{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sentence-form-cta",
  "type": "registry:block",
  "title": "Sentence Form CTA",
  "description": "CTA Section built with Sentence Form (natural language form): the sign-up form is one sentence to fill in. A take on the form (contact form). A closing call to action where the request-access form is one sentence: \"Hi, I'm ___ from ___.\" Picks fly up into the blanks, and on send the sentence settles into a thank-you that uses the visitor's first name.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "cta-sections",
    "cta",
    "form"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/cta-sections/sentence-form-cta",
  "registryDependencies": [
    "https://keyframeui.com/r/sentence-form.json"
  ],
  "files": [
    {
      "path": "components/sentence-form-cta.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport {\n  SentenceForm,\n  SentenceFormField,\n  type SentenceFormFieldProps,\n  type SentenceFormValues,\n} from \"@/components/ui/sentence-form\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the section yours, including\n * the sentence itself and what each blank asks for.\n * ─────────────────────────────────────────────────────────── */\n\n/** The one accent: the eyebrow, the send button and the icons. */\nconst ACCENT = \"#6e56cf\";\n\nconst EYEBROW = \"Early access\";\nconst HEADLINE = \"Tell us what your agents should do.\";\nconst SUBLINE =\n  \"One sentence is enough. A founder reads every request and replies within a day, usually with a time to talk.\";\n\n/** The blanks. `name` is also the key in the values your request receives. */\nconst BLANKS = {\n  name: { name: \"name\", label: \"Your name\", placeholder: \"your name\", autoComplete: \"name\", required: true },\n  company: {\n    name: \"company\",\n    label: \"Company\",\n    placeholder: \"your company\",\n    autoComplete: \"organization\",\n    required: true,\n  },\n  volume: {\n    name: \"volume\",\n    label: \"Agent runs a day\",\n    placeholder: \"how many\",\n    options: [\"a handful of\", \"hundreds of\", \"thousands of\", \"millions of\"],\n    required: true,\n  },\n  goals: {\n    name: \"goals\",\n    label: \"What you want\",\n    placeholder: \"something better\",\n    options: [\"fewer hallucinations\", \"on-prem\", \"faster evals\", \"lower costs\"],\n    multiple: true,\n    required: true,\n  },\n  email: {\n    name: \"email\",\n    label: \"Work email\",\n    placeholder: \"you@company.com\",\n    type: \"email\",\n    autoComplete: \"email\",\n    hint: \"Only used to reply\",\n    required: true,\n  },\n} satisfies Record<string, SentenceFormFieldProps>;\n\n/** The sentence, with a blank wherever one goes. */\nconst SENTENCE: (string | { blank: keyof typeof BLANKS })[] = [\n  \"Hi, I'm \",\n  { blank: \"name\" },\n  \" from \",\n  { blank: \"company\" },\n  \". We run \",\n  { blank: \"volume\" },\n  \" agents a day and want \",\n  { blank: \"goals\" },\n  \". Reach me at \",\n  { blank: \"email\" },\n  \".\",\n];\n\nconst SUBMIT_LABEL = \"Request access\";\nconst ERROR_MESSAGE = \"That didn't send. Your answers are still here, so try again.\";\n\n/** The thank-you that takes the button's place. */\nconst thanks = (values: SentenceFormValues) => ({\n  lead: `Thanks, ${firstName(values.name)}.`,\n  text: `You're on the list, and we'll write to ${values.email} within a day.`,\n});\n\nconst TRUST_POINTS = [\n  { icon: \"reply\", title: \"A reply within a day\", text: \"From a founder, not an email sequence.\" },\n  { icon: \"shield\", title: \"SOC 2 Type II\", text: \"Audited every year. Your data never trains a model.\" },\n  { icon: \"bolt\", title: \"Live in a week\", text: \"Most teams ship their first agent in five days.\" },\n] as const;\n\n/** Stands in for your request: send the values to your API, CRM or inbox here. */\nasync function requestAccess(values: SentenceFormValues) {\n  void values;\n  await new Promise((resolve) => setTimeout(resolve, 900));\n}\n\n/* ── Section ─────────────────────────────────────────────── */\n\nfunction firstName(name: string | string[] | undefined) {\n  return String(name ?? \"\").trim().split(/\\s+/)[0];\n}\n\nconst focusRing =\n  \"focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent)\";\n\nexport function SentenceFormCta() {\n  return (\n    <section\n      style={{ \"--accent\": ACCENT } as React.CSSProperties}\n      // The form's send button falls back to the shadcn theme colors; point them at this palette.\n      className=\"relative isolate overflow-hidden bg-white text-zinc-950 [--background:#ffffff] [--foreground:#09090b] dark:bg-zinc-950 dark:text-white dark:[--background:#09090b] dark:[--foreground:#fafafa]\"\n    >\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute -top-48 right-[-12rem] -z-10 size-[36rem] rounded-full bg-(--accent)/15 blur-[120px] dark:bg-(--accent)/25\"\n      />\n\n      {/* Phones: copy, form, trust points. Tablets: the trust points move above the form. From lg the\n          form takes the right column, so it can grow as it's filled in without moving anything. */}\n      <div className=\"mx-auto grid max-w-6xl gap-12 px-6 py-24 sm:py-32 lg:grid-cols-[minmax(0,5fr)_minmax(0,7fr)] lg:grid-rows-[auto_1fr] lg:gap-x-16 lg:gap-y-12\">\n        <div className=\"sm:order-1 lg:order-none lg:col-start-1 lg:row-start-1 lg:pt-4\">\n          <p className=\"inline-flex items-center gap-2 rounded-full bg-(--accent)/10 py-1 pr-3 pl-2.5 text-sm font-medium text-(--accent) dark:text-[color-mix(in_oklab,var(--accent),white_45%)]\">\n            <span aria-hidden className=\"size-1.5 rounded-full bg-current\" />\n            {EYEBROW}\n          </p>\n          <h2 className=\"mt-5 max-w-[14ch] text-4xl/[1.05] font-semibold tracking-[-0.03em] text-balance sm:text-5xl/[1.02] lg:text-6xl/[1]\">\n            {HEADLINE}\n          </h2>\n          <p className=\"mt-6 max-w-md text-base/7 text-pretty text-zinc-600 sm:text-lg/8 dark:text-zinc-400\">\n            {SUBLINE}\n          </p>\n        </div>\n\n        <div className=\"rounded-3xl bg-zinc-50 p-6 ring-1 ring-zinc-950/[0.06] sm:order-3 sm:p-10 lg:order-none lg:col-start-2 lg:row-span-2 lg:row-start-1 lg:self-start dark:bg-white/[0.03] dark:ring-white/10\">\n          <SentenceForm\n            onSubmit={requestAccess}\n            className=\"text-[22px]/[1.5] font-medium tracking-[-0.015em] sm:text-[28px]/[1.45]\"\n            submitLabel={SUBMIT_LABEL}\n            submitClassName=\"tracking-normal data-[ready=true]:bg-(--accent) data-[ready=true]:text-white\"\n            trayClassName=\"tracking-normal\"\n            errorMessage={ERROR_MESSAGE}\n            success={({ values, edit }) => {\n              const message = thanks(values);\n              return (\n                <div className=\"flex items-start gap-3 text-base/7 tracking-normal\">\n                  <span\n                    aria-hidden\n                    className=\"mt-0.5 grid size-6 shrink-0 place-items-center rounded-full bg-(--accent) text-white\"\n                  >\n                    <CheckIcon className=\"size-3.5\" />\n                  </span>\n                  <p className=\"text-pretty text-zinc-600 dark:text-zinc-400\">\n                    <span className=\"font-semibold text-zinc-950 dark:text-white\">{message.lead}</span>{\" \"}\n                    {message.text}{\" \"}\n                    <button\n                      type=\"button\"\n                      onClick={edit}\n                      className={`cursor-pointer rounded-sm font-medium text-zinc-950 underline decoration-zinc-950/30 underline-offset-4 hover:decoration-zinc-950 dark:text-white dark:decoration-white/30 dark:hover:decoration-white ${focusRing}`}\n                    >\n                      Edit\n                    </button>\n                  </p>\n                </div>\n              );\n            }}\n          >\n            {SENTENCE.map((part, i) =>\n              typeof part === \"string\" ? part : <SentenceFormField key={i} {...BLANKS[part.blank]} />,\n            )}\n          </SentenceForm>\n        </div>\n\n        <ul className=\"grid gap-6 border-t border-zinc-950/10 pt-8 sm:order-2 sm:grid-cols-3 lg:order-none lg:col-start-1 lg:row-start-2 lg:grid-cols-1 lg:self-start dark:border-white/10\">\n          {TRUST_POINTS.map((point) => (\n            <li key={point.title} className=\"flex gap-3.5\">\n              <span\n                aria-hidden\n                className=\"grid size-9 shrink-0 place-items-center rounded-xl bg-(--accent)/10 text-(--accent) dark:text-[color-mix(in_oklab,var(--accent),white_45%)]\"\n              >\n                <TrustIcon icon={point.icon} />\n              </span>\n              <div>\n                <p className=\"font-medium\">{point.title}</p>\n                <p className=\"mt-1 text-sm/6 text-pretty text-zinc-600 dark:text-zinc-400\">{point.text}</p>\n              </div>\n            </li>\n          ))}\n        </ul>\n      </div>\n    </section>\n  );\n}\n\n/* ── Icons ───────────────────────────────────────────────── */\n\nfunction TrustIcon({ icon }: { icon: (typeof TRUST_POINTS)[number][\"icon\"] }) {\n  const paths = {\n    reply: \"M4 5.5A2.5 2.5 0 0 1 6.5 3h7A2.5 2.5 0 0 1 16 5.5v5a2.5 2.5 0 0 1-2.5 2.5H9l-3.5 3v-3h0A1.5 1.5 0 0 1 4 11.5Z\",\n    shield: \"M10 2.5 4 4.75v4.6c0 3.7 2.55 6.6 6 8.15 3.45-1.55 6-4.45 6-8.15v-4.6L10 2.5ZM7.5 10l1.75 1.75L12.75 8\",\n    bolt: \"M11 2.5 4.5 11h5l-1 6.5L15 9h-5l1-6.5Z\",\n  };\n  return (\n    <svg viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" className=\"size-[18px]\">\n      <path d={paths[icon]} />\n    </svg>\n  );\n}\n\nfunction CheckIcon({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden className={className}>\n      <path d=\"m3.5 8.5 3 3 6-7\" />\n    </svg>\n  );\n}\n"
    }
  ]
}