'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _templateObject = _taggedTemplateLiteral(['\n  box-sizing: border-box;\n  height: 2em;\n  width: 100%;\n  border: none;\n  border-radius: 0;\n  border-bottom: 1px solid var(--px-input-border-color--outer, #889aa5);\n  padding: 0 0.33333rem;\n  color: var(--px-input-text-color, #2c404c);\n'], ['\n  box-sizing: border-box;\n  height: 2em;\n  width: 100%;\n  border: none;\n  border-radius: 0;\n  border-bottom: 1px solid var(--px-input-border-color--outer, #889aa5);\n  padding: 0 0.33333rem;\n  color: var(--px-input-text-color, #2c404c);\n']),
    _templateObject2 = _taggedTemplateLiteral(['\n  font: inherit;\n  outline: 0;\n  background-color: var(--px-input-background-color, transparent);\n  transition: background .4s, border-color .4s, color .4s;\n\n    \n  &:focus::placeholder,\n  &:disabled::placeholder{\n    color: var(--px-input-text-color--placeholder--focused, rgba(0, 0, 0, 0.3));\n  }\n  \n  &::placeholder{\n    color: var(--px-input-text-color--placeholder, rgba(0, 0, 0, 0.3));\n  }\n\n  &:disabled::placeholder{\n    color: var(--px-input-text-color--disabled, rgba(0, 0, 0, 0.2));\n  }\n  \n  &::-ms-clear {\n    display: none;\n  }\n  \n  &:readonly,\n  &:disabled {\n    border-color: var(--px-input-border-color--disabled, rgba(0, 0, 0, 0.2));\n    color: var(--px-input-text-color--disabled, rgba(0, 0, 0, 0.2));\n    cursor: not-allowed;\n    background-color: var(--px-input-background-color--disabled, transparent);\n  }\n  \n  &:hover{\n    background-color: var(--px-input-background-color--hover, #d8e0e5);\n  }\n  \n  &:focus{\n    border-color: var(--px-input-border-color--outer--focused, #007acc);\n    background-color: var(--px-input-background-color--focused, #eefbff);\n    color: var(--px-input-text-color--focused, inherit);\n  }\n  \n  &::placeholder {\n    padding-top: 1px;\n  }\n\n\n  &[type=checkbox] + label {\n    padding-left: 5px;\n  }\n  &[type=radio] + label {\n    padding-left: 3px;\n  }\n  \n  &[type=checkbox],\n  &[type=radio]{\n    margin: 0;\n    padding: 0;\n    font-size: 1.05em;\n    cursor: pointer;\n    outline: none;\n    width: auto;\n    height: auto;\n    &[disabled]{\n      cursor: not-allowed;\n    }\n  }\n\n\n\n  ', '\n  ', '\n  ', '\n  ', '\n  ', '\n  ', '\n\n   ', '\n  \n'], ['\n  font: inherit;\n  outline: 0;\n  background-color: var(--px-input-background-color, transparent);\n  transition: background .4s, border-color .4s, color .4s;\n\n    \n  &:focus::placeholder,\n  &:disabled::placeholder{\n    color: var(--px-input-text-color--placeholder--focused, rgba(0, 0, 0, 0.3));\n  }\n  \n  &::placeholder{\n    color: var(--px-input-text-color--placeholder, rgba(0, 0, 0, 0.3));\n  }\n\n  &:disabled::placeholder{\n    color: var(--px-input-text-color--disabled, rgba(0, 0, 0, 0.2));\n  }\n  \n  &::-ms-clear {\n    display: none;\n  }\n  \n  &:readonly,\n  &:disabled {\n    border-color: var(--px-input-border-color--disabled, rgba(0, 0, 0, 0.2));\n    color: var(--px-input-text-color--disabled, rgba(0, 0, 0, 0.2));\n    cursor: not-allowed;\n    background-color: var(--px-input-background-color--disabled, transparent);\n  }\n  \n  &:hover{\n    background-color: var(--px-input-background-color--hover, #d8e0e5);\n  }\n  \n  &:focus{\n    border-color: var(--px-input-border-color--outer--focused, #007acc);\n    background-color: var(--px-input-background-color--focused, #eefbff);\n    color: var(--px-input-text-color--focused, inherit);\n  }\n  \n  &::placeholder {\n    padding-top: 1px;\n  }\n\n\n  &[type=checkbox] + label {\n    padding-left: 5px;\n  }\n  &[type=radio] + label {\n    padding-left: 3px;\n  }\n  \n  &[type=checkbox],\n  &[type=radio]{\n    margin: 0;\n    padding: 0;\n    font-size: 1.05em;\n    cursor: pointer;\n    outline: none;\n    width: auto;\n    height: auto;\n    &[disabled]{\n      cursor: not-allowed;\n    }\n  }\n\n\n\n  ', '\n  ', '\n  ', '\n  ', '\n  ', '\n  ', '\n\n   ', '\n  \n']),
    _templateObject3 = _taggedTemplateLiteral(['\n    max-width: auto;\n  '], ['\n    max-width: auto;\n  ']),
    _templateObject4 = _taggedTemplateLiteral(['\n    max-width: 7.06667rem;\n  '], ['\n    max-width: 7.06667rem;\n  ']),
    _templateObject5 = _taggedTemplateLiteral(['\n     max-width: 14.13333rem;\n  '], ['\n     max-width: 14.13333rem;\n  ']),
    _templateObject6 = _taggedTemplateLiteral(['\n    max-width: 21.2rem;\n  '], ['\n    max-width: 21.2rem;\n  ']),
    _templateObject7 = _taggedTemplateLiteral(['\n    max-width: 28.26667rem;\n  '], ['\n    max-width: 28.26667rem;\n  ']),
    _templateObject8 = _taggedTemplateLiteral(['\n     max-width: 35.33333rem;\n  '], ['\n     max-width: 35.33333rem;\n  ']),
    _templateObject9 = _taggedTemplateLiteral(['\n     max-width: ', ';\n  '], ['\n     max-width: ', ';\n  ']);

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _styledComponents = require('styled-components');

var _styledComponents2 = _interopRequireDefault(_styledComponents);

var _polished = require('polished');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }

var sizes = {
  tiny: '7.06667rem',
  small: '14.13333rem',
  regular: '21.2rem',
  large: '28.26667rem',
  huge: '35.33333rem'
};

var BaseInput = _styledComponents2.default.input(_templateObject);

var Input = BaseInput.extend(_templateObject2, function (props) {
  return props.auto && (0, _styledComponents.css)(_templateObject3);
}, function (props) {
  return props.tiny && (0, _styledComponents.css)(_templateObject4);
}, function (props) {
  return props.small && (0, _styledComponents.css)(_templateObject5);
}, function (props) {
  return props.regular && (0, _styledComponents.css)(_templateObject6);
}, function (props) {
  return props.large && (0, _styledComponents.css)(_templateObject7);
}, function (props) {
  return props.huge && (0, _styledComponents.css)(_templateObject8);
}, function (props) {
  return props.size && (0, _styledComponents.css)(_templateObject9, sizes[props.size]);
});

Input.defaultProps = {
  label: null,
  className: null,

  value: undefined,

  type: 'text',

  disabled: null,

  placeholder: null,

  inputRef: null,

  inputProps: null
};

exports.default = Input;