@carbon/react 1.30.0-rc.0 → 1.30.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/es/components/DatePicker/DatePicker.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +4 -1
- package/es/components/FileUploader/Filename.js +6 -0
- package/es/components/Modal/Modal.js +1 -3
- package/lib/components/DatePicker/DatePicker.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +4 -1
- package/lib/components/FileUploader/Filename.js +6 -0
- package/lib/components/Modal/Modal.js +1 -3
- package/package.json +8 -8
|
@@ -235,7 +235,7 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
235
235
|
if (!startInputField.current) {
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
const onHook = (_electedDates, _dateStr, instance
|
|
238
|
+
const onHook = (_electedDates, _dateStr, instance) => {
|
|
239
239
|
updateClassNames(instance, prefix);
|
|
240
240
|
if (startInputField?.current) {
|
|
241
241
|
startInputField.current.readOnly = readOnly;
|
|
@@ -50,6 +50,7 @@ function FileUploaderItem(_ref) {
|
|
|
50
50
|
iconDescription: iconDescription,
|
|
51
51
|
status: status,
|
|
52
52
|
invalid: invalid,
|
|
53
|
+
"aria-describedby": `${name}-id-error`,
|
|
53
54
|
onKeyDown: evt => {
|
|
54
55
|
if (matches(evt, [Enter, Space])) {
|
|
55
56
|
if (status === 'edit') {
|
|
@@ -68,7 +69,9 @@ function FileUploaderItem(_ref) {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
})), invalid && errorSubject && /*#__PURE__*/React__default.createElement("div", {
|
|
71
|
-
className: `${prefix}--form-requirement
|
|
72
|
+
className: `${prefix}--form-requirement`,
|
|
73
|
+
role: "alert",
|
|
74
|
+
id: `${name}-id-error`
|
|
72
75
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
73
76
|
className: `${prefix}--form-requirement__title`
|
|
74
77
|
}, errorSubject), errorBody && /*#__PURE__*/React__default.createElement("p", {
|
|
@@ -19,6 +19,7 @@ function Filename(_ref) {
|
|
|
19
19
|
status,
|
|
20
20
|
invalid,
|
|
21
21
|
name,
|
|
22
|
+
['aria-describedBy']: ariaDescribedBy,
|
|
22
23
|
...rest
|
|
23
24
|
} = _ref;
|
|
24
25
|
const prefix = usePrefix();
|
|
@@ -34,6 +35,7 @@ function Filename(_ref) {
|
|
|
34
35
|
className: `${prefix}--file-invalid`
|
|
35
36
|
}), /*#__PURE__*/React__default.createElement("button", _extends({
|
|
36
37
|
"aria-label": `${iconDescription} - ${name}`,
|
|
38
|
+
"aria-describedby": invalid ? ariaDescribedBy : null,
|
|
37
39
|
className: `${prefix}--file-close`,
|
|
38
40
|
type: "button"
|
|
39
41
|
}, rest), _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, null))));
|
|
@@ -49,6 +51,10 @@ function Filename(_ref) {
|
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
Filename.propTypes = {
|
|
54
|
+
/**
|
|
55
|
+
* Specify an id that describes the error to be read by screen readers when the filename is invalid
|
|
56
|
+
*/
|
|
57
|
+
['aria-describedby']: PropTypes.string,
|
|
52
58
|
/**
|
|
53
59
|
* Provide a description of the SVG icon to denote file upload status
|
|
54
60
|
*/
|
|
@@ -200,9 +200,7 @@ const Modal = /*#__PURE__*/React__default.forwardRef(function Modal(_ref, ref) {
|
|
|
200
200
|
}, modalHeading), !passiveModal && modalButton), /*#__PURE__*/React__default.createElement("div", _extends({
|
|
201
201
|
id: modalBodyId,
|
|
202
202
|
className: contentClasses
|
|
203
|
-
}, hasScrollingContentProps, {
|
|
204
|
-
"aria-labelledby": getAriaLabelledBy
|
|
205
|
-
}), children), hasScrollingContent && /*#__PURE__*/React__default.createElement("div", {
|
|
203
|
+
}, hasScrollingContentProps), children), hasScrollingContent && /*#__PURE__*/React__default.createElement("div", {
|
|
206
204
|
className: `${prefix}--modal-content--overflow-indicator`
|
|
207
205
|
}), !passiveModal && /*#__PURE__*/React__default.createElement(ButtonSet, {
|
|
208
206
|
className: footerClasses
|
|
@@ -247,7 +247,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
|
|
|
247
247
|
if (!startInputField.current) {
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
|
-
const onHook = (_electedDates, _dateStr, instance
|
|
250
|
+
const onHook = (_electedDates, _dateStr, instance) => {
|
|
251
251
|
updateClassNames(instance, prefix);
|
|
252
252
|
if (startInputField?.current) {
|
|
253
253
|
startInputField.current.readOnly = readOnly;
|
|
@@ -60,6 +60,7 @@ function FileUploaderItem(_ref) {
|
|
|
60
60
|
iconDescription: iconDescription,
|
|
61
61
|
status: status,
|
|
62
62
|
invalid: invalid,
|
|
63
|
+
"aria-describedby": `${name}-id-error`,
|
|
63
64
|
onKeyDown: evt => {
|
|
64
65
|
if (match.matches(evt, [keys.Enter, keys.Space])) {
|
|
65
66
|
if (status === 'edit') {
|
|
@@ -78,7 +79,9 @@ function FileUploaderItem(_ref) {
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
})), invalid && errorSubject && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
81
|
-
className: `${prefix}--form-requirement
|
|
82
|
+
className: `${prefix}--form-requirement`,
|
|
83
|
+
role: "alert",
|
|
84
|
+
id: `${name}-id-error`
|
|
82
85
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
83
86
|
className: `${prefix}--form-requirement__title`
|
|
84
87
|
}, errorSubject), errorBody && /*#__PURE__*/React__default["default"].createElement("p", {
|
|
@@ -28,6 +28,7 @@ function Filename(_ref) {
|
|
|
28
28
|
status,
|
|
29
29
|
invalid,
|
|
30
30
|
name,
|
|
31
|
+
['aria-describedBy']: ariaDescribedBy,
|
|
31
32
|
...rest
|
|
32
33
|
} = _ref;
|
|
33
34
|
const prefix = usePrefix.usePrefix();
|
|
@@ -43,6 +44,7 @@ function Filename(_ref) {
|
|
|
43
44
|
className: `${prefix}--file-invalid`
|
|
44
45
|
}), /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
|
|
45
46
|
"aria-label": `${iconDescription} - ${name}`,
|
|
47
|
+
"aria-describedby": invalid ? ariaDescribedBy : null,
|
|
46
48
|
className: `${prefix}--file-close`,
|
|
47
49
|
type: "button"
|
|
48
50
|
}, rest), _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))));
|
|
@@ -58,6 +60,10 @@ function Filename(_ref) {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
Filename.propTypes = {
|
|
63
|
+
/**
|
|
64
|
+
* Specify an id that describes the error to be read by screen readers when the filename is invalid
|
|
65
|
+
*/
|
|
66
|
+
['aria-describedby']: PropTypes__default["default"].string,
|
|
61
67
|
/**
|
|
62
68
|
* Provide a description of the SVG icon to denote file upload status
|
|
63
69
|
*/
|
|
@@ -210,9 +210,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
|
|
|
210
210
|
}, modalHeading), !passiveModal && modalButton), /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
|
|
211
211
|
id: modalBodyId,
|
|
212
212
|
className: contentClasses
|
|
213
|
-
}, hasScrollingContentProps, {
|
|
214
|
-
"aria-labelledby": getAriaLabelledBy
|
|
215
|
-
}), children), hasScrollingContent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
213
|
+
}, hasScrollingContentProps), children), hasScrollingContent && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
216
214
|
className: `${prefix}--modal-content--overflow-indicator`
|
|
217
215
|
}), !passiveModal && /*#__PURE__*/React__default["default"].createElement(ButtonSet["default"], {
|
|
218
216
|
className: footerClasses
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.30.0
|
|
4
|
+
"version": "1.30.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "es/index.js",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@babel/runtime": "^7.18.3",
|
|
46
|
-
"@carbon/feature-flags": "^0.14.0
|
|
47
|
-
"@carbon/icons-react": "^11.20.0
|
|
48
|
-
"@carbon/layout": "^11.14.0
|
|
49
|
-
"@carbon/styles": "^1.30.0
|
|
46
|
+
"@carbon/feature-flags": "^0.14.0",
|
|
47
|
+
"@carbon/icons-react": "^11.20.0",
|
|
48
|
+
"@carbon/layout": "^11.14.0",
|
|
49
|
+
"@carbon/styles": "^1.30.0",
|
|
50
50
|
"@carbon/telemetry": "0.1.0",
|
|
51
51
|
"classnames": "2.3.2",
|
|
52
52
|
"copy-to-clipboard": "^3.3.1",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@babel/plugin-transform-react-constant-elements": "^7.17.12",
|
|
73
73
|
"@babel/preset-env": "^7.18.2",
|
|
74
74
|
"@babel/preset-react": "^7.17.12",
|
|
75
|
-
"@carbon/test-utils": "^10.29.0
|
|
76
|
-
"@carbon/themes": "^11.19.0
|
|
75
|
+
"@carbon/test-utils": "^10.29.0",
|
|
76
|
+
"@carbon/themes": "^11.19.0",
|
|
77
77
|
"@rollup/plugin-babel": "^6.0.0",
|
|
78
78
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
79
79
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
@@ -133,5 +133,5 @@
|
|
|
133
133
|
"**/*.scss",
|
|
134
134
|
"**/*.css"
|
|
135
135
|
],
|
|
136
|
-
"gitHead": "
|
|
136
|
+
"gitHead": "8fb6526d2f73634b13f3bec63b7112839754092d"
|
|
137
137
|
}
|