@carbon/ibm-products 0.99.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/index-full-carbon.css +895 -922
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +8 -8
- package/css/index-without-carbon-released-only.css +808 -796
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +8 -8
- package/css/index-without-carbon.css +895 -922
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +8 -8
- package/css/index.css +895 -922
- package/css/index.css.map +1 -1
- package/css/index.min.css +8 -8
- package/es/components/ActionBar/ActionBar.js +11 -36
- package/es/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +42 -115
- package/es/components/CreateSidePanel/CreateSidePanel.js +5 -17
- package/es/components/PageHeader/PageHeader.js +17 -100
- package/es/components/SidePanel/SidePanel.js +13 -28
- package/es/components/Tearsheet/Tearsheet.js +1 -10
- package/es/components/Tearsheet/TearsheetNarrow.js +1 -10
- package/es/components/Tearsheet/TearsheetShell.js +0 -10
- package/es/components/UserProfileImage/UserProfileImage.js +1 -1
- package/es/components/index.js +0 -1
- package/es/global/js/package-settings.js +1 -2
- package/lib/components/ActionBar/ActionBar.js +11 -37
- package/lib/components/BreadcrumbWithOverflow/BreadcrumbWithOverflow.js +44 -116
- package/lib/components/CreateSidePanel/CreateSidePanel.js +5 -19
- package/lib/components/PageHeader/PageHeader.js +16 -99
- package/lib/components/SidePanel/SidePanel.js +13 -29
- package/lib/components/Tearsheet/Tearsheet.js +0 -9
- package/lib/components/Tearsheet/TearsheetNarrow.js +0 -9
- package/lib/components/Tearsheet/TearsheetShell.js +0 -11
- package/lib/components/UserProfileImage/UserProfileImage.js +1 -1
- package/lib/components/index.js +0 -8
- package/lib/global/js/package-settings.js +1 -2
- package/package.json +2 -2
- package/scss/components/PageHeader/_page-header.scss +26 -5
- package/scss/components/UserProfileImage/_user-profile-image.scss +2 -2
- package/scss/components/_index.scss +0 -1
- package/scss/global/styles/_project-settings.scss +1 -1
- package/es/components/ContextHeader/ContextHeader.js +0 -46
- package/es/components/ContextHeader/index.js +0 -7
- package/lib/components/ContextHeader/ContextHeader.js +0 -62
- package/lib/components/ContextHeader/index.js +0 -15
- package/scss/components/ContextHeader/_context-header.scss +0 -43
- package/scss/components/ContextHeader/_index.scss +0 -8
@@ -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 = ["actionBarItems", "actionBarMenuOptionsClass", "actionBarOverflowAriaLabel", "
|
5
|
+
var _excluded = ["actionBarItems", "actionBarMenuOptionsClass", "actionBarOverflowAriaLabel", "allTagsModalSearchLabel", "allTagsModalSearchPlaceholderText", "allTagsModalTitle", "hasBackgroundAlways", "breadcrumbOverflowAriaLabel", "breadcrumbs", "children", "className", "collapseHeader", "collapseHeaderIconDescription", "collapseTitle", "disableBreadcrumbScroll", "expandHeaderIconDescription", "fullWidthGrid", "hasCollapseHeaderToggle", "narrowGrid", "navigation", "pageActions", "pageActionsOverflowLabel", "pageActionsMenuOptionsClass", "showAllTagsLabel", "subtitle", "tags", "title"];
|
6
6
|
|
7
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
8
8
|
|
@@ -19,10 +19,10 @@ import PropTypes from 'prop-types';
|
|
19
19
|
import { layout05, baseFontSize } from '@carbon/layout';
|
20
20
|
import cx from 'classnames';
|
21
21
|
import { useResizeDetector } from 'react-resize-detector';
|
22
|
-
import {
|
22
|
+
import { Grid, Column, Row, Button, Tag } from 'carbon-components-react';
|
23
23
|
import { useWindowResize, useNearestScroll } from '../../global/js/hooks';
|
24
24
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
25
|
-
import {
|
25
|
+
import { prepareProps } from '../../global/js/utils/props-helper';
|
26
26
|
import { pkg } from '../../settings';
|
27
27
|
import { ActionBar } from '../ActionBar/';
|
28
28
|
import { BreadcrumbWithOverflow } from '../BreadcrumbWithOverflow';
|
@@ -33,32 +33,24 @@ var componentName = 'PageHeader';
|
|
33
33
|
import { blockClass, utilCheckUpdateVerticalSpace, utilGetBreadcrumbItemForTitle, utilSetCollapsed } from './PageHeaderUtils';
|
34
34
|
import { PageHeaderTitle } from './PageHeaderTitle';
|
35
35
|
export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
36
|
-
var
|
36
|
+
var _ref5, _cx2, _ref6, _cx4, _cx7;
|
37
37
|
|
38
38
|
var actionBarItems = _ref.actionBarItems,
|
39
39
|
actionBarMenuOptionsClass = _ref.actionBarMenuOptionsClass,
|
40
40
|
actionBarOverflowAriaLabel = _ref.actionBarOverflowAriaLabel,
|
41
|
-
deprecated_actionBarOverflowLabel = _ref.actionBarOverflowLabel,
|
42
41
|
allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
|
43
42
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
44
43
|
allTagsModalTitle = _ref.allTagsModalTitle,
|
45
|
-
deprecated_availableSpace = _ref.availableSpace,
|
46
|
-
deprecated_background = _ref.background,
|
47
44
|
hasBackgroundAlways = _ref.hasBackgroundAlways,
|
48
45
|
breadcrumbOverflowAriaLabel = _ref.breadcrumbOverflowAriaLabel,
|
49
|
-
|
50
|
-
deprecated_breadcrumbItems = _ref.breadcrumbItems,
|
51
|
-
breadcrumbsIn = _ref.breadcrumbs,
|
46
|
+
breadcrumbs = _ref.breadcrumbs,
|
52
47
|
children = _ref.children,
|
53
48
|
className = _ref.className,
|
54
49
|
collapseHeader = _ref.collapseHeader,
|
55
50
|
collapseHeaderIconDescription = _ref.collapseHeaderIconDescription,
|
56
|
-
deprecated_collapseHeaderLabel = _ref.collapseHeaderLabel,
|
57
|
-
deprecated_collapseHeaderToggleWanted = _ref.collapseHeaderToggleWanted,
|
58
51
|
collapseTitle = _ref.collapseTitle,
|
59
52
|
disableBreadcrumbScroll = _ref.disableBreadcrumbScroll,
|
60
53
|
expandHeaderIconDescription = _ref.expandHeaderIconDescription,
|
61
|
-
deprecated_expandHeaderLabel = _ref.expandHeaderLabel,
|
62
54
|
fullWidthGrid = _ref.fullWidthGrid,
|
63
55
|
hasCollapseHeaderToggle = _ref.hasCollapseHeaderToggle,
|
64
56
|
narrowGrid = _ref.narrowGrid,
|
@@ -66,27 +58,12 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
66
58
|
pageActions = _ref.pageActions,
|
67
59
|
pageActionsOverflowLabel = _ref.pageActionsOverflowLabel,
|
68
60
|
pageActionsMenuOptionsClass = _ref.pageActionsMenuOptionsClass,
|
69
|
-
_deprecated_pageHeaderOffset = _ref.pageHeaderOffset,
|
70
|
-
deprecated_preCollapseTitleRow = _ref.preCollapseTitleRow,
|
71
|
-
deprecated_preventBreadcrumbScroll = _ref.preventBreadcrumbScroll,
|
72
61
|
showAllTagsLabel = _ref.showAllTagsLabel,
|
73
62
|
subtitle = _ref.subtitle,
|
74
63
|
tags = _ref.tags,
|
75
64
|
title = _ref.title,
|
76
65
|
rest = _objectWithoutProperties(_ref, _excluded);
|
77
66
|
|
78
|
-
// handle deprecated props - START
|
79
|
-
(_actionBarOverflowAri = actionBarOverflowAriaLabel) !== null && _actionBarOverflowAri !== void 0 ? _actionBarOverflowAri : actionBarOverflowAriaLabel = deprecated_actionBarOverflowLabel;
|
80
|
-
(_breadcrumbOverflowAr = breadcrumbOverflowAriaLabel) !== null && _breadcrumbOverflowAr !== void 0 ? _breadcrumbOverflowAr : breadcrumbOverflowAriaLabel = deprecated_breadcrumbOverflowLabel;
|
81
|
-
(_children = children) !== null && _children !== void 0 ? _children : children = deprecated_availableSpace;
|
82
|
-
(_collapseHeaderIconDe = collapseHeaderIconDescription) !== null && _collapseHeaderIconDe !== void 0 ? _collapseHeaderIconDe : collapseHeaderIconDescription = deprecated_collapseHeaderLabel;
|
83
|
-
(_expandHeaderIconDesc = expandHeaderIconDescription) !== null && _expandHeaderIconDesc !== void 0 ? _expandHeaderIconDesc : expandHeaderIconDescription = deprecated_expandHeaderLabel;
|
84
|
-
(_hasBackgroundAlways = hasBackgroundAlways) !== null && _hasBackgroundAlways !== void 0 ? _hasBackgroundAlways : hasBackgroundAlways = deprecated_background;
|
85
|
-
(_hasCollapseHeaderTog = hasCollapseHeaderToggle) !== null && _hasCollapseHeaderTog !== void 0 ? _hasCollapseHeaderTog : hasCollapseHeaderToggle = deprecated_collapseHeaderToggleWanted;
|
86
|
-
(_collapseTitle = collapseTitle) !== null && _collapseTitle !== void 0 ? _collapseTitle : collapseTitle = deprecated_preCollapseTitleRow;
|
87
|
-
(_disableBreadcrumbScr = disableBreadcrumbScroll) !== null && _disableBreadcrumbScr !== void 0 ? _disableBreadcrumbScr : disableBreadcrumbScroll = deprecated_preventBreadcrumbScroll;
|
88
|
-
var breadcrumbs = breadcrumbsIn !== null && breadcrumbsIn !== void 0 ? breadcrumbsIn : deprecated_breadcrumbItems; // handle deprecated props - END
|
89
|
-
|
90
67
|
var _useState = useState({}),
|
91
68
|
_useState2 = _slicedToArray(_useState, 2),
|
92
69
|
metrics = _useState2[0],
|
@@ -108,8 +85,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
108
85
|
}; // state based on props only
|
109
86
|
|
110
87
|
|
111
|
-
var
|
112
|
-
var hasActionBar = actionBarItemArray && actionBarItemArray.length > 0;
|
88
|
+
var hasActionBar = actionBarItems && actionBarItems.length > 0;
|
113
89
|
var hasBreadcrumbRow = breadcrumbs || actionBarItems; // NOTE: The buffer is used to add space between the bottom of the header and the last content
|
114
90
|
// Not pre-collapsed and (subtitle or children)
|
115
91
|
|
@@ -382,8 +358,8 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
382
358
|
className: "".concat(blockClass, "__breadcrumb"),
|
383
359
|
noTrailingSlash: !!title,
|
384
360
|
overflowAriaLabel: breadcrumbOverflowAriaLabel,
|
385
|
-
breadcrumbs:
|
386
|
-
}
|
361
|
+
breadcrumbs: breadcrumbs ? breadcrumbItemForTitle ? breadcrumbs.concat(breadcrumbItemForTitle) : breadcrumbs : null
|
362
|
+
}) : null), /*#__PURE__*/React.createElement(Column, {
|
387
363
|
className: cx(["".concat(blockClass, "__action-bar-column ").concat(blockClass, "__action-bar-column--background"), (_ref6 = {}, _defineProperty(_ref6, "".concat(blockClass, "__action-bar-column--has-page-actions"), pageActions), _defineProperty(_ref6, "".concat(blockClass, "__action-bar-column--influenced-by-collapse-button"), spaceForCollapseButton), _ref6)])
|
388
364
|
}, /*#__PURE__*/React.createElement("div", {
|
389
365
|
className: "".concat(blockClass, "__action-bar-column-content"),
|
@@ -394,7 +370,7 @@ export var PageHeader = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
394
370
|
React.createElement(React.Fragment, null, thePageActions(true, pageActionsInBreadcrumbRow), /*#__PURE__*/React.createElement(ActionBar, {
|
395
371
|
menuOptionsClass: cx(actionBarMenuOptionsClass, "".concat(blockClass, "__action-bar-menu-options")),
|
396
372
|
overflowAriaLabel: actionBarOverflowAriaLabel,
|
397
|
-
actions:
|
373
|
+
actions: actionBarItems,
|
398
374
|
className: "".concat(blockClass, "__action-bar"),
|
399
375
|
onWidthChange: handleActionBarWidthChange,
|
400
376
|
rightAlign: true
|
@@ -500,74 +476,17 @@ var TYPES = {
|
|
500
476
|
'high-contrast': 'High-Contrast'
|
501
477
|
};
|
502
478
|
var tagTypes = Object.keys(TYPES);
|
503
|
-
|
504
|
-
/**
|
505
|
-
* **Deprecated** see property `actionBarOverflowAriaLabel`
|
506
|
-
*/
|
507
|
-
actionBarOverflowLabel: deprecateProp(PropTypes.string, 'Property renamed to `actionBarOverflowAriaLabel`.'),
|
508
|
-
|
509
|
-
/**
|
510
|
-
* **Deprecated** see property `children`
|
511
|
-
*/
|
512
|
-
availableSpace: deprecateProp(PropTypes.node, 'Make use of children instead.'),
|
513
|
-
|
514
|
-
/**
|
515
|
-
* **Deprecated** see property `hasBackgroundAlways`
|
516
|
-
*/
|
517
|
-
background: deprecateProp(PropTypes.bool, 'Property renamed to `hasBackgroundAlways`'),
|
518
|
-
|
519
|
-
/**
|
520
|
-
* **Deprecated** see property `breadcrumbs`
|
521
|
-
*/
|
522
|
-
breadcrumbItems: deprecateProp(PropTypes.element, 'Usage changed to expect breadcrumb item like shapes, see `breadcrumbs`.'),
|
523
|
-
|
524
|
-
/**
|
525
|
-
* **Deprecated** see property `breadcrumbOverflowAriaLabel`
|
526
|
-
*/
|
527
|
-
breadcrumbOverflowLabel: deprecateProp(PropTypes.string, 'Property renamed to `breadcrumbOverflowAriaLabel`.'),
|
528
|
-
|
529
|
-
/**
|
530
|
-
* **Deprecated** see property `collapseHeaderIconDescription`
|
531
|
-
*/
|
532
|
-
collapseHeaderLabel: deprecateProp(PropTypes.string, 'Property renamed to `collapseHeaderIconDescription`.'),
|
533
|
-
|
534
|
-
/**
|
535
|
-
* **Deprecated** see property `hasCollapseHeaderToggle`
|
536
|
-
*/
|
537
|
-
collapseHeaderToggleWanted: deprecateProp(PropTypes.bool, 'Property renamed to `hasCollapseHeaderToggle`'),
|
538
|
-
|
539
|
-
/**
|
540
|
-
* **Deprecated** see property `expandHeaderIconDescription`
|
541
|
-
*/
|
542
|
-
expandHeaderLabel: deprecateProp(PropTypes.string, 'Property renamed to `expandHeaderIconDescription`.'),
|
543
|
-
|
544
|
-
/**
|
545
|
-
* **Deprecated** no longer required
|
546
|
-
*/
|
547
|
-
pageHeaderOffset: deprecateProp(PropTypes.number, 'Property removed as no longer required.'),
|
548
|
-
|
549
|
-
/**
|
550
|
-
* **Deprecated** see property `collapseTitle`
|
551
|
-
*/
|
552
|
-
preCollapseTitleRow: deprecateProp(PropTypes.bool, 'Property renamed to `collapseTitle`.'),
|
553
|
-
|
554
|
-
/**
|
555
|
-
* **Deprecated** see property `disableBreadcrumbScroll`
|
556
|
-
*/
|
557
|
-
preventBreadcrumbScroll: deprecateProp(PropTypes.bool, 'Prop renamed to `disableBreadcrumbScroll`.')
|
558
|
-
};
|
559
|
-
PageHeader.propTypes = _objectSpread({
|
479
|
+
PageHeader.propTypes = {
|
560
480
|
/**
|
561
481
|
* Specifies the action bar items which are the final items in the row top of the PageHeader.
|
562
482
|
* Each item is specified as an object with the properties of a Carbon Button in icon only form.
|
563
483
|
* Button kind, size, tooltipPosition, tooltipAlignment and type are ignored.
|
564
484
|
*/
|
565
|
-
actionBarItems:
|
485
|
+
actionBarItems: PropTypes.arrayOf(PropTypes.shape(_objectSpread(_objectSpread({}, prepareProps(Button.propTypes, ['kind', 'size', 'tooltipPosition', 'tooltipAlignment'])), {}, {
|
566
486
|
iconDescription: PropTypes.string.isRequired,
|
567
487
|
onClick: Button.propTypes.onClick,
|
568
488
|
renderIcon: Button.propTypes.renderIcon.isRequired
|
569
|
-
}))),
|
570
|
-
PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]), 'Expects an array of objects with the following properties: iconDescription, renderIcon and onClick.'),
|
489
|
+
}))),
|
571
490
|
|
572
491
|
/**
|
573
492
|
* class name applied to the action bar overflow options
|
@@ -581,9 +500,8 @@ PageHeader.propTypes = _objectSpread({
|
|
581
500
|
* NOTE: This prop is required if actionBarItems are supplied
|
582
501
|
*/
|
583
502
|
actionBarOverflowAriaLabel: PropTypes.string.isRequired.if(function (_ref8) {
|
584
|
-
var actionBarItems = _ref8.actionBarItems
|
585
|
-
|
586
|
-
return actionBarItems && actionBarItems.length > 0 && !actionBarOverflowLabel;
|
503
|
+
var actionBarItems = _ref8.actionBarItems;
|
504
|
+
return actionBarItems && actionBarItems.length > 0;
|
587
505
|
}),
|
588
506
|
|
589
507
|
/**
|
@@ -618,9 +536,8 @@ PageHeader.propTypes = _objectSpread({
|
|
618
536
|
* It is used in an overflow menu when there is insufficient space to display all breadcrumbs inline.
|
619
537
|
*/
|
620
538
|
breadcrumbOverflowAriaLabel: PropTypes.string.isRequired.if(function (_ref9) {
|
621
|
-
var breadcrumbs = _ref9.breadcrumbs
|
622
|
-
|
623
|
-
return breadcrumbs && breadcrumbs.length > 0 || breadcrumbItems && breadcrumbItems.length > 0;
|
539
|
+
var breadcrumbs = _ref9.breadcrumbs;
|
540
|
+
return breadcrumbs && breadcrumbs.length > 0;
|
624
541
|
}),
|
625
542
|
|
626
543
|
/**
|
@@ -853,7 +770,7 @@ PageHeader.propTypes = _objectSpread({
|
|
853
770
|
breadcrumbContent: PropTypes.node,
|
854
771
|
asText: PropTypes.string.isRequired
|
855
772
|
})])
|
856
|
-
}
|
773
|
+
};
|
857
774
|
PageHeader.defaultProps = {
|
858
775
|
fullWidthGrid: false,
|
859
776
|
hasBackgroundAlways: true,
|
@@ -2,8 +2,8 @@ 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 = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "
|
6
|
-
_excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"
|
5
|
+
var _excluded = ["actionToolbarButtons", "actions", "animateTitle", "children", "className", "closeIconDescription", "condensedActions", "currentStep", "includeOverlay", "labelText", "navigationBackIconDescription", "onNavigationBack", "onRequestClose", "onUnmount", "open", "placement", "preventCloseOnClickOutside", "selectorPageContent", "selectorPrimaryFocus", "size", "slideIn", "subtitle", "title"],
|
6
|
+
_excluded2 = ["label", "kind", "icon", "leading", "disabled", "className", "onClick"];
|
7
7
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
9
9
|
|
@@ -23,7 +23,7 @@ import cx from 'classnames';
|
|
23
23
|
import { useResizeDetector } from 'react-resize-detector';
|
24
24
|
import { moderate02 } from '@carbon/motion';
|
25
25
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
26
|
-
import { allPropTypes
|
26
|
+
import { allPropTypes } from '../../global/js/utils/props-helper';
|
27
27
|
import wrapFocus from '../../global/js/utils/wrapFocus';
|
28
28
|
import { pkg } from '../../settings';
|
29
29
|
import { SIDE_PANEL_SIZES } from './constants';
|
@@ -57,7 +57,6 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
57
57
|
onRequestClose = _ref.onRequestClose,
|
58
58
|
onUnmount = _ref.onUnmount,
|
59
59
|
open = _ref.open,
|
60
|
-
pageContentSelector = _ref.pageContentSelector,
|
61
60
|
placement = _ref.placement,
|
62
61
|
preventCloseOnClickOutside = _ref.preventCloseOnClickOutside,
|
63
62
|
selectorPageContent = _ref.selectorPageContent,
|
@@ -318,7 +317,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
318
317
|
|
319
318
|
useEffect(function () {
|
320
319
|
if (!open && slideIn) {
|
321
|
-
var pageContentElement = document.querySelector(selectorPageContent
|
320
|
+
var pageContentElement = document.querySelector(selectorPageContent);
|
322
321
|
|
323
322
|
if (placement && placement === 'right' && pageContentElement) {
|
324
323
|
pageContentElement.style.marginRight = 0;
|
@@ -326,11 +325,11 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
326
325
|
pageContentElement.style.marginLeft = 0;
|
327
326
|
}
|
328
327
|
}
|
329
|
-
}, [open, placement, selectorPageContent,
|
328
|
+
}, [open, placement, selectorPageContent, slideIn]); // used to set margins of content for slide in panel version
|
330
329
|
|
331
330
|
useEffect(function () {
|
332
331
|
if (shouldRender && slideIn) {
|
333
|
-
var pageContentElement = document.querySelector(selectorPageContent
|
332
|
+
var pageContentElement = document.querySelector(selectorPageContent);
|
334
333
|
|
335
334
|
if (placement && placement === 'right' && pageContentElement) {
|
336
335
|
pageContentElement.style.marginRight = 0;
|
@@ -342,7 +341,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
342
341
|
pageContentElement.style.marginLeft = SIDE_PANEL_SIZES[size];
|
343
342
|
}
|
344
343
|
}
|
345
|
-
}, [slideIn, selectorPageContent,
|
344
|
+
}, [slideIn, selectorPageContent, placement, shouldRender, size]); // adds focus trap functionality
|
346
345
|
|
347
346
|
/* istanbul ignore next */
|
348
347
|
|
@@ -403,8 +402,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
403
402
|
leading = _ref5.leading,
|
404
403
|
disabled = _ref5.disabled,
|
405
404
|
className = _ref5.className,
|
406
|
-
|
407
|
-
onActionToolbarButtonClick = _ref5.onActionToolbarButtonClick,
|
405
|
+
onClick = _ref5.onClick,
|
408
406
|
rest = _objectWithoutProperties(_ref5, _excluded2);
|
409
407
|
|
410
408
|
return /*#__PURE__*/React.createElement(Button, _extends({}, rest, {
|
@@ -418,9 +416,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
418
416
|
hasIconOnly: !leading,
|
419
417
|
disabled: disabled,
|
420
418
|
className: cx(["".concat(blockClass, "__action-toolbar-button"), className, (_ref6 = {}, _defineProperty(_ref6, "".concat(blockClass, "__action-toolbar-icon-only-button"), icon && !leading), _defineProperty(_ref6, "".concat(blockClass, "__action-toolbar-leading-button"), leading), _ref6)]),
|
421
|
-
onClick:
|
422
|
-
return _onClick ? _onClick(event) : onActionToolbarButtonClick && onActionToolbarButtonClick(event);
|
423
|
-
}
|
419
|
+
onClick: onClick
|
424
420
|
}), leading && label);
|
425
421
|
})));
|
426
422
|
};
|
@@ -486,16 +482,7 @@ export var SidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
486
482
|
}); // Return a placeholder if not released and not enabled by feature flag
|
487
483
|
|
488
484
|
SidePanel = pkg.checkComponentEnabled(SidePanel, componentName);
|
489
|
-
|
490
|
-
/**
|
491
|
-
* **Deprecated**
|
492
|
-
*
|
493
|
-
* This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
|
494
|
-
* This prop is required when using the `slideIn` variant of the side panel.
|
495
|
-
*/
|
496
|
-
pageContentSelector: deprecateProp(PropTypes.string, 'This prop has been renamed to `selectorPageContent`.')
|
497
|
-
};
|
498
|
-
SidePanel.propTypes = _objectSpread({
|
485
|
+
SidePanel.propTypes = {
|
499
486
|
/**
|
500
487
|
* Sets the action toolbar buttons
|
501
488
|
*/
|
@@ -503,7 +490,6 @@ SidePanel.propTypes = _objectSpread({
|
|
503
490
|
label: PropTypes.string,
|
504
491
|
leading: PropTypes.bool,
|
505
492
|
icon: PropTypes.object,
|
506
|
-
onActionToolbarButtonClick: deprecateProp(PropTypes.func, 'This prop will be removed in the future. Please use `onClick` instead'),
|
507
493
|
onClick: PropTypes.func,
|
508
494
|
kind: PropTypes.oneOf(['ghost', 'tertiary', 'secondary', 'primary'])
|
509
495
|
})),
|
@@ -611,9 +597,8 @@ SidePanel.propTypes = _objectSpread({
|
|
611
597
|
* This prop is required when using the `slideIn` variant of the side panel.
|
612
598
|
*/
|
613
599
|
selectorPageContent: PropTypes.string.isRequired.if(function (_ref7) {
|
614
|
-
var slideIn = _ref7.slideIn
|
615
|
-
|
616
|
-
return slideIn && !pageContentSelector;
|
600
|
+
var slideIn = _ref7.slideIn;
|
601
|
+
return slideIn;
|
617
602
|
}),
|
618
603
|
|
619
604
|
/**
|
@@ -644,7 +629,7 @@ SidePanel.propTypes = _objectSpread({
|
|
644
629
|
var labelText = _ref8.labelText;
|
645
630
|
return labelText;
|
646
631
|
})
|
647
|
-
}
|
632
|
+
};
|
648
633
|
SidePanel.defaultProps = {
|
649
634
|
animateTitle: true,
|
650
635
|
placement: 'right',
|
@@ -16,7 +16,7 @@ import React from 'react'; // Other standard imports.
|
|
16
16
|
|
17
17
|
import PropTypes from 'prop-types';
|
18
18
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
19
|
-
import { allPropTypes,
|
19
|
+
import { allPropTypes, prepareProps } from '../../global/js/utils/props-helper';
|
20
20
|
import { pkg } from '../../settings'; // Carbon and package components we use.
|
21
21
|
|
22
22
|
import { Button } from 'carbon-components-react';
|
@@ -49,15 +49,6 @@ Tearsheet = pkg.checkComponentEnabled(Tearsheet, componentName); // The display
|
|
49
49
|
|
50
50
|
Tearsheet.displayName = componentName;
|
51
51
|
export var deprecatedProps = {
|
52
|
-
/**
|
53
|
-
* **Deprecated**
|
54
|
-
*
|
55
|
-
* Prevent the tearsheet from automatically closing (triggering onClose, if
|
56
|
-
* provided, which can be cancelled by returning 'false') if the user clicks
|
57
|
-
* outside it.
|
58
|
-
*/
|
59
|
-
preventCloseOnClickOutside: deprecateProp(PropTypes.bool, 'The tearsheet will close automatically if the user clicks outside it if and only if the tearsheet is passive (no navigation actions)'),
|
60
|
-
|
61
52
|
/**
|
62
53
|
* **Deprecated**
|
63
54
|
*
|
@@ -16,7 +16,7 @@ import React from 'react'; // Other standard imports.
|
|
16
16
|
|
17
17
|
import PropTypes from 'prop-types';
|
18
18
|
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
19
|
-
import { allPropTypes,
|
19
|
+
import { allPropTypes, prepareProps } from '../../global/js/utils/props-helper';
|
20
20
|
import { pkg } from '../../settings'; // Carbon and package components we use.
|
21
21
|
|
22
22
|
import { Button } from 'carbon-components-react';
|
@@ -45,15 +45,6 @@ TearsheetNarrow = pkg.checkComponentEnabled(TearsheetNarrow, componentName); //
|
|
45
45
|
|
46
46
|
TearsheetNarrow.displayName = componentName;
|
47
47
|
export var deprecatedProps = {
|
48
|
-
/**
|
49
|
-
* **Deprecated**
|
50
|
-
*
|
51
|
-
* Prevent the tearsheet from automatically closing (triggering onClose, if
|
52
|
-
* provided, which can be cancelled by returning 'false') if the user clicks
|
53
|
-
* outside it.
|
54
|
-
*/
|
55
|
-
preventCloseOnClickOutside: deprecateProp(PropTypes.bool, 'The tearsheet will close automatically if the user clicks outside it if and only if the tearsheet is passive (no navigation actions)'),
|
56
|
-
|
57
48
|
/**
|
58
49
|
* **Deprecated**
|
59
50
|
*
|
@@ -21,7 +21,6 @@ import { useResizeDetector } from 'react-resize-detector'; // Other standard imp
|
|
21
21
|
import PropTypes from 'prop-types';
|
22
22
|
import cx from 'classnames';
|
23
23
|
import { pkg, carbon } from '../../settings';
|
24
|
-
import { deprecateProp } from '../../global/js/utils/props-helper';
|
25
24
|
import pconsole from '../../global/js/utils/pconsole'; // Carbon and package components we use.
|
26
25
|
|
27
26
|
import { Button, ComposedModal, ModalHeader, ModalBody } from 'carbon-components-react';
|
@@ -249,15 +248,6 @@ export var TearsheetShell = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
249
248
|
|
250
249
|
TearsheetShell.displayName = componentName;
|
251
250
|
export var deprecatedProps = {
|
252
|
-
/**
|
253
|
-
* **Deprecated**
|
254
|
-
*
|
255
|
-
* Prevent the tearsheet from automatically closing (triggering onClose, if
|
256
|
-
* provided, which can be cancelled by returning 'false') if the user clicks
|
257
|
-
* outside it.
|
258
|
-
*/
|
259
|
-
preventCloseOnClickOutside: deprecateProp(PropTypes.bool, 'The tearsheet will close automatically if the user clicks outside it if and only if the tearsheet is passive (no navigation actions)'),
|
260
|
-
|
261
251
|
/**
|
262
252
|
* **Deprecated**
|
263
253
|
*
|
@@ -20,7 +20,7 @@ import { pkg } from '../../settings'; // Carbon and package components we use.
|
|
20
20
|
import { User20, User24, User32, Group20, Group24, Group32 } from '@carbon/icons-react';
|
21
21
|
import { TooltipIcon } from 'carbon-components-react'; // The block part of our conventional BEM class names (blockClass__E--M).
|
22
22
|
|
23
|
-
var blockClass = "".concat(pkg.prefix, "
|
23
|
+
var blockClass = "".concat(pkg.prefix, "--user-profile-image");
|
24
24
|
var componentName = 'UserProfileImage'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
25
25
|
|
26
26
|
/**
|
package/es/components/index.js
CHANGED
@@ -8,7 +8,6 @@ export { AboutModal } from './AboutModal';
|
|
8
8
|
export { APIKeyModal } from './APIKeyModal';
|
9
9
|
export { Cascade } from './Cascade';
|
10
10
|
export { ComboButton, ComboButtonItem } from './ComboButton';
|
11
|
-
export { ContextHeader } from './ContextHeader';
|
12
11
|
export { CreateFullPage, CreateFullPageStep } from './CreateFullPage';
|
13
12
|
export { CreateModal } from './CreateModal';
|
14
13
|
export { CreateSidePanel } from './CreateSidePanel';
|
@@ -12,7 +12,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
12
12
|
//
|
13
13
|
import { devtoolsAttribute, getDevtoolsId } from './utils/devtools';
|
14
14
|
var defaults = {
|
15
|
-
prefix: '
|
15
|
+
prefix: 'c4p',
|
16
16
|
// by default only released components are set to true
|
17
17
|
component: {
|
18
18
|
// reviewed and released components:
|
@@ -52,7 +52,6 @@ var defaults = {
|
|
52
52
|
UnauthorizedEmptyState: true,
|
53
53
|
UserProfileImage: true,
|
54
54
|
// other public components not yet reviewed and released:
|
55
|
-
ContextHeader: false,
|
56
55
|
ExampleComponent: false,
|
57
56
|
LoadingBar: false,
|
58
57
|
ModifiedTabs: false,
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
8
8
|
value: true
|
9
9
|
});
|
10
|
-
exports.
|
10
|
+
exports.ActionBar = void 0;
|
11
11
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
13
13
|
|
@@ -37,7 +37,7 @@ var _ActionBarItem = require("./ActionBarItem");
|
|
37
37
|
|
38
38
|
var _ActionBarOverflowItems = require("./ActionBarOverflowItems");
|
39
39
|
|
40
|
-
var _excluded = ["actions", "
|
40
|
+
var _excluded = ["actions", "className", "maxVisible", "menuOptionsClass", "onWidthChange", "overflowAriaLabel", "rightAlign"],
|
41
41
|
_excluded2 = ["key"],
|
42
42
|
_excluded3 = ["key"];
|
43
43
|
|
@@ -59,7 +59,6 @@ var componentName = 'ActionBar'; // NOTE: the component SCSS is not imported her
|
|
59
59
|
|
60
60
|
var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
61
61
|
var actions = _ref.actions,
|
62
|
-
children = _ref.children,
|
63
62
|
className = _ref.className,
|
64
63
|
maxVisible = _ref.maxVisible,
|
65
64
|
menuOptionsClass = _ref.menuOptionsClass,
|
@@ -84,28 +83,12 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
84
83
|
setHiddenSizingItems = _useState6[1];
|
85
84
|
|
86
85
|
var internalId = (0, _react.useRef)((0, _uuidv.default)());
|
87
|
-
|
88
|
-
var _useState7 = (0, _react.useState)([]),
|
89
|
-
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
90
|
-
itemArray = _useState8[0],
|
91
|
-
setItemArray = _useState8[1];
|
92
|
-
|
93
86
|
var refDisplayedItems = (0, _react.useRef)(null);
|
94
87
|
var sizingRef = (0, _react.useRef)(null);
|
95
|
-
var sizes = (0, _react.useRef)({}); // create
|
88
|
+
var sizes = (0, _react.useRef)({}); // create hidden sizing items
|
96
89
|
|
97
90
|
(0, _react.useEffect)(function () {
|
98
|
-
//
|
99
|
-
var newItemArray;
|
100
|
-
|
101
|
-
if (actions) {
|
102
|
-
newItemArray = actions;
|
103
|
-
} else {
|
104
|
-
newItemArray = (0, _propsHelper.extractShapesArray)(children);
|
105
|
-
}
|
106
|
-
|
107
|
-
setItemArray(newItemArray); // Hidden action bar and items used to calculate sizes
|
108
|
-
|
91
|
+
// Hidden action bar and items used to calculate sizes
|
109
92
|
setHiddenSizingItems( /*#__PURE__*/_react.default.createElement("div", {
|
110
93
|
className: "".concat(blockClass, "__hidden-sizing-items"),
|
111
94
|
"aria-hidden": true,
|
@@ -115,7 +98,7 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
115
98
|
overflowAriaLabel: "hidden sizing overflow items",
|
116
99
|
overflowItems: [],
|
117
100
|
key: "hidden-overflow-menu"
|
118
|
-
}),
|
101
|
+
}), actions.map(function (_ref2) {
|
119
102
|
var key = _ref2.key,
|
120
103
|
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
|
121
104
|
return /*#__PURE__*/_react.default.createElement(_ActionBarItem.ActionBarItem, (0, _extends2.default)({}, rest, {
|
@@ -123,11 +106,11 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
123
106
|
className: "".concat(blockClass, "__hidden-sizing-item")
|
124
107
|
}));
|
125
108
|
})));
|
126
|
-
}, [actions
|
109
|
+
}, [actions]); // creates displayed items based on actions, displayCount and alignment
|
127
110
|
|
128
111
|
(0, _react.useEffect)(function () {
|
129
112
|
// Calculate the displayed items
|
130
|
-
var newDisplayedItems =
|
113
|
+
var newDisplayedItems = actions.map(function (_ref3) {
|
131
114
|
var key = _ref3.key,
|
132
115
|
rest = (0, _objectWithoutProperties2.default)(_ref3, _excluded3);
|
133
116
|
return /*#__PURE__*/_react.default.createElement(_ActionBarItem.ActionBarItem, (0, _extends2.default)({}, rest, {
|
@@ -147,7 +130,7 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
147
130
|
}
|
148
131
|
|
149
132
|
setDisplayedItems(newDisplayedItems);
|
150
|
-
}, [
|
133
|
+
}, [actions, displayCount, overflowAriaLabel, menuOptionsClass]); // determine display count based on space available and width of pageActions
|
151
134
|
|
152
135
|
var checkFullyVisibleItems = function checkFullyVisibleItems() {
|
153
136
|
/* istanbul ignore if */
|
@@ -202,7 +185,7 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
202
185
|
|
203
186
|
(0, _react.useEffect)(function () {
|
204
187
|
checkFullyVisibleItems(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
205
|
-
}, [maxVisible,
|
188
|
+
}, [maxVisible, hiddenSizingItems]);
|
206
189
|
/* istanbul ignore next */
|
207
190
|
// not sure how to fake window resize
|
208
191
|
|
@@ -247,17 +230,8 @@ var ActionBar = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
247
230
|
});
|
248
231
|
|
249
232
|
exports.ActionBar = ActionBar;
|
250
|
-
var deprecatedProps = {
|
251
|
-
/**
|
252
|
-
* **Deprecated**
|
253
|
-
*
|
254
|
-
* children of the action bar (action bar items)
|
255
|
-
*/
|
256
|
-
children: (0, _propsHelper.deprecateProp)(_propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.element), _propTypes.default.element]), 'See documentation on the `actions` prop.')
|
257
|
-
};
|
258
|
-
exports.deprecatedProps = deprecatedProps;
|
259
233
|
ActionBar.displayName = componentName;
|
260
|
-
ActionBar.propTypes =
|
234
|
+
ActionBar.propTypes = {
|
261
235
|
/**
|
262
236
|
* Specifies the action bar items. Each item is specified as an object
|
263
237
|
* with required fields: key for array rendering, renderIcon and
|
@@ -314,7 +288,7 @@ ActionBar.propTypes = _objectSpread({
|
|
314
288
|
* align tags to right of available space
|
315
289
|
*/
|
316
290
|
rightAlign: _propTypes.default.bool
|
317
|
-
}
|
291
|
+
};
|
318
292
|
ActionBar.defaultProps = {
|
319
293
|
rightAlign: false
|
320
294
|
};
|