@atlaskit/modal-dialog
Version:
A modal dialog displays content that requires user interaction, in a layer above the page.
31 lines (30 loc) • 1.1 kB
TypeScript
import { type Context } from 'react';
import { type ModalDialogProps, type OnCloseHandler } from '../types';
export type ModalAttributes = {
/**
* Test ID passed to the modal dialog.
*/
testId?: ModalDialogProps['testId'];
/**
* Id referenced by the modal dialog's `aria-labelledby` attribute.
* This id should be assigned to the modal title element.
*/
titleId: string;
/**
* Callback function called when the modal dialog is requesting to be closed,
* wrapped in modal dialog's analytic event context.
*/
onClose: OnCloseHandler;
/**
* A boolean for if the onClose is provided. We define a `noop` as our onClose
* at the top level, but we need to know if one is provided for the close
* button to be rendered.
*/
hasProvidedOnClose?: boolean;
/**
* Whether or not the modal is fullscreen (when `width="full"` is passed to the modal).
*/
isFullScreen: boolean;
};
export declare const ModalContext: Context<ModalAttributes | null>;
export declare const ScrollContext: Context<boolean | null>;