@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.
@@ -22,11 +22,12 @@ import { launchImageLibraryAsync } from 'expo-image-picker';
22
22
  import { useDebouncedCallback } from 'use-debounce';
23
23
  import { Loader } from '@googlemaps/js-api-loader';
24
24
  import { parseNumber, getCountryCallingCode, isValidNumber } from 'libphonenumber-js';
25
- import Animated, { useAnimatedStyle, withSpring, withTiming, useSharedValue, interpolateColor, Easing, useAnimatedProps, withDelay, withRepeat, runOnJS, interpolate } from 'react-native-reanimated';
25
+ import Animated, { useAnimatedStyle, withSpring, withTiming, useSharedValue, interpolateColor, Easing, useAnimatedProps, withDelay, withRepeat, interpolate, runOnJS } from 'react-native-reanimated';
26
26
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
27
27
  import Svg, { Circle as Circle$1 } from 'react-native-svg';
28
28
  import { useFloating, autoUpdate, offset, autoPlacement, shift, arrow } from '@floating-ui/react-dom';
29
29
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
30
+ import { LinearGradient } from 'expo-linear-gradient';
30
31
  import { makeDecorator } from '@storybook/addons';
31
32
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
32
33
 
@@ -2313,7 +2314,7 @@ var shadows = {
2313
2314
 
2314
2315
  var skeletonBackgroundColor = deepPurpleColorPalette['beige.2'];
2315
2316
  var skeletonFlareColor = deepPurpleColorPalette['beige.3'];
2316
- var skeleton$1 = {
2317
+ var skeleton = {
2317
2318
  backgroundColor: skeletonBackgroundColor,
2318
2319
  flareColor: skeletonFlareColor,
2319
2320
  animationDuration: 1000,
@@ -2655,7 +2656,7 @@ var theme = {
2655
2656
  pageLoader: pageLoader,
2656
2657
  picker: picker,
2657
2658
  shadows: shadows,
2658
- skeleton: skeleton$1,
2659
+ skeleton: skeleton,
2659
2660
  tabBar: tabBar,
2660
2661
  tag: tag,
2661
2662
  sticker: sticker,
@@ -11611,12 +11612,47 @@ function SegmentedProgressBar(_ref) {
11611
11612
  });
11612
11613
  }
11613
11614
 
11614
- var skeleton = "kitt-u_skeleton_sc3upcl";
11615
- var skeletonWithoutAnimation = "kitt-u_skeletonWithoutAnimation_s12gop2o";
11616
11615
  function SkeletonContent(_ref) {
11617
- var isLoading = _ref.isLoading;
11618
- return /*#__PURE__*/jsx("div", {
11619
- className: (skeleton ) + " " + ((!isLoading ? skeletonWithoutAnimation : undefined) || "")
11616
+ var isLoading = _ref.isLoading,
11617
+ width = _ref.width;
11618
+ var theme = useTheme();
11619
+ var sharedX = useSharedValue(0);
11620
+ useEffect(function () {
11621
+ if (isLoading) {
11622
+ sharedX.value = withRepeat(withTiming(1, {
11623
+ duration: theme.kitt.skeleton.animationDuration,
11624
+ easing: Easing.inOut(Easing.ease)
11625
+ }), -1);
11626
+ }
11627
+ }, [sharedX, width, isLoading, theme]);
11628
+ var linearGradientStyle = useAnimatedStyle(function () {
11629
+ return {
11630
+ transform: [{
11631
+ translateX: interpolate(sharedX.value, [0, 1], [-width, width])
11632
+ }]
11633
+ };
11634
+ }, [sharedX, width]);
11635
+ return /*#__PURE__*/jsx(View, {
11636
+ height: "100%",
11637
+ width: "100%",
11638
+ backgroundColor: "kitt.skeleton.backgroundColor",
11639
+ borderColor: "kitt.skeleton.flareColor",
11640
+ children: /*#__PURE__*/jsx(Animated.View, {
11641
+ style: [StyleSheet.absoluteFill, linearGradientStyle],
11642
+ children: /*#__PURE__*/jsx(LinearGradient, {
11643
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
11644
+ locations: [0.1, 0.5, 0.9],
11645
+ start: {
11646
+ x: 0,
11647
+ y: 0
11648
+ },
11649
+ end: {
11650
+ x: 1,
11651
+ y: 0
11652
+ },
11653
+ style: StyleSheet.absoluteFill
11654
+ })
11655
+ })
11620
11656
  });
11621
11657
  }
11622
11658