{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "retro-board",
  "title": "Retro Board",
  "description": "A cycle retrospective with reflection columns, a limited voting round and actionable follow-ups with completion tracking.",
  "dependencies": [
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/retro-board/retro-board.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Layers, Plus, ChevronUp, ArrowRight } 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 RetroNote {\n  id: string;\n  column: \"keep\" | \"improve\" | \"try\";\n  text: string;\n  author: string;\n  votes: number;\n  action?: boolean;\n  done?: boolean;\n}\nexport interface RetroBoardProps {\n  title?: string;\n  theme?: \"dark\" | \"light\";\n  initialNotes?: RetroNote[];\n  onNotesChange?: (notes: RetroNote[]) => void;\n  voteLimit?: number;\n  className?: string;\n}\nconst columns = [\n  {\n    id: \"keep\",\n    title: \"Keep doing\",\n    hint: \"What gave us momentum?\",\n    color: \"#79a798\",\n  },\n  {\n    id: \"improve\",\n    title: \"Do differently\",\n    hint: \"Where did we get stuck?\",\n    color: \"#bda478\",\n  },\n  {\n    id: \"try\",\n    title: \"Try next\",\n    hint: \"One small experiment.\",\n    color: \"#9690da\",\n  },\n] as const;\nconst initial: RetroNote[] = [\n  {\n    id: \"a\",\n    column: \"keep\",\n    text: \"The smaller pull requests made reviews feel effortless.\",\n    author: \"JD\",\n    votes: 5,\n  },\n  {\n    id: \"b\",\n    column: \"keep\",\n    text: \"A short async update beats another status meeting.\",\n    author: \"AL\",\n    votes: 3,\n  },\n  {\n    id: \"c\",\n    column: \"improve\",\n    text: \"Decisions got lost between the project doc and chat.\",\n    author: \"SK\",\n    votes: 4,\n    action: true,\n  },\n  {\n    id: \"d\",\n    column: \"improve\",\n    text: \"We left accessibility checks until the last day.\",\n    author: \"MK\",\n    votes: 2,\n  },\n  {\n    id: \"e\",\n    column: \"try\",\n    text: \"One owner for every decision. One place to find it.\",\n    author: \"AL\",\n    votes: 6,\n    action: true,\n  },\n  {\n    id: \"f\",\n    column: \"try\",\n    text: \"Reserve Friday mornings for finishing, not starting.\",\n    author: \"JD\",\n    votes: 2,\n  },\n];\nexport function RetroBoard({\n  title = \"A little better, every cycle.\",\n  theme = \"dark\",\n  initialNotes = initial,\n  onNotesChange,\n  voteLimit = 3,\n  className,\n}: RetroBoardProps) {\n  const [notes, setNotes] = React.useState(() =>\n    initialNotes.map((note) => ({ ...note })),\n  );\n  const [phase, setPhase] = React.useState(\"Reflect\");\n  const [voted, setVoted] = React.useState<string[]>([]);\n  const [revealed, setRevealed] = React.useState(true);\n  const [adding, setAdding] = React.useState<RetroNote[\"column\"] | null>(null);\n  const [draft, setDraft] = React.useState(\"\");\n  const current = React.useRef(notes);\n  const update = (next: RetroNote[]) => {\n    current.current = next;\n    setNotes(next);\n    onNotesChange?.(next);\n  };\n  const patch = (id: string, values: Partial<RetroNote>) =>\n    update(\n      current.current.map((note) =>\n        note.id === id ? { ...note, ...values } : note,\n      ),\n    );\n  const vote = (note: RetroNote) => {\n    const has = voted.includes(note.id);\n    if (!has && voted.length >= Math.max(0, voteLimit)) return;\n    patch(note.id, { votes: Math.max(0, note.votes + (has ? -1 : 1)) });\n    setVoted((values) =>\n      has ? values.filter((id) => id !== note.id) : [...values, note.id],\n    );\n  };\n  const actions = notes.filter((note) => note.action);\n  return (\n    <Frame\n      name=\"Retrospective\"\n      title={title}\n      description=\"Keep what works. Be honest about what doesn't. Leave with a next step.\"\n      theme={theme}\n      className={className}\n      toolbar={\n        <>\n          <div\n            className=\"flex gap-1\"\n            role=\"group\"\n            aria-label=\"Retrospective phase\"\n          >\n            {[\"Reflect\", \"Vote\", \"Actions\"].map((value, i) => (\n              <button\n                key={value}\n                className={button}\n                aria-pressed={phase === value}\n                onClick={() => setPhase(value)}\n                style={{\n                  background:\n                    phase === value ? \"var(--board-input)\" : undefined,\n                }}\n              >\n                <span className=\"mr-1 text-[9px] opacity-35\">0{i + 1}</span>\n                {value}\n              </button>\n            ))}\n          </div>\n          <div className=\"flex items-center gap-3\">\n            <span className=\"text-[10px] opacity-40\">\n              {voted.length} / {Math.max(0, voteLimit)} votes used\n            </span>\n            <button\n              className={button}\n              aria-pressed={!revealed}\n              onClick={() => setRevealed(!revealed)}\n            >\n              {revealed ? \"Hide notes\" : \"Reveal notes\"}\n            </button>\n          </div>\n        </>\n      }\n    >\n      {phase === \"Actions\" ? (\n        <div className=\"space-y-3 bg-[var(--board-canvas)] p-5\">\n          <p className=\"mb-4 text-[10px] tracking-wider opacity-40\">\n            TURN THE CONVERSATION INTO PROGRESS\n          </p>\n          {actions.map((note) => (\n            <article\n              key={note.id}\n              className=\"flex items-start gap-3 rounded-lg border border-current/10 bg-[var(--board-panel)] p-4\"\n            >\n              <input\n                type=\"checkbox\"\n                aria-label={`Complete action ${note.text}`}\n                checked={Boolean(note.done)}\n                onChange={(event) =>\n                  patch(note.id, { done: event.target.checked })\n                }\n                className=\"mt-1 accent-[#9690da]\"\n              />\n              <div className=\"flex-1\">\n                <p\n                  className={`text-xs leading-relaxed ${note.done ? \"line-through opacity-35\" : \"\"}`}\n                >\n                  {revealed ? note.text : \"Note hidden\"}\n                </p>\n                <p className=\"mt-2 text-[10px] opacity-35\">\n                  {note.author} · {note.done ? \"Completed\" : \"Next cycle\"}\n                </p>\n              </div>\n              <button\n                className={button}\n                onClick={() => patch(note.id, { action: false, done: false })}\n              >\n                Remove action\n              </button>\n            </article>\n          ))}\n          {!actions.length && (\n            <p className=\"p-10 text-center text-xs opacity-40\">\n              Mark a note as an action to bring it into the next cycle.\n            </p>\n          )}\n        </div>\n      ) : (\n        <div className=\"grid gap-4 bg-[var(--board-canvas)] p-5 md:grid-cols-3\">\n          {columns.map((column) => (\n            <div key={column.id}>\n              <div className=\"mb-4 flex items-center justify-between\">\n                <div>\n                  <h3 className=\"flex items-center gap-2 text-xs font-medium\">\n                    <span\n                      className=\"size-1.5 rounded-full\"\n                      style={{ background: column.color }}\n                    />\n                    {column.title}\n                    <span className=\"ml-1 text-[10px] opacity-30\">\n                      {notes.filter((note) => note.column === column.id).length}\n                    </span>\n                  </h3>\n                  <p className=\"mt-1.5 text-[10px] opacity-35\">{column.hint}</p>\n                </div>\n                <button\n                  aria-label={`Add to ${column.title}`}\n                  className=\"rounded border border-current/10 p-1\"\n                  onClick={() => {\n                    setAdding(column.id);\n                    setDraft(\"\");\n                  }}\n                >\n                  <Plus size={12} />\n                </button>\n              </div>\n              {adding === column.id && (\n                <form\n                  className=\"mb-3 space-y-2 rounded-lg border border-[#9690da50] bg-[var(--board-panel)] p-3\"\n                  onSubmit={(event) => {\n                    event.preventDefault();\n                    if (!draft.trim()) return;\n                    update([\n                      ...current.current,\n                      {\n                        id: crypto.randomUUID(),\n                        column: column.id,\n                        text: draft.trim(),\n                        author: \"You\",\n                        votes: 0,\n                      },\n                    ]);\n                    setAdding(null);\n                    setDraft(\"\");\n                  }}\n                >\n                  <textarea\n                    aria-label=\"Retrospective note\"\n                    className={input + \" w-full resize-none\"}\n                    placeholder=\"One thought to share…\"\n                    required\n                    maxLength={400}\n                    value={draft}\n                    onChange={(event) => setDraft(event.target.value)}\n                  />\n                  <div className=\"flex gap-2\">\n                    <button className={primary} type=\"submit\">\n                      Add note\n                    </button>\n                    <button\n                      type=\"button\"\n                      className={button}\n                      onClick={() => setAdding(null)}\n                    >\n                      Cancel\n                    </button>\n                  </div>\n                </form>\n              )}\n              <div className=\"space-y-3\">\n                {notes\n                  .filter((note) => note.column === column.id)\n                  .sort((a, b) => (phase === \"Vote\" ? b.votes - a.votes : 0))\n                  .map((note) => (\n                    <article\n                      key={note.id}\n                      className=\"rounded-lg border border-current/10 bg-[var(--board-panel)] p-4\"\n                    >\n                      <p className=\"min-h-[65px] text-xs leading-relaxed\">\n                        {revealed\n                          ? note.text\n                          : \"This thought is hidden until notes are revealed.\"}\n                      </p>\n                      <div className=\"mt-4 flex items-center justify-between\">\n                        <span className=\"flex size-5 items-center justify-center rounded-full border border-current/10 text-[8px] opacity-50\">\n                          {note.author}\n                        </span>\n                        <div className=\"flex items-center gap-2\">\n                          <button\n                            aria-label={`${voted.includes(note.id) ? \"Remove vote from\" : \"Vote for\"} ${note.text}`}\n                            aria-pressed={voted.includes(note.id)}\n                            disabled={\n                              !revealed ||\n                              (!voted.includes(note.id) &&\n                                voted.length >= Math.max(0, voteLimit))\n                            }\n                            onClick={() => vote(note)}\n                            className={button}\n                            style={{\n                              color: voted.includes(note.id)\n                                ? \"var(--board-accent)\"\n                                : undefined,\n                            }}\n                          >\n                            <ChevronUp size={12} />\n                            {note.votes}\n                          </button>\n                          <button\n                            aria-label={`Make action: ${note.text}`}\n                            aria-pressed={Boolean(note.action)}\n                            disabled={!revealed}\n                            onClick={() =>\n                              patch(note.id, {\n                                action: !note.action,\n                                done: false,\n                              })\n                            }\n                            className=\"rounded border border-current/10 p-1.5 disabled:opacity-25\"\n                            style={{\n                              color: note.action ? column.color : undefined,\n                            }}\n                          >\n                            <ArrowRight size={12} />\n                          </button>\n                        </div>\n                      </div>\n                    </article>\n                  ))}\n              </div>\n            </div>\n          ))}\n        </div>\n      )}\n      <footer\n        role=\"status\"\n        className=\"flex justify-between border-t border-current/[0.07] px-5 py-3 text-[10px] opacity-40\"\n      >\n        <span>\n          {notes.length} thoughts · {actions.length} actions ·{\" \"}\n          {actions.filter((note) => note.done).length} complete\n        </span>\n        <span>\n          {phase === \"Vote\"\n            ? \"Most-voted thoughts appear first\"\n            : \"Make the next cycle count.\"}\n        </span>\n      </footer>\n    </Frame>\n  );\n}\nexport default RetroBoard;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}