@ornikar/kitt-universal 29.2.0 → 29.3.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.
@@ -29,7 +29,5 @@
29
29
  .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;}
30
30
  .kitt-u_exit_e1mwnccz{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;}
31
31
  .kitt-u_exitActive_e1004d1h{-webkit-transform:translateY(8px);-ms-transform:translateY(8px);transform:translateY(8px);opacity:0;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;}
32
- .kitt-u_skeleton_sc3upcl{background-color:#F1ECE4;position:relative;overflow:hidden;height:100%;width:100%;}@-webkit-keyframes flareTranslate-kitt-u_skeleton_sc3upcl{from{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);}to{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}@keyframes flareTranslate-kitt-u_skeleton_sc3upcl{from{-webkit-transform:translateX(-100%);-ms-transform:translateX(-100%);transform:translateX(-100%);}to{-webkit-transform:translateX(100%);-ms-transform:translateX(100%);transform:translateX(100%);}}.kitt-u_skeleton_sc3upcl::after{content:'';position:absolute;width:100%;height:100%;top:0;left:0;background-image:linear-gradient( -90deg, #F1ECE4, #EAE3D6 50%, #F1ECE4 100% );-webkit-animation:1s ease-in-out infinite;animation:1s ease-in-out infinite;-webkit-animation-name:flareTranslate-kitt-u_skeleton_sc3upcl;animation-name:flareTranslate-kitt-u_skeleton_sc3upcl;}
33
- .kitt-u_skeletonWithoutAnimation_s12gop2o::after{background-image:none;-webkit-animation:none;animation:none;}
34
32
  .kitt-u_displayUnderline_dch42t > *{-webkit-text-decoration:underline;text-decoration:underline;}.kitt-u_displayUnderline_dch42t > *:hover,.kitt-u_displayUnderline_dch42t > *:active,.kitt-hover .kitt-u_displayUnderline_dch42t > *{-webkit-text-decoration:none;text-decoration:none;}
35
33
  .kitt-u_displayUnderlineWhenHovered_d80w0t7 > *{-webkit-text-decoration:none;text-decoration:none;}.kitt-u_displayUnderlineWhenHovered_d80w0t7 > *:hover,.kitt-u_displayUnderlineWhenHovered_d80w0t7 > *:active,.kitt-hover .kitt-u_displayUnderlineWhenHovered_d80w0t7 > *{-webkit-text-decoration:underline;text-decoration:underline;}
@@ -14,10 +14,11 @@ import { launchImageLibraryAsync } from 'expo-image-picker';
14
14
  import { useDebouncedCallback } from 'use-debounce';
15
15
  import { Loader } from '@googlemaps/js-api-loader';
16
16
  import { parseNumber, getCountryCallingCode, isValidNumber } from 'libphonenumber-js';
17
- import Animated, { useAnimatedStyle, withSpring, withTiming, useSharedValue, interpolateColor, Easing, useAnimatedProps, withDelay, withRepeat, runOnJS, interpolate } from 'react-native-reanimated';
17
+ import Animated, { useAnimatedStyle, withSpring, withTiming, useSharedValue, interpolateColor, Easing, useAnimatedProps, withDelay, withRepeat, interpolate, runOnJS } from 'react-native-reanimated';
18
18
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
19
19
  import Svg, { Circle as Circle$1 } from 'react-native-svg';
20
20
  import { useFloating, autoUpdate, offset, autoPlacement, shift, arrow } from '@floating-ui/react-dom';
21
+ import { LinearGradient } from 'expo-linear-gradient';
21
22
  import { makeDecorator } from '@storybook/addons';
22
23
 
23
24
  const View = View$1;
@@ -2295,7 +2296,7 @@ const shadows = {
2295
2296
 
2296
2297
  const skeletonBackgroundColor = deepPurpleColorPalette['beige.2'];
2297
2298
  const skeletonFlareColor = deepPurpleColorPalette['beige.3'];
2298
- const skeleton$1 = {
2299
+ const skeleton = {
2299
2300
  backgroundColor: skeletonBackgroundColor,
2300
2301
  flareColor: skeletonFlareColor,
2301
2302
  animationDuration: 1000,
@@ -2635,7 +2636,7 @@ const theme = {
2635
2636
  pageLoader,
2636
2637
  picker,
2637
2638
  shadows,
2638
- skeleton: skeleton$1,
2639
+ skeleton,
2639
2640
  tabBar,
2640
2641
  tag,
2641
2642
  sticker,
@@ -11432,13 +11433,48 @@ function SegmentedProgressBar({
11432
11433
  });
11433
11434
  }
11434
11435
 
11435
- const skeleton = "kitt-u_skeleton_sc3upcl";
11436
- const skeletonWithoutAnimation = "kitt-u_skeletonWithoutAnimation_s12gop2o";
11437
11436
  function SkeletonContent({
11438
- isLoading
11437
+ isLoading,
11438
+ width
11439
11439
  }) {
11440
- return /*#__PURE__*/jsx("div", {
11441
- className: (skeleton ) + " " + ((!isLoading ? skeletonWithoutAnimation : undefined) || "")
11440
+ const theme = useTheme();
11441
+ const sharedX = useSharedValue(0);
11442
+ useEffect(() => {
11443
+ if (isLoading) {
11444
+ sharedX.value = withRepeat(withTiming(1, {
11445
+ duration: theme.kitt.skeleton.animationDuration,
11446
+ easing: Easing.inOut(Easing.ease)
11447
+ }), -1);
11448
+ }
11449
+ }, [sharedX, width, isLoading, theme]);
11450
+ const linearGradientStyle = useAnimatedStyle(() => {
11451
+ return {
11452
+ transform: [{
11453
+ translateX: interpolate(sharedX.value, [0, 1], [-width, width])
11454
+ }]
11455
+ };
11456
+ }, [sharedX, width]);
11457
+ return /*#__PURE__*/jsx(View, {
11458
+ height: "100%",
11459
+ width: "100%",
11460
+ backgroundColor: "kitt.skeleton.backgroundColor",
11461
+ borderColor: "kitt.skeleton.flareColor",
11462
+ children: /*#__PURE__*/jsx(Animated.View, {
11463
+ style: [StyleSheet.absoluteFill, linearGradientStyle],
11464
+ children: /*#__PURE__*/jsx(LinearGradient, {
11465
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
11466
+ locations: [0.1, 0.5, 0.9],
11467
+ start: {
11468
+ x: 0,
11469
+ y: 0
11470
+ },
11471
+ end: {
11472
+ x: 1,
11473
+ y: 0
11474
+ },
11475
+ style: StyleSheet.absoluteFill
11476
+ })
11477
+ })
11442
11478
  });
11443
11479
  }
11444
11480