@carbon/ibm-products 2.39.0 → 2.40.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/css/index-full-carbon.css +9 -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 +9 -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 +9 -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 +1 -1
  27. package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
  28. package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  29. package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  30. package/es/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
  31. package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
  32. package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  33. package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  34. package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
  35. package/es/components/Guidebanner/Guidebanner.js +8 -7
  36. package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  37. package/es/components/Guidebanner/GuidebannerElement.js +4 -4
  38. package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  39. package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
  40. package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  41. package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
  42. package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
  43. package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  44. package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
  45. package/es/components/NotificationsPanel/NotificationsPanel.js +0 -1
  46. package/es/components/PageHeader/PageHeader.d.ts +298 -5
  47. package/es/components/PageHeader/PageHeader.js +98 -47
  48. package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  49. package/es/components/PageHeader/PageHeaderUtils.js +4 -1
  50. package/es/components/SidePanel/SidePanel.d.ts +6 -2
  51. package/es/components/SidePanel/SidePanel.js +17 -2
  52. package/es/components/SidePanel/constants.d.ts +1 -0
  53. package/es/components/SidePanel/constants.js +1 -0
  54. package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  55. package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
  56. package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
  57. package/es/components/Tearsheet/Tearsheet.js +25 -13
  58. package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
  59. package/es/components/Tearsheet/TearsheetShell.js +26 -4
  60. package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
  61. package/es/components/WebTerminal/WebTerminal.js +11 -3
  62. package/es/global/js/hooks/useFocus.d.ts +3 -1
  63. package/es/global/js/hooks/useFocus.js +6 -3
  64. package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  65. package/es/global/js/hooks/useRetrieveStepData.js +1 -1
  66. package/lib/components/AddSelect/AddSelect.d.ts +44 -2
  67. package/lib/components/AddSelect/AddSelect.js +7 -3
  68. package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
  69. package/lib/components/AddSelect/AddSelectBody.js +10 -12
  70. package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
  71. package/lib/components/AddSelect/AddSelectSort.js +5 -5
  72. package/lib/components/AddSelect/types/index.d.ts +44 -0
  73. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
  74. package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
  75. package/lib/components/Card/Card.js +1 -1
  76. package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
  77. package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
  78. package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
  79. package/lib/components/DataSpreadsheet/DataSpreadsheet.js +4 -3
  80. package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +5 -0
  81. package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
  82. package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
  83. package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
  84. package/lib/components/Guidebanner/Guidebanner.js +8 -7
  85. package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
  86. package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
  87. package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
  88. package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
  89. package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
  90. package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
  91. package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
  92. package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
  93. package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
  94. package/lib/components/NotificationsPanel/NotificationsPanel.js +0 -1
  95. package/lib/components/PageHeader/PageHeader.d.ts +298 -5
  96. package/lib/components/PageHeader/PageHeader.js +98 -47
  97. package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
  98. package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
  99. package/lib/components/SidePanel/SidePanel.d.ts +6 -2
  100. package/lib/components/SidePanel/SidePanel.js +17 -2
  101. package/lib/components/SidePanel/constants.d.ts +1 -0
  102. package/lib/components/SidePanel/constants.js +1 -0
  103. package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
  104. package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
  105. package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
  106. package/lib/components/Tearsheet/Tearsheet.js +25 -13
  107. package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
  108. package/lib/components/Tearsheet/TearsheetShell.js +26 -4
  109. package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
  110. package/lib/components/WebTerminal/WebTerminal.js +11 -3
  111. package/lib/global/js/hooks/useFocus.d.ts +3 -1
  112. package/lib/global/js/hooks/useFocus.js +6 -3
  113. package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
  114. package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
  115. package/package.json +3 -3
  116. package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
  117. package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
  118. package/scss/components/StringFormatter/_string-formatter.scss +1 -1
  119. package/telemetry.yml +2 -0
