{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "todo-list",
  "type": "registry:component",
  "title": "Todo List",
  "description": "Agent todo checklist card with progress.",
  "files": [
    {
      "path": "registry/tonic/todo-list/todo-list.tsx",
      "content": "\"use client\"\n\nimport { CheckIcon, Loader2Icon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nexport const TODO_STATUSES = [\n  \"pending\",\n  \"in_progress\",\n  \"completed\",\n  \"cancelled\",\n] as const\n\nexport const TODO_PRIORITIES = [\"high\", \"medium\", \"low\"] as const\n\nexport type TodoStatus = (typeof TODO_STATUSES)[number]\nexport type TodoPriority = (typeof TODO_PRIORITIES)[number]\n\nexport type AgentTodo = {\n  readonly content: string\n  readonly status: TodoStatus\n  readonly priority: TodoPriority\n}\n\nexport function todoProgress(items: readonly AgentTodo[]) {\n  const tracked = items.filter((item) => item.status !== \"cancelled\").length\n  const completed = items.filter((item) => item.status === \"completed\").length\n  return { completed, tracked }\n}\n\nfunction StatusMark({ status }: { readonly status: AgentTodo[\"status\"] }) {\n  if (status === \"completed\") {\n    return (\n      <CheckIcon\n        aria-hidden\n        className=\"text-foreground/55 mt-0.5 size-3.5 shrink-0\"\n      />\n    )\n  }\n  if (status === \"in_progress\") {\n    return (\n      <Loader2Icon\n        aria-hidden\n        className=\"text-foreground/70 mt-0.5 size-3.5 shrink-0 animate-spin motion-reduce:animate-none\"\n      />\n    )\n  }\n  if (status === \"cancelled\") {\n    return (\n      <span\n        aria-hidden\n        className=\"border-foreground/25 mt-1 size-3 shrink-0 rounded-full border border-dashed\"\n      />\n    )\n  }\n  return (\n    <span\n      aria-hidden\n      className=\"border-foreground/35 mt-1 size-3 shrink-0 rounded-full border\"\n    />\n  )\n}\n\nfunction TodoRow({ item }: { readonly item: AgentTodo }) {\n  const done = item.status === \"completed\" || item.status === \"cancelled\"\n  return (\n    <li className=\"flex items-start gap-2\">\n      <StatusMark status={item.status} />\n      <span\n        className={cn(\n          \"min-w-0 flex-1 text-[13px] leading-5\",\n          done\n            ? \"text-muted-foreground line-through decoration-muted-foreground/70\"\n            : \"text-foreground/90\"\n        )}\n      >\n        {item.content}\n      </span>\n      {item.priority === \"high\" && !done ? (\n        <span className=\"text-foreground/45 pt-0.5 text-[11px] tracking-wide uppercase\">\n          High\n        </span>\n      ) : null}\n    </li>\n  )\n}\n\nexport function TodoListCard({\n  items,\n  updating = false,\n}: {\n  readonly items: readonly AgentTodo[]\n  readonly updating?: boolean\n}) {\n  const { completed, tracked } = todoProgress(items)\n  const fraction = tracked === 0 ? 1 : completed / tracked\n  const countLabel =\n    items.length === 0\n      ? \"Updating\"\n      : tracked === 0\n        ? \"Cleared\"\n        : `${completed} of ${tracked}`\n\n  return (\n    <section\n      aria-label={`To-dos, ${countLabel}`}\n      className=\"border-border/60 bg-foreground/[0.02] w-full rounded-xl border px-3 py-2.5\"\n      data-slot=\"todo-list\"\n    >\n      <div className=\"flex items-center justify-between gap-3\">\n        <h3 className=\"text-foreground/80 text-[13px] font-medium\">To-dos</h3>\n        <p className=\"text-muted-foreground text-[12px] tabular-nums\">\n          {updating && items.length === 0 ? \"Updating…\" : countLabel}\n        </p>\n      </div>\n      {tracked > 0 ? (\n        <div\n          aria-hidden\n          className=\"bg-foreground/10 mt-2 h-0.5 overflow-hidden rounded-full\"\n        >\n          <div\n            className=\"bg-foreground/55 h-full rounded-full\"\n            style={{ width: `${Math.round(fraction * 100)}%` }}\n          />\n        </div>\n      ) : null}\n      {items.length > 0 ? (\n        <ul className=\"mt-2 flex flex-col gap-1.5\">\n          {items.map((item, index) => (\n            <TodoRow item={item} key={`${index}-${item.content}`} />\n          ))}\n        </ul>\n      ) : null}\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ]
}