@ornikar/kitt-universal 29.1.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.
@@ -25,12 +25,9 @@
25
25
  .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);}
26
26
  .kitt-u_opacityExit_o14r8iix{opacity:1;}
27
27
  .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);}
28
- .kitt-u_pageLoaderContainer_ptkwz2j{width:60px;height:60px;-webkit-transform:scale(-1) rotate(90deg);-ms-transform:scale(-1) rotate(90deg);transform:scale(-1) rotate(90deg);}@-webkit-keyframes PageLoaderInit-kitt-u_pageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:169.64600329384882px;}100%{stroke-dashoffset:0;}}@keyframes PageLoaderInit-kitt-u_pageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:169.64600329384882px;}100%{stroke-dashoffset:0;}}@-webkit-keyframes PageLoaderOffset-kitt-u_pageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:169.64600329384882px;}100%{stroke-dashoffset:33.929200658769766px;}}@keyframes PageLoaderOffset-kitt-u_pageLoaderContainer_ptkwz2j{0%{stroke-dashoffset:169.64600329384882px;}100%{stroke-dashoffset:33.929200658769766px;}}@-webkit-keyframes PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j{0%{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}100%{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}.kitt-u_pageLoaderContainer_ptkwz2j circle,.kitt-u_pageLoaderContainer_ptkwz2j g{-webkit-transform-origin:center center;-ms-transform-origin:center center;transform-origin:center center;}.kitt-u_pageLoaderContainer_ptkwz2j g[data-large-loader='base'] circle{-webkit-animation:1000ms cubic-bezier(0.39,0.575,0.565,1) 500ms forwards;animation:1000ms cubic-bezier(0.39,0.575,0.565,1) 500ms forwards;-webkit-animation-name:PageLoaderInit-kitt-u_pageLoaderContainer_ptkwz2j;animation-name:PageLoaderInit-kitt-u_pageLoaderContainer_ptkwz2j;}.kitt-u_pageLoaderContainer_ptkwz2j g[data-large-loader='fill']{-webkit-animation:1800ms linear 500ms infinite;animation:1800ms linear 500ms infinite;-webkit-animation-name:PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j;animation-name:PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j;}.kitt-u_pageLoaderContainer_ptkwz2j g[data-large-loader='fill'] circle{-webkit-animation:1800ms cubic-bezier(0.39,0.575,0.565,1) 500ms infinite alternate,2160ms linear 500ms infinite;animation:1800ms cubic-bezier(0.39,0.575,0.565,1) 500ms infinite alternate,2160ms linear 500ms infinite;-webkit-animation-name:PageLoaderOffset-kitt-u_pageLoaderContainer_ptkwz2j,PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j;animation-name:PageLoaderOffset-kitt-u_pageLoaderContainer_ptkwz2j,PageLoaderRotation-kitt-u_pageLoaderContainer_ptkwz2j;}
29
28
  .kitt-u_enter_ereraf{-webkit-transform:translateY(8px);-ms-transform:translateY(8px);transform:translateY(8px);opacity:0;}
30
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;}
31
30
  .kitt-u_exit_e1mwnccz{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0);opacity:1;}
32
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;}
33
- .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;}
34
- .kitt-u_skeletonWithoutAnimation_s12gop2o::after{background-image:none;-webkit-animation:none;animation:none;}
35
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;}
36
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;}
@@ -18,13 +18,16 @@ const jsApiLoader = require('@googlemaps/js-api-loader');
18
18
  const libphonenumberJs = require('libphonenumber-js');
19
19
  const Animated = require('react-native-reanimated');
20
20
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
21
+ const Svg = require('react-native-svg');
21
22
  const reactDom$1 = require('@floating-ui/react-dom');
23
+ const expoLinearGradient = require('expo-linear-gradient');
22
24
  const addons = require('@storybook/addons');
23
25
 
24
26
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
25
27
 
26
28
  const Downshift__default = /*#__PURE__*/_interopDefaultLegacy(Downshift);
27
29
  const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
30
+ const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
28
31
 
29
32
  const View = nativeBase.View;
30
33
  const ScrollView = nativeBase.ScrollView;
