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