@carbon/ibm-products 2.64.0 → 2.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.
Files changed (104) hide show
  1. package/css/index-full-carbon.css +59 -143
  2. package/css/index-full-carbon.css.map +1 -1
  3. package/css/index-full-carbon.min.css +1 -1
  4. package/css/index-full-carbon.min.css.map +1 -1
  5. package/css/index-without-carbon-released-only.css +8 -0
  6. package/css/index-without-carbon-released-only.css.map +1 -1
  7. package/css/index-without-carbon-released-only.min.css +1 -1
  8. package/css/index-without-carbon-released-only.min.css.map +1 -1
  9. package/css/index-without-carbon.css +59 -143
  10. package/css/index-without-carbon.css.map +1 -1
  11. package/css/index-without-carbon.min.css +1 -1
  12. package/css/index-without-carbon.min.css.map +1 -1
  13. package/css/index.css +59 -143
  14. package/css/index.css.map +1 -1
  15. package/css/index.min.css +1 -1
  16. package/css/index.min.css.map +1 -1
  17. package/es/components/Checklist/Checklist.js +8 -7
  18. package/es/components/CoachmarkStack/CoachmarkStack.d.ts +5 -0
  19. package/es/components/CoachmarkStack/CoachmarkStack.js +9 -3
  20. package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +5 -0
  21. package/es/components/CoachmarkStack/CoachmarkStackHome.js +39 -6
  22. package/es/components/CreateFullPage/CreateFullPage.d.ts +1 -1
  23. package/es/components/CreateFullPage/CreateFullPage.js +23 -18
  24. package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +3 -1
  25. package/es/components/Datagrid/Datagrid/DraggableElement.js +3 -1
  26. package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +3 -0
  27. package/es/components/InlineTip/InlineTip.js +3 -3
  28. package/es/components/InterstitialScreen/InterstitialScreen.d.ts +36 -59
  29. package/es/components/InterstitialScreen/InterstitialScreen.js +75 -271
  30. package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +27 -0
  31. package/es/components/InterstitialScreen/InterstitialScreenBody.js +110 -0
  32. package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +47 -0
  33. package/es/components/InterstitialScreen/InterstitialScreenFooter.js +184 -0
  34. package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +35 -0
  35. package/es/components/InterstitialScreen/InterstitialScreenHeader.js +90 -0
  36. package/es/components/{InterstitialScreenView → InterstitialScreen/_story-assets/InterstitialScreenView}/InterstitialScreenView.d.ts +1 -0
  37. package/{lib/components → es/components/InterstitialScreen/_story-assets}/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +8 -0
  38. package/es/components/NotificationsPanel/NotificationsPanel.js +15 -10
  39. package/es/components/PageHeader/PageHeader.js +1 -1
  40. package/es/components/SidePanel/SidePanel.js +3 -2
  41. package/es/components/Tearsheet/Tearsheet.js +3 -2
  42. package/es/components/index.d.ts +0 -2
  43. package/es/global/js/hooks/useOverflowItems/useOverflowItems.d.ts +2 -2
  44. package/es/global/js/package-settings.d.ts +0 -2
  45. package/es/global/js/package-settings.js +0 -2
  46. package/es/index.js +0 -2
  47. package/es/settings.d.ts +0 -2
  48. package/lib/components/Checklist/Checklist.js +7 -6
  49. package/lib/components/CoachmarkStack/CoachmarkStack.d.ts +5 -0
  50. package/lib/components/CoachmarkStack/CoachmarkStack.js +9 -3
  51. package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +5 -0
  52. package/lib/components/CoachmarkStack/CoachmarkStackHome.js +37 -4
  53. package/lib/components/CreateFullPage/CreateFullPage.d.ts +1 -1
  54. package/lib/components/CreateFullPage/CreateFullPage.js +22 -17
  55. package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +3 -1
  56. package/lib/components/Datagrid/Datagrid/DraggableElement.js +3 -1
  57. package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +3 -0
  58. package/lib/components/InlineTip/InlineTip.js +2 -2
  59. package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +36 -59
  60. package/lib/components/InterstitialScreen/InterstitialScreen.js +73 -267
  61. package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +27 -0
  62. package/lib/components/InterstitialScreen/InterstitialScreenBody.js +114 -0
  63. package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +47 -0
  64. package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +188 -0
  65. package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +35 -0
  66. package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +94 -0
  67. package/lib/components/{InterstitialScreenView → InterstitialScreen/_story-assets/InterstitialScreenView}/InterstitialScreenView.d.ts +1 -0
  68. package/{es/components → lib/components/InterstitialScreen/_story-assets}/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +8 -0
  69. package/lib/components/NotificationsPanel/NotificationsPanel.js +14 -9
  70. package/lib/components/PageHeader/PageHeader.js +1 -1
  71. package/lib/components/SidePanel/SidePanel.js +3 -2
  72. package/lib/components/Tearsheet/Tearsheet.js +3 -2
  73. package/lib/components/index.d.ts +0 -2
  74. package/lib/global/js/hooks/useOverflowItems/useOverflowItems.d.ts +2 -2
  75. package/lib/global/js/package-settings.d.ts +0 -2
  76. package/lib/global/js/package-settings.js +0 -2
  77. package/lib/index.js +0 -10
  78. package/lib/settings.d.ts +0 -2
  79. package/package.json +7 -7
  80. package/scss/components/Coachmark/_coachmark-overlay.scss +2 -0
  81. package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -0
  82. package/scss/components/CoachmarkStack/_coachmark-stack.scss +25 -0
  83. package/scss/components/InterstitialScreen/_interstitial-screen.scss +29 -137
  84. package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -0
  85. package/scss/components/PageHeader/_page-header.scss +5 -0
  86. package/scss/components/_index-with-carbon.scss +0 -2
  87. package/scss/components/_index.scss +0 -2
  88. package/telemetry.yml +17 -8
  89. package/es/components/InterstitialScreenView/InterstitialScreenView.js +0 -78
  90. package/es/components/InterstitialScreenView/index.d.ts +0 -8
  91. package/es/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +0 -81
  92. package/es/components/InterstitialScreenViewModule/index.d.ts +0 -8
  93. package/lib/components/InterstitialScreenView/InterstitialScreenView.js +0 -78
  94. package/lib/components/InterstitialScreenView/index.d.ts +0 -8
  95. package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +0 -81
  96. package/lib/components/InterstitialScreenViewModule/index.d.ts +0 -8
  97. package/scss/components/InterstitialScreenView/_carbon-imports.scss +0 -9
  98. package/scss/components/InterstitialScreenView/_index-with-carbon.scss +0 -9
  99. package/scss/components/InterstitialScreenView/_index.scss +0 -8
  100. package/scss/components/InterstitialScreenView/_interstitial-screen-view.scss +0 -25
  101. package/scss/components/InterstitialScreenViewModule/_carbon-imports.scss +0 -9
  102. package/scss/components/InterstitialScreenViewModule/_index-with-carbon.scss +0 -9
  103. package/scss/components/InterstitialScreenViewModule/_index.scss +0 -8
  104. package/scss/components/InterstitialScreenViewModule/_interstitial-screen-view-module.scss +0 -59
