@thecb/components 11.11.0-beta.4 → 11.11.0-beta.7

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.
Files changed (35) hide show
  1. package/README.md +8 -4
  2. package/dist/index.cjs.js +95 -67
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +95 -67
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/atoms/card-type/CardType.js +10 -2
  8. package/src/components/atoms/dropdown/Dropdown.js +2 -3
  9. package/src/components/atoms/dropdown/DropdownIcon.js +1 -0
  10. package/src/components/atoms/dropdown/DropdownIconV2.js +1 -0
  11. package/src/components/atoms/form-layouts/FormInput.js +9 -16
  12. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.js +2 -2
  13. package/src/components/atoms/formatted-bank-account/FormattedBankAccount.theme.js +2 -2
  14. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.js +12 -9
  15. package/src/components/atoms/formatted-credit-card/FormattedCreditCard.theme.js +2 -2
  16. package/src/components/atoms/icons/AmExSmallIcon.js +2 -0
  17. package/src/components/atoms/icons/DiscoverSmallIcon.js +2 -0
  18. package/src/components/atoms/icons/GenericCardLarge.js +1 -1
  19. package/src/components/atoms/icons/GenericSmallIcon.js +2 -0
  20. package/src/components/atoms/icons/MasterCardSmallIcon.js +2 -0
  21. package/src/components/atoms/icons/VisaSmallIcon.js +2 -0
  22. package/src/components/molecules/email-form/EmailForm.js +2 -1
  23. package/src/components/molecules/email-form/EmailForm.stories.js +210 -0
  24. package/src/components/molecules/forgot-password-form/ForgotPasswordForm.js +2 -1
  25. package/src/components/molecules/login-form/LoginForm.js +2 -1
  26. package/src/components/molecules/radio-section/InnerRadioSection.js +3 -3
  27. package/src/components/molecules/radio-section/RadioSection.stories.js +142 -0
  28. package/src/components/molecules/registration-form/RegistrationForm.js +2 -1
  29. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -1
  30. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +110 -0
  31. package/src/components/molecules/tooltip/Tooltip.js +28 -15
  32. package/src/components/molecules/tooltip/Tooltip.stories.js +5 -5
  33. package/src/components/molecules/tooltip/Tooltip.theme.js +10 -11
  34. package/src/components/molecules/tooltip/index.d.ts +1 -1
  35. 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": "Card Payment"
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",
@@ -22615,6 +22625,7 @@ var SortableTableHeading$1 = themeComponent(SortableTableHeading, "SortableTable
22615
22625
 
22616
22626
  var DropdownIcon = function DropdownIcon() {
22617
22627
  return /*#__PURE__*/React__default.createElement("svg", {
22628
+ "aria-hidden": "true",
22618
22629
  version: "1.2",
22619
22630
  xmlns: "http://www.w3.org/2000/svg",
22620
22631
  overflow: "visible",
@@ -23964,7 +23975,7 @@ var IconWrapper = styled.div.withConfig({
23964
23975
  var DropdownContentWrapper = styled.div.withConfig({
23965
23976
  displayName: "Dropdown__DropdownContentWrapper",
23966
23977
  componentId: "sc-pn6m0h-1"
23967
- })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], GREY_CHATEAU, WHITE, function (_ref2) {
23978
+ })(["transform-origin:0 0;border:1px solid ", ";border-radius:2px;background-color:", ";padding:8px 0 8px;position:absolute;width:", ";min-width:100%;max-height:", ";overflow-y:scroll;z-index:1;box-sizing:border-box;&:focus{outline:none;}ul{padding-left:0;}"], STORM_GREY, WHITE, function (_ref2) {
23968
23979
  var widthFitOptions = _ref2.widthFitOptions;
23969
23980
  return widthFitOptions ? "fit-content" : "100%";
23970
23981
  }, function (_ref3) {
@@ -24269,7 +24280,7 @@ var Dropdown = function Dropdown(_ref13) {
24269
24280
  background: isOpen ? themeValues.hoverColor : WHITE,
24270
24281
  borderRadius: "2px",
24271
24282
  borderSize: "1px",
24272
- borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
24283
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : STORM_GREY,
24273
24284
  dataQa: placeholder,
24274
24285
  extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
24275
24286
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
@@ -25927,7 +25938,8 @@ var FormInput = function FormInput(_ref15) {
25927
25938
  minWidth: "100%"
25928
25939
  }, /*#__PURE__*/React__default.createElement(Cluster, {
25929
25940
  justify: "space-between",
25930
- align: "center"
25941
+ align: "center",
25942
+ overflow: true
25931
25943
  }, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
25932
25944
  as: "label",
25933
25945
  color: themeValues.labelColor,
@@ -25935,22 +25947,16 @@ var FormInput = function FormInput(_ref15) {
25935
25947
  fontWeight: themeValues.fontWeight,
25936
25948
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
25937
25949
  id: createIdFromString(labelTextWhenNoError)
25938
- }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(Text$1, {
25939
- variant: labelTextVariant,
25940
- color: themeValues.linkColor,
25941
- weight: themeValues.fontWeight,
25942
- hoverStyles: themeValues.hoverFocusStyles,
25943
- extraStyles: "text-decoration: underline; cursor: pointer; &:focus { outline-offset: -2px; }",
25944
- onClick: function onClick() {
25950
+ }, labelTextWhenNoError), type === "password" && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
25951
+ variant: "smallGhost",
25952
+ text: showPassword ? "Hide" : "Show",
25953
+ action: function action() {
25945
25954
  return setShowPassword(!showPassword);
25946
25955
  },
25947
- tabIndex: "0",
25948
25956
  "aria-label": showPassword ? "Hide Password" : "Show password",
25949
- "aria-live": "polite",
25950
- onKeyPress: function onKeyPress(e) {
25951
- return e.key === "Enter" && setShowPassword(!showPassword);
25952
- }
25953
- }, 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, {
25954
25960
  padding: "0 0 0 auto"
25955
25961
  }, decorator)))), /*#__PURE__*/React__default.createElement(Box, {
25956
25962
  padding: "0"
@@ -26290,7 +26296,7 @@ var FormattedAddress = function FormattedAddress(_ref) {
26290
26296
  var FormattedAddress$1 = themeComponent(FormattedAddress, "FormattedAddress", fallbackValues$n, "default");
26291
26297
 
26292
26298
  var textColor$1 = "".concat(CHARADE_GREY);
26293
- var autopayTextColor = "".concat(REGENT_GREY);
26299
+ var autopayTextColor = "".concat(SEA_GREEN);
26294
26300
  var fallbackValues$o = {
26295
26301
  textColor: textColor$1,
26296
26302
  autopayTextColor: autopayTextColor
@@ -26326,8 +26332,8 @@ var FormattedBankAccount = function FormattedBankAccount(_ref2) {
26326
26332
  }, "Savings Account ending in ", lastFour), autoPay && /*#__PURE__*/React__default.createElement(Text$1, {
26327
26333
  variant: "p",
26328
26334
  color: themeValues.autopayTextColor,
26329
- extraStyles: "font-style: italic;"
26330
- }, "Autopay Enabled")));
26335
+ extraStyles: "font-style: italic; font-size: .75rem;"
26336
+ }, "Autopay On")));
26331
26337
  };
26332
26338
  var FormattedBankAccount$1 = themeComponent(FormattedBankAccount, "FormattedBankAccount", fallbackValues$o);
26333
26339
 
@@ -26358,21 +26364,25 @@ var cardBrands = {
26358
26364
  large: GenericCardLarge
26359
26365
  }
26360
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
+ };
26361
26373
  var CardType = function CardType(_ref) {
26362
26374
  var type = _ref.type,
26363
26375
  _ref$size = _ref.size,
26364
26376
  size = _ref$size === void 0 ? "small" : _ref$size;
26365
- var _ref2 = cardBrands[type] || cardBrands["default"],
26377
+ var normalizedType = normalizeType(type);
26378
+ var _ref2 = cardBrands[normalizedType] || cardBrands["default"],
26366
26379
  label = _ref2.label,
26367
26380
  IconComponent = _ref2[size];
26368
- return /*#__PURE__*/React__default.createElement("span", {
26369
- role: "img",
26370
- "aria-label": label
26371
- }, /*#__PURE__*/React__default.createElement(IconComponent, null));
26381
+ return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(IconComponent, null));
26372
26382
  };
26373
26383
 
26374
26384
  var textColor$2 = "".concat(CHARADE_GREY);
26375
- var autopayTextColor$1 = "".concat(REGENT_GREY);
26385
+ var autopayTextColor$1 = "".concat(SEA_GREEN);
26376
26386
  var fallbackValues$p = {
26377
26387
  textColor: textColor$2,
26378
26388
  autopayTextColor: autopayTextColor$1
@@ -26401,13 +26411,15 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
26401
26411
  return /*#__PURE__*/React__default.createElement(Text$1, {
26402
26412
  as: as,
26403
26413
  variant: "pXS",
26404
- color: ASH_GREY,
26414
+ fontSize: ".75rem",
26415
+ color: STORM_GREY,
26405
26416
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26406
26417
  }, "Exp Date ", expireDate);
26407
26418
  case EXPIRING_SOON:
26408
26419
  return /*#__PURE__*/React__default.createElement(Text$1, {
26409
26420
  as: as,
26410
26421
  variant: "pXS",
26422
+ fontSize: ".75rem",
26411
26423
  color: FIRE_YELLOW,
26412
26424
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26413
26425
  }, "Expiring Soon ", expireDate);
@@ -26415,7 +26427,8 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
26415
26427
  return /*#__PURE__*/React__default.createElement(Text$1, {
26416
26428
  as: as,
26417
26429
  variant: "pXS",
26418
- color: ASH_GREY,
26430
+ fontSize: ".75rem",
26431
+ color: STORM_GREY,
26419
26432
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26420
26433
  }, "Expired");
26421
26434
  }
