Issue
A number of our demos in the Codex doc site don't reflect the accessibility guidelines we are promoting.
User Stories
As a developer using Codex, I expect the docsite to be a trusted source of best practices and good examples of writing accessible code.
As a developer using Codex, I want to be able to copy examples from the docsite and not worry about there being potential accessibility issues.
Acceptance Criteria
- Update the example usage of fake button components to include role="button"
- Remove the indeterminate state example from CSS-only demos of the checkbox, since the indeterminate state cannot be set without JS.
- For the 3 binary input components (Checkbox, Radio, and ToggleSwitch):
- Wrap demos of groups in the Field component, which uses the fieldset-legend technique for semantic grouping and labelling. Explain that this is required when using a group in a form.
- Include a demo that uses a div with role="group" (or radiogroup for Radios) and aria-labelledby, explaining that this is an alternate technique that should be used outside of forms
- "Complex field with two inputs" demo has old usage of Label.
- Change Lorum ipsum examples for Links to a real sentence with good link text (e.g. not "click here").
- Radios under "form field" example are numbered incorrectly because they re-use the name of another radio group on the page (already done in this patch)
- Docs should not demonstrate a ToggleButton with a label that changes when pressed/unpressed.
- Create a new example of an icon-only ToggleButton whose icon does not change when pressed.
- Change the 'stateful' section to explain that if you want the button to change labels when pressed, you should use a regular button with no aria-pressed attribute".
- Update the "custom button display" example for ToggleButtonGroup not to change the label on toggle
- Menu demo inputs have to have role=combobox applied for aria-expanded to be valid set.
- MenuItem: Ensure that we not only use semantic HTML (ul is missing around li items), but also put role="listbox" on containing ul)