@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
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<auro-header level="1" id="overview">Dialog - Keyboard
|
|
1
|
+
<auro-header level="1" id="overview">Dialog - Keyboard behavior</auro-header>
|
|
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="#tabBehavior">Tab
|
|
8
|
-
<auro-anchorlink fluid href="#keyEvents">Key
|
|
9
|
-
<auro-anchorlink fluid href="#modalDifferences">Modal
|
|
5
|
+
<span slot="mobileToggleCollapsed">View more</span>
|
|
6
|
+
<span slot="mobileToggleExpanded">View less</span>
|
|
7
|
+
<auro-anchorlink fluid href="#tabBehavior">Tab behavior</auro-anchorlink>
|
|
8
|
+
<auro-anchorlink fluid href="#keyEvents">Key events</auro-anchorlink>
|
|
9
|
+
<auro-anchorlink fluid href="#modalDifferences">Modal differences</auro-anchorlink>
|
|
10
10
|
</auro-nav>
|
|
11
11
|
</nav>
|
|
12
12
|
<div class="mainContent">
|
|
13
13
|
<div class="scrollWrapper">
|
|
14
|
-
<auro-header level="2" id="tabBehavior">Tab
|
|
15
|
-
<p>While the dialog is open, focus is trapped inside it. <code>Tab</code> moves forward through the dialog's focusable elements and <code>Shift</code> + <code>Tab</code> moves backward, both wrapping at the ends so focus never leaves the dialog. When the dialog closes, focus returns to the element that
|
|
16
|
-
<auro-header level="2" id="keyEvents">Key
|
|
14
|
+
<auro-header level="2" id="tabBehavior">Tab behavior</auro-header>
|
|
15
|
+
<p>While the dialog is open, focus is trapped inside it. <code>Tab</code> moves forward through the dialog's focusable elements and <code>Shift</code> + <code>Tab</code> moves backward, both wrapping at the ends so focus never leaves the dialog. When the dialog closes, focus returns to the element that was active when the dialog opened. The <code>triggerElement</code> property is a fallback for when no element was active.</p>
|
|
16
|
+
<auro-header level="2" id="keyEvents">Key events</auro-header>
|
|
17
17
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/keyboard-behavior/keyEvents.md) -->
|
|
18
18
|
<!-- The below content is automatically added from ./../docs/partials/keyboard-behavior/keyEvents.md -->
|
|
19
|
-
<p>The <code><auro-dialog></code> component responds to the following keys while it
|
|
19
|
+
<p>The <code><auro-dialog></code> component responds to the following keys while it's open.</p>
|
|
20
20
|
<table>
|
|
21
21
|
<thead>
|
|
22
22
|
<tr>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<tbody>
|
|
28
28
|
<tr>
|
|
29
29
|
<td><code>Tab</code></td>
|
|
30
|
-
<td>Moves focus to the next focusable element inside the dialog. Focus is trapped within the dialog
|
|
30
|
+
<td>Moves focus to the next focusable element inside the dialog. Focus is trapped within the dialog, so tabbing past the last element wraps to the first.</td>
|
|
31
31
|
</tr>
|
|
32
32
|
<tr>
|
|
33
33
|
<td><code>Shift</code> + <code>Tab</code></td>
|
|
@@ -35,17 +35,17 @@
|
|
|
35
35
|
</tr>
|
|
36
36
|
<tr>
|
|
37
37
|
<td><code>Esc</code></td>
|
|
38
|
-
<td>Dismisses a non-<code>modal</code> dialog. In a <code>modal</code> dialog the default cancel action is prevented, so <code>Esc</code>
|
|
38
|
+
<td>Dismisses a non-<code>modal</code> dialog. In a <code>modal</code> dialog the default cancel action is prevented, so <code>Esc</code> doesn't close it. People must use an explicit action in the footer.</td>
|
|
39
39
|
</tr>
|
|
40
40
|
<tr>
|
|
41
41
|
<td><code>Enter</code> / <code>Space</code></td>
|
|
42
|
-
<td>Activates the focused control (
|
|
42
|
+
<td>Activates the focused control (for example, a footer button), following the native behavior of that control.</td>
|
|
43
43
|
</tr>
|
|
44
44
|
</tbody>
|
|
45
45
|
</table>
|
|
46
46
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
47
|
-
<auro-header level="2" id="modalDifferences">Modal
|
|
48
|
-
<p>The <code>modal</code> attribute changes the dismissal keys. Because a modal dialog requires an explicit action to close, the native <code>Esc</code>
|
|
47
|
+
<auro-header level="2" id="modalDifferences">Modal differences</auro-header>
|
|
48
|
+
<p>The <code>modal</code> attribute changes the dismissal keys. Because a modal dialog requires an explicit action to close, the native <code>Esc</code> or cancel behavior is intercepted and prevented, so pressing <code>Esc</code> doesn't close a modal dialog. Non-modal dialogs close on <code>Esc</code> as expected. In both modes, <code>Tab</code> focus trapping behaves identically.</p>
|
|
49
49
|
</div>
|
|
50
50
|
</div>
|
|
51
51
|
</div>
|
package/demo/readme.md
CHANGED
|
@@ -12,31 +12,31 @@ 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
|
-
<p>
|
|
26
|
-
<p>Auro
|
|
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
|
+
<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>
|
|
26
|
+
<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
27
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
28
28
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
29
29
|
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
30
30
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
31
31
|
|
|
32
|
-
## Use
|
|
32
|
+
## Use cases
|
|
33
33
|
|
|
34
34
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
|
|
35
35
|
<!-- The below content is automatically added from ./docs/partials/useCases.md -->
|
|
36
|
-
<p>
|
|
36
|
+
<p>Use <code><auro-dialog></code> when people need to:</p>
|
|
37
37
|
<ul>
|
|
38
|
-
<li>
|
|
39
|
-
<li>
|
|
38
|
+
<li>Take an action before they do anything else or go back</li>
|
|
39
|
+
<li>View content that they can close when they're done</li>
|
|
40
40
|
</ul>
|
|
41
41
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
42
42
|
|
|
@@ -52,10 +52,10 @@ The following sections are editable by making changes to the following files:
|
|
|
52
52
|
|
|
53
53
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
54
54
|
|
|
55
|
-
### Define
|
|
55
|
+
### Define dependency in project
|
|
56
56
|
|
|
57
57
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
58
|
-
|
|
58
|
+
Import the component in each project that uses `<auro-dialog>`.
|
|
59
59
|
|
|
60
60
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
61
61
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
@@ -67,22 +67,22 @@ Defining the dependency within each project that is using the `<auro-dialog>` co
|
|
|
67
67
|
### Use CDN
|
|
68
68
|
|
|
69
69
|
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
|
|
70
|
-
|
|
70
|
+
If your project can't process JS assets, use the pre-processed assets. Legacy browsers, such as IE11, aren't supported.
|
|
71
71
|
|
|
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>
|
|
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
73
|
|
|
74
74
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
75
75
|
|
|
76
|
-
## Basic
|
|
76
|
+
## Basic example
|
|
77
77
|
|
|
78
78
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
79
79
|
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
80
80
|
|
|
81
81
|
<pre class="language-html"><code class="language-html"><div>
|
|
82
82
|
<auro-button id="openBasic">Open default dialog</auro-button>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<span slot="header">Default
|
|
83
|
+
</div>
|
|
84
|
+
<auro-dialog id="defaultDialog">
|
|
85
|
+
<span slot="header">Default dialog</span>
|
|
86
86
|
<div slot="content">
|
|
87
87
|
<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
88
|
<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 +95,31 @@ In cases where the project is not able to process JS assets, there are pre-proce
|
|
|
95
95
|
</ul>
|
|
96
96
|
</div>
|
|
97
97
|
<div slot="footer">
|
|
98
|
-
<auro-button secondary id="closeBasic">Close</auro-button>
|
|
98
|
+
<auro-button variant="secondary" id="closeBasic">Close</auro-button>
|
|
99
99
|
</div>
|
|
100
|
-
</auro-dialog></code></pre>
|
|
100
|
+
</auro-dialog></code></pre>
|
|
101
101
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
102
102
|
|
|
103
|
-
## Custom
|
|
103
|
+
## Custom component registration for version management
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
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
106
|
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
107
|
|
|
108
|
-
|
|
108
|
+
Installing the component as described in the Install section imports the class and registers the component globally for you.
|
|
109
109
|
|
|
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),
|
|
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), register the class manually under a custom element name to avoid conflicts.
|
|
111
111
|
|
|
112
|
-
|
|
112
|
+
To do this, import only the component class and call the `register(name)` method with a unique name:
|
|
113
113
|
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
115
115
|
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
116
116
|
|
|
117
117
|
<pre class="language-js"><code class="language-js">// Import the class only
|
|
118
118
|
import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
|
|
119
|
-
|
|
120
|
-
// Register with a custom name if desired
|
|
119
|
+
// Register with a custom name if desired
|
|
121
120
|
AuroDialog.register('custom-dialog');</code></pre>
|
|
122
121
|
|
|
123
|
-
This
|
|
122
|
+
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
123
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
125
124
|
<div class="exampleWrapper exampleWrapper--flex">
|
|
126
125
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./apiExamples/custom.html) -->
|
|
@@ -129,7 +128,7 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
129
128
|
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
130
129
|
</div>
|
|
131
130
|
<custom-dialog id="customDialog">
|
|
132
|
-
<span slot="header">Default
|
|
131
|
+
<span slot="header">Default dialog</span>
|
|
133
132
|
<div slot="content">
|
|
134
133
|
<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
134
|
<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 +141,7 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
142
141
|
</ul>
|
|
143
142
|
</div>
|
|
144
143
|
<div slot="footer">
|
|
145
|
-
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
144
|
+
<auro-button variant="secondary" id="closeCustom">Close</auro-button>
|
|
146
145
|
</div>
|
|
147
146
|
</custom-dialog>
|
|
148
147
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -154,9 +153,9 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
154
153
|
|
|
155
154
|
<pre class="language-html"><code class="language-html"><div>
|
|
156
155
|
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
157
|
-
</div>
|
|
158
|
-
|
|
159
|
-
<span slot="header">Default
|
|
156
|
+
</div>
|
|
157
|
+
<custom-dialog id="customDialog">
|
|
158
|
+
<span slot="header">Default dialog</span>
|
|
160
159
|
<div slot="content">
|
|
161
160
|
<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
161
|
<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 +168,8 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
|
|
|
169
168
|
</ul>
|
|
170
169
|
</div>
|
|
171
170
|
<div slot="footer">
|
|
172
|
-
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
171
|
+
<auro-button variant="secondary" id="closeCustom">Close</auro-button>
|
|
173
172
|
</div>
|
|
174
|
-
</custom-dialog></code></pre>
|
|
173
|
+
</custom-dialog></code></pre>
|
|
175
174
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
176
175
|
</auro-accordion>
|