@sky-mavis/tanto-widget
Version:
Tanto Widget
35 lines • 723 B
JavaScript
import {jsx}from'@emotion/react/jsx-runtime';import {AnimatePresence}from'motion/react';import*as m from'motion/react-m';const defaultProps = {
initial: {
opacity: 0,
scale: 0
},
animate: {
opacity: 1,
scale: 1
},
exit: {
opacity: 0,
scale: 0
},
transition: {
duration: 0.15
}
};
const Fade = ({
children,
initial,
animate,
exit,
transition,
show
}) => {
return jsx(AnimatePresence, {
children: show && jsx(m.div, {
initial: initial || defaultProps.initial,
animate: animate || defaultProps.animate,
exit: exit || defaultProps.exit,
transition: transition || defaultProps.transition,
children: children
})
});
};export{Fade};