@app-studio/web 0.7.3 → 0.7.5
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/dist/web.esm.js
CHANGED
|
@@ -944,6 +944,8 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
944
944
|
effect = _ref$effect === void 0 ? 'default' : _ref$effect,
|
|
945
945
|
isHovered = _ref.isHovered,
|
|
946
946
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
|
|
947
|
+
var _useTheme = useTheme(),
|
|
948
|
+
getColor = _useTheme.getColor;
|
|
947
949
|
var isActive = !(isDisabled || isLoading);
|
|
948
950
|
var defaultNativeProps = {
|
|
949
951
|
disabled: !isActive
|
|
@@ -951,12 +953,12 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
951
953
|
var buttonColor = isActive ? colorScheme : 'theme.disabled';
|
|
952
954
|
var hovering = isHovered && effect === 'hover';
|
|
953
955
|
var reverse = isHovered && effect === 'reverse';
|
|
954
|
-
var isLight = contrast(buttonColor) == 'light';
|
|
956
|
+
var isLight = contrast(getColor(buttonColor)) == 'light';
|
|
955
957
|
var ButtonVariants = {
|
|
956
958
|
filled: {
|
|
957
959
|
// Defines CSS properties for 'link' variant of the button with conditional styles based on reverse state, includes text decoration.
|
|
958
960
|
backgroundColor: reverse ? 'transparent' : buttonColor,
|
|
959
|
-
color: reverse
|
|
961
|
+
color: reverse ? isLight ? 'color.white' : buttonColor : isLight ? buttonColor : 'color.white',
|
|
960
962
|
borderWidth: 1,
|
|
961
963
|
borderStyle: 'solid',
|
|
962
964
|
borderColor: reverse ? buttonColor : 'transparent'
|
|
@@ -983,7 +985,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
983
985
|
},
|
|
984
986
|
ghost: {
|
|
985
987
|
backgroundColor: reverse ? buttonColor : 'transparent',
|
|
986
|
-
color: reverse
|
|
988
|
+
color: reverse ? 'color.white' : buttonColor,
|
|
987
989
|
borderWidth: 1,
|
|
988
990
|
borderStyle: 'solid',
|
|
989
991
|
borderColor: reverse ? buttonColor : 'transparent'
|