"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = exports.TextareaFieldRegular = 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 _TextareaFieldRegular = _interopRequireDefault(require("./TextareaFieldRegular.styles"));

var TextareaRegular = _InputRegular.InputRegular.withComponent('textarea', {
  target: "e1ar4gf21",
  label: "TextareaRegular"
});

var TextareaFieldRegularOrigin = function TextareaFieldRegularOrigin(props) {
  var label = props.label,
      id = props.id,
      error = props.error,
      hovered = props.hovered,
      focused = props.focused,
      value = props.value,
      className = props.className,
      success = props.success,
      hint = props.hint,
      rest = (0, _objectWithoutProperties2["default"])(props, ["label", "id", "error", "hovered", "focused", "value", "className", "success", "hint"]);
  var isActive = (0, _isFieldActive["default"])({
    value: value,
    focused: focused
  });
  return (0, _core.jsx)("div", {
    className: className
  }, (0, _core.jsx)(TextareaRegular, (0, _extends2["default"])({
    id: id,
    className: "textarea-regular",
    error: error,
    hovered: hovered,
    focused: focused,
    value: value,
    success: success
  }, rest)), label && (0, _core.jsx)(_InputLabelRegular.InputLabelRegular, {
    htmlFor: id,
    error: error,
    active: isActive,
    success: success
  }, label), (0, _core.jsx)(_Hint.Hint, {
    success: success,
    error: error,
    hint: hint
  }));
};

var TextareaFieldRegular = (
/*#__PURE__*/
0, _styledBase["default"])(TextareaFieldRegularOrigin, {
  target: "e1ar4gf20",
  label: "TextareaFieldRegular"
})(_TextareaFieldRegular["default"].base, " ", _TextareaFieldRegular["default"].state.active, " ", _TextareaFieldRegular["default"].state.error, process.env.NODE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hcmVhRmllbGRSZWd1bGFyID0gc3R5bGVkKFRleHRhcmVhRmllbGRSZWd1bGFyT3JpZ2luKWBcbiAgJHtzdHlsZXMuYmFzZX1cbiAgJHtzdHlsZXMuc3RhdGUuYWN0aXZlfVxuICAke3N0eWxlcy5zdGF0ZS5lcnJvcn1cbmBcblxuZXhwb3J0IHsgVGV4dGFyZWFGaWVsZFJlZ3VsYXIgfVxuZXhwb3J0IGRlZmF1bHQgVGV4dGFyZWFGaWVsZFJlZ3VsYXJcbiJdfQ== */");
exports.TextareaFieldRegular = TextareaFieldRegular;
var _default = TextareaFieldRegular;
exports["default"] = _default;