{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sentence-form-rsvp-demo",
  "type": "registry:block",
  "title": "Sentence Form: Event RSVP",
  "description": "Natural Language Form example, Event RSVP: An invitation reply with a clause that depends on an answer. Pick \"with a guest\" and \" named ___\" rises in after it while the words after it glide aside; switch back and the clause folds away. The dinner choice starts filled in through a default value. 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-rsvp-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/sentence-form.json"
  ],
  "files": [
    {
      "path": "components/sentence-form-rsvp-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, 1000));\n\nexport function SentenceFormRsvpDemo() {\n  return (\n    <section className=\"w-full max-w-xl rounded-3xl bg-[#fff7f2] px-6 py-8 text-[#3b1d14] ring-1 ring-[#3b1d14]/10 sm:px-10 sm:py-10 dark:bg-[#1c1311] dark:text-[#f6e7df] dark:ring-white/10\">\n      <header className=\"border-b border-current/15 pb-5\">\n        <p className=\"font-mono text-[11px] tracking-[0.16em] uppercase opacity-60\">Thursday 19 June · 7 pm</p>\n        <h3 className=\"mt-2 font-serif text-2xl italic\">Midsummer supper at the studio</h3>\n      </header>\n\n      <SentenceForm\n        onSubmit={send}\n        className=\"mt-6 min-h-[32rem] font-serif text-[22px] leading-[1.5] sm:min-h-[21rem] sm:text-[26px]\"\n        submitLabel=\"RSVP\"\n        submitClassName=\"data-[ready=true]:bg-[#3b1d14] data-[ready=true]:text-[#fff7f2] dark:data-[ready=true]:bg-[#f6e7df] dark:data-[ready=true]:text-[#1c1311]\"\n        success={({ values, edit }) => (\n          <p className=\"text-pretty opacity-80\">\n            See you on the 19th\n            {values.party === \"with a guest\" && values.guest ? <>, and {values.guest} too</> : null}. Details are on\n            their way.{\" \"}\n            <button\n              type=\"button\"\n              onClick={edit}\n              className=\"cursor-pointer rounded-sm font-medium underline decoration-current/30 underline-offset-4 outline-none hover:decoration-current focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-current\"\n            >\n              Change my reply\n            </button>\n          </p>\n        )}\n      >\n        {(values) => (\n          <>\n            Count me in. I&apos;m{\" \"}\n            <SentenceFormField name=\"name\" label=\"Your name\" placeholder=\"your name\" autoComplete=\"name\" required />,\n            and I&apos;m coming{\" \"}\n            <SentenceFormField\n              name=\"party\"\n              label=\"Coming\"\n              placeholder=\"with whom\"\n              options={[\"on my own\", \"with a guest\"]}\n              required\n            />\n            {values.party === \"with a guest\" ? (\n              <>\n                {\" \"}\n                named{\" \"}\n                <SentenceFormField name=\"guest\" label=\"Guest's name\" placeholder=\"their name\" required />\n              </>\n            ) : null}\n            . I&apos;ll have the{\" \"}\n            <SentenceFormField\n              name=\"menu\"\n              label=\"Dinner\"\n              options={[\"roast chicken\", \"wild mushroom risotto\", \"grilled sea bass\"]}\n              defaultValue=\"wild mushroom risotto\"\n            />\n            . Send the details to{\" \"}\n            <SentenceFormField\n              name=\"email\"\n              label=\"Email\"\n              placeholder=\"you@email.com\"\n              type=\"email\"\n              autoComplete=\"email\"\n              required\n            />\n            .\n          </>\n        )}\n      </SentenceForm>\n    </section>\n  );\n}\n"
    }
  ]
}