[
{"name": "a plain text input: type text, submitted under its id", "args": [{"id": "full-name", "label": "Full name"}], "expect": "
"},
{"name": "a name of its own", "args": [{"id": "f1", "name": "fullName", "label": "Full name"}], "expect": ""},
{"name": "an email address: type, autocomplete and no spell check", "args": [{"id": "email", "label": "Email address", "type": "email", "autoComplete": "email", "spellCheck": false}], "expect": ""},
{"name": "a hint describes the input", "args": [{"id": "phone", "label": "UK telephone number", "type": "tel", "hint": "For international numbers include the country code", "autoComplete": "tel"}], "expect": "
For international numbers include the country code
"},
{"name": "an error marks the input invalid and describes it", "args": [{"id": "email", "label": "Email address", "type": "email", "error": "Enter an email address in the correct format, like name@example.com"}], "expect": "
Error: Enter an email address in the correct format, like name@example.com
"},
{"name": "hint and error: described by both, hint first", "args": [{"id": "url", "label": "Website", "type": "url", "hint": "Starting with https://", "error": "Enter a website address, like https://example.com", "value": "example"}], "expect": "
Starting with https://
Error: Enter a website address, like https://example.com
"},
{"name": "a controlled value", "args": [{"id": "town", "label": "Town or city", "value": "Leeds", "autoComplete": "address-level2"}], "expect": ""},
{"name": "a default value renders as the value attribute", "args": [{"id": "q", "label": "Search", "type": "search", "defaultValue": "vat"}], "expect": ""},
{"name": "a prefix and a suffix wrap the input and are hidden from screen readers", "args": [{"id": "cost", "label": "Cost, in pounds, per item", "prefix": "£", "suffix": "per item", "inputMode": "decimal", "spellCheck": false}], "expect": "
£
per item
"},
{"name": "a prefix alone", "args": [{"id": "amount", "label": "Amount, in pounds", "prefix": "£"}], "expect": "
£
"},
{"name": "required and disabled are boolean attributes", "args": [{"id": "ref", "label": "Reference", "required": true, "disabled": true}], "expect": ""},
{"name": "false booleans and an empty suffix render nothing", "args": [{"id": "ref", "label": "Reference", "required": false, "disabled": false, "suffix": "", "className": "fune-field--narrow"}], "expect": ""},
{"name": "values and labels are escaped", "args": [{"id": "c", "label": "Company \"name\" & ", "value": "A&B \"Ltd\""}], "expect": ""},
{"name": "an id with a space is refused", "args": [{"id": "full name", "label": "Full name"}], "expectError": "a field id cannot contain spaces"}
]