@thecb/components 9.4.0 → 9.4.1
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 +95 -50
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +95 -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 +7 -1
- package/src/components/atoms/labeled-amount/LabeledAmountV1.js +37 -0
- package/src/components/atoms/labeled-amount/LabeledAmountV2.js +34 -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
|
@@ -26739,17 +26739,27 @@ var Jumbo = function Jumbo(_ref) {
|
|
|
26739
26739
|
var Jumbo$1 = withWindowSize(Jumbo);
|
|
26740
26740
|
|
|
26741
26741
|
var fontWeight$4 = {
|
|
26742
|
+
// v1 variants
|
|
26742
26743
|
"default": "600",
|
|
26743
26744
|
pS: "600",
|
|
26744
26745
|
p: "600",
|
|
26745
26746
|
pL: "600",
|
|
26746
|
-
h6: "700"
|
|
26747
|
+
h6: "700",
|
|
26748
|
+
// v2 variants
|
|
26749
|
+
regular: "600",
|
|
26750
|
+
// fontsize Detail large
|
|
26751
|
+
extraSmall: "600",
|
|
26752
|
+
//fontsize Detail small
|
|
26753
|
+
small: "600",
|
|
26754
|
+
// fontsize Detail regular
|
|
26755
|
+
large: "700" // fontsize Title small
|
|
26756
|
+
|
|
26747
26757
|
};
|
|
26748
26758
|
var fallbackValues$p = {
|
|
26749
26759
|
fontWeight: fontWeight$4
|
|
26750
26760
|
};
|
|
26751
26761
|
|
|
26752
|
-
var
|
|
26762
|
+
var LabeledAmountV1 = function LabeledAmountV1(_ref) {
|
|
26753
26763
|
var _ref$variant = _ref.variant,
|
|
26754
26764
|
variant = _ref$variant === void 0 ? "pL" : _ref$variant,
|
|
26755
26765
|
label = _ref.label,
|
|
@@ -26773,19 +26783,53 @@ var LabeledAmount = function LabeledAmount(_ref) {
|
|
|
26773
26783
|
}, amount));
|
|
26774
26784
|
};
|
|
26775
26785
|
|
|
26786
|
+
var LabeledAmountV2 = function LabeledAmountV2(_ref) {
|
|
26787
|
+
var _ref$variant = _ref.variant,
|
|
26788
|
+
variant = _ref$variant === void 0 ? "regular" : _ref$variant,
|
|
26789
|
+
label = _ref.label,
|
|
26790
|
+
amount = _ref.amount,
|
|
26791
|
+
themeValues = _ref.themeValues,
|
|
26792
|
+
as = _ref.as,
|
|
26793
|
+
extraStyles = _ref.extraStyles;
|
|
26794
|
+
var mappedDetailVariants = {
|
|
26795
|
+
regular: "large",
|
|
26796
|
+
small: "regular",
|
|
26797
|
+
extraSmall: "small"
|
|
26798
|
+
};
|
|
26799
|
+
var LabeledAmountContainer = variant === "large" ? Title$1 : Detail$1;
|
|
26800
|
+
var containerVariant = variant === "large" ? "small" : mappedDetailVariants[variant];
|
|
26801
|
+
return /*#__PURE__*/React.createElement(LabeledAmountContainer, {
|
|
26802
|
+
variant: containerVariant,
|
|
26803
|
+
as: as,
|
|
26804
|
+
weight: themeValues.fontWeight,
|
|
26805
|
+
extraStyles: "display: flex; justify-content: space-between; ".concat(extraStyles)
|
|
26806
|
+
}, /*#__PURE__*/React.createElement("span", null, label), /*#__PURE__*/React.createElement("span", null, amount));
|
|
26807
|
+
};
|
|
26808
|
+
|
|
26809
|
+
var _excluded$u = ["version"];
|
|
26810
|
+
|
|
26811
|
+
var LabeledAmount = function LabeledAmount(_ref) {
|
|
26812
|
+
var _ref$version = _ref.version,
|
|
26813
|
+
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
26814
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
26815
|
+
|
|
26816
|
+
var LabeledAmountComponent = version === "v1" ? LabeledAmountV1 : LabeledAmountV2;
|
|
26817
|
+
return /*#__PURE__*/React.createElement(LabeledAmountComponent, rest);
|
|
26818
|
+
};
|
|
26819
|
+
|
|
26776
26820
|
var LabeledAmount$1 = themeComponent(LabeledAmount, "LabeledAmount", fallbackValues$p, "default");
|
|
26777
26821
|
|
|
26778
26822
|
var weightTitle = {
|
|
26779
26823
|
"default": "600",
|
|
26780
26824
|
small: "400"
|
|
26781
26825
|
};
|
|
26782
|
-
var
|
|
26783
|
-
"default": "
|
|
26784
|
-
small: "
|
|
26826
|
+
var detailVariant = {
|
|
26827
|
+
"default": "large",
|
|
26828
|
+
small: "small"
|
|
26785
26829
|
};
|
|
26786
26830
|
var fallbackValues$q = {
|
|
26787
26831
|
weightTitle: weightTitle,
|
|
26788
|
-
|
|
26832
|
+
detailVariant: detailVariant
|
|
26789
26833
|
};
|
|
26790
26834
|
|
|
26791
26835
|
var LineItem = function LineItem(_ref) {
|
|
@@ -26812,35 +26856,27 @@ var LineItem = function LineItem(_ref) {
|
|
|
26812
26856
|
var visibleCustomAttrs = customAttributes === null || customAttributes === void 0 ? void 0 : (_customAttributes$fil = customAttributes.filter(function (attr) {
|
|
26813
26857
|
return (visibleFields === null || visibleFields === void 0 ? void 0 : visibleFields.includes(attr.key)) && attr.key !== "description";
|
|
26814
26858
|
})) === null || _customAttributes$fil === void 0 ? void 0 : _customAttributes$fil.map(function (attr) {
|
|
26815
|
-
return /*#__PURE__*/React.createElement(
|
|
26816
|
-
variant: "
|
|
26859
|
+
return /*#__PURE__*/React.createElement(Detail$1, {
|
|
26860
|
+
variant: "small",
|
|
26817
26861
|
weight: "400",
|
|
26818
26862
|
key: attr.key,
|
|
26819
26863
|
color: STORM_GREY
|
|
26820
26864
|
}, "".concat(formatAttrKeys(attr.key), ": ").concat(attr.value));
|
|
26821
26865
|
});
|
|
26822
|
-
return /*#__PURE__*/React.createElement(
|
|
26823
|
-
nowrap: true,
|
|
26824
|
-
justify: "space-between",
|
|
26825
|
-
align: "start"
|
|
26826
|
-
}, /*#__PURE__*/React.createElement(Stack, {
|
|
26866
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
26827
26867
|
childGap: "0px"
|
|
26828
|
-
}, /*#__PURE__*/React.createElement(
|
|
26829
|
-
|
|
26830
|
-
|
|
26831
|
-
|
|
26832
|
-
|
|
26868
|
+
}, /*#__PURE__*/React.createElement(Detail$1, {
|
|
26869
|
+
as: "h3",
|
|
26870
|
+
variant: themeValues.detailVariant,
|
|
26871
|
+
weight: themeValues.weightTitle,
|
|
26872
|
+
extraStyles: "display: flex; justify-content: space-between;"
|
|
26873
|
+
}, /*#__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, {
|
|
26874
|
+
as: "p",
|
|
26875
|
+
variant: themeValues.detailVariant,
|
|
26833
26876
|
weight: "400"
|
|
26834
26877
|
}, subDescription), visibleCustomAttrs && /*#__PURE__*/React.createElement(Stack, {
|
|
26835
26878
|
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));
|
|
26879
|
+
}, visibleCustomAttrs));
|
|
26844
26880
|
};
|
|
26845
26881
|
|
|
26846
26882
|
var LineItem$1 = themeComponent(LineItem, "LineItem", fallbackValues$q, "default");
|
|
@@ -26918,7 +26954,7 @@ var Loading = function Loading() {
|
|
|
26918
26954
|
})))));
|
|
26919
26955
|
};
|
|
26920
26956
|
|
|
26921
|
-
var _excluded$
|
|
26957
|
+
var _excluded$v = ["leftContent", "rightContent", "footerMinHeight", "backgroundColor", "largeSide", "largeSideSize", "footerPadding", "isMobile", "footerWidth"];
|
|
26922
26958
|
|
|
26923
26959
|
var NavFooter = function NavFooter(_ref) {
|
|
26924
26960
|
var leftContent = _ref.leftContent,
|
|
@@ -26934,7 +26970,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26934
26970
|
footerPadding = _ref$footerPadding === void 0 ? "1.5rem 1rem" : _ref$footerPadding,
|
|
26935
26971
|
isMobile = _ref.isMobile,
|
|
26936
26972
|
footerWidth = _ref.footerWidth,
|
|
26937
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
26973
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
26938
26974
|
|
|
26939
26975
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
26940
26976
|
padding: footerPadding,
|
|
@@ -26966,7 +27002,7 @@ var NavFooter = function NavFooter(_ref) {
|
|
|
26966
27002
|
}, rightContent)))))));
|
|
26967
27003
|
};
|
|
26968
27004
|
|
|
26969
|
-
var _excluded$
|
|
27005
|
+
var _excluded$w = ["leftContent", "rightContent", "headerHeight", "isMobile", "backgroundColor", "headerWidth"];
|
|
26970
27006
|
|
|
26971
27007
|
var NavHeader = function NavHeader(_ref) {
|
|
26972
27008
|
var leftContent = _ref.leftContent,
|
|
@@ -26976,7 +27012,7 @@ var NavHeader = function NavHeader(_ref) {
|
|
|
26976
27012
|
isMobile = _ref.isMobile,
|
|
26977
27013
|
backgroundColor = _ref.backgroundColor,
|
|
26978
27014
|
headerWidth = _ref.headerWidth,
|
|
26979
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
27015
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
26980
27016
|
|
|
26981
27017
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
26982
27018
|
padding: "0 16px 4px",
|
|
@@ -38772,7 +38808,7 @@ var TableRowWrapper = styled.tr.withConfig({
|
|
|
38772
38808
|
return extraStyles;
|
|
38773
38809
|
});
|
|
38774
38810
|
|
|
38775
|
-
var _excluded$
|
|
38811
|
+
var _excluded$x = ["children", "extraStyles", "hoverCursor", "hoverEffect", "onClick", "themeValues"];
|
|
38776
38812
|
|
|
38777
38813
|
var TableRow = function TableRow(_ref) {
|
|
38778
38814
|
var children = _ref.children,
|
|
@@ -38782,7 +38818,7 @@ var TableRow = function TableRow(_ref) {
|
|
|
38782
38818
|
hoverEffect = _ref$hoverEffect === void 0 ? true : _ref$hoverEffect,
|
|
38783
38819
|
onClick = _ref.onClick,
|
|
38784
38820
|
themeValues = _ref.themeValues,
|
|
38785
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
38821
|
+
props = _objectWithoutProperties(_ref, _excluded$x);
|
|
38786
38822
|
|
|
38787
38823
|
return /*#__PURE__*/React.createElement(TableRowWrapper, _extends({
|
|
38788
38824
|
onClick: onClick,
|
|
@@ -45855,9 +45891,10 @@ var Modal$1 = function Modal(_ref) {
|
|
|
45855
45891
|
}, /*#__PURE__*/React.createElement(Cluster, {
|
|
45856
45892
|
justify: "flex-start",
|
|
45857
45893
|
align: "center"
|
|
45858
|
-
}, /*#__PURE__*/React.createElement(
|
|
45859
|
-
|
|
45860
|
-
weight: FONT_WEIGHT_SEMIBOLD
|
|
45894
|
+
}, /*#__PURE__*/React.createElement(Title$1, {
|
|
45895
|
+
as: "h2",
|
|
45896
|
+
weight: FONT_WEIGHT_SEMIBOLD,
|
|
45897
|
+
fontSize: "1.25rem"
|
|
45861
45898
|
}, modalHeaderText))), /*#__PURE__*/React.createElement(Box, {
|
|
45862
45899
|
background: modalBodyBg,
|
|
45863
45900
|
padding: "1.5rem"
|
|
@@ -47349,12 +47386,12 @@ var lineItem = {
|
|
|
47349
47386
|
small: "small"
|
|
47350
47387
|
};
|
|
47351
47388
|
var labeledAmountSubtotal = {
|
|
47352
|
-
"default": "
|
|
47353
|
-
small: "
|
|
47389
|
+
"default": "regular",
|
|
47390
|
+
small: "small"
|
|
47354
47391
|
};
|
|
47355
47392
|
var labeledAmountTotal = {
|
|
47356
|
-
"default": "
|
|
47357
|
-
small: "
|
|
47393
|
+
"default": "large",
|
|
47394
|
+
small: "small"
|
|
47358
47395
|
};
|
|
47359
47396
|
var fallbackValues$N = {
|
|
47360
47397
|
backgroundColor: backgroundColor$c,
|
|
@@ -47363,7 +47400,7 @@ var fallbackValues$N = {
|
|
|
47363
47400
|
labeledAmountTotal: labeledAmountTotal
|
|
47364
47401
|
};
|
|
47365
47402
|
|
|
47366
|
-
var _excluded$
|
|
47403
|
+
var _excluded$y = ["amount"],
|
|
47367
47404
|
_excluded2$1 = ["amount"];
|
|
47368
47405
|
|
|
47369
47406
|
var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
@@ -47414,6 +47451,9 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47414
47451
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
47415
47452
|
padding: "16px 0px"
|
|
47416
47453
|
}, /*#__PURE__*/React.createElement(SolidDivider$1, null)), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47454
|
+
version: "v2",
|
|
47455
|
+
as: "h3",
|
|
47456
|
+
variant: "small",
|
|
47417
47457
|
extraStyles: "font-weight: ".concat(FONT_WEIGHT_REGULAR, "; font-size: 14px;"),
|
|
47418
47458
|
label: "Amount paid",
|
|
47419
47459
|
amount: displayCurrency(voidableAmountPaid)
|
|
@@ -47421,15 +47461,18 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47421
47461
|
, subtotal ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
47422
47462
|
padding: "0.5rem 0"
|
|
47423
47463
|
}, /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47464
|
+
version: "v2",
|
|
47424
47465
|
variant: themeValues.labeledAmountSubtotal,
|
|
47425
47466
|
label: "Subtotal",
|
|
47426
|
-
amount: displayCurrency(subtotal)
|
|
47467
|
+
amount: displayCurrency(subtotal),
|
|
47468
|
+
as: "h3"
|
|
47427
47469
|
}), feeElems), /*#__PURE__*/React.createElement(SolidDivider$1, null)) : /*#__PURE__*/React.createElement(React.Fragment, null), /*#__PURE__*/React.createElement(LabeledAmount$1, {
|
|
47428
|
-
|
|
47470
|
+
version: "v2",
|
|
47471
|
+
as: "h3",
|
|
47429
47472
|
variant: themeValues.labeledAmountTotal,
|
|
47430
47473
|
label: hasVoidablePaymentsSection ? "Remaining amount due" : "Total",
|
|
47431
47474
|
amount: displayCurrency(typeof remainingBalance === "number" ? remainingBalance : total),
|
|
47432
|
-
extraStyles:
|
|
47475
|
+
extraStyles: "margin-top: 1rem;"
|
|
47433
47476
|
}));
|
|
47434
47477
|
};
|
|
47435
47478
|
|
|
@@ -47608,7 +47651,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47608
47651
|
return fee.amount > 0;
|
|
47609
47652
|
}).map(function (_ref5) {
|
|
47610
47653
|
var amount = _ref5.amount,
|
|
47611
|
-
rest = _objectWithoutProperties(_ref5, _excluded$
|
|
47654
|
+
rest = _objectWithoutProperties(_ref5, _excluded$y);
|
|
47612
47655
|
|
|
47613
47656
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
47614
47657
|
amount: displayCurrency(amount)
|
|
@@ -47637,6 +47680,8 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47637
47680
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
47638
47681
|
padding: "4px 0"
|
|
47639
47682
|
}), /*#__PURE__*/React.createElement(LabeledAmount$1, _extends({
|
|
47683
|
+
version: "v2",
|
|
47684
|
+
as: "h3",
|
|
47640
47685
|
key: fee.label,
|
|
47641
47686
|
variant: themeValues.labeledAmountSubtotal
|
|
47642
47687
|
}, fee)));
|
|
@@ -47680,7 +47725,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47680
47725
|
align: "center"
|
|
47681
47726
|
}, /*#__PURE__*/React.createElement(Title$1, {
|
|
47682
47727
|
weight: FONT_WEIGHT_BOLD,
|
|
47683
|
-
as: "
|
|
47728
|
+
as: "h2",
|
|
47684
47729
|
extraStyles: "font-size: 1.375rem;",
|
|
47685
47730
|
id: "payment-details-title"
|
|
47686
47731
|
}, titleText), /*#__PURE__*/React.createElement(Title$1, {
|
|
@@ -47688,7 +47733,7 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
47688
47733
|
as: "p",
|
|
47689
47734
|
extraStyles: "font-size: 1.375rem;"
|
|
47690
47735
|
}, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Title$1, {
|
|
47691
|
-
as: "
|
|
47736
|
+
as: "h2",
|
|
47692
47737
|
weight: FONT_WEIGHT_BOLD,
|
|
47693
47738
|
margin: "1rem 0 0 0",
|
|
47694
47739
|
extraStyles: "font-size: 1.75rem;",
|
|
@@ -48030,12 +48075,12 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48030
48075
|
}, errorMessage))))));
|
|
48031
48076
|
};
|
|
48032
48077
|
|
|
48033
|
-
var _excluded$
|
|
48078
|
+
var _excluded$z = ["version"];
|
|
48034
48079
|
|
|
48035
48080
|
var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
48036
48081
|
var _ref$version = _ref.version,
|
|
48037
48082
|
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
48038
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48083
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
48039
48084
|
|
|
48040
48085
|
var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
|
|
48041
48086
|
return /*#__PURE__*/React.createElement(TermsAndConditionsControl, rest);
|
|
@@ -48714,7 +48759,7 @@ var fallbackValues$Q = {
|
|
|
48714
48759
|
focusStyles: focusStyles
|
|
48715
48760
|
};
|
|
48716
48761
|
|
|
48717
|
-
var _excluded$
|
|
48762
|
+
var _excluded$A = ["themeValues", "isMobile", "supportsTouch", "sections", "openSection", "toggleOpenSection", "staggeredAnimation", "initiallyOpen", "openHeight", "containerStyles", "ariaDescribedBy", "isSectionRequired"];
|
|
48718
48763
|
/*
|
|
48719
48764
|
Takes an array of section objects, each object should look like:
|
|
48720
48765
|
{
|
|
@@ -48762,7 +48807,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48762
48807
|
ariaDescribedBy = _ref.ariaDescribedBy,
|
|
48763
48808
|
_ref$isSectionRequire = _ref.isSectionRequired,
|
|
48764
48809
|
isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
|
|
48765
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
48810
|
+
rest = _objectWithoutProperties(_ref, _excluded$A);
|
|
48766
48811
|
|
|
48767
48812
|
var _useState = useState(null),
|
|
48768
48813
|
_useState2 = _slicedToArray(_useState, 2),
|