@thecb/components 12.0.1-beta.2 → 12.0.2-beta.1

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
@@ -45847,37 +45847,34 @@ var fallbackValues$L = {
45847
45847
  textColor: textColor$5
45848
45848
  };
45849
45849
 
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
- });
45850
+ var getCardBaseStyles = function getCardBaseStyles(theme, disabled, extraStyles) {
45851
+ 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");
45852
+ };
45853
+ var getCardHoverActiveStyles = function getCardHoverActiveStyles(theme, disabled, hoverStyles, activeStyles) {
45854
+ if (disabled) {
45855
+ return "\n &:hover,\n &:active {\n cursor: default;\n box-shadow: none;\n border: 1px solid ".concat(theme.disabledBorderColor, ";\n }\n ");
45856
+ }
45857
+ 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 ");
45858
+ };
45862
45859
  var Title$2 = styled__default(Heading$1).withConfig({
45863
45860
  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;
45861
+ componentId: "sc-l5q1h2-0"
45862
+ })(["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) {
45863
+ var disabled = _ref.$disabled,
45864
+ theme = _ref.$theme;
45868
45865
  return disabled ? theme.disabledColor : theme.color;
45869
45866
  });
45870
45867
  var Subtitle = styled__default(Paragraph$1).withConfig({
45871
45868
  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;
45869
+ componentId: "sc-l5q1h2-1"
45870
+ })(["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) {
45871
+ var disabled = _ref2.$disabled,
45872
+ theme = _ref2.$theme;
45876
45873
  return disabled ? theme.disabledColor : theme.textColor;
45877
45874
  });
45878
45875
  var Footer = styled__default(Stack).withConfig({
45879
45876
  displayName: "LinkCardstyled__Footer",
45880
- componentId: "sc-l5q1h2-3"
45877
+ componentId: "sc-l5q1h2-2"
45881
45878
  })(["align-items:center;width:100%;"]);
45882
45879
 
45883
45880
  var LinkCard = function LinkCard(_ref) {
@@ -45908,21 +45905,9 @@ var LinkCard = function LinkCard(_ref) {
45908
45905
  isExternalLink = _ref$isExternalLink === void 0 ? false : _ref$isExternalLink;
45909
45906
  var regex = /\W/g;
45910
45907
  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, {
45908
+ var baseStyles = getCardBaseStyles(themeValues, disabled, extraStyles);
45909
+ var hoverActiveStyles = getCardHoverActiveStyles(themeValues, disabled, extraHoverStyles, extraActiveStyles);
45910
+ var cardContent = /*#__PURE__*/React__default.createElement(Stack, {
45926
45911
  childGap: 0,
45927
45912
  bottomItem: 3,
45928
45913
  justify: "space-between",
@@ -45964,7 +45949,30 @@ var LinkCard = function LinkCard(_ref) {
45964
45949
  justify: "space-between"
45965
45950
  }, showLeft && !!leftContent ? leftContent : /*#__PURE__*/React__default.createElement(Box, {
45966
45951
  extraStyles: "margin-right: auto;"
45967
- }), showRight && !!rightContent && rightContent))));
45952
+ }), showRight && !!rightContent && rightContent)));
45953
+ if (isExternalLink) {
45954
+ return /*#__PURE__*/React__default.createElement(ExternalLink, {
45955
+ key: "link-card-".concat(locatorSlug),
45956
+ href: disabled ? undefined : href,
45957
+ newTab: true,
45958
+ isUnderlined: false,
45959
+ tabIndex: disabled ? "-1" : "0",
45960
+ ariaLabel: "".concat(title, ", ").concat(subtitle),
45961
+ dataQa: "link-card-".concat(locatorSlug),
45962
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
45963
+ }, cardContent);
45964
+ }
45965
+ return /*#__PURE__*/React__default.createElement(InternalLink, {
45966
+ key: "link-card-".concat(locatorSlug),
45967
+ to: disabled ? "" : href,
45968
+ isUnderlined: false,
45969
+ hoverUnderline: false,
45970
+ tabIndex: disabled ? "-1" : "0",
45971
+ "aria-label": "".concat(title, ", ").concat(subtitle),
45972
+ "aria-disabled": disabled,
45973
+ "data-qa": "link-card-".concat(locatorSlug),
45974
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
45975
+ }, cardContent);
45968
45976
  };
45969
45977
  var LinkCard$1 = themeComponent(LinkCard, "LinkCard", fallbackValues$L, "primary");
45970
45978
 
@@ -46126,7 +46134,7 @@ var NavMenuMobile = function NavMenuMobile(_ref3) {
46126
46134
  width: "100%",
46127
46135
  maxWidth: "400px",
46128
46136
  padding: "1rem 0.5rem",
46129
- extraStyles: "position: relative; max-width: 400px; height: calc(100vh - 72px); overflow-y: auto;",
46137
+ extraStyles: "position: relative; max-width: 400px; height: calc(100vh - 72px);",
46130
46138
  background: themeValues.backgroundColor
46131
46139
  }, menuContent));
46132
46140
  };