@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/demo/api.md CHANGED
@@ -3,56 +3,56 @@
3
3
 
4
4
  # auro-dialog
5
5
 
6
- The auro-dialog appears above the page and requires the user's attention.
6
+ The auro-dialog appears above the page and presents information that requires the users immediate attention.
7
7
 
8
- ## Attributes
9
-
10
- | Attribute | Type | Description |
11
- |-----------|-----------|--------------------------------------------------|
12
- | [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. |
13
- | [onDark](#onDark) | `Boolean` | DEPRECATED - use `close-button-appearance="inverse" instead. |
14
- | [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. |
15
-
16
- ## Properties
17
-
18
- | Property | Attribute | Type | Default | Description |
19
- |-------------------------|---------------------------|---------------|-------------|--------------------------------------------------|
20
- | [closeButtonAppearance](#closeButtonAppearance) | `close-button-appearance` | `string` | "'default'" | Defines whether the close button should be light colored for use on dark backgrounds. |
21
- | [modal](#modal) | `modal` | `Boolean` | false | Modal dialog restricts the user to take an action (no default close actions) |
22
- | [open](#open) | `open` | `Boolean` | | Sets state of dialog to open |
23
- | [triggerElement](#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. |
24
- | [unformatted](#unformatted) | `unformatted` | `Boolean` | false | Unformatted dialog window, edge-to-edge fill for content |
25
-
26
- ## Events
27
-
28
- | Event | Description |
29
- |----------|----------------------------------------|
30
- | [toggle](#toggle) | Event fires when the element is closed |
31
-
32
- ## Slots
33
-
34
- | Name | Description |
35
- |--------------------------|--------------------------------------------------|
36
- | `ariaLabel.dialog.close` | Text to describe the "x" icon close button for screen readers. Default: "Close". |
37
- | [content](#content) | Injects content into the body of the modal |
38
- | [footer](#footer) | Used for action options, e.g. buttons |
39
- | [header](#header) | Text to display as the header of the modal |
40
-
41
- ## CSS Shadow Parts
42
-
43
- | Part | Description |
44
- |------------------|--------------------------------------------------|
45
- | `close-button` | adjust position of the close X icon in the dialog window |
46
- | [dialog](#dialog) | apply CSS to the entire dialog |
47
- | `dialog-content` | apply CSS to the content of the dialog |
48
- | `dialog-footer` | apply CSS to the footer of the dialog |
49
- | `dialog-header` | apply CSS to the header of the dialog |
50
- | `dialog-overlay` | apply CSS on the overlay of the dialog |
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
+ | lg | lg | | boolean | | Sets the dialog to lg for mobile and the size defined by sm or md for desktop.<br>Must be used in conjunction with sm or md to have an effect. |
14
+ | 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. |
15
+ | modal | modal | | boolean | `false` | Modal dialog restricts the user to take an action (no default close actions) |
16
+ | open | open | | boolean | | Sets state of dialog to open |
17
+ | 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. |
18
+ | 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. |
19
+ | unformatted | unformatted | | boolean | `false` | Unformatted dialog window, edge-to-edge fill for content |
20
+ | | onDark | | boolean | | DEPRECATED - use `close-button-appearance="inverse" instead. |
21
+
22
+ ### Methods
23
+
24
+ | Name | Parameters | Return | Description |
25
+ | -------- | -------------------------------------------------------------------- | ------ | ------------------------------------------------- |
26
+ | register | `name` (string) - The name of the element that you want to register. | | This will register this element with the browser. |
27
+
28
+ ### Events
29
+
30
+ | Name | Description |
31
+ | ------ | -------------------------------------- |
32
+ | toggle | Event fires when the element is closed |
33
+
34
+ ### Slots
35
+
36
+ | Name | Description |
37
+ | ---------------------- | -------------------------------------------------------------------------------- |
38
+ | ariaLabel.dialog.close | Text to describe the "x" icon close button for screen readers. Default: "Close". |
39
+ | content | Injects content into the body of the modal |
40
+ | footer | Used for action options, e.g. buttons |
41
+ | header | Text to display as the header of the modal |
42
+
43
+ ### CSS Shadow Parts
44
+
45
+ | Name | Description |
46
+ | -------------- | -------------------------------------------------------- |
47
+ | close-button | adjust position of the close X icon in the dialog window |
48
+ | dialog | apply CSS to the entire dialog |
49
+ | dialog-content | apply CSS to the content of the dialog |
50
+ | dialog-footer | apply CSS to the footer of the dialog |
51
+ | dialog-header | apply CSS to the header of the dialog |
52
+ | dialog-overlay | apply CSS on the overlay of the dialog |
51
53
  <!-- AURO-GENERATED-CONTENT:END -->
52
54
 
53
- ## API Examples
54
-
55
- ### Basic
55
+ ## Basic
56
56
 
57
57
  <div class="exampleWrapper">
58
58
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/basic.html) -->
@@ -109,15 +109,27 @@ The auro-dialog appears above the page and requires the user's attention.
109
109
  <!-- AURO-GENERATED-CONTENT:END -->
110
110
  </auro-accordion>
111
111
 
112
+ ## Property & Attribute Examples
113
+
112
114
  ### Size Options
113
115
 
114
- The auro-dialog supports three different sizes. A default dialog is equal to the large size dialog. Using the `sm` and `md` attributes, the component supports these sizes for both mobile and desktop.
116
+ The auro-dialog supports three different sizes via attribute, `sm`, `md`, and `lg`. The default size is `lg`.
117
+
118
+ #### Size Effects
119
+
120
+ ##### Desktop
121
+ At desktop resolutions, size affects the width of the dialog, and its height is dictated by its contents with a max height of 80%.
122
+
123
+ ##### Mobile
124
+ At mobile resolutions the size affects the maximum height the dialog will use of the browser viewport with a fixed width of 100%.
115
125
 
116
- The size attribute effects the `width` of the desktop dialog. Its `height` is dictated by the content with a max height of `80%`. On mobile, the `size` attribute effects the `maximum height` the dialog will use of the device screen. Its width will be 100%.
126
+ > *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.*
127
+
128
+ #### Single Size Examples:
117
129
 
118
130
  <div class="exampleWrapper">
119
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/sizeOptions.html) -->
120
- <!-- The below content is automatically added from ./../apiExamples/sizeOptions.html -->
131
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/size-options.html) -->
132
+ <!-- The below content is automatically added from ./../apiExamples/size-options.html -->
121
133
  <div>
122
134
  <auro-button id="openDefaultSize">Open default dialog</auro-button>
123
135
  <auro-button id="openMediumSize">Open medium dialog</auro-button>
@@ -178,8 +190,8 @@ The size attribute effects the `width` of the desktop dialog. Its `height` is di
178
190
  </div>
179
191
  <auro-accordion alignRight>
180
192
  <span slot="trigger">See code</span>
181
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/sizeOptions.html) -->
182
- <!-- The below code snippet is automatically added from ./../apiExamples/sizeOptions.html -->
193
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/size-options.html) -->
194
+ <!-- The below code snippet is automatically added from ./../apiExamples/size-options.html -->
183
195
 
184
196
  ```html
185
197
  <div>
@@ -242,9 +254,114 @@ The size attribute effects the `width` of the desktop dialog. Its `height` is di
242
254
  <!-- AURO-GENERATED-CONTENT:END -->
243
255
  </auro-accordion>
244
256
 
245
- ### Modal and Size Options
257
+ #### Mixed Size Examples:
246
258
 
247
- The auro-dialog supports a modal dialog state that will lock a user into interacting with the modal dialog. To activate, use the modal attribute.
259
+ <div class="exampleWrapper">
260
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/decoupled.html) -->
261
+ <!-- The below content is automatically added from ./../apiExamples/decoupled.html -->
262
+ <div>
263
+ <auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
264
+ <auro-button id="openMdLg">Open [md lg] dialog</auro-button>
265
+ </div>
266
+ <auro-dialog id="smLgDialog" sm lg>
267
+ <span slot="header">Small Modal Dialog</span>
268
+ <div slot="content">
269
+ <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>
270
+ <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>
271
+ <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
272
+ <ul>
273
+ <li>Caerphilly croque monsieur fondue</li>
274
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
275
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
276
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
277
+ </ul>
278
+ </div>
279
+ <div slot="footer">
280
+ <auro-button id="closeSmLg">
281
+ I understand
282
+ <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
283
+ </auro-button>
284
+ </div>
285
+ </auro-dialog>
286
+ <auro-dialog id="mdLgDialog" md lg>
287
+ <span slot="header">Medium Modal Dialog</span>
288
+ <div slot="content">
289
+ <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>
290
+ <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>
291
+ <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
292
+ <ul>
293
+ <li>Caerphilly croque monsieur fondue</li>
294
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
295
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
296
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
297
+ </ul>
298
+ </div>
299
+ <div slot="footer">
300
+ <auro-button id="closeMdLg">
301
+ I understand
302
+ <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
303
+ </auro-button>
304
+ </div>
305
+ </auro-dialog>
306
+ <!-- AURO-GENERATED-CONTENT:END -->
307
+ </div>
308
+ <auro-accordion alignRight>
309
+ <span slot="trigger">See code</span>
310
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/decoupled.html) -->
311
+ <!-- The below code snippet is automatically added from ./../apiExamples/decoupled.html -->
312
+
313
+ ```html
314
+ <div>
315
+ <auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
316
+ <auro-button id="openMdLg">Open [md lg] dialog</auro-button>
317
+ </div>
318
+ <auro-dialog id="smLgDialog" sm lg>
319
+ <span slot="header">Small Modal Dialog</span>
320
+ <div slot="content">
321
+ <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>
322
+ <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>
323
+ <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
324
+ <ul>
325
+ <li>Caerphilly croque monsieur fondue</li>
326
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
327
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
328
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
329
+ </ul>
330
+ </div>
331
+ <div slot="footer">
332
+ <auro-button id="closeSmLg">
333
+ I understand
334
+ <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
335
+ </auro-button>
336
+ </div>
337
+ </auro-dialog>
338
+ <auro-dialog id="mdLgDialog" md lg>
339
+ <span slot="header">Medium Modal Dialog</span>
340
+ <div slot="content">
341
+ <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>
342
+ <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>
343
+ <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
344
+ <ul>
345
+ <li>Caerphilly croque monsieur fondue</li>
346
+ <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
347
+ <li>Cheddar cheese and biscuits chalk and cheese</li>
348
+ <li>Camembert de normandie stinking bishop bavarian bergkase</li>
349
+ </ul>
350
+ </div>
351
+ <div slot="footer">
352
+ <auro-button id="closeMdLg">
353
+ I understand
354
+ <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
355
+ </auro-button>
356
+ </div>
357
+ </auro-dialog>
358
+ ```
359
+ <!-- AURO-GENERATED-CONTENT:END -->
360
+ </auro-accordion>
361
+
362
+ ### Modal
363
+
364
+ The auro-dialog supports a modal dialog state that will lock a user into interacting with the modal dialog via the `modal` attribute.
248
365
 
249
366
  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
367
 
@@ -384,125 +501,130 @@ When using this state, the modal dialog must include a button action to dismiss
384
501
  </div>
385
502
  </auro-dialog>
386
503
  ```
387
- <!-- AURO-GENERATED-CONTENT:END -->
504
+ <!-- AURO-GENERATED-CONTENT:END -->
388
505
  </auro-accordion>
389
506
 
390
- ## Dialogs with Decoupled Experience
507
+ ### Unformatted dialog
391
508
 
392
- For use case where the size of the dialog on desktop should not influence the size of the dialog on mobile, the combination API of `sm lg` and `md lg` can be used.
509
+ 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.
510
+
511
+ 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.
512
+
513
+ ## Slot Examples
514
+
515
+ ### Close button aria-label slot
393
516
 
394
- The use of these combinations will set the first value to the dialog for a desktop experience. The second value will set the mobile experience to be up to 90% of the screen depending on the length of the content.
517
+ 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
518
 
396
519
  <div class="exampleWrapper">
397
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/decoupled.html) -->
398
- <!-- The below content is automatically added from ./../apiExamples/decoupled.html -->
520
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/slot_aria-label.html) -->
521
+ <!-- The below content is automatically added from ./../apiExamples/slot_aria-label.html -->
399
522
  <div>
400
- <auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
401
- <auro-button id="openMdLg">Open [md lg] dialog</auro-button>
523
+ <auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
402
524
  </div>
403
- <auro-dialog id="smLgDialog" sm lg>
404
- <span slot="header">Small Modal Dialog</span>
405
- <div slot="content">
406
- <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>
407
- <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>
408
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
409
- <ul>
410
- <li>Caerphilly croque monsieur fondue</li>
411
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
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>
525
+ <auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
526
+ <span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
527
+ <span slot="content">
528
+ <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" />
529
+ <div class="unformattedWrapper">
530
+ <h1 id="dialog-header" class="heading-lg">This is a header</h1>
531
+ These are words that are slotted into the scope of the custom element.
532
+ </div>
533
+ </span>
442
534
  </auro-dialog>
443
535
  <!-- AURO-GENERATED-CONTENT:END -->
444
536
  </div>
445
537
  <auro-accordion alignRight>
446
538
  <span slot="trigger">See code</span>
447
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/decoupled.html) -->
448
- <!-- The below code snippet is automatically added from ./../apiExamples/decoupled.html -->
539
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/slot_aria-label.html) -->
540
+ <!-- The below code snippet is automatically added from ./../apiExamples/slot_aria-label.html -->
449
541
 
450
542
  ```html
451
543
  <div>
452
- <auro-button id="openSmLg">Open [sm lg] dialog</auro-button>
453
- <auro-button id="openMdLg">Open [md lg] dialog</auro-button>
544
+ <auro-button id="openAriaLabelSlot">Unformatted Dialog w/ custom close button aria-label</auro-button>
454
545
  </div>
455
- <auro-dialog id="smLgDialog" sm lg>
456
- <span slot="header">Small Modal Dialog</span>
457
- <div slot="content">
458
- <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>
459
- <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>
460
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
461
- <ul>
462
- <li>Caerphilly croque monsieur fondue</li>
463
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
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>
546
+ <auro-dialog id="ariaLabelMdDialog" unformatted md lg ondark>
547
+ <span slot="ariaLabel.dialog.close">This will be the new aria label for the close button</span>
548
+ <span slot="content">
549
+ <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" />
550
+ <div class="unformattedWrapper">
551
+ <h1 id="dialog-header" class="heading-lg">This is a header</h1>
552
+ These are words that are slotted into the scope of the custom element.
553
+ </div>
554
+ </span>
474
555
  </auro-dialog>
475
- <auro-dialog id="mdLgDialog" md lg>
476
- <span slot="header">Medium Modal Dialog</span>
477
- <div slot="content">
478
- <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>
479
- <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>
480
- <auro-header level="3" display="500">Before checking your bags, remember to:</auro-header>
481
- <ul>
482
- <li>Caerphilly croque monsieur fondue</li>
483
- <li>Taleggio goat mascarpone cow manchego cheese and wine emmental cheese strings</li>
484
- <li>Cheddar cheese and biscuits chalk and cheese</li>
485
- <li>Camembert de normandie stinking bishop bavarian bergkase</li>
486
- </ul>
487
- </div>
488
- <div slot="footer">
489
- <auro-button id="closeMdLg">
490
- I understand
491
- <auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
492
- </auro-button>
493
- </div>
556
+ ```
557
+ <!-- AURO-GENERATED-CONTENT:END -->
558
+ </auro-accordion>
559
+
560
+ ## CSS Shadow Part Examples
561
+
562
+ ### Close Button
563
+
564
+ The close button can be targetted via the `close-button` CSS part, e.g. `auro-dialog::part(close-button)`.
565
+
566
+ <div class="exampleWrapper">
567
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/part_close-button.html) -->
568
+ <!-- The below content is automatically added from ./../apiExamples/part_close-button.html -->
569
+ <div>
570
+ <auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
571
+ </div>
572
+ <style>
573
+ .example::part(close-button) {
574
+ top: var(--ds-size-400);
575
+ right: var(--ds-size-400);
576
+ color: var(--ds-color-brand-flamingo-500);
577
+ }
578
+ </style>
579
+ <auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
580
+ <span slot="content">
581
+ <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" />
582
+ <div class="unformattedWrapper">
583
+ <h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
584
+ Notice the custom location of the close button as well as the custom color.
585
+ </div>
586
+ </span>
587
+ </auro-dialog>
588
+ <!-- AURO-GENERATED-CONTENT:END -->
589
+ </div>
590
+ <auro-accordion alignRight>
591
+ <span slot="trigger">See code</span>
592
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/part_close-button.html) -->
593
+ <!-- The below code snippet is automatically added from ./../apiExamples/part_close-button.html -->
594
+
595
+ ```html
596
+ <div>
597
+ <auro-button id="openEditDialog">Unformatted w/custom close button</auro-button>
598
+ </div>
599
+ <style>
600
+ .example::part(close-button) {
601
+ top: var(--ds-size-400);
602
+ right: var(--ds-size-400);
603
+ color: var(--ds-color-brand-flamingo-500);
604
+ }
605
+ </style>
606
+ <auro-dialog id="unformattedCustomMdDialog" unformatted md lg class="example">
607
+ <span slot="content">
608
+ <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" />
609
+ <div class="unformattedWrapper">
610
+ <h1 id="dialog-header" class="heading-lg">Unformatted w/custom close button</h1>
611
+ Notice the custom location of the close button as well as the custom color.
612
+ </div>
613
+ </span>
494
614
  </auro-dialog>
495
615
  ```
496
616
  <!-- AURO-GENERATED-CONTENT:END -->
497
617
  </auro-accordion>
498
618
 
499
- ## Dialog with Popover and Dropdown Components
619
+ ## Common Usage Patterns & Functional Examples
620
+
621
+ ### Dialog with Popover and Dropdown Components
500
622
 
501
623
  This is a use case where there is a popover and combobox component inside the dialog component, creating a stack of layered components.
502
624
 
503
625
  <div class="exampleWrapper">
504
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popoverAndDropdown.html) -->
505
- <!-- The below content is automatically added from ./../apiExamples/popoverAndDropdown.html -->
626
+ <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/popover-and-dropdown.html) -->
627
+ <!-- The below content is automatically added from ./../apiExamples/popover-and-dropdown.html -->
506
628
  <div>
507
629
  <auro-button id="openPopAndDrop">Open dialog with popover</auro-button>
508
630
  </div>
@@ -552,8 +674,8 @@ This is a use case where there is a popover and combobox component inside the di
552
674
  </div>
553
675
  <auro-accordion alignRight>
554
676
  <span slot="trigger">See code</span>
555
- <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popoverAndDropdown.html) -->
556
- <!-- The below code snippet is automatically added from ./../apiExamples/popoverAndDropdown.html -->
677
+ <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/popover-and-dropdown.html) -->
678
+ <!-- The below code snippet is automatically added from ./../apiExamples/popover-and-dropdown.html -->
557
679
 
558
680
  ```html
559
681
  <div>
@@ -605,24 +727,6 @@ This is a use case where there is a popover and combobox component inside the di
605
727
  <!-- AURO-GENERATED-CONTENT:END -->
606
728
  </auro-accordion>
607
729
 
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
730
  ### Accessibility
627
731
 
628
732
  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 +770,23 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
666
770
  <!-- AURO-GENERATED-CONTENT:END -->
667
771
  </auro-accordion>
668
772
 
669
- ### Edit close button position
773
+ ## Restyle Component with CSS Variables
774
+
775
+ ### Responsive padding
670
776
 
671
- When using the dialog with the `unformatted` attribute, some may want to adjust the positioning of the X close button. This can be addressed using the CSS `::part` CSS pseudo-element API.
777
+ 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
778
 
673
- <div class="exampleWrapper">
674
- <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/editCloseButton.html) -->
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
779
+ ```css
780
+ import '@aurodesignsystem/auro-dialog/dist/style-unformatted.scss'
727
781
 
728
- 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.
782
+ or
729
783
 
730
- <div class="exampleWrapper">
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>
767
- ```
768
- <!-- AURO-GENERATED-CONTENT:END -->
769
- </auro-accordion>
770
-
771
- ### Theme Support
784
+ import '@aurodesignsystem/auro-dialog/dist/style-unformatted.css'
785
+ ```
772
786
 
773
- The component may be restyled using the following code sample and changing the values of the following token(s).
787
+ The component may be restyled by changing the values of the following token(s).
774
788
 
789
+ <!-- Remove section if component does not have any component specific tokens -->
775
790
  <!-- AURO-GENERATED-CONTENT:START (CODE:src=./../src/styles/tokens.scss) -->
776
791
  <!-- The below code snippet is automatically added from ./../src/styles/tokens.scss -->
777
792
 
@@ -787,4 +802,4 @@ The component may be restyled using the following code sample and changing the v
787
802
  --ds-auro-dialog-text-color: var(--ds-basic-color-texticon-default, #{v.$ds-basic-color-texticon-default});
788
803
  }
789
804
  ```
790
- <!-- AURO-GENERATED-CONTENT:END -->
805
+ <!-- AURO-GENERATED-CONTENT:END -->