@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.cjs.js CHANGED
@@ -22623,6 +22623,7 @@ var SortableTableHeading$1 = themeComponent(SortableTableHeading, "SortableTable
22623
22623
 
22624
22624
  var DropdownIcon = function DropdownIcon() {
22625
22625
  return /*#__PURE__*/React__default.createElement("svg", {
22626
+ "aria-hidden": "true",
22626
22627
  version: "1.2",
22627
22628
  xmlns: "http://www.w3.org/2000/svg",
22628
22629
  overflow: "visible",
@@ -23972,7 +23973,7 @@ var IconWrapper = styled__default.div.withConfig({
23972
23973
  var DropdownContentWrapper = styled__default.div.withConfig({
23973
23974
  displayName: "Dropdown__DropdownContentWrapper",
23974
23975
  componentId: "sc-pn6m0h-1"
23975
- })(["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) {
23976
+ })(["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) {
23976
23977
  var widthFitOptions = _ref2.widthFitOptions;
23977
23978
  return widthFitOptions ? "fit-content" : "100%";
23978
23979
  }, function (_ref3) {
@@ -24277,7 +24278,7 @@ var Dropdown = function Dropdown(_ref13) {
24277
24278
  background: isOpen ? themeValues.hoverColor : WHITE,
24278
24279
  borderRadius: "2px",
24279
24280
  borderSize: "1px",
24280
- borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : GREY_CHATEAU,
24281
+ borderColor: isError ? ERROR_COLOR : isOpen ? themeValues.selectedColor : STORM_GREY,
24281
24282
  dataQa: placeholder,
24282
24283
  extraStyles: disabled ? "".concat(inputPlaceholderTextStyle).concat(inputDisabledStyle) : inputPlaceholderTextStyle,
24283
24284
  hoverStyles: "background-color: ".concat(themeValues.hoverColor, ";"),
@@ -25921,7 +25922,8 @@ var FormInput = function FormInput(_ref15) {
25921
25922
  padding: "0"
25922
25923
  }, helperModal ? /*#__PURE__*/React__default.createElement(Cluster, {
25923
25924
  justify: "space-between",
25924
- align: "center"
25925
+ align: "center",
25926
+ overflow: true
25925
25927
  }, labelDisplayOverride ? labelDisplayOverride : /*#__PURE__*/React__default.createElement(Text$1, {
25926
25928
  as: "label",
25927
25929
  color: themeValues.labelColor,
@@ -50269,6 +50271,7 @@ var DropdownIconV2 = function DropdownIconV2(_ref) {
50269
50271
  color = _ref$color === void 0 ? "#292A33" : _ref$color,
50270
50272
  props = _objectWithoutProperties(_ref, _excluded$Q);
50271
50273
  return /*#__PURE__*/React__default.createElement("svg", _extends({
50274
+ "aria-hidden": "true",
50272
50275
  width: width,
50273
50276
  height: height,
50274
50277
  viewBox: "0 0 ".concat(width, " ").concat(height),
@@ -51451,39 +51454,25 @@ var TurnstileWidget = /*#__PURE__*/React.forwardRef(function (_ref4, ref) {
51451
51454
  }, error)));
51452
51455
  });
51453
51456
 
51454
- var hoverColor$6 = SAPPHIRE_BLUE;
51455
- var activeColor$b = PEACOCK_BLUE;
51456
- var linkColor$6 = MATISSE_BLUE;
51457
- var borderColor$7 = "rgba(255, 255, 255, 0.85)";
51458
- var TOOLTIP_THEME_SOURCE = "Button";
51457
+ var TOOLTIP_THEME_SOURCE = "Popover";
51459
51458
  var fallbackValues$12 = {
51460
- borderColor: borderColor$7,
51461
- linkColor: linkColor$6,
51462
- hoverColor: hoverColor$6,
51463
- activeColor: activeColor$b
51459
+ hoverColor: SAPPHIRE_BLUE,
51460
+ activeColor: PEACOCK_BLUE,
51461
+ popoverTriggerColor: MATISSE_BLUE,
51462
+ borderColor: "rgba(255, 255, 255, 0.85)"
51464
51463
  };
51465
-
51466
51464
  var Tooltip = function Tooltip(_ref) {
51467
51465
  var tooltipID = _ref.tooltipID,
51468
- children = _ref.children,
51469
- _ref$hasCustomTrigger = _ref.hasCustomTrigger,
51470
- hasCustomTrigger = _ref$hasCustomTrigger === void 0 ? false : _ref$hasCustomTrigger,
51466
+ _ref$hasIconTrigger = _ref.hasIconTrigger,
51467
+ hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51468
+ _ref$IconTrigger = _ref.IconTrigger,
51469
+ IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51470
+ _ref$iconHelpText = _ref.iconHelpText,
51471
+ iconHelpText = _ref$iconHelpText === void 0 ? "Open the tooltip" : _ref$iconHelpText,
51471
51472
  _ref$triggerText = _ref.triggerText,
51472
- triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
51473
- _ref$containerExtraSt = _ref.containerExtraStyles,
51474
- containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
51475
- _ref$triggerButtonVar = _ref.triggerButtonVariant,
51476
- triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
51477
- _ref$content = _ref.content,
51478
- content = _ref$content === void 0 ? "" : _ref$content,
51479
- _ref$contentExtraStyl = _ref.contentExtraStyles,
51480
- contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51481
- _ref$minWidth = _ref.minWidth,
51482
- minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51483
- _ref$maxWidth = _ref.maxWidth,
51484
- maxWidth = _ref$maxWidth === void 0 ? "100%" : _ref$maxWidth,
51485
- _ref$height = _ref.height,
51486
- height = _ref$height === void 0 ? "auto" : _ref$height,
51473
+ triggerText = _ref$triggerText === void 0 ? "Open the tooltip" : _ref$triggerText,
51474
+ _ref$tooltipContent = _ref.tooltipContent,
51475
+ tooltipContent = _ref$tooltipContent === void 0 ? "The contents of the tooltip go here." : _ref$tooltipContent,
51487
51476
  _ref$contentPosition = _ref.contentPosition,
51488
51477
  contentPosition = _ref$contentPosition === void 0 ? {
51489
51478
  top: "-110px",
@@ -51500,7 +51489,22 @@ var Tooltip = function Tooltip(_ref) {
51500
51489
  arrowBottom: "-8px",
51501
51490
  arrowLeft: "auto"
51502
51491
  } : _ref$arrowPosition,
51503
- arrowColor = _ref.arrowColor;
51492
+ _ref$minWidth = _ref.minWidth,
51493
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51494
+ _ref$maxWidth = _ref.maxWidth,
51495
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51496
+ _ref$height = _ref.height,
51497
+ height = _ref$height === void 0 ? "auto" : _ref$height,
51498
+ _ref$containerExtraSt = _ref.containerExtraStyles,
51499
+ containerExtraStyles = _ref$containerExtraSt === void 0 ? "" : _ref$containerExtraSt,
51500
+ _ref$triggerExtraStyl = _ref.triggerExtraStyles,
51501
+ triggerExtraStyles = _ref$triggerExtraStyl === void 0 ? "" : _ref$triggerExtraStyl,
51502
+ _ref$triggerButtonVar = _ref.triggerButtonVariant,
51503
+ triggerButtonVariant = _ref$triggerButtonVar === void 0 ? "smallGhost" : _ref$triggerButtonVar,
51504
+ _ref$contentExtraStyl = _ref.contentExtraStyles,
51505
+ contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51506
+ _ref$contentBackgroun = _ref.contentBackgroundColor,
51507
+ contentBackgroundColor = _ref$contentBackgroun === void 0 ? WHITE : _ref$contentBackgroun;
51504
51508
  var closeTimeoutRef = React.useRef(null);
51505
51509
  var _useState = React.useState(false),
51506
51510
  _useState2 = _slicedToArray(_useState, 2),
@@ -51508,6 +51512,10 @@ var Tooltip = function Tooltip(_ref) {
51508
51512
  setTooltipOpen = _useState2[1];
51509
51513
  var themeContext = React.useContext(styled.ThemeContext);
51510
51514
  var themeValues = createThemeValues(themeContext, fallbackValues$12, TOOLTIP_THEME_SOURCE);
51515
+ var borderColor = themeValues.borderColor,
51516
+ tooltipTriggerColor = themeValues.popoverTriggerColor,
51517
+ hoverColor = themeValues.hoverColor,
51518
+ activeColor = themeValues.activeColor;
51511
51519
  var top = contentPosition.top,
51512
51520
  right = contentPosition.right,
51513
51521
  bottom = contentPosition.bottom,
@@ -51516,12 +51524,12 @@ var Tooltip = function Tooltip(_ref) {
51516
51524
  arrowRight = arrowPosition.arrowRight,
51517
51525
  arrowBottom = arrowPosition.arrowBottom,
51518
51526
  arrowLeft = arrowPosition.arrowLeft;
51519
- var handleToggleTooltip = function handleToggleTooltip(desiredState) {
51520
- if (tooltipOpen !== desiredState) {
51521
- setTooltipOpen(desiredState);
51527
+ var handleToggleTooltip = function handleToggleTooltip(desiredTooltipState) {
51528
+ if (tooltipOpen !== desiredTooltipState) {
51529
+ setTooltipOpen(desiredTooltipState);
51522
51530
  }
51523
51531
  };
51524
- var handleKeyDown = function handleKeyDown(e) {
51532
+ var handleKeyboardEvent = function handleKeyboardEvent(e) {
51525
51533
  if (e.key === "Escape") {
51526
51534
  handleToggleTooltip(false);
51527
51535
  }
@@ -51545,61 +51553,57 @@ var Tooltip = function Tooltip(_ref) {
51545
51553
  }
51546
51554
  };
51547
51555
  }, []);
51548
- var renderTrigger = function renderTrigger() {
51549
- if (hasCustomTrigger && children) {
51550
- return /*#__PURE__*/React__default.cloneElement(React__default.Children.only(children), {
51551
- "aria-describedby": tooltipID,
51552
- onFocus: function onFocus() {
51553
- return handleToggleTooltip(true);
51554
- },
51555
- onBlur: function onBlur() {
51556
- return handleToggleTooltip(false);
51557
- },
51558
- onKeyDown: handleKeyDown
51559
- });
51560
- }
51561
- return /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51562
- action: noop$1,
51563
- "aria-describedby": tooltipID,
51564
- onKeyDown: handleKeyDown,
51565
- variant: triggerButtonVariant,
51566
- onFocus: function onFocus() {
51567
- return handleToggleTooltip(true);
51568
- },
51569
- onBlur: function onBlur() {
51570
- return handleToggleTooltip(false);
51571
- },
51572
- onTouchStart: function onTouchStart() {
51573
- return handleToggleTooltip(true);
51574
- },
51575
- "data-qa": "tooltip-trigger-".concat(tooltipID),
51576
- 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 ")
51578
- });
51579
- };
51580
51556
  return /*#__PURE__*/React__default.createElement(Box, {
51557
+ ref: closeTimeoutRef,
51581
51558
  padding: "0",
51582
51559
  extraStyles: "position: relative; ".concat(containerExtraStyles),
51583
- onMouseEnter: handleMouseEnter,
51584
- onMouseLeave: handleMouseLeave,
51585
- "data-qa": "".concat(tooltipID, "-container")
51586
- }, renderTrigger(), /*#__PURE__*/React__default.createElement(Box, {
51560
+ onMouseEnter: function onMouseEnter() {
51561
+ return handleMouseEnter();
51562
+ },
51563
+ onMouseLeave: function onMouseLeave() {
51564
+ return handleMouseLeave();
51565
+ },
51566
+ "data-qa": "tooltip-container"
51567
+ }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51568
+ "aria-describedby": tooltipID,
51569
+ onKeyDown: handleKeyboardEvent,
51570
+ variant: triggerButtonVariant,
51571
+ onFocus: function onFocus() {
51572
+ return handleToggleTooltip(true);
51573
+ },
51574
+ onBlur: function onBlur() {
51575
+ return handleToggleTooltip(false);
51576
+ },
51577
+ onTouchStart: function onTouchStart() {
51578
+ return handleToggleTooltip(true);
51579
+ },
51580
+ "data-qa": "tooltip-trigger",
51581
+ contentOverride: true
51582
+ }, hasIconTrigger === true && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51583
+ "aria-label": "Open tooltip"
51584
+ }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51585
+ color: tooltipTriggerColor
51586
+ })), /*#__PURE__*/React__default.createElement(Box, {
51587
+ padding: "0",
51588
+ srOnly: true
51589
+ }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), hasIconTrigger === false && /*#__PURE__*/React__default.createElement(Text$1, {
51590
+ color: tooltipTriggerColor,
51591
+ 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 ")
51592
+ }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51587
51593
  role: "tooltip",
51588
51594
  id: tooltipID,
51589
51595
  "aria-hidden": !tooltipOpen,
51590
- background: themeValues.borderColor,
51596
+ background: contentBackgroundColor,
51591
51597
  "data-qa": "tooltip-contents",
51592
- 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 "),
51598
+ 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 "),
51593
51599
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
51594
51600
  border: "1px solid transparent",
51595
51601
  borderRadius: "4px",
51596
51602
  minWidth: minWidth,
51597
51603
  maxWidth: maxWidth
51598
- }, typeof content === "string" ? /*#__PURE__*/React__default.createElement(Text$1, {
51599
- color: themeValues.linkColor
51600
- }, content) : content, /*#__PURE__*/React__default.createElement(Box, {
51604
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, tooltipContent), /*#__PURE__*/React__default.createElement(Box, {
51601
51605
  padding: "0",
51602
- 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 ")
51606
+ 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 ")
51603
51607
  })));
51604
51608
  };
51605
51609