Skip to content

Commit 3e5381e

Browse files
gazabmrchief
authored andcommitted
feat: Add ARIA roles and attributes (dowjones#233)
Fixes dowjones#235 Fixes dowjones#216
1 parent a4fb879 commit 3e5381e

16 files changed

+497
-103
lines changed

.codeclimate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ plugins:
3939
config:
4040
languages:
4141
javascript:
42-
mass_threshold : 50
42+
mass_threshold : 60
4343
exclude_patterns:
4444
- "docs/"
4545
- "snapshots/"

__snapshots__/src/index.test.js.md

+91-67
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ Generated by [AVA](https://ava.li).
1515
<div
1616
className="dropdown"
1717
>
18-
<a
19-
className="dropdown-trigger arrow top"
20-
onClick={Function {}}
18+
<Trigger
19+
onTrigger={Function {}}
20+
showDropdown={true}
2121
>
2222
<Input
2323
inputRef={Function inputRef {}}
@@ -28,7 +28,7 @@ Generated by [AVA](https://ava.li).
2828
onTagRemove={Function {}}
2929
tags={[]}
3030
/>
31-
</a>
31+
</Trigger>
3232
<div
3333
className="dropdown-content"
3434
>
@@ -166,8 +166,10 @@ Generated by [AVA](https://ava.li).
166166
<div
167167
className="dropdown"
168168
>
169-
<a
170-
className="dropdown-trigger arrow disabled bottom"
169+
<Trigger
170+
disabled={true}
171+
onTrigger={Function {}}
172+
showDropdown={false}
171173
>
172174
<Input
173175
disabled={true}
@@ -179,7 +181,7 @@ Generated by [AVA](https://ava.li).
179181
onTagRemove={Function {}}
180182
tags={[]}
181183
/>
182-
</a>
184+
</Trigger>
183185
</div>
184186
</div>
185187

@@ -263,39 +265,51 @@ Generated by [AVA](https://ava.li).
263265
<div
264266
className="dropdown radio-select"
265267
>
266-
<a
267-
className="dropdown-trigger arrow bottom"
268-
onClick={Function {}}
268+
<Trigger
269+
onTrigger={Function {}}
270+
radioSelect={true}
271+
showDropdown={false}
269272
>
270-
<Input
271-
inputRef={Function inputRef {}}
272-
onBlur={Function {}}
273-
onFocus={Function {}}
274-
onInputChange={Function {}}
273+
<a
274+
"aria-expanded"="false"
275+
"aria-haspopup"="tree"
276+
className="dropdown-trigger arrow bottom"
277+
onClick={Function {}}
275278
onKeyDown={Function {}}
276-
onTagRemove={Function {}}
277-
tags={[]}
279+
role="button"
280+
tabIndex={0}
278281
>
279-
<ul
280-
className="tag-list"
282+
<Input
283+
inputRef={Function inputRef {}}
284+
onBlur={Function {}}
285+
onFocus={Function {}}
286+
onInputChange={Function {}}
287+
onKeyDown={Function {}}
288+
onTagRemove={Function {}}
289+
radioSelect={true}
290+
tags={[]}
281291
>
282-
<li
283-
className="tag-item"
292+
<ul
293+
className="tag-list"
284294
>
285-
<input
286-
"aria-autocomplete"="list"
287-
className="search"
288-
onBlur={Function {}}
289-
onChange={Function {}}
290-
onFocus={Function {}}
291-
onKeyDown={Function {}}
292-
placeholder="Choose..."
293-
type="text"
294-
/>
295-
</li>
296-
</ul>
297-
</Input>
298-
</a>
295+
<li
296+
className="tag-item"
297+
>
298+
<input
299+
"aria-autocomplete"="list"
300+
className="search"
301+
onBlur={Function {}}
302+
onChange={Function {}}
303+
onFocus={Function {}}
304+
onKeyDown={Function {}}
305+
placeholder="Choose..."
306+
type="text"
307+
/>
308+
</li>
309+
</ul>
310+
</Input>
311+
</a>
312+
</Trigger>
299313
</div>
300314
</div>
301315
</DropdownTreeSelect>
@@ -379,39 +393,49 @@ Generated by [AVA](https://ava.li).
379393
<div
380394
className="dropdown"
381395
>
382-
<a
383-
className="dropdown-trigger arrow bottom"
384-
onClick={Function {}}
396+
<Trigger
397+
onTrigger={Function {}}
398+
showDropdown={false}
385399
>
386-
<Input
387-
inputRef={Function inputRef {}}
388-
onBlur={Function {}}
389-
onFocus={Function {}}
390-
onInputChange={Function {}}
400+
<a
401+
"aria-expanded"="false"
402+
"aria-haspopup"="tree"
403+
className="dropdown-trigger arrow bottom"
404+
onClick={Function {}}
391405
onKeyDown={Function {}}
392-
onTagRemove={Function {}}
393-
tags={[]}
406+
role="button"
407+
tabIndex={0}
394408
>
395-
<ul
396-
className="tag-list"
409+
<Input
410+
inputRef={Function inputRef {}}
411+
onBlur={Function {}}
412+
onFocus={Function {}}
413+
onInputChange={Function {}}
414+
onKeyDown={Function {}}
415+
onTagRemove={Function {}}
416+
tags={[]}
397417
>
398-
<li
399-
className="tag-item"
418+
<ul
419+
className="tag-list"
400420
>
401-
<input
402-
"aria-autocomplete"="list"
403-
className="search"
404-
onBlur={Function {}}
405-
onChange={Function {}}
406-
onFocus={Function {}}
407-
onKeyDown={Function {}}
408-
placeholder="Choose..."
409-
type="text"
410-
/>
411-
</li>
412-
</ul>
413-
</Input>
414-
</a>
421+
<li
422+
className="tag-item"
423+
>
424+
<input
425+
"aria-autocomplete"="list"
426+
className="search"
427+
onBlur={Function {}}
428+
onChange={Function {}}
429+
onFocus={Function {}}
430+
onKeyDown={Function {}}
431+
placeholder="Choose..."
432+
type="text"
433+
/>
434+
</li>
435+
</ul>
436+
</Input>
437+
</a>
438+
</Trigger>
415439
</div>
416440
</div>
417441
</DropdownTreeSelect>
@@ -427,9 +451,9 @@ Generated by [AVA](https://ava.li).
427451
<div
428452
className="dropdown"
429453
>
430-
<a
431-
className="dropdown-trigger arrow top"
432-
onClick={Function {}}
454+
<Trigger
455+
onTrigger={Function {}}
456+
showDropdown={true}
433457
>
434458
<Input
435459
inputRef={Function inputRef {}}
@@ -440,7 +464,7 @@ Generated by [AVA](https://ava.li).
440464
onTagRemove={Function {}}
441465
tags={[]}
442466
/>
443-
</a>
467+
</Trigger>
444468
<div
445469
className="dropdown-content"
446470
>

__snapshots__/src/index.test.js.snap

233 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)