"use strict";

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

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

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

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

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

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

var _react = _interopRequireDefault(require("react"));

var _classnames2 = _interopRequireDefault(require("classnames"));

var _js = require("../../globals/js");

var _excluded = ["className", "children", "longForm"];
var prefix = _js.settings.prefix;
/** A form is a group of related input controls that allows users to provide data or configure options. */

var Form = function Form(_ref) {
  var className = _ref.className,
      children = _ref.children,
      longForm = _ref.longForm,
      other = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var classNames = (0, _classnames2.default)("".concat(prefix, "--form"), (0, _defineProperty2.default)({}, "".concat(prefix, "--form-long"), longForm === true), className);
  return /*#__PURE__*/_react.default.createElement("form", (0, _extends2.default)({
    className: classNames
  }, other), children);
};

Form.propTypes = {
  /**
   * Provide children to be rendered inside of the <form> element
   */
  children: _propTypes.default.node,

  /**
   * Provide a custom className to be applied on the containing <form> node
   */
  className: _propTypes.default.string,

  /**
   * Default margin is added to each form input
   */
  longForm: _propTypes.default.bool
};
Form.defaultProps = {
  longForm: true
};
var _default = Form;
exports.default = _default;