@carbon/react 1.81.0 → 1.82.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 (202) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +902 -902
  2. package/es/components/AILabel/index.d.ts +1 -1
  3. package/es/components/AILabel/index.js +2 -9
  4. package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  5. package/es/components/Breadcrumb/Breadcrumb.js +4 -4
  6. package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
  7. package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
  8. package/es/components/Button/Button.js +2 -10
  9. package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
  10. package/es/components/ButtonSet/ButtonSet.js +4 -4
  11. package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  12. package/es/components/CodeSnippet/CodeSnippet.js +3 -19
  13. package/es/components/ComboBox/ComboBox.d.ts +1 -1
  14. package/es/components/ComboBox/ComboBox.js +2 -2
  15. package/es/components/ComboButton/index.d.ts +1 -1
  16. package/es/components/ComboButton/index.js +2 -18
  17. package/es/components/ComposedModal/ComposedModal.js +5 -3
  18. package/es/components/Copy/Copy.d.ts +1 -1
  19. package/es/components/Copy/Copy.js +2 -18
  20. package/es/components/CopyButton/CopyButton.d.ts +1 -1
  21. package/es/components/CopyButton/CopyButton.js +2 -18
  22. package/es/components/DataTable/DataTable.d.ts +7 -12
  23. package/es/components/DataTable/DataTable.js +0 -5
  24. package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
  25. package/es/components/DataTable/TableToolbarAction.js +5 -4
  26. package/es/components/DataTable/tools/sorting.d.ts +42 -0
  27. package/es/components/DataTable/tools/sorting.js +24 -53
  28. package/es/components/DatePicker/DatePicker.d.ts +1 -1
  29. package/es/components/DatePicker/DatePicker.js +18 -18
  30. package/es/components/Dialog/index.d.ts +1 -1
  31. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
  32. package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
  33. package/es/components/Dropdown/Dropdown.d.ts +7 -6
  34. package/es/components/Dropdown/Dropdown.js +7 -3
  35. package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
  36. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  37. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  38. package/es/components/FileUploader/FileUploaderItem.js +1 -1
  39. package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
  40. package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
  41. package/es/components/IconButton/index.d.ts +1 -1
  42. package/es/components/IconButton/index.js +2 -18
  43. package/es/components/ListBox/ListBox.d.ts +4 -5
  44. package/es/components/ListBox/ListBox.js +8 -7
  45. package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
  46. package/es/components/ListBox/ListBoxMenu.js +4 -2
  47. package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
  48. package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
  49. package/es/components/ListBox/ListBoxPropTypes.js +3 -3
  50. package/es/components/ListBox/index.d.ts +7 -5
  51. package/es/components/ListBox/index.js +1 -1
  52. package/es/components/Menu/Menu.js +5 -0
  53. package/es/components/Modal/Modal.js +9 -9
  54. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
  55. package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
  56. package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
  57. package/es/components/MultiSelect/MultiSelect.js +3 -3
  58. package/es/components/Notification/Notification.js +1 -1
  59. package/es/components/OverflowMenu/OverflowMenu.js +2 -21
  60. package/es/components/OverflowMenu/next/index.js +2 -18
  61. package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
  62. package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
  63. package/es/components/PageHeader/PageHeader.d.ts +153 -8
  64. package/es/components/PageHeader/PageHeader.js +143 -21
  65. package/es/components/PageHeader/index.d.ts +2 -2
  66. package/es/components/PageHeader/index.js +1 -1
  67. package/es/components/Popover/index.js +4 -21
  68. package/es/components/Search/Search.d.ts +2 -5
  69. package/es/components/Search/Search.js +24 -8
  70. package/es/components/Stack/HStack.d.ts +2 -3
  71. package/es/components/Stack/HStack.js +4 -7
  72. package/es/components/Stack/Stack.d.ts +3 -4
  73. package/es/components/Stack/Stack.js +3 -6
  74. package/es/components/Stack/VStack.d.ts +2 -3
  75. package/es/components/Stack/VStack.js +3 -2
  76. package/es/components/Stack/index.d.ts +4 -4
  77. package/es/components/TextArea/TextArea.js +3 -5
  78. package/es/components/TimePicker/TimePicker.d.ts +3 -4
  79. package/es/components/TimePicker/TimePicker.js +5 -4
  80. package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
  81. package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
  82. package/es/components/TreeView/TreeNode.js +13 -1
  83. package/es/components/TreeView/TreeView.js +1 -1
  84. package/es/index.js +1 -1
  85. package/es/internal/FloatingMenu.js +9 -5
  86. package/es/internal/environment.js +7 -0
  87. package/es/internal/keyboard/navigation.d.ts +0 -10
  88. package/es/internal/keyboard/navigation.js +1 -13
  89. package/es/internal/useId.js +1 -1
  90. package/es/internal/useNoInteractiveChildren.js +7 -0
  91. package/es/internal/useOutsideClick.js +3 -0
  92. package/es/internal/wrapFocus.d.ts +49 -0
  93. package/es/internal/wrapFocus.js +64 -51
  94. package/es/tools/events.d.ts +17 -0
  95. package/es/tools/events.js +10 -13
  96. package/es/tools/mapPopoverAlign.d.ts +15 -0
  97. package/es/tools/mapPopoverAlign.js +28 -0
  98. package/es/tools/uniqueId.d.ts +7 -0
  99. package/es/tools/uniqueId.js +3 -3
  100. package/es/types/common.d.ts +0 -2
  101. package/lib/components/AILabel/index.d.ts +1 -1
  102. package/lib/components/AILabel/index.js +2 -9
  103. package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  104. package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
  105. package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
  106. package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
  107. package/lib/components/Button/Button.js +1 -9
  108. package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
  109. package/lib/components/ButtonSet/ButtonSet.js +3 -3
  110. package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  111. package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
  112. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  113. package/lib/components/ComboBox/ComboBox.js +1 -1
  114. package/lib/components/ComboButton/index.d.ts +1 -1
  115. package/lib/components/ComboButton/index.js +2 -18
  116. package/lib/components/ComposedModal/ComposedModal.js +5 -3
  117. package/lib/components/Copy/Copy.d.ts +1 -1
  118. package/lib/components/Copy/Copy.js +2 -18
  119. package/lib/components/CopyButton/CopyButton.d.ts +1 -1
  120. package/lib/components/CopyButton/CopyButton.js +2 -18
  121. package/lib/components/DataTable/DataTable.d.ts +7 -12
  122. package/lib/components/DataTable/DataTable.js +0 -5
  123. package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
  124. package/lib/components/DataTable/TableToolbarAction.js +4 -3
  125. package/lib/components/DataTable/tools/sorting.d.ts +42 -0
  126. package/lib/components/DataTable/tools/sorting.js +23 -53
  127. package/lib/components/DatePicker/DatePicker.d.ts +1 -1
  128. package/lib/components/DatePicker/DatePicker.js +18 -18
  129. package/lib/components/Dialog/index.d.ts +1 -1
  130. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
  131. package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
  132. package/lib/components/Dropdown/Dropdown.d.ts +7 -6
  133. package/lib/components/Dropdown/Dropdown.js +6 -2
  134. package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
  135. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  136. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  137. package/lib/components/FileUploader/FileUploaderItem.js +1 -1
  138. package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
  139. package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
  140. package/lib/components/IconButton/index.d.ts +1 -1
  141. package/lib/components/IconButton/index.js +2 -18
  142. package/lib/components/ListBox/ListBox.d.ts +4 -5
  143. package/lib/components/ListBox/ListBox.js +7 -6
  144. package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
  145. package/lib/components/ListBox/ListBoxMenu.js +3 -1
  146. package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
  147. package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
  148. package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
  149. package/lib/components/ListBox/index.d.ts +7 -5
  150. package/lib/components/ListBox/index.js +2 -2
  151. package/lib/components/Menu/Menu.js +5 -0
  152. package/lib/components/Modal/Modal.js +9 -9
  153. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
  154. package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
  155. package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
  156. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  157. package/lib/components/Notification/Notification.js +1 -1
  158. package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
  159. package/lib/components/OverflowMenu/next/index.js +2 -18
  160. package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
  161. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
  162. package/lib/components/PageHeader/PageHeader.d.ts +153 -8
  163. package/lib/components/PageHeader/PageHeader.js +145 -19
  164. package/lib/components/PageHeader/index.d.ts +2 -2
  165. package/lib/components/PageHeader/index.js +4 -0
  166. package/lib/components/Popover/index.js +4 -21
  167. package/lib/components/Search/Search.d.ts +2 -5
  168. package/lib/components/Search/Search.js +24 -8
  169. package/lib/components/Stack/HStack.d.ts +2 -3
  170. package/lib/components/Stack/HStack.js +3 -6
  171. package/lib/components/Stack/Stack.d.ts +3 -4
  172. package/lib/components/Stack/Stack.js +2 -5
  173. package/lib/components/Stack/VStack.d.ts +2 -3
  174. package/lib/components/Stack/VStack.js +2 -1
  175. package/lib/components/Stack/index.d.ts +4 -4
  176. package/lib/components/TextArea/TextArea.js +2 -4
  177. package/lib/components/TimePicker/TimePicker.d.ts +3 -4
  178. package/lib/components/TimePicker/TimePicker.js +4 -3
  179. package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
  180. package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
  181. package/lib/components/TreeView/TreeNode.js +13 -1
  182. package/lib/components/TreeView/TreeView.js +1 -1
  183. package/lib/index.js +2 -2
  184. package/lib/internal/FloatingMenu.js +9 -5
  185. package/lib/internal/environment.js +7 -0
  186. package/lib/internal/keyboard/navigation.d.ts +0 -10
  187. package/lib/internal/keyboard/navigation.js +0 -14
  188. package/lib/internal/useNoInteractiveChildren.js +7 -0
  189. package/lib/internal/useOutsideClick.js +3 -0
  190. package/lib/internal/wrapFocus.d.ts +49 -0
  191. package/lib/internal/wrapFocus.js +66 -53
  192. package/lib/tools/events.d.ts +17 -0
  193. package/lib/tools/events.js +10 -13
  194. package/lib/tools/mapPopoverAlign.d.ts +15 -0
  195. package/lib/tools/mapPopoverAlign.js +32 -0
  196. package/lib/tools/uniqueId.d.ts +7 -0
  197. package/lib/tools/uniqueId.js +3 -3
  198. package/lib/types/common.d.ts +0 -2
  199. package/package.json +7 -7
  200. package/telemetry.yml +3 -1
  201. package/es/tools/createPropAdapter.js +0 -40
  202. package/lib/tools/createPropAdapter.js +0 -44
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -9,6 +9,6 @@ declare const listBoxTypes: readonly ["default", "inline"];
9
9
  declare const listBoxSizes: readonly ["sm", "md", "lg"];
