@carbon/ibm-products 2.38.0 → 2.39.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/css/index-full-carbon.css +227 -0
  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.css +227 -0
  6. package/css/index-without-carbon.css.map +1 -1
  7. package/css/index-without-carbon.min.css +1 -1
  8. package/css/index-without-carbon.min.css.map +1 -1
  9. package/css/index.css +227 -0
  10. package/css/index.css.map +1 -1
  11. package/css/index.min.css +1 -1
  12. package/css/index.min.css.map +1 -1
  13. package/es/components/Card/Card.js +50 -9
  14. package/es/components/Card/CardFooter.d.ts +5 -1
  15. package/es/components/Card/CardFooter.js +11 -1
  16. package/es/components/Carousel/Carousel.d.ts +6 -2
  17. package/es/components/Checklist/Checklist.d.ts +100 -2
  18. package/es/components/Checklist/Checklist.js +9 -5
  19. package/es/components/Checklist/Checklist.types.d.ts +19 -0
  20. package/es/components/Checklist/Checklist.types.js +22 -0
  21. package/es/components/Checklist/ChecklistChart.d.ts +5 -1
  22. package/es/components/Checklist/ChecklistChart.js +9 -4
  23. package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
  24. package/es/components/Checklist/ChecklistIcon.js +9 -4
  25. package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  26. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  27. package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  28. package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  29. package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  30. package/es/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
  31. package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  32. package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  33. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  34. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +34 -25
  35. package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
  36. package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  37. package/es/components/GetStartedCard/GetStartedCard.js +82 -0
  38. package/es/components/GetStartedCard/index.d.ts +1 -0
  39. package/es/components/Guidebanner/Guidebanner.js +2 -2
  40. package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  41. package/es/components/NotificationsPanel/NotificationsPanel.js +10 -10
  42. package/es/components/SidePanel/SidePanel.js +1 -1
  43. package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
  44. package/es/components/TagOverflow/TagOverflow.js +153 -29
  45. package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  46. package/es/components/TagOverflow/TagOverflowModal.js +112 -0
  47. package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  48. package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
  49. package/es/components/index.d.ts +1 -0
  50. package/es/global/js/package-settings.d.ts +1 -0
  51. package/es/global/js/package-settings.js +1 -0
  52. package/es/index.js +1 -0
  53. package/es/settings.d.ts +1 -0
  54. package/lib/components/Card/Card.js +50 -9
  55. package/lib/components/Card/CardFooter.d.ts +5 -1
  56. package/lib/components/Card/CardFooter.js +11 -1
  57. package/lib/components/Carousel/Carousel.d.ts +6 -2
  58. package/lib/components/Checklist/Checklist.d.ts +100 -2
  59. package/lib/components/Checklist/Checklist.js +9 -5
  60. package/lib/components/Checklist/Checklist.types.d.ts +19 -0
  61. package/lib/components/Checklist/Checklist.types.js +27 -0
  62. package/lib/components/Checklist/ChecklistChart.d.ts +5 -1
  63. package/lib/components/Checklist/ChecklistChart.js +14 -9
  64. package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
  65. package/lib/components/Checklist/ChecklistIcon.js +9 -4
  66. package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
  67. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
  68. package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
  69. package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
  70. package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
  71. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +48 -27
  72. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
  73. package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
  74. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
  75. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +34 -25
  76. package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
  77. package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
  78. package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
  79. package/lib/components/GetStartedCard/index.d.ts +1 -0
  80. package/lib/components/Guidebanner/Guidebanner.js +2 -2
  81. package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
  82. package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -10
  83. package/lib/components/SidePanel/SidePanel.js +1 -1
  84. package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
  85. package/lib/components/TagOverflow/TagOverflow.js +154 -28
  86. package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
  87. package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
  88. package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
  89. package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
  90. package/lib/components/index.d.ts +1 -0
  91. package/lib/global/js/package-settings.d.ts +1 -0
  92. package/lib/global/js/package-settings.js +1 -0
  93. package/lib/index.js +5 -0
  94. package/lib/settings.d.ts +1 -0
  95. package/package.json +3 -3
  96. package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
  97. package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
  98. package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
  99. package/scss/components/GetStartedCard/_index.scss +8 -0
  100. package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
  101. package/scss/components/_index-with-carbon.scss +1 -0
  102. package/scss/components/_index.scss +1 -0
  103. package/telemetry.yml +23 -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,12 +61,12 @@ 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
