@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.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"];
@@ -19244,7 +19259,7 @@ var AlertInfoIcon = function AlertInfoIcon() {
19244
19259
  xlinkHref: "#path-1"
19245
19260
  })), /*#__PURE__*/React__default.createElement("use", {
19246
19261
  id: "background-2",
19247
- fill: "#281978",
19262
+ fill: "#15749d",
19248
19263
  fillRule: "nonzero",
19249
19264
  xlinkHref: "#path-1"
19250
19265
  })))));
@@ -19395,13 +19410,13 @@ var AlertIcons = {
19395
19410
  };
19396
19411
 
19397
19412
  var background = {
19398
- info: "".concat(HAWKES_BLUE),
19413
+ info: "".concat(INFO_BLUE),
19399
19414
  warn: "".concat(APRICOT_ORANGE),
19400
19415
  error: "".concat(BLUSH_RED),
19401
19416
  success: "".concat(HINT_GREEN)
19402
19417
  };
19403
19418
  var border$1 = {
19404
- info: "".concat(LUCKY_POINT),
19419
+ info: "".concat(MATISSE_BLUE),
19405
19420
  warn: "".concat(ZEST_ORANGE),
19406
19421
  error: "".concat(RAZZMATAZZ_RED),
19407
19422
  success: "".concat(EMERALD_GREEN)
@@ -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,
@@ -47167,13 +47168,18 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
47167
47168
  backButtonTestId = _ref$backButtonTestId === void 0 ? null : _ref$backButtonTestId;
47168
47169
  var _useContext = useContext(ThemeContext),
47169
47170
  isMobile = _useContext.isMobile;
47170
- var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
47171
+
47172
+ // cancel URLs are external (back to client system)
47173
+ var handleCancel = function handleCancel() {
47174
+ window.location.href = cancelURL;
47175
+ };
47176
+ var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
47171
47177
  text: cancelText,
47172
- url: cancelURL,
47178
+ action: handleCancel,
47173
47179
  variant: backButtonVariant,
47174
47180
  extraStyles: isMobile && "flex-grow: 1",
47175
47181
  dataQa: backButtonTestId || cancelText,
47176
- "aria-labelledby": "".concat(kebabCaseString(cancelText), "-button"),
47182
+ "aria-label": "".concat(cancelText, ", navigate back to previous site"),
47177
47183
  role: "link"
47178
47184
  }) : backButtonAction && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
47179
47185
  text: "Back",
@@ -47181,7 +47187,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
47181
47187
  action: backButtonAction,
47182
47188
  extraStyles: isMobile && "flex-grow: 1",
47183
47189
  dataQa: "Back",
47184
- "aria-labelledby": "back-button",
47190
+ "aria-label": "Back, navigate to previous page",
47185
47191
  role: "link"
47186
47192
  });
47187
47193
  var forwardButton = !!redirectURL ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
@@ -51170,20 +51176,6 @@ var fallbackValues$12 = {
51170
51176
  tooltipTriggerColor: tooltipTriggerColor
51171
51177
  };
51172
51178
 
