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.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 J, useContext as re, createContext as oe, useLayoutEffect as ie, useId as le } from "react";
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 }, p) => {
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: p,
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 C;
65
- !v && !f && ye(m.currentTarget, t), (C = s.onMouseEnter) == null || C.call(s, m);
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 C;
69
- !v && !f && xe(m.currentTarget, t), (C = s.onMouseLeave) == null || C.call(s, m);
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 C;
73
- v || (m.currentTarget.style.transform = "scale(0.95)"), (C = s.onMouseDown) == null || C.call(s, m);
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 C;
77
- m.currentTarget.style.transform = "", (C = s.onMouseUp) == null || C.call(s, m);
76
+ var k;
77
+ m.currentTarget.style.transform = "", (k = s.onMouseUp) == null || k.call(s, m);
78
78
  },
79
79
  onFocus: (m) => {
80
- var C;
81
- m.currentTarget.style.boxShadow = "0 0 0 3px var(--lucent-accent-subtle)", (C = s.onFocus) == null || C.call(s, m);
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 C;
85
- m.currentTarget.style.boxShadow = "", (C = s.onBlur) == null || C.call(s, m);
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 p;
278
- !c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-strong)"), (p = c.onMouseEnter) == null || p.call(c, s);
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 p;
282
- !c.disabled && s.currentTarget !== document.activeElement && (s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)"), (p = c.onMouseLeave) == null || p.call(c, s);
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 p;
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)"}`, (p = c.onFocus) == null || p.call(c, s);
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 p;
290
- s.currentTarget.style.borderColor = y ? "var(--lucent-danger-default)" : "var(--lucent-border-default)", s.currentTarget.style.boxShadow = "none", (p = c.onBlur) == null || p.call(c, s);
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), p = d ?? s, v = l ?? `lucent-textarea-${Math.random().toString(36).slice(2, 7)}`, m = !!a, C = typeof c == "string" ? c.length : 0;
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 = p.current;
369
+ const b = u.current;
370
370
  b && (b.style.height = "auto", b.style.height = `${b.scrollHeight}px`);
