import { defineWebComponent } from './define'; import { ThinkingBar } from '../components/thinking-bar'; interface Props extends Record { /** The shimmering label, e.g. "Thinking…". */ text?: string; /** When true, show a "stop" affordance that fires a `stop` event. */ stoppable?: boolean; /** Label for the stop affordance. */ stopLabel?: string; } /** Events fired by ``. */ interface Events { /** The "stop / answer now" affordance was clicked. */ 'kc-stop': void; } /** * `` — a pure leaf element: an animated "thinking" indicator * (one of the primitives the batteries-included `` does NOT surface). * Config via attributes, the only interaction (`stop`) comes back as an event. */ defineWebComponent('kc-thinking-bar', { text: 'Thinking', stoppable: false, stopLabel: 'Answer now', }, (props, { dispatch, flag }) => ( dispatch('kc-stop') : undefined} /> ));