{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dictation-svelte",
  "title": "Dictation (Svelte)",
  "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/svelte@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/svelte/dictation/Dictation.svelte",
      "content": "<!--\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-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import DictationStatus from \"./DictationStatus.svelte\";\n  import DictationWaveform from \"./DictationWaveform.svelte\";\n  import { parts } from \"./parts\";\n\n  type Props = ComponentProps<typeof parts.Root>;\n\n  let { children: content, ...props }: Props = $props();\n</script>\n\n<parts.Root {...props}>\n  {#snippet children(state: Parameters<NonNullable<Props[\"children\"]>>[0])}\n    {#if content}{@render content(state)}{:else}\n      <DictationWaveform\n      /><DictationStatus\n      /><parts.Start\n      /><parts.Cancel\n      /><parts.Stop />\n    {/if}\n  {/snippet}\n</parts.Root>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/dictation/Dictation.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/dictation/DictationStatus.svelte",
      "content": "<!-- \"Listening\" or the words heard so far, \"Transcribing\", or the error, with its mark unless you pass children. -->\n<script lang=\"ts\">\n  import type { DictationStatusState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps, Snippet } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  type Props = ComponentProps<typeof parts.Status> & { children?: Snippet<[DictationStatusState]> };\n\n  let { children: content, ...props }: Props = $props();\n</script>\n\n<parts.Status {...props}>\n  {#snippet children(state: DictationStatusState)}\n    {#if content}{@render content(state)}{:else}<parts.StatusIcon /><span data-dictation-text=\"\">{state.text}</span>{/if}\n  {/snippet}\n</parts.Status>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/dictation/DictationStatus.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/dictation/DictationWaveform.svelte",
      "content": "<!-- The waveform, one `DictationBar` per level unless you pass children. Shown while listening. -->\n<script lang=\"ts\">\n  import type { DictationWaveformState } from \"@kind-ui/agent-ui/core\";\n  import type { ComponentProps, Snippet } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  type Props = ComponentProps<typeof parts.Waveform> & { children?: Snippet<[DictationWaveformState]> };\n\n  let { children: content, ...props }: Props = $props();\n</script>\n\n<parts.Waveform {...props}>\n  {#snippet children(state: DictationWaveformState)}\n    {#if content}{@render content(state)}{:else}\n      {#each { length: state.bars }, i (i)}<parts.Bar value={String(i)} />{/each}\n    {/if}\n  {/snippet}\n</parts.Waveform>\n",
      "type": "registry:ui",
      "target": "@ui/svelte/dictation/DictationWaveform.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/dictation/index.ts",
      "content": "import { parts } from \"./parts\";\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\nexport { default as Dictation } from \"./Dictation.svelte\";\nexport { default as DictationStatus } from \"./DictationStatus.svelte\";\nexport { default as DictationWaveform } from \"./DictationWaveform.svelte\";\n",
      "type": "registry:ui",
      "target": "@ui/svelte/dictation/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/dictation/parts.ts",
      "content": "import { dictationButtonPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const 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",
      "type": "registry:ui",
      "target": "@ui/svelte/dictation/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
