@carbon/react 1.7.0-rc.0 → 1.8.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 (78) hide show
  1. package/es/components/ComposedModal/ComposedModal.js +1 -1
  2. package/es/components/ComposedModal/index.js +4 -4
  3. package/es/components/DataTable/DataTable.js +1 -1
  4. package/es/components/DataTable/Table.js +10 -2
  5. package/es/components/DataTable/TableContainer.js +20 -5
  6. package/es/components/DataTable/TableContext.js +15 -0
  7. package/es/components/DataTable/TableSelectRow.js +1 -1
  8. package/es/components/FileUploader/FileUploader.js +8 -1
  9. package/es/components/FileUploader/FileUploaderButton.js +3 -1
  10. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -1
  11. package/es/components/FileUploader/FileUploaderItem.js +3 -1
  12. package/es/components/InlineLoading/InlineLoading.js +9 -5
  13. package/es/components/Loading/Loading.js +7 -18
  14. package/es/components/Modal/Modal.js +204 -273
  15. package/es/components/Modal/index.js +2 -8
  16. package/es/components/ModalWrapper/ModalWrapper.js +1 -1
  17. package/es/components/MultiSelect/FilterableMultiSelect.js +345 -386
  18. package/es/components/MultiSelect/index.js +4 -8
  19. package/es/components/Notification/Notification.js +322 -189
  20. package/es/components/ProgressBar/ProgressBar.js +6 -3
  21. package/es/components/RadioButton/RadioButton.js +58 -99
  22. package/es/components/RadioButton/index.js +2 -8
  23. package/es/components/RadioButtonGroup/RadioButtonGroup.js +72 -121
  24. package/es/components/RadioButtonGroup/index.js +2 -8
  25. package/es/components/Slider/Slider.js +2 -1
  26. package/es/components/Switch/Switch.js +0 -1
  27. package/es/components/TreeView/TreeView.js +19 -11
  28. package/es/components/UIShell/HeaderMenu.js +1 -1
  29. package/es/components/UIShell/HeaderMenuButton.js +4 -0
  30. package/es/components/UIShell/SideNavDetails.js +8 -3
  31. package/es/components/UIShell/SideNavLink.js +6 -9
  32. package/es/index.js +8 -7
  33. package/es/internal/createClassWrapper.js +2 -5
  34. package/lib/components/ComposedModal/index.js +7 -7
  35. package/lib/components/DataTable/DataTable.js +5 -5
  36. package/lib/components/DataTable/Table.js +9 -1
  37. package/lib/components/DataTable/TableContainer.js +19 -4
  38. package/lib/components/DataTable/TableContext.js +19 -0
  39. package/lib/components/DataTable/TableSelectRow.js +2 -2
  40. package/lib/components/FileUploader/FileUploader.js +8 -1
  41. package/lib/components/FileUploader/FileUploaderButton.js +3 -1
  42. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -1
  43. package/lib/components/FileUploader/FileUploaderItem.js +3 -1
  44. package/lib/components/InlineLoading/InlineLoading.js +9 -5
  45. package/lib/components/Loading/Loading.js +6 -17
  46. package/lib/components/Modal/Modal.js +201 -270
  47. package/lib/components/Modal/index.js +2 -25
  48. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  49. package/lib/components/MultiSelect/FilterableMultiSelect.js +341 -382
  50. package/lib/components/MultiSelect/index.js +5 -28
  51. package/lib/components/Notification/Notification.js +321 -188
  52. package/lib/components/ProgressBar/ProgressBar.js +6 -3
  53. package/lib/components/RadioButton/RadioButton.js +57 -99
  54. package/lib/components/RadioButton/index.js +2 -25
  55. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +68 -117
  56. package/lib/components/RadioButtonGroup/index.js +2 -25
  57. package/lib/components/Slider/Slider.js +2 -1
  58. package/lib/components/Switch/Switch.js +0 -1
  59. package/lib/components/TreeView/TreeView.js +18 -10
  60. package/lib/components/UIShell/HeaderMenu.js +1 -0
  61. package/lib/components/UIShell/HeaderMenuButton.js +4 -0
  62. package/lib/components/UIShell/SideNavDetails.js +8 -3
  63. package/lib/components/UIShell/SideNavLink.js +6 -9
  64. package/lib/index.js +91 -91
  65. package/lib/internal/createClassWrapper.js +2 -5
  66. package/package.json +8 -8
  67. package/es/components/Modal/next/Modal.js +0 -274
  68. package/es/components/MultiSelect/next/FilterableMultiSelect.js +0 -542
  69. package/es/components/Notification/index.js +0 -42
  70. package/es/components/Notification/next/Notification.js +0 -663
  71. package/es/components/RadioButton/next/RadioButton.js +0 -130
  72. package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -141
  73. package/lib/components/Modal/next/Modal.js +0 -284
  74. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +0 -554
  75. package/lib/components/Notification/index.js +0 -51
  76. package/lib/components/Notification/next/Notification.js +0 -677
  77. package/lib/components/RadioButton/next/RadioButton.js +0 -140
  78. package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -151
