/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { PopoverCollision } from './PopoverCollision'; import { PopoverMargin } from './PopoverMargin'; import { PopoverOffset } from './PopoverOffset'; import { PopoverOpenEvent } from './PopoverOpenEvent'; import { PopoverCloseEvent } from './PopoverCloseEvent'; import { PopoverAnimation } from './PopoverAnimation'; import { PopoverPosition } from './PopoverPosition'; import { PopoverPositionEvent } from './PopoverPositionEvent'; import { PopoverPositionMode } from './PopoverPositionMode'; import { PopoverKeyDownEvent } from './PopoverKeyDownEvent'; export interface PopoverProps { /** * Set the focus the Popover container automatically when mounted. * * @default true * * @example * ```jsx * * ``` */ autoFocus?: boolean; /** * Specifies the title of the Popover component. * Can be a string or JSX content. * * @example * ```jsx * * ``` */ title?: React.ReactNode; /** * Specifies the position of the Popover relative to the anchor or offset. * Accepts predefined position values. * * @default "top" * * @example * ```jsx * * ``` */ position?: PopoverPosition; /** * Controls the visibility of the Popover callout (arrow). * If set to `false`, the callout will not be rendered. * * @default true * * @example * ```jsx * * ``` */ callout?: boolean; /** * Configures the animation behavior of the Popover. * Accepts a boolean or a configuration object. * * @example * ```jsx * * ``` */ animate?: boolean | PopoverAnimation; /** * Specifies the element to be used as the anchor for the Popover. * The Popover opens relative to this element. * * @example * ```jsx * * ``` */ anchor?: HTMLElement | null; /** * Defines the container to which the Popover will be appended. * Defaults to [`body`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body). * If set to `null`, the Popover will not use React Portal. * * @example * ```jsx * * ``` */ appendTo?: HTMLElement | null; /** * Configures the collision behavior of the Popover. * Determines how the Popover adjusts its position when it overflows the viewport. * * @example * ```jsx * * ``` */ collision?: PopoverCollision; /** * Specifies the margin in pixels between the Popover and the anchor element. * Automatically set based on the `position` property if not specified. * * @example * ```jsx * * ``` */ margin?: PopoverMargin; /** * Specifies the positioning mode of the Popover. * Defaults to `fixed`. Use `absolute` for mobile browser support with zoom. * * @default "fixed" * * @example * ```jsx * * ``` */ positionMode?: PopoverPositionMode; /** * Specifies the document scale when using a [scale transform](https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/scale). * Required for accurate positioning when scaling is applied. * * @example * ```jsx * * ``` */ scale?: number; /** * Specifies the absolute position of the Popover. * The Popover opens relative to this point. * * @example * ```jsx * * ``` */ offset?: PopoverOffset; /** * Specifies additional CSS classes for the animated Popover element. * * @example * ```jsx * * ``` */ popoverClass?: string | Array | { [key: string]: boolean; }; /** * Specifies additional CSS classes for the Popover element. * * @example * ```jsx * * ``` */ className?: string | Array; /** * Specifies the `id` attribute for the Popover element. * * @example * ```jsx * * ``` */ id?: string; /** * Specifies the styles applied to the Popover element. * * @example * ```jsx * * ``` */ style?: React.CSSProperties; /** * Specifies the styles applied to the content element of the Popover. * * @example * ```jsx * * ``` */ contentStyle?: React.CSSProperties; /** * Controls the visibility of the Popover. * Defaults to `false`. * * @default false * * @example * ```jsx * * ``` */ show?: boolean; /** * Fires after the Popover is opened and the opening animation ends. * Provides the event details. * * @example * ```jsx * console.log('Popover opened', event)} /> * ``` */ onOpen?: (event: PopoverOpenEvent) => void; /** * Fires after the Popover is closed. * Provides the event details. * * @example * ```jsx * console.log('Popover closed', event)} /> * ``` */ onClose?: (event: PopoverCloseEvent) => void; /** * Fires after the Popover position is calculated and set. * Provides the event details. * * @example * ```jsx * console.log('Popover positioned', event)} /> * ``` */ onPosition?: (event: PopoverPositionEvent) => void; /** * Fires when the Popover is focused and a key is pressed. * Provides the event details. * * @example * ```jsx * console.log('Key pressed', event)} /> * ``` */ onKeyDown?: (event: PopoverKeyDownEvent) => void; /** * Specifies the children elements of the Popover. * Used to define the content of the Popover. * * @example * ```jsx * *
Popover Content
*
* ``` */ children?: React.ReactNode; }