lucent-ui 0.4.0 → 0.4.2
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/index.cjs +19 -19
- package/dist/index.d.ts +11 -1
- package/dist/index.js +316 -285
- package/dist-server/src/components/atoms/NavLink/NavLink.manifest.js +96 -0
- package/dist-server/src/components/molecules/Breadcrumb/Breadcrumb.manifest.js +76 -0
- package/dist-server/src/components/molecules/Collapsible/Collapsible.manifest.js +83 -0
- package/dist-server/src/components/molecules/PageLayout/PageLayout.manifest.js +160 -0
- package/dist-server/src/components/molecules/Tabs/Tabs.manifest.js +105 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as h, jsx as e, Fragment as V } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as H, useRef as F, useEffect as B, useState as z, useCallback as
|
|
2
|
+
import { forwardRef as H, useRef as F, useEffect as B, useState as z, useCallback as Q, useContext as re, createContext as oe, useLayoutEffect as ie, useId as le } from "react";
|
|
3
3
|
const ge = {
|
|
4
4
|
primary: {
|
|
5
5
|
background: "var(--lucent-accent-default)",
|
|
@@ -26,12 +26,12 @@ const ge = {
|
|
|
26
26
|
md: { height: "38px", padding: "0 var(--lucent-space-4)", fontSize: "var(--lucent-font-size-md)" },
|
|
27
27
|
lg: { height: "46px", padding: "0 var(--lucent-space-5)", fontSize: "var(--lucent-font-size-lg)" }
|
|
28
28
|
}, be = H(
|
|
29
|
-
({ variant: t = "primary", size: n = "md", loading: a = !1, fullWidth: o = !1, spread: r = !1, leftIcon: i, rightIcon: l, chevron: c = !1, disableHoverStyles: f = !1, children: g, disabled: y, style: d, ...s },
|
|
29
|
+
({ variant: t = "primary", size: n = "md", loading: a = !1, fullWidth: o = !1, spread: r = !1, leftIcon: i, rightIcon: l, chevron: c = !1, disableHoverStyles: f = !1, children: g, disabled: y, style: d, ...s }, u) => {
|
|
30
30
|
const v = y ?? a;
|
|
31
31
|
return /* @__PURE__ */ h(
|
|
32
32
|
"button",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
34
|
+
ref: u,
|
|
35
35
|
disabled: v,
|
|
36
36
|
"aria-busy": a,
|
|
37
37
|
style: {
|
|
@@ -61,28 +61,28 @@ const ge = {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
onMouseEnter: (m) => {
|
|
64
|
-
var
|
|
65
|
-
!v && !f && ye(m.currentTarget, t), (
|
|
64
|
+
var k;
|
|
65
|
+
!v && !f && ye(m.currentTarget, t), (k = s.onMouseEnter) == null || k.call(s, m);
|
|
66
66
|
},
|
|
67
67
|
onMouseLeave: (m) => {
|
|
68
|
-
var
|
|
69
|
-
!v && !f && xe(m.currentTarget, t), (
|
|
68
|
+
var k;
|
|
69
|
+
!v && !f && xe(m.currentTarget, t), (k = s.onMouseLeave) == null || k.call(s, m);
|
|
70
70
|
},
|
|
71
71
|
onMouseDown: (m) => {
|
|
72
|
-
var
|
|
73
|
-
v || (m.currentTarget.style.transform = "scale(0.95)"), (
|
|
72
|
+
var k;
|
|
73
|
+
v || (m.currentTarget.style.transform = "scale(0.95)"), (k = s.onMouseDown) == null || k.call(s, m);
|
|
74
74
|
},
|
|
75
75
|
onMouseUp: (m) => {
|
|
76
|
-
var
|
|
77
|
-
m.currentTarget.style.transform = "", (
|
|
76
|
+
var k;
|
|
77
|
+
m.currentTarget.style.transform = "", (k = s.onMouseUp) == null || k.call(s, m);
|
|
78
78
|
},
|
|
79
79
|
onFocus: (m) => {
|
|
80
|
-
var
|
|
81
|
-
m.currentTarget.style.boxShadow = "0 0 0 3px var(--lucent-accent-subtle)", (
|
|
80
|
+
var k;
|
|
81
|
+
m.currentTarget.style.boxShadow = "0 0 0 3px var(--lucent-accent-subtle)", (k = s.onFocus) == null || k.call(s, m);
|
|
82
82
|
},
|
|
83
83
|
onBlur: (m) => {
|
|
84
|
-
var
|
|
85
|
-
m.currentTarget.style.boxShadow = "", (
|
|
84
|
+
var k;
|
|
85
|
+
m.currentTarget.style.boxShadow = "", (k = s.onBlur) == null || k.call(s, m);
|
|
86
86
|
},
|
|
87
87
|
...s,
|
|
88
88
|
children: [
|
|
@@ -274,20 +274,20 @@ const Wt = {
|
|
|
274
274
|
...l
|
|
275
275
|
},
|
|
276
276
|
onMouseEnter: (s) => {
|
|
277
|
-
var
|
|
278
|
-
!c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-strong)"), (
|
|
277
|
+
var u;
|
|
278
|
+
!c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-strong)"), (u = c.onMouseEnter) == null || u.call(c, s);
|
|
279
279
|
},
|
|
280
280
|
onMouseLeave: (s) => {
|
|
281
|
-
var
|
|
282
|
-
!c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)"), (
|
|
281
|
+
var u;
|
|
282
|
+
!c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)"), (u = c.onMouseLeave) == null || u.call(c, s);
|
|
283
283
|
},
|
|
284
284
|
onFocus: (s) => {
|
|
285
|
-
var
|
|
286
|
-
s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-focus-ring)", s.currentTarget.style.boxShadow = `0 0 0 3px ${y ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}`, (
|
|
285
|
+
var u;
|
|
286
|
+
s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-focus-ring)", s.currentTarget.style.boxShadow = `0 0 0 3px ${y ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}`, (u = c.onFocus) == null || u.call(c, s);
|
|
287
287
|
},
|
|
288
288
|
onBlur: (s) => {
|
|
289
|
-
var
|
|
290
|
-
s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)", s.currentTarget.style.boxShadow = "none", (
|
|
289
|
+
var u;
|
|
290
|
+
s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)", s.currentTarget.style.boxShadow = "none", (u = c.onBlur) == null || u.call(c, s);
|
|
291
291
|
},
|
|
292
292
|
...c
|
|
293
293
|
}
|
|
@@ -363,12 +363,12 @@ const Vt = {
|
|
|
363
363
|
}
|
|
364
364
|
}, Te = H(
|
|
365
365
|
({ label: t, helperText: n, errorText: a, autoResize: o = !1, maxLength: r, showCount: i = !1, id: l, value: c, onChange: f, style: g, ...y }, d) => {
|
|
366
|
-
const s = F(null),
|
|
366
|
+
const s = F(null), u = d ?? s, v = l ?? `lucent-textarea-${Math.random().toString(36).slice(2, 7)}`, m = !!a, k = typeof c == "string" ? c.length : 0;
|
|
367
367
|
return B(() => {
|
|
368
368
|
if (!o) return;
|
|
369
|
-
const b =
|
|
369
|
+
const b = u.current;
|
|
370
370
|
b && (b.style.height = "auto", b.style.height = `${b.scrollHeight}px`);
|
|
371
|
-
}, [c, o,
|
|
371
|
+
}, [c, o, u]), /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-1)", width: "100%" }, children: [
|
|
372
372
|
t && /* @__PURE__ */ e("label", { htmlFor: v, style: {
|
|
373
373
|
fontSize: "var(--lucent-font-size-sm)",
|
|
374
374
|
fontWeight: "var(--lucent-font-weight-medium)",
|
|
@@ -378,7 +378,7 @@ const Vt = {
|
|
|
378
378
|
/* @__PURE__ */ e(
|
|
379
379
|
"textarea",
|
|
380
380
|
{
|
|
381
|
-
ref:
|
|
381
|
+
ref: u,
|
|
382
382
|
id: v,
|
|
383
383
|
maxLength: r,
|
|
384
384
|
value: c,
|
|
@@ -420,12 +420,12 @@ const Vt = {
|
|
|
420
420
|
] }),
|
|
421
421
|
(i || r) && /* @__PURE__ */ h("span", { style: {
|
|
422
422
|
fontSize: "var(--lucent-font-size-xs)",
|
|
423
|
-
color: r &&
|
|
423
|
+
color: r && k >= r ? "var(--lucent-danger-text)" : "var(--lucent-text-secondary)",
|
|
424
424
|
fontFamily: "var(--lucent-font-family-mono)",
|
|
425
425
|
flexShrink: 0,
|
|
426
426
|
marginLeft: "var(--lucent-space-2)"
|
|
427
427
|
}, children: [
|
|
428
|
-
|
|
428
|
+
k,
|
|
429
429
|
r ? `/${r}` : ""
|
|
430
430
|
] })
|
|
431
431
|
] })
|
|
@@ -786,24 +786,24 @@ const Kt = {
|
|
|
786
786
|
style: f,
|
|
787
787
|
...g
|
|
788
788
|
}, y) => {
|
|
789
|
-
const d = F(null), s = l ?? `lucent-checkbox-${Math.random().toString(36).slice(2, 7)}`,
|
|
789
|
+
const d = F(null), s = l ?? `lucent-checkbox-${Math.random().toString(36).slice(2, 7)}`, u = Fe[n], v = o !== void 0, [m, k] = z(r ?? !1), b = v ? !!o : m, x = F(b), [E, T] = z(0);
|
|
790
790
|
B(() => {
|
|
791
|
-
!i && x.current !== b && (x.current = b,
|
|
791
|
+
!i && x.current !== b && (x.current = b, T((S) => S + 1));
|
|
792
792
|
}, [b, i]);
|
|
793
|
-
const
|
|
794
|
-
(
|
|
795
|
-
d.current =
|
|
793
|
+
const p = Q(
|
|
794
|
+
(S) => {
|
|
795
|
+
d.current = S, typeof y == "function" ? y(S) : y && (y.current = S);
|
|
796
796
|
},
|
|
797
797
|
[y]
|
|
798
798
|
);
|
|
799
799
|
B(() => {
|
|
800
800
|
d.current && (d.current.indeterminate = a);
|
|
801
801
|
}, [a]);
|
|
802
|
-
const
|
|
803
|
-
v ||
|
|
802
|
+
const C = (S) => {
|
|
803
|
+
v || k(S.target.checked), c == null || c(S);
|
|
804
804
|
}, D = i ? "var(--lucent-text-disabled)" : "var(--lucent-text-on-accent)", w = {
|
|
805
|
-
width:
|
|
806
|
-
height:
|
|
805
|
+
width: u,
|
|
806
|
+
height: u,
|
|
807
807
|
borderRadius: "var(--lucent-radius-sm)",
|
|
808
808
|
border: `1.5px solid ${i ? "transparent" : b || a ? "var(--lucent-accent-default)" : "var(--lucent-border-strong)"}`,
|
|
809
809
|
background: i ? "var(--lucent-bg-muted)" : b || a ? "var(--lucent-accent-default)" : "var(--lucent-surface-default)",
|
|
@@ -835,12 +835,12 @@ const Kt = {
|
|
|
835
835
|
/* @__PURE__ */ e(
|
|
836
836
|
"input",
|
|
837
837
|
{
|
|
838
|
-
ref:
|
|
838
|
+
ref: p,
|
|
839
839
|
type: "checkbox",
|
|
840
840
|
id: s,
|
|
841
841
|
checked: v ? o : m,
|
|
842
842
|
disabled: i,
|
|
843
|
-
onChange:
|
|
843
|
+
onChange: C,
|
|
844
844
|
style: { position: "absolute", opacity: 0, width: 0, height: 0, margin: 0, pointerEvents: "none" },
|
|
845
845
|
...g
|
|
846
846
|
}
|
|
@@ -849,8 +849,8 @@ const Kt = {
|
|
|
849
849
|
b && !a && /* @__PURE__ */ e(
|
|
850
850
|
"svg",
|
|
851
851
|
{
|
|
852
|
-
width:
|
|
853
|
-
height:
|
|
852
|
+
width: u - 4,
|
|
853
|
+
height: u - 4,
|
|
854
854
|
viewBox: "0 0 10 10",
|
|
855
855
|
fill: "none",
|
|
856
856
|
style: { animation: "lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards" },
|
|
@@ -860,8 +860,8 @@ const Kt = {
|
|
|
860
860
|
a && /* @__PURE__ */ e(
|
|
861
861
|
"svg",
|
|
862
862
|
{
|
|
863
|
-
width:
|
|
864
|
-
height:
|
|
863
|
+
width: u - 4,
|
|
864
|
+
height: u - 4,
|
|
865
865
|
viewBox: "0 0 10 10",
|
|
866
866
|
fill: "none",
|
|
867
867
|
style: { animation: "lucent-cb-mark 200ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards" },
|
|
@@ -985,11 +985,11 @@ function Be({
|
|
|
985
985
|
}
|
|
986
986
|
const $e = { sm: 14, md: 16 };
|
|
987
987
|
function Jt({ value: t, label: n, size: a = "md", disabled: o, id: r, onChange: i, checked: l, ...c }) {
|
|
988
|
-
const f = re(ce), g = r ?? `lucent-radio-${Math.random().toString(36).slice(2, 7)}`, y = $e[a], d = o ?? (f == null ? void 0 : f.disabled) ?? !1, s = f ? f.value === t : !!l,
|
|
988
|
+
const f = re(ce), g = r ?? `lucent-radio-${Math.random().toString(36).slice(2, 7)}`, y = $e[a], d = o ?? (f == null ? void 0 : f.disabled) ?? !1, s = f ? f.value === t : !!l, u = F(s), [v, m] = z(0);
|
|
989
989
|
B(() => {
|
|
990
|
-
!d &&
|
|
990
|
+
!d && u.current !== s && (u.current = s, m((E) => E + 1));
|
|
991
991
|
}, [s, d]);
|
|
992
|
-
const
|
|
992
|
+
const k = (E) => {
|
|
993
993
|
f == null || f.onChange(t), i == null || i(E);
|
|
994
994
|
}, b = {
|
|
995
995
|
width: y / 2,
|
|
@@ -1036,7 +1036,7 @@ function Jt({ value: t, label: n, size: a = "md", disabled: o, id: r, onChange:
|
|
|
1036
1036
|
name: (f == null ? void 0 : f.name) ?? c.name,
|
|
1037
1037
|
checked: s,
|
|
1038
1038
|
disabled: d,
|
|
1039
|
-
onChange:
|
|
1039
|
+
onChange: k,
|
|
1040
1040
|
style: { position: "absolute", opacity: 0, width: 0, height: 0, margin: 0, pointerEvents: "none" },
|
|
1041
1041
|
...c
|
|
1042
1042
|
}
|
|
@@ -1146,7 +1146,7 @@ const Zt = {
|
|
|
1146
1146
|
sm: { track: [28, 16], thumb: 12 },
|
|
1147
1147
|
md: { track: [36, 20], thumb: 16 },
|
|
1148
1148
|
lg: { track: [44, 24], thumb: 20 }
|
|
1149
|
-
},
|
|
1149
|
+
}, Z = "cubic-bezier(0.34, 1.56, 0.64, 1)", We = `
|
|
1150
1150
|
@keyframes lucent-toggle-pop {
|
|
1151
1151
|
0% { transform: scale(1); }
|
|
1152
1152
|
35% { transform: scale(0.94); }
|
|
@@ -1165,12 +1165,12 @@ function en({
|
|
|
1165
1165
|
style: c,
|
|
1166
1166
|
...f
|
|
1167
1167
|
}) {
|
|
1168
|
-
const g = i ?? `lucent-toggle-${Math.random().toString(36).slice(2, 7)}`, y = a !== void 0, [d, s] = z(o ?? !1),
|
|
1168
|
+
const g = i ?? `lucent-toggle-${Math.random().toString(36).slice(2, 7)}`, y = a !== void 0, [d, s] = z(o ?? !1), u = y ? !!a : d, v = F(u), [m, k] = z(0);
|
|
1169
1169
|
B(() => {
|
|
1170
|
-
!r && v.current !==
|
|
1171
|
-
}, [
|
|
1172
|
-
const { track: [b, x], thumb: E } = Pe[n],
|
|
1173
|
-
y || s(
|
|
1170
|
+
!r && v.current !== u && (v.current = u, k((C) => C + 1));
|
|
1171
|
+
}, [u, r]);
|
|
1172
|
+
const { track: [b, x], thumb: E } = Pe[n], T = u ? b - E - 2 : 2, p = (C) => {
|
|
1173
|
+
y || s(C.target.checked), l == null || l(C);
|
|
1174
1174
|
};
|
|
1175
1175
|
return /* @__PURE__ */ h(V, { children: [
|
|
1176
1176
|
/* @__PURE__ */ e("style", { children: We }),
|
|
@@ -1197,8 +1197,8 @@ function en({
|
|
|
1197
1197
|
id: g,
|
|
1198
1198
|
checked: y ? a : d,
|
|
1199
1199
|
disabled: r,
|
|
1200
|
-
onChange:
|
|
1201
|
-
"aria-checked":
|
|
1200
|
+
onChange: p,
|
|
1201
|
+
"aria-checked": u,
|
|
1202
1202
|
style: { position: "absolute", opacity: 0, width: 0, height: 0, margin: 0, pointerEvents: "none" },
|
|
1203
1203
|
...f
|
|
1204
1204
|
}
|
|
@@ -1212,10 +1212,10 @@ function en({
|
|
|
1212
1212
|
width: b,
|
|
1213
1213
|
height: x,
|
|
1214
1214
|
borderRadius: x / 2,
|
|
1215
|
-
background: r ? "var(--lucent-bg-muted)" :
|
|
1215
|
+
background: r ? "var(--lucent-bg-muted)" : u ? "var(--lucent-accent-default)" : "var(--lucent-border-strong)",
|
|
1216
1216
|
flexShrink: 0,
|
|
1217
1217
|
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
1218
|
-
animation: m > 0 ? `lucent-toggle-pop 240ms ${
|
|
1218
|
+
animation: m > 0 ? `lucent-toggle-pop 240ms ${Z} forwards` : void 0
|
|
1219
1219
|
},
|
|
1220
1220
|
children: /* @__PURE__ */ e(
|
|
1221
1221
|
"span",
|
|
@@ -1223,13 +1223,13 @@ function en({
|
|
|
1223
1223
|
style: {
|
|
1224
1224
|
position: "absolute",
|
|
1225
1225
|
top: 2,
|
|
1226
|
-
left:
|
|
1226
|
+
left: T,
|
|
1227
1227
|
width: E,
|
|
1228
1228
|
height: E,
|
|
1229
1229
|
borderRadius: "50%",
|
|
1230
1230
|
background: "#ffffff",
|
|
1231
1231
|
boxShadow: "0 1px 3px rgb(0 0 0 / 0.2)",
|
|
1232
|
-
transition: `left 260ms ${
|
|
1232
|
+
transition: `left 260ms ${Z}`
|
|
1233
1233
|
}
|
|
1234
1234
|
}
|
|
1235
1235
|
)
|
|
@@ -1357,26 +1357,26 @@ const tn = {
|
|
|
1357
1357
|
transition: "border-color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
1358
1358
|
...f
|
|
1359
1359
|
},
|
|
1360
|
-
onMouseEnter: (
|
|
1360
|
+
onMouseEnter: (u) => {
|
|
1361
1361
|
var v;
|
|
1362
|
-
!l &&
|
|
1362
|
+
!l && u.currentTarget !== document.activeElement && (u.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-strong)"), (v = g.onMouseEnter) == null || v.call(g, u);
|
|
1363
1363
|
},
|
|
1364
|
-
onMouseLeave: (
|
|
1364
|
+
onMouseLeave: (u) => {
|
|
1365
1365
|
var v;
|
|
1366
|
-
!l &&
|
|
1366
|
+
!l && u.currentTarget !== document.activeElement && (u.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-default)"), (v = g.onMouseLeave) == null || v.call(g, u);
|
|
1367
1367
|
},
|
|
1368
|
-
onFocus: (
|
|
1368
|
+
onFocus: (u) => {
|
|
1369
1369
|
var v;
|
|
1370
|
-
|
|
1370
|
+
u.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-focus-ring)", u.currentTarget.style.boxShadow = `0 0 0 3px ${s ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}`, (v = g.onFocus) == null || v.call(g, u);
|
|
1371
1371
|
},
|
|
1372
|
-
onBlur: (
|
|
1372
|
+
onBlur: (u) => {
|
|
1373
1373
|
var v;
|
|
1374
|
-
|
|
1374
|
+
u.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-default)", u.currentTarget.style.boxShadow = "none", (v = g.onBlur) == null || v.call(g, u);
|
|
1375
1375
|
},
|
|
1376
1376
|
...g,
|
|
1377
1377
|
children: [
|
|
1378
1378
|
i && /* @__PURE__ */ e("option", { value: "", disabled: !0, children: i }),
|
|
1379
|
-
t.map((
|
|
1379
|
+
t.map((u) => /* @__PURE__ */ e("option", { value: u.value, disabled: u.disabled, children: u.label }, u.value))
|
|
1380
1380
|
]
|
|
1381
1381
|
}
|
|
1382
1382
|
),
|
|
@@ -2198,14 +2198,14 @@ function hn({
|
|
|
2198
2198
|
id: c,
|
|
2199
2199
|
style: f
|
|
2200
2200
|
}) {
|
|
2201
|
-
const [g, y] = z(!1), [d, s] = z(null),
|
|
2201
|
+
const [g, y] = z(!1), [d, s] = z(null), u = F(null), v = g && o.length > 0, m = () => {
|
|
2202
2202
|
n("");
|
|
2203
|
-
},
|
|
2204
|
-
r == null || r(
|
|
2203
|
+
}, k = (T) => {
|
|
2204
|
+
r == null || r(T), y(!1);
|
|
2205
2205
|
}, b = () => {
|
|
2206
|
-
|
|
2206
|
+
u.current = setTimeout(() => y(!1), 150);
|
|
2207
2207
|
}, x = () => {
|
|
2208
|
-
|
|
2208
|
+
u.current && clearTimeout(u.current), y(!0);
|
|
2209
2209
|
}, E = i ? /* @__PURE__ */ e(Ae, { size: "sm" }) : t ? /* @__PURE__ */ e(
|
|
2210
2210
|
"button",
|
|
2211
2211
|
{
|
|
@@ -2222,11 +2222,11 @@ function hn({
|
|
|
2222
2222
|
borderRadius: "var(--lucent-radius-sm)",
|
|
2223
2223
|
color: "var(--lucent-text-secondary)"
|
|
2224
2224
|
},
|
|
2225
|
-
onMouseEnter: (
|
|
2226
|
-
|
|
2225
|
+
onMouseEnter: (T) => {
|
|
2226
|
+
T.currentTarget.style.color = "var(--lucent-text-primary)";
|
|
2227
2227
|
},
|
|
2228
|
-
onMouseLeave: (
|
|
2229
|
-
|
|
2228
|
+
onMouseLeave: (T) => {
|
|
2229
|
+
T.currentTarget.style.color = "var(--lucent-text-secondary)";
|
|
2230
2230
|
},
|
|
2231
2231
|
children: /* @__PURE__ */ e(tt, {})
|
|
2232
2232
|
}
|
|
@@ -2238,7 +2238,7 @@ function hn({
|
|
|
2238
2238
|
id: c,
|
|
2239
2239
|
type: "search",
|
|
2240
2240
|
value: t,
|
|
2241
|
-
onChange: (
|
|
2241
|
+
onChange: (T) => n(T.target.value),
|
|
2242
2242
|
placeholder: a,
|
|
2243
2243
|
disabled: l,
|
|
2244
2244
|
leftElement: /* @__PURE__ */ e(et, {}),
|
|
@@ -2263,23 +2263,23 @@ function hn({
|
|
|
2263
2263
|
boxShadow: "var(--lucent-shadow-md)",
|
|
2264
2264
|
overflow: "hidden"
|
|
2265
2265
|
},
|
|
2266
|
-
children: o.map((
|
|
2266
|
+
children: o.map((T, p) => /* @__PURE__ */ e(
|
|
2267
2267
|
"div",
|
|
2268
2268
|
{
|
|
2269
2269
|
role: "option",
|
|
2270
2270
|
"aria-selected": !1,
|
|
2271
|
-
onMouseDown: () =>
|
|
2272
|
-
onMouseEnter: () => s(
|
|
2271
|
+
onMouseDown: () => k(T),
|
|
2272
|
+
onMouseEnter: () => s(p),
|
|
2273
2273
|
onMouseLeave: () => s(null),
|
|
2274
2274
|
style: {
|
|
2275
2275
|
padding: "var(--lucent-space-2) var(--lucent-space-3)",
|
|
2276
2276
|
cursor: "pointer",
|
|
2277
|
-
background: d ===
|
|
2277
|
+
background: d === p ? "var(--lucent-bg-subtle)" : "transparent",
|
|
2278
2278
|
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
2279
2279
|
},
|
|
2280
|
-
children: /* @__PURE__ */ e(q, { as: "span", size: "md", children:
|
|
2280
|
+
children: /* @__PURE__ */ e(q, { as: "span", size: "md", children: T.label })
|
|
2281
2281
|
},
|
|
2282
|
-
|
|
2282
|
+
T.id
|
|
2283
2283
|
))
|
|
2284
2284
|
}
|
|
2285
2285
|
)
|
|
@@ -2826,7 +2826,7 @@ const wn = {
|
|
|
2826
2826
|
circle: "var(--lucent-radius-full)",
|
|
2827
2827
|
rectangle: "var(--lucent-radius-md)"
|
|
2828
2828
|
};
|
|
2829
|
-
function
|
|
2829
|
+
function ee({
|
|
2830
2830
|
width: t,
|
|
2831
2831
|
height: n,
|
|
2832
2832
|
radius: a,
|
|
@@ -2868,7 +2868,7 @@ function kn({
|
|
|
2868
2868
|
return t === "text" && o > 1 ? /* @__PURE__ */ h(V, { children: [
|
|
2869
2869
|
g,
|
|
2870
2870
|
/* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-2)", ...l }, children: Array.from({ length: o }).map((y, d) => /* @__PURE__ */ e(
|
|
2871
|
-
|
|
2871
|
+
ee,
|
|
2872
2872
|
{
|
|
2873
2873
|
width: d === o - 1 ? "70%" : n,
|
|
2874
2874
|
height: c,
|
|
@@ -2880,7 +2880,7 @@ function kn({
|
|
|
2880
2880
|
] }) : /* @__PURE__ */ h(V, { children: [
|
|
2881
2881
|
g,
|
|
2882
2882
|
/* @__PURE__ */ e(
|
|
2883
|
-
|
|
2883
|
+
ee,
|
|
2884
2884
|
{
|
|
2885
2885
|
width: t === "circle" ? a ?? 40 : n,
|
|
2886
2886
|
height: c,
|
|
@@ -3046,18 +3046,18 @@ function Tn({ items: t, separator: n = "/", style: a }) {
|
|
|
3046
3046
|
}
|
|
3047
3047
|
function Cn({ tabs: t, defaultValue: n, value: a, onChange: o, style: r }) {
|
|
3048
3048
|
var b;
|
|
3049
|
-
const i = a !== void 0, [l, c] = z(n ?? ((b = t[0]) == null ? void 0 : b.value) ?? ""), f = i ? a : l, [g, y] = z(null), d = F([]), [s,
|
|
3049
|
+
const i = a !== void 0, [l, c] = z(n ?? ((b = t[0]) == null ? void 0 : b.value) ?? ""), f = i ? a : l, [g, y] = z(null), d = F([]), [s, u] = z(null), v = F(!1);
|
|
3050
3050
|
ie(() => {
|
|
3051
|
-
const x = t.findIndex((
|
|
3052
|
-
E && (
|
|
3051
|
+
const x = t.findIndex((T) => T.value === f), E = d.current[x];
|
|
3052
|
+
E && (u({ left: E.offsetLeft, width: E.offsetWidth, animate: v.current }), v.current = !0);
|
|
3053
3053
|
}, [f, t]);
|
|
3054
3054
|
const m = (x) => {
|
|
3055
3055
|
i || c(x), o == null || o(x);
|
|
3056
|
-
},
|
|
3056
|
+
}, k = (x, E) => {
|
|
3057
3057
|
var D;
|
|
3058
|
-
const
|
|
3059
|
-
let
|
|
3060
|
-
x.key === "ArrowRight" && (
|
|
3058
|
+
const T = t.map((w, S) => w.disabled ? -1 : S).filter((w) => w !== -1), p = T.indexOf(E);
|
|
3059
|
+
let C = -1;
|
|
3060
|
+
x.key === "ArrowRight" && (C = T[(p + 1) % T.length] ?? -1), x.key === "ArrowLeft" && (C = T[(p - 1 + T.length) % T.length] ?? -1), x.key === "Home" && (C = T[0] ?? -1), x.key === "End" && (C = T[T.length - 1] ?? -1), C !== -1 && (x.preventDefault(), (D = d.current[C]) == null || D.focus(), m(t[C].value));
|
|
3061
3061
|
};
|
|
3062
3062
|
return /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", ...r }, children: [
|
|
3063
3063
|
/* @__PURE__ */ h(
|
|
@@ -3071,36 +3071,36 @@ function Cn({ tabs: t, defaultValue: n, value: a, onChange: o, style: r }) {
|
|
|
3071
3071
|
},
|
|
3072
3072
|
children: [
|
|
3073
3073
|
t.map((x, E) => {
|
|
3074
|
-
const
|
|
3074
|
+
const T = x.value === f, p = x.disabled ?? !1;
|
|
3075
3075
|
return /* @__PURE__ */ e(
|
|
3076
3076
|
"button",
|
|
3077
3077
|
{
|
|
3078
|
-
ref: (
|
|
3079
|
-
d.current[E] =
|
|
3078
|
+
ref: (C) => {
|
|
3079
|
+
d.current[E] = C;
|
|
3080
3080
|
},
|
|
3081
3081
|
role: "tab",
|
|
3082
|
-
"aria-selected":
|
|
3082
|
+
"aria-selected": T,
|
|
3083
3083
|
"aria-controls": `lucent-tabpanel-${x.value}`,
|
|
3084
3084
|
id: `lucent-tab-${x.value}`,
|
|
3085
|
-
disabled:
|
|
3086
|
-
tabIndex:
|
|
3085
|
+
disabled: p,
|
|
3086
|
+
tabIndex: T ? 0 : -1,
|
|
3087
3087
|
onClick: () => {
|
|
3088
|
-
|
|
3088
|
+
p || m(x.value);
|
|
3089
3089
|
},
|
|
3090
|
-
onKeyDown: (
|
|
3090
|
+
onKeyDown: (C) => k(C, E),
|
|
3091
3091
|
onMouseEnter: () => {
|
|
3092
|
-
|
|
3092
|
+
p || y(E);
|
|
3093
3093
|
},
|
|
3094
3094
|
onMouseLeave: () => y(null),
|
|
3095
3095
|
style: {
|
|
3096
3096
|
padding: "var(--lucent-space-1) var(--lucent-space-2) var(--lucent-space-3)",
|
|
3097
3097
|
background: "none",
|
|
3098
3098
|
border: "none",
|
|
3099
|
-
cursor:
|
|
3099
|
+
cursor: p ? "not-allowed" : "pointer",
|
|
3100
3100
|
fontFamily: "var(--lucent-font-family-base)",
|
|
3101
3101
|
fontSize: "var(--lucent-font-size-md)",
|
|
3102
|
-
fontWeight:
|
|
3103
|
-
color:
|
|
3102
|
+
fontWeight: T ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
3103
|
+
color: p ? "var(--lucent-text-disabled)" : T ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
|
|
3104
3104
|
transition: "color var(--lucent-duration-fast) var(--lucent-easing-default)",
|
|
3105
3105
|
whiteSpace: "nowrap",
|
|
3106
3106
|
outline: "none"
|
|
@@ -3109,7 +3109,7 @@ function Cn({ tabs: t, defaultValue: n, value: a, onChange: o, style: r }) {
|
|
|
3109
3109
|
display: "block",
|
|
3110
3110
|
padding: "var(--lucent-space-1) var(--lucent-space-3)",
|
|
3111
3111
|
borderRadius: "var(--lucent-radius-md)",
|
|
3112
|
-
background: g === E && !
|
|
3112
|
+
background: g === E && !T ? "var(--lucent-bg-subtle)" : "transparent",
|
|
3113
3113
|
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
3114
3114
|
}, children: x.label })
|
|
3115
3115
|
},
|
|
@@ -3157,15 +3157,15 @@ const ht = `
|
|
|
3157
3157
|
}
|
|
3158
3158
|
`;
|
|
3159
3159
|
function In({ trigger: t, children: n, defaultOpen: a = !1, open: o, onOpenChange: r, style: i }) {
|
|
3160
|
-
const l = o !== void 0, [c, f] = z(a), g = l ? o : c, y = F(null), [d, s] = z(g ? void 0 : 0),
|
|
3160
|
+
const l = o !== void 0, [c, f] = z(a), g = l ? o : c, y = F(null), [d, s] = z(g ? void 0 : 0), u = F(!1);
|
|
3161
3161
|
B(() => {
|
|
3162
3162
|
const m = y.current;
|
|
3163
3163
|
if (m)
|
|
3164
3164
|
if (g) {
|
|
3165
|
-
const
|
|
3166
|
-
s(
|
|
3165
|
+
const k = m.scrollHeight;
|
|
3166
|
+
s(k), u.current = !0;
|
|
3167
3167
|
const b = setTimeout(() => {
|
|
3168
|
-
s(void 0),
|
|
3168
|
+
s(void 0), u.current = !1;
|
|
3169
3169
|
}, 220);
|
|
3170
3170
|
return () => clearTimeout(b);
|
|
3171
3171
|
} else
|
|
@@ -3251,7 +3251,7 @@ function mt({ open: t }) {
|
|
|
3251
3251
|
}
|
|
3252
3252
|
);
|
|
3253
3253
|
}
|
|
3254
|
-
function
|
|
3254
|
+
function G(t) {
|
|
3255
3255
|
return typeof t == "number" ? `${t}px` : t;
|
|
3256
3256
|
}
|
|
3257
3257
|
function Mn({
|
|
@@ -3261,10 +3261,15 @@ function Mn({
|
|
|
3261
3261
|
sidebarWidth: o = 240,
|
|
3262
3262
|
headerHeight: r = 48,
|
|
3263
3263
|
sidebarCollapsed: i = !1,
|
|
3264
|
-
|
|
3265
|
-
|
|
3264
|
+
rightSidebar: l,
|
|
3265
|
+
rightSidebarWidth: c = 240,
|
|
3266
|
+
rightSidebarCollapsed: f = !1,
|
|
3267
|
+
footer: g,
|
|
3268
|
+
footerHeight: y = 28,
|
|
3269
|
+
mainStyle: d,
|
|
3270
|
+
style: s
|
|
3266
3271
|
}) {
|
|
3267
|
-
const
|
|
3272
|
+
const u = G(r), v = G(o), m = G(c), k = G(y);
|
|
3268
3273
|
return /* @__PURE__ */ h(
|
|
3269
3274
|
"div",
|
|
3270
3275
|
{
|
|
@@ -3274,7 +3279,7 @@ function Mn({
|
|
|
3274
3279
|
height: "100vh",
|
|
3275
3280
|
overflow: "hidden",
|
|
3276
3281
|
fontFamily: "var(--lucent-font-family-base)",
|
|
3277
|
-
...
|
|
3282
|
+
...s
|
|
3278
3283
|
},
|
|
3279
3284
|
children: [
|
|
3280
3285
|
n != null && /* @__PURE__ */ e(
|
|
@@ -3282,7 +3287,7 @@ function Mn({
|
|
|
3282
3287
|
{
|
|
3283
3288
|
style: {
|
|
3284
3289
|
flexShrink: 0,
|
|
3285
|
-
height:
|
|
3290
|
+
height: u,
|
|
3286
3291
|
zIndex: 10,
|
|
3287
3292
|
background: "var(--lucent-surface-default)"
|
|
3288
3293
|
},
|
|
@@ -3294,7 +3299,7 @@ function Mn({
|
|
|
3294
3299
|
"div",
|
|
3295
3300
|
{
|
|
3296
3301
|
style: {
|
|
3297
|
-
width: i ? 0 :
|
|
3302
|
+
width: i ? 0 : v,
|
|
3298
3303
|
flexShrink: 0,
|
|
3299
3304
|
overflow: "hidden",
|
|
3300
3305
|
overflowY: i ? "hidden" : "auto",
|
|
@@ -3311,17 +3316,43 @@ function Mn({
|
|
|
3311
3316
|
flex: 1,
|
|
3312
3317
|
overflowY: "auto",
|
|
3313
3318
|
minWidth: 0,
|
|
3314
|
-
margin: "0 var(--lucent-space-3) var(--lucent-space-3) 0",
|
|
3319
|
+
margin: l != null ? "0 0 var(--lucent-space-3) 0" : "0 var(--lucent-space-3) var(--lucent-space-3) 0",
|
|
3315
3320
|
border: "1px solid var(--lucent-border-default)",
|
|
3316
3321
|
borderRadius: "var(--lucent-radius-lg)",
|
|
3317
3322
|
boxShadow: "var(--lucent-shadow-sm)",
|
|
3318
3323
|
background: "var(--lucent-surface-default)",
|
|
3319
|
-
...
|
|
3324
|
+
...d
|
|
3320
3325
|
},
|
|
3321
3326
|
children: t
|
|
3322
3327
|
}
|
|
3328
|
+
),
|
|
3329
|
+
l != null && /* @__PURE__ */ e(
|
|
3330
|
+
"aside",
|
|
3331
|
+
{
|
|
3332
|
+
style: {
|
|
3333
|
+
width: f ? 0 : m,
|
|
3334
|
+
flexShrink: 0,
|
|
3335
|
+
overflow: "hidden",
|
|
3336
|
+
overflowY: f ? "hidden" : "auto",
|
|
3337
|
+
background: "var(--lucent-surface-default)",
|
|
3338
|
+
transition: "width 200ms var(--lucent-easing-default)"
|
|
3339
|
+
},
|
|
3340
|
+
children: l
|
|
3341
|
+
}
|
|
3323
3342
|
)
|
|
3324
|
-
] })
|
|
3343
|
+
] }),
|
|
3344
|
+
g != null && /* @__PURE__ */ e(
|
|
3345
|
+
"div",
|
|
3346
|
+
{
|
|
3347
|
+
style: {
|
|
3348
|
+
flexShrink: 0,
|
|
3349
|
+
height: k,
|
|
3350
|
+
zIndex: 10,
|
|
3351
|
+
background: "var(--lucent-surface-default)"
|
|
3352
|
+
},
|
|
3353
|
+
children: g
|
|
3354
|
+
}
|
|
3355
|
+
)
|
|
3325
3356
|
]
|
|
3326
3357
|
}
|
|
3327
3358
|
);
|
|
@@ -3378,21 +3409,21 @@ function zn({
|
|
|
3378
3409
|
emptyState: i,
|
|
3379
3410
|
style: l
|
|
3380
3411
|
}) {
|
|
3381
|
-
const [c, f] = z(null), [g, y] = z(0), [d, s] = z(null),
|
|
3382
|
-
const D =
|
|
3383
|
-
return c.dir === "asc" ?
|
|
3384
|
-
}) : n,
|
|
3385
|
-
|
|
3386
|
-
}, E = (
|
|
3387
|
-
f((
|
|
3388
|
-
},
|
|
3412
|
+
const [c, f] = z(null), [g, y] = z(0), [d, s] = z(null), u = o !== void 0, v = u ? o : g, m = c ? [...n].sort((p, C) => {
|
|
3413
|
+
const D = p[c.key], w = C[c.key], S = String(D ?? "").localeCompare(String(w ?? ""), void 0, { numeric: !0 });
|
|
3414
|
+
return c.dir === "asc" ? S : -S;
|
|
3415
|
+
}) : n, k = a > 0 ? m.slice(v * a, (v + 1) * a) : m, b = a > 0 ? Math.max(1, Math.ceil(m.length / a)) : 1, x = (p) => {
|
|
3416
|
+
u || y(p), r == null || r(p);
|
|
3417
|
+
}, E = (p) => {
|
|
3418
|
+
f((C) => !C || C.key !== p ? { key: p, dir: "asc" } : C.dir === "asc" ? { key: p, dir: "desc" } : null), u || y(0), r == null || r(0);
|
|
3419
|
+
}, T = [];
|
|
3389
3420
|
if (b <= 7)
|
|
3390
|
-
for (let
|
|
3421
|
+
for (let p = 0; p < b; p++) T.push(p);
|
|
3391
3422
|
else {
|
|
3392
|
-
|
|
3393
|
-
for (let
|
|
3394
|
-
|
|
3395
|
-
v < b - 3 &&
|
|
3423
|
+
T.push(0), v > 2 && T.push("…");
|
|
3424
|
+
for (let p = Math.max(1, v - 1); p <= Math.min(b - 2, v + 1); p++)
|
|
3425
|
+
T.push(p);
|
|
3426
|
+
v < b - 3 && T.push("…"), T.push(b - 1);
|
|
3396
3427
|
}
|
|
3397
3428
|
return /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-3)", ...l }, children: [
|
|
3398
3429
|
/* @__PURE__ */ e("div", { style: {
|
|
@@ -3405,46 +3436,46 @@ function zn({
|
|
|
3405
3436
|
fontFamily: "var(--lucent-font-family-base)",
|
|
3406
3437
|
fontSize: "var(--lucent-font-size-sm)"
|
|
3407
3438
|
}, children: [
|
|
3408
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { style: { borderBottom: "1px solid var(--lucent-border-default)" }, children: t.map((
|
|
3409
|
-
const
|
|
3439
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { style: { borderBottom: "1px solid var(--lucent-border-default)" }, children: t.map((p) => {
|
|
3440
|
+
const C = (c == null ? void 0 : c.key) === p.key ? c.dir : "none";
|
|
3410
3441
|
return /* @__PURE__ */ e(
|
|
3411
3442
|
"th",
|
|
3412
3443
|
{
|
|
3413
|
-
onClick:
|
|
3444
|
+
onClick: p.sortable ? () => E(p.key) : void 0,
|
|
3414
3445
|
style: {
|
|
3415
3446
|
padding: "var(--lucent-space-3) var(--lucent-space-4)",
|
|
3416
|
-
textAlign:
|
|
3447
|
+
textAlign: p.align ?? "left",
|
|
3417
3448
|
fontWeight: "var(--lucent-font-weight-medium)",
|
|
3418
3449
|
color: "var(--lucent-text-secondary)",
|
|
3419
3450
|
background: "var(--lucent-bg-subtle)",
|
|
3420
|
-
cursor:
|
|
3451
|
+
cursor: p.sortable ? "pointer" : "default",
|
|
3421
3452
|
userSelect: "none",
|
|
3422
3453
|
whiteSpace: "nowrap",
|
|
3423
|
-
...
|
|
3454
|
+
...p.width ? { width: p.width } : {}
|
|
3424
3455
|
},
|
|
3425
3456
|
children: /* @__PURE__ */ h("span", { style: { display: "inline-flex", alignItems: "center", gap: "var(--lucent-space-1)" }, children: [
|
|
3426
|
-
|
|
3427
|
-
|
|
3457
|
+
p.header,
|
|
3458
|
+
p.sortable && /* @__PURE__ */ e(gt, { state: C })
|
|
3428
3459
|
] })
|
|
3429
3460
|
},
|
|
3430
|
-
|
|
3461
|
+
p.key
|
|
3431
3462
|
);
|
|
3432
3463
|
}) }) }),
|
|
3433
|
-
/* @__PURE__ */ e("tbody", { children:
|
|
3464
|
+
/* @__PURE__ */ e("tbody", { children: k.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
3434
3465
|
"td",
|
|
3435
3466
|
{
|
|
3436
3467
|
colSpan: t.length,
|
|
3437
3468
|
style: { padding: "var(--lucent-space-12)", textAlign: "center" },
|
|
3438
3469
|
children: i ?? /* @__PURE__ */ e(q, { color: "secondary", children: "No data" })
|
|
3439
3470
|
}
|
|
3440
|
-
) }) :
|
|
3471
|
+
) }) : k.map((p, C) => /* @__PURE__ */ e(
|
|
3441
3472
|
"tr",
|
|
3442
3473
|
{
|
|
3443
|
-
onMouseEnter: () => s(
|
|
3474
|
+
onMouseEnter: () => s(C),
|
|
3444
3475
|
onMouseLeave: () => s(null),
|
|
3445
3476
|
style: {
|
|
3446
|
-
borderBottom:
|
|
3447
|
-
background: d ===
|
|
3477
|
+
borderBottom: C < k.length - 1 ? "1px solid var(--lucent-border-subtle)" : "none",
|
|
3478
|
+
background: d === C ? "var(--lucent-bg-subtle)" : "var(--lucent-surface-default)",
|
|
3448
3479
|
transition: "background var(--lucent-duration-fast) var(--lucent-easing-default)"
|
|
3449
3480
|
},
|
|
3450
3481
|
children: t.map((D) => /* @__PURE__ */ e(
|
|
@@ -3456,12 +3487,12 @@ function zn({
|
|
|
3456
3487
|
textAlign: D.align ?? "left",
|
|
3457
3488
|
verticalAlign: "middle"
|
|
3458
3489
|
},
|
|
3459
|
-
children: D.render ? D.render(
|
|
3490
|
+
children: D.render ? D.render(p, C) : String(p[D.key] ?? "")
|
|
3460
3491
|
},
|
|
3461
3492
|
D.key
|
|
3462
3493
|
))
|
|
3463
3494
|
},
|
|
3464
|
-
|
|
3495
|
+
C
|
|
3465
3496
|
)) })
|
|
3466
3497
|
] }) }),
|
|
3467
3498
|
a > 0 && m.length > 0 && /* @__PURE__ */ h("div", { style: {
|
|
@@ -3474,7 +3505,7 @@ function zn({
|
|
|
3474
3505
|
/* @__PURE__ */ e(q, { color: "secondary", size: "sm", children: m.length === 1 ? "1 row" : `${v * a + 1}–${Math.min((v + 1) * a, m.length)} of ${m.length} rows` }),
|
|
3475
3506
|
/* @__PURE__ */ h("div", { style: { display: "flex", alignItems: "center", gap: "var(--lucent-space-1)" }, children: [
|
|
3476
3507
|
/* @__PURE__ */ e(
|
|
3477
|
-
|
|
3508
|
+
Y,
|
|
3478
3509
|
{
|
|
3479
3510
|
onClick: () => x(v - 1),
|
|
3480
3511
|
disabled: v === 0,
|
|
@@ -3482,25 +3513,25 @@ function zn({
|
|
|
3482
3513
|
children: /* @__PURE__ */ e(te, { dir: "left" })
|
|
3483
3514
|
}
|
|
3484
3515
|
),
|
|
3485
|
-
|
|
3486
|
-
(
|
|
3516
|
+
T.map(
|
|
3517
|
+
(p, C) => p === "…" ? /* @__PURE__ */ e("span", { style: {
|
|
3487
3518
|
padding: "0 var(--lucent-space-1)",
|
|
3488
3519
|
color: "var(--lucent-text-disabled)",
|
|
3489
3520
|
fontSize: "var(--lucent-font-size-sm)"
|
|
3490
|
-
}, children: "…" }, `ellipsis-${
|
|
3491
|
-
|
|
3521
|
+
}, children: "…" }, `ellipsis-${C}`) : /* @__PURE__ */ e(
|
|
3522
|
+
Y,
|
|
3492
3523
|
{
|
|
3493
|
-
onClick: () => x(
|
|
3494
|
-
active:
|
|
3495
|
-
"aria-label": `Page ${
|
|
3496
|
-
"aria-current":
|
|
3497
|
-
children:
|
|
3524
|
+
onClick: () => x(p),
|
|
3525
|
+
active: p === v,
|
|
3526
|
+
"aria-label": `Page ${p + 1}`,
|
|
3527
|
+
"aria-current": p === v ? "page" : void 0,
|
|
3528
|
+
children: p + 1
|
|
3498
3529
|
},
|
|
3499
|
-
|
|
3530
|
+
p
|
|
3500
3531
|
)
|
|
3501
3532
|
),
|
|
3502
3533
|
/* @__PURE__ */ e(
|
|
3503
|
-
|
|
3534
|
+
Y,
|
|
3504
3535
|
{
|
|
3505
3536
|
onClick: () => x(v + 1),
|
|
3506
3537
|
disabled: v >= b - 1,
|
|
@@ -3512,7 +3543,7 @@ function zn({
|
|
|
3512
3543
|
] })
|
|
3513
3544
|
] });
|
|
3514
3545
|
}
|
|
3515
|
-
function
|
|
3546
|
+
function Y({
|
|
3516
3547
|
children: t,
|
|
3517
3548
|
onClick: n,
|
|
3518
3549
|
disabled: a,
|
|
@@ -3659,21 +3690,21 @@ function qn({
|
|
|
3659
3690
|
onOpenChange: r,
|
|
3660
3691
|
style: i
|
|
3661
3692
|
}) {
|
|
3662
|
-
const l = o !== void 0, [c, f] = z(!1), g = l ? o : c, [y, d] = z(""), [s,
|
|
3663
|
-
if (!
|
|
3693
|
+
const l = o !== void 0, [c, f] = z(!1), g = l ? o : c, [y, d] = z(""), [s, u] = z(0), v = F(null), m = F(null), k = F(!1);
|
|
3694
|
+
if (!k.current) {
|
|
3664
3695
|
const w = document.createElement("style");
|
|
3665
|
-
w.textContent = vt, document.head.appendChild(w),
|
|
3696
|
+
w.textContent = vt, document.head.appendChild(w), k.current = !0;
|
|
3666
3697
|
}
|
|
3667
|
-
const b =
|
|
3698
|
+
const b = Q((w) => {
|
|
3668
3699
|
l || f(w), r == null || r(w);
|
|
3669
3700
|
}, [l, r]);
|
|
3670
3701
|
B(() => {
|
|
3671
|
-
const w = (
|
|
3672
|
-
(
|
|
3702
|
+
const w = (S) => {
|
|
3703
|
+
(S.metaKey || S.ctrlKey) && S.key === a && (S.preventDefault(), b(!g));
|
|
3673
3704
|
};
|
|
3674
3705
|
return window.addEventListener("keydown", w), () => window.removeEventListener("keydown", w);
|
|
3675
3706
|
}, [g, a, b]), B(() => {
|
|
3676
|
-
g && (d(""),
|
|
3707
|
+
g && (d(""), u(0), setTimeout(() => {
|
|
3677
3708
|
var w;
|
|
3678
3709
|
return (w = v.current) == null ? void 0 : w.focus();
|
|
3679
3710
|
}, 10));
|
|
@@ -3682,24 +3713,24 @@ function qn({
|
|
|
3682
3713
|
B(() => {
|
|
3683
3714
|
const w = m.current;
|
|
3684
3715
|
if (!w) return;
|
|
3685
|
-
const
|
|
3686
|
-
|
|
3716
|
+
const S = w.querySelector('[data-active="true"]');
|
|
3717
|
+
S == null || S.scrollIntoView({ block: "nearest" });
|
|
3687
3718
|
}, [s]);
|
|
3688
|
-
const
|
|
3719
|
+
const T = (w) => {
|
|
3689
3720
|
w.disabled || (w.onSelect(), b(!1));
|
|
3690
|
-
},
|
|
3721
|
+
}, p = (w) => {
|
|
3691
3722
|
if (w.key === "Escape") {
|
|
3692
3723
|
b(!1);
|
|
3693
3724
|
return;
|
|
3694
3725
|
}
|
|
3695
|
-
if (w.key === "ArrowDown" && (w.preventDefault(),
|
|
3696
|
-
const
|
|
3697
|
-
|
|
3726
|
+
if (w.key === "ArrowDown" && (w.preventDefault(), u((S) => Math.min(S + 1, E.length - 1))), w.key === "ArrowUp" && (w.preventDefault(), u((S) => Math.max(S - 1, 0))), w.key === "Enter") {
|
|
3727
|
+
const S = E[s];
|
|
3728
|
+
S && T(S);
|
|
3698
3729
|
}
|
|
3699
|
-
},
|
|
3730
|
+
}, C = [];
|
|
3700
3731
|
for (const w of x) {
|
|
3701
|
-
const
|
|
3702
|
-
|
|
3732
|
+
const S = C[C.length - 1];
|
|
3733
|
+
S && S.group === w.group ? S.items.push(w) : C.push({ group: w.group, items: [w] });
|
|
3703
3734
|
}
|
|
3704
3735
|
if (!g) return null;
|
|
3705
3736
|
let D = 0;
|
|
@@ -3760,9 +3791,9 @@ function qn({
|
|
|
3760
3791
|
"aria-controls": "lucent-command-list",
|
|
3761
3792
|
value: y,
|
|
3762
3793
|
onChange: (w) => {
|
|
3763
|
-
d(w.target.value),
|
|
3794
|
+
d(w.target.value), u(0);
|
|
3764
3795
|
},
|
|
3765
|
-
onKeyDown:
|
|
3796
|
+
onKeyDown: p,
|
|
3766
3797
|
placeholder: n,
|
|
3767
3798
|
style: {
|
|
3768
3799
|
flex: 1,
|
|
@@ -3799,12 +3830,12 @@ function qn({
|
|
|
3799
3830
|
'No results for "',
|
|
3800
3831
|
y,
|
|
3801
3832
|
'"'
|
|
3802
|
-
] }) }) :
|
|
3833
|
+
] }) }) : C.map(({ group: w, items: S }, P) => /* @__PURE__ */ h("div", { children: [
|
|
3803
3834
|
w && /* @__PURE__ */ e("div", { style: {
|
|
3804
3835
|
padding: "var(--lucent-space-2) var(--lucent-space-4) var(--lucent-space-1)",
|
|
3805
3836
|
...P > 0 ? { borderTop: "1px solid var(--lucent-border-subtle)", marginTop: "var(--lucent-space-1)" } : {}
|
|
3806
3837
|
}, children: /* @__PURE__ */ e(q, { size: "xs", color: "secondary", weight: "medium", children: w }) }),
|
|
3807
|
-
|
|
3838
|
+
S.map((N) => {
|
|
3808
3839
|
const $ = N.disabled ?? !1;
|
|
3809
3840
|
let I = !1;
|
|
3810
3841
|
return $ || (I = D === s, D++), /* @__PURE__ */ h(
|
|
@@ -3814,11 +3845,11 @@ function qn({
|
|
|
3814
3845
|
"aria-selected": I,
|
|
3815
3846
|
"aria-disabled": $,
|
|
3816
3847
|
"data-active": I,
|
|
3817
|
-
onClick: () =>
|
|
3848
|
+
onClick: () => T(N),
|
|
3818
3849
|
onMouseEnter: () => {
|
|
3819
3850
|
if (!$) {
|
|
3820
3851
|
const M = E.indexOf(N);
|
|
3821
|
-
M !== -1 &&
|
|
3852
|
+
M !== -1 && u(M);
|
|
3822
3853
|
}
|
|
3823
3854
|
},
|
|
3824
3855
|
style: {
|
|
@@ -3855,7 +3886,7 @@ function qn({
|
|
|
3855
3886
|
["↑↓", "Navigate"],
|
|
3856
3887
|
["↵", "Select"],
|
|
3857
3888
|
["Esc", "Close"]
|
|
3858
|
-
].map(([w,
|
|
3889
|
+
].map(([w, S]) => /* @__PURE__ */ h("span", { style: { display: "flex", alignItems: "center", gap: "var(--lucent-space-1)" }, children: [
|
|
3859
3890
|
/* @__PURE__ */ e("kbd", { style: {
|
|
3860
3891
|
padding: "1px 5px",
|
|
3861
3892
|
borderRadius: "var(--lucent-radius-sm)",
|
|
@@ -3865,7 +3896,7 @@ function qn({
|
|
|
3865
3896
|
fontSize: "var(--lucent-font-size-xs)",
|
|
3866
3897
|
color: "var(--lucent-text-secondary)"
|
|
3867
3898
|
}, children: w }),
|
|
3868
|
-
/* @__PURE__ */ e(q, { size: "xs", color: "secondary", children:
|
|
3899
|
+
/* @__PURE__ */ e(q, { size: "xs", color: "secondary", children: S })
|
|
3869
3900
|
] }, w)) })
|
|
3870
3901
|
]
|
|
3871
3902
|
}
|
|
@@ -4008,12 +4039,12 @@ function An({
|
|
|
4008
4039
|
max: l,
|
|
4009
4040
|
style: c
|
|
4010
4041
|
}) {
|
|
4011
|
-
const f = n !== void 0, [g, y] = z(a), d = f ? n : g, [s,
|
|
4042
|
+
const f = n !== void 0, [g, y] = z(a), d = f ? n : g, [s, u] = z(!1), [v, m] = z(""), [k, b] = z(0), [x, E] = z(!1), T = F(null), p = F(null), C = le();
|
|
4012
4043
|
B(() => {
|
|
4013
4044
|
if (!s) return;
|
|
4014
4045
|
const I = (M) => {
|
|
4015
4046
|
var R;
|
|
4016
|
-
(R =
|
|
4047
|
+
(R = T.current) != null && R.contains(M.target) || (u(!1), m(""));
|
|
4017
4048
|
};
|
|
4018
4049
|
return document.addEventListener("mousedown", I), () => document.removeEventListener("mousedown", I);
|
|
4019
4050
|
}, [s]);
|
|
@@ -4023,27 +4054,27 @@ function An({
|
|
|
4023
4054
|
}, w = (I) => {
|
|
4024
4055
|
const M = d.filter((R) => R !== I);
|
|
4025
4056
|
f || y(M), o == null || o(M);
|
|
4026
|
-
},
|
|
4057
|
+
}, S = t.filter(
|
|
4027
4058
|
(I) => I.label.toLowerCase().includes(v.toLowerCase())
|
|
4028
4059
|
), P = (I) => {
|
|
4029
4060
|
if (I.key === "Escape") {
|
|
4030
|
-
|
|
4061
|
+
u(!1), m("");
|
|
4031
4062
|
return;
|
|
4032
4063
|
}
|
|
4033
|
-
if (I.key === "ArrowDown" && (I.preventDefault(),
|
|
4064
|
+
if (I.key === "ArrowDown" && (I.preventDefault(), u(!0), b((M) => Math.min(M + 1, S.length - 1))), I.key === "ArrowUp" && (I.preventDefault(), b((M) => Math.max(M - 1, 0))), I.key === "Enter") {
|
|
4034
4065
|
I.preventDefault();
|
|
4035
|
-
const M = k
|
|
4066
|
+
const M = S[k];
|
|
4036
4067
|
M && !M.disabled && D(M.value);
|
|
4037
4068
|
}
|
|
4038
4069
|
I.key === "Backspace" && v === "" && d.length > 0 && w(d[d.length - 1]);
|
|
4039
4070
|
}, N = l !== void 0 && d.length >= l, $ = i ? "var(--lucent-border-default)" : x ? "var(--lucent-accent-default)" : "var(--lucent-border-default)";
|
|
4040
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
4071
|
+
return /* @__PURE__ */ h("div", { ref: T, style: { position: "relative", ...c }, children: [
|
|
4041
4072
|
/* @__PURE__ */ h(
|
|
4042
4073
|
"div",
|
|
4043
4074
|
{
|
|
4044
4075
|
onClick: () => {
|
|
4045
4076
|
var I;
|
|
4046
|
-
i || (
|
|
4077
|
+
i || (u(!0), (I = p.current) == null || I.focus());
|
|
4047
4078
|
},
|
|
4048
4079
|
style: {
|
|
4049
4080
|
display: "flex",
|
|
@@ -4068,10 +4099,10 @@ function An({
|
|
|
4068
4099
|
/* @__PURE__ */ e(
|
|
4069
4100
|
"input",
|
|
4070
4101
|
{
|
|
4071
|
-
ref:
|
|
4102
|
+
ref: p,
|
|
4072
4103
|
value: v,
|
|
4073
4104
|
onChange: (I) => {
|
|
4074
|
-
m(I.target.value),
|
|
4105
|
+
m(I.target.value), u(!0), b(0);
|
|
4075
4106
|
},
|
|
4076
4107
|
onKeyDown: P,
|
|
4077
4108
|
onFocus: () => E(!0),
|
|
@@ -4079,7 +4110,7 @@ function An({
|
|
|
4079
4110
|
disabled: i,
|
|
4080
4111
|
placeholder: d.length === 0 ? r : "",
|
|
4081
4112
|
"aria-autocomplete": "list",
|
|
4082
|
-
"aria-controls":
|
|
4113
|
+
"aria-controls": C,
|
|
4083
4114
|
"aria-expanded": s,
|
|
4084
4115
|
role: "combobox",
|
|
4085
4116
|
style: {
|
|
@@ -4102,7 +4133,7 @@ function An({
|
|
|
4102
4133
|
s && !i && /* @__PURE__ */ h(
|
|
4103
4134
|
"div",
|
|
4104
4135
|
{
|
|
4105
|
-
id:
|
|
4136
|
+
id: C,
|
|
4106
4137
|
role: "listbox",
|
|
4107
4138
|
"aria-multiselectable": "true",
|
|
4108
4139
|
style: {
|
|
@@ -4120,8 +4151,8 @@ function An({
|
|
|
4120
4151
|
padding: "var(--lucent-space-1) 0"
|
|
4121
4152
|
},
|
|
4122
4153
|
children: [
|
|
4123
|
-
|
|
4124
|
-
const R = d.includes(I.value), O = M ===
|
|
4154
|
+
S.length === 0 ? /* @__PURE__ */ e("div", { style: { padding: "var(--lucent-space-3) var(--lucent-space-4)" }, children: /* @__PURE__ */ e(q, { color: "secondary", size: "sm", children: "No options" }) }) : S.map((I, M) => {
|
|
4155
|
+
const R = d.includes(I.value), O = M === k, W = I.disabled ?? !1, U = N && !R;
|
|
4125
4156
|
return /* @__PURE__ */ h(
|
|
4126
4157
|
"div",
|
|
4127
4158
|
{
|
|
@@ -4274,10 +4305,10 @@ function xt(t, n) {
|
|
|
4274
4305
|
function wt(t, n) {
|
|
4275
4306
|
return new Date(t, n, 1).getDay();
|
|
4276
4307
|
}
|
|
4277
|
-
function
|
|
4308
|
+
function _(t, n) {
|
|
4278
4309
|
return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
|
|
4279
4310
|
}
|
|
4280
|
-
function
|
|
4311
|
+
function K(t, n) {
|
|
4281
4312
|
return new Date(t.getFullYear(), t.getMonth(), t.getDate()) < new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
4282
4313
|
}
|
|
4283
4314
|
function ne(t, n) {
|
|
@@ -4337,7 +4368,7 @@ function ae({ dir: t, onClick: n, disabled: a }) {
|
|
|
4337
4368
|
}
|
|
4338
4369
|
);
|
|
4339
4370
|
}
|
|
4340
|
-
function
|
|
4371
|
+
function X({
|
|
4341
4372
|
year: t,
|
|
4342
4373
|
month: n,
|
|
4343
4374
|
selected: a,
|
|
@@ -4349,9 +4380,9 @@ function K({
|
|
|
4349
4380
|
onNextMonth: f,
|
|
4350
4381
|
highlightRange: g
|
|
4351
4382
|
}) {
|
|
4352
|
-
const y = xt(t, n), d = wt(t, n), [s,
|
|
4383
|
+
const y = xt(t, n), d = wt(t, n), [s, u] = z(null), v = [
|
|
4353
4384
|
...Array(d).fill(null),
|
|
4354
|
-
...Array.from({ length: y }, (m,
|
|
4385
|
+
...Array.from({ length: y }, (m, k) => k + 1)
|
|
4355
4386
|
];
|
|
4356
4387
|
for (; v.length % 7 !== 0; ) v.push(null);
|
|
4357
4388
|
return /* @__PURE__ */ h("div", { children: [
|
|
@@ -4365,18 +4396,18 @@ function K({
|
|
|
4365
4396
|
/* @__PURE__ */ e(ae, { dir: "next", onClick: f })
|
|
4366
4397
|
] }),
|
|
4367
4398
|
/* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 2, marginBottom: "var(--lucent-space-1)" }, children: St.map((m) => /* @__PURE__ */ e("div", { style: { textAlign: "center" }, children: /* @__PURE__ */ e(q, { size: "xs", color: "secondary", children: m }) }, m)) }),
|
|
4368
|
-
/* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 2 }, children: v.map((m,
|
|
4369
|
-
if (!m) return /* @__PURE__ */ e("div", {},
|
|
4370
|
-
const b = new Date(t, n, m), x = a ?
|
|
4371
|
-
let
|
|
4372
|
-
return g != null && g.start && (g != null && g.end) && (
|
|
4399
|
+
/* @__PURE__ */ e("div", { style: { display: "grid", gridTemplateColumns: "repeat(7, 1fr)", gap: 2 }, children: v.map((m, k) => {
|
|
4400
|
+
if (!m) return /* @__PURE__ */ e("div", {}, k);
|
|
4401
|
+
const b = new Date(t, n, m), x = a ? _(b, a) : !1, E = _(b, o), T = (r ? K(b, r) : !1) || (i ? ne(b, i) : !1);
|
|
4402
|
+
let p = !1;
|
|
4403
|
+
return g != null && g.start && (g != null && g.end) && (p = !K(b, g.start) && !ne(b, g.end)), /* @__PURE__ */ e(
|
|
4373
4404
|
"button",
|
|
4374
4405
|
{
|
|
4375
4406
|
type: "button",
|
|
4376
|
-
disabled:
|
|
4377
|
-
onClick: () => !
|
|
4378
|
-
onMouseEnter: () =>
|
|
4379
|
-
onMouseLeave: () =>
|
|
4407
|
+
disabled: T,
|
|
4408
|
+
onClick: () => !T && l(b),
|
|
4409
|
+
onMouseEnter: () => u(m),
|
|
4410
|
+
onMouseLeave: () => u(null),
|
|
4380
4411
|
"aria-label": j(b),
|
|
4381
4412
|
"aria-pressed": x,
|
|
4382
4413
|
style: {
|
|
@@ -4387,17 +4418,17 @@ function K({
|
|
|
4387
4418
|
width: "100%",
|
|
4388
4419
|
border: E && !x ? "1px solid var(--lucent-border-strong)" : "1px solid transparent",
|
|
4389
4420
|
borderRadius: "var(--lucent-radius-md)",
|
|
4390
|
-
background: x ? "var(--lucent-accent-default)" :
|
|
4391
|
-
color: x ? "var(--lucent-text-on-accent)" :
|
|
4421
|
+
background: x ? "var(--lucent-accent-default)" : p ? "var(--lucent-accent-subtle)" : s === m && !T ? "var(--lucent-bg-muted)" : "transparent",
|
|
4422
|
+
color: x ? "var(--lucent-text-on-accent)" : T ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
|
|
4392
4423
|
fontSize: "var(--lucent-font-size-sm)",
|
|
4393
4424
|
fontFamily: "var(--lucent-font-family-base)",
|
|
4394
4425
|
fontWeight: E ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
|
|
4395
|
-
cursor:
|
|
4426
|
+
cursor: T ? "not-allowed" : "pointer",
|
|
4396
4427
|
transition: "background var(--lucent-duration-fast)"
|
|
4397
4428
|
},
|
|
4398
4429
|
children: m
|
|
4399
4430
|
},
|
|
4400
|
-
|
|
4431
|
+
k
|
|
4401
4432
|
);
|
|
4402
4433
|
}) })
|
|
4403
4434
|
] });
|
|
@@ -4412,31 +4443,31 @@ function Nn({
|
|
|
4412
4443
|
max: l,
|
|
4413
4444
|
style: c
|
|
4414
4445
|
}) {
|
|
4415
|
-
const f = t !== void 0, [g, y] = z(n), d = f ? t : g, s = /* @__PURE__ */ new Date(), [
|
|
4446
|
+
const f = t !== void 0, [g, y] = z(n), d = f ? t : g, s = /* @__PURE__ */ new Date(), [u, v] = z((d ?? s).getFullYear()), [m, k] = z((d ?? s).getMonth()), [b, x] = z(!1), [E, T] = z(!1), p = F(null);
|
|
4416
4447
|
B(() => {
|
|
4417
4448
|
if (!b) return;
|
|
4418
|
-
const
|
|
4449
|
+
const S = (P) => {
|
|
4419
4450
|
var N;
|
|
4420
|
-
(N =
|
|
4451
|
+
(N = p.current) != null && N.contains(P.target) || x(!1);
|
|
4421
4452
|
};
|
|
4422
|
-
return document.addEventListener("mousedown",
|
|
4453
|
+
return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
|
|
4423
4454
|
}, [b]);
|
|
4424
|
-
const
|
|
4425
|
-
f || y(
|
|
4455
|
+
const C = (S) => {
|
|
4456
|
+
f || y(S), a == null || a(S), x(!1);
|
|
4426
4457
|
}, D = () => {
|
|
4427
|
-
m === 0 ? (
|
|
4458
|
+
m === 0 ? (k(11), v((S) => S - 1)) : k((S) => S - 1);
|
|
4428
4459
|
}, w = () => {
|
|
4429
|
-
m === 11 ? (
|
|
4460
|
+
m === 11 ? (k(0), v((S) => S + 1)) : k((S) => S + 1);
|
|
4430
4461
|
};
|
|
4431
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
4462
|
+
return /* @__PURE__ */ h("div", { ref: p, style: { position: "relative", display: "inline-block", ...c }, children: [
|
|
4432
4463
|
/* @__PURE__ */ h(
|
|
4433
4464
|
"button",
|
|
4434
4465
|
{
|
|
4435
4466
|
type: "button",
|
|
4436
4467
|
disabled: r,
|
|
4437
|
-
onClick: () => !r && x((
|
|
4438
|
-
onFocus: () =>
|
|
4439
|
-
onBlur: () =>
|
|
4468
|
+
onClick: () => !r && x((S) => !S),
|
|
4469
|
+
onFocus: () => T(!0),
|
|
4470
|
+
onBlur: () => T(!1),
|
|
4440
4471
|
"aria-haspopup": "dialog",
|
|
4441
4472
|
"aria-expanded": b,
|
|
4442
4473
|
style: {
|
|
@@ -4484,15 +4515,15 @@ function Nn({
|
|
|
4484
4515
|
minWidth: 260
|
|
4485
4516
|
},
|
|
4486
4517
|
children: /* @__PURE__ */ e(
|
|
4487
|
-
|
|
4518
|
+
X,
|
|
4488
4519
|
{
|
|
4489
|
-
year:
|
|
4520
|
+
year: u,
|
|
4490
4521
|
month: m,
|
|
4491
4522
|
...d !== void 0 && { selected: d },
|
|
4492
4523
|
today: s,
|
|
4493
4524
|
...i !== void 0 && { min: i },
|
|
4494
4525
|
...l !== void 0 && { max: l },
|
|
4495
|
-
onSelect:
|
|
4526
|
+
onSelect: C,
|
|
4496
4527
|
onPrevMonth: D,
|
|
4497
4528
|
onNextMonth: w
|
|
4498
4529
|
}
|
|
@@ -4588,7 +4619,7 @@ const Rn = {
|
|
|
4588
4619
|
}
|
|
4589
4620
|
};
|
|
4590
4621
|
function Tt(t, n) {
|
|
4591
|
-
return t ?
|
|
4622
|
+
return t ? _(t.start, t.end) ? j(t.start) : `${j(t.start)} → ${j(t.end)}` : n;
|
|
4592
4623
|
}
|
|
4593
4624
|
function Ln({
|
|
4594
4625
|
value: t,
|
|
@@ -4600,38 +4631,38 @@ function Ln({
|
|
|
4600
4631
|
max: l,
|
|
4601
4632
|
style: c
|
|
4602
4633
|
}) {
|
|
4603
|
-
const f = t !== void 0, [g, y] = z(n), d = f ? t : g, [s,
|
|
4634
|
+
const f = t !== void 0, [g, y] = z(n), d = f ? t : g, [s, u] = z(null), v = /* @__PURE__ */ new Date(), [m, k] = z(((d == null ? void 0 : d.start) ?? v).getFullYear()), [b, x] = z(((d == null ? void 0 : d.start) ?? v).getMonth()), E = b === 11 ? 0 : b + 1, T = b === 11 ? m + 1 : m, [p, C] = z(!1), [D, w] = z(!1), S = F(null);
|
|
4604
4635
|
B(() => {
|
|
4605
|
-
if (!
|
|
4636
|
+
if (!p) return;
|
|
4606
4637
|
const M = (R) => {
|
|
4607
4638
|
var O;
|
|
4608
|
-
(O =
|
|
4639
|
+
(O = S.current) != null && O.contains(R.target) || (C(!1), u(null));
|
|
4609
4640
|
};
|
|
4610
4641
|
return document.addEventListener("mousedown", M), () => document.removeEventListener("mousedown", M);
|
|
4611
|
-
}, [
|
|
4642
|
+
}, [p]);
|
|
4612
4643
|
const P = (M) => {
|
|
4613
4644
|
if (!s)
|
|
4614
|
-
|
|
4645
|
+
u(M);
|
|
4615
4646
|
else {
|
|
4616
|
-
const [R, O] =
|
|
4617
|
-
f || y(W), a == null || a(W),
|
|
4647
|
+
const [R, O] = K(M, s) || _(M, s) ? [M, s] : [s, M], W = { start: R, end: O };
|
|
4648
|
+
f || y(W), a == null || a(W), u(null), C(!1);
|
|
4618
4649
|
}
|
|
4619
4650
|
}, N = () => {
|
|
4620
|
-
b === 0 ? (x(11),
|
|
4651
|
+
b === 0 ? (x(11), k((M) => M - 1)) : x((M) => M - 1);
|
|
4621
4652
|
}, $ = () => {
|
|
4622
|
-
b === 11 ? (x(0),
|
|
4653
|
+
b === 11 ? (x(0), k((M) => M + 1)) : x((M) => M + 1);
|
|
4623
4654
|
}, I = s ? { start: s, end: s } : d ? { start: d.start, end: d.end } : void 0;
|
|
4624
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
4655
|
+
return /* @__PURE__ */ h("div", { ref: S, style: { position: "relative", display: "inline-block", ...c }, children: [
|
|
4625
4656
|
/* @__PURE__ */ h(
|
|
4626
4657
|
"button",
|
|
4627
4658
|
{
|
|
4628
4659
|
type: "button",
|
|
4629
4660
|
disabled: r,
|
|
4630
|
-
onClick: () => !r &&
|
|
4661
|
+
onClick: () => !r && C((M) => !M),
|
|
4631
4662
|
onFocus: () => w(!0),
|
|
4632
4663
|
onBlur: () => w(!1),
|
|
4633
4664
|
"aria-haspopup": "dialog",
|
|
4634
|
-
"aria-expanded":
|
|
4665
|
+
"aria-expanded": p,
|
|
4635
4666
|
style: {
|
|
4636
4667
|
display: "inline-flex",
|
|
4637
4668
|
alignItems: "center",
|
|
@@ -4659,7 +4690,7 @@ function Ln({
|
|
|
4659
4690
|
]
|
|
4660
4691
|
}
|
|
4661
4692
|
),
|
|
4662
|
-
|
|
4693
|
+
p && /* @__PURE__ */ h(
|
|
4663
4694
|
"div",
|
|
4664
4695
|
{
|
|
4665
4696
|
role: "dialog",
|
|
@@ -4679,7 +4710,7 @@ function Ln({
|
|
|
4679
4710
|
},
|
|
4680
4711
|
children: [
|
|
4681
4712
|
/* @__PURE__ */ e("div", { style: { minWidth: 220 }, children: /* @__PURE__ */ e(
|
|
4682
|
-
|
|
4713
|
+
X,
|
|
4683
4714
|
{
|
|
4684
4715
|
year: m,
|
|
4685
4716
|
month: b,
|
|
@@ -4695,9 +4726,9 @@ function Ln({
|
|
|
4695
4726
|
) }),
|
|
4696
4727
|
/* @__PURE__ */ e("div", { style: { width: 1, background: "var(--lucent-border-subtle)", flexShrink: 0 } }),
|
|
4697
4728
|
/* @__PURE__ */ e("div", { style: { minWidth: 220 }, children: /* @__PURE__ */ e(
|
|
4698
|
-
|
|
4729
|
+
X,
|
|
4699
4730
|
{
|
|
4700
|
-
year:
|
|
4731
|
+
year: T,
|
|
4701
4732
|
month: E,
|
|
4702
4733
|
...(d == null ? void 0 : d.end) !== void 0 && { selected: d.end },
|
|
4703
4734
|
today: v,
|
|
@@ -4712,8 +4743,8 @@ function Ln({
|
|
|
4712
4743
|
]
|
|
4713
4744
|
}
|
|
4714
4745
|
),
|
|
4715
|
-
s &&
|
|
4716
|
-
s &&
|
|
4746
|
+
s && p && /* @__PURE__ */ e("div", { style: { position: "absolute", top: "calc(100% + 4px)", left: 0, zIndex: 1001, pointerEvents: "none" } }),
|
|
4747
|
+
s && p && /* @__PURE__ */ e("div", { style: {
|
|
4717
4748
|
position: "absolute",
|
|
4718
4749
|
bottom: -24,
|
|
4719
4750
|
left: 0
|
|
@@ -4802,7 +4833,7 @@ const Bn = {
|
|
|
4802
4833
|
notes: 'Inherits Calendar accessibility from DatePicker. The two-step selection flow is reinforced with a visible "Now pick the end date" hint.'
|
|
4803
4834
|
}
|
|
4804
4835
|
};
|
|
4805
|
-
function
|
|
4836
|
+
function J(t) {
|
|
4806
4837
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : `${(t / (1024 * 1024)).toFixed(1)} MB`;
|
|
4807
4838
|
}
|
|
4808
4839
|
function Ct() {
|
|
@@ -4828,7 +4859,7 @@ function It({
|
|
|
4828
4859
|
] }),
|
|
4829
4860
|
/* @__PURE__ */ h("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
4830
4861
|
/* @__PURE__ */ e(q, { size: "sm", truncate: !0, children: t.file.name }),
|
|
4831
|
-
i ? /* @__PURE__ */ e(q, { size: "xs", color: "danger", children: t.error }) : /* @__PURE__ */ e(q, { size: "xs", color: "secondary", children:
|
|
4862
|
+
i ? /* @__PURE__ */ e(q, { size: "xs", color: "danger", children: t.error }) : /* @__PURE__ */ e(q, { size: "xs", color: "secondary", children: J(t.file.size) }),
|
|
4832
4863
|
r !== void 0 && !i && /* @__PURE__ */ e("div", { style: {
|
|
4833
4864
|
marginTop: 4,
|
|
4834
4865
|
height: 3,
|
|
@@ -4880,27 +4911,27 @@ function $n({
|
|
|
4880
4911
|
disabled: l = !1,
|
|
4881
4912
|
style: c
|
|
4882
4913
|
}) {
|
|
4883
|
-
const f = o !== void 0, [g, y] = z([]), d = f ? o : g, [s,
|
|
4884
|
-
if (!
|
|
4885
|
-
const
|
|
4886
|
-
for (const w of Array.from(
|
|
4914
|
+
const f = o !== void 0, [g, y] = z([]), d = f ? o : g, [s, u] = z(!1), [v, m] = z(!1), k = F(null), b = Q((p) => {
|
|
4915
|
+
if (!p || l) return;
|
|
4916
|
+
const C = [];
|
|
4917
|
+
for (const w of Array.from(p)) {
|
|
4887
4918
|
if (a && w.size > a) {
|
|
4888
|
-
i == null || i(`"${w.name}" exceeds the ${
|
|
4919
|
+
i == null || i(`"${w.name}" exceeds the ${J(a)} limit.`);
|
|
4889
4920
|
continue;
|
|
4890
4921
|
}
|
|
4891
|
-
if (!n && d.length +
|
|
4892
|
-
|
|
4922
|
+
if (!n && d.length + C.length >= 1) break;
|
|
4923
|
+
C.push({ id: Ct(), file: w });
|
|
4893
4924
|
}
|
|
4894
|
-
if (
|
|
4895
|
-
const D = n ? [...d, ...
|
|
4925
|
+
if (C.length === 0) return;
|
|
4926
|
+
const D = n ? [...d, ...C] : C;
|
|
4896
4927
|
f || y(D), r == null || r(D);
|
|
4897
|
-
}, [l, d, f, a, n, r, i]), x = (
|
|
4898
|
-
const
|
|
4899
|
-
f || y(
|
|
4900
|
-
}, E = (
|
|
4901
|
-
|
|
4902
|
-
},
|
|
4903
|
-
b(
|
|
4928
|
+
}, [l, d, f, a, n, r, i]), x = (p) => {
|
|
4929
|
+
const C = d.filter((D) => D.id !== p);
|
|
4930
|
+
f || y(C), r == null || r(C);
|
|
4931
|
+
}, E = (p) => {
|
|
4932
|
+
p.preventDefault(), u(!1), b(p.dataTransfer.files);
|
|
4933
|
+
}, T = (p) => {
|
|
4934
|
+
b(p.target.files), p.target.value = "";
|
|
4904
4935
|
};
|
|
4905
4936
|
return /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-3)", ...c }, children: [
|
|
4906
4937
|
/* @__PURE__ */ h(
|
|
@@ -4911,19 +4942,19 @@ function $n({
|
|
|
4911
4942
|
"aria-label": "Upload files",
|
|
4912
4943
|
"aria-disabled": l,
|
|
4913
4944
|
onClick: () => {
|
|
4914
|
-
var
|
|
4915
|
-
return !l && ((
|
|
4945
|
+
var p;
|
|
4946
|
+
return !l && ((p = k.current) == null ? void 0 : p.click());
|
|
4916
4947
|
},
|
|
4917
|
-
onKeyDown: (
|
|
4918
|
-
var
|
|
4919
|
-
(
|
|
4948
|
+
onKeyDown: (p) => {
|
|
4949
|
+
var C;
|
|
4950
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), (C = k.current) == null || C.click());
|
|
4920
4951
|
},
|
|
4921
4952
|
onFocus: () => m(!0),
|
|
4922
4953
|
onBlur: () => m(!1),
|
|
4923
|
-
onDragOver: (
|
|
4924
|
-
|
|
4954
|
+
onDragOver: (p) => {
|
|
4955
|
+
p.preventDefault(), l || u(!0);
|
|
4925
4956
|
},
|
|
4926
|
-
onDragLeave: () =>
|
|
4957
|
+
onDragLeave: () => u(!1),
|
|
4927
4958
|
onDrop: E,
|
|
4928
4959
|
style: {
|
|
4929
4960
|
display: "flex",
|
|
@@ -4959,18 +4990,18 @@ function $n({
|
|
|
4959
4990
|
/* @__PURE__ */ e(q, { color: l ? "disabled" : "primary", weight: "medium", children: s ? "Drop to upload" : "Drop files here or click to browse" }),
|
|
4960
4991
|
(t || a) && /* @__PURE__ */ e(q, { size: "xs", color: "secondary", children: [
|
|
4961
4992
|
t && `Accepted: ${t}`,
|
|
4962
|
-
a && `Max size: ${
|
|
4993
|
+
a && `Max size: ${J(a)}`
|
|
4963
4994
|
].filter(Boolean).join(" · ") })
|
|
4964
4995
|
] }),
|
|
4965
4996
|
/* @__PURE__ */ e(
|
|
4966
4997
|
"input",
|
|
4967
4998
|
{
|
|
4968
|
-
ref:
|
|
4999
|
+
ref: k,
|
|
4969
5000
|
type: "file",
|
|
4970
5001
|
accept: t,
|
|
4971
5002
|
multiple: n,
|
|
4972
5003
|
disabled: l,
|
|
4973
|
-
onChange:
|
|
5004
|
+
onChange: T,
|
|
4974
5005
|
style: { display: "none" },
|
|
4975
5006
|
tabIndex: -1
|
|
4976
5007
|
}
|
|
@@ -4978,7 +5009,7 @@ function $n({
|
|
|
4978
5009
|
]
|
|
4979
5010
|
}
|
|
4980
5011
|
),
|
|
4981
|
-
d.length > 0 && /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-2)" }, children: d.map((
|
|
5012
|
+
d.length > 0 && /* @__PURE__ */ e("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-2)" }, children: d.map((p) => /* @__PURE__ */ e(It, { item: p, onRemove: x }, p.id)) })
|
|
4982
5013
|
] });
|
|
4983
5014
|
}
|
|
4984
5015
|
const Pn = {
|