anentrypoint-design 0.0.178 → 0.0.180
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/app-shell.css +8 -1
- package/dist/247420.css +8 -1
- package/dist/247420.js +9 -9
- package/package.json +1 -1
- package/src/components/files-modals.js +14 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.180",
|
|
4
4
|
"description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/247420.js",
|
|
@@ -5,7 +5,10 @@ import { Btn, Icon } from './shell.js';
|
|
|
5
5
|
import { fileGlyph, fmtFileSize } from './files.js';
|
|
6
6
|
const h = webjsx.createElement;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Monotonic id source for aria-labelledby wiring between a modal and its head.
|
|
9
|
+
let _modalSeq = 0;
|
|
10
|
+
|
|
11
|
+
function Backdrop({ onClose, children, kind = '', labelledBy } = {}) {
|
|
9
12
|
// webjsx invokes a ref callback with the element on mount and with null on
|
|
10
13
|
// unmount. We stash the per-element keydown teardown on the node itself so
|
|
11
14
|
// the null branch can run it — otherwise the document/element listener leaks
|
|
@@ -66,7 +69,11 @@ function Backdrop({ onClose, children, kind = '' } = {}) {
|
|
|
66
69
|
},
|
|
67
70
|
onclick: (e) => { if (e.target === e.currentTarget && onClose) onClose(); }
|
|
68
71
|
},
|
|
69
|
-
h('div', {
|
|
72
|
+
h('div', {
|
|
73
|
+
class: 'ds-modal' + (kind ? ' ds-modal-' + kind : ''),
|
|
74
|
+
role: 'dialog', 'aria-modal': 'true',
|
|
75
|
+
...(labelledBy ? { 'aria-labelledby': labelledBy } : {})
|
|
76
|
+
}, ...(Array.isArray(children) ? children : [children]))
|
|
70
77
|
);
|
|
71
78
|
}
|
|
72
79
|
|
|
@@ -75,11 +82,15 @@ function Backdrop({ onClose, children, kind = '' } = {}) {
|
|
|
75
82
|
// `actions` is an array of vnodes (already using the Btn primitive). Any of the
|
|
76
83
|
// slots may be omitted.
|
|
77
84
|
function Modal({ onClose, kind = '', head, headClass = '', headAttrs = {}, body, bodyClass = 'ds-modal-body', bodyAttrs = {}, actions } = {}) {
|
|
85
|
+
// Give the head a stable id so the dialog can point aria-labelledby at it,
|
|
86
|
+
// exposing the title as the dialog's accessible name to screen readers.
|
|
87
|
+
const headId = head != null ? ('ds-modal-head-' + (++_modalSeq)) : null;
|
|
78
88
|
return Backdrop({
|
|
79
89
|
onClose,
|
|
80
90
|
kind,
|
|
91
|
+
labelledBy: headId,
|
|
81
92
|
children: [
|
|
82
|
-
head != null ? h('div', { class: ('ds-modal-head' + (headClass ? ' ' + headClass : '')), ...headAttrs }, ...(Array.isArray(head) ? head : [head])) : null,
|
|
93
|
+
head != null ? h('div', { id: headId, class: ('ds-modal-head' + (headClass ? ' ' + headClass : '')), ...headAttrs }, ...(Array.isArray(head) ? head : [head])) : null,
|
|
83
94
|
body != null ? h('div', { class: bodyClass, ...bodyAttrs }, ...(Array.isArray(body) ? body : [body])) : null,
|
|
84
95
|
actions != null ? h('div', { class: 'ds-modal-actions' }, ...(Array.isArray(actions) ? actions : [actions])) : null,
|
|
85
96
|
].filter(Boolean)
|