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

Composable ActionMenu draft #1619

Merged
merged 29 commits into from
Dec 1, 2021
Merged

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Nov 17, 2021

Docs | Storybook
Closes #448

checklist:

  • Composable API
  • docs/drafts/ActionMenu2 (and move ActionList2 to /docs/drafts)
  • Visual updates
  • Adds MenuContext for composing ActionList
  • Keyboard navigation
  • the right roles for ActionList ul + li
  • dx: Show type error (typescript) if there are multiple children in Anchor
  • dx: Disable selection state for List when not in Dropdown/SelectPanel (+ fail loudly?)
  • flowchart to help selection between overlayed components - link

Will create another PR after this for feedback: ActionMenu.Overlay instead of overlayProps object

@github-actions
Copy link
Contributor

github-actions bot commented Nov 17, 2021

size-limit report 📦

Path Size
dist/browser.esm.js 57.34 KB (0%)
dist/browser.umd.js 57.74 KB (0%)

@changeset-bot
Copy link

changeset-bot bot commented Nov 18, 2021

🦋 Changeset detected

Latest commit: 6f0712d

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

This PR includes changesets to release 1 package
Name Type
@primer/components 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

| open | `boolean` | - | Optional. If defined, will control the open/closed state of the overlay. Must be used in conjuction with `onOpenChange`. |
| onOpenChange | `(open: boolean) => void` | - | Optional. If defined, will control the open/closed state of the overlay. Must be used in conjuction with `open`. |
| anchorRef | `React.RefObject<HTMLElement>` | - | Optional. Useful for defining an external anchor |
| overlayProps | [`Partial<OverlayProps>`](/Overlay#component-props) | - | Optional. Props to be spread on the internal [`AnchoredOverlay`](/AnchoredOverlay) component. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we had an ActionMenu.Overlay component instead of exposing overlayProps? IMO that feels a little more aligned with the general direction of the ActionList API.

We do something similar for Autocomplete: https://primer.style/react/Autocomplete

Copy link
Member Author

@siddharthkp siddharthkp Nov 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!! That's something I wanted feedback on! I'm glad there's already precedence 💯

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I introduce that in a different PR, the types need some untangling for that and I'd like to get it reviewed on it's own

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. Sounds good 👍

Co-authored-by: Cole Bemis <colebemis@github.com>
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ship it 🚢

@siddharthkp siddharthkp merged commit a13efa4 into main Dec 1, 2021
@siddharthkp siddharthkp deleted the siddharth/composable-actionmenu branch December 1, 2021 10:39
@primer-css primer-css mentioned this pull request Dec 1, 2021
pksjce pushed a commit that referenced this pull request Dec 20, 2021
* wip

* add memex example

* add complex story

* add changeset

* add actionmenu2 to drafts

* add docs!

* polish the docs just a bit

* move MenuContext + add warning

* return null from selection

* polish stories

* fix story

* remove draft from status

* oops left a comment in

* change setOpen to onOpenChange

* Use Box instead of BorderBox in docs

* missed role in bad merge!

* remove component checklist import

Co-authored-by: Cole Bemis <colebemis@github.com>

Co-authored-by: Cole Bemis <colebemis@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants