{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dictation",
  "title": "Dictation",
  "description": "A mic button that turns speech into text through a source the host chooses, with a live waveform.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/dictation.tsx",
      "content": "\"use client\";\n\nimport {\n  type DictationStatusState,\n  type DictationWaveformState,\n  dictationButtonPrimitive,\n} from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps } from \"react\";\n\nconst parts = createParts(dictationButtonPrimitive, {\n  root: \"div\",\n  start: \"button\",\n  waveform: \"span\",\n  bar: \"span\",\n  status: \"span\",\n  \"status-icon\": \"span\",\n  stop: \"button\",\n  cancel: \"button\",\n});\n\nexport type DictationProps = ComponentProps<typeof parts.Root>;\nexport type DictationWaveformProps = ComponentProps<typeof parts.Waveform>;\nexport type DictationStatusProps = ComponentProps<typeof parts.Status>;\n\n/** The mic button, shown while idle or after an error. */\nexport const DictationStart = parts.Start;\n/** Stop: ends the dictation and sends its final text. */\nexport const DictationStop = parts.Stop;\n/** Cancel: ends the dictation and sends nothing. */\nexport const DictationCancel = parts.Cancel;\n/** One bar of the waveform, whose `value` is its index. */\nexport const DictationBar = parts.Bar;\n/** The mark beside the status: running while transcribing, an error after one. */\nexport const DictationStatusIcon = parts.StatusIcon;\n\nconst BARS = ({ bars }: DictationWaveformState) =>\n  Array.from({ length: bars }, (_, i) => <DictationBar key={i} value={String(i)} />);\n\n/** The waveform, one `DictationBar` per level unless you pass children. Shown while listening. */\nexport function DictationWaveform({ children = BARS, ...props }: DictationWaveformProps) {\n  return <parts.Waveform {...props}>{children}</parts.Waveform>;\n}\n\nconst STATUS = ({ text }: DictationStatusState) => (\n  <>\n    <DictationStatusIcon />\n    <span data-dictation-text=\"\">{text}</span>\n  </>\n);\n\n/** \"Listening\" or the words heard so far, \"Transcribing\", or the error, with its mark unless you pass children. */\nexport function DictationStatus({ children = STATUS, ...props }: DictationStatusProps) {\n  return <parts.Status {...props}>{children}</parts.Status>;\n}\n\n/**\n * A mic button that turns speech into text through a host's `source`. While listening it shows a waveform, the words\n * heard so far, Cancel and Stop, in the same box. Any `children` replace those parts.\n */\nexport function Dictation({ children, ...props }: DictationProps) {\n  return (\n    <parts.Root {...props}>\n      {children !== undefined ? (\n        children\n      ) : (\n        <>\n          <DictationWaveform />\n          <DictationStatus />\n          <DictationStart />\n          <DictationCancel />\n          <DictationStop />\n        </>\n      )}\n    </parts.Root>\n  );\n}\n",
      "type": "registry:ui",
      "target": "@ui/dictation.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
