@ornikar/kitt-universal 31.1.2-canary.b586e0e9612495f8597e9c4be7d2c5a28baa9437.0 → 31.2.1-canary.338c0e3dad9e12a43d9c58a1a2e846e1df8c075b.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.
@@ -1,4 +1,12 @@
1
1
  .kitt-u_overflowHidden_otm3u3{overflow:hidden;}
2
+ .kitt-u_contentAnimationEnter_c11xxy4r{opacity:0;-webkit-transform:rotateZ(5deg) scale(0.8);-ms-transform:rotateZ(5deg) scale(0.8);transform:rotateZ(5deg) scale(0.8);}
3
+ .kitt-u_contentAnimatioEnterActive_cl52117{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);}
4
+ .kitt-u_contentAnimatioExit_cyjczep{opacity:1;-webkit-transform:rotateZ(0) scale(1);-ms-transform:rotateZ(0) scale(1);transform:rotateZ(0) scale(1);}
5
+ .kitt-u_contentAnimatioExitActive_cpsy3dt{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);}
6
+ .kitt-u_opacityEnter_o1ae40dx{opacity:0;}
7
+ .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);}
8
+ .kitt-u_opacityExit_ogyytm1{opacity:1;}
9
+ .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);}
2
10
  .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);}
3
11
  .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);}
4
12
  .kitt-u_contentAnimatioExit_cwjstxl{opacity:1;-webkit-transform:rotateZ(0) scale(1);-ms-transform:rotateZ(0) scale(1);transform:rotateZ(0) scale(1);}
@@ -8,7 +8,6 @@ const jsxRuntime = require('react/jsx-runtime');
8
8
  const phosphor = require('@ornikar/kitt-icons/phosphor');
9
9
  const reactNative = require('react-native');
10
10
  const reactDom = require('react-dom');
11
- const Animated = require('react-native-reanimated');
12
11
  const reactTransitionGroup = require('react-transition-group');
13
12
  const parser = require('@twemoji/parser');
14
13
  const Downshift = require('downshift');
@@ -17,6 +16,7 @@ const expoImagePicker = require('expo-image-picker');
17
16
  const useDebounce = require('use-debounce');
18
17
  const jsApiLoader = require('@googlemaps/js-api-loader');
19
18
  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 Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
30
29
  const Downshift__default = /*#__PURE__*/_interopDefaultLegacy(Downshift);
30
+ const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
31
31
  const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
32
32
  const isChromatic__default = /*#__PURE__*/_interopDefaultLegacy(isChromatic);
33
33
 
@@ -4333,161 +4333,85 @@ const CardModalRotationContainer = /*#__PURE__*/react.forwardRef((props, ref) =>
4333
4333
  });
4334
4334
  });
4335
4335
 
