@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/components/Button/Button/Button.props.d.ts +1 -1
- package/dist/web.cjs.development.js +4 -2
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +4 -2
- package/dist/web.esm.js.map +1 -1
- package/package.json +2 -1
|
@@ -5,7 +5,7 @@ import { IconPosition, Shape, Size, Variant, LoaderPosition, Effects } from './B
|
|
|
5
5
|
import { LoaderProps } from '../../Loader/Loader/Loader.props';
|
|
6
6
|
export interface ButtonProps {
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
colorScheme?:
|
|
8
|
+
colorScheme?: any;
|
|
9
9
|
externalHref?: string;
|
|
10
10
|
isLoading?: boolean;
|
|
11
11
|
loaderProps?: LoaderProps;
|
|
@@ -913,6 +913,7 @@ var LoaderComponent = function LoaderComponent(props) {
|
|
|
913
913
|
var Loader = LoaderComponent;
|
|
914
914
|
|
|
915
915
|
var _excluded$g = ["icon", "shadow", "children", "ariaLabel", "externalHref", "isAuto", "isFilled", "isIconRounded", "isLoading", "isDisabled", "size", "variant", "iconPosition", "colorScheme", "shape", "onClick", "loaderProps", "loaderPosition", "effect", "isHovered"];
|
|
916
|
+
var contrast = /*#__PURE__*/require('contrast');
|
|
916
917
|
var ButtonView = function ButtonView(_ref) {
|
|
917
918
|
var _props$onClick;
|
|
918
919
|
var icon = _ref.icon,
|
|
@@ -957,11 +958,12 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
957
958
|
var buttonColor = isActive ? colorScheme : 'theme.disabled';
|
|
958
959
|
var hovering = isHovered && effect === 'hover';
|
|
959
960
|
var reverse = isHovered && effect === 'reverse';
|
|
961
|
+
var isLight = contrast(buttonColor) == 'light';
|
|
960
962
|
var ButtonVariants = {
|
|
961
963
|
filled: {
|
|
962
964
|
// Defines CSS properties for 'link' variant of the button with conditional styles based on reverse state, includes text decoration.
|
|
963
965
|
backgroundColor: reverse ? 'transparent' : buttonColor,
|
|
964
|
-
color: reverse ? buttonColor : 'color.white',
|
|
966
|
+
color: reverse && !isLight ? buttonColor : 'color.white',
|
|
965
967
|
borderWidth: 1,
|
|
966
968
|
borderStyle: 'solid',
|
|
967
969
|
borderColor: reverse ? buttonColor : 'transparent'
|
|
@@ -988,7 +990,7 @@ var ButtonView = function ButtonView(_ref) {
|
|
|
988
990
|
},
|
|
989
991
|
ghost: {
|
|
990
992
|
backgroundColor: reverse ? buttonColor : 'transparent',
|
|
991
|
-
color: reverse ? 'color.white' : buttonColor,
|
|
993
|
+
color: reverse && !isLight ? 'color.white' : buttonColor,
|
|
992
994
|
borderWidth: 1,
|
|
993
995
|
borderStyle: 'solid',
|
|
994
996
|
borderColor: reverse ? buttonColor : 'transparent'
|