UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

138 lines (134 loc) 4.76 kB
'use client'; 'use strict'; var rem = require('../../core/utils/units-converters/rem.cjs'); require('react'); require('react/jsx-runtime'); require('@mantine/hooks'); require('clsx'); require('../../core/MantineProvider/Mantine.context.cjs'); require('../../core/MantineProvider/default-theme.cjs'); require('../../core/MantineProvider/MantineProvider.cjs'); require('../../core/MantineProvider/MantineThemeProvider/MantineThemeProvider.cjs'); require('../../core/MantineProvider/MantineCssVariables/MantineCssVariables.cjs'); require('../../core/Box/Box.cjs'); require('../../core/DirectionProvider/DirectionProvider.cjs'); const popIn = (from) => ({ in: { opacity: 1, transform: "scale(1)" }, out: { opacity: 0, transform: `scale(.9) translateY(${rem.rem(from === "bottom" ? 10 : -10)})` }, transitionProperty: "transform, opacity" }); const transitions = { fade: { in: { opacity: 1 }, out: { opacity: 0 }, transitionProperty: "opacity" }, "fade-up": { in: { opacity: 1, transform: "translateY(0)" }, out: { opacity: 0, transform: `translateY(${rem.rem(30)}` }, transitionProperty: "opacity, transform" }, "fade-down": { in: { opacity: 1, transform: "translateY(0)" }, out: { opacity: 0, transform: `translateY(${rem.rem(-30)}` }, transitionProperty: "opacity, transform" }, "fade-left": { in: { opacity: 1, transform: "translateX(0)" }, out: { opacity: 0, transform: `translateX(${rem.rem(30)}` }, transitionProperty: "opacity, transform" }, "fade-right": { in: { opacity: 1, transform: "translateX(0)" }, out: { opacity: 0, transform: `translateX(${rem.rem(-30)}` }, transitionProperty: "opacity, transform" }, scale: { in: { opacity: 1, transform: "scale(1)" }, out: { opacity: 0, transform: "scale(0)" }, common: { transformOrigin: "top" }, transitionProperty: "transform, opacity" }, "scale-y": { in: { opacity: 1, transform: "scaleY(1)" }, out: { opacity: 0, transform: "scaleY(0)" }, common: { transformOrigin: "top" }, transitionProperty: "transform, opacity" }, "scale-x": { in: { opacity: 1, transform: "scaleX(1)" }, out: { opacity: 0, transform: "scaleX(0)" }, common: { transformOrigin: "left" }, transitionProperty: "transform, opacity" }, "skew-up": { in: { opacity: 1, transform: "translateY(0) skew(0deg, 0deg)" }, out: { opacity: 0, transform: `translateY(${rem.rem(-20)}) skew(-10deg, -5deg)` }, common: { transformOrigin: "top" }, transitionProperty: "transform, opacity" }, "skew-down": { in: { opacity: 1, transform: "translateY(0) skew(0deg, 0deg)" }, out: { opacity: 0, transform: `translateY(${rem.rem(20)}) skew(-10deg, -5deg)` }, common: { transformOrigin: "bottom" }, transitionProperty: "transform, opacity" }, "rotate-left": { in: { opacity: 1, transform: "translateY(0) rotate(0deg)" }, out: { opacity: 0, transform: `translateY(${rem.rem(20)}) rotate(-5deg)` }, common: { transformOrigin: "bottom" }, transitionProperty: "transform, opacity" }, "rotate-right": { in: { opacity: 1, transform: "translateY(0) rotate(0deg)" }, out: { opacity: 0, transform: `translateY(${rem.rem(20)}) rotate(5deg)` }, common: { transformOrigin: "top" }, transitionProperty: "transform, opacity" }, "slide-down": { in: { opacity: 1, transform: "translateY(0)" }, out: { opacity: 0, transform: "translateY(-100%)" }, common: { transformOrigin: "top" }, transitionProperty: "transform, opacity" }, "slide-up": { in: { opacity: 1, transform: "translateY(0)" }, out: { opacity: 0, transform: "translateY(100%)" }, common: { transformOrigin: "bottom" }, transitionProperty: "transform, opacity" }, "slide-left": { in: { opacity: 1, transform: "translateX(0)" }, out: { opacity: 0, transform: "translateX(100%)" }, common: { transformOrigin: "left" }, transitionProperty: "transform, opacity" }, "slide-right": { in: { opacity: 1, transform: "translateX(0)" }, out: { opacity: 0, transform: "translateX(-100%)" }, common: { transformOrigin: "right" }, transitionProperty: "transform, opacity" }, pop: { ...popIn("bottom"), common: { transformOrigin: "center center" } }, "pop-bottom-left": { ...popIn("bottom"), common: { transformOrigin: "bottom left" } }, "pop-bottom-right": { ...popIn("bottom"), common: { transformOrigin: "bottom right" } }, "pop-top-left": { ...popIn("top"), common: { transformOrigin: "top left" } }, "pop-top-right": { ...popIn("top"), common: { transformOrigin: "top right" } } }; exports.transitions = transitions; //# sourceMappingURL=transitions.cjs.map