@ornikar/kitt-universal 27.0.0 → 27.0.1-canary.e2bc67122aa41f65986d23f21317b442b05d8963.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 (70) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/definitions/Button/AnimatedContainer.d.ts +2 -1
  3. package/dist/definitions/Button/AnimatedContainer.d.ts.map +1 -1
  4. package/dist/definitions/Button/Button.d.ts +2 -17
  5. package/dist/definitions/Button/Button.d.ts.map +1 -1
  6. package/dist/definitions/Button/ButtonContent.d.ts +10 -8
  7. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  8. package/dist/definitions/Button/ButtonPadding.d.ts +1 -1
  9. package/dist/definitions/Button/ButtonPadding.d.ts.map +1 -1
  10. package/dist/definitions/Button/FocusBorder.d.ts +1 -4
  11. package/dist/definitions/Button/FocusBorder.d.ts.map +1 -1
  12. package/dist/definitions/Button/hooks/useNativeAnimation.d.ts +1 -1
  13. package/dist/definitions/Button/hooks/useNativeAnimation.d.ts.map +1 -1
  14. package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts +12 -3
  15. package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts.map +1 -1
  16. package/dist/definitions/Button/utils/getCurrentBackgroundColorForNativeBaseTheme.d.ts +3 -2
  17. package/dist/definitions/Button/utils/getCurrentBackgroundColorForNativeBaseTheme.d.ts.map +1 -1
  18. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts +2 -1
  19. package/dist/definitions/ButtonBadge/ButtonBadge.d.ts.map +1 -1
  20. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +30 -23
  21. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  22. package/dist/definitions/story-components/StoryBlock.d.ts +1 -1
  23. package/dist/definitions/themes/late-ocean/button.d.ts +26 -52
  24. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  25. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts +4 -1
  26. package/dist/definitions/themes/late-ocean/buttonBadge.d.ts.map +1 -1
  27. package/dist/definitions/themes/late-ocean/iconButton.d.ts +0 -1
  28. package/dist/definitions/themes/late-ocean/iconButton.d.ts.map +1 -1
  29. package/dist/definitions/typography/Typography.d.ts +1 -1
  30. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  31. package/dist/index-metro.es.android.js +238 -306
  32. package/dist/index-metro.es.android.js.map +1 -1
  33. package/dist/index-metro.es.ios.js +238 -306
  34. package/dist/index-metro.es.ios.js.map +1 -1
  35. package/dist/index-node-22.17.cjs.js +232 -300
  36. package/dist/index-node-22.17.cjs.js.map +1 -1
  37. package/dist/index-node-22.17.cjs.web.js +231 -284
  38. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  39. package/dist/index-node-22.17.es.mjs +232 -300
  40. package/dist/index-node-22.17.es.mjs.map +1 -1
  41. package/dist/index-node-22.17.es.web.mjs +231 -284
  42. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  43. package/dist/index.es.js +260 -322
  44. package/dist/index.es.js.map +1 -1
  45. package/dist/index.es.web.js +259 -307
  46. package/dist/index.es.web.js.map +1 -1
  47. package/dist/linaria-themes-metro.es.android.js +130 -116
  48. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  49. package/dist/linaria-themes-metro.es.ios.js +130 -116
  50. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  51. package/dist/linaria-themes-node-22.17.cjs.js +130 -116
  52. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  53. package/dist/linaria-themes-node-22.17.cjs.web.js +130 -116
  54. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  55. package/dist/linaria-themes-node-22.17.es.mjs +130 -116
  56. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  57. package/dist/linaria-themes-node-22.17.es.web.mjs +130 -116
  58. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  59. package/dist/linaria-themes.es.js +130 -116
  60. package/dist/linaria-themes.es.js.map +1 -1
  61. package/dist/linaria-themes.es.web.js +130 -116
  62. package/dist/linaria-themes.es.web.js.map +1 -1
  63. package/dist/tsbuildinfo +1 -1
  64. package/package.json +1 -1
  65. package/dist/definitions/Button/DisabledBorder.d.ts +0 -3
  66. package/dist/definitions/Button/DisabledBorder.d.ts.map +0 -1
  67. package/dist/definitions/Button/getVariantValuesIfExist.d.ts +0 -5
  68. package/dist/definitions/Button/getVariantValuesIfExist.d.ts.map +0 -1
  69. package/dist/definitions/Button/utils/getButtonSize.d.ts +0 -3
  70. package/dist/definitions/Button/utils/getButtonSize.d.ts.map +0 -1
@@ -534,15 +534,18 @@ const bottomSheet = {
534
534
  }
535
535
  };
536
536
 
