import { FormCheckbox, type FormCheckboxProps, FormError, FormInput, type FormInputProps, FormLabel, } from "@ariakit/react"; import { type ReactNode } from "react"; import { cx } from "../class-names.ts"; import { SubmitErrorAlert } from "../form/SubmitErrorAlert.tsx"; import * as css from "./style.css.ts"; export type LetterheadTextFieldProps = FormInputProps & { label: string; hint?: ReactNode; }; export function LetterheadTextField(props: LetterheadTextFieldProps) { const { name, label, hint, ...inputProps } = props; return (
{label}
{hint &&
{hint}
}
); } export function LetterheadCheckboxField( props: FormCheckboxProps & { label: ReactNode }, ) { const { label, name, ...inputProps } = props; return (
{" "} {label}
); } type LetterheadReadonlyTextFieldProps = { label: string; value: string; placeholder?: string; hint?: ReactNode; type?: "text" | "email" | "password"; }; /** * Renders a read-only text field. * * For an editable text field, use {@link LetterheadTextField} along with * Ariakit form store. */ export function LetterheadReadonlyTextField( props: LetterheadReadonlyTextFieldProps, ) { return (
{props.hint &&
{props.hint}
}
); } type LetterheadSubmitErrorProps = { name: string; }; /** * Renders an error message from form context. * * If there is no error message, will be completely omitted from DOM, so there * is no need to guard it with an if statement. */ export function LetterheadSubmitError(props: LetterheadSubmitErrorProps) { return ; } export function LetterheadHeader(props: { children: ReactNode }) { return
{props.children}
; } export function LetterheadFormActions(props: { children: ReactNode }) { return (
{props.children}
); } export function InputsStack(props: { children: ReactNode }) { return (
{props.children}
); }