carbon-react 142.11.3 → 142.11.5

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.
@@ -87,6 +87,7 @@ const FormField = ({
87
87
  id: fieldHelpId
88
88
  }, fieldHelpContent) : null;
89
89
  return /*#__PURE__*/React.createElement(FormFieldStyle, _extends({}, tagComponent(dataComponent, rest), marginProps), /*#__PURE__*/React.createElement(FieldLineStyle, {
90
+ "data-role": "field-line",
90
91
  inline: inlineLabel
91
92
  }, reverse && children, label && /*#__PURE__*/React.createElement(Label, {
92
93
  labelId: labelId,
@@ -15,12 +15,7 @@ const NavigationBar = ({
15
15
  ...props
16
16
  }) => {
17
17
  const navbarRef = useRef(null);
18
- return /*#__PURE__*/React.createElement(FixedNavigationBarContextProvider, {
19
- orientation: isGlobal ? "top" : orientation,
20
- offset: isGlobal ? "0px" : offset,
21
- position: isGlobal ? "fixed" : position,
22
- navbarRef: navbarRef
23
- }, /*#__PURE__*/React.createElement(StyledNavigationBar, _extends({
18
+ return /*#__PURE__*/React.createElement(StyledNavigationBar, _extends({
24
19
  role: "navigation",
25
20
  "data-component": isGlobal ? "global-header" : "navigation-bar",
26
21
  "aria-label": isGlobal ? "Global Header" : ariaLabel,
@@ -31,7 +26,12 @@ const NavigationBar = ({
31
26
  }, props, {
32
27
  isGlobal: isGlobal,
33
28
  ref: navbarRef
34
- }), !isLoading && children));
29
+ }), /*#__PURE__*/React.createElement(FixedNavigationBarContextProvider, {
30
+ orientation: isGlobal ? "top" : orientation,
31
+ offset: isGlobal ? "0px" : offset,
32
+ position: isGlobal ? "fixed" : position,
33
+ navbarRef: navbarRef
34
+ }, !isLoading && children));
35
35
  };
36
36
  if (process.env.NODE_ENV !== "production") {
37
37
  NavigationBar.propTypes = {
@@ -38,6 +38,7 @@ const Toast = /*#__PURE__*/React.forwardRef(({
38
38
  const closeIconRef = useRef(null);
39
39
  const focusedElementBeforeOpening = useRef(null);
40
40
  const [tabIndex, setTabIndex] = useState(0);
41
+ const ariaLabelledBy = `${!isNotice && toastIconId.current} ${toastContentId.current}`;
41
42
  let refToPass = toastRef;
42
43
  if (ref && typeof ref === "object" && "current" in ref) {
43
44
  refToPass = ref;
@@ -160,7 +161,8 @@ const Toast = /*#__PURE__*/React.forwardRef(({
160
161
  isNotice: isNotice,
161
162
  "data-role": "toast-wrapper",
162
163
  role: "region",
163
- "aria-labelledby": `${!isNotice && toastIconId.current} ${toastContentId.current}`
164
+ "aria-hidden": !open,
165
+ "aria-labelledby": open ? ariaLabelledBy : undefined
164
166
  }, /*#__PURE__*/React.createElement(TransitionGroup, null, renderToastContent())));
165
167
  });
166
168
  if (process.env.NODE_ENV !== "production") {
@@ -96,6 +96,7 @@ const FormField = ({
96
96
  id: fieldHelpId
97
97
  }, fieldHelpContent) : null;
98
98
  return /*#__PURE__*/_react.default.createElement(_formField.default, _extends({}, (0, _tags.default)(dataComponent, rest), marginProps), /*#__PURE__*/_react.default.createElement(_formField.FieldLineStyle, {
99
+ "data-role": "field-line",
99
100
  inline: inlineLabel
100
101
  }, reverse && children, label && /*#__PURE__*/_react.default.createElement(_label.default, {
101
102
  labelId: labelId,
@@ -24,12 +24,7 @@ const NavigationBar = ({
24
24
  ...props
25
25
  }) => {
26
26
  const navbarRef = (0, _react.useRef)(null);
27
- return /*#__PURE__*/_react.default.createElement(_fixedNavigationBar.FixedNavigationBarContextProvider, {
28
- orientation: isGlobal ? "top" : orientation,
29
- offset: isGlobal ? "0px" : offset,
30
- position: isGlobal ? "fixed" : position,
31
- navbarRef: navbarRef
32
- }, /*#__PURE__*/_react.default.createElement(_navigationBar.default, _extends({
27
+ return /*#__PURE__*/_react.default.createElement(_navigationBar.default, _extends({
33
28
  role: "navigation",
34
29
  "data-component": isGlobal ? "global-header" : "navigation-bar",
35
30
  "aria-label": isGlobal ? "Global Header" : ariaLabel,
@@ -40,7 +35,12 @@ const NavigationBar = ({
40
35
  }, props, {
41
36
  isGlobal: isGlobal,
42
37
  ref: navbarRef
43
- }), !isLoading && children));
38
+ }), /*#__PURE__*/_react.default.createElement(_fixedNavigationBar.FixedNavigationBarContextProvider, {
39
+ orientation: isGlobal ? "top" : orientation,
40
+ offset: isGlobal ? "0px" : offset,
41
+ position: isGlobal ? "fixed" : position,
42
+ navbarRef: navbarRef
43
+ }, !isLoading && children));
44
44
  };
45
45
  exports.NavigationBar = NavigationBar;
46
46
  if (process.env.NODE_ENV !== "production") {
@@ -47,6 +47,7 @@ const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
47
47
  const closeIconRef = (0, _react.useRef)(null);
48
48
  const focusedElementBeforeOpening = (0, _react.useRef)(null);
49
49
  const [tabIndex, setTabIndex] = (0, _react.useState)(0);
50
+ const ariaLabelledBy = `${!isNotice && toastIconId.current} ${toastContentId.current}`;
50
51
  let refToPass = toastRef;
51
52
  if (ref && typeof ref === "object" && "current" in ref) {
52
53
  refToPass = ref;
@@ -169,7 +170,8 @@ const Toast = exports.Toast = /*#__PURE__*/_react.default.forwardRef(({
169
170
  isNotice: isNotice,
170
171
  "data-role": "toast-wrapper",
171
172
  role: "region",
172
- "aria-labelledby": `${!isNotice && toastIconId.current} ${toastContentId.current}`
173
+ "aria-hidden": !open,
174
+ "aria-labelledby": open ? ariaLabelledBy : undefined
173
175
  }, /*#__PURE__*/_react.default.createElement(_reactTransitionGroup.TransitionGroup, null, renderToastContent())));
174
176
  });
175
177
  if (process.env.NODE_ENV !== "production") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "142.11.3",
3
+ "version": "142.11.5",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",