@editora/ui-core 0.2.0 → 0.2.2
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 +8 -0
- package/dist/accordion.cjs.js +1 -1
- package/dist/accordion.esm.js +1 -1
- package/dist/alert-dialog.cjs.js +32 -24
- package/dist/alert-dialog.esm.js +48 -40
- package/dist/alert.cjs.js +2 -2
- package/dist/alert.esm.js +2 -2
- package/dist/animated-text.cjs.js +5 -5
- package/dist/animated-text.esm.js +5 -5
- package/dist/app-header.cjs.js +12 -7
- package/dist/app-header.esm.js +12 -7
- package/dist/avatar.cjs.js +3 -3
- package/dist/avatar.esm.js +3 -3
- package/dist/{calendar-o273O28D.js → calendar-CzpWDxLc.js} +5 -4
- package/dist/{calendar-DmxiZrR7.mjs → calendar-DkSDFg33.mjs} +1 -0
- package/dist/calendar.cjs.js +1 -1
- package/dist/calendar.esm.js +1 -1
- package/dist/chart.cjs.js +13 -7
- package/dist/chart.esm.js +13 -7
- package/dist/collapsible.cjs.js +2 -2
- package/dist/collapsible.esm.js +2 -2
- package/dist/color-picker.cjs.js +3 -3
- package/dist/color-picker.esm.js +3 -3
- package/dist/combobox.cjs.js +3 -3
- package/dist/combobox.esm.js +36 -36
- package/dist/components/ui-alert-dialog.d.ts.map +1 -1
- package/dist/components/ui-app-header.d.ts.map +1 -1
- package/dist/components/ui-calendar.d.ts.map +1 -1
- package/dist/components/ui-chart.d.ts.map +1 -1
- package/dist/components/ui-gantt.d.ts.map +1 -1
- package/dist/components/ui-hover-card.d.ts.map +1 -1
- package/dist/components/ui-inline-edit.d.ts.map +1 -1
- package/dist/components/ui-multi-select.d.ts.map +1 -1
- package/dist/components/ui-sidebar.d.ts.map +1 -1
- package/dist/components/ui-tabs.d.ts.map +1 -1
- package/dist/components/ui-wizard.d.ts.map +1 -1
- package/dist/context-menu.cjs.js +1 -1
- package/dist/context-menu.esm.js +1 -1
- package/dist/data-table.cjs.js +3 -3
- package/dist/data-table.esm.js +3 -3
- package/dist/date-field.cjs.js +2 -2
- package/dist/date-field.esm.js +14 -14
- package/dist/date-picker.cjs.js +3 -3
- package/dist/date-picker.esm.js +4 -4
- package/dist/date-range-picker.cjs.js +3 -3
- package/dist/date-range-picker.esm.js +59 -59
- package/dist/date-range-time-picker.cjs.js +2 -2
- package/dist/date-range-time-picker.esm.js +3 -3
- package/dist/date-time-picker.cjs.js +2 -2
- package/dist/date-time-picker.esm.js +3 -3
- package/dist/{date-time-utils-DdigV4hs.js → date-time-utils-C-4eHTyy.js} +1 -1
- package/dist/{date-time-utils-B4hAkt36.mjs → date-time-utils-zAx4ghvC.mjs} +1 -1
- package/dist/description.cjs.js +4 -4
- package/dist/description.esm.js +4 -4
- package/dist/dialog.cjs.js +2 -2
- package/dist/dialog.esm.js +2 -2
- package/dist/direction-provider.cjs.js +1 -1
- package/dist/direction-provider.esm.js +1 -1
- package/dist/dock.cjs.js +1 -1
- package/dist/dock.esm.js +1 -1
- package/dist/dropdown.cjs.js +1 -1
- package/dist/dropdown.esm.js +1 -1
- package/dist/field-error.cjs.js +1 -1
- package/dist/field-error.esm.js +7 -7
- package/dist/field.cjs.js +1 -1
- package/dist/field.esm.js +29 -29
- package/dist/fieldset.cjs.js +4 -4
- package/dist/fieldset.esm.js +3 -3
- package/dist/file-upload.cjs.js +2 -2
- package/dist/file-upload.esm.js +2 -2
- package/dist/flex.cjs.js +2 -2
- package/dist/flex.esm.js +8 -8
- package/dist/form.cjs.js +4 -4
- package/dist/form.esm.js +4 -4
- package/dist/gantt.cjs.js +7 -5
- package/dist/gantt.esm.js +7 -5
- package/dist/grid.cjs.js +1 -1
- package/dist/grid.esm.js +1 -1
- package/dist/hover-card.cjs.js +1 -1
- package/dist/hover-card.esm.js +11 -8
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/inline-edit.cjs.js +6 -6
- package/dist/inline-edit.esm.js +15 -15
- package/dist/input.cjs.js +1 -1
- package/dist/input.esm.js +1 -1
- package/dist/label.cjs.js +6 -6
- package/dist/label.esm.js +6 -6
- package/dist/masonry-grid.cjs.js +2 -2
- package/dist/masonry-grid.esm.js +11 -11
- package/dist/{menu-item-styles-IGSFLAHu.mjs → menu-item-styles-CdqxPUuw.mjs} +15 -15
- package/dist/{menu-item-styles-B4onAr4C.js → menu-item-styles-DUdyjQ7i.js} +10 -10
- package/dist/menu.cjs.js +1 -1
- package/dist/menu.esm.js +1 -1
- package/dist/menubar.cjs.js +1 -1
- package/dist/menubar.esm.js +1 -1
- package/dist/multi-select.cjs.js +7 -7
- package/dist/multi-select.esm.js +26 -26
- package/dist/number-field.cjs.js +1 -1
- package/dist/number-field.esm.js +1 -1
- package/dist/number-ticker.cjs.js +4 -4
- package/dist/number-ticker.esm.js +10 -10
- package/dist/odometer.cjs.js +7 -7
- package/dist/odometer.esm.js +14 -14
- package/dist/password-field.cjs.js +1 -1
- package/dist/password-field.esm.js +1 -1
- package/dist/pin-input.cjs.js +1 -1
- package/dist/pin-input.esm.js +1 -1
- package/dist/placement-grid.cjs.js +1 -1
- package/dist/placement-grid.esm.js +1 -1
- package/dist/portal.cjs.js +1 -1
- package/dist/portal.esm.js +1 -1
- package/dist/presence.cjs.js +1 -1
- package/dist/presence.esm.js +1 -1
- package/dist/quick-actions.cjs.js +1 -1
- package/dist/quick-actions.esm.js +1 -1
- package/dist/radio.cjs.js +1 -1
- package/dist/radio.esm.js +1 -1
- package/dist/{runtime-CQM6wZOc.mjs → runtime-CJzoaC8Z.mjs} +385 -329
- package/dist/runtime-DYSIU3sR.js +5 -0
- package/dist/runtime.cjs.js +1 -1
- package/dist/runtime.esm.js +1 -1
- package/dist/select.cjs.js +2 -2
- package/dist/select.esm.js +2 -2
- package/dist/separator.cjs.js +6 -6
- package/dist/separator.esm.js +7 -7
- package/dist/sidebar.cjs.js +7 -6
- package/dist/sidebar.esm.js +7 -6
- package/dist/slot.cjs.js +1 -1
- package/dist/slot.esm.js +1 -1
- package/dist/sortable.cjs.js +6 -6
- package/dist/sortable.esm.js +6 -6
- package/dist/split-button.cjs.js +2 -2
- package/dist/split-button.esm.js +2 -2
- package/dist/tabs.cjs.js +11 -6
- package/dist/tabs.esm.js +28 -23
- package/dist/tags-input.cjs.js +2 -2
- package/dist/tags-input.esm.js +2 -2
- package/dist/textarea.cjs.js +2 -2
- package/dist/textarea.esm.js +16 -16
- package/dist/theme.d.ts.map +1 -1
- package/dist/time-field.cjs.js +2 -2
- package/dist/time-field.esm.js +24 -24
- package/dist/time-picker.cjs.js +2 -2
- package/dist/time-picker.esm.js +3 -3
- package/dist/toast.cjs.js +2 -2
- package/dist/toast.esm.js +2 -2
- package/dist/transfer-list.cjs.js +9 -9
- package/dist/transfer-list.esm.js +4 -4
- package/dist/wizard.cjs.js +16 -7
- package/dist/wizard.esm.js +16 -7
- package/package.json +1 -1
- package/dist/runtime-DxCl0A5q.js +0 -5
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import "./portal-DeaM1tYY.mjs";
|
|
2
2
|
import "./positioner-BE8Nbho2.mjs";
|
|
3
|
-
function
|
|
3
|
+
function A() {
|
|
4
4
|
return typeof window < "u" && typeof document < "u";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function N(n) {
|
|
7
7
|
return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function V(n) {
|
|
10
10
|
return n === "replace" || n === "stack" ? n : "queue";
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function L(n) {
|
|
13
13
|
return `ui-alert-dialog-${n}`;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
const e = n.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action,
|
|
15
|
+
function Z(n, a) {
|
|
16
|
+
const e = n.kind === "alert" && a.action === "cancel" ? "dismiss" : a.action, t = n.dialog?.getChecked();
|
|
17
17
|
if (n.kind === "prompt") {
|
|
18
18
|
const i = n.dialog?.getInputValue() ?? n.value ?? "";
|
|
19
19
|
return {
|
|
20
20
|
id: n.id,
|
|
21
21
|
action: e,
|
|
22
22
|
value: i,
|
|
23
|
-
checked:
|
|
23
|
+
checked: t,
|
|
24
24
|
source: a.source,
|
|
25
25
|
reason: a.reason
|
|
26
26
|
};
|
|
@@ -29,12 +29,12 @@ function B(n, a) {
|
|
|
29
29
|
id: n.id,
|
|
30
30
|
action: e,
|
|
31
31
|
value: n.value,
|
|
32
|
-
checked:
|
|
32
|
+
checked: t,
|
|
33
33
|
source: a.source,
|
|
34
34
|
reason: a.reason
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function y(n, a, e) {
|
|
38
38
|
return n.kind === "prompt" ? {
|
|
39
39
|
id: n.id,
|
|
40
40
|
action: "dismiss",
|
|
@@ -51,10 +51,10 @@ function h(n, a, e) {
|
|
|
51
51
|
reason: e
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
|
-
function
|
|
54
|
+
function U(n) {
|
|
55
55
|
return n === "esc" || n === "backdrop" || n === "close-icon" || n === "abort" || n === "unmount" || n === "replace" || n === "programmatic" ? n : "abort";
|
|
56
56
|
}
|
|
57
|
-
class
|
|
57
|
+
class Q {
|
|
58
58
|
constructor(a) {
|
|
59
59
|
this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._defaults = {}, this._container = a ?? null;
|
|
60
60
|
}
|
|
@@ -77,42 +77,42 @@ class V {
|
|
|
77
77
|
this._disposed = !0;
|
|
78
78
|
const e = [...this._active, ...this._queue];
|
|
79
79
|
this._queue = [];
|
|
80
|
-
for (const
|
|
81
|
-
this._settle(
|
|
80
|
+
for (const t of e)
|
|
81
|
+
this._settle(t, y(t, a), !1);
|
|
82
82
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
83
83
|
}
|
|
84
84
|
_enqueue(a, e) {
|
|
85
|
-
const
|
|
86
|
-
if (!
|
|
85
|
+
const t = this._mergeOptions(e);
|
|
86
|
+
if (!A() || this._disposed) {
|
|
87
87
|
const s = {
|
|
88
|
-
id:
|
|
88
|
+
id: t.id || L(++this._seed),
|
|
89
89
|
action: "dismiss",
|
|
90
90
|
source: "unmount"
|
|
91
91
|
};
|
|
92
92
|
return Promise.resolve(s);
|
|
93
93
|
}
|
|
94
|
-
const i =
|
|
94
|
+
const i = t.id || L(++this._seed), r = V(t.mode);
|
|
95
95
|
return new Promise((s) => {
|
|
96
96
|
const c = {
|
|
97
97
|
id: i,
|
|
98
98
|
kind: a,
|
|
99
|
-
mode:
|
|
100
|
-
options:
|
|
99
|
+
mode: r,
|
|
100
|
+
options: t,
|
|
101
101
|
settled: !1,
|
|
102
102
|
processing: !1,
|
|
103
103
|
resolve: s,
|
|
104
104
|
cleanup: []
|
|
105
105
|
};
|
|
106
|
-
if (
|
|
107
|
-
this._settle(c,
|
|
106
|
+
if (t.signal?.aborted) {
|
|
107
|
+
this._settle(c, y(c, "abort"), !1);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
110
|
+
if (r === "replace") {
|
|
111
111
|
const d = this._active[this._active.length - 1];
|
|
112
|
-
d && this._settle(d,
|
|
112
|
+
d && this._settle(d, y(d, "replace", "replace"), !1, !1), this._open(c);
|
|
113
113
|
return;
|
|
114
114
|
}
|
|
115
|
-
if (
|
|
115
|
+
if (r === "stack") {
|
|
116
116
|
this._open(c);
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
@@ -126,68 +126,68 @@ class V {
|
|
|
126
126
|
_open(a) {
|
|
127
127
|
const e = this._ensureContainer();
|
|
128
128
|
if (!e) {
|
|
129
|
-
this._settle(a,
|
|
129
|
+
this._settle(a, y(a, "unmount"), !1);
|
|
130
130
|
return;
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
a.dialog =
|
|
132
|
+
const t = document.createElement("ui-alert-dialog");
|
|
133
|
+
a.dialog = t, a.checked = !!a.options.checkbox?.defaultChecked;
|
|
134
134
|
const i = this._buildConfig(a);
|
|
135
|
-
|
|
136
|
-
const
|
|
135
|
+
t.dialogId = a.id, t.config = i;
|
|
136
|
+
const r = (d) => {
|
|
137
137
|
if (a.settled) return;
|
|
138
|
-
const
|
|
139
|
-
a.value =
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
d.preventDefault(),
|
|
138
|
+
const f = d.detail;
|
|
139
|
+
a.value = f?.inputValue, a.checked = f?.checked;
|
|
140
|
+
const g = this._validatePrompt(a);
|
|
141
|
+
if (g) {
|
|
142
|
+
d.preventDefault(), t.setError(g);
|
|
143
143
|
return;
|
|
144
144
|
}
|
|
145
145
|
if (!a.options.onConfirm) {
|
|
146
|
-
|
|
146
|
+
t.clearError();
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
|
-
d.preventDefault(), a.processing = !0,
|
|
149
|
+
d.preventDefault(), a.processing = !0, t.state = "loading", t.clearError(), Promise.resolve(
|
|
150
150
|
a.options.onConfirm({
|
|
151
151
|
id: a.id,
|
|
152
152
|
value: a.value,
|
|
153
153
|
checked: a.checked,
|
|
154
|
-
dialog:
|
|
154
|
+
dialog: t,
|
|
155
155
|
signal: a.options.signal
|
|
156
156
|
})
|
|
157
157
|
).then(() => {
|
|
158
|
-
a.processing = !1,
|
|
159
|
-
}).catch((
|
|
160
|
-
a.processing = !1,
|
|
158
|
+
a.processing = !1, t.state = "idle", t.clearError(), a.settled || t.close("confirm");
|
|
159
|
+
}).catch((m) => {
|
|
160
|
+
a.processing = !1, t.state = "error", t.setError(N(m));
|
|
161
161
|
});
|
|
162
162
|
}, s = () => {
|
|
163
|
-
a.settled || (a.value =
|
|
163
|
+
a.settled || (a.value = t.getInputValue(), a.checked = t.getChecked(), t.state === "error" && t.clearError());
|
|
164
164
|
}, c = (d) => {
|
|
165
165
|
if (a.settled) return;
|
|
166
|
-
const
|
|
167
|
-
this._handleClose(a,
|
|
166
|
+
const f = d.detail;
|
|
167
|
+
this._handleClose(a, f);
|
|
168
168
|
};
|
|
169
|
-
if (
|
|
169
|
+
if (t.addEventListener("ui-confirm", r), t.addEventListener("ui-change", s), t.addEventListener("ui-close", c), a.cleanup.push(() => t.removeEventListener("ui-confirm", r)), a.cleanup.push(() => t.removeEventListener("ui-change", s)), a.cleanup.push(() => t.removeEventListener("ui-close", c)), a.options.signal) {
|
|
170
170
|
const d = () => {
|
|
171
|
-
a.settled || this._settle(a,
|
|
171
|
+
a.settled || this._settle(a, y(a, "abort"), !1);
|
|
172
172
|
};
|
|
173
173
|
a.options.signal.addEventListener("abort", d, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", d));
|
|
174
174
|
}
|
|
175
|
-
this._active.push(a), e.appendChild(
|
|
175
|
+
this._active.push(a), e.appendChild(t), t.open = !0, this._updateStackZIndex();
|
|
176
176
|
}
|
|
177
177
|
_validatePrompt(a) {
|
|
178
178
|
if (a.kind !== "prompt") return null;
|
|
179
|
-
const
|
|
180
|
-
return
|
|
179
|
+
const t = a.options.input, i = a.dialog?.getInputValue() ?? a.value ?? "";
|
|
180
|
+
return t?.required && !i.trim() ? "Please enter a value." : t?.validate ? t.validate(i) : null;
|
|
181
181
|
}
|
|
182
|
-
_settle(a, e,
|
|
182
|
+
_settle(a, e, t, i = !0) {
|
|
183
183
|
if (!a.settled) {
|
|
184
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
187
|
-
const s =
|
|
188
|
-
|
|
184
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
|
|
185
|
+
const r = a.dialog;
|
|
186
|
+
if (!t && r.open) {
|
|
187
|
+
const s = U(e.source);
|
|
188
|
+
r.close("dismiss", s, e.reason);
|
|
189
189
|
}
|
|
190
|
-
|
|
190
|
+
r.parentElement && r.parentElement.removeChild(r);
|
|
191
191
|
}
|
|
192
192
|
a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
|
|
193
193
|
}
|
|
@@ -205,7 +205,7 @@ class V {
|
|
|
205
205
|
a && this._open(a);
|
|
206
206
|
}
|
|
207
207
|
_buildConfig(a) {
|
|
208
|
-
const e = a.options,
|
|
208
|
+
const e = a.options, t = a.kind === "prompt", i = a.kind === "alert", r = t ? e.input : void 0;
|
|
209
209
|
return {
|
|
210
210
|
id: a.id,
|
|
211
211
|
title: e.title,
|
|
@@ -219,7 +219,7 @@ class V {
|
|
|
219
219
|
closeOnBackdrop: e.closeOnBackdrop,
|
|
220
220
|
lockWhileLoading: e.lockWhileLoading ?? !0,
|
|
221
221
|
role: e.role || "alertdialog",
|
|
222
|
-
tone: e.tone || (i ? "info" :
|
|
222
|
+
tone: e.tone || (i ? "info" : t ? "neutral" : "warning"),
|
|
223
223
|
size: e.size || "md",
|
|
224
224
|
variant: e.variant || "surface",
|
|
225
225
|
radius: e.radius,
|
|
@@ -233,11 +233,11 @@ class V {
|
|
|
233
233
|
showCancel: !i,
|
|
234
234
|
showClose: e.dismissible ?? !0,
|
|
235
235
|
input: {
|
|
236
|
-
enabled:
|
|
237
|
-
label:
|
|
238
|
-
placeholder:
|
|
239
|
-
value:
|
|
240
|
-
required:
|
|
236
|
+
enabled: t,
|
|
237
|
+
label: r?.label,
|
|
238
|
+
placeholder: r?.placeholder,
|
|
239
|
+
value: r?.defaultValue || "",
|
|
240
|
+
required: r?.required
|
|
241
241
|
},
|
|
242
242
|
checkbox: {
|
|
243
243
|
enabled: !!e.checkbox?.enabled,
|
|
@@ -256,10 +256,10 @@ class V {
|
|
|
256
256
|
};
|
|
257
257
|
}
|
|
258
258
|
_handleClose(a, e) {
|
|
259
|
-
const
|
|
259
|
+
const t = Z(a, e);
|
|
260
260
|
if (e.action === "cancel" && a.options.onCancel) {
|
|
261
261
|
Promise.resolve(a.options.onCancel(this._buildLifecycleContext(a))).finally(() => {
|
|
262
|
-
this._settle(a,
|
|
262
|
+
this._settle(a, t, !0);
|
|
263
263
|
});
|
|
264
264
|
return;
|
|
265
265
|
}
|
|
@@ -271,11 +271,11 @@ class V {
|
|
|
271
271
|
reason: e.reason
|
|
272
272
|
})
|
|
273
273
|
).finally(() => {
|
|
274
|
-
this._settle(a,
|
|
274
|
+
this._settle(a, t, !0);
|
|
275
275
|
});
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
278
|
-
this._settle(a,
|
|
278
|
+
this._settle(a, t, !0);
|
|
279
279
|
}
|
|
280
280
|
_mergeOptions(a) {
|
|
281
281
|
const e = this._defaults;
|
|
@@ -289,7 +289,7 @@ class V {
|
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
291
|
_ensureContainer() {
|
|
292
|
-
if (!
|
|
292
|
+
if (!A()) return null;
|
|
293
293
|
if (this._container && this._container.isConnected) return this._container;
|
|
294
294
|
let a = document.querySelector('[data-ui-alert-dialog-host="true"]');
|
|
295
295
|
return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-alert-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1000", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
|
|
@@ -301,38 +301,38 @@ class V {
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
let
|
|
305
|
-
function
|
|
306
|
-
return new
|
|
304
|
+
let h = null;
|
|
305
|
+
function W(n = {}) {
|
|
306
|
+
return new Q(n.container ?? null);
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
return
|
|
308
|
+
function T() {
|
|
309
|
+
return h || (h = W()), h;
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
return
|
|
311
|
+
function xa(n = {}) {
|
|
312
|
+
return T().alert(n);
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
return
|
|
314
|
+
function ha(n = {}) {
|
|
315
|
+
return T().confirm(n);
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
return
|
|
317
|
+
function ba(n = {}) {
|
|
318
|
+
return T().prompt(n);
|
|
319
319
|
}
|
|
320
|
-
function
|
|
321
|
-
|
|
320
|
+
function va(n = "programmatic") {
|
|
321
|
+
h && (h.destroy(n), h = null);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function I() {
|
|
324
324
|
return typeof window < "u" && typeof document < "u";
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function G(n) {
|
|
327
327
|
return n === "replace" || n === "stack" ? n : "queue";
|
|
328
328
|
}
|
|
329
|
-
function
|
|
329
|
+
function O(n) {
|
|
330
330
|
return `ui-dialog-${n}`;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function X(n) {
|
|
333
333
|
return n ? typeof n == "string" ? n : n instanceof Error && n.message ? n.message : "Something went wrong. Please try again." : "Something went wrong. Please try again.";
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class K {
|
|
336
336
|
constructor(a) {
|
|
337
337
|
this._container = null, this._ownsContainer = !1, this._queue = [], this._active = [], this._disposed = !1, this._seed = 0, this._container = a ?? null;
|
|
338
338
|
}
|
|
@@ -349,9 +349,9 @@ class W {
|
|
|
349
349
|
this._disposed = !0;
|
|
350
350
|
const e = [...this._active, ...this._queue];
|
|
351
351
|
this._queue = [];
|
|
352
|
-
for (const
|
|
353
|
-
this._settle(
|
|
354
|
-
id:
|
|
352
|
+
for (const t of e)
|
|
353
|
+
this._settle(t, {
|
|
354
|
+
id: t.id,
|
|
355
355
|
action: "dismiss",
|
|
356
356
|
source: a,
|
|
357
357
|
reason: a
|
|
@@ -359,40 +359,40 @@ class W {
|
|
|
359
359
|
this._active = [], this._ownsContainer && this._container && this._container.parentElement && this._container.parentElement.removeChild(this._container), this._container = null, this._ownsContainer = !1;
|
|
360
360
|
}
|
|
361
361
|
_enqueue(a) {
|
|
362
|
-
if (!
|
|
362
|
+
if (!I() || this._disposed)
|
|
363
363
|
return Promise.resolve({
|
|
364
|
-
id: a.id ||
|
|
364
|
+
id: a.id || O(++this._seed),
|
|
365
365
|
action: "dismiss",
|
|
366
366
|
source: "unmount"
|
|
367
367
|
});
|
|
368
|
-
const e = a.id ||
|
|
368
|
+
const e = a.id || O(++this._seed), t = G(a.mode);
|
|
369
369
|
return new Promise((i) => {
|
|
370
|
-
const
|
|
370
|
+
const r = {
|
|
371
371
|
id: e,
|
|
372
|
-
mode:
|
|
372
|
+
mode: t,
|
|
373
373
|
options: a,
|
|
374
374
|
settled: !1,
|
|
375
375
|
resolve: i,
|
|
376
376
|
cleanup: []
|
|
377
377
|
};
|
|
378
378
|
if (a.signal?.aborted) {
|
|
379
|
-
this._settle(
|
|
379
|
+
this._settle(r, { id: e, action: "dismiss", source: "abort" }, !1);
|
|
380
380
|
return;
|
|
381
381
|
}
|
|
382
|
-
if (
|
|
382
|
+
if (t === "replace") {
|
|
383
383
|
const s = this._active[this._active.length - 1];
|
|
384
|
-
s && this._settle(s, { id: s.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(
|
|
384
|
+
s && this._settle(s, { id: s.id, action: "dismiss", source: "replace", reason: "replace" }, !1, !1), this._open(r);
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
if (
|
|
388
|
-
this._open(
|
|
387
|
+
if (t === "stack") {
|
|
388
|
+
this._open(r);
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
if (this._active.length > 0) {
|
|
392
|
-
this._queue.push(
|
|
392
|
+
this._queue.push(r);
|
|
393
393
|
return;
|
|
394
394
|
}
|
|
395
|
-
this._open(
|
|
395
|
+
this._open(r);
|
|
396
396
|
});
|
|
397
397
|
}
|
|
398
398
|
_open(a) {
|
|
@@ -405,28 +405,28 @@ class W {
|
|
|
405
405
|
}, !1);
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
|
-
const
|
|
409
|
-
a.dialog =
|
|
408
|
+
const t = document.createElement("ui-dialog");
|
|
409
|
+
a.dialog = t;
|
|
410
410
|
const i = this._buildConfig(a.options, a.id);
|
|
411
|
-
|
|
412
|
-
const
|
|
411
|
+
t.dialogId = a.id, t.config = i;
|
|
412
|
+
const r = (c) => {
|
|
413
413
|
if (a.settled) return;
|
|
414
414
|
const d = c.detail;
|
|
415
415
|
if (a.resultFormData = d?.formData, !a.options.onSubmit) {
|
|
416
|
-
|
|
416
|
+
t.clearError();
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
|
-
c.preventDefault(),
|
|
419
|
+
c.preventDefault(), t.state = "loading", t.clearError(), Promise.resolve(
|
|
420
420
|
a.options.onSubmit({
|
|
421
421
|
id: a.id,
|
|
422
|
-
dialog:
|
|
422
|
+
dialog: t,
|
|
423
423
|
signal: a.options.signal,
|
|
424
424
|
formData: d?.formData
|
|
425
425
|
})
|
|
426
426
|
).then(() => {
|
|
427
|
-
a.settled || (
|
|
428
|
-
}).catch((
|
|
429
|
-
|
|
427
|
+
a.settled || (t.state = "idle", t.clearError(), t.close("submit"));
|
|
428
|
+
}).catch((f) => {
|
|
429
|
+
t.state = "error", t.setError(X(f));
|
|
430
430
|
});
|
|
431
431
|
}, s = (c) => {
|
|
432
432
|
if (a.settled) return;
|
|
@@ -439,7 +439,7 @@ class W {
|
|
|
439
439
|
formData: a.resultFormData
|
|
440
440
|
}, !0);
|
|
441
441
|
};
|
|
442
|
-
if (
|
|
442
|
+
if (t.addEventListener("ui-submit", r), t.addEventListener("ui-close", s), a.cleanup.push(() => t.removeEventListener("ui-submit", r)), a.cleanup.push(() => t.removeEventListener("ui-close", s)), a.options.signal) {
|
|
443
443
|
const c = () => {
|
|
444
444
|
a.settled || this._settle(a, {
|
|
445
445
|
id: a.id,
|
|
@@ -449,13 +449,13 @@ class W {
|
|
|
449
449
|
};
|
|
450
450
|
a.options.signal.addEventListener("abort", c, { once: !0 }), a.cleanup.push(() => a.options.signal?.removeEventListener("abort", c));
|
|
451
451
|
}
|
|
452
|
-
this._active.push(a), e.appendChild(
|
|
452
|
+
this._active.push(a), e.appendChild(t), t.openDialog(), this._updateStackZIndex();
|
|
453
453
|
}
|
|
454
|
-
_settle(a, e,
|
|
454
|
+
_settle(a, e, t, i = !0) {
|
|
455
455
|
if (!a.settled) {
|
|
456
|
-
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((
|
|
457
|
-
const
|
|
458
|
-
!
|
|
456
|
+
if (a.settled = !0, this._cleanupRequest(a), this._active = this._active.filter((r) => r !== a), this._queue = this._queue.filter((r) => r !== a), a.dialog) {
|
|
457
|
+
const r = a.dialog;
|
|
458
|
+
!t && r.open && r.close("dismiss", e.source || "abort", e.reason), r.parentElement && r.parentElement.removeChild(r);
|
|
459
459
|
}
|
|
460
460
|
a.resolve(e), this._updateStackZIndex(), !this._disposed && i && this._drainQueue();
|
|
461
461
|
}
|
|
@@ -497,7 +497,7 @@ class W {
|
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
_ensureContainer() {
|
|
500
|
-
if (!
|
|
500
|
+
if (!I()) return null;
|
|
501
501
|
if (this._container && this._container.isConnected) return this._container;
|
|
502
502
|
let a = document.querySelector('[data-ui-dialog-host="true"]');
|
|
503
503
|
return a ? this._ownsContainer = !1 : (a = document.createElement("div"), a.setAttribute("data-ui-dialog-host", "true"), a.style.position = "relative", a.style.zIndex = "1200", document.body.appendChild(a), this._ownsContainer = !0), this._container = a, a;
|
|
@@ -509,36 +509,36 @@ class W {
|
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
let
|
|
513
|
-
function
|
|
514
|
-
return new
|
|
512
|
+
let b = null;
|
|
513
|
+
function J(n = {}) {
|
|
514
|
+
return new K(n.container ?? null);
|
|
515
515
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
516
|
+
function M() {
|
|
517
|
+
return b || (b = J()), b;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
519
|
+
function ya(n = {}) {
|
|
520
|
+
return M().open(n);
|
|
521
521
|
}
|
|
522
|
-
function
|
|
523
|
-
return
|
|
522
|
+
function wa(n = {}) {
|
|
523
|
+
return M().confirm(n);
|
|
524
524
|
}
|
|
525
|
-
function
|
|
526
|
-
|
|
525
|
+
function ka(n = "programmatic") {
|
|
526
|
+
b && (b.destroy(n), b = null);
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
530
|
-
const a = n.palette?.gray || {}, e = n.palette?.accent || {},
|
|
531
|
-
d && (
|
|
528
|
+
const Y = ["1", "2", "3", "4"], q = { 1: "24px", 2: "32px", 3: "40px", 4: "48px" }, aa = { 1: "12px", 2: "14px", 3: "16px", 4: "18px" }, ea = { 1: "8px", 2: "12px", 3: "16px", 4: "20px" }, na = { 1: 0, 2: 0, 3: 2, 4: 4 };
|
|
529
|
+
function ta(n) {
|
|
530
|
+
const a = n.palette?.gray || {}, e = n.palette?.accent || {}, t = n.radiusScale || {}, i = n.colors, r = {}, s = (c, d) => {
|
|
531
|
+
d && (r[c] = d);
|
|
532
532
|
};
|
|
533
|
-
s("--ui-color-surface-subtle", a[2]), s("--ui-color-fill", a[3]), s("--ui-color-fill-hover", a[4]), s("--ui-color-fill-active", a[5]), s("--ui-color-line-subtle", a[6]), s("--ui-color-line", a[7]), s("--ui-color-line-strong", a[8]), s("--ui-color-text-secondary", a[11] || i.muted), s("--ui-color-text-strong", a[12] || i.text), s("--ui-color-accent-subtle", e[2]), s("--ui-color-accent-fill", e[3]), s("--ui-color-accent-fill-hover", e[4]), s("--ui-color-accent-fill-active", e[5]), s("--ui-color-accent-line", e[7]), s("--ui-color-accent-solid", e[9] || i.primary), s("--ui-color-accent-solid-hover", e[10] || i.primaryHover || i.primary), s("--ui-color-accent-text", e[11]), s("--ui-color-surface-elevated", n.surfaces?.panelSolid || i.surfaceAlt || i.surface), s("--ui-color-info", i.info), s("--ui-color-placeholder", i.text ? `color-mix(in srgb, ${i.text} 62%, transparent)` : void 0), s("--ui-ring-color", i.focusRing || i.primary),
|
|
534
|
-
for (const c of
|
|
535
|
-
|
|
536
|
-
const d =
|
|
537
|
-
|
|
533
|
+
s("--ui-color-surface-subtle", a[2]), s("--ui-color-fill", a[3]), s("--ui-color-fill-hover", a[4]), s("--ui-color-fill-active", a[5]), s("--ui-color-line-subtle", a[6]), s("--ui-color-line", a[7]), s("--ui-color-line-strong", a[8]), s("--ui-color-text-secondary", a[11] || i.muted), s("--ui-color-text-strong", a[12] || i.text), s("--ui-color-accent-subtle", e[2]), s("--ui-color-accent-fill", e[3]), s("--ui-color-accent-fill-hover", e[4]), s("--ui-color-accent-fill-active", e[5]), s("--ui-color-accent-line", e[7]), s("--ui-color-accent-solid", e[9] || i.primary), s("--ui-color-accent-solid-hover", e[10] || i.primaryHover || i.primary), s("--ui-color-accent-text", e[11]), s("--ui-color-surface-elevated", n.surfaces?.panelSolid || i.surfaceAlt || i.surface), s("--ui-color-info", i.info), s("--ui-color-placeholder", i.text ? `color-mix(in srgb, ${i.text} 62%, transparent)` : void 0), s("--ui-ring-color", i.focusRing || i.primary), r["--ui-ring-width"] = "2px", r["--ui-ring-offset"] = "2px";
|
|
534
|
+
for (const c of Y) {
|
|
535
|
+
r[`--ui-control-height-${c}`] = q[c], r[`--ui-control-font-size-${c}`] = aa[c], r[`--ui-control-padding-inline-${c}`] = ea[c];
|
|
536
|
+
const d = na[c], f = n.radius || t[2] || "6px";
|
|
537
|
+
r[`--ui-control-radius-${c}`] = d ? `calc(${f} + ${d}px)` : f;
|
|
538
538
|
}
|
|
539
|
-
return
|
|
539
|
+
return r["--ui-motion-enter-easing"] = "cubic-bezier(0.16, 1, 0.3, 1)", r["--ui-motion-exit-easing"] = "cubic-bezier(0.4, 0, 1, 1)", s("--ui-font-family-mono", n.typography?.codeFamily || "monospace"), s("--font-mono", n.typography?.codeFamily || "monospace"), s("--ui-breakpoint-xl", n.breakpoints?.xl || "1280px"), r;
|
|
540
540
|
}
|
|
541
|
-
const
|
|
541
|
+
const R = {
|
|
542
542
|
1: "#0000000d",
|
|
543
543
|
2: "#0000001a",
|
|
544
544
|
3: "#00000026",
|
|
@@ -551,7 +551,7 @@ const O = {
|
|
|
551
551
|
10: "#000c",
|
|
552
552
|
11: "#000000e6",
|
|
553
553
|
12: "#000000f2"
|
|
554
|
-
},
|
|
554
|
+
}, $ = {
|
|
555
555
|
1: "#ffffff0d",
|
|
556
556
|
2: "#ffffff1a",
|
|
557
557
|
3: "#ffffff26",
|
|
@@ -564,7 +564,7 @@ const O = {
|
|
|
564
564
|
10: "#fffc",
|
|
565
565
|
11: "#ffffffe6",
|
|
566
566
|
12: "#fffffff2"
|
|
567
|
-
},
|
|
567
|
+
}, u = {
|
|
568
568
|
amber: {
|
|
569
569
|
light: {
|
|
570
570
|
scale: {
|
|
@@ -915,7 +915,7 @@ const O = {
|
|
|
915
915
|
track: "#7b7b7b"
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
|
-
},
|
|
918
|
+
}, ra = {
|
|
919
919
|
button: {
|
|
920
920
|
"classic-after-inset": "2px",
|
|
921
921
|
"classic-box-shadow-top": "inset 0 0 0 1px var(--gray-a5), inset 0 1px 1px var(--white-a10)",
|
|
@@ -1164,7 +1164,7 @@ const O = {
|
|
|
1164
1164
|
input: {
|
|
1165
1165
|
bg: "var(--color-panel-solid)"
|
|
1166
1166
|
}
|
|
1167
|
-
},
|
|
1167
|
+
}, ia = {
|
|
1168
1168
|
button: {
|
|
1169
1169
|
"classic-after-inset": "1px",
|
|
1170
1170
|
"classic-box-shadow-top": "inset 0 0 0 1px var(--white-a2), inset 0 4px 2px -2px var(--white-a3), inset 0 1px 1px var(--white-a6), inset 0 -1px 1px var(--black-a6)",
|
|
@@ -1414,41 +1414,41 @@ const O = {
|
|
|
1414
1414
|
bg: "var(--color-panel-solid)"
|
|
1415
1415
|
}
|
|
1416
1416
|
};
|
|
1417
|
-
function
|
|
1417
|
+
function w(n) {
|
|
1418
1418
|
const a = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(n.trim())?.[1];
|
|
1419
1419
|
if (!a) return null;
|
|
1420
|
-
const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6),
|
|
1421
|
-
const
|
|
1422
|
-
return
|
|
1420
|
+
const e = a.length === 3 ? a.replace(/./g, (i) => i + i) : a.slice(0, 6), t = (i) => {
|
|
1421
|
+
const r = parseInt(e.slice(i, i + 2), 16) / 255;
|
|
1422
|
+
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1423
1423
|
};
|
|
1424
|
-
return 0.2126 *
|
|
1424
|
+
return 0.2126 * t(0) + 0.7152 * t(2) + 0.0722 * t(4);
|
|
1425
1425
|
}
|
|
1426
|
-
function
|
|
1427
|
-
const e =
|
|
1428
|
-
return e === null ||
|
|
1426
|
+
function v(n, a) {
|
|
1427
|
+
const e = w(n), t = w(a);
|
|
1428
|
+
return e === null || t === null ? null : (Math.max(e, t) + 0.05) / (Math.min(e, t) + 0.05);
|
|
1429
1429
|
}
|
|
1430
|
-
function
|
|
1430
|
+
function oa(n, a) {
|
|
1431
1431
|
const e = n?.colors;
|
|
1432
1432
|
if (!e?.primary) return {};
|
|
1433
|
-
const
|
|
1434
|
-
return a ? e.primary === a.colors?.primary ? {} :
|
|
1433
|
+
const t = e.foregroundOnPrimary;
|
|
1434
|
+
return a ? e.primary === a.colors?.primary ? {} : t && t !== a.colors?.foregroundOnPrimary ? {} : { foregroundOnPrimary: k(e.primary, a.colors?.foregroundOnPrimary || "#ffffff") } : t ? {} : { foregroundOnPrimary: k(e.primary, "#ffffff") };
|
|
1435
1435
|
}
|
|
1436
|
-
function
|
|
1437
|
-
const e =
|
|
1436
|
+
function k(n, a) {
|
|
1437
|
+
const e = v(a, n);
|
|
1438
1438
|
if (e === null || e >= 4.5) return a;
|
|
1439
|
-
const
|
|
1440
|
-
return (
|
|
1439
|
+
const t = v("#ffffff", n) ?? 0;
|
|
1440
|
+
return (v("#111111", n) ?? 0) > t ? "#111111" : "#ffffff";
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1442
|
+
function H(n) {
|
|
1443
1443
|
return {
|
|
1444
1444
|
primary: n.scale[9],
|
|
1445
1445
|
primaryHover: n.scale[10] || n.scale[9],
|
|
1446
|
-
foregroundOnPrimary:
|
|
1446
|
+
foregroundOnPrimary: k(n.scale[9], n.contrast),
|
|
1447
1447
|
focusRing: n.scale[8] || n.scale[9],
|
|
1448
1448
|
warning: n.scale[9]
|
|
1449
1449
|
};
|
|
1450
1450
|
}
|
|
1451
|
-
const
|
|
1451
|
+
const _ = {
|
|
1452
1452
|
colors: {
|
|
1453
1453
|
primary: "#ffc53d",
|
|
1454
1454
|
primaryHover: "#ffba18",
|
|
@@ -1494,18 +1494,18 @@ const y = {
|
|
|
1494
1494
|
11: "#0000009b",
|
|
1495
1495
|
12: "#000000df"
|
|
1496
1496
|
},
|
|
1497
|
-
blackAlpha:
|
|
1498
|
-
whiteAlpha:
|
|
1497
|
+
blackAlpha: R,
|
|
1498
|
+
whiteAlpha: $,
|
|
1499
1499
|
accent: {
|
|
1500
|
-
...
|
|
1500
|
+
...u.amber.light.scale
|
|
1501
1501
|
},
|
|
1502
1502
|
accentAlpha: {
|
|
1503
|
-
...
|
|
1503
|
+
...u.amber.light.alphaScale
|
|
1504
1504
|
},
|
|
1505
|
-
accentContrast:
|
|
1506
|
-
accentSurface:
|
|
1507
|
-
accentIndicator:
|
|
1508
|
-
accentTrack:
|
|
1505
|
+
accentContrast: u.amber.light.contrast,
|
|
1506
|
+
accentSurface: u.amber.light.surface,
|
|
1507
|
+
accentIndicator: u.amber.light.indicator,
|
|
1508
|
+
accentTrack: u.amber.light.track
|
|
1509
1509
|
},
|
|
1510
1510
|
surfaces: {
|
|
1511
1511
|
background: "#ffffff",
|
|
@@ -1603,11 +1603,11 @@ const y = {
|
|
|
1603
1603
|
effects: {
|
|
1604
1604
|
backdropFilterPanel: "blur(64px)"
|
|
1605
1605
|
},
|
|
1606
|
-
components:
|
|
1606
|
+
components: ra,
|
|
1607
1607
|
zIndex: { modal: 1e3, overlay: 900, toast: 1100 },
|
|
1608
1608
|
breakpoints: { sm: "640px", md: "768px", lg: "1024px" }
|
|
1609
|
-
},
|
|
1610
|
-
...
|
|
1609
|
+
}, sa = {
|
|
1610
|
+
..._,
|
|
1611
1611
|
colors: {
|
|
1612
1612
|
primary: "#ffc53d",
|
|
1613
1613
|
primaryHover: "#ffd60a",
|
|
@@ -1625,7 +1625,7 @@ const y = {
|
|
|
1625
1625
|
info: "#4cc3d6"
|
|
1626
1626
|
},
|
|
1627
1627
|
palette: {
|
|
1628
|
-
...
|
|
1628
|
+
..._.palette,
|
|
1629
1629
|
gray: {
|
|
1630
1630
|
1: "#111",
|
|
1631
1631
|
2: "#191919",
|
|
@@ -1654,18 +1654,18 @@ const y = {
|
|
|
1654
1654
|
11: "#ffffffaf",
|
|
1655
1655
|
12: "#ffffffed"
|
|
1656
1656
|
},
|
|
1657
|
-
blackAlpha:
|
|
1658
|
-
whiteAlpha:
|
|
1657
|
+
blackAlpha: R,
|
|
1658
|
+
whiteAlpha: $,
|
|
1659
1659
|
accent: {
|
|
1660
|
-
...
|
|
1660
|
+
...u.amber.dark.scale
|
|
1661
1661
|
},
|
|
1662
1662
|
accentAlpha: {
|
|
1663
|
-
...
|
|
1663
|
+
...u.amber.dark.alphaScale
|
|
1664
1664
|
},
|
|
1665
|
-
accentContrast:
|
|
1666
|
-
accentSurface:
|
|
1667
|
-
accentIndicator:
|
|
1668
|
-
accentTrack:
|
|
1665
|
+
accentContrast: u.amber.dark.contrast,
|
|
1666
|
+
accentSurface: u.amber.dark.surface,
|
|
1667
|
+
accentIndicator: u.amber.dark.indicator,
|
|
1668
|
+
accentTrack: u.amber.dark.track
|
|
1669
1669
|
},
|
|
1670
1670
|
surfaces: {
|
|
1671
1671
|
background: "#111111",
|
|
@@ -1687,141 +1687,141 @@ const y = {
|
|
|
1687
1687
|
5: "0 0 0 1px var(--gray-a6),0 12px 60px var(--black-a5),0 12px 32px -16px var(--black-a7)",
|
|
1688
1688
|
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)"
|
|
1689
1689
|
},
|
|
1690
|
-
components:
|
|
1691
|
-
},
|
|
1690
|
+
components: ia
|
|
1691
|
+
}, _a = _, F = /* @__PURE__ */ new Set();
|
|
1692
1692
|
function p(n, a) {
|
|
1693
1693
|
if (!(!n && !a))
|
|
1694
1694
|
return { ...n || {}, ...a || {} };
|
|
1695
1695
|
}
|
|
1696
|
-
function
|
|
1697
|
-
const a = n?.colors, e = n?.surfaces || {},
|
|
1698
|
-
if (!a) return
|
|
1699
|
-
if (a.background && !e.background && (
|
|
1696
|
+
function ca(n) {
|
|
1697
|
+
const a = n?.colors, e = n?.surfaces || {}, t = {};
|
|
1698
|
+
if (!a) return t;
|
|
1699
|
+
if (a.background && !e.background && (t.background = a.background), a.surface) {
|
|
1700
1700
|
const i = `color-mix(in srgb, ${a.surface} 80%, transparent)`;
|
|
1701
|
-
e.surface || (
|
|
1701
|
+
e.surface || (t.surface = a.surface), e.panelSolid || (t.panelSolid = a.surface), e.panel || (t.panel = i), e.panelTranslucent || (t.panelTranslucent = i);
|
|
1702
1702
|
}
|
|
1703
|
-
return
|
|
1703
|
+
return t;
|
|
1704
1704
|
}
|
|
1705
|
-
function
|
|
1706
|
-
const e = a?.mode || "light",
|
|
1705
|
+
function S(n, a) {
|
|
1706
|
+
const e = a?.mode || "light", t = e === "dark" ? sa : _, i = a?.accentPalette, r = i ? u[i][e] : null, s = r ? {
|
|
1707
1707
|
colors: {
|
|
1708
|
-
...
|
|
1708
|
+
...H(r)
|
|
1709
1709
|
},
|
|
1710
1710
|
palette: {
|
|
1711
|
-
accent:
|
|
1712
|
-
accentAlpha:
|
|
1713
|
-
accentContrast:
|
|
1714
|
-
accentSurface:
|
|
1715
|
-
accentIndicator:
|
|
1716
|
-
accentTrack:
|
|
1711
|
+
accent: r.scale,
|
|
1712
|
+
accentAlpha: r.alphaScale,
|
|
1713
|
+
accentContrast: r.contrast,
|
|
1714
|
+
accentSurface: r.surface,
|
|
1715
|
+
accentIndicator: r.indicator,
|
|
1716
|
+
accentTrack: r.track
|
|
1717
1717
|
}
|
|
1718
1718
|
} : null;
|
|
1719
1719
|
return {
|
|
1720
|
-
...
|
|
1720
|
+
...t,
|
|
1721
1721
|
...n,
|
|
1722
1722
|
colors: {
|
|
1723
|
-
...
|
|
1723
|
+
...t.colors,
|
|
1724
1724
|
...s?.colors || {},
|
|
1725
1725
|
...n?.colors || {},
|
|
1726
|
-
...
|
|
1726
|
+
...oa(n)
|
|
1727
1727
|
},
|
|
1728
1728
|
palette: {
|
|
1729
|
-
...
|
|
1729
|
+
...t.palette || {},
|
|
1730
1730
|
...s?.palette || {},
|
|
1731
1731
|
...n?.palette || {},
|
|
1732
|
-
gray: p(
|
|
1733
|
-
grayAlpha: p(
|
|
1734
|
-
blackAlpha: p(
|
|
1735
|
-
whiteAlpha: p(
|
|
1736
|
-
accent: p(
|
|
1737
|
-
accentAlpha: p(
|
|
1732
|
+
gray: p(t.palette?.gray, n?.palette?.gray),
|
|
1733
|
+
grayAlpha: p(t.palette?.grayAlpha, n?.palette?.grayAlpha),
|
|
1734
|
+
blackAlpha: p(t.palette?.blackAlpha, n?.palette?.blackAlpha),
|
|
1735
|
+
whiteAlpha: p(t.palette?.whiteAlpha, n?.palette?.whiteAlpha),
|
|
1736
|
+
accent: p(r?.scale || t.palette?.accent, n?.palette?.accent),
|
|
1737
|
+
accentAlpha: p(r?.alphaScale || t.palette?.accentAlpha, n?.palette?.accentAlpha)
|
|
1738
1738
|
},
|
|
1739
1739
|
surfaces: {
|
|
1740
|
-
...
|
|
1741
|
-
...
|
|
1740
|
+
...t.surfaces || {},
|
|
1741
|
+
...ca(n),
|
|
1742
1742
|
...n?.surfaces || {}
|
|
1743
1743
|
},
|
|
1744
1744
|
shadows: {
|
|
1745
|
-
...
|
|
1745
|
+
...t.shadows || {},
|
|
1746
1746
|
...n?.shadows || {}
|
|
1747
1747
|
},
|
|
1748
1748
|
spacing: {
|
|
1749
|
-
...
|
|
1749
|
+
...t.spacing || {},
|
|
1750
1750
|
...n?.spacing || {}
|
|
1751
1751
|
},
|
|
1752
|
-
spaceScale: p(
|
|
1753
|
-
radiusScale: p(
|
|
1752
|
+
spaceScale: p(t.spaceScale, n?.spaceScale),
|
|
1753
|
+
radiusScale: p(t.radiusScale, n?.radiusScale),
|
|
1754
1754
|
typography: {
|
|
1755
|
-
...
|
|
1755
|
+
...t.typography || {},
|
|
1756
1756
|
...n?.typography || {},
|
|
1757
1757
|
size: {
|
|
1758
|
-
...
|
|
1758
|
+
...t.typography?.size || {},
|
|
1759
1759
|
...n?.typography?.size || {}
|
|
1760
1760
|
},
|
|
1761
|
-
fontScale: p(
|
|
1762
|
-
lineHeight: p(
|
|
1763
|
-
letterSpacing: p(
|
|
1761
|
+
fontScale: p(t.typography?.fontScale, n?.typography?.fontScale),
|
|
1762
|
+
lineHeight: p(t.typography?.lineHeight, n?.typography?.lineHeight),
|
|
1763
|
+
letterSpacing: p(t.typography?.letterSpacing, n?.typography?.letterSpacing)
|
|
1764
1764
|
},
|
|
1765
1765
|
motion: {
|
|
1766
|
-
...
|
|
1766
|
+
...t.motion || {},
|
|
1767
1767
|
...n?.motion || {}
|
|
1768
1768
|
},
|
|
1769
1769
|
effects: {
|
|
1770
|
-
...
|
|
1770
|
+
...t.effects || {},
|
|
1771
1771
|
...n?.effects || {}
|
|
1772
1772
|
},
|
|
1773
1773
|
components: {
|
|
1774
|
-
...
|
|
1774
|
+
...t.components || {},
|
|
1775
1775
|
...n?.components || {},
|
|
1776
|
-
button: p(
|
|
1777
|
-
badge: p(
|
|
1778
|
-
dropdown: p(
|
|
1779
|
-
select: p(
|
|
1780
|
-
sidebar: p(
|
|
1781
|
-
card: p(
|
|
1782
|
-
navigationMenu: p(
|
|
1783
|
-
blockControls: p(
|
|
1784
|
-
box: p(
|
|
1785
|
-
breadcrumb: p(
|
|
1786
|
-
contextMenu: p(
|
|
1787
|
-
menubar: p(
|
|
1788
|
-
alert: p(
|
|
1789
|
-
alertDialog: p(
|
|
1790
|
-
appHeader: p(
|
|
1791
|
-
aspectRatio: p(
|
|
1792
|
-
avatar: p(
|
|
1793
|
-
menu: p(
|
|
1794
|
-
multiSelect: p(
|
|
1795
|
-
panel: p(
|
|
1796
|
-
input: p(
|
|
1776
|
+
button: p(t.components?.button, n?.components?.button),
|
|
1777
|
+
badge: p(t.components?.badge, n?.components?.badge),
|
|
1778
|
+
dropdown: p(t.components?.dropdown, n?.components?.dropdown),
|
|
1779
|
+
select: p(t.components?.select, n?.components?.select),
|
|
1780
|
+
sidebar: p(t.components?.sidebar, n?.components?.sidebar),
|
|
1781
|
+
card: p(t.components?.card, n?.components?.card),
|
|
1782
|
+
navigationMenu: p(t.components?.navigationMenu, n?.components?.navigationMenu),
|
|
1783
|
+
blockControls: p(t.components?.blockControls, n?.components?.blockControls),
|
|
1784
|
+
box: p(t.components?.box, n?.components?.box),
|
|
1785
|
+
breadcrumb: p(t.components?.breadcrumb, n?.components?.breadcrumb),
|
|
1786
|
+
contextMenu: p(t.components?.contextMenu, n?.components?.contextMenu),
|
|
1787
|
+
menubar: p(t.components?.menubar, n?.components?.menubar),
|
|
1788
|
+
alert: p(t.components?.alert, n?.components?.alert),
|
|
1789
|
+
alertDialog: p(t.components?.alertDialog, n?.components?.alertDialog),
|
|
1790
|
+
appHeader: p(t.components?.appHeader, n?.components?.appHeader),
|
|
1791
|
+
aspectRatio: p(t.components?.aspectRatio, n?.components?.aspectRatio),
|
|
1792
|
+
avatar: p(t.components?.avatar, n?.components?.avatar),
|
|
1793
|
+
menu: p(t.components?.menu, n?.components?.menu),
|
|
1794
|
+
multiSelect: p(t.components?.multiSelect, n?.components?.multiSelect),
|
|
1795
|
+
panel: p(t.components?.panel, n?.components?.panel),
|
|
1796
|
+
input: p(t.components?.input, n?.components?.input)
|
|
1797
1797
|
},
|
|
1798
1798
|
zIndex: {
|
|
1799
|
-
...
|
|
1799
|
+
...t.zIndex || {},
|
|
1800
1800
|
...n?.zIndex || {}
|
|
1801
1801
|
},
|
|
1802
1802
|
breakpoints: {
|
|
1803
|
-
...
|
|
1803
|
+
...t.breakpoints || {},
|
|
1804
1804
|
...n?.breakpoints || {}
|
|
1805
1805
|
}
|
|
1806
1806
|
};
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1809
|
-
const
|
|
1810
|
-
return
|
|
1808
|
+
function Sa(n, a, e = "light") {
|
|
1809
|
+
const t = u[a][e], i = n;
|
|
1810
|
+
return S(
|
|
1811
1811
|
{
|
|
1812
1812
|
...i,
|
|
1813
1813
|
colors: {
|
|
1814
1814
|
...i.colors || {},
|
|
1815
|
-
...
|
|
1815
|
+
...H(t)
|
|
1816
1816
|
},
|
|
1817
1817
|
palette: {
|
|
1818
1818
|
...i.palette || {},
|
|
1819
|
-
accent:
|
|
1820
|
-
accentAlpha:
|
|
1821
|
-
accentContrast:
|
|
1822
|
-
accentSurface:
|
|
1823
|
-
accentIndicator:
|
|
1824
|
-
accentTrack:
|
|
1819
|
+
accent: t.scale,
|
|
1820
|
+
accentAlpha: t.alphaScale,
|
|
1821
|
+
accentContrast: t.contrast,
|
|
1822
|
+
accentSurface: t.surface,
|
|
1823
|
+
accentIndicator: t.indicator,
|
|
1824
|
+
accentTrack: t.track
|
|
1825
1825
|
}
|
|
1826
1826
|
},
|
|
1827
1827
|
{ mode: e }
|
|
@@ -1831,120 +1831,176 @@ function o(n, a, e) {
|
|
|
1831
1831
|
n[a] = e;
|
|
1832
1832
|
}
|
|
1833
1833
|
function l(n, a, e) {
|
|
1834
|
-
e && Object.entries(e).forEach(([
|
|
1835
|
-
typeof i == "string" && i && (n[`${a}${
|
|
1834
|
+
e && Object.entries(e).forEach(([t, i]) => {
|
|
1835
|
+
typeof i == "string" && i && (n[`${a}${t}`] = i);
|
|
1836
1836
|
});
|
|
1837
1837
|
}
|
|
1838
|
-
function
|
|
1839
|
-
n &&
|
|
1838
|
+
function Ca(n) {
|
|
1839
|
+
n && F.add(n);
|
|
1840
1840
|
}
|
|
1841
|
-
function
|
|
1842
|
-
return
|
|
1841
|
+
function la(n) {
|
|
1842
|
+
return j(S(n));
|
|
1843
|
+
}
|
|
1844
|
+
const pa = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
1845
|
+
function E(n) {
|
|
1846
|
+
const a = pa.exec(n.trim());
|
|
1847
|
+
if (!a) return null;
|
|
1848
|
+
const e = a[1].length === 3 ? a[1].replace(/./g, (t) => t + t) : a[1];
|
|
1849
|
+
return [parseInt(e.slice(0, 2), 16), parseInt(e.slice(2, 4), 16), parseInt(e.slice(4, 6), 16)];
|
|
1843
1850
|
}
|
|
1844
|
-
function
|
|
1851
|
+
function z(n, a, e) {
|
|
1852
|
+
const t = E(n), i = E(a);
|
|
1853
|
+
return !t || !i ? null : "#" + t.map((s, c) => Math.round(s + (i[c] - s) * e)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
1854
|
+
}
|
|
1855
|
+
function da(n) {
|
|
1856
|
+
const a = {}, e = n.colors, t = e.surface || e.background, i = e.text;
|
|
1857
|
+
if (!t || !i) return a;
|
|
1858
|
+
const r = [
|
|
1859
|
+
// the accent's text step (Radix step 11) can sit just under 4.5:1 (amber is 4.49:1 on near-white)
|
|
1860
|
+
["accent", n.palette?.accent?.["11"] || e.primary],
|
|
1861
|
+
["danger", e.danger],
|
|
1862
|
+
["success", e.success],
|
|
1863
|
+
["warning", e.warning],
|
|
1864
|
+
["info", e.info]
|
|
1865
|
+
];
|
|
1866
|
+
for (const [s, c] of r) {
|
|
1867
|
+
if (!c) continue;
|
|
1868
|
+
if (!E(c)) {
|
|
1869
|
+
a[`--ui-color-${s}-text`] = `color-mix(in srgb, ${c} 62%, ${i})`;
|
|
1870
|
+
continue;
|
|
1871
|
+
}
|
|
1872
|
+
const d = z(c, t, 0.86);
|
|
1873
|
+
let f = c;
|
|
1874
|
+
for (let g = 0; g <= 18; g += 1) {
|
|
1875
|
+
const m = z(c, i, g * 0.05);
|
|
1876
|
+
if (!m) break;
|
|
1877
|
+
f = m;
|
|
1878
|
+
const x = v(m, t) ?? 0, C = d ? v(m, d) ?? 0 : x;
|
|
1879
|
+
if (x >= 5.5 && C >= 5) break;
|
|
1880
|
+
}
|
|
1881
|
+
if (a[`--ui-color-${s}-text`] = f, s === "danger" || s === "success") {
|
|
1882
|
+
let g = c;
|
|
1883
|
+
for (let m = 0; m <= 12; m += 1) {
|
|
1884
|
+
const x = z(c, "#000000", m * 0.05);
|
|
1885
|
+
if (!x || (g = x, (v("#ffffff", x) ?? 0) >= 4.6)) break;
|
|
1886
|
+
}
|
|
1887
|
+
a[`--ui-color-${s}-solid`] = g, a[`--ui-color-foreground-on-${s}`] = "#ffffff";
|
|
1888
|
+
}
|
|
1889
|
+
}
|
|
1890
|
+
return a;
|
|
1891
|
+
}
|
|
1892
|
+
function fa(n) {
|
|
1845
1893
|
const a = n.colors, e = n.palette;
|
|
1846
1894
|
if (!e || !a) return n;
|
|
1847
|
-
const
|
|
1895
|
+
const t = (m, x, C) => `color-mix(in srgb, ${m} ${x}%, ${C})`, i = a.surface || a.background, r = a.text;
|
|
1848
1896
|
let s = e.gray, c = e.accent;
|
|
1849
|
-
const d = a.background ?
|
|
1850
|
-
i &&
|
|
1897
|
+
const d = a.background ? w(a.background) : null, f = s?.["1"] ? w(s[1]) : null;
|
|
1898
|
+
i && r && d !== null && f !== null && d < 0.4 != f < 0.4 && (s = {
|
|
1851
1899
|
...s,
|
|
1852
|
-
2: r
|
|
1853
|
-
3: r
|
|
1854
|
-
4: r
|
|
1855
|
-
5: r
|
|
1856
|
-
6: r
|
|
1857
|
-
7: r
|
|
1858
|
-
8: r
|
|
1859
|
-
11: a.muted ||
|
|
1860
|
-
12:
|
|
1900
|
+
2: t(r, 4, i),
|
|
1901
|
+
3: t(r, 8, i),
|
|
1902
|
+
4: t(r, 12, i),
|
|
1903
|
+
5: t(r, 16, i),
|
|
1904
|
+
6: t(r, 20, i),
|
|
1905
|
+
7: t(r, 28, i),
|
|
1906
|
+
8: t(r, 40, i),
|
|
1907
|
+
11: a.muted || r,
|
|
1908
|
+
12: r
|
|
1861
1909
|
});
|
|
1862
|
-
const
|
|
1863
|
-
return i &&
|
|
1910
|
+
const g = c?.["9"];
|
|
1911
|
+
return i && r && a.primary && g && g.trim().toLowerCase() !== a.primary.trim().toLowerCase() && (c = {
|
|
1864
1912
|
...c,
|
|
1865
|
-
2:
|
|
1866
|
-
3:
|
|
1867
|
-
4:
|
|
1868
|
-
5:
|
|
1869
|
-
7:
|
|
1913
|
+
2: t(a.primary, 6, i),
|
|
1914
|
+
3: t(a.primary, 14, i),
|
|
1915
|
+
4: t(a.primary, 20, i),
|
|
1916
|
+
5: t(a.primary, 26, i),
|
|
1917
|
+
7: t(a.primary, 42, i),
|
|
1870
1918
|
9: a.primary,
|
|
1871
1919
|
10: a.primaryHover || a.primary,
|
|
1872
|
-
11:
|
|
1920
|
+
11: t(a.primary, 60, r)
|
|
1873
1921
|
}), s === e.gray && c === e.accent ? n : { ...n, palette: { ...e, gray: s, accent: c } };
|
|
1874
1922
|
}
|
|
1875
|
-
function
|
|
1876
|
-
const a =
|
|
1877
|
-
return o(e, "--ui-color-primary", a.colors.primary), o(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-color-background", a.colors.background || "#ffffff"), o(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-color-text", a.colors.text || "#202020"), o(e, "--ui-color-muted", a.colors.muted || "#646464"), o(e, "--ui-color-border", a.colors.border || "#0000001f"), o(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-color-success", a.colors.success || "#30a46c"), o(e, "--ui-color-danger", a.colors.danger || "#e5484d"), o(e, "--ui-color-warning", a.colors.warning || a.colors.primary), o(e, "--ui-primary", a.colors.primary), o(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-background", a.colors.background || "#ffffff"), o(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-text", a.colors.text || "#202020"), o(e, "--ui-muted", a.colors.muted || "#646464"), o(e, "--ui-border", a.colors.border || "#0000001f"), o(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-success", a.colors.success || "#30a46c"), o(e, "--ui-error", a.colors.danger || "#e5484d"), o(e, "--ui-warning", a.colors.warning || a.colors.primary), o(e, "--ui-radius", a.radius || "6px"), o(e, "--ui-space-xs", a.spacing?.xs || "4px"), o(e, "--ui-space-sm", a.spacing?.sm || "8px"), o(e, "--ui-space-md", a.spacing?.md || "12px"), o(e, "--ui-space-lg", a.spacing?.lg || "24px"), o(e, "--ui-space-xl", a.spacing?.xl || "32px"), o(e, "--ui-space-xxl", a.spacing?.xxl || "48px"), o(e, "--ui-default-gap", a.spacing?.sm || a.spaceScale?.["2"] || "8px"), o(e, "--ui-shadow-sm", a.shadows?.sm || a.shadows?.["2"] || "none"), o(e, "--ui-shadow-md", a.shadows?.md || a.shadows?.["3"] || "none"), o(e, "--ui-shadow-lg", a.shadows?.lg || a.shadows?.["4"] || "none"), o(e, "--ui-font-family", a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-heading", a.typography?.headingFamily || a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-code", a.typography?.codeFamily || "monospace"), o(e, "--ui-font-size-sm", a.typography?.size?.sm || "12px"), o(e, "--ui-font-size-md", a.typography?.size?.md || "14px"), o(e, "--ui-font-size-lg", a.typography?.size?.lg || "16px"), o(e, "--ui-default-font-size", a.typography?.size?.md || a.typography?.fontScale?.["2"] || "14px"), o(e, "--ui-default-line-height", a.typography?.lineHeight?.["2"] || "20px"), o(e, "--ui-default-letter-spacing", a.typography?.letterSpacing?.["2"] || "0em"), o(e, "--ui-motion-short", a.motion?.durationShort || "120ms"), o(e, "--ui-motion-base", a.motion?.durationBase || "180ms"), o(e, "--ui-motion-long", a.motion?.durationLong || "260ms"), o(e, "--ui-motion-easing", a.motion?.easing || "cubic-bezier(0.2, 0.8, 0.2, 1)"), o(e, "--ui-z-modal", String(a.zIndex?.modal ?? 1e3)), o(e, "--ui-z-overlay", String(a.zIndex?.overlay ?? 900)), o(e, "--ui-z-toast", String(a.zIndex?.toast ?? 1100)), o(e, "--ui-breakpoint-sm", a.breakpoints?.sm || "640px"), o(e, "--ui-breakpoint-md", a.breakpoints?.md || "768px"), o(e, "--ui-breakpoint-lg", a.breakpoints?.lg || "1024px"), o(e, "--color-background", a.surfaces?.background || a.colors.background || "#ffffff"), o(e, "--color-surface", a.surfaces?.surface || a.colors.surface || "#fcfcfc"), o(e, "--color-panel", a.surfaces?.panel || a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-panel-solid", a.surfaces?.panelSolid || a.colors.surface || "#ffffff"), o(e, "--color-panel-translucent", a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-overlay", a.surfaces?.overlay || "rgba(2, 6, 23, 0.52)"), o(e, "--color-transparent", a.surfaces?.transparent || "transparent"), o(e, "--backdrop-filter-panel", a.effects?.backdropFilterPanel || "blur(64px)"), a.palette?.accentContrast && o(e, "--accent-contrast", a.palette.accentContrast), a.palette?.accentSurface && o(e, "--accent-surface", a.palette.accentSurface), a.palette?.accentIndicator && o(e, "--accent-indicator", a.palette.accentIndicator), a.palette?.accentTrack && o(e, "--accent-track", a.palette.accentTrack), l(e, "--gray-", a.palette?.gray), l(e, "--gray-a", a.palette?.grayAlpha), l(e, "--black-a", a.palette?.blackAlpha), l(e, "--white-a", a.palette?.whiteAlpha), l(e, "--accent-", a.palette?.accent), l(e, "--accent-a", a.palette?.accentAlpha), l(e, "--space-", a.spaceScale), l(e, "--radius-", a.radiusScale), l(e, "--font-size-", a.typography?.fontScale), l(e, "--line-height-", a.typography?.lineHeight), l(e, "--letter-spacing-", a.typography?.letterSpacing), l(e, "--shadow-", a.shadows), l(e, "--base-button-", a.components?.button), l(e, "--base-badge-", a.components?.badge), l(e, "--base-dropdown-", a.components?.dropdown), l(e, "--base-select-", a.components?.select), l(e, "--base-sidebar-", a.components?.sidebar), l(e, "--base-block-controls-", a.components?.blockControls), l(e, "--base-box-", a.components?.box), l(e, "--base-breadcrumb-", a.components?.breadcrumb), l(e, "--base-card-", a.components?.card), l(e, "--base-multi-select-", a.components?.multiSelect), l(e, "--base-navigation-menu-", a.components?.navigationMenu), l(e, "--base-menubar-", a.components?.menubar), l(e, "--base-context-menu-", a.components?.contextMenu), l(e, "--base-alert-", a.components?.alert), l(e, "--base-alert-dialog-", a.components?.alertDialog), l(e, "--base-app-header-", a.components?.appHeader), l(e, "--base-aspect-ratio-", a.components?.aspectRatio), l(e, "--base-avatar-", a.components?.avatar), l(e, "--base-menu-", a.components?.menu), l(e, "--base-panel-", a.components?.panel), l(e, "--base-input-", a.components?.input), Object.assign(e,
|
|
1923
|
+
function j(n) {
|
|
1924
|
+
const a = fa(n), e = {};
|
|
1925
|
+
return o(e, "--ui-color-primary", a.colors.primary), o(e, "--ui-color-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-color-foreground-on-primary", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-color-background", a.colors.background || "#ffffff"), o(e, "--ui-color-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-color-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-color-text", a.colors.text || "#202020"), o(e, "--ui-color-muted", a.colors.muted || "#646464"), o(e, "--ui-color-border", a.colors.border || "#0000001f"), o(e, "--ui-color-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-color-success", a.colors.success || "#30a46c"), o(e, "--ui-color-danger", a.colors.danger || "#e5484d"), o(e, "--ui-color-warning", a.colors.warning || a.colors.primary), o(e, "--ui-primary", a.colors.primary), o(e, "--ui-primary-hover", a.colors.primaryHover || a.colors.primary), o(e, "--ui-foreground", a.colors.foregroundOnPrimary || "#ffffff"), o(e, "--ui-background", a.colors.background || "#ffffff"), o(e, "--ui-surface", a.colors.surface || a.colors.background || "#ffffff"), o(e, "--ui-surface-alt", a.colors.surfaceAlt || a.colors.surface || "#f9f9f9"), o(e, "--ui-text", a.colors.text || "#202020"), o(e, "--ui-muted", a.colors.muted || "#646464"), o(e, "--ui-border", a.colors.border || "#0000001f"), o(e, "--ui-focus-ring", a.colors.focusRing || a.colors.primary), o(e, "--ui-success", a.colors.success || "#30a46c"), o(e, "--ui-error", a.colors.danger || "#e5484d"), o(e, "--ui-warning", a.colors.warning || a.colors.primary), o(e, "--ui-radius", a.radius || "6px"), o(e, "--ui-space-xs", a.spacing?.xs || "4px"), o(e, "--ui-space-sm", a.spacing?.sm || "8px"), o(e, "--ui-space-md", a.spacing?.md || "12px"), o(e, "--ui-space-lg", a.spacing?.lg || "24px"), o(e, "--ui-space-xl", a.spacing?.xl || "32px"), o(e, "--ui-space-xxl", a.spacing?.xxl || "48px"), o(e, "--ui-default-gap", a.spacing?.sm || a.spaceScale?.["2"] || "8px"), o(e, "--ui-shadow-sm", a.shadows?.sm || a.shadows?.["2"] || "none"), o(e, "--ui-shadow-md", a.shadows?.md || a.shadows?.["3"] || "none"), o(e, "--ui-shadow-lg", a.shadows?.lg || a.shadows?.["4"] || "none"), o(e, "--ui-font-family", a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-heading", a.typography?.headingFamily || a.typography?.family || "system-ui, sans-serif"), o(e, "--ui-font-family-code", a.typography?.codeFamily || "monospace"), o(e, "--ui-font-size-sm", a.typography?.size?.sm || "12px"), o(e, "--ui-font-size-md", a.typography?.size?.md || "14px"), o(e, "--ui-font-size-lg", a.typography?.size?.lg || "16px"), o(e, "--ui-default-font-size", a.typography?.size?.md || a.typography?.fontScale?.["2"] || "14px"), o(e, "--ui-default-line-height", a.typography?.lineHeight?.["2"] || "20px"), o(e, "--ui-default-letter-spacing", a.typography?.letterSpacing?.["2"] || "0em"), o(e, "--ui-motion-short", a.motion?.durationShort || "120ms"), o(e, "--ui-motion-base", a.motion?.durationBase || "180ms"), o(e, "--ui-motion-long", a.motion?.durationLong || "260ms"), o(e, "--ui-motion-easing", a.motion?.easing || "cubic-bezier(0.2, 0.8, 0.2, 1)"), o(e, "--ui-z-modal", String(a.zIndex?.modal ?? 1e3)), o(e, "--ui-z-overlay", String(a.zIndex?.overlay ?? 900)), o(e, "--ui-z-toast", String(a.zIndex?.toast ?? 1100)), o(e, "--ui-breakpoint-sm", a.breakpoints?.sm || "640px"), o(e, "--ui-breakpoint-md", a.breakpoints?.md || "768px"), o(e, "--ui-breakpoint-lg", a.breakpoints?.lg || "1024px"), o(e, "--color-background", a.surfaces?.background || a.colors.background || "#ffffff"), o(e, "--color-surface", a.surfaces?.surface || a.colors.surface || "#fcfcfc"), o(e, "--color-panel", a.surfaces?.panel || a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-panel-solid", a.surfaces?.panelSolid || a.colors.surface || "#ffffff"), o(e, "--color-panel-translucent", a.surfaces?.panelTranslucent || "#ffffffcc"), o(e, "--color-overlay", a.surfaces?.overlay || "rgba(2, 6, 23, 0.52)"), o(e, "--color-transparent", a.surfaces?.transparent || "transparent"), o(e, "--backdrop-filter-panel", a.effects?.backdropFilterPanel || "blur(64px)"), a.palette?.accentContrast && o(e, "--accent-contrast", a.palette.accentContrast), a.palette?.accentSurface && o(e, "--accent-surface", a.palette.accentSurface), a.palette?.accentIndicator && o(e, "--accent-indicator", a.palette.accentIndicator), a.palette?.accentTrack && o(e, "--accent-track", a.palette.accentTrack), l(e, "--gray-", a.palette?.gray), l(e, "--gray-a", a.palette?.grayAlpha), l(e, "--black-a", a.palette?.blackAlpha), l(e, "--white-a", a.palette?.whiteAlpha), l(e, "--accent-", a.palette?.accent), l(e, "--accent-a", a.palette?.accentAlpha), l(e, "--space-", a.spaceScale), l(e, "--radius-", a.radiusScale), l(e, "--font-size-", a.typography?.fontScale), l(e, "--line-height-", a.typography?.lineHeight), l(e, "--letter-spacing-", a.typography?.letterSpacing), l(e, "--shadow-", a.shadows), l(e, "--base-button-", a.components?.button), l(e, "--base-badge-", a.components?.badge), l(e, "--base-dropdown-", a.components?.dropdown), l(e, "--base-select-", a.components?.select), l(e, "--base-sidebar-", a.components?.sidebar), l(e, "--base-block-controls-", a.components?.blockControls), l(e, "--base-box-", a.components?.box), l(e, "--base-breadcrumb-", a.components?.breadcrumb), l(e, "--base-card-", a.components?.card), l(e, "--base-multi-select-", a.components?.multiSelect), l(e, "--base-navigation-menu-", a.components?.navigationMenu), l(e, "--base-menubar-", a.components?.menubar), l(e, "--base-context-menu-", a.components?.contextMenu), l(e, "--base-alert-", a.components?.alert), l(e, "--base-alert-dialog-", a.components?.alertDialog), l(e, "--base-app-header-", a.components?.appHeader), l(e, "--base-aspect-ratio-", a.components?.aspectRatio), l(e, "--base-avatar-", a.components?.avatar), l(e, "--base-menu-", a.components?.menu), l(e, "--base-panel-", a.components?.panel), l(e, "--base-input-", a.components?.input), Object.assign(e, ta(a)), Object.assign(e, da(a)), o(e, "--ui-color-foreground-on-warning", k(a.colors.warning || a.colors.primary, "#ffffff")), e;
|
|
1878
1926
|
}
|
|
1879
|
-
function
|
|
1880
|
-
Object.entries(a).forEach(([e,
|
|
1927
|
+
function P(n, a) {
|
|
1928
|
+
Object.entries(a).forEach(([e, t]) => {
|
|
1881
1929
|
try {
|
|
1882
|
-
n.style.setProperty(e,
|
|
1930
|
+
n.style.setProperty(e, t);
|
|
1883
1931
|
} catch {
|
|
1884
1932
|
}
|
|
1885
1933
|
});
|
|
1886
1934
|
}
|
|
1887
|
-
function
|
|
1888
|
-
const e = Object.entries(
|
|
1935
|
+
function za(n, a = ":root") {
|
|
1936
|
+
const e = Object.entries(la(n)).map(([t, i]) => ` ${t}: ${i};`).join(`
|
|
1889
1937
|
`);
|
|
1890
1938
|
return `${a} {
|
|
1891
1939
|
${e}
|
|
1892
1940
|
}
|
|
1893
1941
|
`;
|
|
1894
1942
|
}
|
|
1895
|
-
function
|
|
1943
|
+
function B(n) {
|
|
1896
1944
|
return n === document ? document.documentElement : n instanceof ShadowRoot ? n.host : n;
|
|
1897
1945
|
}
|
|
1898
|
-
function
|
|
1946
|
+
function ua(n, a = typeof document < "u" ? document : null) {
|
|
1899
1947
|
if (!a) return;
|
|
1900
|
-
const e =
|
|
1901
|
-
if (
|
|
1902
|
-
for (const
|
|
1948
|
+
const e = j(S(n)), t = a === document || a instanceof ShadowRoot, i = B(a);
|
|
1949
|
+
if (P(i, e), D(i, e["--ui-color-background"]), t)
|
|
1950
|
+
for (const r of F)
|
|
1903
1951
|
try {
|
|
1904
|
-
|
|
1952
|
+
P(r, e), D(r, e["--ui-color-background"]);
|
|
1905
1953
|
} catch {
|
|
1906
1954
|
}
|
|
1907
1955
|
}
|
|
1908
|
-
function
|
|
1956
|
+
function D(n, a) {
|
|
1957
|
+
const e = a ? w(a) : null;
|
|
1958
|
+
if (e !== null)
|
|
1959
|
+
try {
|
|
1960
|
+
n.style.setProperty("color-scheme", e < 0.179 ? "dark" : "light");
|
|
1961
|
+
} catch {
|
|
1962
|
+
}
|
|
1963
|
+
}
|
|
1964
|
+
function Ea(n = {}) {
|
|
1909
1965
|
const a = n.root === void 0 ? typeof document < "u" ? document : null : n.root;
|
|
1910
1966
|
if (!a) return () => {
|
|
1911
1967
|
};
|
|
1912
|
-
const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null,
|
|
1913
|
-
const s =
|
|
1914
|
-
|
|
1915
|
-
const c =
|
|
1968
|
+
const e = typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(prefers-color-scheme: dark)") : null, t = (r) => {
|
|
1969
|
+
const s = r ? "dark" : "light";
|
|
1970
|
+
ua(S(r ? n.dark : n.light, { accentPalette: n.accentPalette, mode: s }), a);
|
|
1971
|
+
const c = B(a);
|
|
1916
1972
|
c.setAttribute("data-ui-mode", s), c.style.setProperty("color-scheme", s);
|
|
1917
1973
|
};
|
|
1918
|
-
if (
|
|
1974
|
+
if (t(!!e?.matches), !e) return () => {
|
|
1919
1975
|
};
|
|
1920
|
-
const i = (
|
|
1976
|
+
const i = (r) => t(r.matches);
|
|
1921
1977
|
return typeof e.addEventListener == "function" ? (e.addEventListener("change", i), () => e.removeEventListener("change", i)) : (e.addListener(i), () => e.removeListener(i));
|
|
1922
1978
|
}
|
|
1923
1979
|
export {
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1980
|
+
Q as A,
|
|
1981
|
+
K as D,
|
|
1982
|
+
xa as a,
|
|
1983
|
+
Ea as b,
|
|
1984
|
+
ua as c,
|
|
1985
|
+
u as d,
|
|
1986
|
+
sa as e,
|
|
1987
|
+
_ as f,
|
|
1988
|
+
ha as g,
|
|
1989
|
+
wa as h,
|
|
1990
|
+
W as i,
|
|
1991
|
+
J as j,
|
|
1992
|
+
S as k,
|
|
1993
|
+
_a as l,
|
|
1994
|
+
oa as m,
|
|
1995
|
+
ta as n,
|
|
1996
|
+
ca as o,
|
|
1997
|
+
va as p,
|
|
1998
|
+
ka as q,
|
|
1999
|
+
ba as r,
|
|
2000
|
+
k as s,
|
|
2001
|
+
Ca as t,
|
|
2002
|
+
ya as u,
|
|
2003
|
+
za as v,
|
|
2004
|
+
la as w,
|
|
2005
|
+
Sa as x
|
|
1950
2006
|
};
|