Skip to content

[WIP] Native checks #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
root: true,
extends: ['@react-native'],
extends: ['@react-native', 'plugin:jest/recommended'],
plugins: ['jest', 'import'],
env: {
browser: true,
Expand All @@ -9,6 +9,7 @@ module.exports = {
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'react-hooks/rules-of-hooks': 'off',
'@typescript-eslint/func-call-spacing': 'off',
},
parserOptions: {
project: ['./tsconfig.json'],
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ coverage
!.yarn/releases
!.yarn/sdks
!.yarn/versions
example/.yarn
playground/.yarn/cache/
playground/android
playground/ios

.java-version
15 changes: 7 additions & 8 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
importOrder: ['<THIRD_PARTY_MODULES>', '^~(.*)/(.*)$', '^[./]'],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
plugins: [require('@ianvs/prettier-plugin-sort-imports')],
bracketSpacing: true,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
importOrder: ['<THIRD_PARTY_MODULES>', '^~(.*)/(.*)$', '^[./]'],
parser: 'typescript',
};
46 changes: 35 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,39 @@

[![github][github-image]][github-url] [![npm][npm-image]][npm-url] [![docs][docs-image]][docs-url] [![Maintenance Status][maintenance-image]](#maintenance-status)

A.M.A. stands for **A**ccessible **M**obile **A**pp and is react native library that aim offers the best accessibility tooling experience and guides to guide you through accessibility best practices while you code your app.
That's why we created A.M.A., a set of components and hooks designed to enforce minimum accessibility requirements.
This is combined with extensive [guidelines](https://commerce.nearform.com/open-source/react-native-ama/guidelines/) to help you understand how accessibility should work when manually testing your app. Finally we have provided a [checklist](https://commerce.nearform.com/open-source/react-native-ama/checklist/) which condenses these guidelines, explaining their intended functionality against specific features or components.
**A.M.A.** stands for **A**ccessible **M**obile **A**pp and is a React Native library that offers the best accessibility tooling experience as well as expert guides to support you with accessibility best practices while developing your app.

While in development AMA also provides run time accessibility checks against components
The library consists of

#### Example of AMA checks performed in development:
1. Runtime checks that help you catch common accessibility issues during development.
2. A set of popular components that are designed with accessibility in mind.
2. Extensive [guidelines](https://commerce.nearform.com/open-source/react-native-ama/guidelines/) to help you understand how accessibility should work when manually testing your app.
3. A [checklist](https://commerce.nearform.com/open-source/react-native-ama/checklist/) which condenses these guidelines, explaining their intended functionality against specific features or components.

<img alt="Example of runtime failure detected by AMA" src="https://github.com/FormidableLabs/react-native-ama/blob/main/website/docs/ama/ama-demo.png?raw=true" height=700 />
**AMA** consists of a family of packages under the npm `@react-native-ama` namespace.
These packages are designed to work independently, allowing you to pick and choose the ones that suit your needs.
This modular approach enables developers to create a tailored experience for their applications without the overhead of unnecessary dependencies.

> [!NOTE]
> This is an example of a runtime failure detected by AMA with additional information and links to guidelines provided in the console.
## Runtime Dev Tooling (Accessibility Checks)

**Example of additional console info**:
<img alt="Example of console warning by AMA" src="https://github.com/FormidableLabs/react-native-ama/blob/main/website/docs/ama-console-error.png?raw=true" width=550 />
Adopting an "accessibility-first" approach is the best way to ensure that digital experiences are inclusive for everyone. By prioritizing accessibility in the early stages of code development, you avoid having to later apply retroactive fixes which can be very time-consuming, expensive and difficult.

### How it works

When you wrap your application with the AMAProvider from the [@react-native-ama/core](/core/) package, AMA begins scanning your UI for accessibility (a11y) issues as the app is running.

If any issues are found at the end of a scan, AMA will:

- Highlight the offending component directly on the screen.
- Print a detailed report of the issue to the console.
- Display a summary of the total number of errors and warnings detected.

You can use the built-in developer UI to get more information about the issues affecting each component.
As you modify your code to fix them, AMA reacts to the changes and removes the issues from the report in real-time.

| Real Time scanning | AMA in-app info |
|---------|-------------|
| ![AMA flags multiple accessibility issues in real time, including missing roles and contrast failures, and visually marks each element with severity indicators to guide developers toward immediate fixes.](/img/ama-checks.png) | ![AMA’s real-time accessibility checker detecting a missing role on a pressable element, with detailed guidance, severity level, and direct links to related guidelines.](/img/ama-issue.png) |

## Getting started

Expand Down Expand Up @@ -49,7 +67,7 @@ yarn add @react-native-ama/core
npm install @react-native-ama/core
```

**2. Wrap App in `<AMAProvider>`**
**2. Wrap the App in `<AMAProvider>`**

```jsx {2-4,6,8-9}
import { AMAProvider } from '@react-native-ama/core';
Expand All @@ -63,6 +81,12 @@ export const App = () => {
};
```

### Playground

You can use the playground app within this repository to see how AMA checks work in practice.
The playground can also be used to learn how to fix accessibility issues in your app.


## 📃 [Documentation](https://commerce.nearform.com/open-source/react-native-ama)

The documentation contains everything you need to know about `@react-native-ama/...`. It contains several sections in order of importance when you first get started:
Expand Down
8 changes: 0 additions & 8 deletions examples/README.md

This file was deleted.

2 changes: 0 additions & 2 deletions examples/bare/.bundle/config

This file was deleted.

4 changes: 0 additions & 4 deletions examples/bare/.eslintrc.js

This file was deleted.

75 changes: 0 additions & 75 deletions examples/bare/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions examples/bare/.prettierrc.js

This file was deleted.

1 change: 0 additions & 1 deletion examples/bare/.watchmanconfig

This file was deleted.

13 changes: 0 additions & 13 deletions examples/bare/CHANGELOG.md

This file was deleted.

9 changes: 0 additions & 9 deletions examples/bare/Gemfile

This file was deleted.

100 changes: 0 additions & 100 deletions examples/bare/Gemfile.lock

This file was deleted.

35 changes: 0 additions & 35 deletions examples/bare/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions examples/bare/__tests__/App.test.tsx

This file was deleted.

Loading