carbon-react 104.26.1 → 104.27.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/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +2 -2
- package/lib/components/advanced-color-picker/advanced-color-picker.style.js +6 -2
- package/lib/components/simple-color-picker/simple-color/simple-color.style.js +2 -2
- package/lib/components/simple-color-picker/simple-color-input/simple-color-input.style.js +5 -13
- package/lib/components/simple-color-picker/simple-color-picker.style.js +4 -10
- package/lib/components/simple-color-picker/tick-icon/tick-icon.style.js +5 -11
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ const StyledAdvancedColorPickerCell = _styledComponents.default.button.attrs({
|
|
|
18
18
|
display: block;
|
|
19
19
|
width: 25px;
|
|
20
20
|
height: 25px;
|
|
21
|
-
border: 1px solid
|
|
21
|
+
border: 1px solid var(--colorsUtilityYin090);
|
|
22
22
|
${({
|
|
23
23
|
color
|
|
24
24
|
}) => color && (0, _styledComponents.css)`
|
|
@@ -37,7 +37,7 @@ const StyledAdvancedColorPickerCell = _styledComponents.default.button.attrs({
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
&:focus {
|
|
40
|
-
outline: solid 3px
|
|
40
|
+
outline: solid 3px var(--colorsSemanticFocus500);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
&::-moz-focus-inner {
|
|
@@ -49,7 +49,7 @@ const StyledAdvancedColorPickerPreview = _styledComponents.default.div`
|
|
|
49
49
|
width: 25px;
|
|
50
50
|
height: 25px;
|
|
51
51
|
margin-bottom: 15px;
|
|
52
|
-
border: 1px solid
|
|
52
|
+
border: 1px solid var(--colorsUtilityYin090);
|
|
53
53
|
|
|
54
54
|
${({
|
|
55
55
|
color
|
|
@@ -82,7 +82,7 @@ const DialogStyle = (0, _styledComponents.default)(_dialog2.default)`
|
|
|
82
82
|
${_simpleColorPicker.StyledColorOptions} {
|
|
83
83
|
max-width: 285px;
|
|
84
84
|
${_simpleColor.default} {
|
|
85
|
-
border: 1px solid
|
|
85
|
+
border: 1px solid var(--colorsUtilityYin090);
|
|
86
86
|
margin-right: -1px;
|
|
87
87
|
margin-bottom: -1px;
|
|
88
88
|
transition: all 0.2s ease;
|
|
@@ -101,5 +101,9 @@ const DialogStyle = (0, _styledComponents.default)(_dialog2.default)`
|
|
|
101
101
|
top: 20px;
|
|
102
102
|
right: 13px;
|
|
103
103
|
}
|
|
104
|
+
|
|
105
|
+
[data-component="icon"] {
|
|
106
|
+
color: var(--colorsActionMinorYin065);
|
|
107
|
+
}
|
|
104
108
|
`;
|
|
105
109
|
exports.DialogStyle = DialogStyle;
|
|
@@ -10,8 +10,8 @@ var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
12
|
const StyledSimpleColor = _styledComponents.default.div`
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
13
|
+
width: var(--sizing700);
|
|
14
|
+
height: var(--sizing700);
|
|
15
15
|
margin-right: 2px;
|
|
16
16
|
margin-bottom: 2px;
|
|
17
17
|
|
|
@@ -7,8 +7,6 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
9
|
|
|
10
|
-
var _base = _interopRequireDefault(require("../../../style/themes/base"));
|
|
11
|
-
|
|
12
10
|
var _input = require("../../../__internal__/input");
|
|
13
11
|
|
|
14
12
|
var _colorSampleBox = _interopRequireDefault(require("../color-sample-box/color-sample-box.style"));
|
|
@@ -18,8 +16,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
16
|
const StyledSimpleColorInput = (0, _styledComponents.default)(_input.Input)`
|
|
19
17
|
position: absolute;
|
|
20
18
|
opacity: 0;
|
|
21
|
-
height:
|
|
22
|
-
width:
|
|
19
|
+
height: var(--sizing700);
|
|
20
|
+
width: var(--sizing700);
|
|
23
21
|
margin: 0;
|
|
24
22
|
|
|
25
23
|
&:hover {
|
|
@@ -31,16 +29,10 @@ const StyledSimpleColorInput = (0, _styledComponents.default)(_input.Input)`
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
&:focus + ${_colorSampleBox.default} {
|
|
34
|
-
box-shadow: inset 0px 0px 0px
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
border: 2px solid ${({
|
|
38
|
-
theme
|
|
39
|
-
}) => theme.colors.focus};
|
|
32
|
+
box-shadow: inset 0px 0px 0px var(--borderWidth200)
|
|
33
|
+
var(--colorsActionMajorYang100);
|
|
34
|
+
border: 2px solid var(--colorsSemanticFocus500);
|
|
40
35
|
}
|
|
41
36
|
`;
|
|
42
|
-
StyledSimpleColorInput.defaultProps = {
|
|
43
|
-
theme: _base.default
|
|
44
|
-
};
|
|
45
37
|
var _default = StyledSimpleColorInput;
|
|
46
38
|
exports.default = _default;
|
|
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _validationIcon = _interopRequireDefault(require("../../__internal__/validations/validation-icon.style"));
|
|
11
11
|
|
|
12
|
-
var _base = _interopRequireDefault(require("../../style/themes/base"));
|
|
13
|
-
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
13
|
|
|
16
14
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -43,24 +41,20 @@ const StyledColorOptions = _styledComponents.default.div`
|
|
|
43
41
|
border-top: ${BORDER_WIDTH}px solid transparent;
|
|
44
42
|
|
|
45
43
|
${({
|
|
46
|
-
theme,
|
|
47
44
|
error,
|
|
48
45
|
info,
|
|
49
46
|
warning
|
|
50
47
|
}) => {
|
|
51
48
|
if (error) return (0, _styledComponents.css)`
|
|
52
|
-
outline:
|
|
49
|
+
outline: var(--borderWidth200) solid var(--colorsSemanticNegative500);
|
|
53
50
|
`;
|
|
54
51
|
if (warning) return (0, _styledComponents.css)`
|
|
55
|
-
outline:
|
|
52
|
+
outline: var(--borderWidth200) solid var(--colorsSemanticCaution500);
|
|
56
53
|
`;
|
|
57
54
|
if (info) return (0, _styledComponents.css)`
|
|
58
|
-
outline:
|
|
55
|
+
outline: var(--borderWidth200) solid var(--colorsSemanticInfo500);
|
|
59
56
|
`;
|
|
60
57
|
return "";
|
|
61
58
|
}}
|
|
62
59
|
`;
|
|
63
|
-
exports.StyledColorOptions = StyledColorOptions;
|
|
64
|
-
StyledColorOptions.defaultProps = {
|
|
65
|
-
theme: _base.default
|
|
66
|
-
};
|
|
60
|
+
exports.StyledColorOptions = StyledColorOptions;
|
|
@@ -11,15 +11,13 @@ var _icon = _interopRequireDefault(require("../../icon"));
|
|
|
11
11
|
|
|
12
12
|
var _getRgbValues = _interopRequireDefault(require("../../../style/utils/get-rgb-values"));
|
|
13
13
|
|
|
14
|
-
var _base = _interopRequireDefault(require("../../../style/themes/base"));
|
|
15
|
-
|
|
16
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
15
|
|
|
18
16
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
19
17
|
|
|
20
18
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
19
|
|
|
22
|
-
const getIconColor =
|
|
20
|
+
const getIconColor = color => {
|
|
23
21
|
const rgbValues = (0, _getRgbValues.default)(color);
|
|
24
22
|
const [r, g, b] = rgbValues; // color contrast calculating formula as per W3 suggestions
|
|
25
23
|
|
|
@@ -27,8 +25,8 @@ const getIconColor = (color, theme) => {
|
|
|
27
25
|
greenMultiplier = 587,
|
|
28
26
|
blueMultiplier = 114;
|
|
29
27
|
const contrast = (Math.round(r * redMultiplier) + Math.round(g * greenMultiplier) + Math.round(b * blueMultiplier)) / 1000;
|
|
30
|
-
if (contrast < 128) return
|
|
31
|
-
return
|
|
28
|
+
if (contrast < 128) return "var(--colorsActionMajorYang100)";
|
|
29
|
+
return "var(--colorsActionMajorYin090)";
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
const StyledTickIcon = (0, _styledComponents.default)(_icon.default)`
|
|
@@ -40,9 +38,8 @@ const StyledTickIcon = (0, _styledComponents.default)(_icon.default)`
|
|
|
40
38
|
&::before {
|
|
41
39
|
font-size: 22px;
|
|
42
40
|
color: ${({
|
|
43
|
-
color
|
|
44
|
-
|
|
45
|
-
}) => getIconColor(color, theme)};
|
|
41
|
+
color
|
|
42
|
+
}) => getIconColor(color)};
|
|
46
43
|
}
|
|
47
44
|
|
|
48
45
|
${({
|
|
@@ -53,8 +50,5 @@ const StyledTickIcon = (0, _styledComponents.default)(_icon.default)`
|
|
|
53
50
|
}
|
|
54
51
|
`}
|
|
55
52
|
`;
|
|
56
|
-
StyledTickIcon.defaultProps = {
|
|
57
|
-
theme: _base.default
|
|
58
|
-
};
|
|
59
53
|
var _default = StyledTickIcon;
|
|
60
54
|
exports.default = _default;
|