@carbon/react 1.3.0-rc.1 → 1.4.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 (45) hide show
  1. package/es/components/Checkbox/Checkbox.Skeleton.js +5 -3
  2. package/es/components/ComposedModal/next/ComposedModal.js +11 -11
  3. package/es/components/DatePicker/DatePicker.js +264 -334
  4. package/es/components/DatePickerInput/DatePickerInput.js +141 -168
  5. package/es/components/FileUploader/FileUploader.js +3 -3
  6. package/es/components/FileUploader/FileUploaderButton.js +4 -4
  7. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -3
  8. package/es/components/FormGroup/FormGroup.js +1 -2
  9. package/es/components/IconButton/index.js +2 -2
  10. package/es/components/MultiSelect/FilterableMultiSelect.js +10 -0
  11. package/es/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
  12. package/es/components/RadioButton/RadioButton.js +1 -1
  13. package/es/components/Slider/Slider.js +11 -0
  14. package/es/components/StructuredList/next/StructuredList.js +19 -3
  15. package/es/components/TabContent/TabContent.js +2 -1
  16. package/es/components/Tabs/next/Tabs.js +31 -25
  17. package/es/components/UIShell/SideNav.js +1 -1
  18. package/es/index.js +3 -3
  19. package/lib/components/Checkbox/Checkbox.Skeleton.js +5 -3
  20. package/lib/components/ComposedModal/next/ComposedModal.js +11 -11
  21. package/lib/components/DatePicker/DatePicker.js +261 -331
  22. package/lib/components/DatePickerInput/DatePickerInput.js +138 -165
  23. package/lib/components/FileUploader/FileUploader.js +3 -3
  24. package/lib/components/FileUploader/FileUploaderButton.js +4 -4
  25. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -3
  26. package/lib/components/FormGroup/FormGroup.js +1 -2
  27. package/lib/components/IconButton/index.js +1 -1
  28. package/lib/components/MultiSelect/FilterableMultiSelect.js +10 -0
  29. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +11 -0
  30. package/lib/components/RadioButton/RadioButton.js +1 -1
  31. package/lib/components/Slider/Slider.js +11 -0
  32. package/lib/components/StructuredList/next/StructuredList.js +19 -3
  33. package/lib/components/TabContent/TabContent.js +2 -1
  34. package/lib/components/Tabs/next/Tabs.js +31 -25
  35. package/lib/components/UIShell/SideNav.js +1 -1
  36. package/lib/index.js +100 -100
  37. package/package.json +4 -4
  38. package/es/components/DatePicker/index.js +0 -15
  39. package/es/components/DatePicker/next/DatePicker.js +0 -562
  40. package/es/components/DatePickerInput/index.js +0 -15
  41. package/es/components/DatePickerInput/next/DatePickerInput.js +0 -244
  42. package/lib/components/DatePicker/index.js +0 -39
  43. package/lib/components/DatePicker/next/DatePicker.js +0 -573
  44. package/lib/components/DatePickerInput/index.js +0 -39
  45. package/lib/components/DatePickerInput/next/DatePickerInput.js +0 -254
