UNPKG

@drivy/cobalt

Version:

Opinionated design system for Drivy's projects.

79 lines (78 loc) 2.28 kB
import React from "react"; import { ModalFooterPropsType } from "./ModalFooter"; export type ModalPropsType = { /** * mandatory for A11y */ ["aria-label"]: string; /** * Function called to close the modal, providing it make the modal closeable */ close?: () => void; /** * React.ref of the element to focus first when the modal opens */ initialFocusRef?: React.RefObject<HTMLElement>; /** * State to show or hide the modal/dialog */ isOpen: boolean; /** * Custom css classes to add to the modal */ className?: string; /** * Action to fire if the user try to dismiss when the modal is not closeable */ onDismissAttempt?: () => void; /** * Listener called when the modal has been fully hidden */ onHidden?: () => void; /** * Listener called when the modal begins to show */ onShow?: () => void; /** * Modal title */ title?: React.ReactNode; /** * Disable/Enable body paddings (enabled by default) */ bodySpacing?: boolean; /** * Disable/Enable hidding overflowing absolute elements (enabled by default) */ overflowHidden?: boolean; /** * Disable enter/leave animation (animation enabled by default) */ skipAnimation?: { enter: boolean; leave: boolean; }; /** * Disable modal max-width limit */ fullWidth?: boolean; /** * Always take the full height of the screen */ fullHeight?: boolean; /** * Remove the modal from the DOM on hidden (enabled by default) */ unmountOnHidden?: boolean; /** * Modal body content */ children: React.ReactNode; }; export declare const ModalFooterAPI: (_props: ModalFooterPropsType) => null; export declare const isModalFooterAPIComponent: (component: React.ReactNode) => component is React.ReactElement<ModalFooterPropsType, string | React.JSXElementConstructor<any>>; declare const _default: React.ForwardRefExoticComponent<ModalPropsType & React.RefAttributes<HTMLDivElement>> & { Footer: (_props: ModalFooterPropsType) => null; }; export default _default; export { default as MultiStepModal, type ModalStepType } from "./MultiStepModal";