@aurodesignsystem/auro-dialog 4.2.0 → 4.2.2-rc-1638600.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +2 -19
  2. package/README.md +78 -91
  3. package/demo/accessibility.html +42 -0
  4. package/demo/accessibility.js +21 -0
  5. package/demo/accessibility.md +134 -0
  6. package/demo/accessibility.min.js +4259 -0
  7. package/demo/api.html +16 -40
  8. package/demo/api.md +2 -752
  9. package/demo/customize.html +45 -0
  10. package/demo/{api.js → customize.js} +2 -14
  11. package/demo/customize.md +226 -0
  12. package/demo/customize.min.js +4264 -0
  13. package/demo/demo-nav.css +32 -0
  14. package/demo/design.html +42 -0
  15. package/demo/design.js +23 -0
  16. package/demo/design.md +306 -0
  17. package/demo/design.min.js +4331 -0
  18. package/demo/getting-started.html +38 -0
  19. package/demo/getting-started.md +295 -0
  20. package/demo/index.html +17 -36
  21. package/demo/index.js +2 -3
  22. package/demo/index.md +221 -144
  23. package/demo/index.min.js +4274 -7
  24. package/demo/keyboard-behavior.html +38 -0
  25. package/demo/keyboard-behavior.md +51 -0
  26. package/demo/pages.json +1 -0
  27. package/demo/readme.html +42 -0
  28. package/demo/readme.js +24 -0
  29. package/demo/readme.md +176 -0
  30. package/demo/{auro-dialog.min.js → readme.min.js} +754 -311
  31. package/demo/support/demo-support.js +140 -0
  32. package/demo/voiceover.html +38 -0
  33. package/demo/voiceover.md +19 -0
  34. package/demo/why-dialog.html +38 -0
  35. package/demo/why-dialog.md +36 -0
  36. package/dist/{auro-dialog-CWkXz5VA.js → auro-dialog-FFeXiEB1.js} +20 -20
  37. package/dist/index.d.ts +207 -99
  38. package/dist/index.js +1 -1
  39. package/dist/registered.js +1 -1
  40. package/package.json +6 -6
  41. package/demo/api.min.js +0 -219
