@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.cjs.js
CHANGED
|
@@ -45839,37 +45839,34 @@ var fallbackValues$L = {
|
|
|
45839
45839
|
textColor: textColor$5
|
|
45840
45840
|
};
|
|
45841
45841
|
|
|
45842
|
-
var
|
|
45843
|
-
|
|
45844
|
-
|
|
45845
|
-
|
|
45846
|
-
|
|
45847
|
-
|
|
45848
|
-
|
|
45849
|
-
|
|
45850
|
-
|
|
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__default(Heading$1).withConfig({
|
|
45855
45852
|
displayName: "LinkCardstyled__Title",
|
|
45856
|
-
componentId: "sc-l5q1h2-
|
|
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 (
|
|
45858
|
-
var disabled =
|
|
45859
|
-
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__default(Paragraph$1).withConfig({
|
|
45863
45860
|
displayName: "LinkCardstyled__Subtitle",
|
|
45864
|
-
componentId: "sc-l5q1h2-
|
|
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 (
|
|
45866
|
-
var disabled =
|
|
45867
|
-
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__default(Stack).withConfig({
|
|
45871
45868
|
displayName: "LinkCardstyled__Footer",
|
|
45872
|
-
componentId: "sc-l5q1h2-
|
|
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
|
-
|
|
45904
|
-
|
|
45905
|
-
|
|
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 ? "" : 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 ? "" : 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
|
|