{"version":3,"file":"typing-indicator.cjs","names":[],"sources":["../src/feedback/typing-indicator/typing-indicator.ts"],"sourcesContent":["import { define, html, prop } from '@vielzeug/ore';\nimport { watch } from '@vielzeug/ripple';\nimport { announce } from '../../core';\nimport { sizableBundle, themableBundle } from '../../shared';\nimport { colorThemeMixin, reducedMotionMixin, sizeVariantMixin } from '../../styles';\nimport type { ComponentSize, ThemeColor } from '../../types';\nimport componentStyles from './typing-indicator.css?inline';\n\n/** Typing indicator component properties */\nexport type OreTypingIndicatorProps = {\n  /** Theme color for the dots */\n  color?: ThemeColor;\n  /** Accessible label announced once via a polite live region (default: `\"Typing…\"`) */\n  label?: string;\n  /** Dot size preset */\n  size?: ComponentSize;\n};\n\n/**\n * Three bouncing dots signaling that the other side of a conversation is composing a reply —\n * the moment before any content exists. For a message whose content is already streaming in,\n * use `ore-chat-message`'s `streaming` attribute (a blinking cursor) instead.\n *\n * The dots are decorative (`aria-hidden`) — `label` is the entire accessibility contract,\n * announced through the shared singleton live region (`core/announcer.ts`) rather than a\n * static `aria-live` element in the template. A live region populated in the same paint as\n * its own insertion is unreliable across browsers/screen readers; routing through the shared\n * announcer (pre-existing region, clear-then-set) is the same pattern already used for other\n * transient status messages across this package.\n *\n * @element ore-typing-indicator\n *\n * @attr {string} label - Accessible label announced once via a polite live region (default: \"Typing…\")\n * @attr {string} color - Theme color: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'error'\n * @attr {string} size - 'sm' | 'md' | 'lg'\n *\n * @cssprop --typing-indicator-color - Dot color\n * @cssprop --typing-indicator-size - Dot diameter\n * @cssprop --typing-indicator-gap - Gap between dots\n *\n * @part dots - Dots container.\n * @part dot - Individual dot element.\n * @example\n * ```html\n * <ore-typing-indicator></ore-typing-indicator>\n * <ore-typing-indicator label=\"Assistant is typing…\" color=\"primary\"></ore-typing-indicator>\n * ```\n */\nexport const TYPING_INDICATOR_TAG = 'ore-typing-indicator' as const;\ndefine<OreTypingIndicatorProps>(TYPING_INDICATOR_TAG, {\n  props: {\n    ...themableBundle,\n    ...sizableBundle,\n    label: prop.string('Typing…'),\n  },\n  setup(props) {\n    watch(\n      () => props.label.value,\n      (label) => announce(label ?? ''),\n      { immediate: true },\n    );\n\n    return html`\n      <span class=\"dots\" part=\"dots\" aria-hidden=\"true\">\n        <span class=\"dot\" part=\"dot\"></span>\n        <span class=\"dot\" part=\"dot\"></span>\n        <span class=\"dot\" part=\"dot\"></span>\n      </span>\n    `;\n  },\n  styles: [\n    colorThemeMixin,\n    reducedMotionMixin,\n    sizeVariantMixin({\n      lg: {\n        gap: 'var(--typing-indicator-gap, var(--size-1-5))',\n        size: 'var(--typing-indicator-size, var(--size-2-5))',\n      },\n      md: { gap: 'var(--typing-indicator-gap, var(--size-1))', size: 'var(--typing-indicator-size, var(--size-2))' },\n      sm: {\n        gap: 'var(--typing-indicator-gap, var(--size-1))',\n        size: 'var(--typing-indicator-size, var(--size-1-5))',\n      },\n    }),\n    componentStyles,\n  ],\n});\n"],"mappings":"0ZAgDA,IAAa,EAAuB,wBACpC,EAAA,EAAA,OAAA,CAAgC,EAAsB,CACpD,MAAO,CACL,GAAG,EAAA,eACH,GAAG,EAAA,cACH,MAAO,EAAA,KAAK,OAAO,SAAS,CAC9B,EACA,MAAM,EAAO,CAOX,OANA,EAAA,EAAA,MAAA,KACQ,EAAM,MAAM,MACjB,GAAU,EAAA,SAAS,GAAS,EAAE,EAC/B,CAAE,UAAW,EAAK,CACpB,EAEO,EAAA,IAAI;;;;;;KAOb,EACA,OAAQ,CACN,EAAA,gBACA,EAAA,mBACA,EAAA,iBAAiB,CACf,GAAI,CACF,IAAK,+CACL,KAAM,+CACR,EACA,GAAI,CAAE,IAAK,6CAA8C,KAAM,6CAA8C,EAC7G,GAAI,CACF,IAAK,6CACL,KAAM,+CACR,CACF,CAAC,EACD,EAAA,OACF,CACF,CAAC"}