@editora/ui-react 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/AlertDialogProvider.cjs.js +1 -1
- package/dist/AlertDialogProvider.esm.js +1 -1
- package/dist/DialogProvider.cjs.js +1 -1
- package/dist/DialogProvider.esm.js +1 -1
- package/dist/Icon.cjs.js +1 -1
- package/dist/Icon.esm.js +40 -38
- package/dist/SplitButton.cjs.js +396 -1
- package/dist/SplitButton.esm.js +658 -49
- package/dist/ThemeProvider.cjs.js +1 -1
- package/dist/ThemeProvider.esm.js +4 -4
- package/dist/components/AlertDialogProvider.cjs.js +1 -1
- package/dist/components/AlertDialogProvider.esm.js +1 -1
- package/dist/components/DialogProvider.cjs.js +1 -1
- package/dist/components/DialogProvider.esm.js +1 -1
- package/dist/components/Icon.d.ts +2 -0
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/SplitButton.cjs.js +1 -1
- package/dist/components/SplitButton.d.ts +4 -2
- package/dist/components/SplitButton.d.ts.map +1 -1
- package/dist/components/SplitButton.esm.js +3 -2
- package/dist/components/ThemeProvider.cjs.js +1 -1
- package/dist/components/ThemeProvider.esm.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +344 -327
- package/dist/{runtime-3cc1c386-b4118dbe.mjs → runtime-4ac0107b-3a3f8a32.mjs} +230 -248
- package/dist/runtime-4ac0107b-b526ae0d.js +1 -0
- package/package.json +1 -1
- package/dist/runtime-3cc1c386-9d1b191c.js +0 -1
|
@@ -1,74 +1,57 @@
|
|
|
1
|
-
function te(e, a, i = "top") {
|
|
2
|
-
const o = typeof i == "string" ? { placement: i } : i, n = o.placement || "top", r = typeof o.offset == "number" ? o.offset : 8, f = !!o.shift, d = e.getBoundingClientRect(), s = a.getBoundingClientRect();
|
|
3
|
-
let p = 0, x = 0;
|
|
4
|
-
n === "top" ? (p = d.top - s.height - r, x = d.left + (d.width - s.width) / 2) : n === "bottom" ? (p = d.bottom + r, x = d.left + (d.width - s.width) / 2) : n === "left" ? (p = d.top + (d.height - s.height) / 2, x = d.left - s.width - r) : (p = d.top + (d.height - s.height) / 2, x = d.right + r);
|
|
5
|
-
const m = d.left + d.width / 2, b = d.top + d.height / 2, y = Math.round(m - x), w = Math.round(b - p);
|
|
6
|
-
if (f) {
|
|
7
|
-
const k = window.innerWidth || document.documentElement.clientWidth, _ = window.innerHeight || document.documentElement.clientHeight;
|
|
8
|
-
if (n === "top" || n === "bottom") {
|
|
9
|
-
const v = k - s.width - 4;
|
|
10
|
-
x < 4 && (x = Math.min(v, x + (4 - x))), x > v && (x = Math.max(4, x - (x - v)));
|
|
11
|
-
} else {
|
|
12
|
-
const v = _ - s.height - 4;
|
|
13
|
-
p < 4 && (p = Math.min(v, p + (4 - p))), p > v && (p = Math.max(4, p - (p - v)));
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
return { top: p, left: x, placement: n, x: y, y: w };
|
|
17
|
-
}
|
|
18
1
|
function Fa() {
|
|
19
2
|
return typeof window < "u" && typeof document < "u";
|
|
20
3
|
}
|
|
21
|
-
function
|
|
4
|
+
function Wa(e) {
|
|
22
5
|
return e ? typeof e == "string" ? e : e instanceof Error && e.message ? e.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
23
6
|
}
|
|
24
7
|
function $a(e) {
|
|
25
8
|
return e === "replace" || e === "stack" ? e : "queue";
|
|
26
9
|
}
|
|
27
|
-
function
|
|
10
|
+
function Va(e) {
|
|
28
11
|
return `ui-alert-dialog-${e}`;
|
|
29
12
|
}
|
|
30
|
-
function
|
|
31
|
-
var i,
|
|
32
|
-
const
|
|
13
|
+
function Ka(e, a) {
|
|
14
|
+
var i, r;
|
|
15
|
+
const t = e.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, o = (i = e.dialog) == null ? void 0 : i.getChecked();
|
|
33
16
|
if (e.kind === "prompt") {
|
|
34
|
-
const
|
|
17
|
+
const c = ((r = e.dialog) == null ? void 0 : r.getInputValue()) ?? e.value ?? "";
|
|
35
18
|
return {
|
|
36
19
|
id: e.id,
|
|
37
|
-
action:
|
|
38
|
-
value:
|
|
39
|
-
checked:
|
|
20
|
+
action: t,
|
|
21
|
+
value: c,
|
|
22
|
+
checked: o,
|
|
40
23
|
source: a.source,
|
|
41
24
|
reason: a.reason
|
|
42
25
|
};
|
|
43
26
|
}
|
|
44
27
|
return {
|
|
45
28
|
id: e.id,
|
|
46
|
-
action:
|
|
29
|
+
action: t,
|
|
47
30
|
value: e.value,
|
|
48
|
-
checked:
|
|
31
|
+
checked: o,
|
|
49
32
|
source: a.source,
|
|
50
33
|
reason: a.reason
|
|
51
34
|
};
|
|
52
35
|
}
|
|
53
36
|
function ba(e, a, i) {
|
|
54
|
-
var
|
|
37
|
+
var r, t, o;
|
|
55
38
|
return e.kind === "prompt" ? {
|
|
56
39
|
id: e.id,
|
|
57
40
|
action: "dismiss",
|
|
58
|
-
value: ((
|
|
59
|
-
checked: (
|
|
41
|
+
value: ((r = e.dialog) == null ? void 0 : r.getInputValue()) ?? e.value ?? "",
|
|
42
|
+
checked: (t = e.dialog) == null ? void 0 : t.getChecked(),
|
|
60
43
|
source: a,
|
|
61
44
|
reason: i
|
|
62
45
|
} : {
|
|
63
46
|
id: e.id,
|
|
64
47
|
action: "dismiss",
|
|
65
48
|
value: e.value,
|
|
66
|
-
checked: (
|
|
49
|
+
checked: (o = e.dialog) == null ? void 0 : o.getChecked(),
|
|
67
50
|
source: a,
|
|
68
51
|
reason: i
|
|
69
52
|
};
|
|
70
53
|
}
|
|
71
|
-
function
|
|
54
|
+
function Na(e) {
|
|
72
55
|
return e === "esc" || e === "backdrop" || e === "close-icon" || e === "abort" || e === "unmount" || e === "replace" || e === "programmatic" ? e : "abort";
|
|
73
56
|
}
|
|
74
57
|
class Ga {
|
|
@@ -94,43 +77,43 @@ class Ga {
|
|
|
94
77
|
this._disposed = !0;
|
|
95
78
|
const i = [...this._active, ...this._queue];
|
|
96
79
|
this._queue = [];
|
|
97
|
-
for (const
|
|
98
|
-
this._settle(
|
|
80
|
+
for (const r of i)
|
|
81
|
+
this._settle(r, ba(r, a), !1);
|
|
99
82
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
100
83
|
}
|
|
101
84
|
_enqueue(a, i) {
|
|
102
|
-
const
|
|
85
|
+
const r = this._mergeOptions(i);
|
|
103
86
|
if (!Fa() || this._disposed) {
|
|
104
|
-
const
|
|
105
|
-
id:
|
|
87
|
+
const c = {
|
|
88
|
+
id: r.id || Va(++this._seed),
|
|
106
89
|
action: "dismiss",
|
|
107
90
|
source: "unmount"
|
|
108
91
|
};
|
|
109
|
-
return Promise.resolve(
|
|
92
|
+
return Promise.resolve(c);
|
|
110
93
|
}
|
|
111
|
-
const
|
|
112
|
-
return new Promise((
|
|
113
|
-
var
|
|
94
|
+
const t = r.id || Va(++this._seed), o = $a(r.mode);
|
|
95
|
+
return new Promise((c) => {
|
|
96
|
+
var u;
|
|
114
97
|
const s = {
|
|
115
|
-
id:
|
|
98
|
+
id: t,
|
|
116
99
|
kind: a,
|
|
117
|
-
mode:
|
|
118
|
-
options:
|
|
100
|
+
mode: o,
|
|
101
|
+
options: r,
|
|
119
102
|
settled: !1,
|
|
120
103
|
processing: !1,
|
|
121
|
-
resolve:
|
|
104
|
+
resolve: c,
|
|
122
105
|
cleanup: []
|
|
123
106
|
};
|
|
124
|
-
if ((
|
|
107
|
+
if ((u = r.signal) != null && u.aborted) {
|
|
125
108
|
this._settle(s, ba(s, "abort"), !1);
|
|
126
109
|
return;
|
|
127
110
|
}
|
|
128
|
-
if (
|
|
129
|
-
const
|
|
130
|
-
|
|
111
|
+
if (o === "replace") {
|
|
112
|
+
const f = this._active[this._active.length - 1];
|
|
113
|
+
f && this._settle(f, ba(f, "replace", "replace"), !1, !1), this._open(s);
|
|
131
114
|
return;
|
|
132
115
|
}
|
|
133
|
-
if (
|
|
116
|
+
if (o === "stack") {
|
|
134
117
|
this._open(s);
|
|
135
118
|
return;
|
|
136
119
|
}
|
|
@@ -143,79 +126,79 @@ class Ga {
|
|
|
143
126
|
}
|
|
144
127
|
_open(a) {
|
|
145
128
|
var i;
|
|
146
|
-
const
|
|
147
|
-
if (!
|
|
129
|
+
const r = this._ensureContainer();
|
|
130
|
+
if (!r) {
|
|
148
131
|
this._settle(a, ba(a, "unmount"), !1);
|
|
149
132
|
return;
|
|
150
133
|
}
|
|
151
|
-
const
|
|
152
|
-
a.dialog =
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
const
|
|
134
|
+
const t = document.createElement("ui-alert-dialog");
|
|
135
|
+
a.dialog = t, a.checked = !!((i = a.options.checkbox) != null && i.defaultChecked);
|
|
136
|
+
const o = this._buildConfig(a);
|
|
137
|
+
t.dialogId = a.id, t.config = o;
|
|
138
|
+
const c = (f) => {
|
|
156
139
|
if (a.settled)
|
|
157
140
|
return;
|
|
158
|
-
const x =
|
|
141
|
+
const x = f.detail;
|
|
159
142
|
a.value = x == null ? void 0 : x.inputValue, a.checked = x == null ? void 0 : x.checked;
|
|
160
143
|
const m = this._validatePrompt(a);
|
|
161
144
|
if (m) {
|
|
162
|
-
|
|
145
|
+
f.preventDefault(), t.setError(m);
|
|
163
146
|
return;
|
|
164
147
|
}
|
|
165
148
|
if (!a.options.onConfirm) {
|
|
166
|
-
|
|
149
|
+
t.clearError();
|
|
167
150
|
return;
|
|
168
151
|
}
|
|
169
|
-
|
|
152
|
+
f.preventDefault(), a.processing = !0, t.state = "loading", t.clearError(), Promise.resolve(
|
|
170
153
|
a.options.onConfirm({
|
|
171
154
|
id: a.id,
|
|
172
155
|
value: a.value,
|
|
173
156
|
checked: a.checked,
|
|
174
|
-
dialog:
|
|
157
|
+
dialog: t,
|
|
175
158
|
signal: a.options.signal
|
|
176
159
|
})
|
|
177
160
|
).then(() => {
|
|
178
|
-
a.processing = !1,
|
|
179
|
-
}).catch((
|
|
180
|
-
a.processing = !1,
|
|
161
|
+
a.processing = !1, t.state = "idle", t.clearError(), a.settled || t.close("confirm");
|
|
162
|
+
}).catch((h) => {
|
|
163
|
+
a.processing = !1, t.state = "error", t.setError(Wa(h));
|
|
181
164
|
});
|
|
182
|
-
},
|
|
183
|
-
a.settled || (a.value =
|
|
184
|
-
}, s = (
|
|
165
|
+
}, u = () => {
|
|
166
|
+
a.settled || (a.value = t.getInputValue(), a.checked = t.getChecked(), t.state === "error" && t.clearError());
|
|
167
|
+
}, s = (f) => {
|
|
185
168
|
if (a.settled)
|
|
186
169
|
return;
|
|
187
|
-
const x =
|
|
170
|
+
const x = f.detail;
|
|
188
171
|
this._handleClose(a, x);
|
|
189
172
|
};
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
173
|
+
if (t.addEventListener("ui-confirm", c), t.addEventListener("ui-change", u), t.addEventListener("ui-close", s), a.cleanup.push(() => t.removeEventListener("ui-confirm", c)), a.cleanup.push(() => t.removeEventListener("ui-change", u)), a.cleanup.push(() => t.removeEventListener("ui-close", s)), a.options.signal) {
|
|
174
|
+
const f = () => {
|
|
192
175
|
a.settled || this._settle(a, ba(a, "abort"), !1);
|
|
193
176
|
};
|
|
194
|
-
a.options.signal.addEventListener("abort",
|
|
177
|
+
a.options.signal.addEventListener("abort", f, { once: !0 }), a.cleanup.push(() => {
|
|
195
178
|
var x;
|
|
196
|
-
return (x = a.options.signal) == null ? void 0 : x.removeEventListener("abort",
|
|
179
|
+
return (x = a.options.signal) == null ? void 0 : x.removeEventListener("abort", f);
|
|
197
180
|
});
|
|
198
181
|
}
|
|
199
|
-
this._active.push(a),
|
|
182
|
+
this._active.push(a), r.appendChild(t), t.open = !0, this._updateStackZIndex();
|
|
200
183
|
}
|
|
201
184
|
_validatePrompt(a) {
|
|
202
185
|
var i;
|
|
203
186
|
if (a.kind !== "prompt")
|
|
204
187
|
return null;
|
|
205
|
-
const
|
|
206
|
-
return
|
|
188
|
+
const r = a.options.input, t = ((i = a.dialog) == null ? void 0 : i.getInputValue()) ?? a.value ?? "";
|
|
189
|
+
return r != null && r.required && !t.trim() ? "Please enter a value." : r != null && r.validate ? r.validate(t) : null;
|
|
207
190
|
}
|
|
208
|
-
_settle(a, i,
|
|
191
|
+
_settle(a, i, r, t = !0) {
|
|
209
192
|
if (!a.settled) {
|
|
210
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
211
|
-
const
|
|
212
|
-
if (!
|
|
213
|
-
const
|
|
214
|
-
|
|
193
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((o) => o !== a), this._queue = this._queue.filter((o) => o !== a), a.dialog) {
|
|
194
|
+
const o = a.dialog;
|
|
195
|
+
if (!r && o.open) {
|
|
196
|
+
const c = Na(i.source);
|
|
197
|
+
o.close("dismiss", c, i.reason);
|
|
215
198
|
}
|
|
216
|
-
|
|
199
|
+
o.parentElement && o.parentElement.removeChild(o);
|
|
217
200
|
}
|
|
218
|
-
a.resolve(i), this._updateStackZIndex(), !this._disposed &&
|
|
201
|
+
a.resolve(i), this._updateStackZIndex(), !this._disposed && t && this._drainQueue();
|
|
219
202
|
}
|
|
220
203
|
}
|
|
221
204
|
_cleanupRequest(a) {
|
|
@@ -232,63 +215,63 @@ class Ga {
|
|
|
232
215
|
a && this._open(a);
|
|
233
216
|
}
|
|
234
217
|
_buildConfig(a) {
|
|
235
|
-
var i,
|
|
236
|
-
const
|
|
218
|
+
var i, r, t;
|
|
219
|
+
const o = a.options, c = a.kind === "prompt", u = a.kind === "alert", s = c ? o.input : void 0;
|
|
237
220
|
return {
|
|
238
221
|
id: a.id,
|
|
239
|
-
title:
|
|
240
|
-
description:
|
|
241
|
-
confirmText:
|
|
242
|
-
cancelText:
|
|
243
|
-
loadingText:
|
|
244
|
-
errorMessage:
|
|
245
|
-
dismissible:
|
|
246
|
-
closeOnEsc:
|
|
247
|
-
closeOnBackdrop:
|
|
248
|
-
lockWhileLoading:
|
|
249
|
-
role:
|
|
250
|
-
tone:
|
|
251
|
-
size:
|
|
252
|
-
variant:
|
|
253
|
-
radius:
|
|
254
|
-
elevation:
|
|
255
|
-
indicator:
|
|
256
|
-
initialFocus:
|
|
257
|
-
ariaLabel:
|
|
258
|
-
ariaLabelledby:
|
|
259
|
-
ariaDescribedby:
|
|
260
|
-
headless:
|
|
261
|
-
showCancel: !
|
|
262
|
-
showClose:
|
|
222
|
+
title: o.title,
|
|
223
|
+
description: o.description,
|
|
224
|
+
confirmText: o.confirmText || (u ? "OK" : "Confirm"),
|
|
225
|
+
cancelText: o.cancelText || "Cancel",
|
|
226
|
+
loadingText: o.loadingText,
|
|
227
|
+
errorMessage: o.errorMessage,
|
|
228
|
+
dismissible: o.dismissible ?? !0,
|
|
229
|
+
closeOnEsc: o.closeOnEsc,
|
|
230
|
+
closeOnBackdrop: o.closeOnBackdrop,
|
|
231
|
+
lockWhileLoading: o.lockWhileLoading ?? !0,
|
|
232
|
+
role: o.role || "alertdialog",
|
|
233
|
+
tone: o.tone || (u ? "info" : c ? "neutral" : "warning"),
|
|
234
|
+
size: o.size || "md",
|
|
235
|
+
variant: o.variant || "surface",
|
|
236
|
+
radius: o.radius,
|
|
237
|
+
elevation: o.elevation || "low",
|
|
238
|
+
indicator: o.indicator || "line",
|
|
239
|
+
initialFocus: o.initialFocus,
|
|
240
|
+
ariaLabel: o.ariaLabel,
|
|
241
|
+
ariaLabelledby: o.ariaLabelledby,
|
|
242
|
+
ariaDescribedby: o.ariaDescribedby,
|
|
243
|
+
headless: o.headless,
|
|
244
|
+
showCancel: !u,
|
|
245
|
+
showClose: o.dismissible ?? !0,
|
|
263
246
|
input: {
|
|
264
|
-
enabled:
|
|
247
|
+
enabled: c,
|
|
265
248
|
label: s == null ? void 0 : s.label,
|
|
266
249
|
placeholder: s == null ? void 0 : s.placeholder,
|
|
267
250
|
value: (s == null ? void 0 : s.defaultValue) || "",
|
|
268
251
|
required: s == null ? void 0 : s.required
|
|
269
252
|
},
|
|
270
253
|
checkbox: {
|
|
271
|
-
enabled: !!((i =
|
|
272
|
-
label: (
|
|
273
|
-
checked: (
|
|
254
|
+
enabled: !!((i = o.checkbox) != null && i.enabled),
|
|
255
|
+
label: (r = o.checkbox) == null ? void 0 : r.label,
|
|
256
|
+
checked: (t = o.checkbox) == null ? void 0 : t.defaultChecked
|
|
274
257
|
}
|
|
275
258
|
};
|
|
276
259
|
}
|
|
277
260
|
_buildLifecycleContext(a) {
|
|
278
|
-
var i,
|
|
261
|
+
var i, r;
|
|
279
262
|
return {
|
|
280
263
|
id: a.id,
|
|
281
264
|
value: ((i = a.dialog) == null ? void 0 : i.getInputValue()) ?? a.value,
|
|
282
|
-
checked: ((
|
|
265
|
+
checked: ((r = a.dialog) == null ? void 0 : r.getChecked()) ?? a.checked,
|
|
283
266
|
dialog: a.dialog,
|
|
284
267
|
signal: a.options.signal
|
|
285
268
|
};
|
|
286
269
|
}
|
|
287
270
|
_handleClose(a, i) {
|
|
288
|
-
const
|
|
271
|
+
const r = Ka(a, i);
|
|
289
272
|
if (i.action === "cancel" && a.options.onCancel) {
|
|
290
273
|
Promise.resolve(a.options.onCancel(this._buildLifecycleContext(a))).finally(() => {
|
|
291
|
-
this._settle(a,
|
|
274
|
+
this._settle(a, r, !0);
|
|
292
275
|
});
|
|
293
276
|
return;
|
|
294
277
|
}
|
|
@@ -300,11 +283,11 @@ class Ga {
|
|
|
300
283
|
reason: i.reason
|
|
301
284
|
})
|
|
302
285
|
).finally(() => {
|
|
303
|
-
this._settle(a,
|
|
286
|
+
this._settle(a, r, !0);
|
|
304
287
|
});
|
|
305
288
|
return;
|
|
306
289
|
}
|
|
307
|
-
this._settle(a,
|
|
290
|
+
this._settle(a, r, !0);
|
|
308
291
|
}
|
|
309
292
|
_mergeOptions(a) {
|
|
310
293
|
const i = this._defaults;
|
|
@@ -332,22 +315,22 @@ class Ga {
|
|
|
332
315
|
}
|
|
333
316
|
}
|
|
334
317
|
}
|
|
335
|
-
function
|
|
318
|
+
function te(e = {}) {
|
|
336
319
|
return new Ga(e.container ?? null);
|
|
337
320
|
}
|
|
338
|
-
function
|
|
321
|
+
function ja() {
|
|
339
322
|
return typeof window < "u" && typeof document < "u";
|
|
340
323
|
}
|
|
341
324
|
function Ja(e) {
|
|
342
325
|
return e === "replace" || e === "stack" ? e : "queue";
|
|
343
326
|
}
|
|
344
|
-
function
|
|
327
|
+
function Ba(e) {
|
|
345
328
|
return `ui-dialog-${e}`;
|
|
346
329
|
}
|
|
347
|
-
function
|
|
330
|
+
function Xa(e) {
|
|
348
331
|
return e ? typeof e == "string" ? e : e instanceof Error && e.message ? e.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
349
332
|
}
|
|
350
|
-
class
|
|
333
|
+
class Ya {
|
|
351
334
|
constructor(a) {
|
|
352
335
|
this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._container = a ?? null;
|
|
353
336
|
}
|
|
@@ -364,9 +347,9 @@ class Xa {
|
|
|
364
347
|
this._disposed = !0;
|
|
365
348
|
const i = [...this._active, ...this._queue];
|
|
366
349
|
this._queue = [];
|
|
367
|
-
for (const
|
|
368
|
-
this._settle(
|
|
369
|
-
id:
|
|
350
|
+
for (const r of i)
|
|
351
|
+
this._settle(r, {
|
|
352
|
+
id: r.id,
|
|
370
353
|
action: "dismiss",
|
|
371
354
|
source: a,
|
|
372
355
|
reason: a
|
|
@@ -374,41 +357,41 @@ class Xa {
|
|
|
374
357
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
375
358
|
}
|
|
376
359
|
_enqueue(a) {
|
|
377
|
-
if (!
|
|
360
|
+
if (!ja() || this._disposed)
|
|
378
361
|
return Promise.resolve({
|
|
379
|
-
id: a.id ||
|
|
362
|
+
id: a.id || Ba(++this._seed),
|
|
380
363
|
action: "dismiss",
|
|
381
364
|
source: "unmount"
|
|
382
365
|
});
|
|
383
|
-
const i = a.id ||
|
|
384
|
-
return new Promise((
|
|
385
|
-
var
|
|
386
|
-
const
|
|
366
|
+
const i = a.id || Ba(++this._seed), r = Ja(a.mode);
|
|
367
|
+
return new Promise((t) => {
|
|
368
|
+
var o;
|
|
369
|
+
const c = {
|
|
387
370
|
id: i,
|
|
388
|
-
mode:
|
|
371
|
+
mode: r,
|
|
389
372
|
options: a,
|
|
390
373
|
settled: !1,
|
|
391
|
-
resolve:
|
|
374
|
+
resolve: t,
|
|
392
375
|
cleanup: []
|
|
393
376
|
};
|
|
394
|
-
if ((
|
|
395
|
-
this._settle(
|
|
377
|
+
if ((o = a.signal) != null && o.aborted) {
|
|
378
|
+
this._settle(c, { id: i, action: "dismiss", source: "abort" }, !1);
|
|
396
379
|
return;
|
|
397
380
|
}
|
|
398
|
-
if (
|
|
399
|
-
const
|
|
400
|
-
|
|
381
|
+
if (r === "replace") {
|
|
382
|
+
const u = this._active[this._active.length - 1];
|
|
383
|
+
u && this._settle(u, { id: u.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(c);
|
|
401
384
|
return;
|
|
402
385
|
}
|
|
403
|
-
if (
|
|
404
|
-
this._open(
|
|
386
|
+
if (r === "stack") {
|
|
387
|
+
this._open(c);
|
|
405
388
|
return;
|
|
406
389
|
}
|
|
407
390
|
if (this._active.length > 0) {
|
|
408
|
-
this._queue.push(
|
|
391
|
+
this._queue.push(c);
|
|
409
392
|
return;
|
|
410
393
|
}
|
|
411
|
-
this._open(
|
|
394
|
+
this._open(c);
|
|
412
395
|
});
|
|
413
396
|
}
|
|
414
397
|
_open(a) {
|
|
@@ -421,34 +404,34 @@ class Xa {
|
|
|
421
404
|
}, !1);
|
|
422
405
|
return;
|
|
423
406
|
}
|
|
424
|
-
const
|
|
425
|
-
a.dialog =
|
|
426
|
-
const
|
|
427
|
-
|
|
428
|
-
const
|
|
407
|
+
const r = document.createElement("ui-dialog");
|
|
408
|
+
a.dialog = r;
|
|
409
|
+
const t = this._buildConfig(a.options, a.id);
|
|
410
|
+
r.dialogId = a.id, r.config = t;
|
|
411
|
+
const o = (u) => {
|
|
429
412
|
if (a.settled)
|
|
430
413
|
return;
|
|
431
|
-
const s =
|
|
414
|
+
const s = u.detail;
|
|
432
415
|
if (a.resultFormData = s == null ? void 0 : s.formData, !a.options.onSubmit) {
|
|
433
|
-
|
|
416
|
+
r.clearError();
|
|
434
417
|
return;
|
|
435
418
|
}
|
|
436
|
-
|
|
419
|
+
u.preventDefault(), r.state = "loading", r.clearError(), Promise.resolve(
|
|
437
420
|
a.options.onSubmit({
|
|
438
421
|
id: a.id,
|
|
439
|
-
dialog:
|
|
422
|
+
dialog: r,
|
|
440
423
|
signal: a.options.signal,
|
|
441
424
|
formData: s == null ? void 0 : s.formData
|
|
442
425
|
})
|
|
443
426
|
).then(() => {
|
|
444
|
-
a.settled || (
|
|
445
|
-
}).catch((
|
|
446
|
-
|
|
427
|
+
a.settled || (r.state = "idle", r.clearError(), r.close("submit"));
|
|
428
|
+
}).catch((f) => {
|
|
429
|
+
r.state = "error", r.setError(Xa(f));
|
|
447
430
|
});
|
|
448
|
-
},
|
|
431
|
+
}, c = (u) => {
|
|
449
432
|
if (a.settled)
|
|
450
433
|
return;
|
|
451
|
-
const s =
|
|
434
|
+
const s = u.detail;
|
|
452
435
|
this._settle(a, {
|
|
453
436
|
id: a.id,
|
|
454
437
|
action: s.action,
|
|
@@ -457,28 +440,28 @@ class Xa {
|
|
|
457
440
|
formData: a.resultFormData
|
|
458
441
|
}, !0);
|
|
459
442
|
};
|
|
460
|
-
if (
|
|
461
|
-
const
|
|
443
|
+
if (r.addEventListener("ui-submit", o), r.addEventListener("ui-close", c), a.cleanup.push(() => r.removeEventListener("ui-submit", o)), a.cleanup.push(() => r.removeEventListener("ui-close", c)), a.options.signal) {
|
|
444
|
+
const u = () => {
|
|
462
445
|
a.settled || this._settle(a, {
|
|
463
446
|
id: a.id,
|
|
464
447
|
action: "dismiss",
|
|
465
448
|
source: "abort"
|
|
466
449
|
}, !1);
|
|
467
450
|
};
|
|
468
|
-
a.options.signal.addEventListener("abort",
|
|
451
|
+
a.options.signal.addEventListener("abort", u, { once: !0 }), a.cleanup.push(() => {
|
|
469
452
|
var s;
|
|
470
|
-
return (s = a.options.signal) == null ? void 0 : s.removeEventListener("abort",
|
|
453
|
+
return (s = a.options.signal) == null ? void 0 : s.removeEventListener("abort", u);
|
|
471
454
|
});
|
|
472
455
|
}
|
|
473
|
-
this._active.push(a), i.appendChild(
|
|
456
|
+
this._active.push(a), i.appendChild(r), r.openDialog(), this._updateStackZIndex();
|
|
474
457
|
}
|
|
475
|
-
_settle(a, i,
|
|
458
|
+
_settle(a, i, r, t = !0) {
|
|
476
459
|
if (!a.settled) {
|
|
477
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
478
|
-
const
|
|
479
|
-
!
|
|
460
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((o) => o !== a), this._queue = this._queue.filter((o) => o !== a), a.dialog) {
|
|
461
|
+
const o = a.dialog;
|
|
462
|
+
!r && o.open && o.close("dismiss", i.source || "abort", i.reason), o.parentElement && o.parentElement.removeChild(o);
|
|
480
463
|
}
|
|
481
|
-
a.resolve(i), this._updateStackZIndex(), !this._disposed &&
|
|
464
|
+
a.resolve(i), this._updateStackZIndex(), !this._disposed && t && this._drainQueue();
|
|
482
465
|
}
|
|
483
466
|
}
|
|
484
467
|
_cleanupRequest(a) {
|
|
@@ -519,7 +502,7 @@ class Xa {
|
|
|
519
502
|
};
|
|
520
503
|
}
|
|
521
504
|
_ensureContainer() {
|
|
522
|
-
if (!
|
|
505
|
+
if (!ja())
|
|
523
506
|
return null;
|
|
524
507
|
if (this._container && this._container.isConnected)
|
|
525
508
|
return this._container;
|
|
@@ -533,10 +516,10 @@ class Xa {
|
|
|
533
516
|
}
|
|
534
517
|
}
|
|
535
518
|
}
|
|
536
|
-
function
|
|
537
|
-
return new
|
|
519
|
+
function le(e = {}) {
|
|
520
|
+
return new Ya(e.container ?? null);
|
|
538
521
|
}
|
|
539
|
-
const
|
|
522
|
+
const Ua = {
|
|
540
523
|
1: "#0000000d",
|
|
541
524
|
2: "#0000001a",
|
|
542
525
|
3: "#00000026",
|
|
@@ -549,7 +532,7 @@ const Za = {
|
|
|
549
532
|
10: "#000c",
|
|
550
533
|
11: "#000000e6",
|
|
551
534
|
12: "#000000f2"
|
|
552
|
-
},
|
|
535
|
+
}, Qa = {
|
|
553
536
|
1: "#ffffff0d",
|
|
554
537
|
2: "#ffffff1a",
|
|
555
538
|
3: "#ffffff26",
|
|
@@ -562,7 +545,7 @@ const Za = {
|
|
|
562
545
|
10: "#fffc",
|
|
563
546
|
11: "#ffffffe6",
|
|
564
547
|
12: "#fffffff2"
|
|
565
|
-
},
|
|
548
|
+
}, v = {
|
|
566
549
|
amber: {
|
|
567
550
|
light: {
|
|
568
551
|
scale: {
|
|
@@ -1566,18 +1549,18 @@ const ya = {
|
|
|
1566
1549
|
11: "#0000009b",
|
|
1567
1550
|
12: "#000000df"
|
|
1568
1551
|
},
|
|
1569
|
-
blackAlpha:
|
|
1570
|
-
whiteAlpha:
|
|
1552
|
+
blackAlpha: Ua,
|
|
1553
|
+
whiteAlpha: Qa,
|
|
1571
1554
|
accent: {
|
|
1572
|
-
...
|
|
1555
|
+
...v.amber.light.scale
|
|
1573
1556
|
},
|
|
1574
1557
|
accentAlpha: {
|
|
1575
|
-
...
|
|
1558
|
+
...v.amber.light.alphaScale
|
|
1576
1559
|
},
|
|
1577
|
-
accentContrast:
|
|
1578
|
-
accentSurface:
|
|
1579
|
-
accentIndicator:
|
|
1580
|
-
accentTrack:
|
|
1560
|
+
accentContrast: v.amber.light.contrast,
|
|
1561
|
+
accentSurface: v.amber.light.surface,
|
|
1562
|
+
accentIndicator: v.amber.light.indicator,
|
|
1563
|
+
accentTrack: v.amber.light.track
|
|
1581
1564
|
},
|
|
1582
1565
|
surfaces: {
|
|
1583
1566
|
background: "#ffffff",
|
|
@@ -1678,7 +1661,7 @@ const ya = {
|
|
|
1678
1661
|
components: ae,
|
|
1679
1662
|
zIndex: { modal: 1e3, overlay: 900, toast: 1100 },
|
|
1680
1663
|
breakpoints: { sm: "640px", md: "768px", lg: "1024px" }
|
|
1681
|
-
},
|
|
1664
|
+
}, re = {
|
|
1682
1665
|
...ya,
|
|
1683
1666
|
colors: {
|
|
1684
1667
|
primary: "#ffc53d",
|
|
@@ -1725,18 +1708,18 @@ const ya = {
|
|
|
1725
1708
|
11: "#ffffffaf",
|
|
1726
1709
|
12: "#ffffffed"
|
|
1727
1710
|
},
|
|
1728
|
-
blackAlpha:
|
|
1729
|
-
whiteAlpha:
|
|
1711
|
+
blackAlpha: Ua,
|
|
1712
|
+
whiteAlpha: Qa,
|
|
1730
1713
|
accent: {
|
|
1731
|
-
...
|
|
1714
|
+
...v.amber.dark.scale
|
|
1732
1715
|
},
|
|
1733
1716
|
accentAlpha: {
|
|
1734
|
-
...
|
|
1717
|
+
...v.amber.dark.alphaScale
|
|
1735
1718
|
},
|
|
1736
|
-
accentContrast:
|
|
1737
|
-
accentSurface:
|
|
1738
|
-
accentIndicator:
|
|
1739
|
-
accentTrack:
|
|
1719
|
+
accentContrast: v.amber.dark.contrast,
|
|
1720
|
+
accentSurface: v.amber.dark.surface,
|
|
1721
|
+
accentIndicator: v.amber.dark.indicator,
|
|
1722
|
+
accentTrack: v.amber.dark.track
|
|
1740
1723
|
},
|
|
1741
1724
|
surfaces: {
|
|
1742
1725
|
background: "#111111",
|
|
@@ -1759,14 +1742,14 @@ const ya = {
|
|
|
1759
1742
|
6: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a4),0 16px 64px var(--black-a6),0 16px 36px -20px var(--black-a11)"
|
|
1760
1743
|
},
|
|
1761
1744
|
components: ee
|
|
1762
|
-
},
|
|
1763
|
-
function
|
|
1745
|
+
}, se = ya, oe = /* @__PURE__ */ new Set();
|
|
1746
|
+
function p(e, a) {
|
|
1764
1747
|
if (!(!e && !a))
|
|
1765
1748
|
return { ...e || {}, ...a || {} };
|
|
1766
1749
|
}
|
|
1767
1750
|
function ne(e, a) {
|
|
1768
|
-
var i,
|
|
1769
|
-
const
|
|
1751
|
+
var i, r, t, o, c, u, s, f, x, m, h, y, w, k, _, S, C, z, E, A, q, I, L, P, D, O, T, M, H, R, F, V, j, B, Z, U, Q, W, $, K, N, G, J, X, Y, aa, ea, ia, ra, oa, na, ta, la, sa, da, pa, ca, ua, fa, xa, ga, va;
|
|
1752
|
+
const ma = (a == null ? void 0 : a.mode) || "light", l = ma === "dark" ? re : ya, ha = a == null ? void 0 : a.accentPalette, g = ha ? v[ha][ma] : null, b = g ? {
|
|
1770
1753
|
colors: {
|
|
1771
1754
|
...ie(g)
|
|
1772
1755
|
},
|
|
@@ -1784,19 +1767,19 @@ function ne(e, a) {
|
|
|
1784
1767
|
...e,
|
|
1785
1768
|
colors: {
|
|
1786
1769
|
...l.colors,
|
|
1787
|
-
...(
|
|
1770
|
+
...(b == null ? void 0 : b.colors) || {},
|
|
1788
1771
|
...(e == null ? void 0 : e.colors) || {}
|
|
1789
1772
|
},
|
|
1790
1773
|
palette: {
|
|
1791
1774
|
...l.palette || {},
|
|
1792
|
-
...(
|
|
1775
|
+
...(b == null ? void 0 : b.palette) || {},
|
|
1793
1776
|
...(e == null ? void 0 : e.palette) || {},
|
|
1794
|
-
gray:
|
|
1795
|
-
grayAlpha:
|
|
1796
|
-
blackAlpha:
|
|
1797
|
-
whiteAlpha:
|
|
1798
|
-
accent:
|
|
1799
|
-
accentAlpha:
|
|
1777
|
+
gray: p((i = l.palette) == null ? void 0 : i.gray, (r = e == null ? void 0 : e.palette) == null ? void 0 : r.gray),
|
|
1778
|
+
grayAlpha: p((t = l.palette) == null ? void 0 : t.grayAlpha, (o = e == null ? void 0 : e.palette) == null ? void 0 : o.grayAlpha),
|
|
1779
|
+
blackAlpha: p((c = l.palette) == null ? void 0 : c.blackAlpha, (u = e == null ? void 0 : e.palette) == null ? void 0 : u.blackAlpha),
|
|
1780
|
+
whiteAlpha: p((s = l.palette) == null ? void 0 : s.whiteAlpha, (f = e == null ? void 0 : e.palette) == null ? void 0 : f.whiteAlpha),
|
|
1781
|
+
accent: p((g == null ? void 0 : g.scale) || ((x = l.palette) == null ? void 0 : x.accent), (m = e == null ? void 0 : e.palette) == null ? void 0 : m.accent),
|
|
1782
|
+
accentAlpha: p((g == null ? void 0 : g.alphaScale) || ((h = l.palette) == null ? void 0 : h.accentAlpha), (y = e == null ? void 0 : e.palette) == null ? void 0 : y.accentAlpha)
|
|
1800
1783
|
},
|
|
1801
1784
|
surfaces: {
|
|
1802
1785
|
...l.surfaces || {},
|
|
@@ -1810,8 +1793,8 @@ function ne(e, a) {
|
|
|
1810
1793
|
...l.spacing || {},
|
|
1811
1794
|
...(e == null ? void 0 : e.spacing) || {}
|
|
1812
1795
|
},
|
|
1813
|
-
spaceScale:
|
|
1814
|
-
radiusScale:
|
|
1796
|
+
spaceScale: p(l.spaceScale, e == null ? void 0 : e.spaceScale),
|
|
1797
|
+
radiusScale: p(l.radiusScale, e == null ? void 0 : e.radiusScale),
|
|
1815
1798
|
typography: {
|
|
1816
1799
|
...l.typography || {},
|
|
1817
1800
|
...(e == null ? void 0 : e.typography) || {},
|
|
@@ -1819,9 +1802,9 @@ function ne(e, a) {
|
|
|
1819
1802
|
...((w = l.typography) == null ? void 0 : w.size) || {},
|
|
1820
1803
|
...((k = e == null ? void 0 : e.typography) == null ? void 0 : k.size) || {}
|
|
1821
1804
|
},
|
|
1822
|
-
fontScale:
|
|
1823
|
-
lineHeight:
|
|
1824
|
-
letterSpacing:
|
|
1805
|
+
fontScale: p((_ = l.typography) == null ? void 0 : _.fontScale, (S = e == null ? void 0 : e.typography) == null ? void 0 : S.fontScale),
|
|
1806
|
+
lineHeight: p((C = l.typography) == null ? void 0 : C.lineHeight, (z = e == null ? void 0 : e.typography) == null ? void 0 : z.lineHeight),
|
|
1807
|
+
letterSpacing: p((E = l.typography) == null ? void 0 : E.letterSpacing, (A = e == null ? void 0 : e.typography) == null ? void 0 : A.letterSpacing)
|
|
1825
1808
|
},
|
|
1826
1809
|
motion: {
|
|
1827
1810
|
...l.motion || {},
|
|
@@ -1834,27 +1817,27 @@ function ne(e, a) {
|
|
|
1834
1817
|
components: {
|
|
1835
1818
|
...l.components || {},
|
|
1836
1819
|
...(e == null ? void 0 : e.components) || {},
|
|
1837
|
-
button:
|
|
1838
|
-
badge:
|
|
1839
|
-
dropdown:
|
|
1840
|
-
select:
|
|
1841
|
-
sidebar:
|
|
1842
|
-
card:
|
|
1843
|
-
navigationMenu:
|
|
1844
|
-
blockControls:
|
|
1845
|
-
box:
|
|
1846
|
-
breadcrumb:
|
|
1847
|
-
contextMenu:
|
|
1848
|
-
menubar:
|
|
1849
|
-
alert:
|
|
1850
|
-
alertDialog:
|
|
1851
|
-
appHeader:
|
|
1852
|
-
aspectRatio:
|
|
1853
|
-
avatar:
|
|
1854
|
-
menu:
|
|
1855
|
-
multiSelect:
|
|
1856
|
-
panel:
|
|
1857
|
-
input:
|
|
1820
|
+
button: p((q = l.components) == null ? void 0 : q.button, (I = e == null ? void 0 : e.components) == null ? void 0 : I.button),
|
|
1821
|
+
badge: p((L = l.components) == null ? void 0 : L.badge, (P = e == null ? void 0 : e.components) == null ? void 0 : P.badge),
|
|
1822
|
+
dropdown: p((D = l.components) == null ? void 0 : D.dropdown, (O = e == null ? void 0 : e.components) == null ? void 0 : O.dropdown),
|
|
1823
|
+
select: p((T = l.components) == null ? void 0 : T.select, (M = e == null ? void 0 : e.components) == null ? void 0 : M.select),
|
|
1824
|
+
sidebar: p((H = l.components) == null ? void 0 : H.sidebar, (R = e == null ? void 0 : e.components) == null ? void 0 : R.sidebar),
|
|
1825
|
+
card: p((F = l.components) == null ? void 0 : F.card, (V = e == null ? void 0 : e.components) == null ? void 0 : V.card),
|
|
1826
|
+
navigationMenu: p((j = l.components) == null ? void 0 : j.navigationMenu, (B = e == null ? void 0 : e.components) == null ? void 0 : B.navigationMenu),
|
|
1827
|
+
blockControls: p((Z = l.components) == null ? void 0 : Z.blockControls, (U = e == null ? void 0 : e.components) == null ? void 0 : U.blockControls),
|
|
1828
|
+
box: p((Q = l.components) == null ? void 0 : Q.box, (W = e == null ? void 0 : e.components) == null ? void 0 : W.box),
|
|
1829
|
+
breadcrumb: p(($ = l.components) == null ? void 0 : $.breadcrumb, (K = e == null ? void 0 : e.components) == null ? void 0 : K.breadcrumb),
|
|
1830
|
+
contextMenu: p((N = l.components) == null ? void 0 : N.contextMenu, (G = e == null ? void 0 : e.components) == null ? void 0 : G.contextMenu),
|
|
1831
|
+
menubar: p((J = l.components) == null ? void 0 : J.menubar, (X = e == null ? void 0 : e.components) == null ? void 0 : X.menubar),
|
|
1832
|
+
alert: p((Y = l.components) == null ? void 0 : Y.alert, (aa = e == null ? void 0 : e.components) == null ? void 0 : aa.alert),
|
|
1833
|
+
alertDialog: p((ea = l.components) == null ? void 0 : ea.alertDialog, (ia = e == null ? void 0 : e.components) == null ? void 0 : ia.alertDialog),
|
|
1834
|
+
appHeader: p((ra = l.components) == null ? void 0 : ra.appHeader, (oa = e == null ? void 0 : e.components) == null ? void 0 : oa.appHeader),
|
|
1835
|
+
aspectRatio: p((na = l.components) == null ? void 0 : na.aspectRatio, (ta = e == null ? void 0 : e.components) == null ? void 0 : ta.aspectRatio),
|
|
1836
|
+
avatar: p((la = l.components) == null ? void 0 : la.avatar, (sa = e == null ? void 0 : e.components) == null ? void 0 : sa.avatar),
|
|
1837
|
+
menu: p((da = l.components) == null ? void 0 : da.menu, (pa = e == null ? void 0 : e.components) == null ? void 0 : pa.menu),
|
|
1838
|
+
multiSelect: p((ca = l.components) == null ? void 0 : ca.multiSelect, (ua = e == null ? void 0 : e.components) == null ? void 0 : ua.multiSelect),
|
|
1839
|
+
panel: p((fa = l.components) == null ? void 0 : fa.panel, (xa = e == null ? void 0 : e.components) == null ? void 0 : xa.panel),
|
|
1840
|
+
input: p((ga = l.components) == null ? void 0 : ga.input, (va = e == null ? void 0 : e.components) == null ? void 0 : va.input)
|
|
1858
1841
|
},
|
|
1859
1842
|
zIndex: {
|
|
1860
1843
|
...l.zIndex || {},
|
|
@@ -1866,37 +1849,36 @@ function ne(e, a) {
|
|
|
1866
1849
|
}
|
|
1867
1850
|
};
|
|
1868
1851
|
}
|
|
1869
|
-
function
|
|
1852
|
+
function n(e, a, i) {
|
|
1870
1853
|
try {
|
|
1871
1854
|
e.style.setProperty(a, i);
|
|
1872
1855
|
} catch {
|
|
1873
1856
|
}
|
|
1874
1857
|
}
|
|
1875
|
-
function
|
|
1876
|
-
i && Object.entries(i).forEach(([
|
|
1877
|
-
typeof
|
|
1858
|
+
function d(e, a, i) {
|
|
1859
|
+
i && Object.entries(i).forEach(([r, t]) => {
|
|
1860
|
+
typeof t == "string" && t && e.style.setProperty(`${a}${r}`, t);
|
|
1878
1861
|
});
|
|
1879
1862
|
}
|
|
1880
|
-
function
|
|
1881
|
-
var i,
|
|
1882
|
-
|
|
1863
|
+
function Za(e, a) {
|
|
1864
|
+
var i, r, t, o, c, u, s, f, x, m, h, y, w, k, _, S, C, z, E, A, q, I, L, P, D, O, T, M, H, R, F, V, j, B, Z, U, Q, W, $, K, N, G, J, X, Y, aa, ea, ia, ra, oa, na, ta, la, sa, da, pa, ca, ua, fa, xa, ga, va, ma, l, ha, g, b, wa, ka, _a, Sa, Ca, za, Ea, Aa, qa, Ia, La, Pa, Da, Oa, Ta, Ma, Ha, Ra;
|
|
1865
|
+
n(e, "--ui-color-primary", a.colors.primary), n(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), n(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), n(e, "--ui-color-background", a.colors.background || "#ffffff"), n(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), n(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), n(e, "--ui-color-text", a.colors.text || "#202020"), n(e, "--ui-color-muted", a.colors.muted || "#646464"), n(e, "--ui-color-border", a.colors.border || "#0000001f"), n(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), n(e, "--ui-color-success", a.colors.success || "#30a46c"), n(e, "--ui-color-danger", a.colors.danger || "#e5484d"), n(e, "--ui-color-warning", a.colors.warning || a.colors.primary), n(e, "--ui-primary", a.colors.primary), n(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), n(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), n(e, "--ui-background", a.colors.background || "#ffffff"), n(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), n(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), n(e, "--ui-text", a.colors.text || "#202020"), n(e, "--ui-muted", a.colors.muted || "#646464"), n(e, "--ui-border", a.colors.border || "#0000001f"), n(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), n(e, "--ui-success", a.colors.success || "#30a46c"), n(e, "--ui-error", a.colors.danger || "#e5484d"), n(e, "--ui-warning", a.colors.warning || a.colors.primary), n(e, "--ui-radius", a.radius || "4px"), n(e, "--ui-space-xs", ((i = a.spacing) == null ? void 0 : i.xs) || "4px"), n(e, "--ui-space-sm", ((r = a.spacing) == null ? void 0 : r.sm) || "8px"), n(e, "--ui-space-md", ((t = a.spacing) == null ? void 0 : t.md) || "12px"), n(e, "--ui-space-lg", ((o = a.spacing) == null ? void 0 : o.lg) || "24px"), n(e, "--ui-space-xl", ((c = a.spacing) == null ? void 0 : c.xl) || "32px"), n(e, "--ui-space-xxl", ((u = a.spacing) == null ? void 0 : u.xxl) || "48px"), n(e, "--ui-default-gap", ((s = a.spacing) == null ? void 0 : s.sm) || ((f = a.spaceScale) == null ? void 0 : f[2]) || "8px"), n(e, "--ui-shadow-sm", ((x = a.shadows) == null ? void 0 : x.sm) || ((m = a.shadows) == null ? void 0 : m[2]) || "none"), n(e, "--ui-shadow-md", ((h = a.shadows) == null ? void 0 : h.md) || ((y = a.shadows) == null ? void 0 : y[3]) || "none"), n(e, "--ui-shadow-lg", ((w = a.shadows) == null ? void 0 : w.lg) || ((k = a.shadows) == null ? void 0 : k[4]) || "none"), n(e, "--ui-font-family", ((_ = a.typography) == null ? void 0 : _.family) || "system-ui, sans-serif"), n(e, "--ui-font-family-heading", ((S = a.typography) == null ? void 0 : S.headingFamily) || ((C = a.typography) == null ? void 0 : C.family) || "system-ui, sans-serif"), n(e, "--ui-font-family-code", ((z = a.typography) == null ? void 0 : z.codeFamily) || "monospace"), n(e, "--ui-font-size-sm", ((A = (E = a.typography) == null ? void 0 : E.size) == null ? void 0 : A.sm) || "12px"), n(e, "--ui-font-size-md", ((I = (q = a.typography) == null ? void 0 : q.size) == null ? void 0 : I.md) || "14px"), n(e, "--ui-font-size-lg", ((P = (L = a.typography) == null ? void 0 : L.size) == null ? void 0 : P.lg) || "16px"), n(e, "--ui-default-font-size", ((O = (D = a.typography) == null ? void 0 : D.size) == null ? void 0 : O.md) || ((M = (T = a.typography) == null ? void 0 : T.fontScale) == null ? void 0 : M[2]) || "14px"), n(e, "--ui-default-line-height", ((R = (H = a.typography) == null ? void 0 : H.lineHeight) == null ? void 0 : R[2]) || "20px"), n(e, "--ui-default-letter-spacing", ((V = (F = a.typography) == null ? void 0 : F.letterSpacing) == null ? void 0 : V[2]) || "0em"), n(e, "--ui-motion-short", ((j = a.motion) == null ? void 0 : j.durationShort) || "120ms"), n(e, "--ui-motion-base", ((B = a.motion) == null ? void 0 : B.durationBase) || "180ms"), n(e, "--ui-motion-long", ((Z = a.motion) == null ? void 0 : Z.durationLong) || "260ms"), n(e, "--ui-motion-easing", ((U = a.motion) == null ? void 0 : U.easing) || "cubic-bezier(0.2, 0.8, 0.2, 1)"), n(e, "--ui-z-modal", String(((Q = a.zIndex) == null ? void 0 : Q.modal) ?? 1e3)), n(e, "--ui-z-overlay", String(((W = a.zIndex) == null ? void 0 : W.overlay) ?? 900)), n(e, "--ui-z-toast", String((($ = a.zIndex) == null ? void 0 : $.toast) ?? 1100)), n(e, "--ui-breakpoint-sm", ((K = a.breakpoints) == null ? void 0 : K.sm) || "640px"), n(e, "--ui-breakpoint-md", ((N = a.breakpoints) == null ? void 0 : N.md) || "768px"), n(e, "--ui-breakpoint-lg", ((G = a.breakpoints) == null ? void 0 : G.lg) || "1024px"), n(e, "--color-background", ((J = a.surfaces) == null ? void 0 : J.background) || a.colors.background || "#ffffff"), n(e, "--color-surface", ((X = a.surfaces) == null ? void 0 : X.surface) || a.colors.surface || "#fcfcfc"), n(e, "--color-panel", ((Y = a.surfaces) == null ? void 0 : Y.panel) || ((aa = a.surfaces) == null ? void 0 : aa.panelTranslucent) || "#ffffffcc"), n(e, "--color-panel-solid", ((ea = a.surfaces) == null ? void 0 : ea.panelSolid) || a.colors.surface || "#ffffff"), n(e, "--color-panel-translucent", ((ia = a.surfaces) == null ? void 0 : ia.panelTranslucent) || "#ffffffcc"), n(e, "--color-overlay", ((ra = a.surfaces) == null ? void 0 : ra.overlay) || "rgba(2, 6, 23, 0.52)"), n(e, "--color-transparent", ((oa = a.surfaces) == null ? void 0 : oa.transparent) || "transparent"), n(e, "--backdrop-filter-panel", ((na = a.effects) == null ? void 0 : na.backdropFilterPanel) || "blur(64px)"), (ta = a.palette) != null && ta.accentContrast && n(e, "--accent-contrast", a.palette.accentContrast), (la = a.palette) != null && la.accentSurface && n(e, "--accent-surface", a.palette.accentSurface), (sa = a.palette) != null && sa.accentIndicator && n(e, "--accent-indicator", a.palette.accentIndicator), (da = a.palette) != null && da.accentTrack && n(e, "--accent-track", a.palette.accentTrack), d(e, "--gray-", (pa = a.palette) == null ? void 0 : pa.gray), d(e, "--gray-a", (ca = a.palette) == null ? void 0 : ca.grayAlpha), d(e, "--black-a", (ua = a.palette) == null ? void 0 : ua.blackAlpha), d(e, "--white-a", (fa = a.palette) == null ? void 0 : fa.whiteAlpha), d(e, "--accent-", (xa = a.palette) == null ? void 0 : xa.accent), d(e, "--accent-a", (ga = a.palette) == null ? void 0 : ga.accentAlpha), d(e, "--space-", a.spaceScale), d(e, "--radius-", a.radiusScale), d(e, "--font-size-", (va = a.typography) == null ? void 0 : va.fontScale), d(e, "--line-height-", (ma = a.typography) == null ? void 0 : ma.lineHeight), d(e, "--letter-spacing-", (l = a.typography) == null ? void 0 : l.letterSpacing), d(e, "--shadow-", a.shadows), d(e, "--base-button-", (ha = a.components) == null ? void 0 : ha.button), d(e, "--base-badge-", (g = a.components) == null ? void 0 : g.badge), d(e, "--base-dropdown-", (b = a.components) == null ? void 0 : b.dropdown), d(e, "--base-select-", (wa = a.components) == null ? void 0 : wa.select), d(e, "--base-sidebar-", (ka = a.components) == null ? void 0 : ka.sidebar), d(e, "--base-block-controls-", (_a = a.components) == null ? void 0 : _a.blockControls), d(e, "--base-box-", (Sa = a.components) == null ? void 0 : Sa.box), d(e, "--base-breadcrumb-", (Ca = a.components) == null ? void 0 : Ca.breadcrumb), d(e, "--base-card-", (za = a.components) == null ? void 0 : za.card), d(e, "--base-multi-select-", (Ea = a.components) == null ? void 0 : Ea.multiSelect), d(e, "--base-navigation-menu-", (Aa = a.components) == null ? void 0 : Aa.navigationMenu), d(e, "--base-menubar-", (qa = a.components) == null ? void 0 : qa.menubar), d(e, "--base-context-menu-", (Ia = a.components) == null ? void 0 : Ia.contextMenu), d(e, "--base-alert-", (La = a.components) == null ? void 0 : La.alert), d(e, "--base-alert-dialog-", (Pa = a.components) == null ? void 0 : Pa.alertDialog), d(e, "--base-app-header-", (Da = a.components) == null ? void 0 : Da.appHeader), d(e, "--base-aspect-ratio-", (Oa = a.components) == null ? void 0 : Oa.aspectRatio), d(e, "--base-avatar-", (Ta = a.components) == null ? void 0 : Ta.avatar), d(e, "--base-menu-", (Ma = a.components) == null ? void 0 : Ma.menu), d(e, "--base-panel-", (Ha = a.components) == null ? void 0 : Ha.panel), d(e, "--base-input-", (Ra = a.components) == null ? void 0 : Ra.input);
|
|
1883
1866
|
}
|
|
1884
|
-
function
|
|
1867
|
+
function de(e, a = typeof document < "u" ? document : null) {
|
|
1885
1868
|
if (!a)
|
|
1886
1869
|
return;
|
|
1887
|
-
const i = ne(e),
|
|
1888
|
-
let
|
|
1889
|
-
if (a === document ?
|
|
1890
|
-
for (const
|
|
1870
|
+
const i = ne(e), r = a === document || a instanceof ShadowRoot;
|
|
1871
|
+
let t;
|
|
1872
|
+
if (a === document ? t = document.documentElement : a instanceof ShadowRoot ? t = a.host : t = a, Za(t, i), r)
|
|
1873
|
+
for (const o of oe)
|
|
1891
1874
|
try {
|
|
1892
|
-
|
|
1875
|
+
Za(o, i);
|
|
1893
1876
|
} catch {
|
|
1894
1877
|
}
|
|
1895
1878
|
}
|
|
1896
1879
|
export {
|
|
1897
|
-
te as V,
|
|
1898
1880
|
de as _,
|
|
1899
|
-
|
|
1900
|
-
le as
|
|
1901
|
-
|
|
1881
|
+
te as o,
|
|
1882
|
+
le as p,
|
|
1883
|
+
se as w
|
|
1902
1884
|
};
|