@ornikar/kitt-universal 3.4.0 → 3.5.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 (33) hide show
  1. package/dist/definitions/Skeleton/Skeleton.d.ts +14 -0
  2. package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
  3. package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
  4. package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
  5. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
  6. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
  7. package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
  8. package/dist/definitions/index.d.ts +4 -0
  9. package/dist/definitions/index.d.ts.map +1 -1
  10. package/dist/definitions/themes/default.d.ts +1 -0
  11. package/dist/definitions/themes/default.d.ts.map +1 -1
  12. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts +7 -0
  13. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
  14. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
  15. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
  16. package/dist/definitions/utils/hexToRgba.d.ts +2 -0
  17. package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
  18. package/dist/index-browser-all.es.android.js +154 -18
  19. package/dist/index-browser-all.es.android.js.map +1 -1
  20. package/dist/index-browser-all.es.ios.js +154 -18
  21. package/dist/index-browser-all.es.ios.js.map +1 -1
  22. package/dist/index-browser-all.es.js +154 -18
  23. package/dist/index-browser-all.es.js.map +1 -1
  24. package/dist/index-browser-all.es.web.js +108 -7
  25. package/dist/index-browser-all.es.web.js.map +1 -1
  26. package/dist/index-node-14.17.cjs.js +143 -15
  27. package/dist/index-node-14.17.cjs.js.map +1 -1
  28. package/dist/index-node-14.17.cjs.web.css +1 -0
  29. package/dist/index-node-14.17.cjs.web.js +98 -5
  30. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  31. package/dist/styles.css +1 -0
  32. package/dist/tsbuildinfo +1 -1
  33. package/package.json +4 -3
@@ -12,6 +12,7 @@ const twemojiParser = require('twemoji-parser');
12
12
  const WebBrowser = require('expo-web-browser');
13
13
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
14
14
  const react$1 = require('@linaria/react');
15
+ const expoLinearGradient = require('expo-linear-gradient');
15
16
  const DateTimePicker = require('@react-native-community/datetimepicker');
16
17
  const reactIntl = require('react-intl');
17
18
  const reactNative$1 = require('@floating-ui/react-native');
@@ -787,7 +788,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
787
788
  });
788
789
  });
789
790
 
790
- const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
791
+ const Container$7 = /*#__PURE__*/styled__default.View.withConfig({
791
792
  displayName: "Card__Container",
792
793
  componentId: "kitt-universal__sc-1n9psug-0"
793
794
  })(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
@@ -807,7 +808,7 @@ function Card({
807
808
  children,
808
809
  type
809
810
  }) {
810
- return /*#__PURE__*/jsxRuntime.jsx(Container$6, {
811
+ return /*#__PURE__*/jsxRuntime.jsx(Container$7, {
811
812
  type: type,
812
813
  children: children
813
814
  });
@@ -995,7 +996,7 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
995
996
  }, ({
996
997
  minHeight
997
998
  }) => minHeight);
998
- const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
999
+ const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
999
1000
  displayName: "InputText__Container",
1000
1001
  componentId: "kitt-universal__sc-uke279-1"
1001
1002
  })(["margin-top:", ";margin-bottom:", ";"], ({
@@ -1069,7 +1070,7 @@ const InputText = /*#__PURE__*/react.forwardRef(({
1069
1070
  isDisabled: disabled,
1070
1071
  formState
1071
1072
  });
1072
- return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
1073
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$6, {
1073
1074
  children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
1074
1075
  ref: ref,
1075
1076
  nativeID: id,
@@ -1159,7 +1160,7 @@ const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
1159
1160
  }) => theme.kitt.forms.radio.checked.innerSize, ({
1160
1161
  theme
1161
1162
  }) => theme.kitt.forms.radio.checked.innerSize / 2);
1162
- const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
1163
+ const Container$5 = /*#__PURE__*/styled__default.Pressable.withConfig({
1163
1164
  displayName: "Radio__Container",
1164
1165
  componentId: "kitt-universal__sc-1mdgr2o-3"
1165
1166
  })(["flex-direction:row;align-items:center;"]);
@@ -1177,7 +1178,7 @@ function Radio({
1177
1178
  disabled = false,
1178
1179
  children
1179
1180
  }) {
1180
- return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
1181
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
1181
1182
  nativeID: id,
1182
1183
  disabled: disabled,
1183
1184
  accessibilityRole: "radio",
@@ -1203,6 +1204,7 @@ function TextArea({ ...props
1203
1204
  const theme = /*#__PURE__*/styled.useTheme();
1204
1205
  return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1205
1206
  multiline: true,
1207
+ textAlignVertical: "top",
1206
1208
  ...props,
1207
1209
  type: "text",
1208
1210
  minHeight: theme.kitt.forms.input.textAreaMinHeight
@@ -1344,7 +1346,7 @@ function FullScreenModalHeader({
1344
1346
  });
1345
1347
  }
1346
1348
 
1347
- const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1349
+ const Container$4 = /*#__PURE__*/styled__default.View.withConfig({
1348
1350
  displayName: "FullScreenModal__Container",
1349
1351
  componentId: "kitt-universal__sc-11qpbe3-0"
1350
1352
  })(["flex:1;background-color:", ";"], ({
@@ -1353,7 +1355,7 @@ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1353
1355
  function FullScreenModal({
1354
1356
  children
1355
1357
  }) {
1356
- return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
1358
+ return /*#__PURE__*/jsxRuntime.jsx(Container$4, {
1357
1359
  children: children
1358
1360
  });
1359
1361
  }
@@ -1782,7 +1784,7 @@ function LargeLoader({
1782
1784
 
1783
1785
  const xIconSize = 14;
1784
1786
  const mainIconSize = 20;
1785
- const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
1787
+ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1786
1788
  displayName: "Message__Container",
1787
1789
  componentId: "kitt-universal__sc-c6400e-0"
1788
1790
  })(["border-radius:", "px;background-color:", ";padding-bottom:", "px;padding-left:", "px;padding-right:", "px;padding-top:", "px;flex-direction:row;align-items:flex-start;justify-content:space-between;"], ({
@@ -1861,7 +1863,7 @@ function Message({
1861
1863
  insets
1862
1864
  }) {
1863
1865
  const color = getColorByType(type);
1864
- return /*#__PURE__*/jsxRuntime.jsxs(Container$2, {
1866
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$3, {
1865
1867
  type: type,
1866
1868
  noRadius: noRadius,
1867
1869
  insets: insets,
@@ -2062,6 +2064,117 @@ function Notification({
2062
2064
  });
2063
2065
  }
2064
2066
 
2067
+ const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
2068
+ displayName: "SkeletonContent__Container",
2069
+ componentId: "kitt-universal__sc-1u3chjb-0"
2070
+ })(["background-color:", ";border-color:", ";height:100%;width:100%;"], ({
2071
+ theme
2072
+ }) => theme.kitt.skeleton.backgroundColor, ({
2073
+ theme
2074
+ }) => theme.kitt.skeleton.flareColor);
2075
+ const AnimatedLinearGradient = Animated__default.createAnimatedComponent(expoLinearGradient.LinearGradient);
2076
+ function SkeletonContent({
2077
+ isLoading,
2078
+ width
2079
+ }) {
2080
+ const theme = /*#__PURE__*/styled.useTheme();
2081
+ const sharedX = Animated.useSharedValue(0);
2082
+ react.useEffect(() => {
2083
+ if (isLoading) {
2084
+ sharedX.value = Animated.withRepeat(Animated.withTiming(1, {
2085
+ duration: theme.kitt.skeleton.animationDuration,
2086
+ easing: Animated.Easing.inOut(Animated.Easing.ease)
2087
+ }), -1);
2088
+ }
2089
+ }, [sharedX, width, isLoading, theme]);
2090
+ const linearGradientStyle = Animated.useAnimatedStyle(function () {
2091
+ const _f = function () {
2092
+ return {
2093
+ transform: [{
2094
+ translateX: Animated.interpolate(sharedX.value, [0, 1], [-width, width])
2095
+ }]
2096
+ };
2097
+ };
2098
+
2099
+ _f._closure = {
2100
+ interpolate: Animated.interpolate,
2101
+ sharedX,
2102
+ width
2103
+ };
2104
+ _f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
2105
+ _f.__workletHash = 1670955855244;
2106
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
2107
+ _f.__optimalization = 3;
2108
+
2109
+ global.__reanimatedWorkletInit(_f);
2110
+
2111
+ return _f;
2112
+ }());
2113
+ return /*#__PURE__*/jsxRuntime.jsx(Container$2, {
2114
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLinearGradient, {
2115
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
2116
+ locations: [0.1, 0.5, 0.9],
2117
+ start: {
2118
+ x: 0,
2119
+ y: 0
2120
+ },
2121
+ end: {
2122
+ x: 1,
2123
+ y: 0
2124
+ },
2125
+ style: [reactNative.StyleSheet.absoluteFill, linearGradientStyle]
2126
+ })
2127
+ });
2128
+ }
2129
+
2130
+ function Skeleton({
2131
+ isLoading,
2132
+ style
2133
+ }) {
2134
+ const [width, setWidth] = react.useState(0);
2135
+ return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
2136
+ style: style,
2137
+ onLayout: ({
2138
+ nativeEvent
2139
+ }) => setWidth(nativeEvent.layout.width),
2140
+ children: /*#__PURE__*/jsxRuntime.jsx(SkeletonContent, {
2141
+ isLoading: isLoading,
2142
+ width: width
2143
+ })
2144
+ });
2145
+ }
2146
+ const Bar = /*#__PURE__*/styled__default(Skeleton).withConfig({
2147
+ displayName: "Skeleton__Bar",
2148
+ componentId: "kitt-universal__sc-1w5cm3i-0"
2149
+ })(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2150
+ theme
2151
+ }) => theme.kitt.spacing * 2, ({
2152
+ theme
2153
+ }) => theme.kitt.spacing * 2);
2154
+ const Circle = /*#__PURE__*/styled__default(Skeleton).withConfig({
2155
+ displayName: "Skeleton__Circle",
2156
+ componentId: "kitt-universal__sc-1w5cm3i-1"
2157
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2158
+ theme
2159
+ }) => theme.kitt.spacing * 12, ({
2160
+ theme
2161
+ }) => theme.kitt.spacing * 12, ({
2162
+ theme
2163
+ }) => theme.kitt.spacing * 6);
2164
+ const Square = /*#__PURE__*/styled__default(Skeleton).withConfig({
2165
+ displayName: "Skeleton__Square",
2166
+ componentId: "kitt-universal__sc-1w5cm3i-2"
2167
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2168
+ theme
2169
+ }) => theme.kitt.spacing * 12, ({
2170
+ theme
2171
+ }) => theme.kitt.spacing * 12, ({
2172
+ theme
2173
+ }) => theme.kitt.spacing * 1.5);
2174
+ Skeleton.Bar = Bar;
2175
+ Skeleton.Circle = Circle;
2176
+ Skeleton.Square = Square;
2177
+
2065
2178
  const Flex = /*#__PURE__*/styled__default.View.withConfig({
2066
2179
  shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
2067
2180
  }).withConfig({
@@ -2746,6 +2859,12 @@ const shadowsLateOceanTheme = {
2746
2859
  medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2747
2860
  };
2748
2861
 
2862
+ const skeletonTheme = {
2863
+ backgroundColor: lateOceanColorPalette.black100,
2864
+ flareColor: lateOceanColorPalette.black200,
2865
+ animationDuration: 1000
2866
+ };
2867
+
2749
2868
  const tagLateOceanTheme = {
2750
2869
  borderRadius: '10px',
2751
2870
  padding: '2px 12px',
@@ -2797,18 +2916,16 @@ const tooltip = {
2797
2916
  };
2798
2917
 
2799
2918
  const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
2800
-
2801
2919
  const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
2802
2920
  baseAndSmall: {
2803
2921
  fontSize: `${baseAndSmallFontSize}px`,
2804
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2922
+ lineHeight: `${calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)}px`
2805
2923
  },
2806
2924
  mediumAndWide: {
2807
2925
  fontSize: `${mediumAndWideFontSize}px`,
2808
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2926
+ lineHeight: `${calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)}px`
2809
2927
  }
2810
2928
  });
2811
-
2812
2929
  const typographyLateOceanTheme = {
2813
2930
  colors: {
2814
2931
  black: lateOceanColorPalette.black1000,
@@ -2909,7 +3026,8 @@ const theme = {
2909
3026
  fullScreenModal: fullScreenModalLateOceanTheme,
2910
3027
  iconButton,
2911
3028
  listItem: listItemLateOceanTheme,
2912
- tooltip
3029
+ tooltip,
3030
+ skeleton: skeletonTheme
2913
3031
  };
2914
3032
 
2915
3033
  function Title({
@@ -3392,6 +3510,13 @@ function useKittTheme() {
3392
3510
  }, [dimensions]);
3393
3511
  }
3394
3512
 
3513
+ const hex2rgba = (hex, alpha = 1) => {
3514
+ const r = parseInt(hex.slice(1, 3), 16);
3515
+ const g = parseInt(hex.slice(3, 5), 16);
3516
+ const b = parseInt(hex.slice(5, 7), 16);
3517
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
3518
+ };
3519
+
3395
3520
  function KittThemeProvider({
3396
3521
  children
3397
3522
  }) {
@@ -3452,6 +3577,7 @@ exports.Modal = Modal;
3452
3577
  exports.Notification = Notification;
3453
3578
  exports.Radio = Radio;
3454
3579
  exports.Section = DeprecatedSection;
3580
+ exports.Skeleton = Skeleton;
3455
3581
  exports.Story = Story;
3456
3582
  exports.StoryBlock = StoryBlock;
3457
3583
  exports.StoryContainer = StoryContainer;
@@ -3459,6 +3585,7 @@ exports.StoryDecorator = StoryDecorator;
3459
3585
  exports.StoryGrid = StoryGrid;
3460
3586
  exports.StorySection = StorySection;
3461
3587
  exports.StoryTitle = StoryTitle;
3588
+ exports.StyleWebWrapper = StyleWebWrapper;
3462
3589
  exports.Tag = Tag;
3463
3590
  exports.TextArea = TextArea;
3464
3591
  exports.TimePicker = TimePicker;
@@ -3468,6 +3595,7 @@ exports.TypographyEmoji = TypographyEmoji;
3468
3595
  exports.TypographyIcon = TypographyIcon;
3469
3596
  exports.TypographyLink = TypographyLink;
3470
3597
  exports.createWindowSizeHelper = createWindowSizeHelper;
3598
+ exports.hex2rgba = hex2rgba;
3471
3599
  exports.matchWindowSize = matchWindowSize;
3472
3600
  exports.styledTextInputMixin = styledTextInputMixin;
3473
3601
  exports.theme = theme;