@@ -5,24 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import { ProgressIndicator, ProgressStep, ComposedModal, ModalHeader, ModalBody, ModalFooter, FlexGrid, Row, Column, Button } from '@carbon/react';
10
- import React__default, { useRef, useState, Children, useCallback, useEffect, useMemo, isValidElement } from 'react';
11
- import { ArrowRight } from '@carbon/react/icons';
12
- import { Carousel } from '../Carousel/Carousel.js';
13
- import '../Carousel/CarouselItem.js';
8
+ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import { ComposedModal } from '@carbon/react';
10
+ import React__default, { createContext, useRef, useState, useCallback, useEffect } from 'react';
14
11
  import PropTypes from '../../_virtual/index.js';
15
12
  import cx from 'classnames';
16
- import { clamp } from '../../global/js/utils/clamp.js';
17
13
  import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
18
14
  import { pkg } from '../../settings.js';
15
+ import InterstitialScreenHeader from './InterstitialScreenHeader.js';
16
+ import InterstitialScreenBody from './InterstitialScreenBody.js';
17
+ import InterstitialScreenFooter from './InterstitialScreenFooter.js';
19
18
 
20
- var _excluded = ["children", "className", "closeIconDescription", "domainName", "hideProgressIndicator", "interstitialAriaLabel", "isFullScreen", "isOpen", "renderMedia", "breakpointsWithMedia", "nextButtonLabel", "onClose", "previousButtonLabel", "productName", "headerClassName", "headerTitle", "startButtonLabel", "skipButtonLabel"];
19
+ var _excluded = ["children", "className", "interstitialAriaLabel", "isFullScreen", "isOpen", "onClose"];
21
20
 
22
21
  // The block part of our conventional BEM class names (blockClass__E--M).
23
22
  var blockClass = "".concat(pkg.prefix, "--interstitial-screen");
24
- var headerBlockClass = "".concat(blockClass, "--internal-header");
25
- var bodyBlockClass = "".concat(blockClass, "--internal-body");
26
23
  var componentName = 'InterstitialScreen';
27
24
 
28
25
  // NOTE: the component SCSS is not imported here: it is rolled up separately.
@@ -36,21 +33,12 @@ var componentName = 'InterstitialScreen';
36
33
  // Default values should be provided when the component needs to make a choice
37
34
  // or assumption when a prop is not supplied.
38
35
 
