{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "transcript-svelte",
  "title": "Transcript (Svelte)",
  "description": "Speaker-labelled, timed segments with search, marking the segment and word playing and seeking on a press.",
  "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/transcript/Transcript.svelte",
      "content": "<!--\n  Speaker-labelled, timed segments with a search, marking the segment and word playing at `currentTime`. Any\n  `children` replace the default parts.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TranscriptList from \"./TranscriptList.svelte\";\n  import TranscriptSearch from \"./TranscriptSearch.svelte\";\n\n  let { children, query = $bindable(), ...props }: ComponentProps<typeof parts.Root> = $props();\n</script>\n\n{#snippet fallback()}<TranscriptSearch /><parts.Viewport><TranscriptList /></parts.Viewport>{/snippet}\n\n<parts.Root {...props} bind:query children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/Transcript.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptCount.svelte",
      "content": "<!-- \"3 matches\" while there's a search, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Count> = $props();\n</script>\n\n{#snippet fallback({ text }: { text: string })}{text}{/snippet}\n\n<parts.Count {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptCount.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptList.svelte",
      "content": "<!-- A `TranscriptSegment` for each segment in view, keyed by its id, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TranscriptSegment from \"./TranscriptSegment.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.List> = $props();\n</script>\n\n<!-- Each segment takes only its id, so a segment that stays in view keeps its props as the rows around it change. -->\n{#snippet fallback({ rows }: { rows: readonly { key: string | number }[] })}\n  {#each rows.map((row) => String(row.key)) as value (value)}<TranscriptSegment {value} />{/each}\n{/snippet}\n\n<parts.List {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptList.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptSearch.svelte",
      "content": "<!-- A search field with the match count and a clear button, unless you pass children. Pass the state to UI SDK Input. -->\n<script lang=\"ts\">\n  import type { TranscriptSearchState } from \"@kind-ui/agent-ui/core\";\n  import { Input, InputClear, InputGroup } from \"@ui-sdk/svelte/input\";\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TranscriptCount from \"./TranscriptCount.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Search> = $props();\n</script>\n\n{#snippet fallback({ controller, defaultValue, label }: TranscriptSearchState)}\n  <InputGroup\n    ><Input\n      type=\"search\"\n      {controller}\n      {defaultValue}\n      aria-label={label}\n      placeholder=\"Search\"\n      data-agent-hidden=\"\"\n    /><TranscriptCount /><InputClear aria-label=\"Clear search\" data-agent-hidden=\"\" /></InputGroup\n  >\n{/snippet}\n\n<parts.Search {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptSearch.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptSegment.svelte",
      "content": "<!-- The segment whose id is `value`: its speaker, its time, and its text, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TranscriptSpeaker from \"./TranscriptSpeaker.svelte\";\n  import TranscriptText from \"./TranscriptText.svelte\";\n  import TranscriptTime from \"./TranscriptTime.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Segment> = $props();\n</script>\n\n{#snippet fallback({ canSeek }: { canSeek: boolean })}<div data-transcript-header=\"\"\n    ><TranscriptSpeaker />{#if canSeek}<parts.Seek><TranscriptTime /></parts.Seek>{:else}<TranscriptTime\n      />{/if}</div\n  ><TranscriptText />{/snippet}\n\n<parts.Segment {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptSegment.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptSpeaker.svelte",
      "content": "<!-- The speaker, with what the search matched marked, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Speaker> = $props();\n</script>\n\n{#snippet fallback({ speaker }: { speaker: readonly { text: string; match: boolean }[] })}{#each speaker as piece}{#if piece.match}<mark>{piece.text}</mark>{:else}{piece.text}{/if}{/each}{/snippet}\n\n<parts.Speaker {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptSpeaker.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptText.svelte",
      "content": "<!-- A `TranscriptWord` for each of the segment's words, a space apart, or its whole text, unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n  import TranscriptWord from \"./TranscriptWord.svelte\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Text> = $props();\n</script>\n\n{#snippet fallback({ words }: { words: readonly string[] })}\n  {#each words as value, index (value)}{#if index > 0}{\" \"}{/if}<TranscriptWord {value} />{/each}\n{/snippet}\n\n<parts.Text {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptText.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptTime.svelte",
      "content": "<!-- When the segment starts, like \"1:05\", unless you pass children. -->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Time> = $props();\n</script>\n\n{#snippet fallback({ time }: { time: string })}{time}{/snippet}\n\n<parts.Time {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptTime.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/TranscriptWord.svelte",
      "content": "<!--\n  The word whose `value` is `\"<segment id>/<index>\"`, or a segment's whole text without words, with what the search\n  matched marked, unless you pass children.\n-->\n<script lang=\"ts\">\n  import type { ComponentProps } from \"svelte\";\n  import { parts } from \"./parts\";\n\n  let { children, ...props }: ComponentProps<typeof parts.Word> = $props();\n</script>\n\n{#snippet fallback({ text }: { text: readonly { text: string; match: boolean }[] })}{#each text as piece}{#if piece.match}<mark>{piece.text}</mark>{:else}{piece.text}{/if}{/each}{/snippet}\n\n<parts.Word {...props} children={children ?? fallback} />\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/TranscriptWord.svelte"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/index.ts",
      "content": "import type { ComponentProps } from \"svelte\";\nimport { parts } from \"./parts\";\nimport Transcript from \"./Transcript.svelte\";\nimport TranscriptCount from \"./TranscriptCount.svelte\";\nimport TranscriptList from \"./TranscriptList.svelte\";\nimport TranscriptSearch from \"./TranscriptSearch.svelte\";\nimport TranscriptSegment from \"./TranscriptSegment.svelte\";\nimport TranscriptSpeaker from \"./TranscriptSpeaker.svelte\";\nimport TranscriptText from \"./TranscriptText.svelte\";\nimport TranscriptTime from \"./TranscriptTime.svelte\";\nimport TranscriptWord from \"./TranscriptWord.svelte\";\n\n/** A time as a button that seeks to its segment, rendered only while `onSeek` is set. Holds a `TranscriptTime`. */\nexport const TranscriptSeek = parts.Seek;\n/** Scrolls the segments. Holds a `TranscriptList`. */\nexport const TranscriptViewport = parts.Viewport;\n\nexport {\n  Transcript,\n  TranscriptCount,\n  TranscriptList,\n  TranscriptSearch,\n  TranscriptSegment,\n  TranscriptSpeaker,\n  TranscriptText,\n  TranscriptTime,\n  TranscriptWord,\n};\nexport type TranscriptProps = ComponentProps<typeof Transcript>;\nexport type TranscriptSearchProps = ComponentProps<typeof TranscriptSearch>;\nexport type TranscriptCountProps = ComponentProps<typeof TranscriptCount>;\nexport type TranscriptListProps = ComponentProps<typeof TranscriptList>;\nexport type TranscriptSegmentProps = ComponentProps<typeof TranscriptSegment>;\nexport type TranscriptSpeakerProps = ComponentProps<typeof TranscriptSpeaker>;\nexport type TranscriptTimeProps = ComponentProps<typeof TranscriptTime>;\nexport type TranscriptTextProps = ComponentProps<typeof TranscriptText>;\nexport type TranscriptWordProps = ComponentProps<typeof TranscriptWord>;\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/index.ts"
    },
    {
      "path": "packages/agent-ui/src/svelte/transcript/parts.ts",
      "content": "import { transcriptPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/svelte/primitive\";\n\nexport const parts = createParts(transcriptPrimitive, {\n  root: \"div\",\n  search: \"div\",\n  count: \"span\",\n  viewport: \"div\",\n  list: \"div\",\n  segment: \"div\",\n  speaker: \"span\",\n  seek: \"button\",\n  time: \"span\",\n  text: \"p\",\n  word: \"span\",\n});\n",
      "type": "registry:ui",
      "target": "@ui/svelte/transcript/parts.ts"
    }
  ],
  "meta": {
    "layer": "svelte"
  },
  "type": "registry:ui"
}
