@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 _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["actions", "
|
5
|
+
var _excluded = ["actions", "className", "maxVisible", "menuOptionsClass", "onWidthChange", "overflowAriaLabel", "rightAlign"],
|
6
6
|
_excluded2 = ["key"],
|
7
7
|
_excluded3 = ["key"];
|
8
8
|
|
@@ -26,7 +26,7 @@ import { useResizeDetector } from 'react-resize-detector'; // Carbon and package
|
|
26
26
|
|
27
27
|
import { Button } from 'carbon-components-react';
|
28
28
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
29
|
-
import {
|
29
|
+
import { prepareProps } from '../../global/js/utils/props-helper';
|
30
30
|
import { ActionBarItem } from './ActionBarItem';
|
31
31
|
import { ActionBarOverflowItems } from './ActionBarOverflowItems'; // The block part of our conventional BEM class names (blockClass__E--M).
|
32
32
|
|
@@ -39,7 +39,6 @@ var componentName = 'ActionBar'; // NOTE: the component SCSS is not imported her
|
|
39
39
|
|
40
40
|
export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
41
41
|
var actions = _ref.actions,
|
42
|
-
children = _ref.children,
|
43
42
|
className = _ref.className,
|
44
43
|
maxVisible = _ref.maxVisible,
|
45
44
|
menuOptionsClass = _ref.menuOptionsClass,
|
@@ -64,28 +63,12 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
64
63
|
setHiddenSizingItems = _useState6[1];
|
65
64
|
|
66
65
|
var internalId = useRef(uuidv4());
|
67
|
-
|
68
|
-
var _useState7 = useState([]),
|
69
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
70
|
-
itemArray = _useState8[0],
|
71
|
-
setItemArray = _useState8[1];
|
72
|
-
|
73
66
|
var refDisplayedItems = useRef(null);
|
74
67
|
var sizingRef = useRef(null);
|
75
|
-
var sizes = useRef({}); // create
|
68
|
+
var sizes = useRef({}); // create hidden sizing items
|
76
69
|
|
77
70
|
useEffect(function () {
|
78
|
-
//
|
79
|
-
var newItemArray;
|
80
|
-
|
81
|
-
if (actions) {
|
82
|
-
newItemArray = actions;
|
83
|
-
} else {
|
84
|
-
newItemArray = extractShapesArray(children);
|
85
|
-
}
|
86
|
-
|
87
|
-
setItemArray(newItemArray); // Hidden action bar and items used to calculate sizes
|
88
|
-
|
71
|
+
// Hidden action bar and items used to calculate sizes
|
89
72
|
setHiddenSizingItems( /*#__PURE__*/React.createElement("div", {
|
90
73
|
className: "".concat(blockClass, "__hidden-sizing-items"),
|
91
74
|
"aria-hidden": true,
|
@@ -95,7 +78,7 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
95
78
|
overflowAriaLabel: "hidden sizing overflow items",
|
96
79
|
overflowItems: [],
|
97
80
|
key: "hidden-overflow-menu"
|
98
|
-
}),
|
81
|
+
}), actions.map(function (_ref2) {
|
99
82
|
var key = _ref2.key,
|
100
83
|
rest = _objectWithoutProperties(_ref2, _excluded2);
|
101
84
|
|
@@ -104,11 +87,11 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
104
87
|
className: "".concat(blockClass, "__hidden-sizing-item")
|
105
88
|
}));
|
106
89
|
})));
|
107
|
-
}, [actions
|
90
|
+
}, [actions]); // creates displayed items based on actions, displayCount and alignment
|
108
91
|
|
109
92
|
useEffect(function () {
|
110
93
|
// Calculate the displayed items
|
111
|
-
var newDisplayedItems =
|
94
|
+
var newDisplayedItems = actions.map(function (_ref3) {
|
112
95
|
var key = _ref3.key,
|
113
96
|
rest = _objectWithoutProperties(_ref3, _excluded3);
|
114
97
|
|
@@ -129,7 +112,7 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
129
112
|
}
|
130
113
|
|
131
114
|
setDisplayedItems(newDisplayedItems);
|
132
|
-
}, [
|
115
|
+
}, [actions, displayCount, overflowAriaLabel, menuOptionsClass]); // determine display count based on space available and width of pageActions
|
133
116
|
|
134
117
|
var checkFullyVisibleItems = function checkFullyVisibleItems() {
|
135
118
|
/* istanbul ignore if */
|
@@ -184,7 +167,7 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
184
167
|
|
185
168
|
useEffect(function () {
|
186
169
|
checkFullyVisibleItems(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
187
|
-
}, [maxVisible,
|
170
|
+
}, [maxVisible, hiddenSizingItems]);
|
188
171
|
/* istanbul ignore next */
|
189
172
|
// not sure how to fake window resize
|
190
173
|
|
@@ -227,16 +210,8 @@ export var ActionBar = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
227
210
|
className: cx(["".concat(blockClass, "__displayed-items"), _defineProperty({}, "".concat(blockClass, "__displayed-items--right"), rightAlign)])
|
228
211
|
}, displayedItems));
|
229
212
|
});
|
230
|
-
export var deprecatedProps = {
|
231
|
-
/**
|
232
|
-
* **Deprecated**
|
233
|
-
*
|
234
|
-
* children of the action bar (action bar items)
|
235
|
-
*/
|
236
|
-
children: deprecateProp(PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]), 'See documentation on the `actions` prop.')
|
237
|
-
};
|
238
213
|
ActionBar.displayName = componentName;
|
239
|
-
ActionBar.propTypes =
|
214
|
+
ActionBar.propTypes = {
|
240
215
|
/**
|
241
216
|
* Specifies the action bar items. Each item is specified as an object
|
242
217
|
* with required fields: key for array rendering, renderIcon and
|
@@ -293,7 +268,7 @@ ActionBar.propTypes = _objectSpread({
|
|
293
268
|
* align tags to right of available space
|
294
269
|
*/
|
295
270
|
rightAlign: PropTypes.bool
|
296
|
-
}
|
271
|
+
};
|
297
272
|
ActionBar.defaultProps = {
|
298
273
|
rightAlign: false
|
299
274
|
};
|
@@ -1,12 +1,10 @@
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
5
|
-
var _excluded = ["
|
6
|
-
_excluded2 = ["
|
7
|
-
_excluded3 = ["title"]
|
8
|
-
_excluded4 = ["className", "key", "label", "title"],
|
9
|
-
_excluded5 = ["label", "key"];
|
5
|
+
var _excluded = ["breadcrumbs", "className", "maxVisible", "noTrailingSlash", "overflowAriaLabel"],
|
6
|
+
_excluded2 = ["label", "key", "title"],
|
7
|
+
_excluded3 = ["className", "key", "label", "title"];
|
10
8
|
|
11
9
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
12
10
|
|
@@ -14,10 +12,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
14
12
|
|
15
13
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
16
14
|
|
17
|
-
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; }
|
18
|
-
|
19
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
20
|
-
|
21
15
|
//
|
22
16
|
// Copyright IBM Corp. 2020, 2021
|
23
17
|
//
|
@@ -37,81 +31,24 @@ import { ArrowLeft16 } from '@carbon/icons-react'; // Carbon and package compone
|
|
37
31
|
import { Breadcrumb, BreadcrumbItem, OverflowMenu, OverflowMenuItem } from 'carbon-components-react';
|
38
32
|
import { OverflowMenuHorizontal32 } from '@carbon/icons-react';
|
39
33
|
import uuidv4 from '../../global/js/utils/uuidv4';
|
40
|
-
import
|
34
|
+
import '../../global/js/utils/props-helper'; // The block part of our conventional BEM class names (blockClass__E--M).
|
41
35
|
|
42
36
|
var blockClass = "".concat(pkg.prefix, "--breadcrumb-with-overflow");
|
43
37
|
var componentName = 'BreadcrumbWithOverflow'; // NOTE: the component SCSS is not imported here: it is rolled up separately.
|
44
38
|
|
45
|
-
var getHref = function getHref(shape) {
|
46
|
-
var _shape$children, _shape$children$props;
|
47
|
-
|
48
|
-
// This function should extract href from item
|
49
|
-
// It expects that the href is attached either to the item or direct child
|
50
|
-
// It prefers item.props.href
|
51
|
-
return shape !== null && shape !== void 0 && shape.href ? shape.href : shape === null || shape === void 0 ? void 0 : (_shape$children = shape.children) === null || _shape$children === void 0 ? void 0 : (_shape$children$props = _shape$children.props) === null || _shape$children$props === void 0 ? void 0 : _shape$children$props.href;
|
52
|
-
};
|
53
|
-
|
54
|
-
var getTitle = function getTitle(shape) {
|
55
|
-
// This function should extract text based title from the item.
|
56
|
-
// It prefers in this order
|
57
|
-
// - shape.data-title
|
58
|
-
// - shape.title
|
59
|
-
// - shape.label if string
|
60
|
-
// - shape.label.props.children if string. This case is likely if an <a /> is used inside a BreadcrumbItem
|
61
|
-
var useAsTitle = null;
|
62
|
-
/* istanbul ignore else */
|
63
|
-
|
64
|
-
if (shape) {
|
65
|
-
var _shape$label, _shape$label$props;
|
66
|
-
|
67
|
-
// list represents preferred order with checks, no else case expected
|
68
|
-
|
69
|
-
/* istanbul ignore next */
|
70
|
-
if (shape['data-title']) {
|
71
|
-
useAsTitle = shape['data-title'];
|
72
|
-
} else if (shape.title) {
|
73
|
-
useAsTitle = shape.title;
|
74
|
-
} else if (typeof shape.label === 'string') {
|
75
|
-
useAsTitle = shape.label;
|
76
|
-
} else if (typeof (shape === null || shape === void 0 ? void 0 : (_shape$label = shape.label) === null || _shape$label === void 0 ? void 0 : (_shape$label$props = _shape$label.props) === null || _shape$label$props === void 0 ? void 0 : _shape$label$props.children) === 'string') {
|
77
|
-
useAsTitle = shape.label.props.children;
|
78
|
-
}
|
79
|
-
}
|
80
|
-
|
81
|
-
return useAsTitle;
|
82
|
-
};
|
83
|
-
/**
|
84
|
-
* Converts the deprecated children array shapes into breadcrumbs
|
85
|
-
*/
|
86
|
-
|
87
|
-
|
88
|
-
var processShapesArray = function processShapesArray(arr) {
|
89
|
-
return arr.map(function (shape) {
|
90
|
-
var label = shape.children,
|
91
|
-
rest = _objectWithoutProperties(shape, _excluded);
|
92
|
-
|
93
|
-
var href = getHref(shape);
|
94
|
-
return _objectSpread(_objectSpread({}, rest), {}, {
|
95
|
-
href: href,
|
96
|
-
label: label
|
97
|
-
});
|
98
|
-
});
|
99
|
-
};
|
100
39
|
/**
|
101
40
|
* The BreadcrumbWithOverflow is used internally by the PageHeader to wrap BreadcrumbItems.
|
102
41
|
*/
|
103
42
|
|
104
|
-
|
105
43
|
export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
106
44
|
var _backItem, _backItem2, _backItem3;
|
107
45
|
|
108
|
-
var
|
109
|
-
deprecated_children = _ref.children,
|
46
|
+
var breadcrumbs = _ref.breadcrumbs,
|
110
47
|
className = _ref.className,
|
111
48
|
maxVisible = _ref.maxVisible,
|
112
49
|
noTrailingSlash = _ref.noTrailingSlash,
|
113
50
|
overflowAriaLabel = _ref.overflowAriaLabel,
|
114
|
-
other = _objectWithoutProperties(_ref,
|
51
|
+
other = _objectWithoutProperties(_ref, _excluded);
|
115
52
|
|
116
53
|
var _useState = useState(3),
|
117
54
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -129,8 +66,8 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
129
66
|
|
130
67
|
var _useState5 = useState([]),
|
131
68
|
_useState6 = _slicedToArray(_useState5, 2),
|
132
|
-
|
133
|
-
|
69
|
+
hiddenSizingItems = _useState6[0],
|
70
|
+
setHiddenSizingItems = _useState6[1]; // eslint-disable-next-line react/prop-types
|
134
71
|
|
135
72
|
|
136
73
|
var BreadcrumbOverflowMenu = function BreadcrumbOverflowMenu(_ref2) {
|
@@ -150,22 +87,37 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
150
87
|
itemText: item.props.children
|
151
88
|
});
|
152
89
|
})));
|
153
|
-
};
|
90
|
+
}; // create hidden sizing items
|
91
|
+
|
154
92
|
|
155
93
|
useEffect(function () {
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
94
|
+
// Hidden action bar and items used to calculate sizes
|
95
|
+
setHiddenSizingItems( /*#__PURE__*/React.createElement("div", {
|
96
|
+
className: "".concat(blockClass, "__breadcrumb-container ").concat(blockClass, "__breadcrumb-container--hidden"),
|
97
|
+
"aria-hidden": true,
|
98
|
+
ref: sizingContainerRef
|
99
|
+
}, /*#__PURE__*/React.createElement(Breadcrumb, null, /*#__PURE__*/React.createElement(BreadcrumbItem, {
|
100
|
+
key: "".concat(blockClass, "-hidden-overflow-").concat(internalId)
|
101
|
+
}, /*#__PURE__*/React.createElement(OverflowMenu, {
|
102
|
+
ariaLabel: overflowAriaLabel,
|
103
|
+
renderIcon: OverflowMenuHorizontal32
|
104
|
+
})), breadcrumbs.map(function (_ref3) {
|
105
|
+
var label = _ref3.label,
|
106
|
+
key = _ref3.key,
|
107
|
+
title = _ref3.title,
|
108
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
160
109
|
|
161
|
-
return
|
162
|
-
|
163
|
-
}
|
164
|
-
|
165
|
-
|
166
|
-
|
110
|
+
return /*#__PURE__*/React.createElement(BreadcrumbItem, _extends({
|
111
|
+
key: key
|
112
|
+
}, rest, {
|
113
|
+
title: title !== null && title !== void 0 ? title : label
|
114
|
+
}), label);
|
115
|
+
}))));
|
116
|
+
}, [breadcrumbs, overflowAriaLabel]);
|
167
117
|
useEffect(function () {
|
168
118
|
// updates displayedBreadcrumbItems and overflowBreadcrumbItems based on displayCount and breadcrumbs
|
119
|
+
|
120
|
+
/* istanbul ignore if */
|
169
121
|
if (breadcrumbs.length === 0) {
|
170
122
|
setDisplayedBreadcrumbItems([]);
|
171
123
|
return;
|
@@ -176,7 +128,7 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
176
128
|
key = _ref4.key,
|
177
129
|
label = _ref4.label,
|
178
130
|
title = _ref4.title,
|
179
|
-
rest = _objectWithoutProperties(_ref4,
|
131
|
+
rest = _objectWithoutProperties(_ref4, _excluded3);
|
180
132
|
|
181
133
|
return /*#__PURE__*/React.createElement(BreadcrumbItem, _extends({
|
182
134
|
key: key,
|
@@ -283,7 +235,7 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
283
235
|
|
284
236
|
useEffect(function () {
|
285
237
|
checkFullyVisibleBreadcrumbItems(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
286
|
-
}, [
|
238
|
+
}, [hiddenSizingItems, maxVisible]);
|
287
239
|
/* istanbul ignore next */
|
288
240
|
// not sure how to test resize
|
289
241
|
|
@@ -323,24 +275,7 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
323
275
|
ref: breadcrumbItemWithOverflow
|
324
276
|
}, /*#__PURE__*/React.createElement("div", {
|
325
277
|
className: cx(["".concat(blockClass, "__space")])
|
326
|
-
}, /*#__PURE__*/React.createElement(
|
327
|
-
className: "".concat(blockClass, "__breadcrumb-container ").concat(blockClass, "__breadcrumb-container--hidden"),
|
328
|
-
"aria-hidden": true,
|
329
|
-
ref: sizingContainerRef
|
330
|
-
}, /*#__PURE__*/React.createElement(Breadcrumb, null, /*#__PURE__*/React.createElement(BreadcrumbItem, {
|
331
|
-
key: "".concat(blockClass, "-hidden-overflow-").concat(internalId)
|
332
|
-
}, /*#__PURE__*/React.createElement(OverflowMenu, {
|
333
|
-
ariaLabel: overflowAriaLabel,
|
334
|
-
renderIcon: OverflowMenuHorizontal32
|
335
|
-
})), breadcrumbs.map(function (_ref5) {
|
336
|
-
var children = _ref5.label,
|
337
|
-
key = _ref5.key,
|
338
|
-
rest = _objectWithoutProperties(_ref5, _excluded5);
|
339
|
-
|
340
|
-
return /*#__PURE__*/React.createElement(BreadcrumbItem, _extends({
|
341
|
-
key: key
|
342
|
-
}, rest), children);
|
343
|
-
}))), ((_backItem2 = backItem) === null || _backItem2 === void 0 ? void 0 : _backItem2.href) && ((_backItem3 = backItem) === null || _backItem3 === void 0 ? void 0 : _backItem3.title) && /*#__PURE__*/React.createElement(Button, {
|
278
|
+
}, hiddenSizingItems, ((_backItem2 = backItem) === null || _backItem2 === void 0 ? void 0 : _backItem2.href) && ((_backItem3 = backItem) === null || _backItem3 === void 0 ? void 0 : _backItem3.title) && /*#__PURE__*/React.createElement(Button, {
|
344
279
|
className: "".concat(blockClass, "__breadcrumb-back-button"),
|
345
280
|
hasIconOnly: true,
|
346
281
|
iconDescription: backItem.title,
|
@@ -357,15 +292,7 @@ export var BreadcrumbWithOverflow = function BreadcrumbWithOverflow(_ref) {
|
|
357
292
|
}; // Return a placeholder if not released and not enabled by feature flag
|
358
293
|
|
359
294
|
BreadcrumbWithOverflow = pkg.checkComponentEnabled(BreadcrumbWithOverflow, componentName);
|
360
|
-
|
361
|
-
/**
|
362
|
-
* **Deprecated** see property `breadcrumbs`
|
363
|
-
*
|
364
|
-
* children of the breadcrumb-item set (these are expected to be breadcrumb-items)
|
365
|
-
*/
|
366
|
-
children: deprecateProp(PropTypes.arrayOf(PropTypes.element), 'Usage changed to expect breadcrumb item like shapes, see `breadcrumbs`.')
|
367
|
-
};
|
368
|
-
BreadcrumbWithOverflow.propTypes = _objectSpread({
|
295
|
+
BreadcrumbWithOverflow.propTypes = {
|
369
296
|
breadcrumbs: PropTypes.arrayOf(PropTypes.shape({
|
370
297
|
/**
|
371
298
|
* Optional string representing the link location for the BreadcrumbItem
|
@@ -390,8 +317,8 @@ BreadcrumbWithOverflow.propTypes = _objectSpread({
|
|
390
317
|
/**
|
391
318
|
* A string based alternative to the children, required only if children is not of type string.
|
392
319
|
*/
|
393
|
-
title: PropTypes.string.isRequired.if(function (
|
394
|
-
var label =
|
320
|
+
title: PropTypes.string.isRequired.if(function (_ref5) {
|
321
|
+
var label = _ref5.label;
|
395
322
|
return typeof label !== 'string';
|
396
323
|
})
|
397
324
|
})),
|
@@ -415,7 +342,7 @@ BreadcrumbWithOverflow.propTypes = _objectSpread({
|
|
415
342
|
* overflowAriaLabel label for open close button overflow used for action bar items that do nto fit.
|
416
343
|
*/
|
417
344
|
overflowAriaLabel: PropTypes.string.isRequired
|
418
|
-
}
|
345
|
+
};
|
419
346
|
BreadcrumbWithOverflow.defaultProps = {
|
420
347
|
noTrailingSlash: false
|
421
348
|
};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
4
|
-
var _excluded = ["className", "children", "disableSubmit", "formTitle", "formDescription", "onRequestClose", "onRequestSubmit", "open", "
|
4
|
+
var _excluded = ["className", "children", "disableSubmit", "formTitle", "formDescription", "onRequestClose", "onRequestSubmit", "open", "primaryButtonText", "secondaryButtonText", "selectorPageContent", "selectorPrimaryFocus", "subtitle", "title"];
|
5
5
|
|
6
6
|
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; }
|
7
7
|
|
@@ -19,8 +19,7 @@ import React from 'react'; // Other standard imports.
|
|
19
19
|
import PropTypes from 'prop-types';
|
20
20
|
import cx from 'classnames';
|
21
21
|
import { pkg } from '../../settings';
|
22
|
-
import { getDevtoolsProps } from '../../global/js/utils/devtools';
|
23
|
-
import { deprecateProp } from '../../global/js/utils/props-helper'; // Carbon and package components we use.
|
22
|
+
import { getDevtoolsProps } from '../../global/js/utils/devtools'; // Carbon and package components we use.
|
24
23
|
|
25
24
|
import { Form } from 'carbon-components-react';
|
26
25
|
import { SidePanel } from '../SidePanel';
|
@@ -43,7 +42,6 @@ export var CreateSidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
43
42
|
onRequestClose = _ref.onRequestClose,
|
44
43
|
onRequestSubmit = _ref.onRequestSubmit,
|
45
44
|
open = _ref.open,
|
46
|
-
pageContentSelector = _ref.pageContentSelector,
|
47
45
|
primaryButtonText = _ref.primaryButtonText,
|
48
46
|
secondaryButtonText = _ref.secondaryButtonText,
|
49
47
|
selectorPageContent = _ref.selectorPageContent,
|
@@ -67,10 +65,9 @@ export var CreateSidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
67
65
|
kind: 'secondary'
|
68
66
|
}];
|
69
67
|
var actionContainerClassNames = cx(["".concat(blockClass, "__actions-container"), "".concat(sidePanelBlockClass, "__actions-container")]);
|
70
|
-
return
|
68
|
+
return selectorPageContent && /*#__PURE__*/React.createElement(SidePanel, _extends({}, rest, _objectSpread({
|
71
69
|
open: open,
|
72
70
|
ref: ref,
|
73
|
-
pageContentSelector: pageContentSelector,
|
74
71
|
selectorPageContent: selectorPageContent,
|
75
72
|
onRequestClose: onRequestClose,
|
76
73
|
title: title,
|
@@ -96,16 +93,7 @@ export var CreateSidePanel = /*#__PURE__*/React.forwardRef(function (_ref, ref)
|
|
96
93
|
});
|
97
94
|
CreateSidePanel = pkg.checkComponentEnabled(CreateSidePanel, componentName);
|
98
95
|
CreateSidePanel.displayName = componentName;
|
99
|
-
|
100
|
-
/**
|
101
|
-
* **Deprecated**
|
102
|
-
*
|
103
|
-
* This is the selector to the element that contains all of the page content that will shrink if the panel is a slide in.
|
104
|
-
* This prop is required when using the `slideIn` variant of the side panel.
|
105
|
-
*/
|
106
|
-
pageContentSelector: deprecateProp(PropTypes.string, 'This prop has been renamed to `selectorPageContent`.')
|
107
|
-
};
|
108
|
-
CreateSidePanel.propTypes = _objectSpread({
|
96
|
+
CreateSidePanel.propTypes = {
|
109
97
|
/**
|
110
98
|
* Sets the body content of the create side panel
|
111
99
|
*/
|
@@ -184,4 +172,4 @@ CreateSidePanel.propTypes = _objectSpread({
|
|
184
172
|
* The title of the CreateSidePanel is usually the product or service name.
|
185
173
|
*/
|
186
174
|
title: PropTypes.node.isRequired
|
187
|
-
}
|
175
|
+
};
|