@thecb/components 11.11.0-beta.0 → 11.11.0-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.
package/dist/index.cjs.js CHANGED
@@ -51456,6 +51456,7 @@ var hoverColor$6 = SAPPHIRE_BLUE;
51456
51456
  var activeColor$b = PEACOCK_BLUE;
51457
51457
  var linkColor$6 = MATISSE_BLUE;
51458
51458
  var borderColor$7 = "rgba(255, 255, 255, 0.85)";
51459
+ var TOOLTIP_THEME_SOURCE = "Button";
51459
51460
  var fallbackValues$12 = {
51460
51461
  borderColor: borderColor$7,
51461
51462
  linkColor: linkColor$6,
@@ -51484,24 +51485,21 @@ var Tooltip = function Tooltip(_ref) {
51484
51485
  maxWidth = _ref$maxWidth === void 0 ? "100%" : _ref$maxWidth,
51485
51486
  _ref$height = _ref.height,
51486
51487
  height = _ref$height === void 0 ? "auto" : _ref$height,
51487
- _ref$arrowDirection = _ref.arrowDirection,
51488
- arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51489
51488
  _ref$contentPosition = _ref.contentPosition,
51490
51489
  contentPosition = _ref$contentPosition === void 0 ? {
51491
- top: "auto",
51490
+ top: "-110px",
51492
51491
  right: "auto",
51493
- bottom: "calc(100% + 8px)",
51494
- // always sits above the trigger + 8px gap for arrow
51495
- left: "50%",
51496
- // anchors to horizontal center of trigger
51497
- transform: "translateX(-50%)" // shifts left by half tooltip's own width → centered
51492
+ bottom: "auto",
51493
+ left: "-225px"
51498
51494
  } : _ref$contentPosition,
51495
+ _ref$arrowDirection = _ref.arrowDirection,
51496
+ arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51499
51497
  _ref$arrowPosition = _ref.arrowPosition,
51500
51498
  arrowPosition = _ref$arrowPosition === void 0 ? {
51501
51499
  arrowTop: "auto",
51502
- arrowRight: "auto",
51500
+ arrowRight: "10px",
51503
51501
  arrowBottom: "-8px",
51504
- arrowLeft: "calc(50% - 8px)" // centers the 0-width arrow element (16px wide border)
51502
+ arrowLeft: "auto"
51505
51503
  } : _ref$arrowPosition,
51506
51504
  arrowColor = _ref.arrowColor;
51507
51505
  var closeTimeoutRef = React.useRef(null);
@@ -51510,7 +51508,7 @@ var Tooltip = function Tooltip(_ref) {
51510
51508
  tooltipOpen = _useState2[0],
51511
51509
  setTooltipOpen = _useState2[1];
51512
51510
  var themeContext = React.useContext(styled.ThemeContext);
51513
- var themeValues = createThemeValues(themeContext, fallbackValues$12, "Tooltip");
51511
+ var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
51514
51512
  var top = contentPosition.top,
51515
51513
  right = contentPosition.right,
51516
51514
  bottom = contentPosition.bottom,
@@ -51550,12 +51548,7 @@ var Tooltip = function Tooltip(_ref) {
51550
51548
  }, []);
51551
51549
  var renderTrigger = function renderTrigger() {
51552
51550
  if (hasCustomTrigger && children) {
51553
- return /*#__PURE__*/React__default.createElement(Box, {
51554
- padding: "0",
51555
- extraStyles: "cursor: pointer;",
51556
- tabIndex: "0",
51557
- role: "button",
51558
- "data-qa": "tooltip-trigger-".concat(tooltipID),
51551
+ return /*#__PURE__*/React__default.cloneElement(React__default.Children.only(children), {
51559
51552
  "aria-describedby": tooltipID,
51560
51553
  onFocus: function onFocus() {
51561
51554
  return handleToggleTooltip(true);
@@ -51564,7 +51557,7 @@ var Tooltip = function Tooltip(_ref) {
51564
51557
  return handleToggleTooltip(false);
51565
51558
  },
51566
51559
  onKeyDown: handleKeyDown
51567
- }, children);
51560
+ });
51568
51561
  }
51569
51562
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51570
51563
  action: noop$1,
@@ -51582,7 +51575,7 @@ var Tooltip = function Tooltip(_ref) {
51582
51575
  },
51583
51576
  "data-qa": "tooltip-trigger-".concat(tooltipID),
51584
51577
  text: triggerText,
51585
- extraStyles: "\n color: ".concat(themeValues.linkColor, ";\n cursor: pointer;\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 ")
51578
+ 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 ")
51586
51579
  });
51587
51580
  };
51588
51581
  return /*#__PURE__*/React__default.createElement(Box, {
@@ -51610,7 +51603,6 @@ var Tooltip = function Tooltip(_ref) {
51610
51603
  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 ")
51611
51604
  })));
51612
51605
  };
51613
- var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
51614
51606
 
51615
51607
  var pageBackground = "#FBFCFD";
51616
51608
  var fallbackValues$13 = {
@@ -52171,7 +52163,7 @@ exports.TimeoutImage = TimeoutImage;
52171
52163
  exports.Title = Title$1;
52172
52164
  exports.ToastNotification = ToastNotification;
52173
52165
  exports.ToggleSwitch = ToggleSwitch$1;
52174
- exports.Tooltip = Tooltip$1;
52166
+ exports.Tooltip = Tooltip;
52175
52167
  exports.TrashIcon = TrashIcon$1;
52176
52168
  exports.TrashIconV2 = TrashIconV2$1;
52177
52169
  exports.TurnstileWidget = TurnstileWidget;