@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.
- package/CHANGELOG.md +13 -0
- package/dist/definitions/Button/Button.d.ts +1 -1
- package/dist/definitions/Button/Button.d.ts.map +1 -1
- package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts +4 -0
- package/dist/definitions/Button/utils/getButtonTextColorByType.d.ts.map +1 -0
- package/dist/definitions/IconButton/IconButton.d.ts +1 -1
- package/dist/definitions/IconButton/IconButton.d.ts.map +1 -1
- package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts +4 -0
- package/dist/definitions/IconButton/utils/getIconButtonTextColorByColor.d.ts.map +1 -0
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts +1 -2
- package/dist/definitions/native-base/KittNativeBaseProvider.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/button.d.ts +0 -1
- package/dist/definitions/themes/late-ocean/button.d.ts.map +1 -1
- package/dist/definitions/themes/late-ocean/iconButton.d.ts +1 -1
- package/dist/index-node-18.18.cjs.js +22 -21
- package/dist/index-node-18.18.cjs.js.map +1 -1
- package/dist/index-node-18.18.cjs.web.js +22 -21
- package/dist/index-node-18.18.cjs.web.js.map +1 -1
- package/dist/index-node-18.18.es.mjs +22 -21
- package/dist/index-node-18.18.es.mjs.map +1 -1
- package/dist/index-node-18.18.es.web.mjs +22 -21
- package/dist/index-node-18.18.es.web.mjs.map +1 -1
- package/dist/index.es.android.js +22 -21
- package/dist/index.es.android.js.map +1 -1
- package/dist/index.es.ios.js +22 -21
- package/dist/index.es.ios.js.map +1 -1
- package/dist/index.es.js +22 -21
- package/dist/index.es.js.map +1 -1
- package/dist/index.es.web.js +22 -21
- package/dist/index.es.web.js.map +1 -1
- package/dist/linaria-themes-node-18.18.cjs.js +2 -10
- package/dist/linaria-themes-node-18.18.cjs.js.map +1 -1
- package/dist/linaria-themes-node-18.18.cjs.web.js +2 -10
- package/dist/linaria-themes-node-18.18.cjs.web.js.map +1 -1
- package/dist/linaria-themes-node-18.18.es.mjs +2 -10
- package/dist/linaria-themes-node-18.18.es.mjs.map +1 -1
- package/dist/linaria-themes-node-18.18.es.web.mjs +2 -10
- package/dist/linaria-themes-node-18.18.es.web.mjs.map +1 -1
- package/dist/linaria-themes.es.android.js +2 -10
- package/dist/linaria-themes.es.android.js.map +1 -1
- package/dist/linaria-themes.es.ios.js +2 -10
- package/dist/linaria-themes.es.ios.js.map +1 -1
- package/dist/linaria-themes.es.js +2 -10
- package/dist/linaria-themes.es.js.map +1 -1
- package/dist/linaria-themes.es.web.js +2 -10
- package/dist/linaria-themes.es.web.js.map +1 -1
- package/dist/tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/definitions/Button/utils/getTextColorByType.d.ts +0 -4
- 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
|
-
|
|
1191
|
-
pressedBackgroundColor: button.
|
|
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
|
|
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' :
|
|
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 '
|
|
5773
|
-
return 'kitt.iconButton.
|
|
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:
|
|
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 '
|
|
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
|
-
|
|
6761
|
+
ghost: {
|
|
6761
6762
|
pressed: {
|
|
6762
|
-
backgroundColor: theme.iconButton.
|
|
6763
|
+
backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
|
|
6763
6764
|
}
|
|
6764
6765
|
},
|
|
6765
6766
|
primary: {
|