File tree Expand file tree Collapse file tree 5 files changed +32
-28
lines changed
ReferenceDirectoryWithFilter Expand file tree Collapse file tree 5 files changed +32
-28
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const { link, title } = entry.data;
9
9
<a class =" banner-content" href ={ link } target =" _blank" >
10
10
<Content />
11
11
</a >
12
- <button id =" hideBanner" ><Icon kind =" close" ></button >
12
+ <button id =" hideBanner" aria-label = " Hide banner " ><Icon kind =" close" / ></button >
13
13
</div >
14
14
15
15
<script >
Original file line number Diff line number Diff line change @@ -22,14 +22,15 @@ export const JumpToLinks = ({
22
22
< button
23
23
class = { styles . toggle }
24
24
onClick = { handleToggle }
25
- aria-hidden = "true"
26
- tabIndex = { - 1 }
25
+ aria-expanded = { isOpen }
26
+ aria-label = { ` ${ heading } menu toggle` }
27
27
>
28
28
< span > { heading } </ span >
29
29
< div class = "pt-[6px]" >
30
30
< Icon kind = { isOpen ? "chevron-down" : "chevron-up" } />
31
31
</ div >
32
32
</ button >
33
+
33
34
{ isOpen && (
34
35
< ul >
35
36
{ links ?. map ( ( link ) => (
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ export const MainNavLinks = ({
45
45
< button
46
46
class = { styles . toggle }
47
47
onClick = { handleToggle }
48
- aria-hidden = "true"
49
- tabIndex = { - 1 }
48
+ aria-expanded = { isOpen }
49
+ aria-label = { mobileMenuLabel || "Toggle navigation menu" }
50
50
>
51
51
< div class = { styles . mobileMenuLabel } >
52
52
{ isOpen ? (
@@ -79,26 +79,24 @@ export const MainNavLinks = ({
79
79
</ li >
80
80
) ) }
81
81
</ ul >
82
- {
83
- < ul class = "flex flex-col gap-[15px]" >
84
- < li >
85
- < a className = { styles . buttonlink } href = "https://editor.p5js.org" >
86
- < div class = "mr-xxs" >
87
- < Icon kind = "code-brackets" />
88
- </ div >
89
- { editorButtonLabel }
90
- </ a >
91
- </ li >
92
- < li >
93
- < a className = { styles . buttonlink } href = "/donate/" >
94
- < div class = "mr-xxs" >
95
- < Icon kind = "heart" />
96
- </ div >
97
- { donateButtonLabel }
98
- </ a >
99
- </ li >
100
- </ ul >
101
- }
82
+ < ul class = "flex flex-col gap-[15px]" >
83
+ < li >
84
+ < a className = { styles . buttonlink } href = "https://editor.p5js.org" >
85
+ < div class = "mr-xxs" >
86
+ < Icon kind = "code-brackets" />
87
+ </ div >
88
+ { editorButtonLabel }
89
+ </ a >
90
+ </ li >
91
+ < li >
92
+ < a className = { styles . buttonlink } href = "/donate/" >
93
+ < div class = "mr-xxs" >
94
+ < Icon kind = "heart" />
95
+ </ div >
96
+ { donateButtonLabel }
97
+ </ a >
98
+ </ li >
99
+ </ ul >
102
100
</ div >
103
101
) ;
104
102
} ;
Original file line number Diff line number Diff line change @@ -221,9 +221,10 @@ export const ReferenceDirectoryWithFilter = ({
221
221
} }
222
222
/>
223
223
{ searchKeyword . length > 0 && (
224
- < button type = "reset" class = "" onClick = { clearInput } >
225
- < Icon kind = "close" className = "h-4 w-4" />
226
- </ button >
224
+ < button type = "reset" class = "" onClick = { clearInput } aria-label = "Clear search input" >
225
+ < Icon kind = "close" className = "h-4 w-4" />
226
+ </ button >
227
+
227
228
) }
228
229
</ div >
229
230
</ div >
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ const SearchResults = ({
77
77
value = { category }
78
78
className = "capitalize"
79
79
onClick = { ( ) => toggleFilter ( category ) }
80
+ aria-pressed = { currentFilter === category }
81
+ aria-label = { `Filter by ${ uiTranslations [ uiTranslationKey ( category ) ] } ` }
80
82
>
81
83
< div class = "flex flex-nowrap gap-xs" >
82
84
{ uiTranslations [ uiTranslationKey ( category ) ] }
@@ -131,6 +133,7 @@ const SearchResults = ({
131
133
type = "submit"
132
134
class = "absolute right-0 top-[2px] px-[22px] py-[13px]"
133
135
onClick = { submitInput }
136
+ aria-label = "Submit search"
134
137
>
135
138
< Icon kind = "arrow-lg" />
136
139
</ button >
@@ -139,6 +142,7 @@ const SearchResults = ({
139
142
type = "reset"
140
143
class = "absolute right-0 top-0 px-[22px] py-[13px]"
141
144
onClick = { clearInput }
145
+ aria-label = "Clear search input"
142
146
>
143
147
< Icon kind = "close-lg" />
144
148
</ button >
You can’t perform that action at this time.
0 commit comments