@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.cjs.js
CHANGED
|
@@ -26751,13 +26751,17 @@ var fontWeight$4 = {
|
|
|
26751
26751
|
pS: "600",
|
|
26752
26752
|
p: "600",
|
|
26753
26753
|
pL: "600",
|
|
26754
|
-
h6: "700"
|
|
26754
|
+
h6: "700",
|
|
26755
|
+
regular: "600",
|
|
26756
|
+
extraSmall: "600",
|
|
26757
|
+
small: "600",
|
|
26758
|
+
large: "600"
|
|
26755
26759
|
};
|
|
26756
26760
|
var fallbackValues$p = {
|
|
26757
26761
|
fontWeight: fontWeight$4
|
|
26758
26762
|
};
|
|
26759
26763
|
|
|
26760
|
-
var
|
|
26764
|
+
var LabeledAmountV1 = function LabeledAmountV1(_ref) {
|
|
26761
26765
|
var _ref$variant = _ref.variant,
|
|
26762
26766
|
variant = _ref$variant === void 0 ? "pL" : _ref$variant,
|
|
26763
26767
|
label = _ref.label,
|
|
@@ -26781,19 +26785,46 @@ var LabeledAmount = function LabeledAmount(_ref) {
|
|
|
26781
26785
|
}, amount));
|
|
26782
26786
|
};
|
|
26783
26787
|
|
|
26788
|
+
var LabeledAmountV2 = function LabeledAmountV2(_ref) {
|
|
26789
|
+
var _ref$variant = _ref.variant,
|
|
26790
|
+
variant = _ref$variant === void 0 ? "regular" : _ref$variant,
|
|
26791
|
+
label = _ref.label,
|
|
26792
|
+
amount = _ref.amount,
|
|
26793
|
+
themeValues = _ref.themeValues,
|
|
26794
|
+
as = _ref.as,
|
|
26795
|
+
extraStyles = _ref.extraStyles;
|
|
26796
|
+
return /*#__PURE__*/React__default.createElement(Detail$1, {
|
|
26797
|
+
variant: variant,
|
|
26798
|
+
as: as,
|
|
26799
|
+
weight: themeValues.fontWeight,
|
|
26800
|
+
extraStyles: "display: flex; justify-content: space-between; ".concat(extraStyles)
|
|
26801
|
+
}, /*#__PURE__*/React__default.createElement("span", null, label), /*#__PURE__*/React__default.createElement("span", null, amount));
|
|
26802
|
+
};
|
|
26803
|
+
|
|
26804
|
+
var _excluded$u = ["version"];
|
|
26805
|
+
|
|
26806
|
+
var LabeledAmount = function LabeledAmount(_ref) {
|
|
26807
|
+
var _ref$version = _ref.version,
|
|
26808
|
+
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
26809
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
26810
|
+
|
|
26811
|
+
var LabeledAmountComponent = version === "v1" ? LabeledAmountV1 : LabeledAmountV2;
|
|
26812
|
+
return /*#__PURE__*/React__default.createElement(LabeledAmountComponent, rest);
|
|
26813
|
+
};
|
|
26814
|
+
|
|
26784
26815
|
var LabeledAmount$1 = themeComponent(LabeledAmount, "LabeledAmount", fallbackValues$p, "default");
|
|
26785
26816
|
|
|
26786
26817
|
var weightTitle = {
|
|
26787
26818
|
"default": "600",
|
|
26788
26819
|
small: "400"
|
|
26789
26820
|
};
|
|
26790
|
-
var
|
|
26791
|
-
"default": "
|
|
26792
|
-
small: "
|
|
26821
|
+
var detailVariant = {
|
|
26822
|
+
"default": "large",
|
|
26823
|
+
small: "small"
|
|
26793
26824
|
};
|
|
26794
26825
|
var fallbackValues$q = {
|
|
26795
26826
|
weightTitle: weightTitle,
|
|
26796
|
-
|
|
26827
|
+
detailVariant: detailVariant
|
|
26797
26828
|
};
|
|
26798
26829
|
|
|
26799
26830
|
var LineItem = function LineItem(_ref) {
|
|
@@ -26820,35 +26851,27 @@ var LineItem = function LineItem(_ref) {
|
|
|
26820
26851
|
var visibleCustomAttrs = customAttributes === null || customAttributes === void 0 ? void 0 : (_customAttributes$fil = customAttributes.filter(function (attr) {
|
|
26821
26852
|
return (visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.includes(attr.key)) && attr.key !== "description";
|
|
26822
26853
|
})) === null || _customAttributes$fil === void 0 ? void 0 : _customAttributes$fil.map(function (attr) {
|
|
26823
|
-
return /*#__PURE__*/React__default.createElement(
|
|
26824
|
-
variant: "
|
|
26854
|
+
return /*#__PURE__*/React__default.createElement(Detail$1, {
|
|
26855
|
+
variant: "small",
|
|
26825
26856
|
weight: "400",
|
|
26826
26857
|
key: attr.key,
|
|
26827
26858
|
color: STORM_GREY
|
|
26828
26859
|
}, "".concat(formatAttrKeys(attr.key), ": ").concat(attr.value));
|
|
26829
26860
|
});
|
|
26830
|
-
return /*#__PURE__*/React__default.createElement(
|
|
26831
|
-
nowrap: true,
|
|
26832
|
-
justify: "space-between",
|
|
26833
|
-
align: "start"
|
|
26834
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
26861
|
+
return /*#__PURE__*/React__default.createElement(Stack, {
|
|
26835
26862
|
childGap: "0px"
|
|
26836
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
26837
|
-
|
|
26838
|
-
|
|
26839
|
-
|
|
26840
|
-
|
|
26863
|
+
}, /*#__PURE__*/React__default.createElement(Detail$1, {
|
|
26864
|
+
as: "h3",
|
|
26865
|
+
variant: themeValues.detailVariant,
|
|
26866
|
+
weight: themeValues.weightTitle,
|
|
26867
|
+
extraStyles: "display: flex; justify-content: space-between;"
|
|
26868
|
+
}, /*#__PURE__*/React__default.createElement("span", null, description), /*#__PURE__*/React__default.createElement("span", null, !!displayQuantity && "x".concat(displayQuantity)), /*#__PURE__*/React__default.createElement("span", null, amount)), /*#__PURE__*/React__default.createElement(Detail$1, {
|
|
26869
|
+
as: "p",
|
|
26870
|
+
variant: themeValues.detailVariant,
|
|
26841
26871
|
weight: "400"
|
|
26842
26872
|
}, subDescription), visibleCustomAttrs && /*#__PURE__*/React__default.createElement(Stack, {
|
|
26843
26873
|
childGap: "0.25rem"
|
|
26844
|
-
}, visibleCustomAttrs))
|
|
26845
|
-
variant: themeValues.paragraphVariant,
|
|
26846
|
-
weight: themeValues.weightTitle
|
|
26847
|
-
}, "x".concat(displayQuantity)), /*#__PURE__*/React__default.createElement(Paragraph$1, {
|
|
26848
|
-
variant: themeValues.paragraphVariant,
|
|
26849
|
-
weight: "600",
|
|
26850
|
-
extraStyles: "margin: 0; text-align: end; min-width: fit-content; padding-left: 32px;"
|
|
26851
|
-
}, amount));
|
|
26874
|
+
}, visibleCustomAttrs));
|
|
26852
26875
|
};
|
|
26853
26876
|
|
|
26854
26877
|
var LineItem$1 = themeComponent(LineItem, "LineItem", fallbackValues$q, "default");
|
|
@@ -26926,7 +26949,7 @@ var Loading = function Loading() {
|
|
|
26926
26949
|
})))));
|
|
26927
26950
|
};
|
|
26928
26951
|
|
|
26929
|
-
var _excluded$
|
|
26952
|
+
var _excluded$v = ["leftContent", "rightContent", "footerMinHeight", "backgroundColor", "largeSide", "largeSideSize", "footerPadding", "isMobile", "footerWidth"];
|
|
26930
26953
|
|
|
26931
26954
|
var NavFooter = function NavFooter(_ref) {
|
|
26932
26955
|
var leftContent = _ref.leftContent,
|
|
@@ -26942,7 +26965,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26942
26965
|
footerPadding = _ref$footerPadding === void 0 ? "1.5rem 1rem" : _ref$footerPadding,
|
|
26943
26966
|
isMobile = _ref.isMobile,
|
|
26944
26967
|
footerWidth = _ref.footerWidth,
|
|
26945
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
26968
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
26946
26969
|
|
|
26947
26970
|
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
26948
26971
|
padding: footerPadding,
|
|
@@ -26974,7 +26997,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26974
26997
|
}, rightContent)))))));
|
|
26975
26998
|
};
|
|
26976
26999
|
|
|
26977
|
-
var _excluded$
|
|
27000
|
+
var _excluded$w = ["leftContent", "rightContent", "headerHeight", "isMobile", "backgroundColor", "headerWidth"];
|
|
26978
27001
|
|
|
26979
27002
|
var NavHeader = function NavHeader(_ref) {
|
|
26980
27003
|
var leftContent = _ref.leftContent,
|
|
@@ -26984,7 +27007,7 @@ var NavHeader = function NavHeader(_ref) {
|
|
|
26984
27007
|
isMobile = _ref.isMobile,
|
|
26985
27008
|
backgroundColor = _ref.backgroundColor,
|
|
26986
27009
|
headerWidth = _ref.headerWidth,
|
|
26987
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
27010
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
26988
27011
|
|
|
26989
27012
|
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
26990
27013
|
padding: "0 16px 4px",
|
|
@@ -38779,7 +38802,7 @@ var TableRowWrapper = styled__default.tr.withConfig({
|
|
|
38779
38802
|
return extraStyles;
|
|
38780
38803
|
});
|
|
38781
38804
|
|
|
38782
|
-
var _excluded$
|
|
38805
|
+
var _excluded$x = ["children", "extraStyles", "hoverCursor", "hoverEffect", "onClick", "themeValues"];
|
|
38783
38806
|
|
|
38784
38807
|
var TableRow = function TableRow(_ref) {
|
|
38785
38808
|
var children = _ref.children,
|
|
@@ -38789,7 +38812,7 @@ var TableRow = function TableRow(_ref) {
|
|
|
38789
38812
|
hoverEffect = _ref$hoverEffect === void 0 ? true : _ref$hoverEffect,
|
|
38790
38813
|
onClick = _ref.onClick,
|
|
38791
38814
|
themeValues = _ref.themeValues,
|
|
38792
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
38815
|
+
props = _objectWithoutProperties(_ref, _excluded$x);
|
|
38793
38816
|
|
|
38794
38817
|
return /*#__PURE__*/React__default.createElement(TableRowWrapper, _extends({
|
|
38795
38818
|
onClick: onClick,
|
|
@@ -45862,9 +45885,10 @@ var Modal$1 = function Modal(_ref) {
|
|
|
45862
45885
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
45863
45886
|
justify: "flex-start",
|
|
45864
45887
|
align: "center"
|
|
45865
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
45866
|
-
|
|
45867
|
-
weight: FONT_WEIGHT_SEMIBOLD
|
|
45888
|
+
}, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
45889
|
+
as: "h2",
|
|
45890
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
45891
|
+
fontSize: "1.25rem"
|
|
45868
45892
|
}, modalHeaderText))), /*#__PURE__*/React__default.createElement(Box, {
|
|
45869
45893
|
background: modalBodyBg,
|
|
45870
45894
|
padding: "1.5rem"
|
|
@@ -47356,12 +47380,12 @@ var lineItem = {
|
|
|
47356
47380
|
small: "small"
|
|
47357
47381
|
};
|
|
47358
47382
|
var labeledAmountSubtotal = {
|
|
47359
|
-
"default": "
|
|
47360
|
-
small: "
|
|
47383
|
+
"default": "large",
|
|
47384
|
+
small: "small"
|
|
47361
47385
|
};
|
|
47362
47386
|
var labeledAmountTotal = {
|
|
47363
|
-
"default": "
|
|
47364
|
-
small: "
|
|
47387
|
+
"default": "large",
|
|
47388
|
+
small: "small"
|
|
47365
47389
|
};
|
|
47366
47390
|
var fallbackValues$N = {
|
|
47367
47391
|
backgroundColor: backgroundColor$c,
|
|
@@ -47370,7 +47394,7 @@ var fallbackValues$N = {
|
|
|
47370
47394
|
labeledAmountTotal: labeledAmountTotal
|
|
47371
47395
|
};
|
|
47372
47396
|
|
|
47373
|
-
var _excluded$
|
|
47397
|
+
var _excluded$y = ["amount"],
|
|
47374
47398
|
_excluded2$1 = ["amount"];
|
|
47375
47399
|
|
|
47376
47400
|
var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
@@ -47421,6 +47445,9 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47421
47445
|
}), /*#__PURE__*/React__default.createElement(Box, {
|
|
47422
47446
|
padding: "16px 0px"
|
|
47423
47447
|
}, /*#__PURE__*/React__default.createElement(SolidDivider$1, null)), /*#__PURE__*/React__default.createElement(LabeledAmount$1, {
|
|
47448
|
+
version: "v2",
|
|
47449
|
+
as: "h3",
|
|
47450
|
+
variant: "small",
|
|
47424
47451
|
extraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;"),
|
|
47425
47452
|
label: "Amount paid",
|
|
47426
47453
|
amount: displayCurrency(voidableAmountPaid)
|
|
@@ -47428,15 +47455,18 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47428
47455
|
, subtotal ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
47429
47456
|
padding: "0.5rem 0"
|
|
47430
47457
|
}, /*#__PURE__*/React__default.createElement(LabeledAmount$1, {
|
|
47458
|
+
version: "v2",
|
|
47431
47459
|
variant: themeValues.labeledAmountSubtotal,
|
|
47432
47460
|
label: "Subtotal",
|
|
47433
|
-
amount: displayCurrency(subtotal)
|
|
47461
|
+
amount: displayCurrency(subtotal),
|
|
47462
|
+
as: "h3"
|
|
47434
47463
|
}), feeElems), /*#__PURE__*/React__default.createElement(SolidDivider$1, null)) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null), /*#__PURE__*/React__default.createElement(LabeledAmount$1, {
|
|
47435
|
-
|
|
47464
|
+
version: "v2",
|
|
47465
|
+
as: "h3",
|
|
47436
47466
|
variant: themeValues.labeledAmountTotal,
|
|
47437
47467
|
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
47438
47468
|
amount: displayCurrency(typeof remainingBalance === "number" ? remainingBalance : total),
|
|
47439
|
-
extraStyles:
|
|
47469
|
+
extraStyles: "margin-top: 1rem;"
|
|
47440
47470
|
}));
|
|
47441
47471
|
};
|
|
47442
47472
|
|
|
@@ -47615,7 +47645,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47615
47645
|
return fee.amount > 0;
|
|
47616
47646
|
}).map(function (_ref5) {
|
|
47617
47647
|
var amount = _ref5.amount,
|
|
47618
|
-
rest = _objectWithoutProperties(_ref5, _excluded$
|
|
47648
|
+
rest = _objectWithoutProperties(_ref5, _excluded$y);
|
|
47619
47649
|
|
|
47620
47650
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
47621
47651
|
amount: displayCurrency(amount)
|
|
@@ -47644,6 +47674,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47644
47674
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
47645
47675
|
padding: "4px 0"
|
|
47646
47676
|
}), /*#__PURE__*/React__default.createElement(LabeledAmount$1, _extends({
|
|
47677
|
+
version: "v2",
|
|
47678
|
+
as: "h3",
|
|
47647
47679
|
key: fee.label,
|
|
47648
47680
|
variant: themeValues.labeledAmountSubtotal
|
|
47649
47681
|
}, fee)));
|
|
@@ -47687,7 +47719,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47687
47719
|
align: "center"
|
|
47688
47720
|
}, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
47689
47721
|
weight: FONT_WEIGHT_BOLD,
|
|
47690
|
-
as: "
|
|
47722
|
+
as: "h2",
|
|
47691
47723
|
extraStyles: "font-size: 1.375rem;",
|
|
47692
47724
|
id: "payment-details-title"
|
|
47693
47725
|
}, titleText), /*#__PURE__*/React__default.createElement(Title$1, {
|
|
@@ -47695,7 +47727,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47695
47727
|
as: "p",
|
|
47696
47728
|
extraStyles: "font-size: 1.375rem;"
|
|
47697
47729
|
}, displayCurrency(total)))) : /*#__PURE__*/React__default.createElement(Title$1, {
|
|
47698
|
-
as: "
|
|
47730
|
+
as: "h2",
|
|
47699
47731
|
weight: FONT_WEIGHT_BOLD,
|
|
47700
47732
|
margin: "1rem 0 0 0",
|
|
47701
47733
|
extraStyles: "font-size: 1.75rem;",
|
|
@@ -48037,12 +48069,12 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48037
48069
|
}, errorMessage))))));
|
|
48038
48070
|
};
|
|
48039
48071
|
|
|
48040
|
-
var _excluded$
|
|
48072
|
+
var _excluded$z = ["version"];
|
|
48041
48073
|
|
|
48042
48074
|
var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
48043
48075
|
var _ref$version = _ref.version,
|
|
48044
48076
|
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
48045
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48077
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
48046
48078
|
|
|
48047
48079
|
var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
|
|
48048
48080
|
return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, rest);
|
|
@@ -48721,7 +48753,7 @@ var fallbackValues$Q = {
|
|
|
48721
48753
|
focusStyles: focusStyles
|
|
48722
48754
|
};
|
|
48723
48755
|
|
|
48724
|
-
var _excluded$
|
|
48756
|
+
var _excluded$A = ["themeValues", "isMobile", "supportsTouch", "sections", "openSection", "toggleOpenSection", "staggeredAnimation", "initiallyOpen", "openHeight", "containerStyles", "ariaDescribedBy", "isSectionRequired"];
|
|
48725
48757
|
/*
|
|
48726
48758
|
Takes an array of section objects, each object should look like:
|
|
48727
48759
|
{
|
|
@@ -48769,7 +48801,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48769
48801
|
ariaDescribedBy = _ref.ariaDescribedBy,
|
|
48770
48802
|
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
48771
48803
|
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
|
|
48772
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48804
|
+
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
48773
48805
|
|
|
48774
48806
|
var _useState = React.useState(null),
|
|
48775
48807
|
_useState2 = _slicedToArray(_useState, 2),
|