@@ -1,2 +1,44 @@
1
- export let AddSelectBody: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
1
+ import React, { ReactNode } from 'react';
2
+ import { Item, Theme } from './types';
3
+ export interface AddSelectBodyProps {
4
+ className?: string;
5
+ clearFiltersText?: string;
6
+ closeIconDescription?: string;
7
+ columnInputPlaceholder?: string;
8
+ defaultModifiers?: Array<any>;
9
+ description?: string;
10
+ filterByLabel?: string;
11
+ globalFilterOpts?: Array<any>;
12
+ globalFiltersIconDescription?: string;
13
+ globalFiltersLabel?: string;
14
+ globalFiltersPlaceholderText?: string;
15
+ globalFiltersPrimaryButtonText?: string;
16
+ globalFiltersSecondaryButtonText?: string;
17
+ globalSearchLabel: string;
18
+ globalSearchPlaceholder?: string;
19
+ globalSortBy?: Array<any>;
20
+ illustrationTheme?: Theme;
21
+ influencerTitle?: string;
22
+ items?: Item;
23
+ itemsLabel?: string;
24
+ metaIconDescription?: string;
25
+ metaPanelTitle?: string;
26
+ multi?: boolean;
27
+ navIconDescription?: string;
28
+ noResultsDescription?: string;
29
+ noResultsTitle?: string;
30
+ noSelectionDescription?: string;
31
+ noSelectionTitle?: string;
32
+ normalizedItems?: object;
33
+ onClose?: () => void;
34
+ onCloseButtonText?: string;
35
+ onSubmit?: (selection: any) => void;
36
+ onSubmitButtonText?: string;
37
+ open?: boolean;
38
+ portalTarget?: ReactNode;
39
+ searchResultsTitle?: string;
40
+ sortByLabel?: string;
41
+ title?: string;
42
+ useNormalizedItems?: boolean;
43
+ }
44
+ export declare const AddSelectBody: React.ForwardRefExoticComponent<AddSelectBodyProps & React.RefAttributes<HTMLDivElement>>;
@@ -122,7 +122,7 @@ var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
122
122
  };
123
123
  var onCloseHandler = function onCloseHandler() {
124
124
  resetState();
125
- onClose();
125
+ onClose === null || onClose === void 0 || onClose();
126
126
  };
127
127
  var tearsheetClassnames = cx(className, blockClass, _defineProperty(_defineProperty({}, "".concat(blockClass, "__single"), !multi), "".concat(blockClass, "__multi"), multi));
128
128
  var globalFilterKeys = Object.keys(appliedGlobalFilters);
@@ -136,17 +136,17 @@ var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
136
136
  setAppliedGlobalFilters(filters);
137
137
  };
