{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "team-grid",
  "type": "registry:block",
  "title": "Team Grid",
  "description": "Team cards with tinted initials portraits, roles and a ticking local clock; hover, focus or tap one and a short bio with links slides over, plus a team filter and a we're-hiring card.",
  "categories": [
    "block",
    "Content"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/devl/team-grid.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport { ArrowUpRightIcon, AtSignIcon, GlobeIcon, MailIcon, PlusIcon } from \"lucide-react\";\nimport { AnimatePresence, motion, MotionConfig, useReducedMotion } from \"motion/react\";\nimport { type ReactNode, useEffect, useId, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nfunction useReducedMotionSafe() {\n  const prefers = useReducedMotion();\n  const [mounted, setMounted] = useState(false);\n  useEffect(() => setMounted(true), []);\n  return mounted && Boolean(prefers);\n}\n\nexport type TeamTone = \"violet\" | \"sky\" | \"emerald\" | \"amber\" | \"rose\" | \"teal\" | \"indigo\" | \"orange\";\n\nexport interface TeamMember {\n  name: string;\n  role: string;\n  team: string;\n  location: string;\n  timeZone?: string;\n  bio: string;\n  tone?: TeamTone;\n  links?: { email?: string; website?: string; handle?: string };\n}\n\nexport interface TeamGridProps {\n  eyebrow?: string;\n  title?: ReactNode;\n  description?: ReactNode;\n  members: TeamMember[];\n  hiring?: { title: string; text: string; href: string; count?: number };\n  className?: string;\n}\n\nconst ease = [0.23, 1, 0.32, 1] as const;\n\nconst tones: Record<TeamTone, { bg: string; text: string; ring: string }> = {\n  violet: {\n    bg: \"from-violet-100 to-violet-50/60 dark:from-violet-500/25 dark:to-violet-500/5\",\n    text: \"text-violet-700 dark:text-violet-300\",\n    ring: \"text-violet-500/25 dark:text-violet-300/15\",\n  },\n  sky: {\n    bg: \"from-sky-100 to-sky-50/60 dark:from-sky-500/25 dark:to-sky-500/5\",\n    text: \"text-sky-700 dark:text-sky-300\",\n    ring: \"text-sky-500/25 dark:text-sky-300/15\",\n  },\n  emerald: {\n    bg: \"from-emerald-100 to-emerald-50/60 dark:from-emerald-500/25 dark:to-emerald-500/5\",\n    text: \"text-emerald-700 dark:text-emerald-300\",\n    ring: \"text-emerald-500/25 dark:text-emerald-300/15\",\n  },\n  amber: {\n    bg: \"from-amber-100 to-amber-50/60 dark:from-amber-500/25 dark:to-amber-500/5\",\n    text: \"text-amber-800 dark:text-amber-300\",\n    ring: \"text-amber-500/30 dark:text-amber-300/15\",\n  },\n  rose: {\n    bg: \"from-rose-100 to-rose-50/60 dark:from-rose-500/25 dark:to-rose-500/5\",\n    text: \"text-rose-700 dark:text-rose-300\",\n    ring: \"text-rose-500/25 dark:text-rose-300/15\",\n  },\n  teal: {\n    bg: \"from-teal-100 to-teal-50/60 dark:from-teal-500/25 dark:to-teal-500/5\",\n    text: \"text-teal-700 dark:text-teal-300\",\n    ring: \"text-teal-500/25 dark:text-teal-300/15\",\n  },\n  indigo: {\n    bg: \"from-indigo-100 to-indigo-50/60 dark:from-indigo-500/25 dark:to-indigo-500/5\",\n    text: \"text-indigo-700 dark:text-indigo-300\",\n    ring: \"text-indigo-500/25 dark:text-indigo-300/15\",\n  },\n  orange: {\n    bg: \"from-orange-100 to-orange-50/60 dark:from-orange-500/25 dark:to-orange-500/5\",\n    text: \"text-orange-700 dark:text-orange-300\",\n    ring: \"text-orange-500/25 dark:text-orange-300/15\",\n  },\n};\nconst order = Object.keys(tones) as TeamTone[];\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .map((p) => p[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n}\n\nfunction useNow() {\n  const [now, setNow] = useState<Date | null>(null);\n  useEffect(() => {\n    setNow(new Date());\n    const id = window.setInterval(() => setNow(new Date()), 30_000);\n    return () => window.clearInterval(id);\n  }, []);\n  return now;\n}\n\nfunction localTime(now: Date | null, timeZone?: string) {\n  if (!now || !timeZone) return null;\n  try {\n    return new Intl.DateTimeFormat(\"en-GB\", { hour: \"2-digit\", minute: \"2-digit\", timeZone }).format(now);\n  } catch {\n    return null;\n  }\n}\n\nfunction MemberCard({ member, index, now }: { member: TeamMember; index: number; now: Date | null }) {\n  const reduce = useReducedMotionSafe();\n  const bioId = useId();\n  const [hover, setHover] = useState(false);\n  const [focus, setFocus] = useState(false);\n  const [pinned, setPinned] = useState(false);\n  const open = hover || focus || pinned;\n  const tone = tones[member.tone ?? order[index % order.length]];\n  const time = localTime(now, member.timeZone);\n  const links = member.links ?? {};\n\n  return (\n    <motion.li\n      animate={{ opacity: 1, scale: 1 }}\n      className=\"group/card relative\"\n      exit={{ opacity: 0, scale: 0.97 }}\n      initial={{ opacity: 0, scale: 0.97 }}\n      layout=\"position\"\n      onBlur={(e) => !e.currentTarget.contains(e.relatedTarget as Node) && setFocus(false)}\n      onFocus={() => setFocus(true)}\n      onPointerEnter={(e) => e.pointerType === \"mouse\" && setHover(true)}\n      onPointerLeave={() => setHover(false)}\n      transition={{ duration: 0.3, ease }}\n    >\n      <article className=\"relative isolate overflow-hidden rounded-2xl border bg-card shadow-xs/5 transition-shadow duration-200 group-hover/card:shadow-md/5\">\n        <button\n          aria-controls={bioId}\n          aria-expanded={open}\n          aria-label={`About ${member.name}`}\n          className=\"relative block aspect-[4/3] w-full cursor-pointer overflow-hidden outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset\"\n          onClick={() => setPinned((p) => !p)}\n          type=\"button\"\n        >\n          <span aria-hidden className={cn(\"absolute inset-0 bg-linear-to-br\", tone.bg)} />\n          <svg aria-hidden className={cn(\"absolute -right-10 -bottom-12 size-56\", tone.ring)} fill=\"none\" viewBox=\"0 0 200 200\">\n            {[30, 50, 70, 90].map((r) => (\n              <circle cx=\"100\" cy=\"100\" key={r} r={r} stroke=\"currentColor\" strokeWidth=\"1.25\" />\n            ))}\n          </svg>\n          <span\n            className={cn(\n              \"absolute inset-0 flex items-center justify-center font-heading font-semibold text-4xl tracking-tight sm:text-5xl\",\n              tone.text,\n            )}\n          >\n            {initials(member.name)}\n          </span>\n        </button>\n\n        <div className=\"p-4\">\n          <h3 className=\"truncate font-medium text-sm\">{member.name}</h3>\n          <p className=\"truncate text-muted-foreground text-xs\">{member.role}</p>\n          <p className=\"mt-2.5 flex items-center gap-1.5 text-muted-foreground text-xs\">\n            <span className=\"truncate\">{member.location}</span>\n            {time && (\n              <>\n                <span aria-hidden className=\"size-0.5 shrink-0 rounded-full bg-foreground/30\" />\n                <span className=\"shrink-0 font-mono tabular-nums\" title=\"Local time\">\n                  {time}\n                </span>\n              </>\n            )}\n          </p>\n        </div>\n\n        <motion.div\n          animate={open ? { y: \"0%\", opacity: 1 } : { y: reduce ? \"0%\" : \"12%\", opacity: 0 }}\n          className={cn(\n            \"absolute inset-0 flex flex-col bg-card p-4\",\n            !open && \"pointer-events-none\",\n          )}\n          id={bioId}\n          inert={!open}\n          initial={false}\n          transition={{ duration: 0.22, ease }}\n        >\n          <p className=\"font-medium text-sm\">{member.name}</p>\n          <p className=\"text-muted-foreground text-xs\">{member.role}</p>\n          <p className=\"mt-2.5 line-clamp-4 shrink-0 text-pretty text-xs leading-relaxed sm:mt-3 sm:line-clamp-6 sm:text-[0.8125rem]\">{member.bio}</p>\n          <div className=\"mt-auto flex gap-1 pt-3\">\n            {links.email && (\n              <a\n                aria-label={`Email ${member.name}`}\n                className=\"flex size-8 items-center justify-center rounded-lg border bg-background text-muted-foreground shadow-xs/5 outline-none transition-[color,translate,scale,rotate] duration-150 ease-out hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.94]\"\n                href={`mailto:${links.email}`}\n              >\n                <MailIcon className=\"size-3.5\" />\n              </a>\n            )}\n            {links.website && (\n              <a\n                aria-label={`${member.name}'s website`}\n                className=\"flex size-8 items-center justify-center rounded-lg border bg-background text-muted-foreground shadow-xs/5 outline-none transition-[color,translate,scale,rotate] duration-150 ease-out hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.94]\"\n                href={links.website}\n              >\n                <GlobeIcon className=\"size-3.5\" />\n              </a>\n            )}\n            {links.handle && (\n              <a\n                className=\"flex h-8 min-w-0 items-center gap-1 rounded-lg border bg-background px-2 text-muted-foreground text-xs shadow-xs/5 outline-none transition-[color,translate,scale,rotate] duration-150 ease-out hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.97]\"\n                href={`#${links.handle}`}\n              >\n                <AtSignIcon className=\"size-3 shrink-0\" />\n                <span className=\"truncate\">{links.handle}</span>\n              </a>\n            )}\n          </div>\n        </motion.div>\n      </article>\n    </motion.li>\n  );\n}\n\nexport function TeamGrid({\n  eyebrow = \"Team\",\n  title = \"The people behind it\",\n  description,\n  members,\n  hiring,\n  className,\n}: TeamGridProps) {\n  const reduce = useReducedMotionSafe();\n  const tabsId = useId();\n  const now = useNow();\n  const teams = [\"Everyone\", ...Array.from(new Set(members.map((m) => m.team)))];\n  const [team, setTeam] = useState(\"Everyone\");\n  const shown = members.filter((m) => team === \"Everyone\" || m.team === team);\n\n  return (\n    <MotionConfig reducedMotion=\"user\">\n      <section className={cn(\"mx-auto w-full max-w-[1100px]\", className)}>\n        <header className=\"flex flex-col gap-6 md:flex-row md:items-end md:justify-between\">\n          <div className=\"max-w-xl\">\n            {eyebrow && <p className=\"font-medium text-muted-foreground text-xs uppercase tracking-widest\">{eyebrow}</p>}\n            <h2 className=\"mt-2 text-balance font-heading font-semibold text-3xl tracking-tight sm:text-4xl\">{title}</h2>\n            {description && <p className=\"mt-3 text-pretty text-muted-foreground text-sm leading-relaxed\">{description}</p>}\n          </div>\n          <div\n            aria-label=\"Filter by team\"\n            className=\"-mx-4 flex gap-1 overflow-x-auto px-4 [scrollbar-width:none] md:mx-0 md:px-0\"\n            role=\"group\"\n          >\n            {teams.map((t) => {\n              const on = t === team;\n              return (\n                <button\n                  aria-pressed={on}\n                  className={cn(\n                    \"relative h-8 shrink-0 cursor-pointer rounded-full px-3 font-medium text-sm outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring\",\n                    on ? \"text-foreground\" : \"text-muted-foreground hover:text-foreground\",\n                  )}\n                  key={t}\n                  onClick={() => setTeam(t)}\n                  type=\"button\"\n                >\n                  {on && (\n                    <motion.span\n                      className=\"absolute inset-0 rounded-full bg-accent\"\n                      layoutId={tabsId}\n                      transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 500, damping: 40 }}\n                    />\n                  )}\n                  <span className=\"relative\">{t}</span>\n                </button>\n              );\n            })}\n          </div>\n        </header>\n\n        <ul className=\"mt-10 grid grid-cols-2 gap-3 sm:gap-4 md:grid-cols-3 lg:grid-cols-4\">\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {shown.map((member) => (\n              <MemberCard index={members.indexOf(member)} key={member.name} member={member} now={now} />\n            ))}\n            {hiring && (\n              <motion.li key=\"hiring\" layout=\"position\" transition={{ duration: 0.3, ease }}>\n                <a\n                  className=\"group/hire flex h-full min-h-56 flex-col justify-between rounded-2xl border border-dashed p-4 outline-none transition-[background-color,border-color,translate,scale,rotate] duration-200 ease-out hover:border-foreground/20 hover:bg-accent/50 focus-visible:ring-2 focus-visible:ring-ring active:scale-[0.98]\"\n                  href={hiring.href}\n                >\n                  <span className=\"flex size-9 items-center justify-center rounded-full border bg-background text-muted-foreground shadow-xs/5 transition-transform duration-200 ease-out group-hover/hire:rotate-90\">\n                    <PlusIcon className=\"size-4\" />\n                  </span>\n                  <span>\n                    <span className=\"flex items-center gap-2 font-medium text-sm\">\n                      {hiring.title}\n                      {hiring.count !== undefined && (\n                        <span className=\"rounded-full bg-success/10 px-1.5 py-px font-medium text-[0.625rem] text-success-foreground tabular-nums\">\n                          {hiring.count} open\n                        </span>\n                      )}\n                    </span>\n                    <span className=\"mt-1 block text-pretty text-muted-foreground text-xs leading-relaxed\">{hiring.text}</span>\n                    <span className=\"mt-3 inline-flex items-center gap-1 font-medium text-xs\">\n                      See roles\n                      <ArrowUpRightIcon className=\"size-3.5 transition-transform duration-200 ease-out group-hover/hire:translate-x-0.5 group-hover/hire:-translate-y-0.5\" />\n                    </span>\n                  </span>\n                </a>\n              </motion.li>\n            )}\n          </AnimatePresence>\n        </ul>\n      </section>\n    </MotionConfig>\n  );\n}\n"
    }
  ]
}