@thecb/components 12.0.2-beta.1 → 12.0.2-beta.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.cjs.js +38 -46
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +38 -46
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/link-card/LinkCard.js +68 -92
- package/src/components/molecules/link-card/LinkCard.stories.js +13 -17
- package/src/components/molecules/link-card/LinkCard.styled.js +45 -45
- package/src/components/molecules/link-card/LinkCard.theme.js +1 -2
- package/src/components/molecules/link-card/index.d.ts +1 -4
package/dist/index.cjs.js
CHANGED
|
@@ -45833,7 +45833,7 @@ var disabledBorderColor$1 = GHOST_GREY;
|
|
|
45833
45833
|
var disabledColor$2 = MANATEE_GREY;
|
|
45834
45834
|
var activeBackgroundColor$1 = CORNFLOWER_BLUE;
|
|
45835
45835
|
var backgroundColor$a = LINK_WATER;
|
|
45836
|
-
var borderColor$5 =
|
|
45836
|
+
var borderColor$5 = MANATEE_GREY;
|
|
45837
45837
|
var color$c = ROYAL_BLUE_VIVID;
|
|
45838
45838
|
var textColor$5 = BRIGHT_GREY;
|
|
45839
45839
|
var fallbackValues$L = {
|
|
@@ -45847,34 +45847,37 @@ var fallbackValues$L = {
|
|
|
45847
45847
|
textColor: textColor$5
|
|
45848
45848
|
};
|
|
45849
45849
|
|
|
45850
|
-
var
|
|
45851
|
-
|
|
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
|
-
};
|
|
45859
|
-
var Title$2 = styled__default(Heading$1).withConfig({
|
|
45860
|
-
displayName: "LinkCardstyled__Title",
|
|
45850
|
+
var StyledAnchor = styled__default("a").withConfig({
|
|
45851
|
+
displayName: "LinkCardstyled__StyledAnchor",
|
|
45861
45852
|
componentId: "sc-l5q1h2-0"
|
|
45862
|
-
})(["
|
|
45853
|
+
})(["", ""], function (_ref) {
|
|
45863
45854
|
var disabled = _ref.$disabled,
|
|
45864
|
-
theme = _ref.$theme
|
|
45865
|
-
|
|
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 ");
|
|
45866
45861
|
});
|
|
45867
|
-
var
|
|
45868
|
-
displayName: "
|
|
45862
|
+
var Title$2 = styled__default(Heading$1).withConfig({
|
|
45863
|
+
displayName: "LinkCardstyled__Title",
|
|
45869
45864
|
componentId: "sc-l5q1h2-1"
|
|
45870
|
-
})(["
|
|
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) {
|
|
45871
45866
|
var disabled = _ref2.$disabled,
|
|
45872
45867
|
theme = _ref2.$theme;
|
|
45868
|
+
return disabled ? theme.disabledColor : theme.color;
|
|
45869
|
+
});
|
|
45870
|
+
var Subtitle = styled__default(Paragraph$1).withConfig({
|
|
45871
|
+
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;
|
|
45873
45876
|
return disabled ? theme.disabledColor : theme.textColor;
|
|
45874
45877
|
});
|
|
45875
45878
|
var Footer = styled__default(Stack).withConfig({
|
|
45876
45879
|
displayName: "LinkCardstyled__Footer",
|
|
45877
|
-
componentId: "sc-l5q1h2-
|
|
45880
|
+
componentId: "sc-l5q1h2-3"
|
|
45878
45881
|
})(["align-items:center;width:100%;"]);
|
|
45879
45882
|
|
|
45880
45883
|
var LinkCard = function LinkCard(_ref) {
|
|
@@ -45905,9 +45908,21 @@ var LinkCard = function LinkCard(_ref) {
|
|
|
45905
45908
|
isExternalLink = _ref$isExternalLink === void 0 ? false : _ref$isExternalLink;
|
|
45906
45909
|
var regex = /\W/g;
|
|
45907
45910
|
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, "-");
|
|
45908
|
-
|
|
45909
|
-
|
|
45910
|
-
|
|
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, {
|
|
45911
45926
|
childGap: 0,
|
|
45912
45927
|
bottomItem: 3,
|
|
45913
45928
|
justify: "space-between",
|
|
@@ -45949,30 +45964,7 @@ var LinkCard = function LinkCard(_ref) {
|
|
|
45949
45964
|
justify: "space-between"
|
|
45950
45965
|
}, showLeft && !!leftContent ? leftContent : /*#__PURE__*/React__default.createElement(Box, {
|
|
45951
45966
|
extraStyles: "margin-right: auto;"
|
|
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);
|
|
45967
|
+
}), showRight && !!rightContent && rightContent))));
|
|
45976
45968
|
};
|
|
45977
45969
|
var LinkCard$1 = themeComponent(LinkCard, "LinkCard", fallbackValues$L, "primary");
|
|
45978
45970
|
|