import type { AriaAttributes, RefObject } from "react"; import React from "react"; import type { Property } from "csstype"; import type { PortalProps } from "../../Portal/Portal"; import type { StackProps } from "../../Stack/Stack"; import type { ButtonGroupButtonProps } from "../ButtonGroup/ButtonGroup"; import type { TextProps } from "../../Typography/Text/Text"; type BaseProps = { onAction?: (action: "cancel" | "action") => void; role?: "dialog" | "alertdialog"; labelHeader?: string; /** The black color is going to be replaced with gray one */ subHeader?: string; /** Text and other props for action Button */ actionButton?: ButtonGroupButtonProps; /** Text and other props for action Button */ secondaryButton?: ButtonGroupButtonProps; /** @deprecated Use secondaryButton to pass in text and other props for secondary button */ cancelButtonLabel?: string; /** Aim to use and */ children?: React.ReactNode; "data-e2e-test-id"?: string; privateProps?: { skipPortal?: boolean; /** * @internal * Constrains Modal body to available height (applies flex: 1) even with size="m". * Prevents Modal itself from scrolling - instead internal content panels scroll. * Normally only size="l" gets this layout behavior. */ height?: Property.Height; /** * @internal * Removes all horizontal and vertical padding from modal content area. * Use for edge-to-edge content with custom internal spacing. */ zeroPadding?: boolean; /** * @internal * Options passed to focus-trap's tabbable detection. * Use `{ displayCheck: "none" }` for testing to avoid JSDOM visibility issues. */ tabbableOptions?: { displayCheck?: "full" | "legacy-full" | "non-zero-area" | "none"; }; }; /** It's a bad pattern to use non-dismissible Modal */ isDismissible?: boolean; isFullScreen?: boolean; isMaxWidthLimit?: boolean; size?: "m" | "l"; closeButtonAriaLabel?: string; /** * Determines which element receives focus when the modal opens. * - Pass a **RefObject** to focus a specific custom element. * - Pass a string that will act as css selector to focus that specific element * For and actionButton, secondaryButton, pass a ref to those elements and to this prop * For closeButton focus, pass "[data-modal-close-btn]" * - If **undefined**, focus falls back to the first focusable element in the modal. */ initialFocus?: RefObject | string; } & Omit; /** At least one of header, aria-label, or aria-labelledby must be provided for accessibility */ type LabelProps = { header: string; "aria-label"?: string; "aria-labelledby"?: string; } | { header?: string; "aria-label": string; "aria-labelledby"?: string; } | { header?: string; "aria-label"?: string; "aria-labelledby": string; }; type ConditionalProps = { /** Aspect ratio 16:9 */ imageUrl?: string; imageAlt?: string; ImageComponent?: never; } | { imageUrl?: never; imageAlt?: never; /** Accept ratio 16:9 */ ImageComponent?: React.ElementType; }; export type ModalProps = BaseProps & LabelProps & ConditionalProps & Pick; export declare function Modal({ header, subHeader, labelHeader, children, imageUrl, ImageComponent, secondaryButton, cancelButtonLabel, isDismissible, isFullScreen, isMaxWidthLimit, actionButton, role, onAction, size, privateProps: { skipPortal, height, zeroPadding, tabbableOptions }, portalContainer, closeButtonAriaLabel, "data-e2e-test-id": dataE2eTestId, imageAlt, initialFocus, ...ariaAttributes }: ModalProps): React.ReactElement; export declare namespace Modal { var Stack: ({ children, ...rest }: Omit) => React.JSX.Element; var Text: ({ children, ...rest }: Omit) => React.JSX.Element; } export {};