{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "sticky-notes-wall",
  "title": "Sticky Notes Wall",
  "description": "Interactive Sticky Notes Wall with light and dark themes.",
  "dependencies": [
    "lucide-react",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/sticky-notes-wall/sticky-notes-wall.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport {\n  Plus,\n  Pin,\n  X,\n  GripHorizontal,\n  StickyNote,\n  ArrowUpRight,\n} from \"lucide-react\";\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport interface WallNote {\n  id: string;\n  text: string;\n  x: number;\n  y: number;\n  color: \"yellow\" | \"purple\" | \"green\" | \"blue\";\n  category: string;\n  author: string;\n  pinned?: boolean;\n}\nexport interface StickyNotesWallProps {\n  title?: string;\n  description?: string;\n  theme?: \"dark\" | \"light\";\n  initialNotes?: WallNote[];\n  onNotesChange?: (notes: WallNote[]) => void;\n  className?: string;\n}\nconst colors = {\n  yellow: \"#bda478\",\n  purple: \"#9690da\",\n  green: \"#79a798\",\n  blue: \"#819dbd\",\n};\nconst seed: WallNote[] = [\n  {\n    id: \"1\",\n    text: \"Make the first five minutes feel effortless. Less setup. More creating.\",\n    x: 40,\n    y: 38,\n    color: \"yellow\",\n    category: \"Ideas\",\n    author: \"AL\",\n    pinned: true,\n  },\n  {\n    id: \"2\",\n    text: \"People aren't looking for more features. They're looking for a clearer next step.\",\n    x: 290,\n    y: 64,\n    color: \"purple\",\n    category: \"Research\",\n    author: \"SK\",\n  },\n  {\n    id: \"3\",\n    text: \"What if the empty state was the best part of the product?\",\n    x: 545,\n    y: 30,\n    color: \"green\",\n    category: \"Ideas\",\n    author: \"JD\",\n  },\n  {\n    id: \"4\",\n    text: \"Prototype quick-add. Test with three people before Friday.\",\n    x: 85,\n    y: 259,\n    color: \"blue\",\n    category: \"To do\",\n    author: \"JD\",\n  },\n  {\n    id: \"5\",\n    text: \"A little room to think. Whitespace is a feature, too.\",\n    x: 378,\n    y: 276,\n    color: \"yellow\",\n    category: \"Ideas\",\n    author: \"AL\",\n  },\n  {\n    id: \"6\",\n    text: \"Ship something small.\\nListen carefully.\\nRepeat.\",\n    x: 650,\n    y: 251,\n    color: \"purple\",\n    category: \"To do\",\n    author: \"SK\",\n  },\n];\n\nexport function StickyNotesWall({\n  title = \"Product discovery\",\n  description = \"A shared space for early thoughts, research, and what comes next.\",\n  theme = \"dark\",\n  initialNotes = seed,\n  onNotesChange,\n  className,\n}: StickyNotesWallProps) {\n  const [notes, setNotes] = React.useState<WallNote[]>(() =>\n    initialNotes.map((note) => ({ ...note })),\n  );\n  const [filter, setFilter] = React.useState(\"All notes\");\n  const [editing, setEditing] = React.useState<string | null>(null);\n  const [selected, setSelected] = React.useState<string | null>(null);\n  const [color, setColor] = React.useState<WallNote[\"color\"]>(\"yellow\");\n  const board = React.useRef<HTMLDivElement>(null);\n  const drag = React.useRef<{\n    id: string;\n    x: number;\n    y: number;\n    startX: number;\n    startY: number;\n  } | null>(null);\n  const current = React.useRef(notes);\n  const update = (next: WallNote[]) => {\n    current.current = next;\n    setNotes(next);\n    onNotesChange?.(next);\n  };\n  const change = (id: string, patch: Partial<WallNote>) =>\n    update(\n      current.current.map((note) =>\n        note.id === id ? { ...note, ...patch } : note,\n      ),\n    );\n  const remove = (id: string) => {\n    update(current.current.filter((note) => note.id !== id));\n    setSelected(null);\n    setEditing(null);\n  };\n  const dark = theme === \"dark\";\n  const categories = [\n    \"All notes\",\n    ...new Set(notes.map((note) => note.category)),\n  ];\n  const visible = notes.filter(\n    (note) => filter === \"All notes\" || note.category === filter,\n  );\n  const add = () => {\n    const id = crypto.randomUUID();\n    const next: WallNote = {\n      id,\n      text: \"\",\n      x: 110 + (notes.length % 4) * 100,\n      y: 90 + (notes.length % 3) * 60,\n      color,\n      category: filter === \"All notes\" ? \"Ideas\" : filter,\n      author: \"You\",\n    };\n    update([...current.current, next]);\n    setEditing(id);\n    setSelected(id);\n  };\n  return (\n    <section\n      aria-label=\"Sticky notes wall\"\n      className={twMerge(\n        clsx(\n          \"w-full overflow-hidden rounded-xl border font-sans antialiased\",\n          className,\n        ),\n      )}\n      style={{\n        background: dark ? \"#111113\" : \"#fcfcfd\",\n        color: dark ? \"#e5e5e8\" : \"#28282e\",\n        borderColor: dark ? \"#ffffff12\" : \"#18181b16\",\n      }}\n    >\n      <header className=\"flex flex-wrap items-center justify-between gap-4 border-b border-current/[0.07] px-6 py-3\">\n        <div className=\"flex items-center gap-2 text-xs font-medium\">\n          <StickyNote size={15} className=\"opacity-50\" /> Workspace{\" \"}\n          <span className=\"px-1 opacity-25\">/</span> Discovery{\" \"}\n          <span className=\"ml-2 rounded border border-current/15 px-1.5 py-0.5 text-[9px] opacity-50\">\n            Private\n          </span>\n        </div>\n        <div className=\"flex items-center gap-3\">\n          <span className=\"hidden text-[11px] opacity-40 sm:block\">\n            Personal workspace\n          </span>\n          <span className=\"flex size-7 items-center justify-center rounded-full border border-current/20 text-[10px]\">\n            AL\n          </span>\n        </div>\n      </header>\n      <div className=\"px-7 pt-7\">\n        <p className=\"mb-2 text-[10px] tracking-[0.16em] opacity-40\">\n          PROJECT / NOTES\n        </p>\n        <h2 className=\"text-[23px] font-medium tracking-[-0.035em]\">{title}</h2>\n        <p className=\"mt-2 text-[12px] leading-relaxed opacity-45\">\n          {description}\n        </p>\n      </div>\n      <div className=\"flex flex-wrap items-center justify-between gap-3 px-7 pb-4 pt-6\">\n        <div\n          role=\"group\"\n          aria-label=\"Filter notes\"\n          className=\"flex flex-wrap gap-1\"\n        >\n          {categories.map((category) => (\n            <button\n              key={category}\n              onClick={() => setFilter(category)}\n              aria-pressed={filter === category}\n              className=\"rounded-md border px-2.5 py-1.5 text-[11px] transition-colors hover:bg-current/5 focus-visible:outline-2 focus-visible:outline-offset-2\"\n              style={{\n                borderColor:\n                  filter === category\n                    ? dark\n                      ? \"#ffffff15\"\n                      : \"#18181b18\"\n                    : \"transparent\",\n                background:\n                  filter === category\n                    ? dark\n                      ? \"#242428\"\n                      : \"#efeff2\"\n                    : undefined,\n              }}\n            >\n              {category}\n              <span className=\"ml-2 opacity-35\">\n                {category === \"All notes\"\n                  ? notes.length\n                  : notes.filter((note) => note.category === category).length}\n              </span>\n            </button>\n          ))}\n        </div>\n        <div className=\"flex items-center gap-3\">\n          <div\n            role=\"group\"\n            aria-label=\"New note color\"\n            className=\"flex gap-1.5\"\n          >\n            {Object.entries(colors).map(([key, value]) => (\n              <button\n                key={key}\n                aria-label={`${key} note`}\n                aria-pressed={color === key}\n                onClick={() => setColor(key as WallNote[\"color\"])}\n                className=\"size-4 rounded-full border-2 focus-visible:outline-2 focus-visible:outline-offset-2\"\n                style={{\n                  background: value,\n                  borderColor:\n                    color === key ? (dark ? \"#fff\" : \"#252629\") : \"transparent\",\n                }}\n              />\n            ))}\n          </div>\n          <button\n            onClick={add}\n            className=\"flex items-center gap-1.5 rounded-md border border-white/15 bg-[#6e67d4] px-3 py-1.5 text-[11px] font-medium text-white shadow-[0_1px_2px_#00000020] hover:bg-[#7a73df] focus-visible:outline-2 focus-visible:outline-offset-2\"\n          >\n            <Plus size={13} /> Add note\n          </button>\n        </div>\n      </div>\n      <div className=\"overflow-x-auto border-t border-current/[0.07]\">\n        <div\n          ref={board}\n          className=\"relative h-[490px] min-w-[860px]\"\n          style={{\n            backgroundColor: dark ? \"#0e0e10\" : \"#f6f6f8\",\n            backgroundImage: `radial-gradient(${dark ? \"#ffffff0c\" : \"#18181b15\"} 0.65px, transparent 0.65px)`,\n            backgroundSize: \"24px 24px\",\n          }}\n        >\n          {visible.map((note) => (\n            <article\n              key={note.id}\n              aria-label={`Note by ${note.author}`}\n              onFocus={() => setSelected(note.id)}\n              className=\"absolute flex h-[183px] w-[184px] flex-col rounded-lg border shadow-[0_2px_5px_#00000010] outline-offset-2\"\n              style={{\n                left: note.x,\n                top: note.y,\n                background: dark\n                  ? `linear-gradient(145deg, ${colors[note.color]}1c, ${colors[note.color]}08), #171719`\n                  : `linear-gradient(145deg, ${colors[note.color]}14, ${colors[note.color]}05), #ffffff`,\n                color: dark ? \"#e2e2e6\" : \"#35353b\",\n                borderColor:\n                  selected === note.id\n                    ? `${colors[note.color]}90`\n                    : dark\n                      ? \"#ffffff10\"\n                      : \"#18181b14\",\n                zIndex: selected === note.id ? 20 : note.pinned ? 10 : 1,\n                outline:\n                  selected === note.id\n                    ? `1px solid ${colors[note.color]}50`\n                    : undefined,\n              }}\n            >\n              <div className=\"flex items-center justify-between px-3 pt-2.5\">\n                <button\n                  aria-label={`Move note by ${note.author}`}\n                  className=\"touch-none cursor-grab rounded p-1 active:cursor-grabbing focus-visible:outline-2\"\n                  onKeyDown={(event) => {\n                    const directions: Record<string, number[]> = {\n                      ArrowLeft: [-10, 0],\n                      ArrowRight: [10, 0],\n                      ArrowUp: [0, -10],\n                      ArrowDown: [0, 10],\n                    };\n                    const delta = directions[event.key];\n                    if (delta) {\n                      event.preventDefault();\n                      change(note.id, {\n                        x: Math.max(8, Math.min(668, note.x + delta[0])),\n                        y: Math.max(8, Math.min(299, note.y + delta[1])),\n                      });\n                    }\n                  }}\n                  onPointerDown={(event) => {\n                    if (event.button !== 0) return;\n                    event.currentTarget.setPointerCapture(event.pointerId);\n                    setSelected(note.id);\n                    const rect = board.current!.getBoundingClientRect();\n                    drag.current = {\n                      id: note.id,\n                      x: note.x,\n                      y: note.y,\n                      startX:\n                        event.clientX /\n                        (rect.width / board.current!.offsetWidth),\n                      startY:\n                        event.clientY /\n                        (rect.height / board.current!.offsetHeight),\n                    };\n                  }}\n                  onPointerMove={(event) => {\n                    const d = drag.current;\n                    if (!d || d.id !== note.id) return;\n                    const rect = board.current!.getBoundingClientRect();\n                    change(note.id, {\n                      x: Math.max(\n                        8,\n                        Math.min(\n                          board.current!.offsetWidth - 192,\n                          d.x +\n                            event.clientX /\n                              (rect.width / board.current!.offsetWidth) -\n                            d.startX,\n                        ),\n                      ),\n                      y: Math.max(\n                        8,\n                        Math.min(\n                          299,\n                          d.y +\n                            event.clientY /\n                              (rect.height / board.current!.offsetHeight) -\n                            d.startY,\n                        ),\n                      ),\n                    });\n                  }}\n                  onPointerUp={() => {\n                    drag.current = null;\n                  }}\n                  onPointerCancel={() => {\n                    drag.current = null;\n                  }}\n                >\n                  <span className=\"flex items-center gap-1.5\">\n                    <span\n                      className=\"size-1.5 rounded-sm\"\n                      style={{ background: colors[note.color] }}\n                    />\n                    <span className=\"text-[9px] tracking-wide opacity-40\">\n                      N-{String(notes.indexOf(note) + 1).padStart(3, \"0\")}\n                    </span>\n                    <GripHorizontal size={11} className=\"opacity-25\" />\n                  </span>\n                </button>\n                <div className=\"flex\">\n                  <button\n                    aria-label={note.pinned ? \"Unpin note\" : \"Pin note\"}\n                    aria-pressed={Boolean(note.pinned)}\n                    onClick={() => change(note.id, { pinned: !note.pinned })}\n                    className=\"rounded p-1 hover:bg-black/5\"\n                  >\n                    <Pin\n                      size={11}\n                      fill={note.pinned ? \"currentColor\" : \"none\"}\n                    />\n                  </button>\n                  <button\n                    aria-label={`Delete note by ${note.author}`}\n                    onClick={() => remove(note.id)}\n                    className=\"rounded p-1 hover:bg-black/5\"\n                  >\n                    <X size={12} />\n                  </button>\n                </div>\n              </div>\n              {editing === note.id ? (\n                <textarea\n                  autoFocus\n                  aria-label=\"Note text\"\n                  value={note.text}\n                  onChange={(event) =>\n                    change(note.id, { text: event.target.value })\n                  }\n                  onBlur={() => setEditing(null)}\n                  onKeyDown={(event) => {\n                    if (\n                      event.key === \"Escape\" ||\n                      (event.key === \"Enter\" &&\n                        (event.metaKey || event.ctrlKey))\n                    )\n                      setEditing(null);\n                  }}\n                  maxLength={400}\n                  placeholder=\"An idea worth keeping…\"\n                  className=\"mx-4 mt-2 min-h-0 flex-1 resize-none bg-transparent text-[13px] leading-relaxed outline-none\"\n                />\n              ) : (\n                <button\n                  onClick={() => {\n                    setSelected(note.id);\n                    setEditing(note.id);\n                  }}\n                  aria-label={`Edit note: ${note.text || \"Empty note\"}`}\n                  className=\"mx-4 mt-2 min-h-0 flex-1 overflow-y-auto whitespace-pre-wrap text-left text-[13px] leading-relaxed focus-visible:outline-2\"\n                >\n                  {note.text || \"An idea worth keeping…\"}\n                </button>\n              )}\n              <footer className=\"mx-4 mb-3 mt-2 flex items-center justify-between border-t border-current/[0.07] pt-2 text-[9px]\">\n                <span className=\"opacity-50\">{note.category}</span>\n                <span\n                  className=\"flex size-5 items-center justify-center rounded-full border border-current/10 text-[8px] font-medium\"\n                  style={{ color: colors[note.color] }}\n                >\n                  {note.author}\n                </span>\n              </footer>\n            </article>\n          ))}\n          {!visible.length && (\n            <p className=\"p-10 text-sm opacity-40\">\n              A clean slate. Add your first note.\n            </p>\n          )}\n        </div>\n      </div>\n      <footer className=\"flex justify-between border-t border-current/10 px-6 py-3 text-[10px] opacity-40\">\n        <span role=\"status\">{visible.length} notes · Click a note to edit</span>\n        <span className=\"flex items-center gap-1\">\n          Drag to rearrange <ArrowUpRight size={11} />\n        </span>\n      </footer>\n    </section>\n  );\n}\nexport default StickyNotesWall;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}