@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
|
@@ -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
|
-
|
|
1195
|
-
pressedBackgroundColor: button.
|
|
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
|
|
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' :
|
|
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 '
|
|
6697
|
-
return 'kitt.iconButton.
|
|
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:
|
|
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 '
|
|
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
|
-
|
|
7707
|
+
ghost: {
|
|
7707
7708
|
pressed: {
|
|
7708
|
-
backgroundColor: theme.iconButton.
|
|
7709
|
+
backgroundColor: theme.iconButton.ghost.pressedBackgroundColor
|
|
7709
7710
|
}
|
|
7710
7711
|
},
|
|
7711
7712
|
primary: {
|