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

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,20 +51184,6 @@ 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
51188
  var themeValues = _ref.themeValues,
51202
51189
  _ref$triggerText = _ref.triggerText,
@@ -51268,7 +51255,7 @@ var Tooltip = function Tooltip(_ref) {
51268
51255
  }
51269
51256
  };
51270
51257
  var handleKeyboardEvent = function handleKeyboardEvent(e) {
51271
- if (e.keyCode === ESCAPE || e.keyCode === 9) {
51258
+ if (e.key === ESCAPE) {
51272
51259
  handleToggleTooltip(false);
51273
51260
  }
51274
51261
  };
@@ -51304,15 +51291,14 @@ var Tooltip = function Tooltip(_ref) {
51304
51291
  "aria-describedby": tooltipID,
51305
51292
  extraStyles: buttonExtraStyles
51306
51293
  }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51307
- "aria-label": "Trigger Popover"
51294
+ "aria-label": "Open tooltip"
51308
51295
  }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51309
51296
  color: iconColor
51310
51297
  })), /*#__PURE__*/React__default.createElement(Box, {
51311
51298
  padding: "0",
51312
- srOnly: true,
51313
- "aria-hidden": "true"
51299
+ srOnly: true
51314
51300
  }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), !hasIconTrigger && /*#__PURE__*/React__default.createElement(Text$1, {
51315
- extraStyles: textExtraStyles
51301
+ extraStyles: "color: ".concat(tooltipTriggerColor, "; &:hover {\n ").concat(hoverColor, "; &:active ").concat(activeColor, "; ").concat(textExtraStyles)
51316
51302
  }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51317
51303
  background: backgroundColor,
51318
51304
  borderRadius: "4px",
@@ -51325,7 +51311,7 @@ var Tooltip = function Tooltip(_ref) {
51325
51311
  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
51312
  }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
51327
51313
  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 ")
51314
+ 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
51315
  })));
51330
51316
  };
51331
51317
  var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
@@ -51565,8 +51551,7 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
51565
51551
  }), /*#__PURE__*/React__default.createElement(Box, {
51566
51552
  padding: "0",
51567
51553
  minWidth: "100%",
51568
- key: "content-box",
51569
- role: "main"
51554
+ key: "content-box"
51570
51555
  }, subHeader && !(isMobile && hideMobileSubHeader) ? subHeader : /*#__PURE__*/React__default.createElement(React.Fragment, null), /*#__PURE__*/React__default.createElement(Box, {
51571
51556
  padding: sidebarWrapperPadding,
51572
51557
  key: "content-wrapper"