import type { InputHTMLAttributes, TextareaHTMLAttributes, SelectHTMLAttributes, ReactNode } from "react";
import { cn } from "./cn";
// 注意:基类不含宽度。宽度由调用方决定(Field 内为 flex-col 自动撑满,
// 或显式 w-full / flex-1 / w-16),避免 w-full 与 flex-1/w-16 冲突塌陷。
const fieldBase =
"rounded-md border border-line bg-ink-950 text-sm text-slate-200 placeholder:text-slate-600 transition focus:border-brand focus:outline-none focus:ring-1 focus:ring-brand/40 disabled:opacity-50";
export function Input({ className, ...rest }: InputHTMLAttributes) {
return ;
}
export function Textarea({ className, ...rest }: TextareaHTMLAttributes) {
return ;
}
export function Select({ className, children, ...rest }: SelectHTMLAttributes) {
return (
);
}
// Field 包一层标签 + 控件,统一表单纵向节奏。
export function Field({ label, hint, children }: { label: string; hint?: string; children: ReactNode }) {
return (
);
}