import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { Field, getIn } from 'formik';
import { dissoc } from 'ramda';
import { T as Textarea } from '../Textarea-C0z50h0N.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/Textarea.js';
import '../textarea-BSZwxzjQ.js';

const FormikTextarea = 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(Textarea, { ref: ref, error: meta.touched ? meta.error || fieldStatus : "", ...fieldProps, ...rest }));
    } })));
FormikTextarea.displayName = "FormikTextarea";

export { FormikTextarea };
//# sourceMappingURL=Textarea.js.map
