import { __assign } from "tslib";
// @ts-nocheck
import './Form.css';
import React from 'react';
import { Form as FormikForm, Formik } from 'formik';
import { cn } from '../../utils/bem';
import { forwardRefWithAs } from '../../utils/types/PropsWithAsAttributes';
import { Modal } from '../Modal/Modal';
import { SiteBlock } from '../SiteBlock/SiteBlock';
import { Typography } from '../Typography';
export var cnFormSuccess = cn('FormSuccess');
// eslint-disable-next-line @typescript-eslint/no-redeclare
export var Form = forwardRefWithAs(function (props, ref) {
    return React.createElement(Formik, __assign({}, props), props.children);
});
// eslint-disable-next-line @typescript-eslint/no-redeclare
export var FormBody = forwardRefWithAs(function (props, ref) {
    return React.createElement(FormikForm, __assign({}, props), props.children);
});
export var FormSuccess = 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.createElement(Modal, __assign({}, modal),
            React.createElement(SiteBlock, { topGap: topGap, bottomGap: bottomGap, sideGap: sideGap, className: cnFormSuccess({ view: view }) },
                React.createElement(Typography.Title, { size: titleSize, className: cnFormSuccess('Title') }, title),
                React.createElement(Typography.Text, { className: cnFormSuccess('Text'), size: textSize, parse: true }, text))));
    }
    return (React.createElement(SiteBlock, { topGap: topGap, bottomGap: bottomGap, sideGap: sideGap, className: cnFormSuccess({ view: view }) },
        React.createElement(Typography.Title, { size: titleSize, className: cnFormSuccess('Title') }, title),
        React.createElement(Typography.Text, { className: cnFormSuccess('Text'), size: textSize, parse: true }, text)));
});
