@carbon/react 1.106.0 → 1.107.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 (161) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1017 -982
  2. package/es/components/Accordion/AccordionItem.d.ts +2 -2
  3. package/es/components/Button/Button.d.ts +2 -2
  4. package/es/components/Button/Button.js +1 -1
  5. package/es/components/Checkbox/Checkbox.js +2 -1
  6. package/es/components/CheckboxGroup/CheckboxGroup.js +2 -1
  7. package/es/components/ComboBox/ComboBox.d.ts +1 -1
  8. package/es/components/ComboBox/ComboBox.js +1 -1
  9. package/es/components/ComboButton/index.js +2 -2
  10. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
  11. package/es/components/ContentSwitcher/ContentSwitcher.js +24 -15
  12. package/es/components/DataTable/DataTable.d.ts +3 -3
  13. package/es/components/DataTable/TableActionList.d.ts +1 -1
  14. package/es/components/DataTable/TableHead.d.ts +1 -1
  15. package/es/components/DataTable/TableSlugRow.d.ts +2 -2
  16. package/es/components/DataTable/TableSlugRow.js +8 -11
  17. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  18. package/es/components/DataTable/TableToolbarSearch.d.ts +5 -1
  19. package/es/components/DatePicker/DatePicker.js +15 -13
  20. package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -3
  21. package/es/components/Dropdown/Dropdown.d.ts +1 -1
  22. package/es/components/FluidTimePicker/FluidTimePicker.d.ts +1 -1
  23. package/es/components/FluidTimePicker/FluidTimePicker.js +6 -4
  24. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +4 -0
  25. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -1
  26. package/es/components/FluidTimePickerSelect/index.js +18 -0
  27. package/es/components/Grid/CSSGrid.js +11 -6
  28. package/es/components/Grid/Column.d.ts +2 -2
  29. package/es/components/Grid/ColumnHang.d.ts +3 -3
  30. package/es/components/Grid/ColumnHang.js +1 -1
  31. package/es/components/Grid/FlexGrid.js +5 -3
  32. package/es/components/Grid/Grid.js +2 -1
  33. package/es/components/Grid/GridTypes.d.ts +5 -0
  34. package/es/components/Grid/Row.d.ts +3 -3
  35. package/es/components/Grid/Row.js +1 -1
  36. package/es/components/Menu/Menu.js +1 -1
  37. package/es/components/Menu/MenuItem.js +4 -0
  38. package/es/components/Modal/Modal.d.ts +1 -1
  39. package/es/components/Modal/Modal.js +20 -6
  40. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
  41. package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
  42. package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
  43. package/es/components/NumberInput/NumberInput.js +4 -2
  44. package/es/components/OverflowMenu/OverflowMenu.js +11 -12
  45. package/es/components/Pagination/Pagination.d.ts +1 -1
  46. package/es/components/Pagination/Pagination.js +2 -0
  47. package/es/components/Popover/index.js +14 -1
  48. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
  49. package/es/components/RadioButtonGroup/RadioButtonGroup.js +8 -6
  50. package/es/components/Search/Search.Skeleton.d.ts +12 -3
  51. package/es/components/Search/Search.Skeleton.js +16 -8
  52. package/es/components/Search/Search.d.ts +1 -1
  53. package/es/components/Search/Search.js +4 -4
  54. package/es/components/Select/Select.d.ts +1 -1
  55. package/es/components/Select/Select.js +7 -6
  56. package/es/components/Slider/Slider.js +58 -76
  57. package/es/components/Tabs/Tabs.js +2 -2
  58. package/es/components/TextArea/TextArea.js +5 -2
  59. package/es/components/TextInput/ControlledPasswordInput.js +2 -1
  60. package/es/components/TextInput/PasswordInput.d.ts +2 -2
  61. package/es/components/TextInput/PasswordInput.js +33 -21
  62. package/es/components/TextInput/TextInput.Skeleton.d.ts +10 -2
  63. package/es/components/TextInput/TextInput.Skeleton.js +10 -4
  64. package/es/components/TextInput/TextInput.d.ts +1 -1
  65. package/es/components/TextInput/TextInput.js +39 -30
  66. package/es/components/TextInput/util.d.ts +1 -0
  67. package/es/components/TextInput/util.js +1 -1
  68. package/es/components/Theme/index.d.ts +2 -2
  69. package/es/components/Theme/index.js +3 -3
  70. package/es/components/TimePicker/TimePicker.js +5 -2
  71. package/es/components/TreeView/TreeNode.js +2 -2
  72. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  73. package/es/components/UIShell/HeaderMenu.d.ts +1 -1
  74. package/es/components/UIShell/HeaderMenu.js +5 -3
  75. package/es/index.js +2 -2
  76. package/es/internal/FloatingMenu.d.ts +5 -1
  77. package/es/internal/hasHelperText.d.ts +8 -0
  78. package/es/internal/hasHelperText.js +11 -0
  79. package/es/tools/wrapComponent.d.ts +3 -3
  80. package/es/tools/wrapComponent.js +1 -1
  81. package/lib/components/Accordion/AccordionItem.d.ts +2 -2
  82. package/lib/components/Button/Button.d.ts +2 -2
  83. package/lib/components/Button/Button.js +1 -1
  84. package/lib/components/Checkbox/Checkbox.js +2 -1
  85. package/lib/components/CheckboxGroup/CheckboxGroup.js +2 -1
  86. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  87. package/lib/components/ComboBox/ComboBox.js +1 -1
  88. package/lib/components/ComboButton/index.js +2 -2
  89. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
  90. package/lib/components/ContentSwitcher/ContentSwitcher.js +22 -13
  91. package/lib/components/DataTable/DataTable.d.ts +3 -3
  92. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  93. package/lib/components/DataTable/TableHead.d.ts +1 -1
  94. package/lib/components/DataTable/TableSlugRow.d.ts +2 -2
  95. package/lib/components/DataTable/TableSlugRow.js +7 -10
  96. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  97. package/lib/components/DataTable/TableToolbarSearch.d.ts +5 -1
  98. package/lib/components/DatePicker/DatePicker.js +15 -13
  99. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -2
  100. package/lib/components/Dropdown/Dropdown.d.ts +1 -1
  101. package/lib/components/FluidTimePicker/FluidTimePicker.d.ts +1 -1
  102. package/lib/components/FluidTimePicker/FluidTimePicker.js +5 -3
  103. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +4 -0
  104. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -1
  105. package/lib/components/FluidTimePickerSelect/index.js +17 -0
  106. package/lib/components/Grid/CSSGrid.js +11 -6
  107. package/lib/components/Grid/Column.d.ts +2 -2
  108. package/lib/components/Grid/ColumnHang.d.ts +3 -3
  109. package/lib/components/Grid/ColumnHang.js +1 -1
  110. package/lib/components/Grid/FlexGrid.js +5 -3
  111. package/lib/components/Grid/Grid.js +2 -1
  112. package/lib/components/Grid/GridTypes.d.ts +5 -0
  113. package/lib/components/Grid/Row.d.ts +3 -3
  114. package/lib/components/Grid/Row.js +1 -1
  115. package/lib/components/Menu/Menu.js +1 -1
  116. package/lib/components/Menu/MenuItem.js +4 -0
  117. package/lib/components/Modal/Modal.d.ts +1 -1
  118. package/lib/components/Modal/Modal.js +19 -5
  119. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
  120. package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
  121. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  122. package/lib/components/NumberInput/NumberInput.js +4 -2
  123. package/lib/components/OverflowMenu/OverflowMenu.js +10 -11
  124. package/lib/components/Pagination/Pagination.d.ts +1 -1
  125. package/lib/components/Pagination/Pagination.js +2 -0
  126. package/lib/components/Popover/index.js +14 -1
  127. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
  128. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +7 -5
  129. package/lib/components/Search/Search.Skeleton.d.ts +12 -3
  130. package/lib/components/Search/Search.Skeleton.js +15 -7
  131. package/lib/components/Search/Search.d.ts +1 -1
  132. package/lib/components/Search/Search.js +4 -4
  133. package/lib/components/Select/Select.d.ts +1 -1
  134. package/lib/components/Select/Select.js +7 -6
  135. package/lib/components/Slider/Slider.js +58 -76
  136. package/lib/components/Tabs/Tabs.js +2 -2
  137. package/lib/components/TextArea/TextArea.js +5 -2
  138. package/lib/components/TextInput/ControlledPasswordInput.js +2 -1
  139. package/lib/components/TextInput/PasswordInput.d.ts +2 -2
  140. package/lib/components/TextInput/PasswordInput.js +33 -21
  141. package/lib/components/TextInput/TextInput.Skeleton.d.ts +10 -2
  142. package/lib/components/TextInput/TextInput.Skeleton.js +10 -4
  143. package/lib/components/TextInput/TextInput.d.ts +1 -1
  144. package/lib/components/TextInput/TextInput.js +39 -30
  145. package/lib/components/TextInput/util.d.ts +1 -0
  146. package/lib/components/TextInput/util.js +1 -1
  147. package/lib/components/Theme/index.d.ts +2 -2
  148. package/lib/components/Theme/index.js +2 -2
  149. package/lib/components/TimePicker/TimePicker.js +5 -2
  150. package/lib/components/TreeView/TreeNode.js +1 -1
  151. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  152. package/lib/components/UIShell/HeaderMenu.d.ts +1 -1
  153. package/lib/components/UIShell/HeaderMenu.js +5 -3
  154. package/lib/index.js +2 -2
  155. package/lib/internal/FloatingMenu.d.ts +5 -1
  156. package/lib/internal/hasHelperText.d.ts +8 -0
  157. package/lib/internal/hasHelperText.js +11 -0
  158. package/lib/tools/wrapComponent.d.ts +3 -3
  159. package/lib/tools/wrapComponent.js +1 -1
  160. package/package.json +11 -11
  161. package/telemetry.yml +1 -0
