import { jsx as _jsx } from "react/jsx-runtime";
import * as React from 'react';
import { useFormFields } from "./useFormFields.js";
export const FormContext = React.createContext(null);
export const FormProvider = ({ children, formFields, onChange }) => {
    const value = useFormFields({ initialFields: formFields, onChange });
    return _jsx(FormContext.Provider, { value: value, children: children });
};
export const useFormContext = () => {
    const context = React.useContext(FormContext);
    if (!context) {
        throw new Error('useFormContext must be used within a FormProvider');
    }
    return context;
};
//# sourceMappingURL=FormContext.js.map
