@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
71 lines (70 loc) • 2.56 kB
TypeScript
import React, { type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ReactNode } from 'react';
export interface ModalBodyProps extends HTMLAttributes<HTMLDivElement> {
/** Specify the content to be placed in the ModalBody. */
children?: ReactNode;
/**
* Provide whether the modal content has a form element.
* If `true` is used here, non-form child content should have `bx--modal-content__regular-content` class.
*/
hasForm?: boolean;
/**
* Specify whether the modal contains scrolling content
*/
hasScrollingContent?: boolean;
}
export declare const ModalBody: React.ForwardRefExoticComponent<ModalBodyProps & React.RefAttributes<HTMLDivElement>>;
export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
/**
* Specify the aria-label for bx--modal-container
*/
'aria-label'?: string;
/**
* Specify the aria-labelledby for bx--modal-container
*/
'aria-labelledby'?: string;
/**
* Specify the content to be placed in the ComposedModal
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the modal root node
*/
className?: string;
/**
* Specify an optional className to be applied to the modal node
*/
containerClassName?: string;
/**
* Specify whether the primary button should be replaced with danger button.
* Note that this prop is not applied if you render primary/danger button by yourself
*/
danger?: boolean;
/**
* Specify whether the Modal content should have any inner padding.
*/
isFullWidth?: boolean;
/**
* Specify an optional handler for closing modal.
* Returning `false` here prevents closing modal.
*/
onClose?(event: MouseEvent): void | boolean;
/**
* Called for all `onKeyDown` events that do not close the modal
*/
onKeyDown?(evt: KeyboardEvent): void;
/**
* Specify whether the Modal is currently open
*/
open?: boolean;
preventCloseOnClickOutside?: boolean;
/**
* Specify a CSS selector that matches the DOM element that should be
* focused when the Modal opens
*/
selectorPrimaryFocus?: string;
/** Specify the CSS selectors that match the floating menus. */
selectorsFloatingMenus?: Array<string | null | undefined>;
size?: 'xs' | 'sm' | 'md' | 'lg';
}
declare const ComposedModal: React.ForwardRefExoticComponent<ComposedModalProps & React.RefAttributes<HTMLDivElement>>;
export default ComposedModal;