{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "todo-list",
  "title": "Todo List",
  "description": "A live agent plan with completion counts, checkable tasks, and details you can expand.",
  "dependencies": [
    "@solar-icons/react@^2.2.0",
    "cn@^0.3.0",
    "motion@^13.4.0"
  ],
  "registryDependencies": [
    "collapsible",
    "https://pastaui.com/r/pastaui-styles.json"
  ],
  "files": [
    {
      "path": "src/components/ai/todo-list.tsx",
      "content": "import { AltArrowDownIcon as ChevronDownIcon } from '@solar-icons/react/linear/alt-arrow-down'\nimport { ChecklistIcon as ListTodoIcon } from '@solar-icons/react/linear/checklist'\nimport { LoaderIcon as LoaderCircleIcon } from '@solar-icons/react/linear/loader'\nimport * as React from 'react'\nimport { AnimatePresence, MotionConfig, motion } from 'motion/react'\n\nimport { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible'\nimport { cn } from 'cn'\n\ninterface AgentTodoItem {\n  detail?: string\n  id: string\n  label: string\n  status: 'complete' | 'in-progress' | 'pending'\n}\n\ninterface TodoListProps extends React.ComponentProps<typeof Collapsible> {\n  items: AgentTodoItem[]\n  onItemToggle?: (id: string) => void\n  title?: string\n}\n\nconst ease = [0.23, 1, 0.32, 1] as const\nconst spring = { type: 'spring', stiffness: 500, damping: 30 } as const\n\nfunction TodoList({\n  className,\n  defaultOpen = true,\n  items,\n  onItemToggle,\n  title = 'Plan',\n  ...props\n}: TodoListProps) {\n  const complete = items.filter((item) => item.status === 'complete').length\n  const [openId, setOpenId] = React.useState<string>()\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      <Collapsible\n        data-slot=\"todo-list\"\n        className={cn(\n          'rounded-[16px] bg-card p-4 font-sans text-sm font-[450] tracking-[-0.05px] text-muted-foreground shadow-card',\n          className,\n        )}\n        defaultOpen={defaultOpen}\n        {...props}\n      >\n        <CollapsibleTrigger\n          className=\"group flex w-full items-center gap-2 rounded-sm text-left card-heading leading-5 outline-none focus-visible:ring-2 focus-visible:ring-ring/30\"\n          render={<button aria-label=\"Toggle agent plan\" type=\"button\" />}\n        >\n          <ListTodoIcon aria-hidden=\"true\" className=\"size-4 shrink-0\" />\n          <span>{title}</span>\n          <span className=\"ml-auto flex shrink-0 overflow-hidden text-xs leading-5 font-[450] text-muted-foreground tabular-nums\">\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              <motion.span\n                animate={{ opacity: 1, y: 0 }}\n                exit={{ opacity: 0, y: -10 }}\n                initial={{ opacity: 0, y: 10 }}\n                key={complete}\n                transition={spring}\n              >\n                {complete}\n              </motion.span>\n            </AnimatePresence>\n            /{items.length}\n          </span>\n          <ChevronDownIcon className=\"size-4 shrink-0 text-muted-foreground transition-[rotate] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] group-data-panel-open:rotate-180 motion-reduce:transition-none\" />\n        </CollapsibleTrigger>\n        <div className=\"mt-3 h-0.5 overflow-hidden rounded-full bg-muted\">\n          <motion.div\n            animate={{ scaleX: items.length ? complete / items.length : 0 }}\n            className=\"h-full origin-left rounded-full bg-foreground/50\"\n            initial={false}\n            transition={{ duration: 0.5, ease }}\n          />\n        </div>\n        <CollapsibleContent className=\"h-(--collapsible-panel-height) overflow-hidden transition-[height,opacity] duration-200 ease-[cubic-bezier(0.23,1,0.32,1)] data-ending-style:h-0 data-ending-style:opacity-0 data-starting-style:h-0 data-starting-style:opacity-0 motion-reduce:transition-opacity\">\n          <ol className=\"mt-4 space-y-3\">\n            {items.map((item) => (\n              <motion.li\n                animate={{ opacity: item.status === 'pending' ? 0.6 : 1 }}\n                className=\"flex gap-3\"\n                initial={false}\n                key={item.id}\n                transition={{ duration: 0.3, ease }}\n              >\n                {onItemToggle ? (\n                  <button\n                    aria-label={\n                      item.status === 'complete'\n                        ? `Mark ${item.label} as not done`\n                        : `Mark ${item.label} as done`\n                    }\n                    aria-pressed={item.status === 'complete'}\n                    className=\"-m-1 rounded-full p-1 transition-[scale] duration-150 outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring/30 active:scale-90\"\n                    onClick={() => onItemToggle(item.id)}\n                    type=\"button\"\n                  >\n                    <TodoStatus status={item.status} />\n                  </button>\n                ) : (\n                  <TodoStatus status={item.status} />\n                )}\n                <div className=\"min-w-0 flex-1\">\n                  <p\n                    aria-expanded={\n                      item.detail ? openId === item.id || item.status === 'in-progress' : undefined\n                    }\n                    className={cn(\n                      'relative w-fit max-w-full cursor-default text-sm leading-5 font-[450] transition-colors duration-300',\n                      item.detail &&\n                        item.status !== 'in-progress' &&\n                        'cursor-pointer hover:text-foreground',\n                      item.status === 'in-progress' && 'agent-text-shimmer',\n                    )}\n                  >\n                    {item.label}\n                    {item.detail && item.status !== 'in-progress' && (\n                      <button\n                        aria-label={\n                          openId === item.id\n                            ? `Hide details for ${item.label}`\n                            : `Show details for ${item.label}`\n                        }\n                        className=\"absolute inset-0 rounded-sm outline-none focus-visible:ring-2 focus-visible:ring-ring/30\"\n                        onClick={() =>\n                          setOpenId((current) => (current === item.id ? undefined : item.id))\n                        }\n                        type=\"button\"\n                      />\n                    )}\n                    <motion.span\n                      animate={{ scaleX: item.status === 'complete' ? 1 : 0 }}\n                      aria-hidden=\"true\"\n                      className=\"absolute inset-x-0 top-1/2 h-px origin-left bg-current\"\n                      initial={false}\n                      transition={{ duration: 0.35, ease }}\n                    />\n                  </p>\n                  <AnimatePresence initial={false}>\n                    {item.detail && (item.status === 'in-progress' || openId === item.id) && (\n                      <motion.p\n                        animate={{ height: 'auto', opacity: 1 }}\n                        className=\"overflow-hidden text-xs leading-5 font-[450] text-muted-foreground\"\n                        exit={{ height: 0, opacity: 0 }}\n                        initial={{ height: 0, opacity: 0 }}\n                        transition={{ duration: 0.25, ease }}\n                      >\n                        <span className=\"block pt-0.5\">{item.detail}</span>\n                      </motion.p>\n                    )}\n                  </AnimatePresence>\n                </div>\n              </motion.li>\n            ))}\n          </ol>\n        </CollapsibleContent>\n      </Collapsible>\n    </MotionConfig>\n  )\n}\n\nfunction TodoStatus({ status }: Pick<AgentTodoItem, 'status'>) {\n  return (\n    <span className=\"relative mt-0.5 flex size-4 shrink-0 items-center justify-center\">\n      <AnimatePresence initial={false} mode=\"popLayout\">\n        <motion.span\n          animate={{ opacity: 1, scale: 1 }}\n          className=\"flex size-4 items-center justify-center\"\n          exit={{ opacity: 0, scale: 0.6 }}\n          initial={{ opacity: 0, scale: 0.6 }}\n          key={status}\n          transition={spring}\n        >\n          {status === 'complete' ? (\n            <>\n              <svg\n                aria-hidden=\"true\"\n                className=\"size-4 text-emerald-500\"\n                viewBox=\"0 0 16 16\"\n              >\n                <circle cx=\"8\" cy=\"8\" fill=\"currentColor\" r=\"7.5\" />\n                <motion.path\n                  animate={{ pathLength: 1 }}\n                  d=\"M5 8.25 7 10.25 11 6\"\n                  fill=\"none\"\n                  initial={{ pathLength: 0 }}\n                  stroke=\"white\"\n                  strokeLinecap=\"round\"\n                  strokeLinejoin=\"round\"\n                  strokeWidth=\"1.5\"\n                  transition={{ delay: 0.08, duration: 0.3, ease }}\n                />\n              </svg>\n              <span className=\"sr-only\">Complete</span>\n            </>\n          ) : status === 'in-progress' ? (\n            <LoaderCircleIcon\n              aria-label=\"In progress\"\n              className=\"size-3.5 animate-spin motion-reduce:animate-none\"\n            />\n          ) : (\n            <>\n              <span aria-hidden=\"true\" className=\"size-3.5 rounded-full border border-current\" />\n              <span className=\"sr-only\">Pending</span>\n            </>\n          )}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  )\n}\n\nexport { TodoList }\nexport type { AgentTodoItem, TodoListProps }\nexport default TodoList\n",
      "type": "registry:component",
      "target": "@components/ai/todo-list.tsx"
    }
  ],
  "css": {
    ".agent-text-shimmer": {
      "color": "transparent",
      "background-image": "linear-gradient( 90deg, var(--muted-foreground), var(--foreground), var(--muted-foreground) )",
      "background-size": "200% 100%",
      "background-clip": "text",
      "animation": "agent-text-shimmer 1.6s linear infinite"
    },
    "@keyframes agent-text-shimmer": {
      "from": {
        "background-position": "200% 0"
      },
      "to": {
        "background-position": "-200% 0"
      }
    },
    "@media (prefers-reduced-motion: reduce)": {
      ".agent-text-shimmer": {
        "color": "var(--muted-foreground)",
        "background-image": "none",
        "animation": "none"
      }
    }
  },
  "type": "registry:component"
}