@thecb/components 12.0.0 → 12.0.1-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 +45 -37
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +45 -37
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/link-card/LinkCard.js +92 -68
- package/src/components/molecules/link-card/LinkCard.stories.js +17 -13
- package/src/components/molecules/link-card/LinkCard.styled.js +45 -45
- package/src/components/molecules/link-card/index.d.ts +4 -1
package/dist/index.esm.js
CHANGED
|
@@ -45831,37 +45831,34 @@ var fallbackValues$L = {
|
|
|
45831
45831
|
textColor: textColor$5
|
|
45832
45832
|
};
|
|
45833
45833
|
|
|
45834
|
-
var
|
|
45835
|
-
|
|
45836
|
-
|
|
45837
|
-
|
|
45838
|
-
|
|
45839
|
-
|
|
45840
|
-
|
|
45841
|
-
|
|
45842
|
-
|
|
45843
|
-
activeStyles = _ref.$activeStyles;
|
|
45844
|
-
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 ");
|
|
45845
|
-
});
|
|
45834
|
+
var getCardBaseStyles = function getCardBaseStyles(theme, disabled, extraStyles) {
|
|
45835
|
+
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");
|
|
45836
|
+
};
|
|
45837
|
+
var getCardHoverActiveStyles = function getCardHoverActiveStyles(theme, disabled, hoverStyles, activeStyles) {
|
|
45838
|
+
if (disabled) {
|
|
45839
|
+
return "\n &:hover,\n &:active {\n cursor: default;\n box-shadow: none;\n border: 1px solid ".concat(theme.disabledBorderColor, ";\n }\n ");
|
|
45840
|
+
}
|
|
45841
|
+
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 ");
|
|
45842
|
+
};
|
|
45846
45843
|
var Title$2 = styled(Heading$1).withConfig({
|
|
45847
45844
|
displayName: "LinkCardstyled__Title",
|
|
45848
|
-
componentId: "sc-l5q1h2-
|
|
45849
|
-
})(["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 (
|
|
45850
|
-
var disabled =
|
|
45851
|
-
theme =
|
|
45845
|
+
componentId: "sc-l5q1h2-0"
|
|
45846
|
+
})(["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) {
|
|
45847
|
+
var disabled = _ref.$disabled,
|
|
45848
|
+
theme = _ref.$theme;
|
|
45852
45849
|
return disabled ? theme.disabledColor : theme.color;
|
|
45853
45850
|
});
|
|
45854
45851
|
var Subtitle = styled(Paragraph$1).withConfig({
|
|
45855
45852
|
displayName: "LinkCardstyled__Subtitle",
|
|
45856
|
-
componentId: "sc-l5q1h2-
|
|
45857
|
-
})(["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 (
|
|
45858
|
-
var disabled =
|
|
45859
|
-
theme =
|
|
45853
|
+
componentId: "sc-l5q1h2-1"
|
|
45854
|
+
})(["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) {
|
|
45855
|
+
var disabled = _ref2.$disabled,
|
|
45856
|
+
theme = _ref2.$theme;
|
|
45860
45857
|
return disabled ? theme.disabledColor : theme.textColor;
|
|
45861
45858
|
});
|
|
45862
45859
|
var Footer = styled(Stack).withConfig({
|
|
45863
45860
|
displayName: "LinkCardstyled__Footer",
|
|
45864
|
-
componentId: "sc-l5q1h2-
|
|
45861
|
+
componentId: "sc-l5q1h2-2"
|
|
45865
45862
|
})(["align-items:center;width:100%;"]);
|
|
45866
45863
|
|
|
45867
45864
|
var LinkCard = function LinkCard(_ref) {
|
|
@@ -45892,21 +45889,9 @@ var LinkCard = function LinkCard(_ref) {
|
|
|
45892
45889
|
isExternalLink = _ref$isExternalLink === void 0 ? false : _ref$isExternalLink;
|
|
45893
45890
|
var regex = /\W/g;
|
|
45894
45891
|
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, "-");
|
|
45895
|
-
|
|
45896
|
-
|
|
45897
|
-
|
|
45898
|
-
rel: isExternalLink ? "noopener noreferrer" : undefined,
|
|
45899
|
-
target: isExternalLink ? "_blank" : undefined,
|
|
45900
|
-
tabIndex: disabled ? -1 : 0,
|
|
45901
|
-
"aria-disabled": disabled,
|
|
45902
|
-
$disabled: disabled,
|
|
45903
|
-
"aria-label": "".concat(title, ", ").concat(subtitle),
|
|
45904
|
-
"data-qa": "link-card-".concat(locatorSlug),
|
|
45905
|
-
$theme: themeValues,
|
|
45906
|
-
$extraStyles: disabled ? "pointer-events: none; ".concat(extraStyles) : extraStyles,
|
|
45907
|
-
$hoverStyles: extraHoverStyles,
|
|
45908
|
-
$activeStyles: extraActiveStyles
|
|
45909
|
-
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
45892
|
+
var baseStyles = getCardBaseStyles(themeValues, disabled, extraStyles);
|
|
45893
|
+
var hoverActiveStyles = getCardHoverActiveStyles(themeValues, disabled, extraHoverStyles, extraActiveStyles);
|
|
45894
|
+
var cardContent = /*#__PURE__*/React__default.createElement(Stack, {
|
|
45910
45895
|
childGap: 0,
|
|
45911
45896
|
bottomItem: 3,
|
|
45912
45897
|
justify: "space-between",
|
|
@@ -45948,7 +45933,30 @@ var LinkCard = function LinkCard(_ref) {
|
|
|
45948
45933
|
justify: "space-between"
|
|
45949
45934
|
}, showLeft && !!leftContent ? leftContent : /*#__PURE__*/React__default.createElement(Box, {
|
|
45950
45935
|
extraStyles: "margin-right: auto;"
|
|
45951
|
-
}), showRight && !!rightContent && rightContent)))
|
|
45936
|
+
}), showRight && !!rightContent && rightContent)));
|
|
45937
|
+
if (isExternalLink) {
|
|
45938
|
+
return /*#__PURE__*/React__default.createElement(ExternalLink, {
|
|
45939
|
+
key: "link-card-".concat(locatorSlug),
|
|
45940
|
+
href: disabled ? "" : href,
|
|
45941
|
+
newTab: true,
|
|
45942
|
+
isUnderlined: false,
|
|
45943
|
+
tabIndex: disabled ? "-1" : "0",
|
|
45944
|
+
ariaLabel: "".concat(title, ", ").concat(subtitle),
|
|
45945
|
+
dataQa: "link-card-".concat(locatorSlug),
|
|
45946
|
+
extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
|
|
45947
|
+
}, cardContent);
|
|
45948
|
+
}
|
|
45949
|
+
return /*#__PURE__*/React__default.createElement(InternalLink, {
|
|
45950
|
+
key: "link-card-".concat(locatorSlug),
|
|
45951
|
+
to: disabled ? "" : href,
|
|
45952
|
+
isUnderlined: false,
|
|
45953
|
+
hoverUnderline: false,
|
|
45954
|
+
tabIndex: disabled ? "-1" : "0",
|
|
45955
|
+
"aria-label": "".concat(title, ", ").concat(subtitle),
|
|
45956
|
+
"aria-disabled": disabled,
|
|
45957
|
+
"data-qa": "link-card-".concat(locatorSlug),
|
|
45958
|
+
extraStyles: "".concat(baseStyles, " ").concat(hoverActiveStyles)
|
|
45959
|
+
}, cardContent);
|
|
45952
45960
|
};
|
|
45953
45961
|
var LinkCard$1 = themeComponent(LinkCard, "LinkCard", fallbackValues$L, "primary");
|
|
45954
45962
|
|