@ornikar/kitt-universal 3.1.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 (71) hide show
  1. package/dist/definitions/Button/AnimatedButtonPressable.d.ts +14 -0
  2. package/dist/definitions/Button/AnimatedButtonPressable.d.ts.map +1 -0
  3. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts +17 -0
  4. package/dist/definitions/Button/AnimatedButtonPressable.web.d.ts.map +1 -0
  5. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts +11 -0
  6. package/dist/definitions/Button/BaseStyledButtonPressable.d.ts.map +1 -0
  7. package/dist/definitions/Button/Button.d.ts +9 -4
  8. package/dist/definitions/Button/Button.d.ts.map +1 -1
  9. package/dist/definitions/Button/ButtonContent.d.ts +11 -3
  10. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  11. package/dist/definitions/Button/StyledDisabled.d.ts +3 -0
  12. package/dist/definitions/Button/StyledDisabled.d.ts.map +1 -0
  13. package/dist/definitions/Button/isSubtle.d.ts +3 -0
  14. package/dist/definitions/Button/isSubtle.d.ts.map +1 -0
  15. package/dist/definitions/Icon/SpinningIcon.web.d.ts.map +1 -1
  16. package/dist/definitions/IconButton/PressableIconButton.d.ts.map +1 -1
  17. package/dist/definitions/Loader/LargeLoader.web.d.ts.map +1 -1
  18. package/dist/definitions/Loader/Loader.d.ts +1 -1
  19. package/dist/definitions/Loader/Loader.d.ts.map +1 -1
  20. package/dist/definitions/Skeleton/Skeleton.d.ts +14 -0
  21. package/dist/definitions/Skeleton/Skeleton.d.ts.map +1 -0
  22. package/dist/definitions/Skeleton/SkeletonContent.d.ts +8 -0
  23. package/dist/definitions/Skeleton/SkeletonContent.d.ts.map +1 -0
  24. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts +7 -0
  25. package/dist/definitions/Skeleton/SkeletonContent.web.d.ts.map +1 -0
  26. package/dist/definitions/forms/TextArea/TextArea.d.ts.map +1 -1
  27. package/dist/definitions/index.d.ts +4 -0
  28. package/dist/definitions/index.d.ts.map +1 -1
  29. package/dist/definitions/themes/default.d.ts +4 -43
  30. package/dist/definitions/themes/default.d.ts.map +1 -1
  31. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +42 -35
  32. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
  33. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +2 -0
  34. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
  35. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts +7 -0
  36. package/dist/definitions/themes/late-ocean/skeletonTheme.d.ts.map +1 -0
  37. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts +2 -0
  38. package/dist/definitions/themes/late-ocean/typographyLateOceanTheme.d.ts.map +1 -1
  39. package/dist/definitions/typography/Typography.d.ts +2 -0
  40. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  41. package/dist/definitions/typography/TypographyIcon.d.ts +2 -2
  42. package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
  43. package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
  44. package/dist/definitions/utils/hexToRgba.d.ts +2 -0
  45. package/dist/definitions/utils/hexToRgba.d.ts.map +1 -0
  46. package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts +7 -2
  47. package/dist/definitions/utils/windowSize/createWindowSizeHelper.d.ts.map +1 -1
  48. package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts +5 -2
  49. package/dist/definitions/utils/windowSize/useMatchWindowSize.d.ts.map +1 -1
  50. package/dist/definitions/utils/withTheme.d.ts +2 -2
  51. package/dist/definitions/utils/withTheme.d.ts.map +1 -1
  52. package/dist/index-browser-all.es.android.js +614 -272
  53. package/dist/index-browser-all.es.android.js.map +1 -1
  54. package/dist/index-browser-all.es.css +2 -2
  55. package/dist/index-browser-all.es.ios.js +614 -272
  56. package/dist/index-browser-all.es.ios.js.map +1 -1
  57. package/dist/index-browser-all.es.js +654 -306
  58. package/dist/index-browser-all.es.js.map +1 -1
  59. package/dist/index-browser-all.es.web.js +608 -288
  60. package/dist/index-browser-all.es.web.js.map +1 -1
  61. package/dist/index-node-14.17.cjs.css +2 -2
  62. package/dist/index-node-14.17.cjs.js +602 -226
  63. package/dist/index-node-14.17.cjs.js.map +1 -1
  64. package/dist/index-node-14.17.cjs.web.css +4 -2
  65. package/dist/index-node-14.17.cjs.web.js +546 -220
  66. package/dist/index-node-14.17.cjs.web.js.map +1 -1
  67. package/dist/styles.css +4 -2
  68. package/dist/tsbuildinfo +1 -1
  69. package/package.json +4 -3
  70. package/dist/definitions/Button/ButtonPressable.d.ts +0 -13
  71. package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
@@ -7,11 +7,12 @@ const reactNative = require('react-native');
7
7
  const styled = require('styled-components/native');
8
8
  const react = require('react');
9
9
  const jsxRuntime = require('react/jsx-runtime');
10
+ const Animated = require('react-native-reanimated');
10
11
  const twemojiParser = require('twemoji-parser');
11
12
  const WebBrowser = require('expo-web-browser');
12
13
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
13
- const Animated = require('react-native-reanimated');
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');
@@ -56,7 +57,7 @@ function SpinningIcon({
56
57
  });
57
58
  }
58
59
 
59
- const IconContainer$2 = /*#__PURE__*/styled__default.View.withConfig({
60
+ const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
60
61
  displayName: "Icon__IconContainer",
61
62
  componentId: "kitt-universal__sc-usm0ol-0"
62
63
  })(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
@@ -78,7 +79,7 @@ function Icon({
78
79
  const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
79
80
  color
80
81
  });
81
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer$2, {
82
+ return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
82
83
  align: align,
83
84
  size: size,
84
85
  color: color,
@@ -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,
@@ -363,79 +383,232 @@ function Avatar({
363
383
  });
364
384
  }
365
385
 
366
- function TypographyIconInheritColor(props) {
367
- const color = useTypographyColor();
386
+ const StyledPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
387
+ displayName: "AnimatedButtonPressable__StyledPressable",
388
+ componentId: "kitt-universal__sc-175vyve-0"
389
+ })(["", ""], ({
390
+ $isStretch
391
+ }) => {
392
+ if ($isStretch) return undefined;
393
+ return 'align-self: flex-start;';
394
+ });
395
+ const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
396
+ displayName: "AnimatedButtonPressable__StyledAnimatedView",
397
+ componentId: "kitt-universal__sc-175vyve-1"
398
+ })(["border-radius:", ";"], ({
399
+ theme
400
+ }) => theme.kitt.button.borderRadius);
401
+ const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
402
+ children,
403
+ disabled,
404
+ accessibilityRole,
405
+ $type,
406
+ $isStretch,
407
+ href,
408
+ hrefAttrs,
409
+ testID,
410
+ onPress
411
+ }, ref) => {
368
412
  const theme = /*#__PURE__*/styled.useTheme();
369
- return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
370
- color: theme.kitt.typography.colors[color]
413
+ const pressed = Animated.useSharedValue(0);
414
+ const color = Animated.useSharedValue(0);
415
+ const {
416
+ backgroundColor,
417
+ pressedBackgroundColor
418
+ } = theme.kitt.button[$type];
419
+ const {
420
+ scale
421
+ } = theme.kitt.button;
422
+ const scaleStyles = Animated.useAnimatedStyle(function () {
423
+ const _f = function () {
424
+ return {
425
+ backgroundColor: Animated.interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
426
+ transform: [{
427
+ scale: Animated.withSpring(pressed.value ? scale.base.active : scale.base.default)
428
+ }]
429
+ };
430
+ };
431
+
432
+ _f._closure = {
433
+ interpolateColor: Animated.interpolateColor,
434
+ color,
435
+ backgroundColor,
436
+ pressedBackgroundColor,
437
+ withSpring: Animated.withSpring,
438
+ pressed,
439
+ scale: {
440
+ base: {
441
+ active: scale.base.active,
442
+ default: scale.base.default
443
+ }
444
+ }
445
+ };
446
+ _f.asString = "function _f(){const{interpolateColor,color,backgroundColor,pressedBackgroundColor,withSpring,pressed,scale}=jsThis._closure;{return{backgroundColor:interpolateColor(color.value,[0,1],[backgroundColor,pressedBackgroundColor]),transform:[{scale:withSpring(pressed.value?scale.base.active:scale.base.default)}]};}}";
447
+ _f.__workletHash = 5368461229978;
448
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (53:41)";
449
+ _f.__optimalization = 2;
450
+
451
+ global.__reanimatedWorkletInit(_f);
452
+
453
+ return _f;
454
+ }());
455
+
456
+ const handlePressInOut = pressIn => {
457
+ color.value = Animated.withSpring(pressIn ? 1 : 0);
458
+ pressed.value = pressIn ? 1 : 0;
459
+ };
460
+
461
+ return /*#__PURE__*/jsxRuntime.jsx(StyledPressable, {
462
+ ref: ref,
463
+ disabled: disabled,
464
+ accessibilityRole: accessibilityRole,
465
+ testID: testID,
466
+ href: href,
467
+ hrefAttrs: hrefAttrs,
468
+ $isStretch: $isStretch,
469
+ $type: $type,
470
+ onPress: onPress,
471
+ onPressIn: () => {
472
+ handlePressInOut(true);
473
+ },
474
+ onPressOut: () => {
475
+ handlePressInOut(false);
476
+ },
477
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledAnimatedView, {
478
+ style: disabled ? [{
479
+ transform: [{
480
+ scale: 1
481
+ }]
482
+ }] : [scaleStyles],
483
+ children: children
484
+ })
371
485
  });
372
- }
486
+ });
487
+
488
+ const BaseStyledButtonPressable = /*#__PURE__*/styled__default.View.withConfig({
489
+ displayName: "BaseStyledButtonPressable",
490
+ componentId: "kitt-universal__sc-4k8lse-0"
491
+ })(["position:relative;min-width:", ";max-width:", ";width:", ";min-height:", ";border-radius:", ";flex-direction:row;align-items:center;justify-content:center;align-self:flex-start;background-color:", ";padding:", ";"], ({
492
+ theme
493
+ }) => theme.kitt.button.minWidth, ({
494
+ theme,
495
+ $isStretch
496
+ }) => $isStretch ? '100%' : theme.kitt.button.maxWidth, ({
497
+ $isStretch
498
+ }) => $isStretch ? '100%' : 'auto', ({
499
+ theme
500
+ }) => theme.kitt.button.minHeight, ({
501
+ theme
502
+ }) => theme.kitt.button.borderRadius, ({
503
+ theme,
504
+ $isDisabled,
505
+ $type
506
+ }) => {
507
+ if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
508
+ if (reactNative.Platform.OS !== 'web') return 'transparent';
509
+ return theme.kitt.button[$type].backgroundColor;
510
+ }, ({
511
+ theme,
512
+ $isLarge,
513
+ $isDisabled
514
+ }) => {
515
+ const {
516
+ large,
517
+ default: defaultPadding,
518
+ disabled: disabledPadding
519
+ } = theme.kitt.button.contentPadding;
520
+ if ($isLarge) return large;
521
+ if ($isDisabled) return disabledPadding;
522
+ return defaultPadding;
523
+ });
373
524
 
374
525
  function TypographyIconSpecifiedColor({
375
526
  color,
376
- ...otherProps
527
+ ...props
377
528
  }) {
378
529
  const theme = /*#__PURE__*/styled.useTheme();
379
- return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...otherProps,
380
- color: theme.kitt.typography.colors[color]
530
+ return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
531
+ color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
532
+ });
533
+ }
534
+
535
+ function TypographyIconInheritColor(props) {
536
+ const color = useTypographyColor();
537
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
538
+ color: color,
539
+ ...props
381
540
  });
382
541
  }
383
542
 
384
543
  function TypographyIcon({
385
544
  color,
386
- ...otherProps
545
+ ...props
387
546
  }) {
388
547
  if (color) {
389
548
  return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
390
549
  color: color,
391
- ...otherProps
550
+ ...props
392
551
  });
393
552
  }
394
553
 
395
- return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...otherProps
554
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...props
396
555
  });
397
556
  }
398
557
 
399
- const getTextColorByType = (type, isPressed, disabled) => {
400
- if (disabled) return 'black-light';
558
+ function isSubtle(type) {
559
+ return type.startsWith('subtle');
560
+ }
401
561
 
562
+ const getTextColorByType = type => {
402
563
  switch (type) {
403
564
  case 'primary':
404
565
  return 'white';
405
566
 
567
+ case 'white':
568
+ return 'white';
569
+
406
570
  case 'subtle':
407
- return isPressed ? 'primary-light' : 'primary';
571
+ return 'primary';
408
572
 
409
573
  case 'subtle-dark':
410
- return isPressed ? 'black-light' : 'black';
574
+ return 'black';
411
575
 
412
- case 'secondary':
413
576
  default:
414
577
  return 'black';
415
578
  }
416
579
  };
417
580
 
418
- const ButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
419
- displayName: "ButtonContent__ButtonText",
581
+ const StyledButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
582
+ displayName: "ButtonContent__StyledButtonText",
420
583
  componentId: "kitt-universal__sc-dnyw3n-0"
421
- })(["text-align:center;"]);
422
- const Content$1 = /*#__PURE__*/styled__default.View.withConfig({
423
- displayName: "ButtonContent__Content",
584
+ })(["text-align:center;", " ", ""], () => {
585
+ // Make the multilines case work properly on native
586
+ // Breaks the web implem
587
+ if (reactNative.Platform.OS === 'web') return undefined;
588
+ return `
589
+ flex-shrink: 1;
590
+ `;
591
+ }, ({
592
+ $type,
593
+ $isDisabled
594
+ }) => {
595
+ /* For subltes button, color changes when hovered.
596
+ * We don't want to use a mouse event handler with a react state to handle it
597
+ * For this precise case, we've decided to work outside the typography logic
598
+ */
599
+ if (reactNative.Platform.OS !== 'web' || $isDisabled || !isSubtle($type)) return undefined;
600
+ return 'color: inherit';
601
+ });
602
+ const StyledIconContainer = /*#__PURE__*/styled__default.View.withConfig({
603
+ displayName: "ButtonContent__StyledIconContainer",
424
604
  componentId: "kitt-universal__sc-dnyw3n-1"
425
- })(["flex-direction:row;align-items:center;justify-content:center;flex:", ";"], ({
426
- stretch,
427
- iconOnly
428
- }) => `${stretch || iconOnly ? 1 : 0} 1 auto`);
429
- const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
430
- displayName: "ButtonContent__IconContainer",
431
- componentId: "kitt-universal__sc-dnyw3n-2"
432
605
  })(["", ""], ({
433
606
  theme,
434
- iconPosition
607
+ $iconPosition
435
608
  }) => {
436
- const value = theme.kitt.spacing * 3;
609
+ const value = theme.kitt.spacing * 2;
437
610
 
438
- if (iconPosition === 'left') {
611
+ if ($iconPosition === 'left') {
439
612
  return `margin: 0 ${value}px 0 0;`;
440
613
  }
441
614
 
@@ -444,152 +617,178 @@ const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
444
617
 
445
618
  function ButtonIcon({
446
619
  icon,
447
- spin,
448
620
  color,
449
- size,
621
+ spin,
450
622
  iconPosition,
451
623
  testID
452
624
  }) {
453
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
454
- iconPosition: iconPosition,
625
+ return /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
626
+ $iconPosition: iconPosition,
455
627
  children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
456
628
  icon: icon,
457
629
  spin: spin,
458
- color: color,
459
- size: size,
460
- testID: testID
630
+ testID: testID,
631
+ color: color
461
632
  })
462
633
  });
463
634
  }
464
635
 
465
- function ButtonContent({
636
+ const StyledChildrenWithIcon = /*#__PURE__*/styled__default.View.withConfig({
637
+ displayName: "ButtonContent__StyledChildrenWithIcon",
638
+ componentId: "kitt-universal__sc-dnyw3n-2"
639
+ })(["align-items:center;justify-content:center;flex-direction:row;"]);
640
+ function ButtonContentChildren({
466
641
  type,
467
- isPressed,
468
- stretch,
469
642
  icon,
470
643
  iconPosition,
471
644
  iconSpin,
472
- disabled,
645
+ isDisabled,
646
+ color,
473
647
  children
474
648
  }) {
475
- const color = getTextColorByType(type, Boolean(isPressed), Boolean(disabled));
476
- const theme = /*#__PURE__*/styled.useTheme();
477
- const sharedIconProps = {
478
- spin: iconSpin,
479
- color,
480
- size: theme.kitt.button.iconSize
481
- };
482
-
483
649
  if ((process.env.NODE_ENV !== "production")) {
484
650
  if (!(children || icon)) {
485
651
  throw new Error('kitt(Button): You should provide at least a children or a icon');
486
652
  }
487
653
  }
488
654
 
655
+ const isWebSubtle = isSubtle(type) && reactNative.Platform.OS === 'web' && !isDisabled;
656
+
489
657
  if (!children) {
490
- return /*#__PURE__*/jsxRuntime.jsx(Content$1, {
491
- iconOnly: true,
492
- stretch: stretch,
493
- children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, { ...sharedIconProps,
494
- icon: icon
495
- })
658
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
659
+ spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
660
+ ,
661
+ icon: icon,
662
+ color: isWebSubtle ? 'inherit' : color
496
663
  });
497
664
  }
498
665
 
499
- return /*#__PURE__*/jsxRuntime.jsxs(Content$1, {
500
- stretch: stretch,
501
- children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...sharedIconProps,
502
- icon: icon,
503
- iconPosition: iconPosition,
504
- testID: "button-left-icon"
505
- }) : null, /*#__PURE__*/jsxRuntime.jsx(ButtonText, {
666
+ const buttonIconSharedProps = {
667
+ type,
668
+ spin: iconSpin,
669
+ iconPosition,
670
+ color: isWebSubtle ? 'inherit' : color
671
+ };
672
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledChildrenWithIcon, {
673
+ children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
674
+ testID: "button-left-icon",
675
+ icon: icon
676
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(StyledButtonText, {
506
677
  base: "body",
507
- color: color,
508
678
  variant: "bold",
679
+ $type: type,
680
+ $isDisabled: isDisabled // set to color: inherit via styled components
681
+ ,
682
+ color: isWebSubtle ? undefined : color,
509
683
  children: children
510
- }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...sharedIconProps,
511
- icon: icon,
512
- iconPosition: iconPosition
684
+ }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
685
+ icon: icon
513
686
  }) : null]
514
687
  });
515
688
  }
689
+ const ButtonContentContainer = /*#__PURE__*/styled__default.View.withConfig({
690
+ displayName: "ButtonContent__ButtonContentContainer",
691
+ componentId: "kitt-universal__sc-dnyw3n-3"
692
+ })(["line-height:16px;", " ", ";"], ({
693
+ $isStretch,
694
+ $isIconOnly
695
+ }) => {
696
+ // Make the multilines case work properly on web
697
+ // Breaks the native implem
698
+ if (reactNative.Platform.OS !== 'web') return undefined;
699
+ return `
700
+ flex: ${$isStretch || $isIconOnly ? 1 : 0} 1 auto;
701
+ `;
702
+ }, ({
703
+ $isSubtle
704
+ }) => {
705
+ if (reactNative.Platform.OS !== 'web' || !$isSubtle) return undefined; // Needed for subtle type
706
+
707
+ return 'color: inherit';
708
+ });
709
+ function ButtonContent({
710
+ type,
711
+ isDisabled,
712
+ $isStretch,
713
+ icon,
714
+ children,
715
+ ...props
716
+ }) {
717
+ const color = isDisabled ? 'black-light' : getTextColorByType(type);
718
+ return /*#__PURE__*/jsxRuntime.jsx(ButtonContentContainer, {
719
+ $isSubtle: isSubtle(type),
720
+ $isStretch: $isStretch,
721
+ $isIconOnly: Boolean(!children && icon),
722
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonContentChildren, {
723
+ icon: icon,
724
+ type: type,
725
+ isDisabled: isDisabled,
726
+ color: color,
727
+ ...props,
728
+ children: children
729
+ })
730
+ });
731
+ }
516
732
 
517
- const ButtonPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
518
- displayName: "ButtonPressable",
519
- componentId: "kitt-universal__sc-7ckel6-0"
520
- })(["min-width:", ";max-width:", ";width:", ";min-height:", ";background-color:", ";padding:", ";flex-direction:row;align-self:flex-start;border-radius:", ";border-color:", ";border-width:", ";"], ({
521
- theme
522
- }) => theme.kitt.button.minWidth, ({
523
- theme,
524
- stretch
525
- }) => stretch ? 'auto' : theme.kitt.button.maxWidth, ({
526
- stretch
527
- }) => stretch ? '100%' : 'auto', ({
733
+ const StyledDisabled = /*#__PURE__*/styled__default.View.withConfig({
734
+ displayName: "StyledDisabled",
735
+ componentId: "kitt-universal__sc-16irf7q-0"
736
+ })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], ({
528
737
  theme
529
- }) => theme.kitt.button.minHeight, ({
530
- theme,
531
- isPressed,
532
- disabled,
533
- type
534
738
  }) => {
535
- if (disabled) {
536
- return theme.kitt.button[type].disabledBackgroundColor;
537
- }
538
-
539
- return isPressed ? theme.kitt.button[type].pressedBackgroundColor : theme.kitt.button[type].backgroundColor;
739
+ const {
740
+ borderWidth,
741
+ disabled
742
+ } = theme.kitt.button;
743
+ return `${borderWidth.disabled} solid ${disabled.borderColor}`;
540
744
  }, ({
541
745
  theme
542
- }) => theme.kitt.button.contentPadding.default, ({
543
- theme
544
- }) => theme.kitt.button.borderRadius, ({
545
- theme,
546
- disabled,
547
- type
548
- }) => disabled ? theme.kitt.button[type].disabledBorderColor : 'transparent', ({
549
- theme
550
- }) => theme.kitt.button.borderWidth);
746
+ }) => theme.kitt.button.borderRadius);
551
747
 
552
- function Button({
748
+ const Button = /*#__PURE__*/react.forwardRef(({
553
749
  children,
554
- type = 'secondary',
750
+ type = 'default',
751
+ disabled,
752
+ stretch,
753
+ large,
555
754
  icon,
556
755
  iconPosition = 'left',
557
756
  iconSpin,
558
- stretch,
559
- disabled,
560
757
  testID,
561
758
  href,
562
759
  hrefAttrs,
760
+ accessibilityRole = 'button',
563
761
  onPress
564
- }) {
565
- const [isPressed, setIsPressed] = react.useState(false);
566
- const sharedProps = {
567
- type,
568
- stretch,
569
- disabled
570
- };
571
- return /*#__PURE__*/jsxRuntime.jsx(ButtonPressable // eslint-disable-next-line unicorn/expiring-todo-comments
572
- // TODO: When designs are defined, update with the proper onPress styles to mimic TouchableHighlight
573
- // underlayColor={globalTheme.button[type].pressedBackgroundColor}
574
- , { ...sharedProps,
575
- isPressed: isPressed,
576
- accessibilityRole: "button",
762
+ }, ref) => {
763
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
764
+ ref: ref,
765
+ accessibilityRole: accessibilityRole,
577
766
  testID: testID,
578
767
  href: href,
579
768
  hrefAttrs: hrefAttrs,
769
+ disabled: disabled,
770
+ $isStretch: stretch,
771
+ $type: type,
580
772
  onPress: onPress,
581
- onPressIn: () => setIsPressed(true),
582
- onPressOut: () => setIsPressed(false),
583
- children: /*#__PURE__*/jsxRuntime.jsx(ButtonContent, { ...sharedProps,
584
- icon: icon,
585
- iconPosition: iconPosition,
586
- iconSpin: iconSpin,
587
- children: children
773
+ children: /*#__PURE__*/jsxRuntime.jsxs(BaseStyledButtonPressable, {
774
+ $type: type,
775
+ $isStretch: stretch,
776
+ $isLarge: large,
777
+ $isDisabled: disabled,
778
+ children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
779
+ type: type,
780
+ $isStretch: stretch,
781
+ isDisabled: disabled,
782
+ icon: icon,
783
+ iconPosition: iconPosition,
784
+ iconSpin: iconSpin,
785
+ children: children
786
+ }), reactNative.Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsxRuntime.jsx(StyledDisabled, {}) : null]
588
787
  })
589
788
  });
590
- }
789
+ });
591
790
 
592
- const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
791
+ const Container$7 = /*#__PURE__*/styled__default.View.withConfig({
593
792
  displayName: "Card__Container",
594
793
  componentId: "kitt-universal__sc-1n9psug-0"
595
794
  })(["background-color:", ";padding:", ";border-radius:", ";border-width:", ";border-color:", ";"], ({
@@ -609,7 +808,7 @@ function Card({
609
808
  children,
610
809
  type
611
810
  }) {
612
- return /*#__PURE__*/jsxRuntime.jsx(Container$6, {
811
+ return /*#__PURE__*/jsxRuntime.jsx(Container$7, {
613
812
  type: type,
614
813
  children: children
615
814
  });
@@ -797,7 +996,7 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
797
996
  }, ({
798
997
  minHeight
799
998
  }) => minHeight);
800
- const Container$5 = /*#__PURE__*/styled__default.View.withConfig({
999
+ const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
801
1000
  displayName: "InputText__Container",
802
1001
  componentId: "kitt-universal__sc-uke279-1"
803
1002
  })(["margin-top:", ";margin-bottom:", ";"], ({
@@ -871,7 +1070,7 @@ const InputText = /*#__PURE__*/react.forwardRef(({
871
1070
  isDisabled: disabled,
872
1071
  formState
873
1072
  });
874
- return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
1073
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$6, {
875
1074
  children: [/*#__PURE__*/jsxRuntime.jsx(Input, {
876
1075
  ref: ref,
877
1076
  nativeID: id,
@@ -961,7 +1160,7 @@ const SelectedInnerRadio = /*#__PURE__*/styled__default.View.withConfig({
961
1160
  }) => theme.kitt.forms.radio.checked.innerSize, ({
962
1161
  theme
963
1162
  }) => theme.kitt.forms.radio.checked.innerSize / 2);
964
- const Container$4 = /*#__PURE__*/styled__default.Pressable.withConfig({
1163
+ const Container$5 = /*#__PURE__*/styled__default.Pressable.withConfig({
965
1164
  displayName: "Radio__Container",
966
1165
  componentId: "kitt-universal__sc-1mdgr2o-3"
967
1166
  })(["flex-direction:row;align-items:center;"]);
@@ -979,7 +1178,7 @@ function Radio({
979
1178
  disabled = false,
980
1179
  children
981
1180
  }) {
982
- return /*#__PURE__*/jsxRuntime.jsxs(Container$4, {
1181
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$5, {
983
1182
  nativeID: id,
984
1183
  disabled: disabled,
985
1184
  accessibilityRole: "radio",
@@ -1005,6 +1204,7 @@ function TextArea({ ...props
1005
1204
  const theme = /*#__PURE__*/styled.useTheme();
1006
1205
  return /*#__PURE__*/jsxRuntime.jsx(InputText, {
1007
1206
  multiline: true,
1207
+ textAlignVertical: "top",
1008
1208
  ...props,
1009
1209
  type: "text",
1010
1210
  minHeight: theme.kitt.forms.input.textAreaMinHeight
@@ -1146,7 +1346,7 @@ function FullScreenModalHeader({
1146
1346
  });
1147
1347
  }
1148
1348
 
1149
- const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1349
+ const Container$4 = /*#__PURE__*/styled__default.View.withConfig({
1150
1350
  displayName: "FullScreenModal__Container",
1151
1351
  componentId: "kitt-universal__sc-11qpbe3-0"
1152
1352
  })(["flex:1;background-color:", ";"], ({
@@ -1155,7 +1355,7 @@ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1155
1355
  function FullScreenModal({
1156
1356
  children
1157
1357
  }) {
1158
- return /*#__PURE__*/jsxRuntime.jsx(Container$3, {
1358
+ return /*#__PURE__*/jsxRuntime.jsx(Container$4, {
1159
1359
  children: children
1160
1360
  });
1161
1361
  }
@@ -1184,8 +1384,7 @@ function StyleWebWrapper({
1184
1384
  // return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
1185
1385
  // };
1186
1386
  // }
1187
- function withTheme( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1188
- WrappedComponent) {
1387
+ function withTheme(WrappedComponent) {
1189
1388
  return function (props) {
1190
1389
  const theme = /*#__PURE__*/styled.useTheme();
1191
1390
  return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
@@ -1212,11 +1411,16 @@ const PressableIconButtonWebWrapper = withTheme( /*#__PURE__*/react$1.styled("di
1212
1411
  theme
1213
1412
  }) => theme.kitt.iconButton.scale.base.active],
1214
1413
  "p1nlccvg-4": [({
1215
- theme
1216
- }) => theme.kitt.iconButton.default.pressedBackgroundColor],
1217
- "p1nlccvg-5": [({
1218
- theme
1219
- }) => theme.kitt.iconButton.white.pressedBackgroundColor]
1414
+ theme,
1415
+ $isWhite
1416
+ }) => {
1417
+ const {
1418
+ white,
1419
+ default: defaultIconButton
1420
+ } = theme.kitt.iconButton;
1421
+ if ($isWhite) return white.pressedBackgroundColor;
1422
+ return defaultIconButton.pressedBackgroundColor;
1423
+ }]
1220
1424
  }
1221
1425
  }));
1222
1426
  const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withConfig({
@@ -1260,7 +1464,7 @@ function PressableIconButton({
1260
1464
  }) {
1261
1465
  return /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
1262
1466
  as: PressableIconButtonWebWrapper,
1263
- "data-color-white": color === 'white' ? true : undefined,
1467
+ $isWhite: color === 'white',
1264
1468
  children: /*#__PURE__*/jsxRuntime.jsx(StyledPressableIconButton, { ...props
1265
1469
  })
1266
1470
  });
@@ -1580,7 +1784,7 @@ function LargeLoader({
1580
1784
 
1581
1785
  const xIconSize = 14;
1582
1786
  const mainIconSize = 20;
1583
- const Container$2 = /*#__PURE__*/styled__default.View.withConfig({
1787
+ const Container$3 = /*#__PURE__*/styled__default.View.withConfig({
1584
1788
  displayName: "Message__Container",
1585
1789
  componentId: "kitt-universal__sc-c6400e-0"
1586
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;"], ({
@@ -1659,7 +1863,7 @@ function Message({
1659
1863
  insets
1660
1864
  }) {
1661
1865
  const color = getColorByType(type);
1662
- return /*#__PURE__*/jsxRuntime.jsxs(Container$2, {
1866
+ return /*#__PURE__*/jsxRuntime.jsxs(Container$3, {
1663
1867
  type: type,
1664
1868
  noRadius: noRadius,
1665
1869
  insets: insets,
@@ -1860,6 +2064,117 @@ function Notification({
1860
2064
  });
1861
2065
  }
1862
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
+
1863
2178
  const Flex = /*#__PURE__*/styled__default.View.withConfig({
1864
2179
  shouldForwardProp: (prop, defaultValidatorFn) => !['direction', 'padding'].includes(prop) && defaultValidatorFn(prop)
1865
2180
  }).withConfig({
@@ -2296,47 +2611,98 @@ const avatarLateOceanTheme = {
2296
2611
  }
2297
2612
  };
2298
2613
 
2614
+ const colorsLateOceanTheme = {
2615
+ primary: lateOceanColorPalette.lateOcean,
2616
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
2617
+ accent: lateOceanColorPalette.warmEmbrace,
2618
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
2619
+ success: lateOceanColorPalette.viride,
2620
+ correct: lateOceanColorPalette.viride,
2621
+ danger: lateOceanColorPalette.englishVermillon,
2622
+ separator: lateOceanColorPalette.black100,
2623
+ hover: lateOceanColorPalette.black100,
2624
+ black: lateOceanColorPalette.black1000,
2625
+ uiBackground: lateOceanColorPalette.black25,
2626
+ uiBackgroundLight: lateOceanColorPalette.white,
2627
+ transparent: lateOceanColorPalette.transparent,
2628
+ disabled: lateOceanColorPalette.black50,
2629
+ overlay: {
2630
+ dark: 'rgba(41, 48, 51, 0.25)',
2631
+ light: 'rgba(255, 255, 255, 0.90)',
2632
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2633
+ }
2634
+ };
2635
+
2299
2636
  const buttonLateOceanTheme = {
2300
2637
  borderRadius: '30px',
2301
- borderWidth: '2px',
2302
- minHeight: '42px',
2638
+ borderWidth: {
2639
+ disabled: '2px',
2640
+ focus: '3px'
2641
+ },
2642
+ minHeight: '40px',
2303
2643
  minWidth: '40px',
2304
2644
  maxWidth: '335px',
2305
- iconSize: 18,
2645
+ scale: {
2646
+ base: {
2647
+ default: 1,
2648
+ hover: 0.95,
2649
+ active: 0.95
2650
+ },
2651
+ medium: {
2652
+ hover: 1.05
2653
+ }
2654
+ },
2306
2655
  contentPadding: {
2307
- default: '8px 16px'
2656
+ default: '8px 16px 7px',
2657
+ large: '12px 24px 11px',
2658
+ disabled: '6px 14px 5px'
2308
2659
  },
2309
- primary: {
2310
- backgroundColor: lateOceanColorPalette.lateOcean,
2311
- disabledBackgroundColor: lateOceanColorPalette.black50,
2312
- pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
2313
- disabledBorderColor: lateOceanColorPalette.black100
2660
+ transition: {
2661
+ duration: '200ms',
2662
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
2314
2663
  },
2315
- secondary: {
2664
+ default: {
2316
2665
  backgroundColor: 'rgba(0, 0, 0, 0.05)',
2317
- disabledBackgroundColor: lateOceanColorPalette.black50,
2318
2666
  pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2319
- disabledBorderColor: lateOceanColorPalette.black100
2320
- },
2321
- subtle: {
2322
- backgroundColor: lateOceanColorPalette.transparent,
2323
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2324
- pressedBackgroundColor: lateOceanColorPalette.transparent,
2325
- disabledBorderColor: lateOceanColorPalette.transparent
2667
+ hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2668
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)'
2326
2669
  },
2327
- 'subtle-dark': {
2328
- backgroundColor: lateOceanColorPalette.transparent,
2329
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2330
- pressedBackgroundColor: lateOceanColorPalette.transparent,
2331
- disabledBorderColor: lateOceanColorPalette.transparent
2670
+ primary: {
2671
+ backgroundColor: colorsLateOceanTheme.primary,
2672
+ pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
2673
+ hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
2674
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)'
2332
2675
  },
2333
2676
  white: {
2334
2677
  backgroundColor: 'rgba(255, 255, 255, 0.05)',
2335
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2336
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2337
2678
  pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2338
- focusBorderColor: 'rgba(255, 255, 255, 0.1)',
2339
- disabledBorderColor: lateOceanColorPalette.transparent
2679
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2680
+ focusBorderColor: 'rgba(255, 255, 255, 0.1)'
2681
+ },
2682
+ subtle: {
2683
+ backgroundColor: colorsLateOceanTheme.transparent,
2684
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2685
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2686
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)',
2687
+ color: colorsLateOceanTheme.primary,
2688
+ hoverColor: 'rgba(76, 52, 224, 0.8)',
2689
+ activeColor: 'rgba(76, 52, 224, 0.8)'
2690
+ },
2691
+ 'subtle-dark': {
2692
+ backgroundColor: colorsLateOceanTheme.transparent,
2693
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2694
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2695
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)',
2696
+ color: colorsLateOceanTheme.black,
2697
+ hoverColor: 'rgba(0, 0, 0, 0.8)',
2698
+ activeColor: 'rgba(0, 0, 0, 0.8)'
2699
+ },
2700
+ disabled: {
2701
+ backgroundColor: colorsLateOceanTheme.disabled,
2702
+ pressedBackgroundColor: colorsLateOceanTheme.disabled,
2703
+ hoverBackgroundColor: colorsLateOceanTheme.disabled,
2704
+ focusBorderColor: lateOceanColorPalette.black100,
2705
+ borderColor: lateOceanColorPalette.black100
2340
2706
  }
2341
2707
  };
2342
2708
 
@@ -2358,26 +2724,6 @@ const cardLateOceanTheme = {
2358
2724
  }
2359
2725
  };
2360
2726
 
2361
- const colorsLateOceanTheme = {
2362
- primary: lateOceanColorPalette.lateOcean,
2363
- primaryLight: lateOceanColorPalette.lateOceanLight1,
2364
- accent: lateOceanColorPalette.warmEmbrace,
2365
- accentLight: lateOceanColorPalette.warmEmbraceLight1,
2366
- success: lateOceanColorPalette.viride,
2367
- correct: lateOceanColorPalette.viride,
2368
- danger: lateOceanColorPalette.englishVermillon,
2369
- separator: lateOceanColorPalette.black100,
2370
- hover: lateOceanColorPalette.black100,
2371
- black: lateOceanColorPalette.black1000,
2372
- uiBackground: lateOceanColorPalette.black25,
2373
- uiBackgroundLight: lateOceanColorPalette.white,
2374
- overlay: {
2375
- dark: 'rgba(41, 48, 51, 0.25)',
2376
- light: 'rgba(255, 255, 255, 0.90)',
2377
- fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2378
- }
2379
- };
2380
-
2381
2727
  const feedbackMessageLateOceanTheme = {
2382
2728
  backgroundColors: {
2383
2729
  success: lateOceanColorPalette.viride,
@@ -2491,11 +2837,11 @@ const iconButton = {
2491
2837
  },
2492
2838
  disabled: {
2493
2839
  scale: 1,
2494
- backgroundColor: buttonLateOceanTheme.secondary.disabledBackgroundColor,
2495
- borderColor: buttonLateOceanTheme.secondary.disabledBorderColor
2840
+ backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
2841
+ borderColor: buttonLateOceanTheme.disabled.borderColor
2496
2842
  },
2497
2843
  default: {
2498
- pressedBackgroundColor: buttonLateOceanTheme.secondary.pressedBackgroundColor
2844
+ pressedBackgroundColor: buttonLateOceanTheme.default.pressedBackgroundColor
2499
2845
  },
2500
2846
  white: {
2501
2847
  pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
@@ -2513,6 +2859,12 @@ const shadowsLateOceanTheme = {
2513
2859
  medium: '0px 10px 20px rgba(41, 48, 51, 0.25)'
2514
2860
  };
2515
2861
 
2862
+ const skeletonTheme = {
2863
+ backgroundColor: lateOceanColorPalette.black100,
2864
+ flareColor: lateOceanColorPalette.black200,
2865
+ animationDuration: 1000
2866
+ };
2867
+
2516
2868
  const tagLateOceanTheme = {
2517
2869
  borderRadius: '10px',
2518
2870
  padding: '2px 12px',
@@ -2564,18 +2916,16 @@ const tooltip = {
2564
2916
  };
2565
2917
 
2566
2918
  const calcLineHeight = (fontSize, lineHeightMultiplier) => Math.round(fontSize * lineHeightMultiplier);
2567
-
2568
2919
  const createTypographyTypeConfig = (lineHeightMultiplier, baseAndSmallFontSize, mediumAndWideFontSize) => ({
2569
2920
  baseAndSmall: {
2570
2921
  fontSize: `${baseAndSmallFontSize}px`,
2571
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2922
+ lineHeight: `${calcLineHeight(baseAndSmallFontSize, lineHeightMultiplier)}px`
2572
2923
  },
2573
2924
  mediumAndWide: {
2574
2925
  fontSize: `${mediumAndWideFontSize}px`,
2575
- lineHeight: `${calcLineHeight(lineHeightMultiplier, baseAndSmallFontSize)}px`
2926
+ lineHeight: `${calcLineHeight(mediumAndWideFontSize, lineHeightMultiplier)}px`
2576
2927
  }
2577
2928
  });
2578
-
2579
2929
  const typographyLateOceanTheme = {
2580
2930
  colors: {
2581
2931
  black: lateOceanColorPalette.black1000,
@@ -2657,7 +3007,7 @@ const breakpoints = {
2657
3007
  wideBreakpoint: 'max-width: 1279px'
2658
3008
  }
2659
3009
  }; // eslint-disable-next-line unicorn/expiring-todo-comments
2660
- // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
3010
+ // TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
2661
3011
 
2662
3012
  const theme = {
2663
3013
  spacing: 4,
@@ -2676,7 +3026,8 @@ const theme = {
2676
3026
  fullScreenModal: fullScreenModalLateOceanTheme,
2677
3027
  iconButton,
2678
3028
  listItem: listItemLateOceanTheme,
2679
- tooltip
3029
+ tooltip,
3030
+ skeleton: skeletonTheme
2680
3031
  };
2681
3032
 
2682
3033
  function Title({
@@ -3040,14 +3391,19 @@ function TypographyEmoji({
3040
3391
 
3041
3392
  const TypographyLinkWebWrapper = withTheme( /*#__PURE__*/react$1.styled("span")({
3042
3393
  name: "TypographyLinkWebWrapper",
3043
- class: "tcwz3nt"
3394
+ class: "tcwz3nt",
3395
+ vars: {
3396
+ "tcwz3nt-0": [({
3397
+ $hasNoUnderline
3398
+ }) => $hasNoUnderline ? 'underline' : 'none']
3399
+ }
3044
3400
  }));
3045
3401
  const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
3046
3402
  displayName: "TypographyLink__StyledLink",
3047
3403
  componentId: "kitt-universal__sc-1o1zy30-0"
3048
3404
  })(["text-decoration:", ";", ";", ";"], ({
3049
- $noUnderline
3050
- }) => $noUnderline ? 'none' : 'underline', ({
3405
+ $hasNoUnderline
3406
+ }) => $hasNoUnderline ? 'none' : 'underline', ({
3051
3407
  $disabled
3052
3408
  }) => {
3053
3409
  if (reactNative.Platform.OS !== 'web') return undefined;
@@ -3076,10 +3432,10 @@ function TypographyLink({
3076
3432
  accessibilityRole: "none",
3077
3433
  children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
3078
3434
  as: TypographyLinkWebWrapper,
3079
- "data-nounderline": noUnderline ? true : undefined,
3435
+ $hasNoUnderline: noUnderline,
3080
3436
  children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
3081
3437
  $disabled: disabled,
3082
- $noUnderline: noUnderline,
3438
+ $hasNoUnderline: noUnderline,
3083
3439
  href: href,
3084
3440
  hrefAttrs: hrefAttrs,
3085
3441
  accessibilityRole: "link",
@@ -3094,23 +3450,35 @@ function TypographyLink({
3094
3450
  });
3095
3451
  }
3096
3452
 
3097
- function matchWindowSize(currentWidth, {
3453
+ function matchWindowSize({
3454
+ width,
3455
+ height
3456
+ }, {
3098
3457
  minWidth,
3099
- maxWidth
3458
+ maxWidth,
3459
+ minHeight,
3460
+ maxHeight
3100
3461
  }) {
3101
- return currentWidth >= minWidth && (!maxWidth || currentWidth <= maxWidth);
3462
+ const hasWidthMatched = width ? (!minWidth || width >= minWidth) && (!maxWidth || width <= maxWidth) : true;
3463
+ const hasHeightMatched = height ? (!minHeight || height >= minHeight) && (!maxHeight || height <= maxHeight) : true;
3464
+ return hasWidthMatched && hasHeightMatched;
3102
3465
  }
3103
3466
  function useMatchWindowSize(options) {
3104
3467
  const {
3105
- width
3468
+ width,
3469
+ height
3106
3470
  } = reactNative.useWindowDimensions();
3107
- return matchWindowSize(width, options);
3471
+ return matchWindowSize({
3472
+ width,
3473
+ height
3474
+ }, options);
3108
3475
  }
3109
3476
 
3110
- function createWindowSizeHelper(currentWidth) {
3477
+ // eslint-disable-next-line no-restricted-imports
3478
+ function createWindowSizeHelper(dimensions) {
3111
3479
  return {
3112
- matchWindowSize: options => matchWindowSize(currentWidth, options),
3113
- ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(currentWidth, options) ? valueIfTrue : valueIfFalse,
3480
+ matchWindowSize: options => matchWindowSize(dimensions, options),
3481
+ ifWindowSizeMatches: (options, valueIfTrue, valueIfFalse) => matchWindowSize(dimensions, options) ? valueIfTrue : valueIfFalse,
3114
3482
  mapWindowWidth: (...widthList) => {
3115
3483
  if ((process.env.NODE_ENV !== "production")) {
3116
3484
  widthList.slice(1).forEach(([minWidth], index) => {
@@ -3122,7 +3490,7 @@ function createWindowSizeHelper(currentWidth) {
3122
3490
  });
3123
3491
  }
3124
3492
 
3125
- const found = widthList.find(([minWidth, value]) => matchWindowSize(currentWidth, {
3493
+ const found = widthList.find(([minWidth, value]) => matchWindowSize(dimensions, {
3126
3494
  minWidth: Number(minWidth)
3127
3495
  }));
3128
3496
  if (!found) return null;
@@ -3132,18 +3500,23 @@ function createWindowSizeHelper(currentWidth) {
3132
3500
  }
3133
3501
 
3134
3502
  function useKittTheme() {
3135
- const {
3136
- width
3137
- } = reactNative.useWindowDimensions();
3503
+ const dimensions = reactNative.useWindowDimensions();
3138
3504
  return react.useMemo(() => {
3139
3505
  return {
3140
3506
  kitt: theme,
3141
- responsive: createWindowSizeHelper(width),
3507
+ responsive: createWindowSizeHelper(dimensions),
3142
3508
  breakpoints
3143
3509
  };
3144
- }, [width]);
3510
+ }, [dimensions]);
3145
3511
  }
3146
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
+
3147
3520
  function KittThemeProvider({
3148
3521
  children
3149
3522
  }) {
@@ -3204,6 +3577,7 @@ exports.Modal = Modal;
3204
3577
  exports.Notification = Notification;
3205
3578
  exports.Radio = Radio;
3206
3579
  exports.Section = DeprecatedSection;
3580
+ exports.Skeleton = Skeleton;
3207
3581
  exports.Story = Story;
3208
3582
  exports.StoryBlock = StoryBlock;
3209
3583
  exports.StoryContainer = StoryContainer;
@@ -3211,6 +3585,7 @@ exports.StoryDecorator = StoryDecorator;
3211
3585
  exports.StoryGrid = StoryGrid;
3212
3586
  exports.StorySection = StorySection;
3213
3587
  exports.StoryTitle = StoryTitle;
3588
+ exports.StyleWebWrapper = StyleWebWrapper;
3214
3589
  exports.Tag = Tag;
3215
3590
  exports.TextArea = TextArea;
3216
3591
  exports.TimePicker = TimePicker;
@@ -3220,6 +3595,7 @@ exports.TypographyEmoji = TypographyEmoji;
3220
3595
  exports.TypographyIcon = TypographyIcon;
3221
3596
  exports.TypographyLink = TypographyLink;
3222
3597
  exports.createWindowSizeHelper = createWindowSizeHelper;
3598
+ exports.hex2rgba = hex2rgba;
3223
3599
  exports.matchWindowSize = matchWindowSize;
3224
3600
  exports.styledTextInputMixin = styledTextInputMixin;
3225
3601
  exports.theme = theme;