@@ -17,7 +17,7 @@ prop_types = require_runtime.__toESM(prop_types);
17
17
  let react_jsx_runtime = require("react/jsx-runtime");
18
18
  //#region src/components/DataTable/TableSlugRow.tsx
19
19
  /**
20
- * Copyright IBM Corp. 2016, 2025
20
+ * Copyright IBM Corp. 2016, 2026
21
21
  *
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
@@ -27,16 +27,13 @@ const TableSlugRow = ({ className, slug }) => {
27
27
  require_deprecateComponent.deprecateComponent("TableSlugRow", "The `TableSlugRow` component has been deprecated and will be removed in the next major version. Use the TableDecoratorRow component instead.");
28
28
  }, []);
29
29
  const prefix = require_usePrefix.usePrefix();
30
- const TableSlugRowClasses = (0, classnames.default)({
31
- ...className && { [className]: true },
32
- [`${prefix}--table-column-slug`]: true,
33
- [`${prefix}--table-column-slug--active`]: slug
34
- });
35
- let normalizedSlug;
36
- if (slug) normalizedSlug = react.default.cloneElement(slug, { size: "mini" });
37
30
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
38
- className: TableSlugRowClasses,
39
- children: normalizedSlug
31
+ className: (0, classnames.default)({
32
+ ...className && { [className]: true },
33
+ [`${prefix}--table-column-slug`]: true,
34
+ [`${prefix}--table-column-slug--active`]: slug
35
+ }),
36
+ children: (0, react.isValidElement)(slug) ? (0, react.cloneElement)(slug, { size: "mini" }) : void 0
40
37
  });
41
38
  };
42
39
  TableSlugRow.displayName = "TableSlugRow";
@@ -4,5 +4,5 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- declare const TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
7
+ declare const TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => import("react").ReactElement;
8
8
  export default TableToolbarContent;
@@ -13,7 +13,7 @@ declare const translationIds: {
13
13
  readonly 'carbon.table.toolbar.search.placeholder': "carbon.table.toolbar.search.placeholder";
14
14
  };
15
15
  type TranslationKey = keyof typeof translationIds;
16
- type ExcludedInheritedProps = 'defaultValue' | 'labelText' | 'onBlur' | 'onChange' | 'onExpand' | 'onFocus' | 'tabIndex';
16
+ type ExcludedInheritedProps = 'defaultValue' | 'labelText' | 'onBlur' | 'onChange' | 'onExpand' | 'onFocus' | 'tabIndex' | 'size';
17
17
  export type TableToolbarSearchHandleExpand = (event: FocusEvent<HTMLInputElement>, newValue?: boolean) => void;
18
18
  /**
19
19
  * @deprecated Passing `''` as the event sentinel is legacy compatibility
@@ -69,6 +69,10 @@ export interface TableToolbarSearchProps extends Omit<SearchProps, ExcludedInher
69
69
  * Provide an optional className for the overall container of the Search
70
70
  */
