@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
@@ -15,25 +15,31 @@ import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
15
15
  import { pkg } from '../../settings.js';
16
16
 
17
17
  var _Crossroads;
18
- var _excluded = ["children", "className", "type"];
18
+ var _excluded = ["children", "className", "iconDescription", "type"];
19
19
 
20
20
  // The block part of our conventional BEM class names (blockClass__E--M).
21
21
  var blockClass = "".concat(pkg.prefix, "--guidebanner__element-button");
22
22
  var componentName = 'GuidebannerElementButton';
23
+ var defaults = {
24
+ iconDescription: 'Crossroads'
25
+ };
23
26
 
24
27
  /**
25
28
  * One of two buttons styled specifically for the GuidebannerElement.
26
29
  */
27
- var GuidebannerElementButton = function GuidebannerElementButton(_ref) {
30
+ var GuidebannerElementButton = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
28
31
  var children = _ref.children,
29
32
  className = _ref.className,
33
+ _ref$iconDescription = _ref.iconDescription,
34
+ iconDescription = _ref$iconDescription === void 0 ? defaults.iconDescription : _ref$iconDescription,
30
35
  type = _ref.type,
31
36
  rest = _objectWithoutProperties(_ref, _excluded);
32
37
  if (type === 'primary') {
33
38
  return /*#__PURE__*/React__default.createElement(Button, _extends({}, rest, {
34
39
  className: cx(blockClass, className),
35
- iconDescription: 'Crossroads',
40
+ iconDescription: iconDescription,
36
41
  kind: "tertiary",
42
+ ref: ref,
37
43
  renderIcon: function renderIcon() {
38
44
  return _Crossroads || (_Crossroads = /*#__PURE__*/React__default.createElement(Crossroads, {
39
45
  size: 16
@@ -49,7 +55,7 @@ var GuidebannerElementButton = function GuidebannerElementButton(_ref) {
49
55
  role: "button",
50
56
  size: "md"
51
57
  }, getDevtoolsProps(componentName)), children);
52
- };
58
+ });
53
59
 
54
60
  // Return a placeholder if not released and not enabled by feature flag
55
61
  GuidebannerElementButton = pkg.checkComponentEnabled(GuidebannerElementButton, componentName);
@@ -1,15 +1,22 @@
1
- export function GuidebannerElementLink({ children, className, ...rest }: {
2
- [x: string]: any;
3
- children: any;
4
- className: any;
5
- }): import("react/jsx-runtime").JSX.Element;
6
- export namespace GuidebannerElementLink {
7
- export { componentName as displayName };
8
- export namespace propTypes {
9
- let children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
10
- let className: PropTypes.Requireable<string>;
11
- }
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 GuidebannerElementLinkProps {
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;
12
17
  }
13
- declare const componentName: "GuidebannerElementLink";
14
- import PropTypes from 'prop-types';
18
+ /**
19
+ * A link styled specifically for the GuidebannerElement.
20
+ */
21
+ export declare let GuidebannerElementLink: React.ForwardRefExoticComponent<GuidebannerElementLinkProps & React.RefAttributes<Link>>;
15
22
  export {};
@@ -18,21 +18,21 @@ var _excluded = ["children", "className"];
18
18
  // The block part of our conventional BEM class names (blockClass__E--M).
19
19
  var blockClass = "".concat(pkg.prefix, "--guidebanner__element-link");
20
20
  var componentName = 'GuidebannerElementLink';
21
-
22
21
  /**
23
22
  * A link styled specifically for the GuidebannerElement.
24
23
  */
25
- var GuidebannerElementLink = function GuidebannerElementLink(_ref) {
24
+ var GuidebannerElementLink = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
26
25
  var children = _ref.children,
27
26
  className = _ref.className,
28
27
  rest = _objectWithoutProperties(_ref, _excluded);
29
28
  return /*#__PURE__*/React__default.createElement(Link, _extends({}, rest, {
30
29
  className: cx(blockClass, className),
31
30
  kind: "ghost",
31
+ ref: ref,
32
32
  role: "link",
33
33
  size: "md"
34
34
  }, getDevtoolsProps(componentName)), children);
35
- };
35
+ });
36
36
 
37
37
  // Return a placeholder if not released and not enabled by feature flag
38
38
  GuidebannerElementLink = pkg.checkComponentEnabled(GuidebannerElementLink, componentName);
@@ -214,6 +214,7 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (_ref,
214
214
  className,
215
215
  // Apply any supplied class names to the main HTML element.
216
216
  variantClass, isVisibleClass),
217
+ role: "main",
217
218
  "aria-label": interstitialAriaLabel,
218
219
  ref: ref
219
220
  }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
@@ -239,7 +240,8 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (_ref,
239
240
  var renderBody = function renderBody() {
240
241
  return /*#__PURE__*/React__default.createElement("div", {
241
242
  className: cx("".concat(blockClass, "--body")),
242
- ref: bodyScrollRef
243
+ ref: bodyScrollRef,
244
+ tabIndex: 0
243
245
  }, mediaIsDefined ? /*#__PURE__*/React__default.createElement(FlexGrid, {
244
246
  fullWidth: true,
245
247
  className: cx("".concat(blockClass, "--body-grid"))
@@ -1,5 +1,137 @@
1
+ import React, { ReactNode } from 'react';
2
+ type Filter = {
3
+ id?: string;
4
+ label?: string;
5
+ };
6
+ type Modifier = {
7
+ label?: string;
8
+ options?: string[];
9
+ };
10
+ interface Entry {
11
+ avatar?: {
12
+ alt?: string;
13
+ icon?: () => void;
14
+ src?: string;
15
+ theme?: 'light' | 'dark';
16
+ };
17
+ children?: ReactNode;
18
+ icon?: () => void;
19
+ id: string;
20
+ subtitle?: string;
21
+ title: string;
22
+ value: string;
23
+ }
24
+ type Theme = 'light' | 'dark';
25
+ type ItemType = {
26
+ entries?: Entry[];
27
+ modifiers: Modifier;
28
+ sortBy: string[];
29
+ filterBy: string[];
30
+ };
31
+ interface MultiAddSelectProps {
32
+ /**
33
+ * optional class name
34
+ */
35
+ className?: string;
36
+ /**
37
+ * placeholder for column input filter
38
+ */
39
+ columnInputPlaceholder?: string;
40
+ /**
41
+ * text description that appears under the title
42
+ */
43
+ description?: string;
44
+ /**
45
+ * options to display in the global filter box. values are generated
46
+ * from the id which should correlate with a specific property in an
47
+ * item entry
48
+ */
49
+ globalFilters?: Filter[];
50
+ globalFiltersIconDescription?: string;
51
+ /**
52
+ * placeholder text for the global filter dropdown
53
+ */
54
+ globalFiltersPlaceholderText?: string;
55
+ /**
56
+ * text for the global filter primary button
57
+ */
58
+ globalFiltersPrimaryButtonText?: string;
59
+ /**
60
+ * text for the global filter secondary button
61
+ */
62
+ globalFiltersSecondaryButtonText?: string;
63
+ /**
64
+ * label for global search input
65
+ */
66
+ globalSearchLabel?: string;
67
+ /**
68
+ * placeholder for global search input
69
+ */
70
+ globalSearchPlaceholder?: string;
71
+ /**
72
+ * the theme for the empty state illustration
73
+ */
74
+ illustrationTheme?: Theme;
75
+ /**
76
+ * title that displays in the sidebar / influencer
77
+ */
78
+ influencerTitle?: string;
79
+ /**
80
+ * object that contains the item data. for more information reference the
81
+ * "Structuring items" section in the docs tab
82
+ */
83
+ items?: ItemType;
84
+ /**
85
+ * label that display above the list of items
86
+ */
87
+ itemsLabel?: string;
88
+ /**
89
+ * text to display when no results are found from the global search
90
+ */
91
+ noResultsDescription?: string;
92
+ /**
93
+ * title to display when no results are found from the global search
94
+ */
95
+ noResultsTitle?: string;
96
+ /**
97
+ * text body that displays in the sidebar when nothing is selected
98
+ */
99
+ noSelectionDescription?: string;
100
+ /**
101
+ * title that displays in the sidebar when nothing is selected
102
+ */
103
+ noSelectionTitle?: string;
104
+ /**
105
+ * function to call when the close button clicked
106
+ */
107
+ onClose?: () => void;
108
+ /**
109
+ * text for close button
110
+ */
111
+ onCloseButtonText?: string;
112
+ /**
113
+ * function to call when the submit button is clicked. returns a selection
114
+ */
115
+ onSubmit?: () => void;
116
+ /**
117
+ * text for the submit button
118
+ */
119
+ onSubmitButtonText?: string;
120
+ /**
121
+ * specifies if the component is open or not
122
+ */
123
+ open?: boolean;
124
+ /**
125
+ * text that displays when displaying filtered items
126
+ */
127
+ searchResultsTitle?: string;
128
+ /**
129
+ * header text
130
+ */
131
+ title?: string;
132
+ }
1
133
  /**
2
134
  * Used to add or select multiple or more items from larger lists or hierarchies.
3
135
  */
4
- export let MultiAddSelect: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
- import React from 'react';
136
+ export declare let MultiAddSelect: React.ForwardRefExoticComponent<MultiAddSelectProps & React.RefAttributes<HTMLDivElement>>;
137
+ export {};
@@ -13,7 +13,6 @@ import { pkg } from '../../settings.js';
13
13
  import { AddSelect } from '../AddSelect/AddSelect.js';
14
14
 
15
15
  var componentName = 'MultiAddSelect';
16
-
17
16
  /**
18
17
  * Used to add or select multiple or more items from larger lists or hierarchies.
19
18
  */
@@ -42,6 +41,7 @@ MultiAddSelect.propTypes = {
42
41
  * from the id which should correlate with a specific property in an
43
42
  * item entry
44
43
  */
44
+ /**@ts-ignore */
45
45
  globalFilters: PropTypes.arrayOf(PropTypes.shape({
46
46
  id: PropTypes.string,
47
47
  label: PropTypes.string
@@ -79,6 +79,7 @@ MultiAddSelect.propTypes = {
79
79
  * object that contains the item data. for more information reference the
80
80
  * "Structuring items" section in the docs tab
81
81
  */
82
+ /**@ts-ignore */
82
83
  items: PropTypes.shape({
83
84
  modifiers: PropTypes.shape({
84
85
  label: PropTypes.string,
@@ -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 {};
@@ -209,9 +209,9 @@ var NotificationsPanel = /*#__PURE__*/React__default.forwardRef(function (_ref,
209
209
  return item.id === id;
210
210
  })[0];
211
211
  var trimLength = 88;
212
- var description = notification.description;
213
- var descriptionClassName = cx(["".concat(blockClass, "__notification-description"), _defineProperty(_defineProperty({}, "".concat(blockClass, "__notification-long-description"), notification.showAll), "".concat(blockClass, "__notification-short-description"), !notification.showAll)]);
214
- var showMoreButtonClassName = cx([_defineProperty(_defineProperty({}, "".concat(blockClass, "__notification-read-less-button"), notification.showAll), "".concat(blockClass, "__notification-read-more-button"), !notification.showAll)]);
212
+ var description = notification === null || notification === void 0 ? void 0 : notification['description'];
213
+ var descriptionClassName = cx(["".concat(blockClass, "__notification-description"), _defineProperty(_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']))]);
214
+ var showMoreButtonClassName = cx([_defineProperty(_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']))]);
215
215
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement("p", {
216
216
  className: descriptionClassName
217
217
  }, description), description.length > trimLength && /*#__PURE__*/React__default.createElement(Button, {
@@ -222,14 +222,14 @@ var NotificationsPanel = /*#__PURE__*/React__default.forwardRef(function (_ref,
222
222
  size: 16
223
223
  }, props));
224
224
  },
225
- iconDescription: notification.showAll ? readLessLabel : readMoreLabel,
225
+ iconDescription: notification !== null && notification !== void 0 && notification['showAll'] ? readLessLabel : readMoreLabel,
226
226
  onClick: function onClick(event) {
227
227
  event.preventDefault();
228
228
  event.stopPropagation();
229
229
  var newData = allNotifications.map(function (item) {
230
- if (item.id === notification.id) {
230
+ if (item.id === (notification === null || notification === void 0 ? void 0 : notification['id'])) {
231
231
  return Object.assign({}, item, {
232
- showAll: !item.showAll
232
+ showAll: !(item !== null && item !== void 0 && item['showAll'])
233
233
  });
234
234
  }
235
235
  return item;
@@ -237,23 +237,21 @@ var NotificationsPanel = /*#__PURE__*/React__default.forwardRef(function (_ref,
237
237
  setAllNotifications(newData);
238
238
  },
239
239
  className: showMoreButtonClassName
240
- }, notification.showAll ? readLessLabel : readMoreLabel));
240
+ }, notification !== null && notification !== void 0 && notification['showAll'] ? readLessLabel : readMoreLabel));
241
241
  };
242
242
  var renderNotification = function renderNotification(group, notification, index) {
243
243
  var notificationClassName = cx(["".concat(blockClass, "__notification"), "".concat(blockClass, "__notification-").concat(group)]);
244
244
  var notificationHeaderClassName = cx(["".concat(blockClass, "__notification-title"), _defineProperty({}, "".concat(blockClass, "__notification-title-unread"), notification.unread)]);
245
245
  return /*#__PURE__*/React__default.createElement("div", {
246
- "aria-label": notification.title,
247
246
  key: "".concat(notification.timestamp, "-").concat(notification.title, "-").concat(index),
248
247
  className: notificationClassName,
249
- type: "button",
250
248
  role: "button",
251
249
  tabIndex: 0,
252
250
  onClick: function onClick() {
253
251
  return notification.onNotificationClick(notification);
254
252
  },
255
253
  onKeyDown: function onKeyDown(event) {
256
- if (event.target.classList.contains("".concat(blockClass, "__dismiss-single-button"))) {
254
+ if (event.target instanceof HTMLElement && event.target.classList.contains("".concat(blockClass, "__dismiss-single-button"))) {
257
255
  return;
258
256
  }
259
257
  event.which === 13 && notification.onNotificationClick(notification);
@@ -316,7 +314,7 @@ var NotificationsPanel = /*#__PURE__*/React__default.forwardRef(function (_ref,
316
314
  id: blockClass,
317
315
  className: cx(blockClass, className, "".concat(blockClass, "__container")),
318
316
  style: {
319
- animation: !reducedMotion ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : null
317
+ animation: !reducedMotion ? "".concat(open ? 'fade-in 250ms' : 'fade-out forwards 250ms') : undefined
320
318
  },
321
319
  onAnimationEnd: onAnimationEnd,
322
320
  ref: ref || notificationPanelRef
@@ -405,6 +403,7 @@ NotificationsPanel.propTypes = {
405
403
  /**
406
404
  * Array of data for Notifications component to render
407
405
  */
406
+ /**@ts-ignore*/
408
407
  data: PropTypes.arrayOf(PropTypes.shape({
409
408
  id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
410
409
  type: PropTypes.oneOf(['error', 'warning', 'success', 'informational']),