{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "media-library-fixtures",
  "title": "Media Library — fixtures",
  "author": "ilinxa",
  "description": "Media Library plus the dummy-data fixtures used by the docs-site demo.",
  "registryDependencies": [
    "@ilinxa/media-library"
  ],
  "files": [
    {
      "path": "src/registry/components/media/media-library/dummy-data.ts",
      "content": "import type { MediaNode } from \"./types\";\n\n/** A fixed past instant offset from a stable base (avoids Date.now at module load). */\nfunction relativeIso({ hours = 0, days = 0 }: { hours?: number; days?: number }): string {\n  const base = new Date(\"2026-06-09T12:00:00.000Z\").getTime();\n  return new Date(base - (hours * 3600 + days * 86400) * 1000).toISOString();\n}\n\n/** Deterministic source-key → stable Unsplash photo map (sorted distinct keys, in order). */\nconst PHOTO_KEY_TO_UNSPLASH: Record<string, string> = {\n  \"id/1015\": \"photo-1506744038136-46273834b3fb\",\n  \"id/1016\": \"photo-1519389950473-47ba0277781c\",\n  \"id/1019\": \"photo-1486312338219-ce68d2c6f44d\",\n};\n\nfunction img(\n  id: string,\n  name: string,\n  sizeKb: number,\n  days: number,\n  photoKey: string,\n): MediaNode {\n  const photo = PHOTO_KEY_TO_UNSPLASH[photoKey] ?? PHOTO_KEY_TO_UNSPLASH[\"id/1015\"];\n  return {\n    id,\n    name,\n    type: \"file\",\n    ext: name.split(\".\").pop(),\n    mimeType: \"image/jpeg\",\n    size: sizeKb * 1000,\n    width: 1600,\n    height: 1066,\n    modifiedAt: relativeIso({ days }),\n    url: `https://images.unsplash.com/${photo}?w=1600&h=1066&fit=crop&q=80`,\n    thumbnailUrl: `https://images.unsplash.com/${photo}?w=600&h=400&fit=crop&q=80`,\n  };\n}\n\n/**\n * Sample library mirroring the reference CMS \"Media library\" surface: a few\n * folders + root files spanning the previewable types. Folders use\n * `children: undefined` to exercise lazy loading via `onLoadChildren`.\n */\nexport const MEDIA_LIBRARY_NODES: MediaNode[] = [\n  { id: \"f-photos\", name: \"Photos\", type: \"folder\", modifiedAt: relativeIso({ hours: 2 }), children: undefined },\n  { id: \"f-brand\", name: \"Brand & logos\", type: \"folder\", modifiedAt: \"2026-03-24T10:00:00.000Z\", children: undefined },\n  { id: \"f-docs\", name: \"Documents\", type: \"folder\", modifiedAt: relativeIso({ days: 3 }), children: undefined },\n  { id: \"f-video\", name: \"Video\", type: \"folder\", modifiedAt: relativeIso({ days: 8 }), children: undefined },\n  {\n    id: \"file-hero\",\n    name: \"hero-home.jpg\",\n    type: \"file\",\n    ext: \"jpg\",\n    mimeType: \"image/jpeg\",\n    size: 2_415_000,\n    width: 2400,\n    height: 1350,\n    modifiedAt: relativeIso({ hours: 5 }),\n    url: \"https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=2400&h=1350&fit=crop&q=80\",\n    thumbnailUrl: \"https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=640&h=360&fit=crop&q=80\",\n  },\n  {\n    id: \"file-og\",\n    name: \"og-card.png\",\n    type: \"file\",\n    ext: \"png\",\n    mimeType: \"image/png\",\n    size: 845_000,\n    width: 1200,\n    height: 630,\n    modifiedAt: relativeIso({ days: 1 }),\n    url: \"https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=1200&h=630&fit=crop&q=80\",\n    thumbnailUrl: \"https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=600&h=315&fit=crop&q=80\",\n  },\n  {\n    id: \"file-favicon\",\n    name: \"favicon.png\",\n    type: \"file\",\n    ext: \"png\",\n    mimeType: \"image/png\",\n    size: 18_400,\n    width: 512,\n    height: 512,\n    modifiedAt: relativeIso({ days: 2 }),\n    url: \"https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=512&h=512&fit=crop&q=80\",\n    thumbnailUrl: \"https://images.unsplash.com/photo-1504674900247-0877df9cc836?w=256&h=256&fit=crop&q=80\",\n  },\n];\n\n/** Children resolved lazily by the demo's `onLoadChildren`. */\nexport const MEDIA_LIBRARY_CHILDREN: Record<string, MediaNode[]> = {\n  \"f-photos\": [\n    img(\"p1\", \"beach-sunset.jpg\", 1080, 3, \"id/1015\"),\n    img(\"p2\", \"mountains.jpg\", 1480, 6, \"id/1016\"),\n    img(\"p3\", \"city-night.jpg\", 990, 12, \"id/1019\"),\n  ],\n  \"f-brand\": [\n    {\n      id: \"b-readme\",\n      name: \"brand-guidelines.md\",\n      type: \"file\",\n      ext: \"md\",\n      mimeType: \"text/markdown\",\n      size: 4200,\n      modifiedAt: \"2026-03-24T10:00:00.000Z\",\n      url:\n        \"data:text/markdown,\" +\n        encodeURIComponent(\n          \"# Brand guidelines\\n\\n## Logo\\nUse the **signal-lime** mark on near-black.\\n\\n- Min size: 24px\\n- Clear space: 1× cap height\\n\",\n        ),\n    },\n    {\n      id: \"b-tokens\",\n      name: \"tokens.json\",\n      type: \"file\",\n      ext: \"json\",\n      mimeType: \"application/json\",\n      size: 1200,\n      modifiedAt: \"2026-03-22T10:00:00.000Z\",\n      url:\n        \"data:application/json,\" +\n        encodeURIComponent(\n          JSON.stringify({ accent: \"oklch(0.80 0.20 132)\", font: \"Onest\", radius: 12 }, null, 2),\n        ),\n    },\n  ],\n  \"f-docs\": [\n    {\n      id: \"d-notes\",\n      name: \"release-notes.txt\",\n      type: \"file\",\n      ext: \"txt\",\n      mimeType: \"text/plain\",\n      size: 820,\n      modifiedAt: relativeIso({ days: 3 }),\n      url:\n        \"data:text/plain,\" +\n        encodeURIComponent(\"Release 2.4\\n- Media library ships\\n- Drive-style previews\\n\"),\n    },\n    {\n      id: \"d-report\",\n      name: \"annual-report.pdf\",\n      type: \"file\",\n      ext: \"pdf\",\n      mimeType: \"application/pdf\",\n      size: 1_240_000,\n      modifiedAt: relativeIso({ days: 4 }),\n      url: \"https://mozilla.github.io/pdf.js/web/compressed.tracemonkey-pldi-09.pdf\",\n    },\n  ],\n  \"f-video\": [\n    {\n      id: \"v1\",\n      name: \"promo.mp4\",\n      type: \"file\",\n      ext: \"mp4\",\n      mimeType: \"video/mp4\",\n      size: 8_400_000,\n      modifiedAt: relativeIso({ days: 8 }),\n      url: \"https://www.w3schools.com/html/mov_bbb.mp4\",\n    },\n  ],\n};\n\nexport const MEDIA_LIBRARY_STORAGE = { used: 12_800_000_000, total: 50_000_000_000 };\n\n// @ilinxa/media-library-fixtures 0.2.3\n",
      "type": "registry:component",
      "target": "components/media-library/dummy-data.ts"
    }
  ],
  "meta": {
    "version": "0.2.3",
    "status": "alpha"
  },
  "categories": [
    "media",
    "fixtures"
  ],
  "type": "registry:block"
}