import { OverlayPosition } from "./useOverlayPosition"; import { PopupType } from "./usePopupAriaProps"; import { SyntheticEvent } from "react"; import { ResponsiveProp } from "../../styling"; export declare type PopupAlignment = "start" | "end"; export declare type PopupDirection = "top" | "bottom"; export declare type PopupPosition = OverlayPosition; export declare type PopupAlignmentProp = ResponsiveProp; export declare type PopupDirectionProp = ResponsiveProp; export declare type PopupPositionProp = ResponsiveProp; export declare type PopupTrigger = "none" | "click"; export interface PopupProps { /** * The horizontal alignment of the popup relative to the trigger. */ align?: PopupAlignment; /** * Whether or not the popup can flip when it will overflow it's boundary area. */ allowFlip?: boolean; /** * Whether or not the popup position can change to prevent it from being cut off so that it stays visible within its boundary area. */ allowPreventOverflow?: boolean; /** * The initial value of open when in auto controlled mode. */ defaultOpen?: boolean; /** * The direction the open will open relative to the trigger. */ direction?: PopupDirection; /** * Called when the open state change. * @param {SyntheticEvent} event - React's original event. * @param {boolean} isOpen - Indicate if the popup is visible. * @returns {void} */ onOpenChange?: (event: SyntheticEvent, isOpen: boolean) => void; /** * Whether or not to show the popup. */ open?: boolean; /** * The z-index of the menu. */ zIndex?: number; } export interface UsePopupOptions { allowFlip?: boolean; allowPreventOverflow?: boolean; boundaryElement?: HTMLElement; defaultOpen?: boolean; disabled?: boolean; hasArrow?: boolean; hideOnEscape?: boolean; hideOnLeave?: boolean; hideOnOutsideClick?: boolean; hideOnTriggerClick?: boolean; id?: string; keyProp?: string; offset?: number[]; onOpenChange?: (event: SyntheticEvent, newValue: boolean) => void; open?: boolean | null; position?: PopupPosition; trigger?: PopupTrigger; } export declare function usePopup(type: PopupType, { allowFlip, allowPreventOverflow, boundaryElement, defaultOpen, disabled, hasArrow, hideOnEscape, hideOnLeave, hideOnOutsideClick, hideOnTriggerClick, id, keyProp, offset, onOpenChange, open, position, trigger }?: UsePopupOptions): { arrowProps: { ref?: undefined; } | { ref: import("../../shared").MergedRef; }; focusManager: import("../../shared").DomFocusManager | import("../../shared").VirtualFocusManager; focusScope: import("../../shared").FocusScope; isOpen: boolean; overlayProps: { onKeyDown: (event: import("react").KeyboardEvent) => void; } & { onKeyDown?: undefined; } & { onKeyDown: (event: import("react").KeyboardEvent) => void; } & { id: string; } & { ref: import("../../shared").MergedRef; show: boolean; }; setIsOpen: (event: SyntheticEvent, newValue: boolean) => void; triggerProps: { onClick?: undefined; onKeyDown?: undefined; onKeyUp?: undefined; onBlur?: undefined; onFocus?: undefined; onMouseEnter?: undefined; } & { onClick: (event: SyntheticEvent) => void; onKeyDown: (event: import("react").KeyboardEvent) => void; onKeyUp: (event: import("react").KeyboardEvent) => void; onBlur?: undefined; onFocus?: undefined; onMouseEnter?: undefined; } & { onBlur: (event: import("react").FocusEvent) => void; onFocus: (event: import("react").FocusEvent) => void; onMouseEnter: (event: import("react").MouseEvent) => void; onClick?: undefined; onKeyDown?: undefined; onKeyUp?: undefined; } & { "aria-controls": string; "aria-expanded": boolean; "aria-haspopup": PopupType; } & { ref: import("../../shared").MergedRef; tabIndex: number; }; };