@ornikar/kitt-universal 27.1.0 → 27.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 (96) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/definitions/Button/AnimatedContainer.d.ts +3 -1
  3. package/dist/definitions/Button/AnimatedContainer.d.ts.map +1 -1
  4. package/dist/definitions/Button/AnimatedContainer.web.d.ts +1 -1
  5. package/dist/definitions/Button/AnimatedContainer.web.d.ts.map +1 -1
  6. package/dist/definitions/Button/Button.d.ts.map +1 -1
  7. package/dist/definitions/Button/ButtonContent.d.ts.map +1 -1
  8. package/dist/definitions/Button/ButtonPadding.d.ts +2 -2
  9. package/dist/definitions/Button/ButtonPadding.d.ts.map +1 -1
  10. package/dist/definitions/Button/hooks/useNativeAnimation.d.ts.map +1 -1
  11. package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts +3 -3
  12. package/dist/definitions/Choices/AnimatedChoiceItemView.d.ts.map +1 -1
  13. package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts +1 -1
  14. package/dist/definitions/Choices/AnimatedChoiceItemView.web.d.ts.map +1 -1
  15. package/dist/definitions/Choices/ChoiceItem.d.ts +6 -4
  16. package/dist/definitions/Choices/ChoiceItem.d.ts.map +1 -1
  17. package/dist/definitions/Choices/Choices.d.ts +2 -2
  18. package/dist/definitions/Choices/Choices.d.ts.map +1 -1
  19. package/dist/definitions/Choices/utils/getBorderColor.d.ts +8 -0
  20. package/dist/definitions/Choices/utils/getBorderColor.d.ts.map +1 -0
  21. package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts +1 -5
  22. package/dist/definitions/Choices/utils/getCurrentTextColor.d.ts.map +1 -1
  23. package/dist/definitions/IconButton/IconButton.d.ts +8 -16
  24. package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
  25. package/dist/definitions/IconButton/utils/getButtonTypeAndVariant.d.ts +9 -0
  26. package/dist/definitions/IconButton/utils/getButtonTypeAndVariant.d.ts.map +1 -0
  27. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +19 -43
  28. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  29. package/dist/definitions/themes/default.d.ts +5 -0
  30. package/dist/definitions/themes/default.d.ts.map +1 -1
  31. package/dist/definitions/themes/late-ocean/button.d.ts +3 -11
  32. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  33. package/dist/definitions/themes/late-ocean/choices.d.ts +20 -2
  34. package/dist/definitions/themes/late-ocean/choices.d.ts.map +1 -1
  35. package/dist/definitions/themes/late-ocean/iconButton.d.ts +0 -35
  36. package/dist/definitions/themes/late-ocean/iconButton.d.ts.map +1 -1
  37. package/dist/definitions/themes/late-ocean/typography.d.ts +5 -0
  38. package/dist/definitions/themes/late-ocean/typography.d.ts.map +1 -1
  39. package/dist/definitions/typography/Typography.d.ts +1 -1
  40. package/dist/definitions/typography/Typography.d.ts.map +1 -1
  41. package/dist/index-metro.es.android.js +228 -405
  42. package/dist/index-metro.es.android.js.map +1 -1
  43. package/dist/index-metro.es.ios.js +228 -405
  44. package/dist/index-metro.es.ios.js.map +1 -1
  45. package/dist/index-node-22.17.cjs.js +223 -400
  46. package/dist/index-node-22.17.cjs.js.map +1 -1
  47. package/dist/index-node-22.17.cjs.web.js +225 -439
  48. package/dist/index-node-22.17.cjs.web.js.map +1 -1
  49. package/dist/index-node-22.17.es.mjs +223 -400
  50. package/dist/index-node-22.17.es.mjs.map +1 -1
  51. package/dist/index-node-22.17.es.web.mjs +225 -439
  52. package/dist/index-node-22.17.es.web.mjs.map +1 -1
  53. package/dist/index.es.js +228 -398
  54. package/dist/index.es.js.map +1 -1
  55. package/dist/index.es.web.js +231 -437
  56. package/dist/index.es.web.js.map +1 -1
  57. package/dist/linaria-themes-metro.es.android.js +38 -64
  58. package/dist/linaria-themes-metro.es.android.js.map +1 -1
  59. package/dist/linaria-themes-metro.es.ios.js +38 -64
  60. package/dist/linaria-themes-metro.es.ios.js.map +1 -1
  61. package/dist/linaria-themes-node-22.17.cjs.js +38 -64
  62. package/dist/linaria-themes-node-22.17.cjs.js.map +1 -1
  63. package/dist/linaria-themes-node-22.17.cjs.web.js +38 -64
  64. package/dist/linaria-themes-node-22.17.cjs.web.js.map +1 -1
  65. package/dist/linaria-themes-node-22.17.es.mjs +38 -64
  66. package/dist/linaria-themes-node-22.17.es.mjs.map +1 -1
  67. package/dist/linaria-themes-node-22.17.es.web.mjs +38 -64
  68. package/dist/linaria-themes-node-22.17.es.web.mjs.map +1 -1
  69. package/dist/linaria-themes.es.js +38 -64
  70. package/dist/linaria-themes.es.js.map +1 -1
  71. package/dist/linaria-themes.es.web.js +38 -64
  72. package/dist/linaria-themes.es.web.js.map +1 -1
  73. package/dist/tsbuildinfo +1 -1
  74. package/package.json +1 -1
  75. package/dist/definitions/Button/utils/getCurrentScale.d.ts +0 -10
  76. package/dist/definitions/Button/utils/getCurrentScale.d.ts.map +0 -1
  77. package/dist/definitions/Choices/utils/getBorderRadius.d.ts +0 -3
  78. package/dist/definitions/Choices/utils/getBorderRadius.d.ts.map +0 -1
  79. package/dist/definitions/IconButton/AnimatedBackground.d.ts +0 -13
  80. package/dist/definitions/IconButton/AnimatedBackground.d.ts.map +0 -1
  81. package/dist/definitions/IconButton/AnimatedBackground.web.d.ts +0 -4
  82. package/dist/definitions/IconButton/AnimatedBackground.web.d.ts.map +0 -1
  83. package/dist/definitions/IconButton/AnimatedScale.d.ts +0 -12
  84. package/dist/definitions/IconButton/AnimatedScale.d.ts.map +0 -1
  85. package/dist/definitions/IconButton/AnimatedScale.web.d.ts +0 -4
  86. package/dist/definitions/IconButton/AnimatedScale.web.d.ts.map +0 -1
  87. package/dist/definitions/IconButton/Background.d.ts +0 -11
  88. package/dist/definitions/IconButton/Background.d.ts.map +0 -1
  89. package/dist/definitions/IconButton/hooks/useNativeAnimation.d.ts +0 -18
  90. package/dist/definitions/IconButton/hooks/useNativeAnimation.d.ts.map +0 -1
  91. package/dist/definitions/IconButton/hooks/useNativeAnimation.web.d.ts +0 -3
  92. package/dist/definitions/IconButton/hooks/useNativeAnimation.web.d.ts.map +0 -1
  93. package/dist/definitions/IconButton/utils/getIconButtonBackgroundColor.d.ts +0 -3
  94. package/dist/definitions/IconButton/utils/getIconButtonBackgroundColor.d.ts.map +0 -1
  95. package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts +0 -4
  96. package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts.map +0 -1
