@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
@@ -540,14 +540,6 @@ const button = {
540
540
  activeColor: colors.hover
541
541
  }
542
542
  },
543
- white: {
544
- default: {
545
- backgroundColor: 'rgba(255, 255, 255, 0.05)',
546
- pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
547
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
548
- focusBorderColor: 'rgba(255, 255, 255, 0.1)'
549
- }
550
- },
551
543
  danger: {
552
544
  default: {
553
545
  backgroundColor: lateOceanColorPalette.warmEmbraceLight1,
@@ -1187,8 +1179,8 @@ const iconButton = {
1187
1179
  default: {
1188
1180
  pressedBackgroundColor: button.default.default.pressedBackgroundColor
1189
1181
  },
1190
- white: {
1191
- pressedBackgroundColor: button.white.default.hoverBackgroundColor
1182
+ ghost: {
1183
+ pressedBackgroundColor: button.default.ghost.pressedBackgroundColor
1192
1184
  },
1193
1185
  primary: {
1194
1186
  pressedBackgroundColor: lateOceanColorPalette.moonPurpleLight1
@@ -2092,13 +2084,11 @@ function TypographyIcon({
2092
2084
  });
2093
2085
  }
2094
2086
 
2095
- const getTextColorByType = (type, variant, isHovered, isPressed) => {
2087
+ const getButtonTextColorByType = (type, variant, isHovered, isPressed) => {
2096
2088
  const isButtonInteractedWith = isHovered || isPressed;
2097
2089
  switch (type) {
2098
2090
  case 'primary':
2099
2091
  return variant === 'ghost' ? 'primary' : 'white';
2100
- case 'white':
2101
- return 'white';
2102
2092
  case 'danger':
2103
2093
  return 'danger';
2104
2094
  case 'subtle':
@@ -2192,7 +2182,7 @@ function ButtonContent({
2192
2182
  isFocused,
2193
2183
  ...props
2194
2184
  }) {
2195
- const color = isDisabled ? 'black-light' : getTextColorByType(type, variant, isHovered, isPressed);
2185
+ const color = isDisabled ? 'black-light' : getButtonTextColorByType(type, variant, isHovered, isPressed);
2196
2186
  return /*#__PURE__*/jsx(View, {
2197
2187
  _web: {
2198
2188
  // Make the multilines case work properly on web
@@ -5769,8 +5759,8 @@ function getBackgroundColor$1(color, isDisabled) {
5769
5759
  switch (color) {
5770
5760
  case 'primary':
5771
5761
  return 'kitt.iconButton.primary.pressed.backgroundColor';
5772
- case 'white':
5773
- return 'kitt.iconButton.white.pressed.backgroundColor';
5762
+ case 'ghost':
5763
+ return 'kitt.iconButton.ghost.pressed.backgroundColor';
5774
5764
  case 'black':
5775
5765
  default:
5776
5766
  return 'kitt.iconButton.black.pressed.backgroundColor';
@@ -5883,6 +5873,18 @@ function useNativeAnimation() {
5883
5873
  };
5884
5874
  }
5885
5875
 
5876
+ const getIconButtonTextColorByColor = (color, disabled) => {
5877
+ if (disabled) {
5878
+ return 'black-light';
5879
+ }
5880
+ switch (color) {
5881
+ case 'ghost':
5882
+ return 'white';
5883
+ default:
5884
+ return color;
5885
+ }
5886
+ };
5887
+
5886
5888
  function IconButton({
5887
5889
  icon,
5888
5890
  color = 'black',
@@ -5945,7 +5947,7 @@ function IconButton({
5945
5947
  alignItems: "center",
5946
5948
  justifyContent: "center",
5947
5949
  children: /*#__PURE__*/jsx(TypographyIcon, {
5948
- color: disabled ? 'black-light' : color,
5950
+ color: getIconButtonTextColorByColor(color, disabled),
5949
5951
  icon: icon
5950
5952
  })
5951
5953
  })]
@@ -6328,7 +6330,7 @@ const getIconButtonColor = messageType => {
6328
6330
  switch (messageType) {
6329
6331
  case 'success':
6330
6332
  case 'danger':
6331
- return 'white';
6333
+ return 'ghost';
6332
6334
  case 'warning':
6333
6335
  default:
6334
6336
  return 'black';
@@ -6554,7 +6556,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
6554
6556
  default: theme.button.default,
6555
6557
  primary: theme.button.primary,
6556
6558
  danger: theme.button.danger,
6557
- white: theme.button.white,
6558
6559
  subtle: theme.button.subtle,
6559
6560
  'subtle-dark': theme.button['subtle-dark'],
6560
6561
  disabled: theme.button.disabled
@@ -6757,9 +6758,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
6757
6758
  backgroundColor: theme.iconButton.default.pressedBackgroundColor
6758
6759
  }
6759
6760
  },
6760
- white: {
6761
+ ghost: {
6761
6762
  pressed: {
6762
- backgroundColor: theme.iconButton.white.pressedBackgroundColor
6763
+ backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
6763
6764
  }
6764
6765
  },
6765
6766
  primary: {