@carbon/ibm-products 2.22.0 → 2.24.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -1
- package/css/index-full-carbon.css +29490 -28295
- 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 +81 -104
- 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 +24399 -350
- 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 +17204 -123
- 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/Card/Card.js +1 -2
- package/es/components/Card/CardHeader.js +2 -2
- package/es/components/Carousel/Carousel.js +5 -3
- package/es/components/Coachmark/Coachmark.js +255 -0
- package/es/components/Coachmark/CoachmarkDragbar.js +146 -0
- package/es/components/Coachmark/CoachmarkHeader.js +91 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +235 -0
- package/es/components/Coachmark/CoachmarkTagline.js +97 -0
- package/es/components/Coachmark/index.js +10 -0
- package/es/components/Coachmark/utils/constants.js +76 -0
- package/es/components/Coachmark/utils/context.js +5 -0
- package/es/components/Coachmark/utils/enums.js +40 -0
- package/es/components/Coachmark/utils/helpers.js +11 -0
- package/es/components/Coachmark/utils/hooks.js +54 -0
- package/es/components/CoachmarkBeacon/CoachmarkBeacon.js +93 -0
- package/es/components/CoachmarkBeacon/index.js +8 -0
- package/es/components/CoachmarkButton/CoachmarkButton.js +90 -0
- package/es/components/CoachmarkButton/index.js +8 -0
- package/es/components/CoachmarkFixed/CoachmarkFixed.js +226 -0
- package/es/components/CoachmarkFixed/index.js +8 -0
- package/es/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +86 -0
- package/es/components/CoachmarkOverlayElement/index.js +8 -0
- package/es/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +216 -0
- package/es/components/CoachmarkOverlayElements/index.js +8 -0
- package/es/components/CoachmarkStack/CoachmarkStack.js +283 -0
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +192 -0
- package/es/components/CoachmarkStack/index.js +8 -0
- package/es/components/Datagrid/Datagrid/DatagridHeaderRow.js +14 -4
- package/es/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.js +26 -0
- package/es/components/Datagrid/Datagrid.docs-page.js +2 -2
- package/es/components/Datagrid/useActionsColumn.js +16 -12
- package/es/components/Datagrid/useDefaultStringRenderer.js +3 -3
- package/es/components/Datagrid/useNestedRowExpander.js +2 -2
- package/es/components/Datagrid/useSortableColumns.js +15 -5
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +7 -2
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +8 -3
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +7 -2
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +7 -2
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +7 -2
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +7 -2
- package/es/components/EmptyStates/assets/ErrorIllustration.js +5 -5
- package/es/components/EmptyStates/assets/NoDataIllustration.js +5 -5
- package/es/components/EmptyStates/assets/NoTagsIllustration.js +5 -5
- package/es/components/EmptyStates/assets/NotFoundIllustration.js +5 -5
- package/es/components/EmptyStates/assets/NotificationsIllustration.js +5 -5
- package/es/components/EmptyStates/assets/UnauthorizedIllustration.js +5 -5
- package/es/components/FilterSummary/FilterSummary.js +100 -19
- package/es/components/InterstitialScreen/InterstitialScreen.js +427 -0
- package/es/components/InterstitialScreen/index.js +8 -0
- package/es/components/InterstitialScreenView/InterstitialScreenView.js +75 -0
- package/es/components/InterstitialScreenView/index.js +8 -0
- package/es/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +83 -0
- package/es/components/InterstitialScreenViewModule/index.js +8 -0
- package/es/components/PageHeader/PageHeaderUtils.js +2 -2
- package/es/components/SearchBar/SearchBar.js +227 -0
- package/es/components/SearchBar/index.js +8 -0
- package/es/components/TagSet/TagSet.js +11 -3
- package/es/components/index.js +12 -1
- package/es/global/js/hooks/useResizeObserver.js +2 -2
- package/es/global/js/package-settings.js +14 -0
- package/lib/components/Card/Card.js +3 -4
- package/lib/components/Card/CardHeader.js +2 -2
- package/lib/components/Carousel/Carousel.js +5 -3
- package/lib/components/Coachmark/Coachmark.js +264 -0
- package/lib/components/Coachmark/CoachmarkDragbar.js +151 -0
- package/lib/components/Coachmark/CoachmarkHeader.js +95 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +243 -0
- package/lib/components/Coachmark/CoachmarkTagline.js +101 -0
- package/lib/components/Coachmark/index.js +38 -0
- package/lib/components/Coachmark/utils/constants.js +81 -0
- package/lib/components/Coachmark/utils/context.js +11 -0
- package/lib/components/Coachmark/utils/enums.js +46 -0
- package/lib/components/Coachmark/utils/helpers.js +17 -0
- package/lib/components/Coachmark/utils/hooks.js +59 -0
- package/lib/components/CoachmarkBeacon/CoachmarkBeacon.js +97 -0
- package/lib/components/CoachmarkBeacon/index.js +12 -0
- package/lib/components/CoachmarkButton/CoachmarkButton.js +93 -0
- package/lib/components/CoachmarkButton/index.js +12 -0
- package/lib/components/CoachmarkFixed/CoachmarkFixed.js +232 -0
- package/lib/components/CoachmarkFixed/index.js +12 -0
- package/lib/components/CoachmarkOverlayElement/CoachmarkOverlayElement.js +90 -0
- package/lib/components/CoachmarkOverlayElement/index.js +12 -0
- package/lib/components/CoachmarkOverlayElements/CoachmarkOverlayElements.js +222 -0
- package/lib/components/CoachmarkOverlayElements/index.js +12 -0
- package/lib/components/CoachmarkStack/CoachmarkStack.js +288 -0
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +198 -0
- package/lib/components/CoachmarkStack/index.js +12 -0
- package/lib/components/Datagrid/Datagrid/DatagridHeaderRow.js +14 -4
- package/lib/components/Datagrid/Datagrid/DatagridSelectAll.js +4 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/ButtonWrapper.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/Columns.js +4 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/CustomizeColumnsTearsheet.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Slug/ColumnHeaderSlug.js +36 -0
- package/lib/components/Datagrid/Datagrid.docs-page.js +2 -2
- package/lib/components/Datagrid/useActionsColumn.js +15 -11
- package/lib/components/Datagrid/useDefaultStringRenderer.js +3 -3
- package/lib/components/Datagrid/useNestedRowExpander.js +2 -2
- package/lib/components/Datagrid/useSortableColumns.js +15 -5
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +7 -2
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +8 -3
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +7 -2
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +7 -2
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +7 -2
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +7 -2
- package/lib/components/EmptyStates/assets/ErrorIllustration.js +5 -5
- package/lib/components/EmptyStates/assets/NoDataIllustration.js +5 -5
- package/lib/components/EmptyStates/assets/NoTagsIllustration.js +5 -5
- package/lib/components/EmptyStates/assets/NotFoundIllustration.js +5 -5
- package/lib/components/EmptyStates/assets/NotificationsIllustration.js +5 -5
- package/lib/components/EmptyStates/assets/UnauthorizedIllustration.js +5 -5
- package/lib/components/FilterSummary/FilterSummary.js +103 -23
- package/lib/components/InterstitialScreen/InterstitialScreen.js +434 -0
- package/lib/components/InterstitialScreen/index.js +12 -0
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +77 -0
- package/lib/components/InterstitialScreenView/index.js +12 -0
- package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +85 -0
- package/lib/components/InterstitialScreenViewModule/index.js +12 -0
- package/lib/components/PageHeader/PageHeaderUtils.js +2 -2
- package/lib/components/SearchBar/SearchBar.js +233 -0
- package/lib/components/SearchBar/index.js +12 -0
- package/lib/components/TagSet/TagSet.js +11 -3
- package/lib/components/index.js +78 -1
- package/lib/global/js/hooks/useResizeObserver.js +2 -2
- package/lib/global/js/package-settings.js +14 -0
- package/package.json +5 -5
- package/scss/components/Card/_card.scss +6 -5
- package/scss/components/Coachmark/_carbon-imports.scss +10 -0
- package/scss/components/Coachmark/_coachmark-dragbar.scss +27 -0
- package/scss/components/Coachmark/_coachmark-header.scss +20 -0
- package/scss/components/Coachmark/_coachmark-overlay.scss +431 -0
- package/scss/components/Coachmark/_coachmark-tagline.scss +140 -0
- package/scss/components/Coachmark/_coachmark.scss +30 -0
- package/scss/components/Coachmark/_index-with-carbon.scss +9 -0
- package/scss/components/Coachmark/_index.scss +8 -0
- package/scss/components/CoachmarkBeacon/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkBeacon/_coachmark-beacon.scss +166 -0
- package/scss/components/CoachmarkBeacon/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkBeacon/_index.scss +8 -0
- package/scss/components/CoachmarkButton/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkButton/_coachmark-button.scss +25 -0
- package/scss/components/CoachmarkButton/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkButton/_index.scss +8 -0
- package/scss/components/CoachmarkFixed/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkFixed/_coachmark-fixed.scss +25 -0
- package/scss/components/CoachmarkFixed/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkFixed/_index.scss +8 -0
- package/scss/components/CoachmarkOverlayElement/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkOverlayElement/_coachmark-overlay-element.scss +52 -0
- package/scss/components/CoachmarkOverlayElement/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkOverlayElement/_index.scss +8 -0
- package/scss/components/CoachmarkOverlayElements/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +47 -0
- package/scss/components/CoachmarkOverlayElements/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkOverlayElements/_index.scss +8 -0
- package/scss/components/CoachmarkStack/_carbon-imports.scss +9 -0
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +95 -0
- package/scss/components/CoachmarkStack/_index-with-carbon.scss +9 -0
- package/scss/components/CoachmarkStack/_index.scss +8 -0
- package/scss/components/CreateSidePanel/_create-side-panel.scss +1 -38
- package/scss/components/Datagrid/styles/_datagrid.scss +15 -0
- package/scss/components/EditSidePanel/_edit-side-panel.scss +0 -18
- package/scss/components/FilterSummary/_filter-summary.scss +22 -1
- package/scss/components/InterstitialScreen/_carbon-imports.scss +9 -0
- package/scss/components/InterstitialScreen/_index-with-carbon.scss +9 -0
- package/scss/components/InterstitialScreen/_index.scss +8 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +276 -0
- package/scss/components/InterstitialScreenView/_carbon-imports.scss +9 -0
- package/scss/components/InterstitialScreenView/_index-with-carbon.scss +9 -0
- package/scss/components/InterstitialScreenView/_index.scss +8 -0
- package/scss/components/InterstitialScreenView/_interstitial-screen-view.scss +25 -0
- package/scss/components/InterstitialScreenViewModule/_carbon-imports.scss +9 -0
- package/scss/components/InterstitialScreenViewModule/_index-with-carbon.scss +9 -0
- package/scss/components/InterstitialScreenViewModule/_index.scss +8 -0
- package/scss/components/InterstitialScreenViewModule/_interstitial-screen-view-module.scss +59 -0
- package/scss/components/PageHeader/_page-header.scss +0 -1
- package/scss/components/SearchBar/_carbon-imports.scss +9 -0
- package/scss/components/SearchBar/_index-with-carbon.scss +9 -0
- package/scss/components/SearchBar/_index.scss +8 -0
- package/scss/components/SearchBar/_search-bar.scss +26 -0
- package/scss/components/SidePanel/_side-panel.scss +12 -7
- package/scss/components/_index-with-carbon.scss +11 -0
- package/scss/components/_index.scss +11 -0
@@ -17,7 +17,7 @@ var _settings = require("../../../settings");
|
|
17
17
|
var _EmptyStateContent = require("../EmptyStateContent");
|
18
18
|
var _NoTagsIllustration = require("../assets/NoTagsIllustration");
|
19
19
|
var _EmptyState = require("../EmptyState");
|
20
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "link", "size", "subtitle", "title"];
|
20
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
21
21
|
/**
|
22
22
|
* Copyright IBM Corp. 2020, 2021
|
23
23
|
*
|
@@ -41,6 +41,7 @@ var NoTagsEmptyState = exports.NoTagsEmptyState = /*#__PURE__*/_react.default.fo
|
|
41
41
|
_ref$illustrationPosi = _ref.illustrationPosition,
|
42
42
|
illustrationPosition = _ref$illustrationPosi === void 0 ? _EmptyState.defaults.position : _ref$illustrationPosi,
|
43
43
|
illustrationTheme = _ref.illustrationTheme,
|
44
|
+
illustrationDescription = _ref.illustrationDescription,
|
44
45
|
link = _ref.link,
|
45
46
|
_ref$size = _ref.size,
|
46
47
|
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
@@ -53,7 +54,7 @@ var NoTagsEmptyState = exports.NoTagsEmptyState = /*#__PURE__*/_react.default.fo
|
|
53
54
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_NoTagsIllustration.NoTagsIllustration, {
|
54
55
|
theme: illustrationTheme,
|
55
56
|
size: size,
|
56
|
-
|
57
|
+
alt: illustrationDescription || title
|
57
58
|
}), /*#__PURE__*/_react.default.createElement(_EmptyStateContent.EmptyStateContent, {
|
58
59
|
action: action,
|
59
60
|
link: link,
|
@@ -87,6 +88,10 @@ NoTagsEmptyState.propTypes = {
|
|
87
88
|
* Provide an optional class to be applied to the containing node.
|
88
89
|
*/
|
89
90
|
className: _propTypes.default.string,
|
91
|
+
/**
|
92
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
93
|
+
*/
|
94
|
+
illustrationDescription: _propTypes.default.string,
|
90
95
|
/**
|
91
96
|
* Designates the position of the illustration relative to the content
|
92
97
|
*/
|
@@ -17,7 +17,7 @@ var _settings = require("../../../settings");
|
|
17
17
|
var _EmptyStateContent = require("../EmptyStateContent");
|
18
18
|
var _NotFoundIllustration = require("../assets/NotFoundIllustration");
|
19
19
|
var _EmptyState = require("../EmptyState");
|
20
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "link", "size", "subtitle", "title"];
|
20
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
21
21
|
/**
|
22
22
|
* Copyright IBM Corp. 2020, 2021
|
23
23
|
*
|
@@ -41,6 +41,7 @@ var NotFoundEmptyState = exports.NotFoundEmptyState = /*#__PURE__*/_react.defaul
|
|
41
41
|
_ref$illustrationPosi = _ref.illustrationPosition,
|
42
42
|
illustrationPosition = _ref$illustrationPosi === void 0 ? _EmptyState.defaults.position : _ref$illustrationPosi,
|
43
43
|
illustrationTheme = _ref.illustrationTheme,
|
44
|
+
illustrationDescription = _ref.illustrationDescription,
|
44
45
|
link = _ref.link,
|
45
46
|
_ref$size = _ref.size,
|
46
47
|
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
@@ -53,7 +54,7 @@ var NotFoundEmptyState = exports.NotFoundEmptyState = /*#__PURE__*/_react.defaul
|
|
53
54
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_NotFoundIllustration.NotFoundIllustration, {
|
54
55
|
theme: illustrationTheme,
|
55
56
|
size: size,
|
56
|
-
|
57
|
+
alt: illustrationDescription || title
|
57
58
|
}), /*#__PURE__*/_react.default.createElement(_EmptyStateContent.EmptyStateContent, {
|
58
59
|
action: action,
|
59
60
|
link: link,
|
@@ -87,6 +88,10 @@ NotFoundEmptyState.propTypes = {
|
|
87
88
|
* Provide an optional class to be applied to the containing node.
|
88
89
|
*/
|
89
90
|
className: _propTypes.default.string,
|
91
|
+
/**
|
92
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
93
|
+
*/
|
94
|
+
illustrationDescription: _propTypes.default.string,
|
90
95
|
/**
|
91
96
|
* Designates the position of the illustration relative to the content
|
92
97
|
*/
|
@@ -17,7 +17,7 @@ var _settings = require("../../../settings");
|
|
17
17
|
var _EmptyStateContent = require("../EmptyStateContent");
|
18
18
|
var _NotificationsIllustration = require("../assets/NotificationsIllustration");
|
19
19
|
var _EmptyState = require("../EmptyState");
|
20
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "link", "size", "subtitle", "title"];
|
20
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
21
21
|
/**
|
22
22
|
* Copyright IBM Corp. 2020, 2021
|
23
23
|
*
|
@@ -41,6 +41,7 @@ var NotificationsEmptyState = exports.NotificationsEmptyState = /*#__PURE__*/_re
|
|
41
41
|
_ref$illustrationPosi = _ref.illustrationPosition,
|
42
42
|
illustrationPosition = _ref$illustrationPosi === void 0 ? _EmptyState.defaults.position : _ref$illustrationPosi,
|
43
43
|
illustrationTheme = _ref.illustrationTheme,
|
44
|
+
illustrationDescription = _ref.illustrationDescription,
|
44
45
|
link = _ref.link,
|
45
46
|
_ref$size = _ref.size,
|
46
47
|
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
@@ -53,7 +54,7 @@ var NotificationsEmptyState = exports.NotificationsEmptyState = /*#__PURE__*/_re
|
|
53
54
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_NotificationsIllustration.NotificationsIllustration, {
|
54
55
|
size: size,
|
55
56
|
theme: illustrationTheme,
|
56
|
-
|
57
|
+
alt: illustrationDescription || title
|
57
58
|
}), /*#__PURE__*/_react.default.createElement(_EmptyStateContent.EmptyStateContent, {
|
58
59
|
action: action,
|
59
60
|
link: link,
|
@@ -87,6 +88,10 @@ NotificationsEmptyState.propTypes = {
|
|
87
88
|
* Provide an optional class to be applied to the containing node.
|
88
89
|
*/
|
89
90
|
className: _propTypes.default.string,
|
91
|
+
/**
|
92
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
93
|
+
*/
|
94
|
+
illustrationDescription: _propTypes.default.string,
|
90
95
|
/**
|
91
96
|
* Designates the position of the illustration relative to the content
|
92
97
|
*/
|
@@ -17,7 +17,7 @@ var _settings = require("../../../settings");
|
|
17
17
|
var _EmptyStateContent = require("../EmptyStateContent");
|
18
18
|
var _UnauthorizedIllustration = require("../assets/UnauthorizedIllustration");
|
19
19
|
var _EmptyState = require("../EmptyState");
|
20
|
-
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "link", "size", "subtitle", "title"];
|
20
|
+
var _excluded = ["action", "className", "illustrationPosition", "illustrationTheme", "illustrationDescription", "link", "size", "subtitle", "title"];
|
21
21
|
/**
|
22
22
|
* Copyright IBM Corp. 2020, 2021
|
23
23
|
*
|
@@ -41,6 +41,7 @@ var UnauthorizedEmptyState = exports.UnauthorizedEmptyState = /*#__PURE__*/_reac
|
|
41
41
|
_ref$illustrationPosi = _ref.illustrationPosition,
|
42
42
|
illustrationPosition = _ref$illustrationPosi === void 0 ? _EmptyState.defaults.position : _ref$illustrationPosi,
|
43
43
|
illustrationTheme = _ref.illustrationTheme,
|
44
|
+
illustrationDescription = _ref.illustrationDescription,
|
44
45
|
link = _ref.link,
|
45
46
|
_ref$size = _ref.size,
|
46
47
|
size = _ref$size === void 0 ? _EmptyState.defaults.size : _ref$size,
|
@@ -53,7 +54,7 @@ var UnauthorizedEmptyState = exports.UnauthorizedEmptyState = /*#__PURE__*/_reac
|
|
53
54
|
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_UnauthorizedIllustration.UnauthorizedIllustration, {
|
54
55
|
size: size,
|
55
56
|
theme: illustrationTheme,
|
56
|
-
|
57
|
+
alt: illustrationDescription || title
|
57
58
|
}), /*#__PURE__*/_react.default.createElement(_EmptyStateContent.EmptyStateContent, {
|
58
59
|
action: action,
|
59
60
|
link: link,
|
@@ -87,6 +88,10 @@ UnauthorizedEmptyState.propTypes = {
|
|
87
88
|
* Provide an optional class to be applied to the containing node.
|
88
89
|
*/
|
89
90
|
className: _propTypes.default.string,
|
91
|
+
/**
|
92
|
+
* The alt text for empty state svg images. If not provided , title will be used.
|
93
|
+
*/
|
94
|
+
illustrationDescription: _propTypes.default.string,
|
90
95
|
/**
|
91
96
|
* Designates the position of the illustration relative to the content
|
92
97
|
*/
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var ErrorIllustration = exports.ErrorIllustration = function ErrorIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -36,7 +36,7 @@ var ErrorIllustration = exports.ErrorIllustration = function ErrorIllustration(_
|
|
36
36
|
viewBox: "0 0 80 80",
|
37
37
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-error"), "".concat(blockClass, "__illustration--").concat(size)]),
|
38
38
|
role: "img"
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
39
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
40
40
|
id: "prefix__a_dark_".concat(svgId),
|
41
41
|
x1: 38.9,
|
42
42
|
y1: 77.08,
|
@@ -213,7 +213,7 @@ var ErrorIllustration = exports.ErrorIllustration = function ErrorIllustration(_
|
|
213
213
|
})));
|
214
214
|
};
|
215
215
|
ErrorIllustration.propTypes = {
|
216
|
+
alt: _propTypes.default.string.isRequired,
|
216
217
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
217
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
218
|
-
title: _propTypes.default.string
|
218
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
219
219
|
};
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var NoDataIllustration = exports.NoDataIllustration = function NoDataIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -36,7 +36,7 @@ var NoDataIllustration = exports.NoDataIllustration = function NoDataIllustratio
|
|
36
36
|
viewBox: "0 0 80 80",
|
37
37
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noData"), "".concat(blockClass, "__illustration--").concat(size)]),
|
38
38
|
role: "img"
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
39
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
40
40
|
id: "prefix__a_dark_".concat(svgId),
|
41
41
|
x1: 11.12,
|
42
42
|
y1: 43.34,
|
@@ -176,7 +176,7 @@ var NoDataIllustration = exports.NoDataIllustration = function NoDataIllustratio
|
|
176
176
|
})));
|
177
177
|
};
|
178
178
|
NoDataIllustration.propTypes = {
|
179
|
+
alt: _propTypes.default.string.isRequired,
|
179
180
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
180
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
181
|
-
title: _propTypes.default.string
|
181
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
182
182
|
};
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var NoTagsIllustration = exports.NoTagsIllustration = function NoTagsIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -37,7 +37,7 @@ var NoTagsIllustration = exports.NoTagsIllustration = function NoTagsIllustratio
|
|
37
37
|
viewBox: "0 0 80 80",
|
38
38
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-noTags"), "".concat(blockClass, "__illustration--").concat(size)]),
|
39
39
|
role: "img"
|
40
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
40
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
41
41
|
id: "prefix__c_dark_".concat(svgId),
|
42
42
|
x1: 34.96,
|
43
43
|
y1: 5.37,
|
@@ -483,7 +483,7 @@ var NoTagsIllustration = exports.NoTagsIllustration = function NoTagsIllustratio
|
|
483
483
|
})));
|
484
484
|
};
|
485
485
|
NoTagsIllustration.propTypes = {
|
486
|
+
alt: _propTypes.default.string.isRequired,
|
486
487
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
487
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
488
|
-
title: _propTypes.default.string
|
488
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
489
489
|
};
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var NotFoundIllustration = exports.NotFoundIllustration = function NotFoundIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -36,7 +36,7 @@ var NotFoundIllustration = exports.NotFoundIllustration = function NotFoundIllus
|
|
36
36
|
viewBox: "0 0 80 80",
|
37
37
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notFound"), "".concat(blockClass, "__illustration--").concat(size)]),
|
38
38
|
role: "img"
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
39
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
40
40
|
id: "prefix__a_dark_".concat(svgId),
|
41
41
|
x1: 2.6,
|
42
42
|
y1: -12.81,
|
@@ -360,7 +360,7 @@ var NotFoundIllustration = exports.NotFoundIllustration = function NotFoundIllus
|
|
360
360
|
})));
|
361
361
|
};
|
362
362
|
NotFoundIllustration.propTypes = {
|
363
|
+
alt: _propTypes.default.string.isRequired,
|
363
364
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
364
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
365
|
-
title: _propTypes.default.string
|
365
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
366
366
|
};
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var NotificationsIllustration = exports.NotificationsIllustration = function NotificationsIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -36,7 +36,7 @@ var NotificationsIllustration = exports.NotificationsIllustration = function Not
|
|
36
36
|
viewBox: "0 0 80 80",
|
37
37
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-notification"), "".concat(blockClass, "__illustration--").concat(size)]),
|
38
38
|
role: "img"
|
39
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
39
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
40
40
|
id: "prefix__a_dark_".concat(svgId),
|
41
41
|
x1: 30.05,
|
42
42
|
y1: 54.31,
|
@@ -331,7 +331,7 @@ var NotificationsIllustration = exports.NotificationsIllustration = function Not
|
|
331
331
|
})));
|
332
332
|
};
|
333
333
|
NotificationsIllustration.propTypes = {
|
334
|
+
alt: _propTypes.default.string.isRequired,
|
334
335
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
335
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
336
|
-
title: _propTypes.default.string
|
336
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
337
337
|
};
|
@@ -12,7 +12,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
12
12
|
var _classnames = _interopRequireDefault(require("classnames"));
|
13
13
|
var _settings = require("../../../settings");
|
14
14
|
var _uuidv = _interopRequireDefault(require("../../../global/js/utils/uuidv4"));
|
15
|
-
var _excluded = ["theme", "
|
15
|
+
var _excluded = ["theme", "size", "alt"];
|
16
16
|
/**
|
17
17
|
* Copyright IBM Corp. 2020, 2021
|
18
18
|
*
|
@@ -25,8 +25,8 @@ var _excluded = ["theme", "title", "size"];
|
|
25
25
|
var blockClass = "".concat(_settings.pkg.prefix, "--empty-state");
|
26
26
|
var UnauthorizedIllustration = exports.UnauthorizedIllustration = function UnauthorizedIllustration(_ref) {
|
27
27
|
var theme = _ref.theme,
|
28
|
-
title = _ref.title,
|
29
28
|
size = _ref.size,
|
29
|
+
alt = _ref.alt,
|
30
30
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
31
|
var svgId = (0, _uuidv.default)();
|
32
32
|
return /*#__PURE__*/_react.default.createElement("svg", (0, _extends2.default)({}, rest, {
|
@@ -37,7 +37,7 @@ var UnauthorizedIllustration = exports.UnauthorizedIllustration = function Unaut
|
|
37
37
|
viewBox: "0 0 80 80",
|
38
38
|
className: (0, _classnames.default)(["".concat(blockClass, "__illustration"), "".concat(blockClass, "__illustration-unauthorized"), "".concat(blockClass, "__illustration--").concat(size)]),
|
39
39
|
role: "img"
|
40
|
-
}), /*#__PURE__*/_react.default.createElement("title", null,
|
40
|
+
}), /*#__PURE__*/_react.default.createElement("title", null, alt), theme === 'dark' ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("defs", null, /*#__PURE__*/_react.default.createElement("linearGradient", {
|
41
41
|
id: "prefix__b_dark_".concat(svgId),
|
42
42
|
x1: 17.33,
|
43
43
|
y1: 40.68,
|
@@ -304,7 +304,7 @@ var UnauthorizedIllustration = exports.UnauthorizedIllustration = function Unaut
|
|
304
304
|
})));
|
305
305
|
};
|
306
306
|
UnauthorizedIllustration.propTypes = {
|
307
|
+
alt: _propTypes.default.string.isRequired,
|
307
308
|
size: _propTypes.default.oneOf(['lg', 'sm']),
|
308
|
-
theme: _propTypes.default.oneOf(['light', 'dark'])
|
309
|
-
title: _propTypes.default.string
|
309
|
+
theme: _propTypes.default.oneOf(['light', 'dark'])
|
310
310
|
};
|
@@ -7,20 +7,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
});
|
8
8
|
exports.default = void 0;
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
12
|
-
var _react = require("
|
13
|
-
var _react2 =
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
14
|
+
var _react2 = require("@carbon/react");
|
15
|
+
var _framerMotion = require("framer-motion");
|
16
|
+
var _icons = require("@carbon/react/icons");
|
14
17
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
15
18
|
var _classnames = _interopRequireDefault(require("classnames"));
|
16
19
|
var _TagSet = require("../TagSet");
|
17
20
|
var _settings = require("../../settings");
|
18
21
|
var _uuidv = _interopRequireDefault(require("../../global/js/utils/uuidv4"));
|
22
|
+
var _motionConstants = require("../../global/js/utils/motionConstants");
|
23
|
+
var _hooks = require("../../global/js/hooks");
|
24
|
+
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
19
25
|
var _devtools = require("../../global/js/utils/devtools");
|
20
26
|
var _excluded = ["className", "clearFiltersText", "clearFilters", "filters", "renderLabel", "overflowType", "clearButtonInline"],
|
21
27
|
_excluded2 = ["key", "value"];
|
22
28
|
/**
|
23
|
-
* Copyright IBM Corp. 2022,
|
29
|
+
* Copyright IBM Corp. 2022, 2024
|
24
30
|
*
|
25
31
|
* This source code is licensed under the Apache-2.0 license found in the
|
26
32
|
* LICENSE file in the root directory of this source tree.
|
@@ -30,8 +36,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
30
36
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
31
37
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
32
38
|
var blockClass = "".concat(_settings.pkg.prefix, "--filter-summary");
|
33
|
-
var FilterSummary = /*#__PURE__*/
|
34
|
-
var _filterSummaryClearBu;
|
39
|
+
var FilterSummary = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
40
|
+
var _viewAllButtonRef$cur, _filterSummaryClearBu;
|
35
41
|
var _ref$className = _ref.className,
|
36
42
|
className = _ref$className === void 0 ? '' : _ref$className,
|
37
43
|
_ref$clearFiltersText = _ref.clearFiltersText,
|
@@ -56,30 +62,104 @@ var FilterSummary = /*#__PURE__*/_react2.default.forwardRef(function (_ref, ref)
|
|
56
62
|
label: (_renderLabel = renderLabel === null || renderLabel === void 0 ? void 0 : renderLabel(key, value)) !== null && _renderLabel !== void 0 ? _renderLabel : "".concat(key, ": ").concat(value)
|
57
63
|
});
|
58
64
|
});
|
59
|
-
var filterSummaryClearButton = (0,
|
60
|
-
var
|
61
|
-
var
|
62
|
-
|
65
|
+
var filterSummaryClearButton = (0, _react.useRef)();
|
66
|
+
var viewAllButtonRef = (0, _react.useRef)();
|
67
|
+
var filterSummaryRef = (0, _react.useRef)();
|
68
|
+
var localRef = filterSummaryRef || ref;
|
69
|
+
var _useState = (0, _react.useState)(0),
|
70
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
71
|
+
overflowCount = _useState2[0],
|
72
|
+
setOverflowCount = _useState2[1];
|
73
|
+
var _useState3 = (0, _react.useState)(false),
|
74
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
75
|
+
multiline = _useState4[0],
|
76
|
+
setMultiline = _useState4[1];
|
77
|
+
var previousState = (0, _hooks.usePreviousValue)({
|
78
|
+
multiline: multiline
|
79
|
+
});
|
80
|
+
var handleViewAll = function handleViewAll() {
|
81
|
+
if (overflowCount === 0) {
|
82
|
+
setMultiline(false);
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
setMultiline(function (prev) {
|
86
|
+
return !prev;
|
87
|
+
});
|
88
|
+
};
|
89
|
+
var viewAllWidth = typeof (viewAllButtonRef === null || viewAllButtonRef === void 0 || (_viewAllButtonRef$cur = viewAllButtonRef.current) === null || _viewAllButtonRef$cur === void 0 ? void 0 : _viewAllButtonRef$cur.offsetWidth) === 'undefined' ? 0 : overflowCount > 0 ? 48 : 0;
|
90
|
+
var measurementOffset = (filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth) + viewAllWidth;
|
91
|
+
var renderTagSet = function renderTagSet(type) {
|
92
|
+
return /*#__PURE__*/_react.default.createElement(_framerMotion.motion.div, {
|
93
|
+
key: type,
|
94
|
+
initial: {
|
95
|
+
opacity: 0,
|
96
|
+
y: -16
|
97
|
+
},
|
98
|
+
animate: {
|
99
|
+
opacity: 1,
|
100
|
+
y: 0
|
101
|
+
},
|
102
|
+
exit: {
|
103
|
+
opacity: 0,
|
104
|
+
y: -16
|
105
|
+
},
|
106
|
+
transition: {
|
107
|
+
duration: _motionConstants.DURATIONS.moderate01,
|
108
|
+
ease: _motionConstants.EASINGS.productive.entrance
|
109
|
+
}
|
110
|
+
}, /*#__PURE__*/_react.default.createElement(_TagSet.TagSet, {
|
111
|
+
allTagsModalSearchLabel: "Search all tags",
|
112
|
+
allTagsModalSearchPlaceholderText: "Search all tags",
|
113
|
+
allTagsModalTitle: "All tags",
|
114
|
+
showAllTagsLabel: "View all tags",
|
115
|
+
tags: tagFilters,
|
116
|
+
overflowType: overflowType,
|
117
|
+
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__clear-button-inline"), clearButtonInline)),
|
118
|
+
containingElementRef: localRef,
|
119
|
+
measurementOffset: measurementOffset,
|
120
|
+
onOverflowTagChange: function onOverflowTagChange(overflowTags) {
|
121
|
+
return setOverflowCount(overflowTags.length);
|
122
|
+
},
|
123
|
+
multiline: multiline
|
124
|
+
}));
|
125
|
+
};
|
126
|
+
(0, _hooks.useWindowResize)(function () {
|
127
|
+
var handleFilterSummaryResize = function handleFilterSummaryResize() {
|
128
|
+
var _localRef$current;
|
129
|
+
if (multiline && (localRef === null || localRef === void 0 || (_localRef$current = localRef.current) === null || _localRef$current === void 0 ? void 0 : _localRef$current.offsetHeight) <= 50) {
|
130
|
+
setMultiline(false);
|
131
|
+
}
|
132
|
+
};
|
133
|
+
var filterResize = (0, _debounce.default)(handleFilterSummaryResize, 500);
|
134
|
+
filterResize();
|
135
|
+
}, [previousState === null || previousState === void 0 ? void 0 : previousState.multiline, multiline]);
|
136
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, (0, _devtools.getDevtoolsProps)(componentName), {
|
63
137
|
id: filterSummaryId
|
64
138
|
}, rest, {
|
65
139
|
ref: localRef,
|
66
|
-
className: (0, _classnames.default)([blockClass, className])
|
67
|
-
}), /*#__PURE__*/
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
showAllTagsLabel: "View all tags",
|
72
|
-
tags: tagFilters,
|
73
|
-
overflowType: overflowType,
|
74
|
-
className: (0, _classnames.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__clear-button-inline"), clearButtonInline)),
|
75
|
-
containingElementRef: localRef,
|
76
|
-
measurementOffset: filterSummaryClearButton === null || filterSummaryClearButton === void 0 || (_filterSummaryClearBu = filterSummaryClearButton.current) === null || _filterSummaryClearBu === void 0 ? void 0 : _filterSummaryClearBu.offsetWidth
|
77
|
-
}), /*#__PURE__*/_react2.default.createElement(_react.Button, {
|
140
|
+
className: (0, _classnames.default)([blockClass, className], (0, _defineProperty2.default)({}, "".concat(blockClass, "__expanded"), multiline))
|
141
|
+
}), /*#__PURE__*/_react.default.createElement(_framerMotion.AnimatePresence, {
|
142
|
+
mode: "wait",
|
143
|
+
exitBeforeEnter: true
|
144
|
+
}, !multiline && renderTagSet('single'), multiline && renderTagSet('multiline')), /*#__PURE__*/_react.default.createElement(_react2.Button, {
|
78
145
|
kind: "ghost",
|
79
146
|
size: "sm",
|
80
147
|
onClick: clearFilters,
|
81
|
-
ref: filterSummaryClearButton
|
82
|
-
|
148
|
+
ref: filterSummaryClearButton,
|
149
|
+
className: "".concat(blockClass, "__clear-all-button")
|
150
|
+
}, clearFiltersText), (overflowCount > 0 || multiline) && /*#__PURE__*/_react.default.createElement("div", {
|
151
|
+
className: "".concat(blockClass, "__view-all--wrapper")
|
152
|
+
}, /*#__PURE__*/_react.default.createElement(_react2.IconButton, {
|
153
|
+
ref: viewAllButtonRef,
|
154
|
+
kind: "ghost",
|
155
|
+
label: 'View all',
|
156
|
+
className: "".concat(blockClass, "__view-all--trigger"),
|
157
|
+
align: "left",
|
158
|
+
onClick: handleViewAll,
|
159
|
+
size: "sm"
|
160
|
+
}, /*#__PURE__*/_react.default.createElement(_icons.ChevronDown, {
|
161
|
+
className: (0, _classnames.default)("".concat(blockClass, "__view-all--chevron"), (0, _defineProperty2.default)({}, "".concat(blockClass, "__view-all--chevron-multiline"), multiline))
|
162
|
+
}))));
|
83
163
|
});
|
84
164
|
var componentName = 'FilterSummary';
|
85
165
|
FilterSummary.displayName = componentName;
|