@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.cjs.js +46 -38
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +46 -38
- 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/LinkCard.theme.js +2 -1
- package/src/components/molecules/link-card/index.d.ts +4 -1
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 = MOON_RAKER;
|
|
45837
45837
|
var color$c = ROYAL_BLUE_VIVID;
|
|
45838
45838
|
var textColor$5 = BRIGHT_GREY;
|
|
45839
45839
|
var fallbackValues$L = {
|
|
@@ -45847,37 +45847,34 @@ var fallbackValues$L = {
|
|
|
45847
45847
|
textColor: textColor$5
|
|
45848
45848
|
};
|
|
45849
45849
|
|
|
45850
|
-
var
|
|
45851
|
-
|
|
45852
|
-
|
|
45853
|
-
|
|
45854
|
-
|
|
45855
|
-
|
|
45856
|
-
|
|
45857
|
-
|
|
45858
|
-
|
|
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-
|
|
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 (
|
|
45866
|
-
var disabled =
|
|
45867
|
-
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-
|
|
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 (
|
|
45874
|
-
var disabled =
|
|
45875
|
-
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-
|
|
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
|
-
|
|
45912
|
-
|
|
45913
|
-
|
|
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 ? undefined : 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
|
|