@@ -26442,7 +26455,7 @@ var CreditCardWrapper = styled.div.withConfig({
26442
26455
  var CCIconWrapper = styled.div.withConfig({
26443
26456
  displayName: "FormattedCreditCard__CCIconWrapper",
26444
26457
  componentId: "sc-s0ta5l-1"
26445
- })(["margin-right:16px;width:30px;height:auto;display:flex;"]);
26458
+ })(["margin-right:16px;width:36px;height:auto;display:flex;"]);
26446
26459
  var FormattedCreditCard = function FormattedCreditCard(_ref) {
26447
26460
  var lastFour = _ref.lastFour,
26448
26461
  type = _ref.type,
@@ -26450,23 +26463,26 @@ var FormattedCreditCard = function FormattedCreditCard(_ref) {
26450
26463
  expireDate = _ref.expireDate,
26451
26464
  expirationStatus = _ref.expirationStatus,
26452
26465
  themeValues = _ref.themeValues;
26466
+ var _useContext = useContext(ThemeContext),
26467
+ isMobile = _useContext.isMobile;
26453
26468
  return /*#__PURE__*/React__default.createElement(CreditCardWrapper, null, /*#__PURE__*/React__default.createElement(CCIconWrapper, null, /*#__PURE__*/React__default.createElement(CardType, {
26454
- type: type
26469
+ type: type,
26470
+ size: isMobile ? "small" : "large"
26455
26471
  })), /*#__PURE__*/React__default.createElement(Stack, {
26456
26472
  childGap: "0"
26457
26473
  }, /*#__PURE__*/React__default.createElement(Box, {
26458
26474
  padding: "0"
26459
26475
  }, /*#__PURE__*/React__default.createElement(Text$1, {
26460
26476
  variant: "p",
26461
- padding: "0 0 0 8px",
26477
+ padding: "0",
26462
26478
  color: themeValues.textColor,
26463
26479
  textAlign: "left",
26464
26480
  extraStyles: "display: inline-block;"
26465
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, {
26466
26482
  variant: "p",
26467
26483
  color: themeValues.autopayTextColor,
26468
- extraStyles: "font-style: italic;"
26469
- }, "Autopay Enabled")));
26484
+ extraStyles: "font-style: italic; font-size: .75rem;"
26485
+ }, "Autopay On")));
26470
26486
  };
26471
26487
  var FormattedCreditCard$1 = themeComponent(FormattedCreditCard, "FormattedCreditCard", fallbackValues$p);
26472
26488
 
@@ -41149,7 +41165,7 @@ var EmailForm = function EmailForm(_ref) {
41149
41165
  }, []);
41150
41166
  }
41151
41167
  useConditionallyAddValidator(isRequired, required, actions.fields.email.addValidator, actions.fields.email.removeValidator);
41152
- var emailFieldErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Invalid email address");
41168
+ var emailFieldErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
41153
41169
  return /*#__PURE__*/React__default.createElement(FormContainer$1, {
41154
41170
  variant: variant,
41155
41171
  role: "form",
@@ -41241,7 +41257,7 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
41241
41257
  };
41242
41258
  }, []);
41243
41259
  }
41244
- var EmailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Email address is not valid");
41260
+ var EmailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
41245
41261
  return /*#__PURE__*/React__default.createElement(FormInput$1, {
41246
41262
  labelTextWhenNoError: "Email address",
41247
41263
  errorMessages: EmailErrorMessages,
@@ -45940,7 +45956,7 @@ var LoginForm = function LoginForm(_ref) {
45940
45956
  };
45941
45957
  }, []);
45942
45958
  }
45943
- var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Invalid email address");
45959
+ var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email address is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
45944
45960
  var passwordErrorMessages = _defineProperty({}, required.error, "Password is required");
45945
45961
  return /*#__PURE__*/React__default.createElement(FormInputColumn, {
45946
45962
  role: "form",
@@ -48068,7 +48084,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48068
48084
  weight: themeValues.fontWeight,
48069
48085
  hoverStyles: themeValues.modalLinkHoverFocus,
48070
48086
  textDecoration: themeValues.modalLinkTextDecoration,
48071
- extraStyles: "display: inline-block; width: fit-content; cursor: pointer",
48087
+ extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;",
48072
48088
  role: "button" // This should always be a "button" since it opens a modal
48073
48089
  ,
48074
48090
  className: "modal-trigger"
@@ -48907,10 +48923,10 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
48907
48923
  componentId: "sc-1wtp6qc-0"
48908
48924
  })(["height:", ";width:", ";", " transition:opacity 0.3s ease;"], function (_ref2) {
48909
48925
  var isMobile = _ref2.isMobile;
48910
- return isMobile ? "14px" : "18px";
48926
+ return isMobile ? "16px" : "24px";
48911
48927
  }, function (_ref3) {
48912
48928
  var isMobile = _ref3.isMobile;
48913
- return isMobile ? "22px" : "28px";
48929
+ return isMobile ? "24px" : "36px";
48914
48930
  }, function (_ref4) {
48915
48931
  var fade = _ref4.fade;
48916
48932
  return fade && "opacity: 0.4;";
@@ -48982,7 +48998,7 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
48982
48998
  padding: section.titleIcon ? "0 0 0 8px" : "0"
48983
48999
  }, /*#__PURE__*/React__default.createElement(Text$1, {
48984
49000
  as: "label",
48985
- htmlFor: "radio-input-".concat(idString(section)),
49001
+ htmlFor: "radio-".concat(idString(section)),
48986
49002
  color: CHARADE_GREY
48987
49003
  }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48988
49004
  id: "right-icons-".concat(idString(section)),
@@ -49313,7 +49329,7 @@ var RegistrationForm = function RegistrationForm(_ref) {
49313
49329
  }
49314
49330
  var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), validName.error, "First name contains invalid characters");
49315
49331
  var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), validName.error, "Last name contains invalid characters");
