@ornikar/kitt-universal 29.0.0 → 29.2.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 (50) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/definitions/Sticker/Sticker.d.ts +10 -0
  3. package/dist/definitions/Sticker/Sticker.d.ts.map +1 -0
  4. package/dist/definitions/index.d.ts +1 -0
  5. package/dist/definitions/index.d.ts.map +1 -1
  6. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +7 -4
  7. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  8. package/dist/definitions/themes/default.d.ts +1 -0
  9. package/dist/definitions/themes/default.d.ts.map +1 -1
  10. package/dist/definitions/themes/late-ocean/sticker.d.ts +9 -0
  11. package/dist/definitions/themes/late-ocean/sticker.d.ts.map +1 -0
  12. package/dist/index-metro.es.android.js +107 -3
  13. package/dist/index-metro.es.android.js.map +1 -1
  14. package/dist/index-metro.es.ios.js +107 -3
  15. package/dist/index-metro.es.ios.js.map +1 -1
  16. package/dist/index-node-22.17.cjs.js +107 -2
  17. package/dist/index-node-22.17.cjs.js.map +1 -1
  18. package/dist/index-node-22.17.cjs.web.css +0 -1
  19. package/dist/index-node-22.17.cjs.web.js +251 -33
  20. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  21. package/dist/index-node-22.17.es.mjs +107 -3
  22. package/dist/index-node-22.17.es.mjs.map +1 -1
  23. package/dist/index-node-22.17.es.web.css +0 -1
  24. package/dist/index-node-22.17.es.web.mjs +252 -36
  25. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  26. package/dist/index.es.js +108 -3
  27. package/dist/index.es.js.map +1 -1
  28. package/dist/index.es.web.js +250 -35
  29. package/dist/index.es.web.js.map +1 -1
  30. package/dist/linaria-themes-metro.es.android.js +6 -0
  31. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  32. package/dist/linaria-themes-metro.es.ios.js +6 -0
  33. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  34. package/dist/linaria-themes-node-22.17.cjs.js +6 -0
  35. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  36. package/dist/linaria-themes-node-22.17.cjs.web.js +6 -0
  37. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  38. package/dist/linaria-themes-node-22.17.es.mjs +6 -0
  39. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  40. package/dist/linaria-themes-node-22.17.es.web.mjs +6 -0
  41. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  42. package/dist/linaria-themes.es.js +6 -0
  43. package/dist/linaria-themes.es.js.map +1 -1
  44. package/dist/linaria-themes.es.web.js +6 -0
  45. package/dist/linaria-themes.es.web.js.map +1 -1
  46. package/dist/styles.css +0 -1
  47. package/dist/tsbuildinfo +1 -1
  48. package/package.json +3 -3
  49. package/dist/definitions/PageLoader/PageLoader.web.d.ts +0 -3
  50. package/dist/definitions/PageLoader/PageLoader.web.d.ts.map +0 -1
@@ -25,7 +25,6 @@
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;}
@@ -18,6 +18,7 @@ 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');
22
23
  const addons = require('@storybook/addons');
23
24
 
@@ -25,6 +26,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
25
26
 
26
27
  const Downshift__default = /*#__PURE__*/_interopDefaultLegacy(Downshift);
27
28
  const Animated__default = /*#__PURE__*/_interopDefaultLegacy(Animated);
29
+ const Svg__default = /*#__PURE__*/_interopDefaultLegacy(Svg);
28
30
 
29
31
  const View = nativeBase.View;
30
32
  const ScrollView = nativeBase.ScrollView;
@@ -2321,6 +2323,11 @@ const skeleton$1 = {
2321
2323
  }
2322
2324
  };
2323
2325
 
