{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-plan",
  "title": "AI: Plan",
  "description": "A collapsible multi-step plan card with per-step status and actions.",
  "dependencies": [
    "@untitledui/icons@^0.0.22"
  ],
  "registryDependencies": [
    "@nx-ui/utils",
    "@nx-ui/button",
    "@nx-ui/card",
    "@nx-ui/collapsible",
    "@nx-ui/ai-shimmer"
  ],
  "files": [
    {
      "path": "components/ai/plan.tsx",
      "content": "\"use client\"\n\nimport { type ComponentProps, createContext, useContext } from \"react\"\nimport { ChevronSelectorVertical } from \"@untitledui/icons\"\n\nimport { Button } from \"@/components/ui/button\"\nimport {\n  Card,\n  CardAction,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport {\n  Collapsible,\n  CollapsibleContent,\n  CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { cn } from \"@/lib/utils\"\n\nimport { Shimmer } from \"./shimmer\"\n\ntype PlanContextValue = {\n  isStreaming: boolean\n}\n\nconst PlanContext = createContext<PlanContextValue | null>(null)\n\nconst usePlan = () => {\n  const context = useContext(PlanContext)\n  if (!context) {\n    throw new Error(\"Plan components must be used within Plan\")\n  }\n  return context\n}\n\nexport type PlanProps = ComponentProps<typeof Collapsible> & {\n  isStreaming?: boolean\n}\n\nexport const Plan = ({\n  className,\n  isStreaming = false,\n  children,\n  ...props\n}: PlanProps) => (\n  <PlanContext.Provider value={{ isStreaming }}>\n    <Collapsible\n      data-slot=\"plan\"\n      render={<Card className={cn(\"shadow-none\", className)} />}\n      {...props}\n    >\n      {children}\n    </Collapsible>\n  </PlanContext.Provider>\n)\n\nexport type PlanHeaderProps = ComponentProps<typeof CardHeader>\n\nexport const PlanHeader = ({ className, ...props }: PlanHeaderProps) => (\n  <CardHeader\n    className={cn(\"flex items-start justify-between\", className)}\n    data-slot=\"plan-header\"\n    {...props}\n  />\n)\n\nexport type PlanTitleProps = Omit<\n  ComponentProps<typeof CardTitle>,\n  \"children\"\n> & {\n  children: string\n}\n\nexport const PlanTitle = ({ children, ...props }: PlanTitleProps) => {\n  const { isStreaming } = usePlan()\n\n  return (\n    <CardTitle data-slot=\"plan-title\" {...props}>\n      {isStreaming ? <Shimmer>{children}</Shimmer> : children}\n    </CardTitle>\n  )\n}\n\nexport type PlanDescriptionProps = Omit<\n  ComponentProps<typeof CardDescription>,\n  \"children\"\n> & {\n  children: string\n}\n\nexport const PlanDescription = ({\n  className,\n  children,\n  ...props\n}: PlanDescriptionProps) => {\n  const { isStreaming } = usePlan()\n\n  return (\n    <CardDescription\n      className={cn(\"text-balance\", className)}\n      data-slot=\"plan-description\"\n      {...props}\n    >\n      {isStreaming ? <Shimmer>{children}</Shimmer> : children}\n    </CardDescription>\n  )\n}\n\nexport type PlanActionProps = ComponentProps<typeof CardAction>\n\nexport const PlanAction = (props: PlanActionProps) => (\n  <CardAction data-slot=\"plan-action\" {...props} />\n)\n\nexport type PlanContentProps = ComponentProps<typeof CardContent>\n\nexport const PlanContent = (props: PlanContentProps) => (\n  <CollapsibleContent\n    render={<CardContent data-slot=\"plan-content\" {...props} />}\n  />\n)\n\nexport type PlanFooterProps = ComponentProps<\"div\">\n\nexport const PlanFooter = (props: PlanFooterProps) => (\n  <CardFooter data-slot=\"plan-footer\" {...props} />\n)\n\nexport type PlanTriggerProps = ComponentProps<typeof CollapsibleTrigger>\n\nexport const PlanTrigger = ({ className, ...props }: PlanTriggerProps) => (\n  <CollapsibleTrigger\n    data-slot=\"plan-trigger\"\n    render={\n      <Button className={cn(\"size-8\", className)} size=\"icon\" variant=\"ghost\" />\n    }\n    {...props}\n  >\n    <ChevronSelectorVertical className=\"size-4\" />\n    <span className=\"sr-only\">Toggle plan</span>\n  </CollapsibleTrigger>\n)\n",
      "type": "registry:ui",
      "target": "components/ai/plan.tsx"
    }
  ],
  "type": "registry:ui"
}