10
10
  export type ListBoxType = (typeof listBoxTypes)[number];
11
11
  export type ListBoxSize = (typeof listBoxSizes)[number];
12
- export declare const ListBoxType: PropTypes.Requireable<"default" | "inline">;
13
- export declare const ListBoxSize: PropTypes.Requireable<"sm" | "md" | "lg">;
12
+ export declare const ListBoxTypePropType: PropTypes.Requireable<"default" | "inline">;
13
+ export declare const ListBoxSizePropType: PropTypes.Requireable<"sm" | "md" | "lg">;
14
14
  export {};
@@ -17,8 +17,8 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
17
17
 
18
18
  const listBoxTypes = ['default', 'inline'];
19
19
  const listBoxSizes = ['sm', 'md', 'lg'];
20
- const ListBoxType = PropTypes__default["default"].oneOf(listBoxTypes);
21
- const ListBoxSize = PropTypes__default["default"].oneOf(listBoxSizes);
20
+ const ListBoxTypePropType = PropTypes__default["default"].oneOf(listBoxTypes);
21
+ const ListBoxSizePropType = PropTypes__default["default"].oneOf(listBoxSizes);
22
22
 
23
- exports.ListBoxSize = ListBoxSize;
24
- exports.ListBoxType = ListBoxType;
23
+ exports.ListBoxSizePropType = ListBoxSizePropType;
24
+ exports.ListBoxTypePropType = ListBoxTypePropType;
@@ -1,17 +1,19 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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
- export * as PropTypes from './ListBoxPropTypes';
8
7
  export * from './ListBoxPropTypes';
