"use strict";

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

exports.__esModule = true;
exports.ModalForm = void 0;

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

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

var _styledComponents = _interopRequireDefault(require("styled-components"));

var _ = require("..");

var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;

var ModalForm = function ModalForm(_ref) {
  var title = _ref.title,
      subtitle = _ref.subtitle,
      _ref$buttonLabel = _ref.buttonLabel,
      buttonLabel = _ref$buttonLabel === void 0 ? 'Continue' : _ref$buttonLabel,
      onSubmit = _ref.onSubmit,
      handleClose = _ref.handleClose,
      Inputs = _ref.Inputs,
      error = _ref.error,
      disableSubmit = _ref.disableSubmit;
  return /*#__PURE__*/_react["default"].createElement(_.Modal, {
    open: true,
    handleClose: handleClose,
    maxWidth: "43rem"
  }, /*#__PURE__*/_react["default"].createElement(Inner, {
    noValidate: "novalidate",
    onSubmit: onSubmit
  }, /*#__PURE__*/_react["default"].createElement(HeaderContainer, null, /*#__PURE__*/_react["default"].createElement(HeaderTitle, null, title), subtitle && /*#__PURE__*/_react["default"].createElement(HeaderSubTitle, null, subtitle)), /*#__PURE__*/_react["default"].createElement(InputContainer, null, Inputs), error && /*#__PURE__*/_react["default"].createElement(_.FormError, {
    center: true,
    text: error
  }), /*#__PURE__*/_react["default"].createElement(ButtonContainer, null, /*#__PURE__*/_react["default"].createElement(_.Button, {
    disabled: disableSubmit,
    variant: "primary",
    fullWidth: true,
    type: "submit"
  }, buttonLabel))));
};

exports.ModalForm = ModalForm;
var Inner = (0, _styledComponents["default"])(_.Typography).attrs({
  variant: 6,
  as: 'form',
  className: 'm-auto'
})(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2["default"])(["\n  background-color: ", ";\n  color: ", ";\n  max-width: 380px;\n  text-align: left;\n"])), function (_ref2) {
  var theme = _ref2.theme;
  return theme.palette.secondary;
}, function (_ref3) {
  var theme = _ref3.theme;
  return theme.palette.hint;
});

var HeaderContainer = _styledComponents["default"].header(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2["default"])([""])));

var HeaderTitle = _styledComponents["default"].h2.attrs({
  className: 'mb-2 pb-1 mx-auto'
})(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  color: ", ";\n  text-align: center;\n  font-weight: 700;\n"])), function (_ref4) {
  var theme = _ref4.theme;
  return theme.palette.primary;
});

var HeaderSubTitle = _styledComponents["default"].div.attrs({
  className: 'pb-4'
})(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2["default"])(["\n  text-align: center;\n  text-transform: none !important;\n"])));

var InputContainer = _styledComponents["default"].div.attrs({
  className: 'my-1'
})(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2["default"])([""])));

var ButtonContainer = _styledComponents["default"].div.attrs({
  className: 'my-4 py-2'
})(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteralLoose2["default"])([""])));
//# sourceMappingURL=index.js.map