{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "task-solid",
  "title": "Task (Solid)",
  "description": "The steps an agent takes for a task, as it takes them, with how many are done.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/task.tsx",
      "content": "import { taskPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { For, omit } from \"solid-js\";\n\nconst parts = createParts(taskPrimitive, {\n  root: \"div\",\n  trigger: \"button\",\n  icon: \"span\",\n  title: \"span\",\n  meta: \"span\",\n  content: \"div\",\n  list: \"ol\",\n  item: \"li\",\n  \"item-icon\": \"span\",\n  \"item-title\": \"span\",\n  \"item-files\": \"span\",\n});\n\nexport type TaskProps = ComponentProps<typeof parts.Root>;\n\n/**\n * The steps an agent takes for one task, as it takes them, with how many are done. Any `children` replace the\n * default trigger and content.\n */\nexport function Task(props: TaskProps) {\n  return <parts.Root {...omit(props, \"children\")}>{props.children ?? <DefaultParts />}</parts.Root>;\n}\n\nexport const TaskTrigger = parts.Trigger;\nexport const TaskIcon = parts.Icon;\nexport const TaskContent = parts.Content;\nexport const TaskItemIcon = parts.ItemIcon;\n\nexport type TaskTitleProps = ComponentProps<typeof parts.Title>;\n\n/** The `label`, else \"Task\", unless you pass children. */\nexport function TaskTitle(props: TaskTitleProps) {\n  return <parts.Title {...omit(props, \"children\")}>{props.children ?? ((state) => state.title)}</parts.Title>;\n}\n\nexport type TaskMetaProps = ComponentProps<typeof parts.Meta>;\n\n/** How many items are complete, as \"2 of 5\", unless you pass children. */\nexport function TaskMeta(props: TaskMetaProps) {\n  return (\n    <parts.Meta {...omit(props, \"children\")}>\n      {props.children ?? ((state) => `${state.done} of ${state.total}`)}\n    </parts.Meta>\n  );\n}\n\nexport type TaskListProps = ComponentProps<typeof parts.List>;\n\n/** An item for each of the `items`, unless you pass children. */\nexport function TaskList(props: TaskListProps) {\n  return (\n    <parts.List {...omit(props, \"children\")}>\n      {props.children ??\n        ((state) => (\n          <For each={state.items} keyed={(item) => item.id}>\n            {(item) => <TaskItem value={item().id} />}\n          </For>\n        ))}\n    </parts.List>\n  );\n}\n\nexport type TaskItemProps = ComponentProps<typeof parts.Item>;\n\n/** The item whose `id` is `value`. Without children, it shows the item's mark, title and files. */\nexport function TaskItem(props: TaskItemProps) {\n  return <parts.Item {...omit(props, \"children\")}>{props.children ?? <DefaultItemParts />}</parts.Item>;\n}\n\nexport type TaskItemTitleProps = ComponentProps<typeof parts.ItemTitle>;\n\n/** The item's `title`, unless you pass children. */\nexport function TaskItemTitle(props: TaskItemTitleProps) {\n  return (\n    <parts.ItemTitle {...omit(props, \"children\")}>\n      {props.children ?? ((state) => state.title)}\n    </parts.ItemTitle>\n  );\n}\n\nexport type TaskItemFilesProps = ComponentProps<typeof parts.ItemFiles>;\n\n/** The item's `files`, each as code, unless you pass children. Rendered only while the item has files. */\nexport function TaskItemFiles(props: TaskItemFilesProps) {\n  return (\n    <parts.ItemFiles {...omit(props, \"children\")}>\n      {props.children ??\n        ((state) => (\n          <For each={state.files} keyed={false}>\n            {(file) => <code>{file()}</code>}\n          </For>\n        ))}\n    </parts.ItemFiles>\n  );\n}\n\nfunction DefaultItemParts() {\n  return (\n    <>\n      <TaskItemIcon />\n      <TaskItemTitle />\n      <TaskItemFiles />\n    </>\n  );\n}\n\nfunction DefaultParts() {\n  return (\n    <>\n      <TaskTrigger>\n        <TaskIcon />\n        <TaskTitle />\n        <TaskMeta />\n      </TaskTrigger>\n      <TaskContent>\n        <TaskList />\n      </TaskContent>\n    </>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@ui/solid/task.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