537
+ // Strongly typed theme so every new type/variant/size can't be added
538
+ // without defined color & backgroundColor or icon size
539
+
537
540
  const button = {
538
- borderRadius: 30,
541
+ borderRadius: 4,
539
542
  borderWidth: {
540
- disabled: 2,
541
543
  focus: 3
542
544
  },
543
545
  minHeight: 40,
544
546
  minWidth: 40,
545
547
  maxWidth: 335,
548
+ maxHeight: 48,
546
549
  scale: {
547
550
  base: {
548
551
  default: 1,
@@ -553,148 +556,160 @@ const button = {
553
556
  hover: 1.05
554
557
  }
555
558
  },
556
- contentPadding: {
557
- default: '7px 16px 7px',
558
- large: '11px 24px 11px',
559
- xLarge: '15px 24px 15px',
560
- disabled: '5px 14px 5px'
559
+ icon: {
560
+ medium: {
561
+ size: 24
562
+ },
563
+ default: {
564
+ size: 20
565
+ }
561
566
  },
562
567
  padding: {
563
568
  default: {
564
- hasBadge: {
565
- right: 8
566
- },
567
569
  horizontal: 16,
568
- vertical: 7
570
+ vertical: 8
569
571
  },
570
- large: {
571
- hasBadge: {
572
- right: 12
573
- },
574
- horizontal: 24,
575
- vertical: 11
576
- },
577
- xLarge: {
578
- hasBadge: {
579
- right: 12
580
- },
572
+ medium: {
581
573
  horizontal: 24,
582
- vertical: 15
574
+ vertical: 12
583
575
  }
584
576
  },
585
577
  transition: {
586
578
  duration: '200ms',
587
579
  timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
588
580
  },
589
- default: {
590
- default: {
591
- backgroundColor: 'rgba(0, 0, 0, 0.05)',
592
- pressedBackgroundColor: 'rgba(0, 0, 0, 0.1)',
593
- hoverBackgroundColor: 'rgba(0, 0, 0, 0.1)',
594
- focusBorderColor: 'rgba(0, 0, 0, 0.1)'
595
- },
596
- ghost: {
597
- backgroundColor: 'rgba(255, 255, 255, 0.1)',
598
- pressedBackgroundColor: 'rgba(255, 255, 255, 0.05)',
599
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.05)',
600
- focusBorderColor: 'rgba(255, 255, 255, 0.4)',
601
- color: deepPurpleColorPalette.white,
602
- hoverColor: deepPurpleColorPalette.white,
603
- activeColor: deepPurpleColorPalette.white
604
- }
605
- },
581
+ focusBorderColor: deepPurpleColorPalette['blue.2'],
606
582
  primary: {
607
583
  default: {
608
- backgroundColor: colors.primary,
609
- pressedBackgroundColor: colors.primaryLight,
610
- hoverBackgroundColor: colors.primaryLight,
611
- focusBorderColor: 'rgba(76, 52, 224, 0.2)'
584
+ backgroundColor: {
585
+ default: colors.primary,
586
+ hover: deepPurpleColorPalette['deepPurple.7'],
587
+ pressed: deepPurpleColorPalette['deepPurple.7'],
588
+ disabled: deepPurpleColorPalette['grey.3'],
589
+ focus: colors.primary
590
+ },
591
+ color: {
592
+ default: colors.white,
593
+ hover: colors.white,
594
+ pressed: colors.white,
595
+ disabled: colors.disabled,
596
+ focus: colors.white
597
+ }
612
598
  },
613
- ghost: {
614
- backgroundColor: colors.uiBackgroundLight,
615
- pressedBackgroundColor: colors.uiBackground,
616
- hoverBackgroundColor: deepPurpleColorPalette['beige.2'],
617
- focusBorderColor: 'rgba(255,255,255, 0.4)',
618
- color: colors.primary,
619
- hoverColor: deepPurpleColorPalette['beige.2'],
620
- activeColor: deepPurpleColorPalette['beige.2']
621
- }
622
- },
623
- dark: {
624
- default: {
625
- backgroundColor: colors.black,
626
- pressedBackgroundColor: 'rgba(0, 0, 0, 0.8)',
627
- hoverBackgroundColor: 'rgba(0, 0, 0, 0.8)',
628
- focusBorderColor: 'rgba(0, 0, 0, 0.8)'
599
+ revert: {
600
+ backgroundColor: {
601
+ default: colors.white,
602
+ hover: deepPurpleColorPalette['white-alpha.80'],
603
+ pressed: deepPurpleColorPalette['white-alpha.80'],
604
+ disabled: deepPurpleColorPalette['grey.3'],
605
+ focus: colors.white
606
+ },
607
+ color: {
608
+ default: colors.black,
609
+ hover: colors.black,
610
+ pressed: colors.black,
611
+ disabled: colors.disabled,
612
+ focus: colors.black
613
+ }
629
614
  }
630
615
  },
631
- danger: {
616
+ secondary: {
632
617
  default: {
633
- backgroundColor: deepPurpleColorPalette['red.1'],
634
- pressedBackgroundColor: deepPurpleColorPalette['red.2'],
635
- hoverBackgroundColor: deepPurpleColorPalette['red.2'],
636
- focusBorderColor: deepPurpleColorPalette['red.2']
618
+ backgroundColor: {
619
+ default: deepPurpleColorPalette['beige-alpha.25'],
620
+ hover: deepPurpleColorPalette['beige-alpha.40'],
621
+ pressed: deepPurpleColorPalette['beige-alpha.40'],
622
+ disabled: colors.disabled,
623
+ focus: deepPurpleColorPalette['beige-alpha.25']
624
+ },
625
+ color: {
626
+ default: colors.black,
627
+ hover: colors.black,
628
+ pressed: colors.black,
629
+ disabled: deepPurpleColorPalette['grey.3'],
630
+ focus: colors.black
631
+ }
637
632
  },
638
- ghost: {
639
- backgroundColor: colors.uiBackgroundLight,
640
- pressedBackgroundColor: colors.uiBackground,
641
- hoverBackgroundColor: deepPurpleColorPalette['beige.2'],
642
- focusBorderColor: 'rgba(255, 255, 255, 0.4)',
643
- color: deepPurpleColorPalette['red.6'],
644
- hoverColor: deepPurpleColorPalette['red.6'],
645
- activeColor: deepPurpleColorPalette['red.6']
646
- }
647
- },
648
- subtle: {
649
- default: {
650
- backgroundColor: colors.transparent,
651
- pressedBackgroundColor: colors.transparent,
652
- hoverBackgroundColor: colors.transparent,
653
- focusBorderColor: 'rgba(76, 52, 224, 0.2)',
654
- color: colors.primary,
655
- hoverColor: 'rgba(76, 52, 224, 0.8)',
656
- activeColor: 'rgba(76, 52, 224, 0.8)'
657
- }
658
- },
659
- 'subtle-dark': {
660
- default: {
661
- backgroundColor: colors.transparent,
662
- pressedBackgroundColor: colors.transparent,
663
- hoverBackgroundColor: colors.transparent,
664
- focusBorderColor: 'rgba(0, 0, 0, 0.1)',
665
- color: colors.black,
666
- hoverColor: 'rgba(0, 0, 0, 0.8)',
667
- activeColor: 'rgba(0, 0, 0, 0.8)'
633
+ revert: {
634
+ backgroundColor: {
635
+ default: deepPurpleColorPalette['white-alpha.10'],
636
+ hover: deepPurpleColorPalette['white-alpha.20'],
637
+ pressed: deepPurpleColorPalette['white-alpha.20'],
638
+ disabled: colors.disabled,
639
+ focus: deepPurpleColorPalette['white-alpha.10']
640
+ },
641
+ color: {
642
+ default: colors.white,
643
+ hover: deepPurpleColorPalette['white-alpha.80'],
644
+ pressed: deepPurpleColorPalette['white-alpha.80'],
645
+ disabled: deepPurpleColorPalette['grey.3'],
646
+ focus: colors.white
647
+ }
668
648
  }
669
649
  },
670
- 'subtle-revert': {
650
+ tertiary: {
671
651
  default: {
672
- backgroundColor: colors.transparent,
673
- pressedBackgroundColor: colors.transparent,
674
- hoverBackgroundColor: colors.transparent,
675
- focusBorderColor: colors.white,
676
- color: colors.white,
677
- hoverColor: colors.white,
678
- activeColor: colors.white
652
+ backgroundColor: {
653
+ default: 'transparent',
654
+ hover: 'transparent',
655
+ pressed: 'transparent',
656
+ disabled: 'transparent',
657
+ focus: 'transparent'
658
+ },
659
+ color: {
660
+ default: colors.black,
661
+ hover: colors.blackAnthracite,
662
+ pressed: colors.blackAnthracite,
663
+ disabled: deepPurpleColorPalette['grey.3'],
664
+ focus: colors.black
665
+ }
666
+ },
667
+ revert: {
668
+ backgroundColor: {
669
+ default: 'transparent',
670
+ hover: 'transparent',
671
+ pressed: 'transparent',
672
+ disabled: 'transparent',
673
+ focus: 'transparent'
674
+ },
675
+ color: {
676
+ default: colors.white,
677
+ hover: deepPurpleColorPalette['white-alpha.80'],
678
+ pressed: deepPurpleColorPalette['white-alpha.80'],
679
+ disabled: deepPurpleColorPalette['white-alpha.20'],
680
+ focus: colors.white
681
+ }
679
682
  }
680
683
  },
681
- disabled: {
684
+ 'tertiary-danger': {
682
685
  default: {
683
- backgroundColor: colors.disabled,
684
- pressedBackgroundColor: colors.disabled,
685
- hoverBackgroundColor: colors.disabled,
686
- focusBorderColor: deepPurpleColorPalette['beige.2'],
687
- borderColor: deepPurpleColorPalette['beige.2']
686
+ backgroundColor: {
687
+ default: 'transparent',
688
+ hover: 'transparent',
689
+ pressed: 'transparent',
690
+ disabled: 'transparent',
691
+ focus: 'transparent'
692
+ },
693
+ color: {
694
+ default: colors.danger,
695
+ hover: deepPurpleColorPalette['red.2'],
696
+ pressed: deepPurpleColorPalette['red.2'],
697
+ disabled: deepPurpleColorPalette['grey.3'],
698
+ focus: colors.danger
699
+ }
688
700
  }
689
701
  }
690
702
  };
691
703
 
692
704
  const buttonBadge = {
693
- backgroundColor: deepPurpleColorPalette['red.6'],
705
+ backgroundColor: {
706
+ default: colors.danger,
707
+ disabled: colors.blackLight
708
+ },
694
709
  dimensions: {
695
710
  withBadge: {
696
- width: 10,
697
- height: 10
711
+ width: 8,
712
+ height: 8
698
713
  },
699
714
  badgeCount: {
700
715
  width: 20,
@@ -1891,14 +1906,13 @@ const iconButton = {
1891
1906
  },
1892
1907
  disabled: {
1893
1908
  scale: 1,
1894
- backgroundColor: button.disabled.default.backgroundColor,
1895
- borderColor: button.disabled.default.borderColor
1909
+ backgroundColor: button.primary.default.backgroundColor.disabled
1896
1910
  },
1897
1911
  default: {
1898
- pressedBackgroundColor: button.default.default.pressedBackgroundColor
1912
+ pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1899
1913
  },
1900
1914
  ghost: {
1901
- pressedBackgroundColor: button.default.ghost.pressedBackgroundColor
1915
+ pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1902
1916
  },
1903
1917
  primary: {
1904
1918
  pressedBackgroundColor: deepPurpleColorPalette['beige.1']
@@ -2785,32 +2799,28 @@ function createResponsiveStyleFromProp(responsiveBooleanValue, valueIfTrue, valu
2785
2799
  return responsiveValue;
2786
2800
  }
2787
2801
 
2788
- function warn(message) {
2789
- if (process.env.NODE_ENV !== 'production') {
2790
- console.warn(message);
2791
- }
2792
- }
2793
- function deprecatedMessage(symbol, deprecation, replaceBy) {
2794
- const replaceMessage = replaceBy === undefined ? '' : `, please use ${replaceBy} instead`;
2795
- warn(`[Deprecation] in ${symbol}: ${deprecation} is deprecated${replaceMessage}.`);
2796
- }
2797
- function deprecatedInComponent(component, deprecation, replaceBy) {
2798
- deprecatedMessage(`<${component} />`, deprecation, replaceBy);
2799
- }
2800
-
2801
2802
  function getCurrentBackgroundColorForNativeBaseTheme({
2802
2803
  type,
2803
2804
  variant,
2804
2805
  isDisabled,
2805
2806
  isHovered,
2806
- isPressed
2807
+ isPressed,
2808
+ isFocused
2807
2809
  }) {
2808
- if (isDisabled) return 'kitt.button.disabled.default.backgroundColor';
2809
- const baseKey = `kitt.button.${type}.${variant}`;
2810
- if (isHovered || isPressed) {
2811
- return `${baseKey}.hoverBackgroundColor`;
2810
+ const baseKey = `kitt.button.${type}.${variant}.backgroundColor`;
2811
+ if (isDisabled) {
2812
+ return `${baseKey}.disabled`;
2813
+ }
2814
+ if (isHovered) {
2815
+ return `${baseKey}.hover`;
2816
+ }
2817
+ if (isPressed) {
2818
+ return `${baseKey}.pressed`;
2819
+ }
2820
+ if (isFocused) {
2821
+ return `${baseKey}.focused`;
2812
2822
  }
2813
- return `${baseKey}.backgroundColor`;
2823
+ return `${baseKey}.default`;
2814
2824
  }
2815
2825
 
2816
2826
  function getCurrentScale$1({
@@ -3048,7 +3058,6 @@ function Typography({
3048
3058
  },
3049
3059
  variant,
3050
3060
  color,
3051
- underline,
3052
3061
  ...otherProps
3053
3062
  }) {
3054
3063
  const sx = useSx();
@@ -3087,15 +3096,9 @@ function Typography({
3087
3096
  lineHeight: hasTypographyAncestor ? undefined : fontSizeForNativeBase,
3088
3097
  fontWeight: webFontWeight,
3089
3098
  fontFamily: nativeFontFamily,
3090
- borderBottomWidth: underline ? 1 : undefined,
3091
- borderBottomColor: underline ? currentColorValue : undefined,
3092
3099
  textTransform: typographyFamily === 'contentCaps' ? 'uppercase' : undefined,
3093
3100
  ...colorStyles,
3094
- ...otherProps,
3095
- // The property text-underline-offset is not on native.
3096
- // To add an underline with an offset, we use a custom borderBottomWidth and color.
3097
- // and we set underline to undefined to avoid a double underline
3098
- underline: undefined
3101
+ ...otherProps
3099
3102
  });
3100
3103
  const content = baseOrDefaultToBody ? /*#__PURE__*/jsx(TypographyFamilyContext.Provider, {
3101
3104
  value: typographyFamily,
@@ -3147,13 +3150,15 @@ Typography.Header6 = createHeading(6);
3147
3150
 
3148
3151
  function ButtonBadge({
3149
3152
  withBadge,
3150
- badgeCount
3153
+ badgeCount,
3154
+ disabled
3151
3155
  }) {
3156
+ const backgroundColor = disabled ? 'kitt.buttonBadge.backgroundColor.disabled' : 'kitt.buttonBadge.backgroundColor.default';
3152
3157
  if (withBadge) {
3153
3158
  return /*#__PURE__*/jsx(View, {
3154
3159
  height: "kitt.buttonBadge.dimensions.withBadge.height",
3155
3160
  width: "kitt.buttonBadge.dimensions.withBadge.width",
3156
- backgroundColor: "kitt.buttonBadge.backgroundColor",
3161
+ backgroundColor: backgroundColor,
3157
3162
  borderRadius: "kitt.buttonBadge.borderRadius.withBadge"
3158
3163
  });
3159
3164
  }
@@ -3163,7 +3168,7 @@ function ButtonBadge({
3163
3168
  justifyContent: "center",
3164
3169
  height: "kitt.buttonBadge.dimensions.badgeCount.height",
3165
3170
  width: "kitt.buttonBadge.dimensions.badgeCount.width",
3166
- backgroundColor: "kitt.buttonBadge.backgroundColor",
3171
+ backgroundColor: backgroundColor,
3167
3172
  borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3168
3173
  children: /*#__PURE__*/jsx(Typography.Text, {
3169
3174
  base: "body-xs",
@@ -3258,103 +3263,77 @@ function TypographyIcon({
3258
3263
  });
3259
3264
  }
3260
3265
 
3261
- const getButtonTextColorByType = (type, variant, isHovered, isPressed) => {
3262
- const isButtonInteractedWith = isHovered || isPressed;
3263
- switch (type) {
3264
- case 'primary':
3265
- return variant === 'ghost' ? 'primary' : 'white';
3266
- case 'dark':
3267
- return 'white';
3268
- case 'danger':
3269
- return 'danger';
3270
- case 'subtle':
3271
- return isButtonInteractedWith ? 'primary-light' : 'primary';
3272
- case 'subtle-dark':
3273
- return isButtonInteractedWith ? 'black-light' : 'black';
3274
- case 'subtle-revert':
3275
- return 'white';
3276
- case 'default':
3277
- return variant === 'ghost' ? 'white' : 'black';
3278
- default:
3279
- return 'black';
3266
+ const getButtonTextColorByType = (type, variant, isHovered, isPressed, isDisabled) => {
3267
+ const baseKey = `kitt.button.${type}.${variant}.color`;
3268
+ if (isDisabled) {
3269
+ return `${baseKey}.disabled`;
3270
+ }
3271
+ if (isHovered || isPressed) {
3272
+ return `${baseKey}.hover`;
3280
3273
  }
3274
+ return `${baseKey}.default`;
3281
3275
  };
3282
3276
 
3283
- function ButtonIcon({
3284
- icon,
3285
- color,
3286
- iconPosition,
3287
- testID
3288
- }) {
3289
- return /*#__PURE__*/jsx(View, {
3290
- marginRight: iconPosition === 'left' ? 'kitt.2' : 0,
3291
- marginLeft: iconPosition === 'right' ? 'kitt.2' : 0,
3292
- children: /*#__PURE__*/jsx(TypographyIcon, {
3293
- icon: icon,
3294
- testID: testID,
3295
- color: color
3296
- })
3297
- });
3298
- }
3299
3277
  function ButtonContentChildren({
3300
3278
  type,
3301
3279
  icon,
3302
3280
  iconPosition,
3303
3281
  innerSpacing,
3282
+ isDisabled,
3304
3283
  withBadge,
3305
3284
  badgeCount,
3306
3285
  color,
3307
- children
3286
+ children,
3287
+ isPressed,
3288
+ isHovered,
3289
+ size = 'default'
3308
3290
  }) {
3309
3291
  if ((process.env.NODE_ENV !== "production")) {
3310
3292
  if (!(children || icon)) {
3311
3293
  throw new Error('kitt(Button): You should provide at least a children or a icon');
3312
3294
  }
3313
3295
  }
3314
- if (!children) {
3315
- return /*#__PURE__*/jsx(TypographyIcon
3316
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
3317
- , {
3296
+ if (!children && icon) {
3297
+ return /*#__PURE__*/jsx(TypographyIcon, {
3318
3298
  icon: icon,
3319
3299
  color: color
3320
3300
  });
3321
3301
  }
3322
- const buttonIconSharedProps = {
3323
- type,
3324
- iconPosition,
3325
- color
3326
- };
3327
-
3328
3302
  // Make the multilines case work properly on native - Breaks the web implem
3329
3303
  const sharedNativeStyle = {
3330
3304
  flexShrink: 1
3331
3305
  };
3332
- return /*#__PURE__*/jsxs(View, {
3306
+ return /*#__PURE__*/jsxs(HStack$1, {
3333
3307
  alignItems: "center",
3334
3308
  justifyContent: innerSpacing,
3335
- flexDirection: "row",
3336
- children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(ButtonIcon, {
3337
- ...buttonIconSharedProps,
3309
+ space: "kitt.2",
3310
+ children: [icon && iconPosition === 'left' ? /*#__PURE__*/jsx(TypographyIcon, {
3311
+ ...{
3312
+ type,
3313
+ color
3314
+ },
3338
3315
  testID: "button.ButtonContent.leftButtonIcon",
3339
- icon: icon
3316
+ icon: icon,
3317
+ color: color,
3318
+ size: `kitt.button.icon.${size}.size`
3340
3319
  }) : null, /*#__PURE__*/jsx(Typography.Text, {
3341
3320
  /* On native code, this is the only way to ensure that the text is centered */
3342
3321
  textAlign: "center",
3343
3322
  _android: sharedNativeStyle,
3344
3323
  _ios: sharedNativeStyle,
3345
- base: "body-m",
3346
- variant: "bold",
3324
+ base: "label-large",
3325
+ variant: "semibold",
3326
+ underline: (type === 'tertiary' || type === 'tertiary-danger') && !isHovered && !isPressed,
3347
3327
  color: color,
3348
3328
  children: children
3349
- }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(ButtonIcon, {
3350
- ...buttonIconSharedProps,
3351
- icon: icon
3352
- }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3353
- marginLeft: "kitt.2",
3354
- children: /*#__PURE__*/jsx(ButtonBadge, {
3355
- withBadge: withBadge,
3356
- badgeCount: badgeCount
3357
- })
3329
+ }), icon && iconPosition === 'right' ? /*#__PURE__*/jsx(TypographyIcon, {
3330
+ icon: icon,
3331
+ color: color,
3332
+ size: `kitt.button.icon.${size}.size`
3333
+ }) : null, withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(ButtonBadge, {
3334
+ disabled: isDisabled,
3335
+ withBadge: withBadge,
3336
+ badgeCount: badgeCount
3358
3337
  }) : null]
3359
3338
  });
3360
3339
  }
@@ -3368,9 +3347,10 @@ function ButtonContent({
3368
3347
  isPressed,
3369
3348
  isFocused,
3370
3349
  innerSpacing,
3350
+ size,
3371
3351
  ...props
3372
3352
  }) {
3373
- const color = isDisabled ? 'black-light' : getButtonTextColorByType(type, variant, isHovered, isPressed);
3353
+ const color = getButtonTextColorByType(type, variant, isHovered, isPressed, isDisabled);
3374
3354
  return /*#__PURE__*/jsx(View, {
3375
3355
  _web: {
3376
3356
  // Make the multilines case work properly on web
@@ -3385,56 +3365,33 @@ function ButtonContent({
3385
3365
  isDisabled: isDisabled,
3386
3366
  color: color,
3387
3367
  innerSpacing: innerSpacing,
3368
+ isHovered: isHovered,
3369
+ isPressed: isPressed,
3370
+ size: size,
3388
3371
  ...props,
3389
3372
  children: children
3390
3373
  })
3391
3374
  });
3392
3375
  }
3393
3376
 
3394
- function getCurrentPaddingConfig({
3395
- size
3396
- }) {
3397
- if (size === 'large') return 'large';
3398
- if (size === 'xLarge') return 'xLarge';
3399
- return 'default';
3400
- }
3401
3377
  function ButtonPadding({
3402
3378
  children,
3403
3379
  size,
3404
3380
  hasBadge
3405
3381
  }) {
3406
- const currentPaddingKey = getCurrentPaddingConfig({
3407
- size
3408
- });
3409
3382
  return /*#__PURE__*/jsx(View, {
3410
3383
  position: "relative",
3411
3384
  flexDirection: "row",
3412
3385
  alignItems: "center",
3413
3386
  justifyContent: "center",
3414
- paddingX: `kitt.button.padding.${currentPaddingKey}.horizontal`,
3415
- paddingY: `kitt.button.padding.${currentPaddingKey}.vertical`,
3416
- paddingRight: hasBadge ? `kitt.button.padding.${currentPaddingKey}.hasBadge.right` : undefined,
3387
+ paddingX: `kitt.button.padding.${size}.horizontal`,
3388
+ paddingY: `kitt.button.padding.${size}.vertical`,
3417
3389
  minHeight: "kitt.button.minHeight",
3418
3390
  children: children
3419
3391
  });
3420
3392
  }
3421
3393
 
3422
- function DisabledBorder() {
3423
- return /*#__PURE__*/jsx(View, {
3424
- position: "absolute",
3425
- top: 0,
3426
- left: 0,
3427
- right: 0,
3428
- bottom: 0,
3429
- borderWidth: "kitt.button.borderWidth.disabled",
3430
- borderColor: "kitt.button.disabled.default.borderColor",
3431
- borderRadius: "kitt.button.borderRadius"
3432
- });
3433
- }
3434
-
3435
3394
  function FocusBorder({
3436
- type,
3437
- variant,
3438
3395
  isFocused,
3439
3396
  isHovered,
3440
3397
  isPressed
@@ -3444,11 +3401,13 @@ function FocusBorder({
3444
3401
  button: buttonTheme
3445
3402
  }
3446
3403
  } = useTheme();
3404
+ const outerBorderRadius = buttonTheme.borderRadius + buttonTheme.borderWidth.focus;
3405
+ const innerBorderRadius = buttonTheme.borderRadius;
3447
3406
  return /*#__PURE__*/jsx(View, {
3448
3407
  _web: {
3449
3408
  style: {
3450
- width: `calc(100% + ${buttonTheme.borderWidth.focus * 2}px)`,
3451
- height: `calc(100% + ${buttonTheme.borderWidth.focus * 2}px)`,
3409
+ width: `calc(100% + ${buttonTheme.borderRadius}px)`,
3410
+ height: `calc(100% + ${buttonTheme.borderRadius}px)`,
3452
3411
  transitionProperty: 'opacity',
3453
3412
  transitionDuration: buttonTheme.transition.duration,
3454
3413
  transitionTimingFunction: buttonTheme.transition.timingFunction
@@ -3456,11 +3415,12 @@ function FocusBorder({
3456
3415
  },
3457
3416
  opacity: isFocused && !(isPressed || isHovered) ? 1 : 0,
3458
3417
  position: "absolute",
3459
- left: -buttonTheme.borderWidth.focus,
3460
- top: -buttonTheme.borderWidth.focus,
3461
3418
  borderWidth: "kitt.button.borderWidth.focus",
3462
- borderColor: `kitt.button.${type}.${variant}.focusBorderColor`,
3463
- borderRadius: "kitt.button.borderRadius"
3419
+ borderColor: "kitt.button.focusBorderColor",
3420
+ borderRadius: outerBorderRadius,
3421
+ children: /*#__PURE__*/jsx(View, {
3422
+ borderRadius: innerBorderRadius
3423
+ })
3464
3424
  });
3465
3425
  }
3466
3426
 
@@ -3472,27 +3432,14 @@ function useNativeAnimation$5() {
3472
3432
  };
3473
3433
  }
3474
3434
 
3475
- const getButtonSize = ({
3476
- large,
3477
- xLarge,
3478
- size
3479
- }) => {
3480
- if (large) return 'large';
3481
- if (xLarge) return 'xLarge';
3482
- return size;
3483
- };
3484
-
3485
- const allowedGhostTypes = ['primary', 'default', 'danger'];
3486
3435
  const Button = /*#__PURE__*/forwardRef(({
3487
3436
  children,
3488
- type = 'default',
3437
+ type = 'secondary',
3489
3438
  variant = 'default',
3490
3439
  disabled,
3491
3440
  stretch,
3492
- large,
3493
- xLarge,
3494
3441
  icon,
3495
- size: sizeProp,
3442
+ size = 'default',
3496
3443
  iconPosition = 'left',
3497
3444
  testID,
3498
3445
  href,
@@ -3515,18 +3462,9 @@ const Button = /*#__PURE__*/forwardRef(({
3515
3462
  onPressOut,
3516
3463
  animatedStyles
3517
3464
  } = useNativeAnimation$5();
3518
- if ((process.env.NODE_ENV !== "production") && variant === 'ghost' && !allowedGhostTypes.includes(type)) {
3519
- throw new Error('variant=ghost is only allowed with type=primary or default');
3465
+ if (process.env.NODE_ENV !== 'production' && variant === 'revert' && type === 'tertiary-danger') {
3466
+ throw new Error('Invalid revert variant for tertiary-danger button type. Only default variant is allowed.');
3520
3467
  }
3521
- if (large || xLarge) {
3522
- const deprecatedProp = large ? 'large' : 'xLarge';
3523
- deprecatedInComponent('Button', `${deprecatedProp} prop`, 'size');
3524
- }
3525
- const size = getButtonSize({
3526
- large,
3527
- xLarge,
3528
- size: sizeProp
3529
- });
3530
3468
  return /*#__PURE__*/jsx(Pressable, {
3531
3469
  ref: ref,
3532
3470
  disabled: disabled,
@@ -3538,6 +3476,7 @@ const Button = /*#__PURE__*/forwardRef(({
3538
3476
  alignSelf: createResponsiveStyleFromProp(stretch, undefined, 'flex-start'),
3539
3477
  minWidth: "kitt.button.minWidth",
3540
3478
  maxWidth: createResponsiveStyleFromProp(stretch, '100%', 'kitt.button.maxWidth'),
3479
+ maxHeight: "kitt.button.maxHeight",
3541
3480
  width: createResponsiveStyleFromProp(stretch, '100%', 'auto'),
3542
3481
  onPress: onPress,
3543
3482
  onPressIn: onPressIn,
@@ -3573,10 +3512,9 @@ const Button = /*#__PURE__*/forwardRef(({
3573
3512
  isPressed: isPressed,
3574
3513
  isFocused: isFocused,
3575
3514
  innerSpacing: innerSpacing,
3515
+ size: size,
3576
3516
  children: children
3577
- }), disabled ? /*#__PURE__*/jsx(DisabledBorder, {}) : null, /*#__PURE__*/jsx(FocusBorder, {
3578
- type: type,
3579
- variant: variant,
3517
+ }), /*#__PURE__*/jsx(FocusBorder, {
3580
3518
  isFocused: isFocused || isFocusedInternal,
3581
3519
  isHovered: isHovered,
3582
3520
  isPressed: isPressed
@@ -3718,7 +3656,7 @@ function Actions({
3718
3656
  flexGrow: 1,
3719
3657
  reversed: isReversed,
3720
3658
  ...props,
3721
- space: "kitt.3",
3659
+ space: "kitt.2",
3722
3660
  children: children
3723
3661
  });
3724
3662
  }
@@ -7821,7 +7759,8 @@ function InfoCard({
7821
7759
  icon: /*#__PURE__*/jsx(CaretRightRegularIcon, {})
7822
7760
  }) : /*#__PURE__*/jsx(View$1, {
7823
7761
  children: /*#__PURE__*/jsx(Button, {
7824
- type: isContrastReversed ? 'subtle-revert' : 'subtle-dark',
7762
+ type: "tertiary",
7763
+ variant: isContrastReversed ? 'revert' : undefined,
7825
7764
  onPress: onPress,
7826
7765
  children: action?.label
7827
7766
  })
@@ -8441,14 +8380,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8441
8380
  }
8442
8381
  },
8443
8382
  button: {
8444
- default: theme.button.default,
8445
- dark: theme.button.dark,
8446
8383
  primary: theme.button.primary,
8447
- danger: theme.button.danger,
8448
- subtle: theme.button.subtle,
8449
- 'subtle-revert': theme.button['subtle-revert'],
8450
- 'subtle-dark': theme.button['subtle-dark'],
8451
- disabled: theme.button.disabled
8384
+ secondary: theme.button.secondary,
8385
+ tertiary: theme.button.tertiary,
8386
+ 'tertiary-danger': theme.button['tertiary-danger'],
8387
+ focusBorderColor: theme.button.focusBorderColor
8452
8388
  },
8453
8389
  choices: {
8454
8390
  item: {
@@ -8877,7 +8813,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8877
8813
  iconButton: {
8878
8814
  borderColor: theme.iconButton.borderColor,
8879
8815
  disabled: {
8880
- borderColor: theme.iconButton.disabled.borderColor,
8881
8816
  backgroundColor: theme.iconButton.disabled.backgroundColor
8882
8817
  },
8883
8818
  black: {
@@ -9431,7 +9366,16 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9431
9366
  button: {
9432
9367
  minWidth: theme.button.minWidth,
9433
9368
  maxWidth: theme.button.maxWidth,
9434
- minHeight: theme.button.minHeight
9369
+ minHeight: theme.button.minHeight,
9370
+ maxHeight: theme.button.maxHeight,
9371
+ icon: {
9372
+ default: {
9373
+ size: theme.button.icon.default.size
9374
+ },
9375
+ medium: {
9376
+ size: theme.button.icon.medium.size
9377
+ }
9378
+ }
9435
9379
  },
9436
9380
  buttonBadge: {
9437
9381
  dimensions: {
@@ -9827,7 +9771,10 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9827
9771
  }
9828
9772
  },
9829
9773
  button: {
9830
- padding: theme.button.padding
9774
+ padding: {
9775
+ default: theme.button.padding.default,
9776
+ medium: theme.button.padding.medium
9777
+ }
9831
9778
  },
9832
9779
  cardModal: {
9833
9780
  overlayPadding: theme.cardModal.overlayPadding