import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface SourceListToggleDetail{expanded:boolean;}export interface LyraSourceListEventMap{'lr-toggle':CustomEvent;} /** * `` — a collapsible "Sources" panel for one chat message, * grouping a set of `` children (its default-slot light-DOM * children, plain composition — no `.items` array prop, the same shape * ``'s panels take) behind a single clickable header. * * This library has no built-in pluralization (see ``'s plain * `description` prop for a similar stance), so anything beyond the final * fallback is entirely consumer-supplied: `label-plural` (e.g. `"3 sources"`) * wins when set, falling back to `label`, falling back to a localized * `"Sources"` (via `this.localize()`) — see each property's own doc. * `sourceCount` (a read-only, live-updated count of the currently-slotted * children) is exposed for a consumer who wants to build that string * reactively instead of hand-counting DOM children. * * The card list is removed from the accessibility tree (not just visually * hidden) while collapsed, via the native `hidden` attribute on * `[part="list"]` — a screen reader user tabbing past the header never lands * on off-screen source cards they can't currently see. * When every assigned child is a source card, a neutral `
`/`` * wrapper, or already `role="listitem"`, `[part="list"]` supplies list/listitem * semantics. Native controls and other semantic children retain their * semantics; their presence leaves the wrapper unroled rather than imposing * an invalid list context. * * @customElement lr-source-list * @slot - `` elements, neutral `
`/`` wrappers, or * author-owned list items. Other semantic children remain as authored and * disable the list semantics. * @event lr-toggle - The header was activated, expanding or collapsing the * list. `detail: { expanded }`. * @csspart base - The outer container. * @csspart header - The clickable header (`