{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dictation-vue",
  "title": "Dictation (Vue)",
  "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/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/dictation.ts",
      "content": "import {\n  type DictationStatusState,\n  type DictationWaveformState,\n  dictationButtonPrimitive,\n} from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { defineComponent, h } from \"vue\";\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\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 = ({ state }: { state: DictationWaveformState }) =>\n  Array.from({ length: state.bars }, (_, i) => h(DictationBar, { key: i, value: String(i) }));\n\n/** The waveform, one `DictationBar` per level unless you pass children. Shown while listening. */\nexport const DictationWaveform = defineComponent({\n  name: \"DictationWaveform\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => h(parts.Waveform, attrs, { ...slots, default: slots.default ?? bars });\n  },\n}) as unknown as typeof parts.Waveform;\n\nconst status = ({ state }: { state: DictationStatusState }) => [\n  h(DictationStatusIcon),\n  h(\"span\", { \"data-dictation-text\": \"\" }, state.text),\n];\n\n/** \"Listening\" or the words heard so far, \"Transcribing\", or the error, with its mark unless you pass children. */\nexport const DictationStatus = defineComponent({\n  name: \"DictationStatus\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => h(parts.Status, attrs, { ...slots, default: slots.default ?? status });\n  },\n}) as unknown as typeof parts.Status;\n\nconst defaultParts = () => [\n  h(DictationWaveform),\n  h(DictationStatus),\n  h(DictationStart),\n  h(DictationCancel),\n  h(DictationStop),\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. A default slot replaces those parts.\n */\nexport const Dictation = defineComponent({\n  name: \"Dictation\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => h(parts.Root, attrs, { ...slots, default: slots.default ?? defaultParts });\n  },\n}) as unknown as typeof parts.Root;\n",
      "type": "registry:ui",
      "target": "@ui/vue/dictation.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
