@thecb/components 5.9.4-beta.0 → 5.10.4
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 +61 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +61 -6
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/molecules/payment-details/PaymentDetails.js +80 -7
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +93 -3
- package/src/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -40200,10 +40200,49 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40200
40200
|
subtotal = _ref.subtotal,
|
|
40201
40201
|
total = _ref.total,
|
|
40202
40202
|
variant = _ref.variant,
|
|
40203
|
-
themeValues = _ref.themeValues
|
|
40203
|
+
themeValues = _ref.themeValues,
|
|
40204
|
+
hasVoidablePaymentsSection = _ref.hasVoidablePaymentsSection,
|
|
40205
|
+
voidableTransactionDetails = _ref.voidableTransactionDetails,
|
|
40206
|
+
voidableAmountPaid = _ref.voidableAmountPaid,
|
|
40207
|
+
partialVoidAction = _ref.partialVoidAction;
|
|
40204
40208
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
40205
40209
|
childGap: "16px"
|
|
40206
|
-
}, lineItemElems,
|
|
40210
|
+
}, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React.createElement(Box, {
|
|
40211
|
+
background: ATHENS_GREY
|
|
40212
|
+
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
40213
|
+
variant: "p",
|
|
40214
|
+
color: themeValues.text,
|
|
40215
|
+
weight: "400"
|
|
40216
|
+
}, "Paid"), voidableTransactionDetails.map(function (t) {
|
|
40217
|
+
return /*#__PURE__*/React.createElement(Cluster, {
|
|
40218
|
+
key: t.id,
|
|
40219
|
+
justify: "space-between",
|
|
40220
|
+
align: "center"
|
|
40221
|
+
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
40222
|
+
padding: "0",
|
|
40223
|
+
align: "center"
|
|
40224
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
40225
|
+
padding: "0"
|
|
40226
|
+
}, t.voidText), /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
40227
|
+
variant: "ghost",
|
|
40228
|
+
action: function action() {
|
|
40229
|
+
return partialVoidAction(t);
|
|
40230
|
+
},
|
|
40231
|
+
text: "Void",
|
|
40232
|
+
extraStyles: "min-width: 75px; margin: 0px;",
|
|
40233
|
+
textExtraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 16px;")
|
|
40234
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
40235
|
+
padding: "0",
|
|
40236
|
+
key: t.id
|
|
40237
|
+
}, displayCurrency(t.amount_processed)));
|
|
40238
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
40239
|
+
padding: "8px 0px 16px 0px"
|
|
40240
|
+
}, /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40241
|
+
fontWeight: FONT_WEIGHT_REGULAR,
|
|
40242
|
+
label: "Amount paid",
|
|
40243
|
+
amount: displayCurrency(voidableAmountPaid)
|
|
40244
|
+
})), !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, {
|
|
40207
40246
|
padding: "0.5rem 0"
|
|
40208
40247
|
}, /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40209
40248
|
variant: themeValues.labeledAmountSubtotal,
|
|
@@ -40212,7 +40251,7 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
40212
40251
|
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
40213
40252
|
as: "p",
|
|
40214
40253
|
variant: themeValues.labeledAmountTotal,
|
|
40215
|
-
label: "Total",
|
|
40254
|
+
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
40216
40255
|
amount: displayCurrency(total),
|
|
40217
40256
|
extraStyles: variant === "small" && "font-weight: ".concat(FONT_WEIGHT_BOLD, ";")
|
|
40218
40257
|
}));
|
|
@@ -40272,7 +40311,15 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40272
40311
|
collapsibleOnMobile = _ref4$collapsibleOnMo === void 0 ? true : _ref4$collapsibleOnMo,
|
|
40273
40312
|
isMobile = _ref4.isMobile,
|
|
40274
40313
|
supportsTouch = _ref4.supportsTouch,
|
|
40275
|
-
themeValues = _ref4.themeValues
|
|
40314
|
+
themeValues = _ref4.themeValues,
|
|
40315
|
+
_ref4$hasVoidablePaym = _ref4.hasVoidablePaymentsSection,
|
|
40316
|
+
hasVoidablePaymentsSection = _ref4$hasVoidablePaym === void 0 ? false : _ref4$hasVoidablePaym,
|
|
40317
|
+
_ref4$voidableTransac = _ref4.voidableTransactionDetails,
|
|
40318
|
+
voidableTransactionDetails = _ref4$voidableTransac === void 0 ? [] : _ref4$voidableTransac,
|
|
40319
|
+
_ref4$partialVoidActi = _ref4.partialVoidAction,
|
|
40320
|
+
partialVoidAction = _ref4$partialVoidActi === void 0 ? noop : _ref4$partialVoidActi,
|
|
40321
|
+
_ref4$voidableAmountP = _ref4.voidableAmountPaid,
|
|
40322
|
+
voidableAmountPaid = _ref4$voidableAmountP === void 0 ? 0 : _ref4$voidableAmountP;
|
|
40276
40323
|
|
|
40277
40324
|
var _useState = useState(initiallyOpen),
|
|
40278
40325
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -40328,14 +40375,22 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
40328
40375
|
subtotal: subtotal,
|
|
40329
40376
|
total: total,
|
|
40330
40377
|
themeValues: themeValues,
|
|
40331
|
-
variant: variant
|
|
40378
|
+
variant: variant,
|
|
40379
|
+
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40380
|
+
voidableTransactionDetails: voidableTransactionDetails,
|
|
40381
|
+
voidableAmountPaid: voidableAmountPaid,
|
|
40382
|
+
partialVoidAction: partialVoidAction
|
|
40332
40383
|
})) : /*#__PURE__*/React.createElement(PaymentDetailsContent, {
|
|
40333
40384
|
lineItemElems: lineItemElems,
|
|
40334
40385
|
feeElems: feeElems,
|
|
40335
40386
|
subtotal: subtotal,
|
|
40336
40387
|
total: total,
|
|
40337
40388
|
themeValues: themeValues,
|
|
40338
|
-
variant: variant
|
|
40389
|
+
variant: variant,
|
|
40390
|
+
hasVoidablePaymentsSection: hasVoidablePaymentsSection,
|
|
40391
|
+
voidableTransactionDetails: voidableTransactionDetails,
|
|
40392
|
+
voidableAmountPaid: voidableAmountPaid,
|
|
40393
|
+
partialVoidAction: partialVoidAction
|
|
40339
40394
|
});
|
|
40340
40395
|
var title = hideTitle ? /*#__PURE__*/React.createElement(Fragment, null) : isCollapsible ? /*#__PURE__*/React.createElement(Box, {
|
|
40341
40396
|
width: "100%",
|