@thecb/components 5.10.4 → 5.11.1-beta.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 +21 -13
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -13
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/molecules/payment-details/PaymentDetails.js +44 -20
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +3 -2
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,
|
|
@@ -40220,7 +40222,8 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40220
40222
|
align: "center"
|
|
40221
40223
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
40222
40224
|
padding: "0",
|
|
40223
|
-
align: "center"
|
|
40225
|
+
align: "center",
|
|
40226
|
+
extraStyles: "font-size: 14px;"
|
|
40224
40227
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
40225
40228
|
padding: "0"
|
|
40226
40229
|
}, t.voidText), /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
@@ -40229,30 +40232,31 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40229
40232
|
return partialVoidAction(t);
|
|
40230
40233
|
},
|
|
40231
40234
|
text: "Void",
|
|
40232
|
-
|
|
40233
|
-
|
|
40235
|
+
padding: "0",
|
|
40236
|
+
extraStyles: "\n min-width: 65px; \n margin: 0px;\n min-height: 0px;\n ",
|
|
40237
|
+
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;")
|
|
40234
40238
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
40235
40239
|
padding: "0",
|
|
40236
40240
|
key: t.id
|
|
40237
40241
|
}, displayCurrency(t.amount_processed)));
|
|
40238
40242
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
40239
|
-
padding: "
|
|
40243
|
+
padding: "16px 0px"
|
|
40240
40244
|
}, /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40241
|
-
|
|
40245
|
+
extraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;"),
|
|
40242
40246
|
label: "Amount paid",
|
|
40243
40247
|
amount: displayCurrency(voidableAmountPaid)
|
|
40244
40248
|
})), !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, {
|
|
40249
|
+
, subtotal && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
40246
40250
|
padding: "0.5rem 0"
|
|
40247
40251
|
}, /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40248
40252
|
variant: themeValues.labeledAmountSubtotal,
|
|
40249
40253
|
label: "Subtotal",
|
|
40250
40254
|
amount: displayCurrency(subtotal)
|
|
40251
|
-
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40255
|
+
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40252
40256
|
as: "p",
|
|
40253
40257
|
variant: themeValues.labeledAmountTotal,
|
|
40254
40258
|
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
40255
|
-
amount: displayCurrency(total),
|
|
40259
|
+
amount: displayCurrency(typeof remainingBalance === "number" ? remainingBalance : total),
|
|
40256
40260
|
extraStyles: variant === "small" && "font-weight: ".concat(FONT_WEIGHT_BOLD, ";")
|
|
40257
40261
|
}));
|
|
40258
40262
|
};
|
|
@@ -40319,7 +40323,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40319
40323
|
_ref4$partialVoidActi = _ref4.partialVoidAction,
|
|
40320
40324
|
partialVoidAction = _ref4$partialVoidActi === void 0 ? noop : _ref4$partialVoidActi,
|
|
40321
40325
|
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
40322
|
-
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP
|
|
40326
|
+
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP,
|
|
40327
|
+
_ref4$remainingBalanc = _ref4.remainingBalance,
|
|
40328
|
+
remainingBalance = _ref4$remainingBalanc === void 0 ? false : _ref4$remainingBalanc;
|
|
40323
40329
|
|
|
40324
40330
|
var _useState = useState(initiallyOpen),
|
|
40325
40331
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -40379,7 +40385,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40379
40385
|
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40380
40386
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
40381
40387
|
voidableAmountPaid: voidableAmountPaid,
|
|
40382
|
-
partialVoidAction: partialVoidAction
|
|
40388
|
+
partialVoidAction: partialVoidAction,
|
|
40389
|
+
remainingBalance: remainingBalance
|
|
40383
40390
|
})) : /*#__PURE__*/React.createElement(PaymentDetailsContent, {
|
|
40384
40391
|
lineItemElems: lineItemElems,
|
|
40385
40392
|
feeElems: feeElems,
|
|
@@ -40390,7 +40397,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40390
40397
|
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40391
40398
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
40392
40399
|
voidableAmountPaid: voidableAmountPaid,
|
|
40393
|
-
partialVoidAction: partialVoidAction
|
|
40400
|
+
partialVoidAction: partialVoidAction,
|
|
40401
|
+
remainingBalance: remainingBalance
|
|
40394
40402
|
});
|
|
40395
40403
|
var title = hideTitle ? /*#__PURE__*/React.createElement(Fragment, null) : isCollapsible ? /*#__PURE__*/React.createElement(Box, {
|
|
40396
40404
|
width: "100%",
|