@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
1 lines • 7.49 kB
Source Map (JSON)
{"version":3,"file":"transitions.cjs","names":[],"sources":["../../../src/components/Transition/transitions.ts"],"sourcesContent":["export interface MantineTransitionStyles {\n common?: React.CSSProperties;\n in: React.CSSProperties;\n out: React.CSSProperties;\n transitionProperty: React.CSSProperties['transitionProperty'];\n}\n\nexport type MantineTransitionName =\n | 'fade'\n | 'fade-down'\n | 'fade-up'\n | 'fade-left'\n | 'fade-right'\n | 'skew-up'\n | 'skew-down'\n | 'rotate-right'\n | 'rotate-left'\n | 'slide-down'\n | 'slide-up'\n | 'slide-right'\n | 'slide-left'\n | 'scale-y'\n | 'scale-x'\n | 'scale'\n | 'pop'\n | 'pop-top-left'\n | 'pop-top-right'\n | 'pop-bottom-left'\n | 'pop-bottom-right';\n\nexport type MantineTransition = MantineTransitionName | MantineTransitionStyles;\n\nconst popIn = (from: 'top' | 'bottom') => ({\n in: { opacity: 1, transform: 'scale(1)' },\n out: { opacity: 0, transform: `scale(.9) translateY(${from === 'bottom' ? 10 : -10}px)` },\n transitionProperty: 'transform, opacity',\n});\n\nexport const transitions: Record<MantineTransitionName, MantineTransitionStyles> = {\n fade: {\n in: { opacity: 1 },\n out: { opacity: 0 },\n transitionProperty: 'opacity',\n },\n\n 'fade-up': {\n in: { opacity: 1, transform: 'translateY(0)' },\n out: { opacity: 0, transform: 'translateY(30px)' },\n transitionProperty: 'opacity, transform',\n },\n\n 'fade-down': {\n in: { opacity: 1, transform: 'translateY(0)' },\n out: { opacity: 0, transform: 'translateY(-30px)' },\n transitionProperty: 'opacity, transform',\n },\n\n 'fade-left': {\n in: { opacity: 1, transform: 'translateX(0)' },\n out: { opacity: 0, transform: 'translateX(30px)' },\n transitionProperty: 'opacity, transform',\n },\n\n 'fade-right': {\n in: { opacity: 1, transform: 'translateX(0)' },\n out: { opacity: 0, transform: 'translateX(-30px)' },\n transitionProperty: 'opacity, transform',\n },\n\n scale: {\n in: { opacity: 1, transform: 'scale(1)' },\n out: { opacity: 0, transform: 'scale(0)' },\n common: { transformOrigin: 'top' },\n transitionProperty: 'transform, opacity',\n },\n\n 'scale-y': {\n in: { opacity: 1, transform: 'scaleY(1)' },\n out: { opacity: 0, transform: 'scaleY(0)' },\n common: { transformOrigin: 'top' },\n transitionProperty: 'transform, opacity',\n },\n\n 'scale-x': {\n in: { opacity: 1, transform: 'scaleX(1)' },\n out: { opacity: 0, transform: 'scaleX(0)' },\n common: { transformOrigin: 'left' },\n transitionProperty: 'transform, opacity',\n },\n\n 'skew-up': {\n in: { opacity: 1, transform: 'translateY(0) skew(0deg, 0deg)' },\n out: { opacity: 0, transform: 'translateY(-20px) skew(-10deg, -5deg)' },\n common: { transformOrigin: 'top' },\n transitionProperty: 'transform, opacity',\n },\n\n 'skew-down': {\n in: { opacity: 1, transform: 'translateY(0) skew(0deg, 0deg)' },\n out: { opacity: 0, transform: 'translateY(20px) skew(-10deg, -5deg)' },\n common: { transformOrigin: 'bottom' },\n transitionProperty: 'transform, opacity',\n },\n\n 'rotate-left': {\n in: { opacity: 1, transform: 'translateY(0) rotate(0deg)' },\n out: { opacity: 0, transform: 'translateY(20px) rotate(-5deg)' },\n common: { transformOrigin: 'bottom' },\n transitionProperty: 'transform, opacity',\n },\n\n 'rotate-right': {\n in: { opacity: 1, transform: 'translateY(0) rotate(0deg)' },\n out: { opacity: 0, transform: 'translateY(20px) rotate(5deg)' },\n common: { transformOrigin: 'top' },\n transitionProperty: 'transform, opacity',\n },\n\n 'slide-down': {\n in: { opacity: 1, transform: 'translateY(0)' },\n out: { opacity: 0, transform: 'translateY(-100%)' },\n common: { transformOrigin: 'top' },\n transitionProperty: 'transform, opacity',\n },\n\n 'slide-up': {\n in: { opacity: 1, transform: 'translateY(0)' },\n out: { opacity: 0, transform: 'translateY(100%)' },\n common: { transformOrigin: 'bottom' },\n transitionProperty: 'transform, opacity',\n },\n\n 'slide-left': {\n in: { opacity: 1, transform: 'translateX(0)' },\n out: { opacity: 0, transform: 'translateX(100%)' },\n common: { transformOrigin: 'left' },\n transitionProperty: 'transform, opacity',\n },\n\n 'slide-right': {\n in: { opacity: 1, transform: 'translateX(0)' },\n out: { opacity: 0, transform: 'translateX(-100%)' },\n common: { transformOrigin: 'right' },\n transitionProperty: 'transform, opacity',\n },\n\n pop: {\n ...popIn('bottom'),\n common: { transformOrigin: 'center center' },\n },\n\n 'pop-bottom-left': {\n ...popIn('bottom'),\n common: { transformOrigin: 'bottom left' },\n },\n\n 'pop-bottom-right': {\n ...popIn('bottom'),\n common: { transformOrigin: 'bottom right' },\n },\n\n 'pop-top-left': {\n ...popIn('top'),\n common: { transformOrigin: 'top left' },\n },\n\n 'pop-top-right': {\n ...popIn('top'),\n common: { transformOrigin: 'top right' },\n },\n};\n"],"mappings":";;AAgCA,MAAM,SAAS,UAA4B;CACzC,IAAI;EAAE,SAAS;EAAG,WAAW;EAAY;CACzC,KAAK;EAAE,SAAS;EAAG,WAAW,wBAAwB,SAAS,WAAW,KAAK,IAAI;EAAM;CACzF,oBAAoB;CACrB;AAED,MAAa,cAAsE;CACjF,MAAM;EACJ,IAAI,EAAE,SAAS,GAAG;EAClB,KAAK,EAAE,SAAS,GAAG;EACnB,oBAAoB;EACrB;CAED,WAAW;EACT,IAAI;GAAE,SAAS;GAAG,WAAW;GAAiB;EAC9C,KAAK;GAAE,SAAS;GAAG,WAAW;GAAoB;EAClD,oBAAoB;EACrB;CAED,aAAa;EACX,IAAI;GAAE,SAAS;GAAG,WAAW;GAAiB;EAC9C,KAAK;GAAE,SAAS;GAAG,WAAW;GAAqB;EACnD,oBAAoB;EACrB;CAED,aAAa;EACX,IAAI;GAAE,SAAS;GAAG,WAAW;GAAiB;EAC9C,KAAK;GAAE,SAAS;GAAG,WAAW;GAAoB;EAClD,oBAAoB;EACrB;CAED,cAAc;EACZ,IAAI;GAAE,SAAS;GAAG,WAAW;GAAiB;EAC9C,KAAK;GAAE,SAAS;GAAG,WAAW;GAAqB;EACnD,oBAAoB;E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