@unleashit/modal
Version:
Responsive modal component for React with custom header, footer and more.
32 lines (29 loc) • 1.6 kB
text/typescript
import React from 'react';
import { CSSVars } from '@unleashit/common';
type OverlayColor = {
light: string;
dark: string;
} | string | false;
interface ModalProps {
isOpen: boolean;
size?: 'small' | 'medium' | 'large' | 'full' | `${number}${(typeof cssUnits)[number]}`;
onClose?: (e?: React.MouseEvent) => void;
closeOnOverlayClick?: boolean;
animationSupport?: boolean;
animationCloseTimeout?: number;
header?: React.FC<any> | string;
footer?: React.FC<any> | string;
overlayColor?: OverlayColor;
closeBtn?: boolean;
darkMode?: boolean;
cssVars?: CSSVars<typeof varNames>;
cssModule?: Record<string, string>;
children?: React.ReactNode;
}
declare const cssUnits: readonly ["px", "%", "em", "rem", "vw", "vh", "vmin", "vmax"];
declare const varNames: readonly ["modalPadding", "lightModeOverlayColor", "darkModeOverlayColor", "lightModeTextColor", "darkModeTextColor", "lightModeBackgroundColor", "darkModeBackgroundColor", "lightModeHeaderColor", "darkModeHeaderColor", "lightModeHeaderShadow", "darkModeHeaderShadow", "lightModeBorderColor", "darkModeBorderColor", "smallWidth", "mediumWidth", "largeWidth", "fullWidth", "modalYPosition", "breakXs", "breakSm", "breakMd", "breakLg"];
declare const Modal: {
({ isOpen, size, onClose, closeBtn, closeOnOverlayClick, animationSupport, animationCloseTimeout, header: Header, footer: Footer, overlayColor, darkMode, cssVars, cssModule, children, }: ModalProps): JSX.Element | null;
displayName: string;
};
export { Modal, type ModalProps, type OverlayColor, Modal as default };