@floegence/floe-webapp-core 0.14.0 → 0.14.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.
@@ -15,9 +15,9 @@ export interface FileBrowserProviderProps {
15
15
  */
16
16
  sidebarWidthStorageKey?: string;
17
17
  /**
18
- * 持久化存储 key 前缀,用于区分不同实例的持久化数据。
19
- * 设置后会持久化 viewModesortConfigexpandedFolderssidebarCollapsed
20
- * 若不设置则不持久化这些状态。
18
+ * Persistence key prefix to isolate per-instance state.
19
+ * When provided, we persist viewMode, sortConfig, expandedFolders, and sidebarCollapsed.
20
+ * When omitted, these states are not persisted.
21
21
  */
22
22
  persistenceKey?: string;
23
23
  /** Label for the root/home directory in breadcrumb (default: 'Root') */
package/dist/index21.js CHANGED
@@ -1,34 +1,37 @@
1
- import { delegateEvents as oe, insert as d, createComponent as h, effect as S, className as I, memo as k, setAttribute as x, spread as R, mergeProps as B, template as C, Portal as le, setStyleProperty as ee, use as te } from "solid-js/web";
1
+ import { delegateEvents as oe, insert as l, createComponent as c, effect as y, className as C, memo as _, spread as R, mergeProps as B, setAttribute as p, template as z, Portal as le, setStyleProperty as ee, use as te } from "solid-js/web";
2
2
  import { splitProps as N, createUniqueId as E, Show as w, createSignal as re, For as de } from "solid-js";
3
3
  import { cn as $ } from "./index110.js";
4
4
  import { Minus as se, Plus as ue, ChevronDown as ae } from "./index40.js";
5
- var ce = /* @__PURE__ */ C('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), fe = /* @__PURE__ */ C('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), L = /* @__PURE__ */ C('<p class="mt-1 text-[11px] text-error"role=alert>'), M = /* @__PURE__ */ C('<p class="mt-1 text-[11px] text-muted-foreground">'), he = /* @__PURE__ */ C("<div class=relative><input>"), ge = /* @__PURE__ */ C("<div><textarea>"), xe = /* @__PURE__ */ C('<div><div><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), ve = /* @__PURE__ */ C("<div><div><input>"), ne = /* @__PURE__ */ C("<span>"), be = /* @__PURE__ */ C("<button type=button><span>"), me = /* @__PURE__ */ C("<div role=listbox>"), pe = /* @__PURE__ */ C("<button type=button role=option>");
5
+ var ce = /* @__PURE__ */ z('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), fe = /* @__PURE__ */ z('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), L = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-error"role=alert>'), M = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-muted-foreground">'), he = /* @__PURE__ */ z("<div class=relative><input>"), ge = /* @__PURE__ */ z("<div><textarea>"), xe = /* @__PURE__ */ z('<div><div><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), ve = /* @__PURE__ */ z("<div><div><input>"), ne = /* @__PURE__ */ z("<span>"), be = /* @__PURE__ */ z("<button type=button><span>"), me = /* @__PURE__ */ z("<div role=listbox>"), pe = /* @__PURE__ */ z("<button type=button role=option>");
6
6
  const we = {
7
7
  sm: "h-7 text-xs px-2",
8
8
  md: "h-8 text-xs px-2.5",
9
9
  lg: "h-9 text-sm px-3"
10
10
  };
11
- function ze(t) {
12
- const [e, b] = N(t, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), m = e.id ?? E(), y = `${m}-error`, g = `${m}-helper`, p = () => {
13
- const l = [];
14
- return e.error && l.push(y), e.helperText && !e.error && l.push(g), l.length > 0 ? l.join(" ") : void 0;
11
+ function ze(r) {
12
+ const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
13
+ const o = [];
14
+ return e.error && o.push(f()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
15
15
  };
16
16
  return (() => {
17
- var l = he(), c = l.firstChild;
18
- return d(l, h(w, {
17
+ var o = he(), g = o.firstChild;
18
+ return l(o, c(w, {
19
19
  get when() {
20
20
  return e.leftIcon;
21
21
  },
22
22
  get children() {
23
- var u = ce();
24
- return d(u, () => e.leftIcon), u;
23
+ var s = ce();
24
+ return l(s, () => e.leftIcon), s;
25
25
  }
26
- }), c), x(c, "id", m), R(c, B({
26
+ }), g), R(g, B({
27
+ get id() {
28
+ return m();
29
+ },
27
30
  get "aria-invalid"() {
28
31
  return e.error ? !0 : void 0;
29
32
  },
30
33
  get "aria-describedby"() {
31
- return p();
34
+ return I();
32
35
  },
33
36
  get class() {
34
37
  return $(
@@ -45,84 +48,87 @@ function ze(t) {
45
48
  e.class
46
49
  );
47
50
  }
48
- }, b), !1, !1), d(l, h(w, {
51
+ }, b), !1, !1), l(o, c(w, {
49
52
  get when() {
50
53
  return e.rightIcon;
51
54
  },
52
55
  get children() {
53
- var u = fe();
54
- return d(u, () => e.rightIcon), u;
56
+ var s = fe();
57
+ return l(s, () => e.rightIcon), s;
55
58
  }
56
- }), null), d(l, h(w, {
59
+ }), null), l(o, c(w, {
57
60
  get when() {
58
61
  return e.error;
59
62
  },
60
63
  get children() {
61
- var u = L();
62
- return x(u, "id", y), d(u, () => e.error), u;
64
+ var s = L();
65
+ return l(s, () => e.error), y(() => p(s, "id", f())), s;
63
66
  }
64
- }), null), d(l, h(w, {
67
+ }), null), l(o, c(w, {
65
68
  get when() {
66
- return k(() => !!e.helperText)() && !e.error;
69
+ return _(() => !!e.helperText)() && !e.error;
67
70
  },
68
71
  get children() {
69
- var u = M();
70
- return x(u, "id", g), d(u, () => e.helperText), u;
72
+ var s = M();
73
+ return l(s, () => e.helperText), y(() => p(s, "id", x())), s;
71
74
  }
72
- }), null), l;
75
+ }), null), o;
73
76
  })();
74
77
  }
75
- function Se(t) {
76
- const [e, b] = N(t, ["error", "helperText", "class", "id"]), m = e.id ?? E(), y = `${m}-error`, g = `${m}-helper`, p = () => {
77
- const l = [];
78
- return e.error && l.push(y), e.helperText && !e.error && l.push(g), l.length > 0 ? l.join(" ") : void 0;
78
+ function Se(r) {
79
+ const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
80
+ const o = [];
81
+ return e.error && o.push(f()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
79
82
  };
80
83
  return (() => {
81
- var l = ge(), c = l.firstChild;
82
- return x(c, "id", m), R(c, B({
84
+ var o = ge(), g = o.firstChild;
85
+ return R(g, B({
86
+ get id() {
87
+ return m();
88
+ },
83
89
  get "aria-invalid"() {
84
90
  return e.error ? !0 : void 0;
85
91
  },
86
92
  get "aria-describedby"() {
87
- return p();
93
+ return I();
88
94
  },
89
95
  get class() {
90
96
  return $("w-full min-h-16 rounded border border-input bg-background p-2.5 text-xs shadow-sm", "placeholder:text-muted-foreground/60", "transition-colors duration-100", "focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring", "disabled:cursor-not-allowed disabled:opacity-50", "resize-y", e.error && "border-error focus:ring-error", e.class);
91
97
  }
92
- }, b), !1, !1), d(l, h(w, {
98
+ }, b), !1, !1), l(o, c(w, {
93
99
  get when() {
94
100
  return e.error;
95
101
  },
96
102
  get children() {
97
- var u = L();
98
- return x(u, "id", y), d(u, () => e.error), u;
103
+ var s = L();
104
+ return l(s, () => e.error), y(() => p(s, "id", f())), s;
99
105
  }
100
- }), null), d(l, h(w, {
106
+ }), null), l(o, c(w, {
101
107
  get when() {
102
- return k(() => !!e.helperText)() && !e.error;
108
+ return _(() => !!e.helperText)() && !e.error;
103
109
  },
104
110
  get children() {
105
- var u = M();
106
- return x(u, "id", g), d(u, () => e.helperText), u;
111
+ var s = M();
112
+ return l(s, () => e.helperText), y(() => p(s, "id", x())), s;
107
113
  }
108
- }), null), l;
114
+ }), null), o;
109
115
  })();
110
116
  }
111
- function Oe(t) {
112
- const e = E(), b = `${e}-error`, m = `${e}-helper`, y = () => t.step ?? 1, g = () => t.min ?? -1 / 0, p = () => t.max ?? 1 / 0, l = (i) => Math.min(p(), Math.max(g(), i)), c = () => !t.disabled && t.value > g(), u = () => !t.disabled && t.value < p(), _ = () => {
113
- c() && t.onChange(l(t.value - y()));
114
- }, T = () => {
115
- u() && t.onChange(l(t.value + y()));
116
- }, P = (i) => {
117
- const a = parseFloat(i.currentTarget.value);
118
- isNaN(a) || t.onChange(l(a));
119
- }, v = (i) => {
120
- const a = parseFloat(i.currentTarget.value);
121
- isNaN(a) ? t.onChange(g() === -1 / 0 ? 0 : g()) : t.onChange(l(a));
122
- }, z = () => {
123
- const i = [];
124
- return t.error && i.push(b), t.helperText && !t.error && i.push(m), i.length > 0 ? i.join(" ") : void 0;
125
- }, o = {
117
+ function ke(r) {
118
+ const e = E(), b = `${e}-error`, S = `${e}-helper`, m = () => r.step ?? 1, f = () => r.min ?? -1 / 0, x = () => r.max ?? 1 / 0, I = (t) => Math.min(x(), Math.max(f(), t)), o = () => !r.disabled && r.value > f(), g = () => !r.disabled && r.value < x(), s = () => {
119
+ o() && r.onChange(I(r.value - m()));
120
+ }, O = () => {
121
+ g() && r.onChange(I(r.value + m()));
122
+ }, T = (t) => {
123
+ const u = parseFloat(t.currentTarget.value);
124
+ isNaN(u) || r.onChange(I(u));
125
+ }, P = (t) => {
126
+ const u = parseFloat(t.currentTarget.value);
127
+ isNaN(u) ? r.onChange(f() === -1 / 0 ? 0 : f()) : r.onChange(I(u));
128
+ }, v = () => {
129
+ const t = [];
130
+ return r.error && t.push(b), r.helperText && !r.error && t.push(S), t.length > 0 ? t.join(" ") : void 0;
131
+ }, i = {
126
132
  sm: {
127
133
  height: "h-7",
128
134
  btnSize: "w-7",
@@ -138,36 +144,36 @@ function Oe(t) {
138
144
  btnSize: "w-9",
139
145
  iconSize: "w-4 h-4"
140
146
  }
141
- }, r = () => o[t.size ?? "md"];
147
+ }, h = () => i[r.size ?? "md"];
142
148
  return (() => {
143
- var i = xe(), a = i.firstChild, f = a.firstChild, s = f.nextSibling, O = s.nextSibling;
144
- return f.$$click = _, d(f, h(se, {
149
+ var t = xe(), u = t.firstChild, a = u.firstChild, d = a.nextSibling, k = d.nextSibling;
150
+ return a.$$click = s, l(a, c(se, {
145
151
  get class() {
146
- return r().iconSize;
152
+ return h().iconSize;
147
153
  }
148
- })), s.addEventListener("blur", v), s.$$input = P, x(s, "id", e), O.$$click = T, d(O, h(ue, {
154
+ })), d.addEventListener("blur", P), d.$$input = T, p(d, "id", e), k.$$click = O, l(k, c(ue, {
149
155
  get class() {
150
- return r().iconSize;
156
+ return h().iconSize;
151
157
  }
152
- })), d(i, h(w, {
158
+ })), l(t, c(w, {
153
159
  get when() {
154
- return t.error;
160
+ return r.error;
155
161
  },
156
162
  get children() {
157
163
  var n = L();
158
- return x(n, "id", b), d(n, () => t.error), n;
164
+ return p(n, "id", b), l(n, () => r.error), n;
159
165
  }
160
- }), null), d(i, h(w, {
166
+ }), null), l(t, c(w, {
161
167
  get when() {
162
- return k(() => !!t.helperText)() && !t.error;
168
+ return _(() => !!r.helperText)() && !r.error;
163
169
  },
164
170
  get children() {
165
171
  var n = M();
166
- return x(n, "id", m), d(n, () => t.helperText), n;
172
+ return p(n, "id", S), l(n, () => r.helperText), n;
167
173
  }
168
- }), null), S((n) => {
169
- var V = t.class, j = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", t.disabled && "opacity-50 cursor-not-allowed", t.error && "border-error focus-within:ring-error", r().height), A = !c(), F = $("flex items-center justify-center border-r border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", r().btnSize, r().height), W = t.min, q = t.max, H = t.step, G = t.disabled, U = t.inputDisabled, X = t.placeholder, J = t.error ? !0 : void 0, K = z(), Q = $("w-16 text-center text-xs bg-transparent border-none", "outline-none focus:outline-none focus:ring-0", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", t.inputDisabled && "cursor-default"), Y = !u(), Z = $("flex items-center justify-center border-l border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", r().btnSize, r().height);
170
- return V !== n.e && I(i, n.e = V), j !== n.t && I(a, n.t = j), A !== n.a && (f.disabled = n.a = A), F !== n.o && I(f, n.o = F), W !== n.i && x(s, "min", n.i = W), q !== n.n && x(s, "max", n.n = q), H !== n.s && x(s, "step", n.s = H), G !== n.h && (s.disabled = n.h = G), U !== n.r && (s.readOnly = n.r = U), X !== n.d && x(s, "placeholder", n.d = X), J !== n.l && x(s, "aria-invalid", n.l = J), K !== n.u && x(s, "aria-describedby", n.u = K), Q !== n.c && I(s, n.c = Q), Y !== n.w && (O.disabled = n.w = Y), Z !== n.m && I(O, n.m = Z), n;
174
+ }), null), y((n) => {
175
+ var V = r.class, j = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", r.disabled && "opacity-50 cursor-not-allowed", r.error && "border-error focus-within:ring-error", h().height), A = !o(), F = $("flex items-center justify-center border-r border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", h().btnSize, h().height), W = r.min, q = r.max, H = r.step, G = r.disabled, U = r.inputDisabled, X = r.placeholder, J = r.error ? !0 : void 0, K = v(), Q = $("w-16 text-center text-xs bg-transparent border-none", "outline-none focus:outline-none focus:ring-0", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", r.inputDisabled && "cursor-default"), Y = !g(), Z = $("flex items-center justify-center border-l border-input", "text-muted-foreground transition-colors", "hover:bg-accent hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground", h().btnSize, h().height);
176
+ return V !== n.e && C(t, n.e = V), j !== n.t && C(u, n.t = j), A !== n.a && (a.disabled = n.a = A), F !== n.o && C(a, n.o = F), W !== n.i && p(d, "min", n.i = W), q !== n.n && p(d, "max", n.n = q), H !== n.s && p(d, "step", n.s = H), G !== n.h && (d.disabled = n.h = G), U !== n.r && (d.readOnly = n.r = U), X !== n.d && p(d, "placeholder", n.d = X), J !== n.l && p(d, "aria-invalid", n.l = J), K !== n.u && p(d, "aria-describedby", n.u = K), Q !== n.c && C(d, n.c = Q), Y !== n.w && (k.disabled = n.w = Y), Z !== n.m && C(k, n.m = Z), n;
171
177
  }, {
172
178
  e: void 0,
173
179
  t: void 0,
@@ -184,15 +190,15 @@ function Oe(t) {
184
190
  c: void 0,
185
191
  w: void 0,
186
192
  m: void 0
187
- }), S(() => s.value = t.value), i;
193
+ }), y(() => d.value = r.value), t;
188
194
  })();
189
195
  }
190
196
  const D = 8;
191
- function _e(t) {
192
- const [e, b] = N(t, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), m = e.id ?? E(), y = `${m}-error`, g = `${m}-helper`, p = () => {
197
+ function Oe(r) {
198
+ const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), S = E(), m = () => e.id ?? S, f = () => `${m()}-error`, x = () => `${m()}-helper`, I = () => {
193
199
  const v = [];
194
- return e.error && v.push(y), e.helperText && !e.error && v.push(g), v.length > 0 ? v.join(" ") : void 0;
195
- }, l = {
200
+ return e.error && v.push(f()), e.helperText && !e.error && v.push(x()), v.length > 0 ? v.join(" ") : void 0;
201
+ }, o = {
196
202
  sm: {
197
203
  height: "h-7",
198
204
  text: "text-xs",
@@ -208,26 +214,26 @@ function _e(t) {
208
214
  text: "text-sm",
209
215
  px: "px-3"
210
216
  }
211
- }, c = () => l[e.size ?? "md"], u = () => !!e.prefix || e.prefixOptions && e.prefixOptions.length > 0, _ = () => !!e.suffix || e.suffixOptions && e.suffixOptions.length > 0, T = () => e.prefix ? e.prefix : e.prefixOptions?.find((v) => v.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, P = () => e.suffix ? e.suffix : e.suffixOptions?.find((v) => v.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
217
+ }, g = () => o[e.size ?? "md"], s = () => !!e.prefix || e.prefixOptions && e.prefixOptions.length > 0, O = () => !!e.suffix || e.suffixOptions && e.suffixOptions.length > 0, T = () => e.prefix ? e.prefix : e.prefixOptions?.find((v) => v.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, P = () => e.suffix ? e.suffix : e.suffixOptions?.find((v) => v.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
212
218
  return (() => {
213
- var v = ve(), z = v.firstChild, o = z.firstChild;
214
- return d(z, h(w, {
219
+ var v = ve(), i = v.firstChild, h = i.firstChild;
220
+ return l(i, c(w, {
215
221
  get when() {
216
- return u();
222
+ return s();
217
223
  },
218
224
  get children() {
219
- return h(w, {
225
+ return c(w, {
220
226
  get when() {
221
- return k(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
227
+ return _(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
222
228
  },
223
229
  get fallback() {
224
230
  return (() => {
225
- var r = ne();
226
- return d(r, () => e.prefix), S(() => I(r, $("flex items-center border-r border-input bg-muted/50 text-muted-foreground", c().text, c().px, c().height))), r;
231
+ var t = ne();
232
+ return l(t, () => e.prefix), y(() => C(t, $("flex items-center border-r border-input bg-muted/50 text-muted-foreground", g().text, g().px, g().height))), t;
227
233
  })();
228
234
  },
229
235
  get children() {
230
- return h(ie, {
236
+ return c(ie, {
231
237
  get options() {
232
238
  return e.prefixOptions;
233
239
  },
@@ -251,33 +257,36 @@ function _e(t) {
251
257
  }
252
258
  });
253
259
  }
254
- }), o), x(o, "id", m), R(o, B({
260
+ }), h), R(h, B({
261
+ get id() {
262
+ return m();
263
+ },
255
264
  get "aria-invalid"() {
256
265
  return e.error ? !0 : void 0;
257
266
  },
258
267
  get "aria-describedby"() {
259
- return p();
268
+ return I();
260
269
  },
261
270
  get class() {
262
- return $("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground/60", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", c().text, c().px);
271
+ return $("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground/60", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", g().text, g().px);
263
272
  }
264
- }, b), !1, !1), d(z, h(w, {
273
+ }, b), !1, !1), l(i, c(w, {
265
274
  get when() {
266
- return _();
275
+ return O();
267
276
  },
268
277
  get children() {
269
- return h(w, {
278
+ return c(w, {
270
279
  get when() {
271
- return k(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
280
+ return _(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
272
281
  },
273
282
  get fallback() {
274
283
  return (() => {
275
- var r = ne();
276
- return d(r, () => e.suffix), S(() => I(r, $("flex items-center border-l border-input bg-muted/50 text-muted-foreground", c().text, c().px, c().height))), r;
284
+ var t = ne();
285
+ return l(t, () => e.suffix), y(() => C(t, $("flex items-center border-l border-input bg-muted/50 text-muted-foreground", g().text, g().px, g().height))), t;
277
286
  })();
278
287
  },
279
288
  get children() {
280
- return h(ie, {
289
+ return c(ie, {
281
290
  get options() {
282
291
  return e.suffixOptions;
283
292
  },
@@ -301,38 +310,38 @@ function _e(t) {
301
310
  }
302
311
  });
303
312
  }
304
- }), null), d(v, h(w, {
313
+ }), null), l(v, c(w, {
305
314
  get when() {
306
315
  return e.error;
307
316
  },
308
317
  get children() {
309
- var r = L();
310
- return x(r, "id", y), d(r, () => e.error), r;
318
+ var t = L();
319
+ return l(t, () => e.error), y(() => p(t, "id", f())), t;
311
320
  }
312
- }), null), d(v, h(w, {
321
+ }), null), l(v, c(w, {
313
322
  get when() {
314
- return k(() => !!e.helperText)() && !e.error;
323
+ return _(() => !!e.helperText)() && !e.error;
315
324
  },
316
325
  get children() {
317
- var r = M();
318
- return x(r, "id", g), d(r, () => e.helperText), r;
326
+ var t = M();
327
+ return l(t, () => e.helperText), y(() => p(t, "id", x())), t;
319
328
  }
320
- }), null), S((r) => {
321
- var i = e.class, a = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", b.disabled && "opacity-50 cursor-not-allowed", e.error && "border-error focus-within:ring-error", c().height);
322
- return i !== r.e && I(v, r.e = i), a !== r.t && I(z, r.t = a), r;
329
+ }), null), y((t) => {
330
+ var u = e.class, a = $("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", "focus-within:ring-1 focus-within:ring-ring focus-within:border-ring", b.disabled && "opacity-50 cursor-not-allowed", e.error && "border-error focus-within:ring-error", g().height);
331
+ return u !== t.e && C(v, t.e = u), a !== t.t && C(i, t.t = a), t;
323
332
  }, {
324
333
  e: void 0,
325
334
  t: void 0
326
335
  }), v;
327
336
  })();
328
337
  }
329
- function ie(t) {
330
- const [e, b] = re(!1), [m, y] = re({
338
+ function ie(r) {
339
+ const [e, b] = re(!1), [S, m] = re({
331
340
  x: -9999,
332
341
  y: -9999
333
342
  });
334
- let g, p;
335
- const l = {
343
+ let f, x;
344
+ const I = {
336
345
  sm: {
337
346
  height: "h-7",
338
347
  text: "text-xs",
@@ -348,70 +357,70 @@ function ie(t) {
348
357
  text: "text-sm",
349
358
  px: "px-3"
350
359
  }
351
- }, c = () => l[t.size ?? "md"], u = () => {
352
- if (!g || !p) return;
353
- const o = g.getBoundingClientRect(), r = p.getBoundingClientRect(), i = window.innerWidth, a = window.innerHeight;
354
- let f = o.left, s = o.bottom + 2;
355
- f + r.width > i - D && (f = o.right - r.width), f = Math.max(D, f), s + r.height > a - D && (s = o.top - r.height - 2), s = Math.max(D, s), y({
356
- x: f,
357
- y: s
360
+ }, o = () => I[r.size ?? "md"], g = () => {
361
+ if (!f || !x) return;
362
+ const i = f.getBoundingClientRect(), h = x.getBoundingClientRect(), t = window.innerWidth, u = window.innerHeight;
363
+ let a = i.left, d = i.bottom + 2;
364
+ a + h.width > t - D && (a = i.right - h.width), a = Math.max(D, a), d + h.height > u - D && (d = i.top - h.height - 2), d = Math.max(D, d), m({
365
+ x: a,
366
+ y: d
358
367
  });
359
- }, _ = (o) => {
360
- g && !g.contains(o.target) && p && !p.contains(o.target) && b(!1);
361
- }, T = (o) => {
362
- o.key === "Escape" && b(!1);
363
- }, P = (o) => {
364
- t.onChange?.(o), b(!1);
368
+ }, s = (i) => {
369
+ f && !f.contains(i.target) && x && !x.contains(i.target) && b(!1);
370
+ }, O = (i) => {
371
+ i.key === "Escape" && b(!1);
372
+ }, T = (i) => {
373
+ r.onChange?.(i), b(!1);
374
+ }, P = () => {
375
+ document.addEventListener("mousedown", s), document.addEventListener("keydown", O), requestAnimationFrame(g);
365
376
  }, v = () => {
366
- document.addEventListener("mousedown", _), document.addEventListener("keydown", T), requestAnimationFrame(u);
367
- }, z = () => {
368
- document.removeEventListener("mousedown", _), document.removeEventListener("keydown", T);
377
+ document.removeEventListener("mousedown", s), document.removeEventListener("keydown", O);
369
378
  };
370
379
  return [(() => {
371
- var o = be(), r = o.firstChild;
372
- o.$$click = () => {
373
- e() ? (b(!1), z()) : (b(!0), v());
380
+ var i = be(), h = i.firstChild;
381
+ i.$$click = () => {
382
+ e() ? (b(!1), v()) : (b(!0), P());
374
383
  };
375
- var i = g;
376
- return typeof i == "function" ? te(i, o) : g = o, d(r, () => t.label), d(o, h(ae, {
384
+ var t = f;
385
+ return typeof t == "function" ? te(t, i) : f = i, l(h, () => r.label), l(i, c(ae, {
377
386
  class: "w-3 h-3 opacity-60"
378
- }), null), S((a) => {
379
- var f = t.disabled, s = $("flex items-center gap-1 bg-muted/50 text-muted-foreground", "hover:bg-muted hover:text-foreground transition-colors", "focus:outline-none", "disabled:cursor-not-allowed disabled:hover:bg-muted/50 disabled:hover:text-muted-foreground", t.position === "prefix" ? "border-r border-input" : "border-l border-input", c().text, c().px, c().height);
380
- return f !== a.e && (o.disabled = a.e = f), s !== a.t && I(o, a.t = s), a;
387
+ }), null), y((u) => {
388
+ var a = r.disabled, d = $("flex items-center gap-1 bg-muted/50 text-muted-foreground", "hover:bg-muted hover:text-foreground transition-colors", "focus:outline-none", "disabled:cursor-not-allowed disabled:hover:bg-muted/50 disabled:hover:text-muted-foreground", r.position === "prefix" ? "border-r border-input" : "border-l border-input", o().text, o().px, o().height);
389
+ return a !== u.e && (i.disabled = u.e = a), d !== u.t && C(i, u.t = d), u;
381
390
  }, {
382
391
  e: void 0,
383
392
  t: void 0
384
- }), o;
385
- })(), h(w, {
393
+ }), i;
394
+ })(), c(w, {
386
395
  get when() {
387
396
  return e();
388
397
  },
389
398
  get children() {
390
- return h(le, {
399
+ return c(le, {
391
400
  get children() {
392
- var o = me(), r = p;
393
- return typeof r == "function" ? te(r, o) : p = o, d(o, h(de, {
401
+ var i = me(), h = x;
402
+ return typeof h == "function" ? te(h, i) : x = i, l(i, c(de, {
394
403
  get each() {
395
- return t.options;
404
+ return r.options;
396
405
  },
397
- children: (i) => (() => {
398
- var a = pe();
399
- return a.$$click = () => P(i.value), d(a, () => i.label), S((f) => {
400
- var s = $("w-full flex items-center px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-accent", "focus:outline-none focus:bg-accent", t.value === i.value && "bg-accent/50 font-medium"), O = t.value === i.value;
401
- return s !== f.e && I(a, f.e = s), O !== f.t && x(a, "aria-selected", f.t = O), f;
406
+ children: (t) => (() => {
407
+ var u = pe();
408
+ return u.$$click = () => T(t.value), l(u, () => t.label), y((a) => {
409
+ var d = $("w-full flex items-center px-2.5 py-1.5 text-xs cursor-pointer", "transition-colors duration-75", "hover:bg-accent", "focus:outline-none focus:bg-accent", r.value === t.value && "bg-accent/50 font-medium"), k = r.value === t.value;
410
+ return d !== a.e && C(u, a.e = d), k !== a.t && p(u, "aria-selected", a.t = k), a;
402
411
  }, {
403
412
  e: void 0,
404
413
  t: void 0
405
- }), a;
414
+ }), u;
406
415
  })()
407
- })), S((i) => {
408
- var a = $("fixed z-50 min-w-24 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-top-1"), f = `${m().x}px`, s = `${m().y}px`;
409
- return a !== i.e && I(o, i.e = a), f !== i.t && ee(o, "left", i.t = f), s !== i.a && ee(o, "top", i.a = s), i;
416
+ })), y((t) => {
417
+ var u = $("fixed z-50 min-w-24 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "animate-in fade-in slide-in-from-top-1"), a = `${S().x}px`, d = `${S().y}px`;
418
+ return u !== t.e && C(i, t.e = u), a !== t.t && ee(i, "left", t.t = a), d !== t.a && ee(i, "top", t.a = d), t;
410
419
  }, {
411
420
  e: void 0,
412
421
  t: void 0,
413
422
  a: void 0
414
- }), o;
423
+ }), i;
415
424
  }
416
425
  });
417
426
  }
@@ -419,8 +428,8 @@ function ie(t) {
419
428
  }
420
429
  oe(["click", "input"]);
421
430
  export {
422
- _e as AffixInput,
431
+ Oe as AffixInput,
423
432
  ze as Input,
424
- Oe as NumberInput,
433
+ ke as NumberInput,
425
434
  Se as Textarea
426
435
  };