import React from 'react'; import { BoxSystemProps } from './Box'; import { Side, Align } from '../utils/geometry'; import { StyleConfig } from '../utils/styleConfig'; import { FocusableTarget } from '../utils/createFocusTrap'; export declare type PopoverParts = { content: ''; arrow: ''; }; declare type PopoverDOMProps = React.ComponentPropsWithRef<'div'>; declare type PopoverStyleConfigProp = { styleConfig?: StyleConfig; }; declare type PopoverSystemProps = BoxSystemProps; declare type PopoverOwnProps = { targetRef: React.RefObject; /** whether the Popover is currently opened or not */ isOpen: boolean; /** * A function called when the Popover is closed from the inside (escape / outslide click) */ onClose?: () => void; side?: Side; sideOffset?: number; align?: Align; alignOffset?: number; arrowOffset?: number; noArrow?: boolean; collisionTolerance?: number; /** * A ref to an element to focus on inside the Popover after it is opened. * (default: first focusable element inside the Popover) * (fallback: first focusable element inside the Popover, then the Popover's content container) */ refToFocusOnOpen?: React.RefObject; /** * A ref to an element to focus on outside the Popover after it is closed. * (default: last focused element before the Popover was activated) * (fallback: none) */ refToFocusOnClose?: React.RefObject; /** * Whether pressing the `Escape` key should close the Popover * (default: `true`) */ shouldCloseOnEscape?: boolean; /** * Whether clicking outside the Popover should close it * (default: `true`) */ shouldCloseOnOutsideClick?: boolean | ((event: MouseEvent | TouchEvent) => boolean); /** * Whether pointer events happening outside the Popover should be blocked * (default: `false`) */ shouldBlockOutsideClick?: boolean; /** * Whether scrolling should be locked or not * (default: `false`) */ shouldLockScroll?: boolean; }; export declare type PopoverProps = PopoverDOMProps & PopoverStyleConfigProp & PopoverSystemProps & PopoverOwnProps & { as?: React.ElementType; }; export declare const Popover: React.ForwardRefExoticComponent & React.RefAttributes>; export {};