import { Modal, ModalDialog, ModalOverflow } 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 = false, backdropBlur = true, ...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 }, }, }} > {children} ) } export default FadeModal