@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
@@ -0,0 +1,83 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["className", "title", "description"];
|
4
|
+
/**
|
5
|
+
* Copyright IBM Corp. 2024, 2024
|
6
|
+
*
|
7
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
9
|
+
*/
|
10
|
+
|
11
|
+
// Import portions of React that are needed.
|
12
|
+
import React from 'react';
|
13
|
+
|
14
|
+
// Other standard imports.
|
15
|
+
import PropTypes from 'prop-types';
|
16
|
+
import cx from 'classnames';
|
17
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
18
|
+
import { pkg /*, carbon */ } from '../../settings';
|
19
|
+
|
20
|
+
// Carbon and package components we use.
|
21
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
22
|
+
|
23
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
24
|
+
var blockClass = "".concat(pkg.prefix, "--interstitial-screen-view-module");
|
25
|
+
var componentName = 'InterstitialScreenViewModule';
|
26
|
+
|
27
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
28
|
+
|
29
|
+
// Default values can be included here and then assigned to the prop params,
|
30
|
+
// e.g. prop = defaults.prop,
|
31
|
+
// This gathers default values together neatly and ensures non-primitive
|
32
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
33
|
+
// Note that default values are not required for props that are 'required',
|
34
|
+
// nor for props where the component can apply undefined values reasonably.
|
35
|
+
// Default values should be provided when the component needs to make a choice
|
36
|
+
// or assumption when a prop is not supplied.
|
37
|
+
|
38
|
+
/**
|
39
|
+
* View module to help in building interstitial screen views.
|
40
|
+
*/
|
41
|
+
export var InterstitialScreenViewModule = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
42
|
+
var className = _ref.className,
|
43
|
+
title = _ref.title,
|
44
|
+
description = _ref.description,
|
45
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
46
|
+
return /*#__PURE__*/React.createElement("section", _extends({}, rest, {
|
47
|
+
className: cx(blockClass,
|
48
|
+
// Apply the block class to the main HTML element
|
49
|
+
className // Apply any supplied class names to the main HTML element.
|
50
|
+
),
|
51
|
+
|
52
|
+
ref: ref
|
53
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("h1", {
|
54
|
+
className: "".concat(blockClass, "--heading")
|
55
|
+
}, title), /*#__PURE__*/React.createElement("p", {
|
56
|
+
className: "".concat(blockClass, "--body")
|
57
|
+
}, description));
|
58
|
+
});
|
59
|
+
|
60
|
+
// Return a placeholder if not released and not enabled by feature flag
|
61
|
+
InterstitialScreenViewModule = pkg.checkComponentEnabled(InterstitialScreenViewModule, componentName);
|
62
|
+
|
63
|
+
// The display name of the component, used by React. Note that displayName
|
64
|
+
// is used in preference to relying on function.name.
|
65
|
+
InterstitialScreenViewModule.displayName = componentName;
|
66
|
+
|
67
|
+
// The types and DocGen commentary for the component props,
|
68
|
+
// in alphabetical order (for consistency).
|
69
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
70
|
+
InterstitialScreenViewModule.propTypes = {
|
71
|
+
/**
|
72
|
+
* Provide an optional class to be applied to the containing node.
|
73
|
+
*/
|
74
|
+
className: PropTypes.string,
|
75
|
+
/**
|
76
|
+
* The description of this component.
|
77
|
+
*/
|
78
|
+
description: PropTypes.string.isRequired,
|
79
|
+
/**
|
80
|
+
* The title of this component.
|
81
|
+
*/
|
82
|
+
title: PropTypes.string.isRequired
|
83
|
+
};
|
@@ -71,8 +71,8 @@ export var utilCheckUpdateVerticalSpace = function utilCheckUpdateVerticalSpace(
|
|
71
71
|
var offsetMeasuringTop = offsetTopMeasuringRef.current ? offsetTopMeasuringRef.current.getBoundingClientRect().top : 0;
|
72
72
|
|
73
73
|
// The header offset calculation is either going to work out at 0 if we have no gap between scrolling container
|
74
|
-
// top and the measuring ref top, or the difference between.
|
75
|
-
update.headerOffset = offsetMeasuringTop - scrollableContainerTop;
|
74
|
+
// top and the measuring ref top, or the difference between.
|
75
|
+
update.headerOffset = offsetMeasuringTop === 0 ? offsetMeasuringTop - scrollableContainerTop : 0;
|
76
76
|
|
77
77
|
/* istanbul ignore next */
|
78
78
|
update.breadcrumbRowHeight = breadcrumbRowEl ? breadcrumbRowEl.clientHeight : 0;
|
@@ -0,0 +1,227 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["className", "clearButtonLabelText", "hideScopesLabel", "labelText", "onChange", "onSubmit", "placeHolderText", "scopes", "scopesTypeLabel", "scopeToString", "selectedScopes", "sortItems", "submitLabel", "translateWithId", "value"];
|
6
|
+
/**
|
7
|
+
* Copyright IBM Corp. 2024, 2024
|
8
|
+
*
|
9
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
11
|
+
*/
|
12
|
+
|
13
|
+
// Import portions of React that are needed.
|
14
|
+
import React, { useEffect, useState } from 'react';
|
15
|
+
|
16
|
+
// Other standard imports.
|
17
|
+
import PropTypes from 'prop-types';
|
18
|
+
import cx from 'classnames';
|
19
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
20
|
+
import { pkg } from '../../settings';
|
21
|
+
|
22
|
+
// Carbon and package components we use.
|
23
|
+
import { Search, Button, MultiSelect } from '@carbon/react';
|
24
|
+
|
25
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
26
|
+
var blockClass = "".concat(pkg.prefix, "--search-bar");
|
27
|
+
var componentName = 'SearchBar';
|
28
|
+
|
29
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
30
|
+
|
31
|
+
// Default values for props
|
32
|
+
var defaults = {
|
33
|
+
onSubmit: function onSubmit() {},
|
34
|
+
onChange: function onChange() {},
|
35
|
+
scopes: [],
|
36
|
+
selectedScopes: [],
|
37
|
+
hideScopesLabel: true
|
38
|
+
};
|
39
|
+
|
40
|
+
/**
|
41
|
+
* Search bar with input field and search button
|
42
|
+
*/
|
43
|
+
export var SearchBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
44
|
+
var className = _ref.className,
|
45
|
+
clearButtonLabelText = _ref.clearButtonLabelText,
|
46
|
+
_ref$hideScopesLabel = _ref.hideScopesLabel,
|
47
|
+
hideScopesLabel = _ref$hideScopesLabel === void 0 ? defaults.hideScopesLabel : _ref$hideScopesLabel,
|
48
|
+
labelText = _ref.labelText,
|
49
|
+
_ref$onChange = _ref.onChange,
|
50
|
+
onChange = _ref$onChange === void 0 ? defaults.onChange : _ref$onChange,
|
51
|
+
_ref$onSubmit = _ref.onSubmit,
|
52
|
+
onSubmit = _ref$onSubmit === void 0 ? defaults.onSubmit : _ref$onSubmit,
|
53
|
+
placeHolderText = _ref.placeHolderText,
|
54
|
+
_ref$scopes = _ref.scopes,
|
55
|
+
scopes = _ref$scopes === void 0 ? defaults.scopes : _ref$scopes,
|
56
|
+
scopesTypeLabel = _ref.scopesTypeLabel,
|
57
|
+
scopeToString = _ref.scopeToString,
|
58
|
+
_ref$selectedScopes = _ref.selectedScopes,
|
59
|
+
selectedScopes = _ref$selectedScopes === void 0 ? defaults.selectedScopes : _ref$selectedScopes,
|
60
|
+
sortItems = _ref.sortItems,
|
61
|
+
submitLabel = _ref.submitLabel,
|
62
|
+
translateWithId = _ref.translateWithId,
|
63
|
+
value = _ref.value,
|
64
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
65
|
+
var _useState = useState(value || ''),
|
66
|
+
_useState2 = _slicedToArray(_useState, 2),
|
67
|
+
text = _useState2[0],
|
68
|
+
setText = _useState2[1];
|
69
|
+
var _useState3 = useState(selectedScopes || []),
|
70
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
71
|
+
_selectedScopes = _useState4[0],
|
72
|
+
setSelectedScopes = _useState4[1];
|
73
|
+
var _useState5 = useState(false),
|
74
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
75
|
+
isInputDirty = _useState6[0],
|
76
|
+
setIsInputDirty = _useState6[1];
|
77
|
+
useEffect(function () {
|
78
|
+
if (!text || !text.length) {
|
79
|
+
setIsInputDirty(false);
|
80
|
+
} else {
|
81
|
+
setIsInputDirty(true);
|
82
|
+
}
|
83
|
+
}, [text]);
|
84
|
+
/**
|
85
|
+
* Handler for form submit that calls onSubmit prop.
|
86
|
+
* @param {Event} event Submit event generated.
|
87
|
+
*/
|
88
|
+
var handleSubmit = function handleSubmit(event) {
|
89
|
+
event.preventDefault();
|
90
|
+
var eventObject = {
|
91
|
+
value: text
|
92
|
+
};
|
93
|
+
if (scopes.length > 0) {
|
94
|
+
eventObject.selectedScopes = _selectedScopes;
|
95
|
+
}
|
96
|
+
onSubmit(eventObject);
|
97
|
+
};
|
98
|
+
|
99
|
+
/**
|
100
|
+
* Handler for when scope selection changes that calls onChangeProp.
|
101
|
+
* @param {{selectedItems: Array<any>}} {selectedItems} Object containing array of selected items.
|
102
|
+
*/
|
103
|
+
var handleSearchScopeChange = function handleSearchScopeChange(_ref2) {
|
104
|
+
var selectedItems = _ref2.selectedItems;
|
105
|
+
setSelectedScopes(selectedItems);
|
106
|
+
onChange({
|
107
|
+
selectedScopes: selectedItems,
|
108
|
+
value: text
|
109
|
+
});
|
110
|
+
};
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Handler for search input changes that calls onChange prop.
|
114
|
+
* @param {KeyboardEvent} event Event object from input change.
|
115
|
+
*/
|
116
|
+
var handleInputChange = function handleInputChange(event) {
|
117
|
+
var value = event.target.value;
|
118
|
+
var eventObject = {
|
119
|
+
value: value
|
120
|
+
};
|
121
|
+
if (scopes.length > 0) {
|
122
|
+
eventObject.selectedScopes = selectedScopes;
|
123
|
+
}
|
124
|
+
setText(value);
|
125
|
+
onChange(eventObject);
|
126
|
+
};
|
127
|
+
return /*#__PURE__*/React.createElement("form", _extends({}, rest, {
|
128
|
+
ref: ref
|
129
|
+
}, getDevtoolsProps(componentName), {
|
130
|
+
className: cx(blockClass, className, _defineProperty({}, "".concat(blockClass, "--hide-scopes-label"), hideScopesLabel)),
|
131
|
+
onSubmit: handleSubmit
|
132
|
+
}), scopes !== null && scopes !== void 0 && scopes.length ? /*#__PURE__*/React.createElement(MultiSelect, {
|
133
|
+
id: "".concat(blockClass, "__multi-select"),
|
134
|
+
name: "search-scopes",
|
135
|
+
className: "".concat(blockClass, "__scopes"),
|
136
|
+
label: scopesTypeLabel,
|
137
|
+
onChange: handleSearchScopeChange,
|
138
|
+
initialSelectedItems: selectedScopes,
|
139
|
+
items: scopes,
|
140
|
+
itemToString: scopeToString,
|
141
|
+
translateWithId: translateWithId,
|
142
|
+
sortItems: sortItems,
|
143
|
+
size: "lg"
|
144
|
+
}) : null, /*#__PURE__*/React.createElement(Search, {
|
145
|
+
className: "".concat(blockClass, "__input"),
|
146
|
+
closeButtonLabelText: clearButtonLabelText,
|
147
|
+
labelText: labelText || '',
|
148
|
+
name: "search-input",
|
149
|
+
onChange: handleInputChange,
|
150
|
+
placeholder: placeHolderText,
|
151
|
+
value: text,
|
152
|
+
size: "lg"
|
153
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
154
|
+
name: "search-submit",
|
155
|
+
kind: "primary",
|
156
|
+
type: "submit",
|
157
|
+
className: "".concat(blockClass, "__submit"),
|
158
|
+
disabled: !isInputDirty
|
159
|
+
}, submitLabel));
|
160
|
+
});
|
161
|
+
|
162
|
+
// Return a placeholder if not released and not enabled by feature flag
|
163
|
+
SearchBar = pkg.checkComponentEnabled(SearchBar, componentName);
|
164
|
+
|
165
|
+
// The display name of the component, used by React. Note that displayName
|
166
|
+
// is used in preference to relying on function.name.
|
167
|
+
SearchBar.displayName = componentName;
|
168
|
+
var conditionalScopePropValidator = function conditionalScopePropValidator(props, propName, componentName) {
|
169
|
+
if (props.scopes && props.scopes.length > 0 && !props[propName]) {
|
170
|
+
return new Error("Required `".concat(propName, "` when `scopes` prop type is supplied to `").concat(componentName, "`. Validation failed."));
|
171
|
+
}
|
172
|
+
for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
|
173
|
+
rest[_key - 3] = arguments[_key];
|
174
|
+
}
|
175
|
+
return PropTypes.string.apply(PropTypes, [props, propName, componentName].concat(rest));
|
176
|
+
};
|
177
|
+
|
178
|
+
// The types and DocGen commentary for the component props,
|
179
|
+
// in alphabetical order (for consistency).
|
180
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
181
|
+
SearchBar.propTypes = {
|
182
|
+
/** @type {string} Optional additional class name. */
|
183
|
+
className: PropTypes.string,
|
184
|
+
/** @type {string} The label text for the search text input. */
|
185
|
+
clearButtonLabelText: PropTypes.string.isRequired,
|
186
|
+
/**
|
187
|
+
* Whether or not the scopes MultiSelect label is visually hidden.
|
188
|
+
*/
|
189
|
+
hideScopesLabel: PropTypes.bool,
|
190
|
+
/** @type {string} The label text for the search text input. */
|
191
|
+
labelText: PropTypes.string,
|
192
|
+
/** @type {Function} Function handler for when the user changes their query search. */
|
193
|
+
onChange: PropTypes.func,
|
194
|
+
/** @type {Function} Function handler for when the user submits a search. */
|
195
|
+
onSubmit: PropTypes.func,
|
196
|
+
/** @type {string} Placeholder text to be displayed in the search input. */
|
197
|
+
placeHolderText: PropTypes.string.isRequired,
|
198
|
+
/** @type {Function} Function to get the text for each scope to display in dropdown. */
|
199
|
+
scopeToString: PropTypes.func,
|
200
|
+
/** @type {Array<any>} Array of allowed search scopes. */
|
201
|
+
scopes: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
|
202
|
+
/** @type {string} The name text for the search scope type. */
|
203
|
+
// eslint-disable-next-line react/require-default-props
|
204
|
+
scopesTypeLabel: conditionalScopePropValidator,
|
205
|
+
/** @type {Array<any> Array of initially selected search scopes. */
|
206
|
+
selectedScopes: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.object])),
|
207
|
+
/**
|
208
|
+
* Optional custom sorting algorithm for an array of scope items.
|
209
|
+
* By default, scope items are sorted in ascending alphabetical order,
|
210
|
+
* with "selected" items moved to the start of the scope items array.
|
211
|
+
*/
|
212
|
+
sortItems: PropTypes.func,
|
213
|
+
// eslint-disable-line react/require-default-props
|
214
|
+
|
215
|
+
/** @type {string} The label text for the search submit button. */
|
216
|
+
submitLabel: PropTypes.string.isRequired,
|
217
|
+
/**
|
218
|
+
* Provide accessible label text for the scopes MultiSelect.
|
219
|
+
*/
|
220
|
+
titleText: PropTypes.string,
|
221
|
+
/** @type {func} Callback function for translating MultiSelect's child ListBoxMenuIcon SVG title. */
|
222
|
+
translateWithId: PropTypes.func,
|
223
|
+
// eslint-disable-line react/require-default-props
|
224
|
+
|
225
|
+
/** @type {string} Search query value. */
|
226
|
+
value: PropTypes.string
|
227
|
+
};
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset"],
|
5
|
+
var _excluded = ["align", "allTagsModalTarget", "className", "maxVisible", "multiline", "overflowAlign", "overflowClassName", "overflowType", "allTagsModalTitle", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "showAllTagsLabel", "tags", "containingElementRef", "measurementOffset", "onOverflowTagChange"],
|
6
6
|
_excluded2 = ["label", "id"],
|
7
7
|
_excluded3 = ["label", "onClose"];
|
8
8
|
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; }
|
@@ -33,7 +33,8 @@ var defaults = {
|
|
33
33
|
align: 'start',
|
34
34
|
measurementOffset: 0,
|
35
35
|
overflowAlign: 'bottom',
|
36
|
-
overflowType: 'default'
|
36
|
+
overflowType: 'default',
|
37
|
+
onOverflowTagChange: function onOverflowTagChange() {}
|
37
38
|
};
|
38
39
|
export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
39
40
|
var _ref$align = _ref.align,
|
@@ -55,6 +56,8 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
55
56
|
containingElementRef = _ref.containingElementRef,
|
56
57
|
_ref$measurementOffse = _ref.measurementOffset,
|
57
58
|
measurementOffset = _ref$measurementOffse === void 0 ? defaults.measurementOffset : _ref$measurementOffse,
|
59
|
+
_ref$onOverflowTagCha = _ref.onOverflowTagChange,
|
60
|
+
onOverflowTagChange = _ref$onOverflowTagCha === void 0 ? defaults.onOverflowTagChange : _ref$onOverflowTagCha,
|
58
61
|
rest = _objectWithoutProperties(_ref, _excluded);
|
59
62
|
var _useState = useState(3),
|
60
63
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -151,8 +154,9 @@ export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
151
154
|
popoverOpen: popoverOpen,
|
152
155
|
setPopoverOpen: setPopoverOpen
|
153
156
|
}));
|
157
|
+
onOverflowTagChange === null || onOverflowTagChange === void 0 || onOverflowTagChange(newOverflowTags);
|
154
158
|
setDisplayedTags(newDisplayedTags);
|
155
|
-
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, popoverOpen, handleTagOnClose]);
|
159
|
+
}, [displayCount, overflowAlign, overflowClassName, overflowType, showAllTagsLabel, tags, onOverflowTagChange, popoverOpen, handleTagOnClose]);
|
156
160
|
var checkFullyVisibleTags = useCallback(function () {
|
157
161
|
if (multiline) {
|
158
162
|
return setDisplayCount(maxVisible);
|
@@ -306,6 +310,10 @@ TagSet.propTypes = {
|
|
306
310
|
* display tags in multiple lines
|
307
311
|
*/
|
308
312
|
multiline: PropTypes.bool,
|
313
|
+
/**
|
314
|
+
* Handler to get overflow tags
|
315
|
+
*/
|
316
|
+
onOverflowTagChange: PropTypes.func,
|
309
317
|
/**
|
310
318
|
* overflowAlign from the standard tooltip. Default center.
|
311
319
|
*/
|
package/es/components/index.js
CHANGED
@@ -43,7 +43,18 @@ export { EditTearsheetNarrow } from './EditTearsheetNarrow';
|
|
43
43
|
export { EditFullPage } from './EditFullPage';
|
44
44
|
export { EditUpdateCards } from './EditUpdateCards';
|
45
45
|
export { Checklist } from './Checklist';
|
46
|
+
export { Coachmark } from './Coachmark';
|
47
|
+
export { CoachmarkBeacon } from './CoachmarkBeacon';
|
48
|
+
export { CoachmarkButton } from './CoachmarkButton';
|
49
|
+
export { CoachmarkFixed } from './CoachmarkFixed';
|
50
|
+
export { CoachmarkOverlayElement } from './CoachmarkOverlayElement';
|
51
|
+
export { CoachmarkOverlayElements } from './CoachmarkOverlayElements';
|
52
|
+
export { CoachmarkStack } from './CoachmarkStack';
|
46
53
|
export { Guidebanner, GuidebannerElement, GuidebannerElementButton, GuidebannerElementLink } from './Guidebanner';
|
47
54
|
export { InlineTip, InlineTipButton, InlineTipLink } from './InlineTip';
|
48
55
|
export { NonLinearReading } from './NonLinearReading';
|
49
|
-
export {
|
56
|
+
export { InterstitialScreen } from './InterstitialScreen';
|
57
|
+
export { InterstitialScreenView } from './InterstitialScreenView';
|
58
|
+
export { InterstitialScreenViewModule } from './InterstitialScreenViewModule';
|
59
|
+
export { DelimitedList } from './DelimitedList';
|
60
|
+
export { SearchBar } from './SearchBar';
|
@@ -41,7 +41,7 @@ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
41
41
|
}
|
42
42
|
getInitialSize();
|
43
43
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
44
|
-
}, [width, height, ref].concat(_toConsumableArray(deps)));
|
44
|
+
}, [width, height, ref.current].concat(_toConsumableArray(deps)));
|
45
45
|
useLayoutEffect(function () {
|
46
46
|
if (!(ref !== null && ref !== void 0 && ref.current)) {
|
47
47
|
return;
|
@@ -71,7 +71,7 @@ export var useResizeObserver = function useResizeObserver(ref, callback) {
|
|
71
71
|
observer = null;
|
72
72
|
};
|
73
73
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
74
|
-
}, [ref].concat(_toConsumableArray(deps)));
|
74
|
+
}, [ref.current].concat(_toConsumableArray(deps)));
|
75
75
|
return {
|
76
76
|
width: width,
|
77
77
|
height: height
|
@@ -69,7 +69,18 @@ var defaults = {
|
|
69
69
|
EditTearsheetNarrow: false,
|
70
70
|
EditFullPage: false,
|
71
71
|
EditUpdateCards: false,
|
72
|
+
/* new component flags here - comment used by generate CLI */
|
73
|
+
|
74
|
+
// Novice to pro components not yet reviewed and released:
|
75
|
+
Coachmark: false,
|
76
|
+
CoachmarkBeacon: false,
|
77
|
+
CoachmarkButton: false,
|
78
|
+
CoachmarkFixed: false,
|
79
|
+
CoachmarkOverlayElement: false,
|
80
|
+
CoachmarkOverlayElements: false,
|
81
|
+
CoachmarkStack: false,
|
72
82
|
DelimitedList: false,
|
83
|
+
SearchBar: false,
|
73
84
|
/* new component flags here - comment used by generate CLI */
|
74
85
|
|
75
86
|
// Novice to pro components not yet reviewed and released:
|
@@ -81,6 +92,9 @@ var defaults = {
|
|
81
92
|
InlineTip: false,
|
82
93
|
InlineTipButton: false,
|
83
94
|
InlineTipLink: false,
|
95
|
+
InterstitialScreen: false,
|
96
|
+
InterstitialScreenView: false,
|
97
|
+
InterstitialScreenViewModule: false,
|
84
98
|
NonLinearReading: false
|
85
99
|
},
|
86
100
|
// feature level flags
|
@@ -1,12 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
-
var
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
8
|
exports.Card = void 0;
|
9
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
10
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
11
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
12
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
@@ -26,7 +25,7 @@ var _excluded = ["actionIcons", "actionsPlacement", "children", "className", "cl
|
|
26
25
|
// LICENSE file in the root directory of this source tree.
|
27
26
|
//
|
28
27
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
29
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
30
29
|
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
30
|
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
31
|
var componentName = 'Card';
|
@@ -169,7 +168,7 @@ var Card = exports.Card = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, re
|
|
169
168
|
var clickable = hasClickEvent && !productive || hasClickEvent && productive && clickZone === 'one';
|
170
169
|
var cardProps = _objectSpread(_objectSpread({}, rest), {}, {
|
171
170
|
ref: ref,
|
172
|
-
className: (0, _classnames.default)(blockClass, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"),
|
171
|
+
className: (0, _classnames.default)(blockClass, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)({}, "".concat(blockClass, "__productive"), productive), "".concat(blockClass, "__clickable"), clickable), "".concat(blockClass, "__media-left"), mediaPosition === 'left'), "".concat(blockClass, "--has-slug"), !!slug), className)
|
173
172
|
}, clickable && clickableProps);
|
174
173
|
return cardProps;
|
175
174
|
};
|
@@ -70,9 +70,9 @@ var CardHeader = exports.CardHeader = function CardHeader(_ref) {
|
|
70
70
|
}));
|
71
71
|
var normalizedSlug;
|
72
72
|
if (slug) {
|
73
|
-
if (inClickableCard) {
|
73
|
+
if (inClickableCard || typeof slug === 'boolean') {
|
74
74
|
normalizedSlug = hollowSlugIcon;
|
75
|
-
} else
|
75
|
+
} else {
|
76
76
|
normalizedSlug = /*#__PURE__*/_react.default.cloneElement(slug, {
|
77
77
|
size: label && title || title && titleSize === 'large' ? 'sm' : 'xs'
|
78
78
|
});
|
@@ -203,9 +203,11 @@ var Carousel = exports.Carousel = /*#__PURE__*/_react.default.forwardRef(functio
|
|
203
203
|
(0, _react.useEffect)(function () {
|
204
204
|
function handleWheel(event) {
|
205
205
|
// update the scroll position
|
206
|
-
event.
|
207
|
-
|
208
|
-
|
206
|
+
if (event.shiftKey) {
|
207
|
+
event.stopPropagation();
|
208
|
+
event.preventDefault();
|
209
|
+
event.cancelBubble = false;
|
210
|
+
}
|
209
211
|
}
|
210
212
|
var scrollDiv = scrollRef.current;
|
211
213
|
if (scrollDiv) {
|