Repository navigation
UN-4300 [FEAT] Add the v1 toggles: Checkbox, Radio and RadioGroup, Switch and Slider (P1-T05) - #2462
praveen-formido wants to merge 12 commits into
Conversation
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…ed label in tests Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Co-Authored-By: Claude Fable 5.1 <[email protected]>
…trols on the label line, and narrow defaultChecked Co-Authored-By: Claude Fable 5.1 <[email protected]>
…d hand-off, and add the missing gallery entries Co-Authored-By: Claude Fable 5.1 <[email protected]>
[Low impact] The PR appears safe to merge; no new actionable issue was established.
|
…ledby Co-Authored-By: Claude Fable 5.1 <[email protected]>
# Conflicts: # frontend/src/v1/README.md
Frontend Lint Report (Biome)✅ All checks passed! No linting or formatting issues found. |
|
Unstract test resultsPer-group results
Critical paths
|



What
frontend/src/v1/components/ui/toggles/, on Radix (radix-uinamed imports) and the P0-T04 tokens:Checkbox(16): checked, unchecked and mixed (checked="indeterminate", controlled only;defaultCheckedis narrowed tobooleanon purpose), Space toggles.Switch(20 × 36):role="switch"exposing on and off, Space toggles.Radio(14) andRadioGroup: arrows move selection and focus together and skip a disabled item; the group is named by itslabel(rendered heading,aria-labelledby) or the caller'saria-label; a disabled group dims its heading and item labels.Slider: label line with an optional shown value, description, one or more thumbs; arrows, PageUp/PageDown, Home and End; every thumb has an accessible name (thumbLabels[i], then a stringlabel, then the root'saria-label; a range withoutthumbLabelskeeps Radix's "Minimum"/"Maximum") andaria-valuetextfromformatValue; the root is a namedrole="group"and each thumb carries the description andaria-disabled.ControlRow(control centred on a 20px label line, description below), which wireshtmlForandaria-describedbyand dims the label when disabled.toggles.gallery.tsxlists every variant and state (21 entries);markup.test.tsxsnapshots each one to__snapshots__/markup.mdand runs axe on each, the same wayui/codedoes. A README in the folder and a Toggles section insrc/v1/README.md.Why
How
ui:size-4, radioui:size-3.5, switchui:h-5 ui:w-9with aui:size-4thumb, slider trackui:h-1.5ui:focus-visible:focus-ring; disabled isopacity-50+pointer-events-none; selected fillprimary, rest borderinput; no hover fillui:rounded-sm(6px)IndicatorrenderedasChildonto the lucide svg, and the icon (Check or Minus) is chosen in JSsvg.luciderule forces any lucide icon under aspan/p/label/li/a/td/thto 1em inline-block and is unlayered, so aui:size-*on the svg loses and a CSShiddencannot hide the wrong icon. With the svg's parent being the button the rule never matches.ControlRow, with the same classes asLabel/HelperTextin #2416 (P1-T03), not imported from itFieldis documented in the README: toggles readuseFieldControlin P1-T06;RadioGroupnever goes insideField(a<label for>cannot name aradiogroup); until then, do not put a toggle insideField.checked;defaultChecked="indeterminate"would announce "mixed" while drawing a tick, so the type rejects it.classNamelands on the outermost element of every component<Slider className="ui:max-w-xs">narrows the label line and the track together. Only horizontal sliders are supported (orientationis omitted from the props).index.tsui/codedoes the same; the P1-T01 gallery imports./toggles.gallerydirectly.Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)
frontend/src/v1/components/ui/toggles/plus a section insrc/v1/README.md. No v0 file, dependency or build file changes, and no v0 route renders v1.Database Migrations
Env Config
Relevant Docs
frontend/src/v1/components/ui/toggles/README.md;frontend/src/v1/README.md, Toggles section.Related Issues or PRs
main(23bbc87). Builds on UN-4299 [FEAT] v1 design tokens, themes and style isolation (P0-T04) #2399 (P0-T04 tokens) and UN-4329 [FEAT] Add the v1 unit-test harness and the frontend-v1-unit rig group #2429 (P0-T08 harness).Fieldseam, above); P1-T01 (gallery registration); P1-T11 (row-selection checkboxes).--inputon--backgroundis about 1.4:1 in all three modes and the slider's empty--mutedtrack about 1.04:1 in light, under WCAG 1.4.11's 3:1 for non-text contrast. The code follows the board; the values need the designer.Dependencies Versions
Notes on Testing
bun run test:v1: 429 tests across 48 files, coverage 97.6% lines / 94.8% branches / 93.9% functions;lint:v1,typecheck:v1andbiome ci src/v1clean.claudedocs/frontend-v1-lane-c/plans/2026-11-09-P1-T05-sdd-ledger.md(not committed).🤖 Generated with Claude Code