Navigation: Implement Keyboard Navigation (#41618)

* Navigation: Start creating new NavBarMenu component

* Navigation: Apply new NavBarMenu to NavBarNext

* Navigation: Remove everything to do with .sidemenu-open--xs

* Navigation: Ensure search is passed to NavBarMenu

* Navigation: Standardise NavBarMenuItem

* This extra check isn't needed anymore

* Navigation: Refactor <li> out of NavBarMenu

* Navigation: Combine NavBarMenuItem with DropdownChild

* use spread syntax since performance shouldn't be a concern for such small arrays

* Improve active item logic

* Ensure unique keys

* Remove this duplicate code

* Add unit tests for getActiveItem

* Add tests for NavBarMenu

* Rename mobileMenuOpen -> menuOpen in NavBarNext (since it can be used for mobile menu or megamenu)

* just use index to key the items

* Use exact versions of @react-aria packages

* Navigation: Make the dropdown header a NavBarMenuItem

* Navigation: Stop using dropdown-menu for styles

* Navigation: Add react-aria relevant packages

* Navigation: Refactor NavBarDropdown to support react aria

* Navigation: apply keyboard navigation to NavBar component

* Navigation: UseHover hook for triggering submenu on navbar

* Navigation: rename testMenu component to NavBarItemButton

* WIP

* some hacks

* Refactor: clean up keybinding events

* Navigation:  render subtitle on item menu and disable it

* Navigation: Adds react-aria types (#42113)

* Refactor: refactor out to NavBarItemWithoutMenu

* Refactor: cleaning up stuff

* Refactor: comment out unused code

* Chore: Removes section and uses items only

* Chore: fix NavBarNext

* Chore: adds tests

* Refactor: minimize props api

* Refactor: various refactors

* Refactor: rename enableAllItems

* Refactor: remove unused code

* Refactor: fix clicking on menuitems

* Refactor: use recommended onAction instead

* Navigation: Fix a11y issues on NavBar

* Navigation: Fix a11y navBar Next

* Navigation: Remove unnecessary label prop, use link.text instead

* Apply suggestions from code review

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>

* Apply unit tests suggestions from code review

Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>

* Update react-aria/menu package to latest version and apply PR suggestion

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com>
This commit is contained in:
Maria Alexandra
2021-12-06 06:58:17 +01:00
committed by GitHub
co-authored by kay delaney Ashley Harrison Alex Khomenko Hugo Häggmark
parent bf744698a1
commit e468fcf518
18 changed files with 911 additions and 401 deletions
+11
View File
@@ -83,6 +83,10 @@
"@kusto/monaco-kusto": "4.0.6",
"@microsoft/api-extractor": "7.18.16",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
"@react-types/button": "3.4.1",
"@react-types/menu": "3.4.1",
"@react-types/overlays": "3.5.1",
"@react-types/shared": "3.9.0",
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
"@swc/core": "1.2.103",
"@swc/helpers": "0.2.13",
@@ -243,8 +247,15 @@
"@opentelemetry/exporter-collector": "0.23.0",
"@opentelemetry/semantic-conventions": "1.0.0",
"@popperjs/core": "2.5.4",
"@react-aria/button": "3.3.4",
"@react-aria/focus": "3.5.0",
"@react-aria/interactions": "3.6.0",
"@react-aria/menu": "3.3.0",
"@react-aria/overlays": "3.7.2",
"@react-aria/utils": "3.9.0",
"@react-stately/collections": "3.3.4",
"@react-stately/menu": "3.2.3",
"@react-stately/tree": "3.2.0",
"@reduxjs/toolkit": "1.6.1",
"@sentry/browser": "6.15.0",
"@sentry/types": "6.15.0",