@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
@@ -38,12 +38,12 @@ export interface AccordionItemProps {
38
38
  * removed in the next major release of Carbon. Use the
39
39
  * `renderToggle` prop instead.
40
40
  */
41
- renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
41
+ renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
42
42
  /**
43
43
  * The callback function to render the expand button.
44
44
  * Can be a React component class.
45
45
  */
46
- renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
46
+ renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
47
47
  /**
48
48
  * The accordion title.
49
49
  */
@@ -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 ReactNode } from 'react';
8
8
  import { IconButtonKind } from '../IconButton';
9
9
  import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
10
10
  export declare const ButtonKinds: readonly ["primary", "secondary", "danger", "ghost", "danger--primary", "danger--ghost", "danger--tertiary", "tertiary"];
@@ -82,6 +82,6 @@ export interface ButtonBaseProps extends React.ButtonHTMLAttributes<HTMLButtonEl
82
82
  tooltipPosition?: ButtonTooltipPosition;
83
83
  }
84
84
  export type ButtonProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, ButtonBaseProps>;
85
- export type ButtonComponent = <T extends React.ElementType = 'button'>(props: ButtonProps<T>, context?: any) => React.ReactElement | any;
85
+ export type ButtonComponent = <T extends React.ElementType = 'button'>(props: ButtonProps<T>) => ReactNode;
86
86
  declare const _default: ButtonComponent;
87
87
  export default _default;
@@ -46,7 +46,7 @@ const ButtonTooltipPositions = [
46
46
  "bottom",
47
47
  "left"
48
48
  ];
