@carbon/react 1.53.0 → 1.54.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 (92) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1016 -1062
  2. package/es/components/AiSkeleton/AiSkeletonIcon.js +39 -0
  3. package/es/components/AiSkeleton/AiSkeletonPlaceholder.js +37 -0
  4. package/es/components/AiSkeleton/AiSkeletonText.js +51 -0
  5. package/es/components/ComboBox/ComboBox.js +13 -4
  6. package/es/components/ComboButton/index.js +1 -1
  7. package/es/components/ComposedModal/ComposedModal.js +19 -10
  8. package/es/components/DataTable/DataTable.js +1 -1
  9. package/es/components/DataTable/TableBatchAction.d.ts +1 -1
  10. package/es/components/DataTable/TableToolbarMenu.d.ts +5 -1
  11. package/es/components/DataTable/TableToolbarMenu.js +7 -0
  12. package/es/components/DatePicker/DatePicker.d.ts +4 -0
  13. package/es/components/DatePicker/DatePicker.js +37 -0
  14. package/es/components/IconButton/index.d.ts +1 -1
  15. package/es/components/IconButton/index.js +1 -1
  16. package/es/components/ListBox/ListBox.d.ts +8 -0
  17. package/es/components/ListBox/ListBox.js +15 -3
  18. package/es/components/Loading/Loading.d.ts +1 -1
  19. package/es/components/Modal/Modal.js +14 -5
  20. package/es/components/Notification/Notification.js +18 -6
  21. package/es/components/Pagination/Pagination.Skeleton.d.ts +25 -0
  22. package/es/components/Pagination/Pagination.d.ts +102 -0
  23. package/es/components/Pagination/Pagination.js +13 -14
  24. package/es/components/Pagination/index.d.ts +10 -0
  25. package/es/components/Popover/index.d.ts +1 -1
  26. package/es/components/Popover/index.js +175 -108
  27. package/es/components/RadioTile/RadioTile.d.ts +55 -0
  28. package/es/components/RadioTile/RadioTile.js +17 -17
  29. package/es/components/RadioTile/index.d.ts +10 -0
  30. package/es/components/Slug/index.js +24 -13
  31. package/es/components/Stack/HStack.d.ts +10 -0
  32. package/es/components/Stack/HStack.js +23 -0
  33. package/es/components/Stack/Stack.d.ts +1 -1
  34. package/es/components/Stack/Stack.js +2 -2
  35. package/es/components/Stack/VStack.d.ts +10 -0
  36. package/es/components/Stack/{index.js → VStack.js} +1 -8
  37. package/es/components/Stack/index.d.ts +3 -6
  38. package/es/components/TileGroup/TileGroup.js +30 -24
  39. package/es/components/Toggletip/index.d.ts +1 -18
  40. package/es/components/Toggletip/index.js +27 -4
  41. package/es/components/Tooltip/Tooltip.js +23 -5
  42. package/es/index.d.ts +2 -0
  43. package/es/index.js +8 -4
  44. package/es/internal/FloatingMenu.js +26 -5
  45. package/es/internal/wrapFocus.js +51 -1
  46. package/es/tools/createPropAdapter.js +40 -0
  47. package/lib/components/AiSkeleton/AiSkeletonIcon.js +49 -0
  48. package/lib/components/AiSkeleton/AiSkeletonPlaceholder.js +47 -0
  49. package/lib/components/AiSkeleton/AiSkeletonText.js +61 -0
  50. package/lib/components/ComboBox/ComboBox.js +13 -4
  51. package/lib/components/ComboButton/index.js +1 -1
  52. package/lib/components/ComposedModal/ComposedModal.js +17 -8
  53. package/lib/components/DataTable/DataTable.js +1 -1
  54. package/lib/components/DataTable/TableBatchAction.d.ts +1 -1
  55. package/lib/components/DataTable/TableToolbarMenu.d.ts +5 -1
  56. package/lib/components/DataTable/TableToolbarMenu.js +7 -0
  57. package/lib/components/DatePicker/DatePicker.d.ts +4 -0
  58. package/lib/components/DatePicker/DatePicker.js +37 -0
  59. package/lib/components/IconButton/index.d.ts +1 -1
  60. package/lib/components/IconButton/index.js +1 -1
  61. package/lib/components/ListBox/ListBox.d.ts +8 -0
  62. package/lib/components/ListBox/ListBox.js +15 -3
  63. package/lib/components/Loading/Loading.d.ts +1 -1
  64. package/lib/components/Modal/Modal.js +14 -5
  65. package/lib/components/Notification/Notification.js +15 -3
  66. package/lib/components/Pagination/Pagination.Skeleton.d.ts +25 -0
  67. package/lib/components/Pagination/Pagination.d.ts +102 -0
  68. package/lib/components/Pagination/Pagination.js +13 -14
  69. package/lib/components/Pagination/index.d.ts +10 -0
  70. package/lib/components/Popover/index.d.ts +1 -1
  71. package/lib/components/Popover/index.js +174 -107
  72. package/lib/components/RadioTile/RadioTile.d.ts +55 -0
  73. package/lib/components/RadioTile/RadioTile.js +17 -17
  74. package/lib/components/RadioTile/index.d.ts +10 -0
  75. package/lib/components/Slug/index.js +24 -13
  76. package/lib/components/Stack/HStack.d.ts +10 -0
  77. package/lib/components/Stack/HStack.js +31 -0
  78. package/lib/components/Stack/Stack.d.ts +1 -1
  79. package/lib/components/Stack/Stack.js +3 -3
  80. package/lib/components/Stack/VStack.d.ts +10 -0
  81. package/lib/components/Stack/{index.js → VStack.js} +0 -8
  82. package/lib/components/Stack/index.d.ts +3 -6
  83. package/lib/components/TileGroup/TileGroup.js +30 -24
  84. package/lib/components/Toggletip/index.d.ts +1 -18
  85. package/lib/components/Toggletip/index.js +27 -4
  86. package/lib/components/Tooltip/Tooltip.js +23 -5
  87. package/lib/index.d.ts +2 -0
  88. package/lib/index.js +21 -14
  89. package/lib/internal/FloatingMenu.js +44 -4
  90. package/lib/internal/wrapFocus.js +51 -0
  91. package/lib/tools/createPropAdapter.js +44 -0
  92. package/package.json +9 -7
