{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "newsletter-card",
  "type": "registry:block",
  "title": "Newsletter, card",
  "description": "A card with an image beside the headline and an email capture form.",
  "categories": [
    "newsletter"
  ],
  "dependencies": [
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-d-chrome.json"
  ],
  "files": [
    {
      "path": "src/blocks/newsletter-card/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/newsletter-card/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, formFields, media, t, req } from '../_shared/schema';\n\nconst schema = z.object({\n  eyebrow: t(60),\n  title: t(100),\n  description: t(240),\n  placeholder: req(60),\n  submit: req(24),\n  consent: t(160),\n  media,\n  /** Form wiring: `action` is where the form goes (and a flow edge in Canvas); with `method` it submits natively. See formFields. */\n  ...formFields,\n});\n\nexport const spec = defineSpec({\n  type: 'newsletter-card',\n  aliases: ['newsletter/card'],\n  name: 'Newsletter, card',\n  category: 'newsletter',\n  role: 'body',\n  description: 'A card with an image beside the headline and an email capture form.',\n  schema,\n  defaults: {\n    eyebrow: 'Name the newsletter',\n    title: 'Say what subscribers get by email',\n    description: 'Say in one or two sentences what the emails cover and how often they come.',\n    placeholder: 'Your email address',\n    submit: 'Subscribe',\n    consent: 'Say how the address is kept and how to leave',\n    media: { src: '', alt: \"A picture that suits the newsletter's topic\" },\n  },\n});\n"
    },
    {
      "path": "src/blocks/newsletter-card/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/newsletter-card/index.tsx",
      "content": "import { useId } from 'react';\nimport { Media, Text, withHeadingLevel } from '../../editing';\nimport { Container, Eyebrow, Section } from '../_shared/kit';\nimport { EmailForm } from '../_shared/d-chrome-kit';\nimport { spec } from './spec';\nimport type { BlockProps } from '../types';\nimport type { z } from 'zod';\n\nexport { spec };\ntype Props = z.infer<typeof spec.schema>;\n\nfunction NewsletterCard({ props }: BlockProps<Props>) {\n  const id = useId();\n  return (\n    <Section labelledBy={id}>\n      <Container width=\"narrow\" className=\"@4xl:max-w-kh-page\">\n        <div className=\"grid overflow-hidden rounded-kh-xl border border-kh-line bg-kh-surface shadow-kh-1 @3xl:grid-cols-[1.1fr_0.9fr]\">\n          <div className=\"px-8 py-10 @3xl:px-12 @3xl:py-14\">\n            <Eyebrow path={['eyebrow']} value={props.eyebrow} className=\"mb-3\" />\n            <div id={id}>\n              <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-title font-semibold\" />\n            </div>\n            <Text path={['description']} value={props.description} as=\"p\" className=\"mt-4 text-kh-body text-kh-muted\" />\n            <EmailForm path={[]} placeholder={props.placeholder} submit={props.submit} form={props} size=\"lg\" className=\"mt-8\" />\n            <Text path={['consent']} value={props.consent} as=\"p\" className=\"mt-3 text-kh-caption text-kh-muted\" />\n          </div>\n          <div>\n            <Media path={['media']} value={props.media} ratio=\"4 / 3\" className=\"@3xl:h-full @3xl:!aspect-auto\" />\n          </div>\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(NewsletterCard);\n"
    }
  ]
}
