@a.nemreen/a11y 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +78 -0
- package/dist/index.cjs +1238 -0
- package/dist/index.d.cts +228 -0
- package/dist/index.d.ts +228 -0
- package/dist/index.js +1227 -0
- package/dist/styles.css +725 -0
- package/package.json +69 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ahmed Nemreen
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# @a.nemreen/a11y
|
|
2
|
+
|
|
3
|
+
Framework-agnostic **Accessibility Tools** widget — quick profiles, readable experience controls, visual filters, and a reading mask.
|
|
4
|
+
|
|
5
|
+
Works with **Angular**, **React**, **Vue**, and plain HTML. Zero framework peer dependencies.
|
|
6
|
+
|
|
7
|
+
- **Demo:** [https://nemreen.info/a11y](https://nemreen.info/a11y)
|
|
8
|
+
- **npm:** `@a.nemreen/a11y`
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @a.nemreen/a11y
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { Accessibility } from '@a.nemreen/a11y';
|
|
20
|
+
import '@a.nemreen/a11y/styles.css';
|
|
21
|
+
|
|
22
|
+
const a11y = Accessibility.mount({
|
|
23
|
+
position: 'end', // end | start | left | right
|
|
24
|
+
stack: 0,
|
|
25
|
+
locale: 'auto', // auto | ar | en
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
Accessibility.createSkipLink({ href: '#main' });
|
|
29
|
+
|
|
30
|
+
a11y.open();
|
|
31
|
+
a11y.toggleMode('reduce-motion');
|
|
32
|
+
a11y.setVisualFilter('deuteranopia');
|
|
33
|
+
a11y.reset();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Headless (controller only)
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
const a11y = Accessibility.mount({ headless: true });
|
|
40
|
+
a11y.setMode('high-contrast', true);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Frameworks
|
|
44
|
+
|
|
45
|
+
Mount once at the application root — same API everywhere:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
// Angular main.ts / React App / Vue main.js
|
|
49
|
+
Accessibility.mount();
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Features
|
|
53
|
+
|
|
54
|
+
- **Profiles:** epilepsy-safe, visually-impaired, cognitive-disability, motor-impaired, colorblind, dyslexia-friendly, adhd-friendly
|
|
55
|
+
- **Adjust:** font size, dyslexia font, highlight titles/links, reading mask, pause motion, text align, line/letter/word spacing
|
|
56
|
+
- **Filters:** boost contrast, monochrome, high contrast, high/low saturation, deuteranopia
|
|
57
|
+
- AR / EN UI, RTL-aware panel, `localStorage` persistence, live region announcements
|
|
58
|
+
|
|
59
|
+
## Local demo
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npm install
|
|
63
|
+
npm run demo
|
|
64
|
+
# open http://localhost:4173/demo/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Deploy demo (cPanel)
|
|
68
|
+
|
|
69
|
+
Same pattern as [loggo](https://nemreen.info/loggo) / [dga](https://nemreen.info/dga):
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm run build:site
|
|
73
|
+
# Upload deploy/ (or a11y-cpanel.zip) → public_html/a11y/
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT © [Ahmed Nemreen](https://nemreen.info)
|