Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(breaking): menu prefer explicit state for option items #1387

Merged
merged 7 commits into from
Apr 1, 2024

Conversation

segunadebayo
Copy link
Member

📝 Description

This PR refactors the menu machine to use an explicit state for managing option items. This makes the design of the component in Ark UI more flexible and encourages using custom components like OptionItemGroup that can encapsulate the state.

⛳️ Current behavior (updates)

Option Item State was handled in the menu machine, making it a bit harder to type and prone to name-mismatch errors.

🚀 New behavior

Invert control to the end user.

💣 Is this a breaking change (Yes/No):

Yes

📝 Additional Information

Copy link

changeset-bot bot commented Apr 1, 2024

🦋 Changeset detected

Latest commit: 4027d61

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 72 packages
Name Type
@zag-js/menu Minor
@zag-js/anatomy-icons Minor
@zag-js/anatomy Minor
@zag-js/core Minor
@zag-js/docs Minor
@zag-js/preact Minor
@zag-js/react Minor
@zag-js/solid Minor
@zag-js/svelte Minor
@zag-js/vue Minor
@zag-js/accordion Minor
@zag-js/avatar Minor
@zag-js/carousel Minor
@zag-js/checkbox Minor
@zag-js/clipboard Minor
@zag-js/collapsible Minor
@zag-js/color-picker Minor
@zag-js/combobox Minor
@zag-js/date-picker Minor
@zag-js/dialog Minor
@zag-js/editable Minor
@zag-js/file-upload Minor
@zag-js/floating-panel Minor
@zag-js/hover-card Minor
@zag-js/number-input Minor
@zag-js/pagination Minor
@zag-js/pin-input Minor
@zag-js/popover Minor
@zag-js/presence Minor
@zag-js/progress Minor
@zag-js/radio-group Minor
@zag-js/rating-group Minor
@zag-js/select Minor
@zag-js/slider Minor
@zag-js/splitter Minor
@zag-js/switch Minor
@zag-js/tabs Minor
@zag-js/tags-input Minor
@zag-js/toast Minor
@zag-js/toggle-group Minor
@zag-js/tooltip Minor
@zag-js/tour Minor
@zag-js/tree-view Minor
@zag-js/store Minor
@zag-js/types Minor
@zag-js/aria-hidden Minor
@zag-js/auto-resize Minor
@zag-js/collection Minor
@zag-js/color-utils Minor
@zag-js/utils Minor
@zag-js/date-utils Minor
@zag-js/dismissable Minor
@zag-js/dom-event Minor
@zag-js/dom-query Minor
@zag-js/element-rect Minor
@zag-js/element-size Minor
@zag-js/file-utils Minor
@zag-js/focus-scope Minor
@zag-js/focus-visible Minor
@zag-js/form-utils Minor
@zag-js/i18n-utils Minor
@zag-js/interact-outside Minor
@zag-js/live-region Minor
@zag-js/mutation-observer Minor
@zag-js/number-utils Minor
@zag-js/numeric-range Minor
@zag-js/popper Minor
@zag-js/rect-utils Minor
@zag-js/remove-scroll Minor
@zag-js/tabbable Minor
@zag-js/text-selection Minor
@zag-js/visually-hidden Minor

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

Copy link

vercel bot commented Apr 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
zag-nextjs ✅ Ready (Inspect) Visit Preview Apr 1, 2024 5:28pm
zag-solid ✅ Ready (Inspect) Visit Preview Apr 1, 2024 5:28pm
zag-vue ✅ Ready (Inspect) Visit Preview Apr 1, 2024 5:28pm
zag-website ✅ Ready (Inspect) Visit Preview Apr 1, 2024 5:28pm

Copy link
Contributor

github-actions bot commented Apr 1, 2024

Visualize the logic of the machines here 🎊

@segunadebayo segunadebayo marked this pull request as draft April 1, 2024 16:48
@segunadebayo segunadebayo changed the title refactor(breaking): menu prefer explicit state for options refactor(breaking): menu prefer explicit state for option items Apr 1, 2024
@segunadebayo segunadebayo merged commit b119136 into main Apr 1, 2024
19 checks passed
@segunadebayo segunadebayo deleted the breaking/menu branch April 1, 2024 17:47
@github-actions github-actions bot mentioned this pull request Apr 1, 2024
colinlienard pushed a commit to colinlienard/zag that referenced this pull request Jun 18, 2024
…ra-ui#1387)

* refactor: menu prefer explicit state for options

* fix: types

* fix: props

* chore: rename types

* docs: update typedocs

* feat: add highlight change callback

* fix: menu props
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant