carbon-react 102.7.2 → 102.8.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/lib/components/checkbox/checkbox.style.js +20 -18
- package/lib/components/date-range/date-range.component.js +5 -5
- package/lib/components/dialog/dialog.style.js +0 -1
- package/lib/components/dialog-full-screen/content.style.js +23 -29
- package/lib/components/dialog-full-screen/dialog-full-screen.component.js +1 -16
- package/lib/components/dialog-full-screen/dialog-full-screen.style.js +6 -0
- package/lib/components/form/form.style.js +6 -2
- package/lib/components/pages/page/page.component.js +8 -2
- package/lib/components/pages/pages.style.js +0 -6
- package/lib/components/sidebar/sidebar.component.js +2 -1
- package/lib/components/split-button/split-button.component.js +2 -1
- package/package.json +1 -1
|
@@ -47,8 +47,7 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
47
47
|
inputWidth,
|
|
48
48
|
reverse,
|
|
49
49
|
size,
|
|
50
|
-
adaptiveSpacingSmallScreen
|
|
51
|
-
theme
|
|
50
|
+
adaptiveSpacingSmallScreen
|
|
52
51
|
}) => (0, _styledComponents.css)`
|
|
53
52
|
${adaptiveSpacingSmallScreen && "margin-left: 0;"}
|
|
54
53
|
|
|
@@ -61,13 +60,13 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
svg {
|
|
64
|
-
background-color:
|
|
63
|
+
background-color: var(--colorsUtilityYang100);
|
|
65
64
|
${!disabled && (0, _styledComponents.css)`
|
|
66
|
-
border: 1px solid
|
|
65
|
+
border: 1px solid var(--colorsUtilityMajor300);
|
|
67
66
|
|
|
68
|
-
${info && `border: 1px solid
|
|
69
|
-
${warning && `border: 1px solid
|
|
70
|
-
${error && `border: 2px solid
|
|
67
|
+
${info && `border: 1px solid var(--colorsSemanticInfo500);`}
|
|
68
|
+
${warning && `border: 1px solid var(--colorsSemanticCaution500);`}
|
|
69
|
+
${error && `border: 2px solid var(--colorsSemanticNegative500);`}
|
|
71
70
|
`}
|
|
72
71
|
}
|
|
73
72
|
|
|
@@ -91,7 +90,7 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
91
90
|
${_hiddenCheckableInput.default}:not([disabled]) {
|
|
92
91
|
&:focus + ${_checkableInputSvgWrapper.default},
|
|
93
92
|
&:hover + ${_checkableInputSvgWrapper.default} {
|
|
94
|
-
box-shadow: 0 0 0 3px
|
|
93
|
+
box-shadow: 0 0 0 3px var(--colorsSemanticFocus500);
|
|
95
94
|
}
|
|
96
95
|
}
|
|
97
96
|
|
|
@@ -103,7 +102,7 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
103
102
|
${_fieldHelp.default} {
|
|
104
103
|
margin-left: 16px;
|
|
105
104
|
margin-top: 0;
|
|
106
|
-
padding-left: ${labelSpacing
|
|
105
|
+
padding-left: ${labelSpacing === 1 ? "var(--spacing100)" : "var(--spacing200)"};
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
${_validationIcon.default} {
|
|
@@ -126,7 +125,7 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
126
125
|
|
|
127
126
|
${_fieldHelp.default} {
|
|
128
127
|
margin-left: 24px;
|
|
129
|
-
padding-left: ${labelSpacing
|
|
128
|
+
padding-left: ${labelSpacing === 1 ? "var(--spacing100)" : "var(--spacing200)"};
|
|
130
129
|
}
|
|
131
130
|
|
|
132
131
|
${fieldHelpInline && (0, _styledComponents.css)`
|
|
@@ -137,21 +136,21 @@ const CheckboxStyle = _styledComponents.default.div`
|
|
|
137
136
|
`}
|
|
138
137
|
|
|
139
138
|
${_hiddenCheckableInput.default}:checked ~ ${_checkableInputSvgWrapper.default} svg path {
|
|
140
|
-
fill:
|
|
139
|
+
fill: var(--colorsUtilityYin090);
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
${disabled && (0, _styledComponents.css)`
|
|
144
143
|
svg {
|
|
145
|
-
background-color:
|
|
146
|
-
border: 1px solid
|
|
144
|
+
background-color: var(--colorsUtilityDisabled400);
|
|
145
|
+
border: 1px solid var(--colorsUtilityDisabled600);
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
svg path {
|
|
150
|
-
fill:
|
|
149
|
+
fill: var(--colorsUtilityDisabled400);
|
|
151
150
|
}
|
|
152
151
|
|
|
153
152
|
${_hiddenCheckableInput.default}:checked ~ ${_checkableInputSvgWrapper.default} svg path {
|
|
154
|
-
fill:
|
|
153
|
+
fill: var(--colorsUtilityYin030);
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
${_checkableInputSvgWrapper.default} {
|
|
@@ -211,7 +210,10 @@ CheckboxStyle.propTypes = {
|
|
|
211
210
|
info: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string]),
|
|
212
211
|
fieldHelpInline: _propTypes.default.bool,
|
|
213
212
|
inputWidth: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]),
|
|
214
|
-
size: _propTypes.default.string
|
|
213
|
+
size: _propTypes.default.string,
|
|
214
|
+
labelSpacing: _propTypes.default.oneOf([1, 2]),
|
|
215
|
+
reverse: _propTypes.default.bool,
|
|
216
|
+
adaptiveSpacingSmallScreen: _propTypes.default.bool
|
|
215
217
|
};
|
|
216
218
|
const StyledCheckboxGroup = _styledComponents.default.div`
|
|
217
219
|
display: flex;
|
|
@@ -249,8 +251,8 @@ const StyledCheckboxGroup = _styledComponents.default.div`
|
|
|
249
251
|
`}
|
|
250
252
|
`;
|
|
251
253
|
exports.StyledCheckboxGroup = StyledCheckboxGroup;
|
|
252
|
-
StyledCheckboxGroup.
|
|
253
|
-
|
|
254
|
+
StyledCheckboxGroup.propTypes = {
|
|
255
|
+
legendInline: _propTypes.default.bool
|
|
254
256
|
};
|
|
255
257
|
var _default = CheckboxStyle;
|
|
256
258
|
exports.default = _default;
|
|
@@ -89,7 +89,7 @@ const DateRange = ({
|
|
|
89
89
|
...localeData
|
|
90
90
|
}),
|
|
91
91
|
rawValue: _date2.default.formatValue({
|
|
92
|
-
value: getStartDate() || (
|
|
92
|
+
value: getStartDate() || (startDateProps.allowEmptyValue ? "" : today),
|
|
93
93
|
...localeData
|
|
94
94
|
})
|
|
95
95
|
});
|
|
@@ -99,7 +99,7 @@ const DateRange = ({
|
|
|
99
99
|
...localeData
|
|
100
100
|
}),
|
|
101
101
|
rawValue: _date2.default.formatValue({
|
|
102
|
-
value: getEndDate() || (
|
|
102
|
+
value: getEndDate() || (endDateProps.allowEmptyValue ? "" : today),
|
|
103
103
|
...localeData
|
|
104
104
|
})
|
|
105
105
|
});
|
|
@@ -110,7 +110,7 @@ const DateRange = ({
|
|
|
110
110
|
...localeData
|
|
111
111
|
}),
|
|
112
112
|
rawValue: _date2.default.formatValue({
|
|
113
|
-
value: getStartDate() || today,
|
|
113
|
+
value: getStartDate() || (startDateProps.allowEmptyValue ? "" : today),
|
|
114
114
|
...localeData
|
|
115
115
|
})
|
|
116
116
|
});
|
|
@@ -120,11 +120,11 @@ const DateRange = ({
|
|
|
120
120
|
...localeData
|
|
121
121
|
}),
|
|
122
122
|
rawValue: _date2.default.formatValue({
|
|
123
|
-
value: getEndDate() || today,
|
|
123
|
+
value: getEndDate() || (endDateProps.allowEmptyValue ? "" : today),
|
|
124
124
|
...localeData
|
|
125
125
|
})
|
|
126
126
|
});
|
|
127
|
-
}, [getEndDate, getStartDate, localeData, today]);
|
|
127
|
+
}, [getEndDate, getStartDate, endDateProps, startDateProps, localeData, today]);
|
|
128
128
|
|
|
129
129
|
function usePrevious(arg) {
|
|
130
130
|
const ref = (0, _react.useRef)();
|
|
@@ -18,37 +18,31 @@ const StyledContent = _styledComponents.default.div`
|
|
|
18
18
|
padding: 0 16px;
|
|
19
19
|
flex: 1;
|
|
20
20
|
|
|
21
|
-
${
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
padding-right: 16px;
|
|
28
|
-
padding-left: 16px;
|
|
29
|
-
margin-right: -16px;
|
|
30
|
-
margin-left: -16px;
|
|
21
|
+
${_form.StyledFormContent}.sticky {
|
|
22
|
+
padding-right: 16px;
|
|
23
|
+
padding-left: 16px;
|
|
24
|
+
margin-right: -16px;
|
|
25
|
+
margin-left: -16px;
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
@media screen and (min-width: 960px) {
|
|
39
|
-
padding-right: 32px;
|
|
40
|
-
padding-left: 32px;
|
|
41
|
-
margin-right: -32px;
|
|
42
|
-
margin-left: -32px;
|
|
43
|
-
}
|
|
44
|
-
@media screen and (min-width: 1260px) {
|
|
45
|
-
padding-right: 40px;
|
|
46
|
-
padding-left: 40px;
|
|
47
|
-
margin-right: -40px;
|
|
48
|
-
margin-left: -40px;
|
|
49
|
-
}
|
|
27
|
+
@media screen and (min-width: 600px) {
|
|
28
|
+
padding-right: 24px;
|
|
29
|
+
padding-left: 24px;
|
|
30
|
+
margin-right: -24px;
|
|
31
|
+
margin-left: -24px;
|
|
50
32
|
}
|
|
51
|
-
|
|
33
|
+
@media screen and (min-width: 960px) {
|
|
34
|
+
padding-right: 32px;
|
|
35
|
+
padding-left: 32px;
|
|
36
|
+
margin-right: -32px;
|
|
37
|
+
margin-left: -32px;
|
|
38
|
+
}
|
|
39
|
+
@media screen and (min-width: 1260px) {
|
|
40
|
+
padding-right: 40px;
|
|
41
|
+
padding-left: 40px;
|
|
42
|
+
margin-right: -40px;
|
|
43
|
+
margin-left: -40px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
52
46
|
|
|
53
47
|
${_form.StyledFormFooter}.sticky {
|
|
54
48
|
padding: 16px;
|
|
@@ -25,8 +25,6 @@ var _iconButton = _interopRequireDefault(require("../icon-button"));
|
|
|
25
25
|
|
|
26
26
|
var _icon = _interopRequireDefault(require("../icon"));
|
|
27
27
|
|
|
28
|
-
var _useResizeObserver = _interopRequireDefault(require("../../hooks/__internal__/useResizeObserver"));
|
|
29
|
-
|
|
30
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
29
|
|
|
32
30
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -54,18 +52,6 @@ const DialogFullScreen = ({
|
|
|
54
52
|
}) => {
|
|
55
53
|
const dialogRef = (0, _react.useRef)();
|
|
56
54
|
const headingRef = (0, _react.useRef)();
|
|
57
|
-
const [headingHeight, setHeadingHeight] = (0, _react.useState)(101);
|
|
58
|
-
|
|
59
|
-
const updateheadingHeight = () => {
|
|
60
|
-
setHeadingHeight(headingRef.current.offsetHeight);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
(0, _react.useEffect)(() => {
|
|
64
|
-
if (open && headingRef.current) {
|
|
65
|
-
updateheadingHeight();
|
|
66
|
-
}
|
|
67
|
-
}, [open]);
|
|
68
|
-
(0, _useResizeObserver.default)(headingRef, updateheadingHeight, !headingRef.current);
|
|
69
55
|
|
|
70
56
|
const closeIcon = () => {
|
|
71
57
|
if (!showCloseIcon || !onCancel) return null;
|
|
@@ -111,8 +97,7 @@ const DialogFullScreen = ({
|
|
|
111
97
|
hasHeader: title !== undefined,
|
|
112
98
|
"data-element": "content",
|
|
113
99
|
ref: contentRef,
|
|
114
|
-
disableContentPadding: disableContentPadding
|
|
115
|
-
headingHeight: headingHeight
|
|
100
|
+
disableContentPadding: disableContentPadding
|
|
116
101
|
}, children), closeIcon())));
|
|
117
102
|
};
|
|
118
103
|
|
|
@@ -17,6 +17,8 @@ var _fullScreenHeading = _interopRequireDefault(require("../../__internal__/full
|
|
|
17
17
|
|
|
18
18
|
var _heading = require("../heading/heading.style");
|
|
19
19
|
|
|
20
|
+
var _form = require("../form/form.style");
|
|
21
|
+
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
24
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
|
|
@@ -38,6 +40,10 @@ const StyledDialogFullScreen = _styledComponents.default.div`
|
|
|
38
40
|
display: flex;
|
|
39
41
|
flex-direction: column;
|
|
40
42
|
|
|
43
|
+
${_form.StyledForm} {
|
|
44
|
+
min-height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
41
47
|
${_heading.StyledHeaderContent} {
|
|
42
48
|
align-items: baseline;
|
|
43
49
|
}
|
|
@@ -39,7 +39,7 @@ const StyledFormContent = _styledComponents.default.div`
|
|
|
39
39
|
}) => (0, _styledComponents.css)`
|
|
40
40
|
${stickyFooter && (0, _styledComponents.css)`
|
|
41
41
|
overflow-y: auto;
|
|
42
|
-
|
|
42
|
+
flex: 1;
|
|
43
43
|
`}
|
|
44
44
|
`}
|
|
45
45
|
`;
|
|
@@ -69,6 +69,8 @@ const StyledFormFooter = _styledComponents.default.div`
|
|
|
69
69
|
padding: 16px 32px;
|
|
70
70
|
width: 100%;
|
|
71
71
|
z-index: 1000;
|
|
72
|
+
position: sticky;
|
|
73
|
+
bottom: 0;
|
|
72
74
|
`}
|
|
73
75
|
`}
|
|
74
76
|
`;
|
|
@@ -112,10 +114,11 @@ const StyledForm = _styledComponents.default.form`
|
|
|
112
114
|
}) => stickyFooter && (0, _styledComponents.css)`
|
|
113
115
|
display: flex;
|
|
114
116
|
flex-direction: column;
|
|
117
|
+
position: relative;
|
|
115
118
|
|
|
116
119
|
${isInSidebar && (0, _styledComponents.css)`
|
|
120
|
+
min-height: 100%;
|
|
117
121
|
${StyledFormContent}.sticky {
|
|
118
|
-
height: calc(100vh - 184px);
|
|
119
122
|
padding-right: ${theme.space[4]}px;
|
|
120
123
|
padding-left: ${theme.space[4]}px;
|
|
121
124
|
padding-top: 27px;
|
|
@@ -130,6 +133,7 @@ const StyledForm = _styledComponents.default.form`
|
|
|
130
133
|
width: calc(100% + ${2 * theme.space[4]}px);
|
|
131
134
|
padding-left: ${theme.space[4]}px;
|
|
132
135
|
padding-right: ${theme.space[4]}px;
|
|
136
|
+
bottom: -32px;
|
|
133
137
|
}
|
|
134
138
|
`}
|
|
135
139
|
`}
|
|
@@ -15,7 +15,7 @@ var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/
|
|
|
15
15
|
|
|
16
16
|
var _fullScreenHeading = _interopRequireDefault(require("../../../__internal__/full-screen-heading"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _box = _interopRequireDefault(require("../../box"));
|
|
19
19
|
|
|
20
20
|
var _page = require("./page.style");
|
|
21
21
|
|
|
@@ -41,7 +41,13 @@ const Page = ({
|
|
|
41
41
|
hasContent: title
|
|
42
42
|
}, title), /*#__PURE__*/_react.default.createElement(_page.StyledPageContent, {
|
|
43
43
|
"data-element": "carbon-page-content"
|
|
44
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
44
|
+
}, /*#__PURE__*/_react.default.createElement(_box.default, {
|
|
45
|
+
boxSizing: "border-box",
|
|
46
|
+
maxWidth: "100%",
|
|
47
|
+
minWidth: "auto",
|
|
48
|
+
margin: "0 auto",
|
|
49
|
+
padding: "4px 0px"
|
|
50
|
+
}, children))));
|
|
45
51
|
};
|
|
46
52
|
|
|
47
53
|
Page.propTypes = {
|
|
@@ -18,12 +18,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
18
18
|
const PagesContent = _styledComponents.default.div`
|
|
19
19
|
border: none;
|
|
20
20
|
|
|
21
|
-
.carbon-app-wrapper {
|
|
22
|
-
min-width: auto;
|
|
23
|
-
max-width: 100%;
|
|
24
|
-
padding: 4px 0 0 0;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
21
|
${_heading.StyledHeading} {
|
|
28
22
|
padding-left: 45px;
|
|
29
23
|
margin-bottom: 34px;
|
|
@@ -80,7 +80,8 @@ const Sidebar = /*#__PURE__*/_react.default.forwardRef(({
|
|
|
80
80
|
p: 4,
|
|
81
81
|
pt: "27px",
|
|
82
82
|
scrollVariant: "light",
|
|
83
|
-
overflow: "auto"
|
|
83
|
+
overflow: "auto",
|
|
84
|
+
flex: "1"
|
|
84
85
|
}, /*#__PURE__*/_react.default.createElement(SidebarContext.Provider, {
|
|
85
86
|
value: {
|
|
86
87
|
isInSidebar: true
|
|
@@ -183,7 +183,8 @@ const SplitButton = ({
|
|
|
183
183
|
"aria-expanded": showAdditionalButtons,
|
|
184
184
|
"aria-label": "Show more",
|
|
185
185
|
"data-element": "toggle-button",
|
|
186
|
-
key: "toggle-button"
|
|
186
|
+
key: "toggle-button",
|
|
187
|
+
type: "button"
|
|
187
188
|
}, toggleButtonProps()), /*#__PURE__*/_react.default.createElement(_icon.default, {
|
|
188
189
|
type: "dropdown",
|
|
189
190
|
bgSize: "extra-small",
|