{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-url-form",
  "type": "registry:block",
  "title": "Hero, url form",
  "description": "A centred hero: a small pill badge, a large two-line heading, a line under it, then a label and one wide rounded input for a web address with a submit button. On a phone the heading wraps to three lines and the input fills the width.",
  "categories": [
    "hero"
  ],
  "dependencies": [
    "lucide-react@^1.49.0",
    "zod@^4.6.5"
  ],
  "registryDependencies": [
    "https://ui.klarhimmel.com/r/block-kit.json",
    "https://ui.klarhimmel.com/r/button.json",
    "https://ui.klarhimmel.com/r/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-url-form/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-url-form/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, formFields, t } from '../_shared/schema';\n\nconst schema = z.object({\n  /** Where the address goes: the form submits natively (GET, the address as `url`) to this page. Leave it out and it submits to the page it is on. */\n  ...formFields,\n  badge: t(40),\n  title: t(80),\n  description: t(200),\n  label: t(40),\n  submit: t(24),\n  /** Where the form goes, an href-like string; the form submits natively. */\n});\n\nexport const spec = defineSpec({\n  type: 'hero-url-form',\n  aliases: ['hero/url-form'],\n  name: 'Hero, url form',\n  category: 'hero',\n  role: 'body',\n  description: 'A centred hero: a small pill badge, a large two-line heading, a line under it, then a label and one wide rounded input for a web address with a submit button. On a phone the heading wraps to three lines and the input fills the width.',\n  schema,\n  defaults: {\n    badge: 'Name what is new or true now',\n    title: 'Say what the visitor gets in two short lines',\n    description: 'Say in one or two sentences why it matters to the visitor and what they do next.',\n    label: 'Ask for the visitor\\'s address',\n    submit: 'Start',\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-url-form/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-url-form/index.tsx",
      "content": "import { useId } from 'react';\nimport { Sparkles } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { Container, Gate, Section } from '../_shared/kit';\nimport { useHeadingId } from '../_shared/c-proof-kit';\nimport { safeHref } from '../../ui/button';\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 HeroUrlForm({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const field = useId();\n  return (\n    <Section labelledBy={id} className=\"pt-14 pb-20 @3xl:pt-24 @3xl:pb-32\">\n      <Container>\n        <div className=\"mx-auto flex max-w-kh-narrow flex-col items-center text-center\">\n          <span className=\"inline-flex items-center gap-2 rounded-full border border-kh-line bg-kh-surface px-4 py-2 text-kh-small font-medium text-kh-ink\">\n            <Sparkles aria-hidden className=\"size-4 text-kh-accent\" />\n            <Text path={['badge']} value={props.badge} as=\"span\" />\n          </span>\n          <div id={id} className=\"mt-6\">\n            <Text path={['title']} value={props.title} as=\"h2\" className=\"text-kh-display font-bold tracking-tight\" />\n          </div>\n          <Text path={['description']} value={props.description} as=\"p\" multiline className=\"mt-6 max-w-kh-lead text-kh-lead text-kh-muted\" />\n          {/* The label names the field: emptied, the form is not drawn (an unnamed input); the button is drawn only with its label. */}\n          <Gate label={props.label}>\n            <form action={props.action ? safeHref(props.action) : undefined} method={props.method ?? 'get'} className=\"mt-10 flex w-full max-w-md flex-col items-stretch gap-3 @3xl:max-w-lg\">\n              <label htmlFor={field} className=\"text-kh-small font-medium text-kh-ink\">\n                <Text path={['label']} value={props.label} as=\"span\" />\n              </label>\n              <div className=\"flex flex-col gap-3 @md:flex-row\">\n                <input id={field} name=\"url\" type=\"url\" inputMode=\"url\" placeholder=\"https://\"\n                  className=\"h-14 w-full rounded-full border border-kh-line bg-kh-surface px-6 text-kh-body text-kh-ink outline-none focus-visible:ring-2 focus-visible:ring-[var(--kh-accent)]\" />\n                <Gate label={props.submit}>\n                  <button type=\"submit\" className=\"h-14 shrink-0 rounded-full bg-kh-accent px-7 text-kh-body font-semibold text-kh-accent-fg\">\n                    <Text path={['submit']} value={props.submit} as=\"span\" />\n                  </button>\n                </Gate>\n              </div>\n            </form>\n          </Gate>\n        </div>\n      </Container>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroUrlForm);\n"
    }
  ]
}
