@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
125 lines (122 loc) • 4.08 kB
JavaScript
'use client';
'use strict';
const popIn = (from) => ({
in: { opacity: 1, transform: "scale(1)" },
out: { opacity: 0, transform: `scale(.9) translateY(${from === "bottom" ? 10 : -10}px)` },
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(30px)" },
transitionProperty: "opacity, transform"
},
"fade-down": {
in: { opacity: 1, transform: "translateY(0)" },
out: { opacity: 0, transform: "translateY(-30px)" },
transitionProperty: "opacity, transform"
},
"fade-left": {
in: { opacity: 1, transform: "translateX(0)" },
out: { opacity: 0, transform: "translateX(30px)" },
transitionProperty: "opacity, transform"
},
"fade-right": {
in: { opacity: 1, transform: "translateX(0)" },
out: { opacity: 0, transform: "translateX(-30px)" },
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(-20px) 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(20px) skew(-10deg, -5deg)" },
common: { transformOrigin: "bottom" },
transitionProperty: "transform, opacity"
},
"rotate-left": {
in: { opacity: 1, transform: "translateY(0) rotate(0deg)" },
out: { opacity: 0, transform: "translateY(20px) rotate(-5deg)" },
common: { transformOrigin: "bottom" },
transitionProperty: "transform, opacity"
},
"rotate-right": {
in: { opacity: 1, transform: "translateY(0) rotate(0deg)" },
out: { opacity: 0, transform: "translateY(20px) 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