@aurodesignsystem-dev/auro-dialog 0.0.0-pr103.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/CHANGELOG.md +295 -0
- package/LICENSE +201 -0
- package/NOTICE +2 -0
- package/README.md +189 -0
- package/demo/api.html +64 -0
- package/demo/api.js +33 -0
- package/demo/api.md +803 -0
- package/demo/api.min.js +219 -0
- package/demo/auro-dialog.min.js +950 -0
- package/demo/index.html +63 -0
- package/demo/index.js +24 -0
- package/demo/index.md +151 -0
- package/demo/index.min.js +41 -0
- package/dist/auro-dialog-BNnIwNXB.js +128 -0
- package/dist/index.d.ts +230 -0
- package/dist/index.js +1 -0
- package/dist/registered.js +1 -0
- package/package.json +93 -0
package/README.md
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
The README.md file is a compiled document. No edits should be made directly to this file.
|
|
3
|
+
|
|
4
|
+
README.md is created by running `npm run build:docs`.
|
|
5
|
+
|
|
6
|
+
This file is generated based on a template fetched from
|
|
7
|
+
`https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/README.md`
|
|
8
|
+
and copied to `./componentDocs/README.md` each time the docs are compiled.
|
|
9
|
+
|
|
10
|
+
The following sections are editable by making changes to the following files:
|
|
11
|
+
|
|
12
|
+
| SECTION | DESCRIPTION | FILE LOCATION |
|
|
13
|
+
|------------------------|---------------------------------------------------|-------------------------------------|
|
|
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` |
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
# Dialog
|
|
21
|
+
|
|
22
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/description.md) -->
|
|
23
|
+
<!-- The below content is automatically added from ./docs/partials/description.md -->
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
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.
|
|
27
|
+
|
|
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
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
30
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/readmeAddlInfo.md) -->
|
|
31
|
+
<!-- The below content is automatically added from ./docs/partials/readmeAddlInfo.md -->
|
|
32
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
33
|
+
|
|
34
|
+
## Use Cases
|
|
35
|
+
|
|
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
|
+
|
|
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
|
|
42
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
43
|
+
|
|
44
|
+
## Install
|
|
45
|
+
|
|
46
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentInstall.md) -->
|
|
47
|
+
[](https://github.com/AlaskaAirlines/auro-dialog/actions/workflows/release.yml)
|
|
48
|
+
[](https://www.npmjs.com/package/@aurodesignsystem/auro-dialog)
|
|
49
|
+
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
50
|
+

|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
$ npm i @aurodesignsystem/auro-dialog
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
57
|
+
|
|
58
|
+
### Define Dependency in Project
|
|
59
|
+
|
|
60
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImportDescription.md) -->
|
|
61
|
+
Defining the dependency within each project that is using the `<auro-dialog>` component.
|
|
62
|
+
|
|
63
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
64
|
+
<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/auro-templates/main/templates/default/partials/usage/componentImport.md) -->
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import "@aurodesignsystem/auro-dialog";
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
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
|
+
|
|
85
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./apiExamples/basic.html) -->
|
|
86
|
+
<!-- The below code snippet is automatically added from ./apiExamples/basic.html -->
|
|
87
|
+
|
|
88
|
+
```html
|
|
89
|
+
<div>
|
|
90
|
+
<auro-button id="openBasic">Open default dialog</auro-button>
|
|
91
|
+
</div>
|
|
92
|
+
<auro-dialog id="defaultDialog">
|
|
93
|
+
<span slot="header">Default Dialog</span>
|
|
94
|
+
<div slot="content">
|
|
95
|
+
<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>
|
|
96
|
+
<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>
|
|
97
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
98
|
+
<ul>
|
|
99
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
100
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
101
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
102
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</div>
|
|
105
|
+
<div slot="footer">
|
|
106
|
+
<auro-button secondary id="closeBasic">Close</auro-button>
|
|
107
|
+
</div>
|
|
108
|
+
</auro-dialog>
|
|
109
|
+
```
|
|
110
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
111
|
+
|
|
112
|
+
## Custom Component Registration for Version Management
|
|
113
|
+
|
|
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.
|
|
116
|
+
|
|
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.
|
|
118
|
+
|
|
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.
|
|
120
|
+
|
|
121
|
+
You can do this by importing only the component class and using the `register(name)` method with a unique name:
|
|
122
|
+
|
|
123
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./docs/partials/customRegistration.md) -->
|
|
124
|
+
<!-- The below content is automatically added from ./docs/partials/customRegistration.md -->
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
// Import the class only
|
|
128
|
+
import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
|
|
129
|
+
|
|
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 -->
|
|
165
|
+
|
|
166
|
+
```html
|
|
167
|
+
<div>
|
|
168
|
+
<auro-button id="openCustom">Open default dialog</auro-button>
|
|
169
|
+
</div>
|
|
170
|
+
<custom-dialog id="customDialog">
|
|
171
|
+
<span slot="header">Default Dialog</span>
|
|
172
|
+
<div slot="content">
|
|
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>
|
|
174
|
+
<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>
|
|
175
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
176
|
+
<ul>
|
|
177
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
178
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
179
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
180
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
181
|
+
</ul>
|
|
182
|
+
</div>
|
|
183
|
+
<div slot="footer">
|
|
184
|
+
<auro-button secondary id="closeCustom">Close</auro-button>
|
|
185
|
+
</div>
|
|
186
|
+
</custom-dialog>
|
|
187
|
+
```
|
|
188
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
189
|
+
</auro-accordion>
|
package/demo/api.html
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
3
|
+
See LICENSE in the project root for license information.
|
|
4
|
+
|
|
5
|
+
HTML in this document is standardized and NOT to be edited.
|
|
6
|
+
All demo code should be added/edited in ./demo/api.md
|
|
7
|
+
|
|
8
|
+
With the exception of adding custom elements if needed for the demo.
|
|
9
|
+
|
|
10
|
+
----------------------- DO NOT EDIT -----------------------------
|
|
11
|
+
|
|
12
|
+
-->
|
|
13
|
+
|
|
14
|
+
<!DOCTYPE html>
|
|
15
|
+
<html lang="en">
|
|
16
|
+
<head>
|
|
17
|
+
<meta charset="UTF-8" />
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
19
|
+
<title>Auro Web Component Demo | auro-dialog</title>
|
|
20
|
+
|
|
21
|
+
<!-- Prism.js Stylesheet -->
|
|
22
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/prismjs@1.24.1/themes/prism.css"/>
|
|
23
|
+
|
|
24
|
+
<!-- Legacy reference is still needed to support auro-dialog's use of legacy token values at this time -->
|
|
25
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
|
|
26
|
+
|
|
27
|
+
<!-- Design Token Alaska Theme -->
|
|
28
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
|
|
29
|
+
|
|
30
|
+
<!-- Webcore Stylesheet Alaska Theme -->
|
|
31
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
|
|
32
|
+
|
|
33
|
+
<!-- Demo Specific Styles -->
|
|
34
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
|
|
35
|
+
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
|
|
36
|
+
</head>
|
|
37
|
+
<body class="auro-markdown">
|
|
38
|
+
<main></main>
|
|
39
|
+
|
|
40
|
+
<script type="module">
|
|
41
|
+
import 'https://cdn.jsdelivr.net/npm/marked@latest/marked.min.js';
|
|
42
|
+
import 'https://cdn.jsdelivr.net/npm/prismjs@latest/prism.js';
|
|
43
|
+
fetch('./api.md')
|
|
44
|
+
.then((response) => response.text())
|
|
45
|
+
.then((text) => {
|
|
46
|
+
const rawHtml = marked.parse(text);
|
|
47
|
+
document.querySelector('main').innerHTML = rawHtml;
|
|
48
|
+
Prism.highlightAll();
|
|
49
|
+
});
|
|
50
|
+
</script>
|
|
51
|
+
<script type="module" data-demo-script="true">
|
|
52
|
+
import { initExamples } from './api.min.js';
|
|
53
|
+
initExamples();
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<!-- If additional elements are needed for the demo, add them here. -->
|
|
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
|
+
</body>
|
|
64
|
+
</html>
|
package/demo/api.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { initAccessibilityExample } from "../apiExamples/accessibility";
|
|
2
|
+
import { initBasicExample } from "../apiExamples/basic";
|
|
3
|
+
import { initDecoupledExample } from "../apiExamples/decoupled";
|
|
4
|
+
import { initEditCloseButtonExample } from "../apiExamples/close-button";
|
|
5
|
+
import { initModalExample } from "../apiExamples/modal";
|
|
6
|
+
import { initPopoverAndDropdownExample } from "../apiExamples/popover-and-dropdown";
|
|
7
|
+
import { initSizeOptionsExample } from "../apiExamples/size-options";
|
|
8
|
+
import { initAriaLabelSlotExample } from "../apiExamples/aria-label";
|
|
9
|
+
|
|
10
|
+
import "../src/registered"
|
|
11
|
+
|
|
12
|
+
export function initExamples(initCount) {
|
|
13
|
+
// biome-ignore lint/style/noParameterAssign: legacy error handling
|
|
14
|
+
initCount = initCount || 0;
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
initBasicExample();
|
|
18
|
+
initSizeOptionsExample();
|
|
19
|
+
initModalExample();
|
|
20
|
+
initDecoupledExample();
|
|
21
|
+
initPopoverAndDropdownExample();
|
|
22
|
+
initEditCloseButtonExample();
|
|
23
|
+
initAriaLabelSlotExample();
|
|
24
|
+
initAccessibilityExample();
|
|
25
|
+
} catch (_err) {
|
|
26
|
+
if (initCount <= 20) {
|
|
27
|
+
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
initExamples(initCount + 1);
|
|
30
|
+
}, 100);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|