@carbon/react 1.24.0 → 1.26.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/es/components/Button/Button.js +2 -2
  2. package/es/components/CodeSnippet/CodeSnippet.js +13 -115
  3. package/es/components/ComboBox/ComboBox.d.ts +6 -0
  4. package/es/components/ComboBox/ComboBox.js +19 -172
  5. package/es/components/ComboButton/index.js +164 -0
  6. package/es/components/ComposedModal/ComposedModal.js +1 -2
  7. package/es/components/DataTable/Table.d.ts +74 -0
  8. package/es/components/DataTable/Table.js +4 -2
  9. package/es/components/DataTable/TableCell.d.ts +10 -0
  10. package/es/components/DataTable/TableContext.d.ts +13 -0
  11. package/es/components/DataTable/TableContext.js +2 -2
  12. package/es/components/DataTable/TableExpandRow.d.ts +67 -0
  13. package/es/components/DataTable/TableExpandedRow.d.ts +32 -0
  14. package/es/components/DataTable/TableHead.d.ts +10 -0
  15. package/es/components/DataTable/TableHeader.d.ts +64 -0
  16. package/es/components/DataTable/TableHeader.js +23 -28
  17. package/es/components/DataTable/TableRow.d.ts +32 -0
  18. package/es/components/DataTable/TableSelectAll.js +1 -1
  19. package/es/components/DataTable/TableSelectRow.js +1 -3
  20. package/es/components/DataTable/TableToolbar.d.ts +19 -0
  21. package/es/components/DataTable/TableToolbar.js +1 -1
  22. package/es/components/DataTable/TableToolbarAction.d.ts +21 -0
  23. package/es/components/DataTable/TableToolbarContent.d.ts +19 -0
  24. package/es/components/DataTable/TableToolbarMenu.d.ts +24 -0
  25. package/es/components/DataTable/TableToolbarMenu.js +3 -3
  26. package/es/components/DataTable/TableToolbarSearch.js +1 -0
  27. package/es/components/DataTable/tools/sorting.js +2 -1
  28. package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
  29. package/es/components/Dropdown/Dropdown.d.ts +6 -0
  30. package/es/components/Dropdown/Dropdown.js +8 -145
  31. package/es/components/ExpandableSearch/ExpandableSearch.js +1 -0
  32. package/es/components/FileUploader/FileUploader.js +1 -1
  33. package/es/components/FileUploader/FileUploaderButton.js +2 -0
  34. package/es/components/FileUploader/FileUploaderDropContainer.js +30 -18
  35. package/es/components/FileUploader/FileUploaderItem.js +2 -1
  36. package/es/components/FileUploader/Filename.js +8 -2
  37. package/es/components/FluidTextArea/FluidTextArea.js +12 -1
  38. package/es/components/IconButton/index.js +1 -0
  39. package/es/components/InlineCheckbox/InlineCheckbox.js +7 -53
  40. package/es/components/ListBox/ListBoxSelection.js +4 -23
  41. package/es/components/ListBox/next/ListBoxSelection.js +2 -23
  42. package/es/components/Menu/Menu.js +50 -29
  43. package/es/components/Menu/MenuItem.js +1 -0
  44. package/es/components/MenuButton/index.js +127 -0
  45. package/es/components/Modal/Modal.js +4 -3
  46. package/es/components/MultiSelect/FilterableMultiSelect.js +46 -144
  47. package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
  48. package/es/components/MultiSelect/MultiSelect.js +48 -28
  49. package/es/components/Notification/Notification.js +27 -264
  50. package/es/components/NumberInput/NumberInput.js +9 -1
  51. package/es/components/OverflowMenu/OverflowMenu.js +13 -139
  52. package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
  53. package/es/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
  54. package/es/components/OverflowMenuV2/index.js +15 -51
  55. package/es/components/Popover/index.d.ts +5 -1
  56. package/es/components/Popover/index.js +37 -9
  57. package/es/components/RadioButton/RadioButton.Skeleton.d.ts +25 -0
  58. package/es/components/RadioButton/RadioButton.Skeleton.js +3 -3
  59. package/es/components/RadioButton/RadioButton.d.ts +64 -0
  60. package/es/components/RadioButton/RadioButton.js +19 -17
  61. package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +80 -0
  62. package/es/components/RadioButtonGroup/RadioButtonGroup.js +88 -26
  63. package/es/components/RadioTile/RadioTile.js +6 -6
  64. package/es/components/Search/Search.Skeleton.d.ts +36 -0
  65. package/es/components/Search/Search.js +3 -2
  66. package/es/components/Search/index.js +1 -0
  67. package/es/components/Select/Select.d.ts +89 -0
  68. package/es/components/SelectItem/SelectItem.d.ts +62 -0
  69. package/es/components/SelectItem/SelectItem.js +2 -4
  70. package/es/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
  71. package/es/components/SkeletonText/SkeletonText.js +1 -1
  72. package/es/components/StructuredList/StructuredList.js +11 -39
  73. package/es/components/Tabs/Tabs.js +29 -6
  74. package/es/components/TextArea/TextArea.Skeleton.d.ts +33 -0
  75. package/es/components/TextArea/TextArea.Skeleton.js +5 -5
  76. package/es/components/TextArea/TextArea.d.ts +9 -2
  77. package/es/components/TextArea/TextArea.js +31 -8
  78. package/es/components/TextArea/index.js +1 -0
  79. package/es/components/TextInput/TextInput.Skeleton.d.ts +33 -0
  80. package/es/components/TextInput/index.js +1 -0
  81. package/es/components/Tile/Tile.js +15 -8
  82. package/es/components/Toggle/Toggle.js +8 -19
  83. package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -0
  84. package/es/components/Tooltip/DefinitionTooltip.js +2 -2
  85. package/es/components/Tooltip/Tooltip.d.ts +117 -0
  86. package/es/components/Tooltip/Tooltip.js +6 -4
  87. package/es/components/Tooltip/index.d.ts +9 -0
  88. package/es/components/UIShell/HeaderMenu.js +13 -4
  89. package/es/components/UIShell/HeaderMenuItem.js +17 -4
  90. package/es/index.d.ts +2 -0
  91. package/es/index.js +5 -3
  92. package/es/internal/ClickListener.js +1 -2
  93. package/es/internal/keyboard/match.js +1 -1
  94. package/es/internal/useAttachedMenu.js +85 -0
  95. package/es/internal/useDelayedState.d.ts +19 -0
  96. package/es/internal/useDelayedState.js +7 -3
  97. package/es/internal/useId.js +1 -1
  98. package/es/tools/wrapComponent.js +9 -0
  99. package/lib/components/Button/Button.js +2 -2
  100. package/lib/components/CodeSnippet/CodeSnippet.js +13 -115
  101. package/lib/components/ComboBox/ComboBox.d.ts +6 -0
  102. package/lib/components/ComboBox/ComboBox.js +18 -171
  103. package/lib/components/ComboButton/index.js +174 -0
  104. package/lib/components/ComposedModal/ComposedModal.js +1 -2
  105. package/lib/components/DataTable/Table.d.ts +74 -0
  106. package/lib/components/DataTable/Table.js +4 -2
  107. package/lib/components/DataTable/TableCell.d.ts +10 -0
  108. package/lib/components/DataTable/TableContext.d.ts +13 -0
  109. package/lib/components/DataTable/TableContext.js +2 -2
  110. package/lib/components/DataTable/TableExpandRow.d.ts +67 -0
  111. package/lib/components/DataTable/TableExpandedRow.d.ts +32 -0
  112. package/lib/components/DataTable/TableHead.d.ts +10 -0
  113. package/lib/components/DataTable/TableHeader.d.ts +64 -0
  114. package/lib/components/DataTable/TableHeader.js +23 -28
  115. package/lib/components/DataTable/TableRow.d.ts +32 -0
  116. package/lib/components/DataTable/TableSelectAll.js +1 -1
  117. package/lib/components/DataTable/TableSelectRow.js +1 -3
  118. package/lib/components/DataTable/TableToolbar.d.ts +19 -0
  119. package/lib/components/DataTable/TableToolbar.js +1 -1
  120. package/lib/components/DataTable/TableToolbarAction.d.ts +21 -0
  121. package/lib/components/DataTable/TableToolbarContent.d.ts +19 -0
  122. package/lib/components/DataTable/TableToolbarMenu.d.ts +24 -0
  123. package/lib/components/DataTable/TableToolbarMenu.js +3 -3
  124. package/lib/components/DataTable/TableToolbarSearch.js +1 -0
  125. package/lib/components/DataTable/tools/sorting.js +2 -1
  126. package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
  127. package/lib/components/Dropdown/Dropdown.d.ts +6 -0
  128. package/lib/components/Dropdown/Dropdown.js +7 -144
  129. package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -0
  130. package/lib/components/FileUploader/FileUploader.js +1 -1
  131. package/lib/components/FileUploader/FileUploaderButton.js +2 -0
  132. package/lib/components/FileUploader/FileUploaderDropContainer.js +30 -18
  133. package/lib/components/FileUploader/FileUploaderItem.js +2 -1
  134. package/lib/components/FileUploader/Filename.js +8 -2
  135. package/lib/components/FluidTextArea/FluidTextArea.js +12 -1
  136. package/lib/components/IconButton/index.js +1 -0
  137. package/lib/components/InlineCheckbox/InlineCheckbox.js +7 -53
  138. package/lib/components/ListBox/ListBoxSelection.js +4 -23
  139. package/lib/components/ListBox/next/ListBoxSelection.js +2 -23
  140. package/lib/components/Menu/Menu.js +50 -29
  141. package/lib/components/Menu/MenuItem.js +1 -0
  142. package/lib/components/MenuButton/index.js +137 -0
  143. package/lib/components/Modal/Modal.js +4 -3
  144. package/lib/components/MultiSelect/FilterableMultiSelect.js +43 -141
  145. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  146. package/lib/components/MultiSelect/MultiSelect.js +47 -27
  147. package/lib/components/Notification/Notification.js +27 -264
  148. package/lib/components/NumberInput/NumberInput.js +9 -1
  149. package/lib/components/OverflowMenu/OverflowMenu.js +13 -139
  150. package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
  151. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
  152. package/lib/components/OverflowMenuV2/index.js +13 -49
  153. package/lib/components/Popover/index.d.ts +5 -1
  154. package/lib/components/Popover/index.js +37 -9
  155. package/lib/components/RadioButton/RadioButton.Skeleton.d.ts +25 -0
  156. package/lib/components/RadioButton/RadioButton.Skeleton.js +3 -3
  157. package/lib/components/RadioButton/RadioButton.d.ts +64 -0
  158. package/lib/components/RadioButton/RadioButton.js +18 -16
  159. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +80 -0
  160. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +86 -24
  161. package/lib/components/RadioTile/RadioTile.js +6 -6
  162. package/lib/components/Search/Search.Skeleton.d.ts +36 -0
  163. package/lib/components/Search/Search.js +3 -2
  164. package/lib/components/Search/index.js +2 -0
  165. package/lib/components/Select/Select.d.ts +89 -0
  166. package/lib/components/SelectItem/SelectItem.d.ts +62 -0
  167. package/lib/components/SelectItem/SelectItem.js +1 -3
  168. package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
  169. package/lib/components/SkeletonText/SkeletonText.js +1 -1
  170. package/lib/components/StructuredList/StructuredList.js +11 -39
  171. package/lib/components/Tabs/Tabs.js +29 -6
  172. package/lib/components/TextArea/TextArea.Skeleton.d.ts +33 -0
  173. package/lib/components/TextArea/TextArea.Skeleton.js +5 -5
  174. package/lib/components/TextArea/TextArea.d.ts +9 -2
  175. package/lib/components/TextArea/TextArea.js +30 -7
  176. package/lib/components/TextArea/index.js +2 -0
  177. package/lib/components/TextInput/TextInput.Skeleton.d.ts +33 -0
  178. package/lib/components/TextInput/index.js +2 -0
  179. package/lib/components/Tile/Tile.js +15 -8
  180. package/lib/components/Toggle/Toggle.js +8 -19
  181. package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -0
  182. package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
  183. package/lib/components/Tooltip/Tooltip.d.ts +117 -0
  184. package/lib/components/Tooltip/Tooltip.js +6 -4
  185. package/lib/components/Tooltip/index.d.ts +9 -0
  186. package/lib/components/UIShell/HeaderMenu.js +13 -4
  187. package/lib/components/UIShell/HeaderMenuItem.js +17 -4
  188. package/lib/index.d.ts +2 -0
  189. package/lib/index.js +50 -46
  190. package/lib/internal/ClickListener.js +1 -2
  191. package/lib/internal/keyboard/match.js +1 -1
  192. package/lib/internal/useAttachedMenu.js +89 -0
  193. package/lib/internal/useDelayedState.d.ts +19 -0
  194. package/lib/internal/useDelayedState.js +7 -3
  195. package/lib/internal/useId.js +1 -1
  196. package/lib/tools/wrapComponent.js +9 -0
  197. package/package.json +3 -3
