@ornikar/kitt-universal 3.3.0 → 3.7.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 (49) hide show
  1. package/dist/definitions/Avatar/Avatar.d.ts +9 -4
  2. package/dist/definitions/Avatar/Avatar.d.ts.map +1 -1
  3. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +2 -2
  4. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -1
  5. package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
  6. package/dist/definitions/Skeleton/Skeleton.d.ts +14 -0
  7. package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
  8. package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
  9. package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
  10. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
  11. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
  12. package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
  13. package/dist/definitions/index.d.ts +5 -0
  14. package/dist/definitions/index.d.ts.map +1 -1
  15. package/dist/definitions/themes/default.d.ts +23 -31
  16. package/dist/definitions/themes/default.d.ts.map +1 -1
  17. package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts +9 -10
  18. package/dist/definitions/themes/late-ocean/avatarLateOceanTheme.d.ts.map +1 -1
  19. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts +7 -0
  20. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
  21. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
  22. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
  23. package/dist/definitions/typography/Typography.d.ts +2 -0
  24. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  25. package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
  26. package/dist/definitions/useKittTheme.d.ts +0 -2
  27. package/dist/definitions/useKittTheme.d.ts.map +1 -1
  28. package/dist/definitions/utils/hexToRgba.d.ts +2 -0
  29. package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
  30. package/dist/definitions/utils/withTheme.d.ts +2 -2
  31. package/dist/definitions/utils/withTheme.d.ts.map +1 -1
  32. package/dist/index-browser-all.es.android.js +337 -151
  33. package/dist/index-browser-all.es.android.js.map +1 -1
  34. package/dist/index-browser-all.es.css +2 -2
  35. package/dist/index-browser-all.es.ios.js +337 -151
  36. package/dist/index-browser-all.es.ios.js.map +1 -1
  37. package/dist/index-browser-all.es.js +296 -129
  38. package/dist/index-browser-all.es.js.map +1 -1
  39. package/dist/index-browser-all.es.web.js +294 -166
  40. package/dist/index-browser-all.es.web.js.map +1 -1
  41. package/dist/index-node-14.17.cjs.css +2 -2
  42. package/dist/index-node-14.17.cjs.js +247 -78
  43. package/dist/index-node-14.17.cjs.js.map +1 -1
  44. package/dist/index-node-14.17.cjs.web.css +4 -3
  45. package/dist/index-node-14.17.cjs.web.js +234 -103
  46. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  47. package/dist/styles.css +4 -3
  48. package/dist/tsbuildinfo +1 -1
  49. package/package.json +5 -4
@@ -1,2 +1,2 @@
1
- @media (hover:none) and (pointer:coarse){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (var(--p1nlccvg-1)){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *,.p1nlccvg > *:focus,.kitt-focus .p1nlccvg > *,.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{background-color:var(--p1nlccvg-4);}.p1nlccvg[data-color-white=true] > *:hover,.kitt-hover .p1nlccvg[data-color-white] > *,.p1nlccvg[data-color-white=true] > *:focus,.kitt-focus .p1nlccvg[data-color-white=true] > *,.p1nlccvg[data-color-white=true] > *:active,.kitt-active .p1nlccvg[data-color-white=true] > *{background-color:var(--p1nlccvg-5);}
2
- .tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:none;text-decoration:none;}.tcwz3nt[data-nounderline] > *:hover,.tcwz3nt[data-nounderline] > *:active,.kitt-hover .tcwz3nt[data-nounderline] > *{-webkit-text-decoration:underline;text-decoration:underline;}
1
+ @media (hover:none) and (pointer:coarse){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-0));-ms-transform:scale(var(--p1nlccvg-0));transform:scale(var(--p1nlccvg-0));}}@media (min-width:768px){.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-2));-ms-transform:scale(var(--p1nlccvg-2));transform:scale(var(--p1nlccvg-2));}}.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{-webkit-transform:scale(var(--p1nlccvg-3));-ms-transform:scale(var(--p1nlccvg-3));transform:scale(var(--p1nlccvg-3));}.p1nlccvg,.p1nlccvg > [data-focusvisible-polyfill]{outline:none;}.p1nlccvg > *:hover,.kitt-hover .p1nlccvg > *,.p1nlccvg > *:focus,.kitt-focus .p1nlccvg > *,.p1nlccvg > [data-focusvisible-polyfill],.p1nlccvg > *:active,.kitt-active .p1nlccvg > *{background-color:var(--p1nlccvg-4);}
2
+ .tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:none;text-decoration:none;}.tcwz3nt > *:hover,.tcwz3nt > *:active,.kitt-hover .tcwz3nt > *{-webkit-text-decoration:var(--tcwz3nt-0);text-decoration:var(--tcwz3nt-0);}
@@ -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');
@@ -204,6 +205,20 @@ function useTypographyTypeForCurrentWindowSize(base, small, medium, large) {
204
205
  if (small && width >= KittBreakpoints.SMALL) return small;
205
206
  return base;
206
207
  }
208
+ function getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
209
+ base,
210
+ color
211
+ }) {
212
+ // return the props set or undefined. In case of undefined, the value will be inherited from its parents.
213
+ if (hasTypographyAncestor) return {
214
+ base,
215
+ color
216
+ };
217
+ return {
218
+ base: base ?? 'body',
219
+ color: color ?? 'black'
220
+ };
221
+ }
207
222
  function Typography({
208
223
  accessibilityRole,
209
224
  base,
@@ -215,16 +230,21 @@ function Typography({
215
230
  ...otherProps
216
231
  }) {
217
232
  const isHeaderTypographyInContext = react.useContext(IsHeaderTypographyContext);
218
- const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(base, small, medium, large);
233
+ const hasTypographyAncestor = isHeaderTypographyInContext !== undefined;
234
+ const {
235
+ base: baseOrDefaultToBody,
236
+ color: colorOrDefaultToBlack
237
+ } = getTypographyInheritedOrDefaultValuesBasedOnExistingAncestors(hasTypographyAncestor, {
238
+ base,
239
+ color
240
+ });
241
+ const typeForCurrentWindowSize = useTypographyTypeForCurrentWindowSize(baseOrDefaultToBody, small, medium, large);
219
242
  const isHeader = isTypographyHeader(typeForCurrentWindowSize, isHeaderTypographyInContext);
220
- const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular'); // if isHeaderTypographyInContext exists, it means we are inside another typography so we don't want to
221
- // redefine the color, just inherit from it
222
-
223
- const colorWithDefaultToBlack = color ?? (isHeaderTypographyInContext !== undefined ? undefined : 'black');
224
- const content = base ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
243
+ const nonNullableVariant = variant ?? (isHeader ? 'bold' : 'regular');
244
+ const content = baseOrDefaultToBody ? /*#__PURE__*/jsxRuntime.jsx(IsHeaderTypographyContext.Provider, {
225
245
  value: isHeader,
226
246
  children: /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
227
- $color: colorWithDefaultToBlack,
247
+ $color: colorOrDefaultToBlack,
228
248
  $isHeader: isHeader,
229
249
  $typeForCurrentWindowSize: typeForCurrentWindowSize,
230
250
  $variant: nonNullableVariant,
@@ -232,7 +252,7 @@ function Typography({
232
252
  ...otherProps
233
253
  })
234
254
  }) : /*#__PURE__*/jsxRuntime.jsx(StyledTypography, {
235
- $color: colorWithDefaultToBlack,
255
+ $color: colorOrDefaultToBlack,
236
256
  $isHeader: isHeader,
237
257
  $variant: nonNullableVariant,
238
258
  accessibilityRole: accessibilityRole || undefined,
@@ -297,31 +317,35 @@ Typography.h4 = createHeading(4, 'header4');
297
317
 
298
318
  Typography.h5 = createHeading(5, 'header5');
299
319
 
300
- const getFirstCharacter = string => string ? string[0] : '';
301
-
302
- const getInitials = (firstname, lastname) => (getFirstCharacter(firstname) + getFirstCharacter(lastname)).toUpperCase();
320
+ const getInitials = (firstname, lastname) => `${firstname[0]}${lastname[0]}`.toUpperCase();
303
321
 
304
322
  const StyledAvatarView = /*#__PURE__*/styled__default.View.withConfig({
305
323
  displayName: "Avatar__StyledAvatarView",
306
324
  componentId: "kitt-universal__sc-9miubv-0"
307
- })(["border-radius:", "px;background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
308
- round,
309
- size
310
- }) => round ? size / 2 : 10, ({
325
+ })(["border-radius:", ";background-color:", ";height:", "px;width:", "px;overflow:hidden;align-items:center;justify-content:center;"], ({
311
326
  theme,
312
- light
313
- }) => light ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor, ({
314
- size
315
- }) => size, ({
316
- size
317
- }) => size);
327
+ $isRound,
328
+ $size
329
+ }) => {
330
+ if ($isRound) return `${$size / 2}px`;
331
+ return theme.kitt.avatar.borderRadius;
332
+ }, ({
333
+ theme,
334
+ $isLight
335
+ }) => $isLight ? theme.kitt.avatar.light.backgroundColor : theme.kitt.avatar.default.backgroundColor, ({
336
+ $size
337
+ }) => $size, ({
338
+ $size
339
+ }) => $size);
318
340
 
319
341
  function AvatarContent({
320
- size = 40,
342
+ size,
321
343
  src,
322
344
  firstname,
323
345
  lastname,
324
- light
346
+ alt,
347
+ base,
348
+ isLight
325
349
  }) {
326
350
  if (src) {
327
351
  return /*#__PURE__*/jsxRuntime.jsx(reactNative.Image, {
@@ -331,34 +355,43 @@ function AvatarContent({
331
355
  style: {
332
356
  width: size,
333
357
  height: size
334
- }
358
+ },
359
+ accessibilityLabel: alt
335
360
  });
336
361
  }
337
362
 
338
363
  if (firstname && lastname) {
339
364
  return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
340
- base: "body-small",
365
+ base: base,
341
366
  variant: "bold",
342
- color: light ? 'black' : 'white',
367
+ color: isLight ? 'black' : 'white',
343
368
  children: getInitials(firstname, lastname)
344
369
  });
345
370
  }
346
371
 
347
372
  return /*#__PURE__*/jsxRuntime.jsx(Icon, {
348
373
  icon: /*#__PURE__*/jsxRuntime.jsx(kittIcons.UserIcon, {}),
349
- color: light ? 'black' : 'white',
374
+ color: isLight ? 'black' : 'white',
350
375
  size: size / 2
351
376
  });
352
377
  }
353
378
 
354
379
  function Avatar({
355
380
  size = 40,
356
- ...rest
381
+ base = 'body-small',
382
+ round,
383
+ light,
384
+ ...props
357
385
  }) {
358
- return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, { ...rest,
359
- size: size,
360
- children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, { ...rest,
361
- size: size
386
+ return /*#__PURE__*/jsxRuntime.jsx(StyledAvatarView, {
387
+ $size: size,
388
+ $isRound: round,
389
+ $isLight: light,
390
+ children: /*#__PURE__*/jsxRuntime.jsx(AvatarContent, {
391
+ size: size,
392
+ base: base,
393
+ isLight: light,
394
+ ...props
362
395
  })
363
396
  });
364
397
  }
@@ -768,7 +801,7 @@ const Button = /*#__PURE__*/react.forwardRef(({
768
801
  });
769
802
  });
770
803
 
771
- const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
804
+ const Container$7 = /*#__PURE__*/styled__default.View.withConfig({
772
805
  displayName: "Card__Container",
773
806
  componentId: "kitt-universal__sc-1n9psug-0"
774
807
  })(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
@@ -788,7 +821,7 @@ function Card({
788
821
  children,
789
822
  type
790
823
  }) {
791
- return /*#__PURE__*/jsxRuntime.jsx(Container$6, {
824
+ return /*#__PURE__*/jsxRuntime.jsx(Container$7, {
792
825
  type: type,
793
826
  children: children
794
827
  });
@@ -976,7 +1009,7 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
976
1009
  }, ({
977
1010
  minHeight
978
1011
  }) => minHeight);
979
- const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
1012
+ const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
980
1013
  displayName: "InputText__Container",
981
1014
  componentId: "kitt-universal__sc-uke279-1"
982
1015
  })(["margin-top:", ";margin-bottom:", ";"], ({
@@ -1050,7 +1083,7 @@ const InputText = /*#__PURE__*/react.forwardRef(({
1050
1083
  isDisabled: disabled,
1051
1084
  formState
1052
1085
  });
1053
- return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
1086
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$6, {
1054
1087
  children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
1055
1088
  ref: ref,
1056
1089
  nativeID: id,
@@ -1140,7 +1173,7 @@ const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
1140
1173
  }) => theme.kitt.forms.radio.checked.innerSize, ({
1141
1174
  theme
1142
1175
  }) => theme.kitt.forms.radio.checked.innerSize / 2);
1143
- const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
1176
+ const Container$5 = /*#__PURE__*/styled__default.Pressable.withConfig({
1144
1177
  displayName: "Radio__Container",
1145
1178
  componentId: "kitt-universal__sc-1mdgr2o-3"
1146
1179
  })(["flex-direction:row;align-items:center;"]);
@@ -1158,7 +1191,7 @@ function Radio({
1158
1191
  disabled = false,
1159
1192
  children
1160
1193
  }) {
1161
- return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
1194
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
1162
1195
  nativeID: id,
1163
1196
  disabled: disabled,
1164
1197
  accessibilityRole: "radio",
@@ -1184,6 +1217,7 @@ function TextArea({ ...props
1184
1217
  const theme = /*#__PURE__*/styled.useTheme();
1185
1218
  return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1186
1219
  multiline: true,
1220
+ textAlignVertical: "top",
1187
1221
  ...props,
1188
1222
  type: "text",
1189
1223
  minHeight: theme.kitt.forms.input.textAreaMinHeight
@@ -1325,7 +1359,7 @@ function FullScreenModalHeader({
1325
1359
  });
1326
1360
  }
1327
1361
 
1328
- const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1362
+ const Container$4 = /*#__PURE__*/styled__default.View.withConfig({
1329
1363
  displayName: "FullScreenModal__Container",
1330
1364
  componentId: "kitt-universal__sc-11qpbe3-0"
1331
1365
  })(["flex:1;background-color:", ";"], ({
@@ -1334,7 +1368,7 @@ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1334
1368
  function FullScreenModal({
1335
1369
  children
1336
1370
  }) {
1337
- return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
1371
+ return /*#__PURE__*/jsxRuntime.jsx(Container$4, {
1338
1372
  children: children
1339
1373
  });
1340
1374
  }
@@ -1364,13 +1398,15 @@ function StyleWebWrapper({
1364
1398
  // };
1365
1399
  // }
1366
1400
  function withTheme(WrappedComponent) {
1367
- return function (props) {
1401
+ // eslint-disable-next-line prefer-arrow-callback
1402
+ return /*#__PURE__*/react.forwardRef(function (props, ref) {
1368
1403
  const theme = /*#__PURE__*/styled.useTheme();
1369
1404
  return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
1405
+ ref: ref,
1370
1406
  theme: theme,
1371
1407
  ...props
1372
1408
  });
1373
- };
1409
+ });
1374
1410
  }
1375
1411
 
1376
1412
  const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("div")({
@@ -1380,9 +1416,6 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("di
1380
1416
  "p1nlccvg-0": [({
1381
1417
  theme
1382
1418
  }) => theme.kitt.iconButton.scale.base.hover],
1383
- "p1nlccvg-1": [({
1384
- theme
1385
- }) => theme.breakpoints.min.mediumBreakpoint],
1386
1419
  "p1nlccvg-2": [({
1387
1420
  theme
1388
1421
  }) => theme.kitt.iconButton.scale.medium.hover],
@@ -1390,11 +1423,16 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("di
1390
1423
  theme
1391
1424
  }) => theme.kitt.iconButton.scale.base.active],
1392
1425
  "p1nlccvg-4": [({
1393
- theme
1394
- }) => theme.kitt.iconButton.default.pressedBackgroundColor],
1395
- "p1nlccvg-5": [({
1396
- theme
1397
- }) => theme.kitt.iconButton.white.pressedBackgroundColor]
1426
+ theme,
1427
+ $isWhite
1428
+ }) => {
1429
+ const {
1430
+ white,
1431
+ default: defaultIconButton
1432
+ } = theme.kitt.iconButton;
1433
+ if ($isWhite) return white.pressedBackgroundColor;
1434
+ return defaultIconButton.pressedBackgroundColor;
1435
+ }]
1398
1436
  }
1399
1437
  }));
1400
1438
  const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
@@ -1438,7 +1476,7 @@ function PressableIconButton({
1438
1476
  }) {
1439
1477
  return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1440
1478
  as: PressableIconButtonWebWrapper,
1441
- "data-color-white": color === 'white' ? true : undefined,
1479
+ $isWhite: color === 'white',
1442
1480
  children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
1443
1481
  })
1444
1482
  });
@@ -1758,7 +1796,7 @@ function LargeLoader({
1758
1796
 
1759
1797
  const xIconSize = 14;
1760
1798
  const mainIconSize = 20;
1761
- const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
1799
+ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1762
1800
  displayName: "Message__Container",
1763
1801
  componentId: "kitt-universal__sc-c6400e-0"
1764
1802
  })(["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;"], ({
@@ -1837,7 +1875,7 @@ function Message({
1837
1875
  insets
1838
1876
  }) {
1839
1877
  const color = getColorByType(type);
1840
- return /*#__PURE__*/jsxRuntime.jsxs(Container$2, {
1878
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$3, {
1841
1879
  type: type,
1842
1880
  noRadius: noRadius,
1843
1881
  insets: insets,
@@ -2038,6 +2076,117 @@ function Notification({
2038
2076
  });
2039
2077
  }
2040
2078
 
2079
+ const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
2080
+ displayName: "SkeletonContent__Container",
2081
+ componentId: "kitt-universal__sc-1u3chjb-0"
2082
+ })(["background-color:", ";border-color:", ";height:100%;width:100%;"], ({
2083
+ theme
2084
+ }) => theme.kitt.skeleton.backgroundColor, ({
2085
+ theme
2086
+ }) => theme.kitt.skeleton.flareColor);
2087
+ const AnimatedLinearGradient = Animated__default.createAnimatedComponent(expoLinearGradient.LinearGradient);
2088
+ function SkeletonContent({
2089
+ isLoading,
2090
+ width
2091
+ }) {
2092
+ const theme = /*#__PURE__*/styled.useTheme();
2093
+ const sharedX = Animated.useSharedValue(0);
2094
+ react.useEffect(() => {
2095
+ if (isLoading) {
2096
+ sharedX.value = Animated.withRepeat(Animated.withTiming(1, {
2097
+ duration: theme.kitt.skeleton.animationDuration,
2098
+ easing: Animated.Easing.inOut(Animated.Easing.ease)
2099
+ }), -1);
2100
+ }
2101
+ }, [sharedX, width, isLoading, theme]);
2102
+ const linearGradientStyle = Animated.useAnimatedStyle(function () {
2103
+ const _f = function () {
2104
+ return {
2105
+ transform: [{
2106
+ translateX: Animated.interpolate(sharedX.value, [0, 1], [-width, width])
2107
+ }]
2108
+ };
2109
+ };
2110
+
2111
+ _f._closure = {
2112
+ interpolate: Animated.interpolate,
2113
+ sharedX,
2114
+ width
2115
+ };
2116
+ _f.asString = "function _f(){const{interpolate,sharedX,width}=jsThis._closure;{return{transform:[{translateX:interpolate(sharedX.value,[0,1],[-width,width])}]};}}";
2117
+ _f.__workletHash = 1670955855244;
2118
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Skeleton/SkeletonContent.tsx (41:47)";
2119
+ _f.__optimalization = 3;
2120
+
2121
+ global.__reanimatedWorkletInit(_f);
2122
+
2123
+ return _f;
2124
+ }());
2125
+ return /*#__PURE__*/jsxRuntime.jsx(Container$2, {
2126
+ children: /*#__PURE__*/jsxRuntime.jsx(AnimatedLinearGradient, {
2127
+ colors: [theme.kitt.skeleton.backgroundColor, theme.kitt.skeleton.flareColor, theme.kitt.skeleton.backgroundColor],
2128
+ locations: [0.1, 0.5, 0.9],
2129
+ start: {
2130
+ x: 0,
2131
+ y: 0
2132
+ },
2133
+ end: {
2134
+ x: 1,
2135
+ y: 0
2136
+ },
2137
+ style: [reactNative.StyleSheet.absoluteFill, linearGradientStyle]
2138
+ })
2139
+ });
2140
+ }
2141
+
2142
+ function Skeleton({
2143
+ isLoading,
2144
+ style
2145
+ }) {
2146
+ const [width, setWidth] = react.useState(0);
2147
+ return /*#__PURE__*/jsxRuntime.jsx(reactNative.View, {
2148
+ style: style,
2149
+ onLayout: ({
2150
+ nativeEvent
2151
+ }) => setWidth(nativeEvent.layout.width),
2152
+ children: /*#__PURE__*/jsxRuntime.jsx(SkeletonContent, {
2153
+ isLoading: isLoading,
2154
+ width: width
2155
+ })
2156
+ });
2157
+ }
2158
+ const Bar = /*#__PURE__*/styled__default(Skeleton).withConfig({
2159
+ displayName: "Skeleton__Bar",
2160
+ componentId: "kitt-universal__sc-1w5cm3i-0"
2161
+ })(["width:100%;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2162
+ theme
2163
+ }) => theme.kitt.spacing * 2, ({
2164
+ theme
2165
+ }) => theme.kitt.spacing * 2);
2166
+ const Circle = /*#__PURE__*/styled__default(Skeleton).withConfig({
2167
+ displayName: "Skeleton__Circle",
2168
+ componentId: "kitt-universal__sc-1w5cm3i-1"
2169
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2170
+ theme
2171
+ }) => theme.kitt.spacing * 12, ({
2172
+ theme
2173
+ }) => theme.kitt.spacing * 12, ({
2174
+ theme
2175
+ }) => theme.kitt.spacing * 6);
2176
+ const Square = /*#__PURE__*/styled__default(Skeleton).withConfig({
2177
+ displayName: "Skeleton__Square",
2178
+ componentId: "kitt-universal__sc-1w5cm3i-2"
2179
+ })(["width:", "px;height:", "px;border-radius:", "px;overflow:hidden;"], ({
2180
+ theme
2181
+ }) => theme.kitt.spacing * 12, ({
2182
+ theme
2183
+ }) => theme.kitt.spacing * 12, ({
2184
+ theme
2185
+ }) => theme.kitt.spacing * 1.5);
2186
+ Skeleton.Bar = Bar;
2187
+ Skeleton.Circle = Circle;
2188
+ Skeleton.Square = Square;
2189
+
2041
2190
  const Flex = /*#__PURE__*/styled__default.View.withConfig({
2042
2191
  shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
2043
2192
  }).withConfig({
@@ -2463,17 +2612,6 @@ const lateOceanColorPalette = {
2463
2612
  moonPurpleLight1: '#EDEBFC'
2464
2613
  };
2465
2614
 
2466
- const avatarLateOceanTheme = {
2467
- default: {
2468
- color: lateOceanColorPalette.white,
2469
- backgroundColor: lateOceanColorPalette.lateOcean
2470
- },
2471
- light: {
2472
- color: lateOceanColorPalette.black1000,
2473
- backgroundColor: lateOceanColorPalette.black100
2474
- }
2475
- };
2476
-
2477
2615
  const colorsLateOceanTheme = {
2478
2616
  primary: lateOceanColorPalette.lateOcean,
2479
2617
  primaryLight: lateOceanColorPalette.lateOceanLight1,
@@ -2496,6 +2634,16 @@ const colorsLateOceanTheme = {
2496
2634
  }
2497
2635
  };
2498
2636
 
2637
+ const avatar = {
2638
+ borderRadius: '10px',
2639
+ default: {
2640
+ backgroundColor: colorsLateOceanTheme.primary
2641
+ },
2642
+ light: {
2643
+ backgroundColor: lateOceanColorPalette.black100
2644
+ }
2645
+ };
2646
+
2499
2647
  const buttonLateOceanTheme = {
2500
2648
  borderRadius: '30px',
2501
2649
  borderWidth: {
@@ -2722,6 +2870,12 @@ const shadowsLateOceanTheme = {
2722
2870
  medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2723
2871
  };
2724
2872
 
2873
+ const skeletonTheme = {
2874
+ backgroundColor: lateOceanColorPalette.black100,
2875
+ flareColor: lateOceanColorPalette.black200,
2876
+ animationDuration: 1000
2877
+ };
2878
+
2725
2879
  const tagLateOceanTheme = {
2726
2880
  borderRadius: '10px',
2727
2881
  padding: '2px 12px',
@@ -2773,18 +2927,16 @@ const tooltip = {
2773
2927
  };
2774
2928
 
2775
2929
  const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
2776
-
2777
2930
  const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
2778
2931
  baseAndSmall: {
2779
2932
  fontSize: `${baseAndSmallFontSize}px`,
2780
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2933
+ lineHeight: `${calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)}px`
2781
2934
  },
2782
2935
  mediumAndWide: {
2783
2936
  fontSize: `${mediumAndWideFontSize}px`,
2784
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2937
+ lineHeight: `${calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)}px`
2785
2938
  }
2786
2939
  });
2787
-
2788
2940
  const typographyLateOceanTheme = {
2789
2941
  colors: {
2790
2942
  black: lateOceanColorPalette.black1000,
@@ -2866,7 +3018,7 @@ const breakpoints = {
2866
3018
  wideBreakpoint: 'max-width: 1279px'
2867
3019
  }
2868
3020
  }; // eslint-disable-next-line unicorn/expiring-todo-comments
2869
- // TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
3021
+ // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
2870
3022
 
2871
3023
  const theme = {
2872
3024
  spacing: 4,
@@ -2874,7 +3026,7 @@ const theme = {
2874
3026
  palettes: {
2875
3027
  lateOcean: lateOceanColorPalette
2876
3028
  },
2877
- avatar: avatarLateOceanTheme,
3029
+ avatar,
2878
3030
  button: buttonLateOceanTheme,
2879
3031
  card: cardLateOceanTheme,
2880
3032
  feedbackMessage: feedbackMessageLateOceanTheme,
@@ -2885,7 +3037,9 @@ const theme = {
2885
3037
  fullScreenModal: fullScreenModalLateOceanTheme,
2886
3038
  iconButton,
2887
3039
  listItem: listItemLateOceanTheme,
2888
- tooltip
3040
+ tooltip,
3041
+ skeleton: skeletonTheme,
3042
+ breakpoints
2889
3043
  };
2890
3044
 
2891
3045
  function Title({
@@ -3249,14 +3403,19 @@ function TypographyEmoji({
3249
3403
 
3250
3404
  const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react$1.styled("span")({
3251
3405
  name: "TypographyLinkWebWrapper",
3252
- class: "tcwz3nt"
3406
+ class: "tcwz3nt",
3407
+ vars: {
3408
+ "tcwz3nt-0": [({
3409
+ $hasNoUnderline
3410
+ }) => $hasNoUnderline ? 'underline' : 'none']
3411
+ }
3253
3412
  }));
3254
3413
  const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
3255
3414
  displayName: "TypographyLink__StyledLink",
3256
3415
  componentId: "kitt-universal__sc-1o1zy30-0"
3257
3416
  })(["text-decoration:", ";", ";", ";"], ({
3258
- $noUnderline
3259
- }) => $noUnderline ? 'none' : 'underline', ({
3417
+ $hasNoUnderline
3418
+ }) => $hasNoUnderline ? 'none' : 'underline', ({
3260
3419
  $disabled
3261
3420
  }) => {
3262
3421
  if (reactNative.Platform.OS !== 'web') return undefined;
@@ -3285,10 +3444,10 @@ function TypographyLink({
3285
3444
  accessibilityRole: "none",
3286
3445
  children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
3287
3446
  as: TypographyLinkWebWrapper,
3288
- "data-nounderline": noUnderline ? true : undefined,
3447
+ $hasNoUnderline: noUnderline,
3289
3448
  children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
3290
3449
  $disabled: disabled,
3291
- $noUnderline: noUnderline,
3450
+ $hasNoUnderline: noUnderline,
3292
3451
  href: href,
3293
3452
  hrefAttrs: hrefAttrs,
3294
3453
  accessibilityRole: "link",
@@ -3357,12 +3516,18 @@ function useKittTheme() {
3357
3516
  return react.useMemo(() => {
3358
3517
  return {
3359
3518
  kitt: theme,
3360
- responsive: createWindowSizeHelper(dimensions),
3361
- breakpoints
3519
+ responsive: createWindowSizeHelper(dimensions)
3362
3520
  };
3363
3521
  }, [dimensions]);
3364
3522
  }
3365
3523
 
3524
+ const hex2rgba = (hex, alpha = 1) => {
3525
+ const r = parseInt(hex.slice(1, 3), 16);
3526
+ const g = parseInt(hex.slice(3, 5), 16);
3527
+ const b = parseInt(hex.slice(5, 7), 16);
3528
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
3529
+ };
3530
+
3366
3531
  function KittThemeProvider({
3367
3532
  children
3368
3533
  }) {
@@ -3423,6 +3588,7 @@ exports.Modal = Modal;
3423
3588
  exports.Notification = Notification;
3424
3589
  exports.Radio = Radio;
3425
3590
  exports.Section = DeprecatedSection;
3591
+ exports.Skeleton = Skeleton;
3426
3592
  exports.Story = Story;
3427
3593
  exports.StoryBlock = StoryBlock;
3428
3594
  exports.StoryContainer = StoryContainer;
@@ -3430,6 +3596,7 @@ exports.StoryDecorator = StoryDecorator;
3430
3596
  exports.StoryGrid = StoryGrid;
3431
3597
  exports.StorySection = StorySection;
3432
3598
  exports.StoryTitle = StoryTitle;
3599
+ exports.StyleWebWrapper = StyleWebWrapper;
3433
3600
  exports.Tag = Tag;
3434
3601
  exports.TextArea = TextArea;
3435
3602
  exports.TimePicker = TimePicker;
@@ -3439,12 +3606,14 @@ exports.TypographyEmoji = TypographyEmoji;
3439
3606
  exports.TypographyIcon = TypographyIcon;
3440
3607
  exports.TypographyLink = TypographyLink;
3441
3608
  exports.createWindowSizeHelper = createWindowSizeHelper;
3609
+ exports.hex2rgba = hex2rgba;
3442
3610
  exports.matchWindowSize = matchWindowSize;
3443
3611
  exports.styledTextInputMixin = styledTextInputMixin;
3444
3612
  exports.theme = theme;
3445
3613
  exports.useKittTheme = useKittTheme;
3446
3614
  exports.useMatchWindowSize = useMatchWindowSize;
3447
3615
  exports.useStoryBlockColor = useStoryBlockColor;
3616
+ exports.withTheme = withTheme;
3448
3617
  Object.keys(kittIcons).forEach(function (k) {
3449
3618
  if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = kittIcons[k];
3450
3619
  });