package/CHANGELOG.md CHANGED
@@ -1,26 +1,9 @@
1
- # [4.2.0](https://github.com/AlaskaAirlines/auro-dialog/compare/v4.1.1...v4.2.0) (2026-05-13)
1
+ ## [4.2.2-rc-1638600.1](https://github.com/AlaskaAirlines/auro-dialog/compare/v4.2.1...v4.2.2-rc-1638600.1) (2026-10-06)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * code cleanup as per review ([c9b967d](https://github.com/AlaskaAirlines/auro-dialog/commit/c9b967d45477a11757d39dab77be8c669bc26ca8))
7
- * lock page scroll for mobile screen ([3e55a6c](https://github.com/AlaskaAirlines/auro-dialog/commit/3e55a6c11f033f1d7decf494e9b944cc2cb04daa))
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
+ * restore page scroll lock behind non-modal dialogs AB[#1625424](https://github.com/AlaskaAirlines/auro-dialog/issues/1625424) ([56c2f89](https://github.com/AlaskaAirlines/auro-dialog/commit/56c2f8944b170043f95509a97ec6bb9f5276706f)), closes [AB#1647843](https://github.com/AB/issues/1647843)
24
7
 
25
8
  # Semantic Release Automated Changelog
26
9
 
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 `<auro-dialog>` 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.
25
-
26
- 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.
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>&lt;auro-dialog&gt;</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 `<auro-dialog>` component should be used in situations where users may:
39
-
40
- * Be prompted to take an action before doing anything else or going back
41
- * Be prompted to view content with the option of closing it
36
+ <p>The <code>&lt;auro-dialog&gt;</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
@@ -49,9 +48,7 @@ The `<auro-dialog>` component should be used in situations where users may:
49
48
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-dialog?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
50
49
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
51
50
 
52
- ```shell
53
- $ npm i @aurodesignsystem/auro-dialog
54
- ```
51
+ <pre class="language-shell"><code class="language-shell">$ npm i @aurodesignsystem/auro-dialog</code></pre>
55
52
 
56
53
  <!-- AURO-GENERATED-CONTENT:END -->
57
54
 
@@ -63,9 +60,7 @@ Defining the dependency within each project that is using the `<auro-dialog>` co
63
60
  <!-- AURO-GENERATED-CONTENT:END -->
64
61
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
65
62
 
66
- ```js
67
- import "@aurodesignsystem/auro-dialog";
68
- ```
63
+ <pre class="language-js"><code class="language-js">import "@aurodesignsystem/auro-dialog";</code></pre>
69
64
 
70
65
  <!-- AURO-GENERATED-CONTENT:END -->
71
66
 
@@ -74,9 +69,7 @@ import "@aurodesignsystem/auro-dialog";
74
69
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
75
70
  In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
76
71
 
77
- ```html
78
- <script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"></script>
79
- ```
72
+ <pre class="language-html"><code class="language-html">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"&gt;&lt;/script&gt;</code></pre>
80
73
 
81
74
  <!-- AURO-GENERATED-CONTENT:END -->
82
75
 
@@ -85,28 +78,26 @@ In cases where the project is not able to process JS assets, there are pre-proce
85
78
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
86
79
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
87
80
 
88
- ```html
89
- <div>
90
- <auro-button id="openBasic">Open default dialog</auro-button>
91
- </div>
92
- <auro-dialog id="defaultDialog">
93
- <span slot="header">Default Dialog</span>
94
- <div slot="content">
95
- <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
96
- <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
97
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
98
- <ul>
99
- <li>Caerphilly croque monsieur fondue</li>
100
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
101
- <li>Cheddar cheese and biscuits chalk and cheese</li>
102
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
103
- </ul>
104
- </div>
105
- <div slot="footer">
106
- <auro-button secondary id="closeBasic">Close</auro-button>
107
- </div>
108
- </auro-dialog>
109
- ```
81
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
82
+ &lt;auro-button id="openBasic"&gt;Open default dialog&lt;/auro-button&gt;
83
+ &lt;/div&gt;
84
+ &lt;auro-dialog id="defaultDialog"&gt;
85
+ &lt;span slot="header"&gt;Default Dialog&lt;/span&gt;
86
+ &lt;div slot="content"&gt;
87
+ &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
88
+ &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
89
+ &lt;auro-header level="3" display="500"&gt;Before checking your bags, remember to:&lt;/auro-header&gt;
90
+ &lt;ul&gt;
91
+ &lt;li&gt;Caerphilly croque monsieur fondue&lt;/li&gt;
92
+ &lt;li&gt;Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings&lt;/li&gt;
93
+ &lt;li&gt;Cheddar cheese and biscuits chalk and cheese&lt;/li&gt;
94
+ &lt;li&gt;Camembert de normandie stinking bishop bavarian bergkase&lt;/li&gt;
95
+ &lt;/ul&gt;
96
+ &lt;/div&gt;
97
+ &lt;div slot="footer"&gt;
98
+ &lt;auro-button secondary id="closeBasic"&gt;Close&lt;/auro-button&gt;
99
+ &lt;/div&gt;
100
+ &lt;/auro-dialog&gt;</code></pre>
110
101
  <!-- AURO-GENERATED-CONTENT:END -->
111
102
 
112
103
  ## Custom Component Registration for Version Management
@@ -123,67 +114,63 @@ You can do this by importing only the component class and using the `register(na
123
114
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
124
115
  <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
125
116
 
126
- ```js
127
- // Import the class only
117
+ <pre class="language-js"><code class="language-js">// Import the class only
128
118
  import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
129
-
119
+ ​
130
120
  // Register with a custom name if desired
131
- AuroDialog.register('custom-dialog');
132
- ```
121
+ AuroDialog.register('custom-dialog');</code></pre>
133
122
 
134
123
  This will create a new custom element `<custom-dialog>` that behaves exactly like `<auro-dialog>`, allowing both to coexist on the same page without interfering with each other.
135
124
  <!-- AURO-GENERATED-CONTENT:END -->
136
125
  <div class="exampleWrapper exampleWrapper--flex">
137
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
138
- <!-- The below content is automatically added from ./apiExamples/custom.html -->
139
- <div>
140
- <auro-button id="openCustom">Open default dialog</auro-button>
141
- </div>
142
- <custom-dialog id="customDialog">
143
- <span slot="header">Default Dialog</span>
144
- <div slot="content">
145
- <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
146
- <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
147
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
148
- <ul>
149
- <li>Caerphilly croque monsieur fondue</li>
150
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
151
- <li>Cheddar cheese and biscuits chalk and cheese</li>
152
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
153
- </ul>
154
- </div>
155
- <div slot="footer">
156
- <auro-button secondary id="closeCustom">Close</auro-button>
157
- </div>
158
- </custom-dialog>
159
- <!-- AURO-GENERATED-CONTENT:END -->
126
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
127
+ <!-- The below content is automatically added from ./apiExamples/custom.html -->
128
+ <div>
129
+ <auro-button id="openCustom">Open default dialog</auro-button>
130
+ </div>
131
+ <custom-dialog id="customDialog">
132
+ <span slot="header">Default Dialog</span>
133
+ <div slot="content">
134
+ <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
135
+ <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
136
+ <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
137
+ <ul>
138
+ <li>Caerphilly croque monsieur fondue</li>
139
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
140
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
141
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
142
+ </ul>
143
+ </div>
144
+ <div slot="footer">
145
+ <auro-button secondary id="closeCustom">Close</auro-button>
146
+ </div>
147
+ </custom-dialog>
148
+ <!-- AURO-GENERATED-CONTENT:END -->
160
149
  </div>
161
150
  <auro-accordion alignRight>
162
- <span slot="trigger">See code</span>
151
+ <span slot="trigger">See code</span>
163
152
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
164
153
  <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
165
154
 
166
- ```html
167
- <div>
168
- <auro-button id="openCustom">Open default dialog</auro-button>
169
- </div>
170
- <custom-dialog id="customDialog">
171
- <span slot="header">Default Dialog</span>
172
- <div slot="content">
173
- <p>When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See <auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank">alaskaair.com/bagrules</auro-hyperlink> for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.</p>
174
- <p>Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.</p>
175
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
176
- <ul>
177
- <li>Caerphilly croque monsieur fondue</li>
178
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
179
- <li>Cheddar cheese and biscuits chalk and cheese</li>
180
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
181
- </ul>
182
- </div>
183
- <div slot="footer">
184
- <auro-button secondary id="closeCustom">Close</auro-button>
185
- </div>
186
- </custom-dialog>
187
- ```
155
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
156
+ &lt;auro-button id="openCustom"&gt;Open default dialog&lt;/auro-button&gt;
157
+ &lt;/div&gt;
158
+ &lt;custom-dialog id="customDialog"&gt;
159
+ &lt;span slot="header"&gt;Default Dialog&lt;/span&gt;
160
+ &lt;div slot="content"&gt;
161
+ &lt;p&gt;When traveling on Alaska Airlines flights, Alaska Airlines checked baggage fees may apply. See &lt;auro-hyperlink href="https://www.alaskaair.com/bagrules" target="_blank"&gt;alaskaair.com/bagrules&lt;/auro-hyperlink&gt; for our rules. For itineraries that include other airlines, their checked baggage fees may apply, as displayed on their websites.&lt;/p&gt;
162
+ &lt;p&gt;Baggage rules and fees will be based on the specific itinerary chosen. The applicable first and second bag fees will be displayed after you have added flights to the cart.&lt;/p&gt;
163
+ &lt;auro-header level="3" display="500"&gt;Before checking your bags, remember to:&lt;/auro-header&gt;
164
+ &lt;ul&gt;
165
+ &lt;li&gt;Caerphilly croque monsieur fondue&lt;/li&gt;
166
+ &lt;li&gt;Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings&lt;/li&gt;
167
+ &lt;li&gt;Cheddar cheese and biscuits chalk and cheese&lt;/li&gt;
168
+ &lt;li&gt;Camembert de normandie stinking bishop bavarian bergkase&lt;/li&gt;
169
+ &lt;/ul&gt;
170
+ &lt;/div&gt;
171
+ &lt;div slot="footer"&gt;
172
+ &lt;auro-button secondary id="closeCustom"&gt;Close&lt;/auro-button&gt;
173
+ &lt;/div&gt;
174
+ &lt;/custom-dialog&gt;</code></pre>
188
175
  <!-- AURO-GENERATED-CONTENT:END -->
189
176
  </auro-accordion>
@@ -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,134 @@
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 &amp; 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="#backgroundScroll">Background Scroll</auro-anchorlink>
11
+ <auro-anchorlink fluid href="#unformattedA11y">Unformatted Dialogs</auro-anchorlink>
12
+ <auro-anchorlink fluid href="#closeButtonLabel">Close Button Label</auro-anchorlink>
13
+ </auro-nav>
14
+ </nav>
15
+ <div class="mainContent">
16
+ <div class="scrollWrapper">
17
+ <auro-header level="2" id="semantics">Semantics &amp; Roles</auro-header>
18
+ <p>The component renders its content inside a native HTML <code>&lt;dialog&gt;</code> element, which carries the implicit <code>role="dialog"</code> and the built-in semantics that assistive technology expects.</p>
19
+ <ul>
20
+ <li>A <strong>non-modal</strong> dialog is presented using the Popover API. Focus is trapped inside it and the page behind it is frozen while it is open, so it is exposed to assistive technology as <code>aria-modal="true"</code>.</li>
21
+ <li>A <strong>modal</strong> dialog is opened with <code>showModal()</code>, which does all of the above and additionally makes the rest of the page <code>inert</code> — content outside the dialog cannot be focused or interacted with until the dialog closes.</li>
22
+ </ul>
23
+ <auro-header level="2" id="labelling">Labelling</auro-header>
24
+ <p>The dialog wires up two ARIA relationships automatically:</p>
25
+ <table>
26
+ <thead>
27
+ <tr><th>Attribute</th><th>Points to</th><th>Purpose</th></tr>
28
+ </thead>
29
+ <tbody>
30
+ <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>
31
+ <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>
32
+ </tbody>
33
+ </table>
34
+ <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>
35
+ <auro-header level="2" id="focusManagement">Focus Management</auro-header>
36
+ <p>The component manages focus across the full open/close lifecycle:</p>
37
+ <ul>
38
+ <li><strong>On open</strong> — once the open animation completes, focus is moved to the first focusable element inside the dialog.</li>
39
+ <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>
40
+ <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>
41
+ <li><strong>Dismissing with the keyboard</strong> — <code>Escape</code> closes a <strong>non-modal</strong> dialog. A <strong>modal</strong> dialog deliberately ignores <code>Escape</code> and must be dismissed through an explicit action, such as the close button. A non-modal dialog can also be dismissed by clicking the page behind it, but that affordance is not exposed to assistive technology while <code>aria-modal="true"</code> is set, so <code>Escape</code> is the equivalent path for keyboard and screen reader users.</li>
42
+ </ul>
43
+ <auro-header level="2" id="backgroundScroll">Background Scroll</auro-header>
44
+ <p>Both presentations freeze the page behind the dialog for as long as it is open, and restore the previous scroll position when it closes. This is deliberate: content drifting out of view behind an open dialog is disorienting, and on touch devices and with a screen reader the page can otherwise move unexpectedly while someone is reading the dialog.</p>
45
+ <p>The lock blocks every scroll vector — wheel, trackpad, touch, and the arrow and space keys — including the VoiceOver three-finger swipe, which <code>overflow: hidden</code> alone does not prevent. Content <em>inside</em> the dialog still scrolls normally.</p>
46
+ <auro-header level="2" id="unformattedA11y">Unformatted Dialogs</auro-header>
47
+ <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>
48
+
49
+ <pre class="language-html"><code class="language-html">&lt;auro-dialog unformatted&gt;
50
+ &lt;span slot="content"&gt;
51
+ &lt;h1 id="dialog-header" class="heading-lg"&gt;This is a header&lt;/h1&gt;
52
+ Custom, edge-to-edge content.
53
+ &lt;/span&gt;
54
+ &lt;/auro-dialog&gt;</code></pre>
55
+
56
+ <div class="exampleWrapper">
57
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/accessibility-unformatted-header.html) -->
58
+ <!-- The below content is automatically added from ./../apiExamples/accessibility-unformatted-header.html -->
59
+ <div>
60
+ <auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
61
+ </div>
62
+ <auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
63
+ <span slot="content">
64
+ <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" />
65
+ <div class="unformattedWrapper">
66
+ <h1 id="dialog-header" class="heading-lg">This is a header</h1>
67
+ These are words that are slotted into the scope of the custom element.
68
+ </div>
69
+ </span>
70
+ </auro-dialog>
71
+ <!-- AURO-GENERATED-CONTENT:END -->
72
+ </div>
73
+ <auro-accordion alignRight>
74
+ <span slot="trigger">See code</span>
75
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/accessibility-unformatted-header.html) -->
76
+ <!-- The below code snippet is automatically added from ./../apiExamples/accessibility-unformatted-header.html -->
77
+
78
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
79
+ &lt;auro-button id="openAccessibility"&gt;Unformatted Medium Dialog&lt;/auro-button&gt;
80
+ &lt;/div&gt;
81
+ &lt;auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse"&gt;
82
+ &lt;span slot="content"&gt;
83
+ &lt;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" /&gt;
84
+ &lt;div class="unformattedWrapper"&gt;
85
+ &lt;h1 id="dialog-header" class="heading-lg"&gt;This is a header&lt;/h1&gt;
86
+ These are words that are slotted into the scope of the custom element.
87
+ &lt;/div&gt;
88
+ &lt;/span&gt;
89
+ &lt;/auro-dialog&gt;</code></pre>
90
+ <!-- AURO-GENERATED-CONTENT:END -->
91
+ </auro-accordion>
92
+ <auro-header level="2" id="closeButtonLabel">Close Button Label</auro-header>
93
+ <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>
94
+ <div class="exampleWrapper">
95
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label.html) -->
96
+ <!-- The below content is automatically added from ./../apiExamples/aria-label.html -->
97
+ <div>
98
+ <auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
99
+ </div>
100
+ <auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
101
+ <span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
102
+ <span slot="content">
103
+ <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" />
104
+ <div class="unformattedWrapper">
105
+ <h1 id="dialog-header" class="heading-lg">This is a header</h1>
106
+ These are words that are slotted into the scope of the custom element.
107
+ </div>
108
+ </span>
109
+ </auro-dialog>
110
+ <!-- AURO-GENERATED-CONTENT:END -->
111
+ </div>
112
+ <auro-accordion alignRight>
113
+ <span slot="trigger">See code</span>
114
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label.html) -->
115
+ <!-- The below code snippet is automatically added from ./../apiExamples/aria-label.html -->
116
+
117
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
118
+ &lt;auro-button id="openAriaLabelSlot"&gt;Unformatted Dialog w/ custom close button aria-label&lt;/auro-button&gt;
119
+ &lt;/div&gt;
120
+ &lt;auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark&gt;
121
+ &lt;span slot="ariaLabel.dialog.close"&gt;This will be the new aria label for the close button&lt;/span&gt;
122
+ &lt;span slot="content"&gt;
123
+ &lt;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" /&gt;
124
+ &lt;div class="unformattedWrapper"&gt;
125
+ &lt;h1 id="dialog-header" class="heading-lg"&gt;This is a header&lt;/h1&gt;
126
+ These are words that are slotted into the scope of the custom element.
127
+ &lt;/div&gt;
128
+ &lt;/span&gt;
129
+ &lt;/auro-dialog&gt;</code></pre>
130
+ <!-- AURO-GENERATED-CONTENT:END -->
131
+ </auro-accordion>
132
+ </div>
133
+ </div>
134
+ </div>