import { jsx } from 'react/jsx-runtime';
import { useField, useFormikContext, getIn } from 'formik';
import { dissoc } from 'ramda';
import { R as RadioGroup } from '../RadioGroup-BNeYQAoT.js';
import 'react';
import '../utils-DdHUxIdC.js';
import '../primitives/RadioGroup.js';
import '../index-DNzunGHb.js';
import '../index-BtkPdosV.js';
import '../index-CiyxEyB0.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../index-j_qxDBFl.js';
import '../index-Dd1i1d2M.js';
import '../index-zW4GjM5L.js';
import '../index-DOzu5J1s.js';
import '../index-CSUSJzOJ.js';
import '../index-Cor698lu.js';
import '../index-BA158WEj.js';
import '../index-BYZaLNq1.js';
import '../index-30QpKM0j.js';
import '../index-yFgkK_AM.js';
import '../primitives/Label.js';
import '../label-B4qDF3W1.js';
import '../primitives/Field.js';
import '../index-D7Zy7P05.js';
import '../separator-BbhgePmX.js';

const FormikRadioGroup = ({ name, ...props }) => {
    const [field, meta] = useField(name);
    const { setFieldValue, status = {}, setStatus, } = useFormikContext();
    const fieldStatus = getIn(status, name);
    return (jsx(RadioGroup, { error: meta.touched ? meta.error || fieldStatus : "", name: field.name, value: field.value, onValueChange: (value) => {
            setStatus(dissoc(name, status));
            setFieldValue(name, value);
        }, ...props }));
};
FormikRadioGroup.displayName = "FormikRadioGroup";
FormikRadioGroup.Item = RadioGroup.Item;

export { FormikRadioGroup };
//# sourceMappingURL=RadioGroup.js.map
