@aurodesignsystem-dev/auro-dialog 0.0.0-pr95.1 → 0.0.0-pr97.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/README.md CHANGED
@@ -28,21 +28,23 @@ The component also supports a modal (blocking) state where the user must interac
28
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.
29
29
  <!-- AURO-GENERATED-CONTENT:END -->
30
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.
31
+ <!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
33
32
  <!-- AURO-GENERATED-CONTENT:END -->
34
33
 
35
- ## UI development browser support
34
+ ## Use Cases
36
35
 
37
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/browserSupport.md) -->
38
- For the most up to date information on [UI development browser support](https://auro.alaskaair.com/support/browsersSupport)
36
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
37
+ <!-- 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
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
40
42
  <!-- AURO-GENERATED-CONTENT:END -->
41
43
 
42
44
  ## Install
43
45
 
44
46
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
45
- [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-dialog/testPublish.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-dialog/actions/workflows/testPublish.yml)
47
+ [![Build Status](https://img.shields.io/github/actions/workflow/status/AlaskaAirlines/auro-dialog/release.yml?style=for-the-badge)](https://github.com/AlaskaAirlines/auro-dialog/actions/workflows/release.yml)
46
48
  [![See it on NPM!](https://img.shields.io/npm/v/@aurodesignsystem/auro-dialog?style=for-the-badge&color=orange)](https://www.npmjs.com/package/@aurodesignsystem/auro-dialog)
47
49
  [![License](https://img.shields.io/npm/l/@aurodesignsystem/auro-dialog?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
48
50
  ![ESM supported](https://img.shields.io/badge/ESM-compatible-FFE900?style=for-the-badge)
@@ -53,17 +55,10 @@ $ npm i @aurodesignsystem/auro-dialog
53
55
 
54
56
  <!-- AURO-GENERATED-CONTENT:END -->
55
57
 
56
- ### Design Token CSS Custom Property dependency
57
-
58
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/designTokens.md) -->
59
- The use of any Auro custom element has a dependency on the [Auro Design Tokens](https://auro.alaskaair.com/getting-started/developers/design-tokens).
60
-
61
- <!-- AURO-GENERATED-CONTENT:END -->
62
-
63
- ### Define dependency in project component
58
+ ### Define Dependency in Project
64
59
 
65
60
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
66
- Defining the component dependency within each component that is using the `<auro-dialog>` component.
61
+ Defining the dependency within each project that is using the `<auro-dialog>` component.
67
62
 
68
63
  <!-- AURO-GENERATED-CONTENT:END -->
69
64
  <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
@@ -73,7 +68,20 @@ import "@aurodesignsystem/auro-dialog";
73
68
  ```
74
69
 
75
70
  <!-- AURO-GENERATED-CONTENT:END -->
76
- **Reference component in HTML**
71
+
72
+ ### Use CDN
73
+
74
+ <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
75
+ 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
+
77
+ ```html
78
+ <script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"></script>
79
+ ```
80
+
81
+ <!-- AURO-GENERATED-CONTENT:END -->
82
+
83
+ ## Basic Example
84
+
77
85
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
78
86
  <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
79
87
 
@@ -101,39 +109,65 @@ import "@aurodesignsystem/auro-dialog";
101
109
  ```
102
110
  <!-- AURO-GENERATED-CONTENT:END -->
103
111
 
104
- ## Use CDN
112
+ ## Custom Component Registration for Version Management
105
113
 
106
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/bundleInstallDescription.md) -->
107
- 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.
114
+ 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.
115
+ The class defines the component’s behavior, while the custom element registers it under a specific name so it can be used in HTML.
108
116
 
109
- ```html
110
- <script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-dialog@latest/+esm"></script>
111
- ```
117
+ When you install the component as described on the `Install` page, the class is imported automatically, and the component is registered globally for you.
112
118
 
113
- <!-- AURO-GENERATED-CONTENT:END -->
114
-
115
- ## auro-dialog use cases
119
+ 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.
116
120
 
117
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/useCases.md) -->
118
- <!-- The below content is automatically added from ./docs/partials/useCases.md -->
119
- The `<auro-dialog>` component should be used in situations where users may:
121
+ You can do this by importing only the component class and using the `register(name)` method with a unique name:
120
122
 
121
- * Be prompted to take an action before doing anything else or going back
122
- * Be prompted to view content with the option of closing it
123
- <!-- AURO-GENERATED-CONTENT:END -->
124
-
125
- ## API Code Examples
123
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
124
+ <!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
126
125
 
127
- ### Default auro-dialog
126
+ ```js
127
+ // Import the class only
128
+ import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
128
129
 
129
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
130
- <!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
130
+ // Register with a custom name if desired
131
+ AuroDialog.register('custom-dialog');
132
+ ```
133
+
134
+ 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
+ <!-- AURO-GENERATED-CONTENT:END -->
136
+ <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 -->
160
+ </div>
161
+ <auro-accordion alignRight>
162
+ <span slot="trigger">See code</span>
163
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/custom.html) -->
164
+ <!-- The below code snippet is automatically added from ./apiExamples/custom.html -->
131
165
 
132
166
  ```html
133
167
  <div>
134
- <auro-button id="openBasic">Open default dialog</auro-button>
168
+ <auro-button id="openCustom">Open default dialog</auro-button>
135
169
  </div>
136
- <auro-dialog id="defaultDialog">
170
+ <custom-dialog id="customDialog">
137
171
  <span slot="header">Default Dialog</span>
138
172
  <div slot="content">
139
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>
@@ -147,37 +181,9 @@ The `<auro-dialog>` component should be used in situations where users may:
147
181
  </ul>
148
182
  </div>
149
183
  <div slot="footer">
150
- <auro-button secondary id="closeBasic">Close</auro-button>
184
+ <auro-button secondary id="closeCustom">Close</auro-button>
151
185
  </div>
152
- </auro-dialog>
186
+ </custom-dialog>
153
187
  ```
154
188
  <!-- AURO-GENERATED-CONTENT:END -->
155
-
156
- ## Development
157
-
158
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/developmentDescription.md) -->
159
- In order to develop against this project, if you are not part of the core team, you will be required to fork the project prior to submitting a pull request.
160
-
161
- Please be sure to review the [contribution guidelines](https://auro.alaskaair.com/contributing) for this project. Please make sure to **pay special attention** to the **conventional commits** section of the document.
162
-
163
- <!-- AURO-GENERATED-CONTENT:END -->
164
-
165
- ### Start development environment
166
-
167
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/localhost.md) -->
168
- Once the project has been cloned to your local resource and you have installed all the dependencies you will need to open a shell session to run the **dev server**.
169
-
170
- ```shell
171
- $ npm run dev
172
- ```
173
-
174
- Open [localhost:8000](http://localhost:8000/)
175
-
176
- <!-- AURO-GENERATED-CONTENT:END -->
177
-
178
- ### Testing
179
-
180
- <!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/development/testing.md) -->
181
- Automated tests are required for every Auro component. See `.\test\auro-dialog.test.js` for the tests for this component. Run `npm run test` to run the tests and check code coverage. Tests must pass and meet a certain coverage threshold to commit. See [the testing documentation](https://auro.alaskaair.com/support/tests) for more details.
182
-
183
- <!-- AURO-GENERATED-CONTENT:END -->
189
+ </auro-accordion>
package/demo/api.html CHANGED
@@ -54,11 +54,11 @@
54
54
  </script>
55
55
 
56
56
  <!-- If additional elements are needed for the demo, add them here. -->
57
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
58
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-menu@latest/dist/auro-menu__bundled.js" type="module"></script>
59
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-combobox@latest/dist/auro-combobox__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-popover@latest/dist/auro-popover__bundled.js" type="module"></script>
62
- <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/dist/auro-button__bundled.js" type="module"></script>
57
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
58
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-menu/+esm" type="module"></script>
59
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-combobox/+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-popover@latest/+esm" type="module"></script>
62
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
63
63
  </body>
64
64
  </html>
package/demo/api.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { initAccessibilityExample } from "../apiExamples/accessibility";
2
2
  import { initBasicExample } from "../apiExamples/basic";
3
3
  import { initDecoupledExample } from "../apiExamples/decoupled";
4
- import { initEditCloseButtonExample } from "../apiExamples/editCloseButton";
4
+ import { initEditCloseButtonExample } from "../apiExamples/part_close-button";
5
5
  import { initModalExample } from "../apiExamples/modal";
6
- import { initPopoverAndDropdownExample } from "../apiExamples/popoverAndDropdown";
7
- import { initSizeOptionsExample } from "../apiExamples/sizeOptions";
8
- import { initAriaLabelSlotExample } from "../apiExamples/ariaLabelSlot";
6
+ import { initPopoverAndDropdownExample } from "../apiExamples/popover-and-dropdown";
7
+ import { initSizeOptionsExample } from "../apiExamples/size-options";
8
+ import { initAriaLabelSlotExample } from "../apiExamples/slot_aria-label";
9
9
 
10
10
  import "../src/registered"
11
11
 
@@ -15,13 +15,10 @@ export function initExamples(initCount) {
15
15
 
16
16
  try {
17
17
  initBasicExample();
18
- initAccessibilityExample();
19
- initDecoupledExample();
20
- initEditCloseButtonExample();
18
+ initSizeOptionsExample();
21
19
  initModalExample();
20
+ initDecoupledExample();
22
21
  initPopoverAndDropdownExample();
23
- initSizeOptionsExample();
24
- initAriaLabelSlotExample();
25
22
  } catch (_err) {
26
23
  if (initCount <= 20) {
27
24
  // setTimeout handles issue where content is sometimes loaded after the functions get called