@thecb/components 12.0.4-beta.0 → 12.0.5-beta.0

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
@@ -14074,8 +14074,12 @@ var PaymentMethodIcon = function PaymentMethodIcon(_ref) {
14074
14074
  };
14075
14075
  var PaymentMethodIcon$1 = themeComponent(PaymentMethodIcon, "Icons", fallbackValues$2, "info");
14076
14076
 
14077
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
14078
+ // screen readers to skip this element. Use this when the icon is purely decorative
14079
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
14077
14080
  var AccountsIconSmall = function AccountsIconSmall(_ref) {
14078
- var themeValues = _ref.themeValues;
14081
+ var themeValues = _ref.themeValues,
14082
+ ariaHidden = _ref.ariaHidden;
14079
14083
  return /*#__PURE__*/React__default.createElement("svg", {
14080
14084
  width: "22px",
14081
14085
  height: "22px",
@@ -14086,7 +14090,8 @@ var AccountsIconSmall = function AccountsIconSmall(_ref) {
14086
14090
  style: {
14087
14091
  display: "inline-block",
14088
14092
  verticalAlign: "text-bottom"
14089
- }
14093
+ },
14094
+ "aria-hidden": ariaHidden ? "true" : undefined
14090
14095
  }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("rect", {
14091
14096
  id: "path-1-accountssmall",
14092
14097
  x: "0",
@@ -14253,8 +14258,12 @@ var ProfileIconSmall = function ProfileIconSmall(_ref) {
14253
14258
  };
14254
14259
  var ProfileIconSmall$1 = themeComponent(ProfileIconSmall, "Icons", fallbackValues$2, "primary");
14255
14260
 
14261
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
14262
+ // screen readers to skip this element. Use this when the icon is purely decorative
14263
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
14256
14264
  var SettingsIconSmall = function SettingsIconSmall(_ref) {
14257
- var themeValues = _ref.themeValues;
14265
+ var themeValues = _ref.themeValues,
14266
+ ariaHidden = _ref.ariaHidden;
14258
14267
  return /*#__PURE__*/React__default.createElement("svg", {
14259
14268
  width: "22px",
14260
14269
  height: "22px",
@@ -14265,7 +14274,8 @@ var SettingsIconSmall = function SettingsIconSmall(_ref) {
14265
14274
  style: {
14266
14275
  display: "inline-block",
14267
14276
  verticalAlign: "text-bottom"
14268
- }
14277
+ },
14278
+ "aria-hidden": ariaHidden ? "true" : undefined
14269
14279
  }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("rect", {
14270
14280
  id: "path-1-paymentssmall",
14271
14281
  x: "0",
@@ -14303,17 +14313,22 @@ var SettingsIconSmall = function SettingsIconSmall(_ref) {
14303
14313
  };
14304
14314
  var SettingsIconSmall$1 = themeComponent(SettingsIconSmall, "Icons", fallbackValues$2, "primary");
14305
14315
 
14316
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
14317
+ // screen readers to skip this element. Use this when the icon is purely decorative
14318
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
14306
14319
  var WalletIconSmall = function WalletIconSmall(_ref) {
14307
14320
  var themeValues = _ref.themeValues,
14308
14321
  _ref$iconIndex = _ref.iconIndex,
14309
14322
  iconIndex = _ref$iconIndex === void 0 ? 0 : _ref$iconIndex,
14310
- colorOverride = _ref.colorOverride;
14323
+ colorOverride = _ref.colorOverride,
14324
+ ariaHidden = _ref.ariaHidden;
14311
14325
  return /*#__PURE__*/React__default.createElement("svg", {
14312
14326
  width: "20",
14313
14327
  height: "20",
14314
14328
  viewBox: "0 0 20 20",
14315
14329
  fill: "none",
14316
- xmlns: "http://www.w3.org/2000/svg"
14330
+ xmlns: "http://www.w3.org/2000/svg",
14331
+ "aria-hidden": ariaHidden ? "true" : undefined
14317
14332
  }, /*#__PURE__*/React__default.createElement("path", {
14318
14333
  fillRule: "evenodd",
14319
14334
  clipRule: "evenodd",
@@ -14453,8 +14468,12 @@ var PropertiesAddIcon = function PropertiesAddIcon(_ref) {
14453
14468
  };
14454
14469
  var PropertiesAddIcon$1 = themeComponent(PropertiesAddIcon, "Icons", fallbackValues$2, "info");
14455
14470
 
14471
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
14472
+ // screen readers to skip this element. Use this when the icon is purely decorative
14473
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
14456
14474
  var PropertiesIconSmall = function PropertiesIconSmall(_ref) {
14457
- var themeValues = _ref.themeValues;
14475
+ var themeValues = _ref.themeValues,
14476
+ ariaHidden = _ref.ariaHidden;
14458
14477
  return /*#__PURE__*/React__default.createElement("svg", {
14459
14478
  xmlns: "http://www.w3.org/2000/svg",
14460
14479
  width: "22px",
@@ -14465,7 +14484,8 @@ var PropertiesIconSmall = function PropertiesIconSmall(_ref) {
14465
14484
  style: {
14466
14485
  display: "inline-block",
14467
14486
  verticalAlign: "text-bottom"
14468
- }
14487
+ },
14488
+ "aria-hidden": ariaHidden ? "true" : undefined
14469
14489
  }, /*#__PURE__*/React__default.createElement("g", {
14470
14490
  fill: "none",
14471
14491
  fillRule: "evenodd",
@@ -17231,17 +17251,22 @@ var CashieringImage = function CashieringImage() {
17231
17251
  })));
17232
17252
  };
17233
17253
 
17254
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
17255
+ // screen readers to skip this element. Use this when the icon is purely decorative
17256
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
17234
17257
  var FindIconSmall = function FindIconSmall(_ref) {
17235
17258
  var themeValues = _ref.themeValues,
17236
17259
  _ref$iconIndex = _ref.iconIndex,
17237
- iconIndex = _ref$iconIndex === void 0 ? 0 : _ref$iconIndex;
17260
+ iconIndex = _ref$iconIndex === void 0 ? 0 : _ref$iconIndex,
17261
+ ariaHidden = _ref.ariaHidden;
17238
17262
  var maskId = "find-icon-mask-".concat(iconIndex);
17239
17263
  return /*#__PURE__*/React__default.createElement("svg", {
17240
17264
  width: "20",
17241
17265
  height: "20",
17242
17266
  viewBox: "0 0 20 20",
17243
17267
  fill: "none",
17244
- xmlns: "http://www.w3.org/2000/svg"
17268
+ xmlns: "http://www.w3.org/2000/svg",
17269
+ "aria-hidden": ariaHidden ? "true" : undefined
17245
17270
  }, /*#__PURE__*/React__default.createElement("path", {
17246
17271
  fillRule: "evenodd",
17247
17272
  clipRule: "evenodd",
@@ -17272,14 +17297,19 @@ var FindIconSmall = function FindIconSmall(_ref) {
17272
17297
  };
17273
17298
  var FindIconSmall$1 = themeComponent(FindIconSmall, "Icons", fallbackValues$2, "primary");
17274
17299
 
17300
+ // When ariaHidden is true, aria-hidden="true" is added to the SVG, which tells
17301
+ // screen readers to skip this element. Use this when the icon is purely decorative
17302
+ // and adjacent text already conveys its meaning (e.g. an icon inside a labeled nav link).
17275
17303
  var HistoryIconSmall = function HistoryIconSmall(_ref) {
17276
- var themeValues = _ref.themeValues;
17304
+ var themeValues = _ref.themeValues,
17305
+ ariaHidden = _ref.ariaHidden;
17277
17306
  return /*#__PURE__*/React__default.createElement("svg", {
17278
17307
  width: "20",
17279
17308
  height: "20",
17280
17309
  viewBox: "0 0 20 20",
17281
17310
  fill: "none",
17282
- xmlns: "http://www.w3.org/2000/svg"
17311
+ xmlns: "http://www.w3.org/2000/svg",
17312
+ "aria-hidden": ariaHidden ? "true" : undefined
17283
17313
  }, /*#__PURE__*/React__default.createElement("path", {
17284
17314
  d: "M3.33337 8.33333C3.33337 7.8731 3.70647 7.5 4.16671 7.5H15.8334C16.2936 7.5 16.6667 7.8731 16.6667 8.33333V16.6667C16.6667 17.1269 16.2936 17.5 15.8334 17.5H4.16671C3.70647 17.5 3.33337 17.1269 3.33337 16.6667V8.33333Z",
17285
17315
  fill: themeValues.singleIconColor
@@ -45847,37 +45877,34 @@ var fallbackValues$L = {
45847
45877
  textColor: textColor$5
45848
45878
  };
45849
45879
 
45850
- var StyledAnchor = styled__default("a").withConfig({
45851
- displayName: "LinkCardstyled__StyledAnchor",
45852
- componentId: "sc-l5q1h2-0"
45853
- })(["", ""], function (_ref) {
45854
- var disabled = _ref.$disabled,
45855
- theme = _ref.$theme,
45856
- extraStyles = _ref.$extraStyles,
45857
- disabledStyles = _ref.$disabledStyles,
45858
- hoverStyles = _ref.$hoverStyles,
45859
- activeStyles = _ref.$activeStyles;
45860
- return "\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 40px;\n flex-shrink: 0;\n padding: 24px;\n align-self: stretch;\n border-radius: 8px;\n text-decoration: none;\n background-color: ".concat(disabled ? theme.disabledBackgroundColor : theme.backgroundColor, ";\n border: 1px solid\n ").concat(disabled ? theme.disabledBorderColor : theme.borderColor, ";\n transition: all 0.2s ease-in-out;\n ").concat(extraStyles || "", "\n\n ").concat(disabled ? "\n &:hover,\n &:active {\n cursor: default;\n box-shadow: none;\n border: 1px solid ".concat(theme.disabledBorderColor, ";\n ").concat(disabledStyles || "", "\n }\n ") : "\n &:hover,\n &:active {\n cursor: pointer;\n box-shadow: 0px 0px 0px 0px rgba(41, 42, 51, 0.1),\n 0px 5px 11px 0px rgba(41, 42, 51, 0.1),\n 0px 4px 19px 0px rgba(41, 42, 51, 0.09),\n 0px 27px 26px 0px rgba(41, 42, 51, 0.05),\n 0px 56px 31px 0px rgba(41, 42, 51, 0.01),\n 0px 80px 33px 0px rgba(41, 42, 51, 0);\n }\n ".concat(hoverStyles || "", "\n\n &:hover:not(:active) {\n border: 1px solid ").concat(theme.borderColor, ";\n }\n\n &:active {\n background-color: ").concat(theme.activeBackgroundColor, ";\n border: 1px solid ").concat(theme.borderColor, ";\n ").concat(activeStyles || "", "\n }\n "), "\n ");
45861
- });
45880
+ var getCardBaseStyles = function getCardBaseStyles(theme, disabled, extraStyles) {
45881
+ return "\n flex-direction: column;\n align-items: flex-start;\n gap: 40px;\n flex-shrink: 0;\n padding: 24px;\n align-self: stretch;\n border-radius: 8px;\n text-decoration: none;\n font-size: inherit;\n color: inherit;\n font-weight: inherit;\n line-height: inherit;\n background-color: ".concat(disabled ? theme.disabledBackgroundColor : theme.backgroundColor, ";\n border: 1px solid\n ").concat(disabled ? theme.disabledBorderColor : theme.borderColor, ";\n transition: all 0.2s ease-in-out;\n ").concat(disabled ? "pointer-events: none;" : "", "\n ").concat(extraStyles || "", "\n");
45882
+ };
45883
+ var getCardHoverActiveStyles = function getCardHoverActiveStyles(theme, disabled, hoverStyles, activeStyles) {
45884
+ if (disabled) {
45885
+ return "\n &:hover,\n &:active {\n cursor: default;\n box-shadow: none;\n border: 1px solid ".concat(theme.disabledBorderColor, ";\n }\n ");
45886
+ }
45887
+ return "\n &:hover,\n &:active {\n cursor: pointer;\n box-shadow: 0px 0px 0px 0px rgba(41, 42, 51, 0.1),\n 0px 5px 11px 0px rgba(41, 42, 51, 0.1),\n 0px 4px 19px 0px rgba(41, 42, 51, 0.09),\n 0px 27px 26px 0px rgba(41, 42, 51, 0.05),\n 0px 56px 31px 0px rgba(41, 42, 51, 0.01),\n 0px 80px 33px 0px rgba(41, 42, 51, 0);\n }\n ".concat(hoverStyles || "", "\n\n &:hover:not(:active) {\n border: 1px solid ").concat(theme.borderColor, ";\n }\n\n &:active {\n background-color: ").concat(theme.activeBackgroundColor, ";\n border: 1px solid ").concat(theme.borderColor, ";\n ").concat(activeStyles || "", "\n }\n ");
45888
+ };
45862
45889
  var Title$2 = styled__default(Heading$1).withConfig({
45863
45890
  displayName: "LinkCardstyled__Title",
45864
- componentId: "sc-l5q1h2-1"
45865
- })(["display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:stretch;overflow:hidden;text-overflow:ellipsis;font-size:16px;line-height:150%;background-color:transparent;font-weight:", ";color:", ";"], FONT_WEIGHT_SEMIBOLD, function (_ref2) {
45866
- var disabled = _ref2.$disabled,
45867
- theme = _ref2.$theme;
45891
+ componentId: "sc-l5q1h2-0"
45892
+ })(["display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:stretch;overflow:hidden;text-overflow:ellipsis;font-size:16px;line-height:150%;background-color:transparent;font-weight:", ";color:", ";"], FONT_WEIGHT_SEMIBOLD, function (_ref) {
45893
+ var disabled = _ref.$disabled,
45894
+ theme = _ref.$theme;
45868
45895
  return disabled ? theme.disabledColor : theme.color;
45869
45896
  });
45870
45897
  var Subtitle = styled__default(Paragraph$1).withConfig({
45871
45898
  displayName: "LinkCardstyled__Subtitle",
45872
- componentId: "sc-l5q1h2-2"
45873
- })(["overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:stretch;font-size:14px;line-height:150%;letter-spacing:0.14px;font-weight:", ";color:", ";"], FONT_WEIGHT_REGULAR, function (_ref3) {
45874
- var disabled = _ref3.$disabled,
45875
- theme = _ref3.$theme;
45899
+ componentId: "sc-l5q1h2-1"
45900
+ })(["overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;align-self:stretch;font-size:14px;line-height:150%;letter-spacing:0.14px;font-weight:", ";color:", ";"], FONT_WEIGHT_REGULAR, function (_ref2) {
45901
+ var disabled = _ref2.$disabled,
45902
+ theme = _ref2.$theme;
45876
45903
  return disabled ? theme.disabledColor : theme.textColor;
45877
45904
  });
45878
45905
  var Footer = styled__default(Stack).withConfig({
45879
45906
  displayName: "LinkCardstyled__Footer",
45880
- componentId: "sc-l5q1h2-3"
45907
+ componentId: "sc-l5q1h2-2"
45881
45908
  })(["align-items:center;width:100%;"]);
45882
45909
 
45883
45910
  var LinkCard = function LinkCard(_ref) {
@@ -45908,21 +45935,9 @@ var LinkCard = function LinkCard(_ref) {
45908
45935
  isExternalLink = _ref$isExternalLink === void 0 ? false : _ref$isExternalLink;
45909
45936
  var regex = /\W/g;
45910
45937
  var locatorSlug = title === null || title === void 0 || (_title$toLowerCase = title.toLowerCase) === null || _title$toLowerCase === void 0 || (_title$toLowerCase = _title$toLowerCase.call(title)) === null || _title$toLowerCase === void 0 || (_title$toLowerCase$re = _title$toLowerCase.replaceAll) === null || _title$toLowerCase$re === void 0 ? void 0 : _title$toLowerCase$re.call(_title$toLowerCase, regex, "-");
45911
- return /*#__PURE__*/React__default.createElement(StyledAnchor, {
45912
- key: "link-card-".concat(locatorSlug),
45913
- href: disabled ? undefined : href,
45914
- rel: isExternalLink ? "noopener noreferrer" : undefined,
45915
- target: isExternalLink ? "_blank" : undefined,
45916
- tabIndex: disabled ? -1 : 0,
45917
- "aria-disabled": disabled,
45918
- $disabled: disabled,
45919
- "aria-label": "".concat(title, ", ").concat(subtitle),
45920
- "data-qa": "link-card-".concat(locatorSlug),
45921
- $theme: themeValues,
45922
- $extraStyles: disabled ? "pointer-events: none; ".concat(extraStyles) : extraStyles,
45923
- $hoverStyles: extraHoverStyles,
45924
- $activeStyles: extraActiveStyles
45925
- }, /*#__PURE__*/React__default.createElement(Stack, {
45938
+ var baseStyles = getCardBaseStyles(themeValues, disabled, extraStyles);
45939
+ var hoverActiveStyles = getCardHoverActiveStyles(themeValues, disabled, extraHoverStyles, extraActiveStyles);
45940
+ var cardContent = /*#__PURE__*/React__default.createElement(Stack, {
45926
45941
  childGap: 0,
45927
45942
  bottomItem: 3,
45928
45943
  justify: "space-between",
@@ -45964,7 +45979,30 @@ var LinkCard = function LinkCard(_ref) {
45964
45979
  justify: "space-between"
45965
45980
  }, showLeft && !!leftContent ? leftContent : /*#__PURE__*/React__default.createElement(Box, {
45966
45981
  extraStyles: "margin-right: auto;"
45967
- }), showRight && !!rightContent && rightContent))));
45982
+ }), showRight && !!rightContent && rightContent)));
45983
+ if (isExternalLink) {
45984
+ return /*#__PURE__*/React__default.createElement(ExternalLink, {
45985
+ key: "link-card-".concat(locatorSlug),
45986
+ href: disabled ? undefined : href,
45987
+ newTab: true,
45988
+ isUnderlined: false,
45989
+ tabIndex: disabled ? "-1" : "0",
45990
+ ariaLabel: "".concat(title, ", ").concat(subtitle),
45991
+ dataQa: "link-card-".concat(locatorSlug),
45992
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
45993
+ }, cardContent);
45994
+ }
45995
+ return /*#__PURE__*/React__default.createElement(InternalLink, {
45996
+ key: "link-card-".concat(locatorSlug),
45997
+ to: disabled ? undefined : href,
45998
+ isUnderlined: false,
45999
+ hoverUnderline: false,
46000
+ tabIndex: disabled ? "-1" : "0",
46001
+ "aria-label": "".concat(title, ", ").concat(subtitle),
46002
+ "aria-disabled": disabled,
46003
+ "data-qa": "link-card-".concat(locatorSlug),
46004
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
46005
+ }, cardContent);
45968
46006
  };
45969
46007
  var LinkCard$1 = themeComponent(LinkCard, "LinkCard", fallbackValues$L, "primary");
45970
46008
 
@@ -46126,7 +46164,7 @@ var NavMenuMobile = function NavMenuMobile(_ref3) {
46126
46164
  width: "100%",
46127
46165
  maxWidth: "400px",
46128
46166
  padding: "1rem 0.5rem",
46129
- extraStyles: "position: relative; max-width: 400px; height: calc(100vh - 72px);",
46167
+ extraStyles: "position: relative; max-width: 400px; height: calc(100vh - 72px); overflow-y: auto;",
46130
46168
  background: themeValues.backgroundColor
46131
46169
  }, menuContent));
46132
46170
  };