9
- import { ListBoxComponent as ListBoxPartialComponent } from './ListBox';
8
+ import ListBoxInternal from './ListBox';
10
9
  import { ListBoxFieldComponent } from './ListBoxField';
11
- import { ListBoxMenuComponent } from './ListBoxMenu';
10
+ import ListBoxMenu from './ListBoxMenu';
12
11
  import { ListBoxMenuIconComponent } from './ListBoxMenuIcon';
13
- import { ListBoxMenuItemComponent } from './ListBoxMenuItem';
12
+ import ListBoxMenuItem from './ListBoxMenuItem';
14
13
  import { ListBoxSelectionComponent } from './ListBoxSelection';
14
+ type ListBoxMenuComponent = typeof ListBoxMenu;
15
+ type ListBoxMenuItemComponent = typeof ListBoxMenuItem;
16
+ type ListBoxPartialComponent = typeof ListBoxInternal;
15
17
  export interface ListBoxComponent extends ListBoxPartialComponent {
16
18
  readonly Field: ListBoxFieldComponent;
17
19
  readonly Menu: ListBoxMenuComponent;
@@ -25,6 +25,6 @@ const ListBox = Object.assign(ListBox$1["default"], {
25
25
  Selection: ListBoxSelection["default"]
26
26
  });
27
27
 
28
- exports.ListBoxSize = ListBoxPropTypes.ListBoxSize;
29
- exports.ListBoxType = ListBoxPropTypes.ListBoxType;
28
+ exports.ListBoxSizePropType = ListBoxPropTypes.ListBoxSizePropType;
29
+ exports.ListBoxTypePropType = ListBoxPropTypes.ListBoxTypePropType;
30
30
  exports["default"] = ListBox;
@@ -44,7 +44,12 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
44
44
  open,
45
45
  size = 'sm',
46
46
  legacyAutoalign = 'true',
47
+ // TODO: `ssr-friendly` doesn't support ESLint v9.
48
+ // https://github.com/kopiro/eslint-plugin-ssr-friendly/issues/30
49
+ // https://github.com/carbon-design-system/carbon/issues/18991
50
+ /*
47
51
  // eslint-disable-next-line ssr-friendly/no-dom-globals-in-react-fc
52
+ */
48
53
  target = environment.canUseDOM && document.body,
49
54
  x = 0,
50
55
  y = 0,
@@ -109,28 +109,28 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
109
109
  target
110
110
  } = evt;
