Skip to content

Commit e410132

Browse files
committed
fix build errors
1 parent 62f388d commit e410132

4 files changed

Lines changed: 99 additions & 20 deletions

File tree

packages/core/src/ReactNativeAmaView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { requireNativeView } from 'expo';
22
import * as React from 'react';
33
import { ReactNativeAmaViewProps } from './ReactNativeAma.types';
44

5-
const NativeView: React.ComponentType = requireNativeView('ReactNativeAma');
5+
const NativeView: React.ComponentType<ReactNativeAmaViewProps> = requireNativeView('ReactNativeAma');
66

77
export default function ReactNativeAmaView(props: ReactNativeAmaViewProps) {
88
return <NativeView {...props} />;

packages/core/src/internals/AMAError.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ const AMAOverlay = ({ issue, position, closeOverlay }: AMAOverlayProps) => {
259259
},
260260
]}
261261
>
262-
<GetRuleError issue={issue} />
262+
{GetRuleError && <GetRuleError issue={issue} />}
263263

264264
<Pressable onPress={openHelp} role="button">
265265
<Text style={styles!.link}>Learn more</Text>
@@ -272,7 +272,7 @@ const AMAOverlay = ({ issue, position, closeOverlay }: AMAOverlayProps) => {
272272
{
273273
left: x + width / 2 - POINTER_SIZE,
274274
top: y + height + SPACER,
275-
borderBottomColor: styles!.callout.borderColor,
275+
borderBottomColor: COLORS[severity],
276276
},
277277
]}
278278
/>

packages/core/src/internals/getRuleErrorInfo.tsx

Lines changed: 95 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

packages/core/src/internals/useAMADev.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const useAMADev = () => {
5454
startAMA();
5555

5656
ReactNativeAmaModule.addListener('onA11yIssues', (issues: A11yIssue[]) => {
57-
setIssues(issues.issues);
57+
setIssues(issues);
5858
});
5959
}, []);
6060

0 commit comments

Comments
 (0)