Three doc comments elsewhere in the tree still named the old CreateAgentPage identifier/page framing after the rename in this branch -- TextField.tsx, Panel.tsx, FormField.css (x3). None of these files are touched by the rest of the diff, which is exactly how the staleness happened.
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
// <TextField> — a labelled single-line text input, the shared control
|
|
// every form (`CreateAgentForm` today) reaches for instead
|
|
// of hand-rolling its own label/input pair. No textarea/multi-line
|
|
// mode — promote that the day a real caller needs one, same "don't
|
|
// build ahead of a caller" rule the rest of `ui/` follows.
|
|
import { FormField } from '../form-field/FormField.js';
|
|
|
|
export function TextField({
|
|
id,
|
|
label,
|
|
value,
|
|
onInput,
|
|
type = 'text',
|
|
pattern,
|
|
title,
|
|
required,
|
|
placeholder,
|
|
}: {
|
|
id: string;
|
|
label: string;
|
|
value: string;
|
|
onInput: (value: string) => void;
|
|
type?: string;
|
|
pattern?: string;
|
|
title?: string;
|
|
required?: boolean;
|
|
placeholder?: string;
|
|
}) {
|
|
return (
|
|
<FormField label={label} htmlFor={id}>
|
|
<input
|
|
id={id}
|
|
class="ui-form-control"
|
|
type={type}
|
|
value={value}
|
|
pattern={pattern}
|
|
title={title}
|
|
required={required}
|
|
placeholder={placeholder}
|
|
onInput={(e) => onInput((e.target as HTMLInputElement).value)}
|
|
/>
|
|
</FormField>
|
|
);
|
|
}
|