import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface LyraCommand{ /** Stable business identity. Must be nonempty and unique within `commands`; the first command * wins when an untyped caller supplies duplicates. */ commandId:string; /** Nonblank text used as the command row's visible and accessible name. */ label:string;description?:string;group?:string;shortcut?:string; /** Additional search terms. Runtime non-array values and non-string entries are ignored. */ keywords?:readonly string[];disabled?:boolean; /** Optional leading TemplateResult glyph, rendered before `label` (`LyraPaletteItem.icon`/ * `LyraSegmentedItem.icon` precedent -- not restricted to a square icon-only shape). */ icon?:unknown;onSelect?:()=>void;}export interface LyraCommandPaletteEventMap{'lr-select':CustomEvent>;'lr-open':CustomEvent;'lr-close':CustomEvent;focus:CustomEvent;blur:CustomEvent;} /** `` — searchable application command menu with keyboard navigation. * Shared overlay infrastructure (the same one `` uses) coordinates focus-trapping * Tab, Escape dismissal, and document scroll-locking for as long as the palette is open. * The public command sequence is copied, bounded, and frozen while each command object's identity * is retained for its imperative `onSelect` contract. Create and reassign a new command array after * sequence or row changes; mutating the assigned array does not update the view. * * @customElement lr-command-palette * @event lr-select - A command was chosen; detail is `{ command }`. * @event lr-open - Emitted before the palette opens. Cancelable: `preventDefault()` keeps it * closed. * @event lr-close - Emitted before the palette closes. Cancelable: `preventDefault()` keeps it * open. * @event focus - Re-dispatched when the search input receives focus. Native `focus` neither * bubbles nor crosses the shadow boundary, so a host listener on `` itself * never sees it otherwise. * @event blur - Re-dispatched when the search input loses focus. * @csspart backdrop - Modal backdrop. * @csspart dialog - Palette dialog. * @csspart search - The search row wrapping the leading icon and the `input`. * @csspart input - Search input. * @csspart clear-button - The button that clears the search field, replacing the native * search-cancel glyph suppressed by this field's own reset; rendered only while it has a value. * @csspart list - Command list. * @csspart list-spacer - Virtual result extent inside the scrolling list. * @csspart command-group - A labeled ARIA group containing visible command options. * @csspart group - A group heading, rendered before the first command of each `group`. * @csspart command - A command button. * @csspart icon - A command's leading icon glyph. Only rendered when the command has an `icon`. * @csspart label - A command's visible label. * @csspart description - A command's secondary description text. Rendered for every command; empty * when the command has no `description`. * @csspart shortcut - A command's trailing shortcut hint. Only rendered when the command has a * `shortcut`. * @csspart empty - The "no results" message. Only rendered when the filter matches no command. * @cssprop [--lr-command-palette-z-index=var(--lr-overlay-stack-index, var(--lr-layer-modal))] - Stacking index of the backdrop. * @cssprop [--lr-command-palette-max-inline-size=var(--lr-size-48rem)] - Maximum dialog width. * @cssprop [--lr-command-palette-max-block-size=70vh] - Maximum dialog height. * @cssprop [--lr-command-palette-list-max-block-size=50vh] - Maximum height of the scrolling command list. * @cssprop [--lr-command-palette-offset-block-start=12vh] - Gap between the viewport top and the dialog. * @cssprop [--lr-command-palette-row-height=var(--lr-size-3rem)] - Virtual command-row height; * live changes rebuild row transforms, scrolling coordinates, and the result extent. * @cssprop [--lr-command-palette-group-height=var(--lr-size-2rem)] - Virtual group-heading height; * live changes rebuild heading/row transforms and the result extent. * @cssprop [--lr-command-palette-search-padding=var(--lr-space-m)] - Gutter around the query row. * @cssprop [--lr-command-palette-search-gap=var(--lr-space-s)] - Gap between the leading glyph and * the query field. * @cssprop [--lr-command-palette-search-min-height=auto] - Minimum row height of the query field, * for matching it to a themed search field of a chosen density tier. Point it at * `--lr-form-control-height-s` (or any tier of that ladder) to line the palette's own field up * with the rest of an application's controls. * @cssprop [--lr-command-palette-search-font-size=inherit] - Text size of the query field. * @cssprop [--lr-command-palette-active-bg=var(--lr-color-brand-quiet)] - Background of the active * (keyboard-highlighted, `data-active="true"`) command row. Declared as an inline `var()` fallback * (never on `:host`), so setting it on the element or an ancestor recolors only the active row * without hijacking the library-wide `--lr-color-brand-quiet` token. * @status stable * @since 4.0.0 */ export declare class LyraCommandPalette extends LyraElement{protected static readonly ownedCollectionProperties:readonly string[]; /** Command objects are returned to `onSelect`; their identity is an explicit API contract. */ protected static readonly identityCollectionProperties:readonly string[];protected static readonly identityEventDetailProperties:Readonly<{'lr-select':readonly string[];}>;static styles:import("lit").CSSResultGroup[];protected static readonly immutableEventDetails:readonly string[];private _open; /** Whether the palette is open. Post-mount IDL and attribute writes use the same synchronous, * cancelable lifecycle as `openPalette()` and `close()`; initial markup stays silent. */ get open():boolean;set open(next:boolean); /** Commands to search and activate. The sequence is copied, bounded, and frozen while command * identity is retained. `commandId` must be unique and nonempty; malformed rows and later * duplicates from untyped boundaries are omitted deterministically. */ commands:readonly LyraCommand[]; /** Exact global activation chord. `mod` resolves to Command on macOS and Control elsewhere, * using Client Hints with legacy platform and reduced user-agent fallbacks. */ hotkey:string; /** Accessible name for the dialog. Omitted falls back to the localized `commandPaletteLabel` * default. An explicitly empty `aria-label` is used as-is. */ accessibleLabel?:string;private queryText;private activeIndex;private listScrollTop;private listViewportHeight;private rowPitch;private groupPitch;private listId;private overlay?;private activeCommandId?;private listResizeObserver?;private observedList?;private observedRow?;private observedGroup?;private rowPitchFrame?;private listScrollFrame?; /** Window that owns listeners, observers, and animation frames for the current connection. */ private runtimeWindow?; /** The canonical command view `haystacks` was built from -- reference-keyed memo, since `commands` * only ever changes by reassignment (it's `attribute: false`; in-place mutation wouldn't * trigger a re-render either). */ private haystacksFor?;private haystacksLocale;private haystacks;private filteredForCommands?;private filteredForQuery;private filteredForLocale;private filteredRows;private normalizedForCommands?;private normalizedRows;private resultModelFor?;private resultModelRowPitch?;private resultModelGroupPitch?;private resultModelCache?;private openRequestTarget?; /** Canonical command collection consumed by search, focus, rendering, and activation. Keeping * the first valid occurrence makes duplicate handling deterministic while retaining caller * object identity in `lr-select` and `onSelect`. */ private get effectiveCommands(); /** One lowercased searchable string per command, index-aligned with `commands`. `filtered` * runs on every keystroke (and every ArrowUp/ArrowDown/Enter), so re-joining and lowercasing * every row per call would scale with palette size for a result that only changes when the * command list itself does. */ private get searchHaystacks();protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;private observeList;private observePitchSentinels;private clearPitchSentinels; /** Resolves the two row pitches from their custom properties so the absolutely-positioned rows * stay aligned with their painted heights. Hardcoding 48/32 matched only at a 16px root font; * at a browser "large text" setting the rows grew but the pitch did not, overlapping every row * and putting keyboard scrolling in the wrong coordinate space. */ private measureRowPitch;private scheduleRowPitchMeasurement;connectedCallback():void;disconnectedCallback():void;private activateOverlay;openPalette():void;close():void;private requestOpen;private resetOpeningState;private commitOpen;registerCommand(command:LyraCommand):()=>void;private matchesShortcut;private onGlobalKeyDown;private get filtered();private select; /** First enabled index at or past `from`, walking in `step` direction; -1 when every row that * way is disabled (callers then keep the current index, preserving clamp-at-the-ends arrow * behavior). Keeps the active option off disabled rows so Enter always has a live target. */ private seekEnabled;private setActiveIndex;private onKeyDown;private onInput;private onClearSearch;private onSearchFocus;private onSearchBlur;private get resultModel();private visibleGroups;private optionId;private scrollActiveIntoView;private onListScroll;private renderCommand;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-command-palette':LyraCommandPalette;}}