{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "queue",
  "title": "Queue",
  "description": "The agent's to-do list, queued and completed, that people can reorder, send now, edit and clear, or the messages queued in a Composer.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/queue.tsx",
      "content": "\"use client\";\n\nimport { queuePrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps } from \"react\";\n\nconst parts = createParts(queuePrimitive, {\n  root: \"div\",\n  section: \"div\",\n  \"section-trigger\": \"button\",\n  \"section-content\": \"div\",\n  list: \"ul\",\n  item: \"li\",\n  \"item-icon\": \"span\",\n  \"item-title\": \"span\",\n  \"item-description\": \"span\",\n  \"item-send\": \"button\",\n  \"item-edit\": \"button\",\n  \"item-remove\": \"button\",\n  instructions: \"span\",\n});\n\nexport type QueueProps = ComponentProps<typeof parts.Root>;\n\n/**\n * The agent's queue: pending items under Queued, complete ones under Completed, each with a count. Any `children`\n * replace the default sections.\n */\nexport function Queue({ children, ...props }: QueueProps) {\n  return <parts.Root {...props}>{children !== undefined ? children : DEFAULT_PARTS}</parts.Root>;\n}\n\nexport const QueueSection = parts.Section;\nexport const QueueSectionContent = parts.SectionContent;\nexport const QueueItemIcon = parts.ItemIcon;\n/** Sends a queued item now, shown while `onSend` is set. Named \"Send now\"; an arrow unless you pass children. */\nexport const QueueItemSend = parts.ItemSend;\n/** Gives a queued item back to the Composer it's docked in, shown while `onEdit` is set. A pencil unless you pass children. */\nexport const QueueItemEdit = parts.ItemEdit;\n/** Removes an item, shown while `onRemove` is set. An ✕ unless you pass children. */\nexport const QueueItemRemove = parts.ItemRemove;\n\nexport type QueueSectionTriggerProps = ComponentProps<typeof parts.SectionTrigger>;\n\n/** The section's title and count, unless you pass children. */\nexport function QueueSectionTrigger({\n  children = ({ title, count }) => (\n    <>\n      <span data-title=\"\">{title}</span>\n      <span data-count=\"\">{count}</span>\n    </>\n  ),\n  ...props\n}: QueueSectionTriggerProps) {\n  return <parts.SectionTrigger {...props}>{children}</parts.SectionTrigger>;\n}\n\nexport type QueueListProps = ComponentProps<typeof parts.List>;\n\n/** An item for each of the section's rows, unless you pass children. */\nexport function QueueList({\n  children = ({ rows }) => rows.map((row) => <QueueItem key={row.item.id} value={row.item.id} />),\n  ...props\n}: QueueListProps) {\n  return <parts.List {...props}>{children}</parts.List>;\n}\n\nexport type QueueItemProps = ComponentProps<typeof parts.Item>;\n\n/**\n * The item whose `id` is `value`. Without children, it shows the item's mark, title and description, then Send now,\n * Edit and Remove.\n */\nexport function QueueItem({ children, ...props }: QueueItemProps) {\n  return <parts.Item {...props}>{children !== undefined ? children : DEFAULT_ITEM_PARTS}</parts.Item>;\n}\n\nexport type QueueItemTitleProps = ComponentProps<typeof parts.ItemTitle>;\n\n/** The item's `title`, unless you pass children. */\nexport function QueueItemTitle({ children = ({ title }) => title, ...props }: QueueItemTitleProps) {\n  return <parts.ItemTitle {...props}>{children}</parts.ItemTitle>;\n}\n\nexport type QueueItemDescriptionProps = ComponentProps<typeof parts.ItemDescription>;\n\n/** The item's `description`, unless you pass children. Hidden while empty. */\nexport function QueueItemDescription({\n  children = ({ description }) => description,\n  ...props\n}: QueueItemDescriptionProps) {\n  return <parts.ItemDescription {...props}>{children}</parts.ItemDescription>;\n}\n\nexport type QueueInstructionsProps = ComponentProps<typeof parts.Instructions>;\n\n/** The keys that move and remove items, read with each item and hidden from sight, unless you pass children. */\nexport function QueueInstructions({ children = ({ text }) => text, ...props }: QueueInstructionsProps) {\n  return <parts.Instructions {...props}>{children}</parts.Instructions>;\n}\n\n// Shared, so an update to the items doesn't render the default parts' wrappers again.\nconst DEFAULT_ITEM_PARTS = (\n  <>\n    <QueueItemIcon />\n    <span data-text=\"\">\n      <QueueItemTitle />\n      <QueueItemDescription />\n    </span>\n    <span data-queue-actions=\"\">\n      <QueueItemSend />\n      <QueueItemEdit />\n      <QueueItemRemove />\n    </span>\n  </>\n);\n\nconst section = (value: \"pending\" | \"complete\") => (\n  <QueueSection value={value}>\n    <QueueSectionTrigger />\n    <QueueSectionContent>\n      <QueueList />\n    </QueueSectionContent>\n  </QueueSection>\n);\n\nconst DEFAULT_PARTS = (\n  <>\n    {section(\"pending\")}\n    {section(\"complete\")}\n    <QueueInstructions />\n  </>\n);\n",
      "type": "registry:ui",
      "target": "@ui/queue.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