51173
- var arrowBorder$1 = function arrowBorder(borderColor, direction) {
51174
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
51175
- var angle = "".concat(width, " solid transparent");
51176
- var straight = "".concat(width, " solid ").concat(borderColor);
51177
- if (direction == "down") {
51178
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
51179
- } else if (direction == "up") {
51180
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
51181
- } else if (direction == "left") {
51182
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
51183
- } else if (direction == "right") {
51184
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
51185
- }
51186
- };
51187
51179
  var Tooltip = function Tooltip(_ref) {
51188
51180
  var themeValues = _ref.themeValues,
51189
51181
  _ref$triggerText = _ref.triggerText,
@@ -51193,12 +51185,13 @@ var Tooltip = function Tooltip(_ref) {
51193
51185
  _ref$hasIconTrigger = _ref.hasIconTrigger,
51194
51186
  hasIconTrigger = _ref$hasIconTrigger === void 0 ? false : _ref$hasIconTrigger,
51195
51187
  _ref$IconTrigger = _ref.IconTrigger,
51196
- IconTrigger = _ref$IconTrigger === void 0 ? IconAdd : _ref$IconTrigger,
51188
+ IconTrigger = _ref$IconTrigger === void 0 ? WarningIconXS : _ref$IconTrigger,
51197
51189
  _ref$iconHelpText = _ref.iconHelpText,
51198
51190
  iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
51199
51191
  _ref$tooltipID = _ref.tooltipID,
51200
- tooltipID = _ref$tooltipID === void 0 ? 0 : _ref$tooltipID,
51201
- extraStyles = _ref.extraStyles,
51192
+ tooltipID = _ref$tooltipID === void 0 ? "tooltip-content" : _ref$tooltipID,
51193
+ _ref$extraStyles = _ref.extraStyles,
51194
+ extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
51202
51195
  _ref$textExtraStyles = _ref.textExtraStyles,
51203
51196
  textExtraStyles = _ref$textExtraStyles === void 0 ? "" : _ref$textExtraStyles,
51204
51197
  _ref$minWidth = _ref.minWidth,
@@ -51207,39 +51200,43 @@ var Tooltip = function Tooltip(_ref) {
51207
51200
  maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
51208
51201
  _ref$height = _ref.height,
51209
51202
  height = _ref$height === void 0 ? "auto" : _ref$height,
51210
- position = _ref.position,
51211
- arrowPosition = _ref.arrowPosition,
51212
51203
  _ref$arrowDirection = _ref.arrowDirection,
51213
51204
  arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
51214
- _ref$transform = _ref.transform,
51215
- transform = _ref$transform === void 0 ? "none" : _ref$transform,
51205
+ _ref$arrowPosition = _ref.arrowPosition,
51206
+ arrowPosition = _ref$arrowPosition === void 0 ? {
51207
+ arrowTop: "auto",
51208
+ arrowRight: "10px",
51209
+ arrowBottom: "-8px",
51210
+ arrowLeft: "auto"
51211
+ } : _ref$arrowPosition,
51212
+ _ref$position = _ref.position,
51213
+ position = _ref$position === void 0 ? {
51214
+ top: "-110px",
51215
+ right: "auto",
51216
+ bottom: "auto",
51217
+ left: "-225px"
51218
+ } : _ref$position,
51219
+ _ref$iconColor = _ref.iconColor,
51220
+ iconColor = _ref$iconColor === void 0 ? SELECTIVE_YELLOW : _ref$iconColor,
51216
51221
  buttonExtraStyles = _ref.buttonExtraStyles,
51217
51222
  _ref$backgroundColor = _ref.backgroundColor,
51218
51223
  backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
51219
51224
  _ref$borderColor = _ref.borderColor,
51220
51225
  borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
51221
- tooltipExtraStyles = _ref.tooltipExtraStyles;
51226
+ tooltipContentExtraStyles = _ref.tooltipContentExtraStyles;
51222
51227
  var hoverColor = themeValues.hoverColor,
51223
51228
  activeColor = themeValues.activeColor,
51224
51229
  tooltipTriggerColor = themeValues.tooltipTriggerColor;
51225
51230
  var _ref2 = position !== null && position !== void 0 ? position : {},
51226
- _ref2$top = _ref2.top,
51227
- top = _ref2$top === void 0 ? "-110px" : _ref2$top,
51228
- _ref2$right = _ref2.right,
51229
- right = _ref2$right === void 0 ? "auto" : _ref2$right,
51230
- _ref2$bottom = _ref2.bottom,
51231
- bottom = _ref2$bottom === void 0 ? "auto" : _ref2$bottom,
51232
- _ref2$left = _ref2.left,
51233
- left = _ref2$left === void 0 ? "-225px" : _ref2$left;
51231
+ top = _ref2.top,
51232
+ right = _ref2.right,
51233
+ bottom = _ref2.bottom,
51234
+ left = _ref2.left;
51234
51235
  var _ref3 = arrowPosition !== null && arrowPosition !== void 0 ? arrowPosition : {},
51235
- _ref3$arrowTop = _ref3.arrowTop,
51236
- arrowTop = _ref3$arrowTop === void 0 ? "auto" : _ref3$arrowTop,
51237
- _ref3$arrowRight = _ref3.arrowRight,
51238
- arrowRight = _ref3$arrowRight === void 0 ? "10px" : _ref3$arrowRight,
51239
- _ref3$arrowBottom = _ref3.arrowBottom,
51240
- arrowBottom = _ref3$arrowBottom === void 0 ? "-8px" : _ref3$arrowBottom,
51241
- _ref3$arrowLeft = _ref3.arrowLeft,
51242
- arrowLeft = _ref3$arrowLeft === void 0 ? "auto" : _ref3$arrowLeft;
51236
+ arrowTop = _ref3.arrowTop,
51237
+ arrowRight = _ref3.arrowRight,
51238
+ arrowBottom = _ref3.arrowBottom,
51239
+ arrowLeft = _ref3.arrowLeft;
51243
51240
  var _useState = useState(false),
51244
51241
  _useState2 = _slicedToArray(_useState, 2),
51245
51242
  tooltipOpen = _useState2[0],
@@ -51250,7 +51247,7 @@ var Tooltip = function Tooltip(_ref) {
51250
51247
  }
51251
51248
  };
51252
51249
  var handleKeyboardEvent = function handleKeyboardEvent(e) {
51253
- if (e.keyCode === ESCAPE || e.keyCode === 9) {
51250
+ if (e.key === ESCAPE) {
51254
51251
  handleToggleTooltip(false);
51255
51252
  }
51256
51253
  };
@@ -51285,13 +51282,15 @@ var Tooltip = function Tooltip(_ref) {
51285
51282
  tabIndex: "0",
51286
51283
  "aria-describedby": tooltipID,
51287
51284
  extraStyles: buttonExtraStyles
51288
- }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(IconTrigger, {
51289
- stroke: BLACK
51290
- }), /*#__PURE__*/React__default.createElement(Box, {
51285
+ }, hasIconTrigger && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Box, {
51286
+ "aria-label": "Open tooltip"
51287
+ }, /*#__PURE__*/React__default.createElement(IconTrigger, {
51288
+ color: iconColor
51289
+ })), /*#__PURE__*/React__default.createElement(Box, {
51291
51290
  padding: "0",
51292
51291
  srOnly: true
51293
51292
  }, /*#__PURE__*/React__default.createElement(Text$1, null, iconHelpText))), !hasIconTrigger && /*#__PURE__*/React__default.createElement(Text$1, {
51294
- extraStyles: textExtraStyles
51293
+ extraStyles: "color: ".concat(tooltipTriggerColor, "; &:hover {\n ").concat(hoverColor, "; &:active ").concat(activeColor, "; ").concat(textExtraStyles)
51295
51294
  }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
51296
51295
  background: backgroundColor,
51297
51296
  borderRadius: "4px",
@@ -51300,10 +51299,11 @@ var Tooltip = function Tooltip(_ref) {
51300
51299
  role: "tooltip",
51301
51300
  minWidth: minWidth,
51302
51301
  maxWidth: maxWidth,
51303
- 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 ")
51302
+ "aria-hidden": !tooltipOpen,
51303
+ 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 ")
51304
51304
  }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
51305
51305
  padding: "0",
51306
- 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 ")
51306
+ 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 ")
51307
51307
  })));
51308
51308
  };
51309
51309
  var Tooltip$1 = themeComponent(Tooltip, "Tooltip", fallbackValues$12);
@@ -51543,8 +51543,7 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
51543
51543
  }), /*#__PURE__*/React__default.createElement(Box, {
51544
51544
  padding: "0",
51545
51545
  minWidth: "100%",
51546
- key: "content-box",
51547
- role: "main"
51546
+ key: "content-box"
51548
51547
  }, subHeader && !(isMobile && hideMobileSubHeader) ? subHeader : /*#__PURE__*/React__default.createElement(Fragment$1, null), /*#__PURE__*/React__default.createElement(Box, {
51549
51548
  padding: sidebarWrapperPadding,
51550
51549
  key: "content-wrapper"