@stealthscale/component-a11y 0.1.0 → 0.1.3
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 +54 -38
- package/dist/cyclonedx/bom.json +1 -1
- package/dist/index.d.ts +47 -38
- package/dist/index.js +1 -597
- package/dist/pages/pages.json +42 -0
- package/dist/pages/roving-focus/roving-focus.js +359 -0
- package/dist/pages/roving-focus/roving-focus.props.js +3 -0
- package/dist/pages/skip-nav/skip-nav.js +181 -0
- package/dist/pages/skip-nav/skip-nav.props.js +3 -0
- package/dist/pages/visually-hidden/visually-hidden.js +203 -0
- package/dist/pages/visually-hidden/visually-hidden.props.js +3 -0
- package/dist/recipes-BM8WGKWH.js +127 -0
- package/dist/shared-UZQEmdYt.js +584 -0
- package/dist/theme.d.ts +3 -4
- package/dist/theme.js +4 -5
- package/locales/en/specimen/roving-focus.json +35 -0
- package/locales/en/specimen/skip-nav.json +14 -0
- package/locales/en/specimen/visually-hidden.json +17 -0
- package/package.json +29 -25
- package/dist/recipe-BKojQp6r.js +0 -106
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stealthscale/component-a11y",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Draws what a keyboard and a screen reader need, and an eye does not.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"a11y",
|
|
@@ -8,17 +8,18 @@
|
|
|
8
8
|
"components",
|
|
9
9
|
"react"
|
|
10
10
|
],
|
|
11
|
-
"homepage": "https://github.com/stealth-scale/
|
|
12
|
-
"bugs": "https://github.com/stealth-scale/
|
|
11
|
+
"homepage": "https://github.com/stealth-scale/scale/tree/main/components/a11y#readme",
|
|
12
|
+
"bugs": "https://github.com/stealth-scale/scale/issues",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/stealth-scale/
|
|
16
|
+
"url": "git+https://github.com/stealth-scale/scale.git",
|
|
17
17
|
"directory": "components/a11y"
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
20
|
"dist",
|
|
21
21
|
"LICENSE",
|
|
22
|
+
"locales",
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"type": "module",
|
|
@@ -35,30 +36,33 @@
|
|
|
35
36
|
"access": "public"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@arethetypeswrong/core": "^0.18
|
|
39
|
-
"@
|
|
40
|
-
"@stealthscale/
|
|
41
|
-
"@stealthscale/
|
|
42
|
-
"@stealthscale/
|
|
43
|
-
"@stealthscale/vite-config
|
|
44
|
-
"@stealthscale/vite-config-
|
|
39
|
+
"@arethetypeswrong/core": "^0.18",
|
|
40
|
+
"@stealthscale/component-actions": "^0.2.3",
|
|
41
|
+
"@stealthscale/component-layout": "^0.2.2",
|
|
42
|
+
"@stealthscale/hooks": "^0.3.0",
|
|
43
|
+
"@stealthscale/theme": "^0.5.0",
|
|
44
|
+
"@stealthscale/vite-config": "^0.8.0",
|
|
45
|
+
"@stealthscale/vite-config-i18n": "^0.2.2",
|
|
46
|
+
"@stealthscale/vite-config-react": "^0.9.1",
|
|
47
|
+
"@stealthscale/vite-config-specimen": "^0.3.0",
|
|
48
|
+
"@stealthscale/vite-config-theme": "^0.3.0",
|
|
45
49
|
"@stealthscale/vite-config-typescript": "^0.3.0",
|
|
46
|
-
"@testing-library/react": "^16.3
|
|
47
|
-
"@types/react": "^19.3
|
|
48
|
-
"@types/react-dom": "^19.3
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"oxc-transform-react": "^0.
|
|
52
|
-
"publint": "^0.3
|
|
53
|
-
"react": "^19.3
|
|
54
|
-
"react-dom": "^19.3
|
|
55
|
-
"typescript": "^7.0
|
|
56
|
-
"vitest": "
|
|
50
|
+
"@testing-library/react": "^16.3",
|
|
51
|
+
"@types/react": "^19.3",
|
|
52
|
+
"@types/react-dom": "^19.3",
|
|
53
|
+
"happy-dom": "^20.14",
|
|
54
|
+
"lucide-react": "^1.52",
|
|
55
|
+
"oxc-transform-react": "^0.153",
|
|
56
|
+
"publint": "^0.3",
|
|
57
|
+
"react": "^19.3",
|
|
58
|
+
"react-dom": "^19.3",
|
|
59
|
+
"typescript": "^7.0",
|
|
60
|
+
"vitest": "5.0.3"
|
|
57
61
|
},
|
|
58
62
|
"peerDependencies": {
|
|
59
|
-
"@stealthscale/hooks": "^0.
|
|
60
|
-
"@stealthscale/theme": "^0.
|
|
61
|
-
"react": "^19.3
|
|
63
|
+
"@stealthscale/hooks": "^0.3.0",
|
|
64
|
+
"@stealthscale/theme": "^0.5.0",
|
|
65
|
+
"react": "^19.3"
|
|
62
66
|
},
|
|
63
67
|
"engines": {
|
|
64
68
|
"node": ">=26.0.0"
|
package/dist/recipe-BKojQp6r.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { defineRecipe, defineSlotRecipe } from "@stealthscale/theme/authoring";
|
|
2
|
-
//#region src/roving-focus/recipe.ts
|
|
3
|
-
/**
|
|
4
|
-
* States what a set of controls under one tab stop is: a row or a column of items, laid out the
|
|
5
|
-
* way the arrows move through them.
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* The orientation is one axis because it decides two things that have to agree: which arrows
|
|
9
|
-
* move focus, which the root reads, and which way the items run, which the recipe draws. A group
|
|
10
|
-
* the arrows move through in both directions wraps, because a set a reader moves through on two
|
|
11
|
-
* axes is a set that runs onto a second line.
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Lays the items out in a row the arrows run along until a caller says otherwise.
|
|
15
|
-
*/
|
|
16
|
-
const recipe$2 = defineSlotRecipe({
|
|
17
|
-
base: {
|
|
18
|
-
item: { minInlineSize: "0" },
|
|
19
|
-
root: { display: "flex" }
|
|
20
|
-
},
|
|
21
|
-
className: "roving-focus",
|
|
22
|
-
defaultVariants: { orientation: "horizontal" },
|
|
23
|
-
jsx: [/^RovingFocus(\.\w+)?$/u],
|
|
24
|
-
slots: ["root", "item"],
|
|
25
|
-
variants: { orientation: {
|
|
26
|
-
both: { root: {
|
|
27
|
-
flexDirection: "row",
|
|
28
|
-
flexWrap: "wrap"
|
|
29
|
-
} },
|
|
30
|
-
horizontal: { root: { flexDirection: "row" } },
|
|
31
|
-
vertical: { root: { flexDirection: "column" } }
|
|
32
|
-
} }
|
|
33
|
-
});
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/skip-nav/recipe.ts
|
|
36
|
-
/**
|
|
37
|
-
* States what a way past the navigation is: a link a keyboard reaches first and an eye sees only
|
|
38
|
-
* while focus is on it, and the place on the page it jumps to.
|
|
39
|
-
*
|
|
40
|
-
* @remarks
|
|
41
|
-
* The link is hidden the way the hidden text is hidden, and comes into view under focus, so a
|
|
42
|
-
* reader tabbing into the page meets it and a reader who never tabs never sees it. The target
|
|
43
|
-
* states nothing but its own class, because a page decides what it looks like and the target's
|
|
44
|
-
* whole job is to be somewhere focus can land.
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* Draws the link over the top of the page while focus is on it, and leaves the target alone.
|
|
48
|
-
*/
|
|
49
|
-
const recipe$1 = defineSlotRecipe({
|
|
50
|
-
base: {
|
|
51
|
-
link: {
|
|
52
|
-
_focusVisible: {
|
|
53
|
-
borderRadius: "l2",
|
|
54
|
-
insetBlockStart: "inset.md",
|
|
55
|
-
insetInlineStart: "inset.md",
|
|
56
|
-
layerStyle: "fill.surface",
|
|
57
|
-
paddingBlock: "inset.sm",
|
|
58
|
-
paddingInline: "inset.md",
|
|
59
|
-
position: "fixed",
|
|
60
|
-
srOnly: false,
|
|
61
|
-
textStyle: "label.md",
|
|
62
|
-
zIndex: "skipNav"
|
|
63
|
-
},
|
|
64
|
-
srOnly: true
|
|
65
|
-
},
|
|
66
|
-
target: { scrollMarginBlockStart: "inset.lg" }
|
|
67
|
-
},
|
|
68
|
-
className: "skip-nav",
|
|
69
|
-
jsx: [/^SkipNav(\.\w+)?$/u],
|
|
70
|
-
slots: ["link", "target"]
|
|
71
|
-
});
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/visually-hidden/recipe.ts
|
|
74
|
-
/**
|
|
75
|
-
* States what visually hidden text is: words a screen reader reads and an eye never sees, and
|
|
76
|
-
* which come into view where a keyboard reaches them.
|
|
77
|
-
*
|
|
78
|
-
* @remarks
|
|
79
|
-
* The compiler's `srOnly` utility writes the hiding, which takes the words out of sight without
|
|
80
|
-
* taking them out of the accessibility tree the way `display: none` and `visibility: hidden`
|
|
81
|
-
* both do. A control a reader can reach by keyboard has to be visible once focus is on it, or a
|
|
82
|
-
* sighted reader tabbing through the page loses their place, so the focusable value undoes the
|
|
83
|
-
* hiding for as long as focus is there.
|
|
84
|
-
*/
|
|
85
|
-
/**
|
|
86
|
-
* Hides what it holds from sight and leaves it to a screen reader.
|
|
87
|
-
*/
|
|
88
|
-
const recipe = defineRecipe({
|
|
89
|
-
base: { srOnly: true },
|
|
90
|
-
className: "visually-hidden",
|
|
91
|
-
jsx: [/^VisuallyHidden$/u],
|
|
92
|
-
variants: { focusable: { true: { _focusVisible: {
|
|
93
|
-
borderRadius: "l1",
|
|
94
|
-
insetBlockStart: "inset.md",
|
|
95
|
-
insetInlineStart: "inset.md",
|
|
96
|
-
layerStyle: "fill.surface",
|
|
97
|
-
paddingBlock: "inset.sm",
|
|
98
|
-
paddingInline: "inset.md",
|
|
99
|
-
position: "fixed",
|
|
100
|
-
srOnly: false,
|
|
101
|
-
textStyle: "label.md",
|
|
102
|
-
zIndex: "skipNav"
|
|
103
|
-
} } } }
|
|
104
|
-
});
|
|
105
|
-
//#endregion
|
|
106
|
-
export { recipe$1 as n, recipe$2 as r, recipe as t };
|