49316
- var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Invalid email address");
49332
+ var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Please enter a valid email address in the format user@example.com");
49317
49333
  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 (!@#$%^&*.?)");
49318
49334
  var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
49319
49335
  return /*#__PURE__*/React__default.createElement(FormInputColumn, {
@@ -50262,6 +50278,7 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
50262
50278
  color = _ref$color === void 0 ? "#292A33" : _ref$color,
50263
50279
  props = _objectWithoutProperties(_ref, _excluded$Q);
50264
50280
  return /*#__PURE__*/React__default.createElement("svg", _extends({
50281
+ "aria-hidden": "true",
50265
50282
  width: width,
50266
50283
  height: height,
50267
50284
  viewBox: "0 0 ".concat(width, " ").concat(height),
@@ -51444,16 +51461,15 @@ var TurnstileWidget = /*#__PURE__*/forwardRef(function (_ref4, ref) {
51444
51461
  }, error)));
51445
51462
  });
51446
51463
 
51447
- var hoverColor$6 = SAPPHIRE_BLUE;
51448
- var activeColor$b = PEACOCK_BLUE;
51449
- var linkColor$6 = MATISSE_BLUE;
51450
- var borderColor$7 = "rgba(255, 255, 255, 0.85)";
51451
- var TOOLTIP_THEME_SOURCE = "Button";
51464
+ var hoverColor$6 = ROYAL_BLUE;
51465
+ var activeColor$b = CONGRESS_BLUE;
51466
+ var linkColor$6 = ROYAL_BLUE_VIVID;
51467
+ var textColor$5 = CHARADE_GREY;
51452
51468
  var fallbackValues$12 = {
51453
- borderColor: borderColor$7,
51454
51469
  linkColor: linkColor$6,
51455
51470
  hoverColor: hoverColor$6,
51456
- activeColor: activeColor$b
51471
+ activeColor: activeColor$b,
51472
+ textColor: textColor$5
51457
51473
  };
51458
51474
 
51459
51475
  var Tooltip = function Tooltip(_ref) {
@@ -51493,14 +51509,15 @@ var Tooltip = function Tooltip(_ref) {
51493
51509
  arrowBottom: "-8px",
51494
51510
  arrowLeft: "auto"
51495
51511
  } : _ref$arrowPosition,
51496
- arrowColor = _ref.arrowColor;
51512
+ _ref$backgroundColor = _ref.backgroundColor,
51513
+ backgroundColor = _ref$backgroundColor === void 0 ? WHITE : _ref$backgroundColor;
51497
51514
  var closeTimeoutRef = useRef(null);
51498
51515
  var _useState = useState(false),
51499
51516
  _useState2 = _slicedToArray(_useState, 2),
51500
51517
  tooltipOpen = _useState2[0],
51501
51518
  setTooltipOpen = _useState2[1];
51502
51519
  var themeContext = useContext(ThemeContext);
51503
- var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
51520
+ var themeValues = createThemeValues(themeContext, fallbackValues$12, "Tooltip");
51504
51521
  var top = contentPosition.top,
51505
51522
  right = contentPosition.right,
51506
51523
  bottom = contentPosition.bottom,
@@ -51540,19 +51557,30 @@ var Tooltip = function Tooltip(_ref) {
51540
51557
  }, []);
51541
51558
  var renderTrigger = function renderTrigger() {
51542
51559
  if (hasCustomTrigger && children) {
51543
- return /*#__PURE__*/React__default.cloneElement(React__default.Children.only(children), {
51560
+ var _child$props, _child$props2;
51561
+ var child = React__default.Children.only(children);
51562
+ var _ref2 = (_child$props = child.props) !== null && _child$props !== void 0 ? _child$props : {},
51563
+ childOnFocus = _ref2.onFocus,
51564
+ childOnBlur = _ref2.onBlur,
51565
+ childOnKeyDown = _ref2.onKeyDown;
51566
+ return /*#__PURE__*/React__default.cloneElement(child, {
51544
51567
  "aria-describedby": tooltipID,
51545
- onFocus: function onFocus() {
51546
- return handleToggleTooltip(true);
51568
+ onFocus: function onFocus(e) {
51569
+ childOnFocus === null || childOnFocus === void 0 || childOnFocus(e);
51570
+ handleToggleTooltip(true);
51547
51571
  },
51548
- onBlur: function onBlur() {
51549
- return handleToggleTooltip(false);
51572
+ onBlur: function onBlur(e) {
51573
+ childOnBlur === null || childOnBlur === void 0 || childOnBlur(e);
51574
+ handleToggleTooltip(false);
51575
+ },
51576
+ onKeyDown: function onKeyDown(e) {
51577
+ childOnKeyDown === null || childOnKeyDown === void 0 || childOnKeyDown(e);
51578
+ handleKeyDown(e);
51550
51579
  },
51551
- onKeyDown: handleKeyDown,
51552
51580
  tabIndex: "0",
51553
- style: {
51581
+ style: _objectSpread2(_objectSpread2({}, (_child$props2 = child.props) === null || _child$props2 === void 0 ? void 0 : _child$props2.style), {}, {
51554
51582
  cursor: "pointer"
51555
- }
51583
+ })
51556
51584
  });
51557
51585
  }
51558
51586
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
@@ -51585,19 +51613,19 @@ var Tooltip = function Tooltip(_ref) {
51585
51613
  role: "tooltip",
51586
51614
  id: tooltipID,
51587
51615
  "aria-hidden": !tooltipOpen,
51588
- background: themeValues.borderColor,
51616
+ background: backgroundColor,
51589
51617
  "data-qa": "tooltip-contents",
51590
- 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 ").concat(contentExtraStyles, "\n "),
51618
+ 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
51619
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
51592
51620
  border: "1px solid transparent",
51593
51621
  borderRadius: "4px",
51594
51622
  minWidth: minWidth,
51595
51623
  maxWidth: maxWidth
51596
51624
  }, typeof content === "string" ? /*#__PURE__*/React__default.createElement(Text$1, {
51597
- color: themeValues.linkColor
51625
+ color: themeValues.textColor
51598
51626
  }, content) : content, /*#__PURE__*/React__default.createElement(Box, {
51599
51627
  padding: "0",
51600
- extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(arrowColor || themeValues.borderColor, 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 ")
51628
+ 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 ")
51601
51629
  })));
51602
51630
  };
51603
51631