ieee-atiig-accessibility-menu 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 +124 -0
- package/dist/index.cjs +815 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +147 -0
- package/dist/index.d.ts +147 -0
- package/dist/index.js +801 -0
- package/dist/index.js.map +1 -0
- package/package.json +92 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ieee-atiig-accessibility-menu
|
|
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,124 @@
|
|
|
1
|
+
# ieee-atiig-accessibility-menu
|
|
2
|
+
|
|
3
|
+
A fully customizable React accessibility menu component. Provides font scaling, reading aids, color adjustments, and more to help make your web app more accessible.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Font size adjustment
|
|
8
|
+
- Line height adjustment
|
|
9
|
+
- Text alignment control
|
|
10
|
+
- Reading aid (focus line overlay)
|
|
11
|
+
- Grayscale/desaturate mode
|
|
12
|
+
- Dyslexia-friendly font toggle
|
|
13
|
+
- Big cursor toggle
|
|
14
|
+
- Stop animations toggle
|
|
15
|
+
- Persistent settings (localStorage)
|
|
16
|
+
- Fully configurable labels, colors, and positioning
|
|
17
|
+
- SSR / Next.js compatible
|
|
18
|
+
- No external CSS framework required — ships with bundled styles
|
|
19
|
+
- TypeScript type definitions included
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install ieee-atiig-accessibility-menu
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Basic Usage
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { AccessibilityMenu } from "ieee-atiig-accessibility-menu";
|
|
31
|
+
|
|
32
|
+
function App() {
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
{/* Your app content */}
|
|
36
|
+
<AccessibilityMenu />
|
|
37
|
+
</>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The component injects its own CSS at runtime — no additional imports needed.
|
|
43
|
+
|
|
44
|
+
### Manual CSS Import (optional)
|
|
45
|
+
|
|
46
|
+
If you prefer to load styles statically:
|
|
47
|
+
|
|
48
|
+
```tsx
|
|
49
|
+
import "ieee-atiig-accessibility-menu/styles.css";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Props
|
|
53
|
+
|
|
54
|
+
| Prop | Type | Default | Description |
|
|
55
|
+
|------|------|---------|-------------|
|
|
56
|
+
| `initialSettings` | `Partial<AccessibilitySettings>` | `{}` | Initial settings overrides |
|
|
57
|
+
| `storageKey` | `string` | `"ieee-atiig-accessibility-menu-settings"` | localStorage key for persistence |
|
|
58
|
+
| `position` | `"bottom-left" \| "bottom-right"` | `"bottom-left"` | Menu position |
|
|
59
|
+
| `positionOffset` | `number \| { x: number, y: number }` | `0` | Offset from edge in px |
|
|
60
|
+
| `labels` | `Partial<SectionLabels>` | `{}` | Custom text labels |
|
|
61
|
+
| `className` | `string` | `""` | Additional class for root wrapper |
|
|
62
|
+
| `buttonClassName` | `string` | `""` | Additional class for the FAB |
|
|
63
|
+
| `panelClassName` | `string` | `""` | Additional class for the panel |
|
|
64
|
+
| `zIndex` | `Partial<ZIndexConfig>` | `{}` | Z-index overrides for layers |
|
|
65
|
+
| `onSettingsChange` | `(settings) => void` | — | Called when any setting changes |
|
|
66
|
+
| `onReset` | `() => void` | — | Called when settings are reset |
|
|
67
|
+
| `showResetButton` | `boolean` | `true` | Show/hide the reset button |
|
|
68
|
+
| `showFontSize` | `boolean` | `true` | Show/hide font size control |
|
|
69
|
+
| `showLineHeight` | `boolean` | `true` | Show/hide line height control |
|
|
70
|
+
| `showAlignment` | `boolean` | `true` | Show/hide alignment control |
|
|
71
|
+
| `showReadingAid` | `boolean` | `true` | Show/hide reading aid control |
|
|
72
|
+
| `showDesaturate` | `boolean` | `true` | Show/hide desaturate toggle |
|
|
73
|
+
| `showDyslexicFont` | `boolean` | `true` | Show/hide dyslexic font toggle |
|
|
74
|
+
| `showBigCursor` | `boolean` | `true` | Show/hide big cursor toggle |
|
|
75
|
+
| `showStopAnimations` | `boolean` | `true` | Show/hide stop animations toggle |
|
|
76
|
+
| `theme` | `Partial<ThemeColors>` | `{}` | Color theme customization |
|
|
77
|
+
| `icons` | `IconsConfig` | — | Custom icon elements |
|
|
78
|
+
| `fontSizeSteps` | `FontSizeStep[]` | `[0, 10, 20, 30]` | Custom font size steps |
|
|
79
|
+
| `lineHeightSteps` | `LineHeightStep[]` | `[0, 15, 20, 25]` | Custom line height steps |
|
|
80
|
+
| `readingAidSizes` | `number[]` | `[0, 0.9, 1, 1.2]` | Custom reading aid sizes |
|
|
81
|
+
| `ssr` | `boolean` | `false` | Enable SSR-safe rendering |
|
|
82
|
+
|
|
83
|
+
## Theming
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
<AccessibilityMenu
|
|
87
|
+
theme={{
|
|
88
|
+
primary: "#1a365d",
|
|
89
|
+
accent: "#2b6cb0",
|
|
90
|
+
gradientFrom: "#1a365d",
|
|
91
|
+
gradientTo: "#2b6cb0",
|
|
92
|
+
}}
|
|
93
|
+
/>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Custom Labels (i18n)
|
|
97
|
+
|
|
98
|
+
```tsx
|
|
99
|
+
<AccessibilityMenu
|
|
100
|
+
labels={{
|
|
101
|
+
menuTitle: "Accessibilité",
|
|
102
|
+
fontSize: "Taille de police",
|
|
103
|
+
reset: "Réinitialiser",
|
|
104
|
+
off: "Désactivé",
|
|
105
|
+
}}
|
|
106
|
+
/>
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Accessibility
|
|
110
|
+
|
|
111
|
+
- All controls are keyboard accessible
|
|
112
|
+
- `aria-label` applied to the menu button
|
|
113
|
+
- `aria-pressed` on toggle buttons
|
|
114
|
+
- Backdrop overlay dismiss on click
|
|
115
|
+
- Focus remains within the panel when open
|
|
116
|
+
|
|
117
|
+
## Browser Support
|
|
118
|
+
|
|
119
|
+
- Chrome, Firefox, Safari, Edge (last 2 major versions)
|
|
120
|
+
- IE is not supported
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
MIT
|