{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "task-list",
  "type": "registry:block",
  "title": "Task list",
  "description": "Compact task rows with controlled completion, due dates, and comment counts.",
  "categories": [
    "blocks"
  ],
  "dependencies": [
    "@tabler/icons-react"
  ],
  "registryDependencies": [
    "card",
    "checkbox"
  ],
  "files": [
    {
      "path": "src/registry/overtrue/task-list.tsx",
      "type": "registry:component",
      "target": "components/overtrue/task-list.tsx",
      "content": "\"use client\";\nimport type { ComponentProps } from \"react\";\nimport { IconMessage } from \"@tabler/icons-react\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport { SectionCard } from \"./section-card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface TaskCardProps extends Omit<ComponentProps<\"li\">, \"title\"> {\n  title: string;\n  due?: string;\n  progressText?: string;\n  comments?: number;\n  done?: boolean;\n  disabled?: boolean;\n  onDoneChange?: (done: boolean) => void;\n}\nexport function TaskCard({\n  title,\n  due,\n  progressText,\n  comments = 0,\n  done = false,\n  disabled = false,\n  onDoneChange,\n  className,\n  ...props\n}: TaskCardProps) {\n  return (\n    <li\n      data-slot=\"task-card\"\n      className={cn(\n        \"flex flex-wrap items-center gap-3 border-b border-border py-3 last:border-0\",\n        className,\n      )}\n      {...props}\n    >\n      <Checkbox\n        aria-label={title}\n        checked={done}\n        disabled={disabled || !onDoneChange}\n        onCheckedChange={(checked) => onDoneChange?.(checked === true)}\n      />\n      <div className=\"min-w-0 flex-1\">\n        <p\n          className={cn(\n            \"m-0 break-words text-sm font-medium text-foreground\",\n            done && \"text-muted-foreground line-through\",\n          )}\n        >\n          {title}\n        </p>\n        {due && <p className=\"m-0 mt-1 text-xs text-muted-foreground\">{due}</p>}\n      </div>\n      {progressText && (\n        <span className=\"rounded bg-muted px-2 py-1 text-xs text-muted-foreground\">\n          {progressText}\n        </span>\n      )}\n      {comments > 0 && (\n        <span\n          aria-label={`${comments} comments`}\n          className=\"flex items-center gap-1 text-xs text-muted-foreground\"\n        >\n          <IconMessage aria-hidden=\"true\" className=\"size-3.5\" />\n          {comments}\n        </span>\n      )}\n    </li>\n  );\n}\nexport interface TaskItem extends Pick<\n  TaskCardProps,\n  \"title\" | \"due\" | \"progressText\" | \"comments\" | \"done\" | \"disabled\"\n> {\n  id: string;\n}\n/** Controlled completion state. Persist it in the caller's onTaskChange handler. */\nexport function TaskList({\n  tasks,\n  title = \"Tasks\",\n  onTaskChange,\n  className,\n  emptyMessage = \"No tasks yet.\",\n}: {\n  tasks: readonly TaskItem[];\n  title?: string;\n  onTaskChange?: (id: string, done: boolean) => void;\n  className?: string;\n  emptyMessage?: string;\n}) {\n  return (\n    <SectionCard\n      data-slot=\"task-list\"\n      title={title}\n      className={className}\n      contentClassName=\"py-2\"\n    >\n      {tasks.length ? (\n        <ul aria-label={title} className=\"m-0 list-none p-0\">\n          {tasks.map(({ id, ...task }) => (\n            <TaskCard\n              key={id}\n              {...task}\n              onDoneChange={\n                onTaskChange ? (done) => onTaskChange(id, done) : undefined\n              }\n            />\n          ))}\n        </ul>\n      ) : (\n        <p className=\"py-3 text-sm text-muted-foreground\">{emptyMessage}</p>\n      )}\n    </SectionCard>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/section-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/section-card.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport {\n  Card,\n  CardContent,\n  CardHeader,\n  CardTitle,\n  CardDescription,\n} from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SectionCardProps extends Omit<\n  ComponentProps<typeof Card>,\n  \"title\"\n> {\n  title?: ReactNode;\n  description?: ReactNode;\n  actions?: ReactNode;\n  contentClassName?: string;\n}\n\n/** A shared heading, actions and content surface for admin panels. */\nexport function SectionCard({\n  title,\n  description,\n  actions,\n  children,\n  className,\n  contentClassName,\n  ...props\n}: SectionCardProps) {\n  return (\n    <Card\n      data-slot=\"section-card\"\n      className={cn(\n        \"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground ring-0\",\n        \"shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\",\n        className,\n      )}\n      {...props}\n    >\n      {(title || description || actions) && (\n        <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-x-4 gap-y-3 border-b border-border/60 px-5 py-4 [.border-b]:pb-4\">\n          <div data-slot=\"section-card-heading\" className=\"min-w-0 flex-1\">\n            {title && (\n              <CardTitle className=\"m-0 text-sm leading-6 font-semibold tracking-tight text-card-foreground\">\n                {title}\n              </CardTitle>\n            )}\n            {description && (\n              <CardDescription className=\"m-0 mt-0.5 text-[13px] leading-5 text-muted-foreground\">\n                {description}\n              </CardDescription>\n            )}\n          </div>\n          {actions && (\n            <div\n              data-slot=\"section-card-actions\"\n              className=\"flex shrink-0 items-center gap-2\"\n            >\n              {actions}\n            </div>\n          )}\n        </CardHeader>\n      )}\n      <CardContent className={cn(\"p-5\", contentClassName)}>\n        {children}\n      </CardContent>\n    </Card>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/task-list. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
