@carbon/ibm-products 2.64.0 → 2.65.0-rc.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 +59 -143
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-full-carbon.min.css.map +1 -1
- package/css/index-without-carbon-released-only.css +8 -0
- 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 +59 -143
- 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 +59 -143
- 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/Checklist/Checklist.js +8 -7
- package/es/components/CoachmarkStack/CoachmarkStack.d.ts +5 -0
- package/es/components/CoachmarkStack/CoachmarkStack.js +9 -3
- package/es/components/CoachmarkStack/CoachmarkStackHome.d.ts +5 -0
- package/es/components/CoachmarkStack/CoachmarkStackHome.js +39 -6
- package/es/components/CreateFullPage/CreateFullPage.d.ts +1 -1
- package/es/components/CreateFullPage/CreateFullPage.js +23 -18
- package/es/components/Datagrid/Datagrid/DraggableElement.d.ts +3 -1
- package/es/components/Datagrid/Datagrid/DraggableElement.js +3 -1
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +3 -0
- package/es/components/InlineTip/InlineTip.js +3 -3
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +36 -59
- package/es/components/InterstitialScreen/InterstitialScreen.js +75 -271
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +27 -0
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +110 -0
- package/es/components/InterstitialScreen/InterstitialScreenFooter.d.ts +47 -0
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +184 -0
- package/es/components/InterstitialScreen/InterstitialScreenHeader.d.ts +35 -0
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +90 -0
- package/es/components/{InterstitialScreenView → InterstitialScreen/_story-assets/InterstitialScreenView}/InterstitialScreenView.d.ts +1 -0
- package/{lib/components → es/components/InterstitialScreen/_story-assets}/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +8 -0
- package/es/components/NotificationsPanel/NotificationsPanel.js +15 -10
- package/es/components/PageHeader/PageHeader.js +1 -1
- package/es/components/SidePanel/SidePanel.js +3 -2
- package/es/components/Tearsheet/Tearsheet.js +3 -2
- package/es/components/index.d.ts +0 -2
- package/es/global/js/hooks/useOverflowItems/useOverflowItems.d.ts +2 -2
- package/es/global/js/package-settings.d.ts +0 -2
- package/es/global/js/package-settings.js +0 -2
- package/es/index.js +0 -2
- package/es/settings.d.ts +0 -2
- package/lib/components/Checklist/Checklist.js +7 -6
- package/lib/components/CoachmarkStack/CoachmarkStack.d.ts +5 -0
- package/lib/components/CoachmarkStack/CoachmarkStack.js +9 -3
- package/lib/components/CoachmarkStack/CoachmarkStackHome.d.ts +5 -0
- package/lib/components/CoachmarkStack/CoachmarkStackHome.js +37 -4
- package/lib/components/CreateFullPage/CreateFullPage.d.ts +1 -1
- package/lib/components/CreateFullPage/CreateFullPage.js +22 -17
- package/lib/components/Datagrid/Datagrid/DraggableElement.d.ts +3 -1
- package/lib/components/Datagrid/Datagrid/DraggableElement.js +3 -1
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +3 -0
- package/lib/components/InlineTip/InlineTip.js +2 -2
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +36 -59
- package/lib/components/InterstitialScreen/InterstitialScreen.js +73 -267
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +27 -0
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +114 -0
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.d.ts +47 -0
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +188 -0
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.d.ts +35 -0
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +94 -0
- package/lib/components/{InterstitialScreenView → InterstitialScreen/_story-assets/InterstitialScreenView}/InterstitialScreenView.d.ts +1 -0
- package/{es/components → lib/components/InterstitialScreen/_story-assets}/InterstitialScreenViewModule/InterstitialScreenViewModule.d.ts +8 -0
- package/lib/components/NotificationsPanel/NotificationsPanel.js +14 -9
- package/lib/components/PageHeader/PageHeader.js +1 -1
- package/lib/components/SidePanel/SidePanel.js +3 -2
- package/lib/components/Tearsheet/Tearsheet.js +3 -2
- package/lib/components/index.d.ts +0 -2
- package/lib/global/js/hooks/useOverflowItems/useOverflowItems.d.ts +2 -2
- package/lib/global/js/package-settings.d.ts +0 -2
- package/lib/global/js/package-settings.js +0 -2
- package/lib/index.js +0 -10
- package/lib/settings.d.ts +0 -2
- package/package.json +7 -7
- package/scss/components/Coachmark/_coachmark-overlay.scss +2 -0
- package/scss/components/CoachmarkOverlayElements/_coachmark-overlay-elements.scss +1 -0
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +25 -0
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +29 -137
- package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -0
- package/scss/components/PageHeader/_page-header.scss +5 -0
- package/scss/components/_index-with-carbon.scss +0 -2
- package/scss/components/_index.scss +0 -2
- package/telemetry.yml +17 -8
- package/es/components/InterstitialScreenView/InterstitialScreenView.js +0 -78
- package/es/components/InterstitialScreenView/index.d.ts +0 -8
- package/es/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +0 -81
- package/es/components/InterstitialScreenViewModule/index.d.ts +0 -8
- package/lib/components/InterstitialScreenView/InterstitialScreenView.js +0 -78
- package/lib/components/InterstitialScreenView/index.d.ts +0 -8
- package/lib/components/InterstitialScreenViewModule/InterstitialScreenViewModule.js +0 -81
- package/lib/components/InterstitialScreenViewModule/index.d.ts +0 -8
- package/scss/components/InterstitialScreenView/_carbon-imports.scss +0 -9
- package/scss/components/InterstitialScreenView/_index-with-carbon.scss +0 -9
- package/scss/components/InterstitialScreenView/_index.scss +0 -8
- package/scss/components/InterstitialScreenView/_interstitial-screen-view.scss +0 -25
- package/scss/components/InterstitialScreenViewModule/_carbon-imports.scss +0 -9
- package/scss/components/InterstitialScreenViewModule/_index-with-carbon.scss +0 -9
- package/scss/components/InterstitialScreenViewModule/_index.scss +0 -8
- package/scss/components/InterstitialScreenViewModule/_interstitial-screen-view-module.scss +0 -59
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, defineProperty as _defineProperty } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import { IconButton, Button } from '@carbon/react';
|
9
|
+
import { Section, Heading, IconButton, Button } from '@carbon/react';
|
10
10
|
import { Themes, Kinds } from './Checklist.types.js';
|
11
11
|
import React__default, { useState, useRef, useEffect } from 'react';
|
12
12
|
import { ChecklistChart } from './ChecklistChart.js';
|
@@ -112,8 +112,9 @@ var Checklist = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
112
112
|
useEffect(function () {
|
113
113
|
setIsOpen(open);
|
114
114
|
}, [open]);
|
115
|
-
return /*#__PURE__*/React__default.createElement(
|
115
|
+
return /*#__PURE__*/React__default.createElement(Section, _extends({}, rest, {
|
116
116
|
"aria-label": checklistAriaLabel,
|
117
|
+
as: "aside",
|
117
118
|
className: cx(blockClass,
|
118
119
|
// Apply the block class to the main HTML element
|
119
120
|
className, // Apply any supplied class names to the main HTML element.
|
@@ -128,9 +129,9 @@ var Checklist = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
128
129
|
value: chartValue
|
129
130
|
}), /*#__PURE__*/React__default.createElement("div", {
|
130
131
|
className: "".concat(blockClass, "__titles")
|
131
|
-
}, title && /*#__PURE__*/React__default.createElement(
|
132
|
+
}, title && /*#__PURE__*/React__default.createElement(Heading, {
|
132
133
|
className: "".concat(blockClass, "__title")
|
133
|
-
}, title), chartLabelAndValue && /*#__PURE__*/React__default.createElement("
|
134
|
+
}, title), chartLabelAndValue && /*#__PURE__*/React__default.createElement("p", {
|
134
135
|
id: chartLabelId,
|
135
136
|
className: "".concat(blockClass, "__chart-label")
|
136
137
|
}, chartLabel)), enableToggle && /*#__PURE__*/React__default.createElement(IconButton, {
|
@@ -151,13 +152,13 @@ var Checklist = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
151
152
|
className: "".concat(blockClass, "__content-outer")
|
152
153
|
}, /*#__PURE__*/React__default.createElement("div", {
|
153
154
|
className: "".concat(blockClass, "__content-inner")
|
154
|
-
}, /*#__PURE__*/React__default.createElement("
|
155
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
155
156
|
className: cx("".concat(blockClass, "__body"))
|
156
157
|
}, taskLists.map(function (list, index) {
|
157
|
-
return /*#__PURE__*/React__default.createElement(
|
158
|
+
return /*#__PURE__*/React__default.createElement(Section, {
|
158
159
|
className: "".concat(blockClass, "__list-group"),
|
159
160
|
key: "".concat(list.title, "-").concat(index)
|
160
|
-
}, list.title && /*#__PURE__*/React__default.createElement(
|
161
|
+
}, list.title && /*#__PURE__*/React__default.createElement(Heading, {
|
161
162
|
title: list.title,
|
162
163
|
className: "".concat(blockClass, "__list-title")
|
163
164
|
}, list.title), /*#__PURE__*/React__default.createElement("ol", {
|
@@ -5,6 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { ReactNode } from 'react';
|
8
|
+
type TooltipAlignment = 'top' | 'bottom';
|
8
9
|
interface CoachmarkStackProps {
|
9
10
|
/**
|
10
11
|
* CoachmarkStack should use a single CoachmarkOverlayElements component as a child.
|
@@ -51,6 +52,10 @@ interface CoachmarkStackProps {
|
|
51
52
|
* The title of the Coachmark.
|
52
53
|
*/
|
53
54
|
title: string;
|
55
|
+
/**
|
56
|
+
* Label's tooltip position
|
57
|
+
*/
|
58
|
+
tooltipAlign?: TooltipAlignment;
|
54
59
|
}
|
55
60
|
/**
|
56
61
|
* Stacked coachmarks are used to call out specific functionality or concepts
|
@@ -19,7 +19,7 @@ import { CoachmarkContext } from '../Coachmark/utils/context.js';
|
|
19
19
|
import { COACHMARK_OVERLAY_KIND } from '../Coachmark/utils/enums.js';
|
20
20
|
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
21
21
|
|
22
|
-
var _excluded = ["children", "className", "onClose", "description", "renderMedia", "navLinkLabels", "portalTarget", "closeButtonLabel", "tagline", "theme", "title"];
|
22
|
+
var _excluded = ["children", "className", "onClose", "description", "renderMedia", "navLinkLabels", "portalTarget", "closeButtonLabel", "tagline", "theme", "title", "tooltipAlign"];
|
23
23
|
|
24
24
|
// Carbon and package components we use.
|
25
25
|
/* TODO: @import(s) of carbon components and other package components. */
|
@@ -63,6 +63,7 @@ var CoachmarkStack = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
63
63
|
_ref$theme = _ref.theme,
|
64
64
|
theme = _ref$theme === void 0 ? defaults.theme : _ref$theme,
|
65
65
|
title = _ref.title,
|
66
|
+
tooltipAlign = _ref.tooltipAlign,
|
66
67
|
rest = _objectWithoutProperties(_ref, _excluded);
|
67
68
|
var portalNode = useRef(null);
|
68
69
|
useIsomorphicEffect(function () {
|
@@ -220,7 +221,8 @@ var CoachmarkStack = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
220
221
|
},
|
221
222
|
portalTarget: portalTarget,
|
222
223
|
closeButtonLabel: closeButtonLabel,
|
223
|
-
title: title
|
224
|
+
title: title,
|
225
|
+
tooltipAlign: tooltipAlign
|
224
226
|
}), portalNode !== null && portalNode !== void 0 && portalNode.current ? /*#__PURE__*/createPortal(wrappedChildren, portalNode === null || portalNode === void 0 ? void 0 : portalNode.current) : null));
|
225
227
|
});
|
226
228
|
|
@@ -280,7 +282,11 @@ CoachmarkStack.propTypes = {
|
|
280
282
|
/**
|
281
283
|
* The title of the Coachmark.
|
282
284
|
*/
|
283
|
-
title: PropTypes.string.isRequired
|
285
|
+
title: PropTypes.string.isRequired,
|
286
|
+
/**
|
287
|
+
* Label's tooltip position
|
288
|
+
*/
|
289
|
+
tooltipAlign: PropTypes.oneOf(['top', 'bottom'])
|
284
290
|
};
|
285
291
|
|
286
292
|
export { CoachmarkStack };
|
@@ -5,6 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
import React, { ReactNode } from 'react';
|
8
|
+
type TooltipAlignment = 'top' | 'bottom';
|
8
9
|
interface CoachmarkStackHomeProps {
|
9
10
|
/**
|
10
11
|
* Optional class name for this component.
|
@@ -53,6 +54,10 @@ interface CoachmarkStackHomeProps {
|
|
53
54
|
* The title of the Coachmark.
|
54
55
|
*/
|
55
56
|
title: string;
|
57
|
+
/**
|
58
|
+
* Label's tooltip position
|
59
|
+
*/
|
60
|
+
tooltipAlign?: TooltipAlignment;
|
56
61
|
}
|
57
62
|
/**
|
58
63
|
* DO NOT USE. This component is for the exclusive use
|
@@ -5,20 +5,20 @@
|
|
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 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
8
|
+
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends, toConsumableArray as _toConsumableArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import React__default, { forwardRef, useRef, useState, useEffect } from 'react';
|
10
10
|
import pconsole from '../../global/js/utils/pconsole.js';
|
11
11
|
import PropTypes from '../../_virtual/index.js';
|
12
12
|
import cx from 'classnames';
|
13
13
|
import { Idea } from '@carbon/react/icons';
|
14
|
-
import { Button } from '@carbon/react';
|
14
|
+
import { Button, Tooltip } from '@carbon/react';
|
15
15
|
import { getDevtoolsProps } from '../../global/js/utils/devtools.js';
|
16
16
|
import { pkg } from '../../settings.js';
|
17
17
|
import { createPortal } from 'react-dom';
|
18
18
|
import { CoachmarkHeader } from '../Coachmark/CoachmarkHeader.js';
|
19
19
|
import { useIsomorphicEffect } from '../../global/js/hooks/useIsomorphicEffect.js';
|
20
20
|
|
21
|
-
var _excluded = ["className", "description", "isOpen", "renderMedia", "navLinkLabels", "onClickNavItem", "onClose", "portalTarget", "closeButtonLabel", "title"];
|
21
|
+
var _excluded = ["className", "description", "isOpen", "renderMedia", "navLinkLabels", "onClickNavItem", "onClose", "portalTarget", "closeButtonLabel", "title", "tooltipAlign"];
|
22
22
|
// Carbon and package components we use.
|
23
23
|
/* TODO: @import(s) of carbon components and other package components. */
|
24
24
|
|
@@ -42,12 +42,18 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
42
42
|
portalTarget = _ref.portalTarget,
|
43
43
|
closeButtonLabel = _ref.closeButtonLabel,
|
44
44
|
title = _ref.title,
|
45
|
+
tooltipAlign = _ref.tooltipAlign,
|
45
46
|
rest = _objectWithoutProperties(_ref, _excluded);
|
46
47
|
var buttonFocusRef = useRef(null);
|
47
48
|
var _useState = useState(0),
|
48
49
|
_useState2 = _slicedToArray(_useState, 2),
|
49
50
|
linkFocusIndex = _useState2[0],
|
50
51
|
setLinkFocusIndex = _useState2[1];
|
52
|
+
var navItemRefs = useRef([]);
|
53
|
+
var _useState3 = useState([]),
|
54
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
55
|
+
overflowStates = _useState4[0],
|
56
|
+
setOverflowStates = _useState4[1];
|
51
57
|
useEffect(function () {
|
52
58
|
setTimeout(function () {
|
53
59
|
if (isOpen && buttonFocusRef.current) {
|
@@ -63,10 +69,26 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
63
69
|
if (!navLinkLabels) {
|
64
70
|
return pconsole.warn("".concat(componentName, " is an Onboarding internal component and is not intended for general use."));
|
65
71
|
}
|
72
|
+
var itemRefHandler = function itemRefHandler(index, node) {
|
73
|
+
if (node && navItemRefs.current[index] !== node) {
|
74
|
+
var isOverflowing = node.scrollWidth > node.clientWidth;
|
75
|
+
navItemRefs.current[index] = node;
|
76
|
+
setOverflowStates(function (prev) {
|
77
|
+
var newState = _toConsumableArray(prev);
|
78
|
+
newState[index] = isOverflowing;
|
79
|
+
return newState;
|
80
|
+
});
|
81
|
+
}
|
82
|
+
};
|
66
83
|
function renderNavLink(index, label) {
|
84
|
+
var _overflowStates$index;
|
67
85
|
var ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
86
|
+
var isOverflowing = (_overflowStates$index = overflowStates[index]) !== null && _overflowStates$index !== void 0 ? _overflowStates$index : false;
|
68
87
|
return /*#__PURE__*/React__default.createElement("li", {
|
69
|
-
key: index
|
88
|
+
key: index,
|
89
|
+
ref: function ref(node) {
|
90
|
+
itemRefHandler(index, node);
|
91
|
+
}
|
70
92
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
71
93
|
kind: "ghost",
|
72
94
|
size: "sm",
|
@@ -75,7 +97,14 @@ var CoachmarkStackHome = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
75
97
|
onClickNavItem(index + 1);
|
76
98
|
},
|
77
99
|
ref: ref
|
78
|
-
},
|
100
|
+
}, isOverflowing ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
101
|
+
highContrast: false,
|
102
|
+
label: label,
|
103
|
+
align: tooltipAlign,
|
104
|
+
className: "".concat(blockClass, "__navLinkLabels-tooltip")
|
105
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
106
|
+
className: "".concat(blockClass, "__navLinkLabels-text")
|
107
|
+
}, label)) : label));
|
79
108
|
}
|
80
109
|
return portalNode !== null && portalNode !== void 0 && portalNode.current ? /*#__PURE__*/createPortal(/*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
81
110
|
className: cx(blockClass, className),
|
@@ -177,7 +206,11 @@ CoachmarkStackHome.propTypes = {
|
|
177
206
|
/**
|
178
207
|
* The title of the Coachmark.
|
179
208
|
*/
|
180
|
-
title: PropTypes.string.isRequired
|
209
|
+
title: PropTypes.string.isRequired,
|
210
|
+
/**
|
211
|
+
* Label's tooltip position
|
212
|
+
*/
|
213
|
+
tooltipAlign: PropTypes.oneOf(['top', 'bottom'])
|
181
214
|
};
|
182
215
|
|
183
216
|
export { CoachmarkStackHome };
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
9
|
import { Tooltip, Form, ComposedModal, ModalHeader, ModalBody, ModalFooter, Button } from '@carbon/react';
|
10
|
-
import React__default, { useState, useEffect, createContext } from 'react';
|
10
|
+
import React__default, { useState, useRef, useEffect, createContext } from 'react';
|
11
11
|
import { overflowAriaLabel_required_if_breadcrumbs_exist, SimpleHeader } from '../SimpleHeader/SimpleHeader.js';
|
12
12
|
import { ActionSet } from '../ActionSet/ActionSet.js';
|
13
13
|
import PropTypes from '../../_virtual/index.js';
|
@@ -19,7 +19,6 @@ import { pkg } from '../../settings.js';
|
|
19
19
|
import { usePreviousValue } from '../../global/js/hooks/usePreviousValue.js';
|
20
20
|
import { useCreateComponentFocus } from '../../global/js/hooks/useCreateComponentFocus.js';
|
21
21
|
import { useValidCreateStepCount } from '../../global/js/hooks/useValidCreateStepCount.js';
|
22
|
-
import { useResetCreateComponent } from '../../global/js/hooks/useResetCreateComponent.js';
|
23
22
|
import { useCreateComponentStepChange } from '../../global/js/hooks/useCreateComponentStepChange.js';
|
24
23
|
import { CreateInfluencer } from '../CreateInfluencer/CreateInfluencer.js';
|
25
24
|
|
@@ -93,8 +92,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
93
92
|
modalIsOpen = _useState10[0],
|
94
93
|
setModalIsOpen = _useState10[1];
|
95
94
|
var previousState = usePreviousValue({
|
96
|
-
currentStep: currentStep
|
97
|
-
open: open
|
95
|
+
currentStep: currentStep
|
98
96
|
});
|
99
97
|
var _useState11 = useState(false),
|
100
98
|
_useState12 = _slicedToArray(_useState11, 2),
|
@@ -124,6 +122,7 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
124
122
|
_useState24 = _slicedToArray(_useState23, 2),
|
125
123
|
lastIncludedStep = _useState24[0],
|
126
124
|
setLastIncludedStep = _useState24[1];
|
125
|
+
var invalidInitialStepWarned = useRef(false);
|
127
126
|
useEffect(function () {
|
128
127
|
var firstItem = stepData.findIndex(function (item) {
|
129
128
|
return item === null || item === void 0 ? void 0 : item.shouldIncludeStep;
|
@@ -137,11 +136,18 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
137
136
|
}
|
138
137
|
|
139
138
|
/**@ts-ignore */
|
140
|
-
if (
|
139
|
+
if (initialStep) {
|
141
140
|
var numberOfHiddenSteps = getNumberOfHiddenSteps(stepData, initialStep);
|
142
141
|
setCurrentStep(Number(initialStep + numberOfHiddenSteps));
|
143
142
|
}
|
144
143
|
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep, modalIsOpen]);
|
144
|
+
useEffect(function () {
|
145
|
+
if (!(invalidInitialStepWarned !== null && invalidInitialStepWarned !== void 0 && invalidInitialStepWarned.current)) {
|
146
|
+
checkForValidInitialStep();
|
147
|
+
}
|
148
|
+
|
149
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
150
|
+
}, [initialStep, stepData]);
|
145
151
|
useCreateComponentFocus({
|
146
152
|
previousState: previousState,
|
147
153
|
currentStep: currentStep,
|
@@ -150,17 +156,6 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
150
156
|
firstFocusElement: firstFocusElement
|
151
157
|
});
|
152
158
|
useValidCreateStepCount(stepData.length, componentName);
|
153
|
-
useResetCreateComponent({
|
154
|
-
firstIncludedStep: firstIncludedStep,
|
155
|
-
previousState: previousState,
|
156
|
-
open: true,
|
157
|
-
setCurrentStep: setCurrentStep,
|
158
|
-
stepData: stepData,
|
159
|
-
/**@ts-ignore */
|
160
|
-
initialStep: initialStep,
|
161
|
-
totalSteps: stepData === null || stepData === void 0 ? void 0 : stepData.length,
|
162
|
-
componentName: componentName
|
163
|
-
});
|
164
159
|
useCreateComponentStepChange({
|
165
160
|
firstIncludedStep: firstIncludedStep,
|
166
161
|
lastIncludedStep: lastIncludedStep,
|
@@ -183,6 +178,15 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
183
178
|
setCreateComponentActions: setCreateFullPageActions,
|
184
179
|
setModalIsOpen: setModalIsOpen
|
185
180
|
});
|
181
|
+
var checkForValidInitialStep = function checkForValidInitialStep() {
|
182
|
+
// An invalid initialStep value was provided, we'll default to rendering the first step or last step
|
183
|
+
|
184
|
+
if (initialStep && stepData !== null && stepData !== void 0 && stepData.length && Number(initialStep) > Number(stepData === null || stepData === void 0 ? void 0 : stepData.length) || Number(initialStep) <= 0) {
|
185
|
+
invalidInitialStepWarned.current = true;
|
186
|
+
setCurrentStep(1);
|
187
|
+
console.warn("".concat(componentName, ": An invalid `initialStep` prop was supplied. The `initialStep` prop should be a number that is greater than 0 or less than or equal to the number of steps your ").concat(componentName, " has."));
|
188
|
+
}
|
189
|
+
};
|
186
190
|
// currently, we are not supporting the use of 'view all' toggle state
|
187
191
|
/* istanbul ignore next */
|
188
192
|
return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
|
@@ -236,9 +240,10 @@ var CreateFullPage = /*#__PURE__*/React__default.forwardRef(function (_ref, ref)
|
|
236
240
|
setStepData: setStepData,
|
237
241
|
stepData: stepData
|
238
242
|
}
|
239
|
-
}, React__default.Children.map(
|
243
|
+
}, React__default.Children.toArray(children).filter(Boolean).map(function (child, index) {
|
240
244
|
return /*#__PURE__*/React__default.createElement(StepNumberContext.Provider, {
|
241
|
-
value: index + 1
|
245
|
+
value: index + 1,
|
246
|
+
key: index
|
242
247
|
}, child);
|
243
248
|
})))), /*#__PURE__*/React__default.createElement(ActionSet, {
|
244
249
|
className: "".concat(blockClass, "__buttons"),
|
@@ -11,16 +11,18 @@ interface DraggableElementProps extends PropsWithChildren {
|
|
11
11
|
classList?: string;
|
12
12
|
disabled?: boolean;
|
13
13
|
id: string;
|
14
|
+
elementId?: string;
|
14
15
|
isSticky?: boolean;
|
15
16
|
selected?: boolean;
|
16
17
|
}
|
17
18
|
declare const DraggableElement: {
|
18
|
-
({ id, children, classList, disabled, ariaLabel, isSticky, selected, }: DraggableElementProps): React.JSX.Element;
|
19
|
+
({ id, elementId, children, classList, disabled, ariaLabel, isSticky, selected, }: DraggableElementProps): React.JSX.Element;
|
19
20
|
propTypes: {
|
20
21
|
ariaLabel: any;
|
21
22
|
children: any;
|
22
23
|
classList: any;
|
23
24
|
disabled: any;
|
25
|
+
elementId: any;
|
24
26
|
id: any;
|
25
27
|
isSticky: any;
|
26
28
|
selected: any;
|
@@ -18,6 +18,7 @@ var _Locked, _DraggableIcon;
|
|
18
18
|
var blockClass = "".concat(pkg.prefix, "--datagrid");
|
19
19
|
var DraggableElement = function DraggableElement(_ref) {
|
20
20
|
var id = _ref.id,
|
21
|
+
elementId = _ref.elementId,
|
21
22
|
children = _ref.children,
|
22
23
|
classList = _ref.classList,
|
23
24
|
disabled = _ref.disabled,
|
@@ -49,7 +50,7 @@ var DraggableElement = function DraggableElement(_ref) {
|
|
49
50
|
};
|
50
51
|
return /*#__PURE__*/React__default.createElement("li", _extends({
|
51
52
|
className: cx(classList, "".concat(blockClass, "__draggable-handleHolder"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(blockClass, "__draggable-handleHolder--selected"), selected), "".concat(blockClass, "__draggable-handleHolder--sticky"), isSticky), "".concat(blockClass, "__draggable-handleHolder--dragging"), isDragging)),
|
52
|
-
id: id,
|
53
|
+
id: elementId ? elementId : id,
|
53
54
|
ref: setNodeRef,
|
54
55
|
style: style
|
55
56
|
}, attributes, listeners, {
|
@@ -67,6 +68,7 @@ DraggableElement.propTypes = {
|
|
67
68
|
children: PropTypes.element.isRequired,
|
68
69
|
classList: PropTypes.string,
|
69
70
|
disabled: PropTypes.bool,
|
71
|
+
elementId: PropTypes.string,
|
70
72
|
id: PropTypes.string.isRequired,
|
71
73
|
isSticky: PropTypes.bool,
|
72
74
|
selected: PropTypes.bool
|
@@ -10,6 +10,7 @@ import React__default from 'react';
|
|
10
10
|
import { p as propTypesExports } from '../../../../../_virtual/index.js';
|
11
11
|
import { Checkbox } from '@carbon/react';
|
12
12
|
import { isColumnVisible } from './common.js';
|
13
|
+
import { useId } from '../../../../../global/js/utils/useId.js';
|
13
14
|
import DraggableElement from '../../DraggableElement.js';
|
14
15
|
import { pkg } from '../../../../../settings.js';
|
15
16
|
import { getNodeTextContent as _getNodeTextContent } from '../../../../../global/js/utils/getNodeTextContent.js';
|
@@ -29,6 +30,7 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
29
30
|
onSelectColumn = _ref.onSelectColumn,
|
30
31
|
setAriaRegionText = _ref.setAriaRegionText;
|
31
32
|
var draggableClass = "".concat(blockClass, "__draggable-item");
|
33
|
+
var generatedId = useId();
|
32
34
|
var visibleCols = columns
|
33
35
|
// hide the columns without Header, e.g the sticky actions, spacer
|
34
36
|
.filter(function (colDef) {
|
@@ -192,6 +194,7 @@ var DraggableItemsList = function DraggableItemsList(_ref) {
|
|
192
194
|
classList: draggableClass,
|
193
195
|
key: colDef.id,
|
194
196
|
id: colDef.id,
|
197
|
+
elementId: "".concat(colDef.id, "-").concat(generatedId),
|
195
198
|
disabled: filterString.length > 0 || isFrozenColumn,
|
196
199
|
ariaLabel: colHeaderTitle,
|
197
200
|
isSticky: isFrozenColumn,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
*/
|
7
7
|
|
8
8
|
import { objectWithoutProperties as _objectWithoutProperties, slicedToArray as _slicedToArray, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
9
|
-
import { IconButton, Button } from '@carbon/react';
|
9
|
+
import { Section, IconButton, Heading, Button } from '@carbon/react';
|
10
10
|
import { Close, Idea, Crossroads } from '@carbon/react/icons';
|
11
11
|
import React__default, { useState, useRef, useMemo, useEffect } from 'react';
|
12
12
|
import PropTypes from '../../_virtual/index.js';
|
@@ -82,7 +82,7 @@ var InlineTip = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
82
82
|
useEffect(function () {
|
83
83
|
setIsCollapsed(collapsible);
|
84
84
|
}, [collapsible]);
|
85
|
-
return /*#__PURE__*/React__default.createElement(
|
85
|
+
return /*#__PURE__*/React__default.createElement(Section, _extends({}, rest, {
|
86
86
|
"aria-labelledby": labelId,
|
87
87
|
className: cx(blockClass, className, collapsible && "".concat(blockClass, "__collapsible"), isCollapsed && "".concat(blockClass, "__collapsible-collapsed"), renderMedia && "".concat(blockClass, "__has-media"), [narrow ? "".concat(blockClass, "__narrow") : "".concat(blockClass, "__wide")], withLeftGutter && !narrow && "".concat(blockClass, "__with-left-gutter")),
|
88
88
|
ref: ref,
|
@@ -104,7 +104,7 @@ var InlineTip = /*#__PURE__*/React__default.forwardRef(function (_ref, ref) {
|
|
104
104
|
size: 16
|
105
105
|
}))), /*#__PURE__*/React__default.createElement("div", {
|
106
106
|
className: "".concat(blockClass, "__content")
|
107
|
-
}, /*#__PURE__*/React__default.createElement(
|
107
|
+
}, /*#__PURE__*/React__default.createElement(Heading, {
|
108
108
|
id: labelId,
|
109
109
|
className: "".concat(blockClass, "__title")
|
110
110
|
}, title), /*#__PURE__*/React__default.createElement("section", {
|
@@ -1,15 +1,15 @@
|
|
1
1
|
/**
|
2
|
-
* Copyright IBM Corp. 2024,
|
2
|
+
* Copyright IBM Corp. 2024, 2025
|
3
3
|
*
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
|
-
import React, {
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
export interface InterstitialScreenProps
|
7
|
+
import React, { ReactNode, RefObject } from 'react';
|
8
|
+
import { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
|
9
|
+
import { InterstitialScreenBodyProps } from './InterstitialScreenBody';
|
10
|
+
import { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
|
11
|
+
export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next';
|
12
|
+
export interface InterstitialScreenProps {
|
13
13
|
/**
|
14
14
|
* Provide the contents of the InterstitialScreen.
|
15
15
|
*/
|
@@ -18,26 +18,6 @@ export interface InterstitialScreenProps extends PropsWithChildren {
|
|
18
18
|
* Provide an optional class to be applied to the containing node.
|
19
19
|
*/
|
20
20
|
className?: string;
|
21
|
-
/**
|
22
|
-
* Tooltip text and aria label for the Close button icon.
|
23
|
-
*/
|
24
|
-
closeIconDescription?: string;
|
25
|
-
/**
|
26
|
-
* The domain this app belongs to, e.g. "IBM Cloud Pak".
|
27
|
-
*/
|
28
|
-
domainName?: string;
|
29
|
-
/**
|
30
|
-
* Provide an optional class to be applied to the <header> element >.
|
31
|
-
*/
|
32
|
-
headerClassName?: string;
|
33
|
-
/**
|
34
|
-
* Provide an optional class to be applied to the <header> element >.
|
35
|
-
*/
|
36
|
-
headerTitle?: string;
|
37
|
-
/**
|
38
|
-
* Optional parameter to hide the progress indicator when multiple steps are used.
|
39
|
-
*/
|
40
|
-
hideProgressIndicator?: boolean;
|
41
21
|
/**
|
42
22
|
* The aria label applied to the Interstitial Screen component
|
43
23
|
*/
|
@@ -51,46 +31,43 @@ export interface InterstitialScreenProps extends PropsWithChildren {
|
|
51
31
|
* Specifies whether the component is currently open.
|
52
32
|
*/
|
53
33
|
isOpen?: boolean;
|
54
|
-
/**
|
55
|
-
* Optional prop to render any media like images or any animated media.
|
56
|
-
*/
|
57
|
-
renderMedia?: (params: any) => ReactNode;
|
58
|
-
/**
|
59
|
-
* optional prop to specify breakpoints when media is rendered through renderMedia
|
60
|
-
* Breakpoints are used to set the media content column size as well as the remainder for the main content areas column size.
|
61
|
-
* Medium and small breakpoints will be set to 0 internally to focus on the main content area.
|
62
|
-
*/
|
63
|
-
breakpointsWithMedia?: BreakpointsWithMedia;
|
64
|
-
/**
|
65
|
-
* The label for the Next button.
|
66
|
-
*/
|
67
|
-
nextButtonLabel?: string;
|
68
34
|
/**
|
69
35
|
* Function to call when the close button is clicked.
|
70
36
|
*/
|
71
|
-
onClose?: () => void;
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
37
|
+
onClose?: (value: ActionType) => void;
|
38
|
+
}
|
39
|
+
type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & {
|
40
|
+
Header: React.FC<InterstitialScreenHeaderProps>;
|
41
|
+
Body: React.FC<InterstitialScreenBodyProps>;
|
42
|
+
Footer: React.FC<InterstitialScreenFooterProps>;
|
43
|
+
};
|
44
|
+
export type disableButtonConfigType = {
|
45
|
+
skip?: boolean;
|
46
|
+
back?: boolean;
|
47
|
+
next?: boolean;
|
48
|
+
start?: boolean;
|
49
|
+
};
|
50
|
+
interface InterstitialScreenContextType {
|
51
|
+
bodyChildrenData?: ReactNode;
|
52
|
+
setBodyChildrenData?: (value: ReactNode) => void;
|
53
|
+
isFullScreen?: boolean;
|
54
|
+
handleClose?: (value: ActionType) => void;
|
55
|
+
progStep: number;
|
56
|
+
setProgStep?: (value: number) => void;
|
57
|
+
bodyScrollRef?: RefObject<HTMLDivElement | null>;
|
58
|
+
scrollRef?: RefObject<HTMLDivElement>;
|
59
|
+
handleGotoStep?: (value: number) => void;
|
60
|
+
stepCount: number;
|
61
|
+
setStepCount?: (value: number) => void;
|
62
|
+
disableButtonConfig?: disableButtonConfigType;
|
63
|
+
setDisableButtonConfig?: (value: disableButtonConfigType) => void;
|
88
64
|
}
|
65
|
+
export declare const InterstitialScreenContext: React.Context<InterstitialScreenContextType>;
|
89
66
|
/**
|
90
67
|
* InterstitialScreen can be a full page or an overlay, and are
|
91
68
|
* shown on the first time a user accesses a new experience
|
92
69
|
* (e.g. upon first login or first time opening a page where a
|
93
70
|
* newly purchased capability is presented).
|
94
71
|
*/
|
95
|
-
export declare let InterstitialScreen:
|
72
|
+
export declare let InterstitialScreen: InterstitialScreenComponent;
|
96
73
|
export {};
|