@carbon/ibm-products 2.46.0 → 2.47.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 (183) hide show
  1. package/css/config-dev.css +6 -1
  2. package/css/config-dev.css.map +1 -1
  3. package/css/config.css +6 -1
  4. package/css/config.css.map +1 -1
  5. package/css/index-full-carbon.css +1323 -264
  6. package/css/index-full-carbon.css.map +1 -1
  7. package/css/index-full-carbon.min.css +1 -1
  8. package/css/index-full-carbon.min.css.map +1 -1
  9. package/css/index-without-carbon-released-only.css +49 -60
  10. package/css/index-without-carbon-released-only.css.map +1 -1
  11. package/css/index-without-carbon-released-only.min.css +1 -1
  12. package/css/index-without-carbon-released-only.min.css.map +1 -1
  13. package/css/index-without-carbon.css +1323 -264
  14. package/css/index-without-carbon.css.map +1 -1
  15. package/css/index-without-carbon.min.css +1 -1
  16. package/css/index-without-carbon.min.css.map +1 -1
  17. package/css/index.css +1323 -264
  18. package/css/index.css.map +1 -1
  19. package/css/index.min.css +1 -1
  20. package/css/index.min.css.map +1 -1
  21. package/es/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  22. package/es/components/ActionBar/ActionBar.d.ts +58 -2
  23. package/es/components/ActionBar/ActionBar.js +14 -9
  24. package/es/components/ActionBar/ActionBarItem.d.ts +36 -2
  25. package/es/components/ActionBar/ActionBarItem.js +7 -4
  26. package/es/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  27. package/es/components/ActionBar/ActionBarOverflowItems.js +8 -4
  28. package/es/components/AddSelect/types/index.d.ts +6 -0
  29. package/es/components/Card/Card.d.ts +68 -2
  30. package/es/components/Card/Card.js +28 -35
  31. package/es/components/Card/CardFooter.d.ts +51 -48
  32. package/es/components/Card/CardFooter.js +4 -2
  33. package/es/components/Card/CardHeader.d.ts +67 -49
  34. package/es/components/Card/CardHeader.js +4 -2
  35. package/es/components/Coachmark/utils/enums.d.ts +6 -0
  36. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  37. package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +17 -4
  38. package/es/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
  39. package/es/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +6 -4
  40. package/es/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
  41. package/es/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
  42. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
  43. package/es/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
  44. package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
  45. package/es/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
  46. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  47. package/es/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
  48. package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
  49. package/es/components/DataSpreadsheet/types/index.d.ts +6 -0
  50. package/es/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  51. package/es/components/Datagrid/Datagrid/DatagridContent.js +3 -2
  52. package/es/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  53. package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
  54. package/es/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  55. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  56. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  57. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  58. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
  59. package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
  60. package/es/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  61. package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  62. package/es/components/Datagrid/common-column-ids.d.ts +6 -0
  63. package/es/components/Datagrid/types/index.d.ts +6 -0
  64. package/es/components/Datagrid/useDatagrid.d.ts +6 -0
  65. package/es/components/Datagrid/useDisableSelectRows.d.ts +6 -0
  66. package/es/components/Datagrid/useInitialColumnSort.js +4 -0
  67. package/es/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  68. package/es/components/Datagrid/useSortableColumns.d.ts +5 -4
  69. package/es/components/Datagrid/useSortableColumns.js +18 -13
  70. package/es/components/EmptyStates/EmptyState.d.ts +72 -5
  71. package/es/components/EmptyStates/EmptyState.js +8 -5
  72. package/es/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  73. package/es/components/EmptyStates/EmptyStateV2.js +3 -2
  74. package/es/components/FullPageError/FullPageError.d.ts +36 -2
  75. package/es/components/FullPageError/FullPageError.js +0 -3
  76. package/es/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  77. package/es/components/GetStartedCard/GetStartedCard.js +11 -10
  78. package/es/components/PageHeader/PageHeaderUtils.js +1 -1
  79. package/es/components/StringFormatter/utils/enums.js +7 -0
  80. package/es/components/TagOverflow/TagOverflow.d.ts +35 -4
  81. package/es/components/TagOverflow/TagOverflow.js +47 -64
  82. package/es/components/TagOverflow/TagOverflowModal.js +4 -6
  83. package/es/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  84. package/es/components/TagOverflow/TagOverflowPopover.js +38 -41
  85. package/es/components/Tearsheet/TearsheetShell.js +4 -1
  86. package/es/components/UserAvatar/UserAvatar.d.ts +59 -1
  87. package/es/components/UserAvatar/UserAvatar.js +7 -23
  88. package/es/global/js/utils/scrollableAncestor.js +7 -0
  89. package/es/global/js/utils/uuidv4.d.ts +6 -0
  90. package/es/global/js/utils/uuidv4.js +2 -0
  91. package/es/global/js/utils/wait.d.ts +6 -0
  92. package/es/global/js/utils/wait.js +2 -0
  93. package/flags.js +7 -0
  94. package/lib/components/APIKeyModal/APIKeyModal.types.d.ts +6 -0
  95. package/lib/components/ActionBar/ActionBar.d.ts +58 -2
  96. package/lib/components/ActionBar/ActionBar.js +14 -9
  97. package/lib/components/ActionBar/ActionBarItem.d.ts +36 -2
  98. package/lib/components/ActionBar/ActionBarItem.js +6 -3
  99. package/lib/components/ActionBar/ActionBarOverflowItems.d.ts +55 -16
  100. package/lib/components/ActionBar/ActionBarOverflowItems.js +8 -4
  101. package/lib/components/AddSelect/types/index.d.ts +6 -0
  102. package/lib/components/Card/Card.d.ts +68 -2
  103. package/lib/components/Card/Card.js +28 -35
  104. package/lib/components/Card/CardFooter.d.ts +51 -48
  105. package/lib/components/Card/CardFooter.js +4 -2
  106. package/lib/components/Card/CardHeader.d.ts +67 -49
  107. package/lib/components/Card/CardHeader.js +4 -2
  108. package/lib/components/Coachmark/utils/enums.d.ts +6 -0
  109. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.d.ts +1 -0
  110. package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +16 -3
  111. package/lib/components/ConditionBuilder/ConditionBuilderAdd/ConditionBuilderAdd.js +2 -2
  112. package/lib/components/ConditionBuilder/ConditionBuilderButton/ConditionBuilderButton.js +5 -3
  113. package/lib/components/ConditionBuilder/ConditionBuilderConnector/ConditionConnector.js +4 -1
  114. package/lib/components/ConditionBuilder/ConditionBuilderContent/ConditionBuilderContent.js +8 -2
  115. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.d.ts +3 -0
  116. package/lib/components/ConditionBuilder/ConditionBuilderContext/translationObject.js +5 -2
  117. package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +20 -4
  118. package/lib/components/ConditionBuilder/ConditionGroupBuilder/ConditionGroupBuilder.js +15 -7
  119. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.d.ts +3 -1
  120. package/lib/components/ConditionBuilder/ConditionPreview/ConditionPreview.js +9 -3
  121. package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +19 -6
  122. package/lib/components/DataSpreadsheet/types/index.d.ts +6 -0
  123. package/lib/components/Datagrid/Datagrid/DatagridBody.d.ts +6 -0
  124. package/lib/components/Datagrid/Datagrid/DatagridContent.js +3 -2
  125. package/lib/components/Datagrid/Datagrid/DatagridRefBody.d.ts +6 -0
  126. package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -5
  127. package/lib/components/Datagrid/Datagrid/DatagridSimpleBody.d.ts +6 -0
  128. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +3 -1
  129. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +6 -0
  130. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +1 -1
  131. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +3 -2
  132. package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +13 -8
  133. package/lib/components/Datagrid/Datagrid/addons/Filtering/handleCheckboxChange.js +7 -0
  134. package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditCell/InlineEditCell.js +1 -1
  135. package/lib/components/Datagrid/common-column-ids.d.ts +6 -0
  136. package/lib/components/Datagrid/types/index.d.ts +6 -0
  137. package/lib/components/Datagrid/useDatagrid.d.ts +6 -0
  138. package/lib/components/Datagrid/useDisableSelectRows.d.ts +6 -0
  139. package/lib/components/Datagrid/useInitialColumnSort.js +4 -0
  140. package/lib/components/Datagrid/useRowIsMouseOver.d.ts +6 -0
  141. package/lib/components/Datagrid/useSortableColumns.d.ts +5 -4
  142. package/lib/components/Datagrid/useSortableColumns.js +18 -13
  143. package/lib/components/EmptyStates/EmptyState.d.ts +72 -5
  144. package/lib/components/EmptyStates/EmptyState.js +8 -5
  145. package/lib/components/EmptyStates/EmptyStateV2.d.ts +63 -2
  146. package/lib/components/EmptyStates/EmptyStateV2.js +3 -2
  147. package/lib/components/FullPageError/FullPageError.d.ts +36 -2
  148. package/lib/components/FullPageError/FullPageError.js +0 -3
  149. package/lib/components/GetStartedCard/GetStartedCard.d.ts +60 -2
  150. package/lib/components/GetStartedCard/GetStartedCard.js +10 -9
  151. package/lib/components/PageHeader/PageHeaderUtils.js +1 -1
  152. package/lib/components/StringFormatter/utils/enums.js +7 -0
  153. package/lib/components/TagOverflow/TagOverflow.d.ts +35 -4
  154. package/lib/components/TagOverflow/TagOverflow.js +46 -63
  155. package/lib/components/TagOverflow/TagOverflowModal.js +4 -6
  156. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +13 -1
  157. package/lib/components/TagOverflow/TagOverflowPopover.js +37 -40
  158. package/lib/components/Tearsheet/TearsheetShell.js +4 -1
  159. package/lib/components/UserAvatar/UserAvatar.d.ts +59 -1
  160. package/lib/components/UserAvatar/UserAvatar.js +7 -23
  161. package/lib/global/js/utils/scrollableAncestor.js +7 -0
  162. package/lib/global/js/utils/uuidv4.d.ts +6 -0
  163. package/lib/global/js/utils/uuidv4.js +2 -0
  164. package/lib/global/js/utils/wait.d.ts +6 -0
  165. package/lib/global/js/utils/wait.js +2 -0
  166. package/package.json +4 -4
  167. package/scss/components/ConditionBuilder/_condition-builder.scss +3 -0
  168. package/scss/components/ConditionBuilder/styles/_conditionBuilderCondition.scss +18 -2
  169. package/scss/components/ConditionBuilder/styles/_conditionBuilderItem.scss +48 -31
  170. package/scss/components/ConditionBuilder/styles/_index.scss +7 -0
  171. package/scss/components/CreateModal/_create-modal.scss +0 -4
  172. package/scss/components/Datagrid/styles/_datagrid.scss +1 -0
  173. package/scss/components/Datagrid/styles/_useActionsColumn.scss +6 -7
  174. package/scss/components/Datagrid/styles/_useColumnRightAlign.scss +6 -7
  175. package/scss/components/Datagrid/styles/_useExpandedRow.scss +6 -7
  176. package/scss/components/Datagrid/styles/_useInlineEdit.scss +6 -7
  177. package/scss/components/Datagrid/styles/_useNestedRows.scss +6 -7
  178. package/scss/components/Datagrid/styles/_useNestedTable.scss +6 -7
  179. package/scss/components/Datagrid/styles/_useStickyColumn.scss +6 -7
  180. package/scss/components/Datagrid/styles/addons/_RowSizeDropdown.scss +6 -7
  181. package/scss/config-dev.scss +7 -0
  182. package/scss/config.scss +7 -0
  183. package/telemetry.yml +2 -0
