@epfl-sti/poesis 0.1.2 → 0.1.4
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/dist/components/ui/Select.d.ts.map +1 -1
- package/dist/poesis.js +180 -175
- package/dist/poesis.js.map +1 -1
- package/package.json +1 -1
package/dist/poesis.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useState as N, forwardRef as C, useId as I, useRef as D, useCallback as k, useEffect as $, createContext as S, useContext as A, useSyncExternalStore as ue, useMemo as L } from "react";
|
|
3
3
|
import { useTranslation as Z } from "react-i18next";
|
|
4
4
|
import { jsx as e, jsxs as m, Fragment as B } from "react/jsx-runtime";
|
|
5
|
-
import { SunFill as be, MoonFill as pe, List as fe, ChevronDown as ee, XLg as xe, SortDown as ge, SortNumericDown as he, SortNumericDownAlt as ye, SortAlphaDown as ve, SortAlphaDownAlt as we, InfoCircleFill as te, XCircleFill as re, ExclamationTriangleFill as
|
|
5
|
+
import { SunFill as be, MoonFill as pe, List as fe, ChevronDown as ee, XLg as xe, SortDown as ge, SortNumericDown as he, SortNumericDownAlt as ye, SortAlphaDown as ve, SortAlphaDownAlt as we, InfoCircleFill as te, XCircleFill as re, ExclamationTriangleFill as R, CheckCircleFill as ne, X as M } from "react-bootstrap-icons";
|
|
6
6
|
import { createPortal as Ne } from "react-dom";
|
|
7
7
|
import { useFloating as O, autoUpdate as V, offset as U, flip as H, shift as q, useClick as oe, useDismiss as K, useRole as G, useListNavigation as ke, useInteractions as X, FloatingPortal as Y, FloatingFocusManager as ie, arrow as Ce, useHover as ze, useFocus as $e } from "@floating-ui/react";
|
|
8
8
|
import De from "react-select";
|
|
@@ -15,7 +15,7 @@ function je(t) {
|
|
|
15
15
|
const r = t.trim().split(/\s+/);
|
|
16
16
|
return r.length === 0 ? "?" : r.length === 1 ? r[0][0].toUpperCase() : (r[0][0] + r[r.length - 1][0]).toUpperCase();
|
|
17
17
|
}
|
|
18
|
-
function wt({ src: t, name: r, size: o = "md", alt: n, className:
|
|
18
|
+
function wt({ src: t, name: r, size: o = "md", alt: n, className: i = "", ...s }) {
|
|
19
19
|
const [a, c] = N(!1), d = !!t && !a;
|
|
20
20
|
return /* @__PURE__ */ e(
|
|
21
21
|
"span",
|
|
@@ -26,9 +26,9 @@ function wt({ src: t, name: r, size: o = "md", alt: n, className: s = "", ...i }
|
|
|
26
26
|
"inline-flex items-center justify-center rounded-full overflow-hidden",
|
|
27
27
|
"bg-primary text-white font-semibold select-none shrink-0",
|
|
28
28
|
Ie[o],
|
|
29
|
-
|
|
29
|
+
i
|
|
30
30
|
].join(" "),
|
|
31
|
-
...
|
|
31
|
+
...s,
|
|
32
32
|
children: d ? /* @__PURE__ */ e(
|
|
33
33
|
"img",
|
|
34
34
|
{
|
|
@@ -54,13 +54,13 @@ const Fe = {
|
|
|
54
54
|
error: "bg-error",
|
|
55
55
|
info: "bg-info"
|
|
56
56
|
};
|
|
57
|
-
function Nt({ color: t = "default", dot: r, className: o = "", children: n, ...
|
|
57
|
+
function Nt({ color: t = "default", dot: r, className: o = "", children: n, ...i }) {
|
|
58
58
|
return r ? /* @__PURE__ */ e(
|
|
59
59
|
"span",
|
|
60
60
|
{
|
|
61
61
|
role: "status",
|
|
62
62
|
className: `inline-block size-2.5 rounded-full ${Ee[t]} ${o}`,
|
|
63
|
-
...
|
|
63
|
+
...i
|
|
64
64
|
}
|
|
65
65
|
) : /* @__PURE__ */ e(
|
|
66
66
|
"span",
|
|
@@ -71,7 +71,7 @@ function Nt({ color: t = "default", dot: r, className: o = "", children: n, ...s
|
|
|
71
71
|
Fe[t],
|
|
72
72
|
o
|
|
73
73
|
].join(" "),
|
|
74
|
-
...
|
|
74
|
+
...i,
|
|
75
75
|
children: n
|
|
76
76
|
}
|
|
77
77
|
);
|
|
@@ -133,14 +133,14 @@ const Ae = {
|
|
|
133
133
|
variant: r = "primary",
|
|
134
134
|
size: o = "md",
|
|
135
135
|
loading: n = !1,
|
|
136
|
-
disabled:
|
|
137
|
-
iconLeft:
|
|
136
|
+
disabled: i,
|
|
137
|
+
iconLeft: s,
|
|
138
138
|
iconRight: a,
|
|
139
139
|
className: c = "",
|
|
140
140
|
children: d,
|
|
141
141
|
...l
|
|
142
142
|
}, u) {
|
|
143
|
-
const b =
|
|
143
|
+
const b = i || n;
|
|
144
144
|
return /* @__PURE__ */ m(
|
|
145
145
|
"button",
|
|
146
146
|
{
|
|
@@ -162,7 +162,7 @@ const Ae = {
|
|
|
162
162
|
].filter(Boolean).join(" "),
|
|
163
163
|
...l,
|
|
164
164
|
children: [
|
|
165
|
-
n ? /* @__PURE__ */ e(se, { size: Be[o], "aria-hidden": "true" }) :
|
|
165
|
+
n ? /* @__PURE__ */ e(se, { size: Be[o], "aria-hidden": "true" }) : s,
|
|
166
166
|
d,
|
|
167
167
|
!n && a
|
|
168
168
|
]
|
|
@@ -173,12 +173,12 @@ const Ae = {
|
|
|
173
173
|
secondary: "border border-border text-text-primary bg-bg-primary hover:bg-bg-tertiary focus-visible:ring-primary",
|
|
174
174
|
ghost: "text-text-primary hover:bg-bg-tertiary focus-visible:ring-primary",
|
|
175
175
|
danger: "bg-error text-white hover:opacity-90 focus-visible:ring-error"
|
|
176
|
-
},
|
|
176
|
+
}, Te = {
|
|
177
177
|
sm: "size-7 text-small",
|
|
178
178
|
md: "size-9 text-body",
|
|
179
179
|
lg: "size-11 text-body"
|
|
180
|
-
},
|
|
181
|
-
const l =
|
|
180
|
+
}, Re = C(function({ variant: r = "ghost", size: o = "md", loading: n = !1, disabled: i, icon: s, className: a = "", ...c }, d) {
|
|
181
|
+
const l = i || n;
|
|
182
182
|
return /* @__PURE__ */ e(
|
|
183
183
|
"button",
|
|
184
184
|
{
|
|
@@ -193,26 +193,26 @@ const Ae = {
|
|
|
193
193
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2",
|
|
194
194
|
// variant + size
|
|
195
195
|
Le[r],
|
|
196
|
-
|
|
196
|
+
Te[o],
|
|
197
197
|
// disabled / loading
|
|
198
198
|
l && "opacity-50 pointer-events-none",
|
|
199
199
|
a
|
|
200
200
|
].filter(Boolean).join(" "),
|
|
201
201
|
...c,
|
|
202
|
-
children: n ? /* @__PURE__ */ e(se, { size: "sm", "aria-hidden": "true" }) :
|
|
202
|
+
children: n ? /* @__PURE__ */ e(se, { size: "sm", "aria-hidden": "true" }) : s
|
|
203
203
|
}
|
|
204
204
|
);
|
|
205
205
|
}), Ct = C(function({
|
|
206
206
|
label: r,
|
|
207
207
|
indeterminate: o = !1,
|
|
208
208
|
helperText: n,
|
|
209
|
-
error:
|
|
210
|
-
className:
|
|
209
|
+
error: i,
|
|
210
|
+
className: s = "",
|
|
211
211
|
id: a,
|
|
212
212
|
disabled: c,
|
|
213
213
|
...d
|
|
214
214
|
}, l) {
|
|
215
|
-
const u = I(), b = a ?? u, h = `${b}-helper`, p = !!
|
|
215
|
+
const u = I(), b = a ?? u, h = `${b}-helper`, p = !!i, y = D(null), f = k(
|
|
216
216
|
(v) => {
|
|
217
217
|
y.current = v, typeof l == "function" ? l(v) : l && (l.current = v);
|
|
218
218
|
},
|
|
@@ -220,7 +220,7 @@ const Ae = {
|
|
|
220
220
|
);
|
|
221
221
|
return $(() => {
|
|
222
222
|
y.current && (y.current.indeterminate = o);
|
|
223
|
-
}, [o]), /* @__PURE__ */ m("div", { className: `flex flex-col gap-1 ${
|
|
223
|
+
}, [o]), /* @__PURE__ */ m("div", { className: `flex flex-col gap-1 ${s}`, children: [
|
|
224
224
|
/* @__PURE__ */ m("div", { className: "flex items-start gap-2", children: [
|
|
225
225
|
/* @__PURE__ */ e(
|
|
226
226
|
"input",
|
|
@@ -230,7 +230,7 @@ const Ae = {
|
|
|
230
230
|
type: "checkbox",
|
|
231
231
|
disabled: c,
|
|
232
232
|
"aria-invalid": p || void 0,
|
|
233
|
-
"aria-describedby": n ||
|
|
233
|
+
"aria-describedby": n || i ? h : void 0,
|
|
234
234
|
className: [
|
|
235
235
|
"mt-0.5 size-4 shrink-0 cursor-pointer rounded-sm border appearance-none",
|
|
236
236
|
"bg-bg-primary transition-colors",
|
|
@@ -256,12 +256,12 @@ const Ae = {
|
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
258
|
] }),
|
|
259
|
-
(n ||
|
|
259
|
+
(n || i) && /* @__PURE__ */ e(
|
|
260
260
|
"p",
|
|
261
261
|
{
|
|
262
262
|
id: h,
|
|
263
263
|
className: `text-caption pl-6 ${p ? "text-error" : "text-text-secondary"}`,
|
|
264
|
-
children:
|
|
264
|
+
children: i ?? n
|
|
265
265
|
}
|
|
266
266
|
)
|
|
267
267
|
] });
|
|
@@ -285,8 +285,8 @@ const Ae = {
|
|
|
285
285
|
label: r,
|
|
286
286
|
helperText: o,
|
|
287
287
|
error: n,
|
|
288
|
-
leftIcon:
|
|
289
|
-
rightIcon:
|
|
288
|
+
leftIcon: i,
|
|
289
|
+
rightIcon: s,
|
|
290
290
|
inputSize: a = "md",
|
|
291
291
|
className: c = "",
|
|
292
292
|
id: d,
|
|
@@ -297,12 +297,12 @@ const Ae = {
|
|
|
297
297
|
return /* @__PURE__ */ m("div", { className: `flex flex-col gap-1.5 ${c}`, children: [
|
|
298
298
|
r && /* @__PURE__ */ e("label", { htmlFor: p, className: "text-small font-medium text-text-primary", children: r }),
|
|
299
299
|
/* @__PURE__ */ m("div", { className: "relative", children: [
|
|
300
|
-
|
|
300
|
+
i && /* @__PURE__ */ e(
|
|
301
301
|
"span",
|
|
302
302
|
{
|
|
303
303
|
className: `pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3 text-text-secondary ${J[a]}`,
|
|
304
304
|
"aria-hidden": "true",
|
|
305
|
-
children:
|
|
305
|
+
children: i
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
308
|
/* @__PURE__ */ e(
|
|
@@ -320,18 +320,18 @@ const Ae = {
|
|
|
320
320
|
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-bg-secondary",
|
|
321
321
|
f ? "border-error focus:border-error focus:ring-error" : "border-border hover:border-border-strong",
|
|
322
322
|
Me[a],
|
|
323
|
-
|
|
324
|
-
|
|
323
|
+
i ? Oe[a] : "",
|
|
324
|
+
s ? Ve[a] : ""
|
|
325
325
|
].join(" "),
|
|
326
326
|
...u
|
|
327
327
|
}
|
|
328
328
|
),
|
|
329
|
-
|
|
329
|
+
s && /* @__PURE__ */ e(
|
|
330
330
|
"span",
|
|
331
331
|
{
|
|
332
332
|
className: `pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-text-secondary ${J[a]}`,
|
|
333
333
|
"aria-hidden": "true",
|
|
334
|
-
children:
|
|
334
|
+
children: s
|
|
335
335
|
}
|
|
336
336
|
)
|
|
337
337
|
] }),
|
|
@@ -355,19 +355,19 @@ function He({
|
|
|
355
355
|
value: r,
|
|
356
356
|
onChange: o,
|
|
357
357
|
label: n,
|
|
358
|
-
helperText:
|
|
359
|
-
error:
|
|
358
|
+
helperText: i,
|
|
359
|
+
error: s,
|
|
360
360
|
orientation: a = "vertical",
|
|
361
361
|
disabled: c = !1,
|
|
362
362
|
children: d,
|
|
363
363
|
className: l = ""
|
|
364
364
|
}) {
|
|
365
|
-
const u = I(), b = t ?? u, p = `${`${b}-group`}-helper`, y = !!
|
|
365
|
+
const u = I(), b = t ?? u, p = `${`${b}-group`}-helper`, y = !!s;
|
|
366
366
|
return /* @__PURE__ */ e(ae.Provider, { value: { name: b, value: r, onChange: o, disabled: c, hasError: y }, children: /* @__PURE__ */ m(
|
|
367
367
|
"fieldset",
|
|
368
368
|
{
|
|
369
369
|
className: `flex flex-col gap-2 ${l}`,
|
|
370
|
-
"aria-describedby":
|
|
370
|
+
"aria-describedby": i || s ? p : void 0,
|
|
371
371
|
disabled: c,
|
|
372
372
|
children: [
|
|
373
373
|
n && /* @__PURE__ */ e("legend", { className: "text-small font-medium text-text-primary mb-1", children: n }),
|
|
@@ -379,12 +379,12 @@ function He({
|
|
|
379
379
|
children: d
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
|
-
(
|
|
382
|
+
(i || s) && /* @__PURE__ */ e(
|
|
383
383
|
"p",
|
|
384
384
|
{
|
|
385
385
|
id: p,
|
|
386
386
|
className: `text-caption ${y ? "text-error" : "text-text-secondary"}`,
|
|
387
|
-
children:
|
|
387
|
+
children: s ?? i
|
|
388
388
|
}
|
|
389
389
|
)
|
|
390
390
|
]
|
|
@@ -393,8 +393,8 @@ function He({
|
|
|
393
393
|
}
|
|
394
394
|
function qe({ value: t, label: r, description: o, disabled: n }) {
|
|
395
395
|
const {
|
|
396
|
-
name:
|
|
397
|
-
value:
|
|
396
|
+
name: i,
|
|
397
|
+
value: s,
|
|
398
398
|
onChange: a,
|
|
399
399
|
disabled: c,
|
|
400
400
|
hasError: d
|
|
@@ -405,9 +405,9 @@ function qe({ value: t, label: r, description: o, disabled: n }) {
|
|
|
405
405
|
{
|
|
406
406
|
id: l,
|
|
407
407
|
type: "radio",
|
|
408
|
-
name:
|
|
408
|
+
name: i,
|
|
409
409
|
value: t,
|
|
410
|
-
checked:
|
|
410
|
+
checked: s !== void 0 ? s === t : void 0,
|
|
411
411
|
disabled: u,
|
|
412
412
|
onChange: () => a?.(t),
|
|
413
413
|
className: [
|
|
@@ -473,8 +473,8 @@ const Ke = (t) => ({
|
|
|
473
473
|
option: ({ isFocused: t, isSelected: r }) => `${r ? "!bg-primary !text-white" : t ? "!bg-bg-tertiary" : ""}`,
|
|
474
474
|
multiValue: () => "!rounded-sm !bg-bg-tertiary"
|
|
475
475
|
};
|
|
476
|
-
function $t({ label: t, helperText: r, error: o, className: n = "", ...
|
|
477
|
-
const
|
|
476
|
+
function $t({ label: t, helperText: r, error: o, className: n = "", ...i }) {
|
|
477
|
+
const s = I(), a = i.inputId ?? s, c = `${a}-helper`, d = !!o;
|
|
478
478
|
return /* @__PURE__ */ m("div", { className: `flex flex-col gap-1.5 ${n}`, children: [
|
|
479
479
|
t && /* @__PURE__ */ e("label", { htmlFor: a, className: "text-small font-medium text-text-primary", children: t }),
|
|
480
480
|
/* @__PURE__ */ e(
|
|
@@ -482,6 +482,11 @@ function $t({ label: t, helperText: r, error: o, className: n = "", ...s }) {
|
|
|
482
482
|
{
|
|
483
483
|
inputId: a,
|
|
484
484
|
theme: Ke,
|
|
485
|
+
menuPortalTarget: document.body,
|
|
486
|
+
styles: {
|
|
487
|
+
menuPortal: (l) => ({ ...l, zIndex: 50 }),
|
|
488
|
+
...i.styles
|
|
489
|
+
},
|
|
485
490
|
classNames: {
|
|
486
491
|
...Q,
|
|
487
492
|
control: (l) => {
|
|
@@ -491,7 +496,7 @@ function $t({ label: t, helperText: r, error: o, className: n = "", ...s }) {
|
|
|
491
496
|
},
|
|
492
497
|
"aria-invalid": d || void 0,
|
|
493
498
|
"aria-errormessage": d ? c : void 0,
|
|
494
|
-
...
|
|
499
|
+
...i
|
|
495
500
|
}
|
|
496
501
|
),
|
|
497
502
|
(r || o) && /* @__PURE__ */ e(
|
|
@@ -504,8 +509,8 @@ function $t({ label: t, helperText: r, error: o, className: n = "", ...s }) {
|
|
|
504
509
|
)
|
|
505
510
|
] });
|
|
506
511
|
}
|
|
507
|
-
const Dt = C(function({ label: r, helperText: o, className: n = "", id:
|
|
508
|
-
const d = I(), l =
|
|
512
|
+
const Dt = C(function({ label: r, helperText: o, className: n = "", id: i, disabled: s, ...a }, c) {
|
|
513
|
+
const d = I(), l = i ?? d, u = `${l}-helper`;
|
|
509
514
|
return /* @__PURE__ */ m("div", { className: `flex flex-col gap-1 ${n}`, children: [
|
|
510
515
|
/* @__PURE__ */ m("div", { className: "flex items-center gap-3", children: [
|
|
511
516
|
/* @__PURE__ */ m("div", { className: "relative inline-flex items-center", children: [
|
|
@@ -516,7 +521,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
516
521
|
id: l,
|
|
517
522
|
type: "checkbox",
|
|
518
523
|
role: "switch",
|
|
519
|
-
disabled:
|
|
524
|
+
disabled: s,
|
|
520
525
|
"aria-describedby": o ? u : void 0,
|
|
521
526
|
className: "peer sr-only",
|
|
522
527
|
...a
|
|
@@ -532,7 +537,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
532
537
|
"peer-checked:bg-primary",
|
|
533
538
|
"peer-focus-visible:ring-2 peer-focus-visible:ring-primary peer-focus-visible:ring-offset-2 peer-focus-visible:ring-offset-bg-primary",
|
|
534
539
|
"peer-disabled:opacity-50 peer-disabled:cursor-not-allowed",
|
|
535
|
-
|
|
540
|
+
s ? "cursor-not-allowed" : "cursor-pointer",
|
|
536
541
|
// Thumb
|
|
537
542
|
"after:content-[''] after:absolute after:top-0.5 after:left-0.5",
|
|
538
543
|
"after:size-5 after:rounded-full after:bg-white after:shadow-sm",
|
|
@@ -546,7 +551,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
546
551
|
"label",
|
|
547
552
|
{
|
|
548
553
|
htmlFor: l,
|
|
549
|
-
className: `text-body select-none ${
|
|
554
|
+
className: `text-body select-none ${s ? "text-text-muted cursor-not-allowed" : "text-text-primary cursor-pointer"}`,
|
|
550
555
|
children: r
|
|
551
556
|
}
|
|
552
557
|
)
|
|
@@ -557,8 +562,8 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
557
562
|
label: r,
|
|
558
563
|
helperText: o,
|
|
559
564
|
error: n,
|
|
560
|
-
autoGrow:
|
|
561
|
-
minRows:
|
|
565
|
+
autoGrow: i = !1,
|
|
566
|
+
minRows: s = 3,
|
|
562
567
|
className: a = "",
|
|
563
568
|
id: c,
|
|
564
569
|
disabled: d,
|
|
@@ -567,8 +572,8 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
567
572
|
}, b) {
|
|
568
573
|
const h = I(), p = c ?? h, y = `${p}-helper`, f = !!n, v = D(null), w = k(() => {
|
|
569
574
|
const x = v.current;
|
|
570
|
-
!x || !
|
|
571
|
-
}, [
|
|
575
|
+
!x || !i || (x.style.height = "auto", x.style.height = `${x.scrollHeight}px`);
|
|
576
|
+
}, [i]);
|
|
572
577
|
$(() => {
|
|
573
578
|
w();
|
|
574
579
|
}, [w, u.value, u.defaultValue]);
|
|
@@ -585,7 +590,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
585
590
|
{
|
|
586
591
|
ref: g,
|
|
587
592
|
id: p,
|
|
588
|
-
rows:
|
|
593
|
+
rows: s,
|
|
589
594
|
disabled: d,
|
|
590
595
|
"aria-invalid": f || void 0,
|
|
591
596
|
"aria-describedby": o || n ? y : void 0,
|
|
@@ -597,7 +602,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
597
602
|
"px-3 py-2 text-body outline-none transition-colors",
|
|
598
603
|
"focus:border-primary focus:ring-1 focus:ring-primary",
|
|
599
604
|
"disabled:cursor-not-allowed disabled:opacity-50 disabled:bg-bg-secondary",
|
|
600
|
-
|
|
605
|
+
i ? "resize-none overflow-hidden" : "resize-y",
|
|
601
606
|
f ? "border-error focus:border-error focus:ring-error" : "border-border hover:border-border-strong"
|
|
602
607
|
].join(" "),
|
|
603
608
|
...u
|
|
@@ -623,7 +628,7 @@ const Dt = C(function({ label: r, helperText: o, className: n = "", id: s, disab
|
|
|
623
628
|
function jt() {
|
|
624
629
|
return /* @__PURE__ */ e("div", { role: "separator", className: "my-1 border-t border-border" });
|
|
625
630
|
}
|
|
626
|
-
const Ft = C(function({ children: r, icon: o, danger: n = !1, disabled:
|
|
631
|
+
const Ft = C(function({ children: r, icon: o, danger: n = !1, disabled: i = !1, onClick: s, className: a = "", ...c }, d) {
|
|
627
632
|
const { close: l } = A(le);
|
|
628
633
|
return /* @__PURE__ */ m(
|
|
629
634
|
"button",
|
|
@@ -631,15 +636,15 @@ const Ft = C(function({ children: r, icon: o, danger: n = !1, disabled: s = !1,
|
|
|
631
636
|
ref: d,
|
|
632
637
|
type: "button",
|
|
633
638
|
role: "menuitem",
|
|
634
|
-
disabled:
|
|
639
|
+
disabled: i,
|
|
635
640
|
onClick: () => {
|
|
636
|
-
|
|
641
|
+
i || (s?.(), l());
|
|
637
642
|
},
|
|
638
643
|
className: [
|
|
639
644
|
"flex w-full items-center gap-2 px-3 py-2 text-small rounded-md",
|
|
640
645
|
"text-left transition-colors outline-none cursor-pointer",
|
|
641
646
|
n ? "text-error hover:bg-error-bg focus:bg-error-bg" : "text-text-primary hover:bg-bg-tertiary focus:bg-bg-tertiary",
|
|
642
|
-
|
|
647
|
+
i && "opacity-50 pointer-events-none",
|
|
643
648
|
a
|
|
644
649
|
].filter(Boolean).join(" "),
|
|
645
650
|
...c,
|
|
@@ -656,9 +661,9 @@ function Et({
|
|
|
656
661
|
placement: o = "bottom-start",
|
|
657
662
|
className: n = ""
|
|
658
663
|
}) {
|
|
659
|
-
const [
|
|
660
|
-
open:
|
|
661
|
-
onOpenChange:
|
|
664
|
+
const [i, s] = N(!1), [a, c] = N(null), d = D([]), { refs: l, floatingStyles: u, context: b } = O({
|
|
665
|
+
open: i,
|
|
666
|
+
onOpenChange: s,
|
|
662
667
|
placement: o,
|
|
663
668
|
middleware: [U(4), H(), q({ padding: 8 })],
|
|
664
669
|
whileElementsMounted: V
|
|
@@ -672,10 +677,10 @@ function Et({
|
|
|
672
677
|
p,
|
|
673
678
|
y,
|
|
674
679
|
f
|
|
675
|
-
]), x = k(() =>
|
|
680
|
+
]), x = k(() => s(!1), []);
|
|
676
681
|
return /* @__PURE__ */ m(B, { children: [
|
|
677
682
|
/* @__PURE__ */ e("span", { ref: l.setReference, className: "inline-flex", ...v(), children: t }),
|
|
678
|
-
|
|
683
|
+
i && /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e(ie, { context: b, modal: !1, children: /* @__PURE__ */ e(
|
|
679
684
|
"div",
|
|
680
685
|
{
|
|
681
686
|
ref: l.setFloating,
|
|
@@ -702,10 +707,10 @@ function St({
|
|
|
702
707
|
children: r,
|
|
703
708
|
placement: o = "bottom",
|
|
704
709
|
open: n,
|
|
705
|
-
onOpenChange:
|
|
706
|
-
className:
|
|
710
|
+
onOpenChange: i,
|
|
711
|
+
className: s = ""
|
|
707
712
|
}) {
|
|
708
|
-
const [a, c] = N(!1), d = n !== void 0, l = d ? n : a, u = d ? (x) =>
|
|
713
|
+
const [a, c] = N(!1), d = n !== void 0, l = d ? n : a, u = d ? (x) => i?.(x) : c, { refs: b, floatingStyles: h, context: p } = O({
|
|
709
714
|
open: l,
|
|
710
715
|
onOpenChange: u,
|
|
711
716
|
placement: o,
|
|
@@ -722,7 +727,7 @@ function St({
|
|
|
722
727
|
className: [
|
|
723
728
|
"z-50 rounded-lg border border-border p-md",
|
|
724
729
|
"bg-bg-primary shadow-lg animate-floating-in",
|
|
725
|
-
|
|
730
|
+
s
|
|
726
731
|
].join(" "),
|
|
727
732
|
...g(),
|
|
728
733
|
children: r
|
|
@@ -735,17 +740,17 @@ const ce = S({
|
|
|
735
740
|
idPrefix: ""
|
|
736
741
|
});
|
|
737
742
|
function At({ value: t, children: r, className: o = "" }) {
|
|
738
|
-
const { activeValue: n, idPrefix:
|
|
743
|
+
const { activeValue: n, idPrefix: i } = A(ce), s = n === t;
|
|
739
744
|
return /* @__PURE__ */ e(
|
|
740
745
|
"div",
|
|
741
746
|
{
|
|
742
|
-
id: `${
|
|
747
|
+
id: `${i}-panel-${t}`,
|
|
743
748
|
role: "tabpanel",
|
|
744
|
-
"aria-labelledby": `${
|
|
745
|
-
hidden: !
|
|
749
|
+
"aria-labelledby": `${i}-tab-${t}`,
|
|
750
|
+
hidden: !s,
|
|
746
751
|
tabIndex: 0,
|
|
747
752
|
className: o,
|
|
748
|
-
children:
|
|
753
|
+
children: s && r
|
|
749
754
|
}
|
|
750
755
|
);
|
|
751
756
|
}
|
|
@@ -754,8 +759,8 @@ function Pt({
|
|
|
754
759
|
value: r,
|
|
755
760
|
defaultValue: o,
|
|
756
761
|
onChange: n,
|
|
757
|
-
children:
|
|
758
|
-
className:
|
|
762
|
+
children: i,
|
|
763
|
+
className: s = ""
|
|
759
764
|
}) {
|
|
760
765
|
const a = I().replace(/:/g, ""), c = D(null), d = r !== void 0, [l, u] = N(
|
|
761
766
|
() => o ?? t.find((f) => !f.disabled)?.value ?? t[0]?.value ?? ""
|
|
@@ -790,7 +795,7 @@ function Pt({
|
|
|
790
795
|
`[data-tab-value="${g.value}"]`
|
|
791
796
|
)?.focus());
|
|
792
797
|
};
|
|
793
|
-
return /* @__PURE__ */ e(ce.Provider, { value: { activeValue: b, idPrefix: a }, children: /* @__PURE__ */ m("div", { className:
|
|
798
|
+
return /* @__PURE__ */ e(ce.Provider, { value: { activeValue: b, idPrefix: a }, children: /* @__PURE__ */ m("div", { className: s, children: [
|
|
794
799
|
/* @__PURE__ */ e(
|
|
795
800
|
"div",
|
|
796
801
|
{
|
|
@@ -830,7 +835,7 @@ function Pt({
|
|
|
830
835
|
})
|
|
831
836
|
}
|
|
832
837
|
),
|
|
833
|
-
|
|
838
|
+
i
|
|
834
839
|
] }) });
|
|
835
840
|
}
|
|
836
841
|
const Ge = {
|
|
@@ -844,16 +849,16 @@ function Bt({
|
|
|
844
849
|
content: r,
|
|
845
850
|
placement: o = "top",
|
|
846
851
|
delay: n = 200,
|
|
847
|
-
className:
|
|
852
|
+
className: i = ""
|
|
848
853
|
}) {
|
|
849
|
-
const [
|
|
854
|
+
const [s, a] = N(!1), c = D(null), {
|
|
850
855
|
refs: d,
|
|
851
856
|
floatingStyles: l,
|
|
852
857
|
context: u,
|
|
853
858
|
middlewareData: b,
|
|
854
859
|
placement: h
|
|
855
860
|
} = O({
|
|
856
|
-
open:
|
|
861
|
+
open: s,
|
|
857
862
|
onOpenChange: a,
|
|
858
863
|
placement: o,
|
|
859
864
|
middleware: [
|
|
@@ -867,7 +872,7 @@ function Bt({
|
|
|
867
872
|
}), p = ze(u, { delay: n, move: !1 }), y = $e(u), f = K(u), v = G(u, { role: "tooltip" }), { getReferenceProps: w, getFloatingProps: g } = X([p, y, f, v]), x = h.split("-")[0], z = b.arrow?.x, P = b.arrow?.y;
|
|
868
873
|
return /* @__PURE__ */ m(B, { children: [
|
|
869
874
|
/* @__PURE__ */ e("span", { ref: d.setReference, className: "inline-flex", ...w(), children: t }),
|
|
870
|
-
|
|
875
|
+
s && r && /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ m(
|
|
871
876
|
"div",
|
|
872
877
|
{
|
|
873
878
|
ref: d.setFloating,
|
|
@@ -877,7 +882,7 @@ function Bt({
|
|
|
877
882
|
"z-50 max-w-[var(--container-xs)] px-3 py-1.5 rounded-md text-small",
|
|
878
883
|
"bg-text-primary text-bg-primary shadow-md",
|
|
879
884
|
"pointer-events-none animate-floating-in",
|
|
880
|
-
|
|
885
|
+
i
|
|
881
886
|
].join(" "),
|
|
882
887
|
...g(),
|
|
883
888
|
children: [
|
|
@@ -901,8 +906,8 @@ function Bt({
|
|
|
901
906
|
}
|
|
902
907
|
function Xe() {
|
|
903
908
|
const { i18n: t } = Z(), r = t.language ?? "en", o = k(
|
|
904
|
-
(
|
|
905
|
-
t.changeLanguage(
|
|
909
|
+
(i) => {
|
|
910
|
+
t.changeLanguage(i);
|
|
906
911
|
},
|
|
907
912
|
[t]
|
|
908
913
|
), n = k(() => {
|
|
@@ -925,20 +930,20 @@ function Lt({ className: t = "" }) {
|
|
|
925
930
|
"inline-flex items-center rounded-full border border-border bg-bg-secondary p-0.5",
|
|
926
931
|
t
|
|
927
932
|
].filter(Boolean).join(" "),
|
|
928
|
-
children: Ye.map(({ value: n, label:
|
|
929
|
-
const
|
|
933
|
+
children: Ye.map(({ value: n, label: i }) => {
|
|
934
|
+
const s = r === n;
|
|
930
935
|
return /* @__PURE__ */ e(
|
|
931
936
|
"button",
|
|
932
937
|
{
|
|
933
938
|
type: "button",
|
|
934
939
|
role: "radio",
|
|
935
|
-
"aria-checked":
|
|
940
|
+
"aria-checked": s,
|
|
936
941
|
onClick: () => o(n),
|
|
937
942
|
className: [
|
|
938
943
|
"rounded-full px-2.5 py-0.5 text-caption font-medium transition-colors cursor-pointer",
|
|
939
|
-
|
|
944
|
+
s ? "bg-primary text-white shadow-sm" : "text-text-secondary hover:text-text-primary"
|
|
940
945
|
].join(" "),
|
|
941
|
-
children:
|
|
946
|
+
children: i
|
|
942
947
|
},
|
|
943
948
|
n
|
|
944
949
|
);
|
|
@@ -946,12 +951,12 @@ function Lt({ className: t = "" }) {
|
|
|
946
951
|
}
|
|
947
952
|
);
|
|
948
953
|
}
|
|
949
|
-
const _ = "poesis-theme",
|
|
954
|
+
const _ = "poesis-theme", T = /* @__PURE__ */ new Set();
|
|
950
955
|
function _e() {
|
|
951
|
-
|
|
956
|
+
T.forEach((t) => t());
|
|
952
957
|
}
|
|
953
958
|
function We(t) {
|
|
954
|
-
return
|
|
959
|
+
return T.add(t), () => T.delete(t);
|
|
955
960
|
}
|
|
956
961
|
function Je() {
|
|
957
962
|
return document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
@@ -962,7 +967,7 @@ function Qe() {
|
|
|
962
967
|
function E(t) {
|
|
963
968
|
t === "dark" ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark"), localStorage.setItem(_, t), _e();
|
|
964
969
|
}
|
|
965
|
-
function
|
|
970
|
+
function Tt() {
|
|
966
971
|
const t = localStorage.getItem(_);
|
|
967
972
|
if (t) {
|
|
968
973
|
E(t);
|
|
@@ -974,10 +979,10 @@ function Rt() {
|
|
|
974
979
|
function Ze() {
|
|
975
980
|
const t = ue(We, Je, Qe);
|
|
976
981
|
$(() => {
|
|
977
|
-
const n = window.matchMedia("(prefers-color-scheme: dark)"),
|
|
978
|
-
localStorage.getItem(_) || E(
|
|
982
|
+
const n = window.matchMedia("(prefers-color-scheme: dark)"), i = (s) => {
|
|
983
|
+
localStorage.getItem(_) || E(s.matches ? "dark" : "light");
|
|
979
984
|
};
|
|
980
|
-
return n.addEventListener("change",
|
|
985
|
+
return n.addEventListener("change", i), () => n.removeEventListener("change", i);
|
|
981
986
|
}, []);
|
|
982
987
|
const r = k(() => {
|
|
983
988
|
E(t === "dark" ? "light" : "dark");
|
|
@@ -986,16 +991,16 @@ function Ze() {
|
|
|
986
991
|
}, []);
|
|
987
992
|
return { theme: t, toggleTheme: r, setTheme: o, isDark: t === "dark" };
|
|
988
993
|
}
|
|
989
|
-
function
|
|
990
|
-
const { isDark: n, toggleTheme:
|
|
994
|
+
function Rt({ variant: t = "ghost", size: r = "md", className: o }) {
|
|
995
|
+
const { isDark: n, toggleTheme: i } = Ze(), { t: s } = Z();
|
|
991
996
|
return /* @__PURE__ */ e(
|
|
992
|
-
|
|
997
|
+
Re,
|
|
993
998
|
{
|
|
994
999
|
variant: t,
|
|
995
1000
|
size: r,
|
|
996
1001
|
icon: n ? /* @__PURE__ */ e(be, { size: 16 }) : /* @__PURE__ */ e(pe, { size: 16 }),
|
|
997
|
-
"aria-label":
|
|
998
|
-
onClick:
|
|
1002
|
+
"aria-label": s("theme.toggleTheme"),
|
|
1003
|
+
onClick: i,
|
|
999
1004
|
className: o
|
|
1000
1005
|
}
|
|
1001
1006
|
);
|
|
@@ -1005,15 +1010,15 @@ function et({
|
|
|
1005
1010
|
categories: r = [],
|
|
1006
1011
|
activeCategoryId: o,
|
|
1007
1012
|
onCategoryChange: n,
|
|
1008
|
-
actions:
|
|
1009
|
-
onBurgerClick:
|
|
1013
|
+
actions: i,
|
|
1014
|
+
onBurgerClick: s
|
|
1010
1015
|
}) {
|
|
1011
1016
|
return /* @__PURE__ */ m("header", { className: "fixed inset-x-0 top-0 z-40 flex h-14 items-center border-b border-border bg-bg-primary px-md", children: [
|
|
1012
1017
|
/* @__PURE__ */ e(
|
|
1013
1018
|
"button",
|
|
1014
1019
|
{
|
|
1015
1020
|
type: "button",
|
|
1016
|
-
onClick:
|
|
1021
|
+
onClick: s,
|
|
1017
1022
|
className: "mr-sm flex size-9 items-center justify-center rounded-md text-text-secondary hover:bg-bg-tertiary hover:text-text-primary lg:hidden",
|
|
1018
1023
|
"aria-label": "Open menu",
|
|
1019
1024
|
children: /* @__PURE__ */ e(fe, { size: 22 })
|
|
@@ -1041,7 +1046,7 @@ function et({
|
|
|
1041
1046
|
);
|
|
1042
1047
|
}) }),
|
|
1043
1048
|
/* @__PURE__ */ e("div", { className: "flex-1 lg:hidden" }),
|
|
1044
|
-
|
|
1049
|
+
i && /* @__PURE__ */ e("div", { className: "flex items-center gap-xs", children: i })
|
|
1045
1050
|
] });
|
|
1046
1051
|
}
|
|
1047
1052
|
function tt({
|
|
@@ -1057,15 +1062,15 @@ function tt({
|
|
|
1057
1062
|
"hidden lg:flex flex-col border-r border-border bg-bg-secondary overflow-y-auto transition-[width] duration-200",
|
|
1058
1063
|
n ? "w-16" : "w-64"
|
|
1059
1064
|
].join(" "),
|
|
1060
|
-
children: /* @__PURE__ */ e("nav", { className: "flex flex-col gap-xs p-sm", "aria-label": "Page navigation", children: t.map((
|
|
1065
|
+
children: /* @__PURE__ */ e("nav", { className: "flex flex-col gap-xs p-sm", "aria-label": "Page navigation", children: t.map((i) => /* @__PURE__ */ e(
|
|
1061
1066
|
rt,
|
|
1062
1067
|
{
|
|
1063
|
-
section:
|
|
1068
|
+
section: i,
|
|
1064
1069
|
activeLinkId: r,
|
|
1065
1070
|
onLinkClick: o,
|
|
1066
1071
|
collapsed: n
|
|
1067
1072
|
},
|
|
1068
|
-
|
|
1073
|
+
i.id
|
|
1069
1074
|
)) })
|
|
1070
1075
|
}
|
|
1071
1076
|
);
|
|
@@ -1076,13 +1081,13 @@ function rt({
|
|
|
1076
1081
|
onLinkClick: o,
|
|
1077
1082
|
collapsed: n
|
|
1078
1083
|
}) {
|
|
1079
|
-
const [
|
|
1084
|
+
const [i, s] = N(!0);
|
|
1080
1085
|
return /* @__PURE__ */ m("div", { className: "flex flex-col", children: [
|
|
1081
1086
|
t.title && !n && /* @__PURE__ */ m(
|
|
1082
1087
|
"button",
|
|
1083
1088
|
{
|
|
1084
1089
|
type: "button",
|
|
1085
|
-
onClick: () =>
|
|
1090
|
+
onClick: () => s((a) => !a),
|
|
1086
1091
|
className: "flex items-center justify-between rounded-md px-sm py-xs text-caption font-semibold uppercase tracking-wide text-text-muted hover:text-text-secondary",
|
|
1087
1092
|
children: [
|
|
1088
1093
|
/* @__PURE__ */ e("span", { children: t.title }),
|
|
@@ -1090,13 +1095,13 @@ function rt({
|
|
|
1090
1095
|
ee,
|
|
1091
1096
|
{
|
|
1092
1097
|
size: 14,
|
|
1093
|
-
className: `transition-transform ${
|
|
1098
|
+
className: `transition-transform ${i ? "" : "-rotate-90"}`
|
|
1094
1099
|
}
|
|
1095
1100
|
)
|
|
1096
1101
|
]
|
|
1097
1102
|
}
|
|
1098
1103
|
),
|
|
1099
|
-
(
|
|
1104
|
+
(i || n) && /* @__PURE__ */ e("ul", { className: "flex flex-col gap-px", children: t.links.map((a) => {
|
|
1100
1105
|
const c = a.id === r;
|
|
1101
1106
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ m(
|
|
1102
1107
|
"button",
|
|
@@ -1124,8 +1129,8 @@ function nt({
|
|
|
1124
1129
|
onClose: r,
|
|
1125
1130
|
categories: o = [],
|
|
1126
1131
|
activeCategoryId: n,
|
|
1127
|
-
onCategoryChange:
|
|
1128
|
-
sections:
|
|
1132
|
+
onCategoryChange: i,
|
|
1133
|
+
sections: s = [],
|
|
1129
1134
|
activeLinkId: a,
|
|
1130
1135
|
onLinkClick: c
|
|
1131
1136
|
}) {
|
|
@@ -1189,7 +1194,7 @@ function nt({
|
|
|
1189
1194
|
{
|
|
1190
1195
|
type: "button",
|
|
1191
1196
|
onClick: () => {
|
|
1192
|
-
|
|
1197
|
+
i?.(l.id);
|
|
1193
1198
|
},
|
|
1194
1199
|
className: [
|
|
1195
1200
|
"flex items-center gap-sm rounded-md px-sm py-xs text-small font-medium transition-colors",
|
|
@@ -1204,7 +1209,7 @@ function nt({
|
|
|
1204
1209
|
);
|
|
1205
1210
|
})
|
|
1206
1211
|
] }),
|
|
1207
|
-
|
|
1212
|
+
s.map((l) => /* @__PURE__ */ e(
|
|
1208
1213
|
ot,
|
|
1209
1214
|
{
|
|
1210
1215
|
section: l,
|
|
@@ -1226,13 +1231,13 @@ function ot({
|
|
|
1226
1231
|
activeLinkId: r,
|
|
1227
1232
|
onLinkClick: o
|
|
1228
1233
|
}) {
|
|
1229
|
-
const [n,
|
|
1234
|
+
const [n, i] = N(!0);
|
|
1230
1235
|
return /* @__PURE__ */ m("div", { className: "mb-xs flex flex-col", children: [
|
|
1231
1236
|
t.title && /* @__PURE__ */ m(
|
|
1232
1237
|
"button",
|
|
1233
1238
|
{
|
|
1234
1239
|
type: "button",
|
|
1235
|
-
onClick: () =>
|
|
1240
|
+
onClick: () => i((s) => !s),
|
|
1236
1241
|
className: "flex items-center justify-between rounded-md px-sm py-xs text-caption font-semibold uppercase tracking-wide text-text-muted hover:text-text-secondary",
|
|
1237
1242
|
children: [
|
|
1238
1243
|
/* @__PURE__ */ e("span", { children: t.title }),
|
|
@@ -1246,24 +1251,24 @@ function ot({
|
|
|
1246
1251
|
]
|
|
1247
1252
|
}
|
|
1248
1253
|
),
|
|
1249
|
-
n && /* @__PURE__ */ e("ul", { className: "flex flex-col gap-px", children: t.links.map((
|
|
1250
|
-
const a =
|
|
1254
|
+
n && /* @__PURE__ */ e("ul", { className: "flex flex-col gap-px", children: t.links.map((s) => {
|
|
1255
|
+
const a = s.id === r;
|
|
1251
1256
|
return /* @__PURE__ */ e("li", { children: /* @__PURE__ */ m(
|
|
1252
1257
|
"button",
|
|
1253
1258
|
{
|
|
1254
1259
|
type: "button",
|
|
1255
|
-
onClick: () => o?.(
|
|
1260
|
+
onClick: () => o?.(s.href),
|
|
1256
1261
|
className: [
|
|
1257
1262
|
"flex w-full items-center gap-sm rounded-md px-sm py-xs text-small transition-colors",
|
|
1258
1263
|
a ? "bg-primary/10 font-medium text-primary" : "text-text-secondary hover:bg-bg-tertiary hover:text-text-primary"
|
|
1259
1264
|
].join(" "),
|
|
1260
1265
|
"aria-current": a ? "page" : void 0,
|
|
1261
1266
|
children: [
|
|
1262
|
-
|
|
1263
|
-
/* @__PURE__ */ e("span", { children:
|
|
1267
|
+
s.icon && /* @__PURE__ */ e(s.icon, { size: 18 }),
|
|
1268
|
+
/* @__PURE__ */ e("span", { children: s.label })
|
|
1264
1269
|
]
|
|
1265
1270
|
}
|
|
1266
|
-
) },
|
|
1271
|
+
) }, s.id);
|
|
1267
1272
|
}) })
|
|
1268
1273
|
] });
|
|
1269
1274
|
}
|
|
@@ -1272,8 +1277,8 @@ function Mt({
|
|
|
1272
1277
|
logo: r,
|
|
1273
1278
|
categories: o = [],
|
|
1274
1279
|
activeCategoryId: n,
|
|
1275
|
-
onCategoryChange:
|
|
1276
|
-
sections:
|
|
1280
|
+
onCategoryChange: i,
|
|
1281
|
+
sections: s = [],
|
|
1277
1282
|
activeLinkId: a,
|
|
1278
1283
|
onLinkClick: c,
|
|
1279
1284
|
actions: d,
|
|
@@ -1287,7 +1292,7 @@ function Mt({
|
|
|
1287
1292
|
logo: r,
|
|
1288
1293
|
categories: o,
|
|
1289
1294
|
activeCategoryId: n,
|
|
1290
|
-
onCategoryChange:
|
|
1295
|
+
onCategoryChange: i,
|
|
1291
1296
|
actions: d,
|
|
1292
1297
|
onBurgerClick: () => b(!0)
|
|
1293
1298
|
}
|
|
@@ -1296,7 +1301,7 @@ function Mt({
|
|
|
1296
1301
|
/* @__PURE__ */ e(
|
|
1297
1302
|
tt,
|
|
1298
1303
|
{
|
|
1299
|
-
sections:
|
|
1304
|
+
sections: s,
|
|
1300
1305
|
activeLinkId: a,
|
|
1301
1306
|
onLinkClick: c,
|
|
1302
1307
|
collapsed: l
|
|
@@ -1312,9 +1317,9 @@ function Mt({
|
|
|
1312
1317
|
categories: o,
|
|
1313
1318
|
activeCategoryId: n,
|
|
1314
1319
|
onCategoryChange: (h) => {
|
|
1315
|
-
|
|
1320
|
+
i?.(h), b(!1);
|
|
1316
1321
|
},
|
|
1317
|
-
sections:
|
|
1322
|
+
sections: s,
|
|
1318
1323
|
activeLinkId: a,
|
|
1319
1324
|
onLinkClick: (h) => {
|
|
1320
1325
|
c?.(h), b(!1);
|
|
@@ -1323,7 +1328,7 @@ function Mt({
|
|
|
1323
1328
|
)
|
|
1324
1329
|
] });
|
|
1325
1330
|
}
|
|
1326
|
-
const Ot = C(function({ header: r, footer: o, actions: n, noPadding:
|
|
1331
|
+
const Ot = C(function({ header: r, footer: o, actions: n, noPadding: i = !1, className: s = "", children: a, ...c }, d) {
|
|
1327
1332
|
const l = o || n;
|
|
1328
1333
|
return /* @__PURE__ */ m(
|
|
1329
1334
|
"div",
|
|
@@ -1332,12 +1337,12 @@ const Ot = C(function({ header: r, footer: o, actions: n, noPadding: s = !1, cla
|
|
|
1332
1337
|
className: [
|
|
1333
1338
|
"rounded-md shadow-md border border-border bg-bg-secondary",
|
|
1334
1339
|
"flex flex-col overflow-hidden",
|
|
1335
|
-
|
|
1340
|
+
s
|
|
1336
1341
|
].filter(Boolean).join(" "),
|
|
1337
1342
|
...c,
|
|
1338
1343
|
children: [
|
|
1339
1344
|
r && /* @__PURE__ */ e("div", { className: "px-lg py-md border-b border-border", children: /* @__PURE__ */ e("div", { className: "font-semibold text-body text-text-primary", children: r }) }),
|
|
1340
|
-
/* @__PURE__ */ e("div", { className:
|
|
1345
|
+
/* @__PURE__ */ e("div", { className: i ? "" : "p-lg", children: a }),
|
|
1341
1346
|
l && /* @__PURE__ */ m("div", { className: "px-lg py-md border-t border-border flex items-center gap-3", children: [
|
|
1342
1347
|
o && /* @__PURE__ */ e("div", { className: "flex-1 min-w-0", children: o }),
|
|
1343
1348
|
n && /* @__PURE__ */ e("div", { className: "ml-auto flex items-center gap-2", children: n })
|
|
@@ -1346,14 +1351,14 @@ const Ot = C(function({ header: r, footer: o, actions: n, noPadding: s = !1, cla
|
|
|
1346
1351
|
}
|
|
1347
1352
|
);
|
|
1348
1353
|
}), Vt = C(
|
|
1349
|
-
function({ items: r, layout: o = "horizontal", dividers: n = !0, className:
|
|
1354
|
+
function({ items: r, layout: o = "horizontal", dividers: n = !0, className: i = "", ...s }, a) {
|
|
1350
1355
|
const c = o === "horizontal";
|
|
1351
1356
|
return /* @__PURE__ */ e(
|
|
1352
1357
|
"dl",
|
|
1353
1358
|
{
|
|
1354
1359
|
ref: a,
|
|
1355
|
-
className: ["text-body", n && "divide-y divide-border",
|
|
1356
|
-
...
|
|
1360
|
+
className: ["text-body", n && "divide-y divide-border", i].filter(Boolean).join(" "),
|
|
1361
|
+
...s,
|
|
1357
1362
|
children: r.map((d, l) => /* @__PURE__ */ m(
|
|
1358
1363
|
"div",
|
|
1359
1364
|
{
|
|
@@ -1380,21 +1385,21 @@ const Ot = C(function({ header: r, footer: o, actions: n, noPadding: s = !1, cla
|
|
|
1380
1385
|
}
|
|
1381
1386
|
);
|
|
1382
1387
|
}
|
|
1383
|
-
), Ut = C(function({ illustration: r, title: o, description: n, action:
|
|
1388
|
+
), Ut = C(function({ illustration: r, title: o, description: n, action: i, className: s = "", ...a }, c) {
|
|
1384
1389
|
return /* @__PURE__ */ m(
|
|
1385
1390
|
"div",
|
|
1386
1391
|
{
|
|
1387
1392
|
ref: c,
|
|
1388
1393
|
className: [
|
|
1389
1394
|
"flex flex-col items-center justify-center text-center py-2xl px-lg",
|
|
1390
|
-
|
|
1395
|
+
s
|
|
1391
1396
|
].filter(Boolean).join(" "),
|
|
1392
1397
|
...a,
|
|
1393
1398
|
children: [
|
|
1394
1399
|
r && /* @__PURE__ */ e("div", { className: "mb-lg text-text-secondary", children: r }),
|
|
1395
1400
|
/* @__PURE__ */ e("h3", { className: "text-h3 font-semibold text-text-primary", children: o }),
|
|
1396
1401
|
n && /* @__PURE__ */ e("p", { className: "mt-xs text-body text-text-secondary max-w-[var(--container-md)]", children: n }),
|
|
1397
|
-
|
|
1402
|
+
i && /* @__PURE__ */ e("div", { className: "mt-lg", children: i })
|
|
1398
1403
|
]
|
|
1399
1404
|
}
|
|
1400
1405
|
);
|
|
@@ -1418,14 +1423,14 @@ const Ht = C(function({
|
|
|
1418
1423
|
columns: r,
|
|
1419
1424
|
data: o,
|
|
1420
1425
|
rowKey: n,
|
|
1421
|
-
striped:
|
|
1422
|
-
sort:
|
|
1426
|
+
striped: i = !1,
|
|
1427
|
+
sort: s,
|
|
1423
1428
|
onSortChange: a,
|
|
1424
1429
|
emptyContent: c,
|
|
1425
1430
|
className: d = "",
|
|
1426
1431
|
...l
|
|
1427
1432
|
}, u) {
|
|
1428
|
-
const [b, h] = N(), p =
|
|
1433
|
+
const [b, h] = N(), p = s ?? b, y = k(
|
|
1429
1434
|
(g) => {
|
|
1430
1435
|
const x = p?.column === g && p.direction === "asc" ? { column: g, direction: "desc" } : { column: g, direction: "asc" };
|
|
1431
1436
|
a ? a(x) : h(x);
|
|
@@ -1496,7 +1501,7 @@ const Ht = C(function({
|
|
|
1496
1501
|
{
|
|
1497
1502
|
className: [
|
|
1498
1503
|
"border-b border-border last:border-b-0 transition-colors",
|
|
1499
|
-
|
|
1504
|
+
i && x % 2 === 1 && "bg-bg-tertiary/50",
|
|
1500
1505
|
"hover:bg-bg-tertiary/70"
|
|
1501
1506
|
].filter(Boolean).join(" "),
|
|
1502
1507
|
children: r.map((z) => /* @__PURE__ */ e(
|
|
@@ -1527,7 +1532,7 @@ const Ht = C(function({
|
|
|
1527
1532
|
bg: "bg-warning-bg",
|
|
1528
1533
|
border: "border-warning/30",
|
|
1529
1534
|
text: "text-warning",
|
|
1530
|
-
icon:
|
|
1535
|
+
icon: R
|
|
1531
1536
|
},
|
|
1532
1537
|
error: {
|
|
1533
1538
|
bg: "bg-error-bg",
|
|
@@ -1547,19 +1552,19 @@ function qt({
|
|
|
1547
1552
|
title: r,
|
|
1548
1553
|
children: o,
|
|
1549
1554
|
dismissible: n = !1,
|
|
1550
|
-
onDismiss:
|
|
1551
|
-
className:
|
|
1555
|
+
onDismiss: i,
|
|
1556
|
+
className: s = ""
|
|
1552
1557
|
}) {
|
|
1553
1558
|
const [a, c] = N(!0), { bg: d, border: l, text: u, icon: b } = at[t];
|
|
1554
1559
|
if (!a) return null;
|
|
1555
1560
|
const h = () => {
|
|
1556
|
-
c(!1),
|
|
1561
|
+
c(!1), i?.();
|
|
1557
1562
|
};
|
|
1558
1563
|
return /* @__PURE__ */ m(
|
|
1559
1564
|
"div",
|
|
1560
1565
|
{
|
|
1561
1566
|
role: "alert",
|
|
1562
|
-
className: `flex gap-3 rounded-md border p-md ${d} ${l} ${
|
|
1567
|
+
className: `flex gap-3 rounded-md border p-md ${d} ${l} ${s}`,
|
|
1563
1568
|
children: [
|
|
1564
1569
|
/* @__PURE__ */ e(b, { size: 20, className: `shrink-0 mt-0.5 ${u}`, "aria-hidden": !0 }),
|
|
1565
1570
|
/* @__PURE__ */ m("div", { className: "flex-1 min-w-0", children: [
|
|
@@ -1590,8 +1595,8 @@ function ct({
|
|
|
1590
1595
|
onClose: r,
|
|
1591
1596
|
title: o,
|
|
1592
1597
|
size: n = "md",
|
|
1593
|
-
children:
|
|
1594
|
-
footer:
|
|
1598
|
+
children: i,
|
|
1599
|
+
footer: s,
|
|
1595
1600
|
className: a = ""
|
|
1596
1601
|
}) {
|
|
1597
1602
|
const c = D(null);
|
|
@@ -1680,8 +1685,8 @@ function ct({
|
|
|
1680
1685
|
}
|
|
1681
1686
|
)
|
|
1682
1687
|
] }),
|
|
1683
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-lg py-md text-body text-text-primary", children:
|
|
1684
|
-
|
|
1688
|
+
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-lg py-md text-body text-text-primary", children: i }),
|
|
1689
|
+
s && /* @__PURE__ */ e("div", { className: "flex items-center justify-end gap-sm px-lg py-md border-t border-border", children: s })
|
|
1685
1690
|
]
|
|
1686
1691
|
}
|
|
1687
1692
|
)
|
|
@@ -1698,8 +1703,8 @@ function Kt({
|
|
|
1698
1703
|
onCancel: r,
|
|
1699
1704
|
onConfirm: o,
|
|
1700
1705
|
title: n,
|
|
1701
|
-
children:
|
|
1702
|
-
confirmLabel:
|
|
1706
|
+
children: i,
|
|
1707
|
+
confirmLabel: s = "Confirm",
|
|
1703
1708
|
cancelLabel: a = "Cancel",
|
|
1704
1709
|
danger: c = !1,
|
|
1705
1710
|
size: d = "sm"
|
|
@@ -1707,14 +1712,14 @@ function Kt({
|
|
|
1707
1712
|
return /* @__PURE__ */ m(ct, { open: t, onClose: r, title: n, size: d, children: [
|
|
1708
1713
|
/* @__PURE__ */ m("div", { className: "flex gap-3", children: [
|
|
1709
1714
|
c && /* @__PURE__ */ e(
|
|
1710
|
-
|
|
1715
|
+
R,
|
|
1711
1716
|
{
|
|
1712
1717
|
size: 22,
|
|
1713
1718
|
className: "shrink-0 mt-0.5 text-error",
|
|
1714
1719
|
"aria-hidden": !0
|
|
1715
1720
|
}
|
|
1716
1721
|
),
|
|
1717
|
-
/* @__PURE__ */ e("div", { className: "text-body text-text-secondary", children:
|
|
1722
|
+
/* @__PURE__ */ e("div", { className: "text-body text-text-secondary", children: i })
|
|
1718
1723
|
] }),
|
|
1719
1724
|
/* @__PURE__ */ m("div", { className: "flex items-center justify-end gap-sm mt-lg", children: [
|
|
1720
1725
|
/* @__PURE__ */ e(
|
|
@@ -1732,7 +1737,7 @@ function Kt({
|
|
|
1732
1737
|
type: "button",
|
|
1733
1738
|
onClick: o,
|
|
1734
1739
|
className: `px-4 py-2 rounded-md text-small font-medium text-white transition-colors cursor-pointer ${c ? "bg-error hover:bg-error/80" : "bg-primary hover:bg-primary-hover"}`,
|
|
1735
|
-
children:
|
|
1740
|
+
children: s
|
|
1736
1741
|
}
|
|
1737
1742
|
)
|
|
1738
1743
|
] })
|
|
@@ -1755,7 +1760,7 @@ const dt = {
|
|
|
1755
1760
|
bg: "bg-bg-primary",
|
|
1756
1761
|
accent: "bg-warning",
|
|
1757
1762
|
text: "text-warning",
|
|
1758
|
-
icon:
|
|
1763
|
+
icon: R
|
|
1759
1764
|
},
|
|
1760
1765
|
error: {
|
|
1761
1766
|
bg: "bg-bg-primary",
|
|
@@ -1771,12 +1776,12 @@ const dt = {
|
|
|
1771
1776
|
}
|
|
1772
1777
|
};
|
|
1773
1778
|
function mt({ toast: t, onRemove: r }) {
|
|
1774
|
-
const { variant: o, title: n, message:
|
|
1779
|
+
const { variant: o, title: n, message: i, duration: s = 5e3 } = t, { bg: a, accent: c, text: d, icon: l } = dt[o], [u, b] = N(100), h = D(0), p = D(0);
|
|
1775
1780
|
return $(() => {
|
|
1776
|
-
if (
|
|
1781
|
+
if (s <= 0) return;
|
|
1777
1782
|
h.current = performance.now();
|
|
1778
1783
|
const y = (f) => {
|
|
1779
|
-
const v = f - h.current, w = Math.max(0, 100 - v /
|
|
1784
|
+
const v = f - h.current, w = Math.max(0, 100 - v / s * 100);
|
|
1780
1785
|
if (b(w), w <= 0) {
|
|
1781
1786
|
r(t.id);
|
|
1782
1787
|
return;
|
|
@@ -1784,7 +1789,7 @@ function mt({ toast: t, onRemove: r }) {
|
|
|
1784
1789
|
p.current = requestAnimationFrame(y);
|
|
1785
1790
|
};
|
|
1786
1791
|
return p.current = requestAnimationFrame(y), () => cancelAnimationFrame(p.current);
|
|
1787
|
-
}, [
|
|
1792
|
+
}, [s, t.id, r]), /* @__PURE__ */ m(
|
|
1788
1793
|
"div",
|
|
1789
1794
|
{
|
|
1790
1795
|
role: "status",
|
|
@@ -1795,7 +1800,7 @@ function mt({ toast: t, onRemove: r }) {
|
|
|
1795
1800
|
/* @__PURE__ */ e(l, { size: 18, className: `shrink-0 mt-0.5 ${d}`, "aria-hidden": !0 }),
|
|
1796
1801
|
/* @__PURE__ */ m("div", { className: "flex-1 min-w-0", children: [
|
|
1797
1802
|
n && /* @__PURE__ */ e("p", { className: "font-semibold text-small text-text-primary", children: n }),
|
|
1798
|
-
/* @__PURE__ */ e("p", { className: "text-small text-text-secondary", children:
|
|
1803
|
+
/* @__PURE__ */ e("p", { className: "text-small text-text-secondary", children: i })
|
|
1799
1804
|
] }),
|
|
1800
1805
|
/* @__PURE__ */ e(
|
|
1801
1806
|
"button",
|
|
@@ -1808,7 +1813,7 @@ function mt({ toast: t, onRemove: r }) {
|
|
|
1808
1813
|
}
|
|
1809
1814
|
)
|
|
1810
1815
|
] }),
|
|
1811
|
-
|
|
1816
|
+
s > 0 && /* @__PURE__ */ e("div", { className: "h-0.5 w-full bg-bg-tertiary", children: /* @__PURE__ */ e(
|
|
1812
1817
|
"div",
|
|
1813
1818
|
{
|
|
1814
1819
|
className: `h-full ${c} transition-none`,
|
|
@@ -1821,20 +1826,20 @@ function mt({ toast: t, onRemove: r }) {
|
|
|
1821
1826
|
}
|
|
1822
1827
|
let ut = 0;
|
|
1823
1828
|
function Xt({ children: t }) {
|
|
1824
|
-
const [r, o] = N([]), n = k((
|
|
1829
|
+
const [r, o] = N([]), n = k((s) => {
|
|
1825
1830
|
const a = `toast-${++ut}`;
|
|
1826
|
-
return o((c) => [...c, { ...
|
|
1827
|
-
}, []),
|
|
1828
|
-
o((a) => a.filter((c) => c.id !==
|
|
1831
|
+
return o((c) => [...c, { ...s, id: a }]), a;
|
|
1832
|
+
}, []), i = k((s) => {
|
|
1833
|
+
o((a) => a.filter((c) => c.id !== s));
|
|
1829
1834
|
}, []);
|
|
1830
|
-
return /* @__PURE__ */ m(de, { value: { addToast: n, removeToast:
|
|
1835
|
+
return /* @__PURE__ */ m(de, { value: { addToast: n, removeToast: i }, children: [
|
|
1831
1836
|
t,
|
|
1832
1837
|
/* @__PURE__ */ e(
|
|
1833
1838
|
"div",
|
|
1834
1839
|
{
|
|
1835
1840
|
"aria-label": "Notifications",
|
|
1836
1841
|
className: "fixed bottom-lg right-lg z-50 flex flex-col-reverse gap-sm pointer-events-none",
|
|
1837
|
-
children: r.map((
|
|
1842
|
+
children: r.map((s) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: /* @__PURE__ */ e(mt, { toast: s, onRemove: i }) }, s.id))
|
|
1838
1843
|
}
|
|
1839
1844
|
)
|
|
1840
1845
|
] });
|
|
@@ -1845,8 +1850,8 @@ const me = S(null), bt = {
|
|
|
1845
1850
|
role: "admin"
|
|
1846
1851
|
};
|
|
1847
1852
|
function Yt({ initialUser: t = bt, children: r }) {
|
|
1848
|
-
const [o, n] = N(t),
|
|
1849
|
-
return /* @__PURE__ */ e(me.Provider, { value:
|
|
1853
|
+
const [o, n] = N(t), i = (a) => n((c) => ({ ...c, role: a })), s = L(() => ({ user: o, setRole: i }), [o]);
|
|
1854
|
+
return /* @__PURE__ */ e(me.Provider, { value: s, children: r });
|
|
1850
1855
|
}
|
|
1851
1856
|
function _t() {
|
|
1852
1857
|
const t = A(me);
|
|
@@ -1869,7 +1874,7 @@ export {
|
|
|
1869
1874
|
Ft as DropdownItem,
|
|
1870
1875
|
Et as DropdownMenu,
|
|
1871
1876
|
Ut as EmptyState,
|
|
1872
|
-
|
|
1877
|
+
Re as IconButton,
|
|
1873
1878
|
zt as Input,
|
|
1874
1879
|
Lt as LanguageSwitcher,
|
|
1875
1880
|
Mt as PageShell,
|
|
@@ -1883,13 +1888,13 @@ export {
|
|
|
1883
1888
|
Ht as Table,
|
|
1884
1889
|
Pt as Tabs,
|
|
1885
1890
|
It as Textarea,
|
|
1886
|
-
|
|
1891
|
+
Rt as ThemeToggle,
|
|
1887
1892
|
Xt as ToastProvider,
|
|
1888
1893
|
Bt as Tooltip,
|
|
1889
1894
|
et as TopNav,
|
|
1890
1895
|
Q as epflSelectClassNames,
|
|
1891
1896
|
Ke as epflSelectTheme,
|
|
1892
|
-
|
|
1897
|
+
Tt as initTheme,
|
|
1893
1898
|
_t as useAuth,
|
|
1894
1899
|
Xe as useLanguage,
|
|
1895
1900
|
Ze as useTheme,
|