/** * Floating-element positioning helpers for popovers/tooltips. * * The widget is often embedded inside host containers that clip overflow or — * worse — establish a containing block via `transform`/`filter`/`contain`, * which defeats `position: fixed`. To stay overflow-safe in every context we * lift floating panels into the browser **top layer** via the native Popover * API (`showPopover()`), which escapes all ancestor clipping and transforms. * We still compute viewport coordinates ourselves (Popover UA positioning is * centered) with two-axis collision handling (flip vertically, shift * horizontally) so panels never spill off-screen. */ export type VerticalPlacement = 'top' | 'bottom'; export type HorizontalAlign = 'start' | 'center' | 'end'; /** Whether the native Popover API (top layer) is available. */ export declare function supportsPopover(): boolean; /** * Pick a vertical placement (open up vs. down) for a floating element based on * available viewport space around its trigger. Used by the toolbar tooltips and * flyout popovers so they flip automatically when the toolbar is mounted at the * bottom of the screen (or anywhere with limited space below). * * Prefers `bottom` when the panel fits below; otherwise `top` when it fits * above; otherwise whichever side has more room. */ export declare function pickVerticalPlacement(trigger: Element, panelHeight: number, gap?: number): VerticalPlacement; export interface FloatingPosition { top: number; left: number; placement: VerticalPlacement; } /** * Compute viewport (fixed) coordinates for a floating panel anchored to a * trigger rect, flipping vertically and shifting horizontally to stay within * the viewport. */ export declare function computeFloatingPosition(anchor: DOMRect, panelWidth: number, panelHeight: number, opts?: { gap?: number; align?: HorizontalAlign; prefer?: VerticalPlacement; }): FloatingPosition; //# sourceMappingURL=placement.d.ts.map