{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "spotlight-tour-form-demo",
  "type": "registry:block",
  "title": "Spotlight Tour: Form Help",
  "description": "Product Tour Overlay example, Form Help: A sign-up form that explains each field in turn. You can type into each field while it's highlighted. A take on the product tour (walkthrough) and tooltip (popover). Fits onboarding, changelog and app UI sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "onboarding",
    "changelog",
    "app-ui",
    "product-tour",
    "tooltip",
    "overlay",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/spotlight-tour#spotlight-tour-form-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/spotlight-tour.json"
  ],
  "files": [
    {
      "path": "components/spotlight-tour-form-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { SpotlightTour, type SpotlightTourStep } from \"@/components/ui/spotlight-tour\";\n\n// Each field stays typable while it's highlighted.\nconst steps: SpotlightTourStep[] = [\n  {\n    target: \"[data-tour=signup-name]\",\n    title: \"Your name\",\n    body: \"This is how teammates see you in comments and mentions.\",\n    side: \"right\",\n    padding: 6,\n    interactive: true,\n  },\n  {\n    target: \"[data-tour=signup-email]\",\n    title: \"Use your work email\",\n    body: \"So teammates can find you, and you join your company's workspace automatically.\",\n    side: \"right\",\n    padding: 6,\n    interactive: true,\n  },\n  {\n    target: \"[data-tour=signup-password]\",\n    title: \"Pick a password\",\n    body: \"At least 12 characters. A short sentence is easier to remember than symbols.\",\n    side: \"right\",\n    padding: 6,\n    interactive: true,\n  },\n  {\n    target: \"[data-tour=signup-workspace]\",\n    title: \"Name your workspace\",\n    body: \"It becomes your address. You can change it later in settings.\",\n    side: \"right\",\n    padding: 6,\n    interactive: true,\n  },\n  {\n    target: \"[data-tour=signup-submit]\",\n    title: \"You're ready\",\n    body: \"Create the workspace, then invite your team on the next screen.\",\n    side: \"right\",\n    padding: 6,\n  },\n];\n\nfunction strength(password: string) {\n  let score = 0;\n  if (password.length >= 8) score++;\n  if (password.length >= 12) score++;\n  if (/[A-Z]/.test(password) && /[a-z]/.test(password)) score++;\n  if (/[\\d\\s\\W]/.test(password)) score++;\n  return password ? Math.max(score, 1) : 0;\n}\n\nconst meter = [\"\", \"bg-rose-500\", \"bg-amber-500\", \"bg-lime-500\", \"bg-emerald-500\"];\n\nconst field =\n  \"h-10 w-full rounded-lg bg-white px-3 text-sm text-zinc-900 ring-1 ring-zinc-900/10 transition-shadow outline-none placeholder:text-zinc-400 focus:ring-2 focus:ring-zinc-900 dark:bg-zinc-950 dark:text-zinc-50 dark:ring-white/10 dark:focus:ring-zinc-100\";\nconst label = \"mb-1.5 block text-sm font-medium text-zinc-900 dark:text-zinc-100\";\n\nexport function SpotlightTourFormDemo() {\n  const [open, setOpen] = React.useState(false);\n  const [password, setPassword] = React.useState(\"\");\n  const [workspace, setWorkspace] = React.useState(\"\");\n  const [visible, setVisible] = React.useState(false);\n  const [created, setCreated] = React.useState(false);\n  const score = strength(password);\n\n  React.useEffect(() => {\n    if (!created) return;\n    const timer = window.setTimeout(() => setCreated(false), 2200);\n    return () => window.clearTimeout(timer);\n  }, [created]);\n\n  return (\n    <div className=\"w-full max-w-sm rounded-2xl border border-zinc-200 bg-zinc-50 p-6 dark:border-zinc-800 dark:bg-zinc-900\">\n      <div className=\"flex items-start justify-between gap-4\">\n        <div>\n          <h2 className=\"text-lg font-semibold tracking-tight text-zinc-900 dark:text-zinc-50\">Create your workspace</h2>\n          <p className=\"mt-1 text-sm text-zinc-500\">Free for teams of up to 5.</p>\n        </div>\n        <button\n          type=\"button\"\n          onClick={() => setOpen(true)}\n          className=\"mt-0.5 shrink-0 rounded-md text-sm font-medium text-zinc-500 underline decoration-zinc-300 underline-offset-4 transition-colors hover:text-zinc-900 hover:decoration-zinc-900 dark:decoration-zinc-700 dark:hover:text-zinc-50 dark:hover:decoration-zinc-50\"\n        >\n          Guide me\n        </button>\n      </div>\n\n      <form\n        className=\"mt-6 space-y-4\"\n        onSubmit={(event) => {\n          event.preventDefault();\n          setCreated(true);\n        }}\n      >\n        <div>\n          <label htmlFor=\"signup-name\" className={label}>\n            Full name\n          </label>\n          <input id=\"signup-name\" data-tour=\"signup-name\" autoComplete=\"name\" placeholder=\"Jordan Lee\" className={field} />\n        </div>\n\n        <div>\n          <label htmlFor=\"signup-email\" className={label}>\n            Work email\n          </label>\n          <input\n            id=\"signup-email\"\n            data-tour=\"signup-email\"\n            type=\"email\"\n            autoComplete=\"email\"\n            placeholder=\"jordan@company.com\"\n            className={field}\n          />\n        </div>\n\n        <div>\n          <label htmlFor=\"signup-password\" className={label}>\n            Password\n          </label>\n          <div data-tour=\"signup-password\" className=\"rounded-lg\">\n            <div className=\"relative\">\n              <input\n                id=\"signup-password\"\n                type={visible ? \"text\" : \"password\"}\n                autoComplete=\"new-password\"\n                value={password}\n                onChange={(event) => setPassword(event.target.value)}\n                className={`${field} pr-16`}\n              />\n              <button\n                type=\"button\"\n                onClick={() => setVisible((on) => !on)}\n                className=\"absolute top-1/2 right-2 -translate-y-1/2 rounded px-1.5 py-0.5 text-xs font-medium text-zinc-500 hover:text-zinc-900 dark:hover:text-zinc-50\"\n              >\n                {visible ? \"Hide\" : \"Show\"}\n              </button>\n            </div>\n            <div aria-hidden className=\"mt-2 grid grid-cols-4 gap-1\">\n              {[1, 2, 3, 4].map((bar) => (\n                <span\n                  key={bar}\n                  className={`h-1 rounded-full transition-colors duration-300 ${bar <= score ? meter[score] : \"bg-zinc-200 dark:bg-zinc-800\"}`}\n                />\n              ))}\n            </div>\n          </div>\n        </div>\n\n        <div>\n          <label htmlFor=\"signup-workspace\" className={label}>\n            Workspace\n          </label>\n          <div\n            data-tour=\"signup-workspace\"\n            className=\"flex h-10 items-center rounded-lg bg-white text-sm ring-1 ring-zinc-900/10 transition-shadow focus-within:ring-2 focus-within:ring-zinc-900 dark:bg-zinc-950 dark:ring-white/10 dark:focus-within:ring-zinc-100\"\n          >\n            <span className=\"pl-3 text-zinc-400\">pulse.app/</span>\n            <input\n              id=\"signup-workspace\"\n              value={workspace}\n              onChange={(event) => setWorkspace(event.target.value.toLowerCase().replace(/[^a-z0-9-]/g, \"\"))}\n              placeholder=\"acme\"\n              className=\"h-full min-w-0 flex-1 bg-transparent pr-3 text-zinc-900 outline-none placeholder:text-zinc-400 dark:text-zinc-50\"\n            />\n          </div>\n        </div>\n\n        <button\n          data-tour=\"signup-submit\"\n          type=\"submit\"\n          className=\"h-10 w-full rounded-lg bg-zinc-900 text-sm font-medium text-white transition-[background-color,scale] duration-150 hover:bg-zinc-800 active:scale-[0.98] dark:bg-zinc-50 dark:text-zinc-900 dark:hover:bg-zinc-200\"\n        >\n          {created ? \"Workspace created\" : \"Create workspace\"}\n        </button>\n      </form>\n\n      <SpotlightTour open={open} onOpenChange={setOpen} steps={steps} />\n    </div>\n  );\n}\n"
    }
  ]
}