import type{LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';import'../../media/file-icon/file-icon.class.js';import'../../forms/input/input.class.js';import'../../forms/checkbox/checkbox.class.js';import'../../overlays/empty/empty.class.js';import{type LyraSize}from'../../../internal/variants.js';export interface LyraSourceEntry{id:string;label:string; /** Drives the `lr-file-icon` badge. */ mimeType?:string; /** Filename fallback for icon detection. */ name?:string; /** Presence makes this a group/folder row. */ children?:readonly LyraSourceEntry[];}export interface LyraSourcePickerEventMap{'lr-sources-change':CustomEvent>;} /** * `` — a checkbox tree/list scoping which sources ground the next answer: * tri-state folders, select-all, type icons, search. **Not `FormAssociated`, deliberately**: this * is a scoping panel, not a form control — the selection is immediate app state consumed by the * next retrieval call, exactly the stance `lr-tool-select-dialog` already takes. * * Public collection properties take bounded, clone-owned readonly snapshots. Create a new * collection and reassign it after changes; mutating the assigned array does not update the view. * * @customElement lr-source-picker * @event lr-sources-change - `detail: { selectedSourceIds }` — the complete updated leaf-id array, * fired after every toggle including select-all. * @csspart base - The root wrapper. * @csspart search - The built-in filter `lr-input`, only rendered when `searchable`. * @csspart select-all - The header select-all row, only rendered when `showSelectAll`. * @csspart select-all-control - The shared `lr-checkbox` that owns select-all semantics. * @csspart summary - The "{selected} of {total} selected" text. * @csspart tree - The `role="tree"` container. * @csspart item - One `role="treeitem"` row. Its selection state is exposed only through * tri-state `aria-checked`; `aria-selected` is intentionally absent because it would duplicate * that same state. * @csspart disclosure - A folder row's pointer-only expand/collapse indicator. Keyboard * expansion remains owned by the surrounding treeitem. * @csspart checkbox - The tri-state checkbox glyph. * @csspart icon - The `lr-file-icon` type badge. * @csspart label - The entry's label text. * @csspart empty - The empty state (`noData` when `sources` is empty, `noMatches` when a filter * empties the tree). * @csspart error - A localized error shown when a nonempty source payload contains no valid rows. * @csspart limit - Localized fail-closed status when a cyclic, duplicate, over-depth or * over-budget input was truncated by the bounded source-tree normalizer. * @cssprop [--lr-source-picker-checked-bg] - Background of a fully-checked selection control: * the `select-all` pill (defaults to `var(--lr-color-brand-quiet)`) and a fully-selected entry's * `[part="checkbox"]` (defaults to `var(--lr-color-brand)`). The two keep their distinct resting * defaults; setting this prop unifies both. * @cssprop [--lr-source-picker-checked-border=var(--lr-color-brand)] - Border color of every * checked or mixed selection control. * @cssprop [--lr-source-picker-mixed-bg=color-mix(in srgb, var(--lr-color-brand) 50%, var(--lr-color-surface))] - * Background of a partially-selected entry's `[part="checkbox"]`. * @cssprop [--lr-source-picker-indent-size=var(--lr-size-1-25rem)] - Indent step added to * `[part="item"]`'s `padding-inline-start` per nesting level. The total indent is capped at * `--lr-size-8rem` so a deeply nested tree cannot push its labels out of view. * @cssprop [--lr-source-picker-depth=0] - Internal indent plumbing, not a retheming knob: the row's * own nesting depth, written inline onto `[part="item"]` as a plain number and multiplied by * `--lr-source-picker-indent-size` to produce the indent. * @status stable * @since 4.0.0 */ export declare class LyraSourcePicker extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[];static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[]; /** Flat (no `children`) or a tree. */ sources:readonly LyraSourceEntry[]; /** Leaf ids only. Duplicates and ids absent from `sources` are discarded. The picker updates * its own copy on toggle *then* emits; reassign to control. */ selectedSourceIds:readonly string[]; /** Whether the header exposes one control for selecting or clearing every visible leaf source. */ showSelectAll:boolean; /** Whether the built-in source filter is rendered. Toggling retains the query and selection, * while keeping a visible tree entry available whenever rows remain. */ searchable:boolean;private _size?; /** Density tier for the built-in filter field, on the library's one size ladder, in either * spelling -- `2xs`/`xs`/`s`/`m`/`l`/`xl`, or Web Awesome's and Shoelace's * `small`/`medium`/`large`. Forwarded to the composed ``, which is the only way to * reach it: that control resolves its tier inside its own shadow root, so no custom property * this component could publish would get there. Forwarded as a property rather than an * attribute, because removing an already-written `size` attribute again would leave the child's * own `size` at `null` instead of back at its own default. Opt-in: with no size the field keeps * its own `m` default, exactly what it rendered before. Unsupported values normalize to the * omitted state and remove the attribute. */ get size():LyraSize|undefined;set size(next:LyraSize|undefined); /** Visible/fallback accessible label for the source tree. Omitting it falls back to a * localized default; an explicit empty string clears it. */ label?:string; /** JS-only accessible-name override for the tree. A markup `aria-label` names the component * as a whole, so it is not cloned onto the inner tree. */ accessibleLabel:string|null;private expandedIds;private query;private activeId;private pendingFocusIndex;private keyboardFocusGeneration;private normalizedInput?;private normalizedModel?;private announcementSink?;private isMounting;private lastFilterAnnouncement;private get sourceEntries();private get selectedIds();connectedCallback():void;disconnectedCallback():void; /** Builds a bounded, acyclic, nonblank first-id-wins tree once per `sources` identity. */ private get sourceModel();private allLeafIds;private descendantLeafIds;private normalizedSelectedSourceIds;private checkedState;private matchesQuery;private isFiltering;private visibleRows;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private commitSelection;private toggleEntry;private toggleSelectAll;private focusRowByIndex;private onTreeKeyDown;private renderRow;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-source-picker':LyraSourcePicker;}}