@@ -25,12 +25,39 @@ const RULES_HELP: RuleHelp | null = __DEV__
2525 ? {
2626 CONTRAST_FAILED : {
2727 url : '/guidelines/contrast' ,
28- message : '' ,
28+ issue : 'Contrast ratio failed' ,
29+ severity : 'Serious' ,
30+ message : 'Text contrast ratio does not meet accessibility standards.' ,
31+ expectation : 'Ensure text has sufficient contrast against its background.' ,
32+ } ,
33+ CONTRAST_FAILED_AAA : {
34+ url : '/guidelines/contrast' ,
35+ issue : 'Contrast ratio failed AAA' ,
36+ severity : 'Serious' ,
37+ message : 'Text contrast ratio does not meet AAA accessibility standards.' ,
38+ expectation : 'Ensure text has sufficient contrast for AAA compliance.' ,
39+ } ,
40+ MINIMUM_SIZE : {
41+ url : '/guidelines/minimum-size' ,
42+ issue : 'Element too small' ,
43+ severity : 'Serious' ,
44+ message : 'Interactive elements should meet minimum size requirements for accessibility.' ,
45+ expectation : 'Ensure interactive elements are at least 44x44 points.' ,
46+ } ,
47+ UPPERCASE_TEXT_NO_ACCESSIBILITY_LABEL : {
48+ url : '/guidelines/text' ,
49+ issue : 'Uppercase text without accessibility label' ,
50+ severity : 'Serious' ,
51+ message : 'Uppercase text can be difficult for screen readers to pronounce correctly.' ,
52+ expectation : 'Provide an accessibility label with proper capitalization.' ,
53+ } ,
54+ NO_UPPERCASE_TEXT : {
55+ url : '/guidelines/text' ,
56+ issue : 'Avoid uppercase text' ,
57+ severity : 'Serious' ,
58+ message : 'Uppercase text can be difficult to read and understand.' ,
59+ expectation : 'Use normal capitalization instead of all uppercase text.' ,
2960 } ,
30- CONTRAST_FAILED_AAA : '/guidelines/contrast' ,
31- MINIMUM_SIZE : '/guidelines/minimum-size' ,
32- UPPERCASE_TEXT_NO_ACCESSIBILITY_LABEL : '/guidelines/text' ,
33- NO_UPPERCASE_TEXT : '/guidelines/text' ,
3461 NO_ACCESSIBILITY_LABEL : {
3562 url : '/guidelines/accessibility-label' ,
3663 issue : 'Missing accessibility label' ,
@@ -49,17 +76,69 @@ const RULES_HELP: RuleHelp | null = __DEV__
4976 expectation :
5077 'Specify an appropriate aria-role prop (e.g., "button", "link") for the component.' ,
5178 } ,
52- NO_KEYBOARD_TRAP : '/guidelines/forms' ,
53- NO_FORM_LABEL : '/guidelines/forms' ,
54- NO_FORM_ERROR : '/guidelines/forms' ,
55- FLATLIST_NO_COUNT_IN_SINGULAR_MESSAGE :
56- '/guidelines/lists-grids#number-of-results' ,
57- FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE :
58- '/guidelines/lists-grids#number-of-results' ,
59- BOTTOM_SHEET_CLOSE_ACTION : '/guidelines/bottomsheet' ,
60- INCOMPATIBLE_ACCESSIBILITY_STATE : '/guidelines/accessibility-role' ,
61- INCOMPATIBLE_ACCESSIBILITY_ROLE : '/guidelines/accessibility-role' ,
62- NO_FORM_LABEL_ENDING_WITH_ASTERISK : '/guidelines/forms#labels' ,
79+ NO_KEYBOARD_TRAP : {
80+ url : '/guidelines/forms' ,
81+ issue : 'Keyboard trap detected' ,
82+ severity : 'Critical' ,
83+ message : 'Users should be able to navigate away from form elements using the keyboard.' ,
84+ expectation : 'Ensure keyboard navigation allows users to exit form fields.' ,
85+ } ,
86+ NO_FORM_LABEL : {
87+ url : '/guidelines/forms' ,
88+ issue : 'Missing form label' ,
89+ severity : 'Critical' ,
90+ message : 'Form inputs must have associated labels for accessibility.' ,
91+ expectation : 'Add a label element or aria-label to form inputs.' ,
92+ } ,
93+ NO_FORM_ERROR : {
94+ url : '/guidelines/forms' ,
95+ issue : 'Missing form error handling' ,
96+ severity : 'Serious' ,
97+ message : 'Form validation errors must be communicated to users.' ,
98+ expectation : 'Provide clear error messages for form validation failures.' ,
99+ } ,
100+ FLATLIST_NO_COUNT_IN_SINGULAR_MESSAGE : {
101+ url : '/guidelines/lists-grids#number-of-results' ,
102+ issue : 'Missing count in singular message' ,
103+ severity : 'Serious' ,
104+ message : 'List announcements should include item counts for better context.' ,
105+ expectation : 'Include the number of items in singular list announcements.' ,
106+ } ,
107+ FLATLIST_NO_COUNT_IN_PLURAL_MESSAGE : {
108+ url : '/guidelines/lists-grids#number-of-results' ,
109+ issue : 'Missing count in plural message' ,
110+ severity : 'Serious' ,
111+ message : 'List announcements should include item counts for better context.' ,
112+ expectation : 'Include the number of items in plural list announcements.' ,
113+ } ,
114+ BOTTOM_SHEET_CLOSE_ACTION : {
115+ url : '/guidelines/bottomsheet' ,
116+ issue : 'Missing bottom sheet close action' ,
117+ severity : 'Critical' ,
118+ message : 'Bottom sheets must provide an accessible way to close them.' ,
119+ expectation : 'Add a close button or gesture that is accessible to screen readers.' ,
120+ } ,
121+ INCOMPATIBLE_ACCESSIBILITY_STATE : {
122+ url : '/guidelines/accessibility-role' ,
123+ issue : 'Incompatible accessibility state' ,
124+ severity : 'Serious' ,
125+ message : 'The accessibility state is not compatible with the element type.' ,
126+ expectation : 'Use accessibility states that are appropriate for the element type.' ,
127+ } ,
128+ INCOMPATIBLE_ACCESSIBILITY_ROLE : {
129+ url : '/guidelines/accessibility-role' ,
130+ issue : 'Incompatible accessibility role' ,
131+ severity : 'Serious' ,
132+ message : 'The accessibility role is not compatible with the element type.' ,
133+ expectation : 'Use accessibility roles that are appropriate for the element type.' ,
134+ } ,
135+ NO_FORM_LABEL_ENDING_WITH_ASTERISK : {
136+ url : '/guidelines/forms#labels' ,
137+ issue : 'Form label ends with asterisk' ,
138+ severity : 'Serious' ,
139+ message : 'Form labels should not end with asterisks as they can confuse screen readers.' ,
140+ expectation : 'Use proper required field indicators instead of asterisks in labels.' ,
141+ } ,
63142 }
64143 : null ;
65144
0 commit comments