import React from "react"; import type { CSSObject } from "styled-components"; import { PopoverMenuContextProps, PopoverControlProps } from "./contexts"; import { TagProps } from "../utils/helpers/tags"; interface ListProps { $size: PopoverMenuContextProps["size"]; $maxHeight?: string; $isButtonMenu?: PopoverMenuContextProps["isButtonMenu"]; } export declare const List: import("styled-components").StyledComponent<"ul", any, ListProps, never>; export type FocusableHandle = HTMLElement | HTMLButtonElement | HTMLAnchorElement | HTMLInputElement; export interface PopoverMenuProps extends TagProps { /** The content of the popover menu */ children: React.ReactNode; /** Whether the popover menu is open or not */ open: boolean; /** The element that the popover menu is anchored to */ popoverControl: (ref: React.RefObject, props: PopoverControlProps) => React.ReactNode; size?: PopoverMenuContextProps["size"]; /** Placement of the popover menu */ placement?: "top" | "bottom" | "left" | "right" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end" | "right-start" | "right-end"; /** Middleware for the popover menu */ middleware?: typeof menuPopoverMiddleware; /** Ref for the submenu control element */ submenuControlRef?: React.MutableRefObject; /** id applied to the outer wrapper element (e.g. for aria-controls) */ id?: string; /** Blur handler for the outer wrapper element */ onBlur?: React.FocusEventHandler; /** Callback when the popover menu is opened */ onOpen?: () => void; /** Callback when the popover menu is closed */ onClose: (e?: Event, value?: string) => void; /** Set the custom width of the menu */ width?: string; /** Override default control reference for popover */ controlReference?: React.RefObject; /** Set the custom max-height of the menu list */ maxHeight?: string; /** Custom styles for the control wrapper element */ controlWrapperStyle?: CSSObject; /** Aria labelledby for the listbox */ listboxAriaLabelledBy?: string; /** Aria label for the listbox */ listboxAriaLabel?: string; /** Controls the keyboard navigation behavior and sets roles to `list` and `listitem` */ isButtonMenu?: boolean; /** Flag to notify that the menu is a submenu */ isSubmenu?: boolean; /** Ref to the listbox/menu element */ listRef?: React.Ref; } declare const menuPopoverMiddleware: (width?: string, isButtonMenu?: boolean, isSubmenu?: boolean) => { name: string; options?: any; fn: (state: import("@floating-ui/dom").MiddlewareState) => import("@floating-ui/core").MiddlewareReturn | Promise; }[]; declare const PopoverMenu: (props: PopoverMenuProps & { ref?: React.ForwardedRef; }) => React.ReactElement; export default PopoverMenu;