@ornikar/kitt-universal 31.3.2-canary.d9333a410786c9c1a722ce408a27e7980c9146a4.0 → 31.4.1-canary.2fdbcaad37b7e76ba2442f7c56a4939349d51eb1.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.
Files changed (52) hide show
  1. package/CHANGELOG.md +17 -2
  2. package/dist/definitions/CardModal/CardModalAnimation/OpacityAnimation.d.ts +8 -0
  3. package/dist/definitions/CardModal/CardModalAnimation/OpacityAnimation.d.ts.map +1 -0
  4. package/dist/definitions/CardModal/CardModalAnimation/{NativeRotationAnimation.d.ts → RotationAnimation.d.ts} +3 -3
  5. package/dist/definitions/CardModal/CardModalAnimation/RotationAnimation.d.ts.map +1 -0
  6. package/dist/definitions/DialogModal/DialogModalAnimation/NativeOpacityAnimation.d.ts.map +1 -1
  7. package/dist/definitions/DialogModal/DialogModalAnimation/NativeRotationAnimation.d.ts.map +1 -1
  8. package/dist/definitions/FullscreenModal/FullscreenModalAnimation.web.d.ts.map +1 -1
  9. package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts +0 -14
  10. package/dist/definitions/themes/late-ocean/fullscreenModal.d.ts.map +1 -1
  11. package/dist/index-metro.es.android.js +44 -42
  12. package/dist/index-metro.es.android.js.map +1 -1
  13. package/dist/index-metro.es.ios.js +44 -42
  14. package/dist/index-metro.es.ios.js.map +1 -1
  15. package/dist/index-node-22.17.cjs.js +44 -42
  16. package/dist/index-node-22.17.cjs.js.map +1 -1
  17. package/dist/index-node-22.17.cjs.web.css +38 -16
  18. package/dist/index-node-22.17.cjs.web.js +262 -179
  19. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  20. package/dist/index-node-22.17.es.mjs +44 -42
  21. package/dist/index-node-22.17.es.mjs.map +1 -1
  22. package/dist/index-node-22.17.es.web.css +38 -16
  23. package/dist/index-node-22.17.es.web.mjs +262 -179
  24. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  25. package/dist/index.es.js +44 -42
  26. package/dist/index.es.js.map +1 -1
  27. package/dist/index.es.web.js +288 -206
  28. package/dist/index.es.web.js.map +1 -1
  29. package/dist/linaria-themes-metro.es.android.js +30 -34
  30. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  31. package/dist/linaria-themes-metro.es.ios.js +30 -34
  32. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  33. package/dist/linaria-themes-node-22.17.cjs.js +30 -34
  34. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  35. package/dist/linaria-themes-node-22.17.cjs.web.js +30 -34
  36. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  37. package/dist/linaria-themes-node-22.17.es.mjs +30 -34
  38. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  39. package/dist/linaria-themes-node-22.17.es.web.mjs +30 -34
  40. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  41. package/dist/linaria-themes.es.js +30 -34
  42. package/dist/linaria-themes.es.js.map +1 -1
  43. package/dist/linaria-themes.es.web.js +30 -34
  44. package/dist/linaria-themes.es.web.js.map +1 -1
  45. package/dist/styles.css +38 -16
  46. package/dist/tsbuildinfo +1 -1
  47. package/package.json +1 -1
  48. package/dist/definitions/CardModal/CardModalAnimation/NativeOpacityAnimation.d.ts +0 -8
  49. package/dist/definitions/CardModal/CardModalAnimation/NativeOpacityAnimation.d.ts.map +0 -1
  50. package/dist/definitions/CardModal/CardModalAnimation/NativeRotationAnimation.d.ts.map +0 -1
  51. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts +0 -4
  52. package/dist/definitions/DialogModal/DialogModalAnimation/DialogModalAnimation.web.d.ts.map +0 -1
@@ -6,23 +6,45 @@
6
6
  .kitt-u_opacityEnterActive_o1t4vl7b{opacity:1;-webkit-transition:opacity 250ms cubic-bezier(0.42,0,1,1);transition:opacity 250ms cubic-bezier(0.42,0,1,1);}
7
7
  .kitt-u_opacityExit_ogyytm1{opacity:1;}
8
8
  .kitt-u_opacityExitActive_o18xvk52{opacity:0;-webkit-transition:opacity 250ms cubic-bezier(0.42,0,1,1);transition:opacity 250ms cubic-bezier(0.42,0,1,1);}
