{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "plan",
  "registryDependencies": [
    "https://taki-ui.com/r/card.json",
    "https://taki-ui.com/r/disclosure.json",
    "https://taki-ui.com/r/button.json",
    "https://taki-ui.com/r/shimmer.json"
  ],
  "files": [
    {
      "path": "registry/new-york/ai-elements/plan.tsx",
      "content": "\"use client\"\n\nimport type { ComponentProps } from \"react\"\nimport { createContext, useContext } from \"react\"\nimport { ChevronsUpDownIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport { Button } from \"@/registry/new-york/ui/button\"\nimport {\n  Card,\n  CardAction,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/registry/new-york/ui/card\"\nimport { Disclosure, DisclosurePanel } from \"@/registry/new-york/ui/disclosure\"\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 Disclosure> & {\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    <Card className={cn(\"shadow-none\", className)}>\n      <Disclosure data-slot=\"plan\" {...props}>\n        {children}\n      </Disclosure>\n    </Card>\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  <DisclosurePanel className={cn(\"pt-4\", props.className)}>\n    <CardContent data-slot=\"plan-content\" {...props} />\n  </DisclosurePanel>\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 Button>\n\nexport const PlanTrigger = ({ className, ...props }: PlanTriggerProps) => (\n  <Button\n    className={cn(\"size-8\", className)}\n    data-slot=\"plan-trigger\"\n    size=\"icon\"\n    variant=\"ghost\"\n    slot=\"trigger\"\n    {...props}\n  >\n    <ChevronsUpDownIcon className=\"size-4\" />\n    <span className=\"sr-only\">Toggle plan</span>\n  </Button>\n)\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}