(function (factory) {
    if (typeof module === "object" && typeof module.exports === "object") {
        var v = factory(require, exports);
        if (v !== undefined) module.exports = v;
    }
    else if (typeof define === "function" && define.amd) {
        define(["require", "exports", "tslib", "styled-components", "polished", "../utils/theme/getTheme", "../Pallette/themes", "./themes"], factory);
    }
})(function (require, exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    exports.RadioButtonComponent = exports.Input = exports.Mark = void 0;
    var tslib_1 = require("tslib");
    var styled_components_1 = (0, tslib_1.__importStar)(require("styled-components"));
    var polished_1 = require("polished");
    var getTheme_1 = require("../utils/theme/getTheme");
    var themes_1 = require("../Pallette/themes");
    var themes_2 = require("./themes");
    var COMPONENT_NAME = "radioButton";
    exports.Mark = styled_components_1.default.span.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: themes_2.defaultThemeRadioButton
        })
    }); })(templateObject_3 || (templateObject_3 = (0, tslib_1.__makeTemplateObject)(["\n  position: relative;\n  transform: translateY(-50%);\n  border-radius: 50%;\n  transition: 0.2s;\n  left: 4px;\n  top: 12px;\n\n  ", ";\n\n  ", "\n\n  &:after {\n    content: \"\";\n    position: absolute;\n    left: 50%;\n    top: 50%;\n    transform: translate(-50%, -50%) scale(0);\n    border-radius: 50%;\n    transition: all 0.2s;\n    ", "\n    background: ", ";\n  }\n"], ["\n  position: relative;\n  transform: translateY(-50%);\n  border-radius: 50%;\n  transition: 0.2s;\n  left: 4px;\n  top: 12px;\n\n  ", ";\n\n  ", "\n\n  &:after {\n    content: \"\";\n    position: absolute;\n    left: 50%;\n    top: 50%;\n    transform: translate(-50%, -50%) scale(0);\n    border-radius: 50%;\n    transition: all 0.2s;\n    ", "\n    background: ", ";\n  }\n"])), (0, polished_1.size)("16px"), function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        if (isDisabled) {
            return (0, styled_components_1.css)(templateObject_1 || (templateObject_1 = (0, tslib_1.__makeTemplateObject)(["\n        background-color: ", ";\n        border: none;\n      "], ["\n        background-color: ", ";\n        border: none;\n      "])), theme.components[COMPONENT_NAME]
                .backgroundDisabled);
        }
        return (0, styled_components_1.css)(templateObject_2 || (templateObject_2 = (0, tslib_1.__makeTemplateObject)(["\n      background-color: ", ";\n      outline: solid 1px ", ";\n    "], ["\n      background-color: ", ";\n      outline: solid 1px ", ";\n    "])), theme.components[COMPONENT_NAME].background, theme.components[COMPONENT_NAME].outlineColor);
    }, (0, polished_1.size)("8px"), function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return isDisabled
            ? theme.components[COMPONENT_NAME].backgroundDisabled
            : theme.components[COMPONENT_NAME].backgroundChecked;
    });
    exports.Mark.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.Input = styled_components_1.default.input.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: themes_2.defaultThemeRadioButton
        })
    }); })(templateObject_6 || (templateObject_6 = (0, tslib_1.__makeTemplateObject)(["\n  position: absolute;\n  opacity: 0;\n  cursor: pointer;\n\n  &:focus ~ ", " {\n    ", "\n  }\n\n  &:checked ~ ", " {\n    border: none;\n    ", "\n  }\n\n  &:checked ~ ", ":after {\n    transform: translate(-50%, -50%) scale(1);\n  }\n"], ["\n  position: absolute;\n  opacity: 0;\n  cursor: pointer;\n\n  &:focus ~ ", " {\n    ", "\n  }\n\n  &:checked ~ ", " {\n    border: none;\n    ", "\n  }\n\n  &:checked ~ ", ":after {\n    transform: translate(-50%, -50%) scale(1);\n  }\n"])), exports.Mark, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return (0, styled_components_1.css)(templateObject_4 || (templateObject_4 = (0, tslib_1.__makeTemplateObject)(["\n        outline: solid 2px\n          ", ";\n      "], ["\n        outline: solid 2px\n          ", ";\n      "])), isDisabled
            ? theme.components[COMPONENT_NAME].backgroundDisabled
            : theme.components[COMPONENT_NAME].backgroundChecked);
    }, exports.Mark, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return (0, styled_components_1.css)(templateObject_5 || (templateObject_5 = (0, tslib_1.__makeTemplateObject)(["\n        background-color: ", ";\n        outline: solid 2px\n          ", ";\n      "], ["\n        background-color: ", ";\n        outline: solid 2px\n          ", ";\n      "])), theme.components[COMPONENT_NAME].backgroundHover, isDisabled
            ? theme.components[COMPONENT_NAME].backgroundDisabled
            : theme.components[COMPONENT_NAME].backgroundChecked);
    }, exports.Mark);
    exports.Input.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    exports.RadioButtonComponent = styled_components_1.default.div.attrs(function (props) { return ({
        theme: (0, getTheme_1.getTheme)({
            theme: props.theme,
            componentName: COMPONENT_NAME,
            defaultTheme: themes_2.defaultThemeRadioButton
        })
    }); })(templateObject_12 || (templateObject_12 = (0, tslib_1.__makeTemplateObject)(["\n  display: flex;\n  position: relative;\n  font-weight: normal;\n  user-select: none;\n  gap: 18px;\n\n  ", "\n\n  color: ", ";\n\n  ", ";\n\n  &:hover,\n  &:focus {\n    color: ", ";\n\n    ", " {\n      ", "\n    }\n\n    ", ":checked ~ ", " {\n      ", " {\n        ", "\n      }\n    }\n  }\n\n  ", ":checked ~ ", " {\n    ", ";\n  }\n"], ["\n  display: flex;\n  position: relative;\n  font-weight: normal;\n  user-select: none;\n  gap: 18px;\n\n  ", "\n\n  color: ", ";\n\n  ", ";\n\n  &:hover,\n  &:focus {\n    color: ", ";\n\n    ", " {\n      ", "\n    }\n\n    ", ":checked ~ ", " {\n      ", " {\n        ", "\n      }\n    }\n  }\n\n  ", ":checked ~ ", " {\n    ", ";\n  }\n"])), function (_a) {
        var isDisabled = _a.isDisabled;
        return (0, styled_components_1.css)(templateObject_7 || (templateObject_7 = (0, tslib_1.__makeTemplateObject)(["\n    pointer-events: ", ";\n    min-height: 24px;\n    cursor: ", ";\n  "], ["\n    pointer-events: ", ";\n    min-height: 24px;\n    cursor: ", ";\n  "])), isDisabled ? "none" : "default", isDisabled ? "not-allowed" : "pointer");
    }, function (_a) {
        var isDisabled = _a.isDisabled, theme = _a.theme, isChecked = _a.isChecked;
        if (isDisabled) {
            return theme.components[COMPONENT_NAME].colorDisabled;
        }
        if (isChecked) {
            return theme.components[COMPONENT_NAME].colorChecked;
        }
        return theme.components[COMPONENT_NAME].color;
    }, function (_a) {
        var isError = _a.isError, theme = _a.theme;
        return isError && (0, styled_components_1.css)(templateObject_8 || (templateObject_8 = (0, tslib_1.__makeTemplateObject)(["\n      ", " {\n        border: solid 2px ", ";\n      }\n    "], ["\n      ", " {\n        border: solid 2px ", ";\n      }\n    "])), exports.Mark, theme.components[COMPONENT_NAME].borderColorError);
    }, function (_a) {
        var theme = _a.theme;
        return theme.components[COMPONENT_NAME].colorHover;
    }, exports.Mark, function (_a) {
        var theme = _a.theme;
        return (0, styled_components_1.css)(templateObject_9 || (templateObject_9 = (0, tslib_1.__makeTemplateObject)(["\n        background: ", ";\n        outline: solid 2px ", ";\n      "], ["\n        background: ", ";\n        outline: solid 2px ", ";\n      "])), theme.components[COMPONENT_NAME].backgroundHover, theme.components[COMPONENT_NAME].outlineColor);
    }, exports.Input, exports.Mark, exports.Mark, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return !isDisabled && (0, styled_components_1.css)(templateObject_10 || (templateObject_10 = (0, tslib_1.__makeTemplateObject)(["\n            background-color: ", ";\n            outline: solid 2px\n              ", ";\n          "], ["\n            background-color: ", ";\n            outline: solid 2px\n              ", ";\n          "])), theme.components[COMPONENT_NAME]
            .backgroundHover, theme.components[COMPONENT_NAME].outlineColorHover);
    }, exports.Input, exports.Mark, function (_a) {
        var theme = _a.theme, isDisabled = _a.isDisabled;
        return !isDisabled && (0, styled_components_1.css)(templateObject_11 || (templateObject_11 = (0, tslib_1.__makeTemplateObject)(["\n        background-color: ", ";\n        outline: solid 2px ", ";\n      "], ["\n        background-color: ", ";\n        outline: solid 2px ", ";\n      "])), theme.components[COMPONENT_NAME].backgroundHover, theme.components[COMPONENT_NAME].backgroundChecked);
    });
    exports.RadioButtonComponent.defaultProps = {
        theme: themes_1.LIGHT_THEME
    };
    var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12;
});