9
- .kitt-u_contentAnimationEnter_c1i0gle8{opacity:0;-webkit-transform:rotateZ(5deg) scale(0.8);-ms-transform:rotateZ(5deg) scale(0.8);transform:rotateZ(5deg) scale(0.8);}
10
- .kitt-u_contentAnimatioEnterActive_c1jmfkjw{opacity:1;-webkit-transform:rotateZ(0) scale(1);-ms-transform:rotateZ(0) scale(1);transform:rotateZ(0) scale(1);-webkit-transition:all 400ms cubic-bezier(0.77,0,0.175,1);transition:all 400ms cubic-bezier(0.77,0,0.175,1);}
11
- .kitt-u_contentAnimatioExit_cwjstxl{opacity:1;-webkit-transform:rotateZ(0) scale(1);-ms-transform:rotateZ(0) scale(1);transform:rotateZ(0) scale(1);}
12
- .kitt-u_contentAnimatioExitActive_c1almbvu{opacity:0;-webkit-transform:rotateZ(5deg) scale(0.8);-ms-transform:rotateZ(5deg) scale(0.8);transform:rotateZ(5deg) scale(0.8);-webkit-transition:all 400ms cubic-bezier(0.77,0,0.175,1);transition:all 400ms cubic-bezier(0.77,0,0.175,1);}
13
- .kitt-u_opacityEnter_o9rkayr{opacity:0;}
14
- .kitt-u_opacityEnterActive_od7zvm9{opacity:1;-webkit-transition:opacity 250ms cubic-bezier(0.42,0,1,1);transition:opacity 250ms cubic-bezier(0.42,0,1,1);}
15
- .kitt-u_opacityExit_opddo9j{opacity:1;}
16
- .kitt-u_opacityExitActive_o15v6ove{opacity:0;-webkit-transition:opacity 250ms cubic-bezier(0.42,0,1,1);transition:opacity 250ms cubic-bezier(0.42,0,1,1);}
17
9
  .kitt-u_inputTextContainer_i1encr9g{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;}.kitt-u_inputTextContainer_i1encr9g > *::-ms-clear,.kitt-u_inputTextContainer_i1encr9g > *::-ms-reveal{display:none;}.kitt-u_inputTextContainer_i1encr9g > *{-webkit-transition:border-color 200ms ease-in-out,background-color 200ms ease-in-out;transition:border-color 200ms ease-in-out,background-color 200ms ease-in-out;}
18
- .kitt-u_slideInFromBottomEnter_s1717rto{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);}
19
- .kitt-u_slideInFromBottomEnterActive_sux6xgc{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);-webkit-transition:-webkit-transform 600ms cubic-bezier(0.77,0,0.175,1);-webkit-transition:transform 600ms cubic-bezier(0.77,0,0.175,1);transition:transform 600ms cubic-bezier(0.77,0,0.175,1);}
20
- .kitt-u_slideInFromBottomExit_sl0lsxt{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);}
21
- .kitt-u_slideInFromBottomExitActive_srlzzmu{-webkit-transform:translateY(100%);-ms-transform:translateY(100%);transform:translateY(100%);-webkit-transition:-webkit-transform 600ms cubic-bezier(0.77,0,0.175,1);-webkit-transition:transform 600ms cubic-bezier(0.77,0,0.175,1);transition:transform 600ms cubic-bezier(0.77,0,0.175,1);}
22
- .kitt-u_opacityEnter_okm44hr{opacity:0;}
23
- .kitt-u_opacityEnterActive_o2w8t0i{opacity:1;-webkit-transition:opacity 250ms cubic-bezier(0.42,1,0,1);transition:opacity 250ms cubic-bezier(0.42,1,0,1);}
24
- .kitt-u_opacityExit_o14r8iix{opacity:1;}
25
- .kitt-u_opacityExitActive_oim72y2{opacity:0;-webkit-transition:opacity 250ms cubic-bezier(0.42,1,0,1);transition:opacity 250ms cubic-bezier(0.42,1,0,1);}
10
+ /* Overlay animation styles - uses CSS variables for theme values */
11
+ .FullscreenModalAnimation-module_overlay-enter__L1J1X {
12
+ opacity: 0;
13
+ }
14
+
15
+ .FullscreenModalAnimation-module_overlay-enter-active__gDEVb {
16
+ opacity: 1;
17
+ transition: opacity var(--overlay-duration) var(--overlay-easing);
18
+ }
19
+
20
+ .FullscreenModalAnimation-module_overlay-exit__Qx1WE {
21
+ opacity: 1;
22
+ }
23
+
24
+ .FullscreenModalAnimation-module_overlay-exit-active__lFR3x {
25
+ opacity: 0;
26
+ transition: opacity var(--overlay-duration) var(--overlay-easing);
27
+ }
28
+
29
+ /* Content animation styles - uses CSS variables for theme values */
30
+ .FullscreenModalAnimation-module_content-enter__JmCWa {
31
+ transform: translateY(100%);
32
+ }
33
+
34
+ .FullscreenModalAnimation-module_content-enter-active__iaNRs {
35
+ transform: translateY(0);
36
+ transition: transform var(--content-duration) var(--content-easing);
37
+ }
38
+
39
+ .FullscreenModalAnimation-module_content-exit__hB0wY {
40
+ transform: translateY(0);
41
+ }
42
+
43
+ .FullscreenModalAnimation-module_content-exit-active__BPVPo {
44
+ transform: translateY(100%);
45
+ transition: transform var(--content-duration) var(--content-easing);
46
+ }
47
+
26
48
  .kitt-u_enter_ereraf{-webkit-transform:translateY(8px);-ms-transform:translateY(8px);transform:translateY(8px);opacity:0;}
