@kopexa/motion-utils 8.0.2 → 8.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-7S4HQXW4.mjs → chunk-3MF4JB5V.mjs} +28 -0
- package/dist/index.js +28 -0
- package/dist/index.mjs +1 -1
- package/dist/transition-utils.d.mts +53 -9
- package/dist/transition-utils.d.ts +53 -9
- package/dist/transition-utils.js +28 -0
- package/dist/transition-utils.mjs +1 -1
- package/package.json +4 -4
|
@@ -36,6 +36,34 @@ var TRANSITION_VARIANTS = {
|
|
|
36
36
|
ease: TRANSITION_EASINGS.ease
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
},
|
|
40
|
+
scaleSpringOpacity: {
|
|
41
|
+
initial: {
|
|
42
|
+
opacity: 0,
|
|
43
|
+
transform: "scale(0.8)"
|
|
44
|
+
},
|
|
45
|
+
enter: {
|
|
46
|
+
opacity: 1,
|
|
47
|
+
transform: "scale(1)",
|
|
48
|
+
transition: {
|
|
49
|
+
type: "spring",
|
|
50
|
+
bounce: 0,
|
|
51
|
+
duration: 0.3
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
exit: {
|
|
55
|
+
opacity: 0,
|
|
56
|
+
transform: "scale(0.96)",
|
|
57
|
+
transition: {
|
|
58
|
+
ease: TRANSITION_EASINGS.easeOut,
|
|
59
|
+
bounce: 0,
|
|
60
|
+
duration: 0.15
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
scale: {
|
|
65
|
+
enter: { scale: 1 },
|
|
66
|
+
exit: { scale: 0.95 }
|
|
39
67
|
}
|
|
40
68
|
};
|
|
41
69
|
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,34 @@ var TRANSITION_VARIANTS = {
|
|
|
63
63
|
ease: TRANSITION_EASINGS.ease
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
+
},
|
|
67
|
+
scaleSpringOpacity: {
|
|
68
|
+
initial: {
|
|
69
|
+
opacity: 0,
|
|
70
|
+
transform: "scale(0.8)"
|
|
71
|
+
},
|
|
72
|
+
enter: {
|
|
73
|
+
opacity: 1,
|
|
74
|
+
transform: "scale(1)",
|
|
75
|
+
transition: {
|
|
76
|
+
type: "spring",
|
|
77
|
+
bounce: 0,
|
|
78
|
+
duration: 0.3
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
exit: {
|
|
82
|
+
opacity: 0,
|
|
83
|
+
transform: "scale(0.96)",
|
|
84
|
+
transition: {
|
|
85
|
+
ease: TRANSITION_EASINGS.easeOut,
|
|
86
|
+
bounce: 0,
|
|
87
|
+
duration: 0.15
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
scale: {
|
|
92
|
+
enter: { scale: 1 },
|
|
93
|
+
exit: { scale: 0.95 }
|
|
66
94
|
}
|
|
67
95
|
};
|
|
68
96
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transition, Target,
|
|
1
|
+
import { Transition, Target, Variants as Variants$1 } from 'motion';
|
|
2
2
|
|
|
3
3
|
type WithMotionState<P> = Partial<Record<"enter" | "exit", P>>;
|
|
4
4
|
type TransitionConfig = WithMotionState<Transition>;
|
|
@@ -13,13 +13,6 @@ type TransitionProperties = {
|
|
|
13
13
|
*/
|
|
14
14
|
transitionEnd?: TransitionEndConfig;
|
|
15
15
|
};
|
|
16
|
-
type TargetResolver<P = object> = (props: P & TransitionProperties) => TargetAndTransition;
|
|
17
|
-
type Variant<P = object> = TargetAndTransition | TargetResolver<P>;
|
|
18
|
-
type Variants<P = object> = Record<string, {
|
|
19
|
-
enter: Variant<P>;
|
|
20
|
-
exit: Variant<P>;
|
|
21
|
-
initial?: Variant<P>;
|
|
22
|
-
}>;
|
|
23
16
|
declare const TRANSITION_EASINGS: {
|
|
24
17
|
readonly ease: readonly [0.36, 0.66, 0.4, 1];
|
|
25
18
|
readonly easeIn: readonly [0.4, 0, 1, 1];
|
|
@@ -39,6 +32,57 @@ declare const TRANSITION_DEFAULTS: {
|
|
|
39
32
|
readonly ease: readonly [0.4, 0, 1, 1];
|
|
40
33
|
};
|
|
41
34
|
};
|
|
42
|
-
|
|
35
|
+
type VariantTypes = "fade" | "scaleSpringOpacity" | "scale";
|
|
36
|
+
type Variants = Record<VariantTypes, Variants$1>;
|
|
37
|
+
declare const TRANSITION_VARIANTS: {
|
|
38
|
+
fade: {
|
|
39
|
+
enter: {
|
|
40
|
+
opacity: number;
|
|
41
|
+
transition: {
|
|
42
|
+
duration: number;
|
|
43
|
+
ease: readonly [0.36, 0.66, 0.4, 1];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exit: {
|
|
47
|
+
opacity: number;
|
|
48
|
+
transition: {
|
|
49
|
+
duration: number;
|
|
50
|
+
ease: readonly [0.36, 0.66, 0.4, 1];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
scaleSpringOpacity: {
|
|
55
|
+
initial: {
|
|
56
|
+
opacity: number;
|
|
57
|
+
transform: string;
|
|
58
|
+
};
|
|
59
|
+
enter: {
|
|
60
|
+
opacity: number;
|
|
61
|
+
transform: string;
|
|
62
|
+
transition: {
|
|
63
|
+
type: "spring";
|
|
64
|
+
bounce: number;
|
|
65
|
+
duration: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
exit: {
|
|
69
|
+
opacity: number;
|
|
70
|
+
transform: string;
|
|
71
|
+
transition: {
|
|
72
|
+
ease: readonly [0, 0, 0.2, 1];
|
|
73
|
+
bounce: number;
|
|
74
|
+
duration: number;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
scale: {
|
|
79
|
+
enter: {
|
|
80
|
+
scale: number;
|
|
81
|
+
};
|
|
82
|
+
exit: {
|
|
83
|
+
scale: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
43
87
|
|
|
44
88
|
export { TRANSITION_DEFAULTS, TRANSITION_EASINGS, TRANSITION_VARIANTS, type TransitionConfig, type TransitionEndConfig, type TransitionProperties, type Variants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Transition, Target,
|
|
1
|
+
import { Transition, Target, Variants as Variants$1 } from 'motion';
|
|
2
2
|
|
|
3
3
|
type WithMotionState<P> = Partial<Record<"enter" | "exit", P>>;
|
|
4
4
|
type TransitionConfig = WithMotionState<Transition>;
|
|
@@ -13,13 +13,6 @@ type TransitionProperties = {
|
|
|
13
13
|
*/
|
|
14
14
|
transitionEnd?: TransitionEndConfig;
|
|
15
15
|
};
|
|
16
|
-
type TargetResolver<P = object> = (props: P & TransitionProperties) => TargetAndTransition;
|
|
17
|
-
type Variant<P = object> = TargetAndTransition | TargetResolver<P>;
|
|
18
|
-
type Variants<P = object> = Record<string, {
|
|
19
|
-
enter: Variant<P>;
|
|
20
|
-
exit: Variant<P>;
|
|
21
|
-
initial?: Variant<P>;
|
|
22
|
-
}>;
|
|
23
16
|
declare const TRANSITION_EASINGS: {
|
|
24
17
|
readonly ease: readonly [0.36, 0.66, 0.4, 1];
|
|
25
18
|
readonly easeIn: readonly [0.4, 0, 1, 1];
|
|
@@ -39,6 +32,57 @@ declare const TRANSITION_DEFAULTS: {
|
|
|
39
32
|
readonly ease: readonly [0.4, 0, 1, 1];
|
|
40
33
|
};
|
|
41
34
|
};
|
|
42
|
-
|
|
35
|
+
type VariantTypes = "fade" | "scaleSpringOpacity" | "scale";
|
|
36
|
+
type Variants = Record<VariantTypes, Variants$1>;
|
|
37
|
+
declare const TRANSITION_VARIANTS: {
|
|
38
|
+
fade: {
|
|
39
|
+
enter: {
|
|
40
|
+
opacity: number;
|
|
41
|
+
transition: {
|
|
42
|
+
duration: number;
|
|
43
|
+
ease: readonly [0.36, 0.66, 0.4, 1];
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
exit: {
|
|
47
|
+
opacity: number;
|
|
48
|
+
transition: {
|
|
49
|
+
duration: number;
|
|
50
|
+
ease: readonly [0.36, 0.66, 0.4, 1];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
scaleSpringOpacity: {
|
|
55
|
+
initial: {
|
|
56
|
+
opacity: number;
|
|
57
|
+
transform: string;
|
|
58
|
+
};
|
|
59
|
+
enter: {
|
|
60
|
+
opacity: number;
|
|
61
|
+
transform: string;
|
|
62
|
+
transition: {
|
|
63
|
+
type: "spring";
|
|
64
|
+
bounce: number;
|
|
65
|
+
duration: number;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
exit: {
|
|
69
|
+
opacity: number;
|
|
70
|
+
transform: string;
|
|
71
|
+
transition: {
|
|
72
|
+
ease: readonly [0, 0, 0.2, 1];
|
|
73
|
+
bounce: number;
|
|
74
|
+
duration: number;
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
scale: {
|
|
79
|
+
enter: {
|
|
80
|
+
scale: number;
|
|
81
|
+
};
|
|
82
|
+
exit: {
|
|
83
|
+
scale: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
43
87
|
|
|
44
88
|
export { TRANSITION_DEFAULTS, TRANSITION_EASINGS, TRANSITION_VARIANTS, type TransitionConfig, type TransitionEndConfig, type TransitionProperties, type Variants };
|
package/dist/transition-utils.js
CHANGED
|
@@ -61,6 +61,34 @@ var TRANSITION_VARIANTS = {
|
|
|
61
61
|
ease: TRANSITION_EASINGS.ease
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
},
|
|
65
|
+
scaleSpringOpacity: {
|
|
66
|
+
initial: {
|
|
67
|
+
opacity: 0,
|
|
68
|
+
transform: "scale(0.8)"
|
|
69
|
+
},
|
|
70
|
+
enter: {
|
|
71
|
+
opacity: 1,
|
|
72
|
+
transform: "scale(1)",
|
|
73
|
+
transition: {
|
|
74
|
+
type: "spring",
|
|
75
|
+
bounce: 0,
|
|
76
|
+
duration: 0.3
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
exit: {
|
|
80
|
+
opacity: 0,
|
|
81
|
+
transform: "scale(0.96)",
|
|
82
|
+
transition: {
|
|
83
|
+
ease: TRANSITION_EASINGS.easeOut,
|
|
84
|
+
bounce: 0,
|
|
85
|
+
duration: 0.15
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
scale: {
|
|
90
|
+
enter: { scale: 1 },
|
|
91
|
+
exit: { scale: 0.95 }
|
|
64
92
|
}
|
|
65
93
|
};
|
|
66
94
|
// Annotate the CommonJS export names for ESM import in node:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kopexa/motion-utils",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.4",
|
|
4
4
|
"description": "utility package to work with motion library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"motion-utils"
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"react": ">=19.0.0-rc.0",
|
|
29
29
|
"react-dom": ">=19.0.0-rc.0",
|
|
30
30
|
"motion": ">=12.23.6",
|
|
31
|
-
"@kopexa/theme": "1.5.
|
|
31
|
+
"@kopexa/theme": "1.5.4"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@kopexa/shared-utils": "1.1.
|
|
35
|
-
"@kopexa/react-utils": "2.0.
|
|
34
|
+
"@kopexa/shared-utils": "1.1.5",
|
|
35
|
+
"@kopexa/react-utils": "2.0.5"
|
|
36
36
|
},
|
|
37
37
|
"clean-package": "../../../clean-package.config.json",
|
|
38
38
|
"module": "dist/index.mjs",
|