Major Changes
-
#3342
1e1f6daThanks
@github-actions! - Breaking: Spell out "Prev" as "Previous" across the
API.The
prevTriggerpart is nowpreviousTriggerin carousel, date picker, pagination, scheduler and steps, including
its prop getter, data attribute,idskey and translation key.- <button {...api.getPrevTriggerProps()} /> + <button {...api.getPreviousTriggerProps()} /> - [data-carousel-prev-trigger] { ... } + [data-carousel-previous-trigger] { ... } carousel.machine({ - ids: { prevTrigger: "prev" }, - translations: { prevTrigger: "Previous slide" }, + ids: { previousTrigger: "prev" }, + translations: { previousTrigger: "Previous slide" }, })
Pagination and scheduler rename
translations.prevTriggerLabeltotranslations.previousTriggerLabel.Component Before After Carousel scrollPrev(),canScrollPrevscrollPrevious(),canScrollPreviousDate picker, Scheduler goToPrev()goToPrevious()Pagination goToPrevPage()goToPreviousPage()Steps goToPrevStep(),hasPrevStepgoToPreviousStep(),hasPreviousStepTabs selectPrev()selectPrevious()Tour prev(),hasPrevStepprevious(),hasPreviousStepThe tour's
"prev"action is now"previous", and its trigger rendersdata-type="previous".- actions: [{ label: "Prev", action: "prev" }], + actions: [{ label: "Previous", action: "previous" }], - action: (actions) => actions.prev() + action: (actions) => actions.previous() - translations: { prevStep: "Previous step" } + translations: { previousStep: "Previous step" }
-
#3342
d6089c3Thanks
@github-actions! - - Breaking: Remove the indicator's inline transition
and the--transition-*CSS variables. Add the transition in CSS, and turn it off fordata-instant, which is set
when the indicator moves for a reason other than a value change (first render, resize,dirororientationchange).[data-tabs-indicator] { - --transition-duration: 0.2s; - --transition-timing-function: ease-in-out; + transition: + left 0.2s ease-in-out, + width 0.2s ease-in-out; } + + [data-tabs-indicator][data-instant] { + transition: none; + }-
Breaking: Replace
data-ssrwithdata-indicator-pending. It's set during server rendering and while the
indicator hasn't been measured, such as inside a hidden panel.- [data-tabs-trigger][data-selected][data-ssr] { ... } + [data-tabs-trigger][data-selected][data-indicator-pending] { ... }
-
Fix the indicator animating on resize after a transition never finished.
-
Add
data-activation-directionto every part,api.activationDirection, andactivationDirectionin
onValueChange, for animating panels in the direction of the selected tab. -
Add
getIndicatorState, andorientationandactivationDirectiontogetContentState. -
Type
valueinonValueChangeandfocusedValueinonFocusChangeas nullable. They'renullafter deselecting,
and when focus leaves the list. -
Fix the indicator not following the selected tab when tabs are reordered, added, removed or scrolled.
-
Fix
setIndicatorRectnot moving the indicator. -
Fix
selectNextandselectPreviousnot selecting in manual mode. -
Fix arrow keys pressed with a modifier switching tabs, and Home and End moving DOM focus with
virtualFocus. -
Fix the tab list losing its tab stop when no tab is selected or the selected tab is disabled.
-
Fix Home, End and
setValuedeselecting the selected tab whendeselectableis set. -
Fix the tab list staying focused when focus moves to another tab list.
-
Minor Changes
- #3342
4f28f36Thanks
@github-actions! - - AddreasontoonValueChangedetails, such as
trigger-click,keyboard,drag,item-selectorscript. Each component exports itsValueChangeReasontype.
Slider also adds it toonValueChangeEnd.
Patch Changes
- #3342
730ea29Thanks
@github-actions! - - Fix focus, scroll and sync work scheduled for the next
frame running after the component unmounts. - Updated dependencies [
a80b307]:- @zag-js/dom-query@2.0.0-next.4
- @zag-js/core@2.0.0-next.4
- @zag-js/anatomy@2.0.0-next.4
- @zag-js/types@2.0.0-next.4
- @zag-js/utils@2.0.0-next.4