@niclasbork/a11ycore 1.1.7
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 +78 -0
- package/dist/a11y-core.cjs.js +626 -0
- package/dist/a11y-core.es.js +24891 -0
- package/dist/a11y-core.iife.js +626 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# A11YCore
|
|
2
|
+
|
|
3
|
+
A powerful, embeddable accessibility widget built with React, TypeScript, and Tailwind CSS.
|
|
4
|
+
Instantly add features like text scaling, high contrast and night-shift modes, dyslexia-friendly fonts, screen reader support, link highlighting, and reduce motion to any website - with a single line of code.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
|
|
8
|
+
### Script Tag
|
|
9
|
+
|
|
10
|
+
```html
|
|
11
|
+
<script
|
|
12
|
+
src="https://a11ycore-engine.vercel.app/loader.js"
|
|
13
|
+
data-key="YOUR-LICENSE"
|
|
14
|
+
data-primary-color="#2563eb"
|
|
15
|
+
data-position="bottom-right"
|
|
16
|
+
data-hotkey="Alt+A"
|
|
17
|
+
data-locale="de"
|
|
18
|
+
defer
|
|
19
|
+
></script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Locale behavior:
|
|
23
|
+
- If `data-locale` is set, the widget uses that locale and ignores document language changes.
|
|
24
|
+
- If `data-locale` is omitted, the widget follows the website language (`<html lang>`) and updates automatically on language switches.
|
|
25
|
+
|
|
26
|
+
### NPM
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install @niclasbork/a11ycore
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { loadA11Y } from '@niclasbork/a11ycore'
|
|
34
|
+
|
|
35
|
+
loadA11Y({
|
|
36
|
+
apiBaseUrl: 'https://a11ycore-engine.vercel.app',
|
|
37
|
+
licenseKey: 'YOUR-LICENSE',
|
|
38
|
+
position: 'bottom-right',
|
|
39
|
+
primaryColor: '#2563eb',
|
|
40
|
+
hotkey: 'Alt+A',
|
|
41
|
+
locale: 'de',
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Default options:
|
|
46
|
+
- `apiBaseUrl`: `https://a11ycore-engine.vercel.app`
|
|
47
|
+
- `position`: `bottom-right`
|
|
48
|
+
- `primaryColor`: `#2563eb`
|
|
49
|
+
- `locale`: follows `<html lang>` when omitted
|
|
50
|
+
|
|
51
|
+
## API Options
|
|
52
|
+
|
|
53
|
+
| Option | Type | Default | Description |
|
|
54
|
+
| -------------- | ---------------------------------------------------- | --------------------------------- | ---------------------------------------------------------- |
|
|
55
|
+
| `selector` | `string` | `'body'` | DOM selector where the widget container mounts. |
|
|
56
|
+
| `position` | `'bottom-right' \| 'bottom-left' \| 'bottom-center'` | `'bottom-right'` | Placement of the floating action button. |
|
|
57
|
+
| `primaryColor` | `string` | `'#2563eb'` | Background color for button and accents. |
|
|
58
|
+
| `licenseKey` | `string` | `YOUR-LICENSE` | Validates the install with the engine. |
|
|
59
|
+
| `apiBaseUrl` | `string` | `'https://a11ycore-engine.vercel.app'` | Base URL for API and core asset requests (no /loader.js). |
|
|
60
|
+
| `hotkey` | `string` | `undefined` | Keyboard shortcut to toggle the panel (e.g. `Alt+A`). |
|
|
61
|
+
| `locale` | `string` | `undefined` | Fixed locale; omit to follow `<html lang>`. |
|
|
62
|
+
|
|
63
|
+
## Engine URLs
|
|
64
|
+
|
|
65
|
+
- Loader: `https://a11ycore-engine.vercel.app/loader.js`
|
|
66
|
+
- Core: `https://a11ycore-engine.vercel.app/core/core.v<version>.js`
|
|
67
|
+
- Token API: `https://a11ycore-engine.vercel.app/api/token`
|
|
68
|
+
|
|
69
|
+
## CSP Requirements
|
|
70
|
+
|
|
71
|
+
Make sure your host site allows:
|
|
72
|
+
|
|
73
|
+
- `script-src https://a11ycore-engine.vercel.app`
|
|
74
|
+
- `connect-src https://a11ycore-engine.vercel.app`
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
MIT
|