import { ReactNode, LabelHTMLAttributes, InputHTMLAttributes, SelectHTMLAttributes } from "react";
// Form Field Container
interface FormFieldProps {
children: ReactNode;
className?: string;
}
export function FormField({ children, className = "" }: FormFieldProps) {
return
{children}
;
}
// Form Label
interface FormLabelProps extends LabelHTMLAttributes {
children: ReactNode;
required?: boolean;
}
export function FormLabel({ children, required, className = "", ...props }: FormLabelProps) {
return (
);
}
// Form Input
interface FormInputProps extends InputHTMLAttributes {
error?: string;
}
export function FormInput({ className = "", error, ...props }: FormInputProps) {
return (
);
}
// Form Select
interface FormSelectProps extends SelectHTMLAttributes {
children: ReactNode;
error?: string;
}
export function FormSelect({ children, className = "", error, ...props }: FormSelectProps) {
return (
);
}
// Form Row (horizontal layout)
interface FormRowProps {
children: ReactNode;
className?: string;
}
export function FormRow({ children, className = "" }: FormRowProps) {
return {children}
;
}
// Form Section
interface FormSectionProps {
title?: string;
description?: string;
children: ReactNode;
className?: string;
}
export function FormSection({ title, description, children, className = "" }: FormSectionProps) {
return (
{(title || description) && (
{title &&
{title}
}
{description &&
{description}
}
)}
{children}
);
}
// Form Error Message
interface FormErrorProps {
children: ReactNode;
className?: string;
}
export function FormError({ children, className = "" }: FormErrorProps) {
return (
{children}
);
}
// Form Description
interface FormDescriptionProps {
children: ReactNode;
className?: string;
}
export function FormDescription({ children, className = "" }: FormDescriptionProps) {
return (
{children}
);
}