{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "profile-team-presence",
  "type": "registry:component",
  "title": "Profile Team Presence",
  "description": "A grid of teammate cards with presence dots that pulse when online, status notes, a typing indicator, local times and message and call actions, filtered by a status switch and a search field.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "profile",
    "profile",
    "team",
    "presence",
    "status",
    "directory",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/profile-team-presence",
  "files": [
    {
      "path": "registry/hyperblur/profile-team-presence.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/profile-team-presence.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type ProfilePresenceStatus = \"online\" | \"away\" | \"busy\" | \"offline\";\n\nexport interface ProfilePresenceMember {\n  name: string;\n  role: string;\n  status: ProfilePresenceStatus;\n  note: string;\n  localTime: string;\n  city: string;\n  hue: number;\n  typing?: boolean;\n}\n\nexport interface ProfileTeamPresenceProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  members?: ProfilePresenceMember[];\n  defaultFilter?: ProfilePresenceStatus | \"all\";\n  onMessage?: (member: ProfilePresenceMember) => void;\n  onCall?: (member: ProfilePresenceMember) => void;\n  accent?: string;\n}\n\nconst defaultMembers: ProfilePresenceMember[] = [\n  { name: \"Ines Carvalho\", role: \"Design Lead\", status: \"online\", note: \"Reviewing onboarding flows\", localTime: \"14:32\", city: \"Lisbon\", hue: 330, typing: true },\n  { name: \"Marcus Webb\", role: \"Backend Engineer\", status: \"busy\", note: \"In a call until 15:00\", localTime: \"09:32\", city: \"New York\", hue: 210 },\n  { name: \"Yuki Tanaka\", role: \"iOS Engineer\", status: \"online\", note: \"Shipping 4.2 to TestFlight\", localTime: \"22:32\", city: \"Osaka\", hue: 160 },\n  { name: \"Leah Goldberg\", role: \"Product Manager\", status: \"away\", note: \"Lunch, back at 14:00\", localTime: \"13:32\", city: \"London\", hue: 40 },\n  { name: \"Arjun Mehta\", role: \"Data Scientist\", status: \"online\", note: \"Training churn model v7\", localTime: \"19:02\", city: \"Bangalore\", hue: 265 },\n  { name: \"Sofia Rossi\", role: \"Frontend Engineer\", status: \"offline\", note: \"Back Monday\", localTime: \"15:32\", city: \"Milan\", hue: 12 },\n  { name: \"Kwame Asante\", role: \"Support Lead\", status: \"online\", note: \"Inbox zero, for now\", localTime: \"13:32\", city: \"Accra\", hue: 185 },\n  { name: \"Nora Lindgren\", role: \"QA Engineer\", status: \"away\", note: \"Focus time\", localTime: \"15:32\", city: \"Stockholm\", hue: 290 },\n];\n\nconst statusLabel: Record<ProfilePresenceStatus, string> = { online: \"Online\", away: \"Away\", busy: \"Do not disturb\", offline: \"Offline\" };\nconst filters: (ProfilePresenceStatus | \"all\")[] = [\"all\", \"online\", \"away\", \"busy\", \"offline\"];\nconst filterLabel: Record<ProfilePresenceStatus | \"all\", string> = { all: \"All\", online: \"Online\", away: \"Away\", busy: \"Busy\", offline: \"Offline\" };\n\nconst css = `\n@keyframes hb-yga-ping {\n  0% { transform: scale(1); opacity: 0.6; }\n  80%, 100% { transform: scale(2.6); opacity: 0; }\n}\n@keyframes hb-yga-in {\n  from { opacity: 0; transform: translateY(12px); }\n  to { opacity: 1; transform: none; }\n}\n@keyframes hb-yga-dot {\n  0%, 60%, 100% { transform: none; opacity: 0.4; }\n  30% { transform: translateY(-3px); opacity: 1; }\n}\n.hb-yga {\n  --hb-yga-accent: #10b981;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yga *, .hb-yga *::before, .hb-yga *::after { box-sizing: border-box; }\n.hb-yga-in { max-width: 1120px; margin: 0 auto; padding: 80px 24px 96px; }\n.hb-yga-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }\n.hb-yga-title { margin: 0; font-size: clamp(28px, 4cqw, 42px); font-weight: 650; letter-spacing: -0.04em; }\n.hb-yga-sub { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0 0; color: #8f8f8f; font-size: 14.5px; }\n.hb-yga-sub span { display: inline-flex; align-items: center; gap: 6px; }\n.hb-yga-sub i { width: 7px; height: 7px; border-radius: 50%; }\n.hb-yga-tools { display: flex; flex-wrap: wrap; gap: 10px; }\n.hb-yga-search {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  height: 38px;\n  padding: 0 12px;\n  border: 1px solid rgba(255, 255, 255, 0.08);\n  border-radius: 10px;\n  background: #111;\n  color: #6f6f6f;\n  transition: border-color 0.2s ease;\n}\n.hb-yga-search:focus-within { border-color: color-mix(in srgb, var(--hb-yga-accent) 60%, transparent); }\n.hb-yga-search input { width: 160px; border: 0; background: none; color: #ededed; font: inherit; font-size: 13.5px; outline: none; }\n.hb-yga-search input::placeholder { color: #5f5f5f; }\n.hb-yga-seg { display: flex; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px; background: #111; }\n.hb-yga-seg button {\n  height: 30px;\n  padding: 0 11px;\n  border: 0;\n  border-radius: 7px;\n  background: none;\n  color: #8f8f8f;\n  font: inherit;\n  font-size: 13px;\n  font-weight: 500;\n  cursor: pointer;\n  transition: background 0.2s ease, color 0.2s ease;\n}\n.hb-yga-seg button:hover { color: #ededed; }\n.hb-yga-seg button[aria-checked=\"true\"] { background: #1f1f1f; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }\n.hb-yga-seg button:focus-visible { outline: 2px solid var(--hb-yga-accent); outline-offset: 1px; }\n.hb-yga-grid {\n  display: grid;\n  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));\n  gap: 12px;\n  margin: 28px 0 0;\n  padding: 0;\n  list-style: none;\n}\n.hb-yga-card {\n  position: relative;\n  padding: 18px;\n  border: 1px solid rgba(255, 255, 255, 0.08);\n  border-radius: 18px;\n  background: linear-gradient(180deg, #131313, #0f0f0f);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);\n  animation: hb-yga-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;\n  transition: border-color 0.25s ease, transform 0.25s ease;\n}\n.hb-yga-card:hover, .hb-yga-card:focus-within { border-color: rgba(255, 255, 255, 0.16); transform: translateY(-2px); }\n.hb-yga-card[data-status=\"offline\"] { opacity: 0.62; }\n.hb-yga-top { display: flex; align-items: center; gap: 12px; }\n.hb-yga-av {\n  position: relative;\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 46px;\n  height: 46px;\n  border-radius: 50%;\n  background: linear-gradient(140deg, hsl(var(--hb-yga-h) 75% 62%), hsl(calc(var(--hb-yga-h) + 40) 60% 36%));\n  color: #fff;\n  font-size: 15px;\n  font-weight: 650;\n}\n.hb-yga-card[data-status=\"offline\"] .hb-yga-av { filter: grayscale(0.7); }\n.hb-yga-pres {\n  position: absolute;\n  right: -1px;\n  bottom: -1px;\n  width: 14px;\n  height: 14px;\n  border: 3px solid #121212;\n  border-radius: 50%;\n  background: var(--hb-yga-pc);\n}\n.hb-yga-pres::after {\n  content: \"\";\n  position: absolute;\n  inset: -3px;\n  border-radius: 50%;\n  background: var(--hb-yga-pc);\n  opacity: 0;\n}\n.hb-yga-card[data-status=\"online\"] .hb-yga-pres::after { animation: hb-yga-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite; animation-delay: inherit; }\n.hb-yga-card[data-status=\"busy\"] .hb-yga-pres::before {\n  content: \"\";\n  position: absolute;\n  left: 2px;\n  right: 2px;\n  top: 50%;\n  height: 2px;\n  margin-top: -1px;\n  border-radius: 1px;\n  background: #121212;\n}\n.hb-yga-card[data-status=\"offline\"] .hb-yga-pres { background: #121212; box-shadow: inset 0 0 0 2px #6f6f6f; }\n.hb-yga-who { min-width: 0; }\n.hb-yga-who strong { display: block; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yga-who span { display: block; margin-top: 2px; color: #8f8f8f; font-size: 13px; }\n.hb-yga-note {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  min-height: 38px;\n  margin-top: 14px;\n  padding: 9px 12px;\n  border-radius: 10px;\n  background: #0b0b0b;\n  color: #c4c4c4;\n  font-size: 13px;\n  line-height: 1.35;\n}\n.hb-yga-typing { display: inline-flex; gap: 3px; margin-left: auto; }\n.hb-yga-typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--hb-yga-accent); animation: hb-yga-dot 1.2s ease-in-out infinite; }\n.hb-yga-typing i:nth-child(2) { animation-delay: 0.15s; }\n.hb-yga-typing i:nth-child(3) { animation-delay: 0.3s; }\n.hb-yga-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; }\n.hb-yga-time { color: #6f6f6f; font-size: 12.5px; font-variant-numeric: tabular-nums; }\n.hb-yga-time b { color: #a1a1a1; font-weight: 500; }\n.hb-yga-acts { display: flex; gap: 6px; opacity: 0.55; transition: opacity 0.2s ease; }\n.hb-yga-card:hover .hb-yga-acts, .hb-yga-card:focus-within .hb-yga-acts { opacity: 1; }\n.hb-yga-act {\n  display: grid;\n  place-items: center;\n  width: 32px;\n  height: 32px;\n  border: 1px solid rgba(255, 255, 255, 0.1);\n  border-radius: 9px;\n  background: #171717;\n  color: #ededed;\n  cursor: pointer;\n  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;\n}\n.hb-yga-act:hover:not(:disabled) { background: color-mix(in srgb, var(--hb-yga-accent) 18%, #171717); border-color: color-mix(in srgb, var(--hb-yga-accent) 50%, transparent); color: #fff; }\n.hb-yga-act:disabled { opacity: 0.4; cursor: not-allowed; }\n.hb-yga-act:focus-visible { outline: 2px solid var(--hb-yga-accent); outline-offset: 2px; }\n.hb-yga-empty { grid-column: 1 / -1; padding: 40px; border: 1px dashed rgba(255, 255, 255, 0.1); border-radius: 18px; color: #8f8f8f; text-align: center; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-yga-card, .hb-yga-pres::after, .hb-yga-typing i { animation: none !important; }\n  .hb-yga-card, .hb-yga-acts, .hb-yga-act, .hb-yga-seg button, .hb-yga-search { transition: none; }\n}\n`;\n\nfunction initials(name: string) {\n  return name.split(\" \").map((p) => p[0]).slice(0, 2).join(\"\");\n}\n\nexport function ProfileTeamPresence({\n  title = \"Who is around\",\n  subtitle,\n  members = defaultMembers,\n  defaultFilter = \"all\",\n  onMessage,\n  onCall,\n  accent = \"#10b981\",\n  className = \"\",\n  style,\n  ...rest\n}: ProfileTeamPresenceProps) {\n  const [filter, setFilter] = React.useState<ProfilePresenceStatus | \"all\">(defaultFilter);\n  const [query, setQuery] = React.useState(\"\");\n  const segRefs = React.useRef<(HTMLButtonElement | null)[]>([]);\n  const colors: Record<ProfilePresenceStatus, string> = { online: accent, away: \"#f5a524\", busy: \"#ef4444\", offline: \"#6f6f6f\" };\n  const count = (s: ProfilePresenceStatus) => members.filter((m) => m.status === s).length;\n  const q = query.trim().toLowerCase();\n  const visible = members.filter((m) => (filter === \"all\" || m.status === filter) && (!q || `${m.name} ${m.role} ${m.city}`.toLowerCase().includes(q)));\n\n  const onSegKey = (e: React.KeyboardEvent, i: number) => {\n    if (e.key !== \"ArrowRight\" && e.key !== \"ArrowLeft\") return;\n    e.preventDefault();\n    const n = (i + (e.key === \"ArrowRight\" ? 1 : -1) + filters.length) % filters.length;\n    segRefs.current[n]?.focus();\n    setFilter(filters[n]);\n  };\n\n  return (\n    <section className={`hb-yga ${className}`} style={{ \"--hb-yga-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-profile-team-presence\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yga-in\">\n        <div className=\"hb-yga-head\">\n          <div>\n            <h2 className=\"hb-yga-title\">{title}</h2>\n            <p className=\"hb-yga-sub\">\n              {subtitle ?? (\n                <>\n                  <span><i style={{ background: colors.online }} aria-hidden=\"true\" />{count(\"online\")} online</span>\n                  <span><i style={{ background: colors.away }} aria-hidden=\"true\" />{count(\"away\")} away</span>\n                  <span><i style={{ background: colors.busy }} aria-hidden=\"true\" />{count(\"busy\")} busy</span>\n                  <span><i style={{ background: colors.offline }} aria-hidden=\"true\" />{count(\"offline\")} offline</span>\n                </>\n              )}\n            </p>\n          </div>\n          <div className=\"hb-yga-tools\">\n            <label className=\"hb-yga-search\">\n              <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"11\" r=\"7\" /><path d=\"M20 20l-3.5-3.5\" /></svg>\n              <input type=\"search\" placeholder=\"Search people\" aria-label=\"Search people\" value={query} onChange={(e) => setQuery(e.target.value)} />\n            </label>\n            <div className=\"hb-yga-seg\" role=\"radiogroup\" aria-label=\"Filter by status\">\n              {filters.map((f, i) => (\n                <button\n                  key={f}\n                  ref={(el) => { segRefs.current[i] = el; }}\n                  type=\"button\"\n                  role=\"radio\"\n                  aria-checked={filter === f}\n                  tabIndex={filter === f ? 0 : -1}\n                  onClick={() => setFilter(f)}\n                  onKeyDown={(e) => onSegKey(e, i)}\n                >\n                  {filterLabel[f]}\n                </button>\n              ))}\n            </div>\n          </div>\n        </div>\n        <ul className=\"hb-yga-grid\" aria-live=\"polite\">\n          {visible.length === 0 && <li className=\"hb-yga-empty\">No one matches that filter.</li>}\n          {visible.map((m, i) => (\n            <li\n              key={`${filter}-${m.name}`}\n              className=\"hb-yga-card\"\n              data-status={m.status}\n              style={{ \"--hb-yga-h\": m.hue, \"--hb-yga-pc\": colors[m.status], animationDelay: `${(i * 0.05).toFixed(2)}s` } as React.CSSProperties}\n            >\n              <div className=\"hb-yga-top\">\n                <span className=\"hb-yga-av\" aria-hidden=\"true\">\n                  {initials(m.name)}\n                  <span className=\"hb-yga-pres\" />\n                </span>\n                <div className=\"hb-yga-who\">\n                  <strong>{m.name}</strong>\n                  <span>{m.role} · {statusLabel[m.status]}</span>\n                </div>\n              </div>\n              <div className=\"hb-yga-note\">\n                {m.typing ? \"Typing in #design\" : m.note}\n                {m.typing && <span className=\"hb-yga-typing\" aria-hidden=\"true\"><i /><i /><i /></span>}\n              </div>\n              <div className=\"hb-yga-foot\">\n                <span className=\"hb-yga-time\"><b>{m.localTime}</b> in {m.city}</span>\n                <span className=\"hb-yga-acts\">\n                  <button type=\"button\" className=\"hb-yga-act\" aria-label={`Message ${m.name}`} onClick={() => onMessage?.(m)}>\n                    <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12Z\" /></svg>\n                  </button>\n                  <button type=\"button\" className=\"hb-yga-act\" aria-label={`Call ${m.name}`} disabled={m.status === \"offline\" || m.status === \"busy\"} onClick={() => onCall?.(m)}>\n                    <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M15 10l5-3v10l-5-3M3 7h12v10H3z\" /></svg>\n                  </button>\n                </span>\n              </div>\n            </li>\n          ))}\n        </ul>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}