import { type Placement, type Rect } from '@vielzeug/orbit'; export type OverlayPositioner = { floating: () => HTMLElement | null; reference: () => HTMLElement | null; /** Start continuous position auto-updates. Returns a stop function. */ startAutoUpdate?: () => () => void; update: () => void; }; export type DropdownPositionerOptions = { /** * Clipping boundary for flip/shift/size — the edges the dropdown must stay within. * Defaults to the nearest ancestor that actually clips content (`overflow: * hidden|auto|scroll|clip`, e.g. a dialog panel), auto-detected per update via * `getClippingAncestorRect()`, intersected with the viewport. Without this, flip/shift only * avoid the full page viewport — a dropdown can be "in view" by that measure while still * visibly overhanging a much smaller container it's actually nested in. Pass an explicit * boundary to override auto-detection. */ boundary?: Element | Rect; /** * Returns the text direction used for placement mirroring. Defaults to the resolved * direction of the reference element (nearest `dir="ltr"|"rtl"` ancestor, falling back to * computed style) — most callers never need to pass this explicitly. */ getDir?: () => 'ltr' | 'rtl'; /** Getter for the floating (dropdown panel) element. */ getFloating: () => HTMLElement | null; /** Getter for the current placement. Defaults to 'bottom-start' (RTL-aware: flips to 'bottom-end'). */ getPlacement?: () => Placement; /** Getter for the reference (trigger) element. */ getReference: () => HTMLElement | null; /** Whether to match the floating element width to the reference. Default: true */ matchWidth?: boolean; /** Additional offset in pixels between reference and floating element. Default: 0 */ offsetPx?: number; /** Padding (px) used by flip, shift, and size middleware. Default: 6 */ padding?: number; /** * Whether to constrain placement to a clipping ancestor when `boundary` is unset. Default: * true. Disable for native Popover API panels, which render in the top layer. */ useClippingAncestor?: boolean; }; /** * Creates an Orbit-powered positioner for dropdown overlays (select, combobox, menu). * * Uses flip + shift + optional width-matching middleware. Supports continuous * auto-update for repositioning on scroll or resize. * * RTL-aware: start/end placements are automatically mirrored so dropdowns open on the * correct side, based on `getDir` (or the reference element's resolved direction when * `getDir` is omitted). */ export declare function createDropdownPositioner({ boundary, getDir, getFloating, getPlacement, getReference, matchWidth, offsetPx, padding, useClippingAncestor, }: DropdownPositionerOptions): OverlayPositioner; //# sourceMappingURL=positioner.d.ts.map