@thecb/components 10.4.0 → 10.4.2-beta.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 +41 -11
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +41 -11
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/molecules/payment-details/PaymentDetails.js +51 -14
- package/src/components/molecules/payment-details/PaymentDetails.stories.js +2 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +6 -3
- package/src/components/molecules/registration-form/RegistrationForm.state.js +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -39826,6 +39826,12 @@ validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
|
39826
39826
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39827
39827
|
};
|
|
39828
39828
|
|
|
39829
|
+
const VALID_NAME = 'validator/VALID_NAME';
|
|
39830
|
+
const VALID_NAME_ERROR = 'validator/VALID_NAME_ERROR';
|
|
39831
|
+
const validName = createValidator(VALID_NAME, VALID_NAME_ERROR);
|
|
39832
|
+
validatorFns[VALID_NAME] = (value, args, form) =>
|
|
39833
|
+
value === '' ? false : new RegExp(/[A-Za-z]+(\s?[A-Za-z\-,'])*/).test(value);
|
|
39834
|
+
|
|
39829
39835
|
const runValidatorErrorMessage = (type) =>
|
|
39830
39836
|
`${type} was passed to runValidator, but that validator type does not exist.
|
|
39831
39837
|
Please check that you are only calling validator creator functions exported from
|
|
@@ -47846,10 +47852,12 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47846
47852
|
voidableTransactionDetails = _ref.voidableTransactionDetails,
|
|
47847
47853
|
voidableAmountPaid = _ref.voidableAmountPaid,
|
|
47848
47854
|
partialVoidAction = _ref.partialVoidAction,
|
|
47849
|
-
remainingBalance = _ref.remainingBalance
|
|
47855
|
+
remainingBalance = _ref.remainingBalance,
|
|
47856
|
+
agencySubheading = _ref.agencySubheading,
|
|
47857
|
+
isCollapsible = _ref.isCollapsible;
|
|
47850
47858
|
return /*#__PURE__*/React__default.createElement(Stack, {
|
|
47851
47859
|
childGap: "16px"
|
|
47852
|
-
}, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React__default.createElement(Box, {
|
|
47860
|
+
}, isCollapsible && agencySubheading, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React__default.createElement(Box, {
|
|
47853
47861
|
background: ATHENS_GREY
|
|
47854
47862
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
47855
47863
|
variant: "p",
|
|
@@ -48064,7 +48072,10 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48064
48072
|
_ref4$isLoading = _ref4.isLoading,
|
|
48065
48073
|
isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
|
|
48066
48074
|
_ref4$isError = _ref4.isError,
|
|
48067
|
-
isError = _ref4$isError === void 0 ? false : _ref4$isError
|
|
48075
|
+
isError = _ref4$isError === void 0 ? false : _ref4$isError,
|
|
48076
|
+
_ref4$multiCartEnable = _ref4.multiCartEnabled,
|
|
48077
|
+
multiCartEnabled = _ref4$multiCartEnable === void 0 ? false : _ref4$multiCartEnable,
|
|
48078
|
+
agencyDisplayName = _ref4.agencyDisplayName;
|
|
48068
48079
|
var _useState = React.useState(initiallyOpen),
|
|
48069
48080
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48070
48081
|
isOpen = _useState2[0],
|
|
@@ -48104,6 +48115,21 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48104
48115
|
variant: themeValues.labeledAmountSubtotal
|
|
48105
48116
|
}, fee)));
|
|
48106
48117
|
});
|
|
48118
|
+
var agencySubheading = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, multiCartEnabled && agencyDisplayName && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48119
|
+
justify: "space-between",
|
|
48120
|
+
align: "center",
|
|
48121
|
+
style: {
|
|
48122
|
+
margin: isCollapsible ? "0" : "0.5rem 0"
|
|
48123
|
+
}
|
|
48124
|
+
}, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
48125
|
+
weight: FONT_WEIGHT_REGULAR,
|
|
48126
|
+
as: "h3",
|
|
48127
|
+
extraStyles: "font-size: 1rem;"
|
|
48128
|
+
}, agencyDisplayName), (lineItems === null || lineItems === void 0 ? void 0 : lineItems.length) && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48129
|
+
variant: "pS",
|
|
48130
|
+
color: themeValues.text,
|
|
48131
|
+
weight: "400"
|
|
48132
|
+
}, "".concat(lineItems.length, " item").concat(lineItems.length > 1 ? "s" : ""))));
|
|
48107
48133
|
var content = isCollapsible ? /*#__PURE__*/React__default.createElement(Stack, {
|
|
48108
48134
|
childGap: "0"
|
|
48109
48135
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -48121,7 +48147,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48121
48147
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
48122
48148
|
voidableAmountPaid: voidableAmountPaid,
|
|
48123
48149
|
partialVoidAction: partialVoidAction,
|
|
48124
|
-
remainingBalance: remainingBalance
|
|
48150
|
+
remainingBalance: remainingBalance,
|
|
48151
|
+
agencySubheading: agencySubheading,
|
|
48152
|
+
isCollapsible: isCollapsible
|
|
48125
48153
|
})) : /*#__PURE__*/React__default.createElement(PaymentDetailsContent, {
|
|
48126
48154
|
lineItemElems: lineItemElems,
|
|
48127
48155
|
feeElems: feeElems,
|
|
@@ -48133,7 +48161,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48133
48161
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
48134
48162
|
voidableAmountPaid: voidableAmountPaid,
|
|
48135
48163
|
partialVoidAction: partialVoidAction,
|
|
48136
|
-
remainingBalance: remainingBalance
|
|
48164
|
+
remainingBalance: remainingBalance,
|
|
48165
|
+
agencySubheading: agencySubheading,
|
|
48166
|
+
isCollapsible: isCollapsible
|
|
48137
48167
|
});
|
|
48138
48168
|
var title = hideTitle ? /*#__PURE__*/React__default.createElement(React.Fragment, null) : isCollapsible ? /*#__PURE__*/React__default.createElement(Box, {
|
|
48139
48169
|
width: "100%",
|
|
@@ -48150,13 +48180,13 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48150
48180
|
weight: FONT_WEIGHT_BOLD,
|
|
48151
48181
|
as: "p",
|
|
48152
48182
|
extraStyles: "font-size: 1.375rem;"
|
|
48153
|
-
}, displayCurrency(total)))) : /*#__PURE__*/React__default.createElement(Title$1, {
|
|
48183
|
+
}, displayCurrency(total)))) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Title$1, {
|
|
48154
48184
|
as: "h2",
|
|
48155
48185
|
weight: FONT_WEIGHT_BOLD,
|
|
48156
48186
|
margin: "1rem 0 0 0",
|
|
48157
48187
|
extraStyles: "font-size: 1.75rem;",
|
|
48158
48188
|
id: "payment-details-title"
|
|
48159
|
-
}, titleText);
|
|
48189
|
+
}, titleText), agencySubheading);
|
|
48160
48190
|
return isCollapsible ? /*#__PURE__*/React__default.createElement(Collapsible, {
|
|
48161
48191
|
title: title,
|
|
48162
48192
|
content: content,
|
|
@@ -49448,8 +49478,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49448
49478
|
};
|
|
49449
49479
|
}, []);
|
|
49450
49480
|
}
|
|
49451
|
-
var firstNameErrorMessages = _defineProperty({}, required.error, "First name is required");
|
|
49452
|
-
var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
|
|
49481
|
+
var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), validName.error, "First name contains invalid characters");
|
|
49482
|
+
var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), validName.error, "Last name contains invalid characters");
|
|
49453
49483
|
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Invalid email address");
|
|
49454
49484
|
var passwordErrorMessages = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, required.error, "Password is required"), hasLength.error, "Password must have at least 8 characters"), hasNumber.error, "Password must contain at least one number"), hasLowercaseLetter.error, "Password must contain at least one lowercase letter"), hasUppercaseLetter.error, "Password must contain at least one uppercase letter"), hasSpecialCharacter.error, "Password must contain at least one special character (!@#$%^&*.?)");
|
|
49455
49485
|
var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
|
|
@@ -49525,10 +49555,10 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49525
49555
|
|
|
49526
49556
|
var formConfig$9 = {
|
|
49527
49557
|
firstName: {
|
|
49528
|
-
validators: [required()]
|
|
49558
|
+
validators: [required(), validName()]
|
|
49529
49559
|
},
|
|
49530
49560
|
lastName: {
|
|
49531
|
-
validators: [required()]
|
|
49561
|
+
validators: [required(), validName()]
|
|
49532
49562
|
},
|
|
49533
49563
|
email: {
|
|
49534
49564
|
validators: [required(), isProbablyEmail()]
|