diff --git a/src/components/dropdown-menu/dropdown-menu.tsx b/src/components/dropdown-menu/dropdown-menu.tsx index 64370953..064d55ba 100644 --- a/src/components/dropdown-menu/dropdown-menu.tsx +++ b/src/components/dropdown-menu/dropdown-menu.tsx @@ -33,6 +33,7 @@ import { useMenuTrigger, } from './hooks'; import clsx from 'clsx'; +import { AnimatePresence, motion, Variants } from 'framer-motion'; const Root: FC> = ({ children, @@ -57,6 +58,7 @@ const Root: FC> = ({ padding: 8, }), ], + transform: false, }); const listNavigation = useListNavigation(context, { @@ -119,6 +121,22 @@ const Root: FC> = ({ ); }; +const contentMotionVariants = { + closed: { + scale: 0, + transition: { + delay: 0.15, + }, + }, + open: { + scale: 1, + transition: { + type: 'spring', + duration: 0.2, + }, + }, +} satisfies Variants; + const Content: FC = ({ children }) => { const { id, @@ -133,28 +151,37 @@ const Content: FC = ({ children }) => { return ( - {isOpen && ( - - -
- -
-
-
- )} + + + + + + + )} +
); };