@carbon/react 1.35.0 → 1.36.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 (73) hide show
  1. package/es/components/ComboBox/ComboBox.js +1 -2
  2. package/es/components/ComboBox/index.d.ts +9 -0
  3. package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +4 -0
  4. package/es/components/DatePicker/DatePicker.Skeleton.d.ts +9 -1
  5. package/es/components/DatePicker/DatePicker.Skeleton.js +7 -5
  6. package/es/components/DatePicker/DatePicker.js +1 -0
  7. package/es/components/DatePickerInput/DatePickerInput.js +1 -2
  8. package/es/components/DatePickerInput/index.d.ts +9 -0
  9. package/es/components/ExpandableSearch/index.d.ts +9 -0
  10. package/es/components/FileUploader/index.d.ts +14 -0
  11. package/es/components/FormGroup/FormGroup.js +1 -2
  12. package/es/components/FormGroup/index.d.ts +9 -0
  13. package/es/components/Loading/index.d.ts +9 -0
  14. package/es/components/NumberInput/index.d.ts +8 -0
  15. package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -2
  16. package/es/components/OverflowMenuItem/index.d.ts +9 -0
  17. package/es/components/RadioButton/RadioButton.js +1 -2
  18. package/es/components/RadioButton/index.d.ts +9 -0
  19. package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -2
  20. package/es/components/RadioButtonGroup/index.d.ts +9 -0
  21. package/es/components/Search/Search.js +2 -2
  22. package/es/components/Select/Select.Skeleton.js +1 -2
  23. package/es/components/Select/Select.js +1 -2
  24. package/es/components/Select/index.d.ts +10 -0
  25. package/es/components/SelectItem/SelectItem.js +1 -2
  26. package/es/components/SelectItem/index.d.ts +9 -0
  27. package/es/components/SelectItemGroup/SelectItemGroup.js +1 -2
  28. package/es/components/SelectItemGroup/index.d.ts +9 -0
  29. package/es/components/StructuredList/StructuredList.js +10 -2
  30. package/es/components/TimePicker/TimePicker.js +1 -2
  31. package/es/components/TimePicker/index.d.ts +9 -0
  32. package/es/components/TimePickerSelect/TimePickerSelect.js +1 -2
  33. package/es/components/TimePickerSelect/index.d.ts +9 -0
  34. package/es/components/UIShell/HeaderPanel.js +2 -2
  35. package/es/index.js +22 -22
  36. package/es/types/common.d.ts +1 -1
  37. package/lib/components/ComboBox/ComboBox.js +1 -2
  38. package/lib/components/ComboBox/index.d.ts +9 -0
  39. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +4 -0
  40. package/lib/components/DatePicker/DatePicker.Skeleton.d.ts +9 -1
  41. package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -5
  42. package/lib/components/DatePicker/DatePicker.js +1 -0
  43. package/lib/components/DatePickerInput/DatePickerInput.js +1 -2
  44. package/lib/components/DatePickerInput/index.d.ts +9 -0
  45. package/lib/components/ExpandableSearch/index.d.ts +9 -0
  46. package/lib/components/FileUploader/index.d.ts +14 -0
  47. package/lib/components/FormGroup/FormGroup.js +1 -2
  48. package/lib/components/FormGroup/index.d.ts +9 -0
  49. package/lib/components/Loading/index.d.ts +9 -0
  50. package/lib/components/NumberInput/index.d.ts +8 -0
  51. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -2
  52. package/lib/components/OverflowMenuItem/index.d.ts +9 -0
  53. package/lib/components/RadioButton/RadioButton.js +1 -2
  54. package/lib/components/RadioButton/index.d.ts +9 -0
  55. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -2
  56. package/lib/components/RadioButtonGroup/index.d.ts +9 -0
  57. package/lib/components/Search/Search.js +2 -2
  58. package/lib/components/Select/Select.Skeleton.js +1 -2
  59. package/lib/components/Select/Select.js +1 -2
  60. package/lib/components/Select/index.d.ts +10 -0
  61. package/lib/components/SelectItem/SelectItem.js +1 -2
  62. package/lib/components/SelectItem/index.d.ts +9 -0
  63. package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -2
  64. package/lib/components/SelectItemGroup/index.d.ts +9 -0
  65. package/lib/components/StructuredList/StructuredList.js +10 -2
  66. package/lib/components/TimePicker/TimePicker.js +1 -2
  67. package/lib/components/TimePicker/index.d.ts +9 -0
  68. package/lib/components/TimePickerSelect/TimePickerSelect.js +1 -2
  69. package/lib/components/TimePickerSelect/index.d.ts +9 -0
  70. package/lib/components/UIShell/HeaderPanel.js +2 -2
  71. package/lib/index.js +44 -44
  72. package/lib/types/common.d.ts +1 -1
  73. package/package.json +6 -6
