import { default as React } from 'react'; import { Placement } from '../hooks/useDropdownLayer'; export interface PopoverProps { /** Content of popover */ content: React.ReactNode; /** * The root node of JSX passed into Tooltip as children will act as the tooltip trigger * * @deprecated use `renderTrigger` instead. */ children?: React.ReactNode; /** * Render function for a custom trigger aware of the open state of the Popover. * Called with `(isOpen) => {}`, the state of the Popover. */ renderTrigger?: (isOpen?: boolean) => React.ReactNode; /** Sets preferred side of the trigger the tooltip should appear */ side?: Placement; /** CSS `display` value for the element that wraps the Tooltip children */ wrapperDisplay?: "inline-flex" | "inline-block" | "inline" | "block" | "flex"; /** When `true`, the Popover container will match the width of its triggering element */ matchTriggerWidth?: boolean; /** Optional value for `data-testid` attribute */ testId?: string; /** Close the popover if the User clicks on the content */ closeOnContentClick?: boolean; /** If isOpen is set the component becomes a controlled component. Use the `onUserDismiss` callback to update. */ isOpen?: boolean; /** * Callback to handle user taking an action to __dismiss__ the popover * (click outside, Escape key) */ onUserDismiss?: () => void; /** * Callback to handle user taking an action to __enable__ the popover * (click or key interaction on the trigger button rendered in Popover) */ onUserEnable?: () => void; /** * When set to `true`, the first focusable element will automatically receive focus * whenever the popover opens */ autoFocus?: boolean; /** * When set to `false` the popover positioned element will not have a box shadow. * Useful for adding a custom box shadow. */ hasShadow?: boolean; } /** * Generic Popover component. Renders a floating element that can contain any content, * positioned relatively to its triggering element. * * This Popover only appears on "click" (focus + activate or mouse click) interactions. * The Escape key and clicking outside of the Popover will dismiss it. * For a hover-based informative popover, use `Tooltip`. * * The popover will position itself based on the `side` prop, but will * automatically reposition to avoid collisions with viewport edges. */ declare const Popover: ({ side, content, children, renderTrigger, wrapperDisplay, matchTriggerWidth, testId, closeOnContentClick, isOpen, autoFocus, hasShadow, onUserDismiss, onUserEnable, }: PopoverProps) => React.JSX.Element; export default Popover; //# sourceMappingURL=index.d.ts.map