@@ -5,152 +5,94 @@
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, createClass as _createClass, objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import PropTypes from 'prop-types';
10
- import React__default, { Component } from 'react';
11
- import deprecate from '../../prop-types/deprecate.js';
12
- import cx from 'classnames';
8
+ import { objectWithoutProperties as _objectWithoutProperties, defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
13
9
  import { WarningFilled, WarningAltFilled, Calendar } from '@carbon/icons-react';
14
- import { PrefixContext } from '../../internal/usePrefix.js';
15
-
16
- var _excluded = ["id", "labelText", "disabled", "invalid", "invalidText", "helperText", "hideLabel", "onChange", "onClick", "placeholder", "type", "datePickerType", "pattern", "iconDescription", "openCalendar", "size", "warn", "warnText"];
17
-
18
- var DatePickerInput = /*#__PURE__*/function (_Component) {
19
- _inherits(DatePickerInput, _Component);
20
-
21
- var _super = _createSuper(DatePickerInput);
22
-
23
- function DatePickerInput() {
24
- _classCallCheck(this, DatePickerInput);
25
-
26
- return _super.apply(this, arguments);
27
- }
28
-
29
- _createClass(DatePickerInput, [{
30
- key: "render",
31
- value: function render() {
32
- var _this = this,
33
- _title;
34
-
35
- var _this$props = this.props,
36
- id = _this$props.id,
37
- labelText = _this$props.labelText,
38
- disabled = _this$props.disabled,
39
- invalid = _this$props.invalid,
40
- invalidText = _this$props.invalidText,
41
- helperText = _this$props.helperText,
42
- hideLabel = _this$props.hideLabel,
43
- _onChange = _this$props.onChange,
44
- _onClick = _this$props.onClick,
45
- placeholder = _this$props.placeholder,
46
- type = _this$props.type,
47
- datePickerType = _this$props.datePickerType,
48
- pattern = _this$props.pattern,
49
- iconDescription = _this$props.iconDescription,
50
- openCalendar = _this$props.openCalendar,
51
- size = _this$props.size,
52
- warn = _this$props.warn,
53
- warnText = _this$props.warnText,
54
- other = _objectWithoutProperties(_this$props, _excluded);
55
-
56
- var datePickerInputProps = {
57
- id: id,
58
- onChange: function onChange(evt) {
59
- if (!disabled) {
60
- _onChange(evt);
61
- }
62
- },
63
- onClick: function onClick(evt) {
64
- if (!disabled) {
65
- _onClick(evt);
66
- }
67
- },
68
- placeholder: placeholder,
69
- type: type,
70
- pattern: pattern
71
- };
72
- return /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, function (prefix) {
73
- var _classNames, _classNames2, _classNames4;
74
-
75
- var wrapperClasses = cx("".concat(prefix, "--date-picker-input__wrapper"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--date-picker-input__wrapper--invalid"), invalid), _defineProperty(_classNames, "".concat(prefix, "--date-picker-input__wrapper--warn"), warn), _classNames));
76
- var labelClasses = cx("".concat(prefix, "--label"), (_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_classNames2, "".concat(prefix, "--label--disabled"), disabled), _classNames2));
77
- var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), _defineProperty({}, "".concat(prefix, "--form__helper-text--disabled"), disabled));
78
- var inputClasses = cx("".concat(prefix, "--date-picker__input"), (_classNames4 = {}, _defineProperty(_classNames4, "".concat(prefix, "--date-picker__input--").concat(size), size), _defineProperty(_classNames4, "".concat(prefix, "--date-picker__input--invalid"), invalid), _classNames4));
79
-
80
- var datePickerIcon = function () {
81
- if (datePickerType === 'simple' && !invalid && !warn) {
82
- return;
83
- }
84
-
85
- if (invalid) {
86
- return /*#__PURE__*/React__default.createElement(WarningFilled, {
87
- className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--invalid")
88
- });
89
- }
90
-
91
- if (!invalid && warn) {
92
- return /*#__PURE__*/React__default.createElement(WarningAltFilled, {
93
- className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--warn")
94
- });
95
- }
96
-
97
- return /*#__PURE__*/React__default.createElement(Calendar, {
98
- className: "".concat(prefix, "--date-picker__icon"),
99
- "aria-label": iconDescription,
100
- onClick: openCalendar,
101
- role: "img",
102
- "aria-hidden": "true"
103
- }, iconDescription && (_title || (_title = /*#__PURE__*/React__default.createElement("title", null, iconDescription))));
104
- }();
105
-
106
- var label = labelText ? /*#__PURE__*/React__default.createElement("label", {
107
- htmlFor: id,
108
- className: labelClasses
109
- }, labelText) : null;
110
- var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
111
- className: helperTextClasses
112
- }, helperText) : null;
113
- var error = null;
114
-
115
- if (invalid) {
116
- error = /*#__PURE__*/React__default.createElement("div", {
117
- className: "".concat(prefix, "--form-requirement")
118
- }, invalidText);
119
- } else if (warn) {
120
- error = /*#__PURE__*/React__default.createElement("div", {
121
- className: "".concat(prefix, "--form-requirement")
122
- }, warnText);
123
- }
124
-
125
- var containerClasses = cx("".concat(prefix, "--date-picker-container"), _defineProperty({}, "".concat(prefix, "--date-picker--nolabel"), !label));
126
- var input = invalid ? /*#__PURE__*/React__default.createElement("input", _extends({}, other, datePickerInputProps, {
127
- disabled: disabled,
128
- ref: function ref(input) {
129
- _this.input = input;
130
- },
131
- "data-invalid": true,
132
- className: inputClasses
133
- })) : /*#__PURE__*/React__default.createElement("input", _extends({
134
- ref: function ref(input) {
135
- _this.input = input;
136
- }
137
- }, other, datePickerInputProps, {
138
- disabled: disabled,
139
- className: inputClasses
140
- }));
141
- return /*#__PURE__*/React__default.createElement("div", {
142
- className: containerClasses
143
- }, label, /*#__PURE__*/React__default.createElement("div", {
144
- className: wrapperClasses
145
- }, input, datePickerIcon), error, helper);
146
- });
147
- }
148
- }]);
149
-
150
- return DatePickerInput;
151
- }(Component);
152
-
153
- _defineProperty(DatePickerInput, "propTypes", {
10
+ import cx from 'classnames';
11
+ import PropTypes from 'prop-types';
12
+ import React__default from 'react';
13
+ import { usePrefix } from '../../internal/usePrefix.js';
14
+
15
+ var _excluded = ["datePickerType", "disabled", "helperText", "hideLabel", "id", "invalid", "invalidText", "labelText", "onClick", "onChange", "pattern", "placeholder", "size", "type", "warn", "warnText"];
16
+ var DatePickerInput = /*#__PURE__*/React__default.forwardRef(function DatePickerInput(props, ref) {
17
+ var _cx, _cx2, _cx4;
18
+
19
+ var datePickerType = props.datePickerType,
20
+ _props$disabled = props.disabled,
21
+ disabled = _props$disabled === void 0 ? false : _props$disabled,
22
+ helperText = props.helperText,
23
+ hideLabel = props.hideLabel,
24
+ id = props.id,
25
+ _props$invalid = props.invalid,
26
+ invalid = _props$invalid === void 0 ? false : _props$invalid,
27
+ invalidText = props.invalidText,
28
+ labelText = props.labelText,
29
+ _props$onClick = props.onClick,
30
+ _onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
31
+ _props$onChange = props.onChange,
32
+ _onChange = _props$onChange === void 0 ? function () {} : _props$onChange,
33
+ _props$pattern = props.pattern,
34
+ pattern = _props$pattern === void 0 ? '\\d{1,2}\\/\\d{1,2}\\/\\d{4}' : _props$pattern,
35
+ placeholder = props.placeholder,
36
+ _props$size = props.size,
37
+ size = _props$size === void 0 ? 'md' : _props$size,
38
+ _props$type = props.type,
39
+ type = _props$type === void 0 ? 'text' : _props$type,
40
+ warn = props.warn,
41
+ warnText = props.warnText,
42
+ rest = _objectWithoutProperties(props, _excluded);
43
+
44
+ var prefix = usePrefix();
45
+ var datePickerInputProps = {
46
+ id: id,
47
+ onChange: function onChange(event) {
48
+ if (!disabled) {
49
+ _onChange(event);
50
+ }
51
+ },
52
+ onClick: function onClick(event) {
53
+ if (!disabled) {
54
+ _onClick(event);
55
+ }
56
+ },
57
+ pattern: pattern,
58
+ placeholder: placeholder,
59
+ type: type
60
+ };
61
+ var wrapperClasses = cx("".concat(prefix, "--date-picker-input__wrapper"), (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--date-picker-input__wrapper--invalid"), invalid), _defineProperty(_cx, "".concat(prefix, "--date-picker-input__wrapper--warn"), warn), _cx));
62
+ var labelClasses = cx("".concat(prefix, "--label"), (_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--visually-hidden"), hideLabel), _defineProperty(_cx2, "".concat(prefix, "--label--disabled"), disabled), _cx2));
63
+ var helperTextClasses = cx("".concat(prefix, "--form__helper-text"), _defineProperty({}, "".concat(prefix, "--form__helper-text--disabled"), disabled));
64
+ var inputClasses = cx("".concat(prefix, "--date-picker__input"), (_cx4 = {}, _defineProperty(_cx4, "".concat(prefix, "--date-picker__input--").concat(size), size), _defineProperty(_cx4, "".concat(prefix, "--date-picker__input--invalid"), invalid), _cx4));
65
+ var containerClasses = cx("".concat(prefix, "--date-picker-container"), _defineProperty({}, "".concat(prefix, "--date-picker--nolabel"), !labelText));
66
+ var input = invalid ? /*#__PURE__*/React__default.createElement("input", _extends({}, rest, datePickerInputProps, {
67
+ disabled: disabled,
68
+ ref: ref,
69
+ "data-invalid": true,
70
+ className: inputClasses
71
+ })) : /*#__PURE__*/React__default.createElement("input", _extends({}, rest, datePickerInputProps, {
72
+ disabled: disabled,
73
+ className: inputClasses,
74
+ ref: ref
75
+ }));
76
+ return /*#__PURE__*/React__default.createElement("div", {
77
+ className: containerClasses
78
+ }, labelText && /*#__PURE__*/React__default.createElement("label", {
79
+ htmlFor: id,
80
+ className: labelClasses
81
+ }, labelText), /*#__PURE__*/React__default.createElement("div", {
82
+ className: wrapperClasses
83
+ }, input, /*#__PURE__*/React__default.createElement(DatePickerIcon, {
84
+ datePickerType: datePickerType,
85
+ invalid: invalid,
86
+ warn: warn
87
+ })), invalid && /*#__PURE__*/React__default.createElement("div", {
88
+ className: "".concat(prefix, "--form-requirement")
89
+ }, invalidText), warn && /*#__PURE__*/React__default.createElement("div", {
90
+ className: "".concat(prefix, "--form-requirement")
91
+ }, warnText), helperText && /*#__PURE__*/React__default.createElement("div", {
92
+ className: helperTextClasses
93
+ }, helperText));
94
+ });
95
+ DatePickerInput.propTypes = {
154
96
  /**
155
97
  * The type of the date picker:
156
98
  *
@@ -175,11 +117,6 @@ _defineProperty(DatePickerInput, "propTypes", {
175
117
  */
176
118
  hideLabel: PropTypes.bool,
177
119
 
178
- /**
179
- * The description of the calendar icon.
180
- */
181
- iconDescription: deprecate(PropTypes.string, "\nThe prop `iconDescriptionInput` for DatePickerInput has been deprecated and is no longer used"),
182
-
183
120
  /**
184
121
  * Specify an id that uniquely identifies the `<input>`
185
122
  */
@@ -212,11 +149,6 @@ _defineProperty(DatePickerInput, "propTypes", {
212
149
  */
213
150
  onClick: PropTypes.func,
214
151
 
215
- /**
216
- * Provide a function to be called when the input field is clicked
217
- */
218
- openCalendar: deprecate(PropTypes.func, "\nThe prop `openCalendar` for DatePickerInput has been deprecated and is no longer used"),
219
-
220
152
  /**
221
153
  * Provide a regular expression that the input value must match
222
154
  */
@@ -238,10 +170,9 @@ _defineProperty(DatePickerInput, "propTypes", {
238
170
  placeholder: PropTypes.string,
239
171
 
240
172
  /**
241
- * Specify the size of the Date Picker Input. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
242
- * TODO V11: remove `xl` (replaced with lg)
173
+ * Specify the size of the Date Picker Input. Currently supports either `sm`, `md`, or `lg` as an option.
243
174
  */
244
- size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl']),
175
+ size: PropTypes.oneOf(['sm', 'md', 'lg']),
245
176
 
246
177
  /**
247
178
  * Specify the type of the `<input>`
@@ -257,15 +188,57 @@ _defineProperty(DatePickerInput, "propTypes", {
257
188
  * Provide the text that is displayed when the control is in warning state
258
189
  */
259
190
  warnText: PropTypes.node
260
- });
191
+ };
261
192
 
262
- _defineProperty(DatePickerInput, "defaultProps", {
263
- pattern: '\\d{1,2}\\/\\d{1,2}\\/\\d{4}',
264
- type: 'text',
265
- disabled: false,
266
- invalid: false,
267
- onClick: function onClick() {},
268
- onChange: function onChange() {}
269
- });
193
+ function DatePickerIcon(_ref) {
194
+ var datePickerType = _ref.datePickerType,
195
+ invalid = _ref.invalid,
196
+ warn = _ref.warn;
197
+ var prefix = usePrefix();
198
+
199
+ if (datePickerType === 'simple' && !invalid && !warn) {
200
+ return null;
201
+ }
202
+
203
+ if (invalid) {
204
+ return /*#__PURE__*/React__default.createElement(WarningFilled, {
205
+ className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--invalid")
206
+ });
207
+ }
208
+
209
+ if (!invalid && warn) {
210
+ return /*#__PURE__*/React__default.createElement(WarningAltFilled, {
211
+ className: "".concat(prefix, "--date-picker__icon ").concat(prefix, "--date-picker__icon--warn")
212
+ });
213
+ }
214
+
215
+ return /*#__PURE__*/React__default.createElement(Calendar, {
216
+ className: "".concat(prefix, "--date-picker__icon"),
217
+ role: "img",
218
+ "aria-hidden": "true"
219
+ });
220
+ }
221
+
222
+ DatePickerIcon.propTypes = {
223
+ /**
224
+ * The type of the date picker:
225
+ *
226
+ * * `simple` - Without calendar dropdown.
227
+ * * `single` - With calendar dropdown and single date.
228
+ * * `range` - With calendar dropdown and a date range.
229
+ */
230
+ datePickerType: PropTypes.oneOf(['simple', 'single', 'range']),
231
+
232
+ /**
233
+ * Specify whether or not the input should be invalid
234
+ */
235
+ invalid: PropTypes.bool,
236
+
237
+ /**
238
+ * Specify whether the control is currently in warning state
239
+ */
240
+ warn: PropTypes.bool
241
+ };
242
+ var DatePickerInput$1 = DatePickerInput;
270
243
 
271
- export { DatePickerInput as default };
244
+ export { DatePickerInput$1 as default };
@@ -193,13 +193,13 @@ _defineProperty(FileUploader, "propTypes", {
193
193
  accept: PropTypes.arrayOf(PropTypes.string),
194
194
 
195
195
  /**
196
- * Specify the type of the <FileUploaderButton>
196
+ * Specify the type of the `<FileUploaderButton>`
197
197
  */
198
198
  buttonKind: PropTypes.oneOf(ButtonKinds),
199
199
 
200
200
  /**
201
201
  * Provide the label text to be read by screen readers when interacting with
202
- * the <FileUploaderButton>
202
+ * the `<FileUploaderButton>`
203
203
  */
204
204
  buttonLabel: PropTypes.string,
205
205
 
@@ -229,7 +229,7 @@ _defineProperty(FileUploader, "propTypes", {
229
229
  labelDescription: PropTypes.string,
230
230
 
231
231
  /**
232
- * Specify the title text of this <FileUploader>
232
+ * Specify the title text of this `<FileUploader>`
233
233
  */
234
234
  labelTitle: PropTypes.string,
235
235
 
@@ -162,12 +162,12 @@ FileUploaderButton.propTypes = {
162
162
  multiple: PropTypes.bool,
163
163
 
164
164
  /**
165
- * Provide a name for the underlying <input> node
165
+ * Provide a name for the underlying `<input>` node
166
166
  */
167
167
  name: PropTypes.string,
168
168
 
169
169
  /**
170
- * Provide an optional `onChange` hook that is called each time the <input>
170
+ * Provide an optional `onChange` hook that is called each time the `<input>`
171
171
  * value changes
172
172
  */
173
173
  onChange: PropTypes.func,
@@ -179,7 +179,7 @@ FileUploaderButton.propTypes = {
179
179
  onClick: PropTypes.func,
180
180
 
181
181
  /**
182
- * Provide an accessibility role for the <FileUploaderButton>
182
+ * Provide an accessibility role for the `<FileUploaderButton>`
183
183
  */
184
184
  role: PropTypes.string,
185
185
 
@@ -190,7 +190,7 @@ FileUploaderButton.propTypes = {
190
190
  size: FeatureFlags.enabled('enable-v11-release') ? PropTypes.oneOf(['sm', 'md', 'lg']) : PropTypes.oneOf(['default', 'field', 'small', 'sm', 'md', 'lg']),
191
191
 
192
192
  /**
193
- * Provide a custom tabIndex value for the <FileUploaderButton>
193
+ * Provide a custom tabIndex value for the `<FileUploaderButton>`
194
194
  */
195
195
  tabIndex: PropTypes.number
196
196
  };
@@ -73,7 +73,7 @@ function FileUploaderDropContainer(_ref) {
73
73
  _name$match2 = _slicedToArray(_name$match, 1),
74
74
  fileExtension = _name$match2[0];
75
75
 
76
- if (acceptedTypes.has(mimeType) || acceptedTypes.has(fileExtension)) {
76
+ if (acceptedTypes.has(mimeType) || acceptedTypes.has(fileExtension.toLowerCase())) {
77
77
  return acc.concat([curr]);
78
78
  }
79
79
 
@@ -202,12 +202,12 @@ FileUploaderDropContainer.propTypes = {
202
202
  pattern: PropTypes.string,
203
203
 
204
204
  /**
205
- * Provide an accessibility role for the <FileUploaderButton>
205
+ * Provide an accessibility role for the `<FileUploaderButton>`
206
206
  */
207
207
  role: PropTypes.string,
208
208
 
209
209
  /**
210
- * Provide a custom tabIndex value for the <FileUploaderButton>
210
+ * Provide a custom tabIndex value for the `<FileUploaderButton>`
211
211
  */
212
212
  tabIndex: PropTypes.number
213
213
  };
@@ -79,8 +79,7 @@ FormGroup.propTypes = {
79
79
  FormGroup.defaultProps = {
80
80
  invalid: false,
81
81
  message: false,
82
- messageText: '',
83
- hasMargin: true
82
+ messageText: ''
84
83
  };
85
84
  var FormGroup$1 = FormGroup;
86
85
 
@@ -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, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
10
  import React__default from 'react';
11
11
  import Button from '../Button/Button.js';
@@ -40,7 +40,7 @@ var IconButton = /*#__PURE__*/React__default.forwardRef(function IconButton(prop
40
40
  kind: kind,
41
41
  ref: ref,
42
42
  size: size,
43
- className: cx("".concat(prefix, "--btn--icon-only"), _defineProperty({}, className, className))
43
+ className: cx("".concat(prefix, "--btn--icon-only"), className)
44
44
  }), children));
45
45
  });
46
46
  IconButton.propTypes = {
@@ -104,6 +104,10 @@ var FilterableMultiSelect = /*#__PURE__*/function (_React$Component) {
104
104
  _defineProperty(_assertThisInitialized(_this), "handleOnInputValueChange", function (inputValue, _ref) {
105
105
  var type = _ref.type;
106
106
 
107
+ if (_this.props.onInputValueChange) {
108
+ _this.props.onInputValueChange(inputValue);
109
+ }
110
+
107
111
  if (type !== Downshift.stateChangeTypes.changeInput) {
108
112
  return;
109
113
  }
@@ -504,6 +508,12 @@ _defineProperty(FilterableMultiSelect, "propTypes", _objectSpread2(_objectSpread
504
508
  */
505
509
  onChange: PropTypes.func,
506
510
 
511
+ /**
512
+ * `onInputValueChange` is a utility for this controlled component to communicate to
513
+ * the currently typed input.
514
+ */
515
+ onInputValueChange: PropTypes.func,
516
+
507
517
  /**
508
518
  * `onMenuChange` is a utility for this controlled component to communicate to a
509
519
  * consuming component that the menu was opened(`true`)/closed(`false`).
@@ -50,6 +50,7 @@ var FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Filt
50
50
  itemToString = _ref.itemToString,
51
51
  light = _ref.light,
52
52
  locale = _ref.locale,
53
+ onInputValueChange = _ref.onInputValueChange,
53
54
  open = _ref.open,
54
55
  onChange = _ref.onChange,
55
56
  onMenuChange = _ref.onMenuChange,
@@ -168,6 +169,10 @@ var FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Filt
168
169
  function handleOnInputValueChange(inputValue, _ref2) {
169
170
  var type = _ref2.type;
170
171
 
172
+ if (onInputValueChange) {
173
+ onInputValueChange(inputValue);
174
+ }
175
+
171
176
  if (type !== Downshift.stateChangeTypes.changeInput) {
172
177
  return;
173
178
  }
@@ -462,6 +467,12 @@ FilterableMultiSelect.propTypes = _objectSpread2(_objectSpread2({
462
467
  */
463
468
  onChange: PropTypes.func,
464
469
 
470
+ /**
471
+ * `onInputValueChange` is a utility for this controlled component to communicate to
472
+ * the currently typed input.
473
+ */
474
+ onInputValueChange: PropTypes.func,
475
+
465
476
  /**
466
477
  * `onMenuChange` is a utility for this controlled component to communicate to a
467
478
  * consuming component that the menu was opened(`true`)/closed(`false`).
@@ -147,7 +147,7 @@ _defineProperty(RadioButton, "propTypes", {
147
147
  /**
148
148
  * Specify the value of the <RadioButton>
149
149
  */
150
- value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
150
+ value: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
151
151
  });
152
152
 
153
153
  _defineProperty(RadioButton, "contextType", PrefixContext);
@@ -220,10 +220,15 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
220
220
 
221
221
 
222
222
  var validity = evt.target.checkValidity();
223
+ var value = evt.target.value;
223
224
 
224
225
  _this.setState({
225
226
  isValid: validity
226
227
  });
228
+
229
+ _this.props.onBlur({
230
+ value: value
231
+ });
227
232
  });
228
233
 
229
234
  _defineProperty(_assertThisInitialized(_this), "calcValue", function (_ref) {
@@ -592,6 +597,12 @@ _defineProperty(Slider, "propTypes", {
592
597
  */
593
598
  name: PropTypes.string,
594
599
 
600
+ /**
601
+ * Provide an optional function to be called when the input element
602
+ * loses focus
603
+ */
604
+ onBlur: PropTypes.func,
605
+
595
606
  /**
596
607
  * The callback to get notified of change in value.
597
608
  */
@@ -13,7 +13,7 @@ import { useId } from '../../../internal/useId.js';
13
13
  import deprecate from '../../../prop-types/deprecate.js';
14
14
  import { usePrefix } from '../../../internal/usePrefix.js';
15
15
 
16
- var _excluded = ["children", "selection", "className", "ariaLabel"],
16
+ var _excluded = ["children", "selection", "className", "ariaLabel", "isCondensed", "isFlush"],
17
17
  _excluded2 = ["children", "className"],
18
18
  _excluded3 = ["children", "className"],
19
19
  _excluded4 = ["onKeyDown", "children", "className", "head"],
@@ -22,14 +22,18 @@ var _excluded = ["children", "selection", "className", "ariaLabel"],
22
22
  var GridSelectedRowStateContext = /*#__PURE__*/React__default.createContext(null);
23
23
  var GridSelectedRowDispatchContext = /*#__PURE__*/React__default.createContext(null);
24
24
  function StructuredListWrapper(props) {
25
+ var _classNames;
26
+
25
27
  var children = props.children,
26
28
  selection = props.selection,
27
29
  className = props.className,
28
30
  ariaLabel = props.ariaLabel,
31
+ isCondensed = props.isCondensed,
32
+ isFlush = props.isFlush,
29
33
  other = _objectWithoutProperties(props, _excluded);
30
34
 
31
35
  var prefix = usePrefix();
32
- var classes = cx("".concat(prefix, "--structured-list"), className, _defineProperty({}, "".concat(prefix, "--structured-list--selection"), selection));
36
+ var classes = cx("".concat(prefix, "--structured-list"), className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--structured-list--selection"), selection), _defineProperty(_classNames, "".concat(prefix, "--structured-list--condensed"), isCondensed), _defineProperty(_classNames, "".concat(prefix, "--structured-list--flush"), isFlush), _classNames));
33
37
 
34
38
  var _React$useState = React__default.useState(null),
35
39
  _React$useState2 = _slicedToArray(_React$useState, 2),
@@ -41,7 +45,7 @@ function StructuredListWrapper(props) {
41
45
  }, /*#__PURE__*/React__default.createElement(GridSelectedRowDispatchContext.Provider, {
42
46
  value: setSelectedRow
43
47
  }, /*#__PURE__*/React__default.createElement("div", _extends({
44
- role: "grid",
48
+ role: "table",
45
49
  className: classes
46
50
  }, other, {
47
51
  "aria-label": ariaLabel
@@ -63,6 +67,16 @@ StructuredListWrapper.propTypes = {
63
67
  */
64
68
  className: PropTypes.string,
65
69
 
70
+ /**
71
+ * Specify if structured list is condensed, default is false
72
+ */
73
+ isCondensed: PropTypes.bool,
74
+
75
+ /**
76
+ * Specify if structured list is flush, default is false
77
+ */
78
+ isFlush: PropTypes.bool,
79
+
66
80
  /**
67
81
  * Specify whether your StructuredListWrapper should have selections
68
82
  */
@@ -70,6 +84,8 @@ StructuredListWrapper.propTypes = {
70
84
  };
71
85
  StructuredListWrapper.defaultProps = {
72
86
  selection: false,
87
+ isCondensed: false,
88
+ isFlush: false,
73
89
  ariaLabel: 'Structured list section'
74
90
  };
75
91
  function StructuredListHead(props) {
@@ -22,7 +22,8 @@ function useTabbableContent(ref) {
22
22
  var _useState = useState(false),
23
23
  _useState2 = _slicedToArray(_useState, 2),
24
24
  hasTabbableContent = _useState2[0],
25
- setHasTabbableContent = _useState2[1];
25
+ setHasTabbableContent = _useState2[1]; // eslint-disable-next-line react-hooks/exhaustive-deps
26
+
26
27
 
27
28
  useIsomorphicEffect(function () {
28
29
  if (ref.current) {