@carbon/ibm-products 2.38.0 → 2.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. package/css/index-full-carbon.css +236 -3
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +5 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +236 -3
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +236 -3
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/AddSelect/AddSelect.d.ts +44 -2
  18. package/es/components/AddSelect/AddSelect.js +8 -4
  19. package/es/components/AddSelect/AddSelectBody.d.ts +44 -2
  20. package/es/components/AddSelect/AddSelectBody.js +10 -12
  21. package/es/components/AddSelect/AddSelectSort.d.ts +16 -17
  22. package/es/components/AddSelect/AddSelectSort.js +5 -5
  23. package/es/components/AddSelect/types/index.d.ts +44 -0
  24. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  25. package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  26. package/es/components/Card/Card.js +50 -9
  27. package/es/components/Card/CardFooter.d.ts +5 -1
  28. package/es/components/Card/CardFooter.js +11 -1
  29. package/es/components/Carousel/Carousel.d.ts +6 -2
  30. package/es/components/Checklist/Checklist.d.ts +100 -2
  31. package/es/components/Checklist/Checklist.js +9 -5
  32. package/es/components/Checklist/Checklist.types.d.ts +19 -0
  33. package/es/components/Checklist/Checklist.types.js +22 -0
  34. package/es/components/Checklist/ChecklistChart.d.ts +5 -1
  35. package/es/components/Checklist/ChecklistChart.js +9 -4
  36. package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
  37. package/es/components/Checklist/ChecklistIcon.js +9 -4
  38. package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  39. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  40. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  41. package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  42. package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
  43. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  44. package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  45. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  46. package/es/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
  47. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  48. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  49. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  50. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
  51. package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
  52. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  53. package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  54. package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  55. package/es/components/GetStartedCard/GetStartedCard.js +82 -0
  56. package/es/components/GetStartedCard/index.d.ts +1 -0
  57. package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
  58. package/es/components/Guidebanner/Guidebanner.js +6 -5
  59. package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  60. package/es/components/Guidebanner/GuidebannerElement.js +4 -4
  61. package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  62. package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
  63. package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  64. package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
  65. package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
  66. package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  67. package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
  68. package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  69. package/es/components/NotificationsPanel/NotificationsPanel.js +10 -11
  70. package/es/components/PageHeader/PageHeader.d.ts +298 -5
  71. package/es/components/PageHeader/PageHeader.js +98 -47
  72. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  73. package/es/components/PageHeader/PageHeaderUtils.js +4 -1
  74. package/es/components/SidePanel/SidePanel.d.ts +6 -2
  75. package/es/components/SidePanel/SidePanel.js +18 -3
  76. package/es/components/SidePanel/constants.d.ts +1 -0
  77. package/es/components/SidePanel/constants.js +1 -0
  78. package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  79. package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
  80. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  81. package/es/components/TagOverflow/TagOverflow.js +153 -29
  82. package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  83. package/es/components/TagOverflow/TagOverflowModal.js +112 -0
  84. package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  85. package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
  86. package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
  87. package/es/components/Tearsheet/Tearsheet.js +25 -13
  88. package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
  89. package/es/components/Tearsheet/TearsheetShell.js +26 -4
  90. package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
  91. package/es/components/WebTerminal/WebTerminal.js +11 -3
  92. package/es/components/index.d.ts +1 -0
  93. package/es/global/js/hooks/useFocus.d.ts +3 -1
  94. package/es/global/js/hooks/useFocus.js +6 -3
  95. package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  96. package/es/global/js/hooks/useRetrieveStepData.js +1 -1
  97. package/es/global/js/package-settings.d.ts +1 -0
  98. package/es/global/js/package-settings.js +1 -0
  99. package/es/index.js +1 -0
  100. package/es/settings.d.ts +1 -0
  101. package/lib/components/AddSelect/AddSelect.d.ts +44 -2
  102. package/lib/components/AddSelect/AddSelect.js +7 -3
  103. package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
  104. package/lib/components/AddSelect/AddSelectBody.js +10 -12
  105. package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
  106. package/lib/components/AddSelect/AddSelectSort.js +5 -5
  107. package/lib/components/AddSelect/types/index.d.ts +44 -0
  108. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  109. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  110. package/lib/components/Card/Card.js +50 -9
  111. package/lib/components/Card/CardFooter.d.ts +5 -1
  112. package/lib/components/Card/CardFooter.js +11 -1
  113. package/lib/components/Carousel/Carousel.d.ts +6 -2
  114. package/lib/components/Checklist/Checklist.d.ts +100 -2
  115. package/lib/components/Checklist/Checklist.js +9 -5
  116. package/lib/components/Checklist/Checklist.types.d.ts +19 -0
  117. package/lib/components/Checklist/Checklist.types.js +27 -0
  118. package/lib/components/Checklist/ChecklistChart.d.ts +5 -1
  119. package/lib/components/Checklist/ChecklistChart.js +14 -9
  120. package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
  121. package/lib/components/Checklist/ChecklistIcon.js +9 -4
  122. package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  123. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  124. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  125. package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  126. package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
  127. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  128. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  129. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  130. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
  131. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  132. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  133. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  134. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
  135. package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
  136. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  137. package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  138. package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  139. package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
  140. package/lib/components/GetStartedCard/index.d.ts +1 -0
  141. package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
  142. package/lib/components/Guidebanner/Guidebanner.js +6 -5
  143. package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  144. package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
  145. package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  146. package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
  147. package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  148. package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
  149. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
  150. package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  151. package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
  152. package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  153. package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -11
  154. package/lib/components/PageHeader/PageHeader.d.ts +298 -5
  155. package/lib/components/PageHeader/PageHeader.js +98 -47
  156. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  157. package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
  158. package/lib/components/SidePanel/SidePanel.d.ts +6 -2
  159. package/lib/components/SidePanel/SidePanel.js +18 -3
  160. package/lib/components/SidePanel/constants.d.ts +1 -0
  161. package/lib/components/SidePanel/constants.js +1 -0
  162. package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  163. package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
  164. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  165. package/lib/components/TagOverflow/TagOverflow.js +154 -28
  166. package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  167. package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
  168. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  169. package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
  170. package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
  171. package/lib/components/Tearsheet/Tearsheet.js +25 -13
  172. package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
  173. package/lib/components/Tearsheet/TearsheetShell.js +26 -4
  174. package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
  175. package/lib/components/WebTerminal/WebTerminal.js +11 -3
  176. package/lib/components/index.d.ts +1 -0
  177. package/lib/global/js/hooks/useFocus.d.ts +3 -1
  178. package/lib/global/js/hooks/useFocus.js +6 -3
  179. package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  180. package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
  181. package/lib/global/js/package-settings.d.ts +1 -0
  182. package/lib/global/js/package-settings.js +1 -0
  183. package/lib/index.js +5 -0
  184. package/lib/settings.d.ts +1 -0
  185. package/package.json +3 -3
  186. package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
  187. package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
  188. package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
  189. package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
  190. package/scss/components/GetStartedCard/_index.scss +8 -0
  191. package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
  192. package/scss/components/StringFormatter/_string-formatter.scss +1 -1
  193. package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
  194. package/scss/components/_index-with-carbon.scss +1 -0
  195. package/scss/components/_index.scss +1 -0
  196. package/telemetry.yml +25 -16
@@ -1,2 +1,89 @@
1
- export const DataSpreadsheetHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
1
+ /**
2
+ * Copyright IBM Corp. 2022, 2022
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 React, { Dispatch, SetStateAction } from 'react';
8
+ import { ActiveCellCoordinates, Column, ItemType, Size } from './types';
9
+ interface DataSpreadsheetHeaderProps {
10
+ /**
11
+ * Object containing the active cell coordinates
12
+ */
13
+ activeCellCoordinates?: ActiveCellCoordinates | null;
14
+ /**
15
+ * Specifies the cell height
16
+ */
17
+ cellSize?: Size;
18
+ /**
19
+ * All of the spreadsheet columns
20
+ */
21
+ columns?: readonly Column[];
22
+ /**
23
+ * uuid that corresponds to the current selection area
24
+ */
25
+ currentMatcher?: string;
26
+ /**
27
+ * Default spreadsheet sizing values
28
+ */
29
+ defaultColumn?: Column;
30
+ /**
31
+ * Whether or not a click/hold is active on a header cell
32
+ */
33
+ headerCellHoldActive?: boolean;
34
+ /**
35
+ * Headers provided from useTable hook
36
+ */
37
+ headerGroups?: any[];
38
+ /**
39
+ * All of the spreadsheet row data
40
+ */
41
+ rows?: object[];
42
+ /**
43
+ * The scrollbar width
44
+ */
45
+ scrollBarSize?: number;
46
+ /**
47
+ * The aria label applied to the Select all button
48
+ */
49
+ selectAllAriaLabel: string;
50
+ /**
51
+ * All of the cell selection area items
52
+ */
53
+ selectionAreas?: ItemType[];
54
+ /**
55
+ * Setter fn for activeCellCoordinates value
56
+ */
57
+ setActiveCellCoordinates?: Dispatch<SetStateAction<ActiveCellCoordinates | null>>;
58
+ /**
59
+ * Setter fn for currentMatcher value
60
+ */
61
+ setCurrentMatcher?: Dispatch<SetStateAction<string>>;
62
+ /**
63
+ * Setter fn for header cell hold active value
64
+ */
65
+ setHeaderCellHoldActive?: (arg: boolean) => void;
66
+ /**
67
+ * Setter fn for selectionAreaData state value
68
+ */
69
+ setSelectionAreaData?: Dispatch<SetStateAction<object[]>>;
70
+ /**
71
+ * Setter fn for selectionAreas value
72
+ */
73
+ setSelectionAreas?: Dispatch<SetStateAction<object[]>>;
74
+ /**
75
+ * The total number of columns to be initially visible, additional columns will be rendered and
76
+ * visible via horizontal scrollbar
77
+ */
78
+ totalVisibleColumns?: number;
79
+ /**
80
+ * Function used to update the active cell coordinates
81
+ */
82
+ updateActiveCellCoordinates?: (arg: any) => void;
83
+ /**
84
+ * Array of visible columns provided by react-table useTable hook
85
+ */
86
+ visibleColumns?: [];
87
+ }
88
+ export declare const DataSpreadsheetHeader: React.ForwardRefExoticComponent<DataSpreadsheetHeaderProps & React.RefAttributes<HTMLDivElement>>;
89
+ export {};
@@ -61,13 +61,18 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
61
61
  setSelectedHeaderReorderActive = _useState4[1];
