@thecb/components 11.8.0-beta.3 → 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"];
@@ -19252,7 +19267,7 @@ var AlertInfoIcon = function AlertInfoIcon() {
19252
19267
  xlinkHref: "#path-1"
19253
19268
  })), /*#__PURE__*/React__default.createElement("use", {
19254
19269
  id: "background-2",
19255
- fill: "#281978",
19270
+ fill: "#15749d",
19256
19271
  fillRule: "nonzero",
19257
19272
  xlinkHref: "#path-1"
19258
19273
  })))));
@@ -19403,13 +19418,13 @@ var AlertIcons = {
19403
19418
  };
19404
19419
 
19405
19420
  var background = {
19406
- info: "".concat(HAWKES_BLUE),
19421
+ info: "".concat(INFO_BLUE),
19407
19422
  warn: "".concat(APRICOT_ORANGE),
19408
19423
  error: "".concat(BLUSH_RED),
19409
19424
  success: "".concat(HINT_GREEN)
19410
19425
  };
19411
19426
  var border$1 = {
19412
- info: "".concat(LUCKY_POINT),
19427
+ info: "".concat(MATISSE_BLUE),
19413
19428
  warn: "".concat(ZEST_ORANGE),
19414
19429
  error: "".concat(RAZZMATAZZ_RED),
19415
19430
  success: "".concat(EMERALD_GREEN)
@@ -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,
@@ -47175,13 +47176,18 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
47175
47176
  backButtonTestId = _ref$backButtonTestId === void 0 ? null : _ref$backButtonTestId;
47176
47177
  var _useContext = React.useContext(styled.ThemeContext),
47177
47178
  isMobile = _useContext.isMobile;
47178
- var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
47179
+
47180
+ // cancel URLs are external (back to client system)
47181
+ var handleCancel = function handleCancel() {
47182
+ window.location.href = cancelURL;
47183
+ };
47184
+ var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
47179
47185
  text: cancelText,
47180
- url: cancelURL,
47186
+ action: handleCancel,
47181
47187
  variant: backButtonVariant,
47182
47188
  extraStyles: isMobile && "flex-grow: 1",
47183
47189
  dataQa: backButtonTestId || cancelText,
47184
- "aria-labelledby": "".concat(kebabCaseString(cancelText), "-button"),
47190
+ "aria-label": "".concat(cancelText, ", navigate back to previous site"),
47185
47191
  role: "link"
47186
47192
  }) : backButtonAction && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
47187
47193
  text: "Back",
@@ -47189,7 +47195,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
47189
47195
  action: backButtonAction,
47190
47196
  extraStyles: isMobile && "flex-grow: 1",
47191
47197
  dataQa: "Back",
47192
- "aria-labelledby": "back-button",
47198
+ "aria-label": "Back, navigate to previous page",
47193
47199
  role: "link"
47194
47200
  });
47195
47201
  var forwardButton = !!redirectURL ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
@@ -51178,20 +51184,6 @@ var fallbackValues$12 = {
51178
51184
  tooltipTriggerColor: tooltipTriggerColor
51179
51185
  };
51180
51186
 
51181
- var arrowBorder$1 = function arrowBorder(borderColor, direction) {
51182
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
51183
- var angle = "".concat(width, " solid transparent");
51184
- var straight = "".concat(width, " solid ").concat(borderColor);
51185
- if (direction == "down") {
51186
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
51187
- } else if (direction == "up") {
51188
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
51189
- } else if (direction == "left") {
51190
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
51191
- } else if (direction == "right") {
51192
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
51193
- }
51194
- };
51195
51187
  var Tooltip = function Tooltip(_ref) {
51196
51188
  var themeValues = _ref.themeValues,
51197
51189
  _ref$triggerText = _ref.triggerText,
@@ -51201,12 +51193,13 @@ var Tooltip = function Tooltip(_ref) {
51201
51193
  _ref$hasIconTrigger = _ref.hasIconTrigger,
51202
51194
  hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51203
51195
  _ref$IconTrigger = _ref.IconTrigger,
51204
- IconTrigger = _ref$IconTrigger === void 0 ? IconAdd : _ref$IconTrigger,
51196
+ IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51205
51197
  _ref$iconHelpText = _ref.iconHelpText,
51206
51198
  iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
51207
51199
  _ref$tooltipID = _ref.tooltipID,
51208
- tooltipID = _ref$tooltipID === void 0 ? 0 : _ref$tooltipID,
51209
- extraStyles = _ref.extraStyles,
51200
+ tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51201
+ _ref$extraStyles = _ref.extraStyles,
51202
+ extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
51210
51203
  _ref$textExtraStyles = _ref.textExtraStyles,
51211
51204
  textExtraStyles = _ref$textExtraStyles === void 0 ? "" : _ref$textExtraStyles,
51212
51205
  _ref$minWidth = _ref.minWidth,
@@ -51215,39 +51208,43 @@ var Tooltip = function Tooltip(_ref) {
51215
51208
  maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51216
51209
  _ref$height = _ref.height,
51217
51210
  height = _ref$height === void 0 ? "auto" : _ref$height,
51218
- position = _ref.position,
51219
- arrowPosition = _ref.arrowPosition,
51220
51211
  _ref$arrowDirection = _ref.arrowDirection,
51221
51212
  arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51222
- _ref$transform = _ref.transform,
51223
- transform = _ref$transform === void 0 ? "none" : _ref$transform,
51213
+ _ref$arrowPosition = _ref.arrowPosition,
51214
+ arrowPosition = _ref$arrowPosition === void 0 ? {
51215
+ arrowTop: "auto",
51216
+ arrowRight: "10px",
51217
+ arrowBottom: "-8px",
51218
+ arrowLeft: "auto"
51219
+ } : _ref$arrowPosition,
51220
+ _ref$position = _ref.position,
51221
+ position = _ref$position === void 0 ? {
51222
+ top: "-110px",
51223
+ right: "auto",
51224
+ bottom: "auto",
51225
+ left: "-225px"
51226
+ } : _ref$position,
51227
+ _ref$iconColor = _ref.iconColor,
51228
+ iconColor = _ref$iconColor === void 0 ? SELECTIVE_YELLOW : _ref$iconColor,
51224
51229
  buttonExtraStyles = _ref.buttonExtraStyles,
51225
51230
  _ref$backgroundColor = _ref.backgroundColor,
51226
51231
  backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
51227
51232
  _ref$borderColor = _ref.borderColor,
51228
51233
  borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
51229
- tooltipExtraStyles = _ref.tooltipExtraStyles;
51234
+ tooltipContentExtraStyles = _ref.tooltipContentExtraStyles;
51230
51235
  var hoverColor = themeValues.hoverColor,
51231
51236
  activeColor = themeValues.activeColor,
51232
51237
  tooltipTriggerColor = themeValues.tooltipTriggerColor;
51233
51238
  var _ref2 = position !== null && position !== void 0 ? position : {},
51234
- _ref2$top = _ref2.top,
51235
- top = _ref2$top === void 0 ? "-110px" : _ref2$top,
51236
- _ref2$right = _ref2.right,
51237
- right = _ref2$right === void 0 ? "auto" : _ref2$right,
51238
- _ref2$bottom = _ref2.bottom,
51239
- bottom = _ref2$bottom === void 0 ? "auto" : _ref2$bottom,
51240
- _ref2$left = _ref2.left,
51241
- left = _ref2$left === void 0 ? "-225px" : _ref2$left;
51239
+ top = _ref2.top,
51240
+ right = _ref2.right,
51241
+ bottom = _ref2.bottom,
51242
+ left = _ref2.left;
51242
51243
  var _ref3 = arrowPosition !== null && arrowPosition !== void 0 ? arrowPosition : {},
51243
- _ref3$arrowTop = _ref3.arrowTop,
51244
- arrowTop = _ref3$arrowTop === void 0 ? "auto" : _ref3$arrowTop,
51245
- _ref3$arrowRight = _ref3.arrowRight,
51246
- arrowRight = _ref3$arrowRight === void 0 ? "10px" : _ref3$arrowRight,
51247
- _ref3$arrowBottom = _ref3.arrowBottom,
51248
- arrowBottom = _ref3$arrowBottom === void 0 ? "-8px" : _ref3$arrowBottom,
51249
- _ref3$arrowLeft = _ref3.arrowLeft,
51250
- arrowLeft = _ref3$arrowLeft === void 0 ? "auto" : _ref3$arrowLeft;
51244
+ arrowTop = _ref3.arrowTop,
51245
+ arrowRight = _ref3.arrowRight,
51246
+ arrowBottom = _ref3.arrowBottom,
51247
+ arrowLeft = _ref3.arrowLeft;
51251
51248
  var _useState = React.useState(false),
51252
51249
  _useState2 = _slicedToArray(_useState, 2),
51253
51250
  tooltipOpen = _useState2[0],
@@ -51258,7 +51255,7 @@ var Tooltip = function Tooltip(_ref) {
51258
51255
  }
51259
51256
  };
51260
51257
  var handleKeyboardEvent = function handleKeyboardEvent(e) {
51261
- if (e.keyCode === ESCAPE || e.keyCode === 9) {
51258
+ if (e.key === ESCAPE) {
51262
51259
  handleToggleTooltip(false);
51263
51260
  }
51264
51261
  };
@@ -51293,13 +51290,15 @@ var Tooltip = function Tooltip(_ref) {
51293
51290
  tabIndex: "0",
51294
51291
  "aria-describedby": tooltipID,
51295
51292
  extraStyles: buttonExtraStyles
51296
- }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconTrigger, {
51297
- stroke: BLACK
51298
- }), /*#__PURE__*/React__default.createElement(Box, {
51293
+ }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51294
+ "aria-label": "Open tooltip"
51295
+ }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51296
+ color: iconColor
51297
+ })), /*#__PURE__*/React__default.createElement(Box, {
51299
51298
  padding: "0",
51300
51299
  srOnly: true
51301
51300
  }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), !hasIconTrigger && /*#__PURE__*/React__default.createElement(Text$1, {
51302
- extraStyles: textExtraStyles
51301
+ extraStyles: "color: ".concat(tooltipTriggerColor, "; &:hover {\n ").concat(hoverColor, "; &:active ").concat(activeColor, "; ").concat(textExtraStyles)
51303
51302
  }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51304
51303
  background: backgroundColor,
51305
51304
  borderRadius: "4px",
@@ -51308,10 +51307,11 @@ var Tooltip = function Tooltip(_ref) {
51308
51307
  role: "tooltip",
51309
51308
  minWidth: minWidth,
51310
51309
  maxWidth: maxWidth,
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 transform: ").concat(transform, ";\n ").concat(tooltipExtraStyles, ";\n ")
51310
+ "aria-hidden": !tooltipOpen,
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 ")
51312
51312
  }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
51313
51313
  padding: "0",
51314
- 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 ")
51315
51315
  })));
51316
51316
  };
51317
51317
  var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
@@ -51551,8 +51551,7 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
51551
51551
  }), /*#__PURE__*/React__default.createElement(Box, {
51552
51552
  padding: "0",
51553
51553
  minWidth: "100%",
51554
- key: "content-box",
51555
- role: "main"
51554
+ key: "content-box"
51556
51555
  }, subHeader && !(isMobile && hideMobileSubHeader) ? subHeader : /*#__PURE__*/React__default.createElement(React.Fragment, null), /*#__PURE__*/React__default.createElement(Box, {
51557
51556
  padding: sidebarWrapperPadding,
51558
51557
  key: "content-wrapper"