import{type TemplateResult,type PropertyValues}from'lit';import{LyraElement}from'../../../internal/lyra-element.js';export interface LyraWidgetView{ /** Stable, unique business identity for this view. */ viewId:string; /** Visible label text. Optional so a toggle can be icon-only (`icon` set, `label` omitted) -- * set `ariaLabel` too in that case so the button keeps a real accessible name; see `ariaLabel`'s * own doc for what happens if both are left unset. */ label?:string; /** Optional decorative leading visual rendered before the label. This is intentionally general * content, not a square-icon-only field: SVG icons, flag glyphs, badges, and other * natural-aspect-ratio Lit content are supported, matching `LyraSegmentedItem`/`LyraStepItem`'s * own `icon` field. It is rendered in inert, aria-hidden chrome, so it cannot provide an * independent action or accessible name. */ icon?:unknown; /** Accessible name for the toggle button, used only when `label` is omitted -- ignored otherwise, * since the visible label text already supplies the accessible name. If both `label` and * `ariaLabel` are omitted, the button falls back to its own `viewId` as a last-resort accessible name: * not silently unlabeled, but not a good name either, so set one of the two for any icon-only view. */ ariaLabel?:string;}export interface LyraWidgetEventMap{'lr-collapse-request':CustomEvent<{collapsed:boolean;}>;'lr-collapse-change':CustomEvent<{collapsed:boolean;}>;'lr-fullscreen-request':CustomEvent<{fullscreen:boolean;}>;'lr-fullscreen-change':CustomEvent<{fullscreen:boolean;}>;'lr-view-request':CustomEvent<{viewId:string;}>;'lr-view-change':CustomEvent<{viewId:string;}>;'lr-activate':CustomEvent<{value:string;}>;} /** * `` — a titled panel shell with an optional collapse toggle and * an optional fullscreen-expand toggle. Fullscreen promotes the same host * element in place (a CSS state, not a clone/portal), so slotted content * (a chart, a running simulation, scroll position) survives the transition. * * @customElement lr-widget * @slot - The panel body. * @slot icon - Optional decorative leading icon in the title row. Its flattened subtree is inert * and hidden from assistive technology. * @slot label - Rich label content (overrides the `label` attribute). * @slot sublabel - Rich sublabel content (overrides the `sublabel` attribute). * @slot actions - Header action controls, rendered before the collapse/expand buttons. * @slot collapse-icon - Overrides the built-in chevron glyph inside the collapse/expand toggle * button entirely, via the platform's own slot-fallback-content mechanism (same convention as * ``'s `icon` slot): whatever is assigned wins, otherwise the default chevron * renders. Assigned content is decorative, inert, and aria-hidden so the outer toggle remains the * sole action. Only meaningful while `collapsible`. * @slot fullscreen-icon - Overrides the built-in expand/close glyph inside the fullscreen toggle * button entirely, using the same mechanism -- the override replaces *both* the "expand" and * "exit fullscreen" default icons, so a consumer supplying one is responsible for its own * expand/exit distinction (e.g. by reading the `fullscreen` attribute). Assigned content is * decorative, inert, and aria-hidden so the outer toggle remains the sole action. Only meaningful * while `expandable`. * @slot view-{viewId} - Content for the view whose `LyraWidgetView.viewId` matches `{viewId}`, rendered when * `views` is non-empty. * @event lr-collapse-request - A cancelable proposed `collapsed` state from the built-in collapse * toggle. Call `preventDefault()` to keep `collapsed` and persistence unchanged. Not fired when * a consumer sets `collapsed` directly. `detail: { collapsed }`. * @event lr-collapse-change - Non-cancelable post-commit notification from the built-in collapse * toggle. Not fired when a consumer sets `collapsed` directly. `detail: { collapsed }` (the new * `collapsed` state). * @event lr-fullscreen-request - A cancelable proposed `fullscreen` state from the fullscreen * toggle, Escape, or a backdrop click. Call `preventDefault()` to leave `fullscreen` unchanged. * Not fired when a consumer sets `fullscreen` directly. `detail: { fullscreen }`. * @event lr-fullscreen-change - Non-cancelable post-commit notification, fired after the * fullscreen toggle, Escape, or a backdrop click accepts the change. Not fired when a consumer * sets `fullscreen` directly. `detail: { fullscreen }` (the new `fullscreen` state). * @event lr-view-request - A cancelable proposed `activeViewId` from a header view-toggle click. * Call `preventDefault()` to leave `activeViewId` unchanged. Not fired when a consumer sets * `activeViewId` directly. `detail: { viewId }`. * @event lr-view-change - Non-cancelable post-commit notification, fired after a header * view-toggle click accepts the change. Not fired when a consumer sets `activeViewId` directly. * `detail: { viewId }`. * @event lr-activate - Fired on every accepted header view-toggle activation, whether or not * `activeViewId` actually moved. `detail: { value }` carries the activated view's `viewId`. * Bubbling and composed, so a host outside the shadow tree receives it. Not cancelable: * `lr-view-request` is this component's veto point, and a vetoed activation emits no activation * at all. Re-picking the active view is the case `lr-view-change` deliberately stays silent for * -- "rebuild that view" is a real intent -- and it is otherwise unobservable, because the * toggles live in this shadow root, so a retargeted `click` names no view. When an activation * does move the view, `lr-view-request` and `lr-view-change` are emitted first. Not fired when a * consumer sets `activeViewId` directly. * @csspart base - The panel root (dialog role + backdrop when fullscreen). * @csspart header - The header row containing the title, actions, and toggle buttons. * @csspart title - The wrapper around the label/sublabel. * @csspart icon - Wrapper around the `icon` slot. Hidden entirely when empty. * @csspart label-group - Wrapper around the label and sublabel. * @csspart label - The panel title text. * @csspart sublabel - The panel subtitle text. * @csspart actions - The wrapper around the `actions` slot. * @csspart view-toggles - The header toggle-button group, only rendered when `views` is non-empty. * @csspart view-toggle - A single view toggle button. * @csspart view-icon - Decorative icon content inside a view toggle; its subtree is inert and * hidden from assistive technology. * @csspart view-label - Visible label text inside a view toggle. * @csspart collapse-button - The collapse/expand toggle button. * @csspart fullscreen-button - The fullscreen toggle button. * @csspart body - The wrapper around the default slot (the panel body). * @csspart backdrop - The fullscreen scrim behind the panel. * @cssprop [--lr-widget-overlay-color=var(--lr-color-overlay)] - The fullscreen scrim's color, * applied to `[part="backdrop"]`. * @cssprop [--lr-widget-view-toggle-active-bg=var(--lr-color-brand-quiet)] - Background of the * pressed (`aria-pressed="true"`) view toggle. Declared as an inline `var()` fallback (never on * `:host`), so setting it on the element or an ancestor recolors only the active toggle without * hijacking the library-wide `--lr-color-brand-quiet` token. * @cssprop [--lr-widget-view-toggle-hover-bg=var(--lr-color-brand-quiet)] - Background of a hovered * `[part="view-toggle"]`. * @cssprop [--lr-widget-view-toggle-hover-color=var(--lr-color-text)] - Text color of a hovered * `[part="view-toggle"]`. * @cssprop [--lr-widget-view-toggle-active-color=var(--lr-color-brand)] - Text color of the pressed * view toggle. * @cssprop [--lr-widget-view-toggle-active-border-color=transparent] - Border color of the pressed * view toggle. Like the active background and text hooks, it is an inline inherited fallback. * @cssprop [--lr-widget-fullscreen-inset=max(var(--lr-space-l), var(--lr-safe-area-top)) max(var(--lr-space-l), var(--lr-safe-area-inline-end)) max(var(--lr-space-l), var(--lr-safe-area-bottom)) max(var(--lr-space-l), var(--lr-safe-area-inline-start))] - The `inset` applied to `[part="base"]` while `fullscreen`. Also set inline from the `fullscreen-inset` attribute. * @cssprop [--lr-widget-backdrop-inset=0] - The `inset` applied to * `[part="backdrop"]`, so the scrim can be pulled back independently of the panel. Also set * inline from the `backdrop-inset` attribute. * @cssprop [--lr-scroll-fade-size=2rem] - Width of the fade at each horizontal scroll edge of the * `actions`/`view-toggles` header rows. The fade is applied only while a row actually overflows, * so a row that fits is never dimmed. * * `fullscreen-inset` overrides the safe-area panel inset while the viewport-filling backdrop stays * at zero by default. `compact` tightens header/body padding — same convention as `lr-empty`. * @status stable * @since 4.0.0 */ export declare class LyraWidget extends LyraElement{static styles:import("lit").CSSResultGroup[];static properties:{collapsed:{type:BooleanConstructor;reflect:boolean;noAccessor:boolean;};};private actionsScrollOverflow;private viewTogglesScrollOverflow; /** Header title. Removing the attribute omits the copy without changing null readback. */ label:string; /** Overrides the fullscreen dialog's accessible name, taking precedence over both `label` and a * slotted `label`. An explicitly empty value remains an explicit name; fallbacks apply only when * the value is absent. Fed only by a host `aria-label`, matching `lr-scroller`'s/`lr-carousel`'s * own host-override pattern. */ accessibleLabel:string|null; /** Secondary header copy. Removed or empty attributes render no fallback text. */ sublabel:string;collapsible:boolean; /** Whether the body is collapsed. Reflects to the `collapsed` attribute. Also settable from * outside (attribute or property) to restore a previously-persisted `storageKey` preference -- * see `storageKey`'s own doc for the explicit-assignment-beats-persisted-value precedence. * @default false */ collapsed:boolean; /** Persists `collapsed` to `localStorage` across reloads when set. Namespaced as * `lr-widget:${storageKey}`. Restoration never overwrites a `collapsed` the consumer already * assigned on the same mount (`collapsed` attribute present, or a `.collapsed=${...}` binding) * -- including a binding that pins it to `false`, its own default. The same "explicit beats * persisted" guarantee as `lr-app-rail`'s and `lr-table`'s `storage-key` restores, which share * this one's write-tracking mechanism. Unset (the default) touches storage not at all. */ storageKey?:string;expandable:boolean;fullscreen:boolean; /** CSS `inset` shorthand applied to the fullscreen panel instead of its safe-area default. * The backdrop remains viewport-filling unless `backdropInset` is also set. */ fullscreenInset:string; /** Overrides the fullscreen backdrop's viewport-filling inset independently of * `fullscreenInset`. Invalid values retain the default `0`. */ backdropInset:string; /** Tighter header/body padding for constrained spaces. */ compact:boolean;private effectiveViews; /** Named alternate views for the panel body. Assignment takes a bounded, recursively frozen * snapshot (except `icon`, preserved by reference -- see `snapshotWidgetViews`'s doc); mutate a * copy and reassign it to update. For example, a chart/table toggle inside the same card * chrome. Each entry gets a header toggle button and a ``. Empty (the * default) renders today's single unnamed default slot as the sole view, unchanged. An entry's * `label` is optional -- see `LyraWidgetView`'s own doc for the icon-only (`ariaLabel`) case. */ get views():readonly LyraWidgetView[];set views(value:readonly LyraWidgetView[]); /** The currently active view's `viewId` -- defaults to the first entry of `views` (or `''` when * `views` is empty). Settable directly by a consumer wanting to control the active view * externally; also updated internally when a view toggle is clicked. */ activeViewId:string;private hasActionsSlot;private hasIconSlot;private hasLabelSlot; /** Text content of a slotted `label`, so the fullscreen dialog's accessible name can see rich * slotted label content the same way it already sees the plain `label` property. */ private labelSlotText?;private hasSublabelSlot;private overlayHandle?;private explicitTrigger?;private labelSlotObserver?;private labelSlotObserverDocument?;private labelSlotObserverGeneration;private ownerRealmGeneration;private readonly bodyId;private focusedViewIdBeforeUpdate?;private get storageFullKey(); /** Skips the very first `updated()` pass so mounting never writes to storage -- `willUpdate()` * restored `collapsed` on that first pass, and Lit has already flipped `hasUpdated` to true by * the time `updated()` runs, so a dedicated flag is needed. Mirrors `lr-table`'s/`lr-app-rail`'s * `persistReady`. */ private persistReady;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void;connectedCallback():void;disconnectedCallback():void;adoptedCallback():void;private resetOwnerRealmWork;private queueOwnerMicrotask;private activateFullscreenOverlay;private deactivateFullscreenOverlay;private onActionsSlotChange;private onIconSlotChange;private onLabelSlotChange;private syncLabelSlot;private readLabelSlotText;private resetLabelSlotObserver;private onSublabelSlotChange;private setActiveView; /** Emits the cancelable interaction proposal before touching the persisted * property, while retaining lr-collapse-change as the existing post-commit * notification. */ private requestCollapse;private toggleCollapsed; /** Emits the cancelable lr-fullscreen-request proposal before touching the persisted property, * while retaining lr-fullscreen-change as the existing post-commit notification. Returns * whether the change was accepted, mirroring requestCollapse() above. */ private requestFullscreenChange;private toggleFullscreen;private dismissFullscreen;private onBackdropClick;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-widget':LyraWidget;}}