@aurodesignsystem/auro-dialog 4.0.0 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/demo/index.html CHANGED
@@ -56,8 +56,8 @@
56
56
  </script>
57
57
 
58
58
  <!-- If additional elements are needed for the demo, add them here. -->
59
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
60
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/dist/auro-hyperlink__bundled.js" type="module"></script>
61
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/dist/auro-button__bundled.js" type="module"></script>
59
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
60
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
61
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
62
62
  </body>
63
63
  </html>
package/demo/index.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <!--
2
- The index.md file is a compiled document. No edits should be made directly to this file.
3
- README.md is created by running `npm run build:docs`.
4
- This file is generated based on a template fetched from `./docs/partials/index.md`
2
+ THIS PAGE'S CONTENT SHOULD BE KEPT MINIMAL.
3
+ ONLY ADD EXAMPLES THAT ARE TRULY NECESSARY FOR THE INDEX PAGE — THE BASIC EXAMPLE IS USUALLY ENOUGH.
4
+ ALL OTHER EXAMPLES SHOULD GO IN THE API DOCUMENTATION.
5
5
  -->
6
6
 
7
- # Dialog
8
-
7
+ # Dialog
8
+
9
9
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/description.md) -->
10
10
  <!-- The below content is automatically added from ./../docs/partials/description.md -->
11
11
  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.
@@ -15,8 +15,8 @@ The component also supports a modal (blocking) state where the user must interac
15
15
  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.
16
16
  <!-- AURO-GENERATED-CONTENT:END -->
17
17
 
18
- ## auro-dialog use cases
19
-
18
+ ## Use Cases
19
+
20
20
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/useCases.md) -->
21
21
  <!-- The below content is automatically added from ./../docs/partials/useCases.md -->
22
22
  The `<auro-dialog>` component should be used in situations where users may:
@@ -25,13 +25,6 @@ The `<auro-dialog>` component should be used in situations where users may:
25
25
  * Be prompted to view content with the option of closing it
26
26
  <!-- AURO-GENERATED-CONTENT:END -->
27
27
 
28
- ## Additional Information
29
-
30
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/readmeAddlInfo.md) -->
31
- <!-- The below content is automatically added from ./../docs/partials/readmeAddlInfo.md -->
32
- **Important Notice**: This component no longer lives within the `auro-interruption` repository, as that is now being deprecated. `<auro-dialog>` is now a standalone component and users will be required to install it seperately. See the [Install Page](https://auro.alaskaair.com/components/auro/dialog/install) for instructions on how to install the component.
33
- <!-- AURO-GENERATED-CONTENT:END -->
34
-
35
28
  ## Set Up
36
29
 
37
30
  Triggering the dialog relies on functions being installed. See the following example code that is installed into this demo.
@@ -74,6 +67,11 @@ It should be noted that the `footer` slot is reserved for the placement of actio
74
67
 
75
68
  ## Example(s)
76
69
 
70
+ ### Basic
71
+
72
+ The dialog open state is controlled via the `open` attribute, or by programmatically setting the `open` property to `true`.
73
+ You can see in the example below under the "See Code" section that we are controlling our dialogs by adding and removing the `open` attribute.
74
+
77
75
  <div class="exampleWrapper">
78
76
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
79
77
  <!-- The below content is automatically added from ./../apiExamples/basic.html -->
@@ -127,74 +125,27 @@ It should be noted that the `footer` slot is reserved for the placement of actio
127
125
  </auro-dialog>
128
126
  ```
129
127
  <!-- AURO-GENERATED-CONTENT:END -->
130
- </auro-accordion>
131
- Having a closing statement about your example helps to really complete the thought with your reader.
128
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/basic.js) -->
129
+ <!-- The below code snippet is automatically added from ./../apiExamples/basic.js -->
132
130
 
133
- ## Recommended Use and Version Control
134
-
135
- There are two important parts of every Auro component. The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</a> and the custom element. The class is exported and then used as part of defining the Web Component. When importing this component as described in the <a href="#install">install</a> section, the class is imported and the `auro-dialog` custom element is defined automatically.
136
-
137
- To protect from versioning conflicts with other instances of the component being loaded, it is recommended to use our `AuroDialog.register(name)` method and pass in a unique name.
138
-
139
131
  ```js
140
- import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
141
-
142
- AuroDialog.register('custom-dialog');
132
+ export function initBasicExample() {
133
+ const buttons = [
134
+ document.querySelector("#openBasic"),
135
+ document.querySelector("#closeBasic"),
136
+ ];
137
+ const dialog = document.querySelector("#defaultDialog");
138
+
139
+ buttons.forEach((button) => {
140
+ button.addEventListener("click", () => {
141
+ if (dialog.hasAttribute("open")) {
142
+ dialog.removeAttribute("open");
143
+ } else {
144
+ dialog.setAttribute("open", true);
145
+ }
146
+ });
147
+ });
148
+ }
143
149
  ```
144
-
145
- This will create a new custom element that you can use in your HTML that will function identically to the `auro-dialog` element.
146
-
147
- <div class="exampleWrapper">
148
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/custom.html) -->
149
- <!-- The below content is automatically added from ./../apiExamples/custom.html -->
150
- <div>
151
- <auro-button id="openCustom">Open default dialog</auro-button>
152
- </div>
153
- <custom-dialog id="customDialog">
154
- <span slot="header">Default Dialog</span>
155
- <div slot="content">
156
- <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>
157
- <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>
158
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
159
- <ul>
160
- <li>Caerphilly croque monsieur fondue</li>
161
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
162
- <li>Cheddar cheese and biscuits chalk and cheese</li>
163
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
164
- </ul>
165
- </div>
166
- <div slot="footer">
167
- <auro-button secondary id="closeCustom">Close</auro-button>
168
- </div>
169
- </custom-dialog>
170
- <!-- AURO-GENERATED-CONTENT:END -->
171
- </div>
172
- <auro-accordion alignRight>
173
- <span slot="trigger">See code</span>
174
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/custom.html) -->
175
- <!-- The below code snippet is automatically added from ./../apiExamples/custom.html -->
176
-
177
- ```html
178
- <div>
179
- <auro-button id="openCustom">Open default dialog</auro-button>
180
- </div>
181
- <custom-dialog id="customDialog">
182
- <span slot="header">Default Dialog</span>
183
- <div slot="content">
184
- <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>
185
- <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>
186
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
187
- <ul>
188
- <li>Caerphilly croque monsieur fondue</li>
189
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
190
- <li>Cheddar cheese and biscuits chalk and cheese</li>
191
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
192
- </ul>
193
- </div>
194
- <div slot="footer">
195
- <auro-button secondary id="closeCustom">Close</auro-button>
196
- </div>
197
- </custom-dialog>
198
- ```
199
150
  <!-- AURO-GENERATED-CONTENT:END -->
200
- </auro-accordion>
151
+ </auro-accordion>