@carbon/react 1.79.0 → 1.80.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 (157) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +835 -779
  2. package/es/components/CodeSnippet/CodeSnippet.js +1 -1
  3. package/es/components/ComposedModal/ComposedModal.d.ts +6 -0
  4. package/es/components/ComposedModal/ModalFooter.d.ts +6 -0
  5. package/es/components/ContainedList/index.js +1 -1
  6. package/es/components/DataTable/DataTable.d.ts +3 -1
  7. package/es/components/DatePicker/DatePicker.d.ts +1 -1
  8. package/es/components/DatePicker/DatePicker.js +1 -1
  9. package/es/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +6 -0
  10. package/es/components/InlineLoading/InlineLoading.js +10 -2
  11. package/es/components/Layer/LayerLevel.d.ts +6 -0
  12. package/es/components/Menu/Menu.d.ts +1 -1
  13. package/es/components/Menu/MenuItem.d.ts +4 -4
  14. package/es/components/Menu/MenuItem.js +1 -1
  15. package/es/components/Modal/Modal.js +1 -1
  16. package/es/components/ModalWrapper/ModalWrapper.d.ts +1 -1
  17. package/es/components/ModalWrapper/ModalWrapper.js +2 -1
  18. package/es/components/Notification/Notification.js +1 -1
  19. package/es/components/NumberInput/NumberInput.d.ts +1 -1
  20. package/es/components/OverflowMenu/OverflowMenu.js +3 -3
  21. package/es/components/OverflowMenuItem/OverflowMenuItem.js +1 -3
  22. package/es/components/OverflowMenuV2/index.js +1 -1
  23. package/es/components/PageHeader/PageHeader.d.ts +101 -0
  24. package/es/components/PageHeader/PageHeader.js +241 -0
  25. package/es/components/PageHeader/index.d.ts +8 -0
  26. package/es/components/PageHeader/index.js +8 -0
  27. package/es/components/PasswordInput/index.d.ts +6 -0
  28. package/es/components/Popover/index.js +1 -1
  29. package/es/components/Slider/SliderHandles.d.ts +6 -0
  30. package/es/components/Tag/DismissibleTag.d.ts +1 -55
  31. package/es/components/Tag/DismissibleTag.js +6 -4
  32. package/es/components/Tag/OperationalTag.d.ts +1 -1
  33. package/es/components/Tag/SelectableTag.d.ts +1 -43
  34. package/es/components/Tag/SelectableTag.js +7 -5
  35. package/es/components/Tag/Tag.js +2 -2
  36. package/es/components/Text/createTextComponent.js +1 -1
  37. package/es/components/TextArea/TextArea.d.ts +3 -3
  38. package/es/components/TextArea/TextArea.js +5 -2
  39. package/es/components/TextInput/ControlledPasswordInput.d.ts +6 -0
  40. package/es/components/TextInput/ControlledPasswordInput.js +1 -1
  41. package/es/components/TextInput/PasswordInput.d.ts +6 -0
  42. package/es/components/TextInput/index.js +1 -1
  43. package/es/components/Tile/Tile.d.ts +1 -1
  44. package/es/components/Tile/Tile.js +1 -4
  45. package/es/components/TreeView/TreeNode.d.ts +1 -1
  46. package/es/components/TreeView/TreeNode.js +11 -4
  47. package/es/components/TreeView/TreeView.d.ts +1 -1
  48. package/es/components/TreeView/TreeView.js +6 -6
  49. package/es/components/UIShell/Switcher.d.ts +1 -7
  50. package/es/components/UIShell/SwitcherDivider.d.ts +6 -0
  51. package/es/components/UIShell/SwitcherItem.d.ts +6 -0
  52. package/es/index.d.ts +5 -1
  53. package/es/index.js +3 -1
  54. package/es/internal/ClickListener.d.ts +13 -0
  55. package/es/internal/ClickListener.js +33 -60
  56. package/es/internal/FloatingMenu.js +2 -2
  57. package/es/internal/PolymorphicProps.d.ts +6 -0
  58. package/es/internal/deprecateFieldOnObject.d.ts +12 -0
  59. package/es/internal/deprecateFieldOnObject.js +4 -4
  60. package/es/internal/useControllableState.d.ts +34 -0
  61. package/es/internal/useControllableState.js +17 -32
  62. package/es/internal/useEvent.js +1 -1
  63. package/es/internal/useMergedRefs.d.ts +9 -6
  64. package/es/internal/useMergedRefs.js +8 -9
  65. package/es/internal/useNoInteractiveChildren.js +2 -2
  66. package/es/internal/useOutsideClick.d.ts +8 -0
  67. package/es/internal/useOutsideClick.js +9 -6
  68. package/es/internal/useSavedCallback.d.ts +15 -0
  69. package/es/internal/useSavedCallback.js +9 -12
  70. package/es/internal/warning.d.ts +17 -0
  71. package/es/internal/warning.js +16 -12
  72. package/es/internal/wrapFocus.js +1 -1
  73. package/es/prop-types/isRequiredOneOf.js +1 -1
  74. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  75. package/es/tools/events.js +1 -6
  76. package/es/tools/toggleClass.js +6 -0
  77. package/es/types/common.d.ts +6 -0
  78. package/lib/components/CodeSnippet/CodeSnippet.js +1 -1
  79. package/lib/components/ComposedModal/ComposedModal.d.ts +6 -0
  80. package/lib/components/ComposedModal/ModalFooter.d.ts +6 -0
  81. package/lib/components/ContainedList/index.js +1 -1
  82. package/lib/components/DataTable/DataTable.d.ts +3 -1
  83. package/lib/components/DatePicker/DatePicker.d.ts +1 -1
  84. package/lib/components/DatePicker/DatePicker.js +1 -1
  85. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +6 -0
  86. package/lib/components/InlineLoading/InlineLoading.js +10 -2
  87. package/lib/components/Layer/LayerLevel.d.ts +6 -0
  88. package/lib/components/Menu/Menu.d.ts +1 -1
  89. package/lib/components/Menu/MenuItem.d.ts +4 -4
  90. package/lib/components/Menu/MenuItem.js +1 -1
  91. package/lib/components/Modal/Modal.js +1 -1
  92. package/lib/components/ModalWrapper/ModalWrapper.d.ts +1 -1
  93. package/lib/components/ModalWrapper/ModalWrapper.js +2 -1
  94. package/lib/components/Notification/Notification.js +1 -1
  95. package/lib/components/NumberInput/NumberInput.d.ts +1 -1
  96. package/lib/components/OverflowMenu/OverflowMenu.js +3 -3
  97. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +1 -3
  98. package/lib/components/OverflowMenuV2/index.js +1 -1
  99. package/lib/components/PageHeader/PageHeader.d.ts +101 -0
  100. package/lib/components/PageHeader/PageHeader.js +260 -0
  101. package/lib/components/PageHeader/index.d.ts +8 -0
  102. package/lib/components/PageHeader/index.js +25 -0
  103. package/lib/components/PasswordInput/index.d.ts +6 -0
  104. package/lib/components/Popover/index.js +1 -1
  105. package/lib/components/Slider/SliderHandles.d.ts +6 -0
  106. package/lib/components/Tag/DismissibleTag.d.ts +1 -55
  107. package/lib/components/Tag/DismissibleTag.js +5 -3
  108. package/lib/components/Tag/OperationalTag.d.ts +1 -1
  109. package/lib/components/Tag/SelectableTag.d.ts +1 -43
  110. package/lib/components/Tag/SelectableTag.js +6 -4
  111. package/lib/components/Tag/Tag.js +2 -2
  112. package/lib/components/Text/createTextComponent.js +1 -1
  113. package/lib/components/TextArea/TextArea.d.ts +3 -3
  114. package/lib/components/TextArea/TextArea.js +4 -1
  115. package/lib/components/TextInput/ControlledPasswordInput.d.ts +6 -0
  116. package/lib/components/TextInput/ControlledPasswordInput.js +1 -1
  117. package/lib/components/TextInput/PasswordInput.d.ts +6 -0
  118. package/lib/components/TextInput/index.js +1 -1
  119. package/lib/components/Tile/Tile.d.ts +1 -1
  120. package/lib/components/Tile/Tile.js +1 -4
  121. package/lib/components/TreeView/TreeNode.d.ts +1 -1
  122. package/lib/components/TreeView/TreeNode.js +11 -4
  123. package/lib/components/TreeView/TreeView.d.ts +1 -1
  124. package/lib/components/TreeView/TreeView.js +6 -6
  125. package/lib/components/UIShell/Switcher.d.ts +1 -7
  126. package/lib/components/UIShell/SwitcherDivider.d.ts +6 -0
  127. package/lib/components/UIShell/SwitcherItem.d.ts +6 -0
  128. package/lib/index.d.ts +5 -1
  129. package/lib/index.js +62 -57
  130. package/lib/internal/ClickListener.d.ts +13 -0
  131. package/lib/internal/ClickListener.js +32 -64
  132. package/lib/internal/FloatingMenu.js +2 -2
  133. package/lib/internal/PolymorphicProps.d.ts +6 -0
  134. package/lib/internal/deprecateFieldOnObject.d.ts +12 -0
  135. package/lib/internal/deprecateFieldOnObject.js +4 -4
  136. package/lib/internal/useControllableState.d.ts +34 -0
  137. package/lib/internal/useControllableState.js +17 -32
  138. package/lib/internal/useEvent.js +1 -1
  139. package/lib/internal/useMergedRefs.d.ts +9 -6
  140. package/lib/internal/useMergedRefs.js +8 -9
  141. package/lib/internal/useNoInteractiveChildren.js +2 -2
  142. package/lib/internal/useOutsideClick.d.ts +8 -0
  143. package/lib/internal/useOutsideClick.js +9 -6
  144. package/lib/internal/useSavedCallback.d.ts +15 -0
  145. package/lib/internal/useSavedCallback.js +9 -12
  146. package/lib/internal/warning.d.ts +17 -0
  147. package/lib/internal/warning.js +16 -12
  148. package/lib/internal/wrapFocus.js +1 -1
  149. package/lib/prop-types/isRequiredOneOf.js +1 -1
  150. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  151. package/lib/tools/events.js +1 -6
  152. package/lib/tools/toggleClass.js +6 -0
  153. package/lib/types/common.d.ts +6 -0
  154. package/package.json +9 -8
  155. package/scss/components/page-header/_index.scss +9 -0
  156. package/scss/components/page-header/_page-header.scss +9 -0
  157. package/telemetry.yml +62 -23