111
111
  evt.stopPropagation();
112
- if (open) {
112
+ if (open && target instanceof HTMLElement) {
113
113
  if (match.match(evt, keys.Escape)) {
114
114
  onRequestClose(evt);
115
115
  }
116
- if (match.match(evt, keys.Enter) && shouldSubmitOnEnter && target instanceof Element && !isCloseButton(target) && document.activeElement !== button.current) {
116
+ if (match.match(evt, keys.Enter) && shouldSubmitOnEnter && !isCloseButton(target) && document.activeElement !== button.current) {
117
117
  onRequestSubmit(evt);
118
118
  }
119
119
  if (focusTrapWithoutSentinels && !enableDialogElement && match.match(evt, keys.Tab) && innerModal.current) {
120
120
  wrapFocus.wrapFocusWithoutSentinels({
121
121
  containerNode: innerModal.current,
122
- currentActiveNode: evt.target,
123
- // TODO: Delete type assertion following util rewrite.
124
- // https://github.com/carbon-design-system/carbon/pull/18913
122
+ currentActiveNode: target,
125
123
  event: evt
126
124
  });
127
125
  }
128
126
  }
129
127
  }
130
128
  function handleOnClick(evt) {
131
- const target = evt.target;
129
+ const {
130
+ target
131
+ } = evt;
132
132
  evt.stopPropagation();
133
- if (!preventCloseOnClickOutside && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target)) {
133
+ if (!preventCloseOnClickOutside && target instanceof Node && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target)) {
134
134
  onRequestClose(evt);
135
135
  }
136
136
  }
@@ -139,7 +139,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
139
139
  target: oldActiveNode,
140
140
  relatedTarget: currentActiveNode
141
141
  } = _ref2;
