{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-wizard",
  "title": "Wizard",
  "description": "Wizard multi-step — ReUI Wizard 7.",
  "dependencies": [],
  "registryDependencies": [
    "@lema-ds/card",
    "@lema-ds/button",
    "@lema-ds/progress",
    "@lema-ds/skeleton"
  ],
  "files": [
    {
      "path": "components/ds/ds-wizard.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Card } from \"@/components/ui/card\"\nimport { Button } from \"@/components/ui/button\"\nimport { Progress } from \"@/components/ui/progress\"\nimport { Skeleton } from \"@/components/ui/skeleton\"\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface WizardStep {\n  id: string\n  title: string\n  content: React.ReactNode\n}\n\nexport interface WizardProps extends React.HTMLAttributes<HTMLDivElement> {\n  steps: WizardStep[]\n  currentId?: string\n  onStepChange?: (id: string) => void\n  loading?: boolean\n}\n\n// ── Component ──────────────────────────────────────────────────────────────\n\nexport function Wizard({\n  className,\n  steps,\n  currentId,\n  onStepChange,\n  loading = false,\n  ...props\n}: WizardProps) {\n  const [current, setCurrent] = React.useState(currentId ?? steps[0]?.id)\n  const resolved = currentId ?? current\n\n  const idx = steps.findIndex((s) => s.id === resolved)\n  const progress = ((idx + 1) / steps.length) * 100\n\n  const handleChange = (id: string) => {\n    if (!currentId) setCurrent(id)\n    onStepChange?.(id)\n  }\n\n  if (loading) {\n    return (\n      <Card\n        data-slot=\"wizard-skeleton\"\n        className={cn(\"p-6\", className)}\n        {...props}\n      >\n        <Skeleton className=\"h-40 w-full\" />\n      </Card>\n    )\n  }\n\n  const step = steps[idx]\n\n  return (\n    <Card data-slot=\"wizard\" className={cn(\"p-6\", className)} {...props}>\n      <div className=\"flex flex-col gap-4\">\n        <Progress\n          value={progress}\n          aria-label={`Step ${idx + 1} of ${steps.length}: ${step?.title ?? \"\"}`}\n          aria-valuenow={Math.round(progress)}\n          aria-valuemin={0}\n          aria-valuemax={100}\n          className=\"h-1\"\n        />\n        <div className=\"flex gap-2\">\n          {steps.map((s, i) => (\n            <button\n              key={s.id}\n              onClick={() => handleChange(s.id)}\n              className={cn(\n                \"h-7 rounded-full px-3 text-xs font-medium\",\n                s.id === resolved\n                  ? \"bg-primary text-primary-foreground\"\n                  : \"bg-muted text-muted-foreground\"\n              )}\n              aria-current={s.id === resolved ? \"step\" : undefined}\n            >\n              {i + 1}. {s.title}\n            </button>\n          ))}\n        </div>\n        <div className=\"rounded-xl border bg-muted/20 p-4\">{step?.content}</div>\n        <div className=\"flex justify-between gap-2\">\n          <Button\n            variant=\"ghost\"\n            size=\"sm\"\n            disabled={idx === 0}\n            onClick={() => handleChange(steps[idx - 1]?.id)}\n            className=\"rounded-full\"\n          >\n            Back\n          </Button>\n          <Button\n            size=\"sm\"\n            disabled={idx === steps.length - 1}\n            onClick={() => handleChange(steps[idx + 1]?.id)}\n            className=\"rounded-full\"\n          >\n            Next\n          </Button>\n        </div>\n      </div>\n    </Card>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "wizard"
  ],
  "type": "registry:block"
}
