{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "swimlane-board",
  "title": "Swimlane Board",
  "description": "A cross-team workflow board with collapsible swimlanes, draggable tasks, accessible status menus, owner filters and a visible work-in-progress limit.",
  "dependencies": [
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/swimlane-board/swimlane-board.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Layers, Plus, ArrowRight, GripVertical } from \"lucide-react\";\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction Frame({\n  name,\n  title,\n  description,\n  theme,\n  className,\n  toolbar,\n  children,\n}: {\n  name: string;\n  title: string;\n  description: string;\n  theme: \"dark\" | \"light\";\n  className?: string;\n  toolbar?: React.ReactNode;\n  children: React.ReactNode;\n}) {\n  const dark = theme === \"dark\";\n  return (\n    <section\n      aria-label={name}\n      className={twMerge(\n        clsx(\n          \"w-full overflow-hidden rounded-xl border font-sans antialiased\",\n          className,\n        ),\n      )}\n      style={\n        {\n          background: dark ? \"#111113\" : \"#fcfcfd\",\n          color: dark ? \"#e5e5e8\" : \"#28282e\",\n          borderColor: dark ? \"#ffffff12\" : \"#18181b16\",\n          \"--board-panel\": dark ? \"#19191d\" : \"#ffffff\",\n          \"--board-canvas\": dark ? \"#0e0e10\" : \"#f6f6f8\",\n          \"--board-input\": dark ? \"#222227\" : \"#efeff3\",\n          \"--board-accent\": dark ? \"#a49aee\" : \"#6857ac\",\n        } as React.CSSProperties\n      }\n    >\n      <header className=\"flex items-center justify-between border-b border-current/[0.07] px-6 py-3 text-[11px]\">\n        <span className=\"flex items-center gap-2\">\n          <Layers size={14} className=\"opacity-45\" />\n          <span className=\"opacity-50\">Workspace</span>\n          <span className=\"px-1 opacity-20\">/</span>\n          {name}\n        </span>\n        <span className=\"flex size-6 items-center justify-center rounded-full border border-current/10 text-[9px] opacity-60\">\n          AL\n        </span>\n      </header>\n      <div className=\"px-6 pb-5 pt-6\">\n        <p className=\"mb-2 text-[9px] tracking-[0.14em] opacity-35\">\n          PRODUCT WORKSPACE\n        </p>\n        <h2 className=\"text-[23px] font-medium tracking-[-0.035em]\">{title}</h2>\n        <p className=\"mt-2 text-xs leading-relaxed opacity-45\">{description}</p>\n      </div>\n      {toolbar && (\n        <div className=\"flex flex-wrap items-center justify-between gap-3 border-y border-current/[0.07] px-6 py-3\">\n          {toolbar}\n        </div>\n      )}\n      {children}\n    </section>\n  );\n}\nconst button =\n  \"inline-flex items-center justify-center gap-1.5 rounded-md border border-current/10 px-2.5 py-1.5 text-[11px] transition-colors hover:bg-current/5 focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-25\";\nconst primary =\n  \"inline-flex items-center justify-center gap-1.5 rounded-md border border-white/15 bg-[#6e67d4] px-3 py-1.5 text-[11px] font-medium text-white hover:bg-[#7a73df] focus-visible:outline-2 focus-visible:outline-offset-2\";\nconst input =\n  \"min-w-0 rounded-md border border-current/10 bg-[var(--board-input)] px-3 py-2 text-xs outline-none focus:border-[#9690da]\";\n\nexport interface SwimlaneTask {\n  id: string;\n  title: string;\n  team: string;\n  status: \"Queued\" | \"In progress\" | \"Review\" | \"Done\";\n  owner: string;\n  priority: \"Low\" | \"Medium\" | \"High\";\n}\nexport interface SwimlaneBoardProps {\n  title?: string;\n  theme?: \"dark\" | \"light\";\n  initialTasks?: SwimlaneTask[];\n  onTasksChange?: (tasks: SwimlaneTask[]) => void;\n  wipLimit?: number;\n  className?: string;\n}\nconst columns = [\"Queued\", \"In progress\", \"Review\", \"Done\"] as const;\nconst initial: SwimlaneTask[] = [\n  {\n    id: \"ENG-241\",\n    title: \"Unify workspace permissions\",\n    team: \"Engineering\",\n    status: \"In progress\",\n    owner: \"JD\",\n    priority: \"High\",\n  },\n  {\n    id: \"ENG-242\",\n    title: \"Improve search latency\",\n    team: \"Engineering\",\n    status: \"Queued\",\n    owner: \"SK\",\n    priority: \"Medium\",\n  },\n  {\n    id: \"ENG-243\",\n    title: \"Keyboard navigation audit\",\n    team: \"Engineering\",\n    status: \"Review\",\n    owner: \"JD\",\n    priority: \"Medium\",\n  },\n  {\n    id: \"DES-101\",\n    title: \"Refine the empty states\",\n    team: \"Design\",\n    status: \"In progress\",\n    owner: \"MK\",\n    priority: \"High\",\n  },\n  {\n    id: \"DES-102\",\n    title: \"Navigation explorations\",\n    team: \"Design\",\n    status: \"Queued\",\n    owner: \"AL\",\n    priority: \"Low\",\n  },\n  {\n    id: \"DES-103\",\n    title: \"Color token library\",\n    team: \"Design\",\n    status: \"Done\",\n    owner: \"MK\",\n    priority: \"Medium\",\n  },\n  {\n    id: \"OPS-071\",\n    title: \"Launch checklist\",\n    team: \"Operations\",\n    status: \"Review\",\n    owner: \"AL\",\n    priority: \"High\",\n  },\n  {\n    id: \"OPS-072\",\n    title: \"Customer feedback digest\",\n    team: \"Operations\",\n    status: \"Done\",\n    owner: \"SK\",\n    priority: \"Low\",\n  },\n];\nexport function SwimlaneBoard({\n  title = \"Different teams. One direction.\",\n  theme = \"dark\",\n  initialTasks = initial,\n  onTasksChange,\n  wipLimit = 3,\n  className,\n}: SwimlaneBoardProps) {\n  const [tasks, setTasks] = React.useState(() =>\n    initialTasks.map((task) => ({ ...task })),\n  );\n  const [owner, setOwner] = React.useState(\"Everyone\");\n  const [collapsed, setCollapsed] = React.useState<string[]>([]);\n  const [adding, setAdding] = React.useState(false);\n  const [draft, setDraft] = React.useState(\"\");\n  const [team, setTeam] = React.useState(\"Engineering\");\n  const current = React.useRef(tasks);\n  const dragged = React.useRef<string | null>(null);\n  const update = (next: SwimlaneTask[]) => {\n    current.current = next;\n    setTasks(next);\n    onTasksChange?.(next);\n  };\n  const teams = [\n    ...new Set([\n      \"Engineering\",\n      \"Design\",\n      \"Operations\",\n      ...tasks.map((task) => task.team),\n    ]),\n  ];\n  const owners = [\"Everyone\", ...new Set(tasks.map((task) => task.owner))];\n  const visible = tasks.filter(\n    (task) => owner === \"Everyone\" || task.owner === owner,\n  );\n  const move = (id: string, status: SwimlaneTask[\"status\"], team?: string) =>\n    update(\n      current.current.map((task) =>\n        task.id === id ? { ...task, status, ...(team ? { team } : {}) } : task,\n      ),\n    );\n  return (\n    <Frame\n      name=\"Swimlanes\"\n      title={title}\n      description=\"Keep every workstream visible, without losing the bigger picture.\"\n      theme={theme}\n      className={className}\n      toolbar={\n        <>\n          <div className=\"flex items-center gap-3 text-[11px]\">\n            <select\n              aria-label=\"Filter by owner\"\n              className={input}\n              value={owner}\n              onChange={(event) => setOwner(event.target.value)}\n            >\n              {owners.map((value) => (\n                <option key={value}>{value}</option>\n              ))}\n            </select>\n            <span className=\"opacity-35\">{visible.length} issues</span>\n          </div>\n          <button\n            className={primary}\n            aria-expanded={adding}\n            onClick={() => setAdding(!adding)}\n          >\n            <Plus size={13} /> New issue\n          </button>\n        </>\n      }\n    >\n      {adding && (\n        <form\n          className=\"flex flex-wrap gap-2 border-b border-current/10 p-4\"\n          onSubmit={(event) => {\n            event.preventDefault();\n            if (!draft.trim()) return;\n            update([\n              ...current.current,\n              {\n                id: `NEW-${crypto.randomUUID().slice(0, 5)}`,\n                title: draft.trim(),\n                team,\n                status: \"Queued\",\n                owner: \"You\",\n                priority: \"Medium\",\n              },\n            ]);\n            setOwner(\"Everyone\");\n            setCollapsed((values) => values.filter((value) => value !== team));\n            setAdding(false);\n            setDraft(\"\");\n          }}\n        >\n          <input\n            aria-label=\"Issue title\"\n            required\n            maxLength={100}\n            className={input}\n            placeholder=\"What needs doing?\"\n            value={draft}\n            onChange={(event) => setDraft(event.target.value)}\n          />\n          <select\n            aria-label=\"Issue team\"\n            className={input}\n            value={team}\n            onChange={(event) => setTeam(event.target.value)}\n          >\n            {teams.map((value) => (\n              <option key={value}>{value}</option>\n            ))}\n          </select>\n          <button type=\"submit\" className={primary}>\n            Create issue\n          </button>\n          <button\n            type=\"button\"\n            className={button}\n            onClick={() => setAdding(false)}\n          >\n            Cancel\n          </button>\n        </form>\n      )}\n      <div className=\"overflow-x-auto bg-[var(--board-canvas)]\">\n        <div className=\"min-w-[880px]\">\n          <div className=\"grid grid-cols-[120px_repeat(4,minmax(0,1fr))] border-b border-current/[0.07]\">\n            <span className=\"p-4 text-[9px] tracking-wider opacity-35\">\n              TEAMS\n            </span>\n            {columns.map((column, i) => {\n              const count = tasks.filter(\n                (task) => task.status === column,\n              ).length;\n              return (\n                <div\n                  key={column}\n                  className=\"flex items-center gap-2 border-l border-current/[0.07] px-3 py-4 text-[11px]\"\n                >\n                  <span\n                    className=\"size-2 rounded-full border border-current/30\"\n                    style={{\n                      background: [\n                        \"transparent\",\n                        \"#9690da\",\n                        \"#bda478\",\n                        \"#79a798\",\n                      ][i],\n                    }}\n                  />\n                  {column}\n                  <span\n                    className=\"ml-auto text-[10px]\"\n                    style={{\n                      color:\n                        column === \"In progress\" && count > wipLimit\n                          ? \"#c99781\"\n                          : undefined,\n                      opacity: 0.6,\n                    }}\n                  >\n                    {count}\n                    {column === \"In progress\" ? ` / ${wipLimit}` : \"\"}\n                  </span>\n                </div>\n              );\n            })}\n          </div>\n          {teams.map((team) => (\n            <React.Fragment key={team}>\n              <button\n                aria-expanded={!collapsed.includes(team)}\n                onClick={() =>\n                  setCollapsed((values) =>\n                    values.includes(team)\n                      ? values.filter((value) => value !== team)\n                      : [...values, team],\n                  )\n                }\n                className=\"flex w-full items-center gap-2 border-b border-current/[0.07] bg-current/[0.02] px-4 py-2.5 text-[11px] font-medium\"\n              >\n                <ArrowRight\n                  size={11}\n                  className={collapsed.includes(team) ? \"\" : \"rotate-90\"}\n                />\n                {team}\n                <span className=\"text-[9px] opacity-35\">\n                  {visible.filter((task) => task.team === team).length}\n                </span>\n              </button>\n              {!collapsed.includes(team) && (\n                <div className=\"grid grid-cols-[120px_repeat(4,minmax(0,1fr))] border-b border-current/[0.07]\">\n                  <span className=\"p-4 text-[9px] opacity-25\">\n                    {team.slice(0, 3).toUpperCase()}\n                  </span>\n                  {columns.map((column) => (\n                    <div\n                      key={column}\n                      aria-label={`${team} ${column}`}\n                      onDragOver={(event) => event.preventDefault()}\n                      onDrop={(event) => {\n                        event.preventDefault();\n                        if (dragged.current)\n                          move(dragged.current, column, team);\n                        dragged.current = null;\n                      }}\n                      className=\"min-h-[150px] space-y-2 border-l border-current/[0.07] p-2.5\"\n                    >\n                      {visible\n                        .filter(\n                          (task) =>\n                            task.team === team && task.status === column,\n                        )\n                        .map((task) => (\n                          <article\n                            key={task.id}\n                            draggable\n                            onDragStart={() => {\n                              dragged.current = task.id;\n                            }}\n                            onDragEnd={() => {\n                              dragged.current = null;\n                            }}\n                            className=\"rounded-lg border border-current/10 bg-[var(--board-panel)] p-3\"\n                          >\n                            <div className=\"flex items-center justify-between text-[9px] opacity-35\">\n                              <span>{task.id}</span>\n                              <GripVertical size={12} />\n                            </div>\n                            <h3 className=\"mt-2 text-[12px] leading-relaxed\">\n                              {task.title}\n                            </h3>\n                            <div className=\"mt-3 flex items-center justify-between\">\n                              <span\n                                className=\"text-[9px]\"\n                                style={{\n                                  color:\n                                    task.priority === \"High\"\n                                      ? \"#bda478\"\n                                      : \"#888893\",\n                                }}\n                              >\n                                {task.priority}\n                              </span>\n                              <span className=\"flex size-5 items-center justify-center rounded-full border border-current/10 text-[8px] opacity-60\">\n                                {task.owner}\n                              </span>\n                            </div>\n                            <select\n                              aria-label={`Move ${task.title}`}\n                              className=\"mt-3 w-full rounded border border-current/10 bg-[var(--board-input)] px-1 py-1 text-[9px] opacity-65\"\n                              value={task.status}\n                              onChange={(event) =>\n                                move(\n                                  task.id,\n                                  event.target.value as SwimlaneTask[\"status\"],\n                                )\n                              }\n                            >\n                              {columns.map((status) => (\n                                <option key={status}>{status}</option>\n                              ))}\n                            </select>\n                          </article>\n                        ))}\n                    </div>\n                  ))}\n                </div>\n              )}\n            </React.Fragment>\n          ))}\n        </div>\n      </div>\n      <footer\n        role=\"status\"\n        className=\"border-t border-current/[0.07] px-5 py-3 text-[10px] opacity-40\"\n      >\n        {tasks.filter((task) => task.status === \"Done\").length} completed · Drag\n        between teams and statuses, or use each issue’s move menu\n        {tasks.filter((task) => task.status === \"In progress\").length > wipLimit\n          ? \" · In-progress limit exceeded\"\n          : \"\"}\n      </footer>\n    </Frame>\n  );\n}\nexport default SwimlaneBoard;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}