27
49
  .kitt-u_enterActive_e1jmsjrm{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;}
28
50
  .kitt-u_exit_e1mwnccz{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;}
@@ -9,6 +9,7 @@ const phosphor = require('@ornikar/kitt-icons/phosphor');
9
9
  const reactNative = require('react-native');
10
10
  const reactDom = require('react-dom');
11
11
  const reactTransitionGroup = require('react-transition-group');
12
+ const Animated = require('react-native-reanimated');
12
13
  const parser = require('@twemoji/parser');
13
14
  const Downshift = require('downshift');
14
15
  const expoDocumentPicker = require('expo-document-picker');
@@ -16,7 +17,6 @@ const expoImagePicker = require('expo-image-picker');
16
17
  const useDebounce = require('use-debounce');
17
18
  const jsApiLoader = require('@googlemaps/js-api-loader');
18
19
  const libphonenumberJs = require('libphonenumber-js');
19
- const Animated = require('react-native-reanimated');
20
20
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
21
21
  const Svg = require('react-native-svg');
22
22
  const reactDom$1 = require('@floating-ui/react-dom');
@@ -26,8 +26,8 @@ const isChromatic = require('chromatic/isChromatic');
26
26
 
27
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
28
28
 
29
- const Downshift__default = /*#__PURE__*/_interopDefaultLegacy(Downshift);
30
29
  const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
30
+ const Downshift__default = /*#__PURE__*/_interopDefaultLegacy(Downshift);
31
31
  const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
32
32
  const isChromatic__default = /*#__PURE__*/_interopDefaultLegacy(isChromatic);
33
33
 
@@ -847,15 +847,15 @@ const card = {
847
847
  }
848
848
  };
849
849
 
