@human-synthesis/norns-ui 0.2.1 → 0.2.2
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/package.json +1 -1
- package/src/components/Btn.n +5 -0
- package/src/palette-manifest.json +6 -1
- package/src/types/Btn.d.ts +6 -0
package/package.json
CHANGED
package/src/components/Btn.n
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
target!="{target}"
|
|
17
17
|
rel!="{rel}"
|
|
18
18
|
class!="{classes}"
|
|
19
|
+
aria-label!="{ariaLabel}"
|
|
19
20
|
aria-disabled!="{disabled || loading ? 'true' : undefined}"
|
|
20
21
|
)
|
|
21
22
|
| {@render body()}
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
class!="{classes}"
|
|
26
27
|
disabled!="{disabled || loading}"
|
|
27
28
|
onclick!="{onclick}"
|
|
29
|
+
aria-label!="{ariaLabel}"
|
|
28
30
|
aria-busy!="{loading ? 'true' : undefined}"
|
|
29
31
|
)
|
|
30
32
|
| {@render body()}
|
|
@@ -44,6 +46,9 @@
|
|
|
44
46
|
href
|
|
45
47
|
target
|
|
46
48
|
rel
|
|
49
|
+
// Icon-only buttons (icon set, no children) have no accessible name
|
|
50
|
+
// without this — always pass ariaLabel for those.
|
|
51
|
+
ariaLabel
|
|
47
52
|
children
|
|
48
53
|
leading
|
|
49
54
|
trailing
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"library": "@human-synthesis/norns-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"counts": {
|
|
5
5
|
"components": 78,
|
|
6
6
|
"motion": 5,
|
|
@@ -372,6 +372,11 @@
|
|
|
372
372
|
"type": "string",
|
|
373
373
|
"required": false
|
|
374
374
|
},
|
|
375
|
+
{
|
|
376
|
+
"name": "ariaLabel",
|
|
377
|
+
"type": "string",
|
|
378
|
+
"required": false
|
|
379
|
+
},
|
|
375
380
|
{
|
|
376
381
|
"name": "class",
|
|
377
382
|
"type": "string",
|
package/src/types/Btn.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export type BtnProps = Omit<HTMLButtonAttributes, 'class' | 'children'> & {
|
|
|
25
25
|
href?: string;
|
|
26
26
|
target?: string;
|
|
27
27
|
rel?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Accessible name, rendered as `aria-label`. Required in practice for
|
|
30
|
+
* icon-only buttons (`icon` set, no `children`), which otherwise have
|
|
31
|
+
* no accessible name at all.
|
|
32
|
+
*/
|
|
33
|
+
ariaLabel?: string;
|
|
28
34
|
class?: string;
|
|
29
35
|
children?: Snippet;
|
|
30
36
|
leading?: Snippet;
|