{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "clip-timeline",
  "title": "Clip timeline",
  "description": "Trim a field recording from either end and see the length of the selected clip.",
  "registryDependencies": [
    "https://www.cyberspec.dev/r/recipe-layout.json",
    "https://www.cyberspec.dev/r/readout.json",
    "https://www.cyberspec.dev/r/slider.json"
  ],
  "files": [
    {
      "path": "registry/cyber/recipes/clip-timeline.tsx",
      "content": "\"use client\"\n\nimport \"./recipe-layout.css\"\nimport { useState } from \"react\"\nimport { Readout } from \"@/registry/cyber/ui/readout\"\nimport { Slider } from \"@/registry/cyber/ui/slider\"\n\nconst duration = 60\nconst samples = Array.from({ length: duration }, (_, i) => 12 + 88 * Math.abs(Math.sin(i * 0.43) * Math.cos(i * 0.19)))\n\nexport default function ClipTimeline() {\n  const [range, setRange] = useState([8, 42])\n  const [start, end] = range\n\n  return (\n    <div className=\"sink-stack\">\n      <div className=\"sink-between\"><strong>Night train.wav</strong><span className=\"sink-label\">1:00</span></div>\n      <div aria-hidden=\"true\" style={{ display: \"flex\", alignItems: \"center\", gap: 1, height: 64, paddingBlock: 6, backgroundColor: \"var(--cy-panel)\", borderBlock: \"1px solid var(--cy-line-deco)\" }}>\n        {samples.map((height, i) => <span key={i} style={{ flex: \"1 1 0\", height: `${height}%`, backgroundColor: i >= start && i < end ? \"var(--cy-signal)\" : \"var(--cy-line-ctl)\" }} />)}\n      </div>\n      <Slider label=\"Trim points\" thumbLabels={[\"Clip start\", \"Clip end\"]} value={range} onValueChange={setRange} min={0} max={duration} ticks={12} format={(value) => `${value}s`} />\n      <Readout label=\"Selected duration\" value={end - start} unit=\"s\" size=\"sm\" />\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "@components/recipes/clip-timeline.tsx"
    }
  ],
  "categories": [
    "recipe",
    "studio"
  ],
  "type": "registry:component"
}