71
71
  searchContainerClass?: string;
72
+ /**
73
+ * Specify the size of the Search
74
+ */
75
+ size?: 'sm' | 'md' | 'lg';
72
76
  tabIndex?: number | string;
73
77
  }
74
78
  declare const TableToolbarSearch: {
@@ -45,6 +45,7 @@ function initializeWeekdayShorthand() {
45
45
  });
46
46
  }
47
47
  const forEach = Array.prototype.forEach;
48
+ const defaultAriaDateFormat = "l, F j, Y";
48
49
  /**
49
50
  * @param {number} monthNumber The month number.
50
51
  * @param {boolean} shorthand `true` to use shorthand month.
@@ -170,7 +171,6 @@ const DatePicker = (0, react.forwardRef)((props, ref) => {
170
171
  const lastFocusedField = (0, react.useRef)(null);
171
172
  const savedOnChange = require_useSavedCallback.useSavedCallback(onChange);
172
173
  const savedOnOpen = require_useSavedCallback.useSavedCallback(onOpen);
173
- const effectiveWarn = warn && !invalid;
174
174
  const wrapperRef = (0, react.useRef)(null);
175
175
  const datePickerClasses = (0, classnames.default)(`${prefix}--date-picker`, {
176
176
  [`${prefix}--date-picker--short`]: short,
@@ -182,31 +182,35 @@ const DatePicker = (0, react.forwardRef)((props, ref) => {
182
182
  });
183
183
  const wrapperClasses = (0, classnames.default)(`${prefix}--form-item`, { [String(className)]: className });
184
184
  const childrenWithProps = react.default.Children.toArray(children).map((child, index) => {
185
+ const childInvalid = child.props?.invalid;
186
+ const childWarn = child.props?.warn;
187
+ const mergedInvalid = invalid ?? childInvalid;
188
+ const mergedWarn = mergedInvalid ? false : warn ?? childWarn;
185
189
  if (index === 0 && require_utils.isComponentElement(child, require_index.default)) return react.default.cloneElement(child, {
186
190
  datePickerType,
187
191
  ref: startInputField,
188
192
  readOnly,
189
- invalid,
190
- warn: effectiveWarn
193
+ invalid: mergedInvalid,
194
+ warn: mergedWarn
191
195
  });
192
196
  if (index === 1 && require_utils.isComponentElement(child, require_index.default)) return react.default.cloneElement(child, {
193
197
  datePickerType,
194
198
  ref: endInputField,
195
199
  readOnly,
196
- invalid,
197
- warn: effectiveWarn
200
+ invalid: mergedInvalid,
201
+ warn: mergedWarn
198
202
  });
199
203
  if (index === 0) return react.default.cloneElement(child, {
200
204
  ref: startInputField,
201
205
  readOnly,
202
- invalid,
203
- warn: effectiveWarn
206
+ invalid: mergedInvalid,
207
+ warn: mergedWarn
204
208
  });
205
209
  if (index === 1) return react.default.cloneElement(child, {
206
210
  ref: endInputField,
207
211
  readOnly,
208
- invalid,
209
- warn: effectiveWarn
212
+ invalid: mergedInvalid,
213
+ warn: mergedWarn
210
214
  });
211
215
  });
212
216
  (0, react.useEffect)(() => {
@@ -261,6 +265,7 @@ const DatePicker = (0, react.forwardRef)((props, ref) => {
261
265
  inline: inline ?? false,
262
266
  onClose: onCalendarClose,
263
267
  disableMobile: true,
268
+ ariaDateFormat: defaultAriaDateFormat,
264
269
  defaultDate: value,
265
270
  closeOnSelect,
266
271
  mode: datePickerType,
@@ -345,7 +350,6 @@ const DatePicker = (0, react.forwardRef)((props, ref) => {
345
350
  const { target } = event;
346
351
  if (target === start) lastStartValue.current = start.value;
347
352
  if (start.value !== "") return;
348
- if (!calendar.selectedDates) return;
349
353
  if (calendar.selectedDates.length === 0) return;
350
354
  }
351
355
  function handleKeyPress(event) {
@@ -427,9 +431,7 @@ const DatePicker = (0, react.forwardRef)((props, ref) => {
427
431
  }, [value, startInputField]);
428
432
  (0, react.useEffect)(() => {
429
433
  if (calendarRef.current?.set) {
430
- if (value !== void 0) if (value === "" || value === null || Array.isArray(value) && (value.length === 0 || value.every(require_utils$1.isEmptyDateValue))) {
431
- if (calendarRef.current.selectedDates.length > 0) calendarRef.current.clear();
432
- } else calendarRef.current.setDate(value);
434
+ if (!require_utils$1.isEmptyDateValue(value) && (!Array.isArray(value) || value.length > 0 && !value.every(require_utils$1.isEmptyDateValue))) calendarRef.current.setDate(value);
433
435
  updateClassNames(calendarRef.current, prefix);
434
436
  } else if (!calendarRef.current && typeof value !== "undefined" && value !== null) startInputField.current.value = value;
435
437
  }, [
@@ -52,8 +52,7 @@ const fixEventsPlugin = (config) => (fp) => {
52
52
  if (inputTo === target && fp.config.closeOnSelect) requestAnimationFrame(() => {
53
53
  fp.close();
54
54
  });
55
- } else if (require_match.match(event, require_keys.ArrowLeft) || require_match.match(event, require_keys.ArrowRight)) event.stopPropagation();
56
- else if (require_match.match(event, require_keys.ArrowDown)) {
55
+ } else if (require_match.match(event, require_keys.ArrowDown)) {
57
56
  event.preventDefault();
58
57
  fp.open();
59
58
  } else if (!fp.config.allowInput) {
@@ -152,7 +152,7 @@ export type DropdownTranslationKey = ListBoxMenuIconTranslationKey;
152
152
  interface DropdownComponent {
153
153
  <ItemType>(props: DropdownProps<ItemType> & {
154
154
  ref?: Ref<HTMLButtonElement>;
155
- }): React.ReactElement<any> | null;
155
+ }): React.ReactElement | null;
156
156
  }
157
157
  declare const _default: DropdownComponent;
158
158
  export default _default;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2022
2
+ * Copyright IBM Corp. 2022, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -7,7 +7,9 @@
7
7
 
8
8
  const require_runtime = require("../../_virtual/_rolldown/runtime.js");
9
9
  const require_usePrefix = require("../../internal/usePrefix.js");
10
+ const require_utils = require("../../internal/utils.js");
10
11
  const require_index = require("../FluidTextInput/index.js");
12
+ const require_index$1 = require("../FluidTimePickerSelect/index.js");
11
13
  let classnames = require("classnames");
12
14
  classnames = require_runtime.__toESM(classnames);
13
15
  let react = require("react");
@@ -18,7 +20,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
18
20
  let _carbon_icons_react = require("@carbon/icons-react");
19
21
  //#region src/components/FluidTimePicker/FluidTimePicker.tsx
20
22
  /**
21
- * Copyright IBM Corp. 2022
23
+ * Copyright IBM Corp. 2022, 2026
22
24
  *
23
25
  * This source code is licensed under the Apache-2.0 license found in the
24
26
  * LICENSE file in the root directory of this source tree.
@@ -38,8 +40,8 @@ const FluidTimePicker = react.default.forwardRef(({ className, children, disable
38
40
  };
39
41
  const error = invalid || warn;
40
42
  const childrenWithProps = () => {
41
- if (disabled) return react.default.Children.toArray(children).map((child) => react.default.cloneElement(child, { disabled: true }));
42
- if (readOnly) return react.default.Children.toArray(children).map((child) => react.default.cloneElement(child, { readOnly: true }));
43
+ if (disabled) return react.default.Children.toArray(children).map((child) => require_utils.isComponentElement(child, require_index$1.default) ? (0, react.cloneElement)(child, { disabled: true }) : child);
44
+ if (readOnly) return react.default.Children.toArray(children).map((child) => require_utils.isComponentElement(child, require_index$1.default) ? (0, react.cloneElement)(child, { readOnly: true }) : child);
43
45
  return children;
44
46
  };
45
47
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -36,6 +36,10 @@ export interface FluidTimePickerSelectProps {
36
36
  * the underlying `<input>` changes
37
37
  */
