// One controlled input per field type, class-for-class with the page // stylesheet. Layout blocks (heading, paragraph, divider) render in // FormRenderer; hidden fields never render at all. import type { FormField } from "./api"; export type AnswerValue = string | string[] | boolean; export function FieldControl({ field, value, onChange, onBlur, }: { field: FormField; value: AnswerValue; onChange: (v: AnswerValue) => void; onBlur: () => void; }) { const id = `f-${field.id}`; const str = typeof value === "string" ? value : ""; switch (field.type) { case "textarea": return (