{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activity-feed",
  "type": "registry:component",
  "title": "Activity Feed",
  "description": "A vertical timeline of events with avatars, detail cards and a staggered entrance.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "app-ui",
    "timeline",
    "feed",
    "activity",
    "audit log"
  ],
  "docs": "https://hyperblur.dev/effects/activity-feed",
  "files": [
    {
      "path": "registry/hyperblur/activity-feed.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/activity-feed.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type ActivityTone = \"default\" | \"success\" | \"warning\" | \"danger\";\n\nexport interface ActivityFeedItem {\n  id: string;\n  actor: string;\n  action: string;\n  target?: string;\n  time: string;\n  avatar?: React.ReactNode;\n  detail?: React.ReactNode;\n  tone?: ActivityTone;\n}\n\nexport interface ActivityFeedProps\n  extends Omit<React.HTMLAttributes<HTMLDivElement>, \"children\"> {\n  items: ActivityFeedItem[];\n  maxHeight?: number;\n  showLine?: boolean;\n  color?: string;\n}\n\nconst css = `\n.hb-af {\n  position: relative;\n  color: #ededed;\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  font-size: 13px;\n  line-height: 1.45;\n  --hb-af-accent: #2f7bff;\n}\n.hb-af-scroll {\n  max-height: var(--hb-af-max, none);\n  overflow-y: auto;\n  overscroll-behavior: contain;\n  scrollbar-width: thin;\n  scrollbar-color: #2a2a2a transparent;\n}\n.hb-af-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }\n.hb-af-item {\n  position: relative;\n  display: grid;\n  grid-template-columns: 28px minmax(0, 1fr);\n  column-gap: 12px;\n  padding-bottom: 16px;\n  animation: hb-af-in .5s cubic-bezier(.22, .8, .24, 1) both;\n  animation-delay: var(--hb-af-d, 0s);\n}\n.hb-af-item:last-child { padding-bottom: 0; }\n.hb-af[data-line=\"true\"] .hb-af-item::before {\n  content: \"\";\n  position: absolute;\n  left: 13px;\n  top: 34px;\n  bottom: 6px;\n  width: 1px;\n  background: #262626;\n}\n.hb-af[data-line=\"true\"] .hb-af-item:last-child::before { display: none; }\n.hb-af-avatar {\n  position: relative;\n  display: grid;\n  place-items: center;\n  width: 28px;\n  height: 28px;\n  overflow: hidden;\n  border-radius: 999px;\n  background: var(--hb-af-bg, #262626);\n  color: #ededed;\n  font-size: 11px;\n  font-weight: 600;\n  letter-spacing: .02em;\n}\n.hb-af-avatar > img, .hb-af-avatar > svg { width: 100%; height: 100%; object-fit: cover; }\n.hb-af-dot {\n  position: absolute;\n  right: -1px;\n  bottom: -1px;\n  z-index: 1;\n  width: 9px;\n  height: 9px;\n  border: 2px solid var(--hb-af-surface, #111111);\n  border-radius: 999px;\n  background: var(--hb-af-tone, var(--hb-af-accent));\n  box-sizing: content-box;\n}\n.hb-af-wrap { position: relative; width: 28px; height: 28px; }\n.hb-af-body { min-width: 0; padding-top: 4px; }\n.hb-af-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }\n.hb-af-text { min-width: 0; color: #8f8f8f; overflow-wrap: anywhere; }\n.hb-af-actor { color: #ededed; font-weight: 500; }\n.hb-af-target { color: #ededed; font-weight: 500; }\n.hb-af-time { flex: none; color: #8f8f8f; font-size: 12px; white-space: nowrap; }\n.hb-af-detail {\n  margin-top: 8px;\n  padding: 10px 12px;\n  border: 1px solid #262626;\n  border-radius: 10px;\n  background: #111111;\n  color: #ededed;\n  font-size: 12.5px;\n}\n@keyframes hb-af-in {\n  from { opacity: 0; transform: translate3d(0, 10px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-af-item { animation: none; }\n}\n`;\n\nconst TONES: Record<ActivityTone, string> = {\n  default: \"var(--hb-af-accent)\",\n  success: \"#3ecf8e\",\n  warning: \"#f5a524\",\n  danger: \"#f4525e\",\n};\n\nconst SWATCHES = [\"#1d3a6e\", \"#3b2a63\", \"#14463a\", \"#5a3217\", \"#5b2230\", \"#2b3a45\"];\n\nfunction initials(name: string) {\n  const parts = name.trim().split(/\\s+/).filter(Boolean);\n  if (parts.length === 0) return \"?\";\n  if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\n  return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();\n}\n\nfunction swatch(name: string) {\n  let sum = 0;\n  for (let i = 0; i < name.length; i++) sum += name.charCodeAt(i);\n  return SWATCHES[sum % SWATCHES.length];\n}\n\nexport function ActivityFeed({\n  items,\n  maxHeight,\n  showLine = true,\n  color = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: ActivityFeedProps) {\n  const vars = {\n    \"--hb-af-accent\": color,\n    \"--hb-af-max\": maxHeight === undefined ? \"none\" : `${Math.max(0, maxHeight)}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <div className={`hb-af ${className}`} data-line={showLine} style={vars} {...rest}>\n      <style href=\"hb-activity-feed\" precedence=\"default\">{css}</style>\n      <div className=\"hb-af-scroll\">\n        <ol className=\"hb-af-list\">\n          {items.map((item, i) => {\n            const tone = item.tone ?? \"default\";\n            return (\n              <li\n                key={item.id}\n                className=\"hb-af-item\"\n                style={{ \"--hb-af-d\": `${Math.min(i, 10) * 0.07}s`, \"--hb-af-tone\": TONES[tone] } as React.CSSProperties}\n              >\n                <div className=\"hb-af-wrap\">\n                  <span\n                    className=\"hb-af-avatar\"\n                    style={{ \"--hb-af-bg\": swatch(item.actor) } as React.CSSProperties}\n                    aria-hidden=\"true\"\n                  >\n                    {item.avatar ?? initials(item.actor)}\n                  </span>\n                  <span className=\"hb-af-dot\" aria-hidden=\"true\" />\n                </div>\n                <div className=\"hb-af-body\">\n                  <div className=\"hb-af-line\">\n                    <span className=\"hb-af-text\">\n                      <span className=\"hb-af-actor\">{item.actor}</span> {item.action}\n                      {item.target ? (\n                        <>\n                          {\" \"}\n                          <span className=\"hb-af-target\">{item.target}</span>\n                        </>\n                      ) : null}\n                    </span>\n                    <span className=\"hb-af-time\">{item.time}</span>\n                  </div>\n                  {item.detail ? <div className=\"hb-af-detail\">{item.detail}</div> : null}\n                </div>\n              </li>\n            );\n          })}\n        </ol>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}