import type { ComponentProps, CSSProperties, ReactNode } from "react"; /** * Popover - placement of the floating element relative to the reference element. * Mirrors the placements supported by `react-popper` (`Auto` enables both * `flip` and `preventOverflow` automatically). */ export declare const PopoverPosition: { readonly Auto: "auto"; readonly Top: "top"; readonly TopStart: "top-start"; readonly TopEnd: "top-end"; readonly Right: "right"; readonly RightStart: "right-start"; readonly RightEnd: "right-end"; readonly Bottom: "bottom"; readonly BottomStart: "bottom-start"; readonly BottomEnd: "bottom-end"; readonly Left: "left"; readonly LeftStart: "left-start"; readonly LeftEnd: "left-end"; }; export type PopoverPosition = (typeof PopoverPosition)[keyof typeof PopoverPosition]; /** * Popover - ARIA role for the floating element. * Use `Dialog` when the contents are interactive, `Tooltip` for purely * informational content. */ export declare const PopoverRole: { readonly Tooltip: "tooltip"; readonly Dialog: "dialog"; }; export type PopoverRole = (typeof PopoverRole)[keyof typeof PopoverRole]; export type PopoverProps = Omit, 'role'> & { /** * The contents of the Popover. */ children?: ReactNode; /** * Additional class names to merge onto the Popover root. */ className?: string; /** * Inline styles applied to the Popover root. Merged after the styles * computed by `react-popper`. */ style?: CSSProperties; /** * Placement relative to `referenceElement`. When `PopoverPosition.Auto`, * `flip` and `preventOverflow` are forced on regardless of their props. * * @default PopoverPosition.Auto */ position?: PopoverPosition; /** * ARIA role applied to the Popover root. * * @default PopoverRole.Tooltip */ role?: PopoverRole; /** * Render an arrow pointing at the reference element. * * @default false */ hasArrow?: boolean; /** * Props forwarded to the arrow element. `ref`, `style`, and `children` are * reserved for internal use (popper positioning, rotation styles, and the * arrow visual) and cannot be overridden. */ arrowProps?: Omit, 'ref' | 'style' | 'children'>; /** * Match the popover width to the reference element's `clientWidth`. * * @default false */ matchWidth?: boolean; /** * Keep the Popover within the viewport. Forced on when * `position === PopoverPosition.Auto`. * * @default false */ preventOverflow?: boolean; /** * Allow flipping to the opposite side when there is not enough space. * Forced on when `position === PopoverPosition.Auto`. * * @default false */ flip?: boolean; /** * Hide the Popover when the reference element is scrolled out of view. * * @default true */ referenceHidden?: boolean; /** * The element the Popover is positioned against. */ referenceElement?: HTMLElement | null; /** * Whether the Popover is open. Nothing is rendered when `false`. */ isOpen?: boolean; /** * `[skidding, distance]` offset (in px) applied to the Popover. * * @default [0, 8] */ offset?: [number, number]; /** * Render the Popover into `document.body` via `createPortal`. * * @default false */ isPortal?: boolean; /** * Called when the user presses the Escape key while the Popover is open. */ onPressEscKey?: () => void; /** * Called when the user clicks outside the Popover and the reference element * while the Popover is open. */ onClickOutside?: () => void; }; //# sourceMappingURL=Popover.types.d.cts.map