@illinois-toolkit/ilw-header-megamenu 0.0.1 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Web at Illinois
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Web at Illinois
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
package/README.md CHANGED
@@ -1,261 +1,229 @@
1
- # ilw-header-megamenu
2
-
3
- Links: **[ilw-header-megamenu in Builder](https://builder3.toolkit.illinois.edu/component/ilw-header-megamenu/index.html)** |
4
- [Illinois Web Theme](https://webtheme.illinois.edu/) |
5
- [Toolkit Development](https://github.com/web-illinois/toolkit-management)
6
-
7
- ## Overview
8
-
9
- An Illinois Mega Menu utilizes the standard design of the header menu, including the ability to have a link and toggle dropdown or just a static label with toggle dropdown. The difference will be the dropdown takes up the full-width of the container maxing out at 1270px, slightly exceeding the length of the main nav bar items. Each dropdown section has a maximum of 4 columns, evenly spaced with a diving bar between each.
10
-
11
- The mega menu is not suited for more than 1 layer of nested lists, if you require more, use the original ilw-header-menu with nested ilw-header-menu-sections instead (flyout menu).
12
-
13
- ---------
14
-
15
- The ilw-header-megamenu should contain an unordered list. Each list item can contain one of three items:
16
-
17
- - a simple link or button (`<a>` or `<button>`)
18
- - an <ilw-header-megamenu-section> that contains a span and at least one unordered list of links. The span should contain `slot="label"`.
19
- - an <ilw-header-megamenu-section linked="true"> that contains an anchor and at least one unordered list of links. The anchor should contain `slot="link"`.
20
-
21
- Within each `ilw-header-megamenu-section` or `ilw-header-megamenu-section linked="true"` you can choose:
22
- - a basic unordered list of less than 20 links and no nesting. Each list item will be divided into groups of 5 or less. Adding more than 20 items will result in missing links.
23
-
24
- OR a `<div>` containing:
25
- - four seperated lists of links with nesting. Each new list will become it's own column. You can have as many list items as you want using this method. Note that items spanning more than four columns can result in wrapped columns.
26
- Optional secondary items - each secondary item will be placed on the far right column, unless align-left class is added.
27
- - a decorative image
28
- - a `<span>` containing a paragraph element and a call to action (`<a>` or `<button>`). The span should contain `slot="action"`.
29
-
30
- The intention is to only use one secondary item, a decorative image or call-to-action, per dropdown. Repeating the same call-to-action in other dropdowns is not advised. You can use multiple lists.
31
-
32
- ## Attributes
33
-
34
- `width`: the numeric pixel width where it will change to the hamburger menu. This is defaulted to 990, but may be changed if you have a ridiculous menu.
35
- `compact`: a boolean value that will force the menu to be a hamburger menu. Before using this option, see Accessibility Notes and Use for more information.
36
-
37
- ## Classes
38
- `align-left`: aligns your secondary item to the far left column
39
- `span-2`: allows your secondary item to span 2 columns
40
- `span-3`: allows your secondary item to span 3 columns
41
-
42
- ## Code Examples
43
-
44
- ```html
45
- <ilw-header-megamenu slot="navigation">
46
- <ul>
47
- <li>
48
- <ilw-header-megamenu-section linked="true">
49
- <a slot="link" href="/">Basic top links, no groups or nesting</a>
50
-
51
- <ul>
52
- <li><a href="/">Undergrad Admissions</a></li>
53
- <li><a href="/">Graduate Admissions</a></li>
54
- <li><a href="/">International Admissions</a></li>
55
- <li><a href="/">Degrees</a></li>
56
- <li><a href="/">Certificates</a></li>
57
- <li><a href="/">Online Programs</a></li>
58
- <li><a href="/">Research Focus Areas</a></li>
59
- <li><a href="/">Find a mentor</a></li>
60
- <li><a href="/">Degrees</a></li>
61
- <li><a href="/">Certificates</a></li>
62
- <li><a href="/">Online Programs</a></li>
63
- <li><a href="/">Undergrad Admissions</a></li>
64
- <li><a href="/">Graduate Admissions</a></li>
65
- </ul>
66
-
67
- </ilw-header-megamenu-section>
68
- </li>
69
- <li>
70
- <ilw-header-megamenu-section>
71
- <span slot="label">Four columns, destinct groups with some nesting and a vanilla image</span>
72
- <div>
73
- <!-- column 1 -->
74
- <ul>
75
- <li><a href="/">Undergrad Admissions</a>
76
- <ul>
77
- <li><a href="/">Apply</a></li>
78
- <li><a href="/">Majors</a></li>
79
- <li><a href="/">Cost and Aid</a></li>
80
- </ul>
81
- </li>
82
- <li><a href="/">Graduate Admissions</a>
83
- <ul>
84
- <li><a href="/">Apply</a></li>
85
- <li><a href="/">Majors</a></li>
86
- <li><a href="/">Cost and Aid</a></li>
87
- </ul>
88
- </li>
89
- <li><a href="/">International Admissions</a></li>
90
- </ul>
91
- <!-- column 1 -->
92
- <!-- column 2 -->
93
- <ul>
94
- <li><a href="/">Degrees</a></li>
95
- <li><a href="/">Certificates</a></li>
96
- <li><a href="/">Online Programs</a></li>
97
- </ul>
98
- <!-- column 2 -->
99
- <!-- column 3 -->
100
- <ul>
101
- <li><a href="/">Undergrad Admissions</a></li>
102
- <li><a href="/">Graduate Admissions</a></li>
103
- <li><a href="/">International Admissions</a>
104
- <ul>
105
- <li><a href="/">Degrees</a></li>
106
- <li><a href="/">Certificates</a></li>
107
- <li><a href="/">Online Programs</a></li>
108
- <li><a href="/">Research Focus Areas</a></li>
109
- </ul>
110
- </li>
111
- <li><a href="/">Find a mentor</a></li>
112
- <li><a href="/">Student Handbook</a></li>
113
- </ul>
114
- <!-- column 3 -->
115
- <!-- column 4 -->
116
- <ul>
117
- <li><a href="/">Undergrad Admissions</a></li>
118
- <li><a href="/">Graduate Admissions</a></li>
119
- <li><a href="/">International Admissions</a>
120
- <ul>
121
- <li><a href="/">Degrees</a></li>
122
- <li><a href="/">Certificates</a></li>
123
- <li><a href="/">Online Programs</a></li>
124
- <li><a href="/">Research Focus Areas</a></li>
125
- </ul>
126
- </li>
127
- </ul>
128
- <!-- column 4 -->
129
- </div>
130
- </ilw-header-megamenu-section>
131
- </li>
132
- <li>
133
- <ilw-header-megamenu-section>
134
- <span slot="label">Links, with decorative image aligned left</span>
135
- <div>
136
- <ul>
137
- <li><a href="/">Undergrad Admissions</a></li>
138
- <li><a href="/">Graduate Admissions</a></li>
139
- <li><a href="/">International Admissions</a></li>
140
- <li><a href="/">Degrees</a></li>
141
- <li><a href="/">Certificates</a></li>
142
- </ul>
143
- <ul>
144
- <li><a href="/">Undergrad Admissions</a></li>
145
- <li><a href="/">Graduate Admissions</a></li>
146
- <li><a href="/">International Admissions</a></li>
147
- <li><a href="/">Degrees</a></li>
148
- <li><a href="/">Certificates</a></li>
149
- </ul>
150
- <ul>
151
- <li><a href="/">Undergrad Admissions</a></li>
152
- <li><a href="/">Graduate Admissions</a></li>
153
- <li><a href="/">International Admissions</a>
154
- <ul>
155
- <li><a href="/">Degrees</a></li>
156
- <li><a href="/">Certificates</a></li>
157
- <li><a href="/">Online Programs</a></li>
158
- <li><a href="/">Research Focus Areas</a></li>
159
- </ul>
160
- </li>
161
- <li><a href="/">Find a mentor</a></li>
162
- <li><a href="/">Student Handbook</a></li>
163
- </ul>
164
- <img class="align-left" src="https://fastly.picsum.photos/id/1025/500/400.jpg?hmac=MPFZjsU2UG1Mr3SjMkYP2F9jnhQWyatt6soxbOj0TN4" alt="">
165
- </div>
166
- </ilw-header-megamenu-section>
167
- </li>
168
- <li>
169
- <ilw-header-megamenu-section>
170
- <span slot="label">Links with image call to action</span>
171
- <div>
172
- <ul>
173
- <li><a href="/">Undergrad Admissions</a></li>
174
- <li><a href="/">Graduate Admissions</a></li>
175
- <li><a href="/">International Admissions</a>
176
- <ul>
177
- <li><a href="/">Degrees</a></li>
178
- <li><a href="/">Certificates</a></li>
179
- <li><a href="/">Online Programs</a></li>
180
- <li><a href="/">Research Focus Areas</a></li>
181
- </ul>
182
- </li>
183
- <li><a href="/">Find a mentor</a></li>
184
- <li><a href="/">Student Handbook</a></li>
185
- </ul>
186
- <span slot="action" class="span-3">
187
- <p> Prospective students </p>
188
- <button class="ilw-button ilw-theme-orange-2">Link 2</button>
189
- <img src="https://picsum.photos/id/37/300/300" alt="">
190
- </span>
191
-
192
- </div>
193
- </ilw-header-megamenu-section>
194
- </li>
195
- <li>
196
- <ilw-header-megamenu-section>
197
- <span slot="label">Links with plain call to action</span>
198
- <div>
199
- <ul>
200
- <li><a href="/">Undergrad Admissions</a></li>
201
- <li><a href="/">Graduate Admissions</a></li>
202
- <li><a href="/">International Admissions</a></li>
203
- <li><a href="/">Degrees</a></li>
204
- <li><a href="/">Certificates</a></li>
205
- <li><a href="/">Undergrad Admissions</a></li>
206
- <li><a href="/">Graduate Admissions</a></li>
207
- <li><a href="/">International Admissions</a></li>
208
- <li><a href="/">Degrees</a></li>
209
- <li><a href="/">Certificates</a></li>
210
- </ul>
211
- <ul>
212
- <li><a href="/">Undergrad Admissions</a></li>
213
- <li><a href="/">Graduate Admissions</a></li>
214
- <li><a href="/">International Admissions</a>
215
- <ul>
216
- <li><a href="/">Degrees</a></li>
217
- <li><a href="/">Certificates</a></li>
218
- <li><a href="/">Online Programs</a></li>
219
- <li><a href="/">Research Focus Areas</a></li>
220
- </ul>
221
- </li>
222
- <li><a href="/">Find a mentor</a></li>
223
- <li><a href="/">Student Handbook</a></li>
224
- </ul>
225
- <span slot="action" class="span-2 align-left">
226
- <p> Prospective students </p>
227
- <button class="ilw-button ilw-theme-orange-2">Link 2</button>
228
- </span>
229
-
230
- </div>
231
- </ilw-header-megamenu-section>
232
- </li>
233
- </ul>
234
- </ilw-header-megamenu>
235
- ```
236
-
237
- ## Usability
238
- When creating menus, do not include all your links inside the menu. Just focus on the high-level links, and rely on breadcrumbs and side menus for internal links. Having a large menu system reduces usability.
239
-
240
- While it is tempting to hide your menu with the hamburger menu option, only do this if you have no other option. Hamburger menus harm usability because it hides the top-level categories and reduces the ability for users to browse to find what they want, especially for new users.
241
-
242
- ## Accessibility Notes and Use
243
-
244
- Note from Keith:
245
- - Navigation / Menus are unique in that most screen reader users will only expect linked items to exist inside of this element role. This means that any headings or static text should be avoided since they will likely be missed by this audience.
246
-
247
- ### Keyboard navigation
248
- - While all dropdowns are closed: Use `Tab/Shift + Tab` or `left/right arrow keys` move the user across the top level navigation bar.
249
- - Open a dropdown: Focus on the toggle button and press `enter` or `space`.
250
- - Navigate an open dropdown: `Tab/Shift + Tab` or `down/up arrow keys` will go down/up the list.
251
- - Close an open dropdown: Click anywhere else on the screen, press `escape` to close and return focus to the corresponding toggle button or hitting the `Left/right arrow keys` will close the dropdown and go to the next item in the top level navigation bar.
252
- - Focus stays on the same menu item when the browser changes sizes to switch between mega and hamburger menu
253
-
254
- ### ARIA
255
- - Each toggle button will get the attributes: `aria-haspopup="true"`, `aria-expanded="true"`, `aria-controls="parent-name-menu"` and `aria-label="Toggle parent-name submenu`. The SVG will get `aria-hidden="true"`
256
- - Each section will get a unique id and label, example: `id="parent-name-menu"` and `aria-label="About submenu"`
257
- - For call to action items, the paragraph will get: `id="parent-name-action-text"` and the clickable element will receive `aria-describedby="parent-name-action-text"`.
258
-
259
- ## External References
260
-
261
- See [ilw-header-menu documentation](https://github.com/web-illinois/ilw-header-menu)
1
+ # ilw-header-megamenu
2
+
3
+ Links: **[ilw-header-megamenu in Builder](https://builder3.toolkit.illinois.edu/component/ilw-header-megamenu/index.html)** |
4
+ [Illinois Web Theme](https://webtheme.illinois.edu/) |
5
+ [Toolkit Development](https://github.com/web-illinois/toolkit-management)
6
+
7
+ ## Overview
8
+
9
+ An Illinois Mega Menu utilizes the standard design of the header menu, limited to only dropdown labels or singular links for top level items, no link combination toggles. The dropdown itself takes up the full-width of the container maxing out at 1270px, slightly exceeding the length of the main nav bar items. Each dropdown section has a maximum of 4 columns, evenly spaced with a diving bar between each.
10
+
11
+ The Mega Menu is not suited for more than 1 layer of nested lists, if you require more, use the original ilw-header-menu with nested ilw-header-menu-sections instead (flyout menu).
12
+
13
+ ---------
14
+
15
+ The ilw-header-megamenu should contain an unordered list. Each list item can contain one of three items:
16
+
17
+ - a simple link or button (`<a>` or `<button>`)
18
+ - an <ilw-header-megamenu-section> that contains a span and at least one unordered list of links. The span should contain `slot="label"`.
19
+
20
+
21
+ Within each `ilw-header-megamenu-section` you can choose:
22
+ - a basic unordered list of less than 20 links and no nesting. Each list item will be divided into groups of 5 or less. Adding more than 20 items will result in missing links. To make a solo-list use `class="solo-list"` otherwise you will get a list that only fills the first column.
23
+ OR
24
+ - four seperated lists of links with nesting. Each new list will become it's own column. You can have as many list items within a list as you need using this method. Note that this has been specifically designed for a maximum of four columns, using more than four lists is *not advised* and will result in wrapped columns.
25
+
26
+ Optional action-left and action-right slots can contain:
27
+ - a decorative image
28
+ - a `<span>` containing a paragraph element and a `<button>`. The span should contain `slot="action-left"` or `slot="action-right"` depending on where you'd like it to be placed. Only a single left or right slots can be used, if two are entered only left will appear. Note that any combination of items spanning more than four columns can result in wrapped columns and is an unintended use.
29
+
30
+
31
+ ## Attributes
32
+
33
+ `width`: the numeric pixel width where it will change to the hamburger menu. This is defaulted to 990, but may be changed if you have a ridiculous menu.
34
+ `compact`: a boolean value that will force the menu to be a hamburger menu. Before using this option, see Accessibility Notes and Use for more information.
35
+
36
+ ## Classes
37
+ `solo-list`: allows you to have a single list with a fixed background height and fills up the 4 columns, maxing out at 20 items with no nesting
38
+ `span-2`: allows your secondary item to span 2 columns
39
+ `span-3`: allows your secondary item to span 3 columns
40
+
41
+ ## Code Examples
42
+
43
+ ```html
44
+ <ilw-header-megamenu slot="navigation">
45
+ <ul>
46
+ <li>
47
+ <ilw-header-megamenu-section class="solo-list">
48
+ <span slot="label">Single Unordered List</span>
49
+ <ul>
50
+ <li><a href="/">Undergrad Admissions</a></li>
51
+ <li><a href="/">Graduate Admissions</a></li>
52
+ <li><a href="/">International Admissions</a></li>
53
+ <li><a href="/">Degrees</a></li>
54
+ <li><a href="/">Certificates</a></li>
55
+ <li><a href="/">Online Programs</a></li>
56
+ <li><a href="/">Research Focus Areas</a></li>
57
+ <li><a href="/">Find a mentor</a></li>
58
+ <li><a href="/">Degrees</a></li>
59
+ <li><a href="/">Certificates</a></li>
60
+ <li><a href="/">Online Programs</a></li>
61
+ <li><a href="/">Undergrad Admissions</a></li>
62
+ <li><a href="/">Graduate Admissions</a></li>
63
+ <li><a href="/">Online Programs</a></li>
64
+ <li><a href="/">Research Focus Areas</a></li>
65
+ <li><a href="/">Find a mentor</a></li>
66
+ <li><a href="/">Degrees</a></li>
67
+ <li><a href="/">Certificates</a></li>
68
+ <li><a href="/">Online Programs</a></li>
69
+ <li><a href="/">Undergrad Admissions</a></li>
70
+ <li><a href="/">Graduate Admissions</a></li>
71
+ </ul>
72
+ </ilw-header-megamenu-section>
73
+ </li>
74
+ <li>
75
+ <ilw-header-megamenu-section>
76
+ <span slot="label">Distinct Columns</span>
77
+ <ul>
78
+ <li><a href="/">Undergrad Admissions</a>
79
+ <ul>
80
+ <li><a href="/">Apply</a></li>
81
+ <li><a href="/">Majors</a></li>
82
+ <li><a href="/">Cost and Aid</a></li>
83
+ </ul>
84
+ </li>
85
+ <li><a href="/">Graduate Admissions</a>
86
+ <ul>
87
+ <li><a href="/">Apply</a></li>
88
+ <li><a href="/">Majors</a></li>
89
+ <li><a href="/">Cost and Aid</a></li>
90
+ </ul>
91
+ </li>
92
+ <li><a href="/">International Admissions</a></li>
93
+ </ul>
94
+ <ul>
95
+ <li><a href="/">Degrees</a></li>
96
+ <li><a href="/">Certificates</a></li>
97
+ <li><a href="/">Online Programs</a></li>
98
+ </ul>
99
+ <ul>
100
+ <li><a href="/">Undergrad Admissions</a></li>
101
+ <li><a href="/">Graduate Admissions</a></li>
102
+ <li><a href="/">International Admissions</a>
103
+ <ul>
104
+ <li><a href="/">Degrees</a></li>
105
+ <li><a href="/">Certificates</a></li>
106
+ <li><a href="/">Online Programs</a></li>
107
+ <li><a href="/">Research Focus Areas</a></li>
108
+ </ul>
109
+ </li>
110
+ <li><a href="/">Find a mentor</a></li>
111
+ <li><a href="/">Student Handbook</a></li>
112
+ </ul>
113
+ <ul>
114
+ <li><a href="/">Undergrad Admissions</a></li>
115
+ <li><a href="/">Graduate Admissions</a></li>
116
+ <li><a href="/">International Admissions</a>
117
+ <ul>
118
+ <li><a href="/">Degrees</a></li>
119
+ <li><a href="/">Certificates</a></li>
120
+ <li><a href="/">Online Programs</a></li>
121
+ <li><a href="/">Research Focus Areas</a></li>
122
+ </ul>
123
+ </li>
124
+ </ul>
125
+ </ilw-header-megamenu-section>
126
+ </li>
127
+ <li>
128
+ <ilw-header-megamenu-section>
129
+ <span slot="label">Decorative Image</span>
130
+ <ul>
131
+ <li><a href="/">Undergrad Admissions</a></li>
132
+ <li><a href="/">Graduate Admissions</a></li>
133
+ <li><a href="/">International Admissions</a></li>
134
+ <li><a href="/">Degrees</a></li>
135
+ <li><a href="/">Certificates</a></li>
136
+ </ul>
137
+ <span slot="action-left" >
138
+ <img src="https://fastly.picsum.photos/id/1025/500/400.jpg?hmac=MPFZjsU2UG1Mr3SjMkYP2F9jnhQWyatt6soxbOj0TN4" alt="">
139
+ </span>
140
+ </ilw-header-megamenu-section>
141
+ </li>
142
+ <li>
143
+ <ilw-header-megamenu-section>
144
+ <span slot="label">CTA with image</span>
145
+ <ul>
146
+ <li><a href="/">Undergrad Admissions</a></li>
147
+ <li><a href="/">Graduate Admissions</a></li>
148
+ <li><a href="/">International Admissions</a>
149
+ <ul>
150
+ <li><a href="/">Degrees</a></li>
151
+ <li><a href="/">Certificates</a></li>
152
+ <li><a href="/">Online Programs</a></li>
153
+ <li><a href="/">Research Focus Areas</a></li>
154
+ </ul>
155
+ </li>
156
+ <li><a href="/">Find a mentor</a></li>
157
+ <li><a href="/">Student Handbook</a></li>
158
+ </ul>
159
+ <span slot="action-left" class="span-3">
160
+ <p> Prospective students </p>
161
+ <button class="ilw-button ilw-theme-orange-1">Link 2</button>
162
+ <img src="https://picsum.photos/id/37/300/300" alt="">
163
+ </span>
164
+ </ilw-header-megamenu-section>
165
+ </li>
166
+ <li>
167
+ <ilw-header-megamenu-section>
168
+ <span slot="label">Plain CTA</span>
169
+ <ul>
170
+ <li><a href="/">Undergrad Admissions</a></li>
171
+ <li><a href="/">Graduate Admissions</a></li>
172
+ <li><a href="/">International Admissions</a></li>
173
+ <li><a href="/">Degrees</a></li>
174
+ <li><a href="/">Certificates</a></li>
175
+ <li><a href="/">Undergrad Admissions</a></li>
176
+ <li><a href="/">Graduate Admissions</a></li>
177
+ <li><a href="/">International Admissions</a></li>
178
+ <li><a href="/">Degrees</a></li>
179
+ <li><a href="/">Certificates</a></li>
180
+ </ul>
181
+ <ul>
182
+ <li><a href="/">Undergrad Admissions</a></li>
183
+ <li><a href="/">Graduate Admissions</a></li>
184
+ <li><a href="/">International Admissions</a>
185
+ <ul>
186
+ <li><a href="/">Degrees</a></li>
187
+ <li><a href="/">Certificates</a></li>
188
+ <li><a href="/">Online Programs</a></li>
189
+ <li><a href="/">Research Focus Areas</a>
190
+ </li>
191
+ </ul>
192
+ </li>
193
+ <li><a href="/">Find a mentor</a></li>
194
+ <li><a href="/">Student Handbook</a></li>
195
+ </ul>
196
+ <span slot="action-right" class="span-2">
197
+ <p> Prospective students </p>
198
+ <button class="ilw-button ilw-theme-orange-1">Link 2</button>
199
+ </span>
200
+ </ilw-header-megamenu-section>
201
+ </li>
202
+ </ul>
203
+ </ilw-header-megamenu>
204
+ ```
205
+
206
+ ## Usability
207
+ When creating menus, do not include all your links inside the menu. Just focus on the high-level links, and rely on breadcrumbs and side menus for internal links. Having a large menu system reduces usability.
208
+
209
+ While it is tempting to hide your menu with the hamburger menu option, only do this if you have no other option. Hamburger menus harm usability because it hides the top-level categories and reduces the ability for users to browse to find what they want, especially for new users.
210
+
211
+ ## Accessibility Notes and Use
212
+
213
+ Note from Keith:
214
+ - Navigation / Menus are unique in that most screen reader users will only expect linked items to exist inside of this element role. This means that any headings or static text should be avoided since they will likely be missed by this audience.
215
+
216
+ ### Keyboard navigation
217
+ - While all dropdowns are closed: Use `Tab/Shift + Tab` or `left/right arrow keys` move the user across the top level navigation bar.
218
+ - Open a dropdown: Focus on the toggle button and press `enter` or `space`.
219
+ - Navigate an open dropdown: `Tab/Shift + Tab` or `down/up arrow keys` will go down/up the list.
220
+ - Close an open dropdown: Click anywhere else on the screen, press `escape` to close and return focus to the corresponding toggle button or hitting the `Left/right arrow keys` will close the dropdown and go to the next item in the top level navigation bar.
221
+ - Focus stays on the same menu item when the browser changes sizes to switch between mega and hamburger menu
222
+
223
+ ### ARIA
224
+ - Each toggle button will get the attributes: `aria-haspopup="true"`, `aria-expanded="true"`, `aria-controls="parent-name-menu"` and `aria-label="parent-name submenu`. The SVG will get `aria-hidden="true"`
225
+ - For call to action items, the paragraph will get: `id="parent-name-action-text"` and the clickable element will receive `aria-describedby="parent-name-action-text"`.
226
+
227
+ ## External References
228
+
229
+ See [ilw-header-menu documentation](https://github.com/web-illinois/ilw-header-menu)
@@ -1,12 +1,12 @@
1
- {
2
- "title": "Header Mega Menu",
3
- "tag": "ilw-header-megamenu",
4
- "github": "https://github.com/web-illinois/ilw-header-megamenu/",
5
- "type": "web component",
6
- "element-name": "ilw-header-megamenu",
7
- "description": "Mega Menu for the top of the page.",
8
- "purpose": "Build a mega menu navigation",
9
- "toolkit-version": "",
10
- "production-version": "",
11
- "development-version": "latest"
12
- }
1
+ {
2
+ "title": "Header Mega Menu",
3
+ "tag": "ilw-header-megamenu",
4
+ "github": "https://github.com/web-illinois/ilw-header-megamenu/",
5
+ "type": "web component",
6
+ "element-name": "ilw-header-megamenu",
7
+ "description": "Mega Menu for the top of the page.",
8
+ "purpose": "Build a mega menu navigation",
9
+ "toolkit-version": "1.0.1",
10
+ "production-version": "1.0.1",
11
+ "development-version": "latest"
12
+ }