zod-form-radix
Version:
Radix UI integration for zod-form-kit
18 lines (17 loc) • 1.48 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { z } from 'zod';
import { ZodForm } from '../components/ZodForm';
// Simple schema for testing
const simpleSchema = z.object({
name: z.string(),
email: z.string().email(),
});
export function DiagnosticExample() {
const handleSubmit = (data) => {
console.log('Form submitted:', data);
};
return (_jsxs("div", { className: "max-w-md mx-auto p-6", style: { maxWidth: '400px', margin: '0 auto', padding: '24px' }, children: [_jsx("h1", { style: { fontSize: '24px', fontWeight: 'bold', marginBottom: '24px' }, children: "Diagnostic ZodForm Test" }), _jsx("div", { style: { marginBottom: '16px' }, children: _jsx("p", { children: "This form is used to test input functionality and identify issues." }) }), _jsx(ZodForm, { schema: simpleSchema, onSubmit: handleSubmit, defaultValues: {
name: '',
email: '',
} }), _jsxs("div", { style: { marginTop: '24px', padding: '16px', backgroundColor: '#f5f5f5', borderRadius: '8px' }, children: [_jsx("h3", { style: { fontSize: '16px', fontWeight: 'bold', marginBottom: '8px' }, children: "Expected Behavior:" }), _jsxs("ul", { style: { marginLeft: '20px' }, children: [_jsx("li", { children: "You should be able to type in the name field" }), _jsx("li", { children: "You should be able to type in the email field" }), _jsx("li", { children: "Form should validate on submit" })] })] })] }));
}