@nysds/nys-modal 1.10.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.
@@ -0,0 +1 @@
1
+ export * from "./nys-modal";
@@ -0,0 +1,45 @@
1
+ import { LitElement } from "lit";
2
+ export declare class NysModal extends LitElement {
3
+ id: string;
4
+ heading: string;
5
+ subheading: string;
6
+ open: boolean;
7
+ mandatory: boolean;
8
+ private static readonly VALID_WIDTHS;
9
+ private _width;
10
+ get width(): (typeof NysModal.VALID_WIDTHS)[number];
11
+ set width(value: string);
12
+ private _actionButtonSlot;
13
+ private _prevFocusedElement;
14
+ private _originalBodyOverflow;
15
+ private hasBodySlots;
16
+ private hasActionSlots;
17
+ static styles: import("lit").CSSResult;
18
+ /**************** Lifecycle Methods ****************/
19
+ constructor();
20
+ connectedCallback(): void;
21
+ disconnectedCallback(): void;
22
+ firstUpdated(): void;
23
+ updated(changeProps: Map<string, any>): Promise<void>;
24
+ /******************** Functions ********************/
25
+ private _hideBodyScroll;
26
+ private _restoreBodyScroll;
27
+ private _savePrevFocused;
28
+ private _focusOnModal;
29
+ private _restorePrevFocused;
30
+ private _handleBodySlotChange;
31
+ private _handleActionSlotChange;
32
+ private _updateSlottedButtonWidth;
33
+ private _dispatchOpenEvent;
34
+ private _dispatchCloseEvent;
35
+ private _getAriaDescribedBy;
36
+ /**
37
+ * This exist to prevent the VO for dismiss button from announcing itself between the heading & subheading/slot content.
38
+ * We add the "Close this window" ariaLabel after the initial VO is done
39
+ */
40
+ private _updateDismissAria;
41
+ /****************** Event Handlers ******************/
42
+ private _handleKeydown;
43
+ private _closeModal;
44
+ render(): "" | import("lit-html").TemplateResult<1>;
45
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,717 @@
1
+ import { css as D, LitElement as N, html as S } from "lit";
2
+ /*!
3
+ * ▒█▄░▒█ ▒█░░▒█ ▒█▀▀▀█ ▒█▀▀▄ ▒█▀▀▀█
4
+ * ▒█▒█▒█ ▒█▄▄▄█ ░▀▀▀▄▄ ▒█░▒█ ░▀▀▀▄▄
5
+ * ▒█░░▀█ ░░▒█░░ ▒█▄▄▄█ ▒█▄▄▀ ▒█▄▄▄█
6
+ *
7
+ * Modal Component
8
+ * Part of the New York State Design System
9
+ * Repository: https://github.com/its-hcd/nysds
10
+ * License: MIT
11
+ */
12
+ /**
13
+ * @license
14
+ * Copyright 2019 Google LLC
15
+ * SPDX-License-Identifier: BSD-3-Clause
16
+ */
17
+ const v = globalThis, P = v.ShadowRoot && (v.ShadyCSS === void 0 || v.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, M = Symbol(), A = /* @__PURE__ */ new WeakMap();
18
+ let T = class {
19
+ constructor(t, e, s) {
20
+ if (this._$cssResult$ = !0, s !== M) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
21
+ this.cssText = t, this.t = e;
22
+ }
23
+ get styleSheet() {
24
+ let t = this.o;
25
+ const e = this.t;
26
+ if (P && t === void 0) {
27
+ const s = e !== void 0 && e.length === 1;
28
+ s && (t = A.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), s && A.set(e, t));
29
+ }
30
+ return t;
31
+ }
32
+ toString() {
33
+ return this.cssText;
34
+ }
35
+ };
36
+ const L = (i) => new T(typeof i == "string" ? i : i + "", void 0, M), R = (i, t) => {
37
+ if (P) i.adoptedStyleSheets = t.map((e) => e instanceof CSSStyleSheet ? e : e.styleSheet);
38
+ else for (const e of t) {
39
+ const s = document.createElement("style"), o = v.litNonce;
40
+ o !== void 0 && s.setAttribute("nonce", o), s.textContent = e.cssText, i.appendChild(s);
41
+ }
42
+ }, O = P ? (i) => i : (i) => i instanceof CSSStyleSheet ? ((t) => {
43
+ let e = "";
44
+ for (const s of t.cssRules) e += s.cssText;
45
+ return L(e);
46
+ })(i) : i;
47
+ /**
48
+ * @license
49
+ * Copyright 2017 Google LLC
50
+ * SPDX-License-Identifier: BSD-3-Clause
51
+ */
52
+ const { is: z, defineProperty: j, getOwnPropertyDescriptor: q, getOwnPropertyNames: F, getOwnPropertySymbols: W, getPrototypeOf: H } = Object, c = globalThis, B = c.trustedTypes, I = B ? B.emptyScript : "", $ = c.reactiveElementPolyfillSupport, _ = (i, t) => i, g = { toAttribute(i, t) {
53
+ switch (t) {
54
+ case Boolean:
55
+ i = i ? I : null;
56
+ break;
57
+ case Object:
58
+ case Array:
59
+ i = i == null ? i : JSON.stringify(i);
60
+ }
61
+ return i;
62
+ }, fromAttribute(i, t) {
63
+ let e = i;
64
+ switch (t) {
65
+ case Boolean:
66
+ e = i !== null;
67
+ break;
68
+ case Number:
69
+ e = i === null ? null : Number(i);
70
+ break;
71
+ case Object:
72
+ case Array:
73
+ try {
74
+ e = JSON.parse(i);
75
+ } catch {
76
+ e = null;
77
+ }
78
+ }
79
+ return e;
80
+ } }, C = (i, t) => !z(i, t), U = { attribute: !0, type: String, converter: g, reflect: !1, hasChanged: C };
81
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), c.litPropertyMetadata ?? (c.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
82
+ class m extends HTMLElement {
83
+ static addInitializer(t) {
84
+ this._$Ei(), (this.l ?? (this.l = [])).push(t);
85
+ }
86
+ static get observedAttributes() {
87
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
88
+ }
89
+ static createProperty(t, e = U) {
90
+ if (e.state && (e.attribute = !1), this._$Ei(), this.elementProperties.set(t, e), !e.noAccessor) {
91
+ const s = Symbol(), o = this.getPropertyDescriptor(t, s, e);
92
+ o !== void 0 && j(this.prototype, t, o);
93
+ }
94
+ }
95
+ static getPropertyDescriptor(t, e, s) {
96
+ const { get: o, set: n } = q(this.prototype, t) ?? { get() {
97
+ return this[e];
98
+ }, set(r) {
99
+ this[e] = r;
100
+ } };
101
+ return { get() {
102
+ return o == null ? void 0 : o.call(this);
103
+ }, set(r) {
104
+ const a = o == null ? void 0 : o.call(this);
105
+ n.call(this, r), this.requestUpdate(t, a, s);
106
+ }, configurable: !0, enumerable: !0 };
107
+ }
108
+ static getPropertyOptions(t) {
109
+ return this.elementProperties.get(t) ?? U;
110
+ }
111
+ static _$Ei() {
112
+ if (this.hasOwnProperty(_("elementProperties"))) return;
113
+ const t = H(this);
114
+ t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
115
+ }
116
+ static finalize() {
117
+ if (this.hasOwnProperty(_("finalized"))) return;
118
+ if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(_("properties"))) {
119
+ const e = this.properties, s = [...F(e), ...W(e)];
120
+ for (const o of s) this.createProperty(o, e[o]);
121
+ }
122
+ const t = this[Symbol.metadata];
123
+ if (t !== null) {
124
+ const e = litPropertyMetadata.get(t);
125
+ if (e !== void 0) for (const [s, o] of e) this.elementProperties.set(s, o);
126
+ }
127
+ this._$Eh = /* @__PURE__ */ new Map();
128
+ for (const [e, s] of this.elementProperties) {
129
+ const o = this._$Eu(e, s);
130
+ o !== void 0 && this._$Eh.set(o, e);
131
+ }
132
+ this.elementStyles = this.finalizeStyles(this.styles);
133
+ }
134
+ static finalizeStyles(t) {
135
+ const e = [];
136
+ if (Array.isArray(t)) {
137
+ const s = new Set(t.flat(1 / 0).reverse());
138
+ for (const o of s) e.unshift(O(o));
139
+ } else t !== void 0 && e.push(O(t));
140
+ return e;
141
+ }
142
+ static _$Eu(t, e) {
143
+ const s = e.attribute;
144
+ return s === !1 ? void 0 : typeof s == "string" ? s : typeof t == "string" ? t.toLowerCase() : void 0;
145
+ }
146
+ constructor() {
147
+ super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
148
+ }
149
+ _$Ev() {
150
+ var t;
151
+ this._$ES = new Promise((e) => this.enableUpdating = e), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (t = this.constructor.l) == null || t.forEach((e) => e(this));
152
+ }
153
+ addController(t) {
154
+ var e;
155
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t), this.renderRoot !== void 0 && this.isConnected && ((e = t.hostConnected) == null || e.call(t));
156
+ }
157
+ removeController(t) {
158
+ var e;
159
+ (e = this._$EO) == null || e.delete(t);
160
+ }
161
+ _$E_() {
162
+ const t = /* @__PURE__ */ new Map(), e = this.constructor.elementProperties;
163
+ for (const s of e.keys()) this.hasOwnProperty(s) && (t.set(s, this[s]), delete this[s]);
164
+ t.size > 0 && (this._$Ep = t);
165
+ }
166
+ createRenderRoot() {
167
+ const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
168
+ return R(t, this.constructor.elementStyles), t;
169
+ }
170
+ connectedCallback() {
171
+ var t;
172
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (t = this._$EO) == null || t.forEach((e) => {
173
+ var s;
174
+ return (s = e.hostConnected) == null ? void 0 : s.call(e);
175
+ });
176
+ }
177
+ enableUpdating(t) {
178
+ }
179
+ disconnectedCallback() {
180
+ var t;
181
+ (t = this._$EO) == null || t.forEach((e) => {
182
+ var s;
183
+ return (s = e.hostDisconnected) == null ? void 0 : s.call(e);
184
+ });
185
+ }
186
+ attributeChangedCallback(t, e, s) {
187
+ this._$AK(t, s);
188
+ }
189
+ _$EC(t, e) {
190
+ var n;
191
+ const s = this.constructor.elementProperties.get(t), o = this.constructor._$Eu(t, s);
192
+ if (o !== void 0 && s.reflect === !0) {
193
+ const r = (((n = s.converter) == null ? void 0 : n.toAttribute) !== void 0 ? s.converter : g).toAttribute(e, s.type);
194
+ this._$Em = t, r == null ? this.removeAttribute(o) : this.setAttribute(o, r), this._$Em = null;
195
+ }
196
+ }
197
+ _$AK(t, e) {
198
+ var n;
199
+ const s = this.constructor, o = s._$Eh.get(t);
200
+ if (o !== void 0 && this._$Em !== o) {
201
+ const r = s.getPropertyOptions(o), a = typeof r.converter == "function" ? { fromAttribute: r.converter } : ((n = r.converter) == null ? void 0 : n.fromAttribute) !== void 0 ? r.converter : g;
202
+ this._$Em = o, this[o] = a.fromAttribute(e, r.type), this._$Em = null;
203
+ }
204
+ }
205
+ requestUpdate(t, e, s) {
206
+ if (t !== void 0) {
207
+ if (s ?? (s = this.constructor.getPropertyOptions(t)), !(s.hasChanged ?? C)(this[t], e)) return;
208
+ this.P(t, e, s);
209
+ }
210
+ this.isUpdatePending === !1 && (this._$ES = this._$ET());
211
+ }
212
+ P(t, e, s) {
213
+ this._$AL.has(t) || this._$AL.set(t, e), s.reflect === !0 && this._$Em !== t && (this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Set())).add(t);
214
+ }
215
+ async _$ET() {
216
+ this.isUpdatePending = !0;
217
+ try {
218
+ await this._$ES;
219
+ } catch (e) {
220
+ Promise.reject(e);
221
+ }
222
+ const t = this.scheduleUpdate();
223
+ return t != null && await t, !this.isUpdatePending;
224
+ }
225
+ scheduleUpdate() {
226
+ return this.performUpdate();
227
+ }
228
+ performUpdate() {
229
+ var s;
230
+ if (!this.isUpdatePending) return;
231
+ if (!this.hasUpdated) {
232
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
233
+ for (const [n, r] of this._$Ep) this[n] = r;
234
+ this._$Ep = void 0;
235
+ }
236
+ const o = this.constructor.elementProperties;
237
+ if (o.size > 0) for (const [n, r] of o) r.wrapped !== !0 || this._$AL.has(n) || this[n] === void 0 || this.P(n, this[n], r);
238
+ }
239
+ let t = !1;
240
+ const e = this._$AL;
241
+ try {
242
+ t = this.shouldUpdate(e), t ? (this.willUpdate(e), (s = this._$EO) == null || s.forEach((o) => {
243
+ var n;
244
+ return (n = o.hostUpdate) == null ? void 0 : n.call(o);
245
+ }), this.update(e)) : this._$EU();
246
+ } catch (o) {
247
+ throw t = !1, this._$EU(), o;
248
+ }
249
+ t && this._$AE(e);
250
+ }
251
+ willUpdate(t) {
252
+ }
253
+ _$AE(t) {
254
+ var e;
255
+ (e = this._$EO) == null || e.forEach((s) => {
256
+ var o;
257
+ return (o = s.hostUpdated) == null ? void 0 : o.call(s);
258
+ }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
259
+ }
260
+ _$EU() {
261
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
262
+ }
263
+ get updateComplete() {
264
+ return this.getUpdateComplete();
265
+ }
266
+ getUpdateComplete() {
267
+ return this._$ES;
268
+ }
269
+ shouldUpdate(t) {
270
+ return !0;
271
+ }
272
+ update(t) {
273
+ this._$Ej && (this._$Ej = this._$Ej.forEach((e) => this._$EC(e, this[e]))), this._$EU();
274
+ }
275
+ updated(t) {
276
+ }
277
+ firstUpdated(t) {
278
+ }
279
+ }
280
+ m.elementStyles = [], m.shadowRootOptions = { mode: "open" }, m[_("elementProperties")] = /* @__PURE__ */ new Map(), m[_("finalized")] = /* @__PURE__ */ new Map(), $ == null || $({ ReactiveElement: m }), (c.reactiveElementVersions ?? (c.reactiveElementVersions = [])).push("2.0.4");
281
+ /**
282
+ * @license
283
+ * Copyright 2017 Google LLC
284
+ * SPDX-License-Identifier: BSD-3-Clause
285
+ */
286
+ const K = { attribute: !0, type: String, converter: g, reflect: !1, hasChanged: C }, V = (i = K, t, e) => {
287
+ const { kind: s, metadata: o } = e;
288
+ let n = globalThis.litPropertyMetadata.get(o);
289
+ if (n === void 0 && globalThis.litPropertyMetadata.set(o, n = /* @__PURE__ */ new Map()), n.set(e.name, i), s === "accessor") {
290
+ const { name: r } = e;
291
+ return { set(a) {
292
+ const l = t.get.call(this);
293
+ t.set.call(this, a), this.requestUpdate(r, l, i);
294
+ }, init(a) {
295
+ return a !== void 0 && this.P(r, void 0, i), a;
296
+ } };
297
+ }
298
+ if (s === "setter") {
299
+ const { name: r } = e;
300
+ return function(a) {
301
+ const l = this[r];
302
+ t.call(this, a), this.requestUpdate(r, l, i);
303
+ };
304
+ }
305
+ throw Error("Unsupported decorator location: " + s);
306
+ };
307
+ function f(i) {
308
+ return (t, e) => typeof e == "object" ? V(i, t, e) : ((s, o, n) => {
309
+ const r = o.hasOwnProperty(n);
310
+ return o.constructor.createProperty(n, r ? { ...s, wrapped: !0 } : s), r ? Object.getOwnPropertyDescriptor(o, n) : void 0;
311
+ })(i, t, e);
312
+ }
313
+ /**
314
+ * @license
315
+ * Copyright 2017 Google LLC
316
+ * SPDX-License-Identifier: BSD-3-Clause
317
+ */
318
+ function k(i) {
319
+ return f({ ...i, state: !0, attribute: !1 });
320
+ }
321
+ const J = D`
322
+ :host {
323
+ /* Global Modal Styles */
324
+ --_nys-modal-width: 480px;
325
+ --_nys-modal-min-width: 320px;
326
+ --_nys-modal-border-radius: var(--nys-radius-lg, 8px);
327
+ --_nys-modal-border-color: var(--nys-color-neutral-200, #bec0c1);
328
+ --_nys-modal-border-width: 1px;
329
+ --_nys-modal-background-color: var(--nys-color-surface, #fff);
330
+ --_nys-modal-margin: var(--nys-space-250, 20px);
331
+ --_nys-modal-padding: var(--nys-space-300, 24px);
332
+ --_nys-modal-gap: var(--nys-space-200, 16px);
333
+
334
+ /* Modal Overlay */
335
+ --_nys-modal-background-color--overlay: var(
336
+ --nys-color-black-transparent-700,
337
+ rgba(27, 27, 27, 0.7)
338
+ );
339
+
340
+ /* Modal Header */
341
+ --_nys-modal-gap--header: var(--nys-space-100, 8px);
342
+
343
+ /* Modal Footer */
344
+ --_nys-modal-gap--footer: var(--nys-space-250, 20px);
345
+
346
+ /* Typography */
347
+ --_nys-modal-font-size: var(--nys-font-size-ui-md, 16px);
348
+ --_nys-modal-font-weight--header: var(--nys-font-weight-bold, 700);
349
+ --_nys-modal-font-weight--subheader: var(--nys-font-weight-regular, 400);
350
+ --_nys-modal-line-height: var(--nys-font-lineheight-ui-md, 24px);
351
+ --_nys-modal-font-family: var(
352
+ --nys-font-family-ui,
353
+ var(
354
+ --nys-font-family-sans,
355
+ "Proxima Nova",
356
+ "Helvetica Neue",
357
+ "Helvetica",
358
+ "Arial",
359
+ sans-serif
360
+ )
361
+ );
362
+ }
363
+
364
+ /*** CSS & Slot resets ***/
365
+ * {
366
+ box-sizing: border-box;
367
+ }
368
+
369
+ ::slotted(p) {
370
+ margin: 0 !important;
371
+ }
372
+
373
+ h2,
374
+ p {
375
+ flex: 1;
376
+ margin: 0;
377
+ margin-bottom: 0;
378
+ }
379
+
380
+ /*** Modal Overlay (black transparent background) ***/
381
+ .nys-modal-overlay {
382
+ position: fixed;
383
+ top: 0;
384
+ left: 0;
385
+ width: 100vw;
386
+ height: 100vh;
387
+ display: flex;
388
+ align-items: center;
389
+ justify-content: center;
390
+ z-index: 1000;
391
+ background: var(--_nys-modal-background-color--overlay);
392
+ }
393
+
394
+ /*** Base ***/
395
+ .nys-modal {
396
+ display: flex;
397
+ flex-direction: column;
398
+ margin: var(--_nys-modal-margin);
399
+ padding: var(--_nys-modal-padding);
400
+ gap: var(--_nys-modal-gap);
401
+ width: var(--_nys-modal-width);
402
+ min-width: var(--_nys-modal-min-width);
403
+ border-radius: var(--_nys-modal-border-radius);
404
+ border: var(--_nys-modal-border-width) solid var(--_nys-modal-border-color);
405
+ font-family: var(--_nys-modal-font-family);
406
+ font-size: var(--_nys-modal-font-size);
407
+ line-height: var(--_nys-modal-line-height);
408
+ background: var(--_nys-modal-background-color);
409
+ position: relative;
410
+ z-index: 10000;
411
+ }
412
+
413
+ /*** Modal Header ***/
414
+ .nys-modal_header {
415
+ display: flex;
416
+ flex-direction: column;
417
+ align-items: flex-start;
418
+ gap: var(--_nys-modal-gap--header);
419
+ }
420
+
421
+ .nys-modal_header p {
422
+ font-weight: var(--_nys-modal-font-weight--subheader);
423
+ }
424
+
425
+ .nys-modal_header-inner {
426
+ display: flex;
427
+ align-items: center;
428
+ width: 100%;
429
+ font-weight: var(--_nys-modal-font-weight--header);
430
+ }
431
+
432
+ /*** Modal Body ***/
433
+ .nys-modal_body {
434
+ display: flex;
435
+ flex-direction: column;
436
+ align-items: flex-start;
437
+ }
438
+
439
+ .nys-modal_body-inner {
440
+ overflow: auto;
441
+ width: 100%;
442
+ max-height: 45vh;
443
+ }
444
+
445
+ .nys-modal_body.hidden {
446
+ display: none;
447
+ }
448
+
449
+ /*** Modal Footer (i.e. where the button slot is) ***/
450
+ .nys-modal_footer ::slotted(*) {
451
+ display: flex;
452
+ flex-direction: column-reverse;
453
+ justify-content: center;
454
+ gap: var(--_nys-modal-gap--footer);
455
+ align-self: stretch;
456
+ }
457
+
458
+ .nys-modal_footer.hidden ::slotted(*) {
459
+ display: none;
460
+ }
461
+
462
+ @media (min-width: 480px) {
463
+ .nys-modal_body-inner {
464
+ max-height: 25vh;
465
+ }
466
+ .nys-modal_footer ::slotted(*) {
467
+ flex-direction: row;
468
+ justify-content: flex-end;
469
+ align-items: center;
470
+ }
471
+ }
472
+ `;
473
+ var G = Object.defineProperty, Q = Object.getOwnPropertyDescriptor, p = (i, t, e, s) => {
474
+ for (var o = s > 1 ? void 0 : s ? Q(t, e) : t, n = i.length - 1, r; n >= 0; n--)
475
+ (r = i[n]) && (o = (s ? r(t, e, o) : r(o)) || o);
476
+ return s && o && G(t, e, o), o;
477
+ };
478
+ let X = 0;
479
+ var u;
480
+ const d = (u = class extends N {
481
+ /**************** Lifecycle Methods ****************/
482
+ constructor() {
483
+ super(), this.id = "", this.heading = "", this.subheading = "", this.open = !1, this.mandatory = !1, this._width = "md", this._actionButtonSlot = null, this._prevFocusedElement = null, this._originalBodyOverflow = null, this.hasBodySlots = !1, this.hasActionSlots = !1;
484
+ }
485
+ get width() {
486
+ return this._width;
487
+ }
488
+ set width(t) {
489
+ this._width = u.VALID_WIDTHS.includes(
490
+ t
491
+ ) ? t : "md";
492
+ }
493
+ connectedCallback() {
494
+ super.connectedCallback(), this.id || (this.id = `nys-{{componentName}}-${Date.now()}-${X++}`), window.addEventListener("resize", () => this._updateSlottedButtonWidth()), window.addEventListener("keydown", (t) => this._handleKeydown(t));
495
+ }
496
+ disconnectedCallback() {
497
+ super.disconnectedCallback(), this._restoreBodyScroll(), window.removeEventListener("keydown", (t) => this._handleKeydown(t));
498
+ }
499
+ firstUpdated() {
500
+ this._handleBodySlotChange(), this._handleActionSlotChange();
501
+ }
502
+ async updated(t) {
503
+ t.has("open") && (this.open ? (this._hideBodyScroll(), this._dispatchOpenEvent(), await this.updateComplete, this._savePrevFocused(), this._focusOnModal(), this._updateDismissAria()) : (this._restorePrevFocused(), this._restoreBodyScroll(), this._dispatchCloseEvent(), this._updateDismissAria()));
504
+ }
505
+ /******************** Functions ********************/
506
+ _hideBodyScroll() {
507
+ this._originalBodyOverflow === null && (this._originalBodyOverflow = document.body.style.overflow), document.body.style.overflow = "hidden";
508
+ }
509
+ _restoreBodyScroll() {
510
+ this._originalBodyOverflow !== null && (document.body.style.overflow = this._originalBodyOverflow, this._originalBodyOverflow = null);
511
+ }
512
+ _savePrevFocused() {
513
+ this._prevFocusedElement = document.activeElement;
514
+ }
515
+ _focusOnModal() {
516
+ var e;
517
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".nys-modal");
518
+ t == null || t.focus();
519
+ }
520
+ async _restorePrevFocused() {
521
+ var e;
522
+ const t = this._prevFocusedElement;
523
+ if (t && t.tagName.toLowerCase() === "nys-button") {
524
+ const s = await t.getButtonElement();
525
+ if (s) {
526
+ s.focus();
527
+ return;
528
+ }
529
+ } else
530
+ (e = this._prevFocusedElement) == null || e.focus();
531
+ this._prevFocusedElement = null;
532
+ }
533
+ // Check if the slot contains stuff (aka user add texts & action buttons), and render visibility accordingly
534
+ async _handleBodySlotChange() {
535
+ var e;
536
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
537
+ t && (this.hasBodySlots = t.assignedNodes({ flatten: !0 }).some(
538
+ (s) => {
539
+ var o;
540
+ return s.nodeType === Node.ELEMENT_NODE || ((o = s.textContent) == null ? void 0 : o.trim());
541
+ }
542
+ ));
543
+ }
544
+ // Determines whether we hide the action buttons slot container based on if user put in action buttons
545
+ async _handleActionSlotChange() {
546
+ var e;
547
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
548
+ 'slot[name="actions"]'
549
+ );
550
+ t && (this.hasActionSlots = t.assignedNodes({ flatten: !0 }).some(
551
+ (s) => {
552
+ var o;
553
+ return s.nodeType === Node.ELEMENT_NODE || ((o = s.textContent) == null ? void 0 : o.trim());
554
+ }
555
+ ), this._actionButtonSlot = t, this._updateSlottedButtonWidth());
556
+ }
557
+ // Design has it that the slotted action buttons should be fullWidth and display:column direction for mobile view.
558
+ // Therefore, we need to account for mobile size and screen resizes
559
+ _updateSlottedButtonWidth() {
560
+ if (!this._actionButtonSlot) return;
561
+ const t = window.innerWidth <= 480;
562
+ this._actionButtonSlot.assignedElements().forEach((e) => {
563
+ e.querySelectorAll("nys-button").forEach((s) => {
564
+ t ? s == null || s.setAttribute("fullWidth", "") : s == null || s.removeAttribute("fullWidth");
565
+ });
566
+ });
567
+ }
568
+ _dispatchOpenEvent() {
569
+ this.dispatchEvent(
570
+ new CustomEvent("nys-open", {
571
+ detail: { id: this.id },
572
+ bubbles: !0,
573
+ composed: !0
574
+ })
575
+ );
576
+ }
577
+ _dispatchCloseEvent() {
578
+ this.dispatchEvent(
579
+ new CustomEvent("nys-close", {
580
+ detail: { id: this.id },
581
+ bubbles: !0,
582
+ composed: !0
583
+ })
584
+ );
585
+ }
586
+ _getAriaDescribedBy() {
587
+ const t = [];
588
+ return this.subheading && t.push(`${this.id}-subheading`), this.hasBodySlots && t.push(`${this.id}-desc`), t.join(" ");
589
+ }
590
+ /**
591
+ * This exist to prevent the VO for dismiss button from announcing itself between the heading & subheading/slot content.
592
+ * We add the "Close this window" ariaLabel after the initial VO is done
593
+ */
594
+ _updateDismissAria() {
595
+ var e;
596
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("nys-button");
597
+ t && (t.setAttribute("ariaLabel", " "), this.open && setTimeout(() => {
598
+ t.setAttribute("ariaLabel", "Close this window");
599
+ }, 100));
600
+ }
601
+ /****************** Event Handlers ******************/
602
+ async _handleKeydown(t) {
603
+ var e;
604
+ if (this.open && (t.key === "Escape" && !this.mandatory && (t.preventDefault(), this._closeModal()), t.key === "Tab")) {
605
+ const s = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".nys-modal");
606
+ if (!s) return;
607
+ const o = 'a[href], area[href], button:not([disabled]), details, iframe, object, input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contentEditable="true"], [tabindex]:not([tabindex^="-"])', n = [], r = s.querySelector("nys-button");
608
+ r && n.push(r);
609
+ const a = Array.from(s.querySelectorAll("slot"));
610
+ for (const l of a) {
611
+ const b = l.assignedElements({ flatten: !0 });
612
+ for (const y of b)
613
+ y instanceof HTMLElement && y.matches(o) && n.push(y), y.querySelectorAll("nys-button").forEach(
614
+ (w) => {
615
+ n.push(w);
616
+ }
617
+ );
618
+ }
619
+ if (n.length > 0) {
620
+ const l = n[0], b = n[n.length - 1];
621
+ let y = document.activeElement, w = n.indexOf(y);
622
+ if (t.shiftKey) {
623
+ t.preventDefault();
624
+ let h = w - 1;
625
+ h < 0 && (h = n.length - 1);
626
+ const x = n[h];
627
+ if (n[h].tagName.toLowerCase() === "nys-button") {
628
+ const E = await x.getButtonElement();
629
+ E == null || E.focus();
630
+ } else
631
+ x.focus();
632
+ } else if (y === b)
633
+ if (t.preventDefault(), l.tagName.toLowerCase() === "nys-button") {
634
+ const h = await l.getButtonElement();
635
+ h == null || h.focus();
636
+ } else
637
+ l.focus();
638
+ }
639
+ }
640
+ }
641
+ _closeModal() {
642
+ this.open = !1, this._dispatchCloseEvent();
643
+ }
644
+ render() {
645
+ return this.open ? S`<div
646
+ id=${this.id}
647
+ class="nys-modal-overlay"
648
+ role="dialog"
649
+ aria-modal="true"
650
+ aria-labelledby="${this.id}-heading"
651
+ aria-describedby="${this._getAriaDescribedBy()}"
652
+ >
653
+ <div class="nys-modal" tabindex="-1">
654
+ <div class="nys-modal_header">
655
+ <div class="nys-modal_header-inner">
656
+ <h2 id="${this.id}-heading">${this.heading}</h2>
657
+ ${this.mandatory ? "" : S`<nys-button
658
+ circle
659
+ icon="close"
660
+ variant="ghost"
661
+ .onClick=${() => this._closeModal()}
662
+ ></nys-button>`}
663
+ </div>
664
+ ${this.subheading ? S`<p id="${this.id}-subheading">${this.subheading}</p>` : ""}
665
+ </div>
666
+
667
+ <div
668
+ id="${this.id}-desc"
669
+ class="nys-modal_body ${this.hasBodySlots ? "" : "hidden"}"
670
+ >
671
+ <div class="nys-modal_body-inner">
672
+ <slot @slotchange=${this._handleBodySlotChange}></slot>
673
+ </div>
674
+ </div>
675
+
676
+ <div
677
+ class="nys-modal_footer ${this.hasActionSlots ? "" : "hidden"}"
678
+ >
679
+ <slot
680
+ name="actions"
681
+ @slotchange=${this._handleActionSlotChange}
682
+ ></slot>
683
+ </div>
684
+ </div>
685
+ </div>` : "";
686
+ }
687
+ }, u.VALID_WIDTHS = ["sm", "md", "lg"], u.styles = J, u);
688
+ p([
689
+ f({ type: String })
690
+ ], d.prototype, "id", 2);
691
+ p([
692
+ f({ type: String })
693
+ ], d.prototype, "heading", 2);
694
+ p([
695
+ f({ type: String })
696
+ ], d.prototype, "subheading", 2);
697
+ p([
698
+ f({ type: Boolean, reflect: !0 })
699
+ ], d.prototype, "open", 2);
700
+ p([
701
+ f({ type: Boolean, reflect: !0 })
702
+ ], d.prototype, "mandatory", 2);
703
+ p([
704
+ f({ reflect: !0 })
705
+ ], d.prototype, "width", 1);
706
+ p([
707
+ k()
708
+ ], d.prototype, "hasBodySlots", 2);
709
+ p([
710
+ k()
711
+ ], d.prototype, "hasActionSlots", 2);
712
+ let Y = d;
713
+ customElements.get("nys-modal") || customElements.define("nys-modal", Y);
714
+ export {
715
+ Y as NysModal
716
+ };
717
+ //# sourceMappingURL=nys-modal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nys-modal.js","sources":["../../../node_modules/@lit/reactive-element/css-tag.js","../../../node_modules/@lit/reactive-element/reactive-element.js","../../../node_modules/@lit/reactive-element/decorators/property.js","../../../node_modules/@lit/reactive-element/decorators/state.js","../src/nys-modal.styles.ts","../src/nys-modal.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nconst t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&\"adoptedStyleSheets\"in Document.prototype&&\"replace\"in CSSStyleSheet.prototype,s=Symbol(),o=new WeakMap;class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s)throw Error(\"CSSResult is not constructable. Use `unsafeCSS` or `css` instead.\");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o.set(s,t))}return t}toString(){return this.cssText}}const r=t=>new n(\"string\"==typeof t?t:t+\"\",void 0,s),i=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if(\"number\"==typeof t)return t;throw Error(\"Value passed to 'css' function must be a 'css' function result: \"+t+\". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.\")})(s)+t[o+1]),t[0]);return new n(o,t,s)},S=(s,o)=>{if(e)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement(\"style\"),n=t.litNonce;void 0!==n&&o.setAttribute(\"nonce\",n),o.textContent=e.cssText,s.appendChild(o)}},c=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e=\"\";for(const s of t.cssRules)e+=s.cssText;return r(e)})(t):t;export{n as CSSResult,S as adoptStyles,i as css,c as getCompatibleStyle,e as supportsAdoptingStyleSheets,r as unsafeCSS};\n//# sourceMappingURL=css-tag.js.map\n","import{getCompatibleStyle as t,adoptStyles as s}from\"./css-tag.js\";export{CSSResult,adoptStyles,css,getCompatibleStyle,supportsAdoptingStyleSheets,unsafeCSS}from\"./css-tag.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{is:i,defineProperty:e,getOwnPropertyDescriptor:r,getOwnPropertyNames:h,getOwnPropertySymbols:o,getPrototypeOf:n}=Object,a=globalThis,c=a.trustedTypes,l=c?c.emptyScript:\"\",p=a.reactiveElementPolyfillSupport,d=(t,s)=>t,u={toAttribute(t,s){switch(s){case Boolean:t=t?l:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},f=(t,s)=>!i(t,s),y={attribute:!0,type:String,converter:u,reflect:!1,hasChanged:f};Symbol.metadata??=Symbol(\"metadata\"),a.litPropertyMetadata??=new WeakMap;class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e(this.prototype,t,r)}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t}};return{get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(d(\"elementProperties\")))return;const t=n(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(d(\"finalized\")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d(\"properties\"))){const t=this.properties,s=[...h(t),...o(t)];for(const i of s)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(t(s))}else void 0!==s&&i.push(t(s));return i}static _$Eu(t,s){const i=s.attribute;return!1===i?void 0:\"string\"==typeof i?i:\"string\"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,s,i){this._$AK(t,i)}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r=\"function\"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f)(this[t],s))return;this.P(t,s,i)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i)}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU()}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}b.elementStyles=[],b.shadowRootOptions={mode:\"open\"},b[d(\"elementProperties\")]=new Map,b[d(\"finalized\")]=new Map,p?.({ReactiveElement:b}),(a.reactiveElementVersions??=[]).push(\"2.0.4\");export{b as ReactiveElement,u as defaultConverter,f as notEqual};\n//# sourceMappingURL=reactive-element.js.map\n","import{defaultConverter as t,notEqual as e}from\"../reactive-element.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const o={attribute:!0,type:String,converter:t,reflect:!1,hasChanged:e},r=(t=o,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(r.name,t),\"accessor\"===n){const{name:o}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t)},init(e){return void 0!==e&&this.P(o,void 0,t),e}}}if(\"setter\"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t)}}throw Error(\"Unsupported decorator location: \"+n)};function n(t){return(e,o)=>\"object\"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,r?{...t,wrapped:!0}:t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}export{n as property,r as standardProperty};\n//# sourceMappingURL=property.js.map\n","import{property as t}from\"./property.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */function r(r){return t({...r,state:!0,attribute:!1})}export{r as state};\n//# sourceMappingURL=state.js.map\n","import { css } from \"lit\";\n\nexport default css`\n :host {\n /* Global Modal Styles */\n --_nys-modal-width: 480px;\n --_nys-modal-min-width: 320px;\n --_nys-modal-border-radius: var(--nys-radius-lg, 8px);\n --_nys-modal-border-color: var(--nys-color-neutral-200, #bec0c1);\n --_nys-modal-border-width: 1px;\n --_nys-modal-background-color: var(--nys-color-surface, #fff);\n --_nys-modal-margin: var(--nys-space-250, 20px);\n --_nys-modal-padding: var(--nys-space-300, 24px);\n --_nys-modal-gap: var(--nys-space-200, 16px);\n\n /* Modal Overlay */\n --_nys-modal-background-color--overlay: var(\n --nys-color-black-transparent-700,\n rgba(27, 27, 27, 0.7)\n );\n\n /* Modal Header */\n --_nys-modal-gap--header: var(--nys-space-100, 8px);\n\n /* Modal Footer */\n --_nys-modal-gap--footer: var(--nys-space-250, 20px);\n\n /* Typography */\n --_nys-modal-font-size: var(--nys-font-size-ui-md, 16px);\n --_nys-modal-font-weight--header: var(--nys-font-weight-bold, 700);\n --_nys-modal-font-weight--subheader: var(--nys-font-weight-regular, 400);\n --_nys-modal-line-height: var(--nys-font-lineheight-ui-md, 24px);\n --_nys-modal-font-family: var(\n --nys-font-family-ui,\n var(\n --nys-font-family-sans,\n \"Proxima Nova\",\n \"Helvetica Neue\",\n \"Helvetica\",\n \"Arial\",\n sans-serif\n )\n );\n }\n\n /*** CSS & Slot resets ***/\n * {\n box-sizing: border-box;\n }\n\n ::slotted(p) {\n margin: 0 !important;\n }\n\n h2,\n p {\n flex: 1;\n margin: 0;\n margin-bottom: 0;\n }\n\n /*** Modal Overlay (black transparent background) ***/\n .nys-modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 1000;\n background: var(--_nys-modal-background-color--overlay);\n }\n\n /*** Base ***/\n .nys-modal {\n display: flex;\n flex-direction: column;\n margin: var(--_nys-modal-margin);\n padding: var(--_nys-modal-padding);\n gap: var(--_nys-modal-gap);\n width: var(--_nys-modal-width);\n min-width: var(--_nys-modal-min-width);\n border-radius: var(--_nys-modal-border-radius);\n border: var(--_nys-modal-border-width) solid var(--_nys-modal-border-color);\n font-family: var(--_nys-modal-font-family);\n font-size: var(--_nys-modal-font-size);\n line-height: var(--_nys-modal-line-height);\n background: var(--_nys-modal-background-color);\n position: relative;\n z-index: 10000;\n }\n\n /*** Modal Header ***/\n .nys-modal_header {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: var(--_nys-modal-gap--header);\n }\n\n .nys-modal_header p {\n font-weight: var(--_nys-modal-font-weight--subheader);\n }\n\n .nys-modal_header-inner {\n display: flex;\n align-items: center;\n width: 100%;\n font-weight: var(--_nys-modal-font-weight--header);\n }\n\n /*** Modal Body ***/\n .nys-modal_body {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n }\n\n .nys-modal_body-inner {\n overflow: auto;\n width: 100%;\n max-height: 45vh;\n }\n\n .nys-modal_body.hidden {\n display: none;\n }\n\n /*** Modal Footer (i.e. where the button slot is) ***/\n .nys-modal_footer ::slotted(*) {\n display: flex;\n flex-direction: column-reverse;\n justify-content: center;\n gap: var(--_nys-modal-gap--footer);\n align-self: stretch;\n }\n\n .nys-modal_footer.hidden ::slotted(*) {\n display: none;\n }\n\n @media (min-width: 480px) {\n .nys-modal_body-inner {\n max-height: 25vh;\n }\n .nys-modal_footer ::slotted(*) {\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n }\n }\n`;\n","import { LitElement, html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\nimport styles from \"./nys-modal.styles\";\n\nlet componentIdCounter = 0; // Counter for generating unique IDs\n\nexport class NysModal extends LitElement {\n @property({ type: String }) id = \"\";\n @property({ type: String }) heading = \"\";\n @property({ type: String }) subheading = \"\";\n @property({ type: Boolean, reflect: true }) open = false;\n @property({ type: Boolean, reflect: true }) mandatory = false;\n\n private static readonly VALID_WIDTHS = [\"sm\", \"md\", \"lg\"] as const;\n private _width: (typeof NysModal.VALID_WIDTHS)[number] = \"md\";\n @property({ reflect: true })\n get width(): (typeof NysModal.VALID_WIDTHS)[number] {\n return this._width;\n }\n set width(value: string) {\n this._width = NysModal.VALID_WIDTHS.includes(\n value as (typeof NysModal.VALID_WIDTHS)[number],\n )\n ? (value as (typeof NysModal.VALID_WIDTHS)[number])\n : \"md\";\n }\n\n private _actionButtonSlot: HTMLSlotElement | null = null; // cache action button slots (if given) so we can manipulate their widths for mobile vs desktop\n private _prevFocusedElement: HTMLElement | null = null;\n private _originalBodyOverflow: string | null = null;\n\n // Track slot contents to control what HTML is rendered\n @state() private hasBodySlots = false;\n @state() private hasActionSlots = false;\n\n static styles = styles;\n\n /**************** Lifecycle Methods ****************/\n constructor() {\n super();\n }\n\n connectedCallback() {\n super.connectedCallback();\n if (!this.id) {\n this.id = `nys-{{componentName}}-${Date.now()}-${componentIdCounter++}`;\n }\n window.addEventListener(\"resize\", () => this._updateSlottedButtonWidth());\n window.addEventListener(\"keydown\", (e) => this._handleKeydown(e));\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._restoreBodyScroll(); // make sure scroll is restored when modal is removed\n window.removeEventListener(\"keydown\", (e) => this._handleKeydown(e));\n }\n\n firstUpdated() {\n this._handleBodySlotChange();\n this._handleActionSlotChange();\n }\n\n async updated(changeProps: Map<string, any>) {\n // Hide main body's scroll bar if modal is open/active\n if (changeProps.has(\"open\")) {\n if (this.open) {\n this._hideBodyScroll();\n this._dispatchOpenEvent();\n await this.updateComplete;\n this._savePrevFocused();\n this._focusOnModal();\n this._updateDismissAria();\n } else {\n this._restorePrevFocused();\n this._restoreBodyScroll();\n this._dispatchCloseEvent();\n this._updateDismissAria();\n }\n }\n }\n\n /******************** Functions ********************/\n private _hideBodyScroll() {\n if (this._originalBodyOverflow === null) {\n this._originalBodyOverflow = document.body.style.overflow;\n }\n document.body.style.overflow = \"hidden\";\n }\n\n private _restoreBodyScroll() {\n if (this._originalBodyOverflow !== null) {\n document.body.style.overflow = this._originalBodyOverflow;\n this._originalBodyOverflow = null;\n }\n }\n\n private _savePrevFocused() {\n this._prevFocusedElement = document.activeElement as HTMLElement;\n }\n\n private _focusOnModal() {\n const modal = this.shadowRoot?.querySelector<HTMLElement>(\".nys-modal\");\n modal?.focus();\n }\n\n private async _restorePrevFocused() {\n const prev = this._prevFocusedElement;\n\n if (prev && prev.tagName.toLowerCase() === \"nys-button\") {\n const innerBtn = await (prev as any).getButtonElement();\n if (innerBtn) {\n innerBtn.focus();\n return;\n }\n } else {\n this._prevFocusedElement?.focus();\n }\n this._prevFocusedElement = null;\n }\n\n // Check if the slot contains stuff (aka user add texts & action buttons), and render visibility accordingly\n private async _handleBodySlotChange() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\"slot\");\n if (!slot) return;\n this.hasBodySlots = slot\n .assignedNodes({ flatten: true })\n .some(\n (node) =>\n node.nodeType === Node.ELEMENT_NODE || node.textContent?.trim(),\n );\n }\n\n // Determines whether we hide the action buttons slot container based on if user put in action buttons\n private async _handleActionSlotChange() {\n const slot = this.shadowRoot?.querySelector<HTMLSlotElement>(\n 'slot[name=\"actions\"]',\n );\n if (!slot) return;\n this.hasActionSlots = slot\n .assignedNodes({ flatten: true })\n .some(\n (node) =>\n node.nodeType === Node.ELEMENT_NODE || node.textContent?.trim(),\n );\n\n // Cached the action button slot container so we can use it continuously for _updateSlottedButtonWidth() during screen resize\n this._actionButtonSlot = slot;\n // Update button widths immediately\n this._updateSlottedButtonWidth();\n }\n\n // Design has it that the slotted action buttons should be fullWidth and display:column direction for mobile view.\n // Therefore, we need to account for mobile size and screen resizes\n private _updateSlottedButtonWidth() {\n if (!this._actionButtonSlot) return; // use the cached variable\n const isMobile = window.innerWidth <= 480;\n\n this._actionButtonSlot.assignedElements().forEach((el) => {\n el.querySelectorAll(\"nys-button\").forEach((btn) => {\n if (isMobile) {\n btn?.setAttribute(\"fullWidth\", \"\");\n } else {\n btn?.removeAttribute(\"fullWidth\");\n }\n });\n });\n }\n\n private _dispatchOpenEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-open\", {\n detail: { id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _dispatchCloseEvent() {\n this.dispatchEvent(\n new CustomEvent(\"nys-close\", {\n detail: { id: this.id },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private _getAriaDescribedBy() {\n // Handling what aria-describedby needs to announce in VO based on if the subheading or slot contents exists\n const ariaDescriptions: string[] = [];\n if (this.subheading) {\n ariaDescriptions.push(`${this.id}-subheading`);\n }\n if (this.hasBodySlots) {\n ariaDescriptions.push(`${this.id}-desc`);\n }\n return ariaDescriptions.join(\" \");\n }\n\n /**\n * This exist to prevent the VO for dismiss button from announcing itself between the heading & subheading/slot content.\n * We add the \"Close this window\" ariaLabel after the initial VO is done\n */\n private _updateDismissAria() {\n const dismissBtn = this.shadowRoot?.querySelector(\"nys-button\");\n if (!dismissBtn) return;\n\n // Hide from VO initially\n dismissBtn.setAttribute(\"ariaLabel\", \" \");\n\n if (this.open) {\n // After focus is moved into modal, update label\n setTimeout(() => {\n dismissBtn.setAttribute(\"ariaLabel\", \"Close this window\");\n }, 100);\n }\n }\n\n /****************** Event Handlers ******************/\n private async _handleKeydown(e: KeyboardEvent) {\n if (!this.open) return;\n\n /** Exit the modal for \"escape\" key **/\n if (e.key === \"Escape\" && !this.mandatory) {\n e.preventDefault();\n this._closeModal();\n }\n\n /** Trap focus to be within the modal only **/\n if (e.key === \"Tab\") {\n const modal = this.shadowRoot?.querySelector(\".nys-modal\");\n if (!modal) return;\n\n // Gather all elements from slots + dismissible btn\n const knownFocusableElements =\n 'a[href], area[href], button:not([disabled]), details, iframe, object, input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [contentEditable=\"true\"], [tabindex]:not([tabindex^=\"-\"])';\n const focusableElements: HTMLElement[] = [];\n const dismissBtn = modal.querySelector(\"nys-button\") as HTMLElement;\n\n if (dismissBtn) {\n focusableElements.push(dismissBtn);\n }\n\n // Gather from slot elements to store the focusable elements for trapping\n const slotElements = Array.from(modal.querySelectorAll(\"slot\"));\n for (const slot of slotElements) {\n const assigned = slot.assignedElements({ flatten: true });\n for (const el of assigned) {\n if (el instanceof HTMLElement && el.matches(knownFocusableElements)) {\n focusableElements.push(el);\n }\n // also account for the action slot container that has nys-buttons\n el.querySelectorAll<HTMLElement>(\"nys-button\").forEach(\n (actionBtn) => {\n focusableElements.push(actionBtn);\n },\n );\n }\n }\n\n if (focusableElements.length > 0) {\n // Laying out the starting (i.e. dismiss btn) and ending elements for looping focus elements\n const firstFocusableEl = focusableElements[0];\n const lastFocusableEl = focusableElements[focusableElements.length - 1];\n let active = document.activeElement as HTMLElement | null;\n let activeIndex = focusableElements.indexOf(active as HTMLElement);\n\n /**\n * Move focus backward when Shift+Tab is pressed.\n * Focus goes to the previous element in focusableElements.\n * If currently at the first element, wrap around to the last element.\n * For <nys-button>, focus the internal button. For other elements, focus directly.\n */\n if (e.shiftKey) {\n e.preventDefault();\n\n let prevIndex = activeIndex - 1;\n if (prevIndex < 0) {\n prevIndex = focusableElements.length - 1; // wrap back to lastFocusableEl\n }\n\n const prevElement = focusableElements[prevIndex];\n const isNysButton =\n focusableElements[prevIndex].tagName.toLowerCase() === \"nys-button\";\n\n if (isNysButton) {\n const innerBtn = await (prevElement as any).getButtonElement();\n innerBtn?.focus();\n } else {\n prevElement.focus();\n }\n } else {\n // Tab (go back to first focusable element if we're at last)\n if (active === lastFocusableEl) {\n e.preventDefault();\n if (firstFocusableEl.tagName.toLowerCase() === \"nys-button\") {\n const innerBtn = await (\n firstFocusableEl as any\n ).getButtonElement();\n innerBtn?.focus();\n } else {\n firstFocusableEl.focus();\n }\n }\n }\n }\n }\n }\n\n private _closeModal() {\n this.open = false;\n this._dispatchCloseEvent();\n }\n\n render() {\n return this.open\n ? html`<div\n id=${this.id}\n class=\"nys-modal-overlay\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"${this.id}-heading\"\n aria-describedby=\"${this._getAriaDescribedBy()}\"\n >\n <div class=\"nys-modal\" tabindex=\"-1\">\n <div class=\"nys-modal_header\">\n <div class=\"nys-modal_header-inner\">\n <h2 id=\"${this.id}-heading\">${this.heading}</h2>\n ${!this.mandatory\n ? html`<nys-button\n circle\n icon=\"close\"\n variant=\"ghost\"\n .onClick=${() => this._closeModal()}\n ></nys-button>`\n : \"\"}\n </div>\n ${this.subheading\n ? html`<p id=\"${this.id}-subheading\">${this.subheading}</p>`\n : \"\"}\n </div>\n\n <div\n id=\"${this.id}-desc\"\n class=\"nys-modal_body ${!this.hasBodySlots ? \"hidden\" : \"\"}\"\n >\n <div class=\"nys-modal_body-inner\">\n <slot @slotchange=${this._handleBodySlotChange}></slot>\n </div>\n </div>\n\n <div\n class=\"nys-modal_footer ${!this.hasActionSlots ? \"hidden\" : \"\"}\"\n >\n <slot\n name=\"actions\"\n @slotchange=${this._handleActionSlotChange}\n ></slot>\n </div>\n </div>\n </div>`\n : \"\";\n }\n}\n\nif (!customElements.get(\"nys-modal\")) {\n customElements.define(\"nys-modal\", NysModal);\n}\n"],"names":["t","e","s","o","n$2","r","n","S","c","i","h","a","l","p","d","u","f","y","b","_a","styles","css","componentIdCounter","_NysModal","LitElement","value","changeProps","modal","prev","innerBtn","slot","node","isMobile","el","btn","ariaDescriptions","dismissBtn","knownFocusableElements","focusableElements","slotElements","assigned","actionBtn","firstFocusableEl","lastFocusableEl","active","activeIndex","prevIndex","prevElement","html","__decorateClass","property","state","NysModal"],"mappings":";;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,MAAMA,IAAE,YAAWC,IAAED,EAAE,eAAsBA,EAAE,aAAX,UAAqBA,EAAE,SAAS,iBAAe,wBAAuB,SAAS,aAAW,aAAY,cAAc,WAAUE,IAAE,OAAM,GAAGC,IAAE,oBAAI;AAAO,IAAAC,IAAC,MAAO;AAAA,EAAC,YAAY,GAAE,GAAED,GAAE;AAAC,QAAG,KAAK,eAAa,IAAGA,MAAID,EAAE,OAAM,MAAM,mEAAmE;AAAE,SAAK,UAAQ,GAAE,KAAK,IAAE;AAAA,EAAC;AAAA,EAAC,IAAI,aAAY;AAAC,QAAI,IAAE,KAAK;AAAE,UAAMA,IAAE,KAAK;AAAE,QAAGD,KAAY,MAAT,QAAW;AAAC,YAAMA,IAAWC,MAAT,UAAgBA,EAAE,WAAN;AAAa,MAAAD,MAAI,IAAEE,EAAE,IAAID,CAAC,IAAY,MAAT,YAAc,KAAK,IAAE,IAAE,IAAI,iBAAe,YAAY,KAAK,OAAO,GAAED,KAAGE,EAAE,IAAID,GAAE,CAAC;AAAA,IAAE;AAAC,WAAO;AAAA,EAAC;AAAA,EAAC,WAAU;AAAC,WAAO,KAAK;AAA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AA,CAAA;AACA0B,EAAA;AAAA,EAA3CC,EAAS,EAAE,MAAM,SAAS,SAAS,IAAM;AAAA,GAL/B3B,EAKiC,WAAA,aAAA,CAAA;AAKxC0B,EAAA;AAAA,EADHC,EAAS,EAAE,SAAS,GAAA,CAAM;AAAA,GAThB3B,EAUP,WAAA,SAAA,CAAA;AAgBa0B,EAAA;AAAA,EAAhBE,EAAA;AAAM,GA1BI5B,EA0BM,WAAA,gBAAA,CAAA;AACA0B,EAAA;AAAA,EAAhBE,EAAA;AAAM,GA3BI5B,EA2BM,WAAA,kBAAA,CAAA;AA3BZ,IAAM6B,IAAN7B;AAwWF,eAAe,IAAI,WAAW,KACjC,eAAe,OAAO,aAAa6B,CAAQ;","x_google_ignoreList":[0,1,2,3]}
@@ -0,0 +1,2 @@
1
+ declare const _default: import("lit").CSSResult;
2
+ export default _default;
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@nysds/nys-modal",
3
+ "version": "1.10.0",
4
+ "description": "The Modal component from the NYS Design System.",
5
+ "module": "dist/nys-modal.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/nys-modal.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "type": "module",
14
+ "files": [
15
+ "dist/"
16
+ ],
17
+ "scripts": {
18
+ "dev": "tsc --emitDeclarationOnly && vite",
19
+ "build": "tsc --emitDeclarationOnly && vite build",
20
+ "test": "vite build && wtr",
21
+ "build:watch": "tsc --emitDeclarationOnly && vite build --watch",
22
+ "test:watch": "vite build && wtr --watch"
23
+ },
24
+ "peerDependencies": {
25
+ "lit": "^3.2.1"
26
+ },
27
+ "dependencies": {
28
+ "@nysds/nys-button": "^1.10.0"
29
+ },
30
+ "devDependencies": {
31
+ "lit": "^3.2.1",
32
+ "typescript": "^5.7.2",
33
+ "vite": "^6.3.6"
34
+ },
35
+ "keywords": [
36
+ "new-york-state",
37
+ "design-system",
38
+ "web-components",
39
+ "lit",
40
+ "nys",
41
+ "modal",
42
+ "forms"
43
+ ],
44
+ "author": "New York State Design System Team",
45
+ "license": "MIT"
46
+ }
47
+