{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "engagement-bar-fixtures",
  "title": "Engagement Bar — fixtures",
  "author": "ilinxa",
  "description": "Engagement Bar plus the dummy-data fixtures used by the docs-site demo.",
  "registryDependencies": [
    "@ilinxa/engagement-bar"
  ],
  "files": [
    {
      "path": "src/registry/components/data/engagement-bar/dummy-data.ts",
      "content": "import type {\n  EngagementAction,\n  EngagementDelta,\n  EngagementLikeUser,\n  Subscribe,\n} from \"./types\";\n\nconst noop = () => {};\n\n// Demo data uses UNCONTROLLED mode (no explicit `liked` / `bookmarked` fields)\n// so clicks visibly flip via the bar's internal mirror. Passing `liked: false`\n// would put the action in CONTROLLED mode (action.liked !== undefined), which\n// means the host owns the value — clicks dispatch nothing visible because the\n// noop callback doesn't update a host-side state. Pre-existing demos passed\n// these explicit-false fields, which silently disabled interactivity. v0.3.0\n// fix: drop them; let the internal mirror drive.\nexport const DUMMY_POST_ENGAGEMENT: EngagementAction[] = [\n  { kind: \"like\", count: 142, onToggle: noop },\n  { kind: \"comment\", count: 23, onClick: noop },\n  { kind: \"share\", count: 8, onClick: noop },\n  { kind: \"bookmark\", onToggle: noop },\n];\n\nexport const DUMMY_NEWS_CARD_ENGAGEMENT: EngagementAction[] = [\n  { kind: \"like\", count: 56, onToggle: noop },\n  { kind: \"share\", onClick: noop },\n  { kind: \"bookmark\", onToggle: noop },\n];\n\nexport const DUMMY_VIDEO_ENGAGEMENT_STACKED: EngagementAction[] = [\n  { kind: \"like\", count: 1234, onToggle: noop },\n  { kind: \"comment\", count: 87, onClick: noop },\n  { kind: \"share\", count: 12, onClick: noop },\n  { kind: \"view-count\", count: 12_345 },\n];\n\nexport const DUMMY_LIKE_USERS: EngagementLikeUser[] = [\n  {\n    id: \"u1\",\n    name: \"Ada Lovelace\",\n    username: \"ada\",\n    avatar: \"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=80\",\n  },\n  {\n    id: \"u2\",\n    name: \"Grace Hopper\",\n    username: \"grace\",\n    avatar: \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=80\",\n  },\n  {\n    id: \"u3\",\n    name: \"Linus Torvalds\",\n    username: \"linus\",\n    avatar: \"https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=80\",\n  },\n  {\n    id: \"u4\",\n    name: \"Margaret Hamilton\",\n    username: \"maggie\",\n    avatar: \"https://images.unsplash.com/photo-1531123897727-8f129e1688ce?w=80\",\n  },\n  {\n    id: \"u5\",\n    name: \"Alan Turing\",\n    username: \"alan\",\n    avatar: \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=80\",\n  },\n];\n\n/**\n * Sandbox-only fake subscription. Fires a synthetic like-changed delta every 4s\n * for the realtime demo. Real consumers wire their own subscribe over websocket / SSE.\n */\nexport function createDummySubscribe(initialCount = 142): Subscribe<EngagementDelta> {\n  return (handler) => {\n    let current = initialCount;\n    const id = setInterval(() => {\n      current += Math.floor(Math.random() * 5) + 1;\n      handler({ kind: \"like-changed\", count: current });\n    }, 4000);\n    return () => clearInterval(id);\n  };\n}\n",
      "type": "registry:component",
      "target": "components/engagement-bar/dummy-data.ts"
    }
  ],
  "categories": [
    "data",
    "fixtures"
  ],
  "type": "registry:block"
}