@aurodesignsystem/auro-dialog 4.0.0 → 4.1.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 +4 -6
- package/demo/api.js +2 -0
- package/demo/api.md +73 -26
- package/demo/api.min.js +14 -0
- package/demo/auro-dialog.min.js +71 -27
- package/dist/{auro-dialog-GEQYCVM4.js → auro-dialog-a7_PNy6-.js} +38 -21
- package/dist/index.d.ts +33 -16
- package/dist/index.js +1 -1
- package/dist/registered.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
# [4.
|
|
1
|
+
# [4.1.0](https://github.com/AlaskaAirlines/auro-dialog/compare/v4.0.0...v4.1.0) (2025-10-21)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
### BREAKING CHANGES
|
|
4
|
+
### Features
|
|
8
5
|
|
|
9
|
-
*
|
|
6
|
+
* add `appearance` deprecated `ondark` [#81](https://github.com/AlaskaAirlines/auro-dialog/issues/81) ([0bbc2b1](https://github.com/AlaskaAirlines/auro-dialog/commit/0bbc2b1057595a08a57b4f91371a53d0800f5a5c))
|
|
7
|
+
* add slot for close button aria label [#86](https://github.com/AlaskaAirlines/auro-dialog/issues/86) ([f46da4e](https://github.com/AlaskaAirlines/auro-dialog/commit/f46da4e278747952aefbd09b908ab9a88e64faed))
|
|
10
8
|
|
|
11
9
|
# Semantic Release Automated Changelog
|
|
12
10
|
|
package/demo/api.js
CHANGED
|
@@ -5,6 +5,7 @@ import { initEditCloseButtonExample } from "../apiExamples/editCloseButton";
|
|
|
5
5
|
import { initModalExample } from "../apiExamples/modal";
|
|
6
6
|
import { initPopoverAndDropdownExample } from "../apiExamples/popoverAndDropdown";
|
|
7
7
|
import { initSizeOptionsExample } from "../apiExamples/sizeOptions";
|
|
8
|
+
import { initAriaLabelSlotExample } from "../apiExamples/ariaLabelSlot";
|
|
8
9
|
|
|
9
10
|
import "../src/registered"
|
|
10
11
|
|
|
@@ -20,6 +21,7 @@ export function initExamples(initCount) {
|
|
|
20
21
|
initModalExample();
|
|
21
22
|
initPopoverAndDropdownExample();
|
|
22
23
|
initSizeOptionsExample();
|
|
24
|
+
initAriaLabelSlotExample();
|
|
23
25
|
} catch (_err) {
|
|
24
26
|
if (initCount <= 20) {
|
|
25
27
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|
package/demo/api.md
CHANGED
|
@@ -10,17 +10,18 @@ The auro-dialog appears above the page and requires the user's attention.
|
|
|
10
10
|
| Attribute | Type | Description |
|
|
11
11
|
|-----------|-----------|--------------------------------------------------|
|
|
12
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` |
|
|
13
|
+
| [onDark](#onDark) | `Boolean` | DEPRECATED - use `close-button-appearance="inverse" instead. |
|
|
14
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
15
|
|
|
16
16
|
## Properties
|
|
17
17
|
|
|
18
|
-
| Property
|
|
19
|
-
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
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 |
|
|
24
25
|
|
|
25
26
|
## Events
|
|
26
27
|
|
|
@@ -30,11 +31,12 @@ The auro-dialog appears above the page and requires the user's attention.
|
|
|
30
31
|
|
|
31
32
|
## Slots
|
|
32
33
|
|
|
33
|
-
| Name
|
|
34
|
-
|
|
35
|
-
|
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
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 |
|
|
38
40
|
|
|
39
41
|
## CSS Shadow Parts
|
|
40
42
|
|
|
@@ -269,7 +271,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
269
271
|
</div>
|
|
270
272
|
<div slot="footer">
|
|
271
273
|
<auro-button id="closeDefaultModal">I understand
|
|
272
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
274
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
273
275
|
</auro-button>
|
|
274
276
|
</div>
|
|
275
277
|
</auro-dialog>
|
|
@@ -288,7 +290,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
288
290
|
</div>
|
|
289
291
|
<div slot="footer">
|
|
290
292
|
<auro-button id="closeMediumModal">I understand
|
|
291
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
293
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
292
294
|
</auro-button>
|
|
293
295
|
</div>
|
|
294
296
|
</auro-dialog>
|
|
@@ -307,7 +309,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
307
309
|
</div>
|
|
308
310
|
<div slot="footer">
|
|
309
311
|
<auro-button id="closeSmallModal">I understand
|
|
310
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
312
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
311
313
|
</auro-button>
|
|
312
314
|
</div>
|
|
313
315
|
</auro-dialog>
|
|
@@ -339,7 +341,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
339
341
|
</div>
|
|
340
342
|
<div slot="footer">
|
|
341
343
|
<auro-button id="closeDefaultModal">I understand
|
|
342
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
344
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
343
345
|
</auro-button>
|
|
344
346
|
</div>
|
|
345
347
|
</auro-dialog>
|
|
@@ -358,7 +360,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
358
360
|
</div>
|
|
359
361
|
<div slot="footer">
|
|
360
362
|
<auro-button id="closeMediumModal">I understand
|
|
361
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
363
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
362
364
|
</auro-button>
|
|
363
365
|
</div>
|
|
364
366
|
</auro-dialog>
|
|
@@ -377,7 +379,7 @@ When using this state, the modal dialog must include a button action to dismiss
|
|
|
377
379
|
</div>
|
|
378
380
|
<div slot="footer">
|
|
379
381
|
<auro-button id="closeSmallModal">I understand
|
|
380
|
-
<auro-icon category="interface" name="chevron-right" emphasis
|
|
382
|
+
<auro-icon category="interface" name="chevron-right" emphasis appearance="inverse"></auro-icon>
|
|
381
383
|
</auro-button>
|
|
382
384
|
</div>
|
|
383
385
|
</auro-dialog>
|
|
@@ -414,7 +416,7 @@ The use of these combinations will set the first value to the dialog for a deskt
|
|
|
414
416
|
<div slot="footer">
|
|
415
417
|
<auro-button id="closeSmLg">
|
|
416
418
|
I understand
|
|
417
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
419
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
418
420
|
</auro-button>
|
|
419
421
|
</div>
|
|
420
422
|
</auro-dialog>
|
|
@@ -434,7 +436,7 @@ The use of these combinations will set the first value to the dialog for a deskt
|
|
|
434
436
|
<div slot="footer">
|
|
435
437
|
<auro-button id="closeMdLg">
|
|
436
438
|
I understand
|
|
437
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
439
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
438
440
|
</auro-button>
|
|
439
441
|
</div>
|
|
440
442
|
</auro-dialog>
|
|
@@ -466,7 +468,7 @@ The use of these combinations will set the first value to the dialog for a deskt
|
|
|
466
468
|
<div slot="footer">
|
|
467
469
|
<auro-button id="closeSmLg">
|
|
468
470
|
I understand
|
|
469
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
471
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
470
472
|
</auro-button>
|
|
471
473
|
</div>
|
|
472
474
|
</auro-dialog>
|
|
@@ -486,7 +488,7 @@ The use of these combinations will set the first value to the dialog for a deskt
|
|
|
486
488
|
<div slot="footer">
|
|
487
489
|
<auro-button id="closeMdLg">
|
|
488
490
|
I understand
|
|
489
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
491
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
490
492
|
</auro-button>
|
|
491
493
|
</div>
|
|
492
494
|
</auro-dialog>
|
|
@@ -542,7 +544,7 @@ This is a use case where there is a popover and combobox component inside the di
|
|
|
542
544
|
<div slot="footer">
|
|
543
545
|
<auro-button id="closePopAndDrop">
|
|
544
546
|
I understand
|
|
545
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
547
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
546
548
|
</auro-button>
|
|
547
549
|
</div>
|
|
548
550
|
</auro-dialog>
|
|
@@ -595,7 +597,7 @@ This is a use case where there is a popover and combobox component inside the di
|
|
|
595
597
|
<div slot="footer">
|
|
596
598
|
<auro-button id="closePopAndDrop">
|
|
597
599
|
I understand
|
|
598
|
-
<auro-icon category="interface" name="check-lg" emphasis
|
|
600
|
+
<auro-icon category="interface" name="check-lg" emphasis appearance="inverse"></auro-icon>
|
|
599
601
|
</auro-button>
|
|
600
602
|
</div>
|
|
601
603
|
</auro-dialog>
|
|
@@ -631,7 +633,7 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
|
|
|
631
633
|
<div>
|
|
632
634
|
<auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
|
|
633
635
|
</div>
|
|
634
|
-
<auro-dialog id="unformattedMdDialog" unformatted md lg
|
|
636
|
+
<auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
|
|
635
637
|
<span slot="content">
|
|
636
638
|
<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" />
|
|
637
639
|
<div class="unformattedWrapper">
|
|
@@ -651,7 +653,7 @@ Within the scope of the auro-dialog there is `aria-labelledby="dialog-header"`.
|
|
|
651
653
|
<div>
|
|
652
654
|
<auro-button id="openAccessibility">Unformatted Medium Dialog</auro-button>
|
|
653
655
|
</div>
|
|
654
|
-
<auro-dialog id="unformattedMdDialog" unformatted md lg
|
|
656
|
+
<auro-dialog id="unformattedMdDialog" unformatted md lg close-button-appearance="inverse">
|
|
655
657
|
<span slot="content">
|
|
656
658
|
<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" />
|
|
657
659
|
<div class="unformattedWrapper">
|
|
@@ -721,6 +723,51 @@ When using the dialog with the `unformatted` attribute, some may want to adjust
|
|
|
721
723
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
722
724
|
</auro-accordion>
|
|
723
725
|
|
|
726
|
+
### Close button aria-label slot
|
|
727
|
+
|
|
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.
|
|
729
|
+
|
|
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
|
+
|
|
724
771
|
### Theme Support
|
|
725
772
|
|
|
726
773
|
The component may be restyled using the following code sample and changing the values of the following token(s).
|
package/demo/api.min.js
CHANGED
|
@@ -178,6 +178,19 @@ function initSizeOptionsExample() {
|
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
function initAriaLabelSlotExample() {
|
|
182
|
+
const button = document.querySelector("#openAriaLabelSlot");
|
|
183
|
+
const dialog = document.querySelector("#ariaLabelMdDialog");
|
|
184
|
+
|
|
185
|
+
button.addEventListener("click", () => {
|
|
186
|
+
if (dialog.hasAttribute("open")) {
|
|
187
|
+
dialog.removeAttribute("open");
|
|
188
|
+
} else {
|
|
189
|
+
dialog.setAttribute("open", true);
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
181
194
|
AuroDialog.register();
|
|
182
195
|
|
|
183
196
|
function initExamples(initCount) {
|
|
@@ -192,6 +205,7 @@ function initExamples(initCount) {
|
|
|
192
205
|
initModalExample();
|
|
193
206
|
initPopoverAndDropdownExample();
|
|
194
207
|
initSizeOptionsExample();
|
|
208
|
+
initAriaLabelSlotExample();
|
|
195
209
|
} catch (_err) {
|
|
196
210
|
if (initCount <= 20) {
|
|
197
211
|
// setTimeout handles issue where content is sometimes loaded after the functions get called
|