{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "grid-list",
  "title": "Grid List",
  "description": "A grid list of people for an app: cards with avatar, presence dot, role and team, Email and Call actions, a star that pins favourites to the front, team filters with counts, search, Show more, and multi-select with a floating bar to message everyone selected.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/grid-list/grid-list.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface GridPerson {\n  id: string;\n  name: string;\n  role: string;\n  team: string;\n  email: string;\n  phone: string;\n  avatar?: string;\n  status?: \"online\" | \"away\" | \"offline\";\n}\n\nexport interface GridListProps {\n  title?: string;\n  people?: GridPerson[];\n  /** Cards shown before Load more. */\n  pageSize?: number;\n  onMessage?: (ids: string[]) => void;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.62)\", faint: \"rgba(245,244,241,0.36)\", card: \"#121212\", tile: \"#151515\", border: \"rgba(255,255,255,0.09)\", chip: \"rgba(255,255,255,0.06)\", hover: \"rgba(255,255,255,0.05)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", green: \"#4ADE80\", amber: \"#FBBF24\", star: \"#FBBF24\", ring: \"rgba(245,244,241,0.6)\", shadow: \"0 18px 40px -20px rgba(0,0,0,0.9)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.62)\", faint: \"rgba(10,10,10,0.4)\", card: \"#FFFFFF\", tile: \"#FFFFFF\", border: \"rgba(10,10,10,0.09)\", chip: \"rgba(10,10,10,0.05)\", hover: \"rgba(10,10,10,0.03)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", green: \"#15803D\", amber: \"#B45309\", star: \"#D97706\", ring: \"rgba(10,10,10,0.5)\", shadow: \"0 18px 40px -24px rgba(0,0,0,0.25)\" },\n};\nconst TEAM_COLORS: Record<string, string> = { Design: \"#A78BFA\", Engineering: \"#60A5FA\", Sales: \"#4ADE80\", Support: \"#FB923C\", Finance: \"#F472B6\" };\n\nconst DEFAULT_PEOPLE: GridPerson[] = [\n  { id: \"1\", name: \"Mara Okafor\", role: \"Head of Product\", team: \"Design\", email: \"mara@nexora.io\", phone: \"+49 30 5550 101\", avatar: \"/demo/44.webp\", status: \"online\" },\n  { id: \"2\", name: \"Daniel Reyes\", role: \"Staff Engineer\", team: \"Engineering\", email: \"daniel@nexora.io\", phone: \"+49 30 5550 102\", avatar: \"/demo/42.webp\", status: \"online\" },\n  { id: \"3\", name: \"Lena Brandt\", role: \"Design Lead\", team: \"Design\", email: \"lena@nexora.io\", phone: \"+49 30 5550 103\", avatar: \"/demo/55.webp\", status: \"away\" },\n  { id: \"4\", name: \"Tomás Ferreira\", role: \"Data Engineer\", team: \"Engineering\", email: \"tomas@nexora.io\", phone: \"+351 21 555 0104\", avatar: \"/demo/43.webp\", status: \"offline\" },\n  { id: \"5\", name: \"Noor Haddad\", role: \"Support Manager\", team: \"Support\", email: \"noor@nexora.io\", phone: \"+971 4 555 0105\", avatar: \"/demo/46.webp\", status: \"online\" },\n  { id: \"6\", name: \"Priya Nair\", role: \"Account Executive\", team: \"Sales\", email: \"priya@nexora.io\", phone: \"+44 20 5550 106\", avatar: \"/demo/41.webp\", status: \"away\" },\n  { id: \"7\", name: \"Samuel Osei\", role: \"Frontend Engineer\", team: \"Engineering\", email: \"samuel@nexora.io\", phone: \"+49 30 5550 107\", avatar: \"/demo/53.webp\", status: \"online\" },\n  { id: \"8\", name: \"Elena Vargas\", role: \"Finance Lead\", team: \"Finance\", email: \"elena@nexora.io\", phone: \"+34 91 555 0108\", avatar: \"/demo/50.webp\", status: \"offline\" },\n  { id: \"9\", name: \"Hana Sato\", role: \"Product Designer\", team: \"Design\", email: \"hana@nexora.io\", phone: \"+81 3 5550 0109\", avatar: \"/demo/54.webp\", status: \"online\" },\n  { id: \"10\", name: \"Marco Bellini\", role: \"Sales Manager\", team: \"Sales\", email: \"marco@nexora.io\", phone: \"+39 02 5550 110\", avatar: \"/demo/51.webp\", status: \"away\" },\n];\n\nexport function GridList({ title = \"People\", people = DEFAULT_PEOPLE, pageSize = 8, onMessage, theme = \"dark\", className }: GridListProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const [team, setTeam] = React.useState(\"All\");\n  const [q, setQ] = React.useState(\"\");\n  const [fav, setFav] = React.useState<string[]>([\"2\"]);\n  const [sel, setSel] = React.useState<string[]>([]);\n  const [shown, setShown] = React.useState(pageSize);\n  const [toast, setToast] = React.useState<string | null>(null);\n  React.useEffect(() => {\n    if (!toast) return;\n    const t = setTimeout(() => setToast(null), 2200);\n    return () => clearTimeout(t);\n  }, [toast]);\n\n  const teams = [\"All\", ...Array.from(new Set(people.map((x) => x.team)))];\n  const query = q.trim().toLowerCase();\n  const filtered = people.filter((x) => (team === \"All\" || x.team === team) && (!query || `${x.name} ${x.role} ${x.email}`.toLowerCase().includes(query))).sort((a, b) => Number(fav.includes(b.id)) - Number(fav.includes(a.id)));\n  const rows = filtered.slice(0, shown);\n  const toggleSel = (id: string) => setSel((s) => (s.includes(id) ? s.filter((x) => x !== id) : [...s, id]));\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.card } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const statusColor = (s?: GridPerson[\"status\"]) => (s === \"online\" ? p.green : s === \"away\" ? p.amber : p.faint);\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"relative mx-auto max-w-6xl px-4 py-10 @[640px]:px-6 @[640px]:py-14\">\n        <div className=\"flex flex-wrap items-end justify-between gap-4\">\n          <div>\n            <h2 className=\"m-0 text-[22px] font-semibold tracking-[-0.02em]\">{title}</h2>\n            <p className=\"m-0 mt-1 text-[13.5px]\" style={{ color: p.muted }}>\n              {people.length} people across {teams.length - 1} teams\n            </p>\n          </div>\n          <label className=\"relative w-full @[640px]:w-64\">\n            <span className=\"sr-only\">Search people</span>\n            <svg className=\"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\" style={{ color: p.faint }}>\n              <circle cx=\"11\" cy=\"11\" r=\"7\" />\n              <path d=\"m20 20-3.5-3.5\" />\n            </svg>\n            <input type=\"search\" value={q} onChange={(e) => { setQ(e.target.value); setShown(pageSize); }} placeholder=\"Name, role or email\" className={cn(\"h-10 w-full rounded-xl border pr-3 pl-8 text-[13.5px]\", focus)} style={{ borderColor: p.border, background: p.card, color: p.text, ...ring }} />\n          </label>\n        </div>\n\n        <div role=\"radiogroup\" aria-label=\"Team\" className=\"mt-5 flex gap-1.5 overflow-x-auto pb-1\">\n          {teams.map((t) => {\n            const on = team === t;\n            const n = t === \"All\" ? people.length : people.filter((x) => x.team === t).length;\n            return (\n              <button\n                key={t}\n                type=\"button\"\n                role=\"radio\"\n                aria-checked={on}\n                onClick={() => {\n                  setTeam(t);\n                  setShown(pageSize);\n                }}\n                className={cn(\"relative flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-full border px-3 text-[12.5px]\", focus)}\n                style={{ borderColor: on ? \"transparent\" : p.border, color: on ? p.onText : p.muted, background: \"transparent\", ...ring }}\n              >\n                {on && <motion.span layoutId={`${uid}-team`} className=\"absolute inset-0 rounded-full\" style={{ background: p.on }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 38 }} />}\n                {t !== \"All\" && <span className=\"relative h-1.5 w-1.5 rounded-full\" style={{ background: TEAM_COLORS[t] ?? p.faint }} aria-hidden=\"true\" />}\n                <span className=\"relative\">{t}</span>\n                <span className=\"relative tabular-nums\" style={{ color: on ? p.onText : p.faint, opacity: on ? 0.6 : 1 }}>\n                  {n}\n                </span>\n              </button>\n            );\n          })}\n        </div>\n\n        <ul className=\"m-0 mt-5 grid list-none grid-cols-2 gap-2.5 p-0 @[640px]:gap-3 @[760px]:grid-cols-3 @[1000px]:grid-cols-4\">\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {rows.map((x, i) => {\n              const checked = sel.includes(x.id);\n              const starred = fav.includes(x.id);\n              return (\n                <motion.li key={x.id} layout={!reduce} initial={reduce ? false : { opacity: 0, y: 12 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, scale: 0.95, transition: { duration: 0.12 } }} transition={{ duration: 0.25, delay: reduce ? 0 : Math.min(i, 8) * 0.03 }} whileHover={reduce ? undefined : { y: -3 }} className=\"group relative flex flex-col overflow-hidden rounded-2xl border\" style={{ background: p.tile, borderColor: checked ? p.on : p.border, boxShadow: checked ? `0 0 0 1px ${p.on}` : \"0 0 0 0px rgba(0,0,0,0)\" }}>\n                  <div className=\"absolute top-3 left-3 z-10\">\n                    <label className={cn(\"flex h-6 w-6 cursor-pointer items-center justify-center rounded-md border transition-opacity\", checked || sel.length ? \"opacity-100\" : \"opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100\")} style={{ borderColor: checked ? p.on : p.border, background: checked ? p.on : p.card }}>\n                      <input type=\"checkbox\" checked={checked} onChange={() => toggleSel(x.id)} className=\"peer sr-only\" aria-label={`Select ${x.name}`} />\n                      {checked && (\n                        <svg width=\"11\" height=\"11\" viewBox=\"0 0 16 16\" fill=\"none\" stroke={p.onText} strokeWidth=\"2.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                          <path d=\"m3 8.5 3 3 7-7\" />\n                        </svg>\n                      )}\n                    </label>\n                  </div>\n                  <button type=\"button\" aria-pressed={starred} aria-label={starred ? `Unstar ${x.name}` : `Star ${x.name}`} onClick={() => setFav((f) => (starred ? f.filter((y) => y !== x.id) : [...f, x.id]))} className={cn(\"absolute top-2.5 right-2.5 z-10 flex h-7 w-7 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent\", focus)} style={{ color: starred ? p.star : p.faint, ...ring }}>\n                    <motion.svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill={starred ? \"currentColor\" : \"none\"} stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinejoin=\"round\" aria-hidden=\"true\" animate={starred && !reduce ? { scale: [1, 1.35, 1], rotate: [0, 15, 0] } : { scale: 1 }}>\n                      <path d=\"m12 3 2.8 5.7 6.2.9-4.5 4.4 1 6.2L12 17.3 6.5 20.2l1-6.2L3 9.6l6.2-.9L12 3Z\" />\n                    </motion.svg>\n                  </button>\n                  <div className=\"flex flex-col items-center px-3 pt-7 pb-4 text-center @[640px]:px-4\">\n                    <span className=\"relative\">\n                      {x.avatar ? (\n                        // eslint-disable-next-line @next/next/no-img-element\n                        <img src={x.avatar} alt=\"\" className=\"h-16 w-16 rounded-full object-cover\" />\n                      ) : (\n                        <span className=\"flex h-16 w-16 items-center justify-center rounded-full text-[18px] font-semibold\" style={{ background: p.chip }}>\n                          {x.name[0]}\n                        </span>\n                      )}\n                      <span className=\"absolute right-0.5 bottom-0.5 h-3.5 w-3.5 rounded-full border-2\" style={{ background: statusColor(x.status), borderColor: p.tile }} aria-label={x.status ?? \"offline\"} />\n                    </span>\n                    <h3 className=\"m-0 mt-3 text-[14px] font-semibold @[640px]:text-[14.5px]\">{x.name}</h3>\n                    <p className=\"m-0 mt-0.5 text-[12.5px]\" style={{ color: p.muted }}>\n                      {x.role}\n                    </p>\n                    <span className=\"mt-2 inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium\" style={{ background: p.chip, color: TEAM_COLORS[x.team] ?? p.muted }}>\n                      {x.team}\n                    </span>\n                  </div>\n                  <div className=\"mt-auto grid grid-cols-2 border-t\" style={{ borderColor: p.border }}>\n                    <a href={`mailto:${x.email}`} className={cn(\"flex h-11 items-center justify-center gap-1.5 text-[12.5px] no-underline transition-colors hover:bg-[var(--gl-h)]\", focus, \"focus-visible:ring-inset\")} style={{ color: p.muted, [\"--gl-h\" as string]: p.hover, ...ring }} aria-label={`Email ${x.name}`}>\n                      <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                        <path d=\"M3 7l9 6 9-6M4 5h16v14H4z\" />\n                      </svg>\n                      Email\n                    </a>\n                    <a href={`tel:${x.phone.replace(/\\s/g, \"\")}`} className={cn(\"flex h-11 items-center justify-center gap-1.5 border-l text-[12.5px] no-underline transition-colors hover:bg-[var(--gl-h)]\", focus, \"focus-visible:ring-inset\")} style={{ color: p.muted, borderColor: p.border, [\"--gl-h\" as string]: p.hover, ...ring }} aria-label={`Call ${x.name}`}>\n                      <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                        <path d=\"M5 4h4l2 5-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2Z\" />\n                      </svg>\n                      Call\n                    </a>\n                  </div>\n                </motion.li>\n              );\n            })}\n          </AnimatePresence>\n        </ul>\n        {filtered.length === 0 && (\n          <p className=\"m-0 rounded-2xl border border-dashed px-6 py-14 text-center text-[14px]\" style={{ borderColor: p.border, color: p.muted }}>\n            No one matches “{q}”.\n          </p>\n        )}\n        {filtered.length > shown && (\n          <div className=\"mt-6 flex justify-center\">\n            <button type=\"button\" onClick={() => setShown((n) => n + pageSize)} className={cn(\"h-10 cursor-pointer rounded-full border bg-transparent px-5 text-[13px]\", focus)} style={{ borderColor: p.border, color: p.text, ...ring }}>\n              Show {Math.min(pageSize, filtered.length - shown)} more\n            </button>\n          </div>\n        )}\n\n        {/* Selection bar */}\n        <div className=\"pointer-events-none sticky bottom-4 mt-4 flex justify-center\">\n          <AnimatePresence>\n            {sel.length > 0 && (\n              <motion.div initial={reduce ? false : { y: 30, opacity: 0 }} animate={{ y: 0, opacity: 1 }} exit={reduce ? undefined : { y: 30, opacity: 0 }} transition={{ type: \"spring\", stiffness: 420, damping: 34 }} className=\"pointer-events-auto flex items-center gap-3 rounded-full py-1.5 pr-1.5 pl-4 text-[13px]\" style={{ background: p.on, color: p.onText, boxShadow: p.shadow }} role=\"region\" aria-label=\"Selection\">\n                <span className=\"flex -space-x-2\" aria-hidden=\"true\">\n                  {sel.slice(0, 3).map((id) => {\n                    const x = people.find((y) => y.id === id);\n                    return x?.avatar ? (\n                      // eslint-disable-next-line @next/next/no-img-element\n                      <img key={id} src={x.avatar} alt=\"\" className=\"h-6 w-6 rounded-full border-2 object-cover\" style={{ borderColor: p.on }} />\n                    ) : null;\n                  })}\n                </span>\n                <span className=\"tabular-nums\">{sel.length} selected</span>\n                <button type=\"button\" onClick={() => setSel([])} className=\"h-7 cursor-pointer rounded-full border-0 bg-transparent px-2 text-[12.5px]\" style={{ color: p.onText, opacity: 0.6 }}>\n                  Clear\n                </button>\n                <button\n                  type=\"button\"\n                  onClick={() => {\n                    onMessage?.(sel);\n                    setToast(`Message started with ${sel.length} ${sel.length === 1 ? \"person\" : \"people\"}`);\n                    setSel([]);\n                  }}\n                  className=\"h-8 cursor-pointer rounded-full border-0 px-3.5 text-[12.5px] font-semibold\"\n                  style={{ background: p.onText, color: p.on }}\n                >\n                  Message\n                </button>\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n        <div className=\"pointer-events-none absolute inset-x-0 bottom-4 flex justify-center px-4\" aria-live=\"polite\">\n          <AnimatePresence>\n            {toast && (\n              <motion.div initial={reduce ? false : { opacity: 0, y: 10 }} animate={{ opacity: 1, y: 0 }} exit={reduce ? undefined : { opacity: 0, y: 6 }} className=\"rounded-full px-4 py-2 text-[13px] font-medium shadow-lg\" style={{ background: p.on, color: p.onText }}>\n                {toast}\n              </motion.div>\n            )}\n          </AnimatePresence>\n        </div>\n      </div>\n    </section>\n  );\n}\n\nexport default GridList;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}