{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "delegation-board",
  "title": "Delegation board",
  "description": "Pigeonholes for delegated work, one per subagent: its task slip, a lamp and a word for its status, and its progress. Finished work rises out of its cubby.",
  "dependencies": [
    "@base-ui/react",
    "cn"
  ],
  "registryDependencies": [
    "https://bevel-ui.vercel.app/r/bevel.json",
    "https://bevel-ui.vercel.app/r/name-tag.json"
  ],
  "files": [
    {
      "path": "registry/bevel/ui/delegation-board.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { Progress as ProgressPrimitive } from \"@base-ui/react/progress\"\nimport { cn } from \"cn\"\n\n/** Pigeonholes for delegated work, one per subagent. Give it an aria-label. */\nfunction DelegationBoard({ className, ...props }: React.ComponentProps<\"ul\">) {\n  return (\n    <ul\n      data-slot=\"delegation-board\"\n      className={cn(\n        \"bevel-leather bevel-object grid w-full grid-cols-[repeat(auto-fill,minmax(13rem,1fr))] gap-3 rounded-(--bevel-radius-md) p-3 text-(--delegation-foreground)\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\ntype DelegationStatus = \"pending\" | \"active\" | \"awaiting\" | \"error\" | \"complete\"\n\nconst statusText: Record<DelegationStatus, string> = {\n  pending: \"Pending\",\n  active: \"Working\",\n  awaiting: \"Needs you\",\n  error: \"Error\",\n  complete: \"Done\",\n}\n\nconst SlotContext = React.createContext<DelegationStatus>(\"pending\")\n\ntype DelegationSlotProps = React.ComponentProps<\"li\"> & {\n  status?: DelegationStatus\n}\n\n/**\n * One subagent's cubby. Its status shows as a lamp and in words; finished\n * work rises out of the cubby.\n */\nfunction DelegationSlot({ className, status = \"pending\", children, ...props }: DelegationSlotProps) {\n  return (\n    <SlotContext value={status}>\n      <li\n        data-slot=\"delegation-slot\"\n        data-status={status}\n        className={cn(\"bevel-recessed flex flex-col gap-2 rounded-(--bevel-radius-sm) p-2.5 pt-3\", className)}\n        {...props}\n      >\n        {children}\n      </li>\n    </SlotContext>\n  )\n}\n\n/** The agent's name and lamp across the top of the cubby. Put a NameTag in it. */\nfunction DelegationAgent({ className, children, ...props }: React.ComponentProps<\"div\">) {\n  const status = React.useContext(SlotContext)\n  return (\n    <div\n      data-slot=\"delegation-agent\"\n      className={cn(\"flex min-w-0 items-center justify-between gap-2\", className)}\n      {...props}\n    >\n      <div className=\"min-w-0\">{children}</div>\n      <span className=\"bevel-deboss flex shrink-0 items-center gap-1.5 text-(length:--bevel-fine) font-semibold tracking-(--bevel-tracking-print) uppercase\">\n        <span aria-hidden className=\"bevel-led size-1.5 rounded-full\" />\n        {statusText[status]}\n      </span>\n    </div>\n  )\n}\n\n/** The task slip in the cubby. Rises out when the work comes back. */\nfunction DelegationTask({ className, ...props }: React.ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"delegation-task\"\n      className={cn(\n        \"bevel-paper rounded-(--bevel-radius-xs) px-3 py-2 text-sm leading-snug shadow-(--bevel-depth-sheet)\",\n        \"transition-[translate] duration-(--bevel-duration-move) ease-(--bevel-ease-spring) motion-reduce:transition-none\",\n        \"in-data-[status=complete]:-translate-y-(--delegation-return)\",\n        \"in-data-[status=pending]:text-(--bevel-pencil)\",\n        className\n      )}\n      {...props}\n    />\n  )\n}\n\ntype DelegationProgressProps = Omit<ProgressPrimitive.Root.Props, \"children\">\n\n/** How far along the subagent is. Name it after the agent: \"Research progress\". */\nfunction DelegationProgress({\n  className,\n  value,\n  max = 100,\n  \"aria-label\": ariaLabel = \"Progress\",\n  ...props\n}: DelegationProgressProps) {\n  return (\n    <ProgressPrimitive.Root\n      data-slot=\"delegation-progress\"\n      value={value}\n      max={max}\n      aria-label={ariaLabel}\n      className={cn(\"px-0.5\", className)}\n      {...props}\n    >\n      <ProgressPrimitive.Track className=\"relative h-1 overflow-hidden rounded-full bg-(--delegation-foreground)/15\">\n        {/* Scaled, not resized, so progress never relays out the board. */}\n        <span\n          aria-hidden\n          className=\"absolute inset-0 origin-left rounded-full bg-(--bevel-led) transition-[scale] duration-(--bevel-duration-move) ease-(--bevel-ease-out) motion-reduce:transition-none\"\n          style={{ scale: `${max && value !== null ? Math.min(1, (value ?? 0) / max) : 0} 1` }}\n        />\n      </ProgressPrimitive.Track>\n    </ProgressPrimitive.Root>\n  )\n}\n\nexport { DelegationBoard, DelegationSlot, DelegationAgent, DelegationTask, DelegationProgress }\nexport type { DelegationStatus, DelegationSlotProps }\n",
      "type": "registry:ui"
    }
  ],
  "css": {
    ":root": {
      "--delegation-board": "oklch(0.33 0.05 52)",
      "--delegation-board-edge": "oklch(0.22 0.04 48)",
      "--delegation-cubby": "oklch(0.2 0.03 45)",
      "--delegation-foreground": "oklch(0.93 0.02 80)",
      "--delegation-pending": "oklch(0.5 0.01 260)",
      "--delegation-active": "oklch(0.82 0.16 75)",
      "--delegation-awaiting": "oklch(0.8 0.17 55)",
      "--delegation-error": "oklch(0.68 0.2 27)",
      "--delegation-complete": "oklch(0.8 0.17 150)",
      "--delegation-return": "0.5rem"
    },
    "[data-slot=\"delegation-board\"]": {
      "--bevel-material": "var(--delegation-board)",
      "--bevel-material-edge": "var(--delegation-board-edge)",
      "--bevel-material-recess": "var(--delegation-cubby)"
    },
    "[data-slot=\"delegation-slot\"]": {
      "--bevel-led": "var(--delegation-pending)"
    },
    "[data-slot=\"delegation-slot\"][data-status=\"active\"]": {
      "--bevel-led": "var(--delegation-active)"
    },
    "[data-slot=\"delegation-slot\"][data-status=\"awaiting\"]": {
      "--bevel-led": "var(--delegation-awaiting)"
    },
    "[data-slot=\"delegation-slot\"][data-status=\"error\"]": {
      "--bevel-led": "var(--delegation-error)"
    },
    "[data-slot=\"delegation-slot\"][data-status=\"complete\"]": {
      "--bevel-led": "var(--delegation-complete)"
    }
  },
  "categories": [
    "agents"
  ],
  "type": "registry:ui"
}