@@ -542,20 +542,13 @@ const button = {
542
542
  borderWidth: {
543
543
  focus: 3
544
544
  },
545
- minHeight: 40,
546
545
  minWidth: 40,
547
546
  maxWidth: 335,
548
- maxHeight: 48,
549
- scale: {
550
- base: {
551
- default: 1,
552
- hover: 0.95,
553
- active: 0.95
554
- },
555
- medium: {
556
- hover: 1.05
557
- }
547
+ height: {
548
+ default: 40,
549
+ medium: 48
558
550
  },
551
+ maxHeight: 48,
559
552
  icon: {
560
553
  medium: {
561
554
  size: 24
@@ -788,23 +781,35 @@ const choices = {
788
781
  column: 12
789
782
  },
790
783
  item: {
791
- borderRadius: 10,
784
+ borderRadius: 4,
792
785
  padding: {
793
786
  base: 16,
794
787
  small: 24
795
788
  },
796
789
  backgroundColor: {
797
790
  default: deepPurpleColorPalette['beige.1'],
798
- disabled: colors.disabled,
799
- selected: colors.primary,
800
- pressed: deepPurpleColorPalette['deepPurple.7'],
791
+ disabled: deepPurpleColorPalette['grey.1'],
792
+ selected: deepPurpleColorPalette['beige.3'],
793
+ pressed: deepPurpleColorPalette['beige.2'],
801
794
  hover: deepPurpleColorPalette['beige.2'],
802
- hoverWhenSelected: deepPurpleColorPalette['deepPurple.7']
795
+ hoverWhenSelected: deepPurpleColorPalette['beige.3']
803
796
  },
804
- disabled: {
805
- border: {
806
- width: 2,
807
- color: deepPurpleColorPalette['beige.2']
797
+ color: {
798
+ default: deepPurpleColorPalette['grey.9'],
799
+ disabled: deepPurpleColorPalette['grey.3']
800
+ },
801
+ border: {
802
+ default: {
803
+ width: 1,
804
+ color: deepPurpleColorPalette['deepPurple.7']
805
+ },
806
+ disabled: {
807
+ width: 1,
808
+ color: deepPurpleColorPalette['grey.2']
809
+ },
810
+ error: {
811
+ width: 1,
812
+ color: deepPurpleColorPalette['red.6']
808
813
  }
809
814
  },
810
815
  transition: {
@@ -812,6 +817,12 @@ const choices = {
812
817
  duration: 300,
813
818
  timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
814
819
  }
820
+ },
821
+ description: {
822
+ color: {
823
+ default: deepPurpleColorPalette['grey.5'],
824
+ error: deepPurpleColorPalette['red.6']
825
+ }
815
826
  }
816
827
  };
817
828
 
@@ -1881,50 +1892,8 @@ const icon = {
1881
1892
  };
1882
1893
 
1883
1894
  const iconButton = {
1884
- backgroundColor: 'transparent',
1885
- width: 40,
1886
- height: 40,
1887
- borderRadius: 20,
1888
- borderWidth: 2,
1889
- borderColor: 'transparent',
1890
- transition: {
1891
- property: 'all',
1892
- duration: '200ms',
1893
- timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
1894
- },
1895
- scale: {
1896
- base: {
1897
- default: 1,
1898
- hover: 0.95,
1899
- active: 0.95
1900
- },
1901
- medium: {
1902
- default: 1,
1903
- hover: 1.05,
1904
- active: 0.95
1905
- }
1906
- },
1907
- disabled: {
1908
- scale: 1,
1909
- backgroundColor: button.primary.default.backgroundColor.disabled
1910
- },
1911
- default: {
1912
- pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1913
- },
1914
- ghost: {
1915
- pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1916
- },
1917
- primary: {
1918
- pressedBackgroundColor: deepPurpleColorPalette['beige.1']
1919
- },
1920
- 'primary-plain': {
1921
- pressedBackgroundColor: colors.primaryLight,
1922
- backgroundColor: colors.primary
1923
- },
1924
- secondary: {
1925
- pressedBackgroundColor: 'rgba(0, 0, 0, 0.05)',
1926
- backgroundColor: 'rgba(0, 0, 0, 0.1)'
1927
- }
1895
+ width: button.height.medium,
1896
+ height: button.height.medium
1928
1897
  };
1929
1898
 
1930
1899
  const listItem = {
@@ -2128,6 +2097,11 @@ const typography = {
2128
2097
  fontSize: 14,
2129
2098
  lineHeight: 20,
2130
2099
  allowedFontWeights: ['semibold']
2100
+ },
2101
+ 'label-small': {
2102
+ fontSize: 12,
2103
+ lineHeight: 16,
2104
+ allowedFontWeights: ['semibold']
2131
2105
  }
2132
2106
  }
2133
2107
  },
@@ -2823,23 +2797,6 @@ function getCurrentBackgroundColorForNativeBaseTheme({
2823
2797
  return `${baseKey}.default`;
2824
2798
  }
2825
2799
 
2826
- function getCurrentScale$1({
2827
- hoverScaleValue,
2828
- pressedScaleValue,
2829
- isDisabled,
2830
- isHovered,
2831
- isPressed
2832
- }) {
2833
- if (isDisabled) return 1;
2834
- if (isPressed) {
2835
- return pressedScaleValue;
2836
- }
2837
- if (isHovered) {
2838
- return hoverScaleValue;
2839
- }
2840
- return 1;
2841
- }
2842
-
2843
2800
  function AnimatedContainer$2({
2844
2801
  children,
2845
2802
  type,
@@ -2847,27 +2804,19 @@ function AnimatedContainer$2({
2847
2804
  isHovered,
2848
2805
  isPressed,
2849
2806
  isStretch,
2850
- disabled
2807
+ disabled,
2808
+ isIconOnly,
2809
+ size = 'default'
2851
2810
  }) {
2852
2811
  const theme = useTheme();
2812
+ const width = isIconOnly ? `kitt.button.height.${size}` : createResponsiveStyleFromProp(isStretch, '100%', 'auto');
2813
+ const height = isIconOnly ? `kitt.button.height.${size}` : undefined;
2853
2814
  const {
2854
2815
  transition: {
2855
2816
  duration,
2856
2817
  timingFunction
2857
- },
2858
- scale
2818
+ }
2859
2819
  } = theme.kitt.button;
2860
- const responsiveHoverScaleValue = useBreakpointValue({
2861
- base: scale.base.hover,
2862
- medium: scale.medium.hover
2863
- });
2864
- const currentScale = getCurrentScale$1({
2865
- hoverScaleValue: responsiveHoverScaleValue,
2866
- pressedScaleValue: scale.base.active,
2867
- isHovered,
2868
- isPressed,
2869
- isDisabled: !!disabled
2870
- });
2871
2820
  const currentBackgroundColor = getCurrentBackgroundColorForNativeBaseTheme({
2872
2821
  type,
2873
2822
  variant,
@@ -2880,13 +2829,11 @@ function AnimatedContainer$2({
2880
2829
  style: {
2881
2830
  transitionProperty: 'all',
2882
2831
  transitionDuration: duration,
2883
- transitionTimingFunction: timingFunction,
2884
- /* Simplifies the animation to just the front of the object – avoid blurry scale */
2885
- backfaceVisibility: 'hidden',
2886
- transform: `scale(${currentScale})`
2832
+ transitionTimingFunction: timingFunction
2887
2833
  }
2888
2834
  },
2889
- width: createResponsiveStyleFromProp(isStretch, '100%', 'auto'),
2835
+ width: width,
2836
+ height: height,
2890
2837
  alignSelf: "baseline",
2891
2838
  borderRadius: "kitt.button.borderRadius",
2892
2839
  backgroundColor: currentBackgroundColor,
@@ -3171,7 +3118,7 @@ function ButtonBadge({
3171
3118
  backgroundColor: backgroundColor,
3172
3119
  borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3173
3120
  children: /*#__PURE__*/jsx(Typography.Text, {
3174
- base: "body-xs",
3121
+ base: "content-caps-xs",
3175
3122
  variant: "bold",
3176
3123
  color: "white",
3177
3124
  children: (badgeCount || 0) > 5 ? '+5' : badgeCount
@@ -3293,10 +3240,34 @@ function ButtonContentChildren({
3293
3240
  throw new Error('kitt(Button): You should provide at least a children or a icon');
3294
3241
  }
3295
3242
  }
3243
+ const isMedium = size === 'medium';
3296
3244
  if (!children && icon) {
3297
- return /*#__PURE__*/jsx(TypographyIcon, {
3298
- icon: icon,
3299
- color: color
3245
+ return /*#__PURE__*/jsxs(View, {
3246
+ alignItems: "center",
3247
+ justifyContent: "center",
3248
+ children: [/*#__PURE__*/jsx(TypographyIcon, {
3249
+ icon: icon,
3250
+ color: color,
3251
+ size: `kitt.button.icon.${size}.size`
3252
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3253
+ position: "absolute",
3254
+ top: (() => {
3255
+ if (withBadge) {
3256
+ return isMedium ? '-14px' : '-10px';
3257
+ }
3258
+ return isMedium ? '-20px' : '-16px';
3259
+ })(),
3260
+ right: (() => {
3261
+ if (withBadge) {
3262
+ return isMedium ? '-28px' : '-20px';
3263
+ }
3264
+ return isMedium ? '-33px' : '-25px';
3265
+ })(),
3266
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3267
+ withBadge: withBadge,
3268
+ badgeCount: badgeCount
3269
+ })
3270
+ }) : null]
3300
3271
  });
3301
3272
  }
3302
3273
  // Make the multilines case work properly on native - Breaks the web implem
@@ -3377,16 +3348,16 @@ function ButtonContent({
3377
3348
  function ButtonPadding({
3378
3349
  children,
3379
3350
  size,
3380
- hasBadge
3351
+ isIconOnly
3381
3352
  }) {
3382
3353
  return /*#__PURE__*/jsx(View, {
3383
3354
  position: "relative",
3384
3355
  flexDirection: "row",
3385
3356
  alignItems: "center",
3386
3357
  justifyContent: "center",
3358
+ height: isIconOnly ? `kitt.button.height.${size}` : undefined,
3387
3359
  paddingX: `kitt.button.padding.${size}.horizontal`,
3388
3360
  paddingY: `kitt.button.padding.${size}.vertical`,
3389
- minHeight: "kitt.button.minHeight",
3390
3361
  children: children
3391
3362
  });
3392
3363
  }
@@ -3424,7 +3395,7 @@ function FocusBorder({
3424
3395
  });
3425
3396
  }
3426
3397
 
3427
- function useNativeAnimation$5() {
3398
+ function useNativeAnimation$4() {
3428
3399
  return {
3429
3400
  onPressIn: undefined,
3430
3401
  onPressOut: undefined,
@@ -3461,10 +3432,11 @@ const Button = /*#__PURE__*/forwardRef(({
3461
3432
  onPressIn,
3462
3433
  onPressOut,
3463
3434
  animatedStyles
3464
- } = useNativeAnimation$5();
3435
+ } = useNativeAnimation$4();
3465
3436
  if (process.env.NODE_ENV !== 'production' && variant === 'revert' && type === 'tertiary-danger') {
3466
3437
  throw new Error('Invalid revert variant for tertiary-danger button type. Only default variant is allowed.');
3467
3438
  }
3439
+ const isIconOnly = !children && !!icon;
3468
3440
  return /*#__PURE__*/jsx(Pressable, {
3469
3441
  ref: ref,
3470
3442
  disabled: disabled,
@@ -3496,10 +3468,12 @@ const Button = /*#__PURE__*/forwardRef(({
3496
3468
  isPressed: isPressed || isPressedInternal,
3497
3469
  disabled: !!disabled,
3498
3470
  variant: variant,
3471
+ size: size,
3472
+ isIconOnly: isIconOnly,
3499
3473
  isStretch: stretch,
3500
3474
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3501
3475
  size: size,
3502
- hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3476
+ isIconOnly: isIconOnly,
3503
3477
  children: [/*#__PURE__*/jsx(ButtonContent, {
3504
3478
  type: type,
3505
3479
  variant: variant,
@@ -4178,7 +4152,7 @@ CardModal.Header = CardModalHeader;
4178
4152
  CardModal.Footer = CardModalFooter;
4179
4153
  CardModal.ModalBehaviour = CardModalBehaviour;
4180
4154
 
4181
- function getBackgroundColor$6({
4155
+ function getBackgroundColor$5({
4182
4156
  isDisabled,
4183
4157
  isSelected,
4184
4158
  isHovered,
@@ -4192,39 +4166,49 @@ function getBackgroundColor$6({
4192
4166
  return 'kitt.choices.item.default.backgroundColor';
4193
4167
  }
4194
4168
 
4195
- function getBorderRadius(variant) {
4196
- // The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
4197
- // We don't control over the height of the rendered children we just go with a arbitrary really high value
4198
- return variant === 'rounded' ? Number.MAX_SAFE_INTEGER : 'kitt.choices.item.borderRadius';
4169
+ function getBorderColor$2({
4170
+ isDisabled,
4171
+ hasError,
4172
+ isSelected
4173
+ }) {
4174
+ if (isDisabled) {
4175
+ return 'kitt.choices.item.disabled.borderColor';
4176
+ }
4177
+ if (hasError) {
4178
+ return 'kitt.choices.item.error.borderColor';
4179
+ }
4180
+ if (isSelected) {
4181
+ return 'kitt.choices.item.default.borderColor';
4182
+ }
4183
+ return 'transparent';
4199
4184
  }
4200
4185
 
4201
4186
  function AnimatedChoiceItemView({
4202
4187
  children,
4203
- variant,
4204
4188
  size,
4205
4189
  isHovered,
4206
4190
  isPressed,
4207
4191
  isDisabled,
4208
- isSelected
4192
+ isSelected,
4193
+ hasError
4209
4194
  }) {
4210
4195
  const theme = useTheme();
4211
4196
  return /*#__PURE__*/jsx(View, {
4212
4197
  position: "relative",
4213
- borderRadius: getBorderRadius(variant),
4214
- backgroundColor: getBackgroundColor$6({
4198
+ borderRadius: "kitt.choices.item.borderRadius",
4199
+ borderWidth: "kitt.choices.item.default.borderWidth",
4200
+ borderColor: getBorderColor$2({
4201
+ isDisabled,
4202
+ hasError,
4203
+ isSelected
4204
+ }),
4205
+ backgroundColor: getBackgroundColor$5({
4215
4206
  isDisabled,
4216
4207
  isSelected,
4217
4208
  isHovered,
4218
4209
  isPressed
4219
4210
  }),
4220
- paddingX: size === 'small' ? 'kitt.4' : {
4221
- base: 'kitt.4',
4222
- small: 'kitt.6'
4223
- },
4224
- paddingY: size === 'small' ? 'kitt.2' : {
4225
- base: 'kitt.4',
4226
- small: 'kitt.6'
4227
- },
4211
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4',
4228
4212
  _web: {
4229
4213
  style: {
4230
4214
  transitionProperty: theme.kitt.choices.item.transition.property,
@@ -4236,7 +4220,7 @@ function AnimatedChoiceItemView({
4236
4220
  });
4237
4221
  }
4238
4222
 
4239
- const useNativeAnimation$4 = () => {
4223
+ const useNativeAnimation$3 = () => {
4240
4224
  return {
4241
4225
  onPressIn: () => {},
4242
4226
  onPressOut: () => {},
@@ -4245,23 +4229,21 @@ const useNativeAnimation$4 = () => {
4245
4229
  };
4246
4230
 
4247
4231
  function getCurrentTextColor$1({
4248
- isDisabled,
4249
- isSelected,
4250
- isPressed,
4251
- isHovered
4232
+ isDisabled
4252
4233
  }) {
4253
- if (isDisabled) return 'black-light';
4254
- if (isSelected && isHovered) return 'white';
4255
- if (isSelected || isPressed) return 'white';
4256
- return 'black';
4234
+ if (isDisabled) return 'kitt.choices.item.disabled.color';
4235
+ return 'kitt.choices.item.default.color';
4257
4236
  }
4258
4237
 
4259
4238
  function ChoiceItem({
4260
4239
  type = 'button',
4240
+ orientation = 'horizontal',
4241
+ icon,
4242
+ hasError,
4243
+ description,
4261
4244
  value,
4262
4245
  selected,
4263
4246
  disabled,
4264
- variant,
4265
4247
  children,
4266
4248
  isPressedInternal,
4267
4249
  isHoveredInternal,
@@ -4277,7 +4259,8 @@ function ChoiceItem({
4277
4259
  onPressIn,
4278
4260
  onPressOut,
4279
4261
  backgroundStyles
4280
- } = useNativeAnimation$4();
4262
+ } = useNativeAnimation$3();
4263
+ const Stack = orientation === 'horizontal' ? HStack : VStack;
4281
4264
  const handleChange = () => {
4282
4265
  if (!onChange) return;
4283
4266
 
@@ -4309,33 +4292,45 @@ function ChoiceItem({
4309
4292
  children: ({
4310
4293
  isHovered,
4311
4294
  isPressed
4312
- }) => /*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4313
- animatedStyles: backgroundStyles,
4314
- isHovered: isHovered || isHoveredInternal,
4315
- isDisabled: disabled,
4316
- isSelected: selected,
4317
- isPressed: isPressed || isPressedInternal,
4318
- variant: variant,
4319
- size: size,
4320
- children: [/*#__PURE__*/jsx(Typography.SetDefaultColor, {
4321
- value: getCurrentTextColor$1({
4295
+ }) => {
4296
+ const textColor = getCurrentTextColor$1({
4297
+ isDisabled: disabled
4298
+ });
4299
+ return /*#__PURE__*/jsxs(VStack, {
4300
+ space: "kitt.2",
4301
+ children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4302
+ animatedStyles: backgroundStyles,
4303
+ isHovered: isHovered || isHoveredInternal,
4322
4304
  isDisabled: disabled,
4323
- isSelected: selected || isPressedInternal,
4324
- isPressed,
4325
- isHovered: isHovered || isHoveredInternal
4326
- }),
4327
- children: children
4328
- }), disabled ? /*#__PURE__*/jsx(View, {
4329
- borderRadius: getBorderRadius(variant),
4330
- borderWidth: "kitt.choices.item.disabled.borderWidth",
4331
- borderColor: "kitt.choices.item.disabled.borderColor",
4332
- position: "absolute",
4333
- top: "0",
4334
- right: "0",
4335
- left: "0",
4336
- bottom: "0"
4337
- }) : null]
4338
- })
4305
+ isSelected: selected,
4306
+ isPressed: isPressed || isPressedInternal,
4307
+ hasError: hasError,
4308
+ size: size,
4309
+ children: [/*#__PURE__*/jsxs(Stack, {
4310
+ alignItems: "center",
4311
+ space: "kitt.2",
4312
+ children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4313
+ color: textColor,
4314
+ icon: icon
4315
+ }) : null, /*#__PURE__*/jsx(Typography.SetDefaultColor, {
4316
+ value: textColor,
4317
+ children: children
4318
+ })]
4319
+ }), disabled ? /*#__PURE__*/jsx(View, {
4320
+ borderRadius: "kitt.choices.item.borderRadius",
4321
+ position: "absolute",
4322
+ top: "0",
4323
+ right: "0",
4324
+ left: "0",
4325
+ bottom: "0"
4326
+ }) : null]
4327
+ }), description ? /*#__PURE__*/jsx(Typography.Text, {
4328
+ base: "body-s",
4329
+ color: hasError ? 'kitt.choices.description.color.error' : 'kitt.choices.description.color.default',
4330
+ children: description
4331
+ }) : null]
4332
+ });
4333
+ }
4339
4334
  });
4340
4335
  }
4341
4336
 
@@ -4385,7 +4380,6 @@ function Choices({
4385
4380
  disabled,
4386
4381
  children,
4387
4382
  value,
4388
- variant,
4389
4383
  onPress,
4390
4384
  onChange,
4391
4385
  onFocus,
@@ -4400,7 +4394,6 @@ function Choices({
4400
4394
  const sharedProps = {
4401
4395
  type,
4402
4396
  disabled,
4403
- variant,
4404
4397
  onPress: !isForm ? onPress : undefined,
4405
4398
  onChange: isForm ? newValue => {
4406
4399
  setCurrentValue(newValue);
@@ -4834,7 +4827,7 @@ const InputText = /*#__PURE__*/forwardRef(({
4834
4827
  });
4835
4828
  });
4836
4829
 
4837
- function getBackgroundColor$5({
4830
+ function getBackgroundColor$4({
4838
4831
  isSelected,
4839
4832
  isHighlighted,
4840
4833
  isPressed,
@@ -4873,7 +4866,7 @@ function AutocompleteItem({
4873
4866
  minHeight: "kitt.forms.autocomplete.option.minHeight",
4874
4867
  borderRadius: "kitt.1",
4875
4868
  padding: "kitt.1",
4876
- backgroundColor: getBackgroundColor$5({
4869
+ backgroundColor: getBackgroundColor$4({
4877
4870
  isSelected,
4878
4871
  isHighlighted,
4879
4872
  isPressed,
@@ -5153,7 +5146,7 @@ const SvgCheckboxMarkinline = props => /*#__PURE__*/jsx("svg", {
5153
5146
  })
5154
5147
  });
5155
5148
 
5156
- function getBackgroundColor$4({
5149
+ function getBackgroundColor$3({
5157
5150
  isDisabled,
5158
5151
  isPressed,
5159
5152
  isHovered,
@@ -5232,7 +5225,7 @@ const Checkbox = /*#__PURE__*/forwardRef(({
5232
5225
  isPressed,
5233
5226
  isChecked: checked
5234
5227
  }),
5235
- backgroundColor: getBackgroundColor$4({
5228
+ backgroundColor: getBackgroundColor$3({
5236
5229
  isDisabled: disabled,
5237
5230
  isFocused,
5238
5231
  isHovered,
@@ -6422,7 +6415,7 @@ function InnerCircle({
6422
6415
  });
6423
6416
  }
6424
6417
 
6425
- function getBackgroundColor$3({
6418
+ function getBackgroundColor$2({
6426
6419
  isDisabled,
6427
6420
  isPressed,
6428
6421
  isHovered,
@@ -6468,7 +6461,7 @@ function OuterCircle({
6468
6461
  width: "kitt.forms.radio.size",
6469
6462
  height: "kitt.forms.radio.size",
6470
6463
  borderRadius: "kitt.forms.radio.borderRadius",
6471
- backgroundColor: getBackgroundColor$3({
6464
+ backgroundColor: getBackgroundColor$2({
6472
6465
  isChecked,
6473
6466
  isDisabled,
6474
6467
  isFocused,
@@ -6651,7 +6644,7 @@ function HoverBorder({
6651
6644
  });
6652
6645
  }
6653
6646
 
6654
- function useNativeAnimation$3() {
6647
+ function useNativeAnimation$2() {
6655
6648
  return {
6656
6649
  onPressIn: undefined,
6657
6650
  onPressOut: undefined,
@@ -6693,7 +6686,7 @@ function RadioButton({
6693
6686
  onPressIn,
6694
6687
  onPressOut,
6695
6688
  animatedStyles
6696
- } = useNativeAnimation$3();
6689
+ } = useNativeAnimation$2();
6697
6690
  return /*#__PURE__*/jsx(Pressable, {
6698
6691
  accessibilityRole: "radiogroup",
6699
6692
  accessibilityState: {
@@ -7367,7 +7360,7 @@ function AnimatedContent({
7367
7360
  });
7368
7361
  }
7369
7362
 
7370
- function useNativeAnimation$2() {
7363
+ function useNativeAnimation$1() {
7371
7364
  return {
7372
7365
  onPressIn: undefined,
7373
7366
  onPressOut: undefined,
@@ -7408,7 +7401,7 @@ function Highlight({
7408
7401
  contentAnimatedStyles,
7409
7402
  onPressIn,
7410
7403
  onPressOut
7411
- } = useNativeAnimation$2();
7404
+ } = useNativeAnimation$1();
7412
7405
  const handleLayout = event => {
7413
7406
  const layoutHeight = event.nativeEvent.layout.height;
7414
7407
  const newContentHeight = layoutHeight + highlightStyle[size].contentMarginY;
@@ -7503,236 +7496,53 @@ function Highlight({
7503
7496
  });
7504
7497
  }
7505
7498
 
7506
- function getBackgroundColor$2(color, isDisabled) {
7507
- if (isDisabled) {
7508
- return 'kitt.iconButton.disabled.backgroundColor';
7509
- }
7510
- switch (color) {
7511
- case 'primary':
7512
- return 'kitt.iconButton.primary.pressed.backgroundColor';
7513
- case 'primary-plain':
7514
- return 'kitt.iconButton.primary-plain.pressed.backgroundColor';
7515
- case 'ghost':
7516
- return 'kitt.iconButton.ghost.pressed.backgroundColor';
7499
+ const getButtonTypeAndVariant = iconColor => {
7500
+ switch (iconColor) {
7517
7501
  case 'black':
7518
- default:
7519
- return 'kitt.iconButton.black.pressed.backgroundColor';
7520
- }
7521
- }
7522
- function Background({
7523
- color,
7524
- isDisabled,
7525
- ...props
7526
- }) {
7527
- return /*#__PURE__*/jsx(View, {
7528
- ...props,
7529
- width: "100%",
7530
- height: "100%",
7531
- borderRadius: "kitt.iconButton.borderRadius",
7532
- backgroundColor: getBackgroundColor$2(color, isDisabled)
7533
- });
7534
- }
7535
-
7536
- function AnimatedBackground({
7537
- color,
7538
- isHovered,
7539
- isPressed,
7540
- isFocused,
7541
- isDisabled
7542
- }) {
7543
- const theme = useTheme();
7544
- const {
7545
- duration,
7546
- timingFunction
7547
- } = theme.kitt.iconButton.transition;
7548
- return /*#__PURE__*/jsx(Background, {
7549
- position: "absolute",
7550
- top: "0",
7551
- left: "0",
7552
- opacity: isHovered || isPressed || isFocused || isDisabled ? 1 : 0,
7553
- color: color,
7554
- isDisabled: isDisabled,
7555
- _web: {
7556
- style: {
7557
- transitionProperty: 'all',
7558
- transitionDuration: duration,
7559
- transitionTimingFunction: timingFunction
7560
- }
7561
- }
7562
- });
7563
- }
7564
-
7565
- function getCurrentScale(isHovered, scaleHover, isPressed, scalePressed) {
7566
- if (isPressed) {
7567
- return scalePressed;
7568
- }
7569
- if (isHovered) {
7570
- return scaleHover;
7571
- }
7572
- return 1;
7573
- }
7574
- function AnimatedScale({
7575
- children,
7576
- isHovered,
7577
- isPressed,
7578
- isDisabled
7579
- }) {
7580
- const theme = useTheme();
7581
- const {
7582
- scale
7583
- } = theme.kitt.iconButton;
7584
- const currentHoverScale = useBreakpointValue({
7585
- base: scale.base.hover,
7586
- medium: scale.medium.hover
7587
- });
7588
- const currentPressedScale = useBreakpointValue({
7589
- base: scale.base.active,
7590
- medium: scale.medium.active
7591
- });
7592
- const currentScale = getCurrentScale(Boolean(isHovered), currentHoverScale, Boolean(isPressed), currentPressedScale);
7593
- const {
7594
- duration,
7595
- timingFunction
7596
- } = theme.kitt.iconButton.transition;
7597
- return /*#__PURE__*/jsx(View, {
7598
- position: "relative",
7599
- alignItems: "center",
7600
- justifyContent: "center",
7601
- width: "100%",
7602
- height: "100%",
7603
- overflow: "hidden",
7604
- _web: {
7605
- style: {
7606
- transitionProperty: 'transform',
7607
- transitionDuration: duration,
7608
- transitionTimingFunction: timingFunction,
7609
- /* Simplifies the animation to just the front of the object – avoid blurry scale */
7610
- backfaceVisibility: 'hidden',
7611
- transform: `scale(${isDisabled ? 1 : currentScale})`
7612
- }
7613
- },
7614
- children: children
7615
- });
7616
- }
7617
-
7618
- function useNativeAnimation$1() {
7619
- return {
7620
- opacityStyles: undefined,
7621
- scaleStyles: undefined,
7622
- onPressIn: () => {},
7623
- onPressOut: () => {}
7624
- };
7625
- }
7626
-
7627
- const getIconButtonBackgroundColor = (color, disabled) => {
7628
- if (disabled) {
7629
- return undefined;
7630
- }
7631
- switch (color) {
7632
- case 'primary-plain':
7633
- return 'kitt.iconButton.primary-plain.backgroundColor';
7502
+ return {
7503
+ type: 'tertiary'
7504
+ };
7634
7505
  case 'secondary':
7635
- return 'kitt.iconButton.secondary.backgroundColor';
7636
- default:
7637
- return undefined;
7638
- }
7639
- };
7640
-
7641
- const getIconButtonTextColorByColor = (color, disabled) => {
7642
- if (disabled) {
7643
- return 'black-light';
7644
- }
7645
- switch (color) {
7646
- case 'ghost':
7647
- return 'white';
7506
+ return {
7507
+ type: 'secondary'
7508
+ };
7509
+ case 'primary':
7510
+ return {
7511
+ type: 'primary'
7512
+ };
7648
7513
  case 'primary-plain':
7649
- return 'white';
7650
- case 'secondary':
7651
- return 'black';
7514
+ return {
7515
+ type: 'primary'
7516
+ };
7517
+ case 'ghost':
7518
+ return {
7519
+ type: 'tertiary',
7520
+ variant: 'revert'
7521
+ };
7652
7522
  default:
7653
- return color;
7523
+ return {
7524
+ type: 'secondary'
7525
+ };
7654
7526
  }
7655
7527
  };
7656
7528
 
7529
+ /**
7530
+ * @deprecated IconButton should only be used as a navigation button
7531
+ * Other use cases should use a <Button> component with an icon
7532
+ */
7657
7533
  function IconButton({
7658
- icon,
7659
7534
  color = 'black',
7660
- disabled,
7661
- testID,
7662
7535
  ariaLabel,
7663
- accessibilityRole = 'button',
7664
- withBadge,
7665
- badgeCount,
7666
- isHoveredInternal,
7667
- isPressedInternal,
7668
- isFocusedInternal,
7669
- onPress
7536
+ ...props
7670
7537
  }) {
7671
7538
  const {
7672
- onPressIn,
7673
- onPressOut,
7674
- opacityStyles,
7675
- scaleStyles
7676
- } = useNativeAnimation$1();
7677
- return /*#__PURE__*/jsx(Pressable, {
7678
- testID: testID,
7679
- disabled: disabled,
7680
- width: "kitt.iconButton.width",
7681
- height: "kitt.iconButton.height",
7682
- "aria-label": ariaLabel,
7683
- accessibilityRole: accessibilityRole,
7684
- _web: {
7685
- style: {
7686
- backfaceVisibility: 'hidden',
7687
- transform: 'translate3d(0px)'
7688
- }
7689
- },
7690
- backgroundColor: getIconButtonBackgroundColor(color, disabled),
7691
- borderRadius: "kitt.iconButton.borderRadius",
7692
- borderColor: disabled ? 'kitt.iconButton.disabled.borderColor' : 'kitt.iconButton.borderColor',
7693
- borderWidth: disabled ? 'kitt.iconButton.borderWidth' : 0,
7694
- onPress: onPress,
7695
- onPressIn: onPressIn,
7696
- onPressOut: onPressOut,
7697
- children: ({
7698
- isHovered,
7699
- isPressed,
7700
- isFocused
7701
- }) => {
7702
- const isCurrentHovered = isHovered || isHoveredInternal;
7703
- const isCurrentPressed = isPressed || isPressedInternal;
7704
- return /*#__PURE__*/jsxs(Fragment, {
7705
- children: [/*#__PURE__*/jsxs(AnimatedScale, {
7706
- isDisabled: disabled,
7707
- isHovered: isCurrentHovered,
7708
- isPressed: isCurrentPressed,
7709
- scaleStyles: scaleStyles,
7710
- children: [/*#__PURE__*/jsx(AnimatedBackground, {
7711
- color: color,
7712
- isDisabled: disabled,
7713
- isHovered: isCurrentHovered,
7714
- isPressed: isCurrentPressed,
7715
- isFocused: isFocused || isFocusedInternal,
7716
- opacityStyles: opacityStyles
7717
- }), /*#__PURE__*/jsx(View, {
7718
- alignItems: "center",
7719
- justifyContent: "center",
7720
- children: /*#__PURE__*/jsx(TypographyIcon, {
7721
- color: getIconButtonTextColorByColor(color, disabled),
7722
- icon: icon
7723
- })
7724
- })]
7725
- }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
7726
- position: "absolute",
7727
- top: withBadge ? '1px' : '-6px',
7728
- right: withBadge ? '1px' : '-6px',
7729
- children: /*#__PURE__*/jsx(ButtonBadge, {
7730
- withBadge: withBadge,
7731
- badgeCount: badgeCount
7732
- })
7733
- }) : null]
7734
- });
7735
- }
7539
+ type: legacyColorToType,
7540
+ variant: legacyColorToVariant
7541
+ } = getButtonTypeAndVariant(color);
7542
+ return /*#__PURE__*/jsx(Button, {
7543
+ variant: legacyColorToVariant,
7544
+ type: legacyColorToType,
7545
+ ...props
7736
7546
  });
7737
7547
  }
7738
7548
  function CloseIconButton(props) {
@@ -8389,11 +8199,17 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8389
8199
  choices: {
8390
8200
  item: {
8391
8201
  default: {
8392
- backgroundColor: theme.choices.item.backgroundColor.default
8202
+ backgroundColor: theme.choices.item.backgroundColor.default,
8203
+ borderColor: theme.choices.item.border.default.color,
8204
+ color: theme.choices.item.color.default
8393
8205
  },
8394
8206
  disabled: {
8395
8207
  backgroundColor: theme.choices.item.backgroundColor.disabled,
8396
- borderColor: theme.choices.item.disabled.border.color
8208
+ borderColor: theme.choices.item.border.disabled.color,
8209
+ color: theme.choices.item.color.disabled
8210
+ },
8211
+ error: {
8212
+ borderColor: theme.choices.item.border.error.color
8397
8213
  },
8398
8214
  selected: {
8399
8215
  backgroundColor: theme.choices.item.backgroundColor.selected
@@ -8407,6 +8223,12 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8407
8223
  hoverWhenSelected: {
8408
8224
  backgroundColor: theme.choices.item.backgroundColor.hoverWhenSelected
8409
8225
  }
8226
+ },
8227
+ description: {
8228
+ color: {
8229
+ default: theme.choices.description.color.default,
8230
+ error: theme.choices.description.color.error
8231
+ }
8410
8232
  }
8411
8233
  },
8412
8234
  tooltip: {
@@ -8810,39 +8632,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
8810
8632
  buttonBadge: {
8811
8633
  backgroundColor: theme.buttonBadge.backgroundColor
8812
8634
  },
8813
- iconButton: {
8814
- borderColor: theme.iconButton.borderColor,
8815
- disabled: {
8816
- backgroundColor: theme.iconButton.disabled.backgroundColor
8817
- },
8818
- black: {
8819
- pressed: {
8820
- backgroundColor: theme.iconButton.default.pressedBackgroundColor
8821
- }
8822
- },
8823
- ghost: {
8824
- pressed: {
8825
- backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
8826
- }
8827
- },
8828
- primary: {
8829
- pressed: {
8830
- backgroundColor: theme.iconButton.primary.pressedBackgroundColor
8831
- }
8832
- },
8833
- 'primary-plain': {
8834
- pressed: {
8835
- backgroundColor: theme.iconButton['primary-plain'].pressedBackgroundColor
8836
- },
8837
- backgroundColor: theme.iconButton['primary-plain'].backgroundColor
8838
- },
8839
- secondary: {
8840
- pressed: {
8841
- backgroundColor: theme.iconButton.secondary.pressedBackgroundColor
8842
- },
8843
- backgroundColor: theme.iconButton.secondary.backgroundColor
8844
- }
8845
- },
8846
8635
  highlight: {
8847
8636
  regular: {
8848
8637
  default: {
@@ -9044,9 +8833,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9044
8833
  highlight: {
9045
8834
  borderRadius: theme.highlight.borderRadius
9046
8835
  },
9047
- iconButton: {
9048
- borderRadius: theme.iconButton.borderRadius
9049
- },
9050
8836
  tag: {
9051
8837
  borderRadius: theme.tag.borderRadius
9052
8838
  },
@@ -9170,14 +8956,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9170
8956
  },
9171
8957
  choices: {
9172
8958
  item: {
9173
- disabled: {
9174
- borderWidth: theme.choices.item.disabled.border.width
8959
+ default: {
8960
+ borderWidth: theme.choices.item.border.default.width
9175
8961
  }
9176
8962
  }
9177
8963
  },
9178
- iconButton: {
9179
- borderWidth: theme.iconButton.borderWidth
9180
- },
9181
8964
  forms: {
9182
8965
  input: {
9183
8966
  borderWidth: theme.forms.input.borderWidth
@@ -9366,8 +9149,10 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9366
9149
  button: {
9367
9150
  minWidth: theme.button.minWidth,
9368
9151
  maxWidth: theme.button.maxWidth,
9369
- minHeight: theme.button.minHeight,
9370
- maxHeight: theme.button.maxHeight,
9152
+ height: {
9153
+ default: theme.button.height.default,
9154
+ medium: theme.button.height.medium
9155
+ },
9371
9156
  icon: {
9372
9157
  default: {
9373
9158
  size: theme.button.icon.default.size
@@ -9695,7 +9480,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9695
9480
  }
9696
9481
  },
9697
9482
  iconButton: {
9698
- size: theme.iconButton.width - theme.iconButton.borderWidth,
9699
9483
  width: theme.iconButton.width,
9700
9484
  height: theme.iconButton.height
9701
9485
  },
@@ -9997,6 +9781,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9997
9781
  'body-xs': `${theme.typography.types.bodies.configs['body-xs'].fontSize}px`,
9998
9782
  'label-large': `${theme.typography.types.labels.configs['label-large'].fontSize}px`,
9999
9783
  'label-medium': `${theme.typography.types.labels.configs['label-medium'].fontSize}px`,
9784
+ 'label-small': `${theme.typography.types.labels.configs['label-small'].fontSize}px`,
10000
9785
  'content-caps-xxxl': `${theme.typography.types.contentCaps.configs['content-caps-xxxl'].fontSize}px`,
10001
9786
  'content-caps-xxl': `${theme.typography.types.contentCaps.configs['content-caps-xxl'].fontSize}px`,
10002
9787
  'content-caps-xl': `${theme.typography.types.contentCaps.configs['content-caps-xl'].fontSize}px`,
@@ -10019,6 +9804,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10019
9804
  'body-xs': `${theme.typography.types.bodies.configs['body-xs'].lineHeight}px`,
10020
9805
  'label-large': `${theme.typography.types.labels.configs['label-large'].lineHeight}px`,
10021
9806
  'label-medium': `${theme.typography.types.labels.configs['label-medium'].lineHeight}px`,
9807
+ 'label-small': `${theme.typography.types.labels.configs['label-small'].lineHeight}px`,
10022
9808
  'content-caps-xxxl': `${theme.typography.types.contentCaps.configs['content-caps-xxxl'].lineHeight}px`,
10023
9809
  'content-caps-xxl': `${theme.typography.types.contentCaps.configs['content-caps-xxl'].lineHeight}px`,
10024
9810
  'content-caps-xl': `${theme.typography.types.contentCaps.configs['content-caps-xl'].lineHeight}px`,