@carbon/ibm-products 1.64.0 → 1.65.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 +224 -0
- 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.css +224 -0
- 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 +224 -0
- 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/Carousel/Carousel.js +5 -3
- 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/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/_index.scss +3 -0
@@ -0,0 +1,420 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
6
|
+
value: true
|
7
|
+
});
|
8
|
+
exports.InterstitialScreen = void 0;
|
9
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
13
|
+
var _react = _interopRequireWildcard(require("react"));
|
14
|
+
var _lodash = require("lodash");
|
15
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
16
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
17
|
+
var _devtools = require("../../global/js/utils/devtools");
|
18
|
+
var _settings = require("../../settings");
|
19
|
+
var _iconsReact = require("@carbon/icons-react");
|
20
|
+
var _carbonComponentsReact = require("carbon-components-react");
|
21
|
+
var _Carousel = require("../Carousel");
|
22
|
+
var _SteppedAnimatedMedia = require("../SteppedAnimatedMedia");
|
23
|
+
var _excluded = ["children", "className", "closeIconDescription", "domainName", "hideProgressIndicator", "interstitialAriaLabel", "isFullScreen", "isOpen", "media", "nextButtonLabel", "onClose", "previousButtonLabel", "productName", "headerClassName", "headerTitle", "startButtonLabel", "skipButtonLabel"];
|
24
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
25
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
26
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
27
|
+
var blockClass = "".concat(_settings.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
|
+
var InterstitialScreen = /*#__PURE__*/_react.default.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 = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
94
|
+
var backupRef = (0, _react.useRef)();
|
95
|
+
var _forwardedRef = ref || backupRef;
|
96
|
+
var scrollRef = (0, _react.useRef)();
|
97
|
+
var startButtonRef = (0, _react.useRef)();
|
98
|
+
var nextButtonRef = (0, _react.useRef)();
|
99
|
+
var _useState = (0, _react.useState)(null),
|
100
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
101
|
+
isVisibleClass = _useState2[0],
|
102
|
+
setIsVisibleClass = _useState2[1];
|
103
|
+
var _useState3 = (0, _react.useState)(0),
|
104
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
105
|
+
progStep = _useState4[0],
|
106
|
+
setProgStep = _useState4[1];
|
107
|
+
var childArray = _react.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 = (0, _react.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 = (0, _react.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 = (0, _lodash.clamp)(progStep - 1, progStepFloor, progStepCeil);
|
138
|
+
scrollRef.current.scrollPrev();
|
139
|
+
scrollBodyToTop();
|
140
|
+
setProgStep(targetStep);
|
141
|
+
};
|
142
|
+
var handleClickNext = function handleClickNext() {
|
143
|
+
var targetStep = (0, _lodash.clamp)(progStep + 1, progStepFloor, progStepCeil);
|
144
|
+
scrollRef.current.scrollNext();
|
145
|
+
scrollBodyToTop();
|
146
|
+
setProgStep(targetStep);
|
147
|
+
};
|
148
|
+
(0, _react.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
|
+
(0, _react.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
|
+
(0, _react.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.default.createElement(_carbonComponentsReact.ComposedModal, (0, _extends2.default)({}, rest, {
|
178
|
+
className: (0, _classnames.default)(
|
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
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ModalHeader, {
|
191
|
+
className: (0, _classnames.default)(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName),
|
192
|
+
iconDescription: closeIconDescription,
|
193
|
+
buttonOnClick: handleClose
|
194
|
+
}, headerTitle && /*#__PURE__*/_react.default.createElement("h2", null, headerTitle), !hideProgressIndicator && /*#__PURE__*/_react.default.createElement("div", {
|
195
|
+
className: "".concat(blockClass, "--progress")
|
196
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ProgressIndicator, {
|
197
|
+
vertical: false,
|
198
|
+
currentIndex: progStep
|
199
|
+
}, childArray.map(function (child, idx) {
|
200
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ProgressStep, {
|
201
|
+
key: idx,
|
202
|
+
label: child.props.stepTitle
|
203
|
+
});
|
204
|
+
})))), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ModalBody, {
|
205
|
+
className: bodyBlockClass
|
206
|
+
}, childElements), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ModalFooter, null, renderFooter()));
|
207
|
+
};
|
208
|
+
var renderFullScreen = function renderFullScreen(childElements) {
|
209
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
210
|
+
className: (0, _classnames.default)(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
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement("div", {
|
218
|
+
className: (0, _classnames.default)([(0, _defineProperty2.default)({}, "".concat(blockClass, "--container"), isFullScreen)])
|
219
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
220
|
+
className: "".concat(blockClass, "--header")
|
221
|
+
}, domainName, domainProductDelimiter, /*#__PURE__*/_react.default.createElement("strong", null, productName)), /*#__PURE__*/_react.default.createElement("header", {
|
222
|
+
className: (0, _classnames.default)(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName)
|
223
|
+
}, headerTitle && /*#__PURE__*/_react.default.createElement("h2", null, headerTitle), !hideProgressIndicator && /*#__PURE__*/_react.default.createElement("div", {
|
224
|
+
className: "".concat(blockClass, "--progress")
|
225
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ProgressIndicator, {
|
226
|
+
vertical: false,
|
227
|
+
currentIndex: progStep
|
228
|
+
}, childArray.map(function (child, idx) {
|
229
|
+
return /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.ProgressStep, {
|
230
|
+
key: idx,
|
231
|
+
label: child.props.stepTitle
|
232
|
+
});
|
233
|
+
})))), childElements, renderFooter()));
|
234
|
+
};
|
235
|
+
var renderBody = function renderBody() {
|
236
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
237
|
+
className: (0, _classnames.default)("".concat(blockClass, "--body")),
|
238
|
+
ref: bodyScrollRef
|
239
|
+
}, mediaIsDefined ? /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Grid, {
|
240
|
+
fullWidth: true,
|
241
|
+
className: (0, _classnames.default)("".concat(blockClass, "--body-grid"))
|
242
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Row, {
|
243
|
+
className: (0, _classnames.default)("".concat(blockClass, "--body-row"))
|
244
|
+
}, /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Column, {
|
245
|
+
xlg: contentBreakpoints.xlg,
|
246
|
+
lg: contentBreakpoints.lg,
|
247
|
+
md: contentBreakpoints.md,
|
248
|
+
sm: contentBreakpoints.sm
|
249
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
250
|
+
className: (0, _classnames.default)("".concat(blockClass, "--content"))
|
251
|
+
}, isMultiStep ? /*#__PURE__*/_react.default.createElement("div", {
|
252
|
+
className: "".concat(blockClass, "__carousel")
|
253
|
+
}, /*#__PURE__*/_react.default.createElement(_Carousel.Carousel, {
|
254
|
+
disableArrowScroll: true,
|
255
|
+
ref: scrollRef
|
256
|
+
}, children)) : childArray[0])), mediaIsDefined && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Column, {
|
257
|
+
xlg: mediaBreakpoints.xlg,
|
258
|
+
lg: mediaBreakpoints.lg,
|
259
|
+
md: mediaBreakpoints.md,
|
260
|
+
sm: mediaBreakpoints.sm,
|
261
|
+
className: (0, _classnames.default)("".concat(blockClass, "--media-container"))
|
262
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
263
|
+
className: "".concat(blockClass, "--media")
|
264
|
+
}, media.render ? media.render() : /*#__PURE__*/_react.default.createElement(_SteppedAnimatedMedia.SteppedAnimatedMedia, {
|
265
|
+
className: "".concat(blockClass, "--stepped-animated-media"),
|
266
|
+
filePaths: media.filePaths,
|
267
|
+
playStep: progStep
|
268
|
+
}))))) : /*#__PURE__*/_react.default.createElement("div", {
|
269
|
+
className: (0, _classnames.default)("".concat(blockClass, "--content"))
|
270
|
+
}, isMultiStep ? /*#__PURE__*/_react.default.createElement("div", {
|
271
|
+
className: "".concat(blockClass, "__carousel")
|
272
|
+
}, /*#__PURE__*/_react.default.createElement(_Carousel.Carousel, {
|
273
|
+
disableArrowScroll: true,
|
274
|
+
ref: scrollRef
|
275
|
+
}, children)) : /*#__PURE__*/_react.default.createElement("div", null, childArray[0])));
|
276
|
+
};
|
277
|
+
var renderFooter = function renderFooter() {
|
278
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
279
|
+
className: "".concat(blockClass, "--footer")
|
280
|
+
}, isMultiStep && skipButtonLabel !== '' && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
281
|
+
className: "".concat(blockClass, "--skip-btn"),
|
282
|
+
kind: "ghost",
|
283
|
+
size: "lg",
|
284
|
+
title: skipButtonLabel,
|
285
|
+
onClick: handleClose
|
286
|
+
}, skipButtonLabel), /*#__PURE__*/_react.default.createElement("div", {
|
287
|
+
className: "".concat(blockClass, "--footer-controls")
|
288
|
+
}, isMultiStep && progStep > 0 && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.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.default.createElement(_carbonComponentsReact.Button, {
|
295
|
+
className: "".concat(blockClass, "--next-btn"),
|
296
|
+
renderIcon: _iconsReact.ArrowRight16,
|
297
|
+
ref: nextButtonRef,
|
298
|
+
size: "lg",
|
299
|
+
title: nextButtonLabel,
|
300
|
+
onClick: handleClickNext
|
301
|
+
}, nextButtonLabel), isMultiStep && progStep === progStepCeil && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.Button, {
|
302
|
+
className: "".concat(blockClass, "--start-btn"),
|
303
|
+
ref: startButtonRef,
|
304
|
+
renderIcon: _iconsReact.ArrowRight16,
|
305
|
+
size: "lg",
|
306
|
+
title: startButtonLabel,
|
307
|
+
onClick: handleClose
|
308
|
+
}, startButtonLabel), !isMultiStep && /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.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
|
+
exports.InterstitialScreen = InterstitialScreen;
|
321
|
+
exports.InterstitialScreen = InterstitialScreen = _settings.pkg.checkComponentEnabled(InterstitialScreen, componentName);
|
322
|
+
|
323
|
+
// The display name of the component, used by React. Note that displayName
|
324
|
+
// is used in preference to relying on function.name.
|
325
|
+
InterstitialScreen.displayName = componentName;
|
326
|
+
|
327
|
+
// The types and DocGen commentary for the component props,
|
328
|
+
// in alphabetical order (for consistency).
|
329
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
330
|
+
InterstitialScreen.propTypes = {
|
331
|
+
/**
|
332
|
+
* Provide the contents of the InterstitialScreen.
|
333
|
+
*/
|
334
|
+
children: _propTypes.default.node.isRequired,
|
335
|
+
/**
|
336
|
+
* Provide an optional class to be applied to the containing node.
|
337
|
+
*/
|
338
|
+
className: _propTypes.default.string,
|
339
|
+
/**
|
340
|
+
* Tooltip text and aria label for the Close button icon.
|
341
|
+
*/
|
342
|
+
closeIconDescription: _propTypes.default.string,
|
343
|
+
/**
|
344
|
+
* The domain this app belongs to, e.g. "IBM Cloud Pak".
|
345
|
+
*/
|
346
|
+
domainName: _propTypes.default.string,
|
347
|
+
/**
|
348
|
+
* Provide an optional class to be applied to the <header> element >.
|
349
|
+
*/
|
350
|
+
headerClassName: _propTypes.default.string,
|
351
|
+
/**
|
352
|
+
* Provide an optional class to be applied to the <header> element >.
|
353
|
+
*/
|
354
|
+
headerTitle: _propTypes.default.string,
|
355
|
+
/**
|
356
|
+
* Optional parameter to hide the progress indicator when multiple steps are used.
|
357
|
+
*/
|
358
|
+
hideProgressIndicator: _propTypes.default.bool,
|
359
|
+
/**
|
360
|
+
* The aria label applied to the Interstitial Screen component
|
361
|
+
*/
|
362
|
+
interstitialAriaLabel: _propTypes.default.string,
|
363
|
+
/**
|
364
|
+
* Specifies whether the component is shown as a full-screen
|
365
|
+
* experience, else it is shown as a modal by default.
|
366
|
+
*/
|
367
|
+
isFullScreen: _propTypes.default.bool,
|
368
|
+
/**
|
369
|
+
* Specifies whether the component is currently open.
|
370
|
+
*/
|
371
|
+
isOpen: _propTypes.default.bool,
|
372
|
+
/**
|
373
|
+
* The object describing an image in one of two shapes.
|
374
|
+
*
|
375
|
+
* If a single media element is required, use `{render}`.
|
376
|
+
*
|
377
|
+
* If a stepped animation is required, use `{filePaths}`.
|
378
|
+
*
|
379
|
+
* Breakpoints are used to set the media content column size as well as the remainder for the main content areas column size.
|
380
|
+
* Medium and small breakpoints will be set to 0 internally to focus on the main content area.
|
381
|
+
* @see {@link MEDIA_PROP_TYPE}.
|
382
|
+
*/
|
383
|
+
media: _propTypes.default.oneOfType([_propTypes.default.shape({
|
384
|
+
render: _propTypes.default.func,
|
385
|
+
breakpoints: _propTypes.default.shape({
|
386
|
+
xlg: _propTypes.default.number,
|
387
|
+
lg: _propTypes.default.number
|
388
|
+
})
|
389
|
+
}), _propTypes.default.shape({
|
390
|
+
filePaths: _propTypes.default.arrayOf(_propTypes.default.string),
|
391
|
+
breakpoints: _propTypes.default.shape({
|
392
|
+
xlg: _propTypes.default.number,
|
393
|
+
lg: _propTypes.default.number
|
394
|
+
})
|
395
|
+
})]),
|
396
|
+
/**
|
397
|
+
* The label for the Next button.
|
398
|
+
*/
|
399
|
+
nextButtonLabel: _propTypes.default.string,
|
400
|
+
/**
|
401
|
+
* Function to call when the close button is clicked.
|
402
|
+
*/
|
403
|
+
onClose: _propTypes.default.func,
|
404
|
+
/**
|
405
|
+
* The label for the Previous button.
|
406
|
+
*/
|
407
|
+
previousButtonLabel: _propTypes.default.string,
|
408
|
+
/**
|
409
|
+
* The name of this app, e.g. "QRadar".
|
410
|
+
*/
|
411
|
+
productName: _propTypes.default.string,
|
412
|
+
/**
|
413
|
+
* The label for the skip button.
|
414
|
+
*/
|
415
|
+
skipButtonLabel: _propTypes.default.string,
|
416
|
+
/**
|
417
|
+
* The label for the start button.
|
418
|
+
*/
|
419
|
+
startButtonLabel: _propTypes.default.string
|
420
|
+
};
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.InterstitialExampleImg = exports.HowACaseIsCreated3 = exports.HowACaseIsCreated2 = exports.HowACaseIsCreated1 = void 0;
|
7
|
+
var HowACaseIsCreated1 = new URL('./illustrations/how-a-case-is-created-1', import.meta.url).pathname;
|
8
|
+
exports.HowACaseIsCreated1 = HowACaseIsCreated1;
|
9
|
+
var HowACaseIsCreated2 = new URL('./illustrations/how-a-case-is-created-2', import.meta.url).pathname;
|
10
|
+
exports.HowACaseIsCreated2 = HowACaseIsCreated2;
|
11
|
+
var HowACaseIsCreated3 = new URL('./illustrations/how-a-case-is-created-3', import.meta.url).pathname;
|
12
|
+
exports.HowACaseIsCreated3 = HowACaseIsCreated3;
|
13
|
+
var InterstitialExampleImg = new URL('./illustrations/interstitial-ph.png', import.meta.url).pathname;
|
14
|
+
exports.InterstitialExampleImg = InterstitialExampleImg;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "InterstitialScreen", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _InterstitialScreen.InterstitialScreen;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _InterstitialScreen = require("./InterstitialScreen");
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.InterstitialScreenView = void 0;
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
|
+
var _devtools = require("../../global/js/utils/devtools");
|
14
|
+
var _settings = require("../../settings");
|
15
|
+
var _excluded = ["children", "className", "stepTitle"];
|
16
|
+
// Carbon and package components we use.
|
17
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
18
|
+
|
19
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--interstitial-screen-view");
|
21
|
+
var componentName = 'InterstitialScreenView';
|
22
|
+
|
23
|
+
/**
|
24
|
+
* A Novice to Pro component intended to be used as the child elements of the InterstitialScreen component.
|
25
|
+
*/
|
26
|
+
var InterstitialScreenView = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
27
|
+
var children = _ref.children,
|
28
|
+
className = _ref.className,
|
29
|
+
stepTitle = _ref.stepTitle,
|
30
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
31
|
+
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
|
32
|
+
role: "complementary",
|
33
|
+
"aria-label": stepTitle
|
34
|
+
}, rest, {
|
35
|
+
className: (0, _classnames.default)(blockClass,
|
36
|
+
// Apply the block class to the main HTML element
|
37
|
+
className,
|
38
|
+
// Apply any supplied class names to the main HTML element.
|
39
|
+
// example: `${blockClass}__template-string-class-${kind}-n-${size}`,
|
40
|
+
{
|
41
|
+
// switched classes dependant on props or state
|
42
|
+
// example: [`${blockClass}__here-if-small`]: size === 'sm',
|
43
|
+
}),
|
44
|
+
ref: ref
|
45
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), children);
|
46
|
+
});
|
47
|
+
|
48
|
+
// Return a placeholder if not released and not enabled by feature flag
|
49
|
+
exports.InterstitialScreenView = InterstitialScreenView;
|
50
|
+
exports.InterstitialScreenView = InterstitialScreenView = _settings.pkg.checkComponentEnabled(InterstitialScreenView, componentName);
|
51
|
+
|
52
|
+
// The display name of the component, used by React. Note that displayName
|
53
|
+
// is used in preference to relying on function.name.
|
54
|
+
InterstitialScreenView.displayName = componentName;
|
55
|
+
|
56
|
+
// The types and DocGen commentary for the component props,
|
57
|
+
// in alphabetical order (for consistency).
|
58
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
59
|
+
InterstitialScreenView.propTypes = {
|
60
|
+
/**
|
61
|
+
* Provide the contents of the InterstitialScreenView.
|
62
|
+
*/
|
63
|
+
children: _propTypes.default.node,
|
64
|
+
/**
|
65
|
+
* Optional class name for this component.
|
66
|
+
*/
|
67
|
+
className: _propTypes.default.string,
|
68
|
+
/**
|
69
|
+
* The label to pass to the ProgressStep component.
|
70
|
+
*/
|
71
|
+
stepTitle: _propTypes.default.string.isRequired
|
72
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "InterstitialScreenView", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _InterstitialScreenView.InterstitialScreenView;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _InterstitialScreenView = require("./InterstitialScreenView");
|
@@ -0,0 +1,80 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.InterstitialScreenViewModule = void 0;
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
12
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
13
|
+
var _devtools = require("../../global/js/utils/devtools");
|
14
|
+
var _settings = require("../../settings");
|
15
|
+
var _excluded = ["className", "title", "description"];
|
16
|
+
// Carbon and package components we use.
|
17
|
+
/* TODO: @import(s) of carbon components and other package components. */
|
18
|
+
|
19
|
+
// The block part of our conventional BEM class names (blockClass__E--M).
|
20
|
+
var blockClass = "".concat(_settings.pkg.prefix, "--interstitial-screen-view-module");
|
21
|
+
var componentName = 'InterstitialScreenViewModule';
|
22
|
+
|
23
|
+
// NOTE: the component SCSS is not imported here: it is rolled up separately.
|
24
|
+
|
25
|
+
// Default values can be included here and then assigned to the prop params,
|
26
|
+
// e.g. prop = defaults.prop,
|
27
|
+
// This gathers default values together neatly and ensures non-primitive
|
28
|
+
// values are initialized early to avoid react making unnecessary re-renders.
|
29
|
+
// Note that default values are not required for props that are 'required',
|
30
|
+
// nor for props where the component can apply undefined values reasonably.
|
31
|
+
// Default values should be provided when the component needs to make a choice
|
32
|
+
// or assumption when a prop is not supplied.
|
33
|
+
|
34
|
+
/**
|
35
|
+
* View module to help in building interstitial screen views.
|
36
|
+
*/
|
37
|
+
var InterstitialScreenViewModule = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
38
|
+
var className = _ref.className,
|
39
|
+
title = _ref.title,
|
40
|
+
description = _ref.description,
|
41
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
42
|
+
return /*#__PURE__*/_react.default.createElement("section", (0, _extends2.default)({}, rest, {
|
43
|
+
className: (0, _classnames.default)(blockClass,
|
44
|
+
// Apply the block class to the main HTML element
|
45
|
+
className // Apply any supplied class names to the main HTML element.
|
46
|
+
),
|
47
|
+
|
48
|
+
ref: ref
|
49
|
+
}, (0, _devtools.getDevtoolsProps)(componentName)), /*#__PURE__*/_react.default.createElement("h1", {
|
50
|
+
className: "".concat(blockClass, "--heading")
|
51
|
+
}, title), /*#__PURE__*/_react.default.createElement("p", {
|
52
|
+
className: "".concat(blockClass, "--body")
|
53
|
+
}, description));
|
54
|
+
});
|
55
|
+
|
56
|
+
// Return a placeholder if not released and not enabled by feature flag
|
57
|
+
exports.InterstitialScreenViewModule = InterstitialScreenViewModule;
|
58
|
+
exports.InterstitialScreenViewModule = InterstitialScreenViewModule = _settings.pkg.checkComponentEnabled(InterstitialScreenViewModule, componentName);
|
59
|
+
|
60
|
+
// The display name of the component, used by React. Note that displayName
|
61
|
+
// is used in preference to relying on function.name.
|
62
|
+
InterstitialScreenViewModule.displayName = componentName;
|
63
|
+
|
64
|
+
// The types and DocGen commentary for the component props,
|
65
|
+
// in alphabetical order (for consistency).
|
66
|
+
// See https://www.npmjs.com/package/prop-types#usage.
|
67
|
+
InterstitialScreenViewModule.propTypes = {
|
68
|
+
/**
|
69
|
+
* Provide an optional class to be applied to the containing node.
|
70
|
+
*/
|
71
|
+
className: _propTypes.default.string,
|
72
|
+
/**
|
73
|
+
* The description of this component.
|
74
|
+
*/
|
75
|
+
description: _propTypes.default.string.isRequired,
|
76
|
+
/**
|
77
|
+
* The title of this component.
|
78
|
+
*/
|
79
|
+
title: _propTypes.default.string.isRequired
|
80
|
+
};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
Object.defineProperty(exports, "InterstitialScreenViewModule", {
|
7
|
+
enumerable: true,
|
8
|
+
get: function get() {
|
9
|
+
return _InterstitialScreenViewModule.InterstitialScreenViewModule;
|
10
|
+
}
|
11
|
+
});
|
12
|
+
var _InterstitialScreenViewModule = require("./InterstitialScreenViewModule");
|
package/lib/components/index.js
CHANGED
@@ -273,6 +273,24 @@ Object.defineProperty(exports, "InlineTipLink", {
|
|
273
273
|
return _InlineTip.InlineTipLink;
|
274
274
|
}
|
275
275
|
});
|
276
|
+
Object.defineProperty(exports, "InterstitialScreen", {
|
277
|
+
enumerable: true,
|
278
|
+
get: function get() {
|
279
|
+
return _InterstitialScreen.InterstitialScreen;
|
280
|
+
}
|
281
|
+
});
|
282
|
+
Object.defineProperty(exports, "InterstitialScreenView", {
|
283
|
+
enumerable: true,
|
284
|
+
get: function get() {
|
285
|
+
return _InterstitialScreenView.InterstitialScreenView;
|
286
|
+
}
|
287
|
+
});
|
288
|
+
Object.defineProperty(exports, "InterstitialScreenViewModule", {
|
289
|
+
enumerable: true,
|
290
|
+
get: function get() {
|
291
|
+
return _InterstitialScreenViewModule.InterstitialScreenViewModule;
|
292
|
+
}
|
293
|
+
});
|
276
294
|
Object.defineProperty(exports, "ModifiedTabs", {
|
277
295
|
enumerable: true,
|
278
296
|
get: function get() {
|
@@ -616,4 +634,7 @@ var _CoachmarkOverlayElements = require("./CoachmarkOverlayElements");
|
|
616
634
|
var _CoachmarkOverlayElement = require("./CoachmarkOverlayElement");
|
617
635
|
var _CoachmarkStack = require("./CoachmarkStack");
|
618
636
|
var _InlineTip = require("./InlineTip");
|
637
|
+
var _InterstitialScreen = require("./InterstitialScreen");
|
638
|
+
var _InterstitialScreenView = require("./InterstitialScreenView");
|
639
|
+
var _InterstitialScreenViewModule = require("./InterstitialScreenViewModule");
|
619
640
|
var _Checklist = require("./Checklist");
|