@thecb/components 9.3.3 → 9.3.5-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 +82 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +82 -50
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/labeled-amount/LabeledAmount.js +7 -32
- package/src/components/atoms/labeled-amount/LabeledAmount.stories.js +13 -0
- package/src/components/atoms/labeled-amount/LabeledAmount.theme.js +5 -1
- package/src/components/atoms/labeled-amount/LabeledAmountV1.js +37 -0
- package/src/components/atoms/labeled-amount/LabeledAmountV2.js +25 -0
- package/src/components/atoms/line-item/LineItem.js +21 -35
- package/src/components/atoms/line-item/LineItem.theme.js +2 -2
- package/src/components/molecules/modal/Modal.js +3 -3
- package/src/components/molecules/payment-details/PaymentDetails.js +14 -13
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +36 -0
- package/src/components/molecules/payment-details/PaymentDetails.theme.js +2 -2
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -26743,13 +26743,17 @@ var fontWeight$4 = {
|
|
|
26743
26743
|
pS: "600",
|
|
26744
26744
|
p: "600",
|
|
26745
26745
|
pL: "600",
|
|
26746
|
-
h6: "700"
|
|
26746
|
+
h6: "700",
|
|
26747
|
+
regular: "600",
|
|
26748
|
+
extraSmall: "600",
|
|
26749
|
+
small: "600",
|
|
26750
|
+
large: "600"
|
|
26747
26751
|
};
|
|
26748
26752
|
var fallbackValues$p = {
|
|
26749
26753
|
fontWeight: fontWeight$4
|
|
26750
26754
|
};
|
|
26751
26755
|
|
|
26752
|
-
var
|
|
26756
|
+
var LabeledAmountV1 = function LabeledAmountV1(_ref) {
|
|
26753
26757
|
var _ref$variant = _ref.variant,
|
|
26754
26758
|
variant = _ref$variant === void 0 ? "pL" : _ref$variant,
|
|
26755
26759
|
label = _ref.label,
|
|
@@ -26773,19 +26777,46 @@ var LabeledAmount = function LabeledAmount(_ref) {
|
|
|
26773
26777
|
}, amount));
|
|
26774
26778
|
};
|
|
26775
26779
|
|
|
26780
|
+
var LabeledAmountV2 = function LabeledAmountV2(_ref) {
|
|
26781
|
+
var _ref$variant = _ref.variant,
|
|
26782
|
+
variant = _ref$variant === void 0 ? "regular" : _ref$variant,
|
|
26783
|
+
label = _ref.label,
|
|
26784
|
+
amount = _ref.amount,
|
|
26785
|
+
themeValues = _ref.themeValues,
|
|
26786
|
+
as = _ref.as,
|
|
26787
|
+
extraStyles = _ref.extraStyles;
|
|
26788
|
+
return /*#__PURE__*/React.createElement(Detail$1, {
|
|
26789
|
+
variant: variant,
|
|
26790
|
+
as: as,
|
|
26791
|
+
weight: themeValues.fontWeight,
|
|
26792
|
+
extraStyles: "display: flex; justify-content: space-between; ".concat(extraStyles)
|
|
26793
|
+
}, /*#__PURE__*/React.createElement("span", null, label), /*#__PURE__*/React.createElement("span", null, amount));
|
|
26794
|
+
};
|
|
26795
|
+
|
|
26796
|
+
var _excluded$u = ["version"];
|
|
26797
|
+
|
|
26798
|
+
var LabeledAmount = function LabeledAmount(_ref) {
|
|
26799
|
+
var _ref$version = _ref.version,
|
|
26800
|
+
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
26801
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
26802
|
+
|
|
26803
|
+
var LabeledAmountComponent = version === "v1" ? LabeledAmountV1 : LabeledAmountV2;
|
|
26804
|
+
return /*#__PURE__*/React.createElement(LabeledAmountComponent, rest);
|
|
26805
|
+
};
|
|
26806
|
+
|
|
26776
26807
|
var LabeledAmount$1 = themeComponent(LabeledAmount, "LabeledAmount", fallbackValues$p, "default");
|
|
26777
26808
|
|
|
26778
26809
|
var weightTitle = {
|
|
26779
26810
|
"default": "600",
|
|
26780
26811
|
small: "400"
|
|
26781
26812
|
};
|
|
26782
|
-
var
|
|
26783
|
-
"default": "
|
|
26784
|
-
small: "
|
|
26813
|
+
var detailVariant = {
|
|
26814
|
+
"default": "large",
|
|
26815
|
+
small: "small"
|
|
26785
26816
|
};
|
|
26786
26817
|
var fallbackValues$q = {
|
|
26787
26818
|
weightTitle: weightTitle,
|
|
26788
|
-
|
|
26819
|
+
detailVariant: detailVariant
|
|
26789
26820
|
};
|
|
26790
26821
|
|
|
26791
26822
|
var LineItem = function LineItem(_ref) {
|
|
@@ -26812,35 +26843,27 @@ var LineItem = function LineItem(_ref) {
|
|
|
26812
26843
|
var visibleCustomAttrs = customAttributes === null || customAttributes === void 0 ? void 0 : (_customAttributes$fil = customAttributes.filter(function (attr) {
|
|
26813
26844
|
return (visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.includes(attr.key)) && attr.key !== "description";
|
|
26814
26845
|
})) === null || _customAttributes$fil === void 0 ? void 0 : _customAttributes$fil.map(function (attr) {
|
|
26815
|
-
return /*#__PURE__*/React.createElement(
|
|
26816
|
-
variant: "
|
|
26846
|
+
return /*#__PURE__*/React.createElement(Detail$1, {
|
|
26847
|
+
variant: "small",
|
|
26817
26848
|
weight: "400",
|
|
26818
26849
|
key: attr.key,
|
|
26819
26850
|
color: STORM_GREY
|
|
26820
26851
|
}, "".concat(formatAttrKeys(attr.key), ": ").concat(attr.value));
|
|
26821
26852
|
});
|
|
26822
|
-
return /*#__PURE__*/React.createElement(
|
|
26823
|
-
nowrap: true,
|
|
26824
|
-
justify: "space-between",
|
|
26825
|
-
align: "start"
|
|
26826
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
26853
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
26827
26854
|
childGap: "0px"
|
|
26828
|
-
}, /*#__PURE__*/React.createElement(
|
|
26829
|
-
|
|
26830
|
-
|
|
26831
|
-
|
|
26832
|
-
|
|
26855
|
+
}, /*#__PURE__*/React.createElement(Detail$1, {
|
|
26856
|
+
as: "h3",
|
|
26857
|
+
variant: themeValues.detailVariant,
|
|
26858
|
+
weight: themeValues.weightTitle,
|
|
26859
|
+
extraStyles: "display: flex; justify-content: space-between;"
|
|
26860
|
+
}, /*#__PURE__*/React.createElement("span", null, description), /*#__PURE__*/React.createElement("span", null, !!displayQuantity && "x".concat(displayQuantity)), /*#__PURE__*/React.createElement("span", null, amount)), /*#__PURE__*/React.createElement(Detail$1, {
|
|
26861
|
+
as: "p",
|
|
26862
|
+
variant: themeValues.detailVariant,
|
|
26833
26863
|
weight: "400"
|
|
26834
26864
|
}, subDescription), visibleCustomAttrs && /*#__PURE__*/React.createElement(Stack, {
|
|
26835
26865
|
childGap: "0.25rem"
|
|
26836
|
-
}, visibleCustomAttrs))
|
|
26837
|
-
variant: themeValues.paragraphVariant,
|
|
26838
|
-
weight: themeValues.weightTitle
|
|
26839
|
-
}, "x".concat(displayQuantity)), /*#__PURE__*/React.createElement(Paragraph$1, {
|
|
26840
|
-
variant: themeValues.paragraphVariant,
|
|
26841
|
-
weight: "600",
|
|
26842
|
-
extraStyles: "margin: 0; text-align: end; min-width: fit-content; padding-left: 32px;"
|
|
26843
|
-
}, amount));
|
|
26866
|
+
}, visibleCustomAttrs));
|
|
26844
26867
|
};
|
|
26845
26868
|
|
|
26846
26869
|
var LineItem$1 = themeComponent(LineItem, "LineItem", fallbackValues$q, "default");
|
|
@@ -26918,7 +26941,7 @@ var Loading = function Loading() {
|
|
|
26918
26941
|
})))));
|
|
26919
26942
|
};
|
|
26920
26943
|
|
|
26921
|
-
var _excluded$
|
|
26944
|
+
var _excluded$v = ["leftContent", "rightContent", "footerMinHeight", "backgroundColor", "largeSide", "largeSideSize", "footerPadding", "isMobile", "footerWidth"];
|
|
26922
26945
|
|
|
26923
26946
|
var NavFooter = function NavFooter(_ref) {
|
|
26924
26947
|
var leftContent = _ref.leftContent,
|
|
@@ -26934,7 +26957,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26934
26957
|
footerPadding = _ref$footerPadding === void 0 ? "1.5rem 1rem" : _ref$footerPadding,
|
|
26935
26958
|
isMobile = _ref.isMobile,
|
|
26936
26959
|
footerWidth = _ref.footerWidth,
|
|
26937
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
26960
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
26938
26961
|
|
|
26939
26962
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
26940
26963
|
padding: footerPadding,
|
|
@@ -26966,7 +26989,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26966
26989
|
}, rightContent)))))));
|
|
26967
26990
|
};
|
|
26968
26991
|
|
|
26969
|
-
var _excluded$
|
|
26992
|
+
var _excluded$w = ["leftContent", "rightContent", "headerHeight", "isMobile", "backgroundColor", "headerWidth"];
|
|
26970
26993
|
|
|
26971
26994
|
var NavHeader = function NavHeader(_ref) {
|
|
26972
26995
|
var leftContent = _ref.leftContent,
|
|
@@ -26976,7 +26999,7 @@ var NavHeader = function NavHeader(_ref) {
|
|
|
26976
26999
|
isMobile = _ref.isMobile,
|
|
26977
27000
|
backgroundColor = _ref.backgroundColor,
|
|
26978
27001
|
headerWidth = _ref.headerWidth,
|
|
26979
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
27002
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
26980
27003
|
|
|
26981
27004
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
26982
27005
|
padding: "0 16px 4px",
|
|
@@ -38771,7 +38794,7 @@ var TableRowWrapper = styled.tr.withConfig({
|
|
|
38771
38794
|
return extraStyles;
|
|
38772
38795
|
});
|
|
38773
38796
|
|
|
38774
|
-
var _excluded$
|
|
38797
|
+
var _excluded$x = ["children", "extraStyles", "hoverCursor", "hoverEffect", "onClick", "themeValues"];
|
|
38775
38798
|
|
|
38776
38799
|
var TableRow = function TableRow(_ref) {
|
|
38777
38800
|
var children = _ref.children,
|
|
@@ -38781,7 +38804,7 @@ var TableRow = function TableRow(_ref) {
|
|
|
38781
38804
|
hoverEffect = _ref$hoverEffect === void 0 ? true : _ref$hoverEffect,
|
|
38782
38805
|
onClick = _ref.onClick,
|
|
38783
38806
|
themeValues = _ref.themeValues,
|
|
38784
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
38807
|
+
props = _objectWithoutProperties(_ref, _excluded$x);
|
|
38785
38808
|
|
|
38786
38809
|
return /*#__PURE__*/React.createElement(TableRowWrapper, _extends({
|
|
38787
38810
|
onClick: onClick,
|
|
@@ -45854,9 +45877,10 @@ var Modal$1 = function Modal(_ref) {
|
|
|
45854
45877
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
45855
45878
|
justify: "flex-start",
|
|
45856
45879
|
align: "center"
|
|
45857
|
-
}, /*#__PURE__*/React.createElement(
|
|
45858
|
-
|
|
45859
|
-
weight: FONT_WEIGHT_SEMIBOLD
|
|
45880
|
+
}, /*#__PURE__*/React.createElement(Title$1, {
|
|
45881
|
+
as: "h2",
|
|
45882
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
45883
|
+
fontSize: "1.25rem"
|
|
45860
45884
|
}, modalHeaderText))), /*#__PURE__*/React.createElement(Box, {
|
|
45861
45885
|
background: modalBodyBg,
|
|
45862
45886
|
padding: "1.5rem"
|
|
@@ -47348,12 +47372,12 @@ var lineItem = {
|
|
|
47348
47372
|
small: "small"
|
|
47349
47373
|
};
|
|
47350
47374
|
var labeledAmountSubtotal = {
|
|
47351
|
-
"default": "
|
|
47352
|
-
small: "
|
|
47375
|
+
"default": "large",
|
|
47376
|
+
small: "small"
|
|
47353
47377
|
};
|
|
47354
47378
|
var labeledAmountTotal = {
|
|
47355
|
-
"default": "
|
|
47356
|
-
small: "
|
|
47379
|
+
"default": "large",
|
|
47380
|
+
small: "small"
|
|
47357
47381
|
};
|
|
47358
47382
|
var fallbackValues$N = {
|
|
47359
47383
|
backgroundColor: backgroundColor$c,
|
|
@@ -47362,7 +47386,7 @@ var fallbackValues$N = {
|
|
|
47362
47386
|
labeledAmountTotal: labeledAmountTotal
|
|
47363
47387
|
};
|
|
47364
47388
|
|
|
47365
|
-
var _excluded$
|
|
47389
|
+
var _excluded$y = ["amount"],
|
|
47366
47390
|
_excluded2$1 = ["amount"];
|
|
47367
47391
|
|
|
47368
47392
|
var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
@@ -47413,6 +47437,9 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47413
47437
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
47414
47438
|
padding: "16px 0px"
|
|
47415
47439
|
}, /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47440
|
+
version: "v2",
|
|
47441
|
+
as: "h3",
|
|
47442
|
+
variant: "small",
|
|
47416
47443
|
extraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;"),
|
|
47417
47444
|
label: "Amount paid",
|
|
47418
47445
|
amount: displayCurrency(voidableAmountPaid)
|
|
@@ -47420,15 +47447,18 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47420
47447
|
, subtotal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
47421
47448
|
padding: "0.5rem 0"
|
|
47422
47449
|
}, /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47450
|
+
version: "v2",
|
|
47423
47451
|
variant: themeValues.labeledAmountSubtotal,
|
|
47424
47452
|
label: "Subtotal",
|
|
47425
|
-
amount: displayCurrency(subtotal)
|
|
47453
|
+
amount: displayCurrency(subtotal),
|
|
47454
|
+
as: "h3"
|
|
47426
47455
|
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null)) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47427
|
-
|
|
47456
|
+
version: "v2",
|
|
47457
|
+
as: "h3",
|
|
47428
47458
|
variant: themeValues.labeledAmountTotal,
|
|
47429
47459
|
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
47430
47460
|
amount: displayCurrency(typeof remainingBalance === "number" ? remainingBalance : total),
|
|
47431
|
-
extraStyles:
|
|
47461
|
+
extraStyles: "margin-top: 1rem;"
|
|
47432
47462
|
}));
|
|
47433
47463
|
};
|
|
47434
47464
|
|
|
@@ -47607,7 +47637,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47607
47637
|
return fee.amount > 0;
|
|
47608
47638
|
}).map(function (_ref5) {
|
|
47609
47639
|
var amount = _ref5.amount,
|
|
47610
|
-
rest = _objectWithoutProperties(_ref5, _excluded$
|
|
47640
|
+
rest = _objectWithoutProperties(_ref5, _excluded$y);
|
|
47611
47641
|
|
|
47612
47642
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
47613
47643
|
amount: displayCurrency(amount)
|
|
@@ -47636,6 +47666,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47636
47666
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
47637
47667
|
padding: "4px 0"
|
|
47638
47668
|
}), /*#__PURE__*/React.createElement(LabeledAmount$1, _extends({
|
|
47669
|
+
version: "v2",
|
|
47670
|
+
as: "h3",
|
|
47639
47671
|
key: fee.label,
|
|
47640
47672
|
variant: themeValues.labeledAmountSubtotal
|
|
47641
47673
|
}, fee)));
|
|
@@ -47679,7 +47711,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47679
47711
|
align: "center"
|
|
47680
47712
|
}, /*#__PURE__*/React.createElement(Title$1, {
|
|
47681
47713
|
weight: FONT_WEIGHT_BOLD,
|
|
47682
|
-
as: "
|
|
47714
|
+
as: "h2",
|
|
47683
47715
|
extraStyles: "font-size: 1.375rem;",
|
|
47684
47716
|
id: "payment-details-title"
|
|
47685
47717
|
}, titleText), /*#__PURE__*/React.createElement(Title$1, {
|
|
@@ -47687,7 +47719,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47687
47719
|
as: "p",
|
|
47688
47720
|
extraStyles: "font-size: 1.375rem;"
|
|
47689
47721
|
}, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Title$1, {
|
|
47690
|
-
as: "
|
|
47722
|
+
as: "h2",
|
|
47691
47723
|
weight: FONT_WEIGHT_BOLD,
|
|
47692
47724
|
margin: "1rem 0 0 0",
|
|
47693
47725
|
extraStyles: "font-size: 1.75rem;",
|
|
@@ -48029,12 +48061,12 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48029
48061
|
}, errorMessage))))));
|
|
48030
48062
|
};
|
|
48031
48063
|
|
|
48032
|
-
var _excluded$
|
|
48064
|
+
var _excluded$z = ["version"];
|
|
48033
48065
|
|
|
48034
48066
|
var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
48035
48067
|
var _ref$version = _ref.version,
|
|
48036
48068
|
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
48037
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48069
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
48038
48070
|
|
|
48039
48071
|
var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
|
|
48040
48072
|
return /*#__PURE__*/React.createElement(TermsAndConditionsControl, rest);
|
|
@@ -48713,7 +48745,7 @@ var fallbackValues$Q = {
|
|
|
48713
48745
|
focusStyles: focusStyles
|
|
48714
48746
|
};
|
|
48715
48747
|
|
|
48716
|
-
var _excluded$
|
|
48748
|
+
var _excluded$A = ["themeValues", "isMobile", "supportsTouch", "sections", "openSection", "toggleOpenSection", "staggeredAnimation", "initiallyOpen", "openHeight", "containerStyles", "ariaDescribedBy", "isSectionRequired"];
|
|
48717
48749
|
/*
|
|
48718
48750
|
Takes an array of section objects, each object should look like:
|
|
48719
48751
|
{
|
|
@@ -48761,7 +48793,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48761
48793
|
ariaDescribedBy = _ref.ariaDescribedBy,
|
|
48762
48794
|
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
48763
48795
|
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
|
|
48764
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48796
|
+
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
48765
48797
|
|
|
48766
48798
|
var _useState = useState(null),
|
|
48767
48799
|
_useState2 = _slicedToArray(_useState, 2),
|