@cleartrip/ct-design-animate 4.0.0-SNAPSHOT-native-main.10 → 4.0.0-SNAPSHOT-native-main.11

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.
@@ -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;CAClC;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA6DvD,CAAC;AAEF,eAAe,iBAAiB,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;CAClC;AAED,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAmEvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleartrip/ct-design-animate",
3
- "version": "4.0.0-SNAPSHOT-native-main.10",
3
+ "version": "4.0.0-SNAPSHOT-native-main.11",
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,12 +26,12 @@
26
26
  "dependencies": {
27
27
  "@emotion/react": "^11.14.0",
28
28
  "@emotion/styled": "^11.14.0",
29
- "@cleartrip/ct-design-style-manager": "4.0.0-SNAPSHOT-native-main.10",
30
- "@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-native-main.10"
29
+ "@cleartrip/ct-design-style-manager": "4.0.0-SNAPSHOT-native-main.11",
30
+ "@cleartrip/ct-design-theme": "4.0.0-SNAPSHOT-native-main.11"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@emotion/babel-plugin": "^11.12.0",
34
- "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-native-main.10"
34
+ "@cleartrip/ct-design-types": "4.0.0-SNAPSHOT-native-main.11"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": ">=16.8.0",
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useRef } from 'react';
2
2
 
3
- import Animated, { useAnimatedStyle, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
3
+ import Animated, { Easing, useAnimatedStyle, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
4
4
 
5
5
  import { EntranceAnimationDirection } from '../constants';
6
6
  import { ViewStyle } from 'react-native';
@@ -41,14 +41,20 @@ const EntranceAnimation: React.FC<EntranceAnimationProps> = ({
41
41
  const hasAnimated = useRef(false);
42
42
 
43
43
  const translate = useSharedValue(initialOffset);
44
- const opacity = useSharedValue(opacityAnimation ? 0.5 : 1);
44
+ const opacity = useSharedValue(opacityAnimation ? 0 : 1);
45
45
 
46
46
  // Callback to emit animation complete event
47
47
  useEffect(() => {
48
48
  if (!hasAnimated.current && startAnimation) {
49
49
  hasAnimated.current = true;
50
- translate.value = withDelay(wrappedIndex * staggerDelay, withTiming(0, { duration }));
51
- opacity.value = withDelay(wrappedIndex * staggerDelay + duration, withTiming(1, { duration: duration * 0.5 }));
50
+ translate.value = withDelay(
51
+ wrappedIndex * staggerDelay,
52
+ withTiming(0, { duration, easing: Easing.inOut(Easing.ease) }),
53
+ );
54
+ opacity.value = withDelay(
55
+ wrappedIndex * staggerDelay,
56
+ withTiming(1, { duration: duration * 0.2, easing: Easing.inOut(Easing.ease) }),
57
+ );
52
58
 
53
59
  // Emit animation complete event after animation duration
54
60
  const totalDelay = wrappedIndex * staggerDelay + duration + duration * 0.5;