{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sentence-form-demo",
  "type": "registry:block",
  "title": "Sentence Form: Project Brief",
  "description": "Natural Language Form example, Project Brief: A design studio's inquiry in large serif type. Type your name and the words after it make room; pick services and each one flies up from the tray while the list grammar (\"a website, a product, and motion\") rearranges around it. Tap an outline in the tray to send a pick back down. Try Other for the timeline, send it half-filled to see the check, then send it for real: the form settles into the note you wrote, with an Edit link. A take on the form (contact form). Fits contact, CTA and events sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "contact",
    "cta",
    "events",
    "form",
    "input",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/sentence-form#sentence-form-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/sentence-form.json"
  ],
  "files": [
    {
      "path": "components/sentence-form-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { SentenceForm, SentenceFormField } from \"@/components/ui/sentence-form\";\n\n// Stands in for a real request.\nconst send = () => new Promise<void>((resolve) => setTimeout(resolve, 1200));\n\nconst firstName = (name: string | string[] | undefined) => String(name ?? \"\").trim().split(/\\s+/)[0];\n\nexport function SentenceFormDemo() {\n  return (\n    <section className=\"w-full max-w-2xl rounded-3xl bg-[#fbfaf7] px-6 py-8 text-stone-900 ring-1 ring-stone-900/[0.07] sm:px-10 sm:py-10 dark:bg-stone-950 dark:text-stone-100 dark:ring-white/10\">\n      <div className=\"flex items-baseline justify-between gap-4 font-mono text-[11px] tracking-[0.16em] text-stone-500 uppercase\">\n        <span>Start a project</span>\n        <span className=\"max-sm:hidden\">Field &amp; Fold Studio</span>\n      </div>\n\n      <SentenceForm\n        onSubmit={send}\n        className=\"mt-6 min-h-[34rem] font-serif text-[23px] leading-[1.45] sm:min-h-[27rem] sm:text-[31px] sm:leading-[1.4]\"\n        submitLabel=\"Send brief\"\n        success={({ values, edit }) => (\n          <p className=\"max-w-md text-pretty text-stone-600 dark:text-stone-400\">\n            Thanks, {firstName(values.name)}. We&apos;ll reply to{\" \"}\n            <span className=\"break-all text-stone-900 dark:text-stone-100\">{values.email}</span> within two\n            working days.{\" \"}\n            <button\n              type=\"button\"\n              onClick={edit}\n              className=\"cursor-pointer rounded-sm font-medium text-stone-900 underline decoration-stone-900/30 underline-offset-4 outline-none hover:decoration-stone-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current dark:text-stone-100 dark:decoration-stone-100/30 dark:hover:decoration-stone-100\"\n            >\n              Edit\n            </button>\n          </p>\n        )}\n      >\n        Hi, I&apos;m{\" \"}\n        <SentenceFormField name=\"name\" label=\"Your name\" placeholder=\"your name\" autoComplete=\"name\" required /> from{\" \"}\n        <SentenceFormField name=\"company\" label=\"Company\" placeholder=\"your company\" autoComplete=\"organization\" />.\n        We&apos;d like help with{\" \"}\n        <SentenceFormField\n          name=\"services\"\n          label=\"What you need\"\n          placeholder=\"a few things\"\n          options={[\"a brand identity\", \"a website\", \"a product\", \"motion\"]}\n          multiple\n          required\n        />\n        , ideally by{\" \"}\n        <SentenceFormField\n          name=\"timeline\"\n          label=\"Timeline\"\n          placeholder=\"when\"\n          options={[\"next month\", \"this summer\", \"the end of the year\"]}\n          custom\n        />\n        . Our budget is around{\" \"}\n        <SentenceFormField\n          name=\"budget\"\n          label=\"Budget\"\n          placeholder=\"how much\"\n          options={[\"$10k\", \"$25k\", \"$50k\", \"$100k+\"]}\n          required\n        />\n        , and you can reach me at{\" \"}\n        <SentenceFormField\n          name=\"email\"\n          label=\"Email\"\n          placeholder=\"you@company.com\"\n          type=\"email\"\n          autoComplete=\"email\"\n          hint=\"Only used to reply\"\n          required\n        />\n        .\n      </SentenceForm>\n    </section>\n  );\n}\n"
    }
  ]
}