@@ -1,10 +1,41 @@
1
1
  /**
2
- * TODO: A description of the component.
2
+ * Copyright IBM Corp. 2024, 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.
3
6
  */
4
- export let TagOverflow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
7
+ import React, { RefObject, ReactNode } from 'react';
8
+ export interface TagOverflowItem {
9
+ className?: string;
10
+ filter?: string;
11
+ id: string;
12
+ label: string;
13
+ onClose: () => void;
14
+ tagType?: 'red' | 'magenta' | 'purple' | 'blue' | 'cyan' | 'teal' | 'green' | 'gray' | 'cool-gray' | 'warm-gray' | 'high-contrast' | 'outline';
15
+ type?: string;
16
+ }
17
+ export interface Props {
18
+ align?: 'start' | 'center' | 'end';
19
+ allTagsModalSearchLabel?: string;
20
+ allTagsModalSearchPlaceholderText?: string;
21
+ allTagsModalTarget?: ReactNode;
22
+ allTagsModalTitle?: string;
23
+ className?: string;
24
+ containingElementRef?: RefObject<HTMLElement>;
25
+ items: TagOverflowItem[];
26
+ maxVisible?: number;
27
+ measurementOffset?: number;
28
+ multiline?: boolean;
29
+ overflowAlign?: 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'left-bottom' | 'left-top' | 'right' | 'right-bottom' | 'right-top';
30
+ overflowClassName?: string;
31
+ overflowType?: 'default' | 'tag';
32
+ onOverflowTagChange?: (arr: TagOverflowItem[]) => void;
33
+ showAllTagsLabel?: string;
34
+ tagComponent?: string;
35
+ }
36
+ export declare let TagOverflow: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
5
37
  /**
6
38
  * The strings shown in the showAllModal are only shown if we have more than allTagsModalSearchLThreshold
7
39
  * @returns null if no problems
8
40
  */
9
- export const string_required_if_more_than_10_tags: (props: any, propName: any, componentName: any, location: any, propFullName: any, secret: any) => any;
10
- import React from 'react';
41
+ export declare const string_required_if_more_than_10_tags: (props: any, propName: any, componentName: any, location: any, propFullName: any, secret: any) => any;
@@ -27,52 +27,36 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
27
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
29
29
 
30
- var _excluded = ["items", "tagComponent", "align", "showAllTagsLabel", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTarget", "allTagsModalTitle", "className", "containingElementRef", "measurementOffset", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "onOverflowTagChange"],
30
+ var _excluded = ["align", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTarget", "allTagsModalTitle", "className", "containingElementRef", "items", "maxVisible", "measurementOffset", "multiline", "overflowAlign", "overflowClassName", "overflowType", "onOverflowTagChange", "showAllTagsLabel", "tagComponent"],
31
31
  _excluded2 = ["className", "id"],
32
32
  _excluded3 = ["tagType"],
33
33
  _excluded4 = ["id", "label", "tagType", "onClose"];
34
34
  var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow");
35
35
  var componentName = 'TagOverflow';
36
36
  var allTagsModalSearchThreshold = 10;
37
-
38
- // Default values for props
39
- var defaults = {
40
- items: [],
41
- align: 'start',
42
- measurementOffset: 0,
43
- overflowAlign: 'bottom',
44
- overflowType: 'default',
45
- onOverflowTagChange: function onOverflowTagChange() {}
46
- };
47
-
48
- /**
49
- * TODO: A description of the component.
50
- */
51
- exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
52
- var _ref$items = _ref.items,
53
- items = _ref$items === void 0 ? defaults.items : _ref$items,
54
- tagComponent = _ref.tagComponent,
55
- _ref$align = _ref.align,
56
- align = _ref$align === void 0 ? defaults.align : _ref$align,
57
- showAllTagsLabel = _ref.showAllTagsLabel,
58
- allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
59
- allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
60
- allTagsModalTarget = _ref.allTagsModalTarget,
61
- allTagsModalTitle = _ref.allTagsModalTitle,
62
- className = _ref.className,
63
- containingElementRef = _ref.containingElementRef,
64
- _ref$measurementOffse = _ref.measurementOffset,
65
- measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
66
- maxVisible = _ref.maxVisible,
67
- multiline = _ref.multiline,
68
- _ref$overflowAlign = _ref.overflowAlign,
69
- overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
70
- overflowClassName = _ref.overflowClassName,
71
- _ref$overflowType = _ref.overflowType,
72
- overflowType = _ref$overflowType === void 0 ? defaults.overflowType : _ref$overflowType,
73
- _ref$onOverflowTagCha = _ref.onOverflowTagChange,
74
- onOverflowTagChange = _ref$onOverflowTagCha === void 0 ? defaults.onOverflowTagChange : _ref$onOverflowTagCha,
75
- rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
37
+ exports.TagOverflow = /*#__PURE__*/React.forwardRef(function (props, ref) {
38
+ var _props$align = props.align,
39
+ align = _props$align === void 0 ? 'start' : _props$align,
40
+ allTagsModalSearchLabel = props.allTagsModalSearchLabel,
41
+ allTagsModalSearchPlaceholderText = props.allTagsModalSearchPlaceholderText,
42
+ allTagsModalTarget = props.allTagsModalTarget,
43
+ allTagsModalTitle = props.allTagsModalTitle,
44
+ className = props.className,
45
+ containingElementRef = props.containingElementRef,
46
+ items = props.items,
47
+ maxVisible = props.maxVisible,
48
+ _props$measurementOff = props.measurementOffset,
49
+ measurementOffset = _props$measurementOff === void 0 ? 0 : _props$measurementOff,
50
+ multiline = props.multiline,
51
+ _props$overflowAlign = props.overflowAlign,
52
+ overflowAlign = _props$overflowAlign === void 0 ? 'bottom' : _props$overflowAlign,
53
+ overflowClassName = props.overflowClassName,
54
+ _props$overflowType = props.overflowType,
55
+ overflowType = _props$overflowType === void 0 ? 'default' : _props$overflowType,
56
+ onOverflowTagChange = props.onOverflowTagChange,
57
+ showAllTagsLabel = props.showAllTagsLabel,
58
+ tagComponent = props.tagComponent,
59
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
76
60
  var localContainerRef = React.useRef(null);
77
61
  var containerRef = ref || localContainerRef;
78
62
  var itemRefs = React.useRef(null);
@@ -109,7 +93,9 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
109
93
  setShowAllModalOpen(false);
110
94
  };
111
95
  var handleResize = function handleResize() {
112
- setContainerWidth(resizeElm.current.offsetWidth);
96
+ if (typeof resizeElm !== 'function' && resizeElm.current) {
97
+ setContainerWidth(resizeElm.current.offsetWidth);
98
+ }
113
99
  };
114
100
  useResizeObserver.useResizeObserver(resizeElm, handleResize);
115
101
  var getMap = function getMap() {
@@ -125,7 +111,6 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
125
111
  }
126
112
  };
127
113
  var getVisibleItems = React.useCallback(function () {
128
- var _overflowRef$current;
129
114
  if (!itemRefs.current) {
130
115
  return items;
131
116
  }
@@ -137,13 +122,13 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
137
122
  var optionalContainingElement = containingElementRef === null || containingElementRef === void 0 ? void 0 : containingElementRef.current;
138
123
  var measurementOffsetValue = typeof measurementOffset === 'number' ? measurementOffset : 0;
139
124
  var spaceAvailable = optionalContainingElement ? optionalContainingElement.offsetWidth - measurementOffsetValue : containerWidth;
140
- var overflowContainerWidth = ((_overflowRef$current = overflowRef.current) === null || _overflowRef$current === void 0 ? void 0 : _overflowRef$current.offsetWidth) > overflowIndicatorWidth ? overflowRef.current.offsetWidth : overflowIndicatorWidth;
125
+ var overflowContainerWidth = overflowRef && overflowRef.current && overflowRef.current.offsetWidth > overflowIndicatorWidth ? overflowRef.current.offsetWidth : overflowIndicatorWidth;
141
126
  var maxWidth = spaceAvailable - overflowContainerWidth;
142
127
  var childrenWidth = 0;
143
128
  var maxReached = false;
144
129
  return items.reduce(function (prev, cur) {
145
130
  if (!maxReached) {
146
- var itemWidth = map.get(cur.id) + itemOffset;
131
+ var itemWidth = (map ? Number(map.get(cur.id)) : 0) + itemOffset;
147
132
  var fits = itemWidth + childrenWidth < maxWidth;
148
133
  if (fits) {
149
134
  childrenWidth += itemWidth;
@@ -154,12 +139,13 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
154
139
  }
155
140
  return prev;
156
141
  }, []);
157
- }, [itemRefs, overflowRef, containerWidth, items, multiline, maxVisible, containingElementRef, measurementOffset]);
158
- var getCustomComponent = function getCustomComponent(item) {
142
+ }, [containerWidth, containingElementRef, items, maxVisible, measurementOffset, multiline]);
143
+ var getCustomComponent = function getCustomComponent(item, tagComponent) {
159
144
  var className = item.className,
160
145
  id = item.id,
161
146
  other = _rollupPluginBabelHelpers.objectWithoutProperties(item, _excluded2);
162
- return /*#__PURE__*/React__default["default"].createElement(tagComponent, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, other), {}, {
147
+ return /*#__PURE__*/React.createElement(tagComponent, _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, other), {}, {
148
+ key: id,
163
149
  className: cx__default["default"]("".concat(blockClass, "__item"), className),
164
150
  ref: function ref(node) {
165
151
  return itemRefHandler(id, node);
@@ -173,9 +159,9 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
173
159
  visibleItemsArr = (_visibleItemsArr = visibleItemsArr) === null || _visibleItemsArr === void 0 ? void 0 : _visibleItemsArr.slice(0, maxVisible);
174
160
  }
175
161
  var hiddenItems = items === null || items === void 0 ? void 0 : items.slice(visibleItemsArr.length);
176
- var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (_ref2) {
177
- var tagType = _ref2.tagType,
178
- other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded3);
162
+ var overflowItemsArr = hiddenItems === null || hiddenItems === void 0 ? void 0 : hiddenItems.map(function (_ref) {
163
+ var tagType = _ref.tagType,
164
+ other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded3);
179
165
  return _rollupPluginBabelHelpers.objectSpread2({
180
166
  type: tagType
181
167
  }, other);
@@ -183,10 +169,10 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
183
169
  setVisibleItems(visibleItemsArr);
184
170
  setOverflowItems(overflowItemsArr);
185
171
  onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(overflowItemsArr);
186
- }, [containerWidth, items, maxVisible, getVisibleItems, onOverflowTagChange]);
172
+ }, [getVisibleItems, items, maxVisible, onOverflowTagChange]);
187
173
  var handleTagOnClose = React.useCallback(function (onClose, index) {
188
174
  onClose === null || onClose === void 0 || onClose();
189
- if (index <= visibleItems.length - 1) {
175
+ if (index <= (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) - 1) {
190
176
  setPopoverOpen(false);
191
177
  }
192
178
  }, [visibleItems]);
@@ -194,10 +180,10 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
194
180
  className: cx__default["default"](blockClass, className, "".concat(blockClass, "--align-").concat(align), _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--multiline"), multiline)),
195
181
  ref: containerRef,
196
182
  role: "main"
197
- }, devtools.getDevtoolsProps(componentName)), visibleItems.length > 0 && visibleItems.map(function (item, index) {
183
+ }, devtools.getDevtoolsProps(componentName)), (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0 && visibleItems.map(function (item, index) {
198
184
  // Render custom components
199
185
  if (tagComponent) {
200
- return getCustomComponent(item);
186
+ return getCustomComponent(item, tagComponent);
201
187
  } else {
202
188
  var id = item.id,
203
189
  label = item.label,
@@ -224,7 +210,7 @@ exports.TagOverflow = /*#__PURE__*/React__default["default"].forwardRef(function
224
210
  }), /*#__PURE__*/React__default["default"].createElement("span", {
225
211
  className: "".concat(blockClass, "__indicator"),
226
212
  ref: overflowRef
227
- }, overflowItems.length > 0 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TagOverflowPopover.TagOverflowPopover, {
213
+ }, (overflowItems === null || overflowItems === void 0 ? void 0 : overflowItems.length) > 0 && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(TagOverflowPopover.TagOverflowPopover, {
228
214
  allTagsModalSearchThreshold: allTagsModalSearchThreshold,
229
215
  className: overflowClassName,
230
216
  onShowAllClick: handleShowAllClick,
@@ -260,9 +246,9 @@ var tagTypes = Object.keys(constants.TYPES);
260
246
  * The strings shown in the showAllModal are only shown if we have more than allTagsModalSearchLThreshold
261
247
  * @returns null if no problems
262
248
  */
263
- var string_required_if_more_than_10_tags = propsHelper.isRequiredIf(index["default"].string, function (_ref3) {
264
- var items = _ref3.items;
265
- return items && items.length > allTagsModalSearchThreshold;
249
+ var string_required_if_more_than_10_tags = propsHelper.isRequiredIf(index["default"].string, function (_ref2) {
250
+ var items = _ref2.items;
251
+ return (items === null || items === void 0 ? void 0 : items.length) > allTagsModalSearchThreshold;
266
252
  });
267
253
 
268
254
  // The types and DocGen commentary for the component props,
@@ -293,11 +279,6 @@ exports.TagOverflow.propTypes = {
293
279
  * Provide an optional class to be applied to the containing node.
294
280
  */
295
281
  className: index["default"].string,
296
- /**
297
- * Optional ref for custom resize container to measure available space
298
- * Default will measure the available space of the TagSet container itself.
299
- */
300
- containingElementRef: index["default"].object,
301
282
  /**
302
283
  * The items to be shown in the TagOverflow. Each item is specified as an object with properties:
303
284
  * **label**\* (required) to supply the content,
@@ -308,6 +289,7 @@ exports.TagOverflow.propTypes = {
308
289
  * If you want to render a custom component, pass it as tagComponent prop and
309
290
  * then pass the props required for your custom component as the properties of item object
310
291
  */
292
+ //@ts-ignore
311
293
  items: index["default"].arrayOf(index["default"].shape({
312
294
  id: index["default"].string.isRequired,
313
295
  label: index["default"].string.isRequired,
@@ -351,6 +333,7 @@ exports.TagOverflow.propTypes = {
351
333
  /** Component definition of the items to be rendered inside TagOverflow.
352
334
  * If this is not passed, items will be rendered as Tag component
353
335
  */
336
+ //@ts-ignore
354
337
  tagComponent: index["default"].elementType
355
338
  };
356
339
 
@@ -23,8 +23,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
23
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
25
 
26
- var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"],
27
- _excluded2 = ["label", "id", "filter"];
26
+ var _excluded = ["allTags", "className", "title", "onClose", "open", "overflowType", "portalTarget", "searchLabel", "searchPlaceholder"];
28
27
  var componentName = 'TagOverflowModal';
29
28
  var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow-modal");
30
29
 
@@ -86,13 +85,12 @@ var TagOverflowModal = function TagOverflowModal(_ref) {
86
85
  }, getFilteredItems().map(function (_ref2) {
87
86
  var label = _ref2.label,
88
87
  id = _ref2.id,
89
- filter = _ref2.filter,
90
- other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
88
+ filter = _ref2.filter;
91
89
  var isFilterable = overflowType === 'tag' ? filter : false;
92
- return /*#__PURE__*/React__default["default"].createElement(react.Tag, _rollupPluginBabelHelpers["extends"]({}, other, {
90
+ return /*#__PURE__*/React__default["default"].createElement(react.Tag, {
93
91
  key: id,
94
92
  filter: isFilterable
95
- }), label);
93
+ }, label);
96
94
  })), /*#__PURE__*/React__default["default"].createElement("div", {
97
95
  className: "".concat(blockClass, "__fade")
98
96
  })));
@@ -1,2 +1,14 @@
1
- export const TagOverflowPopover: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
1
  import React from 'react';
2
+ import { TagOverflowItem } from './TagOverflow';
3
+ export interface Props {
4
+ allTagsModalSearchThreshold?: number;
5
+ className?: string;
6
+ onShowAllClick: () => void;
7
+ overflowAlign?: string;
8
+ overflowTags: TagOverflowItem[];
9
+ overflowType?: string;
10
+ popoverOpen?: boolean;
11
+ setPopoverOpen?: (x: boolean) => void;
12
+ showAllTagsLabel?: string;
13
+ }
14
+ export declare const TagOverflowPopover: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
@@ -26,52 +26,48 @@ var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "
26
26
  _excluded2 = ["label", "id", "tagType", "filter", "onClose"];
27
27
  var componentName = 'TagOverflowPopover';
28
28
  var blockClass = "".concat(settings.pkg.prefix, "--tag-overflow-popover");
29
-
30
- // Default values for props
31
- var defaults = {
32
- allTagsModalSearchThreshold: 10,
33
- overflowAlign: 'bottom'
34
- };
35
- var TagOverflowPopover = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
36
- var _ref$allTagsModalSear = _ref.allTagsModalSearchThreshold,
37
- allTagsModalSearchThreshold = _ref$allTagsModalSear === void 0 ? defaults.allTagsModalSearchThreshold : _ref$allTagsModalSear,
38
- className = _ref.className,
39
- onShowAllClick = _ref.onShowAllClick,
40
- _ref$overflowAlign = _ref.overflowAlign,
41
- overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
42
- overflowTags = _ref.overflowTags,
43
- overflowType = _ref.overflowType,
44
- showAllTagsLabel = _ref.showAllTagsLabel,
45
- popoverOpen = _ref.popoverOpen,
46
- setPopoverOpen = _ref.setPopoverOpen,
47
- rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
48
- var localRef = React.useRef();
29
+ var TagOverflowPopover = /*#__PURE__*/React.forwardRef(function (props, ref) {
30
+ var _overflowTags$length;
31
+ var allTagsModalSearchThreshold = props.allTagsModalSearchThreshold,
32
+ className = props.className,
33
+ onShowAllClick = props.onShowAllClick,
34
+ overflowAlign = props.overflowAlign,
35
+ overflowTags = props.overflowTags,
36
+ overflowType = props.overflowType,
37
+ showAllTagsLabel = props.showAllTagsLabel,
38
+ popoverOpen = props.popoverOpen,
39
+ setPopoverOpen = props.setPopoverOpen,
40
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
41
+ var localRef = React.useRef(null);
49
42
  var overflowTagContent = React.useRef(null);
50
43
  useClickOutside.useClickOutside(ref || localRef, function () {
51
44
  if (popoverOpen) {
52
- setPopoverOpen(false);
45
+ setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
53
46
  }
54
47
  });
55
48
  var handleShowAllTagsClick = function handleShowAllTagsClick(evt) {
56
49
  evt.stopPropagation();
57
50
  evt.preventDefault();
58
- setPopoverOpen(false);
59
- onShowAllClick();
51
+ setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
52
+ onShowAllClick === null || onShowAllClick === void 0 || onShowAllClick();
60
53
  };
61
- var handleEscKeyPress = function handleEscKeyPress(event) {
62
- var key = event.key;
54
+ var handleEscKeyPress = function handleEscKeyPress(evt) {
55
+ var key = evt.key;
63
56
  if (key === 'Escape') {
64
- setPopoverOpen(false);
57
+ setPopoverOpen === null || setPopoverOpen === void 0 || setPopoverOpen(false);
65
58
  }
66
59
  };
67
60
  var getOverflowPopoverItems = function getOverflowPopoverItems() {
68
- return overflowTags.filter(function (_, index) {
69
- return overflowTags.length > allTagsModalSearchThreshold ? index < allTagsModalSearchThreshold : index <= allTagsModalSearchThreshold;
61
+ var thresh = allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0;
62
+ return overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.filter(function (_, index) {
63
+ return (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) > thresh ? index < thresh : index <= thresh;
70
64
  });
71
65
  };
66
+ var visibleItems = getOverflowPopoverItems();
67
+ var hasItems = (visibleItems === null || visibleItems === void 0 ? void 0 : visibleItems.length) > 0;
72
68
  return /*#__PURE__*/React__default["default"].createElement("span", _rollupPluginBabelHelpers["extends"]({}, rest, {
73
- "aria-hidden": overflowTags.length === 0,
74
- className: cx__default["default"](blockClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--hidden"), overflowTags.length === 0)),
69
+ "aria-hidden": (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0,
70
+ className: cx__default["default"](blockClass, _rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "--hidden"), (overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) === 0)),
75
71
  ref: ref || localRef
76
72
  }), /*#__PURE__*/React__default["default"].createElement(react.Popover, {
77
73
  align: overflowAlign,
@@ -82,21 +78,21 @@ var TagOverflowPopover = /*#__PURE__*/React__default["default"].forwardRef(funct
82
78
  open: popoverOpen
83
79
  }, /*#__PURE__*/React__default["default"].createElement(react.Tag, {
84
80
  onClick: function onClick() {
85
- return setPopoverOpen(!popoverOpen);
81
+ return setPopoverOpen === null || setPopoverOpen === void 0 ? void 0 : setPopoverOpen(!popoverOpen);
86
82
  },
87
83
  className: cx__default["default"]("".concat(blockClass, "__trigger"))
88
- }, "+", overflowTags.length), /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, /*#__PURE__*/React__default["default"].createElement("div", {
84
+ }, "+", overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length), /*#__PURE__*/React__default["default"].createElement(react.PopoverContent, null, /*#__PURE__*/React__default["default"].createElement("div", {
89
85
  ref: overflowTagContent,
90
86
  className: "".concat(blockClass, "__content")
91
87
  }, /*#__PURE__*/React__default["default"].createElement("ul", {
92
88
  className: "".concat(blockClass, "__tag-list")
93
- }, getOverflowPopoverItems().map(function (_ref2) {
94
- var label = _ref2.label,
95
- id = _ref2.id,
96
- tagType = _ref2.tagType,
97
- filter = _ref2.filter,
98
- _onClose = _ref2.onClose,
99
- other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref2, _excluded2);
89
+ }, hasItems && visibleItems.map(function (_ref) {
90
+ var label = _ref.label,
91
+ id = _ref.id,
92
+ tagType = _ref.tagType,
93
+ filter = _ref.filter,
94
+ _onClose = _ref.onClose,
95
+ other = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded2);
100
96
  var typeValue = overflowType === 'tag' ? 'high-contrast' : tagType;
101
97
  var isFilterable = overflowType === 'tag' ? filter : false;
102
98
  return /*#__PURE__*/React__default["default"].createElement("li", {
@@ -109,7 +105,7 @@ var TagOverflowPopover = /*#__PURE__*/React__default["default"].forwardRef(funct
109
105
  type: typeValue,
110
106
  filter: isFilterable
111
107
  }), label) : label);
112
- })), overflowTags.length > allTagsModalSearchThreshold && /*#__PURE__*/React__default["default"].createElement(react.Link, {
108
+ })), ((_overflowTags$length = overflowTags === null || overflowTags === void 0 ? void 0 : overflowTags.length) !== null && _overflowTags$length !== void 0 ? _overflowTags$length : 0) > (allTagsModalSearchThreshold !== null && allTagsModalSearchThreshold !== void 0 ? allTagsModalSearchThreshold : 0) && /*#__PURE__*/React__default["default"].createElement(react.Link, {
113
109
  className: "".concat(blockClass, "__show-all-tags-link"),
114
110
  href: "",
115
111
  onClick: handleShowAllTagsClick,
@@ -137,6 +133,7 @@ TagOverflowPopover.propTypes = {
137
133
  /**
138
134
  * tags shown in overflow
139
135
  */
136
+ //@ts-ignore
140
137
  overflowTags: index["default"].arrayOf(index["default"].object).isRequired,
141
138
  /**
142
139
  * Type of rendering displayed inside of the tag overflow component
@@ -176,10 +176,13 @@ var TearsheetShell = /*#__PURE__*/React__default["default"].forwardRef(function
176
176
  React.useEffect(function () {
177
177
  if (open && position !== depth) {
178
178
  setTimeout(function () {
179
+ if (selectorPrimaryFocus) {
180
+ return specifiedElement === null || specifiedElement === void 0 ? void 0 : specifiedElement.focus();
181
+ }
179
182
  firstElement === null || firstElement === void 0 || firstElement.focus();
180
183
  }, 0);
181
184
  }
182
- }, [position, depth, firstElement, open]);
185
+ }, [position, depth, firstElement, open, specifiedElement, selectorPrimaryFocus]);
183
186
  React.useEffect(function () {
184
187
  var notify = function notify() {
185
188
  return stack.all.forEach(function (handler) {
@@ -1,2 +1,60 @@
1
- export let UserAvatar: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1
+ /**
2
+ * Copyright IBM Corp. 2024, 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
+ */
2
7
  import React from 'react';
8
+ import '../../global/js/utils/props-helper';
9
+ /**
10
+ * TODO: A description of the component.
11
+ */
12
+ type BackgroundColor = 'order-1-cyan' | 'order-2-gray' | 'order-3-green' | 'order-4-magenta' | 'order-5-purple' | 'order-6-teal' | 'order-7-cyan' | 'order-8-gray' | 'order-9-green' | 'order-10-magenta' | 'order-11-purple' | 'order-12-teal';
13
+ type Size = 'xl' | 'lg' | 'md' | 'sm';
14
+ type TooltipAlignment = 'top' | 'top-left' | 'top-right' | 'bottom' | 'bottom-left' | 'bottom-right' | 'left' | 'right';
15
+ type ImageProps = {
16
+ /**
17
+ * When passing the image prop, supply a full path to the image to be displayed.
18
+ */
19
+ image: string;
20
+ /**
21
+ * When passing the image prop use the imageDescription prop to describe the image for screen reader.
22
+ */
23
+ imageDescription: string;
24
+ } | {
25
+ image?: never;
26
+ imageDescription?: never;
27
+ };
28
+ type UserAvatarBaseProps = {
29
+ /**
30
+ * Provide the background color need to be set for UserAvatar.
31
+ */
32
+ backgroundColor?: BackgroundColor;
33
+ /**
34
+ * Provide an optional class to be applied to the containing node.
35
+ */
36
+ className?: string;
37
+ /**
38
+ * When passing the name prop, either send the initials to be used or the user's full name. The first two capital letters of the user's name will be used as the name.
39
+ */
40
+ name?: string;
41
+ /**
42
+ * Provide a custom icon to use if you need to use an icon other than the default one
43
+ */
44
+ renderIcon?: React.ElementType;
45
+ /**
46
+ * Set the size of the avatar circle
47
+ */
48
+ size?: Size;
49
+ /**
50
+ * Specify how the trigger should align with the tooltip
51
+ */
52
+ tooltipAlignment?: TooltipAlignment;
53
+ /**
54
+ * Pass in the display name to have it shown on hover
55
+ */
56
+ tooltipText?: string;
57
+ };
58
+ type UserAvatarProps = UserAvatarBaseProps & ImageProps;
59
+ export declare let UserAvatar: React.ForwardRefExoticComponent<UserAvatarProps & React.RefAttributes<HTMLDivElement>>;
60
+ export {};
@@ -35,42 +35,23 @@ var componentName = 'UserAvatar';
35
35
 
36
36
  // NOTE: the component SCSS is not imported here: it is rolled up separately.
37
37
 
38
- // Default values can be included here and then assigned to the prop params,
39
- // e.g. prop = defaults.prop,
40
- // This gathers default values together neatly and ensures non-primitive
41
- // values are initialized early to avoid react making unnecessary re-renders.
42
- // Note that default values are not required for props that are 'required',
43
- // nor for props where the component can apply undefined values reasonably.
44
- // Default values should be provided when the component needs to make a choice
45
- // or assumption when a prop is not supplied.
46
-
47
- // Default values for props
48
- // const defaults = {
49
- // /* TODO: add defaults for relevant props if needed */
50
- // };
51
-
52
38
  /**
53
39
  * TODO: A description of the component.
54
40
  */
55
41
 
56
- var defaults = {
57
- size: 'md',
58
- tooltipAlignment: 'bottom',
59
- backgroundColor: 'order-1-cyan'
60
- };
61
42
  exports.UserAvatar = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
62
43
  var _ref$backgroundColor = _ref.backgroundColor,
63
- backgroundColor = _ref$backgroundColor === void 0 ? defaults.backgroundColor : _ref$backgroundColor,
44
+ backgroundColor = _ref$backgroundColor === void 0 ? 'order-1-cyan' : _ref$backgroundColor,
64
45
  className = _ref.className,
65
46
  image = _ref.image,
66
47
  imageDescription = _ref.imageDescription,
67
48
  name = _ref.name,
68
49
  RenderIcon = _ref.renderIcon,
69
50
  _ref$size = _ref.size,
70
- size = _ref$size === void 0 ? defaults.size : _ref$size,
51
+ size = _ref$size === void 0 ? 'md' : _ref$size,
71
52
  tooltipText = _ref.tooltipText,
72
53
  _ref$tooltipAlignment = _ref.tooltipAlignment,
73
- tooltipAlignment = _ref$tooltipAlignment === void 0 ? defaults.tooltipAlignment : _ref$tooltipAlignment,
54
+ tooltipAlignment = _ref$tooltipAlignment === void 0 ? 'bottom' : _ref$tooltipAlignment,
74
55
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
75
56
  var carbonPrefix = react.usePrefix();
76
57
  var iconSize = {
@@ -81,7 +62,7 @@ exports.UserAvatar = /*#__PURE__*/React__default["default"].forwardRef(function
81
62
  };
82
63
  var formatInitials = function formatInitials() {
83
64
  var _ref2;
84
- var parts = name.split(' ');
65
+ var parts = (name === null || name === void 0 ? void 0 : name.split(' ')) || [];
85
66
  var firstChar = parts[0].charAt(0).toUpperCase();
86
67
  var secondChar = parts[0].charAt(1).toUpperCase();
87
68
  if (parts.length === 1) {
@@ -161,10 +142,12 @@ exports.UserAvatar.propTypes = {
161
142
  /**
162
143
  * When passing the image prop, supply a full path to the image to be displayed.
163
144
  */
145
+ /**@ts-ignore */
164
146
  image: index["default"].string,
165
147
  /**
166
148
  * When passing the image prop use the imageDescription prop to describe the image for screen reader.
167
149
  */
150
+ /**@ts-ignore */
168
151
  imageDescription: index["default"].string.isRequired.if(function (_ref3) {
169
152
  var image = _ref3.image;
170
153
  return !!image;
@@ -176,6 +159,7 @@ exports.UserAvatar.propTypes = {
176
159
  /**
177
160
  * Provide a custom icon to use if you need to use an icon other than the default one
178
161
  */
162
+ /**@ts-ignore */
179
163
  renderIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
180
164
  /**
181
165
  * Set the size of the avatar circle
@@ -11,6 +11,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
13
13
 
14
+ /**
15
+ * Copyright IBM Corp. 2024
16
+ *
17
+ * This source code is licensed under the Apache-2.0 license found in the
18
+ * LICENSE file in the root directory of this source tree.
19
+ */
20
+
14
21
  var windowExists = (typeof window === "undefined" ? "undefined" : _rollupPluginBabelHelpers["typeof"](window)) !== "undefined";
15
22
 
16
23
  // determine whether the target is scrollable
@@ -1,2 +1,8 @@
1
1
  export default uuidv4;
2
+ /**
3
+ * Copyright IBM Corp. 2024
4
+ *
5
+ * This source code is licensed under the Apache-2.0 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  declare function uuidv4(): any;
@@ -9,6 +9,8 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
+ // https://stackoverflow.com/a/2117523
13
+
12
14
  function uuidv4() {
13
15
  var randomValues = function randomValues(c) {
14
16
  return typeof crypto !== 'undefined' ? crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4 : Math.random() * 16 >> c / 4;
@@ -1,2 +1,8 @@
1
1
  export default wait;
2
+ /**
3
+ * Copyright IBM Corp. 2024
4
+ *
5
+ * This source code is licensed under the Apache-2.0 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
2
8
  declare function wait(ms: any): Promise<any>;
@@ -9,6 +9,8 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
+ // utility function for an async timeout
13
+
12
14
  function wait(ms) {
13
15
  return new Promise(function (resolve) {
14
16
  return setTimeout(resolve, ms);