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

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.esm.js CHANGED
@@ -22615,6 +22615,7 @@ var SortableTableHeading$1 = themeComponent(SortableTableHeading, "SortableTable
22615
22615
 
22616
22616
  var DropdownIcon = function DropdownIcon() {
22617
22617
  return /*#__PURE__*/React__default.createElement("svg", {
22618
+ "aria-hidden": "true",
22618
22619
  version: "1.2",
22619
22620
  xmlns: "http://www.w3.org/2000/svg",
22620
22621
  overflow: "visible",
@@ -23964,7 +23965,7 @@ var IconWrapper = styled.div.withConfig({
23964
23965
  var DropdownContentWrapper = styled.div.withConfig({
23965
23966
  displayName: "Dropdown__DropdownContentWrapper",
23966
23967
  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) {
23968
+ })(["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
23969
  var widthFitOptions = _ref2.widthFitOptions;
23969
23970
  return widthFitOptions ? "fit-content" : "100%";
23970
23971
  }, function (_ref3) {
@@ -24269,7 +24270,7 @@ var Dropdown = function Dropdown(_ref13) {
24269
24270
  background: isOpen ? themeValues.hoverColor : WHITE,
24270
24271
  borderRadius: "2px",
24271
24272
  borderSize: "1px",
24272
- borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
24273
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : STORM_GREY,
24273
24274
  dataQa: placeholder,
24274
24275
  extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
24275
24276
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
@@ -25913,7 +25914,8 @@ var FormInput = function FormInput(_ref15) {
25913
25914
  padding: "0"
25914
25915
  }, helperModal ? /*#__PURE__*/React__default.createElement(Cluster, {
25915
25916
  justify: "space-between",
25916
- align: "center"
25917
+ align: "center",
25918
+ overflow: true
25917
25919
  }, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
25918
25920
  as: "label",
25919
25921
  color: themeValues.labelColor,
@@ -50261,6 +50263,7 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
50261
50263
  color = _ref$color === void 0 ? "#292A33" : _ref$color,
50262
50264
  props = _objectWithoutProperties(_ref, _excluded$Q);
50263
50265
  return /*#__PURE__*/React__default.createElement("svg", _extends({
50266
+ "aria-hidden": "true",
50264
50267
  width: width,
50265
50268
  height: height,
50266
50269
  viewBox: "0 0 ".concat(width, " ").concat(height),
@@ -51443,39 +51446,25 @@ var TurnstileWidget = /*#__PURE__*/forwardRef(function (_ref4, ref) {
51443
51446
  }, error)));
51444
51447
  });
51445
51448
 
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";
51449
+ var TOOLTIP_THEME_SOURCE = "Popover";
51451
51450
  var fallbackValues$12 = {
51452
- borderColor: borderColor$7,
51453
- linkColor: linkColor$6,
51454
- hoverColor: hoverColor$6,
51455
- activeColor: activeColor$b
51451
+ hoverColor: SAPPHIRE_BLUE,
51452
+ activeColor: PEACOCK_BLUE,
51453
+ popoverTriggerColor: MATISSE_BLUE,
51454
+ borderColor: "rgba(255, 255, 255, 0.85)"
51456
51455
  };
51457
-
51458
51456
  var Tooltip = function Tooltip(_ref) {
51459
51457
  var tooltipID = _ref.tooltipID,
51460
- children = _ref.children,
51461
- _ref$hasCustomTrigger = _ref.hasCustomTrigger,
51462
- hasCustomTrigger = _ref$hasCustomTrigger === void 0 ? false : _ref$hasCustomTrigger,
51458
+ _ref$hasIconTrigger = _ref.hasIconTrigger,
51459
+ hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51460
+ _ref$IconTrigger = _ref.IconTrigger,
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,
51463
51464
  _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,
51465
+ triggerText = _ref$triggerText === void 0 ? "Open the tooltip" : _ref$triggerText,
51466
+ _ref$tooltipContent = _ref.tooltipContent,
51467
+ tooltipContent = _ref$tooltipContent === void 0 ? "The contents of the tooltip go here." : _ref$tooltipContent,
51479
51468
  _ref$contentPosition = _ref.contentPosition,
51480
51469
  contentPosition = _ref$contentPosition === void 0 ? {
51481
51470
  top: "-110px",
@@ -51492,7 +51481,22 @@ var Tooltip = function Tooltip(_ref) {
51492
51481
  arrowBottom: "-8px",
51493
51482
  arrowLeft: "auto"
51494
51483
  } : _ref$arrowPosition,
51495
- arrowColor = _ref.arrowColor;
51484
+ _ref$minWidth = _ref.minWidth,
51485
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51486
+ _ref$maxWidth = _ref.maxWidth,
51487
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51488
+ _ref$height = _ref.height,
51489
+ height = _ref$height === void 0 ? "auto" : _ref$height,
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;
51496
51500
  var closeTimeoutRef = useRef(null);
51497
51501
  var _useState = useState(false),
51498
51502
  _useState2 = _slicedToArray(_useState, 2),
@@ -51500,6 +51504,10 @@ var Tooltip = function Tooltip(_ref) {
51500
51504
  setTooltipOpen = _useState2[1];
51501
51505
  var themeContext = useContext(ThemeContext);
51502
51506
  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;
51503
51511
  var top = contentPosition.top,
51504
51512
  right = contentPosition.right,
51505
51513
  bottom = contentPosition.bottom,
@@ -51508,12 +51516,12 @@ var Tooltip = function Tooltip(_ref) {
51508
51516
  arrowRight = arrowPosition.arrowRight,
51509
51517
  arrowBottom = arrowPosition.arrowBottom,
51510
51518
  arrowLeft = arrowPosition.arrowLeft;
51511
- var handleToggleTooltip = function handleToggleTooltip(desiredState) {
51512
- if (tooltipOpen !== desiredState) {
51513
- setTooltipOpen(desiredState);
51519
+ var handleToggleTooltip = function handleToggleTooltip(desiredTooltipState) {
51520
+ if (tooltipOpen !== desiredTooltipState) {
51521
+ setTooltipOpen(desiredTooltipState);
51514
51522
  }
51515
51523
  };
51516
- var handleKeyDown = function handleKeyDown(e) {
51524
+ var handleKeyboardEvent = function handleKeyboardEvent(e) {
51517
51525
  if (e.key === "Escape") {
51518
51526
  handleToggleTooltip(false);
51519
51527
  }
@@ -51537,61 +51545,57 @@ var Tooltip = function Tooltip(_ref) {
51537
51545
  }
51538
51546
  };
51539
51547
  }, []);
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
51548
  return /*#__PURE__*/React__default.createElement(Box, {
51549
+ ref: closeTimeoutRef,
51573
51550
  padding: "0",
51574
51551
  extraStyles: "position: relative; ".concat(containerExtraStyles),
51575
- onMouseEnter: handleMouseEnter,
51576
- onMouseLeave: handleMouseLeave,
51577
- "data-qa": "".concat(tooltipID, "-container")
51578
- }, renderTrigger(), /*#__PURE__*/React__default.createElement(Box, {
51552
+ onMouseEnter: function onMouseEnter() {
51553
+ return handleMouseEnter();
51554
+ },
51555
+ onMouseLeave: function onMouseLeave() {
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, {
51579
51585
  role: "tooltip",
51580
51586
  id: tooltipID,
51581
51587
  "aria-hidden": !tooltipOpen,
51582
- background: themeValues.borderColor,
51588
+ background: contentBackgroundColor,
51583
51589
  "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 "),
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 "),
51585
51591
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
51586
51592
  border: "1px solid transparent",
51587
51593
  borderRadius: "4px",
51588
51594
  minWidth: minWidth,
51589
51595
  maxWidth: maxWidth
51590
- }, typeof content === "string" ? /*#__PURE__*/React__default.createElement(Text$1, {
51591
- color: themeValues.linkColor
51592
- }, content) : content, /*#__PURE__*/React__default.createElement(Box, {
51596
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, tooltipContent), /*#__PURE__*/React__default.createElement(Box, {
51593
51597
  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 ")
51598
+ 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
51599
  })));
51596
51600
  };
51597
51601