@carbon/ibm-products 1.5.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- package/css/index-full-carbon.css +389 -139
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +9 -3
- package/css/index-full-carbon.min.css.map +1 -0
- package/css/index-without-carbon-released-only.css +33 -27
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +3 -3
- package/css/index-without-carbon-released-only.min.css.map +1 -0
- package/css/index-without-carbon.css +330 -133
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +9 -3
- package/css/index-without-carbon.min.css.map +1 -0
- package/css/index.css +332 -135
- package/css/index.css.map +1 -1
- package/css/index.min.css +9 -3
- package/css/index.min.css.map +1 -0
- package/es/components/APIKeyModal/APIKeyModal.js +10 -13
- package/es/components/ActionBar/ActionBar.js +0 -3
- package/es/components/ActionBar/ActionBarItem.js +2 -6
- package/es/components/ActionSet/ActionSet.js +11 -13
- package/es/components/AddSelect/AddSelect.js +122 -72
- package/es/components/AddSelect/AddSelectBreadcrumbs.js +56 -0
- package/es/components/AddSelect/AddSelectList.js +94 -0
- package/es/components/AddSelect/AddSelectSidebar.js +110 -0
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -5
- package/es/components/ButtonMenu/ButtonMenu.js +6 -4
- package/es/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/es/components/Card/Card.js +37 -25
- package/es/components/Card/CardFooter.js +14 -10
- package/es/components/Card/CardHeader.js +8 -6
- package/es/components/Cascade/Cascade.js +5 -4
- package/es/components/ComboButton/ComboButton.js +0 -4
- package/es/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/es/components/CreateFullPage/CreateFullPageStep.js +15 -8
- package/es/components/CreateModal/CreateModal.js +1 -4
- package/es/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/es/components/CreateTearsheet/CreateTearsheetStep.js +18 -14
- package/es/components/DataSpreadsheet/DataSpreadsheet.js +414 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetBody.js +138 -0
- package/es/components/DataSpreadsheet/DataSpreadsheetHeader.js +64 -0
- package/es/components/DataSpreadsheet/createActiveCellFn.js +45 -0
- package/es/components/DataSpreadsheet/generateData.js +47 -0
- package/es/components/DataSpreadsheet/getCellSize.js +30 -0
- package/es/components/{CancelableTextEdit → DataSpreadsheet}/index.js +2 -2
- package/es/components/EditSidePanel/EditSidePanel.js +9 -10
- package/es/components/EmptyStates/EmptyState.js +8 -7
- package/es/components/EmptyStates/EmptyStateContent.js +2 -2
- package/es/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +5 -9
- package/es/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +5 -9
- package/es/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +5 -9
- package/es/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +5 -9
- package/es/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +5 -9
- package/es/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +5 -9
- package/es/components/ExampleComponent/ExampleComponent.js +12 -13
- package/es/components/ExportModal/ExportModal.js +13 -9
- package/es/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/es/components/ImportModal/ImportModal.js +7 -5
- package/es/components/InlineEdit/InlineEdit.js +256 -88
- package/es/components/LoadingBar/LoadingBar.js +13 -17
- package/es/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/es/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/es/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/es/components/NotificationsPanel/NotificationsPanel.js +125 -89
- package/es/components/OptionsTile/OptionsTile.js +6 -9
- package/es/components/PageHeader/PageHeader.js +19 -13
- package/es/components/PageHeader/PageHeaderTitle.js +10 -6
- package/es/components/ProductiveCard/ProductiveCard.js +23 -12
- package/es/components/RemoveModal/RemoveModal.js +0 -3
- package/es/components/SidePanel/SidePanel.js +54 -32
- package/es/components/TagSet/TagSet.js +13 -9
- package/es/components/TagSet/TagSetModal.js +16 -12
- package/es/components/TagSet/TagSetOverflow.js +21 -13
- package/es/components/Tearsheet/Tearsheet.js +27 -18
- package/es/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/es/components/Tearsheet/TearsheetShell.js +3 -4
- package/es/components/Toolbar/ToolbarButton.js +0 -3
- package/es/components/WebTerminal/WebTerminal.js +18 -19
- package/es/components/index.js +2 -2
- package/es/global/js/hooks/index.js +1 -0
- package/es/global/js/hooks/useActiveElement.js +27 -0
- package/es/global/js/package-settings.js +2 -1
- package/es/global/js/utils/Wrap.js +7 -5
- package/es/global/js/utils/getScrollbarWidth.js +14 -0
- package/es/settings.js +0 -5
- package/lib/components/APIKeyModal/APIKeyModal.js +10 -13
- package/lib/components/ActionBar/ActionBar.js +0 -3
- package/lib/components/ActionBar/ActionBarItem.js +2 -6
- package/lib/components/ActionSet/ActionSet.js +11 -13
- package/lib/components/AddSelect/AddSelect.js +126 -72
- package/lib/components/AddSelect/AddSelectBreadcrumbs.js +71 -0
- package/lib/components/AddSelect/AddSelectList.js +112 -0
- package/lib/components/AddSelect/AddSelectSidebar.js +122 -0
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +5 -5
- package/lib/components/ButtonMenu/ButtonMenu.js +6 -4
- package/lib/components/ButtonMenu/ButtonMenuItem.js +1 -2
- package/lib/components/Card/Card.js +37 -25
- package/lib/components/Card/CardFooter.js +14 -10
- package/lib/components/Card/CardHeader.js +8 -6
- package/lib/components/Cascade/Cascade.js +5 -4
- package/lib/components/ComboButton/ComboButton.js +0 -4
- package/lib/components/ComboButton/ComboButtonItem/index.js +0 -5
- package/lib/components/CreateFullPage/CreateFullPageStep.js +17 -14
- package/lib/components/CreateModal/CreateModal.js +1 -4
- package/lib/components/CreateTearsheet/CreateTearsheet.js +10 -11
- package/lib/components/CreateTearsheet/CreateTearsheetStep.js +20 -20
- package/lib/components/DataSpreadsheet/DataSpreadsheet.js +438 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetBody.js +161 -0
- package/lib/components/DataSpreadsheet/DataSpreadsheetHeader.js +80 -0
- package/lib/components/DataSpreadsheet/createActiveCellFn.js +56 -0
- package/lib/components/DataSpreadsheet/generateData.js +58 -0
- package/lib/components/DataSpreadsheet/getCellSize.js +39 -0
- package/lib/components/DataSpreadsheet/index.js +13 -0
- package/lib/components/EditSidePanel/EditSidePanel.js +9 -10
- package/lib/components/EmptyStates/EmptyState.js +10 -9
- package/lib/components/EmptyStates/EmptyStateContent.js +2 -2
- package/lib/components/EmptyStates/ErrorEmptyState/ErrorEmptyState.js +4 -8
- package/lib/components/EmptyStates/NoDataEmptyState/NoDataEmptyState.js +4 -8
- package/lib/components/EmptyStates/NoTagsEmptyState/NoTagsEmptyState.js +4 -8
- package/lib/components/EmptyStates/NotFoundEmptyState/NotFoundEmptyState.js +4 -8
- package/lib/components/EmptyStates/NotificationsEmptyState/NotificationsEmptyState.js +4 -8
- package/lib/components/EmptyStates/UnauthorizedEmptyState/UnauthorizedEmptyState.js +4 -8
- package/lib/components/ExampleComponent/ExampleComponent.js +12 -13
- package/lib/components/ExportModal/ExportModal.js +13 -9
- package/lib/components/ExpressiveCard/ExpressiveCard.js +0 -8
- package/lib/components/ImportModal/ImportModal.js +7 -5
- package/lib/components/InlineEdit/InlineEdit.js +253 -87
- package/lib/components/LoadingBar/LoadingBar.js +13 -17
- package/lib/components/ModifiedTabs/ModifiedTabLabelNew.js +0 -4
- package/lib/components/ModifiedTabs/ModifiedTabLabelWithClose.js +0 -5
- package/lib/components/ModifiedTabs/ModifiedTabs.js +24 -18
- package/lib/components/NotificationsPanel/NotificationsPanel.js +122 -87
- package/lib/components/OptionsTile/OptionsTile.js +6 -9
- package/lib/components/PageHeader/PageHeader.js +18 -12
- package/lib/components/PageHeader/PageHeaderTitle.js +10 -6
- package/lib/components/ProductiveCard/ProductiveCard.js +24 -18
- package/lib/components/RemoveModal/RemoveModal.js +0 -3
- package/lib/components/SidePanel/SidePanel.js +54 -32
- package/lib/components/TagSet/TagSet.js +13 -9
- package/lib/components/TagSet/TagSetModal.js +17 -13
- package/lib/components/TagSet/TagSetOverflow.js +24 -19
- package/lib/components/Tearsheet/Tearsheet.js +26 -17
- package/lib/components/Tearsheet/TearsheetNarrow.js +18 -15
- package/lib/components/Tearsheet/TearsheetShell.js +2 -3
- package/lib/components/Toolbar/ToolbarButton.js +0 -3
- package/lib/components/WebTerminal/WebTerminal.js +18 -19
- package/lib/components/index.js +8 -8
- package/lib/global/js/hooks/index.js +8 -0
- package/lib/global/js/hooks/useActiveElement.js +39 -0
- package/lib/global/js/package-settings.js +2 -1
- package/lib/global/js/utils/Wrap.js +7 -5
- package/lib/global/js/utils/getScrollbarWidth.js +23 -0
- package/lib/settings.js +0 -6
- package/package.json +25 -23
- package/scss/components/AddSelect/_add-select.scss +59 -5
- package/scss/components/BreadcrumbWithOverflow/_index.scss +1 -1
- package/scss/components/CreateInfluencer/_create-influencer.scss +4 -4
- package/scss/components/CreateTearsheet/_create-tearsheet.scss +2 -2
- package/scss/components/CreateTearsheetNarrow/_storybook-styles.scss +0 -6
- package/scss/components/DataSpreadsheet/_data-spreadsheet.scss +102 -0
- package/scss/components/{CancelableTextEdit → DataSpreadsheet}/_index.scss +2 -2
- package/scss/components/DataSpreadsheet/_storybook-styles.scss +6 -0
- package/scss/components/EditSidePanel/_storybook-styles.scss +0 -8
- package/scss/components/InlineEdit/_inline-edit.scss +293 -10
- package/scss/components/InlineEdit/_storybook-styles.scss +12 -6
- package/scss/components/LoadingBar/_storybook-styles.scss +0 -5
- package/scss/components/NotificationsPanel/_notifications-panel.scss +2 -2
- package/scss/components/OptionsTile/_storybook-styles.scss +0 -7
- package/scss/components/PageHeader/_index.scss +1 -1
- package/scss/components/PageHeader/_page-header.scss +4 -1
- package/scss/components/ProductiveCard/_productive-card.scss +0 -4
- package/scss/components/SidePanel/_side-panel.scss +15 -6
- package/scss/components/StatusIcon/_index.scss +1 -1
- package/scss/components/StatusIcon/_status-icon.scss +4 -4
- package/scss/components/TagSet/_index.scss +1 -1
- package/scss/components/UserProfileImage/_index.scss +1 -1
- package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
- package/scss/components/WebTerminal/_web-terminal.scss +2 -2
- package/scss/components/_index.scss +1 -1
- package/scss/global/styles/_project-settings.scss +5 -1
- package/es/components/CancelableTextEdit/CancelableTextEdit.js +0 -245
- package/es/generated/feature-flags/feature-flags.js +0 -15
- package/lib/components/CancelableTextEdit/CancelableTextEdit.js +0 -265
- package/lib/components/CancelableTextEdit/index.js +0 -13
- package/lib/generated/feature-flags/feature-flags.js +0 -22
- package/scss/components/CancelableTextEdit/_cancelable-text-edit.scss +0 -211
- package/scss/components/CancelableTextEdit/_storybook-styles.scss +0 -15
- package/scss/generated/feature-flags/_feature-flags.scss +0 -19
@@ -34,7 +34,16 @@ import { Close20, ArrowLeft20 } from '@carbon/icons-react';
|
|
34
34
|
import { ActionSet } from '../ActionSet';
|
35
35
|
var blockClass = "".concat(pkg.prefix, "--side-panel");
|
36
36
|
var componentName = 'SidePanel'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
37
|
+
// Default values for props
|
37
38
|
|
39
|
+
var defaults = {
|
40
|
+
animateTitle: true,
|
41
|
+
closeIconDescription: 'Close',
|
42
|
+
currentStep: 0,
|
43
|
+
navigationBackIconDescription: 'Back',
|
44
|
+
placement: 'right',
|
45
|
+
size: 'md'
|
46
|
+
};
|
38
47
|
/**
|
39
48
|
* Side panels keep users in-context of a page while performing tasks like navigating, editing, viewing details, or configuring something new.
|
40
49
|
*/
|
@@ -44,24 +53,30 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
44
53
|
|
45
54
|
var actionToolbarButtons = _ref.actionToolbarButtons,
|
46
55
|
actions = _ref.actions,
|
47
|
-
animateTitle = _ref.animateTitle,
|
56
|
+
_ref$animateTitle = _ref.animateTitle,
|
57
|
+
animateTitle = _ref$animateTitle === void 0 ? defaults.animateTitle : _ref$animateTitle,
|
48
58
|
children = _ref.children,
|
49
59
|
className = _ref.className,
|
50
|
-
|
60
|
+
_ref$closeIconDescrip = _ref.closeIconDescription,
|
61
|
+
closeIconDescription = _ref$closeIconDescrip === void 0 ? defaults.closeIconDescription : _ref$closeIconDescrip,
|
51
62
|
condensedActions = _ref.condensedActions,
|
52
|
-
currentStep = _ref.currentStep,
|
63
|
+
_ref$currentStep = _ref.currentStep,
|
64
|
+
currentStep = _ref$currentStep === void 0 ? defaults.currentStep : _ref$currentStep,
|
53
65
|
includeOverlay = _ref.includeOverlay,
|
54
66
|
labelText = _ref.labelText,
|
55
|
-
|
67
|
+
_ref$navigationBackIc = _ref.navigationBackIconDescription,
|
68
|
+
navigationBackIconDescription = _ref$navigationBackIc === void 0 ? defaults.navigationBackIconDescription : _ref$navigationBackIc,
|
56
69
|
onNavigationBack = _ref.onNavigationBack,
|
57
70
|
onRequestClose = _ref.onRequestClose,
|
58
71
|
onUnmount = _ref.onUnmount,
|
59
72
|
open = _ref.open,
|
60
|
-
placement = _ref.placement,
|
73
|
+
_ref$placement = _ref.placement,
|
74
|
+
placement = _ref$placement === void 0 ? defaults.placement : _ref$placement,
|
61
75
|
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
62
76
|
selectorPageContent = _ref.selectorPageContent,
|
63
77
|
selectorPrimaryFocus = _ref.selectorPrimaryFocus,
|
64
|
-
size = _ref.size,
|
78
|
+
_ref$size = _ref.size,
|
79
|
+
size = _ref$size === void 0 ? defaults.size : _ref$size,
|
65
80
|
slideIn = _ref.slideIn,
|
66
81
|
subtitle = _ref.subtitle,
|
67
82
|
title = _ref.title,
|
@@ -89,8 +104,12 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
89
104
|
var sidePanelInnerRef = useRef();
|
90
105
|
var sidePanelCloseRef = useRef();
|
91
106
|
var previousState = usePreviousValue({
|
92
|
-
size: size
|
93
|
-
|
107
|
+
size: size,
|
108
|
+
open: open
|
109
|
+
});
|
110
|
+
var reducedMotion = window && window.matchMedia ? window.matchMedia('(prefers-reduced-motion: reduce)') : {
|
111
|
+
matches: true
|
112
|
+
}; // scroll panel to top going between steps
|
94
113
|
|
95
114
|
useEffect(function () {
|
96
115
|
var panelRef = ref || sidePanelRef;
|
@@ -169,7 +188,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
169
188
|
|
170
189
|
|
171
190
|
useEffect(function () {
|
172
|
-
if (open && animateTitle && animationComplete && title && title.length) {
|
191
|
+
if (open && animateTitle && animationComplete && title && title.length && !reducedMotion.matches) {
|
173
192
|
var _document$querySelect2, _document$querySelect3, _document$querySelect4;
|
174
193
|
|
175
194
|
var sidePanelOuter = document.querySelector("#".concat(blockClass, "-outer"));
|
@@ -261,7 +280,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
261
280
|
_sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--subtitle-container-height"), "".concat(_sidePanelSubtitleElementHeight, "px"));
|
262
281
|
_sidePanelOuter === null || _sidePanelOuter === void 0 ? void 0 : _sidePanelOuter.style.setProperty("--".concat(blockClass, "--action-bar-container-height"), "".concat(sidePanelActionBarElementHeight, "px"));
|
263
282
|
}
|
264
|
-
}, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size]); // click outside functionality if `includeOverlay` prop is set
|
283
|
+
}, [open, animateTitle, animationComplete, shouldRender, panelHeight, title, size, reducedMotion.matches]); // click outside functionality if `includeOverlay` prop is set
|
265
284
|
|
266
285
|
useEffect(function () {
|
267
286
|
var handleOutsideClick = function handleOutsideClick(event) {
|
@@ -287,7 +306,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
287
306
|
return function () {
|
288
307
|
document.removeEventListener('click', handleOutsideClick);
|
289
308
|
};
|
290
|
-
}, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref]); // initialize the side panel to open
|
309
|
+
}, [includeOverlay, onRequestClose, open, preventCloseOnClickOutside, ref, onUnmount]); // initialize the side panel to open
|
291
310
|
|
292
311
|
useEffect(function () {
|
293
312
|
if (open) {
|
@@ -297,14 +316,21 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
297
316
|
|
298
317
|
var onAnimationEnd = function onAnimationEnd() {
|
299
318
|
if (!open) {
|
300
|
-
onUnmount
|
319
|
+
onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
301
320
|
setRender(false);
|
302
321
|
}
|
303
322
|
|
304
323
|
setAnimationComplete(true);
|
305
|
-
}; //
|
324
|
+
}; // Set the internal state `animationComplete` to true if
|
325
|
+
// prefers reduced motion is true
|
306
326
|
|
307
327
|
|
328
|
+
useEffect(function () {
|
329
|
+
if (reducedMotion.matches) {
|
330
|
+
setAnimationComplete(true);
|
331
|
+
}
|
332
|
+
}, [reducedMotion.matches]); // initializes the side panel to open
|
333
|
+
|
308
334
|
var _onAnimationStart = function onAnimationStart(event) {
|
309
335
|
event.persist();
|
310
336
|
var isPanelTarget = event.target.id === "".concat(blockClass, "-outer");
|
@@ -325,7 +351,13 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
325
351
|
pageContentElement.style.marginLeft = 0;
|
326
352
|
}
|
327
353
|
}
|
328
|
-
}, [open, placement, selectorPageContent, slideIn]);
|
354
|
+
}, [open, placement, selectorPageContent, slideIn]);
|
355
|
+
useEffect(function () {
|
356
|
+
if (!open && previousState !== null && previousState !== void 0 && previousState.open && reducedMotion.matches) {
|
357
|
+
setRender(false);
|
358
|
+
onUnmount === null || onUnmount === void 0 ? void 0 : onUnmount();
|
359
|
+
}
|
360
|
+
}, [open, onUnmount, reducedMotion.matches, previousState === null || previousState === void 0 ? void 0 : previousState.open]); // used to set margins of content for slide in panel version
|
329
361
|
|
330
362
|
useEffect(function () {
|
331
363
|
if (shouldRender && slideIn) {
|
@@ -333,15 +365,15 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
333
365
|
|
334
366
|
if (placement && placement === 'right' && pageContentElement) {
|
335
367
|
pageContentElement.style.marginRight = 0;
|
336
|
-
pageContentElement.style.transition = "margin-right ".concat(moderate02);
|
368
|
+
pageContentElement.style.transition = !reducedMotion.matches ? "margin-right ".concat(moderate02) : null;
|
337
369
|
pageContentElement.style.marginRight = SIDE_PANEL_SIZES[size];
|
338
370
|
} else if (pageContentElement) {
|
339
371
|
pageContentElement.style.marginLeft = 0;
|
340
|
-
pageContentElement.style.transition = "margin-left ".concat(moderate02);
|
372
|
+
pageContentElement.style.transition = !reducedMotion.matches ? "margin-left ".concat(moderate02) : null;
|
341
373
|
pageContentElement.style.marginLeft = SIDE_PANEL_SIZES[size];
|
342
374
|
}
|
343
375
|
}
|
344
|
-
}, [slideIn, selectorPageContent, placement, shouldRender, size]); // adds focus trap functionality
|
376
|
+
}, [slideIn, selectorPageContent, placement, shouldRender, size, reducedMotion.matches]); // adds focus trap functionality
|
345
377
|
|
346
378
|
/* istanbul ignore next */
|
347
379
|
|
@@ -368,7 +400,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
368
400
|
var _cx, _cx2;
|
369
401
|
|
370
402
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
371
|
-
className: cx("".concat(blockClass, "__title-container"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), _defineProperty(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), _defineProperty(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), _defineProperty(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), _defineProperty(_cx, "".concat(blockClass, "__title-container-without-title"), !title), _cx))
|
403
|
+
className: cx("".concat(blockClass, "__title-container"), (_cx = {}, _defineProperty(_cx, "".concat(blockClass, "__on-detail-step"), currentStep > 0), _defineProperty(_cx, "".concat(blockClass, "__on-detail-step-without-title"), currentStep > 0 && !title), _defineProperty(_cx, "".concat(blockClass, "__title-container--no-title-animation"), !animateTitle), _defineProperty(_cx, "".concat(blockClass, "__title-container-is-animating"), !animationComplete || !open), _defineProperty(_cx, "".concat(blockClass, "__title-container-without-title"), !title), _defineProperty(_cx, "".concat(blockClass, "__title-container--reduced-motion"), reducedMotion.matches), _cx))
|
372
404
|
}, currentStep > 0 && /*#__PURE__*/React.createElement(Button, {
|
373
405
|
"aria-label": navigationBackIconDescription,
|
374
406
|
kind: "ghost",
|
@@ -426,7 +458,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
426
458
|
className: "".concat(blockClass, "__title-text"),
|
427
459
|
title: title,
|
428
460
|
"aria-hidden": false
|
429
|
-
}, title), animateTitle && title && title.length && /*#__PURE__*/React.createElement("h2", {
|
461
|
+
}, title), animateTitle && title && title.length && !reducedMotion.matches && /*#__PURE__*/React.createElement("h2", {
|
430
462
|
className: "".concat(blockClass, "__collapsed-title-text"),
|
431
463
|
title: title,
|
432
464
|
"aria-hidden": true
|
@@ -443,7 +475,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
443
475
|
id: "".concat(blockClass, "-outer"),
|
444
476
|
className: mainPanelClassNames,
|
445
477
|
style: {
|
446
|
-
animation: "".concat(open ? placement === 'right' ? "
|
478
|
+
animation: !reducedMotion.matches ? "".concat(open ? placement === 'right' ? "side-panel-entrance-right ".concat(moderate02) : "side-panel-entrance-left ".concat(moderate02) : placement === 'right' ? "side-panel-exit-right ".concat(moderate02) : "side-panel-exit-left ".concat(moderate02)) : null
|
447
479
|
},
|
448
480
|
onAnimationEnd: onAnimationEnd,
|
449
481
|
onAnimationStart: function onAnimationStart(event) {
|
@@ -476,7 +508,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
476
508
|
ref: sidePanelOverlayRef,
|
477
509
|
className: "".concat(blockClass, "__overlay"),
|
478
510
|
style: {
|
479
|
-
animation: "".concat(open ? "
|
511
|
+
animation: !reducedMotion.matches ? "".concat(open ? "side-panel-overlay-entrance ".concat(moderate02) : "side-panel-overlay-exit ".concat(moderate02)) : null
|
480
512
|
}
|
481
513
|
}));
|
482
514
|
}); // Return a placeholder if not released and not enabled by feature flag
|
@@ -533,7 +565,7 @@ SidePanel.propTypes = {
|
|
533
565
|
/**
|
534
566
|
* Sets the close button icon description
|
535
567
|
*/
|
536
|
-
closeIconDescription: PropTypes.string
|
568
|
+
closeIconDescription: PropTypes.string,
|
537
569
|
|
538
570
|
/**
|
539
571
|
* Determines whether the side panel should render the condensed version (affects action buttons primarily)
|
@@ -630,14 +662,4 @@ SidePanel.propTypes = {
|
|
630
662
|
return labelText;
|
631
663
|
})
|
632
664
|
};
|
633
|
-
SidePanel.defaultProps = {
|
634
|
-
animateTitle: true,
|
635
|
-
placement: 'right',
|
636
|
-
size: 'md',
|
637
|
-
slideIn: false,
|
638
|
-
currentStep: 0,
|
639
|
-
navigationBackIconDescription: 'Back',
|
640
|
-
closeIconDescription: 'Close',
|
641
|
-
preventCloseOnClickOutside: false
|
642
|
-
};
|
643
665
|
SidePanel.displayName = componentName;
|
@@ -28,14 +28,23 @@ import { prepareProps, isRequiredIf } from '../../global/js/utils/props-helper';
|
|
28
28
|
import { pkg } from '../../settings';
|
29
29
|
var componentName = 'TagSet';
|
30
30
|
var blockClass = "".concat(pkg.prefix, "--tag-set");
|
31
|
-
var allTagsModalSearchThreshold = 10;
|
31
|
+
var allTagsModalSearchThreshold = 10; // Default values for props
|
32
|
+
|
33
|
+
var defaults = {
|
34
|
+
align: 'start',
|
35
|
+
overflowAlign: 'center',
|
36
|
+
overflowDirection: 'bottom'
|
37
|
+
};
|
32
38
|
export var TagSet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
33
|
-
var align = _ref.align,
|
39
|
+
var _ref$align = _ref.align,
|
40
|
+
align = _ref$align === void 0 ? defaults.align : _ref$align,
|
34
41
|
className = _ref.className,
|
35
42
|
maxVisible = _ref.maxVisible,
|
36
|
-
overflowAlign = _ref.overflowAlign,
|
43
|
+
_ref$overflowAlign = _ref.overflowAlign,
|
44
|
+
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
37
45
|
overflowClassName = _ref.overflowClassName,
|
38
|
-
|
46
|
+
_ref$overflowDirectio = _ref.overflowDirection,
|
47
|
+
overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
|
39
48
|
allTagsModalTitle = _ref.allTagsModalTitle,
|
40
49
|
allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
|
41
50
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
@@ -320,10 +329,5 @@ TagSet.propTypes = {
|
|
320
329
|
type: PropTypes.oneOf(tagTypes)
|
321
330
|
})))
|
322
331
|
};
|
323
|
-
TagSet.defaultProps = {
|
324
|
-
align: 'start',
|
325
|
-
overflowAlign: 'center',
|
326
|
-
overflowDirection: 'bottom'
|
327
|
-
};
|
328
332
|
TagSet.displayName = componentName;
|
329
333
|
export default TagSet;
|
@@ -1,8 +1,9 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
5
|
-
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["allTags", "className", "title", "onClose", "open", "searchLabel", "searchPlaceholder"],
|
6
|
+
_excluded2 = ["label"];
|
6
7
|
|
7
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
8
9
|
|
@@ -21,15 +22,22 @@ import { ComposedModal, ModalHeader, ModalBody, Search, Tag } from 'carbon-compo
|
|
21
22
|
import { pkg } from '../../settings';
|
22
23
|
import { prepareProps } from '../../global/js/utils/props-helper';
|
23
24
|
var componentName = 'TagSetModal';
|
24
|
-
var blockClass = "".concat(pkg.prefix, "--tag-set-modal");
|
25
|
+
var blockClass = "".concat(pkg.prefix, "--tag-set-modal"); // Default values for props
|
26
|
+
|
27
|
+
var defaults = {
|
28
|
+
// marked as required by TagSet if needed, default used to satisfy <Search /> component
|
29
|
+
searchLabel: ''
|
30
|
+
};
|
25
31
|
export var TagSetModal = function TagSetModal(_ref) {
|
26
32
|
var allTags = _ref.allTags,
|
27
33
|
className = _ref.className,
|
28
34
|
title = _ref.title,
|
29
35
|
onClose = _ref.onClose,
|
30
36
|
open = _ref.open,
|
31
|
-
searchLabel = _ref.searchLabel,
|
32
|
-
|
37
|
+
_ref$searchLabel = _ref.searchLabel,
|
38
|
+
searchLabel = _ref$searchLabel === void 0 ? defaults.searchLabel : _ref$searchLabel,
|
39
|
+
searchPlaceholder = _ref.searchPlaceholder,
|
40
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
33
41
|
|
34
42
|
var _useState = useState([]),
|
35
43
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -69,13 +77,13 @@ export var TagSetModal = function TagSetModal(_ref) {
|
|
69
77
|
setSearch(ev.target.value || '');
|
70
78
|
};
|
71
79
|
|
72
|
-
return /*#__PURE__*/React.createElement(ComposedModal, {
|
80
|
+
return /*#__PURE__*/React.createElement(ComposedModal, _extends({}, rest, {
|
73
81
|
containerClassName: "".concat(blockClass, "__container"),
|
74
82
|
className: cx(className, "".concat(blockClass)),
|
75
83
|
size: "sm",
|
76
84
|
open: open,
|
77
85
|
onClose: onClose
|
78
|
-
}, /*#__PURE__*/React.createElement(ModalHeader, {
|
86
|
+
}), /*#__PURE__*/React.createElement(ModalHeader, {
|
79
87
|
title: title,
|
80
88
|
className: "".concat(blockClass, "__header")
|
81
89
|
}, /*#__PURE__*/React.createElement(Search, {
|
@@ -90,7 +98,7 @@ export var TagSetModal = function TagSetModal(_ref) {
|
|
90
98
|
hasForm: true
|
91
99
|
}, filteredModalTags.map(function (_ref2, index) {
|
92
100
|
var label = _ref2.label,
|
93
|
-
other = _objectWithoutProperties(_ref2,
|
101
|
+
other = _objectWithoutProperties(_ref2, _excluded2);
|
94
102
|
|
95
103
|
return /*#__PURE__*/React.createElement(Tag, _extends({}, other, {
|
96
104
|
filter: false,
|
@@ -111,8 +119,4 @@ TagSetModal.propTypes = {
|
|
111
119
|
searchPlaceholder: PropTypes.string,
|
112
120
|
title: PropTypes.string
|
113
121
|
};
|
114
|
-
TagSetModal.defaultProps = {
|
115
|
-
// marked as required by TagSet if needed, default used to satisfy <Search /> component
|
116
|
-
searchLabel: ''
|
117
|
-
};
|
118
122
|
TagSetModal.displayName = componentName;
|
@@ -1,5 +1,8 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
+
var _excluded = ["allTagsModalSearchThreshold", "className", "onShowAllClick", "overflowAlign", "overflowDirection", "overflowTags", "showAllTagsLabel"];
|
3
6
|
//
|
4
7
|
// Copyright IBM Corp. 2021, 2021
|
5
8
|
//
|
@@ -13,15 +16,25 @@ import { Link, Tag, Tooltip } from 'carbon-components-react';
|
|
13
16
|
import { pkg } from '../../settings';
|
14
17
|
import { noop } from '../../global/js/utils/pconsole';
|
15
18
|
var componentName = 'TagSetOverflow';
|
16
|
-
var blockClass = "".concat(pkg.prefix, "--tag-set-overflow");
|
19
|
+
var blockClass = "".concat(pkg.prefix, "--tag-set-overflow"); // Default values for props
|
20
|
+
|
21
|
+
var defaults = {
|
22
|
+
allTagsModalSearchThreshold: 10,
|
23
|
+
overflowAlign: 'center',
|
24
|
+
overflowDirection: 'bottom'
|
25
|
+
};
|
17
26
|
export var TagSetOverflow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
18
|
-
var
|
19
|
-
|
27
|
+
var _ref$allTagsModalSear = _ref.allTagsModalSearchThreshold,
|
28
|
+
allTagsModalSearchThreshold = _ref$allTagsModalSear === void 0 ? defaults.allTagsModalSearchThreshold : _ref$allTagsModalSear,
|
29
|
+
className = _ref.className,
|
20
30
|
onShowAllClick = _ref.onShowAllClick,
|
21
|
-
overflowAlign = _ref.overflowAlign,
|
22
|
-
|
31
|
+
_ref$overflowAlign = _ref.overflowAlign,
|
32
|
+
overflowAlign = _ref$overflowAlign === void 0 ? defaults.overflowAlign : _ref$overflowAlign,
|
33
|
+
_ref$overflowDirectio = _ref.overflowDirection,
|
34
|
+
overflowDirection = _ref$overflowDirectio === void 0 ? defaults.overflowDirection : _ref$overflowDirectio,
|
35
|
+
overflowTags = _ref.overflowTags,
|
23
36
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
24
|
-
|
37
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
25
38
|
|
26
39
|
var _useState = useState(false),
|
27
40
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -42,11 +55,11 @@ export var TagSetOverflow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
42
55
|
onShowAllClick();
|
43
56
|
};
|
44
57
|
|
45
|
-
return /*#__PURE__*/React.createElement("span", {
|
58
|
+
return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
|
46
59
|
"aria-hidden": overflowTags.length === 0,
|
47
60
|
className: cx("".concat(blockClass), _defineProperty({}, "".concat(blockClass, "--hidden"), overflowTags.length === 0)),
|
48
61
|
ref: ref
|
49
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
62
|
+
}), /*#__PURE__*/React.createElement(Tooltip, {
|
50
63
|
align: overflowAlign,
|
51
64
|
className: cx(className, "".concat(blockClass, "__tooltip")),
|
52
65
|
direction: overflowDirection,
|
@@ -113,9 +126,4 @@ TagSetOverflow.propTypes = {
|
|
113
126
|
* label for the overflow show all tags link
|
114
127
|
*/
|
115
128
|
showAllTagsLabel: PropTypes.string
|
116
|
-
};
|
117
|
-
TagSetOverflow.defaultProps = {
|
118
|
-
allTagsModalSearchThreshold: 10,
|
119
|
-
overflowAlign: 'center',
|
120
|
-
overflowDirection: 'bottom'
|
121
129
|
};
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
import
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["influencerPosition", "influencerWidth", "verticalPosition"];
|
3
4
|
|
4
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
5
6
|
|
@@ -16,14 +17,20 @@ import React from 'react'; // Other standard imports.
|
|
16
17
|
|
17
18
|
import PropTypes from 'prop-types';
|
18
19
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
19
|
-
import { allPropTypes
|
20
|
+
import { allPropTypes } from '../../global/js/utils/props-helper';
|
20
21
|
import { pkg } from '../../settings'; // Carbon and package components we use.
|
21
22
|
|
22
23
|
import { Button } from 'carbon-components-react';
|
23
24
|
import { ActionSet } from '../ActionSet';
|
24
25
|
import { tearsheetHasCloseIcon, TearsheetShell } from './TearsheetShell';
|
25
26
|
var componentName = 'Tearsheet'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
27
|
+
// Default values for props
|
26
28
|
|
29
|
+
var defaults = {
|
30
|
+
influencerPosition: 'left',
|
31
|
+
influencerWidth: 'narrow',
|
32
|
+
verticalPosition: 'lower'
|
33
|
+
};
|
27
34
|
/**
|
28
35
|
* A tearsheet is a mostly full-screen type of dialog that keeps users
|
29
36
|
* in-context and focused by bringing actionable content front and center while
|
@@ -37,11 +44,22 @@ var componentName = 'Tearsheet'; // NOTE: the component SCSS is not imported her
|
|
37
44
|
* action buttons.
|
38
45
|
*/
|
39
46
|
|
40
|
-
export var Tearsheet = /*#__PURE__*/React.forwardRef(function (
|
41
|
-
|
47
|
+
export var Tearsheet = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
48
|
+
var _ref$influencerPositi = _ref.influencerPosition,
|
49
|
+
influencerPosition = _ref$influencerPositi === void 0 ? defaults.influencerPosition : _ref$influencerPositi,
|
50
|
+
_ref$influencerWidth = _ref.influencerWidth,
|
51
|
+
influencerWidth = _ref$influencerWidth === void 0 ? defaults.influencerWidth : _ref$influencerWidth,
|
52
|
+
_ref$verticalPosition = _ref.verticalPosition,
|
53
|
+
verticalPosition = _ref$verticalPosition === void 0 ? defaults.verticalPosition : _ref$verticalPosition,
|
54
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
55
|
+
|
56
|
+
return /*#__PURE__*/React.createElement(TearsheetShell, _objectSpread(_objectSpread(_objectSpread({}, getDevtoolsProps(componentName)), rest), {}, {
|
57
|
+
influencerPosition: influencerPosition,
|
58
|
+
influencerWidth: influencerWidth,
|
59
|
+
verticalPosition: verticalPosition,
|
42
60
|
ref: ref,
|
43
61
|
size: 'wide'
|
44
|
-
}))
|
62
|
+
}));
|
45
63
|
}); // Return a placeholder if not released and not enabled by feature flag
|
46
64
|
|
47
65
|
Tearsheet = pkg.checkComponentEnabled(Tearsheet, componentName); // The display name of the component, used by React. Note that displayName
|
@@ -100,9 +118,9 @@ Tearsheet.propTypes = _objectSpread({
|
|
100
118
|
* **Note:** This prop is only required if a close icon is shown, i.e. if
|
101
119
|
* there are a no navigation actions and/or hasCloseIcon is true.
|
102
120
|
*/
|
103
|
-
closeIconDescription: PropTypes.string.isRequired.if(function (
|
104
|
-
var actions =
|
105
|
-
hasCloseIcon =
|
121
|
+
closeIconDescription: PropTypes.string.isRequired.if(function (_ref2) {
|
122
|
+
var actions = _ref2.actions,
|
123
|
+
hasCloseIcon = _ref2.hasCloseIcon;
|
106
124
|
return tearsheetHasCloseIcon(actions, hasCloseIcon);
|
107
125
|
}),
|
108
126
|
|
@@ -168,13 +186,4 @@ Tearsheet.propTypes = _objectSpread({
|
|
168
186
|
* The main title of the tearsheet, displayed in the header area.
|
169
187
|
*/
|
170
188
|
title: PropTypes.node
|
171
|
-
}, deprecatedProps);
|
172
|
-
// props that are required, nor for props where the component can apply
|
173
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
174
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
175
|
-
|
176
|
-
Tearsheet.defaultProps = {
|
177
|
-
influencerPosition: 'left',
|
178
|
-
influencerWidth: 'narrow',
|
179
|
-
verticalPosition: 'lower'
|
180
|
-
};
|
189
|
+
}, deprecatedProps);
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
import
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
3
|
+
var _excluded = ["verticalPosition"];
|
3
4
|
|
4
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
5
6
|
|
@@ -23,7 +24,11 @@ import { Button } from 'carbon-components-react';
|
|
23
24
|
import { ActionSet } from '../ActionSet';
|
24
25
|
import { tearsheetHasCloseIcon, TearsheetShell, tearsheetShellWideProps as blocked } from './TearsheetShell';
|
25
26
|
var componentName = 'TearsheetNarrow'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
27
|
+
// Default values for props
|
26
28
|
|
29
|
+
var defaults = {
|
30
|
+
verticalPosition: 'lower'
|
31
|
+
};
|
27
32
|
/**
|
28
33
|
* A narrow tearsheet is a slimmer variant of the tearsheet, providing a dialog
|
29
34
|
* that keeps users in-context and focused by bringing actionable content front
|
@@ -33,11 +38,16 @@ var componentName = 'TearsheetNarrow'; // NOTE: the component SCSS is not import
|
|
33
38
|
* main content area, and a set of action buttons.
|
34
39
|
*/
|
35
40
|
|
36
|
-
export var TearsheetNarrow = /*#__PURE__*/React.forwardRef(function (
|
37
|
-
|
41
|
+
export var TearsheetNarrow = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
42
|
+
var _ref$verticalPosition = _ref.verticalPosition,
|
43
|
+
verticalPosition = _ref$verticalPosition === void 0 ? defaults.verticalPosition : _ref$verticalPosition,
|
44
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
45
|
+
|
46
|
+
return /*#__PURE__*/React.createElement(TearsheetShell, _objectSpread(_objectSpread(_objectSpread({}, getDevtoolsProps(componentName)), prepareProps(rest, blocked)), {}, {
|
47
|
+
verticalPosition: verticalPosition,
|
38
48
|
ref: ref,
|
39
49
|
size: 'narrow'
|
40
|
-
}))
|
50
|
+
}));
|
41
51
|
}); // Return a placeholder if not released and not enabled by feature flag
|
42
52
|
|
43
53
|
TearsheetNarrow = pkg.checkComponentEnabled(TearsheetNarrow, componentName); // The display name of the component, used by React. Note that displayName
|
@@ -96,9 +106,9 @@ TearsheetNarrow.propTypes = _objectSpread({
|
|
96
106
|
* **Note:** This prop is only required if a close icon is shown, i.e. if
|
97
107
|
* there are a no navigation actions and/or hasCloseIcon is true.
|
98
108
|
*/
|
99
|
-
closeIconDescription: PropTypes.string.isRequired.if(function (
|
100
|
-
var actions =
|
101
|
-
hasCloseIcon =
|
109
|
+
closeIconDescription: PropTypes.string.isRequired.if(function (_ref2) {
|
110
|
+
var actions = _ref2.actions,
|
111
|
+
hasCloseIcon = _ref2.hasCloseIcon;
|
102
112
|
return tearsheetHasCloseIcon(actions, hasCloseIcon);
|
103
113
|
}),
|
104
114
|
|
@@ -138,11 +148,4 @@ TearsheetNarrow.propTypes = _objectSpread({
|
|
138
148
|
* The main title of the tearsheet, displayed in the header area.
|
139
149
|
*/
|
140
150
|
title: PropTypes.node
|
141
|
-
}, deprecatedProps);
|
142
|
-
// props that are required, nor for props where the component can apply
|
143
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
144
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
145
|
-
|
146
|
-
TearsheetNarrow.defaultProps = {
|
147
|
-
verticalPosition: 'lower'
|
148
|
-
};
|
151
|
+
}, deprecatedProps);
|
@@ -15,7 +15,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
15
15
|
* LICENSE file in the root directory of this source tree.
|
16
16
|
*/
|
17
17
|
// Import portions of React that are needed.
|
18
|
-
import React, { useEffect,
|
18
|
+
import React, { useEffect, useState, useRef } from 'react';
|
19
19
|
import { useResizeDetector } from 'react-resize-detector'; // Other standard imports.
|
20
20
|
|
21
21
|
import PropTypes from 'prop-types';
|
@@ -120,10 +120,9 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
120
120
|
setTimeout(function () {
|
121
121
|
return element.focus();
|
122
122
|
}, 1);
|
123
|
-
};
|
123
|
+
};
|
124
124
|
|
125
|
-
|
126
|
-
useLayoutEffect(function () {
|
125
|
+
useEffect(function () {
|
127
126
|
var notify = function notify() {
|
128
127
|
return stack.all.forEach(function (handler) {
|
129
128
|
handler(Math.min(stack.open.length, maxDepth), stack.open.indexOf(handler) + 1);
|
@@ -50,8 +50,5 @@ ToolbarButton.propTypes = {
|
|
50
50
|
/** Provide an optional class to be applied to the containing node */
|
51
51
|
className: string
|
52
52
|
};
|
53
|
-
ToolbarButton.defaultProps = {
|
54
|
-
caret: false
|
55
|
-
};
|
56
53
|
ToolbarButton = pkg.checkComponentEnabled(ToolbarButton, componentName);
|
57
54
|
export { blockClass, ToolbarButton };
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["
|
5
|
+
var _excluded = ["actions", "children", "className", "closeIconDescription", "closeTerminal", "documentationLinks", "documentationLinksIconDescription", "open"];
|
6
6
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
8
8
|
|
@@ -25,18 +25,27 @@ import { Close16 as Close, Help16 as Help } from '@carbon/icons-react';
|
|
25
25
|
import { Button, OverflowMenu, OverflowMenuItem } from 'carbon-components-react'; // The block part of our conventional BEM class names (blockClass__E--M).
|
26
26
|
|
27
27
|
var componentName = 'WebTerminal';
|
28
|
-
var blockClass = "".concat(pkg.prefix, "--web-terminal");
|
28
|
+
var blockClass = "".concat(pkg.prefix, "--web-terminal"); // Default values for props
|
29
|
+
|
30
|
+
var defaults = {
|
31
|
+
actions: Object.freeze([]),
|
32
|
+
documentationLinks: Object.freeze([]),
|
33
|
+
documentationLinksIconDescription: 'Show documentation links'
|
34
|
+
};
|
29
35
|
export var WebTerminal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
30
36
|
var _ref2;
|
31
37
|
|
32
|
-
var
|
38
|
+
var _ref$actions = _ref.actions,
|
39
|
+
actions = _ref$actions === void 0 ? defaults.actions : _ref$actions,
|
40
|
+
children = _ref.children,
|
33
41
|
className = _ref.className,
|
42
|
+
closeIconDescription = _ref.closeIconDescription,
|
34
43
|
closeTerminal = _ref.closeTerminal,
|
35
|
-
|
36
|
-
|
44
|
+
_ref$documentationLin = _ref.documentationLinks,
|
45
|
+
documentationLinks = _ref$documentationLin === void 0 ? defaults.documentationLinks : _ref$documentationLin,
|
46
|
+
_ref$documentationLin2 = _ref.documentationLinksIconDescription,
|
47
|
+
documentationLinksIconDescription = _ref$documentationLin2 === void 0 ? defaults.documentationLinksIconDescription : _ref$documentationLin2,
|
37
48
|
open = _ref.open,
|
38
|
-
actions = _ref.actions,
|
39
|
-
closeIconDescription = _ref.closeIconDescription,
|
40
49
|
rest = _objectWithoutProperties(_ref, _excluded);
|
41
50
|
|
42
51
|
var _useState = useState(open),
|
@@ -61,9 +70,9 @@ export var WebTerminal = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
61
70
|
|
62
71
|
return shouldRender ? /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
63
72
|
ref: ref,
|
64
|
-
className: cx([blockClass, (_ref2 = {}, _defineProperty(_ref2, "".concat(blockClass, "--open"), open), _defineProperty(_ref2, "".concat(blockClass, "--closed"), !open),
|
73
|
+
className: cx([className, blockClass, (_ref2 = {}, _defineProperty(_ref2, "".concat(blockClass, "--open"), open), _defineProperty(_ref2, "".concat(blockClass, "--closed"), !open), _ref2)]),
|
65
74
|
style: {
|
66
|
-
animation: "".concat(open ? '
|
75
|
+
animation: "".concat(open ? 'web-terminal-entrance 250ms' : 'web-terminal-exit 250ms')
|
67
76
|
},
|
68
77
|
onAnimationEnd: onAnimationEnd
|
69
78
|
}), /*#__PURE__*/React.createElement("header", {
|
@@ -155,14 +164,4 @@ WebTerminal.propTypes = {
|
|
155
164
|
* Boolean that determines if the web terminal is opened or closed
|
156
165
|
*/
|
157
166
|
open: PropTypes.bool.isRequired
|
158
|
-
}; // Default values for component props. Default values are not required for
|
159
|
-
// props that are required, nor for props where the component can apply
|
160
|
-
// 'undefined' values reasonably. Default values should be provided when the
|
161
|
-
// component needs to make a choice or assumption when a prop is not supplied.
|
162
|
-
|
163
|
-
WebTerminal.defaultProps = {
|
164
|
-
actions: [],
|
165
|
-
documentationLinks: [],
|
166
|
-
documentationLinksIconDescription: 'Show documentation links',
|
167
|
-
className: ''
|
168
167
|
};
|
package/es/components/index.js
CHANGED
@@ -36,5 +36,5 @@ export { UserProfileImage } from './UserProfileImage';
|
|
36
36
|
export { WebTerminal } from './WebTerminal';
|
37
37
|
export { EditSidePanel } from './EditSidePanel';
|
38
38
|
export { OptionsTile } from './OptionsTile';
|
39
|
-
export {
|
40
|
-
export {
|
39
|
+
export { InlineEdit } from './InlineEdit';
|
40
|
+
export { DataSpreadsheet } from './DataSpreadsheet';
|