@useblu/ocean-react 1.132.0 → 1.133.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/index.js CHANGED
@@ -47787,9 +47787,26 @@ var InternalListActions = e.forwardRef(function (_a, forwardedRef) {
47787
47787
  });
47788
47788
  InternalListActions.displayName = 'InternalListActions';
47789
47789
 
47790
+ var AmountDetails = function (_a) {
47791
+ 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;
47792
+ var isNegative = type === 'negative';
47793
+ var isPositive = type === 'positive';
47794
+ return (e.createElement("div", { className: "ods-amount-details" },
47795
+ e.createElement("div", { className: "ods-amount-details__main" },
47796
+ isNegative ? (e.createElement("div", { className: "ods-amount-details__amount-row" },
47797
+ e.createElement("span", { className: "ods-amount-details__amount-sign" }, "- "),
47798
+ e.createElement("p", { className: "ods-amount-details__amount" }, amount))) : (e.createElement("p", { className: classNames('ods-amount-details__amount', {
47799
+ 'ods-amount-details__amount--positive': isPositive,
47800
+ }) }, amount)),
47801
+ showIndicator && indicator && (e.createElement("div", { className: classNames('ods-amount-details__indicator', {
47802
+ 'ods-amount-details__indicator--medium': indicatorSize === 'medium',
47803
+ }) }, indicator))),
47804
+ showAdditionalData && additionalData && (e.createElement(Typography, { variant: "captionbold", className: "ods-amount-details__caption" }, additionalData))));
47805
+ };
47806
+
47790
47807
  var ListAction = e.forwardRef(function (_a, ref) {
47791
47808
  var _b;
47792
- 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"]);
47809
+ 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, rest = __rest$1(_a, ["title", "description", "strikethroughDescription", "caption", "inverted", "type", "status", "disabled", "loading", "icon", "indicator", "actionType", "menuActions", "menuPosition", "onClick", "className", "showDivider", "amountDetails", "position"]);
47793
47810
  var _l = e.useState(false), isSwipeOpen = _l[0], setIsSwipeOpen = _l[1];
47794
47811
  var _m = e.useState(0), menuWidth = _m[0], setMenuWidth = _m[1];
47795
47812
  var handleSwipeOpenChange = function (isOpen, width) {
@@ -47800,7 +47817,7 @@ var ListAction = e.forwardRef(function (_a, ref) {
47800
47817
  };
47801
47818
  var renderActionIcon = function () {
47802
47819
  if (actionType === 'chevron') {
47803
- return (e.createElement("div", { className: 'ods-list-action__action' },
47820
+ return (e.createElement("div", { className: "ods-list-action__action" },
47804
47821
  e.createElement(re, { size: 20 })));
47805
47822
  }
47806
47823
  if (actionType === 'menu' || actionType === 'swipe') {
@@ -47808,19 +47825,32 @@ var ListAction = e.forwardRef(function (_a, ref) {
47808
47825
  }
47809
47826
  return null;
47810
47827
  };
47811
- var renderLoadingContent = function () { return (e.createElement("div", { className: 'ods-list-action__skeleton' },
47812
- e.createElement(SkeletonBar, { width: '40%', height: '16px' }),
47813
- e.createElement(SkeletonBar, { width: '100%', height: '16px' }))); };
47828
+ var renderLoadingContent = function () { return (e.createElement("div", { className: "ods-list-action__skeleton" },
47829
+ e.createElement(SkeletonBar, { width: "40%", height: "16px" }),
47830
+ e.createElement(SkeletonBar, { width: "100%", height: "16px" }))); };
47814
47831
  var contentStyle = isSwipeOpen && menuWidth > 0
47815
47832
  ? { transform: "translateX(-".concat(menuWidth, "px)") }
47816
47833
  : {};
47834
+ var showLeading = position && icon;
47835
+ var showLineAbove = position === 'middle' || position === 'last';
47836
+ var showLineBelow = position === 'first' || position === 'middle';
47817
47837
  var renderContent = function () { return (e.createElement(e.Fragment, null,
47818
- e.createElement("div", { className: 'ods-list-action__content', style: contentStyle },
47819
- icon && (e.createElement("div", { className: classNames('ods-list-action__icon', {
47838
+ e.createElement("div", { className: "ods-list-action__content", style: contentStyle },
47839
+ showLeading ? (e.createElement("div", { className: "ods-list-action__position" },
47840
+ e.createElement("div", { className: classNames('ods-list-action__position-line', {
47841
+ 'ods-list-action__position-line--visible': showLineAbove,
47842
+ }) }),
47843
+ e.createElement("div", { className: classNames('ods-list-action__icon', {
47844
+ 'ods-list-action__icon--inactive': status === 'inactive',
47845
+ }) }, icon),
47846
+ e.createElement("div", { className: classNames('ods-list-action__position-line', {
47847
+ 'ods-list-action__position-line--visible': showLineBelow,
47848
+ }) }))) : (icon && (e.createElement("div", { className: classNames('ods-list-action__icon', {
47820
47849
  'ods-list-action__icon--inactive': status === 'inactive',
47821
- }) }, icon)),
47850
+ }) }, icon))),
47822
47851
  e.createElement(ContentList, { title: title, description: description, strikethroughDescription: strikethroughDescription, caption: caption, inverted: inverted, type: status }),
47823
- indicator && (e.createElement("div", { className: 'ods-list-action__indicator' }, indicator))),
47852
+ amountDetails && e.createElement(AmountDetails, __assign$1({ type: status }, amountDetails)),
47853
+ indicator && (e.createElement("div", { className: "ods-list-action__indicator" }, indicator))),
47824
47854
  renderActionIcon())); };
47825
47855
  var buttonClassName = classNames('ods-list-action', className, (_b = {
47826
47856
  'ods-list-action--loading': loading,
@@ -47830,9 +47860,9 @@ var ListAction = e.forwardRef(function (_a, ref) {
47830
47860
  },
47831
47861
  _b["ods-list-action--".concat(type)] = type,
47832
47862
  _b));
47833
- return (e.createElement("div", { className: 'ods-list-action__container' },
47834
- 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()),
47835
- showDivider && type === 'text' && (e.createElement("div", { className: 'ods-list-action__divider' }))));
47863
+ return (e.createElement("div", { className: "ods-list-action__container" },
47864
+ 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()),
47865
+ showDivider && type === 'text' && (e.createElement("div", { className: "ods-list-action__divider" }))));
47836
47866
  });
47837
47867
  ListAction.displayName = 'ListAction';
47838
47868
 
@@ -47899,6 +47929,48 @@ var ListExpandable = e.forwardRef(function (_a, ref) {
47899
47929
  });
47900
47930
  ListExpandable.displayName = 'ListExpandable';
47901
47931
 
47932
+ var TransactionListExpandable = e.forwardRef(function (_a, ref) {
47933
+ var _b;
47934
+ 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"]);
47935
+ var handleToggle = function () {
47936
+ onToggle === null || onToggle === void 0 ? void 0 : onToggle(!expanded);
47937
+ };
47938
+ var renderLoadingContent = function () { return (e.createElement(e.Fragment, null,
47939
+ e.createElement("div", { className: "ods-list-expandable__icon", "aria-hidden": true },
47940
+ e.createElement(SkeletonBar, { width: "24px", height: "24px" })),
47941
+ e.createElement("div", { className: "ods-list-expandable__skeleton ods-list-expandable__transaction-content" },
47942
+ e.createElement("div", { className: "ods-list-expandable__skeleton-list" },
47943
+ e.createElement(SkeletonBar, { width: "33%", height: "16px" }),
47944
+ e.createElement(SkeletonBar, { width: "100%", height: "16px" })),
47945
+ e.createElement("div", { className: "ods-list-expandable__skeleton-amount" },
47946
+ e.createElement(SkeletonBar, { width: "100%", height: "16px" }),
47947
+ e.createElement(SkeletonBar, { width: "100%", height: "16px" }))))); };
47948
+ var renderContent = function () { return (e.createElement(e.Fragment, null,
47949
+ icon && (e.createElement("div", { className: classNames('ods-list-expandable__icon', {
47950
+ 'ods-list-expandable__icon--inactive': status === 'inactive',
47951
+ }) }, icon)),
47952
+ e.createElement("div", { className: "ods-list-expandable__transaction-content" },
47953
+ e.createElement(ContentList, { title: title, description: description, caption: caption, inverted: inverted, type: status }),
47954
+ e.createElement(AmountDetails, { amount: amount, type: amountType, indicator: amountIndicator, indicatorSize: "medium", showIndicator: showAmountIndicator, additionalData: additionalData, showAdditionalData: Boolean(additionalData) })),
47955
+ e.createElement("div", { className: "ods-list-expandable__trailing" },
47956
+ e.createElement("div", { className: "ods-list-expandable__action" }, expanded ? e.createElement(ae, { size: 20 }) : e.createElement(ee, { size: 20 }))))); };
47957
+ var containerClassName = classNames('ods-list-expandable', 'ods-list-expandable--transaction', className, (_b = {
47958
+ 'ods-list-expandable--expanded': expanded,
47959
+ 'ods-list-expandable--disabled': disabled,
47960
+ 'ods-list-expandable--loading': loading
47961
+ },
47962
+ _b["ods-list-expandable--".concat(type)] = type,
47963
+ _b));
47964
+ return (e.createElement("div", __assign$1({ ref: ref, "data-testid": "transaction-list-expandable", className: containerClassName }, rest),
47965
+ 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()),
47966
+ showDivider && !expanded && (e.createElement("div", { className: "ods-list-expandable__divider", "data-testid": "transaction-list-expandable-divider" })),
47967
+ expanded && !loading && (children || supportingText) && (e.createElement(e.Fragment, null,
47968
+ children && (e.createElement("div", { className: "ods-list-expandable__content ods-list-expandable__content--transaction" }, children)),
47969
+ supportingText && (e.createElement("div", { className: "ods-list-expandable__footer", "data-testid": "transaction-list-expandable-supporting-text" }, supportingText)),
47970
+ showDivider && (e.createElement("div", { className: "ods-list-expandable__divider", "data-testid": "transaction-list-expandable-divider" }))))));
47971
+ });
47972
+ TransactionListExpandable.displayName = 'TransactionListExpandable';
47973
+
47902
47974
  var isListItemString = function (item) {
47903
47975
  return typeof item === 'object' && item !== null && 'description' in item;
47904
47976
  };
@@ -48026,6 +48098,7 @@ exports.TextArea = TextArea;
48026
48098
  exports.TextListItem = TextListItem;
48027
48099
  exports.TokenInput = TokenInput;
48028
48100
  exports.TopBar = TopBar;
48101
+ exports.TransactionListExpandable = TransactionListExpandable;
48029
48102
  exports.TransactionListItem = TransactionListItem;
48030
48103
  exports.Typography = Typography;
48031
48104
  exports.UnorderedListItem = UnorderedListItem;