-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 experimental dropdown menu usages to latest version #55625
Merged
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
34d2ba1
First attempt at refactoring the view actions dropdown
ciampo 46a5bf5
note
ciampo be88dba
Force all menus to have "left-start" placement.
ciampo 377b0d8
Port changes missed in rebase due to file renames
oandregal 9432e65
ViewActions: remove unnecessary icon management
oandregal ee4d695
ViewTable: remove SubMenu, SubMenuTrigger, and use RadioItem
oandregal b3575f2
Use Ariakit versions in FilterSummary as well
oandregal b3179a8
AddFilter: migrate to Ariakit
oandregal a74c886
Update sort behavior to match RadioItem (cannot be unset once set)
oandregal 7530ed4
Remove old add-filter file
oandregal b8698ab
Use ariakit components
oandregal f50a1b6
remove submenu trigger
oandregal 6b25c2a
DropdownMenuItem: substitute onSelect by onClick
oandregal 8cedafb
Remove old filter-summary file
oandregal 3b21c2f
FilterSummary: use the ariakit versions
oandregal e28f4c9
Substitute trigger by menuitem
oandregal 82d89f8
DropdownMenuItem: substitute onSelect by onClick
oandregal b6ba575
Remove old view-table file
oandregal ff2e74e
ViewTable: update to ariakit
oandregal fe549a9
Remove trigger
oandregal 218652c
DropdownMenuItem: substitute onSelect by onClick
oandregal 9e854fe
Remove DropdownSubMenu in favor of DropdownMenu across dataviews package
oandregal fb23128
Remove suffix chevronrightsmall across dataviews
oandregal 2e7855d
Fix rebase for view-actions
oandregal 5c4e940
Remove unnecessary label
ciampo 2971e40
Use DropdownMenuItemLabel component
ciampo b5c4599
Hide suffix contents to assistive tech
ciampo 7ac661b
Refactor conditions to use radio menu items
ciampo 087a047
Hide suffix contents to assistive technology
ciampo a7f3db3
Fix checked check
ciampo 37367ee
Remove unnecessary preventDefault() calls
ciampo 0edbc42
Improve isActive check, remove extra icons, remove extra preventDefau…
ciampo c7693ab
Fix label not appearing
ciampo 171b13a
Use filter name instead of field, as done for other menus in the file
ciampo b71ec66
Rename isActive to isChecked
ciampo a5dd424
Remove unneeded radio semantics from hide button
ciampo 39e26a5
Refactor to DropdownMenuRadioItem
ciampo f4337f3
Refactor to DrodownMenuRadioItem
ciampo 5a267cf
Refactor OPERATORS
ciampo e6420b0
Refactor filter summery operators to radio items
ciampo 105063f
Fix OPERATORS object && checks
ciampo 27b69b0
Remove comment
ciampo 2412ab0
Refactor operators code in view table
ciampo 49b8ab8
Add custom spacing for custom menu radio items
ciampo 04adf97
Remove comment
ciampo d82b7c8
Replace preventDefault with hideOnClick={false}
ciampo 662e7f0
Move OPERATORS object to common constants file
ciampo ac60750
Use the `onChange` event instead of `onClick` on radio items + the ev…
ciampo 5bd5f4d
Extract custom dropdown radio item implementation
ciampo eb7abf5
Swap actual menu radio items with custom implementation
ciampo ae88946
Fix warning when onChange prop is not defined
ciampo 4c7a592
Add a few min widths to dropdowns to avoid jumping and for better whi…
ciampo 6a17c1c
Extract sorting directions to constants
ciampo 17475d9
Refactor more code to use the OPERATORS constant instead of individua…
ciampo 18f3885
Remove un-needed workaround, now that Truncate has been updated
ciampo 09c6a25
Remove hardcoded left placements
ciampo ffa0e58
Use dot icon instead of check for custom radios
ciampo 36261ed
Use real DropdownMenuRadioItem where possible
ciampo f7e6b25
Fix e2e test
ciampo 95718a0
Sort dependencies
ciampo 79bff91
Update package.lock
ciampo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird as a component, why not a prop of
DropdownMenuItem
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DropdownMenuItemLabel
(together witnDropdownMenuItemHelpText
) are useful to use the correct typography, and to make sure that the text gets truncated appropriately (label after one line, help text after two lines).The reason why I exposed them as separate components is because I wanted to give consumers of
DropdownMenu
the freedom of passing any React component aschildren
. Folks can opt in to the "default" look by usingDropdownMenuItemLabel
and/or DropdownMenuItemHelpText`, but they can also pass any other content in case they want to go custom.Using dedicated props instead of
children
would either limit the flexibility of what we can display in the menu item (ie. what if folks don't want to truncate the label text after 1 line?), or even worse, end up in a similar situation toButton
where we currently have atext
prop and achildren
prop.Having said that, the component is still under active development and only exposed via private APIs, so we can make changes as we see fit.