@ornikar/kitt-universal 3.0.0-beta.1 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) 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/themes/default.d.ts +3 -43
  21. package/dist/definitions/themes/default.d.ts.map +1 -1
  22. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts +42 -35
  23. package/dist/definitions/themes/late-ocean/buttonLateOceanTheme.d.ts.map +1 -1
  24. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts +2 -0
  25. package/dist/definitions/themes/late-ocean/colorsLateOceanTheme.d.ts.map +1 -1
  26. package/dist/definitions/typography/Typography.d.ts +11 -11
  27. package/dist/definitions/typography/TypographyIcon.d.ts +2 -2
  28. package/dist/definitions/typography/TypographyIcon.d.ts.map +1 -1
  29. package/dist/definitions/typography/TypographyLink.d.ts.map +1 -1
  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 +402 -223
  33. package/dist/index-browser-all.es.android.js.map +1 -1
  34. package/dist/index-browser-all.es.css +1 -1
  35. package/dist/index-browser-all.es.ios.js +402 -223
  36. package/dist/index-browser-all.es.ios.js.map +1 -1
  37. package/dist/index-browser-all.es.js +406 -227
  38. package/dist/index-browser-all.es.js.map +1 -1
  39. package/dist/index-browser-all.es.web.js +399 -214
  40. package/dist/index-browser-all.es.web.js.map +1 -1
  41. package/dist/index-node-14.17.cjs.css +1 -1
  42. package/dist/index-node-14.17.cjs.js +428 -196
  43. package/dist/index-node-14.17.cjs.js.map +1 -1
  44. package/dist/index-node-14.17.cjs.web.css +5 -0
  45. package/dist/index-node-14.17.cjs.web.js +3173 -0
  46. package/dist/index-node-14.17.cjs.web.js.map +1 -0
  47. package/dist/styles.css +2 -1
  48. package/dist/tsbuildinfo +1 -1
  49. package/package.json +9 -8
  50. package/CHANGELOG.md +0 -131
  51. package/dist/definitions/Button/ButtonPressable.d.ts +0 -13
  52. package/dist/definitions/Button/ButtonPressable.d.ts.map +0 -1
@@ -7,10 +7,10 @@ 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
15
  const DateTimePicker = require('@react-native-community/datetimepicker');
16
16
  const reactIntl = require('react-intl');
@@ -56,7 +56,7 @@ function SpinningIcon({
56
56
  });
57
57
  }
58
58
 
59
- const IconContainer$2 = /*#__PURE__*/styled__default.View.withConfig({
59
+ const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
60
60
  displayName: "Icon__IconContainer",
61
61
  componentId: "kitt-universal__sc-usm0ol-0"
62
62
  })(["color:", ";width:", "px;height:", "px;align-self:", ";"], ({
@@ -78,7 +78,7 @@ function Icon({
78
78
  const clonedIcon = /*#__PURE__*/react.cloneElement(icon, {
79
79
  color
80
80
  });
81
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer$2, {
81
+ return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
82
82
  align: align,
83
83
  size: size,
84
84
  color: color,
@@ -363,79 +363,232 @@ function Avatar({
363
363
  });
364
364
  }
365
365
 
366
- function TypographyIconInheritColor(props) {
367
- const color = useTypographyColor();
366
+ const StyledPressable = /*#__PURE__*/styled__default.Pressable.withConfig({
367
+ displayName: "AnimatedButtonPressable__StyledPressable",
368
+ componentId: "kitt-universal__sc-175vyve-0"
369
+ })(["", ""], ({
370
+ $isStretch
371
+ }) => {
372
+ if ($isStretch) return undefined;
373
+ return 'align-self: flex-start;';
374
+ });
375
+ const StyledAnimatedView = /*#__PURE__*/styled__default(Animated__default.View).withConfig({
376
+ displayName: "AnimatedButtonPressable__StyledAnimatedView",
377
+ componentId: "kitt-universal__sc-175vyve-1"
378
+ })(["border-radius:", ";"], ({
379
+ theme
380
+ }) => theme.kitt.button.borderRadius);
381
+ const AnimatedButtonPressable = /*#__PURE__*/react.forwardRef(({
382
+ children,
383
+ disabled,
384
+ accessibilityRole,
385
+ $type,
386
+ $isStretch,
387
+ href,
388
+ hrefAttrs,
389
+ testID,
390
+ onPress
391
+ }, ref) => {
368
392
  const theme = /*#__PURE__*/styled.useTheme();
369
- return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
370
- color: theme.kitt.typography.colors[color]
393
+ const pressed = Animated.useSharedValue(0);
394
+ const color = Animated.useSharedValue(0);
395
+ const {
396
+ backgroundColor,
397
+ pressedBackgroundColor
398
+ } = theme.kitt.button[$type];
399
+ const {
400
+ scale
401
+ } = theme.kitt.button;
402
+ const scaleStyles = Animated.useAnimatedStyle(function () {
403
+ const _f = function () {
404
+ return {
405
+ backgroundColor: Animated.interpolateColor(color.value, [0, 1], [backgroundColor, pressedBackgroundColor]),
406
+ transform: [{
407
+ scale: Animated.withSpring(pressed.value ? scale.base.active : scale.base.default)
408
+ }]
409
+ };
410
+ };
411
+
412
+ _f._closure = {
413
+ interpolateColor: Animated.interpolateColor,
414
+ color,
415
+ backgroundColor,
416
+ pressedBackgroundColor,
417
+ withSpring: Animated.withSpring,
418
+ pressed,
419
+ scale: {
420
+ base: {
421
+ active: scale.base.active,
422
+ default: scale.base.default
423
+ }
424
+ }
425
+ };
426
+ _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)}]};}}";
427
+ _f.__workletHash = 5368461229978;
428
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Button/AnimatedButtonPressable.tsx (53:41)";
429
+ _f.__optimalization = 2;
430
+
431
+ global.__reanimatedWorkletInit(_f);
432
+
433
+ return _f;
434
+ }());
435
+
436
+ const handlePressInOut = pressIn => {
437
+ color.value = Animated.withSpring(pressIn ? 1 : 0);
438
+ pressed.value = pressIn ? 1 : 0;
439
+ };
440
+
441
+ return /*#__PURE__*/jsxRuntime.jsx(StyledPressable, {
442
+ ref: ref,
443
+ disabled: disabled,
444
+ accessibilityRole: accessibilityRole,
445
+ testID: testID,
446
+ href: href,
447
+ hrefAttrs: hrefAttrs,
448
+ $isStretch: $isStretch,
449
+ $type: $type,
450
+ onPress: onPress,
451
+ onPressIn: () => {
452
+ handlePressInOut(true);
453
+ },
454
+ onPressOut: () => {
455
+ handlePressInOut(false);
456
+ },
457
+ children: /*#__PURE__*/jsxRuntime.jsx(StyledAnimatedView, {
458
+ style: disabled ? [{
459
+ transform: [{
460
+ scale: 1
461
+ }]
462
+ }] : [scaleStyles],
463
+ children: children
464
+ })
371
465
  });
372
- }
466
+ });
467
+
468
+ const BaseStyledButtonPressable = /*#__PURE__*/styled__default.View.withConfig({
469
+ displayName: "BaseStyledButtonPressable",
470
+ componentId: "kitt-universal__sc-4k8lse-0"
471
+ })(["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:", ";"], ({
472
+ theme
473
+ }) => theme.kitt.button.minWidth, ({
474
+ theme,
475
+ $isStretch
476
+ }) => $isStretch ? '100%' : theme.kitt.button.maxWidth, ({
477
+ $isStretch
478
+ }) => $isStretch ? '100%' : 'auto', ({
479
+ theme
480
+ }) => theme.kitt.button.minHeight, ({
481
+ theme
482
+ }) => theme.kitt.button.borderRadius, ({
483
+ theme,
484
+ $isDisabled,
485
+ $type
486
+ }) => {
487
+ if ($isDisabled) return theme.kitt.button.disabled.backgroundColor;
488
+ if (reactNative.Platform.OS !== 'web') return 'transparent';
489
+ return theme.kitt.button[$type].backgroundColor;
490
+ }, ({
491
+ theme,
492
+ $isLarge,
493
+ $isDisabled
494
+ }) => {
495
+ const {
496
+ large,
497
+ default: defaultPadding,
498
+ disabled: disabledPadding
499
+ } = theme.kitt.button.contentPadding;
500
+ if ($isLarge) return large;
501
+ if ($isDisabled) return disabledPadding;
502
+ return defaultPadding;
503
+ });
373
504
 
374
505
  function TypographyIconSpecifiedColor({
375
506
  color,
376
- ...otherProps
507
+ ...props
377
508
  }) {
378
509
  const theme = /*#__PURE__*/styled.useTheme();
379
- return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...otherProps,
380
- color: theme.kitt.typography.colors[color]
510
+ return /*#__PURE__*/jsxRuntime.jsx(Icon, { ...props,
511
+ color: color === 'inherit' ? 'inherit' : theme.kitt.typography.colors[color]
512
+ });
513
+ }
514
+
515
+ function TypographyIconInheritColor(props) {
516
+ const color = useTypographyColor();
517
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
518
+ color: color,
519
+ ...props
381
520
  });
382
521
  }
383
522
 
384
523
  function TypographyIcon({
385
524
  color,
386
- ...otherProps
525
+ ...props
387
526
  }) {
388
527
  if (color) {
389
528
  return /*#__PURE__*/jsxRuntime.jsx(TypographyIconSpecifiedColor, {
390
529
  color: color,
391
- ...otherProps
530
+ ...props
392
531
  });
393
532
  }
394
533
 
395
- return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...otherProps
534
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIconInheritColor, { ...props
396
535
  });
397
536
  }
398
537
 
399
- const getTextColorByType = (type, isPressed, disabled) => {
400
- if (disabled) return 'black-light';
538
+ function isSubtle(type) {
539
+ return type.startsWith('subtle');
540
+ }
401
541
 
542
+ const getTextColorByType = type => {
402
543
  switch (type) {
403
544
  case 'primary':
404
545
  return 'white';
405
546
 
547
+ case 'white':
548
+ return 'white';
549
+
406
550
  case 'subtle':
407
- return isPressed ? 'primary-light' : 'primary';
551
+ return 'primary';
408
552
 
409
553
  case 'subtle-dark':
410
- return isPressed ? 'black-light' : 'black';
554
+ return 'black';
411
555
 
412
- case 'secondary':
413
556
  default:
414
557
  return 'black';
415
558
  }
416
559
  };
417
560
 
418
- const ButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
419
- displayName: "ButtonContent__ButtonText",
561
+ const StyledButtonText = /*#__PURE__*/styled__default(Typography.Text).withConfig({
562
+ displayName: "ButtonContent__StyledButtonText",
420
563
  componentId: "kitt-universal__sc-dnyw3n-0"
421
- })(["text-align:center;"]);
422
- const Content$1 = /*#__PURE__*/styled__default.View.withConfig({
423
- displayName: "ButtonContent__Content",
564
+ })(["text-align:center;", " ", ""], () => {
565
+ // Make the multilines case work properly on native
566
+ // Breaks the web implem
567
+ if (reactNative.Platform.OS === 'web') return undefined;
568
+ return `
569
+ flex-shrink: 1;
570
+ `;
571
+ }, ({
572
+ $type,
573
+ $isDisabled
574
+ }) => {
575
+ /* For subltes button, color changes when hovered.
576
+ * We don't want to use a mouse event handler with a react state to handle it
577
+ * For this precise case, we've decided to work outside the typography logic
578
+ */
579
+ if (reactNative.Platform.OS !== 'web' || $isDisabled || !isSubtle($type)) return undefined;
580
+ return 'color: inherit';
581
+ });
582
+ const StyledIconContainer = /*#__PURE__*/styled__default.View.withConfig({
583
+ displayName: "ButtonContent__StyledIconContainer",
424
584
  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
585
  })(["", ""], ({
433
586
  theme,
434
- iconPosition
587
+ $iconPosition
435
588
  }) => {
436
- const value = theme.kitt.spacing * 3;
589
+ const value = theme.kitt.spacing * 2;
437
590
 
438
- if (iconPosition === 'left') {
591
+ if ($iconPosition === 'left') {
439
592
  return `margin: 0 ${value}px 0 0;`;
440
593
  }
441
594
 
@@ -444,150 +597,176 @@ const IconContainer$1 = /*#__PURE__*/styled__default.View.withConfig({
444
597
 
445
598
  function ButtonIcon({
446
599
  icon,
447
- spin,
448
600
  color,
449
- size,
601
+ spin,
450
602
  iconPosition,
451
603
  testID
452
604
  }) {
453
- return /*#__PURE__*/jsxRuntime.jsx(IconContainer$1, {
454
- iconPosition: iconPosition,
605
+ return /*#__PURE__*/jsxRuntime.jsx(StyledIconContainer, {
606
+ $iconPosition: iconPosition,
455
607
  children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
456
608
  icon: icon,
457
609
  spin: spin,
458
- color: color,
459
- size: size,
460
- testID: testID
610
+ testID: testID,
611
+ color: color
461
612
  })
462
613
  });
463
614
  }
464
615
 
465
- function ButtonContent({
616
+ const StyledChildrenWithIcon = /*#__PURE__*/styled__default.View.withConfig({
617
+ displayName: "ButtonContent__StyledChildrenWithIcon",
618
+ componentId: "kitt-universal__sc-dnyw3n-2"
619
+ })(["align-items:center;justify-content:center;flex-direction:row;"]);
620
+ function ButtonContentChildren({
466
621
  type,
467
- isPressed,
468
- stretch,
469
622
  icon,
470
623
  iconPosition,
471
624
  iconSpin,
472
- disabled,
625
+ isDisabled,
626
+ color,
473
627
  children
474
628
  }) {
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
629
  if ((process.env.NODE_ENV !== "production")) {
484
630
  if (!(children || icon)) {
485
631
  throw new Error('kitt(Button): You should provide at least a children or a icon');
486
632
  }
487
633
  }
488
634
 
635
+ const isWebSubtle = isSubtle(type) && reactNative.Platform.OS === 'web' && !isDisabled;
636
+
489
637
  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
- })
638
+ return /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
639
+ spin: iconSpin // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
640
+ ,
641
+ icon: icon,
642
+ color: isWebSubtle ? 'inherit' : color
496
643
  });
497
644
  }
498
645
 
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, {
646
+ const buttonIconSharedProps = {
647
+ type,
648
+ spin: iconSpin,
649
+ iconPosition,
650
+ color: isWebSubtle ? 'inherit' : color
651
+ };
652
+ return /*#__PURE__*/jsxRuntime.jsxs(StyledChildrenWithIcon, {
653
+ children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
654
+ testID: "button-left-icon",
655
+ icon: icon
656
+ }) : null, /*#__PURE__*/jsxRuntime.jsx(StyledButtonText, {
506
657
  base: "body",
507
- color: color,
508
658
  variant: "bold",
659
+ $type: type,
660
+ $isDisabled: isDisabled // set to color: inherit via styled components
661
+ ,
662
+ color: isWebSubtle ? undefined : color,
509
663
  children: children
510
- }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...sharedIconProps,
511
- icon: icon,
512
- iconPosition: iconPosition
664
+ }), icon && iconPosition === 'right' ? /*#__PURE__*/jsxRuntime.jsx(ButtonIcon, { ...buttonIconSharedProps,
665
+ icon: icon
513
666
  }) : null]
514
667
  });
515
668
  }
669
+ const ButtonContentContainer = /*#__PURE__*/styled__default.View.withConfig({
670
+ displayName: "ButtonContent__ButtonContentContainer",
671
+ componentId: "kitt-universal__sc-dnyw3n-3"
672
+ })(["line-height:16px;", " ", ";"], ({
673
+ $isStretch,
674
+ $isIconOnly
675
+ }) => {
676
+ // Make the multilines case work properly on web
677
+ // Breaks the native implem
678
+ if (reactNative.Platform.OS !== 'web') return undefined;
679
+ return `
680
+ flex: ${$isStretch || $isIconOnly ? 1 : 0} 1 auto;
681
+ `;
682
+ }, ({
683
+ $isSubtle
684
+ }) => {
685
+ if (reactNative.Platform.OS !== 'web' || !$isSubtle) return undefined; // Needed for subtle type
516
686
 
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', ({
687
+ return 'color: inherit';
688
+ });
689
+ function ButtonContent({
690
+ type,
691
+ isDisabled,
692
+ $isStretch,
693
+ icon,
694
+ children,
695
+ ...props
696
+ }) {
697
+ const color = isDisabled ? 'black-light' : getTextColorByType(type);
698
+ return /*#__PURE__*/jsxRuntime.jsx(ButtonContentContainer, {
699
+ $isSubtle: isSubtle(type),
700
+ $isStretch: $isStretch,
701
+ $isIconOnly: Boolean(!children && icon),
702
+ children: /*#__PURE__*/jsxRuntime.jsx(ButtonContentChildren, {
703
+ icon: icon,
704
+ type: type,
705
+ isDisabled: isDisabled,
706
+ color: color,
707
+ ...props,
708
+ children: children
709
+ })
710
+ });
711
+ }
712
+
713
+ const StyledDisabled = /*#__PURE__*/styled__default.View.withConfig({
714
+ displayName: "StyledDisabled",
715
+ componentId: "kitt-universal__sc-16irf7q-0"
716
+ })(["position:absolute;top:0;left:0;right:0;bottom:0;border:", ";border-radius:", ";"], ({
528
717
  theme
529
- }) => theme.kitt.button.minHeight, ({
530
- theme,
531
- isPressed,
532
- disabled,
533
- type
534
718
  }) => {
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;
719
+ const {
720
+ borderWidth,
721
+ disabled
722
+ } = theme.kitt.button;
723
+ return `${borderWidth.disabled} solid ${disabled.borderColor}`;
540
724
  }, ({
541
725
  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);
726
+ }) => theme.kitt.button.borderRadius);
551
727
 
552
- function Button({
728
+ const Button = /*#__PURE__*/react.forwardRef(({
553
729
  children,
554
- type = 'secondary',
730
+ type = 'default',
731
+ disabled,
732
+ stretch,
733
+ large,
555
734
  icon,
556
735
  iconPosition = 'left',
557
736
  iconSpin,
558
- stretch,
559
- disabled,
560
737
  testID,
561
738
  href,
562
739
  hrefAttrs,
740
+ accessibilityRole = 'button',
563
741
  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",
742
+ }, ref) => {
743
+ return /*#__PURE__*/jsxRuntime.jsx(AnimatedButtonPressable, {
744
+ ref: ref,
745
+ accessibilityRole: accessibilityRole,
577
746
  testID: testID,
578
747
  href: href,
579
748
  hrefAttrs: hrefAttrs,
749
+ disabled: disabled,
750
+ $isStretch: stretch,
751
+ $type: type,
580
752
  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
753
+ children: /*#__PURE__*/jsxRuntime.jsxs(BaseStyledButtonPressable, {
754
+ $type: type,
755
+ $isStretch: stretch,
756
+ $isLarge: large,
757
+ $isDisabled: disabled,
758
+ children: [/*#__PURE__*/jsxRuntime.jsx(ButtonContent, {
759
+ type: type,
760
+ $isStretch: stretch,
761
+ isDisabled: disabled,
762
+ icon: icon,
763
+ iconPosition: iconPosition,
764
+ iconSpin: iconSpin,
765
+ children: children
766
+ }), reactNative.Platform.OS !== 'web' && disabled ? /*#__PURE__*/jsxRuntime.jsx(StyledDisabled, {}) : null]
588
767
  })
589
768
  });
590
- }
769
+ });
591
770
 
592
771
  const Container$6 = /*#__PURE__*/styled__default.View.withConfig({
593
772
  displayName: "Card__Container",
@@ -630,7 +809,7 @@ function Emoji({
630
809
  }) {
631
810
  const [emojiData] = react.useMemo(() => twemojiParser.parse(emoji, {
632
811
  // on native plaforms, you can't display svg as Image
633
- assetType: 'svg'
812
+ assetType: reactNative.Platform.OS === 'web' ? 'svg' : 'png'
634
813
  }), [emoji]);
635
814
  if (!emojiData) return null;
636
815
  return /*#__PURE__*/jsxRuntime.jsx(StyledEmoji, {
@@ -787,11 +966,11 @@ const Input = /*#__PURE__*/styled__default(reactNative.TextInput).withConfig({
787
966
  })(["", " padding:", ";line-height:", ";min-height:", "px;"], styledTextInputMixin, ({
788
967
  theme,
789
968
  multiline
790
- }) => !multiline && "web" === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding, ({
969
+ }) => !multiline && reactNative.Platform.OS === 'ios' ? theme.kitt.forms.input.paddingSingleLineIOS : theme.kitt.forms.input.padding, ({
791
970
  theme,
792
971
  multiline
793
972
  }) => {
794
- if (!multiline && "web" === 'ios') return 0;
973
+ if (!multiline && reactNative.Platform.OS === 'ios') return 0;
795
974
  const typeConfigKey = getTypographyTypeConfigKey(theme);
796
975
  return theme.kitt.typography.types.bodies.configs.body[typeConfigKey].lineHeight;
797
976
  }, ({
@@ -912,10 +1091,10 @@ function Label({
912
1091
  }) {
913
1092
  return /*#__PURE__*/jsxRuntime.jsx(Typography.Text, {
914
1093
  base: "body",
915
- children: /*#__PURE__*/jsxRuntime.jsx("label", {
1094
+ children: reactNative.Platform.OS === 'web' ? /*#__PURE__*/jsxRuntime.jsx("label", {
916
1095
  htmlFor: htmlFor,
917
1096
  children: children
918
- })
1097
+ }) : children
919
1098
  });
920
1099
  }
921
1100
 
@@ -1129,7 +1308,7 @@ function FullScreenModalHeader({
1129
1308
  };
1130
1309
 
1131
1310
  return /*#__PURE__*/jsxRuntime.jsxs(Header, {
1132
- insetTop: top,
1311
+ insetTop: reactNative.Platform.OS === 'ios' ? undefined : top,
1133
1312
  children: [left ? /*#__PURE__*/jsxRuntime.jsx(SideContainer, {
1134
1313
  onLayout: e => handleLayoutChange(e, 'left'),
1135
1314
  children: left
@@ -1167,6 +1346,7 @@ function StyleWebWrapper({
1167
1346
  children,
1168
1347
  ...props
1169
1348
  }) {
1349
+ if (reactNative.Platform.OS !== 'web') return children;
1170
1350
  // as or default to div. If as is undefined, T is div but typescript is not sure
1171
1351
  return /*#__PURE__*/jsxRuntime.jsx(as || 'div', { ...props,
1172
1352
  children: children
@@ -1183,8 +1363,7 @@ function StyleWebWrapper({
1183
1363
  // return (<WrappedComponent theme={theme} {...(props as any)} />) as any;
1184
1364
  // };
1185
1365
  // }
1186
- function withTheme( // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
1187
- WrappedComponent) {
1366
+ function withTheme(WrappedComponent) {
1188
1367
  return function (props) {
1189
1368
  const theme = /*#__PURE__*/styled.useTheme();
1190
1369
  return /*#__PURE__*/jsxRuntime.jsx(WrappedComponent, {
@@ -1234,6 +1413,11 @@ const StyledPressableIconButton = /*#__PURE__*/styled__default.Pressable.withCon
1234
1413
  const {
1235
1414
  iconButton
1236
1415
  } = theme.kitt;
1416
+
1417
+ if (reactNative.Platform.OS !== 'web') {
1418
+ return undefined;
1419
+ }
1420
+
1237
1421
  const {
1238
1422
  transition
1239
1423
  } = iconButton;
@@ -1306,7 +1490,7 @@ function PressableAnimatedContainer({
1306
1490
  };
1307
1491
  _f.asString = "function _f(){const{withSpring,pressed}=jsThis._closure;{return{opacity:withSpring(pressed.value?1:0)};}}";
1308
1492
  _f.__workletHash = 10645190329247;
1309
- _f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
1493
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (54:41)";
1310
1494
  _f.__optimalization = 2;
1311
1495
 
1312
1496
  global.__reanimatedWorkletInit(_f);
@@ -1340,7 +1524,7 @@ function PressableAnimatedContainer({
1340
1524
  };
1341
1525
  _f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{transform:[{scale:withSpring(pressed.value?theme.kitt.iconButton.scale.base.active:theme.kitt.iconButton.scale.base.default)}]};}}";
1342
1526
  _f.__workletHash = 13861998831411;
1343
- _f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
1527
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/IconButton/PressableAnimatedContainer.tsx (60:39)";
1344
1528
  _f.__optimalization = 2;
1345
1529
 
1346
1530
  global.__reanimatedWorkletInit(_f);
@@ -1546,6 +1730,7 @@ ListItem.SideContent = ListItemSideContent;
1546
1730
  ListItem.SideContainer = ListItemSideContainer;
1547
1731
 
1548
1732
  function getActivityIndicatorSize(size) {
1733
+ if (reactNative.Platform.OS === 'android') return size;
1549
1734
  return size < 36 ? 'small' : 'large';
1550
1735
  }
1551
1736
 
@@ -2172,7 +2357,13 @@ function StoryGridCol({
2172
2357
  children,
2173
2358
  platform = 'all'
2174
2359
  }) {
2175
- if (platform === 'native') {
2360
+ const isNative = reactNative.Platform.OS === 'ios' || reactNative.Platform.OS === 'android';
2361
+
2362
+ if (reactNative.Platform.OS === 'web' && platform === 'native') {
2363
+ return null;
2364
+ }
2365
+
2366
+ if (isNative && platform === 'web') {
2176
2367
  return null;
2177
2368
  }
2178
2369
 
@@ -2283,47 +2474,98 @@ const avatarLateOceanTheme = {
2283
2474
  }
2284
2475
  };
2285
2476
 
2477
+ const colorsLateOceanTheme = {
2478
+ primary: lateOceanColorPalette.lateOcean,
2479
+ primaryLight: lateOceanColorPalette.lateOceanLight1,
2480
+ accent: lateOceanColorPalette.warmEmbrace,
2481
+ accentLight: lateOceanColorPalette.warmEmbraceLight1,
2482
+ success: lateOceanColorPalette.viride,
2483
+ correct: lateOceanColorPalette.viride,
2484
+ danger: lateOceanColorPalette.englishVermillon,
2485
+ separator: lateOceanColorPalette.black100,
2486
+ hover: lateOceanColorPalette.black100,
2487
+ black: lateOceanColorPalette.black1000,
2488
+ uiBackground: lateOceanColorPalette.black25,
2489
+ uiBackgroundLight: lateOceanColorPalette.white,
2490
+ transparent: lateOceanColorPalette.transparent,
2491
+ disabled: lateOceanColorPalette.black50,
2492
+ overlay: {
2493
+ dark: 'rgba(41, 48, 51, 0.25)',
2494
+ light: 'rgba(255, 255, 255, 0.90)',
2495
+ fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2496
+ }
2497
+ };
2498
+
2286
2499
  const buttonLateOceanTheme = {
2287
2500
  borderRadius: '30px',
2288
- borderWidth: '2px',
2289
- minHeight: '42px',
2501
+ borderWidth: {
2502
+ disabled: '2px',
2503
+ focus: '3px'
2504
+ },
2505
+ minHeight: '40px',
2290
2506
  minWidth: '40px',
2291
2507
  maxWidth: '335px',
2292
- iconSize: 18,
2508
+ scale: {
2509
+ base: {
2510
+ default: 1,
2511
+ hover: 0.95,
2512
+ active: 0.95
2513
+ },
2514
+ medium: {
2515
+ hover: 1.05
2516
+ }
2517
+ },
2293
2518
  contentPadding: {
2294
- default: '8px 16px'
2519
+ default: '8px 16px 7px',
2520
+ large: '12px 24px 11px',
2521
+ disabled: '6px 14px 5px'
2295
2522
  },
2296
- primary: {
2297
- backgroundColor: lateOceanColorPalette.lateOcean,
2298
- disabledBackgroundColor: lateOceanColorPalette.black50,
2299
- pressedBackgroundColor: lateOceanColorPalette.lateOceanLight1,
2300
- disabledBorderColor: lateOceanColorPalette.black100
2523
+ transition: {
2524
+ duration: '200ms',
2525
+ timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
2301
2526
  },
2302
- secondary: {
2527
+ default: {
2303
2528
  backgroundColor: 'rgba(0, 0, 0, 0.05)',
2304
- disabledBackgroundColor: lateOceanColorPalette.black50,
2305
2529
  pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2306
- disabledBorderColor: lateOceanColorPalette.black100
2530
+ hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
2531
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)'
2307
2532
  },
2308
- subtle: {
2309
- backgroundColor: lateOceanColorPalette.transparent,
2310
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2311
- pressedBackgroundColor: lateOceanColorPalette.transparent,
2312
- disabledBorderColor: lateOceanColorPalette.transparent
2313
- },
2314
- 'subtle-dark': {
2315
- backgroundColor: lateOceanColorPalette.transparent,
2316
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2317
- pressedBackgroundColor: lateOceanColorPalette.transparent,
2318
- disabledBorderColor: lateOceanColorPalette.transparent
2533
+ primary: {
2534
+ backgroundColor: colorsLateOceanTheme.primary,
2535
+ pressedBackgroundColor: colorsLateOceanTheme.primaryLight,
2536
+ hoverBackgroundColor: colorsLateOceanTheme.primaryLight,
2537
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)'
2319
2538
  },
2320
2539
  white: {
2321
2540
  backgroundColor: 'rgba(255, 255, 255, 0.05)',
2322
- disabledBackgroundColor: lateOceanColorPalette.transparent,
2323
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2324
2541
  pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2325
- focusBorderColor: 'rgba(255, 255, 255, 0.1)',
2326
- disabledBorderColor: lateOceanColorPalette.transparent
2542
+ hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
2543
+ focusBorderColor: 'rgba(255, 255, 255, 0.1)'
2544
+ },
2545
+ subtle: {
2546
+ backgroundColor: colorsLateOceanTheme.transparent,
2547
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2548
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2549
+ focusBorderColor: 'rgba(76, 52, 224, 0.2)',
2550
+ color: colorsLateOceanTheme.primary,
2551
+ hoverColor: 'rgba(76, 52, 224, 0.8)',
2552
+ activeColor: 'rgba(76, 52, 224, 0.8)'
2553
+ },
2554
+ 'subtle-dark': {
2555
+ backgroundColor: colorsLateOceanTheme.transparent,
2556
+ pressedBackgroundColor: colorsLateOceanTheme.transparent,
2557
+ hoverBackgroundColor: colorsLateOceanTheme.transparent,
2558
+ focusBorderColor: 'rgba(0, 0, 0, 0.1)',
2559
+ color: colorsLateOceanTheme.black,
2560
+ hoverColor: 'rgba(0, 0, 0, 0.8)',
2561
+ activeColor: 'rgba(0, 0, 0, 0.8)'
2562
+ },
2563
+ disabled: {
2564
+ backgroundColor: colorsLateOceanTheme.disabled,
2565
+ pressedBackgroundColor: colorsLateOceanTheme.disabled,
2566
+ hoverBackgroundColor: colorsLateOceanTheme.disabled,
2567
+ focusBorderColor: lateOceanColorPalette.black100,
2568
+ borderColor: lateOceanColorPalette.black100
2327
2569
  }
2328
2570
  };
2329
2571
 
@@ -2345,26 +2587,6 @@ const cardLateOceanTheme = {
2345
2587
  }
2346
2588
  };
2347
2589
 
2348
- const colorsLateOceanTheme = {
2349
- primary: lateOceanColorPalette.lateOcean,
2350
- primaryLight: lateOceanColorPalette.lateOceanLight1,
2351
- accent: lateOceanColorPalette.warmEmbrace,
2352
- accentLight: lateOceanColorPalette.warmEmbraceLight1,
2353
- success: lateOceanColorPalette.viride,
2354
- correct: lateOceanColorPalette.viride,
2355
- danger: lateOceanColorPalette.englishVermillon,
2356
- separator: lateOceanColorPalette.black100,
2357
- hover: lateOceanColorPalette.black100,
2358
- black: lateOceanColorPalette.black1000,
2359
- uiBackground: lateOceanColorPalette.black25,
2360
- uiBackgroundLight: lateOceanColorPalette.white,
2361
- overlay: {
2362
- dark: 'rgba(41, 48, 51, 0.25)',
2363
- light: 'rgba(255, 255, 255, 0.90)',
2364
- fullscreenLoader: 'rgba(0, 0, 0, 0.25)'
2365
- }
2366
- };
2367
-
2368
2590
  const feedbackMessageLateOceanTheme = {
2369
2591
  backgroundColors: {
2370
2592
  success: lateOceanColorPalette.viride,
@@ -2478,11 +2700,11 @@ const iconButton = {
2478
2700
  },
2479
2701
  disabled: {
2480
2702
  scale: 1,
2481
- backgroundColor: buttonLateOceanTheme.secondary.disabledBackgroundColor,
2482
- borderColor: buttonLateOceanTheme.secondary.disabledBorderColor
2703
+ backgroundColor: buttonLateOceanTheme.disabled.backgroundColor,
2704
+ borderColor: buttonLateOceanTheme.disabled.borderColor
2483
2705
  },
2484
2706
  default: {
2485
- pressedBackgroundColor: buttonLateOceanTheme.secondary.pressedBackgroundColor
2707
+ pressedBackgroundColor: buttonLateOceanTheme.default.pressedBackgroundColor
2486
2708
  },
2487
2709
  white: {
2488
2710
  pressedBackgroundColor: buttonLateOceanTheme.white.hoverBackgroundColor
@@ -2578,8 +2800,8 @@ const typographyLateOceanTheme = {
2578
2800
  types: {
2579
2801
  headers: {
2580
2802
  fontFamily: {
2581
- regular: 'Moderat',
2582
- bold: 'Moderat'
2803
+ regular: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold',
2804
+ bold: reactNative.Platform.OS === 'web' ? 'Moderat' : 'Moderat-Extended-Bold'
2583
2805
  },
2584
2806
  fontWeight: 400,
2585
2807
  fontStyle: 'normal',
@@ -2598,8 +2820,8 @@ const typographyLateOceanTheme = {
2598
2820
  },
2599
2821
  bodies: {
2600
2822
  fontFamily: {
2601
- regular: 'Noto Sans',
2602
- bold: 'Noto Sans'
2823
+ regular: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans',
2824
+ bold: reactNative.Platform.OS === 'web' ? 'Noto Sans' : 'NotoSans-Bold'
2603
2825
  },
2604
2826
  fontWeight: {
2605
2827
  regular: 400,
@@ -2644,7 +2866,7 @@ const breakpoints = {
2644
2866
  wideBreakpoint: 'max-width: 1279px'
2645
2867
  }
2646
2868
  }; // eslint-disable-next-line unicorn/expiring-todo-comments
2647
- // TODO : seperate brand color usage definition from proper theme definition and add typings - https://ornikar.atlassian.net/browse/CME-156
2869
+ // TODO : seperate brand co lor usage definition from proper theme definition and add t ypings - https://ornikar.atlassian.net/browse/CME-156
2648
2870
 
2649
2871
  const theme = {
2650
2872
  spacing: 4,
@@ -2703,7 +2925,7 @@ function ModalDateTimePicker({
2703
2925
  testID: "date-picker-native-element",
2704
2926
  value: currentValue,
2705
2927
  mode: "time",
2706
- display: 'default',
2928
+ display: reactNative.Platform.OS === 'ios' ? 'spinner' : 'default',
2707
2929
  onChange: (_event, date) => setCurrentValue(prev => {
2708
2930
  return date || prev;
2709
2931
  })
@@ -2792,14 +3014,21 @@ function TimePicker({
2792
3014
  base: "body",
2793
3015
  color: displayedValue === timePickerPlaceholder ? 'black-light' : 'black',
2794
3016
  children: displayedValue
2795
- }), null, /*#__PURE__*/jsxRuntime.jsx(ModalDateTimePicker, {
3017
+ }), reactNative.Platform.OS === 'android' && isTimePickerModalVisible ? /*#__PURE__*/jsxRuntime.jsx(DateTimePicker__default, {
3018
+ is24Hour: true,
3019
+ testID: "date-picker-native-element",
3020
+ value: dateTimePickerValue,
3021
+ mode: "time",
3022
+ display: "default",
3023
+ onChange: (_event, date) => handleTimeChange(date)
3024
+ }) : null, reactNative.Platform.OS !== 'android' ? /*#__PURE__*/jsxRuntime.jsx(ModalDateTimePicker, {
2796
3025
  title: title,
2797
3026
  visible: isTimePickerModalVisible,
2798
3027
  value: dateTimePickerValue,
2799
3028
  validateButtonLabel: validateButtonLabel,
2800
3029
  onChange: handleTimeChange,
2801
3030
  onClose: handleModalClose
2802
- })]
3031
+ }) : null]
2803
3032
  });
2804
3033
  }
2805
3034
 
@@ -2914,7 +3143,7 @@ function Tooltip({
2914
3143
  };
2915
3144
  _f.asString = "function _f(){const{withSpring,pressed,theme}=jsThis._closure;{return{opacity:withSpring(pressed.value?theme.kitt.tooltip.opacity:0)};}}";
2916
3145
  _f.__workletHash = 15953928507970;
2917
- _f.__location = "/home/chris/ornikar/kitt/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
3146
+ _f.__location = "/home/circleci/repo/@ornikar/kitt-universal/src/Tooltip/Tooltip.tsx (57:41)";
2918
3147
  _f.__optimalization = 2;
2919
3148
 
2920
3149
  global.__reanimatedWorkletInit(_f);
@@ -2985,7 +3214,9 @@ const StyledTypographyEmoji = /*#__PURE__*/styled__default(Emoji).withConfig({
2985
3214
  })(["align-self:center;", ""], ({
2986
3215
  size
2987
3216
  }) => {
3217
+ if (reactNative.Platform.OS !== 'web') return undefined;
2988
3218
  /* Style Twemoji: https://github.com/twitter/twemoji#inline-styles */
3219
+
2989
3220
  return `
2990
3221
  margin: 0 ${size / 20}px 0 ${size / 10}px;
2991
3222
  transform: translateY(${size / 10 * 2}px);
@@ -3028,6 +3259,7 @@ const StyledLink = /*#__PURE__*/styled__default.Text.withConfig({
3028
3259
  }) => $noUnderline ? 'none' : 'underline', ({
3029
3260
  $disabled
3030
3261
  }) => {
3262
+ if (reactNative.Platform.OS !== 'web') return undefined;
3031
3263
  return `
3032
3264
  text-decoration-color: inherit;
3033
3265
  transition: color 0.2s ease-in-out;
@@ -3053,7 +3285,7 @@ function TypographyLink({
3053
3285
  accessibilityRole: "none",
3054
3286
  children: /*#__PURE__*/jsxRuntime.jsx(StyleWebWrapper, {
3055
3287
  as: TypographyLinkWebWrapper,
3056
- "data-nounderline": noUnderline,
3288
+ "data-nounderline": noUnderline ? true : undefined,
3057
3289
  children: /*#__PURE__*/jsxRuntime.jsx(StyledLink, {
3058
3290
  $disabled: disabled,
3059
3291
  $noUnderline: noUnderline,