2326
+ const sticker = {
2327
+ borderRadius: 2,
2328
+ padding: 4
2329
+ };
2330
+
2324
2331
  const tabBar = {
2325
2332
  underline: {
2326
2333
  default: {
@@ -2639,6 +2646,7 @@ const theme = {
2639
2646
  skeleton: skeleton$1,
2640
2647
  tabBar,
2641
2648
  tag,
2649
+ sticker,
2642
2650
  tooltip,
2643
2651
  typography,
2644
2652
  fullscreenModal,
@@ -9188,6 +9196,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9188
9196
  tag: {
9189
9197
  borderRadius: theme.tag.borderRadius
9190
9198
  },
9199
+ sticker: {
9200
+ borderRadius: theme.sticker.borderRadius
9201
+ },
9191
9202
  tooltip: {
9192
9203
  borderRadius: theme.tooltip.borderRadius
9193
9204
  },
@@ -9980,6 +9991,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9980
9991
  }
9981
9992
  }
9982
9993
  },
9994
+ sticker: {
9995
+ padding: theme.sticker.padding
9996
+ },
9983
9997
  toggle: {
9984
9998
  primary: {
9985
9999
  enabled: {
@@ -10947,49 +10961,160 @@ function Notification({
10947
10961
  });
10948
10962
  }
10949
10963
 
10950
- const pageLoaderContainer = "kitt-u_pageLoaderContainer_ptkwz2j";
10951
- function PageLoader() {
10964
+ const AnimatedCircle = Animated__default.createAnimatedComponent(Svg.Circle);
10965
+ function AnimatedLoaderCircle({
10966
+ color,
10967
+ progress
10968
+ }) {
10952
10969
  const theme = useTheme();
10953
10970
  const {
10971
+ strokeWidth,
10972
+ size
10973
+ } = theme.kitt.pageLoader;
10974
+ const centerCoord = size * 0.5;
10975
+ const circlePerimeter = 2 * Math.PI * (size * 0.5 - strokeWidth);
10976
+ const strokeAnimation = Animated.useAnimatedProps(() => {
10977
+ return {
10978
+ strokeDashoffset: circlePerimeter - circlePerimeter * progress.value
10979
+ };
10980
+ }, [progress, circlePerimeter]);
10981
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedCircle, {
10982
+ "transform-origin": "center center",
10983
+ strokeWidth: strokeWidth,
10984
+ stroke: color,
10985
+ strokeLinecap: "round",
10986
+ cx: centerCoord,
10987
+ cy: centerCoord,
10988
+ r: centerCoord - strokeWidth,
10989
+ fill: "none",
10990
+ strokeDasharray: circlePerimeter,
10991
+ animatedProps: strokeAnimation
10992
+ });
10993
+ }
10994
+
10995
+ function AnimatedBackgroundCircle() {
10996
+ const theme = useTheme();
10997
+ const progress = Animated.useSharedValue(0);
10998
+ const {
10999
+ animation,
10954
11000
  colors,
11001
+ size
11002
+ } = theme.kitt.pageLoader;
11003
+ react.useEffect(() => {
11004
+ const {
11005
+ delay,
11006
+ circleBackgroundFillDuration,
11007
+ fillEasingFunction
11008
+ } = animation;
11009
+ const [x1, y1, x2, y2] = fillEasingFunction;
11010
+ progress.value = Animated.withDelay(delay, Animated.withTiming(1, {
11011
+ duration: circleBackgroundFillDuration,
11012
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
11013
+ }));
11014
+ }, [progress, animation]);
11015
+ return /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
11016
+ width: size,
11017
+ height: size,
11018
+ viewBox: `0 0 ${size} ${size}`,
11019
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
11020
+ color: colors.base,
11021
+ progress: progress
11022
+ })
11023
+ });
11024
+ }
11025
+
11026
+ const isInfinitAnimation$1 = -1;
11027
+ function AnimatedFillCircleContainer({
11028
+ children,
11029
+ duration
11030
+ }) {
11031
+ const theme = useTheme();
11032
+ const progress = Animated.useSharedValue(0);
11033
+ const {
11034
+ animation
11035
+ } = theme.kitt.pageLoader;
11036
+ react.useEffect(() => {
11037
+ const {
11038
+ delay
11039
+ } = animation;
11040
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(1, {
11041
+ duration,
11042
+ easing: Animated.Easing.linear
11043
+ }), isInfinitAnimation$1));
11044
+ }, [progress, animation, duration]);
11045
+ const rotationStyles = Animated.useAnimatedStyle(() => {
11046
+ return {
11047
+ transform: [{
11048
+ rotate: `${360 * progress.value}deg`
11049
+ }]
11050
+ };
11051
+ }, [progress]);
11052
+ return /*#__PURE__*/jsxRuntime.jsx(Animated__default.View, {
11053
+ style: [reactNative.StyleSheet.absoluteFill, rotationStyles],
11054
+ children: children
11055
+ });
11056
+ }
11057
+
11058
+ const isInfinitAnimation = -1;
11059
+ const shouldReverse = true;
11060
+ function AnimatedFilledCircle() {
11061
+ const theme = useTheme();
11062
+ const progress = Animated.useSharedValue(0);
11063
+ const {
10955
11064
  size,
10956
- strokeWidth
11065
+ animation,
11066
+ colors
10957
11067
  } = theme.kitt.pageLoader;
10958
- const center = size * 0.5;
10959
- const radius = center - strokeWidth;
10960
- const circlePerimeter = 2 * Math.PI * radius;
10961
- const sharedProps = {
10962
- cx: center,
10963
- cy: center,
10964
- r: radius,
10965
- fill: 'none',
10966
- strokeWidth,
10967
- strokeDasharray: circlePerimeter,
10968
- strokeDashoffset: circlePerimeter,
10969
- strokeLinecap: 'round'
10970
- };
10971
- return /*#__PURE__*/jsxRuntime.jsx("div", {
10972
- className: pageLoaderContainer,
10973
- children: /*#__PURE__*/jsxRuntime.jsxs("svg", {
10974
- width: size,
10975
- height: size,
10976
- children: [/*#__PURE__*/jsxRuntime.jsx("g", {
10977
- "data-large-loader": "base",
10978
- children: /*#__PURE__*/jsxRuntime.jsx("circle", {
10979
- ...sharedProps,
10980
- stroke: colors.base
10981
- })
10982
- }), /*#__PURE__*/jsxRuntime.jsx("g", {
10983
- "data-large-loader": "fill",
10984
- children: /*#__PURE__*/jsxRuntime.jsx("circle", {
10985
- ...sharedProps,
10986
- stroke: colors.fill
11068
+ react.useEffect(() => {
11069
+ const {
11070
+ delay,
11071
+ filledCircleFillDuration,
11072
+ fillEasingFunction
11073
+ } = animation;
11074
+ const [x1, y1, x2, y2] = fillEasingFunction;
11075
+ progress.value = Animated.withDelay(delay, Animated.withRepeat(Animated.withTiming(0.8, {
11076
+ duration: filledCircleFillDuration,
11077
+ easing: Animated.Easing.bezier(x1, y1, x2, y2)
11078
+ }), isInfinitAnimation, shouldReverse));
11079
+ }, [progress, animation]);
11080
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
11081
+ duration: animation.groupFilledCircleRotationDuration,
11082
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedFillCircleContainer, {
11083
+ duration: animation.filledCircleRotationDuration,
11084
+ children: /*#__PURE__*/jsxRuntime.jsx(Svg__default, {
11085
+ width: size,
11086
+ height: size,
11087
+ viewBox: `0 0 ${size} ${size}`,
11088
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLoaderCircle, {
11089
+ color: colors.fill,
11090
+ progress: progress
10987
11091
  })
10988
- })]
11092
+ })
10989
11093
  })
10990
11094
  });
10991
11095
  }
10992
11096
 
11097
+ function PageLoader() {
11098
+ const sharedTransformStyle = {
11099
+ style: {
11100
+ /* Needed to make the animation starting from the top of the circles */
11101
+ transform: [{
11102
+ rotate: '90deg'
11103
+ }, {
11104
+ scale: -1
11105
+ }]
11106
+ }
11107
+ };
11108
+ return /*#__PURE__*/jsxRuntime.jsxs(View, {
11109
+ position: "relative",
11110
+ height: "kitt.pageLoader.size",
11111
+ width: "kitt.pageLoader.size",
11112
+ _ios: sharedTransformStyle,
11113
+ _android: sharedTransformStyle,
11114
+ children: [/*#__PURE__*/jsxRuntime.jsx(AnimatedBackgroundCircle, {}), /*#__PURE__*/jsxRuntime.jsx(AnimatedFilledCircle, {})]
11115
+ });
11116
+ }
11117
+
10993
11118
  function getBackgroundColor({
10994
11119
  isSelected,
10995
11120
  isHighlighted,
@@ -11611,6 +11736,98 @@ StaticMap.Loader = StaticMapLoader;
11611
11736
  StaticMap.Error = StaticMapError;
11612
11737
  StaticMap.Marker = StaticMapMarker;
11613
11738
 
11739
+ const getTypographySize = size => {
11740
+ switch (size) {
11741
+ case 'small':
11742
+ return 'content-caps-xs';
11743
+ case 'medium':
11744
+ return 'content-caps-m';
11745
+ case 'large':
11746
+ default:
11747
+ return 'content-caps-l';
11748
+ }
11749
+ };
11750
+ function Sticker({
11751
+ label,
11752
+ color = 'linen',
11753
+ size = 'medium'
11754
+ }) {
11755
+ const kittTheme = useKittTheme();
11756
+ const colorMatching = {
11757
+ green: {
11758
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.green-grass'],
11759
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.green-apple']
11760
+ },
11761
+ darkGreen: {
11762
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.green-pine'],
11763
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.blue-sky']
11764
+ },
11765
+ blue: {
11766
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.blue-sky'],
11767
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.green-pine']
11768
+ },
11769
+ darkBlue: {
11770
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.blue-electric'],
11771
+ font: kittTheme.kitt.palettes.deepPurple['beige.3']
11772
+ },
11773
+ red: {
11774
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.brick'],
11775
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.sun']
11776
+ },
11777
+ orange: {
11778
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.orange'],
11779
+ font: kittTheme.kitt.palettes.deepPurple['beige.2']
11780
+ },
11781
+ pink: {
11782
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.pink'],
11783
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.brick']
11784
+ },
11785
+ gold: {
11786
+ background: kittTheme.kitt.palettes.deepPurple['rainbow.gold'],
11787
+ font: kittTheme.kitt.palettes.deepPurple['beige.1']
11788
+ },
11789
+ cream: {
11790
+ background: kittTheme.kitt.palettes.deepPurple['beige.1'],
11791
+ font: kittTheme.kitt.palettes.deepPurple['rainbow.brick']
11792
+ },
11793
+ linen: {
11794
+ background: kittTheme.kitt.palettes.deepPurple['beige.3'],
11795
+ font: kittTheme.kitt.palettes.deepPurple['deepPurple.8']
11796
+ },
11797
+ promo: {
11798
+ background: kittTheme.kitt.palettes.deepPurple['lightning.5'],
11799
+ font: kittTheme.kitt.palettes.deepPurple['lightning.7']
11800
+ },
11801
+ darkPromo: {
11802
+ background: kittTheme.kitt.palettes.deepPurple['lightning.7'],
11803
+ font: kittTheme.kitt.palettes.deepPurple['lightning.5']
11804
+ },
11805
+ disabled: {
11806
+ background: kittTheme.kitt.palettes.deepPurple['beige.6'],
11807
+ font: kittTheme.kitt.palettes.deepPurple['beige.2']
11808
+ }
11809
+ };
11810
+ return /*#__PURE__*/jsxRuntime.jsx(HStack, {
11811
+ alignSelf: "flex-start",
11812
+ borderRadius: "kitt.sticker.borderRadius",
11813
+ padding: "kitt.sticker.padding",
11814
+ backgroundColor: colorMatching[color].background,
11815
+ space: "kitt.1",
11816
+ alignItems: "center",
11817
+ maxWidth: "100%",
11818
+ children: /*#__PURE__*/jsxRuntime.jsx(View, {
11819
+ flexShrink: 1,
11820
+ children: /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
11821
+ base: getTypographySize(size),
11822
+ color: colorMatching[color].font,
11823
+ numberOfLines: 1,
11824
+ ellipsizeMode: "tail",
11825
+ children: label
11826
+ })
11827
+ })
11828
+ });
11829
+ }
11830
+
11614
11831
  function Flex({
11615
11832
  direction,
11616
11833
  wrap = 'wrap',
@@ -13234,6 +13451,7 @@ exports.Skeleton = Skeleton;
13234
13451
  exports.SpinningIcon = SpinningIcon;
13235
13452
  exports.Stack = Stack;
13236
13453
  exports.StaticMap = StaticMap;
13454
+ exports.Sticker = Sticker;
13237
13455
  exports.Story = Story;
13238
13456
  exports.StoryBlock = StoryBlock;
13239
13457
  exports.StoryContainer = StoryContainer;