import { LitElement } from "lit"; import type { PropertyValues, TemplateResult } from "lit"; export type OverlayTier = "tooltip" | "menu" | "dialog"; export type OverlayMode = "modal" | "non-modal"; export type OverlayPlacement = "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end"; export type OverlayCloseReason = "escape" | "backdrop" | "api" | "ancestor-closed"; export interface OverlayCloseDetail { tier: OverlayTier; mode: OverlayMode; reason: OverlayCloseReason; } export interface OverlayOpenDetail { tier: OverlayTier; mode: OverlayMode; } /** * @fires xm-overlay-close - Fired when the overlay closes. * @fires xm-overlay-open - Fired when the overlay opens. */ export declare class XmOverlay extends LitElement { static styles: CSSStyleSheet[]; static shadowRootOptions: ShadowRootInit; open: boolean; mode: OverlayMode; tier: OverlayTier; placement: OverlayPlacement; label: string; /** Non-modal dropdowns: size the surface's border box to exactly the anchor's width, so a width-matching listbox aligns border-to-border with its trigger (ADR 0025). The consumer stops sizing the panel content to the anchor. */ matchAnchorWidth: boolean; /** Non-modal overlays: weld a small pointer to the surface edge facing the anchor. It tracks the anchor's centre — when the surface is clamped at a viewport edge the pointer slides along that edge and keeps pointing at the trigger (ADR 0033). Opt-in, so menus and dialogs are unaffected. */ arrow: boolean; /** Trigger element to anchor a non-modal overlay against (CSS anchor()). A property, not an attribute — it is an element reference, possibly from another shadow root. Reactive, so re-anchoring an ALREADY-OPEN overlay re-pins it (a delegated tooltip moving between targets, ADR 0033). */ anchor: HTMLElement | null; /** Element focus is restored to on close. Defaults to `anchor`, else the document's deepest activeElement at open time. */ opener: HTMLElement | null; private _dialog; private _popover; private readonly _id; private readonly _anchorName; private _restoreFocusTo; private _scrollLocked; private _wasOpen; private _activationSeq; render(): TemplateResult; protected updated(changed: PropertyValues): void; disconnectedCallback(): void; show(): void; hide(reason?: OverlayCloseReason): void; toggle(): void; private _activate; private _deactivate; private _onKeydown; private _onDialogCancel; private _onDialogClose; private _onDialogClick; private _applyAnchor; private _sameTreeScope; private _reposition; private _pinToAnchor; private _flipSide; private _lockScroll; private _unlockScroll; private _restoreFocus; private _deepActiveElement; private _ownsOpener; private _tierZVar; } declare global { interface HTMLElementTagNameMap { "xm-overlay": XmOverlay; } }