-
Notifications
You must be signed in to change notification settings - Fork 0
/
aria_role.go
124 lines (113 loc) · 3.87 KB
/
aria_role.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package gomplements
import "maragu.dev/gomponents"
type ariaRole string
// Document structure ARIA roles
const (
AriaToolbar ariaRole = "toolbar"
AriaTooltip ariaRole = "tooltip"
AriaFeed ariaRole = "feed"
AriaMath ariaRole = "math"
AriaPresentation ariaRole = "presentation"
AriaNone ariaRole = "none"
AriaNote ariaRole = "note"
)
// Document structure ARIA roles to avoid
const (
AriaApplication ariaRole = "application"
AriaArticle ariaRole = "article"
AriaCell ariaRole = "cell"
AriaColumnHeader ariaRole = "columnheader"
AriaDefinition ariaRole = "definition"
AriaDocument ariaRole = "document"
AriaFigure ariaRole = "figure"
AriaGroup ariaRole = "group"
AriaHeading ariaRole = "heading"
AriaImg ariaRole = "img"
AriaList ariaRole = "list"
AriaListItem ariaRole = "listitem"
AriaMeter ariaRole = "meter"
AriaRow ariaRole = "row"
AriaRowGroup ariaRole = "rowgroup"
AriaRowHeader ariaRole = "rowheader"
AriaTable ariaRole = "table"
AriaTerm ariaRole = "term"
)
// Document structure ARIA roles rarely, if ever, useful
const (
AriaAssociationList ariaRole = "associationlist"
AriaAssociationListItemKey ariaRole = "associationlistitemkey"
AriaAssociationListItemValue ariaRole = "associationlistitemvalue"
AriaBlockquote ariaRole = "blockquote"
AriaCaption ariaRole = "caption"
AriaCode ariaRole = "code"
AriaDeletion ariaRole = "deletion"
AriaEmphasis ariaRole = "emphasis"
AriaInsertion ariaRole = "insertion"
AriaParagraph ariaRole = "paragraph"
AriaStrong ariaRole = "strong"
AriaSubscription ariaRole = "subscript"
AriaSuperscript ariaRole = "superscript"
AriaTime ariaRole = "time"
)
// Widget ARIA roles
const (
AriaScrollbar ariaRole = "scrollbar"
AriaSearchbox ariaRole = "searchbox"
AriaSeparator ariaRole = "separator"
AriaSlider ariaRole = "slider"
AriaSpinButton ariaRole = "spinbutton"
AriaSwitch ariaRole = "switch"
AriaTab ariaRole = "tab"
AriaTabPanel ariaRole = "tabpanel"
AriaTreeItem ariaRole = "treeitem"
AriaComboBox ariaRole = "combobox"
AriaMenu ariaRole = "menu"
AriaMenuBar ariaRole = "menubar"
AriaTabList ariaRole = "tablist"
AriaTree ariaRole = "tree"
AriaTreeGrid ariaRole = "treegrid"
)
// Widget ARIA roles to avoid
const (
AriaButton ariaRole = "button"
AriaCheckbox ariaRole = "checkbox"
AriaGridCell ariaRole = "gridcell"
AriaLink ariaRole = "link"
AriaMenuItem ariaRole = "menuitem"
AriaMenuItemCheckbox ariaRole = "menuitemcheckbox"
AriaMenuItemRadio ariaRole = "menuitemradio"
AriaOption ariaRole = "option"
AriaProgressbar ariaRole = "progressbar"
AriaRadio ariaRole = "radio"
AriaTextbox ariaRole = "textbox"
AriaGrid ariaRole = "grid"
AriaListbox ariaRole = "listbox"
AriaRadioGroup ariaRole = "radiogroup"
)
// Landmark ARIA roles
const (
AriaBanner ariaRole = "banner"
AriaComplementary ariaRole = "complementary"
AriaContentInfo ariaRole = "contentinfo"
AriaForm ariaRole = "form"
AriaMain ariaRole = "main"
AriaNavigation ariaRole = "navigation"
AriaRegion ariaRole = "region"
AriaSearch ariaRole = "search"
)
// Live region ARIA roles
const (
AriaAlert ariaRole = "alert"
AriaLog ariaRole = "log"
AriaMarquee ariaRole = "marquee"
AriaStatus ariaRole = "status"
AriaTimer ariaRole = "timer"
)
// Window ARIA roles
const (
AriaAlertDialog ariaRole = "alertdialog"
AriaDialog ariaRole = "dialog"
)
func (a ariaRole) ModifyParent(p Element) {
p.With(gomponents.Attr("role", string(a)))
}