{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "reasoning-demo",
  "title": "Reasoning: Example",
  "description": "Thoughts stream in, then it folds away.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.cuelark.com/r/button.json",
    "https://ui.cuelark.com/r/reasoning.json"
  ],
  "files": [
    {
      "path": "src/registry/cuelark/examples/reasoning-demo.tsx",
      "content": "import * as React from \"react\";\n\nimport { Button } from \"@/registry/cuelark/ui/button\";\nimport { Reasoning } from \"@/registry/cuelark/ui/reasoning\";\n\nconst thoughts = [\n  \"The user wants the invoice total to include tax only when a tax ID is present.\",\n  \"Totals are computed in two places: the API and the PDF renderer. Both need the same rule.\",\n  \"Safest change: move the rule into a shared helper and call it from both.\",\n  \"Add a test for invoices with and without a tax ID.\",\n];\n\nexport default function ReasoningDemo() {\n  const [shown, setShown] = React.useState(0);\n  const streaming = shown < thoughts.length;\n  React.useEffect(() => {\n    if (!streaming) return;\n    const id = setTimeout(() => setShown((n) => n + 1), 900);\n    return () => clearTimeout(id);\n  }, [shown, streaming]);\n  return (\n    <div className=\"grid w-full max-w-lg gap-4\">\n      <Reasoning streaming={streaming}>\n        {thoughts.slice(0, shown).map((t) => (\n          <p key={t}>{t}</p>\n        ))}\n      </Reasoning>\n      <Button variant=\"ghost\" size=\"xs\" className=\"w-fit\" onClick={() => setShown(0)}>\n        Think again\n      </Button>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "reasoning",
    "example"
  ],
  "type": "registry:component"
}