{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sentence-form-agent-demo",
  "type": "registry:block",
  "title": "Sentence Form: Demo Request",
  "description": "Natural Language Form example, Demo Request: An AI startup's demo request on a dark panel. Each team option brings its own grammar (\"for just me\", \"for a company of 500+\") and the tools are a pick-any list. Turn on Fail the next send to see the error path: the form keeps every answer and says so beside the button. 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-agent-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/sentence-form.json"
  ],
  "files": [
    {
      "path": "components/sentence-form-agent-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { cn } from \"@/lib/utils\";\nimport { SentenceForm, SentenceFormField } from \"@/components/ui/sentence-form\";\n\nexport function SentenceFormAgentDemo() {\n  const [failNext, setFailNext] = React.useState(false);\n\n  // Stands in for a real request. With the switch on, the next send fails once.\n  const send = () =>\n    new Promise<void>((resolve, reject) =>\n      setTimeout(() => {\n        if (!failNext) return resolve();\n        setFailNext(false);\n        reject(new Error(\"Network error\"));\n      }, 1200),\n    );\n\n  return (\n    <section className=\"relative w-full max-w-2xl overflow-hidden rounded-3xl bg-zinc-950 px-6 py-8 text-zinc-100 ring-1 ring-white/10 sm:px-10 sm:py-10\">\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute -top-40 -right-24 size-96 rounded-full bg-indigo-500/20 blur-3xl\"\n      />\n      <div className=\"relative flex flex-wrap items-center justify-between gap-3\">\n        <span className=\"inline-flex items-center gap-2 text-[13px] font-medium text-zinc-400\">\n          <span aria-hidden className=\"size-1.5 rounded-full bg-indigo-400 shadow-[0_0_10px_2px] shadow-indigo-400/60\" />\n          Book a demo\n        </span>\n        <label className=\"inline-flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-xs font-medium text-zinc-400 select-none hover:bg-white/5\">\n          <input\n            type=\"checkbox\"\n            checked={failNext}\n            onChange={(e) => setFailNext(e.target.checked)}\n            className=\"peer sr-only\"\n          />\n          <span\n            aria-hidden\n            className=\"relative h-4 w-7 rounded-full bg-zinc-700 transition-colors duration-200 peer-checked:bg-rose-500 peer-focus-visible:ring-2 peer-focus-visible:ring-zinc-500\"\n          >\n            <span\n              className={cn(\n                \"absolute top-0.5 left-0.5 size-3 rounded-full bg-white shadow-sm transition-transform duration-200\",\n                failNext && \"translate-x-3\",\n              )}\n            />\n          </span>\n          Fail the next send\n        </label>\n      </div>\n\n      <SentenceForm\n        onSubmit={send}\n        className=\"relative mt-7 min-h-[30rem] text-[22px] leading-[1.5] font-medium tracking-[-0.015em] sm:min-h-[22rem] sm:text-[28px] sm:leading-[1.45]\"\n        submitLabel=\"Request demo\"\n        submitClassName=\"data-[ready=true]:bg-white data-[ready=true]:text-zinc-950 tracking-normal\"\n        trayClassName=\"tracking-normal\"\n        errorMessage=\"Couldn't reach our server. Nothing's lost, so try again.\"\n        success={({ values, reset }) => (\n          <div className=\"flex flex-wrap items-center gap-x-4 gap-y-2 tracking-normal\">\n            <p className=\"inline-flex items-center gap-2 text-zinc-300\">\n              <span aria-hidden className=\"grid size-5 place-items-center rounded-full bg-emerald-400/15 text-emerald-300\">\n                <svg viewBox=\"0 0 16 16\" className=\"size-3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                  <path d=\"m3.5 8.5 3 3 6-7\" />\n                </svg>\n              </span>\n              <span>\n                Demo booked. The invite is on its way to <span className=\"break-all text-white\">{values.email}</span>.\n              </span>\n            </p>\n            <button\n              type=\"button\"\n              onClick={reset}\n              className=\"cursor-pointer rounded-md text-zinc-400 underline decoration-zinc-600 underline-offset-4 outline-none hover:text-white hover:decoration-zinc-400 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-zinc-400\"\n            >\n              Start over\n            </button>\n          </div>\n        )}\n      >\n        I want an agent that handles{\" \"}\n        <SentenceFormField\n          name=\"task\"\n          label=\"Task\"\n          placeholder=\"a task\"\n          options={[\"support tickets\", \"lead research\", \"invoices\", \"meeting notes\"]}\n          custom\n          required\n        />{\" \"}\n        for{\" \"}\n        <SentenceFormField\n          name=\"team\"\n          label=\"Who it's for\"\n          placeholder=\"whom\"\n          options={[\"just me\", \"a team of 10\", \"a company of 500+\"]}\n          required\n        />\n        . It should work with{\" \"}\n        <SentenceFormField\n          name=\"tools\"\n          label=\"Tools\"\n          placeholder=\"your tools\"\n          options={[\"Slack\", \"Gmail\", \"HubSpot\", \"Notion\", \"Linear\", \"Salesforce\"]}\n          multiple\n          required\n        />\n        . Send the demo to{\" \"}\n        <SentenceFormField\n          name=\"email\"\n          label=\"Work email\"\n          placeholder=\"you@company.com\"\n          type=\"email\"\n          autoComplete=\"email\"\n          required\n        />\n        .\n      </SentenceForm>\n    </section>\n  );\n}\n"
    }
  ]
}