38
38
  onChange?: React.ChangeEventHandler<HTMLSelectElement>;
39
+ /**
40
+ * Whether the component is read-only.
41
+ */
42
+ readOnly?: boolean;
39
43
  }
40
44
  declare const FluidTimePickerSelect: React.ForwardRefExoticComponent<FluidTimePickerSelectProps & React.RefAttributes<HTMLSelectElement>>;
41
45
  export default FluidTimePickerSelect;
@@ -34,7 +34,8 @@ FluidTimePickerSelect.propTypes = {
34
34
  disabled: prop_types.default.bool,
35
35
  id: prop_types.default.string.isRequired,
36
36
  labelText: prop_types.default.node,
37
- onChange: prop_types.default.func
37
+ onChange: prop_types.default.func,
38
+ readOnly: prop_types.default.bool
38
39
  };
39
40
  //#endregion
40
41
  exports.default = FluidTimePickerSelect;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2026
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
+ //#region src/components/FluidTimePickerSelect/index.tsx
9
+ /**
10
+ * Copyright IBM Corp. 2022
11
+ *
12
+ * This source code is licensed under the Apache-2.0 license found in the
13
+ * LICENSE file in the root directory of this source tree.
14
+ */
15
+ var FluidTimePickerSelect_default = require("./FluidTimePickerSelect.js").default;
16
+ //#endregion
17
+ exports.default = FluidTimePickerSelect_default;
@@ -22,7 +22,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  */
25
- const CSSGrid = react.default.forwardRef(({ align, as, children, className: customClassName, condensed = false, fullWidth = false, narrow = false, ...rest }, ref) => {
25
+ const CSSGrid = react.default.forwardRef(({ align, as, children, className: customClassName, condensed = false, fullWidth = false, narrow = false, withRowGap, ...rest }, ref) => {
26
26
  const prefix = require_usePrefix.usePrefix();
27
27
  const { subgrid } = require_GridContext.useGridSettings();
28
28
  let mode = "wide";
@@ -36,6 +36,7 @@ const CSSGrid = react.default.forwardRef(({ align, as, children, className: cust
36
36
  as,
37
37
  className: customClassName,
38
38
  mode,
39
+ withRowGap,
39
40
  ...rest,
40
41
  children
41
42
  })
@@ -46,7 +47,8 @@ const CSSGrid = react.default.forwardRef(({ align, as, children, className: cust
46
47
  [`${prefix}--css-grid--narrow`]: mode === "narrow",
47
48
  [`${prefix}--css-grid--full-width`]: fullWidth,
48
49
  [`${prefix}--css-grid--start`]: align === "start",
49
- [`${prefix}--css-grid--end`]: align === "end"
50
+ [`${prefix}--css-grid--end`]: align === "end",
51
+ [`${prefix}--css-grid--with-row-gap`]: withRowGap
50
52
  });
51
53
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_GridContext.GridSettings, {
52
54
  mode: "css-grid",
@@ -70,15 +72,17 @@ CSSGrid.propTypes = {
70
72
  className: prop_types.default.string,
71
73
  condensed: prop_types.default.bool,
72
74
  fullWidth: prop_types.default.bool,
73
- narrow: prop_types.default.bool
75
+ narrow: prop_types.default.bool,
76
+ withRowGap: prop_types.default.bool
74
77
  };
75
- const Subgrid = react.default.forwardRef(({ as, className: customClassName, children, mode, ...rest }, ref) => {
78
+ const Subgrid = react.default.forwardRef(({ as, className: customClassName, children, mode, withRowGap, ...rest }, ref) => {
76
79
  const prefix = require_usePrefix.usePrefix();
77
80
  const className = (0, classnames.default)(customClassName, {
78
81
  [`${prefix}--subgrid`]: true,
79
82
  [`${prefix}--subgrid--condensed`]: mode === "condensed",
80
83
  [`${prefix}--subgrid--narrow`]: mode === "narrow",
81
- [`${prefix}--subgrid--wide`]: mode === "wide"
84
+ [`${prefix}--subgrid--wide`]: mode === "wide",
85
+ [`${prefix}--subgrid--with-row-gap`]: withRowGap
82
86
  });
83
87
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(as || "div", {
84
88
  ...rest,
@@ -95,7 +99,8 @@ Subgrid.propTypes = {
95
99
  "wide",
96
100
  "narrow",
97
101
  "condensed"
98
- ])
102
+ ]),
103
+ withRowGap: prop_types.default.bool
99
104
  };
100
105
  const CSSGridComponent = CSSGrid;
101
106
  //#endregion
@@ -4,7 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import React, { type ReactElement } from 'react';
8
8
  import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
9
9
  type ColumnSpanPercent = '25%' | '50%' | '75%' | '100%';
10
10
  type ColumnSpanSimple = boolean | number | ColumnSpanPercent;
@@ -67,7 +67,7 @@ export interface ColumnBaseProps {
67
67
  }
68
68
  export type ColumnProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, ColumnBaseProps>;
69
69
  export interface ColumnComponent {
70
- <T extends React.ElementType>(props: ColumnProps<T>, context?: any): React.ReactElement<any, any> | null;
70
+ <T extends React.ElementType>(props: ColumnProps<T>, context?: any): ReactElement | null;
71
71
  }
72
72
  declare const _default: ColumnComponent;
73
73
  export default _default;
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import React, { type ReactElement } from 'react';
8
8
  import { PolymorphicProps } from '../../types/common';
9
9
  interface ColumnHangBaseProps {
10
10
  /**
@@ -18,7 +18,7 @@ interface ColumnHangBaseProps {
18
18
  }
19
19
  export type ColumnHangProps<T extends React.ElementType> = PolymorphicProps<T, ColumnHangBaseProps>;
20
20
  export interface ColumnHangComponent {
21
- <T extends React.ElementType>(props: ColumnHangProps<T>, context?: any): React.ReactElement<any, any> | null;
21
+ <T extends React.ElementType>(props: ColumnHangProps<T>, context?: any): ReactElement | null;
22
22
  }
23
23
  declare const ColumnHangComponent: ColumnHangComponent;
24
24
  export { ColumnHangComponent as ColumnHang };
@@ -16,7 +16,7 @@ prop_types = require_runtime.__toESM(prop_types);
16
16
  let react_jsx_runtime = require("react/jsx-runtime");
17
17
  //#region src/components/Grid/ColumnHang.tsx
18
18
  /**
19
- * Copyright IBM Corp. 2016, 2023
19
+ * Copyright IBM Corp. 2016, 2026
20
20
  *
21
21
  * This source code is licensed under the Apache-2.0 license found in the
22
22
  * LICENSE file in the root directory of this source tree.
@@ -22,13 +22,14 @@ let react_jsx_runtime = require("react/jsx-runtime");
22
22
  * This source code is licensed under the Apache-2.0 license found in the
23
23
  * LICENSE file in the root directory of this source tree.
24
24
  */
25
- const FlexGrid = react.default.forwardRef(({ as, condensed = false, narrow = false, fullWidth = false, className: containerClassName, children, ...rest }, ref) => {
25
+ const FlexGrid = react.default.forwardRef(({ as, condensed = false, narrow = false, fullWidth = false, withRowGap = false, className: containerClassName, children, ...rest }, ref) => {
26
26
  const prefix = require_usePrefix.usePrefix();
27
27
  const className = (0, classnames.default)(containerClassName, {
28
28
  [`${prefix}--grid`]: true,
29
29
  [`${prefix}--grid--condensed`]: condensed,
30
30
  [`${prefix}--grid--narrow`]: narrow,
31
- [`${prefix}--grid--full-width`]: fullWidth
31
+ [`${prefix}--grid--full-width`]: fullWidth,
32
+ [`${prefix}--grid--with-row-gap`]: withRowGap
32
33
  });
33
34
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_GridContext.GridSettings, {
34
35
  mode: "flexbox",
@@ -47,7 +48,8 @@ FlexGrid.propTypes = {
47
48
  className: prop_types.default.string,
48
49
  condensed: prop_types.default.bool,
49
50
  fullWidth: prop_types.default.bool,
50
- narrow: prop_types.default.bool
51
+ narrow: prop_types.default.bool,
52
+ withRowGap: prop_types.default.bool
51
53
  };
52
54
  const FlexGridComponent = FlexGrid;
53
55
  //#endregion
@@ -36,7 +36,8 @@ Grid.propTypes = {
36
36
  className: prop_types.default.string,
37
37
  condensed: prop_types.default.bool,
38
38
  fullWidth: prop_types.default.bool,
39
- narrow: prop_types.default.bool
39
+ narrow: prop_types.default.bool,
40
+ withRowGap: prop_types.default.bool
40
41
  };
41
42
  const GridAsGridComponent = Grid;
42
43
  //#endregion
@@ -33,6 +33,11 @@ export interface GridBaseProps {
33
33
  * typographic alignment with and without containers.
34
34
  */
35
35
  narrow?: boolean;
36
+ /**
37
+ * Add a row gap to the grid that matches the current gutter size.
38
+ * This is useful when you want consistent vertical spacing between rows.
39
+ */
40
+ withRowGap?: boolean;
36
41
  }
37
42
  export type GridProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, GridBaseProps>;
38
43
  export interface GridComponent {
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import React, { type ReactElement } from 'react';
8
8
  import { PolymorphicProps } from '../../types/common';
9
9
  export interface RowBaseProps {
10
10
  /**
@@ -28,7 +28,7 @@ export interface RowBaseProps {
28
28
  }
29
29
  export type RowProps<T extends React.ElementType> = PolymorphicProps<T, RowBaseProps>;
30
30
  export interface RowComponent {
31
- <T extends React.ElementType>(props: RowProps<T>, context?: any): React.ReactElement<any, any> | null;
31
+ <T extends React.ElementType>(props: RowProps<T>, context?: any): ReactElement | null;
32
32
  }
33
33
  declare const _default: RowComponent;
34
34
  export default _default;
@@ -16,7 +16,7 @@ prop_types = require_runtime.__toESM(prop_types);
16
16
  let react_jsx_runtime = require("react/jsx-runtime");
17
17
  //#region src/components/Grid/Row.tsx
18
18
  /**
19
- * Copyright IBM Corp. 2016, 2023
19
+ * Copyright IBM Corp. 2016, 2026
20
20
  *
21
21
  * This source code is licensed under the Apache-2.0 license found in the
22
22
  * LICENSE file in the root directory of this source tree.
@@ -112,7 +112,7 @@ const Menu = (0, react.forwardRef)(function Menu({ backgroundToken = "layer", bo
112
112
  }
113
113
  }
114
114
  function handleBlur(e) {
115
- if (open && onClose && isRoot && e.relatedTarget && !menu.current?.contains(e.relatedTarget)) handleClose();
115
+ if (open && onClose && isRoot && !menu.current?.contains(e.relatedTarget)) handleClose();
116
116
  }
117
117
  function fitValue(range, axis) {
118
118
  if (!menu.current) return;
@@ -88,6 +88,9 @@ const MenuItem = (0, react.forwardRef)(function MenuItem({ children, className,
88
88
  }
89
89
  const pendingKeyboardClick = (0, react.useRef)(false);
90
90
  const keyboardClickEvent = (e) => require_match.match(e, require_keys.Enter) || require_match.match(e, require_keys.Space);
91
+ function handleMouseDown(e) {
92
+ if (isDisabled) e.preventDefault();
93
+ }
91
94
  function handleKeyDown(e) {
92
95
  if (hasChildren && require_match.match(e, require_keys.ArrowRight)) {
93
96
  openSubmenu();
@@ -142,6 +145,7 @@ const MenuItem = (0, react.forwardRef)(function MenuItem({ children, className,
142
145
  "aria-disabled": isDisabled ?? void 0,
143
146
  "aria-haspopup": hasChildren ?? void 0,
144
147
  "aria-expanded": hasChildren ? submenuOpen : void 0,
148
+ onMouseDown: handleMouseDown,
145
149
  onClick: handleClick,
146
150
  onKeyDown: handleKeyDown,
147
151
  onKeyUp: handleKeyUp,
@@ -57,7 +57,7 @@ export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
57
57
  /**
58
58
  * Provide a ref to return focus to once the modal is closed.
59
59
  */
60
- launcherButtonRef?: RefObject<HTMLButtonElement | null>;
60
+ launcherButtonRef?: RefObject<HTMLElement | null>;
61
61
  /**
62
62
  * Specify the description for the loading text
63
63
  */
@@ -10,6 +10,7 @@ const require_usePrefix = require("../../internal/usePrefix.js");
10
10
  const require_Text = require("../Text/Text.js");
11
11
  const require_keys = require("../../internal/keyboard/keys.js");
12
12
  const require_match = require("../../internal/keyboard/match.js");
13
+ const require_navigation = require("../../internal/keyboard/navigation.js");
13
14
  const require_useId = require("../../internal/useId.js");
14
15
  const require_noopFn = require("../../internal/noopFn.js");
15
16
  const require_warning = require("../../internal/warning.js");
@@ -140,6 +141,9 @@ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label"
140
141
  }
141
142
  const modalContent = document.querySelector(`.${prefix}--modal-content`);
142
143
  if (!modalContent || !modalContent.classList.contains(`${prefix}--modal-scroll-content`) || !currentActiveNode || !modalContent.contains(currentActiveNode)) return;
144
+ const modalRect = modalContent.getBoundingClientRect();
145
+ const elementRect = currentActiveNode.getBoundingClientRect();
146
+ if (elementRect.top >= modalRect.top && elementRect.bottom <= modalRect.bottom) return;
143
147
  currentActiveNode.scrollIntoView({ block: "center" });
144
148
  }
145
149
  const onSecondaryButtonClick = onSecondarySubmit ? onSecondarySubmit : onRequestClose;
@@ -210,25 +214,35 @@ const ModalDialog = react.default.forwardRef(function ModalDialog({ "aria-label"
210
214
  prefix,
211
215
  enableDialogElement
212
216
  ]);
217
+ const focusLauncherButton = (0, react.useCallback)(() => {
218
+ if (!launcherButtonRef || !launcherButtonRef.current) return;
219
+ const { current: launcherButton } = launcherButtonRef;
220
+ (launcherButton.matches(require_navigation.selectorTabbable) ? launcherButton : launcherButton.querySelector(require_navigation.selectorTabbable))?.focus();
221
+ }, [launcherButtonRef]);
213
222
  (0, react.useEffect)(() => {
214
223
  if (!enableDialogElement && !enablePresence && prevOpen && !open && launcherButtonRef) setTimeout(() => {
215
- if ("current" in launcherButtonRef) launcherButtonRef.current?.focus();
224
+ focusLauncherButton();
216
225
  });
217
226
  }, [
218
227
  open,
219
228
  prevOpen,
220
229
  launcherButtonRef,
221
230
  enableDialogElement,
222
- enablePresence
231
+ enablePresence,
232
+ focusLauncherButton
223
233
  ]);
224
234
  (0, react.useEffect)(() => {
225
235
  const launcherButton = launcherButtonRef?.current;
226
236
  return () => {
227
237
  if (enablePresence && launcherButton) setTimeout(() => {
228
- launcherButton.focus();
238
+ focusLauncherButton();
229
239
  });
230
240
  };
231
- }, [enablePresence, launcherButtonRef]);
241
+ }, [
242
+ enablePresence,
243
+ launcherButtonRef,
244
+ focusLauncherButton
245
+ ]);
232
246
  (0, react.useEffect)(() => {
233
247
  if (!enableDialogElement) {
234
248
  const initialFocus = (focusContainerElement) => {
@@ -464,7 +478,7 @@ Modal.propTypes = {
464
478
  hasScrollingContent: prop_types.default.bool,
465
479
  id: prop_types.default.string,
466
480
  isFullWidth: prop_types.default.bool,
467
- launcherButtonRef: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.shape({ current: prop_types.default.oneOfType([typeof HTMLButtonElement !== "undefined" ? prop_types.default.instanceOf(HTMLButtonElement) : prop_types.default.any, prop_types.default.oneOf([null])]).isRequired })]),
481
+ launcherButtonRef: prop_types.default.oneOfType([prop_types.default.func, prop_types.default.shape({ current: prop_types.default.oneOfType([typeof HTMLElement !== "undefined" ? prop_types.default.instanceOf(HTMLElement) : prop_types.default.any, prop_types.default.oneOf([null])]).isRequired })]),
468
482
  loadingDescription: prop_types.default.string,
469
483
  loadingIconDescription: prop_types.default.string,
470
484
  loadingStatus: prop_types.default.oneOf([
@@ -195,7 +195,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
195
195
  inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
196
196
  }
197
197
  export declare const FilterableMultiSelect: {
198
- <ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement<any>;
198
+ <ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement;
199
199
  propTypes?: any;
200
200
  contextTypes?: any;
201
201
  defaultProps?: any;
@@ -14,6 +14,7 @@ const require_useId = require("../../internal/useId.js");
14
14
  const require_deprecate = require("../../prop-types/deprecate.js");
15
15
  const require_defaultItemToString = require("../../internal/defaultItemToString.js");
16
16
  const require_utils = require("../../internal/utils.js");
17
+ const require_hasHelperText = require("../../internal/hasHelperText.js");
17
18
  const require_useNormalizedInputProps = require("../../internal/useNormalizedInputProps.js");
18
19
  const require_index = require("../AILabel/index.js");
19
20
  const require_index$1 = require("../Checkbox/index.js");
@@ -181,7 +182,7 @@ const FilterableMultiSelect = (0, react.forwardRef)(function FilterableMultiSele
181
182
  [`${prefix}--list-box__wrapper--decorator`]: decorator,
182
183
  [`${prefix}--autoalign`]: autoAlign
183
184
  });
184
- const hasHelper = typeof helperText !== "undefined" && helperText !== null;
185
+ const hasHelper = require_hasHelperText.hasHelperText(helperText);
185
186
  const helperId = !hasHelper ? void 0 : `filterablemultiselect-helper-text-${filterableMultiSelectInstanceId}`;
186
187
  const labelId = `${id}-label`;
187
188
  const titleClasses = (0, classnames.default)({
@@ -400,7 +401,7 @@ const FilterableMultiSelect = (0, react.forwardRef)(function FilterableMultiSele
400
401
  });
401
402
  const inputProp = getInputProps(getDropdownProps({
402
403
  "aria-controls": isOpen ? menuId : void 0,
403
- "aria-describedby": helperText && showHelperText ? helperId : void 0,
404
+ "aria-describedby": hasHelper && showHelperText ? helperId : void 0,
404
405
  "aria-haspopup": "listbox",
405
406
  "aria-labelledby": void 0,
406
407
  disabled,
@@ -178,6 +178,6 @@ type MultiSelectComponentProps<ItemType> = React.PropsWithChildren<MultiSelectPr
178
178
  interface MultiSelectComponent {
179
179
  propTypes: Record<string, any>;
180
180
  displayName: string;
181
- <ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement<any> | null;
181
+ <ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement | null;
182
182
  }
183
183
  export {};
@@ -273,7 +273,7 @@ const NumberInput = react.default.forwardRef((props, forwardRef) => {
273
273
  value: allowEmpty && event.target.value === "" ? "" : Number(event.target.value),
274
274
  direction: value < event.target.value ? "up" : "down"
275
275
  };
276
- setValue(state.value);
276
+ if (controlledValue === void 0) setValue(state.value);
277
277
  if (onChange) onChange(event, state);
278
278
  return;
279
279
  }
@@ -316,7 +316,9 @@ const NumberInput = react.default.forwardRef((props, forwardRef) => {
316
316
  value: newValue,
317
317
  direction
318
318
  };
319
- if (type === "number") setValue(state.value);
319
+ if (type === "number") {
320
+ if (controlledValue === void 0) setValue(state.value);
321
+ }
320
322
  if (type === "text") {
321
323
  const formattedNewValue = format(newValue);
322
324
  const parsedFormattedNewValue = numberParser.parse(formattedNewValue);