Repository navigation
feat: positioning, actionsRef, list and form options across primitives - #2306
Conversation
Tooltip.Content takes anchor (element, virtual element, ref or function), positionMethod, collisionAvoidance, sticky, arrowPadding and disableAnchorTracking, built on shared positioning helpers. Tooltip.Root takes disabled and disableHoverablePopup; Tooltip.Trigger takes closeOnClick (default true), and a disabled trigger doesn't open it.
HoverCard.Content, Popover.Content and the menu Root take anchor, positionMethod, collisionAvoidance, sticky and disableAnchorTracking (and arrowPadding where there is an arrow). HoverCard onOpenChange gets details with a reason and cancel(); its triggers take delay/closeDelay. Popover triggers take openOnHover/delay/closeDelay. Menus take highlightItemOnHover, onItemHighlighted and closeParentOnEsc; Escape in a submenu now closes only that submenu and returns focus to its trigger item.
…ptions The shared list primitive takes filter (or null), limit, locale, readOnly, form, inputRef, highlightItemOnHover, onItemHighlighted, loop, and the positioning options (anchor, positionMethod, collisionAvoidance, disableAnchorTracking, boolean sticky). The default filter ignores case and accents; Combobox.useFilter and Autocomplete.useFilter expose the matchers. Autocomplete takes autoHighlight (default off, so Enter keeps typed text), openOnInputClick, submitOnItemClick and mode.
Checkbox: indeterminate, uncheckedValue, form, inputRef. Switch: uncheckedValue, form, inputRef. RadioGroup: form, inputRef. Form reset follows a form outside the tree. Slider: thumbCollisionBehavior (none/push/swap), format/locale value text, largeStep, form; thumbs take getAriaLabel, getAriaValueText and inputRef.
… required OTP NumberField takes allowOutOfRange, snapOnStep, form and inputRef. OTPField takes mask, normalizeValue, onValueInvalid, inputMode, autoComplete and form, and gains OTPField.Separator. A required OTPField now blocks submission until every slot is filled: the code sat in a hidden input, which browsers never validate.
Dialog, AlertDialog, Popover, Tooltip, HoverCard, menus, Select and Combobox take actionsRef with close() (reason 'imperative-action'). Field takes actionsRef with validate(), controlled touched and dirty; Field.Control takes onValueChange. Form takes actionsRef with validate(name?).
Root takes delay, closeDelay, orientation (vertical opens panels with ArrowRight, ArrowLeft in RTL), onOpenChangeComplete and actionsRef. Content plays enter/exit transitions (data-starting-style / data-ending-style) and takes forceMount. A disabled Trigger doesn't open on hover or keys. Link takes active (aria-current) and closeOnClick.
Disabled toolbar items can stay in the arrow-key order, announced as disabled and ignoring presses (Input becomes read-only).
Drawer.Provider tracks whether any drawer inside is open; Drawer.Indent and Drawer.IndentBackground get data-active then, and the default theme eases the page back (respects reduced motion).
Tree.Root takes expanded / defaultExpanded / onExpandedChange (keys are item id, value or label) and dir; in RTL ArrowLeft expands and ArrowRight collapses. Checklist tests added for RadioCards, CheckboxCards and TextArea (keyboard, RTL, forms, Field).
Changes are grouped (Breaking changes / New / Fixes), each linked to its PR, long entries cut to their first sentence, docs-only entries left out, with an install line and npm / changelog / docs links. Drops the broken README summary, the changelog-file and repo fields and the timestamp. The embed colour follows the biggest change. Moved to .github/scripts/announce-release.mjs, which can preview with DRY_RUN=1.
Menu Content and the Select/Combobox Root take finalFocus (trigger by default, false, a ref or a function). Select/Combobox take autoComplete for the hidden control; their Separator takes orientation. ToggleGroup takes multiple as a shorthand for type="multiple".
🦋 Changeset detectedLatest commit: 2953f76 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedToo many files! This PR contains 125 files, which is 25 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.
|
CoverageThis report compares the PR with the base branch. "Δ" shows how the PR affects each metric.
Coverage improved or stayed the same. Great job! Run |
API additions across the primitives, plus two bug fixes and a clearer release announcement.
Positioning (Tooltip, HoverCard, Popover Content, menu Roots, Select/Combobox/Autocomplete Root):
anchor(element, virtual element, ref or function),positionMethod,collisionAvoidance(flip/shift/none per axis),sticky,disableAnchorTracking,arrowPadding.Imperative actions:
actionsRefwithclose()on Dialog, AlertDialog, Popover, Tooltip, HoverCard, menus, Select, Combobox and NavigationMenu;validate()on Field and Form.Lists:
filter(ornull),limit,locale,readOnly,form,inputRef,autoComplete,finalFocus,highlightItemOnHover,onItemHighlighted,loop;Combobox.useFilter/Autocomplete.useFilter; newSelect.Label,Combobox.Status,Autocomplete.Status; AutocompleteautoHighlight,openOnInputClick,submitOnItemClick,mode.Form controls: Checkbox
indeterminate,uncheckedValue; SwitchuncheckedValue;form/inputRefon Checkbox, Switch, RadioGroup, Slider, NumberField, OTPField. SliderthumbCollisionBehavior,format/locale,largeStep, thumbgetAriaLabel/getAriaValueText. NumberFieldallowOutOfRange,snapOnStep. OTPFieldmask,normalizeValue,onValueInvalid,inputMode,autoComplete,OTPField.Separator. Field controlledtouched/dirty,Field.ControlonValueChange.Other: Tooltip
disabled,disableHoverablePopup, TriggercloseOnClick; HoverCardonOpenChangedetails and per-trigger delays; Popover per-triggeropenOnHover/delays; menushighlightItemOnHover,onItemHighlighted,closeParentOnEsc,finalFocus,Arrowpart; NavigationMenudelay,closeDelay,orientation, transitions,onOpenChangeComplete, disabled Trigger, Linkactive/closeOnClick; ToolbarfocusableWhenDisabled; DrawerProvider/Indent/IndentBackground; Treeexpanded/defaultExpanded/onExpandedChangeand RTL arrows; ToggleGroupmultiple.Fixes
closeParentOnEsckeeps the old behaviour).requiredOTPField never blocked form submission (the value sat in a hidden input, which browsers don't validate).Release announcement: the Discord post groups changes (Breaking changes / New / Fixes), links each to its PR, shortens long entries, drops docs-only ones, and ends with an install line and npm / changelog / docs links. The broken README summary, changelog-file, repo and timestamp fields are gone. Preview with
DRY_RUN=1 PKG_NAME=@radui/ui PKG_VERSION=1.1.4 REPO=rad-ui/ui node .github/scripts/announce-release.mjs.Gates: tsc, eslint, 2307 tests, build, exports check, Storybook build + 10 browser tests, docs build against this package (305 pages). Changesets included; docs rows follow in the docs PR after the release.