@thecb/components 12.0.2-beta.2 → 12.0.2

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
@@ -45825,7 +45825,7 @@ var disabledBorderColor$1 = GHOST_GREY;
45825
45825
  var disabledColor$2 = MANATEE_GREY;
45826
45826
  var activeBackgroundColor$1 = CORNFLOWER_BLUE;
45827
45827
  var backgroundColor$a = LINK_WATER;
45828
- var borderColor$5 = MANATEE_GREY;
45828
+ var borderColor$5 = MOON_RAKER;
45829
45829
  var color$c = ROYAL_BLUE_VIVID;
45830
45830
  var textColor$5 = BRIGHT_GREY;
45831
45831
  var fallbackValues$L = {
@@ -45839,37 +45839,34 @@ var fallbackValues$L = {
45839
45839
  textColor: textColor$5
45840
45840
  };
45841
45841
 
45842
- var StyledAnchor = styled("a").withConfig({
45843
- displayName: "LinkCardstyled__StyledAnchor",
45844
- componentId: "sc-l5q1h2-0"
45845
- })(["", ""], function (_ref) {
45846
- var disabled = _ref.$disabled,
45847
- theme = _ref.$theme,
45848
- extraStyles = _ref.$extraStyles,
45849
- disabledStyles = _ref.$disabledStyles,
45850
- hoverStyles = _ref.$hoverStyles,
45851
- activeStyles = _ref.$activeStyles;
45852
- 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 ");
45853
- });
45842
+ var getCardBaseStyles = function getCardBaseStyles(theme, disabled, extraStyles) {
45843
+ 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");
45844
+ };
45845
+ var getCardHoverActiveStyles = function getCardHoverActiveStyles(theme, disabled, hoverStyles, activeStyles) {
45846
+ if (disabled) {
45847
+ return "\n &:hover,\n &:active {\n cursor: default;\n box-shadow: none;\n border: 1px solid ".concat(theme.disabledBorderColor, ";\n }\n ");
45848
+ }
45849
+ 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 ");
45850
+ };
45854
45851
  var Title$2 = styled(Heading$1).withConfig({
45855
45852
  displayName: "LinkCardstyled__Title",
45856
- componentId: "sc-l5q1h2-1"
45857
- })(["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) {
45858
- var disabled = _ref2.$disabled,
45859
- theme = _ref2.$theme;
45853
+ componentId: "sc-l5q1h2-0"
45854
+ })(["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) {
45855
+ var disabled = _ref.$disabled,
45856
+ theme = _ref.$theme;
45860
45857
  return disabled ? theme.disabledColor : theme.color;
45861
45858
  });
45862
45859
  var Subtitle = styled(Paragraph$1).withConfig({
45863
45860
  displayName: "LinkCardstyled__Subtitle",
45864
- componentId: "sc-l5q1h2-2"
45865
- })(["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) {
45866
- var disabled = _ref3.$disabled,
45867
- theme = _ref3.$theme;
45861
+ componentId: "sc-l5q1h2-1"
45862
+ })(["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) {
45863
+ var disabled = _ref2.$disabled,
45864
+ theme = _ref2.$theme;
45868
45865
  return disabled ? theme.disabledColor : theme.textColor;
45869
45866
  });
45870
45867
  var Footer = styled(Stack).withConfig({
45871
45868
  displayName: "LinkCardstyled__Footer",
45872
- componentId: "sc-l5q1h2-3"
45869
+ componentId: "sc-l5q1h2-2"
45873
45870
  })(["align-items:center;width:100%;"]);
45874
45871
 
45875
45872
  var LinkCard = function LinkCard(_ref) {
@@ -45900,21 +45897,9 @@ var LinkCard = function LinkCard(_ref) {
45900
45897
  isExternalLink = _ref$isExternalLink === void 0 ? false : _ref$isExternalLink;
45901
45898
  var regex = /\W/g;
45902
45899
  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, "-");
45903
- return /*#__PURE__*/React__default.createElement(StyledAnchor, {
45904
- key: "link-card-".concat(locatorSlug),
45905
- href: disabled ? undefined : href,
45906
- rel: isExternalLink ? "noopener noreferrer" : undefined,
45907
- target: isExternalLink ? "_blank" : undefined,
45908
- tabIndex: disabled ? -1 : 0,
45909
- "aria-disabled": disabled,
45910
- $disabled: disabled,
45911
- "aria-label": "".concat(title, ", ").concat(subtitle),
45912
- "data-qa": "link-card-".concat(locatorSlug),
45913
- $theme: themeValues,
45914
- $extraStyles: disabled ? "pointer-events: none; ".concat(extraStyles) : extraStyles,
45915
- $hoverStyles: extraHoverStyles,
45916
- $activeStyles: extraActiveStyles
45917
- }, /*#__PURE__*/React__default.createElement(Stack, {
45900
+ var baseStyles = getCardBaseStyles(themeValues, disabled, extraStyles);
45901
+ var hoverActiveStyles = getCardHoverActiveStyles(themeValues, disabled, extraHoverStyles, extraActiveStyles);
45902
+ var cardContent = /*#__PURE__*/React__default.createElement(Stack, {
45918
45903
  childGap: 0,
45919
45904
  bottomItem: 3,
45920
45905
  justify: "space-between",
@@ -45956,7 +45941,30 @@ var LinkCard = function LinkCard(_ref) {
45956
45941
  justify: "space-between"
45957
45942
  }, showLeft && !!leftContent ? leftContent : /*#__PURE__*/React__default.createElement(Box, {
45958
45943
  extraStyles: "margin-right: auto;"
45959
- }), showRight && !!rightContent && rightContent))));
45944
+ }), showRight && !!rightContent && rightContent)));
45945
+ if (isExternalLink) {
45946
+ return /*#__PURE__*/React__default.createElement(ExternalLink, {
45947
+ key: "link-card-".concat(locatorSlug),
45948
+ href: disabled ? undefined : href,
45949
+ newTab: true,
45950
+ isUnderlined: false,
45951
+ tabIndex: disabled ? "-1" : "0",
45952
+ ariaLabel: "".concat(title, ", ").concat(subtitle),
45953
+ dataQa: "link-card-".concat(locatorSlug),
45954
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
45955
+ }, cardContent);
45956
+ }
45957
+ return /*#__PURE__*/React__default.createElement(InternalLink, {
45958
+ key: "link-card-".concat(locatorSlug),
45959
+ to: disabled ? undefined : href,
45960
+ isUnderlined: false,
45961
+ hoverUnderline: false,
45962
+ tabIndex: disabled ? "-1" : "0",
45963
+ "aria-label": "".concat(title, ", ").concat(subtitle),
45964
+ "aria-disabled": disabled,
45965
+ "data-qa": "link-card-".concat(locatorSlug),
45966
+ extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
45967
+ }, cardContent);
45960
45968
  };
45961
45969
  var LinkCard$1 = themeComponent(LinkCard, "LinkCard", fallbackValues$L, "primary");
45962
45970