@@ -2301,7 +2304,7 @@ const shadows = {
2301
2304
 
2302
2305
  const skeletonBackgroundColor = deepPurpleColorPalette['beige.2'];
2303
2306
  const skeletonFlareColor = deepPurpleColorPalette['beige.3'];
2304
- const skeleton$1 = {
2307
+ const skeleton = {
2305
2308
  backgroundColor: skeletonBackgroundColor,
2306
2309
  flareColor: skeletonFlareColor,
2307
2310
  animationDuration: 1000,
@@ -2641,7 +2644,7 @@ const theme = {
2641
2644
  pageLoader,
2642
2645
  picker,
2643
2646
  shadows,
2644
- skeleton: skeleton$1,
2647
+ skeleton,
2645
2648
  tabBar,
2646
2649
  tag,
2647
2650
  sticker,
@@ -10959,49 +10962,160 @@ function Notification({
10959
10962
  });
10960
10963
  }
10961
10964
 
10962
- const pageLoaderContainer = "kitt-u_pageLoaderContainer_ptkwz2j";
10963
- function PageLoader() {
10965
+ const AnimatedCircle = Animated__default.createAnimatedComponent(Svg.Circle);
10966
+ function AnimatedLoaderCircle({
10967
+ color,
10968
+ progress
10969
+ }) {
10970
+ const theme = useTheme();
10971
+ const {
10972
+ strokeWidth,
10973
+ size
10974
+ } = theme.kitt.pageLoader;
10975
+ const centerCoord = size * 0.5;
10976
+ const circlePerimeter = 2 * Math.PI * (size * 0.5 - strokeWidth);
10977
+ const strokeAnimation = Animated.useAnimatedProps(() => {
10978
+ return {
10979
+ strokeDashoffset: circlePerimeter - circlePerimeter * progress.value
10980
+ };
10981
+ }, [progress, circlePerimeter]);
10982
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedCircle, {
10983
+ "transform-origin": "center center",
10984
+ strokeWidth: strokeWidth,
10985
+ stroke: color,
10986
+ strokeLinecap: "round",
10987
+ cx: centerCoord,
10988
+ cy: centerCoord,
10989
+ r: centerCoord - strokeWidth,
10990
+ fill: "none",
10991
+ strokeDasharray: circlePerimeter,
10992
+ animatedProps: strokeAnimation
10993
+ });
10994
+ }
10995
+
10996
+ function AnimatedBackgroundCircle() {
10964
10997
  const theme = useTheme();
10998
+ const progress = Animated.useSharedValue(0);
10965
10999
  const {
11000
+ animation,
10966
11001
  colors,
11002
+ size
11003
+ } = theme.kitt.pageLoader;
11004
+ react.useEffect(() => {
11005
+ const {
11006
+ delay,
11007
+ circleBackgroundFillDuration,
11008
+ fillEasingFunction
11009
+ } = animation;
11010
+ const [x1, y1, x2, y2] = fillEasingFunction;
11011
+ progress.value = Animated.withDelay(delay, Animated.withTiming(1, {
11012
+ duration: circleBackgroundFillDuration,
11013
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
11014
+ }));
11015
+ }, [progress, animation]);
11016
+ return /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
11017
+ width: size,
11018
+ height: size,
11019
+ viewBox: `0 0 ${size} ${size}`,
11020
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
11021
+ color: colors.base,
11022
+ progress: progress
11023
+ })
11024
+ });
11025
+ }
11026
+
11027
+ const isInfinitAnimation$1 = -1;
11028
+ function AnimatedFillCircleContainer({
11029
+ children,
11030
+ duration
11031
+ }) {
11032
+ const theme = useTheme();
11033
+ const progress = Animated.useSharedValue(0);
11034
+ const {
11035
+ animation
11036
+ } = theme.kitt.pageLoader;
11037
+ react.useEffect(() => {
11038
+ const {
11039
+ delay
11040
+ } = animation;
11041
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(1, {
11042
+ duration,
11043
+ easing: Animated.Easing.linear
11044
+ }), isInfinitAnimation$1));
11045
+ }, [progress, animation, duration]);
11046
+ const rotationStyles = Animated.useAnimatedStyle(() => {
11047
+ return {
11048
+ transform: [{
11049
+ rotate: `${360 * progress.value}deg`
11050
+ }]
11051
+ };
11052
+ }, [progress]);
11053
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
11054
+ style: [reactNative.StyleSheet.absoluteFill, rotationStyles],
11055
+ children: children
11056
+ });
11057
+ }
11058
+
11059
+ const isInfinitAnimation = -1;
11060
+ const shouldReverse = true;
11061
+ function AnimatedFilledCircle() {
11062
+ const theme = useTheme();
11063
+ const progress = Animated.useSharedValue(0);
11064
+ const {
10967
11065
  size,
10968
- strokeWidth
11066
+ animation,
11067
+ colors
10969
11068
  } = theme.kitt.pageLoader;
10970
- const center = size * 0.5;
10971
- const radius = center - strokeWidth;
10972
- const circlePerimeter = 2 * Math.PI * radius;
10973
- const sharedProps = {
10974
- cx: center,
10975
- cy: center,
10976
- r: radius,
10977
- fill: 'none',
10978
- strokeWidth,
10979
- strokeDasharray: circlePerimeter,
10980
- strokeDashoffset: circlePerimeter,
10981
- strokeLinecap: 'round'
10982
- };
10983
- return /*#__PURE__*/jsxRuntime.jsx("div", {
10984
- className: pageLoaderContainer,
10985
- children: /*#__PURE__*/jsxRuntime.jsxs("svg", {
10986
- width: size,
10987
- height: size,
10988
- children: [/*#__PURE__*/jsxRuntime.jsx("g", {
10989
- "data-large-loader": "base",
10990
- children: /*#__PURE__*/jsxRuntime.jsx("circle", {
10991
- ...sharedProps,
10992
- stroke: colors.base
10993
- })
10994
- }), /*#__PURE__*/jsxRuntime.jsx("g", {
10995
- "data-large-loader": "fill",
10996
- children: /*#__PURE__*/jsxRuntime.jsx("circle", {
10997
- ...sharedProps,
10998
- stroke: colors.fill
11069
+ react.useEffect(() => {
11070
+ const {
11071
+ delay,
11072
+ filledCircleFillDuration,
11073
+ fillEasingFunction
11074
+ } = animation;
11075
+ const [x1, y1, x2, y2] = fillEasingFunction;
11076
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(0.8, {
11077
+ duration: filledCircleFillDuration,
11078
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
11079
+ }), isInfinitAnimation, shouldReverse));
11080
+ }, [progress, animation]);
11081
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
11082
+ duration: animation.groupFilledCircleRotationDuration,
11083
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
11084
+ duration: animation.filledCircleRotationDuration,
11085
+ children: /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
11086
+ width: size,
11087
+ height: size,
11088
+ viewBox: `0 0 ${size} ${size}`,
11089
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
11090
+ color: colors.fill,
11091
+ progress: progress
10999
11092
  })
11000
- })]
11093
+ })
11001
11094
  })
