/** * Form controls. * * Every control here is a real, focusable element with correct ARIA — the * switch is a `button[role=switch]`, not a styled div, so keyboard and screen * reader users get the same affordances as everyone else. */ import { IconCheck, IconSearch } from '../icons'; /** * Toggle for a single boolean. * * @param {Object} props * @param {boolean} props.checked * @param {Function} props.onChange Receives the next boolean. * @param {string} props.label Accessible name (visually hidden here when * a visible label sits elsewhere). * @return {Element} Switch. */ export function Switch( { checked, onChange, label, id, disabled } ) { return ( ); } /** * Checkbox for multi-select lists, where a column of switches would * over-weight what is really one grouped choice. * * @param {Object} props * @param {boolean} props.checked * @param {Function} props.onChange * @return {Element} Checkbox with its label. */ export function Checkbox( { checked, onChange, children, disabled } ) { return ( ); } /** * Segmented control for 2–3 mutually exclusive options. * * @param {Object} props * @param {Array} props.options `[{ value, label }]`. * @param {string} props.value * @param {Function} props.onChange * @param {string} props.label Accessible group name. * @return {Element} Segmented control. */ export function Segmented( { options, value, onChange, label } ) { return (
{ hint }
}{ hint }
}{ hint }
}