@@ -0,0 +1,117 @@
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
+ import PropTypes from 'prop-types';
8
+ import React from 'react';
9
+ import { PopoverAlignment } from '../Popover';
10
+ import { PolymorphicProps } from '../../types/common';
11
+ interface TooltipBaseProps {
12
+ /**
13
+ * Specify how the trigger should align with the tooltip
14
+ */
15
+ align?: PopoverAlignment;
16
+ /**
17
+ * Pass in the child to which the tooltip will be applied
18
+ */
19
+ children?: React.ReactElement;
20
+ /**
21
+ * Specify an optional className to be applied to the container node
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Determines wether the tooltip should close when inner content is activated (click, Enter or Space)
26
+ */
27
+ closeOnActivation?: boolean;
28
+ /**
29
+ * Specify whether the tooltip should be open when it first renders
30
+ */
31
+ defaultOpen?: boolean;
32
+ /**
33
+ * Provide the description to be rendered inside of the Tooltip. The
34
+ * description will use `aria-describedby` and will describe the child node
35
+ * in addition to the text rendered inside of the child. This means that if you
36
+ * have text in the child node, that it will be announced alongside the
37
+ * description to the screen reader.
38
+ *
39
+ * Note: if label and description are both provided, label will be used and
40
+ * description will not be used
41
+ */
42
+ description?: React.ReactNode;
43
+ /**
44
+ * Specify the duration in milliseconds to delay before displaying the tooltip
45
+ */
46
+ enterDelayMs?: number;
47
+ /**
48
+ * Provide the label to be rendered inside of the Tooltip. The label will use
49
+ * `aria-labelledby` and will fully describe the child node that is provided.
50
+ * This means that if you have text in the child node, that it will not be
51
+ * announced to the screen reader.
52
+ *
53
+ * Note: if label and description are both provided, description will not be
54
+ * used
55
+ */
56
+ label?: React.ReactNode;
57
+ /**
58
+ * Specify the duration in milliseconds to delay before hiding the tooltip
59
+ */
60
+ leaveDelayMs?: number;
61
+ }
62
+ export type TooltipProps<T extends React.ElementType> = PolymorphicProps<T, TooltipBaseProps>;
63
+ declare function Tooltip<T extends React.ElementType>({ align, className: customClassName, children, label, description, enterDelayMs, leaveDelayMs, defaultOpen, closeOnActivation, ...rest }: TooltipProps<T>): JSX.Element;
64
+ declare namespace Tooltip {
65
+ var propTypes: {
66
+ /**
67
+ * Specify how the trigger should align with the tooltip
68
+ */
69
+ align: PropTypes.Requireable<string>;
70
+ /**
71
+ * Pass in the child to which the tooltip will be applied
72
+ */
73
+ children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
74
+ /**
75
+ * Specify an optional className to be applied to the container node
76
+ */
77
+ className: PropTypes.Requireable<string>;
78
+ /**
79
+ * Determines wether the tooltip should close when inner content is activated (click, Enter or Space)
80
+ */
81
+ closeOnActivation: PropTypes.Requireable<boolean>;
82
+ /**
83
+ * Specify whether the tooltip should be open when it first renders
84
+ */
85
+ defaultOpen: PropTypes.Requireable<boolean>;
86
+ /**
87
+ * Provide the description to be rendered inside of the Tooltip. The
88
+ * description will use `aria-describedby` and will describe the child node
89
+ * in addition to the text rendered inside of the child. This means that if you
90
+ * have text in the child node, that it will be announced alongside the
91
+ * description to the screen reader.
92
+ *
93
+ * Note: if label and description are both provided, label will be used and
94
+ * description will not be used
95
+ */
96
+ description: PropTypes.Requireable<PropTypes.ReactNodeLike>;
97
+ /**
98
+ * Specify the duration in milliseconds to delay before displaying the tooltip
99
+ */
100
+ enterDelayMs: PropTypes.Requireable<number>;
101
+ /**
102
+ * Provide the label to be rendered inside of the Tooltip. The label will use
103
+ * `aria-labelledby` and will fully describe the child node that is provided.
104
+ * This means that if you have text in the child node, that it will not be
105
+ * announced to the screen reader.
106
+ *
107
+ * Note: if label and description are both provided, description will not be
108
+ * used
109
+ */
110
+ label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
111
+ /**
112
+ * Specify the duration in milliseconds to delay before hiding the tooltip
113
+ */
114
+ leaveDelayMs: PropTypes.Requireable<number>;
115
+ };
116
+ }
117
+ export { Tooltip };
@@ -113,10 +113,12 @@ function Tooltip(_ref) {
113
113
 
114
114
  useNoInteractiveChildren.useNoInteractiveChildren(tooltipRef, 'The Tooltip component must have no interactive content rendered by the' + '`label` or `description` prop');
115
115
  React.useEffect(function () {
116
- var interactiveContent = useNoInteractiveChildren.getInteractiveContent(containerRef.current);
116
+ if (containerRef !== null && containerRef.current) {
117
+ var interactiveContent = useNoInteractiveChildren.getInteractiveContent(containerRef.current);
117
118
 
118
- if (!interactiveContent) {
119
- setOpen(false);
119
+ if (!interactiveContent) {
120
+ setOpen(false);
121
+ }
120
122
  }
121
123
  });
122
124
  return /*#__PURE__*/React__default["default"].createElement(index.Popover, _rollupPluginBabelHelpers["extends"]({}, rest, {
@@ -128,7 +130,7 @@ function Tooltip(_ref) {
128
130
  onMouseLeave: onMouseLeave,
129
131
  open: open,
130
132
  ref: containerRef
131
- }), /*#__PURE__*/React__default["default"].cloneElement(child, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, triggerProps), getChildEventHandlers(child.props))), /*#__PURE__*/React__default["default"].createElement(index.PopoverContent, {
133
+ }), child !== undefined ? /*#__PURE__*/React__default["default"].cloneElement(child, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, triggerProps), getChildEventHandlers(child.props))) : null, /*#__PURE__*/React__default["default"].createElement(index.PopoverContent, {
132
134
  "aria-hidden": "true",
133
135
  className: "".concat(prefix, "--tooltip-content"),
134
136
  id: id,
@@ -0,0 +1,9 @@
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
+ import { DefinitionTooltip } from './DefinitionTooltip';
8
+ import { Tooltip } from './Tooltip';
9
+ export { DefinitionTooltip, Tooltip };
@@ -16,6 +16,7 @@ var React = require('react');
16
16
  var PropTypes = require('prop-types');
17
17
  var AriaPropTypes = require('../../prop-types/AriaPropTypes.js');
18
18
  var usePrefix = require('../../internal/usePrefix.js');
19
+ var deprecate = require('../../prop-types/deprecate.js');
19
20
  var match = require('../../internal/keyboard/match.js');
20
21
  var keys = require('../../internal/keyboard/keys.js');
21
22
 
@@ -25,7 +26,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
26
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
26
27
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
27
28
 
28
- var _excluded = ["isCurrentPage", "aria-label", "aria-labelledby", "className", "children", "renderMenuContent", "menuLinkName", "focusRef"];
29
+ var _excluded = ["isActive", "isCurrentPage", "aria-label", "aria-labelledby", "className", "children", "renderMenuContent", "menuLinkName", "focusRef"];
29
30
  /**
30
31
  * `HeaderMenu` is used to render submenu's in the `Header`. Most often children
31
32
  * will be a `HeaderMenuItem`. It handles certain keyboard events to help
@@ -159,6 +160,7 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
159
160
  var prefix = this.context;
160
161
 
161
162
  var _this$props = this.props,
163
+ isActive = _this$props.isActive,
162
164
  isCurrentPage = _this$props.isCurrentPage,
163
165
  ariaLabel = _this$props['aria-label'],
164
166
  ariaLabelledBy = _this$props['aria-labelledby'],
@@ -174,7 +176,8 @@ var HeaderMenu = /*#__PURE__*/function (_React$Component) {
174
176
  'aria-labelledby': ariaLabelledBy
175
177
  };
176
178
  var itemClassName = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--header__submenu"), true), _rollupPluginBabelHelpers.defineProperty(_cx, customClassName, !!customClassName), _cx));
177
- var linkClassName = cx__default["default"]((_cx2 = {}, _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-item"), true), _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-title"), true), _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-item--current"), isCurrentPage), _cx2)); // Notes on eslint comments and based on the examples in:
179
+ var isActivePage = isActive ? isActive : isCurrentPage;
180
+ var linkClassName = cx__default["default"]((_cx2 = {}, _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-item"), true), _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-title"), true), _rollupPluginBabelHelpers.defineProperty(_cx2, "".concat(prefix, "--header__menu-item--current"), isActivePage), _cx2)); // Notes on eslint comments and based on the examples in:
178
181
  // https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html#