371
- }, [c, o, p]), /* @__PURE__ */ h("div", { style: { display: "flex", flexDirection: "column", gap: "var(--lucent-space-1)", width: "100%" }, children: [
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: p,
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 && C >= r ? "var(--lucent-danger-text)" : "var(--lucent-text-secondary)",
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
- C,
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)}`, p = Fe[n], v = o !== void 0, [m, C] = z(r ?? !1), b = v ? !!o : m, x = F(b), [E, S] = z(0);
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, S((k) => k + 1));
791
+ !i && x.current !== b && (x.current = b, T((S) => S + 1));
792
792
  }, [b, i]);
793
- const u = J(
794
- (k) => {
795
- d.current = k, typeof y == "function" ? y(k) : y && (y.current = k);
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 T = (k) => {
803
- v || C(k.target.checked), c == null || c(k);
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: p,
806
- height: p,
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: u,
838
+ ref: p,
839
839
  type: "checkbox",
840
840
  id: s,
841
841
  checked: v ? o : m,
842
842
  disabled: i,
843
- onChange: T,
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: p - 4,
853
- height: p - 4,
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: p - 4,
864
- height: p - 4,
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, p = F(s), [v, m] = z(0);
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 && p.current !== s && (p.current = s, m((E) => E + 1));
990
+ !d && u.current !== s && (u.current = s, m((E) => E + 1));
991
991
  }, [s, d]);
992
- const C = (E) => {
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: C,
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
- }, Q = "cubic-bezier(0.34, 1.56, 0.64, 1)", We = `
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), p = y ? !!a : d, v = F(p), [m, C] = z(0);
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 !== p && (v.current = p, C((T) => T + 1));
1171
- }, [p, r]);
1172
- const { track: [b, x], thumb: E } = Pe[n], S = p ? b - E - 2 : 2, u = (T) => {
1173
- y || s(T.target.checked), l == null || l(T);
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: u,
1201
- "aria-checked": p,
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)" : p ? "var(--lucent-accent-default)" : "var(--lucent-border-strong)",
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 ${Q} forwards` : void 0
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: S,
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 ${Q}`
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: (p) => {
1360
+ onMouseEnter: (u) => {
1361
1361
  var v;
1362
- !l && p.currentTarget !== document.activeElement && (p.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-strong)"), (v = g.onMouseEnter) == null || v.call(g, p);
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: (p) => {
1364
+ onMouseLeave: (u) => {
1365
1365
  var v;
1366
- !l && p.currentTarget !== document.activeElement && (p.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-default)"), (v = g.onMouseLeave) == null || v.call(g, p);
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: (p) => {
1368
+ onFocus: (u) => {
1369
1369
  var v;
1370
- p.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-focus-ring)", p.currentTarget.style.boxShadow = `0 0 0 3px ${s ? "var(--lucent-danger-subtle)" : "var(--lucent-accent-subtle)"}`, (v = g.onFocus) == null || v.call(g, p);
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: (p) => {
1372
+ onBlur: (u) => {
1373
1373
  var v;
1374
- p.currentTarget.style.borderColor = s ? "var(--lucent-danger-default)" : "var(--lucent-border-default)", p.currentTarget.style.boxShadow = "none", (v = g.onBlur) == null || v.call(g, p);
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((p) => /* @__PURE__ */ e("option", { value: p.value, disabled: p.disabled, children: p.label }, p.value))
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), p = F(null), v = g && o.length > 0, m = () => {
2201
+ const [g, y] = z(!1), [d, s] = z(null), u = F(null), v = g && o.length > 0, m = () => {
2202
2202
  n("");
2203
- }, C = (S) => {
2204
- r == null || r(S), y(!1);
2203
+ }, k = (T) => {
2204
+ r == null || r(T), y(!1);
2205
2205
  }, b = () => {
2206
- p.current = setTimeout(() => y(!1), 150);
2206
+ u.current = setTimeout(() => y(!1), 150);
2207
2207
  }, x = () => {
2208
- p.current && clearTimeout(p.current), y(!0);
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: (S) => {
2226
- S.currentTarget.style.color = "var(--lucent-text-primary)";
2225
+ onMouseEnter: (T) => {
2226
+ T.currentTarget.style.color = "var(--lucent-text-primary)";
2227
2227
  },
2228
- onMouseLeave: (S) => {
2229
- S.currentTarget.style.color = "var(--lucent-text-secondary)";
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: (S) => n(S.target.value),
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((S, u) => /* @__PURE__ */ e(
2266
+ children: o.map((T, p) => /* @__PURE__ */ e(
2267
2267
  "div",
2268
2268
  {
2269
2269
  role: "option",
2270
2270
  "aria-selected": !1,
2271
- onMouseDown: () => C(S),
2272
- onMouseEnter: () => s(u),
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 === u ? "var(--lucent-bg-subtle)" : "transparent",
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: S.label })
2280
+ children: /* @__PURE__ */ e(q, { as: "span", size: "md", children: T.label })
2281
2281
  },
2282
- S.id
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 Z({
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
- Z,
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
- Z,
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, p] = z(null), v = F(!1);
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((S) => S.value === f), E = d.current[x];
3052
- E && (p({ left: E.offsetLeft, width: E.offsetWidth, animate: v.current }), v.current = !0);
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
- }, C = (x, E) => {
3056
+ }, k = (x, E) => {
3057
3057
  var D;
3058
- const S = t.map((w, k) => w.disabled ? -1 : k).filter((w) => w !== -1), u = S.indexOf(E);
3059
- let T = -1;
3060
- x.key === "ArrowRight" && (T = S[(u + 1) % S.length] ?? -1), x.key === "ArrowLeft" && (T = S[(u - 1 + S.length) % S.length] ?? -1), x.key === "Home" && (T = S[0] ?? -1), x.key === "End" && (T = S[S.length - 1] ?? -1), T !== -1 && (x.preventDefault(), (D = d.current[T]) == null || D.focus(), m(t[T].value));
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 S = x.value === f, u = x.disabled ?? !1;
3074
+ const T = x.value === f, p = x.disabled ?? !1;
3075
3075
  return /* @__PURE__ */ e(
3076
3076
  "button",
3077
3077
  {
3078
- ref: (T) => {
3079
- d.current[E] = T;
3078
+ ref: (C) => {
3079
+ d.current[E] = C;
3080
3080
  },
3081
3081
  role: "tab",
3082
- "aria-selected": S,
3082
+ "aria-selected": T,
3083
3083
  "aria-controls": `lucent-tabpanel-${x.value}`,
3084
3084
  id: `lucent-tab-${x.value}`,
3085
- disabled: u,
3086
- tabIndex: S ? 0 : -1,
3085
+ disabled: p,
3086
+ tabIndex: T ? 0 : -1,
3087
3087
  onClick: () => {
3088
- u || m(x.value);
3088
+ p || m(x.value);
3089
3089
  },
3090
- onKeyDown: (T) => C(T, E),
3090
+ onKeyDown: (C) => k(C, E),
3091
3091
  onMouseEnter: () => {
3092
- u || y(E);
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: u ? "not-allowed" : "pointer",
3099
+ cursor: p ? "not-allowed" : "pointer",
3100
3100
  fontFamily: "var(--lucent-font-family-base)",
3101
3101
  fontSize: "var(--lucent-font-size-md)",
3102
- fontWeight: S ? "var(--lucent-font-weight-medium)" : "var(--lucent-font-weight-regular)",
3103
- color: u ? "var(--lucent-text-disabled)" : S ? "var(--lucent-text-primary)" : "var(--lucent-text-secondary)",
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 && !S ? "var(--lucent-bg-subtle)" : "transparent",
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), p = F(!1);
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 C = m.scrollHeight;
3166
- s(C), p.current = !0;
3165
+ const k = m.scrollHeight;
3166
+ s(k), u.current = !0;
3167
3167
  const b = setTimeout(() => {
3168
- s(void 0), p.current = !1;
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 ee(t) {
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
- mainStyle: l,
3265
- style: c
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 f = ee(r), g = ee(o);
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
- ...c
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: f,
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 : g,
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
- ...l
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), p = o !== void 0, v = p ? o : g, m = c ? [...n].sort((u, T) => {
3382
- const D = u[c.key], w = T[c.key], k = String(D ?? "").localeCompare(String(w ?? ""), void 0, { numeric: !0 });
3383
- return c.dir === "asc" ? k : -k;
3384
- }) : n, C = a > 0 ? m.slice(v * a, (v + 1) * a) : m, b = a > 0 ? Math.max(1, Math.ceil(m.length / a)) : 1, x = (u) => {
3385
- p || y(u), r == null || r(u);
3386
- }, E = (u) => {
3387
- f((T) => !T || T.key !== u ? { key: u, dir: "asc" } : T.dir === "asc" ? { key: u, dir: "desc" } : null), p || y(0), r == null || r(0);
3388
- }, S = [];
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 u = 0; u < b; u++) S.push(u);
3421
+ for (let p = 0; p < b; p++) T.push(p);
3391
3422
  else {
3392
- S.push(0), v > 2 && S.push("…");
3393
- for (let u = Math.max(1, v - 1); u <= Math.min(b - 2, v + 1); u++)
3394
- S.push(u);
3395
- v < b - 3 && S.push("…"), S.push(b - 1);
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((u) => {
3409
- const T = (c == null ? void 0 : c.key) === u.key ? c.dir : "none";
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: u.sortable ? () => E(u.key) : void 0,
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: u.align ?? "left",
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: u.sortable ? "pointer" : "default",
3451
+ cursor: p.sortable ? "pointer" : "default",
3421
3452
  userSelect: "none",
3422
3453
  whiteSpace: "nowrap",
3423
- ...u.width ? { width: u.width } : {}
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
- u.header,
3427
- u.sortable && /* @__PURE__ */ e(gt, { state: T })
3457
+ p.header,
3458
+ p.sortable && /* @__PURE__ */ e(gt, { state: C })
3428
3459
  ] })
3429
3460
  },
3430
- u.key
3461
+ p.key
3431
3462
  );
3432
3463
  }) }) }),
3433
- /* @__PURE__ */ e("tbody", { children: C.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
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
- ) }) : C.map((u, T) => /* @__PURE__ */ e(
3471
+ ) }) : k.map((p, C) => /* @__PURE__ */ e(
3441
3472
  "tr",
3442
3473
  {
3443
- onMouseEnter: () => s(T),
3474
+ onMouseEnter: () => s(C),
3444
3475
  onMouseLeave: () => s(null),
3445
3476
  style: {
3446
- borderBottom: T < C.length - 1 ? "1px solid var(--lucent-border-subtle)" : "none",
3447
- background: d === T ? "var(--lucent-bg-subtle)" : "var(--lucent-surface-default)",
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(u, T) : String(u[D.key] ?? "")
3490
+ children: D.render ? D.render(p, C) : String(p[D.key] ?? "")
3460
3491
  },
3461
3492
  D.key
3462
3493
  ))
3463
3494
  },
3464
- T
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
- S.map(
3486
- (u, T) => u === "…" ? /* @__PURE__ */ e("span", { style: {
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-${T}`) : /* @__PURE__ */ e(
3491
- _,
3521
+ }, children: "…" }, `ellipsis-${C}`) : /* @__PURE__ */ e(
3522
+ Y,
3492
3523
  {
3493
- onClick: () => x(u),
3494
- active: u === v,
3495
- "aria-label": `Page ${u + 1}`,
3496
- "aria-current": u === v ? "page" : void 0,
3497
- children: u + 1
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
- u
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, p] = z(0), v = F(null), m = F(null), C = F(!1);
3663
- if (!C.current) {
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), C.current = !0;
3696
+ w.textContent = vt, document.head.appendChild(w), k.current = !0;
3666
3697
  }
3667
- const b = J((w) => {
3698
+ const b = Q((w) => {
3668
3699
  l || f(w), r == null || r(w);
3669
3700
  }, [l, r]);
3670
3701
  B(() => {
3671
- const w = (k) => {
3672
- (k.metaKey || k.ctrlKey) && k.key === a && (k.preventDefault(), b(!g));
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(""), p(0), setTimeout(() => {
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 k = w.querySelector('[data-active="true"]');
3686
- k == null || k.scrollIntoView({ block: "nearest" });
3716
+ const S = w.querySelector('[data-active="true"]');
3717
+ S == null || S.scrollIntoView({ block: "nearest" });
3687
3718
  }, [s]);
3688
- const S = (w) => {
3719
+ const T = (w) => {
3689
3720
  w.disabled || (w.onSelect(), b(!1));
3690
- }, u = (w) => {
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(), p((k) => Math.min(k + 1, E.length - 1))), w.key === "ArrowUp" && (w.preventDefault(), p((k) => Math.max(k - 1, 0))), w.key === "Enter") {
3696
- const k = E[s];
3697
- k && S(k);
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
- }, T = [];
3730
+ }, C = [];
3700
3731
  for (const w of x) {
3701
- const k = T[T.length - 1];
3702
- k && k.group === w.group ? k.items.push(w) : T.push({ group: w.group, items: [w] });
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), p(0);
3794
+ d(w.target.value), u(0);
3764
3795
  },
3765
- onKeyDown: u,
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
- ] }) }) : T.map(({ group: w, items: k }, P) => /* @__PURE__ */ h("div", { children: [
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
- k.map((N) => {
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: () => S(N),
3848
+ onClick: () => T(N),
3818
3849
  onMouseEnter: () => {
3819
3850
  if (!$) {
3820
3851
  const M = E.indexOf(N);
3821
- M !== -1 && p(M);
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, k]) => /* @__PURE__ */ h("span", { style: { display: "flex", alignItems: "center", gap: "var(--lucent-space-1)" }, children: [
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: k })
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, p] = z(!1), [v, m] = z(""), [C, b] = z(0), [x, E] = z(!1), S = F(null), u = F(null), T = le();
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 = S.current) != null && R.contains(M.target) || (p(!1), m(""));
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
- }, k = t.filter(
4057
+ }, S = t.filter(
4027
4058
  (I) => I.label.toLowerCase().includes(v.toLowerCase())
4028
4059
  ), P = (I) => {
4029
4060
  if (I.key === "Escape") {
4030
- p(!1), m("");
4061
+ u(!1), m("");
4031
4062
  return;
4032
4063
  }
4033
- if (I.key === "ArrowDown" && (I.preventDefault(), p(!0), b((M) => Math.min(M + 1, k.length - 1))), I.key === "ArrowUp" && (I.preventDefault(), b((M) => Math.max(M - 1, 0))), I.key === "Enter") {
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[C];
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: S, style: { position: "relative", ...c }, children: [
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 || (p(!0), (I = u.current) == null || I.focus());
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: u,
4102
+ ref: p,
4072
4103
  value: v,
4073
4104
  onChange: (I) => {
4074
- m(I.target.value), p(!0), b(0);
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": T,
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: T,
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
- k.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" }) }) : k.map((I, M) => {
4124
- const R = d.includes(I.value), O = M === C, W = I.disabled ?? !1, U = N && !R;
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 G(t, n) {
4308
+ function _(t, n) {
4278
4309
  return t.getFullYear() === n.getFullYear() && t.getMonth() === n.getMonth() && t.getDate() === n.getDate();
4279
4310
  }
4280
- function Y(t, n) {
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 K({
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, p] = z(null), v = [
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, C) => C + 1)
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, C) => {
4369
- if (!m) return /* @__PURE__ */ e("div", {}, C);
4370
- const b = new Date(t, n, m), x = a ? G(b, a) : !1, E = G(b, o), S = (r ? Y(b, r) : !1) || (i ? ne(b, i) : !1);
4371
- let u = !1;
4372
- return g != null && g.start && (g != null && g.end) && (u = !Y(b, g.start) && !ne(b, g.end)), /* @__PURE__ */ e(
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: S,
4377
- onClick: () => !S && l(b),
4378
- onMouseEnter: () => p(m),
4379
- onMouseLeave: () => p(null),
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)" : u ? "var(--lucent-accent-subtle)" : s === m && !S ? "var(--lucent-bg-muted)" : "transparent",
4391
- color: x ? "var(--lucent-text-on-accent)" : S ? "var(--lucent-text-disabled)" : "var(--lucent-text-primary)",
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: S ? "not-allowed" : "pointer",
4426
+ cursor: T ? "not-allowed" : "pointer",
4396
4427
  transition: "background var(--lucent-duration-fast)"
4397
4428
  },
4398
4429
  children: m
4399
4430
  },
4400
- C
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(), [p, v] = z((d ?? s).getFullYear()), [m, C] = z((d ?? s).getMonth()), [b, x] = z(!1), [E, S] = z(!1), u = F(null);
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 k = (P) => {
4449
+ const S = (P) => {
4419
4450
  var N;
4420
- (N = u.current) != null && N.contains(P.target) || x(!1);
4451
+ (N = p.current) != null && N.contains(P.target) || x(!1);
4421
4452
  };
4422
- return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
4453
+ return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
4423
4454
  }, [b]);
4424
- const T = (k) => {
4425
- f || y(k), a == null || a(k), x(!1);
4455
+ const C = (S) => {
4456
+ f || y(S), a == null || a(S), x(!1);
4426
4457
  }, D = () => {
4427
- m === 0 ? (C(11), v((k) => k - 1)) : C((k) => k - 1);
4458
+ m === 0 ? (k(11), v((S) => S - 1)) : k((S) => S - 1);
4428
4459
  }, w = () => {
4429
- m === 11 ? (C(0), v((k) => k + 1)) : C((k) => k + 1);
4460
+ m === 11 ? (k(0), v((S) => S + 1)) : k((S) => S + 1);
4430
4461
  };
4431
- return /* @__PURE__ */ h("div", { ref: u, style: { position: "relative", display: "inline-block", ...c }, children: [
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((k) => !k),
4438
- onFocus: () => S(!0),
4439
- onBlur: () => S(!1),
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
- K,
4518
+ X,
4488
4519
  {
4489
- year: p,
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: T,
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 ? G(t.start, t.end) ? j(t.start) : `${j(t.start)} → ${j(t.end)}` : n;
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, p] = z(null), v = /* @__PURE__ */ new Date(), [m, C] = 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, S = b === 11 ? m + 1 : m, [u, T] = z(!1), [D, w] = z(!1), k = F(null);
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 (!u) return;
4636
+ if (!p) return;
4606
4637
  const M = (R) => {
4607
4638
  var O;
4608
- (O = k.current) != null && O.contains(R.target) || (T(!1), p(null));
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
- }, [u]);
4642
+ }, [p]);
4612
4643
  const P = (M) => {
4613
4644
  if (!s)
4614
- p(M);
4645
+ u(M);
4615
4646
  else {
4616
- const [R, O] = Y(M, s) || G(M, s) ? [M, s] : [s, M], W = { start: R, end: O };
4617
- f || y(W), a == null || a(W), p(null), T(!1);
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), C((M) => M - 1)) : x((M) => M - 1);
4651
+ b === 0 ? (x(11), k((M) => M - 1)) : x((M) => M - 1);
4621
4652
  }, $ = () => {
4622
- b === 11 ? (x(0), C((M) => M + 1)) : x((M) => M + 1);
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: k, style: { position: "relative", display: "inline-block", ...c }, children: [
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 && T((M) => !M),
4661
+ onClick: () => !r && C((M) => !M),
4631
4662
  onFocus: () => w(!0),
4632
4663
  onBlur: () => w(!1),
4633
4664
  "aria-haspopup": "dialog",
4634
- "aria-expanded": u,
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
- u && /* @__PURE__ */ h(
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
- K,
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
- K,
4729
+ X,
4699
4730
  {
4700
- year: S,
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 && u && /* @__PURE__ */ e("div", { style: { position: "absolute", top: "calc(100% + 4px)", left: 0, zIndex: 1001, pointerEvents: "none" } }),
4716
- s && u && /* @__PURE__ */ e("div", { style: {
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 X(t) {
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: X(t.file.size) }),
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, p] = z(!1), [v, m] = z(!1), C = F(null), b = J((u) => {
4884
- if (!u || l) return;
4885
- const T = [];
4886
- for (const w of Array.from(u)) {
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 ${X(a)} limit.`);
4919
+ i == null || i(`"${w.name}" exceeds the ${J(a)} limit.`);
4889
4920
  continue;
4890
4921
  }
4891
- if (!n && d.length + T.length >= 1) break;
4892
- T.push({ id: Ct(), file: w });
4922
+ if (!n && d.length + C.length >= 1) break;
4923
+ C.push({ id: Ct(), file: w });
4893
4924
  }
4894
- if (T.length === 0) return;
4895
- const D = n ? [...d, ...T] : T;
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 = (u) => {
4898
- const T = d.filter((D) => D.id !== u);
4899
- f || y(T), r == null || r(T);
4900
- }, E = (u) => {
4901
- u.preventDefault(), p(!1), b(u.dataTransfer.files);
4902
- }, S = (u) => {
4903
- b(u.target.files), u.target.value = "";
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 u;
4915
- return !l && ((u = C.current) == null ? void 0 : u.click());
4945
+ var p;
4946
+ return !l && ((p = k.current) == null ? void 0 : p.click());
4916
4947
  },
4917
- onKeyDown: (u) => {
4918
- var T;
4919
- (u.key === "Enter" || u.key === " ") && (u.preventDefault(), (T = C.current) == null || T.click());
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: (u) => {
4924
- u.preventDefault(), l || p(!0);
4954
+ onDragOver: (p) => {
4955
+ p.preventDefault(), l || u(!0);
4925
4956
  },
4926
- onDragLeave: () => p(!1),
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: ${X(a)}`
4993
+ a && `Max size: ${J(a)}`
4963
4994
  ].filter(Boolean).join(" · ") })
4964
4995
  ] }),
4965
4996
  /* @__PURE__ */ e(
4966
4997
  "input",
4967
4998
  {
4968
- ref: C,
4999
+ ref: k,
4969
5000
  type: "file",
4970
5001
  accept: t,
4971
5002
  multiple: n,
4972
5003
  disabled: l,
4973
- onChange: S,
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((u) => /* @__PURE__ */ e(It, { item: u, onRemove: x }, u.id)) })
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 = {