71
  setScrollBarSizeValue(scrollBarValue);
72
72
  }
@@ -80,15 +80,16 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
80
80
  activeCellCoordinates: activeCellCoordinates,
81
81
  rows: rows,
82
82
  columns: columns,
83
+ currentMatcher: currentMatcher,
83
84
  setActiveCellCoordinates: setActiveCellCoordinates,
84
85
  setCurrentMatcher: setCurrentMatcher,
85
86
  setSelectionAreas: setSelectionAreas,
86
87
  spreadsheetRef: ref,
87
88
  index: index,
89
+ isKeyboard: undefined,
88
90
  setSelectionAreaData: setSelectionAreaData,
89
91
  isHoldingCommandKey: isHoldingCommandKey,
90
- isHoldingShiftKey: isHoldingShiftKey,
91
- currentMatcher: currentMatcher
92
+ isHoldingShiftKey: isHoldingShiftKey
92
93
  });
93
94
  };
94
95
  };
@@ -105,34 +106,36 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
105
106
  };
106
107
  var handleHeaderMouseDown = function handleHeaderMouseDown(index) {
107
108
  return function (event) {
108
- var _selectionAreaToClone;
109
+ var _selectionAreaToClone, _selectionAreaToClone2, _selectionAreaToClone3, _document;
109
110
  if (event.shiftKey) {
110
111
  // Remove columns, need to call handleHeaderCellSelection
111
112
  return;
112
113
  }
113
114
  setSelectedHeaderReorderActive(true);
114
- var selectionAreaToClone = selectionAreas.filter(function (item) {
115
+ var selectionAreaToClone = selectionAreas === null || selectionAreas === void 0 ? void 0 : selectionAreas.filter(function (item) {
115
116
  return (item === null || item === void 0 ? void 0 : item.matcher) === currentMatcher;
116
117
  });
117
- var selectionAreaElement = ref.current.querySelector("[data-matcher-id=\"".concat((_selectionAreaToClone = selectionAreaToClone[0]) === null || _selectionAreaToClone === void 0 ? void 0 : _selectionAreaToClone.matcher, "\"]"));
118
+ 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
119
  var clickXPosition = event.clientX;
119
120
  var headerButtonCoords = event.target.getBoundingClientRect();
120
121
  var headerIndex = event.target.getAttribute('data-column-index');
121
122
  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);
123
+ 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);
124
+ var selectionAreaCoords = (selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.getBoundingClientRect()) || new DOMRect();
125
+ var updatedOffsetDifference = lowestColumnIndexFromSelectionArea < parseInt(headerIndex) ? offsetXValue + (headerButtonCoords.left - (selectionAreaCoords === null || selectionAreaCoords === void 0 ? void 0 : selectionAreaCoords.left)) : offsetXValue;
126
+ var bodyContainer = (_document = document) === null || _document === void 0 || (_document = _document.querySelector(".".concat(blockClass, "__list--container"))) === null || _document === void 0 ? void 0 : _document.firstElementChild;
127
+ var selectionAreaClonedElement = selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.cloneNode();
128
+ var reorderIndicatorLine = selectionAreaElement === null || selectionAreaElement === void 0 ? void 0 : selectionAreaElement.cloneNode();
129
+ if (reorderIndicatorLine) {
130
+ reorderIndicatorLine.className = "".concat(blockClass, "__reorder-indicator-line");
131
+ reorderIndicatorLine.style.width = layout.px(2);
132
+ }
130
133
  selectionAreaClonedElement.classList.add("".concat(blockClass, "__selection-area--element-cloned"));
131
- selectionAreaClonedElement.setAttribute('data-clone-offset-x', updatedOffsetDifference);
134
+ selectionAreaClonedElement.setAttribute('data-clone-offset-x', "".concat(updatedOffsetDifference));
132
135
  selectionAreaClonedElement.setAttribute('data-column-index-original', index);
133
- bodyContainer.appendChild(selectionAreaClonedElement);
134
- bodyContainer.appendChild(reorderIndicatorLine);
135
- setHeaderCellHoldActive(true);
136
+ bodyContainer === null || bodyContainer === void 0 || bodyContainer.appendChild(selectionAreaClonedElement);
137
+ bodyContainer === null || bodyContainer === void 0 || bodyContainer.appendChild(reorderIndicatorLine);
138
+ setHeaderCellHoldActive === null || setHeaderCellHoldActive === void 0 || setHeaderCellHoldActive(true);
136
139
  };
137
140
  };
