"use strict";
exports.__esModule = true;
exports.FormSuccess = exports.FormBody = exports.Form = exports.cnFormSuccess = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./Form.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var formik_1 = require("formik");
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var Modal_1 = require("../Modal/Modal");
var SiteBlock_1 = require("../SiteBlock/SiteBlock");
var Typography_1 = require("../Typography");
exports.cnFormSuccess = (0, bem_1.cn)('FormSuccess');
// eslint-disable-next-line @typescript-eslint/no-redeclare
exports.Form = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    return react_1["default"].createElement(formik_1.Formik, (0, tslib_1.__assign)({}, props), props.children);
});
// eslint-disable-next-line @typescript-eslint/no-redeclare
exports.FormBody = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props, ref) {
    return react_1["default"].createElement(formik_1.Form, (0, tslib_1.__assign)({}, props), props.children);
});
exports.FormSuccess = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (_a, ref) {
    var title = _a.title, text = _a.text, _b = _a.view, view = _b === void 0 ? 'overlay' : _b, _c = _a.topGap, topGap = _c === void 0 ? '2xl' : _c, _d = _a.bottomGap, bottomGap = _d === void 0 ? '3xl' : _d, _e = _a.sideGap, sideGap = _e === void 0 ? 'xl' : _e, _f = _a.titleSize, titleSize = _f === void 0 ? 'tiny' : _f, textSize = _a.textSize, modal = _a.modal;
    if (modal) {
        return (react_1["default"].createElement(Modal_1.Modal, (0, tslib_1.__assign)({}, modal),
            react_1["default"].createElement(SiteBlock_1.SiteBlock, { topGap: topGap, bottomGap: bottomGap, sideGap: sideGap, className: (0, exports.cnFormSuccess)({ view: view }) },
                react_1["default"].createElement(Typography_1.Typography.Title, { size: titleSize, className: (0, exports.cnFormSuccess)('Title') }, title),
                react_1["default"].createElement(Typography_1.Typography.Text, { className: (0, exports.cnFormSuccess)('Text'), size: textSize, parse: true }, text))));
    }
    return (react_1["default"].createElement(SiteBlock_1.SiteBlock, { topGap: topGap, bottomGap: bottomGap, sideGap: sideGap, className: (0, exports.cnFormSuccess)({ view: view }) },
        react_1["default"].createElement(Typography_1.Typography.Title, { size: titleSize, className: (0, exports.cnFormSuccess)('Title') }, title),
        react_1["default"].createElement(Typography_1.Typography.Text, { className: (0, exports.cnFormSuccess)('Text'), size: textSize, parse: true }, text)));
});
