import { Modal, ModalClose, ModalDialog, ModalOverflow, Typography } from '@mui/joy' import { Z_INDEX } from '../../constants/zIndex' /** * FadeModal component with consistent fade-in/out animations * Can be used as a drop-in replacement for Joy UI's Modal component */ const FadeModal = ({ open, onClose, children, size = 'md', fullWidth = true, backdropBlur = true, title, footer, ...props }) => { // Filter out props that shouldn't be passed to Modal const { unmountDelay: _unmountDelay, ...modalProps } = props return ( *': { opacity: 0, animation: open ? 'contentFadeIn 0.35s forwards' : 'contentFadeOut 0.2s forwards', }, // Stagger child animations '& > *:nth-of-type(1)': { animationDelay: '0.05s' }, '& > *:nth-of-type(2)': { animationDelay: '0.1s' }, '& > *:nth-of-type(3)': { animationDelay: '0.15s' }, '& > *:nth-of-type(4)': { animationDelay: '0.2s' }, '& > *:nth-of-type(5)': { animationDelay: '0.25s' }, '@keyframes contentFadeIn': { to: { opacity: 1 }, }, '@keyframes contentFadeOut': { to: { opacity: 0 }, }, }} > {title && ( {title} )}
{children}
{footer &&
{footer}
}
) } export default FadeModal