{
  "component": {
    "id": "voice-recorder",
    "name": "Voice recorder",
    "tier": "pro",
    "exampleId": "voice-recorder",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/voice-recorder-demo.tsx",
    "exportName": "VoiceRecorderDemo",
    "sha256": "c59889b796de7456da03eba645845d51f92835728142514ab3d0cc79cbe8a2c2",
    "helperImports": [],
    "directComponentImports": [
      "voice-recorder"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/voice-recorder",
    "registryUrl": "https://tidalui.com/r/pro/voice-recorder.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/voice-recorder",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/voice-recorder",
      "registryUrl": "https://tidalui.com/r/pro/voice-recorder.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/voice-recorder.tsx",
    "exports": [
      "TidalVoiceClip",
      "TidalVoiceRecorder",
      "TidalVoiceRecorderPermission",
      "TidalVoiceRecorderStatus"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/voice-recorder.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/tidal-button.json"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "tidal-button",
      "voice-recorder"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/voice-recorder.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/voice-recorder.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useEffect, useMemo, useRef, useState } from \"react\";\n\nimport { TidalVoiceRecorder, type TidalVoiceClip, type TidalVoiceRecorderPermission, type TidalVoiceRecorderStatus } from \"./components/ui/voice-recorder\";\n\nimport \"./components/ui/voice-recorder.css\";\n\n\n\nconst syntheticClip = \"/voice-recorder-sample.wav\";\n\nexport function VoiceRecorderDemo() {\n  const [status, setStatus] = useState<TidalVoiceRecorderStatus>(\"idle\");\n  const [permission, setPermission] =\n    useState<TidalVoiceRecorderPermission>(\"prompt\");\n  const [durationMs, setDurationMs] = useState(0);\n  const [level, setLevel] = useState<number | null>(null);\n  const [clip, setClip] = useState<TidalVoiceClip | null>(null);\n  const objectUrl = useRef<string | null>(null);\n\n  const releaseObjectUrl = () => {\n    if (!objectUrl.current) return;\n    URL.revokeObjectURL(objectUrl.current);\n    objectUrl.current = null;\n  };\n\n  useEffect(() => releaseObjectUrl, []);\n\n  const adapter = useMemo(\n    () => ({\n      start: () => {\n        releaseObjectUrl();\n        setClip(null);\n        setPermission(\"granted\");\n        setDurationMs(250);\n        setLevel(0.62);\n        setStatus(\"recording\" as const);\n      },\n      pause: () => {\n        setDurationMs(500);\n        setLevel(0);\n        setStatus(\"paused\" as const);\n      },\n      resume: () => {\n        setDurationMs(750);\n        setLevel(0.48);\n        setStatus(\"recording\" as const);\n      },\n      stop: () => {\n        setDurationMs(1_000);\n        setLevel(0);\n        setClip({\n          src: syntheticClip,\n          label: \"Synthetic one-second tone sample\",\n        });\n        setStatus(\"ready\" as const);\n      },\n      discard: () => {\n        releaseObjectUrl();\n        setClip(null);\n        setDurationMs(0);\n        setLevel(null);\n        setStatus(\"idle\" as const);\n      },\n      attach: (file: File) => {\n        releaseObjectUrl();\n        const nextUrl = URL.createObjectURL(file);\n        objectUrl.current = nextUrl;\n        setPermission(\"granted\");\n        setDurationMs(0);\n        setLevel(null);\n        setClip({ src: nextUrl, label: file.name });\n        setStatus(\"ready\" as const);\n      },\n    }),\n    [],\n  );\n\n  return (\n    <TidalVoiceRecorder\n      title=\"Voice note\"\n      description=\"Review a short audio prompt before handing it to your own workflow.\"\n      consentNotice=\"Choose Start recording to run a synthetic local state sequence. This preview never captures audio or requests microphone access.\"\n      status={status}\n      permission={permission}\n      durationMs={durationMs}\n      level={level}\n      clip={clip}\n      adapter={adapter}\n      footer=\"Local sample only. Nothing is uploaded, transcribed, stored or sent.\"\n    />\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <VoiceRecorderDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/voice-recorder.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "status",
      "type": "inferred-from-existing-demo",
      "initial": "\"idle\"",
      "setter": "setStatus",
      "proposalCanBeRejected": false
    },
    {
      "prop": "permission",
      "type": "inferred-from-existing-demo",
      "initial": "\"prompt\"",
      "setter": "setPermission",
      "proposalCanBeRejected": false
    },
    {
      "prop": "durationMs",
      "type": "inferred-from-existing-demo",
      "initial": "0",
      "setter": "setDurationMs",
      "proposalCanBeRejected": false
    },
    {
      "prop": "level",
      "type": "inferred-from-existing-demo",
      "initial": "null",
      "setter": "setLevel",
      "proposalCanBeRejected": false
    },
    {
      "prop": "clip",
      "type": "inferred-from-existing-demo",
      "initial": "null",
      "setter": "setClip",
      "proposalCanBeRejected": false
    }
  ],
  "events": [],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Consumer-provided label remains required where the component API requires one.",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
