@cleartrip/ct-design-animate 5.26.0-SNAPSHOT-native-main.0 → 5.26.0
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/components/EntranceAnimation.native.d.ts +1 -0
- package/dist/components/EntranceAnimation.native.d.ts.map +1 -1
- package/dist/components/Shake.native.d.ts +1 -0
- package/dist/components/Shake.native.d.ts.map +1 -1
- package/dist/components/StretchyAnimation.native.d.ts.map +1 -1
- package/dist/type.d.ts +2 -0
- package/dist/type.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/EntranceAnimation.native.tsx +11 -1
- package/src/components/Shake.native.tsx +7 -2
- package/src/components/StretchyAnimation.native.tsx +6 -2
- package/src/components/StretchyAnimation.tsx +1 -1
- package/src/type.ts +10 -0
|
@@ -14,6 +14,7 @@ export interface EntranceAnimationProps {
|
|
|
14
14
|
opacityAnimation?: boolean;
|
|
15
15
|
startAnimation?: boolean;
|
|
16
16
|
onAnimationComplete?: () => void;
|
|
17
|
+
testID?: string;
|
|
17
18
|
}
|
|
18
19
|
declare const EntranceAnimation: React.FC<EntranceAnimationProps>;
|
|
19
20
|
export default EntranceAnimation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntranceAnimation.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/EntranceAnimation.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"EntranceAnimation.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/EntranceAnimation.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAIjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,GAAG,0BAA0B,EAAE,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IAKjC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAwEvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -2,6 +2,7 @@ import React, { PropsWithChildren } from 'react';
|
|
|
2
2
|
interface IShakeAnimationProps extends PropsWithChildren {
|
|
3
3
|
animate?: boolean;
|
|
4
4
|
style?: object;
|
|
5
|
+
testID?: string;
|
|
5
6
|
}
|
|
6
7
|
declare const StyledAnimation: React.FC<IShakeAnimationProps>;
|
|
7
8
|
export default StyledAnimation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Shake.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/Shake.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIjD,UAAU,oBAAqB,SAAQ,iBAAiB;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Shake.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/Shake.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAIjD,UAAU,oBAAqB,SAAQ,iBAAiB;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAsBD,QAAA,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAanD,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StretchyAnimation.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/StretchyAnimation.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIjD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"StretchyAnimation.native.d.ts","sourceRoot":"","sources":["../../packages/components/Animate/src/components/StretchyAnimation.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAIjD,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAkCvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
package/dist/type.d.ts
CHANGED
|
@@ -7,11 +7,13 @@ export interface AnimationStyleProps {
|
|
|
7
7
|
styleConfig?: {
|
|
8
8
|
root?: Styles[];
|
|
9
9
|
};
|
|
10
|
+
testID?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface StretchyAnimationProps {
|
|
12
13
|
children: React.ReactNode;
|
|
13
14
|
dynamicHeight: number;
|
|
14
15
|
iosOnly?: boolean;
|
|
16
|
+
testID?: string;
|
|
15
17
|
}
|
|
16
18
|
export type AnimateProps = ({
|
|
17
19
|
variant: 'SHAKE';
|
package/dist/type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Animate/src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAIlC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAK3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAIlB,WAAW,CAAC,EAAE;QAIZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../packages/components/Animate/src/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAExE,MAAM,WAAW,mBAAmB;IAIlC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAK3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAIlB,WAAW,CAAC,EAAE;QAIZ,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;KACjB,CAAC;IAKF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IAIrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAI1B,aAAa,EAAE,MAAM,CAAC;IAItB,OAAO,CAAC,EAAE,OAAO,CAAC;IAKlB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,YAAY,GACpB,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG,mBAAmB,CAAC,GAC5C,CAAC;IAAE,OAAO,EAAE,oBAAoB,CAAA;CAAE,GAAG,sBAAsB,CAAC,GAC5D,CAAC;IAAE,OAAO,EAAE,oBAAoB,CAAA;CAAE,GAAG,sBAAsB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-design-animate",
|
|
3
|
-
"version": "5.26.0
|
|
3
|
+
"version": "5.26.0",
|
|
4
4
|
"description": "HOC component that will render animation to children",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "./dist/ct-design-animate.cjs.js",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@emotion/react": "^11.14.0",
|
|
28
28
|
"@emotion/styled": "^11.14.0",
|
|
29
|
-
"@cleartrip/ct-design-style-manager": "5.
|
|
30
|
-
"@cleartrip/ct-design-theme": "5.26.0
|
|
31
|
-
"@cleartrip/ct-design-common-utils": "5.
|
|
32
|
-
"@cleartrip/ct-design-scroll-container": "5.26.0
|
|
29
|
+
"@cleartrip/ct-design-style-manager": "5.26.0",
|
|
30
|
+
"@cleartrip/ct-design-theme": "5.26.0",
|
|
31
|
+
"@cleartrip/ct-design-common-utils": "5.26.0",
|
|
32
|
+
"@cleartrip/ct-design-scroll-container": "5.26.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@emotion/babel-plugin": "^11.12.0",
|
|
36
|
-
"@cleartrip/ct-design-types": "5.26.0
|
|
36
|
+
"@cleartrip/ct-design-types": "5.26.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"react": ">=16.8.0",
|
|
@@ -18,6 +18,11 @@ export interface EntranceAnimationProps {
|
|
|
18
18
|
opacityAnimation?: boolean;
|
|
19
19
|
startAnimation?: boolean;
|
|
20
20
|
onAnimationComplete?: () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Identifier used to locate this component in end-to-end tests.
|
|
23
|
+
* Forwarded to the underlying animated view.
|
|
24
|
+
*/
|
|
25
|
+
testID?: string;
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
const EntranceAnimation: React.FC<EntranceAnimationProps> = ({
|
|
@@ -33,6 +38,7 @@ const EntranceAnimation: React.FC<EntranceAnimationProps> = ({
|
|
|
33
38
|
opacityAnimation = true,
|
|
34
39
|
startAnimation = true,
|
|
35
40
|
onAnimationComplete = () => void 0,
|
|
41
|
+
testID,
|
|
36
42
|
}) => {
|
|
37
43
|
// Wrap index for staggered effect
|
|
38
44
|
const wrappedIndex = index % (maxStaggerIndex + 1);
|
|
@@ -86,7 +92,11 @@ const EntranceAnimation: React.FC<EntranceAnimationProps> = ({
|
|
|
86
92
|
};
|
|
87
93
|
});
|
|
88
94
|
|
|
89
|
-
return
|
|
95
|
+
return (
|
|
96
|
+
<Animated.View testID={testID ? `${testID}-EntranceAnimation` : undefined} style={animatedStyle}>
|
|
97
|
+
{children}
|
|
98
|
+
</Animated.View>
|
|
99
|
+
);
|
|
90
100
|
};
|
|
91
101
|
|
|
92
102
|
export default EntranceAnimation;
|
|
@@ -5,6 +5,7 @@ import Animated, { Easing, useAnimatedStyle, useSharedValue, withSequence, withT
|
|
|
5
5
|
interface IShakeAnimationProps extends PropsWithChildren {
|
|
6
6
|
animate?: boolean;
|
|
7
7
|
style?: object;
|
|
8
|
+
testID?: string;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
const useShakeAnimation = (show: boolean) => {
|
|
@@ -27,7 +28,7 @@ const useShakeAnimation = (show: boolean) => {
|
|
|
27
28
|
return translateX;
|
|
28
29
|
};
|
|
29
30
|
|
|
30
|
-
const StyledAnimation: React.FC<IShakeAnimationProps> = ({ children, animate = false, style = {} }) => {
|
|
31
|
+
const StyledAnimation: React.FC<IShakeAnimationProps> = ({ children, animate = false, style = {}, testID }) => {
|
|
31
32
|
const translateX = useShakeAnimation(animate);
|
|
32
33
|
|
|
33
34
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
@@ -35,7 +36,11 @@ const StyledAnimation: React.FC<IShakeAnimationProps> = ({ children, animate = f
|
|
|
35
36
|
backfaceVisibility: 'hidden',
|
|
36
37
|
perspective: 1000,
|
|
37
38
|
}));
|
|
38
|
-
return
|
|
39
|
+
return (
|
|
40
|
+
<Animated.View testID={testID ? `${testID}-Shake` : undefined} style={[style, animatedStyle]}>
|
|
41
|
+
{children}
|
|
42
|
+
</Animated.View>
|
|
43
|
+
);
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
export default StyledAnimation;
|
|
@@ -5,7 +5,7 @@ import { StretchyAnimationProps } from '../type';
|
|
|
5
5
|
import { useAnimatedScroll } from '@cleartrip/ct-design-scroll-container';
|
|
6
6
|
import { isIOS } from '@cleartrip/ct-design-common-utils';
|
|
7
7
|
|
|
8
|
-
const StretchyAnimation: React.FC<StretchyAnimationProps> = ({ children, dynamicHeight, iosOnly = true }) => {
|
|
8
|
+
const StretchyAnimation: React.FC<StretchyAnimationProps> = ({ children, dynamicHeight, iosOnly = true, testID }) => {
|
|
9
9
|
const { scrollY } = useAnimatedScroll() as unknown as { scrollY: Animated.Value };
|
|
10
10
|
|
|
11
11
|
const stretchyCarouselStyle = useMemo(() => {
|
|
@@ -31,7 +31,11 @@ const StretchyAnimation: React.FC<StretchyAnimationProps> = ({ children, dynamic
|
|
|
31
31
|
}, [iosOnly, scrollY, dynamicHeight]);
|
|
32
32
|
|
|
33
33
|
if (isIOS() && iosOnly) {
|
|
34
|
-
return
|
|
34
|
+
return (
|
|
35
|
+
<Animated.View testID={testID ? `${testID}-StretchyAnimation` : undefined} style={stretchyCarouselStyle}>
|
|
36
|
+
{children}
|
|
37
|
+
</Animated.View>
|
|
38
|
+
);
|
|
35
39
|
}
|
|
36
40
|
|
|
37
41
|
return children;
|
package/src/type.ts
CHANGED
|
@@ -22,6 +22,11 @@ export interface AnimationStyleProps {
|
|
|
22
22
|
*/
|
|
23
23
|
root?: Styles[];
|
|
24
24
|
};
|
|
25
|
+
/**
|
|
26
|
+
* Identifier used to locate this component in end-to-end tests.
|
|
27
|
+
* Forwarded to the underlying animated view.
|
|
28
|
+
*/
|
|
29
|
+
testID?: string;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
export interface StretchyAnimationProps {
|
|
@@ -37,6 +42,11 @@ export interface StretchyAnimationProps {
|
|
|
37
42
|
* If true, the stretchy animation will only be applied on iOS.
|
|
38
43
|
*/
|
|
39
44
|
iosOnly?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Identifier used to locate this component in end-to-end tests.
|
|
47
|
+
* Forwarded to the underlying animated view.
|
|
48
|
+
*/
|
|
49
|
+
testID?: string;
|
|
40
50
|
}
|
|
41
51
|
|
|
42
52
|
export type AnimateProps =
|