{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "task",
  "title": "Task",
  "author": "Jamie Thompson <jamie@jamiethompson.design> (https://jamiethompson.design)",
  "description": "Collapsible task log for agent activity: a search-icon trigger with a title and rotating chevron, and an indented list of TaskItem rows with inline TaskItemFile chips for filenames. Use it inside a chat message to show what an agent did in a step, such as files read or searches run. Open by default; composes shadcn collapsible.",
  "dependencies": [
    "cn",
    "lucide-react"
  ],
  "registryDependencies": [
    "collapsible"
  ],
  "files": [
    {
      "path": "registry/ai/task.tsx",
      "content": "// Derived from Vercel AI Elements task.tsx (Apache-2.0, Copyright 2023 Vercel, Inc.).\n// Modified for uifiles: ported from Radix UI to Base UI; dependencies point at @uifiles.\n\"use client\"\n\nimport { cn } from \"cn\"\nimport { ChevronDownIcon, SearchIcon } from \"lucide-react\"\nimport type { ComponentProps } from \"react\"\nimport {\n  Collapsible,\n  CollapsibleContent,\n  CollapsibleTrigger,\n} from \"@/components/ui/collapsible\"\n\nexport type TaskItemFileProps = ComponentProps<\"div\">\n\nexport const TaskItemFile = ({\n  children,\n  className,\n  ...props\n}: TaskItemFileProps) => (\n  <div\n    className={cn(\n      \"inline-flex items-center gap-1 rounded-md border bg-secondary px-1.5 py-0.5 text-xs text-foreground\",\n      className\n    )}\n    {...props}\n  >\n    {children}\n  </div>\n)\n\nexport type TaskItemProps = ComponentProps<\"div\">\n\nexport const TaskItem = ({ children, className, ...props }: TaskItemProps) => (\n  <div className={cn(\"text-sm text-muted-foreground\", className)} {...props}>\n    {children}\n  </div>\n)\n\nexport type TaskProps = ComponentProps<typeof Collapsible>\n\nexport const Task = ({\n  defaultOpen = true,\n  className,\n  ...props\n}: TaskProps) => (\n  <Collapsible className={cn(className)} defaultOpen={defaultOpen} {...props} />\n)\n\nexport type TaskTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {\n  title: string\n}\n\nexport const TaskTrigger = ({\n  children,\n  className,\n  title,\n  ...props\n}: TaskTriggerProps) => (\n  <CollapsibleTrigger\n    className={cn(\n      \"group flex min-h-6 w-full cursor-pointer items-center gap-2 text-left text-sm text-muted-foreground transition-colors hover:text-foreground\",\n      className\n    )}\n    {...props}\n  >\n    {children ?? (\n      <>\n        <SearchIcon className=\"size-4\" />\n        <span className=\"text-sm\">{title}</span>\n        <ChevronDownIcon className=\"size-4 transition-transform group-data-panel-open:rotate-180\" />\n      </>\n    )}\n  </CollapsibleTrigger>\n)\n\nexport type TaskContentProps = ComponentProps<typeof CollapsibleContent>\n\nexport const TaskContent = ({\n  children,\n  className,\n  ...props\n}: TaskContentProps) => (\n  <CollapsibleContent\n    className={cn(\n      \"text-popover-foreground outline-none data-open:animate-in data-open:slide-in-from-top-2 data-closed:animate-out data-closed:fade-out-0 data-closed:slide-out-to-top-2\",\n      className\n    )}\n    {...props}\n  >\n    <div className=\"mt-4 space-y-2 border-l-2 border-muted pl-4\">\n      {children}\n    </div>\n  </CollapsibleContent>\n)\n",
      "type": "registry:component",
      "target": "components/ai/task.tsx"
    }
  ],
  "docs": "Derived from Vercel AI Elements (Apache-2.0, Copyright 2023 Vercel, Inc.); ported to Base UI and maintained by uifiles. Built for the Base UI styles (base-nova): it composes the Base UI wrappers from components/ui and relies on their render prop and event signatures, so it does not work on Radix or React Aria styles. Base UI port of AI Elements task. TaskTrigger renders the Collapsible trigger's native <button> (upstream rendered a <div> through asChild); custom children render inside that button instead of replacing it, so they must be phrasing content without interactive descendants (no nested buttons or links); `render` substitutes the element (pass nativeButton={false} for a non-button). The default label is a <span> (was <p>, which is invalid inside a button). The trigger row is min-h-6 (24px) to meet the WCAG 2.2 target size. The chevron rotates on the trigger's data-panel-open attribute (was group-data-[state=open]); TaskContent animates on data-open / data-closed and takes Collapsible.Panel props such as keepMounted. onOpenChange receives (open, eventDetails).",
  "categories": [
    "ai",
    "chat",
    "agent"
  ],
  "type": "registry:component"
}