Skip to content

Commit f9d3cde

Browse files
authored
feat(aria/menu): create the aria menu (#32080)
* feat(aria/ui-patterns): add initial menu pattern * Adds the initial implementation of the WAI-ARIA menu, menubar, and menuitem patterns. This includes the basic behaviors for keyboard navigation, opening and closing submenus, and typeahead support. * This also introduces a 'focusElement' option to the list navigation behaviors to allow for moving the active item without focusing it. * feat(aria/menu): add initial menu directives * Adds the initial implementation of the 'ngMenu', 'ngMenuBar', 'ngMenuItem', and 'ngMenuTrigger' directives built on top of the menu UI patterns. * feat(aria/menu): add examples for aria menu * Adds four examples for the new ARIA menu directives: - A menubar example demonstrating a typical application menu. - A menu trigger example showing a simple icon button that opens a menu. - A standalone menu example. - A context menu example that opens on right-click. * Also includes a set of simple wrapper directives to apply basic popover styles and behavior to the examples. * test(aria/menu): add unit tests * build(aria/menu): add menu to entrypoints
1 parent daaa69c commit f9d3cde

30 files changed

+3827
-31
lines changed

src/aria/config.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ARIA_ENTRYPOINTS = [
44
"combobox",
55
"deferred-content",
66
"listbox",
7+
"menu",
78
"radio-group",
89
"tabs",
910
"toolbar",

src/aria/menu/BUILD.bazel

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
load("//tools:defaults.bzl", "ng_project", "ng_web_test_suite")
2+
3+
package(default_visibility = ["//visibility:public"])
4+
5+
ng_project(
6+
name = "menu",
7+
srcs = glob(
8+
["**/*.ts"],
9+
exclude = ["**/*.spec.ts"],
10+
),
11+
deps = [
12+
"//:node_modules/@angular/core",
13+
"//src/aria/ui-patterns",
14+
"//src/cdk/a11y",
15+
"//src/cdk/bidi",
16+
],
17+
)
18+
19+
ng_project(
20+
name = "unit_test_sources",
21+
testonly = True,
22+
srcs = glob(
23+
["**/*.spec.ts"],
24+
exclude = ["**/*.e2e.spec.ts"],
25+
),
26+
deps = [
27+
":menu",
28+
"//:node_modules/@angular/core",
29+
"//:node_modules/@angular/platform-browser",
30+
"//:node_modules/axe-core",
31+
"//src/cdk/testing/private",
32+
],
33+
)
34+
35+
ng_web_test_suite(
36+
name = "unit_tests",
37+
deps = [":unit_test_sources"],
38+
)

src/aria/menu/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.dev/license
7+
*/
8+
9+
export {Menu, MenuBar, MenuItem, MenuTrigger} from './menu';

0 commit comments

Comments
 (0)