138
138
  var submitHandler = function submitHandler() {
139
- if (multi && appliedModifiers.length > 0) {
139
+ if (multi && appliedModifiers && (appliedModifiers === null || appliedModifiers === void 0 ? void 0 : appliedModifiers.length) > 0) {
140
140
  var selections = multiSelection.map(function (item) {
141
141
  return appliedModifiers.find(function (mod) {
142
142
  return mod.id === item;
143
143
  });
144
144
  });
145
- onSubmit(selections);
146
- } else if (multi && appliedModifiers.length === 0) {
147
- onSubmit(multiSelection);
145
+ onSubmit === null || onSubmit === void 0 || onSubmit(selections);
146
+ } else if (multi && (appliedModifiers === null || appliedModifiers === void 0 ? void 0 : appliedModifiers.length) === 0) {
147
+ onSubmit === null || onSubmit === void 0 || onSubmit(multiSelection);
148
148
  } else {
149
- onSubmit(singleSelection);
149
+ onSubmit === null || onSubmit === void 0 || onSubmit(singleSelection);
150
150
  }
151
151
  onCloseHandler();
152
152
  };
@@ -213,9 +213,9 @@ var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
213
213
  displayMetalPanel: displayMetalPanel,
214
214
  illustrationTheme: illustrationTheme,
215
215
  influencerTitle: influencerTitle,
216
- items: useNormalizedItems ? normalizedItems : items.entries,
216
+ items: useNormalizedItems ? normalizedItems : items === null || items === void 0 ? void 0 : items.entries,
217
217
  metaPanelTitle: metaPanelTitle,
218
- modifiers: items.modifiers,
218
+ modifiers: items === null || items === void 0 ? void 0 : items.modifiers,
219
219
  multiSelection: multiSelection,
220
220
  noSelectionDescription: noSelectionDescription,
221
221
  noSelectionTitle: noSelectionTitle,
@@ -257,11 +257,8 @@ var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
257
257
  type: "gray",
258
258
  size: "sm"
259
259
  }, itemsToDisplay.length)), showSort && /*#__PURE__*/React__default.createElement(AddSelectSort, {
260
- items: itemsToDisplay,
261
260
  setSortAttribute: setSortAttribute,
262
261
  setSortDirection: setSortDirection,
263
- sortAttribute: sortAttribute,
264
- sortDirection: sortDirection,
265
262
  sortBy: globalSortBy
266
263
  }))), displayColumnView ? /*#__PURE__*/React__default.createElement("div", {
267
264
  className: "".concat(blockClass, "__columns")
@@ -273,7 +270,7 @@ var AddSelectBody = /*#__PURE__*/forwardRef(function (_ref, ref) {
273
270
  sortByLabel: sortByLabel
274
271
  }))) : /*#__PURE__*/React__default.createElement("div", null, hasResults ? /*#__PURE__*/React__default.createElement(AddSelectList, _extends({}, commonListProps, {
275
272
  filteredItems: itemsToDisplay,
276
- modifiers: items.modifiers,
273
+ modifiers: items === null || items === void 0 ? void 0 : items.modifiers,
277
274
  appliedModifiers: appliedModifiers,
278
275
  setAppliedModifiers: setAppliedModifiers,
279
276
  setParentSelected: parentSelectionHandler,
@@ -313,6 +310,7 @@ AddSelectBody.propTypes = {
313
310
  globalSortBy: PropTypes.array,
314
311
  illustrationTheme: PropTypes.oneOf(['light', 'dark']),
315
312
  influencerTitle: PropTypes.string,
313
+ /**@ts-ignore */
316
314
  items: PropTypes.shape({
317
315
  modifiers: PropTypes.shape({
318
316
  id: PropTypes.string,
@@ -1,18 +1,17 @@
1
- export function AddSelectSort({ setSortAttribute, setSortDirection, sortBy, sortByLabel, }: {
2
- setSortAttribute: any;
3
- setSortDirection: any;
4
- sortBy: any;
5
- sortByLabel: any;
6
- }): import("react/jsx-runtime").JSX.Element;
7
- export namespace AddSelectSort {
8
- export namespace propTypes {
9
- let setSortAttribute: PropTypes.Requireable<(...args: any[]) => any>;
10
- let setSortDirection: PropTypes.Requireable<(...args: any[]) => any>;
11
- let sortBy: PropTypes.Requireable<any[]>;
12
- let sortByLabel: PropTypes.Requireable<string>;
13
- }
14
- export { componentName as displayName };
15
- }
16
1
  import PropTypes from 'prop-types';
17
- declare const componentName: "AddSelectSort";
18
- export {};
2
+ export interface AddSelectSortProps {
3
+ setSortAttribute?: (attribute: any) => void;
4
+ setSortDirection?: (direction: any) => void;
5
+ sortBy?: Array<string>;
6
+ sortByLabel?: string;
7
+ }
8
+ export declare const AddSelectSort: {
9
+ ({ setSortAttribute, setSortDirection, sortBy, sortByLabel, }: AddSelectSortProps): import("react/jsx-runtime").JSX.Element;
10
+ propTypes: {
11
+ setSortAttribute: PropTypes.Requireable<(...args: any[]) => any>;
12
+ setSortDirection: PropTypes.Requireable<(...args: any[]) => any>;
13
+ sortBy: PropTypes.Requireable<any[]>;
14
+ sortByLabel: PropTypes.Requireable<string>;
15
+ };
16
+ displayName: string;
17
+ };
@@ -20,7 +20,7 @@ var AddSelectSort = function AddSelectSort(_ref) {
20
20
  setSortDirection = _ref.setSortDirection,
21
21
  sortBy = _ref.sortBy,
22
22
  sortByLabel = _ref.sortByLabel;
23
- var sortByOpts = sortBy ? sortBy.reduce(function (acc, cur) {
23
+ var sortByOpts = sortBy ? sortBy === null || sortBy === void 0 ? void 0 : sortBy.reduce(function (acc, cur) {
24
24
  var opts = [{
25
25
  id: "".concat(cur, "-asc"),
26
26
  itemText: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _ArrowUp || (_ArrowUp = /*#__PURE__*/React__default.createElement(ArrowUp, {
@@ -43,8 +43,8 @@ var AddSelectSort = function AddSelectSort(_ref) {
43
43
  var sortHandler = function sortHandler(_ref2) {
44
44
  var direction = _ref2.direction,
45
45
  attribute = _ref2.attribute;
46
- setSortAttribute(attribute);
47
- setSortDirection(direction);
46
+ setSortAttribute === null || setSortAttribute === void 0 || setSortAttribute(attribute);
47
+ setSortDirection === null || setSortDirection === void 0 || setSortDirection(direction);
48
48
  };
49
49
  return /*#__PURE__*/React__default.createElement("div", {
50
50
  className: blockClass
@@ -61,8 +61,8 @@ var AddSelectSort = function AddSelectSort(_ref) {
61
61
  }, sortByOpts.map(function (opt) {
62
62
  return /*#__PURE__*/React__default.createElement(OverflowMenuItem, {
63
63
  className: "".concat(blockClass, "_overflow-item"),
64
- key: opt.id,
65
- itemText: opt.itemText,
64
+ key: opt === null || opt === void 0 ? void 0 : opt.id,
65
+ itemText: opt === null || opt === void 0 ? void 0 : opt.itemText,
66
66
  onClick: function onClick() {
67
67
  return sortHandler(opt);
68
68
  }
@@ -0,0 +1,44 @@
1
+ import { ReactNode } from 'react';
2
+ export type Theme = 'light' | 'dark';
3
+ export interface Filter {
4
+ id?: string;
5
+ label?: string;
6
+ }
7
+ export interface Modifier {
8
+ id?: string;
9
+ label?: string;
10
+ options?: string[];
11
+ }
12
+ export interface Avatar {
13
+ alt?: string;
14
+ icon?: () => void;
15
+ src?: string;
16
+ theme?: Theme;
17
+ }
18
+ export interface Meta {
19
+ id?: string;
20
+ title?: string;
21
+ value?: string;
22
+ }
23
+ export interface Entry {
24
+ id: string;
25
+ title: string;
26
+ value: string;
27
+ avatar?: Avatar;
28
+ children?: ReactNode;
29
+ icon?: () => void | object;
30
+ meta?: Meta[] | ReactNode;
31
+ subtitle?: string;
32
+ }
33
+ export interface Item {
34
+ entries: Entry[];
35
+ modifiers?: Modifier;
36
+ sortBy?: string[];
37
+ filterBy?: string[];
38
+ }
39
+ export interface SortOption {
40
+ id?: string;
41
+ direction?: string;
42
+ attribute?: string;
43
+ itemText?: object;
44
+ }
@@ -27,7 +27,11 @@ export namespace BreadcrumbWithOverflow {
27
27
  */
28
28
  label: PropTypes.Requireable<PropTypes.ReactNodeLike>;
29
29
  /**
30
- * A string based alternative to the children, required only if children is not of type string.
30
+ * An optional title label for extra long breadcrumb
31
+ */
32
+ shortTitle: PropTypes.Requireable<string>;
33
+ /**
34
+ * A string based alternative to the children, required only if children is not of type string
31
35
  */
32
36
  title: any;
33
37
  }> | null | undefined)[]>;
@@ -19,8 +19,8 @@ import { TooltipTrigger } from '../TooltipTrigger/TooltipTrigger.js';
19
19
 
20
20
  var _TooltipTrigger;
21
21
  var _excluded = ["breadcrumbs", "className", "maxVisible", "noTrailingSlash", "overflowAriaLabel", "overflowTooltipAlign"],
22
- _excluded2 = ["label", "key", "title", "id"],
23
- _excluded3 = ["className", "key", "label", "title"];
22
+ _excluded2 = ["label", "key", "title", "id", "shortTitle"],
23
+ _excluded3 = ["className", "key", "label", "shortTitle", "title"];
24
24
 
25
25
  // The block part of our conventional BEM class names (blockClass__E--M).
26
26
  var blockClass = "".concat(pkg.prefix, "--breadcrumb-with-overflow");
@@ -106,8 +106,9 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
106
106
  var label = _ref3.label,
107
107
  key = _ref3.key,
108
108
  title = _ref3.title,
109
- id = _ref3.id,
110
- rest = _objectWithoutProperties(_ref3, _excluded2);
109
+ id = _ref3.id;
110
+ _ref3.shortTitle;
111
+ var rest = _objectWithoutProperties(_ref3, _excluded2);
111
112
  return /*#__PURE__*/React__default.createElement(BreadcrumbItem, _extends({
112
113
  key: key
113
114
  }, rest, {
@@ -128,13 +129,14 @@ var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
128
129
  var className = _ref4.className,
129
130
  key = _ref4.key,
130
131
  label = _ref4.label,
132
+ shortTitle = _ref4.shortTitle,
131
133
  title = _ref4.title,
132
134
  rest = _objectWithoutProperties(_ref4, _excluded3);
133
135
  return /*#__PURE__*/React__default.createElement(BreadcrumbItem, _extends({
134
136
  key: key,
135
137
  className: index > 0 || displayCount > 1 ? cx([className, "".concat(blockClass, "__displayed-breadcrumb")]) : className,
136
138
  title: index + 1 === breadcrumbs.length ? title : null
137
- }, rest), label);
139
+ }, rest), shortTitle || label);
138
140
  });
139
141
 
140
142
  // The breadcrumb has the form [first item] [overflow] [items 2...(n-1)] [last item].
@@ -296,7 +298,11 @@ BreadcrumbWithOverflow.propTypes = {
296
298
  */
297
299
  label: PropTypes.node,
298
300
  /**
299
- * A string based alternative to the children, required only if children is not of type string.
301
+ * An optional title label for extra long breadcrumb
302
+ */
303
+ shortTitle: PropTypes.string,
304
+ /**
305
+ * A string based alternative to the children, required only if children is not of type string
300
306
  */
301
307
  title: PropTypes.string.isRequired.if(function (_ref5) {
302
308
  var label = _ref5.label;
@@ -259,7 +259,7 @@ var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
259
259
  }, status === 'incomplete' && (_Incomplete || (_Incomplete = /*#__PURE__*/React__default.createElement(Incomplete, null))), status === 'complete' && (_CheckmarkOutline || (_CheckmarkOutline = /*#__PURE__*/React__default.createElement(CheckmarkOutline, null)))), /*#__PURE__*/React__default.createElement("div", {
260
260
  className: "".concat(blockClass, "__content-container")
261
261
  }, /*#__PURE__*/React__default.createElement("div", getHeaderBodyProps(), /*#__PURE__*/React__default.createElement("div", {
262
- className: "".concat(blockClass, "__header-container")
262
+ className: "".concat(blockClass, "__header-wrapper")
263
263
  }, /*#__PURE__*/React__default.createElement(CardHeader, getHeaderProps()), /*#__PURE__*/React__default.createElement("div", getBodyProps(), children)), getStarted && media && /*#__PURE__*/React__default.createElement("div", {
264
264
  className: "".concat(blockClass, "__media")
265
265
  }, media)), hasBottomBar && /*#__PURE__*/React__default.createElement(CardFooter, getFooterProps())));
@@ -62,7 +62,7 @@ var CreateInfluencer = function CreateInfluencer(_ref) {
62
62
  return /*#__PURE__*/React__default.createElement(ProgressStep, {
63
63
  label: step.title,
64
64
  key: stepIndex,
65
- secondaryLabel: step.secondaryLabel,
65
+ secondaryLabel: step.secondaryLabel || undefined,
66
66
  invalid: step.invalid
67
67
  });
68
68
  })));
@@ -1,2 +1,95 @@
1
- export let CreateTearsheetStep: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
- import React from 'react';
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { PropsWithChildren } from 'react';
8
+ type fieldsetLegendTextProps = {
9
+ /**
10
+ * This optional prop will render your form content inside of a fieldset html element
11
+ * and is defaulted to true.
12
+ * You can set this prop to `false` if you have multiple fieldset elements or want to control the children of your Full Page's step content.
13
+ */
14
+ hasFieldset: false;
15
+ /**
16
+ * This is the required legend text that appears above a fieldset html element for accessibility purposes.
17
+ * You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
18
+ * Otherwise, use CSS to hide/remove this label text.
19
+ */
20
+ fieldsetLegendText?: string;
21
+ } | {
22
+ /**
23
+ * This optional prop will render your form content inside of a fieldset html element
24
+ * and is defaulted to true.
25
+ * You can set this prop to `false` if you have multiple fieldset elements or want to control the children of your Full Page's step content.
26
+ */
27
+ hasFieldset?: true;
28
+ /**
29
+ * This is the required legend text that appears above a fieldset html element for accessibility purposes.
30
+ * You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
31
+ * Otherwise, use CSS to hide/remove this label text.
32
+ */
33
+ fieldsetLegendText: string;
34
+ };
35
+ interface CreateTearsheetStepBaseProps extends PropsWithChildren {
36
+ /**
37
+ * Content that shows in the tearsheet step
38
+ */
39
+ children?: React.ReactNode;
40
+ /**
41
+ * Sets an optional className to be added to the tearsheet step
42
+ */
43
+ className?: string;
44
+ /**
45
+ * Sets an optional description on the step component
46
+ */
47
+ description?: React.ReactNode;
48
+ /**
49
+ * This will conditionally disable the submit button in the multi step Tearsheet
50
+ */
51
+ disableSubmit?: boolean;
52
+ /**
53
+ * This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
54
+ * steps. If this value is `true` then the step will be included in the list of visible steps, as well as being included in the ProgressIndicator step list
55
+ */
56
+ includeStep?: boolean;
57
+ /**
58
+ * This prop can be used on the first step to mark it as an intro step, which will not render the progress indicator steps
59
+ */
60
+ introStep?: boolean;
61
+ /**
62
+ * This optional prop will indicate an error icon on the progress indicator step item
63
+ */
64
+ invalid?: boolean;
65
+ /**
66
+ * Optional function to be called on initial mount of a step.
67
+ * For example, this can be used to fetch data that is required on a particular step.
68
+ */
69
+ onMount?: () => void;
70
+ /**
71
+ * Optional function to be called when you move to the next step.
72
+ * For example, this can be used to validate input fields before proceeding to the next step.
73
+ * This function can _optionally_ return a promise that is either resolved or rejected and the CreateTearsheet will handle the submitting state of the next button.
74
+ */
75
+ onNext?: () => Promise<void>;
76
+ /**
77
+ * Optional function to be called when you move to the previous step.
78
+ */
79
+ onPrevious?: () => void;
80
+ /**
81
+ * Sets the optional secondary label on the progress step component
82
+ */
83
+ secondaryLabel?: string;
84
+ /**
85
+ * Sets an optional subtitle on the step component
86
+ */
87
+ subtitle?: string;
88
+ /**
89
+ * Sets the title text for a tearsheet step
90
+ */
91
+ title: React.ReactNode;
92
+ }
93
+ type CreateTearsheetStepProps = CreateTearsheetStepBaseProps & fieldsetLegendTextProps;
94
+ export declare let CreateTearsheetStep: React.ForwardRefExoticComponent<CreateTearsheetStepProps & React.RefAttributes<unknown>>;
95
+ export {};
@@ -46,7 +46,7 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
46
46
  rest = _objectWithoutProperties(_ref, _excluded);
47
47
  var stepsContext = useContext(StepsContext);
48
48
  var stepNumber = useContext(StepNumberContext);
49
- var _useState = useState(),
49
+ var _useState = useState(includeStep),
50
50
  _useState2 = _slicedToArray(_useState, 2),
51
51
  shouldIncludeStep = _useState2[0],
52
52
  setShouldIncludeStep = _useState2[1];
@@ -56,11 +56,11 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
56
56
  useRetrieveStepData({
57
57
  stepsContext: stepsContext,
58
58
  stepNumber: stepNumber,
59
- introStep: introStep,
59
+ introStep: !!introStep,
60
60
  shouldIncludeStep: shouldIncludeStep,
61
- secondaryLabel: secondaryLabel,
61
+ secondaryLabel: secondaryLabel || '',
62
62
  title: title,
63
- invalid: invalid
63
+ invalid: !!invalid
64
64
  });
65
65
 
66
66
  // This useEffect reports back the onMount value so that they can be used
@@ -80,7 +80,7 @@ var CreateTearsheetStep = /*#__PURE__*/forwardRef(function (_ref, ref) {
80
80
  // steps container context so that it can manage the 'Next' button appropriately.
81
81
  useEffect(function () {
82
82
  if (stepNumber === (stepsContext === null || stepsContext === void 0 ? void 0 : stepsContext.currentStep)) {
83
- stepsContext.setIsDisabled(disableSubmit);
83
+ stepsContext.setIsDisabled(!!disableSubmit);
84
84
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnNext(onNext); // needs to be updated here otherwise there could be stale state values from only initially setting onNext
85
85
  stepsContext === null || stepsContext === void 0 || stepsContext.setOnPrevious(onPrevious);
86
86
  }
@@ -144,6 +144,7 @@ CreateTearsheetStep.propTypes = {
144
144
  * You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's step content.
145
145
  * Otherwise, use CSS to hide/remove this label text.
146
146
  */
147
+ /**@ts-ignore*/
147
148
  fieldsetLegendText: PropTypes.string.isRequired.if(function (_ref2) {
148
149
  var hasFieldset = _ref2.hasFieldset;
149
150
  return !!hasFieldset;
@@ -153,6 +154,7 @@ CreateTearsheetStep.propTypes = {
153
154
  * and is defaulted to true.
154
155
  * You can set this prop to `false` if you have multiple fieldset elements or want to control the children of your Full Page's step content.
155
156
  */
157
+ /**@ts-ignore*/
156
158
  hasFieldset: PropTypes.bool,
157
159
  /**
158
160
  * This prop is used to help track dynamic steps. If this value is `false` then the step is not included in the visible steps or the ProgressIndicator
@@ -205,8 +205,9 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
205
205
  }
206
206
  if ((prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.row) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) || (prevCoords === null || prevCoords === void 0 ? void 0 : prevCoords.column) !== (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column)) {
207
207
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) !== 'header' && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) !== 'header') {
208
+ var _activeCellFullData$r;
208
209
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
209
- setActiveCellContent(activeCellFullData.render('Cell'));
210
+ setActiveCellContent((_activeCellFullData$r = activeCellFullData === null || activeCellFullData === void 0 ? void 0 : activeCellFullData.render('Cell')) !== null && _activeCellFullData$r !== void 0 ? _activeCellFullData$r : null);
210
211
  }
211
212
  if (activeCellCoordinates && (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'header' || (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'header') {
212
213
  setActiveCellContent(null);
@@ -414,8 +415,8 @@ var DataSpreadsheet = /*#__PURE__*/React__default.forwardRef(function (_ref, ref
414
415
  var activeCellFullData = typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column) === 'number' && typeof (activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row) === 'number' ? rows[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.row].cells[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column] : null;
415
416
  var activeCellValue;
416
417
  if (activeCellFullData && activeCellCoordinates !== null && activeCellCoordinates !== void 0 && activeCellCoordinates.column) {
417
- var _activeCellFullData$r;
418
- activeCellValue = activeCellFullData ? (_activeCellFullData$r = activeCellFullData.row.cells) === null || _activeCellFullData$r === void 0 || (_activeCellFullData$r = _activeCellFullData$r[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r === void 0 ? void 0 : _activeCellFullData$r.value : null;
418
+ var _activeCellFullData$r2;
419
+ activeCellValue = activeCellFullData ? (_activeCellFullData$r2 = activeCellFullData.row.cells) === null || _activeCellFullData$r2 === void 0 || (_activeCellFullData$r2 = _activeCellFullData$r2[activeCellCoordinates === null || activeCellCoordinates === void 0 ? void 0 : activeCellCoordinates.column]) === null || _activeCellFullData$r2 === void 0 ? void 0 : _activeCellFullData$r2.value : null;
419
420
  }
420
421
  setCellEditorValue(activeCellValue || '');
421
422
  if (cellEditorRulerRef !== null && cellEditorRulerRef !== void 0 && cellEditorRulerRef.current) {
@@ -59,6 +59,11 @@ var DataSpreadsheetHeader = /*#__PURE__*/forwardRef(function (_ref, ref) {
59
59
  var scrollContainer = ref === null || ref === void 0 || (_current = ref.current) === null || _current === void 0 ? void 0 : _current.querySelector(".".concat(blockClass, "__list--container"));
60
60
  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);
61
61
  var scrollBarValue = hasScrollBar ? 0 : scrollBarSize;
62
+
63
+ // fix for a11y violation element_scrollable_tabbable
64
+ if (!(scrollContainer !== null && scrollContainer !== void 0 && scrollContainer.getAttribute('tabIndex'))) {
65
+ scrollContainer === null || scrollContainer === void 0 || scrollContainer.setAttribute('tabIndex', '0');
66
+ }
62
67
  setScrollBarSizeValue(scrollBarValue);
63
68
  }
64
69
  }, [cellSize, ref, scrollBarSize, previousState === null || previousState === void 0 ? void 0 : previousState.cellSize]);
@@ -39,7 +39,8 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
39
39
  page = datagridState.page,
40
40
  handleResize = datagridState.handleResize,
41
41
  gridRef = datagridState.gridRef,
42
- tableId = datagridState.tableId;
42
+ tableId = datagridState.tableId,
43
+ onVirtualScroll = datagridState.onVirtualScroll;
43
44
 
44
45
  /* istanbul ignore next */
45
46
  var handleVirtualGridResize = function handleVirtualGridResize() {
@@ -89,6 +90,9 @@ var DatagridVirtualBody = function DatagridVirtualBody(datagridState) {
89
90
  },
90
91
  estimatedItemSize: rowHeight,
91
92
  onScroll: onScroll,
93
+ onItemsRendered: function onItemsRendered(e) {
94
+ return onVirtualScroll === null || onVirtualScroll === void 0 ? void 0 : onVirtualScroll(e);
95
+ },
92
96
  innerRef: innerListRef,
93
97
  outerRef: testRef,
94
98
  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
  */
@@ -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 {};
@@ -57,8 +57,8 @@ var Guidebanner = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
57
57
  previousIconDescription = _ref$previousIconDesc === void 0 ? defaults.previousIconDescription : _ref$previousIconDesc,
58
58
  title = _ref.title,
59
59
  rest = _objectWithoutProperties(_ref, _excluded);
60
- var scrollRef = useRef();
61
- var toggleRef = useRef();
60
+ var scrollRef = useRef(null);
61
+ var toggleRef = useRef(null);
62
62
  var _useState = useState(0),
63
63
  _useState2 = _slicedToArray(_useState, 2),
64
64
  scrollPosition = _useState2[0],
@@ -77,6 +77,7 @@ var Guidebanner = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
77
77
  });
78
78
  };
79
79
  return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
80
+ "aria-expanded": !isCollapsed,
80
81
  className: cx(blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), withLeftGutter && "".concat(blockClass, "__with-left-gutter")),
81
82
  ref: ref
82
83
  }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(Idea, {
@@ -107,8 +108,7 @@ var Guidebanner = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
107
108
  size: "md",
108
109
  className: "".concat(blockClass, "__toggle-button"),
109
110
  onClick: handleClickToggle,
110
- ref: toggleRef,
111
- "aria-expanded": !isCollapsed
111
+ ref: toggleRef
112
112
  }, isCollapsed ? expandButtonLabel : collapseButtonLabel), showNavigation && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
113
113
  className: cx("".concat(blockClass, "__back-button"), [scrollPosition === 0 ? "".concat(blockClass, "__back-button--disabled") : null])
114
114
  }, /*#__PURE__*/React__default.createElement(IconButton, {
@@ -172,9 +172,10 @@ Guidebanner.propTypes = {
172
172
  React__default.Children.forEach(prop, function (child) {
173
173
  if (child.type.displayName !== 'GuidebannerElement') {
174
174
  var _child$type, _child$type2;
175
- // If not GuidebannerElement, then show:
176
- // React component name(child.type?.name) or
177
- // HTML element name(child.type).
175
+ // If child element is not `GuidebannerElement`, then show:
176
+ // Carbon Products component's `displayName` (child.type.displayName) or
177
+ // React component's `name` (child.type.name) or
178
+ // HTML element's tag name (child.type).
178
179
  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."));
179
180
  }
180
181
  });