import { jsx as _jsx } from "react/jsx-runtime";
import React from "react";
import { CheckboxField } from "../fragments/checkbox-field/index.js";
import { ToggleField } from "../fragments/toggle-field/index.js";
export const BooleanField = React.forwardRef(({ isToggle, onChange, ...props }, ref) => {
    const handleChange = (value) => {
        onChange?.(Boolean(value));
    };
    return isToggle ? (_jsx(ToggleField, { onChange: handleChange, ref: ref, ...props })) : (_jsx(CheckboxField, { onChange: handleChange, ref: ref, ...props }));
});
BooleanField.displayName = "BooleanField";
//# sourceMappingURL=boolean-field.js.map