"use strict";

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

var _css2 = require("@emotion/css");

var _css3 = _interopRequireDefault(_css2);

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

var _propTypes = require("prop-types");

var _propTypes2 = _interopRequireDefault(_propTypes);

var _presets = require("../../utils/presets");

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

function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

var Textarea = function Textarea(_ref) {
  var id = _ref.id,
      rows = _ref.rows,
      cols = _ref.cols,
      children = _ref.children,
      placeholder = _ref.placeholder,
      disabled = _ref.disabled,
      onChange = _ref.onChange;
  return (0, _core.jsx)("textarea", {
    id: id,
    rows: rows,
    cols: cols,
    placeholder: placeholder,
    disabled: disabled,
    onChange: onChange,
    css:
    /*#__PURE__*/
    (0, _css3["default"])(_objectSpread({}, _presets.styles.input, {
      display: "block",
      minHeight: "4rem",
      resize: "vertical",
      padding: "".concat(_presets.spaces.xs, " ").concat(_presets.spaces.s)
    }), "label:Textarea;" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy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Jvd3M6IFByb3BUeXBlcy5udW1iZXIsXG4gIGNvbHM6IFByb3BUeXBlcy5udW1iZXIsXG4gIGNoaWxkcmVuOiBQcm9wVHlwZXMubm9kZSxcbiAgcGxhY2Vob2xkZXI6IFByb3BUeXBlcy5zdHJpbmcsXG4gIGRpc2FibGVkOiBQcm9wVHlwZXMuYm9vbCxcbiAgb25DaGFuZ2U6IFByb3BUeXBlcy5mdW5jLFxufVxuXG5leHBvcnQgZGVmYXVsdCBUZXh0YXJlYVxuIl19 */"))
  }, children);
};

Textarea.propTypes = {
  id: _propTypes2["default"].string,
  rows: _propTypes2["default"].number,
  cols: _propTypes2["default"].number,
  children: _propTypes2["default"].node,
  placeholder: _propTypes2["default"].string,
  disabled: _propTypes2["default"].bool,
  onChange: _propTypes2["default"].func
};
exports["default"] = Textarea;