Repository navigation
feat(rune-kit): add composable headless primitives and expose reusable utilities - #3208
Merged
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an additive
rune_kit::headlessmodule and exposesrune-kit's shared component-authoring utilities publicly so downstream applications and custom design systems can reuse keyboard navigation, ARIA roles/states, focus management, and floating placement without adoptingrune-kit's default visual chrome.What changed
rune_kit::headless):Button,Toggle,Switch,Checkbox— wrap arbitrary caller-suppliedElvisuals with WAI-ARIA roles, pressed/checked/mixed/expanded/controls/has_popup states, focusability, keyboard activation, and disabled-safe handler attachment.Disclosure+DisclosureState(DisclosurePhase,DisclosureEvent,DisclosureEffect) — explicit open/close state machine and headless trigger/region builder withbuild_parts()for full layout control.Listbox&Menu(ListboxItem,ListboxItemState,MenuItem) — render-prop / slot-based builders withlistbox/optionandmenu/menuitemARIA wiring, roving keyboard navigation, disabled-item skipping, type-ahead, and optional anchored popup mounting.Tabs(TabItem,TabState,TabActivation::{Automatic, Manual}) —tablist/tab/tabpanelARIA wiring, horizontal/vertical orientation, disabled-tab skipping, automatic and manual keyboard activation, andbuild_parts().Popover— anchors any custom surfaceElto a keyed trigger withFloatingPlacement, focus return, modal or non-modal outside-press scrim, andEscapedismissal without requiring&Kit.RovingFocus/ListNav(RovingAxis,RovingOutcome),FloatingPlacement/FloatingRect, andDismiss(outside_dismiss,escape_dismiss,modal_dismissand*_txvariants).list_nav(NavStep,NavAction,NavPolicy,TypeAhead,type_select,page_size,allows_list_mods),Grip,Acts,ButtonSkin,over,press_over,Placement::{split, from_parts, opposite_side}, andKitvisual-state/focus/disabled/motion helpers (surface_state,hover_surface,overlay_state,focus_ring,focus_ring_state,disabled_dim,disabled_dim_alpha,apply_*_motion).rune-kitcomponents remain 100% source- and behavior-compatible and share the same underlying helpers.Verification
cargo test -j 1 -p rune-kit --lib headless(10/10 passed: roving focus arrows/RTL/Home/End/PageUp/PageDown/typeahead/disabled-skip, floating placement flip/align-flip/shift/bounds/round, disclosure state machine & builder, headless Button/Toggle/Switch/Checkbox/Listbox/Menu/Tabs/Popover ARIA & keyboard, public utilities)cargo test -j 1 -p rune-kit --lib list_nav,grip,popover::tests(all passed)cargo check -j 1 -p rune-kit --all-features(passed)cargo check -j 1 -p rune-kit --target wasm32-unknown-unknown(passed)scripts/file-size.sh(0 errors, 0 folder-shape issues)Fixes #2653