@aurodesignsystem/auro-dialog 4.2.0 → 4.2.1
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/CHANGELOG.md +3 -19
- package/README.md +8 -9
- package/demo/accessibility.html +42 -0
- package/demo/accessibility.js +21 -0
- package/demo/accessibility.md +129 -0
- package/demo/accessibility.min.js +3969 -0
- package/demo/api.html +16 -40
- package/demo/api.md +0 -750
- package/demo/customize.html +45 -0
- package/demo/{api.js → customize.js} +2 -14
- package/demo/customize.md +226 -0
- package/demo/customize.min.js +3974 -0
- package/demo/demo-nav.css +32 -0
- package/demo/design.html +42 -0
- package/demo/design.js +23 -0
- package/demo/design.md +306 -0
- package/demo/design.min.js +4041 -0
- package/demo/getting-started.html +38 -0
- package/demo/getting-started.md +295 -0
- package/demo/index.html +17 -36
- package/demo/index.js +2 -3
- package/demo/index.md +220 -144
- package/demo/index.min.js +3984 -7
- package/demo/keyboard-behavior.html +38 -0
- package/demo/keyboard-behavior.md +51 -0
- package/demo/pages.json +1 -0
- package/demo/readme.html +42 -0
- package/demo/readme.js +24 -0
- package/demo/readme.md +176 -0
- package/demo/{auro-dialog.min.js → readme.min.js} +434 -281
- package/demo/support/demo-support.js +140 -0
- package/demo/voiceover.html +38 -0
- package/demo/voiceover.md +19 -0
- package/demo/why-dialog.html +38 -0
- package/demo/why-dialog.md +36 -0
- package/dist/{auro-dialog-CWkXz5VA.js → auro-dialog-T9I85UZL.js} +20 -20
- package/dist/index.d.ts +198 -98
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +6 -6
- package/demo/api.min.js +0 -219
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
## [4.2.1](https://github.com/AlaskaAirlines/auro-dialog/compare/v4.2.0...v4.2.1) (2026-08-18)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* not to close dialog with backdrop click while another floatingUI open AB[#1536579](https://github.com/AlaskaAirlines/auro-dialog/issues/1536579) ([ab2c56b](https://github.com/AlaskaAirlines/auro-dialog/commit/ab2c56ba87fcb1c15f1ac5a6929316035c2f829e))
|
|
9
|
-
* reset scroll lock on disconnectedCallback ([e12bd72](https://github.com/AlaskaAirlines/auro-dialog/commit/e12bd72083d3a7f5b2217b22052c31adbf8e7bc4))
|
|
10
|
-
* restructure to work with floatingUI ([aa06280](https://github.com/AlaskaAirlines/auro-dialog/commit/aa06280a049dc084b6b89f3d75f4dbd99d9e8cff))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
### Features
|
|
14
|
-
|
|
15
|
-
* integrate FloatingUI, native dialog/popover specs, and ::backdrop ([9a8b2c8](https://github.com/AlaskaAirlines/auro-dialog/commit/9a8b2c83724bcecab815f14668b0ce53858d6d8c))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Performance Improvements
|
|
19
|
-
|
|
20
|
-
* bind open to isPopoverVisible ([316b5c6](https://github.com/AlaskaAirlines/auro-dialog/commit/316b5c6cd5173939e1e78fc21e3daa26751b8382))
|
|
21
|
-
* bump engine to be `>=22` ([b71cc31](https://github.com/AlaskaAirlines/auro-dialog/commit/b71cc31168d5803683693799ded109f4aa0477d0))
|
|
22
|
-
* remove scroll lock as floatingUI handles lock ([aeb1992](https://github.com/AlaskaAirlines/auro-dialog/commit/aeb19929bf639c2ddd4a41a9af1e015a1059f9d7))
|
|
23
|
-
* update dependencies ([f138124](https://github.com/AlaskaAirlines/auro-dialog/commit/f13812417a258da0ce35e016966ba27f087f9437))
|
|
6
|
+
* engage focus trap via fallback timer; guard rapid re-open and disconnect AB[#1543191](https://github.com/AlaskaAirlines/auro-dialog/issues/1543191) ([83068e7](https://github.com/AlaskaAirlines/auro-dialog/commit/83068e7258090aaaa0ebccf8b46441e1be447961))
|
|
7
|
+
* update library to suppress Escape keydown for modal AB[#1613688](https://github.com/AlaskaAirlines/auro-dialog/issues/1613688) ([d893a9c](https://github.com/AlaskaAirlines/auro-dialog/commit/d893a9c3b17643bf1d722b82dd75b9fcb1d38432))
|
|
24
8
|
|
|
25
9
|
# Semantic Release Automated Changelog
|
|
26
10
|
|
package/README.md
CHANGED
|
@@ -21,11 +21,9 @@ The following sections are editable by making changes to the following files:
|
|
|
21
21
|
|
|
22
22
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
23
|
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
-
The
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
Auro holds the opinions of the [Nielsen Norman Group](https://www.nngroup.com/articles/modal-nonmodal-dialog/) on dialog and modal use to be true.
|
|
24
|
+
<p>The <code><auro-dialog></code> component is an intrusive interactive component, not passive. The component is best used when there is a requirement the user be made aware of the content being shown, moving focus from the main content to the dialog content.</p>
|
|
25
|
+
<p>The component also supports a modal (blocking) state where the user must interact with the content of the component in order to continue. Passive dismissal of the content is not allowed. Users of this state must add a trigger for the user to move beyond this content.</p>
|
|
26
|
+
<p>Auro holds the opinions of the <a class="hyperlink" href="https://www.nngroup.com/articles/modal-nonmodal-dialog/" target="_blank">Nielsen Norman Group</a> on dialog and modal use to be true.</p>
|
|
29
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
30
28
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
31
29
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
@@ -35,10 +33,11 @@ Auro holds the opinions of the [Nielsen Norman Group](https://www.nngroup.com/ar
|
|
|
35
33
|
|
|
36
34
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
37
35
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
38
|
-
The
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
<p>The <code><auro-dialog></code> component should be used in situations where users may:</p>
|
|
37
|
+
<ul>
|
|
38
|
+
<li>Be prompted to take an action before doing anything else or going back</li>
|
|
39
|
+
<li>Be prompted to view content with the option of closing it</li>
|
|
40
|
+
</ul>
|
|
42
41
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
42
|
|
|
44
43
|
## Install
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
+
See LICENSE in the project root for license information.
|
|
4
|
+
|
|
5
|
+
Demo shell. Content authored in ../docs/pages/accessibility.md → ./accessibility.md.
|
|
6
|
+
Rendered by ./demo-support.js (remark/rehype) with the top page-nav from ./pages.json.
|
|
7
|
+
-->
|
|
8
|
+
<!DOCTYPE html>
|
|
9
|
+
<html lang="en">
|
|
10
|
+
<head>
|
|
11
|
+
<meta charset="UTF-8" />
|
|
12
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
13
|
+
<title>Auro Web Component Demo | auro-dialog | Accessibility</title>
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
|
|
16
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
17
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
18
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
19
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
20
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
|
|
21
|
+
<link rel="stylesheet" type="text/css" href="./demo-nav.css" />
|
|
22
|
+
</head>
|
|
23
|
+
<body class="auro-markdown">
|
|
24
|
+
<main></main>
|
|
25
|
+
|
|
26
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
|
|
29
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
|
|
30
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
|
|
32
|
+
|
|
33
|
+
<script type="module">
|
|
34
|
+
import { renderPage } from './support/demo-support.js';
|
|
35
|
+
await renderPage('./accessibility.md');
|
|
36
|
+
</script>
|
|
37
|
+
<script type="module" data-demo-script="true">
|
|
38
|
+
import { initExamples } from './accessibility.min.js';
|
|
39
|
+
initExamples();
|
|
40
|
+
</script>
|
|
41
|
+
</body>
|
|
42
|
+
</html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { initAccessibilityUnformattedHeaderExample } from "../apiExamples/accessibility-unformatted-header";
|
|
2
|
+
import { initAriaLabelSlotExample } from "../apiExamples/aria-label";
|
|
3
|
+
|
|
4
|
+
import "../src/registered";
|
|
5
|
+
|
|
6
|
+
export function initExamples(initCount) {
|
|
7
|
+
// biome-ignore lint/style/noParameterAssign: legacy error handling
|
|
8
|
+
initCount = initCount || 0;
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
initAccessibilityUnformattedHeaderExample();
|
|
12
|
+
initAriaLabelSlotExample();
|
|
13
|
+
} catch (_err) {
|
|
14
|
+
if (initCount <= 20) {
|
|
15
|
+
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
initExamples(initCount + 1);
|
|
18
|
+
}, 100);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<auro-header level="1" id="overview">Dialog - Accessibility</auro-header>
|
|
2
|
+
<div class="contentWrapper">
|
|
3
|
+
<nav>
|
|
4
|
+
<auro-nav anchorNavContent=".scrollWrapper">
|
|
5
|
+
<span slot="mobileToggleCollapsed">View More</span>
|
|
6
|
+
<span slot="mobileToggleExpanded">View Less</span>
|
|
7
|
+
<auro-anchorlink fluid href="#semantics">Semantics & Roles</auro-anchorlink>
|
|
8
|
+
<auro-anchorlink fluid href="#labelling">Labelling</auro-anchorlink>
|
|
9
|
+
<auro-anchorlink fluid href="#focusManagement">Focus Management</auro-anchorlink>
|
|
10
|
+
<auro-anchorlink fluid href="#unformattedA11y">Unformatted Dialogs</auro-anchorlink>
|
|
11
|
+
<auro-anchorlink fluid href="#closeButtonLabel">Close Button Label</auro-anchorlink>
|
|
12
|
+
</auro-nav>
|
|
13
|
+
</nav>
|
|
14
|
+
<div class="mainContent">
|
|
15
|
+
<div class="scrollWrapper">
|
|
16
|
+
<auro-header level="2" id="semantics">Semantics & Roles</auro-header>
|
|
17
|
+
<p>The component renders its content inside a native HTML <code><dialog></code> element, which carries the implicit <code>role="dialog"</code> and the built-in semantics that assistive technology expects.</p>
|
|
18
|
+
<ul>
|
|
19
|
+
<li>A <strong>non-modal</strong> dialog is presented using the Popover API, so the page behind it remains reachable.</li>
|
|
20
|
+
<li>A <strong>modal</strong> dialog is opened with <code>showModal()</code>, which makes the rest of the page <code>inert</code> — content outside the dialog cannot be focused or interacted with until the dialog closes.</li>
|
|
21
|
+
</ul>
|
|
22
|
+
<auro-header level="2" id="labelling">Labelling</auro-header>
|
|
23
|
+
<p>The dialog wires up two ARIA relationships automatically:</p>
|
|
24
|
+
<table>
|
|
25
|
+
<thead>
|
|
26
|
+
<tr><th>Attribute</th><th>Points to</th><th>Purpose</th></tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody>
|
|
29
|
+
<tr><td><code>aria-labelledby</code></td><td><code>#dialog-header</code></td><td>Gives the dialog its accessible name from the header content.</td></tr>
|
|
30
|
+
<tr><td><code>aria-describedby</code></td><td><code>#dialog-content</code></td><td>Associates the body content as the dialog's description.</td></tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
<p>In a formatted dialog, the <code>header</code> slot is rendered inside the <code>#dialog-header</code> heading for you, so simply providing header content yields a correctly labelled dialog.</p>
|
|
34
|
+
<auro-header level="2" id="focusManagement">Focus Management</auro-header>
|
|
35
|
+
<p>The component manages focus across the full open/close lifecycle:</p>
|
|
36
|
+
<ul>
|
|
37
|
+
<li><strong>On open</strong> — once the open animation completes, focus is moved to the first focusable element inside the dialog.</li>
|
|
38
|
+
<li><strong>While open</strong> — focus is trapped within the dialog. <code>Tab</code> and <code>Shift</code> + <code>Tab</code> cycle through the dialog's focusable elements and wrap at the ends; elements outside the dialog are not reachable.</li>
|
|
39
|
+
<li><strong>On close</strong> — focus is restored to the element that was active (<code>document.activeElement</code>) when the dialog opened. The <code>triggerElement</code> property sets a fallback focus target, used only when no element was active at open time.</li>
|
|
40
|
+
</ul>
|
|
41
|
+
<auro-header level="2" id="unformattedA11y">Unformatted Dialogs</auro-header>
|
|
42
|
+
<p>An <code>unformatted</code> dialog does not render the default header heading, so the <code>aria-labelledby="dialog-header"</code> relationship has nothing to point at unless you supply it. To keep the dialog properly labelled, add <code>id="dialog-header"</code> to the heading element within your slotted content:</p>
|
|
43
|
+
|
|
44
|
+
<pre class="language-html"><code class="language-html"><auro-dialog unformatted>
|
|
45
|
+
<span slot="content">
|
|
46
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
47
|
+
Custom, edge-to-edge content.
|
|
48
|
+
</span>
|
|
49
|
+
</auro-dialog></code></pre>
|
|
50
|
+
|
|
51
|
+
<div class="exampleWrapper">
|
|
52
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/accessibility-unformatted-header.html) -->
|
|
53
|
+
<!-- The below content is automatically added from ./../apiExamples/accessibility-unformatted-header.html -->
|
|
54
|
+
<div>
|
|
55
|
+
<auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
|
|
56
|
+
</div>
|
|
57
|
+
<auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
|
|
58
|
+
<span slot="content">
|
|
59
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
60
|
+
<div class="unformattedWrapper">
|
|
61
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
62
|
+
These are words that are slotted into the scope of the custom element.
|
|
63
|
+
</div>
|
|
64
|
+
</span>
|
|
65
|
+
</auro-dialog>
|
|
66
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
67
|
+
</div>
|
|
68
|
+
<auro-accordion alignRight>
|
|
69
|
+
<span slot="trigger">See code</span>
|
|
70
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/accessibility-unformatted-header.html) -->
|
|
71
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/accessibility-unformatted-header.html -->
|
|
72
|
+
|
|
73
|
+
<pre class="language-html"><code class="language-html"><div>
|
|
74
|
+
<auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
|
|
75
|
+
</div>
|
|
76
|
+
<auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
|
|
77
|
+
<span slot="content">
|
|
78
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
79
|
+
<div class="unformattedWrapper">
|
|
80
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
81
|
+
These are words that are slotted into the scope of the custom element.
|
|
82
|
+
</div>
|
|
83
|
+
</span>
|
|
84
|
+
</auro-dialog></code></pre>
|
|
85
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
86
|
+
</auro-accordion>
|
|
87
|
+
<auro-header level="2" id="closeButtonLabel">Close Button Label</auro-header>
|
|
88
|
+
<p>The non-modal close button has an accessible label of <code>"Close"</code> by default. Provide the <code>ariaLabel.dialog.close</code> slot to override it — useful when the surrounding context calls for more specific wording.</p>
|
|
89
|
+
<div class="exampleWrapper">
|
|
90
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label.html) -->
|
|
91
|
+
<!-- The below content is automatically added from ./../apiExamples/aria-label.html -->
|
|
92
|
+
<div>
|
|
93
|
+
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
94
|
+
</div>
|
|
95
|
+
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
96
|
+
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
97
|
+
<span slot="content">
|
|
98
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
99
|
+
<div class="unformattedWrapper">
|
|
100
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
101
|
+
These are words that are slotted into the scope of the custom element.
|
|
102
|
+
</div>
|
|
103
|
+
</span>
|
|
104
|
+
</auro-dialog>
|
|
105
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
|
+
</div>
|
|
107
|
+
<auro-accordion alignRight>
|
|
108
|
+
<span slot="trigger">See code</span>
|
|
109
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label.html) -->
|
|
110
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/aria-label.html -->
|
|
111
|
+
|
|
112
|
+
<pre class="language-html"><code class="language-html"><div>
|
|
113
|
+
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
114
|
+
</div>
|
|
115
|
+
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
116
|
+
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
117
|
+
<span slot="content">
|
|
118
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
119
|
+
<div class="unformattedWrapper">
|
|
120
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
121
|
+
These are words that are slotted into the scope of the custom element.
|
|
122
|
+
</div>
|
|
123
|
+
</span>
|
|
124
|
+
</auro-dialog></code></pre>
|
|
125
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
126
|
+
</auro-accordion>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
</div>
|