@minimalstuff/ui 3.2.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.d.ts +136 -29
- package/dist/minimalstuff-ui.css +1 -1
- package/dist/minimalstuff-ui.js +1633 -868
- package/package.json +36 -34
package/dist/minimalstuff-ui.js
CHANGED
|
@@ -28,9 +28,12 @@ var S = {
|
|
|
28
28
|
lg: "rounded-lg",
|
|
29
29
|
xl: "rounded-xl",
|
|
30
30
|
full: "rounded-full"
|
|
31
|
-
}, C =
|
|
31
|
+
}, C = {
|
|
32
|
+
...S,
|
|
33
|
+
full: S.lg
|
|
34
|
+
}, w = "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", T = "focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", E = "has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", D = "has-[:focus-visible]:ring-blue-500", O = "has-[:focus-visible]:ring-red-500", k = "outline-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-blue-500 dark:focus-visible:outline-blue-400", A = {
|
|
32
35
|
primary: {
|
|
33
|
-
solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800
|
|
36
|
+
solid: "border-transparent bg-blue-600 text-white enabled:hover:bg-blue-700 enabled:active:bg-blue-800",
|
|
34
37
|
outline: "border-blue-300 bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:border-blue-800 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
|
|
35
38
|
ghost: "border-transparent bg-transparent text-blue-700 enabled:hover:bg-blue-50 enabled:active:bg-blue-100 dark:text-blue-400 dark:enabled:hover:bg-blue-950/40 dark:enabled:active:bg-blue-950/60",
|
|
36
39
|
subtle: "border-transparent bg-blue-50 text-blue-700 enabled:hover:bg-blue-100 enabled:active:bg-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:enabled:hover:bg-blue-500/20 dark:enabled:active:bg-blue-500/30",
|
|
@@ -41,42 +44,42 @@ var S = {
|
|
|
41
44
|
outline: "border-gray-300 bg-transparent text-gray-700 enabled:hover:bg-gray-50 enabled:active:bg-gray-100 dark:border-gray-600 dark:text-gray-300 dark:enabled:hover:bg-gray-800/50 dark:enabled:active:bg-gray-800/80",
|
|
42
45
|
ghost: "border-transparent bg-transparent text-gray-700 enabled:hover:bg-gray-100 enabled:active:bg-gray-200 dark:text-gray-300 dark:enabled:hover:bg-gray-700/50 dark:enabled:active:bg-gray-700/80",
|
|
43
46
|
subtle: "border-transparent bg-gray-100 text-gray-700 enabled:hover:bg-gray-200 enabled:active:bg-gray-300 dark:bg-gray-700/50 dark:text-gray-300 dark:enabled:hover:bg-gray-600/50 dark:enabled:active:bg-gray-600/80",
|
|
44
|
-
focusOutline: "focus-visible:outline-gray-400"
|
|
47
|
+
focusOutline: "focus-visible:outline-gray-500 dark:focus-visible:outline-gray-400"
|
|
45
48
|
},
|
|
46
49
|
danger: {
|
|
47
|
-
solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800
|
|
50
|
+
solid: "border-transparent bg-red-600 text-white enabled:hover:bg-red-700 enabled:active:bg-red-800",
|
|
48
51
|
outline: "border-red-300 bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:border-red-800 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
|
|
49
52
|
ghost: "border-transparent bg-transparent text-red-700 enabled:hover:bg-red-50 enabled:active:bg-red-100 dark:text-red-400 dark:enabled:hover:bg-red-950/40 dark:enabled:active:bg-red-950/60",
|
|
50
53
|
subtle: "border-transparent bg-red-50 text-red-700 enabled:hover:bg-red-100 enabled:active:bg-red-200 dark:bg-red-500/10 dark:text-red-400 dark:enabled:hover:bg-red-500/20 dark:enabled:active:bg-red-500/30",
|
|
51
54
|
focusOutline: "focus-visible:outline-red-500"
|
|
52
55
|
},
|
|
53
56
|
success: {
|
|
54
|
-
solid: "border-transparent bg-green-
|
|
57
|
+
solid: "border-transparent bg-green-700 text-white enabled:hover:bg-green-800 enabled:active:bg-green-900",
|
|
55
58
|
outline: "border-green-300 bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:border-green-800 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
|
|
56
59
|
ghost: "border-transparent bg-transparent text-green-700 enabled:hover:bg-green-50 enabled:active:bg-green-100 dark:text-green-400 dark:enabled:hover:bg-green-950/40 dark:enabled:active:bg-green-950/60",
|
|
57
60
|
subtle: "border-transparent bg-green-50 text-green-700 enabled:hover:bg-green-100 enabled:active:bg-green-200 dark:bg-green-500/10 dark:text-green-400 dark:enabled:hover:bg-green-500/20 dark:enabled:active:bg-green-500/30",
|
|
58
|
-
focusOutline: "focus-visible:outline-green-
|
|
61
|
+
focusOutline: "focus-visible:outline-green-600"
|
|
59
62
|
},
|
|
60
63
|
warning: {
|
|
61
|
-
solid: "border-transparent bg-yellow-
|
|
64
|
+
solid: "border-transparent bg-yellow-700 text-white enabled:hover:bg-yellow-800 enabled:active:bg-yellow-900",
|
|
62
65
|
outline: "border-yellow-300 bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:border-yellow-800 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
|
|
63
66
|
ghost: "border-transparent bg-transparent text-yellow-700 enabled:hover:bg-yellow-50 enabled:active:bg-yellow-100 dark:text-yellow-400 dark:enabled:hover:bg-yellow-950/40 dark:enabled:active:bg-yellow-950/60",
|
|
64
67
|
subtle: "border-transparent bg-yellow-50 text-yellow-700 enabled:hover:bg-yellow-100 enabled:active:bg-yellow-200 dark:bg-yellow-500/10 dark:text-yellow-400 dark:enabled:hover:bg-yellow-500/20 dark:enabled:active:bg-yellow-500/30",
|
|
65
|
-
focusOutline: "focus-visible:outline-yellow-500"
|
|
68
|
+
focusOutline: "focus-visible:outline-yellow-700 dark:focus-visible:outline-yellow-500"
|
|
66
69
|
}
|
|
67
|
-
},
|
|
70
|
+
}, j = "inline-flex items-center justify-center disabled:opacity-50 disabled:cursor-not-allowed", M = `cursor-pointer transition-[color,background-color,border-color,transform] duration-200 enabled:active:duration-75 enabled:active:scale-[0.95] ${w}`, N = {
|
|
68
71
|
xs: "h-6 w-6 text-xs",
|
|
69
72
|
sm: "h-8 w-8 text-sm",
|
|
70
73
|
md: "h-10 w-10 text-base",
|
|
71
74
|
lg: "h-12 w-12 text-xl"
|
|
72
|
-
},
|
|
73
|
-
function
|
|
75
|
+
}, P = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
76
|
+
function F(e) {
|
|
74
77
|
let t = e.trim();
|
|
75
78
|
if (t.length === 0) return "";
|
|
76
|
-
let [n] =
|
|
79
|
+
let [n] = P.segment(t);
|
|
77
80
|
return n.segment.toUpperCase();
|
|
78
81
|
}
|
|
79
|
-
function
|
|
82
|
+
function I({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i = "full", unstyled: a = !1, className: o }) {
|
|
80
83
|
let [s, c] = p(null), l = t !== void 0 && t !== s, u = e.trim().length > 0, d = l ? /* @__PURE__ */ g("img", {
|
|
81
84
|
src: t,
|
|
82
85
|
alt: "",
|
|
@@ -84,47 +87,47 @@ function P({ name: e, src: t, size: n = "sm", color: r = "primary", radius: i =
|
|
|
84
87
|
className: "h-full w-full object-cover"
|
|
85
88
|
}) : /* @__PURE__ */ g("span", {
|
|
86
89
|
"aria-hidden": "true",
|
|
87
|
-
children:
|
|
90
|
+
children: F(e)
|
|
88
91
|
});
|
|
89
92
|
return /* @__PURE__ */ g("span", {
|
|
90
93
|
role: u ? "img" : void 0,
|
|
91
94
|
"aria-label": u ? e : void 0,
|
|
92
95
|
"aria-hidden": !u || void 0,
|
|
93
|
-
className: x("inline-flex flex-shrink-0 items-center justify-center overflow-hidden",
|
|
96
|
+
className: x("inline-flex flex-shrink-0 items-center justify-center overflow-hidden", N[n], !a && S[i], !a && !l && ["border font-semibold", A[r].solid], o),
|
|
94
97
|
children: d
|
|
95
98
|
});
|
|
96
99
|
}
|
|
97
100
|
//#endregion
|
|
98
101
|
//#region src/components/badge/badge.tsx
|
|
99
|
-
var
|
|
102
|
+
var ee = {
|
|
100
103
|
xs: "px-1.5 py-0.5 text-xs",
|
|
101
104
|
sm: "px-2.5 py-1 text-sm",
|
|
102
105
|
md: "px-3 py-1 text-base",
|
|
103
106
|
lg: "px-3.5 py-1.5 text-lg"
|
|
104
|
-
},
|
|
105
|
-
className: x("inline-flex items-center gap-1 border", S[i],
|
|
107
|
+
}, L = ({ children: e, color: t = "primary", variant: n = "subtle", size: r = "sm", radius: i = "md", className: a, ...o }) => /* @__PURE__ */ g("span", {
|
|
108
|
+
className: x("inline-flex items-center gap-1 border", S[i], ee[r], A[t][n], a),
|
|
106
109
|
...o,
|
|
107
110
|
children: e
|
|
108
|
-
}),
|
|
111
|
+
}), te = {
|
|
109
112
|
xs: "px-2 py-1 text-xs",
|
|
110
113
|
sm: "px-3 py-1.5 text-sm",
|
|
111
114
|
md: "px-4 py-2 text-sm",
|
|
112
115
|
lg: "px-4 py-3 text-base"
|
|
113
|
-
},
|
|
116
|
+
}, ne = {
|
|
114
117
|
xs: "w-3.5 h-3.5",
|
|
115
118
|
sm: "w-4 h-4",
|
|
116
119
|
md: "w-4 h-4",
|
|
117
120
|
lg: "w-5 h-5"
|
|
118
121
|
};
|
|
119
122
|
function R(e) {
|
|
120
|
-
let { unstyled: t = !1, variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p } = e, m =
|
|
123
|
+
let { unstyled: t = !1, variant: n = "solid", color: r = "primary", size: i = "md", radius: a = "md", children: o, className: s, fullWidth: c = !1, loading: l = !1, startIcon: u, endIcon: d, disabled: f, ...p } = e, m = A[r], h = ne[i];
|
|
121
124
|
return /* @__PURE__ */ _("button", {
|
|
122
125
|
type: "button",
|
|
123
|
-
className: x(
|
|
124
|
-
|
|
126
|
+
className: x(j, !t && [
|
|
127
|
+
M,
|
|
125
128
|
"gap-2 font-medium border",
|
|
126
129
|
S[a],
|
|
127
|
-
|
|
130
|
+
te[i],
|
|
128
131
|
m[n],
|
|
129
132
|
m.focusOutline
|
|
130
133
|
], c && "w-full", s),
|
|
@@ -150,13 +153,13 @@ function R(e) {
|
|
|
150
153
|
}
|
|
151
154
|
//#endregion
|
|
152
155
|
//#region src/components/shared/surface_tokens.ts
|
|
153
|
-
var
|
|
156
|
+
var re = "border-gray-300 dark:border-gray-600", z = "bg-white dark:bg-gray-800", B = "border-gray-200 dark:border-gray-700", ie = "border-gray-100 dark:border-gray-800", V = "bg-white dark:bg-gray-900", H = {
|
|
154
157
|
2: "h2",
|
|
155
158
|
3: "h3",
|
|
156
159
|
4: "h4"
|
|
157
160
|
};
|
|
158
161
|
function ae({ title: e, titleId: t, level: n, description: r, actions: i }) {
|
|
159
|
-
let a =
|
|
162
|
+
let a = H[n];
|
|
160
163
|
return /* @__PURE__ */ _("div", {
|
|
161
164
|
className: "mb-4",
|
|
162
165
|
children: [/* @__PURE__ */ _("div", {
|
|
@@ -180,7 +183,7 @@ var oe = {
|
|
|
180
183
|
md: "p-6",
|
|
181
184
|
lg: "p-8"
|
|
182
185
|
};
|
|
183
|
-
function
|
|
186
|
+
function U({ children: e, title: t, description: n, actions: r, headingLevel: i = 2, padding: a = "md", radius: o = "lg", unstyled: s = !1, className: c }) {
|
|
184
187
|
let u = l(), d = !!t;
|
|
185
188
|
return /* @__PURE__ */ _("div", {
|
|
186
189
|
role: d ? "region" : void 0,
|
|
@@ -203,67 +206,101 @@ function se({ children: e, title: t, description: n, actions: r, headingLevel: i
|
|
|
203
206
|
}
|
|
204
207
|
//#endregion
|
|
205
208
|
//#region src/components/character_count/character_count.tsx
|
|
206
|
-
var
|
|
207
|
-
function
|
|
208
|
-
return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-
|
|
209
|
+
var se = "text-xs text-gray-500 dark:text-gray-400 mt-1 text-right";
|
|
210
|
+
function W(e, t) {
|
|
211
|
+
return t ? "" : e === "overLimit" ? "text-red-600 dark:text-red-400" : e === "atLimit" ? "text-amber-700 dark:text-amber-400" : "";
|
|
209
212
|
}
|
|
210
|
-
function
|
|
211
|
-
let
|
|
213
|
+
function ce({ current: e, min: t, max: n, showMin: r, showMax: i, unstyled: a = !1, id: o, className: s }) {
|
|
214
|
+
let c = r === !0 || i === !0, l = t !== void 0 && e <= t ? "atLimit" : "ok", u = n !== void 0 && e > n ? "overLimit" : n !== void 0 && e >= n ? "atLimit" : "ok", d = c ? `${e}/${t} min` : `${e} (min ${t})`, f = c ? `${e}/${n} max` : `${e}/${n}`;
|
|
212
215
|
return /* @__PURE__ */ _("div", {
|
|
213
|
-
|
|
216
|
+
id: o,
|
|
217
|
+
className: x(!a && se, s),
|
|
214
218
|
children: [
|
|
215
219
|
r && t !== void 0 && /* @__PURE__ */ g("span", {
|
|
216
|
-
className:
|
|
217
|
-
children:
|
|
220
|
+
className: W(l, a),
|
|
221
|
+
children: d
|
|
218
222
|
}),
|
|
219
223
|
r && i && " · ",
|
|
220
224
|
i && n !== void 0 && /* @__PURE__ */ g("span", {
|
|
221
|
-
className:
|
|
222
|
-
children:
|
|
225
|
+
className: W(u, a),
|
|
226
|
+
children: f
|
|
223
227
|
}),
|
|
224
228
|
!r && !i && n !== void 0 && /* @__PURE__ */ g("span", {
|
|
225
|
-
className:
|
|
226
|
-
children:
|
|
229
|
+
className: W(u, a),
|
|
230
|
+
children: f
|
|
227
231
|
}),
|
|
228
232
|
!r && !i && t !== void 0 && n === void 0 && /* @__PURE__ */ g("span", {
|
|
229
|
-
className:
|
|
230
|
-
children:
|
|
233
|
+
className: W(l, a),
|
|
234
|
+
children: d
|
|
231
235
|
})
|
|
232
236
|
]
|
|
233
237
|
});
|
|
234
238
|
}
|
|
235
239
|
//#endregion
|
|
236
|
-
//#region src/components/shared/
|
|
237
|
-
|
|
240
|
+
//#region src/components/shared/join_ids.ts
|
|
241
|
+
function G(...e) {
|
|
242
|
+
return e.filter(Boolean).join(" ") || void 0;
|
|
243
|
+
}
|
|
244
|
+
var le = `w-full border ${re} ${z} text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400 ${T} transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed`, ue = "text-sm font-medium text-gray-700 dark:text-gray-300", de = "text-xs text-gray-600 dark:text-gray-400", fe = "text-xs text-red-600 dark:text-red-400", pe = "border-red-500 dark:border-red-400", me = ({ id: e, error: t, className: n }) => t ? /* @__PURE__ */ g("p", {
|
|
238
245
|
id: e,
|
|
239
|
-
className: x(
|
|
246
|
+
className: x(fe, n),
|
|
240
247
|
role: "alert",
|
|
241
248
|
children: t
|
|
242
249
|
}) : null;
|
|
243
250
|
//#endregion
|
|
244
251
|
//#region src/components/shared/use_field_ids.ts
|
|
245
|
-
function
|
|
252
|
+
function K(e) {
|
|
246
253
|
let t = l(), n = e ?? t;
|
|
247
254
|
return {
|
|
248
255
|
fieldId: n,
|
|
249
256
|
errorId: `${n}-error`,
|
|
250
|
-
descriptionId: `${n}-description
|
|
257
|
+
descriptionId: `${n}-description`,
|
|
258
|
+
labelId: `${n}-label`,
|
|
259
|
+
characterCountId: `${n}-character-count`
|
|
251
260
|
};
|
|
252
261
|
}
|
|
253
262
|
//#endregion
|
|
263
|
+
//#region src/components/shared/checkmark_icon.tsx
|
|
264
|
+
function he() {
|
|
265
|
+
return /* @__PURE__ */ g("svg", {
|
|
266
|
+
className: "h-3 w-3 text-white",
|
|
267
|
+
viewBox: "0 0 12 12",
|
|
268
|
+
fill: "none",
|
|
269
|
+
stroke: "currentColor",
|
|
270
|
+
strokeWidth: "2.5",
|
|
271
|
+
strokeLinecap: "round",
|
|
272
|
+
strokeLinejoin: "round",
|
|
273
|
+
children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
//#endregion
|
|
254
277
|
//#region src/components/shared/field_description.tsx
|
|
255
278
|
var ge = ({ id: e, description: t, className: n }) => t ? typeof t == "string" ? /* @__PURE__ */ g("p", {
|
|
256
279
|
id: e,
|
|
257
|
-
className: x(
|
|
280
|
+
className: x(de, n),
|
|
258
281
|
children: t
|
|
259
282
|
}) : /* @__PURE__ */ g("span", {
|
|
260
283
|
id: e,
|
|
261
|
-
className: x(
|
|
284
|
+
className: x(de, "block", n),
|
|
262
285
|
children: t
|
|
263
286
|
}) : null;
|
|
264
287
|
//#endregion
|
|
288
|
+
//#region src/components/shared/option_card_styles.ts
|
|
289
|
+
function _e(e) {
|
|
290
|
+
let { isSelected: t, isError: n, isDisabled: r, radius: i, unstyled: a } = e;
|
|
291
|
+
return x("flex cursor-pointer items-start gap-3 transition-colors duration-150", E, n ? O : D, !a && [
|
|
292
|
+
S[i],
|
|
293
|
+
"border px-3 py-2.5",
|
|
294
|
+
t ? n ? x("border-red-500 dark:border-red-400", "bg-red-50 dark:bg-red-950/20") : "border-blue-500 bg-blue-50 dark:border-blue-500 dark:bg-blue-950/25" : n ? "border-red-300 bg-white dark:border-red-800/50 dark:bg-gray-800/50" : x("border-gray-200 dark:border-gray-700", "bg-gray-50 hover:border-gray-300 hover:bg-white dark:bg-gray-800/50 dark:hover:border-gray-600 dark:hover:bg-gray-800")
|
|
295
|
+
], r && "cursor-not-allowed opacity-50");
|
|
296
|
+
}
|
|
297
|
+
function ve(e) {
|
|
298
|
+
let { isSelected: t, isError: n } = e;
|
|
299
|
+
return t ? n ? pe : "border-blue-600 dark:border-blue-500" : n ? "border-red-400 dark:border-red-600" : re;
|
|
300
|
+
}
|
|
301
|
+
//#endregion
|
|
265
302
|
//#region src/components/shared/use_controlled_state.ts
|
|
266
|
-
function
|
|
303
|
+
function ye(e, t) {
|
|
267
304
|
let [n, r] = p(t), i = e !== void 0, a = o((e) => {
|
|
268
305
|
i || r(e);
|
|
269
306
|
}, [i]);
|
|
@@ -271,73 +308,208 @@ function _e(e, t) {
|
|
|
271
308
|
}
|
|
272
309
|
//#endregion
|
|
273
310
|
//#region src/components/checkbox/checkbox.tsx
|
|
274
|
-
function
|
|
275
|
-
|
|
311
|
+
function be(e, t, n) {
|
|
312
|
+
return e === void 0 ? null : typeof e == "string" ? /* @__PURE__ */ _("span", {
|
|
313
|
+
className: t,
|
|
314
|
+
children: [e, n && /* @__PURE__ */ g("span", {
|
|
315
|
+
className: "text-red-500 dark:text-red-400 ml-1",
|
|
316
|
+
children: "*"
|
|
317
|
+
})]
|
|
318
|
+
}) : /* @__PURE__ */ _(h, { children: [e, n && /* @__PURE__ */ g("span", {
|
|
319
|
+
className: "text-red-500 dark:text-red-400 ml-1",
|
|
320
|
+
children: "*"
|
|
321
|
+
})] });
|
|
322
|
+
}
|
|
323
|
+
function xe({ label: e, description: t, error: n, radius: r = "sm", unstyled: i = !1, fullWidth: a = !1, variant: o = "inline", className: s, wrapperClassName: c, checked: l, defaultChecked: u = !1, onChange: d, id: f, "aria-describedby": p, ...m }) {
|
|
324
|
+
let { fieldId: h, errorId: v, descriptionId: y } = K(f), [b, C] = ye(l, u), w = o === "card", T = G(p, !!t && y, n && v), E = (e) => {
|
|
325
|
+
C(e.target.checked), d?.(e);
|
|
326
|
+
}, D = w ? _e({
|
|
327
|
+
isSelected: b,
|
|
328
|
+
isError: !!n,
|
|
329
|
+
isDisabled: m.disabled === !0,
|
|
330
|
+
radius: r,
|
|
331
|
+
unstyled: i
|
|
332
|
+
}) : x("flex items-start gap-3 cursor-pointer", m.disabled && "cursor-not-allowed opacity-50"), O = w ? x("select-none text-sm font-medium", b ? n ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300") : x(ue, "select-none"), k = x("relative shrink-0", S[r], !w && ["has-[:focus-visible]:outline-none has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-offset-2 has-[:focus-visible]:ring-offset-white dark:has-[:focus-visible]:ring-offset-gray-900", n ? "has-[:focus-visible]:ring-red-500" : "has-[:focus-visible]:ring-blue-500"]), A = be(e, O, m.required === !0);
|
|
276
333
|
return /* @__PURE__ */ _("div", {
|
|
277
|
-
className: x("w-full",
|
|
334
|
+
className: x(a ? "w-full" : "w-fit", c),
|
|
278
335
|
children: [
|
|
279
336
|
/* @__PURE__ */ _("label", {
|
|
280
|
-
htmlFor:
|
|
281
|
-
className:
|
|
337
|
+
htmlFor: h,
|
|
338
|
+
className: D,
|
|
282
339
|
children: [/* @__PURE__ */ _("span", {
|
|
283
|
-
className:
|
|
340
|
+
className: k,
|
|
284
341
|
children: [/* @__PURE__ */ g("input", {
|
|
285
342
|
type: "checkbox",
|
|
286
|
-
id:
|
|
343
|
+
id: h,
|
|
287
344
|
className: "sr-only",
|
|
288
|
-
checked:
|
|
289
|
-
onChange:
|
|
290
|
-
y(e.target.checked), l?.(e);
|
|
291
|
-
},
|
|
345
|
+
checked: b,
|
|
346
|
+
onChange: E,
|
|
292
347
|
"aria-invalid": !!n,
|
|
293
|
-
"aria-describedby":
|
|
294
|
-
...
|
|
348
|
+
"aria-describedby": T,
|
|
349
|
+
...m
|
|
295
350
|
}), /* @__PURE__ */ g("span", {
|
|
296
351
|
className: x("flex h-5 w-5 items-center justify-center transition-all duration-200", !i && [
|
|
297
352
|
S[r],
|
|
298
353
|
"border-2",
|
|
299
|
-
|
|
354
|
+
b ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800"),
|
|
300
355
|
n && "border-red-500 dark:border-red-400"
|
|
301
|
-
],
|
|
356
|
+
], s),
|
|
302
357
|
"aria-hidden": !0,
|
|
303
|
-
children:
|
|
304
|
-
className: "h-3 w-3 text-white",
|
|
305
|
-
viewBox: "0 0 12 12",
|
|
306
|
-
fill: "none",
|
|
307
|
-
stroke: "currentColor",
|
|
308
|
-
strokeWidth: "2.5",
|
|
309
|
-
strokeLinecap: "round",
|
|
310
|
-
strokeLinejoin: "round",
|
|
311
|
-
children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
|
|
312
|
-
})
|
|
358
|
+
children: b && /* @__PURE__ */ g(he, {})
|
|
313
359
|
})]
|
|
314
|
-
}),
|
|
315
|
-
className:
|
|
316
|
-
children: [
|
|
317
|
-
|
|
318
|
-
|
|
360
|
+
}), w ? /* @__PURE__ */ _("span", {
|
|
361
|
+
className: "flex min-w-0 flex-col",
|
|
362
|
+
children: [A, t && /* @__PURE__ */ g("span", {
|
|
363
|
+
id: y,
|
|
364
|
+
className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
|
|
365
|
+
children: t
|
|
319
366
|
})]
|
|
320
|
-
}) :
|
|
321
|
-
className: "text-red-500 dark:text-red-400 ml-1",
|
|
322
|
-
children: "*"
|
|
323
|
-
})] }))]
|
|
367
|
+
}) : A]
|
|
324
368
|
}),
|
|
325
|
-
/* @__PURE__ */ g(ge, {
|
|
326
|
-
id:
|
|
369
|
+
!w && /* @__PURE__ */ g(ge, {
|
|
370
|
+
id: y,
|
|
327
371
|
description: t,
|
|
328
372
|
className: "mt-1 ml-8"
|
|
329
373
|
}),
|
|
330
|
-
/* @__PURE__ */ g(
|
|
331
|
-
id:
|
|
374
|
+
/* @__PURE__ */ g(me, {
|
|
375
|
+
id: v,
|
|
332
376
|
error: n,
|
|
333
|
-
className: "mt-1 ml-8"
|
|
377
|
+
className: w ? "mt-1" : "mt-1 ml-8"
|
|
378
|
+
})
|
|
379
|
+
]
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
//#endregion
|
|
383
|
+
//#region src/components/shared/option_row.tsx
|
|
384
|
+
function Se({ item: e, htmlFor: t, descriptionId: n, orientation: r, isSelected: i, isDisabled: a, isError: o, radius: s, unstyled: c, className: l, control: u, indicator: d }) {
|
|
385
|
+
return /* @__PURE__ */ _("label", {
|
|
386
|
+
htmlFor: t,
|
|
387
|
+
className: x(_e({
|
|
388
|
+
isSelected: i,
|
|
389
|
+
isError: o,
|
|
390
|
+
isDisabled: a,
|
|
391
|
+
radius: s,
|
|
392
|
+
unstyled: c
|
|
393
|
+
}), r === "horizontal" && "flex-1", l),
|
|
394
|
+
children: [
|
|
395
|
+
u,
|
|
396
|
+
d,
|
|
397
|
+
/* @__PURE__ */ _("span", {
|
|
398
|
+
className: "flex min-w-0 flex-col",
|
|
399
|
+
children: [/* @__PURE__ */ _("span", {
|
|
400
|
+
className: "flex items-center gap-1.5",
|
|
401
|
+
children: [e.icon && /* @__PURE__ */ g("span", {
|
|
402
|
+
className: x(e.icon, "h-4 w-4 shrink-0", i ? o ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
|
|
403
|
+
"aria-hidden": !0
|
|
404
|
+
}), /* @__PURE__ */ g("span", {
|
|
405
|
+
className: x("select-none text-sm font-medium", i ? o ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
|
|
406
|
+
children: e.label
|
|
407
|
+
})]
|
|
408
|
+
}), e.description && /* @__PURE__ */ g("span", {
|
|
409
|
+
id: n,
|
|
410
|
+
className: x("text-xs text-gray-600 dark:text-gray-400", "mt-0.5"),
|
|
411
|
+
children: e.description
|
|
412
|
+
})]
|
|
413
|
+
})
|
|
414
|
+
]
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region src/components/checkbox_options/checkbox_option_row.tsx
|
|
419
|
+
function Ce({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, error: s, radius: c, unstyled: l, className: u, onToggle: d }) {
|
|
420
|
+
let f = !!s;
|
|
421
|
+
return /* @__PURE__ */ g(Se, {
|
|
422
|
+
item: e,
|
|
423
|
+
htmlFor: t,
|
|
424
|
+
descriptionId: n,
|
|
425
|
+
orientation: i,
|
|
426
|
+
isSelected: a,
|
|
427
|
+
isDisabled: o,
|
|
428
|
+
isError: f,
|
|
429
|
+
radius: c,
|
|
430
|
+
unstyled: l,
|
|
431
|
+
className: u,
|
|
432
|
+
control: /* @__PURE__ */ g("input", {
|
|
433
|
+
type: "checkbox",
|
|
434
|
+
id: t,
|
|
435
|
+
name: r,
|
|
436
|
+
value: e.value,
|
|
437
|
+
checked: a,
|
|
438
|
+
onChange: () => d(e.value),
|
|
439
|
+
disabled: o,
|
|
440
|
+
"aria-invalid": s ? !0 : void 0,
|
|
441
|
+
"aria-describedby": e.description ? n : void 0,
|
|
442
|
+
className: "sr-only"
|
|
443
|
+
}),
|
|
444
|
+
indicator: /* @__PURE__ */ g("span", {
|
|
445
|
+
className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center border-2 transition-colors duration-150", S.sm, ve({
|
|
446
|
+
isSelected: a,
|
|
447
|
+
isError: f
|
|
448
|
+
}), a && (f ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500")),
|
|
449
|
+
"aria-hidden": !0,
|
|
450
|
+
children: a && /* @__PURE__ */ g(he, {})
|
|
451
|
+
})
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
//#endregion
|
|
455
|
+
//#region src/components/checkbox_options/checkbox_options.tsx
|
|
456
|
+
function we(e, t, n) {
|
|
457
|
+
let r = t.includes(n) ? t.filter((e) => e !== n) : [...t, n];
|
|
458
|
+
return e.map((e) => e.value).filter((e) => r.includes(e));
|
|
459
|
+
}
|
|
460
|
+
function Te({ options: e, orientation: t = "vertical", values: n, defaultValues: r, onChange: i, name: a, label: o, error: s, required: c, requiredLabel: l = "required", disabled: u, radius: d = "lg", unstyled: f = !1, className: p, wrapperClassName: m, id: v, "aria-describedby": y, ...b }) {
|
|
461
|
+
let { fieldId: S, errorId: C } = K(v), w = a ?? S, [T, E] = ye(n, r ?? []), D = e.map((e) => typeof e == "string" ? {
|
|
462
|
+
value: e,
|
|
463
|
+
label: e
|
|
464
|
+
} : e), O = (e) => {
|
|
465
|
+
let t = we(D, T, e);
|
|
466
|
+
E(t), i?.(t);
|
|
467
|
+
};
|
|
468
|
+
return /* @__PURE__ */ _("fieldset", {
|
|
469
|
+
className: x("m-0 border-0 p-0", m),
|
|
470
|
+
disabled: u,
|
|
471
|
+
"aria-describedby": G(y, s && C),
|
|
472
|
+
...b,
|
|
473
|
+
children: [
|
|
474
|
+
o && /* @__PURE__ */ _("legend", {
|
|
475
|
+
className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
|
|
476
|
+
children: [o, c && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("span", {
|
|
477
|
+
className: "text-red-500 dark:text-red-400 ml-1",
|
|
478
|
+
"aria-hidden": "true",
|
|
479
|
+
children: "*"
|
|
480
|
+
}), /* @__PURE__ */ g("span", {
|
|
481
|
+
className: "sr-only",
|
|
482
|
+
children: ` (${l})`
|
|
483
|
+
})] })]
|
|
484
|
+
}),
|
|
485
|
+
/* @__PURE__ */ g("div", {
|
|
486
|
+
className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
|
|
487
|
+
children: D.map((e, n) => /* @__PURE__ */ g(Ce, {
|
|
488
|
+
option: e,
|
|
489
|
+
optionId: `${S}-${n}`,
|
|
490
|
+
descriptionId: `${S}-${n}-desc`,
|
|
491
|
+
name: w,
|
|
492
|
+
orientation: t,
|
|
493
|
+
isSelected: T.includes(e.value),
|
|
494
|
+
isDisabled: u === !0 || e.disabled === !0,
|
|
495
|
+
error: s,
|
|
496
|
+
radius: d,
|
|
497
|
+
unstyled: f,
|
|
498
|
+
className: p,
|
|
499
|
+
onToggle: O
|
|
500
|
+
}, e.value))
|
|
501
|
+
}),
|
|
502
|
+
/* @__PURE__ */ g(me, {
|
|
503
|
+
id: C,
|
|
504
|
+
error: s,
|
|
505
|
+
className: "mt-2"
|
|
334
506
|
})
|
|
335
507
|
]
|
|
336
508
|
});
|
|
337
509
|
}
|
|
338
510
|
//#endregion
|
|
339
511
|
//#region src/hooks/use_is_client/use_is_client.tsx
|
|
340
|
-
var
|
|
512
|
+
var Ee = () => {
|
|
341
513
|
let [e, t] = p(!1);
|
|
342
514
|
return c(() => {
|
|
343
515
|
requestAnimationFrame(() => {
|
|
@@ -347,146 +519,201 @@ var ye = () => {
|
|
|
347
519
|
};
|
|
348
520
|
//#endregion
|
|
349
521
|
//#region src/components/client_only/client_only.tsx
|
|
350
|
-
function
|
|
351
|
-
return
|
|
522
|
+
function De({ children: e, fallback: t }) {
|
|
523
|
+
return Ee() ? /* @__PURE__ */ g(h, { children: e }) : t ?? null;
|
|
352
524
|
}
|
|
353
525
|
//#endregion
|
|
354
526
|
//#region src/components/shared/field.tsx
|
|
355
|
-
var
|
|
527
|
+
var Oe = ({ fieldId: e, errorId: t, label: n, error: r, required: i = !1, wrapperClassName: a, children: o }) => /* @__PURE__ */ _("div", {
|
|
356
528
|
className: x("w-full", a),
|
|
357
529
|
children: [
|
|
358
530
|
n !== void 0 && (typeof n == "string" ? /* @__PURE__ */ _("label", {
|
|
531
|
+
id: `${e}-label`,
|
|
359
532
|
className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "block mb-1"),
|
|
360
533
|
htmlFor: e,
|
|
361
534
|
children: [n, i && /* @__PURE__ */ g("span", {
|
|
362
535
|
className: "text-red-500 dark:text-red-400 ml-1",
|
|
536
|
+
"aria-hidden": "true",
|
|
363
537
|
children: "*"
|
|
364
538
|
})]
|
|
365
539
|
}) : /* @__PURE__ */ _(h, { children: [n, i && /* @__PURE__ */ g("span", {
|
|
366
540
|
className: "text-red-500 dark:text-red-400 ml-1",
|
|
541
|
+
"aria-hidden": "true",
|
|
367
542
|
children: "*"
|
|
368
543
|
})] })),
|
|
369
544
|
o,
|
|
370
|
-
/* @__PURE__ */ g(
|
|
545
|
+
/* @__PURE__ */ g(me, {
|
|
371
546
|
id: t,
|
|
372
547
|
error: r,
|
|
373
548
|
className: "mt-1"
|
|
374
549
|
})
|
|
375
550
|
]
|
|
376
|
-
});
|
|
551
|
+
}), ke = -1;
|
|
552
|
+
function Ae(e, t) {
|
|
553
|
+
return e >= 0 && e < t ? e : ke;
|
|
554
|
+
}
|
|
555
|
+
function je({ optionCount: e, getOptionId: t, isOpen: n }) {
|
|
556
|
+
let [r, i] = p(ke), a = Ae(r, e), s = o((t) => {
|
|
557
|
+
e !== 0 && i((n) => {
|
|
558
|
+
let r = Ae(n, e) + t;
|
|
559
|
+
return r < 0 ? e - 1 : r >= e ? 0 : r;
|
|
560
|
+
});
|
|
561
|
+
}, [e]), l = o(() => {
|
|
562
|
+
i(0);
|
|
563
|
+
}, []), u = o(() => {
|
|
564
|
+
i(e - 1);
|
|
565
|
+
}, [e]), d = o(() => {
|
|
566
|
+
i(ke);
|
|
567
|
+
}, []), f = n && a >= 0 ? t(a) : void 0;
|
|
568
|
+
return c(() => {
|
|
569
|
+
f !== void 0 && document.getElementById(f)?.scrollIntoView?.({ block: "nearest" });
|
|
570
|
+
}, [f]), {
|
|
571
|
+
activeIndex: a,
|
|
572
|
+
activeOptionId: f,
|
|
573
|
+
move: s,
|
|
574
|
+
first: l,
|
|
575
|
+
last: u,
|
|
576
|
+
reset: d
|
|
577
|
+
};
|
|
578
|
+
}
|
|
377
579
|
//#endregion
|
|
378
580
|
//#region src/components/combobox/combobox.tsx
|
|
379
|
-
function
|
|
380
|
-
let { fieldId:
|
|
581
|
+
function Me({ options: e, label: t, "aria-label": n, error: r, placeholder: i, noResultsText: a = "No results found", clearLabel: o = "Clear selection", radius: s = "md", unstyled: c = !1, disabled: l = !1, required: u = !1, className: m, wrapperClassName: h, value: v, defaultValue: y = "", onChange: b, id: C }) {
|
|
582
|
+
let { fieldId: w, errorId: T } = K(C), E = `${w}-listbox`, D = f(null), [O, k] = ye(v, y), j = e.find((e) => e.value === O), [M, N] = p(""), [P, F] = p(!1), [I, ee] = p(!1), L = d(() => P ? e.filter((e) => e.label.toLowerCase().includes(M.toLowerCase())) : e, [
|
|
381
583
|
e,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
]),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
},
|
|
389
|
-
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
},
|
|
393
|
-
k(e.
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
584
|
+
P,
|
|
585
|
+
M
|
|
586
|
+
]), { activeIndex: te, activeOptionId: ne, move: R, first: re, last: z, reset: B } = je({
|
|
587
|
+
optionCount: L.length,
|
|
588
|
+
getOptionId: (e) => `${E}-option-${e}`,
|
|
589
|
+
isOpen: I
|
|
590
|
+
}), ie = I ? M : j?.label ?? "", V = () => {
|
|
591
|
+
l || (N(j?.label ?? ""), F(!1), ee(!0), B());
|
|
592
|
+
}, H = () => {
|
|
593
|
+
ee(!1), F(!1), B();
|
|
594
|
+
}, ae = (e) => {
|
|
595
|
+
k(e.value), b?.(e.value), H();
|
|
596
|
+
}, oe = () => {
|
|
597
|
+
k(""), b?.(""), N(""), D.current?.focus();
|
|
598
|
+
}, U = (e) => {
|
|
599
|
+
N(e.target.value), F(!0), ee(!0), re();
|
|
600
|
+
}, se = () => {
|
|
601
|
+
I || V();
|
|
602
|
+
}, W = (e) => {
|
|
603
|
+
if (e.preventDefault(), e.altKey) {
|
|
604
|
+
I || V();
|
|
402
605
|
return;
|
|
403
606
|
}
|
|
404
|
-
if (
|
|
405
|
-
|
|
607
|
+
if (!I) {
|
|
608
|
+
V(), re();
|
|
406
609
|
return;
|
|
407
610
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
t && te(t);
|
|
611
|
+
R(1);
|
|
612
|
+
}, ce = (e) => {
|
|
613
|
+
if (e.preventDefault(), e.altKey) {
|
|
614
|
+
I && H();
|
|
413
615
|
return;
|
|
414
616
|
}
|
|
415
|
-
if (
|
|
416
|
-
|
|
417
|
-
|
|
617
|
+
if (!I) {
|
|
618
|
+
V(), z();
|
|
619
|
+
return;
|
|
418
620
|
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
621
|
+
R(-1);
|
|
622
|
+
}, G = (e) => {
|
|
623
|
+
if (!I) return;
|
|
624
|
+
let t = L[te];
|
|
625
|
+
if (!t) {
|
|
626
|
+
H();
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
e.preventDefault(), ae(t);
|
|
630
|
+
}, ue = (e) => {
|
|
631
|
+
I && (e.preventDefault(), H());
|
|
632
|
+
};
|
|
633
|
+
return /* @__PURE__ */ g(Oe, {
|
|
634
|
+
fieldId: w,
|
|
635
|
+
errorId: T,
|
|
423
636
|
label: t,
|
|
424
|
-
error:
|
|
425
|
-
required:
|
|
426
|
-
wrapperClassName:
|
|
637
|
+
error: r,
|
|
638
|
+
required: u,
|
|
639
|
+
wrapperClassName: h,
|
|
427
640
|
children: /* @__PURE__ */ _("div", {
|
|
428
641
|
className: "relative",
|
|
429
642
|
children: [
|
|
430
|
-
!
|
|
643
|
+
!c && /* @__PURE__ */ g("span", {
|
|
431
644
|
className: "i-mdi-magnify absolute left-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none",
|
|
432
645
|
"aria-hidden": !0
|
|
433
646
|
}),
|
|
434
647
|
/* @__PURE__ */ g("input", {
|
|
435
|
-
|
|
648
|
+
ref: D,
|
|
649
|
+
id: w,
|
|
436
650
|
role: "combobox",
|
|
437
651
|
type: "text",
|
|
438
652
|
autoComplete: "off",
|
|
439
|
-
disabled:
|
|
440
|
-
placeholder:
|
|
441
|
-
value:
|
|
442
|
-
onChange:
|
|
443
|
-
|
|
444
|
-
onBlur:
|
|
445
|
-
onKeyDown:
|
|
446
|
-
|
|
447
|
-
|
|
653
|
+
disabled: l,
|
|
654
|
+
placeholder: i,
|
|
655
|
+
value: ie,
|
|
656
|
+
onChange: U,
|
|
657
|
+
onClick: se,
|
|
658
|
+
onBlur: H,
|
|
659
|
+
onKeyDown: (e) => {
|
|
660
|
+
if (e.key === "ArrowDown") return W(e);
|
|
661
|
+
if (e.key === "ArrowUp") return ce(e);
|
|
662
|
+
if (e.key === "Enter") return G(e);
|
|
663
|
+
if (e.key === "Escape") return ue(e);
|
|
664
|
+
},
|
|
665
|
+
"aria-expanded": I,
|
|
666
|
+
"aria-controls": E,
|
|
448
667
|
"aria-autocomplete": "list",
|
|
449
|
-
"aria-
|
|
450
|
-
"aria-
|
|
451
|
-
"aria-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
668
|
+
"aria-label": n,
|
|
669
|
+
"aria-activedescendant": ne,
|
|
670
|
+
"aria-invalid": !!r,
|
|
671
|
+
"aria-required": u || void 0,
|
|
672
|
+
"aria-describedby": r ? T : void 0,
|
|
673
|
+
className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !c && [
|
|
674
|
+
le,
|
|
675
|
+
S[s],
|
|
455
676
|
"pl-9 pr-8 py-2 text-sm"
|
|
456
|
-
], !
|
|
677
|
+
], !c && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), m)
|
|
457
678
|
}),
|
|
458
|
-
!
|
|
679
|
+
!c && j && !l && /* @__PURE__ */ g("button", {
|
|
459
680
|
type: "button",
|
|
460
|
-
"aria-label":
|
|
461
|
-
onMouseDown: (e) =>
|
|
462
|
-
|
|
463
|
-
|
|
681
|
+
"aria-label": o,
|
|
682
|
+
onMouseDown: (e) => {
|
|
683
|
+
e.preventDefault();
|
|
684
|
+
},
|
|
685
|
+
onClick: oe,
|
|
686
|
+
className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
|
|
464
687
|
children: /* @__PURE__ */ g("span", {
|
|
465
688
|
className: "i-mdi-close block w-4 h-4",
|
|
466
689
|
"aria-hidden": !0
|
|
467
690
|
})
|
|
468
691
|
}),
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
role: "listbox",
|
|
472
|
-
className: x("absolute z-10 mt-1 w-full max-h-60 overflow-auto py-1 text-sm shadow-lg", !s && [
|
|
692
|
+
I && /* @__PURE__ */ _("div", {
|
|
693
|
+
className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !c && [
|
|
473
694
|
"border",
|
|
474
695
|
"bg-white dark:bg-gray-900",
|
|
475
696
|
"border-gray-100 dark:border-gray-800",
|
|
476
|
-
S[
|
|
697
|
+
S[s]
|
|
477
698
|
]),
|
|
478
|
-
children:
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
699
|
+
children: [/* @__PURE__ */ g("ul", {
|
|
700
|
+
id: E,
|
|
701
|
+
role: "listbox",
|
|
702
|
+
className: "max-h-60 overflow-auto py-1",
|
|
703
|
+
children: L.map((e, t) => /* @__PURE__ */ g("li", {
|
|
704
|
+
id: `${E}-option-${t}`,
|
|
705
|
+
role: "option",
|
|
706
|
+
"aria-selected": e.value === O,
|
|
707
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
708
|
+
onClick: () => ae(e),
|
|
709
|
+
className: x("px-3 py-2 cursor-pointer text-gray-900 dark:text-gray-100", t === te ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : "hover:bg-gray-50 dark:hover:bg-gray-800/60", e.value === O && "font-medium"),
|
|
710
|
+
children: e.label
|
|
711
|
+
}, e.value))
|
|
712
|
+
}), /* @__PURE__ */ g("div", {
|
|
713
|
+
role: "status",
|
|
714
|
+
className: L.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
|
|
715
|
+
children: L.length === 0 ? a : ""
|
|
716
|
+
})]
|
|
490
717
|
})
|
|
491
718
|
]
|
|
492
719
|
})
|
|
@@ -494,75 +721,75 @@ function Se({ options: e, label: t, error: n, placeholder: r, noResultsText: i =
|
|
|
494
721
|
}
|
|
495
722
|
//#endregion
|
|
496
723
|
//#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
|
|
497
|
-
var
|
|
724
|
+
var q = Math.min, Ne = Math.max, Pe = Math.round, Fe = Math.floor, J = (e) => ({
|
|
498
725
|
x: e,
|
|
499
726
|
y: e
|
|
500
|
-
}),
|
|
727
|
+
}), Ie = {
|
|
501
728
|
left: "right",
|
|
502
729
|
right: "left",
|
|
503
730
|
bottom: "top",
|
|
504
731
|
top: "bottom"
|
|
505
732
|
};
|
|
506
|
-
function
|
|
507
|
-
return
|
|
733
|
+
function Le(e, t, n) {
|
|
734
|
+
return Ne(e, q(t, n));
|
|
508
735
|
}
|
|
509
|
-
function
|
|
736
|
+
function Re(e, t) {
|
|
510
737
|
return typeof e == "function" ? e(t) : e;
|
|
511
738
|
}
|
|
512
|
-
function
|
|
739
|
+
function ze(e) {
|
|
513
740
|
return e.split("-")[0];
|
|
514
741
|
}
|
|
515
|
-
function
|
|
742
|
+
function Be(e) {
|
|
516
743
|
return e.split("-")[1];
|
|
517
744
|
}
|
|
518
|
-
function
|
|
745
|
+
function Ve(e) {
|
|
519
746
|
return e === "x" ? "y" : "x";
|
|
520
747
|
}
|
|
521
|
-
function
|
|
748
|
+
function He(e) {
|
|
522
749
|
return e === "y" ? "height" : "width";
|
|
523
750
|
}
|
|
524
|
-
function
|
|
751
|
+
function Y(e) {
|
|
525
752
|
let t = e[0];
|
|
526
753
|
return t === "t" || t === "b" ? "y" : "x";
|
|
527
754
|
}
|
|
528
|
-
function
|
|
529
|
-
return
|
|
755
|
+
function Ue(e) {
|
|
756
|
+
return Ve(Y(e));
|
|
530
757
|
}
|
|
531
|
-
function
|
|
758
|
+
function We(e, t, n) {
|
|
532
759
|
n === void 0 && (n = !1);
|
|
533
|
-
let r =
|
|
534
|
-
return t.reference[a] > t.floating[a] && (o =
|
|
760
|
+
let r = Be(e), i = Ue(e), a = He(i), o = i === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
|
|
761
|
+
return t.reference[a] > t.floating[a] && (o = $e(o)), [o, $e(o)];
|
|
535
762
|
}
|
|
536
|
-
function
|
|
537
|
-
let t =
|
|
763
|
+
function Ge(e) {
|
|
764
|
+
let t = $e(e);
|
|
538
765
|
return [
|
|
539
|
-
|
|
766
|
+
Ke(e),
|
|
540
767
|
t,
|
|
541
|
-
|
|
768
|
+
Ke(t)
|
|
542
769
|
];
|
|
543
770
|
}
|
|
544
|
-
function
|
|
771
|
+
function Ke(e) {
|
|
545
772
|
return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
|
|
546
773
|
}
|
|
547
|
-
var
|
|
548
|
-
function
|
|
774
|
+
var qe = ["left", "right"], Je = ["right", "left"], Ye = ["top", "bottom"], Xe = ["bottom", "top"];
|
|
775
|
+
function Ze(e, t, n) {
|
|
549
776
|
switch (e) {
|
|
550
777
|
case "top":
|
|
551
|
-
case "bottom": return n ? t ?
|
|
778
|
+
case "bottom": return n ? t ? Je : qe : t ? qe : Je;
|
|
552
779
|
case "left":
|
|
553
|
-
case "right": return t ?
|
|
780
|
+
case "right": return t ? Ye : Xe;
|
|
554
781
|
default: return [];
|
|
555
782
|
}
|
|
556
783
|
}
|
|
557
|
-
function
|
|
558
|
-
let i =
|
|
559
|
-
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(
|
|
784
|
+
function Qe(e, t, n, r) {
|
|
785
|
+
let i = Be(e), a = Ze(ze(e), n === "start", r);
|
|
786
|
+
return i && (a = a.map((e) => e + "-" + i), t && (a = a.concat(a.map(Ke)))), a;
|
|
560
787
|
}
|
|
561
|
-
function
|
|
562
|
-
let t =
|
|
563
|
-
return
|
|
788
|
+
function $e(e) {
|
|
789
|
+
let t = ze(e);
|
|
790
|
+
return Ie[t] + e.slice(t.length);
|
|
564
791
|
}
|
|
565
|
-
function
|
|
792
|
+
function et(e) {
|
|
566
793
|
return {
|
|
567
794
|
top: e.top ?? 0,
|
|
568
795
|
right: e.right ?? 0,
|
|
@@ -570,15 +797,15 @@ function Ue(e) {
|
|
|
570
797
|
left: e.left ?? 0
|
|
571
798
|
};
|
|
572
799
|
}
|
|
573
|
-
function
|
|
800
|
+
function tt(e) {
|
|
574
801
|
return typeof e == "number" ? {
|
|
575
802
|
top: e,
|
|
576
803
|
right: e,
|
|
577
804
|
bottom: e,
|
|
578
805
|
left: e
|
|
579
|
-
} :
|
|
806
|
+
} : et(e);
|
|
580
807
|
}
|
|
581
|
-
function
|
|
808
|
+
function nt(e) {
|
|
582
809
|
let { x: t, y: n, width: r, height: i } = e;
|
|
583
810
|
return {
|
|
584
811
|
width: r,
|
|
@@ -593,8 +820,8 @@ function Ge(e) {
|
|
|
593
820
|
}
|
|
594
821
|
//#endregion
|
|
595
822
|
//#region node_modules/.pnpm/@floating-ui+core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.mjs
|
|
596
|
-
function
|
|
597
|
-
let { reference: r, floating: i } = e, a =
|
|
823
|
+
function rt(e, t, n) {
|
|
824
|
+
let { reference: r, floating: i } = e, a = Y(t), o = Ue(t), s = He(o), c = ze(t), l = a === "y", u = r.x + r.width / 2 - i.width / 2, d = r.y + r.height / 2 - i.height / 2, f = r[s] / 2 - i[s] / 2, p;
|
|
598
825
|
switch (c) {
|
|
599
826
|
case "top":
|
|
600
827
|
p = {
|
|
@@ -625,12 +852,12 @@ function Ke(e, t, n) {
|
|
|
625
852
|
y: r.y
|
|
626
853
|
};
|
|
627
854
|
}
|
|
628
|
-
let m =
|
|
855
|
+
let m = Be(t);
|
|
629
856
|
return m && (p[o] += f * (m === "end" ? 1 : -1) * (n && l ? -1 : 1)), p;
|
|
630
857
|
}
|
|
631
|
-
async function
|
|
858
|
+
async function it(e, t) {
|
|
632
859
|
t === void 0 && (t = {});
|
|
633
|
-
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } =
|
|
860
|
+
let { x: n, y: r, platform: i, rects: a, elements: o, strategy: s } = e, { boundary: c = "clippingAncestors", rootBoundary: l = "viewport", elementContext: u = "floating", altBoundary: d = !1, padding: f = 0 } = Re(t, e), p = tt(f), m = o[d ? u === "floating" ? "reference" : "floating" : u], h = nt(await i.getClippingRect({
|
|
634
861
|
element: await (i.isElement == null ? void 0 : i.isElement(m)) ?? !0 ? m : m.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(o.floating)),
|
|
635
862
|
boundary: c,
|
|
636
863
|
rootBoundary: l,
|
|
@@ -643,7 +870,7 @@ async function qe(e, t) {
|
|
|
643
870
|
} : a.reference, _ = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(o.floating)), v = await (i.isElement == null ? void 0 : i.isElement(_)) && await (i.getScale == null ? void 0 : i.getScale(_)) || {
|
|
644
871
|
x: 1,
|
|
645
872
|
y: 1
|
|
646
|
-
}, y =
|
|
873
|
+
}, y = nt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
647
874
|
elements: o,
|
|
648
875
|
rect: g,
|
|
649
876
|
offsetParent: _,
|
|
@@ -656,15 +883,15 @@ async function qe(e, t) {
|
|
|
656
883
|
right: (y.right - h.right + p.right) / v.x
|
|
657
884
|
};
|
|
658
885
|
}
|
|
659
|
-
var
|
|
886
|
+
var at = 50, ot = async (e, t, n) => {
|
|
660
887
|
let { placement: r = "bottom", strategy: i = "absolute", middleware: a = [], platform: o } = n, s = o.detectOverflow ? o : {
|
|
661
888
|
...o,
|
|
662
|
-
detectOverflow:
|
|
889
|
+
detectOverflow: it
|
|
663
890
|
}, c = await (o.isRTL == null ? void 0 : o.isRTL(t)), l = await o.getElementRects({
|
|
664
891
|
reference: e,
|
|
665
892
|
floating: t,
|
|
666
893
|
strategy: i
|
|
667
|
-
}), { x: u, y: d } =
|
|
894
|
+
}), { x: u, y: d } = rt(l, r, c), f = r, p = 0, m = {};
|
|
668
895
|
for (let n = 0; n < a.length; n++) {
|
|
669
896
|
let h = a[n];
|
|
670
897
|
if (!h) continue;
|
|
@@ -685,11 +912,11 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
685
912
|
u = v ?? u, d = y ?? d, m[g] = {
|
|
686
913
|
...m[g],
|
|
687
914
|
...b
|
|
688
|
-
}, x && p <
|
|
915
|
+
}, x && p < at && (p++, typeof x == "object" && (x.placement && (f = x.placement), x.rects && (l = x.rects === !0 ? await o.getElementRects({
|
|
689
916
|
reference: e,
|
|
690
917
|
floating: t,
|
|
691
918
|
strategy: i
|
|
692
|
-
}) : x.rects), {x: u, y: d} =
|
|
919
|
+
}) : x.rects), {x: u, y: d} = rt(l, f, c)), n = -1);
|
|
693
920
|
}
|
|
694
921
|
return {
|
|
695
922
|
x: u,
|
|
@@ -698,18 +925,18 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
698
925
|
strategy: i,
|
|
699
926
|
middlewareData: m
|
|
700
927
|
};
|
|
701
|
-
},
|
|
928
|
+
}, st = (e) => ({
|
|
702
929
|
name: "arrow",
|
|
703
930
|
options: e,
|
|
704
931
|
async fn(t) {
|
|
705
|
-
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } =
|
|
932
|
+
let { x: n, y: r, placement: i, rects: a, platform: o, elements: s, middlewareData: c } = t, { element: l, padding: u = 0 } = Re(e, t) || {};
|
|
706
933
|
if (l == null) return {};
|
|
707
|
-
let d =
|
|
934
|
+
let d = tt(u), f = {
|
|
708
935
|
x: n,
|
|
709
936
|
y: r
|
|
710
|
-
}, p =
|
|
937
|
+
}, p = Ue(i), m = He(p), h = await o.getDimensions(l), g = p === "y", _ = g ? "top" : "left", v = g ? "bottom" : "right", y = g ? "clientHeight" : "clientWidth", b = a.reference[m] + a.reference[p] - f[p] - a.floating[m], x = f[p] - a.reference[p], S = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l)), C = S ? S[y] : 0;
|
|
711
938
|
(!C || !await (o.isElement == null ? void 0 : o.isElement(S))) && (C = s.floating[y] || a.floating[m]);
|
|
712
|
-
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E =
|
|
939
|
+
let w = b / 2 - x / 2, T = C / 2 - h[m] / 2 - 1, E = q(d[_], T), D = q(d[v], T), O = C - h[m] - D, k = C / 2 - h[m] / 2 + w, A = Le(E, k, O), j = !c.arrow && Be(i) != null && k !== A && a.reference[m] / 2 - (k < E ? E : D) - h[m] / 2 < 0, M = j ? k < E ? k - E : k - O : 0;
|
|
713
940
|
return {
|
|
714
941
|
[p]: f[p] + M,
|
|
715
942
|
data: {
|
|
@@ -720,19 +947,19 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
720
947
|
reset: j
|
|
721
948
|
};
|
|
722
949
|
}
|
|
723
|
-
}),
|
|
950
|
+
}), ct = function(e) {
|
|
724
951
|
return e === void 0 && (e = {}), {
|
|
725
952
|
name: "flip",
|
|
726
953
|
options: e,
|
|
727
954
|
async fn(t) {
|
|
728
955
|
var n;
|
|
729
|
-
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } =
|
|
956
|
+
let { placement: r, middlewareData: i, rects: a, initialPlacement: o, platform: s, elements: c } = t, { mainAxis: l = !0, crossAxis: u = !0, fallbackPlacements: d, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: p = "none", flipAlignment: m = !0, ...h } = Re(e, t);
|
|
730
957
|
if ((n = i.arrow) != null && n.alignmentOffset) return {};
|
|
731
|
-
let g =
|
|
732
|
-
!d && x && b.push(...
|
|
958
|
+
let g = ze(r), _ = Y(o), v = ze(o) === o, y = await (s.isRTL == null ? void 0 : s.isRTL(c.floating)), b = d || (v || !m ? [$e(o)] : Ge(o)), x = p !== "none";
|
|
959
|
+
!d && x && b.push(...Qe(o, m, p, y));
|
|
733
960
|
let S = [o, ...b], C = await s.detectOverflow(t, h), w = [], T = i.flip?.overflows || [];
|
|
734
961
|
if (l && w.push(C[g]), u) {
|
|
735
|
-
let e =
|
|
962
|
+
let e = We(r, a, y);
|
|
736
963
|
w.push(C[e[0]], C[e[1]]);
|
|
737
964
|
}
|
|
738
965
|
if (T = [...T, {
|
|
@@ -740,7 +967,7 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
740
967
|
overflows: w
|
|
741
968
|
}], !w.every((e) => e <= 0)) {
|
|
742
969
|
let e = (i.flip?.index || 0) + 1, t = S[e];
|
|
743
|
-
if (t && (u !== "alignment" || _ ===
|
|
970
|
+
if (t && (u !== "alignment" || _ === Y(t) || T.every((e) => Y(e.placement) !== _ || e.overflows[0] > 0))) return {
|
|
744
971
|
data: {
|
|
745
972
|
index: e,
|
|
746
973
|
overflows: T
|
|
@@ -752,7 +979,7 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
752
979
|
case "bestFit": {
|
|
753
980
|
let e = T.filter((e) => {
|
|
754
981
|
if (x) {
|
|
755
|
-
let t =
|
|
982
|
+
let t = Y(e.placement);
|
|
756
983
|
return t === _ || t === "y";
|
|
757
984
|
}
|
|
758
985
|
return !0;
|
|
@@ -767,9 +994,9 @@ var Je = 50, Ye = async (e, t, n) => {
|
|
|
767
994
|
return {};
|
|
768
995
|
}
|
|
769
996
|
};
|
|
770
|
-
},
|
|
771
|
-
async function
|
|
772
|
-
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o =
|
|
997
|
+
}, lt = /*#__PURE__*/ new Set(["left", "top"]);
|
|
998
|
+
async function ut(e, t) {
|
|
999
|
+
let { placement: n, platform: r, elements: i } = e, a = await (r.isRTL == null ? void 0 : r.isRTL(i.floating)), o = ze(n), s = Be(n), c = Y(n) === "y", l = lt.has(o) ? -1 : 1, u = a && c ? -1 : 1, d = Re(t, e), { mainAxis: f, crossAxis: p, alignmentAxis: m } = typeof d == "number" ? {
|
|
773
1000
|
mainAxis: d,
|
|
774
1001
|
crossAxis: 0,
|
|
775
1002
|
alignmentAxis: null
|
|
@@ -786,13 +1013,13 @@ async function $e(e, t) {
|
|
|
786
1013
|
y: p * u
|
|
787
1014
|
};
|
|
788
1015
|
}
|
|
789
|
-
var
|
|
1016
|
+
var dt = function(e) {
|
|
790
1017
|
return e === void 0 && (e = 0), {
|
|
791
1018
|
name: "offset",
|
|
792
1019
|
options: e,
|
|
793
1020
|
async fn(t) {
|
|
794
1021
|
var n;
|
|
795
|
-
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await
|
|
1022
|
+
let { x: r, y: i, placement: a, middlewareData: o } = t, s = await ut(t, e);
|
|
796
1023
|
return a === o.offset?.placement && (n = o.arrow) != null && n.alignmentOffset ? {} : {
|
|
797
1024
|
x: r + s.x,
|
|
798
1025
|
y: i + s.y,
|
|
@@ -803,7 +1030,7 @@ var et = function(e) {
|
|
|
803
1030
|
};
|
|
804
1031
|
}
|
|
805
1032
|
};
|
|
806
|
-
},
|
|
1033
|
+
}, ft = function(e) {
|
|
807
1034
|
return e === void 0 && (e = {}), {
|
|
808
1035
|
name: "shift",
|
|
809
1036
|
options: e,
|
|
@@ -814,10 +1041,10 @@ var et = function(e) {
|
|
|
814
1041
|
x: t,
|
|
815
1042
|
y: n
|
|
816
1043
|
};
|
|
817
|
-
} }, ...l } =
|
|
1044
|
+
} }, ...l } = Re(e, t), u = {
|
|
818
1045
|
x: n,
|
|
819
1046
|
y: r
|
|
820
|
-
}, d = await a.detectOverflow(t, l), f =
|
|
1047
|
+
}, d = await a.detectOverflow(t, l), f = Y(i), p = Ve(f), m = u[p], h = u[f], g = (e, t) => Le(t + d[e === "y" ? "top" : "left"], t, t - d[e === "y" ? "bottom" : "right"]);
|
|
821
1048
|
o && (m = g(p, m)), s && (h = g(f, h));
|
|
822
1049
|
let _ = c.fn({
|
|
823
1050
|
...t,
|
|
@@ -840,39 +1067,39 @@ var et = function(e) {
|
|
|
840
1067
|
};
|
|
841
1068
|
//#endregion
|
|
842
1069
|
//#region node_modules/.pnpm/@floating-ui+utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
|
|
843
|
-
function
|
|
1070
|
+
function pt() {
|
|
844
1071
|
return typeof window < "u";
|
|
845
1072
|
}
|
|
846
|
-
function
|
|
847
|
-
return
|
|
1073
|
+
function mt(e) {
|
|
1074
|
+
return ht(e) ? (e.nodeName || "").toLowerCase() : "#document";
|
|
848
1075
|
}
|
|
849
|
-
function
|
|
1076
|
+
function X(e) {
|
|
850
1077
|
var t;
|
|
851
1078
|
return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
|
|
852
1079
|
}
|
|
853
|
-
function
|
|
854
|
-
return ((
|
|
1080
|
+
function Z(e) {
|
|
1081
|
+
return ((ht(e) ? e.ownerDocument : e.document) || window.document)?.documentElement;
|
|
855
1082
|
}
|
|
856
|
-
function
|
|
857
|
-
return
|
|
1083
|
+
function ht(e) {
|
|
1084
|
+
return pt() ? e instanceof Node || e instanceof X(e).Node : !1;
|
|
858
1085
|
}
|
|
859
|
-
function
|
|
860
|
-
return
|
|
1086
|
+
function Q(e) {
|
|
1087
|
+
return pt() ? e instanceof Element || e instanceof X(e).Element : !1;
|
|
861
1088
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
1089
|
+
function gt(e) {
|
|
1090
|
+
return pt() ? e instanceof HTMLElement || e instanceof X(e).HTMLElement : !1;
|
|
864
1091
|
}
|
|
865
|
-
function
|
|
866
|
-
return !
|
|
1092
|
+
function _t(e) {
|
|
1093
|
+
return !pt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof X(e).ShadowRoot;
|
|
867
1094
|
}
|
|
868
|
-
function
|
|
869
|
-
let { overflow: t, overflowX: n, overflowY: r, display: i } =
|
|
1095
|
+
function vt(e) {
|
|
1096
|
+
let { overflow: t, overflowX: n, overflowY: r, display: i } = $(e);
|
|
870
1097
|
return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && i !== "inline" && i !== "contents";
|
|
871
1098
|
}
|
|
872
|
-
function
|
|
873
|
-
return /^(table|td|th)$/.test(
|
|
1099
|
+
function yt(e) {
|
|
1100
|
+
return /^(table|td|th)$/.test(mt(e));
|
|
874
1101
|
}
|
|
875
|
-
function
|
|
1102
|
+
function bt(e) {
|
|
876
1103
|
try {
|
|
877
1104
|
if (e.matches(":popover-open")) return !0;
|
|
878
1105
|
} catch {}
|
|
@@ -882,31 +1109,31 @@ function st(e) {
|
|
|
882
1109
|
return !1;
|
|
883
1110
|
}
|
|
884
1111
|
}
|
|
885
|
-
var
|
|
886
|
-
function
|
|
887
|
-
let t =
|
|
888
|
-
return
|
|
889
|
-
}
|
|
890
|
-
function
|
|
891
|
-
let t =
|
|
892
|
-
for (;
|
|
893
|
-
if (
|
|
894
|
-
if (
|
|
895
|
-
t =
|
|
1112
|
+
var xt = /transform|translate|scale|rotate|perspective|filter/, St = /paint|layout|strict|content/, Ct = (e) => !!e && e !== "none", wt;
|
|
1113
|
+
function Tt(e) {
|
|
1114
|
+
let t = Q(e) ? $(e) : e;
|
|
1115
|
+
return Ct(t.transform) || Ct(t.translate) || Ct(t.scale) || Ct(t.rotate) || Ct(t.perspective) || !Dt() && (Ct(t.backdropFilter) || Ct(t.filter)) || xt.test(t.willChange || "") || St.test(t.contain || "");
|
|
1116
|
+
}
|
|
1117
|
+
function Et(e) {
|
|
1118
|
+
let t = At(e);
|
|
1119
|
+
for (; gt(t) && !Ot(t);) {
|
|
1120
|
+
if (Tt(t)) return t;
|
|
1121
|
+
if (bt(t)) return null;
|
|
1122
|
+
t = At(t);
|
|
896
1123
|
}
|
|
897
1124
|
return null;
|
|
898
1125
|
}
|
|
899
|
-
function
|
|
900
|
-
return
|
|
1126
|
+
function Dt() {
|
|
1127
|
+
return wt ??= typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"), wt;
|
|
901
1128
|
}
|
|
902
|
-
function
|
|
903
|
-
return /^(html|body|#document)$/.test(
|
|
1129
|
+
function Ot(e) {
|
|
1130
|
+
return /^(html|body|#document)$/.test(mt(e));
|
|
904
1131
|
}
|
|
905
|
-
function
|
|
906
|
-
return
|
|
1132
|
+
function $(e) {
|
|
1133
|
+
return X(e).getComputedStyle(e);
|
|
907
1134
|
}
|
|
908
|
-
function
|
|
909
|
-
return
|
|
1135
|
+
function kt(e) {
|
|
1136
|
+
return Q(e) ? {
|
|
910
1137
|
scrollLeft: e.scrollLeft,
|
|
911
1138
|
scrollTop: e.scrollTop
|
|
912
1139
|
} : {
|
|
@@ -914,102 +1141,102 @@ function ht(e) {
|
|
|
914
1141
|
scrollTop: e.scrollY
|
|
915
1142
|
};
|
|
916
1143
|
}
|
|
917
|
-
function
|
|
918
|
-
if (
|
|
919
|
-
let t = e.assignedSlot || e.parentNode ||
|
|
920
|
-
return
|
|
1144
|
+
function At(e) {
|
|
1145
|
+
if (mt(e) === "html") return e;
|
|
1146
|
+
let t = e.assignedSlot || e.parentNode || _t(e) && e.host || Z(e);
|
|
1147
|
+
return _t(t) ? t.host : t;
|
|
921
1148
|
}
|
|
922
|
-
function
|
|
923
|
-
let t =
|
|
924
|
-
return
|
|
1149
|
+
function jt(e) {
|
|
1150
|
+
let t = At(e);
|
|
1151
|
+
return Ot(t) ? (e.ownerDocument || e).body : gt(t) && vt(t) ? t : jt(t);
|
|
925
1152
|
}
|
|
926
|
-
function
|
|
1153
|
+
function Mt(e, t, n) {
|
|
927
1154
|
t === void 0 && (t = []), n === void 0 && (n = !0);
|
|
928
|
-
let r =
|
|
1155
|
+
let r = jt(e), i = r === e.ownerDocument?.body, a = X(r);
|
|
929
1156
|
if (i) {
|
|
930
|
-
let e =
|
|
931
|
-
return t.concat(a, a.visualViewport || [],
|
|
1157
|
+
let e = Nt(a);
|
|
1158
|
+
return t.concat(a, a.visualViewport || [], vt(r) ? r : [], e && n ? Mt(e) : []);
|
|
932
1159
|
}
|
|
933
|
-
return t.concat(r,
|
|
1160
|
+
return t.concat(r, Mt(r, [], n));
|
|
934
1161
|
}
|
|
935
|
-
function
|
|
1162
|
+
function Nt(e) {
|
|
936
1163
|
return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
|
|
937
1164
|
}
|
|
938
1165
|
//#endregion
|
|
939
1166
|
//#region node_modules/.pnpm/@floating-ui+dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
|
|
940
|
-
function
|
|
941
|
-
let t =
|
|
1167
|
+
function Pt(e) {
|
|
1168
|
+
let t = $(e), n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0, i = gt(e), a = i ? e.offsetWidth : n, o = i ? e.offsetHeight : r, s = Pe(n) !== a || Pe(r) !== o;
|
|
942
1169
|
return s && (n = a, r = o), {
|
|
943
1170
|
width: n,
|
|
944
1171
|
height: r,
|
|
945
1172
|
$: s
|
|
946
1173
|
};
|
|
947
1174
|
}
|
|
948
|
-
function
|
|
949
|
-
return
|
|
1175
|
+
function Ft(e) {
|
|
1176
|
+
return Q(e) ? e : e.contextElement;
|
|
950
1177
|
}
|
|
951
|
-
function
|
|
952
|
-
let t =
|
|
953
|
-
if (!
|
|
954
|
-
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } =
|
|
1178
|
+
function It(e) {
|
|
1179
|
+
let t = Ft(e);
|
|
1180
|
+
if (!gt(t)) return J(1);
|
|
1181
|
+
let n = t.getBoundingClientRect(), { width: r, height: i, $: a } = Pt(t), o = (a ? Pe(n.width) : n.width) / r, s = (a ? Pe(n.height) : n.height) / i;
|
|
955
1182
|
return (!o || !Number.isFinite(o)) && (o = 1), (!s || !Number.isFinite(s)) && (s = 1), {
|
|
956
1183
|
x: o,
|
|
957
1184
|
y: s
|
|
958
1185
|
};
|
|
959
1186
|
}
|
|
960
|
-
var
|
|
961
|
-
function
|
|
962
|
-
let t =
|
|
963
|
-
return !
|
|
1187
|
+
var Lt = /*#__PURE__*/ J(0);
|
|
1188
|
+
function Rt(e) {
|
|
1189
|
+
let t = X(e);
|
|
1190
|
+
return !Dt() || !t.visualViewport ? Lt : {
|
|
964
1191
|
x: t.visualViewport.offsetLeft,
|
|
965
1192
|
y: t.visualViewport.offsetTop
|
|
966
1193
|
};
|
|
967
1194
|
}
|
|
968
|
-
function
|
|
969
|
-
return t === void 0 && (t = !1), !!n && t && n ===
|
|
1195
|
+
function zt(e, t, n) {
|
|
1196
|
+
return t === void 0 && (t = !1), !!n && t && n === X(e);
|
|
970
1197
|
}
|
|
971
|
-
function
|
|
1198
|
+
function Bt(e, t, n, r) {
|
|
972
1199
|
t === void 0 && (t = !1), n === void 0 && (n = !1);
|
|
973
|
-
let i = e.getBoundingClientRect(), a =
|
|
974
|
-
t && (r ?
|
|
975
|
-
let s =
|
|
1200
|
+
let i = e.getBoundingClientRect(), a = Ft(e), o = J(1);
|
|
1201
|
+
t && (r ? Q(r) && (o = It(r)) : o = It(e));
|
|
1202
|
+
let s = zt(a, n, r) ? Rt(a) : J(0), c = (i.left + s.x) / o.x, l = (i.top + s.y) / o.y, u = i.width / o.x, d = i.height / o.y;
|
|
976
1203
|
if (a && r) {
|
|
977
|
-
let e =
|
|
1204
|
+
let e = X(a), t = Q(r) ? X(r) : r, n = e, i = Nt(n);
|
|
978
1205
|
for (; i && t !== n;) {
|
|
979
|
-
let e =
|
|
980
|
-
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n =
|
|
1206
|
+
let e = It(i), t = i.getBoundingClientRect(), r = $(i), a = t.left + (i.clientLeft + parseFloat(r.paddingLeft)) * e.x, o = t.top + (i.clientTop + parseFloat(r.paddingTop)) * e.y;
|
|
1207
|
+
c *= e.x, l *= e.y, u *= e.x, d *= e.y, c += a, l += o, n = X(i), i = Nt(n);
|
|
981
1208
|
}
|
|
982
1209
|
}
|
|
983
|
-
return
|
|
1210
|
+
return nt({
|
|
984
1211
|
width: u,
|
|
985
1212
|
height: d,
|
|
986
1213
|
x: c,
|
|
987
1214
|
y: l
|
|
988
1215
|
});
|
|
989
1216
|
}
|
|
990
|
-
function
|
|
991
|
-
let n =
|
|
992
|
-
return t ? t.left + n :
|
|
1217
|
+
function Vt(e, t) {
|
|
1218
|
+
let n = kt(e).scrollLeft;
|
|
1219
|
+
return t ? t.left + n : Bt(Z(e)).left + n;
|
|
993
1220
|
}
|
|
994
|
-
function
|
|
1221
|
+
function Ht(e, t) {
|
|
995
1222
|
let n = e.getBoundingClientRect();
|
|
996
1223
|
return {
|
|
997
|
-
x: n.left + t.scrollLeft -
|
|
1224
|
+
x: n.left + t.scrollLeft - Vt(e, n),
|
|
998
1225
|
y: n.top + t.scrollTop
|
|
999
1226
|
};
|
|
1000
1227
|
}
|
|
1001
|
-
function
|
|
1002
|
-
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o =
|
|
1228
|
+
function Ut(e) {
|
|
1229
|
+
let { elements: t, rect: n, offsetParent: r, strategy: i } = e, a = i === "fixed", o = Z(r), s = t ? bt(t.floating) : !1;
|
|
1003
1230
|
if (r === o || s && a) return n;
|
|
1004
1231
|
let c = {
|
|
1005
1232
|
scrollLeft: 0,
|
|
1006
1233
|
scrollTop: 0
|
|
1007
|
-
}, l =
|
|
1008
|
-
if ((d || !a) && ((
|
|
1009
|
-
let e =
|
|
1010
|
-
l =
|
|
1234
|
+
}, l = J(1), u = J(0), d = gt(r);
|
|
1235
|
+
if ((d || !a) && ((mt(r) !== "body" || vt(o)) && (c = kt(r)), d)) {
|
|
1236
|
+
let e = Bt(r);
|
|
1237
|
+
l = It(r), u.x = e.x + r.clientLeft, u.y = e.y + r.clientTop;
|
|
1011
1238
|
}
|
|
1012
|
-
let f = o && !d && !a ?
|
|
1239
|
+
let f = o && !d && !a ? Ht(o, c) : J(0);
|
|
1013
1240
|
return {
|
|
1014
1241
|
width: n.width * l.x,
|
|
1015
1242
|
height: n.height * l.y,
|
|
@@ -1017,29 +1244,29 @@ function Dt(e) {
|
|
|
1017
1244
|
y: n.y * l.y - c.scrollTop * l.y + u.y + f.y
|
|
1018
1245
|
};
|
|
1019
1246
|
}
|
|
1020
|
-
function
|
|
1247
|
+
function Wt(e) {
|
|
1021
1248
|
return e.getClientRects ? Array.from(e.getClientRects()) : [];
|
|
1022
1249
|
}
|
|
1023
|
-
function
|
|
1024
|
-
let t =
|
|
1025
|
-
return
|
|
1250
|
+
function Gt(e) {
|
|
1251
|
+
let t = kt(e), n = e.ownerDocument.body, r = Ne(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), i = Ne(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight), a = -t.scrollLeft + Vt(e), o = -t.scrollTop;
|
|
1252
|
+
return $(n).direction === "rtl" && (a += Ne(e.clientWidth, n.clientWidth) - r), {
|
|
1026
1253
|
width: r,
|
|
1027
1254
|
height: i,
|
|
1028
1255
|
x: a,
|
|
1029
1256
|
y: o
|
|
1030
1257
|
};
|
|
1031
1258
|
}
|
|
1032
|
-
var
|
|
1033
|
-
function
|
|
1259
|
+
var Kt = 25;
|
|
1260
|
+
function qt(e, t, n) {
|
|
1034
1261
|
n === void 0 && (n = "viewport");
|
|
1035
|
-
let r = n === "layoutViewport", i =
|
|
1262
|
+
let r = n === "layoutViewport", i = X(e), a = Z(e), o = i.visualViewport, s = a.clientWidth, c = a.clientHeight, l = 0, u = 0;
|
|
1036
1263
|
if (o) {
|
|
1037
|
-
let e = !
|
|
1264
|
+
let e = !Dt() || t === "fixed";
|
|
1038
1265
|
r ? e || (l = -o.offsetLeft, u = -o.offsetTop) : (s = o.width, c = o.height, e && (l = o.offsetLeft, u = o.offsetTop));
|
|
1039
1266
|
}
|
|
1040
|
-
if (
|
|
1267
|
+
if (Vt(a) <= 0) {
|
|
1041
1268
|
let e = a.ownerDocument, t = e.body, n = getComputedStyle(t), r = e.compatMode === "CSS1Compat" && parseFloat(n.marginLeft) + parseFloat(n.marginRight) || 0, i = Math.abs(a.clientWidth - t.clientWidth - r), o = getComputedStyle(a).scrollbarGutter === "stable both-edges" ? i / 2 : i;
|
|
1042
|
-
o <=
|
|
1269
|
+
o <= Kt && (s -= o);
|
|
1043
1270
|
}
|
|
1044
1271
|
return {
|
|
1045
1272
|
width: s,
|
|
@@ -1048,8 +1275,8 @@ function jt(e, t, n) {
|
|
|
1048
1275
|
y: u
|
|
1049
1276
|
};
|
|
1050
1277
|
}
|
|
1051
|
-
function
|
|
1052
|
-
let n =
|
|
1278
|
+
function Jt(e, t) {
|
|
1279
|
+
let n = Bt(e, !0, t === "fixed"), r = n.top + e.clientTop, i = n.left + e.clientLeft, a = It(e);
|
|
1053
1280
|
return {
|
|
1054
1281
|
width: e.clientWidth * a.x,
|
|
1055
1282
|
height: e.clientHeight * a.y,
|
|
@@ -1057,13 +1284,13 @@ function Mt(e, t) {
|
|
|
1057
1284
|
y: r * a.y
|
|
1058
1285
|
};
|
|
1059
1286
|
}
|
|
1060
|
-
function
|
|
1287
|
+
function Yt(e, t, n) {
|
|
1061
1288
|
let r;
|
|
1062
|
-
if (t === "viewport" || t === "layoutViewport") r =
|
|
1063
|
-
else if (t === "document") r =
|
|
1064
|
-
else if (
|
|
1289
|
+
if (t === "viewport" || t === "layoutViewport") r = qt(e, n, t);
|
|
1290
|
+
else if (t === "document") r = Gt(Z(e));
|
|
1291
|
+
else if (Q(t)) r = Jt(t, n);
|
|
1065
1292
|
else {
|
|
1066
|
-
let n =
|
|
1293
|
+
let n = Rt(e);
|
|
1067
1294
|
r = {
|
|
1068
1295
|
x: t.x - n.x,
|
|
1069
1296
|
y: t.y - n.y,
|
|
@@ -1071,23 +1298,23 @@ function Nt(e, t, n) {
|
|
|
1071
1298
|
height: t.height
|
|
1072
1299
|
};
|
|
1073
1300
|
}
|
|
1074
|
-
return
|
|
1301
|
+
return nt(r);
|
|
1075
1302
|
}
|
|
1076
|
-
function
|
|
1303
|
+
function Xt(e, t) {
|
|
1077
1304
|
let n = t.get(e);
|
|
1078
1305
|
if (n) return n;
|
|
1079
|
-
let r =
|
|
1080
|
-
for (;
|
|
1081
|
-
let e =
|
|
1082
|
-
!t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o =
|
|
1306
|
+
let r = Mt(e, [], !1).filter((e) => Q(e) && mt(e) !== "body"), i = null, a = $(e).position === "fixed", o = a ? At(e) : e;
|
|
1307
|
+
for (; Q(o) && !Ot(o);) {
|
|
1308
|
+
let e = $(o), t = Tt(o), n = i ? i.position : a ? "fixed" : "";
|
|
1309
|
+
!t && (n === "fixed" || n === "absolute" && e.position === "static") ? r = r.filter((e) => e !== o) : i = e, o = At(o);
|
|
1083
1310
|
}
|
|
1084
1311
|
return t.set(e, r), r;
|
|
1085
1312
|
}
|
|
1086
|
-
function
|
|
1087
|
-
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ?
|
|
1313
|
+
function Zt(e) {
|
|
1314
|
+
let { element: t, boundary: n, rootBoundary: r, strategy: i } = e, a = [...n === "clippingAncestors" ? bt(t) ? [] : Xt(t, this._c) : [].concat(n), r], o = Yt(t, a[0], i), s = o.top, c = o.right, l = o.bottom, u = o.left;
|
|
1088
1315
|
for (let e = 1; e < a.length; e++) {
|
|
1089
|
-
let n =
|
|
1090
|
-
s =
|
|
1316
|
+
let n = Yt(t, a[e], i);
|
|
1317
|
+
s = Ne(n.top, s), c = q(n.right, c), l = q(n.bottom, l), u = Ne(n.left, u);
|
|
1091
1318
|
}
|
|
1092
1319
|
return {
|
|
1093
1320
|
width: c - u,
|
|
@@ -1096,24 +1323,24 @@ function Ft(e) {
|
|
|
1096
1323
|
y: s
|
|
1097
1324
|
};
|
|
1098
1325
|
}
|
|
1099
|
-
function
|
|
1100
|
-
let { width: t, height: n } =
|
|
1326
|
+
function Qt(e) {
|
|
1327
|
+
let { width: t, height: n } = Pt(e);
|
|
1101
1328
|
return {
|
|
1102
1329
|
width: t,
|
|
1103
1330
|
height: n
|
|
1104
1331
|
};
|
|
1105
1332
|
}
|
|
1106
|
-
function
|
|
1107
|
-
let r =
|
|
1333
|
+
function $t(e, t, n) {
|
|
1334
|
+
let r = gt(t), i = Z(t), a = n === "fixed", o = Bt(e, !0, a, t), s = {
|
|
1108
1335
|
scrollLeft: 0,
|
|
1109
1336
|
scrollTop: 0
|
|
1110
|
-
}, c =
|
|
1111
|
-
if ((r || !a) && ((
|
|
1112
|
-
let e =
|
|
1337
|
+
}, c = J(0);
|
|
1338
|
+
if ((r || !a) && ((mt(t) !== "body" || vt(i)) && (s = kt(t)), r)) {
|
|
1339
|
+
let e = Bt(t, !0, a, t);
|
|
1113
1340
|
c.x = e.x + t.clientLeft, c.y = e.y + t.clientTop;
|
|
1114
1341
|
}
|
|
1115
|
-
!r && i && (c.x =
|
|
1116
|
-
let l = i && !r && !a ?
|
|
1342
|
+
!r && i && (c.x = Vt(i));
|
|
1343
|
+
let l = i && !r && !a ? Ht(i, s) : J(0);
|
|
1117
1344
|
return {
|
|
1118
1345
|
x: o.left + s.scrollLeft - c.x - l.x,
|
|
1119
1346
|
y: o.top + s.scrollTop - c.y - l.y,
|
|
@@ -1121,34 +1348,34 @@ function Lt(e, t, n) {
|
|
|
1121
1348
|
height: o.height
|
|
1122
1349
|
};
|
|
1123
1350
|
}
|
|
1124
|
-
function
|
|
1125
|
-
return
|
|
1351
|
+
function en(e) {
|
|
1352
|
+
return $(e).position === "static";
|
|
1126
1353
|
}
|
|
1127
|
-
function
|
|
1128
|
-
if (!
|
|
1354
|
+
function tn(e, t) {
|
|
1355
|
+
if (!gt(e) || $(e).position === "fixed") return null;
|
|
1129
1356
|
if (t) return t(e);
|
|
1130
1357
|
let n = e.offsetParent;
|
|
1131
|
-
return
|
|
1132
|
-
}
|
|
1133
|
-
function
|
|
1134
|
-
let n =
|
|
1135
|
-
if (
|
|
1136
|
-
if (!
|
|
1137
|
-
let t =
|
|
1138
|
-
for (; t && !
|
|
1139
|
-
if (
|
|
1140
|
-
t =
|
|
1358
|
+
return Z(e) === n && (n = n.ownerDocument.body), n;
|
|
1359
|
+
}
|
|
1360
|
+
function nn(e, t) {
|
|
1361
|
+
let n = X(e);
|
|
1362
|
+
if (bt(e)) return n;
|
|
1363
|
+
if (!gt(e)) {
|
|
1364
|
+
let t = At(e);
|
|
1365
|
+
for (; t && !Ot(t);) {
|
|
1366
|
+
if (Q(t) && !en(t)) return t;
|
|
1367
|
+
t = At(t);
|
|
1141
1368
|
}
|
|
1142
1369
|
return n;
|
|
1143
1370
|
}
|
|
1144
|
-
let r =
|
|
1145
|
-
for (; r &&
|
|
1146
|
-
return r &&
|
|
1371
|
+
let r = tn(e, t);
|
|
1372
|
+
for (; r && yt(r) && en(r);) r = tn(r, t);
|
|
1373
|
+
return r && Ot(r) && en(r) && !Tt(r) ? n : r || Et(e) || n;
|
|
1147
1374
|
}
|
|
1148
|
-
var
|
|
1149
|
-
let t = this.getOffsetParent ||
|
|
1375
|
+
var rn = async function(e) {
|
|
1376
|
+
let t = this.getOffsetParent || nn, n = this.getDimensions, r = await n(e.floating);
|
|
1150
1377
|
return {
|
|
1151
|
-
reference:
|
|
1378
|
+
reference: $t(e.reference, await t(e.floating), e.strategy),
|
|
1152
1379
|
floating: {
|
|
1153
1380
|
x: 0,
|
|
1154
1381
|
y: 0,
|
|
@@ -1157,26 +1384,26 @@ var Vt = async function(e) {
|
|
|
1157
1384
|
}
|
|
1158
1385
|
};
|
|
1159
1386
|
};
|
|
1160
|
-
function
|
|
1161
|
-
return
|
|
1162
|
-
}
|
|
1163
|
-
var
|
|
1164
|
-
convertOffsetParentRelativeRectToViewportRelativeRect:
|
|
1165
|
-
getDocumentElement:
|
|
1166
|
-
getClippingRect:
|
|
1167
|
-
getOffsetParent:
|
|
1168
|
-
getElementRects:
|
|
1169
|
-
getClientRects:
|
|
1170
|
-
getDimensions:
|
|
1171
|
-
getScale:
|
|
1172
|
-
isElement:
|
|
1173
|
-
isRTL:
|
|
1387
|
+
function an(e) {
|
|
1388
|
+
return $(e).direction === "rtl";
|
|
1389
|
+
}
|
|
1390
|
+
var on = {
|
|
1391
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: Ut,
|
|
1392
|
+
getDocumentElement: Z,
|
|
1393
|
+
getClippingRect: Zt,
|
|
1394
|
+
getOffsetParent: nn,
|
|
1395
|
+
getElementRects: rn,
|
|
1396
|
+
getClientRects: Wt,
|
|
1397
|
+
getDimensions: Qt,
|
|
1398
|
+
getScale: It,
|
|
1399
|
+
isElement: Q,
|
|
1400
|
+
isRTL: an
|
|
1174
1401
|
};
|
|
1175
|
-
function
|
|
1402
|
+
function sn(e, t) {
|
|
1176
1403
|
return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
|
|
1177
1404
|
}
|
|
1178
|
-
function
|
|
1179
|
-
let r = null, i, a =
|
|
1405
|
+
function cn(e, t, n) {
|
|
1406
|
+
let r = null, i, a = Z(e);
|
|
1180
1407
|
function o() {
|
|
1181
1408
|
var e;
|
|
1182
1409
|
clearTimeout(i), (e = r) == null || e.disconnect(), r = null;
|
|
@@ -1185,13 +1412,13 @@ function Gt(e, t, n) {
|
|
|
1185
1412
|
n === void 0 && (n = !1), c === void 0 && (c = 1), o();
|
|
1186
1413
|
let l = e.getBoundingClientRect(), { left: u, top: d, width: f, height: p } = l;
|
|
1187
1414
|
if (n || t(), !f || !p) return;
|
|
1188
|
-
let m =
|
|
1415
|
+
let m = Fe(d), h = Fe(a.clientWidth - (u + f)), g = Fe(a.clientHeight - (d + p)), _ = Fe(u), v = {
|
|
1189
1416
|
rootMargin: -m + "px " + -h + "px " + -g + "px " + -_ + "px",
|
|
1190
|
-
threshold:
|
|
1417
|
+
threshold: Ne(0, q(1, c)) || 1
|
|
1191
1418
|
}, y = !0;
|
|
1192
1419
|
function b(t) {
|
|
1193
1420
|
let n = t[0].intersectionRatio;
|
|
1194
|
-
if (!
|
|
1421
|
+
if (!sn(l, e.getBoundingClientRect())) return s();
|
|
1195
1422
|
if (n !== c) {
|
|
1196
1423
|
if (!y) return s();
|
|
1197
1424
|
n ? s(!1, n) : i = setTimeout(() => {
|
|
@@ -1210,18 +1437,18 @@ function Gt(e, t, n) {
|
|
|
1210
1437
|
}
|
|
1211
1438
|
r.observe(e);
|
|
1212
1439
|
}
|
|
1213
|
-
let c =
|
|
1440
|
+
let c = X(e), l = () => s(n);
|
|
1214
1441
|
return c.addEventListener("resize", l), s(!0), () => {
|
|
1215
1442
|
c.removeEventListener("resize", l), o();
|
|
1216
1443
|
};
|
|
1217
1444
|
}
|
|
1218
|
-
function
|
|
1445
|
+
function ln(e, t, n, r) {
|
|
1219
1446
|
r === void 0 && (r = {});
|
|
1220
|
-
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l =
|
|
1447
|
+
let { ancestorScroll: i = !0, ancestorResize: a = !0, elementResize: o = typeof ResizeObserver == "function", layoutShift: s = typeof IntersectionObserver == "function", animationFrame: c = !1 } = r, l = Ft(e), u = i || a ? [...l ? Mt(l) : [], ...t ? Mt(t) : []] : [];
|
|
1221
1448
|
u.forEach((e) => {
|
|
1222
1449
|
i && e.addEventListener("scroll", n), a && e.addEventListener("resize", n);
|
|
1223
1450
|
});
|
|
1224
|
-
let d = l && s ?
|
|
1451
|
+
let d = l && s ? cn(l, n, a) : null, f = -1, p = null;
|
|
1225
1452
|
o && (p = new ResizeObserver((e) => {
|
|
1226
1453
|
let [r] = e;
|
|
1227
1454
|
r && r.target === l && p && t && (p.unobserve(t), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
|
|
@@ -1229,11 +1456,11 @@ function Kt(e, t, n, r) {
|
|
|
1229
1456
|
(e = p) == null || e.observe(t);
|
|
1230
1457
|
})), n();
|
|
1231
1458
|
}), l && !c && p.observe(l), t && p.observe(t));
|
|
1232
|
-
let m, h = c ?
|
|
1459
|
+
let m, h = c ? Bt(e) : null;
|
|
1233
1460
|
c && g();
|
|
1234
1461
|
function g() {
|
|
1235
|
-
let t =
|
|
1236
|
-
h && !
|
|
1462
|
+
let t = Bt(e);
|
|
1463
|
+
h && !sn(h, t) && n(), h = t, m = requestAnimationFrame(g);
|
|
1237
1464
|
}
|
|
1238
1465
|
return n(), () => {
|
|
1239
1466
|
var e;
|
|
@@ -1242,18 +1469,18 @@ function Kt(e, t, n, r) {
|
|
|
1242
1469
|
}), d?.(), (e = p) == null || e.disconnect(), p = null, c && cancelAnimationFrame(m);
|
|
1243
1470
|
};
|
|
1244
1471
|
}
|
|
1245
|
-
var
|
|
1472
|
+
var un = dt, dn = ft, fn = ct, pn = st, mn = (e, t, n) => {
|
|
1246
1473
|
let r = /* @__PURE__ */ new Map(), i = n ?? {}, a = {
|
|
1247
|
-
...
|
|
1474
|
+
...on,
|
|
1248
1475
|
...i.platform,
|
|
1249
1476
|
_c: r
|
|
1250
1477
|
};
|
|
1251
|
-
return
|
|
1478
|
+
return ot(e, t, {
|
|
1252
1479
|
...i,
|
|
1253
1480
|
platform: a
|
|
1254
1481
|
});
|
|
1255
|
-
},
|
|
1256
|
-
function
|
|
1482
|
+
}, hn = typeof document < "u" ? u : function() {};
|
|
1483
|
+
function gn(e, t) {
|
|
1257
1484
|
if (e === t) return !0;
|
|
1258
1485
|
if (typeof e != typeof t) return !1;
|
|
1259
1486
|
if (typeof e == "function" && e.toString() === t.toString()) return !0;
|
|
@@ -1261,33 +1488,33 @@ function $t(e, t) {
|
|
|
1261
1488
|
if (e && t && typeof e == "object") {
|
|
1262
1489
|
if (Array.isArray(e)) {
|
|
1263
1490
|
if (n = e.length, n !== t.length) return !1;
|
|
1264
|
-
for (r = n; r-- !== 0;) if (
|
|
1491
|
+
for (r = n; r-- !== 0;) if (!gn(e[r], t[r])) return !1;
|
|
1265
1492
|
return !0;
|
|
1266
1493
|
}
|
|
1267
1494
|
if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length) return !1;
|
|
1268
1495
|
for (r = n; r-- !== 0;) if (!{}.hasOwnProperty.call(t, i[r])) return !1;
|
|
1269
1496
|
for (r = n; r-- !== 0;) {
|
|
1270
1497
|
let n = i[r];
|
|
1271
|
-
if (!(n === "_owner" && e.$$typeof) &&
|
|
1498
|
+
if (!(n === "_owner" && e.$$typeof) && !gn(e[n], t[n])) return !1;
|
|
1272
1499
|
}
|
|
1273
1500
|
return !0;
|
|
1274
1501
|
}
|
|
1275
1502
|
return e !== e && t !== t;
|
|
1276
1503
|
}
|
|
1277
|
-
function
|
|
1504
|
+
function _n(e) {
|
|
1278
1505
|
return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
|
|
1279
1506
|
}
|
|
1280
|
-
function
|
|
1281
|
-
let n =
|
|
1507
|
+
function vn(e, t) {
|
|
1508
|
+
let n = _n(e);
|
|
1282
1509
|
return Math.round(t * n) / n;
|
|
1283
1510
|
}
|
|
1284
|
-
function
|
|
1511
|
+
function yn(t) {
|
|
1285
1512
|
let n = e.useRef(t);
|
|
1286
|
-
return
|
|
1513
|
+
return hn(() => {
|
|
1287
1514
|
n.current = t;
|
|
1288
1515
|
}), n;
|
|
1289
1516
|
}
|
|
1290
|
-
function
|
|
1517
|
+
function bn(t) {
|
|
1291
1518
|
t === void 0 && (t = {});
|
|
1292
1519
|
let { placement: n = "bottom", strategy: r = "absolute", middleware: i = [], platform: a, elements: { reference: o, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = t, [d, f] = e.useState({
|
|
1293
1520
|
x: 0,
|
|
@@ -1297,24 +1524,24 @@ function rn(t) {
|
|
|
1297
1524
|
middlewareData: {},
|
|
1298
1525
|
isPositioned: !1
|
|
1299
1526
|
}), [p, m] = e.useState(i);
|
|
1300
|
-
|
|
1527
|
+
gn(p, i) || m(i);
|
|
1301
1528
|
let [h, g] = e.useState(null), [_, y] = e.useState(null), b = e.useCallback((e) => {
|
|
1302
1529
|
e !== w.current && (w.current = e, g(e));
|
|
1303
1530
|
}, []), x = e.useCallback((e) => {
|
|
1304
1531
|
e !== T.current && (T.current = e, y(e));
|
|
1305
|
-
}, []), S = o || h, C = s || _, w = e.useRef(null), T = e.useRef(null), E = e.useRef(d), D = l != null, O =
|
|
1532
|
+
}, []), S = o || h, C = s || _, w = e.useRef(null), T = e.useRef(null), E = e.useRef(d), D = l != null, O = yn(l), k = yn(a), A = yn(u), j = e.useCallback(() => {
|
|
1306
1533
|
if (!w.current || !T.current) return;
|
|
1307
1534
|
let e = {
|
|
1308
1535
|
placement: n,
|
|
1309
1536
|
strategy: r,
|
|
1310
1537
|
middleware: p
|
|
1311
1538
|
};
|
|
1312
|
-
k.current && (e.platform = k.current),
|
|
1539
|
+
k.current && (e.platform = k.current), mn(w.current, T.current, e).then((e) => {
|
|
1313
1540
|
let t = {
|
|
1314
1541
|
...e,
|
|
1315
1542
|
isPositioned: A.current !== !1
|
|
1316
1543
|
};
|
|
1317
|
-
M.current &&
|
|
1544
|
+
M.current && !gn(E.current, t) && (E.current = t, v.flushSync(() => {
|
|
1318
1545
|
f(t);
|
|
1319
1546
|
}));
|
|
1320
1547
|
});
|
|
@@ -1325,16 +1552,16 @@ function rn(t) {
|
|
|
1325
1552
|
k,
|
|
1326
1553
|
A
|
|
1327
1554
|
]);
|
|
1328
|
-
|
|
1555
|
+
hn(() => {
|
|
1329
1556
|
u === !1 && E.current.isPositioned && (E.current.isPositioned = !1, f((e) => ({
|
|
1330
1557
|
...e,
|
|
1331
1558
|
isPositioned: !1
|
|
1332
1559
|
})));
|
|
1333
1560
|
}, [u]);
|
|
1334
1561
|
let M = e.useRef(!1);
|
|
1335
|
-
|
|
1562
|
+
hn(() => (M.current = !0, () => {
|
|
1336
1563
|
M.current = !1;
|
|
1337
|
-
}), []),
|
|
1564
|
+
}), []), hn(() => {
|
|
1338
1565
|
if (S && (w.current = S), C && (T.current = C), S && C) {
|
|
1339
1566
|
if (O.current) return O.current(S, C, j);
|
|
1340
1567
|
j();
|
|
@@ -1361,11 +1588,11 @@ function rn(t) {
|
|
|
1361
1588
|
top: 0
|
|
1362
1589
|
};
|
|
1363
1590
|
if (!P.floating) return e;
|
|
1364
|
-
let t =
|
|
1591
|
+
let t = vn(P.floating, d.x), n = vn(P.floating, d.y);
|
|
1365
1592
|
return c ? {
|
|
1366
1593
|
...e,
|
|
1367
1594
|
transform: "translate(" + t + "px, " + n + "px)",
|
|
1368
|
-
...
|
|
1595
|
+
..._n(P.floating) >= 1.5 && { willChange: "transform" }
|
|
1369
1596
|
} : {
|
|
1370
1597
|
position: r,
|
|
1371
1598
|
left: t,
|
|
@@ -1392,7 +1619,7 @@ function rn(t) {
|
|
|
1392
1619
|
F
|
|
1393
1620
|
]);
|
|
1394
1621
|
}
|
|
1395
|
-
var
|
|
1622
|
+
var xn = (e) => {
|
|
1396
1623
|
function t(e) {
|
|
1397
1624
|
return {}.hasOwnProperty.call(e, "current");
|
|
1398
1625
|
}
|
|
@@ -1401,61 +1628,92 @@ var an = (e) => {
|
|
|
1401
1628
|
options: e,
|
|
1402
1629
|
fn(n) {
|
|
1403
1630
|
let { element: r, padding: i } = typeof e == "function" ? e(n) : e;
|
|
1404
|
-
return r && t(r) ? r.current == null ? {} :
|
|
1631
|
+
return r && t(r) ? r.current == null ? {} : pn({
|
|
1405
1632
|
element: r.current,
|
|
1406
1633
|
padding: i
|
|
1407
|
-
}).fn(n) : r ?
|
|
1634
|
+
}).fn(n) : r ? pn({
|
|
1408
1635
|
element: r,
|
|
1409
1636
|
padding: i
|
|
1410
1637
|
}).fn(n) : {};
|
|
1411
1638
|
}
|
|
1412
1639
|
};
|
|
1413
|
-
},
|
|
1414
|
-
let n =
|
|
1640
|
+
}, Sn = (e, t) => {
|
|
1641
|
+
let n = un(e);
|
|
1415
1642
|
return {
|
|
1416
1643
|
name: n.name,
|
|
1417
1644
|
fn: n.fn,
|
|
1418
1645
|
options: [e, t]
|
|
1419
1646
|
};
|
|
1420
|
-
},
|
|
1421
|
-
let n =
|
|
1647
|
+
}, Cn = (e, t) => {
|
|
1648
|
+
let n = dn(e);
|
|
1422
1649
|
return {
|
|
1423
1650
|
name: n.name,
|
|
1424
1651
|
fn: n.fn,
|
|
1425
1652
|
options: [e, t]
|
|
1426
1653
|
};
|
|
1427
|
-
},
|
|
1428
|
-
let n =
|
|
1654
|
+
}, wn = (e, t) => {
|
|
1655
|
+
let n = fn(e);
|
|
1429
1656
|
return {
|
|
1430
1657
|
name: n.name,
|
|
1431
1658
|
fn: n.fn,
|
|
1432
1659
|
options: [e, t]
|
|
1433
1660
|
};
|
|
1434
|
-
},
|
|
1435
|
-
let n =
|
|
1661
|
+
}, Tn = (e, t) => {
|
|
1662
|
+
let n = xn(e);
|
|
1436
1663
|
return {
|
|
1437
1664
|
name: n.name,
|
|
1438
1665
|
fn: n.fn,
|
|
1439
1666
|
options: [e, t]
|
|
1440
1667
|
};
|
|
1441
|
-
},
|
|
1442
|
-
function
|
|
1443
|
-
return s(
|
|
1668
|
+
}, En = r(null);
|
|
1669
|
+
function Dn() {
|
|
1670
|
+
return s(En);
|
|
1671
|
+
}
|
|
1672
|
+
//#endregion
|
|
1673
|
+
//#region src/components/menu/find_typeahead_index.ts
|
|
1674
|
+
var On = -1;
|
|
1675
|
+
function kn(e, t, n) {
|
|
1676
|
+
let r = n.toLowerCase(), i = e.length;
|
|
1677
|
+
for (let n = 1; n <= i; n += 1) {
|
|
1678
|
+
let a = (t + n + i) % i;
|
|
1679
|
+
if (e[a]?.toLowerCase().startsWith(r)) return a;
|
|
1680
|
+
}
|
|
1681
|
+
return On;
|
|
1444
1682
|
}
|
|
1445
1683
|
//#endregion
|
|
1446
1684
|
//#region src/components/menu/menu_surface.tsx
|
|
1447
|
-
var
|
|
1448
|
-
function
|
|
1449
|
-
|
|
1685
|
+
var An = ":not(:disabled):not([aria-disabled=\"true\"])", jn = `[role="menuitem"]${An}, [role="menuitemradio"]${An}`;
|
|
1686
|
+
function Mn(e) {
|
|
1687
|
+
return Array.from(e.querySelectorAll(jn));
|
|
1688
|
+
}
|
|
1689
|
+
function Nn(e, t) {
|
|
1690
|
+
let n = Mn(e);
|
|
1450
1691
|
n.length !== 0 && n[(t % n.length + n.length) % n.length]?.focus({ preventScroll: !0 });
|
|
1451
1692
|
}
|
|
1452
|
-
function
|
|
1453
|
-
|
|
1693
|
+
function Pn(e, t, n, r) {
|
|
1694
|
+
if (e.key === "ArrowDown") Nn(t, r + 1);
|
|
1695
|
+
else if (e.key === "ArrowUp") Nn(t, r - 1);
|
|
1696
|
+
else if (e.key === "Home") Nn(t, 0);
|
|
1697
|
+
else if (e.key === "End") Nn(t, n.length - 1);
|
|
1698
|
+
else return !1;
|
|
1699
|
+
return e.preventDefault(), !0;
|
|
1700
|
+
}
|
|
1701
|
+
function Fn(e) {
|
|
1702
|
+
return e.key.length === 1 && e.key !== " " && !e.ctrlKey && !e.metaKey && !e.altKey;
|
|
1703
|
+
}
|
|
1704
|
+
function In(e, t, n, r) {
|
|
1705
|
+
let i = kn(t.map((e) => e.textContent?.trim() ?? ""), n, r);
|
|
1706
|
+
i !== -1 && Nn(e, i);
|
|
1707
|
+
}
|
|
1708
|
+
function Ln({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r, radius: i, onClose: a, children: o, id: s, labelledBy: l, "aria-label": u, initialFocus: d = "first" }) {
|
|
1709
|
+
let p = f(null);
|
|
1454
1710
|
return c(() => {
|
|
1455
1711
|
if (!r) return;
|
|
1456
|
-
let e =
|
|
1457
|
-
|
|
1458
|
-
|
|
1712
|
+
let e = p.current;
|
|
1713
|
+
if (!e) return;
|
|
1714
|
+
let t = Mn(e);
|
|
1715
|
+
(d === "last" ? t[t.length - 1] : t[0])?.focus({ preventScroll: !0 });
|
|
1716
|
+
}, [r, d]), y(/* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
|
|
1459
1717
|
className: "fixed inset-0 z-40",
|
|
1460
1718
|
onClick: a,
|
|
1461
1719
|
"aria-hidden": "true"
|
|
@@ -1464,19 +1722,22 @@ function hn({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r,
|
|
|
1464
1722
|
style: t,
|
|
1465
1723
|
className: "z-50",
|
|
1466
1724
|
children: /* @__PURE__ */ g("div", {
|
|
1467
|
-
ref:
|
|
1725
|
+
ref: p,
|
|
1726
|
+
id: s,
|
|
1468
1727
|
role: "menu",
|
|
1728
|
+
"aria-label": u,
|
|
1729
|
+
"aria-labelledby": l,
|
|
1469
1730
|
tabIndex: -1,
|
|
1470
1731
|
"data-state": n ? "open" : "closed",
|
|
1471
1732
|
onKeyDown: (e) => {
|
|
1472
|
-
let t =
|
|
1733
|
+
let t = p.current;
|
|
1473
1734
|
if (!t) return;
|
|
1474
|
-
let n =
|
|
1475
|
-
|
|
1735
|
+
let n = Mn(t), r = n.indexOf(document.activeElement);
|
|
1736
|
+
Pn(e, t, n, r) || (e.key === "Escape" ? (e.preventDefault(), a()) : e.key === "Tab" ? a() : Fn(e) && In(t, n, r, e.key));
|
|
1476
1737
|
},
|
|
1477
|
-
className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", n ? "scale-100 opacity-100" : "scale-95 opacity-0",
|
|
1738
|
+
className: x("w-max min-w-40 max-w-xs origin-top border py-1 shadow-lg backdrop-blur-sm", "transition-[opacity,transform] duration-150 ease-out", n ? "scale-100 opacity-100" : "scale-95 opacity-0", V, ie, S[i]),
|
|
1478
1739
|
onClick: (e) => e.stopPropagation(),
|
|
1479
|
-
children: /* @__PURE__ */ g(
|
|
1740
|
+
children: /* @__PURE__ */ g(En.Provider, {
|
|
1480
1741
|
value: a,
|
|
1481
1742
|
children: o
|
|
1482
1743
|
})
|
|
@@ -1485,7 +1746,7 @@ function hn({ setFloating: e, floatingStyles: t, isVisible: n, isPositioned: r,
|
|
|
1485
1746
|
}
|
|
1486
1747
|
//#endregion
|
|
1487
1748
|
//#region src/components/shared/use_overlay_state.ts
|
|
1488
|
-
function
|
|
1749
|
+
function Rn() {
|
|
1489
1750
|
let [e, t] = p(!1), [n, r] = p(!1), i = f(void 0);
|
|
1490
1751
|
return c(() => () => clearTimeout(i.current), []), {
|
|
1491
1752
|
isMounted: e,
|
|
@@ -1499,7 +1760,7 @@ function gn() {
|
|
|
1499
1760
|
}, [])
|
|
1500
1761
|
};
|
|
1501
1762
|
}
|
|
1502
|
-
function
|
|
1763
|
+
function zn(e, t, n) {
|
|
1503
1764
|
c(() => {
|
|
1504
1765
|
if (!e || !t) return;
|
|
1505
1766
|
let r = requestAnimationFrame(() => n(!0));
|
|
@@ -1512,8 +1773,8 @@ function _n(e, t, n) {
|
|
|
1512
1773
|
}
|
|
1513
1774
|
//#endregion
|
|
1514
1775
|
//#region src/components/context_menu/context_menu.tsx
|
|
1515
|
-
var
|
|
1516
|
-
function
|
|
1776
|
+
var Bn = 2;
|
|
1777
|
+
function Vn(e, t) {
|
|
1517
1778
|
return { getBoundingClientRect: () => ({
|
|
1518
1779
|
width: 0,
|
|
1519
1780
|
height: 0,
|
|
@@ -1525,7 +1786,7 @@ function yn(e, t) {
|
|
|
1525
1786
|
bottom: t
|
|
1526
1787
|
}) };
|
|
1527
1788
|
}
|
|
1528
|
-
function
|
|
1789
|
+
function Hn(e) {
|
|
1529
1790
|
if (e.clientX !== 0 || e.clientY !== 0) return {
|
|
1530
1791
|
x: e.clientX,
|
|
1531
1792
|
y: e.clientY
|
|
@@ -1539,43 +1800,44 @@ function bn(e) {
|
|
|
1539
1800
|
y: 0
|
|
1540
1801
|
};
|
|
1541
1802
|
}
|
|
1542
|
-
function
|
|
1543
|
-
let
|
|
1803
|
+
function Un({ children: e, items: t, radius: n = "md", className: r, ref: i, "aria-label": a }) {
|
|
1804
|
+
let s = f(null), { isMounted: c, isVisible: l, setIsVisible: u, open: d, close: p } = Rn(), { refs: m, floatingStyles: h, isPositioned: v } = bn({
|
|
1544
1805
|
placement: "bottom-start",
|
|
1545
|
-
open:
|
|
1546
|
-
whileElementsMounted:
|
|
1806
|
+
open: c,
|
|
1807
|
+
whileElementsMounted: ln,
|
|
1547
1808
|
middleware: [
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1809
|
+
Sn(Bn),
|
|
1810
|
+
wn(),
|
|
1811
|
+
Cn({ padding: 8 })
|
|
1551
1812
|
]
|
|
1552
1813
|
});
|
|
1553
|
-
|
|
1554
|
-
let
|
|
1555
|
-
|
|
1556
|
-
}, [
|
|
1814
|
+
zn(c, v, u);
|
|
1815
|
+
let y = o(() => {
|
|
1816
|
+
p(), s.current?.focus();
|
|
1817
|
+
}, [p]);
|
|
1557
1818
|
return /* @__PURE__ */ _("div", {
|
|
1558
1819
|
ref: i,
|
|
1559
1820
|
className: r,
|
|
1560
1821
|
onContextMenu: (e) => {
|
|
1561
|
-
e.preventDefault(),
|
|
1562
|
-
let { x: t, y: n } =
|
|
1563
|
-
|
|
1822
|
+
e.preventDefault(), s.current = document.activeElement;
|
|
1823
|
+
let { x: t, y: n } = Hn(e);
|
|
1824
|
+
m.setReference(Vn(t, n)), d(!1);
|
|
1564
1825
|
},
|
|
1565
|
-
children: [e,
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1826
|
+
children: [e, c && /* @__PURE__ */ g(Ln, {
|
|
1827
|
+
"aria-label": a,
|
|
1828
|
+
setFloating: m.setFloating,
|
|
1829
|
+
floatingStyles: h,
|
|
1830
|
+
isVisible: l,
|
|
1831
|
+
isPositioned: v,
|
|
1570
1832
|
radius: n,
|
|
1571
|
-
onClose:
|
|
1833
|
+
onClose: y,
|
|
1572
1834
|
children: t
|
|
1573
1835
|
})]
|
|
1574
1836
|
});
|
|
1575
1837
|
}
|
|
1576
1838
|
//#endregion
|
|
1577
1839
|
//#region src/lib/surface_error.ts
|
|
1578
|
-
function
|
|
1840
|
+
function Wn(e, t) {
|
|
1579
1841
|
if (t) {
|
|
1580
1842
|
t(e);
|
|
1581
1843
|
return;
|
|
@@ -1586,23 +1848,23 @@ function Sn(e, t) {
|
|
|
1586
1848
|
}
|
|
1587
1849
|
//#endregion
|
|
1588
1850
|
//#region src/components/copy_button/copy_button.tsx
|
|
1589
|
-
var
|
|
1590
|
-
function
|
|
1851
|
+
var Gn = 2e3;
|
|
1852
|
+
function Kn({ value: e, children: t, onError: n }) {
|
|
1591
1853
|
let [r, i] = p(!1), a = f(void 0);
|
|
1592
1854
|
return c(() => () => clearTimeout(a.current), []), /* @__PURE__ */ g(h, { children: t({
|
|
1593
1855
|
copied: r,
|
|
1594
1856
|
copy: async () => {
|
|
1595
1857
|
try {
|
|
1596
|
-
await navigator.clipboard.writeText(e), i(!0), clearTimeout(a.current), a.current = setTimeout(() => i(!1),
|
|
1858
|
+
await navigator.clipboard.writeText(e), i(!0), clearTimeout(a.current), a.current = setTimeout(() => i(!1), Gn);
|
|
1597
1859
|
} catch (e) {
|
|
1598
|
-
|
|
1860
|
+
Wn(e, n);
|
|
1599
1861
|
}
|
|
1600
1862
|
}
|
|
1601
1863
|
}) });
|
|
1602
1864
|
}
|
|
1603
1865
|
//#endregion
|
|
1604
1866
|
//#region src/lib/split_into_highlight_segments.ts
|
|
1605
|
-
function
|
|
1867
|
+
function qn(e, t) {
|
|
1606
1868
|
if (t.length === 0) return [{
|
|
1607
1869
|
text: e,
|
|
1608
1870
|
isMatch: !1
|
|
@@ -1625,56 +1887,63 @@ function Tn(e, t) {
|
|
|
1625
1887
|
}
|
|
1626
1888
|
//#endregion
|
|
1627
1889
|
//#region src/components/highlight/highlight.tsx
|
|
1628
|
-
function
|
|
1629
|
-
let
|
|
1630
|
-
return
|
|
1631
|
-
let
|
|
1632
|
-
return
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
}
|
|
1636
|
-
})
|
|
1890
|
+
function Jn(e) {
|
|
1891
|
+
let t = 0;
|
|
1892
|
+
return e.map((e) => {
|
|
1893
|
+
let n = t;
|
|
1894
|
+
return t += e.text.length, {
|
|
1895
|
+
...e,
|
|
1896
|
+
start: n
|
|
1897
|
+
};
|
|
1898
|
+
});
|
|
1899
|
+
}
|
|
1900
|
+
function Yn({ text: e, ranges: t }) {
|
|
1901
|
+
let n = Jn(qn(e, t));
|
|
1902
|
+
return /* @__PURE__ */ g(h, { children: n.map((e) => e.isMatch ? /* @__PURE__ */ g("mark", {
|
|
1903
|
+
className: "rounded bg-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:text-yellow-100",
|
|
1904
|
+
children: e.text
|
|
1905
|
+
}, e.start) : /* @__PURE__ */ g("span", { children: e.text }, e.start)) });
|
|
1637
1906
|
}
|
|
1638
1907
|
//#endregion
|
|
1639
1908
|
//#region src/components/icon_button/icon_button.tsx
|
|
1640
|
-
var
|
|
1909
|
+
var Xn = {
|
|
1641
1910
|
xs: "p-1",
|
|
1642
1911
|
sm: "p-2",
|
|
1643
1912
|
md: "p-2",
|
|
1644
1913
|
lg: "p-3"
|
|
1645
|
-
},
|
|
1914
|
+
}, Zn = {
|
|
1646
1915
|
xs: "w-4 h-4",
|
|
1647
1916
|
sm: "w-4 h-4",
|
|
1648
1917
|
md: "w-5 h-5",
|
|
1649
1918
|
lg: "w-6 h-6"
|
|
1650
1919
|
};
|
|
1651
|
-
function
|
|
1652
|
-
let { icon: t, "aria-label": n, unstyled: r = !1, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d } = e, f =
|
|
1920
|
+
function Qn(e) {
|
|
1921
|
+
let { icon: t, "aria-label": n, unstyled: r = !1, variant: i = "outline", color: a = "neutral", size: o = "md", radius: s = "md", className: c, children: l, ref: u, ...d } = e, f = A[a];
|
|
1653
1922
|
return /* @__PURE__ */ _("button", {
|
|
1654
1923
|
ref: u,
|
|
1655
1924
|
type: "button",
|
|
1656
1925
|
"aria-label": n,
|
|
1657
|
-
className: x(
|
|
1658
|
-
|
|
1926
|
+
className: x(j, !r && [
|
|
1927
|
+
M,
|
|
1659
1928
|
"border",
|
|
1660
1929
|
S[s],
|
|
1661
|
-
|
|
1930
|
+
Xn[o],
|
|
1662
1931
|
f[i],
|
|
1663
1932
|
f.focusOutline
|
|
1664
1933
|
], c),
|
|
1665
1934
|
...d,
|
|
1666
|
-
children: [/* @__PURE__ */ g("div", { className: x(t,
|
|
1935
|
+
children: [/* @__PURE__ */ g("div", { className: x(t, Zn[o], l && "mr-1") }), l]
|
|
1667
1936
|
});
|
|
1668
1937
|
}
|
|
1669
1938
|
//#endregion
|
|
1670
1939
|
//#region src/components/shared/use_controlled_length.ts
|
|
1671
|
-
function
|
|
1940
|
+
function $n(e) {
|
|
1672
1941
|
return typeof e == "string" ? e.length : 0;
|
|
1673
1942
|
}
|
|
1674
|
-
function
|
|
1675
|
-
let [n, r] = p(
|
|
1943
|
+
function er(e, t) {
|
|
1944
|
+
let [n, r] = p($n(t)), i = e !== void 0;
|
|
1676
1945
|
return {
|
|
1677
|
-
length: i ?
|
|
1946
|
+
length: i ? $n(e) : n,
|
|
1678
1947
|
trackLength: (e) => {
|
|
1679
1948
|
i || r(e.length);
|
|
1680
1949
|
}
|
|
@@ -1682,33 +1951,34 @@ function jn(e, t) {
|
|
|
1682
1951
|
}
|
|
1683
1952
|
//#endregion
|
|
1684
1953
|
//#region src/components/input/input.tsx
|
|
1685
|
-
function
|
|
1686
|
-
let { fieldId:
|
|
1687
|
-
|
|
1954
|
+
function tr({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, "aria-describedby": p, ...m }) {
|
|
1955
|
+
let { fieldId: h, errorId: v, characterCountId: y } = K(f), { length: b, trackLength: C } = er(l, u), w = n && (r !== void 0 || i !== void 0), T = (e) => {
|
|
1956
|
+
C(e.target.value), d?.(e);
|
|
1688
1957
|
};
|
|
1689
|
-
return /* @__PURE__ */ _(
|
|
1690
|
-
fieldId:
|
|
1691
|
-
errorId:
|
|
1958
|
+
return /* @__PURE__ */ _(Oe, {
|
|
1959
|
+
fieldId: h,
|
|
1960
|
+
errorId: v,
|
|
1692
1961
|
label: e,
|
|
1693
1962
|
error: t,
|
|
1694
|
-
required:
|
|
1963
|
+
required: m.required,
|
|
1695
1964
|
wrapperClassName: c,
|
|
1696
1965
|
children: [/* @__PURE__ */ g("input", {
|
|
1697
|
-
id:
|
|
1966
|
+
id: h,
|
|
1698
1967
|
className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !o && [
|
|
1699
|
-
|
|
1968
|
+
le,
|
|
1700
1969
|
S[a],
|
|
1701
1970
|
"px-3 py-2 text-sm"
|
|
1702
1971
|
], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
|
|
1703
1972
|
...l === void 0 ? { defaultValue: u } : { value: l },
|
|
1704
1973
|
minLength: r,
|
|
1705
1974
|
maxLength: i,
|
|
1706
|
-
onChange:
|
|
1975
|
+
onChange: T,
|
|
1707
1976
|
"aria-invalid": !!t,
|
|
1708
|
-
"aria-describedby": t
|
|
1709
|
-
...
|
|
1710
|
-
}),
|
|
1711
|
-
|
|
1977
|
+
"aria-describedby": G(p, t && v, w && y),
|
|
1978
|
+
...m
|
|
1979
|
+
}), w && /* @__PURE__ */ g(ce, {
|
|
1980
|
+
id: y,
|
|
1981
|
+
current: b,
|
|
1712
1982
|
min: r,
|
|
1713
1983
|
max: i,
|
|
1714
1984
|
showMin: r !== void 0,
|
|
@@ -1718,15 +1988,15 @@ function Mn({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength
|
|
|
1718
1988
|
}
|
|
1719
1989
|
//#endregion
|
|
1720
1990
|
//#region src/components/kbd/kbd.tsx
|
|
1721
|
-
var
|
|
1991
|
+
var nr = {
|
|
1722
1992
|
xs: "px-1.5 py-0.5 text-xs",
|
|
1723
1993
|
sm: "px-2 py-0.5 text-xs",
|
|
1724
1994
|
md: "px-2.5 py-1 text-sm",
|
|
1725
1995
|
lg: "px-3 py-1 text-base"
|
|
1726
|
-
},
|
|
1727
|
-
className: x("inline-flex items-center",
|
|
1996
|
+
}, rr = ({ children: e, size: t = "sm", radius: n = "sm", unstyled: r = !1, className: i }) => /* @__PURE__ */ g("kbd", {
|
|
1997
|
+
className: x("inline-flex items-center", nr[t], !r && [
|
|
1728
1998
|
"border font-semibold uppercase",
|
|
1729
|
-
"text-gray-
|
|
1999
|
+
"text-gray-600 dark:text-gray-300",
|
|
1730
2000
|
"bg-gray-100 dark:bg-gray-700",
|
|
1731
2001
|
"border-gray-200 dark:border-gray-600",
|
|
1732
2002
|
S[n]
|
|
@@ -1735,55 +2005,63 @@ var Nn = {
|
|
|
1735
2005
|
});
|
|
1736
2006
|
//#endregion
|
|
1737
2007
|
//#region src/lib/merge_refs.ts
|
|
1738
|
-
function
|
|
2008
|
+
function ir(...e) {
|
|
1739
2009
|
return (t) => {
|
|
1740
2010
|
for (let n of e) typeof n == "function" ? n(t) : n && (n.current = t);
|
|
1741
2011
|
};
|
|
1742
2012
|
}
|
|
1743
2013
|
//#endregion
|
|
1744
2014
|
//#region src/components/menu/menu.tsx
|
|
1745
|
-
var
|
|
1746
|
-
function
|
|
2015
|
+
var ar = 4;
|
|
2016
|
+
function or(e, t) {
|
|
1747
2017
|
return t === "center" ? e : `${e}-${t}`;
|
|
1748
2018
|
}
|
|
1749
|
-
function
|
|
1750
|
-
let
|
|
1751
|
-
placement:
|
|
1752
|
-
open:
|
|
1753
|
-
whileElementsMounted:
|
|
2019
|
+
function sr({ trigger: e, children: t, side: r = "bottom", align: i = "start", radius: s = "md", className: c, ref: u }) {
|
|
2020
|
+
let d = f(null), [m, h] = p("first"), { isMounted: v, isVisible: y, setIsVisible: b, open: S, close: C } = Rn(), { refs: w, floatingStyles: T, isPositioned: E } = bn({
|
|
2021
|
+
placement: or(r, i),
|
|
2022
|
+
open: v,
|
|
2023
|
+
whileElementsMounted: ln,
|
|
1754
2024
|
middleware: [
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
2025
|
+
Sn(ar),
|
|
2026
|
+
wn(),
|
|
2027
|
+
Cn({ padding: 8 })
|
|
1758
2028
|
]
|
|
1759
2029
|
});
|
|
1760
|
-
|
|
1761
|
-
let
|
|
1762
|
-
|
|
1763
|
-
}, [
|
|
2030
|
+
zn(v, E, b);
|
|
2031
|
+
let D = l(), O = (a(e) ? e.props.id : void 0) ?? D, k = `${O}-menu`, A = o(() => {
|
|
2032
|
+
C(), d.current?.querySelector("button, [href], [tabindex]")?.focus();
|
|
2033
|
+
}, [C]), j = o((e) => ir(w.setReference, d, u)(e), [w, u]), M = {
|
|
2034
|
+
id: O,
|
|
1764
2035
|
onClick: (t) => {
|
|
1765
|
-
t.stopPropagation(),
|
|
2036
|
+
t.stopPropagation(), y ? C() : (h("first"), S(E)), a(e) && e.props.onClick?.(t);
|
|
2037
|
+
},
|
|
2038
|
+
onKeyDown: (t) => {
|
|
2039
|
+
!y && t.key === "ArrowDown" ? (t.preventDefault(), h("first"), S(E)) : !y && t.key === "ArrowUp" && (t.preventDefault(), h("last"), S(E)), a(e) && e.props.onKeyDown?.(t);
|
|
1766
2040
|
},
|
|
1767
2041
|
"aria-haspopup": "menu",
|
|
1768
|
-
"aria-expanded":
|
|
1769
|
-
|
|
2042
|
+
"aria-expanded": v,
|
|
2043
|
+
"aria-controls": v ? k : void 0
|
|
2044
|
+
}, N = a(e) ? n(e, M) : e;
|
|
1770
2045
|
return /* @__PURE__ */ _("span", {
|
|
1771
|
-
ref:
|
|
2046
|
+
ref: j,
|
|
1772
2047
|
className: x("inline-block", c),
|
|
1773
|
-
children: [
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
2048
|
+
children: [N, v && /* @__PURE__ */ g(Ln, {
|
|
2049
|
+
id: k,
|
|
2050
|
+
labelledBy: O,
|
|
2051
|
+
setFloating: w.setFloating,
|
|
2052
|
+
floatingStyles: T,
|
|
2053
|
+
isVisible: y,
|
|
2054
|
+
isPositioned: E,
|
|
1778
2055
|
radius: s,
|
|
1779
|
-
onClose:
|
|
2056
|
+
onClose: A,
|
|
2057
|
+
initialFocus: m,
|
|
1780
2058
|
children: t
|
|
1781
2059
|
})]
|
|
1782
2060
|
});
|
|
1783
2061
|
}
|
|
1784
2062
|
//#endregion
|
|
1785
2063
|
//#region src/components/menu_group/menu_group.tsx
|
|
1786
|
-
function
|
|
2064
|
+
function cr({ label: e, children: t, unstyled: n = !1, className: r, wrapperClassName: i }) {
|
|
1787
2065
|
let a = l();
|
|
1788
2066
|
return /* @__PURE__ */ _("div", {
|
|
1789
2067
|
role: "group",
|
|
@@ -1799,7 +2077,7 @@ function zn({ label: e, children: t, unstyled: n = !1, className: r, wrapperClas
|
|
|
1799
2077
|
}
|
|
1800
2078
|
//#endregion
|
|
1801
2079
|
//#region src/components/menu_item/menu_item_end.tsx
|
|
1802
|
-
function
|
|
2080
|
+
function lr({ trailing: e, selected: t }) {
|
|
1803
2081
|
let n = t !== void 0;
|
|
1804
2082
|
return !e && !n ? null : /* @__PURE__ */ _("span", {
|
|
1805
2083
|
className: "ml-auto flex flex-shrink-0 items-center gap-2 pl-2",
|
|
@@ -1814,41 +2092,45 @@ function Bn({ trailing: e, selected: t }) {
|
|
|
1814
2092
|
}
|
|
1815
2093
|
//#endregion
|
|
1816
2094
|
//#region src/components/menu_item/menu_item_styles.ts
|
|
1817
|
-
var
|
|
1818
|
-
|
|
1819
|
-
|
|
2095
|
+
var ur = [
|
|
2096
|
+
"flex w-full cursor-pointer items-center gap-2 whitespace-nowrap px-4 py-2 text-left text-sm transition-colors",
|
|
2097
|
+
"focus-visible:bg-gray-100 dark:focus-visible:bg-gray-700",
|
|
2098
|
+
k
|
|
2099
|
+
];
|
|
2100
|
+
function dr(e, t, n) {
|
|
2101
|
+
return x(ur, e, t ? "text-red-700 dark:text-red-300" : "text-gray-700 dark:text-gray-300", n);
|
|
1820
2102
|
}
|
|
1821
2103
|
//#endregion
|
|
1822
2104
|
//#region src/components/menu_item/menu_item_content.tsx
|
|
1823
|
-
var
|
|
2105
|
+
var fr = ({ icon: e, children: t }) => /* @__PURE__ */ _(h, { children: [e && /* @__PURE__ */ g("div", {
|
|
1824
2106
|
className: x(e, "h-4 w-4 flex-shrink-0"),
|
|
1825
2107
|
"aria-hidden": "true"
|
|
1826
|
-
}), t] }),
|
|
1827
|
-
function
|
|
1828
|
-
let u =
|
|
2108
|
+
}), t] }), pr = "_blank", mr = "noopener noreferrer", hr = ["no-underline hover:bg-gray-100 dark:hover:bg-gray-700", "aria-disabled:pointer-events-none aria-disabled:cursor-not-allowed aria-disabled:opacity-50"];
|
|
2109
|
+
function gr({ icon: e, trailing: t, href: n, target: r, rel: i, danger: a = !1, disabled: o = !1, children: s, className: c, ref: l }) {
|
|
2110
|
+
let u = Dn();
|
|
1829
2111
|
return /* @__PURE__ */ _("a", {
|
|
1830
2112
|
ref: l,
|
|
1831
2113
|
role: "menuitem",
|
|
1832
2114
|
tabIndex: -1,
|
|
1833
2115
|
href: o ? void 0 : n,
|
|
1834
2116
|
target: r,
|
|
1835
|
-
rel: i ?? (r ===
|
|
2117
|
+
rel: i ?? (r === pr ? mr : void 0),
|
|
1836
2118
|
"aria-disabled": o || void 0,
|
|
1837
2119
|
onClick: (e) => {
|
|
1838
2120
|
e.stopPropagation(), u?.();
|
|
1839
2121
|
},
|
|
1840
|
-
className:
|
|
1841
|
-
children: [/* @__PURE__ */ g(
|
|
2122
|
+
className: dr(hr, a, c),
|
|
2123
|
+
children: [/* @__PURE__ */ g(fr, {
|
|
1842
2124
|
icon: e,
|
|
1843
2125
|
children: s
|
|
1844
|
-
}), /* @__PURE__ */ g(
|
|
2126
|
+
}), /* @__PURE__ */ g(lr, { trailing: t })]
|
|
1845
2127
|
});
|
|
1846
2128
|
}
|
|
1847
2129
|
//#endregion
|
|
1848
2130
|
//#region src/components/menu_item/menu_item_button.tsx
|
|
1849
|
-
var
|
|
1850
|
-
function
|
|
1851
|
-
let l =
|
|
2131
|
+
var _r = ["hover:enabled:bg-gray-100 dark:hover:enabled:bg-gray-700", "disabled:cursor-not-allowed disabled:opacity-50"];
|
|
2132
|
+
function vr({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, disabled: a = !1, children: o, className: s, ref: c }) {
|
|
2133
|
+
let l = Dn();
|
|
1852
2134
|
return /* @__PURE__ */ _("button", {
|
|
1853
2135
|
ref: c,
|
|
1854
2136
|
type: "button",
|
|
@@ -1859,11 +2141,11 @@ function Yn({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, dis
|
|
|
1859
2141
|
e.stopPropagation(), n(e), l?.();
|
|
1860
2142
|
},
|
|
1861
2143
|
disabled: a,
|
|
1862
|
-
className:
|
|
1863
|
-
children: [/* @__PURE__ */ g(
|
|
2144
|
+
className: dr(_r, i, s),
|
|
2145
|
+
children: [/* @__PURE__ */ g(fr, {
|
|
1864
2146
|
icon: e,
|
|
1865
2147
|
children: o
|
|
1866
|
-
}), /* @__PURE__ */ g(
|
|
2148
|
+
}), /* @__PURE__ */ g(lr, {
|
|
1867
2149
|
trailing: t,
|
|
1868
2150
|
selected: r
|
|
1869
2151
|
})]
|
|
@@ -1871,17 +2153,17 @@ function Yn({ icon: e, trailing: t, onClick: n, selected: r, danger: i = !1, dis
|
|
|
1871
2153
|
}
|
|
1872
2154
|
//#endregion
|
|
1873
2155
|
//#region src/components/menu_item/menu_item.tsx
|
|
1874
|
-
function
|
|
1875
|
-
return e.href === void 0 ? /* @__PURE__ */ g(
|
|
2156
|
+
function yr(e) {
|
|
2157
|
+
return e.href === void 0 ? /* @__PURE__ */ g(vr, { ...e }) : /* @__PURE__ */ g(gr, { ...e });
|
|
1876
2158
|
}
|
|
1877
2159
|
//#endregion
|
|
1878
2160
|
//#region src/components/menu_separator/menu_separator.tsx
|
|
1879
|
-
var
|
|
2161
|
+
var br = ({ unstyled: e = !1, className: t }) => /* @__PURE__ */ g("hr", {
|
|
1880
2162
|
role: "separator",
|
|
1881
2163
|
"aria-orientation": "horizontal",
|
|
1882
2164
|
className: x("w-full", !e && ["my-1 border-0 border-t", "border-gray-200 dark:border-gray-700"], t)
|
|
1883
|
-
}),
|
|
1884
|
-
function
|
|
2165
|
+
}), xr = [];
|
|
2166
|
+
function Sr() {
|
|
1885
2167
|
let e = 0, t = [], n = null, r = /* @__PURE__ */ new Set(), i = () => {
|
|
1886
2168
|
for (let e of r) e(t);
|
|
1887
2169
|
};
|
|
@@ -1902,7 +2184,7 @@ function $n() {
|
|
|
1902
2184
|
r.delete(i), r.size || (e = 0, t = [], n = null);
|
|
1903
2185
|
}),
|
|
1904
2186
|
getSnapshot: () => t,
|
|
1905
|
-
getServerSnapshot: () =>
|
|
2187
|
+
getServerSnapshot: () => xr,
|
|
1906
2188
|
getListenersSize: () => r.size,
|
|
1907
2189
|
getUpsertPromise: () => n,
|
|
1908
2190
|
setUpsertPromise: (e) => {
|
|
@@ -1910,9 +2192,9 @@ function $n() {
|
|
|
1910
2192
|
}
|
|
1911
2193
|
};
|
|
1912
2194
|
}
|
|
1913
|
-
var
|
|
1914
|
-
function
|
|
1915
|
-
let n = { current:
|
|
2195
|
+
var Cr = /* @__PURE__ */ new Map();
|
|
2196
|
+
function wr(e, t = 0) {
|
|
2197
|
+
let n = { current: Sr() }, r = (e) => (r) => {
|
|
1916
2198
|
let i = /* @__PURE__ */ new Set();
|
|
1917
2199
|
n.current.set(e, (e) => (e.resolve(r), i.add(e.promise), {
|
|
1918
2200
|
...e,
|
|
@@ -1998,81 +2280,159 @@ function tr(e, t = 0) {
|
|
|
1998
2280
|
set: (r) => {
|
|
1999
2281
|
if (t || (e = r, !r)) return;
|
|
2000
2282
|
t = !0;
|
|
2001
|
-
let i =
|
|
2002
|
-
i ? n.current = i :
|
|
2283
|
+
let i = Cr.get(r);
|
|
2284
|
+
i ? n.current = i : Cr.set(r, n.current);
|
|
2003
2285
|
}
|
|
2004
2286
|
});
|
|
2005
2287
|
}
|
|
2006
2288
|
return d;
|
|
2007
2289
|
}
|
|
2008
2290
|
//#endregion
|
|
2291
|
+
//#region src/components/shared/tabbable.ts
|
|
2292
|
+
var Tr = [
|
|
2293
|
+
"a[href]",
|
|
2294
|
+
"button",
|
|
2295
|
+
"input",
|
|
2296
|
+
"select",
|
|
2297
|
+
"textarea",
|
|
2298
|
+
"summary",
|
|
2299
|
+
"audio[controls]",
|
|
2300
|
+
"video[controls]",
|
|
2301
|
+
"[contenteditable]:not([contenteditable=\"false\"])",
|
|
2302
|
+
"[tabindex]"
|
|
2303
|
+
].join(", ");
|
|
2304
|
+
function Er(e) {
|
|
2305
|
+
return e.matches(":disabled");
|
|
2306
|
+
}
|
|
2307
|
+
function Dr(e) {
|
|
2308
|
+
return e.getAttribute("tabindex") === "-1";
|
|
2309
|
+
}
|
|
2310
|
+
function Or(e) {
|
|
2311
|
+
return e.matches("input[type=\"hidden\"]");
|
|
2312
|
+
}
|
|
2313
|
+
function kr(e) {
|
|
2314
|
+
return e.closest("[inert]") !== null;
|
|
2315
|
+
}
|
|
2316
|
+
function Ar(e) {
|
|
2317
|
+
return typeof e.checkVisibility != "function" || e.checkVisibility();
|
|
2318
|
+
}
|
|
2319
|
+
function jr(e) {
|
|
2320
|
+
return !Er(e) && !Dr(e) && !Or(e) && !kr(e) && Ar(e);
|
|
2321
|
+
}
|
|
2322
|
+
function Mr(e) {
|
|
2323
|
+
return e instanceof HTMLInputElement && e.type === "radio" && e.name !== "";
|
|
2324
|
+
}
|
|
2325
|
+
function Nr(e) {
|
|
2326
|
+
let t = /* @__PURE__ */ new Map();
|
|
2327
|
+
for (let n of e) {
|
|
2328
|
+
let e = t.get(n.form) ?? /* @__PURE__ */ new Map();
|
|
2329
|
+
t.set(n.form, e);
|
|
2330
|
+
let r = e.get(n.name) ?? [];
|
|
2331
|
+
r.push(n), e.set(n.name, r);
|
|
2332
|
+
}
|
|
2333
|
+
return Array.from(t.values()).flatMap((e) => Array.from(e.values()));
|
|
2334
|
+
}
|
|
2335
|
+
function Pr(e) {
|
|
2336
|
+
return e.find((e) => e.checked) ?? e[0];
|
|
2337
|
+
}
|
|
2338
|
+
function Fr(e) {
|
|
2339
|
+
let t = Array.from(e.querySelectorAll(Tr)).filter(jr), n = t.filter(Mr), r = new Set(Nr(n).map(Pr));
|
|
2340
|
+
return t.filter((e) => !Mr(e) || r.has(e));
|
|
2341
|
+
}
|
|
2342
|
+
//#endregion
|
|
2343
|
+
//#region src/components/modal/modal_stack.ts
|
|
2344
|
+
var Ir = [];
|
|
2345
|
+
function Lr(e) {
|
|
2346
|
+
return Ir.push(e), () => {
|
|
2347
|
+
let t = Ir.indexOf(e);
|
|
2348
|
+
t !== -1 && Ir.splice(t, 1);
|
|
2349
|
+
};
|
|
2350
|
+
}
|
|
2351
|
+
function Rr(e) {
|
|
2352
|
+
return Ir[Ir.length - 1] === e;
|
|
2353
|
+
}
|
|
2354
|
+
//#endregion
|
|
2009
2355
|
//#region src/components/modal/modal_shell.tsx
|
|
2010
|
-
var
|
|
2356
|
+
var zr = {
|
|
2011
2357
|
sm: "max-w-md",
|
|
2012
2358
|
md: "max-w-lg",
|
|
2013
2359
|
lg: "max-w-2xl",
|
|
2014
2360
|
xl: "max-w-4xl"
|
|
2015
2361
|
};
|
|
2016
|
-
function
|
|
2017
|
-
let [
|
|
2362
|
+
function Br({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size: a = "md", radius: o = "xl", className: s, dismissible: u = !0, closeLabel: d = "Close", role: m = "dialog", initialFocusRef: h, "aria-label": v }) {
|
|
2363
|
+
let [b, C] = p(!1), [w] = p(() => Symbol("modal")), T = f(null), E = f(null), D = f(null), O = l(), k = l();
|
|
2018
2364
|
c(() => {
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
let t =
|
|
2023
|
-
|
|
2365
|
+
if (!e) return Lr(w);
|
|
2366
|
+
}, [e, w]), c(() => {
|
|
2367
|
+
document.body.style.overflow = "hidden", D.current = document.activeElement;
|
|
2368
|
+
let e = T.current, t = (E.current && Fr(E.current)[0]) ?? (e && Fr(e)[0]);
|
|
2369
|
+
(h?.current ?? t ?? e)?.focus();
|
|
2370
|
+
let n = requestAnimationFrame(() => {
|
|
2371
|
+
requestAnimationFrame(() => C(!0));
|
|
2024
2372
|
});
|
|
2025
2373
|
return () => {
|
|
2026
|
-
cancelAnimationFrame(
|
|
2374
|
+
cancelAnimationFrame(n), document.body.style.overflow = "";
|
|
2027
2375
|
};
|
|
2028
2376
|
}, []), c(() => {
|
|
2029
|
-
e &&
|
|
2377
|
+
e && D.current?.focus();
|
|
2030
2378
|
}, [e]), c(() => {
|
|
2031
2379
|
if (e) return;
|
|
2032
2380
|
let n = (e) => {
|
|
2381
|
+
if (!Rr(w)) return;
|
|
2033
2382
|
if (e.key === "Escape") {
|
|
2034
|
-
|
|
2383
|
+
if (e.defaultPrevented) return;
|
|
2384
|
+
e.preventDefault(), u && t();
|
|
2035
2385
|
return;
|
|
2036
2386
|
}
|
|
2037
2387
|
if (e.key !== "Tab") return;
|
|
2038
|
-
let n =
|
|
2388
|
+
let n = T.current;
|
|
2039
2389
|
if (!n) return;
|
|
2040
|
-
let r =
|
|
2041
|
-
if (r.length === 0)
|
|
2042
|
-
|
|
2043
|
-
|
|
2390
|
+
let r = Fr(n);
|
|
2391
|
+
if (r.length === 0) {
|
|
2392
|
+
e.preventDefault(), n.focus();
|
|
2393
|
+
return;
|
|
2394
|
+
}
|
|
2395
|
+
let i = r[0], a = r[r.length - 1], o = document.activeElement;
|
|
2396
|
+
if ((o instanceof HTMLElement ? r.indexOf(o) : -1) === -1) {
|
|
2397
|
+
e.preventDefault(), (e.shiftKey ? a : i).focus();
|
|
2398
|
+
return;
|
|
2399
|
+
}
|
|
2400
|
+
e.shiftKey && o === i ? (e.preventDefault(), a.focus()) : !e.shiftKey && o === a && (e.preventDefault(), i.focus());
|
|
2044
2401
|
};
|
|
2045
2402
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
2046
2403
|
}, [
|
|
2047
2404
|
e,
|
|
2048
2405
|
t,
|
|
2049
|
-
u
|
|
2406
|
+
u,
|
|
2407
|
+
w
|
|
2050
2408
|
]);
|
|
2051
|
-
let
|
|
2409
|
+
let A = () => {
|
|
2052
2410
|
!e && u && t();
|
|
2053
|
-
},
|
|
2411
|
+
}, j = m === "alertdialog" && !!r, M = b && !e;
|
|
2054
2412
|
return y(/* @__PURE__ */ _("div", {
|
|
2055
|
-
className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out",
|
|
2056
|
-
onClick:
|
|
2413
|
+
className: x("fixed inset-0 z-50 flex items-start justify-center", "p-2 sm:py-[3rem] lg:py-[5rem]", "transition-opacity duration-200 ease-out", M ? "opacity-100" : "opacity-0"),
|
|
2414
|
+
onClick: A,
|
|
2057
2415
|
children: [/* @__PURE__ */ g("div", {
|
|
2058
|
-
className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out",
|
|
2416
|
+
className: x("fixed inset-0 bg-black/60 backdrop-blur-md", "transition-opacity duration-200 ease-out", M ? "opacity-100" : "opacity-0"),
|
|
2059
2417
|
"aria-hidden": "true"
|
|
2060
2418
|
}), /* @__PURE__ */ _("div", {
|
|
2061
|
-
ref:
|
|
2062
|
-
role:
|
|
2419
|
+
ref: T,
|
|
2420
|
+
role: m,
|
|
2063
2421
|
"aria-modal": "true",
|
|
2064
|
-
"aria-labelledby": n ?
|
|
2422
|
+
"aria-labelledby": n ? O : void 0,
|
|
2423
|
+
"aria-label": n ? void 0 : v,
|
|
2424
|
+
"aria-describedby": j ? k : void 0,
|
|
2065
2425
|
tabIndex: -1,
|
|
2066
|
-
className: x("relative w-full",
|
|
2426
|
+
className: x("relative w-full", zr[a], V, "shadow-2xl", S[o], "max-h-[calc(100vh-4rem)] sm:max-h-[calc(100vh-10rem)] overflow-hidden flex flex-col", "transition-all duration-200 ease-out", "focus:outline-none", M ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 translate-y-1"),
|
|
2067
2427
|
onClick: (e) => e.stopPropagation(),
|
|
2068
2428
|
children: [
|
|
2069
2429
|
n && /* @__PURE__ */ _("div", {
|
|
2070
2430
|
className: "flex items-center justify-between gap-4 px-6 pt-5 pb-4 flex-shrink-0",
|
|
2071
2431
|
children: [/* @__PURE__ */ g("h2", {
|
|
2072
|
-
id:
|
|
2432
|
+
id: O,
|
|
2073
2433
|
className: "text-base font-medium tracking-tight text-gray-900 dark:text-gray-100",
|
|
2074
2434
|
children: n
|
|
2075
|
-
}), u && /* @__PURE__ */ g(
|
|
2435
|
+
}), u && /* @__PURE__ */ g(Qn, {
|
|
2076
2436
|
icon: "i-mdi-close",
|
|
2077
2437
|
onClick: t,
|
|
2078
2438
|
"aria-label": d,
|
|
@@ -2083,7 +2443,8 @@ function ir({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size:
|
|
|
2083
2443
|
})]
|
|
2084
2444
|
}),
|
|
2085
2445
|
/* @__PURE__ */ g("div", {
|
|
2086
|
-
ref:
|
|
2446
|
+
ref: E,
|
|
2447
|
+
id: j ? k : void 0,
|
|
2087
2448
|
className: x("flex-1 overflow-y-auto px-6 pb-6 text-sm leading-relaxed text-gray-600 dark:text-gray-400 min-h-0", !n && "pt-6", s),
|
|
2088
2449
|
children: r
|
|
2089
2450
|
}),
|
|
@@ -2096,8 +2457,8 @@ function ir({ isEnded: e, onDismiss: t, title: n, children: r, footer: i, size:
|
|
|
2096
2457
|
}), document.body);
|
|
2097
2458
|
}
|
|
2098
2459
|
//#endregion
|
|
2099
|
-
//#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.
|
|
2100
|
-
var
|
|
2460
|
+
//#region node_modules/.pnpm/zustand@5.0.15_@types+react@19.3.0_react@19.3.0_use-sync-external-store@1.6.0_react@19.3.0_/node_modules/zustand/esm/vanilla.mjs
|
|
2461
|
+
var Vr = (e) => {
|
|
2101
2462
|
let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
|
|
2102
2463
|
let i = typeof e == "function" ? e(t) : e;
|
|
2103
2464
|
if (!Object.is(i, t)) {
|
|
@@ -2111,47 +2472,47 @@ var ar = (e) => {
|
|
|
2111
2472
|
subscribe: (e) => (n.add(e), () => n.delete(e))
|
|
2112
2473
|
}, o = t = e(r, i, a);
|
|
2113
2474
|
return a;
|
|
2114
|
-
},
|
|
2115
|
-
function
|
|
2475
|
+
}, Hr = ((e) => e ? Vr(e) : Vr), Ur = (e) => e;
|
|
2476
|
+
function Wr(e, n = Ur) {
|
|
2116
2477
|
let r = t.useSyncExternalStore(e.subscribe, t.useCallback(() => n(e.getState()), [e, n]), t.useCallback(() => n(e.getInitialState()), [e, n]));
|
|
2117
2478
|
return t.useDebugValue(r), r;
|
|
2118
2479
|
}
|
|
2119
|
-
var
|
|
2120
|
-
let t =
|
|
2480
|
+
var Gr = (e) => {
|
|
2481
|
+
let t = Hr(e), n = (e) => Wr(t, e);
|
|
2121
2482
|
return Object.assign(n, t), n;
|
|
2122
|
-
},
|
|
2483
|
+
}, Kr = ((e) => e ? Gr(e) : Gr), qr = Kr((e) => ({
|
|
2123
2484
|
globalHotkeysEnabled: !0,
|
|
2124
2485
|
setGlobalHotkeysEnabled: (t) => e({ globalHotkeysEnabled: t })
|
|
2125
|
-
})),
|
|
2126
|
-
function
|
|
2127
|
-
c(() => (
|
|
2128
|
-
--
|
|
2486
|
+
})), Jr = 0;
|
|
2487
|
+
function Yr() {
|
|
2488
|
+
c(() => (Jr += 1, Jr === 1 && qr.getState().setGlobalHotkeysEnabled(!1), () => {
|
|
2489
|
+
--Jr, Jr === 0 && qr.getState().setGlobalHotkeysEnabled(!0);
|
|
2129
2490
|
}), []);
|
|
2130
2491
|
}
|
|
2131
2492
|
//#endregion
|
|
2132
2493
|
//#region src/components/modal/confirm_modal.tsx
|
|
2133
|
-
var
|
|
2494
|
+
var Xr = {
|
|
2134
2495
|
danger: "i-mdi-alert-circle",
|
|
2135
2496
|
primary: "i-mdi-help-circle",
|
|
2136
2497
|
success: "i-mdi-check-circle"
|
|
2137
|
-
},
|
|
2498
|
+
}, Zr = {
|
|
2138
2499
|
danger: "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400",
|
|
2139
2500
|
primary: "bg-blue-50 text-blue-600 dark:bg-blue-500/10 dark:text-blue-400",
|
|
2140
2501
|
success: "bg-green-50 text-green-600 dark:bg-green-500/10 dark:text-green-400"
|
|
2141
2502
|
};
|
|
2142
|
-
function
|
|
2503
|
+
function Qr({ title: e, color: t }) {
|
|
2143
2504
|
return /* @__PURE__ */ _("div", {
|
|
2144
2505
|
className: "flex items-center gap-3",
|
|
2145
2506
|
children: [/* @__PURE__ */ g("span", {
|
|
2146
|
-
className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full",
|
|
2507
|
+
className: x("flex h-9 w-9 shrink-0 items-center justify-center rounded-full", Zr[t]),
|
|
2147
2508
|
"aria-hidden": "true",
|
|
2148
|
-
children: /* @__PURE__ */ g("span", { className: x(
|
|
2509
|
+
children: /* @__PURE__ */ g("span", { className: x(Xr[t], "h-5 w-5") })
|
|
2149
2510
|
}), e]
|
|
2150
2511
|
});
|
|
2151
2512
|
}
|
|
2152
|
-
var
|
|
2153
|
-
|
|
2154
|
-
let [u, d] = p(!1), f = () => e.end(!1),
|
|
2513
|
+
var $r = wr(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i, confirmColor: a, radius: o, closeLabel: s, onConfirm: c, onError: l }) => {
|
|
2514
|
+
Yr();
|
|
2515
|
+
let [u, d] = p(!1), m = f(null), v = () => e.end(!1), y = async () => {
|
|
2155
2516
|
if (!c) {
|
|
2156
2517
|
e.end(!0);
|
|
2157
2518
|
return;
|
|
@@ -2160,138 +2521,367 @@ var _r = tr(({ call: e, title: t, children: n, confirmLabel: r, cancelLabel: i,
|
|
|
2160
2521
|
try {
|
|
2161
2522
|
await c(), e.end(!0);
|
|
2162
2523
|
} catch (e) {
|
|
2163
|
-
d(!1),
|
|
2524
|
+
d(!1), Wn(e, l);
|
|
2164
2525
|
}
|
|
2165
|
-
},
|
|
2166
|
-
return /* @__PURE__ */ g(
|
|
2526
|
+
}, b = u, x = r ?? "Confirm", S = i ?? "Cancel", C = a ?? "primary";
|
|
2527
|
+
return /* @__PURE__ */ g(Br, {
|
|
2167
2528
|
isEnded: e.ended,
|
|
2168
|
-
onDismiss:
|
|
2169
|
-
title: /* @__PURE__ */ g(
|
|
2529
|
+
onDismiss: v,
|
|
2530
|
+
title: /* @__PURE__ */ g(Qr, {
|
|
2170
2531
|
title: t,
|
|
2171
|
-
color:
|
|
2532
|
+
color: C
|
|
2172
2533
|
}),
|
|
2173
2534
|
size: "sm",
|
|
2174
2535
|
radius: o,
|
|
2175
2536
|
closeLabel: s,
|
|
2537
|
+
role: "alertdialog",
|
|
2538
|
+
initialFocusRef: m,
|
|
2176
2539
|
footer: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(R, {
|
|
2540
|
+
ref: m,
|
|
2177
2541
|
variant: "outline",
|
|
2178
2542
|
color: "neutral",
|
|
2179
|
-
onClick:
|
|
2180
|
-
disabled:
|
|
2543
|
+
onClick: v,
|
|
2544
|
+
disabled: b,
|
|
2181
2545
|
size: "sm",
|
|
2182
|
-
children:
|
|
2546
|
+
children: S
|
|
2183
2547
|
}), /* @__PURE__ */ g(R, {
|
|
2184
|
-
color:
|
|
2548
|
+
color: C,
|
|
2185
2549
|
onClick: () => {
|
|
2186
|
-
|
|
2550
|
+
y();
|
|
2187
2551
|
},
|
|
2188
|
-
loading:
|
|
2189
|
-
disabled:
|
|
2552
|
+
loading: b,
|
|
2553
|
+
disabled: b,
|
|
2190
2554
|
size: "sm",
|
|
2191
|
-
children:
|
|
2555
|
+
children: x
|
|
2192
2556
|
})] }),
|
|
2193
2557
|
children: n
|
|
2194
2558
|
});
|
|
2195
2559
|
}, 200);
|
|
2196
2560
|
//#endregion
|
|
2197
2561
|
//#region src/components/modal/modal.tsx
|
|
2198
|
-
function
|
|
2562
|
+
function ei(e, t) {
|
|
2199
2563
|
return typeof e == "function" ? e(t) : e;
|
|
2200
2564
|
}
|
|
2201
|
-
var
|
|
2202
|
-
|
|
2203
|
-
let [
|
|
2204
|
-
return /* @__PURE__ */ g(
|
|
2565
|
+
var ti = r(null), ni = wr(({ call: e, title: t, children: n, size: r, radius: i, className: a, dismissible: o, closeLabel: s, "aria-label": c }) => {
|
|
2566
|
+
Yr();
|
|
2567
|
+
let [l, u] = p(null), d = () => e.end();
|
|
2568
|
+
return /* @__PURE__ */ g(Br, {
|
|
2205
2569
|
isEnded: e.ended,
|
|
2206
|
-
onDismiss:
|
|
2570
|
+
onDismiss: d,
|
|
2207
2571
|
title: t,
|
|
2208
|
-
footer:
|
|
2572
|
+
footer: l,
|
|
2209
2573
|
size: r,
|
|
2210
2574
|
radius: i,
|
|
2211
2575
|
className: a,
|
|
2212
2576
|
dismissible: o,
|
|
2213
2577
|
closeLabel: s,
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2578
|
+
"aria-label": c,
|
|
2579
|
+
children: /* @__PURE__ */ g(ti.Provider, {
|
|
2580
|
+
value: u,
|
|
2581
|
+
children: ei(n, d)
|
|
2217
2582
|
})
|
|
2218
2583
|
});
|
|
2219
2584
|
}, 200);
|
|
2220
2585
|
//#endregion
|
|
2221
2586
|
//#region src/components/modal/modal_footer.tsx
|
|
2222
|
-
function
|
|
2223
|
-
let t = s(
|
|
2587
|
+
function ri({ children: e }) {
|
|
2588
|
+
let t = s(ti);
|
|
2224
2589
|
return c(() => (t?.(e), () => t?.(null)), [t, e]), null;
|
|
2225
2590
|
}
|
|
2226
2591
|
//#endregion
|
|
2227
2592
|
//#region src/components/modal_provider/modal_provider.tsx
|
|
2228
|
-
function
|
|
2229
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(
|
|
2593
|
+
function ii() {
|
|
2594
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ni, {}), /* @__PURE__ */ g($r, {})] });
|
|
2595
|
+
}
|
|
2596
|
+
//#endregion
|
|
2597
|
+
//#region src/components/multi_combobox/multi_combobox.tsx
|
|
2598
|
+
var ai = 2;
|
|
2599
|
+
function oi(e, t, n, r) {
|
|
2600
|
+
return r?.(e, t) ? !0 : n === void 0 || t.includes(e) ? !1 : t.length >= n;
|
|
2601
|
+
}
|
|
2602
|
+
function si(e, t) {
|
|
2603
|
+
return e.includes(t) ? e.filter((e) => e !== t) : [...e, t];
|
|
2604
|
+
}
|
|
2605
|
+
function ci(e, t) {
|
|
2606
|
+
if (e.length <= t) return {
|
|
2607
|
+
visibleOptions: e,
|
|
2608
|
+
hiddenCount: 0
|
|
2609
|
+
};
|
|
2610
|
+
let n = Math.max(t - 1, 0);
|
|
2611
|
+
return {
|
|
2612
|
+
visibleOptions: e.slice(0, n),
|
|
2613
|
+
hiddenCount: e.length - n
|
|
2614
|
+
};
|
|
2615
|
+
}
|
|
2616
|
+
var li = "inline-flex items-center rounded-full bg-gray-200 dark:bg-gray-700 px-2 py-0.5 text-xs text-gray-900 dark:text-gray-100";
|
|
2617
|
+
function ui({ options: e, label: t, "aria-label": n, error: r, placeholder: i, searchPlaceholder: a = "Search", noResultsText: s = "No results found", clearLabel: l = "Clear selection", clearText: u = "Clear", maxSelectedValues: m, isOptionDisabled: v, maxDisplayedValues: y = ai, formatOverflowCount: b = (e) => `+${e} more`, formatSelectedCount: w = (e) => `${e} selected`, formatMaxSelectedHint: T = (e) => `You can select up to ${e} items`, radius: E = "sm", unstyled: D = !1, disabled: O = !1, required: k = !1, className: j, wrapperClassName: M, values: N, defaultValues: P = [], onChange: F, onDropdownClose: I, id: ee }) {
|
|
2618
|
+
let { fieldId: L, errorId: te, labelId: ne } = K(ee), R = `${L}-listbox`, re = `${L}-max-hint`, z = f(null), B = f(null), ie = f(null), [V, H] = ye(N, P), [ae, oe] = p(""), [U, se] = p(!1), W = d(() => {
|
|
2619
|
+
let t = ae.trim().toLowerCase();
|
|
2620
|
+
return t ? e.filter((e) => e.label.toLowerCase().includes(t)) : e;
|
|
2621
|
+
}, [e, ae]), { activeIndex: ce, activeOptionId: G, move: ue, first: de, last: fe, reset: pe } = je({
|
|
2622
|
+
optionCount: W.length,
|
|
2623
|
+
getOptionId: (e) => `${R}-option-${e}`,
|
|
2624
|
+
isOpen: U
|
|
2625
|
+
}), me = d(() => e.filter((e) => V.includes(e.value)), [e, V]), { visibleOptions: he, hiddenCount: ge } = ci(me, y), _e = () => {
|
|
2626
|
+
O || se(!0);
|
|
2627
|
+
}, ve = o(() => {
|
|
2628
|
+
se(!1), oe(""), pe(), I?.(V);
|
|
2629
|
+
}, [
|
|
2630
|
+
pe,
|
|
2631
|
+
I,
|
|
2632
|
+
V
|
|
2633
|
+
]), be = () => {
|
|
2634
|
+
U ? ve() : _e();
|
|
2635
|
+
}, xe = (e) => {
|
|
2636
|
+
if (oi(e, V, m, v)) return;
|
|
2637
|
+
let t = si(V, e);
|
|
2638
|
+
H(t), F?.(t);
|
|
2639
|
+
}, Se = () => {
|
|
2640
|
+
H([]), F?.([]);
|
|
2641
|
+
}, Ce = (e) => {
|
|
2642
|
+
e.stopPropagation(), Se(), U || I?.([]), z.current?.focus();
|
|
2643
|
+
}, we = () => {
|
|
2644
|
+
Se(), ie.current?.focus();
|
|
2645
|
+
}, Te = () => {
|
|
2646
|
+
O || be();
|
|
2647
|
+
}, Ee = (e) => {
|
|
2648
|
+
oe(e.target.value), pe();
|
|
2649
|
+
}, De = (e) => {
|
|
2650
|
+
if (e.preventDefault(), !U) {
|
|
2651
|
+
_e(), de();
|
|
2652
|
+
return;
|
|
2653
|
+
}
|
|
2654
|
+
ue(1);
|
|
2655
|
+
}, ke = (e) => {
|
|
2656
|
+
if (e.preventDefault(), !U) {
|
|
2657
|
+
_e(), fe();
|
|
2658
|
+
return;
|
|
2659
|
+
}
|
|
2660
|
+
ue(-1);
|
|
2661
|
+
}, Ae = (e) => {
|
|
2662
|
+
if (!U) return;
|
|
2663
|
+
e.preventDefault();
|
|
2664
|
+
let t = W[ce];
|
|
2665
|
+
t && xe(t.value);
|
|
2666
|
+
}, Me = (e) => {
|
|
2667
|
+
U && (e.preventDefault(), ve(), z.current?.focus());
|
|
2668
|
+
}, q = (e) => {
|
|
2669
|
+
if (e.key === "ArrowDown") return De(e);
|
|
2670
|
+
if (e.key === "ArrowUp") return ke(e);
|
|
2671
|
+
if (e.key === "Enter") return Ae(e);
|
|
2672
|
+
if (e.key === "Escape") return Me(e);
|
|
2673
|
+
};
|
|
2674
|
+
return c(() => {
|
|
2675
|
+
if (!U) return;
|
|
2676
|
+
let e = (e) => {
|
|
2677
|
+
B.current && !B.current.contains(e.target) && ve();
|
|
2678
|
+
};
|
|
2679
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
2680
|
+
}, [U, ve]), /* @__PURE__ */ g(Oe, {
|
|
2681
|
+
fieldId: L,
|
|
2682
|
+
errorId: te,
|
|
2683
|
+
label: t,
|
|
2684
|
+
error: r,
|
|
2685
|
+
required: k,
|
|
2686
|
+
wrapperClassName: M,
|
|
2687
|
+
children: /* @__PURE__ */ _("div", {
|
|
2688
|
+
ref: B,
|
|
2689
|
+
className: "relative",
|
|
2690
|
+
onBlur: (e) => {
|
|
2691
|
+
if (!U) return;
|
|
2692
|
+
let t = e.relatedTarget;
|
|
2693
|
+
t instanceof Node && B.current?.contains(t) || ve();
|
|
2694
|
+
},
|
|
2695
|
+
children: [
|
|
2696
|
+
/* @__PURE__ */ g("button", {
|
|
2697
|
+
ref: z,
|
|
2698
|
+
type: "button",
|
|
2699
|
+
id: L,
|
|
2700
|
+
role: "combobox",
|
|
2701
|
+
disabled: O,
|
|
2702
|
+
"aria-expanded": U,
|
|
2703
|
+
"aria-controls": R,
|
|
2704
|
+
"aria-haspopup": "listbox",
|
|
2705
|
+
"aria-invalid": !!r,
|
|
2706
|
+
"aria-required": k || void 0,
|
|
2707
|
+
"aria-describedby": r ? te : void 0,
|
|
2708
|
+
"aria-labelledby": typeof t == "string" ? ne : void 0,
|
|
2709
|
+
"aria-label": n,
|
|
2710
|
+
onClick: Te,
|
|
2711
|
+
onKeyDown: q,
|
|
2712
|
+
className: x("w-full flex flex-wrap items-center gap-1 text-left disabled:opacity-50 disabled:cursor-not-allowed", !D && [
|
|
2713
|
+
le,
|
|
2714
|
+
S[E],
|
|
2715
|
+
"pl-3 pr-8 py-2 text-sm min-h-10"
|
|
2716
|
+
], !D && r && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), j),
|
|
2717
|
+
children: me.length === 0 ? /* @__PURE__ */ g("span", {
|
|
2718
|
+
className: x(!D && "text-gray-500 dark:text-gray-400"),
|
|
2719
|
+
children: i
|
|
2720
|
+
}) : /* @__PURE__ */ _(h, { children: [he.map((e) => /* @__PURE__ */ g("span", {
|
|
2721
|
+
className: x(!D && li),
|
|
2722
|
+
children: e.label
|
|
2723
|
+
}, e.value)), ge > 0 && /* @__PURE__ */ g("span", {
|
|
2724
|
+
className: x(!D && li),
|
|
2725
|
+
children: b(ge)
|
|
2726
|
+
})] })
|
|
2727
|
+
}),
|
|
2728
|
+
!D && V.length > 0 && !O && /* @__PURE__ */ g("button", {
|
|
2729
|
+
type: "button",
|
|
2730
|
+
"aria-label": l,
|
|
2731
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
2732
|
+
onClick: Ce,
|
|
2733
|
+
className: x("absolute right-2.5 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300", "outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2", A.primary.focusOutline),
|
|
2734
|
+
children: /* @__PURE__ */ g("span", {
|
|
2735
|
+
className: "i-mdi-close block w-4 h-4",
|
|
2736
|
+
"aria-hidden": !0
|
|
2737
|
+
})
|
|
2738
|
+
}),
|
|
2739
|
+
U && /* @__PURE__ */ _("div", {
|
|
2740
|
+
onMouseDown: (e) => {
|
|
2741
|
+
e.target !== ie.current && e.preventDefault();
|
|
2742
|
+
},
|
|
2743
|
+
className: x("absolute z-10 mt-1 w-full text-sm shadow-lg", !D && [
|
|
2744
|
+
"border overflow-hidden",
|
|
2745
|
+
"bg-white dark:bg-gray-900",
|
|
2746
|
+
"border-gray-100 dark:border-gray-800",
|
|
2747
|
+
C[E]
|
|
2748
|
+
]),
|
|
2749
|
+
children: [
|
|
2750
|
+
/* @__PURE__ */ g("input", {
|
|
2751
|
+
ref: ie,
|
|
2752
|
+
type: "text",
|
|
2753
|
+
autoFocus: !0,
|
|
2754
|
+
autoComplete: "off",
|
|
2755
|
+
value: ae,
|
|
2756
|
+
onChange: Ee,
|
|
2757
|
+
onKeyDown: q,
|
|
2758
|
+
placeholder: a,
|
|
2759
|
+
"aria-label": a,
|
|
2760
|
+
"aria-controls": R,
|
|
2761
|
+
"aria-activedescendant": G,
|
|
2762
|
+
"aria-describedby": m === void 0 ? void 0 : re,
|
|
2763
|
+
className: x("w-full", !D && [
|
|
2764
|
+
"px-3 py-2 border-b bg-transparent focus:outline-none",
|
|
2765
|
+
"text-gray-900 dark:text-gray-100 placeholder-gray-500 dark:placeholder-gray-400",
|
|
2766
|
+
"border-gray-100 dark:border-gray-800"
|
|
2767
|
+
])
|
|
2768
|
+
}),
|
|
2769
|
+
m !== void 0 && /* @__PURE__ */ g("div", {
|
|
2770
|
+
id: re,
|
|
2771
|
+
className: x("px-3 py-1 text-xs", !D && ["border-b", "border-gray-100 dark:border-gray-800"], !D && "text-gray-500 dark:text-gray-400"),
|
|
2772
|
+
children: T(m)
|
|
2773
|
+
}),
|
|
2774
|
+
/* @__PURE__ */ g("ul", {
|
|
2775
|
+
id: R,
|
|
2776
|
+
role: "listbox",
|
|
2777
|
+
"aria-multiselectable": !0,
|
|
2778
|
+
className: "max-h-60 overflow-auto py-1",
|
|
2779
|
+
children: W.map((e, t) => {
|
|
2780
|
+
let n = V.includes(e.value), r = oi(e.value, V, m, v);
|
|
2781
|
+
return /* @__PURE__ */ _("li", {
|
|
2782
|
+
id: `${R}-option-${t}`,
|
|
2783
|
+
role: "option",
|
|
2784
|
+
"aria-selected": n,
|
|
2785
|
+
"aria-disabled": r,
|
|
2786
|
+
onClick: () => xe(e.value),
|
|
2787
|
+
className: x("px-3 py-2 flex items-center gap-2 text-gray-900 dark:text-gray-100", r ? "opacity-50 cursor-not-allowed" : "cursor-pointer", t === ce ? x("bg-blue-50 dark:bg-blue-900/40", "outline-2 -outline-offset-2 outline-blue-500 dark:outline-blue-400") : !r && "hover:bg-gray-50 dark:hover:bg-gray-800/60"),
|
|
2788
|
+
children: [/* @__PURE__ */ g("span", {
|
|
2789
|
+
"aria-hidden": !0,
|
|
2790
|
+
className: x("flex h-4 w-4 shrink-0 items-center justify-center", !D && [
|
|
2791
|
+
"border-2",
|
|
2792
|
+
S[E],
|
|
2793
|
+
n ? x("border-blue-600 dark:border-blue-500", "bg-blue-600 dark:bg-blue-500") : x("border-gray-300 dark:border-gray-600", "bg-white dark:bg-gray-800")
|
|
2794
|
+
]),
|
|
2795
|
+
children: n && /* @__PURE__ */ g("svg", {
|
|
2796
|
+
className: "h-3 w-3 text-white",
|
|
2797
|
+
viewBox: "0 0 12 12",
|
|
2798
|
+
fill: "none",
|
|
2799
|
+
stroke: "currentColor",
|
|
2800
|
+
strokeWidth: "2.5",
|
|
2801
|
+
strokeLinecap: "round",
|
|
2802
|
+
strokeLinejoin: "round",
|
|
2803
|
+
children: /* @__PURE__ */ g("polyline", { points: "2 6 5 9 10 3" })
|
|
2804
|
+
})
|
|
2805
|
+
}), e.label]
|
|
2806
|
+
}, e.value);
|
|
2807
|
+
})
|
|
2808
|
+
}),
|
|
2809
|
+
/* @__PURE__ */ g("div", {
|
|
2810
|
+
role: "status",
|
|
2811
|
+
className: W.length === 0 ? "px-3 py-2 text-gray-500 dark:text-gray-400" : void 0,
|
|
2812
|
+
children: W.length === 0 ? s : ""
|
|
2813
|
+
}),
|
|
2814
|
+
m !== void 0 && /* @__PURE__ */ _("div", {
|
|
2815
|
+
className: x("flex items-center justify-between px-3 py-2", !D && ["border-t", "border-gray-100 dark:border-gray-800"]),
|
|
2816
|
+
children: [/* @__PURE__ */ g("span", {
|
|
2817
|
+
className: "text-xs text-gray-500 dark:text-gray-400",
|
|
2818
|
+
children: w(V.length)
|
|
2819
|
+
}), /* @__PURE__ */ g("button", {
|
|
2820
|
+
type: "button",
|
|
2821
|
+
disabled: V.length === 0,
|
|
2822
|
+
onClick: we,
|
|
2823
|
+
className: "text-xs font-medium text-blue-600 hover:text-blue-700 disabled:opacity-50 disabled:cursor-not-allowed dark:text-blue-400 dark:hover:text-blue-300",
|
|
2824
|
+
children: u
|
|
2825
|
+
})]
|
|
2826
|
+
})
|
|
2827
|
+
]
|
|
2828
|
+
})
|
|
2829
|
+
]
|
|
2830
|
+
})
|
|
2831
|
+
});
|
|
2230
2832
|
}
|
|
2231
2833
|
//#endregion
|
|
2232
2834
|
//#region src/components/radio_options/radio_option_row.tsx
|
|
2233
|
-
function
|
|
2234
|
-
|
|
2835
|
+
function di({ option: e, optionId: t, descriptionId: n, name: r, orientation: i, isSelected: a, isDisabled: o, isFirstOption: s, required: c, error: l, radius: u, unstyled: d, className: f, onSelect: p }) {
|
|
2836
|
+
let m = !!l;
|
|
2837
|
+
return /* @__PURE__ */ g(Se, {
|
|
2838
|
+
item: e,
|
|
2235
2839
|
htmlFor: t,
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
className: x(e.icon, "h-4 w-4 shrink-0", a ? l ? "text-red-600 dark:text-red-400" : "text-blue-600 dark:text-blue-400" : "text-gray-500 dark:text-gray-400"),
|
|
2266
|
-
"aria-hidden": !0
|
|
2267
|
-
}), /* @__PURE__ */ g("span", {
|
|
2268
|
-
className: x("select-none text-sm font-medium", a ? l ? "text-red-700 dark:text-red-300" : "text-blue-700 dark:text-blue-300" : "text-gray-700 dark:text-gray-300"),
|
|
2269
|
-
children: e.label
|
|
2270
|
-
})]
|
|
2271
|
-
}), e.description && /* @__PURE__ */ g("span", {
|
|
2272
|
-
id: n,
|
|
2273
|
-
className: x("text-xs text-gray-500 dark:text-gray-400", "mt-0.5"),
|
|
2274
|
-
children: e.description
|
|
2275
|
-
})]
|
|
2276
|
-
})
|
|
2277
|
-
]
|
|
2840
|
+
descriptionId: n,
|
|
2841
|
+
orientation: i,
|
|
2842
|
+
isSelected: a,
|
|
2843
|
+
isDisabled: o,
|
|
2844
|
+
isError: m,
|
|
2845
|
+
radius: u,
|
|
2846
|
+
unstyled: d,
|
|
2847
|
+
className: f,
|
|
2848
|
+
control: /* @__PURE__ */ g("input", {
|
|
2849
|
+
type: "radio",
|
|
2850
|
+
id: t,
|
|
2851
|
+
name: r,
|
|
2852
|
+
value: e.value,
|
|
2853
|
+
checked: a,
|
|
2854
|
+
onChange: () => p(e.value),
|
|
2855
|
+
disabled: o,
|
|
2856
|
+
required: c && s,
|
|
2857
|
+
"aria-invalid": l ? !0 : void 0,
|
|
2858
|
+
"aria-describedby": e.description ? n : void 0,
|
|
2859
|
+
className: "sr-only"
|
|
2860
|
+
}),
|
|
2861
|
+
indicator: /* @__PURE__ */ g("span", {
|
|
2862
|
+
className: x("mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded-full border-2 transition-colors duration-150", ve({
|
|
2863
|
+
isSelected: a,
|
|
2864
|
+
isError: m
|
|
2865
|
+
})),
|
|
2866
|
+
"aria-hidden": !0,
|
|
2867
|
+
children: a && /* @__PURE__ */ g("span", { className: x("h-2 w-2 rounded-full", l ? "bg-red-500 dark:bg-red-400" : "bg-blue-600 dark:bg-blue-500") })
|
|
2868
|
+
})
|
|
2278
2869
|
});
|
|
2279
2870
|
}
|
|
2280
2871
|
//#endregion
|
|
2281
2872
|
//#region src/components/radio_options/radio_options.tsx
|
|
2282
|
-
function
|
|
2283
|
-
let { fieldId:
|
|
2873
|
+
function fi({ options: e, orientation: t = "vertical", value: n, defaultValue: r, onChange: i, name: a, label: o, error: s, required: c, disabled: l, radius: u = "lg", unstyled: d = !1, className: f, wrapperClassName: p, id: m, "aria-describedby": h, ...v }) {
|
|
2874
|
+
let { fieldId: y, errorId: b } = K(m), S = a ?? y, [C, w] = ye(n, r ?? ""), T = e.map((e) => typeof e == "string" ? {
|
|
2284
2875
|
value: e,
|
|
2285
2876
|
label: e
|
|
2286
|
-
} : e),
|
|
2287
|
-
|
|
2877
|
+
} : e), E = (e) => {
|
|
2878
|
+
w(e), i?.(e);
|
|
2288
2879
|
};
|
|
2289
2880
|
return /* @__PURE__ */ _("fieldset", {
|
|
2290
2881
|
className: x("m-0 border-0 p-0", p),
|
|
2291
2882
|
disabled: l,
|
|
2292
|
-
"aria-describedby": s
|
|
2293
|
-
|
|
2294
|
-
...h,
|
|
2883
|
+
"aria-describedby": G(h, s && b),
|
|
2884
|
+
...v,
|
|
2295
2885
|
children: [
|
|
2296
2886
|
o && /* @__PURE__ */ _("legend", {
|
|
2297
2887
|
className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "mb-2"),
|
|
@@ -2302,13 +2892,13 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
|
|
|
2302
2892
|
}),
|
|
2303
2893
|
/* @__PURE__ */ g("div", {
|
|
2304
2894
|
className: x(t === "horizontal" ? "flex flex-row gap-2" : "flex flex-col gap-2"),
|
|
2305
|
-
children:
|
|
2895
|
+
children: T.map((e, n) => /* @__PURE__ */ g(di, {
|
|
2306
2896
|
option: e,
|
|
2307
|
-
optionId: `${
|
|
2308
|
-
descriptionId: `${
|
|
2309
|
-
name:
|
|
2897
|
+
optionId: `${y}-${n}`,
|
|
2898
|
+
descriptionId: `${y}-${n}-desc`,
|
|
2899
|
+
name: S,
|
|
2310
2900
|
orientation: t,
|
|
2311
|
-
isSelected:
|
|
2901
|
+
isSelected: C === e.value,
|
|
2312
2902
|
isDisabled: l === !0 || e.disabled === !0,
|
|
2313
2903
|
isFirstOption: n === 0,
|
|
2314
2904
|
required: c,
|
|
@@ -2316,11 +2906,11 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
|
|
|
2316
2906
|
radius: u,
|
|
2317
2907
|
unstyled: d,
|
|
2318
2908
|
className: f,
|
|
2319
|
-
onSelect:
|
|
2909
|
+
onSelect: E
|
|
2320
2910
|
}, e.value))
|
|
2321
2911
|
}),
|
|
2322
|
-
/* @__PURE__ */ g(
|
|
2323
|
-
id:
|
|
2912
|
+
/* @__PURE__ */ g(me, {
|
|
2913
|
+
id: b,
|
|
2324
2914
|
error: s,
|
|
2325
2915
|
className: "mt-2"
|
|
2326
2916
|
})
|
|
@@ -2329,19 +2919,19 @@ function wr({ options: e, orientation: t = "vertical", value: n, defaultValue: r
|
|
|
2329
2919
|
}
|
|
2330
2920
|
//#endregion
|
|
2331
2921
|
//#region src/components/select/select.tsx
|
|
2332
|
-
function
|
|
2333
|
-
let { fieldId:
|
|
2334
|
-
return /* @__PURE__ */ g(
|
|
2335
|
-
fieldId:
|
|
2336
|
-
errorId:
|
|
2922
|
+
function pi({ options: e, label: t, error: n, placeholder: r, radius: i = "md", unstyled: a = !1, className: o, wrapperClassName: s, value: c, defaultValue: l, onChange: u, id: d, "aria-describedby": f, ...p }) {
|
|
2923
|
+
let { fieldId: m, errorId: h } = K(d);
|
|
2924
|
+
return /* @__PURE__ */ g(Oe, {
|
|
2925
|
+
fieldId: m,
|
|
2926
|
+
errorId: h,
|
|
2337
2927
|
label: t,
|
|
2338
2928
|
error: n,
|
|
2339
|
-
required:
|
|
2929
|
+
required: p.required,
|
|
2340
2930
|
wrapperClassName: s,
|
|
2341
2931
|
children: /* @__PURE__ */ _("select", {
|
|
2342
|
-
id:
|
|
2932
|
+
id: m,
|
|
2343
2933
|
className: x("w-full disabled:opacity-50 disabled:cursor-not-allowed", !a && [
|
|
2344
|
-
|
|
2934
|
+
le,
|
|
2345
2935
|
S[i],
|
|
2346
2936
|
"pl-3 pr-8 py-2 text-sm appearance-none bg-[length:1rem_1rem] bg-[position:right_0.5rem_center] bg-no-repeat",
|
|
2347
2937
|
"bg-[url(\"data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e\")]"
|
|
@@ -2349,8 +2939,8 @@ function Tr({ options: e, label: t, error: n, placeholder: r, radius: i = "md",
|
|
|
2349
2939
|
...c === void 0 ? { defaultValue: l } : { value: c },
|
|
2350
2940
|
onChange: u,
|
|
2351
2941
|
"aria-invalid": !!n,
|
|
2352
|
-
"aria-describedby": n
|
|
2353
|
-
...
|
|
2942
|
+
"aria-describedby": G(f, n && h),
|
|
2943
|
+
...p,
|
|
2354
2944
|
children: [r !== void 0 && /* @__PURE__ */ g("option", {
|
|
2355
2945
|
value: "",
|
|
2356
2946
|
children: r
|
|
@@ -2363,54 +2953,54 @@ function Tr({ options: e, label: t, error: n, placeholder: r, radius: i = "md",
|
|
|
2363
2953
|
}
|
|
2364
2954
|
//#endregion
|
|
2365
2955
|
//#region src/components/switch/switch.tsx
|
|
2366
|
-
function
|
|
2367
|
-
let { fieldId:
|
|
2956
|
+
function mi({ label: e, description: t, error: n, unstyled: r = !1, fullWidth: i = !1, className: a, wrapperClassName: o, checked: s, defaultChecked: c = !1, onChange: l, id: u, "aria-describedby": d, ...f }) {
|
|
2957
|
+
let { fieldId: p, errorId: m, descriptionId: v } = K(u), [y, b] = ye(s, c), S = G(d, !!t && v, n && m);
|
|
2368
2958
|
return /* @__PURE__ */ _("div", {
|
|
2369
|
-
className: x("w-full",
|
|
2959
|
+
className: x(i ? "w-full" : "w-fit", o),
|
|
2370
2960
|
children: [
|
|
2371
2961
|
/* @__PURE__ */ _("label", {
|
|
2372
|
-
htmlFor:
|
|
2373
|
-
className: x("flex items-center gap-3 cursor-pointer",
|
|
2962
|
+
htmlFor: p,
|
|
2963
|
+
className: x("flex items-center gap-3 cursor-pointer", f.disabled && "cursor-not-allowed opacity-50"),
|
|
2374
2964
|
children: [/* @__PURE__ */ _("span", {
|
|
2375
|
-
className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out",
|
|
2965
|
+
className: x("relative inline-flex w-11 shrink-0", "transition-colors duration-200 ease-in-out", E, D, !r && [
|
|
2376
2966
|
"rounded-full border-2 border-transparent",
|
|
2377
|
-
|
|
2967
|
+
y ? "bg-blue-600 dark:bg-blue-500" : "bg-gray-200 dark:bg-gray-600",
|
|
2378
2968
|
n && "ring-2 ring-red-500 dark:ring-red-400"
|
|
2379
|
-
],
|
|
2969
|
+
], a),
|
|
2380
2970
|
children: [/* @__PURE__ */ g("input", {
|
|
2381
2971
|
type: "checkbox",
|
|
2382
2972
|
role: "switch",
|
|
2383
|
-
id:
|
|
2973
|
+
id: p,
|
|
2384
2974
|
className: "sr-only",
|
|
2385
|
-
checked:
|
|
2975
|
+
checked: y,
|
|
2386
2976
|
onChange: (e) => {
|
|
2387
|
-
|
|
2977
|
+
b(e.target.checked), l?.(e);
|
|
2388
2978
|
},
|
|
2389
2979
|
"aria-invalid": !!n,
|
|
2390
|
-
"aria-describedby":
|
|
2391
|
-
...
|
|
2980
|
+
"aria-describedby": S,
|
|
2981
|
+
...f
|
|
2392
2982
|
}), /* @__PURE__ */ g("span", {
|
|
2393
|
-
className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out",
|
|
2983
|
+
className: x("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0", "transition duration-200 ease-in-out", y ? "translate-x-5.25" : "translate-x-0"),
|
|
2394
2984
|
"aria-hidden": !0
|
|
2395
2985
|
})]
|
|
2396
2986
|
}), e && /* @__PURE__ */ g(h, { children: typeof e == "string" ? /* @__PURE__ */ _("span", {
|
|
2397
2987
|
className: x("text-sm font-medium text-gray-700 dark:text-gray-300", "select-none"),
|
|
2398
|
-
children: [e,
|
|
2988
|
+
children: [e, f.required && /* @__PURE__ */ g("span", {
|
|
2399
2989
|
className: "text-red-500 dark:text-red-400 ml-1",
|
|
2400
2990
|
children: "*"
|
|
2401
2991
|
})]
|
|
2402
|
-
}) : /* @__PURE__ */ _(h, { children: [e,
|
|
2992
|
+
}) : /* @__PURE__ */ _(h, { children: [e, f.required && /* @__PURE__ */ g("span", {
|
|
2403
2993
|
className: "text-red-500 dark:text-red-400 ml-1",
|
|
2404
2994
|
children: "*"
|
|
2405
2995
|
})] }) })]
|
|
2406
2996
|
}),
|
|
2407
2997
|
/* @__PURE__ */ g(ge, {
|
|
2408
|
-
id:
|
|
2998
|
+
id: v,
|
|
2409
2999
|
description: t,
|
|
2410
3000
|
className: "mt-1 ml-14"
|
|
2411
3001
|
}),
|
|
2412
|
-
/* @__PURE__ */ g(
|
|
2413
|
-
id:
|
|
3002
|
+
/* @__PURE__ */ g(me, {
|
|
3003
|
+
id: m,
|
|
2414
3004
|
error: n,
|
|
2415
3005
|
className: "mt-1 ml-14"
|
|
2416
3006
|
})
|
|
@@ -2418,90 +3008,255 @@ function Er({ label: e, description: t, error: n, unstyled: r = !1, className: i
|
|
|
2418
3008
|
});
|
|
2419
3009
|
}
|
|
2420
3010
|
//#endregion
|
|
3011
|
+
//#region src/components/tabs/tabs_styles.ts
|
|
3012
|
+
var hi = {
|
|
3013
|
+
line: {
|
|
3014
|
+
list: `gap-1 border-b ${B}`,
|
|
3015
|
+
tab: "-mb-px border-b-2",
|
|
3016
|
+
activeTab: "border-transparent text-gray-900 dark:text-gray-100",
|
|
3017
|
+
idleTab: "border-transparent text-gray-500 dark:text-gray-400",
|
|
3018
|
+
idleHover: "hover:text-gray-900 hover:border-gray-300 dark:hover:text-gray-100 dark:hover:border-gray-600",
|
|
3019
|
+
indicator: "absolute inset-x-0 -bottom-0.5 h-0.5 bg-blue-600 dark:bg-blue-400"
|
|
3020
|
+
},
|
|
3021
|
+
segmented: {
|
|
3022
|
+
list: "gap-1 p-1 bg-gray-100 dark:bg-gray-800/50",
|
|
3023
|
+
tab: "",
|
|
3024
|
+
activeTab: "text-gray-900 dark:text-gray-100",
|
|
3025
|
+
idleTab: "text-gray-600 dark:text-gray-400",
|
|
3026
|
+
idleHover: "hover:text-gray-900 dark:hover:text-gray-100",
|
|
3027
|
+
indicator: `absolute inset-0 ${z} border border-gray-200 dark:border-gray-700`
|
|
3028
|
+
}
|
|
3029
|
+
}, gi = {
|
|
3030
|
+
xs: "px-2 py-1 text-xs",
|
|
3031
|
+
sm: "px-3 py-1.5 text-sm",
|
|
3032
|
+
md: "px-4 py-2.5 text-sm",
|
|
3033
|
+
lg: "px-5 py-3 text-base"
|
|
3034
|
+
}, _i = {
|
|
3035
|
+
xs: "w-3.5 h-3.5",
|
|
3036
|
+
sm: "w-4 h-4",
|
|
3037
|
+
md: "w-4 h-4",
|
|
3038
|
+
lg: "w-5 h-5"
|
|
3039
|
+
}, vi = x(w, A.primary.focusOutline);
|
|
3040
|
+
function yi(e) {
|
|
3041
|
+
let { variant: t, radius: n, unstyled: r, isFullWidth: i, className: a } = e;
|
|
3042
|
+
return x("flex items-center", i && "w-full", !r && hi[t].list, !r && t === "segmented" && S[n], a);
|
|
3043
|
+
}
|
|
3044
|
+
function bi(e) {
|
|
3045
|
+
let { variant: t, size: n, radius: r, unstyled: i, isActive: a, isDisabled: o, isFullWidth: s, className: c } = e, l = hi[t];
|
|
3046
|
+
return x("relative flex items-center gap-2 whitespace-nowrap", s && "flex-1 justify-center", o ? "opacity-50 cursor-not-allowed" : "cursor-pointer", !i && [
|
|
3047
|
+
"font-medium transition-colors duration-200",
|
|
3048
|
+
gi[n],
|
|
3049
|
+
l.tab,
|
|
3050
|
+
a ? l.activeTab : [l.idleTab, !o && l.idleHover],
|
|
3051
|
+
t === "segmented" && S[r],
|
|
3052
|
+
vi
|
|
3053
|
+
], c);
|
|
3054
|
+
}
|
|
3055
|
+
function xi(e) {
|
|
3056
|
+
let { variant: t, radius: n } = e;
|
|
3057
|
+
return x("tabs-indicator pointer-events-none", hi[t].indicator, t === "segmented" && S[n]);
|
|
3058
|
+
}
|
|
3059
|
+
//#endregion
|
|
3060
|
+
//#region src/components/tabs/tab_button.tsx
|
|
3061
|
+
function Si({ item: e, isActive: t, isTabStop: n, isFullWidth: r, variant: i, size: a, radius: o, unstyled: s, tabId: c, panelId: l, onSelect: u, onKeyDown: d, ref: f, indicatorRef: p }) {
|
|
3062
|
+
let m = !!e.disabled;
|
|
3063
|
+
return /* @__PURE__ */ _("button", {
|
|
3064
|
+
ref: f,
|
|
3065
|
+
id: c,
|
|
3066
|
+
role: "tab",
|
|
3067
|
+
type: "button",
|
|
3068
|
+
"aria-selected": t,
|
|
3069
|
+
"aria-disabled": e.disabled,
|
|
3070
|
+
"aria-controls": t ? l : void 0,
|
|
3071
|
+
tabIndex: n ? 0 : -1,
|
|
3072
|
+
disabled: e.disabled,
|
|
3073
|
+
onClick: u,
|
|
3074
|
+
onKeyDown: d,
|
|
3075
|
+
className: bi({
|
|
3076
|
+
variant: i,
|
|
3077
|
+
size: a,
|
|
3078
|
+
radius: o,
|
|
3079
|
+
unstyled: s,
|
|
3080
|
+
isActive: t,
|
|
3081
|
+
isDisabled: m,
|
|
3082
|
+
isFullWidth: r
|
|
3083
|
+
}),
|
|
3084
|
+
children: [
|
|
3085
|
+
t && !s && /* @__PURE__ */ g("span", {
|
|
3086
|
+
ref: p,
|
|
3087
|
+
"aria-hidden": "true",
|
|
3088
|
+
className: xi({
|
|
3089
|
+
variant: i,
|
|
3090
|
+
radius: o
|
|
3091
|
+
})
|
|
3092
|
+
}),
|
|
3093
|
+
e.icon && /* @__PURE__ */ g("span", {
|
|
3094
|
+
"aria-hidden": "true",
|
|
3095
|
+
className: x("relative shrink-0", _i[a], e.icon)
|
|
3096
|
+
}),
|
|
3097
|
+
/* @__PURE__ */ g("span", {
|
|
3098
|
+
className: "relative",
|
|
3099
|
+
children: e.title
|
|
3100
|
+
})
|
|
3101
|
+
]
|
|
3102
|
+
});
|
|
3103
|
+
}
|
|
3104
|
+
//#endregion
|
|
3105
|
+
//#region src/components/tabs/use_tab_indicator_transition.ts
|
|
3106
|
+
var Ci = 200, wi = "ease-out", Ti = "(prefers-reduced-motion: reduce)";
|
|
3107
|
+
function Ei() {
|
|
3108
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(Ti).matches;
|
|
3109
|
+
}
|
|
3110
|
+
function Di(e, t, n) {
|
|
3111
|
+
e.animate([{
|
|
3112
|
+
transform: `translateX(${t.left - n.left}px)`,
|
|
3113
|
+
width: `${t.width}px`
|
|
3114
|
+
}, {
|
|
3115
|
+
transform: "none",
|
|
3116
|
+
width: `${n.width}px`
|
|
3117
|
+
}], {
|
|
3118
|
+
duration: Ci,
|
|
3119
|
+
easing: wi
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
function Oi(e, t, n) {
|
|
3123
|
+
return !e || !t || !n ? !1 : !Ei();
|
|
3124
|
+
}
|
|
3125
|
+
function ki(e) {
|
|
3126
|
+
let { activeIndex: t, indicatorRef: n, isAnimated: r } = e, i = f(null);
|
|
3127
|
+
u(() => {
|
|
3128
|
+
let e = n.current;
|
|
3129
|
+
if (!e) {
|
|
3130
|
+
i.current = null;
|
|
3131
|
+
return;
|
|
3132
|
+
}
|
|
3133
|
+
let t = e.getBoundingClientRect(), a = typeof e.animate == "function";
|
|
3134
|
+
Oi(i.current, r, a) && Di(e, i.current, t), i.current = t;
|
|
3135
|
+
}, [
|
|
3136
|
+
t,
|
|
3137
|
+
n,
|
|
3138
|
+
r
|
|
3139
|
+
]);
|
|
3140
|
+
}
|
|
3141
|
+
//#endregion
|
|
3142
|
+
//#region src/components/tabs/use_tabs_keyboard_navigation.ts
|
|
3143
|
+
var Ai = {
|
|
3144
|
+
ArrowRight: (e, t) => (e + 1) % t,
|
|
3145
|
+
ArrowLeft: (e, t) => (e - 1 + t) % t,
|
|
3146
|
+
Home: () => 0,
|
|
3147
|
+
End: (e, t) => t - 1
|
|
3148
|
+
};
|
|
3149
|
+
function ji(e) {
|
|
3150
|
+
return e.flatMap((e, t) => e.disabled ? [] : [t]);
|
|
3151
|
+
}
|
|
3152
|
+
function Mi(e, t) {
|
|
3153
|
+
let n = e[t];
|
|
3154
|
+
return n && !n.disabled ? t : ji(e)[0] ?? -1;
|
|
3155
|
+
}
|
|
3156
|
+
function Ni(e) {
|
|
3157
|
+
let { items: t, activeIndex: n, onNavigate: r } = e;
|
|
3158
|
+
return (e) => {
|
|
3159
|
+
let i = Ai[e.key];
|
|
3160
|
+
if (!i) return;
|
|
3161
|
+
let a = ji(t);
|
|
3162
|
+
if (a.length === 0) return;
|
|
3163
|
+
e.preventDefault();
|
|
3164
|
+
let o = i(a.indexOf(n), a.length);
|
|
3165
|
+
r(a[o]);
|
|
3166
|
+
};
|
|
3167
|
+
}
|
|
3168
|
+
//#endregion
|
|
2421
3169
|
//#region src/components/tabs/tabs.tsx
|
|
2422
|
-
function
|
|
2423
|
-
let [
|
|
2424
|
-
e[t]?.disabled || (
|
|
2425
|
-
},
|
|
2426
|
-
|
|
2427
|
-
},
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
3170
|
+
function Pi({ items: e, value: t, defaultIndex: n = 0, variant: r = "line", size: i = "md", radius: a = "md", fullWidth: o = !1, unstyled: s = !1, animated: c = !0, className: u, tabListClassName: d, panelClassName: p, onChange: m }) {
|
|
3171
|
+
let [h, v] = ye(t, n), y = l(), b = f([]), S = f(null), C = (t) => {
|
|
3172
|
+
e[t]?.disabled || (v(t), m?.(t));
|
|
3173
|
+
}, w = (e) => {
|
|
3174
|
+
b.current[e]?.focus(), C(e);
|
|
3175
|
+
}, T = Mi(e, h), E = Ni({
|
|
3176
|
+
items: e,
|
|
3177
|
+
activeIndex: T,
|
|
3178
|
+
onNavigate: w
|
|
3179
|
+
}), D = e[h];
|
|
3180
|
+
return ki({
|
|
3181
|
+
activeIndex: h,
|
|
3182
|
+
indicatorRef: S,
|
|
3183
|
+
isAnimated: c
|
|
3184
|
+
}), /* @__PURE__ */ _("div", {
|
|
3185
|
+
className: x("w-full", u),
|
|
2435
3186
|
children: [/* @__PURE__ */ g("div", {
|
|
2436
3187
|
role: "tablist",
|
|
2437
|
-
className:
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
3188
|
+
className: yi({
|
|
3189
|
+
variant: r,
|
|
3190
|
+
radius: a,
|
|
3191
|
+
unstyled: s,
|
|
3192
|
+
isFullWidth: o,
|
|
3193
|
+
className: d
|
|
3194
|
+
}),
|
|
3195
|
+
children: e.map((e, t) => /* @__PURE__ */ g(Si, {
|
|
2443
3196
|
ref: (e) => {
|
|
2444
|
-
|
|
3197
|
+
b.current[t] = e;
|
|
2445
3198
|
},
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
3199
|
+
indicatorRef: S,
|
|
3200
|
+
item: e,
|
|
3201
|
+
isActive: h === t,
|
|
3202
|
+
isTabStop: T === t,
|
|
3203
|
+
isFullWidth: o,
|
|
3204
|
+
variant: r,
|
|
3205
|
+
size: i,
|
|
3206
|
+
radius: a,
|
|
3207
|
+
unstyled: s,
|
|
3208
|
+
tabId: `${y}-tab-${t}`,
|
|
3209
|
+
panelId: `${y}-panel-${t}`,
|
|
3210
|
+
onSelect: () => C(t),
|
|
3211
|
+
onKeyDown: E
|
|
2458
3212
|
}, e.title))
|
|
2459
3213
|
}), /* @__PURE__ */ g("div", {
|
|
2460
3214
|
role: "tabpanel",
|
|
2461
|
-
id: `${
|
|
2462
|
-
"aria-labelledby": `${
|
|
3215
|
+
id: `${y}-panel-${h}`,
|
|
3216
|
+
"aria-labelledby": `${y}-tab-${h}`,
|
|
2463
3217
|
tabIndex: 0,
|
|
2464
|
-
className: x(
|
|
2465
|
-
"
|
|
2466
|
-
"
|
|
2467
|
-
|
|
2468
|
-
],
|
|
3218
|
+
className: x(!s && [
|
|
3219
|
+
"mt-4",
|
|
3220
|
+
"outline-hidden focus-visible:outline-2 focus-visible:outline-offset-2",
|
|
3221
|
+
A.primary.focusOutline
|
|
3222
|
+
], p),
|
|
2469
3223
|
children: /* @__PURE__ */ g("div", {
|
|
2470
|
-
className: "tabs-panel-inner",
|
|
2471
|
-
children:
|
|
2472
|
-
},
|
|
3224
|
+
className: x(c && !s && "tabs-panel-inner"),
|
|
3225
|
+
children: D?.content
|
|
3226
|
+
}, h)
|
|
2473
3227
|
})]
|
|
2474
3228
|
});
|
|
2475
3229
|
}
|
|
2476
3230
|
//#endregion
|
|
2477
3231
|
//#region src/components/textarea/textarea.tsx
|
|
2478
|
-
function
|
|
2479
|
-
let { fieldId:
|
|
2480
|
-
|
|
3232
|
+
function Fi({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength: i, radius: a = "md", unstyled: o = !1, className: s, wrapperClassName: c, value: l, defaultValue: u, onChange: d, id: f, "aria-describedby": p, ...m }) {
|
|
3233
|
+
let { fieldId: h, errorId: v, characterCountId: y } = K(f), { length: b, trackLength: C } = er(l, u), w = n && (r !== void 0 || i !== void 0), T = (e) => {
|
|
3234
|
+
C(e.target.value), d?.(e);
|
|
2481
3235
|
};
|
|
2482
|
-
return /* @__PURE__ */ _(
|
|
2483
|
-
fieldId:
|
|
2484
|
-
errorId:
|
|
3236
|
+
return /* @__PURE__ */ _(Oe, {
|
|
3237
|
+
fieldId: h,
|
|
3238
|
+
errorId: v,
|
|
2485
3239
|
label: e,
|
|
2486
3240
|
error: t,
|
|
2487
|
-
required:
|
|
3241
|
+
required: m.required,
|
|
2488
3242
|
wrapperClassName: c,
|
|
2489
3243
|
children: [/* @__PURE__ */ g("textarea", {
|
|
2490
|
-
id:
|
|
3244
|
+
id: h,
|
|
2491
3245
|
className: x("w-full min-h-[80px] resize-y disabled:opacity-50 disabled:cursor-not-allowed", !o && [
|
|
2492
|
-
|
|
3246
|
+
le,
|
|
2493
3247
|
S[a],
|
|
2494
3248
|
"px-3 py-2 text-sm"
|
|
2495
3249
|
], !o && t && x("border-red-500 dark:border-red-400", "focus:ring-red-500"), s),
|
|
2496
3250
|
...l === void 0 ? { defaultValue: u } : { value: l },
|
|
2497
3251
|
minLength: r,
|
|
2498
3252
|
maxLength: i,
|
|
2499
|
-
onChange:
|
|
3253
|
+
onChange: T,
|
|
2500
3254
|
"aria-invalid": !!t,
|
|
2501
|
-
"aria-describedby": t
|
|
2502
|
-
...
|
|
2503
|
-
}),
|
|
2504
|
-
|
|
3255
|
+
"aria-describedby": G(p, t && v, w && y),
|
|
3256
|
+
...m
|
|
3257
|
+
}), w && /* @__PURE__ */ g(ce, {
|
|
3258
|
+
id: y,
|
|
3259
|
+
current: b,
|
|
2505
3260
|
min: r,
|
|
2506
3261
|
max: i,
|
|
2507
3262
|
showMin: r !== void 0,
|
|
@@ -2511,41 +3266,41 @@ function Or({ label: e, error: t, showCharCount: n = !1, minLength: r, maxLength
|
|
|
2511
3266
|
}
|
|
2512
3267
|
//#endregion
|
|
2513
3268
|
//#region src/stores/theme_store/theme_store.ts
|
|
2514
|
-
var
|
|
2515
|
-
function
|
|
3269
|
+
var Ii = "theme";
|
|
3270
|
+
function Li(e) {
|
|
2516
3271
|
return e === "light" || e === "dark" || e === "system";
|
|
2517
3272
|
}
|
|
2518
|
-
function
|
|
3273
|
+
function Ri() {
|
|
2519
3274
|
return globalThis.window !== void 0 && globalThis.document !== void 0;
|
|
2520
3275
|
}
|
|
2521
|
-
function
|
|
3276
|
+
function zi(e) {
|
|
2522
3277
|
let t = window.matchMedia("(prefers-color-scheme: dark)").matches, n = e === "dark" || e === "system" && t;
|
|
2523
3278
|
document.documentElement.classList.toggle("dark", n);
|
|
2524
3279
|
}
|
|
2525
|
-
function
|
|
2526
|
-
if (!
|
|
2527
|
-
let e = globalThis.localStorage.getItem(
|
|
2528
|
-
return
|
|
3280
|
+
function Bi() {
|
|
3281
|
+
if (!Ri()) return "system";
|
|
3282
|
+
let e = globalThis.localStorage.getItem(Ii);
|
|
3283
|
+
return Li(e) ? e : "system";
|
|
2529
3284
|
}
|
|
2530
|
-
var
|
|
2531
|
-
|
|
2532
|
-
var
|
|
2533
|
-
theme:
|
|
3285
|
+
var Vi = Bi();
|
|
3286
|
+
Ri() && zi(Vi);
|
|
3287
|
+
var Hi = Kr((e) => ({
|
|
3288
|
+
theme: Vi,
|
|
2534
3289
|
setTheme: (t) => {
|
|
2535
|
-
|
|
3290
|
+
zi(t), Ri() && globalThis.localStorage.setItem(Ii, t), e({ theme: t });
|
|
2536
3291
|
}
|
|
2537
3292
|
}));
|
|
2538
|
-
|
|
2539
|
-
if (e.key !==
|
|
2540
|
-
let t =
|
|
2541
|
-
|
|
3293
|
+
Ri() && (globalThis.addEventListener("storage", (e) => {
|
|
3294
|
+
if (e.key !== Ii) return;
|
|
3295
|
+
let t = Li(e.newValue) ? e.newValue : "system";
|
|
3296
|
+
zi(t), Hi.setState({ theme: t });
|
|
2542
3297
|
}), globalThis.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
|
|
2543
|
-
|
|
3298
|
+
Hi.getState().theme === "system" && zi("system");
|
|
2544
3299
|
}));
|
|
2545
3300
|
//#endregion
|
|
2546
3301
|
//#region src/lib/theme_transition.ts
|
|
2547
|
-
var
|
|
2548
|
-
async function
|
|
3302
|
+
var Ui = 750, Wi = "ease-in-out";
|
|
3303
|
+
async function Gi({ theme: e, element: t, transitionDuration: n = Ui, transitionEasing: r = Wi, applyThemeCallback: i }) {
|
|
2549
3304
|
if (!document.startViewTransition || globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches) {
|
|
2550
3305
|
i(e);
|
|
2551
3306
|
return;
|
|
@@ -2559,23 +3314,23 @@ async function Rr({ theme: e, element: t, transitionDuration: n = Ir, transition
|
|
|
2559
3314
|
pseudoElement: "::view-transition-new(root)"
|
|
2560
3315
|
});
|
|
2561
3316
|
}
|
|
2562
|
-
function
|
|
3317
|
+
function Ki(e) {
|
|
2563
3318
|
return e === "light" ? "dark" : e === "dark" ? "system" : "light";
|
|
2564
3319
|
}
|
|
2565
3320
|
//#endregion
|
|
2566
3321
|
//#region src/components/theme_toggle/theme_toggle.tsx
|
|
2567
|
-
var
|
|
3322
|
+
var qi = {
|
|
2568
3323
|
light: "i-tabler-sun text-yellow-500",
|
|
2569
3324
|
dark: "i-tabler-moon-stars text-gray-700 dark:text-yellow-500",
|
|
2570
3325
|
system: "i-tabler-device-desktop text-blue-500"
|
|
2571
|
-
},
|
|
2572
|
-
function
|
|
3326
|
+
}, Ji = "i-tabler-device-desktop text-gray-400";
|
|
3327
|
+
function Yi(e) {
|
|
2573
3328
|
return `Current theme: ${e}`;
|
|
2574
3329
|
}
|
|
2575
|
-
function
|
|
2576
|
-
let c =
|
|
2577
|
-
let r =
|
|
2578
|
-
i && e ? await
|
|
3330
|
+
function Xi({ isTransitionEnabled: e = !0, transitionDuration: t, transitionEasing: n, size: r = "md", radius: i, variant: a, getAriaLabel: s = Yi }) {
|
|
3331
|
+
let c = Hi((e) => e.theme), l = Hi((e) => e.setTheme), u = Ee(), d = f(null), p = o(async () => {
|
|
3332
|
+
let r = Ki(c), i = d.current;
|
|
3333
|
+
i && e ? await Gi({
|
|
2579
3334
|
theme: r,
|
|
2580
3335
|
element: i,
|
|
2581
3336
|
transitionDuration: t,
|
|
@@ -2588,8 +3343,8 @@ function Ur({ isTransitionEnabled: e = !0, transitionDuration: t, transitionEasi
|
|
|
2588
3343
|
t,
|
|
2589
3344
|
n,
|
|
2590
3345
|
l
|
|
2591
|
-
]), m = u ?
|
|
2592
|
-
return /* @__PURE__ */ g(
|
|
3346
|
+
]), m = u ? qi[c] : Ji;
|
|
3347
|
+
return /* @__PURE__ */ g(Qn, {
|
|
2593
3348
|
ref: d,
|
|
2594
3349
|
icon: m,
|
|
2595
3350
|
"aria-label": s(c),
|
|
@@ -2603,55 +3358,65 @@ function Ur({ isTransitionEnabled: e = !0, transitionDuration: t, transitionEasi
|
|
|
2603
3358
|
}
|
|
2604
3359
|
//#endregion
|
|
2605
3360
|
//#region src/components/tooltip/tooltip.tsx
|
|
2606
|
-
var
|
|
3361
|
+
var Zi = 8, Qi = 8, $i = {
|
|
2607
3362
|
top: "data-[state=closed]:translate-y-1",
|
|
2608
3363
|
bottom: "data-[state=closed]:-translate-y-1",
|
|
2609
3364
|
left: "data-[state=closed]:translate-x-1",
|
|
2610
3365
|
right: "data-[state=closed]:-translate-x-1"
|
|
2611
|
-
},
|
|
3366
|
+
}, ea = {
|
|
2612
3367
|
top: "bottom",
|
|
2613
3368
|
bottom: "top",
|
|
2614
3369
|
left: "right",
|
|
2615
3370
|
right: "left"
|
|
2616
3371
|
};
|
|
2617
|
-
function
|
|
2618
|
-
let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } =
|
|
3372
|
+
function ta({ content: e, children: t, position: r = "top", showOnClick: i = !1, temporaryContent: s, temporaryDuration: u = 2e3, disabled: d = !1, radius: m = "lg", onTemporaryShow: v, className: b, ref: C }) {
|
|
3373
|
+
let { isMounted: w, isVisible: T, setIsVisible: E, open: D, close: O } = Rn(), [k, A] = p(!1), j = l(), M = f(null), N = f(void 0), { refs: P, floatingStyles: F, placement: I, middlewareData: ee, isPositioned: L } = bn({
|
|
2619
3374
|
placement: r,
|
|
2620
3375
|
open: w,
|
|
2621
|
-
whileElementsMounted:
|
|
3376
|
+
whileElementsMounted: ln,
|
|
2622
3377
|
middleware: [
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
3378
|
+
Sn(Zi),
|
|
3379
|
+
wn(),
|
|
3380
|
+
Cn({ padding: 8 }),
|
|
3381
|
+
Tn({ element: M })
|
|
2627
3382
|
]
|
|
2628
|
-
}),
|
|
2629
|
-
|
|
2630
|
-
let
|
|
3383
|
+
}), te = I.split("-")[0];
|
|
3384
|
+
zn(w, L, E);
|
|
3385
|
+
let ne = o((e) => ir(P.setReference, C)(e), [P, C]), R = o(() => {
|
|
2631
3386
|
A(!1), O();
|
|
2632
|
-
}, re = () => {
|
|
2633
|
-
d
|
|
3387
|
+
}, [O]), re = () => {
|
|
3388
|
+
!d && s && (A(!0), D(L), clearTimeout(N.current), N.current = setTimeout(R, u), v?.());
|
|
2634
3389
|
}, z = () => {
|
|
2635
3390
|
d || D(L);
|
|
2636
|
-
},
|
|
2637
|
-
clearTimeout(N.current),
|
|
2638
|
-
};
|
|
2639
|
-
c(() => () => clearTimeout(N.current), [])
|
|
2640
|
-
|
|
3391
|
+
}, B = o(() => {
|
|
3392
|
+
clearTimeout(N.current), R();
|
|
3393
|
+
}, [R]);
|
|
3394
|
+
c(() => () => clearTimeout(N.current), []), c(() => {
|
|
3395
|
+
if (!w) return;
|
|
3396
|
+
let e = (e) => {
|
|
3397
|
+
e.key === "Escape" && B();
|
|
3398
|
+
};
|
|
3399
|
+
return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
|
|
3400
|
+
}, [w, B]);
|
|
3401
|
+
let ie = w && !d, V = k && s ? s : e, H = {
|
|
2641
3402
|
onClick: (e) => {
|
|
2642
3403
|
i && s && re(), a(t) && t.props.onClick?.(e);
|
|
2643
3404
|
},
|
|
2644
|
-
"aria-describedby":
|
|
2645
|
-
},
|
|
2646
|
-
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */
|
|
2647
|
-
ref:
|
|
3405
|
+
"aria-describedby": G(a(t) ? t.props["aria-describedby"] : void 0, ie && j)
|
|
3406
|
+
}, ae = a(t) ? n(t, H) : t, oe = ee.arrow?.x, U = ee.arrow?.y, se = ea[te];
|
|
3407
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _("span", {
|
|
3408
|
+
ref: ne,
|
|
2648
3409
|
className: x("inline-block", b),
|
|
2649
3410
|
onMouseEnter: z,
|
|
2650
|
-
onMouseLeave:
|
|
3411
|
+
onMouseLeave: B,
|
|
2651
3412
|
onFocus: z,
|
|
2652
|
-
onBlur:
|
|
2653
|
-
children:
|
|
2654
|
-
|
|
3413
|
+
onBlur: B,
|
|
3414
|
+
children: [ae, s !== void 0 && /* @__PURE__ */ g("span", {
|
|
3415
|
+
role: "status",
|
|
3416
|
+
className: "sr-only",
|
|
3417
|
+
children: k ? s : null
|
|
3418
|
+
})]
|
|
3419
|
+
}), ie && y(/* @__PURE__ */ g("div", {
|
|
2655
3420
|
ref: P.setFloating,
|
|
2656
3421
|
style: F,
|
|
2657
3422
|
className: "z-50 inline-block pointer-events-none",
|
|
@@ -2659,16 +3424,16 @@ function Jr({ content: e, children: t, position: r = "top", showOnClick: i = !1,
|
|
|
2659
3424
|
id: j,
|
|
2660
3425
|
role: "tooltip",
|
|
2661
3426
|
"data-state": T ? "open" : "closed",
|
|
2662
|
-
className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0",
|
|
2663
|
-
children: [
|
|
3427
|
+
className: x("px-3 py-1.5 text-sm whitespace-nowrap", "text-white dark:text-gray-900 bg-gray-900 dark:bg-gray-100 shadow-lg", "transition-[opacity,transform] duration-150 ease-out", T ? "opacity-100" : "opacity-0", $i[te], S[m]),
|
|
3428
|
+
children: [V, /* @__PURE__ */ g("div", {
|
|
2664
3429
|
ref: M,
|
|
2665
3430
|
style: {
|
|
2666
3431
|
position: "absolute",
|
|
2667
|
-
width: `${
|
|
2668
|
-
height: `${
|
|
2669
|
-
left:
|
|
2670
|
-
top:
|
|
2671
|
-
[
|
|
3432
|
+
width: `${Qi}px`,
|
|
3433
|
+
height: `${Qi}px`,
|
|
3434
|
+
left: oe === void 0 ? void 0 : `${oe}px`,
|
|
3435
|
+
top: U === void 0 ? void 0 : `${U}px`,
|
|
3436
|
+
[se]: `-${Qi / 2}px`
|
|
2672
3437
|
},
|
|
2673
3438
|
className: "rotate-45 bg-gray-900 dark:bg-gray-100"
|
|
2674
3439
|
})]
|
|
@@ -2677,11 +3442,11 @@ function Jr({ content: e, children: t, position: r = "top", showOnClick: i = !1,
|
|
|
2677
3442
|
}
|
|
2678
3443
|
//#endregion
|
|
2679
3444
|
//#region src/hooks/use_is_client/with_client_only.tsx
|
|
2680
|
-
var
|
|
3445
|
+
var na = (e) => {
|
|
2681
3446
|
function t(t) {
|
|
2682
|
-
return
|
|
3447
|
+
return Ee() ? /* @__PURE__ */ g(e, { ...t }) : null;
|
|
2683
3448
|
}
|
|
2684
3449
|
return t;
|
|
2685
3450
|
};
|
|
2686
3451
|
//#endregion
|
|
2687
|
-
export {
|
|
3452
|
+
export { I as Avatar, le as BASE_INPUT_STYLES, L as Badge, R as Button, U as Card, ce as CharacterCount, xe as Checkbox, Te as CheckboxOptions, De as ClientOnly, Me as Combobox, $r as ConfirmModal, Un as ContextMenu, Kn as CopyButton, Yn as Highlight, Qn as IconButton, tr as Input, rr as Kbd, sr as Menu, cr as MenuGroup, yr as MenuItem, br as MenuSeparator, ni as Modal, ri as ModalFooter, ii as ModalProvider, ui as MultiCombobox, fi as RadioOptions, pi as Select, mi as Switch, Pi as Tabs, Fi as Textarea, Xi as ThemeToggle, ta as Tooltip, qn as splitIntoHighlightSegments, Yr as useDisableHotkeysWhileMounted, qr as useGlobalHotkeysStore, Ee as useIsClient, Hi as useThemeStore, na as withClientOnly };
|