@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
@@ -1256,7 +1256,8 @@ function TextArea(_ref) {
1256
1256
 
1257
1257
  var theme = /*#__PURE__*/useTheme();
1258
1258
  return /*#__PURE__*/jsx(InputText, _objectSpread$9(_objectSpread$9({
1259
- multiline: true
1259
+ multiline: true,
1260
+ textAlignVertical: "top"
1260
1261
  }, props), {}, {
1261
1262
  type: "text",
1262
1263
  minHeight: theme.kitt.forms.input.textAreaMinHeight
@@ -2081,6 +2082,93 @@ function Notification(_ref) {
2081
2082
  });
2082
2083
  }
2083
2084
 
2085
+ var StyledSkeleton = withTheme( /*#__PURE__*/styled("div")({
2086
+ name: "StyledSkeleton",
2087
+ "class": "sc3upcl",
2088
+ vars: {
2089
+ "sc3upcl-0": [function (_ref) {
2090
+ var theme = _ref.theme;
2091
+ return theme.kitt.skeleton.backgroundColor;
2092
+ }],
2093
+ "sc3upcl-1": [function (_ref2) {
2094
+ var $isLoading = _ref2.$isLoading,
2095
+ theme = _ref2.theme;
2096
+ return $isLoading ? "linear-gradient(\n -90deg,\n ".concat(theme.kitt.skeleton.backgroundColor, ",\n ").concat(theme.kitt.skeleton.flareColor, " 50%,\n ").concat(theme.kitt.skeleton.backgroundColor, " 100%\n )") : 'none';
2097
+ }],
2098
+ "sc3upcl-2": [function (_ref3) {
2099
+ var $isLoading = _ref3.$isLoading;
2100
+ return $isLoading ? '1s ease-in-out infinite' : 'none';
2101
+ }]
2102
+ }
2103
+ }));
2104
+ function SkeletonContent(_ref4) {
2105
+ var isLoading = _ref4.isLoading;
2106
+ return /*#__PURE__*/jsx(StyledSkeleton, {
2107
+ $isLoading: isLoading
2108
+ });
2109
+ }
2110
+
2111
+ function Skeleton(_ref) {
2112
+ var isLoading = _ref.isLoading,
2113
+ style = _ref.style;
2114
+
2115
+ var _useState = useState(0),
2116
+ _useState2 = _slicedToArray(_useState, 2),
2117
+ width = _useState2[0],
2118
+ setWidth = _useState2[1];
2119
+
2120
+ return /*#__PURE__*/jsx(View, {
2121
+ style: style,
2122
+ onLayout: function onLayout(_ref2) {
2123
+ var nativeEvent = _ref2.nativeEvent;
2124
+ return setWidth(nativeEvent.layout.width);
2125
+ },
2126
+ children: /*#__PURE__*/jsx(SkeletonContent, {
2127
+ isLoading: isLoading,
2128
+ width: width
2129
+ })
2130
+ });
2131
+ }
2132
+ var Bar = /*#__PURE__*/styled$1(Skeleton).withConfig({
2133
+ displayName: "Skeleton__Bar",
2134
+ componentId: "kitt-universal__sc-1w5cm3i-0"
2135
+ })(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref3) {
2136
+ var theme = _ref3.theme;
2137
+ return theme.kitt.spacing * 2;
2138
+ }, function (_ref4) {
2139
+ var theme = _ref4.theme;
2140
+ return theme.kitt.spacing * 2;
2141
+ });
2142
+ var Circle = /*#__PURE__*/styled$1(Skeleton).withConfig({
2143
+ displayName: "Skeleton__Circle",
2144
+ componentId: "kitt-universal__sc-1w5cm3i-1"
2145
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref5) {
2146
+ var theme = _ref5.theme;
2147
+ return theme.kitt.spacing * 12;
2148
+ }, function (_ref6) {
2149
+ var theme = _ref6.theme;
2150
+ return theme.kitt.spacing * 12;
2151
+ }, function (_ref7) {
2152
+ var theme = _ref7.theme;
2153
+ return theme.kitt.spacing * 6;
2154
+ });
2155
+ var Square = /*#__PURE__*/styled$1(Skeleton).withConfig({
2156
+ displayName: "Skeleton__Square",
2157
+ componentId: "kitt-universal__sc-1w5cm3i-2"
2158
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], function (_ref8) {
2159
+ var theme = _ref8.theme;
2160
+ return theme.kitt.spacing * 12;
2161
+ }, function (_ref9) {
2162
+ var theme = _ref9.theme;
2163
+ return theme.kitt.spacing * 12;
2164
+ }, function (_ref10) {
2165
+ var theme = _ref10.theme;
2166
+ return theme.kitt.spacing * 1.5;
2167
+ });
2168
+ Skeleton.Bar = Bar;
2169
+ Skeleton.Circle = Circle;
2170
+ Skeleton.Square = Square;
2171
+
2084
2172
  var Flex = /*#__PURE__*/styled$1(View).withConfig({
2085
2173
  shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
2086
2174
  return !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop);
@@ -2783,6 +2871,12 @@ var shadowsLateOceanTheme = {
2783
2871
  medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2784
2872
  };
2785
2873
 
2874
+ var skeletonTheme = {
2875
+ backgroundColor: lateOceanColorPalette.black100,
2876
+ flareColor: lateOceanColorPalette.black200,
2877
+ animationDuration: 1000
2878
+ };
2879
+
2786
2880
  var tagLateOceanTheme = {
2787
2881
  borderRadius: '10px',
2788
2882
  padding: '2px 12px',
@@ -2836,20 +2930,18 @@ var tooltip = {
2836
2930
  var calcLineHeight = function (fontSize, lineHeightMultiplier) {
2837
2931
  return Math.round(fontSize * lineHeightMultiplier);
2838
2932
  };
2839
-
2840
2933
  var createTypographyTypeConfig = function (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) {
2841
2934
  return {
2842
2935
  baseAndSmall: {
2843
2936
  fontSize: "".concat(baseAndSmallFontSize, "px"),
2844
- lineHeight: "".concat(calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize), "px")
2937
+ lineHeight: "".concat(calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier), "px")
2845
2938
  },
2846
2939
  mediumAndWide: {
2847
2940
  fontSize: "".concat(mediumAndWideFontSize, "px"),
2848
- lineHeight: "".concat(calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize), "px")
2941
+ lineHeight: "".concat(calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier), "px")
2849
2942
  }
2850
2943
  };
2851
2944
  };
