{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "signup-steps",
  "title": "Signup Steps",
  "description": "A sign-up that asks one question at a time, starts with real progress and never ticks consent for anyone, in a card, beside a rail of what is left, or as one large question per screen.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "https://miseui.junsu4621.workers.dev/r/motion.json",
    "https://miseui.junsu4621.workers.dev/r/button.json",
    "https://miseui.junsu4621.workers.dev/r/checkbox.json",
    "https://miseui.junsu4621.workers.dev/r/input.json",
    "https://miseui.junsu4621.workers.dev/r/kbd.json",
    "https://miseui.junsu4621.workers.dev/r/label.json",
    "https://miseui.junsu4621.workers.dev/r/steps.json"
  ],
  "files": [
    {
      "path": "registry/miseui/blocks/signup-steps.tsx",
      "content": "import type * as React from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { SignupConversation } from \"./signup-steps-conversation\"\nimport {\n  useSignupFlow,\n  type SignupCreditedStep,\n  type SignupQuestionStep,\n  type SignupStep,\n  type SignupValues,\n} from \"./signup-steps-flow\"\nimport { Confirmation, StepProgress } from \"./signup-steps-parts\"\nimport { QuestionForm } from \"./signup-steps-question\"\nimport { SignupRail } from \"./signup-steps-rail\"\n\ntype SignupStepsVariant = \"card\" | \"rail\" | \"conversation\"\n\nconst EMAIL_SHAPE = /^\\S+@\\S+$/\n\nconst DEFAULT_STEPS: readonly SignupStep[] = [\n  { id: \"start\", label: \"Started\", credited: true },\n  {\n    id: \"email\",\n    label: \"Email\",\n    question: \"What is your work email?\",\n    aside: \"This is where your sign-in link goes.\",\n    fieldLabel: \"Work email\",\n    hint: \"There is no password to remember.\",\n    type: \"email\",\n    autoComplete: \"email\",\n    placeholder: \"maya@northgate.studio\",\n    validate: (value) => (EMAIL_SHAPE.test(value.trim()) ? undefined : \"Enter an email address, like maya@northgate.studio.\"),\n  },\n  {\n    id: \"workspace\",\n    label: \"Workspace\",\n    question: \"What should we call your workspace?\",\n    aside: \"Your team will see this name.\",\n    fieldLabel: \"Workspace name\",\n    hint: \"You can change it later.\",\n    autoComplete: \"organization\",\n    placeholder: \"Northgate Studio\",\n    consent: \"I agree to the Terms of Service and Privacy Policy.\",\n  },\n]\n\nfunction defaultConfirmation(values: SignupValues) {\n  return {\n    title: \"Check your inbox.\",\n    description: values.email ? `We sent a sign-in link to ${values.email}.` : \"We sent you a sign-in link.\",\n  }\n}\n\ninterface SignupStepsProps extends React.ComponentProps<\"section\"> {\n  /** `card` one card with a bar on top, `rail` steps in a side rail with what is left, `conversation` one large question per screen. */\n  variant?: SignupStepsVariant\n  /** Mark a first step `credited` to start the bar with real progress on it. */\n  steps?: readonly SignupStep[]\n  /** Called once with every answer, by step id. Return a promise to get the loading state; a rejection's message is shown inline. */\n  onComplete?: (values: SignupValues) => void | Promise<void>\n  /** Label of the last step's button. */\n  submitLabel?: string\n  /** What the final screen says. */\n  confirmation?: (values: SignupValues) => { title: string; description: string }\n}\n\nfunction SignupSteps({\n  variant,\n  steps = DEFAULT_STEPS,\n  onComplete,\n  submitLabel = \"Create workspace\",\n  confirmation = defaultConfirmation,\n  className,\n  ...props\n}: SignupStepsProps) {\n  const flow = useSignupFlow(steps, onComplete)\n  if (flow.questions.length === 0) return null\n\n  const shared = { steps, flow, submitLabel, finished: flow.done ? confirmation(flow.values) : null, className }\n  if (variant === \"rail\") return <SignupRail {...shared} {...props} />\n  if (variant === \"conversation\") return <SignupConversation {...shared} {...props} />\n\n  const credited = steps.length - flow.questions.length\n  const completed = flow.done ? steps.length : credited + flow.index\n\n  return (\n    <section data-slot=\"signup-steps\" data-variant=\"card\" className={cn(\"@container w-full bg-muted/40 dark:bg-background px-4 py-12\", className)} {...props}>\n      <div className=\"mx-auto flex w-full max-w-lg flex-col gap-8 rounded-2xl border bg-popover p-6 shadow-[0_16px_40px_-24px_color-mix(in_oklab,var(--mise)_24%,oklch(0_0_0/40%))] @md:p-8\">\n        <StepProgress steps={steps} completed={completed} />\n        {flow.done ? <Confirmation {...confirmation(flow.values)} /> : <QuestionForm flow={flow} submitLabel={submitLabel} />}\n      </div>\n    </section>\n  )\n}\n\nexport {\n  SignupSteps,\n  type SignupCreditedStep,\n  type SignupQuestionStep,\n  type SignupStep,\n  type SignupStepsProps,\n  type SignupStepsVariant,\n  type SignupValues,\n}\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/signup-steps-conversation.tsx",
      "content": "import type * as React from \"react\"\nimport { useId } from \"react\"\nimport { ArrowLeft, Loader2 } from \"lucide-react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { SPRING_DEFAULT } from \"@/registry/miseui/lib/motion\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Button } from \"@/registry/miseui/ui/button\"\nimport { Input } from \"@/registry/miseui/ui/input\"\nimport { Kbd } from \"@/registry/miseui/ui/kbd\"\nimport { Label } from \"@/registry/miseui/ui/label\"\nimport { useFocusOnChange, type SignupFlow } from \"./signup-steps-flow\"\nimport { Confirmation, ConsentField, ProgressTrack } from \"./signup-steps-parts\"\nimport type { SignupVariantProps } from \"./signup-steps-rail\"\n\nconst STEP_TRAVEL_PX = 16\n\n/** The answer just given, read back so this feels like being listened to. A password is never read back. */\nfunction lastAnswer(flow: SignupFlow) {\n  const previous = flow.questions[flow.index - 1]\n  if (!previous || previous.type === \"password\") return null\n  return flow.values[previous.id]?.trim() || null\n}\n\n/** Large type on one hairline: the question is the page, so the field should not look like a form to fill in. */\nfunction LargeField({ flow, fieldRef }: { flow: SignupFlow; fieldRef: React.RefObject<HTMLInputElement | null> }) {\n  const baseId = useId()\n  const { step, error } = flow\n  const fieldId = `${baseId}-field`\n  const noteId = `${baseId}-note`\n  const note = error ?? step.hint\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <div className=\"flex flex-col gap-2\">\n        <Label htmlFor={fieldId} className=\"sr-only\">\n          {step.fieldLabel}\n        </Label>\n        <Input\n          ref={fieldRef}\n          id={fieldId}\n          type={step.type ?? \"text\"}\n          autoComplete={step.autoComplete}\n          placeholder={step.placeholder}\n          value={flow.values[step.id] ?? \"\"}\n          readOnly={flow.pending}\n          onChange={(event) => flow.change(event.target.value)}\n          aria-invalid={error ? true : undefined}\n          aria-describedby={note ? noteId : undefined}\n          className=\"h-12 rounded-none border-0 border-b-2 bg-transparent px-0 text-xl shadow-none focus-visible:border-foreground focus-visible:ring-0 md:text-xl\"\n        />\n        {note ? (\n          <p\n            id={noteId}\n            role={error ? \"alert\" : undefined}\n            className={cn(\"text-[13px] leading-snug text-pretty\", error ? \"text-destructive\" : \"text-muted-foreground\")}\n          >\n            {note}\n          </p>\n        ) : null}\n      </div>\n      {step.consent ? <ConsentField flow={flow} text={step.consent} id={`${baseId}-consent`} /> : null}\n    </div>\n  )\n}\n\nfunction ConversationQuestion({ flow, submitLabel }: { flow: SignupFlow; submitLabel: string }) {\n  const reduceMotion = useReducedMotion()\n  const fieldRef = useFocusOnChange<HTMLInputElement>(flow.index)\n  const isLast = flow.index === flow.questions.length - 1\n  const answer = lastAnswer(flow)\n\n  const submit = (event: React.FormEvent<HTMLFormElement>) => {\n    event.preventDefault()\n    flow.next()\n  }\n\n  return (\n    <form noValidate onSubmit={submit} className=\"flex flex-col gap-8\">\n      <motion.div\n        key={flow.step.id}\n        className=\"flex flex-col gap-6\"\n        initial={reduceMotion ? false : { opacity: 0, y: flow.direction * STEP_TRAVEL_PX }}\n        animate={{ opacity: 1, y: 0 }}\n        transition={SPRING_DEFAULT}\n      >\n        {answer ? <p className=\"text-[15px] leading-relaxed break-words text-muted-foreground\">Got it: {answer}</p> : null}\n        <h2 className=\"text-display text-3xl leading-[1.12]! text-balance @2xl:text-4xl\">\n          {flow.step.question}\n          {flow.step.aside ? <span className=\"text-muted-foreground\"> {flow.step.aside}</span> : null}\n        </h2>\n        <LargeField flow={flow} fieldRef={fieldRef} />\n      </motion.div>\n      <div className=\"flex flex-wrap items-center gap-3\">\n        <Button type=\"submit\" size=\"lg\" disabled={flow.pending} aria-busy={flow.pending || undefined}>\n          {flow.pending ? <Loader2 aria-hidden=\"true\" className=\"animate-spin motion-reduce:animate-none\" /> : null}\n          {isLast ? submitLabel : \"Continue\"}\n        </Button>\n        {flow.index > 0 ? (\n          <Button type=\"button\" size=\"lg\" variant=\"ghost\" disabled={flow.pending} onClick={flow.back}>\n            <ArrowLeft /> Back\n          </Button>\n        ) : null}\n        <span className=\"hidden items-center gap-2 text-[13px] text-muted-foreground pointer-fine:flex\">\n          or press <Kbd>Enter</Kbd>\n        </span>\n      </div>\n    </form>\n  )\n}\n\nfunction SignupConversation({ steps, flow, submitLabel, finished, className, ...props }: SignupVariantProps) {\n  const credited = steps.length - flow.questions.length\n  const completed = flow.done ? steps.length : credited + flow.index\n  return (\n    <section data-slot=\"signup-steps\" data-variant=\"conversation\" className={cn(\"@container flex min-h-[560px] w-full flex-col bg-background\", className)} {...props}>\n      <ProgressTrack total={steps.length} completed={completed} className=\"rounded-none\" />\n      <div className=\"mx-auto flex w-full max-w-2xl min-w-0 flex-1 flex-col justify-center px-6 py-12\">\n        {finished ? <Confirmation {...finished} /> : <ConversationQuestion flow={flow} submitLabel={submitLabel} />}\n      </div>\n    </section>\n  )\n}\n\nexport { SignupConversation, lastAnswer }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/signup-steps-flow.ts",
      "content": "import { useEffect, useRef, useState } from \"react\"\n\ninterface SignupCreditedStep {\n  id: string\n  /** Short name under the progress bar. */\n  label: string\n  /** Already counted as done when the flow opens. Use it only for something the person has really done, such as starting. */\n  credited: true\n}\n\ninterface SignupQuestionStep {\n  id: string\n  label: string\n  credited?: false\n  /** The one question on this screen. */\n  question: string\n  /** A second sentence in the same heading, in the muted tone: why it is being asked. */\n  aside?: string\n  fieldLabel: string\n  hint?: string\n  type?: \"text\" | \"email\" | \"password\" | \"url\" | \"tel\"\n  autoComplete?: string\n  placeholder?: string\n  /** Return a message to hold the person here. By default the field only has to be filled in. */\n  validate?: (value: string) => string | undefined\n  /** A box that must be ticked to move on. It always starts unticked. */\n  consent?: string\n}\n\ntype SignupStep = SignupCreditedStep | SignupQuestionStep\ntype SignupValues = Readonly<Record<string, string>>\n\nconst REQUIRED_MESSAGE = \"Fill this in to continue.\"\nconst CONSENT_MESSAGE = \"Tick the box to continue.\"\nconst COMPLETE_FAILED = \"Something went wrong. Try again.\"\n\nfunction checkStep(step: SignupQuestionStep, value: string, consented: boolean) {\n  const problem = step.validate ? step.validate(value) : value.trim() ? undefined : REQUIRED_MESSAGE\n  return problem ?? (step.consent && !consented ? CONSENT_MESSAGE : undefined)\n}\n\nfunction isQuestion(step: SignupStep): step is SignupQuestionStep {\n  return !step.credited\n}\n\n/** The last step's request: its loading state, the failure if any, and the switch to the final screen. */\nfunction useCompletion(onComplete: ((values: SignupValues) => void | Promise<void>) | undefined, setError: (message: string) => void) {\n  const [pending, setPending] = useState(false)\n  const [done, setDone] = useState(false)\n\n  const finish = async (values: SignupValues) => {\n    setPending(true)\n    try {\n      await onComplete?.(values)\n      setDone(true)\n    } catch (failure) {\n      setError(failure instanceof Error ? failure.message : COMPLETE_FAILED)\n    } finally {\n      setPending(false)\n    }\n  }\n\n  return { pending, done, finish }\n}\n\nfunction useSignupFlow(steps: readonly SignupStep[], onComplete?: (values: SignupValues) => void | Promise<void>) {\n  const questions = steps.filter(isQuestion)\n  const [{ index, direction }, setPosition] = useState<{ index: number; direction: 1 | -1 }>({ index: 0, direction: 1 })\n  const [values, setValues] = useState<SignupValues>({})\n  const [consents, setConsents] = useState<Readonly<Record<string, boolean>>>({})\n  const [error, setError] = useState<string>()\n  const { pending, done, finish } = useCompletion(onComplete, setError)\n  const step = questions[index]\n\n  const next = () => {\n    if (pending) return\n    const problem = checkStep(step, values[step.id] ?? \"\", consents[step.id] ?? false)\n    setError(problem)\n    if (problem) return\n    if (index === questions.length - 1) return void finish(values)\n    setPosition({ index: index + 1, direction: 1 })\n  }\n\n  const back = () => {\n    setError(undefined)\n    setPosition({ index: index - 1, direction: -1 })\n  }\n\n  /** Back to an answered question, for a rail of steps. A later one would skip the work in between, so it is ignored. */\n  const goTo = (target: number) => {\n    if (pending || target >= index) return\n    setError(undefined)\n    setPosition({ index: Math.max(0, target), direction: -1 })\n  }\n\n  const change = (value: string) => {\n    setError(undefined)\n    setValues((current) => ({ ...current, [step.id]: value }))\n  }\n\n  const toggleConsent = (checked: boolean) => {\n    setError(undefined)\n    setConsents((current) => ({ ...current, [step.id]: checked }))\n  }\n\n  return { questions, step, index, direction, values, consents, error, pending, done, next, back, goTo, change, toggleConsent }\n}\n\ntype SignupFlow = ReturnType<typeof useSignupFlow>\n\n/** Moves focus on a step change only. On first paint it would scroll a page that has the block further down. */\nfunction useFocusOnChange<T extends HTMLElement>(key: unknown) {\n  const ref = useRef<T>(null)\n  // The last key, not the first: going back to the first question has to move focus too, because its Back button is gone.\n  const lastKey = useRef(key)\n  useEffect(() => {\n    if (key === lastKey.current) return\n    lastKey.current = key\n    ref.current?.focus()\n  }, [key])\n  return ref\n}\n\nexport {\n  useFocusOnChange,\n  useSignupFlow,\n  type SignupCreditedStep,\n  type SignupFlow,\n  type SignupQuestionStep,\n  type SignupStep,\n  type SignupValues,\n}\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/signup-steps-parts.tsx",
      "content": "import type * as React from \"react\"\nimport { useEffect, useId, useRef } from \"react\"\nimport { Check } from \"lucide-react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { SPRING_DEFAULT } from \"@/registry/miseui/lib/motion\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Checkbox } from \"@/registry/miseui/ui/checkbox\"\nimport { Input } from \"@/registry/miseui/ui/input\"\nimport { Label } from \"@/registry/miseui/ui/label\"\nimport type { SignupFlow, SignupStep } from \"@/registry/miseui/blocks/signup-steps-flow\"\n\nconst PERCENT = 100\nconst CONFIRMATION_START = { opacity: 0, scale: 0.6 }\nconst CONFIRMATION_END = { opacity: 1, scale: 1 }\n\ninterface StepProgressProps {\n  steps: readonly SignupStep[]\n  /** How many steps count as finished, credited ones included. */\n  completed: number\n}\n\nfunction ProgressTrack({ total, completed, className }: { total: number; completed: number; className?: string }) {\n  const reduceMotion = useReducedMotion()\n  const percent = Math.round((completed / total) * PERCENT)\n  return (\n    <div\n      role=\"progressbar\"\n      aria-label=\"Sign-up progress\"\n      aria-valuemin={0}\n      aria-valuemax={PERCENT}\n      aria-valuenow={percent}\n      aria-valuetext={`Step ${Math.min(completed + 1, total)} of ${total}`}\n      className={cn(\"h-1 overflow-hidden rounded-full bg-muted\", className)}\n    >\n      {/* Sliding a full-width bar, not scaling it: scale would squash the rounded leading edge. */}\n      <motion.div\n        data-testid=\"progress-fill\"\n        data-reduced={reduceMotion ? \"true\" : \"false\"}\n        className=\"h-full rounded-full bg-mise\"\n        initial={false}\n        animate={{ x: `${percent - PERCENT}%` }}\n        transition={reduceMotion ? { duration: 0 } : SPRING_DEFAULT}\n      />\n    </div>\n  )\n}\n\nfunction StepProgress({ steps, completed }: StepProgressProps) {\n  return (\n    <div className=\"flex flex-col gap-2\">\n      <ProgressTrack total={steps.length} completed={completed} />\n      <ol className=\"grid text-[13px]\" style={{ gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }}>\n        {steps.map((step, index) => (\n          <li\n            key={step.id}\n            aria-current={index === completed ? \"step\" : undefined}\n            className={cn(\n              \"flex min-w-0 items-center gap-1\",\n              index === completed ? \"font-medium text-foreground\" : \"text-muted-foreground\",\n            )}\n          >\n            {index < completed ? <Check aria-label=\"Done\" className=\"size-3.5 shrink-0 text-foreground\" /> : null}\n            <span className=\"truncate\">{step.label}</span>\n          </li>\n        ))}\n      </ol>\n    </div>\n  )\n}\n\ninterface QuestionFieldsProps {\n  flow: SignupFlow\n  fieldRef: React.RefObject<HTMLInputElement | null>\n}\n\nfunction QuestionFields({ flow, fieldRef }: QuestionFieldsProps) {\n  const baseId = useId()\n  const { step, error } = flow\n  const fieldId = `${baseId}-field`\n  const noteId = `${baseId}-note`\n  const note = error ?? step.hint\n\n  return (\n    <div className=\"flex flex-col gap-6\">\n      <div className=\"flex flex-col gap-2\">\n        <Label htmlFor={fieldId}>{step.fieldLabel}</Label>\n        <Input\n          ref={fieldRef}\n          id={fieldId}\n          type={step.type ?? \"text\"}\n          autoComplete={step.autoComplete}\n          placeholder={step.placeholder}\n          value={flow.values[step.id] ?? \"\"}\n          readOnly={flow.pending}\n          onChange={(event) => flow.change(event.target.value)}\n          aria-invalid={error ? true : undefined}\n          aria-describedby={note ? noteId : undefined}\n        />\n        {/* The error takes the hint's place, so the buttons below do not jump when it appears. */}\n        {note ? (\n          <p\n            id={noteId}\n            role={error ? \"alert\" : undefined}\n            className={cn(\"text-[13px] leading-snug text-pretty\", error ? \"text-destructive\" : \"text-muted-foreground\")}\n          >\n            {note}\n          </p>\n        ) : null}\n      </div>\n      {step.consent ? <ConsentField flow={flow} text={step.consent} id={`${baseId}-consent`} /> : null}\n    </div>\n  )\n}\n\nfunction ConsentField({ flow, text, id }: { flow: SignupFlow; text: string; id: string }) {\n  return (\n    <div className=\"flex items-start gap-3\">\n      <span className=\"flex h-5 items-center\">\n        <Checkbox\n          id={id}\n          checked={flow.consents[flow.step.id] ?? false}\n          disabled={flow.pending}\n          onCheckedChange={(checked) => flow.toggleConsent(checked === true)}\n        />\n      </span>\n      <Label htmlFor={id} className=\"text-[13px] leading-5 font-normal\">\n        {text}\n      </Label>\n    </div>\n  )\n}\n\ninterface ConfirmationProps {\n  title: string\n  description: string\n}\n\n/** Takes focus so a screen reader hears the result instead of silence after the form disappears. */\nfunction Confirmation({ title, description }: ConfirmationProps) {\n  const reduceMotion = useReducedMotion()\n  const headingRef = useRef<HTMLHeadingElement>(null)\n  useEffect(() => headingRef.current?.focus(), [])\n  return (\n    <div className=\"flex flex-col items-start gap-6\">\n      <motion.span\n        data-testid=\"confirmation-mark\"\n        className=\"grid size-12 place-items-center rounded-full bg-muted\"\n        initial={reduceMotion ? false : CONFIRMATION_START}\n        animate={CONFIRMATION_END}\n        transition={SPRING_DEFAULT}\n      >\n        <Check aria-hidden=\"true\" className=\"size-6\" />\n      </motion.span>\n      <h2 ref={headingRef} tabIndex={-1} className=\"text-display text-3xl leading-[1.12]! text-balance break-words outline-none\">\n        {title} <span className=\"text-muted-foreground\">{description}</span>\n      </h2>\n    </div>\n  )\n}\n\nexport { Confirmation, ConsentField, ProgressTrack, QuestionFields, StepProgress }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/signup-steps-question.tsx",
      "content": "import type * as React from \"react\"\nimport { ArrowLeft, Loader2 } from \"lucide-react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { SPRING_DEFAULT } from \"@/registry/miseui/lib/motion\"\nimport { Button } from \"@/registry/miseui/ui/button\"\nimport { useFocusOnChange, type SignupFlow } from \"./signup-steps-flow\"\nimport { QuestionFields } from \"./signup-steps-parts\"\n\nconst STEP_TRAVEL_PX = 16\n\ninterface QuestionFormProps {\n  flow: SignupFlow\n  submitLabel: string\n}\n\n/** One form, so Enter advances from anywhere. Only the question itself moves; the buttons stay under the thumb. */\nfunction QuestionForm({ flow, submitLabel }: QuestionFormProps) {\n  const reduceMotion = useReducedMotion()\n  const fieldRef = useFocusOnChange<HTMLInputElement>(flow.index)\n  const isLast = flow.index === flow.questions.length - 1\n\n  const submit = (event: React.FormEvent<HTMLFormElement>) => {\n    event.preventDefault()\n    flow.next()\n  }\n\n  return (\n    <form noValidate onSubmit={submit} className=\"flex flex-col gap-8\">\n      <motion.div\n        key={flow.step.id}\n        className=\"flex flex-col gap-8\"\n        initial={reduceMotion ? false : { opacity: 0, x: flow.direction * STEP_TRAVEL_PX }}\n        animate={{ opacity: 1, x: 0 }}\n        transition={SPRING_DEFAULT}\n      >\n        <h2 className=\"text-display text-3xl leading-[1.12]! text-balance\">\n          {flow.step.question}\n          {flow.step.aside ? <span className=\"text-muted-foreground\"> {flow.step.aside}</span> : null}\n        </h2>\n        <QuestionFields flow={flow} fieldRef={fieldRef} />\n      </motion.div>\n      <div className=\"flex items-center gap-3\">\n        {flow.index > 0 ? (\n          <Button type=\"button\" variant=\"ghost\" disabled={flow.pending} onClick={flow.back}>\n            <ArrowLeft /> Back\n          </Button>\n        ) : null}\n        <Button type=\"submit\" disabled={flow.pending} aria-busy={flow.pending || undefined} className=\"ml-auto\">\n          {flow.pending ? <Loader2 aria-hidden=\"true\" className=\"animate-spin motion-reduce:animate-none\" /> : null}\n          {isLast ? submitLabel : \"Continue\"}\n        </Button>\n      </div>\n    </form>\n  )\n}\n\nexport { QuestionForm }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/signup-steps-rail.tsx",
      "content": "import type * as React from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Steps, type StepItem } from \"@/registry/miseui/ui/steps\"\nimport type { SignupFlow, SignupStep } from \"./signup-steps-flow\"\nimport { Confirmation } from \"./signup-steps-parts\"\nimport { QuestionForm } from \"./signup-steps-question\"\n\ninterface SignupVariantProps extends React.ComponentProps<\"section\"> {\n  steps: readonly SignupStep[]\n  flow: SignupFlow\n  submitLabel: string\n  finished: { title: string; description: string } | null\n}\n\n/** The shared question form stays 36 px with a mouse. A checkbox is a button too, so this names the kit's buttons. */\nconst TOUCH_TARGETS_CLASS = \"pointer-coarse:[&_[data-slot=button]]:h-10 pointer-coarse:[&_input]:h-10\"\n\nfunction questionsLeft(flow: SignupFlow) {\n  if (flow.done) return \"Nothing left.\"\n  const left = flow.questions.length - flow.index\n  return `${left} ${left === 1 ? \"question\" : \"questions\"} left.`\n}\n\n/** A step ahead says what it is for. The current one already says so in its heading, and a finished one is done. */\nfunction railItems(steps: readonly SignupStep[], current: number): readonly StepItem[] {\n  return steps.map((step, index) => ({\n    title: step.label,\n    description: index > current && !step.credited ? step.aside : undefined,\n  }))\n}\n\nfunction SignupRail({ steps, flow, submitLabel, finished, className, ...props }: SignupVariantProps) {\n  const credited = steps.length - flow.questions.length\n  const current = flow.done ? steps.length : credited + flow.index\n  const items = railItems(steps, current)\n  // Credited steps were never questions. A press on one goes to the first question, and goTo clamps it there.\n  const select = flow.done || flow.pending ? undefined : (index: number) => flow.goTo(index - credited)\n\n  return (\n    <section data-slot=\"signup-steps\" data-variant=\"rail\" className={cn(\"@container w-full bg-muted/40 dark:bg-background\", className)} {...props}>\n      <div className=\"px-4 py-12 @md:px-6 @2xl:py-16\">\n        <div className=\"mx-auto grid w-full max-w-4xl grid-cols-[minmax(0,1fr)] overflow-hidden rounded-2xl border bg-popover @3xl:grid-cols-[minmax(0,2fr)_minmax(0,3fr)]\">\n          <aside data-testid=\"signup-rail\" className=\"hidden flex-col gap-8 border-r bg-muted p-8 @3xl:flex dark:bg-card\">\n            <p className=\"text-display text-2xl leading-[1.12]! text-balance\">\n              {questionsLeft(flow)} {flow.done ? null : <span className=\"text-muted-foreground\">Then your workspace is ready.</span>}\n            </p>\n            <Steps aria-label=\"Sign-up steps\" variant=\"vertical\" effect=\"draw\" steps={items} current={current} onStepSelect={select} />\n          </aside>\n          <div className={cn(\"flex min-w-0 flex-col gap-8 p-6 @md:p-8 @3xl:min-h-[480px] @3xl:justify-center @3xl:p-12\", TOUCH_TARGETS_CLASS)}>\n            <div data-testid=\"signup-rail-compact\" className=\"@3xl:hidden\">\n              <Steps aria-label=\"Sign-up progress\" variant=\"compact\" steps={items} current={current} />\n            </div>\n            {finished ? <Confirmation {...finished} /> : <QuestionForm flow={flow} submitLabel={submitLabel} />}\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n\nexport { SignupRail, type SignupVariantProps }\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "blocks"
  ],
  "type": "registry:block"
}