@thecb/components 11.11.0-beta.1 → 11.11.0-beta.10
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/README.md +8 -4
- package/dist/index.cjs.js +237 -124
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +237 -124
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/card-type/CardType.js +10 -2
- package/src/components/atoms/form-layouts/FormInput.js +9 -16
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.js +2 -2
- package/src/components/atoms/formatted-bank-account/FormattedBankAccount.theme.js +2 -2
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +12 -9
- package/src/components/atoms/formatted-credit-card/FormattedCreditCard.theme.js +2 -2
- package/src/components/atoms/icons/AmExSmallIcon.js +2 -0
- package/src/components/atoms/icons/DiscoverSmallIcon.js +2 -0
- package/src/components/atoms/icons/GenericCardLarge.js +1 -1
- package/src/components/atoms/icons/GenericSmallIcon.js +2 -0
- package/src/components/atoms/icons/MasterCardSmallIcon.js +2 -0
- package/src/components/atoms/icons/VisaSmallIcon.js +2 -0
- package/src/components/molecules/editable-list/EditableList.js +3 -0
- package/src/components/molecules/email-form/EmailForm.js +2 -1
- package/src/components/molecules/email-form/EmailForm.stories.js +210 -0
- package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +2 -1
- package/src/components/molecules/login-form/LoginForm.js +2 -1
- package/src/components/molecules/radio-section/InnerRadioSection.js +3 -3
- package/src/components/molecules/radio-section/RadioSection.stories.js +142 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +2 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -1
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +110 -0
- package/src/components/molecules/tooltip/Tooltip.js +163 -96
- package/src/components/molecules/tooltip/Tooltip.mdx +12 -2
- package/src/components/molecules/tooltip/Tooltip.stories.js +113 -63
- package/src/components/molecules/tooltip/Tooltip.theme.js +13 -4
- package/src/components/molecules/tooltip/index.d.ts +8 -8
- package/src/util/formats.js +6 -3
package/dist/index.esm.js
CHANGED
|
@@ -15814,7 +15814,7 @@ var GenericCardLarge = function GenericCardLarge() {
|
|
|
15814
15814
|
fill: "none",
|
|
15815
15815
|
xmlns: "http://www.w3.org/2000/svg",
|
|
15816
15816
|
role: "img",
|
|
15817
|
-
"aria-label": "
|
|
15817
|
+
"aria-label": "Credit card"
|
|
15818
15818
|
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
15819
15819
|
width: "36",
|
|
15820
15820
|
height: "24",
|
|
@@ -18692,7 +18692,9 @@ var VisaSmallIcon = function VisaSmallIcon() {
|
|
|
18692
18692
|
height: "16",
|
|
18693
18693
|
viewBox: "0 0 24 16",
|
|
18694
18694
|
fill: "none",
|
|
18695
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
18695
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18696
|
+
role: "img",
|
|
18697
|
+
"aria-label": "Visa"
|
|
18696
18698
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
18697
18699
|
fillRule: "evenodd",
|
|
18698
18700
|
clipRule: "evenodd",
|
|
@@ -18719,7 +18721,9 @@ var AmExSmallIcon = function AmExSmallIcon() {
|
|
|
18719
18721
|
height: "16",
|
|
18720
18722
|
viewBox: "0 0 24 16",
|
|
18721
18723
|
fill: "none",
|
|
18722
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
18724
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18725
|
+
role: "img",
|
|
18726
|
+
"aria-label": "American Express"
|
|
18723
18727
|
}, /*#__PURE__*/React__default.createElement("g", {
|
|
18724
18728
|
clipPath: "url(#clip0_3693_1095)"
|
|
18725
18729
|
}, /*#__PURE__*/React__default.createElement("g", {
|
|
@@ -18818,7 +18822,9 @@ var DiscoverSmallIcon = function DiscoverSmallIcon() {
|
|
|
18818
18822
|
height: "16",
|
|
18819
18823
|
viewBox: "0 0 24 16",
|
|
18820
18824
|
fill: "none",
|
|
18821
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
18825
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18826
|
+
role: "img",
|
|
18827
|
+
"aria-label": "Discover"
|
|
18822
18828
|
}, /*#__PURE__*/React__default.createElement("g", {
|
|
18823
18829
|
clipPath: "url(#clip0_3818_267)"
|
|
18824
18830
|
}, /*#__PURE__*/React__default.createElement("path", {
|
|
@@ -18943,7 +18949,9 @@ var GenericSmallIcon = function GenericSmallIcon() {
|
|
|
18943
18949
|
height: "16",
|
|
18944
18950
|
viewBox: "0 0 24 16",
|
|
18945
18951
|
fill: "none",
|
|
18946
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
18952
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18953
|
+
role: "img",
|
|
18954
|
+
"aria-label": "Credit card"
|
|
18947
18955
|
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
18948
18956
|
width: "24",
|
|
18949
18957
|
height: "16",
|
|
@@ -18964,7 +18972,9 @@ var MasterCardSmallIcon = function MasterCardSmallIcon() {
|
|
|
18964
18972
|
height: "16",
|
|
18965
18973
|
viewBox: "0 0 24 16",
|
|
18966
18974
|
fill: "none",
|
|
18967
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
18975
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
18976
|
+
role: "img",
|
|
18977
|
+
"aria-label": "Mastercard"
|
|
18968
18978
|
}, /*#__PURE__*/React__default.createElement("rect", {
|
|
18969
18979
|
width: "24",
|
|
18970
18980
|
height: "16",
|
|
@@ -25928,7 +25938,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25928
25938
|
minWidth: "100%"
|
|
25929
25939
|
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
25930
25940
|
justify: "space-between",
|
|
25931
|
-
align: "center"
|
|
25941
|
+
align: "center",
|
|
25942
|
+
overflow: true
|
|
25932
25943
|
}, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
|
|
25933
25944
|
as: "label",
|
|
25934
25945
|
color: themeValues.labelColor,
|
|
@@ -25936,22 +25947,16 @@ var FormInput = function FormInput(_ref15) {
|
|
|
25936
25947
|
fontWeight: themeValues.fontWeight,
|
|
25937
25948
|
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
25938
25949
|
id: createIdFromString(labelTextWhenNoError)
|
|
25939
|
-
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(
|
|
25940
|
-
variant:
|
|
25941
|
-
|
|
25942
|
-
|
|
25943
|
-
hoverStyles: themeValues.hoverFocusStyles,
|
|
25944
|
-
extraStyles: "text-decoration: underline; cursor: pointer; &:focus { outline-offset: -2px; }",
|
|
25945
|
-
onClick: function onClick() {
|
|
25950
|
+
}, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
25951
|
+
variant: "smallGhost",
|
|
25952
|
+
text: showPassword ? "Hide" : "Show",
|
|
25953
|
+
action: function action() {
|
|
25946
25954
|
return setShowPassword(!showPassword);
|
|
25947
25955
|
},
|
|
25948
|
-
tabIndex: "0",
|
|
25949
25956
|
"aria-label": showPassword ? "Hide Password" : "Show password",
|
|
25950
|
-
"
|
|
25951
|
-
|
|
25952
|
-
|
|
25953
|
-
}
|
|
25954
|
-
}, showPassword ? "Hide" : "Show"), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
|
|
25957
|
+
extraStyles: "margin: 0; min-width: auto;",
|
|
25958
|
+
textExtraStyles: "color: ".concat(themeValues.linkColor, ";")
|
|
25959
|
+
}), isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
|
|
25955
25960
|
padding: "0 0 0 auto"
|
|
25956
25961
|
}, decorator)))), /*#__PURE__*/React__default.createElement(Box, {
|
|
25957
25962
|
padding: "0"
|
|
@@ -26291,7 +26296,7 @@ var FormattedAddress = function FormattedAddress(_ref) {
|
|
|
26291
26296
|
var FormattedAddress$1 = themeComponent(FormattedAddress, "FormattedAddress", fallbackValues$n, "default");
|
|
26292
26297
|
|
|
26293
26298
|
var textColor$1 = "".concat(CHARADE_GREY);
|
|
26294
|
-
var autopayTextColor = "".concat(
|
|
26299
|
+
var autopayTextColor = "".concat(SEA_GREEN);
|
|
26295
26300
|
var fallbackValues$o = {
|
|
26296
26301
|
textColor: textColor$1,
|
|
26297
26302
|
autopayTextColor: autopayTextColor
|
|
@@ -26327,8 +26332,8 @@ var FormattedBankAccount = function FormattedBankAccount(_ref2) {
|
|
|
26327
26332
|
}, "Savings Account ending in ", lastFour), autoPay && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26328
26333
|
variant: "p",
|
|
26329
26334
|
color: themeValues.autopayTextColor,
|
|
26330
|
-
extraStyles: "font-style: italic;"
|
|
26331
|
-
}, "Autopay
|
|
26335
|
+
extraStyles: "font-style: italic; font-size: .75rem;"
|
|
26336
|
+
}, "Autopay On")));
|
|
26332
26337
|
};
|
|
26333
26338
|
var FormattedBankAccount$1 = themeComponent(FormattedBankAccount, "FormattedBankAccount", fallbackValues$o);
|
|
26334
26339
|
|
|
@@ -26359,21 +26364,25 @@ var cardBrands = {
|
|
|
26359
26364
|
large: GenericCardLarge
|
|
26360
26365
|
}
|
|
26361
26366
|
};
|
|
26367
|
+
var normalizeType = function normalizeType(type) {
|
|
26368
|
+
if (!type) return undefined;
|
|
26369
|
+
var lower = type.toLowerCase();
|
|
26370
|
+
if (lower === "mastercard") return "master_card";
|
|
26371
|
+
return lower;
|
|
26372
|
+
};
|
|
26362
26373
|
var CardType = function CardType(_ref) {
|
|
26363
26374
|
var type = _ref.type,
|
|
26364
26375
|
_ref$size = _ref.size,
|
|
26365
26376
|
size = _ref$size === void 0 ? "small" : _ref$size;
|
|
26366
|
-
var
|
|
26377
|
+
var normalizedType = normalizeType(type);
|
|
26378
|
+
var _ref2 = cardBrands[normalizedType] || cardBrands["default"],
|
|
26367
26379
|
label = _ref2.label,
|
|
26368
26380
|
IconComponent = _ref2[size];
|
|
26369
|
-
return /*#__PURE__*/React__default.createElement("span",
|
|
26370
|
-
role: "img",
|
|
26371
|
-
"aria-label": label
|
|
26372
|
-
}, /*#__PURE__*/React__default.createElement(IconComponent, null));
|
|
26381
|
+
return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(IconComponent, null));
|
|
26373
26382
|
};
|
|
26374
26383
|
|
|
26375
26384
|
var textColor$2 = "".concat(CHARADE_GREY);
|
|
26376
|
-
var autopayTextColor$1 = "".concat(
|
|
26385
|
+
var autopayTextColor$1 = "".concat(SEA_GREEN);
|
|
26377
26386
|
var fallbackValues$p = {
|
|
26378
26387
|
textColor: textColor$2,
|
|
26379
26388
|
autopayTextColor: autopayTextColor$1
|
|
@@ -26402,13 +26411,15 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
|
|
|
26402
26411
|
return /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26403
26412
|
as: as,
|
|
26404
26413
|
variant: "pXS",
|
|
26405
|
-
|
|
26414
|
+
fontSize: ".75rem",
|
|
26415
|
+
color: STORM_GREY,
|
|
26406
26416
|
extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
|
|
26407
26417
|
}, "Exp Date ", expireDate);
|
|
26408
26418
|
case EXPIRING_SOON:
|
|
26409
26419
|
return /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26410
26420
|
as: as,
|
|
26411
26421
|
variant: "pXS",
|
|
26422
|
+
fontSize: ".75rem",
|
|
26412
26423
|
color: FIRE_YELLOW,
|
|
26413
26424
|
extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
|
|
26414
26425
|
}, "Expiring Soon ", expireDate);
|
|
@@ -26416,7 +26427,8 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
|
|
|
26416
26427
|
return /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26417
26428
|
as: as,
|
|
26418
26429
|
variant: "pXS",
|
|
26419
|
-
|
|
26430
|
+
fontSize: ".75rem",
|
|
26431
|
+
color: STORM_GREY,
|
|
26420
26432
|
extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
|
|
26421
26433
|
}, "Expired");
|
|
26422
26434
|
}
|
|
@@ -26443,7 +26455,7 @@ var CreditCardWrapper = styled.div.withConfig({
|
|
|
26443
26455
|
var CCIconWrapper = styled.div.withConfig({
|
|
26444
26456
|
displayName: "FormattedCreditCard__CCIconWrapper",
|
|
26445
26457
|
componentId: "sc-s0ta5l-1"
|
|
26446
|
-
})(["margin-right:16px;width:
|
|
26458
|
+
})(["margin-right:16px;width:36px;height:auto;display:flex;"]);
|
|
26447
26459
|
var FormattedCreditCard = function FormattedCreditCard(_ref) {
|
|
26448
26460
|
var lastFour = _ref.lastFour,
|
|
26449
26461
|
type = _ref.type,
|
|
@@ -26451,23 +26463,26 @@ var FormattedCreditCard = function FormattedCreditCard(_ref) {
|
|
|
26451
26463
|
expireDate = _ref.expireDate,
|
|
26452
26464
|
expirationStatus = _ref.expirationStatus,
|
|
26453
26465
|
themeValues = _ref.themeValues;
|
|
26466
|
+
var _useContext = useContext(ThemeContext),
|
|
26467
|
+
isMobile = _useContext.isMobile;
|
|
26454
26468
|
return /*#__PURE__*/React__default.createElement(CreditCardWrapper, null, /*#__PURE__*/React__default.createElement(CCIconWrapper, null, /*#__PURE__*/React__default.createElement(CardType, {
|
|
26455
|
-
type: type
|
|
26469
|
+
type: type,
|
|
26470
|
+
size: isMobile ? "small" : "large"
|
|
26456
26471
|
})), /*#__PURE__*/React__default.createElement(Stack, {
|
|
26457
26472
|
childGap: "0"
|
|
26458
26473
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
26459
26474
|
padding: "0"
|
|
26460
26475
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26461
26476
|
variant: "p",
|
|
26462
|
-
padding: "0
|
|
26477
|
+
padding: "0",
|
|
26463
26478
|
color: themeValues.textColor,
|
|
26464
26479
|
textAlign: "left",
|
|
26465
26480
|
extraStyles: "display: inline-block;"
|
|
26466
26481
|
}, "Card ending in ".concat(lastFour)), expireDate && /*#__PURE__*/React__default.createElement(Fragment$1, null, renderCardStatus(expirationStatus, expireDate, "left", "p"))), autoPay && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26467
26482
|
variant: "p",
|
|
26468
26483
|
color: themeValues.autopayTextColor,
|
|
26469
|
-
extraStyles: "font-style: italic;"
|
|
26470
|
-
}, "Autopay
|
|
26484
|
+
extraStyles: "font-style: italic; font-size: .75rem;"
|
|
26485
|
+
}, "Autopay On")));
|
|
26471
26486
|
};
|
|
26472
26487
|
var FormattedCreditCard$1 = themeComponent(FormattedCreditCard, "FormattedCreditCard", fallbackValues$p);
|
|
26473
26488
|
|
|
@@ -40873,6 +40888,7 @@ var EditableList = function EditableList(_ref) {
|
|
|
40873
40888
|
_ref$canAdd = _ref.canAdd,
|
|
40874
40889
|
canAdd = _ref$canAdd === void 0 ? true : _ref$canAdd,
|
|
40875
40890
|
addItem = _ref.addItem,
|
|
40891
|
+
addItemDestination = _ref.addItemDestination,
|
|
40876
40892
|
removeItem = _ref.removeItem,
|
|
40877
40893
|
editItem = _ref.editItem,
|
|
40878
40894
|
itemName = _ref.itemName,
|
|
@@ -40980,6 +40996,8 @@ var EditableList = function EditableList(_ref) {
|
|
|
40980
40996
|
padding: items.length === 0 ? "0" : "1rem 0 0"
|
|
40981
40997
|
}, /*#__PURE__*/React__default.createElement(Placeholder$1, {
|
|
40982
40998
|
text: addText,
|
|
40999
|
+
isLink: !!addItemDestination,
|
|
41000
|
+
destination: addItemDestination,
|
|
40983
41001
|
action: addItem,
|
|
40984
41002
|
dataQa: "Add " + qaPrefix,
|
|
40985
41003
|
"aria-label": addText,
|
|
@@ -41150,7 +41168,7 @@ var EmailForm = function EmailForm(_ref) {
|
|
|
41150
41168
|
}, []);
|
|
41151
41169
|
}
|
|
41152
41170
|
useConditionallyAddValidator(isRequired, required, actions.fields.email.addValidator, actions.fields.email.removeValidator);
|
|
41153
|
-
var emailFieldErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "
|
|
41171
|
+
var emailFieldErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
|
|
41154
41172
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
41155
41173
|
variant: variant,
|
|
41156
41174
|
role: "form",
|
|
@@ -41242,7 +41260,7 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
|
|
|
41242
41260
|
};
|
|
41243
41261
|
}, []);
|
|
41244
41262
|
}
|
|
41245
|
-
var EmailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "
|
|
41263
|
+
var EmailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
|
|
41246
41264
|
return /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
41247
41265
|
labelTextWhenNoError: "Email address",
|
|
41248
41266
|
errorMessages: EmailErrorMessages,
|
|
@@ -45941,7 +45959,7 @@ var LoginForm = function LoginForm(_ref) {
|
|
|
45941
45959
|
};
|
|
45942
45960
|
}, []);
|
|
45943
45961
|
}
|
|
45944
|
-
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "
|
|
45962
|
+
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
|
|
45945
45963
|
var passwordErrorMessages = _defineProperty({}, required.error, "Password is required");
|
|
45946
45964
|
return /*#__PURE__*/React__default.createElement(FormInputColumn, {
|
|
45947
45965
|
role: "form",
|
|
@@ -48069,7 +48087,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
|
|
|
48069
48087
|
weight: themeValues.fontWeight,
|
|
48070
48088
|
hoverStyles: themeValues.modalLinkHoverFocus,
|
|
48071
48089
|
textDecoration: themeValues.modalLinkTextDecoration,
|
|
48072
|
-
extraStyles: "display: inline-block; width: fit-content; cursor: pointer",
|
|
48090
|
+
extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;",
|
|
48073
48091
|
role: "button" // This should always be a "button" since it opens a modal
|
|
48074
48092
|
,
|
|
48075
48093
|
className: "modal-trigger"
|
|
@@ -48908,10 +48926,10 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
|
|
|
48908
48926
|
componentId: "sc-1wtp6qc-0"
|
|
48909
48927
|
})(["height:", ";width:", ";", " transition:opacity 0.3s ease;"], function (_ref2) {
|
|
48910
48928
|
var isMobile = _ref2.isMobile;
|
|
48911
|
-
return isMobile ? "
|
|
48929
|
+
return isMobile ? "16px" : "24px";
|
|
48912
48930
|
}, function (_ref3) {
|
|
48913
48931
|
var isMobile = _ref3.isMobile;
|
|
48914
|
-
return isMobile ? "
|
|
48932
|
+
return isMobile ? "24px" : "36px";
|
|
48915
48933
|
}, function (_ref4) {
|
|
48916
48934
|
var fade = _ref4.fade;
|
|
48917
48935
|
return fade && "opacity: 0.4;";
|
|
@@ -48983,7 +49001,7 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
|
|
|
48983
49001
|
padding: section.titleIcon ? "0 0 0 8px" : "0"
|
|
48984
49002
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48985
49003
|
as: "label",
|
|
48986
|
-
htmlFor: "radio-
|
|
49004
|
+
htmlFor: "radio-".concat(idString(section)),
|
|
48987
49005
|
color: CHARADE_GREY
|
|
48988
49006
|
}, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48989
49007
|
id: "right-icons-".concat(idString(section)),
|
|
@@ -49314,7 +49332,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
49314
49332
|
}
|
|
49315
49333
|
var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), validName.error, "First name contains invalid characters");
|
|
49316
49334
|
var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), validName.error, "Last name contains invalid characters");
|
|
49317
|
-
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "
|
|
49335
|
+
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
|
|
49318
49336
|
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 (!@#$%^&*.?)");
|
|
49319
49337
|
var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
|
|
49320
49338
|
return /*#__PURE__*/React__default.createElement(FormInputColumn, {
|
|
@@ -51446,25 +51464,39 @@ var TurnstileWidget = /*#__PURE__*/forwardRef(function (_ref4, ref) {
|
|
|
51446
51464
|
}, error)));
|
|
51447
51465
|
});
|
|
51448
51466
|
|
|
51449
|
-
var
|
|
51467
|
+
var hoverColor$6 = ROYAL_BLUE;
|
|
51468
|
+
var activeColor$b = CONGRESS_BLUE;
|
|
51469
|
+
var linkColor$6 = ROYAL_BLUE_VIVID;
|
|
51470
|
+
var textColor$5 = CHARADE_GREY;
|
|
51450
51471
|
var fallbackValues$12 = {
|
|
51451
|
-
|
|
51452
|
-
|
|
51453
|
-
|
|
51454
|
-
|
|
51472
|
+
linkColor: linkColor$6,
|
|
51473
|
+
hoverColor: hoverColor$6,
|
|
51474
|
+
activeColor: activeColor$b,
|
|
51475
|
+
textColor: textColor$5
|
|
51455
51476
|
};
|
|
51477
|
+
|
|
51478
|
+
var TOOLTIP_THEME_SOURCE = "Popover";
|
|
51456
51479
|
var Tooltip = function Tooltip(_ref) {
|
|
51457
51480
|
var tooltipID = _ref.tooltipID,
|
|
51458
|
-
|
|
51459
|
-
|
|
51460
|
-
_ref$
|
|
51461
|
-
IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
|
|
51462
|
-
_ref$iconHelpText = _ref.iconHelpText,
|
|
51463
|
-
iconHelpText = _ref$iconHelpText === void 0 ? "Open the tooltip" : _ref$iconHelpText,
|
|
51481
|
+
children = _ref.children,
|
|
51482
|
+
_ref$hasCustomTrigger = _ref.hasCustomTrigger,
|
|
51483
|
+
hasCustomTrigger = _ref$hasCustomTrigger === void 0 ? false : _ref$hasCustomTrigger,
|
|
51464
51484
|
_ref$triggerText = _ref.triggerText,
|
|
51465
|
-
triggerText = _ref$triggerText === void 0 ? "
|
|
51466
|
-
_ref$
|
|
51467
|
-
|
|
51485
|
+
triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
|
|
51486
|
+
_ref$containerExtraSt = _ref.containerExtraStyles,
|
|
51487
|
+
containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
|
|
51488
|
+
_ref$triggerButtonVar = _ref.triggerButtonVariant,
|
|
51489
|
+
triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
|
|
51490
|
+
_ref$content = _ref.content,
|
|
51491
|
+
content = _ref$content === void 0 ? "" : _ref$content,
|
|
51492
|
+
_ref$contentExtraStyl = _ref.contentExtraStyles,
|
|
51493
|
+
contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
|
|
51494
|
+
_ref$minWidth = _ref.minWidth,
|
|
51495
|
+
minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
|
|
51496
|
+
_ref$maxWidth = _ref.maxWidth,
|
|
51497
|
+
maxWidth = _ref$maxWidth === void 0 ? "100%" : _ref$maxWidth,
|
|
51498
|
+
_ref$height = _ref.height,
|
|
51499
|
+
height = _ref$height === void 0 ? "auto" : _ref$height,
|
|
51468
51500
|
_ref$contentPosition = _ref.contentPosition,
|
|
51469
51501
|
contentPosition = _ref$contentPosition === void 0 ? {
|
|
51470
51502
|
top: "-110px",
|
|
@@ -51481,33 +51513,23 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
51481
51513
|
arrowBottom: "-8px",
|
|
51482
51514
|
arrowLeft: "auto"
|
|
51483
51515
|
} : _ref$arrowPosition,
|
|
51484
|
-
|
|
51485
|
-
|
|
51486
|
-
_ref$
|
|
51487
|
-
|
|
51488
|
-
|
|
51489
|
-
|
|
51490
|
-
_ref$containerExtraSt = _ref.containerExtraStyles,
|
|
51491
|
-
containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
|
|
51492
|
-
_ref$triggerExtraStyl = _ref.triggerExtraStyles,
|
|
51493
|
-
triggerExtraStyles = _ref$triggerExtraStyl === void 0 ? "" : _ref$triggerExtraStyl,
|
|
51494
|
-
_ref$triggerButtonVar = _ref.triggerButtonVariant,
|
|
51495
|
-
triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
|
|
51496
|
-
_ref$contentExtraStyl = _ref.contentExtraStyles,
|
|
51497
|
-
contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
|
|
51498
|
-
_ref$contentBackgroun = _ref.contentBackgroundColor,
|
|
51499
|
-
contentBackgroundColor = _ref$contentBackgroun === void 0 ? WHITE : _ref$contentBackgroun;
|
|
51516
|
+
customTriggerRole = _ref.customTriggerRole,
|
|
51517
|
+
_ref$backgroundColor = _ref.backgroundColor,
|
|
51518
|
+
backgroundColor = _ref$backgroundColor === void 0 ? WHITE : _ref$backgroundColor;
|
|
51519
|
+
/**
|
|
51520
|
+
* closeTimeoutRef is used internally to store a timer ID for delaying tooltip close. It will have a `.current` property (the timer ID) when the effect or event handlers set it.
|
|
51521
|
+
*/
|
|
51500
51522
|
var closeTimeoutRef = useRef(null);
|
|
51523
|
+
/**
|
|
51524
|
+
* containerRef is used to store a reference to the container element. It will have a `.current` property (the container element) when the effect or event handlers set it.
|
|
51525
|
+
*/
|
|
51526
|
+
var containerRef = useRef(null);
|
|
51501
51527
|
var _useState = useState(false),
|
|
51502
51528
|
_useState2 = _slicedToArray(_useState, 2),
|
|
51503
51529
|
tooltipOpen = _useState2[0],
|
|
51504
51530
|
setTooltipOpen = _useState2[1];
|
|
51505
51531
|
var themeContext = useContext(ThemeContext);
|
|
51506
51532
|
var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
|
|
51507
|
-
var borderColor = themeValues.borderColor,
|
|
51508
|
-
tooltipTriggerColor = themeValues.popoverTriggerColor,
|
|
51509
|
-
hoverColor = themeValues.hoverColor,
|
|
51510
|
-
activeColor = themeValues.activeColor;
|
|
51511
51533
|
var top = contentPosition.top,
|
|
51512
51534
|
right = contentPosition.right,
|
|
51513
51535
|
bottom = contentPosition.bottom,
|
|
@@ -51516,16 +51538,109 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
51516
51538
|
arrowRight = arrowPosition.arrowRight,
|
|
51517
51539
|
arrowBottom = arrowPosition.arrowBottom,
|
|
51518
51540
|
arrowLeft = arrowPosition.arrowLeft;
|
|
51519
|
-
var handleToggleTooltip = function handleToggleTooltip(
|
|
51520
|
-
if (tooltipOpen !==
|
|
51521
|
-
setTooltipOpen(
|
|
51541
|
+
var handleToggleTooltip = function handleToggleTooltip(desiredState) {
|
|
51542
|
+
if (tooltipOpen !== desiredState) {
|
|
51543
|
+
setTooltipOpen(desiredState);
|
|
51522
51544
|
}
|
|
51523
51545
|
};
|
|
51524
|
-
var
|
|
51546
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
51525
51547
|
if (e.key === "Escape") {
|
|
51526
51548
|
handleToggleTooltip(false);
|
|
51527
51549
|
}
|
|
51528
51550
|
};
|
|
51551
|
+
|
|
51552
|
+
/**
|
|
51553
|
+
* @function renderTrigger
|
|
51554
|
+
* Renders the tooltip trigger element.
|
|
51555
|
+
*
|
|
51556
|
+
* When `hasCustomTrigger` is true, the provided child element is cloned and
|
|
51557
|
+
* injected with the event handlers needed to control tooltip visibility:
|
|
51558
|
+
* - onFocus/onBlur: open and close for keyboard users
|
|
51559
|
+
* - onKeyDown: allows Escape to dismiss the tooltip
|
|
51560
|
+
* - onTouchStart: open on tap for touch/mobile users (onFocus is unreliable on touch)
|
|
51561
|
+
*
|
|
51562
|
+
* Mouse interactions (hover) are handled at the container level via
|
|
51563
|
+
* onMouseEnter/onMouseLeave, so they do not need to be injected here.
|
|
51564
|
+
*
|
|
51565
|
+
* Any existing event handlers on the child are preserved and called first,
|
|
51566
|
+
* so the child's own behavior is not overridden.
|
|
51567
|
+
*
|
|
51568
|
+
* When no custom trigger is provided, a default ButtonWithAction is rendered
|
|
51569
|
+
* using `triggerText` and `triggerButtonVariant`.
|
|
51570
|
+
*/
|
|
51571
|
+
var renderTrigger = function renderTrigger() {
|
|
51572
|
+
if (hasCustomTrigger && !children) {
|
|
51573
|
+
console.warn("Tooltip: children prop is required when hasCustomTrigger is true");
|
|
51574
|
+
}
|
|
51575
|
+
if (hasCustomTrigger && children) {
|
|
51576
|
+
var _child$props, _child$props$tabIndex, _child$props2, _child$props3, _child$props4;
|
|
51577
|
+
var child = React__default.Children.only(children);
|
|
51578
|
+
/**
|
|
51579
|
+
* Capture the child's existing handlers before overwriting
|
|
51580
|
+
*/
|
|
51581
|
+
var _ref2 = (_child$props = child.props) !== null && _child$props !== void 0 ? _child$props : {},
|
|
51582
|
+
childOnFocus = _ref2.onFocus,
|
|
51583
|
+
childOnBlur = _ref2.onBlur,
|
|
51584
|
+
childOnKeyDown = _ref2.onKeyDown,
|
|
51585
|
+
childOnTouchStart = _ref2.onTouchStart;
|
|
51586
|
+
|
|
51587
|
+
/**
|
|
51588
|
+
* Clone the child element and add the necessary event handlers
|
|
51589
|
+
*/
|
|
51590
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
51591
|
+
tabIndex: (_child$props$tabIndex = (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.tabIndex) !== null && _child$props$tabIndex !== void 0 ? _child$props$tabIndex : 0,
|
|
51592
|
+
ariaDescribedby: tooltipID,
|
|
51593
|
+
style: _objectSpread2({
|
|
51594
|
+
cursor: "pointer"
|
|
51595
|
+
}, (_child$props3 = child.props) === null || _child$props3 === void 0 ? void 0 : _child$props3.style),
|
|
51596
|
+
onFocus: function onFocus(e) {
|
|
51597
|
+
childOnFocus === null || childOnFocus === void 0 || childOnFocus(e);
|
|
51598
|
+
handleToggleTooltip(true);
|
|
51599
|
+
},
|
|
51600
|
+
onBlur: function onBlur(e) {
|
|
51601
|
+
childOnBlur === null || childOnBlur === void 0 || childOnBlur(e);
|
|
51602
|
+
handleToggleTooltip(false);
|
|
51603
|
+
},
|
|
51604
|
+
onKeyDown: function onKeyDown(e) {
|
|
51605
|
+
childOnKeyDown === null || childOnKeyDown === void 0 || childOnKeyDown(e);
|
|
51606
|
+
handleKeyDown(e);
|
|
51607
|
+
},
|
|
51608
|
+
onTouchStart: function onTouchStart(e) {
|
|
51609
|
+
childOnTouchStart === null || childOnTouchStart === void 0 || childOnTouchStart(e);
|
|
51610
|
+
handleToggleTooltip(true);
|
|
51611
|
+
},
|
|
51612
|
+
role: customTriggerRole || ((_child$props4 = child.props) === null || _child$props4 === void 0 ? void 0 : _child$props4.role),
|
|
51613
|
+
"aria-describedby": tooltipID,
|
|
51614
|
+
"data-qa": "tooltip-trigger-".concat(tooltipID)
|
|
51615
|
+
});
|
|
51616
|
+
} else {
|
|
51617
|
+
return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
51618
|
+
action: noop$1,
|
|
51619
|
+
onKeyDown: handleKeyDown,
|
|
51620
|
+
variant: triggerButtonVariant,
|
|
51621
|
+
text: triggerText,
|
|
51622
|
+
tabIndex: 0,
|
|
51623
|
+
ariaDescribedby: tooltipID,
|
|
51624
|
+
onFocus: function onFocus() {
|
|
51625
|
+
return handleToggleTooltip(true);
|
|
51626
|
+
},
|
|
51627
|
+
onBlur: function onBlur() {
|
|
51628
|
+
return handleToggleTooltip(false);
|
|
51629
|
+
},
|
|
51630
|
+
onTouchStart: function onTouchStart() {
|
|
51631
|
+
return handleToggleTooltip(true);
|
|
51632
|
+
},
|
|
51633
|
+
dataQa: "tooltip-trigger-".concat(tooltipID),
|
|
51634
|
+
extraStyles: "\n color: ".concat(themeValues.linkColor, ";\n &:hover { color: ").concat(themeValues.hoverColor, "; text-decoration: none;}\n &:active, &:focus { color: ").concat(themeValues.activeColor, ";text-decoration: none;}\n button, span, &:hover span { text-decoration: none; }\n ")
|
|
51635
|
+
});
|
|
51636
|
+
}
|
|
51637
|
+
};
|
|
51638
|
+
|
|
51639
|
+
/**
|
|
51640
|
+
* @function handleMouseEnter
|
|
51641
|
+
* Handles the mouse enter event for the tooltip container.
|
|
51642
|
+
* It clears any existing timeout and opens the tooltip.
|
|
51643
|
+
*/
|
|
51529
51644
|
var handleMouseEnter = function handleMouseEnter() {
|
|
51530
51645
|
if (closeTimeoutRef.current) {
|
|
51531
51646
|
clearTimeout(closeTimeoutRef.current);
|
|
@@ -51533,69 +51648,67 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
51533
51648
|
}
|
|
51534
51649
|
handleToggleTooltip(true);
|
|
51535
51650
|
};
|
|
51651
|
+
|
|
51652
|
+
/**
|
|
51653
|
+
* @function handleMouseLeave
|
|
51654
|
+
* Handles the mouse leave event for the tooltip container.
|
|
51655
|
+
* It sets a timeout to close the tooltip after 200ms.
|
|
51656
|
+
*/
|
|
51536
51657
|
var handleMouseLeave = function handleMouseLeave() {
|
|
51537
51658
|
closeTimeoutRef.current = setTimeout(function () {
|
|
51538
51659
|
handleToggleTooltip(false);
|
|
51539
|
-
},
|
|
51660
|
+
}, 200);
|
|
51540
51661
|
};
|
|
51662
|
+
|
|
51663
|
+
/**
|
|
51664
|
+
* Handles the touch start event for the tooltip container.
|
|
51665
|
+
* It closes the tooltip if the touch is outside the container.
|
|
51666
|
+
*/
|
|
51541
51667
|
useEffect$1(function () {
|
|
51542
|
-
|
|
51543
|
-
|
|
51544
|
-
|
|
51668
|
+
if (!tooltipOpen) return;
|
|
51669
|
+
var handleOutsideTouch = function handleOutsideTouch(e) {
|
|
51670
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
51671
|
+
setTooltipOpen(false);
|
|
51545
51672
|
}
|
|
51546
51673
|
};
|
|
51674
|
+
document.addEventListener("touchstart", handleOutsideTouch);
|
|
51675
|
+
return function () {
|
|
51676
|
+
return document.removeEventListener("touchstart", handleOutsideTouch);
|
|
51677
|
+
};
|
|
51678
|
+
}, [tooltipOpen]);
|
|
51679
|
+
|
|
51680
|
+
/**
|
|
51681
|
+
* Cleans up the timeout when the component unmounts.
|
|
51682
|
+
*/
|
|
51683
|
+
useEffect$1(function () {
|
|
51684
|
+
return function () {
|
|
51685
|
+
if (closeTimeoutRef !== null && closeTimeoutRef !== void 0 && closeTimeoutRef.current) clearTimeout(closeTimeoutRef.current);
|
|
51686
|
+
};
|
|
51547
51687
|
}, []);
|
|
51548
51688
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
51549
|
-
ref:
|
|
51689
|
+
ref: containerRef,
|
|
51550
51690
|
padding: "0",
|
|
51551
51691
|
extraStyles: "position: relative; ".concat(containerExtraStyles),
|
|
51552
|
-
onMouseEnter:
|
|
51553
|
-
|
|
51554
|
-
|
|
51555
|
-
|
|
51556
|
-
return handleMouseLeave();
|
|
51557
|
-
},
|
|
51558
|
-
"data-qa": "tooltip-container"
|
|
51559
|
-
}, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
51560
|
-
"aria-describedby": tooltipID,
|
|
51561
|
-
onKeyDown: handleKeyboardEvent,
|
|
51562
|
-
variant: triggerButtonVariant,
|
|
51563
|
-
onFocus: function onFocus() {
|
|
51564
|
-
return handleToggleTooltip(true);
|
|
51565
|
-
},
|
|
51566
|
-
onBlur: function onBlur() {
|
|
51567
|
-
return handleToggleTooltip(false);
|
|
51568
|
-
},
|
|
51569
|
-
onTouchStart: function onTouchStart() {
|
|
51570
|
-
return handleToggleTooltip(true);
|
|
51571
|
-
},
|
|
51572
|
-
"data-qa": "tooltip-trigger",
|
|
51573
|
-
contentOverride: true
|
|
51574
|
-
}, hasIconTrigger === true && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
|
|
51575
|
-
"aria-label": "Open tooltip"
|
|
51576
|
-
}, /*#__PURE__*/React__default.createElement(IconTrigger, {
|
|
51577
|
-
color: tooltipTriggerColor
|
|
51578
|
-
})), /*#__PURE__*/React__default.createElement(Box, {
|
|
51579
|
-
padding: "0",
|
|
51580
|
-
srOnly: true
|
|
51581
|
-
}, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), hasIconTrigger === false && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
51582
|
-
color: tooltipTriggerColor,
|
|
51583
|
-
extraStyles: "\n color: ".concat(tooltipTriggerColor, ";\n &:visited {\n color: ").concat(tooltipTriggerColor, ";\n }\n &:hover {\n color: ").concat(hoverColor, "; \n }\n &:active,\n &:focus {\n color: ").concat(activeColor, "; \n }\n ").concat(triggerExtraStyles, ";\n ")
|
|
51584
|
-
}, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
|
|
51692
|
+
onMouseEnter: handleMouseEnter,
|
|
51693
|
+
onMouseLeave: handleMouseLeave,
|
|
51694
|
+
"data-qa": "".concat(tooltipID, "-container")
|
|
51695
|
+
}, renderTrigger(), /*#__PURE__*/React__default.createElement(Box, {
|
|
51585
51696
|
role: "tooltip",
|
|
51586
51697
|
id: tooltipID,
|
|
51587
51698
|
"aria-hidden": !tooltipOpen,
|
|
51588
|
-
background:
|
|
51699
|
+
background: backgroundColor,
|
|
51589
51700
|
"data-qa": "tooltip-contents",
|
|
51590
|
-
extraStyles: "\n position: absolute;\n display: ".concat(tooltipOpen ? "block" : "none", ";\n top: ").concat(top, "
|
|
51701
|
+
extraStyles: "\n position: absolute;\n display: ".concat(tooltipOpen ? "block" : "none", ";\n top: ").concat(top, ";\n right: ").concat(right, ";\n bottom: ").concat(bottom, ";\n left: ").concat(left, ";\n height: ").concat(height, ";\n color: ").concat(themeValues.textColor, ";\n ").concat(contentExtraStyles, "\n "),
|
|
51591
51702
|
boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
|
|
51592
51703
|
border: "1px solid transparent",
|
|
51593
51704
|
borderRadius: "4px",
|
|
51594
51705
|
minWidth: minWidth,
|
|
51595
51706
|
maxWidth: maxWidth
|
|
51596
|
-
},
|
|
51707
|
+
}, typeof content === "string" && content !== "" ? /*#__PURE__*/React__default.createElement(Text$1, {
|
|
51708
|
+
color: themeValues.textColor
|
|
51709
|
+
}, content) : content !== undefined && content !== null ? content : null, /*#__PURE__*/React__default.createElement(Box, {
|
|
51597
51710
|
padding: "0",
|
|
51598
|
-
extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(
|
|
51711
|
+
extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(backgroundColor, arrowDirection, "8px"), ";\n filter: drop-shadow(2px 8px 14px black);\n bottom: ").concat(arrowBottom, ";\n right: ").concat(arrowRight, ";\n top: ").concat(arrowTop, ";\n left: ").concat(arrowLeft, ";\n ")
|
|
51599
51712
|
})));
|
|
51600
51713
|
};
|
|
51601
51714
|
|