@@ -6,7 +6,9 @@
6
6
  */
7
7
 
8
8
  import findLast from 'lodash.findlast';
9
+ import { useEffect } from 'react';
9
10
  import { DOCUMENT_POSITION_BROAD_PRECEDING, selectorTabbable, DOCUMENT_POSITION_BROAD_FOLLOWING } from './keyboard/navigation.js';
11
+ import { tabbable } from 'tabbable';
10
12
 
11
13
  /**
12
14
  * @param {Node} node A DOM node.
@@ -60,4 +62,52 @@ function wrapFocus(_ref) {
60
62
  }
61
63
  }
62
64
 
63
- export { wrapFocus as default, elementOrParentIsFloatingMenu };
65
+ /**
66
+ * Ensures the focus is kept in the given `containerNode`, implementing "focus-wrap" behavior.
67
+ * Note: This must be called *before* focus moves using onKeyDown or similar.
68
+ * @param {object} options The options.
69
+ * @param {Node|null} options.containerNode
70
+ * @param {EventTarget} options.currentActiveNode The DOM node that has focus.
71
+ * @param {KeyboardEvent} options.event The DOM event
72
+ */
73
+ function wrapFocusWithoutSentinels(_ref2) {
74
+ let {
75
+ containerNode,
76
+ currentActiveNode,
77
+ event
78
+ } = _ref2;
79
+ if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== "production") {
80
+ // eslint-disable-next-line react-hooks/rules-of-hooks
81
+ useEffect(() => {
82
+ throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
83
+ });
84
+ }
85
+
86
+ // The reason we're using tabbable is because it returns the tabbable
87
+ // items *in tab order*, whereas using our `selectorTabbable` only
88
+ // returns in DOM order
89
+ const tabbables = tabbable(containerNode);
90
+ const firstTabbable = tabbables[0];
91
+ const lastTabbable = tabbables[tabbables.length - 1];
92
+
93
+ // console.log(`---------------------------------`);
94
+ // console.log(containerNode);
95
+ // console.log(tabbables);
96
+ // console.log(firstTabbable);
97
+ // console.log(lastTabbable);
98
+ // console.log(currentActiveNode);
99
+
100
+ // The shift key is used to determine if focus is moving forwards or backwards
101
+ if (currentActiveNode === lastTabbable && !event.shiftKey) {
102
+ // Cancel the current movement of focus because we're going to place it ourselves
103
+ event.preventDefault();
104
+ firstTabbable.focus();
105
+ }
106
+ if (currentActiveNode === firstTabbable && event.shiftKey) {
107
+ // Cancel the current movement of focus because we're going to place it ourselves
108
+ event.preventDefault();
109
+ lastTabbable.focus();
110
+ }
111
+ }
112
+
113
+ export { wrapFocus as default, elementOrParentIsFloatingMenu, wrapFocusWithoutSentinels };
@@ -0,0 +1,40 @@
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
+
8
+ /**
9
+ * Create an adapter that converts an object of props with potentially deprecated
10
+ * prop names to the replacement prop names in a newer version. Useful for guarding
11
+ * against breaking changes when a prop has been renamed
12
+ *
13
+ * @param {Array} spec - an array of options which specify a text or regex
14
+ * matcher alongside a replacement if there is a match
15
+ * @returns {Function}
16
+ */
17
+ function mapPopoverAlignProp(align) {
18
+ switch (align) {
19
+ case 'top-left':
20
+ return 'top-start';
21
+ case 'top-right':
22
+ return 'top-end';
23
+ case 'bottom-left':
24
+ return 'bottom-start';
25
+ case 'bottom-right':
26
+ return 'bottom-end';
27
+ case 'left-bottom':
28
+ return 'left-end';
29
+ case 'left-top':
30
+ return 'left-start';
31
+ case 'right-bottom':
32
+ return 'right-end';
33
+ case 'right-top':
34
+ return 'right-start';
35
+ default:
36
+ return align;
37
+ }
38
+ }
39
+
40
+ export { mapPopoverAlignProp };
@@ -0,0 +1,49 @@
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var PropTypes = require('prop-types');
14
+ var React = require('react');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonIcon = require('../SkeletonIcon/SkeletonIcon.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonIcon = _ref => {
26
+ let {
27
+ className,
28
+ ...rest
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const AiSkeletonIconClasses = cx__default["default"](className, {
32
+ [`${prefix}--skeleton__icon--ai`]: true
33
+ });
34
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonIcon["default"], _rollupPluginBabelHelpers["extends"]({
35
+ className: AiSkeletonIconClasses
36
+ }, rest));
37
+ };
38
+ AiSkeletonIcon.propTypes = {
39
+ /**
40
+ * Specify an optional className to add.
41
+ */
42
+ className: PropTypes__default["default"].string,
43
+ /**
44
+ * The CSS styles.
45
+ */
46
+ style: PropTypes__default["default"].object
47
+ };
48
+
49
+ exports["default"] = AiSkeletonIcon;
@@ -0,0 +1,47 @@
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+ var PropTypes = require('prop-types');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonPlaceholder = require('../SkeletonPlaceholder/SkeletonPlaceholder.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonPlaceholder = _ref => {
26
+ let {
27
+ className,
28
+ ...other
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const AiSkeletonPlaceholderClasses = cx__default["default"]({
32
+ className,
33
+ [`${prefix}--skeleton__placeholder--ai`]: true
34
+ }, className);
35
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonPlaceholder["default"], _rollupPluginBabelHelpers["extends"]({
36
+ className: AiSkeletonPlaceholderClasses
37
+ }, other));
38
+ };
39
+ AiSkeletonPlaceholder.propTypes = {
40
+ /**
41
+ * Add a custom class to the component
42
+ * to set the height and width
43
+ */
44
+ className: PropTypes__default["default"].string
45
+ };
46
+
47
+ exports["default"] = AiSkeletonPlaceholder;
@@ -0,0 +1,61 @@
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
+ var PropTypes = require('prop-types');
14
+ var React = require('react');
15
+ var cx = require('classnames');
16
+ var usePrefix = require('../../internal/usePrefix.js');
17
+ var SkeletonText = require('../SkeletonText/SkeletonText.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
+ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
+
25
+ const AiSkeletonText = _ref => {
26
+ let {
27
+ className,
28
+ ...rest
29
+ } = _ref;
30
+ const prefix = usePrefix.usePrefix();
31
+ const aiSkeletonTextClasses = cx__default["default"](className, {
32
+ [`${prefix}--skeleton__text--ai`]: true
33
+ });
34
+ return /*#__PURE__*/React__default["default"].createElement(SkeletonText["default"], _rollupPluginBabelHelpers["extends"]({
35
+ className: aiSkeletonTextClasses
36
+ }, rest));
37
+ };
38
+ AiSkeletonText.propTypes = {
39
+ /**
40
+ * Specify an optional className to be applied to the container node
41
+ */
42
+ className: PropTypes__default["default"].string,
43
+ /**
44
+ * generates skeleton text at a larger size
45
+ */
46
+ heading: PropTypes__default["default"].bool,
47
+ /**
48
+ * the number of lines shown if paragraph is true
49
+ */
50
+ lineCount: PropTypes__default["default"].number,
51
+ /**
52
+ * will generate multiple lines of text
53
+ */
54
+ paragraph: PropTypes__default["default"].bool,
55
+ /**
56
+ * width (in px or %) of single line of text or max-width of paragraph lines
57
+ */
58
+ width: PropTypes__default["default"].string
59
+ };
60
+
61
+ exports["default"] = AiSkeletonText;
@@ -249,7 +249,9 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
249
249
  const titleClasses = cx__default["default"](`${prefix}--label`, {
250
250
  [`${prefix}--label--disabled`]: disabled
251
251
  });
252
- const comboBoxHelperId = !helperText ? undefined : `combobox-helper-text-${comboBoxInstanceId}`;
252
+ const helperTextId = `combobox-helper-text-${comboBoxInstanceId}`;
253
+ const warnTextId = `combobox-warn-text-${comboBoxInstanceId}`;
254
+ const invalidTextId = `combobox-invalid-text-${comboBoxInstanceId}`;
253
255
  const helperClasses = cx__default["default"](`${prefix}--form__helper-text`, {
254
256
  [`${prefix}--form__helper-text--disabled`]: disabled
255
257
  });
@@ -387,6 +389,11 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
387
389
  }
