@thecb/components 11.10.1-beta.2 → 11.10.2-beta.2

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 (28) hide show
  1. package/README.md +8 -4
  2. package/dist/index.cjs.js +126 -102
  3. package/dist/index.cjs.js.map +1 -1
  4. package/dist/index.esm.js +126 -102
  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 +1 -1
  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/radio-section/InnerRadioSection.js +2 -2
  23. package/src/components/molecules/tooltip/Tooltip.js +93 -65
  24. package/src/components/molecules/tooltip/Tooltip.mdx +2 -12
  25. package/src/components/molecules/tooltip/Tooltip.stories.js +71 -93
  26. package/src/components/molecules/tooltip/Tooltip.theme.js +5 -15
  27. package/src/components/molecules/tooltip/index.d.ts +7 -4
  28. 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, ";"),
@@ -25913,7 +25924,8 @@ var FormInput = function FormInput(_ref15) {
25913
25924
  padding: "0"
25914
25925
  }, helperModal ? /*#__PURE__*/React__default.createElement(Cluster, {
25915
25926
  justify: "space-between",
25916
- align: "center"
25927
+ align: "center",
25928
+ overflow: true
25917
25929
  }, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
25918
25930
  as: "label",
25919
25931
  color: themeValues.labelColor,
@@ -26289,7 +26301,7 @@ var FormattedAddress = function FormattedAddress(_ref) {
26289
26301
  var FormattedAddress$1 = themeComponent(FormattedAddress, "FormattedAddress", fallbackValues$n, "default");
26290
26302
 
26291
26303
  var textColor$1 = "".concat(CHARADE_GREY);
26292
- var autopayTextColor = "".concat(REGENT_GREY);
26304
+ var autopayTextColor = "".concat(SEA_GREEN);
26293
26305
  var fallbackValues$o = {
26294
26306
  textColor: textColor$1,
26295
26307
  autopayTextColor: autopayTextColor
@@ -26325,8 +26337,8 @@ var FormattedBankAccount = function FormattedBankAccount(_ref2) {
26325
26337
  }, "Savings Account ending in ", lastFour), autoPay && /*#__PURE__*/React__default.createElement(Text$1, {
26326
26338
  variant: "p",
26327
26339
  color: themeValues.autopayTextColor,
26328
- extraStyles: "font-style: italic;"
26329
- }, "Autopay Enabled")));
26340
+ extraStyles: "font-style: italic; font-size: .75rem;"
26341
+ }, "Autopay On")));
26330
26342
  };
26331
26343
  var FormattedBankAccount$1 = themeComponent(FormattedBankAccount, "FormattedBankAccount", fallbackValues$o);
26332
26344
 
@@ -26357,21 +26369,25 @@ var cardBrands = {
26357
26369
  large: GenericCardLarge
26358
26370
  }
26359
26371
  };
26372
+ var normalizeType = function normalizeType(type) {
26373
+ if (!type) return undefined;
26374
+ var lower = type.toLowerCase();
26375
+ if (lower === "mastercard") return "master_card";
26376
+ return lower;
26377
+ };
26360
26378
  var CardType = function CardType(_ref) {
26361
26379
  var type = _ref.type,
26362
26380
  _ref$size = _ref.size,
26363
26381
  size = _ref$size === void 0 ? "small" : _ref$size;
26364
- var _ref2 = cardBrands[type] || cardBrands["default"],
26382
+ var normalizedType = normalizeType(type);
26383
+ var _ref2 = cardBrands[normalizedType] || cardBrands["default"],
26365
26384
  label = _ref2.label,
26366
26385
  IconComponent = _ref2[size];
26367
- return /*#__PURE__*/React__default.createElement("span", {
26368
- role: "img",
26369
- "aria-label": label
26370
- }, /*#__PURE__*/React__default.createElement(IconComponent, null));
26386
+ return /*#__PURE__*/React__default.createElement("span", null, /*#__PURE__*/React__default.createElement(IconComponent, null));
26371
26387
  };
26372
26388
 
26373
26389
  var textColor$2 = "".concat(CHARADE_GREY);
26374
- var autopayTextColor$1 = "".concat(REGENT_GREY);
26390
+ var autopayTextColor$1 = "".concat(SEA_GREEN);
26375
26391
  var fallbackValues$p = {
26376
26392
  textColor: textColor$2,
26377
26393
  autopayTextColor: autopayTextColor$1
@@ -26400,13 +26416,15 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
26400
26416
  return /*#__PURE__*/React__default.createElement(Text$1, {
26401
26417
  as: as,
26402
26418
  variant: "pXS",
26403
- color: ASH_GREY,
26419
+ fontSize: ".75rem",
26420
+ color: STORM_GREY,
26404
26421
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26405
26422
  }, "Exp Date ", expireDate);
26406
26423
  case EXPIRING_SOON:
26407
26424
  return /*#__PURE__*/React__default.createElement(Text$1, {
26408
26425
  as: as,
26409
26426
  variant: "pXS",
26427
+ fontSize: ".75rem",
26410
26428
  color: FIRE_YELLOW,
26411
26429
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26412
26430
  }, "Expiring Soon ", expireDate);
@@ -26414,7 +26432,8 @@ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
26414
26432
  return /*#__PURE__*/React__default.createElement(Text$1, {
26415
26433
  as: as,
26416
26434
  variant: "pXS",
26417
- color: ASH_GREY,
26435
+ fontSize: ".75rem",
26436
+ color: STORM_GREY,
26418
26437
  extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26419
26438
  }, "Expired");
26420
26439
  }
@@ -26441,7 +26460,7 @@ var CreditCardWrapper = styled.div.withConfig({
26441
26460
  var CCIconWrapper = styled.div.withConfig({
26442
26461
  displayName: "FormattedCreditCard__CCIconWrapper",
26443
26462
  componentId: "sc-s0ta5l-1"
26444
- })(["margin-right:16px;width:30px;height:auto;display:flex;"]);
26463
+ })(["margin-right:16px;width:36px;height:auto;display:flex;"]);
26445
26464
  var FormattedCreditCard = function FormattedCreditCard(_ref) {
26446
26465
  var lastFour = _ref.lastFour,
26447
26466
  type = _ref.type,
@@ -26449,23 +26468,26 @@ var FormattedCreditCard = function FormattedCreditCard(_ref) {
26449
26468
  expireDate = _ref.expireDate,
26450
26469
  expirationStatus = _ref.expirationStatus,
26451
26470
  themeValues = _ref.themeValues;
26471
+ var _useContext = useContext(ThemeContext),
26472
+ isMobile = _useContext.isMobile;
26452
26473
  return /*#__PURE__*/React__default.createElement(CreditCardWrapper, null, /*#__PURE__*/React__default.createElement(CCIconWrapper, null, /*#__PURE__*/React__default.createElement(CardType, {
26453
- type: type
26474
+ type: type,
26475
+ size: isMobile ? "small" : "large"
26454
26476
  })), /*#__PURE__*/React__default.createElement(Stack, {
26455
26477
  childGap: "0"
26456
26478
  }, /*#__PURE__*/React__default.createElement(Box, {
26457
26479
  padding: "0"
26458
26480
  }, /*#__PURE__*/React__default.createElement(Text$1, {
26459
26481
  variant: "p",
26460
- padding: "0 0 0 8px",
26482
+ padding: "0",
26461
26483
  color: themeValues.textColor,
26462
26484
  textAlign: "left",
26463
26485
  extraStyles: "display: inline-block;"
26464
26486
  }, "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, {
26465
26487
  variant: "p",
26466
26488
  color: themeValues.autopayTextColor,
26467
- extraStyles: "font-style: italic;"
26468
- }, "Autopay Enabled")));
26489
+ extraStyles: "font-style: italic; font-size: .75rem;"
26490
+ }, "Autopay On")));
26469
26491
  };
26470
26492
  var FormattedCreditCard$1 = themeComponent(FormattedCreditCard, "FormattedCreditCard", fallbackValues$p);
