import React from 'react'; import { BoxSystemProps } from './Box'; import { StyleConfig } from '../utils/styleConfig'; import { FocusableTarget } from '../utils/createFocusTrap'; export declare type DialogParts = { wrapper: ''; content: 'enter' | 'opened' | 'exit'; overlay: 'enter' | 'opened' | 'exit'; }; declare type DialogDOMProps = React.ComponentPropsWithRef<'div'>; declare type DialogStyleConfigProp = { styleConfig?: StyleConfig; }; declare type DialogSystemProps = BoxSystemProps; declare type DialogOwnProps = { /** whether the Dialog is currently opened or not */ isOpen: boolean; /** A function called when the Dialog is closed from the inside (escape / outslide click) */ onClose?: () => void; /** * A ref to an element to focus on inside the Dialog after it is opened. * (default: first focusable element inside the Dialog) * (fallback: first focusable element inside the Dialog, then the Dialog's content container) */ refToFocusOnOpen?: React.RefObject; /** * A ref to an element to focus on outside the Dialog after it is closed. * (default: last focused element before the Dialog was opened) * (fallback: none) */ refToFocusOnClose?: React.RefObject; /** * Whether pressing the `Escape` key should close the Dialog * (default: `true`) */ shouldCloseOnEscape?: boolean; /** * Whether clicking outside the Dialog should close it * (default: `true`) */ shouldCloseOnOutsideClick?: boolean | ((event: MouseEvent | TouchEvent) => boolean); }; export declare type DialogProps = DialogDOMProps & DialogStyleConfigProp & DialogSystemProps & DialogOwnProps & { as?: React.ElementType; }; export declare const Dialog: React.ForwardRefExoticComponent & React.RefAttributes>; export {};