39
- // Default values for props
40
- var defaults = {
41
- closeIconDescription: 'Close',
42
- domainName: '',
43
- hideProgressIndicator: false,
44
- interstitialAriaLabel: 'Interstitial screen',
45
- isFullScreen: false,
46
- isOpen: false,
47
- nextButtonLabel: 'Next',
48
- onClose: function onClose() {},
49
- previousButtonLabel: 'Back',
50
- productName: '',
51
- skipButtonLabel: '',
52
- startButtonLabel: 'Get started'
53
- };
36
+ // Define the type for InterstitialScreen, extending it to include Header
37
+
38
+ var InterstitialScreenContext = /*#__PURE__*/createContext({
39
+ progStep: 0,
40
+ stepCount: 0
41
+ });
54
42
  /**
55
43
  * InterstitialScreen can be a full page or an overlay, and are
56
44
  * shown on the first time a user accesses a new experience
@@ -58,37 +46,15 @@ var defaults = {
58
46
  * newly purchased capability is presented).
59
47
  */
60
48
  var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props, ref) {
61
- var _h, _strong, _h2;
62
49
  var children = props.children,
63
50
  className = props.className,
64
- _props$closeIconDescr = props.closeIconDescription,
65
- closeIconDescription = _props$closeIconDescr === void 0 ? defaults.closeIconDescription : _props$closeIconDescr,
66
- _props$domainName = props.domainName,
67
- domainName = _props$domainName === void 0 ? defaults.domainName : _props$domainName,
68
- _props$hideProgressIn = props.hideProgressIndicator,
69
- hideProgressIndicator = _props$hideProgressIn === void 0 ? defaults.hideProgressIndicator : _props$hideProgressIn,
70
51
  _props$interstitialAr = props.interstitialAriaLabel,
71
- interstitialAriaLabel = _props$interstitialAr === void 0 ? defaults.interstitialAriaLabel : _props$interstitialAr,
52
+ interstitialAriaLabel = _props$interstitialAr === void 0 ? 'Interstitial screen' : _props$interstitialAr,
72
53
  _props$isFullScreen = props.isFullScreen,
73
- isFullScreen = _props$isFullScreen === void 0 ? defaults.isFullScreen : _props$isFullScreen,
54
+ isFullScreen = _props$isFullScreen === void 0 ? false : _props$isFullScreen,
74
55
  _props$isOpen = props.isOpen,
75
- isOpen = _props$isOpen === void 0 ? defaults.isOpen : _props$isOpen,
76
- renderMedia = props.renderMedia,
77
- breakpointsWithMedia = props.breakpointsWithMedia,
78
- _props$nextButtonLabe = props.nextButtonLabel,
79
- nextButtonLabel = _props$nextButtonLabe === void 0 ? defaults.nextButtonLabel : _props$nextButtonLabe,
80
- _props$onClose = props.onClose,
81
- onClose = _props$onClose === void 0 ? defaults.onClose : _props$onClose,
82
- _props$previousButton = props.previousButtonLabel,
83
- previousButtonLabel = _props$previousButton === void 0 ? defaults.previousButtonLabel : _props$previousButton,
84
- _props$productName = props.productName,
85
- productName = _props$productName === void 0 ? defaults.productName : _props$productName,
86
- headerClassName = props.headerClassName,
87
- headerTitle = props.headerTitle,
88
- _props$startButtonLab = props.startButtonLabel,
89
- startButtonLabel = _props$startButtonLab === void 0 ? defaults.startButtonLabel : _props$startButtonLab,
90
- _props$skipButtonLabe = props.skipButtonLabel,
91
- skipButtonLabel = _props$skipButtonLabe === void 0 ? defaults.skipButtonLabel : _props$skipButtonLabe,
56
+ isOpen = _props$isOpen === void 0 ? false : _props$isOpen,
57
+ onClose = props.onClose,
92
58
  rest = _objectWithoutProperties(props, _excluded);
93
59
  var backupRef = useRef(null);
94
60
  var _forwardedRef = ref || backupRef;
@@ -103,47 +69,29 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props,
103
69
  _useState4 = _slicedToArray(_useState3, 2),
104
70
  progStep = _useState4[0],
105
71
  setProgStep = _useState4[1];
106
- var childArray = Children.toArray(children);
107
- var isMultiStep = childArray.length > 1;
108
72
  var bodyScrollRef = useRef(null);
109
- var mediaBreakpoints = {
110
- xlg: (breakpointsWithMedia === null || breakpointsWithMedia === void 0 ? void 0 : breakpointsWithMedia.xlg) || 0,
111
- lg: (breakpointsWithMedia === null || breakpointsWithMedia === void 0 ? void 0 : breakpointsWithMedia.lg) || 0,
112
- md: 0,
113
- sm: 0
114
- };
115
- var contentBreakpoints = {
116
- xlg: 16 - mediaBreakpoints.xlg,
117
- lg: 16 - mediaBreakpoints.lg,
118
- md: 8,
119
- sm: 4
120
- };
73
+ var _useState5 = useState(0),
74
+ _useState6 = _slicedToArray(_useState5, 2),
75
+ stepCount = _useState6[0],
76
+ setStepCount = _useState6[1];
77
+ var _useState7 = useState({
78
+ skip: false,
79
+ back: false,
80
+ next: false,
81
+ start: false
82
+ }),
83
+ _useState8 = _slicedToArray(_useState7, 2),
84
+ disableButtonConfig = _useState8[0],
85
+ setDisableButtonConfig = _useState8[1];
121
86
  var variantClass = isFullScreen ? "".concat(blockClass, "--full-screen") : "".concat(blockClass, "--modal");
122
- var progStepFloor = 0;
123
- var progStepCeil = childArray.length - 1;
124
- var handleClose = useCallback(function () {
87
+ var _useState9 = useState(null),
88
+ _useState10 = _slicedToArray(_useState9, 2),
89
+ bodyChildrenData = _useState10[0],
90
+ setBodyChildrenData = _useState10[1];
91
+ var handleClose = useCallback(function (actionName) {
125
92
  setProgStep(0);
126
- onClose();
93
+ onClose === null || onClose === void 0 || onClose(actionName !== null && actionName !== void 0 ? actionName : 'close');
127
94
  }, [onClose]);
128
- var scrollBodyToTop = function scrollBodyToTop() {
129
- var _bodyScrollRef$curren, _bodyScrollRef$curren2;
130
- (_bodyScrollRef$curren = bodyScrollRef.current) === null || _bodyScrollRef$curren === void 0 || (_bodyScrollRef$curren2 = _bodyScrollRef$curren.scroll) === null || _bodyScrollRef$curren2 === void 0 || _bodyScrollRef$curren2.call(_bodyScrollRef$curren, {
131
- top: 0,
132
- behavior: 'smooth'
133
- });
134
- };
135
- var handleClickPrev = function handleClickPrev() {
136
- var targetStep = clamp(progStep - 1, progStepFloor, progStepCeil);
137
- scrollRef.current.scrollPrev();
138
- scrollBodyToTop();
139
- setProgStep(targetStep);
140
- };
141
- var handleClickNext = function handleClickNext() {
142
- var targetStep = clamp(progStep + 1, progStepFloor, progStepCeil);
143
- scrollRef.current.scrollNext();
144
- scrollBodyToTop();
145
- setProgStep(targetStep);
146
- };
147
95
  useEffect(function () {
148
96
  var _startButtonRef$curre;
149
97
  if (!isOpen) {
@@ -163,7 +111,7 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props,
163
111
  var close = function close(e) {
164
112
  var key = e.key;
165
113
  if (key === 'Escape') {
166
- handleClose();
114
+ handleClose('close');
167
115
  }
168
116
  };
169
117
  window.addEventListener('keydown', close);
@@ -171,14 +119,10 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props,
171
119
  return window.removeEventListener('keydown', close);
172
120
  };
173
121
  }, [handleClose]);
174
- var stepSize = useMemo(function () {
175
- return children && Children.count(children) > 1 ? parseFloat((1 / (Children.count(children) - 1)).toFixed(2)) : 0;
176
- }, [children]);
177
122
  if (!isOpen) {
178
123
  return null;
179
124
  }
180
- var domainProductDelimiter = domainName !== '' && productName !== '' ? ' | ' : '';
181
- var renderModal = function renderModal(childElements) {
125
+ var renderModal = function renderModal() {
182
126
  return /*#__PURE__*/React__default.createElement(ComposedModal, _extends({}, rest, {
183
127
  preventCloseOnClickOutside: true,
184
128
  className: cx(blockClass,
@@ -190,27 +134,9 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props,
190
134
  open: isOpen,
191
135
  ref: _forwardedRef,
192
136
  "aria-label": interstitialAriaLabel
193
- }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement(ModalHeader, {
194
- className: cx(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName),
195
- iconDescription: closeIconDescription
196
- }, headerTitle && (_h || (_h = /*#__PURE__*/React__default.createElement("h2", null, headerTitle))), !hideProgressIndicator && /*#__PURE__*/React__default.createElement("div", {
197
- className: "".concat(blockClass, "--progress")
198
- }, /*#__PURE__*/React__default.createElement(ProgressIndicator, {
199
- vertical: false,
200
- currentIndex: progStep
201
- }, childArray.map(function (child, idx) {
202
- if (/*#__PURE__*/isValidElement(child)) {
203
- return /*#__PURE__*/React__default.createElement(ProgressStep, {
204
- key: idx,
205
- label: child.props.stepTitle || '',
206
- translateWithId: child.props.translateWithId
207
- });
208
- }
209
- })))), /*#__PURE__*/React__default.createElement(ModalBody, {
210
- className: bodyBlockClass
211
- }, childElements), /*#__PURE__*/React__default.createElement(ModalFooter, null, renderFooter()));
137
+ }, getDevtoolsProps(componentName)), children);
212
138
  };
213
- var renderFullScreen = function renderFullScreen(childElements) {
139
+ var renderFullScreen = function renderFullScreen() {
214
140
  return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
215
141
  className: cx(blockClass,
216
142
  // Apply the block class to the main HTML element
@@ -221,117 +147,42 @@ var InterstitialScreen = /*#__PURE__*/React__default.forwardRef(function (props,
221
147
  "aria-label": interstitialAriaLabel,
222
148
  ref: ref
223
149
  }, getDevtoolsProps(componentName)), /*#__PURE__*/React__default.createElement("div", {
224
- className: cx([_defineProperty({}, "".concat(blockClass, "--container"), isFullScreen)])
225
- }, /*#__PURE__*/React__default.createElement("div", {
226
- className: "".concat(blockClass, "--header")
227
- }, domainName, domainProductDelimiter, _strong || (_strong = /*#__PURE__*/React__default.createElement("strong", null, productName))), /*#__PURE__*/React__default.createElement("header", {
228
- className: cx(headerBlockClass, headerTitle && "".concat(headerBlockClass, "--has-title"), headerClassName)
229
- }, headerTitle && (_h2 || (_h2 = /*#__PURE__*/React__default.createElement("h2", null, headerTitle))), !hideProgressIndicator && /*#__PURE__*/React__default.createElement("div", {
230
- className: "".concat(blockClass, "--progress")
231
- }, /*#__PURE__*/React__default.createElement(ProgressIndicator, {
232
- vertical: false,
233
- currentIndex: progStep
234
- }, childArray.map(function (child, idx) {
235
- if (/*#__PURE__*/isValidElement(child)) {
236
- return /*#__PURE__*/React__default.createElement(ProgressStep, {
237
- key: idx,
238
- label: child.props.stepTitle || '',
239
- translateWithId: child.props.translateWithId
240
- });
241
- }
242
- })))), childElements, renderFooter()));
243
- };
244
- var scrollToCurrentStep = function scrollToCurrentStep(scrollPercent) {
245
- var currentStep = scrollPercent / stepSize;
246
- setProgStep(Math.ceil(currentStep));
150
+ className: "".concat(blockClass, "--container")
151
+ }, children));
247
152
  };
248
- var renderBody = function renderBody() {
249
- return /*#__PURE__*/React__default.createElement("div", {
250
- className: cx("".concat(blockClass, "--body")),
251
- ref: bodyScrollRef,
252
- tabIndex: 0
253
- }, renderMedia ? /*#__PURE__*/React__default.createElement(FlexGrid, {
254
- fullWidth: true,
255
- className: cx("".concat(blockClass, "--body-grid"))
256
- }, /*#__PURE__*/React__default.createElement(Row, {
257
- className: cx("".concat(blockClass, "--body-row"))
258
- }, /*#__PURE__*/React__default.createElement(Column, {
259
- xlg: contentBreakpoints.xlg,
260
- lg: contentBreakpoints.lg,
261
- md: contentBreakpoints.md,
262
- sm: contentBreakpoints.sm
263
- }, /*#__PURE__*/React__default.createElement("div", {
264
- className: cx("".concat(blockClass, "--content"))
265
- }, isMultiStep ? /*#__PURE__*/React__default.createElement("div", {
266
- className: "".concat(blockClass, "__carousel")
267
- }, /*#__PURE__*/React__default.createElement(Carousel, {
268
- disableArrowScroll: true,
269
- ref: scrollRef,
270
- onScroll: scrollToCurrentStep
271
- }, children)) : childArray[0])), renderMedia && /*#__PURE__*/React__default.createElement(Column, {
272
- xlg: mediaBreakpoints.xlg,
273
- lg: mediaBreakpoints.lg,
274
- md: mediaBreakpoints.md,
275
- sm: mediaBreakpoints.sm,
276
- className: cx("".concat(blockClass, "--media-container"))
277
- }, /*#__PURE__*/React__default.createElement("div", {
278
- className: "".concat(blockClass, "--media")
279
- }, renderMedia && /*#__PURE__*/React__default.createElement("div", {
280
- className: "".concat(blockClass, "--stepped-animated-media")
281
- }, renderMedia({
282
- playStep: progStep
283
- })))))) : /*#__PURE__*/React__default.createElement("div", {
284
- className: cx("".concat(blockClass, "--content"))
285
- }, isMultiStep ? /*#__PURE__*/React__default.createElement("div", {
286
- className: "".concat(blockClass, "__carousel")
287
- }, /*#__PURE__*/React__default.createElement(Carousel, {
288
- disableArrowScroll: true,
289
- ref: scrollRef,
290
- onScroll: scrollToCurrentStep
291
- }, children)) : /*#__PURE__*/React__default.createElement("div", null, childArray[0])));
153
+ var handleGotoStep = function handleGotoStep(targetStep) {
154
+ setProgStep(targetStep);
155
+ scrollRef.current.scrollToView(targetStep);
156
+ scrollBodyToTop();
292
157
  };
293
- var renderFooter = function renderFooter() {
294
- return /*#__PURE__*/React__default.createElement("div", {
295
- className: "".concat(blockClass, "--footer")
296
- }, isMultiStep && skipButtonLabel !== '' && /*#__PURE__*/React__default.createElement(Button, {
297
- className: "".concat(blockClass, "--skip-btn"),
298
- kind: "ghost",
299
- size: "lg",
300
- title: skipButtonLabel,
301
- onClick: handleClose
302
- }, skipButtonLabel), /*#__PURE__*/React__default.createElement("div", {
303
- className: "".concat(blockClass, "--footer-controls")
304
- }, isMultiStep && progStep > 0 && /*#__PURE__*/React__default.createElement(Button, {
305
- className: "".concat(blockClass, "--prev-btn"),
306
- kind: "secondary",
307
- size: "lg",
308
- title: previousButtonLabel,
309
- onClick: handleClickPrev
310
- }, previousButtonLabel), isMultiStep && progStep < progStepCeil && /*#__PURE__*/React__default.createElement(Button, {
311
- className: "".concat(blockClass, "--next-btn"),
312
- renderIcon: ArrowRight,
313
- ref: nextButtonRef,
314
- size: "lg",
315
- title: nextButtonLabel,
316
- onClick: handleClickNext
317
- }, nextButtonLabel), isMultiStep && progStep === progStepCeil && /*#__PURE__*/React__default.createElement(Button, {
318
- className: "".concat(blockClass, "--start-btn"),
319
- ref: startButtonRef,
320
- renderIcon: ArrowRight,
321
- size: "lg",
322
- title: startButtonLabel,
323
- onClick: handleClose
324
- }, startButtonLabel), !isMultiStep && /*#__PURE__*/React__default.createElement(Button, {
325
- className: "".concat(blockClass, "--start-btn"),
326
- ref: startButtonRef,
327
- size: "lg",
328
- title: startButtonLabel,
329
- onClick: handleClose
330
- }, startButtonLabel)));
158
+ var scrollBodyToTop = function scrollBodyToTop() {
159
+ var _bodyScrollRef$curren, _bodyScrollRef$curren2;
160
+ (_bodyScrollRef$curren = bodyScrollRef.current) === null || _bodyScrollRef$curren === void 0 || (_bodyScrollRef$curren2 = _bodyScrollRef$curren.scroll) === null || _bodyScrollRef$curren2 === void 0 || _bodyScrollRef$curren2.call(_bodyScrollRef$curren, {
161
+ top: 0,
162
+ behavior: 'smooth'
163
+ });
331
164
  };
332
- return isFullScreen ? renderFullScreen(renderBody()) : renderModal(renderBody());
165
+ return /*#__PURE__*/React__default.createElement(InterstitialScreenContext.Provider, {
166
+ value: {
167
+ bodyChildrenData: bodyChildrenData,
168
+ setBodyChildrenData: setBodyChildrenData,
169
+ isFullScreen: isFullScreen,
170
+ handleClose: handleClose,
171
+ progStep: progStep,
172
+ setProgStep: setProgStep,
173
+ bodyScrollRef: bodyScrollRef,
174
+ scrollRef: scrollRef,
175
+ handleGotoStep: handleGotoStep,
176
+ stepCount: stepCount,
177
+ setStepCount: setStepCount,
178
+ disableButtonConfig: disableButtonConfig,
179
+ setDisableButtonConfig: setDisableButtonConfig
180
+ }
181
+ }, isFullScreen ? renderFullScreen() : renderModal());
333
182
  });
334
-
183
+ InterstitialScreen.Header = InterstitialScreenHeader;
184
+ InterstitialScreen.Body = InterstitialScreenBody;
185
+ InterstitialScreen.Footer = InterstitialScreenFooter;
335
186
  // Return a placeholder if not released and not enabled by feature flag
336
187
  InterstitialScreen = pkg.checkComponentEnabled(InterstitialScreen, componentName);
337
188
 
@@ -343,14 +194,7 @@ InterstitialScreen.displayName = componentName;
343
194
  // in alphabetical order (for consistency).
344
195
  // See https://www.npmjs.com/package/prop-types#usage.
345
196
  InterstitialScreen.propTypes = {
346
- /**
347
- * Breakpoints are used to set the media content column size as well as the remainder for the main content areas column size. Medium and small breakpoints will be set to 0 internally to focus on the main content area.
348
- */
349
- breakpointsWithMedia: PropTypes.object,
350
- /**
351
- * Provide the contents of the InterstitialScreen.
352
- */
353
- children: PropTypes.node.isRequired,
197
+ children: PropTypes.node,
354
198
  /**
355
199
  * Provide an optional class to be applied to the containing node.
356
200
  */
@@ -359,22 +203,6 @@ InterstitialScreen.propTypes = {
359
203
  * Tooltip text and aria label for the Close button icon.
360
204
  */
361
205
  closeIconDescription: PropTypes.string,
362
- /**
363
- * The domain this app belongs to, e.g. "IBM Cloud Pak".
364
- */
365
- domainName: PropTypes.string,
366
- /**
367
- * Provide an optional class to be applied to the <header> element >.
368
- */
369
- headerClassName: PropTypes.string,
370
- /**
371
- * Provide an optional class to be applied to the <header> element >.
372
- */
373
- headerTitle: PropTypes.string,
374
- /**
375
- * Optional parameter to hide the progress indicator when multiple steps are used.
376
- */
377
- hideProgressIndicator: PropTypes.bool,
378
206
  /**
379
207
  * The aria label applied to the Interstitial Screen component
380
208
  */
@@ -388,34 +216,10 @@ InterstitialScreen.propTypes = {
388
216
  * Specifies whether the component is currently open.
389
217
  */
390
218
  isOpen: PropTypes.bool,
391
- /**
392
- * The label for the Next button.
393
- */
394
- nextButtonLabel: PropTypes.string,
395
219
  /**
396
220
  * Function to call when the close button is clicked.
397
221
  */
398
- onClose: PropTypes.func,
399
- /**
400
- * The label for the Previous button.
401
- */
402
- previousButtonLabel: PropTypes.string,
403
- /**
404
- * The name of this app, e.g. "QRadar".
405
- */
406
- productName: PropTypes.string,
407
- /**
408
- * Optional prop to render any media like images or animated media.
409
- */
410
- renderMedia: PropTypes.func,
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
222
+ onClose: PropTypes.func
419
223
  };
420
224
 
421
- export { InterstitialScreen };
225
+ export { InterstitialScreen, InterstitialScreenContext };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React, { ReactElement, ReactNode } from 'react';
8
+ import { disableButtonConfigType } from './InterstitialScreen';
9
+ import { EnrichedChildren } from './InterstitialScreenHeader';
10
+ type contentRendererArgs = {
11
+ handleGotoStep?: (value: number) => void;
12
+ progStep?: number;
13
+ disableActionButton: (value: disableButtonConfigType) => void;
14
+ };
15
+ export interface InterstitialScreenBodyProps {
16
+ /**
17
+ * Provide an optional class to be applied to the containing node.
18
+ */
19
+ className?: string;
20
+ /**
21
+ * This is a required callback that has to return the content to render in the body section.
22
+ * It can be a single child or an array of children depending on your need
23
+ */
24
+ contentRenderer: (config: contentRendererArgs) => ReactElement<EnrichedChildren> | ReactNode;
25
+ }
26
+ declare const InterstitialScreenBody: React.ForwardRefExoticComponent<InterstitialScreenBodyProps & React.RefAttributes<HTMLDivElement>>;
27
+ export default InterstitialScreenBody;
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Copyright IBM Corp. 2020, 2025
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
+
8
+ import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
+ import React__default, { useState, useContext, useEffect, isValidElement } from 'react';
10
+ import PropTypes from '../../_virtual/index.js';
11
+ import { InterstitialScreenContext } from './InterstitialScreen.js';
12
+ import { ModalBody } from '@carbon/react';
13
+ import { pkg } from '../../settings.js';
14
+ import { Carousel } from '../Carousel/Carousel.js';
15
+ import '../Carousel/CarouselItem.js';
16
+
17
+ var _excluded = ["className", "contentRenderer"];
18
+ var InterstitialScreenBody = /*#__PURE__*/React__default.forwardRef(function (props) {
19
+ var _props$className = props.className,
20
+ className = _props$className === void 0 ? '' : _props$className,
21
+ contentRenderer = props.contentRenderer,
22
+ rest = _objectWithoutProperties(props, _excluded);
23
+ var blockClass = "".concat(pkg.prefix, "--interstitial-screen");
24
+ var bodyBlockClass = "".concat(blockClass, "--internal-body");
25
+ var _useState = useState(false),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ isMultiStep = _useState2[0],
28
+ setIsMultiStep = _useState2[1];
29
+ var _useContext = useContext(InterstitialScreenContext),
30
+ setBodyChildrenData = _useContext.setBodyChildrenData,
31
+ bodyChildrenData = _useContext.bodyChildrenData,
32
+ isFullScreen = _useContext.isFullScreen,
33
+ setProgStep = _useContext.setProgStep,
34
+ bodyScrollRef = _useContext.bodyScrollRef,
35
+ scrollRef = _useContext.scrollRef,
36
+ handleGotoStep = _useContext.handleGotoStep,
37
+ progStep = _useContext.progStep,
38
+ setStepCount = _useContext.setStepCount,
39
+ disableButtonConfig = _useContext.disableButtonConfig,
40
+ setDisableButtonConfig = _useContext.setDisableButtonConfig;
41
+ var _useState3 = useState(-1),
42
+ _useState4 = _slicedToArray(_useState3, 2),
43
+ scrollPercent = _useState4[0],
44
+ setScrollPercent = _useState4[1];
45
+ useEffect(function () {
46
+ var _bodyContent = contentRenderer({
47
+ handleGotoStep: handleGotoStep,
48
+ progStep: progStep,
49
+ disableActionButton: disableActionButton
50
+ });
51
+ var isElement = /*#__PURE__*/isValidElement(_bodyContent);
52
+ var children = isElement ? _bodyContent.props.children : _bodyContent;
53
+
54
+ // Set body children data
55
+ setBodyChildrenData === null || setBodyChildrenData === void 0 || setBodyChildrenData(children);
56
+
57
+ // If the children is an array, treat it as a multiStep
58
+ if (isElement && Array.isArray(children)) {
59
+ var stepLength = children.length;
60
+ setIsMultiStep(!!stepLength);
61
+ setStepCount === null || setStepCount === void 0 || setStepCount(stepLength);
62
+ }
63
+
64
+ // eslint-disable-next-line react-hooks/exhaustive-deps
65
+ }, [progStep]);
66
+ useEffect(function () {
67
+ if (scrollPercent !== -1) {
68
+ var stepSize = bodyChildrenData && bodyChildrenData.length > 1 ? parseFloat((1 / (bodyChildrenData.length - 1)).toFixed(2)) : 0;
69
+ var currentStep = scrollPercent / stepSize;
70
+ setProgStep === null || setProgStep === void 0 || setProgStep(Math.ceil(currentStep));
71
+ }
72
+ // eslint-disable-next-line react-hooks/exhaustive-deps
73
+ }, [scrollPercent]);
74
+ var disableActionButton = function disableActionButton(config) {
75
+ setDisableButtonConfig === null || setDisableButtonConfig === void 0 || setDisableButtonConfig(_objectSpread2(_objectSpread2({}, disableButtonConfig), config));
76
+ };
77
+ var onScrollHandler = function onScrollHandler(scrollPercent) {
78
+ return setScrollPercent(scrollPercent);
79
+ };
80
+ var renderBody = function renderBody() {
81
+ return /*#__PURE__*/React__default.createElement("div", _extends({
82
+ className: "".concat(blockClass, "--body ").concat(className),
83
+ ref: bodyScrollRef
84
+ }, rest), /*#__PURE__*/React__default.createElement("div", {
85
+ className: "".concat(blockClass, "--content")
86
+ }, isMultiStep ? /*#__PURE__*/React__default.createElement("div", {
87
+ className: "".concat(blockClass, "__carousel")
88
+ }, /*#__PURE__*/React__default.createElement(Carousel, {
89
+ disableArrowScroll: true,
90
+ ref: scrollRef,
91
+ onScroll: onScrollHandler
92
+ }, bodyChildrenData)) : bodyChildrenData));
93
+ };
94
+ return isFullScreen ? renderBody() : /*#__PURE__*/React__default.createElement(ModalBody, {
95
+ className: bodyBlockClass
96
+ }, renderBody());
97
+ });
98
+ InterstitialScreenBody.propTypes = {
99
+ /**
100
+ * Provide an optional class to be applied to the containing node.
101
+ */
102
+ className: PropTypes.string,
103
+ /**
104
+ * This is a required callback that has to return the content to render in the body section.
105
+ * It can be a single child or an array of children depending on your need
106
+ */
107
+ contentRenderer: PropTypes.func.isRequired
108
+ };
109
+
110
+ export { InterstitialScreenBody as default };
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import React from 'react';
8
+ import { ActionType, disableButtonConfigType } from './InterstitialScreen';
9
+ type actionButtonRendererArgs = {
10
+ handleGotoStep?: (value: number) => void;
11
+ progStep?: number;
12
+ stepCount?: number;
13
+ disableButtonConfig?: disableButtonConfigType;
14
+ };
15
+ export interface InterstitialScreenFooterProps {
16
+ /**
17
+ * Provide an optional class to be applied to the containing node.
18
+ */
19
+ className?: string;
20
+ /**
21
+ * The label for the Previous button.
22
+ */
23
+ previousButtonLabel?: string;
24
+ /**
25
+ * The label for the skip button.
26
+ */
27
+ skipButtonLabel?: string;
28
+ /**
29
+ * The label for the start button.
30
+ */
31
+ startButtonLabel?: string;
32
+ /**
33
+ * The label for the Next button.
34
+ */
35
+ nextButtonLabel?: string;
36
+ /**
37
+ * This is an optional callback prop that allows to render your custom footer action buttons.
38
+ * note: this is applicable when not using custom actionButtonRenderer
39
+ */
40
+ actionButtonRenderer?: (config: actionButtonRendererArgs) => React.ReactNode;
41
+ /**
42
+ * optional asynchronous callback on action button click
43
+ */
44
+ onAction?: (actionName: ActionType, config: actionButtonRendererArgs) => void;
45
+ }
46
+ declare const InterstitialScreenFooter: React.ForwardRefExoticComponent<InterstitialScreenFooterProps & React.RefAttributes<HTMLDivElement>>;
47
+ export default InterstitialScreenFooter;