@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.esm.js CHANGED
@@ -1871,6 +1871,20 @@ var adjustHexColor = function adjustHexColor(hex, percent, action) {
1871
1871
  // Convert back to hex
1872
1872
  return "#".concat(((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1).padStart(6, "0"));
1873
1873
  };
1874
+ var arrowBorder = function arrowBorder(borderColor, direction) {
1875
+ var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
1876
+ var angle = "".concat(width, " solid transparent");
1877
+ var straight = "".concat(width, " solid ").concat(borderColor);
1878
+ if (direction == "down") {
1879
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
1880
+ } else if (direction == "up") {
1881
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
1882
+ } else if (direction == "left") {
1883
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
1884
+ } else if (direction == "right") {
1885
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
1886
+ }
1887
+ };
1874
1888
 
1875
1889
  var general = /*#__PURE__*/Object.freeze({
1876
1890
  __proto__: null,
@@ -1894,7 +1908,8 @@ var general = /*#__PURE__*/Object.freeze({
1894
1908
  titleCaseString: titleCaseString,
1895
1909
  kebabCaseString: kebabCaseString,
1896
1910
  wrapIndex: wrapIndex,
1897
- adjustHexColor: adjustHexColor
1911
+ adjustHexColor: adjustHexColor,
1912
+ arrowBorder: arrowBorder
1898
1913
  });
1899
1914
 
1900
1915
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
@@ -40223,20 +40238,6 @@ var fallbackValues$I = {
40223
40238
  popoverTriggerColor: popoverTriggerColor
40224
40239
  };
40225
40240
 
40226
- var arrowBorder = function arrowBorder(borderColor, direction) {
40227
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
40228
- var angle = "".concat(width, " solid transparent");
40229
- var straight = "".concat(width, " solid ").concat(borderColor);
40230
- if (direction == "down") {
40231
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
40232
- } else if (direction == "up") {
40233
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
40234
- } else if (direction == "left") {
40235
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
40236
- } else if (direction == "right") {
40237
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
40238
- }
40239
- };
40240
40241
  var Popover = function Popover(_ref) {
40241
40242
  var themeValues = _ref.themeValues,
40242
40243
  _ref$triggerText = _ref.triggerText,
@@ -51175,44 +51176,33 @@ var fallbackValues$12 = {
51175
51176
  tooltipTriggerColor: tooltipTriggerColor
51176
51177
  };
51177
51178
 
51178
- var arrowBorder$1 = function arrowBorder(borderColor, direction) {
51179
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
51180
- var angle = "".concat(width, " solid transparent");
51181
- var straight = "".concat(width, " solid ").concat(borderColor);
51182
- if (direction == "down") {
51183
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
51184
- } else if (direction == "up") {
51185
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
51186
- } else if (direction == "left") {
51187
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
51188
- } else if (direction == "right") {
51189
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
51190
- }
51191
- };
51192
51179
  var Tooltip = function Tooltip(_ref) {
51193
- var themeValues = _ref.themeValues,
51194
- _ref$triggerText = _ref.triggerText,
51195
- triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
51196
- _ref$content = _ref.content,
51197
- content = _ref$content === void 0 ? "" : _ref$content,
51180
+ var _ref$tooltipContainer = _ref.tooltipContainerExtraStyles,
51181
+ tooltipContainerExtraStyles = _ref$tooltipContainer === void 0 ? "" : _ref$tooltipContainer,
51182
+ themeValues = _ref.themeValues,
51183
+ _ref$tooltipID = _ref.tooltipID,
51184
+ tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51198
51185
  _ref$hasIconTrigger = _ref.hasIconTrigger,
51199
51186
  hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51200
51187
  _ref$IconTrigger = _ref.IconTrigger,
51201
51188
  IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51202
51189
  _ref$iconHelpText = _ref.iconHelpText,
51203
- iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
51204
- _ref$tooltipID = _ref.tooltipID,
51205
- tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51206
- _ref$extraStyles = _ref.extraStyles,
51207
- extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
51208
- _ref$textExtraStyles = _ref.textExtraStyles,
51209
- textExtraStyles = _ref$textExtraStyles === void 0 ? "" : _ref$textExtraStyles,
51210
- _ref$minWidth = _ref.minWidth,
51211
- minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51212
- _ref$maxWidth = _ref.maxWidth,
51213
- maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51214
- _ref$height = _ref.height,
51215
- height = _ref$height === void 0 ? "auto" : _ref$height,
51190
+ iconHelpText = _ref$iconHelpText === void 0 ? "Open the tooltip" : _ref$iconHelpText,
51191
+ _ref$tooltipContent = _ref.tooltipContent,
51192
+ tooltipContent = _ref$tooltipContent === void 0 ? "" : _ref$tooltipContent,
51193
+ _ref$tooltipTriggerTe = _ref.tooltipTriggerText,
51194
+ tooltipTriggerText = _ref$tooltipTriggerTe === void 0 ? "" : _ref$tooltipTriggerTe,
51195
+ _ref$triggerTextExtra = _ref.triggerTextExtraStyles,
51196
+ triggerTextExtraStyles = _ref$triggerTextExtra === void 0 ? "" : _ref$triggerTextExtra,
51197
+ _ref$contentExtraStyl = _ref.contentExtraStyles,
51198
+ contentExtraStyles = _ref$contentExtraStyl === void 0 ? "" : _ref$contentExtraStyl,
51199
+ _ref$contentPosition = _ref.contentPosition,
51200
+ contentPosition = _ref$contentPosition === void 0 ? {
51201
+ top: "-110px",
51202
+ right: "auto",
51203
+ bottom: "auto",
51204
+ left: "-225px"
51205
+ } : _ref$contentPosition,
51216
51206
  _ref$arrowDirection = _ref.arrowDirection,
51217
51207
  arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51218
51208
  _ref$arrowPosition = _ref.arrowPosition,
@@ -51222,25 +51212,21 @@ var Tooltip = function Tooltip(_ref) {
51222
51212
  arrowBottom: "-8px",
51223
51213
  arrowLeft: "auto"
51224
51214
  } : _ref$arrowPosition,
51225
- _ref$position = _ref.position,
51226
- position = _ref$position === void 0 ? {
51227
- top: "-110px",
51228
- right: "auto",
51229
- bottom: "auto",
51230
- left: "-225px"
51231
- } : _ref$position,
51232
- _ref$iconColor = _ref.iconColor,
51233
- iconColor = _ref$iconColor === void 0 ? SELECTIVE_YELLOW : _ref$iconColor,
51215
+ _ref$minWidth = _ref.minWidth,
51216
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
51217
+ _ref$maxWidth = _ref.maxWidth,
51218
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51219
+ _ref$height = _ref.height,
51220
+ height = _ref$height === void 0 ? "auto" : _ref$height,
51234
51221
  buttonExtraStyles = _ref.buttonExtraStyles,
51235
51222
  _ref$backgroundColor = _ref.backgroundColor,
51236
51223
  backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
51237
51224
  _ref$borderColor = _ref.borderColor,
51238
- borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
51239
- tooltipContentExtraStyles = _ref.tooltipContentExtraStyles;
51225
+ borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor;
51240
51226
  var hoverColor = themeValues.hoverColor,
51241
51227
  activeColor = themeValues.activeColor,
51242
51228
  tooltipTriggerColor = themeValues.tooltipTriggerColor;
51243
- var _ref2 = position !== null && position !== void 0 ? position : {},
51229
+ var _ref2 = contentPosition !== null && contentPosition !== void 0 ? contentPosition : {},
51244
51230
  top = _ref2.top,
51245
51231
  right = _ref2.right,
51246
51232
  bottom = _ref2.bottom,
@@ -51260,13 +51246,13 @@ var Tooltip = function Tooltip(_ref) {
51260
51246
  }
51261
51247
  };
51262
51248
  var handleKeyboardEvent = function handleKeyboardEvent(e) {
51263
- if (e.keyCode === ESCAPE || e.keyCode === 9) {
51249
+ if (e.key === "Escape") {
51264
51250
  handleToggleTooltip(false);
51265
51251
  }
51266
51252
  };
51267
51253
  return /*#__PURE__*/React__default.createElement(Box, {
51268
51254
  padding: "0",
51269
- extraStyles: "position: relative; ".concat(extraStyles)
51255
+ extraStyles: "position: relative; ".concat(tooltipContainerExtraStyles)
51270
51256
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
51271
51257
  action: function action() {
51272
51258
  return noop$1;
@@ -51296,16 +51282,15 @@ var Tooltip = function Tooltip(_ref) {
51296
51282
  "aria-describedby": tooltipID,
51297
51283
  extraStyles: buttonExtraStyles
51298
51284
  }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51299
- "aria-label": "Trigger Popover"
51285
+ "aria-label": "Open tooltip"
51300
51286
  }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51301
- color: iconColor
51287
+ color: tooltipTriggerColor
51302
51288
  })), /*#__PURE__*/React__default.createElement(Box, {
51303
51289
  padding: "0",
51304
- srOnly: true,
51305
- "aria-hidden": "true"
51290
+ srOnly: true
51306
51291
  }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), !hasIconTrigger && /*#__PURE__*/React__default.createElement(Text$1, {
51307
- extraStyles: textExtraStyles
51308
- }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51292
+ extraStyles: "color: ".concat(tooltipTriggerColor, "; &:hover {\n ").concat(hoverColor, "; &:active ").concat(activeColor, "; ").concat(triggerTextExtraStyles)
51293
+ }, tooltipTriggerText)), /*#__PURE__*/React__default.createElement(Box, {
51309
51294
  background: backgroundColor,
51310
51295
  borderRadius: "4px",
51311
51296
  boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
@@ -51314,10 +51299,10 @@ var Tooltip = function Tooltip(_ref) {
51314
51299
  minWidth: minWidth,
51315
51300
  maxWidth: maxWidth,
51316
51301
  "aria-hidden": !tooltipOpen,
51317
- 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 ")
51318
- }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
51302
+ 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 ")
51303
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, tooltipContent), /*#__PURE__*/React__default.createElement(Box, {
51319
51304
  padding: "0",
51320
- 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 ")
51305
+ 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 ")
51321
51306
  })));
51322
51307
  };
51323
51308
  var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
@@ -51557,8 +51542,7 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
51557
51542
  }), /*#__PURE__*/React__default.createElement(Box, {
51558
51543
  padding: "0",
51559
51544
  minWidth: "100%",
51560
- key: "content-box",
51561
- role: "main"
51545
+ key: "content-box"
51562
51546
  }, subHeader && !(isMobile && hideMobileSubHeader) ? subHeader : /*#__PURE__*/React__default.createElement(Fragment$1, null), /*#__PURE__*/React__default.createElement(Box, {
51563
51547
  padding: sidebarWrapperPadding,
51564
51548
  key: "content-wrapper"