ape-accessibility 0.2.2 → 0.2.5
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/README.md +91 -43
- package/dist/index.cjs +13 -16177
- package/dist/index.global.js +13 -16172
- package/dist/index.js +13 -16160
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -1,43 +1,51 @@
|
|
|
1
1
|
# ape-accessibility
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Plug-and-play accessibility widget for any web application. Works with React, Next.js, Vue, Nuxt, Angular, vanilla JS — zero configuration required.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The widget renders inside a **Shadow DOM**, so its styles are fully isolated and will never interfere with your application's CSS.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
10
|
npm install ape-accessibility
|
|
11
|
+
# or
|
|
12
|
+
pnpm add ape-accessibility
|
|
13
|
+
# or
|
|
14
|
+
yarn add ape-accessibility
|
|
9
15
|
```
|
|
10
16
|
|
|
11
|
-
##
|
|
17
|
+
## Usage
|
|
12
18
|
|
|
13
|
-
### Auto-mount (
|
|
19
|
+
### Auto-mount (zero config)
|
|
14
20
|
|
|
15
21
|
```js
|
|
16
22
|
import 'ape-accessibility'
|
|
17
|
-
//
|
|
23
|
+
// Widget appears automatically in the bottom-left corner
|
|
18
24
|
```
|
|
19
25
|
|
|
20
|
-
|
|
26
|
+
That's it. No CSS imports, no providers, no wrappers.
|
|
27
|
+
|
|
28
|
+
### With configuration
|
|
21
29
|
|
|
22
30
|
```js
|
|
23
31
|
import { init, destroy } from 'ape-accessibility'
|
|
24
32
|
|
|
25
33
|
const widget = init({
|
|
26
|
-
position: 'bottom-right',
|
|
34
|
+
position: 'bottom-right', // 'bottom-left' | 'bottom-right'
|
|
27
35
|
zIndex: 9999,
|
|
28
36
|
})
|
|
29
37
|
|
|
30
|
-
//
|
|
38
|
+
// Remove the widget
|
|
31
39
|
widget.destroy()
|
|
32
40
|
```
|
|
33
41
|
|
|
34
|
-
### Script tag (
|
|
42
|
+
### Script tag (no bundler)
|
|
35
43
|
|
|
36
44
|
```html
|
|
37
45
|
<script src="https://unpkg.com/ape-accessibility/dist/index.global.js"></script>
|
|
38
46
|
```
|
|
39
47
|
|
|
40
|
-
|
|
48
|
+
The widget auto-mounts when the script loads. For manual control:
|
|
41
49
|
|
|
42
50
|
```html
|
|
43
51
|
<script>
|
|
@@ -47,36 +55,76 @@ El widget se auto-monta al cargar el script. Para control manual:
|
|
|
47
55
|
|
|
48
56
|
## API
|
|
49
57
|
|
|
50
|
-
|
|
|
51
|
-
|
|
52
|
-
| `init(config?)`
|
|
53
|
-
| `destroy()`
|
|
54
|
-
| `getSettings()`
|
|
55
|
-
| `resetAllSettings()` |
|
|
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
|
-
|
|
58
|
+
| Function | Description |
|
|
59
|
+
| -------------------- | ------------------------------------------ |
|
|
60
|
+
| `init(config?)` | Mounts the widget. Returns `{ destroy() }` |
|
|
61
|
+
| `destroy()` | Removes the widget from the DOM |
|
|
62
|
+
| `getSettings()` | Returns the current accessibility settings |
|
|
63
|
+
| `resetAllSettings()` | Resets all settings to their defaults |
|
|
64
|
+
|
|
65
|
+
### Config options
|
|
66
|
+
|
|
67
|
+
| Option | Type | Default |
|
|
68
|
+
| ------------- | ------------------------------------- | --------------- |
|
|
69
|
+
| `position` | `'bottom-left'` \| `'bottom-right'` | `'bottom-left'` |
|
|
70
|
+
| `zIndex` | `number` | `9999` |
|
|
71
|
+
| `containerId` | `string` | `'ape-accessibility-root'` |
|
|
72
|
+
|
|
73
|
+
## Features
|
|
74
|
+
|
|
75
|
+
| Feature | Description |
|
|
76
|
+
| -------------------- | -------------------------------------------------------- |
|
|
77
|
+
| Font size | Increase/decrease (90%–120%) |
|
|
78
|
+
| High contrast | High contrast mode for improved readability |
|
|
79
|
+
| Saturation | High, low, or monochrome modes |
|
|
80
|
+
| Dyslexia font | Switches to OpenDyslexic font |
|
|
81
|
+
| Letter spacing | Adjust letter spacing for better readability |
|
|
82
|
+
| Line height | Adjust line height / leading |
|
|
83
|
+
| Highlight headings | Visually highlights all headings on the page |
|
|
84
|
+
| Highlight links | Visually highlights all links on the page |
|
|
85
|
+
| Bold text | Applies bold weight to all body text |
|
|
86
|
+
| Pause animations | Stops all CSS animations and transitions |
|
|
87
|
+
| Large cursor | Increases cursor size for easier tracking |
|
|
88
|
+
| Reading guide | Horizontal line that follows the cursor |
|
|
89
|
+
| Read aloud | Text-to-speech using the Web Speech API |
|
|
90
|
+
| Page structure | Navigate the page by heading hierarchy |
|
|
91
|
+
| Hide images | Hides images, videos, and SVGs |
|
|
92
|
+
| Text alignment | Force left, center, or right alignment |
|
|
93
|
+
| Accessibility profiles | Presets for visual, cognitive, motor, and senior needs |
|
|
94
|
+
|
|
95
|
+
## How it works
|
|
96
|
+
|
|
97
|
+
- **Widget UI** (panel, buttons, animations) renders inside a [Shadow DOM](https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_shadow_DOM), completely isolated from the host page. Your styles won't break, and the widget's styles won't leak.
|
|
98
|
+
- **Accessibility tools** (high contrast, dyslexia font, large cursor, etc.) are injected into the host document intentionally, since they need to affect the entire page.
|
|
99
|
+
- **React is bundled internally** — no peer dependencies, no version conflicts with your app.
|
|
100
|
+
|
|
101
|
+
## Framework compatibility
|
|
102
|
+
|
|
103
|
+
| Framework | Status |
|
|
104
|
+
| ---------- | ------ |
|
|
105
|
+
| React | Works |
|
|
106
|
+
| Next.js | Works |
|
|
107
|
+
| Vue | pending |
|
|
108
|
+
| Nuxt | pending |
|
|
109
|
+
| Angular | pending |
|
|
110
|
+
| Vanilla JS | Works |
|
|
111
|
+
| Any other | pending |
|
|
112
|
+
|
|
113
|
+
## Bundle size
|
|
114
|
+
|
|
115
|
+
~265 KB minified (~75 KB gzipped). Includes React internally — no external dependencies required.
|
|
116
|
+
|
|
117
|
+
## Development
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
git clone https://github.com/APE-SENA-2025/ape-accessibility.git
|
|
121
|
+
cd ape-accessibility
|
|
122
|
+
pnpm install
|
|
123
|
+
pnpm dev
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Opens a dev server at `http://localhost:3333` with hot reload.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
All rights reserved.
|