"use strict";
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
    if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
    return cooked;
};
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var styled_components_1 = __importDefault(require("styled-components"));
var styleConstants_1 = require("../styleConstants");
var CheckboxSizes;
(function (CheckboxSizes) {
    CheckboxSizes["SMALL"] = "SMALL";
})(CheckboxSizes = exports.CheckboxSizes || (exports.CheckboxSizes = {}));
var Box = styled_components_1.default.span(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  position: absolute;\n  cursor: ", ";\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  &:after {\n    content: \"\";\n    position: absolute;\n    display: none;\n    left: 4px;\n    top: ", "px;\n    width: ", "px;\n    height: ", "px;\n    border: solid white;\n    border-width: 0 3px 3px 0;\n    transform: rotate(45deg);\n  }\n"], ["\n  position: absolute;\n  cursor: ", ";\n  top: 0;\n  left: 0;\n  bottom: 0;\n  right: 0;\n  &:after {\n    content: \"\";\n    position: absolute;\n    display: none;\n    left: 4px;\n    top: ", "px;\n    width: ", "px;\n    height: ", "px;\n    border: solid white;\n    border-width: 0 3px 3px 0;\n    transform: rotate(45deg);\n  }\n"])), function (props) { return (props.locked ? "default" : "pointer"); }, function (props) { return (props.size === CheckboxSizes.SMALL ? "1" : "0"); }, function (props) { return (props.size === CheckboxSizes.SMALL ? "3" : "5"); }, function (props) { return (props.size === CheckboxSizes.SMALL ? "7" : "10"); });
var Container = styled_components_1.default.label(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  position: relative;\n  display: inline-block;\n  box-sizing: content-box;\n  width: ", "px;\n  height: ", "px;\n  vertical-align: ", ";\n\n  input {\n    display: none;\n  }\n  input + ", " {\n    border-radius: 2px;\n    color: transparent;\n    border: ", "px solid\n      ", ";\n    background-color: transparent;\n  }\n  input:checked + ", " {\n    color: ", ";\n    border: ", "px solid\n      ", ";\n    background-color: ", ";\n    opacity: ", ";\n  }\n  input:checked + ", ":after {\n    display: block;\n  }\n"], ["\n  position: relative;\n  display: inline-block;\n  box-sizing: content-box;\n  width: ", "px;\n  height: ", "px;\n  vertical-align: ", ";\n\n  input {\n    display: none;\n  }\n  input + ", " {\n    border-radius: 2px;\n    color: transparent;\n    border: ", "px solid\n      ", ";\n    background-color: transparent;\n  }\n  input:checked + ", " {\n    color: ", ";\n    border: ", "px solid\n      ", ";\n    background-color: ", ";\n    opacity: ", ";\n  }\n  input:checked + ", ":after {\n    display: block;\n  }\n"])), function (props) { return (props.size === CheckboxSizes.SMALL ? "16" : "20"); }, function (props) { return (props.size === CheckboxSizes.SMALL ? "16" : "20"); }, function (props) { return (props.size === CheckboxSizes.SMALL ? "middle" : "bottom"); }, Box, function (props) { return (props.size === CheckboxSizes.SMALL ? "1" : "2"); }, function (props) { return props.theme.checkboxInactiveColor; }, Box, styleConstants_1.colors.basic.WHITE, function (props) { return (props.size === CheckboxSizes.SMALL ? "1" : "2"); }, function (props) { return props.theme.checkboxActiveColor; }, function (props) { return props.theme.checkboxActiveColor; }, function (props) { return (props.locked ? 0.7 : 1); }, Box);
exports.DEFAULT_CHECKBOX_THEME = {
    checkboxInactiveColor: styleConstants_1.colors.accent.CIVIL_GRAY_2,
    checkboxActiveColor: styleConstants_1.colors.accent.CIVIL_BLUE,
};
Container.defaultProps = {
    theme: exports.DEFAULT_CHECKBOX_THEME,
};
exports.Checkbox = function (props) {
    return (React.createElement(Container, { locked: props.locked, size: props.size },
        React.createElement("input", { onChange: function () {
                if (!props.locked) {
                    props.onClick();
                }
            }, checked: props.checked, id: props.id, type: "checkbox" }),
        React.createElement(Box, { locked: props.locked, size: props.size })));
};
var templateObject_1, templateObject_2;
//# sourceMappingURL=Checkbox.js.map