import React, { RefObject } from "react"; import { ModalProps } from "../../../../__internal__/modal"; import { TagProps } from "../../../../__internal__/utils/helpers/tags"; import { Size, ContentPaddingInterface } from "./dialog.config"; export type { Size, ContentPaddingInterface }; export interface DialogProps extends ModalProps, TagProps { /** Prop to specify the aria-describedby property of the Dialog component */ "aria-describedby"?: string; /** * Prop to specify the aria-label of the Dialog component. * To be used only when the title prop is not defined, and the component is not labelled by any internal element. */ "aria-label"?: string; /** * Prop to specify the aria-labelledby property of the Dialog component * To be used when the title prop is a custom React Node, * or the component is labelled by an internal element other than the title. */ "aria-labelledby"?: string; /** * Function to replace focus trap * @ignore * @private */ bespokeFocusTrap?: (ev: KeyboardEvent, firstElement?: HTMLElement, lastElement?: HTMLElement) => void; /** Child elements */ children?: React.ReactNode; /** * @private * @ignore * @internal * Sets className for component. INTERNAL USE ONLY. */ className?: string; /** Data tag prop bag for close Button */ closeButtonDataProps?: Pick; /** Padding to be set on the Dialog content */ contentPadding?: ContentPaddingInterface; /** Reference to the scrollable content element */ contentRef?: React.ForwardedRef; /** @private @internal @ignore */ "data-component"?: string; disableAutoFocus?: boolean; disableFocusTrap?: boolean; /** an optional array of refs to containers whose content should also be reachable by tabbing from the dialog */ focusableContainers?: RefObject[]; /** Optional selector to identify the focusable elements, if not provided a default selector is used */ focusableSelectors?: string; /** Optional reference to an element meant to be focused on open */ focusFirstElement?: RefObject | HTMLElement | null; /** Footer content to be rendered at the bottom of the dialog */ footer?: React.ReactNode; /** Change the background color of the content to grey */ greyBackground?: boolean; /** Container for components to be displayed in the header */ headerChildren?: React.ReactNode; /** Allows developers to specify a specific height for the dialog. */ height?: string; /** Adds Help tooltip to Header */ help?: string; /** Adds a gradient keyline to the dialog header */ gradientKeyLine?: boolean; /** A custom close event handler */ onCancel?: (ev: React.KeyboardEvent | KeyboardEvent | React.MouseEvent) => void; /** The ARIA role to be applied to the Dialog container */ role?: string; /** Determines if the close icon is shown */ showCloseIcon?: boolean; /** * Size of dialog following design system naming conventions. * - small: 288px min-width, 540px max-width * - medium: 540px min-width, 850px max-width (default) * - large: 850px min-width, 1080px max-width * - fullscreen: full viewport */ size?: Size; /** Makes the footer stick to the bottom of the dialog when content scrolls */ stickyFooter?: boolean; /** Subtitle displayed at top of dialog. Its consumers' responsibility to set a suitable accessible name/description for the Dialog if they pass a node to subtitle prop. */ subtitle?: React.ReactNode; /** Title displayed at top of dialog. Its consumers' responsibility to set a suitable accessible name/description for the Dialog if they pass a node to title prop. */ title?: React.ReactNode; /** * When true, header and sticky footer become unstickied for accessibility on small screen devices. * On small screen devices, the dialog becomes full width and has no dimmer. */ disableStickyOnSmallScreen?: boolean; disableContentPadding?: boolean; /** * @private * @ignore * @internal * Applies legacy Pages component styling for fullscreen dialogs. INTERNAL USE ONLY — consumed by the migration wrapper. */ pagesStyling?: boolean; } export type DialogHandle = { /** Programmatically focus on root container of Dialog. */ focus: () => void; } | null; export declare const Dialog: React.ForwardRefExoticComponent>; export default Dialog; export { default as withDialogHeader } from "./dialog-header/dialog-header.component"; export type { EnhancedDialogProps, DialogHeadingStatus, } from "./dialog-header/dialog-header.component";