{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-prompt-box",
  "type": "registry:block",
  "title": "Hero, prompt box",
  "description": "A large dark prompt box with a round send arrow, a row of suggestion chips under it, then a filled button beside a plain link; the two actions stack on a phone.",
  "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/editing.json",
    "https://ui.klarhimmel.com/r/kit-c-proof.json",
    "https://ui.klarhimmel.com/r/kit-form.json"
  ],
  "files": [
    {
      "path": "src/blocks/hero-prompt-box/spec.ts",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-prompt-box/spec.ts",
      "content": "import { z } from 'zod';\nimport { defineSpec, formFields, link, req, t } from '../_shared/schema';\n\nconst chip = z.object({ label: req(32) });\n\nconst schema = z.object({\n  /** Optional: the original has none, so an emptied title draws no heading. */\n  title: t(80),\n  placeholder: req(80),\n  submit: req(24),\n  /** A list is an array field, never a slot. */\n  chips: z.array(chip).max(6),\n  primary: link.partial().optional(),\n  secondary: link.partial().optional(),\n  /** Form wiring: `action` is where the box goes; with `method` it submits natively. See formFields. */\n  ...formFields,\n});\n\nexport const spec = defineSpec({\n  type: 'hero-prompt-box',\n  aliases: ['hero/prompt-box'],\n  name: 'Hero, prompt box',\n  category: 'hero',\n  role: 'body',\n  description: 'A large dark prompt box with a round send arrow, a row of suggestion chips under it, then a filled button beside a plain link; the two actions stack on a phone.',\n  schema,\n  defaults: {\n    title: 'Say what the visitor can make here, in one short line',\n    placeholder: 'Ask the visitor the one question they come here to answer',\n    submit: 'Send',\n    chips: [\n      { label: 'First example' },\n      { label: 'Second example' },\n      { label: 'Third example' },\n      { label: 'Fourth example' },\n    ],\n    primary: { label: 'Start for free', href: '#start' },\n    secondary: { label: 'Learn more', href: '#more' },\n  },\n});\n"
    },
    {
      "path": "src/blocks/hero-prompt-box/index.tsx",
      "type": "registry:file",
      "target": "components/klarhimmel/blocks/hero-prompt-box/index.tsx",
      "content": "import { useId } from 'react';\nimport { ArrowUp } from 'lucide-react';\nimport { Text, withHeadingLevel } from '../../editing';\nimport { ActionLink, Section, useNamed, Gate } from '../_shared/kit';\nimport { useHeadingId } from '../_shared/c-proof-kit';\nimport { FormExtras, useFormProps } from '../_shared/form-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 HeroPromptBox({ props }: BlockProps<Props>) {\n  const id = useHeadingId(props.title);\n  const field = useId();\n  const formProps = useFormProps(props);\n  const named = useNamed(props.placeholder);\n  return (\n    <Section labelledBy={id} className=\"py-16 @3xl:py-28\">\n      <div className=\"mx-auto w-full max-w-[40rem] px-kh-gutter\">\n        <div id={id}>\n          <Text path={['title']} value={props.title} as=\"h2\" className=\"mb-6 text-center text-kh-heading font-semibold\" />\n        </div>\n        {named && (\n          <form {...formProps}>\n            <div className=\"relative flex min-h-40 flex-col rounded-[1.5rem] bg-kh-ink p-5 text-kh-on-ink shadow-kh-3\">\n              <label htmlFor={field} className=\"sr-only\"><Text path={['placeholder']} value={props.placeholder} /></label>\n              <textarea\n                id={field}\n                name=\"prompt\"\n                rows={3}\n                required\n                placeholder={props.placeholder}\n                className=\"min-h-24 w-full flex-1 resize-none bg-transparent text-kh-lead text-kh-on-ink outline-none placeholder:text-kh-on-ink/70 focus-visible:outline-2 focus-visible:outline-(--kh-focus)\"\n              />\n              {props.submit.trim() && <button\n                type=\"submit\"\n                className=\"ml-auto grid size-10 shrink-0 place-items-center rounded-kh-md bg-kh-on-ink/15 text-kh-on-ink focus-visible:outline-2 focus-visible:outline-(--kh-focus)\"\n              >\n                <ArrowUp aria-hidden className=\"size-5\" />\n                <Text path={['submit']} value={props.submit} as=\"span\" className=\"sr-only\" />\n              </button>}\n            </div>\n            <FormExtras {...props} />\n          </form>\n        )}\n        {props.chips.length > 0 && (\n          <ul className=\"mt-5 flex flex-wrap justify-center gap-x-5 gap-y-2 text-kh-caption text-kh-muted\">\n            {props.chips.map((c, i) => (\n              <li key={i}>\n                <Text path={['chips', i, 'label']} value={c.label} as=\"span\" />\n              </li>\n            ))}\n          </ul>\n        )}\n        <Gate label={props.primary?.label || props.secondary?.label}>\n        <div className=\"mt-8 grid gap-3 @md:grid-cols-2\">\n          <ActionLink path={['primary']} value={props.primary} variant=\"primary\" className=\"w-full justify-center\" />\n          {props.secondary && <ActionLink path={['secondary']} value={props.secondary} variant=\"ghost\" className=\"w-full justify-center\" />}\n        </div>\n        </Gate>\n      </div>\n    </Section>\n  );\n}\n\nexport default withHeadingLevel(HeroPromptBox);\n"
    }
  ]
}
