@aurodesignsystem/auro-dialog 4.2.0 → 4.2.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +3 -19
  2. package/README.md +8 -9
  3. package/demo/accessibility.html +42 -0
  4. package/demo/accessibility.js +21 -0
  5. package/demo/accessibility.md +129 -0
  6. package/demo/accessibility.min.js +3969 -0
  7. package/demo/api.html +16 -40
  8. package/demo/api.md +0 -750
  9. package/demo/customize.html +45 -0
  10. package/demo/{api.js → customize.js} +2 -14
  11. package/demo/customize.md +226 -0
  12. package/demo/customize.min.js +3974 -0
  13. package/demo/demo-nav.css +32 -0
  14. package/demo/design.html +42 -0
  15. package/demo/design.js +23 -0
  16. package/demo/design.md +306 -0
  17. package/demo/design.min.js +4041 -0
  18. package/demo/getting-started.html +38 -0
  19. package/demo/getting-started.md +295 -0
  20. package/demo/index.html +17 -36
  21. package/demo/index.js +2 -3
  22. package/demo/index.md +220 -144
  23. package/demo/index.min.js +3984 -7
  24. package/demo/keyboard-behavior.html +38 -0
  25. package/demo/keyboard-behavior.md +51 -0
  26. package/demo/pages.json +1 -0
  27. package/demo/readme.html +42 -0
  28. package/demo/readme.js +24 -0
  29. package/demo/readme.md +176 -0
  30. package/demo/{auro-dialog.min.js → readme.min.js} +434 -281
  31. package/demo/support/demo-support.js +140 -0
  32. package/demo/voiceover.html +38 -0
  33. package/demo/voiceover.md +19 -0
  34. package/demo/why-dialog.html +38 -0
  35. package/demo/why-dialog.md +36 -0
  36. package/dist/{auro-dialog-CWkXz5VA.js → auro-dialog-T9I85UZL.js} +20 -20
  37. package/dist/index.d.ts +198 -98
  38. package/dist/index.js +1 -1
  39. package/dist/registered.js +1 -1
  40. package/package.json +6 -6
  41. package/demo/api.min.js +0 -219
@@ -0,0 +1,45 @@
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
+ Demo shell. Content authored in ../docs/pages/customize.md → ./customize.md.
6
+ Rendered by ./demo-support.js (remark/rehype) with the top page-nav from ./pages.json.
7
+ -->
8
+ <!DOCTYPE html>
9
+ <html lang="en">
10
+ <head>
11
+ <meta charset="UTF-8" />
12
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
13
+ <title>Auro Web Component Demo | auro-dialog | Customize</title>
14
+
15
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.9.0/build/styles/github.min.css"/>
16
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/legacy/auro-classic/CSSCustomProperties.css"/>
17
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/design-tokens@latest/dist/themes/alaska/CSSCustomProperties--alaska.min.css"/>
18
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/bundled/themes/alaska.global.min.css" />
19
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/demoWrapper.css" />
20
+ <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/@aurodesignsystem/webcorestylesheets@latest/dist/elementDemoStyles.css" />
21
+ <link rel="stylesheet" type="text/css" href="./demo-nav.css" />
22
+ </head>
23
+ <body class="auro-markdown">
24
+ <main></main>
25
+
26
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
27
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
28
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-header@latest/+esm" type="module"></script>
29
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
30
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-hyperlink@latest/+esm" type="module"></script>
31
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
32
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-menu/+esm" type="module"></script>
33
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@latest/auro-combobox/+esm" type="module"></script>
34
+ <script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-popover@latest/+esm" type="module"></script>
35
+
36
+ <script type="module">
37
+ import { renderPage } from './support/demo-support.js';
38
+ await renderPage('./customize.md');
39
+ </script>
40
+ <script type="module" data-demo-script="true">
41
+ import { initExamples } from './customize.min.js';
42
+ initExamples();
43
+ </script>
44
+ </body>
45
+ </html>
@@ -1,27 +1,15 @@
1
- import { initAccessibilityExample } from "../apiExamples/accessibility";
2
- import { initBasicExample } from "../apiExamples/basic";
3
- import { initDecoupledExample } from "../apiExamples/decoupled";
4
1
  import { initEditCloseButtonExample } from "../apiExamples/close-button";
