carbon-react 102.3.0 → 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.
|
@@ -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 = {
|