@useblu/ocean-react 1.129.0 → 1.130.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/Badge/Badge.d.ts +2 -2
- package/Badge/Badge.d.ts.map +1 -1
- package/CHANGELOG.md +6 -0
- package/CardGroup/ActionButton.d.ts +3 -1
- package/CardGroup/ActionButton.d.ts.map +1 -1
- package/CardGroup/CardGroup.d.ts +2 -0
- package/CardGroup/CardGroup.d.ts.map +1 -1
- package/index.es.js +5 -4
- package/index.es.js.map +1 -1
- package/index.js +5 -4
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -505,22 +505,23 @@ var Header = function (_a) {
|
|
|
505
505
|
};
|
|
506
506
|
|
|
507
507
|
var ActionButton = function (_a) {
|
|
508
|
-
var actionLabel = _a.actionLabel, actionCount = _a.actionCount, actionClick = _a.actionClick;
|
|
508
|
+
var actionLabel = _a.actionLabel, actionCount = _a.actionCount, actionClick = _a.actionClick, actionBadgeColor = _a.actionBadgeColor;
|
|
509
|
+
var badgeColor = actionBadgeColor !== null && actionBadgeColor !== void 0 ? actionBadgeColor : (actionCount === 0 ? 'neutral' : 'alert');
|
|
509
510
|
return (e.createElement(e.Fragment, null,
|
|
510
511
|
e.createElement("hr", { className: "ods-divider" }),
|
|
511
512
|
e.createElement("button", { onClick: actionClick, type: "button", className: "ods-card-group__action", "aria-label": actionLabel },
|
|
512
513
|
e.createElement("span", { className: "ods-card-group__action--label" }, actionLabel),
|
|
513
514
|
e.createElement("div", { className: "ods-card-group__action--right" },
|
|
514
|
-
actionCount !== undefined && (e.createElement(Badge, { variation: "medium", color:
|
|
515
|
+
actionCount !== undefined && (e.createElement(Badge, { variation: "medium", color: badgeColor, count: actionCount })),
|
|
515
516
|
e.createElement(re, { size: 20 })))));
|
|
516
517
|
};
|
|
517
518
|
|
|
518
519
|
var CardGroup = e.forwardRef(function (_a, ref) {
|
|
519
|
-
var title = _a.title, subtitle = _a.subtitle, actionLabel = _a.actionLabel, actionCount = _a.actionCount, actionClick = _a.actionClick, count = _a.count, tag = _a.tag, children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'minimal' : _b, rest = __rest$1(_a, ["title", "subtitle", "actionLabel", "actionCount", "actionClick", "count", "tag", "children", "variant"]);
|
|
520
|
+
var title = _a.title, subtitle = _a.subtitle, actionLabel = _a.actionLabel, actionCount = _a.actionCount, actionClick = _a.actionClick, actionBadgeColor = _a.actionBadgeColor, count = _a.count, tag = _a.tag, children = _a.children, _b = _a.variant, variant = _b === void 0 ? 'minimal' : _b, rest = __rest$1(_a, ["title", "subtitle", "actionLabel", "actionCount", "actionClick", "actionBadgeColor", "count", "tag", "children", "variant"]);
|
|
520
521
|
return (e.createElement("div", __assign$1({ ref: ref }, rest, { "data-testid": "card-group", className: classNames('ods-card-group', "ods-card-group--".concat(variant)) }),
|
|
521
522
|
(title || subtitle) && (e.createElement(Header, { title: title, subtitle: subtitle, count: count, tag: tag })),
|
|
522
523
|
children && variant !== 'header' && e.createElement("div", null, children),
|
|
523
|
-
actionLabel && variant !== 'header' && (e.createElement(ActionButton, { actionLabel: actionLabel, actionCount: actionCount, actionClick: actionClick }))));
|
|
524
|
+
actionLabel && variant !== 'header' && (e.createElement(ActionButton, { actionLabel: actionLabel, actionCount: actionCount, actionClick: actionClick, actionBadgeColor: actionBadgeColor }))));
|
|
524
525
|
});
|
|
525
526
|
CardGroup.displayName = 'CardGroup';
|
|
526
527
|
|