{ "name": "chain-of-thought", "type": "registry:ui", "registryDependencies": [ "collapsible" ], "dependencies": [ "lucide-react" ], "devDependencies": [], "tailwind": {}, "cssVars": { "light": {}, "dark": {} }, "description": "A component for displaying a chain of thought process with collapsible steps and triggers.", "files": [ { "path": "chain-of-thought.tsx", "content": "\"use client\"\n\nimport {\n Collapsible,\n CollapsibleContent,\n CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\nimport { cn } from \"@/lib/utils\"\nimport { ChevronDown, Circle } from \"lucide-react\"\nimport React from \"react\"\n\nexport type ChainOfThoughtItemProps = React.ComponentProps<\"div\">\n\nexport const ChainOfThoughtItem = ({\n children,\n className,\n ...props\n}: ChainOfThoughtItemProps) => (\n
\n {children}\n
\n)\n\nexport type ChainOfThoughtTriggerProps = React.ComponentProps<\n typeof CollapsibleTrigger\n> & {\n leftIcon?: React.ReactNode\n swapIconOnHover?: boolean\n}\n\nexport const ChainOfThoughtTrigger = ({\n children,\n className,\n leftIcon,\n swapIconOnHover = true,\n ...props\n}: ChainOfThoughtTriggerProps) => (\n \n
\n {leftIcon ? (\n \n \n {leftIcon}\n \n {swapIconOnHover && (\n \n )}\n \n ) : (\n \n \n \n )}\n {children}\n
\n {!leftIcon && (\n \n )}\n \n)\n\nexport type ChainOfThoughtContentProps = React.ComponentProps<\n typeof CollapsibleContent\n>\n\nexport const ChainOfThoughtContent = ({\n children,\n className,\n ...props\n}: ChainOfThoughtContentProps) => {\n return (\n \n
\n
\n
\n
{children}
\n
\n \n )\n}\n\nexport type ChainOfThoughtProps = {\n children: React.ReactNode\n className?: string\n}\n\nexport function ChainOfThought({ children, className }: ChainOfThoughtProps) {\n const childrenArray = React.Children.toArray(children)\n\n return (\n
\n {childrenArray.map((child, index) => (\n \n {React.isValidElement(child) &&\n React.cloneElement(\n child as React.ReactElement,\n {\n isLast: index === childrenArray.length - 1,\n }\n )}\n \n ))}\n
\n )\n}\n\nexport type ChainOfThoughtStepProps = {\n children: React.ReactNode\n className?: string\n isLast?: boolean\n}\n\nexport const ChainOfThoughtStep = ({\n children,\n className,\n isLast = false,\n ...props\n}: ChainOfThoughtStepProps & React.ComponentProps) => {\n return (\n \n {children}\n
\n
\n
\n \n )\n}\n", "type": "registry:ui" } ] }