@@ -25,18 +25,16 @@ const DatePickerSkeleton = _ref => {
25
25
  let {
26
26
  range,
27
27
  id,
28
+ hideLabel,
28
29
  className,
29
30
  ...rest
30
31
  } = _ref;
31
32
  const prefix = usePrefix.usePrefix();
32
33
  const dateInput = /*#__PURE__*/React__default["default"].createElement("div", {
33
34
  className: `${prefix}--date-picker-container`
34
- },
35
- /*#__PURE__*/
36
- /* eslint-disable jsx-a11y/label-has-for,jsx-a11y/label-has-associated-control */
37
- React__default["default"].createElement("label", {
35
+ }, !hideLabel && /*#__PURE__*/React__default["default"].createElement("span", {
38
36
  className: `${prefix}--label`,
39
- htmlFor: id
37
+ id: id
40
38
  }), /*#__PURE__*/React__default["default"].createElement("div", {
41
39
  className: `${prefix}--date-picker__input ${prefix}--skeleton`
42
40
  }));
@@ -58,6 +56,10 @@ DatePickerSkeleton.propTypes = {
58
56
  * Specify an optional className to add.
59
57
  */
60
58
  className: PropTypes__default["default"].string,
59
+ /**
60
+ * Specify whether the label should be hidden, or not
61
+ */
62
+ hideLabel: PropTypes__default["default"].bool,
61
63
  /**
62
64
  * Specify the id to add.
63
65
  */
@@ -135,6 +135,7 @@ function updateClassNames(calendar, prefix) {
135
135
  });
136
136
  forEach.call(daysContainer.querySelectorAll('.flatpickr-day'), item => {
137
137
  item.classList.add(`${prefix}--date-picker__day`);
138
+ item.setAttribute('role', 'button');
138
139
  if (item.classList.contains('today') && calendar.selectedDates.length > 0) {
139
140
  item.classList.add('no-border');
140
141
  } else if (item.classList.contains('today') && calendar.selectedDates.length === 0) {
@@ -261,6 +261,5 @@ DatePickerIcon.propTypes = {
261
261
  */
262
262
  warn: PropTypes__default["default"].bool
263
263
  };
264
- var DatePickerInput$1 = DatePickerInput;
265
264
 
266
- exports["default"] = DatePickerInput$1;
265
+ exports["default"] = DatePickerInput;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import DatePickerInput from './DatePickerInput';
8
+ export default DatePickerInput;
9
+ export { DatePickerInput };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021
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
+ import ExpandableSearch from './ExpandableSearch';
8
+ export default ExpandableSearch;
9
+ export { ExpandableSearch };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import FileUploader from './FileUploader';
8
+ export default FileUploader;
9
+ export { FileUploader };
10
+ export { default as Filename } from './Filename';
11
+ export { default as FileUploaderSkeleton } from './FileUploader.Skeleton';
12
+ export { default as FileUploaderButton } from './FileUploaderButton';
13
+ export { default as FileUploaderDropContainer } from './FileUploaderDropContainer';
14
+ export { default as FileUploaderItem } from './FileUploaderItem';
@@ -83,6 +83,5 @@ FormGroup.defaultProps = {
83
83
  message: false,
84
84
  messageText: ''
85
85
  };
86
- var FormGroup$1 = FormGroup;
87
86
 
88
- exports["default"] = FormGroup$1;
87
+ exports["default"] = FormGroup;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import FormGroup from './FormGroup';
8
+ export default FormGroup;
9
+ export { FormGroup };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import Loading from './Loading';
8
+ export default Loading;
9
+ export { Loading };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ export { default as NumberInputSkeleton } from './NumberInput.Skeleton';
8
+ export { NumberInput } from './NumberInput';
@@ -163,6 +163,5 @@ OverflowMenuItem.propTypes = {
163
163
  */
164
164
  wrapperClassName: PropTypes__default["default"].string
165
165
  };
166
- var OverflowMenuItem$1 = OverflowMenuItem;
167
166
 
168
- exports["default"] = OverflowMenuItem$1;
167
+ exports["default"] = OverflowMenuItem;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import OverflowMenuItem from './OverflowMenuItem';
8
+ export default OverflowMenuItem;
9
+ export { OverflowMenuItem };
@@ -125,6 +125,5 @@ RadioButton.propTypes = {
125
125
  */
126
126
  value: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number])
127
127
  };
128
- var RadioButton$1 = RadioButton;
129
128
 
130
- exports["default"] = RadioButton$1;
129
+ exports["default"] = RadioButton;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import RadioButton from './RadioButton';
8
+ export default RadioButton;
9
+ export { RadioButton };
@@ -200,6 +200,5 @@ RadioButtonGroup.propTypes = {
200
200
  warnText: PropTypes__default["default"].node
201
201
  };
202
202
  RadioButtonGroup.displayName = 'RadioButtonGroup';
203
- var RadioButtonGroup$1 = RadioButtonGroup;
204
203
 
205
- exports["default"] = RadioButtonGroup$1;
204
+ exports["default"] = RadioButtonGroup;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import RadioButtonGroup from './RadioButtonGroup';
8
+ export default RadioButtonGroup;
9
+ export { RadioButtonGroup };
@@ -145,7 +145,7 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
145
145
  id: searchId,
146
146
  htmlFor: uniqueId,
147
147
  className: `${prefix}--label`
148
- }, labelText), /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({}, rest, {
148
+ }, labelText), /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({
149
149
  autoComplete: autoComplete,
150
150
  className: `${prefix}--search-input`,
151
151
  defaultValue: defaultValue,
@@ -159,7 +159,7 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
159
159
  type: type,
160
160
  value: value,
161
161
  tabIndex: onExpand && !isExpanded ? -1 : undefined
162
- })), /*#__PURE__*/React__default["default"].createElement("button", {
162
+ }, rest)), /*#__PURE__*/React__default["default"].createElement("button", {
163
163
  "aria-label": closeButtonLabelText,
164
164
  className: clearClasses,
165
165
  disabled: disabled,
@@ -48,7 +48,6 @@ SelectSkeleton.propTypes = {
48
48
  */
49
49
  hideLabel: PropTypes__default["default"].bool
50
50
  };
51
- var SelectSkeleton$1 = SelectSkeleton;
52
51
 
53
52
  exports.SelectSkeleton = SelectSkeleton;
54
- exports["default"] = SelectSkeleton$1;
53
+ exports["default"] = SelectSkeleton;
@@ -256,6 +256,5 @@ Select.defaultProps = {
256
256
  invalidText: '',
257
257
  helperText: ''
258
258
  };
259
- var Select$1 = Select;
260
259
 
261
- exports["default"] = Select$1;
260
+ exports["default"] = Select;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import Select from './Select';
8
+ export { default as SelectSkeleton } from './Select.Skeleton';
9
+ export default Select;
10
+ export { Select };
@@ -72,6 +72,5 @@ SelectItem.defaultProps = {
72
72
  value: '',
73
73
  text: ''
74
74
  };
75
- var SelectItem$1 = SelectItem;
76
75
 
77
- exports["default"] = SelectItem$1;
76
+ exports["default"] = SelectItem;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import SelectItem from './SelectItem';
8
+ export default SelectItem;
9
+ export { SelectItem };
@@ -58,6 +58,5 @@ SelectItemGroup.propTypes = {
58
58
  SelectItemGroup.defaultProps = {
59
59
  disabled: false
60
60
  };
61
- var SelectItemGroup$1 = SelectItemGroup;
62
61
 
63
- exports["default"] = SelectItemGroup$1;
62
+ exports["default"] = SelectItemGroup;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import SelectItemGroup from './SelectItemGroup';
8
+ export default SelectItemGroup;
9
+ export { SelectItemGroup };
@@ -152,6 +152,7 @@ function StructuredListRow(props) {
152
152
  children,
153
153
  className,
154
154
  head,
155
+ onClick,
155
156
  ...other
156
157
  } = props;
157
158
  const [hasFocusWithin, setHasFocusWithin] = React.useState(false);
@@ -177,7 +178,10 @@ function StructuredListRow(props) {
177
178
  React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, other, {
178
179
  role: "row",
179
180
  className: classes,
180
- onClick: () => setSelectedRow(id),
181
+ onClick: () => {
182
+ setSelectedRow(id);
183
+ onClick && onClick();
184
+ },
181
185
  onFocus: () => {
182
186
  setHasFocusWithin(true);
183
187
  },
@@ -206,6 +210,10 @@ StructuredListRow.propTypes = {
206
210
  * Specify whether a `<label>` should be used
207
211
  */
208
212
  label: deprecate["default"](PropTypes__default["default"].bool, `\nThe \`label\` prop is no longer needed and will be removed in the next major version of Carbon.`),
213
+ /**
214
+ * Provide a handler that is invoked on the click,
215
+ */
216
+ onClick: PropTypes__default["default"].func,
209
217
  /**
210
218
  * Provide a handler that is invoked on the key down event for the control,
211
219
  */
@@ -237,7 +245,7 @@ function StructuredListInput(props) {
237
245
  value: row?.id ?? '',
238
246
  onChange: event => {
239
247
  setSelectedRow(event.target.value);
240
- onChange(event);
248
+ onChange && onChange(event);
241
249
  },
242
250
  id: id ?? defaultId,
243
251
  className: classes,
@@ -254,6 +254,5 @@ TimePicker.propTypes = {
254
254
  */
255
255
  warningText: PropTypes__default["default"].node
256
256
  };
257
- var TimePicker$1 = TimePicker;
258
257
 
259
- exports["default"] = TimePicker$1;
258
+ exports["default"] = TimePicker;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import TimePicker from './TimePicker';
8
+ export default TimePicker;
9
+ export { TimePicker };
@@ -74,6 +74,5 @@ TimePickerSelect.propTypes = {
74
74
  */
75
75
  id: PropTypes__default["default"].string.isRequired
76
76
  };
77
- var TimePickerSelect$1 = TimePickerSelect;
78
77
 
79
- exports["default"] = TimePickerSelect$1;
78
+ exports["default"] = TimePickerSelect;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+ import { default as TimePickerSelect } from './TimePickerSelect';
8
+ export default TimePickerSelect;
9
+ export { TimePickerSelect };
@@ -25,13 +25,14 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
25
25
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
26
26
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
27
27
 
28
+ const noopFn = () => {};
28
29
  const HeaderPanel = /*#__PURE__*/React__default["default"].forwardRef(function HeaderPanel(_ref, ref) {
29
30
  let {
30
31
  children,
31
32
  className: customClassName,
32
33
  expanded,
33
34
  addFocusListeners = true,
34
- onHeaderPanelFocus,
35
+ onHeaderPanelFocus = noopFn,
35
36
  href,
36
37
  ...other
37
38
  } = _ref;
@@ -105,7 +106,6 @@ HeaderPanel.propTypes = {
105
106
  /**
106
107
  * An optional listener that is called a callback to collapse the HeaderPanel
107
108
  */
108
-
109
109
  onHeaderPanelFocus: PropTypes__default["default"].func
110
110
  };
111
111
  HeaderPanel.displayName = 'HeaderPanel';