{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-stack-demo",
  "title": "Notification Stack Demo",
  "description": "A worked example of Notification Stack: Several notifications kept as one compact stack. It spreads into a readable list on hover, focus or tap, and folds back when you leave.",
  "dependencies": [
    "lucide-react@^1.31.0"
  ],
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/notification-stack.json"
  ],
  "files": [
    {
      "path": "components/demos/notification-stack-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n  CalendarClock,\n  GitBranch,\n  HardDrive,\n  MessageSquare,\n} from \"lucide-react\"\n\nimport {\n  NotificationStack,\n  type NotificationStackItem,\n} from \"@/registry/default/notification-stack/notification-stack\"\n\nconst initial: NotificationStackItem[] = [\n  {\n    id: \"comment\",\n    title: \"New comment on Launch checklist\",\n    description: \"Can we move the beta date to Thursday?\",\n    time: \"2m ago\",\n    icon: <MessageSquare size={16} />,\n  },\n  {\n    id: \"build\",\n    title: \"Build passed on main\",\n    description: \"All 3 checks finished in 4 minutes.\",\n    time: \"9m ago\",\n    icon: <GitBranch size={16} />,\n  },\n  {\n    id: \"meeting\",\n    title: \"Design review starts in 15 minutes\",\n    description: \"Room 4 and the video link are in the invite.\",\n    time: \"12m ago\",\n    icon: <CalendarClock size={16} />,\n  },\n  {\n    id: \"storage\",\n    title: \"Storage is almost full\",\n    description: \"9.2 GB of 10 GB used. Old exports can be removed.\",\n    time: \"1h ago\",\n    icon: <HardDrive size={16} />,\n  },\n]\n\nconst later: NotificationStackItem = {\n  id: \"reply\",\n  title: \"Reply on Launch checklist\",\n  description: \"Thursday works. I will update the plan.\",\n  time: \"Just now\",\n  icon: <MessageSquare size={16} />,\n}\n\nconst action =\n  \"border-border hover:bg-muted focus-visible:ring-ring/50 min-h-9 rounded-[var(--radius)] border px-3 text-sm outline-none focus-visible:ring-4 disabled:opacity-50\"\n\nexport function NotificationStackDemo() {\n  const [items, setItems] = React.useState(initial)\n  const replied = items.some((item) => item.id === later.id)\n\n  return (\n    <div className=\"flex w-full max-w-sm flex-col gap-4\">\n      <NotificationStack\n        items={items}\n        onDismiss={(id) =>\n          setItems((list) => list.filter((item) => item.id !== id))\n        }\n        onClearAll={() => setItems([])}\n      />\n      <div className=\"flex flex-wrap gap-2 pt-8\">\n        <button\n          type=\"button\"\n          className={action}\n          disabled={replied}\n          onClick={() => setItems((list) => [later, ...list])}\n        >\n          Get a reply\n        </button>\n        <button\n          type=\"button\"\n          className={action}\n          onClick={() => setItems(initial)}\n        >\n          Reset\n        </button>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}