@thecb/components 11.8.0-beta.4 → 11.8.0-beta.6

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
@@ -1879,6 +1879,20 @@ var adjustHexColor = function adjustHexColor(hex, percent, action) {
1879
1879
  // Convert back to hex
1880
1880
  return "#".concat(((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).padStart(6, "0"));
1881
1881
  };
1882
+ var arrowBorder = function arrowBorder(borderColor, direction) {
1883
+ var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
1884
+ var angle = "".concat(width, " solid transparent");
1885
+ var straight = "".concat(width, " solid ").concat(borderColor);
1886
+ if (direction == "down") {
1887
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
1888
+ } else if (direction == "up") {
1889
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
1890
+ } else if (direction == "left") {
1891
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
1892
+ } else if (direction == "right") {
1893
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
1894
+ }
1895
+ };
1882
1896
 
1883
1897
  var general = /*#__PURE__*/Object.freeze({
1884
1898
  __proto__: null,
@@ -1902,7 +1916,8 @@ var general = /*#__PURE__*/Object.freeze({
1902
1916
  titleCaseString: titleCaseString,
1903
1917
  kebabCaseString: kebabCaseString,
1904
1918
  wrapIndex: wrapIndex,
1905
- adjustHexColor: adjustHexColor
1919
+ adjustHexColor: adjustHexColor,
1920
+ arrowBorder: arrowBorder
1906
1921
  });
1907
1922
 
1908
1923
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
@@ -40231,20 +40246,6 @@ var fallbackValues$I = {
40231
40246
  popoverTriggerColor: popoverTriggerColor
40232
40247
  };
40233
40248
 
40234
- var arrowBorder = function arrowBorder(borderColor, direction) {
40235
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
40236
- var angle = "".concat(width, " solid transparent");
40237
- var straight = "".concat(width, " solid ").concat(borderColor);
40238
- if (direction == "down") {
40239
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
40240
- } else if (direction == "up") {
40241
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
40242
- } else if (direction == "left") {
40243
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
40244
- } else if (direction == "right") {
40245
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
40246
- }
40247
- };
40248
40249
  var Popover = function Popover(_ref) {
40249
40250
  var themeValues = _ref.themeValues,
40250
40251
  _ref$triggerText = _ref.triggerText,
@@ -51183,44 +51184,33 @@ var fallbackValues$12 = {
51183
51184
  tooltipTriggerColor: tooltipTriggerColor
51184
51185
  };
51185
51186
 
51186
- var arrowBorder$1 = function arrowBorder(borderColor, direction) {
51187
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
51188
- var angle = "".concat(width, " solid transparent");
51189
- var straight = "".concat(width, " solid ").concat(borderColor);
51190
- if (direction == "down") {
51191
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
51192
- } else if (direction == "up") {
51193
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
51194
- } else if (direction == "left") {
51195
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
51196
- } else if (direction == "right") {
51197
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
51198
- }
51199
- };
51200
51187
  var Tooltip = function Tooltip(_ref) {
51201
- var themeValues = _ref.themeValues,
51202
- _ref$triggerText = _ref.triggerText,
51203
- triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
51204
- _ref$content = _ref.content,
51205
- content = _ref$content === void 0 ? "" : _ref$content,
51188
+ var _ref$tooltipContainer = _ref.tooltipContainerExtraStyles,
51189
+ tooltipContainerExtraStyles = _ref$tooltipContainer === void 0 ? "" : _ref$tooltipContainer,
51190
+ themeValues = _ref.themeValues,
51191
+ _ref$tooltipID = _ref.tooltipID,
51192
+ tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51206
51193
  _ref$hasIconTrigger = _ref.hasIconTrigger,
51207
51194
  hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51208
51195
  _ref$IconTrigger = _ref.IconTrigger,
51209
51196
  IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51210
51197
  _ref$iconHelpText = _ref.iconHelpText,
51211
- iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
51212
- _ref$tooltipID = _ref.tooltipID,
51213
- tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51214
- _ref$extraStyles = _ref.extraStyles,
51215
- extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
51216
- _ref$textExtraStyles = _ref.textExtraStyles,
51217
- textExtraStyles = _ref$textExtraStyles === void 0 ? "" : _ref$textExtraStyles,
51218
- _ref$minWidth = _ref.minWidth,
51219
- minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51220
- _ref$maxWidth = _ref.maxWidth,
51221
- maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51222
- _ref$height = _ref.height,
51223
- height = _ref$height === void 0 ? "auto" : _ref$height,
51198
+ iconHelpText = _ref$iconHelpText === void 0 ? "Open the tooltip" : _ref$iconHelpText,
51199
+ _ref$tooltipContent = _ref.tooltipContent,
51200
+ tooltipContent = _ref$tooltipContent === void 0 ? "" : _ref$tooltipContent,
51201
+ _ref$tooltipTriggerTe = _ref.tooltipTriggerText,
51202
+ tooltipTriggerText = _ref$tooltipTriggerTe === void 0 ? "" : _ref$tooltipTriggerTe,
51203
+ _ref$triggerTextExtra = _ref.triggerTextExtraStyles,
51204
+ triggerTextExtraStyles = _ref$triggerTextExtra === void 0 ? "" : _ref$triggerTextExtra,
51205
+ _ref$contentExtraStyl = _ref.contentExtraStyles,
51206
+ contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51207
+ _ref$contentPosition = _ref.contentPosition,
51208
+ contentPosition = _ref$contentPosition === void 0 ? {
51209
+ top: "-110px",
51210
+ right: "auto",
51211
+ bottom: "auto",
51212
+ left: "-225px"
51213
+ } : _ref$contentPosition,
51224
51214
  _ref$arrowDirection = _ref.arrowDirection,
51225
51215
  arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51226
51216
  _ref$arrowPosition = _ref.arrowPosition,
@@ -51230,25 +51220,21 @@ var Tooltip = function Tooltip(_ref) {
51230
51220
  arrowBottom: "-8px",
51231
51221
  arrowLeft: "auto"
51232
51222
  } : _ref$arrowPosition,
51233
- _ref$position = _ref.position,
51234
- position = _ref$position === void 0 ? {
51235
- top: "-110px",
51236
- right: "auto",
51237
- bottom: "auto",
51238
- left: "-225px"
51239
- } : _ref$position,
51240
- _ref$iconColor = _ref.iconColor,
51241
- iconColor = _ref$iconColor === void 0 ? SELECTIVE_YELLOW : _ref$iconColor,
51223
+ _ref$minWidth = _ref.minWidth,
51224
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51225
+ _ref$maxWidth = _ref.maxWidth,
51226
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51227
+ _ref$height = _ref.height,
51228
+ height = _ref$height === void 0 ? "auto" : _ref$height,
51242
51229
  buttonExtraStyles = _ref.buttonExtraStyles,
51243
51230
  _ref$backgroundColor = _ref.backgroundColor,
51244
51231
  backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
51245
51232
  _ref$borderColor = _ref.borderColor,
51246
- borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
51247
- tooltipContentExtraStyles = _ref.tooltipContentExtraStyles;
51233
+ borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor;
51248
51234
  var hoverColor = themeValues.hoverColor,
51249
51235
  activeColor = themeValues.activeColor,
51250
51236
  tooltipTriggerColor = themeValues.tooltipTriggerColor;
51251
- var _ref2 = position !== null && position !== void 0 ? position : {},
51237
+ var _ref2 = contentPosition !== null && contentPosition !== void 0 ? contentPosition : {},
51252
51238
  top = _ref2.top,
51253
51239
  right = _ref2.right,
51254
51240
  bottom = _ref2.bottom,
@@ -51268,13 +51254,13 @@ var Tooltip = function Tooltip(_ref) {
51268
51254
  }
51269
51255
  };
51270
51256
  var handleKeyboardEvent = function handleKeyboardEvent(e) {
51271
- if (e.keyCode === ESCAPE || e.keyCode === 9) {
51257
+ if (e.key === "Escape") {
51272
51258
  handleToggleTooltip(false);
51273
51259
  }
51274
51260
  };
51275
51261
  return /*#__PURE__*/React__default.createElement(Box, {
51276
51262
  padding: "0",
51277
- extraStyles: "position: relative; ".concat(extraStyles)
51263
+ extraStyles: "position: relative; ".concat(tooltipContainerExtraStyles)
51278
51264
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51279
51265
  action: function action() {
51280
51266
  return noop$1;
@@ -51304,16 +51290,15 @@ var Tooltip = function Tooltip(_ref) {
51304
51290
  "aria-describedby": tooltipID,
51305
51291
  extraStyles: buttonExtraStyles
51306
51292
  }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51307
- "aria-label": "Trigger Popover"
51293
+ "aria-label": "Open tooltip"
51308
51294
  }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51309
- color: iconColor
51295
+ color: tooltipTriggerColor
51310
51296
  })), /*#__PURE__*/React__default.createElement(Box, {
51311
51297
  padding: "0",
51312
- srOnly: true,
51313
- "aria-hidden": "true"
51298
+ srOnly: true
51314
51299
  }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), !hasIconTrigger && /*#__PURE__*/React__default.createElement(Text$1, {
51315
- extraStyles: textExtraStyles
51316
- }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51300
+ extraStyles: "color: ".concat(tooltipTriggerColor, "; &:hover {\n ").concat(hoverColor, "; &:active ").concat(activeColor, "; ").concat(triggerTextExtraStyles)
51301
+ }, tooltipTriggerText)), /*#__PURE__*/React__default.createElement(Box, {
51317
51302
  background: backgroundColor,
51318
51303
  borderRadius: "4px",
51319
51304
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
@@ -51322,10 +51307,10 @@ var Tooltip = function Tooltip(_ref) {
51322
51307
  minWidth: minWidth,
51323
51308
  maxWidth: maxWidth,
51324
51309
  "aria-hidden": !tooltipOpen,
51325
- extraStyles: "\n display: ".concat(tooltipOpen ? "block" : "none", "; \n position: absolute; \n top: ").concat(top, "; \n right: ").concat(right, "; \n bottom: ").concat(bottom, "; \n left: ").concat(left, ";\n height: ").concat(height, ";\n ").concat(tooltipContentExtraStyles, ";\n ")
51326
- }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
51310
+ extraStyles: "\n display: ".concat(tooltipOpen ? "block" : "none", "; \n position: absolute; \n top: ").concat(top, "; \n right: ").concat(right, "; \n bottom: ").concat(bottom, "; \n left: ").concat(left, ";\n height: ").concat(height, ";\n ").concat(contentExtraStyles, ";\n ")
51311
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, tooltipContent), /*#__PURE__*/React__default.createElement(Box, {
51327
51312
  padding: "0",
51328
- extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder$1(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 ")
51313
+ 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 ")
51329
51314
  })));
51330
51315
  };
51331
51316
  var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
@@ -51565,8 +51550,7 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
51565
51550
  }), /*#__PURE__*/React__default.createElement(Box, {
51566
51551
  padding: "0",
51567
51552
  minWidth: "100%",
51568
- key: "content-box",
51569
- role: "main"
51553
+ key: "content-box"
51570
51554
  }, subHeader && !(isMobile && hideMobileSubHeader) ? subHeader : /*#__PURE__*/React__default.createElement(React.Fragment, null), /*#__PURE__*/React__default.createElement(Box, {
51571
51555
  padding: sidebarWrapperPadding,
51572
51556
  key: "content-wrapper"