github chakra-ui/zag @zag-js/scheduler@2.0.0-next.4

Major Changes

  • #3342
    1e1f6da Thanks
    @github-actions! - Breaking: Spell out "Prev" as "Previous" across the
    API.

    The prevTrigger part is now previousTrigger in carousel, date picker, pagination, scheduler and steps, including
    its prop getter, data attribute, ids key 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.prevTriggerLabel to translations.previousTriggerLabel.

    Component Before After
    Carousel scrollPrev(), canScrollPrev scrollPrevious(), canScrollPrevious
    Date picker, Scheduler goToPrev() goToPrevious()
    Pagination goToPrevPage() goToPreviousPage()
    Steps goToPrevStep(), hasPrevStep goToPreviousStep(), hasPreviousStep
    Tabs selectPrev() selectPrevious()
    Tour prev(), hasPrevStep previous(), hasPreviousStep

    The tour's "prev" action is now "previous", and its trigger renders data-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" }

Patch Changes

  • #3342
    730ea29 Thanks
    @github-actions! - - Fix focus, scroll and sync work scheduled for the next
    frame running after the component unmounts.

  • #3342
    12f18ab Thanks
    @github-actions! - - Add resource scheduling: per-resource lanes in each day
    column, or one row per resource in the new timeline view.

    scheduler.machine({
      resources: [
        { id: "room-a", title: "Room A" },
        { id: "room-b", title: "Room B" },
      ],
      groupBy: "resource",
      events: [{ id: "1", resourceId: "room-a" /* ... */ }],
    })
    • Add drop constraints with canDropEvent, and external drag and drop with dataTransferFormat and onEventReceive.

    • Add getAllDaySegments(days?) to lay out each all-day event as one bar across its days.

    • Add maxAllDayRows to cap the all-day row, with per-day counts from getAllDayOverflow().

    • Use CalendarDateTime for dates in the scheduler API.

    • Fix dragging or resizing an all-day event collapsing it into a zero-length timed event.

    • Fix dragging an event edge past the opposite edge inverting the event.

    • Fix multi-day and midnight-crossing events missing from, or duplicated on, the visible days.

    • Fix events on different resources being treated as conflicting.

    • Fix long all-day titles widening the column, and stacked all-day bars spilling into the time grid.

    • Date utils: Return the date type passed in from the alignment, pagination and week/month helpers.

  • Updated dependencies [a80b307,
    12f18ab]:

    • @zag-js/dom-query@2.0.0-next.4
    • @zag-js/date-utils@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

Don't miss a new zag release

NewReleases is sending notifications on new releases.