carbon-react 154.2.0 → 154.3.1
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/esm/components/decimal/decimal.component.js +3 -0
- package/esm/components/heading/heading.style.js +0 -1
- package/esm/components/typography/typography.style.js +10 -10
- package/lib/components/decimal/decimal.component.js +3 -0
- package/lib/components/heading/heading.style.js +0 -1
- package/lib/components/typography/typography.style.js +10 -10
- package/package.json +2 -2
|
@@ -146,6 +146,9 @@ export const Decimal = /*#__PURE__*/React.forwardRef(({
|
|
|
146
146
|
const message = "Input elements should not switch from uncontrolled to controlled (or vice versa). " + "Decide between using a controlled or uncontrolled input element for the lifetime of the component";
|
|
147
147
|
!(prevControlledRef.current !== isControlled) ? process.env.NODE_ENV !== "production" ? invariant(false, message) : invariant(false) : void 0;
|
|
148
148
|
prevControlledRef.current = isControlled;
|
|
149
|
+
return () => {
|
|
150
|
+
prevControlledRef.current = null;
|
|
151
|
+
};
|
|
149
152
|
}, [isControlled]);
|
|
150
153
|
const prevValue = usePrevious(value);
|
|
151
154
|
useEffect(() => {
|
|
@@ -6,14 +6,14 @@ import visuallyHidden from "../../style/utils/visually-hidden";
|
|
|
6
6
|
const getSize = variant => {
|
|
7
7
|
switch (variant) {
|
|
8
8
|
case "h1-large":
|
|
9
|
-
return "
|
|
9
|
+
return "40px";
|
|
10
10
|
case "h1":
|
|
11
|
-
return "
|
|
11
|
+
return "30px";
|
|
12
12
|
case "h2":
|
|
13
|
-
return "
|
|
13
|
+
return "24px";
|
|
14
14
|
case "h3":
|
|
15
15
|
case "segment-header":
|
|
16
|
-
return "
|
|
16
|
+
return "21px";
|
|
17
17
|
case "h4":
|
|
18
18
|
case "segment-header-small":
|
|
19
19
|
return "18px";
|
|
@@ -38,19 +38,19 @@ const getSize = variant => {
|
|
|
38
38
|
const getLineHeight = variant => {
|
|
39
39
|
switch (variant) {
|
|
40
40
|
case "h1-large":
|
|
41
|
-
return "
|
|
41
|
+
return "50px";
|
|
42
42
|
case "h1":
|
|
43
|
-
return "
|
|
43
|
+
return "37.5px";
|
|
44
44
|
case "h2":
|
|
45
|
-
return "
|
|
45
|
+
return "30px";
|
|
46
46
|
case "h3":
|
|
47
|
-
return "25px";
|
|
47
|
+
return "26.25px";
|
|
48
48
|
case "h4":
|
|
49
49
|
return "22.5px";
|
|
50
50
|
case "h5":
|
|
51
51
|
return "20px";
|
|
52
52
|
case "segment-header":
|
|
53
|
-
return "25px";
|
|
53
|
+
return "26.25px";
|
|
54
54
|
case "segment-header-small":
|
|
55
55
|
return "22.5px";
|
|
56
56
|
case "segment-subheader":
|
|
@@ -75,10 +75,10 @@ const getWeight = variant => {
|
|
|
75
75
|
switch (variant) {
|
|
76
76
|
case "h1-large":
|
|
77
77
|
case "h1":
|
|
78
|
+
case "h2":
|
|
78
79
|
case "segment-header":
|
|
79
80
|
case "segment-header-small":
|
|
80
81
|
return "700";
|
|
81
|
-
case "h2":
|
|
82
82
|
case "h3":
|
|
83
83
|
case "segment-subheader":
|
|
84
84
|
case "segment-subheader-alt":
|
|
@@ -155,6 +155,9 @@ const Decimal = exports.Decimal = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
155
155
|
const message = "Input elements should not switch from uncontrolled to controlled (or vice versa). " + "Decide between using a controlled or uncontrolled input element for the lifetime of the component";
|
|
156
156
|
!(prevControlledRef.current !== isControlled) ? process.env.NODE_ENV !== "production" ? (0, _invariant.default)(false, message) : (0, _invariant.default)(false) : void 0;
|
|
157
157
|
prevControlledRef.current = isControlled;
|
|
158
|
+
return () => {
|
|
159
|
+
prevControlledRef.current = null;
|
|
160
|
+
};
|
|
158
161
|
}, [isControlled]);
|
|
159
162
|
const prevValue = (0, _usePrevious.default)(value);
|
|
160
163
|
(0, _react.useEffect)(() => {
|
|
@@ -84,7 +84,6 @@ StyledHeadingBackButton.defaultProps = {
|
|
|
84
84
|
theme: _base.default
|
|
85
85
|
};
|
|
86
86
|
const StyledHeadingTitle = exports.StyledHeadingTitle = (0, _styledComponents.default)(_typography.default)`
|
|
87
|
-
line-height: 32px;
|
|
88
87
|
${({
|
|
89
88
|
withMargin
|
|
90
89
|
}) => withMargin ? (0, _styledComponents.css)`
|
|
@@ -15,14 +15,14 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
15
15
|
const getSize = variant => {
|
|
16
16
|
switch (variant) {
|
|
17
17
|
case "h1-large":
|
|
18
|
-
return "
|
|
18
|
+
return "40px";
|
|
19
19
|
case "h1":
|
|
20
|
-
return "
|
|
20
|
+
return "30px";
|
|
21
21
|
case "h2":
|
|
22
|
-
return "
|
|
22
|
+
return "24px";
|
|
23
23
|
case "h3":
|
|
24
24
|
case "segment-header":
|
|
25
|
-
return "
|
|
25
|
+
return "21px";
|
|
26
26
|
case "h4":
|
|
27
27
|
case "segment-header-small":
|
|
28
28
|
return "18px";
|
|
@@ -47,19 +47,19 @@ const getSize = variant => {
|
|
|
47
47
|
const getLineHeight = variant => {
|
|
48
48
|
switch (variant) {
|
|
49
49
|
case "h1-large":
|
|
50
|
-
return "
|
|
50
|
+
return "50px";
|
|
51
51
|
case "h1":
|
|
52
|
-
return "
|
|
52
|
+
return "37.5px";
|
|
53
53
|
case "h2":
|
|
54
|
-
return "
|
|
54
|
+
return "30px";
|
|
55
55
|
case "h3":
|
|
56
|
-
return "25px";
|
|
56
|
+
return "26.25px";
|
|
57
57
|
case "h4":
|
|
58
58
|
return "22.5px";
|
|
59
59
|
case "h5":
|
|
60
60
|
return "20px";
|
|
61
61
|
case "segment-header":
|
|
62
|
-
return "25px";
|
|
62
|
+
return "26.25px";
|
|
63
63
|
case "segment-header-small":
|
|
64
64
|
return "22.5px";
|
|
65
65
|
case "segment-subheader":
|
|
@@ -84,10 +84,10 @@ const getWeight = variant => {
|
|
|
84
84
|
switch (variant) {
|
|
85
85
|
case "h1-large":
|
|
86
86
|
case "h1":
|
|
87
|
+
case "h2":
|
|
87
88
|
case "segment-header":
|
|
88
89
|
case "segment-header-small":
|
|
89
90
|
return "700";
|
|
90
|
-
case "h2":
|
|
91
91
|
case "h3":
|
|
92
92
|
case "segment-subheader":
|
|
93
93
|
case "segment-subheader-alt":
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "carbon-react",
|
|
3
|
-
"version": "154.
|
|
3
|
+
"version": "154.3.1",
|
|
4
4
|
"description": "A library of reusable React components for easily building user interfaces.",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@storybook/types": "~8.6.7",
|
|
92
92
|
"@testing-library/dom": "^10.4.0",
|
|
93
93
|
"@testing-library/jest-dom": "^6.6.3",
|
|
94
|
-
"@testing-library/react": "^16.
|
|
94
|
+
"@testing-library/react": "^16.3.0",
|
|
95
95
|
"@testing-library/user-event": "^14.5.2",
|
|
96
96
|
"@types/crypto-js": "^4.2.1",
|
|
97
97
|
"@types/glob": "^8.1.0",
|