62
62
  var previousState = usePreviousValue.usePreviousValue({
63
63
  cellSize: cellSize
64
- });
64
+ }) || {};
65
65
  React.useEffect(function () {
66
66
  if ((previousState === null || previousState === void 0 ? void 0 : previousState.cellSize) !== cellSize) {
67
- var _ref$current;
68
- var scrollContainer = ref === null || ref === void 0 || (_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.querySelector(".".concat(blockClass, "__list--container"));
69
- var hasScrollBar = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) > (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight);
67
+ var _current;
68
+ var scrollContainer = ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 ? void 0 : _current.querySelector(".".concat(blockClass, "__list--container"));
69
+ var hasScrollBar = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) && (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight) && (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollHeight) > (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.clientHeight);
70
70
  var scrollBarValue = hasScrollBar ? 0 : scrollBarSize;
71
+
72
+ // fix for a11y violation element_scrollable_tabbable
73
+ if (!(scrollContainer !== null && scrollContainer !== void 0 && scrollContainer.getAttribute('tabIndex'))) {
74
+ scrollContainer === null || scrollContainer === void 0 || scrollContainer.setAttribute('tabIndex', '0');
75
+ }
71
76
  setScrollBarSizeValue(scrollBarValue);
72
77
  }
73
78
  }, [cellSize, ref, scrollBarSize, previousState === null || previousState === void 0 ? void 0 : previousState.cellSize]);
@@ -80,15 +85,16 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
80
85
  activeCellCoordinates: activeCellCoordinates,
81
86
  rows: rows,
82
87
  columns: columns,
88
+ currentMatcher: currentMatcher,
83
89
  setActiveCellCoordinates: setActiveCellCoordinates,
84
90
  setCurrentMatcher: setCurrentMatcher,
85
91
  setSelectionAreas: setSelectionAreas,
86
92
  spreadsheetRef: ref,
87
93
  index: index,
94
+ isKeyboard: undefined,
88
95
  setSelectionAreaData: setSelectionAreaData,
89
96
  isHoldingCommandKey: isHoldingCommandKey,
90
- isHoldingShiftKey: isHoldingShiftKey,
91
- currentMatcher: currentMatcher
97
+ isHoldingShiftKey: isHoldingShiftKey
92
98
  });
93
99
  };
94
100
  };
@@ -105,34 +111,36 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
105
111
  };