138
141
  useSpreadsheetMouseMove.useSpreadsheetMouseMove({
@@ -143,7 +146,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
143
146
  return /*#__PURE__*/React__default["default"].createElement("div", {
144
147
  className: cx__default["default"]("".concat(blockClass, "__header--container")),
145
148
  role: "rowgroup"
146
- }, headerGroups.map(function (headerGroup, index) {
149
+ }, headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(function (headerGroup, index) {
147
150
  var headerProps = propsHelper.prepareProps(headerGroup.getHeaderGroupProps(), 'key');
148
151
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
149
152
  key: "header_".concat(index)
@@ -155,6 +158,7 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
155
158
  scrollBarSizeValue: scrollBarSizeValue,
156
159
  totalVisibleColumns: totalVisibleColumns,
157
160
  defaultColumn: defaultColumn,
161
+ totalColumnsWidth: undefined,
158
162
  visibleColumns: visibleColumns
159
163
  }),
160
164
  overflow: 'hidden'
@@ -188,11 +192,11 @@ var DataSpreadsheetHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
188
192
  "data-row-index": "header",
189
193
  "data-column-index": index,
190
194
  tabIndex: -1,
191
- onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : null,
195
+ onMouseDown: selectedHeader ? handleHeaderMouseDown(index) : undefined,
192
196
  onMouseUp: selectedHeader ? function () {
193
197
  return setSelectedHeaderReorderActive(false);
194
- } : null,
195
- onClick: !selectedHeader ? handleColumnHeaderClick(index) : null,
198
+ } : undefined,
199
+ onClick: !selectedHeader ? handleColumnHeaderClick(index) : undefined,
196
200
  style: {
197
201
  height: defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.rowHeight,
198
202
  width: (column === null || column === void 0 ? void 0 : column.width) || (defaultColumn === null || defaultColumn === void 0 ? void 0 : defaultColumn.width)
@@ -207,6 +211,7 @@ DataSpreadsheetHeader.propTypes = {
207
211
  /**
208
212
  * Object containing the active cell coordinates
209
213
  */
214
+ /**@ts-ignore */
210
215
  activeCellCoordinates: index["default"].shape({
211
216
  row: index["default"].oneOfType([index["default"].number, index["default"].string]),
212
217
  column: index["default"].oneOfType([index["default"].number, index["default"].string])
@@ -226,6 +231,7 @@ DataSpreadsheetHeader.propTypes = {
226
231
  /**
227
232
  * Default spreadsheet sizing values
228
233
  */
234
+ /**@ts-ignore */
229
235
  defaultColumn: index["default"].shape({
230
236
  rowHeight: index["default"].number,
231
237
  rowHeaderWidth: index["default"].number,
@@ -242,6 +248,7 @@ DataSpreadsheetHeader.propTypes = {
242
248
  /**
243
249
  * All of the spreadsheet row data
244
250
  */
251
+ /**@ts-ignore */
245
252
  rows: index["default"].arrayOf(index["default"].object),
246
253
  /**
247
254
  * The scrollbar width
@@ -254,6 +261,7 @@ DataSpreadsheetHeader.propTypes = {
254
261
  /**
255
262
  * All of the cell selection area items
256
263
  */
264
+ /**@ts-ignore */
257
265
  selectionAreas: index["default"].arrayOf(index["default"].object),
258
266
  /**
259
267
  * Setter fn for activeCellCoordinates value
@@ -287,6 +295,7 @@ DataSpreadsheetHeader.propTypes = {
287
295
  /**
288
296
  * Array of visible columns provided by react-table useTable hook
289
297
  */
298
+ /**@ts-ignore */
290
299
  visibleColumns: index["default"].array
291
300
  };
292
301
 
@@ -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
+ }
@@ -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";
@@ -86,7 +86,6 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
86
86
  });
87
87
  };
88
88
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({}, rest, {
89
- "aria-expanded": !isCollapsed,
90
89
  className: cx__default["default"](blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), withLeftGutter && "".concat(blockClass, "__with-left-gutter")),
91
90
  ref: ref
92
91
  }, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React__default["default"].createElement(icons.Idea, {
@@ -117,7 +116,8 @@ exports.Guidebanner = /*#__PURE__*/React__default["default"].forwardRef(function
117
116
  size: "md",
118
117
  className: "".concat(blockClass, "__toggle-button"),
119
118
  onClick: handleClickToggle,
120
- ref: toggleRef
119
+ ref: toggleRef,
120
+ "aria-expanded": !isCollapsed
121
121
  }, isCollapsed ? expandButtonLabel : collapseButtonLabel), showNavigation && /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
122
122
  className: cx__default["default"]("".concat(blockClass, "__back-button"), [scrollPosition === 0 ? "".concat(blockClass, "__back-button--disabled") : null])
123
123
  }, /*#__PURE__*/React__default["default"].createElement(react.IconButton, {
@@ -1,2 +1,163 @@
1
- export let NotificationsPanel: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
1
+ /**
2
+ * Copyright IBM Corp. 2020, 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
+ /// <reference path="../../../src/custom-typings/index.d.ts" />
2
8
  import React from 'react';
9
+ import { Link } from '@carbon/react';
10
+ interface Link {
11
+ url: string;
12
+ text: string;
13
+ }
14
+ interface Data {
15
+ id?: string | number;
16
+ type?: 'error' | 'warning' | 'success' | 'informational';
17
+ timestamp?: Date;
18
+ title?: string;
19
+ description?: string;
20
+ link?: Link;
21
+ unread?: boolean;
22
+ onNotificationClick?: () => void;
23
+ }
24
+ interface NotificationsPanelProps {
25
+ /**
26
+ * Provide an optional class to be applied to the containing node.
27
+ */
28
+ className?: string;
29
+ /**
30
+ * Array of data for Notifications component to render
31
+ */
32
+ data: Data[];
33
+ /**
34
+ * Sets the `days ago` label text
35
+ */
36
+ daysAgoText?: (value: number) => string;
37
+ /**
38
+ * Label for Dismiss all button
39
+ */
40
+ dismissAllLabel?: string;
41
+ /**
42
+ * Label for Dismiss single notification icon button
43
+ */
44
+ dismissSingleNotificationIconDescription?: string;
45
+ /**
46
+ * Optional: Determines if the `Do not disturb` toggle is on or off when the component is rendered
47
+ */
48
+ doNotDisturbDefaultToggled?: boolean;
49
+ /**
50
+ * Optional: Label for Do not disturb toggle
51
+ */
52
+ doNotDisturbLabel?: string;
53
+ /**
54
+ * Sets the empty state label text when there are no notifications
55
+ */
56
+ emptyStateLabel?: string;
57
+ /**
58
+ * Sets the `hour ago` label text
59
+ */
60
+ hourAgoText?: (value: number) => string;
61
+ /**
62
+ * Sets the `hours ago` label text
63
+ */
64
+ hoursAgoText?: (value: number) => string;
65
+ /**
66
+ * Sets the `minute ago` label text
67
+ */
68
+ minuteAgoText?: (value: number) => string;
69
+ /**
70
+ * Sets the `minutes ago` label text
71
+ */
72
+ minutesAgoText?: (value: number) => string;
73
+ /**
74
+ * Sets the `month ago` label text
75
+ */
76
+ monthAgoText?: (value: number) => string;
77
+ /**
78
+ * Sets the `months ago` label text
79
+ */
80
+ monthsAgoText?: (value: number) => string;
81
+ /**
82
+ * Sets the `now` label text
83
+ */
84
+ nowText?: string;
85
+ /**
86
+ * Sets the notifications panel open state
87
+ */
88
+ onClickOutside: () => void;
89
+ /**
90
+ * Function that will dismiss all notifications
91
+ */
92
+ onDismissAllNotifications?: () => void;
93
+ /**
94
+ * Function that will dismiss a single notification
95
+ */
96
+ onDismissSingleNotification?: (prop: any) => void;
97
+ /**
98
+ * Optional: function that returns the current selected value of the disable notification toggle
99
+ */
100
+ onDoNotDisturbChange?: (prop: any) => void;
101
+ /**
102
+ * Event handler for the View all button
103
+ */
104
+ onSettingsClick?: () => void;
105
+ /**
106
+ * Event handler for the View all button
107
+ */
108
+ onViewAllClick?: () => void;
109
+ /**
110
+ * Determines whether the notifications panel should render or not
111
+ */
112
+ open: boolean;
113
+ /**
114
+ * Sets the previous label text
115
+ */
116
+ previousLabel?: string;
117
+ /**
118
+ * Sets the `read less` label text
119
+ */
120
+ readLessLabel?: string;
121
+ /**
122
+ * Sets the `read more` label text
123
+ */
124
+ readMoreLabel?: string;
125
+ /**
126
+ * Sets the `seconds ago` label text
127
+ */
128
+ secondsAgoText?: (value: number) => string;
129
+ /**
130
+ * Sets the settings icon description text
131
+ */
132
+ settingsIconDescription?: string;
133
+ /**
134
+ * Sets the title for the Notifications panel
135
+ */
136
+ title?: string;
137
+ /**
138
+ * Sets the today label text
139
+ */
140
+ todayLabel?: string;
141
+ /**
142
+ * Sets the View all button text
143
+ */
144
+ viewAllLabel?: (value: number) => string;
145
+ /**
146
+ * Sets the `year ago` label text
147
+ */
148
+ yearAgoText?: (value: number) => string;
149
+ /**
150
+ * Sets the `years ago` label text
151
+ */
152
+ yearsAgoText?: (value: number) => string;
153
+ /**
154
+ * Sets the `Yesterday at` label text
155
+ */
156
+ yesterdayAtText?: (value: number) => string;
157
+ /**
158
+ * Sets the yesterday label text
159
+ */
160
+ yesterdayLabel?: string;
161
+ }
162
+ export declare let NotificationsPanel: React.ForwardRefExoticComponent<NotificationsPanelProps & React.RefAttributes<unknown>>;
163
+ export {};
@@ -218,9 +218,9 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
218
218
  return item.id === id;
219
219
  })[0];
220
220
  var trimLength = 88;
221
- var description = notification.description;
222
- var descriptionClassName = cx__default["default"](["".concat(blockClass, "__notification-description"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__notification-long-description"), notification.showAll), "".concat(blockClass, "__notification-short-description"), !notification.showAll)]);
223
- var showMoreButtonClassName = cx__default["default"]([_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__notification-read-less-button"), notification.showAll), "".concat(blockClass, "__notification-read-more-button"), !notification.showAll)]);
221
+ var description = notification === null || notification === void 0 ? void 0 : notification['description'];
222
+ var descriptionClassName = cx__default["default"](["".concat(blockClass, "__notification-description"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__notification-long-description"), notification === null || notification === void 0 ? void 0 : notification['showAll']), "".concat(blockClass, "__notification-short-description"), !(notification !== null && notification !== void 0 && notification['showAll']))]);
223
+ var showMoreButtonClassName = cx__default["default"]([_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__notification-read-less-button"), notification === null || notification === void 0 ? void 0 : notification['showAll']), "".concat(blockClass, "__notification-read-more-button"), !(notification !== null && notification !== void 0 && notification['showAll']))]);
224
224
  return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement("p", {
225
225
  className: descriptionClassName
226
226
  }, description), description.length > trimLength && /*#__PURE__*/React__default["default"].createElement(react.Button, {
@@ -231,14 +231,14 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
231
231
  size: 16
232
232
  }, props));
233
233
  },
234
- iconDescription: notification.showAll ? readLessLabel : readMoreLabel,
234
+ iconDescription: notification !== null && notification !== void 0 && notification['showAll'] ? readLessLabel : readMoreLabel,
235
235
  onClick: function onClick(event) {
236
236
  event.preventDefault();
237
237
  event.stopPropagation();
238
238
  var newData = allNotifications.map(function (item) {
239
- if (item.id === notification.id) {
239
+ if (item.id === (notification === null || notification === void 0 ? void 0 : notification['id'])) {
240
240
  return Object.assign({}, item, {
241
- showAll: !item.showAll
241
+ showAll: !(item !== null && item !== void 0 && item['showAll'])
242
242
  });
243
243
  }
244
244
  return item;
@@ -246,7 +246,7 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
246
246
  setAllNotifications(newData);
247
247
  },
248
248
  className: showMoreButtonClassName
249
- }, notification.showAll ? readLessLabel : readMoreLabel));
249
+ }, notification !== null && notification !== void 0 && notification['showAll'] ? readLessLabel : readMoreLabel));
250
250
  };
251
251
  var renderNotification = function renderNotification(group, notification, index) {
252
252
  var notificationClassName = cx__default["default"](["".concat(blockClass, "__notification"), "".concat(blockClass, "__notification-").concat(group)]);
@@ -255,14 +255,13 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
255
255
  "aria-label": notification.title,
256
256
  key: "".concat(notification.timestamp, "-").concat(notification.title, "-").concat(index),
257
257
  className: notificationClassName,
258
- type: "button",
259
258
  role: "button",
260
259
  tabIndex: 0,
261
260
  onClick: function onClick() {
262
261
  return notification.onNotificationClick(notification);
263
262
  },
264
263
  onKeyDown: function onKeyDown(event) {
265
- if (event.target.classList.contains("".concat(blockClass, "__dismiss-single-button"))) {
264
+ if (event.target instanceof HTMLElement && event.target.classList.contains("".concat(blockClass, "__dismiss-single-button"))) {
266
265
  return;
267
266
  }
268
267
  event.which === 13 && notification.onNotificationClick(notification);
@@ -325,7 +324,7 @@ exports.NotificationsPanel = /*#__PURE__*/React__default["default"].forwardRef(f
325
324
  id: blockClass,
326
325
  className: cx__default["default"](blockClass, className, "".concat(blockClass, "__container")),
327
326
  style: {
328
- animation: !reducedMotion ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : null
327
+ animation: !reducedMotion ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : undefined
329
328
  },
330
329
  onAnimationEnd: onAnimationEnd,
331
330
  ref: ref || notificationPanelRef
@@ -414,6 +413,7 @@ exports.NotificationsPanel.propTypes = {
414
413
  /**
415
414
  * Array of data for Notifications component to render
416
415
  */
416
+ /**@ts-ignore*/
417
417
  data: index["default"].arrayOf(index["default"].shape({
418
418
  id: index["default"].oneOfType([index["default"].string, index["default"].number]),
419
419
  type: index["default"].oneOf(['error', 'warning', 'success', 'informational']),
@@ -355,7 +355,7 @@ exports.SidePanel = /*#__PURE__*/React__default["default"].forwardRef(function (
355
355
  });
356
356
  }
357
357
  return /*#__PURE__*/React__default["default"].createElement("div", {
358
- className: cx__default["default"]("".concat(blockClass, "__header"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__header--on-detail-step"), currentStep > 0), "".concat(blockClass, "__header--no-title-animation"), !doAnimateTitle), "".concat(blockClass, "__header--reduced-motion"), reducedMotion.matches), "".concat(blockClass, "__header--has-title"), title)),
358
+ className: cx__default["default"]("".concat(blockClass, "__header"), _rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, "".concat(blockClass, "__header--on-detail-step"), currentStep > 0), "".concat(blockClass, "__header--no-title-animation"), !animateTitle), "".concat(blockClass, "__header--reduced-motion"), reducedMotion.matches), "".concat(blockClass, "__header--has-title"), title)),
359
359
  ref: headerRef
360
360
  }, currentStep > 0 && /*#__PURE__*/React__default["default"].createElement(react.Button, {
361
361
  "aria-label": navigationBackIconDescription,
@@ -2,4 +2,9 @@
2
2
  * TODO: A description of the component.
3
3
  */
4
4
  export let TagOverflow: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ /**
6
+ * The strings shown in the showAllModal are only shown if we have more than allTagsModalSearchLThreshold
7
+ * @returns null if no problems
8
+ */
9
+ export const string_required_if_more_than_10_tags: (props: any, propName: any, componentName: any, location: any, propFullName: any, secret: any) => any;
5
10
  import React from 'react';