4336
- function NativeOpacityAnimation({
4337
- visible,
4338
- children,
4339
- onExited
4340
- }) {
4341
- const theme = useTheme();
4342
- const hasRunAnimationRef = react.useRef(false);
4343
- function handleAnimationFinished() {
4344
- if (visible) {
4345
- hasRunAnimationRef.current = true;
4346
- }
4347
- if (!visible && hasRunAnimationRef.current) {
4348
- onExited();
4349
- }
4350
- }
4351
- const opacityStyle = Animated.useAnimatedStyle(() => {
4352
- const {
4353
- duration,
4354
- easing
4355
- } = theme.kitt.cardModal.animation.overlay;
4356
- const {
4357
- x1,
4358
- y1,
4359
- x2,
4360
- y2
4361
- } = easing;
4362
- return {
4363
- opacity: Animated.withTiming(visible ? 1 : 0, {
4364
- duration,
4365
- easing: Animated.Easing.bezier(x1, y1, x2, y2)
4366
- }, isFinished => {
4367
- if (!isFinished) return;
4368
- Animated.runOnJS(handleAnimationFinished)();
4369
- })
4370
- };
4371
- }, [visible]);
4372
- return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
4373
- style: [reactNative.StyleSheet.absoluteFillObject, opacityStyle],
4374
- children: children
4375
- });
4376
- }
4377
-
4378
- function NativeRotationAnimation({
4379
- visible,
4380
- children,
4381
- onEntered,
4382
- onExited
4383
- }) {
4384
- const theme = useTheme();
4385
- const hasRunAnimationRef = react.useRef(false);
4386
- const rotation = Animated.useSharedValue(0.8);
4387
- function handleAnimationFinished() {
4388
- if (visible) {
4389
- if (onEntered) onEntered();
4390
- hasRunAnimationRef.current = true;
4391
- }
4392
- if (!visible && hasRunAnimationRef.current) onExited();
4393
- }
4394
- const animatedStyle = Animated.useAnimatedStyle(() => {
4395
- const {
4396
- duration,
4397
- easing
4398
- } = theme.kitt.cardModal.animation.content;
4399
- const {
4400
- x1,
4401
- y1,
4402
- x2,
4403
- y2
4404
- } = easing;
4405
- rotation.value = Animated.withTiming(visible ? 0 : 5, {
4406
- duration,
4407
- easing: Animated.Easing.bezier(x1, y1, x2, y2)
4408
- }, isFinished => {
4409
- if (!isFinished) return;
4410
- Animated.runOnJS(handleAnimationFinished)();
4411
- });
4412
- return {
4413
- opacity: Animated.withTiming(visible ? 1 : 0, {
4414
- duration,
4415
- easing: Animated.Easing.bezier(x1, y1, x2, y2)
4416
- }),
4417
- transform: [{
4418
- scale: Animated.withTiming(visible ? 1 : 0.8, {
4419
- duration,
4420
- easing: Animated.Easing.bezier(x1, y1, x2, y2)
4421
- })
4422
- }, {
4423
- rotateZ: `${rotation.value}deg`
4424
- }]
4425
- };
4426
- }, [rotation, visible]);
4427
- return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
4428
- style: [{
4429
- flexShrink: 1
4430
- }, animatedStyle],
4431
- children: children
4432
- });
4433
- }
4434
-
4336
+ const contentAnimationEnter$1 = "kitt-u_contentAnimationEnter_c11xxy4r";
4337
+ const contentAnimatioEnterActive$1 = "kitt-u_contentAnimatioEnterActive_cl52117";
4338
+ const contentAnimatioExit$1 = "kitt-u_contentAnimatioExit_cyjczep";
4339
+ const contentAnimatioExitActive$1 = "kitt-u_contentAnimatioExitActive_cpsy3dt";
4340
+ const contentAnimationClassNames$1 = {
4341
+ appear: contentAnimationEnter$1,
4342
+ appearActive: contentAnimatioEnterActive$1,
4343
+ enter: contentAnimationEnter$1,
4344
+ enterActive: contentAnimatioEnterActive$1,
4345
+ exit: contentAnimatioExit$1,
4346
+ exitActive: contentAnimatioExitActive$1
4347
+ };
4348
+ const opacityEnter$2 = "kitt-u_opacityEnter_o1ae40dx";
4349
+ const opacityEnterActive$2 = "kitt-u_opacityEnterActive_o1t4vl7b";
4350
+ const opacityExit$2 = "kitt-u_opacityExit_ogyytm1";
4351
+ const opacityExitActive$2 = "kitt-u_opacityExitActive_o18xvk52";
4352
+ const opacityClassNames$2 = {
4353
+ appear: opacityEnter$2,
4354
+ appearActive: opacityEnterActive$2,
4355
+ enter: opacityEnter$2,
4356
+ enterActive: opacityEnterActive$2,
4357
+ exit: opacityExit$2,
4358
+ exitActive: opacityExitActive$2
4359
+ };
4435
4360
  function CardModalAnimation({
4436
- visible,
4437
4361
  children,
4362
+ appear = true,
4363
+ visible,
4364
+ unmountOnExit = true,
4365
+ isAnimationEnabled = true,
4438
4366
  onEnter,
4439
4367
  onEntered,
4440
4368
  onExit,
4441
4369
  onExited,
4442
- onClose
4370
+ onClose,
4371
+ ...props
4443
4372
  }) {
4444
- const [isModalVisible, setIsModalVisible] = react.useState(visible);
4445
- const [isContentVisible, setIsContentVisible] = react.useState(false);
4446
- const handleAnimationExited = () => {
4447
- setIsModalVisible(false);
4448
- // Android doesn't handle the onDismiss callback on the modal, we need to call it manually
4373
+ // React 19 has removed the ReactDOM.findDOMNode method. We need to use refs to access DOM nodes in CSSTransition.
4374
+ // See https://github.com/reactjs/react-transition-group/issues/918
4375
+ const overlayRef = react.useRef(null);
4376
+ const contentRef = react.useRef(null);
4377
+ const theme = useTheme();
4378
+ const {
4379
+ animation
4380
+ } = theme.kitt.cardModal;
4381
+ const sharedProps = {
4382
+ in: visible,
4383
+ appear,
4384
+ unmountOnExit
4449
4385
  };
4450
- react.useEffect(() => {
4451
- if (!(!visible && isContentVisible)) return;
4452
- if (onExit) onExit();
4453
- setIsContentVisible(false);
4454
- }, [visible, isContentVisible, onExit]);
4455
- return /*#__PURE__*/jsxRuntime.jsx(reactNative.Modal, {
4456
- transparent: true,
4457
- supportedOrientations: ['landscape', 'portrait'],
4458
- visible: isModalVisible,
4459
- onShow: () => {
4460
- if (onEnter) onEnter();
4461
- setIsContentVisible(true);
4462
- },
4463
- onDismiss: () => {
4464
- if (onExited) onExited();
4465
- },
4466
- children: /*#__PURE__*/jsxRuntime.jsxs(View
4467
- // This is an ugly workaround to make the Modal calculate its height correctly on Android.
4468
- // This ugly workaround is used in FullScreenModalAnimation and DialogModalAnimation as well
4469
- // TODO [expo@>=53]: Check if still needed
4470
- , {
4471
- height: undefined,
4472
- position: "relative",
4473
- flexGrow: 1,
4474
- justifyContent: "center",
4475
- alignItems: "center",
4476
- children: [/*#__PURE__*/jsxRuntime.jsx(NativeOpacityAnimation, {
4477
- visible: isContentVisible,
4478
- onExited: handleAnimationExited,
4479
- children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
4480
- onPress: onClose
4481
- })
4482
- }), /*#__PURE__*/jsxRuntime.jsx(CardModalRotationContainer, {
4483
- children: /*#__PURE__*/jsxRuntime.jsx(NativeRotationAnimation, {
4484
- visible: isContentVisible,
4485
- onExited: handleAnimationExited,
4486
- onEntered: onEntered,
4487
- children: children
4488
- })
4489
- })]
4490
- })
4386
+ return /*#__PURE__*/jsxRuntime.jsxs(View, {
4387
+ ...props,
4388
+ height: "100%",
4389
+ justifyContent: "center",
4390
+ children: [/*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
4391
+ ...sharedProps,
4392
+ nodeRef: overlayRef,
4393
+ timeout: isAnimationEnabled ? animation.overlay.duration : 0,
4394
+ classNames: opacityClassNames$2,
4395
+ children: /*#__PURE__*/jsxRuntime.jsx(Overlay, {
4396
+ ref: overlayRef,
4397
+ onPress: onClose
4398
+ })
4399
+ }), /*#__PURE__*/jsxRuntime.jsx(reactTransitionGroup.CSSTransition, {
4400
+ ...sharedProps,
4401
+ nodeRef: contentRef,
4402
+ timeout: isAnimationEnabled ? animation.content.duration : 0,
4403
+ classNames: contentAnimationClassNames$1,
4404
+ onEnter: onEnter,
4405
+ onEntered: onEntered,
4406
+ onExit: onExit,
4407
+ onExited: onExited,
4408
+ children: /*#__PURE__*/jsxRuntime.jsx(CardModalRotationContainer, {
4409
+ ref: contentRef,
4410
+ alignItems: "center",
4411
+ margin: "auto",
4412
+ children: children
4413
+ })
4414
+ })]
4491
4415
  });
4492
4416
  }
4493
4417