{
  "name": "stepper",
  "type": "registry:ui",
  "framework": "react",
  "title": "Stepper",
  "description": "Progress through a fixed sequence of steps, horizontal or stacked.",
  "files": [
    {
      "path": "ui/stepper.tsx",
      "content": "import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\n/** One stage of the sequence. */\nexport interface StepperStep {\n  title: string\n  /** The quieter line under the title. */\n  description?: string\n}\n\nexport interface StepperProps extends Omit<\n  React.ComponentProps<\"ol\">,\n  \"children\"\n> {\n  steps: readonly StepperStep[]\n  /**\n   * Index of the step in progress. Every step before it is complete; a value\n   * equal to `steps.length` means all of them are.\n   */\n  value: number\n  orientation?: \"horizontal\" | \"vertical\"\n  /** Read after a finished step's title by a screen reader. */\n  completedLabel?: string\n}\n\n/*\n * Progress through a fixed sequence, as an ordered list. A step's state is\n * said three ways, so it never rests on colour: the marker's fill, a check\n * in place of the number, and `aria-current=\"step\"` on the one in progress.\n */\nconst Stepper = React.forwardRef<HTMLOListElement, StepperProps>(\n  (\n    {\n      className,\n      steps,\n      value,\n      orientation = \"horizontal\",\n      completedLabel = \"completed\",\n      ...props\n    },\n    ref\n  ) => {\n    const vertical = orientation === \"vertical\"\n    return (\n      <ol\n        ref={ref}\n        data-orientation={orientation}\n        className={cn(\n          \"m-0 flex w-full list-none p-0\",\n          vertical ? \"flex-col\" : \"gap-2\",\n          className\n        )}\n        {...props}\n      >\n        {steps.map((step, index) => {\n          const complete = index < value\n          const current = index === value\n          const last = index === steps.length - 1\n          return (\n            <li\n              // Positional: the list is fixed, and two steps may share a title.\n              key={index}\n              aria-current={current ? \"step\" : undefined}\n              className={cn(\n                \"relative flex min-w-0\",\n                vertical\n                  ? \"items-start gap-3 text-start\"\n                  : \"flex-1 flex-col items-center gap-2 text-center\",\n                vertical && !last && \"pb-5\"\n              )}\n            >\n              {last ? null : (\n                <span\n                  aria-hidden=\"true\"\n                  className={cn(\n                    \"absolute rounded-full\",\n                    complete ? \"bg-newt-brand\" : \"bg-newt-bg-active\",\n                    vertical\n                      ? \"start-[13px] top-8 h-[calc(100%-36px)] w-0.5\"\n                      : \"start-[calc(50%+20px)] top-[13px] h-0.5 w-[calc(100%-32px)]\"\n                  )}\n                />\n              )}\n              <span\n                aria-hidden=\"true\"\n                className={cn(\n                  \"flex h-7 w-7 shrink-0 items-center justify-center rounded-full border-2 text-[13px] font-bold\",\n                  complete\n                    ? \"border-newt-brand bg-newt-brand text-newt-on-accent\"\n                    : current\n                      ? \"border-newt-brand bg-newt-bg-surface text-newt-text-primary\"\n                      : \"border-newt-bg-active bg-newt-bg-surface text-newt-text-muted\"\n                )}\n              >\n                {complete ? (\n                  <svg viewBox=\"0 0 16 16\" className=\"h-4 w-4\">\n                    <path\n                      fill=\"currentColor\"\n                      d=\"M6.2 11.6 3.1 8.5a1 1 0 0 1 1.4-1.4l1.7 1.7 4.3-4.3a1 1 0 1 1 1.4 1.4l-5 5a1 1 0 0 1-1.4 0Z\"\n                    />\n                  </svg>\n                ) : (\n                  index + 1\n                )}\n              </span>\n              <span\n                className={cn(\n                  \"flex min-w-0 flex-col gap-0.5\",\n                  vertical && \"pt-1\"\n                )}\n              >\n                <span\n                  className={cn(\n                    \"text-sm font-semibold leading-[18px]\",\n                    complete || current\n                      ? \"text-newt-text-primary\"\n                      : \"text-newt-text-secondary\"\n                  )}\n                >\n                  {step.title}\n                  {complete ? (\n                    <span className=\"sr-only\">, {completedLabel}</span>\n                  ) : null}\n                </span>\n                {step.description === undefined ? null : (\n                  <span className=\"text-xs leading-4 text-newt-text-muted\">\n                    {step.description}\n                  </span>\n                )}\n              </span>\n            </li>\n          )\n        })}\n      </ol>\n    )\n  }\n)\nStepper.displayName = \"Stepper\"\n\nexport { Stepper }\n",
      "type": "registry:ui"
    }
  ]
}