@carbon/ibm-products 1.64.0 → 1.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +232 -10
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +2 -2
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +8 -10
- 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 +232 -10
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +2 -2
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +232 -10
- package/css/index.css.map +1 -1
- package/css/index.min.css +2 -2
- package/css/index.min.css.map +1 -1
- package/es/components/Carousel/Carousel.js +5 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +6 -2
- package/es/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +60 -41
- package/es/components/InterstitialScreen/InterstitialScreen.js +419 -0
- package/es/components/InterstitialScreen/assets/index.js +5 -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/index.js +3 -0
- package/es/global/js/package-settings.js +4 -0
- package/lib/components/Carousel/Carousel.js +5 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterPanel.js +5 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/motion/variants.js +60 -41
- package/lib/components/InterstitialScreen/InterstitialScreen.js +420 -0
- package/lib/components/InterstitialScreen/assets/index.js +14 -0
- package/lib/components/InterstitialScreen/index.js +12 -0
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +72 -0
- package/lib/components/InterstitialScreenView/index.js +12 -0
- package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +80 -0
- package/lib/components/InterstitialScreenViewModule/index.js +12 -0
- package/lib/components/index.js +21 -0
- package/lib/global/js/package-settings.js +4 -0
- package/package.json +2 -2
- package/scss/components/InterstitialScreen/_index.scss +8 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +266 -0
- package/scss/components/InterstitialScreen/_storybook-styles.scss +59 -0
- package/scss/components/InterstitialScreenView/_index.scss +8 -0
- package/scss/components/InterstitialScreenView/_interstitial-screen-view.scss +25 -0
- package/scss/components/InterstitialScreenView/_storybook-styles.scss +10 -0
- package/scss/components/InterstitialScreenViewModule/_index.scss +8 -0
- package/scss/components/InterstitialScreenViewModule/_interstitial-screen-view-module.scss +54 -0
- package/scss/components/InterstitialScreenViewModule/_storybook-styles.scss +10 -0
- package/scss/components/SidePanel/_side-panel.scss +4 -2
- package/scss/components/_index.scss +3 -0
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
3
|
/* eslint-disable react/jsx-key */
|
4
4
|
/**
|
5
|
-
* Copyright IBM Corp. 2022,
|
5
|
+
* Copyright IBM Corp. 2022, 2024
|
6
6
|
*
|
7
7
|
* This source code is licensed under the Apache-2.0 license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
@@ -15,7 +15,7 @@ import { rem } from '@carbon/layout';
|
|
15
15
|
import { pkg } from '../../../../../settings';
|
16
16
|
import { BATCH, CLEAR_FILTERS, INSTANT, PANEL } from './constants';
|
17
17
|
import cx from 'classnames';
|
18
|
-
import { motion } from 'framer-motion';
|
18
|
+
import { motion, useReducedMotion } from 'framer-motion';
|
19
19
|
import { panelVariants, innerContainerVariants, actionSetVariants } from './motion/variants';
|
20
20
|
import { Close32 } from '@carbon/icons-react';
|
21
21
|
import { ActionSet } from '../../../../ActionSet';
|
@@ -102,6 +102,7 @@ var FilterPanel = function FilterPanel(_ref) {
|
|
102
102
|
_useShouldDisableButt2 = _slicedToArray(_useShouldDisableButt, 2),
|
103
103
|
shouldDisableButtons = _useShouldDisableButt2[0],
|
104
104
|
setShouldDisableButtons = _useShouldDisableButt2[1];
|
105
|
+
var shouldReduceMotion = useReducedMotion();
|
105
106
|
|
106
107
|
/** Memos */
|
107
108
|
var showActionSet = useMemo(function () {
|
@@ -146,6 +147,7 @@ var FilterPanel = function FilterPanel(_ref) {
|
|
146
147
|
}],
|
147
148
|
className: "".concat(componentClass, "__action-set"),
|
148
149
|
ref: actionSetRef,
|
150
|
+
custom: shouldReduceMotion,
|
149
151
|
variants: actionSetVariants
|
150
152
|
});
|
151
153
|
};
|
@@ -183,8 +185,10 @@ var FilterPanel = function FilterPanel(_ref) {
|
|
183
185
|
className: cx(componentClass, "".concat(componentClass, "__container"), (_cx = {}, _defineProperty(_cx, "".concat(componentClass, "--open"), panelOpen), _defineProperty(_cx, "".concat(componentClass, "--batch"), showActionSet), _defineProperty(_cx, "".concat(componentClass, "--instant"), !showActionSet), _cx)),
|
184
186
|
initial: false,
|
185
187
|
animate: panelOpen ? 'visible' : 'hidden',
|
188
|
+
custom: shouldReduceMotion,
|
186
189
|
variants: panelVariants
|
187
190
|
}, /*#__PURE__*/React.createElement(motion.div, {
|
191
|
+
custom: shouldReduceMotion,
|
188
192
|
variants: innerContainerVariants
|
189
193
|
}, /*#__PURE__*/React.createElement("header", {
|
190
194
|
ref: filterHeadingRef,
|
@@ -1,55 +1,74 @@
|
|
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
|
+
|
1
8
|
import { DURATIONS, EASINGS } from '../../../../../../global/js/utils/motionConstants';
|
2
9
|
import { ACTION_SET_HEIGHT, PANEL_WIDTH } from '../constants';
|
3
10
|
export var panelVariants = {
|
4
|
-
hidden: {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
11
|
+
hidden: function hidden(shouldReduceMotion) {
|
12
|
+
return {
|
13
|
+
width: 0,
|
14
|
+
overflow: 'hidden',
|
15
|
+
transition: {
|
16
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
|
17
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.exit,
|
18
|
+
when: 'afterChildren'
|
19
|
+
}
|
20
|
+
};
|
12
21
|
},
|
13
|
-
visible: {
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
visible: function visible(shouldReduceMotion) {
|
23
|
+
return {
|
24
|
+
width: PANEL_WIDTH,
|
25
|
+
overflow: 'visible',
|
26
|
+
transition: {
|
27
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.moderate02,
|
28
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance,
|
29
|
+
when: 'beforeChildren'
|
30
|
+
}
|
31
|
+
};
|
21
32
|
}
|
22
33
|
};
|
23
34
|
export var innerContainerVariants = {
|
24
|
-
hidden: {
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
35
|
+
hidden: function hidden(shouldReduceMotion) {
|
36
|
+
return {
|
37
|
+
opacity: 0,
|
38
|
+
transition: {
|
39
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.fast01,
|
40
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.exit
|
41
|
+
}
|
42
|
+
};
|
30
43
|
},
|
31
|
-
visible: {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
44
|
+
visible: function visible(shouldReduceMotion) {
|
45
|
+
return {
|
46
|
+
opacity: 1,
|
47
|
+
transition: {
|
48
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
|
49
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance,
|
50
|
+
when: 'beforeChildren'
|
51
|
+
}
|
52
|
+
};
|
38
53
|
}
|
39
54
|
};
|
40
55
|
export var actionSetVariants = {
|
41
|
-
hidden: {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
56
|
+
hidden: function hidden(shouldReduceMotion) {
|
57
|
+
return {
|
58
|
+
y: ACTION_SET_HEIGHT,
|
59
|
+
transition: {
|
60
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.fast01,
|
61
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.exit
|
62
|
+
}
|
63
|
+
};
|
47
64
|
},
|
48
|
-
visible: {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
65
|
+
visible: function visible(shouldReduceMotion) {
|
66
|
+
return {
|
67
|
+
y: 0,
|
68
|
+
transition: {
|
69
|
+
duration: shouldReduceMotion ? 0 : DURATIONS.fast02,
|
70
|
+
ease: shouldReduceMotion ? 0 : EASINGS.productive.entrance
|
71
|
+
}
|
72
|
+
};
|
54
73
|
}
|
55
74
|
};
|
@@ -0,0 +1,419 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["children", "className", "closeIconDescription", "domainName", "hideProgressIndicator", "interstitialAriaLabel", "isFullScreen", "isOpen", "media", "nextButtonLabel", "onClose", "previousButtonLabel", "productName", "headerClassName", "headerTitle", "startButtonLabel", "skipButtonLabel"];
|
6
|
+
/**
|
7
|
+
* Copyright IBM Corp. 2023, 2023
|
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, { Children, useCallback, useEffect, useRef, useState } from 'react';
|
15
|
+
import { clamp } from 'lodash';
|
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
|
+
import { ArrowRight16 } from '@carbon/icons-react'; //Close16
|
22
|
+
import { Button, Column, ComposedModal, ModalBody, ModalHeader, ModalFooter, Grid, ProgressIndicator, ProgressStep, Row } from 'carbon-components-react';
|
23
|
+
import { Carousel } from '../Carousel';
|
24
|
+
import { SteppedAnimatedMedia } from '../SteppedAnimatedMedia';
|
25
|
+
|
26
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
27
|
+
var blockClass = "".concat(pkg.prefix, "--interstitial-screen");
|
28
|
+
var headerBlockClass = "".concat(blockClass, "--internal-header");
|
29
|
+
var bodyBlockClass = "".concat(blockClass, "--internal-body");
|
30
|
+
var componentName = 'InterstitialScreen';
|
31
|
+
|
32
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
33
|
+
|
34
|
+
// Default values can be included here and then assigned to the prop params,
|
35
|
+
// e.g. prop = defaults.prop,
|
36
|
+
// This gathers default values together neatly and ensures non-primitive
|
37
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
38
|
+
// Note that default values are not required for props that are 'required',
|
39
|
+
// nor for props where the component can apply undefined values reasonably.
|
40
|
+
// Default values should be provided when the component needs to make a choice
|
41
|
+
// or assumption when a prop is not supplied.
|
42
|
+
|
43
|
+
// Default values for props
|
44
|
+
var defaults = {
|
45
|
+
closeIconDescription: 'Close',
|
46
|
+
domainName: '',
|
47
|
+
hideProgressIndicator: false,
|
48
|
+
interstitialAriaLabel: 'Interstitial screen',
|
49
|
+
isFullScreen: false,
|
50
|
+
isOpen: false,
|
51
|
+
nextButtonLabel: 'Next',
|
52
|
+
onClose: function onClose() {},
|
53
|
+
previousButtonLabel: 'Back',
|
54
|
+
productName: '',
|
55
|
+
skipButtonLabel: '',
|
56
|
+
startButtonLabel: 'Get started'
|
57
|
+
};
|
58
|
+
|
59
|
+
/**
|
60
|
+
* TODO: A description of the component.
|
61
|
+
*/
|
62
|
+
export var InterstitialScreen = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
63
|
+
var _media$breakpoints, _media$breakpoints2;
|
64
|
+
var children = _ref.children,
|
65
|
+
className = _ref.className,
|
66
|
+
_ref$closeIconDescrip = _ref.closeIconDescription,
|
67
|
+
closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
|
68
|
+
_ref$domainName = _ref.domainName,
|
69
|
+
domainName = _ref$domainName === void 0 ? defaults.domainName : _ref$domainName,
|
70
|
+
_ref$hideProgressIndi = _ref.hideProgressIndicator,
|
71
|
+
hideProgressIndicator = _ref$hideProgressIndi === void 0 ? defaults.hideProgressIndicator : _ref$hideProgressIndi,
|
72
|
+
_ref$interstitialAria = _ref.interstitialAriaLabel,
|
73
|
+
interstitialAriaLabel = _ref$interstitialAria === void 0 ? defaults.interstitialAriaLabel : _ref$interstitialAria,
|
74
|
+
_ref$isFullScreen = _ref.isFullScreen,
|
75
|
+
isFullScreen = _ref$isFullScreen === void 0 ? defaults.isFullScreen : _ref$isFullScreen,
|
76
|
+
_ref$isOpen = _ref.isOpen,
|
77
|
+
isOpen = _ref$isOpen === void 0 ? defaults.isOpen : _ref$isOpen,
|
78
|
+
media = _ref.media,
|
79
|
+
_ref$nextButtonLabel = _ref.nextButtonLabel,
|
80
|
+
nextButtonLabel = _ref$nextButtonLabel === void 0 ? defaults.nextButtonLabel : _ref$nextButtonLabel,
|
81
|
+
_ref$onClose = _ref.onClose,
|
82
|
+
onClose = _ref$onClose === void 0 ? defaults.onClose : _ref$onClose,
|
83
|
+
_ref$previousButtonLa = _ref.previousButtonLabel,
|
84
|
+
previousButtonLabel = _ref$previousButtonLa === void 0 ? defaults.previousButtonLabel : _ref$previousButtonLa,
|
85
|
+
_ref$productName = _ref.productName,
|
86
|
+
productName = _ref$productName === void 0 ? defaults.productName : _ref$productName,
|
87
|
+
headerClassName = _ref.headerClassName,
|
88
|
+
headerTitle = _ref.headerTitle,
|
89
|
+
_ref$startButtonLabel = _ref.startButtonLabel,
|
90
|
+
startButtonLabel = _ref$startButtonLabel === void 0 ? defaults.startButtonLabel : _ref$startButtonLabel,
|
91
|
+
_ref$skipButtonLabel = _ref.skipButtonLabel,
|
92
|
+
skipButtonLabel = _ref$skipButtonLabel === void 0 ? defaults.skipButtonLabel : _ref$skipButtonLabel,
|
93
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
94
|
+
var backupRef = useRef();
|
95
|
+
var _forwardedRef = ref || backupRef;
|
96
|
+
var scrollRef = useRef();
|
97
|
+
var startButtonRef = useRef();
|
98
|
+
var nextButtonRef = useRef();
|
99
|
+
var _useState = useState(null),
|
100
|
+
_useState2 = _slicedToArray(_useState, 2),
|
101
|
+
isVisibleClass = _useState2[0],
|
102
|
+
setIsVisibleClass = _useState2[1];
|
103
|
+
var _useState3 = useState(0),
|
104
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
105
|
+
progStep = _useState4[0],
|
106
|
+
setProgStep = _useState4[1];
|
107
|
+
var childArray = Children.toArray(children);
|
108
|
+
var isMultiStep = childArray.length > 1;
|
109
|
+
var mediaIsDefined = (media === null || media === void 0 ? void 0 : media.render) || (media === null || media === void 0 ? void 0 : media.filePaths);
|
110
|
+
var bodyScrollRef = useRef();
|
111
|
+
var mediaBreakpoints = {
|
112
|
+
xlg: (media === null || media === void 0 ? void 0 : (_media$breakpoints = media.breakpoints) === null || _media$breakpoints === void 0 ? void 0 : _media$breakpoints.xlg) || 0,
|
113
|
+
lg: (media === null || media === void 0 ? void 0 : (_media$breakpoints2 = media.breakpoints) === null || _media$breakpoints2 === void 0 ? void 0 : _media$breakpoints2.lg) || 0,
|
114
|
+
md: 0,
|
115
|
+
sm: 0
|
116
|
+
};
|
117
|
+
var contentBreakpoints = {
|
118
|
+
xlg: 16 - mediaBreakpoints.xlg,
|
119
|
+
lg: 16 - mediaBreakpoints.lg,
|
120
|
+
md: 8,
|
121
|
+
sm: 4
|
122
|
+
};
|
123
|
+
var variantClass = isFullScreen ? "".concat(blockClass, "--full-screen") : "".concat(blockClass, "--modal");
|
124
|
+
var progStepFloor = 0;
|
125
|
+
var progStepCeil = childArray.length - 1;
|
126
|
+
var handleClose = useCallback(function () {
|
127
|
+
setProgStep(0);
|
128
|
+
onClose();
|
129
|
+
}, [onClose]);
|
130
|
+
var scrollBodyToTop = function scrollBodyToTop() {
|
131
|
+
bodyScrollRef.current.scroll({
|
132
|
+
top: 0,
|
133
|
+
behavior: 'smooth'
|
134
|
+
});
|
135
|
+
};
|
136
|
+
var handleClickPrev = function handleClickPrev() {
|
137
|
+
var targetStep = clamp(progStep - 1, progStepFloor, progStepCeil);
|
138
|
+
scrollRef.current.scrollPrev();
|
139
|
+
scrollBodyToTop();
|
140
|
+
setProgStep(targetStep);
|
141
|
+
};
|
142
|
+
var handleClickNext = function handleClickNext() {
|
143
|
+
var targetStep = clamp(progStep + 1, progStepFloor, progStepCeil);
|
144
|
+
scrollRef.current.scrollNext();
|
145
|
+
scrollBodyToTop();
|
146
|
+
setProgStep(targetStep);
|
147
|
+
};
|
148
|
+
useEffect(function () {
|
149
|
+
var _startButtonRef$curre;
|
150
|
+
(_startButtonRef$curre = startButtonRef.current) === null || _startButtonRef$curre === void 0 ? void 0 : _startButtonRef$curre.focus();
|
151
|
+
}, [isOpen, progStep]);
|
152
|
+
useEffect(function () {
|
153
|
+
var _nextButtonRef$curren;
|
154
|
+
//for modal only, "is-visible" triggers animation
|
155
|
+
setIsVisibleClass(!isFullScreen && isOpen ? 'is-visible' : null);
|
156
|
+
nextButtonRef === null || nextButtonRef === void 0 ? void 0 : (_nextButtonRef$curren = nextButtonRef.current) === null || _nextButtonRef$curren === void 0 ? void 0 : _nextButtonRef$curren.focus();
|
157
|
+
}, [isFullScreen, isOpen]);
|
158
|
+
|
159
|
+
// hitting escape key also closes this component
|
160
|
+
useEffect(function () {
|
161
|
+
var close = function close(e) {
|
162
|
+
var key = e.key;
|
163
|
+
if (key === 'Escape') {
|
164
|
+
handleClose();
|
165
|
+
}
|
166
|
+
};
|
167
|
+
window.addEventListener('keydown', close);
|
168
|
+
return function () {
|
169
|
+
return window.removeEventListener('keydown', close);
|
170
|
+
};
|
171
|
+
}, [handleClose]);
|
172
|
+
if (!isOpen) {
|
173
|
+
return null;
|
174
|
+
}
|
175
|
+
var domainProductDelimiter = domainName !== '' && productName !== '' ? ' | ' : '';
|
176
|
+
var renderModal = function renderModal(childElements) {
|
177
|
+
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
178
|
+
className: cx(
|
179
|
+
// blockClass, // Apply the block class to the main HTML element
|
180
|
+
className // Apply any supplied class names to the main HTML element.
|
181
|
+
// variantClass,
|
182
|
+
// isVisibleClass
|
183
|
+
),
|
184
|
+
|
185
|
+
size: "lg",
|
186
|
+
onClose: onClose,
|
187
|
+
open: isOpen,
|
188
|
+
forwardedRef: _forwardedRef,
|
189
|
+
"aria-label": interstitialAriaLabel
|
190
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement(ModalHeader, {
|
191
|
+
className: cx(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName),
|
192
|
+
iconDescription: closeIconDescription,
|
193
|
+
buttonOnClick: handleClose
|
194
|
+
}, headerTitle && /*#__PURE__*/React.createElement("h2", null, headerTitle), !hideProgressIndicator && /*#__PURE__*/React.createElement("div", {
|
195
|
+
className: "".concat(blockClass, "--progress")
|
196
|
+
}, /*#__PURE__*/React.createElement(ProgressIndicator, {
|
197
|
+
vertical: false,
|
198
|
+
currentIndex: progStep
|
199
|
+
}, childArray.map(function (child, idx) {
|
200
|
+
return /*#__PURE__*/React.createElement(ProgressStep, {
|
201
|
+
key: idx,
|
202
|
+
label: child.props.stepTitle
|
203
|
+
});
|
204
|
+
})))), /*#__PURE__*/React.createElement(ModalBody, {
|
205
|
+
className: bodyBlockClass
|
206
|
+
}, childElements), /*#__PURE__*/React.createElement(ModalFooter, null, renderFooter()));
|
207
|
+
};
|
208
|
+
var renderFullScreen = function renderFullScreen(childElements) {
|
209
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
210
|
+
className: cx(blockClass,
|
211
|
+
// Apply the block class to the main HTML element
|
212
|
+
className,
|
213
|
+
// Apply any supplied class names to the main HTML element.
|
214
|
+
variantClass, isVisibleClass),
|
215
|
+
"aria-label": interstitialAriaLabel,
|
216
|
+
ref: ref
|
217
|
+
}, getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("div", {
|
218
|
+
className: cx([_defineProperty({}, "".concat(blockClass, "--container"), isFullScreen)])
|
219
|
+
}, /*#__PURE__*/React.createElement("div", {
|
220
|
+
className: "".concat(blockClass, "--header")
|
221
|
+
}, domainName, domainProductDelimiter, /*#__PURE__*/React.createElement("strong", null, productName)), /*#__PURE__*/React.createElement("header", {
|
222
|
+
className: cx(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName)
|
223
|
+
}, headerTitle && /*#__PURE__*/React.createElement("h2", null, headerTitle), !hideProgressIndicator && /*#__PURE__*/React.createElement("div", {
|
224
|
+
className: "".concat(blockClass, "--progress")
|
225
|
+
}, /*#__PURE__*/React.createElement(ProgressIndicator, {
|
226
|
+
vertical: false,
|
227
|
+
currentIndex: progStep
|
228
|
+
}, childArray.map(function (child, idx) {
|
229
|
+
return /*#__PURE__*/React.createElement(ProgressStep, {
|
230
|
+
key: idx,
|
231
|
+
label: child.props.stepTitle
|
232
|
+
});
|
233
|
+
})))), childElements, renderFooter()));
|
234
|
+
};
|
235
|
+
var renderBody = function renderBody() {
|
236
|
+
return /*#__PURE__*/React.createElement("div", {
|
237
|
+
className: cx("".concat(blockClass, "--body")),
|
238
|
+
ref: bodyScrollRef
|
239
|
+
}, mediaIsDefined ? /*#__PURE__*/React.createElement(Grid, {
|
240
|
+
fullWidth: true,
|
241
|
+
className: cx("".concat(blockClass, "--body-grid"))
|
242
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
243
|
+
className: cx("".concat(blockClass, "--body-row"))
|
244
|
+
}, /*#__PURE__*/React.createElement(Column, {
|
245
|
+
xlg: contentBreakpoints.xlg,
|
246
|
+
lg: contentBreakpoints.lg,
|
247
|
+
md: contentBreakpoints.md,
|
248
|
+
sm: contentBreakpoints.sm
|
249
|
+
}, /*#__PURE__*/React.createElement("div", {
|
250
|
+
className: cx("".concat(blockClass, "--content"))
|
251
|
+
}, isMultiStep ? /*#__PURE__*/React.createElement("div", {
|
252
|
+
className: "".concat(blockClass, "__carousel")
|
253
|
+
}, /*#__PURE__*/React.createElement(Carousel, {
|
254
|
+
disableArrowScroll: true,
|
255
|
+
ref: scrollRef
|
256
|
+
}, children)) : childArray[0])), mediaIsDefined && /*#__PURE__*/React.createElement(Column, {
|
257
|
+
xlg: mediaBreakpoints.xlg,
|
258
|
+
lg: mediaBreakpoints.lg,
|
259
|
+
md: mediaBreakpoints.md,
|
260
|
+
sm: mediaBreakpoints.sm,
|
261
|
+
className: cx("".concat(blockClass, "--media-container"))
|
262
|
+
}, /*#__PURE__*/React.createElement("div", {
|
263
|
+
className: "".concat(blockClass, "--media")
|
264
|
+
}, media.render ? media.render() : /*#__PURE__*/React.createElement(SteppedAnimatedMedia, {
|
265
|
+
className: "".concat(blockClass, "--stepped-animated-media"),
|
266
|
+
filePaths: media.filePaths,
|
267
|
+
playStep: progStep
|
268
|
+
}))))) : /*#__PURE__*/React.createElement("div", {
|
269
|
+
className: cx("".concat(blockClass, "--content"))
|
270
|
+
}, isMultiStep ? /*#__PURE__*/React.createElement("div", {
|
271
|
+
className: "".concat(blockClass, "__carousel")
|
272
|
+
}, /*#__PURE__*/React.createElement(Carousel, {
|
273
|
+
disableArrowScroll: true,
|
274
|
+
ref: scrollRef
|
275
|
+
}, children)) : /*#__PURE__*/React.createElement("div", null, childArray[0])));
|
276
|
+
};
|
277
|
+
var renderFooter = function renderFooter() {
|
278
|
+
return /*#__PURE__*/React.createElement("div", {
|
279
|
+
className: "".concat(blockClass, "--footer")
|
280
|
+
}, isMultiStep && skipButtonLabel !== '' && /*#__PURE__*/React.createElement(Button, {
|
281
|
+
className: "".concat(blockClass, "--skip-btn"),
|
282
|
+
kind: "ghost",
|
283
|
+
size: "lg",
|
284
|
+
title: skipButtonLabel,
|
285
|
+
onClick: handleClose
|
286
|
+
}, skipButtonLabel), /*#__PURE__*/React.createElement("div", {
|
287
|
+
className: "".concat(blockClass, "--footer-controls")
|
288
|
+
}, isMultiStep && progStep > 0 && /*#__PURE__*/React.createElement(Button, {
|
289
|
+
className: "".concat(blockClass, "--prev-btn"),
|
290
|
+
kind: "secondary",
|
291
|
+
size: "lg",
|
292
|
+
title: previousButtonLabel,
|
293
|
+
onClick: handleClickPrev
|
294
|
+
}, previousButtonLabel), isMultiStep && progStep < progStepCeil && /*#__PURE__*/React.createElement(Button, {
|
295
|
+
className: "".concat(blockClass, "--next-btn"),
|
296
|
+
renderIcon: ArrowRight16,
|
297
|
+
ref: nextButtonRef,
|
298
|
+
size: "lg",
|
299
|
+
title: nextButtonLabel,
|
300
|
+
onClick: handleClickNext
|
301
|
+
}, nextButtonLabel), isMultiStep && progStep === progStepCeil && /*#__PURE__*/React.createElement(Button, {
|
302
|
+
className: "".concat(blockClass, "--start-btn"),
|
303
|
+
ref: startButtonRef,
|
304
|
+
renderIcon: ArrowRight16,
|
305
|
+
size: "lg",
|
306
|
+
title: startButtonLabel,
|
307
|
+
onClick: handleClose
|
308
|
+
}, startButtonLabel), !isMultiStep && /*#__PURE__*/React.createElement(Button, {
|
309
|
+
className: "".concat(blockClass, "--start-btn"),
|
310
|
+
ref: startButtonRef,
|
311
|
+
size: "lg",
|
312
|
+
title: startButtonLabel,
|
313
|
+
onClick: handleClose
|
314
|
+
}, startButtonLabel)));
|
315
|
+
};
|
316
|
+
return isFullScreen ? renderFullScreen(renderBody()) : renderModal(renderBody());
|
317
|
+
});
|
318
|
+
|
319
|
+
// Return a placeholder if not released and not enabled by feature flag
|
320
|
+
InterstitialScreen = pkg.checkComponentEnabled(InterstitialScreen, componentName);
|
321
|
+
|
322
|
+
// The display name of the component, used by React. Note that displayName
|
323
|
+
// is used in preference to relying on function.name.
|
324
|
+
InterstitialScreen.displayName = componentName;
|
325
|
+
|
326
|
+
// The types and DocGen commentary for the component props,
|
327
|
+
// in alphabetical order (for consistency).
|
328
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
329
|
+
InterstitialScreen.propTypes = {
|
330
|
+
/**
|
331
|
+
* Provide the contents of the InterstitialScreen.
|
332
|
+
*/
|
333
|
+
children: PropTypes.node.isRequired,
|
334
|
+
/**
|
335
|
+
* Provide an optional class to be applied to the containing node.
|
336
|
+
*/
|
337
|
+
className: PropTypes.string,
|
338
|
+
/**
|
339
|
+
* Tooltip text and aria label for the Close button icon.
|
340
|
+
*/
|
341
|
+
closeIconDescription: PropTypes.string,
|
342
|
+
/**
|
343
|
+
* The domain this app belongs to, e.g. "IBM Cloud Pak".
|
344
|
+
*/
|
345
|
+
domainName: PropTypes.string,
|
346
|
+
/**
|
347
|
+
* Provide an optional class to be applied to the <header> element >.
|
348
|
+
*/
|
349
|
+
headerClassName: PropTypes.string,
|
350
|
+
/**
|
351
|
+
* Provide an optional class to be applied to the <header> element >.
|
352
|
+
*/
|
353
|
+
headerTitle: PropTypes.string,
|
354
|
+
/**
|
355
|
+
* Optional parameter to hide the progress indicator when multiple steps are used.
|
356
|
+
*/
|
357
|
+
hideProgressIndicator: PropTypes.bool,
|
358
|
+
/**
|
359
|
+
* The aria label applied to the Interstitial Screen component
|
360
|
+
*/
|
361
|
+
interstitialAriaLabel: PropTypes.string,
|
362
|
+
/**
|
363
|
+
* Specifies whether the component is shown as a full-screen
|
364
|
+
* experience, else it is shown as a modal by default.
|
365
|
+
*/
|
366
|
+
isFullScreen: PropTypes.bool,
|
367
|
+
/**
|
368
|
+
* Specifies whether the component is currently open.
|
369
|
+
*/
|
370
|
+
isOpen: PropTypes.bool,
|
371
|
+
/**
|
372
|
+
* The object describing an image in one of two shapes.
|
373
|
+
*
|
374
|
+
* If a single media element is required, use `{render}`.
|
375
|
+
*
|
376
|
+
* If a stepped animation is required, use `{filePaths}`.
|
377
|
+
*
|
378
|
+
* Breakpoints are used to set the media content column size as well as the remainder for the main content areas column size.
|
379
|
+
* Medium and small breakpoints will be set to 0 internally to focus on the main content area.
|
380
|
+
* @see {@link MEDIA_PROP_TYPE}.
|
381
|
+
*/
|
382
|
+
media: PropTypes.oneOfType([PropTypes.shape({
|
383
|
+
render: PropTypes.func,
|
384
|
+
breakpoints: PropTypes.shape({
|
385
|
+
xlg: PropTypes.number,
|
386
|
+
lg: PropTypes.number
|
387
|
+
})
|
388
|
+
}), PropTypes.shape({
|
389
|
+
filePaths: PropTypes.arrayOf(PropTypes.string),
|
390
|
+
breakpoints: PropTypes.shape({
|
391
|
+
xlg: PropTypes.number,
|
392
|
+
lg: PropTypes.number
|
393
|
+
})
|
394
|
+
})]),
|
395
|
+
/**
|
396
|
+
* The label for the Next button.
|
397
|
+
*/
|
398
|
+
nextButtonLabel: PropTypes.string,
|
399
|
+
/**
|
400
|
+
* Function to call when the close button is clicked.
|
401
|
+
*/
|
402
|
+
onClose: PropTypes.func,
|
403
|
+
/**
|
404
|
+
* The label for the Previous button.
|
405
|
+
*/
|
406
|
+
previousButtonLabel: PropTypes.string,
|
407
|
+
/**
|
408
|
+
* The name of this app, e.g. "QRadar".
|
409
|
+
*/
|
410
|
+
productName: PropTypes.string,
|
411
|
+
/**
|
412
|
+
* The label for the skip button.
|
413
|
+
*/
|
414
|
+
skipButtonLabel: PropTypes.string,
|
415
|
+
/**
|
416
|
+
* The label for the start button.
|
417
|
+
*/
|
418
|
+
startButtonLabel: PropTypes.string
|
419
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
var HowACaseIsCreated1 = new URL('./illustrations/how-a-case-is-created-1', import.meta.url).pathname;
|
2
|
+
var HowACaseIsCreated2 = new URL('./illustrations/how-a-case-is-created-2', import.meta.url).pathname;
|
3
|
+
var HowACaseIsCreated3 = new URL('./illustrations/how-a-case-is-created-3', import.meta.url).pathname;
|
4
|
+
var InterstitialExampleImg = new URL('./illustrations/interstitial-ph.png', import.meta.url).pathname;
|
5
|
+
export { HowACaseIsCreated1, HowACaseIsCreated2, HowACaseIsCreated3, InterstitialExampleImg };
|
@@ -0,0 +1,75 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["children", "className", "stepTitle"];
|
4
|
+
/**
|
5
|
+
* Copyright IBM Corp. 2023, 2023
|
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");
|
25
|
+
var componentName = 'InterstitialScreenView';
|
26
|
+
|
27
|
+
/**
|
28
|
+
* A Novice to Pro component intended to be used as the child elements of the InterstitialScreen component.
|
29
|
+
*/
|
30
|
+
export var InterstitialScreenView = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
31
|
+
var children = _ref.children,
|
32
|
+
className = _ref.className,
|
33
|
+
stepTitle = _ref.stepTitle,
|
34
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
35
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
36
|
+
role: "complementary",
|
37
|
+
"aria-label": stepTitle
|
38
|
+
}, rest, {
|
39
|
+
className: cx(blockClass,
|
40
|
+
// Apply the block class to the main HTML element
|
41
|
+
className,
|
42
|
+
// Apply any supplied class names to the main HTML element.
|
43
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
44
|
+
{
|
45
|
+
// switched classes dependant on props or state
|
46
|
+
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
47
|
+
}),
|
48
|
+
ref: ref
|
49
|
+
}, getDevtoolsProps(componentName)), children);
|
50
|
+
});
|
51
|
+
|
52
|
+
// Return a placeholder if not released and not enabled by feature flag
|
53
|
+
InterstitialScreenView = pkg.checkComponentEnabled(InterstitialScreenView, componentName);
|
54
|
+
|
55
|
+
// The display name of the component, used by React. Note that displayName
|
56
|
+
// is used in preference to relying on function.name.
|
57
|
+
InterstitialScreenView.displayName = componentName;
|
58
|
+
|
59
|
+
// The types and DocGen commentary for the component props,
|
60
|
+
// in alphabetical order (for consistency).
|
61
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
62
|
+
InterstitialScreenView.propTypes = {
|
63
|
+
/**
|
64
|
+
* Provide the contents of the InterstitialScreenView.
|
65
|
+
*/
|
66
|
+
children: PropTypes.node,
|
67
|
+
/**
|
68
|
+
* Optional class name for this component.
|
69
|
+
*/
|
70
|
+
className: PropTypes.string,
|
71
|
+
/**
|
72
|
+
* The label to pass to the ProgressStep component.
|
73
|
+
*/
|
74
|
+
stepTitle: PropTypes.string.isRequired
|
75
|
+
};
|