@carbon/react 1.7.0 → 1.9.0-rc.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.
Files changed (87) hide show
  1. package/es/components/ComposedModal/ComposedModal.js +1 -1
  2. package/es/components/ComposedModal/index.js +4 -4
  3. package/es/components/ComposedModal/next/ComposedModal.js +1 -1
  4. package/es/components/DataTable/DataTable.js +1 -1
  5. package/es/components/DataTable/Table.js +10 -2
  6. package/es/components/DataTable/TableContainer.js +20 -5
  7. package/es/components/DataTable/TableContext.js +15 -0
  8. package/es/components/DataTable/TableSelectRow.js +1 -1
  9. package/es/components/FileUploader/FileUploader.js +8 -1
  10. package/es/components/FileUploader/FileUploaderButton.js +3 -1
  11. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -1
  12. package/es/components/FileUploader/FileUploaderItem.js +3 -1
  13. package/es/components/InlineLoading/InlineLoading.js +9 -5
  14. package/es/components/Loading/Loading.js +7 -18
  15. package/es/components/Menu/Menu.js +1 -1
  16. package/es/components/Modal/Modal.js +204 -273
  17. package/es/components/Modal/index.js +2 -8
  18. package/es/components/ModalWrapper/ModalWrapper.js +1 -1
  19. package/es/components/MultiSelect/FilterableMultiSelect.js +345 -386
  20. package/es/components/MultiSelect/index.js +4 -8
  21. package/es/components/Notification/Notification.js +322 -189
  22. package/es/components/NumberInput/NumberInput.Skeleton.js +3 -4
  23. package/es/components/NumberInput/NumberInput.js +308 -359
  24. package/es/components/RadioButton/RadioButton.js +58 -99
  25. package/es/components/RadioButton/index.js +2 -8
  26. package/es/components/RadioButtonGroup/RadioButtonGroup.js +72 -121
  27. package/es/components/RadioButtonGroup/index.js +2 -8
  28. package/es/components/Slider/Slider.js +2 -1
  29. package/es/components/Switch/Switch.js +0 -1
  30. package/es/components/TreeView/TreeView.js +19 -11
  31. package/es/components/UIShell/HeaderMenu.js +1 -1
  32. package/es/components/UIShell/HeaderMenuButton.js +4 -0
  33. package/es/components/UIShell/SideNavLink.js +6 -9
  34. package/es/index.js +10 -9
  35. package/es/internal/createClassWrapper.js +2 -5
  36. package/lib/components/ComposedModal/index.js +7 -7
  37. package/lib/components/ComposedModal/next/ComposedModal.js +1 -1
  38. package/lib/components/DataTable/DataTable.js +5 -5
  39. package/lib/components/DataTable/Table.js +9 -1
  40. package/lib/components/DataTable/TableContainer.js +19 -4
  41. package/lib/components/DataTable/TableContext.js +19 -0
  42. package/lib/components/DataTable/TableSelectRow.js +2 -2
  43. package/lib/components/FileUploader/FileUploader.js +8 -1
  44. package/lib/components/FileUploader/FileUploaderButton.js +3 -1
  45. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -1
  46. package/lib/components/FileUploader/FileUploaderItem.js +3 -1
  47. package/lib/components/InlineLoading/InlineLoading.js +9 -5
  48. package/lib/components/Loading/Loading.js +6 -17
  49. package/lib/components/Menu/Menu.js +1 -1
  50. package/lib/components/Modal/Modal.js +201 -270
  51. package/lib/components/Modal/index.js +2 -25
  52. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  53. package/lib/components/MultiSelect/FilterableMultiSelect.js +341 -382
  54. package/lib/components/MultiSelect/index.js +5 -28
  55. package/lib/components/Notification/Notification.js +321 -188
  56. package/lib/components/NumberInput/NumberInput.Skeleton.js +3 -4
  57. package/lib/components/NumberInput/NumberInput.js +305 -376
  58. package/lib/components/RadioButton/RadioButton.js +57 -99
  59. package/lib/components/RadioButton/index.js +2 -25
  60. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +68 -117
  61. package/lib/components/RadioButtonGroup/index.js +2 -25
  62. package/lib/components/Slider/Slider.js +2 -1
  63. package/lib/components/Switch/Switch.js +0 -1
  64. package/lib/components/TreeView/TreeView.js +18 -10
  65. package/lib/components/UIShell/HeaderMenu.js +1 -0
  66. package/lib/components/UIShell/HeaderMenuButton.js +4 -0
  67. package/lib/components/UIShell/SideNavLink.js +6 -9
  68. package/lib/index.js +95 -95
  69. package/lib/internal/createClassWrapper.js +2 -5
  70. package/package.json +7 -7
  71. package/scss/utilities/_hide-at-breakpoint.scss +9 -0
  72. package/es/components/Modal/next/Modal.js +0 -274
  73. package/es/components/MultiSelect/next/FilterableMultiSelect.js +0 -544
  74. package/es/components/Notification/index.js +0 -42
  75. package/es/components/Notification/next/Notification.js +0 -663
  76. package/es/components/RadioButton/next/RadioButton.js +0 -130
  77. package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -141
  78. package/es/internal/FeatureFlags.js +0 -52
  79. package/es/prop-types/requiredIfValueExists.js +0 -32
  80. package/lib/components/Modal/next/Modal.js +0 -284
  81. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +0 -556
  82. package/lib/components/Notification/index.js +0 -51
  83. package/lib/components/Notification/next/Notification.js +0 -677
  84. package/lib/components/RadioButton/next/RadioButton.js +0 -140
  85. package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -151
  86. package/lib/internal/FeatureFlags.js +0 -56
  87. package/lib/prop-types/requiredIfValueExists.js +0 -36
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { inherits as _inherits, createSuper as _createSuper, createClass as _createClass, defineProperty as _defineProperty, objectWithoutProperties as _objectWithoutProperties, extends as _extends, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, typeof as _typeof } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { defineProperty as _defineProperty, objectWithoutProperties as _objectWithoutProperties, extends as _extends, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, assertThisInitialized as _assertThisInitialized, createClass as _createClass, typeof as _typeof } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { Component } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import Button from '../Button/Button.js';
@@ -9,11 +9,11 @@ import * as FeatureFlags from '@carbon/feature-flags';
9
9
  import { ModalHeader as ModalHeader$1 } from './next/ModalHeader.js';