179
182
  // - The focus is handled by the <a> menuitem, onMouseOver is for mouse
180
183
  // users
@@ -228,9 +231,15 @@ _rollupPluginBabelHelpers.defineProperty(HeaderMenu, "propTypes", _rollupPluginB
228
231
  focusRef: PropTypes__default["default"].func,
229
232
 
230
233
  /**
231
- * Applies selected styles to the item if a user sets this to true and aria-current !== 'page'.
234
+ * Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
232
235
  */
233
- isCurrentPage: PropTypes__default["default"].bool,
236
+ isActive: PropTypes__default["default"].bool,
237
+
238
+ /**
239
+ * Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
240
+ * @deprecated Please use `isActive` instead. This will be removed in the next major release.
241
+ */
242
+ isCurrentPage: deprecate["default"](PropTypes__default["default"].bool, 'The `isCurrentPage` prop for `HeaderMenu` has ' + 'been deprecated. Please use `isActive` instead. This will be removed in the next major release.'),
234
243
 
235
244
  /**
236
245
  * Provide a label for the link text
@@ -15,6 +15,7 @@ var React = require('react');
15
15
  var cx = require('classnames');
16
16
  var Link = require('./Link.js');
17
17
  var usePrefix = require('../../internal/usePrefix.js');
18
+ var deprecate = require('../../prop-types/deprecate.js');
18
19
 
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
21
 
@@ -22,11 +23,12 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
25
 
25
- var _excluded = ["className", "isCurrentPage", "aria-current", "children", "role", "tabIndex"];
26
+ var _excluded = ["className", "isActive", "isCurrentPage", "aria-current", "children", "role", "tabIndex"];
26
27
  var HeaderMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function HeaderMenuItem(_ref, ref) {
27
28
  var _cx;
28
29
 
29
30
  var className = _ref.className,
31
+ isActive = _ref.isActive,
30
32
  isCurrentPage = _ref.isCurrentPage,
31
33
  ariaCurrent = _ref['aria-current'],
32
34
  children = _ref.children,
@@ -36,7 +38,12 @@ var HeaderMenuItem = /*#__PURE__*/React__default["default"].forwardRef(function
36
38
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
37
39
 
38
40
  var prefix = usePrefix.usePrefix();
39
- var linkClassName = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--header__menu-item"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--header__menu-item--current"), isCurrentPage && ariaCurrent !== 'page'), _cx));
41
+
42
+ if (isCurrentPage) {
43
+ isActive = isCurrentPage;
44
+ }
45
+
46
+ var linkClassName = cx__default["default"]((_cx = {}, _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--header__menu-item"), true), _rollupPluginBabelHelpers.defineProperty(_cx, "".concat(prefix, "--header__menu-item--current"), isActive && ariaCurrent !== 'page'), _cx));
40
47
  return /*#__PURE__*/React__default["default"].createElement("li", {
41
48
  className: className,
42
49
  role: role
@@ -63,9 +70,15 @@ HeaderMenuItem.propTypes = _rollupPluginBabelHelpers.objectSpread2(_rollupPlugin
63
70
  className: PropTypes__default["default"].string,
64
71
 
65
72
  /**
66
- * Applies selected styles to the item if a user sets this to true and aria-current !== 'page'.
73
+ * Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
74
+ */
75
+ isActive: PropTypes__default["default"].bool,
76
+
77
+ /**
78
+ * Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
79
+ * @deprecated Please use `isActive` instead. This will be removed in the next major release.
67
80
  */
68
- isCurrentPage: PropTypes__default["default"].bool,
81
+ isCurrentPage: deprecate["default"](PropTypes__default["default"].bool, 'The `isCurrentPage` prop for `HeaderMenuItem` has ' + 'been deprecated. Please use `isActive` instead. This will be removed in the next major release.'),
69
82
 
70
83
  /**
71
84
  * Optionally supply a role for the underlying `<li>` node. Useful for resetting
package/lib/index.d.ts CHANGED
@@ -107,6 +107,8 @@ export * from './components/Layer';
107
107
  export { LayoutDirection as unstable_LayoutDirection, useLayoutDirection as unstable_useLayoutDirection, } from './components/Layout';
108
108
  export { Menu as unstable_Menu, MenuItem as unstable_MenuItem, MenuItemDivider as unstable_MenuItemDivider, MenuItemGroup as unstable_MenuItemGroup, MenuItemRadioGroup as unstable_MenuItemRadioGroup, MenuItemSelectable as unstable_MenuItemSelectable, } from './components/Menu';
109
109
  export { OverflowMenuV2 as unstable_OverflowMenuV2 } from './components/OverflowMenuV2';
110
+ export { ComboButton as unstable_ComboButton } from './components/ComboButton';
111
+ export { MenuButton as unstable_MenuButton } from './components/MenuButton';
110
112
  export { PageSelector as unstable_PageSelector, Pagination as unstable_Pagination, } from './components/Pagination/experimental';
111
113
  export * from './components/Popover';
112
114
  export * from './components/ProgressBar';
package/lib/index.js CHANGED
@@ -12,8 +12,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  require('./feature-flags.js');
13
13
  var Checkbox = require('./components/Checkbox/Checkbox.js');
14
14
  var Checkbox_Skeleton = require('./components/Checkbox/Checkbox.Skeleton.js');
15
- var index$2 = require('./components/ClassPrefix/index.js');
16
- var index$3 = require('./components/ContentSwitcher/index.js');
15
+ var index$4 = require('./components/ClassPrefix/index.js');
16
+ var index$5 = require('./components/ContentSwitcher/index.js');
17
17
  var Dropdown = require('./components/Dropdown/Dropdown.js');
18
18
  var Dropdown_Skeleton = require('./components/Dropdown/Dropdown.Skeleton.js');
19
19
  var FluidForm = require('./components/FluidForm/FluidForm.js');
@@ -23,13 +23,13 @@ var Grid = require('./components/Grid/Grid.js');
23
23
  var Row = require('./components/Grid/Row.js');
24
24
  var Column = require('./components/Grid/Column.js');
25
25
  var ColumnHang = require('./components/Grid/ColumnHang.js');
26
- var index$4 = require('./components/IdPrefix/index.js');
27
- var index$5 = require('./components/OverflowMenu/index.js');
28
- var index$6 = require('./components/Slider/index.js');
29
- var index$7 = require('./components/Tab/index.js');
30
- var index$8 = require('./components/TileGroup/index.js');
31
- var index$9 = require('./components/TimePickerSelect/index.js');
32
- var index$a = require('./components/Toggletip/index.js');
26
+ var index$6 = require('./components/IdPrefix/index.js');
27
+ var index$7 = require('./components/OverflowMenu/index.js');
28
+ var index$8 = require('./components/Slider/index.js');
29
+ var index$9 = require('./components/Tab/index.js');
30
+ var index$a = require('./components/TileGroup/index.js');
31
+ var index$b = require('./components/TimePickerSelect/index.js');
32
+ var index$c = require('./components/Toggletip/index.js');
33
33
  var Pagination_Skeleton = require('./components/Pagination/Pagination.Skeleton.js');
34
34
  var RadioButton_Skeleton = require('./components/RadioButton/RadioButton.Skeleton.js');
35
35
  var Tag_Skeleton = require('./components/Tag/Tag.Skeleton.js');
@@ -37,15 +37,18 @@ var Toggle_Skeleton = require('./components/Toggle/Toggle.Skeleton.js');
37
37
  var ToggleSmall_Skeleton = require('./components/ToggleSmall/ToggleSmall.Skeleton.js');
38
38
  var Icon_Skeleton = require('./components/Icon/Icon.Skeleton.js');
39
39
  var index = require('./components/FeatureFlags/index.js');
40
- var index$b = require('./components/Heading/index.js');
41
- var index$c = require('./components/IconButton/index.js');
42
- var index$d = require('./components/Layer/index.js');
40
+ var index$d = require('./components/Heading/index.js');
41
+ var index$e = require('./components/IconButton/index.js');
42
+ var index$f = require('./components/Layer/index.js');
43
43
  var index$1 = require('./components/OverflowMenuV2/index.js');
44
- var index$e = require('./components/Popover/index.js');
45
- var index$f = require('./components/Stack/index.js');
46
- require('./components/Text/index.js');
44
+ var index$2 = require('./components/ComboButton/index.js');
45
+ var index$3 = require('./components/MenuButton/index.js');
46
+ var index$g = require('./components/Popover/index.js');
47
+ var index$h = require('./components/Stack/index.js');
47
48
  var DefinitionTooltip = require('./components/Tooltip/DefinitionTooltip.js');
48
- var index$g = require('./components/Theme/index.js');
49
+ var Tooltip = require('./components/Tooltip/Tooltip.js');
50
+ require('./components/Text/index.js');
51
+ var index$i = require('./components/Theme/index.js');
49
52
  var usePrefix = require('./internal/usePrefix.js');
50
53
  var useIdPrefix = require('./internal/useIdPrefix.js');
51
54
  var useContextMenu = require('./components/ContextMenu/useContextMenu.js');
@@ -80,7 +83,6 @@ var NumberInput_Skeleton = require('./components/NumberInput/NumberInput.Skeleto
80
83
  var ProgressIndicator_Skeleton = require('./components/ProgressIndicator/ProgressIndicator.Skeleton.js');
81
84
  var ExpandableSearch = require('./components/ExpandableSearch/ExpandableSearch.js');
82
85
  var Tabs_Skeleton = require('./components/Tabs/Tabs.Skeleton.js');
83
- var RadioTile = require('./components/RadioTile/RadioTile.js');
84
86
  var Toggle = require('./components/Toggle/Toggle.js');
85
87
  var TreeNode = require('./components/TreeView/TreeNode.js');
86
88
  var TreeView = require('./components/TreeView/TreeView.js');
@@ -189,6 +191,7 @@ var TextArea = require('./components/TextArea/TextArea.js');
189
191
  var TextInput_Skeleton = require('./components/TextInput/TextInput.Skeleton.js');
190
192
  var TextInput = require('./components/TextInput/TextInput.js');
191
193
  var Tile = require('./components/Tile/Tile.js');
194
+ var RadioTile = require('./components/RadioTile/RadioTile.js');
192
195
  var TimePicker = require('./components/TimePicker/TimePicker.js');
193
196
  var UnorderedList = require('./components/UnorderedList/UnorderedList.js');
194
197
  var SkeletonText = require('./components/SkeletonText/SkeletonText.js');
@@ -216,14 +219,13 @@ var SideNavMenu = require('./components/UIShell/SideNavMenu.js');
216
219
  var SideNavMenuItem = require('./components/UIShell/SideNavMenuItem.js');
217
220
  var SideNavSwitcher = require('./components/UIShell/SideNavSwitcher.js');
218
221
  var Stack = require('./components/Stack/Stack.js');
219
- var Tooltip = require('./components/Tooltip/Tooltip.js');
220
222
 
221
223
 
222
224
 
223
225
  exports.Checkbox = Checkbox["default"];
224
226
  exports.CheckboxSkeleton = Checkbox_Skeleton["default"];
225
- exports.ClassPrefix = index$2.ClassPrefix;
226
- exports.ContentSwitcher = index$3["default"];
227
+ exports.ClassPrefix = index$4.ClassPrefix;
228
+ exports.ContentSwitcher = index$5["default"];
227
229
  exports.Dropdown = Dropdown["default"];
228
230
  exports.DropdownSkeleton = Dropdown_Skeleton["default"];
229
231
  exports.FluidForm = FluidForm["default"];
@@ -233,17 +235,17 @@ exports.Grid = Grid.Grid;
233
235
  exports.Row = Row["default"];
234
236
  exports.Column = Column["default"];
235
237
  exports.ColumnHang = ColumnHang.ColumnHang;
236
- exports.IdPrefix = index$4.IdPrefix;
237
- exports.OverflowMenu = index$5["default"];
238
- exports.Slider = index$6["default"];
239
- exports.Tab = index$7["default"];
240
- exports.TileGroup = index$8["default"];
241
- exports.TimePickerSelect = index$9["default"];
242
- exports.Toggletip = index$a.Toggletip;
243
- exports.ToggletipActions = index$a.ToggletipActions;
244
- exports.ToggletipButton = index$a.ToggletipButton;
245
- exports.ToggletipContent = index$a.ToggletipContent;
246
- exports.ToggletipLabel = index$a.ToggletipLabel;
238
+ exports.IdPrefix = index$6.IdPrefix;
239
+ exports.OverflowMenu = index$7["default"];
240
+ exports.Slider = index$8["default"];
241
+ exports.Tab = index$9["default"];
242
+ exports.TileGroup = index$a["default"];
243
+ exports.TimePickerSelect = index$b["default"];
244
+ exports.Toggletip = index$c.Toggletip;
245
+ exports.ToggletipActions = index$c.ToggletipActions;
246
+ exports.ToggletipButton = index$c.ToggletipButton;
247
+ exports.ToggletipContent = index$c.ToggletipContent;
248
+ exports.ToggletipLabel = index$c.ToggletipLabel;
247
249
  exports.PaginationSkeleton = Pagination_Skeleton["default"];
248
250
  exports.RadioButtonSkeleton = RadioButton_Skeleton["default"];
249
251
  exports.TagSkeleton = Tag_Skeleton["default"];
@@ -253,21 +255,24 @@ exports.IconSkeleton = Icon_Skeleton["default"];
253
255
  exports.unstable_FeatureFlags = index.FeatureFlags;
254
256
  exports.unstable_useFeatureFlag = index.useFeatureFlag;
255
257
  exports.unstable_useFeatureFlags = index.useFeatureFlags;
256
- exports.Heading = index$b.Heading;
257
- exports.Section = index$b.Section;
258
- exports.IconButton = index$c.IconButton;
259
- exports.Layer = index$d.Layer;
260
- exports.useLayer = index$d.useLayer;
258
+ exports.Heading = index$d.Heading;
259
+ exports.Section = index$d.Section;
260
+ exports.IconButton = index$e.IconButton;
261
+ exports.Layer = index$f.Layer;
262
+ exports.useLayer = index$f.useLayer;
261
263
  exports.unstable_OverflowMenuV2 = index$1.OverflowMenuV2;
262
- exports.Popover = index$e.Popover;
263
- exports.PopoverContent = index$e.PopoverContent;
264
- exports.HStack = index$f.HStack;
265
- exports.VStack = index$f.VStack;
264
+ exports.unstable_ComboButton = index$2.ComboButton;
265
+ exports.unstable_MenuButton = index$3.MenuButton;
266
+ exports.Popover = index$g.Popover;
267
+ exports.PopoverContent = index$g.PopoverContent;
268
+ exports.HStack = index$h.HStack;
269
+ exports.VStack = index$h.VStack;
266
270
  exports.DefinitionTooltip = DefinitionTooltip.DefinitionTooltip;
267
- exports.GlobalTheme = index$g.GlobalTheme;
268
- exports.Theme = index$g.Theme;
269
- exports.ThemeContext = index$g.ThemeContext;
270
- exports.useTheme = index$g.useTheme;
271
+ exports.Tooltip = Tooltip.Tooltip;
272
+ exports.GlobalTheme = index$i.GlobalTheme;
273
+ exports.Theme = index$i.Theme;
274
+ exports.ThemeContext = index$i.ThemeContext;
275
+ exports.useTheme = index$i.useTheme;
271
276
  exports.PrefixContext = usePrefix.PrefixContext;
272
277
  exports.usePrefix = usePrefix.usePrefix;
273
278
  exports.useIdPrefix = useIdPrefix.useIdPrefix;
@@ -303,7 +308,6 @@ exports.NumberInputSkeleton = NumberInput_Skeleton["default"];
303
308
  exports.ProgressIndicatorSkeleton = ProgressIndicator_Skeleton["default"];
304
309
  exports.ExpandableSearch = ExpandableSearch["default"];
305
310
  exports.TabsSkeleton = Tabs_Skeleton["default"];
306
- exports.RadioTile = RadioTile["default"];
307
311
  exports.Toggle = Toggle.Toggle;
308
312
  exports.TreeNode = TreeNode["default"];
309
313
  exports.TreeView = TreeView["default"];
@@ -437,6 +441,7 @@ exports.SelectableTile = Tile.SelectableTile;
437
441
  exports.Tile = Tile.Tile;
438
442
  exports.TileAboveTheFoldContent = Tile.TileAboveTheFoldContent;
439
443
  exports.TileBelowTheFoldContent = Tile.TileBelowTheFoldContent;
444
+ exports.RadioTile = RadioTile["default"];
440
445
  exports.TimePicker = TimePicker["default"];
441
446
  exports.UnorderedList = UnorderedList["default"];
442
447
  exports.SkeletonText = SkeletonText["default"];
@@ -464,4 +469,3 @@ exports.SideNavMenu = SideNavMenu["default"];
464
469
  exports.SideNavMenuItem = SideNavMenuItem["default"];
465
470
  exports.SideNavSwitcher = SideNavSwitcher["default"];
466
471
  exports.Stack = Stack.Stack;
467
- exports.Tooltip = Tooltip.Tooltip;
@@ -34,8 +34,7 @@ var ClickListener = /*#__PURE__*/function (_React$Component) {
34
34
  _rollupPluginBabelHelpers.classCallCheck(this, ClickListener);
35
35
 
36
36
  _this = _super.call(this, props); // We manually bind handlers in this Component, versus using class
37
- // properties, so that we can properly test the `handleRef` handler with
38
- // enzyme.
37
+ // properties, so that we can properly test the `handleRef` handler.
39
38
 
40
39
  _this.handleRef = _this.handleRef.bind(_rollupPluginBabelHelpers.assertThisInitialized(_this));
41
40
  _this.handleDocumentClick = _this.handleDocumentClick.bind(_rollupPluginBabelHelpers.assertThisInitialized(_this));
@@ -57,7 +57,7 @@ function matches(event, keysToMatch) {
57
57
  * }
58
58
  * }
59
59
  *
60
- * @param {Event|number|string} eventOrCode
60
+ * @param {React.KeyboardEvent|Event|number|string} eventOrCode
61
61
  * @param {Key} key
62
62
  * @returns {boolean}
63
63
  */
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
+ var React = require('react');
14
+
15
+ /**
16
+ * @typedef {object} useAttachedMenuReturn
17
+ * @property {boolean} open Whether the menu is open or not
18
+ * @property {[number, number]} x The x position of the menu
19
+ * @property {[number, number]} y The y position of the menu
20
+ * @property {Function} handleClick A function to be called when the trigger element receives a click event
21
+ * @property {Function} handleMousedown A function to be called when the trigger element recives a mousedown event
22
+ * @property {Function} handleClose A function to be called when the menu emits onClose
23
+ */
24
+
25
+ /**
26
+ * This hook contains common code to be used when a menu should be visually attached to an anchor based on a click event.
27
+ *
28
+ * @param {Element|object} anchor The element or ref the menu should visually be attached to.
29
+ * @returns {useAttachedMenuReturn}
30
+ */
31
+
32
+ function useAttachedMenu(anchor) {
33
+ var _useState = React.useState(false),
34
+ _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
35
+ open = _useState2[0],
36
+ setOpen = _useState2[1];
37
+
38
+ var _useState3 = React.useState([[-1, -1], [-1, -1]]),
39
+ _useState4 = _rollupPluginBabelHelpers.slicedToArray(_useState3, 2),
40
+ position = _useState4[0],
41
+ setPosition = _useState4[1];
42
+
43
+ function openMenu() {
44
+ var anchorEl = (anchor === null || anchor === void 0 ? void 0 : anchor.current) || anchor;
45
+
46
+ if (anchorEl) {
47
+ var _anchorEl$getBounding = anchorEl.getBoundingClientRect(),
48
+ left = _anchorEl$getBounding.left,
49
+ top = _anchorEl$getBounding.top,
50
+ right = _anchorEl$getBounding.right,
51
+ bottom = _anchorEl$getBounding.bottom;
52
+
53
+ setPosition([[left, right], [top, bottom]]);
54
+ }
55
+
56
+ setOpen(true);
57
+ }
58
+
59
+ function closeMenu() {
60
+ setOpen(false);
61
+ }
62
+
63
+ function handleClick() {
64
+ if (open) {
65
+ closeMenu();
66
+ } else {
67
+ openMenu();
68
+ }
69
+ }
70
+
71
+ function handleMousedown(e) {
72
+ // prevent default for mousedown on trigger element to avoid
73
+ // the "blur" event from firing on the menu as this would close
74
+ // it and immediately re-open since "click" event is fired after
75
+ // "blur" event.
76
+ e.preventDefault();
77
+ }
78
+
79
+ return {
80
+ open: open,
81
+ x: position[0],
82
+ y: position[1],
83
+ handleClick: handleClick,
84
+ handleMousedown: handleMousedown,
85
+ handleClose: closeMenu
86
+ };
87
+ }
88
+
89
+ exports.useAttachedMenu = useAttachedMenu;
@@ -0,0 +1,19 @@
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
+ import { SetStateAction } from 'react';
8
+ /**
9
+ * `useDelayedState` mirrors `useState` but also allows you to add a delay to
10
+ * when your state updates. You can provide a second argument to `setState`,
11
+ * `delayMs`, which will be the time in milliseconds after which the state is
12
+ * updated.
13
+ *
14
+ * This hook will clean up pending timers in `useEffect` and will cancel any
15
+ * pending timers when a `setState` is called before the state is updated from
16
+ * a previous call
17
+ */
18
+ export type DispatchWithDelay<A> = (value: A, delayMS?: number) => void;
19
+ export declare function useDelayedState<S>(initialState: S): [S, DispatchWithDelay<SetStateAction<S>>];
@@ -33,8 +33,10 @@ function useDelayedState(initialState) {
33
33
  // always return the same reference for the `setState` updater
34
34
 
35
35
  var setStateWithDelay = React.useCallback(function (stateToSet) {
36
+ var _timeoutId$current;
37
+
36
38
  var delayMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
37
- clearTimeout(timeoutId.current);
39
+ window.clearTimeout((_timeoutId$current = timeoutId.current) !== null && _timeoutId$current !== void 0 ? _timeoutId$current : undefined);
38
40
  timeoutId.current = null;
39
41
 
40
42
  if (delayMs === 0) {
@@ -42,14 +44,16 @@ function useDelayedState(initialState) {
42
44
  return;
43
45
  }
44
46
 
45
- timeoutId.current = setTimeout(function () {
47
+ timeoutId.current = window.setTimeout(function () {
46
48
  setState(stateToSet);
47
49
  timeoutId.current = null;
48
50
  }, delayMs);
49
51
  }, []);
50
52
  React.useEffect(function () {
51
53
  return function () {
52
- clearTimeout(timeoutId.current);
54
+ var _timeoutId$current2;
55
+
56
+ window.clearTimeout((_timeoutId$current2 = timeoutId.current) !== null && _timeoutId$current2 !== void 0 ? _timeoutId$current2 : undefined);
53
57
  };
54
58
  }, []);
55
59
  return [state, setStateWithDelay];
@@ -54,7 +54,7 @@ function useId() {
54
54
  }
55
55
  /**
56
56
  * Generate a unique id if a given `id` is not provided
57
- * @param {string} id
57
+ * @param {string|undefined} id
58
58
  * @returns {string}
59
59
  */
60
60
 
@@ -22,12 +22,21 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
22
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
23
23
 
24
24
  var _excluded = ["className"];
25
+ /**
26
+ * @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
27
+ * @returns
28
+ */
25
29
 
26
30
  var wrapComponent = function wrapComponent(_ref) {
27
31
  var name = _ref.name,
28
32
  getClassName = _ref.className,
29
33
  type = _ref.type;
30
34
 
35
+ /**
36
+ *
37
+ * @param {{ className?: string, [x: string]: any}} param0
38
+ * @returns
39
+ */
31
40
  function Component(_ref2) {
32
41
  var baseClassName = _ref2.className,
33
42
  other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded);