@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
@@ -544,14 +544,6 @@ const button = {
544
544
  activeColor: colors.hover
545
545
  }
546
546
  },
547
- white: {
548
- default: {
549
- backgroundColor: 'rgba(255, 255, 255, 0.05)',
550
- pressedBackgroundColor: 'rgba(255, 255, 255, 0.1)',
551
- hoverBackgroundColor: 'rgba(255, 255, 255, 0.1)',
552
- focusBorderColor: 'rgba(255, 255, 255, 0.1)'
553
- }
554
- },
555
547
  danger: {
556
548
  default: {
557
549
  backgroundColor: lateOceanColorPalette.warmEmbraceLight1,
@@ -1191,8 +1183,8 @@ const iconButton = {
1191
1183
  default: {
1192
1184
  pressedBackgroundColor: button.default.default.pressedBackgroundColor
1193
1185
  },
1194
- white: {
1195
- pressedBackgroundColor: button.white.default.hoverBackgroundColor
1186
+ ghost: {
1187
+ pressedBackgroundColor: button.default.ghost.pressedBackgroundColor
1196
1188
  },
1197
1189
  primary: {
1198
1190
  pressedBackgroundColor: lateOceanColorPalette.moonPurpleLight1
@@ -2047,13 +2039,11 @@ function TypographyIcon({
2047
2039
  });
2048
2040
  }
2049
2041
 
2050
- const getTextColorByType = (type, variant, isHovered, isPressed) => {
2042
+ const getButtonTextColorByType = (type, variant, isHovered, isPressed) => {
2051
2043
  const isButtonInteractedWith = isHovered || isPressed;
2052
2044
  switch (type) {
2053
2045
  case 'primary':
2054
2046
  return variant === 'ghost' ? 'primary' : 'white';
2055
- case 'white':
2056
- return 'white';
2057
2047
  case 'danger':
2058
2048
  return 'danger';
2059
2049
  case 'subtle':
@@ -2147,7 +2137,7 @@ function ButtonContent({
2147
2137
  isFocused,
2148
2138
  ...props
2149
2139
  }) {
2150
- const color = isDisabled ? 'black-light' : getTextColorByType(type, variant, isHovered, isPressed);
2140
+ const color = isDisabled ? 'black-light' : getButtonTextColorByType(type, variant, isHovered, isPressed);
2151
2141
  return /*#__PURE__*/jsx(View, {
2152
2142
  _web: {
2153
2143
  // Make the multilines case work properly on web
@@ -6693,8 +6683,8 @@ function getBackgroundColor(color, isDisabled) {
6693
6683
  switch (color) {
6694
6684
  case 'primary':
6695
6685
  return 'kitt.iconButton.primary.pressed.backgroundColor';
6696
- case 'white':
6697
- return 'kitt.iconButton.white.pressed.backgroundColor';
6686
+ case 'ghost':
6687
+ return 'kitt.iconButton.ghost.pressed.backgroundColor';
6698
6688
  case 'black':
6699
6689
  default:
6700
6690
  return 'kitt.iconButton.black.pressed.backgroundColor';
@@ -6826,6 +6816,18 @@ function useNativeAnimation({
6826
6816
  };
6827
6817
  }
6828
6818
 
6819
+ const getIconButtonTextColorByColor = (color, disabled) => {
6820
+ if (disabled) {
6821
+ return 'black-light';
6822
+ }
6823
+ switch (color) {
6824
+ case 'ghost':
6825
+ return 'white';
6826
+ default:
6827
+ return color;
6828
+ }
6829
+ };
6830
+
6829
6831
  function IconButton({
6830
6832
  icon,
6831
6833
  color = 'black',
@@ -6891,7 +6893,7 @@ function IconButton({
6891
6893
  alignItems: "center",
6892
6894
  justifyContent: "center",
6893
6895
  children: /*#__PURE__*/jsx(TypographyIcon, {
6894
- color: disabled ? 'black-light' : color,
6896
+ color: getIconButtonTextColorByColor(color, disabled),
6895
6897
  icon: icon
6896
6898
  })
6897
6899
  })]
@@ -7274,7 +7276,7 @@ const getIconButtonColor = messageType => {
7274
7276
  switch (messageType) {
7275
7277
  case 'success':
7276
7278
  case 'danger':
7277
- return 'white';
7279
+ return 'ghost';
7278
7280
  case 'warning':
7279
7281
  default:
7280
7282
  return 'black';
@@ -7500,7 +7502,6 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7500
7502
  default: theme.button.default,
7501
7503
  primary: theme.button.primary,
7502
7504
  danger: theme.button.danger,
7503
- white: theme.button.white,
7504
7505
  subtle: theme.button.subtle,
7505
7506
  'subtle-dark': theme.button['subtle-dark'],
7506
7507
  disabled: theme.button.disabled
@@ -7703,9 +7704,9 @@ function createKittNativeBaseCustomTheme(theme, appTheme) {
7703
7704
  backgroundColor: theme.iconButton.default.pressedBackgroundColor
7704
7705
  }
7705
7706
  },
7706
- white: {
7707
+ ghost: {
7707
7708
  pressed: {
7708
- backgroundColor: theme.iconButton.white.pressedBackgroundColor
7709
+ backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
7709
7710
  }
7710
7711
  },
7711
7712
  primary: {