142
- if (open && currentActiveNode && oldActiveNode) {
142
+ if (open && oldActiveNode instanceof HTMLElement && currentActiveNode instanceof HTMLElement) {
143
143
  const {
144
144
  current: bodyNode
145
145
  } = innerModal;
@@ -149,7 +149,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
149
149
  const {
150
150
  current: endTrapNode
151
151
  } = endTrap;
152
- wrapFocus["default"]({
152
+ wrapFocus.wrapFocus({
153
153
  bodyNode,
154
154
  startTrapNode,
155
155
  endTrapNode,
@@ -7,6 +7,7 @@
7
7
  import { type UseComboboxProps, type UseMultipleSelectionProps } from 'downshift';
8
8
  import React, { ReactNode, FunctionComponent, ReactElement } from 'react';
9
9
  import { type MultiSelectSortingProps } from './MultiSelectPropTypes';
10
+ import { type ListBoxSize, type ListBoxType } from '../ListBox';
10
11
  import { TranslateWithId } from '../../types/common';
11
12
  /**
12
13
  * Message ids that will be passed to translateWithId().
@@ -166,7 +167,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
166
167
  * Specify the size of the ListBox.
167
168
  * Currently, supports either `sm`, `md` or `lg` as an option.
168
169
  */
169
- size?: 'sm' | 'md' | 'lg';
170
+ size?: ListBoxSize;
170
171
  /**
171
172
  * @deprecated please use decorator instead.
172
173
  * **Experimental**: Provide a `Slug` component to be rendered inside the `Checkbox` component
@@ -177,7 +178,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
177
178
  * combobox via ARIA attributes.
178
179
  */
179
180
  titleText?: ReactNode;
180
- type?: 'default' | 'inline';
181
+ type?: ListBoxType;
181
182
  /**
182
183
  * Specify title to show title on hover
183
184
  */
@@ -787,7 +787,7 @@ FilterableMultiSelect.propTypes = {
787
787
  /**
788
788
  * Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
789
789
  */
790
- size: ListBoxPropTypes.ListBoxSize,
790
+ size: ListBoxPropTypes.ListBoxSizePropType,
791
791
  slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
792
792
  ...MultiSelectPropTypes.sortingPropTypes,
793
793
  /**
@@ -799,6 +799,7 @@ FilterableMultiSelect.propTypes = {
799
799
  * Callback function for translating ListBoxMenuIcon SVG title
800
800
  */
801
801
  translateWithId: PropTypes__default["default"].func,
802
+ type: ListBoxPropTypes.ListBoxTypePropType,
802
803
  /**
803
804
  * Specify title to show title on hover
804
805
  */
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { UseSelectProps } from 'downshift';
8
8
  import React, { ReactNode } from 'react';
9
- import { ListBoxSize, ListBoxType } from '../ListBox';
9
+ import { type ListBoxSize, type ListBoxType } from '../ListBox';
10
10
  import { MultiSelectSortingProps } from './MultiSelectPropTypes';
11
11
  import { ListBoxProps } from '../ListBox/ListBox';
12
12
  import type { TranslateWithId } from '../../types/common';
@@ -173,5 +173,11 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
173
173
  */
174
174
  warnText?: ReactNode;
175
175
  }
176
- export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<unknown> & React.RefAttributes<HTMLButtonElement>>;
176
+ export declare const MultiSelect: MultiSelectComponent;
177
+ type MultiSelectComponentProps<ItemType> = React.PropsWithChildren<MultiSelectProps<ItemType>> & React.RefAttributes<HTMLButtonElement>;
178
+ interface MultiSelectComponent {
179
+ propTypes: Record<string, any>;
180
+ displayName: string;
181
+ <ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement<any> | null;
182
+ }
177
183
  export {};
@@ -680,7 +680,7 @@ MultiSelect.propTypes = {
680
680
  /**
681
681
  * Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
682
682
  */
683
- size: ListBoxPropTypes.ListBoxSize,
683
+ size: ListBoxPropTypes.ListBoxSizePropType,
684
684
  slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
685
685
  /**
686
686
  * Provide a method that sorts all options in the control. Overriding this
@@ -715,7 +715,7 @@ MultiSelect.propTypes = {
715
715
  /**
716
716
  * Specify 'inline' to create an inline multi-select.
717
717
  */
718
- type: PropTypes__default["default"].oneOf(['default', 'inline']),
718
+ type: ListBoxPropTypes.ListBoxTypePropType,
719
719
  /**
720
720
  * Specify title to show title on hover
721
721
  */
@@ -543,7 +543,7 @@ function ActionableNotification(_ref6) {
543
543
  const {
544
544
  current: endTrapNode
545
545
  } = endTrap;
546
- wrapFocus["default"]({
546
+ wrapFocus.wrapFocus({
547
547
  bodyNode,
548
548
  startTrapNode,
549
549
  endTrapNode,
@@ -26,6 +26,7 @@ var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
26
26
  var index = require('../IconButton/index.js');
27
27
  var useOutsideClick = require('../../internal/useOutsideClick.js');
28
28
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
29
+ var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
29
30
 
30
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
32
 
@@ -101,22 +102,6 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
101
102
  };
102
103
  }
103
104
  };
104
-
105
- // TODO: Replace this code when align mapping is consolidated.
106
- // https://github.com/carbon-design-system/carbon/pull/19081
107
- const propMappingFunction = deprecatedValue => {
108
- const mapping = {
109
- 'top-left': 'top-start',
110
- 'top-right': 'top-end',
111
- 'bottom-left': 'bottom-start',
112
- 'bottom-right': 'bottom-end',
113
- 'left-bottom': 'left-end',
114
- 'left-top': 'left-start',
115
- 'right-bottom': 'right-end',
116
- 'right-top': 'right-start'
117
- };
118
- return mapping[deprecatedValue];
119
- };
120
105
  const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
121
106
  let {
122
107
  align,
@@ -396,11 +381,7 @@ OverflowMenu.propTypes = {
396
381
  // deprecated use right-start instead
397
382
 
398
383
  // new values to match floating-ui
399
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
400
- //allowed prop values
401
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
402
- //optional mapper function
403
- propMappingFunction),
384
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
404
385
  /**
405
386
  * Specify a label to be read by screen readers on the container node
406
387
  */
@@ -24,6 +24,7 @@ var useId = require('../../../internal/useId.js');
24
24
  var usePrefix = require('../../../internal/usePrefix.js');
25
25
  var useAttachedMenu = require('../../../internal/useAttachedMenu.js');
26
26
  var deprecateValuesWithin = require('../../../prop-types/deprecateValuesWithin.js');
27
+ var mapPopoverAlign = require('../../../tools/mapPopoverAlign.js');
27
28
 
28
29
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
30
 
@@ -32,19 +33,6 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
32
33
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
33
34
 
34
35
  const defaultSize = 'md';
35
- const propMappingFunction = deprecatedValue => {
36
- const mapping = {
37
- 'top-left': 'top-start',
38
- 'top-right': 'top-end',
39
- 'bottom-left': 'bottom-start',
40
- 'bottom-right': 'bottom-end',
41
- 'left-bottom': 'left-end',
42
- 'left-top': 'left-start',
43
- 'right-bottom': 'right-end',
44
- 'right-top': 'right-start'
45
- };
46
- return mapping[deprecatedValue];
47
- };
48
36
  const OverflowMenu = /*#__PURE__*/React__default["default"].forwardRef(function OverflowMenu(_ref, forwardRef) {
49
37
  let {
50
38
  autoAlign = false,
@@ -206,11 +194,7 @@ OverflowMenu.propTypes = {
206
194
  // deprecated use right-start instead
207
195
 
208
196
  // new values to match floating-ui
209
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
210
- //allowed prop values
211
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
212
- //optional mapper function
213
- propMappingFunction),
197
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
214
198
  /**
215
199
  * Specify a DOM node where the Menu should be rendered in. Defaults to document.body.
216
200
  */
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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 React from 'react';
8
- import { ForwardRefReturn } from '../../types/common';
9
8
  export interface OverflowMenuItemProps extends React.HTMLAttributes<HTMLElement> {
10
9
  /**
11
10
  * The CSS class name to be placed on the button element
@@ -57,6 +56,5 @@ export interface OverflowMenuItemProps extends React.HTMLAttributes<HTMLElement>
57
56
  */
58
57
  wrapperClassName?: string;
59
58
  }
60
- export type OverflowMenuItemComponent = ForwardRefReturn<HTMLElement, OverflowMenuItemProps>;
61
- declare const OverflowMenuItem: OverflowMenuItemComponent;
59
+ declare const OverflowMenuItem: React.ForwardRefExoticComponent<Omit<OverflowMenuItemProps, "ref"> & React.RefAttributes<HTMLElement>>;
62
60
  export default OverflowMenuItem;
@@ -26,8 +26,9 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
26
26
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
27
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
 
29
- const OverflowMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function OverflowMenuItem(_ref, ref) {
30
- let {
29
+ const frFn = React.forwardRef;
30
+ const OverflowMenuItem = frFn((props, ref) => {
31
+ const {
31
32
  className,
32
33
  closeMenu,
33
34
  disabled = false,
@@ -43,7 +44,7 @@ const OverflowMenuItem = /*#__PURE__*/React__default["default"].forwardRef(funct
43
44
  title,
44
45
  wrapperClassName,
45
46
  ...rest
46
- } = _ref;
47
+ } = props;
47
48
  const prefix = usePrefix.usePrefix();
48
49
  function setTabFocus(evt) {
49
50
  if (match.match(evt, keys.ArrowDown)) {
@@ -5,6 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React, { type ComponentType, type FunctionComponent } from 'react';
8
+ import PropTypes from 'prop-types';
8
9
  import { Tabs as BaseTabs } from '../Tabs/Tabs';
9
10
  /**
10
11
  * ----------
@@ -48,10 +49,6 @@ interface PageHeaderContentProps {
48
49
  * The PageHeaderContent's title
49
50
  */
50
51
  title: string;
51
- /**
52
- * The PageHeaderContent's subtitle
53
- */
54
- subtitle?: string;
55
52
  /**
56
53
  * The PageHeaderContent's contextual actions
57
54
  */
@@ -62,6 +59,88 @@ interface PageHeaderContentProps {
62
59
  pageActions?: React.ReactNode;
63
60
  }
64
61
  declare const PageHeaderContent: React.ForwardRefExoticComponent<PageHeaderContentProps & React.RefAttributes<HTMLDivElement>>;
62
+ /**
63
+ * ----------------
64
+ * PageHeaderContentPageActions
65
+ * ----------------
66
+ */
67
+ interface PageHeaderContentPageActionsProps {
68
+ /**
69
+ * Provide child elements to be rendered inside PageHeaderContentPageActions.
70
+ */
71
+ children?: React.ReactNode;
72
+ /**
73
+ * Specify an optional className to be added to your PageHeaderContentPageActions
74
+ */
75
+ className?: string;
76
+ /**
77
+ * The PageHeaderContent's page actions collapsible Menu button label
78
+ */
79
+ menuButtonLabel?: string;
80
+ /**
81
+ * The PageHeaderContent's page actions
82
+ */
83
+ pageActions?: React.ReactNode;
84
+ }
85
+ declare const PageHeaderContentPageActions: {
86
+ ({ className, children, menuButtonLabel, pageActions, ...other }: PageHeaderContentPageActionsProps): import("react/jsx-runtime").JSX.Element;
87
+ displayName: string;
88
+ propTypes: {
89
+ /**
90
+ * Provide child elements to be rendered inside PageHeaderContentPageActions.
91
+ */
92
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
93
+ /**
94
+ * Specify an optional className to be added to your PageHeaderContentPageActions
95
+ */
96
+ className: PropTypes.Requireable<string>;
97
+ /**
98
+ * The PageHeaderContent's collapsible Menu button label
99
+ */
100
+ menuButtonLabel: PropTypes.Requireable<string>;
101
+ /**
102
+ * The PageHeaderContent's page actions
103
+ */
104
+ pageActions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
105
+ };
106
+ };
107
+ /**
108
+ * ----------------
109
+ * PageHeaderContentText
110
+ * ----------------
111
+ */
112
+ interface PageHeaderContentTextProps {
113
+ /**
114
+ * Provide child elements to be rendered inside PageHeaderContentText.
115
+ */
116
+ children?: React.ReactNode;
117
+ /**
118
+ * Specify an optional className to be added to your PageHeaderContentText
119
+ */
120
+ className?: string;
121
+ /**
122
+ * The PageHeaderContent's subtitle
123
+ */
124
+ subtitle?: string;
125
+ }
126
+ declare const PageHeaderContentText: {
127
+ ({ className, children, subtitle, ...other }: PageHeaderContentTextProps): import("react/jsx-runtime").JSX.Element;
128
+ displayName: string;
129
+ propTypes: {
130
+ /**
131
+ * Provide child elements to be rendered inside PageHeaderContentText.
132
+ */
133
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
134
+ /**
135
+ * Specify an optional className to be added to your PageHeaderContentText
136
+ */
137
+ className: PropTypes.Requireable<string>;
138
+ /**
139
+ * The PageHeaderContent's subtitle
140
+ */
141
+ subtitle: PropTypes.Requireable<string>;
142
+ };
143
+ };
65
144
  /**
66
145
  * ----------------
67
146
  * PageHeaderHeroImage
@@ -77,7 +156,20 @@ interface PageHeaderHeroImageProps {
77
156
  */
78
157
  className?: string;
79
158
  }
80
- declare const PageHeaderHeroImage: React.ForwardRefExoticComponent<PageHeaderHeroImageProps & React.RefAttributes<HTMLDivElement>>;
159
+ declare const PageHeaderHeroImage: {
160
+ ({ className, children, ...other }: PageHeaderHeroImageProps): import("react/jsx-runtime").JSX.Element;
161
+ displayName: string;
162
+ propTypes: {
163
+ /**
164
+ * Provide child elements to be rendered inside PageHeaderHeroImage.
165
+ */
166
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
167
+ /**
168
+ * Specify an optional className to be added to your PageHeaderHeroImage
169
+ */
170
+ className: PropTypes.Requireable<string>;
171
+ };
172
+ };
81
173
  /**
82
174
  * ----------------
83
175
  * PageHeaderTabBar
@@ -101,8 +193,61 @@ declare const PageHeaderTabs: React.ForwardRefExoticComponent<PageHeaderTabsProp
101
193
  declare const Root: React.ForwardRefExoticComponent<PageHeaderProps & React.RefAttributes<HTMLDivElement>>;
102
194
  declare const BreadcrumbBar: React.ForwardRefExoticComponent<PageHeaderBreadcrumbBarProps & React.RefAttributes<HTMLDivElement>>;
103
195
  declare const Content: React.ForwardRefExoticComponent<PageHeaderContentProps & React.RefAttributes<HTMLDivElement>>;
104
- declare const HeroImage: React.ForwardRefExoticComponent<PageHeaderHeroImageProps & React.RefAttributes<HTMLDivElement>>;
196
+ declare const ContentPageActions: {
197
+ ({ className, children, menuButtonLabel, pageActions, ...other }: PageHeaderContentPageActionsProps): import("react/jsx-runtime").JSX.Element;
198
+ displayName: string;
199
+ propTypes: {
200
+ /**
201
+ * Provide child elements to be rendered inside PageHeaderContentPageActions.
202
+ */
203
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
204
+ /**
205
+ * Specify an optional className to be added to your PageHeaderContentPageActions
206
+ */
207
+ className: PropTypes.Requireable<string>;
208
+ /**
209
+ * The PageHeaderContent's collapsible Menu button label
210
+ */
211
+ menuButtonLabel: PropTypes.Requireable<string>;
212
+ /**
213
+ * The PageHeaderContent's page actions
214
+ */
215
+ pageActions: PropTypes.Requireable<NonNullable<any[] | PropTypes.ReactNodeLike>>;
216
+ };
217
+ };
218
+ declare const ContentText: {
219
+ ({ className, children, subtitle, ...other }: PageHeaderContentTextProps): import("react/jsx-runtime").JSX.Element;
220
+ displayName: string;
221
+ propTypes: {
222
+ /**
223
+ * Provide child elements to be rendered inside PageHeaderContentText.
224
+ */
225
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
226
+ /**
227
+ * Specify an optional className to be added to your PageHeaderContentText
228
+ */
229
+ className: PropTypes.Requireable<string>;
230
+ /**
231
+ * The PageHeaderContent's subtitle
232
+ */
233
+ subtitle: PropTypes.Requireable<string>;
234
+ };
235
+ };
236
+ declare const HeroImage: {
237
+ ({ className, children, ...other }: PageHeaderHeroImageProps): import("react/jsx-runtime").JSX.Element;
238
+ displayName: string;
239
+ propTypes: {
240
+ /**
241
+ * Provide child elements to be rendered inside PageHeaderHeroImage.
242
+ */
243
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
244
+ /**
245
+ * Specify an optional className to be added to your PageHeaderHeroImage
246
+ */
247
+ className: PropTypes.Requireable<string>;
248
+ };
249
+ };
105
250
  declare const TabBar: React.ForwardRefExoticComponent<PageHeaderTabBarProps & React.RefAttributes<HTMLDivElement>>;
106
251
  declare const Tabs: React.ForwardRefExoticComponent<PageHeaderTabsProps & React.RefAttributes<HTMLDivElement>>;
107
- export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderHeroImage, PageHeaderTabBar, PageHeaderTabs, Root, BreadcrumbBar, Content, HeroImage, TabBar, Tabs, };
108
- export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderHeroImageProps, PageHeaderTabBarProps, PageHeaderTabsProps, };
252
+ export { PageHeader, PageHeaderBreadcrumbBar, PageHeaderContent, PageHeaderContentPageActions, PageHeaderContentText, PageHeaderHeroImage, PageHeaderTabBar, PageHeaderTabs, Root, BreadcrumbBar, Content, ContentPageActions, ContentText, HeroImage, TabBar, Tabs, };
253
+ export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderContentPageActionsProps, PageHeaderContentTextProps, PageHeaderHeroImageProps, PageHeaderTabBarProps, PageHeaderTabsProps, };