5
- import { initModalExample } from "../apiExamples/modal";
6
2
  import { initPopoverAndDropdownExample } from "../apiExamples/popover-and-dropdown";
7
- import { initSizeOptionsExample } from "../apiExamples/size-options";
8
- import { initAriaLabelSlotExample } from "../apiExamples/aria-label";
9
3
 
10
- import "../src/registered"
4
+ import "../src/registered";
11
5
 
12
6
  export function initExamples(initCount) {
13
7
  // biome-ignore lint/style/noParameterAssign: legacy error handling
14
8
  initCount = initCount || 0;
15
9
 
16
10
  try {
17
- initBasicExample();
18
- initSizeOptionsExample();
19
- initModalExample();
20
- initDecoupledExample();
21
- initPopoverAndDropdownExample();
22
11
  initEditCloseButtonExample();
23
- initAriaLabelSlotExample();
24
- initAccessibilityExample();
12
+ initPopoverAndDropdownExample();
25
13
  } catch (_err) {
26
14
  if (initCount <= 20) {
27
15
  // setTimeout handles issue where content is sometimes loaded after the functions get called
@@ -0,0 +1,226 @@
1
+ <auro-header level="1" id="overview">Dialog - Customize</auro-header>
2
+ <div class="contentWrapper">
3
+ <nav>
4
+ <auro-nav anchorNavContent=".scrollWrapper">
5
+ <span slot="mobileToggleCollapsed">View More</span>
6
+ <span slot="mobileToggleExpanded">View Less</span>
7
+ <auro-anchorlink fluid href="#cssParts">CSS Shadow Parts</auro-anchorlink>
8
+ <auro-anchorlink fluid href="#closeButtonPart">Close Button</auro-anchorlink>
9
+ <auro-anchorlink fluid href="#tokens">Design Tokens</auro-anchorlink>
10
+ <auro-anchorlink fluid href="#customRegistration">Custom Registration</auro-anchorlink>
11
+ <auro-anchorlink fluid href="#layeredComponents">Layered Components</auro-anchorlink>
12
+ </auro-nav>
13
+ </nav>
14
+ <div class="mainContent">
15
+ <div class="scrollWrapper">
16
+ <auro-header level="2" id="cssParts">CSS Shadow Parts</auro-header>
17
+ <p>The dialog exposes the following <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part" target="_blank">CSS shadow parts</auro-hyperlink> for targeted styling, e.g. <code>auro-dialog::part(dialog-header)</code>.</p>
18
+ <table>
19
+ <thead>
20
+ <tr><th>Part</th><th>Description</th></tr>
21
+ </thead>
22
+ <tbody>
23
+ <tr><td><code>dialog</code></td><td>Apply CSS to the entire dialog.</td></tr>
24
+ <tr><td><code>dialog-header</code></td><td>Apply CSS to the header of the dialog.</td></tr>
25
+ <tr><td><code>dialog-content</code></td><td>Apply CSS to the content of the dialog.</td></tr>
26
+ <tr><td><code>dialog-footer</code></td><td>Apply CSS to the footer of the dialog.</td></tr>
27
+ <tr><td><code>close-button</code></td><td>Adjust the position of the close (&times;) icon in the dialog window.</td></tr>
28
+ <tr><td><code>dialog-overlay</code></td><td><strong>Deprecated.</strong> Use <code>--ds-auro-dialog-overlay-modal-background-color</code> or <code>--ds-auro-dialog-overlay-open-background-color</code> for backdrop styling instead.</td></tr>
29
+ </tbody>
30
+ </table>
31
+ <auro-header level="2" id="closeButtonPart">Close Button</auro-header>
32
+ <p>The close button can be repositioned via the <code>close-button</code> part.</p>
33
+ <div class="exampleWrapper">
34
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/close-button.html) -->
35
+ <!-- The below content is automatically added from ./../apiExamples/close-button.html -->
36
+ <div>
37
+ <auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
38
+ </div>
39
+ <style>
40
+ .example::part(close-button) {
41
+ top: var(--ds-size-400);
42
+ right: var(--ds-size-400);
43
+ }
44
+ </style>
45
+ <auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
46
+ <span slot="content">
47
+ <img style="display: block; width: 100%" src="https://worldairlinenews.files.wordpress.com/2022/05/alaska-737-800-sswl-n538as-22-star-warstko-sfo-mdblr-5.4.22.jpg" alt="alaska airlines pride lights" />
48
+ <div class="unformattedWrapper">
49
+ <h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
50
+ Notice the custom location of the close button as well as the custom color.
51
+ </div>
52
+ </span>
53
+ </auro-dialog>
54
+ <!-- AURO-GENERATED-CONTENT:END -->
55
+ </div>
56
+ <auro-accordion alignRight>
57
+ <span slot="trigger">See code</span>
58
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/close-button.html) -->
59
+ <!-- The below code snippet is automatically added from ./../apiExamples/close-button.html -->
60
+
61
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
62
+ &lt;auro-button id="openEditDialog"&gt;Unformatted w/custom close button&lt;/auro-button&gt;
63
+ &lt;/div&gt;
64
+ &lt;style&gt;
65
+ .example::part(close-button) {
66
+ top: var(--ds-size-400);
67
+ right: var(--ds-size-400);
68
+ }
69
+ &lt;/style&gt;
70
+ &lt;auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example"&gt;
71
+ &lt;span slot="content"&gt;
72
+ &lt;img style="display: block; width: 100%" src="https://worldairlinenews.files.wordpress.com/2022/05/alaska-737-800-sswl-n538as-22-star-warstko-sfo-mdblr-5.4.22.jpg" alt="alaska airlines pride lights" /&gt;
73
+ &lt;div class="unformattedWrapper"&gt;
74
+ &lt;h1 id="dialog-header" class="heading-lg"&gt;Unformatted w/custom close button&lt;/h1&gt;
75
+ Notice the custom location of the close button as well as the custom color.
76
+ &lt;/div&gt;
77
+ &lt;/span&gt;
78
+ &lt;/auro-dialog&gt;</code></pre>
79
+ <!-- AURO-GENERATED-CONTENT:END -->
80
+ </auro-accordion>
81
+ <auro-header level="2" id="tokens">Design Tokens</auro-header>
82
+ <p>The component may be restyled by overriding the values of the following component-specific design token(s).</p>
83
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
84
+ <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
85
+
86
+ <pre class="language-scss"><code class="language-scss">@use "@aurodesignsystem/design-tokens/dist/legacy/auro-classic/SCSSVariables" as vac;
87
+ @use "@aurodesignsystem/design-tokens/dist/themes/alaska/SCSSVariables--alaska" as v;
88
+ ​
89
+ :host {
90
+ --ds-auro-dialog-container-color: var(--ds-basic-color-surface-default, #{v.$ds-basic-color-surface-default});
91
+ --ds-auro-dialog-boxshadow-color: var(--ds-elevation-300, #{vac.$ds-elevation-300});
92
+ --ds-auro-dialog-overlay-modal-background-color: var(--ds-advanced-color-shared-scrim, #{v.$ds-advanced-color-shared-scrim});
93
+ --ds-auro-dialog-overlay-open-background-color: var(--ds-advanced-color-shared-scrim, #{v.$ds-advanced-color-shared-scrim});
94
+ --ds-auro-dialog-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
95
+ }</code></pre>
96
+ <!-- AURO-GENERATED-CONTENT:END -->
97
+ <auro-header level="2" id="customRegistration">Custom Registration</auro-header>
98
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../docs/partials/getting-started/customRegistration.md) -->
99
+ <!-- The below content is automatically added from ./../docs/partials/getting-started/customRegistration.md -->
100
+ <p>Every Auro component consists of a JavaScript <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes">class</auro-hyperlink> and a <auro-hyperlink href="https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define">custom element registration</auro-hyperlink>. The class defines the component's behavior, and the registration maps it to an HTML tag name so it can be used in markup.</p>
101
+ <p>The default import handles both steps automatically, registering the component under its standard <code>&lt;auro-dialog&gt;</code> tag name.</p>
102
+ <p>If you need multiple versions of the same component on a single page — for example, when two projects depend on different versions — you can register the class under a custom tag name to avoid conflicts. Import the component class directly and call its <code>register(name)</code> method with a unique name:</p>
103
+
104
+ <pre class="language-js"><code class="language-js">// Import the class only
105
+ import { AuroDialog } from '@aurodesignsystem/auro-dialog/class';
106
+ ​
107
+ // Register with a custom name
108
+ AuroDialog.register('custom-dialog');</code></pre>
109
+
110
+ <p>This creates a new custom element <code>&lt;custom-dialog&gt;</code> that behaves exactly like <code>&lt;auro-dialog&gt;</code>, allowing both to coexist on the same page without interfering with each other.</p>
111
+
112
+ <pre class="language-html"><code class="language-html">&lt;custom-dialog id="custom-dialog-example"&gt;
113
+ &lt;span slot="header"&gt;Dialog header&lt;/span&gt;
114
+ &lt;div slot="content"&gt;Dialog content&lt;/div&gt;
115
+ &lt;div slot="footer"&gt;
116
+ &lt;auro-button id="closeCustom"&gt;Close&lt;/auro-button&gt;
117
+ &lt;/div&gt;
118
+ &lt;/custom-dialog&gt;</code></pre>
119
+ <!-- AURO-GENERATED-CONTENT:END -->
120
+ <auro-header level="2" id="layeredComponents">Layered Components</auro-header>
121
+ <p>A common pattern places floating components — such as a popover and a dropdown — inside the dialog, creating a stack of layered components.</p>
122
+ <div class="exampleWrapper">
123
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-and-dropdown.html) -->
124
+ <!-- The below content is automatically added from ./../apiExamples/popover-and-dropdown.html -->
125
+ <div>
126
+ <auro-button id="openPopAndDrop">Open dialog with popover</auro-button>
127
+ </div>
128
+ <auro-dialog id="popover-dialog" sm lg>
129
+ <span slot="header">Small Modal Dialog</span>
130
+ <div slot="content">
131
+ <p>
132
+ 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.
133
+ </p>
134
+ <p>
135
+ 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.
136
+ </p>
137
+ <auro-header level="3" display="500">
138
+ Before checking your bags, remember to:
139
+ </auro-header>
140
+ <auro-popover>
141
+ <div class="content">
142
+ <ul>
143
+ <li>Caerphilly croque monsieur fondue</li>
144
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
145
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
146
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
147
+ </ul>
148
+ </div>
149
+ <auro-hyperlink slot="trigger" href="#">Hover on me</auro-hyperlink>
150
+ </auro-popover>
151
+ <auro-combobox>
152
+ <span slot="label">Name</span>
153
+ <auro-menu>
154
+ <auro-menuoption value="Apples" id="option-0">Apples</auro-menuoption>
155
+ <auro-menuoption value="Oranges" id="option-1">Oranges</auro-menuoption>
156
+ <auro-menuoption value="Peaches" id="option-2">Peaches</auro-menuoption>
157
+ <auro-menuoption value="Grapes" id="option-3">Grapes</auro-menuoption>
158
+ <auro-menuoption value="Cherries" id="option-4">Cherries</auro-menuoption>
159
+ <auro-menuoption static nomatch>No matching option</auro-menuoption>
160
+ </auro-menu>
161
+ </auro-combobox>
162
+ </div>
163
+ <div slot="footer">
164
+ <auro-button id="closePopAndDrop">
165
+ I understand
166
+ <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
167
+ </auro-button>
168
+ </div>
169
+ </auro-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/popover-and-dropdown.html) -->
175
+ <!-- The below code snippet is automatically added from ./../apiExamples/popover-and-dropdown.html -->
176
+
177
+ <pre class="language-html"><code class="language-html">&lt;div&gt;
178
+ &lt;auro-button id="openPopAndDrop"&gt;Open dialog with popover&lt;/auro-button&gt;
179
+ &lt;/div&gt;
180
+ &lt;auro-dialog id="popover-dialog" sm lg&gt;
181
+ &lt;span slot="header"&gt;Small Modal Dialog&lt;/span&gt;
182
+ &lt;div slot="content"&gt;
183
+ &lt;p&gt;
184
+ 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.
185
+ &lt;/p&gt;
186
+ &lt;p&gt;
187
+ 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.
188
+ &lt;/p&gt;
189
+ &lt;auro-header level="3" display="500"&gt;
190
+ Before checking your bags, remember to:
191
+ &lt;/auro-header&gt;
192
+ &lt;auro-popover&gt;
193
+ &lt;div class="content"&gt;
194
+ &lt;ul&gt;
195
+ &lt;li&gt;Caerphilly croque monsieur fondue&lt;/li&gt;
196
+ &lt;li&gt;Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings&lt;/li&gt;
197
+ &lt;li&gt;Cheddar cheese and biscuits chalk and cheese&lt;/li&gt;
198
+ &lt;li&gt;Camembert de normandie stinking bishop bavarian bergkase&lt;/li&gt;
199
+ &lt;/ul&gt;
200
+ &lt;/div&gt;
201
+ &lt;auro-hyperlink slot="trigger" href="#"&gt;Hover on me&lt;/auro-hyperlink&gt;
202
+ &lt;/auro-popover&gt;
203
+ &lt;auro-combobox&gt;
204
+ &lt;span slot="label"&gt;Name&lt;/span&gt;
205
+ &lt;auro-menu&gt;
206
+ &lt;auro-menuoption value="Apples" id="option-0"&gt;Apples&lt;/auro-menuoption&gt;
207
+ &lt;auro-menuoption value="Oranges" id="option-1"&gt;Oranges&lt;/auro-menuoption&gt;
208
+ &lt;auro-menuoption value="Peaches" id="option-2"&gt;Peaches&lt;/auro-menuoption&gt;
209
+ &lt;auro-menuoption value="Grapes" id="option-3"&gt;Grapes&lt;/auro-menuoption&gt;
210
+ &lt;auro-menuoption value="Cherries" id="option-4"&gt;Cherries&lt;/auro-menuoption&gt;
211
+ &lt;auro-menuoption static nomatch&gt;No matching option&lt;/auro-menuoption&gt;
212
+ &lt;/auro-menu&gt;
213
+ &lt;/auro-combobox&gt;
214
+ &lt;/div&gt;
215
+ &lt;div slot="footer"&gt;
216
+ &lt;auro-button id="closePopAndDrop"&gt;
217
+ I understand
218
+ &lt;auro-icon category="interface" name="check-lg" emphasis appearance="inverse"&gt;&lt;/auro-icon&gt;
219
+ &lt;/auro-button&gt;
220
+ &lt;/div&gt;
221
+ &lt;/auro-dialog&gt;</code></pre>
222
+ <!-- AURO-GENERATED-CONTENT:END -->
223
+ </auro-accordion>
224
+ </div>
225
+ </div>
226
+ </div>