@skbkontur/ui-kit
Version:
39 lines • 2.04 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var utils_1 = require("../utils");
var common_1 = require("./common");
var CHECKBOX_TYPES = ['checked', 'unchecked'];
var CHECKBOX_STATES = ['default', 'hover', 'active', 'focus', 'disabled'];
exports.getCheckboxTheme = function (base) {
if (base === void 0) { base = common_1.getCommonTheme(); }
var getColor = utils_1.getThemeColor.bind(null, base.colors);
var checkBoxStyles = base.components.checkbox;
var stylesForType = {
checked: {},
unchecked: {}
};
CHECKBOX_TYPES.forEach(function (type) {
CHECKBOX_STATES.forEach(function (state) {
stylesForType[type][state] = {
color: getColor(checkBoxStyles[type][state].text),
background: getColor(checkBoxStyles[type][state].background),
'box-shadow': getColor(checkBoxStyles[type][state].shadow),
border: getColor(checkBoxStyles[type][state].border)
};
});
});
return tslib_1.__assign({}, stylesForType, { box: {
size: '16px',
background: "\n linear-gradient(\n #fdfdfd,\n #ededed\n )\n ",
shadow: "\n 0 1px 0 0 rgba(0, 0, 0, 0.15),\n 0 0 0 1px rgba(0, 0, 0, 0.15)\n ",
hoverBackground: "\n linear-gradient(\n -180deg,\n #f2f2f2 0,\n #dfdfdf 100%\n )\n ",
hoverShadow: "\n 0 1px 0 0 rgba(0, 0, 0, 0.15),\n 0 0 0 1px rgba(0, 0, 0, 0.15)\n ",
activeBackground: "#e1e1e1",
activeShadow: "\n 0 -1px 0 0 rgba(0, 0, 0, 0.1),\n 0 0 0 1px rgba(0, 0, 0, 0.2),\n inset 0 1px 2px 0 rgba(0, 0, 0, 0.1);\n ",
disabledBackground: "#f2f2f2",
disabledShadow: "\n 0 0 0 1px rgba(0, 0, 0, 0.15)\n ",
borderRadius: '2px'
} });
};
//# sourceMappingURL=checkbox.js.map
;