@lessonkit/accessibility 1.3.1 → 1.5.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/README.md +23 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
# @lessonkit/accessibility
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@lessonkit/accessibility)
|
|
4
|
-
[](https://lessonkit.readthedocs.io/en/latest/reference/accessibility.html)
|
|
5
4
|
[](https://github.com/eddiethedean/lessonkit/blob/main/LICENSE)
|
|
6
5
|
|
|
7
6
|
Focus management, reduced-motion helpers, and screen-reader utilities for LessonKit apps.
|
|
8
7
|
|
|
8
|
+
## When to install
|
|
9
|
+
|
|
10
|
+
- Custom interactive UI outside `@lessonkit/react` blocks
|
|
11
|
+
- Modal dialogs, custom carousels, or roving-tabindex toolbars in your course shell
|
|
12
|
+
|
|
13
|
+
`@lessonkit/react` uses this package internally (for example `Quiz` labels and compound keyboard nav).
|
|
14
|
+
|
|
9
15
|
## Install
|
|
10
16
|
|
|
11
17
|
```bash
|
|
12
18
|
npm install @lessonkit/accessibility
|
|
13
19
|
```
|
|
14
20
|
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import {
|
|
25
|
+
trapFocus,
|
|
26
|
+
focusFirst,
|
|
27
|
+
prefersReducedMotion,
|
|
28
|
+
shouldAnimate,
|
|
29
|
+
createRovingTabIndex,
|
|
30
|
+
} from "@lessonkit/accessibility";
|
|
31
|
+
|
|
32
|
+
const release = trapFocus(dialogElement, { onEscape: closeDialog });
|
|
33
|
+
// call release() when the dialog closes
|
|
34
|
+
```
|
|
35
|
+
|
|
15
36
|
## API
|
|
16
37
|
|
|
17
38
|
| Export | Purpose |
|
|
@@ -23,11 +44,9 @@ npm install @lessonkit/accessibility
|
|
|
23
44
|
| `createRovingTabIndex(opts)` | Roving tabindex groups |
|
|
24
45
|
| `visuallyHiddenStyle` | Screen-reader-only content |
|
|
25
46
|
|
|
26
|
-
Used internally by `@lessonkit/react` (e.g. `Quiz` labels).
|
|
27
|
-
|
|
28
47
|
## Docs
|
|
29
48
|
|
|
30
|
-
[Accessibility reference](https://lessonkit.readthedocs.io/en/latest/reference/accessibility.html) · [Theming & accessibility guide](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/theming-and-accessibility.html)
|
|
49
|
+
[Accessibility reference](https://lessonkit.readthedocs.io/en/latest/reference/accessibility.html) · [Theming & accessibility guide](https://lessonkit.readthedocs.io/en/latest/guides/react-developers/theming-and-accessibility.html) · [Accessibility conformance](https://lessonkit.readthedocs.io/en/latest/project/accessibility-conformance.html) · [TypeDoc API index](https://lessonkit.readthedocs.io/en/latest/reference/api.html)
|
|
31
50
|
|
|
32
51
|
## License
|
|
33
52
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessonkit/accessibility",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Accessibility utilities for LessonKit packages and apps.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"typecheck": "tsc -p tsconfig.json",
|
|
41
41
|
"test": "vitest run --passWithNoTests",
|
|
42
42
|
"test:coverage": "vitest run --coverage --passWithNoTests=false",
|
|
43
|
-
"lint": "
|
|
43
|
+
"lint": "eslint --max-warnings 0 \"src/**/*.{ts,tsx}\" \"test/**/*.{ts,tsx}\""
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"tsup": "^8.5.0",
|
|
47
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^6.0.3",
|
|
48
48
|
"vitest": "^4.1.8"
|
|
49
49
|
}
|
|
50
50
|
}
|