@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.esm.js
CHANGED
|
@@ -39818,6 +39818,12 @@ validatorFns[IS_PROBABLY_EMAIL] = (value, args, form) => {
|
|
|
39818
39818
|
return new RegExp(/^\S+@\S+\.\S+$/).test(value);
|
|
39819
39819
|
};
|
|
39820
39820
|
|
|
39821
|
+
const VALID_NAME = 'validator/VALID_NAME';
|
|
39822
|
+
const VALID_NAME_ERROR = 'validator/VALID_NAME_ERROR';
|
|
39823
|
+
const validName = createValidator(VALID_NAME, VALID_NAME_ERROR);
|
|
39824
|
+
validatorFns[VALID_NAME] = (value, args, form) =>
|
|
39825
|
+
value === '' ? false : new RegExp(/[A-Za-z]+(\s?[A-Za-z\-,'])*/).test(value);
|
|
39826
|
+
|
|
39821
39827
|
const runValidatorErrorMessage = (type) =>
|
|
39822
39828
|
`${type} was passed to runValidator, but that validator type does not exist.
|
|
39823
39829
|
Please check that you are only calling validator creator functions exported from
|
|
@@ -47838,10 +47844,12 @@ var PaymentDetailsContent = function PaymentDetailsContent(_ref) {
|
|
|
47838
47844
|
voidableTransactionDetails = _ref.voidableTransactionDetails,
|
|
47839
47845
|
voidableAmountPaid = _ref.voidableAmountPaid,
|
|
47840
47846
|
partialVoidAction = _ref.partialVoidAction,
|
|
47841
|
-
remainingBalance = _ref.remainingBalance
|
|
47847
|
+
remainingBalance = _ref.remainingBalance,
|
|
47848
|
+
agencySubheading = _ref.agencySubheading,
|
|
47849
|
+
isCollapsible = _ref.isCollapsible;
|
|
47842
47850
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
47843
47851
|
childGap: "16px"
|
|
47844
|
-
}, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React.createElement(Box, {
|
|
47852
|
+
}, isCollapsible && agencySubheading, lineItemElems, hasVoidablePaymentsSection && /*#__PURE__*/React.createElement(Box, {
|
|
47845
47853
|
background: ATHENS_GREY
|
|
47846
47854
|
}, /*#__PURE__*/React.createElement(Text$1, {
|
|
47847
47855
|
variant: "p",
|
|
@@ -48056,7 +48064,10 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48056
48064
|
_ref4$isLoading = _ref4.isLoading,
|
|
48057
48065
|
isLoading = _ref4$isLoading === void 0 ? false : _ref4$isLoading,
|
|
48058
48066
|
_ref4$isError = _ref4.isError,
|
|
48059
|
-
isError = _ref4$isError === void 0 ? false : _ref4$isError
|
|
48067
|
+
isError = _ref4$isError === void 0 ? false : _ref4$isError,
|
|
48068
|
+
_ref4$multiCartEnable = _ref4.multiCartEnabled,
|
|
48069
|
+
multiCartEnabled = _ref4$multiCartEnable === void 0 ? false : _ref4$multiCartEnable,
|
|
48070
|
+
agencyDisplayName = _ref4.agencyDisplayName;
|
|
48060
48071
|
var _useState = useState(initiallyOpen),
|
|
48061
48072
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48062
48073
|
isOpen = _useState2[0],
|
|
@@ -48096,6 +48107,21 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48096
48107
|
variant: themeValues.labeledAmountSubtotal
|
|
48097
48108
|
}, fee)));
|
|
48098
48109
|
});
|
|
48110
|
+
var agencySubheading = /*#__PURE__*/React.createElement(React.Fragment, null, multiCartEnabled && agencyDisplayName && /*#__PURE__*/React.createElement(Cluster, {
|
|
48111
|
+
justify: "space-between",
|
|
48112
|
+
align: "center",
|
|
48113
|
+
style: {
|
|
48114
|
+
margin: isCollapsible ? "0" : "0.5rem 0"
|
|
48115
|
+
}
|
|
48116
|
+
}, /*#__PURE__*/React.createElement(Title$1, {
|
|
48117
|
+
weight: FONT_WEIGHT_REGULAR,
|
|
48118
|
+
as: "h3",
|
|
48119
|
+
extraStyles: "font-size: 1rem;"
|
|
48120
|
+
}, agencyDisplayName), (lineItems === null || lineItems === void 0 ? void 0 : lineItems.length) && /*#__PURE__*/React.createElement(Text$1, {
|
|
48121
|
+
variant: "pS",
|
|
48122
|
+
color: themeValues.text,
|
|
48123
|
+
weight: "400"
|
|
48124
|
+
}, "".concat(lineItems.length, " item").concat(lineItems.length > 1 ? "s" : ""))));
|
|
48099
48125
|
var content = isCollapsible ? /*#__PURE__*/React.createElement(Stack, {
|
|
48100
48126
|
childGap: "0"
|
|
48101
48127
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -48113,7 +48139,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48113
48139
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
48114
48140
|
voidableAmountPaid: voidableAmountPaid,
|
|
48115
48141
|
partialVoidAction: partialVoidAction,
|
|
48116
|
-
remainingBalance: remainingBalance
|
|
48142
|
+
remainingBalance: remainingBalance,
|
|
48143
|
+
agencySubheading: agencySubheading,
|
|
48144
|
+
isCollapsible: isCollapsible
|
|
48117
48145
|
})) : /*#__PURE__*/React.createElement(PaymentDetailsContent, {
|
|
48118
48146
|
lineItemElems: lineItemElems,
|
|
48119
48147
|
feeElems: feeElems,
|
|
@@ -48125,7 +48153,9 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48125
48153
|
voidableTransactionDetails: voidableTransactionDetails,
|
|
48126
48154
|
voidableAmountPaid: voidableAmountPaid,
|
|
48127
48155
|
partialVoidAction: partialVoidAction,
|
|
48128
|
-
remainingBalance: remainingBalance
|
|
48156
|
+
remainingBalance: remainingBalance,
|
|
48157
|
+
agencySubheading: agencySubheading,
|
|
48158
|
+
isCollapsible: isCollapsible
|
|
48129
48159
|
});
|
|
48130
48160
|
var title = hideTitle ? /*#__PURE__*/React.createElement(Fragment$1, null) : isCollapsible ? /*#__PURE__*/React.createElement(Box, {
|
|
48131
48161
|
width: "100%",
|
|
@@ -48142,13 +48172,13 @@ var PaymentDetails = function PaymentDetails(_ref4) {
|
|
|
48142
48172
|
weight: FONT_WEIGHT_BOLD,
|
|
48143
48173
|
as: "p",
|
|
48144
48174
|
extraStyles: "font-size: 1.375rem;"
|
|
48145
|
-
}, displayCurrency(total)))) : /*#__PURE__*/React.createElement(Title$1, {
|
|
48175
|
+
}, displayCurrency(total)))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Title$1, {
|
|
48146
48176
|
as: "h2",
|
|
48147
48177
|
weight: FONT_WEIGHT_BOLD,
|
|
48148
48178
|
margin: "1rem 0 0 0",
|
|
48149
48179
|
extraStyles: "font-size: 1.75rem;",
|
|
48150
48180
|
id: "payment-details-title"
|
|
48151
|
-
}, titleText);
|
|
48181
|
+
}, titleText), agencySubheading);
|
|
48152
48182
|
return isCollapsible ? /*#__PURE__*/React.createElement(Collapsible, {
|
|
48153
48183
|
title: title,
|
|
48154
48184
|
content: content,
|
|
@@ -49440,8 +49470,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49440
49470
|
};
|
|
49441
49471
|
}, []);
|
|
49442
49472
|
}
|
|
49443
|
-
var firstNameErrorMessages = _defineProperty({}, required.error, "First name is required");
|
|
49444
|
-
var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
|
|
49473
|
+
var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), validName.error, "First name contains invalid characters");
|
|
49474
|
+
var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), validName.error, "Last name contains invalid characters");
|
|
49445
49475
|
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Invalid email address");
|
|
49446
49476
|
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 (!@#$%^&*.?)");
|
|
49447
49477
|
var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
|
|
@@ -49517,10 +49547,10 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49517
49547
|
|
|
49518
49548
|
var formConfig$9 = {
|
|
49519
49549
|
firstName: {
|
|
49520
|
-
validators: [required()]
|
|
49550
|
+
validators: [required(), validName()]
|
|
49521
49551
|
},
|
|
49522
49552
|
lastName: {
|
|
49523
|
-
validators: [required()]
|
|
49553
|
+
validators: [required(), validName()]
|
|
49524
49554
|
},
|
|
49525
49555
|
email: {
|
|
49526
49556
|
validators: [required(), isProbablyEmail()]
|