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