"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 __1 = require("../");
var styled_components_1 = __importDefault(require("styled-components"));
var INPUT_STATE;
(function (INPUT_STATE) {
    INPUT_STATE["EMPTY"] = "empty";
    INPUT_STATE["VALID"] = "valid";
    INPUT_STATE["INVALID"] = "invalid";
})(INPUT_STATE = exports.INPUT_STATE || (exports.INPUT_STATE = {}));
var InputWrapper = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n  margin-bottom: 20px;\n  position: relative;\n  width: ", ";\n\n  ", " {\n    width: 100%;\n  }\n\n  input {\n    border: 1px solid\n      ", ";\n    border-radius: 2px;\n    padding: 10px 35px 10px 12px;\n    width: 100%;\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n\n    ", " {\n      width: 100%;\n    }\n  }\n\n  select {\n    appearance: none;\n    background-color: transparent;\n    border: 1px solid\n      ", ";\n    border-radius: 2px;\n    display: block;\n    font-family: ", ";\n    line-height: 16px;\n    margin: 0;\n    padding: 11px 12px 12px;\n    width: 100%;\n\n    &::-ms-expand {\n      display: none;\n    }\n\n    &:hover {\n      cursor: pointer;\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n\n    ", " {\n      width: 100%;\n    }\n  }\n"], ["\n  margin-bottom: 20px;\n  position: relative;\n  width: ", ";\n\n  ", " {\n    width: 100%;\n  }\n\n  input {\n    border: 1px solid\n      ",
    ";\n    border-radius: 2px;\n    padding: 10px 35px 10px 12px;\n    width: 100%;\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n\n    ", " {\n      width: 100%;\n    }\n  }\n\n  select {\n    appearance: none;\n    background-color: transparent;\n    border: 1px solid\n      ",
    ";\n    border-radius: 2px;\n    display: block;\n    font-family: ", ";\n    line-height: 16px;\n    margin: 0;\n    padding: 11px 12px 12px;\n    width: 100%;\n\n    &::-ms-expand {\n      display: none;\n    }\n\n    &:hover {\n      cursor: pointer;\n    }\n\n    &:focus {\n      border-color: ", ";\n      outline: none;\n    }\n\n    ", " {\n      width: 100%;\n    }\n  }\n"])), function (props) { return (props.width ? props.width : "100%"); }, __1.mediaQueries.MOBILE, function (props) {
    return props.inputState === INPUT_STATE.INVALID ? __1.colors.accent.CIVIL_RED : __1.colors.accent.CIVIL_GRAY_3;
}, __1.colors.accent.CIVIL_BLUE, __1.mediaQueries.MOBILE, function (props) {
    return props.inputState === INPUT_STATE.INVALID ? __1.colors.accent.CIVIL_RED : __1.colors.accent.CIVIL_GRAY_3;
}, __1.fonts.SANS_SERIF, __1.colors.accent.CIVIL_BLUE, __1.mediaQueries.MOBILE);
var InputErrorIcon = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n  display: ", ";\n  position: absolute;\n  right: 5px;\n  top: calc(50% - 10px);\n"], ["\n  display: ", ";\n  position: absolute;\n  right: 5px;\n  top: calc(50% - 10px);\n"])), function (props) { return (props.inputState === INPUT_STATE.INVALID ? "block" : "none"); });
exports.InputValidationUI = function (props) {
    return (React.createElement(React.Fragment, null,
        React.createElement(InputWrapper, { inputState: props.inputState, width: props.width },
            props.children,
            React.createElement(InputErrorIcon, { inputState: props.inputState },
                React.createElement(__1.ErrorIcon, { width: 20, height: 20 })))));
};
var templateObject_1, templateObject_2;
//# sourceMappingURL=PaymentsInputValidationUI.js.map