Skip to content

v1.13.0: One drawing per control

Choose a tag to compare

@robritacca-dotcom robritacca-dotcom released this 23 Oct 14:51
· 837 commits to main since this release

Every checkbox, radio, switch and chosen mark in the library is now the same one. The controls export their indicators as small presentational pieces, the components that offer a choice compose them instead of drawing their own, and the surfaces those choices sit on follow one rule per family. Nothing was renamed or removed, so upgrading needs no code changes; what you will see is the same control drawn the same way wherever it appears.

New

  • CheckboxIndicator, RadioIndicator and SwitchIndicator, exported beside Checkbox, RadioButton and ToggleSwitch. Each is the control's box, circle or track on its own, aria-hidden and driven by a checked prop, for a host that is itself the control. Add the ds-control-host class to that host's interactive root and the indicator lights on hover exactly as the standalone control does.
  • ChosenMark, exported beside Dropdown: the trailing check a listbox or menu row shows on its selected item. One glyph, one size, the action colour.
  • CheckIcon and MinusIcon, exported beside Checkbox: the one SVG check and minus every control draws. The switch thumb now shows the same check as the checkbox.
  • ds-visually-hidden, one class in rift-ds/behaviors/visually-hidden.css for text that is read but not seen, imported by every component that hides text.

Changed

  • SelectionCard and QuestionCard compose the indicators and sit on Input's surface: the input fill and hairline at the input radius, the input's hover and selected borders. A card or row that offers a choice now reads as one of the fields around it.
  • Dropdown, Combobox, RichDropdown, TimePicker, ModelPicker, DropdownMenu, ContextMenu and FilterBar mark a selected row with ChosenMark; FilterBar's multi-select rows lead with the checkbox indicator. ModelPicker's effort row is a SegmentedControl.
  • Dialog, Drawer and CommandPalette close through a compact tertiary CircularButton. InspectorToggleSwitch draws ToggleSwitch's own track.
  • Surfaces by family. Accordion, ToggleGroup, the AgentStatus bar, the chat's agent pane card and the foundations swatches take the container surface; menu items sit at the inner radius step; the current item of a navigation list holds the passive active token, one step past hover; Checkbox, RadioButton and ToggleSwitch share one focus ring on the indicator.
  • The build holds the line. validate-shared-primitives.mjs fails a second drawing of any of these, and design.md's Components intro names the one drawing of each and the surface each family takes.

Install

npm install rift-ds@1.13.0

The docs are at https://rift-ds.com.