11002
11095
  });
11003
11096
  }
11004
11097
 
11098
+ function PageLoader() {
11099
+ const sharedTransformStyle = {
11100
+ style: {
11101
+ /* Needed to make the animation starting from the top of the circles */
11102
+ transform: [{
11103
+ rotate: '90deg'
11104
+ }, {
11105
+ scale: -1
11106
+ }]
11107
+ }
11108
+ };
11109
+ return /*#__PURE__*/jsxRuntime.jsxs(View, {
11110
+ position: "relative",
11111
+ height: "kitt.pageLoader.size",
11112
+ width: "kitt.pageLoader.size",
11113
+ _ios: sharedTransformStyle,
11114
+ _android: sharedTransformStyle,
11115
+ children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsxRuntime.jsx(AnimatedFilledCircle, {})]
11116
+ });
11117
+ }
11118
+
11005
11119
  function getBackgroundColor({
11006
11120
  isSelected,
11007
11121
  isHighlighted,
@@ -11327,13 +11441,48 @@ function SegmentedProgressBar({
11327
11441
  });
11328
11442
  }
11329
11443
 
11330
- const skeleton = "kitt-u_skeleton_sc3upcl";
11331
- const skeletonWithoutAnimation = "kitt-u_skeletonWithoutAnimation_s12gop2o";
11332
11444
  function SkeletonContent({
11333
- isLoading
11445
+ isLoading,
11446
+ width
11334
11447
  }) {
11335
- return /*#__PURE__*/jsxRuntime.jsx("div", {
11336
- className: (skeleton ) + " " + ((!isLoading ? skeletonWithoutAnimation : undefined) || "")
11448
+ const theme = useTheme();
11449
+ const sharedX = Animated.useSharedValue(0);
11450
+ react.useEffect(() => {
11451
+ if (isLoading) {
11452
+ sharedX.value = Animated.withRepeat(Animated.withTiming(1, {
11453
+ duration: theme.kitt.skeleton.animationDuration,
11454
+ easing: Animated.Easing.inOut(Animated.Easing.ease)
11455
+ }), -1);
11456
+ }
11457
+ }, [sharedX, width, isLoading, theme]);
11458
+ const linearGradientStyle = Animated.useAnimatedStyle(() => {
11459
+ return {
11460
+ transform: [{
11461
+ translateX: Animated.interpolate(sharedX.value, [0, 1], [-width, width])
11462
+ }]
11463
+ };
11464
+ }, [sharedX, width]);
11465
+ return /*#__PURE__*/jsxRuntime.jsx(View, {
11466
+ height: "100%",
11467
+ width: "100%",
11468
+ backgroundColor: "kitt.skeleton.backgroundColor",
11469
+ borderColor: "kitt.skeleton.flareColor",
11470
+ children: /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
11471
+ style: [reactNative.StyleSheet.absoluteFill, linearGradientStyle],
11472
+ children: /*#__PURE__*/jsxRuntime.jsx(expoLinearGradient.LinearGradient, {
11473
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
11474
+ locations: [0.1, 0.5, 0.9],
11475
+ start: {
11476
+ x: 0,
11477
+ y: 0
11478
+ },
11479
+ end: {
11480
+ x: 1,
11481
+ y: 0
11482
+ },
11483
+ style: reactNative.StyleSheet.absoluteFill
11484
+ })
11485
+ })
11337
11486
  });
11338
11487
  }
11339
11488