import type { FC, ReactNode } from "react"; import { ModalFooter } from "./components/ModalFooter"; import { ModalSection } from "./components/ModalSection"; import type { XOR } from "../../types"; export type ModalSizeVariant = "small" | "medium" | "large"; export type ModalLocale = { dismissText?: string; modalTitle?: string; }; interface ModalControlledProps { /** Define whether the modal is open or closed. */ open: boolean; /** The element that should receive focus once the `Modal` is closed. */ autoFocusOnCloseElement?: HTMLElement | null; } interface ModalUncontrolledProps { /** Button which should trigger the modal */ triggerButton: ReactNode; } export type ModalProps = XOR & { /** Descriptive title for `Modal`. */ title?: ReactNode; /** @ignore */ className?: string; /** Define whether the content should take up the full width of the `Modal`. */ fullBleed?: boolean; /** Define whether or not the modal should animate on show and hide. */ animate?: boolean; /** Define the size of the `Modal`. */ size?: ModalSizeVariant; /** Define whether or not the dismiss button should be hidden. */ hideCloseIcon?: boolean; /** Define whether or not the modal should be vertically aligned. */ centerY?: boolean; /** * Function triggered when the modal is dismissed. * This function is called when the user clicks the close button, * clicks outside the modal or presses the escape key. */ onDismiss?: () => void; /** The locale for the `Modal`. */ locale?: ModalLocale; /** * The element that should receive focus once the `Modal` is opened. * If unspecified, the first focusable element will be focused. * If an element is passed, it will be focused. * If 'skipContent' is passed, the close button will be focused if present, with a fallback on the dialog element itself. */ autoFocusOnOpenElement?: HTMLElement | null | "skipContent"; children: ReactNode; }; type ModalSubComponents = { Footer: typeof ModalFooter; Section: typeof ModalSection; }; /** * The `Modal` component is a dialog window that is used to display content on top of an application. * * See the [Modal documentation page](https://satellite.algolia.com/8261d6576/p/144213-modal) for more information. */ export declare const Modal: FC & ModalSubComponents; export {};