import { useState } from "react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@godxjp/ui/data-display"; import { Checkbox, Form, FormField, Input, Select } from "@godxjp/ui/data-entry"; import { Dialog, DialogBody, DialogContent, DialogHeader, DialogTitle, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, } from "@godxjp/ui/feedback"; import { Button } from "@godxjp/ui/general"; import { Flex, PageContainer } from "@godxjp/ui/layout"; /** * FormField — wraps one control with a label, helper, and error, and wires * aria-describedby / aria-invalid onto the child. Use it for every stacked * labelled control (Input/Textarea/Select/DatePicker…); use Field for a * checkbox/switch beside its label. Composed only from real @godxjp/ui components. */ export default function Demo() { const [dialogOpen, setDialogOpen] = useState(false); const [sheetOpen, setSheetOpen] = useState(false); return ( States required adds a red asterisk; helper is a muted hint; error (role=alert) overrides it. {}} placeholder="状態を選択" options={[ { value: "pending", label: "承認待ち" }, { value: "approved", label: "承認済み" }, ]} /> Complete field contract Auto id, label addon, every layout, per-field widths, className and grid span are rendered explicitly.
?} className="contract-auto-id" >
Field identity · data-field 項目キーを control の data-field に出す。既定は id から導出。id が DOM 一意化のためのもので項目キーと違う場合だけ field を明示する。AppProvider emitFieldNames を立てたアプリでは同じキーが name にも出る。
{}} options={[ { value: "member", label: "Member" }, { value: "admin", label: "Admin" }, ]} />
Layout matrix · widths / breakpoints / long locale / RTL horizontal は md 未満で vertical に collapse。field 単位の width override と 320px 相当の長文を同時確認する。
State contract · supported and untested gaps FormField supports helper, required and error. warning, pending, touched/submitted timing, server-error mapping and form-summary focus are not FormField props; those remain UNTESTED and belong to the form controller/application flow. Composition · Dialog / Sheet 同じ bounded form を overlay 内で確認する。 取引先を追加
請求先設定
); }