@ornikar/kitt-universal 18.0.2 → 19.0.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 (50) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/definitions/Button/Button.d.ts +1 -1
  3. package/dist/definitions/Button/Button.d.ts.map +1 -1
  4. package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts +4 -0
  5. package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts.map +1 -0
  6. package/dist/definitions/IconButton/IconButton.d.ts +1 -1
  7. package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
  8. package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts +4 -0
  9. package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts.map +1 -0
  10. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +1 -2
  11. package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
  12. package/dist/definitions/themes/late-ocean/button.d.ts +0 -1
  13. package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
  14. package/dist/definitions/themes/late-ocean/iconButton.d.ts +1 -1
  15. package/dist/index-node-18.18.cjs.js +22 -21
  16. package/dist/index-node-18.18.cjs.js.map +1 -1
  17. package/dist/index-node-18.18.cjs.web.js +22 -21
  18. package/dist/index-node-18.18.cjs.web.js.map +1 -1
  19. package/dist/index-node-18.18.es.mjs +22 -21
  20. package/dist/index-node-18.18.es.mjs.map +1 -1
  21. package/dist/index-node-18.18.es.web.mjs +22 -21
  22. package/dist/index-node-18.18.es.web.mjs.map +1 -1
  23. package/dist/index.es.android.js +22 -21
  24. package/dist/index.es.android.js.map +1 -1
  25. package/dist/index.es.ios.js +22 -21
  26. package/dist/index.es.ios.js.map +1 -1
  27. package/dist/index.es.js +22 -21
  28. package/dist/index.es.js.map +1 -1
  29. package/dist/index.es.web.js +22 -21
  30. package/dist/index.es.web.js.map +1 -1
  31. package/dist/linaria-themes-node-18.18.cjs.js +2 -10
  32. package/dist/linaria-themes-node-18.18.cjs.js.map +1 -1
  33. package/dist/linaria-themes-node-18.18.cjs.web.js +2 -10
  34. package/dist/linaria-themes-node-18.18.cjs.web.js.map +1 -1
  35. package/dist/linaria-themes-node-18.18.es.mjs +2 -10
  36. package/dist/linaria-themes-node-18.18.es.mjs.map +1 -1
  37. package/dist/linaria-themes-node-18.18.es.web.mjs +2 -10
  38. package/dist/linaria-themes-node-18.18.es.web.mjs.map +1 -1
  39. package/dist/linaria-themes.es.android.js +2 -10
  40. package/dist/linaria-themes.es.android.js.map +1 -1
  41. package/dist/linaria-themes.es.ios.js +2 -10
  42. package/dist/linaria-themes.es.ios.js.map +1 -1
  43. package/dist/linaria-themes.es.js +2 -10
  44. package/dist/linaria-themes.es.js.map +1 -1
  45. package/dist/linaria-themes.es.web.js +2 -10
  46. package/dist/linaria-themes.es.web.js.map +1 -1
  47. package/dist/tsbuildinfo +1 -1
  48. package/package.json +4 -4
  49. package/dist/definitions/Button/utils/getTextColorByType.d.ts +0 -4
  50. package/dist/definitions/Button/utils/getTextColorByType.d.ts.map +0 -1
@@ -545,14 +545,6 @@ const button = {
545
545
  activeColor: colors.hover
546
546
  }
547
547
  },
548
- white: {
549
- default: {
550
- backgroundColor: 'rgba(255, 255, 255, 0.05)',
551
- pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
552
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
553
- focusBorderColor: 'rgba(255, 255, 255, 0.1)'
554
- }
555
- },
556
548
  danger: {
557
549
  default: {
558
550
  backgroundColor: lateOceanColorPalette.warmEmbraceLight1,
@@ -1192,8 +1184,8 @@ const iconButton = {
1192
1184
  default: {
1193
1185
  pressedBackgroundColor: button.default.default.pressedBackgroundColor
1194
1186
  },
1195
- white: {
1196
- pressedBackgroundColor: button.white.default.hoverBackgroundColor
1187
+ ghost: {
1188
+ pressedBackgroundColor: button.default.ghost.pressedBackgroundColor
1197
1189
  },
1198
1190
  primary: {
1199
1191
  pressedBackgroundColor: lateOceanColorPalette.moonPurpleLight1
@@ -2097,13 +2089,11 @@ function TypographyIcon({
2097
2089
  });
2098
2090
  }
2099
2091
 
2100
- const getTextColorByType = (type, variant, isHovered, isPressed) => {
2092
+ const getButtonTextColorByType = (type, variant, isHovered, isPressed) => {
2101
2093
  const isButtonInteractedWith = isHovered || isPressed;
2102
2094
  switch (type) {
2103
2095
  case 'primary':
2104
2096
  return variant === 'ghost' ? 'primary' : 'white';
2105
- case 'white':
2106
- return 'white';
2107
2097
  case 'danger':
2108
2098
  return 'danger';
2109
2099
  case 'subtle':
@@ -2197,7 +2187,7 @@ function ButtonContent({
2197
2187
  isFocused,
2198
2188
  ...props
2199
2189
  }) {
2200
- const color = isDisabled ? 'black-light' : getTextColorByType(type, variant, isHovered, isPressed);
2190
+ const color = isDisabled ? 'black-light' : getButtonTextColorByType(type, variant, isHovered, isPressed);
2201
2191
  return /*#__PURE__*/jsxRuntime.jsx(View, {
2202
2192
  _web: {
2203
2193
  // Make the multilines case work properly on web
@@ -5774,8 +5764,8 @@ function getBackgroundColor$1(color, isDisabled) {
5774
5764
  switch (color) {
5775
5765
  case 'primary':
5776
5766
  return 'kitt.iconButton.primary.pressed.backgroundColor';
5777
- case 'white':
5778
- return 'kitt.iconButton.white.pressed.backgroundColor';
5767
+ case 'ghost':
5768
+ return 'kitt.iconButton.ghost.pressed.backgroundColor';
5779
5769
  case 'black':
5780
5770
  default:
5781
5771
  return 'kitt.iconButton.black.pressed.backgroundColor';
@@ -5888,6 +5878,18 @@ function useNativeAnimation() {
5888
5878
  };
5889
5879
  }
5890
5880
 
5881
+ const getIconButtonTextColorByColor = (color, disabled) => {
5882
+ if (disabled) {
5883
+ return 'black-light';
5884
+ }
5885
+ switch (color) {
5886
+ case 'ghost':
5887
+ return 'white';
5888
+ default:
5889
+ return color;
5890
+ }
5891
+ };
5892
+
5891
5893
  function IconButton({
5892
5894
  icon,
5893
5895
  color = 'black',
@@ -5950,7 +5952,7 @@ function IconButton({
5950
5952
  alignItems: "center",
5951
5953
  justifyContent: "center",
5952
5954
  children: /*#__PURE__*/jsxRuntime.jsx(TypographyIcon, {
5953
- color: disabled ? 'black-light' : color,
5955
+ color: getIconButtonTextColorByColor(color, disabled),
5954
5956
  icon: icon
5955
5957
  })
5956
5958
  })]
@@ -6333,7 +6335,7 @@ const getIconButtonColor = messageType => {
6333
6335
  switch (messageType) {
6334
6336
  case 'success':
6335
6337
  case 'danger':
6336
- return 'white';
6338
+ return 'ghost';
6337
6339
  case 'warning':
6338
6340
  default:
6339
6341
  return 'black';
@@ -6559,7 +6561,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
6559
6561
  default: theme.button.default,
6560
6562
  primary: theme.button.primary,
6561
6563
  danger: theme.button.danger,
6562
- white: theme.button.white,
6563
6564
  subtle: theme.button.subtle,
6564
6565
  'subtle-dark': theme.button['subtle-dark'],
6565
6566
  disabled: theme.button.disabled
@@ -6762,9 +6763,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
6762
6763
  backgroundColor: theme.iconButton.default.pressedBackgroundColor
6763
6764
  }
6764
6765
  },
6765
- white: {
6766
+ ghost: {
6766
6767
  pressed: {
6767
- backgroundColor: theme.iconButton.white.pressedBackgroundColor
6768
+ backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
6768
6769
  }
6769
6770
  },
6770
6771
  primary: {