import { useId, type InputHTMLAttributes, type ReactNode, type TextareaHTMLAttributes } from "react";
import { cn } from "./cn.js";
export interface FieldFrameProps {
label: string;
labelPlacement?: "above" | "below";
hint?: string;
description?: string;
htmlFor?: string;
children: ReactNode;
className?: string;
}
export function FieldFrame({ label, hint, description, htmlFor, children, className, labelPlacement = "above" }: FieldFrameProps) {
return (
);
}
export interface TextFieldProps extends InputHTMLAttributes {
label: string;
hint?: string;
description?: string;
fieldClassName?: string;
}
export function TextField({
label,
hint,
description,
fieldClassName,
className,
id,
...props
}: TextFieldProps) {
const generatedId = useId();
const controlId = id ?? generatedId;
return (
);
}
export interface TextAreaFieldProps extends TextareaHTMLAttributes {
label: string;
hint?: string;
description?: string;
fieldClassName?: string;
}
export function TextAreaField({
label,
hint,
description,
fieldClassName,
className,
id,
...props
}: TextAreaFieldProps) {
const generatedId = useId();
const controlId = id ?? generatedId;
return (
);
}