@aurodesignsystem-dev/auro-dialog 0.0.0-pr95.1 → 0.0.0-pr97.0
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 +75 -69
- package/demo/api.js +6 -9
- package/demo/api.md +283 -268
- package/demo/api.min.js +2 -44
- package/demo/auro-dialog.min.js +65 -38
- package/demo/index.md +32 -103
- package/dist/{auro-dialog-a7_PNy6-.js → auro-dialog-C3FZ_07u.js} +8 -8
- package/dist/index.d.ts +231 -135
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +10 -8
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
|
-
##
|
|
34
|
+
## Use Cases
|
|
36
35
|
|
|
37
|
-
<!-- AURO-GENERATED-CONTENT:START (
|
|
38
|
-
|
|
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
|
-
[](https://github.com/AlaskaAirlines/auro-dialog/actions/workflows/release.yml)
|
|
46
48
|
[](https://www.npmjs.com/package/@aurodesignsystem/auro-dialog)
|
|
47
49
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
48
50
|

|
|
@@ -53,17 +55,10 @@ $ npm i @aurodesignsystem/auro-dialog
|
|
|
53
55
|
|
|
54
56
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
55
57
|
|
|
56
|
-
###
|
|
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
|
|
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
|
-
|
|
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
|
-
##
|
|
112
|
+
## Custom Component Registration for Version Management
|
|
105
113
|
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
122
|
-
|
|
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
|
-
|
|
126
|
+
```js
|
|
127
|
+
// Import the class only
|
|
128
|
+
import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
|
|
128
129
|
|
|
129
|
-
|
|
130
|
-
|
|
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="
|
|
168
|
+
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
135
169
|
</div>
|
|
136
|
-
<
|
|
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="
|
|
184
|
+
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
151
185
|
</div>
|
|
152
|
-
</
|
|
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.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/
|
|
4
|
+
import { initEditCloseButtonExample } from "../apiExamples/part_close-button";
|
|
5
5
|
import { initModalExample } from "../apiExamples/modal";
|
|
6
|
-
import { initPopoverAndDropdownExample } from "../apiExamples/
|
|
7
|
-
import { initSizeOptionsExample } from "../apiExamples/
|
|
8
|
-
import { initAriaLabelSlotExample } from "../apiExamples/
|
|
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
|
-
|
|
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
|