@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.
@@ -1,22 +1,22 @@
1
- <auro-header level="1" id="overview">Dialog - Keyboard Behavior</auro-header>
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 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>
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 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 opened it (or to the element set via <code>triggerElement</code>).</p>
16
- <auro-header level="2" id="keyEvents">Key Events</auro-header>
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>&lt;auro-dialog&gt;</code> component responds to the following keys while it is open.</p>
19
+ <p>The <code>&lt;auro-dialog&gt;</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 — tabbing past the last element wraps to the first.</td>
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> does <strong>not</strong> close it — the user must use an explicit action in the footer.</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> 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 (e.g. a footer button), following the native behavior of that control.</td>
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 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> / cancel behavior is intercepted and prevented — pressing <code>Esc</code> will not 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>
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 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` |
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>&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>
24
+ <p>The <code>&lt;auro-dialog&gt;</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 Cases
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>The <code>&lt;auro-dialog&gt;</code> component should be used in situations where users may:</p>
36
+ <p>Use <code>&lt;auro-dialog&gt;</code> when people need to:</p>
37
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>
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 Dependency in Project
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
- Defining the dependency within each project that is using the `<auro-dialog>` component.
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
- 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.
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">&lt;script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"&gt;&lt;/script&gt;</code></pre>
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>
73
73
 
74
74
  <!-- AURO-GENERATED-CONTENT:END -->
75
75
 
76
- ## Basic Example
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">&lt;div&gt;
82
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;
83
+ &lt;/div&gt;
84
+ &#10;&lt;auro-dialog id="defaultDialog"&gt;
85
+ &lt;span slot="header"&gt;Default dialog&lt;/span&gt;
86
86
  &lt;div slot="content"&gt;
87
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
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;
@@ -95,32 +95,31 @@ In cases where the project is not able to process JS assets, there are pre-proce
95
95
  &lt;/ul&gt;
96
96
  &lt;/div&gt;
97
97
  &lt;div slot="footer"&gt;
98
- &lt;auro-button secondary id="closeBasic"&gt;Close&lt;/auro-button&gt;
98
+ &lt;auro-button variant="secondary" id="closeBasic"&gt;Close&lt;/auro-button&gt;
99
99
  &lt;/div&gt;
100
- &lt;/auro-dialog&gt;</code></pre>
100
+ &lt;/auro-dialog&gt;</code></pre>
101
101
  <!-- AURO-GENERATED-CONTENT:END -->
102
102
 
103
- ## Custom Component Registration for Version Management
103
+ ## Custom component registration for version management
104
104
 
105
- There are two key parts to every Auro component: the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element definition.
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
- When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
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), you can manually register the class under a custom element name to avoid conflicts.
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
- You can do this by importing only the component class and using the `register(name)` method with a unique name:
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
+ &#10;// Register with a custom name if desired
121
120
  AuroDialog.register('custom-dialog');</code></pre>
122
121
 
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.
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 Dialog</span>
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">&lt;div&gt;
156
155
  &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;
156
+ &lt;/div&gt;
157
+ &#10;&lt;custom-dialog id="customDialog"&gt;
158
+ &lt;span slot="header"&gt;Default dialog&lt;/span&gt;
160
159
  &lt;div slot="content"&gt;
161
160
  &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
161
  &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;
@@ -169,8 +168,8 @@ This will create a new custom element `<custom-dialog>` that behaves exactly lik
169
168
  &lt;/ul&gt;
170
169
  &lt;/div&gt;
171
170
  &lt;div slot="footer"&gt;
172
- &lt;auro-button secondary id="closeCustom"&gt;Close&lt;/auro-button&gt;
171
+ &lt;auro-button variant="secondary" id="closeCustom"&gt;Close&lt;/auro-button&gt;
173
172
  &lt;/div&gt;
174
- &lt;/custom-dialog&gt;</code></pre>
173
+ &lt;/custom-dialog&gt;</code></pre>
175
174
  <!-- AURO-GENERATED-CONTENT:END -->
176
175
  </auro-accordion>