canvas-kit
canvas-kit copied to clipboard
Convert Switch into Compound Component
🚀 Feature Proposal
Convert Switch into a compound component.
Motivation
Switch had a few improvements listed in #387 & #716 Which should be addressed in converting the component into a compound component with this issue.
Related Tickets
https://github.com/Workday/canvas-kit/issues/2112
A11y acceptance criteria:
- Users can identify whether the switch is ON or OFF when viewed through grayscale color. (Failing WCAG v2.1, 1.4.1 "Use of Color" where the blue BG color is the only visual signifier for ON position.)
- Recommending either "ON / OFF" labels, or symbols / icons.
- Update ARIA role from "checkbox" to "switch"
- Tabindex shouldn't be necessary when the component is using an element.