import React from 'react'; import { cn } from '@/lib/utils'; import { Input as DesignSystemInput } from './input'; import { Textarea as DesignSystemTextarea } from './textarea'; import { Select as DesignSystemSelect } from './select'; /** * FormFieldProps - Propriétés du composant FormField * * @interface FormFieldProps */ interface FormFieldProps { /** * Label du champ de formulaire * * @example * ```tsx * * * * ``` */ label: string; /** * Message d'erreur à afficher sous le champ * * @example * ```tsx * * * * ``` */ error?: string; /** * Si `true`, affiche un indicateur requis (*) * * @default false */ required?: boolean; /** * Champ de formulaire enfant (Input, Textarea, Select, etc.) */ children: React.ReactNode; /** * Classes CSS personnalisées */ className?: string; /** * Texte d'aide à afficher sous le champ (si pas d'erreur) * * @example * ```tsx * * * * ``` */ helpText?: string; } /** * FormField - Composant de champ de formulaire avec label et validation * * Composant wrapper pour les champs de formulaire avec support pour : * - Label avec indicateur requis * - Message d'erreur * - Texte d'aide * * @example * ```tsx * // Champ simple * * * * * // Champ requis avec erreur * * * * * // Champ avec texte d'aide * *