@thecb/components 11.10.1-beta.2 → 11.11.0-beta.0

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
@@ -25921,7 +25921,8 @@ var FormInput = function FormInput(_ref15) {
25921
25921
  padding: "0"
25922
25922
  }, helperModal ? /*#__PURE__*/React__default.createElement(Cluster, {
25923
25923
  justify: "space-between",
25924
- align: "center"
25924
+ align: "center",
25925
+ overflow: true
25925
25926
  }, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
25926
25927
  as: "label",
25927
25928
  color: themeValues.labelColor,
@@ -51455,7 +51456,6 @@ var hoverColor$6 = SAPPHIRE_BLUE;
51455
51456
  var activeColor$b = PEACOCK_BLUE;
51456
51457
  var linkColor$6 = MATISSE_BLUE;
51457
51458
  var borderColor$7 = "rgba(255, 255, 255, 0.85)";
51458
- var TOOLTIP_THEME_SOURCE = "Button";
51459
51459
  var fallbackValues$12 = {
51460
51460
  borderColor: borderColor$7,
51461
51461
  linkColor: linkColor$6,
@@ -51484,21 +51484,24 @@ var Tooltip = function Tooltip(_ref) {
51484
51484
  maxWidth = _ref$maxWidth === void 0 ? "100%" : _ref$maxWidth,
51485
51485
  _ref$height = _ref.height,
51486
51486
  height = _ref$height === void 0 ? "auto" : _ref$height,
51487
+ _ref$arrowDirection = _ref.arrowDirection,
51488
+ arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51487
51489
  _ref$contentPosition = _ref.contentPosition,
51488
51490
  contentPosition = _ref$contentPosition === void 0 ? {
51489
- top: "-110px",
51491
+ top: "auto",
51490
51492
  right: "auto",
51491
- bottom: "auto",
51492
- left: "-225px"
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
51493
51498
  } : _ref$contentPosition,
51494
- _ref$arrowDirection = _ref.arrowDirection,
51495
- arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51496
51499
  _ref$arrowPosition = _ref.arrowPosition,
51497
51500
  arrowPosition = _ref$arrowPosition === void 0 ? {
51498
51501
  arrowTop: "auto",
51499
- arrowRight: "10px",
51502
+ arrowRight: "auto",
51500
51503
  arrowBottom: "-8px",
51501
- arrowLeft: "auto"
51504
+ arrowLeft: "calc(50% - 8px)" // centers the 0-width arrow element (16px wide border)
51502
51505
  } : _ref$arrowPosition,
51503
51506
  arrowColor = _ref.arrowColor;
51504
51507
  var closeTimeoutRef = React.useRef(null);
@@ -51507,7 +51510,7 @@ var Tooltip = function Tooltip(_ref) {
51507
51510
  tooltipOpen = _useState2[0],
51508
51511
  setTooltipOpen = _useState2[1];
51509
51512
  var themeContext = React.useContext(styled.ThemeContext);
51510
- var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
51513
+ var themeValues = createThemeValues(themeContext, fallbackValues$12, "Tooltip");
51511
51514
  var top = contentPosition.top,
51512
51515
  right = contentPosition.right,
51513
51516
  bottom = contentPosition.bottom,
@@ -51547,7 +51550,12 @@ var Tooltip = function Tooltip(_ref) {
51547
51550
  }, []);
51548
51551
  var renderTrigger = function renderTrigger() {
51549
51552
  if (hasCustomTrigger && children) {
51550
- return /*#__PURE__*/React__default.cloneElement(React__default.Children.only(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
51559
  "aria-describedby": tooltipID,
51552
51560
  onFocus: function onFocus() {
51553
51561
  return handleToggleTooltip(true);
@@ -51556,7 +51564,7 @@ var Tooltip = function Tooltip(_ref) {
51556
51564
  return handleToggleTooltip(false);
51557
51565
  },
51558
51566
  onKeyDown: handleKeyDown
51559
- });
51567
+ }, children);
51560
51568
  }
51561
51569
  return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51562
51570
  action: noop$1,
@@ -51574,7 +51582,7 @@ var Tooltip = function Tooltip(_ref) {
51574
51582
  },
51575
51583
  "data-qa": "tooltip-trigger-".concat(tooltipID),
51576
51584
  text: triggerText,
51577
- 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 ")
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
51586
  });
51579
51587
  };
51580
51588
  return /*#__PURE__*/React__default.createElement(Box, {
@@ -51602,6 +51610,7 @@ var Tooltip = function Tooltip(_ref) {
51602
51610
  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 ")
51603
51611
  })));
51604
51612
  };
51613
+ var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
51605
51614
 
51606
51615
  var pageBackground = "#FBFCFD";
51607
51616
  var fallbackValues$13 = {
@@ -52162,7 +52171,7 @@ exports.TimeoutImage = TimeoutImage;
52162
52171
  exports.Title = Title$1;
52163
52172
  exports.ToastNotification = ToastNotification;
52164
52173
  exports.ToggleSwitch = ToggleSwitch$1;
52165
- exports.Tooltip = Tooltip;
52174
+ exports.Tooltip = Tooltip$1;
52166
52175
  exports.TrashIcon = TrashIcon$1;
52167
52176
  exports.TrashIconV2 = TrashIconV2$1;
52168
52177
  exports.TurnstileWidget = TurnstileWidget;