@thecb/components 5.10.2 → 5.11.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/dist/index.cjs.js +19 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +19 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/molecules/payment-details/PaymentDetails.js +39 -19
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +3 -2
- package/src/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -40204,7 +40204,8 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40204
40204
|
hasVoidablePaymentsSection = _ref.hasVoidablePaymentsSection,
|
|
40205
40205
|
voidableTransactionDetails = _ref.voidableTransactionDetails,
|
|
40206
40206
|
voidableAmountPaid = _ref.voidableAmountPaid,
|
|
40207
|
-
partialVoidAction = _ref.partialVoidAction
|
|
40207
|
+
partialVoidAction = _ref.partialVoidAction,
|
|
40208
|
+
remainingBalance = _ref.remainingBalance;
|
|
40208
40209
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
40209
40210
|
childGap: "16px"
|
|
40210
40211
|
}, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -40212,7 +40213,8 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40212
40213
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
40213
40214
|
variant: "p",
|
|
40214
40215
|
color: themeValues.text,
|
|
40215
|
-
weight: "400"
|
|
40216
|
+
weight: "400",
|
|
40217
|
+
fontSize: "0.875rem"
|
|
40216
40218
|
}, "Paid"), voidableTransactionDetails.map(function (t) {
|
|
40217
40219
|
return /*#__PURE__*/React.createElement(Cluster, {
|
|
40218
40220
|
key: t.id,
|
|
@@ -40229,30 +40231,31 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40229
40231
|
return partialVoidAction(t);
|
|
40230
40232
|
},
|
|
40231
40233
|
text: "Void",
|
|
40232
|
-
|
|
40234
|
+
padding: "0",
|
|
40235
|
+
extraStyles: "\n min-width: 75px; \n margin: 0px;\n min-height: 0px;\n ",
|
|
40233
40236
|
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 16px;")
|
|
40234
40237
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
40235
40238
|
padding: "0",
|
|
40236
40239
|
key: t.id
|
|
40237
|
-
}, displayCurrency(t.
|
|
40240
|
+
}, displayCurrency(t.amount_processed)));
|
|
40238
40241
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
40239
|
-
padding: "
|
|
40242
|
+
padding: "16px 0px"
|
|
40240
40243
|
}, /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40241
|
-
|
|
40244
|
+
extraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, ";"),
|
|
40242
40245
|
label: "Amount paid",
|
|
40243
40246
|
amount: displayCurrency(voidableAmountPaid)
|
|
40244
40247
|
})), !hasVoidablePaymentsSection && !!lineItemElems.length && /*#__PURE__*/React.createElement(SolidDivider$1, null) // avoids duplicate dividers -> case of voidable payment section, that acts as divider
|
|
40245
|
-
, /*#__PURE__*/React.createElement(Box, {
|
|
40248
|
+
, subtotal && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
40246
40249
|
padding: "0.5rem 0"
|
|
40247
40250
|
}, /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40248
40251
|
variant: themeValues.labeledAmountSubtotal,
|
|
40249
40252
|
label: "Subtotal",
|
|
40250
40253
|
amount: displayCurrency(subtotal)
|
|
40251
|
-
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40254
|
+
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40252
40255
|
as: "p",
|
|
40253
40256
|
variant: themeValues.labeledAmountTotal,
|
|
40254
40257
|
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
40255
|
-
amount: displayCurrency(total),
|
|
40258
|
+
amount: displayCurrency(typeof remainingBalance === "number" ? remainingBalance : total),
|
|
40256
40259
|
extraStyles: variant === "small" && "font-weight: ".concat(FONT_WEIGHT_BOLD, ";")
|
|
40257
40260
|
}));
|
|
40258
40261
|
};
|
|
@@ -40319,7 +40322,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40319
40322
|
_ref4$partialVoidActi = _ref4.partialVoidAction,
|
|
40320
40323
|
partialVoidAction = _ref4$partialVoidActi === void 0 ? noop : _ref4$partialVoidActi,
|
|
40321
40324
|
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
40322
|
-
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP
|
|
40325
|
+
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP,
|
|
40326
|
+
_ref4$remainingBalanc = _ref4.remainingBalance,
|
|
40327
|
+
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc;
|
|
40323
40328
|
|
|
40324
40329
|
var _useState = useState(initiallyOpen),
|
|
40325
40330
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -40379,7 +40384,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40379
40384
|
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40380
40385
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
40381
40386
|
voidableAmountPaid: voidableAmountPaid,
|
|
40382
|
-
partialVoidAction: partialVoidAction
|
|
40387
|
+
partialVoidAction: partialVoidAction,
|
|
40388
|
+
remainingBalance: remainingBalance
|
|
40383
40389
|
})) : /*#__PURE__*/React.createElement(PaymentDetailsContent, {
|
|
40384
40390
|
lineItemElems: lineItemElems,
|
|
40385
40391
|
feeElems: feeElems,
|
|
@@ -40390,7 +40396,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40390
40396
|
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40391
40397
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
40392
40398
|
voidableAmountPaid: voidableAmountPaid,
|
|
40393
|
-
partialVoidAction: partialVoidAction
|
|
40399
|
+
partialVoidAction: partialVoidAction,
|
|
40400
|
+
remainingBalance: remainingBalance
|
|
40394
40401
|
});
|
|
40395
40402
|
var title = hideTitle ? /*#__PURE__*/React.createElement(Fragment, null) : isCollapsible ? /*#__PURE__*/React.createElement(Box, {
|
|
40396
40403
|
width: "100%",
|