@floegence/floe-webapp-core 0.50.3 → 0.50.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,130 +1,130 @@
1
- import { insert as l, createComponent as f, effect as y, className as C, memo as _, spread as B, mergeProps as L, setAttribute as m, template as z, Portal as oe, setStyleProperty as ee, use as te, delegateEvents as le } from "solid-js/web";
2
- import { splitProps as N, createUniqueId as E, Show as p, createSignal as re, createEffect as de, onCleanup as ue, For as se } from "solid-js";
3
- import { cn as $ } from "../../utils/cn.js";
4
- import { Minus as ae, Plus as ce, ChevronDown as fe } from "../icons/index.js";
5
- var he = /* @__PURE__ */ z('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), ge = /* @__PURE__ */ z('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), M = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-error"role=alert>'), R = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-muted-foreground">'), xe = /* @__PURE__ */ z("<div class=relative><input>"), ve = /* @__PURE__ */ z("<div><textarea>"), be = /* @__PURE__ */ z('<div><div><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), me = /* @__PURE__ */ z("<div><div><input>"), ne = /* @__PURE__ */ z("<span>"), pe = /* @__PURE__ */ z("<button type=button><span>"), we = /* @__PURE__ */ z("<div role=listbox>"), ye = /* @__PURE__ */ z("<button type=button role=option>");
6
- const $e = {
1
+ import { insert as l, createComponent as f, effect as y, className as C, memo as _, spread as B, mergeProps as L, setAttribute as g, template as z, Portal as de, setStyleProperty as re, use as ne, delegateEvents as ae } from "solid-js/web";
2
+ import { splitProps as N, createUniqueId as E, Show as w, createSignal as ie, createEffect as ue, onCleanup as se, For as ce } from "solid-js";
3
+ import { cn as I } from "../../utils/cn.js";
4
+ import { Minus as fe, Plus as he, ChevronDown as ge } from "../icons/index.js";
5
+ var xe = /* @__PURE__ */ z('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), ve = /* @__PURE__ */ z('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), M = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-error"role=alert>'), R = /* @__PURE__ */ z('<p class="mt-1 text-[11px] text-muted-foreground">'), be = /* @__PURE__ */ z("<div class=relative><input>"), me = /* @__PURE__ */ z("<div><textarea>"), pe = /* @__PURE__ */ z('<div><div data-floe-input-surface><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), we = /* @__PURE__ */ z("<div><div data-floe-input-surface><input>"), oe = /* @__PURE__ */ z("<span>"), ye = /* @__PURE__ */ z("<button type=button><span>"), Ie = /* @__PURE__ */ z("<div role=listbox>"), $e = /* @__PURE__ */ z("<button type=button role=option>");
6
+ const Ce = {
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 ke(r) {
12
- const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(), v = () => e.id ?? S, h = () => `${v()}-error`, x = () => `${v()}-helper`, I = () => {
11
+ function Te(r) {
12
+ const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`, v = () => `${m()}-helper`, $ = () => {
13
13
  const o = [];
14
- return e.error && o.push(h()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
14
+ return e.error && o.push(h()), e.helperText && !e.error && o.push(v()), o.length > 0 ? o.join(" ") : void 0;
15
15
  };
16
16
  return (() => {
17
- var o = xe(), g = o.firstChild;
18
- return l(o, f(p, {
17
+ var o = be(), x = o.firstChild;
18
+ return l(o, f(w, {
19
19
  get when() {
20
20
  return e.leftIcon;
21
21
  },
22
22
  get children() {
23
- var u = he();
24
- return l(u, () => e.leftIcon), u;
23
+ var a = xe();
24
+ return l(a, () => e.leftIcon), a;
25
25
  }
26
- }), g), B(g, L({
26
+ }), x), B(x, L({
27
27
  get id() {
28
- return v();
28
+ return m();
29
29
  },
30
30
  get "aria-invalid"() {
31
31
  return e.error ? !0 : void 0;
32
32
  },
33
33
  get "aria-describedby"() {
34
- return I();
34
+ return $();
35
35
  },
36
36
  get class() {
37
- return $(
37
+ return I(
38
38
  "w-full rounded border border-input bg-background shadow-sm",
39
39
  "placeholder:text-muted-foreground/60",
40
40
  "transition-colors duration-100",
41
- "focus:outline-none focus:ring-1 focus:ring-ring focus:border-ring",
41
+ "focus:outline-none",
42
42
  "disabled:cursor-not-allowed disabled:opacity-50",
43
- e.error && "border-error focus:ring-error",
44
- $e[e.size ?? "md"],
43
+ e.error && "border-error",
44
+ Ce[e.size ?? "md"],
45
45
  // Icon padding must come AFTER sizeStyles to override px-*
46
46
  e.leftIcon && "pl-10",
47
47
  e.rightIcon && "pr-10",
48
48
  e.class
49
49
  );
50
50
  }
51
- }, b), !1, !1), l(o, f(p, {
51
+ }, b), !1, !1), l(o, f(w, {
52
52
  get when() {
53
53
  return e.rightIcon;
54
54
  },
55
55
  get children() {
56
- var u = ge();
57
- return l(u, () => e.rightIcon), u;
56
+ var a = ve();
57
+ return l(a, () => e.rightIcon), a;
58
58
  }
59
- }), null), l(o, f(p, {
59
+ }), null), l(o, f(w, {
60
60
  get when() {
61
61
  return e.error;
62
62
  },
63
63
  get children() {
64
- var u = M();
65
- return l(u, () => e.error), y(() => m(u, "id", h())), u;
64
+ var a = M();
65
+ return l(a, () => e.error), y(() => g(a, "id", h())), a;
66
66
  }
67
- }), null), l(o, f(p, {
67
+ }), null), l(o, f(w, {
68
68
  get when() {
69
69
  return _(() => !!e.helperText)() && !e.error;
70
70
  },
71
71
  get children() {
72
- var u = R();
73
- return l(u, () => e.helperText), y(() => m(u, "id", x())), u;
72
+ var a = R();
73
+ return l(a, () => e.helperText), y(() => g(a, "id", v())), a;
74
74
  }
75
75
  }), null), o;
76
76
  })();
77
77
  }
78
- function Oe(r) {
79
- const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), v = () => e.id ?? S, h = () => `${v()}-error`, x = () => `${v()}-helper`, I = () => {
78
+ function _e(r) {
79
+ const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`, v = () => `${m()}-helper`, $ = () => {
80
80
  const o = [];
81
- return e.error && o.push(h()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
81
+ return e.error && o.push(h()), e.helperText && !e.error && o.push(v()), o.length > 0 ? o.join(" ") : void 0;
82
82
  };
83
83
  return (() => {
84
- var o = ve(), g = o.firstChild;
85
- return B(g, L({
84
+ var o = me(), x = o.firstChild;
85
+ return B(x, L({
86
86
  get id() {
87
- return v();
87
+ return m();
88
88
  },
89
89
  get "aria-invalid"() {
90
90
  return e.error ? !0 : void 0;
91
91
  },
92
92
  get "aria-describedby"() {
93
- return I();
93
+ return $();
94
94
  },
95
95
  get class() {
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);
96
+ return I("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", "disabled:cursor-not-allowed disabled:opacity-50", "resize-y", e.error && "border-error", e.class);
97
97
  }
98
- }, b), !1, !1), l(o, f(p, {
98
+ }, b), !1, !1), l(o, f(w, {
99
99
  get when() {
100
100
  return e.error;
101
101
  },
102
102
  get children() {
103
- var u = M();
104
- return l(u, () => e.error), y(() => m(u, "id", h())), u;
103
+ var a = M();
104
+ return l(a, () => e.error), y(() => g(a, "id", h())), a;
105
105
  }
106
- }), null), l(o, f(p, {
106
+ }), null), l(o, f(w, {
107
107
  get when() {
108
108
  return _(() => !!e.helperText)() && !e.error;
109
109
  },
110
110
  get children() {
111
- var u = R();
112
- return l(u, () => e.helperText), y(() => m(u, "id", x())), u;
111
+ var a = R();
112
+ return l(a, () => e.helperText), y(() => g(a, "id", v())), a;
113
113
  }
114
114
  }), null), o;
115
115
  })();
116
116
  }
117
- function _e(r) {
118
- const e = E(), b = `${e}-error`, S = `${e}-helper`, v = () => r.step ?? 1, h = () => r.min ?? -1 / 0, x = () => r.max ?? 1 / 0, I = (t) => Math.min(x(), Math.max(h(), t)), o = () => !r.disabled && r.value > h(), g = () => !r.disabled && r.value < x(), u = () => {
119
- o() && r.onChange(I(r.value - v()));
120
- }, O = () => {
121
- g() && r.onChange(I(r.value + v()));
122
- }, T = (t) => {
123
- const a = parseFloat(t.currentTarget.value);
124
- isNaN(a) || r.onChange(I(a));
117
+ function Pe(r) {
118
+ const e = E(), b = `${e}-error`, S = `${e}-helper`, m = () => r.step ?? 1, h = () => r.min ?? -1 / 0, v = () => r.max ?? 1 / 0, $ = (t) => Math.min(v(), Math.max(h(), t)), o = () => !r.disabled && r.value > h(), x = () => !r.disabled && r.value < v(), a = () => {
119
+ o() && r.onChange($(r.value - m()));
120
+ }, T = () => {
121
+ x() && r.onChange($(r.value + m()));
122
+ }, P = (t) => {
123
+ const u = parseFloat(t.currentTarget.value);
124
+ isNaN(u) || r.onChange($(u));
125
125
  }, i = (t) => {
126
- const a = parseFloat(t.currentTarget.value);
127
- isNaN(a) ? r.onChange(h() === -1 / 0 ? 0 : h()) : r.onChange(I(a));
126
+ const u = parseFloat(t.currentTarget.value);
127
+ isNaN(u) ? r.onChange(h() === -1 / 0 ? 0 : h()) : r.onChange($(u));
128
128
  }, s = () => {
129
129
  const t = [];
130
130
  return r.error && t.push(b), r.helperText && !r.error && t.push(S), t.length > 0 ? t.join(" ") : void 0;
@@ -146,34 +146,34 @@ function _e(r) {
146
146
  }
147
147
  }, d = () => c[r.size ?? "md"];
148
148
  return (() => {
149
- var t = be(), a = t.firstChild, k = a.firstChild, w = k.nextSibling, P = w.nextSibling;
150
- return k.$$click = u, l(k, f(ae, {
149
+ var t = pe(), u = t.firstChild, k = u.firstChild, p = k.nextSibling, O = p.nextSibling;
150
+ return k.$$click = a, l(k, f(fe, {
151
151
  get class() {
152
152
  return d().iconSize;
153
153
  }
154
- })), w.addEventListener("blur", i), w.$$input = T, m(w, "id", e), P.$$click = O, l(P, f(ce, {
154
+ })), p.addEventListener("blur", i), p.$$input = P, g(p, "id", e), O.$$click = T, l(O, f(he, {
155
155
  get class() {
156
156
  return d().iconSize;
157
157
  }
158
- })), l(t, f(p, {
158
+ })), l(t, f(w, {
159
159
  get when() {
160
160
  return r.error;
161
161
  },
162
162
  get children() {
163
163
  var n = M();
164
- return m(n, "id", b), l(n, () => r.error), n;
164
+ return g(n, "id", b), l(n, () => r.error), n;
165
165
  }
166
- }), null), l(t, f(p, {
166
+ }), null), l(t, f(w, {
167
167
  get when() {
168
168
  return _(() => !!r.helperText)() && !r.error;
169
169
  },
170
170
  get children() {
171
171
  var n = R();
172
- return m(n, "id", S), l(n, () => r.helperText), n;
172
+ return g(n, "id", S), l(n, () => r.helperText), n;
173
173
  }
174
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", d().height), A = !o(), F = $("flex items-center justify-center border-r border-input cursor-pointer", "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", d().btnSize, d().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 = s(), 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 cursor-pointer", "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", d().btnSize, d().height);
176
- return V !== n.e && C(t, n.e = V), j !== n.t && C(a, n.t = j), A !== n.a && (k.disabled = n.a = A), F !== n.o && C(k, n.o = F), W !== n.i && m(w, "min", n.i = W), q !== n.n && m(w, "max", n.n = q), H !== n.s && m(w, "step", n.s = H), G !== n.h && (w.disabled = n.h = G), U !== n.r && (w.readOnly = n.r = U), X !== n.d && m(w, "placeholder", n.d = X), J !== n.l && m(w, "aria-invalid", n.l = J), K !== n.u && m(w, "aria-describedby", n.u = K), Q !== n.c && C(w, n.c = Q), Y !== n.w && (P.disabled = n.w = Y), Z !== n.m && C(P, n.m = Z), n;
175
+ var V = r.class, j = r.error ? !0 : void 0, A = r.disabled ? !0 : void 0, F = I("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", r.disabled && "opacity-50 cursor-not-allowed", r.error && "border-error", d().height), W = !o(), q = I("flex items-center justify-center border-r border-input cursor-pointer", "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", d().btnSize, d().height), H = r.min, G = r.max, U = r.step, X = r.disabled, J = r.inputDisabled, K = r.placeholder, Q = r.error ? !0 : void 0, Y = s(), Z = I("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"), ee = !x(), te = I("flex items-center justify-center border-l border-input cursor-pointer", "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", d().btnSize, d().height);
176
+ return V !== n.e && C(t, n.e = V), j !== n.t && g(u, "aria-invalid", n.t = j), A !== n.a && g(u, "aria-disabled", n.a = A), F !== n.o && C(u, n.o = F), W !== n.i && (k.disabled = n.i = W), q !== n.n && C(k, n.n = q), H !== n.s && g(p, "min", n.s = H), G !== n.h && g(p, "max", n.h = G), U !== n.r && g(p, "step", n.r = U), X !== n.d && (p.disabled = n.d = X), J !== n.l && (p.readOnly = n.l = J), K !== n.u && g(p, "placeholder", n.u = K), Q !== n.c && g(p, "aria-invalid", n.c = Q), Y !== n.w && g(p, "aria-describedby", n.w = Y), Z !== n.m && C(p, n.m = Z), ee !== n.f && (O.disabled = n.f = ee), te !== n.y && C(O, n.y = te), n;
177
177
  }, {
178
178
  e: void 0,
179
179
  t: void 0,
@@ -189,15 +189,17 @@ function _e(r) {
189
189
  u: void 0,
190
190
  c: void 0,
191
191
  w: void 0,
192
- m: void 0
193
- }), y(() => w.value = r.value), t;
192
+ m: void 0,
193
+ f: void 0,
194
+ y: void 0
195
+ }), y(() => p.value = r.value), t;
194
196
  })();
195
197
  }
196
198
  const D = 8;
197
- function Te(r) {
198
- const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), S = E(), v = () => e.id ?? S, h = () => `${v()}-error`, x = () => `${v()}-helper`, I = () => {
199
+ function De(r) {
200
+ const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`, v = () => `${m()}-helper`, $ = () => {
199
201
  const s = [];
200
- return e.error && s.push(h()), e.helperText && !e.error && s.push(x()), s.length > 0 ? s.join(" ") : void 0;
202
+ return e.error && s.push(h()), e.helperText && !e.error && s.push(v()), s.length > 0 ? s.join(" ") : void 0;
201
203
  }, o = {
202
204
  sm: {
203
205
  height: "h-7",
@@ -214,26 +216,26 @@ function Te(r) {
214
216
  text: "text-sm",
215
217
  px: "px-3"
216
218
  }
217
- }, g = () => o[e.size ?? "md"], u = () => !!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((s) => s.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, i = () => e.suffix ? e.suffix : e.suffixOptions?.find((s) => s.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
219
+ }, x = () => o[e.size ?? "md"], a = () => !!e.prefix || e.prefixOptions && e.prefixOptions.length > 0, T = () => !!e.suffix || e.suffixOptions && e.suffixOptions.length > 0, P = () => e.prefix ? e.prefix : e.prefixOptions?.find((s) => s.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, i = () => e.suffix ? e.suffix : e.suffixOptions?.find((s) => s.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
218
220
  return (() => {
219
- var s = me(), c = s.firstChild, d = c.firstChild;
220
- return l(c, f(p, {
221
+ var s = we(), c = s.firstChild, d = c.firstChild;
222
+ return l(c, f(w, {
221
223
  get when() {
222
- return u();
224
+ return a();
223
225
  },
224
226
  get children() {
225
- return f(p, {
227
+ return f(w, {
226
228
  get when() {
227
229
  return _(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
228
230
  },
229
231
  get fallback() {
230
232
  return (() => {
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;
233
+ var t = oe();
234
+ return l(t, () => e.prefix), y(() => C(t, I("flex items-center border-r border-input bg-muted/50 text-muted-foreground", x().text, x().px, x().height))), t;
233
235
  })();
234
236
  },
235
237
  get children() {
236
- return f(ie, {
238
+ return f(le, {
237
239
  get options() {
238
240
  return e.prefixOptions;
239
241
  },
@@ -244,7 +246,7 @@ function Te(r) {
244
246
  return e.onPrefixChange;
245
247
  },
246
248
  get label() {
247
- return T();
249
+ return P();
248
250
  },
249
251
  get size() {
250
252
  return e.size;
@@ -259,34 +261,34 @@ function Te(r) {
259
261
  }
260
262
  }), d), B(d, L({
261
263
  get id() {
262
- return v();
264
+ return m();
263
265
  },
264
266
  get "aria-invalid"() {
265
267
  return e.error ? !0 : void 0;
266
268
  },
267
269
  get "aria-describedby"() {
268
- return I();
270
+ return $();
269
271
  },
270
272
  get class() {
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);
273
+ return I("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", x().text, x().px);
272
274
  }
273
- }, b), !1, !1), l(c, f(p, {
275
+ }, b), !1, !1), l(c, f(w, {
274
276
  get when() {
275
- return O();
277
+ return T();
276
278
  },
277
279
  get children() {
278
- return f(p, {
280
+ return f(w, {
279
281
  get when() {
280
282
  return _(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
281
283
  },
282
284
  get fallback() {
283
285
  return (() => {
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;
286
+ var t = oe();
287
+ return l(t, () => e.suffix), y(() => C(t, I("flex items-center border-l border-input bg-muted/50 text-muted-foreground", x().text, x().px, x().height))), t;
286
288
  })();
287
289
  },
288
290
  get children() {
289
- return f(ie, {
291
+ return f(le, {
290
292
  get options() {
291
293
  return e.suffixOptions;
292
294
  },
@@ -310,38 +312,40 @@ function Te(r) {
310
312
  }
311
313
  });
312
314
  }
313
- }), null), l(s, f(p, {
315
+ }), null), l(s, f(w, {
314
316
  get when() {
315
317
  return e.error;
316
318
  },
317
319
  get children() {
318
320
  var t = M();
319
- return l(t, () => e.error), y(() => m(t, "id", h())), t;
321
+ return l(t, () => e.error), y(() => g(t, "id", h())), t;
320
322
  }
321
- }), null), l(s, f(p, {
323
+ }), null), l(s, f(w, {
322
324
  get when() {
323
325
  return _(() => !!e.helperText)() && !e.error;
324
326
  },
325
327
  get children() {
326
328
  var t = R();
327
- return l(t, () => e.helperText), y(() => m(t, "id", x())), t;
329
+ return l(t, () => e.helperText), y(() => g(t, "id", v())), t;
328
330
  }
329
331
  }), null), y((t) => {
330
- var a = e.class, k = $("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 a !== t.e && C(s, t.e = a), k !== t.t && C(c, t.t = k), t;
332
+ var u = e.class, k = e.error ? !0 : void 0, p = b.disabled ? !0 : void 0, O = I("inline-flex items-center rounded border border-input bg-background shadow-sm", "transition-colors duration-100", b.disabled && "opacity-50 cursor-not-allowed", e.error && "border-error", x().height);
333
+ return u !== t.e && C(s, t.e = u), k !== t.t && g(c, "aria-invalid", t.t = k), p !== t.a && g(c, "aria-disabled", t.a = p), O !== t.o && C(c, t.o = O), t;
332
334
  }, {
333
335
  e: void 0,
334
- t: void 0
336
+ t: void 0,
337
+ a: void 0,
338
+ o: void 0
335
339
  }), s;
336
340
  })();
337
341
  }
338
- function ie(r) {
339
- const [e, b] = re(!1), [S, v] = re({
342
+ function le(r) {
343
+ const [e, b] = ie(!1), [S, m] = ie({
340
344
  x: -9999,
341
345
  y: -9999
342
346
  });
343
- let h, x;
344
- const I = {
347
+ let h, v;
348
+ const $ = {
345
349
  sm: {
346
350
  height: "h-7",
347
351
  text: "text-xs",
@@ -357,72 +361,72 @@ function ie(r) {
357
361
  text: "text-sm",
358
362
  px: "px-3"
359
363
  }
360
- }, o = () => I[r.size ?? "md"], g = () => {
361
- if (!h || !x) return;
362
- const i = h.getBoundingClientRect(), s = x.getBoundingClientRect(), c = window.innerWidth, d = window.innerHeight;
363
- let t = i.left, a = i.bottom + 2;
364
- t + s.width > c - D && (t = i.right - s.width), t = Math.max(D, t), a + s.height > d - D && (a = i.top - s.height - 2), a = Math.max(D, a), v({
364
+ }, o = () => $[r.size ?? "md"], x = () => {
365
+ if (!h || !v) return;
366
+ const i = h.getBoundingClientRect(), s = v.getBoundingClientRect(), c = window.innerWidth, d = window.innerHeight;
367
+ let t = i.left, u = i.bottom + 2;
368
+ t + s.width > c - D && (t = i.right - s.width), t = Math.max(D, t), u + s.height > d - D && (u = i.top - s.height - 2), u = Math.max(D, u), m({
365
369
  x: t,
366
- y: a
370
+ y: u
367
371
  });
368
- }, u = (i) => {
369
- h && !h.contains(i.target) && x && !x.contains(i.target) && b(!1);
370
- }, O = (i) => {
371
- i.key === "Escape" && b(!1);
372
+ }, a = (i) => {
373
+ h && !h.contains(i.target) && v && !v.contains(i.target) && b(!1);
372
374
  }, T = (i) => {
375
+ i.key === "Escape" && b(!1);
376
+ }, P = (i) => {
373
377
  r.onChange?.(i), b(!1);
374
378
  };
375
- return de(() => {
379
+ return ue(() => {
376
380
  if (!e()) {
377
- v({
381
+ m({
378
382
  x: -9999,
379
383
  y: -9999
380
384
  });
381
385
  return;
382
386
  }
383
- typeof document > "u" || (document.addEventListener("mousedown", u), document.addEventListener("keydown", O), requestAnimationFrame(g), ue(() => {
384
- document.removeEventListener("mousedown", u), document.removeEventListener("keydown", O);
387
+ typeof document > "u" || (document.addEventListener("mousedown", a), document.addEventListener("keydown", T), requestAnimationFrame(x), se(() => {
388
+ document.removeEventListener("mousedown", a), document.removeEventListener("keydown", T);
385
389
  }));
386
390
  }), [(() => {
387
- var i = pe(), s = i.firstChild;
391
+ var i = ye(), s = i.firstChild;
388
392
  i.$$click = () => {
389
393
  b((d) => !d);
390
394
  };
391
395
  var c = h;
392
- return typeof c == "function" ? te(c, i) : h = i, l(s, () => r.label), l(i, f(fe, {
396
+ return typeof c == "function" ? ne(c, i) : h = i, l(s, () => r.label), l(i, f(ge, {
393
397
  class: "w-3 h-3 opacity-60"
394
398
  }), null), y((d) => {
395
- var t = r.disabled, a = $("flex items-center gap-1 bg-muted/50 text-muted-foreground cursor-pointer", "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);
396
- return t !== d.e && (i.disabled = d.e = t), a !== d.t && C(i, d.t = a), d;
399
+ var t = r.disabled, u = I("flex items-center gap-1 bg-muted/50 text-muted-foreground cursor-pointer", "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);
400
+ return t !== d.e && (i.disabled = d.e = t), u !== d.t && C(i, d.t = u), d;
397
401
  }, {
398
402
  e: void 0,
399
403
  t: void 0
400
404
  }), i;
401
- })(), f(p, {
405
+ })(), f(w, {
402
406
  get when() {
403
407
  return e();
404
408
  },
405
409
  get children() {
406
- return f(oe, {
410
+ return f(de, {
407
411
  get children() {
408
- var i = we(), s = x;
409
- return typeof s == "function" ? te(s, i) : x = i, l(i, f(se, {
412
+ var i = Ie(), s = v;
413
+ return typeof s == "function" ? ne(s, i) : v = i, l(i, f(ce, {
410
414
  get each() {
411
415
  return r.options;
412
416
  },
413
417
  children: (c) => (() => {
414
- var d = ye();
415
- return d.$$click = () => T(c.value), l(d, () => c.label), y((t) => {
416
- var a = $("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 === c.value && "bg-accent/50 font-medium"), k = r.value === c.value;
417
- return a !== t.e && C(d, t.e = a), k !== t.t && m(d, "aria-selected", t.t = k), t;
418
+ var d = $e();
419
+ return d.$$click = () => P(c.value), l(d, () => c.label), y((t) => {
420
+ var u = I("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 === c.value && "bg-accent/50 font-medium"), k = r.value === c.value;
421
+ return u !== t.e && C(d, t.e = u), k !== t.t && g(d, "aria-selected", t.t = k), t;
418
422
  }, {
419
423
  e: void 0,
420
424
  t: void 0
421
425
  }), d;
422
426
  })()
423
427
  })), y((c) => {
424
- var d = $("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"), t = `${S().x}px`, a = `${S().y}px`;
425
- return d !== c.e && C(i, c.e = d), t !== c.t && ee(i, "left", c.t = t), a !== c.a && ee(i, "top", c.a = a), c;
428
+ var d = I("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"), t = `${S().x}px`, u = `${S().y}px`;
429
+ return d !== c.e && C(i, c.e = d), t !== c.t && re(i, "left", c.t = t), u !== c.a && re(i, "top", c.a = u), c;
426
430
  }, {
427
431
  e: void 0,
428
432
  t: void 0,
@@ -433,10 +437,10 @@ function ie(r) {
433
437
  }
434
438
  })];
435
439
  }
436
- le(["click", "input"]);
440
+ ae(["click", "input"]);
437
441
  export {
438
- Te as AffixInput,
439
- ke as Input,
440
- _e as NumberInput,
441
- Oe as Textarea
442
+ De as AffixInput,
443
+ Te as Input,
444
+ Pe as NumberInput,
445
+ _e as Textarea
442
446
  };
@@ -225,7 +225,7 @@ function ue(c) {
225
225
  return p.value = l, i(p, l), p;
226
226
  })()
227
227
  })), g((l) => {
228
- var p = v("text-muted-foreground", h().text), L = e.disabled, y = v("rounded-md border border-border bg-background px-2 focus:outline-none focus:ring-2 focus:ring-ring", h().input, e.disabled && "opacity-50 cursor-not-allowed");
228
+ var p = v("text-muted-foreground", h().text), L = e.disabled, y = v("rounded-md border border-border bg-background px-2 focus:outline-none", h().input, e.disabled && "opacity-50 cursor-not-allowed");
229
229
  return p !== l.e && b(s, l.e = p), L !== l.t && (d.disabled = l.t = L), y !== l.a && b(d, l.a = y), l;
230
230
  }, {
231
231
  e: void 0,
@@ -315,7 +315,7 @@ function ue(c) {
315
315
  get children() {
316
316
  var n = te(), s = n.firstChild, d = s.nextSibling;
317
317
  return d.addEventListener("blur", k), d.$$keydown = (l) => l.key === "Enter" && k(l), g((l) => {
318
- var p = v("text-muted-foreground", h().text), L = e.totalPages, y = String(e.page), A = e.disabled, B = v("rounded-md border border-border bg-background px-2 text-center", "focus:outline-none focus:ring-2 focus:ring-ring", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", h().input, e.disabled && "opacity-50 cursor-not-allowed");
318
+ var p = v("text-muted-foreground", h().text), L = e.totalPages, y = String(e.page), A = e.disabled, B = v("rounded-md border border-border bg-background px-2 text-center", "focus:outline-none", "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none", h().input, e.disabled && "opacity-50 cursor-not-allowed");
319
319
  return p !== l.e && b(s, l.e = p), L !== l.t && w(d, "max", l.t = L), y !== l.a && w(d, "placeholder", l.a = y), A !== l.o && (d.disabled = l.o = A), B !== l.i && b(d, l.i = B), l;
320
320
  }, {
321
321
  e: void 0,
package/dist/floe.css CHANGED
@@ -302,7 +302,11 @@
302
302
  }
303
303
 
304
304
  /* Focus styles */
305
- :focus-visible {
305
+ :focus-visible:not(:where(
306
+ input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
307
+ textarea, select, [data-floe-input-surface],
308
+ [data-floe-input-surface] :is(input, textarea, select, button)
309
+ )) {
306
310
  outline: none;
307
311
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
308
312
  }
@@ -427,6 +431,44 @@
427
431
  }
428
432
  }
429
433
 
434
+ /* A field has one visible border. Compound controls mark the element that owns it.
435
+ * This utility changes color only; it never replaces an existing decorative shadow.
436
+ */
437
+ @layer utilities {
438
+ :is(
439
+ input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
440
+ textarea, select, [data-floe-input-surface]
441
+ ) {
442
+ outline: none;
443
+ }
444
+
445
+ :is(
446
+ input:not([type='checkbox'], [type='radio'], [type='range'], [type='color'], [type='file'], [type='button'], [type='submit'], [type='reset'], [type='image']),
447
+ textarea, select, [data-floe-input-surface]
448
+ ):focus:not(:disabled):not([aria-disabled='true']):not([data-floe-input-surface] :is(input, textarea, select)),
449
+ [data-floe-input-surface]:focus-within:not(:disabled):not([aria-disabled='true']) {
450
+ border-color: var(--floe-input-focus-color, var(--ring));
451
+ }
452
+
453
+ :is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
454
+ --floe-input-focus-color: var(--error);
455
+ }
456
+
457
+ /* Internal buttons use a local fill to identify keyboard focus without a second frame. */
458
+ [data-floe-input-surface] button:focus-visible {
459
+ outline: none;
460
+ background-color: var(--accent);
461
+ color: var(--accent-foreground);
462
+ }
463
+
464
+ @media (forced-colors: active) {
465
+ :is(input, textarea, select, [data-floe-input-surface]),
466
+ :is(input, textarea, select, [data-floe-input-surface])[aria-invalid='true'] {
467
+ --floe-input-focus-color: Highlight;
468
+ }
469
+ }
470
+ }
471
+
430
472
  /* Animation utilities */
431
473
  @layer utilities {
432
474
  .floe-floating-presence {