49
- function isIconOnlyButton(hasIconOnly, _kind) {
49
+ function isIconOnlyButton(hasIconOnly) {
50
50
  if (hasIconOnly === true) return true;
51
51
  return false;
52
52
  }
@@ -11,6 +11,7 @@ import { useId } from "../../internal/useId.js";
11
11
  import { noopFn } from "../../internal/noopFn.js";
12
12
  import { deprecate } from "../../prop-types/deprecate.js";
13
13
  import { isComponentElement } from "../../internal/utils.js";
14
+ import { hasHelperText } from "../../internal/hasHelperText.js";
14
15
  import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
15
16
  import { AILabel } from "../AILabel/index.js";
16
17
  import classNames from "classnames";
@@ -39,7 +40,7 @@ const Checkbox$1 = React.forwardRef(({ className, decorator, helperText, id, lab
39
40
  const showWarning = normalizedProps.warn;
40
41
  const showHelper = !normalizedProps.invalid && !normalizedProps.warn;
41
42
  const checkboxGroupInstanceId = useId();
42
- const hasHelper = typeof helperText !== "undefined" && helperText !== null;
43
+ const hasHelper = hasHelperText(helperText);
43
44
  const helperId = !hasHelper ? void 0 : `checkbox-helper-text-${checkboxGroupInstanceId}`;
44
45
  const helper = hasHelper && /* @__PURE__ */ jsx("div", {
45
46
  id: helperId,
@@ -9,6 +9,7 @@ import { usePrefix } from "../../internal/usePrefix.js";
9
9
  import { useId } from "../../internal/useId.js";
10
10
  import { deprecate } from "../../prop-types/deprecate.js";
11
11
  import { isComponentElement } from "../../internal/utils.js";
12
+ import { hasHelperText } from "../../internal/hasHelperText.js";
12
13
  import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
13
14
  import { AILabel } from "../AILabel/index.js";
14
15
  import Checkbox$1 from "../Checkbox/Checkbox.js";
@@ -38,7 +39,7 @@ const CheckboxGroup = ({ children, className, decorator, helperText, invalid, in
38
39
  });
39
40
  const showWarning = normalizedProps.warn;
40
41
  const showHelper = !normalizedProps.invalid && !normalizedProps.warn;
41
- const hasHelper = typeof helperText !== "undefined" && helperText !== null;
42
+ const hasHelper = hasHelperText(helperText);
42
43
  const helperId = !hasHelper ? void 0 : `checkbox-group-helper-text-${checkboxGroupInstanceId}`;
43
44
  const helper = hasHelper && /* @__PURE__ */ jsx("div", {
44
45
  id: helperId,
@@ -197,7 +197,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
197
197
  }
198
198
  type ComboboxComponentProps<ItemType> = PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>;
199
199
  export interface ComboBoxComponent {
200
- <ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement<any> | null;
200
+ <ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement | null;
201
201
  }
202
202
  declare const _default: ComboBoxComponent;
203
203
  export default _default;
@@ -351,7 +351,7 @@ const ComboBox = forwardRef((props, ref) => {
351
351
  selectedItem: newSelectedItem
352
352
  });
353
353
  if (isManualClearingRef.current) return;
354
- if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== "undefined" && !isEqual(selectedItemProp, newSelectedItem)) {
354
+ if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter || !allowCustomValue && type === InputBlur) && typeof newSelectedItem !== "undefined" && !isEqual(currentSelectedItem, newSelectedItem)) {
355
355
  if (items.some((item) => isEqual(item, newSelectedItem))) committedCustomValueRef.current = "";
356
356
  onChange({ selectedItem: newSelectedItem });
357
357
  }
@@ -38,8 +38,8 @@ const ComboButton = React.forwardRef(function ComboButton({ children, className,
38
38
  const id = useId("combobutton");
39
39
  const prefix = usePrefix();
40
40
  const containerRef = useRef(null);
41
- let middlewares = [];
42
- if (!enableOnlyFloatingStyles) middlewares = [flip({ crossAxis: false }), hide()];
41
+ const middlewares = [];
42
+ if (!enableOnlyFloatingStyles) middlewares.push(flip({ crossAxis: false }), hide());
43
43
  if (menuAlignment === "bottom" || menuAlignment === "top") middlewares.push(size({ apply({ rects, elements }) {
44
44
  Object.assign(elements.floating.style, { width: `${rects.reference.width}px` });
45
45
  } }));
@@ -11,7 +11,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
11
11
  /**
12
12
  * Pass in Switch components to be rendered in the ContentSwitcher
13
13
  */
14
- children?: ReactElement<any>[];
14
+ children?: ReactElement | ReactElement[];
15
15
  /**
16
16
  * Specify an optional className to be added to the container node
17
17
  */
@@ -7,15 +7,15 @@
7
7
 
8
8
  import { PrefixContext } from "../../internal/usePrefix.js";
9
9
  import { ArrowLeft, ArrowRight, Enter, Space } from "../../internal/keyboard/keys.js";
10
- import { matches } from "../../internal/keyboard/match.js";
10
+ import { match } from "../../internal/keyboard/match.js";
11
11
  import { getNextIndex } from "../../internal/keyboard/navigation.js";
12
12
  import { deprecate } from "../../prop-types/deprecate.js";
13
13
  import { isComponentElement } from "../../internal/utils.js";
14
- import { composeEventHandlers } from "../../tools/events.js";
15
14
  import { LayoutConstraint } from "../Layout/index.js";
15
+ import Switch from "../Switch/Switch.js";
16
16
  import IconSwitch from "../Switch/IconSwitch.js";
17
17
  import classNames from "classnames";
18
- import { Children, cloneElement, isValidElement, useContext, useEffect, useRef, useState } from "react";
18
+ import { Children, cloneElement, useContext, useEffect, useRef, useState } from "react";
19
19
  import PropTypes from "prop-types";
20
20
  import { jsx } from "react/jsx-runtime";
21
21
  //#region src/components/ContentSwitcher/ContentSwitcher.tsx
@@ -44,25 +44,25 @@ const ContentSwitcher = ({ children, className, light, lowContrast, selectedInde
44
44
  const ref = switchRefs.current[index];
45
45
  if (ref) ref.focus();
46
46
  };
47
- const isKeyboardEvent = (event) => event && typeof event === "object" && "key" in event;
47
+ const hasKey = (event) => typeof event === "object" && event !== null && "key" in event;
48
48
  const handleChildChange = (event) => {
49
49
  if (typeof event.index === "undefined") return;
50
50
  const { index } = event;
51
- if (isKeyboardEvent(event) && matches(event, [ArrowRight, ArrowLeft])) {
51
+ if (hasKey(event) && (match(event.key, ArrowRight) || match(event.key, ArrowLeft))) {
52
52
  const nextIndex = getNextIndex(event.key, index, childrenArray.length);
53
53
  if (typeof nextIndex !== "number") return;
54
54
  focusSwitch(nextIndex);
55
55
  if (selectionMode !== "manual") {
56
56
  const child = childrenArray[nextIndex];
57
57
  setSelectedIndex(nextIndex);
58
- if (isValidElement(child)) onChange({
58
+ if (isComponentElement(child, Switch) || isComponentElement(child, IconSwitch)) onChange({
59
59
  ...event,
60
60
  index: nextIndex,
61
61
  name: child.props.name,
62
62
  text: child.props.text
63
63
  });
64
64
  }
65
- } else if (selectedIndex !== index && (isKeyboardEvent(event) ? matches(event, [Enter, Space]) : true)) {
65
+ } else if (selectedIndex !== index && (hasKey(event) ? match(event.key, Enter) || match(event.key, Space) : true)) {
66
66
  setSelectedIndex(index);
67
67
  focusSwitch(index);
68
68
  onChange(event);
@@ -88,14 +88,23 @@ const ContentSwitcher = ({ children, className, light, lowContrast, selectedInde
88
88
  className: classes,
89
89
  role: "tablist",
90
90
  onChange: void 0,
91
- children: children && Children.map(children, (child, index) => cloneElement(child, {
92
- index,
93
- onClick: composeEventHandlers([handleChildChange, child.props.onClick]),
94
- onKeyDown: composeEventHandlers([handleChildChange, child.props.onKeyDown]),
95
- selected: index === selectedIndex,
96
- ref: handleItemRef(index),
97
- size
98
- }))
91
+ children: Children.map(children, (child, index) => {
92
+ if (!isComponentElement(child, Switch) && !isComponentElement(child, IconSwitch)) return child;
93
+ return cloneElement(child, {
94
+ index,
95
+ onClick: (event) => {
96
+ handleChildChange(event);
97
+ child.props.onClick?.(event);
98
+ },
99
+ onKeyDown: (event) => {
100
+ handleChildChange(event);
101
+ child.props.onKeyDown?.(event);
102
+ },
103
+ selected: index === selectedIndex,
104
+ ref: handleItemRef(index),
105
+ ...isComponentElement(child, IconSwitch) ? { size } : {}
106
+ });
107
+ })
99
108
  });
100
109
  };
101
110
  ContentSwitcher.displayName = "ContentSwitcher";
@@ -255,7 +255,7 @@ export declare const DataTable: {
255
255
  tabIndex: PropTypes.Requireable<number>;
256
256
  };
257
257
  };
258
- TableActionList: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
258
+ TableActionList: (props: import("react").HTMLAttributes<"div">) => ReactElement;
259
259
  TableBatchAction: {
260
260
  ({ renderIcon, iconDescription, ...props }: import("./TableBatchAction").TableBatchActionProps): import("react/jsx-runtime").JSX.Element;
261
261
  propTypes: {
@@ -332,7 +332,7 @@ export declare const DataTable: {
332
332
  colSpan: PropTypes.Validator<number>;
333
333
  };
334
334
  };
335
- TableHead: (props: import("react").HTMLAttributes<"thead">) => React.ReactElement<any>;
335
+ TableHead: (props: import("react").HTMLAttributes<"thead">) => ReactElement;
336
336
  TableHeader: import("react").ForwardRefExoticComponent<import("./TableHeader").TableHeaderProps & import("react").RefAttributes<HTMLTableCellElement>>;
337
337
  TableRow: import("react").ForwardRefExoticComponent<import("./TableRow").TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
338
338
  TableSelectAll: {
@@ -382,7 +382,7 @@ export declare const DataTable: {
382
382
  };
383
383
  };
384
384
  TableToolbarAction: import("react").ForwardRefExoticComponent<import("./TableToolbarAction").TableToolbarActionProps & import("react").RefAttributes<HTMLDivElement>>;
385
- TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
385
+ TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => ReactElement;
386
386
  TableToolbarSearch: {
387
387
  ({ className, searchContainerClass, onChange: onChangeProp, onClear, translateWithId: t, placeholder, labelText, expanded: expandedProp, defaultExpanded, defaultValue, disabled, onExpand, persistent, id, onBlur, onFocus, size, tabIndex, ...rest }: import("./TableToolbarSearch").TableToolbarSearchProps): import("react/jsx-runtime").JSX.Element;
388
388
  propTypes: {
@@ -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 TableActionList: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
7
+ declare const TableActionList: (props: import("react").HTMLAttributes<"div">) => import("react").ReactElement;
8
8
  export default TableActionList;
@@ -6,5 +6,5 @@
6
6
  */
7
7
  import { ThHTMLAttributes } from 'react';
8
8
  export type TableHeadProps = ThHTMLAttributes<HTMLTableSectionElement>;
9
- declare const TableHead: (props: import("react").HTMLAttributes<"thead">) => React.ReactElement<any>;
9
+ declare const TableHead: (props: import("react").HTMLAttributes<"thead">) => import("react").ReactElement;
10
10
  export default TableHead;
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2025
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
7
  import PropTypes from 'prop-types';
8
- import { ReactNode } from 'react';
8
+ import { type ReactNode } from 'react';
9
9
  export interface TableSlugRowProps {
10
10
  /**
11
11
  * The CSS class names of the cell that wraps the underlying input control
@@ -8,12 +8,12 @@
8
8
  import { usePrefix } from "../../internal/usePrefix.js";
9
9
  import { deprecateComponent } from "../../prop-types/deprecateComponent.js";
10
10
  import classNames from "classnames";
11
- import React, { useEffect } from "react";
11
+ import { cloneElement, isValidElement, useEffect } from "react";
12
12
  import PropTypes from "prop-types";
13
13
  import { jsx } from "react/jsx-runtime";
14
14
  //#region src/components/DataTable/TableSlugRow.tsx
15
15
  /**
16
- * Copyright IBM Corp. 2016, 2025
16
+ * Copyright IBM Corp. 2016, 2026
17
17
  *
18
18
  * This source code is licensed under the Apache-2.0 license found in the
19
19
  * LICENSE file in the root directory of this source tree.
@@ -23,16 +23,13 @@ const TableSlugRow = ({ className, slug }) => {
23
23
  deprecateComponent("TableSlugRow", "The `TableSlugRow` component has been deprecated and will be removed in the next major version. Use the TableDecoratorRow component instead.");
24
24
  }, []);
25
25
  const prefix = usePrefix();
26
- const TableSlugRowClasses = classNames({
27
- ...className && { [className]: true },
28
- [`${prefix}--table-column-slug`]: true,
29
- [`${prefix}--table-column-slug--active`]: slug
30
- });
31
- let normalizedSlug;
32
- if (slug) normalizedSlug = React.cloneElement(slug, { size: "mini" });
33
26
  return /* @__PURE__ */ jsx("td", {
34
- className: TableSlugRowClasses,
35
- children: normalizedSlug
27
+ className: classNames({
28
+ ...className && { [className]: true },
29
+ [`${prefix}--table-column-slug`]: true,
30
+ [`${prefix}--table-column-slug--active`]: slug
31
+ }),
32
+ children: isValidElement(slug) ? cloneElement(slug, { size: "mini" }) : void 0
36
33
  });
37
34
  };
38
35
  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: {
@@ -39,6 +39,7 @@ function initializeWeekdayShorthand() {
39
39
  });
40
40
  }
41
41
  const forEach = Array.prototype.forEach;
42
+ const defaultAriaDateFormat = "l, F j, Y";
42
43
  /**
43
44
  * @param {number} monthNumber The month number.
44
45
  * @param {boolean} shorthand `true` to use shorthand month.
@@ -164,7 +165,6 @@ const DatePicker = forwardRef((props, ref) => {
164
165
  const lastFocusedField = useRef(null);
165
166
  const savedOnChange = useSavedCallback(onChange);
166
167
  const savedOnOpen = useSavedCallback(onOpen);
167
- const effectiveWarn = warn && !invalid;
168
168
  const wrapperRef = useRef(null);
169
169
  const datePickerClasses = classNames(`${prefix}--date-picker`, {
170
170
  [`${prefix}--date-picker--short`]: short,
@@ -176,31 +176,35 @@ const DatePicker = forwardRef((props, ref) => {
176
176
  });
177
177
  const wrapperClasses = classNames(`${prefix}--form-item`, { [String(className)]: className });
178
178
  const childrenWithProps = React.Children.toArray(children).map((child, index) => {
179
+ const childInvalid = child.props?.invalid;
180
+ const childWarn = child.props?.warn;
181
+ const mergedInvalid = invalid ?? childInvalid;
182
+ const mergedWarn = mergedInvalid ? false : warn ?? childWarn;
179
183
  if (index === 0 && isComponentElement(child, DatePickerInput_default)) return React.cloneElement(child, {
180
184
  datePickerType,
181
185
  ref: startInputField,
182
186
  readOnly,
183
- invalid,
184
- warn: effectiveWarn
187
+ invalid: mergedInvalid,
188
+ warn: mergedWarn
185
189
  });
186
190
  if (index === 1 && isComponentElement(child, DatePickerInput_default)) return React.cloneElement(child, {
187
191
  datePickerType,
188
192
  ref: endInputField,
189
193
  readOnly,
190
- invalid,
191
- warn: effectiveWarn
194
+ invalid: mergedInvalid,
195
+ warn: mergedWarn
192
196
  });
193
197
  if (index === 0) return React.cloneElement(child, {
194
198
  ref: startInputField,
195
199
  readOnly,
196
- invalid,
197
- warn: effectiveWarn
200
+ invalid: mergedInvalid,
201
+ warn: mergedWarn
198
202
  });
199
203
  if (index === 1) return React.cloneElement(child, {
200
204
  ref: endInputField,
201
205
  readOnly,
202
- invalid,
203
- warn: effectiveWarn
206
+ invalid: mergedInvalid,
207
+ warn: mergedWarn
204
208
  });
205
209
  });
206
210
  useEffect(() => {
@@ -255,6 +259,7 @@ const DatePicker = forwardRef((props, ref) => {
255
259
  inline: inline ?? false,
256
260
  onClose: onCalendarClose,
257
261
  disableMobile: true,
262
+ ariaDateFormat: defaultAriaDateFormat,
258
263
  defaultDate: value,
259
264
  closeOnSelect,
260
265
  mode: datePickerType,
@@ -339,7 +344,6 @@ const DatePicker = forwardRef((props, ref) => {
339
344
  const { target } = event;
340
345
  if (target === start) lastStartValue.current = start.value;
341
346
  if (start.value !== "") return;
342
- if (!calendar.selectedDates) return;
343
347
  if (calendar.selectedDates.length === 0) return;
344
348
  }
345
349
  function handleKeyPress(event) {
@@ -421,9 +425,7 @@ const DatePicker = forwardRef((props, ref) => {
421
425
  }, [value, startInputField]);
422
426
  useEffect(() => {
423
427
  if (calendarRef.current?.set) {
424
- if (value !== void 0) if (value === "" || value === null || Array.isArray(value) && (value.length === 0 || value.every(isEmptyDateValue))) {
425
- if (calendarRef.current.selectedDates.length > 0) calendarRef.current.clear();
426
- } else calendarRef.current.setDate(value);
428
+ if (!isEmptyDateValue(value) && (!Array.isArray(value) || value.length > 0 && !value.every(isEmptyDateValue))) calendarRef.current.setDate(value);
427
429
  updateClassNames(calendarRef.current, prefix);
428
430
  } else if (!calendarRef.current && typeof value !== "undefined" && value !== null) startInputField.current.value = value;
429
431
  }, [
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { ArrowDown, ArrowLeft, ArrowRight, Enter } from "../../../internal/keyboard/keys.js";
8
+ import { ArrowDown, Enter } from "../../../internal/keyboard/keys.js";
9
9
  import { match } from "../../../internal/keyboard/match.js";
10
10
  //#region src/components/DatePicker/plugins/fixEventsPlugin.ts
11
11
  const fixEventsPlugin = (config) => (fp) => {
@@ -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 (match(event, ArrowLeft) || match(event, ArrowRight)) event.stopPropagation();
56
- else if (match(event, ArrowDown)) {
55
+ } else if (match(event, 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.
@@ -6,15 +6,17 @@
6
6
  */
7
7
 
8
8
  import { usePrefix } from "../../internal/usePrefix.js";
9
+ import { isComponentElement } from "../../internal/utils.js";
9
10
  import FluidTextInput_default from "../FluidTextInput/index.js";
11
+ import FluidTimePickerSelect_default from "../FluidTimePickerSelect/index.js";
10
12
  import classNames from "classnames";
11
- import React from "react";
13
+ import React, { cloneElement } from "react";
12
14
  import PropTypes from "prop-types";
13
15
  import { jsx, jsxs } from "react/jsx-runtime";
14
16
  import { WarningAltFilled, WarningFilled } from "@carbon/icons-react";
15
17
  //#region src/components/FluidTimePicker/FluidTimePicker.tsx
16
18
  /**
17
- * Copyright IBM Corp. 2022
19
+ * Copyright IBM Corp. 2022, 2026
18
20
  *
19
21
  * This source code is licensed under the Apache-2.0 license found in the
20
22
  * LICENSE file in the root directory of this source tree.
@@ -34,8 +36,8 @@ const FluidTimePicker = React.forwardRef(({ className, children, disabled, inval
34
36
  };
35
37
  const error = invalid || warn;
36
38
  const childrenWithProps = () => {
37
- if (disabled) return React.Children.toArray(children).map((child) => React.cloneElement(child, { disabled: true }));
38
- if (readOnly) return React.Children.toArray(children).map((child) => React.cloneElement(child, { readOnly: true }));
39
+ if (disabled) return React.Children.toArray(children).map((child) => isComponentElement(child, FluidTimePickerSelect_default) ? cloneElement(child, { disabled: true }) : child);
40
+ if (readOnly) return React.Children.toArray(children).map((child) => isComponentElement(child, FluidTimePickerSelect_default) ? cloneElement(child, { readOnly: true }) : child);
39
41
  return children;
40
42
  };
41
43
  return /* @__PURE__ */ 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;
@@ -31,7 +31,8 @@ FluidTimePickerSelect.propTypes = {
31
31
  disabled: PropTypes.bool,
32
32
  id: PropTypes.string.isRequired,
33
33
  labelText: PropTypes.node,
34
- onChange: PropTypes.func
34
+ onChange: PropTypes.func,
35
+ readOnly: PropTypes.bool
35
36
  };
36
37
  //#endregion
37
38
  export { FluidTimePickerSelect as default };
@@ -0,0 +1,18 @@
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
+ import FluidTimePickerSelect from "./FluidTimePickerSelect.js";
9
+ //#region src/components/FluidTimePickerSelect/index.tsx
10
+ /**
11
+ * Copyright IBM Corp. 2022
12
+ *
13
+ * This source code is licensed under the Apache-2.0 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */
16
+ var FluidTimePickerSelect_default = FluidTimePickerSelect;
17
+ //#endregion
18
+ export { FluidTimePickerSelect_default as default };
@@ -18,7 +18,7 @@ import { jsx } from "react/jsx-runtime";
18
18
  * This source code is licensed under the Apache-2.0 license found in the
19
19
  * LICENSE file in the root directory of this source tree.
20
20
  */
21
- const CSSGrid = React.forwardRef(({ align, as, children, className: customClassName, condensed = false, fullWidth = false, narrow = false, ...rest }, ref) => {
21
+ const CSSGrid = React.forwardRef(({ align, as, children, className: customClassName, condensed = false, fullWidth = false, narrow = false, withRowGap, ...rest }, ref) => {
22
22
  const prefix = usePrefix();
23
23
  const { subgrid } = useGridSettings();
24
24
  let mode = "wide";
@@ -32,6 +32,7 @@ const CSSGrid = React.forwardRef(({ align, as, children, className: customClassN
32
32
  as,
33
33
  className: customClassName,
34
34
  mode,
35
+ withRowGap,
35
36
  ...rest,
36
37
  children
37
38
  })
@@ -42,7 +43,8 @@ const CSSGrid = React.forwardRef(({ align, as, children, className: customClassN
42
43
  [`${prefix}--css-grid--narrow`]: mode === "narrow",
43
44
  [`${prefix}--css-grid--full-width`]: fullWidth,
44
45
  [`${prefix}--css-grid--start`]: align === "start",
45
- [`${prefix}--css-grid--end`]: align === "end"
46
+ [`${prefix}--css-grid--end`]: align === "end",
47
+ [`${prefix}--css-grid--with-row-gap`]: withRowGap
46
48
  });
47
49
  return /* @__PURE__ */ jsx(GridSettings, {
48
50
  mode: "css-grid",
@@ -66,15 +68,17 @@ CSSGrid.propTypes = {
66
68
  className: PropTypes.string,
67
69
  condensed: PropTypes.bool,
68
70
  fullWidth: PropTypes.bool,
69
- narrow: PropTypes.bool
71
+ narrow: PropTypes.bool,
72
+ withRowGap: PropTypes.bool
70
73
  };
71
- const Subgrid = React.forwardRef(({ as, className: customClassName, children, mode, ...rest }, ref) => {
74
+ const Subgrid = React.forwardRef(({ as, className: customClassName, children, mode, withRowGap, ...rest }, ref) => {
72
75
  const prefix = usePrefix();
73
76
  const className = classNames(customClassName, {
74
77
  [`${prefix}--subgrid`]: true,
75
78
  [`${prefix}--subgrid--condensed`]: mode === "condensed",
76
79
  [`${prefix}--subgrid--narrow`]: mode === "narrow",
77
- [`${prefix}--subgrid--wide`]: mode === "wide"
80
+ [`${prefix}--subgrid--wide`]: mode === "wide",
81
+ [`${prefix}--subgrid--with-row-gap`]: withRowGap
78
82
  });
79
83
  return /* @__PURE__ */ jsx(as || "div", {
80
84
  ...rest,
@@ -91,7 +95,8 @@ Subgrid.propTypes = {
91
95
  "wide",
92
96
  "narrow",
93
97
  "condensed"
94
- ])
98
+ ]),
99
+ withRowGap: PropTypes.bool
95
100
  };
96
101
  const CSSGridComponent = CSSGrid;
97
102
  //#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 };
@@ -12,7 +12,7 @@ import PropTypes from "prop-types";
12
12
  import { jsx } from "react/jsx-runtime";
13
13
  //#region src/components/Grid/ColumnHang.tsx
14
14
  /**
15
- * Copyright IBM Corp. 2016, 2023
15
+ * Copyright IBM Corp. 2016, 2026
16
16
  *
17
17
  * This source code is licensed under the Apache-2.0 license found in the
18
18
  * LICENSE file in the root directory of this source tree.