@thecb/components 7.13.0-beta.0 → 7.13.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 +32 -26
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +32 -26
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/CheckmarkIcon.js +4 -4
- package/src/components/atoms/icons/PendingIcon.js +3 -6
- package/src/components/molecules/partial-amount-form/PartialAmountForm.js +16 -1
- package/src/components/molecules/partial-amount-form/PartialAmountForm.state.js +5 -1
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +3 -2
- package/src/components/molecules/workflow-tile/WorkflowTile.js +14 -35
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/.DS_Store +0 -0
- /package/src/components/atoms/icons/{ExternalLinkicon.js → ExternalLinkIcon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -13815,16 +13815,16 @@ var CheckmarkIcon = function CheckmarkIcon() {
|
|
|
13815
13815
|
transform: "translate(672.000000, 64.000000)"
|
|
13816
13816
|
}, /*#__PURE__*/React__default.createElement("circle", {
|
|
13817
13817
|
id: "Oval-2",
|
|
13818
|
-
stroke:
|
|
13818
|
+
stroke: SEA_GREEN,
|
|
13819
13819
|
strokeWidth: "2",
|
|
13820
|
-
fill:
|
|
13820
|
+
fill: HINT_GREEN,
|
|
13821
13821
|
cx: "48",
|
|
13822
13822
|
cy: "48",
|
|
13823
13823
|
r: "48"
|
|
13824
13824
|
}), /*#__PURE__*/React__default.createElement("g", {
|
|
13825
13825
|
id: "Group-2",
|
|
13826
13826
|
transform: "translate(20.800000, 28.400000)",
|
|
13827
|
-
fill:
|
|
13827
|
+
fill: SEA_GREEN
|
|
13828
13828
|
}, /*#__PURE__*/React__default.createElement("polygon", {
|
|
13829
13829
|
id: "Rectangle-2",
|
|
13830
13830
|
transform: "translate(12.800000, 30.000000) rotate(-45.000000) translate(-12.800000, -30.000000) ",
|
|
@@ -14782,7 +14782,9 @@ var PencilIcon = function PencilIcon(_ref) {
|
|
|
14782
14782
|
|
|
14783
14783
|
var PencilIcon$1 = themeComponent(PencilIcon, "Icons", fallbackValues$2, "info");
|
|
14784
14784
|
|
|
14785
|
-
var PendingIcon = function PendingIcon() {
|
|
14785
|
+
var PendingIcon = function PendingIcon(_ref) {
|
|
14786
|
+
var _ref$fill = _ref.fill,
|
|
14787
|
+
fill = _ref$fill === void 0 ? STORM_GREY : _ref$fill;
|
|
14786
14788
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14787
14789
|
width: "32px",
|
|
14788
14790
|
height: "32px",
|
|
@@ -14799,7 +14801,7 @@ var PendingIcon = function PendingIcon() {
|
|
|
14799
14801
|
}, /*#__PURE__*/React__default.createElement("g", {
|
|
14800
14802
|
id: "Icons",
|
|
14801
14803
|
transform: "translate(-64.000000, -448.000000)",
|
|
14802
|
-
fill:
|
|
14804
|
+
fill: fill
|
|
14803
14805
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
14804
14806
|
d: "M80,480 C88.836556,480 96,472.836556 96,464 C96,455.163444 88.836556,448 80,448 C71.163444,448 64,455.163444 64,464 C64,472.836556 71.163444,480 80,480 Z M87,466 C88.1045695,466 89,465.104569 89,464 C89,462.895431 88.1045695,462 87,462 C85.8954305,462 85,462.895431 85,464 C85,465.104569 85.8954305,466 87,466 Z M80,462 C81.1045695,462 82,462.895431 82,464 C82,465.104569 81.1045695,466 80,466 C78.8954305,466 78,465.104569 78,464 C78,462.895431 78.8954305,462 80,462 Z M73,462 C74.1045695,462 75,462.895431 75,464 C75,465.104569 74.1045695,466 73,466 C71.8954305,466 71,465.104569 71,464 C71,462.895431 71.8954305,462 73,462 Z",
|
|
14805
14807
|
id: "status-icon---pending"
|
|
@@ -46508,6 +46510,7 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
|
|
|
46508
46510
|
maximum = _ref.maximum,
|
|
46509
46511
|
_ref$minimum = _ref.minimum,
|
|
46510
46512
|
minimum = _ref$minimum === void 0 ? 1 : _ref$minimum,
|
|
46513
|
+
blockPartialPaymentOverpay = _ref.blockPartialPaymentOverpay,
|
|
46511
46514
|
clearOnDismount = _ref.clearOnDismount,
|
|
46512
46515
|
fields = _ref.fields,
|
|
46513
46516
|
actions = _ref.actions,
|
|
@@ -46523,6 +46526,18 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
|
|
|
46523
46526
|
}
|
|
46524
46527
|
|
|
46525
46528
|
var amountErrors = (_amountErrors = {}, _defineProperty(_amountErrors, required.error, "Amount is required"), _defineProperty(_amountErrors, numberGreaterThanOrEqualTo.error, "There is a minimum payment of ".concat(displayCurrency(minimum))), _defineProperty(_amountErrors, numberLessThanOrEqualTo.error, "There is a maximum payment of ".concat(displayCurrency(maximum))), _amountErrors);
|
|
46529
|
+
|
|
46530
|
+
var getPartialAmountFormErrors = function getPartialAmountFormErrors(itemAmount) {
|
|
46531
|
+
var errorMessages = amountErrors;
|
|
46532
|
+
|
|
46533
|
+
if (blockPartialPaymentOverpay) {
|
|
46534
|
+
var maxAmountError = "There is a maximum payment of ".concat(displayCurrency(itemAmount));
|
|
46535
|
+
return _objectSpread2(_objectSpread2({}, errorMessages), {}, _defineProperty({}, numberLessThanOrEqualTo.error, maxAmountError));
|
|
46536
|
+
}
|
|
46537
|
+
|
|
46538
|
+
return errorMessages;
|
|
46539
|
+
};
|
|
46540
|
+
|
|
46526
46541
|
var lineItemsNew = Array.isArray(lineItems) ? lineItems : [];
|
|
46527
46542
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
46528
46543
|
variant: variant,
|
|
@@ -46541,7 +46556,7 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
|
|
|
46541
46556
|
field: fields[li.id],
|
|
46542
46557
|
fieldActions: actions.fields[li.id],
|
|
46543
46558
|
showErrors: showErrors,
|
|
46544
|
-
errorMessages:
|
|
46559
|
+
errorMessages: getPartialAmountFormErrors(li.amount),
|
|
46545
46560
|
style: {
|
|
46546
46561
|
textAlign: "right"
|
|
46547
46562
|
},
|
|
@@ -46560,6 +46575,7 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
|
|
|
46560
46575
|
|
|
46561
46576
|
var createPartialAmountFormState = function createPartialAmountFormState(lineItems, maximum) {
|
|
46562
46577
|
var minimum = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
46578
|
+
var blockPartialPaymentOverpay = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
46563
46579
|
var formConfig = lineItems.reduce(function (acc, item) {
|
|
46564
46580
|
var validators = [required(), validateSum(numberGreaterThanOrEqualTo(minimum), lineItems.filter(function (lineItem) {
|
|
46565
46581
|
return lineItem != item;
|
|
@@ -46575,6 +46591,10 @@ var createPartialAmountFormState = function createPartialAmountFormState(lineIte
|
|
|
46575
46591
|
}, [])));
|
|
46576
46592
|
}
|
|
46577
46593
|
|
|
46594
|
+
if (blockPartialPaymentOverpay) {
|
|
46595
|
+
validators.push(numberLessThanOrEqualTo(item.amount));
|
|
46596
|
+
}
|
|
46597
|
+
|
|
46578
46598
|
return _objectSpread2(_objectSpread2({}, acc), {}, _defineProperty({}, item.id, {
|
|
46579
46599
|
validators: validators,
|
|
46580
46600
|
constraints: [onlyNaturals()],
|
|
@@ -46827,7 +46847,9 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
46827
46847
|
redirectText = _ref$redirectText === void 0 ? "Return" : _ref$redirectText,
|
|
46828
46848
|
buttonFlexOverride = _ref.buttonFlexOverride,
|
|
46829
46849
|
_ref$hideForwardButto = _ref.hideForwardButton,
|
|
46830
|
-
hideForwardButton = _ref$hideForwardButto === void 0 ? false : _ref$hideForwardButto
|
|
46850
|
+
hideForwardButton = _ref$hideForwardButto === void 0 ? false : _ref$hideForwardButto,
|
|
46851
|
+
_ref$hideBackButton = _ref.hideBackButton,
|
|
46852
|
+
hideBackButton = _ref$hideBackButton === void 0 ? false : _ref$hideBackButton;
|
|
46831
46853
|
|
|
46832
46854
|
var _useContext = React.useContext(styled.ThemeContext),
|
|
46833
46855
|
isMobile = _useContext.isMobile;
|
|
@@ -46866,7 +46888,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
46866
46888
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
46867
46889
|
justify: buttonFlexOverride ? buttonFlexOverride : !!backButton ? "space-between" : "flex-end",
|
|
46868
46890
|
align: "center"
|
|
46869
|
-
}, backButton, !hideForwardButton && /*#__PURE__*/React__default.createElement(React.Fragment, null, forwardButton))));
|
|
46891
|
+
}, !hideBackButton && /*#__PURE__*/React__default.createElement(React.Fragment, null, backButton), !hideForwardButton && /*#__PURE__*/React__default.createElement(React.Fragment, null, forwardButton))));
|
|
46870
46892
|
};
|
|
46871
46893
|
|
|
46872
46894
|
var backgroundColor$b = {
|
|
@@ -48889,9 +48911,7 @@ var WorkflowTile = function WorkflowTile(_ref) {
|
|
|
48889
48911
|
workflowActionName = _ref$workflowActionNa === void 0 ? "Search" : _ref$workflowActionNa,
|
|
48890
48912
|
slug = _ref.slug,
|
|
48891
48913
|
_ref$buttonVariant = _ref.buttonVariant,
|
|
48892
|
-
buttonVariant = _ref$buttonVariant === void 0 ? "primary" : _ref$buttonVariant
|
|
48893
|
-
selectWorkflowAction = _ref.selectWorkflowAction,
|
|
48894
|
-
navigate = _ref.navigate;
|
|
48914
|
+
buttonVariant = _ref$buttonVariant === void 0 ? "primary" : _ref$buttonVariant;
|
|
48895
48915
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48896
48916
|
background: WHITE,
|
|
48897
48917
|
boxShadow: "0px 0px 5px 0px ".concat(GHOST_GREY),
|
|
@@ -48919,21 +48939,7 @@ var WorkflowTile = function WorkflowTile(_ref) {
|
|
|
48919
48939
|
background: ATHENS_GREY,
|
|
48920
48940
|
borderColor: GRECIAN_GREY,
|
|
48921
48941
|
borderWidthOverride: "2px 0 0 0"
|
|
48922
|
-
},
|
|
48923
|
-
variant: buttonVariant,
|
|
48924
|
-
primary: buttonVariant == "primary",
|
|
48925
|
-
primaryBG: MATISSE_BLUE,
|
|
48926
|
-
fontWeight: FONT_WEIGHT_SEMIBOLD,
|
|
48927
|
-
fontSize: "1.125rem",
|
|
48928
|
-
text: workflowActionName,
|
|
48929
|
-
minWidth: "100%",
|
|
48930
|
-
extraStyles: "width: 100%; margin: 0; text-align: center;",
|
|
48931
|
-
dataQa: slug,
|
|
48932
|
-
action: function action() {
|
|
48933
|
-
selectWorkflowAction(slug);
|
|
48934
|
-
navigate("/service/".concat(slug));
|
|
48935
|
-
}
|
|
48936
|
-
}) : /*#__PURE__*/React__default.createElement(ButtonWithLink, {
|
|
48942
|
+
}, /*#__PURE__*/React__default.createElement(ButtonWithLink, {
|
|
48937
48943
|
variant: buttonVariant,
|
|
48938
48944
|
primary: buttonVariant == "primary",
|
|
48939
48945
|
primaryBG: MATISSE_BLUE,
|