carbon-react 102.0.1 → 102.4.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/__internal__/label/icon-wrapper.style.js +1 -8
- package/lib/__internal__/label/label.style.js +13 -24
- package/lib/components/link/link.style.js +10 -10
- package/lib/components/message/message.style.js +8 -5
- package/lib/components/message/type-icon/type-icon.style.js +9 -10
- package/lib/components/radio-button/radio-button.style.js +4 -5
- package/package.json +1 -2
|
@@ -11,8 +11,6 @@ var _validationIcon = _interopRequireDefault(require("../validations/validation-
|
|
|
11
11
|
|
|
12
12
|
var _help = _interopRequireDefault(require("../../components/help/help.style"));
|
|
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
|
const IconWrapperStyle = _styledComponents.default.div`
|
|
@@ -27,17 +25,12 @@ const IconWrapperStyle = _styledComponents.default.div`
|
|
|
27
25
|
vertical-align: top;
|
|
28
26
|
|
|
29
27
|
:focus {
|
|
30
|
-
outline:
|
|
31
|
-
theme
|
|
32
|
-
}) => `2px solid ${theme.colors.focus}`};
|
|
28
|
+
outline: 2px solid var(--colorsSemanticFocus500);
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
${_validationIcon.default}, ${_help.default} {
|
|
36
32
|
position: static;
|
|
37
33
|
}
|
|
38
34
|
`;
|
|
39
|
-
IconWrapperStyle.defaultProps = {
|
|
40
|
-
theme: _base.default
|
|
41
|
-
};
|
|
42
35
|
var _default = IconWrapperStyle;
|
|
43
36
|
exports.default = _default;
|
|
@@ -9,8 +9,6 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
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; }
|
|
@@ -18,36 +16,30 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
18
16
|
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; }
|
|
19
17
|
|
|
20
18
|
const LabelStyle = _styledComponents.default.label`
|
|
21
|
-
color:
|
|
22
|
-
theme
|
|
23
|
-
}) => theme.text.color};
|
|
19
|
+
color: var(--colorsYin090);
|
|
24
20
|
display: block;
|
|
25
|
-
font-weight: 600;
|
|
21
|
+
font-weight: 600; //TODO: (tokens) use token var(--fontWeights500)
|
|
26
22
|
|
|
27
23
|
${({
|
|
28
|
-
isRequired
|
|
29
|
-
theme
|
|
24
|
+
isRequired
|
|
30
25
|
}) => isRequired && (0, _styledComponents.css)`
|
|
31
26
|
::after {
|
|
32
27
|
content: "*";
|
|
33
|
-
color:
|
|
28
|
+
color: var(--colorsSemanticNegative500);
|
|
34
29
|
font-weight: 700;
|
|
35
|
-
margin-left:
|
|
30
|
+
margin-left: var(--spacing100);
|
|
36
31
|
}
|
|
37
32
|
`}
|
|
38
33
|
|
|
39
34
|
${({
|
|
40
|
-
disabled
|
|
41
|
-
theme
|
|
35
|
+
disabled
|
|
42
36
|
}) => disabled && (0, _styledComponents.css)`
|
|
43
|
-
color:
|
|
37
|
+
color: var(--colorsYin030);
|
|
44
38
|
`}
|
|
45
39
|
`;
|
|
46
|
-
LabelStyle.defaultProps = {
|
|
47
|
-
theme: _base.default
|
|
48
|
-
};
|
|
49
40
|
LabelStyle.propTypes = {
|
|
50
|
-
disabled: _propTypes.default.bool
|
|
41
|
+
disabled: _propTypes.default.bool,
|
|
42
|
+
isRequired: _propTypes.default.bool
|
|
51
43
|
};
|
|
52
44
|
const StyledLabelContainer = _styledComponents.default.div`
|
|
53
45
|
display: flex;
|
|
@@ -59,16 +51,15 @@ const StyledLabelContainer = _styledComponents.default.div`
|
|
|
59
51
|
inline,
|
|
60
52
|
pr,
|
|
61
53
|
pl,
|
|
62
|
-
width
|
|
63
|
-
theme
|
|
54
|
+
width
|
|
64
55
|
}) => inline && (0, _styledComponents.css)`
|
|
65
56
|
box-sizing: border-box;
|
|
66
57
|
margin-bottom: 0;
|
|
67
58
|
${pr && (0, _styledComponents.css)`
|
|
68
|
-
padding-right: ${pr
|
|
59
|
+
padding-right: var(${pr === 1 ? "--spacing100" : "--spacing200"});
|
|
69
60
|
`};
|
|
70
61
|
${pl && (0, _styledComponents.css)`
|
|
71
|
-
padding-left: ${pl
|
|
62
|
+
padding-left: var(${pl === 1 ? "--spacing100" : "--spacing200"});
|
|
72
63
|
`};
|
|
73
64
|
justify-content: ${align === "right" ? "flex-end" : "flex-start"};
|
|
74
65
|
width: ${width === 0 ? StyledLabelContainer.defaultProps.width : width}%;
|
|
@@ -79,7 +70,7 @@ const StyledLabelContainer = _styledComponents.default.div`
|
|
|
79
70
|
}) => optional && (0, _styledComponents.css)`
|
|
80
71
|
::after {
|
|
81
72
|
content: "(optional)";
|
|
82
|
-
font-weight: 350;
|
|
73
|
+
font-weight: 350; //TODO: (tokens) use token var(--fontWeights400)
|
|
83
74
|
margin-left: 4px;
|
|
84
75
|
}
|
|
85
76
|
`}
|
|
@@ -87,14 +78,12 @@ const StyledLabelContainer = _styledComponents.default.div`
|
|
|
87
78
|
exports.StyledLabelContainer = StyledLabelContainer;
|
|
88
79
|
StyledLabelContainer.defaultProps = {
|
|
89
80
|
align: "right",
|
|
90
|
-
theme: _base.default,
|
|
91
81
|
width: 30
|
|
92
82
|
};
|
|
93
83
|
StyledLabelContainer.propTypes = {
|
|
94
84
|
align: _propTypes.default.oneOf(["left", "right"]),
|
|
95
85
|
inline: _propTypes.default.bool,
|
|
96
86
|
width: _propTypes.default.number,
|
|
97
|
-
readOnly: _propTypes.default.bool,
|
|
98
87
|
pr: _propTypes.default.number,
|
|
99
88
|
pl: _propTypes.default.number
|
|
100
89
|
};
|
|
@@ -37,8 +37,8 @@ const StyledLink = _styledComponents.default.span`
|
|
|
37
37
|
line-height: 36px;
|
|
38
38
|
left: -999em;
|
|
39
39
|
z-index: ${theme.zIndex.aboveAll};
|
|
40
|
-
box-shadow: inset 0 0 0 2px
|
|
41
|
-
border: 2px solid
|
|
40
|
+
box-shadow: inset 0 0 0 2px var(--colorsActionMajor500);
|
|
41
|
+
border: 2px solid var(--colorsYang100);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
a:focus {
|
|
@@ -51,38 +51,38 @@ const StyledLink = _styledComponents.default.span`
|
|
|
51
51
|
button {
|
|
52
52
|
font-size: ${isSkipLink ? "16px" : "14px"};
|
|
53
53
|
text-decoration: underline;
|
|
54
|
-
color: ${isSkipLink ?
|
|
54
|
+
color: ${isSkipLink ? "var(--colorsYin090)" : "var(--colorsActionMajor500)"};
|
|
55
55
|
display: inline-block;
|
|
56
56
|
${_icon.default} {
|
|
57
57
|
display: inline-block;
|
|
58
58
|
position: relative;
|
|
59
59
|
vertical-align: middle;
|
|
60
60
|
${iconAlign === "left" && (0, _styledComponents.css)`
|
|
61
|
-
margin-right: ${hasContent ? "
|
|
61
|
+
margin-right: ${hasContent ? "var(--spacing100)" : 0};
|
|
62
62
|
`}
|
|
63
63
|
${iconAlign === "right" && (0, _styledComponents.css)`
|
|
64
64
|
margin-right: 0;
|
|
65
|
-
margin-left: ${hasContent ? "
|
|
65
|
+
margin-left: ${hasContent ? "var(--spacing100)" : 0};
|
|
66
66
|
`}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
&:hover {
|
|
70
70
|
cursor: pointer;
|
|
71
|
-
color: ${isSkipLink ?
|
|
71
|
+
color: ${isSkipLink ? "var(--colorsYin090)" : "var(--colorsActionMajor600)"};
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
&:focus {
|
|
75
|
-
color:
|
|
76
|
-
background-color: ${isSkipLink ?
|
|
75
|
+
color: var(--colorsYin090);
|
|
76
|
+
background-color: ${isSkipLink ? "var(--colorsYang100)" : "var(--colorsSemanticFocus250)"};
|
|
77
77
|
outline: none;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
${disabled && (0, _styledComponents.css)`
|
|
81
|
-
color:
|
|
81
|
+
color: var(--colorsYin065);
|
|
82
82
|
&:hover,
|
|
83
83
|
&:focus {
|
|
84
84
|
cursor: not-allowed;
|
|
85
|
-
color:
|
|
85
|
+
color: var(--colorsYin065);
|
|
86
86
|
}
|
|
87
87
|
`}
|
|
88
88
|
}
|
|
@@ -21,18 +21,21 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
|
|
|
21
21
|
|
|
22
22
|
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; }
|
|
23
23
|
|
|
24
|
+
const messageVariants = {
|
|
25
|
+
error: "var(--colorsSemanticNegative500)",
|
|
26
|
+
info: "var(--colorsSemanticNeutral500)",
|
|
27
|
+
success: "var(--colorsSemanticPositive500)",
|
|
28
|
+
warning: "var(--colorsSemanticCaution500)"
|
|
29
|
+
};
|
|
24
30
|
const MessageStyle = _styledComponents.default.div`
|
|
25
31
|
position: relative;
|
|
26
32
|
display: flex;
|
|
27
33
|
justify-content: flex-start;
|
|
28
34
|
align-content: center;
|
|
29
35
|
border: 1px solid ${({
|
|
30
|
-
theme,
|
|
31
36
|
variant
|
|
32
|
-
}) =>
|
|
33
|
-
background-color:
|
|
34
|
-
theme
|
|
35
|
-
}) => theme.colors.white};
|
|
37
|
+
}) => messageVariants[variant]};
|
|
38
|
+
background-color: var(--colorsUtilityYang100);
|
|
36
39
|
min-height: 38px;
|
|
37
40
|
|
|
38
41
|
${({
|
|
@@ -9,20 +9,23 @@ var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
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; }
|
|
17
15
|
|
|
18
16
|
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; }
|
|
19
17
|
|
|
18
|
+
const messageVariants = {
|
|
19
|
+
error: "var(--colorsSemanticNegative500)",
|
|
20
|
+
info: "var(--colorsSemanticNeutral500)",
|
|
21
|
+
success: "var(--colorsSemanticPositive500)",
|
|
22
|
+
warning: "var(--colorsSemanticCaution500)"
|
|
23
|
+
};
|
|
20
24
|
const TypeIconStyle = _styledComponents.default.div`
|
|
21
25
|
align-items: center;
|
|
22
26
|
background-color: ${({
|
|
23
|
-
theme,
|
|
24
27
|
variant
|
|
25
|
-
}) =>
|
|
28
|
+
}) => messageVariants[variant]};
|
|
26
29
|
display: flex;
|
|
27
30
|
justify-content: center;
|
|
28
31
|
line-height: 100%;
|
|
@@ -30,28 +33,24 @@ const TypeIconStyle = _styledComponents.default.div`
|
|
|
30
33
|
text-align: center;
|
|
31
34
|
span {
|
|
32
35
|
&:before {
|
|
33
|
-
color:
|
|
34
|
-
theme
|
|
35
|
-
}) => theme.colors.white};
|
|
36
|
+
color: var(--colorsUtilityYang100);
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
${({
|
|
40
|
-
theme,
|
|
41
41
|
transparent,
|
|
42
42
|
variant
|
|
43
43
|
}) => transparent && (0, _styledComponents.css)`
|
|
44
44
|
background-color: transparent;
|
|
45
45
|
span {
|
|
46
46
|
&:before {
|
|
47
|
-
color: ${
|
|
47
|
+
color: ${messageVariants[variant]};
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
`}
|
|
51
51
|
`;
|
|
52
52
|
TypeIconStyle.defaultProps = {
|
|
53
53
|
variant: "info",
|
|
54
|
-
theme: _base.default,
|
|
55
54
|
transparent: false
|
|
56
55
|
};
|
|
57
56
|
TypeIconStyle.propTypes = {
|
|
@@ -37,10 +37,9 @@ const RadioButtonStyle = (0, _styledComponents.default)(_checkbox.default)`
|
|
|
37
37
|
fieldHelpInline,
|
|
38
38
|
reverse,
|
|
39
39
|
size,
|
|
40
|
-
theme,
|
|
41
40
|
inline
|
|
42
41
|
}) => (0, _styledComponents.css)`
|
|
43
|
-
margin-bottom:
|
|
42
|
+
margin-bottom: var(--spacing150);
|
|
44
43
|
|
|
45
44
|
:last-of-type {
|
|
46
45
|
margin-bottom: 0;
|
|
@@ -79,16 +78,16 @@ const RadioButtonStyle = (0, _styledComponents.default)(_checkbox.default)`
|
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
${_hiddenCheckableInput.default}:checked + ${_checkableInputSvgWrapper.default} circle {
|
|
82
|
-
fill:
|
|
81
|
+
fill: var(--colorsUtilityYin090);
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
${disabled && (0, _styledComponents.css)`
|
|
86
85
|
circle {
|
|
87
|
-
fill:
|
|
86
|
+
fill: var(--colorsCtilityDisabled400);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
${_hiddenCheckableInput.default}:checked + ${_checkableInputSvgWrapper.default} circle {
|
|
91
|
-
fill:
|
|
90
|
+
fill: var(--colorsUtilityDisabled600);
|
|
92
91
|
}
|
|
93
92
|
`}
|
|
94
93
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "102.0
|
|
3
|
+
"version": "102.4.0",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"engineStrict": true,
|
|
6
6
|
"engines": {
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
"test-update": "jest --config=./jest.conf.json --updateSnapshot",
|
|
20
20
|
"test:cypress": "cypress open",
|
|
21
21
|
"cypress:react": "npx cypress open-ct",
|
|
22
|
-
"cypress:ci:react": "npx cypress run-ct --spec './src/components/**/*.test.js' --record --key --parallel --group 'ubuntu-cypress-react' --browser=chrome",
|
|
23
22
|
"debug": "node --inspect ./node_modules/jest-cli/bin/jest --watch --config=./jest.conf.json",
|
|
24
23
|
"format": "prettier --write './src'",
|
|
25
24
|
"lint": "eslint ./src",
|