import{type PropertyValues,type TemplateResult}from'lit';import type{Placement}from'@floating-ui/dom';import{LyraElement}from'../../../internal/lyra-element.js';import type{PlaceAutoSize,PlaceBoundary,PlaceFlipFallbackStrategy,PlaceStrategy,PlaceSync,VirtualAnchor}from'../../../internal/positioner.js';import{type LyraArrowPlacement}from'../overlay/overlay-arrow.js';export type{LyraArrowPlacement,PlaceAutoSize,PlaceBoundary,PlaceFlipFallbackStrategy,PlaceStrategy,PlaceSync,VirtualAnchor,}; /** Shared boundary vocabulary exposed by the mapped popup primitive. */ export type LyraPopupBoundary='viewport'|'scroll'; /** Every public anchor form the mapped primitive accepts. */ export type LyraPopupAnchor=Element|string|VirtualAnchor; /** The mapped spelling is `initial`; `initial-placement` remains a compatibility alias. */ export type LyraPopupFlipFallbackStrategy='best-fit'|'initial'|'initial-placement';export interface LyraPopupEventMap{'lr-reposition':CustomEvent<{placement:Placement;}>;} /** * `` — the low-level anchored-positioning primitive. * * It positions its `popup` slot against an anchor and keeps the two aligned through scroll, * resize and layout change. That is *all* it does: no dismiss behaviour, no focus management, no * ARIA relationship, no trigger semantics. Those are policy, and policy belongs to the component * built on top — ``, `` and `` each layer their own. * * Reach for it when you need a floating surface the library does not already ship: an anchored * inline editor, a colour-picker panel, a custom autocomplete list. If you find yourself adding * light dismiss and focus return on top, use `` instead. * * The v8 defaults match the mapped primitive: `placement="top"`, `strategy="absolute"`, zero * distance/padding, and opt-in flip/shift. `auto-size` narrows an always-on measurement rather * than switching one on: this element publishes the available space as * `--lr-positioner-available-inline-size`/`--lr-positioner-available-block-size` and caps the * popup with them, so `auto-size` re-measures the named axes against `auto-size-boundary` and * `auto-size-padding` instead of the shared `padding`. * * @customElement lr-popup * @slot anchor - The fallback element to position against when no higher-priority source resolves. * @slot - The floating content. * @event lr-reposition - Emitted after each recomputation. `detail: { placement }` carries the * placement actually used, which `flip` may have changed. * @csspart anchor - The anchor slot wrapper. * @csspart popup - The positioned floating surface. Carries the resolved side (`top`, `bottom`, * `left`, `right`) in its part name, so `::part(popup bottom)` can style one side — state after * `::part()` never matches. * @csspart arrow - The arrow element, rendered only when `arrow` is set. Its part name also * carries the resolved side (`arrow-top`, `arrow-bottom`, `arrow-left`, `arrow-right`), matching * `` and ``. * @csspart hover-bridge - The invisible quad spanning the `distance` gap between anchor and popup, * rendered only when `hover-bridge` is set. * @cssprop [--arrow-size=var(--lr-popup-arrow-size,var(--lr-size-0-375rem))] - Half-width of the * arrow square. `--lr-popup-arrow-size` remains a compatibility alias. * @cssprop --lr-popup-arrow-size - Retained Lyra fallback for `--arrow-size`. * @cssprop [--arrow-color=var(--lr-color-surface-raised)] - Arrow fill. * @cssprop [--popup-border-width=var(--lr-border-width-thin)] - Popup/arrow border width. * @cssprop [--show-duration=var(--lr-duration-fast)] - Activation transition duration. * @cssprop [--hide-duration=var(--lr-duration-fast)] - Deactivation transition duration. * @cssprop --auto-size-available-width - Read-only available inline size. * @cssprop --auto-size-available-height - Read-only available block size. * @status stable * @since 8.0.0 */ export declare class LyraPopup extends LyraElement{static styles:import("lit").CSSResultGroup[]; /** Requests positioning and paint. The surface remains hidden until a live anchor is placed. */ active:boolean; /** * Id of an element elsewhere in the same root to anchor against, instead of the `anchor` slot. * Resolved in this element's own root, so it works inside a shadow tree where an idref could not * cross the boundary. */ for:string; /** Element, same-root id string, or Floating UI-compatible virtual element to position against. * Takes precedence over `for` and the anchor slot; `virtualAnchor` remains the highest-priority * Lyra compatibility path. A disconnected element or dangling id falls through. */ anchor:LyraPopupAnchor|null; /** Preferred placement. `flip`/`shift` may override it; the result is reported by `lr-reposition`. */ placement:Placement; /** * CSS positioning scheme. `fixed` escapes every ancestor's * transform/filter/containment context; `absolute` positions against the nearest positioned * ancestor, so the popup scrolls away with the content it belongs to. Defaults to `absolute`. */ strategy:PlaceStrategy; /** Distance from the anchor along the placement axis, in pixels. */ distance:number; /** Offset along the anchor's edge, in pixels. */ skidding:number; /** Flip to the opposite side when the preferred one does not fit. */ flip:boolean; /** * Space-delimited placements `flip` tries, in order, instead of just the opposite side — * `flip-fallback-placements="right bottom"`. Unrecognised entries are ignored. */ flipFallbackPlacements:string; /** * What `flip` settles on when none of the candidate placements fit: `best-fit` takes the * least-overflowing one, `initial` keeps `placement` as written. `initial-placement` remains a * compatibility alias. */ flipFallbackStrategy:LyraPopupFlipFallbackStrategy; /** Shared clipping boundary. `viewport` ignores clipping ancestors; `scroll` uses them. The * separate flip/shift/auto-size boundaries below override this value one middleware at a time. */ boundary:LyraPopupBoundary; /** Element(s) `flip` measures overflow against, instead of the popup's clipping ancestors. */ flipBoundary:PlaceBoundary|null; /** Padding kept clear inside the flip boundary, in pixels. */ flipPadding:number; /** Shift along the anchor's edge to stay within the viewport. */ shift:boolean; /** Element(s) `shift` measures overflow against, instead of the popup's clipping ancestors. */ shiftBoundary:PlaceBoundary|null; /** Padding kept clear inside the shift boundary, in pixels. */ shiftPadding:number; /** Viewport padding kept clear by `shift` and by the available-size measurement. */ padding:number; /** * Re-measures the available space on the named axes against `auto-size-boundary` and * `auto-size-padding` rather than the shared `padding`. The popup is capped by that measurement * either way — this narrows or widens the cap, it does not introduce one. */ autoSize:PlaceAutoSize|null; /** Element(s) the `auto-size` measurement uses, instead of the popup's clipping ancestors. */ autoSizeBoundary:PlaceBoundary|null; /** Padding kept clear inside the auto-size boundary, in pixels. */ autoSizePadding:number; /** Copies the anchor's inline size, block size, or both onto the popup. */ sync:PlaceSync|null; /** * Renders an invisible quad across the `distance` gap between anchor and popup, so a pointer * travelling between them never leaves both at once. Purely geometric — this element owns no * hover policy of its own; the component built on top reads the hover. */ hoverBridge:boolean; /** Render an arrow that points at the anchor. */ arrow:boolean; /** Where the arrow sits along the popup's edge. `anchor` tracks the anchor's centre. */ arrowPlacement:LyraArrowPlacement; /** Keeps the arrow this far from the popup's corners, in pixels. */ arrowPadding:number; /** * Anchor against an arbitrary rectangle rather than an element — a canvas hit, a chart datum, a * text-selection range. Takes precedence over `for` and the `anchor` slot. Assign `null` to go * back to element anchoring. */ /** Highest-priority anchor. A plain rect defaults omitted dimensions to zero, clamps negative * dimensions to zero, and ignores a rect containing any non-finite field. */ virtualAnchor:VirtualAnchor|{x:number;y:number;width?:number;height?:number;}|null; /** The positioned popup element, exposed for mapped popup integrations. Upstream public types * permit assignment, so writes are accepted for source compatibility; the shadow-owned node * remains authoritative because replacing it would detach positioning, parts, and animation. */ get popup():HTMLElement;set popup(_next:HTMLElement);private arrowElement;private hoverBridgeElement;private anchorSlotWrapper;private stopPlacing?;private stopAnchorIdentityObservation?;private anchorPositioned;private placingAnchorIdentity?;private positionedAnchorIdentity?;private resolvedPlacement;connectedCallback():void;disconnectedCallback():void;protected willUpdate(changed:PropertyValues):void;protected updated(changed:PropertyValues):void; /** Recomputes the position now. Rarely needed — the popup already tracks scroll, resize and * layout change — but a consumer that moved a virtual anchor imperatively can force a pass. */ reposition():void; /** `flip-fallback-placements` is a space-delimited attribute, mirroring the upstream primitive. * Unrecognised tokens are dropped rather than forwarded — Floating UI would otherwise place * against a placement string it cannot resolve. */ private get parsedFlipFallbackPlacements();private teardown;private resolveAnchor;private isElementAnchor;private syncAnchorIdentityObservation;private setPositioned;private readonly onAnchorSlotChange; /** A forwarding slot is a light-DOM child of the popup, so its non-composed `slotchange` event * reaches the host but not the shadow-owned anchor slot listener below. */ private readonly onForwardedAnchorSlotChange; /** The resolved side lives in the part name, never as an attribute after `::part()` — that * selector shape silently never matches. */ private applySidePart; /** Same rule as `applySidePart`: the resolved side rides in the part name, never in an * attribute after `::part()`. Matches ``/``'s `arrow-` token. */ private applyArrowSidePart;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-popup':LyraPopup;}}