@useblu/ocean-react 1.127.0 → 1.129.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/Button/Button.d.ts +1 -1
- package/Button/Button.d.ts.map +1 -1
- package/CHANGELOG.md +12 -0
- package/InternalContextualHero/InternalContextualHero.d.ts +2 -0
- package/InternalContextualHero/InternalContextualHero.d.ts.map +1 -1
- package/index.es.js +20 -6
- package/index.es.js.map +1 -1
- package/index.js +20 -6
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -422,7 +422,7 @@ function ButtonBase(_a, ref) {
|
|
|
422
422
|
console.warn('Ocean Design System: The "textCritical" variant is deprecated. Please use "tertiaryCritical" instead.');
|
|
423
423
|
}
|
|
424
424
|
}, [variant]);
|
|
425
|
-
var onColor = ['primary', 'primaryCritical', 'inverse'].includes(variant);
|
|
425
|
+
var onColor = ['primary', 'primaryCritical', 'primaryWarning', 'inverse'].includes(variant);
|
|
426
426
|
return e.createElement(component || 'button', __assign$1(__assign$1({ ref: ref, className: classNames('ods-btn', "ods-btn--".concat(size), "ods-btn--".concat(variant.replace(/[A-Z]/g, function (m) { return "-".concat(m.toLowerCase()); })), blocked && 'ods-btn--blocked', className, { 'ods-btn--loading': loading }) }, rest), { onClick: loading ? function () { return false; } : rest.onClick }), loading ? (e.createElement(e.Fragment, null,
|
|
427
427
|
e.createElement(Progress, { size: size, onColor: onColor }),
|
|
428
428
|
e.createElement("span", null, children))) : (children));
|
|
@@ -47810,26 +47810,40 @@ ListExpandable.displayName = 'ListExpandable';
|
|
|
47810
47810
|
var isListItemString = function (item) {
|
|
47811
47811
|
return typeof item === 'object' && item !== null && 'description' in item;
|
|
47812
47812
|
};
|
|
47813
|
+
var primaryButtonVariants = {
|
|
47814
|
+
default: 'primary',
|
|
47815
|
+
warning: 'primaryWarning',
|
|
47816
|
+
negative: 'primaryCritical',
|
|
47817
|
+
};
|
|
47818
|
+
var secondaryButtonVariants = {
|
|
47819
|
+
default: 'tertiary',
|
|
47820
|
+
warning: 'tertiaryWarning',
|
|
47821
|
+
negative: 'tertiaryCritical',
|
|
47822
|
+
};
|
|
47813
47823
|
var InternalContextualHero = e.forwardRef(function (_a, ref) {
|
|
47814
|
-
var
|
|
47824
|
+
var _b;
|
|
47825
|
+
var title = _a.title, description = _a.description, image = _a.image, listItems = _a.listItems, actions = _a.actions, className = _a.className, _c = _a.imagePosition, imagePosition = _c === void 0 ? 'top' : _c, _d = _a.type, type = _d === void 0 ? 'default' : _d;
|
|
47815
47826
|
var renderImage = function () {
|
|
47816
47827
|
if (typeof image === 'string') {
|
|
47817
47828
|
return e.createElement("img", { src: image, alt: title });
|
|
47818
47829
|
}
|
|
47819
47830
|
return image;
|
|
47820
47831
|
};
|
|
47821
|
-
return (e.createElement("div", { "data-testid": "internal-contextual-hero", className: classNames('ods-internal-contextual-hero', className
|
|
47832
|
+
return (e.createElement("div", { "data-testid": "internal-contextual-hero", className: classNames('ods-internal-contextual-hero', className, (_b = {},
|
|
47833
|
+
_b["ods-internal-contextual-hero--".concat(type)] = type,
|
|
47834
|
+
_b["ods-internal-contextual-hero--".concat(imagePosition)] = imagePosition,
|
|
47835
|
+
_b)), ref: ref },
|
|
47822
47836
|
e.createElement("div", { className: 'ods-internal-contextual-hero__body' },
|
|
47823
47837
|
e.createElement("div", { className: 'ods-internal-contextual-hero__content' },
|
|
47824
47838
|
e.createElement("div", { className: 'ods-internal-contextual-hero__header' },
|
|
47825
47839
|
e.createElement(Typography, { variant: "heading3" }, title),
|
|
47826
47840
|
e.createElement(Typography, { variant: "description" }, description)),
|
|
47827
47841
|
actions && actions.length > 0 && (e.createElement("div", { className: 'ods-internal-contextual-hero__actions' },
|
|
47828
|
-
e.createElement(Button$1, { variant:
|
|
47829
|
-
actions[1] && (e.createElement(Button$1, { variant:
|
|
47842
|
+
e.createElement(Button$1, { variant: primaryButtonVariants[type], size: 'sm', onClick: actions[0].onClick }, actions[0].label),
|
|
47843
|
+
actions[1] && (e.createElement(Button$1, { variant: secondaryButtonVariants[type], size: 'sm', onClick: actions[1].onClick }, actions[1].label))))),
|
|
47830
47844
|
e.createElement("div", { className: 'ods-internal-contextual-hero__list' }, listItems === null || listItems === void 0 ? void 0 : listItems.map(function (item) {
|
|
47831
47845
|
return isListItemString(item) ? (e.createElement("div", { key: item.description, className: 'ods-internal-contextual-hero__list-item' },
|
|
47832
|
-
item.icon && e.createElement("div",
|
|
47846
|
+
item.icon && e.createElement("div", { className: "ods-internal-contextual-hero__list-item-icon" }, item.icon),
|
|
47833
47847
|
e.createElement(Typography, { variant: "description" }, item.description))) : (item);
|
|
47834
47848
|
}))),
|
|
47835
47849
|
image && (e.createElement("div", { className: 'ods-internal-contextual-hero__image' }, renderImage()))));
|