@aurodesignsystem/auro-dialog 4.2.2 → 4.2.3
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 -4
- package/README.md +35 -35
- package/demo/accessibility.js +3 -19
- package/demo/accessibility.md +22 -107
- package/demo/accessibility.min.js +122 -113
- package/demo/api.md +63 -40
- package/demo/customize.js +0 -2
- package/demo/customize.md +32 -82
- package/demo/customize.min.js +119 -85
- package/demo/design.js +0 -2
- package/demo/design.md +51 -94
- package/demo/design.min.js +119 -85
- package/demo/getting-started.md +61 -71
- package/demo/index.md +42 -42
- package/demo/index.min.js +119 -71
- package/demo/keyboard-behavior.md +15 -15
- package/demo/readme.md +34 -35
- package/demo/readme.min.js +119 -71
- package/demo/voiceover.md +9 -9
- package/demo/why-dialog.md +6 -6
- package/dist/auro-dialog-DwEbkZ4d.js +157 -0
- package/dist/index.d.ts +140 -87
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +8 -8
- package/dist/auro-dialog-FFeXiEB1.js +0 -134
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
## [4.2.
|
|
1
|
+
## [4.2.3](https://github.com/AlaskaAirlines/auro-dialog/compare/v4.2.2...v4.2.3) (2026-11-18)
|
|
2
2
|
|
|
3
|
+
### Performance Improvements
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
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)
|
|
5
|
+
* export CEM AB[#1668016](https://github.com/AlaskaAirlines/auro-dialog/issues/1668016) ([49b4e8d](https://github.com/AlaskaAirlines/auro-dialog/commit/49b4e8d3413ddc81ccd69cba03389437245c0882))
|
|
7
6
|
|
|
8
7
|
# Semantic Release Automated Changelog
|
|
9
8
|
|
package/README.md
CHANGED
|
@@ -12,31 +12,32 @@ The following sections are editable by making changes to the following files:
|
|
|
12
12
|
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
13
|
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
14
14
|
| Description | Description of the component | `./docs/partials/description.md` |
|
|
15
|
-
| Use
|
|
16
|
-
| Additional
|
|
17
|
-
| Component
|
|
15
|
+
| Use cases | Examples for when to use this component | `./docs/partials/useCases.md` |
|
|
16
|
+
| Additional information | For use to add any component specific information | `./docs/partials/readmeAddlInfo.md` |
|
|
17
|
+
| Component example code | HTML sample code of the components use | `./apiExamples/basic.html` |
|
|
18
18
|
-->
|
|
19
19
|
|
|
20
20
|
# Dialog
|
|
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
|
-
<p>The <code><auro-dialog></code> component
|
|
25
|
-
|
|
26
|
-
<p>
|
|
24
|
+
<p>The <code><auro-dialog></code> component interrupts the page and moves focus into the dialog. Use it when people need to notice the content right away.</p>
|
|
25
|
+
|
|
26
|
+
<p>Use <code>modal</code> when people must act before they continue. A modal dialog can't be dismissed passively, so add a footer button that closes it.</p>
|
|
27
|
+
<p>Auro follows the <a class="hyperlink" href="https://www.nngroup.com/articles/modal-nonmodal-dialog/" target="_blank">Nielsen Norman Group</a>'s guidance on dialogs and modals.</p>
|
|
27
28
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
29
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
30
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
31
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
31
32
|
|
|
32
|
-
## Use
|
|
33
|
+
## Use cases
|
|
33
34
|
|
|
34
35
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
35
36
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
36
|
-
<p>
|
|
37
|
+
<p>Use <code><auro-dialog></code> when people need to:</p>
|
|
37
38
|
<ul>
|
|
38
|
-
<li>
|
|
39
|
-
<li>
|
|
39
|
+
<li>Take an action before they do anything else or go back</li>
|
|
40
|
+
<li>View content that they can close when they're done</li>
|
|
40
41
|
</ul>
|
|
41
42
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
42
43
|
|
|
@@ -52,10 +53,10 @@ The following sections are editable by making changes to the following files:
|
|
|
52
53
|
|
|
53
54
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
54
55
|
|
|
55
|
-
### Define
|
|
56
|
+
### Define dependency in project
|
|
56
57
|
|
|
57
58
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
58
|
-
|
|
59
|
+
Import the component in each project that uses `<auro-dialog>`.
|
|
59
60
|
|
|
60
61
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
61
62
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -67,22 +68,22 @@ Defining the dependency within each project that is using the `<auro-dialog>` co
|
|
|
67
68
|
### Use CDN
|
|
68
69
|
|
|
69
70
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
70
|
-
|
|
71
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
71
72
|
|
|
72
|
-
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"></script></code></pre>
|
|
73
|
+
<pre class="language-html"><code class="language-html"><script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"></script></code></pre>
|
|
73
74
|
|
|
74
75
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
75
76
|
|
|
76
|
-
## Basic
|
|
77
|
+
## Basic example
|
|
77
78
|
|
|
78
79
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
79
80
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
80
81
|
|
|
81
82
|
<pre class="language-html"><code class="language-html"><div>
|
|
82
83
|
<auro-button id="openBasic">Open default dialog</auro-button>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<span slot="header">Default
|
|
84
|
+
</div>
|
|
85
|
+
<auro-dialog id="defaultDialog">
|
|
86
|
+
<span slot="header">Default dialog</span>
|
|
86
87
|
<div slot="content">
|
|
87
88
|
<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>
|
|
88
89
|
<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>
|
|
@@ -95,32 +96,31 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
95
96
|
</ul>
|
|
96
97
|
</div>
|
|
97
98
|
<div slot="footer">
|
|
98
|
-
<auro-button secondary id="closeBasic">Close</auro-button>
|
|
99
|
+
<auro-button variant="secondary" id="closeBasic">Close</auro-button>
|
|
99
100
|
</div>
|
|
100
|
-
</auro-dialog></code></pre>
|
|
101
|
+
</auro-dialog></code></pre>
|
|
101
102
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
103
|
|
|
103
|
-
## Custom
|
|
104
|
+
## Custom component registration for version management
|
|
104
105
|
|
|
105
|
-
|
|
106
|
+
Every Auro component has two key parts: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
|
|
106
107
|
The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
|
|
107
108
|
|
|
108
|
-
|
|
109
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
109
110
|
|
|
110
|
-
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions),
|
|
111
|
+
However, if you need to load multiple versions of the same component on a single page (for example, when two projects depend on different versions), register the class manually under a custom element name to avoid conflicts.
|
|
111
112
|
|
|
112
|
-
|
|
113
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
113
114
|
|
|
114
115
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
115
116
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
116
117
|
|
|
117
118
|
<pre class="language-js"><code class="language-js">// Import the class only
|
|
118
119
|
import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
|
|
119
|
-
|
|
120
|
-
// Register with a custom name if desired
|
|
120
|
+
// Register with a custom name if desired
|
|
121
121
|
AuroDialog.register('custom-dialog');</code></pre>
|
|
122
122
|
|
|
123
|
-
This
|
|
123
|
+
This creates 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.
|
|
124
124
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
125
125
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
126
126
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
@@ -129,7 +129,7 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
129
129
|
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
130
130
|
</div>
|
|
131
131
|
<custom-dialog id="customDialog">
|
|
132
|
-
<span slot="header">Default
|
|
132
|
+
<span slot="header">Default dialog</span>
|
|
133
133
|
<div slot="content">
|
|
134
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
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>
|
|
@@ -142,7 +142,7 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
142
142
|
</ul>
|
|
143
143
|
</div>
|
|
144
144
|
<div slot="footer">
|
|
145
|
-
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
145
|
+
<auro-button variant="secondary" id="closeCustom">Close</auro-button>
|
|
146
146
|
</div>
|
|
147
147
|
</custom-dialog>
|
|
148
148
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -154,9 +154,9 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
154
154
|
|
|
155
155
|
<pre class="language-html"><code class="language-html"><div>
|
|
156
156
|
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<span slot="header">Default
|
|
157
|
+
</div>
|
|
158
|
+
<custom-dialog id="customDialog">
|
|
159
|
+
<span slot="header">Default dialog</span>
|
|
160
160
|
<div slot="content">
|
|
161
161
|
<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>
|
|
162
162
|
<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>
|
|
@@ -169,8 +169,8 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
169
169
|
</ul>
|
|
170
170
|
</div>
|
|
171
171
|
<div slot="footer">
|
|
172
|
-
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
172
|
+
<auro-button variant="secondary" id="closeCustom">Close</auro-button>
|
|
173
173
|
</div>
|
|
174
|
-
</custom-dialog></code></pre>
|
|
174
|
+
</custom-dialog></code></pre>
|
|
175
175
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
176
176
|
</auro-accordion>
|
package/demo/accessibility.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
import { initAccessibilityUnformattedHeaderExample } from "../apiExamples/accessibility-unformatted-header";
|
|
2
|
-
import { initAriaLabelSlotExample } from "../apiExamples/aria-label";
|
|
3
|
-
|
|
4
1
|
import "../src/registered";
|
|
5
2
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
}
|
|
3
|
+
// The accessibility page has no live examples. The export stays so the demo
|
|
4
|
+
// shell can still call it.
|
|
5
|
+
export function initExamples() {}
|
package/demo/accessibility.md
CHANGED
|
@@ -2,23 +2,22 @@
|
|
|
2
2
|
<div class="contentWrapper">
|
|
3
3
|
<nav>
|
|
4
4
|
<auro-nav anchorNavContent=".scrollWrapper">
|
|
5
|
-
<span slot="mobileToggleCollapsed">View
|
|
6
|
-
<span slot="mobileToggleExpanded">View
|
|
7
|
-
<auro-anchorlink fluid href="#semantics">Semantics
|
|
5
|
+
<span slot="mobileToggleCollapsed">View more</span>
|
|
6
|
+
<span slot="mobileToggleExpanded">View less</span>
|
|
7
|
+
<auro-anchorlink fluid href="#semantics">Semantics and roles</auro-anchorlink>
|
|
8
8
|
<auro-anchorlink fluid href="#labelling">Labelling</auro-anchorlink>
|
|
9
|
-
<auro-anchorlink fluid href="#focusManagement">Focus
|
|
10
|
-
<auro-anchorlink fluid href="#backgroundScroll">Background
|
|
11
|
-
<auro-anchorlink fluid href="#
|
|
12
|
-
<auro-anchorlink fluid href="#closeButtonLabel">Close Button Label</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="#closeButtonLabel">Close button label</auro-anchorlink>
|
|
13
12
|
</auro-nav>
|
|
14
13
|
</nav>
|
|
15
14
|
<div class="mainContent">
|
|
16
15
|
<div class="scrollWrapper">
|
|
17
|
-
<auro-header level="2" id="semantics">Semantics
|
|
18
|
-
<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
|
|
16
|
+
<auro-header level="2" id="semantics">Semantics and 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 screen readers expect.</p>
|
|
19
18
|
<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
|
|
21
|
-
<li>A <strong>modal</strong> dialog is opened with <code>showModal()</code>, which does all of the above and
|
|
19
|
+
<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's open, so it's exposed to screen readers as <code>aria-modal="true"</code>.</li>
|
|
20
|
+
<li>A <strong>modal</strong> dialog is opened with <code>showModal()</code>, which does all of the above and also makes the rest of the page <code>inert</code>. Content outside the dialog can't be focused or interacted with until the dialog closes.</li>
|
|
22
21
|
</ul>
|
|
23
22
|
<auro-header level="2" id="labelling">Labelling</auro-header>
|
|
24
23
|
<p>The dialog wires up two ARIA relationships automatically:</p>
|
|
@@ -31,104 +30,20 @@
|
|
|
31
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>
|
|
32
31
|
</tbody>
|
|
33
32
|
</table>
|
|
34
|
-
<p>In a formatted dialog, the <code>header</code> slot is rendered inside the <code>#dialog-header</code> heading for you, so
|
|
35
|
-
<auro-header level="2" id="focusManagement">Focus
|
|
36
|
-
<p>The component manages focus across the full open
|
|
33
|
+
<p>In a formatted dialog, the <code>header</code> slot is rendered inside the <code>#dialog-header</code> heading for you, so providing header content gives you 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 and close lifecycle:</p>
|
|
37
36
|
<ul>
|
|
38
|
-
<li><strong>On open</strong
|
|
39
|
-
<li><strong>While open</strong
|
|
40
|
-
<li><strong>On close</strong
|
|
41
|
-
<li><strong>Dismissing with the keyboard</strong
|
|
37
|
+
<li><strong>On open</strong>: Once the open animation completes, focus moves 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, and elements outside the dialog aren't reachable.</li>
|
|
39
|
+
<li><strong>On close</strong>: Focus returns 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
|
+
<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 a footer button. People can also dismiss a non-modal dialog by clicking the page behind it, but screen readers don't announce that option while <code>aria-modal="true"</code> is set. <code>Escape</code> is the equivalent path for keyboard and screen reader users.</li>
|
|
42
41
|
</ul>
|
|
43
|
-
<auro-header level="2" id="backgroundScroll">Background
|
|
44
|
-
<p>Both presentations freeze the page behind the dialog for as long as it
|
|
45
|
-
<p>The lock blocks every scroll vector
|
|
46
|
-
<auro-header level="2" id="
|
|
47
|
-
<p>
|
|
48
|
-
|
|
49
|
-
<pre class="language-html"><code class="language-html"><auro-dialog unformatted>
|
|
50
|
-
<span slot="content">
|
|
51
|
-
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
52
|
-
Custom, edge-to-edge content.
|
|
53
|
-
</span>
|
|
54
|
-
</auro-dialog></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"><div>
|
|
79
|
-
<auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
|
|
80
|
-
</div>
|
|
81
|
-
<auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
|
|
82
|
-
<span slot="content">
|
|
83
|
-
<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" />
|
|
84
|
-
<div class="unformattedWrapper">
|
|
85
|
-
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
86
|
-
These are words that are slotted into the scope of the custom element.
|
|
87
|
-
</div>
|
|
88
|
-
</span>
|
|
89
|
-
</auro-dialog></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"><div>
|
|
118
|
-
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
119
|
-
</div>
|
|
120
|
-
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
121
|
-
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
122
|
-
<span slot="content">
|
|
123
|
-
<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" />
|
|
124
|
-
<div class="unformattedWrapper">
|
|
125
|
-
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
126
|
-
These are words that are slotted into the scope of the custom element.
|
|
127
|
-
</div>
|
|
128
|
-
</span>
|
|
129
|
-
</auro-dialog></code></pre>
|
|
130
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
131
|
-
</auro-accordion>
|
|
42
|
+
<auro-header level="2" id="backgroundScroll">Background scroll</auro-header>
|
|
43
|
+
<p>Both presentations freeze the page behind the dialog for as long as it's 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>
|
|
44
|
+
<p>The lock blocks every scroll vector: wheel, trackpad, touch, and the arrow and space keys. That includes the VoiceOver three-finger swipe, which <code>overflow: hidden</code> alone doesn't prevent. Content <em>inside</em> the dialog still scrolls normally.</p>
|
|
45
|
+
<auro-header level="2" id="closeButtonLabel">Close button label</auro-header>
|
|
46
|
+
<p>The non-modal close button has an accessible label of <code>"Close"</code> by default. To override it when the surrounding context calls for more specific wording, provide the <code>ariaLabel.dialog.close</code> slot.</p>
|
|
132
47
|
</div>
|
|
133
48
|
</div>
|
|
134
49
|
</div>
|