import { Rect, Size, Viewport } from './tooltipPosition'; export type { Rect, Size, Viewport }; export interface AnchoredPlacement { top: number; left: number; /** Set only when `matchTriggerWidth` — the panel is pinned to the trigger width. */ width?: number; placement: "bottom" | "top"; /** Available height on the chosen side; apply as `max-height` so long lists scroll. */ maxHeight: number; } export interface AnchoredOptions { /** Trigger↔panel offset. @default 4 */ gap?: number; /** Minimum padding from the viewport edge. @default 8 */ margin?: number; /** Pin the panel width to the trigger width (Select); else use the panel's own width (DatePicker). */ matchTriggerWidth?: boolean; /** * Floor for `matchTriggerWidth` — the panel tracks the trigger but never * shrinks below this (DateRangePicker: its calendar + preset column stop * being usable under ~320px). Ignored when `matchTriggerWidth` is off. * The clamp below uses the SAME floored width, so a panel widened by this * floor is still kept inside the viewport. */ minWidth?: number; /** * The panel carries its OWN CSS min-width (DateRangePicker's * `min-w-[fit-content]`), so it can render WIDER than the width we pin on it — * e.g. on `spacious` density, where `--space-8` grows the 7-cell grid, or with * long custom preset labels. Clamp against the measured natural width in that * case, or the surplus spills past the right viewport edge. * * OFF by default, and deliberately not unconditional: Select also pins its * panel to the trigger, but it has no min-width and truncates long option * labels, so its natural (max-content) width is NOT what it renders at. * Clamping Select against that would shove its panel left of its own trigger * for no reason. */ clampToContentWidth?: boolean; } /** * Compute the fixed on-screen position for a dropdown panel anchored to a trigger. * * @param trigger Bounding rect of the trigger element. * @param panel Measured natural size of the panel. * @param viewport Viewport dimensions. * @param opts gap / margin / matchTriggerWidth. */ export declare function computeAnchoredPosition(trigger: Rect, panel: Size, viewport: Viewport, opts?: AnchoredOptions): AnchoredPlacement; //# sourceMappingURL=anchoredPanelPosition.d.ts.map