@carbon/ibm-products 2.69.0 → 2.70.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/carbon.css +471 -372
- package/css/carbon.css.map +1 -1
- package/css/index-full-carbon.css +527 -282
- 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 +50 -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 +146 -0
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index-without-carbon.min.css.map +1 -1
- package/css/index.css +159 -93
- 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/Card/Card.js +4 -3
- package/es/components/CreateFullPage/CreateFullPage.js +9 -15
- package/es/components/CreateTearsheet/CreateTearsheet.js +1 -1
- package/es/components/CreateTearsheet/CreateTearsheetStep.d.ts +2 -0
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +16 -4
- package/es/components/NotificationsPanel/NotificationsPanel.js +18 -1
- package/es/components/SidePanel/SidePanel.d.ts +4 -0
- package/es/components/SidePanel/SidePanel.js +7 -1
- package/es/components/Tearsheet/TearsheetShell.js +10 -4
- package/es/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/lib/components/Card/Card.js +4 -3
- package/lib/components/CreateFullPage/CreateFullPage.js +8 -14
- package/lib/components/CreateTearsheet/CreateTearsheet.js +1 -1
- package/lib/components/CreateTearsheet/CreateTearsheetStep.d.ts +2 -0
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +16 -4
- package/lib/components/NotificationsPanel/NotificationsPanel.js +18 -1
- package/lib/components/SidePanel/SidePanel.d.ts +4 -0
- package/lib/components/SidePanel/SidePanel.js +7 -1
- package/lib/components/Tearsheet/TearsheetShell.js +10 -4
- package/lib/node_modules/@carbon/icons-react/es/Icon.js +1 -1
- package/package.json +14 -16
- package/scss/components/SidePanel/_side-panel.scss +1 -1
- package/scss/components/Tearsheet/_tearsheet.scss +1 -0
- package/scss/global/styles/_display-box.scss +2 -2
- package/telemetry.yml +2 -0
- /package/es/node_modules/@carbon/{icon-helpers → icons-react/node_modules/@carbon/icon-helpers}/es/index.js +0 -0
- /package/lib/node_modules/@carbon/{icon-helpers → icons-react/node_modules/@carbon/icon-helpers}/es/index.js +0 -0
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
import { 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,
|
10
|
+
import React__default, { useState, isValidElement, 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';
|
@@ -86,7 +86,7 @@ let CreateFullPage = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
86
86
|
const [stepData, setStepData] = useState([]);
|
87
87
|
const [firstIncludedStep, setFirstIncludedStep] = useState(1);
|
88
88
|
const [lastIncludedStep, setLastIncludedStep] = useState();
|
89
|
-
const
|
89
|
+
const stepLength = React__default.Children.toArray(children).filter(item => /*#__PURE__*/isValidElement(item) && item.props.includeStep !== false).length;
|
90
90
|
useEffect(() => {
|
91
91
|
const firstItem = stepData.findIndex(item => item?.shouldIncludeStep) + 1;
|
92
92
|
const lastItem = lastIndexInArray(stepData, 'shouldIncludeStep', true);
|
@@ -96,20 +96,18 @@ let CreateFullPage = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
96
96
|
if (lastItem !== lastIncludedStep) {
|
97
97
|
setLastIncludedStep(lastItem);
|
98
98
|
}
|
99
|
-
|
100
|
-
|
101
|
-
if (initialStep) {
|
99
|
+
if (Number(initialStep) > stepLength || Number(initialStep) <= 0) {
|
100
|
+
setCurrentStep(1);
|
101
|
+
} else if (initialStep) {
|
102
102
|
const numberOfHiddenSteps = getNumberOfHiddenSteps(stepData, initialStep);
|
103
103
|
setCurrentStep(Number(initialStep + numberOfHiddenSteps));
|
104
104
|
}
|
105
|
-
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep, modalIsOpen]);
|
105
|
+
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep, modalIsOpen, stepLength]);
|
106
106
|
useEffect(() => {
|
107
|
-
|
108
|
-
checkForValidInitialStep();
|
109
|
-
}
|
107
|
+
checkForValidInitialStep();
|
110
108
|
|
111
109
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
112
|
-
}, [initialStep
|
110
|
+
}, [initialStep]);
|
113
111
|
useCreateComponentFocus({
|
114
112
|
previousState,
|
115
113
|
currentStep,
|
@@ -141,11 +139,7 @@ let CreateFullPage = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
141
139
|
setModalIsOpen
|
142
140
|
});
|
143
141
|
const checkForValidInitialStep = () => {
|
144
|
-
|
145
|
-
|
146
|
-
if (initialStep && stepData?.length && Number(initialStep) > Number(stepData?.length) || Number(initialStep) <= 0) {
|
147
|
-
invalidInitialStepWarned.current = true;
|
148
|
-
setCurrentStep(1);
|
142
|
+
if (initialStep && stepLength && Number(initialStep) > stepLength || Number(initialStep) <= 0) {
|
149
143
|
console.warn(`${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 ${componentName} has.`);
|
150
144
|
}
|
151
145
|
};
|
@@ -82,7 +82,7 @@ let CreateTearsheet = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
82
82
|
});
|
83
83
|
const contentRef = useRef(null);
|
84
84
|
useEffect(() => {
|
85
|
-
const firstItem = stepData.findIndex(item => item
|
85
|
+
const firstItem = stepData.findIndex(item => item?.shouldIncludeStep) + 1;
|
86
86
|
const lastItem = lastIndexInArray(stepData, 'shouldIncludeStep', true);
|
87
87
|
if (firstItem !== firstIncludedStep) {
|
88
88
|
setCurrentStep(firstItem);
|
@@ -18,6 +18,7 @@ type fieldsetLegendTextProps = {
|
|
18
18
|
* Otherwise, use CSS to hide/remove this label text.
|
19
19
|
*/
|
20
20
|
fieldsetLegendText?: string;
|
21
|
+
fieldsetLegendId?: React.ReactNode;
|
21
22
|
} | {
|
22
23
|
/**
|
23
24
|
* This optional prop will render your form content inside of a fieldset html element
|
@@ -31,6 +32,7 @@ type fieldsetLegendTextProps = {
|
|
31
32
|
* Otherwise, use CSS to hide/remove this label text.
|
32
33
|
*/
|
33
34
|
fieldsetLegendText: string;
|
35
|
+
fieldsetLegendId: React.ReactNode;
|
34
36
|
};
|
35
37
|
interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
36
38
|
/**
|
@@ -44,6 +44,7 @@ let CreateTearsheetStep = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
44
44
|
disableSubmit,
|
45
45
|
experimentalSecondarySubmit,
|
46
46
|
fieldsetLegendText,
|
47
|
+
fieldsetLegendId,
|
47
48
|
hasFieldset = defaults.hasFieldset,
|
48
49
|
includeStep = defaults.includeStep,
|
49
50
|
introStep,
|
@@ -151,13 +152,14 @@ let CreateTearsheetStep = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
151
152
|
sm: 4
|
152
153
|
}, /*#__PURE__*/React__default.createElement("h4", {
|
153
154
|
className: `${blockClass}--title`
|
154
|
-
}, title), subtitle && /*#__PURE__*/React__default.createElement("
|
155
|
+
}, title), subtitle && /*#__PURE__*/React__default.createElement("h5", {
|
155
156
|
className: `${blockClass}--subtitle`
|
156
157
|
}, subtitle), renderDescription()), /*#__PURE__*/React__default.createElement(Column, {
|
157
158
|
span: 100
|
158
159
|
}, hasFieldset ? /*#__PURE__*/React__default.createElement(FormGroup, {
|
159
160
|
legendText: fieldsetLegendText,
|
160
|
-
className: `${blockClass}--fieldset
|
161
|
+
className: `${blockClass}--fieldset`,
|
162
|
+
legendId: fieldsetLegendId
|
161
163
|
}, children) : children))) : pconsole.warn(`You have tried using a ${componentName} component outside of a CreateTearsheet. This is not allowed. ${componentName}s should always be children of the CreateTearsheet`);
|
162
164
|
});
|
163
165
|
|
@@ -195,16 +197,26 @@ CreateTearsheetStep.propTypes = {
|
|
195
197
|
hideSecondarySubmit: PropTypes.bool,
|
196
198
|
onClick: PropTypes.func
|
197
199
|
}),
|
200
|
+
/**
|
201
|
+
* This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
|
202
|
+
*/
|
203
|
+
/**@ts-ignore*/
|
204
|
+
fieldsetLegendId: PropTypes.node.isRequired.if(_ref2 => {
|
205
|
+
let {
|
206
|
+
hasFieldset
|
207
|
+
} = _ref2;
|
208
|
+
return !!hasFieldset;
|
209
|
+
}),
|
198
210
|
/**
|
199
211
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
200
212
|
* 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 step content.
|
201
213
|
* Otherwise, use CSS to hide/remove this label text.
|
202
214
|
*/
|
203
215
|
/**@ts-ignore*/
|
204
|
-
fieldsetLegendText: PropTypes.string.isRequired.if(
|
216
|
+
fieldsetLegendText: PropTypes.string.isRequired.if(_ref3 => {
|
205
217
|
let {
|
206
218
|
hasFieldset
|
207
|
-
} =
|
219
|
+
} = _ref3;
|
208
220
|
return !!hasFieldset;
|
209
221
|
}),
|
210
222
|
/**
|
@@ -143,7 +143,13 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
143
143
|
// Set the notifications passed to the state within this component
|
144
144
|
setAllNotifications(data);
|
145
145
|
}, [data]);
|
146
|
-
useClickOutside(ref || notificationPanelRef,
|
146
|
+
useClickOutside(ref || notificationPanelRef, target => {
|
147
|
+
const element = target;
|
148
|
+
if (!isActionableElement(element)) {
|
149
|
+
setTimeout(() => {
|
150
|
+
triggerButtonRef?.current?.focus();
|
151
|
+
}, 100);
|
152
|
+
}
|
147
153
|
onClickOutside?.();
|
148
154
|
});
|
149
155
|
const handleKeydown = event => {
|
@@ -303,6 +309,17 @@ let NotificationsPanel = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
303
309
|
size: 16
|
304
310
|
}))));
|
305
311
|
};
|
312
|
+
const isActionableElement = el => {
|
313
|
+
if (!el) {
|
314
|
+
return false;
|
315
|
+
}
|
316
|
+
const interactiveRoles = new Set(['button', 'link', 'textbox', 'checkbox', 'radio', 'slider', 'spinbutton', 'combobox', 'switch', 'menuitem']);
|
317
|
+
const actionableAncestor = el.closest('button, a, input, select, textarea, [tabindex], [contenteditable="true"], [role]');
|
318
|
+
if (!actionableAncestor) {
|
319
|
+
return false;
|
320
|
+
}
|
321
|
+
return actionableAncestor instanceof HTMLButtonElement || actionableAncestor instanceof HTMLAnchorElement || actionableAncestor instanceof HTMLInputElement || actionableAncestor instanceof HTMLSelectElement || actionableAncestor instanceof HTMLTextAreaElement || actionableAncestor.tabIndex >= 0 || actionableAncestor.isContentEditable || interactiveRoles.has(actionableAncestor.getAttribute('role')?.toLowerCase() ?? '');
|
322
|
+
};
|
306
323
|
const dismissSingleNotification = (event, notification) => {
|
307
324
|
event.preventDefault();
|
308
325
|
event.stopPropagation();
|
@@ -33,6 +33,7 @@ const defaults = {
|
|
33
33
|
animateTitle: true,
|
34
34
|
closeIconDescription: 'Close',
|
35
35
|
currentStep: 0,
|
36
|
+
hideCloseButton: false,
|
36
37
|
navigationBackIconDescription: 'Back',
|
37
38
|
placement: 'right',
|
38
39
|
size: 'md'
|
@@ -55,6 +56,7 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
55
56
|
condensedActions,
|
56
57
|
currentStep = defaults.currentStep,
|
57
58
|
decorator,
|
59
|
+
hideCloseButton = defaults.hideCloseButton,
|
58
60
|
id = blockClass,
|
59
61
|
includeOverlay,
|
60
62
|
labelText,
|
@@ -452,7 +454,7 @@ const SidePanelBase = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
452
454
|
ref: labelTextRef
|
453
455
|
}, labelText), title && title.length && renderTitle(), /*#__PURE__*/React__default.createElement("div", {
|
454
456
|
className: `${blockClass}__decorator-and-close`
|
455
|
-
}, normalizedDecorator, /*#__PURE__*/React__default.createElement(IconButton, {
|
457
|
+
}, normalizedDecorator, !hideCloseButton && /*#__PURE__*/React__default.createElement(IconButton, {
|
456
458
|
className: `${blockClass}__close-button`,
|
457
459
|
label: closeIconDescription,
|
458
460
|
onClick: onRequestClose,
|
@@ -628,6 +630,10 @@ SidePanel.propTypes = {
|
|
628
630
|
* Sets the current step of the side panel
|
629
631
|
*/
|
630
632
|
currentStep: PropTypes.number,
|
633
|
+
/**
|
634
|
+
* Show/hide the "X" close button.
|
635
|
+
*/
|
636
|
+
hideCloseButton: PropTypes.bool,
|
631
637
|
/**
|
632
638
|
* Unique identifier
|
633
639
|
*/
|
@@ -269,7 +269,7 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
269
269
|
[`${bc}__header--no-close-icon`]: !effectiveHasCloseIcon
|
270
270
|
}),
|
271
271
|
closeModal: onClose,
|
272
|
-
iconDescription: closeIconDescription
|
272
|
+
iconDescription: effectiveHasCloseIcon ? closeIconDescription : undefined
|
273
273
|
}, /*#__PURE__*/React__default.createElement(Wrap, {
|
274
274
|
className: `${bc}__header-content`,
|
275
275
|
element: wide ? Layer : undefined
|
@@ -297,7 +297,9 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
297
297
|
}),
|
298
298
|
neverRender: influencerPosition === 'right',
|
299
299
|
element: SectionLevel3
|
300
|
-
},
|
300
|
+
}, /*#__PURE__*/React__default.createElement(Wrap, {
|
301
|
+
element: Layer
|
302
|
+
}, influencer)), /*#__PURE__*/React__default.createElement(Wrap, {
|
301
303
|
className: `${bc}__right`
|
302
304
|
}, /*#__PURE__*/React__default.createElement(Wrap, {
|
303
305
|
className: `${bc}__main`,
|
@@ -306,14 +308,18 @@ const TearsheetShell = /*#__PURE__*/React__default.forwardRef((_ref2, ref) => {
|
|
306
308
|
className: `${bc}__content`,
|
307
309
|
alwaysRender: !!(influencer && influencerPosition === 'right'),
|
308
310
|
element: SectionLevel3
|
309
|
-
},
|
311
|
+
}, /*#__PURE__*/React__default.createElement(Wrap, {
|
312
|
+
element: !wide ? Layer : undefined
|
313
|
+
}, children)), /*#__PURE__*/React__default.createElement(Wrap, {
|
310
314
|
className: cx({
|
311
315
|
[`${bc}__influencer`]: true,
|
312
316
|
[`${bc}__influencer--wide`]: influencerWidth === 'wide'
|
313
317
|
}),
|
314
318
|
neverRender: influencerPosition !== 'right',
|
315
319
|
element: SectionLevel3
|
316
|
-
},
|
320
|
+
}, /*#__PURE__*/React__default.createElement(Wrap, {
|
321
|
+
element: Layer
|
322
|
+
}, influencer))), includeActions && /*#__PURE__*/React__default.createElement(Wrap, {
|
317
323
|
className: `${bc}__button-container`
|
318
324
|
}, /*#__PURE__*/React__default.createElement(ActionSet, {
|
319
325
|
actions: actions,
|
@@ -5,7 +5,7 @@
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
6
6
|
*/
|
7
7
|
|
8
|
-
import { getAttributes } from '
|
8
|
+
import { getAttributes } from '../node_modules/@carbon/icon-helpers/es/index.js';
|
9
9
|
import PropTypes from '../../../../_virtual/index.js';
|
10
10
|
import React__default from 'react';
|
11
11
|
|
@@ -99,14 +99,15 @@ const Card = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
99
99
|
id,
|
100
100
|
itemText,
|
101
101
|
onKeyDown,
|
102
|
-
onClick
|
102
|
+
onClick,
|
103
|
+
...rest
|
103
104
|
} = _ref2;
|
104
|
-
return /*#__PURE__*/React.createElement(react.MenuItem, {
|
105
|
+
return /*#__PURE__*/React.createElement(react.MenuItem, _rollupPluginBabelHelpers.extends({}, rest, {
|
105
106
|
key: id,
|
106
107
|
label: itemText ?? '',
|
107
108
|
onKeyDown: onKeyDown,
|
108
109
|
onClick: onClick
|
109
|
-
});
|
110
|
+
}));
|
110
111
|
}))));
|
111
112
|
}
|
112
113
|
const icons = getIcons().map(_ref3 => {
|
@@ -88,7 +88,7 @@ exports.CreateFullPage = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
88
88
|
const [stepData, setStepData] = React.useState([]);
|
89
89
|
const [firstIncludedStep, setFirstIncludedStep] = React.useState(1);
|
90
90
|
const [lastIncludedStep, setLastIncludedStep] = React.useState();
|
91
|
-
const
|
91
|
+
const stepLength = React.Children.toArray(children).filter(item => /*#__PURE__*/React.isValidElement(item) && item.props.includeStep !== false).length;
|
92
92
|
React.useEffect(() => {
|
93
93
|
const firstItem = stepData.findIndex(item => item?.shouldIncludeStep) + 1;
|
94
94
|
const lastItem = lastIndexInArray.lastIndexInArray(stepData, 'shouldIncludeStep', true);
|
@@ -98,20 +98,18 @@ exports.CreateFullPage = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
98
98
|
if (lastItem !== lastIncludedStep) {
|
99
99
|
setLastIncludedStep(lastItem);
|
100
100
|
}
|
101
|
-
|
102
|
-
|
103
|
-
if (initialStep) {
|
101
|
+
if (Number(initialStep) > stepLength || Number(initialStep) <= 0) {
|
102
|
+
setCurrentStep(1);
|
103
|
+
} else if (initialStep) {
|
104
104
|
const numberOfHiddenSteps = getNumberOfHiddenSteps.getNumberOfHiddenSteps(stepData, initialStep);
|
105
105
|
setCurrentStep(Number(initialStep + numberOfHiddenSteps));
|
106
106
|
}
|
107
|
-
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep, modalIsOpen]);
|
107
|
+
}, [stepData, firstIncludedStep, lastIncludedStep, initialStep, modalIsOpen, stepLength]);
|
108
108
|
React.useEffect(() => {
|
109
|
-
|
110
|
-
checkForValidInitialStep();
|
111
|
-
}
|
109
|
+
checkForValidInitialStep();
|
112
110
|
|
113
111
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
114
|
-
}, [initialStep
|
112
|
+
}, [initialStep]);
|
115
113
|
useCreateComponentFocus.useCreateComponentFocus({
|
116
114
|
previousState,
|
117
115
|
currentStep,
|
@@ -143,11 +141,7 @@ exports.CreateFullPage = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
143
141
|
setModalIsOpen
|
144
142
|
});
|
145
143
|
const checkForValidInitialStep = () => {
|
146
|
-
|
147
|
-
|
148
|
-
if (initialStep && stepData?.length && Number(initialStep) > Number(stepData?.length) || Number(initialStep) <= 0) {
|
149
|
-
invalidInitialStepWarned.current = true;
|
150
|
-
setCurrentStep(1);
|
144
|
+
if (initialStep && stepLength && Number(initialStep) > stepLength || Number(initialStep) <= 0) {
|
151
145
|
console.warn(`${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 ${componentName} has.`);
|
152
146
|
}
|
153
147
|
};
|
@@ -84,7 +84,7 @@ exports.CreateTearsheet = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
84
84
|
});
|
85
85
|
const contentRef = React.useRef(null);
|
86
86
|
React.useEffect(() => {
|
87
|
-
const firstItem = stepData.findIndex(item => item
|
87
|
+
const firstItem = stepData.findIndex(item => item?.shouldIncludeStep) + 1;
|
88
88
|
const lastItem = lastIndexInArray.lastIndexInArray(stepData, 'shouldIncludeStep', true);
|
89
89
|
if (firstItem !== firstIncludedStep) {
|
90
90
|
setCurrentStep(firstItem);
|
@@ -18,6 +18,7 @@ type fieldsetLegendTextProps = {
|
|
18
18
|
* Otherwise, use CSS to hide/remove this label text.
|
19
19
|
*/
|
20
20
|
fieldsetLegendText?: string;
|
21
|
+
fieldsetLegendId?: React.ReactNode;
|
21
22
|
} | {
|
22
23
|
/**
|
23
24
|
* This optional prop will render your form content inside of a fieldset html element
|
@@ -31,6 +32,7 @@ type fieldsetLegendTextProps = {
|
|
31
32
|
* Otherwise, use CSS to hide/remove this label text.
|
32
33
|
*/
|
33
34
|
fieldsetLegendText: string;
|
35
|
+
fieldsetLegendId: React.ReactNode;
|
34
36
|
};
|
35
37
|
interface CreateTearsheetStepBaseProps extends PropsWithChildren {
|
36
38
|
/**
|
@@ -46,6 +46,7 @@ exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
46
46
|
disableSubmit,
|
47
47
|
experimentalSecondarySubmit,
|
48
48
|
fieldsetLegendText,
|
49
|
+
fieldsetLegendId,
|
49
50
|
hasFieldset = defaults.hasFieldset,
|
50
51
|
includeStep = defaults.includeStep,
|
51
52
|
introStep,
|
@@ -153,13 +154,14 @@ exports.CreateTearsheetStep = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
153
154
|
sm: 4
|
154
155
|
}, /*#__PURE__*/React.createElement("h4", {
|
155
156
|
className: `${blockClass}--title`
|
156
|
-
}, title), subtitle && /*#__PURE__*/React.createElement("
|
157
|
+
}, title), subtitle && /*#__PURE__*/React.createElement("h5", {
|
157
158
|
className: `${blockClass}--subtitle`
|
158
159
|
}, subtitle), renderDescription()), /*#__PURE__*/React.createElement(react.Column, {
|
159
160
|
span: 100
|
160
161
|
}, hasFieldset ? /*#__PURE__*/React.createElement(react.FormGroup, {
|
161
162
|
legendText: fieldsetLegendText,
|
162
|
-
className: `${blockClass}--fieldset
|
163
|
+
className: `${blockClass}--fieldset`,
|
164
|
+
legendId: fieldsetLegendId
|
163
165
|
}, children) : children))) : pconsole.default.warn(`You have tried using a ${componentName} component outside of a CreateTearsheet. This is not allowed. ${componentName}s should always be children of the CreateTearsheet`);
|
164
166
|
});
|
165
167
|
|
@@ -197,16 +199,26 @@ exports.CreateTearsheetStep.propTypes = {
|
|
197
199
|
hideSecondarySubmit: index.default.bool,
|
198
200
|
onClick: index.default.func
|
199
201
|
}),
|
202
|
+
/**
|
203
|
+
* This is the required legend id that appears as the aria-labelledby of fieldset for accessibility purposes.
|
204
|
+
*/
|
205
|
+
/**@ts-ignore*/
|
206
|
+
fieldsetLegendId: index.default.node.isRequired.if(_ref2 => {
|
207
|
+
let {
|
208
|
+
hasFieldset
|
209
|
+
} = _ref2;
|
210
|
+
return !!hasFieldset;
|
211
|
+
}),
|
200
212
|
/**
|
201
213
|
* This is the required legend text that appears above a fieldset html element for accessibility purposes.
|
202
214
|
* 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 step content.
|
203
215
|
* Otherwise, use CSS to hide/remove this label text.
|
204
216
|
*/
|
205
217
|
/**@ts-ignore*/
|
206
|
-
fieldsetLegendText: index.default.string.isRequired.if(
|
218
|
+
fieldsetLegendText: index.default.string.isRequired.if(_ref3 => {
|
207
219
|
let {
|
208
220
|
hasFieldset
|
209
|
-
} =
|
221
|
+
} = _ref3;
|
210
222
|
return !!hasFieldset;
|
211
223
|
}),
|
212
224
|
/**
|
@@ -145,7 +145,13 @@ exports.NotificationsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
145
145
|
// Set the notifications passed to the state within this component
|
146
146
|
setAllNotifications(data);
|
147
147
|
}, [data]);
|
148
|
-
useClickOutside.useClickOutside(ref || notificationPanelRef,
|
148
|
+
useClickOutside.useClickOutside(ref || notificationPanelRef, target => {
|
149
|
+
const element = target;
|
150
|
+
if (!isActionableElement(element)) {
|
151
|
+
setTimeout(() => {
|
152
|
+
triggerButtonRef?.current?.focus();
|
153
|
+
}, 100);
|
154
|
+
}
|
149
155
|
onClickOutside?.();
|
150
156
|
});
|
151
157
|
const handleKeydown = event => {
|
@@ -305,6 +311,17 @@ exports.NotificationsPanel = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
305
311
|
size: 16
|
306
312
|
}))));
|
307
313
|
};
|
314
|
+
const isActionableElement = el => {
|
315
|
+
if (!el) {
|
316
|
+
return false;
|
317
|
+
}
|
318
|
+
const interactiveRoles = new Set(['button', 'link', 'textbox', 'checkbox', 'radio', 'slider', 'spinbutton', 'combobox', 'switch', 'menuitem']);
|
319
|
+
const actionableAncestor = el.closest('button, a, input, select, textarea, [tabindex], [contenteditable="true"], [role]');
|
320
|
+
if (!actionableAncestor) {
|
321
|
+
return false;
|
322
|
+
}
|
323
|
+
return actionableAncestor instanceof HTMLButtonElement || actionableAncestor instanceof HTMLAnchorElement || actionableAncestor instanceof HTMLInputElement || actionableAncestor instanceof HTMLSelectElement || actionableAncestor instanceof HTMLTextAreaElement || actionableAncestor.tabIndex >= 0 || actionableAncestor.isContentEditable || interactiveRoles.has(actionableAncestor.getAttribute('role')?.toLowerCase() ?? '');
|
324
|
+
};
|
308
325
|
const dismissSingleNotification = (event, notification) => {
|
309
326
|
event.preventDefault();
|
310
327
|
event.stopPropagation();
|
@@ -35,6 +35,7 @@ const defaults = {
|
|
35
35
|
animateTitle: true,
|
36
36
|
closeIconDescription: 'Close',
|
37
37
|
currentStep: 0,
|
38
|
+
hideCloseButton: false,
|
38
39
|
navigationBackIconDescription: 'Back',
|
39
40
|
placement: 'right',
|
40
41
|
size: 'md'
|
@@ -57,6 +58,7 @@ const SidePanelBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
57
58
|
condensedActions,
|
58
59
|
currentStep = defaults.currentStep,
|
59
60
|
decorator,
|
61
|
+
hideCloseButton = defaults.hideCloseButton,
|
60
62
|
id = blockClass,
|
61
63
|
includeOverlay,
|
62
64
|
labelText,
|
@@ -454,7 +456,7 @@ const SidePanelBase = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
454
456
|
ref: labelTextRef
|
455
457
|
}, labelText), title && title.length && renderTitle(), /*#__PURE__*/React.createElement("div", {
|
456
458
|
className: `${blockClass}__decorator-and-close`
|
457
|
-
}, normalizedDecorator, /*#__PURE__*/React.createElement(react.IconButton, {
|
459
|
+
}, normalizedDecorator, !hideCloseButton && /*#__PURE__*/React.createElement(react.IconButton, {
|
458
460
|
className: `${blockClass}__close-button`,
|
459
461
|
label: closeIconDescription,
|
460
462
|
onClick: onRequestClose,
|
@@ -630,6 +632,10 @@ SidePanel.propTypes = {
|
|
630
632
|
* Sets the current step of the side panel
|
631
633
|
*/
|
632
634
|
currentStep: index.default.number,
|
635
|
+
/**
|
636
|
+
* Show/hide the "X" close button.
|
637
|
+
*/
|
638
|
+
hideCloseButton: index.default.bool,
|
633
639
|
/**
|
634
640
|
* Unique identifier
|
635
641
|
*/
|
@@ -271,7 +271,7 @@ const TearsheetShell = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
271
271
|
[`${bc}__header--no-close-icon`]: !effectiveHasCloseIcon
|
272
272
|
}),
|
273
273
|
closeModal: onClose,
|
274
|
-
iconDescription: closeIconDescription
|
274
|
+
iconDescription: effectiveHasCloseIcon ? closeIconDescription : undefined
|
275
275
|
}, /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
276
276
|
className: `${bc}__header-content`,
|
277
277
|
element: wide ? react.Layer : undefined
|
@@ -299,7 +299,9 @@ const TearsheetShell = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
299
299
|
}),
|
300
300
|
neverRender: influencerPosition === 'right',
|
301
301
|
element: SectionLevel3
|
302
|
-
},
|
302
|
+
}, /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
303
|
+
element: react.Layer
|
304
|
+
}, influencer)), /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
303
305
|
className: `${bc}__right`
|
304
306
|
}, /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
305
307
|
className: `${bc}__main`,
|
@@ -308,14 +310,18 @@ const TearsheetShell = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
308
310
|
className: `${bc}__content`,
|
309
311
|
alwaysRender: !!(influencer && influencerPosition === 'right'),
|
310
312
|
element: SectionLevel3
|
311
|
-
},
|
313
|
+
}, /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
314
|
+
element: !wide ? react.Layer : undefined
|
315
|
+
}, children)), /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
312
316
|
className: cx({
|
313
317
|
[`${bc}__influencer`]: true,
|
314
318
|
[`${bc}__influencer--wide`]: influencerWidth === 'wide'
|
315
319
|
}),
|
316
320
|
neverRender: influencerPosition !== 'right',
|
317
321
|
element: SectionLevel3
|
318
|
-
},
|
322
|
+
}, /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
323
|
+
element: react.Layer
|
324
|
+
}, influencer))), includeActions && /*#__PURE__*/React.createElement(Wrap.Wrap, {
|
319
325
|
className: `${bc}__button-container`
|
320
326
|
}, /*#__PURE__*/React.createElement(ActionSet.ActionSet, {
|
321
327
|
actions: actions,
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
Object.defineProperty(exports, '__esModule', { value: true });
|
11
11
|
|
12
|
-
var index = require('
|
12
|
+
var index = require('../node_modules/@carbon/icon-helpers/es/index.js');
|
13
13
|
var index$1 = require('../../../../_virtual/index.js');
|
14
14
|
var React = require('react');
|
15
15
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "2.
|
4
|
+
"version": "2.70.0-rc.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -83,7 +83,6 @@
|
|
83
83
|
"@storybook/addon-docs": "^8.6.12",
|
84
84
|
"@storybook/addon-essentials": "^8.6.12",
|
85
85
|
"@storybook/addon-links": "^8.6.12",
|
86
|
-
"@storybook/addon-storysource": "^8.6.12",
|
87
86
|
"@storybook/addon-viewport": "^8.6.12",
|
88
87
|
"@storybook/components": "^8.6.12",
|
89
88
|
"@storybook/core-events": "^8.6.12",
|
@@ -91,11 +90,10 @@
|
|
91
90
|
"@storybook/manager-api": "^8.6.12",
|
92
91
|
"@storybook/react": "^8.6.12",
|
93
92
|
"@storybook/react-vite": "^8.6.12",
|
94
|
-
"@storybook/source-loader": "^8.6.12",
|
95
93
|
"@storybook/theming": "^8.6.12",
|
96
94
|
"@types/react-table": "^7.7.20",
|
97
95
|
"babel-plugin-dev-expression": "^0.2.3",
|
98
|
-
"babel-preset-ibm-cloud-cognitive": "^0.
|
96
|
+
"babel-preset-ibm-cloud-cognitive": "^0.28.0-rc.0",
|
99
97
|
"chalk": "^4.1.2",
|
100
98
|
"change-case": "5.4.4",
|
101
99
|
"classnames": "^2.5.1",
|
@@ -104,7 +102,7 @@
|
|
104
102
|
"fs-extra": "^11.3.0",
|
105
103
|
"glob": "^11.0.1",
|
106
104
|
"jest": "^29.7.0",
|
107
|
-
"jest-config-ibm-cloud-cognitive": "^1.
|
105
|
+
"jest-config-ibm-cloud-cognitive": "^1.29.0-rc.0",
|
108
106
|
"jest-environment-jsdom": "^29.7.0",
|
109
107
|
"namor": "^1.1.2",
|
110
108
|
"npm-check-updates": "^18.0.0",
|
@@ -119,11 +117,11 @@
|
|
119
117
|
},
|
120
118
|
"dependencies": {
|
121
119
|
"@babel/runtime": "^7.26.10",
|
122
|
-
"@carbon/feature-flags": "^0.
|
123
|
-
"@carbon/ibm-products-styles": "^2.
|
120
|
+
"@carbon/feature-flags": "^0.27.0",
|
121
|
+
"@carbon/ibm-products-styles": "^2.66.0-rc.0",
|
124
122
|
"@carbon/telemetry": "^0.1.0",
|
125
|
-
"@carbon/utilities": "^0.
|
126
|
-
"@carbon/utilities-react": "0.
|
123
|
+
"@carbon/utilities": "^0.7.0",
|
124
|
+
"@carbon/utilities-react": "0.9.0",
|
127
125
|
"@dnd-kit/core": "^6.3.1",
|
128
126
|
"@dnd-kit/modifiers": "^9.0.0",
|
129
127
|
"@dnd-kit/sortable": "^10.0.0",
|
@@ -133,14 +131,14 @@
|
|
133
131
|
"react-window": "^1.8.11"
|
134
132
|
},
|
135
133
|
"peerDependencies": {
|
136
|
-
"@carbon/grid": "^11.
|
137
|
-
"@carbon/layout": "^11.
|
138
|
-
"@carbon/motion": "^11.
|
139
|
-
"@carbon/react": "^1.
|
140
|
-
"@carbon/themes": "^11.
|
141
|
-
"@carbon/type": "^11.
|
134
|
+
"@carbon/grid": "^11.37.0",
|
135
|
+
"@carbon/layout": "^11.35.0",
|
136
|
+
"@carbon/motion": "^11.29.0",
|
137
|
+
"@carbon/react": "^1.84.0",
|
138
|
+
"@carbon/themes": "^11.54.0",
|
139
|
+
"@carbon/type": "^11.41.0",
|
142
140
|
"react": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0",
|
143
141
|
"react-dom": "^16.8.6 || ^17.0.1 || ^18.2.0 || ^19.0.0"
|
144
142
|
},
|
145
|
-
"gitHead": "
|
143
|
+
"gitHead": "a0df8e9f8fd3416467f69d3798933a850e9e0fad"
|
146
144
|
}
|
@@ -531,9 +531,9 @@ $clabs-prefix: 'clabs'; // TODO: remove when resizer available in labs
|
|
531
531
|
position: absolute;
|
532
532
|
z-index: 10; /* must be higher than title container border bottom */
|
533
533
|
display: flex;
|
534
|
+
block-size: $spacing-07;
|
534
535
|
inset-block-start: 0;
|
535
536
|
inset-inline-end: 0;
|
536
|
-
|
537
537
|
/* stylelint-disable-next-line max-nesting-depth */
|
538
538
|
@media (prefers-reduced-motion) {
|
539
539
|
position: absolute;
|