10
10
  import { ModalFooter as ModalFooter$1 } from './next/ModalFooter.js';
11
11
  import ComposedModalNext from './next/ComposedModal.js';
12
- import ComposedModal, { ModalHeader as ModalHeader$2, ModalFooter as ModalFooter$2 } from './ComposedModal.js';
13
- export { ModalBody, default } from './ComposedModal.js';
12
+ import ComposedModal$1, { ModalHeader as ModalHeader$2, ModalFooter as ModalFooter$2 } from './ComposedModal.js';
13
+ export { ModalBody } from './ComposedModal.js';
14
14
 
15
15
  var ModalHeader = FeatureFlags.enabled('enable-v11-release') ? ModalHeader$1 : ModalHeader$2;
16
16
  var ModalFooter = FeatureFlags.enabled('enable-v11-release') ? ModalFooter$1 : ModalFooter$2;
17
- FeatureFlags.enabled('enable-v11-release') ? ComposedModalNext : ComposedModal;
17
+ var ComposedModal = FeatureFlags.enabled('enable-v11-release') ? ComposedModalNext : ComposedModal$1;
18
18
 
19
- export { ModalFooter, ModalHeader };
19
+ export { ComposedModal, ModalFooter, ModalHeader };
@@ -215,7 +215,7 @@ var ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedModa
215
215
  className: "".concat(prefix, "--visually-hidden")
216
216
  }, "Focus sentinel")));
217
217
  });
