@vokril/ui-solid 0.40.0 → 0.42.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +20 -0
  3. package/dist/{CommandPalette-1XfwrR2D.js → CommandPalette-beMCOs7C.js} +774 -786
  4. package/dist/CommandPalette-pFMPK8bt.cjs +2 -0
  5. package/dist/{DateRangePicker-DL1j6ww5.js → DateRangePicker-CYaHRpmb.js} +1 -1
  6. package/dist/{DateRangePicker-CZddrCVN.cjs → DateRangePicker-DBXYlp78.cjs} +1 -1
  7. package/dist/{GuidedTour-DzmN3Cfq.js → GuidedTour-5MdUy_iV.js} +1 -1
  8. package/dist/{GuidedTour-BxmPJE-B.cjs → GuidedTour-BofbTVvV.cjs} +1 -1
  9. package/dist/{IconPicker-BuQkoRRB.js → IconPicker-BaKZkh0b.js} +1 -1
  10. package/dist/{IconPicker-xydEBrKw.cjs → IconPicker-DkRBxRGe.cjs} +1 -1
  11. package/dist/Modal-BNQB6QJ7.cjs +1 -0
  12. package/dist/Modal-py2JXnwO.js +968 -0
  13. package/dist/{StatusBarNotificationBell-BIg-eu1Y.cjs → StatusBarNotificationBell-BY9ZiWjy.cjs} +1 -1
  14. package/dist/{StatusBarNotificationBell-DvKKK9jh.js → StatusBarNotificationBell-DZvIOWcY.js} +4 -4
  15. package/dist/{ToggleButton-CrVTb5ZP.js → ToggleButton-B2gPFNtU.js} +2 -2
  16. package/dist/{ToggleButton-sXKMeceC.cjs → ToggleButton-DSdpOk_r.cjs} +1 -1
  17. package/dist/{createDialogShellFocus-CLuQ1s0l.cjs → createDialogShellFocus--i_cKUN4.cjs} +1 -1
  18. package/dist/{createDialogShellFocus-GXYQh0Oh.js → createDialogShellFocus-CRX-Qo81.js} +1 -1
  19. package/dist/{createResizableSidebar-Beu5DVYW.cjs → createResizableSidebar-BEQGesE5.cjs} +1 -1
  20. package/dist/{createResizableSidebar-BGseZrMh.js → createResizableSidebar-XihHxIXV.js} +2 -2
  21. package/dist/forms/index.cjs +1 -1
  22. package/dist/forms/index.js +4 -4
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +12 -12
  25. package/dist/layout/index.cjs +1 -1
  26. package/dist/layout/index.js +1 -1
  27. package/dist/notifications/index.cjs +1 -1
  28. package/dist/notifications/index.js +1 -1
  29. package/dist/overlay/Modal.d.cts +33 -0
  30. package/dist/overlay/Modal.d.ts +33 -0
  31. package/dist/overlay/index.cjs +1 -1
  32. package/dist/overlay/index.js +4 -4
  33. package/dist/overlay/modalDefaults.d.cts +5 -0
  34. package/dist/overlay/modalDefaults.d.ts +5 -0
  35. package/dist/overlay/modalResize.d.cts +50 -0
  36. package/dist/overlay/modalResize.d.ts +50 -0
  37. package/dist/server/{CommandPalette-DorJXXoB.js → CommandPalette-CW5Dp8vj.js} +2 -2
  38. package/dist/server/{CommandPalette-BMwxv_Yy.cjs → CommandPalette-Cr75unDS.cjs} +1 -1
  39. package/dist/server/{GuidedTour-DhVy485y.js → GuidedTour-Bx6CdHjo.js} +1 -1
  40. package/dist/server/{GuidedTour-JPHl9qAv.cjs → GuidedTour-DL7UpS21.cjs} +1 -1
  41. package/dist/server/{IconPicker-bUaMtcMV.js → IconPicker-B2jFVCPZ.js} +2 -2
  42. package/dist/server/{IconPicker-Xb9VX3Lk.cjs → IconPicker-DMnle5yy.cjs} +1 -1
  43. package/dist/server/Modal-B-3XihcF.js +771 -0
  44. package/dist/server/Modal-OLsSdDmR.cjs +1 -0
  45. package/dist/server/{StatusBarNotificationBell-DzrBLG0C.js → StatusBarNotificationBell-B0cK_tTc.js} +2 -2
  46. package/dist/server/{StatusBarNotificationBell-CyNRKMtb.cjs → StatusBarNotificationBell-CtTPByqN.cjs} +1 -1
  47. package/dist/server/{ToggleButton-J-cKrSwa.cjs → ToggleButton-93fdaf-H.cjs} +1 -1
  48. package/dist/server/{ToggleButton-BTKq5h-y.js → ToggleButton-DqNqIAC0.js} +2 -2
  49. package/dist/server/{createResizableSidebar-ClRpRZLh.js → createResizableSidebar-CphNgnrU.js} +2 -2
  50. package/dist/server/{createResizableSidebar-Bukt4w81.cjs → createResizableSidebar-D5mkTix1.cjs} +1 -1
  51. package/dist/server/forms/index.cjs +1 -1
  52. package/dist/server/forms/index.js +2 -2
  53. package/dist/server/{index-CxpRbGi3.cjs → index-DDkjaG5W.cjs} +1 -1
  54. package/dist/server/{index-BglF6V2r.js → index-cgjP4BDD.js} +2 -2
  55. package/dist/server/index.cjs +1 -1
  56. package/dist/server/index.js +8 -8
  57. package/dist/server/layout/index.cjs +1 -1
  58. package/dist/server/layout/index.js +1 -1
  59. package/dist/server/notifications/index.cjs +1 -1
  60. package/dist/server/notifications/index.js +1 -1
  61. package/dist/server/overlay/index.cjs +1 -1
  62. package/dist/server/overlay/index.js +3 -3
  63. package/dist/solid/overlay/Modal.jsx +168 -7
  64. package/dist/solid/overlay/Modal.module.css.js +12 -1
  65. package/dist/solid/overlay/modalResize.js +49 -0
  66. package/dist/style.css +1 -1
  67. package/dist/ui.css +1 -1
  68. package/package.json +1 -1
  69. package/dist/CommandPalette-DgoP-6h9.cjs +0 -2
  70. package/dist/Modal-DospFxAr.js +0 -771
  71. package/dist/Modal-Dq7OTcoz.cjs +0 -1
  72. package/dist/server/Modal-CL3mMf3_.js +0 -666
  73. package/dist/server/Modal-J5LcYq9z.cjs +0 -1