106
112
  var handleHeaderMouseDown = function handleHeaderMouseDown(index) {
107
113
  return function (event) {
108
- var _selectionAreaToClone;
114
+ var _selectionAreaToClone, _selectionAreaToClone2, _selectionAreaToClone3, _document;
109
115
  if (event.shiftKey) {
110
116
  // Remove columns, need to call handleHeaderCellSelection
111
117
  return;
112
118
  }
113
119
  setSelectedHeaderReorderActive(true);
114
- var selectionAreaToClone = selectionAreas.filter(function (item) {
120
+ var selectionAreaToClone = selectionAreas === null || selectionAreas === void 0 ? void 0 : selectionAreas.filter(function (item) {
115
121
  return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
116
122
  });
117
- var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat((_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
123
+ var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat(selectionAreaToClone === null || selectionAreaToClone === void 0 || (_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
118
124
  var clickXPosition = event.clientX;
119
125
  var headerButtonCoords = event.target.getBoundingClientRect();
120
126
  var headerIndex = event.target.getAttribute('data-column-index');
121
127
  var offsetXValue = clickXPosition - headerButtonCoords.left;
122
- var lowestColumnIndexFromSelectionArea = Math.min(selectionAreaToClone[0].point1.column, selectionAreaToClone[0].point2.column);
123
- var selectionAreaCoords = selectionAreaElement.getBoundingClientRect();
124
- var updatedOffsetDifference = lowestColumnIndexFromSelectionArea < parseInt(headerIndex) ? offsetXValue + (headerButtonCoords.left - selectionAreaCoords.left) : offsetXValue;
125
- var bodyContainer = document.querySelector(".".concat(blockClass, "__list--container")).firstElementChild;
126
- var selectionAreaClonedElement = selectionAreaElement.cloneNode();
127
- var reorderIndicatorLine = selectionAreaElement.cloneNode();
128
- reorderIndicatorLine.className = "".concat(blockClass, "__reorder-indicator-line");
129
- reorderIndicatorLine.style.width = layout.px(2);
128
+ var lowestColumnIndexFromSelectionArea = Math.min((selectionAreaToClone === null || selectionAreaToClone === void 0 || (_selectionAreaToClone2 = selectionAreaToClone[0]) === null || _selectionAreaToClone2 === void 0 || (_selectionAreaToClone2 = _selectionAreaToClone2.point1) === null || _selectionAreaToClone2 === void 0 ? void 0 : _selectionAreaToClone2.column) || 0, (selectionAreaToClone === null || selectionAreaToClone === void 0 || (_selectionAreaToClone3 = selectionAreaToClone[0]) === null || _selectionAreaToClone3 === void 0 || (_selectionAreaToClone3 = _selectionAreaToClone3.point2) === null || _selectionAreaToClone3 === void 0 ? void 0 : _selectionAreaToClone3.column) || 0);
129
+ var selectionAreaCoords = (selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.getBoundingClientRect()) || new DOMRect();
130
+ var updatedOffsetDifference = lowestColumnIndexFromSelectionArea < parseInt(headerIndex) ? offsetXValue + (headerButtonCoords.left - (selectionAreaCoords === null || selectionAreaCoords === void 0 ? void 0 : selectionAreaCoords.left)) : offsetXValue;
131
+ var bodyContainer = (_document = document) === null || _document === void 0 || (_document = _document.querySelector(".".concat(blockClass, "__list--container"))) === null || _document === void 0 ? void 0 : _document.firstElementChild;
132
+ var selectionAreaClonedElement = selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.cloneNode();
133
+ var reorderIndicatorLine = selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.cloneNode();
134
+ if (reorderIndicatorLine) {
135
+ reorderIndicatorLine.className = "".concat(blockClass, "__reorder-indicator-line");
136
+ reorderIndicatorLine.style.width = layout.px(2);
137
+ }
130
138
  selectionAreaClonedElement.classList.add("".concat(blockClass, "__selection-area--element-cloned"));
131
- selectionAreaClonedElement.setAttribute('data-clone-offset-x', updatedOffsetDifference);
139
+ selectionAreaClonedElement.setAttribute('data-clone-offset-x', "".concat(updatedOffsetDifference));
132
140
  selectionAreaClonedElement.setAttribute('data-column-index-original', index);
133
- bodyContainer.appendChild(selectionAreaClonedElement);
134
- bodyContainer.appendChild(reorderIndicatorLine);
135
- setHeaderCellHoldActive(true);
141
+ bodyContainer === null || bodyContainer === void 0 || bodyContainer.appendChild(selectionAreaClonedElement);
142
+ bodyContainer === null || bodyContainer === void 0 || bodyContainer.appendChild(reorderIndicatorLine);
143
+ setHeaderCellHoldActive === null || setHeaderCellHoldActive === void 0 || setHeaderCellHoldActive(true);
136
144
  };
137
145
  };
138
146
  useSpreadsheetMouseMove.useSpreadsheetMouseMove({
@@ -143,7 +151,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
143
151
  return /*#__PURE__*/React__default["default"].createElement("div", {
144
152
  className: cx__default["default"]("".concat(blockClass, "__header--container")),
145
153
  role: "rowgroup"
146
- }, headerGroups.map(function (headerGroup, index) {
154
+ }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(function (headerGroup, index) {
147
155
  var headerProps = propsHelper.prepareProps(headerGroup.getHeaderGroupProps(), 'key');
148
156
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
149
157
  key: "header_".concat(index)
@@ -155,6 +163,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
155
163
  scrollBarSizeValue: scrollBarSizeValue,
156
164
  totalVisibleColumns: totalVisibleColumns,
157
165
  defaultColumn: defaultColumn,
166
+ totalColumnsWidth: undefined,
158
167
  visibleColumns: visibleColumns
159
168
  }),
160
169
  overflow: 'hidden'
@@ -188,11 +197,11 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
188
197
  "data-row-index": "header",
189
198
  "data-column-index": index,
190
199
  tabIndex: -1,
191
- onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : null,
200
+ onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
192
201
  onMouseUp: selectedHeader ? function () {
193
202
  return setSelectedHeaderReorderActive(false);
194
- } : null,
195
- onClick: !selectedHeader ? handleColumnHeaderClick(index) : null,
203
+ } : undefined,
204
+ onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
196
205
  style: {
197
206
  height: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight,
198
207
  width: (column === null || column === void 0 ? void 0 : column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
@@ -207,6 +216,7 @@ DataSpreadsheetHeader.propTypes = {
207
216
  /**
208
217
  * Object containing the active cell coordinates
209
218
  */
219
+ /**@ts-ignore */
210
220
  activeCellCoordinates: index["default"].shape({
211
221
  row: index["default"].oneOfType([index["default"].number, index["default"].string]),
212
222
  column: index["default"].oneOfType([index["default"].number, index["default"].string])
@@ -226,6 +236,7 @@ DataSpreadsheetHeader.propTypes = {
226
236
  /**
227
237
  * Default spreadsheet sizing values
228
238
  */
239
+ /**@ts-ignore */
229
240
  defaultColumn: index["default"].shape({
230
241
  rowHeight: index["default"].number,
231
242
  rowHeaderWidth: index["default"].number,
@@ -242,6 +253,7 @@ DataSpreadsheetHeader.propTypes = {
242
253
  /**
243
254
  * All of the spreadsheet row data
244
255
  */
256
+ /**@ts-ignore */
245
257
  rows: index["default"].arrayOf(index["default"].object),
246
258
  /**
247
259
  * The scrollbar width
@@ -254,6 +266,7 @@ DataSpreadsheetHeader.propTypes = {
254
266
  /**
255
267
  * All of the cell selection area items
256
268
  */
269
+ /**@ts-ignore */
257
270
  selectionAreas: index["default"].arrayOf(index["default"].object),
258
271
  /**
259
272
  * Setter fn for activeCellCoordinates value
@@ -287,6 +300,7 @@ DataSpreadsheetHeader.propTypes = {
287
300
  /**
288
301
  * Array of visible columns provided by react-table useTable hook
289
302
  */
303
+ /**@ts-ignore */
290
304
  visibleColumns: index["default"].array
291
305
  };
292
306
 
@@ -0,0 +1,30 @@
1
+ export type Size = 'xs' | 'sm' | 'md' | 'lg';
2
+ export type Theme = 'light' | 'dark';
3
+ export interface Column {
4
+ Header?: string;
5
+ accessor?: string | (() => void);
6
+ Cell?: () => void;
7
+ rowHeight?: number;
8
+ rowHeaderWidth?: number;
9
+ width?: number;
10
+ }
11
+ export interface ActiveCellCoordinates {
12
+ row?: number | string;
13
+ column?: number | string;
14
+ }
15
+ export interface PrevState {
16
+ activeCellCoordinates?: ActiveCellCoordinates;
17
+ isEditing?: boolean;
18
+ selectionAreaData?: object[];
19
+ clickAndHoldActive?: boolean;
20
+ rowHeight?: number;
21
+ cellSize?: Size;
22
+ }
23
+ export interface Point {
24
+ column?: number;
25
+ }
26
+ export interface ItemType {
27
+ matcher?: string;
28
+ point1?: Point;
29
+ point2?: Point;
30
+ }
@@ -47,7 +47,8 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
47
47
  page = datagridState.page,
48
48
  handleResize = datagridState.handleResize,
49
49
  gridRef = datagridState.gridRef,
50
- tableId = datagridState.tableId;
50
+ tableId = datagridState.tableId,
51
+ onVirtualScroll = datagridState.onVirtualScroll;
51
52
 
52
53
  /* istanbul ignore next */
53
54
  var handleVirtualGridResize = function handleVirtualGridResize() {
@@ -97,6 +98,9 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
97
98
  },
98
99
  estimatedItemSize: rowHeight,
99
100
  onScroll: onScroll,
101
+ onItemsRendered: function onItemsRendered(e) {
102
+ return onVirtualScroll === null || onVirtualScroll === void 0 ? void 0 : onVirtualScroll(e);
103
+ },
100
104
  innerRef: innerListRef,
101
105
  outerRef: testRef,
102
106
  ref: listRef,
@@ -1,4 +1,5 @@
1
1
  import React, { PropsWithChildren, ReactNode } from 'react';
2
+ import { CarbonIconType } from '@carbon/icons-react/lib/CarbonIcon';
2
3
  type ActionIcon = {
3
4
  id?: string;
4
5
  icon?: () => void | object;
@@ -50,7 +51,7 @@ interface ExpressiveCardProps extends PropsWithChildren {
50
51
  /**
51
52
  * Provides the icon that's displayed at the top of the card
52
53
  */
53
- pictogram?: () => void | object;
54
+ pictogram?: CarbonIconType;
54
55
  /**
55
56
  * Optionally specify an href for your Button to become an <a> element
56
57
  */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * GetStartedCard a card with icon, number, and media variants
3
+ */
4
+ export let GetStartedCard: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ import React from 'react';
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ */
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
+ var index = require('../../node_modules/prop-types/index.js');
15
+ var devtools = require('../../global/js/utils/devtools.js');
16
+ var settings = require('../../settings.js');
17
+ var Card = require('../Card/Card.js');
18
+
19
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
+
21
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
+
23
+ var componentName = 'GetStartedCard';
24
+
25
+ /**
26
+ * GetStartedCard a card with icon, number, and media variants
27
+ */
28
+ exports.GetStartedCard = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
29
+ var rest = _rollupPluginBabelHelpers["extends"]({}, (_rollupPluginBabelHelpers.objectDestructuringEmpty(_ref), _ref));
30
+ return /*#__PURE__*/React__default["default"].createElement(Card.Card, _rollupPluginBabelHelpers["extends"]({
31
+ getStarted: true,
32
+ ref: ref
33
+ }, rest, devtools.getDevtoolsProps(componentName)));
34
+ });
35
+
36
+ // Return a placeholder if not released and not enabled by feature flag
37
+ exports.GetStartedCard = settings.pkg.checkComponentEnabled(exports.GetStartedCard, componentName);
38
+ exports.GetStartedCard.displayName = componentName;
39
+ exports.GetStartedCard.propTypes = {
40
+ /**
41
+ * Provide an optional class to be applied to the containing node.
42
+ */
43
+ className: index["default"].string,
44
+ /**
45
+ * Optional if the card should be disabled
46
+ */
47
+ disabled: index["default"].bool,
48
+ /**
49
+ * Provides the action icon that's displayed at the footer of the card
50
+ */
51
+ footerActionIcon: index["default"].oneOfType([index["default"].func, index["default"].object]),
52
+ /**
53
+ * Optional label for the top of the card
54
+ */
55
+ label: index["default"].oneOfType([index["default"].string, index["default"].object, index["default"].node]),
56
+ /**
57
+ * Optional media content like an image to be placed in the card
58
+ */
59
+ media: index["default"].node,
60
+ /**
61
+ * Icons that are displayed on the card showing the time and skill needed
62
+ */
63
+ metadata: index["default"].arrayOf(index["default"].shape({
64
+ id: index["default"].string,
65
+ icon: index["default"].oneOfType([index["default"].func, index["default"].object]),
66
+ iconDescription: index["default"].string
67
+ })),
68
+ /**
69
+ * Provides the callback for a clickable card
70
+ */
71
+ onClick: index["default"].func.isRequired,
72
+ /**
73
+ * Provides the icon that's displayed at the top of the card
74
+ */
75
+ pictogram: index["default"].oneOfType([index["default"].func, index["default"].object]),
76
+ /**
77
+ * Provides number for card for tasks in a sequential order
78
+ */
79
+ sequence: index["default"].number,
80
+ /**
81
+ * Provides the status that's displayed at the top of the card
82
+ */
83
+ status: index["default"].oneOf(['complete', 'incomplete']),
84
+ /**
85
+ * Title that's displayed at the top of the card
86
+ */
87
+ title: index["default"].oneOfType([index["default"].string, index["default"].object, index["default"].node])
88
+ };
@@ -0,0 +1 @@
1
+ export { GetStartedCard } from "./GetStartedCard";
@@ -1,6 +1,66 @@
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactNode } from 'react';
8
+ interface GuidebannerProps {
9
+ /**
10
+ * Provide the contents of the Guidebanner.
11
+ * One or more GuidebannerElement components are required.
12
+ */
13
+ children: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * Tooltip text and aria label for the Close button icon.
20
+ */
21
+ closeIconDescription?: string;
22
+ /**
23
+ * Text label for the Collapse button.
24
+ */
25
+ collapseButtonLabel?: string;
26
+ /**
27
+ * When true, the Guidebanner will initialize in a collapsed state,
28
+ * showing the title and the Expand button.
29
+ *
30
+ * When expanded, it will show the GuidebannerElement child components and the Collapse button.
31
+ */
32
+ collapsible?: boolean;
33
+ /**
34
+ * Text label for the Expand button.
35
+ */
36
+ expandButtonLabel?: string;
37
+ /**
38
+ * Tooltip text and aria label for the Next button icon.
39
+ */
40
+ nextIconDescription?: string;
41
+ /**
42
+ * If defined, a Close button will render in the top-right corner and a
43
+ * callback function will be triggered when button is clicked.
44
+ */
45
+ onClose?: () => void;
46
+ /**
47
+ * Tooltip text and aria label for the Back button icon.
48
+ */
49
+ previousIconDescription?: string;
50
+ /**
51
+ * Title text.
52
+ */
53
+ title: string;
54
+ /**
55
+ * If true, insert 1 rem of "space" on the left of the component.
56
+ * This will allow the component's content to line up with other
57
+ * content on the page under special circumstances.
58
+ */
59
+ withLeftGutter?: boolean;
60
+ }
1
61
  /**
2
62
  * The guide banner sits at the top of a page, or page-level tab,
3
63
  * to introduce foundational concepts related to the page's content.
4
64
  */
5
- export let Guidebanner: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
- import React from 'react';
65
+ export declare let Guidebanner: React.ForwardRefExoticComponent<GuidebannerProps & React.RefAttributes<HTMLDivElement>>;
66
+ export {};
@@ -66,8 +66,8 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
66
66
  previousIconDescription = _ref$previousIconDesc === void 0 ? defaults.previousIconDescription : _ref$previousIconDesc,
67
67
  title = _ref.title,
68
68
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
69
- var scrollRef = React.useRef();
70
- var toggleRef = React.useRef();
69
+ var scrollRef = React.useRef(null);
70
+ var toggleRef = React.useRef(null);
71
71
  var _useState = React.useState(0),
72
72
  _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
73
73
  scrollPosition = _useState2[0],
@@ -181,9 +181,10 @@ exports.Guidebanner.propTypes = {
181
181
  React__default["default"].Children.forEach(prop, function (child) {
182
182
  if (child.type.displayName !== 'GuidebannerElement') {
183
183
  var _child$type, _child$type2;
184
- // If not GuidebannerElement, then show:
185
- // React component name(child.type?.name) or
186
- // HTML element name(child.type).
184
+ // If child element is not `GuidebannerElement`, then show:
185
+ // Carbon Products component's `displayName` (child.type.displayName) or
186
+ // React component's `name` (child.type.name) or
187
+ // HTML element's tag name (child.type).
187
188
  error = new Error("`Guidebanner` only accepts children of type `GuidebannerElement`, found `".concat(((_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName) || ((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.name) || child.type, "` instead."));
188
189
  }
189
190
  });
@@ -1,19 +1,32 @@
1
- export function GuidebannerElement({ button, className, description, title, ...rest }: {
2
- [x: string]: any;
3
- button: any;
4
- className: any;
5
- description: any;
6
- title: any;
7
- }): import("react/jsx-runtime").JSX.Element;
8
- export namespace GuidebannerElement {
9
- export { componentName as displayName };
10
- export namespace propTypes {
11
- let button: PropTypes.Requireable<PropTypes.ReactNodeLike>;
12
- let className: PropTypes.Requireable<string>;
13
- let description: PropTypes.Validator<NonNullable<NonNullable<PropTypes.ReactNodeLike>>>;
14
- let title: PropTypes.Requireable<string>;
15
- }
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactNode } from 'react';
8
+ interface GuidebannerElementProps {
9
+ /**
10
+ * An optional button can be rendered below the description.
11
+ * This can be a link, button, Coachmark button, etc.
12
+ */
13
+ button?: ReactNode;
14
+ /**
15
+ * Provide an optional class to be applied to the containing node.
16
+ */
17
+ className?: string;
18
+ /**
19
+ * The description of the element.
20
+ */
21
+ description: ReactNode;
22
+ /**
23
+ * The title of the element.
24
+ */
25
+ title?: string;
16
26
  }
17
- declare const componentName: "GuidebannerElement";
18
- import PropTypes from 'prop-types';
27
+ /**
28
+ * The GuidebannerElement is a required child component of the Guidebanner,
29
+ * and acts as a container for a CarouselItem.
30
+ */
31
+ export declare let GuidebannerElement: React.ForwardRefExoticComponent<GuidebannerElementProps & React.RefAttributes<HTMLDivElement>>;
19
32
  export {};
@@ -26,19 +26,19 @@ var _excluded = ["button", "className", "description", "title"];
26
26
  // The block part of our conventional BEM class names (blockClass__E--M).
27
27
  var blockClass = "".concat(settings.pkg.prefix, "--guidebanner__element");
28
28
  var componentName = 'GuidebannerElement';
29
-
30
29
  /**
31
30
  * The GuidebannerElement is a required child component of the Guidebanner,
32
31
  * and acts as a container for a CarouselItem.
33
32
  */
34
- exports.GuidebannerElement = function GuidebannerElement(_ref) {
33
+ exports.GuidebannerElement = /*#__PURE__*/React__default["default"].forwardRef(function (_ref, ref) {
35
34
  var button = _ref.button,
36
35
  className = _ref.className,
37
36
  description = _ref.description,
38
37
  title = _ref.title,
39
38
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
40
39
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
41
- className: cx__default["default"](blockClass, className)
40
+ className: cx__default["default"](blockClass, className),
41
+ ref: ref
42
42
  }, devtools.getDevtoolsProps(componentName)), title && /*#__PURE__*/React__default["default"].createElement("h2", {
43
43
  className: "".concat(blockClass, "-title")
44
44
  }, title), description && /*#__PURE__*/React__default["default"].createElement("p", {
@@ -46,7 +46,7 @@ exports.GuidebannerElement = function GuidebannerElement(_ref) {
46
46
  }, description), button && /*#__PURE__*/React__default["default"].createElement("div", {
47
47
  className: "".concat(blockClass, "-buttons")
48
48
  }, button));
49
- };
49
+ });
50
50
 
51
51
  // Return a placeholder if not released and not enabled by feature flag
52
52
  exports.GuidebannerElement = settings.pkg.checkComponentEnabled(exports.GuidebannerElement, componentName);
@@ -1,17 +1,31 @@
1
- export function GuidebannerElementButton({ children, className, type, ...rest }: {
2
- [x: string]: any;
3
- children: any;
4
- className: any;
5
- type: any;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export namespace GuidebannerElementButton {
8
- export { componentName as displayName };
9
- export namespace propTypes {
10
- let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
11
- let className: PropTypes.Requireable<string>;
12
- let type: PropTypes.Requireable<string>;
13
- }
1
+ /**
2
+ * Copyright IBM Corp. 2023, 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactNode } from 'react';
8
+ interface GuidebannerElementButtonProps {
9
+ /**
10
+ * Provide the contents of the GuidebannerElementLink.
11
+ */
12
+ children: ReactNode;
13
+ /**
14
+ * Provide an optional class to be applied to the containing node.
15
+ */
16
+ className?: string;
17
+ /**
18
+ * Provide a description for the icon.
19
+ */
20
+ iconDescription?: string;
21
+ /**
22
+ * If type is "primary", then return a tertiary button with the "crossroads" icon,
23
+ * else return a ghost button.
24
+ */
25
+ type?: string;
14
26
  }
15
- declare const componentName: "GuidebannerElementButton";
16
- import PropTypes from 'prop-types';
27
+ /**
28
+ * One of two buttons styled specifically for the GuidebannerElement.
29
+ */
30
+ export declare let GuidebannerElementButton: React.ForwardRefExoticComponent<GuidebannerElementButtonProps & React.RefAttributes<Button>>;
17
31
  export {};