{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "progress-stepper",
  "type": "registry:ui",
  "title": "ProgressStepper",
  "description": "A multi-step progress indicator that shows the user's position in a sequential workflow.",
  "dependencies": [
    "@remixicon/react@^4.9.0",
    "class-variance-authority@^0.7.1"
  ],
  "registryDependencies": [
    "https://wideset.co/r/styles.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/components/progress-stepper/ProgressStepper.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/progress-stepper/ProgressStepper.tsx",
      "content": "'use client';\n\nimport {\n  Children,\n  cloneElement,\n  forwardRef,\n  isValidElement,\n  type ReactElement,\n  useCallback,\n} from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type {\n  ProgressStepperIconProps,\n  ProgressStepperProps,\n  ProgressStepperWithSubComponents,\n} from './ProgressStepper.types';\nimport { progressStepperVariants } from './ProgressStepper.variants';\nimport { ProgressStepperIcon } from './ProgressStepperIcon';\nimport { ProgressStepperStep } from './ProgressStepperStep';\n\nconst ProgressStepper = forwardRef<HTMLOListElement, ProgressStepperProps>(\n  (\n    {\n      className,\n      steps,\n      activeStep = 0,\n      orientation = 'horizontal',\n      onStepChange,\n      allStepsClickable,\n      disabled,\n      children,\n      ...props\n    },\n    ref,\n  ) => {\n    const getStepStatus = useCallback(\n      (\n        index: number,\n        stepStatus: ProgressStepperIconProps['status'],\n      ): ProgressStepperIconProps['status'] => {\n        if (stepStatus != null) return stepStatus;\n        if (index < activeStep) return 'completed';\n        if (index === activeStep) return 'active';\n        return 'incomplete';\n      },\n      [activeStep],\n    );\n\n    const childrenArray = Children.toArray(children);\n    const hasComposedChildren = children != null && Children.count(children) > 0;\n\n    const mapChildSteps = (source: ReturnType<typeof Children.toArray>) =>\n      source.map((child, index) => {\n        if (!isValidElement(child) || child.type !== ProgressStepperStep) return child;\n        const childProps = child.props as { step?: number; onClick?: (step: number) => void };\n        return cloneElement(\n          child as ReactElement<{\n            withLine?: boolean;\n            isActive?: boolean;\n            step?: number;\n            onClick?: (step: number) => void;\n          }>,\n          {\n            withLine: index !== source.length - 1,\n            isActive: childProps.step === activeStep,\n            onClick: childProps.onClick ?? (onStepChange ? onStepChange : undefined),\n          },\n        );\n      });\n\n    const renderedSteps = hasComposedChildren\n      ? mapChildSteps(childrenArray)\n      : steps !== undefined\n        ? steps.map(({ title, caption, status: stepStatus }, index) => (\n            <ProgressStepperStep\n              key={title}\n              step={index}\n              status={getStepStatus(index, stepStatus)}\n              withLine={index !== steps.length - 1}\n              isActive={index === activeStep}\n              orientation={orientation}\n              disabled={disabled || (!allStepsClickable && index > activeStep)}\n              onClick={(stepIndex: number) => onStepChange?.(stepIndex)}\n              title={title}\n              caption={caption}\n            />\n          ))\n        : mapChildSteps(childrenArray);\n\n    return (\n      <ol\n        ref={ref}\n        data-slot=\"progress-stepper\"\n        className={cn(progressStepperVariants({ orientation }), className)}\n        {...props}\n      >\n        {renderedSteps}\n      </ol>\n    );\n  },\n) as ProgressStepperWithSubComponents;\n\nProgressStepper.displayName = 'ProgressStepper';\n\nProgressStepper.Step = ProgressStepperStep;\nProgressStepper.Icon = ProgressStepperIcon;\n\nexport { ProgressStepper };\n"
    },
    {
      "path": "src/components/progress-stepper/ProgressStepper.types.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/progress-stepper/ProgressStepper.types.ts",
      "content": "import type { VariantProps } from 'class-variance-authority';\nimport type {\n  ComponentType,\n  ForwardRefExoticComponent,\n  HTMLAttributes,\n  PropsWithoutRef,\n  ReactNode,\n  RefAttributes,\n} from 'react';\n\nimport type { progressStepperIconVariants } from './ProgressStepper.variants';\n\nexport type ProgressStepperOrientation = 'horizontal' | 'vertical';\n\n/** A sequence of named steps showing workflow progress. */\nexport type ProgressStepperProps = Omit<HTMLAttributes<HTMLOListElement>, 'children'> & {\n  /** Array-driven step definitions. Each entry requires a `title`, optionally a `caption`, and optionally a `status` to override the computed state. Mutually exclusive with `children`. */\n  steps?: Array<{\n    /** Title displayed for this item. */\n    title: string;\n    /** Supporting caption displayed below the title. */\n    caption?: string;\n    /** Semantic status used for the icon and colors. */\n    status?: ProgressStepperIconProps['status'];\n  }>;\n  /** The 0-based index of the currently active step. Steps before this index are marked completed, steps after are incomplete. Set to the length of `steps` to mark all steps complete. */\n  activeStep?: number;\n  /** Layout direction of the stepper. */\n  orientation?: ProgressStepperOrientation;\n  /** Called with the 0-based step index when the user clicks a step. */\n  onStepChange?: (step: number) => void;\n  /** When `true`, future steps are also clickable, not just past and active steps. */\n  allStepsClickable?: boolean;\n  /** Disables all step interactions. */\n  disabled?: boolean;\n  /** Compose steps manually using `ProgressStepper.Step`. Takes precedence over `steps`. */\n  children?: ReactNode;\n};\n\n/** An icon rendered within `ProgressStepper`. */\nexport type ProgressStepperIconProps = Omit<HTMLAttributes<HTMLDivElement>, 'onClick'> & {\n  /** Zero-based step index. */\n  step: number;\n  /** Layout direction of the component. */\n  orientation?: ProgressStepperOrientation;\n  /** Allows users to activate steps. */\n  interactive?: boolean;\n  /** Called with the zero-based step index when the step is activated. */\n  onClick?: (step: number) => void;\n  /** Accessible name of the icon button when `interactive`, from its zero-based step. Defaults to `Step 1`, `Step 2`, … */\n  stepAriaLabel?: (step: number) => string;\n} & VariantProps<typeof progressStepperIconVariants>;\n\n/** An individual stage in the progress indicator. */\nexport type ProgressStepperStepProps = Omit<HTMLAttributes<HTMLLIElement>, 'children' | 'onClick'> &\n  Omit<ProgressStepperIconProps, 'interactive' | 'title' | 'orientation' | 'stepAriaLabel'> & {\n    /** Title displayed for this item. */\n    title: string;\n    /** Supporting caption displayed below the title. */\n    caption?: string;\n    /** Layout direction of the component. */\n    orientation: ProgressStepperOrientation;\n  };\n\nexport type ProgressStepperWithSubComponents = ForwardRefExoticComponent<\n  PropsWithoutRef<ProgressStepperProps> & RefAttributes<HTMLOListElement>\n> & {\n  Step: ComponentType<ProgressStepperStepProps>;\n  Icon: ComponentType<ProgressStepperIconProps>;\n};\n"
    },
    {
      "path": "src/components/progress-stepper/ProgressStepper.variants.ts",
      "type": "registry:ui",
      "target": "components/ui/wideset/progress-stepper/ProgressStepper.variants.ts",
      "content": "import { cva } from 'class-variance-authority';\nimport { cn } from '@/lib/wideset/utils';\n\nexport const progressStepperVariants = cva('flex w-full', {\n  variants: {\n    orientation: {\n      horizontal: 'gap-ws-9 items-center justify-between',\n      vertical: 'gap-ws-3 flex-col',\n    },\n  },\n  defaultVariants: {\n    orientation: 'horizontal',\n  },\n});\n\nexport const progressStepperStepVariants = cva(\n  cn(\n    'gap-ws-9 flex items-center',\n    'outline-ws-dynamic-primary-strong-default focus-visible:outline-2 focus-visible:outline-offset-2',\n  ),\n  {\n    variants: {\n      status: {\n        completed: '',\n        incomplete: '',\n        active: '',\n        error: '',\n      },\n      disabled: {\n        false: '',\n        true: 'pointer-events-none',\n      },\n      withLine: {\n        false: '',\n        true: 'grow',\n      },\n      orientation: {\n        // Figma: horizontal item has cornerRadius 0, vertical Corner Radius/Control/lg.\n        horizontal: 'rounded-none',\n        vertical: 'rounded-ws-control-lg cursor-pointer',\n      },\n    },\n    compoundVariants: [\n      {\n        status: 'completed',\n        orientation: 'vertical',\n        class:\n          'focus-visible:outline-ws-dynamic-primary-strong-default focus-visible:bg-ws-dynamic-secondary-alpha-default',\n      },\n      {\n        status: 'incomplete',\n        orientation: 'vertical',\n        class:\n          'hover:bg-ws-dynamic-secondary-alpha-hover active:bg-ws-dynamic-secondary-alpha-pressed focus-visible:bg-ws-dynamic-secondary-alpha-default',\n      },\n      {\n        status: 'active',\n        orientation: 'vertical',\n        class:\n          'bg-ws-dynamic-tertiary-alpha-strong-default hover:bg-ws-dynamic-tertiary-alpha-strong-hover active:bg-ws-dynamic-tertiary-alpha-strong-pressed focus-visible:bg-ws-dynamic-secondary-alpha-default',\n      },\n      {\n        status: 'error',\n        orientation: 'vertical',\n        class: 'focus-visible:outline-ws-dynamic-danger-strong-default',\n      },\n    ],\n    defaultVariants: {\n      disabled: false,\n      withLine: false,\n      orientation: 'horizontal',\n    },\n  },\n);\n\nexport const progressStepperIconVariants = cva(\n  cn(\n    'flex shrink-0 items-center justify-center',\n    'rounded-full',\n    'outline-ws-dynamic-primary-strong-default',\n    'typography-label-strong-sm',\n  ),\n  {\n    variants: {\n      status: {\n        completed:\n          'bg-ws-dynamic-success-default text-ws-dynamic-on-success-default hover:bg-ws-dynamic-success-hover active:bg-ws-dynamic-success-pressed group-hover:bg-ws-dynamic-success-hover group-active:bg-ws-dynamic-success-pressed',\n        incomplete:\n          'bg-ws-dynamic-secondary-default text-ws-dynamic-on-secondary-default hover:bg-ws-dynamic-secondary-hover active:bg-ws-dynamic-secondary-pressed group-hover:bg-ws-dynamic-secondary-hover group-active:bg-ws-dynamic-secondary-pressed',\n        active:\n          'bg-ws-dynamic-primary-alpha-strong-default text-ws-dynamic-primary-default hover:bg-ws-dynamic-primary-alpha-strong-hover active:bg-ws-dynamic-primary-alpha-strong-pressed group-hover:bg-ws-dynamic-primary-alpha-strong-hover group-active:bg-ws-dynamic-primary-alpha-strong-pressed',\n        error:\n          'bg-ws-dynamic-danger-default hover:bg-ws-dynamic-danger-hover active:bg-ws-dynamic-danger-pressed group-hover:bg-ws-dynamic-danger-hover group-active:bg-ws-dynamic-danger-pressed text-ws-dynamic-on-danger-default outline-ws-dynamic-danger-strong-default',\n      },\n      orientation: {\n        horizontal:\n          'size-ws-14 group-focus-visible:outline-2 group-focus-visible:outline-offset-2 focus-visible:outline-2 focus-visible:outline-offset-2',\n        vertical: 'size-ws-12',\n      },\n      disabled: {\n        true: 'pointer-events-none',\n        false: 'cursor-pointer',\n      },\n    },\n    compoundVariants: [\n      {\n        orientation: 'vertical',\n        status: ['incomplete', 'active'],\n        class:\n          'border-ws-dynamic-secondary-default hover:border-ws-dynamic-secondary-hover active:border-ws-dynamic-secondary-pressed group-hover:border-ws-dynamic-secondary-hover group-active:border-ws-dynamic-secondary-pressed border bg-transparent group-hover:bg-transparent group-active:bg-transparent hover:bg-transparent active:bg-transparent',\n      },\n      {\n        status: 'completed',\n        disabled: true,\n        class: 'bg-ws-dynamic-success-disabled text-ws-dynamic-on-success-disabled',\n      },\n      {\n        status: ['active', 'incomplete'],\n        disabled: true,\n        class:\n          'text-ws-dynamic-on-secondary-disabled border-ws-dynamic-secondary-disabled border bg-transparent',\n      },\n      {\n        orientation: 'vertical',\n        status: 'error',\n        class:\n          'bg-ws-static-foreground group-hover:bg-ws-static-foreground group-active:bg-ws-static-foreground hover:bg-ws-static-foreground active:bg-ws-static-foreground text-(--ws-dynamic-stroke-danger-strong-default) group-hover:text-(--ws-dynamic-text-danger-default) group-active:text-(--ws-dynamic-text-danger-hover) hover:text-(--ws-dynamic-text-danger-default) active:text-(--ws-dynamic-text-danger-hover)',\n      },\n    ],\n    defaultVariants: {\n      disabled: false,\n      orientation: 'horizontal',\n    },\n  },\n);\n\nexport const progressStepperIconContentVariants = cva('', {\n  variants: {\n    orientation: {\n      horizontal: 'size-ws-11',\n      vertical: 'size-ws-9',\n    },\n    status: {\n      completed: '',\n      incomplete: '',\n      active: '',\n      error: '',\n    },\n  },\n  compoundVariants: [],\n  defaultVariants: {\n    orientation: 'horizontal',\n  },\n});\n"
    },
    {
      "path": "src/components/progress-stepper/ProgressStepperIcon.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/progress-stepper/ProgressStepperIcon.tsx",
      "content": "'use client';\n\nimport { RiCheckLine, RiErrorWarningFill } from '@remixicon/react';\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { ProgressStepperIconProps } from './ProgressStepper.types';\nimport {\n  progressStepperIconContentVariants,\n  progressStepperIconVariants,\n} from './ProgressStepper.variants';\n\nconst defaultStepAriaLabel = (step: number) => `Step ${step + 1}`;\n\nconst ProgressStepperIcon = forwardRef<\n  HTMLButtonElement | HTMLDivElement,\n  ProgressStepperIconProps\n>(\n  (\n    {\n      step,\n      orientation,\n      status,\n      disabled,\n      interactive,\n      onClick,\n      stepAriaLabel = defaultStepAriaLabel,\n      className,\n      ...props\n    },\n    ref,\n  ) => {\n    const getContent = () => {\n      if (status === 'completed')\n        return (\n          <RiCheckLine\n            aria-hidden=\"true\"\n            focusable=\"false\"\n            className={progressStepperIconContentVariants({ orientation, status })}\n          />\n        );\n      if (status === 'error') {\n        // Vertical error inverts the dot: white background, red icon. The icon has\n        // to reach the edge or a white ring shows around it. Remix draws its circle\n        // at r=10 inside a 24 viewBox, so scale by 12/10 to bleed it to the edge.\n        if (orientation === 'vertical')\n          return (\n            <RiErrorWarningFill\n              aria-hidden=\"true\"\n              focusable=\"false\"\n              className=\"size-full scale-[1.2]\"\n            />\n          );\n        return (\n          <RiErrorWarningFill\n            aria-hidden=\"true\"\n            focusable=\"false\"\n            className={progressStepperIconContentVariants({ orientation, status })}\n          />\n        );\n      }\n      if (orientation === 'horizontal') return step + 1;\n      if (status === 'active')\n        return <div className=\"bg-ws-dynamic-primary-default size-ws-5 rounded-full\" />;\n      return null;\n    };\n\n    if (interactive) {\n      return (\n        <button\n          ref={ref as React.Ref<HTMLButtonElement>}\n          aria-label={stepAriaLabel(step)}\n          aria-current={status === 'active' ? 'step' : undefined}\n          className={cn(progressStepperIconVariants({ status, disabled, orientation }), className)}\n          onClick={() => onClick?.(step)}\n          type=\"button\"\n          disabled={!!disabled}\n          data-slot=\"progress-stepper-icon\"\n          {...(props as React.ButtonHTMLAttributes<HTMLButtonElement>)}\n        >\n          {getContent()}\n        </button>\n      );\n    }\n\n    return (\n      <div\n        ref={ref as React.Ref<HTMLDivElement>}\n        className={cn(progressStepperIconVariants({ status, disabled, orientation }), className)}\n        data-slot=\"progress-stepper-icon\"\n        {...(props as React.HTMLAttributes<HTMLDivElement>)}\n      >\n        {getContent()}\n      </div>\n    );\n  },\n);\n\nProgressStepperIcon.displayName = 'ProgressStepper.Icon';\n\nexport { ProgressStepperIcon };\n"
    },
    {
      "path": "src/components/progress-stepper/ProgressStepperStep.tsx",
      "type": "registry:ui",
      "target": "components/ui/wideset/progress-stepper/ProgressStepperStep.tsx",
      "content": "'use client';\n\nimport { forwardRef } from 'react';\nimport { cn } from '@/lib/wideset/utils';\n\nimport type { ProgressStepperStepProps } from './ProgressStepper.types';\nimport { progressStepperStepVariants } from './ProgressStepper.variants';\nimport { ProgressStepperIcon } from './ProgressStepperIcon';\n\ntype ProgressStepperStepInternalProps = ProgressStepperStepProps & {\n  withLine?: boolean;\n  isActive?: boolean;\n};\n\nconst ProgressStepperStep = forwardRef<HTMLLIElement, ProgressStepperStepInternalProps>(\n  (\n    {\n      title,\n      caption,\n      withLine,\n      isActive,\n      orientation,\n      className,\n      step,\n      status,\n      disabled,\n      onClick,\n      ...props\n    },\n    ref,\n  ) => {\n    const isStepInteractive = orientation === 'vertical';\n\n    const icon = (\n      <ProgressStepperIcon\n        step={step}\n        status={status}\n        disabled={disabled}\n        orientation={orientation}\n        interactive={false}\n      />\n    );\n\n    const content = (\n      <>\n        <div className=\"flex-none shrink-0\">{icon}</div>\n        <div className=\"flex flex-col items-start text-left\">\n          <span\n            className={cn(\n              'typography-label-strong-sm',\n              disabled ? 'text-ws-static-subtle' : 'text-ws-static-base',\n            )}\n          >\n            {title}\n          </span>\n\n          {caption && (\n            <span\n              className={cn(\n                'typography-body-sm',\n                disabled ? 'text-ws-static-inverse-subtle' : 'text-ws-static-subtle',\n              )}\n            >\n              {caption}\n            </span>\n          )}\n        </div>\n      </>\n    );\n\n    const stepClasses = cn(\n      progressStepperStepVariants({\n        status,\n        disabled,\n        withLine,\n        orientation,\n      }),\n      isStepInteractive\n        ? 'group flex cursor-pointer items-center disabled:cursor-default'\n        : 'flex items-center',\n      // No surface for error: Figma gives the error step no background in any\n      // state — default, hover, pressed or active — only a red focus ring.\n      className,\n    );\n    // Shrinks with its step: a squeezed stepper wraps a step's text instead of pushing it out\n    // of the step and under the next one's line.\n    const stepContentClass = 'flex min-w-0 items-center gap-ws-7';\n\n    return isStepInteractive ? (\n      <li\n        ref={ref}\n        aria-current={isActive ? 'step' : undefined}\n        data-slot=\"progress-stepper-step\"\n        {...props}\n      >\n        <button\n          className={stepClasses}\n          onClick={() => onClick?.(step)}\n          type=\"button\"\n          disabled={disabled ?? undefined}\n        >\n          <div className={cn(stepContentClass, 'px-ws-7 py-ws-5')}>{content}</div>\n        </button>\n      </li>\n    ) : (\n      <li\n        ref={ref}\n        aria-current={isActive ? 'step' : undefined}\n        className={stepClasses}\n        data-slot=\"progress-stepper-step\"\n        {...props}\n      >\n        {onClick ? (\n          <button\n            className={cn(\n              stepContentClass,\n              'group cursor-pointer focus-visible:outline-none disabled:cursor-default',\n            )}\n            onClick={() => onClick(step)}\n            type=\"button\"\n            disabled={!!disabled}\n          >\n            {content}\n          </button>\n        ) : (\n          <div className={stepContentClass}>{content}</div>\n        )}\n\n        {withLine && (\n          <div className=\"h-px min-w-[1rem] flex-1 grow bg-(--ws-static-stroke-base)\" role=\"none\" />\n        )}\n      </li>\n    );\n  },\n);\n\nProgressStepperStep.displayName = 'ProgressStepper.Step';\n\nexport { ProgressStepperStep };\n"
    }
  ],
  "meta": {
    "version": "1.0.0",
    "commit": "8bb3627"
  }
}
