'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var ramda = require('ramda');
var Input = require('../Input-pkugjUb0.js');
require('../utils-CTr7wn5d.js');
require('../primitives/Field.js');
require('../index-BZhTddX0.js');
require('../label-Bdc9ytTI.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-D-iDn9RI.js');
require('../separator-CPy2gyg1.js');
require('../primitives/InputGroup.js');
require('../input-group-CFZl_aQS.js');
require('../button--P7-oIJb.js');
require('../index-DuNgWCXZ.js');
require('../input-CgKPISj_.js');
require('../textarea-CZSSY75H.js');

const FormikInput = React.forwardRef(({ name, onChange: onChangeProp, ...rest }, ref) => (jsxRuntime.jsx(formik.Field, { name: name, children: ({ field, meta, form }) => {
        const { status = {}, setStatus } = form;
        const fieldStatus = formik.getIn(status, name);
        const fieldProps = {
            ...field,
            onChange: (e) => {
                setStatus(ramda.dissoc(name, status));
                field.onChange(e);
                onChangeProp?.(e);
            },
        };
        return (jsxRuntime.jsx(Input.Input, { ref: ref, ...fieldProps, error: meta.touched ? meta.error || fieldStatus : "", ...rest }));
    } })));
FormikInput.displayName = "FormikInput";

exports.FormikInput = FormikInput;
//# sourceMappingURL=Input.js.map