@@ -274,7 +274,7 @@ const Popover = /*#__PURE__*/React__default["default"].forwardRef(function Popov
274
274
 
275
275
  // Note: this displayName is temporarily set so that Storybook ArgTable
276
276
  // correctly displays the name of this component
277
- if (process.env.NODE_ENV !== "production") {
277
+ if (process.env.NODE_ENV !== 'production') {
278
278
  Popover.displayName = 'Popover';
279
279
  }
280
280
  Popover.propTypes = {
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
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
+ */
1
7
  export declare const LowerHandle: (props: any) => import("react/jsx-runtime").JSX.Element;
2
8
  export declare const LowerHandleFocus: (props: any) => import("react/jsx-runtime").JSX.Element;
3
9
  export declare const UpperHandle: (props: any) => import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,6 @@
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 PropTypes from 'prop-types';
8
7
  import React, { ReactNode } from 'react';
9
8
  import { PolymorphicProps } from '../../types/common';
10
9
  import { SIZES, TYPES } from './Tag';
@@ -61,59 +60,6 @@ export interface DismissibleTagBaseProps {
61
60
  type?: keyof typeof TYPES;
62
61
  }
63
62
  export type DismissibleTagProps<T extends React.ElementType> = PolymorphicProps<T, DismissibleTagBaseProps>;
64
- declare const DismissibleTag: {
65
- <T extends React.ElementType>({ className, decorator, disabled, id, renderIcon, title, onClose, slug, size, text, tagTitle, type, ...other }: DismissibleTagProps<T>): import("react/jsx-runtime").JSX.Element;
66
- propTypes: {
67
- /**
68
- * Provide a custom className that is applied to the containing <span>
69
- */
70
- className: PropTypes.Requireable<string>;
71
- /**
72
- * **Experimental:** Provide a `decorator` component to be rendered inside the `DismissibleTag` component
73
- */
74
- decorator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
75
- /**
76
- * Specify if the `DismissibleTag` is disabled
77
- */
78
- disabled: PropTypes.Requireable<boolean>;
79
- /**
80
- * Specify the id for the tag.
81
- */
82
- id: PropTypes.Requireable<string>;
83
- /**
84
- * Click handler for filter tag close button.
85
- */
86
- onClose: PropTypes.Requireable<(...args: any[]) => any>;
87
- /**
88
- * A component used to render an icon.
89
- */
90
- renderIcon: PropTypes.Requireable<object>;
91
- /**
92
- * Specify the size of the Tag. Currently supports either `sm`,
93
- * `md` (default) or `lg` sizes.
94
- */
95
- size: PropTypes.Requireable<string>;
96
- /**
97
- * **Experimental:** Provide a `Slug` component to be rendered inside the `DismissibleTag` component
98
- */
99
- slug: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
100
- /**
101
- * Provide text to be rendered inside of a the tag.
102
- */
103
- text: PropTypes.Requireable<string>;
104
- /**
105
- * Provide a custom `title` to be inserted in the tag.
106
- */
107
- tagTitle: PropTypes.Requireable<string>;
108
- /**
109
- * Text to show on clear filters
110
- */
111
- title: PropTypes.Requireable<string>;
112
- /**
113
- * Specify the type of the `Tag`
114
- */
115
- type: PropTypes.Requireable<string>;
116
- };
117
- };
63
+ declare const DismissibleTag: React.ForwardRefExoticComponent<Omit<DismissibleTagProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLDivElement>>;
118
64
  export declare const types: string[];
119
65
  export default DismissibleTag;
@@ -22,6 +22,7 @@ require('../Tooltip/DefinitionTooltip.js');
22
22
  var Tooltip = require('../Tooltip/Tooltip.js');
23
23
  require('../Text/index.js');
24
24
  var isEllipsisActive = require('./isEllipsisActive.js');
25
+ var mergeRefs = require('../../tools/mergeRefs.js');
25
26
  var Text = require('../Text/Text.js');
26
27
 
27
28
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -31,7 +32,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
31
32
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
32
33
 
33
34
  var _Close;
34
- const DismissibleTag = _ref => {
35
+ const DismissibleTag = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
35
36
  let {
36
37
  className,
37
38
  decorator,
@@ -56,6 +57,7 @@ const DismissibleTag = _ref => {
56
57
  const newElement = tagLabelRef.current?.getElementsByClassName(`${prefix}--tag__label`)[0];
57
58
  setIsEllipsisApplied(isEllipsisActive.isEllipsisActive(newElement));
58
59
  }, [prefix, tagLabelRef]);
60
+ const combinedRef = mergeRefs["default"](tagLabelRef, forwardRef);
59
61
  const handleClose = event => {
60
62
  if (onClose) {
61
63
  event.stopPropagation();
@@ -79,7 +81,7 @@ const DismissibleTag = _ref => {
79
81
  } = other;
80
82
  const dismissLabel = `Dismiss "${text}"`;
81
83
  return /*#__PURE__*/React__default["default"].createElement(Tag["default"], _rollupPluginBabelHelpers["extends"]({
82
- ref: tagLabelRef,
84
+ ref: combinedRef,
83
85
  type: type,
84
86
  size: size,
85
87
  renderIcon: renderIcon,
@@ -106,7 +108,7 @@ const DismissibleTag = _ref => {
106
108
  disabled: disabled,
107
109
  "aria-label": title
108
110
  }, _Close || (_Close = /*#__PURE__*/React__default["default"].createElement(iconsReact.Close, null))))));
109
- };
111
+ });
110
112
  DismissibleTag.propTypes = {
111
113
  /**
112
114
  * Provide a custom className that is applied to the containing <span>
@@ -52,6 +52,6 @@ export interface OperationalTagBaseProps {
52
52
  type?: keyof typeof TYPES;
53
53
  }
54
54
  export type OperationalTagProps<T extends React.ElementType> = PolymorphicProps<T, OperationalTagBaseProps>;
55
- declare const OperationalTag: React.ForwardRefExoticComponent<Omit<OperationalTagProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLLIElement>>;
55
+ declare const OperationalTag: React.ForwardRefExoticComponent<Omit<OperationalTagProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
56
56
  export declare const types: string[];
57
57
  export default OperationalTag;
@@ -4,7 +4,6 @@
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 PropTypes from 'prop-types';
8
7
  import React, { MouseEvent } from 'react';
9
8
  import { PolymorphicProps } from '../../types/common';
10
9
  import { SIZES } from './Tag';
@@ -48,46 +47,5 @@ export interface SelectableTagBaseProps {
48
47
  text?: string;
49
48
  }
50
49
  export type SelectableTagProps<T extends React.ElementType> = PolymorphicProps<T, SelectableTagBaseProps>;
51
- declare const SelectableTag: {
52
- <T extends React.ElementType>({ className, disabled, id, renderIcon, onChange, onClick, selected, size, text, ...other }: SelectableTagProps<T>): import("react/jsx-runtime").JSX.Element;
53
- propTypes: {
54
- /**
55
- * Provide a custom className that is applied to the containing <span>
56
- */
57
- className: PropTypes.Requireable<string>;
58
- /**
59
- * Specify if the `SelectableTag` is disabled
60
- */
61
- disabled: PropTypes.Requireable<boolean>;
62
- /**
63
- * Specify the id for the tag.
64
- */
65
- id: PropTypes.Requireable<string>;
66
- /**
67
- * A component used to render an icon.
68
- */
69
- renderIcon: PropTypes.Requireable<object>;
70
- /**
71
- * Provide an optional hook that is called when selected is changed
72
- */
73
- onChange: PropTypes.Requireable<(...args: any[]) => any>;
74
- /**
75
- * Provide an optional function to be called when the tag is clicked.
76
- */
77
- onClick: PropTypes.Requireable<(...args: any[]) => any>;
78
- /**
79
- * Specify the state of the selectable tag.
80
- */
81
- selected: PropTypes.Requireable<boolean>;
82
- /**
83
- * Specify the size of the Tag. Currently supports either `sm`,
84
- * `md` (default) or `lg` sizes.
85
- */
86
- size: PropTypes.Requireable<string>;
87
- /**
88
- * Provide text to be rendered inside of a the tag.
89
- */
90
- text: PropTypes.Requireable<string>;
91
- };
92
- };
50
+ declare const SelectableTag: React.ForwardRefExoticComponent<Omit<SelectableTagProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
93
51
  export default SelectableTag;
@@ -20,6 +20,7 @@ require('../Tooltip/DefinitionTooltip.js');
20
20
  var Tooltip = require('../Tooltip/Tooltip.js');
21
21
  require('../Text/index.js');
22
22
  var isEllipsisActive = require('./isEllipsisActive.js');
23
+ var mergeRefs = require('../../tools/mergeRefs.js');
23
24
  var Text = require('../Text/Text.js');
24
25
 
25
26
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -28,7 +29,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
28
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
29
30
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
30
31
 
31
- const SelectableTag = _ref => {
32
+ const SelectableTag = /*#__PURE__*/React.forwardRef((_ref, forwardRef) => {
32
33
  let {
33
34
  className,
34
35
  disabled,
@@ -54,6 +55,7 @@ const SelectableTag = _ref => {
54
55
  setIsEllipsisApplied(isEllipsisActive.isEllipsisActive(newElement));
55
56
  }, [prefix, tagRef]);
56
57
  const tooltipClasses = cx__default["default"](`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
58
+ const combinedRef = mergeRefs["default"](tagRef, forwardRef);
57
59
  const handleClick = e => {
58
60
  setSelectedTag(!selectedTag);
59
61
  onChange?.(!selectedTag);
@@ -68,7 +70,7 @@ const SelectableTag = _ref => {
68
70
  onMouseEnter: () => false
69
71
  }, /*#__PURE__*/React__default["default"].createElement(Tag["default"], _rollupPluginBabelHelpers["extends"]({
70
72
  "aria-pressed": selectedTag !== false,
71
- ref: tagRef,
73
+ ref: combinedRef,
72
74
  size: size,
73
75
  renderIcon: renderIcon,
74
76
  disabled: disabled,
@@ -82,7 +84,7 @@ const SelectableTag = _ref => {
82
84
  }
83
85
  return /*#__PURE__*/React__default["default"].createElement(Tag["default"], _rollupPluginBabelHelpers["extends"]({
84
86
  "aria-pressed": selectedTag !== false,
85
- ref: tagRef,
87
+ ref: combinedRef,
86
88
  size: size,
87
89
  renderIcon: renderIcon,
88
90
  disabled: disabled,
@@ -93,7 +95,7 @@ const SelectableTag = _ref => {
93
95
  title: text,
94
96
  className: `${prefix}--tag__label`
95
97
  }, text));
96
- };
98
+ });
97
99
  SelectableTag.propTypes = {
98
100
  /**
99
101
  * Provide a custom className that is applied to the containing <span>
@@ -21,7 +21,7 @@ var deprecate = require('../../prop-types/deprecate.js');
21
21
  var DefinitionTooltip = require('../Tooltip/DefinitionTooltip.js');
22
22
  require('../Tooltip/Tooltip.js');
23
23
  var isEllipsisActive = require('./isEllipsisActive.js');
24
- var react = require('@floating-ui/react');
24
+ var useMergedRefs = require('../../internal/useMergedRefs.js');
25
25
  var Text = require('../Text/Text.js');
26
26
 
27
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -72,7 +72,7 @@ const Tag = /*#__PURE__*/React__default["default"].forwardRef((_ref, forwardRef)
72
72
  } = _ref;
73
73
  const prefix = usePrefix.usePrefix();
74
74
  const tagRef = React.useRef();
75
- const ref = react.useMergeRefs([forwardRef, tagRef]);
75
+ const ref = useMergedRefs.useMergedRefs([forwardRef, tagRef]);
76
76
  const tagId = id || `tag-${useId.useId()}`;
77
77
  const [isEllipsisApplied, setIsEllipsisApplied] = React.useState(false);
78
78
  React.useLayoutEffect(() => {
@@ -30,7 +30,7 @@ const createTextComponent = (element, displayName) => {
30
30
  as: element
31
31
  }, props));
32
32
  };
33
- if (process.env.NODE_ENV !== "production") {
33
+ if (process.env.NODE_ENV !== 'production') {
34
34
  TextWrapper.displayName = displayName;
35
35
  }
36
36
  return TextWrapper;
@@ -1,10 +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
- import React, { ReactNode } from 'react';
7
+ import React, { type ReactNode } from 'react';
8
8
  export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaElement> {
9
9
  /**
10
10
  * Provide a custom className that is applied directly to the underlying
@@ -115,5 +115,5 @@ export interface TextAreaProps extends React.InputHTMLAttributes<HTMLTextAreaEle
115
115
  */
116
116
  counterMode?: 'character' | 'word';
117
117
  }
118
- declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<unknown>>;
118
+ declare const TextArea: React.ForwardRefExoticComponent<TextAreaProps & React.RefAttributes<HTMLTextAreaElement>>;
119
119
  export default TextArea;
@@ -32,7 +32,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
32
32
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
34
34
 
35
- const TextArea = /*#__PURE__*/React__default["default"].forwardRef((props, forwardRef) => {
35
+ // TODO: This type was added to prevent the formatter from changing the
36
+ // indentation of this entire function. Delete it in a future pull request.
37
+
38
+ const TextArea = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
36
39
  const {
37
40
  className,
38
41
  decorator,
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
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
+ */
1
7
  import React from 'react';
2
8
  import { ReactAttr } from '../../types/common';
3
9
  export interface ControlledPasswordInputProps extends ReactAttr<HTMLInputElement> {
@@ -55,7 +55,7 @@ const ControlledPasswordInput = /*#__PURE__*/React__default["default"].forwardRe
55
55
  } = _ref;
56
56
  const prefix = usePrefix.usePrefix();
57
57
  const controlledPasswordInstanceId = useId.useId();
58
- if (process.env.NODE_ENV !== "production") {
58
+ if (process.env.NODE_ENV !== 'production') {
59
59
  process.env.NODE_ENV !== "production" ? warning.warning(didWarnAboutDeprecation, '`<TextInput.ControlledPasswordInput>` has been deprecated in favor of `<TextInput.PasswordInput />` and will be removed in the next major release of `carbon-components-react`') : void 0;
60
60
  didWarnAboutDeprecation = true;
61
61
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2025
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
+ */
1
7
  import React, { InputHTMLAttributes, ReactNode } from 'react';
2
8
  type ExcludedAttributes = 'size';
3
9
  export interface PasswordInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
@@ -15,7 +15,7 @@ var PasswordInput = require('./PasswordInput.js');
15
15
  var TextInput = require('./TextInput.js');
16
16
  var TextInput_Skeleton = require('./TextInput.Skeleton.js');
17
17
 
18
- if (process.env.NODE_ENV !== "production") {
18
+ if (process.env.NODE_ENV !== 'production') {
19
19
  deprecateFieldOnObject.deprecateFieldOnObject(TextInput["default"], 'ControlledPasswordInput', ControlledPasswordInput["default"]);
20
20
  deprecateFieldOnObject.deprecateFieldOnObject(TextInput["default"], 'PasswordInput', PasswordInput["default"]);
21
21
  }
@@ -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, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent } from 'react';
7
+ import React, { type ChangeEvent, type HTMLAttributes, type KeyboardEvent, type MouseEvent, type ReactNode } from 'react';
8
8
  export interface TileProps extends HTMLAttributes<HTMLDivElement> {
9
9
  children?: ReactNode;
10
10
  className?: string;
@@ -527,7 +527,6 @@ const ExpandableTile = /*#__PURE__*/React__default["default"].forwardRef(functio
527
527
  });
528
528
  }
529
529
  return interactive ? /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
530
- // @ts-expect-error: Needlesly strict & deep typing for the element type
531
530
  ref: ref,
532
531
  className: interactiveClassNames
533
532
  }, rest), /*#__PURE__*/React__default["default"].createElement("div", {
@@ -551,9 +550,7 @@ const ExpandableTile = /*#__PURE__*/React__default["default"].forwardRef(functio
551
550
  className: `${prefix}--tile-content`,
552
551
  id: belowTheFoldId
553
552
  }, childrenAsArray[1]))) : /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({
554
- type: "button"
555
- // @ts-expect-error: Needlesly strict & deep typing for the element type
556
- ,
553
+ type: "button",
557
554
  ref: ref,
558
555
  className: classNames,
559
556
  "aria-expanded": isExpanded,
@@ -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, { ComponentType, FunctionComponent } from 'react';
7
+ import React, { type ComponentType, type FunctionComponent } from 'react';
8
8
  export type TreeNodeProps = {
9
9
  /**
10
10
  * **Note:** this is controlled by the parent TreeView component, do not set manually.
@@ -57,10 +57,17 @@ const TreeNode = /*#__PURE__*/React__default["default"].forwardRef((_ref, forwar
57
57
  } = React.useRef(nodeId || uniqueId["default"]());
58
58
  const controllableExpandedState = useControllableState.useControllableState({
59
59
  value: isExpanded,
60
- onChange: onToggle,
61
- defaultValue: defaultIsExpanded
60
+ onChange: newValue => {
61
+ onToggle?.(undefined, {
62
+ id,
63
+ isExpanded: newValue,
64
+ label,
65
+ value
66
+ });
67
+ },
68
+ defaultValue: defaultIsExpanded ?? false
62
69
  });
63
- const uncontrollableExpandedState = React.useState(isExpanded);
70
+ const uncontrollableExpandedState = React.useState(isExpanded ?? false);
64
71
  const [expanded, setExpanded] = enableTreeviewControllable ? controllableExpandedState : uncontrollableExpandedState;
65
72
  const currentNode = React.useRef(null);
66
73
  const currentNodeLabel = React.useRef(null);
@@ -254,7 +261,7 @@ const TreeNode = /*#__PURE__*/React__default["default"].forwardRef((_ref, forwar
254
261
  }
255
262
  if (!enableTreeviewControllable) {
256
263
  // sync props and state
257
- setExpanded(isExpanded);
264
+ setExpanded(isExpanded ?? false);
258
265
  }
259
266
  }, [children, depth, Icon, isExpanded, enableTreeviewControllable, setExpanded]);
260
267
  const treeNodeProps = {
@@ -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.
@@ -54,7 +54,11 @@ const TreeView = _ref => {
54
54
  const treeWalker = React.useRef(treeRootRef?.current);
55
55
  const controllableSelectionState = useControllableState.useControllableState({
56
56
  value: preselected,
57
- onChange: onSelect,
57
+ onChange: newSelected => {
58
+ onSelect?.(undefined, {
59
+ activeNodeId: newSelected[0]
60
+ });
61
+ },
58
62
  defaultValue: []
59
63
  });
60
64
  const uncontrollableSelectionState = React.useState(preselected ?? []);
@@ -137,11 +141,7 @@ const TreeView = _ref => {
137
141
  });
138
142
  function handleKeyDown(event) {
139
143
  event.stopPropagation();
140
- if (match.matches(event, [keys.ArrowUp, keys.ArrowDown, keys.Home, keys.End,
141
- // @ts-ignore - `matches` doesn't like the object syntax without missing properties
142
- {
143
- code: 'KeyA'
144
- }])) {
144
+ if (match.matches(event, [keys.ArrowUp, keys.ArrowDown, keys.Home, keys.End])) {
145
145
  event.preventDefault();
146
146
  }
147
147
  if (!treeWalker.current) {
@@ -1,11 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
3
- *
4
- * This source code is licensed under the Apache-2.0 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- */
7
- /**
8
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
9
3
  *
10
4
  * This source code is licensed under the Apache-2.0 license found in the
11
5
  * LICENSE file in the root directory of this source tree.
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2025
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
+ */
1
7
  import React from 'react';
2
8
  export interface SwitcherDividerProps {
3
9
  /**
@@ -1,3 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2025
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
+ */
1
7
  import React, { HTMLAttributeAnchorTarget, KeyboardEvent } from 'react';
2
8
  export interface BaseSwitcherItemProps {
3
9
  /**
package/lib/index.d.ts CHANGED
@@ -31,6 +31,9 @@ export * from './components/DatePickerInput';
31
31
  export * from './components/Dropdown';
32
32
  export * from './components/ErrorBoundary';
33
33
  export * from './components/ExpandableSearch';
34
+ export { FeatureFlags, useFeatureFlag, useFeatureFlags, FeatureFlags as unstable_FeatureFlags, // this export can be removed in v12
35
+ useFeatureFlag as unstable_useFeatureFlag, // this export can be removed in v12
36
+ useFeatureFlags as unstable_useFeatureFlags, } from './components/FeatureFlags';
34
37
  export * from './components/FileUploader';
35
38
  export * from './components/FilterableMultiSelect';
36
39
  export * from './components/FluidForm';
@@ -55,6 +58,7 @@ export * from './components/NumberInput';
55
58
  export * from './components/OrderedList';
56
59
  export * from './components/OverflowMenu';
57
60
  export * from './components/OverflowMenuItem';
61
+ export * as unstable__PageHeader from './components/PageHeader';
58
62
  export * from './components/Pagination';
59
63
  export * from './components/Pagination/Pagination.Skeleton';
60
64
  export * from './components/PaginationNav';
@@ -95,7 +99,6 @@ export * from './components/Toggletip';
95
99
  export * from './components/TreeView';
96
100
  export * from './components/UIShell';
97
101
  export * from './components/UnorderedList';
98
- export { FeatureFlags as unstable_FeatureFlags, useFeatureFlag as unstable_useFeatureFlag, useFeatureFlags as unstable_useFeatureFlags, } from './components/FeatureFlags';
99
102
  export { FluidComboBox as unstable__FluidComboBox, FluidComboBoxSkeleton as unstable__FluidComboBoxSkeleton, } from './components/FluidComboBox';
100
103
  export { FluidDatePicker as unstable__FluidDatePicker, FluidDatePickerSkeleton as unstable__FluidDatePickerSkeleton, } from './components/FluidDatePicker';
101
104
  export { FluidDatePickerInput as unstable__FluidDatePickerInput } from './components/FluidDatePickerInput';
@@ -263,6 +266,7 @@ export type { NumberInputSkeletonProps } from './components/NumberInput/NumberIn
263
266
  export type { OrderedListProps } from './components/OrderedList/OrderedList';
264
267
  export type { OverflowMenuProps } from './components/OverflowMenu/OverflowMenu';
265
268
  export type { OverflowMenuItemProps } from './components/OverflowMenuItem/OverflowMenuItem';
269
+ export type { PageHeaderProps, PageHeaderBreadcrumbBarProps, PageHeaderContentProps, PageHeaderHeroImageProps, PageHeaderTabBarProps, } from './components/PageHeader';
266
270
  export type { PaginationProps } from './components/Pagination/Pagination';
267
271
  export type { PaginationSkeletonProps } from './components/Pagination/Pagination.Skeleton';
268
272
  export type { DirectionButtonProps } from './components/PaginationNav/PaginationNav';