@sps-woodland/modal 8.0.0-rc1

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,2110 @@
1
+ import { Metadata as Be, cl as re, combineEventHandlers as ve, I18nContext as Qe, useChildTestIdAttrBuilder as Ze, selectChildren as et, modChildren as tt, Icon as ot, contentOf as Z } from "@sps-woodland/core";
2
+ import { Button as he } from "@sps-woodland/buttons";
3
+ import * as d from "react";
4
+ import y, { useState as X, useRef as $, useCallback as S, useContext as A, useEffect as T, useMemo as K } from "react";
5
+ import rt from "react-dom";
6
+ import { code as g } from "@spscommerce/utils";
7
+ function nt(e, t, o) {
8
+ let [r, n] = X(e || t), a = $(e !== void 0), l = a.current, i = e !== void 0, s = $(r);
9
+ l !== i && console.warn(`WARN: A component changed from ${l ? "controlled" : "uncontrolled"} to ${i ? "controlled" : "uncontrolled"}.`), a.current = i;
10
+ let u = S((c, ...f) => {
11
+ let m = (b, ...p) => {
12
+ o && (Object.is(s.current, b) || o(b, ...p)), i || (s.current = b);
13
+ };
14
+ typeof c == "function" ? (console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"), n((p, ...N) => {
15
+ let z = c(i ? s.current : p, ...N);
16
+ return m(z, ...f), i ? p : z;
17
+ })) : (i || n(c), m(c, ...f));
18
+ }, [
19
+ i,
20
+ o
21
+ ]);
22
+ return i ? s.current = e : e = r, [
23
+ e,
24
+ u
25
+ ];
26
+ }
27
+ const Ce = {
28
+ prefix: String(Math.round(Math.random() * 1e10)),
29
+ current: 0,
30
+ isSSR: !1
31
+ }, de = /* @__PURE__ */ y.createContext(Ce);
32
+ let at = Boolean(typeof window < "u" && window.document && window.document.createElement), ee = /* @__PURE__ */ new WeakMap();
33
+ function lt(e = !1) {
34
+ let t = A(de), o = $(null);
35
+ if (o.current === null && !e) {
36
+ var r, n;
37
+ let a = (r = y.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || r === void 0 || (n = r.ReactCurrentOwner) === null || n === void 0 ? void 0 : n.current;
38
+ if (a) {
39
+ let l = ee.get(a);
40
+ l == null ? ee.set(a, {
41
+ id: t.current,
42
+ state: a.memoizedState
43
+ }) : a.memoizedState !== l.state && (t.current = l.id, ee.delete(a));
44
+ }
45
+ o.current = ++t.current;
46
+ }
47
+ return o.current;
48
+ }
49
+ function it(e) {
50
+ let t = A(de);
51
+ t === Ce && !at && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
52
+ let o = lt(!!e);
53
+ return e || `react-aria${t.prefix}-${o}`;
54
+ }
55
+ function st() {
56
+ return A(de).isSSR;
57
+ }
58
+ function Ne(e) {
59
+ var t, o, r = "";
60
+ if (typeof e == "string" || typeof e == "number")
61
+ r += e;
62
+ else if (typeof e == "object")
63
+ if (Array.isArray(e))
64
+ for (t = 0; t < e.length; t++)
65
+ e[t] && (o = Ne(e[t])) && (r && (r += " "), r += o);
66
+ else
67
+ for (t in e)
68
+ e[t] && (r && (r += " "), r += t);
69
+ return r;
70
+ }
71
+ function dt() {
72
+ for (var e, t, o = 0, r = ""; o < arguments.length; )
73
+ (e = arguments[o++]) && (t = Ne(e)) && (r && (r += " "), r += t);
74
+ return r;
75
+ }
76
+ const E = typeof window < "u" ? y.useLayoutEffect : () => {
77
+ };
78
+ function ut(e) {
79
+ let [t, o] = X(e), r = $(t), n = $(null);
80
+ r.current = t;
81
+ let a = $(null);
82
+ a.current = () => {
83
+ let i = n.current.next();
84
+ if (i.done) {
85
+ n.current = null;
86
+ return;
87
+ }
88
+ t === i.value ? a.current() : o(i.value);
89
+ }, E(() => {
90
+ n.current && a.current();
91
+ });
92
+ let l = S((i) => {
93
+ n.current = i(r.current), a.current();
94
+ }, [
95
+ n,
96
+ a
97
+ ]);
98
+ return [
99
+ t,
100
+ l
101
+ ];
102
+ }
103
+ let _ = /* @__PURE__ */ new Map();
104
+ function Oe(e) {
105
+ let [t, o] = X(e), r = $(null), n = it(t), a = S((l) => {
106
+ r.current = l;
107
+ }, []);
108
+ return _.set(n, a), E(() => {
109
+ let l = n;
110
+ return () => {
111
+ _.delete(l);
112
+ };
113
+ }, [
114
+ n
115
+ ]), T(() => {
116
+ let l = r.current;
117
+ l && (r.current = null, o(l));
118
+ }), n;
119
+ }
120
+ function ct(e, t) {
121
+ if (e === t)
122
+ return e;
123
+ let o = _.get(e);
124
+ if (o)
125
+ return o(t), t;
126
+ let r = _.get(t);
127
+ return r ? (r(e), e) : t;
128
+ }
129
+ function mt(e = []) {
130
+ let t = Oe(), [o, r] = ut(t), n = S(() => {
131
+ r(function* () {
132
+ yield t, yield document.getElementById(t) ? t : void 0;
133
+ });
134
+ }, [
135
+ t,
136
+ r
137
+ ]);
138
+ return E(n, [
139
+ t,
140
+ n,
141
+ ...e
142
+ ]), o;
143
+ }
144
+ function j(...e) {
145
+ return (...t) => {
146
+ for (let o of e)
147
+ typeof o == "function" && o(...t);
148
+ };
149
+ }
150
+ function pt(...e) {
151
+ let t = {
152
+ ...e[0]
153
+ };
154
+ for (let o = 1; o < e.length; o++) {
155
+ let r = e[o];
156
+ for (let n in r) {
157
+ let a = t[n], l = r[n];
158
+ typeof a == "function" && typeof l == "function" && n[0] === "o" && n[1] === "n" && n.charCodeAt(2) >= 65 && n.charCodeAt(2) <= 90 ? t[n] = j(a, l) : (n === "className" || n === "UNSAFE_className") && typeof a == "string" && typeof l == "string" ? t[n] = dt(a, l) : n === "id" && a && l ? t.id = ct(a, l) : t[n] = l !== void 0 ? l : a;
159
+ }
160
+ }
161
+ return t;
162
+ }
163
+ const ft = /* @__PURE__ */ new Set([
164
+ "id"
165
+ ]), gt = /* @__PURE__ */ new Set([
166
+ "aria-label",
167
+ "aria-labelledby",
168
+ "aria-describedby",
169
+ "aria-details"
170
+ ]), bt = /^(data-.*)$/;
171
+ function vt(e, t = {}) {
172
+ let { labelable: o, propNames: r } = t, n = {};
173
+ for (const a in e)
174
+ Object.prototype.hasOwnProperty.call(e, a) && (ft.has(a) || o && gt.has(a) || (r == null ? void 0 : r.has(a)) || bt.test(a)) && (n[a] = e[a]);
175
+ return n;
176
+ }
177
+ function $e(e) {
178
+ if (ht())
179
+ e.focus({
180
+ preventScroll: !0
181
+ });
182
+ else {
183
+ let t = $t(e);
184
+ e.focus(), wt(t);
185
+ }
186
+ }
187
+ let q = null;
188
+ function ht() {
189
+ if (q == null) {
190
+ q = !1;
191
+ try {
192
+ var e = document.createElement("div");
193
+ e.focus({
194
+ get preventScroll() {
195
+ return q = !0, !0;
196
+ }
197
+ });
198
+ } catch {
199
+ }
200
+ }
201
+ return q;
202
+ }
203
+ function $t(e) {
204
+ for (var t = e.parentNode, o = [], r = document.scrollingElement || document.documentElement; t instanceof HTMLElement && t !== r; )
205
+ (t.offsetHeight < t.scrollHeight || t.offsetWidth < t.scrollWidth) && o.push({
206
+ element: t,
207
+ scrollTop: t.scrollTop,
208
+ scrollLeft: t.scrollLeft
209
+ }), t = t.parentNode;
210
+ return r instanceof HTMLElement && o.push({
211
+ element: r,
212
+ scrollTop: r.scrollTop,
213
+ scrollLeft: r.scrollLeft
214
+ }), o;
215
+ }
216
+ function wt(e) {
217
+ for (let { element: t, scrollTop: o, scrollLeft: r } of e)
218
+ t.scrollTop = o, t.scrollLeft = r;
219
+ }
220
+ let C = /* @__PURE__ */ new Map(), ne = /* @__PURE__ */ new Set();
221
+ function we() {
222
+ if (typeof window > "u")
223
+ return;
224
+ let e = (o) => {
225
+ let r = C.get(o.target);
226
+ r || (r = /* @__PURE__ */ new Set(), C.set(o.target, r), o.target.addEventListener("transitioncancel", t)), r.add(o.propertyName);
227
+ }, t = (o) => {
228
+ let r = C.get(o.target);
229
+ if (!!r && (r.delete(o.propertyName), r.size === 0 && (o.target.removeEventListener("transitioncancel", t), C.delete(o.target)), C.size === 0)) {
230
+ for (let n of ne)
231
+ n();
232
+ ne.clear();
233
+ }
234
+ };
235
+ document.body.addEventListener("transitionrun", e), document.body.addEventListener("transitionend", t);
236
+ }
237
+ typeof document < "u" && (document.readyState !== "loading" ? we() : document.addEventListener("DOMContentLoaded", we));
238
+ function Et(e) {
239
+ requestAnimationFrame(() => {
240
+ C.size === 0 ? e() : ne.add(e);
241
+ });
242
+ }
243
+ function De(e) {
244
+ for (Ee(e) && (e = e.parentElement); e && !Ee(e); )
245
+ e = e.parentElement;
246
+ return e || document.scrollingElement || document.documentElement;
247
+ }
248
+ function Ee(e) {
249
+ let t = window.getComputedStyle(e);
250
+ return /(auto|scroll)/.test(t.overflow + t.overflowX + t.overflowY);
251
+ }
252
+ function Mt(e) {
253
+ var t;
254
+ return typeof window > "u" || window.navigator == null ? !1 : ((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.brands.some((o) => e.test(o.brand))) || e.test(window.navigator.userAgent);
255
+ }
256
+ function ue(e) {
257
+ var t;
258
+ return typeof window < "u" && window.navigator != null ? e.test(((t = window.navigator.userAgentData) === null || t === void 0 ? void 0 : t.platform) || window.navigator.platform) : !1;
259
+ }
260
+ function Ie() {
261
+ return ue(/^Mac/i);
262
+ }
263
+ function yt() {
264
+ return ue(/^iPhone/i);
265
+ }
266
+ function Pt() {
267
+ return ue(/^iPad/i) || Ie() && navigator.maxTouchPoints > 1;
268
+ }
269
+ function kt() {
270
+ return yt() || Pt();
271
+ }
272
+ function Tt() {
273
+ return Mt(/Android/i);
274
+ }
275
+ function xt(e) {
276
+ return e.mozInputSource === 0 && e.isTrusted ? !0 : Tt() && e.pointerType ? e.type === "click" && e.buttons === 1 : e.detail === 0 && !e.pointerType;
277
+ }
278
+ function ae(e, t, o) {
279
+ return t in e ? Object.defineProperty(e, t, {
280
+ value: o,
281
+ enumerable: !0,
282
+ configurable: !0,
283
+ writable: !0
284
+ }) : e[t] = o, e;
285
+ }
286
+ const Ft = y.createContext(null);
287
+ Ft.displayName = "PressResponderContext";
288
+ class St {
289
+ isDefaultPrevented() {
290
+ return this.nativeEvent.defaultPrevented;
291
+ }
292
+ preventDefault() {
293
+ this.defaultPrevented = !0, this.nativeEvent.preventDefault();
294
+ }
295
+ stopPropagation() {
296
+ this.nativeEvent.stopPropagation(), this.isPropagationStopped = () => !0;
297
+ }
298
+ isPropagationStopped() {
299
+ return !1;
300
+ }
301
+ persist() {
302
+ }
303
+ constructor(t, o) {
304
+ this.nativeEvent = o, this.target = o.target, this.currentTarget = o.currentTarget, this.relatedTarget = o.relatedTarget, this.bubbles = o.bubbles, this.cancelable = o.cancelable, this.defaultPrevented = o.defaultPrevented, this.eventPhase = o.eventPhase, this.isTrusted = o.isTrusted, this.timeStamp = o.timeStamp, this.type = t;
305
+ }
306
+ }
307
+ function Lt(e) {
308
+ let t = $({
309
+ isFocused: !1,
310
+ onBlur: e,
311
+ observer: null
312
+ });
313
+ return t.current.onBlur = e, E(() => {
314
+ const o = t.current;
315
+ return () => {
316
+ o.observer && (o.observer.disconnect(), o.observer = null);
317
+ };
318
+ }, []), S((o) => {
319
+ if (o.target instanceof HTMLButtonElement || o.target instanceof HTMLInputElement || o.target instanceof HTMLTextAreaElement || o.target instanceof HTMLSelectElement) {
320
+ t.current.isFocused = !0;
321
+ let r = o.target, n = (a) => {
322
+ var l, i;
323
+ t.current.isFocused = !1, r.disabled && ((i = (l = t.current).onBlur) === null || i === void 0 || i.call(l, new St("blur", a))), t.current.observer && (t.current.observer.disconnect(), t.current.observer = null);
324
+ };
325
+ r.addEventListener("focusout", n, {
326
+ once: !0
327
+ }), t.current.observer = new MutationObserver(() => {
328
+ t.current.isFocused && r.disabled && (t.current.observer.disconnect(), r.dispatchEvent(new FocusEvent("blur")), r.dispatchEvent(new FocusEvent("focusout", {
329
+ bubbles: !0
330
+ })));
331
+ }), t.current.observer.observe(r, {
332
+ attributes: !0,
333
+ attributeFilter: [
334
+ "disabled"
335
+ ]
336
+ });
337
+ }
338
+ }, []);
339
+ }
340
+ let W = null, Bt = /* @__PURE__ */ new Set(), Me = !1, L = !1, le = !1;
341
+ function ce(e, t) {
342
+ for (let o of Bt)
343
+ o(e, t);
344
+ }
345
+ function Ct(e) {
346
+ return !(e.metaKey || !Ie() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
347
+ }
348
+ function ye(e) {
349
+ L = !0, Ct(e) && (W = "keyboard", ce("keyboard", e));
350
+ }
351
+ function B(e) {
352
+ W = "pointer", (e.type === "mousedown" || e.type === "pointerdown") && (L = !0, ce("pointer", e));
353
+ }
354
+ function Nt(e) {
355
+ xt(e) && (L = !0, W = "virtual");
356
+ }
357
+ function Ot(e) {
358
+ e.target === window || e.target === document || (!L && !le && (W = "virtual", ce("virtual", e)), L = !1, le = !1);
359
+ }
360
+ function Dt() {
361
+ L = !1, le = !0;
362
+ }
363
+ function Pe() {
364
+ if (typeof window > "u" || Me)
365
+ return;
366
+ let e = HTMLElement.prototype.focus;
367
+ HTMLElement.prototype.focus = function() {
368
+ L = !0, e.apply(this, arguments);
369
+ }, document.addEventListener("keydown", ye, !0), document.addEventListener("keyup", ye, !0), document.addEventListener("click", Nt, !0), window.addEventListener("focus", Ot, !0), window.addEventListener("blur", Dt, !1), typeof PointerEvent < "u" ? (document.addEventListener("pointerdown", B, !0), document.addEventListener("pointermove", B, !0), document.addEventListener("pointerup", B, !0)) : (document.addEventListener("mousedown", B, !0), document.addEventListener("mousemove", B, !0), document.addEventListener("mouseup", B, !0)), Me = !0;
370
+ }
371
+ typeof document < "u" && (document.readyState !== "loading" ? Pe() : document.addEventListener("DOMContentLoaded", Pe));
372
+ function It() {
373
+ return W;
374
+ }
375
+ function At(e) {
376
+ let { isDisabled: t, onBlurWithin: o, onFocusWithin: r, onFocusWithinChange: n } = e, a = $({
377
+ isFocusWithin: !1
378
+ }), l = S((u) => {
379
+ a.current.isFocusWithin && !u.currentTarget.contains(u.relatedTarget) && (a.current.isFocusWithin = !1, o && o(u), n && n(!1));
380
+ }, [
381
+ o,
382
+ n,
383
+ a
384
+ ]), i = Lt(l), s = S((u) => {
385
+ !a.current.isFocusWithin && document.activeElement === u.target && (r && r(u), n && n(!0), a.current.isFocusWithin = !0, i(u));
386
+ }, [
387
+ r,
388
+ n,
389
+ i
390
+ ]);
391
+ return t ? {
392
+ focusWithinProps: {
393
+ onFocus: null,
394
+ onBlur: null
395
+ }
396
+ } : {
397
+ focusWithinProps: {
398
+ onFocus: s,
399
+ onBlur: l
400
+ }
401
+ };
402
+ }
403
+ function Wt(e) {
404
+ let { ref: t, onInteractOutside: o, isDisabled: r, onInteractOutsideStart: n } = e, l = $({
405
+ isPointerDown: !1,
406
+ ignoreEmulatedMouseEvents: !1,
407
+ onInteractOutside: o,
408
+ onInteractOutsideStart: n
409
+ }).current;
410
+ l.onInteractOutside = o, l.onInteractOutsideStart = n, T(() => {
411
+ if (r)
412
+ return;
413
+ let i = (s) => {
414
+ R(s, t) && l.onInteractOutside && (l.onInteractOutsideStart && l.onInteractOutsideStart(s), l.isPointerDown = !0);
415
+ };
416
+ if (typeof PointerEvent < "u") {
417
+ let s = (u) => {
418
+ l.isPointerDown && l.onInteractOutside && R(u, t) && l.onInteractOutside(u), l.isPointerDown = !1;
419
+ };
420
+ return document.addEventListener("pointerdown", i, !0), document.addEventListener("pointerup", s, !0), () => {
421
+ document.removeEventListener("pointerdown", i, !0), document.removeEventListener("pointerup", s, !0);
422
+ };
423
+ } else {
424
+ let s = (c) => {
425
+ l.ignoreEmulatedMouseEvents ? l.ignoreEmulatedMouseEvents = !1 : l.isPointerDown && l.onInteractOutside && R(c, t) && l.onInteractOutside(c), l.isPointerDown = !1;
426
+ }, u = (c) => {
427
+ l.ignoreEmulatedMouseEvents = !0, l.onInteractOutside && l.isPointerDown && R(c, t) && l.onInteractOutside(c), l.isPointerDown = !1;
428
+ };
429
+ return document.addEventListener("mousedown", i, !0), document.addEventListener("mouseup", s, !0), document.addEventListener("touchstart", i, !0), document.addEventListener("touchend", u, !0), () => {
430
+ document.removeEventListener("mousedown", i, !0), document.removeEventListener("mouseup", s, !0), document.removeEventListener("touchstart", i, !0), document.removeEventListener("touchend", u, !0);
431
+ };
432
+ }
433
+ }, [
434
+ t,
435
+ l,
436
+ r
437
+ ]);
438
+ }
439
+ function R(e, t) {
440
+ if (e.button > 0)
441
+ return !1;
442
+ if (e.target) {
443
+ const o = e.target.ownerDocument;
444
+ if (!o || !o.documentElement.contains(e.target) || e.target.closest("[data-react-aria-top-layer]"))
445
+ return !1;
446
+ }
447
+ return t.current && !t.current.contains(e.target);
448
+ }
449
+ function ie(e) {
450
+ if (It() === "virtual") {
451
+ let t = document.activeElement;
452
+ Et(() => {
453
+ document.activeElement === t && document.contains(e) && $e(e);
454
+ });
455
+ } else
456
+ $e(e);
457
+ }
458
+ function zt(e) {
459
+ if (!(e instanceof HTMLElement) && !(e instanceof SVGElement))
460
+ return !1;
461
+ let { display: t, visibility: o } = e.style, r = t !== "none" && o !== "hidden" && o !== "collapse";
462
+ if (r) {
463
+ const { getComputedStyle: n } = e.ownerDocument.defaultView;
464
+ let { display: a, visibility: l } = n(e);
465
+ r = a !== "none" && l !== "hidden" && l !== "collapse";
466
+ }
467
+ return r;
468
+ }
469
+ function qt(e, t) {
470
+ return !e.hasAttribute("hidden") && (e.nodeName === "DETAILS" && t && t.nodeName !== "SUMMARY" ? e.hasAttribute("open") : !0);
471
+ }
472
+ function Ae(e, t) {
473
+ return e.nodeName !== "#comment" && zt(e) && qt(e, t) && (!e.parentElement || Ae(e.parentElement, e));
474
+ }
475
+ const ke = /* @__PURE__ */ y.createContext(null);
476
+ let v = null;
477
+ function Rt(e) {
478
+ let { children: t, contain: o, restoreFocus: r, autoFocus: n } = e, a = $(), l = $(), i = $([]), { parentNode: s } = A(ke) || {}, u = K(() => new se({
479
+ scopeRef: i
480
+ }), [
481
+ i
482
+ ]);
483
+ E(() => {
484
+ let m = s || h.root;
485
+ if (h.getTreeNode(m.scopeRef) && v && !G(v, m.scopeRef)) {
486
+ let b = h.getTreeNode(v);
487
+ b && (m = b);
488
+ }
489
+ m.addChild(u), h.addNode(u);
490
+ }, [
491
+ u,
492
+ s
493
+ ]), E(() => {
494
+ let m = h.getTreeNode(i);
495
+ m.contain = o;
496
+ }, [
497
+ o
498
+ ]), E(() => {
499
+ let m = a.current.nextSibling, b = [];
500
+ for (; m && m !== l.current; )
501
+ b.push(m), m = m.nextSibling;
502
+ i.current = b;
503
+ }, [
504
+ t
505
+ ]), Gt(i, r, o), _t(i, o), Xt(i, r, o), Ut(i, n), T(() => {
506
+ if (i) {
507
+ let m = document.activeElement, b = null;
508
+ if (w(m, i.current)) {
509
+ for (let p of h.traverse())
510
+ w(m, p.scopeRef.current) && (b = p);
511
+ b === h.getTreeNode(i) && (v = b.scopeRef);
512
+ }
513
+ return () => {
514
+ let p = h.getTreeNode(i).parent.scopeRef;
515
+ (i === v || G(i, v)) && (!p || h.getTreeNode(p)) && (v = p), h.removeTreeNode(i);
516
+ };
517
+ }
518
+ }, [
519
+ i
520
+ ]);
521
+ let c = K(() => Ht(i), []), f = K(() => ({
522
+ focusManager: c,
523
+ parentNode: u
524
+ }), [
525
+ u,
526
+ c
527
+ ]);
528
+ return /* @__PURE__ */ y.createElement(ke.Provider, {
529
+ value: f
530
+ }, /* @__PURE__ */ y.createElement("span", {
531
+ "data-focus-scope-start": !0,
532
+ hidden: !0,
533
+ ref: a
534
+ }), t, /* @__PURE__ */ y.createElement("span", {
535
+ "data-focus-scope-end": !0,
536
+ hidden: !0,
537
+ ref: l
538
+ }));
539
+ }
540
+ function Ht(e) {
541
+ return {
542
+ focusNext(t = {}) {
543
+ let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, i = r || document.activeElement, s = o[0].previousElementSibling, u = x(F(o), {
544
+ tabbable: n,
545
+ accept: l
546
+ }, o);
547
+ u.currentNode = w(i, o) ? i : s;
548
+ let c = u.nextNode();
549
+ return !c && a && (u.currentNode = s, c = u.nextNode()), c && k(c, !0), c;
550
+ },
551
+ focusPrevious(t = {}) {
552
+ let o = e.current, { from: r, tabbable: n, wrap: a, accept: l } = t, i = r || document.activeElement, s = o[o.length - 1].nextElementSibling, u = x(F(o), {
553
+ tabbable: n,
554
+ accept: l
555
+ }, o);
556
+ u.currentNode = w(i, o) ? i : s;
557
+ let c = u.previousNode();
558
+ return !c && a && (u.currentNode = s, c = u.previousNode()), c && k(c, !0), c;
559
+ },
560
+ focusFirst(t = {}) {
561
+ let o = e.current, { tabbable: r, accept: n } = t, a = x(F(o), {
562
+ tabbable: r,
563
+ accept: n
564
+ }, o);
565
+ a.currentNode = o[0].previousElementSibling;
566
+ let l = a.nextNode();
567
+ return l && k(l, !0), l;
568
+ },
569
+ focusLast(t = {}) {
570
+ let o = e.current, { tabbable: r, accept: n } = t, a = x(F(o), {
571
+ tabbable: r,
572
+ accept: n
573
+ }, o);
574
+ a.currentNode = o[o.length - 1].nextElementSibling;
575
+ let l = a.previousNode();
576
+ return l && k(l, !0), l;
577
+ }
578
+ };
579
+ }
580
+ const me = [
581
+ "input:not([disabled]):not([type=hidden])",
582
+ "select:not([disabled])",
583
+ "textarea:not([disabled])",
584
+ "button:not([disabled])",
585
+ "a[href]",
586
+ "area[href]",
587
+ "summary",
588
+ "iframe",
589
+ "object",
590
+ "embed",
591
+ "audio[controls]",
592
+ "video[controls]",
593
+ "[contenteditable]"
594
+ ], Vt = me.join(":not([hidden]),") + ",[tabindex]:not([disabled]):not([hidden])";
595
+ me.push('[tabindex]:not([tabindex="-1"]):not([disabled])');
596
+ const Kt = me.join(':not([hidden]):not([tabindex="-1"]),');
597
+ function F(e) {
598
+ return e[0].parentElement;
599
+ }
600
+ function H(e) {
601
+ let t = h.getTreeNode(v);
602
+ for (; t && t.scopeRef !== e; ) {
603
+ if (t.contain)
604
+ return !1;
605
+ t = t.parent;
606
+ }
607
+ return !0;
608
+ }
609
+ function _t(e, t) {
610
+ let o = $(), r = $(null);
611
+ E(() => {
612
+ let n = e.current;
613
+ if (!t) {
614
+ r.current && (cancelAnimationFrame(r.current), r.current = null);
615
+ return;
616
+ }
617
+ let a = (s) => {
618
+ if (s.key !== "Tab" || s.altKey || s.ctrlKey || s.metaKey || !H(e))
619
+ return;
620
+ let u = document.activeElement, c = e.current;
621
+ if (!w(u, c))
622
+ return;
623
+ let f = x(F(c), {
624
+ tabbable: !0
625
+ }, c);
626
+ f.currentNode = u;
627
+ let m = s.shiftKey ? f.previousNode() : f.nextNode();
628
+ m || (f.currentNode = s.shiftKey ? c[c.length - 1].nextElementSibling : c[0].previousElementSibling, m = s.shiftKey ? f.previousNode() : f.nextNode()), s.preventDefault(), m && k(m, !0);
629
+ }, l = (s) => {
630
+ (!v || G(v, e)) && w(s.target, e.current) ? (v = e, o.current = s.target) : H(e) && !U(s.target, e) ? o.current ? o.current.focus() : v && Y(v.current) : H(e) && (o.current = s.target);
631
+ }, i = (s) => {
632
+ r.current && cancelAnimationFrame(r.current), r.current = requestAnimationFrame(() => {
633
+ H(e) && !U(document.activeElement, e) && (v = e, document.body.contains(s.target) ? (o.current = s.target, o.current.focus()) : v && Y(v.current));
634
+ });
635
+ };
636
+ return document.addEventListener("keydown", a, !1), document.addEventListener("focusin", l, !1), n.forEach((s) => s.addEventListener("focusin", l, !1)), n.forEach((s) => s.addEventListener("focusout", i, !1)), () => {
637
+ document.removeEventListener("keydown", a, !1), document.removeEventListener("focusin", l, !1), n.forEach((s) => s.removeEventListener("focusin", l, !1)), n.forEach((s) => s.removeEventListener("focusout", i, !1));
638
+ };
639
+ }, [
640
+ e,
641
+ t
642
+ ]), T(() => () => {
643
+ r.current && cancelAnimationFrame(r.current);
644
+ }, [
645
+ r
646
+ ]);
647
+ }
648
+ function We(e) {
649
+ return U(e);
650
+ }
651
+ function w(e, t) {
652
+ return t.some((o) => o.contains(e));
653
+ }
654
+ function U(e, t = null) {
655
+ if (e instanceof Element && e.closest("[data-react-aria-top-layer]"))
656
+ return !0;
657
+ for (let { scopeRef: o } of h.traverse(h.getTreeNode(t)))
658
+ if (w(e, o.current))
659
+ return !0;
660
+ return !1;
661
+ }
662
+ function jt(e) {
663
+ return U(e, v);
664
+ }
665
+ function G(e, t) {
666
+ var o;
667
+ let r = (o = h.getTreeNode(t)) === null || o === void 0 ? void 0 : o.parent;
668
+ for (; r; ) {
669
+ if (r.scopeRef === e)
670
+ return !0;
671
+ r = r.parent;
672
+ }
673
+ return !1;
674
+ }
675
+ function k(e, t = !1) {
676
+ if (e != null && !t)
677
+ try {
678
+ ie(e);
679
+ } catch {
680
+ }
681
+ else if (e != null)
682
+ try {
683
+ e.focus();
684
+ } catch {
685
+ }
686
+ }
687
+ function Y(e, t = !0) {
688
+ let o = e[0].previousElementSibling, r = x(F(e), {
689
+ tabbable: t
690
+ }, e);
691
+ r.currentNode = o;
692
+ let n = r.nextNode();
693
+ t && !n && (r = x(F(e), {
694
+ tabbable: !1
695
+ }, e), r.currentNode = o, n = r.nextNode()), k(n);
696
+ }
697
+ function Ut(e, t) {
698
+ const o = y.useRef(t);
699
+ T(() => {
700
+ o.current && (v = e, w(document.activeElement, v.current) || Y(e.current)), o.current = !1;
701
+ }, [
702
+ e
703
+ ]);
704
+ }
705
+ function Gt(e, t, o) {
706
+ E(() => {
707
+ if (t || o)
708
+ return;
709
+ let r = e.current, n = (a) => {
710
+ let l = a.target;
711
+ w(l, e.current) ? v = e : We(l) || (v = null);
712
+ };
713
+ return document.addEventListener("focusin", n, !1), r.forEach((a) => a.addEventListener("focusin", n, !1)), () => {
714
+ document.removeEventListener("focusin", n, !1), r.forEach((a) => a.removeEventListener("focusin", n, !1));
715
+ };
716
+ }, [
717
+ e,
718
+ t,
719
+ o
720
+ ]);
721
+ }
722
+ function Yt(e) {
723
+ let t = h.getTreeNode(v);
724
+ for (; t && t.scopeRef !== e; ) {
725
+ if (t.nodeToRestore)
726
+ return !1;
727
+ t = t.parent;
728
+ }
729
+ return (t == null ? void 0 : t.scopeRef) === e;
730
+ }
731
+ function Xt(e, t, o) {
732
+ const r = $(typeof document < "u" ? document.activeElement : null);
733
+ E(() => {
734
+ let n = e.current;
735
+ if (!t || o)
736
+ return;
737
+ let a = () => {
738
+ (!v || G(v, e)) && (v = e);
739
+ };
740
+ return document.addEventListener("focusin", a, !1), n.forEach((l) => l.addEventListener("focusin", a, !1)), () => {
741
+ document.removeEventListener("focusin", a, !1), n.forEach((l) => l.removeEventListener("focusin", a, !1));
742
+ };
743
+ }, [
744
+ e,
745
+ o
746
+ ]), E(() => {
747
+ if (!t)
748
+ return;
749
+ h.getTreeNode(e).nodeToRestore = r.current;
750
+ let n = (a) => {
751
+ if (a.key !== "Tab" || a.altKey || a.ctrlKey || a.metaKey)
752
+ return;
753
+ let l = document.activeElement;
754
+ if (!w(l, e.current))
755
+ return;
756
+ let i = h.getTreeNode(e).nodeToRestore, s = x(document.body, {
757
+ tabbable: !0
758
+ });
759
+ s.currentNode = l;
760
+ let u = a.shiftKey ? s.previousNode() : s.nextNode();
761
+ if ((!document.body.contains(i) || i === document.body) && (i = null, h.getTreeNode(e).nodeToRestore = null), (!u || !w(u, e.current)) && i) {
762
+ s.currentNode = i;
763
+ do
764
+ u = a.shiftKey ? s.previousNode() : s.nextNode();
765
+ while (w(u, e.current));
766
+ a.preventDefault(), a.stopPropagation(), u ? k(u, !0) : We(i) ? k(i, !0) : l.blur();
767
+ }
768
+ };
769
+ return o || document.addEventListener("keydown", n, !0), () => {
770
+ o || document.removeEventListener("keydown", n, !0);
771
+ let a = h.getTreeNode(e).nodeToRestore;
772
+ if (t && a && (w(document.activeElement, e.current) || document.activeElement === document.body && Yt(e))) {
773
+ let l = h.clone();
774
+ requestAnimationFrame(() => {
775
+ if (document.activeElement === document.body) {
776
+ let i = l.getTreeNode(e);
777
+ for (; i; ) {
778
+ if (i.nodeToRestore && document.body.contains(i.nodeToRestore)) {
779
+ k(i.nodeToRestore);
780
+ return;
781
+ }
782
+ i = i.parent;
783
+ }
784
+ for (i = l.getTreeNode(e); i; ) {
785
+ if (i.scopeRef && h.getTreeNode(i.scopeRef)) {
786
+ Y(i.scopeRef.current, !0);
787
+ return;
788
+ }
789
+ i = i.parent;
790
+ }
791
+ }
792
+ });
793
+ }
794
+ };
795
+ }, [
796
+ e,
797
+ t,
798
+ o
799
+ ]);
800
+ }
801
+ function x(e, t, o) {
802
+ let r = t != null && t.tabbable ? Kt : Vt, n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
803
+ acceptNode(a) {
804
+ var l;
805
+ return !(t == null || (l = t.from) === null || l === void 0) && l.contains(a) ? NodeFilter.FILTER_REJECT : a.matches(r) && Ae(a) && (!o || w(a, o)) && (!(t != null && t.accept) || t.accept(a)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
806
+ }
807
+ });
808
+ return t != null && t.from && (n.currentNode = t.from), n;
809
+ }
810
+ class pe {
811
+ get size() {
812
+ return this.fastMap.size;
813
+ }
814
+ getTreeNode(t) {
815
+ return this.fastMap.get(t);
816
+ }
817
+ addTreeNode(t, o, r) {
818
+ let n = this.fastMap.get(o != null ? o : null), a = new se({
819
+ scopeRef: t
820
+ });
821
+ n.addChild(a), a.parent = n, this.fastMap.set(t, a), r && (a.nodeToRestore = r);
822
+ }
823
+ addNode(t) {
824
+ this.fastMap.set(t.scopeRef, t);
825
+ }
826
+ removeTreeNode(t) {
827
+ if (t === null)
828
+ return;
829
+ let o = this.fastMap.get(t), r = o.parent;
830
+ for (let a of this.traverse())
831
+ a !== o && o.nodeToRestore && a.nodeToRestore && o.scopeRef.current && w(a.nodeToRestore, o.scopeRef.current) && (a.nodeToRestore = o.nodeToRestore);
832
+ let n = o.children;
833
+ r.removeChild(o), n.size > 0 && n.forEach((a) => r.addChild(a)), this.fastMap.delete(o.scopeRef);
834
+ }
835
+ *traverse(t = this.root) {
836
+ if (t.scopeRef != null && (yield t), t.children.size > 0)
837
+ for (let o of t.children)
838
+ yield* this.traverse(o);
839
+ }
840
+ clone() {
841
+ let t = new pe();
842
+ for (let o of this.traverse())
843
+ t.addTreeNode(o.scopeRef, o.parent.scopeRef, o.nodeToRestore);
844
+ return t;
845
+ }
846
+ constructor() {
847
+ ae(this, "fastMap", /* @__PURE__ */ new Map()), this.root = new se({
848
+ scopeRef: null
849
+ }), this.fastMap.set(null, this.root);
850
+ }
851
+ }
852
+ class se {
853
+ addChild(t) {
854
+ this.children.add(t), t.parent = this;
855
+ }
856
+ removeChild(t) {
857
+ this.children.delete(t), t.parent = void 0;
858
+ }
859
+ constructor(t) {
860
+ ae(this, "children", /* @__PURE__ */ new Set()), ae(this, "contain", !1), this.scopeRef = t.scopeRef;
861
+ }
862
+ }
863
+ let h = new pe();
864
+ const Jt = /* @__PURE__ */ new WeakMap(), P = [];
865
+ function Qt(e, t) {
866
+ let { onClose: o, shouldCloseOnBlur: r, isOpen: n, isDismissable: a = !1, isKeyboardDismissDisabled: l = !1, shouldCloseOnInteractOutside: i } = e;
867
+ T(() => (n && P.push(t), () => {
868
+ let p = P.indexOf(t);
869
+ p >= 0 && P.splice(p, 1);
870
+ }), [
871
+ n,
872
+ t
873
+ ]);
874
+ let s = () => {
875
+ P[P.length - 1] === t && o && o();
876
+ }, u = (p) => {
877
+ (!i || i(p.target)) && P[P.length - 1] === t && (p.stopPropagation(), p.preventDefault());
878
+ }, c = (p) => {
879
+ (!i || i(p.target)) && (P[P.length - 1] === t && (p.stopPropagation(), p.preventDefault()), s());
880
+ }, f = (p) => {
881
+ p.key === "Escape" && !l && (p.stopPropagation(), p.preventDefault(), s());
882
+ };
883
+ Wt({
884
+ ref: t,
885
+ onInteractOutside: a ? c : null,
886
+ onInteractOutsideStart: u
887
+ });
888
+ let { focusWithinProps: m } = At({
889
+ isDisabled: !r,
890
+ onBlurWithin: (p) => {
891
+ p.relatedTarget && jt(p.relatedTarget) || (!i || i(p.relatedTarget)) && o();
892
+ }
893
+ }), b = (p) => {
894
+ p.target === p.currentTarget && p.preventDefault();
895
+ };
896
+ return {
897
+ overlayProps: {
898
+ onKeyDown: f,
899
+ ...m
900
+ },
901
+ underlayProps: {
902
+ onPointerDown: b
903
+ }
904
+ };
905
+ }
906
+ function Zt(e, t, o) {
907
+ let { type: r } = e, { isOpen: n } = t;
908
+ T(() => {
909
+ o && o.current && Jt.set(o.current, t.close);
910
+ });
911
+ let a;
912
+ r === "menu" ? a = !0 : r === "listbox" && (a = "listbox");
913
+ let l = Oe();
914
+ return {
915
+ triggerProps: {
916
+ "aria-haspopup": a,
917
+ "aria-expanded": n,
918
+ "aria-controls": n ? l : null,
919
+ onPress: t.toggle
920
+ },
921
+ overlayProps: {
922
+ id: l
923
+ }
924
+ };
925
+ }
926
+ const te = typeof window < "u" && window.visualViewport, eo = /* @__PURE__ */ new Set([
927
+ "checkbox",
928
+ "radio",
929
+ "range",
930
+ "color",
931
+ "file",
932
+ "image",
933
+ "button",
934
+ "submit",
935
+ "reset"
936
+ ]);
937
+ let V = 0, oe;
938
+ function to(e = {}) {
939
+ let { isDisabled: t } = e;
940
+ E(() => {
941
+ if (!t)
942
+ return V++, V === 1 && (kt() ? oe = ro() : oe = oo()), () => {
943
+ V--, V === 0 && oe();
944
+ };
945
+ }, [
946
+ t
947
+ ]);
948
+ }
949
+ function oo() {
950
+ return j(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"));
951
+ }
952
+ function ro() {
953
+ let e, t = 0, o = (f) => {
954
+ e = De(f.target), !(e === document.documentElement && e === document.body) && (t = f.changedTouches[0].pageY);
955
+ }, r = (f) => {
956
+ if (e === document.documentElement || e === document.body) {
957
+ f.preventDefault();
958
+ return;
959
+ }
960
+ let m = f.changedTouches[0].pageY, b = e.scrollTop, p = e.scrollHeight - e.clientHeight;
961
+ (b <= 0 && m > t || b >= p && m < t) && f.preventDefault(), t = m;
962
+ }, n = (f) => {
963
+ let m = f.target;
964
+ xe(m) && m !== document.activeElement && (f.preventDefault(), m.style.transform = "translateY(-2000px)", m.focus(), requestAnimationFrame(() => {
965
+ m.style.transform = "";
966
+ }));
967
+ }, a = (f) => {
968
+ let m = f.target;
969
+ xe(m) && (m.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
970
+ m.style.transform = "", te && (te.height < window.innerHeight ? requestAnimationFrame(() => {
971
+ Te(m);
972
+ }) : te.addEventListener("resize", () => Te(m), {
973
+ once: !0
974
+ }));
975
+ }));
976
+ }, l = () => {
977
+ window.scrollTo(0, 0);
978
+ }, i = window.pageXOffset, s = window.pageYOffset, u = j(I(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`), I(document.documentElement, "overflow", "hidden"), I(document.body, "marginTop", `-${s}px`));
979
+ window.scrollTo(0, 0);
980
+ let c = j(O(document, "touchstart", o, {
981
+ passive: !1,
982
+ capture: !0
983
+ }), O(document, "touchmove", r, {
984
+ passive: !1,
985
+ capture: !0
986
+ }), O(document, "touchend", n, {
987
+ passive: !1,
988
+ capture: !0
989
+ }), O(document, "focus", a, !0), O(window, "scroll", l));
990
+ return () => {
991
+ u(), c(), window.scrollTo(i, s);
992
+ };
993
+ }
994
+ function I(e, t, o) {
995
+ let r = e.style[t];
996
+ return e.style[t] = o, () => {
997
+ e.style[t] = r;
998
+ };
999
+ }
1000
+ function O(e, t, o, r) {
1001
+ return e.addEventListener(t, o, r), () => {
1002
+ e.removeEventListener(t, o, r);
1003
+ };
1004
+ }
1005
+ function Te(e) {
1006
+ let t = document.scrollingElement || document.documentElement;
1007
+ for (; e && e !== t; ) {
1008
+ let o = De(e);
1009
+ if (o !== document.documentElement && o !== document.body && o !== e) {
1010
+ let r = o.getBoundingClientRect().top, n = e.getBoundingClientRect().top;
1011
+ n > r + e.clientHeight && (o.scrollTop += n - r);
1012
+ }
1013
+ e = o.parentElement;
1014
+ }
1015
+ }
1016
+ function xe(e) {
1017
+ return e instanceof HTMLInputElement && !eo.has(e.type) || e instanceof HTMLTextAreaElement || e instanceof HTMLElement && e.isContentEditable;
1018
+ }
1019
+ let D = /* @__PURE__ */ new WeakMap(), M = [];
1020
+ function no(e, t = document.body) {
1021
+ let o = new Set(e), r = /* @__PURE__ */ new Set(), n = (s) => {
1022
+ for (let m of s.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))
1023
+ o.add(m);
1024
+ let u = (m) => {
1025
+ if (o.has(m) || r.has(m.parentElement) && m.parentElement.getAttribute("role") !== "row")
1026
+ return NodeFilter.FILTER_REJECT;
1027
+ for (let b of o)
1028
+ if (m.contains(b))
1029
+ return NodeFilter.FILTER_SKIP;
1030
+ return NodeFilter.FILTER_ACCEPT;
1031
+ }, c = document.createTreeWalker(s, NodeFilter.SHOW_ELEMENT, {
1032
+ acceptNode: u
1033
+ }), f = u(s);
1034
+ if (f === NodeFilter.FILTER_ACCEPT && a(s), f !== NodeFilter.FILTER_REJECT) {
1035
+ let m = c.nextNode();
1036
+ for (; m != null; )
1037
+ a(m), m = c.nextNode();
1038
+ }
1039
+ }, a = (s) => {
1040
+ var u;
1041
+ let c = (u = D.get(s)) !== null && u !== void 0 ? u : 0;
1042
+ s.getAttribute("aria-hidden") === "true" && c === 0 || (c === 0 && s.setAttribute("aria-hidden", "true"), r.add(s), D.set(s, c + 1));
1043
+ };
1044
+ M.length && M[M.length - 1].disconnect(), n(t);
1045
+ let l = new MutationObserver((s) => {
1046
+ for (let u of s)
1047
+ if (!(u.type !== "childList" || u.addedNodes.length === 0) && ![
1048
+ ...o,
1049
+ ...r
1050
+ ].some((c) => c.contains(u.target))) {
1051
+ for (let c of u.removedNodes)
1052
+ c instanceof Element && (o.delete(c), r.delete(c));
1053
+ for (let c of u.addedNodes)
1054
+ (c instanceof HTMLElement || c instanceof SVGElement) && (c.dataset.liveAnnouncer === "true" || c.dataset.reactAriaTopLayer === "true") ? o.add(c) : c instanceof Element && n(c);
1055
+ }
1056
+ });
1057
+ l.observe(t, {
1058
+ childList: !0,
1059
+ subtree: !0
1060
+ });
1061
+ let i = {
1062
+ observe() {
1063
+ l.observe(t, {
1064
+ childList: !0,
1065
+ subtree: !0
1066
+ });
1067
+ },
1068
+ disconnect() {
1069
+ l.disconnect();
1070
+ }
1071
+ };
1072
+ return M.push(i), () => {
1073
+ l.disconnect();
1074
+ for (let s of r) {
1075
+ let u = D.get(s);
1076
+ u === 1 ? (s.removeAttribute("aria-hidden"), D.delete(s)) : D.set(s, u - 1);
1077
+ }
1078
+ i === M[M.length - 1] ? (M.pop(), M.length && M[M.length - 1].observe()) : M.splice(M.indexOf(i), 1);
1079
+ };
1080
+ }
1081
+ const ze = /* @__PURE__ */ y.createContext(null);
1082
+ function ao(e) {
1083
+ let t = st(), { portalContainer: o = t ? null : document.body } = e, [r, n] = X(!1), a = K(() => ({
1084
+ contain: r,
1085
+ setContain: n
1086
+ }), [
1087
+ r,
1088
+ n
1089
+ ]);
1090
+ if (!o)
1091
+ return null;
1092
+ let l = /* @__PURE__ */ y.createElement(ze.Provider, {
1093
+ value: a
1094
+ }, /* @__PURE__ */ y.createElement(Rt, {
1095
+ restoreFocus: !0,
1096
+ contain: r
1097
+ }, e.children));
1098
+ return /* @__PURE__ */ rt.createPortal(l, o);
1099
+ }
1100
+ function qe() {
1101
+ let e = A(ze), t = e == null ? void 0 : e.setContain;
1102
+ E(() => {
1103
+ t == null || t(!0);
1104
+ }, [
1105
+ t
1106
+ ]);
1107
+ }
1108
+ function lo(e, t, o) {
1109
+ let { overlayProps: r, underlayProps: n } = Qt({
1110
+ ...e,
1111
+ isOpen: t.isOpen,
1112
+ onClose: t.close
1113
+ }, o);
1114
+ return to({
1115
+ isDisabled: !t.isOpen
1116
+ }), qe(), T(() => {
1117
+ if (t.isOpen)
1118
+ return no([
1119
+ o.current
1120
+ ]);
1121
+ }, [
1122
+ t.isOpen,
1123
+ o
1124
+ ]), {
1125
+ modalProps: pt(r),
1126
+ underlayProps: n
1127
+ };
1128
+ }
1129
+ function io(e, t) {
1130
+ let { role: o = "dialog" } = e, r = mt();
1131
+ r = e["aria-label"] ? void 0 : r;
1132
+ let n = $(!1);
1133
+ return T(() => {
1134
+ if (t.current && !t.current.contains(document.activeElement)) {
1135
+ ie(t.current);
1136
+ let a = setTimeout(() => {
1137
+ document.activeElement === t.current && (n.current = !0, t.current.blur(), ie(t.current), n.current = !1);
1138
+ }, 500);
1139
+ return () => {
1140
+ clearTimeout(a);
1141
+ };
1142
+ }
1143
+ }, [
1144
+ t
1145
+ ]), qe(), {
1146
+ dialogProps: {
1147
+ ...vt(e, {
1148
+ labelable: !0
1149
+ }),
1150
+ role: o,
1151
+ tabIndex: -1,
1152
+ "aria-labelledby": e["aria-labelledby"] || r,
1153
+ onBlur: (a) => {
1154
+ n.current && a.stopPropagation();
1155
+ }
1156
+ },
1157
+ titleProps: {
1158
+ id: r
1159
+ }
1160
+ };
1161
+ }
1162
+ function so(e, t, o) {
1163
+ return t in e ? Object.defineProperty(e, t, {
1164
+ value: o,
1165
+ enumerable: !0,
1166
+ configurable: !0,
1167
+ writable: !0
1168
+ }) : e[t] = o, e;
1169
+ }
1170
+ function Fe(e, t) {
1171
+ var o = Object.keys(e);
1172
+ if (Object.getOwnPropertySymbols) {
1173
+ var r = Object.getOwnPropertySymbols(e);
1174
+ t && (r = r.filter(function(n) {
1175
+ return Object.getOwnPropertyDescriptor(e, n).enumerable;
1176
+ })), o.push.apply(o, r);
1177
+ }
1178
+ return o;
1179
+ }
1180
+ function Se(e) {
1181
+ for (var t = 1; t < arguments.length; t++) {
1182
+ var o = arguments[t] != null ? arguments[t] : {};
1183
+ t % 2 ? Fe(Object(o), !0).forEach(function(r) {
1184
+ so(e, r, o[r]);
1185
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(o)) : Fe(Object(o)).forEach(function(r) {
1186
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(o, r));
1187
+ });
1188
+ }
1189
+ return e;
1190
+ }
1191
+ var uo = (e, t, o) => {
1192
+ for (var r of Object.keys(e)) {
1193
+ var n;
1194
+ if (e[r] !== ((n = t[r]) !== null && n !== void 0 ? n : o[r]))
1195
+ return !1;
1196
+ }
1197
+ return !0;
1198
+ }, Re = (e) => (t) => {
1199
+ var o = e.defaultClassName, r = Se(Se({}, e.defaultVariants), t);
1200
+ for (var n in r) {
1201
+ var a, l = (a = r[n]) !== null && a !== void 0 ? a : e.defaultVariants[n];
1202
+ if (l != null) {
1203
+ var i = l;
1204
+ typeof i == "boolean" && (i = i === !0 ? "true" : "false");
1205
+ var s = e.variantClassNames[n][i];
1206
+ s && (o += " " + s);
1207
+ }
1208
+ }
1209
+ for (var [u, c] of e.compoundVariants)
1210
+ uo(u, r, e.defaultVariants) && (o += " " + c);
1211
+ return o;
1212
+ }, co = "_3moto2o", mo = "_3moto2q", po = "_3moto2r", He = "_3moto2p", fo = Re({ defaultClassName: "_3moto20", variantClassNames: { kind: { informational: "_3moto21", delete: "_3moto22", failure: "_3moto23", success: "_3moto24", warning: "_3moto25", successWithFailures: "_3moto26", form: "_3moto27" }, size: { sm: "_3moto28", md: "_3moto29", lg: "_3moto2a", xl: "_3moto2b" }, fullHeight: { true: "_3moto2c", false: "_3moto2d" } }, defaultVariants: {}, compoundVariants: [] }), go = "_3moto2n", bo = Re({ defaultClassName: "_3moto2e", variantClassNames: { kind: { form: "_3moto2f", delete: "_3moto2g", failure: "_3moto2h", informational: "_3moto2i", success: "_3moto2j", warning: "_3moto2k", successWithFailures: "_3moto2l" } }, defaultVariants: {}, compoundVariants: [] }), vo = "_3moto2m", ho = "_3moto2s";
1213
+ function Ve({
1214
+ children: e,
1215
+ className: t = "",
1216
+ ...o
1217
+ }) {
1218
+ return /* @__PURE__ */ d.createElement("div", {
1219
+ className: re(He, t),
1220
+ ...o
1221
+ }, e);
1222
+ }
1223
+ Be.set(Ve, { name: "ModalFooter" });
1224
+ const Le = Object.freeze({
1225
+ form: "pencil",
1226
+ delete: "trash",
1227
+ failure: "status-error",
1228
+ informational: "info-circle",
1229
+ success: "status-ok",
1230
+ successWithFailures: "status-warning",
1231
+ warning: "status-warning"
1232
+ });
1233
+ function $o({
1234
+ children: e,
1235
+ className: t,
1236
+ "data-testid": o,
1237
+ kind: r = "informational",
1238
+ onBlur: n,
1239
+ onFocus: a,
1240
+ overlayProps: l,
1241
+ size: i = "sm",
1242
+ state: s,
1243
+ title: u,
1244
+ dismissable: c = !0,
1245
+ onClose: f,
1246
+ fullHeight: m = !1,
1247
+ ...b
1248
+ }) {
1249
+ const p = d.useRef(null), { modalProps: N, underlayProps: z } = lo(
1250
+ {
1251
+ isDismissable: c,
1252
+ isKeyboardDismissDisabled: !c,
1253
+ ...b
1254
+ },
1255
+ s,
1256
+ p
1257
+ ), { dialogProps: J, titleProps: _e } = io(b, p), je = ve(N.onFocus, J.onFocus, a), Ue = ve(N.onBlur, J.onBlur, n), { t: Ge } = d.useContext(Qe), Ye = Ze({ "data-testid": o }), [Q, Xe] = et(
1258
+ e,
1259
+ [{ type: Ve }]
1260
+ );
1261
+ function fe() {
1262
+ f && typeof f == "function" && f(), s.close();
1263
+ }
1264
+ const ge = function() {
1265
+ return c ? /* @__PURE__ */ d.createElement(he, {
1266
+ "aria-label": "Close",
1267
+ onClick: fe,
1268
+ kind: "icon",
1269
+ icon: "x",
1270
+ className: mo
1271
+ }) : null;
1272
+ }, Je = tt(Xe, (be) => be.type === ge ? [{ className: re(be.props.classname, po) }] : []);
1273
+ return /* @__PURE__ */ d.createElement(ao, null, /* @__PURE__ */ d.createElement("div", {
1274
+ className: ho,
1275
+ ...z,
1276
+ ...b
1277
+ }, /* @__PURE__ */ d.createElement("div", {
1278
+ ...N,
1279
+ ...J,
1280
+ ...l,
1281
+ onFocus: je,
1282
+ onBlur: Ue,
1283
+ ...Ye("dialog"),
1284
+ ref: p,
1285
+ className: re(fo({ kind: r, size: i, fullHeight: m }), t)
1286
+ }, /* @__PURE__ */ d.createElement("div", {
1287
+ ..._e,
1288
+ className: bo({ kind: r })
1289
+ }, r && /* @__PURE__ */ d.createElement(ot, {
1290
+ icon: Le[r] || Le.informational,
1291
+ className: go
1292
+ }), /* @__PURE__ */ d.createElement("div", {
1293
+ className: vo
1294
+ }, Z(u, s.close)), /* @__PURE__ */ d.createElement(ge, null)), /* @__PURE__ */ d.createElement("div", {
1295
+ className: co
1296
+ }, Z(Je, s.close)), Q && Q.length > 0 ? /* @__PURE__ */ d.createElement(d.Fragment, null, Z(Q, s.close)) : /* @__PURE__ */ d.createElement("div", {
1297
+ className: He
1298
+ }, /* @__PURE__ */ d.createElement(he, {
1299
+ kind: "key",
1300
+ onClick: fe
1301
+ }, Ge("design-system:modal.defaultButtonLabel"))))));
1302
+ }
1303
+ function Ke(e) {
1304
+ return e.state.isOpen ? /* @__PURE__ */ d.createElement($o, {
1305
+ ...e
1306
+ }, e.children) : /* @__PURE__ */ d.createElement(d.Fragment, null);
1307
+ }
1308
+ Be.set(Ke, {
1309
+ name: "Modal",
1310
+ props: {
1311
+ dismissable: { type: "boolean", default: "true" },
1312
+ fullHeight: { type: "boolean", default: "false" },
1313
+ kind: { type: "ModalKind", default: "informational" },
1314
+ onBlur: { type: "() => void" },
1315
+ onClose: { type: "() => void" },
1316
+ onFocus: { type: "() => void" },
1317
+ size: { type: "ModalSize", default: "sm" },
1318
+ title: { type: "string" }
1319
+ }
1320
+ });
1321
+ function wo(e) {
1322
+ let [t, o] = nt(e.isOpen, e.defaultOpen || !1, e.onOpenChange);
1323
+ return {
1324
+ isOpen: t,
1325
+ setOpen: o,
1326
+ open() {
1327
+ o(!0);
1328
+ },
1329
+ close() {
1330
+ o(!1);
1331
+ },
1332
+ toggle() {
1333
+ o(!t);
1334
+ }
1335
+ };
1336
+ }
1337
+ function xo(e = {}) {
1338
+ const t = wo(e), o = $(null), { triggerProps: r, overlayProps: n } = Zt(
1339
+ { type: "dialog" },
1340
+ t,
1341
+ o
1342
+ ), {
1343
+ onPress: a,
1344
+ ...l
1345
+ } = r;
1346
+ return {
1347
+ triggerProps: {
1348
+ ...l,
1349
+ onClick: a,
1350
+ ref: o
1351
+ },
1352
+ modalState: t,
1353
+ modalProps: { overlayProps: n, state: t }
1354
+ };
1355
+ }
1356
+ const Eo = {
1357
+ description: () => /* @__PURE__ */ d.createElement("p", null, "Modals are overlays on a page that focus a user\u2019s attention on an important message or a simple action. Examples of a Modal include confirming the deletion of a record, or making a single selection."),
1358
+ components: [Ke],
1359
+ examples: {
1360
+ general: {
1361
+ label: "Usage",
1362
+ description: ({ NavigateTo: e }) => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Use a Modal:"), /* @__PURE__ */ d.createElement("ul", null, /* @__PURE__ */ d.createElement("li", null, "When the user needs to confirm a basic decision, such as deleting a record."), /* @__PURE__ */ d.createElement("li", null, "When important information needs to be displayed to the user before continuing."), /* @__PURE__ */ d.createElement("li", null, "When a simple selection, such as a single form input, is required before proceeding.")), /* @__PURE__ */ d.createElement("h5", null, "Avoid a Modal:"), /* @__PURE__ */ d.createElement("ul", null, /* @__PURE__ */ d.createElement("li", null, "When a complex form is required. Use a ", /* @__PURE__ */ d.createElement(e, {
1363
+ to: "focused-task"
1364
+ }, "Focused Task View"), " instead."), /* @__PURE__ */ d.createElement("li", null, "When sharing non-critical or tertiary information. Use a ", /* @__PURE__ */ d.createElement(e, {
1365
+ to: "growlers"
1366
+ }, "Growler"), " instead.")))
1367
+ },
1368
+ implementation: {
1369
+ label: "Close Button",
1370
+ description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Close Button and Modal dismissiability"), /* @__PURE__ */ d.createElement("p", null, "Remove the Close Button in the upper right of the Modal if the user must choose the course of action before proceeding."), /* @__PURE__ */ d.createElement("p", null, "The close button is included by default and omitted when the prop ", /* @__PURE__ */ d.createElement("code", null, "dismissable"), " is set to ", /* @__PURE__ */ d.createElement("strong", null, "false"), "."), /* @__PURE__ */ d.createElement("p", null, "Setting the ", /* @__PURE__ */ d.createElement("code", null, "dismissable"), " prop to false also prevents dismissing the modal by clicking outside of the modal or by using the", " ", /* @__PURE__ */ d.createElement("strong", null, "escape"), " key.")),
1371
+ examples: {
1372
+ basic: {
1373
+ react: g`
1374
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1375
+ import { sprinkles } from "@sps-woodland/tokens";
1376
+ import { Button } from "@sps-woodland/buttons";
1377
+
1378
+ function Component() {
1379
+
1380
+ const { modalProps, triggerProps, modalState } = useModal();
1381
+ function secondaryAction() {
1382
+ console.info("Secondary action invoked");
1383
+ modalState.close();
1384
+ }
1385
+ function primaryAction() {
1386
+ console.info("Primary action invoked");
1387
+ modalState.close();
1388
+ }
1389
+ return (
1390
+ <>
1391
+ <Button data-testid="non-dismissable-btn" kind="default" {...triggerProps}>Trigger non-dismissable modal</Button>
1392
+ <Modal
1393
+ {...modalProps}
1394
+ title="Foo"
1395
+ dismissable={false}
1396
+ data-testid="non-dismissable"
1397
+ >
1398
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1399
+ <ModalFooter>
1400
+ <Button onClick={secondaryAction} className={sprinkles({ mr: "xs" })}>Secondary Action</Button>
1401
+ <Button kind="key" onClick={primaryAction}>Primary Action</Button>
1402
+ </ModalFooter>
1403
+ </Modal>
1404
+ </>
1405
+ )
1406
+ }
1407
+ `
1408
+ }
1409
+ }
1410
+ },
1411
+ sizing: {
1412
+ label: "Sizing",
1413
+ description: `There are 4 sizes of Modal:
1414
+ Small (4 columns), Medium (6 columns),
1415
+ and Large (8 columns), XLarge (12 columns).
1416
+ Use the size that best fits the content
1417
+ that needs to be in the Modal, erring
1418
+ towards the smallest size whenever possible.`
1419
+ },
1420
+ hooks: {
1421
+ label: "Using Hooks",
1422
+ description: () => /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h5", null, "Using the hook"), /* @__PURE__ */ d.createElement("p", null, "To use any modals, you must call the ", /* @__PURE__ */ d.createElement("code", null, "useModal"), " hook. Optional arguments for this hook include:"), /* @__PURE__ */ d.createElement("dl", null, /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "isOpen"), ": boolean"), /* @__PURE__ */ d.createElement("dd", null, "Whether the overlay is open by default (controlled)"), /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "defaultOpen"), ": boolean"), /* @__PURE__ */ d.createElement("dd", null, "Whether the overlay is open by default (uncontrolled)."), /* @__PURE__ */ d.createElement("dt", null, /* @__PURE__ */ d.createElement("code", null, "onOpenChange"), ": function"), /* @__PURE__ */ d.createElement("dd", null, "Handler that is called when the overlay's open state changes.", /* @__PURE__ */ d.createElement("code", null, "(isOpen: boolean) => void"))), /* @__PURE__ */ d.createElement("h5", null, "Modal Props, Modal State, and Trigger Props"), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "useModal"), " returns an object with ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), ", ", /* @__PURE__ */ d.createElement("code", null, "modalState"), " and ", /* @__PURE__ */ d.createElement("code", null, "triggerProps")), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "triggerProps"), " need to be spread on the element that triggers the modal."), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "modalState"), " object (which is also included in ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), ") allows programmatic access to the state of the modal. This includes a read only ", /* @__PURE__ */ d.createElement("code", null, "isOpen"), " property, a ", /* @__PURE__ */ d.createElement("code", null, "setOpen(isOpen: boolean)"), " method which can be use to set whether the overlay is open, an ", /* @__PURE__ */ d.createElement("code", null, "open()"), " method which open the overlay, a ", /* @__PURE__ */ d.createElement("code", null, "close()"), " method which closes the overlay and a ", /* @__PURE__ */ d.createElement("code", null, "toggle()"), " method that toggles the overlay's visiblity."), /* @__PURE__ */ d.createElement("p", null, "The ", /* @__PURE__ */ d.createElement("code", null, "modalProps"), " should be spread on the actual ", /* @__PURE__ */ d.createElement("code", null, "Modal"), " component."), /* @__PURE__ */ d.createElement("p", null, "Please refer to the examples to see its implementation"))
1423
+ },
1424
+ informational: {
1425
+ label: "Informational",
1426
+ description: `Use Informational Modals to share impactful information with the user,
1427
+ such as telling them when an app will be down for maintenance.`,
1428
+ examples: {
1429
+ small: {
1430
+ description: "Small",
1431
+ react: g`
1432
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1433
+ import { sprinkles } from "@sps-woodland/tokens";
1434
+ import { Button } from "@sps-woodland/buttons";
1435
+
1436
+ function Component() {
1437
+
1438
+ const { modalProps, triggerProps, modalState } = useModal();
1439
+
1440
+
1441
+ return (
1442
+ <>
1443
+ <Button data-testid="small-info-btn" kind="default" {...triggerProps}>Trigger small informational modal</Button>
1444
+ <Modal
1445
+ {...modalProps}
1446
+ title="Foo"
1447
+ kind="informational"
1448
+ size="sm"
1449
+ data-testid="small-info"
1450
+ >
1451
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1452
+ </Modal>
1453
+ </>
1454
+ )
1455
+ }
1456
+ `
1457
+ },
1458
+ medium: {
1459
+ description: "Medium",
1460
+ react: g`
1461
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1462
+ import { sprinkles } from "@sps-woodland/tokens";
1463
+ import { Button } from "@sps-woodland/buttons";
1464
+
1465
+ function Component() {
1466
+ const { modalProps, triggerProps, modalState } = useModal();
1467
+
1468
+ return (
1469
+ <>
1470
+ <Button kind="default" {...triggerProps}>Trigger medium informational modal</Button>
1471
+ <Modal
1472
+ {...modalProps}
1473
+ title="Foo"
1474
+ kind="informational"
1475
+ size="md"
1476
+ >
1477
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1478
+ </Modal>
1479
+ </>
1480
+ )
1481
+ }
1482
+ `
1483
+ },
1484
+ large: {
1485
+ description: "Large",
1486
+ react: g`
1487
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1488
+ import { sprinkles } from "@sps-woodland/tokens";
1489
+ import { Button } from "@sps-woodland/buttons";
1490
+
1491
+ function Component() {
1492
+
1493
+ const { modalProps, triggerProps, modalState } = useModal();
1494
+ return (
1495
+ <>
1496
+ <Button kind="default" {...triggerProps}>Trigger large information modal</Button>
1497
+ <Modal
1498
+ {...modalProps}
1499
+ title="Foo"
1500
+ kind="informational"
1501
+ size="lg"
1502
+ >
1503
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1504
+ </Modal>
1505
+ </>
1506
+ )
1507
+ }
1508
+ `
1509
+ },
1510
+ xlarge: {
1511
+ description: "Extra Large",
1512
+ react: g`
1513
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1514
+ import { sprinkles } from "@sps-woodland/tokens";
1515
+ import { Button } from "@sps-woodland/buttons";
1516
+
1517
+ function Component() {
1518
+
1519
+ const { modalProps, triggerProps, modalState } = useModal();
1520
+ return (
1521
+ <>
1522
+ <Button kind="default" {...triggerProps}>Trigger extra large information trigger</Button>
1523
+ <Modal
1524
+ {...modalProps}
1525
+ title="Foo"
1526
+ kind="informational"
1527
+ isDismissable={true}
1528
+ size="xl">
1529
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1530
+ </Modal>
1531
+ </>
1532
+ )
1533
+ }
1534
+ `
1535
+ }
1536
+ }
1537
+ },
1538
+ delete: {
1539
+ label: "Delete",
1540
+ description: `Use Delete Modals to have the user confirm they want to
1541
+ continue with a destructive action. Be clear on what will happen if they continue.`,
1542
+ examples: {
1543
+ small: {
1544
+ description: "Small",
1545
+ react: g`
1546
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1547
+ import { sprinkles } from "@sps-woodland/tokens";
1548
+ import { Button } from "@sps-woodland/buttons";
1549
+
1550
+ function Component() {
1551
+
1552
+ const { modalProps, triggerProps, modalState } = useModal();
1553
+
1554
+ return (
1555
+ <>
1556
+ <Button kind="default" {...triggerProps}>Trigger small delete modal</Button>
1557
+ <Modal {...modalProps} title="Foo" kind="delete" size="sm">
1558
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1559
+ </Modal>
1560
+ </>
1561
+ )
1562
+ }
1563
+ `
1564
+ },
1565
+ medium: {
1566
+ description: "Medium",
1567
+ react: g`
1568
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1569
+ import { sprinkles } from "@sps-woodland/tokens";
1570
+ import { Button } from "@sps-woodland/buttons";
1571
+
1572
+ function Component() {
1573
+ const { modalProps, triggerProps, modalState } = useModal();
1574
+
1575
+ return (
1576
+ <>
1577
+ <Button kind="default" {...triggerProps}>Trigger medium delete modal</Button>
1578
+ <Modal {...modalProps} title="Foo" kind="delete" size="md">
1579
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1580
+ </Modal>
1581
+ </>
1582
+ )
1583
+ }
1584
+ `
1585
+ },
1586
+ large: {
1587
+ description: "Large",
1588
+ react: g`
1589
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1590
+ import { sprinkles } from "@sps-woodland/tokens";
1591
+ import { Button } from "@sps-woodland/buttons";
1592
+
1593
+ function Component() {
1594
+
1595
+ const { modalProps, triggerProps, modalState } = useModal();
1596
+
1597
+ return (
1598
+ <>
1599
+ <Button kind="default" {...triggerProps}>Trigger large delete modal</Button>
1600
+ <Modal {...modalProps} title="Foo" kind="delete" size="lg">
1601
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1602
+ </Modal>
1603
+ </>
1604
+ )
1605
+ }
1606
+ `
1607
+ },
1608
+ xlarge: {
1609
+ description: "Extra Large",
1610
+ react: g`
1611
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1612
+ import { sprinkles } from "@sps-woodland/tokens";
1613
+ import { Button } from "@sps-woodland/buttons";
1614
+
1615
+ function Component() {
1616
+
1617
+ const { modalProps, triggerProps, modalState } = useModal();
1618
+ return (
1619
+ <>
1620
+ <Button kind="default" {...triggerProps}>Trigger extra large delete modal</Button>
1621
+ <Modal {...modalProps} title="Foo" kind="delete" size="xl">
1622
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1623
+ </Modal>
1624
+ </>
1625
+ )
1626
+ }
1627
+ `
1628
+ }
1629
+ }
1630
+ },
1631
+ failure: {
1632
+ label: "Failure",
1633
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
1634
+ examples: {
1635
+ small: {
1636
+ description: "Small",
1637
+ react: g`
1638
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1639
+ import { sprinkles } from "@sps-woodland/tokens";
1640
+ import { Button } from "@sps-woodland/buttons";
1641
+
1642
+ function Component() {
1643
+
1644
+ const { modalProps, triggerProps, modalState } = useModal();
1645
+
1646
+ return (
1647
+ <>
1648
+ <Button kind="default" {...triggerProps}>Trigger small failure modal</Button>
1649
+ <Modal {...modalProps} title="Foo" kind="failure" size="sm">
1650
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1651
+ </Modal>
1652
+ </>
1653
+ )
1654
+ }
1655
+ `
1656
+ },
1657
+ medium: {
1658
+ description: "Medium",
1659
+ react: g`
1660
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1661
+ import { sprinkles } from "@sps-woodland/tokens";
1662
+ import { Button } from "@sps-woodland/buttons";
1663
+
1664
+ function Component() {
1665
+ const { modalProps, triggerProps, modalState } = useModal();
1666
+
1667
+ return (
1668
+ <>
1669
+ <Button kind="default" {...triggerProps}>Trigger medium failure modal</Button>
1670
+ <Modal {...modalProps} title="Foo" kind="failure" size="md">
1671
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1672
+ </Modal>
1673
+ </>
1674
+ )
1675
+ }
1676
+ `
1677
+ },
1678
+ large: {
1679
+ description: "Large",
1680
+ react: g`
1681
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1682
+ import { sprinkles } from "@sps-woodland/tokens";
1683
+ import { Button } from "@sps-woodland/buttons";
1684
+
1685
+ function Component() {
1686
+
1687
+ const { modalProps, triggerProps, modalState } = useModal();
1688
+
1689
+ return (
1690
+ <>
1691
+ <Button kind="default" {...triggerProps}>Trigger large failure modal</Button>
1692
+ <Modal {...modalProps} title="Foo" kind="failure" size="lg">
1693
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1694
+ </Modal>
1695
+ </>
1696
+ )
1697
+ }
1698
+ `
1699
+ },
1700
+ xlarge: {
1701
+ description: "Extra Large",
1702
+ react: g`
1703
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1704
+ import { sprinkles } from "@sps-woodland/tokens";
1705
+ import { Button } from "@sps-woodland/buttons";
1706
+
1707
+ function Component() {
1708
+
1709
+ const { modalProps, triggerProps, modalState } = useModal();
1710
+ return (
1711
+ <>
1712
+ <Button kind="default" {...triggerProps}>Trigger extra large failure modal</Button>
1713
+ <Modal {...modalProps} title="Foo" kind="failure" size="xl">
1714
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1715
+ </Modal>
1716
+ </>
1717
+ )
1718
+ }
1719
+ `
1720
+ }
1721
+ }
1722
+ },
1723
+ success: {
1724
+ label: "Success",
1725
+ description: "Use Success Modals to confirm that an action has been completed successfully.",
1726
+ examples: {
1727
+ small: {
1728
+ description: "Small",
1729
+ react: g`
1730
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1731
+ import { sprinkles } from "@sps-woodland/tokens";
1732
+ import { Button } from "@sps-woodland/buttons";
1733
+
1734
+ function Component() {
1735
+
1736
+ const { modalProps, triggerProps, modalState } = useModal();
1737
+
1738
+ return (
1739
+ <>
1740
+ <Button kind="default" {...triggerProps}>Trigger small success modal</Button>
1741
+ <Modal {...modalProps} title="Foo" kind="success" size="sm">
1742
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1743
+ </Modal>
1744
+ </>
1745
+ )
1746
+ }
1747
+ `
1748
+ },
1749
+ medium: {
1750
+ description: "Medium",
1751
+ react: g`
1752
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1753
+ import { sprinkles } from "@sps-woodland/tokens";
1754
+ import { Button } from "@sps-woodland/buttons";
1755
+
1756
+ function Component() {
1757
+ const { modalProps, triggerProps, modalState } = useModal();
1758
+
1759
+ return (
1760
+ <>
1761
+ <Button kind="default" {...triggerProps}>Trigger medium success modal</Button>
1762
+ <Modal {...modalProps} title="Foo" kind="success" size="md">
1763
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1764
+ </Modal>
1765
+ </>
1766
+ )
1767
+ }
1768
+ `
1769
+ },
1770
+ large: {
1771
+ description: "Large",
1772
+ react: g`
1773
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1774
+ import { sprinkles } from "@sps-woodland/tokens";
1775
+ import { Button } from "@sps-woodland/buttons";
1776
+
1777
+ function Component() {
1778
+
1779
+ const { modalProps, triggerProps, modalState } = useModal();
1780
+
1781
+ return (
1782
+ <>
1783
+ <Button kind="default" {...triggerProps}>Trigger large success modal</Button>
1784
+ <Modal {...modalProps} title="Foo" kind="success" size="lg">
1785
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1786
+ </Modal>
1787
+ </>
1788
+ )
1789
+ }
1790
+ `
1791
+ },
1792
+ xlarge: {
1793
+ description: "Extra Large",
1794
+ react: g`
1795
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1796
+ import { sprinkles } from "@sps-woodland/tokens";
1797
+ import { Button } from "@sps-woodland/buttons";
1798
+
1799
+ function Component() {
1800
+
1801
+ const { modalProps, triggerProps, modalState } = useModal();
1802
+ return (
1803
+ <>
1804
+ <Button kind="default" {...triggerProps}>Trigger extra large success modal</Button>
1805
+ <Modal {...modalProps} title="Foo" kind="success" size="xl">
1806
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1807
+ </Modal>
1808
+ </>
1809
+ )
1810
+ }
1811
+ `
1812
+ }
1813
+ }
1814
+ },
1815
+ successWithFailtures: {
1816
+ label: "Success with Failures",
1817
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
1818
+ examples: {
1819
+ small: {
1820
+ description: "Small",
1821
+ react: g`
1822
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1823
+ import { sprinkles } from "@sps-woodland/tokens";
1824
+ import { Button } from "@sps-woodland/buttons";
1825
+
1826
+ function Component() {
1827
+
1828
+ const { modalProps, triggerProps, modalState } = useModal();
1829
+
1830
+ return (
1831
+ <>
1832
+ <Button kind="default" {...triggerProps}>Trigger small success with failures modal</Button>
1833
+ <Modal {...modalProps} title="Foo" kind="successWithFailures" size="sm">
1834
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1835
+ </Modal>
1836
+ </>
1837
+ )
1838
+ }
1839
+ `
1840
+ },
1841
+ medium: {
1842
+ description: "Medium",
1843
+ react: g`
1844
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1845
+ import { sprinkles } from "@sps-woodland/tokens";
1846
+ import { Button } from "@sps-woodland/buttons";
1847
+
1848
+ function Component() {
1849
+ const { modalProps, triggerProps, modalState } = useModal();
1850
+
1851
+ return (
1852
+ <>
1853
+ <Button kind="default" {...triggerProps}>Trigger medium success with failures modal</Button>
1854
+ <Modal {...modalProps} title="Foo" kind="successWithFailures" size="md">
1855
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1856
+ </Modal>
1857
+ </>
1858
+ )
1859
+ }
1860
+ `
1861
+ },
1862
+ large: {
1863
+ description: "Large",
1864
+ react: g`
1865
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1866
+ import { sprinkles } from "@sps-woodland/tokens";
1867
+ import { Button } from "@sps-woodland/buttons";
1868
+
1869
+ function Component() {
1870
+
1871
+ const { modalProps, triggerProps, modalState } = useModal();
1872
+
1873
+ return (
1874
+ <>
1875
+ <Button kind="default" {...triggerProps}>Trigger large success with failures modal</Button>
1876
+ <Modal {...modalProps} title="Foo" kind="successWithFailures" size="lg">
1877
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1878
+ </Modal>
1879
+ </>
1880
+ )
1881
+ }
1882
+ `
1883
+ },
1884
+ xlarge: {
1885
+ description: "Extra Large",
1886
+ react: g`
1887
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1888
+ import { sprinkles } from "@sps-woodland/tokens";
1889
+ import { Button } from "@sps-woodland/buttons";
1890
+
1891
+ function Component() {
1892
+
1893
+ const { modalProps, triggerProps, modalState } = useModal();
1894
+ return (
1895
+ <>
1896
+ <Button kind="default" {...triggerProps}>Trigger extra large success with failures modal</Button>
1897
+ <Modal {...modalProps} title="Foo" kind="successWithFailures" size="xl">
1898
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1899
+ </Modal>
1900
+ </>
1901
+ )
1902
+ }
1903
+ `
1904
+ }
1905
+ }
1906
+ },
1907
+ warning: {
1908
+ label: "Warning",
1909
+ description: "Use Warning Modals to warn of problems that may occur as a result of taking an action. When writing the message, be clear about what will happen if the user continues on the path.",
1910
+ examples: {
1911
+ small: {
1912
+ description: "Small",
1913
+ react: g`
1914
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1915
+ import { sprinkles } from "@sps-woodland/tokens";
1916
+ import { Button } from "@sps-woodland/buttons";
1917
+
1918
+ function Component() {
1919
+
1920
+ const { modalProps, triggerProps, modalState } = useModal();
1921
+
1922
+ return (
1923
+ <>
1924
+ <Button kind="default" {...triggerProps}>Trigger small warning modal</Button>
1925
+ <Modal
1926
+ {...modalProps}
1927
+ title="Foo"
1928
+ kind="warning"
1929
+ isDismissable={true}
1930
+ size="sm">
1931
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1932
+ </Modal>
1933
+ </>
1934
+ )
1935
+ }
1936
+ `
1937
+ },
1938
+ medium: {
1939
+ description: "Medium",
1940
+ react: g`
1941
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1942
+ import { sprinkles } from "@sps-woodland/tokens";
1943
+ import { Button } from "@sps-woodland/buttons";
1944
+
1945
+ function Component() {
1946
+ const { modalProps, triggerProps, modalState } = useModal();
1947
+
1948
+ return (
1949
+ <>
1950
+ <Button kind="default" {...triggerProps}>Trigger medium warning modal</Button>
1951
+ <Modal
1952
+ {...modalProps}
1953
+ title="Foo"
1954
+ kind="warning"
1955
+ size="md">
1956
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1957
+ </Modal>
1958
+ </>
1959
+ )
1960
+ }
1961
+ `
1962
+ },
1963
+ large: {
1964
+ description: "Large",
1965
+ react: g`
1966
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1967
+ import { sprinkles } from "@sps-woodland/tokens";
1968
+ import { Button } from "@sps-woodland/buttons";
1969
+
1970
+ function Component() {
1971
+
1972
+ const { modalProps, triggerProps, modalState } = useModal();
1973
+
1974
+ return (
1975
+ <>
1976
+ <Button kind="default" {...triggerProps}>Trigger large warning modal</Button>
1977
+ <Modal {...modalProps} title="Foo" kind="warning" size="lg">
1978
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
1979
+ </Modal>
1980
+ </>
1981
+ )
1982
+ }
1983
+ `
1984
+ },
1985
+ xlarge: {
1986
+ description: "Extra Large",
1987
+ react: g`
1988
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
1989
+ import { sprinkles } from "@sps-woodland/tokens";
1990
+ import { Button } from "@sps-woodland/buttons";
1991
+
1992
+ function Component() {
1993
+
1994
+ const { modalProps, triggerProps, modalState } = useModal();
1995
+ return (
1996
+ <>
1997
+ <Button kind="default" {...triggerProps}>Trigger extra large warning modal</Button>
1998
+ <Modal {...modalProps} title="Foo" kind="warning" size="xl">
1999
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
2000
+ </Modal>
2001
+ </>
2002
+ )
2003
+ }
2004
+ `
2005
+ }
2006
+ }
2007
+ },
2008
+ form: {
2009
+ label: "Form",
2010
+ description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
2011
+ examples: {
2012
+ small: {
2013
+ description: "Small",
2014
+ react: g`
2015
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
2016
+ import { sprinkles } from "@sps-woodland/tokens";
2017
+ import { Button } from "@sps-woodland/buttons";
2018
+
2019
+ function Component() {
2020
+
2021
+ const { modalProps, triggerProps, modalState } = useModal();
2022
+
2023
+ return (
2024
+ <>
2025
+ <Button kind="default" {...triggerProps}>Trigger small form modal</Button>
2026
+ <Modal {...modalProps} title="Foo" kind="form" size="sm">
2027
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
2028
+ </Modal>
2029
+ </>
2030
+ )
2031
+ }
2032
+ `
2033
+ },
2034
+ medium: {
2035
+ description: "Medium",
2036
+ react: g`
2037
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
2038
+ import { sprinkles } from "@sps-woodland/tokens";
2039
+ import { Button } from "@sps-woodland/buttons";
2040
+
2041
+ function Component() {
2042
+ const { modalProps, triggerProps, modalState } = useModal();
2043
+
2044
+ return (
2045
+ <>
2046
+ <Button kind="default" {...triggerProps}>Trigger medium form modal</Button>
2047
+ <Modal {...modalProps} title="Foo" kind="form" size="md">
2048
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
2049
+ </Modal>
2050
+ </>
2051
+ )
2052
+ }
2053
+ `
2054
+ },
2055
+ large: {
2056
+ description: "Large",
2057
+ react: g`
2058
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
2059
+ import { sprinkles } from "@sps-woodland/tokens";
2060
+ import { Button } from "@sps-woodland/buttons";
2061
+
2062
+ function Component() {
2063
+
2064
+ const { modalProps, triggerProps, modalState } = useModal();
2065
+
2066
+ return (
2067
+ <>
2068
+ <Button kind="default" {...triggerProps}>Trigger large form modal</Button>
2069
+ <Modal {...modalProps} title="Foo" kind="form" size="lg">
2070
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
2071
+ </Modal>
2072
+ </>
2073
+ )
2074
+ }
2075
+ `
2076
+ },
2077
+ xlarge: {
2078
+ description: "Extra Large",
2079
+ react: g`
2080
+ import { Modal, ModalFooter } from "@sps-woodland/modal";
2081
+ import { sprinkles } from "@sps-woodland/tokens";
2082
+ import { Button } from "@sps-woodland/buttons";
2083
+
2084
+ function Component() {
2085
+
2086
+ const { modalProps, triggerProps, modalState } = useModal();
2087
+ return (
2088
+ <>
2089
+ <Button kind="default" {...triggerProps}>Trigger extra largeform modal</Button>
2090
+ <Modal {...modalProps} title="Foo" kind="form" size="xl">
2091
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
2092
+ </Modal>
2093
+ </>
2094
+ )
2095
+ }
2096
+ `
2097
+ }
2098
+ }
2099
+ }
2100
+ }
2101
+ }, Fo = {
2102
+ Modals: Eo
2103
+ };
2104
+ export {
2105
+ Fo as MANIFEST,
2106
+ Ke as Modal,
2107
+ Ve as ModalFooter,
2108
+ Le as ModalIcons,
2109
+ xo as useModal
2110
+ };