388
390
  }
389
391
  } : {};
392
+
393
+ // The input should be described by the appropriate message text id
394
+ // when both the message is supplied *and* when the component is in
395
+ // the matching state (invalid, warn, etc).
396
+ const ariaDescribedBy = invalid && invalidText && invalidTextId || warn && warnText && warnTextId || helperText && !isFluid && helperTextId || undefined;
390
397
  return /*#__PURE__*/React__default["default"].createElement("div", {
391
398
  className: wrapperClasses
392
399
  }, titleText && /*#__PURE__*/React__default["default"].createElement(Text.Text, _rollupPluginBabelHelpers["extends"]({
@@ -399,11 +406,13 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
399
406
  disabled: disabled,
400
407
  invalid: invalid,
401
408
  invalidText: invalidText,
409
+ invalidTextId: invalidTextId,
402
410
  isOpen: isOpen,
403
411
  light: light,
404
412
  size: size,
405
413
  warn: warn,
406
- warnText: warnText
414
+ warnText: warnText,
415
+ warnTextId: warnTextId
407
416
  }, /*#__PURE__*/React__default["default"].createElement("div", {
408
417
  className: `${prefix}--list-box__field`
409
418
  }, /*#__PURE__*/React__default["default"].createElement("input", _rollupPluginBabelHelpers["extends"]({
@@ -421,7 +430,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
421
430
  }, inputProps, rest, readOnlyEventHandlers, {
422
431
  readOnly: readOnly,
423
432
  ref: mergeRefs["default"](textInput, ref),
424
- "aria-describedby": helperText && !invalid && !warn && !isFluid ? comboBoxHelperId : undefined
433
+ "aria-describedby": ariaDescribedBy
425
434
  })), invalid && /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningFilled, {
426
435
  className: `${prefix}--list-box__invalid-icon`
427
436
  }), showWarning && /*#__PURE__*/React__default["default"].createElement(iconsReact.WarningAltFilled, {
@@ -460,7 +469,7 @@ const ComboBox = /*#__PURE__*/React.forwardRef((props, ref) => {
460
469
  }));
461
470
  }) : null)), helperText && !invalid && !warn && !isFluid && (_Text || (_Text = /*#__PURE__*/React__default["default"].createElement(Text.Text, {
462
471
  as: "div",
463
- id: comboBoxHelperId,
472
+ id: helperTextId,
464
473
  className: helperClasses
465
474
  }, helperText))));
466
475
  });
@@ -162,7 +162,7 @@ ComboButton.propTypes = {
162
162
  /**
163
163
  * Specify how the trigger tooltip should be aligned.
164
164
  */
165
- tooltipAlignment: PropTypes__default["default"].oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
165
+ tooltipAlignment: PropTypes__default["default"].oneOf(['top', 'top-left', 'top-start', 'top-right', 'top-end', 'bottom', 'bottom-left', 'bottom-start', 'bottom-right', 'bottom-end', 'left', 'right']),
166
166
  /**
167
167
  * Optional method that takes in a message id and returns an
168
168
  * internationalized string.
@@ -23,6 +23,7 @@ var toggleClass = require('../../tools/toggleClass.js');
23
23
  var requiredIfGivenPropIsTruthy = require('../../prop-types/requiredIfGivenPropIsTruthy.js');
24
24
  var wrapFocus = require('../../internal/wrapFocus.js');
25
25
  var usePrefix = require('../../internal/usePrefix.js');
26
+ var index = require('../FeatureFlags/index.js');
26
27
  var match = require('../../internal/keyboard/match.js');
27
28
  var keys = require('../../internal/keyboard/keys.js');
28
29
 
@@ -125,6 +126,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
125
126
  const button = React.useRef(null);
126
127
  const startSentinel = React.useRef(null);
127
128
  const endSentinel = React.useRef(null);
129
+ const focusTrapWithoutSentinels = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
128
130
 
129
131
  // Keep track of modal open/close state
130
132
  // and propagate it to the document.body
@@ -142,12 +144,19 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
142
144
  };
143
145
  }, []); // eslint-disable-line react-hooks/exhaustive-deps
144
146
 
145
- function handleKeyDown(evt) {
146
- evt.stopPropagation();
147
- if (match.match(evt, keys.Escape)) {
148
- closeModal(evt);
147
+ function handleKeyDown(event) {
148
+ event.stopPropagation();
149
+ if (match.match(event, keys.Escape)) {
150
+ closeModal(event);
151
+ }
152
+ if (focusTrapWithoutSentinels && open && match.match(event, keys.Tab) && innerModal.current) {
153
+ wrapFocus.wrapFocusWithoutSentinels({
154
+ containerNode: innerModal.current,
155
+ currentActiveNode: event.target,
156
+ event: event
157
+ });
149
158
  }
150
- onKeyDown?.(evt);
159
+ onKeyDown?.(event);
151
160
  }
152
161
  function handleMousedown(evt) {
153
162
  evt.stopPropagation();
@@ -255,7 +264,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
255
264
  role: "presentation",
256
265
  ref: ref,
257
266
  "aria-hidden": !open,
258
- onBlur: handleBlur,
267
+ onBlur: !focusTrapWithoutSentinels ? handleBlur : () => {},
259
268
  onMouseDown: handleMousedown,
260
269
  onKeyDown: handleKeyDown,
261
270
  className: modalClass
@@ -265,14 +274,14 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
265
274
  "aria-modal": "true",
266
275
  "aria-label": ariaLabel ? ariaLabel : generatedAriaLabel,
267
276
  "aria-labelledby": ariaLabelledBy
268
- }, /*#__PURE__*/React__default["default"].createElement("button", {
277
+ }, !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("button", {
269
278
  type: "button",
270
279
  ref: startSentinel,
271
280
  className: `${prefix}--visually-hidden`
272
281
  }, "Focus sentinel"), /*#__PURE__*/React__default["default"].createElement("div", {
273
282
  ref: innerModal,
274
283
  className: `${prefix}--modal-container-body`
275
- }, normalizedSlug, childrenWithProps), /*#__PURE__*/React__default["default"].createElement("button", {
284
+ }, normalizedSlug, childrenWithProps), !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("button", {
276
285
  type: "button",
277
286
  ref: endSentinel,
278
287
  className: `${prefix}--visually-hidden`
@@ -324,7 +324,7 @@ class DataTable extends React__default["default"].Component {
324
324
  isSortable,
325
325
  useStaticWidth,
326
326
  stickyHeader,
327
- overflowMenuOnHover = true,
327
+ overflowMenuOnHover = false,
328
328
  experimentalAutoAlign
329
329
  } = this.props;
330
330
  return {
@@ -24,7 +24,7 @@ export interface TableBatchActionProps extends React.ButtonHTMLAttributes<HTMLBu
24
24
  declare const TableBatchAction: {
25
25
  ({ renderIcon, iconDescription, ...props }: {
26
26
  [x: string]: any;
27
- renderIcon?: import("@carbon/icons-react/lib/CarbonIcon").CarbonIconType | undefined;
27
+ renderIcon?: import("@carbon/icons-react").CarbonIconType | undefined;
28
28
  iconDescription?: string | undefined;
29
29
  }): import("react/jsx-runtime").JSX.Element;
30
30
  propTypes: {
@@ -8,13 +8,17 @@ import React from 'react';
8
8
  export interface TableToolbarMenuProps extends React.HTMLAttributes<HTMLDivElement> {
9
9
  children: React.ReactNode;
10
10
  /**
11
- * Provide an optional class name for the toolbar menu
11
+ * Provide an optional class name for the toolbar menu trigger button
12
12
  */
13
13
  className?: string;
14
14
  /**
15
15
  * The description of the menu icon.
16
16
  */
17
17
  iconDescription?: string;
18
+ /**
19
+ * Provide an optional class name for the toolbar menu
20
+ */
21
+ menuOptionsClass?: string;
18
22
  /**
19
23
  * Optional prop to allow overriding the default menu icon
20
24
  */
@@ -30,16 +30,19 @@ const TableToolbarMenu = _ref => {
30
30
  renderIcon = iconsReact.Settings,
31
31
  iconDescription = defaultIconDescription,
32
32
  children,
33
+ menuOptionsClass,
33
34
  ...rest
34
35
  } = _ref;
35
36
  const prefix = usePrefix.usePrefix();
36
37
  const toolbarActionClasses = cx__default["default"](className, `${prefix}--toolbar-action ${prefix}--overflow-menu`);
38
+ const menuOptionsClasses = cx__default["default"](menuOptionsClass, `${prefix}--toolbar-action__menu`);
37
39
  return /*#__PURE__*/React__default["default"].createElement(index["default"], _rollupPluginBabelHelpers["extends"]({
38
40
  "aria-label": iconDescription,
39
41
  renderIcon: renderIcon,
40
42
  className: toolbarActionClasses,
41
43
  title: iconDescription,
42
44
  iconDescription: iconDescription,
45
+ menuOptionsClass: menuOptionsClasses,
43
46
  flipped: true
44
47
  }, rest), children);
45
48
  };
@@ -53,6 +56,10 @@ TableToolbarMenu.propTypes = {
53
56
  * The description of the menu icon.
54
57
  */
55
58
  iconDescription: PropTypes__default["default"].string,
59
+ /**
60
+ * Provide an optional class name for the toolbar menu
61
+ */
62
+ menuOptionsClass: PropTypes__default["default"].string,
56
63
  /**
57
64
  * Optional prop to allow overriding the default menu icon
58
65
  */
@@ -102,6 +102,10 @@ interface DatePickerProps {
102
102
  * The `open` event handler.
103
103
  */
104
104
  onOpen?: flatpickr.Options.Hook;
105
+ /**
106
+ * flatpickr prop passthrough. Controls how dates are parsed.
107
+ */
108
+ parseDate?: (date: string) => Date | false;
105
109
  /**
106
110
  * whether the DatePicker is to be readOnly
107
111
  * if boolean applies to all inputs
@@ -170,6 +170,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
170
170
  readOnly = false,
171
171
  short = false,
172
172
  value,
173
+ parseDate: parseDateProp,
173
174
  ...rest
174
175
  } = _ref;
175
176
  const prefix = usePrefix.usePrefix();
@@ -279,6 +280,37 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
279
280
  } else {
280
281
  localeData = l10n__default["default"][locale];
281
282
  }
283
+
284
+ /**
285
+ * parseDate is called before the date is actually set.
286
+ * It attempts to parse the input value and return a valid date string.
287
+ * Flatpickr's default parser results in odd dates when given invalid
288
+ * values, so instead here we normalize the month/day to `1` if given
289
+ * a value outside the acceptable range.
290
+ */
291
+ let parseDate;
292
+ if (!parseDateProp && dateFormat === 'm/d/Y') {
293
+ // This function only supports the default dateFormat.
294
+ parseDate = date => {
295
+ // Month must be 1-12. If outside these bounds, `1` should be used.
296
+ const month = date.split('/')[0] <= 12 && date.split('/')[0] > 0 ? parseInt(date.split('/')[0]) : 1;
297
+ const year = parseInt(date.split('/')[2]);
298
+ if (month && year) {
299
+ // The month and year must be provided to be able to determine
300
+ // the number of days in the month.
301
+ const daysInMonth = new Date(year, month, 0).getDate();
302
+ // If the day does not fall within the days in the month, `1` should be used.
303
+ const day = date.split('/')[1] <= daysInMonth && date.split('/')[1] > 0 ? parseInt(date.split('/')[1]) : 1;
304
+ return new Date(`${year}/${month}/${day}`);
305
+ } else {
306
+ // With no month and year, we cannot calculate anything.
307
+ // Returning false gives flatpickr an invalid date, which will clear the input
308
+ return false;
309
+ }
310
+ };
311
+ } else if (parseDateProp) {
312
+ parseDate = parseDateProp;
313
+ }
282
314
  const {
283
315
  current: start
284
316
  } = startInputField;
@@ -297,6 +329,7 @@ const DatePicker = /*#__PURE__*/React__default["default"].forwardRef(function Da
297
329
  [enableOrDisable]: enableOrDisableArr,
298
330
  minDate: minDate,
299
331
  maxDate: maxDate,
332
+ parseDate: parseDate,
300
333
  plugins: [datePickerType === 'range' ? rangePlugin["default"]({
301
334
  input: endInputField.current
302
335
  }) : () => {}, appendTo ? appendToPlugin["default"]({
@@ -708,6 +741,10 @@ DatePicker.propTypes = {
708
741
  * `(dates: Date[], dStr: string, fp: Instance, data?: any):void;`
709
742
  */
710
743
  onOpen: PropTypes__default["default"].func,
744
+ /**
745
+ * flatpickr prop passthrough. Controls how dates are parsed.
746
+ */
747
+ parseDate: PropTypes__default["default"].func,
711
748
  /**
712
749
  * whether the DatePicker is to be readOnly
713
750
  * if boolean applies to all inputs
@@ -13,7 +13,7 @@ interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>
13
13
  /**
14
14
  * Specify how the trigger should align with the tooltip
15
15
  */
16
- align?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
16
+ align?: 'top' | 'top-left' | 'top-start' | 'top-right' | 'top-end' | 'bottom' | 'bottom-left' | 'bottom-start' | 'bottom-right' | 'bottom-end' | 'left' | 'right';
17
17
  /**
18
18
  * Provide an icon or asset to be rendered inside of the IconButton
19
19
  */
@@ -69,7 +69,7 @@ IconButton.propTypes = {
69
69
  /**
70
70
  * Specify how the trigger should align with the tooltip
71
71
  */
72
- align: PropTypes__default["default"].oneOf(['top', 'top-left', 'top-right', 'bottom', 'bottom-left', 'bottom-right', 'left', 'right']),
72
+ align: PropTypes__default["default"].oneOf(['top', 'top-left', 'top-start', 'top-right', 'top-end', 'bottom', 'bottom-left', 'bottom-start', 'bottom-right', 'bottom-end', 'left', 'right']),
73
73
  /**
74
74
  * Provide an icon or asset to be rendered inside of the IconButton
75
75
  */
@@ -21,6 +21,10 @@ export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAt
21
21
  * Specify the text to be displayed when the control is invalid
22
22
  */
23
23
  invalidText?: React.ReactNode;
24
+ /**
25
+ * Specify the id to be applied to the element containing the invalid text
26
+ */
27
+ invalidTextId?: string;
24
28
  /**
25
29
  * Specify if the control should render open
26
30
  */
@@ -50,6 +54,10 @@ export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAt
50
54
  * Provide the text that is displayed when the control is in warning state
51
55
  */
52
56
  warnText?: React.ReactNode;
57
+ /**
58
+ * Specify the id to be applied to the element containing the warn text
59
+ */
60
+ warnTextId?: string;
53
61
  }
54
62
  export type ListBoxComponent = ForwardRefReturn<HTMLDivElement, ListBoxProps>;
55
63
  /**
@@ -47,8 +47,10 @@ const ListBox = /*#__PURE__*/React__default["default"].forwardRef(function ListB
47
47
  size,
48
48
  invalid,
49
49
  invalidText,
50
+ invalidTextId,
50
51
  warn,
51
52
  warnText,
53
+ warnTextId,
52
54
  light,
53
55
  isOpen,
54
56
  ...rest
@@ -80,9 +82,11 @@ const ListBox = /*#__PURE__*/React__default["default"].forwardRef(function ListB
80
82
  }), children), isFluid && /*#__PURE__*/React__default["default"].createElement("hr", {
81
83
  className: `${prefix}--list-box__divider`
82
84
  }), invalid ? /*#__PURE__*/React__default["default"].createElement("div", {
83
- className: `${prefix}--form-requirement`
85
+ className: `${prefix}--form-requirement`,
86
+ id: invalidTextId
84
87
  }, invalidText) : null, showWarning ? /*#__PURE__*/React__default["default"].createElement("div", {
85
- className: `${prefix}--form-requirement`
88
+ className: `${prefix}--form-requirement`,
89
+ id: warnTextId
86
90
  }, warnText) : null);
87
91
  });
88
92
  ListBox.displayName = 'ListBox';
@@ -107,6 +111,10 @@ ListBox.propTypes = {
107
111
  * Specify the text to be displayed when the control is invalid
108
112
  */
109
113
  invalidText: PropTypes__default["default"].node,
114
+ /**
115
+ * Specify the id to be applied to the element containing the invalid text
116
+ */
117
+ invalidTextId: PropTypes__default["default"].string,
110
118
  /**
111
119
  * Specify if the control should render open
112
120
  */
@@ -132,7 +140,11 @@ ListBox.propTypes = {
132
140
  /**
133
141
  * Provide the text that is displayed when the control is in warning state
134
142
  */
135
- warnText: PropTypes__default["default"].node
143
+ warnText: PropTypes__default["default"].string,
144
+ /**
145
+ * Specify the id to be applied to the element containing the warn text
146
+ */
147
+ warnTextId: PropTypes__default["default"].string
136
148
  };
137
149
 
138
150
  exports["default"] = ListBox;
@@ -30,7 +30,7 @@ export interface LoadingProps extends ReactAttr<HTMLDivElement> {
30
30
  /**
31
31
  * Specify whether you want the loader to be applied with an overlay
32
32
  */
33
- withOverlay: boolean;
33
+ withOverlay?: boolean;
34
34
  }
35
35
  declare function Loading({ active, className: customClassName, withOverlay, small, description, ...rest }: LoadingProps): import("react/jsx-runtime").JSX.Element;
36
36
  declare namespace Loading {