{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "media-14",
  "type": "registry:block",
  "description": "Voice sample list with single-active mini players and progress-filling waveforms.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/media/media-14.tsx",
      "content": "\"use client\"\n\nimport { useEffect, useState } from \"react\"\nimport { Download, Pause, Play } from \"@designali/icons\"\n\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst clips = [\n  {\n    title: \"UI interaction\",\n    voice: \"Soft click\",\n    tag: \"Interface\",\n    length: 24,\n  },\n  { title: \"Page transition\", voice: \"Whoosh\", tag: \"Motion\", length: 11 },\n  { title: \"Brand reveal\", voice: \"Logo sting\", tag: \"Brand\", length: 18 },\n  {\n    title: \"Showreel background\",\n    voice: \"Ambient pad\",\n    tag: \"Long-form\",\n    length: 32,\n  },\n  {\n    title: \"Success state\",\n    voice: \"Glass chime\",\n    tag: \"Interface\",\n    length: 27,\n  },\n]\n\nfunction bars(seed: number) {\n  return Array.from(\n    { length: 48 },\n    (_, i) =>\n      20 +\n      Math.abs(\n        Math.sin(i * 0.55 + seed) * 60 + Math.sin(i * 1.7 + seed * 2) * 20\n      )\n  )\n}\n\nexport default function Media14() {\n  const [active, setActive] = useState<number | null>(null)\n  const [progress, setProgress] = useState(0)\n\n  useEffect(() => {\n    if (active === null) return\n    const id = setTimeout(() => {\n      if (progress + 0.1 >= clips[active]!.length) {\n        setActive(null)\n        setProgress(0)\n      } else setProgress(progress + 0.1)\n    }, 100)\n    return () => clearTimeout(id)\n  }, [active, progress])\n\n  const toggle = (i: number) => {\n    if (active === i) setActive(null)\n    else {\n      setActive(i)\n      setProgress(0)\n    }\n  }\n\n  return (\n    <section className=\"w-full bg-background py-20\">\n      <div className=\"mx-auto max-w-4xl px-6\">\n        <p className=\"text-xs tracking-widest text-muted-foreground uppercase\">\n          Designali sound library\n        </p>\n        <h2 className=\"mt-3 text-3xl font-semibold tracking-tight md:text-4xl\">\n          Hear every sound before you choose\n        </h2>\n        <p className=\"mt-3 max-w-xl text-muted-foreground\">\n          Five of the sounds Designali uses in CGI, 3D and motion projects. Each\n          sample is an unedited preview.\n        </p>\n        <ul className=\"mt-10 divide-y divide-border border-y border-border\">\n          {clips.map((clip, i) => {\n            const isActive = active === i\n            const pct = isActive ? progress / clip.length : 0\n            const heights = bars(i + 1)\n            return (\n              <li\n                key={clip.title}\n                className={cn(\n                  \"flex items-center gap-4 py-4 transition-colors\",\n                  isActive && \"bg-muted/50\"\n                )}\n              >\n                <button\n                  type=\"button\"\n                  aria-label={\n                    isActive ? `Pause ${clip.title}` : `Play ${clip.title}`\n                  }\n                  onClick={() => toggle(i)}\n                  className={cn(\n                    \"ml-2 flex size-10 shrink-0 items-center justify-center rounded-full border border-border transition-colors\",\n                    isActive\n                      ? \"bg-foreground text-background\"\n                      : \"hover:bg-muted\"\n                  )}\n                >\n                  {isActive ? (\n                    <Pause className=\"size-4 fill-current\" />\n                  ) : (\n                    <Play className=\"size-4 translate-x-px fill-current\" />\n                  )}\n                </button>\n                <div className=\"w-36 shrink-0 sm:w-48\">\n                  <p className=\"truncate text-sm font-medium\">{clip.voice}</p>\n                  <p className=\"truncate text-xs text-muted-foreground\">\n                    {clip.title}\n                  </p>\n                </div>\n                <div\n                  className=\"flex h-10 min-w-0 flex-1 items-center gap-px\"\n                  aria-hidden\n                >\n                  {heights.map((h, b) => (\n                    <span\n                      key={b}\n                      className={cn(\n                        \"flex-1 transition-colors\",\n                        b / heights.length < pct\n                          ? \"bg-foreground\"\n                          : \"bg-border\",\n                        b % 2 === 1 && \"hidden sm:block\"\n                      )}\n                      style={{ height: `${h}%` }}\n                    />\n                  ))}\n                </div>\n                <span className=\"hidden w-24 shrink-0 text-center text-xs text-muted-foreground md:block\">\n                  {clip.tag}\n                </span>\n                <span className=\"w-10 shrink-0 text-right font-sans text-xs tabular-nums\">\n                  0:{String(clip.length).padStart(2, \"0\")}\n                </span>\n                <button\n                  type=\"button\"\n                  aria-label=\"Download\"\n                  className=\"mr-2 hidden p-2 text-muted-foreground hover:text-foreground sm:block\"\n                >\n                  <Download className=\"size-4\" />\n                </button>\n              </li>\n            )\n          })}\n        </ul>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "650px"
  },
  "categories": [
    "media"
  ]
}