@aurodesignsystem/auro-dialog 1.0.7 → 1.0.9

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.min.js CHANGED
@@ -1,25 +1,188 @@
1
- function toggleDialog(dialogID) {
2
- const dialog = document.querySelector(dialogID);
1
+ function initBasicExample() {
2
+ const buttons = [document.querySelector('#openBasic'), document.querySelector('#closeBasic')];
3
+ const dialog = document.querySelector('#defaultDialog');
3
4
 
4
- if (dialog.hasAttribute('open')) {
5
- dialog.removeAttribute('open');
6
- } else {
7
- dialog.setAttribute('open', true);
8
- }
5
+ buttons.forEach((button) => {
6
+ button.addEventListener('click', () => {
7
+ if (dialog.hasAttribute('open')) {
8
+ dialog.removeAttribute('open');
9
+ } else {
10
+ dialog.setAttribute('open', true);
11
+ }
12
+ });
13
+ });
14
+ }
15
+
16
+ function initAccessibilityExample() {
17
+ const button = document.querySelector('#openAccessibility');
18
+ const dialog = document.querySelector('#unformattedMdDialog');
19
+
20
+ button.addEventListener('click', () => {
21
+ if (dialog.hasAttribute('open')) {
22
+ dialog.removeAttribute('open');
23
+ } else {
24
+ dialog.setAttribute('open', true);
25
+ }
26
+ });
27
+ }
28
+
29
+ function initDecoupledExample() {
30
+ const smLgButtons = [document.querySelector('#openSmLg'), document.querySelector('#closeSmLg')];
31
+ const smLgDialog = document.querySelector('#smLgDialog');
32
+
33
+ const mdLgButtons = [document.querySelector('#openMdLg'), document.querySelector('#closeMdLg')];
34
+ const mdLgDialog = document.querySelector('#mdLgDialog');
35
+
36
+ smLgButtons.forEach((button) => {
37
+ button.addEventListener('click', () => {
38
+ if (smLgDialog.hasAttribute('open')) {
39
+ smLgDialog.removeAttribute('open');
40
+ } else {
41
+ smLgDialog.setAttribute('open', true);
42
+ }
43
+ });
44
+ });
45
+
46
+ mdLgButtons.forEach((button) => {
47
+ button.addEventListener('click', () => {
48
+ if (mdLgDialog.hasAttribute('open')) {
49
+ mdLgDialog.removeAttribute('open');
50
+ } else {
51
+ mdLgDialog.setAttribute('open', true);
52
+ }
53
+ });
54
+ });
55
+ }
56
+
57
+ function initEditCloseButtonExample() {
58
+ const button = document.querySelector('#openEditDialog');
59
+ const dialog = document.querySelector('#unformattedCustomMdDialog');
60
+
61
+ button.addEventListener('click', () => {
62
+ if (dialog.hasAttribute('open')) {
63
+ dialog.removeAttribute('open');
64
+ } else {
65
+ dialog.setAttribute('open', true);
66
+ }
67
+ });
68
+ }
69
+
70
+ function initModalExample() {
71
+ const defaultButtons = [document.querySelector('#openDefaultModal'), document.querySelector('#closeDefaultModal')];
72
+ const defaultDialog = document.querySelector('#defaultModalDialog');
73
+
74
+ const mediumButtons = [document.querySelector('#openMediumModal'), document.querySelector('#closeMediumModal')];
75
+ const mediumDialog = document.querySelector('#mediumModalDialog');
76
+
77
+ const smallButtons = [document.querySelector('#openSmallModal'), document.querySelector('#closeSmallModal')];
78
+ const smallDialog = document.querySelector('#smallModalDialog');
79
+
80
+ defaultButtons.forEach((button) => {
81
+ button.addEventListener('click', () => {
82
+ if (defaultDialog.hasAttribute('open')) {
83
+ defaultDialog.removeAttribute('open');
84
+ } else {
85
+ defaultDialog.setAttribute('open', true);
86
+ }
87
+ });
88
+ });
89
+
90
+ mediumButtons.forEach((button) => {
91
+ button.addEventListener('click', () => {
92
+ if (mediumDialog.hasAttribute('open')) {
93
+ mediumDialog.removeAttribute('open');
94
+ } else {
95
+ mediumDialog.setAttribute('open', true);
96
+ }
97
+ });
98
+ });
99
+
100
+ smallButtons.forEach((button) => {
101
+ button.addEventListener('click', () => {
102
+ if (smallDialog.hasAttribute('open')) {
103
+ smallDialog.removeAttribute('open');
104
+ } else {
105
+ smallDialog.setAttribute('open', true);
106
+ }
107
+ });
108
+ });
109
+ }
110
+
111
+ function initPopoverAndDropdownExample() {
112
+ const buttons = [document.querySelector('#openPopAndDrop'), document.querySelector('#closePopAndDrop')];
113
+ const dialog = document.querySelector('#popover-dialog');
114
+
115
+ buttons.forEach((button) => {
116
+ button.addEventListener('click', () => {
117
+ if (dialog.hasAttribute('open')) {
118
+ dialog.removeAttribute('open');
119
+ } else {
120
+ dialog.setAttribute('open', true);
121
+ }
122
+ });
123
+ });
124
+ }
125
+
126
+ function initSizeOptionsExample() {
127
+ const defaultButtons = [document.querySelector('#openDefaultSize'), document.querySelector('#closeDefaultSize')];
128
+ const defaultDialog = document.querySelector('#defaultSizeDialog');
129
+
130
+ const mediumButtons = [document.querySelector('#openMediumSize'), document.querySelector('#closeMediumSize')];
131
+ const mediumDialog = document.querySelector('#mediumSizeDialog');
132
+
133
+ const smallButtons = [document.querySelector('#openSmallSize'), document.querySelector('#closeSmallSize')];
134
+ const smallDialog = document.querySelector('#smallSizeDialog');
135
+
136
+ defaultButtons.forEach((button) => {
137
+ button.addEventListener('click', () => {
138
+ if (defaultDialog.hasAttribute('open')) {
139
+ defaultDialog.removeAttribute('open');
140
+ } else {
141
+ defaultDialog.setAttribute('open', true);
142
+ }
143
+ });
144
+ });
145
+
146
+ mediumButtons.forEach((button) => {
147
+ button.addEventListener('click', () => {
148
+ if (mediumDialog.hasAttribute('open')) {
149
+ mediumDialog.removeAttribute('open');
150
+ } else {
151
+ mediumDialog.setAttribute('open', true);
152
+ }
153
+ });
154
+ });
155
+
156
+ smallButtons.forEach((button) => {
157
+ button.addEventListener('click', () => {
158
+ if (smallDialog.hasAttribute('open')) {
159
+ smallDialog.removeAttribute('open');
160
+ } else {
161
+ smallDialog.setAttribute('open', true);
162
+ }
163
+ });
164
+ });
9
165
  }
10
166
 
11
- function initDialogApiExamples(initCount) {
167
+ function initExamples(initCount) {
12
168
  initCount = initCount || 0;
13
169
 
14
170
  try {
15
- toggleDialog();
16
- } catch (error) {
171
+ initBasicExample();
172
+ initAccessibilityExample();
173
+ initDecoupledExample();
174
+ initEditCloseButtonExample();
175
+ initModalExample();
176
+ initPopoverAndDropdownExample();
177
+ initSizeOptionsExample();
178
+ } catch (err) {
17
179
  if (initCount <= 20) {
18
180
  // setTimeout handles issue where content is sometimes loaded after the functions get called
19
181
  setTimeout(() => {
20
- initDialogApiExamples(initCount + 1);
182
+ initExamples(initCount + 1);
21
183
  }, 100);
22
184
  }
23
185
  }
24
186
  }
25
187
 
188
+ export { initExamples };
package/demo/index.js CHANGED
@@ -1,15 +1,17 @@
1
- import { toggleDialog } from "../apiExamples/toggleDialog";
1
+ import { initBasicExample } from "../apiExamples/basic";
2
+ import { initCustomExample } from "../apiExamples/custom";
2
3
 
3
- export function initDialogIndexExamples(initCount) {
4
+ export function initExamples(initCount) {
4
5
  initCount = initCount || 0;
5
6
 
6
7
  try {
7
- toggleDialog();
8
- } catch (error) {
8
+ initBasicExample();
9
+ initCustomExample();
10
+ } catch (err) {
9
11
  if (initCount <= 20) {
10
12
  // setTimeout handles issue where content is sometimes loaded after the functions get called
11
13
  setTimeout(() => {
12
- initDialogIndexExamples(initCount + 1);
14
+ initExamples(initCount + 1);
13
15
  }, 100);
14
16
  }
15
17
  }
package/demo/index.md CHANGED
@@ -78,7 +78,7 @@ It should be noted that the `footer` slot is reserved for the placement of actio
78
78
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../apiExamples/basic.html) -->
79
79
  <!-- The below content is automatically added from ./../../apiExamples/basic.html -->
80
80
  <div>
81
- <auro-button onClick="toggleDialog('#defaultDialog')">Open default dialog</auro-button>
81
+ <auro-button id="openBasic">Open default dialog</auro-button>
82
82
  </div>
83
83
  <auro-dialog id="defaultDialog">
84
84
  <span slot="header">Default Dialog</span>
@@ -94,7 +94,7 @@ It should be noted that the `footer` slot is reserved for the placement of actio
94
94
  </ul>
95
95
  </div>
96
96
  <div slot="footer">
97
- <auro-button secondary onClick="toggleDialog('#defaultDialog')">Close</auro-button>
97
+ <auro-button secondary id="closeBasic">Close</auro-button>
98
98
  </div>
99
99
  </auro-dialog>
100
100
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -106,7 +106,7 @@ It should be noted that the `footer` slot is reserved for the placement of actio
106
106
 
107
107
  ```html
108
108
  <div>
109
- <auro-button onClick="toggleDialog('#defaultDialog')">Open default dialog</auro-button>
109
+ <auro-button id="openBasic">Open default dialog</auro-button>
110
110
  </div>
111
111
  <auro-dialog id="defaultDialog">
112
112
  <span slot="header">Default Dialog</span>
@@ -122,7 +122,7 @@ It should be noted that the `footer` slot is reserved for the placement of actio
122
122
  </ul>
123
123
  </div>
124
124
  <div slot="footer">
125
- <auro-button secondary onClick="toggleDialog('#defaultDialog')">Close</auro-button>
125
+ <auro-button secondary id="closeBasic">Close</auro-button>
126
126
  </div>
127
127
  </auro-dialog>
128
128
  ```
@@ -147,7 +147,7 @@ This will create a new custom element that you can use in your HTML that will fu
147
147
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../apiExamples/custom.html) -->
148
148
  <!-- The below content is automatically added from ./../../apiExamples/custom.html -->
149
149
  <div>
150
- <auro-button onClick="toggleDialog('#customDialog')">Open default dialog</auro-button>
150
+ <auro-button id="openCustom">Open default dialog</auro-button>
151
151
  </div>
152
152
  <custom-dialog id="customDialog">
153
153
  <span slot="header">Default Dialog</span>
@@ -163,7 +163,7 @@ This will create a new custom element that you can use in your HTML that will fu
163
163
  </ul>
164
164
  </div>
165
165
  <div slot="footer">
166
- <auro-button secondary onClick="toggleDialog('#customDialog')">Close</auro-button>
166
+ <auro-button secondary id="closeCustom">Close</auro-button>
167
167
  </div>
168
168
  </custom-dialog>
169
169
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -175,7 +175,7 @@ This will create a new custom element that you can use in your HTML that will fu
175
175
 
176
176
  ```html
177
177
  <div>
178
- <auro-button onClick="toggleDialog('#customDialog')">Open default dialog</auro-button>
178
+ <auro-button id="openCustom">Open default dialog</auro-button>
179
179
  </div>
180
180
  <custom-dialog id="customDialog">
181
181
  <span slot="header">Default Dialog</span>
@@ -191,7 +191,7 @@ This will create a new custom element that you can use in your HTML that will fu
191
191
  </ul>
192
192
  </div>
193
193
  <div slot="footer">
194
- <auro-button secondary onClick="toggleDialog('#customDialog')">Close</auro-button>
194
+ <auro-button secondary id="closeCustom">Close</auro-button>
195
195
  </div>
196
196
  </custom-dialog>
197
197
  ```
package/demo/index.min.js CHANGED
@@ -1,25 +1,47 @@
1
- function toggleDialog(dialogID) {
2
- const dialog = document.querySelector(dialogID);
1
+ function initBasicExample() {
2
+ const buttons = [document.querySelector('#openBasic'), document.querySelector('#closeBasic')];
3
+ const dialog = document.querySelector('#defaultDialog');
3
4
 
4
- if (dialog.hasAttribute('open')) {
5
- dialog.removeAttribute('open');
6
- } else {
7
- dialog.setAttribute('open', true);
8
- }
5
+ buttons.forEach((button) => {
6
+ button.addEventListener('click', () => {
7
+ if (dialog.hasAttribute('open')) {
8
+ dialog.removeAttribute('open');
9
+ } else {
10
+ dialog.setAttribute('open', true);
11
+ }
12
+ });
13
+ });
14
+ }
15
+
16
+ function initCustomExample() {
17
+ const buttons = [document.querySelector('#openCustom'), document.querySelector('#closeCustom')];
18
+ const dialog = document.querySelector('#defaultDialog');
19
+
20
+ buttons.forEach((button) => {
21
+ button.addEventListener('click', () => {
22
+ if (dialog.hasAttribute('open')) {
23
+ dialog.removeAttribute('open');
24
+ } else {
25
+ dialog.setAttribute('open', true);
26
+ }
27
+ });
28
+ });
9
29
  }
10
30
 
11
- function initDialogIndexExamples(initCount) {
31
+ function initExamples(initCount) {
12
32
  initCount = initCount || 0;
13
33
 
14
34
  try {
15
- toggleDialog();
16
- } catch (error) {
35
+ initBasicExample();
36
+ initCustomExample();
37
+ } catch (err) {
17
38
  if (initCount <= 20) {
18
39
  // setTimeout handles issue where content is sometimes loaded after the functions get called
19
40
  setTimeout(() => {
20
- initDialogIndexExamples(initCount + 1);
41
+ initExamples(initCount + 1);
21
42
  }, 100);
22
43
  }
23
44
  }
24
45
  }
25
46
 
47
+ export { initExamples };
@@ -0,0 +1,12 @@
1
+ export function initAccessibilityExample() {
2
+ const button = document.querySelector('#openAccessibility');
3
+ const dialog = document.querySelector('#unformattedMdDialog');
4
+
5
+ button.addEventListener('click', () => {
6
+ if (dialog.hasAttribute('open')) {
7
+ dialog.removeAttribute('open');
8
+ } else {
9
+ dialog.setAttribute('open', true);
10
+ }
11
+ });
12
+ }
@@ -37,11 +37,11 @@ const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
38
  */const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return w}});
39
39
 
40
- var styleCss = i$3`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_inlinePaddingNone--left{padding-left:0}.util_inlinePaddingNone--right{padding-right:0}.util_inlineMarginNone--left{margin-left:0}.util_inlineMarginNone--right{margin-right:0}.util_inlinePadding25--left{padding-left:.125rem}.util_inlinePadding25--right{padding-right:.125rem}.util_inlineMargin25--left{margin-left:.125rem}.util_inlineMargin25--right{margin-right:.125rem}.util_inlinePadding50--left{padding-left:.25rem}.util_inlinePadding50--right{padding-right:.25rem}.util_inlineMargin50--left{margin-left:.25rem}.util_inlineMargin50--right{margin-right:.25rem}.util_inlinePadding100--left{padding-left:.5rem}.util_inlinePadding100--right{padding-right:.5rem}.util_inlineMargin100--left{margin-left:.5rem}.util_inlineMargin100--right{margin-right:.5rem}.util_inlinePadding200--left{padding-left:1rem}.util_inlinePadding200--right{padding-right:1rem}.util_inlineMargin200--left{margin-left:1rem}.util_inlineMargin200--right{margin-right:1rem}.util_inlinePadding300--left{padding-left:1.5rem}.util_inlinePadding300--right{padding-right:1.5rem}.util_inlineMargin300--left{margin-left:1.5rem}.util_inlineMargin300--right{margin-right:1.5rem}.util_inlinePadding400--left{padding-left:2rem}.util_inlinePadding400--right{padding-right:2rem}.util_inlineMargin400--left{margin-left:2rem}.util_inlineMargin400--right{margin-right:2rem}.util_inlinePadding500--left{padding-left:2.5rem}.util_inlinePadding500--right{padding-right:2.5rem}.util_inlineMargin500--left{margin-left:2.5rem}.util_inlineMargin500--right{margin-right:2.5rem}.util_inlinePadding600--left{padding-left:3rem}.util_inlinePadding600--right{padding-right:3rem}.util_inlineMargin600--left{margin-left:3rem}.util_inlineMargin600--right{margin-right:3rem}.util_inlinePadding700--left{padding-left:3.5rem}.util_inlinePadding700--right{padding-right:3.5rem}.util_inlineMargin700--left{margin-left:3.5rem}.util_inlineMargin700--right{margin-right:3.5rem}.util_inlinePadding800--left{padding-left:4rem}.util_inlinePadding800--right{padding-right:4rem}.util_inlineMargin800--left{margin-left:4rem}.util_inlineMargin800--right{margin-right:4rem}.util_inlinePadding900--left{padding-left:4.5rem}.util_inlinePadding900--right{padding-right:4.5rem}.util_inlineMargin900--left{margin-left:4.5rem}.util_inlineMargin900--right{margin-right:4.5rem}.util_inlinePadding1000--left{padding-left:5rem}.util_inlinePadding1000--right{padding-right:5rem}.util_inlineMargin1000--left{margin-left:5rem}.util_inlineMargin1000--right{margin-right:5rem}.util_stackPaddingNone--top{padding-top:0}.util_stackPaddingNone--bottom{padding-bottom:0}.util_stackMarginNone--top{margin-top:0}.util_stackMarginNone--bottom{margin-bottom:0}.util_stackPadding25--top{padding-top:.125rem}.util_stackPadding25--bottom{padding-bottom:.125rem}.util_stackMargin25--top{margin-top:.125rem}.util_stackMargin25--bottom{margin-bottom:.125rem}.util_stackPadding50--top{padding-top:.25rem}.util_stackPadding50--bottom{padding-bottom:.25rem}.util_stackMargin50--top{margin-top:.25rem}.util_stackMargin50--bottom{margin-bottom:.25rem}.util_stackPadding100--top{padding-top:.5rem}.util_stackPadding100--bottom{padding-bottom:.5rem}.util_stackMargin100--top{margin-top:.5rem}.util_stackMargin100--bottom{margin-bottom:.5rem}.util_stackPadding200--top{padding-top:1rem}.util_stackPadding200--bottom{padding-bottom:1rem}.util_stackMargin200--top{margin-top:1rem}.util_stackMargin200--bottom{margin-bottom:1rem}.util_stackPadding300--top{padding-top:1.5rem}.util_stackPadding300--bottom{padding-bottom:1.5rem}.util_stackMargin300--top{margin-top:1.5rem}.util_stackMargin300--bottom{margin-bottom:1.5rem}.util_stackPadding400--top{padding-top:2rem}.util_stackPadding400--bottom{padding-bottom:2rem}.util_stackMargin400--top{margin-top:2rem}.util_stackMargin400--bottom{margin-bottom:2rem}.util_stackPadding500--top{padding-top:2.5rem}.util_stackPadding500--bottom{padding-bottom:2.5rem}.util_stackMargin500--top{margin-top:2.5rem}.util_stackMargin500--bottom{margin-bottom:2.5rem}.util_stackPadding600--top{padding-top:3rem}.util_stackPadding600--bottom{padding-bottom:3rem}.util_stackMargin600--top{margin-top:3rem}.util_stackMargin600--bottom{margin-bottom:3rem}.util_stackPadding700--top{padding-top:3.5rem}.util_stackPadding700--bottom{padding-bottom:3.5rem}.util_stackMargin700--top{margin-top:3.5rem}.util_stackMargin700--bottom{margin-bottom:3.5rem}.util_stackPadding800--top{padding-top:4rem}.util_stackPadding800--bottom{padding-bottom:4rem}.util_stackMargin800--top{margin-top:4rem}.util_stackMargin800--bottom{margin-bottom:4rem}.util_stackPadding900--top{padding-top:4.5rem}.util_stackPadding900--bottom{padding-bottom:4.5rem}.util_stackMargin900--top{margin-top:4.5rem}.util_stackMargin900--bottom{margin-bottom:4.5rem}.util_stackPadding1000--top{padding-top:5rem}.util_stackPadding1000--bottom{padding-bottom:5rem}.util_stackMargin1000--top{margin-top:5rem}.util_stackMargin1000--bottom{margin-bottom:5rem}:host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}.dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}.dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}.dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}.dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:block;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){.dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}.dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){.dialog{max-width:986px}}.dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}.dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){.dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}.dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}.dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}.dialog-header--action:hover{cursor:pointer}::slotted([slot=content]){position:relative}:host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([sm]) .dialog{max-width:740px}}:host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:80%}}:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:90%}:host([unformatted]) .dialog{padding:0}`;
40
+ var styleCss = i$3`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.heading{margin:1.75rem 0;letter-spacing:var(--ds-text-heading-default-spacing, -0.2px);font-weight:var(--ds-text-heading-default-weight, 500)}.heading--display{margin-top:0;font-size:var(--ds-text-heading-display-size-breakpoint-sm, 2.75rem);font-weight:var(--ds-text-heading-display-weight, 100);line-height:var(--ds-text-heading-display-height-breakpoint-sm, 3.375rem)}@media screen and (min-width: 768px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-md, 3rem);line-height:var(--ds-text-heading-display-height-breakpoint-md, 3.75rem)}}@media screen and (min-width: 1024px){.heading--display{font-size:var(--ds-text-heading-display-size-breakpoint-lg, 3.5rem);line-height:var(--ds-text-heading-display-height-breakpoint-lg, 4.25rem)}}.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-sm, 2rem);font-weight:var(--ds-text-heading-800-weight, 500);line-height:var(--ds-text-heading-800-height-breakpoint-sm, 2.375rem)}@media screen and (min-width: 768px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-md, 2.25rem);line-height:var(--ds-text-heading-800-height-breakpoint-md, 2.625rem)}}@media screen and (min-width: 1024px){.heading--800{font-size:var(--ds-text-heading-800-size-breakpoint-lg, 2.5rem);line-height:var(--ds-text-heading-800-height-breakpoint-lg, 3rem)}}.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-sm, 1.75rem);font-weight:var(--ds-text-heading-700-weight, 500);line-height:var(--ds-text-heading-700-height-breakpoint-sm, 2.125rem)}@media screen and (min-width: 768px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-md, 2rem);line-height:var(--ds-text-heading-700-height-breakpoint-md, 2.375rem)}}@media screen and (min-width: 1024px){.heading--700{font-size:var(--ds-text-heading-700-size-breakpoint-lg, 2.25rem);line-height:var(--ds-text-heading-700-height-breakpoint-lg, 2.75rem)}}.heading--600{margin:1rem 0;font-size:var(--ds-text-heading-600-size-breakpoint-sm, 1.625rem);font-weight:var(--ds-text-heading-600-weight, 300);line-height:var(--ds-text-heading-600-height-breakpoint-sm, 1.875rem)}@media screen and (min-width: 768px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-md, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-md, 2.125rem)}}@media screen and (min-width: 1024px){.heading--600{font-size:var(--ds-text-heading-600-size-breakpoint-lg, 1.75rem);line-height:var(--ds-text-heading-600-height-breakpoint-lg, 2.25rem)}}.heading--500{margin:1rem 0;font-size:var(--ds-text-heading-500-size-breakpoint-sm, 1.375rem);font-weight:var(--ds-text-heading-500-weight, 300);line-height:var(--ds-text-heading-500-height-breakpoint-sm, 1.625rem)}@media screen and (min-width: 768px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-md, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-md, 1.875rem)}}@media screen and (min-width: 1024px){.heading--500{font-size:var(--ds-text-heading-500-size-breakpoint-lg, 1.5rem);line-height:var(--ds-text-heading-500-height-breakpoint-lg, 2rem)}}.heading--400{margin:.75rem 0;font-size:var(--ds-text-heading-400-size, 1.25rem);font-weight:var(--ds-text-heading-400-weight, 300);line-height:var(--ds-text-heading-400-height, 1.625rem)}.heading--300{margin:.75rem 0;font-size:var(--ds-text-heading-300-size, 1.125rem);font-weight:var(--ds-text-heading-300-weight, 300);line-height:var(--ds-text-heading-300-height, 1.625rem)}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}.util_inlinePaddingNone--left{padding-left:0}.util_inlinePaddingNone--right{padding-right:0}.util_inlineMarginNone--left{margin-left:0}.util_inlineMarginNone--right{margin-right:0}.util_inlinePadding25--left{padding-left:.125rem}.util_inlinePadding25--right{padding-right:.125rem}.util_inlineMargin25--left{margin-left:.125rem}.util_inlineMargin25--right{margin-right:.125rem}.util_inlinePadding50--left{padding-left:.25rem}.util_inlinePadding50--right{padding-right:.25rem}.util_inlineMargin50--left{margin-left:.25rem}.util_inlineMargin50--right{margin-right:.25rem}.util_inlinePadding100--left{padding-left:.5rem}.util_inlinePadding100--right{padding-right:.5rem}.util_inlineMargin100--left{margin-left:.5rem}.util_inlineMargin100--right{margin-right:.5rem}.util_inlinePadding200--left{padding-left:1rem}.util_inlinePadding200--right{padding-right:1rem}.util_inlineMargin200--left{margin-left:1rem}.util_inlineMargin200--right{margin-right:1rem}.util_inlinePadding300--left{padding-left:1.5rem}.util_inlinePadding300--right{padding-right:1.5rem}.util_inlineMargin300--left{margin-left:1.5rem}.util_inlineMargin300--right{margin-right:1.5rem}.util_inlinePadding400--left{padding-left:2rem}.util_inlinePadding400--right{padding-right:2rem}.util_inlineMargin400--left{margin-left:2rem}.util_inlineMargin400--right{margin-right:2rem}.util_inlinePadding500--left{padding-left:2.5rem}.util_inlinePadding500--right{padding-right:2.5rem}.util_inlineMargin500--left{margin-left:2.5rem}.util_inlineMargin500--right{margin-right:2.5rem}.util_inlinePadding600--left{padding-left:3rem}.util_inlinePadding600--right{padding-right:3rem}.util_inlineMargin600--left{margin-left:3rem}.util_inlineMargin600--right{margin-right:3rem}.util_inlinePadding700--left{padding-left:3.5rem}.util_inlinePadding700--right{padding-right:3.5rem}.util_inlineMargin700--left{margin-left:3.5rem}.util_inlineMargin700--right{margin-right:3.5rem}.util_inlinePadding800--left{padding-left:4rem}.util_inlinePadding800--right{padding-right:4rem}.util_inlineMargin800--left{margin-left:4rem}.util_inlineMargin800--right{margin-right:4rem}.util_inlinePadding900--left{padding-left:4.5rem}.util_inlinePadding900--right{padding-right:4.5rem}.util_inlineMargin900--left{margin-left:4.5rem}.util_inlineMargin900--right{margin-right:4.5rem}.util_inlinePadding1000--left{padding-left:5rem}.util_inlinePadding1000--right{padding-right:5rem}.util_inlineMargin1000--left{margin-left:5rem}.util_inlineMargin1000--right{margin-right:5rem}.util_stackPaddingNone--top{padding-top:0}.util_stackPaddingNone--bottom{padding-bottom:0}.util_stackMarginNone--top{margin-top:0}.util_stackMarginNone--bottom{margin-bottom:0}.util_stackPadding25--top{padding-top:.125rem}.util_stackPadding25--bottom{padding-bottom:.125rem}.util_stackMargin25--top{margin-top:.125rem}.util_stackMargin25--bottom{margin-bottom:.125rem}.util_stackPadding50--top{padding-top:.25rem}.util_stackPadding50--bottom{padding-bottom:.25rem}.util_stackMargin50--top{margin-top:.25rem}.util_stackMargin50--bottom{margin-bottom:.25rem}.util_stackPadding100--top{padding-top:.5rem}.util_stackPadding100--bottom{padding-bottom:.5rem}.util_stackMargin100--top{margin-top:.5rem}.util_stackMargin100--bottom{margin-bottom:.5rem}.util_stackPadding200--top{padding-top:1rem}.util_stackPadding200--bottom{padding-bottom:1rem}.util_stackMargin200--top{margin-top:1rem}.util_stackMargin200--bottom{margin-bottom:1rem}.util_stackPadding300--top{padding-top:1.5rem}.util_stackPadding300--bottom{padding-bottom:1.5rem}.util_stackMargin300--top{margin-top:1.5rem}.util_stackMargin300--bottom{margin-bottom:1.5rem}.util_stackPadding400--top{padding-top:2rem}.util_stackPadding400--bottom{padding-bottom:2rem}.util_stackMargin400--top{margin-top:2rem}.util_stackMargin400--bottom{margin-bottom:2rem}.util_stackPadding500--top{padding-top:2.5rem}.util_stackPadding500--bottom{padding-bottom:2.5rem}.util_stackMargin500--top{margin-top:2.5rem}.util_stackMargin500--bottom{margin-bottom:2.5rem}.util_stackPadding600--top{padding-top:3rem}.util_stackPadding600--bottom{padding-bottom:3rem}.util_stackMargin600--top{margin-top:3rem}.util_stackMargin600--bottom{margin-bottom:3rem}.util_stackPadding700--top{padding-top:3.5rem}.util_stackPadding700--bottom{padding-bottom:3.5rem}.util_stackMargin700--top{margin-top:3.5rem}.util_stackMargin700--bottom{margin-bottom:3.5rem}.util_stackPadding800--top{padding-top:4rem}.util_stackPadding800--bottom{padding-bottom:4rem}.util_stackMargin800--top{margin-top:4rem}.util_stackMargin800--bottom{margin-bottom:4rem}.util_stackPadding900--top{padding-top:4.5rem}.util_stackPadding900--bottom{padding-bottom:4.5rem}.util_stackMargin900--top{margin-top:4.5rem}.util_stackMargin900--bottom{margin-bottom:4.5rem}.util_stackPadding1000--top{padding-top:5rem}.util_stackPadding1000--bottom{padding-bottom:5rem}.util_stackMargin1000--top{margin-top:5rem}.util_stackMargin1000--bottom{margin-bottom:5rem}:host{--insetPaddingXl:0 var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400) var(--ds-size-400, $ds-size-400);--insetPaddingXxl:0 var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600) var(--ds-size-600, $ds-size-600);--insetPaddingXxxl:0 var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800) var(--ds-size-800, $ds-size-800)}.dialogOverlay{position:fixed;z-index:-1;bottom:0;left:0;width:100%;height:100%}.dialogOverlay--open{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.2, 0);background:rgba(0, 0, 0, 0.2)}.dialogOverlay--modal{z-index:var(--ds-depth-overlay);transition:background .3s cubic-bezier(0.4, 0, 0.5, 0);background:rgba(0, 0, 0, 0.5)}.dialog{position:fixed;z-index:-1;right:0;bottom:0;left:0;display:flex;flex-direction:column;visibility:hidden;overflow:visible;width:100%;max-height:90%;padding:var(--insetPaddingXl);transform:translateY(100%);opacity:0;border:0;background:var(--ds-color-background-lightest, #ffffff);color:var(--ds-color-text-primary-default, #222222);transition:all .3s ease-in-out}@media screen and (min-width: 768px){.dialog{top:10%;bottom:unset;max-width:80%;max-height:80%;margin:auto;padding:var(--insetPaddingXxxl);transform:scale(0);box-shadow:0 10px 20px 0 rgba(0, 0, 0, 0.12),0 1px 10px 0 rgba(0, 0, 0, 0.1)}.dialog--open{transform:scale(1)}}@media screen and (min-width: 1024px){.dialog{max-width:986px}}.dialog--open{z-index:var(--ds-depth-modal, 400);visibility:visible;transform:translateY(0%);opacity:1}.dialog-footer{padding-top:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){.dialog-footer ::slotted(*){display:flex;justify-content:flex-end}}.dialog-header{display:flex;align-items:flex-start;justify-content:space-between;padding-top:var(--ds-size-800, 4rem)}.dialog-header svg{fill:var(--ds-color-text-secondary-default, #626b79)}.dialog-header--action{margin:0;padding:0;border:none;border:2px solid transparent;border-radius:var(--ds-border-radius, 0.375rem);background-color:transparent}.dialog-header--action:hover{cursor:pointer}.dialog-content{flex:1;overflow:auto;overscroll-behavior:contain}::slotted([slot=content]){position:relative}:host([unformatted]) .dialog-header--action{position:absolute;top:var(--ds-size-400, 2rem);right:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){:host([unformatted]) .dialog-header--action{top:var(--ds-size-800, 4rem);right:var(--ds-size-800, 4rem)}}:host([unformatted][onDark]) .dialog-header--action{color:var(--ds-color-base-white, #ffffff)}:host([sm]) .dialog{max-height:30%}@media screen and (min-width: 768px){:host([sm]) .dialog{top:10%;max-width:40%;max-height:80%;padding:var(--insetPaddingXxl)}}@media screen and (min-width: 1024px){:host([sm]) .dialog{max-width:740px}}:host([md]) .dialog{max-height:50%}@media screen and (min-width: 768px){:host([md]) .dialog{top:10%;max-width:70%;max-height:80%}}@media screen and (min-width: 1024px){:host([md]) .dialog{top:10%;max-width:986px}}@media screen and (min-width: 768px){:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:80%}}:host([sm][lg]) .dialog,:host([md][lg]) .dialog{max-height:90%}:host([unformatted]) .dialog{padding:0}`;
41
41
 
42
42
  var styleUnformattedCss = i$3`[unformatted] .unformattedWrapper{padding:var(--ds-size-400, 2rem)}@media screen and (min-width: 768px){[unformatted] .unformattedWrapper{padding:var(--ds-size-800, 4rem);padding-top:var(--ds-size-400, 2rem)}}`;
43
43
 
44
- var closeIcon = {"role":"img","color":"currentColor","title":"","desc":"","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","type":"icon","name":"x-lg","category":"interface","deprecated":false,"svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\"><title/><path d=\"m5.397 5.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l5.47-5.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084L13.061 12l5.47 5.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-5.47 5.47a.75.75 0 0 1-.976.072l-.084-.073a.75.75 0 0 1-.073-.976l.073-.084L10.939 12l-5.47-5.47a.75.75 0 0 1-.072-.976l.073-.084z\"/></svg>"};
44
+ var closeIcon = {"role":"img","color":"currentColor","title":"","desc":"","width":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","height":"var(--auro-size-lg, var(--ds-size-300, 1.5rem))","xmlns":"http://www.w3.org/2000/svg","xmlns_xlink":"http://www.w3.org/1999/xlink","viewBox":"0 0 24 24","path":"/icons","style":"ico_squareLarge","type":"icon","name":"x-lg","category":"interface","svg":"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" aria-hidden=\"true\" class=\"ico_squareLarge\" role=\"img\" style=\"min-width:var(--auro-size-lg, var(--ds-size-300, 1.5rem));height:var(--auro-size-lg, var(--ds-size-300, 1.5rem));fill:currentColor\" viewBox=\"0 0 24 24\"><title/><path d=\"m5.397 5.554.073-.084a.75.75 0 0 1 .976-.073l.084.073L12 10.939l5.47-5.47a.75.75 0 0 1 .976-.072l.084.073a.75.75 0 0 1 .073.976l-.073.084L13.061 12l5.47 5.47a.75.75 0 0 1 .072.976l-.073.084a.75.75 0 0 1-.976.073l-.084-.073L12 13.061l-5.47 5.47a.75.75 0 0 1-.976.072l-.084-.073a.75.75 0 0 1-.073-.976l.073-.084L10.939 12l-5.47-5.47a.75.75 0 0 1-.072-.976l.073-.084z\"/></svg>"};
45
45
 
46
46
  // Copyright (c) 2024 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
47
47
  // See LICENSE in the project root for license information.
@@ -194,13 +194,15 @@ class ComponentBase extends s {
194
194
 
195
195
  const closeButton = this.shadowRoot.getElementById('dialog-close');
196
196
 
197
- lastFocusableElement.addEventListener('focusout', () => {
198
- if (closeButton !== null) { // eslint-disable-line no-negated-condition
199
- closeButton.focus();
200
- } else {
201
- firstFocusableElement.focus();
202
- }
203
- });
197
+ if (lastFocusableElement) {
198
+ lastFocusableElement.addEventListener('focusout', () => {
199
+ if (closeButton !== null) { // eslint-disable-line no-negated-condition
200
+ closeButton.focus();
201
+ } else {
202
+ firstFocusableElement.focus();
203
+ }
204
+ });
205
+ }
204
206
  }
205
207
 
206
208
  /**
package/dist/basic.js ADDED
@@ -0,0 +1,14 @@
1
+ export function initBasicExample() {
2
+ const buttons = [document.querySelector('#openBasic'), document.querySelector('#closeBasic')];
3
+ const dialog = document.querySelector('#defaultDialog');
4
+
5
+ buttons.forEach((button) => {
6
+ button.addEventListener('click', () => {
7
+ if (dialog.hasAttribute('open')) {
8
+ dialog.removeAttribute('open');
9
+ } else {
10
+ dialog.setAttribute('open', true);
11
+ }
12
+ });
13
+ });
14
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"componentBase.d.ts","sourceRoot":"","sources":["../src/componentBase.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;IAkBE;;;;;;;;;;;;;;;MAeC;IAsID,+CAKC;IAxKC;;OAEG;IACH,YAAsE;IAEtE;;OAEG;IACH,YAAmC;IAEnC,eAAkB;IAClB,qBAAwB;IAoB1B,qBASC;IALC,oBAAsD;IAOxD;;;;OAIG;IACH,2BAHW,IAAI,MAAM,EAAE,GAAG,CAAC,GACd,IAAI,CAUhB;IAIC,yBAAwD;IAS1D;;;OAGG;IACH,mBAQC;IAPC,wBAA4C;IAS9C;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,4BAMC;IAED;;;OAGG;IACH,wBAeC;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,+BAEC;IADC,cAAiB;IAGnB;;;;OAIG;IACH,sBAIC;IAED;;;;OAIG;IACH,cAIC;IASD;;;OAGG;IACH,uBASC;IAED,+CAuCC;CACF;2BAzQgC,KAAK"}
1
+ {"version":3,"file":"componentBase.d.ts","sourceRoot":"","sources":["../src/componentBase.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;IAkBE;;;;;;;;;;;;;;;MAeC;IAwID,+CAKC;IA1KC;;OAEG;IACH,YAAsE;IAEtE;;OAEG;IACH,YAAmC;IAEnC,eAAkB;IAClB,qBAAwB;IAoB1B,qBASC;IALC,oBAAsD;IAOxD;;;;OAIG;IACH,2BAHW,IAAI,MAAM,EAAE,GAAG,CAAC,GACd,IAAI,CAUhB;IAIC,yBAAwD;IAS1D;;;OAGG;IACH,mBAQC;IAPC,wBAA4C;IAS9C;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,4BAMC;IAED;;;OAGG;IACH,wBAiBC;IAED;;;OAGG;IACH,2BAIC;IAED;;;OAGG;IACH,+BAEC;IADC,cAAiB;IAGnB;;;;OAIG;IACH,sBAIC;IAED;;;;OAIG;IACH,cAIC;IASD;;;OAGG;IACH,uBASC;IAED,+CAuCC;CACF;2BA3QgC,KAAK"}
@@ -159,13 +159,15 @@ export default class ComponentBase extends LitElement {
159
159
 
160
160
  const closeButton = this.shadowRoot.getElementById('dialog-close');
161
161
 
162
- lastFocusableElement.addEventListener('focusout', () => {
163
- if (closeButton !== null) { // eslint-disable-line no-negated-condition
164
- closeButton.focus();
165
- } else {
166
- firstFocusableElement.focus();
167
- }
168
- });
162
+ if (lastFocusableElement) {
163
+ lastFocusableElement.addEventListener('focusout', () => {
164
+ if (closeButton !== null) { // eslint-disable-line no-negated-condition
165
+ closeButton.focus();
166
+ } else {
167
+ firstFocusableElement.focus();
168
+ }
169
+ });
170
+ }
169
171
  }
170
172
 
171
173
  /**
package/dist/custom.js ADDED
@@ -0,0 +1,14 @@
1
+ export function initCustomExample() {
2
+ const buttons = [document.querySelector('#openCustom'), document.querySelector('#closeCustom')];
3
+ const dialog = document.querySelector('#defaultDialog');
4
+
5
+ buttons.forEach((button) => {
6
+ button.addEventListener('click', () => {
7
+ if (dialog.hasAttribute('open')) {
8
+ dialog.removeAttribute('open');
9
+ } else {
10
+ dialog.setAttribute('open', true);
11
+ }
12
+ });
13
+ });
14
+ }
@@ -0,0 +1,27 @@
1
+ export function initDecoupledExample() {
2
+ const smLgButtons = [document.querySelector('#openSmLg'), document.querySelector('#closeSmLg')];
3
+ const smLgDialog = document.querySelector('#smLgDialog');
4
+
5
+ const mdLgButtons = [document.querySelector('#openMdLg'), document.querySelector('#closeMdLg')];
6
+ const mdLgDialog = document.querySelector('#mdLgDialog');
7
+
8
+ smLgButtons.forEach((button) => {
9
+ button.addEventListener('click', () => {
10
+ if (smLgDialog.hasAttribute('open')) {
11
+ smLgDialog.removeAttribute('open');
12
+ } else {
13
+ smLgDialog.setAttribute('open', true);
14
+ }
15
+ });
16
+ });
17
+
18
+ mdLgButtons.forEach((button) => {
19
+ button.addEventListener('click', () => {
20
+ if (mdLgDialog.hasAttribute('open')) {
21
+ mdLgDialog.removeAttribute('open');
22
+ } else {
23
+ mdLgDialog.setAttribute('open', true);
24
+ }
25
+ });
26
+ });
27
+ }
@@ -0,0 +1,12 @@
1
+ export function initEditCloseButtonExample() {
2
+ const button = document.querySelector('#openEditDialog');
3
+ const dialog = document.querySelector('#unformattedCustomMdDialog');
4
+
5
+ button.addEventListener('click', () => {
6
+ if (dialog.hasAttribute('open')) {
7
+ dialog.removeAttribute('open');
8
+ } else {
9
+ dialog.setAttribute('open', true);
10
+ }
11
+ });
12
+ }
package/dist/modal.js ADDED
@@ -0,0 +1,40 @@
1
+ export function initModalExample() {
2
+ const defaultButtons = [document.querySelector('#openDefaultModal'), document.querySelector('#closeDefaultModal')];
3
+ const defaultDialog = document.querySelector('#defaultModalDialog');
4
+
5
+ const mediumButtons = [document.querySelector('#openMediumModal'), document.querySelector('#closeMediumModal')];
6
+ const mediumDialog = document.querySelector('#mediumModalDialog');
7
+
8
+ const smallButtons = [document.querySelector('#openSmallModal'), document.querySelector('#closeSmallModal')];
9
+ const smallDialog = document.querySelector('#smallModalDialog');
10
+
11
+ defaultButtons.forEach((button) => {
12
+ button.addEventListener('click', () => {
13
+ if (defaultDialog.hasAttribute('open')) {
14
+ defaultDialog.removeAttribute('open');
15
+ } else {
16
+ defaultDialog.setAttribute('open', true);
17
+ }
18
+ });
19
+ });
20
+
21
+ mediumButtons.forEach((button) => {
22
+ button.addEventListener('click', () => {
23
+ if (mediumDialog.hasAttribute('open')) {
24
+ mediumDialog.removeAttribute('open');
25
+ } else {
26
+ mediumDialog.setAttribute('open', true);
27
+ }
28
+ });
29
+ });
30
+
31
+ smallButtons.forEach((button) => {
32
+ button.addEventListener('click', () => {
33
+ if (smallDialog.hasAttribute('open')) {
34
+ smallDialog.removeAttribute('open');
35
+ } else {
36
+ smallDialog.setAttribute('open', true);
37
+ }
38
+ });
39
+ });
40
+ }
@@ -0,0 +1,14 @@
1
+ export function initPopoverAndDropdownExample() {
2
+ const buttons = [document.querySelector('#openPopAndDrop'), document.querySelector('#closePopAndDrop')];
3
+ const dialog = document.querySelector('#popover-dialog');
4
+
5
+ buttons.forEach((button) => {
6
+ button.addEventListener('click', () => {
7
+ if (dialog.hasAttribute('open')) {
8
+ dialog.removeAttribute('open');
9
+ } else {
10
+ dialog.setAttribute('open', true);
11
+ }
12
+ });
13
+ });
14
+ }