import { type ReactNode, type RefObject } from "react"; import { View, type StyleProp, type ViewStyle } from "react-native"; export interface AnchoredOverlayProps { /** Whether the card is shown. */ open: boolean; /** Called when a tap off the card should dismiss it. */ onDismiss: () => void; /** Ref to the trigger view the card anchors below. */ triggerRef: RefObject; /** Gap between the trigger's bottom edge and the card's top (default 4). */ gap?: number; /** The floating card's contents. */ children: ReactNode; /** Style for the card wrapper (the skin's card fill/border/shadow + width). */ cardStyle?: StyleProp; /** The caller's inline absolute anchor (e.g. position:absolute, top:"100%"), * used only in the no-host fallback. */ inlineStyle?: StyleProp; /** * Whether an outside tap can actually dismiss the card (default true). Pass * false when dismissal is a no-op — a controlled `open` with no change handler * (e.g. a docs example pinned open) — so the full-bleed dismiss backdrop is * skipped instead of silently swallowing every tap under an overlay that can * never close. */ dismissable?: boolean; /** * The card's known width, when the caller fixes it. Enables horizontal * placement logic: the card is clamped inside the outlet's bounds (8px * inset), so a card anchored to a trigger near the outlet's right edge slides * left instead of overflowing. Omit for the legacy left-edge anchoring. */ cardWidth?: number; /** With `cardWidth`: center the card on the trigger (tooltip-style) instead * of aligning to its left edge. Still clamped inside the outlet. */ centered?: boolean; /** * Align the card's TRAILING edge with the trigger's trailing edge instead of * its leading edge (the default). Needs no `cardWidth`: the card is pinned by * an inset from the outlet's own edge, so there is no measure-then-shift pass. */ alignEnd?: boolean; /** * The active layout direction, for callers that want logical (leading/trailing) * horizontal alignment. Leading is physical-left in a left-to-right locale and * physical-right in a right-to-left one. Omit to keep the legacy physical-left * anchoring untouched. */ rtl?: boolean; /** * With `cardWidth`: prefer placing the card BESIDE the trigger, top-aligned — * to its right when the outlet has room there, else to its left, and only * when neither side fits, below it (the `centered` treatment). For popovers * anchored to small cells (a calendar day peek) where below-the-trigger would * cover the grid. */ preferSide?: boolean; /** * Paint the card as an OPAQUE surface: the skin's own `popover` fill on a * plain box, with NO glass material, in glass mode exactly as in solid mode. * * For the anchored surfaces that are option lists (Dropdown, Select, * Autocomplete, RowMenu, SplitButton's overflow menu, and so the AvatarMenu * built on Dropdown). Those cards carry rows the user reads and picks from, * and under a material the page behind them reads through between the rows. * This is NOT a per-component glass prop and it does not paint any glass: it * selects which of the kit's two existing surfaces (the material one or the * plain one) the card is drawn on, the same choice AlertDialog and Toast make * by rendering their own opaque box. Defaults to false, so a Popover, the * Command palette and the Calendar peek keep the material. */ opaque?: boolean; /** * Fired ONCE per opening, the moment the card and everything inside it are * actually mounted. `open` flipping true is NOT that moment on the hosted * path: there the card is held back until the trigger measurement lands, so a * caller that moves focus into its content (the WAI-ARIA menu pattern: focus * the first row on open) would otherwise focus a card that does not exist yet. * This fires on BOTH paths, from an effect inside the card's own subtree, * which React runs only after every child below it is committed and its refs * attached, so the caller needs neither polling nor a setTimeout guess. */ onCardMount?: () => void; } export declare function AnchoredOverlay({ open, onDismiss, triggerRef, gap, children, cardStyle, inlineStyle, dismissable, cardWidth, centered, preferSide, alignEnd, rtl, opaque, onCardMount, }: AnchoredOverlayProps): import("react").JSX.Element | null; interface Rect { x: number; y: number; width: number; height: number; } /** * The card's outlet-relative position (pure, so the branch logic is testable). * * Without a known `cardWidth`: the legacy anchoring, left-aligned below the * trigger. With one: the below placement can center on the trigger and is * clamped inside the outlet; `preferSide` instead tries beside the trigger, * top-aligned — right first, left when the right lacks room, and below (the * centered treatment) when neither side fits. * * `alignEnd`/`rtl` opt into LOGICAL horizontal alignment for the below * placement: the card is pinned by its leading edge (default) or its trailing * edge (`alignEnd`), and which physical side that is flips with `rtl`. Pinning * the trailing edge is expressed as a `right` inset from the outlet, so it needs * no card measurement and never runs a measure-then-shift second pass. Callers * that pass neither keep the legacy physical-left anchoring byte for byte. */ export declare function placeOverlay(rect: Rect, opts: { cardWidth?: number; centered?: boolean; preferSide?: boolean; alignEnd?: boolean; rtl?: boolean; gap: number; outletWidth: number | null; }): { left?: number; right?: number; top: number; }; export {}; //# sourceMappingURL=anchored-overlay.d.ts.map