import { AriaModalOverlayProps } from 'react-aria/useModalOverlay'; import { ClassNameOrFunction, ContextValue, RenderProps, SlotProps } from './utils'; import { DOMAttributes, GlobalDOMAttributes, RefObject } from '@react-types/shared'; import { OverlayTriggerProps, OverlayTriggerState } from 'react-stately/useOverlayTriggerState'; import React from 'react'; export interface ModalOverlayProps extends AriaModalOverlayProps, OverlayTriggerProps, RenderProps, SlotProps, GlobalDOMAttributes { /** * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the * element. A function may be provided to compute the class based on component state. * * @default 'react-aria-ModalOverlay' */ className?: ClassNameOrFunction; /** * Whether the modal is currently performing an entry animation. */ isEntering?: boolean; /** * Whether the modal is currently performing an exit animation. */ isExiting?: boolean; /** * Callback when the modal starts entering. Return a promise to indicate when the entry animation * has completed. */ onEnter?: (element: HTMLElement) => void | Promise; /** * Callback when the modal starts exiting. Return a promise to indicate when the exit animation * has completed. */ onExit?: (element: HTMLElement) => void | Promise; /** * The container element in which the overlay portal will be placed. This may have unknown * behavior depending on where it is portalled to. * * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead. * @default document.body */ UNSTABLE_portalContainer?: Element; /** * Whether to wait until the entry animation completes before hiding content outside the modal * and moving focus into it. * * @private */ UNSTABLE_deferUntilEntered?: boolean; } interface InternalModalContextValue { modalProps: DOMAttributes; modalRef: RefObject; isOpen: boolean; isExiting: boolean; isDismissable?: boolean; onExitRef?: RefObject; } export declare const ModalContext: React.Context>; export declare const InternalModalContext: React.Context; export interface ModalRenderProps { /** * Whether the modal is currently entering. Use this to apply animations. * * @selector [data-entering] */ isEntering: boolean; /** * Whether the modal is currently exiting. Use this to apply animations. * * @selector [data-exiting] */ isExiting: boolean; /** * State of the modal. */ state: OverlayTriggerState; } /** * A modal is an overlay element which blocks interaction with elements outside it. */ export declare const Modal: (props: ModalOverlayProps & React.RefAttributes) => React.ReactElement | null; /** * A ModalOverlay is a wrapper for a Modal which allows customizing the backdrop element. */ export declare const ModalOverlay: (props: ModalOverlayProps & React.RefAttributes) => React.ReactElement | null; export {};