import * as React from 'react'; import type { ZestChangeEventDetails } from '../../utils/createChangeEventDetails'; import type { REASONS } from '../../utils/reasons'; import type { PopoverHandle } from '../store/PopoverHandle'; /** * Groups all parts of the popover. * Doesn't render its own element. */ export declare function PopoverRoot(props: PopoverRoot.Props): React.JSX.Element; export interface PopoverRootState { } export interface PopoverRootActions { /** * Unmounts the popover without firing `onOpenChange`. Call it after an externally * controlled closing animation finishes. */ unmount: () => void; /** * Closes the popover, reporting the `imperative-action` reason. */ close: () => void; } export interface PopoverRootProps { /** * Whether the popover is currently open. */ open?: boolean | undefined; /** * Whether the popover is initially open. * * To render a controlled popover, use the `open` prop instead. * @default false */ defaultOpen?: boolean | undefined; /** * Event handler called when the popover is opened or closed. */ onOpenChange?: ((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) | undefined; /** * Event handler called once an enter or exit animation has settled. * * zest never animates, so it cannot report when an animation finishes — the * consumer drives it and reports the settle through the store: * `usePopoverRootContext().settled(open)`. Call it when your enter animation * (or exit, which needs `keepMounted` on the `Portal`) ends. */ onOpenChangeComplete?: ((open: boolean, eventDetails: PopoverRoot.ChangeEventDetails) => void) | undefined; /** * Whether to prevent the popover from closing on presses outside the popup. * @default false */ disablePointerDismissal?: boolean | undefined; /** * A ref to imperative actions. */ actionsRef?: React.RefObject | undefined; /** * A handle associating this popover with triggers rendered outside it, and letting * it be opened and closed imperatively. Create one with `Popover.createHandle()`. */ handle?: PopoverHandle | undefined; /** * The id of the trigger the popover is anchored to and associated with. */ triggerId?: string | null | undefined; /** * The id of the trigger the popover is initially associated with. */ defaultTriggerId?: string | null | undefined; /** * The content of the popover. * * Pass a function to receive the payload the popover was opened with. */ children?: React.ReactNode | ((payload: Payload) => React.ReactNode); } export type PopoverRootChangeEventReason = typeof REASONS.triggerPress | typeof REASONS.outsidePress | typeof REASONS.escapeKey | typeof REASONS.closePress | typeof REASONS.imperativeAction | typeof REASONS.none; export type PopoverRootChangeEventDetails = ZestChangeEventDetails; export declare namespace PopoverRoot { type State = PopoverRootState; type Props = PopoverRootProps; type Actions = PopoverRootActions; type ChangeEventReason = PopoverRootChangeEventReason; type ChangeEventDetails = PopoverRootChangeEventDetails; } //# sourceMappingURL=PopoverRoot.d.ts.map