import { type AriaAttributes, type ReactElement, type ReactNode, type RefObject } from "react"; import { type IAccessibilityConfigBase } from "../../typings/accessibility.js"; import { type IUiTooltipProps } from "../UiTooltip/types.js"; /** * @internal */ export interface IUiPopoverProps { id?: string; anchor: ReactElement; /** * Accessibility attributes forwarded to the anchor element (the trigger). * `ariaHaspopup` defaults to `"dialog"` — pass * `"menu"` for menu-style popovers, `"listbox"` for * single-select pickers, etc. Set `ariaHaspopup: false` to * suppress. (Separate from `accessibilityConfig`, which targets * the popover content surface.) */ anchorAccessibilityConfig?: { ariaHaspopup?: "dialog" | "menu" | "listbox" | "tree" | "grid" | false; ariaControls?: AriaAttributes["aria-controls"]; }; width?: "default" | number; disabled?: boolean; tabIndex?: number; accessibilityConfig?: IAccessibilityConfigBase; title?: string | ReactNode; content?: ReactNode | ((args: { onClose: () => void; }) => ReactNode); /** * Padding around the content surface. Defaults to `"default"`. Use `"none"` * for edge-to-edge content whose own children carry their inset (e.g. a list * of full-bleed rows); the surface then also stretches the content to its * full width. */ contentPadding?: "default" | "none"; footer?: ReactNode | ((args: { onClose: () => void; }) => ReactNode); triggerBy?: IUiTooltipProps["triggerBy"]; /** * Where the popover sits relative to its anchor (the arrow side; the panel * opens on the opposite side). Defaults to `"top-start"` — i.e. the panel * opens below the anchor, left-aligned. */ arrowPlacement?: IUiTooltipProps["arrowPlacement"]; /** * Allow the popover to flip to the opposite side when the preferred side * would overflow. Defaults to `true`. Set `false` to pin it to * `arrowPlacement` (e.g. an anchor that should always open downward). */ optimalPlacement?: boolean; closeText?: string; closeVisible?: boolean; initialFocus?: RefObject | string; returnFocusTo?: RefObject | string; returnFocusAfterClose?: boolean; /** * customize if you know that dialog content has some custom focusIn logic which modifies focused element, eg. table which shifts its focus from table wrapper to first table cell * default is check if active element is exactly focused element. */ focusCheckFn?: (element: HTMLElement) => boolean; /** * Enable focus trap to prevent tabbing out of the popover * When true, uses UiFocusManager's focus trap instead of tabOutHandler */ enableFocusTrap?: boolean; /** * Controls the open state. When set, the popover ignores anchor clicks and * opens/closes purely from this prop; pair with `onOpenChange` to * react to outside-click / Escape. When omitted the popover stays * uncontrolled and opens on anchor click as before. */ isOpen?: boolean; /** Fires when an interaction (outside-click, Escape) requests an open-state change. */ onOpenChange?: (open: boolean) => void; onOpen?: () => void; onClose?: () => void; } /** * @internal */ export declare function UiPopover({ id, accessibilityConfig, anchor, anchorAccessibilityConfig, width, title, tabIndex, disabled, content, contentPadding, footer, closeText, closeVisible, initialFocus, returnFocusTo, triggerBy, arrowPlacement, optimalPlacement, returnFocusAfterClose, focusCheckFn, enableFocusTrap, isOpen, onOpenChange, onOpen, onClose, }: IUiPopoverProps): import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=UiPopover.d.ts.map