securityos/node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs

18 lines
609 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
import { isVariantLabel } from '../../render/utils/is-variant-label.mjs';
import { isControllingVariants } from '../../render/utils/is-controlling-variants.mjs';
function getCurrentTreeVariants(props, context) {
if (isControllingVariants(props)) {
const { initial, animate } = props;
return {
initial: initial === false || isVariantLabel(initial)
? initial
: undefined,
animate: isVariantLabel(animate) ? animate : undefined,
};
}
return props.inherit !== false ? context : {};
}
export { getCurrentTreeVariants };