@@ -0,0 +1,771 @@
1
+ import { ssr as k, ssrAttribute as m, escape as t, createComponent as d, ssrStyle as de, memo as ce, Portal as Je } from "solid-js/web";
2
+ import { createSignal as $, createUniqueId as ee, createMemo as B, createEffect as Me, onCleanup as V, Show as L, onMount as J, untrack as et, For as tt } from "solid-js";
3
+ import { O as ot } from "./Input-D128drd7.js";
4
+ import { b as ae, g as nt } from "./window-CUK6x8Pj.js";
5
+ import { K as it, c as at } from "./mainRealmDom-D514acmj.js";
6
+ import { o as lt } from "./ownerWindow-9mx_LD47.js";
7
+ import { c as $e } from "./errorHandler-BvPGW-Nm.js";
8
+ import { i as Ce } from "./keys-B2nlkpqc.js";
9
+ import { p as rt, n as st } from "./prefersReducedMotion-qcGrKv14.js";
10
+ import { a as dt } from "./kitHost-BMMWpU4w.js";
11
+ import { B as le } from "./Button-BHfCFxcX.js";
12
+ import { O as ct } from "./OverlayScrollArea-h6G3yk6U.js";
13
+ import { t as S } from "./i18n-DlGM3NSR.js";
14
+ import { u as mt, h as ut } from "./overlayStack-Bj6Lg1Rm.js";
15
+ import { r as ht } from "./Popover-e9JpRh11.js";
16
+ import { c as me } from "./base-BLohC_tW.js";
17
+ import { V as gt } from "./VpClose-1RAQ20H9.js";
18
+ const ft = 350, Qo = 0, ze = 300, vt = 6, pt = 8;
19
+ function Zo(e) {
20
+ const { anchorRect: n, tooltipSize: o, viewport: s } = e, h = e.offset ?? vt, r = e.margin ?? pt, p = e.placement ?? "bottom", f = "bottom" in n && n.bottom !== void 0 ? n.bottom : n.top + n.height, l = "right" in n && n.right !== void 0 ? n.right : n.left + n.width;
21
+ let x = p, C = 0, H = 0;
22
+ if (p === "top" || p === "bottom") {
23
+ if (p === "top") {
24
+ const y = n.top - h - o.height;
25
+ y < r && f + h + o.height <= s.height - r ? (x = "bottom", C = f + h) : C = Math.max(
26
+ r,
27
+ Math.min(y, s.height - o.height - r)
28
+ );
29
+ } else {
30
+ const y = f + h;
31
+ y + o.height > s.height - r && n.top - h - o.height >= r ? (x = "top", C = n.top - h - o.height) : C = Math.max(
32
+ r,
33
+ Math.min(y, s.height - o.height - r)
34
+ );
35
+ }
36
+ const v = n.left + (n.width - o.width) / 2, F = Math.max(
37
+ r,
38
+ s.width - o.width - r
39
+ );
40
+ H = Math.max(r, Math.min(v, F));
41
+ } else {
42
+ if (p === "left") {
43
+ const y = n.left - h - o.width;
44
+ y < r && l + h + o.width <= s.width - r ? (x = "right", H = l + h) : H = Math.max(
45
+ r,
46
+ Math.min(y, s.width - o.width - r)
47
+ );
48
+ } else {
49
+ const y = l + h;
50
+ y + o.width > s.width - r && n.left - h - o.width >= r ? (x = "left", H = n.left - h - o.width) : H = Math.max(
51
+ r,
52
+ Math.min(y, s.width - o.width - r)
53
+ );
54
+ }
55
+ const v = n.top + (n.height - o.height) / 2, F = Math.max(
56
+ r,
57
+ s.height - o.height - r
58
+ );
59
+ C = Math.max(r, Math.min(v, F));
60
+ }
61
+ return { top: C, left: H, placement: x };
62
+ }
63
+ function wt() {
64
+ const [e, n] = $(null);
65
+ let o = !1, s = null, h, r, p = null;
66
+ const f = () => {
67
+ h !== void 0 && (clearTimeout(h), h = void 0);
68
+ }, l = () => {
69
+ r !== void 0 && (clearTimeout(r), r = void 0);
70
+ }, x = () => {
71
+ if (p) {
72
+ try {
73
+ p();
74
+ } catch (i) {
75
+ $e(
76
+ "Window context may already be destroyed or unloaded",
77
+ i
78
+ );
79
+ }
80
+ p = null;
81
+ }
82
+ }, C = (i) => {
83
+ x();
84
+ const c = () => {
85
+ v();
86
+ }, E = (N) => {
87
+ Ce(N, "Escape") && e() !== null && (N.stopPropagation(), N.stopImmediatePropagation(), v());
88
+ };
89
+ i.addEventListener("scroll", c, !0), i.addEventListener("pointerdown", c, !0), i.addEventListener("keydown", E, !0), i.addEventListener("blur", c), p = () => {
90
+ i.removeEventListener("scroll", c, !0), i.removeEventListener("pointerdown", c, !0), i.removeEventListener("keydown", E, !0), i.removeEventListener("blur", c);
91
+ };
92
+ }, H = (i) => {
93
+ f(), l(), s = null, o = !0, n(i);
94
+ const c = lt(i.target);
95
+ if (c === null) {
96
+ x();
97
+ return;
98
+ }
99
+ C(c);
100
+ }, v = () => {
101
+ f(), l(), s = null, o = !1, n(null), x();
102
+ };
103
+ return {
104
+ activeTooltip: e,
105
+ isWarm: () => o,
106
+ showTooltip: (i) => {
107
+ if (!i.content || typeof i.content == "function" && !i.content())
108
+ return;
109
+ l();
110
+ const c = e();
111
+ if (!(c && (c.id === i.id || c.target === i.target)))
112
+ if (o || c !== null)
113
+ H(i);
114
+ else {
115
+ f(), s = i;
116
+ const E = i.delayMs ?? ft;
117
+ E <= 0 ? H(i) : h = setTimeout(() => {
118
+ s === i && H(i);
119
+ }, E);
120
+ }
121
+ },
122
+ hideTooltip: (i) => {
123
+ if (i !== void 0) {
124
+ s && (typeof i == "string" ? s.id === i : s.target === i) && (f(), s = null);
125
+ const c = e();
126
+ if (c) {
127
+ if (!(typeof i == "string" ? c.id === i : c.target === i))
128
+ return;
129
+ } else
130
+ return;
131
+ }
132
+ f(), s = null, n(null), x(), l(), r = setTimeout(() => {
133
+ o = !1, r = void 0;
134
+ }, ze);
135
+ },
136
+ dismissAll: v,
137
+ recordTooltipShown: () => {
138
+ l(), o = !0;
139
+ },
140
+ recordTooltipHidden: () => {
141
+ l(), r = setTimeout(() => {
142
+ o = !1, r = void 0;
143
+ }, ze);
144
+ }
145
+ };
146
+ }
147
+ const Le = wt();
148
+ var _t = '<path d="M9 4H4v5m0-5 6 6m5-6h5v5m0-5-6 6M4 15v5h5m-5 0 6-6m10 1v5h-5m5 0-6-6"></path>';
149
+ const bt = /* @__PURE__ */ me({
150
+ name: "VpArrowsMaximize",
151
+ a: {
152
+ fill: "none",
153
+ stroke: "currentColor",
154
+ "stroke-linecap": "round",
155
+ "stroke-linejoin": "round",
156
+ "stroke-width": "2",
157
+ viewBox: "0 0 24 24"
158
+ },
159
+ c: () => k(_t)
160
+ });
161
+ var xt = '<path d="M5 10h5V5m0 5L4 4m15 6h-5V5m0 5 6-6M5 14h5v5m0-5-6 6m15-6h-5v5m0-5 6 6"></path>';
162
+ const yt = /* @__PURE__ */ me({
163
+ name: "VpArrowsMinimize",
164
+ a: {
165
+ fill: "none",
166
+ stroke: "currentColor",
167
+ "stroke-linecap": "round",
168
+ "stroke-linejoin": "round",
169
+ "stroke-width": "2",
170
+ viewBox: "0 0 24 24"
171
+ },
172
+ c: () => k(xt)
173
+ });
174
+ var kt = '<path d="M11 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-6M15 3h6v6m0-6-9 9"></path>';
175
+ const Tt = /* @__PURE__ */ me({
176
+ name: "VpExternalLink",
177
+ a: {
178
+ fill: "none",
179
+ stroke: "currentColor",
180
+ "stroke-linecap": "round",
181
+ "stroke-linejoin": "round",
182
+ "stroke-width": "2",
183
+ viewBox: "0 0 24 24"
184
+ },
185
+ c: () => k(kt)
186
+ }), Et = "vk_trigger_--BjF", Mt = "vk_tooltip_eJQhN", zt = "vk_hostTooltip_vLrNc", Lt = "vk_tooltipInner_AyPkl", re = {
187
+ trigger: Et,
188
+ tooltip: Mt,
189
+ hostTooltip: zt,
190
+ tooltipInner: Lt
191
+ }, Dt = 12, De = 16, Y = 8, Ot = 620;
192
+ function Ht(e) {
193
+ const n = e.tooltipWidth ?? Ot, o = e.tooltipWidth === void 0 ? e.viewportWidth : e.viewportWidth - Y, s = Math.min(
194
+ e.pointerX + Dt,
195
+ o - n
196
+ ), h = Math.max(Y, s), r = e.pointerY + De, p = e.tooltipHeight ?? 0, f = e.viewportHeight === void 0 ? r : Math.max(
197
+ Y,
198
+ e.viewportHeight - p - Y
199
+ ), l = e.aboveY === void 0 ? r : e.aboveY - p - De, x = e.viewportHeight !== void 0 && r > f ? Math.max(Y, Math.min(l, f)) : Math.max(Y, Math.min(r, f));
200
+ return { left: h, top: x };
201
+ }
202
+ var $t = ["<span", ">", "</span>"], Ct = ["<div", "><span>", "</span>", "</div>"], Ft = ["<div", ' role="tooltip" style="', '">', "</div>"];
203
+ const At = 1e3;
204
+ function Jo(e) {
205
+ const n = ee(), [o, s] = $(!1), [h, r] = $({
206
+ x: 0,
207
+ y: 0
208
+ }), [p, f] = $(), [l, x] = $({
209
+ width: 0,
210
+ height: 0
211
+ }), [C, H] = $(!1);
212
+ let v, F;
213
+ const y = () => ae(v), I = B(() => e.content);
214
+ return B(() => e.delayMs ?? At), Me(() => {
215
+ Le.activeTooltip() && o() && s(!1);
216
+ }), Me(() => {
217
+ if (!o()) return;
218
+ const T = () => {
219
+ s(!1);
220
+ }, i = (E) => {
221
+ Ce(E, "Escape") && (E.stopPropagation(), E.stopImmediatePropagation(), s(!1), Le.dismissAll());
222
+ }, c = ae(v);
223
+ c.addEventListener("scroll", T, !0), c.addEventListener("resize", T), c.addEventListener("keydown", i, !0), V(() => {
224
+ c.removeEventListener("scroll", T, !0), c.removeEventListener("resize", T), c.removeEventListener("keydown", i, !0);
225
+ });
226
+ }), V(() => {
227
+ }), [k($t, m("class", t(re.trigger, !0), !1) + m("tabindex", C() ? t(void 0, !0) : 0, !1) + m("aria-describedby", o() ? t(n, !0) : t(void 0, !0), !1), t(e.children)), d(L, {
228
+ get when() {
229
+ return ce(() => !!o())() && I();
230
+ },
231
+ get children() {
232
+ return d(ot, {
233
+ type: "tooltip",
234
+ get mount() {
235
+ return ae(v).document.body;
236
+ },
237
+ element: () => F,
238
+ idPrefix: "hover-tooltip",
239
+ get children() {
240
+ return k(Ft, m("class", t(re.tooltip, !0), !1) + m("id", t(n, !0), !1), de((() => {
241
+ const T = p(), i = Ht({
242
+ pointerX: h().x,
243
+ pointerY: h().y,
244
+ viewportWidth: y().innerWidth,
245
+ viewportHeight: y().innerHeight,
246
+ tooltipWidth: l().width,
247
+ tooltipHeight: l().height,
248
+ ...T !== void 0 ? {
249
+ aboveY: T
250
+ } : {}
251
+ });
252
+ return {
253
+ top: `${i.top}px`,
254
+ left: `${i.left}px`
255
+ };
256
+ })()), t(d(L, {
257
+ get when() {
258
+ return e.shortcut;
259
+ },
260
+ get fallback() {
261
+ return I();
262
+ },
263
+ get children() {
264
+ return k(Ct, m("class", t(re.tooltipInner, !0), !1), t(I()), t(d(it, {
265
+ size: "xs",
266
+ get shortcut() {
267
+ return e.shortcut;
268
+ }
269
+ })));
270
+ }
271
+ })));
272
+ }
273
+ });
274
+ }
275
+ })];
276
+ }
277
+ const Wt = "2.875rem", Bt = "data-modal-titlebar-probe";
278
+ function It(e, n) {
279
+ const o = at("div");
280
+ o.setAttribute(Bt, ""), o.style.cssText = `position:absolute;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:var(--modal-maximize-inset, ${Wt})`, (n != null && n.isConnected ? n : e.body ?? e.documentElement).append(o);
281
+ try {
282
+ return o.getBoundingClientRect().height;
283
+ } finally {
284
+ o.remove();
285
+ }
286
+ }
287
+ const St = "vk_place_5Cs4j", Rt = "vk_placeLabel_ZwMrw", Pt = "vk_placeValue_EWbq8", X = {
288
+ place: St,
289
+ placeLabel: Rt,
290
+ placeValue: Pt
291
+ };
292
+ var Vt = ["<dl", " data-dangerous-place><dt", ">", "</dt><dd", ' data-place="connection">', "</dd>", "</dl>"], Nt = ["<dt", ">", "</dt>"], qt = ["<dd", ' data-place="database">', "</dd>"];
293
+ function Ut(e) {
294
+ return k(Vt, m("id", t(e.id, !0), !1) + m("class", t(X.place, !0), !1), m("class", t(X.placeLabel, !0), !1), t(S("Connection")), m("class", t(X.placeValue, !0), !1), t(e.place.connection), t(d(L, {
295
+ get when() {
296
+ return e.place.database;
297
+ },
298
+ children: (n) => [k(Nt, m("class", t(X.placeLabel, !0), !1), t(S("Database"))), k(qt, m("class", t(X.placeValue, !0), !1), t(n()))]
299
+ })));
300
+ }
301
+ const Yt = [
302
+ "n",
303
+ "s",
304
+ "e",
305
+ "w",
306
+ "ne",
307
+ "nw",
308
+ "se",
309
+ "sw"
310
+ ], Oe = { width: 360, height: 220 }, He = (e, n, o) => Math.min(Math.max(e, n), Math.max(n, o));
311
+ function jt(e) {
312
+ return Math.max(
313
+ e.minHeight,
314
+ e.viewportHeight - e.titlebar - e.gap
315
+ );
316
+ }
317
+ function Xt(e, n) {
318
+ return {
319
+ width: He(e.width, n.minWidth, n.viewportWidth),
320
+ height: He(e.height, n.minHeight, jt(n))
321
+ };
322
+ }
323
+ const Kt = "vk_modalOverlay_53kKZ", Gt = "vk_modalBackdropFadeIn_5IQ--", Qt = "vk_modalOverlayExiting_x-xU-", Zt = "vk_modalBackdropFadeOut_PWo4M", Jt = "vk_modal_ZqkLW", eo = "vk_modalEntering_hQj2V", to = "vk_modalEntranceScaleUp_Kyv3p", oo = "vk_modalExiting_qiJ02", no = "vk_modalExitScaleDown_-CC8F", io = "vk_modalDragged_tiDIq", ao = "vk_resizeHandle_b3UDa", lo = "vk_modalNudge_8ldIg", ro = "vk_modalOverlayMaximized_00k68", so = "vk_modalMaximized_iL0gq", co = "vk_modalOverlayEmbedded_kz22G", mo = "vk_modalEmbedded_uaq4K", uo = "vk_modalHeader_fiwar", ho = "vk_modalFooter_PqFE4", go = "vk_modalBodyScroll_XIHnt", fo = "vk_modalHeaderDraggable_XVN7l", vo = "vk_modalHeaderDragging_AfuEb", po = "vk_modalTitle_jdWEj vk_titleLg_Iswm3", wo = "vk_modalTitleWrap_IW3-y", _o = "vk_modalTitleContent_x5Np7", bo = "vk_modalSubtitle_Is6W0", xo = "vk_modalPlace_3FEgX", yo = "vk_modalHeaderActions_uUFCL", ko = "vk_modalBody_EJ4Kr", To = "vk_modalBodyFlush_6Q0bW", u = {
324
+ modalOverlay: Kt,
325
+ modalBackdropFadeIn: Gt,
326
+ modalOverlayExiting: Qt,
327
+ modalBackdropFadeOut: Zt,
328
+ modal: Jt,
329
+ modalEntering: eo,
330
+ modalEntranceScaleUp: to,
331
+ modalExiting: oo,
332
+ modalExitScaleDown: no,
333
+ modalDragged: io,
334
+ resizeHandle: ao,
335
+ "resize-n": "vk_resize-n_mlVNh",
336
+ "resize-s": "vk_resize-s_02Egl",
337
+ "resize-e": "vk_resize-e_RGQAF",
338
+ "resize-w": "vk_resize-w_F3NAn",
339
+ "resize-ne": "vk_resize-ne_-goHY",
340
+ "resize-nw": "vk_resize-nw_20bHL",
341
+ "resize-se": "vk_resize-se_q2Qtb",
342
+ "resize-sw": "vk_resize-sw_n7kou",
343
+ modalNudge: lo,
344
+ modalOverlayMaximized: ro,
345
+ modalMaximized: so,
346
+ modalOverlayEmbedded: co,
347
+ modalEmbedded: mo,
348
+ modalHeader: uo,
349
+ modalFooter: ho,
350
+ modalBodyScroll: go,
351
+ modalHeaderDraggable: fo,
352
+ modalHeaderDragging: vo,
353
+ modalTitle: po,
354
+ modalTitleWrap: wo,
355
+ modalTitleContent: _o,
356
+ modalSubtitle: bo,
357
+ modalPlace: xo,
358
+ modalHeaderActions: yo,
359
+ modalBody: ko,
360
+ modalBodyFlush: To
361
+ };
362
+ var Eo = ["<h3", ">", "</h3>"], Mo = ["<p", ">", "</p>"], zo = ["<div", " data-modal-body-flush>", "</div>"], se = ["<div", ">", "</div>"], Lo = ['<div class="', '" style="', '" tabindex="-1">', '<div class="', '" style="', '" role="dialog" aria-modal="true"', ' tabindex="-1"><div class="', '"><div', ">", "", "</div><div", ">", "", "", "", "</div></div>", "", "", "", "</div></div>"], Do = ['<div class="', '"', ' aria-hidden="true"></div>'];
363
+ function en(e) {
364
+ const n = dt(), o = B(() => !!e.embedded), s = B(() => !!e.closeDisabled);
365
+ B(() => e.backdropDismiss ?? "close");
366
+ const h = B(() => e.canClose), r = B(() => !o() && (e.resizable ?? n.resizable ?? !0)), p = B((w) => o() || !e.open() ? null : w ?? e.hostDocument ?? nt().document, null);
367
+ let f = null, l = null;
368
+ const x = () => l != null && l.isConnected ? l.ownerDocument : p(), C = mt(() => !o() && e.open(), "modal", {
369
+ type: "modal",
370
+ element: () => l != null && l.isConnected ? l : null,
371
+ document: () => p() ?? void 0
372
+ }), H = () => {
373
+ if (!o()) return C.isTopmost();
374
+ const w = x();
375
+ return w !== null && !ut(w);
376
+ };
377
+ let v, F = !1;
378
+ const y = () => {
379
+ const w = h();
380
+ if (w === void 0) {
381
+ v == null || v();
382
+ return;
383
+ }
384
+ if (F || s()) return;
385
+ F = !0;
386
+ const M = (A) => {
387
+ F = !1, A && (v == null || v());
388
+ };
389
+ let q;
390
+ try {
391
+ q = w();
392
+ } catch (A) {
393
+ throw F = !1, A;
394
+ }
395
+ typeof q == "boolean" ? M(q) : q.then(M, (A) => {
396
+ F = !1, $e("modal close guard rejected", A);
397
+ });
398
+ };
399
+ let I = null, T = null;
400
+ const i = () => {
401
+ o() || l === null || (I = st(l));
402
+ }, c = () => {
403
+ var w, M;
404
+ I == null || I(), I = null, f != null && f.isConnected && typeof f.focus == "function" && f.focus(), e.focusFallback && T !== null && T.activeElement !== f && ((w = e.focusFallback()) == null || w.focus()), e.focusFallback && T !== null && T.activeElement === T.body && ((M = e.focusFallback()) == null || M.focus()), f = null, T = null, l = null;
405
+ }, E = ee(), N = ee(), ue = ee(), Fe = () => {
406
+ const w = [...e.subtitle ? [N] : [], ...e.place ? [ue] : []];
407
+ return w.length > 0 ? w.join(" ") : void 0;
408
+ }, he = () => {
409
+ var xe, ye;
410
+ J(i), V(c), J(() => {
411
+ var g;
412
+ const a = (g = x()) == null ? void 0 : g.defaultView;
413
+ if (!a) return;
414
+ const _ = () => {
415
+ H();
416
+ };
417
+ a.addEventListener("mousedown", _, !0), V(() => a.removeEventListener("mousedown", _, !0));
418
+ });
419
+ const w = () => {
420
+ const a = x();
421
+ return a !== null && rt(a);
422
+ }, [M, q] = $(!1);
423
+ let A, te = !1, ge = !1;
424
+ const fe = () => {
425
+ ge || !te || (ge = !0, A !== void 0 && clearTimeout(A), A = void 0, e.onClose());
426
+ };
427
+ v = () => {
428
+ if (!(s() || te)) {
429
+ if (te = !0, we(), K(), o() || w()) {
430
+ fe();
431
+ return;
432
+ }
433
+ q(!0), A = setTimeout(fe, 120);
434
+ }
435
+ }, V(() => {
436
+ v = void 0, A !== void 0 && clearTimeout(A);
437
+ });
438
+ const [oe, Ae] = $(!o() && !w());
439
+ let P;
440
+ const K = () => {
441
+ P !== void 0 && (clearTimeout(P), P = void 0), oe() && Ae(!1);
442
+ };
443
+ J(() => {
444
+ oe() && (P = setTimeout(K, 200));
445
+ }), V(() => {
446
+ P !== void 0 && (clearTimeout(P), P = void 0);
447
+ });
448
+ const [z, We] = $(!1), [G, ve] = $({
449
+ x: 0,
450
+ y: 0
451
+ }), [pe, Oo] = $(!1), [Be, Ho] = $(!1), [j, Ie] = $(et(() => e.initialSize) ?? null), ne = B(() => !o() && (e.allowMaximize ?? !0)), Se = B(() => !o() && !M() && !z() && (e.allowDrag ?? !0)), Re = B(() => !o() && !M() && z() && ne() && (e.allowDrag ?? !0) && (e.allowMaximizedDrag ?? n.allowMaximizedDrag ?? !0));
452
+ let Q = null;
453
+ const we = () => {
454
+ Q == null || Q(), Q = null;
455
+ }, Pe = () => {
456
+ if (!ne() || s() || M()) return;
457
+ K();
458
+ const a = z(), _ = typeof (l == null ? void 0 : l.animate) == "function" && !w(), g = _ && l ? l.getBoundingClientRect() : null;
459
+ if (We(!a), _ && l && g && g.width > 0 && g.height > 0) {
460
+ const D = l;
461
+ ht(D, () => {
462
+ if (l !== D || M()) return;
463
+ const b = D.getBoundingClientRect();
464
+ if (b.width > 0 && b.height > 0) {
465
+ const O = g.left - b.left, W = g.top - b.top, U = g.width / b.width, R = g.height / b.height;
466
+ D.animate([{
467
+ transformOrigin: "top left",
468
+ transform: `translate(${O}px, ${W}px) scale(${U}, ${R})`,
469
+ borderRadius: a ? "0px" : "var(--radius-xl)"
470
+ }, {
471
+ transformOrigin: "top left",
472
+ transform: "translate(0px, 0px) scale(1, 1)",
473
+ borderRadius: a ? "var(--radius-xl)" : "0px"
474
+ }], {
475
+ duration: a ? 240 : 280,
476
+ easing: "cubic-bezier(0.16, 1, 0.3, 1)",
477
+ fill: "none"
478
+ });
479
+ }
480
+ });
481
+ }
482
+ if (a && l) {
483
+ const D = l;
484
+ queueMicrotask(() => {
485
+ if (l !== D || z() || M()) return;
486
+ const b = D.ownerDocument.defaultView;
487
+ if (b === null) return;
488
+ const O = G(), W = D.getBoundingClientRect(), U = {
489
+ left: W.left - O.x,
490
+ top: W.top - O.y,
491
+ width: W.width,
492
+ height: W.height
493
+ };
494
+ ve(_e(O.x, O.y, U, b, 44, ie(b)));
495
+ });
496
+ }
497
+ }, ie = (a) => It(a.document, void 0), _e = (a, _, g, D, b, O) => {
498
+ const W = D.innerWidth, U = D.innerHeight, R = g.width > 0 ? g.width : 500, ke = g.width > 0 ? g.left : (W - R) / 2, Te = g.height > 0 ? g.top : O + 16, Ue = b, Ye = Math.min(0, W - R), je = Math.max(0, W - R), Xe = ke + a, Ke = Math.min(Math.max(Xe, Ye), je) - ke, Ee = O, Ge = Math.max(Ee, U - Ue), Qe = Te + _, Ze = Math.min(Math.max(Qe, Ee), Ge) - Te;
499
+ return {
500
+ x: Ke,
501
+ y: Ze
502
+ };
503
+ }, Ve = B(() => r() && !M() && !z()), Ne = (a) => {
504
+ const _ = Number.parseFloat(a.getComputedStyle(a.document.documentElement).fontSize);
505
+ return {
506
+ minWidth: Oe.width,
507
+ minHeight: Oe.height,
508
+ viewportWidth: a.innerWidth,
509
+ viewportHeight: a.innerHeight,
510
+ titlebar: ie(a),
511
+ // The stylesheet's `max-height` leaves 2rem under the title bar and at the bottom.
512
+ gap: 2 * (Number.isFinite(_) ? _ : 16)
513
+ };
514
+ }, be = (a) => {
515
+ const _ = j();
516
+ if (_ === null) return;
517
+ const g = Xt(_, Ne(a));
518
+ (g.width !== _.width || g.height !== _.height) && Ie(g);
519
+ };
520
+ let Z = null;
521
+ const qe = () => {
522
+ Z == null || Z(), Z = null;
523
+ };
524
+ return J(() => {
525
+ var D;
526
+ const a = (D = x()) == null ? void 0 : D.defaultView;
527
+ if (!a) return;
528
+ o() || be(a);
529
+ const _ = () => {
530
+ if (z() || M() || o() || !l) return;
531
+ K(), be(a);
532
+ const b = G(), O = l.getBoundingClientRect(), W = {
533
+ left: O.left - b.x,
534
+ top: O.top - b.y,
535
+ width: O.width,
536
+ height: O.height
537
+ }, R = _e(b.x, b.y, W, a, 44, ie(a));
538
+ (R.x !== b.x || R.y !== b.y) && ve(R);
539
+ };
540
+ a.addEventListener("resize", _);
541
+ const g = new MutationObserver(_);
542
+ g.observe(a.document.documentElement, {
543
+ attributes: !0,
544
+ attributeFilter: ["style", "class"]
545
+ }), V(() => {
546
+ a.removeEventListener("resize", _), g.disconnect(), we(), qe();
547
+ });
548
+ }), k(Lo, `${o() ? t(u.modalOverlayEmbedded, !0) : t(u.modalOverlay, !0)} ${z() ? t(u.modalOverlayMaximized, !0) : ""} ${M() ? t(u.modalOverlayExiting, !0) : ""}`, de({
549
+ ...e.transparentBackdrop ? {
550
+ background: "transparent"
551
+ } : {},
552
+ ...e.maximizeInset !== void 0 ? {
553
+ "--modal-maximize-inset": e.maximizeInset
554
+ } : {}
555
+ }), t(e.decoration), `${t(u.modal, !0)} ${o() ? t(u.modalEmbedded, !0) : ""} ${oe() && !M() ? t(u.modalEntering, !0) : ""} ${z() ? t(u.modalMaximized, !0) : ""} ${pe() || Be() ? t(u.modalDragged, !0) : ""} ${M() ? t(u.modalExiting, !0) : ""}`, de({
556
+ ...o() ? void 0 : {
557
+ "max-width": z() ? "100%" : j() !== null ? "none" : e.maxWidth ?? "32rem"
558
+ },
559
+ ...o() || z() || j() === null ? void 0 : {
560
+ width: `${((xe = j()) == null ? void 0 : xe.width) ?? 0}px`,
561
+ height: `${((ye = j()) == null ? void 0 : ye.height) ?? 0}px`
562
+ },
563
+ ...e.dialogStyle,
564
+ "--modal-drag-x": `${z() || o() ? 0 : G().x}px`,
565
+ "--modal-drag-y": `${z() || o() ? 0 : G().y}px`
566
+ }), m("aria-labelledby", t(E, !0), !1) + m("aria-describedby", t(Fe(), !0), !1), `${t(u.modalHeader, !0)} ${// A header that drags the modal — restored, or maximized and pullable off the top — is a drag handle:
567
+ // the grab cursor, and `touch-action: none` so a touch pointer drags it instead of panning the page.
568
+ Se() || Re() ? pe() ? t(u.modalHeaderDragging, !0) : t(u.modalHeaderDraggable, !0) : ""}`, m("class", t(u.modalTitleWrap, !0), !1), t(d(L, {
569
+ get when() {
570
+ return typeof e.title == "string";
571
+ },
572
+ get fallback() {
573
+ return k(se, m("id", t(E, !0), !1) + m("class", t(u.modalTitleContent, !0), !1), t(e.title));
574
+ },
575
+ get children() {
576
+ return k(Eo, m("id", t(E, !0), !1) + m("class", t(u.modalTitle, !0), !1), t(e.title));
577
+ }
578
+ })), t(d(L, {
579
+ get when() {
580
+ return e.subtitle;
581
+ },
582
+ get children() {
583
+ return k(Mo, m("id", t(N, !0), !1) + m("class", t(u.modalSubtitle, !0), !1), t(e.subtitle));
584
+ }
585
+ })), m("class", t(u.modalHeaderActions, !0), !1), t(e.headerActions), t(d(L, {
586
+ get when() {
587
+ return e.onDetach;
588
+ },
589
+ get children() {
590
+ return d(le, {
591
+ size: "sm",
592
+ variant: "ghost",
593
+ iconOnly: !0,
594
+ onClick: () => {
595
+ var a;
596
+ return (a = e.onDetach) == null ? void 0 : a.call(e);
597
+ },
598
+ get disabled() {
599
+ return s();
600
+ },
601
+ get title() {
602
+ return S("Open in new window");
603
+ },
604
+ get "aria-label"() {
605
+ return S("Open in new window");
606
+ },
607
+ get children() {
608
+ return d(Tt, {});
609
+ }
610
+ });
611
+ }
612
+ })), t(d(L, {
613
+ get when() {
614
+ return ne();
615
+ },
616
+ get children() {
617
+ return d(le, {
618
+ size: "sm",
619
+ variant: "ghost",
620
+ iconOnly: !0,
621
+ onClick: Pe,
622
+ get disabled() {
623
+ return s();
624
+ },
625
+ get title() {
626
+ return ce(() => !!z())() ? S("Restore") : S("Maximize");
627
+ },
628
+ get "aria-label"() {
629
+ return ce(() => !!z())() ? S("Restore") : S("Maximize");
630
+ },
631
+ get children() {
632
+ return d(L, {
633
+ get when() {
634
+ return z();
635
+ },
636
+ get fallback() {
637
+ return d(bt, {});
638
+ },
639
+ get children() {
640
+ return d(yt, {});
641
+ }
642
+ });
643
+ }
644
+ });
645
+ }
646
+ })), t(d(L, {
647
+ get when() {
648
+ return !e.hideClose;
649
+ },
650
+ get children() {
651
+ return d(le, {
652
+ size: "sm",
653
+ variant: "ghost",
654
+ iconOnly: !0,
655
+ onClick: y,
656
+ get disabled() {
657
+ return s();
658
+ },
659
+ get title() {
660
+ return S("Close");
661
+ },
662
+ get "aria-label"() {
663
+ return S("Close");
664
+ },
665
+ get children() {
666
+ return d(gt, {});
667
+ }
668
+ });
669
+ }
670
+ })), t(d(L, {
671
+ get when() {
672
+ return e.place;
673
+ },
674
+ children: (a) => k(se, m("class", t(u.modalPlace, !0), !1), t(d(Ut, {
675
+ id: ue,
676
+ get place() {
677
+ return a();
678
+ }
679
+ })))
680
+ })), t(d(L, {
681
+ get when() {
682
+ return e.flush;
683
+ },
684
+ get fallback() {
685
+ return d(ct, {
686
+ get rootClass() {
687
+ return u.modalBodyScroll;
688
+ },
689
+ get viewportClass() {
690
+ return u.modalBody;
691
+ },
692
+ get children() {
693
+ return e.children;
694
+ }
695
+ });
696
+ },
697
+ get children() {
698
+ return k(zo, m("class", t(u.modalBodyFlush, !0), !1), t(e.children));
699
+ }
700
+ })), t(d(L, {
701
+ get when() {
702
+ return e.footer;
703
+ },
704
+ get children() {
705
+ return k(se, m("class", t(u.modalFooter, !0), !1), t(e.footer));
706
+ }
707
+ })), t(d(L, {
708
+ get when() {
709
+ return Ve();
710
+ },
711
+ get children() {
712
+ return d(tt, {
713
+ each: Yt,
714
+ children: (a) => k(Do, `${t(u.resizeHandle, !0)} ${t(u[`resize-${a}`], !0)}`, m("data-resize-edge", t(a, !0), !1))
715
+ });
716
+ }
717
+ })));
718
+ };
719
+ return (
720
+ // Embedded fills its aux-window container 1:1 — render in place. The overlay path
721
+ // portals to the body of the document it opened in (reference: the active container
722
+ // at show time), so a modal triggered while a detached / aux window is focused covers
723
+ // THAT window, not main.
724
+ d(L, {
725
+ get when() {
726
+ return !o();
727
+ },
728
+ get fallback() {
729
+ return he();
730
+ },
731
+ get children() {
732
+ return d(L, {
733
+ get when() {
734
+ return p();
735
+ },
736
+ children: (w) => d(Je, {
737
+ get mount() {
738
+ return w().body;
739
+ },
740
+ get children() {
741
+ return he();
742
+ }
743
+ })
744
+ });
745
+ }
746
+ })
747
+ );
748
+ }
749
+ export {
750
+ Ut as A,
751
+ ft as C,
752
+ pt as D,
753
+ Jo as H,
754
+ en as M,
755
+ Dt as T,
756
+ yt as V,
757
+ Qo as W,
758
+ ze as a,
759
+ vt as b,
760
+ De as c,
761
+ Ot as d,
762
+ Y as e,
763
+ Zo as f,
764
+ Ht as g,
765
+ wt as h,
766
+ bt as i,
767
+ Tt as j,
768
+ It as m,
769
+ re as s,
770
+ Le as t
771
+ };