'use client'; import { jsx } from 'react/jsx-runtime'; import { motion } from 'framer-motion'; import { usePopoverContext } from './popover-context.mjs'; import { chakra } from '../system/factory.mjs'; import { forwardRef } from '../system/forward-ref.mjs'; function mergeVariants(variants) { if (!variants) return; return { enter: { ...variants.enter, visibility: "visible" }, exit: { ...variants.exit, transitionEnd: { visibility: "hidden" } } }; } const scaleFade = { exit: { opacity: 0, scale: 0.95, transition: { duration: 0.1, ease: [0.4, 0, 1, 1] } }, enter: { scale: 1, opacity: 1, transition: { duration: 0.15, ease: [0, 0, 0.2, 1] } } }; const MotionSection = chakra(motion.section); const PopoverTransition = forwardRef(function PopoverTransition2(props, ref) { const { variants = scaleFade, ...rest } = props; const { isOpen } = usePopoverContext(); return /* @__PURE__ */ jsx( MotionSection, { ref, variants: mergeVariants(variants), initial: false, animate: isOpen ? "enter" : "exit", ...rest } ); }); PopoverTransition.displayName = "PopoverTransition"; export { PopoverTransition };