import { jsx } from 'react/jsx-runtime';
import { forwardRef } from 'react';
import { Field, getIn } from 'formik';
import { dissoc } from 'ramda';
import { C as Checkbox } from '../Checkbox-zCxgcZiC.js';
import '../utils-DdHUxIdC.js';
import '../primitives/Checkbox.js';
import '../check-Cpkv29p1.js';
import '../createLucideIcon-C8ycilSN.js';
import '../index-BtkPdosV.js';
import '../index-CiyxEyB0.js';
import '../index-DNzunGHb.js';
import '../index-Cor698lu.js';
import '../index-DOzu5J1s.js';
import '../index-30QpKM0j.js';
import '../index-BYZaLNq1.js';
import '../index-yFgkK_AM.js';
import '../index-DhnfW8wQ.js';
import 'react-dom';
import '../primitives/Field.js';
import '../index-D7Zy7P05.js';
import '../label-B4qDF3W1.js';
import '../separator-BbhgePmX.js';

const FormikCheckbox = forwardRef(({ name, ...rest }, ref) => (jsx(Field, { name: name, children: ({ field, meta, form }) => {
        const { status = {}, setStatus } = form;
        const fieldStatus = getIn(status, name);
        return (jsx(Checkbox, { ref: ref, checked: !!field.value, error: meta.touched ? meta.error || fieldStatus : "", name: field.name, onBlur: field.onBlur, onCheckedChange: (checked) => {
                setStatus(dissoc(name, status));
                form.setFieldValue(name, checked);
            }, ...rest }));
    } })));
FormikCheckbox.displayName = "FormikCheckbox";

export { FormikCheckbox };
//# sourceMappingURL=Checkbox.js.map
