@app-studio/web 0.7.2 → 0.7.3

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
@@ -906,6 +906,7 @@ var LoaderComponent = function LoaderComponent(props) {
906
906
  var Loader = LoaderComponent;
907
907
 
908
908
  var _excluded$g = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered"];
909
+ var contrast = /*#__PURE__*/require('contrast');
909
910
  var ButtonView = function ButtonView(_ref) {
910
911
  var _props$onClick;
911
912
  var icon = _ref.icon,
@@ -950,11 +951,12 @@ var ButtonView = function ButtonView(_ref) {
950
951
  var buttonColor = isActive ? colorScheme : 'theme.disabled';
951
952
  var hovering = isHovered && effect === 'hover';
952
953
  var reverse = isHovered && effect === 'reverse';
954
+ var isLight = contrast(buttonColor) == 'light';
953
955
  var ButtonVariants = {
954
956
  filled: {
955
957
  // Defines CSS properties for 'link' variant of the button with conditional styles based on reverse state, includes text decoration.
956
958
  backgroundColor: reverse ? 'transparent' : buttonColor,
957
- color: reverse ? buttonColor : 'color.white',
959
+ color: reverse && !isLight ? buttonColor : 'color.white',
958
960
  borderWidth: 1,
959
961
  borderStyle: 'solid',
960
962
  borderColor: reverse ? buttonColor : 'transparent'
@@ -981,7 +983,7 @@ var ButtonView = function ButtonView(_ref) {
981
983
  },
982
984
  ghost: {
983
985
  backgroundColor: reverse ? buttonColor : 'transparent',
984
- color: reverse ? 'color.white' : buttonColor,
986
+ color: reverse && !isLight ? 'color.white' : buttonColor,
985
987
  borderWidth: 1,
986
988
  borderStyle: 'solid',
987
989
  borderColor: reverse ? buttonColor : 'transparent'