// ============================================================
// ui/types — 通用 UI 组件共享类型
// FieldConfig / FieldRule / InputType 原在 src/pages/auth/types.ts
// 提升到 ui/ 后供 FormField 及未来消费者共用
// ============================================================

export interface FieldRule {
   required?: boolean;
   minLen?: number;
   maxLen?: number;
   pattern?: RegExp;
   message?: string;
}

export type InputType = 'text' | 'password' | 'tel';

export interface FieldConfig {
   name: string;
   label: string;
   placeholder: string;
   inputType: InputType;
   rules: FieldRule[];
   optional?: boolean;
   extraAction?: 'send-sms';
   cooldown?: number;
}
