@carbon/ibm-products 2.70.1 → 2.71.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/carbon.css +317 -216
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +546 -270
- 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 +387 -43
- 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 +229 -54
- 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 +242 -56
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/css/index.min.css.map +1 -1
- package/es/_virtual/_commonjsHelpers.js +1 -3
- package/es/_virtual/index2.js +2 -6
- package/es/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/es/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/es/components/APIKeyModal/APIKeyModal.js +1 -1
- package/es/components/ActionSet/ActionSet.d.ts +4 -0
- package/es/components/ActionSet/ActionSet.js +46 -44
- package/es/components/AddSelect/AddSelectBody.js +1 -1
- package/es/components/Card/Card.d.ts +1 -0
- package/es/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/es/components/Coachmark/CoachmarkTagline.js +2 -2
- package/es/components/Coachmark/utils/context.d.ts +28 -2
- package/es/components/Coachmark/utils/context.js +1 -1
- package/es/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/es/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/es/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/es/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/es/components/ConditionBuilder/utils/util.js +11 -4
- package/es/components/CreateModal/CreateModal.d.ts +4 -7
- package/es/components/CreateModal/CreateModal.js +4 -19
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/es/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/es/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/es/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/es/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/es/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/es/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/es/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/es/components/EmptyStates/EmptyState.js +0 -1
- package/es/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/es/components/FilterSummary/FilterSummary.js +2 -1
- package/es/components/Guidebanner/Guidebanner.js +4 -20
- package/es/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/es/components/InterstitialScreen/InterstitialScreen.js +21 -21
- package/es/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/es/components/InterstitialScreen/InterstitialScreenBody.js +16 -11
- package/es/components/InterstitialScreen/InterstitialScreenFooter.js +15 -13
- package/es/components/InterstitialScreen/InterstitialScreenHeader.js +13 -8
- package/es/components/InterstitialScreen/index.d.ts +4 -1
- package/es/components/Nav/NavItemLink.js +1 -4
- package/es/components/PageHeader/PageHeaderTitle.js +1 -1
- package/es/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/es/components/PageHeader/next/PageHeader.js +475 -0
- package/es/components/PageHeader/next/index.d.ts +8 -0
- package/es/components/ScrollGradient/ScrollGradient.js +4 -4
- package/es/components/SidePanel/SidePanel.js +25 -20
- package/es/components/StringFormatter/StringFormatter.js +3 -0
- package/es/components/Tearsheet/Tearsheet.js +4 -7
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/es/components/Tearsheet/TearsheetShell.js +1 -1
- package/es/components/UserAvatar/UserAvatar.js +5 -7
- package/es/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/es/components/UserProfileImage/UserProfileImage.js +12 -6
- package/es/components/index.d.ts +1 -0
- package/es/global/js/package-settings.js +1 -1
- package/es/index.js +3 -0
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/es/node_modules/prop-types/index.js +1 -1
- package/lib/_virtual/_commonjsHelpers.js +0 -3
- package/lib/_virtual/index2.js +2 -8
- package/lib/components/APIKeyModal/APIKeyDownloader.d.ts +61 -19
- package/lib/components/APIKeyModal/APIKeyDownloader.js +3 -3
- package/lib/components/APIKeyModal/APIKeyModal.js +1 -1
- package/lib/components/ActionSet/ActionSet.d.ts +4 -0
- package/lib/components/ActionSet/ActionSet.js +46 -43
- package/lib/components/AddSelect/AddSelectBody.js +1 -1
- package/lib/components/Card/Card.d.ts +1 -0
- package/lib/components/Coachmark/CoachmarkOverlay.js +5 -5
- package/lib/components/Coachmark/CoachmarkTagline.js +2 -2
- package/lib/components/Coachmark/utils/context.d.ts +28 -2
- package/lib/components/Coachmark/utils/context.js +1 -1
- package/lib/components/CoachmarkStack/CoachmarkStack.js +11 -8
- package/lib/components/ConditionBuilder/ConditionBlock/ConditionBlock.js +18 -12
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.d.ts +1 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItem.js +5 -3
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOption.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.d.ts +2 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemOption/ItemOptionForValueField.js +5 -2
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.d.ts +9 -1
- package/lib/components/ConditionBuilder/ConditionBuilderItem/ConditionBuilderItemTime/ConditionBuilderItemTime.js +24 -5
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/handleKeyboardEvents.js +6 -4
- package/lib/components/ConditionBuilder/utils/util.d.ts +1 -1
- package/lib/components/ConditionBuilder/utils/util.js +11 -4
- package/lib/components/CreateModal/CreateModal.d.ts +4 -7
- package/lib/components/CreateModal/CreateModal.js +4 -19
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +6 -0
- package/lib/components/Datagrid/Datagrid/addons/CustomizeColumns/DraggableItemsList.js +12 -3
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.d.ts +43 -18
- package/lib/components/Datagrid/Datagrid/addons/Filtering/FilterProvider.js +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.d.ts +1 -1
- package/lib/components/Datagrid/Datagrid/addons/Filtering/hooks/useFilterContext.js +2 -2
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.d.ts +7 -1
- package/lib/components/Datagrid/Datagrid/addons/InlineEdit/InlineEditContext/InlineEditContext.js +11 -3
- package/lib/components/Datagrid/Datagrid/addons/RowSize/RowSizeRadioGroup.js +15 -19
- package/lib/components/EditTearsheet/EditTearsheetForm.d.ts +2 -0
- package/lib/components/EditTearsheet/EditTearsheetForm.js +16 -4
- package/lib/components/EmptyStates/EmptyState.js +0 -1
- package/lib/components/FilterSummary/FilterSummary.d.ts +1 -0
- package/lib/components/FilterSummary/FilterSummary.js +2 -1
- package/lib/components/Guidebanner/Guidebanner.js +4 -20
- package/lib/components/InterstitialScreen/InterstitialScreen.d.ts +4 -3
- package/lib/components/InterstitialScreen/InterstitialScreen.js +21 -20
- package/lib/components/InterstitialScreen/InterstitialScreenBody.d.ts +9 -3
- package/lib/components/InterstitialScreen/InterstitialScreenBody.js +19 -14
- package/lib/components/InterstitialScreen/InterstitialScreenFooter.js +20 -18
- package/lib/components/InterstitialScreen/InterstitialScreenHeader.js +15 -10
- package/lib/components/InterstitialScreen/index.d.ts +4 -1
- package/lib/components/Nav/NavItemLink.js +1 -4
- package/lib/components/PageHeader/PageHeaderTitle.js +1 -1
- package/lib/components/PageHeader/next/PageHeader.d.ts +277 -0
- package/lib/components/PageHeader/next/PageHeader.js +490 -0
- package/lib/components/PageHeader/next/index.d.ts +8 -0
- package/lib/components/ScrollGradient/ScrollGradient.js +4 -4
- package/lib/components/SidePanel/SidePanel.js +26 -21
- package/lib/components/StringFormatter/StringFormatter.js +3 -0
- package/lib/components/Tearsheet/Tearsheet.js +4 -7
- package/lib/components/Tearsheet/TearsheetNarrow.js +1 -4
- package/lib/components/Tearsheet/TearsheetShell.js +1 -1
- package/lib/components/UserAvatar/UserAvatar.js +5 -7
- package/lib/components/UserProfileImage/UserProfileImage.d.ts +1 -0
- package/lib/components/UserProfileImage/UserProfileImage.js +12 -6
- package/lib/components/index.d.ts +1 -0
- package/lib/global/js/package-settings.js +1 -1
- package/lib/index.js +5 -2
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/node_modules/prop-types/index.js +1 -1
- package/package.json +22 -30
- package/scss/components/CoachmarkStack/_coachmark-stack.scss +12 -1
- package/scss/components/InterstitialScreen/_interstitial-screen.scss +7 -11
- package/scss/components/PageHeader/_page-header.scss +198 -0
- package/scss/components/SidePanel/_side-panel.scss +2 -52
- package/scss/components/_index-released-only.scss +1 -0
- package/telemetry.yml +12 -13
- package/es/_virtual/index3.js +0 -10
- package/es/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/es/components/SidePanel/resizer/Resizer.js +0 -271
- package/es/node_modules/lodash.debounce/index.js +0 -367
- package/lib/_virtual/index3.js +0 -12
- package/lib/components/SidePanel/resizer/Resizer.d.ts +0 -21
- package/lib/components/SidePanel/resizer/Resizer.js +0 -277
- package/lib/node_modules/lodash.debounce/index.js +0 -369
- /package/es/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icons-react/node_modules/@carbon/icon-helpers → icon-helpers}/es/index.js +0 -0
@@ -36,9 +36,11 @@ interface EditTearsheetFormBaseProps {
|
|
36
36
|
type EditTearsheetFormFieldsetTypes = {
|
37
37
|
hasFieldset?: false;
|
38
38
|
fieldsetLegendText: string;
|
39
|
+
fieldsetLegendId?: React.ReactNode;
|
39
40
|
} | {
|
40
41
|
hasFieldset: true;
|
41
42
|
fieldsetLegendText: string;
|
43
|
+
fieldsetLegendId: React.ReactNode;
|
42
44
|
};
|
43
45
|
type EditTearsheetFormProps = EditTearsheetFormBaseProps & EditTearsheetFormFieldsetTypes;
|
44
46
|
export declare let EditTearsheetForm: React.ForwardRefExoticComponent<EditTearsheetFormProps & React.RefAttributes<HTMLDivElement>>;
|
@@ -32,6 +32,7 @@ exports.EditTearsheetForm = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
32
32
|
className,
|
33
33
|
description,
|
34
34
|
fieldsetLegendText,
|
35
|
+
fieldsetLegendId,
|
35
36
|
hasFieldset = defaults.hasFieldset,
|
36
37
|
subtitle,
|
37
38
|
title,
|
@@ -58,7 +59,7 @@ exports.EditTearsheetForm = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
58
59
|
sm: 4
|
59
60
|
}, /*#__PURE__*/React.createElement("h4", {
|
60
61
|
className: `${blockClass}--title`
|
61
|
-
}, title), subtitle && /*#__PURE__*/React.createElement("
|
62
|
+
}, title), subtitle && /*#__PURE__*/React.createElement("h5", {
|
62
63
|
className: `${blockClass}--subtitle`
|
63
64
|
}, subtitle), description && /*#__PURE__*/React.createElement("p", {
|
64
65
|
className: `${blockClass}--description`
|
@@ -66,7 +67,8 @@ exports.EditTearsheetForm = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
66
67
|
span: 100
|
67
68
|
}, hasFieldset ? /*#__PURE__*/React.createElement(react.FormGroup, {
|
68
69
|
legendText: fieldsetLegendText,
|
69
|
-
className: `${blockClass}--fieldset
|
70
|
+
className: `${blockClass}--fieldset`,
|
71
|
+
legendId: fieldsetLegendId
|
70
72
|
}, /*#__PURE__*/React.createElement(react.Grid, null, children)) : children))) : pconsole.default.warn(`You have tried using a ${componentName} component outside of a EditTearsheet. This is not allowed. ${componentName}s should always be children of the EditTearsheet`);
|
71
73
|
});
|
72
74
|
|
@@ -85,16 +87,26 @@ exports.EditTearsheetForm.propTypes = {
|
|
85
87
|
* Sets an optional description on the form component
|
86
88
|
*/
|
87
89
|
description: index.default.string,
|
90
|
+
/**
|
91
|
+
* This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
|
92
|
+
*/
|
93
|
+
/**@ts-ignore */
|
94
|
+
fieldsetLegendId: index.default.node.isRequired.if(_ref2 => {
|
95
|
+
let {
|
96
|
+
hasFieldset
|
97
|
+
} = _ref2;
|
98
|
+
return !!hasFieldset;
|
99
|
+
}),
|
88
100
|
/**
|
89
101
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
90
102
|
* You can set the `hasFieldset` prop to false if you have multiple fieldset elements or want to control the children of your Full Page's form content.
|
91
103
|
* Otherwise, use CSS to hide/remove this label text.
|
92
104
|
*/
|
93
105
|
/**@ts-ignore */
|
94
|
-
fieldsetLegendText: index.default.string.isRequired.if(
|
106
|
+
fieldsetLegendText: index.default.string.isRequired.if(_ref3 => {
|
95
107
|
let {
|
96
108
|
hasFieldset
|
97
|
-
} =
|
109
|
+
} = _ref3;
|
98
110
|
return !!hasFieldset;
|
99
111
|
}),
|
100
112
|
/**
|
@@ -55,9 +55,10 @@ const FilterSummary = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
55
55
|
const localRef = filterSummaryRef || ref;
|
56
56
|
const [overflowCount, setOverflowCount] = React.useState(0);
|
57
57
|
const [multiline, setMultiline] = React.useState(false);
|
58
|
+
// @ts-ignore
|
58
59
|
const previousState = usePreviousValue.usePreviousValue({
|
59
60
|
multiline
|
60
|
-
})
|
61
|
+
}) ?? {};
|
61
62
|
const handleViewAll = () => {
|
62
63
|
if (overflowCount === 0) {
|
63
64
|
setMultiline(false);
|
@@ -40,8 +40,8 @@ const defaults = {
|
|
40
40
|
* The guide banner sits at the top of a page, or page-level tab,
|
41
41
|
* to introduce foundational concepts related to the page's content.
|
42
42
|
*/
|
43
|
-
exports.Guidebanner = /*#__PURE__*/React.forwardRef((
|
44
|
-
|
43
|
+
exports.Guidebanner = /*#__PURE__*/React.forwardRef((props, ref) => {
|
44
|
+
const {
|
45
45
|
children,
|
46
46
|
className,
|
47
47
|
collapsible = defaults.collapsible,
|
@@ -55,7 +55,7 @@ exports.Guidebanner = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
55
55
|
previousIconDescription = defaults.previousIconDescription,
|
56
56
|
title,
|
57
57
|
...rest
|
58
|
-
} =
|
58
|
+
} = props;
|
59
59
|
const scrollRef = React.useRef(null);
|
60
60
|
const toggleRef = React.useRef(null);
|
61
61
|
const [scrollPosition, setScrollPosition] = React.useState(0);
|
@@ -156,23 +156,7 @@ exports.Guidebanner.propTypes = {
|
|
156
156
|
* Provide the contents of the Guidebanner.
|
157
157
|
* One or more GuidebannerElement components are required.
|
158
158
|
*/
|
159
|
-
children:
|
160
|
-
let error;
|
161
|
-
const prop = props[propName];
|
162
|
-
if (!prop) {
|
163
|
-
error = new Error('`Guidebanner` requires one or more children of type `GuidebannerElement`.');
|
164
|
-
}
|
165
|
-
React.Children.forEach(prop, child => {
|
166
|
-
if (child.type.displayName !== 'GuidebannerElement') {
|
167
|
-
// If child element is not `GuidebannerElement`, then show:
|
168
|
-
// Carbon Products component's `displayName` (child.type.displayName) or
|
169
|
-
// React component's `name` (child.type.name) or
|
170
|
-
// HTML element's tag name (child.type).
|
171
|
-
error = new Error(`\`Guidebanner\` only accepts children of type \`GuidebannerElement\`, found \`${child.type?.displayName || child.type?.name || child.type}\` instead.`);
|
172
|
-
}
|
173
|
-
});
|
174
|
-
return error;
|
175
|
-
},
|
159
|
+
children: index.default.node,
|
176
160
|
/**
|
177
161
|
* Provide an optional class to be applied to the containing node.
|
178
162
|
*/
|
@@ -8,6 +8,7 @@ import React, { ReactNode, RefObject } from 'react';
|
|
8
8
|
import { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
|
9
9
|
import { InterstitialScreenBodyProps } from './InterstitialScreenBody';
|
10
10
|
import { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
|
11
|
+
export declare const blockClass: string;
|
11
12
|
export type ActionType = 'close' | 'start' | 'skip' | 'back' | 'next';
|
12
13
|
export interface InterstitialScreenProps {
|
13
14
|
/**
|
@@ -21,7 +22,7 @@ export interface InterstitialScreenProps {
|
|
21
22
|
/**
|
22
23
|
* The aria label applied to the Interstitial Screen component
|
23
24
|
*/
|
24
|
-
|
25
|
+
ariaLabel?: string;
|
25
26
|
/**
|
26
27
|
* Specifies whether the component is shown as a full-screen
|
27
28
|
* experience, else it is shown as a modal by default.
|
@@ -30,7 +31,7 @@ export interface InterstitialScreenProps {
|
|
30
31
|
/**
|
31
32
|
* Specifies whether the component is currently open.
|
32
33
|
*/
|
33
|
-
|
34
|
+
open?: boolean;
|
34
35
|
/**
|
35
36
|
* Function to call when the close button is clicked.
|
36
37
|
*/
|
@@ -40,7 +41,7 @@ export interface InterstitialScreenProps {
|
|
40
41
|
*/
|
41
42
|
launcherButtonRef?: RefObject<HTMLElement>;
|
42
43
|
}
|
43
|
-
type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & {
|
44
|
+
export type InterstitialScreenComponent = React.ForwardRefExoticComponent<InterstitialScreenProps & React.RefAttributes<HTMLDivElement>> & {
|
44
45
|
Header: React.FC<InterstitialScreenHeaderProps>;
|
45
46
|
Body: React.FC<InterstitialScreenBodyProps>;
|
46
47
|
Footer: React.FC<InterstitialScreenFooterProps>;
|
@@ -49,9 +49,9 @@ exports.InterstitialScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
49
49
|
const {
|
50
50
|
children,
|
51
51
|
className,
|
52
|
-
|
52
|
+
ariaLabel = 'Interstitial screen',
|
53
53
|
isFullScreen = false,
|
54
|
-
|
54
|
+
open = false,
|
55
55
|
launcherButtonRef,
|
56
56
|
onClose,
|
57
57
|
...rest
|
@@ -78,21 +78,21 @@ exports.InterstitialScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
78
78
|
onClose?.(actionName ?? 'close');
|
79
79
|
}, [onClose]);
|
80
80
|
React.useEffect(() => {
|
81
|
-
if (!
|
81
|
+
if (!open) {
|
82
82
|
setProgStep(0);
|
83
83
|
}
|
84
84
|
startButtonRef.current?.focus();
|
85
|
-
}, [
|
85
|
+
}, [open, progStep, onClose]);
|
86
86
|
React.useEffect(() => {
|
87
87
|
// for modal only, "is-visible" triggers animation
|
88
|
-
setIsVisibleClass(!isFullScreen &&
|
88
|
+
setIsVisibleClass(!isFullScreen && open ? 'is-visible' : null);
|
89
89
|
nextButtonRef?.current?.focus();
|
90
|
-
if (!
|
90
|
+
if (!open && launcherButtonRef) {
|
91
91
|
setTimeout(() => {
|
92
92
|
launcherButtonRef.current.focus();
|
93
93
|
}, 0);
|
94
94
|
}
|
95
|
-
}, [launcherButtonRef, isFullScreen,
|
95
|
+
}, [launcherButtonRef, isFullScreen, open]);
|
96
96
|
|
97
97
|
// hitting escape key also closes this component
|
98
98
|
React.useEffect(() => {
|
@@ -107,7 +107,7 @@ exports.InterstitialScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
107
107
|
window.addEventListener('keydown', close);
|
108
108
|
return () => window.removeEventListener('keydown', close);
|
109
109
|
}, [handleClose]);
|
110
|
-
if (!
|
110
|
+
if (!open) {
|
111
111
|
return null;
|
112
112
|
}
|
113
113
|
const renderModal = () => {
|
@@ -121,9 +121,9 @@ exports.InterstitialScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
121
121
|
),
|
122
122
|
size: "lg",
|
123
123
|
onClose: handleClose,
|
124
|
-
open:
|
124
|
+
open: open,
|
125
125
|
ref: _forwardedRef,
|
126
|
-
"aria-label":
|
126
|
+
"aria-label": ariaLabel
|
127
127
|
}, devtools.getDevtoolsProps(componentName)), children));
|
128
128
|
};
|
129
129
|
const renderFullScreen = () => {
|
@@ -134,7 +134,7 @@ exports.InterstitialScreen = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
134
134
|
// Apply any supplied class names to the main HTML element.
|
135
135
|
variantClass, isVisibleClass),
|
136
136
|
role: "main",
|
137
|
-
"aria-label":
|
137
|
+
"aria-label": ariaLabel,
|
138
138
|
ref: ref
|
139
139
|
}, devtools.getDevtoolsProps(componentName)), /*#__PURE__*/React.createElement("div", {
|
140
140
|
className: `${blockClass}--container`
|
@@ -183,6 +183,10 @@ exports.InterstitialScreen.displayName = componentName;
|
|
183
183
|
// in alphabetical order (for consistency).
|
184
184
|
// See https://www.npmjs.com/package/prop-types#usage.
|
185
185
|
exports.InterstitialScreen.propTypes = {
|
186
|
+
/**
|
187
|
+
* The aria label applied to the Interstitial Screen component
|
188
|
+
*/
|
189
|
+
ariaLabel: index.default.string,
|
186
190
|
children: index.default.node,
|
187
191
|
/**
|
188
192
|
* Provide an optional class to be applied to the containing node.
|
@@ -192,19 +196,11 @@ exports.InterstitialScreen.propTypes = {
|
|
192
196
|
* Tooltip text and aria label for the Close button icon.
|
193
197
|
*/
|
194
198
|
closeIconDescription: index.default.string,
|
195
|
-
/**
|
196
|
-
* The aria label applied to the Interstitial Screen component
|
197
|
-
*/
|
198
|
-
interstitialAriaLabel: index.default.string,
|
199
199
|
/**
|
200
200
|
* Specifies whether the component is shown as a full-screen
|
201
201
|
* experience, else it is shown as a modal by default.
|
202
202
|
*/
|
203
203
|
isFullScreen: index.default.bool,
|
204
|
-
/**
|
205
|
-
* Specifies whether the component is currently open.
|
206
|
-
*/
|
207
|
-
isOpen: index.default.bool,
|
208
204
|
/**
|
209
205
|
* Provide a ref to return focus to once the interstitial is closed.
|
210
206
|
*/
|
@@ -212,7 +208,12 @@ exports.InterstitialScreen.propTypes = {
|
|
212
208
|
/**
|
213
209
|
* Function to call when the close button is clicked.
|
214
210
|
*/
|
215
|
-
onClose: index.default.func
|
211
|
+
onClose: index.default.func,
|
212
|
+
/**
|
213
|
+
* Specifies whether the component is currently open.
|
214
|
+
*/
|
215
|
+
open: index.default.bool
|
216
216
|
};
|
217
217
|
|
218
218
|
exports.InterstitialScreenContext = InterstitialScreenContext;
|
219
|
+
exports.blockClass = blockClass;
|
@@ -13,15 +13,21 @@ type contentRendererArgs = {
|
|
13
13
|
disableActionButton: (value: disableButtonConfigType) => void;
|
14
14
|
};
|
15
15
|
export interface InterstitialScreenBodyProps {
|
16
|
+
/**
|
17
|
+
* Optional static content for body
|
18
|
+
*/
|
19
|
+
children?: ReactNode;
|
16
20
|
/**
|
17
21
|
* Provide an optional class to be applied to the containing node.
|
18
22
|
*/
|
19
23
|
className?: string;
|
20
24
|
/**
|
21
|
-
*
|
22
|
-
*
|
25
|
+
*You can provide content either through a callback (contentRenderer) or as static children—but not both.
|
26
|
+
* If both are provided, contentRenderer always takes precedence. This optional callback should return the content
|
27
|
+
* to be rendered in the body section, which can be either a single element or an array of elements based on your needs.
|
28
|
+
* If internal state access isn’t required, you can simply use static children instead
|
23
29
|
*/
|
24
|
-
contentRenderer
|
30
|
+
contentRenderer?: (config: contentRendererArgs) => ReactElement<EnrichedChildren> | ReactNode;
|
25
31
|
}
|
26
32
|
declare const InterstitialScreenBody: React.ForwardRefExoticComponent<InterstitialScreenBodyProps & React.RefAttributes<HTMLDivElement>>;
|
27
33
|
export default InterstitialScreenBody;
|
@@ -14,9 +14,9 @@ var React = require('react');
|
|
14
14
|
var index = require('../../_virtual/index.js');
|
15
15
|
var InterstitialScreen = require('./InterstitialScreen.js');
|
16
16
|
var react = require('@carbon/react');
|
17
|
-
var settings = require('../../settings.js');
|
18
17
|
var Carousel = require('../Carousel/Carousel.js');
|
19
18
|
require('../Carousel/CarouselItem.js');
|
19
|
+
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
|
21
21
|
const InterstitialScreenBody = /*#__PURE__*/React.forwardRef((props, ref) => {
|
22
22
|
const {
|
@@ -24,8 +24,7 @@ const InterstitialScreenBody = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
24
24
|
contentRenderer,
|
25
25
|
...rest
|
26
26
|
} = props;
|
27
|
-
const
|
28
|
-
const bodyBlockClass = `${blockClass}--internal-body`;
|
27
|
+
const bodyBlockClass = `${InterstitialScreen.blockClass}--internal-body`;
|
29
28
|
const [stepType, setStepType] = React.useState();
|
30
29
|
const {
|
31
30
|
setBodyChildrenData,
|
@@ -42,11 +41,11 @@ const InterstitialScreenBody = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
42
41
|
} = React.useContext(InterstitialScreen.InterstitialScreenContext);
|
43
42
|
const [scrollPercent, setScrollPercent] = React.useState(-1);
|
44
43
|
React.useEffect(() => {
|
45
|
-
const _bodyContent = contentRenderer({
|
44
|
+
const _bodyContent = contentRenderer?.({
|
46
45
|
handleGotoStep,
|
47
46
|
progStep,
|
48
47
|
disableActionButton
|
49
|
-
});
|
48
|
+
}) ?? props.children;
|
50
49
|
const isElement = /*#__PURE__*/React.isValidElement(_bodyContent);
|
51
50
|
const children = isElement ? _bodyContent.props.children : _bodyContent;
|
52
51
|
|
@@ -78,32 +77,38 @@ const InterstitialScreenBody = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
78
77
|
};
|
79
78
|
const onScrollHandler = scrollPercent => setScrollPercent(scrollPercent);
|
80
79
|
const renderBody = () => /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
81
|
-
className: `${blockClass}--body ${className}`,
|
80
|
+
className: `${InterstitialScreen.blockClass}--body ${className}`,
|
82
81
|
ref: bodyScrollRef ?? ref
|
83
|
-
}, rest), /*#__PURE__*/React.createElement("div", {
|
84
|
-
className: `${blockClass}--content`
|
82
|
+
}, devtools.getDevtoolsProps('InterstitialScreenBody'), isFullScreen ? rest : {}), /*#__PURE__*/React.createElement("div", {
|
83
|
+
className: `${InterstitialScreen.blockClass}--content`
|
85
84
|
}, stepType === 'multi' ? /*#__PURE__*/React.createElement("div", {
|
86
|
-
className: `${blockClass}__carousel`
|
85
|
+
className: `${InterstitialScreen.blockClass}__carousel`
|
87
86
|
}, /*#__PURE__*/React.createElement(Carousel.Carousel, {
|
88
87
|
disableArrowScroll: true,
|
89
88
|
ref: scrollRef,
|
90
89
|
onScroll: onScrollHandler
|
91
90
|
}, bodyChildrenData)) : stepType === 'single' ? bodyChildrenData : ''));
|
92
|
-
return isFullScreen ? renderBody() : /*#__PURE__*/React.createElement(react.ModalBody, {
|
91
|
+
return isFullScreen ? renderBody() : /*#__PURE__*/React.createElement(react.ModalBody, _rollupPluginBabelHelpers.extends({
|
93
92
|
ref: ref,
|
94
93
|
className: bodyBlockClass
|
95
|
-
}, renderBody());
|
94
|
+
}, rest), renderBody());
|
96
95
|
});
|
97
96
|
InterstitialScreenBody.propTypes = {
|
97
|
+
/**
|
98
|
+
* Optional static content for body
|
99
|
+
*/
|
100
|
+
children: index.default.node,
|
98
101
|
/**
|
99
102
|
* Provide an optional class to be applied to the containing node.
|
100
103
|
*/
|
101
104
|
className: index.default.string,
|
102
105
|
/**
|
103
|
-
*
|
104
|
-
*
|
106
|
+
*You can provide content either through a callback (contentRenderer) or as static children—but not both.
|
107
|
+
* If both are provided, contentRenderer always takes precedence. This optional callback should return the content
|
108
|
+
* to be rendered in the body section, which can be either a single element or an array of elements based on your needs.
|
109
|
+
* If internal state access isn’t required, you can simply use static children instead
|
105
110
|
*/
|
106
|
-
contentRenderer: index.default.func
|
111
|
+
contentRenderer: index.default.func
|
107
112
|
};
|
108
113
|
|
109
114
|
exports.default = InterstitialScreenBody;
|
@@ -11,12 +11,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
11
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
13
13
|
var React = require('react');
|
14
|
-
var settings = require('../../settings.js');
|
15
14
|
var index = require('../../_virtual/index.js');
|
16
15
|
var InterstitialScreen = require('./InterstitialScreen.js');
|
17
16
|
var react = require('@carbon/react');
|
18
17
|
var clamp = require('../../global/js/utils/clamp.js');
|
19
18
|
var icons = require('@carbon/react/icons');
|
19
|
+
var devtools = require('../../global/js/utils/devtools.js');
|
20
20
|
|
21
21
|
var _InlineLoading, _InlineLoading2, _InlineLoading3, _InlineLoading4;
|
22
22
|
const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
@@ -27,9 +27,10 @@ const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
27
27
|
nextButtonLabel = 'Next',
|
28
28
|
startButtonLabel = 'Get Started',
|
29
29
|
actionButtonRenderer,
|
30
|
-
onAction
|
30
|
+
onAction,
|
31
|
+
...rest
|
31
32
|
} = props;
|
32
|
-
const
|
33
|
+
const footerBlockClass = `${InterstitialScreen.blockClass}--footer`;
|
33
34
|
const {
|
34
35
|
handleClose,
|
35
36
|
progStep,
|
@@ -38,8 +39,8 @@ const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
38
39
|
disableButtonConfig,
|
39
40
|
isFullScreen
|
40
41
|
} = React.useContext(InterstitialScreen.InterstitialScreenContext);
|
41
|
-
const startButtonRef = React.useRef(
|
42
|
-
const nextButtonRef = React.useRef(
|
42
|
+
const startButtonRef = React.useRef(null);
|
43
|
+
const nextButtonRef = React.useRef(null);
|
43
44
|
const [loadingAction, setLoadingAction] = React.useState('');
|
44
45
|
const isMultiStep = !!stepCount;
|
45
46
|
const progStepFloor = 0;
|
@@ -82,35 +83,32 @@ const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
82
83
|
}
|
83
84
|
return {};
|
84
85
|
}, [loadingAction, isMultiStep, progStep, progStepCeil]);
|
85
|
-
const getFooterContent = () => /*#__PURE__*/React.createElement(
|
86
|
-
|
87
|
-
className: `${blockClass}--footer ${className}`
|
88
|
-
}, isMultiStep && skipButtonLabel !== '' && /*#__PURE__*/React.createElement(react.Button, {
|
89
|
-
className: `${blockClass}--skip-btn`,
|
86
|
+
const getFooterContent = () => /*#__PURE__*/React.createElement(React.Fragment, null, isMultiStep && skipButtonLabel !== '' && /*#__PURE__*/React.createElement(react.Button, {
|
87
|
+
className: `${InterstitialScreen.blockClass}--skip-btn`,
|
90
88
|
kind: "ghost",
|
91
89
|
size: "lg",
|
92
90
|
title: skipButtonLabel,
|
93
91
|
onClick: handleSkip,
|
94
92
|
disabled: disableButtonConfig?.skip
|
95
93
|
}, skipButtonLabel, loadingAction === 'skip' && (_InlineLoading || (_InlineLoading = /*#__PURE__*/React.createElement(react.InlineLoading, null)))), /*#__PURE__*/React.createElement("div", {
|
96
|
-
className: `${blockClass}--footer-controls`
|
94
|
+
className: `${InterstitialScreen.blockClass}--footer-controls`
|
97
95
|
}, isMultiStep && progStep > 0 && /*#__PURE__*/React.createElement(react.Button, {
|
98
|
-
className: `${blockClass}--prev-btn`,
|
96
|
+
className: `${InterstitialScreen.blockClass}--prev-btn`,
|
99
97
|
kind: "secondary",
|
100
98
|
size: "lg",
|
101
99
|
title: previousButtonLabel,
|
102
100
|
disabled: disableButtonConfig?.back,
|
103
101
|
onClick: handleClickPrev
|
104
102
|
}, previousButtonLabel, loadingAction === 'back' && (_InlineLoading2 || (_InlineLoading2 = /*#__PURE__*/React.createElement(react.InlineLoading, null)))), isMultiStep && progStep < progStepCeil && /*#__PURE__*/React.createElement(react.Button, {
|
105
|
-
className: `${blockClass}--next-btn`,
|
106
|
-
renderIcon: loadingAction !== 'next' ? icons.ArrowRight :
|
103
|
+
className: `${InterstitialScreen.blockClass}--next-btn`,
|
104
|
+
renderIcon: loadingAction !== 'next' ? icons.ArrowRight : undefined,
|
107
105
|
ref: nextButtonRef,
|
108
106
|
size: "lg",
|
109
107
|
title: nextButtonLabel,
|
110
108
|
disabled: disableButtonConfig?.next,
|
111
109
|
onClick: handleClickNext
|
112
110
|
}, nextButtonLabel, loadingAction === 'next' && (_InlineLoading3 || (_InlineLoading3 = /*#__PURE__*/React.createElement(react.InlineLoading, null)))), (isMultiStep && progStep === progStepCeil || !isMultiStep) && /*#__PURE__*/React.createElement(react.Button, _rollupPluginBabelHelpers.extends({
|
113
|
-
className: `${blockClass}--start-btn`,
|
111
|
+
className: `${InterstitialScreen.blockClass}--start-btn`,
|
114
112
|
ref: startButtonRef,
|
115
113
|
size: "lg",
|
116
114
|
title: startButtonLabel,
|
@@ -119,7 +117,7 @@ const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
119
117
|
}, getRenderIcon), startButtonLabel, loadingAction === 'start' && (_InlineLoading4 || (_InlineLoading4 = /*#__PURE__*/React.createElement(react.InlineLoading, null))))));
|
120
118
|
if (actionButtonRenderer) {
|
121
119
|
return /*#__PURE__*/React.createElement("div", {
|
122
|
-
className: `${blockClass}--footer`
|
120
|
+
className: `${InterstitialScreen.blockClass}--footer`
|
123
121
|
}, actionButtonRenderer({
|
124
122
|
handleGotoStep,
|
125
123
|
progStep,
|
@@ -127,9 +125,13 @@ const InterstitialScreenFooter = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
127
125
|
disableButtonConfig
|
128
126
|
}));
|
129
127
|
}
|
130
|
-
return isFullScreen ?
|
128
|
+
return isFullScreen ? /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
129
|
+
ref: ref,
|
130
|
+
className: `${footerBlockClass} ${className}`
|
131
|
+
}, devtools.getDevtoolsProps('InterstitialScreenFooter'), isFullScreen ? rest : {}), getFooterContent()) : /*#__PURE__*/React.createElement(react.ModalFooter, _rollupPluginBabelHelpers.extends({
|
132
|
+
className: footerBlockClass,
|
131
133
|
ref: ref
|
132
|
-
}, getFooterContent());
|
134
|
+
}, rest), getFooterContent());
|
133
135
|
});
|
134
136
|
InterstitialScreenFooter.propTypes = {
|
135
137
|
/**
|
@@ -9,13 +9,14 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
12
13
|
var react = require('@carbon/react');
|
13
14
|
var React = require('react');
|
14
15
|
var index = require('../../_virtual/index.js');
|
15
|
-
var settings = require('../../settings.js');
|
16
16
|
var cx = require('classnames');
|
17
17
|
var InterstitialScreen = require('./InterstitialScreen.js');
|
18
18
|
var useId = require('../../global/js/utils/useId.js');
|
19
|
+
var devtools = require('../../global/js/utils/devtools.js');
|
19
20
|
|
20
21
|
const InterstitialScreenHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
22
|
var _h, _h2;
|
@@ -25,7 +26,8 @@ const InterstitialScreenHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
26
|
headerSubTitle,
|
26
27
|
closeIconDescription,
|
27
28
|
hideProgressIndicator,
|
28
|
-
children
|
29
|
+
children,
|
30
|
+
...rest
|
29
31
|
} = props;
|
30
32
|
const {
|
31
33
|
bodyChildrenData,
|
@@ -34,15 +36,14 @@ const InterstitialScreenHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
34
36
|
handleClose,
|
35
37
|
stepCount
|
36
38
|
} = React.useContext(InterstitialScreen.InterstitialScreenContext);
|
37
|
-
const
|
38
|
-
const headerBlockClass = `${blockClass}--internal-header`;
|
39
|
+
const headerBlockClass = `${InterstitialScreen.blockClass}--internal-header`;
|
39
40
|
const _useId = useId.useId();
|
40
41
|
const carbonPrefix = react.usePrefix();
|
41
42
|
const headerContent = () => {
|
42
43
|
return /*#__PURE__*/React.createElement(React.Fragment, null, (headerTitle || headerSubTitle) && /*#__PURE__*/React.createElement("div", {
|
43
|
-
className: `${blockClass}--titleContainer`
|
44
|
+
className: `${InterstitialScreen.blockClass}--titleContainer`
|
44
45
|
}, headerTitle && (_h || (_h = /*#__PURE__*/React.createElement("h1", null, headerTitle))), headerSubTitle && (_h2 || (_h2 = /*#__PURE__*/React.createElement("h2", null, headerSubTitle)))), children, !hideProgressIndicator && bodyChildrenData && Array.isArray(bodyChildrenData) && /*#__PURE__*/React.createElement("div", {
|
45
|
-
className: `${blockClass}--progress`
|
46
|
+
className: `${InterstitialScreen.blockClass}--progress`
|
46
47
|
}, /*#__PURE__*/React.createElement(react.ProgressIndicator, {
|
47
48
|
vertical: false,
|
48
49
|
currentIndex: progStep
|
@@ -61,19 +62,23 @@ const InterstitialScreenHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
61
62
|
className: `${carbonPrefix}--visually-hidden`
|
62
63
|
}, "Step ", progStep + 1, " of ", stepCount)));
|
63
64
|
};
|
64
|
-
|
65
|
+
const closeModal = () => {
|
66
|
+
handleClose?.('close');
|
67
|
+
};
|
68
|
+
return isFullScreen ? /*#__PURE__*/React.createElement("header", _rollupPluginBabelHelpers.extends({
|
65
69
|
ref: ref,
|
70
|
+
role: "presentation",
|
66
71
|
className: cx(headerBlockClass, className, {
|
67
72
|
[`${headerBlockClass}--has-title`]: headerTitle || headerSubTitle || children
|
68
73
|
})
|
69
|
-
}, headerContent()) : /*#__PURE__*/React.createElement(react.ModalHeader, {
|
74
|
+
}, devtools.getDevtoolsProps('InterstitialScreenHeader'), rest), headerContent()) : /*#__PURE__*/React.createElement(react.ModalHeader, _rollupPluginBabelHelpers.extends({
|
70
75
|
ref: ref,
|
71
76
|
className: cx(headerBlockClass, className, {
|
72
77
|
[`${headerBlockClass}--has-title`]: headerTitle || headerSubTitle || children
|
73
78
|
}),
|
74
|
-
closeModal:
|
79
|
+
closeModal: closeModal,
|
75
80
|
iconDescription: closeIconDescription
|
76
|
-
}, headerContent());
|
81
|
+
}, devtools.getDevtoolsProps('InterstitialScreenHeader'), rest), headerContent());
|
77
82
|
});
|
78
83
|
InterstitialScreenHeader.propTypes = {
|
79
84
|
/**
|
@@ -5,4 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
export { InterstitialScreen } from './InterstitialScreen';
|
8
|
-
export type { InterstitialScreenProps } from './InterstitialScreen';
|
8
|
+
export type { InterstitialScreenProps, InterstitialScreenComponent, disableButtonConfigType, ActionType, } from './InterstitialScreen';
|
9
|
+
export type { InterstitialScreenBodyProps } from './InterstitialScreenBody';
|
10
|
+
export type { InterstitialScreenFooterProps } from './InterstitialScreenFooter';
|
11
|
+
export type { InterstitialScreenHeaderProps } from './InterstitialScreenHeader';
|
@@ -14,7 +14,7 @@ var React = require('react');
|
|
14
14
|
|
15
15
|
const NavItemLink = /*#__PURE__*/React.forwardRef(function NavItemLink(props, ref) {
|
16
16
|
const {
|
17
|
-
element,
|
17
|
+
element = 'a',
|
18
18
|
...rest
|
19
19
|
} = props;
|
20
20
|
return /*#__PURE__*/React.createElement(element, {
|
@@ -27,8 +27,5 @@ NavItemLink.propTypes = {
|
|
27
27
|
/** @type {elementType} The base element to use to build the link. Defaults to `a`, can also accept alternative tag names or custom components like `Link` from `react-router`. */
|
28
28
|
element: index.default.elementType
|
29
29
|
};
|
30
|
-
NavItemLink.defaultProps = {
|
31
|
-
element: 'a'
|
32
|
-
};
|
33
30
|
|
34
31
|
exports.default = NavItemLink;
|
@@ -47,7 +47,7 @@ const PageHeaderTitle = _ref => {
|
|
47
47
|
} = title;
|
48
48
|
let titleText;
|
49
49
|
let isEditable = !!onSave;
|
50
|
-
const titleRef = React.useRef();
|
50
|
+
const titleRef = React.useRef(undefined);
|
51
51
|
const isEllipsisApplied = useOverflowString.useOverflowStringWidth(titleRef);
|
52
52
|
if (text || !content) {
|
53
53
|
if (text === undefined && typeof title === 'string') {
|