import React from 'react'; import { ReferenceType } from '@floating-ui/react'; export declare enum PopoverPosition { bottom = "bottom", top = "top" } export declare enum PopoverAlignment { center = "center", start = "start", end = "end" } export declare type PopoverPlacement = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end'; export interface PopoverApi { closePopoverManually(event: any): void; openPopoverManually(event: any): void; } export interface PopoverProps extends React.HTMLAttributes { /** * Function called when closing the popover menu */ onClose?: (event: React.SyntheticEvent) => void; /** * Function called when opening the popover menu */ onOpen?: () => void; /** * @internal */ testId?: string; /** * Determines the position of the popover relative to its trigger. * @default PopoverPosition.bottom */ position?: PopoverPosition; /** * Sets the maximum height of the popover content. * @default 100% */ maxHeight?: string | number; /** * Sets the width of the popover. * @default Width of longest menu item */ width?: string | number; /** * If true, the popover will remain open when hovered over. * @default false */ hoverable?: boolean; /** * If true, the component will have inverse styling to better appear on a dark background * @default false */ isInverse?: boolean; /** * If true, the popover will be disabled and cannot be opened. * @default false */ isDisabled?: boolean; /** * If true, a pointer (arrow) is displayed pointing towards the trigger element. * @default true */ hasPointer?: boolean; /** * If true, the popover is open by default when the component is first rendered. * @default false */ openByDefault?: boolean; /** * The ref object that allows Popover manipulation. * Actions available: * closePopoverManually(event): void - Closes the popover manually. * openPopoverManually(event): void - Opens the popover manually. */ apiRef?: React.MutableRefObject; /** * If true, the focus will be trapped within the popover, preventing focus from moving outside. * This is recommended when using interactive elements inside the popover to improve accessibility. * @default false */ focusTrap?: boolean; /** * Alignment of the popover content * @default PopoverAlignment.center */ alignment?: PopoverAlignment; /** * If true, the popover trigger will take the full width of its container. * This allows buttons with isFullWidth prop to render at full width. * @default false */ isFullWidth?: boolean; } export interface PopoverContextInterface { floatingStyles?: React.CSSProperties; position?: PopoverPlacement; closePopover?: (event: React.SyntheticEvent | React.KeyboardEvent) => void; popoverTriggerId?: React.MutableRefObject; popoverContentId?: React.MutableRefObject; openPopover?: () => void; isInverse?: boolean; isOpen: boolean; maxHeight?: string; width?: string; contentRef?: any; setIsOpen: React.Dispatch>; setFloating?: (node: ReferenceType) => void; setReference?: (node: ReferenceType) => void; arrowRef?: React.MutableRefObject; arrowContext?: any; toggleRef?: any; isDisabled?: boolean; hoverable?: boolean; hasPointer?: boolean; focusTrap?: boolean; hasActiveElements?: boolean; isFullWidth?: boolean; } export declare const PopoverContext: React.Context; export declare const Popover: React.ForwardRefExoticComponent>;