import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { Field, getIn } from 'formik';
import { dissoc } from 'ramda';
import { I as Input } from '../Input-C1gcv9o2.js';
import '../utils-DdHUxIdC.js';
import '../primitives/Field.js';
import '../index-D7Zy7P05.js';
import '../label-B4qDF3W1.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-BtkPdosV.js';
import '../separator-BbhgePmX.js';
import '../primitives/InputGroup.js';
import '../input-group-C_qKMibX.js';
import '../button-D6uWDFCs.js';
import '../index-CfriMyrd.js';
import '../input-GLCCE2kT.js';
import '../textarea-BSZwxzjQ.js';

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

export { FormikInput };
//# sourceMappingURL=Input.js.map
