@skbkontur/ui-kit
Version:
27 lines • 2.09 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var styled_components_1 = require("../../lib/styled-components");
var Clickable_1 = tslib_1.__importDefault(require("../internal/Clickable"));
var focus_visible_selector_1 = require("../internal/focus-visible-selector");
var useTheme = function (_a) {
var theme = _a.theme, _b = _a.use, use = _b === void 0 ? 'default' : _b;
return theme.link[use];
};
var useProp = function (prop, state) { return function (props) {
if (useTheme(props)) {
if (state) {
return useTheme(props)[state][prop];
}
return useTheme(props).default[prop];
}
return;
}; };
var hoverTextDecoration = function (_a) {
var theme = _a.theme;
return theme.link.hoverTextDecoration;
};
exports.LinkView = Clickable_1.default.extend(templateObject_1 || (templateObject_1 = tslib_1.__makeTemplateObject(["\n outline: none;\n text-decoration: none;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n ", " {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n\n &:hover,\n ", " {\n text-decoration: ", ";\n }\n\n ", ";\n"], ["\n outline: none;\n text-decoration: none;\n color: ", ";\n\n &:hover {\n color: ", ";\n }\n\n ", " {\n color: ", ";\n }\n\n &:active {\n color: ", ";\n }\n\n &:hover,\n ", " {\n text-decoration: ", ";\n }\n\n ",
";\n"])), function (props) { return useProp('color'); }, function (props) { return useProp('color', 'hover'); }, focus_visible_selector_1.FocusVisible, function (props) { return useProp('color', 'focus'); }, function (props) { return useProp('color', 'active'); }, focus_visible_selector_1.FocusVisible, hoverTextDecoration, styled_components_1.isTruthyProp('disabled')(templateObject_2 || (templateObject_2 = tslib_1.__makeTemplateObject(["\n color: ", ";\n pointer-events: none;\n "], ["\n color: ", ";\n pointer-events: none;\n "])), useProp('color', 'disabled')));
var templateObject_2, templateObject_1;
//# sourceMappingURL=LinkView.js.map