import { ReactNode } from 'react'; /** * Dependency-free popup state primitive — a drop-in for the small slice of * `material-ui-popup-state` most apps use: a `PopupState` render-prop / `usePopupState` hook plus * `bindTrigger`/`bindPopper`/`bindPopover` helpers. `open`/`toggle` accept a React event or an * element and derive the anchor from `currentTarget`; the bind helpers produce the prop shapes * consumed by MUI `Popover`/`Popper` (and this library's `StyledPopover`). */ type PopupVariant = 'popover' | 'popper'; type OpenArg = React.SyntheticEvent | Element | null | undefined; export interface PopupState { isOpen: boolean; anchorEl: HTMLElement | undefined; popupId?: string; variant: PopupVariant; open: (eventOrAnchorEl?: OpenArg) => void; close: () => void; toggle: (eventOrAnchorEl?: OpenArg) => void; setAnchorEl: (el: HTMLElement | undefined) => void; } export type InjectedProps = PopupState; interface ControlAriaProps { 'aria-controls': string | undefined; 'aria-describedby': string | undefined; 'aria-haspopup': true | undefined; } type TriggerBindProps = ControlAriaProps & { onClick: PopupState['open']; onTouchStart: PopupState['open']; }; interface PopoverBindProps { anchorEl: HTMLElement | undefined; id: string | undefined; onClose: () => void; open: boolean; } interface PopperBindProps { anchorEl: HTMLElement | undefined; id: string | undefined; open: boolean; } export declare const usePopupState: ({ popupId, variant }: { popupId?: string; variant: PopupVariant; }) => PopupState; export declare const PopupState: ({ variant, popupId, children, }: { variant: PopupVariant; popupId?: string; children: (popupState: PopupState) => ReactNode; }) => JSX.Element; export declare const bindTrigger: (state: PopupState) => TriggerBindProps; export declare const bindPopover: (state: PopupState) => PopoverBindProps; export declare const bindPopper: (state: PopupState) => PopperBindProps; export {};