@viglet/viglet-design-system 2026.3.17 → 2026.3.18
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 +47 -17
- package/dist/bento/bento-calendar.d.ts.map +1 -1
- package/dist/bento/bento-change-cell.d.ts +22 -0
- package/dist/bento/bento-change-cell.d.ts.map +1 -0
- package/dist/bento/bento-data-table.d.ts +12 -2
- package/dist/bento/bento-data-table.d.ts.map +1 -1
- package/dist/bento/bento-diff.d.ts.map +1 -1
- package/dist/bento/bento-filter-bar.d.ts.map +1 -1
- package/dist/bento/bento-identity-cell.d.ts +22 -0
- package/dist/bento/bento-identity-cell.d.ts.map +1 -0
- package/dist/bento/bento-inline-edit.d.ts.map +1 -1
- package/dist/bento/bento-list-page.d.ts +24 -5
- package/dist/bento/bento-list-page.d.ts.map +1 -1
- package/dist/bento/bento-shell.d.ts.map +1 -1
- package/dist/bento/index.d.ts +3 -1
- package/dist/bento/index.d.ts.map +1 -1
- package/dist/bento.cjs +4 -4
- package/dist/bento.es.js +1263 -1097
- package/dist/catalogue.json +111 -3
- package/dist/exports.json +8 -1
- package/dist/i18n/index.d.ts +6 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/locales/en/bento.json.d.ts +3 -0
- package/dist/i18n/locales/pt/bento.json.d.ts +3 -0
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.es.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.es.js +966 -1039
- package/dist/user.context-BqsOcMaZ.cjs +1 -0
- package/dist/{user.context-TpXsFyGy.js → user.context-vCmnGlIb.js} +327 -254
- package/dist/viglet-design-system.css +1 -1
- package/package.json +1 -1
- package/dist/user.context-DDPB1fax.cjs +0 -1
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { t as e } from "./utils-Fk5jmzzb.js";
|
|
2
2
|
import { C as t, a as n, c as r, g as i, o as a, p as o, u as s, v as c, y as l } from "./badge-locale-BwsfyQJT.js";
|
|
3
3
|
import * as u from "react";
|
|
4
|
-
import d, { createContext as f, useCallback as ee, useContext as p, useEffect as
|
|
5
|
-
import { Fragment as
|
|
6
|
-
import * as
|
|
7
|
-
import { Slot as
|
|
8
|
-
import { cva as
|
|
9
|
-
import { useTranslation as
|
|
4
|
+
import d, { createContext as f, useCallback as ee, useContext as p, useEffect as m, useRef as h, useState as g } from "react";
|
|
5
|
+
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
6
|
+
import * as b from "@radix-ui/react-avatar";
|
|
7
|
+
import { Slot as x } from "@radix-ui/react-slot";
|
|
8
|
+
import { cva as S } from "class-variance-authority";
|
|
9
|
+
import { useTranslation as te } from "react-i18next";
|
|
10
10
|
import * as C from "@radix-ui/react-checkbox";
|
|
11
11
|
import * as w from "@radix-ui/react-dropdown-menu";
|
|
12
|
-
import { IconChevronDown as T, IconLoader2 as ne, IconSearch as re, IconSparkles as
|
|
13
|
-
import { Icon as
|
|
14
|
-
import { Popover as
|
|
15
|
-
import { Group as
|
|
16
|
-
import * as
|
|
17
|
-
import { useTheme as
|
|
18
|
-
import { Toaster as
|
|
19
|
-
import * as
|
|
12
|
+
import { IconChevronDown as T, IconLoader2 as ne, IconSearch as re, IconSparkles as ie, IconTrash as ae } from "@tabler/icons-react";
|
|
13
|
+
import { Icon as E } from "@iconify/react";
|
|
14
|
+
import { Popover as D } from "radix-ui";
|
|
15
|
+
import { Group as O, Panel as k, Separator as A } from "react-resizable-panels";
|
|
16
|
+
import * as j from "@radix-ui/react-tooltip";
|
|
17
|
+
import { useTheme as M } from "next-themes";
|
|
18
|
+
import { Toaster as N, toast as P } from "sonner";
|
|
19
|
+
import * as F from "@radix-ui/react-tabs";
|
|
20
|
+
import * as I from "@radix-ui/react-toggle";
|
|
21
|
+
import * as L from "@radix-ui/react-toggle-group";
|
|
20
22
|
//#region node_modules/lucide-react/dist/esm/icons/check.mjs
|
|
21
|
-
var
|
|
23
|
+
var R = {
|
|
22
24
|
name: "check",
|
|
23
25
|
size: 24,
|
|
24
26
|
node: [["path", {
|
|
@@ -26,8 +28,8 @@ var L = {
|
|
|
26
28
|
key: "1gmf2c"
|
|
27
29
|
}]]
|
|
28
30
|
};
|
|
29
|
-
|
|
30
|
-
var
|
|
31
|
+
R.node;
|
|
32
|
+
var z = t(R), B = {
|
|
31
33
|
name: "chevron-right",
|
|
32
34
|
size: 24,
|
|
33
35
|
node: [["path", {
|
|
@@ -35,8 +37,8 @@ var R = t(L), z = {
|
|
|
35
37
|
key: "mthhwq"
|
|
36
38
|
}]]
|
|
37
39
|
};
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
+
B.node;
|
|
41
|
+
var oe = t(B), se = {
|
|
40
42
|
name: "circle-check",
|
|
41
43
|
size: 24,
|
|
42
44
|
node: [["circle", {
|
|
@@ -50,8 +52,8 @@ var B = t(z), V = {
|
|
|
50
52
|
}]],
|
|
51
53
|
aliases: ["check-circle-2"]
|
|
52
54
|
};
|
|
53
|
-
|
|
54
|
-
var
|
|
55
|
+
se.node;
|
|
56
|
+
var ce = t(se), le = {
|
|
55
57
|
name: "circle",
|
|
56
58
|
size: 24,
|
|
57
59
|
node: [["circle", {
|
|
@@ -61,8 +63,8 @@ var ae = t(V), H = {
|
|
|
61
63
|
key: "1mglay"
|
|
62
64
|
}]]
|
|
63
65
|
};
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
+
le.node;
|
|
67
|
+
var ue = t(le), V = {
|
|
66
68
|
name: "grip-vertical",
|
|
67
69
|
size: 24,
|
|
68
70
|
node: [
|
|
@@ -104,8 +106,8 @@ var oe = t(H), se = {
|
|
|
104
106
|
}]
|
|
105
107
|
]
|
|
106
108
|
};
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
+
V.node;
|
|
110
|
+
var de = t(V), H = {
|
|
109
111
|
name: "info",
|
|
110
112
|
size: 24,
|
|
111
113
|
node: [
|
|
@@ -125,8 +127,8 @@ var ce = t(se), U = {
|
|
|
125
127
|
}]
|
|
126
128
|
]
|
|
127
129
|
};
|
|
128
|
-
|
|
129
|
-
var
|
|
130
|
+
H.node;
|
|
131
|
+
var fe = t(H), U = {
|
|
130
132
|
name: "loader-circle",
|
|
131
133
|
size: 24,
|
|
132
134
|
node: [["path", {
|
|
@@ -135,8 +137,8 @@ var le = t(U), W = {
|
|
|
135
137
|
}]],
|
|
136
138
|
aliases: ["loader-2"]
|
|
137
139
|
};
|
|
138
|
-
|
|
139
|
-
var
|
|
140
|
+
U.node;
|
|
141
|
+
var pe = t(U), W = {
|
|
140
142
|
name: "octagon-x",
|
|
141
143
|
size: 24,
|
|
142
144
|
node: [
|
|
@@ -155,8 +157,8 @@ var ue = t(W), G = {
|
|
|
155
157
|
],
|
|
156
158
|
aliases: ["x-octagon"]
|
|
157
159
|
};
|
|
158
|
-
|
|
159
|
-
var
|
|
160
|
+
W.node;
|
|
161
|
+
var me = t(W), G = {
|
|
160
162
|
name: "triangle-alert",
|
|
161
163
|
size: 24,
|
|
162
164
|
node: [
|
|
@@ -175,8 +177,8 @@ var de = t(G), K = {
|
|
|
175
177
|
],
|
|
176
178
|
aliases: ["alert-triangle"]
|
|
177
179
|
};
|
|
178
|
-
|
|
179
|
-
var
|
|
180
|
+
G.node;
|
|
181
|
+
var he = t(G), K = S("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:cursor-not-allowed disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", {
|
|
180
182
|
variants: {
|
|
181
183
|
variant: {
|
|
182
184
|
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
@@ -200,70 +202,70 @@ var fe = t(K), q = x("inline-flex items-center justify-center gap-2 whitespace-n
|
|
|
200
202
|
size: "default"
|
|
201
203
|
}
|
|
202
204
|
});
|
|
203
|
-
function
|
|
204
|
-
let d = i ?
|
|
205
|
-
return /* @__PURE__ */
|
|
205
|
+
function ge({ className: t, variant: n, size: r, asChild: i = !1, loading: a = !1, onClick: o, children: s, ...u }) {
|
|
206
|
+
let d = i ? x : "button", f = l(a, u["aria-disabled"], o);
|
|
207
|
+
return /* @__PURE__ */ v(d, {
|
|
206
208
|
"data-slot": "button",
|
|
207
|
-
className: e(
|
|
209
|
+
className: e(K({
|
|
208
210
|
variant: n,
|
|
209
211
|
size: r,
|
|
210
212
|
className: t
|
|
211
213
|
}), f.inert && (a ? "cursor-progress" : "cursor-not-allowed opacity-50")),
|
|
212
214
|
...u,
|
|
213
215
|
...f.props,
|
|
214
|
-
children: i ? s : /* @__PURE__ */
|
|
216
|
+
children: i ? s : /* @__PURE__ */ y(_, { children: [a && /* @__PURE__ */ v(c, {}), s] })
|
|
215
217
|
});
|
|
216
218
|
}
|
|
217
219
|
//#endregion
|
|
218
220
|
//#region src/components/ui/checkbox.tsx
|
|
219
|
-
function
|
|
220
|
-
return /* @__PURE__ */
|
|
221
|
+
function _e({ className: t, ...n }) {
|
|
222
|
+
return /* @__PURE__ */ v(C.Root, {
|
|
221
223
|
"data-slot": "checkbox",
|
|
222
224
|
className: e("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-sm border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", t),
|
|
223
225
|
...n,
|
|
224
|
-
children: /* @__PURE__ */
|
|
226
|
+
children: /* @__PURE__ */ v(C.Indicator, {
|
|
225
227
|
"data-slot": "checkbox-indicator",
|
|
226
228
|
className: "grid place-content-center text-current transition-none",
|
|
227
|
-
children: /* @__PURE__ */
|
|
229
|
+
children: /* @__PURE__ */ v(z, { className: "size-3.5" })
|
|
228
230
|
})
|
|
229
231
|
});
|
|
230
232
|
}
|
|
231
233
|
//#endregion
|
|
232
234
|
//#region src/components/ui/dropdown-menu.tsx
|
|
233
|
-
function
|
|
234
|
-
return /* @__PURE__ */
|
|
235
|
+
function ve({ ...e }) {
|
|
236
|
+
return /* @__PURE__ */ v(w.Root, {
|
|
235
237
|
"data-slot": "dropdown-menu",
|
|
236
238
|
...e
|
|
237
239
|
});
|
|
238
240
|
}
|
|
239
|
-
function
|
|
240
|
-
return /* @__PURE__ */
|
|
241
|
+
function ye({ ...e }) {
|
|
242
|
+
return /* @__PURE__ */ v(w.Portal, {
|
|
241
243
|
"data-slot": "dropdown-menu-portal",
|
|
242
244
|
...e
|
|
243
245
|
});
|
|
244
246
|
}
|
|
245
|
-
function
|
|
246
|
-
return /* @__PURE__ */
|
|
247
|
+
function be({ ...e }) {
|
|
248
|
+
return /* @__PURE__ */ v(w.Trigger, {
|
|
247
249
|
"data-slot": "dropdown-menu-trigger",
|
|
248
250
|
...e
|
|
249
251
|
});
|
|
250
252
|
}
|
|
251
|
-
function
|
|
252
|
-
return /* @__PURE__ */
|
|
253
|
+
function xe({ className: t, sideOffset: n = 4, ...r }) {
|
|
254
|
+
return /* @__PURE__ */ v(w.Portal, { children: /* @__PURE__ */ v(w.Content, {
|
|
253
255
|
"data-slot": "dropdown-menu-content",
|
|
254
256
|
sideOffset: n,
|
|
255
257
|
className: e("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md", t),
|
|
256
258
|
...r
|
|
257
259
|
}) });
|
|
258
260
|
}
|
|
259
|
-
function
|
|
260
|
-
return /* @__PURE__ */
|
|
261
|
+
function Se({ ...e }) {
|
|
262
|
+
return /* @__PURE__ */ v(w.Group, {
|
|
261
263
|
"data-slot": "dropdown-menu-group",
|
|
262
264
|
...e
|
|
263
265
|
});
|
|
264
266
|
}
|
|
265
|
-
function
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
+
function Ce({ className: t, inset: n, variant: r = "default", ...i }) {
|
|
268
|
+
return /* @__PURE__ */ v(w.Item, {
|
|
267
269
|
"data-slot": "dropdown-menu-item",
|
|
268
270
|
"data-inset": n,
|
|
269
271
|
"data-variant": r,
|
|
@@ -271,74 +273,74 @@ function be({ className: t, inset: n, variant: r = "default", ...i }) {
|
|
|
271
273
|
...i
|
|
272
274
|
});
|
|
273
275
|
}
|
|
274
|
-
function
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
+
function we({ className: t, children: n, checked: r, ...i }) {
|
|
277
|
+
return /* @__PURE__ */ y(w.CheckboxItem, {
|
|
276
278
|
"data-slot": "dropdown-menu-checkbox-item",
|
|
277
279
|
className: e("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
278
280
|
checked: r,
|
|
279
281
|
...i,
|
|
280
|
-
children: [/* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ v("span", {
|
|
281
283
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
282
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ v(w.ItemIndicator, { children: /* @__PURE__ */ v(z, { className: "size-4" }) })
|
|
283
285
|
}), n]
|
|
284
286
|
});
|
|
285
287
|
}
|
|
286
|
-
function
|
|
287
|
-
return /* @__PURE__ */
|
|
288
|
+
function Te({ ...e }) {
|
|
289
|
+
return /* @__PURE__ */ v(w.RadioGroup, {
|
|
288
290
|
"data-slot": "dropdown-menu-radio-group",
|
|
289
291
|
...e
|
|
290
292
|
});
|
|
291
293
|
}
|
|
292
|
-
function
|
|
293
|
-
return /* @__PURE__ */
|
|
294
|
+
function Ee({ className: t, children: n, ...r }) {
|
|
295
|
+
return /* @__PURE__ */ y(w.RadioItem, {
|
|
294
296
|
"data-slot": "dropdown-menu-radio-item",
|
|
295
297
|
className: e("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
296
298
|
...r,
|
|
297
|
-
children: [/* @__PURE__ */
|
|
299
|
+
children: [/* @__PURE__ */ v("span", {
|
|
298
300
|
className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",
|
|
299
|
-
children: /* @__PURE__ */
|
|
301
|
+
children: /* @__PURE__ */ v(w.ItemIndicator, { children: /* @__PURE__ */ v(ue, { className: "size-2 fill-current" }) })
|
|
300
302
|
}), n]
|
|
301
303
|
});
|
|
302
304
|
}
|
|
303
|
-
function
|
|
304
|
-
return /* @__PURE__ */
|
|
305
|
+
function De({ className: t, inset: n, ...r }) {
|
|
306
|
+
return /* @__PURE__ */ v(w.Label, {
|
|
305
307
|
"data-slot": "dropdown-menu-label",
|
|
306
308
|
"data-inset": n,
|
|
307
309
|
className: e("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", t),
|
|
308
310
|
...r
|
|
309
311
|
});
|
|
310
312
|
}
|
|
311
|
-
function
|
|
312
|
-
return /* @__PURE__ */
|
|
313
|
+
function Oe({ className: t, ...n }) {
|
|
314
|
+
return /* @__PURE__ */ v(w.Separator, {
|
|
313
315
|
"data-slot": "dropdown-menu-separator",
|
|
314
316
|
className: e("bg-border -mx-1 my-1 h-px", t),
|
|
315
317
|
...n
|
|
316
318
|
});
|
|
317
319
|
}
|
|
318
|
-
function
|
|
319
|
-
return /* @__PURE__ */
|
|
320
|
+
function ke({ className: t, ...n }) {
|
|
321
|
+
return /* @__PURE__ */ v("span", {
|
|
320
322
|
"data-slot": "dropdown-menu-shortcut",
|
|
321
323
|
className: e("text-muted-foreground ml-auto text-xs tracking-widest", t),
|
|
322
324
|
...n
|
|
323
325
|
});
|
|
324
326
|
}
|
|
325
|
-
function
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
+
function Ae({ ...e }) {
|
|
328
|
+
return /* @__PURE__ */ v(w.Sub, {
|
|
327
329
|
"data-slot": "dropdown-menu-sub",
|
|
328
330
|
...e
|
|
329
331
|
});
|
|
330
332
|
}
|
|
331
|
-
function
|
|
332
|
-
return /* @__PURE__ */
|
|
333
|
+
function je({ className: t, inset: n, children: r, ...i }) {
|
|
334
|
+
return /* @__PURE__ */ y(w.SubTrigger, {
|
|
333
335
|
"data-slot": "dropdown-menu-sub-trigger",
|
|
334
336
|
"data-inset": n,
|
|
335
337
|
className: e("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
336
338
|
...i,
|
|
337
|
-
children: [r, /* @__PURE__ */
|
|
339
|
+
children: [r, /* @__PURE__ */ v(oe, { className: "ml-auto size-4" })]
|
|
338
340
|
});
|
|
339
341
|
}
|
|
340
|
-
function
|
|
341
|
-
return /* @__PURE__ */
|
|
342
|
+
function Me({ className: t, ...n }) {
|
|
343
|
+
return /* @__PURE__ */ v(w.SubContent, {
|
|
342
344
|
"data-slot": "dropdown-menu-sub-content",
|
|
343
345
|
className: e("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg", t),
|
|
344
346
|
...n
|
|
@@ -346,31 +348,31 @@ function ke({ className: t, ...n }) {
|
|
|
346
348
|
}
|
|
347
349
|
//#endregion
|
|
348
350
|
//#region src/components/ui/icon-picker-dialog.tsx
|
|
349
|
-
var
|
|
351
|
+
var q = [
|
|
350
352
|
"lucide",
|
|
351
353
|
"tabler",
|
|
352
354
|
"mdi",
|
|
353
355
|
"ph",
|
|
354
356
|
"solar",
|
|
355
357
|
"heroicons"
|
|
356
|
-
],
|
|
357
|
-
async function
|
|
358
|
+
], Ne = q.join(",");
|
|
359
|
+
async function J(e, t, n) {
|
|
358
360
|
try {
|
|
359
|
-
let r = await fetch(`https://api.iconify.design/search?query=${encodeURIComponent(e)}&limit=${t}&prefixes=${
|
|
361
|
+
let r = await fetch(`https://api.iconify.design/search?query=${encodeURIComponent(e)}&limit=${t}&prefixes=${Ne}`, { signal: n });
|
|
360
362
|
if (r.ok) return (await r.json()).icons ?? [];
|
|
361
363
|
} catch {}
|
|
362
364
|
return [];
|
|
363
365
|
}
|
|
364
|
-
function
|
|
365
|
-
let { t:
|
|
366
|
-
let n = ++
|
|
366
|
+
function Pe({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title: d, description: f, suggestKeywords: p }) {
|
|
367
|
+
let { t: _ } = te(), [b, x] = g(""), [S, C] = g([]), [w, T] = g(!1), D = h(null), [O, k] = g(!1), [A, j] = g([]), M = h(0), [N, P] = g(null), F = ee(async (e, t) => {
|
|
368
|
+
let n = ++M.current, r = () => n === M.current && !t.aborted;
|
|
367
369
|
if (!e.trim()) {
|
|
368
370
|
C([]);
|
|
369
371
|
return;
|
|
370
372
|
}
|
|
371
373
|
T(!0);
|
|
372
374
|
try {
|
|
373
|
-
let n = await
|
|
375
|
+
let n = await J(e, 60, t);
|
|
374
376
|
r() && C(n);
|
|
375
377
|
} catch {
|
|
376
378
|
r() && C([]);
|
|
@@ -378,21 +380,21 @@ function je({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title
|
|
|
378
380
|
r() && T(!1);
|
|
379
381
|
}
|
|
380
382
|
}, []);
|
|
381
|
-
|
|
383
|
+
m(() => {
|
|
382
384
|
let e = new AbortController();
|
|
383
|
-
return
|
|
384
|
-
|
|
385
|
+
return D.current && clearTimeout(D.current), D.current = setTimeout(() => F(b, e.signal), 350), () => {
|
|
386
|
+
D.current && clearTimeout(D.current), e.abort();
|
|
385
387
|
};
|
|
386
|
-
}, [
|
|
387
|
-
let
|
|
388
|
-
|
|
389
|
-
function
|
|
390
|
-
l(e), t(!1),
|
|
388
|
+
}, [b, F]);
|
|
389
|
+
let I = h(null);
|
|
390
|
+
m(() => () => I.current?.abort(), []);
|
|
391
|
+
function L(e) {
|
|
392
|
+
l(e), t(!1), x(""), C([]), j([]), P(null);
|
|
391
393
|
}
|
|
392
|
-
async function
|
|
393
|
-
if (!p ||
|
|
394
|
+
async function R() {
|
|
395
|
+
if (!p || O) return;
|
|
394
396
|
let e = new AbortController();
|
|
395
|
-
|
|
397
|
+
I.current = e, k(!0), j([]), P(null);
|
|
396
398
|
try {
|
|
397
399
|
let t = (await p({
|
|
398
400
|
title: d,
|
|
@@ -402,75 +404,75 @@ function je({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title
|
|
|
402
404
|
if (e.signal.aborted) return;
|
|
403
405
|
n.push({
|
|
404
406
|
keyword: r.trim(),
|
|
405
|
-
icons: await
|
|
407
|
+
icons: await J(r.trim(), 30, e.signal)
|
|
406
408
|
});
|
|
407
409
|
}
|
|
408
|
-
e.signal.aborted ||
|
|
410
|
+
e.signal.aborted || j(n);
|
|
409
411
|
} catch {
|
|
410
|
-
e.signal.aborted ||
|
|
412
|
+
e.signal.aborted || j([]);
|
|
411
413
|
} finally {
|
|
412
|
-
e.signal.aborted ||
|
|
414
|
+
e.signal.aborted || k(!1);
|
|
413
415
|
}
|
|
414
416
|
}
|
|
415
|
-
let
|
|
416
|
-
return /* @__PURE__ */
|
|
417
|
+
let z = N ? A.find((e) => e.keyword === N)?.icons ?? [] : A.flatMap((e) => e.icons.slice(0, 3)), B = !!p && !!(d?.trim() ?? f?.trim());
|
|
418
|
+
return /* @__PURE__ */ v(r, {
|
|
417
419
|
open: e,
|
|
418
420
|
onOpenChange: t,
|
|
419
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ y(s, {
|
|
420
422
|
className: "flex max-h-[80vh] flex-col sm:max-w-lg",
|
|
421
423
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ v(o, { children: /* @__PURE__ */ v(i, { children: _("forms.iconPicker.chooseAnIcon", { defaultValue: "Choose an icon" }) }) }),
|
|
425
|
+
/* @__PURE__ */ y("div", {
|
|
424
426
|
className: "flex gap-2",
|
|
425
|
-
children: [/* @__PURE__ */
|
|
427
|
+
children: [/* @__PURE__ */ y("div", {
|
|
426
428
|
className: "relative flex-1",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
428
|
-
value:
|
|
429
|
-
onChange: (e) =>
|
|
430
|
-
placeholder:
|
|
429
|
+
children: [/* @__PURE__ */ v(re, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ v(n, {
|
|
430
|
+
value: b,
|
|
431
|
+
onChange: (e) => x(e.target.value),
|
|
432
|
+
placeholder: _("forms.iconPicker.searchIcons", { defaultValue: "Search icons" }),
|
|
431
433
|
className: "pl-9",
|
|
432
434
|
autoFocus: !0
|
|
433
435
|
})]
|
|
434
|
-
}),
|
|
436
|
+
}), B && /* @__PURE__ */ y(a, {
|
|
435
437
|
type: "button",
|
|
436
438
|
size: "sm",
|
|
437
439
|
variant: "outline",
|
|
438
|
-
onClick:
|
|
439
|
-
disabled:
|
|
440
|
+
onClick: R,
|
|
441
|
+
disabled: O,
|
|
440
442
|
className: "shrink-0 gap-1.5",
|
|
441
|
-
children: [
|
|
443
|
+
children: [O ? /* @__PURE__ */ v(ne, { className: "size-4 animate-spin" }) : /* @__PURE__ */ v(ie, { className: "size-4" }), _("forms.iconPicker.aiSuggest", { defaultValue: "Suggest" })]
|
|
442
444
|
})]
|
|
443
445
|
}),
|
|
444
|
-
|
|
446
|
+
A.length > 0 && /* @__PURE__ */ y("div", {
|
|
445
447
|
className: "rounded-lg border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] p-3",
|
|
446
448
|
children: [
|
|
447
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ y("div", {
|
|
448
450
|
className: "mb-2 flex items-center gap-1.5 text-xs font-medium vg-accent-text",
|
|
449
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ v(ie, { className: "size-3.5" }), _("forms.iconPicker.aiSuggestions", { defaultValue: "Suggestions" })]
|
|
450
452
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ v("div", {
|
|
452
454
|
className: "mb-3 flex flex-wrap gap-1.5",
|
|
453
|
-
children:
|
|
455
|
+
children: A.map((e) => /* @__PURE__ */ y("button", {
|
|
454
456
|
type: "button",
|
|
455
|
-
onClick: () =>
|
|
456
|
-
className: `cursor-pointer rounded-full px-3 py-1 text-xs font-medium transition-all ${
|
|
457
|
-
children: [e.keyword, /* @__PURE__ */
|
|
457
|
+
onClick: () => P(N === e.keyword ? null : e.keyword),
|
|
458
|
+
className: `cursor-pointer rounded-full px-3 py-1 text-xs font-medium transition-all ${N === e.keyword ? "vg-accent-solid text-white" : "bg-[var(--vg-accent-surface)] text-[var(--vg-accent-fg)] hover:bg-[var(--vg-accent-surface-strong)]"}`,
|
|
459
|
+
children: [e.keyword, /* @__PURE__ */ v("span", {
|
|
458
460
|
className: "ml-1 opacity-60",
|
|
459
461
|
children: e.icons.length
|
|
460
462
|
})]
|
|
461
463
|
}, e.keyword))
|
|
462
464
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
465
|
+
/* @__PURE__ */ v("div", {
|
|
464
466
|
className: "flex max-h-60 flex-wrap gap-2 overflow-y-auto",
|
|
465
|
-
children:
|
|
467
|
+
children: z.map((e) => /* @__PURE__ */ y("button", {
|
|
466
468
|
type: "button",
|
|
467
|
-
onClick: () =>
|
|
469
|
+
onClick: () => L(e),
|
|
468
470
|
className: `flex cursor-pointer flex-col items-center gap-1 rounded-lg p-2 transition-all hover:bg-[var(--vg-accent-surface)] ${c === e ? "border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface-strong)] vg-accent-text" : "border border-[var(--vg-accent-line)]"}`,
|
|
469
471
|
title: e,
|
|
470
|
-
children: [/* @__PURE__ */
|
|
472
|
+
children: [/* @__PURE__ */ v(E, {
|
|
471
473
|
icon: e,
|
|
472
474
|
className: "size-7"
|
|
473
|
-
}), /* @__PURE__ */
|
|
475
|
+
}), /* @__PURE__ */ v("span", {
|
|
474
476
|
className: "max-w-[80px] truncate text-center text-[9px] leading-tight text-muted-foreground",
|
|
475
477
|
children: e.split(":")[1] ?? e
|
|
476
478
|
})]
|
|
@@ -478,41 +480,41 @@ function je({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title
|
|
|
478
480
|
})
|
|
479
481
|
]
|
|
480
482
|
}),
|
|
481
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ y("div", {
|
|
482
484
|
className: "max-h-[400px] min-h-[200px] flex-1 overflow-y-auto",
|
|
483
485
|
children: [
|
|
484
|
-
w && /* @__PURE__ */
|
|
486
|
+
w && /* @__PURE__ */ v("div", {
|
|
485
487
|
className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
|
|
486
|
-
children:
|
|
488
|
+
children: _("forms.iconPicker.searching", { defaultValue: "Searching…" })
|
|
487
489
|
}),
|
|
488
|
-
!w &&
|
|
490
|
+
!w && b && S.length === 0 && /* @__PURE__ */ v("div", {
|
|
489
491
|
className: "flex h-32 items-center justify-center text-sm text-muted-foreground",
|
|
490
|
-
children:
|
|
491
|
-
query:
|
|
492
|
+
children: _("forms.iconPicker.noIconsFound", {
|
|
493
|
+
query: b,
|
|
492
494
|
defaultValue: "No icons found for “{{query}}”"
|
|
493
495
|
})
|
|
494
496
|
}),
|
|
495
|
-
!w && !
|
|
497
|
+
!w && !b && S.length === 0 && A.length === 0 && /* @__PURE__ */ y("div", {
|
|
496
498
|
className: "flex h-32 flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground",
|
|
497
|
-
children: [/* @__PURE__ */
|
|
498
|
-
count:
|
|
499
|
+
children: [/* @__PURE__ */ v("span", { children: _("forms.iconPicker.typeToSearch", {
|
|
500
|
+
count: q.length,
|
|
499
501
|
defaultValue: "Type to search {{count}} icon collections"
|
|
500
|
-
}) }),
|
|
502
|
+
}) }), B && /* @__PURE__ */ v("span", {
|
|
501
503
|
className: "text-xs leading-relaxed",
|
|
502
|
-
children:
|
|
504
|
+
children: _("forms.iconPicker.orClickAi", { defaultValue: "…or let the title and description suggest some" })
|
|
503
505
|
})]
|
|
504
506
|
}),
|
|
505
|
-
|
|
507
|
+
S.length > 0 && /* @__PURE__ */ v("div", {
|
|
506
508
|
className: "grid grid-cols-6 gap-1.5 p-1",
|
|
507
|
-
children:
|
|
509
|
+
children: S.map((e) => /* @__PURE__ */ y("button", {
|
|
508
510
|
type: "button",
|
|
509
|
-
onClick: () =>
|
|
511
|
+
onClick: () => L(e),
|
|
510
512
|
className: `flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg p-2 transition-all hover:bg-muted ${c === e ? "border border-[var(--vg-accent-line)] bg-[var(--vg-accent-surface)] vg-accent-text" : "border border-transparent hover:border-border"}`,
|
|
511
513
|
title: e,
|
|
512
|
-
children: [/* @__PURE__ */
|
|
514
|
+
children: [/* @__PURE__ */ v(E, {
|
|
513
515
|
icon: e,
|
|
514
516
|
className: "size-6"
|
|
515
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ v("span", {
|
|
516
518
|
className: "w-full truncate text-center text-[9px] leading-tight text-muted-foreground",
|
|
517
519
|
children: e.split(":")[1] ?? e
|
|
518
520
|
})]
|
|
@@ -520,32 +522,32 @@ function je({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title
|
|
|
520
522
|
})
|
|
521
523
|
]
|
|
522
524
|
}),
|
|
523
|
-
c && /* @__PURE__ */
|
|
525
|
+
c && /* @__PURE__ */ y("div", {
|
|
524
526
|
className: "flex items-center justify-between border-t pt-2",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
527
|
+
children: [/* @__PURE__ */ y("div", {
|
|
526
528
|
className: "flex items-center gap-2",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ v(E, {
|
|
528
530
|
icon: c,
|
|
529
531
|
className: "size-5"
|
|
530
|
-
}), /* @__PURE__ */
|
|
532
|
+
}), /* @__PURE__ */ v("span", {
|
|
531
533
|
className: "font-mono text-xs text-muted-foreground",
|
|
532
534
|
children: c
|
|
533
535
|
})]
|
|
534
|
-
}), /* @__PURE__ */
|
|
536
|
+
}), /* @__PURE__ */ y("div", {
|
|
535
537
|
className: "flex gap-2",
|
|
536
|
-
children: [u && /* @__PURE__ */
|
|
538
|
+
children: [u && /* @__PURE__ */ y(a, {
|
|
537
539
|
size: "sm",
|
|
538
540
|
type: "button",
|
|
539
541
|
variant: "outline",
|
|
540
542
|
onClick: () => {
|
|
541
543
|
u(), t(!1);
|
|
542
544
|
},
|
|
543
|
-
children: [/* @__PURE__ */
|
|
544
|
-
}), /* @__PURE__ */
|
|
545
|
+
children: [/* @__PURE__ */ v(ae, { className: "size-4" }), _("forms.common.remove", { defaultValue: "Remove" })]
|
|
546
|
+
}), /* @__PURE__ */ v(a, {
|
|
545
547
|
size: "sm",
|
|
546
548
|
type: "button",
|
|
547
549
|
onClick: () => t(!1),
|
|
548
|
-
children:
|
|
550
|
+
children: _("forms.iconPicker.done", { defaultValue: "Done" })
|
|
549
551
|
})]
|
|
550
552
|
})]
|
|
551
553
|
})
|
|
@@ -555,20 +557,20 @@ function je({ open: e, onOpenChange: t, value: c, onSelect: l, onClear: u, title
|
|
|
555
557
|
}
|
|
556
558
|
//#endregion
|
|
557
559
|
//#region src/components/ui/popover.tsx
|
|
558
|
-
function
|
|
559
|
-
return /* @__PURE__ */
|
|
560
|
+
function Fe({ ...e }) {
|
|
561
|
+
return /* @__PURE__ */ v(D.Root, {
|
|
560
562
|
"data-slot": "popover",
|
|
561
563
|
...e
|
|
562
564
|
});
|
|
563
565
|
}
|
|
564
|
-
function
|
|
565
|
-
return /* @__PURE__ */
|
|
566
|
+
function Ie({ ...e }) {
|
|
567
|
+
return /* @__PURE__ */ v(D.Trigger, {
|
|
566
568
|
"data-slot": "popover-trigger",
|
|
567
569
|
...e
|
|
568
570
|
});
|
|
569
571
|
}
|
|
570
|
-
function
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
+
function Le({ className: t, align: n = "center", sideOffset: r = 4, ...i }) {
|
|
573
|
+
return /* @__PURE__ */ v(D.Portal, { children: /* @__PURE__ */ v(D.Content, {
|
|
572
574
|
"data-slot": "popover-content",
|
|
573
575
|
align: n,
|
|
574
576
|
sideOffset: r,
|
|
@@ -576,28 +578,28 @@ function Pe({ className: t, align: n = "center", sideOffset: r = 4, ...i }) {
|
|
|
576
578
|
...i
|
|
577
579
|
}) });
|
|
578
580
|
}
|
|
579
|
-
function
|
|
580
|
-
return /* @__PURE__ */
|
|
581
|
+
function Re({ ...e }) {
|
|
582
|
+
return /* @__PURE__ */ v(D.Anchor, {
|
|
581
583
|
"data-slot": "popover-anchor",
|
|
582
584
|
...e
|
|
583
585
|
});
|
|
584
586
|
}
|
|
585
|
-
function
|
|
586
|
-
return /* @__PURE__ */
|
|
587
|
+
function ze({ className: t, ...n }) {
|
|
588
|
+
return /* @__PURE__ */ v("div", {
|
|
587
589
|
"data-slot": "popover-header",
|
|
588
590
|
className: e("flex flex-col gap-1 text-sm", t),
|
|
589
591
|
...n
|
|
590
592
|
});
|
|
591
593
|
}
|
|
592
|
-
function
|
|
593
|
-
return /* @__PURE__ */
|
|
594
|
+
function Be({ className: t, ...n }) {
|
|
595
|
+
return /* @__PURE__ */ v("div", {
|
|
594
596
|
"data-slot": "popover-title",
|
|
595
597
|
className: e("font-medium", t),
|
|
596
598
|
...n
|
|
597
599
|
});
|
|
598
600
|
}
|
|
599
|
-
function
|
|
600
|
-
return /* @__PURE__ */
|
|
601
|
+
function Ve({ className: t, ...n }) {
|
|
602
|
+
return /* @__PURE__ */ v("p", {
|
|
601
603
|
"data-slot": "popover-description",
|
|
602
604
|
className: e("text-muted-foreground", t),
|
|
603
605
|
...n
|
|
@@ -605,35 +607,35 @@ function Re({ className: t, ...n }) {
|
|
|
605
607
|
}
|
|
606
608
|
//#endregion
|
|
607
609
|
//#region src/components/ui/resizable.tsx
|
|
608
|
-
function
|
|
609
|
-
return /* @__PURE__ */
|
|
610
|
+
function He({ className: t, ...n }) {
|
|
611
|
+
return /* @__PURE__ */ v(O, {
|
|
610
612
|
"data-slot": "resizable-panel-group",
|
|
611
613
|
className: e("flex h-full w-full", t),
|
|
612
614
|
...n
|
|
613
615
|
});
|
|
614
616
|
}
|
|
615
|
-
function
|
|
616
|
-
return /* @__PURE__ */
|
|
617
|
+
function Ue({ overflowHidden: t, className: n, ...r }) {
|
|
618
|
+
return /* @__PURE__ */ v(k, {
|
|
617
619
|
"data-slot": "resizable-panel",
|
|
618
620
|
className: e(t && "[&>div]:overflow-hidden!", n),
|
|
619
621
|
style: t ? { overflow: "hidden" } : void 0,
|
|
620
622
|
...r
|
|
621
623
|
});
|
|
622
624
|
}
|
|
623
|
-
function
|
|
624
|
-
return /* @__PURE__ */
|
|
625
|
+
function We({ withHandle: t, className: n, ...r }) {
|
|
626
|
+
return /* @__PURE__ */ v(A, {
|
|
625
627
|
"data-slot": "resizable-handle",
|
|
626
628
|
className: e("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:-left-2 after:-right-2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden", "[&[aria-orientation=horizontal]]:h-px [&[aria-orientation=horizontal]]:w-full [&[aria-orientation=horizontal]]:after:inset-x-0 [&[aria-orientation=horizontal]]:after:-top-2 [&[aria-orientation=horizontal]]:after:-bottom-2 [&[aria-orientation=horizontal]>div]:rotate-90", n),
|
|
627
629
|
...r,
|
|
628
|
-
children: t && /* @__PURE__ */
|
|
630
|
+
children: t && /* @__PURE__ */ v("div", {
|
|
629
631
|
className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border",
|
|
630
|
-
children: /* @__PURE__ */
|
|
632
|
+
children: /* @__PURE__ */ v(de, { className: "size-2.5" })
|
|
631
633
|
})
|
|
632
634
|
});
|
|
633
635
|
}
|
|
634
636
|
//#endregion
|
|
635
637
|
//#region src/components/ui/section-card.tsx
|
|
636
|
-
var
|
|
638
|
+
var Y = {
|
|
637
639
|
blue: {
|
|
638
640
|
color: "text-blue-600 dark:text-blue-400",
|
|
639
641
|
bg: "from-blue-500/10 to-indigo-500/10 dark:from-blue-500/20 dark:to-indigo-500/20",
|
|
@@ -674,139 +676,139 @@ var X = {
|
|
|
674
676
|
bg: "from-slate-500/10 to-gray-500/10 dark:from-slate-500/20 dark:to-gray-500/20",
|
|
675
677
|
ring: "ring-slate-500/10 dark:ring-slate-400/10"
|
|
676
678
|
}
|
|
677
|
-
},
|
|
679
|
+
}, X = f({
|
|
678
680
|
open: !0,
|
|
679
681
|
toggle: () => {},
|
|
680
682
|
variant: "blue"
|
|
681
683
|
});
|
|
682
|
-
function
|
|
683
|
-
let [a, o] =
|
|
684
|
-
return /* @__PURE__ */
|
|
684
|
+
function Z({ variant: t = "blue", defaultOpen: n = !0, children: r, className: i }) {
|
|
685
|
+
let [a, o] = g(n);
|
|
686
|
+
return /* @__PURE__ */ v(X.Provider, {
|
|
685
687
|
value: {
|
|
686
688
|
open: a,
|
|
687
689
|
toggle: () => o((e) => !e),
|
|
688
690
|
variant: t
|
|
689
691
|
},
|
|
690
|
-
children: /* @__PURE__ */
|
|
692
|
+
children: /* @__PURE__ */ v("div", {
|
|
691
693
|
className: e("rounded-xl border overflow-hidden", i),
|
|
692
694
|
children: r
|
|
693
695
|
})
|
|
694
696
|
});
|
|
695
697
|
}
|
|
696
|
-
function
|
|
697
|
-
let { open: a, toggle: o, variant: s } = p(
|
|
698
|
-
return /* @__PURE__ */
|
|
698
|
+
function Ge({ icon: t, title: n, description: r, className: i }) {
|
|
699
|
+
let { open: a, toggle: o, variant: s } = p(X), c = Y[s];
|
|
700
|
+
return /* @__PURE__ */ y("button", {
|
|
699
701
|
type: "button",
|
|
700
702
|
onClick: o,
|
|
701
703
|
className: e("flex w-full items-center gap-3 px-5 py-4 bg-muted/40 border-b cursor-pointer hover:bg-muted/60 transition-colors", i),
|
|
702
704
|
children: [
|
|
703
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ v("div", {
|
|
704
706
|
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${c.bg} ring-1 ${c.ring}`,
|
|
705
|
-
children: /* @__PURE__ */
|
|
707
|
+
children: /* @__PURE__ */ v(t, { className: `size-4 ${c.color}` })
|
|
706
708
|
}),
|
|
707
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ y("div", {
|
|
708
710
|
className: "min-w-0 text-left",
|
|
709
|
-
children: [/* @__PURE__ */
|
|
711
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
710
712
|
className: "text-sm font-semibold text-foreground",
|
|
711
713
|
children: n
|
|
712
|
-
}), r && /* @__PURE__ */
|
|
714
|
+
}), r && /* @__PURE__ */ v("p", {
|
|
713
715
|
className: "text-xs text-muted-foreground",
|
|
714
716
|
children: r
|
|
715
717
|
})]
|
|
716
718
|
}),
|
|
717
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ v(T, { className: e("ml-auto size-4 text-muted-foreground shrink-0 transition-transform duration-200", a && "rotate-180") })
|
|
718
720
|
]
|
|
719
721
|
});
|
|
720
722
|
}
|
|
721
|
-
function
|
|
722
|
-
let { variant: a } = p(
|
|
723
|
-
return /* @__PURE__ */
|
|
723
|
+
function Ke({ icon: t, title: n, description: r, className: i }) {
|
|
724
|
+
let { variant: a } = p(X), o = Y[a];
|
|
725
|
+
return /* @__PURE__ */ y("div", {
|
|
724
726
|
className: e("flex items-center gap-3 px-5 py-4 bg-muted/40 border-b", i),
|
|
725
|
-
children: [/* @__PURE__ */
|
|
727
|
+
children: [/* @__PURE__ */ v("div", {
|
|
726
728
|
className: `flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-linear-to-br ${o.bg} ring-1 ${o.ring}`,
|
|
727
|
-
children: /* @__PURE__ */
|
|
728
|
-
}), /* @__PURE__ */
|
|
729
|
+
children: /* @__PURE__ */ v(t, { className: `size-4 ${o.color}` })
|
|
730
|
+
}), /* @__PURE__ */ y("div", {
|
|
729
731
|
className: "min-w-0",
|
|
730
|
-
children: [/* @__PURE__ */
|
|
732
|
+
children: [/* @__PURE__ */ v("h3", {
|
|
731
733
|
className: "text-sm font-semibold text-foreground",
|
|
732
734
|
children: n
|
|
733
|
-
}), r && /* @__PURE__ */
|
|
735
|
+
}), r && /* @__PURE__ */ v("p", {
|
|
734
736
|
className: "text-xs text-muted-foreground",
|
|
735
737
|
children: r
|
|
736
738
|
})]
|
|
737
739
|
})]
|
|
738
740
|
});
|
|
739
741
|
}
|
|
740
|
-
function
|
|
741
|
-
let { open: r } = p(
|
|
742
|
-
return r ? /* @__PURE__ */
|
|
742
|
+
function qe({ children: t, className: n }) {
|
|
743
|
+
let { open: r } = p(X);
|
|
744
|
+
return r ? /* @__PURE__ */ v("div", {
|
|
743
745
|
className: e("p-5 space-y-6", n),
|
|
744
746
|
children: t
|
|
745
747
|
}) : null;
|
|
746
748
|
}
|
|
747
|
-
|
|
749
|
+
Z.Header = Ge, Z.StaticHeader = Ke, Z.Content = qe;
|
|
748
750
|
//#endregion
|
|
749
751
|
//#region src/components/ui/tooltip.tsx
|
|
750
|
-
var
|
|
751
|
-
function
|
|
752
|
-
return /* @__PURE__ */
|
|
752
|
+
var Je = u.createContext(!1);
|
|
753
|
+
function Ye({ delayDuration: e = 0, ...t }) {
|
|
754
|
+
return /* @__PURE__ */ v(Je, {
|
|
753
755
|
value: !0,
|
|
754
|
-
children: /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ v(j.Provider, {
|
|
755
757
|
"data-slot": "tooltip-provider",
|
|
756
758
|
delayDuration: e,
|
|
757
759
|
...t
|
|
758
760
|
})
|
|
759
761
|
});
|
|
760
762
|
}
|
|
761
|
-
function
|
|
762
|
-
let t = u.useContext(
|
|
763
|
+
function Xe({ ...e }) {
|
|
764
|
+
let t = u.useContext(Je), n = /* @__PURE__ */ v(j.Root, {
|
|
763
765
|
"data-slot": "tooltip",
|
|
764
766
|
...e
|
|
765
767
|
});
|
|
766
|
-
return t ? n : /* @__PURE__ */
|
|
768
|
+
return t ? n : /* @__PURE__ */ v(Ye, { children: n });
|
|
767
769
|
}
|
|
768
|
-
function
|
|
769
|
-
return /* @__PURE__ */
|
|
770
|
+
function Ze({ ...e }) {
|
|
771
|
+
return /* @__PURE__ */ v(j.Trigger, {
|
|
770
772
|
"data-slot": "tooltip-trigger",
|
|
771
773
|
...e
|
|
772
774
|
});
|
|
773
775
|
}
|
|
774
|
-
function
|
|
775
|
-
return /* @__PURE__ */
|
|
776
|
+
function Qe({ className: t, sideOffset: n = 0, children: r, ...i }) {
|
|
777
|
+
return /* @__PURE__ */ v(j.Portal, { children: /* @__PURE__ */ y(j.Content, {
|
|
776
778
|
"data-slot": "tooltip-content",
|
|
777
779
|
sideOffset: n,
|
|
778
780
|
className: e("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance", t),
|
|
779
781
|
...i,
|
|
780
|
-
children: [r, /* @__PURE__ */
|
|
782
|
+
children: [r, /* @__PURE__ */ v(j.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })]
|
|
781
783
|
}) });
|
|
782
784
|
}
|
|
783
785
|
//#endregion
|
|
784
786
|
//#region src/hooks/use-mobile.ts
|
|
785
|
-
var
|
|
786
|
-
function
|
|
787
|
-
return window.matchMedia(
|
|
787
|
+
var $e = "(max-width: 767px)";
|
|
788
|
+
function Q() {
|
|
789
|
+
return window.matchMedia($e);
|
|
788
790
|
}
|
|
789
|
-
function
|
|
790
|
-
let t =
|
|
791
|
+
function et(e) {
|
|
792
|
+
let t = Q();
|
|
791
793
|
return t.addEventListener("change", e), () => t.removeEventListener("change", e);
|
|
792
794
|
}
|
|
793
|
-
function
|
|
794
|
-
return u.useSyncExternalStore(
|
|
795
|
+
function tt() {
|
|
796
|
+
return u.useSyncExternalStore(et, () => Q().matches, () => !1);
|
|
795
797
|
}
|
|
796
798
|
//#endregion
|
|
797
799
|
//#region src/components/ui/sonner.tsx
|
|
798
|
-
var
|
|
799
|
-
let { theme: t = "system" } =
|
|
800
|
-
return /* @__PURE__ */
|
|
800
|
+
var nt = ({ ...e }) => {
|
|
801
|
+
let { theme: t = "system" } = M(), { t: n } = te();
|
|
802
|
+
return /* @__PURE__ */ v(N, {
|
|
801
803
|
theme: t,
|
|
802
804
|
className: "toaster group",
|
|
803
805
|
containerAriaLabel: n("common.notifications", { defaultValue: "Notifications" }),
|
|
804
806
|
icons: {
|
|
805
|
-
success: /* @__PURE__ */
|
|
806
|
-
info: /* @__PURE__ */
|
|
807
|
-
warning: /* @__PURE__ */
|
|
808
|
-
error: /* @__PURE__ */
|
|
809
|
-
loading: /* @__PURE__ */
|
|
807
|
+
success: /* @__PURE__ */ v(ce, { className: "size-4" }),
|
|
808
|
+
info: /* @__PURE__ */ v(fe, { className: "size-4" }),
|
|
809
|
+
warning: /* @__PURE__ */ v(he, { className: "size-4" }),
|
|
810
|
+
error: /* @__PURE__ */ v(me, { className: "size-4" }),
|
|
811
|
+
loading: /* @__PURE__ */ v(pe, { className: "size-4 animate-spin" })
|
|
810
812
|
},
|
|
811
813
|
style: {
|
|
812
814
|
"--normal-bg": "var(--vg-popover)",
|
|
@@ -819,37 +821,108 @@ var $e = ({ ...e }) => {
|
|
|
819
821
|
};
|
|
820
822
|
//#endregion
|
|
821
823
|
//#region src/components/ui/tabs.tsx
|
|
822
|
-
function
|
|
823
|
-
return /* @__PURE__ */
|
|
824
|
+
function rt({ className: t, ...n }) {
|
|
825
|
+
return /* @__PURE__ */ v(F.Root, {
|
|
824
826
|
"data-slot": "tabs",
|
|
825
827
|
className: e("flex flex-col gap-2", t),
|
|
826
828
|
...n
|
|
827
829
|
});
|
|
828
830
|
}
|
|
829
|
-
function
|
|
830
|
-
return /* @__PURE__ */
|
|
831
|
+
function it({ className: t, ...n }) {
|
|
832
|
+
return /* @__PURE__ */ v(F.List, {
|
|
831
833
|
"data-slot": "tabs-list",
|
|
832
834
|
className: e("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]", t),
|
|
833
835
|
...n
|
|
834
836
|
});
|
|
835
837
|
}
|
|
836
|
-
function
|
|
837
|
-
return /* @__PURE__ */
|
|
838
|
+
function at({ className: t, ...n }) {
|
|
839
|
+
return /* @__PURE__ */ v(F.Trigger, {
|
|
838
840
|
"data-slot": "tabs-trigger",
|
|
839
841
|
className: e("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", t),
|
|
840
842
|
...n
|
|
841
843
|
});
|
|
842
844
|
}
|
|
843
|
-
function
|
|
844
|
-
return /* @__PURE__ */
|
|
845
|
+
function ot({ className: t, ...n }) {
|
|
846
|
+
return /* @__PURE__ */ v(F.Content, {
|
|
845
847
|
"data-slot": "tabs-content",
|
|
846
848
|
className: e("flex-1 outline-none", t),
|
|
847
849
|
...n
|
|
848
850
|
});
|
|
849
851
|
}
|
|
850
852
|
//#endregion
|
|
853
|
+
//#region src/components/ui/toggle.tsx
|
|
854
|
+
var $ = S("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap", {
|
|
855
|
+
variants: {
|
|
856
|
+
variant: {
|
|
857
|
+
default: "bg-transparent",
|
|
858
|
+
outline: "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"
|
|
859
|
+
},
|
|
860
|
+
size: {
|
|
861
|
+
default: "h-(--vg-control-form) px-2 min-w-(--vg-control-form)",
|
|
862
|
+
sm: "h-(--vg-control-dense) px-1.5 min-w-(--vg-control-dense)",
|
|
863
|
+
lg: "h-(--vg-control-form) px-2.5 min-w-(--vg-control-form)"
|
|
864
|
+
}
|
|
865
|
+
},
|
|
866
|
+
defaultVariants: {
|
|
867
|
+
variant: "default",
|
|
868
|
+
size: "default"
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
function st({ className: t, variant: n, size: r, ...i }) {
|
|
872
|
+
return /* @__PURE__ */ v(I.Root, {
|
|
873
|
+
"data-slot": "toggle",
|
|
874
|
+
className: e($({
|
|
875
|
+
variant: n,
|
|
876
|
+
size: r,
|
|
877
|
+
className: t
|
|
878
|
+
})),
|
|
879
|
+
...i
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
//#endregion
|
|
883
|
+
//#region src/components/ui/toggle-group.tsx
|
|
884
|
+
var ct = u.createContext({
|
|
885
|
+
size: "default",
|
|
886
|
+
variant: "default",
|
|
887
|
+
spacing: 0
|
|
888
|
+
});
|
|
889
|
+
function lt({ className: t, variant: n, size: r, spacing: i = 0, children: a, ...o }) {
|
|
890
|
+
return /* @__PURE__ */ v(L.Root, {
|
|
891
|
+
"data-slot": "toggle-group",
|
|
892
|
+
"data-variant": n,
|
|
893
|
+
"data-size": r,
|
|
894
|
+
"data-spacing": i,
|
|
895
|
+
style: { "--gap": i },
|
|
896
|
+
className: e("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs", t),
|
|
897
|
+
...o,
|
|
898
|
+
children: /* @__PURE__ */ v(ct.Provider, {
|
|
899
|
+
value: {
|
|
900
|
+
variant: n,
|
|
901
|
+
size: r,
|
|
902
|
+
spacing: i
|
|
903
|
+
},
|
|
904
|
+
children: a
|
|
905
|
+
})
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
function ut({ className: t, children: n, variant: r, size: i, ...a }) {
|
|
909
|
+
let o = u.useContext(ct);
|
|
910
|
+
return /* @__PURE__ */ v(L.Item, {
|
|
911
|
+
"data-slot": "toggle-group-item",
|
|
912
|
+
"data-variant": o.variant || r,
|
|
913
|
+
"data-size": o.size || i,
|
|
914
|
+
"data-spacing": o.spacing,
|
|
915
|
+
className: e($({
|
|
916
|
+
variant: o.variant || r,
|
|
917
|
+
size: o.size || i
|
|
918
|
+
}), "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10", "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l", t),
|
|
919
|
+
...a,
|
|
920
|
+
children: n
|
|
921
|
+
});
|
|
922
|
+
}
|
|
923
|
+
//#endregion
|
|
851
924
|
//#region src/components/ui/user-avatar.tsx
|
|
852
|
-
function
|
|
925
|
+
function dt({ givenName: e, familyName: t, name: n }) {
|
|
853
926
|
let r = (e ?? "").trim(), i = (t ?? "").trim();
|
|
854
927
|
if (r || i) {
|
|
855
928
|
let e = r ? r[0] : "", t = i.split(/\s+/).filter(Boolean), n = `${e}${t.length > 0 ? t[t.length - 1][0] : ""}`.toUpperCase();
|
|
@@ -862,22 +935,22 @@ function it({ givenName: e, familyName: t, name: n }) {
|
|
|
862
935
|
}
|
|
863
936
|
return "U";
|
|
864
937
|
}
|
|
865
|
-
function
|
|
866
|
-
let l =
|
|
938
|
+
function ft({ className: t, givenName: n, familyName: r, name: i, src: a, alt: o, children: s, ...c }) {
|
|
939
|
+
let l = dt({
|
|
867
940
|
givenName: n,
|
|
868
941
|
familyName: r,
|
|
869
942
|
name: i
|
|
870
943
|
}), u = o ?? i ?? [n, r].filter(Boolean).join(" ");
|
|
871
|
-
return /* @__PURE__ */
|
|
944
|
+
return /* @__PURE__ */ y(b.Root, {
|
|
872
945
|
"data-slot": "user-avatar",
|
|
873
946
|
className: e("relative inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full size-8", "bg-muted text-muted-foreground text-xs font-semibold", "ring-1 ring-border", t),
|
|
874
947
|
...c,
|
|
875
|
-
children: [a && /* @__PURE__ */
|
|
948
|
+
children: [a && /* @__PURE__ */ v(b.Image, {
|
|
876
949
|
"data-slot": "user-avatar-image",
|
|
877
950
|
src: a,
|
|
878
951
|
alt: u,
|
|
879
952
|
className: "aspect-square size-full object-cover"
|
|
880
|
-
}), /* @__PURE__ */
|
|
953
|
+
}), /* @__PURE__ */ v(b.Fallback, {
|
|
881
954
|
"data-slot": "user-avatar-fallback",
|
|
882
955
|
className: "flex size-full items-center justify-center",
|
|
883
956
|
delayMs: a ? 600 : 0,
|
|
@@ -887,18 +960,18 @@ function at({ className: t, givenName: n, familyName: r, name: i, src: a, alt: o
|
|
|
887
960
|
}
|
|
888
961
|
//#endregion
|
|
889
962
|
//#region src/lib/corner-slot.ts
|
|
890
|
-
var
|
|
891
|
-
function
|
|
892
|
-
return p(
|
|
963
|
+
var pt = f(!1);
|
|
964
|
+
function mt() {
|
|
965
|
+
return p(pt);
|
|
893
966
|
}
|
|
894
|
-
var
|
|
895
|
-
function
|
|
896
|
-
return p(
|
|
967
|
+
var ht = f("corner");
|
|
968
|
+
function gt() {
|
|
969
|
+
return p(ht);
|
|
897
970
|
}
|
|
898
971
|
//#endregion
|
|
899
972
|
//#region src/contexts/user.context.tsx
|
|
900
|
-
var
|
|
901
|
-
function
|
|
973
|
+
var _t = d.createContext(null);
|
|
974
|
+
function vt({ children: e, fetchUser: t }) {
|
|
902
975
|
let [n, r] = d.useState({}), [i, a] = d.useState("loading"), [o, s] = d.useState(null), c = d.useRef(0), l = d.useCallback(() => {
|
|
903
976
|
let e = ++c.current;
|
|
904
977
|
t().then((t) => {
|
|
@@ -921,15 +994,15 @@ function dt({ children: e, fetchUser: t }) {
|
|
|
921
994
|
i,
|
|
922
995
|
o
|
|
923
996
|
]);
|
|
924
|
-
return /* @__PURE__ */
|
|
997
|
+
return /* @__PURE__ */ v(_t, {
|
|
925
998
|
value: u,
|
|
926
999
|
children: e
|
|
927
1000
|
});
|
|
928
1001
|
}
|
|
929
|
-
function
|
|
930
|
-
let e = d.useContext(
|
|
1002
|
+
function yt() {
|
|
1003
|
+
let e = d.useContext(_t);
|
|
931
1004
|
if (!e) throw Error("useCurrentUser must be used within UserProvider");
|
|
932
1005
|
return e;
|
|
933
1006
|
}
|
|
934
1007
|
//#endregion
|
|
935
|
-
export {
|
|
1008
|
+
export { ge as $, Re as A, Se as B, Ze as C, Ue as D, We as E, Ie as F, Ee as G, De as H, Pe as I, Ae as J, Oe as K, ve as L, Ve as M, ze as N, He as O, Be as P, _e as Q, we as R, Ye as S, Y as T, ye as U, Ce as V, Te as W, je as X, Me as Y, be as Z, nt as _, gt as a, Xe as b, dt as c, st as d, K as et, $ as f, at as g, it as h, ht as i, Le as j, Fe as k, lt as l, ot as m, yt as n, z as nt, mt as o, rt as p, ke as q, pt as r, ft as s, vt as t, oe as tt, ut as u, P as v, Z as w, Qe as x, tt as y, xe as z };
|