a11y-elements 0.3.0 → 0.4.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 +137 -7
- package/dist/a11y.css +164 -0
- package/dist/all.d.ts +38 -0
- package/dist/all.js +38 -0
- package/dist/all.js.map +1 -0
- package/dist/browser/all.js +149 -0
- package/dist/browser/all.js.map +1 -0
- package/dist/browser/chunk-2YF57VSU.js +122 -0
- package/dist/browser/chunk-2YF57VSU.js.map +1 -0
- package/dist/browser/chunk-3RRJOPEF.js +24 -0
- package/dist/browser/chunk-3RRJOPEF.js.map +1 -0
- package/dist/browser/chunk-3UC2S6JJ.js +42 -0
- package/dist/browser/chunk-3UC2S6JJ.js.map +1 -0
- package/dist/browser/chunk-46SIA3RI.js +410 -0
- package/dist/browser/chunk-46SIA3RI.js.map +1 -0
- package/dist/browser/chunk-4FHDXZ3L.js +547 -0
- package/dist/browser/chunk-4FHDXZ3L.js.map +1 -0
- package/dist/browser/chunk-4IURHUQU.js +78 -0
- package/dist/browser/chunk-4IURHUQU.js.map +1 -0
- package/dist/browser/chunk-4KU26VOY.js +16 -0
- package/dist/browser/chunk-4KU26VOY.js.map +1 -0
- package/dist/browser/chunk-6BOK3R6K.js +400 -0
- package/dist/browser/chunk-6BOK3R6K.js.map +1 -0
- package/dist/browser/chunk-6Q6VW435.js +125 -0
- package/dist/browser/chunk-6Q6VW435.js.map +1 -0
- package/dist/browser/chunk-A32U5MX7.js +76 -0
- package/dist/browser/chunk-A32U5MX7.js.map +1 -0
- package/dist/browser/chunk-A5CV54CT.js +38 -0
- package/dist/browser/chunk-A5CV54CT.js.map +1 -0
- package/dist/browser/chunk-ABTLBDUK.js +56 -0
- package/dist/browser/chunk-ABTLBDUK.js.map +1 -0
- package/dist/browser/chunk-ACOSO5NE.js +64 -0
- package/dist/browser/chunk-ACOSO5NE.js.map +1 -0
- package/dist/browser/chunk-CXUZEGZY.js +52 -0
- package/dist/browser/chunk-CXUZEGZY.js.map +1 -0
- package/dist/browser/chunk-EAASMTBS.js +123 -0
- package/dist/browser/chunk-EAASMTBS.js.map +1 -0
- package/dist/browser/chunk-F47DDMFE.js +39 -0
- package/dist/browser/chunk-F47DDMFE.js.map +1 -0
- package/dist/browser/chunk-FAEA66RR.js +29 -0
- package/dist/browser/chunk-FAEA66RR.js.map +1 -0
- package/dist/browser/chunk-FXHJKL3U.js +81 -0
- package/dist/browser/chunk-FXHJKL3U.js.map +1 -0
- package/dist/browser/chunk-GDJTILU4.js +100 -0
- package/dist/browser/chunk-GDJTILU4.js.map +1 -0
- package/dist/browser/chunk-GH53G7MU.js +35 -0
- package/dist/browser/chunk-GH53G7MU.js.map +1 -0
- package/dist/browser/chunk-GKNBHWGY.js +67 -0
- package/dist/browser/chunk-GKNBHWGY.js.map +1 -0
- package/dist/browser/chunk-GUKQIHPM.js +72 -0
- package/dist/browser/chunk-GUKQIHPM.js.map +1 -0
- package/dist/browser/chunk-HGPHWR3R.js +106 -0
- package/dist/browser/chunk-HGPHWR3R.js.map +1 -0
- package/dist/browser/chunk-HLID3PP5.js +19 -0
- package/dist/browser/chunk-HLID3PP5.js.map +1 -0
- package/dist/browser/chunk-HPTH4SJ2.js +68 -0
- package/dist/browser/chunk-HPTH4SJ2.js.map +1 -0
- package/dist/browser/chunk-I4KOJO4B.js +66 -0
- package/dist/browser/chunk-I4KOJO4B.js.map +1 -0
- package/dist/browser/chunk-ISWQOJT7.js +19 -0
- package/dist/browser/chunk-ISWQOJT7.js.map +1 -0
- package/dist/browser/chunk-KUTHJLZ5.js +72 -0
- package/dist/browser/chunk-KUTHJLZ5.js.map +1 -0
- package/dist/browser/chunk-LQ34M47I.js +41 -0
- package/dist/browser/chunk-LQ34M47I.js.map +1 -0
- package/dist/browser/chunk-NI7PACR4.js +449 -0
- package/dist/browser/chunk-NI7PACR4.js.map +1 -0
- package/dist/browser/chunk-NTNPE4TH.js +162 -0
- package/dist/browser/chunk-NTNPE4TH.js.map +1 -0
- package/dist/browser/chunk-O4AJULBZ.js +249 -0
- package/dist/browser/chunk-O4AJULBZ.js.map +1 -0
- package/dist/browser/chunk-P42KF3NM.js +138 -0
- package/dist/browser/chunk-P42KF3NM.js.map +1 -0
- package/dist/browser/chunk-QT7Z23GS.js +189 -0
- package/dist/browser/chunk-QT7Z23GS.js.map +1 -0
- package/dist/browser/chunk-R4OVZULJ.js +48 -0
- package/dist/browser/chunk-R4OVZULJ.js.map +1 -0
- package/dist/browser/chunk-S7GPESLQ.js +51 -0
- package/dist/browser/chunk-S7GPESLQ.js.map +1 -0
- package/dist/browser/chunk-SIQUYA37.js +76 -0
- package/dist/browser/chunk-SIQUYA37.js.map +1 -0
- package/dist/browser/chunk-SYKTM7WJ.js +82 -0
- package/dist/browser/chunk-SYKTM7WJ.js.map +1 -0
- package/dist/browser/chunk-TTP33GXU.js +177 -0
- package/dist/browser/chunk-TTP33GXU.js.map +1 -0
- package/dist/browser/chunk-UCAUEEED.js +125 -0
- package/dist/browser/chunk-UCAUEEED.js.map +1 -0
- package/dist/browser/chunk-VY6BZLCJ.js +170 -0
- package/dist/browser/chunk-VY6BZLCJ.js.map +1 -0
- package/dist/browser/chunk-ZMCETLOQ.js +39 -0
- package/dist/browser/chunk-ZMCETLOQ.js.map +1 -0
- package/dist/browser/components/anchor/define.js +9 -322
- package/dist/browser/components/anchor/define.js.map +1 -1
- package/dist/browser/components/avatar/define.js +7 -258
- package/dist/browser/components/avatar/define.js.map +1 -1
- package/dist/browser/components/card-link/define.js +16 -0
- package/dist/browser/components/card-link/define.js.map +1 -0
- package/dist/browser/components/checkbox/define.js +9 -277
- package/dist/browser/components/checkbox/define.js.map +1 -1
- package/dist/browser/components/checkbox-group/define.js +9 -388
- package/dist/browser/components/checkbox-group/define.js.map +1 -1
- package/dist/browser/components/file-input/define.js +13 -1062
- package/dist/browser/components/file-input/define.js.map +1 -1
- package/dist/browser/components/focusable/define.js +7 -205
- package/dist/browser/components/focusable/define.js.map +1 -1
- package/dist/browser/components/input/define.js +13 -690
- package/dist/browser/components/input/define.js.map +1 -1
- package/dist/browser/components/label/define.js +9 -268
- package/dist/browser/components/label/define.js.map +1 -1
- package/dist/browser/components/picture/define.js +9 -405
- package/dist/browser/components/picture/define.js.map +1 -1
- package/dist/browser/components/progress/define.js +7 -233
- package/dist/browser/components/progress/define.js.map +1 -1
- package/dist/browser/components/radio-group/define.js +9 -298
- package/dist/browser/components/radio-group/define.js.map +1 -1
- package/dist/browser/components/select/define.js +9 -276
- package/dist/browser/components/select/define.js.map +1 -1
- package/dist/browser/components/skeleton/define.js +7 -228
- package/dist/browser/components/skeleton/define.js.map +1 -1
- package/dist/browser/components/spinner/define.js +7 -254
- package/dist/browser/components/spinner/define.js.map +1 -1
- package/dist/browser/components/switch/define.js +9 -284
- package/dist/browser/components/switch/define.js.map +1 -1
- package/dist/browser/components/textarea/define.js +13 -690
- package/dist/browser/components/textarea/define.js.map +1 -1
- package/dist/browser/components/visually-hidden/define.js +7 -189
- package/dist/browser/components/visually-hidden/define.js.map +1 -1
- package/dist/browser/overlays/blocking-loader/define.js +14 -512
- package/dist/browser/overlays/blocking-loader/define.js.map +1 -1
- package/dist/browser/overlays/context-menu/define.js +16 -944
- package/dist/browser/overlays/context-menu/define.js.map +1 -1
- package/dist/browser/overlays/drawer/define.js +15 -714
- package/dist/browser/overlays/drawer/define.js.map +1 -1
- package/dist/browser/overlays/dropdown/define.js +16 -940
- package/dist/browser/overlays/dropdown/define.js.map +1 -1
- package/dist/browser/overlays/emergency-dialog/define.js +15 -710
- package/dist/browser/overlays/emergency-dialog/define.js.map +1 -1
- package/dist/browser/overlays/floating/define.js +21 -0
- package/dist/browser/overlays/floating/define.js.map +1 -0
- package/dist/browser/overlays/modal/define.js +15 -707
- package/dist/browser/overlays/modal/define.js.map +1 -1
- package/dist/browser/overlays/notification-banner/define.js +14 -449
- package/dist/browser/overlays/notification-banner/define.js.map +1 -1
- package/dist/browser/overlays/popover/define.js +15 -794
- package/dist/browser/overlays/popover/define.js.map +1 -1
- package/dist/browser/overlays/snackbar/define.js +14 -405
- package/dist/browser/overlays/snackbar/define.js.map +1 -1
- package/dist/browser/overlays/tooltip/define.js +16 -890
- package/dist/browser/overlays/tooltip/define.js.map +1 -1
- package/dist/components/anchor/define.d.ts +1 -1
- package/dist/components/anchor/define.js +3 -5
- package/dist/components/anchor/define.js.map +1 -1
- package/dist/components/avatar/define.d.ts +1 -1
- package/dist/components/avatar/define.js +3 -5
- package/dist/components/avatar/define.js.map +1 -1
- package/dist/components/card-link/card-link.element.d.ts +47 -0
- package/dist/components/card-link/card-link.element.js +129 -0
- package/dist/components/card-link/card-link.element.js.map +1 -0
- package/dist/components/card-link/define.d.ts +8 -0
- package/dist/components/card-link/define.js +6 -0
- package/dist/components/card-link/define.js.map +1 -0
- package/dist/components/checkbox/define.d.ts +1 -1
- package/dist/components/checkbox/define.js +3 -5
- package/dist/components/checkbox/define.js.map +1 -1
- package/dist/components/checkbox-group/define.d.ts +1 -1
- package/dist/components/checkbox-group/define.js +3 -5
- package/dist/components/checkbox-group/define.js.map +1 -1
- package/dist/components/file-input/define.d.ts +1 -1
- package/dist/components/file-input/define.js +3 -5
- package/dist/components/file-input/define.js.map +1 -1
- package/dist/components/focusable/define.d.ts +1 -1
- package/dist/components/focusable/define.js +3 -5
- package/dist/components/focusable/define.js.map +1 -1
- package/dist/components/focusable/focusable.element.d.ts +1 -1
- package/dist/components/focusable/focusable.element.js +3 -3
- package/dist/components/focusable/focusable.element.js.map +1 -1
- package/dist/components/input/define.d.ts +1 -1
- package/dist/components/input/define.js +3 -5
- package/dist/components/input/define.js.map +1 -1
- package/dist/components/label/define.d.ts +1 -1
- package/dist/components/label/define.js +3 -5
- package/dist/components/label/define.js.map +1 -1
- package/dist/components/picture/define.d.ts +1 -1
- package/dist/components/picture/define.js +3 -5
- package/dist/components/picture/define.js.map +1 -1
- package/dist/components/progress/define.d.ts +1 -1
- package/dist/components/progress/define.js +3 -5
- package/dist/components/progress/define.js.map +1 -1
- package/dist/components/radio-group/define.d.ts +1 -1
- package/dist/components/radio-group/define.js +3 -5
- package/dist/components/radio-group/define.js.map +1 -1
- package/dist/components/select/define.d.ts +1 -1
- package/dist/components/select/define.js +3 -5
- package/dist/components/select/define.js.map +1 -1
- package/dist/components/skeleton/define.d.ts +1 -1
- package/dist/components/skeleton/define.js +3 -5
- package/dist/components/skeleton/define.js.map +1 -1
- package/dist/components/skeleton/skeleton.element.js +2 -2
- package/dist/components/skeleton/skeleton.element.js.map +1 -1
- package/dist/components/spinner/define.d.ts +1 -1
- package/dist/components/spinner/define.js +3 -5
- package/dist/components/spinner/define.js.map +1 -1
- package/dist/components/switch/define.d.ts +1 -1
- package/dist/components/switch/define.js +3 -5
- package/dist/components/switch/define.js.map +1 -1
- package/dist/components/textarea/define.d.ts +1 -1
- package/dist/components/textarea/define.js +3 -5
- package/dist/components/textarea/define.js.map +1 -1
- package/dist/components/visually-hidden/define.d.ts +1 -1
- package/dist/components/visually-hidden/define.js +3 -5
- package/dist/components/visually-hidden/define.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.element.d.ts +1 -1
- package/dist/components/visually-hidden/visually-hidden.element.js +3 -4
- package/dist/components/visually-hidden/visually-hidden.element.js.map +1 -1
- package/dist/core/a11y-element.d.ts +14 -6
- package/dist/core/a11y-element.js +7 -3
- package/dist/core/a11y-element.js.map +1 -1
- package/dist/core/define-element.d.ts +6 -0
- package/dist/core/define-element.js +10 -0
- package/dist/core/define-element.js.map +1 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/sanitize.d.ts +21 -0
- package/dist/core/sanitize.js +107 -0
- package/dist/core/sanitize.js.map +1 -0
- package/dist/core/strings.d.ts +1 -1
- package/dist/core/strings.js +3 -3
- package/dist/core/strings.js.map +1 -1
- package/dist/core/template.d.ts +37 -7
- package/dist/core/template.js +211 -17
- package/dist/core/template.js.map +1 -1
- package/dist/core/zero-build-exports.d.ts +1 -0
- package/dist/core/zero-build-exports.js +3 -0
- package/dist/core/zero-build-exports.js.map +1 -0
- package/dist/overlays/blocking-loader/blocking-loader.element.js +2 -2
- package/dist/overlays/blocking-loader/blocking-loader.element.js.map +1 -1
- package/dist/overlays/blocking-loader/define.d.ts +1 -2
- package/dist/overlays/blocking-loader/define.js +3 -6
- package/dist/overlays/blocking-loader/define.js.map +1 -1
- package/dist/overlays/context-menu/define.d.ts +1 -2
- package/dist/overlays/context-menu/define.js +3 -6
- package/dist/overlays/context-menu/define.js.map +1 -1
- package/dist/overlays/core/a11y-modal-overlay-element.js +1 -1
- package/dist/overlays/core/a11y-modal-overlay-element.js.map +1 -1
- package/dist/overlays/core/a11y-passive-overlay-element.d.ts +3 -1
- package/dist/overlays/core/a11y-passive-overlay-element.js.map +1 -1
- package/dist/overlays/core/zero-build-exports.d.ts +2 -0
- package/dist/overlays/core/zero-build-exports.js +4 -0
- package/dist/overlays/core/zero-build-exports.js.map +1 -0
- package/dist/overlays/drawer/define.d.ts +1 -2
- package/dist/overlays/drawer/define.js +3 -6
- package/dist/overlays/drawer/define.js.map +1 -1
- package/dist/overlays/dropdown/define.d.ts +1 -2
- package/dist/overlays/dropdown/define.js +3 -6
- package/dist/overlays/dropdown/define.js.map +1 -1
- package/dist/overlays/emergency-dialog/define.d.ts +1 -2
- package/dist/overlays/emergency-dialog/define.js +3 -6
- package/dist/overlays/emergency-dialog/define.js.map +1 -1
- package/dist/overlays/floating/define.d.ts +8 -0
- package/dist/overlays/floating/define.js +6 -0
- package/dist/overlays/floating/define.js.map +1 -0
- package/dist/overlays/floating/floating.element.d.ts +125 -0
- package/dist/overlays/floating/floating.element.js +621 -0
- package/dist/overlays/floating/floating.element.js.map +1 -0
- package/dist/overlays/modal/define.d.ts +1 -2
- package/dist/overlays/modal/define.js +3 -6
- package/dist/overlays/modal/define.js.map +1 -1
- package/dist/overlays/notification-banner/define.d.ts +3 -3
- package/dist/overlays/notification-banner/define.js +3 -6
- package/dist/overlays/notification-banner/define.js.map +1 -1
- package/dist/overlays/notification-banner/notification-banner.element.d.ts +2 -1
- package/dist/overlays/notification-banner/notification-banner.element.js +2 -2
- package/dist/overlays/notification-banner/notification-banner.element.js.map +1 -1
- package/dist/overlays/popover/define.d.ts +1 -2
- package/dist/overlays/popover/define.js +3 -6
- package/dist/overlays/popover/define.js.map +1 -1
- package/dist/overlays/snackbar/define.d.ts +3 -3
- package/dist/overlays/snackbar/define.js +3 -6
- package/dist/overlays/snackbar/define.js.map +1 -1
- package/dist/overlays/snackbar/snackbar.element.d.ts +2 -1
- package/dist/overlays/snackbar/snackbar.element.js +2 -2
- package/dist/overlays/snackbar/snackbar.element.js.map +1 -1
- package/dist/overlays/tooltip/define.d.ts +1 -2
- package/dist/overlays/tooltip/define.js +3 -6
- package/dist/overlays/tooltip/define.js.map +1 -1
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ See a [demo of the elements](https://nutin.org/a11y-elements/elements) - See a [
|
|
|
10
10
|
|
|
11
11
|
### Zero-build
|
|
12
12
|
|
|
13
|
-
Load a component's
|
|
13
|
+
Load a component's browser bundle directly, no bundler required:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
16
|
<link rel="stylesheet" href="node_modules/a11y-elements/dist/a11y.css" />
|
|
@@ -19,8 +19,9 @@ Load a component's standalone browser bundle directly, no bundler required:
|
|
|
19
19
|
<a11y-spinner></a11y-spinner>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
* Each component has its own `define.js` under `dist/browser/**`.
|
|
23
|
-
*
|
|
22
|
+
* Each component has its own `define.js` under `dist/browser/**`. Load only the ones you use.
|
|
23
|
+
* They share their common code through `chunk-*.js` files in `dist/browser/`, so the browser fetches it once however many you load. Serve them from the package's `dist/browser/` folder as is: a `define.js` copied on its own won't load.
|
|
24
|
+
* `dist/browser/all.js` registers every element at once and exports everything the individual bundles do.
|
|
24
25
|
* Page-wide state is shared between bundles, so mixing several on one page is safe.
|
|
25
26
|
* Overlay bundles also export `dismissAllOverlays()`:
|
|
26
27
|
|
|
@@ -44,6 +45,7 @@ import { A11yElement } from 'a11y-elements/core';
|
|
|
44
45
|
|
|
45
46
|
* There's no default export: `import 'a11y-elements'` alone will fail.
|
|
46
47
|
* Import the component you want: `/element` gets you the class itself when you need it
|
|
48
|
+
* `import 'a11y-elements/all'` registers every element at once, and exports every element class plus `setStrings()`, `dismissAllOverlays()`, `notify()` and the other helpers the individual entries export.
|
|
47
49
|
* See [Elements](#elements) for every component.
|
|
48
50
|
|
|
49
51
|
Importing a component's subpath also adds its tag to TypeScript's `HTMLElementTagNameMap`, so exact-tag lookups such as `document.createElement('a11y-checkbox')` or `document.querySelector('a11y-checkbox')` come back typed as `CheckboxElement` without a cast.
|
|
@@ -67,8 +69,8 @@ setStrings({
|
|
|
67
69
|
| --- | --- | --- | --- |
|
|
68
70
|
| `opensInNewTab` | `(opens in new tab)` | `<a11y-anchor>` new-tab links | `new-tab-label` |
|
|
69
71
|
| `navigatedTo` | `Navigated to {name}` | `<a11y-anchor>` jump announcement (`{name}` is the target's name) | `navigated-label` |
|
|
70
|
-
| `closeDialog` | `Close dialog` | the × button of `<a11y-modal>`, `<a11y-drawer>`, `<a11y-emergency-dialog>` | `close-label` |
|
|
71
|
-
| `dismiss` | `Dismiss` | the × button of each `<a11y-notification-banner>` item | `dismiss-label` |
|
|
72
|
+
| `closeDialog` | `Close dialog` | the × button of `<a11y-modal>`, `<a11y-drawer>`, `<a11y-emergency-dialog>`, an expandable `<a11y-floating>`'s panel | `close-label` |
|
|
73
|
+
| `dismiss` | `Dismiss` | the × button of each `<a11y-notification-banner>` item and of a `dismissible` `<a11y-floating>` | `dismiss-label` |
|
|
72
74
|
| `loading` | `Loading` | `<a11y-spinner>`, `<a11y-blocking-loader>` | `label` / `message` |
|
|
73
75
|
| `progress` | `Progress` | `<a11y-progress>` without a label | `label` / `aria-label` |
|
|
74
76
|
| `avatar` | `Avatar` | `<a11y-avatar>` with no `alt` or `initials` | `alt` / `initials` |
|
|
@@ -96,9 +98,9 @@ Each section shows an example, the element's own attributes/properties/methods,
|
|
|
96
98
|
|
|
97
99
|
Behavior shared by overlays is described once, in [Common to all overlays](#common-to-all-overlays).
|
|
98
100
|
|
|
99
|
-
**Accessibility components:** [`<a11y-anchor>`](#a11y-anchor) · [`<a11y-avatar>`](#a11y-avatar) · [`<a11y-checkbox>`](#a11y-checkbox) · [`<a11y-checkbox-group>`](#a11y-checkbox-group) · [`<a11y-file-input>`](#a11y-file-input) · [`<a11y-focusable>`](#a11y-focusable) · [`<a11y-input>`](#a11y-input) · [`<a11y-label>`](#a11y-label) · [`<a11y-picture>`](#a11y-picture) · [`<a11y-progress>`](#a11y-progress) · [`<a11y-radio-group>`](#a11y-radio-group) · [`<a11y-select>`](#a11y-select) · [`<a11y-skeleton>`](#a11y-skeleton) · [`<a11y-spinner>`](#a11y-spinner) · [`<a11y-switch>`](#a11y-switch) · [`<a11y-textarea>`](#a11y-textarea) · [`<a11y-visually-hidden>`](#a11y-visually-hidden)
|
|
101
|
+
**Accessibility components:** [`<a11y-anchor>`](#a11y-anchor) · [`<a11y-avatar>`](#a11y-avatar) · [`<a11y-card-link>`](#a11y-card-link) · [`<a11y-checkbox>`](#a11y-checkbox) · [`<a11y-checkbox-group>`](#a11y-checkbox-group) · [`<a11y-file-input>`](#a11y-file-input) · [`<a11y-focusable>`](#a11y-focusable) · [`<a11y-input>`](#a11y-input) · [`<a11y-label>`](#a11y-label) · [`<a11y-picture>`](#a11y-picture) · [`<a11y-progress>`](#a11y-progress) · [`<a11y-radio-group>`](#a11y-radio-group) · [`<a11y-select>`](#a11y-select) · [`<a11y-skeleton>`](#a11y-skeleton) · [`<a11y-spinner>`](#a11y-spinner) · [`<a11y-switch>`](#a11y-switch) · [`<a11y-textarea>`](#a11y-textarea) · [`<a11y-visually-hidden>`](#a11y-visually-hidden)
|
|
100
102
|
|
|
101
|
-
**Overlays:** [`<a11y-blocking-loader>`](#a11y-blocking-loader) · [`<a11y-context-menu>`](#a11y-context-menu) · [`<a11y-drawer>`](#a11y-drawer) · [`<a11y-dropdown>`](#a11y-dropdown) · [`<a11y-emergency-dialog>`](#a11y-emergency-dialog) · [`<a11y-modal>`](#a11y-modal) · [`<a11y-notification-banner>`](#a11y-notification-banner) · [`<a11y-popover>`](#a11y-popover) · [`<a11y-snackbar>`](#a11y-snackbar) · [`<a11y-tooltip>`](#a11y-tooltip)
|
|
103
|
+
**Overlays:** [`<a11y-blocking-loader>`](#a11y-blocking-loader) · [`<a11y-context-menu>`](#a11y-context-menu) · [`<a11y-drawer>`](#a11y-drawer) · [`<a11y-dropdown>`](#a11y-dropdown) · [`<a11y-emergency-dialog>`](#a11y-emergency-dialog) · [`<a11y-floating>`](#a11y-floating) · [`<a11y-modal>`](#a11y-modal) · [`<a11y-notification-banner>`](#a11y-notification-banner) · [`<a11y-popover>`](#a11y-popover) · [`<a11y-snackbar>`](#a11y-snackbar) · [`<a11y-tooltip>`](#a11y-tooltip)
|
|
102
104
|
|
|
103
105
|
Import paths follow the folder names: `a11y-elements/components/<name>` or `a11y-elements/overlays/<name>` (add `/element` for the class), and `dist/browser/<group>/<name>/define.js` for zero-build.
|
|
104
106
|
|
|
@@ -161,6 +163,44 @@ An avatar image with an initials fallback. When the image is missing or fails to
|
|
|
161
163
|
|
|
162
164
|
</details>
|
|
163
165
|
|
|
166
|
+
#### `a11y-card-link`
|
|
167
|
+
|
|
168
|
+
Makes a whole card go to one page through a real `<a href>` inside it (usually around the title). The link stays the card's only tab stop and its accessible name, so screen readers announce a link named by the title, Enter follows it, Space scrolls the page, and middle-click, "Open in new tab" and "Copy link address" work on it.
|
|
169
|
+
|
|
170
|
+
A click anywhere else on the card is forwarded to the link with a real `click()`, so your own click handlers on the link (an SPA router's) run for it too. Clicks aren't forwarded when they land on another control in the card (a button, a second link, an input…), when the user was selecting text, or when something already called `preventDefault()`. Cmd/Ctrl/Shift-click and middle-click on the card open the link in a new tab.
|
|
171
|
+
|
|
172
|
+
The card gets no `role` or `tabindex`. Use it for cards that navigate; for cards that perform an action, use a `<button>` or [`<a11y-focusable>`](#a11y-focusable).
|
|
173
|
+
|
|
174
|
+
```html
|
|
175
|
+
<a11y-card-link describe>
|
|
176
|
+
<div class="card">
|
|
177
|
+
<svg aria-hidden="true">…</svg>
|
|
178
|
+
<h3><a href="/articles/why-nutin">Why Nutin?</a></h3>
|
|
179
|
+
<p data-card-description>The idea behind the framework…</p>
|
|
180
|
+
</div>
|
|
181
|
+
</a11y-card-link>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
| Name | Kind | Default | Description |
|
|
185
|
+
| --- | --- | --- | --- |
|
|
186
|
+
| `describe` | attribute (boolean) | — | Adds the `data-card-description` element to the link's `aria-describedby` (giving it an id if it has none), so it's read after the title. |
|
|
187
|
+
| `data-card-link` | attribute, on an `<a href>` inside | — | The link to use when the card has several. Otherwise the first `<a href>` is used. Without one, a console warning is logged. |
|
|
188
|
+
| `data-card-description` | attribute, on an element inside | — | The description `describe` points to. |
|
|
189
|
+
| `link` | property (read-only) | — | The link the card navigates through. |
|
|
190
|
+
|
|
191
|
+
The whole card is outlined while its link has keyboard focus (`:has(:focus-visible)`). In browsers without `:has()`, the link keeps its own focus ring.
|
|
192
|
+
|
|
193
|
+
<details>
|
|
194
|
+
<summary>CSS variables</summary>
|
|
195
|
+
|
|
196
|
+
| Variable | Default |
|
|
197
|
+
| --- | --- |
|
|
198
|
+
| `--a11y-card-link-focus-outline-color` | `#2563eb` |
|
|
199
|
+
| `--a11y-card-link-focus-outline-offset` | `2px` |
|
|
200
|
+
| `--a11y-card-link-focus-outline-width` | `2px` |
|
|
201
|
+
|
|
202
|
+
</details>
|
|
203
|
+
|
|
164
204
|
#### `a11y-checkbox`
|
|
165
205
|
|
|
166
206
|
Wraps a real `<input type="checkbox">` in a `<label>` with a visible label text. The input stays yours: `name`, `checked`, `disabled`, `required` are plain HTML attributes on it.
|
|
@@ -350,6 +390,8 @@ The hint and error use the [shared field variables](#a11y-input).
|
|
|
350
390
|
|
|
351
391
|
Makes a non-button element behave like a button: `role="button"`, `tabindex="0"`, and Enter/Space fire a real `click`, so one `click` listener covers mouse and keyboard. Prefer a real `<button>` whenever you can.
|
|
352
392
|
|
|
393
|
+
It's for **actions**. Cards that go to another page should use [`<a11y-card-link>`](#a11y-card-link) or a plain `<a href>`: a button role, Space activation and no `href` mislead screen-reader users and break "Open in new tab".
|
|
394
|
+
|
|
353
395
|
```html
|
|
354
396
|
<a11y-focusable aria-label="Expand menu">
|
|
355
397
|
<svg aria-hidden="true">…</svg> Menu
|
|
@@ -920,6 +962,7 @@ No attributes or CSS variables. The class `a11y-visually-hidden` is also usable
|
|
|
920
962
|
* **Before the element is defined** (lazy-loaded bundles), setting `.open = true`, `onClose` or any other property works: it's applied once the element upgrades. `setAttribute('open', '')` works too.
|
|
921
963
|
* **Events:** `a11y-overlay-open` and `a11y-overlay-close` fire on `document`, with `event.detail.name` set to the tag name.
|
|
922
964
|
* **`dismissAllOverlays()`** closes every open overlay (e.g. on navigation). It's exported from `a11y-elements/core` and from every overlay's `define.js`.
|
|
965
|
+
* **Except `<a11y-floating>`**, which is visible by default and has no `open`: `dismissAllOverlays()` only collapses its expanded panel. See [`a11y-floating`](#a11y-floating).
|
|
923
966
|
* **Body mounting:** every overlay (including the snackbar and notification-banner regions) moves itself to `<body>` when connected, so a `position: fixed` layer isn't clipped by an ancestor. See [Overlays in a framework](#overlays-in-a-framework) below.
|
|
924
967
|
|
|
925
968
|
##### Overlays in a framework
|
|
@@ -1171,6 +1214,89 @@ From the shared [dialog](#dialogs) options, only `dialog-label` and `onClose` ap
|
|
|
1171
1214
|
|
|
1172
1215
|
</details>
|
|
1173
1216
|
|
|
1217
|
+
#### `a11y-floating`
|
|
1218
|
+
|
|
1219
|
+
Content pinned to a corner or edge of the viewport: a floating button that opens a drawer, an info bubble, a help launcher. It's visible by default: there's no `open` attribute. Hide it with `hidden` or `dismiss()`. Several in the same position stack instead of overlapping.
|
|
1220
|
+
|
|
1221
|
+
It works in one of two modes:
|
|
1222
|
+
|
|
1223
|
+
* **Controls mode:** with `controls="<id>"`, its trigger opens and closes that overlay. The trigger is a `[data-floating-trigger]` child, else the first button. It gets `aria-controls`, an `aria-expanded` kept in sync with the overlay however it closes, and `aria-haspopup` (`dialog` for a modal, drawer, emergency dialog or `interactive` popover; `menu` for a dropdown or context menu). A popover or dropdown with no anchor is anchored to the trigger.
|
|
1224
|
+
* **Expandable mode:** with `expandable`, its content goes into a panel (`role="dialog"`, not modal) that a launcher button expands. The launcher is a `[data-floating-trigger]` child, else a generated button showing `label`. Expanding moves focus to the panel's first control. Escape, a click outside, the panel's × or the launcher collapse it, and focus returns to the launcher. The panel is named by `panel-label`, else its first heading, else `label`.
|
|
1225
|
+
|
|
1226
|
+
```html
|
|
1227
|
+
<!-- Opens a drawer -->
|
|
1228
|
+
<a11y-floating controls="nav-drawer"><button>Menu</button></a11y-floating>
|
|
1229
|
+
<a11y-drawer id="nav-drawer"><h2>Navigation</h2>…</a11y-drawer>
|
|
1230
|
+
|
|
1231
|
+
<!-- Info bubble -->
|
|
1232
|
+
<a11y-floating position="bottom-left" label="What's new" dismissible hide-on-scroll>
|
|
1233
|
+
<p>Dark mode is here.</p>
|
|
1234
|
+
</a11y-floating>
|
|
1235
|
+
|
|
1236
|
+
<!-- Help panel -->
|
|
1237
|
+
<a11y-floating expandable label="Help">
|
|
1238
|
+
<h2>Need help?</h2>
|
|
1239
|
+
<a href="/faq">Read the FAQ</a>
|
|
1240
|
+
</a11y-floating>
|
|
1241
|
+
```
|
|
1242
|
+
|
|
1243
|
+
| Name | Kind | Default | Description |
|
|
1244
|
+
| --- | --- | --- | --- |
|
|
1245
|
+
| `position` | attribute / property | `bottom-right` | `top`, `bottom`, `top-left`, `top-right`, `bottom-left` or `bottom-right`. |
|
|
1246
|
+
| `controls` | attribute | — | Id of the overlay its trigger toggles. |
|
|
1247
|
+
| `controlsElement` | property | — | The same, as an element. |
|
|
1248
|
+
| `expandable` | attribute | absent | Expandable mode. Ignored with `controls`. |
|
|
1249
|
+
| `expanded` | attribute / property | absent | Whether the panel is expanded. `expand()`, `collapse()` and `toggle()` set it. |
|
|
1250
|
+
| `label` | attribute | — | Text of the generated launcher. Outside expandable mode, makes the element a `role="region"` landmark with this name. |
|
|
1251
|
+
| `panel-label` | attribute | first heading | Accessible name of the panel. |
|
|
1252
|
+
| `close-label` | attribute | `Close dialog` | Accessible name of the panel's × button. See [Translating built-in strings](#translating-built-in-strings). |
|
|
1253
|
+
| `trap-focus` | attribute | absent | Traps focus in the expanded panel. |
|
|
1254
|
+
| `dismissible` | attribute | absent | Adds a × button that calls `dismiss()`. |
|
|
1255
|
+
| `dismiss-label` | attribute | `Dismiss` | Accessible name of that button. See [Translating built-in strings](#translating-built-in-strings). |
|
|
1256
|
+
| `announce` | attribute | absent | Makes the element a polite `role="status"` live region, so content shown with `show()` is announced. |
|
|
1257
|
+
| `hide-on-scroll` | attribute | absent | Slides it out of view while the page scrolls down and back on scroll up. It stays in the Tab order and comes back when focused. |
|
|
1258
|
+
| `scroll-threshold` | attribute | `16` | Pixels of scrolling before `hide-on-scroll` reacts. |
|
|
1259
|
+
| `dismiss()` | method | — | Fires a cancelable `a11y-floating-dismiss` event, then animates out and sets `hidden`. Focus goes back to where it was before it entered. |
|
|
1260
|
+
| `show()` | method | — | Shows it again (`hidden = false`). |
|
|
1261
|
+
| `onClose` | callback | — | Called when the panel collapses or the element is dismissed. |
|
|
1262
|
+
|
|
1263
|
+
Events on the element: `a11y-floating-expand`, `a11y-floating-collapse`, `a11y-floating-dismiss` (cancelable). The panel also fires `a11y-overlay-open` / `a11y-overlay-close` on `document`, and `dismissAllOverlays()` collapses it but leaves the element showing. Like every overlay it moves itself out of where it was authored (into `.a11y-floating-stack[data-position]` on `<body>`); see [Overlays in a framework](#overlays-in-a-framework) for `removeOverlaysWithin()`. Being last in `<body>`, it comes last in the Tab order.
|
|
1264
|
+
|
|
1265
|
+
Classes: `.a11y-floating-launcher`, `.a11y-floating-panel`, `.a11y-floating-panel-close`, `.a11y-floating-dismiss`. The element itself has no background, so style your bubble's content directly.
|
|
1266
|
+
|
|
1267
|
+
<details>
|
|
1268
|
+
<summary>CSS variables</summary>
|
|
1269
|
+
|
|
1270
|
+
Offsets add the device's safe-area inset (`env(safe-area-inset-*)`). The stacking order comes from `--a11y-z-floating-button` (see [Shared tokens](#shared-tokens)).
|
|
1271
|
+
|
|
1272
|
+
| Variable | Default |
|
|
1273
|
+
| --- | --- |
|
|
1274
|
+
| `--a11y-floating-close-font-size` | `1.25rem` |
|
|
1275
|
+
| `--a11y-floating-content-gap` | `0.5rem` |
|
|
1276
|
+
| `--a11y-floating-gap` | `0.75rem` |
|
|
1277
|
+
| `--a11y-floating-launcher-border-radius` | `999px` |
|
|
1278
|
+
| `--a11y-floating-launcher-color-background` | `#111827` |
|
|
1279
|
+
| `--a11y-floating-launcher-color-text` | `#ffffff` |
|
|
1280
|
+
| `--a11y-floating-launcher-padding` | `0 1rem` |
|
|
1281
|
+
| `--a11y-floating-launcher-size` | `3rem` |
|
|
1282
|
+
| `--a11y-floating-max-width` | `calc(100vw - 2rem)` |
|
|
1283
|
+
| `--a11y-floating-offset` | `1rem` |
|
|
1284
|
+
| `--a11y-floating-offset-x` / `--a11y-floating-offset-y` | `--a11y-floating-offset` |
|
|
1285
|
+
| `--a11y-floating-panel-border-radius` | `0.5rem` |
|
|
1286
|
+
| `--a11y-floating-panel-color-background` | `#ffffff` |
|
|
1287
|
+
| `--a11y-floating-panel-color-text` | `#111827` |
|
|
1288
|
+
| `--a11y-floating-panel-initial-scale` | `0.97` |
|
|
1289
|
+
| `--a11y-floating-panel-max-height` | `min(480px, 70vh)` |
|
|
1290
|
+
| `--a11y-floating-panel-offset` | `0.5rem` |
|
|
1291
|
+
| `--a11y-floating-panel-padding` | `1rem` |
|
|
1292
|
+
| `--a11y-floating-panel-shadow-blur` | `10px` |
|
|
1293
|
+
| `--a11y-floating-panel-shadow-fade` | `80%` |
|
|
1294
|
+
| `--a11y-floating-panel-shadow-offset-y` | `2px` |
|
|
1295
|
+
| `--a11y-floating-panel-width` | `min(320px, calc(100vw - 2rem))` |
|
|
1296
|
+
| `--a11y-floating-transition-duration` | `0.2s` |
|
|
1297
|
+
|
|
1298
|
+
</details>
|
|
1299
|
+
|
|
1174
1300
|
#### `a11y-modal`
|
|
1175
1301
|
|
|
1176
1302
|
A centered dialog. Your content is its children. See [Dialogs](#dialogs).
|
|
@@ -1336,10 +1462,12 @@ Toast notifications that dismiss themselves: after 3 s by default, or 10 s when
|
|
|
1336
1462
|
|
|
1337
1463
|
```js
|
|
1338
1464
|
import { notify } from 'a11y-elements/overlays/snackbar';
|
|
1465
|
+
import { raw } from 'a11y-elements/core';
|
|
1339
1466
|
|
|
1340
1467
|
notify('Saved');
|
|
1341
1468
|
notify('Upload failed', { type: 'error', actionText: 'Retry', onAction: retryUpload });
|
|
1342
1469
|
notify('Copied to clipboard', { position: 'top', duration: 1500 });
|
|
1470
|
+
notify(raw('Saved. <a href="/files">View files</a>')); // markup: sanitized, see below
|
|
1343
1471
|
```
|
|
1344
1472
|
|
|
1345
1473
|
| Name | Kind | Default | Description |
|
|
@@ -1350,6 +1478,8 @@ notify('Copied to clipboard', { position: 'top', duration: 1500 });
|
|
|
1350
1478
|
|
|
1351
1479
|
It's a page region, not an open/close overlay: it fires no open/close events and `dismissAllOverlays()` leaves it alone. Like every overlay it moves itself to `<body>`; see [Overlays in a framework](#overlays-in-a-framework) for `removeOverlaysWithin()`.
|
|
1352
1480
|
|
|
1481
|
+
A `message` is text: a string is escaped. For markup, pass `raw(markup)` from `a11y-elements/core`. It's sanitized (no scripts, styles, event handlers or `javascript:` URLs), so it's safe with user data in it. `trustedRaw(markup)` skips that, for markup you wrote yourself. The same goes for `<a11y-notification-banner>`.
|
|
1482
|
+
|
|
1353
1483
|
`notify()` options (method and convenience export):
|
|
1354
1484
|
|
|
1355
1485
|
| Option | Default | Description |
|
package/dist/a11y.css
CHANGED
|
@@ -530,6 +530,16 @@ a11y-anchor {
|
|
|
530
530
|
display: contents;
|
|
531
531
|
}
|
|
532
532
|
|
|
533
|
+
/* src/components/card-link/card-link.css */
|
|
534
|
+
a11y-card-link {
|
|
535
|
+
display: block;
|
|
536
|
+
cursor: pointer;
|
|
537
|
+
}
|
|
538
|
+
a11y-card-link:has(a[href]:focus-visible) {
|
|
539
|
+
outline: var(--a11y-card-link-focus-outline-width, 2px) solid var(--a11y-card-link-focus-outline-color, #2563eb);
|
|
540
|
+
outline-offset: var(--a11y-card-link-focus-outline-offset, 2px);
|
|
541
|
+
}
|
|
542
|
+
|
|
533
543
|
/* src/core/field.css */
|
|
534
544
|
a11y-hint,
|
|
535
545
|
a11y-error,
|
|
@@ -1183,6 +1193,160 @@ a11y-context-menu {
|
|
|
1183
1193
|
padding: var(--a11y-context-menu-content-padding, 0.25rem 0);
|
|
1184
1194
|
}
|
|
1185
1195
|
|
|
1196
|
+
/* src/overlays/floating/floating.css */
|
|
1197
|
+
.a11y-floating-stack {
|
|
1198
|
+
position: fixed;
|
|
1199
|
+
z-index: var(--a11y-z-floating-button, 120);
|
|
1200
|
+
display: flex;
|
|
1201
|
+
flex-direction: column;
|
|
1202
|
+
gap: var(--a11y-floating-gap, 0.75rem);
|
|
1203
|
+
pointer-events: none;
|
|
1204
|
+
}
|
|
1205
|
+
.a11y-floating-stack > * {
|
|
1206
|
+
pointer-events: auto;
|
|
1207
|
+
}
|
|
1208
|
+
.a11y-floating-stack[data-position^=top] {
|
|
1209
|
+
top: calc(var(--a11y-floating-offset-y, var(--a11y-floating-offset, 1rem)) + env(safe-area-inset-top, 0px));
|
|
1210
|
+
}
|
|
1211
|
+
.a11y-floating-stack[data-position^=bottom] {
|
|
1212
|
+
bottom: calc(var(--a11y-floating-offset-y, var(--a11y-floating-offset, 1rem)) + env(safe-area-inset-bottom, 0px));
|
|
1213
|
+
flex-direction: column-reverse;
|
|
1214
|
+
}
|
|
1215
|
+
.a11y-floating-stack[data-position$=left] {
|
|
1216
|
+
left: calc(var(--a11y-floating-offset-x, var(--a11y-floating-offset, 1rem)) + env(safe-area-inset-left, 0px));
|
|
1217
|
+
align-items: flex-start;
|
|
1218
|
+
}
|
|
1219
|
+
.a11y-floating-stack[data-position$=right] {
|
|
1220
|
+
right: calc(var(--a11y-floating-offset-x, var(--a11y-floating-offset, 1rem)) + env(safe-area-inset-right, 0px));
|
|
1221
|
+
align-items: flex-end;
|
|
1222
|
+
}
|
|
1223
|
+
.a11y-floating-stack[data-position=top],
|
|
1224
|
+
.a11y-floating-stack[data-position=bottom] {
|
|
1225
|
+
left: 50%;
|
|
1226
|
+
transform: translateX(-50%);
|
|
1227
|
+
align-items: center;
|
|
1228
|
+
}
|
|
1229
|
+
a11y-floating {
|
|
1230
|
+
position: relative;
|
|
1231
|
+
display: flex;
|
|
1232
|
+
align-items: flex-start;
|
|
1233
|
+
gap: var(--a11y-floating-content-gap, 0.5rem);
|
|
1234
|
+
max-width: var(--a11y-floating-max-width, calc(100vw - 2rem));
|
|
1235
|
+
transition: opacity var(--a11y-floating-transition-duration, 0.2s) ease, transform var(--a11y-floating-transition-duration, 0.2s) ease;
|
|
1236
|
+
}
|
|
1237
|
+
a11y-floating[hidden] {
|
|
1238
|
+
display: none;
|
|
1239
|
+
}
|
|
1240
|
+
a11y-floating.a11y-is-dismissing {
|
|
1241
|
+
opacity: 0;
|
|
1242
|
+
transform: scale(0.95);
|
|
1243
|
+
}
|
|
1244
|
+
a11y-floating.a11y-floating--scrolled-away {
|
|
1245
|
+
opacity: 0;
|
|
1246
|
+
pointer-events: none;
|
|
1247
|
+
}
|
|
1248
|
+
.a11y-floating-stack[data-position^=bottom] > a11y-floating.a11y-floating--scrolled-away {
|
|
1249
|
+
transform: translateY(calc(100% + var(--a11y-floating-offset-y, var(--a11y-floating-offset, 1rem))));
|
|
1250
|
+
}
|
|
1251
|
+
.a11y-floating-stack[data-position^=top] > a11y-floating.a11y-floating--scrolled-away {
|
|
1252
|
+
transform: translateY(calc(-100% - var(--a11y-floating-offset-y, var(--a11y-floating-offset, 1rem))));
|
|
1253
|
+
}
|
|
1254
|
+
.a11y-floating-launcher {
|
|
1255
|
+
min-width: var(--a11y-floating-launcher-size, 3rem);
|
|
1256
|
+
min-height: var(--a11y-floating-launcher-size, 3rem);
|
|
1257
|
+
padding: var(--a11y-floating-launcher-padding, 0 1rem);
|
|
1258
|
+
border: none;
|
|
1259
|
+
border-radius: var(--a11y-floating-launcher-border-radius, 999px);
|
|
1260
|
+
background: var(--a11y-floating-launcher-color-background, #111827);
|
|
1261
|
+
color: var(--a11y-floating-launcher-color-text, #ffffff);
|
|
1262
|
+
font: inherit;
|
|
1263
|
+
cursor: pointer;
|
|
1264
|
+
box-shadow: 0 2px 10px rgb(0 0 0 / 20%);
|
|
1265
|
+
}
|
|
1266
|
+
.a11y-floating-panel {
|
|
1267
|
+
position: absolute;
|
|
1268
|
+
width: var(--a11y-floating-panel-width, min(320px, calc(100vw - 2rem)));
|
|
1269
|
+
max-height: var(--a11y-floating-panel-max-height, min(480px, 70vh));
|
|
1270
|
+
overflow-y: auto;
|
|
1271
|
+
box-sizing: border-box;
|
|
1272
|
+
padding: var(--a11y-floating-panel-padding, 1rem);
|
|
1273
|
+
background: var(--a11y-floating-panel-color-background, #ffffff);
|
|
1274
|
+
color: var(--a11y-floating-panel-color-text, #111827);
|
|
1275
|
+
border-radius: var(--a11y-floating-panel-border-radius, 0.5rem);
|
|
1276
|
+
box-shadow: 0 var(--a11y-floating-panel-shadow-offset-y, 2px) var(--a11y-floating-panel-shadow-blur, 10px) color-mix(in srgb, var(--a11y-floating-panel-color-text, #111827), transparent var(--a11y-floating-panel-shadow-fade, 80%));
|
|
1277
|
+
opacity: 0;
|
|
1278
|
+
transform: scale(var(--a11y-floating-panel-initial-scale, 0.97));
|
|
1279
|
+
transition: opacity var(--a11y-floating-transition-duration, 0.2s) ease, transform var(--a11y-floating-transition-duration, 0.2s) ease;
|
|
1280
|
+
}
|
|
1281
|
+
.a11y-floating-panel.a11y-is-open {
|
|
1282
|
+
opacity: 1;
|
|
1283
|
+
transform: scale(1);
|
|
1284
|
+
}
|
|
1285
|
+
.a11y-floating-panel[hidden] {
|
|
1286
|
+
display: none;
|
|
1287
|
+
}
|
|
1288
|
+
.a11y-floating-stack[data-position^=bottom] .a11y-floating-panel {
|
|
1289
|
+
bottom: calc(100% + var(--a11y-floating-panel-offset, 0.5rem));
|
|
1290
|
+
}
|
|
1291
|
+
.a11y-floating-stack[data-position^=top] .a11y-floating-panel {
|
|
1292
|
+
top: calc(100% + var(--a11y-floating-panel-offset, 0.5rem));
|
|
1293
|
+
}
|
|
1294
|
+
.a11y-floating-stack[data-position$=right] .a11y-floating-panel {
|
|
1295
|
+
right: 0;
|
|
1296
|
+
transform-origin: right;
|
|
1297
|
+
}
|
|
1298
|
+
.a11y-floating-stack[data-position$=left] .a11y-floating-panel {
|
|
1299
|
+
left: 0;
|
|
1300
|
+
transform-origin: left;
|
|
1301
|
+
}
|
|
1302
|
+
.a11y-floating-stack[data-position=top] .a11y-floating-panel,
|
|
1303
|
+
.a11y-floating-stack[data-position=bottom] .a11y-floating-panel {
|
|
1304
|
+
left: calc(50% - var(--a11y-floating-panel-width, min(320px, calc(100vw - 2rem))) / 2);
|
|
1305
|
+
}
|
|
1306
|
+
.a11y-floating-stack[data-position^=bottom] .a11y-floating-panel {
|
|
1307
|
+
transform-origin: bottom;
|
|
1308
|
+
}
|
|
1309
|
+
.a11y-floating-stack[data-position^=top] .a11y-floating-panel {
|
|
1310
|
+
transform-origin: top;
|
|
1311
|
+
}
|
|
1312
|
+
.a11y-floating-stack[data-position=bottom-right] .a11y-floating-panel {
|
|
1313
|
+
transform-origin: bottom right;
|
|
1314
|
+
}
|
|
1315
|
+
.a11y-floating-stack[data-position=bottom-left] .a11y-floating-panel {
|
|
1316
|
+
transform-origin: bottom left;
|
|
1317
|
+
}
|
|
1318
|
+
.a11y-floating-stack[data-position=top-right] .a11y-floating-panel {
|
|
1319
|
+
transform-origin: top right;
|
|
1320
|
+
}
|
|
1321
|
+
.a11y-floating-stack[data-position=top-left] .a11y-floating-panel {
|
|
1322
|
+
transform-origin: top left;
|
|
1323
|
+
}
|
|
1324
|
+
.a11y-floating-panel-close {
|
|
1325
|
+
float: right;
|
|
1326
|
+
margin: -0.5rem -0.5rem 0 0.5rem;
|
|
1327
|
+
}
|
|
1328
|
+
.a11y-floating-panel-close,
|
|
1329
|
+
.a11y-floating-dismiss {
|
|
1330
|
+
min-width: 1.5rem;
|
|
1331
|
+
min-height: 1.5rem;
|
|
1332
|
+
padding: 0;
|
|
1333
|
+
border: none;
|
|
1334
|
+
background: transparent;
|
|
1335
|
+
color: inherit;
|
|
1336
|
+
font-size: var(--a11y-floating-close-font-size, 1.25rem);
|
|
1337
|
+
line-height: 1;
|
|
1338
|
+
cursor: pointer;
|
|
1339
|
+
}
|
|
1340
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1341
|
+
a11y-floating,
|
|
1342
|
+
a11y-floating.a11y-is-dismissing,
|
|
1343
|
+
.a11y-floating-stack > a11y-floating.a11y-floating--scrolled-away,
|
|
1344
|
+
.a11y-floating-panel,
|
|
1345
|
+
.a11y-floating-panel.a11y-is-open {
|
|
1346
|
+
transform: none;
|
|
1347
|
+
}
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1186
1350
|
/* src/overlays/blocking-loader/blocking-loader.css */
|
|
1187
1351
|
.a11y-blocking-loader-overlay {
|
|
1188
1352
|
position: fixed;
|
package/dist/all.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers every element at once — `import 'a11y-elements/all'`, or
|
|
3
|
+
* `dist/browser/all.js` for zero-build use — and re-exports what each
|
|
4
|
+
* element's own entry does. Per-element entries stay the way to load only
|
|
5
|
+
* what you use.
|
|
6
|
+
*/
|
|
7
|
+
export { AnchorElement } from './components/anchor/define.js';
|
|
8
|
+
export { AvatarElement } from './components/avatar/define.js';
|
|
9
|
+
export { CardLinkElement } from './components/card-link/define.js';
|
|
10
|
+
export { CheckboxGroupElement } from './components/checkbox-group/define.js';
|
|
11
|
+
export { CheckboxElement } from './components/checkbox/define.js';
|
|
12
|
+
export { FileInputElement } from './components/file-input/define.js';
|
|
13
|
+
export { FocusableElement } from './components/focusable/define.js';
|
|
14
|
+
export { InputElement } from './components/input/define.js';
|
|
15
|
+
export { LabelElement } from './components/label/define.js';
|
|
16
|
+
export { PictureElement } from './components/picture/define.js';
|
|
17
|
+
export type { PictureImage, PictureSource } from './components/picture/define.js';
|
|
18
|
+
export { ProgressElement } from './components/progress/define.js';
|
|
19
|
+
export { RadioGroupElement } from './components/radio-group/define.js';
|
|
20
|
+
export { SelectElement } from './components/select/define.js';
|
|
21
|
+
export { SkeletonElement } from './components/skeleton/define.js';
|
|
22
|
+
export { SpinnerElement } from './components/spinner/define.js';
|
|
23
|
+
export { SwitchElement } from './components/switch/define.js';
|
|
24
|
+
export { TextareaElement } from './components/textarea/define.js';
|
|
25
|
+
export { VisuallyHiddenElement } from './components/visually-hidden/define.js';
|
|
26
|
+
export { BlockingLoaderElement } from './overlays/blocking-loader/define.js';
|
|
27
|
+
export { ContextMenuElement } from './overlays/context-menu/define.js';
|
|
28
|
+
export { DrawerElement } from './overlays/drawer/define.js';
|
|
29
|
+
export { DropdownElement } from './overlays/dropdown/define.js';
|
|
30
|
+
export { EmergencyDialogElement } from './overlays/emergency-dialog/define.js';
|
|
31
|
+
export { FloatingElement } from './overlays/floating/define.js';
|
|
32
|
+
export { ModalElement } from './overlays/modal/define.js';
|
|
33
|
+
export { NotificationBannerElement, type NotificationBannerOptions, showNotificationBanner } from './overlays/notification-banner/define.js';
|
|
34
|
+
export { PopoverElement } from './overlays/popover/define.js';
|
|
35
|
+
export { SnackbarElement, type NotifyOptions, notify } from './overlays/snackbar/define.js';
|
|
36
|
+
export { TooltipElement } from './overlays/tooltip/define.js';
|
|
37
|
+
export * from './overlays/core/zero-build-exports.js';
|
|
38
|
+
export { bindField } from './core/field.js';
|
package/dist/all.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers every element at once — `import 'a11y-elements/all'`, or
|
|
3
|
+
* `dist/browser/all.js` for zero-build use — and re-exports what each
|
|
4
|
+
* element's own entry does. Per-element entries stay the way to load only
|
|
5
|
+
* what you use.
|
|
6
|
+
*/
|
|
7
|
+
export { AnchorElement } from './components/anchor/define.js';
|
|
8
|
+
export { AvatarElement } from './components/avatar/define.js';
|
|
9
|
+
export { CardLinkElement } from './components/card-link/define.js';
|
|
10
|
+
export { CheckboxGroupElement } from './components/checkbox-group/define.js';
|
|
11
|
+
export { CheckboxElement } from './components/checkbox/define.js';
|
|
12
|
+
export { FileInputElement } from './components/file-input/define.js';
|
|
13
|
+
export { FocusableElement } from './components/focusable/define.js';
|
|
14
|
+
export { InputElement } from './components/input/define.js';
|
|
15
|
+
export { LabelElement } from './components/label/define.js';
|
|
16
|
+
export { PictureElement } from './components/picture/define.js';
|
|
17
|
+
export { ProgressElement } from './components/progress/define.js';
|
|
18
|
+
export { RadioGroupElement } from './components/radio-group/define.js';
|
|
19
|
+
export { SelectElement } from './components/select/define.js';
|
|
20
|
+
export { SkeletonElement } from './components/skeleton/define.js';
|
|
21
|
+
export { SpinnerElement } from './components/spinner/define.js';
|
|
22
|
+
export { SwitchElement } from './components/switch/define.js';
|
|
23
|
+
export { TextareaElement } from './components/textarea/define.js';
|
|
24
|
+
export { VisuallyHiddenElement } from './components/visually-hidden/define.js';
|
|
25
|
+
export { BlockingLoaderElement } from './overlays/blocking-loader/define.js';
|
|
26
|
+
export { ContextMenuElement } from './overlays/context-menu/define.js';
|
|
27
|
+
export { DrawerElement } from './overlays/drawer/define.js';
|
|
28
|
+
export { DropdownElement } from './overlays/dropdown/define.js';
|
|
29
|
+
export { EmergencyDialogElement } from './overlays/emergency-dialog/define.js';
|
|
30
|
+
export { FloatingElement } from './overlays/floating/define.js';
|
|
31
|
+
export { ModalElement } from './overlays/modal/define.js';
|
|
32
|
+
export { NotificationBannerElement, showNotificationBanner } from './overlays/notification-banner/define.js';
|
|
33
|
+
export { PopoverElement } from './overlays/popover/define.js';
|
|
34
|
+
export { SnackbarElement, notify } from './overlays/snackbar/define.js';
|
|
35
|
+
export { TooltipElement } from './overlays/tooltip/define.js';
|
|
36
|
+
export * from './overlays/core/zero-build-exports.js';
|
|
37
|
+
export { bindField } from './core/field.js';
|
|
38
|
+
//# sourceMappingURL=all.js.map
|
package/dist/all.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"all.js","sourceRoot":"","sources":["../src/all.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAkC,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAC7I,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAsB,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ModalElement
|
|
3
|
+
} from "./chunk-GH53G7MU.js";
|
|
4
|
+
import {
|
|
5
|
+
NotificationBannerElement,
|
|
6
|
+
showNotificationBanner
|
|
7
|
+
} from "./chunk-EAASMTBS.js";
|
|
8
|
+
import {
|
|
9
|
+
PopoverElement
|
|
10
|
+
} from "./chunk-ZMCETLOQ.js";
|
|
11
|
+
import {
|
|
12
|
+
SnackbarElement,
|
|
13
|
+
notify
|
|
14
|
+
} from "./chunk-FXHJKL3U.js";
|
|
15
|
+
import "./chunk-P42KF3NM.js";
|
|
16
|
+
import {
|
|
17
|
+
TooltipElement
|
|
18
|
+
} from "./chunk-2YF57VSU.js";
|
|
19
|
+
import {
|
|
20
|
+
TextareaElement
|
|
21
|
+
} from "./chunk-HLID3PP5.js";
|
|
22
|
+
import {
|
|
23
|
+
VisuallyHiddenElement
|
|
24
|
+
} from "./chunk-3RRJOPEF.js";
|
|
25
|
+
import {
|
|
26
|
+
BlockingLoaderElement
|
|
27
|
+
} from "./chunk-4IURHUQU.js";
|
|
28
|
+
import {
|
|
29
|
+
ContextMenuElement
|
|
30
|
+
} from "./chunk-A32U5MX7.js";
|
|
31
|
+
import {
|
|
32
|
+
DrawerElement
|
|
33
|
+
} from "./chunk-3UC2S6JJ.js";
|
|
34
|
+
import {
|
|
35
|
+
DropdownElement
|
|
36
|
+
} from "./chunk-GUKQIHPM.js";
|
|
37
|
+
import "./chunk-UCAUEEED.js";
|
|
38
|
+
import "./chunk-O4AJULBZ.js";
|
|
39
|
+
import {
|
|
40
|
+
EmergencyDialogElement
|
|
41
|
+
} from "./chunk-A5CV54CT.js";
|
|
42
|
+
import "./chunk-NTNPE4TH.js";
|
|
43
|
+
import "./chunk-6Q6VW435.js";
|
|
44
|
+
import {
|
|
45
|
+
FloatingElement
|
|
46
|
+
} from "./chunk-4FHDXZ3L.js";
|
|
47
|
+
import "./chunk-F47DDMFE.js";
|
|
48
|
+
import "./chunk-TTP33GXU.js";
|
|
49
|
+
import {
|
|
50
|
+
dismissAllOverlays,
|
|
51
|
+
removeOverlaysWithin
|
|
52
|
+
} from "./chunk-ACOSO5NE.js";
|
|
53
|
+
import {
|
|
54
|
+
LabelElement
|
|
55
|
+
} from "./chunk-ABTLBDUK.js";
|
|
56
|
+
import {
|
|
57
|
+
PictureElement
|
|
58
|
+
} from "./chunk-QT7Z23GS.js";
|
|
59
|
+
import {
|
|
60
|
+
ProgressElement
|
|
61
|
+
} from "./chunk-S7GPESLQ.js";
|
|
62
|
+
import {
|
|
63
|
+
RadioGroupElement
|
|
64
|
+
} from "./chunk-SYKTM7WJ.js";
|
|
65
|
+
import {
|
|
66
|
+
SelectElement
|
|
67
|
+
} from "./chunk-I4KOJO4B.js";
|
|
68
|
+
import {
|
|
69
|
+
SkeletonElement
|
|
70
|
+
} from "./chunk-R4OVZULJ.js";
|
|
71
|
+
import {
|
|
72
|
+
SpinnerElement
|
|
73
|
+
} from "./chunk-KUTHJLZ5.js";
|
|
74
|
+
import {
|
|
75
|
+
SwitchElement
|
|
76
|
+
} from "./chunk-HPTH4SJ2.js";
|
|
77
|
+
import {
|
|
78
|
+
AnchorElement
|
|
79
|
+
} from "./chunk-HGPHWR3R.js";
|
|
80
|
+
import {
|
|
81
|
+
AvatarElement
|
|
82
|
+
} from "./chunk-SIQUYA37.js";
|
|
83
|
+
import {
|
|
84
|
+
CardLinkElement
|
|
85
|
+
} from "./chunk-GDJTILU4.js";
|
|
86
|
+
import {
|
|
87
|
+
CheckboxElement
|
|
88
|
+
} from "./chunk-GKNBHWGY.js";
|
|
89
|
+
import {
|
|
90
|
+
CheckboxGroupElement
|
|
91
|
+
} from "./chunk-VY6BZLCJ.js";
|
|
92
|
+
import {
|
|
93
|
+
FileInputElement
|
|
94
|
+
} from "./chunk-6BOK3R6K.js";
|
|
95
|
+
import {
|
|
96
|
+
FocusableElement
|
|
97
|
+
} from "./chunk-LQ34M47I.js";
|
|
98
|
+
import {
|
|
99
|
+
InputElement
|
|
100
|
+
} from "./chunk-ISWQOJT7.js";
|
|
101
|
+
import {
|
|
102
|
+
bindField
|
|
103
|
+
} from "./chunk-NI7PACR4.js";
|
|
104
|
+
import "./chunk-4KU26VOY.js";
|
|
105
|
+
import "./chunk-CXUZEGZY.js";
|
|
106
|
+
import "./chunk-FAEA66RR.js";
|
|
107
|
+
import {
|
|
108
|
+
resetStrings,
|
|
109
|
+
setStrings
|
|
110
|
+
} from "./chunk-46SIA3RI.js";
|
|
111
|
+
export {
|
|
112
|
+
AnchorElement,
|
|
113
|
+
AvatarElement,
|
|
114
|
+
BlockingLoaderElement,
|
|
115
|
+
CardLinkElement,
|
|
116
|
+
CheckboxElement,
|
|
117
|
+
CheckboxGroupElement,
|
|
118
|
+
ContextMenuElement,
|
|
119
|
+
DrawerElement,
|
|
120
|
+
DropdownElement,
|
|
121
|
+
EmergencyDialogElement,
|
|
122
|
+
FileInputElement,
|
|
123
|
+
FloatingElement,
|
|
124
|
+
FocusableElement,
|
|
125
|
+
InputElement,
|
|
126
|
+
LabelElement,
|
|
127
|
+
ModalElement,
|
|
128
|
+
NotificationBannerElement,
|
|
129
|
+
PictureElement,
|
|
130
|
+
PopoverElement,
|
|
131
|
+
ProgressElement,
|
|
132
|
+
RadioGroupElement,
|
|
133
|
+
SelectElement,
|
|
134
|
+
SkeletonElement,
|
|
135
|
+
SnackbarElement,
|
|
136
|
+
SpinnerElement,
|
|
137
|
+
SwitchElement,
|
|
138
|
+
TextareaElement,
|
|
139
|
+
TooltipElement,
|
|
140
|
+
VisuallyHiddenElement,
|
|
141
|
+
bindField,
|
|
142
|
+
dismissAllOverlays,
|
|
143
|
+
notify,
|
|
144
|
+
removeOverlaysWithin,
|
|
145
|
+
resetStrings,
|
|
146
|
+
setStrings,
|
|
147
|
+
showNotificationBanner
|
|
148
|
+
};
|
|
149
|
+
//# sourceMappingURL=all.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|