import React, { createContext } from 'react';
import cx from 'classnames';
export var FormType;

(function (FormType) {
  FormType["NORMAL"] = "normal";
  FormType["INLINE"] = "inline";
  FormType["ONPLACE"] = "onplace";
})(FormType || (FormType = {}));

export var FormContext = createContext(FormType.NORMAL);
export var Form = function Form(_ref) {
  var children = _ref.children,
      type = _ref.type,
      handleSubmit = _ref.onSubmit,
      className = _ref.className;
  var props = {
    onSubmit: handleSubmit,
    className: cx({
      'form-inline': FormType.INLINE === type
    }, {
      'align-items-stretch form-inline flex-nowrap': FormType.ONPLACE === type
    }, className)
  };
  return React.createElement(FormContext.Provider, {
    value: type
  }, React.createElement("form", props, children));
};