@@ -84,9 +84,9 @@ function ProgressBar(_ref) {
84
84
  })), /*#__PURE__*/React__default.createElement("div", {
85
85
  className: "".concat(prefix, "--progress-bar__track"),
86
86
  role: "progressbar",
87
+ "aria-busy": !isFinished,
87
88
  "aria-invalid": isError,
88
89
  "aria-labelledby": labelId,
89
- "aria-describedby": helperText ? helperId : null,
90
90
  "aria-valuemin": !indeterminate ? 0 : null,
91
91
  "aria-valuemax": !indeterminate ? max : null,
92
92
  "aria-valuenow": !indeterminate ? cappedValue : null
@@ -96,9 +96,12 @@ function ProgressBar(_ref) {
96
96
  transform: "scaleX(".concat(percentage, ")")
97
97
  } : null
98
98
  })), helperText && /*#__PURE__*/React__default.createElement("div", {
99
- id: helperId,
100
99
  className: "".concat(prefix, "--progress-bar__helper-text")
101
- }, helperText));
100
+ }, helperText, /*#__PURE__*/React__default.createElement("div", {
101
+ className: "".concat(prefix, "--visually-hidden"),
102
+ "aria-live": "polite",
103
+ id: helperId
104
+ }, isFinished ? 'Done' : 'Loading')));
102
105
  }
103
106
 
