@@ -213,12 +213,13 @@ export function DisabledStory(): JSX.Element {
213213 < >
214214 < h1 > Disabled Items</ h1 >
215215 < ErsatzOverlay >
216- < ActionList selectionVariant = "single" showDividers role = "listbox " aria-label = "Select a project" >
216+ < ActionList selectionVariant = "single" showDividers role = "menu " aria-label = "Select a project" >
217217 { projects . map ( ( project , index ) => (
218218 < ActionList . Item
219219 key = { index }
220- role = "option "
220+ role = "menuitemradio "
221221 selected = { index === selectedIndex }
222+ aria-checked = { index === selectedIndex }
222223 onSelect = { ( ) => setSelectedIndex ( index ) }
223224 disabled = { index === 1 }
224225 >
@@ -236,61 +237,6 @@ export function DisabledStory(): JSX.Element {
236237}
237238DisabledStory . storyName = 'Disabled Items'
238239
239- export function GroupsStory ( ) : JSX . Element {
240- const [ assignees , setAssignees ] = React . useState ( users . slice ( 0 , 1 ) )
241-
242- const toggleAssignee = ( assignee : typeof users [ number ] ) => {
243- const assigneeIndex = assignees . findIndex ( a => a . login === assignee . login )
244-
245- if ( assigneeIndex === - 1 ) setAssignees ( [ ...assignees , assignee ] )
246- else setAssignees ( assignees . filter ( ( _ , index ) => index !== assigneeIndex ) )
247- }
248-
249- return (
250- < >
251- < h1 > Groups</ h1 >
252- < ErsatzOverlay >
253- < ActionList selectionVariant = "multiple" showDividers aria-label = "Select reviewers" >
254- < ActionList . Group title = "Suggestions" variant = "filled" role = "listbox" >
255- { users . slice ( 0 , 2 ) . map ( user => (
256- < ActionList . Item
257- key = { user . login }
258- role = "option"
259- selected = { Boolean ( assignees . find ( assignee => assignee . login === user . login ) ) }
260- onSelect = { ( ) => toggleAssignee ( user ) }
261- >
262- < ActionList . LeadingVisual >
263- < Avatar src = { `https://github.com/${ user . login } .png` } />
264- </ ActionList . LeadingVisual >
265- { user . login }
266- < ActionList . Description > { user . name } </ ActionList . Description >
267- < ActionList . Description variant = "block" > Recently edited these files</ ActionList . Description >
268- </ ActionList . Item >
269- ) ) }
270- </ ActionList . Group >
271- < ActionList . Group title = "Everyone" variant = "filled" role = "listbox" >
272- { users . slice ( 2 ) . map ( user => (
273- < ActionList . Item
274- role = "option"
275- key = { user . login }
276- selected = { Boolean ( assignees . find ( assignee => assignee . login === user . login ) ) }
277- onSelect = { ( ) => toggleAssignee ( user ) }
278- >
279- < ActionList . LeadingVisual >
280- < Avatar src = { `https://github.com/${ user . login } .png` } />
281- </ ActionList . LeadingVisual >
282- { user . login }
283- < ActionList . Description > { user . name } </ ActionList . Description >
284- </ ActionList . Item >
285- ) ) }
286- </ ActionList . Group >
287- </ ActionList >
288- </ ErsatzOverlay >
289- </ >
290- )
291- }
292- GroupsStory . storyName = 'Groups'
293-
294240export function ActionsStory ( ) : JSX . Element {
295241 return (
296242 < >
@@ -1007,20 +953,19 @@ export function MemexSortable(): JSX.Element {
1007953 < h1 > Memex Sortable List</ h1 >
1008954 < ErsatzOverlay >
1009955 < DndProvider backend = { HTML5Backend } >
1010- < ActionList selectionVariant = "multiple" >
1011- < ActionList . Group title = "Visible fields (can be reordered)" role = "listbox" >
956+ < ActionList selectionVariant = "multiple" role = "menu" >
957+ < ActionList . Group title = "Visible fields (can be reordered)" >
1012958 { visibleOptions . map ( option => (
1013959 < SortableItem
1014960 key = { option . text }
1015- role = "option "
961+ role = "menuitemcheckbox "
1016962 option = { option }
1017963 onSelect = { ( ) => toggle ( option . text ) }
1018964 reorder = { reorder }
1019965 />
1020966 ) ) }
1021967 </ ActionList . Group >
1022968 < ActionList . Group
1023- role = "listbox"
1024969 title = "Hidden fields"
1025970 selectionVariant = {
1026971 /** selectionVariant override on Group: disable selection if there are no options */
@@ -1030,7 +975,7 @@ export function MemexSortable(): JSX.Element {
1030975 { hiddenOptions . map ( ( option , index ) => (
1031976 < ActionList . Item
1032977 key = { index }
1033- role = "option "
978+ role = "menuitemcheckbox "
1034979 selected = { option . selected }
1035980 onSelect = { ( ) => toggle ( option . text ) }
1036981 >
0 commit comments