2852
-
2853
2945
  var typographyLateOceanTheme = {
2854
2946
  colors: {
2855
2947
  black: lateOceanColorPalette.black1000,
@@ -2950,7 +3042,8 @@ var theme = {
2950
3042
  fullScreenModal: fullScreenModalLateOceanTheme,
2951
3043
  iconButton: iconButton,
2952
3044
  listItem: listItemLateOceanTheme,
2953
- tooltip: tooltip
3045
+ tooltip: tooltip,
3046
+ skeleton: skeletonTheme
2954
3047
  };
2955
3048
 
2956
3049
  function TimePicker() {
@@ -3344,6 +3437,14 @@ function useKittTheme() {
3344
3437
  }, [dimensions]);
3345
3438
  }
3346
3439
 
3440
+ var hex2rgba = function (hex) {
3441
+ var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
3442
+ var r = parseInt(hex.slice(1, 3), 16);
3443
+ var g = parseInt(hex.slice(3, 5), 16);
3444
+ var b = parseInt(hex.slice(5, 7), 16);
3445
+ return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")");
3446
+ };
3447
+
3347
3448
  function KittThemeProvider(_ref) {
3348
3449
  var children = _ref.children;
3349
3450
  var theme = useKittTheme();
@@ -3376,5 +3477,5 @@ function MatchWindowSize(_ref) {
3376
3477
  });
3377
3478
  }
3378
3479
 
3379
- export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
3480
+ export { Avatar, Button, Card, Emoji, ExternalLink, Flex, FullScreenModal, Icon, IconButton, InputFeedback, InputField, InputText, KittBreakpoints, KittBreakpointsMax, KittThemeDecorator, KittThemeProvider, Label, LargeLoader, ListItem, Loader, MatchWindowSize, Message, Modal, Notification, Radio, DeprecatedSection as Section, Skeleton, Story, StoryBlock, StoryContainer, StoryDecorator, StoryGrid, StorySection, StoryTitle, StyleWebWrapper, Tag, TextArea, TimePicker, Tooltip, Typography, TypographyEmoji, TypographyIcon, TypographyLink, createWindowSizeHelper, hex2rgba, matchWindowSize, styledTextInputMixin, theme, useKittTheme, useMatchWindowSize, useStoryBlockColor };
3380
3481
  //# sourceMappingURL=index-browser-all.es.web.js.map