@useblu/ocean-react 1.132.0 → 1.134.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/CHANGELOG.md +12 -0
- package/ListAction/ListAction.d.ts +8 -0
- package/ListAction/ListAction.d.ts.map +1 -1
- package/ListAction/index.d.ts +1 -0
- package/ListAction/index.d.ts.map +1 -1
- package/ListExpandable/ListExpandable.d.ts +3 -0
- package/ListExpandable/ListExpandable.d.ts.map +1 -1
- package/ListReadOnly/ListReadOnly.d.ts +3 -0
- package/ListReadOnly/ListReadOnly.d.ts.map +1 -1
- package/ListSelectable/ListSelectable.d.ts +3 -0
- package/ListSelectable/ListSelectable.d.ts.map +1 -1
- package/ListSettings/ListSettings.d.ts +3 -0
- package/ListSettings/ListSettings.d.ts.map +1 -1
- package/TransactionListExpandable/TransactionListExpandable.d.ts +47 -0
- package/TransactionListExpandable/TransactionListExpandable.d.ts.map +1 -0
- package/TransactionListExpandable/index.d.ts +3 -0
- package/TransactionListExpandable/index.d.ts.map +1 -0
- package/_shared/components/AmountDetails/AmountDetails.d.ts +15 -0
- package/_shared/components/AmountDetails/AmountDetails.d.ts.map +1 -0
- package/_shared/components/AmountDetails/index.d.ts +3 -0
- package/_shared/components/AmountDetails/index.d.ts.map +1 -0
- package/_shared/components/ListContainer/ListContainer.d.ts +24 -0
- package/_shared/components/ListContainer/ListContainer.d.ts.map +1 -0
- package/_shared/components/ListContainer/index.d.ts +4 -0
- package/_shared/components/ListContainer/index.d.ts.map +1 -0
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.es.js +143 -58
- package/index.es.js.map +1 -1
- package/index.js +143 -57
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.es.js
CHANGED
|
@@ -5476,9 +5476,49 @@ var SkeletonBar = function (_a) {
|
|
|
5476
5476
|
return (e.createElement("div", __assign$1({ className: "ods-skeleton-bar", style: { width: width, height: height } }, props)));
|
|
5477
5477
|
};
|
|
5478
5478
|
|
|
5479
|
-
var
|
|
5479
|
+
var ListContainer = e.forwardRef(function (_a, ref) {
|
|
5480
5480
|
var _b, _c;
|
|
5481
|
-
var
|
|
5481
|
+
var _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.showDivider, showDivider = _e === void 0 ? false : _e, _f = _a.hasError, hasError = _f === void 0 ? false : _f, highlight = _a.highlight, children = _a.children, className = _a.className, rest = __rest$1(_a, ["type", "showDivider", "hasError", "highlight", "children", "className"]);
|
|
5482
|
+
return (e.createElement("div", { className: "ods-list-container" },
|
|
5483
|
+
e.createElement("div", __assign$1({ ref: ref, className: classNames('ods-list-container__content', className, {
|
|
5484
|
+
'ods-list-container__content--card': type === 'card',
|
|
5485
|
+
'ods-list-container__content--card--error': type === 'card' && hasError,
|
|
5486
|
+
'ods-list-container__content--text': type === 'text',
|
|
5487
|
+
}) }, rest),
|
|
5488
|
+
children,
|
|
5489
|
+
showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-container__content__divider" }))),
|
|
5490
|
+
(highlight === null || highlight === void 0 ? void 0 : highlight.caption) && (e.createElement("div", { className: "ods-list-container__highlight", "data-testid": "list-container-highlight", style: { backgroundColor: (_b = highlight.backgroundColor) !== null && _b !== void 0 ? _b : '#F3F5FE' } },
|
|
5491
|
+
e.createElement("p", { className: "ods-typography ods-typography__caption", style: { color: (_c = highlight.captionColor) !== null && _c !== void 0 ? _c : '#67697A' } }, highlight.caption)))));
|
|
5492
|
+
});
|
|
5493
|
+
ListContainer.displayName = 'ListContainer';
|
|
5494
|
+
|
|
5495
|
+
var ListReadOnly = e.forwardRef(function (_a, ref) {
|
|
5496
|
+
var _b;
|
|
5497
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, icon = _a.icon, indicator = _a.indicator, _c = _a.type, type = _c === void 0 ? 'card' : _c, _d = _a.status, status = _d === void 0 ? 'default' : _d, _e = _a.inverted, inverted = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, className = _a.className, _h = _a.showDivider, showDivider = _h === void 0 ? false : _h, highlight = _a.highlight, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "icon", "indicator", "type", "status", "inverted", "disabled", "loading", "className", "showDivider", "highlight"]);
|
|
5498
|
+
var renderLoadingContent = function () { return (e.createElement("div", { className: "ods-list-readonly__skeleton" },
|
|
5499
|
+
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
5500
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }))); };
|
|
5501
|
+
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
5502
|
+
icon && (e.createElement("div", { className: classNames('ods-list-readonly__icon', {
|
|
5503
|
+
'ods-list-readonly__icon--inactive': status === 'inactive',
|
|
5504
|
+
}) }, icon)),
|
|
5505
|
+
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
|
|
5506
|
+
indicator && (e.createElement("div", { className: "ods-list-readonly__trailing" },
|
|
5507
|
+
e.createElement("div", { className: "ods-list-readonly__indicator" }, indicator))))); };
|
|
5508
|
+
var cardClassName = classNames('ods-list-readonly', className, (_b = {
|
|
5509
|
+
'ods-list-readonly--loading': loading,
|
|
5510
|
+
'ods-list-readonly--disabled': disabled
|
|
5511
|
+
},
|
|
5512
|
+
_b["ods-list-readonly--".concat(type)] = type,
|
|
5513
|
+
_b));
|
|
5514
|
+
return (e.createElement(ListContainer, { type: type, showDivider: showDivider, highlight: highlight },
|
|
5515
|
+
e.createElement("div", __assign$1({ ref: ref, "data-testid": "card-list-readonly", className: cardClassName }, rest), loading ? renderLoadingContent() : renderContent())));
|
|
5516
|
+
});
|
|
5517
|
+
ListReadOnly.displayName = 'ListReadOnly';
|
|
5518
|
+
|
|
5519
|
+
var ListSelectable = e.forwardRef(function (_a, ref) {
|
|
5520
|
+
var _b;
|
|
5521
|
+
var title = _a.title, description = _a.description, caption = _a.caption, strikethroughDescription = _a.strikethroughDescription, inverted = _a.inverted, loading = _a.loading, disabled = _a.disabled, checkbox = _a.checkbox, radio = _a.radio, className = _a.className, showDivider = _a.showDivider, indicator = _a.indicator, isSelectableDisabled = _a.isSelectableDisabled, highlight = _a.highlight, _c = _a.status, status = _c === void 0 ? 'default' : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.platform, platform = _e === void 0 ? 'web' : _e, rest = __rest$1(_a, ["title", "description", "caption", "strikethroughDescription", "inverted", "loading", "disabled", "checkbox", "radio", "className", "showDivider", "indicator", "isSelectableDisabled", "highlight", "status", "type", "platform"]);
|
|
5482
5522
|
var hasError = useMemo(function () { return (radio === null || radio === void 0 ? void 0 : radio.error) || (checkbox === null || checkbox === void 0 ? void 0 : checkbox.error); }, [radio === null || radio === void 0 ? void 0 : radio.error, checkbox === null || checkbox === void 0 ? void 0 : checkbox.error]);
|
|
5483
5523
|
var isInputDisabled = useMemo(function () { return (radio === null || radio === void 0 ? void 0 : radio.disabled) || (checkbox === null || checkbox === void 0 ? void 0 : checkbox.disabled) || disabled; }, [radio === null || radio === void 0 ? void 0 : radio.disabled, checkbox === null || checkbox === void 0 ? void 0 : checkbox.disabled, disabled]);
|
|
5484
5524
|
var internalList = useMemo(function () {
|
|
@@ -5504,18 +5544,17 @@ var ListSelectable = e.forwardRef(function (_a, ref) {
|
|
|
5504
5544
|
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
5505
5545
|
e.createElement(SkeletonBar, { width: "100%", height: "16px" })));
|
|
5506
5546
|
}
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
e.createElement("div", __assign$1({ className: classNames('ods-list-selectable', className, (
|
|
5547
|
+
if (isSelectableDisabled) {
|
|
5548
|
+
return (e.createElement(ListReadOnly, __assign$1({ title: title, description: description, status: status, type: type, inverted: inverted, disabled: disabled, loading: loading, className: className, showDivider: showDivider, indicator: indicator, caption: caption, strikethroughDescription: strikethroughDescription, highlight: highlight }, rest, { ref: ref })));
|
|
5549
|
+
}
|
|
5550
|
+
return (e.createElement(ListContainer, { type: type, showDivider: showDivider, hasError: hasError, highlight: highlight },
|
|
5551
|
+
e.createElement("div", __assign$1({ className: classNames('ods-list-selectable', className, (_b = {
|
|
5512
5552
|
'ods-list-selectable--disabled': isInputDisabled
|
|
5513
5553
|
},
|
|
5514
|
-
|
|
5515
|
-
|
|
5554
|
+
_b["ods-list-selectable--".concat(platform)] = platform,
|
|
5555
|
+
_b)), ref: ref }, rest),
|
|
5516
5556
|
checkbox && e.createElement(Checkbox, __assign$1({}, checkbox, { label: internalList })),
|
|
5517
|
-
radio && e.createElement(Radio, __assign$1({}, radio, { label: internalList })))
|
|
5518
|
-
showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-selectable__root--text--divider" }))));
|
|
5557
|
+
radio && e.createElement(Radio, __assign$1({}, radio, { label: internalList })))));
|
|
5519
5558
|
});
|
|
5520
5559
|
ListSelectable.displayName = 'ListSelectable';
|
|
5521
5560
|
|
|
@@ -47785,9 +47824,26 @@ var InternalListActions = forwardRef(function (_a, forwardedRef) {
|
|
|
47785
47824
|
});
|
|
47786
47825
|
InternalListActions.displayName = 'InternalListActions';
|
|
47787
47826
|
|
|
47827
|
+
var AmountDetails = function (_a) {
|
|
47828
|
+
var amount = _a.amount, _b = _a.type, type = _b === void 0 ? 'default' : _b, indicator = _a.indicator, _c = _a.indicatorSize, indicatorSize = _c === void 0 ? 'small' : _c, _d = _a.showIndicator, showIndicator = _d === void 0 ? true : _d, additionalData = _a.additionalData, _e = _a.showAdditionalData, showAdditionalData = _e === void 0 ? true : _e;
|
|
47829
|
+
var isNegative = type === 'negative';
|
|
47830
|
+
var isPositive = type === 'positive';
|
|
47831
|
+
return (e.createElement("div", { className: "ods-amount-details" },
|
|
47832
|
+
e.createElement("div", { className: "ods-amount-details__main" },
|
|
47833
|
+
isNegative ? (e.createElement("div", { className: "ods-amount-details__amount-row" },
|
|
47834
|
+
e.createElement("span", { className: "ods-amount-details__amount-sign" }, "- "),
|
|
47835
|
+
e.createElement("p", { className: "ods-amount-details__amount" }, amount))) : (e.createElement("p", { className: classNames('ods-amount-details__amount', {
|
|
47836
|
+
'ods-amount-details__amount--positive': isPositive,
|
|
47837
|
+
}) }, amount)),
|
|
47838
|
+
showIndicator && indicator && (e.createElement("div", { className: classNames('ods-amount-details__indicator', {
|
|
47839
|
+
'ods-amount-details__indicator--medium': indicatorSize === 'medium',
|
|
47840
|
+
}) }, indicator))),
|
|
47841
|
+
showAdditionalData && additionalData && (e.createElement(Typography, { variant: "captionbold", className: "ods-amount-details__caption" }, additionalData))));
|
|
47842
|
+
};
|
|
47843
|
+
|
|
47788
47844
|
var ListAction = e.forwardRef(function (_a, ref) {
|
|
47789
47845
|
var _b;
|
|
47790
|
-
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, icon = _a.icon, indicator = _a.indicator, _h = _a.actionType, actionType = _h === void 0 ? 'chevron' : _h, menuActions = _a.menuActions, _j = _a.menuPosition, menuPosition = _j === void 0 ? 'bottom-right' : _j, onClick = _a.onClick, className = _a.className, _k = _a.showDivider, showDivider = _k === void 0 ? false : _k, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "indicator", "actionType", "menuActions", "menuPosition", "onClick", "className", "showDivider"]);
|
|
47846
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, icon = _a.icon, indicator = _a.indicator, _h = _a.actionType, actionType = _h === void 0 ? 'chevron' : _h, menuActions = _a.menuActions, _j = _a.menuPosition, menuPosition = _j === void 0 ? 'bottom-right' : _j, onClick = _a.onClick, className = _a.className, _k = _a.showDivider, showDivider = _k === void 0 ? false : _k, amountDetails = _a.amountDetails, position = _a.position, highlight = _a.highlight, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "indicator", "actionType", "menuActions", "menuPosition", "onClick", "className", "showDivider", "amountDetails", "position", "highlight"]);
|
|
47791
47847
|
var _l = useState(false), isSwipeOpen = _l[0], setIsSwipeOpen = _l[1];
|
|
47792
47848
|
var _m = useState(0), menuWidth = _m[0], setMenuWidth = _m[1];
|
|
47793
47849
|
var handleSwipeOpenChange = function (isOpen, width) {
|
|
@@ -47798,7 +47854,7 @@ var ListAction = e.forwardRef(function (_a, ref) {
|
|
|
47798
47854
|
};
|
|
47799
47855
|
var renderActionIcon = function () {
|
|
47800
47856
|
if (actionType === 'chevron') {
|
|
47801
|
-
return (e.createElement("div", { className:
|
|
47857
|
+
return (e.createElement("div", { className: "ods-list-action__action" },
|
|
47802
47858
|
e.createElement(re, { size: 20 })));
|
|
47803
47859
|
}
|
|
47804
47860
|
if (actionType === 'menu' || actionType === 'swipe') {
|
|
@@ -47806,19 +47862,32 @@ var ListAction = e.forwardRef(function (_a, ref) {
|
|
|
47806
47862
|
}
|
|
47807
47863
|
return null;
|
|
47808
47864
|
};
|
|
47809
|
-
var renderLoadingContent = function () { return (e.createElement("div", { className:
|
|
47810
|
-
e.createElement(SkeletonBar, { width:
|
|
47811
|
-
e.createElement(SkeletonBar, { width:
|
|
47865
|
+
var renderLoadingContent = function () { return (e.createElement("div", { className: "ods-list-action__skeleton" },
|
|
47866
|
+
e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
|
|
47867
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }))); };
|
|
47812
47868
|
var contentStyle = isSwipeOpen && menuWidth > 0
|
|
47813
47869
|
? { transform: "translateX(-".concat(menuWidth, "px)") }
|
|
47814
47870
|
: {};
|
|
47871
|
+
var showLeading = position && icon;
|
|
47872
|
+
var showLineAbove = position === 'middle' || position === 'last';
|
|
47873
|
+
var showLineBelow = position === 'first' || position === 'middle';
|
|
47815
47874
|
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
47816
|
-
e.createElement("div", { className:
|
|
47817
|
-
|
|
47875
|
+
e.createElement("div", { className: "ods-list-action__content", style: contentStyle },
|
|
47876
|
+
showLeading ? (e.createElement("div", { className: "ods-list-action__position" },
|
|
47877
|
+
e.createElement("div", { className: classNames('ods-list-action__position-line', {
|
|
47878
|
+
'ods-list-action__position-line--visible': showLineAbove,
|
|
47879
|
+
}) }),
|
|
47880
|
+
e.createElement("div", { className: classNames('ods-list-action__icon', {
|
|
47881
|
+
'ods-list-action__icon--inactive': status === 'inactive',
|
|
47882
|
+
}) }, icon),
|
|
47883
|
+
e.createElement("div", { className: classNames('ods-list-action__position-line', {
|
|
47884
|
+
'ods-list-action__position-line--visible': showLineBelow,
|
|
47885
|
+
}) }))) : (icon && (e.createElement("div", { className: classNames('ods-list-action__icon', {
|
|
47818
47886
|
'ods-list-action__icon--inactive': status === 'inactive',
|
|
47819
|
-
}) }, icon)),
|
|
47887
|
+
}) }, icon))),
|
|
47820
47888
|
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
|
|
47821
|
-
|
|
47889
|
+
amountDetails && e.createElement(AmountDetails, __assign$1({ type: status }, amountDetails)),
|
|
47890
|
+
indicator && (e.createElement("div", { className: "ods-list-action__indicator" }, indicator))),
|
|
47822
47891
|
renderActionIcon())); };
|
|
47823
47892
|
var buttonClassName = classNames('ods-list-action', className, (_b = {
|
|
47824
47893
|
'ods-list-action--loading': loading,
|
|
@@ -47828,40 +47897,14 @@ var ListAction = e.forwardRef(function (_a, ref) {
|
|
|
47828
47897
|
},
|
|
47829
47898
|
_b["ods-list-action--".concat(type)] = type,
|
|
47830
47899
|
_b));
|
|
47831
|
-
return (e.createElement(
|
|
47832
|
-
e.createElement("button", __assign$1({ ref: ref, type:
|
|
47833
|
-
showDivider && type === 'text' && (e.createElement("div", { className: 'ods-list-action__divider' }))));
|
|
47900
|
+
return (e.createElement(ListContainer, { type: type, showDivider: showDivider, highlight: highlight },
|
|
47901
|
+
e.createElement("button", __assign$1({ ref: ref, type: "button", "data-testid": "list-action", className: buttonClassName, onClick: loading ? undefined : onClick, disabled: disabled || loading }, rest), loading ? renderLoadingContent() : renderContent())));
|
|
47834
47902
|
});
|
|
47835
47903
|
ListAction.displayName = 'ListAction';
|
|
47836
47904
|
|
|
47837
|
-
var ListReadOnly = e.forwardRef(function (_a, ref) {
|
|
47838
|
-
var _b;
|
|
47839
|
-
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, icon = _a.icon, indicator = _a.indicator, _c = _a.type, type = _c === void 0 ? 'card' : _c, _d = _a.status, status = _d === void 0 ? 'default' : _d, _e = _a.inverted, inverted = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, className = _a.className, _h = _a.showDivider, showDivider = _h === void 0 ? false : _h, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "icon", "indicator", "type", "status", "inverted", "disabled", "loading", "className", "showDivider"]);
|
|
47840
|
-
var renderLoadingContent = function () { return (e.createElement("div", { className: 'ods-list-readonly__skeleton' },
|
|
47841
|
-
e.createElement(SkeletonBar, { width: '40%', height: '16px' }),
|
|
47842
|
-
e.createElement(SkeletonBar, { width: '100%', height: '16px' }))); };
|
|
47843
|
-
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
47844
|
-
icon && (e.createElement("div", { className: classNames('ods-list-readonly__icon', {
|
|
47845
|
-
'ods-list-readonly__icon--inactive': status === 'inactive',
|
|
47846
|
-
}) }, icon)),
|
|
47847
|
-
e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
|
|
47848
|
-
indicator && (e.createElement("div", { className: 'ods-list-readonly__trailing' },
|
|
47849
|
-
e.createElement("div", { className: 'ods-list-readonly__indicator' }, indicator))))); };
|
|
47850
|
-
var cardClassName = classNames('ods-list-readonly', className, (_b = {
|
|
47851
|
-
'ods-list-readonly--loading': loading,
|
|
47852
|
-
'ods-list-readonly--disabled': disabled
|
|
47853
|
-
},
|
|
47854
|
-
_b["ods-list-readonly--".concat(type)] = type,
|
|
47855
|
-
_b));
|
|
47856
|
-
return (e.createElement("div", { className: 'ods-list-readonly__container' },
|
|
47857
|
-
e.createElement("div", __assign$1({ ref: ref, "data-testid": 'card-list-readonly', className: cardClassName }, rest), loading ? renderLoadingContent() : renderContent()),
|
|
47858
|
-
showDivider && type === 'text' && (e.createElement("div", { className: 'ods-list-readonly__divider' }))));
|
|
47859
|
-
});
|
|
47860
|
-
ListReadOnly.displayName = 'ListReadOnly';
|
|
47861
|
-
|
|
47862
47905
|
var ListExpandable = e.forwardRef(function (_a, ref) {
|
|
47863
47906
|
var _b;
|
|
47864
|
-
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.loading, loading = _f === void 0 ? false : _f, icon = _a.icon, indicator = _a.indicator, controlledExpanded = _a.expanded, _g = _a.defaultExpanded, defaultExpanded = _g === void 0 ? false : _g, onToggle = _a.onToggle, children = _a.children, className = _a.className, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.showDivider, showDivider = _j === void 0 ? false : _j, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "loading", "icon", "indicator", "expanded", "defaultExpanded", "onToggle", "children", "className", "disabled", "showDivider"]);
|
|
47907
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.loading, loading = _f === void 0 ? false : _f, icon = _a.icon, indicator = _a.indicator, controlledExpanded = _a.expanded, _g = _a.defaultExpanded, defaultExpanded = _g === void 0 ? false : _g, onToggle = _a.onToggle, children = _a.children, className = _a.className, _h = _a.disabled, disabled = _h === void 0 ? false : _h, _j = _a.showDivider, showDivider = _j === void 0 ? false : _j, highlight = _a.highlight, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "loading", "icon", "indicator", "expanded", "defaultExpanded", "onToggle", "children", "className", "disabled", "showDivider", "highlight"]);
|
|
47865
47908
|
var _k = useState(defaultExpanded), internalExpanded = _k[0], setInternalExpanded = _k[1];
|
|
47866
47909
|
var isControlled = controlledExpanded !== undefined;
|
|
47867
47910
|
var isExpanded = isControlled ? controlledExpanded : internalExpanded;
|
|
@@ -47890,13 +47933,56 @@ var ListExpandable = e.forwardRef(function (_a, ref) {
|
|
|
47890
47933
|
},
|
|
47891
47934
|
_b["ods-list-expandable--".concat(type)] = type,
|
|
47892
47935
|
_b));
|
|
47893
|
-
return (e.createElement(
|
|
47894
|
-
e.createElement("
|
|
47895
|
-
|
|
47896
|
-
|
|
47936
|
+
return (e.createElement(ListContainer, { type: type, showDivider: false, highlight: highlight, ref: ref },
|
|
47937
|
+
e.createElement("div", __assign$1({ "data-testid": "list-expandable", className: containerClassName }, rest),
|
|
47938
|
+
e.createElement("button", { type: "button", className: "ods-list-expandable__main", onClick: loading ? undefined : handleToggle, disabled: disabled || loading, "aria-expanded": isExpanded, "aria-label": "".concat(isExpanded ? 'Recolher' : 'Expandir', " ").concat(title), "data-testid": "list-expandable-button" }, loading ? renderLoadingContent() : renderContent()),
|
|
47939
|
+
showDivider && (e.createElement("div", { className: "ods-list-expandable__divider", "data-testid": "list-expandable-divider" })),
|
|
47940
|
+
isExpanded && children && (e.createElement("div", { className: "ods-list-expandable__content" }, children)))));
|
|
47897
47941
|
});
|
|
47898
47942
|
ListExpandable.displayName = 'ListExpandable';
|
|
47899
47943
|
|
|
47944
|
+
var TransactionListExpandable = e.forwardRef(function (_a, ref) {
|
|
47945
|
+
var _b;
|
|
47946
|
+
var title = _a.title, description = _a.description, caption = _a.caption, amount = _a.amount, _c = _a.amountType, amountType = _c === void 0 ? 'default' : _c, amountIndicator = _a.amountIndicator, _d = _a.showAmountIndicator, showAmountIndicator = _d === void 0 ? true : _d, additionalData = _a.additionalData, _e = _a.inverted, inverted = _e === void 0 ? true : _e, _f = _a.type, type = _f === void 0 ? 'card' : _f, _g = _a.status, status = _g === void 0 ? 'default' : _g, _h = _a.loading, loading = _h === void 0 ? false : _h, icon = _a.icon, _j = _a.expanded, expanded = _j === void 0 ? false : _j, onToggle = _a.onToggle, children = _a.children, supportingText = _a.supportingText, className = _a.className, _k = _a.disabled, disabled = _k === void 0 ? false : _k, _l = _a.showDivider, showDivider = _l === void 0 ? false : _l, rest = __rest$1(_a, ["title", "description", "caption", "amount", "amountType", "amountIndicator", "showAmountIndicator", "additionalData", "inverted", "type", "status", "loading", "icon", "expanded", "onToggle", "children", "supportingText", "className", "disabled", "showDivider"]);
|
|
47947
|
+
var handleToggle = function () {
|
|
47948
|
+
onToggle === null || onToggle === void 0 ? void 0 : onToggle(!expanded);
|
|
47949
|
+
};
|
|
47950
|
+
var renderLoadingContent = function () { return (e.createElement(e.Fragment, null,
|
|
47951
|
+
e.createElement("div", { className: "ods-list-expandable__icon", "aria-hidden": true },
|
|
47952
|
+
e.createElement(SkeletonBar, { width: "24px", height: "24px" })),
|
|
47953
|
+
e.createElement("div", { className: "ods-list-expandable__skeleton ods-list-expandable__transaction-content" },
|
|
47954
|
+
e.createElement("div", { className: "ods-list-expandable__skeleton-list" },
|
|
47955
|
+
e.createElement(SkeletonBar, { width: "33%", height: "16px" }),
|
|
47956
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" })),
|
|
47957
|
+
e.createElement("div", { className: "ods-list-expandable__skeleton-amount" },
|
|
47958
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }),
|
|
47959
|
+
e.createElement(SkeletonBar, { width: "100%", height: "16px" }))))); };
|
|
47960
|
+
var renderContent = function () { return (e.createElement(e.Fragment, null,
|
|
47961
|
+
icon && (e.createElement("div", { className: classNames('ods-list-expandable__icon', {
|
|
47962
|
+
'ods-list-expandable__icon--inactive': status === 'inactive',
|
|
47963
|
+
}) }, icon)),
|
|
47964
|
+
e.createElement("div", { className: "ods-list-expandable__transaction-content" },
|
|
47965
|
+
e.createElement(ContentList, { title: title, description: description, caption: caption, inverted: inverted, type: status }),
|
|
47966
|
+
e.createElement(AmountDetails, { amount: amount, type: amountType, indicator: amountIndicator, indicatorSize: "medium", showIndicator: showAmountIndicator, additionalData: additionalData, showAdditionalData: Boolean(additionalData) })),
|
|
47967
|
+
e.createElement("div", { className: "ods-list-expandable__trailing" },
|
|
47968
|
+
e.createElement("div", { className: "ods-list-expandable__action" }, expanded ? e.createElement(ae, { size: 20 }) : e.createElement(ee, { size: 20 }))))); };
|
|
47969
|
+
var containerClassName = classNames('ods-list-expandable', 'ods-list-expandable--transaction', className, (_b = {
|
|
47970
|
+
'ods-list-expandable--expanded': expanded,
|
|
47971
|
+
'ods-list-expandable--disabled': disabled,
|
|
47972
|
+
'ods-list-expandable--loading': loading
|
|
47973
|
+
},
|
|
47974
|
+
_b["ods-list-expandable--".concat(type)] = type,
|
|
47975
|
+
_b));
|
|
47976
|
+
return (e.createElement("div", __assign$1({ ref: ref, "data-testid": "transaction-list-expandable", className: containerClassName }, rest),
|
|
47977
|
+
e.createElement("button", { type: "button", className: "ods-list-expandable__main", onClick: loading ? undefined : handleToggle, disabled: disabled || loading, "aria-expanded": expanded, "aria-label": "".concat(expanded ? 'Recolher' : 'Expandir', " ").concat(title), "data-testid": "transaction-list-expandable-button" }, loading ? renderLoadingContent() : renderContent()),
|
|
47978
|
+
showDivider && !expanded && (e.createElement("div", { className: "ods-list-expandable__divider", "data-testid": "transaction-list-expandable-divider" })),
|
|
47979
|
+
expanded && !loading && (children || supportingText) && (e.createElement(e.Fragment, null,
|
|
47980
|
+
children && (e.createElement("div", { className: "ods-list-expandable__content ods-list-expandable__content--transaction" }, children)),
|
|
47981
|
+
supportingText && (e.createElement("div", { className: "ods-list-expandable__footer", "data-testid": "transaction-list-expandable-supporting-text" }, supportingText)),
|
|
47982
|
+
showDivider && (e.createElement("div", { className: "ods-list-expandable__divider", "data-testid": "transaction-list-expandable-divider" }))))));
|
|
47983
|
+
});
|
|
47984
|
+
TransactionListExpandable.displayName = 'TransactionListExpandable';
|
|
47985
|
+
|
|
47900
47986
|
var isListItemString = function (item) {
|
|
47901
47987
|
return typeof item === 'object' && item !== null && 'description' in item;
|
|
47902
47988
|
};
|
|
@@ -47942,7 +48028,7 @@ InternalContextualHero.displayName = 'InternalContextualHero';
|
|
|
47942
48028
|
|
|
47943
48029
|
var ListSettings = e.forwardRef(function (_a, ref) {
|
|
47944
48030
|
var _b;
|
|
47945
|
-
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, icon = _a.icon, _h = _a.actionType, actionType = _h === void 0 ? 'button' : _h, _j = _a.buttonLabel, buttonLabel = _j === void 0 ? 'Label' : _j, _k = _a.buttonSize, buttonSize = _k === void 0 ? 'sm' : _k, _l = _a.buttonVariant, buttonVariant = _l === void 0 ? 'primary' : _l, _m = _a.toggleChecked, toggleChecked = _m === void 0 ? false : _m, onButtonClick = _a.onButtonClick, onToggleChange = _a.onToggleChange, _o = _a.showDivider, showDivider = _o === void 0 ? false : _o, className = _a.className, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "actionType", "buttonLabel", "buttonSize", "buttonVariant", "toggleChecked", "onButtonClick", "onToggleChange", "showDivider", "className"]);
|
|
48031
|
+
var title = _a.title, description = _a.description, strikethroughDescription = _a.strikethroughDescription, caption = _a.caption, _c = _a.inverted, inverted = _c === void 0 ? false : _c, _d = _a.type, type = _d === void 0 ? 'card' : _d, _e = _a.status, status = _e === void 0 ? 'default' : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, icon = _a.icon, _h = _a.actionType, actionType = _h === void 0 ? 'button' : _h, _j = _a.buttonLabel, buttonLabel = _j === void 0 ? 'Label' : _j, _k = _a.buttonSize, buttonSize = _k === void 0 ? 'sm' : _k, _l = _a.buttonVariant, buttonVariant = _l === void 0 ? 'primary' : _l, _m = _a.toggleChecked, toggleChecked = _m === void 0 ? false : _m, onButtonClick = _a.onButtonClick, onToggleChange = _a.onToggleChange, _o = _a.showDivider, showDivider = _o === void 0 ? false : _o, highlight = _a.highlight, className = _a.className, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "actionType", "buttonLabel", "buttonSize", "buttonVariant", "toggleChecked", "onButtonClick", "onToggleChange", "showDivider", "highlight", "className"]);
|
|
47946
48032
|
var renderActionElement = function () {
|
|
47947
48033
|
if (actionType === 'button') {
|
|
47948
48034
|
return (e.createElement(Button$1, { variant: buttonVariant, size: buttonSize, onClick: onButtonClick, disabled: disabled }, buttonLabel));
|
|
@@ -47967,11 +48053,10 @@ var ListSettings = e.forwardRef(function (_a, ref) {
|
|
|
47967
48053
|
},
|
|
47968
48054
|
_b["ods-list-settings--".concat(type)] = type,
|
|
47969
48055
|
_b));
|
|
47970
|
-
return (e.createElement(
|
|
47971
|
-
e.createElement("div", __assign$1({ ref: ref, "data-testid": "list-settings", className: containerClassName }, rest), loading ? renderLoadingContent() : renderContent())
|
|
47972
|
-
showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-settings__divider" }))));
|
|
48056
|
+
return (e.createElement(ListContainer, { type: type, showDivider: showDivider, highlight: highlight },
|
|
48057
|
+
e.createElement("div", __assign$1({ ref: ref, "data-testid": "list-settings", className: containerClassName }, rest), loading ? renderLoadingContent() : renderContent())));
|
|
47973
48058
|
});
|
|
47974
48059
|
ListSettings.displayName = 'ListSettings';
|
|
47975
48060
|
|
|
47976
|
-
export { Accordion, Alert, Badge, Breadcrumb, Button$1 as Button, CardGroup, CardListItem, Carousel, DoughnutChart as Chart, Checkbox, Chips, Col, Container, ContextualMenu, ContextualMenuItem, CrossSellCard, DatePickerSingle as DatePicker, DatePickerRange as DateRange, Divider, DoughnutChart, Drawer, index$1 as Grid, IconButton, Input, InternalContextualHero, Link, List, ListAction, ListExpandable, ListReadOnly, ListSelectable, ListSettings, Modal, Progress, Radio, Row$1 as Row, Search, Select, SelectAutocomplete, SettingsListItem, Shortcut, Snackbar, Stepper, Steps, SubHeader, Switch, Tag, TextArea, TextListItem, TokenInput, TopBar, TransactionListItem, Typography, UnorderedListItem, WebNotification };
|
|
48061
|
+
export { Accordion, Alert, Badge, Breadcrumb, Button$1 as Button, CardGroup, CardListItem, Carousel, DoughnutChart as Chart, Checkbox, Chips, Col, Container, ContextualMenu, ContextualMenuItem, CrossSellCard, DatePickerSingle as DatePicker, DatePickerRange as DateRange, Divider, DoughnutChart, Drawer, index$1 as Grid, IconButton, Input, InternalContextualHero, Link, List, ListAction, ListExpandable, ListReadOnly, ListSelectable, ListSettings, Modal, Progress, Radio, Row$1 as Row, Search, Select, SelectAutocomplete, SettingsListItem, Shortcut, Snackbar, Stepper, Steps, SubHeader, Switch, Tag, TextArea, TextListItem, TokenInput, TopBar, TransactionListExpandable, TransactionListItem, Typography, UnorderedListItem, WebNotification };
|
|
47977
48062
|
//# sourceMappingURL=index.es.js.map
|