850
- const webAnimationContentDuration$2 = 400;
851
- const webAnimationContentEasing$2 = {
850
+ const webAnimationContentDuration$1 = 400;
851
+ const webAnimationContentEasing$1 = {
852
852
  x1: 0.77,
853
853
  y1: 0,
854
854
  x2: 0.175,
855
855
  y2: 1
856
856
  };
857
- const webAnimationOverlayDuration$2 = 250;
858
- const webAnimationOverlayEasing$2 = {
857
+ const webAnimationOverlayDuration$1 = 250;
858
+ const webAnimationOverlayEasing$1 = {
859
859
  x1: 0.42,
860
860
  y1: 0,
861
861
  x2: 1,
@@ -890,12 +890,12 @@ const cardModal = {
890
890
  },
891
891
  animation: {
892
892
  overlay: {
893
- duration: webAnimationOverlayDuration$2,
894
- easing: webAnimationOverlayEasing$2
893
+ duration: webAnimationOverlayDuration$1,
894
+ easing: webAnimationOverlayEasing$1
895
895
  },
896
896
  content: {
897
- duration: webAnimationContentDuration$2,
898
- easing: webAnimationContentEasing$2
897
+ duration: webAnimationContentDuration$1,
898
+ easing: webAnimationContentEasing$1
899
899
  }
900
900
  }
901
901
  };
@@ -951,15 +951,15 @@ const choices = {
951
951
  }
952
952
  };
953
953
 
954
- const webAnimationContentDuration$1 = 400;
955
- const webAnimationContentEasing$1 = {
954
+ const webAnimationContentDuration = 400;
955
+ const webAnimationContentEasing = {
956
956
  x1: 0.77,
957
957
  y1: 0,
958
958
  x2: 0.175,
959
959
  y2: 1
960
960
  };
961
- const webAnimationOverlayDuration$1 = 250;
962
- const webAnimationOverlayEasing$1 = {
961
+ const webAnimationOverlayDuration = 250;
962
+ const webAnimationOverlayEasing = {
963
963
  x1: 0.42,
964
964
  y1: 0,
965
965
  x2: 1,
@@ -981,12 +981,12 @@ const dialogModal = {
981
981
  },
982
982
  animation: {
983
983
  overlay: {
984
- duration: webAnimationOverlayDuration$1,
985
- easing: webAnimationOverlayEasing$1
984
+ duration: webAnimationOverlayDuration,
985
+ easing: webAnimationOverlayEasing
986
986
  },
987
987
  content: {
988
- duration: webAnimationContentDuration$1,
989
- easing: webAnimationContentEasing$1
988
+ duration: webAnimationContentDuration,
989
+ easing: webAnimationContentEasing
990
990
  }
991
991
  }
992
992
  };
@@ -1895,20 +1895,6 @@ const forms = {
1895
1895
  timePicker
1896
1896
  };
1897
1897
 
1898
- const webAnimationContentDuration = 600;
1899
- const webAnimationContentEasing = {
1900
- x1: 0.77,
1901
- y1: 0,
1902
- x2: 0.175,
1903
- y2: 1
1904
- };
1905
- const webAnimationOverlayDuration = 250;
1906
- const webAnimationOverlayEasing = {
1907
- x1: 0.42,
1908
- y1: 0,
1909
- x2: 1,
1910
- y2: 1
1911
- };
1912
1898
  const fullscreenModal = {
1913
1899
  header: {
1914
1900
  height: 56
@@ -1922,12 +1908,22 @@ const fullscreenModal = {
1922
1908
  },
1923
1909
  animation: {
1924
1910
  overlay: {
1925
- duration: webAnimationOverlayDuration,
1926
- easing: webAnimationOverlayEasing
1911
+ duration: 250,
1912
+ easing: {
1913
+ x1: 0.42,
1914
+ y1: 0,
1915
+ x2: 1,
1916
+ y2: 1
1917
+ }
1927
1918
  },
1928
1919
  content: {
1929
- duration: webAnimationContentDuration,
1930
- easing: webAnimationContentEasing
1920
+ duration: 600,
1921
+ easing: {
1922
+ x1: 0.77,
1923
+ y1: 0,
1924
+ x2: 0.175,
1925
+ y2: 1
1926
+ }
1931
1927
  }
1932
1928
  }
1933
1929
  };
@@ -4332,29 +4328,29 @@ const CardModalRotationContainer = /*#__PURE__*/react.forwardRef((props, ref) =>
4332
4328
  });
4333
4329
  });
4334
4330
 
4335
- const contentAnimationEnter$1 = "kitt-u_contentAnimationEnter_c11xxy4r";
4336
- const contentAnimatioEnterActive$1 = "kitt-u_contentAnimatioEnterActive_cl52117";
4337
- const contentAnimatioExit$1 = "kitt-u_contentAnimatioExit_cyjczep";
4338
- const contentAnimatioExitActive$1 = "kitt-u_contentAnimatioExitActive_cpsy3dt";
4339
- const contentAnimationClassNames$1 = {
4340
- appear: contentAnimationEnter$1,
4341
- appearActive: contentAnimatioEnterActive$1,
4342
- enter: contentAnimationEnter$1,
4343
- enterActive: contentAnimatioEnterActive$1,
4344
- exit: contentAnimatioExit$1,
4345
- exitActive: contentAnimatioExitActive$1
4331
+ const contentAnimationEnter = "kitt-u_contentAnimationEnter_c11xxy4r";
4332
+ const contentAnimatioEnterActive = "kitt-u_contentAnimatioEnterActive_cl52117";
4333
+ const contentAnimatioExit = "kitt-u_contentAnimatioExit_cyjczep";
4334
+ const contentAnimatioExitActive = "kitt-u_contentAnimatioExitActive_cpsy3dt";
4335
+ const contentAnimationClassNames = {
4336
+ appear: contentAnimationEnter,
4337
+ appearActive: contentAnimatioEnterActive,
4338
+ enter: contentAnimationEnter,
4339
+ enterActive: contentAnimatioEnterActive,
4340
+ exit: contentAnimatioExit,
4341
+ exitActive: contentAnimatioExitActive
4346
4342
  };
4347
- const opacityEnter$2 = "kitt-u_opacityEnter_o1ae40dx";
4348
- const opacityEnterActive$2 = "kitt-u_opacityEnterActive_o1t4vl7b";
4349
- const opacityExit$2 = "kitt-u_opacityExit_ogyytm1";
4350
- const opacityExitActive$2 = "kitt-u_opacityExitActive_o18xvk52";
4351
- const opacityClassNames$2 = {
4352
- appear: opacityEnter$2,
4353
- appearActive: opacityEnterActive$2,
4354
- enter: opacityEnter$2,
4355
- enterActive: opacityEnterActive$2,
4356
- exit: opacityExit$2,
4357
- exitActive: opacityExitActive$2
4343
+ const opacityEnter = "kitt-u_opacityEnter_o1ae40dx";
4344
+ const opacityEnterActive = "kitt-u_opacityEnterActive_o1t4vl7b";
4345
+ const opacityExit = "kitt-u_opacityExit_ogyytm1";
4346
+ const opacityExitActive = "kitt-u_opacityExitActive_o18xvk52";
4347
+ const opacityClassNames = {
4348
+ appear: opacityEnter,
4349
+ appearActive: opacityEnterActive,
4350
+ enter: opacityEnter,
4351
+ enterActive: opacityEnterActive,
4352
+ exit: opacityExit,
4353
+ exitActive: opacityExitActive
4358
4354
  };
4359
4355
  function CardModalAnimation({
4360
4356
  children,
@@ -4390,7 +4386,7 @@ function CardModalAnimation({
4390
4386
  ...sharedProps,
4391
4387
  nodeRef: overlayRef,
4392
4388
  timeout: isAnimationEnabled ? animation.overlay.duration : 0,
4393
- classNames: opacityClassNames$2,
4389
+ classNames: opacityClassNames,
4394
4390
  children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
4395
4391
  ref: overlayRef,
4396
4392
  onPress: onClose
@@ -4399,7 +4395,7 @@ function CardModalAnimation({
4399
4395
  ...sharedProps,
4400
4396
  nodeRef: contentRef,
4401
4397
  timeout: isAnimationEnabled ? animation.content.duration : 0,
4402
- classNames: contentAnimationClassNames$1,
4398
+ classNames: contentAnimationClassNames,
4403
4399
  onEnter: onEnter,
4404
4400
  onEntered: onEntered,
4405
4401
  onExit: onExit,
@@ -4936,87 +4932,167 @@ const ChoicesElements = {
4936
4932
  ButtonChoices
4937
4933
  };
4938
4934
 
4939
- const contentAnimationEnter = "kitt-u_contentAnimationEnter_c1i0gle8";
4940
- const contentAnimatioEnterActive = "kitt-u_contentAnimatioEnterActive_c1jmfkjw";
4941
- const contentAnimatioExit = "kitt-u_contentAnimatioExit_cwjstxl";
4942
- const contentAnimatioExitActive = "kitt-u_contentAnimatioExitActive_c1almbvu";
4943
- const contentAnimationClassNames = {
4944
- appear: contentAnimationEnter,
4945
- appearActive: contentAnimatioEnterActive,
4946
- enter: contentAnimationEnter,
4947
- enterActive: contentAnimatioEnterActive,
4948
- exit: contentAnimatioExit,
4949
- exitActive: contentAnimatioExitActive
4950
- };
4951
- const opacityEnter$1 = "kitt-u_opacityEnter_o9rkayr";
4952
- const opacityEnterActive$1 = "kitt-u_opacityEnterActive_od7zvm9";
4953
- const opacityExit$1 = "kitt-u_opacityExit_opddo9j";
4954
- const opacityExitActive$1 = "kitt-u_opacityExitActive_o15v6ove";
4955
- const opacityClassNames$1 = {
4956
- appear: opacityEnter$1,
4957
- appearActive: opacityEnterActive$1,
4958
- enter: opacityEnter$1,
4959
- enterActive: opacityEnterActive$1,
4960
- exit: opacityExit$1,
4961
- exitActive: opacityExitActive$1
4962
- };
4963
- function DialogModalAnimation({
4935
+ function NativeOpacityAnimation({
4936
+ visible,
4964
4937
  children,
4965
- appear = true,
4938
+ onExited
4939
+ }) {
4940
+ const theme = useTheme();
4941
+ const hasRunAnimationRef = react.useRef(false);
4942
+ react.useEffect(() => {
4943
+ if (visible) {
4944
+ hasRunAnimationRef.current = true;
4945
+ }
4946
+ }, [visible]);
4947
+ function handleAnimationFinished() {
4948
+ if (!visible && hasRunAnimationRef.current) {
4949
+ onExited();
4950
+ }
4951
+ }
4952
+ const opacityStyle = Animated.useAnimatedStyle(() => {
4953
+ const {
4954
+ duration,
4955
+ easing
4956
+ } = theme.kitt.dialogModal.animation.overlay;
4957
+ const {
4958
+ x1,
4959
+ y1,
4960
+ x2,
4961
+ y2
4962
+ } = easing;
4963
+ return {
4964
+ opacity: Animated.withTiming(visible ? 1 : 0, {
4965
+ duration,
4966
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
4967
+ }, isFinished => {
4968
+ if (!isFinished) return;
4969
+ Animated.runOnJS(handleAnimationFinished)();
4970
+ })
4971
+ };
4972
+ }, [theme, visible, handleAnimationFinished]);
4973
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
4974
+ style: [reactNative.StyleSheet.absoluteFillObject, opacityStyle],
4975
+ children: children
4976
+ });
4977
+ }
4978
+
4979
+ function NativeRotationAnimation({
4966
4980
  visible,
4967
- unmountOnExit = true,
4968
- isAnimationEnabled = true,
4981
+ children,
4982
+ onEntered,
4983
+ onExited
4984
+ }) {
4985
+ const theme = useTheme();
4986
+ const hasRunAnimationRef = react.useRef(false);
4987
+ const rotation = Animated.useSharedValue(0.8);
4988
+ react.useEffect(() => {
4989
+ if (visible) {
4990
+ hasRunAnimationRef.current = true;
4991
+ }
4992
+ }, [visible]);
4993
+ function handleAnimationFinished() {
4994
+ if (visible) {
4995
+ if (onEntered) onEntered();
4996
+ }
4997
+ if (!visible && hasRunAnimationRef.current) onExited();
4998
+ }
4999
+ const animatedStyle = Animated.useAnimatedStyle(() => {
5000
+ const {
5001
+ duration,
5002
+ easing
5003
+ } = theme.kitt.dialogModal.animation.content;
5004
+ const {
5005
+ x1,
5006
+ y1,
5007
+ x2,
5008
+ y2
5009
+ } = easing;
5010
+ rotation.value = Animated.withTiming(visible ? 0 : 5, {
5011
+ duration,
5012
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
5013
+ }, isFinished => {
5014
+ if (!isFinished) return;
5015
+ Animated.runOnJS(handleAnimationFinished)();
5016
+ });
5017
+ return {
5018
+ opacity: Animated.withTiming(visible ? 1 : 0, {
5019
+ duration,
5020
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
5021
+ }),
5022
+ transform: [{
5023
+ scale: Animated.withTiming(visible ? 1 : 0.8, {
5024
+ duration,
5025
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
5026
+ })
5027
+ }, {
5028
+ rotateZ: `${rotation.value}deg`
5029
+ }]
5030
+ };
5031
+ }, [theme, visible, rotation, handleAnimationFinished]);
5032
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
5033
+ style: [animatedStyle],
5034
+ children: children
5035
+ });
5036
+ }
5037
+
5038
+ function DialogModalAnimation({
5039
+ visible,
5040
+ children,
4969
5041
  onEnter,
4970
5042
  onEntered,
4971
5043
  onExit,
4972
5044
  onExited,
4973
- onClose,
4974
- ...props
5045
+ onClose
4975
5046
  }) {
4976
- // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
4977
- // See https://github.com/reactjs/react-transition-group/issues/918
4978
- const overlayRef = react.useRef(null);
4979
- const contentRef = react.useRef(null);
4980
- const theme = useTheme();
4981
- const {
4982
- animation
4983
- } = theme.kitt.dialogModal;
4984
- const sharedProps = {
4985
- in: visible,
4986
- appear,
4987
- unmountOnExit
5047
+ const [isModalVisible, setIsModalVisible] = react.useState(visible);
5048
+ const [isContentVisible, setIsContentVisible] = react.useState(false);
5049
+ const handleAnimationExited = () => {
5050
+ setIsModalVisible(false);
5051
+ // Android doesn't handle the onDismiss callback on the modal, we need to call it manually
4988
5052
  };
4989
- return /*#__PURE__*/jsxRuntime.jsxs(View, {
4990
- ...props,
4991
- height: "100%",
4992
- justifyContent: "center",
4993
- children: [/*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
4994
- ...sharedProps,
4995
- nodeRef: overlayRef,
4996
- timeout: isAnimationEnabled ? animation.overlay.duration : 0,
4997
- classNames: opacityClassNames$1,
4998
- children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
4999
- ref: overlayRef,
5000
- onPress: onClose
5001
- })
5002
- }), /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
5003
- ...sharedProps,
5004
- nodeRef: contentRef,
5005
- timeout: isAnimationEnabled ? animation.content.duration : 0,
5006
- classNames: contentAnimationClassNames,
5007
- onEnter: onEnter,
5008
- onEntered: onEntered,
5009
- onExit: onExit,
5010
- onExited: onExited,
5011
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
5012
- ref: contentRef,
5013
- alignItems: "center",
5014
- paddingX: "kitt.dialogModal.overlayPadding.horizontal",
5015
- paddingY: "kitt.dialogModal.overlayPadding.vertical",
5016
- margin: "auto",
5017
- children: children
5018
- })
5019
- })]
5053
+ react.useEffect(() => {
5054
+ if (!(!visible && isContentVisible)) return;
5055
+ if (onExit) onExit();
5056
+ setIsContentVisible(false);
5057
+ }, [visible, isContentVisible, onExit]);
5058
+ return /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
5059
+ transparent: true,
5060
+ supportedOrientations: ['landscape', 'portrait'],
5061
+ visible: isModalVisible,
5062
+ onShow: () => {
5063
+ if (onEnter) onEnter();
5064
+ setIsContentVisible(true);
5065
+ },
5066
+ onDismiss: () => {
5067
+ if (onExited) onExited();
5068
+ },
5069
+ children: /*#__PURE__*/jsxRuntime.jsxs(View
5070
+ // This is an ugly workaround to make the Modal calculate its height correctly on Android.
5071
+ // This ugly workaround is used in FullScreenModalAnimation and CardModalAnimation as well
5072
+ // TODO [expo@>=53]: Check if still needed
5073
+ , {
5074
+ height: undefined,
5075
+ position: "relative",
5076
+ flexGrow: 1,
5077
+ justifyContent: "center",
5078
+ alignItems: "center",
5079
+ children: [/*#__PURE__*/jsxRuntime.jsx(NativeOpacityAnimation, {
5080
+ visible: isContentVisible,
5081
+ onExited: handleAnimationExited,
5082
+ children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
5083
+ onPress: onClose
5084
+ })
5085
+ }), /*#__PURE__*/jsxRuntime.jsx(NativeRotationAnimation, {
5086
+ visible: isContentVisible,
5087
+ onExited: handleAnimationExited,
5088
+ onEntered: onEntered,
5089
+ children: /*#__PURE__*/jsxRuntime.jsx(View, {
5090
+ paddingX: "kitt.dialogModal.overlayPadding.horizontal",
5091
+ paddingY: "kitt.dialogModal.overlayPadding.vertical",
5092
+ children: children
5093
+ })
5094
+ })]
5095
+ })
5020
5096
  });
5021
5097
  }
5022
5098
 
@@ -7571,29 +7647,23 @@ function FullscreenModalFooter({
7571
7647
  });
7572
7648
  }
7573
7649
 
7574
- const slideInFromBottomEnter = "kitt-u_slideInFromBottomEnter_s1717rto";
7575
- const slideInFromBottomEnterActive = "kitt-u_slideInFromBottomEnterActive_sux6xgc";
7576
- const slideInFromBottomExit = "kitt-u_slideInFromBottomExit_sl0lsxt";
7577
- const slideInFromBottomExitActive = "kitt-u_slideInFromBottomExitActive_srlzzmu";
7578
- const slideInClassNames = {
7579
- appear: slideInFromBottomEnter,
7580
- appearActive: slideInFromBottomEnterActive,
7581
- enter: slideInFromBottomEnter,
7582
- enterActive: slideInFromBottomEnterActive,
7583
- exit: slideInFromBottomExit,
7584
- exitActive: slideInFromBottomExitActive
7650
+ const styles$1 = {"overlay-enter":"FullscreenModalAnimation-module_overlay-enter__L1J1X","overlay-enter-active":"FullscreenModalAnimation-module_overlay-enter-active__gDEVb","overlay-exit":"FullscreenModalAnimation-module_overlay-exit__Qx1WE","overlay-exit-active":"FullscreenModalAnimation-module_overlay-exit-active__lFR3x","content-enter":"FullscreenModalAnimation-module_content-enter__JmCWa","content-enter-active":"FullscreenModalAnimation-module_content-enter-active__iaNRs","content-exit":"FullscreenModalAnimation-module_content-exit__hB0wY","content-exit-active":"FullscreenModalAnimation-module_content-exit-active__BPVPo"};
7651
+
7652
+ const overlayClassNames = {
7653
+ appear: styles$1['overlay-enter'],
7654
+ appearActive: styles$1['overlay-enter-active'],
7655
+ enter: styles$1['overlay-enter'],
7656
+ enterActive: styles$1['overlay-enter-active'],
7657
+ exit: styles$1['overlay-exit'],
7658
+ exitActive: styles$1['overlay-exit-active']
7585
7659
  };
7586
- const opacityEnter = "kitt-u_opacityEnter_okm44hr";
7587
- const opacityEnterActive = "kitt-u_opacityEnterActive_o2w8t0i";
7588
- const opacityExit = "kitt-u_opacityExit_o14r8iix";
7589
- const opacityExitActive = "kitt-u_opacityExitActive_oim72y2";
7590
- const opacityClassNames = {
7591
- appear: opacityEnter,
7592
- appearActive: opacityEnterActive,
7593
- enter: opacityEnter,
7594
- enterActive: opacityEnterActive,
7595
- exit: opacityExit,
7596
- exitActive: opacityExitActive
7660
+ const slideInClassNames = {
7661
+ appear: styles$1['content-enter'],
7662
+ appearActive: styles$1['content-enter-active'],
7663
+ enter: styles$1['content-enter'],
7664
+ enterActive: styles$1['content-enter-active'],
7665
+ exit: styles$1['content-exit'],
7666
+ exitActive: styles$1['content-exit-active']
7597
7667
  };
7598
7668
  function FullscreenModalAnimation({
7599
7669
  children,
@@ -7621,31 +7691,44 @@ function FullscreenModalAnimation({
7621
7691
  appear,
7622
7692
  unmountOnExit
7623
7693
  };
7624
- return /*#__PURE__*/jsxRuntime.jsxs(View, {
7694
+
7695
+ // CSS custom properties for theme-based animation values
7696
+ const overlayEasing = animation.overlay.easing;
7697
+ const contentEasing = animation.content.easing;
7698
+ const cssVariables = {
7699
+ '--overlay-duration': `${animation.overlay.duration}ms`,
7700
+ '--overlay-easing': `cubic-bezier(${overlayEasing.x1}, ${overlayEasing.y1}, ${overlayEasing.x2}, ${overlayEasing.y2})`,
7701
+ '--content-duration': `${animation.content.duration}ms`,
7702
+ '--content-easing': `cubic-bezier(${contentEasing.x1}, ${contentEasing.y1}, ${contentEasing.x2}, ${contentEasing.y2})`
7703
+ };
7704
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
7625
7705
  ...props,
7626
- children: [/*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
7627
- ...sharedProps,
7628
- nodeRef: overlayRef,
7629
- timeout: isAnimationEnabled ? animation.overlay.duration : 0,
7630
- classNames: opacityClassNames,
7631
- children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
7632
- ref: overlayRef,
7633
- onPress: onClose
7634
- })
7635
- }), /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
7636
- ...sharedProps,
7637
- nodeRef: contentRef,
7638
- timeout: isAnimationEnabled ? animation.content.duration : 0,
7639
- classNames: slideInClassNames,
7640
- onEnter: onEnter,
7641
- onEntered: onEntered,
7642
- onExit: onExit,
7643
- onExited: onExited,
7644
- children: /*#__PURE__*/jsxRuntime.jsx(View, {
7645
- ref: contentRef,
7646
- children: children
7647
- })
7648
- })]
7706
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
7707
+ style: cssVariables,
7708
+ children: [/*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
7709
+ ...sharedProps,
7710
+ nodeRef: overlayRef,
7711
+ timeout: isAnimationEnabled ? animation.overlay.duration : 0,
7712
+ classNames: overlayClassNames,
7713
+ children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
7714
+ ref: overlayRef,
7715
+ onPress: onClose
7716
+ })
7717
+ }), /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
7718
+ ...sharedProps,
7719
+ nodeRef: contentRef,
7720
+ timeout: isAnimationEnabled ? animation.content.duration : 0,
7721
+ classNames: slideInClassNames,
7722
+ onEnter: onEnter,
7723
+ onEntered: onEntered,
7724
+ onExit: onExit,
7725
+ onExited: onExited,
7726
+ children: /*#__PURE__*/jsxRuntime.jsx(View, {
7727
+ ref: contentRef,
7728
+ children: children
7729
+ })
7730
+ })]
7731
+ })
7649
7732
  });
7650
7733
  }
7651
7734