218
- ComposedModal.propTypes = (_ComposedModal$propTy = {}, _defineProperty(_ComposedModal$propTy, 'aria-label', PropTypes.string), _defineProperty(_ComposedModal$propTy, 'aria-labelledby', PropTypes.string), _defineProperty(_ComposedModal$propTy, "children", PropTypes.node), _defineProperty(_ComposedModal$propTy, "className", PropTypes.string), _defineProperty(_ComposedModal$propTy, "containerClassName", PropTypes.string), _defineProperty(_ComposedModal$propTy, "danger", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "onClose", PropTypes.func), _defineProperty(_ComposedModal$propTy, "onKeyDown", PropTypes.func), _defineProperty(_ComposedModal$propTy, "open", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "preventCloseOnClickOutside", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "selectorPrimaryFocus", PropTypes.string), _defineProperty(_ComposedModal$propTy, "selectorsFloatingMenus", PropTypes.string), _defineProperty(_ComposedModal$propTy, "size", PropTypes.oneOf(['xs', 'sm', 'md', 'lg'])), _ComposedModal$propTy);
218
+ ComposedModal.propTypes = (_ComposedModal$propTy = {}, _defineProperty(_ComposedModal$propTy, 'aria-label', PropTypes.string), _defineProperty(_ComposedModal$propTy, 'aria-labelledby', PropTypes.string), _defineProperty(_ComposedModal$propTy, "children", PropTypes.node), _defineProperty(_ComposedModal$propTy, "className", PropTypes.string), _defineProperty(_ComposedModal$propTy, "containerClassName", PropTypes.string), _defineProperty(_ComposedModal$propTy, "danger", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "onClose", PropTypes.func), _defineProperty(_ComposedModal$propTy, "onKeyDown", PropTypes.func), _defineProperty(_ComposedModal$propTy, "open", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "preventCloseOnClickOutside", PropTypes.bool), _defineProperty(_ComposedModal$propTy, "selectorPrimaryFocus", PropTypes.string), _defineProperty(_ComposedModal$propTy, "selectorsFloatingMenus", PropTypes.arrayOf(PropTypes.string)), _defineProperty(_ComposedModal$propTy, "size", PropTypes.oneOf(['xs', 'sm', 'md', 'lg'])), _ComposedModal$propTy);
219
219
  ComposedModal.defaultProps = {
220
220
  onKeyDown: function onKeyDown() {},
221
221
  selectorPrimaryFocus: '[data-modal-primary-focus]'
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray, createClass as _createClass } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { defineProperty as _defineProperty, inherits as _inherits, createSuper as _createSuper, createClass as _createClass, classCallCheck as _classCallCheck, objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2, assertThisInitialized as _assertThisInitialized, slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
10
  import React__default from 'react';
11
11
  import isEqual from 'lodash.isequal';
@@ -6,10 +6,11 @@
6
6
  */
7
7
 
8
8
  import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React__default from 'react';
9
+ import React__default, { useContext } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
+ import { TableContext } from './TableContext.js';
13
14
 
14
15
  var _excluded = ["className", "children", "useZebraStyles", "size", "isSortable", "useStaticWidth", "stickyHeader", "overflowMenuOnHover"];
15
16
  var Table = function Table(_ref) {
@@ -25,11 +26,18 @@ var Table = function Table(_ref) {
25
26
  overflowMenuOnHover = _ref.overflowMenuOnHover,
26
27
  other = _objectWithoutProperties(_ref, _excluded);
27
28
 
29
+ var _useContext = useContext(TableContext),
30
+ titleId = _useContext.titleId,
31
+ descriptionId = _useContext.descriptionId;
32
+
28
33
  var prefix = usePrefix();
29
34
  var componentClass = cx("".concat(prefix, "--data-table"), className, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--data-table--").concat(size), size), _defineProperty(_cx, "".concat(prefix, "--data-table--sort"), isSortable), _defineProperty(_cx, "".concat(prefix, "--data-table--zebra"), useZebraStyles), _defineProperty(_cx, "".concat(prefix, "--data-table--static"), useStaticWidth), _defineProperty(_cx, "".concat(prefix, "--data-table--sticky-header"), stickyHeader), _defineProperty(_cx, "".concat(prefix, "--data-table--visible-overflow-menu"), !overflowMenuOnHover), _cx));
30
35
  var table = /*#__PURE__*/React__default.createElement("div", {
31
36
  className: "".concat(prefix, "--data-table-content")
32
- }, /*#__PURE__*/React__default.createElement("table", _extends({}, other, {
37
+ }, /*#__PURE__*/React__default.createElement("table", _extends({
38
+ "aria-labelledby": titleId,
39
+ "aria-describedby": descriptionId
40
+ }, other, {
33
41
  className: componentClass
34
42
  }), children));
35
43
  return stickyHeader ? /*#__PURE__*/React__default.createElement("section", {
@@ -8,8 +8,10 @@
8
8
  import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React__default from 'react';
11
+ import React__default, { useMemo } from 'react';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
+ import { useId } from '../../internal/useId.js';
14
+ import { TableContext } from './TableContext.js';
13
15
 
14
16
  var _excluded = ["className", "children", "title", "description", "stickyHeader", "useStaticWidth"];
15
17
 
@@ -24,17 +26,30 @@ var TableContainer = function TableContainer(_ref) {
24
26
  useStaticWidth = _ref.useStaticWidth,
25
27
  rest = _objectWithoutProperties(_ref, _excluded);
26
28
 
29
+ var baseId = useId('tc');
30
+ var titleId = "".concat(baseId, "-title");
31
+ var descriptionId = "".concat(baseId, "-description");
27
32
  var prefix = usePrefix();
28
33
  var tableContainerClasses = cx(className, "".concat(prefix, "--data-table-container"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--data-table--max-width"), stickyHeader), _defineProperty(_cx, "".concat(prefix, "--data-table-container--static"), useStaticWidth), _cx));
29
- return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
34
+ var value = useMemo(function () {
35
+ return {
36
+ titleId: title ? titleId : null,
37
+ descriptionId: description ? descriptionId : null
38
+ };
39
+ }, [title, description, titleId, descriptionId]);
40
+ return /*#__PURE__*/React__default.createElement(TableContext.Provider, {
41
+ value: value
42
+ }, /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
30
43
  className: tableContainerClasses
31
44
  }), title && /*#__PURE__*/React__default.createElement("div", {
32
45
  className: "".concat(prefix, "--data-table-header")
33
46
  }, /*#__PURE__*/React__default.createElement("h4", {
34
- className: "".concat(prefix, "--data-table-header__title")
47
+ className: "".concat(prefix, "--data-table-header__title"),
48
+ id: titleId
35
49
  }, title), /*#__PURE__*/React__default.createElement("p", {
36
- className: "".concat(prefix, "--data-table-header__description")
37
- }, description)), children);
50
+ className: "".concat(prefix, "--data-table-header__description"),
51
+ id: descriptionId
52
+ }, description)), children));
38
53
  };
39
54
 
40
55
  TableContainer.propTypes = {
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2022
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { createContext } from 'react';
9
+
10
+ var TableContext = /*#__PURE__*/createContext({
11
+ titleId: null,
12
+ descriptionId: null
13
+ });
14
+
15
+ export { TableContext };
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
10
10
  import React__default from 'react';
11
11
  import cx from 'classnames';
12
12
  import InlineCheckbox from '../InlineCheckbox/InlineCheckbox.js';
13
- import RadioButton from '../RadioButton/index.js';
13
+ import RadioButton from '../RadioButton/RadioButton.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
16
  var TableSelectRow = function TableSelectRow(_ref) {
@@ -41,6 +41,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
41
41
 
42
42
  _defineProperty(_assertThisInitialized(_this), "nodes", []);
43
43
 
44
+ _defineProperty(_assertThisInitialized(_this), "uploaderButton", /*#__PURE__*/React__default.createRef());
45
+
44
46
  _defineProperty(_assertThisInitialized(_this), "handleChange", function (evt) {
45
47
  evt.stopPropagation();
46
48
  var filenames = Array.prototype.map.call(evt.target.files, function (file) {
@@ -73,6 +75,8 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
73
75
 
74
76
  if (_this.props.onDelete) {
75
77
  _this.props.onDelete(evt);
78
+
79
+ _this.uploaderButton.current.focus();
76
80
  }
77
81
 
78
82
  _this.props.onClick(evt);
@@ -128,6 +132,7 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
128
132
  }, labelTitle), /*#__PURE__*/React__default.createElement("p", {
129
133
  className: getHelperLabelClasses("".concat(prefix, "--label-description"))
130
134
  }, labelDescription), /*#__PURE__*/React__default.createElement(FileUploaderButton, {
135
+ innerRef: this.uploaderButton,
131
136
  disabled: disabled,
132
137
  labelText: buttonLabel,
133
138
  multiple: multiple,
@@ -148,11 +153,13 @@ var FileUploader = /*#__PURE__*/function (_React$Component) {
148
153
  } // eslint-disable-line
149
154
 
150
155
  }, other), /*#__PURE__*/React__default.createElement("p", {
151
- className: "".concat(prefix, "--file-filename")
156
+ className: "".concat(prefix, "--file-filename"),
157
+ id: name
152
158
  }, name), /*#__PURE__*/React__default.createElement("span", {
153
159
  className: "".concat(prefix, "--file__state-container")
154
160
  }, /*#__PURE__*/React__default.createElement(Filename, {
155
161
  iconDescription: iconDescription,
162
+ "aria-describedby": name,
156
163
  status: filenameStatus,
157
164
  onKeyDown: function onKeyDown(evt) {
158
165
  if (matches(evt, [Enter, Space])) {
@@ -16,7 +16,7 @@ import * as FeatureFlags from '@carbon/feature-flags';
16
16
  import { matches } from '../../internal/keyboard/match.js';
17
17
  import { Enter, Space } from '../../internal/keyboard/keys.js';
18
18
 
19
- var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex"];
19
+ var _excluded = ["accept", "buttonKind", "className", "disabled", "disableLabelChanges", "id", "labelText", "multiple", "onChange", "role", "name", "size", "tabIndex", "innerRef"];
20
20
 
21
21
  function noop() {}
22
22
 
@@ -45,6 +45,7 @@ function FileUploaderButton(_ref) {
45
45
  size = _ref$size === void 0 ? 'md' : _ref$size,
46
46
  _ref$tabIndex = _ref.tabIndex,
47
47
  tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex,
48
+ innerRef = _ref.innerRef,
48
49
  other = _objectWithoutProperties(_ref, _excluded);
49
50
 
50
51
  var prefix = usePrefix();
@@ -96,6 +97,7 @@ function FileUploaderButton(_ref) {
96
97
  }
97
98
 
98
99
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("label", _extends({
100
+ ref: innerRef,
99
101
  tabIndex: disabled ? -1 : tabIndex || 0,
100
102
  className: classes,
101
103
  onKeyDown: onKeyDown,
@@ -14,7 +14,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
14
14
  import { matches } from '../../internal/keyboard/match.js';
15
15
  import { Enter, Space } from '../../internal/keyboard/keys.js';
16
16
 
17
- var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex"];
17
+ var _excluded = ["accept", "className", "id", "disabled", "labelText", "multiple", "name", "onAddFiles", "pattern", "role", "tabIndex", "innerRef"];
18
18
 
19
19
  function FileUploaderDropContainer(_ref) {
20
20
  var _classNames2;
@@ -30,6 +30,7 @@ function FileUploaderDropContainer(_ref) {
30
30
  pattern = _ref.pattern,
31
31
  role = _ref.role,
32
32
  tabIndex = _ref.tabIndex,
33
+ innerRef = _ref.innerRef,
33
34
  rest = _objectWithoutProperties(_ref, _excluded);
34
35
 
35
36
  var prefix = usePrefix();
@@ -125,6 +126,7 @@ function FileUploaderDropContainer(_ref) {
125
126
  handleChange(evt);
126
127
  }
127
128
  }, /*#__PURE__*/React__default.createElement("label", _extends({
129
+ ref: innerRef,
128
130
  className: labelClasses,
129
131
  htmlFor: uid,
130
132
  tabIndex: tabIndex || 0,
@@ -42,11 +42,13 @@ function FileUploaderItem(_ref) {
42
42
  className: classes
43
43
  }, other), /*#__PURE__*/React__default.createElement("p", {
44
44
  className: "".concat(prefix, "--file-filename"),
45
- title: name
45
+ title: name,
46
+ id: name
46
47
  }, name), /*#__PURE__*/React__default.createElement("span", {
47
48
  className: "".concat(prefix, "--file__state-container")
48
49
  }, /*#__PURE__*/React__default.createElement(Filename, {
49
50
  iconDescription: iconDescription,
51
+ "aria-describedby": name,
50
52
  status: status,
51
53
  invalid: invalid,
52
54
  onKeyDown: function onKeyDown(evt) {
@@ -15,8 +15,6 @@ import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
16
  var _excluded = ["className", "status", "iconDescription", "description", "onSuccess", "successDelay"];
17
17
  function InlineLoading(_ref) {
18
- var _title, _title2;
19
-
20
18
  var className = _ref.className,
21
19
  _ref$status = _ref.status,
22
20
  status = _ref$status === void 0 ? 'active' : _ref$status,
@@ -30,10 +28,12 @@ function InlineLoading(_ref) {
30
28
  var loadingClasses = cx("".concat(prefix, "--inline-loading"), className);
31
29
 
32
30
  var getLoading = function getLoading() {
31
+ var iconLabel = iconDescription ? iconDescription : status;
32
+
33
33
  if (status === 'error') {
34
34
  return /*#__PURE__*/React__default.createElement(ErrorFilled, {
35
35
  className: "".concat(prefix, "--inline-loading--error")
36
- }, _title || (_title = /*#__PURE__*/React__default.createElement("title", null, iconDescription)));
36
+ }, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
37
37
  }
38
38
 
39
39
  if (status === 'finished') {
@@ -44,13 +44,17 @@ function InlineLoading(_ref) {
44
44
  }, successDelay);
45
45
  return /*#__PURE__*/React__default.createElement(CheckmarkFilled, {
46
46
  className: "".concat(prefix, "--inline-loading__checkmark-container")
47
- }, _title2 || (_title2 = /*#__PURE__*/React__default.createElement("title", null, iconDescription)));
47
+ }, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
48
48
  }
49
49
 
50
50
  if (status === 'inactive' || status === 'active') {
51
+ if (!iconDescription) {
52
+ iconLabel = status === 'active' ? 'loading' : 'not loading';
53
+ }
54
+
51
55
  return /*#__PURE__*/React__default.createElement(Loading, {
52
56
  small: true,
53
- description: iconDescription,
57
+ description: iconLabel,
54
58
  withOverlay: false,
55
59
  active: status === 'active'
56
60
  });
@@ -8,18 +8,16 @@
8
8
  import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React__default, { useRef } from 'react';
12
- import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
11
+ import React__default from 'react';
13
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
+ import deprecate from '../../prop-types/deprecate.js';
14
14
 
15
- var _excluded = ["id", "active", "className", "withOverlay", "small", "description"];
16
- var getInstanceId = setupGetInstanceId();
15
+ var _excluded = ["active", "className", "withOverlay", "small", "description"];
17
16
 
18
17
  function Loading(_ref) {
19
18
  var _cx, _cx2;
20
19
 
21
- var id = _ref.id,
22
- active = _ref.active,
20
+ var active = _ref.active,
23
21
  customClassName = _ref.className,
24
22
  withOverlay = _ref.withOverlay,
25
23
  small = _ref.small,
@@ -27,22 +25,13 @@ function Loading(_ref) {
27
25
  rest = _objectWithoutProperties(_ref, _excluded);
28
26
 
29
27
  var prefix = usePrefix();
30
-
31
- var _useRef = useRef(getInstanceId()),
32
- instanceId = _useRef.current;
33
-
34
28
  var loadingClassName = cx(customClassName, (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--loading"), true), _defineProperty(_cx, "".concat(prefix, "--loading--small"), small), _defineProperty(_cx, "".concat(prefix, "--loading--stop"), !active), _cx));
35
29
  var overlayClassName = cx((_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--loading-overlay"), true), _defineProperty(_cx2, "".concat(prefix, "--loading-overlay--stop"), !active), _cx2));
36
- var loadingId = id || "loading-id-".concat(instanceId);
37
30
  var loading = /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
38
31
  "aria-atomic": "true",
39
- "aria-labelledby": loadingId,
40
32
  "aria-live": active ? 'assertive' : 'off',
41
33
  className: loadingClassName
42
- }), /*#__PURE__*/React__default.createElement("label", {
43
- id: loadingId,
44
- className: "".concat(prefix, "--visually-hidden")
45
- }, description), /*#__PURE__*/React__default.createElement("svg", {
34
+ }), /*#__PURE__*/React__default.createElement("svg", {
46
35
  className: "".concat(prefix, "--loading__svg"),
47
36
  viewBox: "0 0 100 100"
48
37
  }, /*#__PURE__*/React__default.createElement("title", null, description), small ? /*#__PURE__*/React__default.createElement("circle", {
@@ -80,7 +69,7 @@ Loading.propTypes = {
80
69
  /**
81
70
  * Provide an `id` to uniquely identify the label
82
71
  */
83
- id: PropTypes.string,
72
+ id: deprecate(PropTypes.string, "\nThe prop `id` is no longer needed."),
84
73
 
85
74
  /**
86
75
  * Specify whether you would like the small variant of <Loading>
@@ -96,7 +85,7 @@ Loading.defaultProps = {
96
85
  active: true,
97
86
  withOverlay: true,
98
87
  small: false,
99
- description: 'Active loading indicator'
88
+ description: 'loading'
100
89
  };
101
90
 
102
91
  export { Loading as default };
@@ -311,7 +311,7 @@ Menu.propTypes = {
311
311
  /**
312
312
  * Optionally pass an element the Menu should be appended to as a child. Defaults to document.body.
313
313
  */
314
- target: PropTypes.element,
314
+ target: PropTypes.object,
315
315
 
316
316
  /**
317
317
  * Specify the x position where this menu is rendered