{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-stack",
  "type": "registry:ui",
  "title": "Notification Stack",
  "dependencies": [
    "motion",
    "lucide-react"
  ],
  "files": [
    {
      "path": "components/ui/notification-stack.tsx",
      "content": "\"use client\";\n\nimport React, { useState } from \"react\";\nimport { motion, AnimatePresence } from \"motion/react\";\nimport { Bell, CheckCircle2, X } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Notification {\n  id: number;\n  title: string;\n  body: string;\n  time: string;\n}\n\nconst INITIAL: Notification[] = [\n  { id: 1, title: \"Registry Built\", body: \"13 components synced to /r\", time: \"Just now\" },\n  { id: 2, title: \"Deployment Ready\", body: \"Production bundle verified\", time: \"2m ago\" },\n  { id: 3, title: \"New Star\", body: \"ibiUI gained a star\", time: \"14m ago\" },\n];\n\nexport function NotificationStack({ className }: { className?: string }) {\n  const [items, setItems] = useState<Notification[]>(INITIAL);\n  const [expanded, setExpanded] = useState(false);\n\n  const dismiss = (id: number, e: React.MouseEvent) => {\n    e.stopPropagation();\n    setItems((prev) => prev.filter((item) => item.id !== id));\n  };\n\n  if (items.length === 0) {\n    return (\n      <button\n        onClick={() => setItems(INITIAL)}\n        className=\"inline-flex items-center gap-2 rounded-full border border-white/10 bg-zinc-900 px-4 py-2 text-xs text-zinc-300 hover:bg-zinc-800 cursor-pointer\"\n      >\n        <Bell className=\"h-3.5 w-3.5\" />\n        Restore Notifications\n      </button>\n    );\n  }\n\n  return (\n    <div\n      onClick={() => setExpanded((e) => !e)}\n      className={cn(\"relative w-full max-w-sm cursor-pointer select-none\", className)}\n    >\n      <div className=\"mb-2 flex items-center justify-between px-1 text-[11px] text-zinc-400\">\n        <span>{expanded ? \"Click to stack\" : \"Click to expand stack\"}</span>\n        <span>{items.length} active</span>\n      </div>\n\n      <div className=\"relative flex flex-col gap-2\">\n        <AnimatePresence mode=\"popLayout\">\n          {items.map((item, idx) => {\n            const offset = expanded ? 0 : idx * -56;\n            const scale = expanded ? 1 : 1 - idx * 0.05;\n            const opacity = expanded ? 1 : Math.max(0.4, 1 - idx * 0.25);\n\n            return (\n              <motion.div\n                key={item.id}\n                layout\n                initial={{ opacity: 0, y: -12, scale: 0.95 }}\n                animate={{\n                  opacity,\n                  y: offset,\n                  scale,\n                  zIndex: items.length - idx,\n                }}\n                exit={{ opacity: 0, x: 40, scale: 0.9 }}\n                transition={{ type: \"spring\", stiffness: 360, damping: 28 }}\n                className=\"flex items-start justify-between gap-3 rounded-xl border border-white/10 bg-zinc-900/95 p-3 shadow-lg backdrop-blur-md\"\n              >\n                <div className=\"flex items-start gap-2.5\">\n                  <CheckCircle2 className=\"mt-0.5 h-4 w-4 shrink-0 text-emerald-400\" />\n                  <div>\n                    <div className=\"text-xs font-medium text-zinc-100\">\n                      {item.title}\n                    </div>\n                    <div className=\"text-[11px] text-zinc-400\">{item.body}</div>\n                  </div>\n                </div>\n                <div className=\"flex items-center gap-2\">\n                  <span className=\"text-[10px] text-zinc-500\">{item.time}</span>\n                  <button\n                    onClick={(e) => dismiss(item.id, e)}\n                    className=\"rounded p-0.5 text-zinc-500 hover:bg-white/10 hover:text-zinc-200 cursor-pointer\"\n                  >\n                    <X className=\"h-3 w-3\" />\n                  </button>\n                </div>\n              </motion.div>\n            );\n          })}\n        </AnimatePresence>\n      </div>\n    </div>\n  );\n}\n\n",
      "type": "registry:ui"
    }
  ]
}