104
107
  ProgressBar.propTypes = {
@@ -5,89 +5,66 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass, objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import cx from 'classnames';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
10
9
  import PropTypes from 'prop-types';
11
10
  import React__default from 'react';
12
- import { warning } from '../../internal/warning.js';
13
- import uniqueId from '../../tools/uniqueId.js';
11
+ import cx from 'classnames';
14
12
  import '../Text/index.js';
15
- import { PrefixContext } from '../../internal/usePrefix.js';
13
+ import { usePrefix } from '../../internal/usePrefix.js';
14
+ import { useId } from '../../internal/useId.js';
16
15
  import { Text } from '../Text/Text.js';
17
16
 
18
- var _excluded = ["className", "labelText", "labelPosition", "innerRef", "hideLabel"];
19
-
20
- var RadioButton = /*#__PURE__*/function (_React$Component) {
21
- _inherits(RadioButton, _React$Component);
22
-
23
- var _super = _createSuper(RadioButton);
24
-
25
- function RadioButton() {
26
- var _this;
27
-
28
- _classCallCheck(this, RadioButton);
29
-
30
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
31
- args[_key] = arguments[_key];
32
- }
33
-
34
- _this = _super.call.apply(_super, [this].concat(args));
35
-
36
- _defineProperty(_assertThisInitialized(_this), "prefix", _this.context);
37
-
38
- _defineProperty(_assertThisInitialized(_this), "uid", _this.props.id || uniqueId());
39
-
40
- _defineProperty(_assertThisInitialized(_this), "handleChange", function (evt) {
41
- _this.props.onChange(_this.props.value, _this.props.name, evt);
42
- });
43
-
44
- return _this;
17
+ var _excluded = ["className", "disabled", "hideLabel", "id", "labelPosition", "labelText", "name", "onChange", "value"];
18
+ var RadioButton = /*#__PURE__*/React__default.forwardRef(function RadioButton(_ref, ref) {
19
+ var className = _ref.className,
20
+ disabled = _ref.disabled,
21
+ hideLabel = _ref.hideLabel,
22
+ id = _ref.id,
23
+ _ref$labelPosition = _ref.labelPosition,
24
+ labelPosition = _ref$labelPosition === void 0 ? 'right' : _ref$labelPosition,
25
+ _ref$labelText = _ref.labelText,
26
+ labelText = _ref$labelText === void 0 ? '' : _ref$labelText,
27
+ name = _ref.name,
28
+ _ref$onChange = _ref.onChange,
29
+ onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
30
+ _ref$value = _ref.value,
31
+ value = _ref$value === void 0 ? '' : _ref$value,
32
+ rest = _objectWithoutProperties(_ref, _excluded);
33
+
34
+ var prefix = usePrefix();
35
+ var uid = useId('radio-button');
36
+ var uniqueId = id || uid;
37
+
38
+ function handleOnChange(event) {
39
+ onChange(value, name, event);
45
40
  }
46
41
 
47
- _createClass(RadioButton, [{
48
- key: "render",
49
- value: function render() {
50
- var prefix = this.prefix;
51
-
52
- var _this$props = this.props,
53
- className = _this$props.className,
54
- labelText = _this$props.labelText,
55
- labelPosition = _this$props.labelPosition,
56
- ref = _this$props.innerRef,
57
- hideLabel = _this$props.hideLabel,
58
- other = _objectWithoutProperties(_this$props, _excluded);
59
-
60
- if (process.env.NODE_ENV !== "production") {
61
- process.env.NODE_ENV !== "production" ? warning(labelPosition !== 'top' && labelPosition !== 'bottom', '`top`/`bottom` values for `labelPosition` property in the `RadioButton` component is deprecated ' + 'and being removed in the next release of `carbon-components-react`.') : void 0;
62
- }
63
-
64
- var innerLabelClasses = cx(_defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
65
- var wrapperClasses = cx(className, "".concat(prefix, "--radio-button-wrapper"), _defineProperty({}, "".concat(prefix, "--radio-button-wrapper--label-").concat(labelPosition), labelPosition !== 'right'));
66
- return /*#__PURE__*/React__default.createElement("div", {
67
- className: wrapperClasses
68
- }, /*#__PURE__*/React__default.createElement("input", _extends({}, other, {
69
- type: "radio",
70
- className: "".concat(prefix, "--radio-button"),
71
- onChange: this.handleChange,
72
- id: this.uid,
73
- ref: ref
74
- })), /*#__PURE__*/React__default.createElement("label", {
75
- htmlFor: this.uid,
76
- className: "".concat(prefix, "--radio-button__label")
77
- }, /*#__PURE__*/React__default.createElement("span", {
78
- className: "".concat(prefix, "--radio-button__appearance")
79
- }), labelText && /*#__PURE__*/React__default.createElement(Text, {
80
- className: innerLabelClasses
81
- }, labelText)));
82
- }
83
- }]);
84
-
85
- return RadioButton;
86
- }(React__default.Component);
87
-
88
- _defineProperty(RadioButton, "propTypes", {
42
+ var innerLabelClasses = cx(_defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLabel));
43
+ var wrapperClasses = cx(className, "".concat(prefix, "--radio-button-wrapper"), _defineProperty({}, "".concat(prefix, "--radio-button-wrapper--label-").concat(labelPosition), labelPosition !== 'right'));
44
+ return /*#__PURE__*/React__default.createElement("div", {
45
+ className: wrapperClasses
46
+ }, /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
47
+ type: "radio",
48
+ className: "".concat(prefix, "--radio-button"),
49
+ onChange: handleOnChange,
50
+ id: uniqueId,
51
+ ref: ref,
52
+ disabled: disabled,
53
+ value: value,
54
+ name: name
55
+ })), /*#__PURE__*/React__default.createElement("label", {
56
+ htmlFor: uniqueId,
57
+ className: "".concat(prefix, "--radio-button__label")
58
+ }, /*#__PURE__*/React__default.createElement("span", {
59
+ className: "".concat(prefix, "--radio-button__appearance")
60
+ }), labelText && /*#__PURE__*/React__default.createElement(Text, {
61
+ className: innerLabelClasses
62
+ }, labelText)));
63
+ });
64
+ RadioButton.displayName = 'RadioButton';
65
+ RadioButton.propTypes = {
89
66
  /**
90
- * Specify whether the <RadioButton> is currently checked
67
+ * Specify whether the `<RadioButton>` is currently checked
91
68
  */
92
69
  checked: PropTypes.bool,
93
70
 
@@ -97,7 +74,7 @@ _defineProperty(RadioButton, "propTypes", {
97
74
  className: PropTypes.string,
98
75
 
99
76
  /**
100
- * Specify whether the <RadioButton> should be checked by default
77
+ * Specify whether the `<RadioButton>` should be checked by default
101
78
  */
102
79
  defaultChecked: PropTypes.bool,
103
80
 
@@ -120,7 +97,7 @@ _defineProperty(RadioButton, "propTypes", {
120
97
  * Provide where label text should be placed
121
98
  * NOTE: `top`/`bottom` are deprecated
122
99
  */
123
- labelPosition: PropTypes.oneOf(['top', 'right', 'bottom', 'left']),
100
+ labelPosition: PropTypes.oneOf(['right', 'left']),
124
101
 
125
102
  /**
126
103
  * Provide label text to be read by screen readers when interacting with the
@@ -145,28 +122,10 @@ _defineProperty(RadioButton, "propTypes", {
145
122
  onClick: PropTypes.func,
146
123
 
147
124
  /**
148
- * Specify the value of the <RadioButton>
125
+ * Specify the value of the `<RadioButton>`
149
126
  */
150
127
  value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
151
- });
128
+ };
129
+ var RadioButton$1 = RadioButton;
152
130
 
153
- _defineProperty(RadioButton, "contextType", PrefixContext);
154
-
155
- _defineProperty(RadioButton, "defaultProps", {
156
- labelText: '',
157
- labelPosition: 'right',
158
- onChange: function onChange() {},
159
- value: ''
160
- });
161
- var RadioButtonClassic = (function () {
162
- var forwardRef = function forwardRef(props, ref) {
163
- return /*#__PURE__*/React__default.createElement(RadioButton, _extends({}, props, {
164
- innerRef: ref
165
- }));
166
- };
167
-
168
- forwardRef.displayName = 'RadioButton';
169
- return /*#__PURE__*/React__default.forwardRef(forwardRef);
170
- })();
171
-
172
- export { RadioButton, RadioButtonClassic as default };
131
+ export { RadioButton$1 as default };
@@ -5,11 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import * as FeatureFlags from '@carbon/feature-flags';
9
- import RadioButtonNext from './next/RadioButton.js';
10
- import RadioButtonClassic from './RadioButton.js';
11
-
12
- var RadioButton = FeatureFlags.enabled('enable-v11-release') ? RadioButtonNext : RadioButtonClassic;
13
- var RadioButton$1 = RadioButton;
14
-
15
- export { RadioButton$1 as default };
8
+ import RadioButton from './RadioButton.js';
9
+ export { default } from './RadioButton.js';
@@ -5,121 +5,87 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { inherits as _inherits, createSuper as _createSuper, classCallCheck as _classCallCheck, defineProperty as _defineProperty, assertThisInitialized as _assertThisInitialized, createClass as _createClass } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { slicedToArray as _slicedToArray, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React__default from 'react';
10
+ import React__default, { useState } from 'react';
11
11
  import cx from 'classnames';
12
- import { warning } from '../../internal/warning.js';
13
12
  import { Legend } from '../Text/index.js';
14
- import { FeatureFlagContext } from '../FeatureFlags/index.js';
15
- import { PrefixContext } from '../../internal/usePrefix.js';
16
-
17
- var RadioButtonGroup = /*#__PURE__*/function (_React$Component) {
18
- _inherits(RadioButtonGroup, _React$Component);
19
-
20
- var _super = _createSuper(RadioButtonGroup);
21
-
22
- function RadioButtonGroup() {
23
- var _this;
24
-
25
- _classCallCheck(this, RadioButtonGroup);
26
-
27
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
28
- args[_key] = arguments[_key];
29
- }
13
+ import { usePrefix } from '../../internal/usePrefix.js';
14
+
15
+ var RadioButtonGroup = /*#__PURE__*/React__default.forwardRef(function RadioButtonGroup(_ref, ref) {
16
+ var _classNames;
17
+
18
+ var children = _ref.children,
19
+ className = _ref.className,
20
+ defaultSelected = _ref.defaultSelected,
21
+ disabled = _ref.disabled,
22
+ _ref$labelPosition = _ref.labelPosition,
23
+ labelPosition = _ref$labelPosition === void 0 ? 'right' : _ref$labelPosition,
24
+ legendText = _ref.legendText,
25
+ name = _ref.name,
26
+ _ref$onChange = _ref.onChange,
27
+ onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange,
28
+ _ref$orientation = _ref.orientation,
29
+ orientation = _ref$orientation === void 0 ? 'horizontal' : _ref$orientation,
30
+ valueSelected = _ref.valueSelected;
31
+ var prefix = usePrefix();
32
+
33
+ var _useState = useState(valueSelected !== null && valueSelected !== void 0 ? valueSelected : defaultSelected),
34
+ _useState2 = _slicedToArray(_useState, 2),
35
+ selected = _useState2[0],
36
+ setSelected = _useState2[1];
37
+
38
+ var _useState3 = useState(valueSelected),
39
+ _useState4 = _slicedToArray(_useState3, 2),
40
+ prevValueSelected = _useState4[0],
41
+ setPrevValueSelected = _useState4[1];
42
+ /**
43
+ * prop + state alignment - getDerivedStateFromProps
44
+ * only update if selected prop changes
45
+ */
30
46
 
31
- _this = _super.call.apply(_super, [this].concat(args));
32
47
 
33
- _defineProperty(_assertThisInitialized(_this), "state", {
34
- selected: typeof _this.props.valueSelected !== 'undefined' ? _this.props.valueSelected : _this.props.defaultSelected
35
- });
48
+ if (valueSelected !== prevValueSelected) {
49
+ setSelected(valueSelected);
50
+ setPrevValueSelected(valueSelected);
51
+ }
36
52
 
37
- _defineProperty(_assertThisInitialized(_this), "getRadioButtons", function () {
38
- var children = React__default.Children.map(_this.props.children, function (radioButton) {
39
- var value = radioButton.props.value;
40
- /* istanbul ignore if */
41
-
42
- if (typeof radioButton.props.checked !== 'undefined') {
43
- process.env.NODE_ENV !== "production" ? warning(false, "Instead of using the checked property on the RadioButton, set\n the defaultSelected property or valueSelected property on the RadioButtonGroup.") : void 0;
44
- }
45
-
46
- return /*#__PURE__*/React__default.cloneElement(radioButton, {
47
- name: _this.props.name,
48
- key: value,
49
- value: value,
50
- onChange: _this.handleChange,
51
- checked: value === _this.state.selected
52
- });
53
+ function getRadioButtons() {
54
+ var mappedChildren = React__default.Children.map(children, function (radioButton) {
55
+ var value = radioButton.props.value;
56
+ return /*#__PURE__*/React__default.cloneElement(radioButton, {
57
+ name: name,
58
+ key: value,
59
+ value: value,
60
+ onChange: handleOnChange,
61
+ checked: value === selected
53
62
  });
54
- return children;
55
- });
56
-
57
- _defineProperty(_assertThisInitialized(_this), "handleChange", function (newSelection, value, evt) {
58
- if (newSelection !== _this.state.selected) {
59
- _this.setState({
60
- selected: newSelection
61
- });
62
-
63
- _this.props.onChange(newSelection, _this.props.name, evt);
64
- }
65
63
  });
66
-
67
- return _this;
64
+ return mappedChildren;
68
65
  }
69
66
 
70
- _createClass(RadioButtonGroup, [{
71
- key: "render",
72
- value: function render() {
73
- var _this2 = this;
74
-
75
- var _this$props = this.props,
76
- disabled = _this$props.disabled,
77
- className = _this$props.className,
78
- hideLegend = _this$props.hideLegend,
79
- orientation = _this$props.orientation,
80
- labelPosition = _this$props.labelPosition,
81
- legendText = _this$props.legendText;
82
- var scope = this.context;
83
- var enabled;
84
-
85
- if (scope.enabled) {
86
- enabled = scope.enabled('enable-v11-release');
87
- }
88
-
89
- return /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, function (prefix) {
90
- var _classNames;
91
-
92
- var wrapperClasses = cx("".concat(prefix, "--radio-button-group"), [enabled ? null : className], (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--radio-button-group--").concat(orientation), orientation === 'vertical'), _defineProperty(_classNames, "".concat(prefix, "--radio-button-group--label-").concat(labelPosition), labelPosition), _classNames));
93
- var legendClasses = cx("".concat(prefix, "--label"), _defineProperty({}, "".concat(prefix, "--visually-hidden"), hideLegend));
94
- return /*#__PURE__*/React__default.createElement("div", {
95
- className: enabled ? cx("".concat(prefix, "--form-item"), className) : "".concat(prefix, "--form-item")
96
- }, /*#__PURE__*/React__default.createElement("fieldset", {
97
- className: wrapperClasses,
98
- disabled: disabled
99
- }, legendText && /*#__PURE__*/React__default.createElement(Legend, {
100
- className: legendClasses
101
- }, legendText), _this2.getRadioButtons()));
102
- });
67
+ function handleOnChange(newSelection, value, evt) {
68
+ if (newSelection !== selected) {
69
+ setSelected(newSelection);
70
+ onChange(newSelection, name, evt);
103
71
  }
104
- }], [{
105
- key: "getDerivedStateFromProps",
106
- value: function getDerivedStateFromProps(_ref, state) {
107
- var valueSelected = _ref.valueSelected,
108
- defaultSelected = _ref.defaultSelected;
109
- var prevValueSelected = state.prevValueSelected;
110
- return prevValueSelected === valueSelected ? null : {
111
- selected: typeof valueSelected !== 'undefined' ? valueSelected : defaultSelected,
112
- prevValueSelected: valueSelected
113
- };
114
- }
115
- }]);
116
-
117
- return RadioButtonGroup;
118
- }(React__default.Component);
72
+ }
119
73
 
120
- _defineProperty(RadioButtonGroup, "propTypes", {
74
+ var fieldsetClasses = cx("".concat(prefix, "--radio-button-group"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--radio-button-group--").concat(orientation), orientation === 'vertical'), _defineProperty(_classNames, "".concat(prefix, "--radio-button-group--label-").concat(labelPosition), labelPosition), _classNames));
75
+ var wrapperClasses = cx("".concat(prefix, "--form-item"), className);
76
+ return /*#__PURE__*/React__default.createElement("div", {
77
+ className: wrapperClasses,
78
+ ref: ref
79
+ }, /*#__PURE__*/React__default.createElement("fieldset", {
80
+ className: fieldsetClasses,
81
+ disabled: disabled
82
+ }, legendText && /*#__PURE__*/React__default.createElement(Legend, {
83
+ className: "".concat(prefix, "--label")
84
+ }, legendText), getRadioButtons()));
85
+ });
86
+ RadioButtonGroup.propTypes = {
121
87
  /**
122
- * Provide a collection of <RadioButton> components to render in the group
88
+ * Provide a collection of `<RadioButton>` components to render in the group
123
89
  */
124
90
  children: PropTypes.node,
125
91
 
@@ -129,7 +95,7 @@ _defineProperty(RadioButtonGroup, "propTypes", {
129
95
  className: PropTypes.string,
130
96
 
131
97
  /**
132
- * Specify the <RadioButton> to be selected by default
98
+ * Specify the `<RadioButton>` to be selected by default
133
99
  */
134
100
  defaultSelected: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
135
101
 
@@ -138,11 +104,6 @@ _defineProperty(RadioButtonGroup, "propTypes", {
138
104
  */
139
105
  disabled: PropTypes.bool,
140
106
 
141
- /**
142
- * Specify whether the legend should be hidden, or not
143
- */
144
- hideLegend: PropTypes.bool,
145
-
146
107
  /**
147
108
  * Provide where label text should be placed
148
109
  */
@@ -174,17 +135,7 @@ _defineProperty(RadioButtonGroup, "propTypes", {
174
135
  * Specify the value that is currently selected in the group
175
136
  */
176
137
  valueSelected: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
177
- });
178
-
179
- _defineProperty(RadioButtonGroup, "defaultProps", {
180
- orientation: 'horizontal',
181
- labelPosition: 'right',
182
- hideLegend: false,
183
- onChange:
184
- /* istanbul ignore next */
185
- function onChange() {}
186
- });
187
-
188
- _defineProperty(RadioButtonGroup, "contextType", FeatureFlagContext);
138
+ };
139
+ var RadioButtonGroup$1 = RadioButtonGroup;
189
140
 
190
- export { RadioButtonGroup as default };
141
+ export { RadioButtonGroup$1 as default };
@@ -5,11 +5,5 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import * as FeatureFlags from '@carbon/feature-flags';
9
- import RadioButtonGroupNext from './next/RadioButtonGroup.js';
10
- import RadioButtonGroup$2 from './RadioButtonGroup.js';
11
-
12
- var RadioButtonGroup = FeatureFlags.enabled('enable-v11-release') ? RadioButtonGroupNext : RadioButtonGroup$2;
13
- var RadioButtonGroup$1 = RadioButtonGroup;
14
-
15
- export { RadioButtonGroup$1 as default };
8
+ import RadioButtonGroup from './RadioButtonGroup.js';
9
+ export { default } from './RadioButtonGroup.js';
@@ -457,7 +457,8 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
457
457
  "aria-valuemax": max,
458
458
  "aria-valuemin": min,
459
459
  "aria-valuenow": value,
460
- style: thumbStyle
460
+ style: thumbStyle,
461
+ "aria-labelledby": labelId
461
462
  }), /*#__PURE__*/React__default.createElement("div", {
462
463
  className: "".concat(prefix, "--slider__track"),
463
464
  ref: function ref(node) {
@@ -115,7 +115,6 @@ Switch.propTypes = {
115
115
  };
116
116
  Switch.defaultProps = {
117
117
  selected: false,
118
- text: 'Provide text',
119
118
  onClick: function onClick() {},
120
119
  onKeyDown: function onKeyDown() {}
121
120
  };
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, slicedToArray as _slicedToArray, extends as _extends, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import React__default, { useRef, useState, useEffect } from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
@@ -69,12 +69,15 @@ function TreeView(_ref) {
69
69
  return selectedId !== nodeId;
70
70
  }));
71
71
  }
72
+
73
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, node);
72
74
  } else {
73
75
  setSelected([nodeId]);
74
76
  setActive(nodeId);
77
+ onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, _objectSpread2({
78
+ activeNodeId: nodeId
79
+ }, node));
75
80
  }
76
-
77
- onSelect === null || onSelect === void 0 ? void 0 : onSelect(event, node);
78
81
  }
79
82
 
80
83
  function handleFocusEvent(event) {
@@ -213,15 +216,20 @@ function TreeView(_ref) {
213
216
  }
214
217
  });
215
218
  }, [prefix]);
216
- useEffect(function () {
217
- if (preselected.length) {
218
- setSelected(preselected);
219
- }
220
219
 
221
- if (prespecifiedActive) {
222
- setActive(prespecifiedActive);
223
- }
224
- }, [preselected, prespecifiedActive]);
220
+ var useActiveAndSelectedOnMount = function useActiveAndSelectedOnMount() {
221
+ return useEffect(function () {
222
+ if (preselected.length) {
223
+ setSelected(preselected);
224
+ }
225
+
226
+ if (prespecifiedActive) {
227
+ setActive(prespecifiedActive);
228
+ }
229
+ }, []);
230
+ };
231
+
232
+ useActiveAndSelectedOnMount();
225
233
  var labelId = "".concat(treeId, "__label");
226
234
 
227
235
  var TreeLabel = function TreeLabel() {
@@ -237,4 +237,4 @@ var HeaderMenuForwardRef = /*#__PURE__*/React__default.forwardRef(function (prop
237
237
  HeaderMenuForwardRef.displayName = 'HeaderMenu';
238
238
  var HeaderMenuForwardRef$1 = HeaderMenuForwardRef;
239
239
 
240
- export { HeaderMenuForwardRef$1 as default };
240
+ export { HeaderMenu, HeaderMenuForwardRef$1 as default };
@@ -56,6 +56,10 @@ HeaderMenuButton.propTypes = _objectSpread2(_objectSpread2({}, AriaLabelPropType
56
56
  * button
57
57
  */
58
58
  className: PropTypes.string,
59
+
60
+ /**
61
+ * Specify whether the menu button is "active".
62
+ */
59
63
  isActive: PropTypes.bool,
60
64
 
61
65
  /**
@@ -5,20 +5,25 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
9
  import cx from 'classnames';
9
10
  import PropTypes from 'prop-types';
10
11
  import React__default from 'react';
11
12
  import { usePrefix } from '../../internal/usePrefix.js';
12
13
 
14
+ var _excluded = ["children", "className", "title"];
15
+
13
16
  var SideNavDetails = function SideNavDetails(_ref) {
14
17
  var children = _ref.children,
15
18
  customClassName = _ref.className,
16
- title = _ref.title;
19
+ title = _ref.title,
20
+ rest = _objectWithoutProperties(_ref, _excluded);
21
+
17
22
  var prefix = usePrefix();
18
23
  var className = cx("".concat(prefix, "--side-nav__details"), customClassName);
19
- return /*#__PURE__*/React__default.createElement("div", {
24
+ return /*#__PURE__*/React__default.createElement("div", _extends({
20
25
  className: className
21
- }, /*#__PURE__*/React__default.createElement("h2", {
26
+ }, rest), /*#__PURE__*/React__default.createElement("h2", {
22
27
  className: "".concat(prefix, "--side-nav__title"),
23
28
  title: title
24
29
  }, title), children);
@@ -15,15 +15,16 @@ import SideNavItem from './SideNavItem.js';
15
15
  import SideNavLinkText from './SideNavLinkText.js';
16
16
  import { usePrefix } from '../../internal/usePrefix.js';
17
17
 
18
- var _excluded = ["className", "children", "renderIcon", "isActive", "large"];
18
+ var _excluded = ["children", "className", "renderIcon", "isActive", "large"];
19
19
  var SideNavLink = /*#__PURE__*/React__default.forwardRef(function SideNavLink(_ref, ref) {
20
20
  var _cx;
21
21
 
22
- var customClassName = _ref.className,
23
- children = _ref.children,
22
+ var children = _ref.children,
23
+ customClassName = _ref.className,
24
24
  IconElement = _ref.renderIcon,
25
25
  isActive = _ref.isActive,
26
- large = _ref.large,
26
+ _ref$large = _ref.large,
27
+ large = _ref$large === void 0 ? false : _ref$large,
27
28
  rest = _objectWithoutProperties(_ref, _excluded);
28
29
 
29
30
  var prefix = usePrefix();
@@ -58,11 +59,7 @@ SideNavLink.propTypes = _objectSpread2(_objectSpread2({}, LinkPropTypes), {}, {
58
59
  * Provide an icon to render in the side navigation link. Should be a React class.
59
60
  */
60
61
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
61
- });
62
- SideNavLink.defaultProps = {
63
- element: 'a',
64
- large: false
65
- }; // eslint-disable-next-line react/display-name
62
+ }); // eslint-disable-next-line react/display-name
66
63
  var SideNavLink$1 = SideNavLink;
67
64
 
68
65
  export { SideNavLink$1 as default };