{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "form-wizard",
  "type": "registry:component",
  "title": "Wizard Form",
  "description": "A four step onboarding wizard with a segmented progress rail, direction aware slides and a review step with edit links. Creating the workspace plays a short setup checklist.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "forms",
    "form",
    "wizard",
    "multi-step",
    "onboarding",
    "progress",
    "stepper"
  ],
  "docs": "https://hyperblur.dev/effects/form-wizard",
  "files": [
    {
      "path": "registry/hyperblur/form-wizard.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/form-wizard.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FormWizardValues {\n  workspace: string;\n  slug: string;\n  size: string;\n  teams: string[];\n  invites: string[];\n}\n\nexport interface FormWizardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onSubmit\"> {\n  domain?: string;\n  sizes?: string[];\n  teams?: string[];\n  maxInvites?: number;\n  accent?: string;\n  defaultStep?: number;\n  defaultValues?: Partial<FormWizardValues>;\n  onStepChange?: (step: number) => void;\n  onSubmit?: (values: FormWizardValues) => void | Promise<void>;\n}\n\nconst steps = [\"Workspace\", \"Team\", \"Invite\", \"Review\"];\n\nconst css = `\n.hb-xh3 {\n  --hb-xh3-a: #14b8a6;\n  box-sizing: border-box;\n  width: 100%;\n  max-width: 460px;\n  margin: 0 auto;\n  font-family: inherit;\n  color: #ededed;\n}\n.hb-xh3 *, .hb-xh3 *::before, .hb-xh3 *::after { box-sizing: border-box; }\n.hb-xh3-card {\n  overflow: hidden;\n  border: 1px solid #262626;\n  border-radius: 18px;\n  background: #101010;\n  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 28px 56px -28px rgba(0,0,0,0.85);\n}\n.hb-xh3-top { padding: 18px 20px 16px; border-bottom: 1px solid #1f1f1f; background: linear-gradient(180deg, #141414, #101010); }\n.hb-xh3-meta { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }\n.hb-xh3-step { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hb-xh3-a); }\n.hb-xh3-pct { font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; color: #8f8f8f; font-variant-numeric: tabular-nums; }\n.hb-xh3-rail { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }\n.hb-xh3-seg { display: grid; gap: 7px; padding: 0; border: 0; background: none; text-align: left; color: #6b6b6b; font: inherit; font-size: 11.5px; cursor: default; }\n.hb-xh3-seg[data-reach=\"true\"] { cursor: pointer; color: #a1a1a1; }\n.hb-xh3-seg[aria-current=\"step\"] { color: #ededed; }\n.hb-xh3-seg:focus-visible { outline: 2px solid var(--hb-xh3-a); outline-offset: 3px; border-radius: 4px; }\n.hb-xh3-track { position: relative; height: 4px; border-radius: 4px; background: #222; overflow: hidden; }\n.hb-xh3-track i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--hb-xh3-a) 70%, #000), var(--hb-xh3-a)); transform-origin: left; transform: scaleX(var(--hb-xh3-f, 0)); transition: transform 0.55s cubic-bezier(0.65, 0, 0.35, 1); box-shadow: 0 0 12px var(--hb-xh3-a); }\n.hb-xh3-body { position: relative; min-height: 232px; padding: 20px; }\n.hb-xh3-pane { display: grid; gap: 14px; animation: hb-xh3-next 0.42s cubic-bezier(0.22, 1, 0.36, 1); }\n.hb-xh3-pane[data-dir=\"back\"] { animation-name: hb-xh3-back; }\n.hb-xh3-h { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }\n.hb-xh3-p { margin: -8px 0 0; font-size: 13px; color: #8f8f8f; line-height: 1.45; }\n.hb-xh3-field { display: grid; gap: 6px; }\n.hb-xh3-label { font-size: 12px; font-weight: 500; color: #b0b0b0; }\n.hb-xh3-box { display: flex; align-items: center; min-height: 40px; border: 1px solid #272727; border-radius: 10px; background: #0b0b0b; transition: border-color 0.2s ease, box-shadow 0.2s ease; }\n.hb-xh3-box:focus-within { border-color: var(--hb-xh3-a); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-xh3-a) 20%, transparent); }\n.hb-xh3-box[data-bad=\"true\"] { border-color: #f05260; box-shadow: 0 0 0 3px rgba(240,82,96,0.12); }\n.hb-xh3-pre { padding-left: 12px; font-size: 13.5px; color: #5c5c5c; white-space: nowrap; }\n.hb-xh3-in { flex: 1; min-width: 80px; height: 38px; padding: 0 12px; border: 0; outline: 0; background: transparent; color: #ededed; font: inherit; font-size: 14px; }\n.hb-xh3-pre + .hb-xh3-in { padding-left: 1px; }\n.hb-xh3-in::placeholder { color: #555; }\n.hb-xh3-err { margin: 0; font-size: 12px; color: #ff8a95; animation: hb-xh3-fade 0.2s ease-out; }\n.hb-xh3-help { margin: 0; font-size: 12px; color: #737373; }\n.hb-xh3-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }\n.hb-xh3-size { position: relative; display: grid; gap: 2px; justify-items: center; padding: 12px 4px 10px; border: 1px solid #262626; border-radius: 12px; background: #0d0d0d; color: #bdbdbd; font: inherit; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); }\n.hb-xh3-size:hover { border-color: #363636; }\n.hb-xh3-size:active { transform: scale(0.97); }\n.hb-xh3-size[aria-checked=\"true\"] { border-color: var(--hb-xh3-a); background: color-mix(in srgb, var(--hb-xh3-a) 9%, #0d0d0d); color: #fff; }\n.hb-xh3-size:focus-visible { outline: 2px solid var(--hb-xh3-a); outline-offset: 2px; }\n.hb-xh3-size b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-xh3-size small { font-size: 10.5px; color: #7a7a7a; }\n.hb-xh3-heads { display: flex; gap: 2px; height: 14px; align-items: flex-end; margin-bottom: 4px; }\n.hb-xh3-heads i { width: 5px; border-radius: 3px 3px 1px 1px; background: currentColor; opacity: 0.55; }\n.hb-xh3-size[aria-checked=\"true\"] .hb-xh3-heads i { background: var(--hb-xh3-a); opacity: 1; }\n.hb-xh3-chips { display: flex; flex-wrap: wrap; gap: 6px; }\n.hb-xh3-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border: 1px solid #2a2a2a; border-radius: 999px; background: #121212; color: #b9b9b9; font: inherit; font-size: 12.5px; cursor: pointer; transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1); }\n.hb-xh3-chip:hover { border-color: #3a3a3a; color: #e5e5e5; }\n.hb-xh3-chip[aria-pressed=\"true\"] { border-color: color-mix(in srgb, var(--hb-xh3-a) 60%, #2a2a2a); background: color-mix(in srgb, var(--hb-xh3-a) 14%, #121212); color: #fff; }\n.hb-xh3-chip:focus-visible { outline: 2px solid var(--hb-xh3-a); outline-offset: 2px; }\n.hb-xh3-chip svg { width: 12px; height: 12px; }\n.hb-xh3-tagbox { flex-wrap: wrap; gap: 6px; padding: 6px; }\n.hb-xh3-tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 9px; border-radius: 7px; background: #1b1b1b; border: 1px solid #2c2c2c; font-size: 12.5px; color: #e0e0e0; animation: hb-xh3-pop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }\n.hb-xh3-tag[data-bad=\"true\"] { border-color: rgba(240,82,96,0.5); background: rgba(240,82,96,0.08); color: #ffa1a9; }\n.hb-xh3-tag button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 5px; background: transparent; color: inherit; opacity: 0.6; cursor: pointer; }\n.hb-xh3-tag button:hover { opacity: 1; background: rgba(255,255,255,0.08); }\n.hb-xh3-tag button:focus-visible { outline: 2px solid var(--hb-xh3-a); opacity: 1; }\n.hb-xh3-tagbox .hb-xh3-in { height: 26px; padding: 0 6px; }\n.hb-xh3-review { display: grid; margin: 0; border: 1px solid #222; border-radius: 12px; overflow: hidden; }\n.hb-xh3-review div { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid #1e1e1e; font-size: 13px; }\n.hb-xh3-review div:first-child { border-top: 0; }\n.hb-xh3-review dt { color: #7d7d7d; font-size: 12px; }\n.hb-xh3-review dd { margin: 0; color: #e8e8e8; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-xh3-edit { padding: 2px 6px; border: 0; border-radius: 6px; background: none; color: var(--hb-xh3-a); font: inherit; font-size: 12px; cursor: pointer; }\n.hb-xh3-edit:hover { background: color-mix(in srgb, var(--hb-xh3-a) 12%, transparent); }\n.hb-xh3-edit:focus-visible { outline: 2px solid var(--hb-xh3-a); }\n.hb-xh3-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px; border-top: 1px solid #1f1f1f; background: #0d0d0d; }\n.hb-xh3-ghost { height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: #a1a1a1; font: inherit; font-size: 13px; cursor: pointer; transition: color 0.2s ease, background 0.2s ease; }\n.hb-xh3-ghost:hover:not(:disabled) { color: #ededed; background: #181818; }\n.hb-xh3-ghost:disabled { opacity: 0; pointer-events: none; }\n.hb-xh3-ghost:focus-visible { outline: 2px solid var(--hb-xh3-a); }\n.hb-xh3-right { display: flex; gap: 6px; align-items: center; }\n.hb-xh3-next { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 16px; border: 0; border-radius: 10px; background: var(--hb-xh3-a); color: #04201d; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), 0 6px 16px -6px var(--hb-xh3-a); transition: transform 0.15s cubic-bezier(0.3, 0.7, 0.4, 1), filter 0.2s ease; }\n.hb-xh3-next:hover { filter: brightness(1.08); }\n.hb-xh3-next:active { transform: scale(0.97); }\n.hb-xh3-next:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }\n.hb-xh3-next svg { width: 15px; height: 15px; transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }\n.hb-xh3-next:hover svg { transform: translateX(2px); }\n.hb-xh3-launch { display: grid; gap: 16px; padding: 24px 20px 22px; animation: hb-xh3-fade 0.4s ease-out; }\n.hb-xh3-launch h3 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }\n.hb-xh3-launch > p { margin: -10px 0 0; font-size: 13px; color: #8f8f8f; }\n.hb-xh3-tasks { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-xh3-task { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; background: #141414; font-size: 13px; color: #6f6f6f; transition: color 0.3s ease, background 0.3s ease; }\n.hb-xh3-task[data-s=\"run\"] { color: #ededed; background: #181818; }\n.hb-xh3-task[data-s=\"done\"] { color: #cfcfcf; }\n.hb-xh3-ico { position: relative; display: grid; place-items: center; width: 18px; height: 18px; flex: none; border-radius: 50%; border: 1.5px solid #333; }\n.hb-xh3-task[data-s=\"run\"] .hb-xh3-ico { border-color: #333; border-top-color: var(--hb-xh3-a); animation: hb-xh3-rot 0.8s linear infinite; }\n.hb-xh3-task[data-s=\"done\"] .hb-xh3-ico { border-color: var(--hb-xh3-a); background: var(--hb-xh3-a); animation: hb-xh3-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }\n.hb-xh3-ico svg { width: 10px; height: 10px; stroke: #04201d; }\n.hb-xh3-open { justify-self: start; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; background: #f5f5f5; color: #0a0a0a; font-size: 13.5px; font-weight: 600; text-decoration: none; animation: hb-xh3-fade 0.4s ease-out; }\n.hb-xh3-open:hover { background: #fff; }\n.hb-xh3-open:focus-visible { outline: 2px solid var(--hb-xh3-a); outline-offset: 2px; }\n@keyframes hb-xh3-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xh3-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xh3-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }\n@keyframes hb-xh3-pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }\n@keyframes hb-xh3-rot { to { transform: rotate(360deg); } }\n@container (max-width: 380px) { .hb-xh3-sizes { grid-template-columns: repeat(2, 1fr); } }\n.hb-xh3 { container-type: inline-size; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xh3 *, .hb-xh3 *::before, .hb-xh3 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst emailRe = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/;\n\nfunction slugify(text: string) {\n  return text.toLowerCase().trim().replace(/[^a-z0-9]+/g, \"-\").replace(/^-+|-+$/g, \"\").slice(0, 32);\n}\n\nfunction sizeBars(i: number) {\n  return Array.from({ length: i + 1 }, (_, k) => 6 + ((k * 5 + i * 3) % 8));\n}\n\nexport function FormWizard({\n  domain = \"app.tempo.so/\",\n  sizes = [\"Just me\", \"2-10\", \"11-50\", \"51+\"],\n  teams = [\"Design\", \"Engineering\", \"Product\", \"Marketing\", \"Ops\"],\n  maxInvites = 5,\n  accent = \"#14b8a6\",\n  defaultStep = 0,\n  defaultValues,\n  onStepChange,\n  onSubmit,\n  className,\n  style,\n  ...rest\n}: FormWizardProps) {\n  const uid = React.useId();\n  const [step, setStep] = React.useState(Math.min(3, Math.max(0, defaultStep)));\n  const [dir, setDir] = React.useState<\"next\" | \"back\">(\"next\");\n  const [v, setV] = React.useState<FormWizardValues>({\n    workspace: defaultValues?.workspace ?? \"\",\n    slug: defaultValues?.slug ?? slugify(defaultValues?.workspace ?? \"\"),\n    size: defaultValues?.size ?? \"\",\n    teams: defaultValues?.teams ?? [],\n    invites: defaultValues?.invites ?? [],\n  });\n  const [slugEdited, setSlugEdited] = React.useState(Boolean(defaultValues?.slug));\n  const [draft, setDraft] = React.useState(\"\");\n  const [tried, setTried] = React.useState<Record<number, boolean>>({});\n  const [phase, setPhase] = React.useState(-1);\n  const timers = React.useRef<number[]>([]);\n  const first = React.useRef<HTMLInputElement | null>(null);\n\n  React.useEffect(() => {\n    const list = timers.current;\n    return () => list.forEach((t) => window.clearTimeout(t));\n  }, []);\n\n  const errs: Record<string, string> = {};\n  if (v.workspace.trim().length < 2) errs.workspace = \"Give your workspace a name.\";\n  if (v.slug.length < 3) errs.slug = \"Use at least 3 characters.\";\n  if (!v.size) errs.size = \"Pick the closest team size.\";\n  if (!v.teams.length) errs.teams = \"Choose at least one team.\";\n  const badInvites = v.invites.filter((e) => !emailRe.test(e));\n  if (badInvites.length) errs.invites = `${badInvites.length === 1 ? \"One address looks\" : `${badInvites.length} addresses look`} wrong.`;\n  const stepKeys = [[\"workspace\", \"slug\"], [\"size\", \"teams\"], [\"invites\"], []];\n  const stepOk = (s: number) => stepKeys[s].every((k) => !errs[k]);\n  const reach = (s: number) => Array.from({ length: s }, (_, i) => i).every(stepOk);\n\n  const go = (to: number) => {\n    setDir(to > step ? \"next\" : \"back\");\n    setStep(to);\n    onStepChange?.(to);\n  };\n\n  const launch = async () => {\n    setPhase(0);\n    const tasks = 3;\n    for (let i = 1; i <= tasks; i++) {\n      timers.current.push(window.setTimeout(() => setPhase(i), i * 700));\n    }\n    await Promise.resolve(onSubmit?.(v));\n  };\n\n  const next = (e?: React.FormEvent) => {\n    e?.preventDefault();\n    if (!stepOk(step)) {\n      setTried((t) => ({ ...t, [step]: true }));\n      return;\n    }\n    if (step === 3) {\n      launch();\n      return;\n    }\n    go(step + 1);\n  };\n\n  const addInvite = (raw: string) => {\n    const parts = raw.split(/[\\s,;]+/).map((s) => s.trim().toLowerCase()).filter(Boolean);\n    if (!parts.length) return;\n    setV((s) => ({ ...s, invites: [...s.invites, ...parts.filter((p) => !s.invites.includes(p))].slice(0, maxInvites) }));\n    setDraft(\"\");\n  };\n\n  const err = (k: string) => (tried[step] && errs[k] ? <p className=\"hb-xh3-err\" role=\"alert\">{errs[k]}</p> : null);\n  const fraction = phase >= 0 ? 1 : step / steps.length;\n\n  const check = (\n    <svg viewBox=\"0 0 12 12\" fill=\"none\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"m2.5 6.2 2.3 2.3 4.7-5\" /></svg>\n  );\n\n  if (phase >= 0) {\n    const tasks = [`Creating ${v.workspace.trim()}`, v.invites.length ? `Inviting ${v.invites.length} teammate${v.invites.length > 1 ? \"s\" : \"\"}` : \"Preparing your inbox\", `Setting up ${v.teams.length} team space${v.teams.length > 1 ? \"s\" : \"\"}`];\n    return (\n      <div className={[\"hb-xh3\", className].filter(Boolean).join(\" \")} style={{ ...style, \"--hb-xh3-a\": accent } as React.CSSProperties} {...rest}>\n        <style href=\"hb-form-wizard\" precedence=\"default\">{css}</style>\n        <div className=\"hb-xh3-card\">\n          <div className=\"hb-xh3-launch\" role=\"status\" aria-live=\"polite\">\n            <h3>{phase >= 3 ? \"Your workspace is ready\" : \"Setting things up\"}</h3>\n            <p>{domain}{v.slug}</p>\n            <ul className=\"hb-xh3-tasks\">\n              {tasks.map((t, i) => (\n                <li key={t} className=\"hb-xh3-task\" data-s={phase > i ? \"done\" : phase === i ? \"run\" : \"wait\"}>\n                  <span className=\"hb-xh3-ico\">{phase > i ? check : null}</span>\n                  {t}\n                </li>\n              ))}\n            </ul>\n            {phase >= 3 ? <a className=\"hb-xh3-open\" href={`#${v.slug}`}>Open workspace</a> : null}\n          </div>\n        </div>\n      </div>\n    );\n  }\n\n  return (\n    <div className={[\"hb-xh3\", className].filter(Boolean).join(\" \")} style={{ ...style, \"--hb-xh3-a\": accent } as React.CSSProperties} {...rest}>\n      <style href=\"hb-form-wizard\" precedence=\"default\">{css}</style>\n      <form className=\"hb-xh3-card\" onSubmit={next} noValidate>\n        <div className=\"hb-xh3-top\">\n          <div className=\"hb-xh3-meta\">\n            <span className=\"hb-xh3-step\">Step {step + 1} of {steps.length}</span>\n            <span className=\"hb-xh3-pct\">{Math.round(fraction * 100)}% complete</span>\n          </div>\n          <div className=\"hb-xh3-rail\">\n            {steps.map((s, i) => {\n              const f = i < step ? 1 : i === step ? 0.5 : 0;\n              const ok = i !== step && reach(i);\n              return (\n                <button\n                  key={s}\n                  type=\"button\"\n                  className=\"hb-xh3-seg\"\n                  data-reach={ok}\n                  aria-current={i === step ? \"step\" : undefined}\n                  aria-disabled={!ok && i !== step}\n                  onClick={() => ok && go(i)}\n                >\n                  <span className=\"hb-xh3-track\"><i style={{ \"--hb-xh3-f\": f } as React.CSSProperties} /></span>\n                  {s}\n                </button>\n              );\n            })}\n          </div>\n        </div>\n        <div className=\"hb-xh3-body\">\n          <div className=\"hb-xh3-pane\" key={step} data-dir={dir}>\n            {step === 0 ? (\n              <>\n                <h3 className=\"hb-xh3-h\">Name your workspace</h3>\n                <p className=\"hb-xh3-p\">This is where your team plans, ships and reviews.</p>\n                <div className=\"hb-xh3-field\">\n                  <label className=\"hb-xh3-label\" htmlFor={`${uid}-ws`}>Workspace name</label>\n                  <div className=\"hb-xh3-box\" data-bad={Boolean(tried[0] && errs.workspace)}>\n                    <input\n                      ref={first}\n                      id={`${uid}-ws`}\n                      className=\"hb-xh3-in\"\n                      placeholder=\"Northwind Studio\"\n                      value={v.workspace}\n                      autoComplete=\"organization\"\n                      onChange={(e) => {\n                        const workspace = e.target.value.slice(0, 40);\n                        setV((s) => ({ ...s, workspace, slug: slugEdited ? s.slug : slugify(workspace) }));\n                      }}\n                    />\n                  </div>\n                  {err(\"workspace\")}\n                </div>\n                <div className=\"hb-xh3-field\">\n                  <label className=\"hb-xh3-label\" htmlFor={`${uid}-slug`}>Workspace URL</label>\n                  <div className=\"hb-xh3-box\" data-bad={Boolean(tried[0] && errs.slug)}>\n                    <span className=\"hb-xh3-pre\" aria-hidden=\"true\">{domain}</span>\n                    <input\n                      id={`${uid}-slug`}\n                      className=\"hb-xh3-in\"\n                      placeholder=\"northwind\"\n                      value={v.slug}\n                      onChange={(e) => {\n                        setSlugEdited(true);\n                        setV((s) => ({ ...s, slug: slugify(e.target.value) }));\n                      }}\n                    />\n                  </div>\n                  {err(\"slug\") ?? <p className=\"hb-xh3-help\">You can change this later in settings.</p>}\n                </div>\n              </>\n            ) : null}\n            {step === 1 ? (\n              <>\n                <h3 className=\"hb-xh3-h\">Tell us about your team</h3>\n                <p className=\"hb-xh3-p\">We will tune templates and limits to fit.</p>\n                <div className=\"hb-xh3-field\">\n                  <span className=\"hb-xh3-label\" id={`${uid}-size`}>Team size</span>\n                  <div className=\"hb-xh3-sizes\" role=\"radiogroup\" aria-labelledby={`${uid}-size`}>\n                    {sizes.map((s, i) => (\n                      <button\n                        key={s}\n                        type=\"button\"\n                        role=\"radio\"\n                        aria-checked={v.size === s}\n                        className=\"hb-xh3-size\"\n                        onClick={() => setV((x) => ({ ...x, size: s }))}\n                      >\n                        <span className=\"hb-xh3-heads\" aria-hidden=\"true\">\n                          {sizeBars(i).map((h, k) => <i key={k} style={{ height: h }} />)}\n                        </span>\n                        <b>{s}</b>\n                        <small>{i === 0 ? \"solo\" : \"people\"}</small>\n                      </button>\n                    ))}\n                  </div>\n                  {err(\"size\")}\n                </div>\n                <div className=\"hb-xh3-field\">\n                  <span className=\"hb-xh3-label\" id={`${uid}-teams`}>Who will use it?</span>\n                  <div className=\"hb-xh3-chips\" role=\"group\" aria-labelledby={`${uid}-teams`}>\n                    {teams.map((t) => {\n                      const on = v.teams.includes(t);\n                      return (\n                        <button\n                          key={t}\n                          type=\"button\"\n                          className=\"hb-xh3-chip\"\n                          aria-pressed={on}\n                          onClick={() => setV((x) => ({ ...x, teams: on ? x.teams.filter((y) => y !== t) : [...x.teams, t] }))}\n                        >\n                          {on ? check : null}\n                          {t}\n                        </button>\n                      );\n                    })}\n                  </div>\n                  {err(\"teams\")}\n                </div>\n              </>\n            ) : null}\n            {step === 2 ? (\n              <>\n                <h3 className=\"hb-xh3-h\">Invite your teammates</h3>\n                <p className=\"hb-xh3-p\">Paste a list or press Enter after each address. Up to {maxInvites}.</p>\n                <div className=\"hb-xh3-field\">\n                  <label className=\"hb-xh3-label\" htmlFor={`${uid}-inv`}>Email addresses</label>\n                  <div className=\"hb-xh3-box hb-xh3-tagbox\" data-bad={Boolean(tried[2] && errs.invites)}>\n                    {v.invites.map((e) => (\n                      <span key={e} className=\"hb-xh3-tag\" data-bad={!emailRe.test(e)}>\n                        {e}\n                        <button type=\"button\" aria-label={`Remove ${e}`} onClick={() => setV((s) => ({ ...s, invites: s.invites.filter((x) => x !== e) }))}>\n                          <svg viewBox=\"0 0 12 12\" width=\"10\" height=\"10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"m3 3 6 6M9 3 3 9\" /></svg>\n                        </button>\n                      </span>\n                    ))}\n                    {v.invites.length < maxInvites ? (\n                      <input\n                        id={`${uid}-inv`}\n                        className=\"hb-xh3-in\"\n                        placeholder={v.invites.length ? \"Add another\" : \"sam@northwind.io\"}\n                        value={draft}\n                        onChange={(e) => {\n                          const val = e.target.value;\n                          if (/[,;\\s]$/.test(val)) addInvite(val);\n                          else setDraft(val);\n                        }}\n                        onPaste={(e) => {\n                          e.preventDefault();\n                          addInvite(e.clipboardData.getData(\"text\"));\n                        }}\n                        onKeyDown={(e) => {\n                          if (e.key === \"Enter\" && draft.trim()) {\n                            e.preventDefault();\n                            addInvite(draft);\n                          }\n                          if (e.key === \"Backspace\" && !draft && v.invites.length) {\n                            setV((s) => ({ ...s, invites: s.invites.slice(0, -1) }));\n                          }\n                        }}\n                        onBlur={() => draft.trim() && addInvite(draft)}\n                      />\n                    ) : null}\n                  </div>\n                  {err(\"invites\") ?? <p className=\"hb-xh3-help\">{v.invites.length}/{maxInvites} invites. Everyone joins as a member.</p>}\n                </div>\n              </>\n            ) : null}\n            {step === 3 ? (\n              <>\n                <h3 className=\"hb-xh3-h\">Review and create</h3>\n                <dl className=\"hb-xh3-review\">\n                  {[\n                    { k: \"Workspace\", d: v.workspace, s: 0 },\n                    { k: \"URL\", d: `${domain}${v.slug}`, s: 0 },\n                    { k: \"Team\", d: `${v.size} · ${v.teams.join(\", \")}`, s: 1 },\n                    { k: \"Invites\", d: v.invites.length ? v.invites.join(\", \") : \"None yet\", s: 2 },\n                  ].map((r) => (\n                    <div key={r.k}>\n                      <dt>{r.k}</dt>\n                      <dd title={r.d}>{r.d}</dd>\n                      <button type=\"button\" className=\"hb-xh3-edit\" onClick={() => go(r.s)} aria-label={`Edit ${r.k}`}>Edit</button>\n                    </div>\n                  ))}\n                </dl>\n              </>\n            ) : null}\n          </div>\n        </div>\n        <div className=\"hb-xh3-foot\">\n          <button type=\"button\" className=\"hb-xh3-ghost\" disabled={step === 0} onClick={() => go(step - 1)}>Back</button>\n          <div className=\"hb-xh3-right\">\n            {step === 2 && !v.invites.length ? <button type=\"button\" className=\"hb-xh3-ghost\" onClick={() => go(3)}>Skip for now</button> : null}\n            <button type=\"submit\" className=\"hb-xh3-next\">\n              {step === 3 ? \"Create workspace\" : \"Continue\"}\n              <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M3 8h10M9 4l4 4-4 4\" /></svg>\n            </button>\n          </div>\n        </div>\n      </form>\n    </div>\n  );\n}\n"
    }
  ]
}