@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
@@ -546,20 +546,13 @@ const button = {
546
546
  borderWidth: {
547
547
  focus: 3
548
548
  },
549
- minHeight: 40,
550
549
  minWidth: 40,
551
550
  maxWidth: 335,
552
- maxHeight: 48,
553
- scale: {
554
- base: {
555
- default: 1,
556
- hover: 0.95,
557
- active: 0.95
558
- },
559
- medium: {
560
- hover: 1.05
561
- }
551
+ height: {
552
+ default: 40,
553
+ medium: 48
562
554
  },
555
+ maxHeight: 48,
563
556
  icon: {
564
557
  medium: {
565
558
  size: 24
@@ -792,23 +785,35 @@ const choices = {
792
785
  column: 12
793
786
  },
794
787
  item: {
795
- borderRadius: 10,
788
+ borderRadius: 4,
796
789
  padding: {
797
790
  base: 16,
798
791
  small: 24
799
792
  },
800
793
  backgroundColor: {
801
794
  default: deepPurpleColorPalette['beige.1'],
802
- disabled: colors.disabled,
803
- selected: colors.primary,
804
- pressed: deepPurpleColorPalette['deepPurple.7'],
795
+ disabled: deepPurpleColorPalette['grey.1'],
796
+ selected: deepPurpleColorPalette['beige.3'],
797
+ pressed: deepPurpleColorPalette['beige.2'],
805
798
  hover: deepPurpleColorPalette['beige.2'],
806
- hoverWhenSelected: deepPurpleColorPalette['deepPurple.7']
799
+ hoverWhenSelected: deepPurpleColorPalette['beige.3']
807
800
  },
808
- disabled: {
809
- border: {
810
- width: 2,
811
- color: deepPurpleColorPalette['beige.2']
801
+ color: {
802
+ default: deepPurpleColorPalette['grey.9'],
803
+ disabled: deepPurpleColorPalette['grey.3']
804
+ },
805
+ border: {
806
+ default: {
807
+ width: 1,
808
+ color: deepPurpleColorPalette['deepPurple.7']
809
+ },
810
+ disabled: {
811
+ width: 1,
812
+ color: deepPurpleColorPalette['grey.2']
813
+ },
814
+ error: {
815
+ width: 1,
816
+ color: deepPurpleColorPalette['red.6']
812
817
  }
813
818
  },
814
819
  transition: {
@@ -816,6 +821,12 @@ const choices = {
816
821
  duration: 300,
817
822
  timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
818
823
  }
824
+ },
825
+ description: {
826
+ color: {
827
+ default: deepPurpleColorPalette['grey.5'],
828
+ error: deepPurpleColorPalette['red.6']
829
+ }
819
830
  }
820
831
  };
821
832
 
@@ -1885,50 +1896,8 @@ const icon = {
1885
1896
  };
1886
1897
 
1887
1898
  const iconButton = {
1888
- backgroundColor: 'transparent',
1889
- width: 40,
1890
- height: 40,
1891
- borderRadius: 20,
1892
- borderWidth: 2,
1893
- borderColor: 'transparent',
1894
- transition: {
1895
- property: 'all',
1896
- duration: '200ms',
1897
- timingFunction: 'cubic-bezier(0.645, 0.045, 0.355, 1)'
1898
- },
1899
- scale: {
1900
- base: {
1901
- default: 1,
1902
- hover: 0.95,
1903
- active: 0.95
1904
- },
1905
- medium: {
1906
- default: 1,
1907
- hover: 1.05,
1908
- active: 0.95
1909
- }
1910
- },
1911
- disabled: {
1912
- scale: 1,
1913
- backgroundColor: button.primary.default.backgroundColor.disabled
1914
- },
1915
- default: {
1916
- pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1917
- },
1918
- ghost: {
1919
- pressedBackgroundColor: button.primary.default.backgroundColor.disabled
1920
- },
1921
- primary: {
1922
- pressedBackgroundColor: deepPurpleColorPalette['beige.1']
1923
- },
1924
- 'primary-plain': {
1925
- pressedBackgroundColor: colors.primaryLight,
1926
- backgroundColor: colors.primary
1927
- },
1928
- secondary: {
1929
- pressedBackgroundColor: 'rgba(0, 0, 0, 0.05)',
1930
- backgroundColor: 'rgba(0, 0, 0, 0.1)'
1931
- }
1899
+ width: button.height.medium,
1900
+ height: button.height.medium
1932
1901
  };
1933
1902
 
1934
1903
  const listItem = {
@@ -2132,6 +2101,11 @@ const typography = {
2132
2101
  fontSize: 14,
2133
2102
  lineHeight: 20,
2134
2103
  allowedFontWeights: ['semibold']
2104
+ },
2105
+ 'label-small': {
2106
+ fontSize: 12,
2107
+ lineHeight: 16,
2108
+ allowedFontWeights: ['semibold']
2135
2109
  }
2136
2110
  }
2137
2111
  },
@@ -2834,6 +2808,8 @@ function AnimatedContainer$2({
2834
2808
  isHovered,
2835
2809
  isPressed,
2836
2810
  variant,
2811
+ size = 'default',
2812
+ isIconOnly,
2837
2813
  type
2838
2814
  }) {
2839
2815
  const currentBackgroundColor = getCurrentBackgroundColorForNativeBaseTheme({
@@ -2843,10 +2819,14 @@ function AnimatedContainer$2({
2843
2819
  isHovered,
2844
2820
  isPressed
2845
2821
  });
2822
+ const width = isIconOnly ? `kitt.button.height.${size}` : undefined;
2823
+ const height = isIconOnly ? `kitt.button.height.${size}` : undefined;
2846
2824
  const sx = useSx();
2847
2825
  const styles = sx({
2848
2826
  borderRadius: 'kitt.button.borderRadius',
2849
- backgroundColor: currentBackgroundColor
2827
+ backgroundColor: currentBackgroundColor,
2828
+ width,
2829
+ height
2850
2830
  });
2851
2831
  return /*#__PURE__*/jsx(Animated.View, {
2852
2832
  style: disabled ? [styles] : [styles, animatedStyles],
@@ -3131,7 +3111,7 @@ function ButtonBadge({
3131
3111
  backgroundColor: backgroundColor,
3132
3112
  borderRadius: "kitt.buttonBadge.borderRadius.badgeCount",
3133
3113
  children: /*#__PURE__*/jsx(Typography.Text, {
3134
- base: "body-xs",
3114
+ base: "content-caps-xs",
3135
3115
  variant: "bold",
3136
3116
  color: "white",
3137
3117
  children: (badgeCount || 0) > 5 ? '+5' : badgeCount
@@ -3253,10 +3233,34 @@ function ButtonContentChildren({
3253
3233
  throw new Error('kitt(Button): You should provide at least a children or a icon');
3254
3234
  }
3255
3235
  }
3236
+ const isMedium = size === 'medium';
3256
3237
  if (!children && icon) {
3257
- return /*#__PURE__*/jsx(TypographyIcon, {
3258
- icon: icon,
3259
- color: color
3238
+ return /*#__PURE__*/jsxs(View, {
3239
+ alignItems: "center",
3240
+ justifyContent: "center",
3241
+ children: [/*#__PURE__*/jsx(TypographyIcon, {
3242
+ icon: icon,
3243
+ color: color,
3244
+ size: `kitt.button.icon.${size}.size`
3245
+ }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
3246
+ position: "absolute",
3247
+ top: (() => {
3248
+ if (withBadge) {
3249
+ return isMedium ? '-14px' : '-10px';
3250
+ }
3251
+ return isMedium ? '-20px' : '-16px';
3252
+ })(),
3253
+ right: (() => {
3254
+ if (withBadge) {
3255
+ return isMedium ? '-28px' : '-20px';
3256
+ }
3257
+ return isMedium ? '-33px' : '-25px';
3258
+ })(),
3259
+ children: /*#__PURE__*/jsx(ButtonBadge, {
3260
+ withBadge: withBadge,
3261
+ badgeCount: badgeCount
3262
+ })
3263
+ }) : null]
3260
3264
  });
3261
3265
  }
3262
3266
  // Make the multilines case work properly on native - Breaks the web implem
@@ -3337,16 +3341,16 @@ function ButtonContent({
3337
3341
  function ButtonPadding({
3338
3342
  children,
3339
3343
  size,
3340
- hasBadge
3344
+ isIconOnly
3341
3345
  }) {
3342
3346
  return /*#__PURE__*/jsx(View, {
3343
3347
  position: "relative",
3344
3348
  flexDirection: "row",
3345
3349
  alignItems: "center",
3346
3350
  justifyContent: "center",
3351
+ height: isIconOnly ? `kitt.button.height.${size}` : undefined,
3347
3352
  paddingX: `kitt.button.padding.${size}.horizontal`,
3348
3353
  paddingY: `kitt.button.padding.${size}.vertical`,
3349
- minHeight: "kitt.button.minHeight",
3350
3354
  children: children
3351
3355
  });
3352
3356
  }
@@ -3384,7 +3388,7 @@ function FocusBorder({
3384
3388
  });
3385
3389
  }
3386
3390
 
3387
- const useNativeAnimation$5 = ({
3391
+ const useNativeAnimation$4 = ({
3388
3392
  type,
3389
3393
  variant,
3390
3394
  isPressedInternal
@@ -3392,15 +3396,9 @@ const useNativeAnimation$5 = ({
3392
3396
  const theme = useTheme();
3393
3397
  const pressed = useSharedValue(isPressedInternal ? 1 : 0);
3394
3398
  const color = useSharedValue(0);
3395
- const {
3396
- scale
3397
- } = theme.kitt.button;
3398
3399
  const animatedStyles = useAnimatedStyle(() => {
3399
3400
  return {
3400
- backgroundColor: interpolateColor(color.value, [0, 1], [type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger'].default.backgroundColor.default : theme.kitt.button[type][variant].backgroundColor.default, type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger'].default.backgroundColor.pressed : theme.kitt.button[type][variant].backgroundColor.pressed]),
3401
- transform: [{
3402
- scale: withSpring(pressed.value ? scale.base.active : scale.base.default)
3403
- }]
3401
+ backgroundColor: interpolateColor(color.value, [0, 1], [type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger'].default.backgroundColor.default : theme.kitt.button[type][variant].backgroundColor.default, type === 'tertiary-danger' ? theme.kitt.button['tertiary-danger'].default.backgroundColor.pressed : theme.kitt.button[type][variant].backgroundColor.pressed])
3404
3402
  };
3405
3403
  });
3406
3404
  return {
@@ -3445,13 +3443,14 @@ const Button = /*#__PURE__*/forwardRef(({
3445
3443
  onPressIn,
3446
3444
  onPressOut,
3447
3445
  animatedStyles
3448
- } = useNativeAnimation$5({
3446
+ } = useNativeAnimation$4({
3449
3447
  type,
3450
3448
  variant
3451
3449
  });
3452
3450
  if (process.env.NODE_ENV !== 'production' && variant === 'revert' && type === 'tertiary-danger') {
3453
3451
  throw new Error('Invalid revert variant for tertiary-danger button type. Only default variant is allowed.');
3454
3452
  }
3453
+ const isIconOnly = !children && !!icon;
3455
3454
  return /*#__PURE__*/jsx(Pressable, {
3456
3455
  ref: ref,
3457
3456
  disabled: disabled,
@@ -3483,10 +3482,12 @@ const Button = /*#__PURE__*/forwardRef(({
3483
3482
  isPressed: isPressed || isPressedInternal,
3484
3483
  disabled: !!disabled,
3485
3484
  variant: variant,
3485
+ size: size,
3486
+ isIconOnly: isIconOnly,
3486
3487
  isStretch: stretch,
3487
3488
  children: /*#__PURE__*/jsxs(ButtonPadding, {
3488
3489
  size: size,
3489
- hasBadge: Boolean(withBadge || badgeCount && badgeCount > 0),
3490
+ isIconOnly: isIconOnly,
3490
3491
  children: [/*#__PURE__*/jsx(ButtonContent, {
3491
3492
  type: type,
3492
3493
  variant: variant,
@@ -4284,7 +4285,7 @@ CardModal.Header = CardModalHeader;
4284
4285
  CardModal.Footer = CardModalFooter;
4285
4286
  CardModal.ModalBehaviour = CardModalBehaviour;
4286
4287
 
4287
- function getBackgroundColor$5({
4288
+ function getBackgroundColor$4({
4288
4289
  isDisabled,
4289
4290
  isSelected,
4290
4291
  isHovered,
@@ -4298,40 +4299,50 @@ function getBackgroundColor$5({
4298
4299
  return 'kitt.choices.item.default.backgroundColor';
4299
4300
  }
4300
4301
 
4301
- function getBorderRadius(variant) {
4302
- // The clean way to have the rounded effect would have been to know the children height since radius >= height * 0.5
4303
- // We don't control over the height of the rendered children we just go with a arbitrary really high value
4304
- return variant === 'rounded' ? Number.MAX_SAFE_INTEGER : 'kitt.choices.item.borderRadius';
4302
+ function getBorderColor$2({
4303
+ isDisabled,
4304
+ hasError,
4305
+ isSelected
4306
+ }) {
4307
+ if (isDisabled) {
4308
+ return 'kitt.choices.item.disabled.borderColor';
4309
+ }
4310
+ if (hasError) {
4311
+ return 'kitt.choices.item.error.borderColor';
4312
+ }
4313
+ if (isSelected) {
4314
+ return 'kitt.choices.item.default.borderColor';
4315
+ }
4316
+ return 'transparent';
4305
4317
  }
4306
4318
 
4307
4319
  function AnimatedChoiceItemView({
4308
4320
  children,
4309
- variant,
4310
4321
  size,
4311
4322
  isHovered,
4312
4323
  isPressed,
4313
4324
  isDisabled,
4314
4325
  isSelected,
4326
+ hasError,
4315
4327
  animatedStyles
4316
4328
  }) {
4317
4329
  const sx = useSx();
4318
4330
  const style = sx({
4319
4331
  position: 'relative',
4320
- borderRadius: getBorderRadius(variant),
4321
- backgroundColor: getBackgroundColor$5({
4332
+ borderRadius: 'kitt.choices.item.borderRadius',
4333
+ borderWidth: 'kitt.choices.item.default.borderWidth',
4334
+ borderColor: getBorderColor$2({
4335
+ isDisabled,
4336
+ hasError,
4337
+ isSelected
4338
+ }),
4339
+ backgroundColor: getBackgroundColor$4({
4322
4340
  isDisabled,
4323
4341
  isSelected,
4324
4342
  isHovered,
4325
4343
  isPressed
4326
4344
  }),
4327
- paddingX: size === 'small' ? 'kitt.4' : {
4328
- base: 'kitt.4',
4329
- small: 'kitt.6'
4330
- },
4331
- paddingY: size === 'small' ? 'kitt.2' : {
4332
- base: 'kitt.4',
4333
- small: 'kitt.6'
4334
- }
4345
+ padding: size === 'small' ? 'kitt.2' : 'kitt.4'
4335
4346
  });
4336
4347
  return /*#__PURE__*/jsx(Animated.View, {
4337
4348
  style: [style, animatedStyles],
@@ -4339,7 +4350,7 @@ function AnimatedChoiceItemView({
4339
4350
  });
4340
4351
  }
4341
4352
 
4342
- const useNativeAnimation$4 = ({
4353
+ const useNativeAnimation$3 = ({
4343
4354
  selected,
4344
4355
  disabled,
4345
4356
  isPressedInternal
@@ -4380,23 +4391,21 @@ const useNativeAnimation$4 = ({
4380
4391
  };
4381
4392
 
4382
4393
  function getCurrentTextColor$1({
4383
- isDisabled,
4384
- isSelected,
4385
- isPressed,
4386
- isHovered
4394
+ isDisabled
4387
4395
  }) {
4388
- if (isDisabled) return 'black-light';
4389
- if (isSelected && isHovered) return 'white';
4390
- if (isSelected || isPressed) return 'white';
4391
- return 'black';
4396
+ if (isDisabled) return 'kitt.choices.item.disabled.color';
4397
+ return 'kitt.choices.item.default.color';
4392
4398
  }
4393
4399
 
4394
4400
  function ChoiceItem({
4395
4401
  type = 'button',
4402
+ orientation = 'horizontal',
4403
+ icon,
4404
+ hasError,
4405
+ description,
4396
4406
  value,
4397
4407
  selected,
4398
4408
  disabled,
4399
- variant,
4400
4409
  children,
4401
4410
  isPressedInternal,
4402
4411
  isHoveredInternal,
@@ -4412,11 +4421,12 @@ function ChoiceItem({
4412
4421
  onPressIn,
4413
4422
  onPressOut,
4414
4423
  backgroundStyles
4415
- } = useNativeAnimation$4({
4424
+ } = useNativeAnimation$3({
4416
4425
  selected,
4417
4426
  disabled,
4418
4427
  isPressedInternal
4419
4428
  });
4429
+ const Stack = orientation === 'horizontal' ? HStack : VStack;
4420
4430
  const handleChange = () => {
4421
4431
  if (!onChange) return;
4422
4432
 
@@ -4448,33 +4458,45 @@ function ChoiceItem({
4448
4458
  children: ({
4449
4459
  isHovered,
4450
4460
  isPressed
4451
- }) => /*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4452
- animatedStyles: backgroundStyles,
4453
- isHovered: isHovered || isHoveredInternal,
4454
- isDisabled: disabled,
4455
- isSelected: selected,
4456
- isPressed: isPressed || isPressedInternal,
4457
- variant: variant,
4458
- size: size,
4459
- children: [/*#__PURE__*/jsx(Typography.SetDefaultColor, {
4460
- value: getCurrentTextColor$1({
4461
+ }) => {
4462
+ const textColor = getCurrentTextColor$1({
4463
+ isDisabled: disabled
4464
+ });
4465
+ return /*#__PURE__*/jsxs(VStack, {
4466
+ space: "kitt.2",
4467
+ children: [/*#__PURE__*/jsxs(AnimatedChoiceItemView, {
4468
+ animatedStyles: backgroundStyles,
4469
+ isHovered: isHovered || isHoveredInternal,
4461
4470
  isDisabled: disabled,
4462
- isSelected: selected || isPressedInternal,
4463
- isPressed,
4464
- isHovered: isHovered || isHoveredInternal
4465
- }),
4466
- children: children
4467
- }), disabled ? /*#__PURE__*/jsx(View, {
4468
- borderRadius: getBorderRadius(variant),
4469
- borderWidth: "kitt.choices.item.disabled.borderWidth",
4470
- borderColor: "kitt.choices.item.disabled.borderColor",
4471
- position: "absolute",
4472
- top: "0",
4473
- right: "0",
4474
- left: "0",
4475
- bottom: "0"
4476
- }) : null]
4477
- })
4471
+ isSelected: selected,
4472
+ isPressed: isPressed || isPressedInternal,
4473
+ hasError: hasError,
4474
+ size: size,
4475
+ children: [/*#__PURE__*/jsxs(Stack, {
4476
+ alignItems: "center",
4477
+ space: "kitt.2",
4478
+ children: [icon ? /*#__PURE__*/jsx(TypographyIcon, {
4479
+ color: textColor,
4480
+ icon: icon
4481
+ }) : null, /*#__PURE__*/jsx(Typography.SetDefaultColor, {
4482
+ value: textColor,
4483
+ children: children
4484
+ })]
4485
+ }), disabled ? /*#__PURE__*/jsx(View, {
4486
+ borderRadius: "kitt.choices.item.borderRadius",
4487
+ position: "absolute",
4488
+ top: "0",
4489
+ right: "0",
4490
+ left: "0",
4491
+ bottom: "0"
4492
+ }) : null]
4493
+ }), description ? /*#__PURE__*/jsx(Typography.Text, {
4494
+ base: "body-s",
4495
+ color: hasError ? 'kitt.choices.description.color.error' : 'kitt.choices.description.color.default',
4496
+ children: description
4497
+ }) : null]
4498
+ });
4499
+ }
4478
4500
  });
4479
4501
  }
4480
4502
 
@@ -4524,7 +4546,6 @@ function Choices({
4524
4546
  disabled,
4525
4547
  children,
4526
4548
  value,
4527
- variant,
4528
4549
  onPress,
4529
4550
  onChange,
4530
4551
  onFocus,
@@ -4539,7 +4560,6 @@ function Choices({
4539
4560
  const sharedProps = {
4540
4561
  type,
4541
4562
  disabled,
4542
- variant,
4543
4563
  onPress: !isForm ? onPress : undefined,
4544
4564
  onChange: isForm ? newValue => {
4545
4565
  setCurrentValue(newValue);
@@ -5062,7 +5082,7 @@ const InputText = /*#__PURE__*/forwardRef(({
5062
5082
  });
5063
5083
  });
5064
5084
 
5065
- function getBackgroundColor$4({
5085
+ function getBackgroundColor$3({
5066
5086
  isSelected,
5067
5087
  isHighlighted,
5068
5088
  isPressed,
@@ -5101,7 +5121,7 @@ function AutocompleteItem({
5101
5121
  minHeight: "kitt.forms.autocomplete.option.minHeight",
5102
5122
  borderRadius: "kitt.1",
5103
5123
  padding: "kitt.1",
5104
- backgroundColor: getBackgroundColor$4({
5124
+ backgroundColor: getBackgroundColor$3({
5105
5125
  isSelected,
5106
5126
  isHighlighted,
5107
5127
  isPressed,
@@ -5395,7 +5415,7 @@ const SvgCheckboxMarkinline = props => /*#__PURE__*/jsx("svg", {
5395
5415
  })
5396
5416
  });
5397
5417
 
5398
- function getBackgroundColor$3({
5418
+ function getBackgroundColor$2({
5399
5419
  isDisabled,
5400
5420
  isPressed,
5401
5421
  isHovered,
@@ -5474,7 +5494,7 @@ const Checkbox = /*#__PURE__*/forwardRef(({
5474
5494
  isPressed,
5475
5495
  isChecked: checked
5476
5496
  }),
5477
- backgroundColor: getBackgroundColor$3({
5497
+ backgroundColor: getBackgroundColor$2({
5478
5498
  isDisabled: disabled,
5479
5499
  isFocused,
5480
5500
  isHovered,
@@ -7167,7 +7187,7 @@ function InnerCircle({
7167
7187
  });
7168
7188
  }
7169
7189
 
7170
- function getBackgroundColor$2({
7190
+ function getBackgroundColor$1({
7171
7191
  isDisabled,
7172
7192
  isPressed,
7173
7193
  isHovered,
@@ -7213,7 +7233,7 @@ function OuterCircle({
7213
7233
  width: "kitt.forms.radio.size",
7214
7234
  height: "kitt.forms.radio.size",
7215
7235
  borderRadius: "kitt.forms.radio.borderRadius",
7216
- backgroundColor: getBackgroundColor$2({
7236
+ backgroundColor: getBackgroundColor$1({
7217
7237
  isChecked,
7218
7238
  isDisabled,
7219
7239
  isFocused,
@@ -7354,7 +7374,7 @@ function HoverBorder({
7354
7374
  });
7355
7375
  }
7356
7376
 
7357
- const useNativeAnimation$3 = ({
7377
+ const useNativeAnimation$2 = ({
7358
7378
  isDisabled,
7359
7379
  isSelected,
7360
7380
  isPressedInternal
@@ -7435,7 +7455,7 @@ function RadioButton({
7435
7455
  onPressIn,
7436
7456
  onPressOut,
7437
7457
  animatedStyles
7438
- } = useNativeAnimation$3({
7458
+ } = useNativeAnimation$2({
7439
7459
  isDisabled: disabled,
7440
7460
  isSelected: selected,
7441
7461
  isPressedInternal
@@ -8161,7 +8181,7 @@ const withTimingConfig = {
8161
8181
  duration: 100,
8162
8182
  easing: Easing$1.ease
8163
8183
  };
8164
- const useNativeAnimation$2 = ({
8184
+ const useNativeAnimation$1 = ({
8165
8185
  variant,
8166
8186
  isExpanded,
8167
8187
  isInitialRender,
@@ -8243,7 +8263,7 @@ function Highlight({
8243
8263
  contentAnimatedStyles,
8244
8264
  onPressIn,
8245
8265
  onPressOut
8246
- } = useNativeAnimation$2({
8266
+ } = useNativeAnimation$1({
8247
8267
  variant,
8248
8268
  isExpanded,
8249
8269
  isInitialRender,
@@ -8343,226 +8363,53 @@ function Highlight({
8343
8363
  });
8344
8364
  }
8345
8365
 
8346
- function getBackgroundColor$1(color, isDisabled) {
8347
- if (isDisabled) {
8348
- return 'kitt.iconButton.disabled.backgroundColor';
8349
- }
8350
- switch (color) {
8351
- case 'primary':
8352
- return 'kitt.iconButton.primary.pressed.backgroundColor';
8353
- case 'primary-plain':
8354
- return 'kitt.iconButton.primary-plain.pressed.backgroundColor';
8355
- case 'ghost':
8356
- return 'kitt.iconButton.ghost.pressed.backgroundColor';
8366
+ const getButtonTypeAndVariant = iconColor => {
8367
+ switch (iconColor) {
8357
8368
  case 'black':
8358
- default:
8359
- return 'kitt.iconButton.black.pressed.backgroundColor';
8360
- }
8361
- }
8362
- function Background({
8363
- color,
8364
- isDisabled,
8365
- ...props
8366
- }) {
8367
- return /*#__PURE__*/jsx(View, {
8368
- ...props,
8369
- width: "100%",
8370
- height: "100%",
8371
- borderRadius: "kitt.iconButton.borderRadius",
8372
- backgroundColor: getBackgroundColor$1(color, isDisabled)
8373
- });
8374
- }
8375
-
8376
- function AnimatedBackground({
8377
- color,
8378
- isDisabled,
8379
- opacityStyles
8380
- }) {
8381
- const sx = useSx();
8382
- const currentOpacityStyles = isDisabled ? {
8383
- opacity: 1
8384
- } : opacityStyles;
8385
- const styles = sx({
8386
- position: 'absolute',
8387
- top: 0,
8388
- left: 0,
8389
- width: '100%',
8390
- height: '100%'
8391
- });
8392
- return /*#__PURE__*/jsx(Animated.View, {
8393
- style: [styles, currentOpacityStyles],
8394
- children: /*#__PURE__*/jsx(Background, {
8395
- color: color,
8396
- isDisabled: isDisabled
8397
- })
8398
- });
8399
- }
8400
-
8401
- function AnimatedScale({
8402
- isDisabled,
8403
- scaleStyles,
8404
- children
8405
- }) {
8406
- const sx = useSx();
8407
- const currentOpacityStyles = isDisabled ? {
8408
- transform: [{
8409
- scale: 1
8410
- }]
8411
- } : scaleStyles;
8412
- const styles = sx({
8413
- position: 'relative',
8414
- alignItems: 'center',
8415
- justifyContent: 'center',
8416
- width: '100%',
8417
- height: '100%'
8418
- });
8419
- return /*#__PURE__*/jsx(Animated.View, {
8420
- style: [styles, currentOpacityStyles],
8421
- children: children
8422
- });
8423
- }
8424
-
8425
- function useNativeAnimation$1({
8426
- isPressed
8427
- }) {
8428
- const theme = useTheme();
8429
- const pressed = useSharedValue(!!isPressed);
8430
- const opacityStyles = useAnimatedStyle(() => {
8431
- return {
8432
- opacity: withSpring(pressed.value ? 1 : 0)
8433
- };
8434
- });
8435
- const scaleStyles = useAnimatedStyle(() => {
8436
- return {
8437
- transform: [{
8438
- scale: withSpring(pressed.value ? theme.kitt.iconButton.scale.base.active : theme.kitt.iconButton.scale.base.default)
8439
- }]
8440
- };
8441
- });
8442
- return {
8443
- opacityStyles,
8444
- scaleStyles,
8445
- onPressIn: () => {
8446
- pressed.value = true;
8447
- },
8448
- onPressOut: () => {
8449
- pressed.value = false;
8450
- }
8451
- };
8452
- }
8453
-
8454
- const getIconButtonBackgroundColor = (color, disabled) => {
8455
- if (disabled) {
8456
- return undefined;
8457
- }
8458
- switch (color) {
8459
- case 'primary-plain':
8460
- return 'kitt.iconButton.primary-plain.backgroundColor';
8369
+ return {
8370
+ type: 'tertiary'
8371
+ };
8461
8372
  case 'secondary':
8462
- return 'kitt.iconButton.secondary.backgroundColor';
8463
- default:
8464
- return undefined;
8465
- }
8466
- };
8467
-
8468
- const getIconButtonTextColorByColor = (color, disabled) => {
8469
- if (disabled) {
8470
- return 'black-light';
8471
- }
8472
- switch (color) {
8473
- case 'ghost':
8474
- return 'white';
8373
+ return {
8374
+ type: 'secondary'
8375
+ };
8376
+ case 'primary':
8377
+ return {
8378
+ type: 'primary'
8379
+ };
8475
8380
  case 'primary-plain':
8476
- return 'white';
8477
- case 'secondary':
8478
- return 'black';
8381
+ return {
8382
+ type: 'primary'
8383
+ };
8384
+ case 'ghost':
8385
+ return {
8386
+ type: 'tertiary',
8387
+ variant: 'revert'
8388
+ };
8479
8389
  default:
8480
- return color;
8390
+ return {
8391
+ type: 'secondary'
8392
+ };
8481
8393
  }
8482
8394
  };
8483
8395
 
8396
+ /**
8397
+ * @deprecated IconButton should only be used as a navigation button
8398
+ * Other use cases should use a <Button> component with an icon
8399
+ */
8484
8400
  function IconButton({
8485
- icon,
8486
8401
  color = 'black',
8487
- disabled,
8488
- testID,
8489
8402
  ariaLabel,
8490
- accessibilityRole = 'button',
8491
- withBadge,
8492
- badgeCount,
8493
- isHoveredInternal,
8494
- isPressedInternal,
8495
- isFocusedInternal,
8496
- onPress
8403
+ ...props
8497
8404
  }) {
8498
8405
  const {
8499
- onPressIn,
8500
- onPressOut,
8501
- opacityStyles,
8502
- scaleStyles
8503
- } = useNativeAnimation$1({
8504
- isDisabled: disabled,
8505
- isPressed: isPressedInternal
8506
- });
8507
- return /*#__PURE__*/jsx(Pressable, {
8508
- testID: testID,
8509
- disabled: disabled,
8510
- width: "kitt.iconButton.width",
8511
- height: "kitt.iconButton.height",
8512
- "aria-label": ariaLabel,
8513
- accessibilityRole: accessibilityRole,
8514
- _web: {
8515
- style: {
8516
- backfaceVisibility: 'hidden',
8517
- transform: 'translate3d(0px)'
8518
- }
8519
- },
8520
- backgroundColor: getIconButtonBackgroundColor(color, disabled),
8521
- borderRadius: "kitt.iconButton.borderRadius",
8522
- borderColor: disabled ? 'kitt.iconButton.disabled.borderColor' : 'kitt.iconButton.borderColor',
8523
- borderWidth: disabled ? 'kitt.iconButton.borderWidth' : 0,
8524
- onPress: onPress,
8525
- onPressIn: onPressIn,
8526
- onPressOut: onPressOut,
8527
- children: ({
8528
- isHovered,
8529
- isPressed,
8530
- isFocused
8531
- }) => {
8532
- const isCurrentHovered = isHovered || isHoveredInternal;
8533
- const isCurrentPressed = isPressed || isPressedInternal;
8534
- return /*#__PURE__*/jsxs(Fragment, {
8535
- children: [/*#__PURE__*/jsxs(AnimatedScale, {
8536
- isDisabled: disabled,
8537
- isHovered: isCurrentHovered,
8538
- isPressed: isCurrentPressed,
8539
- scaleStyles: scaleStyles,
8540
- children: [/*#__PURE__*/jsx(AnimatedBackground, {
8541
- color: color,
8542
- isDisabled: disabled,
8543
- isHovered: isCurrentHovered,
8544
- isPressed: isCurrentPressed,
8545
- isFocused: isFocused || isFocusedInternal,
8546
- opacityStyles: opacityStyles
8547
- }), /*#__PURE__*/jsx(View, {
8548
- alignItems: "center",
8549
- justifyContent: "center",
8550
- children: /*#__PURE__*/jsx(TypographyIcon, {
8551
- color: getIconButtonTextColorByColor(color, disabled),
8552
- icon: icon
8553
- })
8554
- })]
8555
- }), withBadge || badgeCount && badgeCount > 0 ? /*#__PURE__*/jsx(View, {
8556
- position: "absolute",
8557
- top: withBadge ? '1px' : '-6px',
8558
- right: withBadge ? '1px' : '-6px',
8559
- children: /*#__PURE__*/jsx(ButtonBadge, {
8560
- withBadge: withBadge,
8561
- badgeCount: badgeCount
8562
- })
8563
- }) : null]
8564
- });
8565
- }
8406
+ type: legacyColorToType,
8407
+ variant: legacyColorToVariant
8408
+ } = getButtonTypeAndVariant(color);
8409
+ return /*#__PURE__*/jsx(Button, {
8410
+ variant: legacyColorToVariant,
8411
+ type: legacyColorToType,
8412
+ ...props
8566
8413
  });
8567
8414
  }
8568
8415
  function CloseIconButton(props) {
@@ -9136,11 +8983,17 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9136
8983
  choices: {
9137
8984
  item: {
9138
8985
  default: {
9139
- backgroundColor: theme.choices.item.backgroundColor.default
8986
+ backgroundColor: theme.choices.item.backgroundColor.default,
8987
+ borderColor: theme.choices.item.border.default.color,
8988
+ color: theme.choices.item.color.default
9140
8989
  },
9141
8990
  disabled: {
9142
8991
  backgroundColor: theme.choices.item.backgroundColor.disabled,
9143
- borderColor: theme.choices.item.disabled.border.color
8992
+ borderColor: theme.choices.item.border.disabled.color,
8993
+ color: theme.choices.item.color.disabled
8994
+ },
8995
+ error: {
8996
+ borderColor: theme.choices.item.border.error.color
9144
8997
  },
9145
8998
  selected: {
9146
8999
  backgroundColor: theme.choices.item.backgroundColor.selected
@@ -9154,6 +9007,12 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9154
9007
  hoverWhenSelected: {
9155
9008
  backgroundColor: theme.choices.item.backgroundColor.hoverWhenSelected
9156
9009
  }
9010
+ },
9011
+ description: {
9012
+ color: {
9013
+ default: theme.choices.description.color.default,
9014
+ error: theme.choices.description.color.error
9015
+ }
9157
9016
  }
9158
9017
  },
9159
9018
  tooltip: {
@@ -9557,39 +9416,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9557
9416
  buttonBadge: {
9558
9417
  backgroundColor: theme.buttonBadge.backgroundColor
9559
9418
  },
9560
- iconButton: {
9561
- borderColor: theme.iconButton.borderColor,
9562
- disabled: {
9563
- backgroundColor: theme.iconButton.disabled.backgroundColor
9564
- },
9565
- black: {
9566
- pressed: {
9567
- backgroundColor: theme.iconButton.default.pressedBackgroundColor
9568
- }
9569
- },
9570
- ghost: {
9571
- pressed: {
9572
- backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
9573
- }
9574
- },
9575
- primary: {
9576
- pressed: {
9577
- backgroundColor: theme.iconButton.primary.pressedBackgroundColor
9578
- }
9579
- },
9580
- 'primary-plain': {
9581
- pressed: {
9582
- backgroundColor: theme.iconButton['primary-plain'].pressedBackgroundColor
9583
- },
9584
- backgroundColor: theme.iconButton['primary-plain'].backgroundColor
9585
- },
9586
- secondary: {
9587
- pressed: {
9588
- backgroundColor: theme.iconButton.secondary.pressedBackgroundColor
9589
- },
9590
- backgroundColor: theme.iconButton.secondary.backgroundColor
9591
- }
9592
- },
9593
9419
  highlight: {
9594
9420
  regular: {
9595
9421
  default: {
@@ -9791,9 +9617,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9791
9617
  highlight: {
9792
9618
  borderRadius: theme.highlight.borderRadius
9793
9619
  },
9794
- iconButton: {
9795
- borderRadius: theme.iconButton.borderRadius
9796
- },
9797
9620
  tag: {
9798
9621
  borderRadius: theme.tag.borderRadius
9799
9622
  },
@@ -9917,14 +9740,11 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
9917
9740
  },
9918
9741
  choices: {
9919
9742
  item: {
9920
- disabled: {
9921
- borderWidth: theme.choices.item.disabled.border.width
9743
+ default: {
9744
+ borderWidth: theme.choices.item.border.default.width
9922
9745
  }
9923
9746
  }
9924
9747
  },
9925
- iconButton: {
9926
- borderWidth: theme.iconButton.borderWidth
9927
- },
9928
9748
  forms: {
9929
9749
  input: {
9930
9750
  borderWidth: theme.forms.input.borderWidth
@@ -10113,8 +9933,10 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10113
9933
  button: {
10114
9934
  minWidth: theme.button.minWidth,
10115
9935
  maxWidth: theme.button.maxWidth,
10116
- minHeight: theme.button.minHeight,
10117
- maxHeight: theme.button.maxHeight,
9936
+ height: {
9937
+ default: theme.button.height.default,
9938
+ medium: theme.button.height.medium
9939
+ },
10118
9940
  icon: {
10119
9941
  default: {
10120
9942
  size: theme.button.icon.default.size
@@ -10442,7 +10264,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10442
10264
  }
10443
10265
  },
10444
10266
  iconButton: {
10445
- size: theme.iconButton.width - theme.iconButton.borderWidth,
10446
10267
  width: theme.iconButton.width,
10447
10268
  height: theme.iconButton.height
10448
10269
  },
@@ -10744,6 +10565,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10744
10565
  'body-xs': `${theme.typography.types.bodies.configs['body-xs'].fontSize}px`,
10745
10566
  'label-large': `${theme.typography.types.labels.configs['label-large'].fontSize}px`,
10746
10567
  'label-medium': `${theme.typography.types.labels.configs['label-medium'].fontSize}px`,
10568
+ 'label-small': `${theme.typography.types.labels.configs['label-small'].fontSize}px`,
10747
10569
  'content-caps-xxxl': `${theme.typography.types.contentCaps.configs['content-caps-xxxl'].fontSize}px`,
10748
10570
  'content-caps-xxl': `${theme.typography.types.contentCaps.configs['content-caps-xxl'].fontSize}px`,
10749
10571
  'content-caps-xl': `${theme.typography.types.contentCaps.configs['content-caps-xl'].fontSize}px`,
@@ -10766,6 +10588,7 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
10766
10588
  'body-xs': `${theme.typography.types.bodies.configs['body-xs'].lineHeight}px`,
10767
10589
  'label-large': `${theme.typography.types.labels.configs['label-large'].lineHeight}px`,
10768
10590
  'label-medium': `${theme.typography.types.labels.configs['label-medium'].lineHeight}px`,
10591
+ 'label-small': `${theme.typography.types.labels.configs['label-small'].lineHeight}px`,
10769
10592
  'content-caps-xxxl': `${theme.typography.types.contentCaps.configs['content-caps-xxxl'].lineHeight}px`,
10770
10593
  'content-caps-xxl': `${theme.typography.types.contentCaps.configs['content-caps-xxl'].lineHeight}px`,
10771
10594
  'content-caps-xl': `${theme.typography.types.contentCaps.configs['content-caps-xl'].lineHeight}px`,