Release v4.9.0
Summary
Four collection controls join @cratis/components/Common, so an application no longer hand-rolls the ones it always needs. Each takes its roles and keyboard behavior from React Aria and leaves the appearance to you through stable parts.
Added
ToggleGroupunder@cratis/components/Common: a single-selection group of exclusive choices — a segmented control. It carriesradiogroup/radiosemantics rather thantablist/tab, because the choice is a value and not a panel. Arrow keys move focus andSpaceorEntercommits, so arrowing past an option never triggers the work behind it. Options take a label, an optional decorative icon and a disabled state;aria-labelledby,aria-describedbyandinvalidassociate the group with a form field's label and error. Parts:root,option,icon,label(#287)Tabsunder@cratis/components/Common: a tab set where arrow keys andHome/Endmove the selection, the list holds a single tab stop, and every tab is wired to its panel througharia-controls. Tabs take a label, optional content and a disabled state. Parts:root,list,tab,panel(#287)TagGroupunder@cratis/components/Common: a group of removable values with an optional text entry.Enterand each configured separator commit the typed value,Backspaceon an empty entry removes the last value, and pasting a separated list adds every value in it. Tags themselves are reachable with the arrow keys and removable withBackspaceorDelete. Duplicates are refused unlessallowDuplicatesis set,editable={false}leaves a read-only set of removable tags, andremoveLabelsupplies a localized name for each remove action. Parts:root,list,tag,remove,input(#287)Breadcrumbsunder@cratis/components/Common: an ordered trail inside a navigation landmark whose last segment is the current page — it carriesaria-current="page", has no destination and is out of the tab order. Segments take anhrefor anonNavigatefor a router that owns navigation, and the separator is a slot. Parts:root,item,link,separator(#287)- Documentation for all four, including a table for choosing between
ToggleGroupandTabs, and their parts in the pass-through cheat sheet (#287)
Changed
- The published stylesheet grows by one shared sheet for all four controls, measured at 208 014 raw and 32 571 gzip bytes against ceilings of 205 KiB and 32 KiB. Raw has room; gzip now has 197 bytes of headroom, so the next stylesheet to join the aggregate has to come with a reduction. Flagged for your judgement.
Notes
This branch also removes fileParallelism: false from Source's vitest configuration, which serialized the spec run to prevent a mock leak that isolate: true already prevents — 126s to 21s locally, and the whole-repository yarn ci from about 450s to 216s, verified across nine consecutive runs (#289). It changes nothing a consumer compiles against or observes, so it is not in the release note above.
CommandForm's ChipsField still uses its own implementation. Moving it onto TagGroup would rename its public part item to tag and add list, which breaks any consumer styling [data-cratis-part="item"] — that belongs in a major release rather than here. TagGroup is available to applications immediately, and the reasoning is recorded on #287.