UNPKG

react-elegant-ui

Version:

Elegant UI components, made by BEM best practices for react

29 lines (28 loc) 797 B
import { FC, RefObject, ReactNode } from 'react'; export type OnClose = (event: KeyboardEvent | MouseEvent, source: 'esc' | 'click') => void; export type LayerManagerProps = { /** * Layer visibility */ visible?: boolean; /** * Handler that call while close layer by esc key or by mouse click outside */ onClose?: OnClose; /** * Array of Refs to DOM nodes who should not handle interactions to close */ essentialRefs: RefObject<HTMLElement>[]; /** * Layer content */ children: ReactNode; }; /** * Component to manage layers of pop-up components like `Popup` or `Modal` * * It allow close elements in that order what it did open * * @param {LayerManagerProps} */ export declare const LayerManager: FC<LayerManagerProps>;