26471
26493
 
@@ -48906,10 +48928,10 @@ var InnerRadioSection = function InnerRadioSection(_ref) {
48906
48928
  componentId: "sc-1wtp6qc-0"
48907
48929
  })(["height:", ";width:", ";", " transition:opacity 0.3s ease;"], function (_ref2) {
48908
48930
  var isMobile = _ref2.isMobile;
48909
- return isMobile ? "14px" : "18px";
48931
+ return isMobile ? "16px" : "24px";
48910
48932
  }, function (_ref3) {
48911
48933
  var isMobile = _ref3.isMobile;
48912
- return isMobile ? "22px" : "28px";
48934
+ return isMobile ? "24px" : "36px";
48913
48935
  }, function (_ref4) {
48914
48936
  var fade = _ref4.fade;
48915
48937
  return fade && "opacity: 0.4;";
@@ -50261,6 +50283,7 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
50261
50283
  color = _ref$color === void 0 ? "#292A33" : _ref$color,
50262
50284
  props = _objectWithoutProperties(_ref, _excluded$Q);
50263
50285
  return /*#__PURE__*/React__default.createElement("svg", _extends({
50286
+ "aria-hidden": "true",
50264
50287
  width: width,
50265
50288
  height: height,
50266
50289
  viewBox: "0 0 ".concat(width, " ").concat(height),
@@ -51443,39 +51466,25 @@ var TurnstileWidget = /*#__PURE__*/forwardRef(function (_ref4, ref) {
51443
51466
  }, error)));
51444
51467
  });
51445
51468
 
51446
- var hoverColor$6 = SAPPHIRE_BLUE;
51447
- var activeColor$b = PEACOCK_BLUE;
51448
- var linkColor$6 = MATISSE_BLUE;
51449
- var borderColor$7 = "rgba(255, 255, 255, 0.85)";
51450
- var TOOLTIP_THEME_SOURCE = "Button";
51469
+ var TOOLTIP_THEME_SOURCE = "Popover";
51451
51470
  var fallbackValues$12 = {
51452
- borderColor: borderColor$7,
51453
- linkColor: linkColor$6,
51454
- hoverColor: hoverColor$6,
51455
- activeColor: activeColor$b
51471
+ hoverColor: SAPPHIRE_BLUE,
51472
+ activeColor: PEACOCK_BLUE,
51473
+ popoverTriggerColor: MATISSE_BLUE,
51474
+ borderColor: "rgba(255, 255, 255, 0.85)"
51456
51475
  };
51457
-
51458
51476
  var Tooltip = function Tooltip(_ref) {
51459
51477
  var tooltipID = _ref.tooltipID,
51460
- children = _ref.children,
51461
- _ref$hasCustomTrigger = _ref.hasCustomTrigger,
51462
- hasCustomTrigger = _ref$hasCustomTrigger === void 0 ? false : _ref$hasCustomTrigger,
51478
+ _ref$hasIconTrigger = _ref.hasIconTrigger,
51479
+ hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51480
+ _ref$IconTrigger = _ref.IconTrigger,
51481
+ IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51482
+ _ref$iconHelpText = _ref.iconHelpText,
51483
+ iconHelpText = _ref$iconHelpText === void 0 ? "Open the tooltip" : _ref$iconHelpText,
51463
51484
  _ref$triggerText = _ref.triggerText,
51464
- triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
51465
- _ref$containerExtraSt = _ref.containerExtraStyles,
51466
- containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
51467
- _ref$triggerButtonVar = _ref.triggerButtonVariant,
51468
- triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
51469
- _ref$content = _ref.content,
51470
- content = _ref$content === void 0 ? "" : _ref$content,
51471
- _ref$contentExtraStyl = _ref.contentExtraStyles,
51472
- contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51473
- _ref$minWidth = _ref.minWidth,
51474
- minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51475
- _ref$maxWidth = _ref.maxWidth,
51476
- maxWidth = _ref$maxWidth === void 0 ? "100%" : _ref$maxWidth,
51477
- _ref$height = _ref.height,
51478
- height = _ref$height === void 0 ? "auto" : _ref$height,
51485
+ triggerText = _ref$triggerText === void 0 ? "Open the tooltip" : _ref$triggerText,
51486
+ _ref$tooltipContent = _ref.tooltipContent,
51487
+ tooltipContent = _ref$tooltipContent === void 0 ? "The contents of the tooltip go here." : _ref$tooltipContent,
51479
51488
  _ref$contentPosition = _ref.contentPosition,
51480
51489
  contentPosition = _ref$contentPosition === void 0 ? {
51481
51490
  top: "-110px",
@@ -51492,7 +51501,22 @@ var Tooltip = function Tooltip(_ref) {
51492
51501
  arrowBottom: "-8px",
51493
51502
  arrowLeft: "auto"
51494
51503
  } : _ref$arrowPosition,
51495
- arrowColor = _ref.arrowColor;
51504
+ _ref$minWidth = _ref.minWidth,
51505
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51506
+ _ref$maxWidth = _ref.maxWidth,
51507
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51508
+ _ref$height = _ref.height,
51509
+ height = _ref$height === void 0 ? "auto" : _ref$height,
51510
+ _ref$containerExtraSt = _ref.containerExtraStyles,
51511
+ containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
51512
+ _ref$triggerExtraStyl = _ref.triggerExtraStyles,
51513
+ triggerExtraStyles = _ref$triggerExtraStyl === void 0 ? "" : _ref$triggerExtraStyl,
51514
+ _ref$triggerButtonVar = _ref.triggerButtonVariant,
51515
+ triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
51516
+ _ref$contentExtraStyl = _ref.contentExtraStyles,
51517
+ contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51518
+ _ref$contentBackgroun = _ref.contentBackgroundColor,
51519
+ contentBackgroundColor = _ref$contentBackgroun === void 0 ? WHITE : _ref$contentBackgroun;
51496
51520
  var closeTimeoutRef = useRef(null);
51497
51521
  var _useState = useState(false),
51498
51522
  _useState2 = _slicedToArray(_useState, 2),
@@ -51500,6 +51524,10 @@ var Tooltip = function Tooltip(_ref) {
51500
51524
  setTooltipOpen = _useState2[1];
51501
51525
  var themeContext = useContext(ThemeContext);
51502
51526
  var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
51527
+ var borderColor = themeValues.borderColor,
51528
+ tooltipTriggerColor = themeValues.popoverTriggerColor,
51529
+ hoverColor = themeValues.hoverColor,
51530
+ activeColor = themeValues.activeColor;
51503
51531
  var top = contentPosition.top,
51504
51532
  right = contentPosition.right,
51505
51533
  bottom = contentPosition.bottom,
@@ -51508,12 +51536,12 @@ var Tooltip = function Tooltip(_ref) {
51508
51536
  arrowRight = arrowPosition.arrowRight,
51509
51537
  arrowBottom = arrowPosition.arrowBottom,
51510
51538
  arrowLeft = arrowPosition.arrowLeft;
51511
- var handleToggleTooltip = function handleToggleTooltip(desiredState) {
51512
- if (tooltipOpen !== desiredState) {
51513
- setTooltipOpen(desiredState);
51539
+ var handleToggleTooltip = function handleToggleTooltip(desiredTooltipState) {
51540
+ if (tooltipOpen !== desiredTooltipState) {
51541
+ setTooltipOpen(desiredTooltipState);
51514
51542
  }
51515
51543
  };
51516
- var handleKeyDown = function handleKeyDown(e) {
51544
+ var handleKeyboardEvent = function handleKeyboardEvent(e) {
51517
51545
  if (e.key === "Escape") {
51518
51546
  handleToggleTooltip(false);
51519
51547
  }
@@ -51537,61 +51565,57 @@ var Tooltip = function Tooltip(_ref) {
51537
51565
  }
51538
51566
  };
51539
51567
  }, []);
51540
- var renderTrigger = function renderTrigger() {
51541
- if (hasCustomTrigger && children) {
51542
- return /*#__PURE__*/React__default.cloneElement(React__default.Children.only(children), {
51543
- "aria-describedby": tooltipID,
51544
- onFocus: function onFocus() {
51545
- return handleToggleTooltip(true);
51546
- },
51547
- onBlur: function onBlur() {
51548
- return handleToggleTooltip(false);
51549
- },
51550
- onKeyDown: handleKeyDown
51551
- });
51552
- }
51553
- return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51554
- action: noop$1,
51555
- "aria-describedby": tooltipID,
51556
- onKeyDown: handleKeyDown,
51557
- variant: triggerButtonVariant,
51558
- onFocus: function onFocus() {
51559
- return handleToggleTooltip(true);
51560
- },
51561
- onBlur: function onBlur() {
51562
- return handleToggleTooltip(false);
51563
- },
51564
- onTouchStart: function onTouchStart() {
51565
- return handleToggleTooltip(true);
51566
- },
51567
- "data-qa": "tooltip-trigger-".concat(tooltipID),
51568
- text: triggerText,
51569
- 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 ")
51570
- });
51571
- };
51572
51568
  return /*#__PURE__*/React__default.createElement(Box, {
51569
+ ref: closeTimeoutRef,
51573
51570
  padding: "0",
51574
51571
  extraStyles: "position: relative; ".concat(containerExtraStyles),
51575
- onMouseEnter: handleMouseEnter,
51576
- onMouseLeave: handleMouseLeave,
51577
- "data-qa": "".concat(tooltipID, "-container")
51578
- }, renderTrigger(), /*#__PURE__*/React__default.createElement(Box, {
51572
+ onMouseEnter: function onMouseEnter() {
51573
+ return handleMouseEnter();
51574
+ },
51575
+ onMouseLeave: function onMouseLeave() {
51576
+ return handleMouseLeave();
51577
+ },
51578
+ "data-qa": "tooltip-container"
51579
+ }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51580
+ "aria-describedby": tooltipID,
51581
+ onKeyDown: handleKeyboardEvent,
51582
+ variant: triggerButtonVariant,
51583
+ onFocus: function onFocus() {
51584
+ return handleToggleTooltip(true);
51585
+ },
51586
+ onBlur: function onBlur() {
51587
+ return handleToggleTooltip(false);
51588
+ },
51589
+ onTouchStart: function onTouchStart() {
51590
+ return handleToggleTooltip(true);
51591
+ },
51592
+ "data-qa": "tooltip-trigger",
51593
+ contentOverride: true
51594
+ }, hasIconTrigger === true && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51595
+ "aria-label": "Open tooltip"
51596
+ }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51597
+ color: tooltipTriggerColor
51598
+ })), /*#__PURE__*/React__default.createElement(Box, {
51599
+ padding: "0",
51600
+ srOnly: true
51601
+ }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), hasIconTrigger === false && /*#__PURE__*/React__default.createElement(Text$1, {
51602
+ color: tooltipTriggerColor,
51603
+ 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 ")
51604
+ }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51579
51605
  role: "tooltip",
51580
51606
  id: tooltipID,
51581
51607
  "aria-hidden": !tooltipOpen,
51582
- background: themeValues.borderColor,
51608
+ background: contentBackgroundColor,
51583
51609
  "data-qa": "tooltip-contents",
51584
- 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 "),
51610
+ 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 "),
51585
51611
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
51586
51612
  border: "1px solid transparent",
51587
51613
  borderRadius: "4px",
51588
51614
  minWidth: minWidth,
51589
51615
  maxWidth: maxWidth
51590
- }, typeof content === "string" ? /*#__PURE__*/React__default.createElement(Text$1, {
51591
- color: themeValues.linkColor
51592
- }, content) : content, /*#__PURE__*/React__default.createElement(Box, {
51616
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, tooltipContent), /*#__PURE__*/React__default.createElement(Box, {
51593
51617
  padding: "0",
51594
- 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 ")
51618
+ extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(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 ")
51595
51619
  })));
51596
51620
  };
51597
51621