extract list expansion container to separate component

This commit is contained in:
jeffvli
2025-10-07 17:44:55 -07:00
parent a068b9ca3d
commit 4600e56b94
6 changed files with 42 additions and 41 deletions
@@ -0,0 +1,32 @@
import { motion, Variants } from 'motion/react';
import { ReactNode } from 'react';
import styles from './expanded-list-container.module.css';
const expandedAnimationVariants: Variants = {
hidden: {
height: 0,
minHeight: 0,
},
show: {
minHeight: '300px',
transition: {
duration: 0.3,
ease: 'easeInOut',
},
},
};
export const ExpandedListContainer = ({ children }: { children: ReactNode }) => {
return (
<motion.div
animate="show"
className={styles.listExpandedContainer}
exit="hidden"
initial="hidden"
variants={expandedAnimationVariants}
>
{children}
</motion.div>
);
};