"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
var styled_components_1 = require("styled-components");
var hoc_1 = require("../hoc");
var utils_1 = require("../utils");
var theme_1 = require("../theme");
var recompose_1 = require("recompose");
var getColor = function (props) {
    if (props.invalid) {
        return props.theme.colors.danger.main;
    }
    if (props.valid) {
        return props.theme.colors.success.main;
    }
    if (props.disabled) {
        return props.theme.colors.gray.light;
    }
    return props.theme.colors.gray.main;
};
var Base = styled_components_1.default.input(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  border-radius: ", ";\n  height: ", ";\n  font-size: inherit;\n  border: 1px solid ", ";\n  padding: 0px 16px;\n\n  &[disabled] {\n    background-color: ", ";\n  }\n  &:focus {\n    border-color: ", ";\n  }\n  &:hover {\n    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);\n  }\n  &::placeholder {\n    color: ", ";\n  }\n\n  &[type='checkbox'] {\n    height: auto;\n    font-size: ", ";\n  }\n\n  ", ";\n"], ["\n  border-radius: ", ";\n  height: ",
    ";\n  font-size: inherit;\n  border: 1px solid ", ";\n  padding: 0px 16px;\n\n  &[disabled] {\n    background-color: ", ";\n  }\n  &:focus {\n    border-color: ", ";\n  }\n  &:hover {\n    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);\n  }\n  &::placeholder {\n    color: ", ";\n  }\n\n  &[type='checkbox'] {\n    height: auto;\n    font-size: ", ";\n  }\n\n  ", ";\n"])), utils_1.px(theme_1.radius), function (props) {
    return utils_1.px(props.emphasized ? props.theme.space[5] : props.theme.space[4]);
}, function (props) { return getColor(props); }, function (props) { return props.theme.colors.gray.light; }, function (props) { return props.theme.colors.secondary.main; }, function (props) { return props.theme.colors.gray.main; }, function (props) { return utils_1.px(props.theme.fontSizes[1]); }, utils_1.monospace);
exports.default = recompose_1.compose(styled_components_1.withTheme, hoc_1.default)(Base);
var templateObject_1;
