@carbon/ibm-products 1.0.0-rc.2 → 1.2.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/README.md +12 -13
- package/css/index-full-carbon.css +34 -69
- package/css/index-full-carbon.css.map +1 -1
- package/css/index-full-carbon.min.css +1 -1
- package/css/index-without-carbon-released-only.css +34 -6
- package/css/index-without-carbon-released-only.css.map +1 -1
- package/css/index-without-carbon-released-only.min.css +1 -1
- package/css/index-without-carbon.css +34 -69
- package/css/index-without-carbon.css.map +1 -1
- package/css/index-without-carbon.min.css +1 -1
- package/css/index.css +34 -69
- package/css/index.css.map +1 -1
- package/css/index.min.css +1 -1
- package/es/components/Card/Card.js +18 -4
- package/es/components/ExpressiveCard/ExpressiveCard.js +3 -2
- package/es/components/PageHeader/PageHeader.js +46 -36
- package/es/components/ProductiveCard/ProductiveCard.js +3 -2
- package/es/components/Toolbar/ToolbarButton.js +7 -5
- package/es/components/_Canary/Canary.js +1 -1
- package/es/components/index.js +0 -1
- package/es/global/js/package-settings.js +0 -1
- package/es/global/js/utils/story-helper.js +22 -0
- package/lib/components/Card/Card.js +18 -4
- package/lib/components/ExpressiveCard/ExpressiveCard.js +3 -2
- package/lib/components/PageHeader/PageHeader.js +46 -36
- package/lib/components/ProductiveCard/ProductiveCard.js +3 -2
- package/lib/components/Toolbar/ToolbarButton.js +6 -3
- package/lib/components/_Canary/Canary.js +1 -1
- package/lib/components/index.js +0 -8
- package/lib/global/js/package-settings.js +0 -1
- package/lib/global/js/utils/story-helper.js +29 -2
- package/package.json +5 -5
- package/scss/components/ButtonSetWithOverflow/_button-set-with-overflow.scss +1 -0
- package/scss/components/Card/_card.scss +1 -0
- package/scss/components/PageHeader/_page-header.scss +36 -6
- package/scss/components/PageHeader/_storybook-styles.scss +1 -0
- package/scss/components/ProductiveCard/_productive-card.scss +4 -0
- package/scss/components/Tearsheet/_tearsheet.scss +6 -0
- package/scss/components/_index.scss +0 -1
@@ -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.PageHeader = void 0;
|
10
|
+
exports.deprecatedProps = exports.PageHeader = void 0;
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
@@ -51,7 +51,7 @@ var _PageHeaderUtils = require("./PageHeaderUtils");
|
|
51
51
|
|
52
52
|
var _PageHeaderTitle = require("./PageHeaderTitle");
|
53
53
|
|
54
|
-
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"];
|
54
|
+
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", "withoutBackground"];
|
55
55
|
|
56
56
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
57
57
|
|
@@ -64,7 +64,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
64
64
|
var componentName = 'PageHeader';
|
65
65
|
|
66
66
|
var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
67
|
-
var _ref5, _cx2, _ref6, _cx4, _cx7;
|
67
|
+
var _withoutBackground, _ref5, _cx2, _ref6, _cx4, _cx7;
|
68
68
|
|
69
69
|
var actionBarItems = _ref.actionBarItems,
|
70
70
|
actionBarMenuOptionsClass = _ref.actionBarMenuOptionsClass,
|
@@ -72,7 +72,7 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
72
72
|
allTagsModalSearchLabel = _ref.allTagsModalSearchLabel,
|
73
73
|
allTagsModalSearchPlaceholderText = _ref.allTagsModalSearchPlaceholderText,
|
74
74
|
allTagsModalTitle = _ref.allTagsModalTitle,
|
75
|
-
|
75
|
+
deprecated_hasBackgroundAlways = _ref.hasBackgroundAlways,
|
76
76
|
breadcrumbOverflowAriaLabel = _ref.breadcrumbOverflowAriaLabel,
|
77
77
|
breadcrumbs = _ref.breadcrumbs,
|
78
78
|
children = _ref.children,
|
@@ -93,7 +93,11 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
93
93
|
subtitle = _ref.subtitle,
|
94
94
|
tags = _ref.tags,
|
95
95
|
title = _ref.title,
|
96
|
+
withoutBackground = _ref.withoutBackground,
|
96
97
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
98
|
+
// handle deprecated props - START
|
99
|
+
// if withoutBackground is null check deprecated_hasBackgroundAlways and default false
|
100
|
+
(_withoutBackground = withoutBackground) !== null && _withoutBackground !== void 0 ? _withoutBackground : withoutBackground = !(deprecated_hasBackgroundAlways !== null && deprecated_hasBackgroundAlways !== void 0 ? deprecated_hasBackgroundAlways : true); // handle deprecated props - END
|
97
101
|
|
98
102
|
var _useState = (0, _react.useState)({}),
|
99
103
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
@@ -116,7 +120,7 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
116
120
|
}; // state based on props only
|
117
121
|
|
118
122
|
|
119
|
-
var hasActionBar = actionBarItems && actionBarItems.length;
|
123
|
+
var hasActionBar = actionBarItems && actionBarItems.length > 0;
|
120
124
|
var hasBreadcrumbRow = breadcrumbs || actionBarItems; // NOTE: The buffer is used to add space between the bottom of the header and the last content
|
121
125
|
// Not pre-collapsed and (subtitle or children)
|
122
126
|
|
@@ -313,8 +317,8 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
313
317
|
checkUpdateVerticalSpace(); // eslint-disable-next-line react-hooks/exhaustive-deps
|
314
318
|
}, [fullWidthGrid, narrowGrid]);
|
315
319
|
(0, _react.useEffect)(function () {
|
316
|
-
// Determines
|
317
|
-
var result =
|
320
|
+
// Determines the appropriate header background opacity based on the header config/height/scroll and the withoutBackground setting
|
321
|
+
var result = withoutBackground ? 0 : 1;
|
318
322
|
|
319
323
|
if (!result && metrics.headerHeight > 0 && (breadcrumbs || actionBarItems || tags || navigation)) {
|
320
324
|
var startAddingAt = parseFloat(_layout.layout05, 10) * parseInt(_layout.baseFontSize);
|
@@ -332,13 +336,13 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
332
336
|
setPageHeaderStyles(function (prev) {
|
333
337
|
return _objectSpread(_objectSpread({}, prev), {}, (0, _defineProperty2.default)({}, "--".concat(_PageHeaderUtils.blockClass, "--background-opacity"), result));
|
334
338
|
});
|
335
|
-
}, [actionBarItems,
|
339
|
+
}, [actionBarItems, withoutBackground, breadcrumbs, headerRef, metrics.breadcrumbRowHeight, metrics.headerHeight, navigation, scrollYValue, hasCollapseHeaderToggle, tags]);
|
336
340
|
(0, _react.useEffect)(function () {
|
337
|
-
// only has toggle if requested and
|
341
|
+
// only has toggle if requested and withoutBackground is unset/falsy
|
338
342
|
// NOTE: prop-types isRequired.if for the expand and collapse
|
339
343
|
// icon descriptions depends on the this.
|
340
|
-
setHasCollapseButton(hasCollapseHeaderToggle &&
|
341
|
-
}, [
|
344
|
+
setHasCollapseButton(hasCollapseHeaderToggle && !withoutBackground);
|
345
|
+
}, [withoutBackground, hasCollapseHeaderToggle]);
|
342
346
|
(0, _react.useEffect)(function () {
|
343
347
|
// Determine if space is needed in the breadcrumb for a collapse button
|
344
348
|
setSpaceForCollapseButton(hasCollapseButton && !(navigation || tags) && metrics.headerHeight);
|
@@ -477,6 +481,8 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
477
481
|
var handleWidthChange = isBreadcrumbRow && hasBreadcrumbRow ? handlePageActionWidthChange : function () {};
|
478
482
|
return /*#__PURE__*/_react.default.createElement(_Tag, {
|
479
483
|
className: (0, _classnames.default)("".concat(_PageHeaderUtils.blockClass, "__page-actions"), (0, _defineProperty2.default)({}, "".concat(_PageHeaderUtils.blockClass, "__page-actions--in-breadcrumb"), inBreadcrumbRow))
|
484
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
485
|
+
className: (0, _classnames.default)("".concat(_PageHeaderUtils.blockClass, "__page-actions-content"))
|
480
486
|
}, (_pageActions$content = pageActions.content) !== null && _pageActions$content !== void 0 ? _pageActions$content : /*#__PURE__*/_react.default.createElement(_ButtonSetWithOverflow.ButtonSetWithOverflow, {
|
481
487
|
classname: "".concat(_PageHeaderUtils.blockClass, "__button-set-with-overflow"),
|
482
488
|
menuOptionsClass: (0, _classnames.default)(pageActionsMenuOptionsClass, "".concat(_PageHeaderUtils.blockClass, "__button-set-menu-options")),
|
@@ -484,7 +490,7 @@ var PageHeader = /*#__PURE__*/_react.default.forwardRef(function (_ref, ref) {
|
|
484
490
|
buttons: pageActions,
|
485
491
|
buttonSetOverflowLabel: pageActionsOverflowLabel,
|
486
492
|
rightAlign: true
|
487
|
-
}));
|
493
|
+
})));
|
488
494
|
}
|
489
495
|
}
|
490
496
|
}); // Return a placeholder if not released and not enabled by feature flag
|
@@ -507,7 +513,14 @@ var TYPES = {
|
|
507
513
|
'high-contrast': 'High-Contrast'
|
508
514
|
};
|
509
515
|
var tagTypes = Object.keys(TYPES);
|
510
|
-
|
516
|
+
var deprecatedProps = {
|
517
|
+
/**
|
518
|
+
* **Deprecated** see property `withoutBackground`
|
519
|
+
*/
|
520
|
+
hasBackgroundAlways: (0, _propsHelper.deprecateProp)(_propTypes.default.bool, 'Property replaced by `withoutBackground`')
|
521
|
+
};
|
522
|
+
exports.deprecatedProps = deprecatedProps;
|
523
|
+
PageHeader.propTypes = _objectSpread({
|
511
524
|
/**
|
512
525
|
* Specifies the action bar items which are the final items in the row top of the PageHeader.
|
513
526
|
* Each item is specified as an object with the properties of a Carbon Button in icon only form.
|
@@ -531,9 +544,8 @@ PageHeader.propTypes = {
|
|
531
544
|
* NOTE: This prop is required if actionBarItems are supplied
|
532
545
|
*/
|
533
546
|
actionBarOverflowAriaLabel: _propTypes.default.string.isRequired.if(function (_ref8) {
|
534
|
-
var actionBarItems = _ref8.actionBarItems
|
535
|
-
|
536
|
-
return actionBarItems && actionBarItems.length > 0 && !actionBarOverflowLabel;
|
547
|
+
var actionBarItems = _ref8.actionBarItems;
|
548
|
+
return actionBarItems && actionBarItems.length > 0;
|
537
549
|
}),
|
538
550
|
|
539
551
|
/**
|
@@ -568,9 +580,8 @@ PageHeader.propTypes = {
|
|
568
580
|
* It is used in an overflow menu when there is insufficient space to display all breadcrumbs inline.
|
569
581
|
*/
|
570
582
|
breadcrumbOverflowAriaLabel: _propTypes.default.string.isRequired.if(function (_ref9) {
|
571
|
-
var breadcrumbs = _ref9.breadcrumbs
|
572
|
-
|
573
|
-
return breadcrumbs && breadcrumbs.length > 0 || breadcrumbItems && breadcrumbItems.length > 0;
|
583
|
+
var breadcrumbs = _ref9.breadcrumbs;
|
584
|
+
return breadcrumbs && breadcrumbs.length > 0;
|
574
585
|
}),
|
575
586
|
|
576
587
|
/**
|
@@ -636,13 +647,13 @@ PageHeader.propTypes = {
|
|
636
647
|
collapseHeader: _propTypes.default.bool,
|
637
648
|
|
638
649
|
/**
|
639
|
-
* If `hasCollapseHeaderToggle` and `
|
640
|
-
* for both the expend and collapse states of the button component used.
|
650
|
+
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
651
|
+
* required for both the expend and collapse states of the button component used.
|
641
652
|
*/
|
642
653
|
collapseHeaderIconDescription: _propTypes.default.string.isRequired.if(function (_ref11) {
|
643
|
-
var
|
654
|
+
var withoutBackground = _ref11.withoutBackground,
|
644
655
|
hasCollapseHeaderToggle = _ref11.hasCollapseHeaderToggle;
|
645
|
-
return
|
656
|
+
return !withoutBackground && hasCollapseHeaderToggle;
|
646
657
|
}),
|
647
658
|
|
648
659
|
/**
|
@@ -658,13 +669,13 @@ PageHeader.propTypes = {
|
|
658
669
|
disableBreadcrumbScroll: _propTypes.default.bool,
|
659
670
|
|
660
671
|
/**
|
661
|
-
* If `hasCollapseHeaderToggle` and `
|
662
|
-
* for both the expend and collapse states of the button component used.
|
672
|
+
* If `hasCollapseHeaderToggle` is set and `withoutBackground` is unset/falsy then assistive text is
|
673
|
+
* required for both the expend and collapse states of the button component used.
|
663
674
|
*/
|
664
675
|
expandHeaderIconDescription: _propTypes.default.string.isRequired.if(function (_ref12) {
|
665
|
-
var
|
676
|
+
var withoutBackground = _ref12.withoutBackground,
|
666
677
|
hasCollapseHeaderToggle = _ref12.hasCollapseHeaderToggle;
|
667
|
-
return
|
678
|
+
return !withoutBackground && hasCollapseHeaderToggle;
|
668
679
|
}),
|
669
680
|
|
670
681
|
/**
|
@@ -673,12 +684,6 @@ PageHeader.propTypes = {
|
|
673
684
|
*/
|
674
685
|
fullWidthGrid: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOf(['xl'])]),
|
675
686
|
|
676
|
-
/**
|
677
|
-
* Specifies if the PageHeader should have a background always on and defaults to the preferred `true`.
|
678
|
-
* When false some parts of the header gain a background if they stick to the top of the PageHeader on scroll.
|
679
|
-
*/
|
680
|
-
hasBackgroundAlways: _propTypes.default.bool,
|
681
|
-
|
682
687
|
/**
|
683
688
|
* Adds a button as the last element of the bottom row which collapses and expands the header.
|
684
689
|
*
|
@@ -802,11 +807,16 @@ PageHeader.propTypes = {
|
|
802
807
|
content: _propTypes.default.node.isRequired,
|
803
808
|
breadcrumbContent: _propTypes.default.node,
|
804
809
|
asText: _propTypes.default.string.isRequired
|
805
|
-
})])
|
806
|
-
|
810
|
+
})]),
|
811
|
+
|
812
|
+
/**
|
813
|
+
* Specifies if the PageHeader should appear without a background color, and defaults to the preferred `false` (a background color is shown).
|
814
|
+
* Note that when `true` some parts of the header still gain a background if and when they stick to the top of the PageHeader on scroll.
|
815
|
+
*/
|
816
|
+
withoutBackground: _propTypes.default.bool
|
817
|
+
}, deprecatedProps);
|
807
818
|
PageHeader.defaultProps = {
|
808
819
|
fullWidthGrid: false,
|
809
|
-
hasBackgroundAlways: true,
|
810
820
|
narrowGrid: false
|
811
821
|
};
|
812
822
|
PageHeader.displayName = componentName;
|
@@ -53,7 +53,8 @@ ProductiveCard.propTypes = {
|
|
53
53
|
icon: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.object]),
|
54
54
|
onKeyDown: _propTypes.default.func,
|
55
55
|
onClick: _propTypes.default.func,
|
56
|
-
iconDescription: _propTypes.default.string
|
56
|
+
iconDescription: _propTypes.default.string,
|
57
|
+
href: _propTypes.default.string
|
57
58
|
})),
|
58
59
|
|
59
60
|
/**
|
@@ -119,7 +120,7 @@ ProductiveCard.propTypes = {
|
|
119
120
|
/**
|
120
121
|
* The text that's displayed in the primary button
|
121
122
|
*/
|
122
|
-
primaryButtonText: _propTypes.default.
|
123
|
+
primaryButtonText: _propTypes.default.node,
|
123
124
|
|
124
125
|
/**
|
125
126
|
* Title that's displayed at the top of the card
|
@@ -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.ToolbarButton = void 0;
|
10
|
+
exports.blockClass = exports.ToolbarButton = void 0;
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
@@ -33,7 +33,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
33
33
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
35
35
|
|
36
|
+
var blockClass = "".concat(_Toolbar.blockClass, "__button");
|
36
37
|
/** Toolbar buttons are common functions performed as part of a products interface or an open window. */
|
38
|
+
|
39
|
+
exports.blockClass = blockClass;
|
37
40
|
var ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
38
41
|
var _useContext;
|
39
42
|
|
@@ -45,12 +48,12 @@ var ToolbarButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
45
48
|
tooltipPosition: ((_useContext = (0, _react.useContext)(_Toolbar.ToolbarContext)) === null || _useContext === void 0 ? void 0 : _useContext.vertical) && 'right'
|
46
49
|
}, rest, {
|
47
50
|
ref: ref,
|
48
|
-
className: (0, _classnames.default)(className, (0, _defineProperty2.default)({}, "".concat(
|
51
|
+
className: (0, _classnames.default)(className, (0, _defineProperty2.default)({}, "".concat(blockClass, "--caret"), caret)),
|
49
52
|
kind: "ghost",
|
50
53
|
size: "md",
|
51
54
|
hasIconOnly: true
|
52
55
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, caret && /*#__PURE__*/_react.default.createElement("span", {
|
53
|
-
className: "".concat(
|
56
|
+
className: "".concat(blockClass, "__caret")
|
54
57
|
})));
|
55
58
|
});
|
56
59
|
exports.ToolbarButton = ToolbarButton;
|
@@ -34,7 +34,7 @@ var Canary = function Canary(_ref
|
|
34
34
|
var className = _ref.className,
|
35
35
|
componentName = _ref.componentName,
|
36
36
|
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
37
|
-
var instructions = "\nimport { pkg } from '@carbon/ibm-
|
37
|
+
var instructions = "\nimport { pkg } from '@carbon/ibm-products';\n// NOTE: must happen before component is first used\npkg.component.".concat(componentName, " = true;\n");
|
38
38
|
return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({}, rest, {
|
39
39
|
className: (0, _classnames.default)(blockClass, className)
|
40
40
|
}), /*#__PURE__*/_react.default.createElement("h2", null, "This component ", /*#__PURE__*/_react.default.createElement("strong", null, componentName), " is not ready yet."), /*#__PURE__*/_react.default.createElement("p", null, "To enable it, initialize package flags before the component is first used."), /*#__PURE__*/_react.default.createElement("br", null), /*#__PURE__*/_react.default.createElement("p", null, "e.g. in main.js"), /*#__PURE__*/_react.default.createElement(_carbonComponentsReact.CodeSnippet, {
|
package/lib/components/index.js
CHANGED
@@ -99,12 +99,6 @@ Object.defineProperty(exports, "ErrorEmptyState", {
|
|
99
99
|
return _EmptyStates.ErrorEmptyState;
|
100
100
|
}
|
101
101
|
});
|
102
|
-
Object.defineProperty(exports, "ExampleComponent", {
|
103
|
-
enumerable: true,
|
104
|
-
get: function get() {
|
105
|
-
return _ExampleComponent.ExampleComponent;
|
106
|
-
}
|
107
|
-
});
|
108
102
|
Object.defineProperty(exports, "ExportModal", {
|
109
103
|
enumerable: true,
|
110
104
|
get: function get() {
|
@@ -300,8 +294,6 @@ var _CreateTearsheetNarrow = require("./CreateTearsheetNarrow");
|
|
300
294
|
|
301
295
|
var _EmptyStates = require("./EmptyStates");
|
302
296
|
|
303
|
-
var _ExampleComponent = require("./ExampleComponent");
|
304
|
-
|
305
297
|
var _ExportModal = require("./ExportModal");
|
306
298
|
|
307
299
|
var _ExpressiveCard = require("./ExpressiveCard");
|
@@ -5,7 +5,11 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
7
7
|
});
|
8
|
-
exports.prepareStory = exports.getStoryTitle = exports.getStoryId = void 0;
|
8
|
+
exports.prepareStory = exports.getStoryTitle = exports.getStoryId = exports.CodesandboxLink = void 0;
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
9
13
|
|
10
14
|
var _csf = require("@storybook/csf");
|
11
15
|
|
@@ -69,5 +73,28 @@ var prepareStory = function prepareStory(template, options) {
|
|
69
73
|
result.parameters.ccsSettings.sequence = sequence++;
|
70
74
|
return result;
|
71
75
|
};
|
76
|
+
/**
|
77
|
+
* A helper component that returns a codesandbox link to an example codesandbox for the component.
|
78
|
+
* The link URL is based on the example directory name and the standard codesandbox URL for package examples.
|
79
|
+
*/
|
80
|
+
|
81
|
+
|
82
|
+
exports.prepareStory = prepareStory;
|
83
|
+
|
84
|
+
var CodesandboxLink = function CodesandboxLink(_ref) {
|
85
|
+
var exampleDirectory = _ref.exampleDirectory;
|
86
|
+
return /*#__PURE__*/_react.default.createElement("a", {
|
87
|
+
href: "https://codesandbox.io/s/github/carbon-design-system/ibm-cloud-cognitive/tree/main/examples/carbon-for-ibm-products/".concat(exampleDirectory)
|
88
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
89
|
+
alt: "Edit on CodeSandbox",
|
90
|
+
src: "https://codesandbox.io/static/img/play-codesandbox.svg"
|
91
|
+
}));
|
92
|
+
};
|
72
93
|
|
73
|
-
exports.
|
94
|
+
exports.CodesandboxLink = CodesandboxLink;
|
95
|
+
CodesandboxLink.propTypes = {
|
96
|
+
/**
|
97
|
+
* directory withing examples codesandbox will be found
|
98
|
+
*/
|
99
|
+
exampleDirectory: _propTypes.default.string
|
100
|
+
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@carbon/ibm-products",
|
3
3
|
"description": "Carbon for IBM Products",
|
4
|
-
"version": "1.
|
4
|
+
"version": "1.2.0",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"main": "lib/index.js",
|
7
7
|
"module": "es/index.js",
|
@@ -52,7 +52,7 @@
|
|
52
52
|
"devDependencies": {
|
53
53
|
"@babel/cli": "^7.16.0",
|
54
54
|
"@babel/core": "^7.16.0",
|
55
|
-
"babel-preset-ibm-cloud-cognitive": "^0.
|
55
|
+
"babel-preset-ibm-cloud-cognitive": "^0.14.0",
|
56
56
|
"chalk": "^4.1.2",
|
57
57
|
"change-case": "^4.1.2",
|
58
58
|
"copyfiles": "^2.4.1",
|
@@ -60,11 +60,11 @@
|
|
60
60
|
"fs-extra": "^10.0.0",
|
61
61
|
"glob": "^7.2.0",
|
62
62
|
"jest": "^27.3.1",
|
63
|
-
"jest-config-ibm-cloud-cognitive": "^0.
|
63
|
+
"jest-config-ibm-cloud-cognitive": "^0.23.0",
|
64
64
|
"npm-check-updates": "^12.0.2",
|
65
65
|
"npm-run-all": "^4.1.5",
|
66
66
|
"rimraf": "^3.0.2",
|
67
|
-
"sass": "^1.43.
|
67
|
+
"sass": "^1.43.5",
|
68
68
|
"yargs": "^17.2.1"
|
69
69
|
},
|
70
70
|
"dependencies": {
|
@@ -86,5 +86,5 @@
|
|
86
86
|
"react": "^16.8.6 || ^17.0.1",
|
87
87
|
"react-dom": "^16.8.6 || ^17.0.1"
|
88
88
|
},
|
89
|
-
"gitHead": "
|
89
|
+
"gitHead": "2d73283440932eacac0047223791c6590599d0db"
|
90
90
|
}
|
@@ -45,12 +45,29 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
45
45
|
background-color: var(--to-color);
|
46
46
|
}
|
47
47
|
}
|
48
|
+
@keyframes background-and-shadow-appear {
|
49
|
+
from {
|
50
|
+
background-color: var(--from-color);
|
51
|
+
box-shadow: 0 1px 0 var(--from-color);
|
52
|
+
}
|
53
|
+
to {
|
54
|
+
background-color: var(--to-color);
|
55
|
+
box-shadow: 0 1px 0 var(--to-color-shadow);
|
56
|
+
}
|
57
|
+
}
|
48
58
|
|
49
|
-
@mixin appearingBackground(
|
59
|
+
@mixin appearingBackground(
|
60
|
+
$with-shadow: false,
|
61
|
+
$from-color: $ui-background,
|
62
|
+
$to-color: $ui-01,
|
63
|
+
$to-color-shadow: $ui-03
|
64
|
+
) {
|
50
65
|
// stylelint-disable-next-line carbon/theme-token-use
|
51
66
|
--from-color: #{$from-color};
|
52
67
|
// stylelint-disable-next-line carbon/theme-token-use
|
53
68
|
--to-color: #{$to-color};
|
69
|
+
// stylelint-disable-next-line carbon/theme-token-use
|
70
|
+
--to-color-shadow: #{$to-color-shadow};
|
54
71
|
|
55
72
|
position: absolute;
|
56
73
|
top: 0;
|
@@ -61,8 +78,13 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
61
78
|
|
62
79
|
// This transitions the background-color between from-color and to-color
|
63
80
|
$duration: 1000ms;
|
64
|
-
|
65
|
-
animation: background-appear
|
81
|
+
|
82
|
+
$animation: background-appear;
|
83
|
+
@if ($with-shadow) {
|
84
|
+
$animation: background-and-shadow-appear;
|
85
|
+
}
|
86
|
+
|
87
|
+
animation: $animation $duration
|
66
88
|
calc((-1 * $duration * var(--#{$block-class}--background-opacity))) linear
|
67
89
|
paused forwards;
|
68
90
|
|
@@ -98,10 +120,9 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
98
120
|
}
|
99
121
|
|
100
122
|
&::before {
|
101
|
-
@include appearingBackground();
|
123
|
+
@include appearingBackground(true);
|
102
124
|
|
103
125
|
z-index: -1;
|
104
|
-
box-shadow: 0 1px 0 $ui-03;
|
105
126
|
}
|
106
127
|
|
107
128
|
.#{$block-class}--width--xl {
|
@@ -465,6 +486,15 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
465
486
|
@include appearingBackground();
|
466
487
|
}
|
467
488
|
|
489
|
+
.#{$block-class}__page-actions-content {
|
490
|
+
position: relative; // ensure appears over ::before
|
491
|
+
display: flex;
|
492
|
+
overflow: hidden;
|
493
|
+
width: 100%;
|
494
|
+
height: 100%;
|
495
|
+
justify-content: flex-end;
|
496
|
+
}
|
497
|
+
|
468
498
|
.#{$block-class}__title-row .#{$block-class}__page-actions--in-breadcrumb {
|
469
499
|
opacity: 0;
|
470
500
|
visibility: hidden;
|
@@ -489,7 +519,7 @@ $right-section-alt-width: 100% - $left-section-alt-width;
|
|
489
519
|
}
|
490
520
|
|
491
521
|
.#{$block-class}__subtitle {
|
492
|
-
@include carbon--type-style('body-long-
|
522
|
+
@include carbon--type-style('body-long-01');
|
493
523
|
}
|
494
524
|
|
495
525
|
.#{$block-class}__available-row {
|
@@ -225,6 +225,12 @@
|
|
225
225
|
flex: 0 0 257px; // influencer width 256px plus 1px border
|
226
226
|
border-right: 1px solid $ui-03;
|
227
227
|
overflow-y: auto;
|
228
|
+
|
229
|
+
// the normal 80% content width inside modals should not apply to influencer content
|
230
|
+
// apply the class again for higher specificity
|
231
|
+
&.#{$block-class}__influencer p {
|
232
|
+
padding-right: 0;
|
233
|
+
}
|
228
234
|
}
|
229
235
|
|
230
236
|
.#{$block-class}__influencer--wide {
|