Added form validators

This commit is contained in:
2026-10-09 18:23:08 +02:00
parent d500d9412f
commit abf2e7d40f
24 changed files with 738 additions and 255 deletions
+16
View File
@@ -8,5 +8,21 @@ export type { SubmitFormArgs, SubmitFormResult } from './submitForm.js'
export type { FormsCollectionOverrides, FormsFieldsOverride, FormsOption } from './types.js'
export { useContactForm } from './useContactForm.js'
export type { ContactFormErrors, ContactFormValues, SubmitAction } from './useContactForm.js'
// Generic form engine (any field set) + the standard contact-form preset.
export { useForm } from './useForm.js'
export type { FormErrors, FormSubmitAction, Validator } from './useForm.js'
export { validateSubmission } from './validateSubmission.js'
export type { FormValidationResult } from './validateSubmission.js'
// Composable validation rules (pure — safe on server or client).
export {
buildValidator,
checked,
custom,
email,
isEmail,
maxLength,
minLength,
pattern,
required,
} from './validators.js'
export type { Rule } from './validators.js'