@aurodesignsystem/auro-dialog 4.1.0 → 4.2.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 +19 -3
- package/README.md +75 -69
- package/demo/api.html +6 -6
- package/demo/api.js +8 -8
- package/demo/api.md +281 -265
- package/demo/api.min.js +4 -4
- package/demo/auro-dialog.min.js +3233 -336
- package/demo/index.html +3 -3
- package/demo/index.md +39 -81
- package/dist/auro-dialog-CWkXz5VA.js +134 -0
- package/dist/index.d.ts +239 -135
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +22 -13
- package/dist/auro-dialog-a7_PNy6-.js +0 -128
package/demo/api.md
CHANGED
|
@@ -3,56 +3,59 @@
|
|
|
3
3
|
|
|
4
4
|
# auro-dialog
|
|
5
5
|
|
|
6
|
-
The auro-dialog appears
|
|
6
|
+
The `auro-dialog` appears on top of the page and presents information that requires the users immediate attention.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
|
49
|
-
|
|
|
50
|
-
|
|
|
8
|
+
### Properties & Attributes
|
|
9
|
+
|
|
10
|
+
| Properties | Attributes | Modifiers | Type | Default | Description |
|
|
11
|
+
| --------------------- | ----------------------- | --------- | ---------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
12
|
+
| closeButtonAppearance | close-button-appearance | | `default` \| `inverse` | `default` | Defines whether the close button should be light colored for use on dark backgrounds. |
|
|
13
|
+
| isPopoverVisible | open | | boolean | | Sets state of dialog to open. |
|
|
14
|
+
| lg | lg | | boolean | | Sets dialog box to large style. Adding both lg and sm/md will set the dialog to lg for mobile and sm/md for desktop.<br>Must be used in conjunction with sm or md to have an effect. |
|
|
15
|
+
| md | md | | boolean | | Sets dialog box to medium style. Adding both md and lg will set the dialog to md for desktop and lg for mobile. |
|
|
16
|
+
| modal | modal | | boolean | | Modal dialog restricts the user to take an action (no default close actions). |
|
|
17
|
+
| onDark | onDark | | boolean | | DEPRECATED - use `close-button-appearance="inverse" instead. |
|
|
18
|
+
| sm | sm | | boolean | | Sets dialog box to small style. Adding both sm and lg will set the dialog to sm for desktop and lg for mobile. |
|
|
19
|
+
| triggerElement | | | HTMLElement | | The element to focus when the dialog is closed. If not set, defaults to the value of document.activeElement when the dialog is opened. |
|
|
20
|
+
| unformatted | unformatted | | boolean | | Unformatted dialog window, edge-to-edge fill for content. |
|
|
21
|
+
| | isBibFullscreen | | boolean | | If true, the dialog bib is in fullscreen mode. |
|
|
22
|
+
|
|
23
|
+
### Methods
|
|
24
|
+
|
|
25
|
+
| Name | Parameters | Return | Description |
|
|
26
|
+
| -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
|
|
27
|
+
| hide | None | void | Closes the dialog. |
|
|
28
|
+
| register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
|
|
29
|
+
| show | None | void | Opens the dialog. |
|
|
30
|
+
|
|
31
|
+
### Events
|
|
32
|
+
|
|
33
|
+
| Name | Description |
|
|
34
|
+
| ------ | -------------------------------------- |
|
|
35
|
+
| toggle | Event fires when the element is closed |
|
|
36
|
+
|
|
37
|
+
### Slots
|
|
38
|
+
|
|
39
|
+
| Name | Description |
|
|
40
|
+
| ---------------------- | -------------------------------------------------------------------------------- |
|
|
41
|
+
| ariaLabel.dialog.close | Text to describe the "x" icon close button for screen readers. Default: "Close". |
|
|
42
|
+
| content | Injects content into the body of the modal |
|
|
43
|
+
| footer | Used for action options, e.g. buttons |
|
|
44
|
+
| header | Text to display as the header of the modal |
|
|
45
|
+
|
|
46
|
+
### CSS Shadow Parts
|
|
47
|
+
|
|
48
|
+
| Name | Description |
|
|
49
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
50
|
+
| close-button | adjust position of the close X icon in the dialog window |
|
|
51
|
+
| dialog | apply CSS to the entire dialog |
|
|
52
|
+
| dialog-content | apply CSS to the content of the dialog |
|
|
53
|
+
| dialog-footer | apply CSS to the footer of the dialog |
|
|
54
|
+
| dialog-header | apply CSS to the header of the dialog |
|
|
55
|
+
| dialog-overlay | DEPRECATED. Use `--ds-auro-dialog-overlay-modal-background-color` or `--ds-auro-dialog-overlay-open-background-color` for backdrop styling instead. |
|
|
51
56
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
52
57
|
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
### Basic
|
|
58
|
+
## Basic
|
|
56
59
|
|
|
57
60
|
<div class="exampleWrapper">
|
|
58
61
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
|
|
@@ -109,15 +112,27 @@ The auro-dialog appears above the page and requires the user's attention.
|
|
|
109
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
113
|
</auro-accordion>
|
|
111
114
|
|
|
115
|
+
## Property & Attribute Examples
|
|
116
|
+
|
|
112
117
|
### Size Options
|
|
113
118
|
|
|
114
|
-
The auro-dialog supports three different sizes
|
|
119
|
+
The auro-dialog supports three different sizes via attribute, `sm`, `md`, and `lg`. The default size is `lg`.
|
|
120
|
+
|
|
121
|
+
#### Size Effects
|
|
122
|
+
|
|
123
|
+
##### Desktop
|
|
124
|
+
At desktop resolutions, size affects the width of the dialog, and its height is dictated by its contents with a max height of 80%.
|
|
125
|
+
|
|
126
|
+
##### Mobile
|
|
127
|
+
At mobile resolutions the size affects the maximum height the dialog will use of the browser viewport with a fixed width of 100%.
|
|
115
128
|
|
|
116
|
-
|
|
129
|
+
> *Note: `lg` may be added in addition to `sm` or `md` to force the `lg` size on mobile while using the other size for desktop.*
|
|
130
|
+
|
|
131
|
+
#### Single Size Examples:
|
|
117
132
|
|
|
118
133
|
<div class="exampleWrapper">
|
|
119
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
120
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
134
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/size-options.html) -->
|
|
135
|
+
<!-- The below content is automatically added from ./../apiExamples/size-options.html -->
|
|
121
136
|
<div>
|
|
122
137
|
<auro-button id="openDefaultSize">Open default dialog</auro-button>
|
|
123
138
|
<auro-button id="openMediumSize">Open medium dialog</auro-button>
|
|
@@ -178,8 +193,8 @@ The size attribute effects the `width` of the desktop dialog. Its `height` is di
|
|
|
178
193
|
</div>
|
|
179
194
|
<auro-accordion alignRight>
|
|
180
195
|
<span slot="trigger">See code</span>
|
|
181
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
182
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
196
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/size-options.html) -->
|
|
197
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/size-options.html -->
|
|
183
198
|
|
|
184
199
|
```html
|
|
185
200
|
<div>
|
|
@@ -242,9 +257,114 @@ The size attribute effects the `width` of the desktop dialog. Its `height` is di
|
|
|
242
257
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
243
258
|
</auro-accordion>
|
|
244
259
|
|
|
245
|
-
|
|
260
|
+
#### Mixed Size Examples:
|
|
246
261
|
|
|
247
|
-
|
|
262
|
+
<div class="exampleWrapper">
|
|
263
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/decoupled.html) -->
|
|
264
|
+
<!-- The below content is automatically added from ./../apiExamples/decoupled.html -->
|
|
265
|
+
<div>
|
|
266
|
+
<auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
|
|
267
|
+
<auro-button id="openMdLg">Open [md lg] dialog</auro-button>
|
|
268
|
+
</div>
|
|
269
|
+
<auro-dialog id="smLgDialog" sm lg>
|
|
270
|
+
<span slot="header">Small Modal Dialog</span>
|
|
271
|
+
<div slot="content">
|
|
272
|
+
<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>
|
|
273
|
+
<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>
|
|
274
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
275
|
+
<ul>
|
|
276
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
277
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
278
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
279
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
280
|
+
</ul>
|
|
281
|
+
</div>
|
|
282
|
+
<div slot="footer">
|
|
283
|
+
<auro-button id="closeSmLg">
|
|
284
|
+
I understand
|
|
285
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
286
|
+
</auro-button>
|
|
287
|
+
</div>
|
|
288
|
+
</auro-dialog>
|
|
289
|
+
<auro-dialog id="mdLgDialog" md lg>
|
|
290
|
+
<span slot="header">Medium Modal Dialog</span>
|
|
291
|
+
<div slot="content">
|
|
292
|
+
<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>
|
|
293
|
+
<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>
|
|
294
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
295
|
+
<ul>
|
|
296
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
297
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
298
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
299
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
300
|
+
</ul>
|
|
301
|
+
</div>
|
|
302
|
+
<div slot="footer">
|
|
303
|
+
<auro-button id="closeMdLg">
|
|
304
|
+
I understand
|
|
305
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
306
|
+
</auro-button>
|
|
307
|
+
</div>
|
|
308
|
+
</auro-dialog>
|
|
309
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
310
|
+
</div>
|
|
311
|
+
<auro-accordion alignRight>
|
|
312
|
+
<span slot="trigger">See code</span>
|
|
313
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/decoupled.html) -->
|
|
314
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/decoupled.html -->
|
|
315
|
+
|
|
316
|
+
```html
|
|
317
|
+
<div>
|
|
318
|
+
<auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
|
|
319
|
+
<auro-button id="openMdLg">Open [md lg] dialog</auro-button>
|
|
320
|
+
</div>
|
|
321
|
+
<auro-dialog id="smLgDialog" sm lg>
|
|
322
|
+
<span slot="header">Small Modal Dialog</span>
|
|
323
|
+
<div slot="content">
|
|
324
|
+
<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>
|
|
325
|
+
<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>
|
|
326
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
327
|
+
<ul>
|
|
328
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
329
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
330
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
331
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
332
|
+
</ul>
|
|
333
|
+
</div>
|
|
334
|
+
<div slot="footer">
|
|
335
|
+
<auro-button id="closeSmLg">
|
|
336
|
+
I understand
|
|
337
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
338
|
+
</auro-button>
|
|
339
|
+
</div>
|
|
340
|
+
</auro-dialog>
|
|
341
|
+
<auro-dialog id="mdLgDialog" md lg>
|
|
342
|
+
<span slot="header">Medium Modal Dialog</span>
|
|
343
|
+
<div slot="content">
|
|
344
|
+
<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>
|
|
345
|
+
<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>
|
|
346
|
+
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
347
|
+
<ul>
|
|
348
|
+
<li>Caerphilly croque monsieur fondue</li>
|
|
349
|
+
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
350
|
+
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
351
|
+
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
352
|
+
</ul>
|
|
353
|
+
</div>
|
|
354
|
+
<div slot="footer">
|
|
355
|
+
<auro-button id="closeMdLg">
|
|
356
|
+
I understand
|
|
357
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
358
|
+
</auro-button>
|
|
359
|
+
</div>
|
|
360
|
+
</auro-dialog>
|
|
361
|
+
```
|
|
362
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
363
|
+
</auro-accordion>
|
|
364
|
+
|
|
365
|
+
### Modal
|
|
366
|
+
|
|
367
|
+
The auro-dialog supports a modal dialog state that will lock a user into interacting with the modal dialog via the `modal` attribute.
|
|
248
368
|
|
|
249
369
|
When using this state, the modal dialog must include a button action to dismiss the modal dialog as the closing icon will not be available and the user will not be able to click outside the `modal` dialog to dismiss.
|
|
250
370
|
|
|
@@ -384,125 +504,128 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
384
504
|
</div>
|
|
385
505
|
</auro-dialog>
|
|
386
506
|
```
|
|
387
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
507
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
388
508
|
</auro-accordion>
|
|
389
509
|
|
|
390
|
-
|
|
510
|
+
### Unformatted dialog
|
|
511
|
+
|
|
512
|
+
For use case where the use of a dialog is to be more freeform, but the experience and base tooling for the dialog are still requested, there is the `unformatted` property.
|
|
391
513
|
|
|
392
|
-
|
|
514
|
+
This property can be used in combination with any other use case of the dialog, but it will render an unformatted dialog window, allowing for full customization of content within the scope of the window.
|
|
515
|
+
|
|
516
|
+
## Slot Examples
|
|
517
|
+
|
|
518
|
+
### Close button aria-label slot
|
|
393
519
|
|
|
394
|
-
|
|
520
|
+
To customize the aria-label text for the close button, use the `ariaLabel.dialog.close` slot to provide custom text. If no text is provided, the default text `"Close"` will be used.
|
|
395
521
|
|
|
396
522
|
<div class="exampleWrapper">
|
|
397
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
398
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
523
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/aria-label.html) -->
|
|
524
|
+
<!-- The below content is automatically added from ./../apiExamples/aria-label.html -->
|
|
399
525
|
<div>
|
|
400
|
-
<auro-button id="
|
|
401
|
-
<auro-button id="openMdLg">Open [md lg] dialog</auro-button>
|
|
526
|
+
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
402
527
|
</div>
|
|
403
|
-
<auro-dialog id="
|
|
404
|
-
<span slot="
|
|
405
|
-
<
|
|
406
|
-
<
|
|
407
|
-
<
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
413
|
-
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
414
|
-
</ul>
|
|
415
|
-
</div>
|
|
416
|
-
<div slot="footer">
|
|
417
|
-
<auro-button id="closeSmLg">
|
|
418
|
-
I understand
|
|
419
|
-
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
420
|
-
</auro-button>
|
|
421
|
-
</div>
|
|
422
|
-
</auro-dialog>
|
|
423
|
-
<auro-dialog id="mdLgDialog" md lg>
|
|
424
|
-
<span slot="header">Medium Modal Dialog</span>
|
|
425
|
-
<div slot="content">
|
|
426
|
-
<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>
|
|
427
|
-
<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>
|
|
428
|
-
<auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
|
|
429
|
-
<ul>
|
|
430
|
-
<li>Caerphilly croque monsieur fondue</li>
|
|
431
|
-
<li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
|
|
432
|
-
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
433
|
-
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
434
|
-
</ul>
|
|
435
|
-
</div>
|
|
436
|
-
<div slot="footer">
|
|
437
|
-
<auro-button id="closeMdLg">
|
|
438
|
-
I understand
|
|
439
|
-
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
440
|
-
</auro-button>
|
|
441
|
-
</div>
|
|
528
|
+
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
529
|
+
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
530
|
+
<span slot="content">
|
|
531
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
532
|
+
<div class="unformattedWrapper">
|
|
533
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
534
|
+
These are words that are slotted into the scope of the custom element.
|
|
535
|
+
</div>
|
|
536
|
+
</span>
|
|
442
537
|
</auro-dialog>
|
|
443
538
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
444
539
|
</div>
|
|
445
540
|
<auro-accordion alignRight>
|
|
446
541
|
<span slot="trigger">See code</span>
|
|
447
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
448
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
542
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/aria-label.html) -->
|
|
543
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/aria-label.html -->
|
|
449
544
|
|
|
450
545
|
```html
|
|
451
546
|
<div>
|
|
452
|
-
<auro-button id="
|
|
453
|
-
<auro-button id="openMdLg">Open [md lg] dialog</auro-button>
|
|
547
|
+
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
454
548
|
</div>
|
|
455
|
-
<auro-dialog id="
|
|
456
|
-
<span slot="
|
|
457
|
-
<
|
|
458
|
-
<
|
|
459
|
-
<
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
<li>Cheddar cheese and biscuits chalk and cheese</li>
|
|
465
|
-
<li>Camembert de normandie stinking bishop bavarian bergkase</li>
|
|
466
|
-
</ul>
|
|
467
|
-
</div>
|
|
468
|
-
<div slot="footer">
|
|
469
|
-
<auro-button id="closeSmLg">
|
|
470
|
-
I understand
|
|
471
|
-
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
472
|
-
</auro-button>
|
|
473
|
-
</div>
|
|
549
|
+
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
550
|
+
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
551
|
+
<span slot="content">
|
|
552
|
+
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
553
|
+
<div class="unformattedWrapper">
|
|
554
|
+
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
555
|
+
These are words that are slotted into the scope of the custom element.
|
|
556
|
+
</div>
|
|
557
|
+
</span>
|
|
474
558
|
</auro-dialog>
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
<div
|
|
489
|
-
<auro-button id="
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
559
|
+
```
|
|
560
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
561
|
+
</auro-accordion>
|
|
562
|
+
|
|
563
|
+
## CSS Shadow Part Examples
|
|
564
|
+
|
|
565
|
+
### Close Button
|
|
566
|
+
|
|
567
|
+
The close button can be targetted via the `close-button` CSS part, e.g. `auro-dialog::part(close-button)`.
|
|
568
|
+
|
|
569
|
+
<div class="exampleWrapper">
|
|
570
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/close-button.html) -->
|
|
571
|
+
<!-- The below content is automatically added from ./../apiExamples/close-button.html -->
|
|
572
|
+
<div>
|
|
573
|
+
<auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
|
|
574
|
+
</div>
|
|
575
|
+
<style>
|
|
576
|
+
.example::part(close-button) {
|
|
577
|
+
top: var(--ds-size-400);
|
|
578
|
+
right: var(--ds-size-400);
|
|
579
|
+
}
|
|
580
|
+
</style>
|
|
581
|
+
<auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
|
|
582
|
+
<span slot="content">
|
|
583
|
+
<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" />
|
|
584
|
+
<div class="unformattedWrapper">
|
|
585
|
+
<h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
|
|
586
|
+
Notice the custom location of the close button as well as the custom color.
|
|
587
|
+
</div>
|
|
588
|
+
</span>
|
|
589
|
+
</auro-dialog>
|
|
590
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
591
|
+
</div>
|
|
592
|
+
<auro-accordion alignRight>
|
|
593
|
+
<span slot="trigger">See code</span>
|
|
594
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/close-button.html) -->
|
|
595
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/close-button.html -->
|
|
596
|
+
|
|
597
|
+
```html
|
|
598
|
+
<div>
|
|
599
|
+
<auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
|
|
600
|
+
</div>
|
|
601
|
+
<style>
|
|
602
|
+
.example::part(close-button) {
|
|
603
|
+
top: var(--ds-size-400);
|
|
604
|
+
right: var(--ds-size-400);
|
|
605
|
+
}
|
|
606
|
+
</style>
|
|
607
|
+
<auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
|
|
608
|
+
<span slot="content">
|
|
609
|
+
<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" />
|
|
610
|
+
<div class="unformattedWrapper">
|
|
611
|
+
<h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
|
|
612
|
+
Notice the custom location of the close button as well as the custom color.
|
|
613
|
+
</div>
|
|
614
|
+
</span>
|
|
494
615
|
</auro-dialog>
|
|
495
616
|
```
|
|
496
617
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
497
618
|
</auro-accordion>
|
|
498
619
|
|
|
499
|
-
##
|
|
620
|
+
## Common Usage Patterns & Functional Examples
|
|
621
|
+
|
|
622
|
+
### Dialog with Popover and Dropdown Components
|
|
500
623
|
|
|
501
624
|
This is a use case where there is a popover and combobox component inside the dialog component, creating a stack of layered components.
|
|
502
625
|
|
|
503
626
|
<div class="exampleWrapper">
|
|
504
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/
|
|
505
|
-
<!-- The below content is automatically added from ./../apiExamples/
|
|
627
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-and-dropdown.html) -->
|
|
628
|
+
<!-- The below content is automatically added from ./../apiExamples/popover-and-dropdown.html -->
|
|
506
629
|
<div>
|
|
507
630
|
<auro-button id="openPopAndDrop">Open dialog with popover</auro-button>
|
|
508
631
|
</div>
|
|
@@ -552,8 +675,8 @@ This is a use case where there is a popover and combobox component inside the di
|
|
|
552
675
|
</div>
|
|
553
676
|
<auro-accordion alignRight>
|
|
554
677
|
<span slot="trigger">See code</span>
|
|
555
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/
|
|
556
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/
|
|
678
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popover-and-dropdown.html) -->
|
|
679
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/popover-and-dropdown.html -->
|
|
557
680
|
|
|
558
681
|
```html
|
|
559
682
|
<div>
|
|
@@ -605,24 +728,6 @@ This is a use case where there is a popover and combobox component inside the di
|
|
|
605
728
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
606
729
|
</auro-accordion>
|
|
607
730
|
|
|
608
|
-
## Unformatted dialog
|
|
609
|
-
|
|
610
|
-
For use case where the use of a dialog is to be more freeform, but the experience and base tooling for the dialog are still requested, there is the `unformatted` property.
|
|
611
|
-
|
|
612
|
-
This property can be used in combination of any other use case of the dialog, but it will render a unformatted dialog window allowing for full customization of content within the scope of the window.
|
|
613
|
-
|
|
614
|
-
### Responsive padding
|
|
615
|
-
|
|
616
|
-
Part of the dialog design spec is its responsive padding. To take advantage of this for your content within the scope of the dialog, be sure to use the selector `unformattedWrapper` that can be imported from the package here:
|
|
617
|
-
|
|
618
|
-
```css
|
|
619
|
-
import '@aurodesignsystem/auro-dialog/dist/style-unformatted.scss'
|
|
620
|
-
|
|
621
|
-
or
|
|
622
|
-
|
|
623
|
-
import '@aurodesignsystem/auro-dialog@/dist/style-unformatted.css'
|
|
624
|
-
```
|
|
625
|
-
|
|
626
731
|
### Accessibility
|
|
627
732
|
|
|
628
733
|
Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`. To make proper use of this, in an unformatted dialog, the developer is required to add `id="dialog-header"` to the content header within the dialog content.
|
|
@@ -666,112 +771,23 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
|
|
|
666
771
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
667
772
|
</auro-accordion>
|
|
668
773
|
|
|
669
|
-
###
|
|
774
|
+
### Responsive padding
|
|
670
775
|
|
|
671
|
-
|
|
776
|
+
Part of the dialog design spec is its responsive padding. To take advantage of this for your content within the scope of the dialog, be sure to use the selector `unformattedWrapper` that can be imported from the package here:
|
|
672
777
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
<!-- The below content is automatically added from ./../apiExamples/editCloseButton.html -->
|
|
676
|
-
<div>
|
|
677
|
-
<auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
|
|
678
|
-
</div>
|
|
679
|
-
<style>
|
|
680
|
-
.example::part(close-button) {
|
|
681
|
-
top: var(--ds-size-400);
|
|
682
|
-
right: var(--ds-size-400);
|
|
683
|
-
color: var(--ds-color-brand-flamingo-500);
|
|
684
|
-
}
|
|
685
|
-
</style>
|
|
686
|
-
<auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
|
|
687
|
-
<span slot="content">
|
|
688
|
-
<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" />
|
|
689
|
-
<div class="unformattedWrapper">
|
|
690
|
-
<h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
|
|
691
|
-
Notice the custom location of the close button as well as the custom color.
|
|
692
|
-
</div>
|
|
693
|
-
</span>
|
|
694
|
-
</auro-dialog>
|
|
695
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
696
|
-
</div>
|
|
697
|
-
<auro-accordion alignRight>
|
|
698
|
-
<span slot="trigger">See code</span>
|
|
699
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/editCloseButton.html) -->
|
|
700
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/editCloseButton.html -->
|
|
701
|
-
|
|
702
|
-
```html
|
|
703
|
-
<div>
|
|
704
|
-
<auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
|
|
705
|
-
</div>
|
|
706
|
-
<style>
|
|
707
|
-
.example::part(close-button) {
|
|
708
|
-
top: var(--ds-size-400);
|
|
709
|
-
right: var(--ds-size-400);
|
|
710
|
-
color: var(--ds-color-brand-flamingo-500);
|
|
711
|
-
}
|
|
712
|
-
</style>
|
|
713
|
-
<auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
|
|
714
|
-
<span slot="content">
|
|
715
|
-
<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" />
|
|
716
|
-
<div class="unformattedWrapper">
|
|
717
|
-
<h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
|
|
718
|
-
Notice the custom location of the close button as well as the custom color.
|
|
719
|
-
</div>
|
|
720
|
-
</span>
|
|
721
|
-
</auro-dialog>
|
|
722
|
-
```
|
|
723
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
724
|
-
</auro-accordion>
|
|
725
|
-
|
|
726
|
-
### Close button aria-label slot
|
|
778
|
+
```css
|
|
779
|
+
import '@aurodesignsystem/auro-dialog/dist/style-unformatted.scss'
|
|
727
780
|
|
|
728
|
-
|
|
781
|
+
or
|
|
729
782
|
|
|
730
|
-
|
|
731
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/ariaLabelSlot.html) -->
|
|
732
|
-
<!-- The below content is automatically added from ./../apiExamples/ariaLabelSlot.html -->
|
|
733
|
-
<div>
|
|
734
|
-
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
735
|
-
</div>
|
|
736
|
-
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
737
|
-
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
738
|
-
<span slot="content">
|
|
739
|
-
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
740
|
-
<div class="unformattedWrapper">
|
|
741
|
-
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
742
|
-
These are words that are slotted into the scope of the custom element.
|
|
743
|
-
</div>
|
|
744
|
-
</span>
|
|
745
|
-
</auro-dialog>
|
|
746
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
747
|
-
</div>
|
|
748
|
-
<auro-accordion alignRight>
|
|
749
|
-
<span slot="trigger">See code</span>
|
|
750
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/ariaLabelSlot.html) -->
|
|
751
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/ariaLabelSlot.html -->
|
|
752
|
-
|
|
753
|
-
```html
|
|
754
|
-
<div>
|
|
755
|
-
<auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
|
|
756
|
-
</div>
|
|
757
|
-
<auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
|
|
758
|
-
<span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
|
|
759
|
-
<span slot="content">
|
|
760
|
-
<img style="display: block; width: 100%" src="https://blog.alaskaair.com/wp-content/uploads/2020/11/111-psp-blog-img-guide.jpg" alt="alaska airlines pride lights" />
|
|
761
|
-
<div class="unformattedWrapper">
|
|
762
|
-
<h1 id="dialog-header" class="heading-lg">This is a header</h1>
|
|
763
|
-
These are words that are slotted into the scope of the custom element.
|
|
764
|
-
</div>
|
|
765
|
-
</span>
|
|
766
|
-
</auro-dialog>
|
|
783
|
+
import '@aurodesignsystem/auro-dialog/dist/style-unformatted.css'
|
|
767
784
|
```
|
|
768
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
769
|
-
</auro-accordion>
|
|
770
785
|
|
|
771
|
-
|
|
786
|
+
## Restyle Component with CSS Variables
|
|
772
787
|
|
|
773
|
-
The component may be restyled
|
|
788
|
+
The component may be restyled by changing the values of the following token(s).
|
|
774
789
|
|
|
790
|
+
<!-- Remove section if component does not have any component specific tokens -->
|
|
775
791
|
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
|
|
776
792
|
<!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
|
|
777
793
|
|