@sitecore/sc-contenthub-blok
Version:
A UI library for [Sitecore Content Hub](https://doc.sitecore.com/ch/).
28 lines • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BlokLink = exports.classes = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const css_1 = require("@emotion/css");
const Foundations_1 = require("../../Foundations");
exports.classes = {
underlineOnHover: (0, css_1.css)({
textDecoration: "none",
"&:hover": {
textDecoration: "underline",
},
}),
underlineAlways: (0, css_1.css)({
textDecoration: "underline",
}),
underlineNever: (0, css_1.css)({
textDecoration: "none",
}),
};
const BlokLink = ({ href, children, colorScheme = "primary", underline = "hover", className, ...extraProps }) => {
const linkStyle = {
color: Foundations_1.colorMap[colorScheme]?.[500] ?? Foundations_1.neutral[500],
};
return ((0, jsx_runtime_1.jsx)("a", { href: href, style: linkStyle, ...extraProps, className: (0, css_1.cx)(underline === "hover" ? exports.classes.underlineOnHover : "", underline === "always" ? exports.classes.underlineAlways : "", underline === "never" ? exports.classes.underlineNever : "", className), children: children }));
};
exports.BlokLink = BlokLink;
//# sourceMappingURL=BlokLink.js.map