{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "roadmap-board",
  "title": "Roadmap Board",
  "description": "A quarterly product roadmap grouped by team, with initiative editing, status filters, progress tracking and quarter reassignment.",
  "dependencies": [
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/roadmap-board/roadmap-board.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Layers, Plus, X } 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 RoadmapInitiative {\n  id: string;\n  title: string;\n  team: string;\n  quarter: 1 | 2 | 3 | 4;\n  status: \"Planned\" | \"In progress\" | \"Shipped\";\n  progress: number;\n  owner: string;\n}\nexport interface RoadmapBoardProps {\n  title?: string;\n  theme?: \"dark\" | \"light\";\n  initialItems?: RoadmapInitiative[];\n  onItemsChange?: (items: RoadmapInitiative[]) => void;\n  className?: string;\n}\nconst initial: RoadmapInitiative[] = [\n  {\n    id: \"r1\",\n    title: \"A better first five minutes\",\n    team: \"Product\",\n    quarter: 1,\n    status: \"Shipped\",\n    progress: 100,\n    owner: \"AL\",\n  },\n  {\n    id: \"r2\",\n    title: \"Shared team spaces\",\n    team: \"Product\",\n    quarter: 2,\n    status: \"In progress\",\n    progress: 62,\n    owner: \"SK\",\n  },\n  {\n    id: \"r3\",\n    title: \"Insights that find you\",\n    team: \"Product\",\n    quarter: 3,\n    status: \"Planned\",\n    progress: 0,\n    owner: \"AL\",\n  },\n  {\n    id: \"r4\",\n    title: \"Public API\",\n    team: \"Engineering\",\n    quarter: 2,\n    status: \"In progress\",\n    progress: 35,\n    owner: \"JD\",\n  },\n  {\n    id: \"r5\",\n    title: \"Enterprise foundations\",\n    team: \"Engineering\",\n    quarter: 4,\n    status: \"Planned\",\n    progress: 0,\n    owner: \"JD\",\n  },\n  {\n    id: \"r6\",\n    title: \"Design system v2\",\n    team: \"Design\",\n    quarter: 1,\n    status: \"Shipped\",\n    progress: 100,\n    owner: \"MK\",\n  },\n  {\n    id: \"r7\",\n    title: \"A calmer mobile experience\",\n    team: \"Design\",\n    quarter: 3,\n    status: \"Planned\",\n    progress: 0,\n    owner: \"MK\",\n  },\n];\nconst statuses = [\"Planned\", \"In progress\", \"Shipped\"] as const;\nconst statusColor = {\n  Planned: \"#8b8b95\",\n  \"In progress\": \"#9690da\",\n  Shipped: \"#79a798\",\n};\nexport function RoadmapBoard({\n  title = \"The next chapter.\",\n  theme = \"dark\",\n  initialItems = initial,\n  onItemsChange,\n  className,\n}: RoadmapBoardProps) {\n  const [items, setItems] = React.useState(() =>\n    initialItems.map((item) => ({ ...item })),\n  );\n  const [filter, setFilter] = React.useState(\"All initiatives\");\n  const [selected, setSelected] = React.useState<string | null>(null);\n  const [adding, setAdding] = React.useState(false);\n  const [draft, setDraft] = React.useState(\"\");\n  const current = React.useRef(items);\n  const update = (next: RoadmapInitiative[]) => {\n    current.current = next;\n    setItems(next);\n    onItemsChange?.(next);\n  };\n  const patch = (id: string, values: Partial<RoadmapInitiative>) =>\n    update(\n      current.current.map((item) =>\n        item.id === id ? { ...item, ...values } : item,\n      ),\n    );\n  const teams = [\n    ...new Set([\n      \"Product\",\n      \"Engineering\",\n      \"Design\",\n      ...items.map((item) => item.team),\n    ]),\n  ];\n  const visible = items.filter(\n    (item) => filter === \"All initiatives\" || item.status === filter,\n  );\n  const active = items.find((item) => item.id === selected);\n  return (\n    <Frame\n      name=\"Roadmap\"\n      title={title}\n      description=\"A clear view of where we're headed. One deliberate step at a time.\"\n      theme={theme}\n      className={className}\n      toolbar={\n        <>\n          <div\n            className=\"flex flex-wrap gap-1\"\n            role=\"group\"\n            aria-label=\"Filter initiatives\"\n          >\n            {[\"All initiatives\", ...statuses].map((status) => (\n              <button\n                key={status}\n                className={button}\n                aria-pressed={filter === status}\n                onClick={() => setFilter(status)}\n                style={{\n                  background:\n                    filter === status ? \"var(--board-input)\" : undefined,\n                }}\n              >\n                {status}\n              </button>\n            ))}\n          </div>\n          <button\n            className={primary}\n            aria-expanded={adding}\n            onClick={() => setAdding(!adding)}\n          >\n            <Plus size={13} /> New initiative\n          </button>\n        </>\n      }\n    >\n      {adding && (\n        <form\n          className=\"flex flex-wrap gap-2 border-b border-current/10 px-5 py-4\"\n          onSubmit={(event) => {\n            event.preventDefault();\n            if (!draft.trim()) return;\n            const id = crypto.randomUUID();\n            update([\n              ...current.current,\n              {\n                id,\n                title: draft.trim(),\n                team: \"Product\",\n                quarter: 2,\n                status: \"Planned\",\n                progress: 0,\n                owner: \"You\",\n              },\n            ]);\n            setDraft(\"\");\n            setAdding(false);\n            setFilter(\"All initiatives\");\n            setSelected(id);\n          }}\n        >\n          <input\n            aria-label=\"Initiative title\"\n            required\n            maxLength={100}\n            value={draft}\n            onChange={(event) => setDraft(event.target.value)}\n            placeholder=\"What are we building?\"\n            className={input}\n          />\n          <button className={primary} type=\"submit\">\n            Create initiative\n          </button>\n          <button\n            className={button}\n            type=\"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-[900px]\">\n          <div className=\"grid grid-cols-[130px_repeat(4,minmax(0,1fr))] border-b border-current/[0.07]\">\n            <div className=\"p-4 text-[10px] opacity-35\">TEAMS</div>\n            {[1, 2, 3, 4].map((quarter) => (\n              <div\n                key={quarter}\n                className=\"border-l border-current/[0.07] px-4 py-4\"\n              >\n                <span className=\"text-xs font-medium\">Q{quarter}</span>\n                <span className=\"ml-2 text-[10px] opacity-30\">\n                  {\n                    [\"Jan – Mar\", \"Apr – Jun\", \"Jul – Sep\", \"Oct – Dec\"][\n                      quarter - 1\n                    ]\n                  }\n                </span>\n              </div>\n            ))}\n          </div>\n          {teams.map((team) => (\n            <div\n              key={team}\n              className=\"grid grid-cols-[130px_repeat(4,minmax(0,1fr))] border-b border-current/[0.07] last:border-0\"\n            >\n              <div className=\"p-4\">\n                <span className=\"text-[11px] font-medium\">{team}</span>\n                <p className=\"mt-1 text-[9px] opacity-35\">\n                  {items.filter((item) => item.team === team).length}{\" \"}\n                  initiatives\n                </p>\n              </div>\n              {[1, 2, 3, 4].map((quarter) => (\n                <div\n                  key={quarter}\n                  className=\"min-h-[155px] space-y-2 border-l border-current/[0.07] p-3\"\n                >\n                  {visible\n                    .filter(\n                      (item) => item.team === team && item.quarter === quarter,\n                    )\n                    .map((item) => (\n                      <button\n                        key={item.id}\n                        aria-label={`Open initiative ${item.title}`}\n                        onClick={() =>\n                          setSelected(selected === item.id ? null : item.id)\n                        }\n                        className=\"block w-full rounded-lg border bg-[var(--board-panel)] p-3 text-left hover:border-[#9690da70]\"\n                        style={{\n                          borderColor:\n                            selected === item.id ? \"#9690da90\" : \"#88888820\",\n                        }}\n                      >\n                        <span className=\"flex items-center gap-1.5 text-[9px] opacity-60\">\n                          <span\n                            className=\"size-1.5 rounded-full\"\n                            style={{ background: statusColor[item.status] }}\n                          />\n                          {item.status}\n                        </span>\n                        <span className=\"mt-2 block text-[12px] leading-relaxed\">\n                          {item.title}\n                        </span>\n                        <div className=\"mt-4 flex items-center gap-2\">\n                          <div className=\"h-1 flex-1 overflow-hidden rounded-full bg-current/5\">\n                            <div\n                              className=\"h-full rounded-full\"\n                              style={{\n                                width: `${Math.max(0, Math.min(100, item.progress))}%`,\n                                background: statusColor[item.status],\n                              }}\n                            />\n                          </div>\n                          <span className=\"text-[9px] opacity-40\">\n                            {item.progress}%\n                          </span>\n                          <span className=\"ml-1 text-[9px] opacity-45\">\n                            {item.owner}\n                          </span>\n                        </div>\n                      </button>\n                    ))}\n                </div>\n              ))}\n            </div>\n          ))}\n        </div>\n      </div>\n      {active && (\n        <div className=\"border-t border-current/10 px-5 py-4\">\n          <div className=\"mb-3 flex items-center justify-between\">\n            <h3 className=\"text-sm font-medium\">{active.title}</h3>\n            <button\n              aria-label=\"Close initiative details\"\n              onClick={() => setSelected(null)}\n            >\n              <X size={14} />\n            </button>\n          </div>\n          <div className=\"flex flex-wrap items-center gap-3\">\n            <label className=\"text-[10px] opacity-70\">\n              Quarter{\" \"}\n              <select\n                className={input}\n                aria-label=\"Initiative quarter\"\n                value={active.quarter}\n                onChange={(event) =>\n                  patch(active.id, {\n                    quarter: Number(event.target.value) as 1 | 2 | 3 | 4,\n                  })\n                }\n              >\n                {[1, 2, 3, 4].map((q) => (\n                  <option key={q} value={q}>\n                    Q{q}\n                  </option>\n                ))}\n              </select>\n            </label>\n            <label className=\"text-[10px] opacity-70\">\n              Team{\" \"}\n              <select\n                aria-label=\"Initiative team\"\n                className={input}\n                value={active.team}\n                onChange={(event) =>\n                  patch(active.id, { team: event.target.value })\n                }\n              >\n                {teams.map((team) => (\n                  <option key={team}>{team}</option>\n                ))}\n              </select>\n            </label>\n            <select\n              aria-label=\"Initiative status\"\n              className={input}\n              value={active.status}\n              onChange={(event) =>\n                patch(active.id, {\n                  status: event.target.value as RoadmapInitiative[\"status\"],\n                  ...(event.target.value === \"Shipped\"\n                    ? { progress: 100 }\n                    : {}),\n                })\n              }\n            >\n              {statuses.map((status) => (\n                <option key={status}>{status}</option>\n              ))}\n            </select>\n            <label className=\"flex items-center gap-2 text-[10px]\">\n              Progress\n              <input\n                aria-label=\"Initiative progress\"\n                type=\"range\"\n                min=\"0\"\n                max=\"100\"\n                value={active.progress}\n                onChange={(event) =>\n                  patch(active.id, {\n                    progress: Number(event.target.value),\n                    status:\n                      Number(event.target.value) === 100\n                        ? \"Shipped\"\n                        : Number(event.target.value) > 0\n                          ? \"In progress\"\n                          : \"Planned\",\n                  })\n                }\n                className=\"w-24 accent-[#9690da]\"\n              />\n              {active.progress}%\n            </label>\n            <button\n              className={button}\n              onClick={() => {\n                update(current.current.filter((item) => item.id !== active.id));\n                setSelected(null);\n              }}\n            >\n              Delete initiative\n            </button>\n          </div>\n        </div>\n      )}\n      <footer\n        role=\"status\"\n        className=\"border-t border-current/[0.07] px-5 py-3 text-[10px] opacity-40\"\n      >\n        {visible.length} initiatives ·{\" \"}\n        {items.filter((item) => item.status === \"Shipped\").length} shipped ·\n        Click an initiative to update its plan\n      </footer>\n    </Frame>\n  );\n}\nexport default RoadmapBoard;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}