@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.
- package/css/index-full-carbon.css +236 -3
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +5 -0
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon-released-only.min.css.map +1 -1
- package/css/index-without-carbon.css +236 -3
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +236 -3
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/components/AddSelect/AddSelect.d.ts +44 -2
- package/es/components/AddSelect/AddSelect.js +8 -4
- package/es/components/AddSelect/AddSelectBody.d.ts +44 -2
- package/es/components/AddSelect/AddSelectBody.js +10 -12
- package/es/components/AddSelect/AddSelectSort.d.ts +16 -17
- package/es/components/AddSelect/AddSelectSort.js +5 -5
- package/es/components/AddSelect/types/index.d.ts +44 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
- package/es/components/Card/Card.js +50 -9
- package/es/components/Card/CardFooter.d.ts +5 -1
- package/es/components/Card/CardFooter.js +11 -1
- package/es/components/Carousel/Carousel.d.ts +6 -2
- package/es/components/Checklist/Checklist.d.ts +100 -2
- package/es/components/Checklist/Checklist.js +9 -5
- package/es/components/Checklist/Checklist.types.d.ts +19 -0
- package/es/components/Checklist/Checklist.types.js +22 -0
- package/es/components/Checklist/ChecklistChart.d.ts +5 -1
- package/es/components/Checklist/ChecklistChart.js +9 -4
- package/es/components/Checklist/ChecklistIcon.d.ts +5 -1
- package/es/components/Checklist/ChecklistIcon.js +9 -4
- package/es/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
- package/es/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
- package/es/components/CreateInfluencer/CreateInfluencer.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
- package/es/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
- package/es/components/DataSpreadsheet/types/index.d.ts +30 -0
- package/es/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/es/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
- package/es/components/GetStartedCard/GetStartedCard.d.ts +5 -0
- package/es/components/GetStartedCard/GetStartedCard.js +82 -0
- package/es/components/GetStartedCard/index.d.ts +1 -0
- package/es/components/Guidebanner/Guidebanner.d.ts +62 -2
- package/es/components/Guidebanner/Guidebanner.js +6 -5
- package/es/components/Guidebanner/GuidebannerElement.d.ts +30 -17
- package/es/components/Guidebanner/GuidebannerElement.js +4 -4
- package/es/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
- package/es/components/Guidebanner/GuidebannerElementButton.js +10 -4
- package/es/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
- package/es/components/Guidebanner/GuidebannerElementLink.js +3 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +3 -1
- package/es/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
- package/es/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/es/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
- package/es/components/NotificationsPanel/NotificationsPanel.js +10 -11
- package/es/components/PageHeader/PageHeader.d.ts +298 -5
- package/es/components/PageHeader/PageHeader.js +98 -47
- package/es/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/es/components/PageHeader/PageHeaderUtils.js +4 -1
- package/es/components/SidePanel/SidePanel.d.ts +6 -2
- package/es/components/SidePanel/SidePanel.js +18 -3
- package/es/components/SidePanel/constants.d.ts +1 -0
- package/es/components/SidePanel/constants.js +1 -0
- package/es/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
- package/es/components/SingleAddSelect/SingleAddSelect.js +2 -1
- package/es/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/es/components/TagOverflow/TagOverflow.js +153 -29
- package/es/components/TagOverflow/TagOverflowModal.d.ts +29 -0
- package/es/components/TagOverflow/TagOverflowModal.js +112 -0
- package/es/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
- package/es/components/TagOverflow/TagOverflowPopover.js +135 -0
- package/es/components/Tearsheet/Tearsheet.d.ts +132 -6
- package/es/components/Tearsheet/Tearsheet.js +25 -13
- package/es/components/Tearsheet/TearsheetShell.d.ts +5 -1
- package/es/components/Tearsheet/TearsheetShell.js +26 -4
- package/es/components/WebTerminal/WebTerminal.d.ts +4 -0
- package/es/components/WebTerminal/WebTerminal.js +11 -3
- package/es/components/index.d.ts +1 -0
- package/es/global/js/hooks/useFocus.d.ts +3 -1
- package/es/global/js/hooks/useFocus.js +6 -3
- package/es/global/js/hooks/useRetrieveStepData.d.ts +1 -1
- package/es/global/js/hooks/useRetrieveStepData.js +1 -1
- package/es/global/js/package-settings.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -0
- package/es/index.js +1 -0
- package/es/settings.d.ts +1 -0
- package/lib/components/AddSelect/AddSelect.d.ts +44 -2
- package/lib/components/AddSelect/AddSelect.js +7 -3
- package/lib/components/AddSelect/AddSelectBody.d.ts +44 -2
- package/lib/components/AddSelect/AddSelectBody.js +10 -12
- package/lib/components/AddSelect/AddSelectSort.d.ts +16 -17
- package/lib/components/AddSelect/AddSelectSort.js +5 -5
- package/lib/components/AddSelect/types/index.d.ts +44 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.d.ts +5 -1
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +12 -6
- package/lib/components/Card/Card.js +50 -9
- package/lib/components/Card/CardFooter.d.ts +5 -1
- package/lib/components/Card/CardFooter.js +11 -1
- package/lib/components/Carousel/Carousel.d.ts +6 -2
- package/lib/components/Checklist/Checklist.d.ts +100 -2
- package/lib/components/Checklist/Checklist.js +9 -5
- package/lib/components/Checklist/Checklist.types.d.ts +19 -0
- package/lib/components/Checklist/Checklist.types.js +27 -0
- package/lib/components/Checklist/ChecklistChart.d.ts +5 -1
- package/lib/components/Checklist/ChecklistChart.js +14 -9
- package/lib/components/Checklist/ChecklistIcon.d.ts +5 -1
- package/lib/components/Checklist/ChecklistIcon.js +9 -4
- package/lib/components/CoachmarkButton/CoachmarkButton.d.ts +19 -2
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.d.ts +46 -2
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +5 -4
- package/lib/components/CreateInfluencer/CreateInfluencer.d.ts +55 -17
- package/lib/components/CreateInfluencer/CreateInfluencer.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +95 -2
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +7 -5
- package/lib/components/DataSpreadsheet/DataSpreadsheet.d.ts +67 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +50 -28
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.d.ts +139 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +46 -31
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.d.ts +89 -2
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +39 -25
- package/lib/components/DataSpreadsheet/types/index.d.ts +30 -0
- package/lib/components/Datagrid/Datagrid/DatagridVirtualBody.js +5 -1
- package/lib/components/ExpressiveCard/ExpressiveCard.d.ts +2 -1
- package/lib/components/GetStartedCard/GetStartedCard.d.ts +5 -0
- package/lib/components/GetStartedCard/GetStartedCard.js +88 -0
- package/lib/components/GetStartedCard/index.d.ts +1 -0
- package/lib/components/Guidebanner/Guidebanner.d.ts +62 -2
- package/lib/components/Guidebanner/Guidebanner.js +6 -5
- package/lib/components/Guidebanner/GuidebannerElement.d.ts +30 -17
- package/lib/components/Guidebanner/GuidebannerElement.js +4 -4
- package/lib/components/Guidebanner/GuidebannerElementButton.d.ts +29 -15
- package/lib/components/Guidebanner/GuidebannerElementButton.js +10 -4
- package/lib/components/Guidebanner/GuidebannerElementLink.d.ts +20 -13
- package/lib/components/Guidebanner/GuidebannerElementLink.js +3 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +3 -1
- package/lib/components/MultiAddSelect/MultiAddSelect.d.ts +134 -2
- package/lib/components/MultiAddSelect/MultiAddSelect.js +2 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.d.ts +162 -1
- package/lib/components/NotificationsPanel/NotificationsPanel.js +10 -11
- package/lib/components/PageHeader/PageHeader.d.ts +298 -5
- package/lib/components/PageHeader/PageHeader.js +98 -47
- package/lib/components/PageHeader/PageHeaderUtils.d.ts +1 -1
- package/lib/components/PageHeader/PageHeaderUtils.js +4 -1
- package/lib/components/SidePanel/SidePanel.d.ts +6 -2
- package/lib/components/SidePanel/SidePanel.js +18 -3
- package/lib/components/SidePanel/constants.d.ts +1 -0
- package/lib/components/SidePanel/constants.js +1 -0
- package/lib/components/SingleAddSelect/SingleAddSelect.d.ts +69 -2
- package/lib/components/SingleAddSelect/SingleAddSelect.js +2 -1
- package/lib/components/TagOverflow/TagOverflow.d.ts +5 -0
- package/lib/components/TagOverflow/TagOverflow.js +154 -28
- package/lib/components/TagOverflow/TagOverflowModal.d.ts +29 -0
- package/lib/components/TagOverflow/TagOverflowModal.js +121 -0
- package/lib/components/TagOverflow/TagOverflowPopover.d.ts +2 -0
- package/lib/components/TagOverflow/TagOverflowPopover.js +144 -0
- package/lib/components/Tearsheet/Tearsheet.d.ts +132 -6
- package/lib/components/Tearsheet/Tearsheet.js +25 -13
- package/lib/components/Tearsheet/TearsheetShell.d.ts +5 -1
- package/lib/components/Tearsheet/TearsheetShell.js +26 -4
- package/lib/components/WebTerminal/WebTerminal.d.ts +4 -0
- package/lib/components/WebTerminal/WebTerminal.js +11 -3
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/hooks/useFocus.d.ts +3 -1
- package/lib/global/js/hooks/useFocus.js +6 -3
- package/lib/global/js/hooks/useRetrieveStepData.d.ts +1 -1
- package/lib/global/js/hooks/useRetrieveStepData.js +1 -1
- package/lib/global/js/package-settings.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -0
- package/lib/index.js +5 -0
- package/lib/settings.d.ts +1 -0
- package/package.json +3 -3
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +4 -2
- package/scss/components/GetStartedCard/_carbon-imports.scss +9 -0
- package/scss/components/GetStartedCard/_get-started-card.scss +135 -0
- package/scss/components/GetStartedCard/_index-with-carbon.scss +9 -0
- package/scss/components/GetStartedCard/_index.scss +8 -0
- package/scss/components/SidePanel/_side-panel-variables.scss +1 -0
- package/scss/components/StringFormatter/_string-formatter.scss +1 -1
- package/scss/components/TagOverflow/_tag-overflow.scss +157 -0
- package/scss/components/_index-with-carbon.scss +1 -0
- package/scss/components/_index.scss +1 -0
- 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
|
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:
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
|
14
|
-
|
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
|
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<
|
5
|
-
|
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
|
-
|
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
|
213
|
-
var descriptionClassName = cx(["".concat(blockClass, "__notification-description"), _defineProperty(_defineProperty({}, "".concat(blockClass, "__notification-long-description"), notification
|
214
|
-
var showMoreButtonClassName = cx([_defineProperty(_defineProperty({}, "".concat(blockClass, "__notification-read-less-button"), notification
|
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
|
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
|
230
|
+
if (item.id === (notification === null || notification === void 0 ? void 0 : notification['id'])) {
|
231
231
|
return Object.assign({}, item, {
|
232
|
-
showAll: !item
|
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
|
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') :
|
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']),
|