"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
Object.defineProperty(exports, "isFieldActive", {
  enumerable: true,
  get: function get() {
    return _isFieldActive["default"];
  }
});
exports["default"] = exports.TextFieldRegular = void 0;

var _core = require("@emotion/core");

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _styledBase = _interopRequireDefault(require("@emotion/styled-base"));

var _isFieldActive = _interopRequireDefault(require("../../../../utils/isFieldActive"));

var _InputLabelRegular = require("../InputLabelRegular");

var _InputRegular = require("../InputRegular");

var _Hint = require("../../Hint");

var _TextFieldRegular = _interopRequireDefault(require("./TextFieldRegular.styles"));

var TextFieldRegularOrigin = function TextFieldRegularOrigin(props) {
  var label = props.label,
      id = props.id,
      error = props.error,
      hint = props.hint,
      hovered = props.hovered,
      focused = props.focused,
      success = props.success,
      value = props.value,
      className = props.className,
      fullHeight = props.fullHeight,
      fullWidth = props.fullWidth,
      rest = (0, _objectWithoutProperties2["default"])(props, ["label", "id", "error", "hint", "hovered", "focused", "success", "value", "className", "fullHeight", "fullWidth"]);
  var isActive = (0, _isFieldActive["default"])({
    value: value,
    focused: focused
  });
  return (0, _core.jsx)("div", {
    className: className
  }, (0, _core.jsx)(_InputRegular.InputRegular, (0, _extends2["default"])({
    id: id,
    error: error,
    hovered: hovered,
    focused: focused,
    success: success,
    value: value,
    fullHeight: true,
    fullWidth: true
  }, rest)), label && (0, _core.jsx)(_InputLabelRegular.InputLabelRegular, {
    htmlFor: id,
    error: error,
    success: success,
    active: isActive
  }, label), (0, _core.jsx)(_Hint.Hint, {
    success: success,
    error: error,
    hint: hint
  }));
};

var TextFieldRegular = (
/*#__PURE__*/
0, _styledBase["default"])(TextFieldRegularOrigin, {
  target: "e17xhwfk0",
  label: "TextFieldRegular"
})(_TextFieldRegular["default"].base, process.env.NODE_ENV === "production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PlxuICApXG59XG5cbmNvbnN0IFRleHRGaWVsZFJlZ3VsYXIgPSBzdHlsZWQoVGV4dEZpZWxkUmVndWxhck9yaWdpbilgXG4gICR7c3R5bGVzLmJhc2V9XG5gXG5cbmV4cG9ydCB7IFRleHRGaWVsZFJlZ3VsYXIsIGlzRmllbGRBY3RpdmUgfVxuZXhwb3J0IGRlZmF1bHQgVGV4dEZpZWxkUmVndWxhclxuIl19 */");
exports.TextFieldRegular = TextFieldRegular;
var _default = TextFieldRegular;
exports["default"] = _default;