@floegence/floe-webapp-core 0.86.76 → 0.87.1

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.
Files changed (54) hide show
  1. package/dist/components/index.d.ts +2 -0
  2. package/dist/components/ui/Accordion.d.ts +16 -0
  3. package/dist/components/ui/Accordion.js +59 -0
  4. package/dist/components/ui/Breadcrumb.d.ts +14 -0
  5. package/dist/components/ui/Breadcrumb.js +72 -0
  6. package/dist/components/ui/Calendar.d.ts +17 -0
  7. package/dist/components/ui/Calendar.js +151 -0
  8. package/dist/components/ui/Checkbox.js +137 -130
  9. package/dist/components/ui/DataTable.d.ts +33 -0
  10. package/dist/components/ui/DataTable.js +269 -0
  11. package/dist/components/ui/DatePicker.d.ts +35 -0
  12. package/dist/components/ui/DatePicker.js +198 -0
  13. package/dist/components/ui/Dropdown.d.ts +4 -20
  14. package/dist/components/ui/Dropdown.js +195 -231
  15. package/dist/components/ui/Form.d.ts +24 -5
  16. package/dist/components/ui/Form.js +179 -128
  17. package/dist/components/ui/Input.d.ts +6 -0
  18. package/dist/components/ui/Input.js +237 -189
  19. package/dist/components/ui/Pagination.js +211 -162
  20. package/dist/components/ui/Popover.d.ts +6 -1
  21. package/dist/components/ui/Popover.js +75 -56
  22. package/dist/components/ui/Select.d.ts +46 -0
  23. package/dist/components/ui/Select.js +414 -0
  24. package/dist/components/ui/Slider.d.ts +7 -0
  25. package/dist/components/ui/Slider.js +28 -0
  26. package/dist/components/ui/Switch.js +41 -32
  27. package/dist/components/ui/Table.d.ts +9 -0
  28. package/dist/components/ui/Table.js +97 -0
  29. package/dist/components/ui/calendarModel.d.ts +6 -0
  30. package/dist/components/ui/calendarModel.js +37 -0
  31. package/dist/components/ui/controllable.d.ts +7 -0
  32. package/dist/components/ui/controllable.js +10 -0
  33. package/dist/components/ui/dataTableModel.d.ts +18 -0
  34. package/dist/components/ui/dataTableModel.js +18 -0
  35. package/dist/components/ui/formFieldContext.d.ts +26 -0
  36. package/dist/components/ui/formFieldContext.js +40 -0
  37. package/dist/components/ui/index.d.ts +13 -1
  38. package/dist/components/ui/picker/PickerBase.js +106 -112
  39. package/dist/context/LocaleContext.d.ts +55 -0
  40. package/dist/context/LocaleContext.js +80 -0
  41. package/dist/context/index.d.ts +1 -0
  42. package/dist/floe.css +1 -0
  43. package/dist/full.d.ts +2 -0
  44. package/dist/full.js +776 -737
  45. package/dist/index.js +111 -107
  46. package/dist/standalone.css +1 -0
  47. package/dist/styles/themes/presets.d.ts +7 -3
  48. package/dist/styles/themes/presets.js +91 -39
  49. package/dist/styles.css +1 -1
  50. package/dist/themes/porcelain-light.css +19 -0
  51. package/dist/themes/shell-presets.generated.css +62 -49
  52. package/dist/ui.js +223 -184
  53. package/dist/workbench-themes.css +3 -0
  54. package/package.json +1 -1
@@ -1,131 +1,137 @@
1
- import { insert as l, createComponent as c, effect as y, className as k, memo as _, spread as B, mergeProps as L, setAttribute as h, template as C, Portal as ae, setStyleProperty as re, use as ne, delegateEvents as se } from "solid-js/web";
2
- import { splitProps as N, createUniqueId as E, Show as w, createSignal as ie, createEffect as de, onCleanup as ue, For as fe } from "solid-js";
3
- import { cn as I } from "../../utils/cn.js";
4
- import { Minus as ce, Plus as ve, ChevronDown as he } from "../icons/index.js";
5
- var ge = /* @__PURE__ */ C('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-[var(--floe-ink-quiet)] pointer-events-none">'), xe = /* @__PURE__ */ C('<div class="absolute right-2.5 top-1/2 -translate-y-1/2 text-[var(--floe-ink-quiet)] pointer-events-none">'), M = /* @__PURE__ */ C('<p class="mt-1 text-caption text-error"role=alert>'), R = /* @__PURE__ */ C('<p class="mt-1 text-[length:var(--floe-type-caption)] leading-[var(--floe-line-caption)] text-[var(--floe-ink-soft)]">'), be = /* @__PURE__ */ C("<div class=relative><input data-floe-control=input data-floe-surface=inset>"), me = /* @__PURE__ */ C("<div><textarea data-floe-control=input data-floe-surface=inset>"), pe = /* @__PURE__ */ C('<div><div data-floe-input-surface data-floe-control=compound-input data-floe-surface=inset><button type=button aria-label="Decrease value"></button><input type=number><button type=button aria-label="Increase value">'), we = /* @__PURE__ */ C("<div><div data-floe-input-surface data-floe-control=compound-input data-floe-surface=inset><input>"), oe = /* @__PURE__ */ C("<span>"), ye = /* @__PURE__ */ C("<button type=button><span>"), Ie = /* @__PURE__ */ C("<div role=listbox>"), $e = /* @__PURE__ */ C("<button type=button data-floe-interactive=item role=option>");
6
- const ke = {
7
- sm: "h-7 text-xs px-2",
8
- md: "h-8 text-[length:var(--floe-type-control)] px-2.5",
9
- lg: "h-9 text-sm px-3"
1
+ import { insert as o, createComponent as h, effect as y, className as S, memo as T, spread as F, mergeProps as L, setAttribute as m, template as _, Portal as le, setStyleProperty as ee, use as te, delegateEvents as oe } from "solid-js/web";
2
+ import { splitProps as N, createUniqueId as M, Show as p, createSignal as re, createEffect as ae, onCleanup as de, For as se } from "solid-js";
3
+ import { cn as O } from "../../utils/cn.js";
4
+ import { useFloeLocale as ue } from "../../context/LocaleContext.js";
5
+ import { useFormControl as R, joinAriaIds as j } from "./formFieldContext.js";
6
+ import { Minus as ce, Plus as fe, ChevronDown as he } from "../icons/index.js";
7
+ var ve = /* @__PURE__ */ _('<div class="absolute start-2.5 top-1/2 -translate-y-1/2 text-[var(--floe-ink-quiet)] pointer-events-none">'), ge = /* @__PURE__ */ _('<div class="absolute end-2.5 top-1/2 -translate-y-1/2 text-[var(--floe-ink-quiet)] pointer-events-none">'), q = /* @__PURE__ */ _('<p class="mt-1 text-caption text-error"role=alert>'), A = /* @__PURE__ */ _('<p class="mt-1 text-[length:var(--floe-type-caption)] leading-[var(--floe-line-caption)] text-[var(--floe-ink-soft)]">'), xe = /* @__PURE__ */ _("<div class=relative><input>"), be = /* @__PURE__ */ _("<div><textarea>"), me = /* @__PURE__ */ _("<div><div data-floe-input-surface data-floe-control=compound-input data-floe-surface=inset><button type=button></button><input><button type=button>"), pe = /* @__PURE__ */ _("<div><div data-floe-input-surface data-floe-control=compound-input data-floe-surface=inset><input>"), ne = /* @__PURE__ */ _("<span>"), ye = /* @__PURE__ */ _("<button type=button><span>"), we = /* @__PURE__ */ _("<div role=listbox>"), Ie = /* @__PURE__ */ _("<button type=button data-floe-interactive=item role=option>");
8
+ const $e = {
9
+ sm: "h-[var(--floe-control-height-sm)] text-xs px-2",
10
+ md: "h-[var(--floe-control-height-md)] text-[length:var(--floe-type-control)] px-2.5",
11
+ lg: "h-[var(--floe-control-height-lg)] text-sm px-3"
10
12
  };
11
- function Te(r) {
12
- const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), z = E(), m = () => e.id ?? z, v = () => `${m()}-error`, x = () => `${m()}-helper`, $ = () => {
13
- const o = [];
14
- return e.error && o.push(v()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
13
+ function Te(t) {
14
+ const e = R(), [r, b] = N(t, ["size", "error", "helperText", "aria-describedby", "leftIcon", "rightIcon", "class", "id"]), z = M(), v = () => r.id ?? e.id ?? z, x = () => `${v()}-error`, I = () => `${v()}-helper`, w = () => {
15
+ const s = [];
16
+ return r.error && s.push(x()), r.helperText && !r.error && s.push(I()), s.length > 0 ? s.join(" ") : void 0;
15
17
  };
16
18
  return (() => {
17
- var o = be(), g = o.firstChild;
18
- return l(o, c(w, {
19
+ var s = xe(), c = s.firstChild;
20
+ return o(s, h(p, {
19
21
  get when() {
20
- return e.leftIcon;
22
+ return r.leftIcon;
21
23
  },
22
24
  get children() {
23
- var s = ge();
24
- return l(s, () => e.leftIcon), s;
25
+ var a = ve();
26
+ return o(a, () => r.leftIcon), a;
25
27
  }
26
- }), g), B(g, L({
28
+ }), c), F(c, L(e, {
27
29
  get id() {
28
- return m();
30
+ return v();
29
31
  },
32
+ "data-floe-control": "input",
33
+ "data-floe-surface": "inset",
30
34
  get "aria-invalid"() {
31
- return e.error ? !0 : void 0;
35
+ return T(() => !!r.error)() ? !0 : e["aria-invalid"];
32
36
  },
33
37
  get "aria-describedby"() {
34
- return $();
38
+ return j(e["aria-describedby"], r["aria-describedby"], w());
35
39
  },
36
40
  get class() {
37
- return I(
41
+ return O(
38
42
  "floe-field w-full",
39
43
  "focus:outline-none",
40
44
  "disabled:cursor-not-allowed disabled:opacity-60",
41
- ke[e.size ?? "md"],
45
+ $e[r.size ?? "md"],
42
46
  // Icon padding must come AFTER sizeStyles to override px-*
43
- e.leftIcon && "pl-10",
44
- e.rightIcon && "pr-10",
45
- e.class
47
+ r.leftIcon && "ps-10",
48
+ r.rightIcon && "pe-10",
49
+ r.class
46
50
  );
47
51
  }
48
- }, b), !1, !1), l(o, c(w, {
52
+ }, b), !1, !1), o(s, h(p, {
49
53
  get when() {
50
- return e.rightIcon;
54
+ return r.rightIcon;
51
55
  },
52
56
  get children() {
53
- var s = xe();
54
- return l(s, () => e.rightIcon), s;
57
+ var a = ge();
58
+ return o(a, () => r.rightIcon), a;
55
59
  }
56
- }), null), l(o, c(w, {
60
+ }), null), o(s, h(p, {
57
61
  get when() {
58
- return e.error;
62
+ return r.error;
59
63
  },
60
64
  get children() {
61
- var s = M();
62
- return l(s, () => e.error), y(() => h(s, "id", v())), s;
65
+ var a = q();
66
+ return o(a, () => r.error), y(() => m(a, "id", x())), a;
63
67
  }
64
- }), null), l(o, c(w, {
68
+ }), null), o(s, h(p, {
65
69
  get when() {
66
- return _(() => !!e.helperText)() && !e.error;
70
+ return T(() => !!r.helperText)() && !r.error;
67
71
  },
68
72
  get children() {
69
- var s = R();
70
- return l(s, () => e.helperText), y(() => h(s, "id", x())), s;
73
+ var a = A();
74
+ return o(a, () => r.helperText), y(() => m(a, "id", I())), a;
71
75
  }
72
- }), null), o;
76
+ }), null), s;
73
77
  })();
74
78
  }
75
- function _e(r) {
76
- const [e, b] = N(r, ["error", "helperText", "class", "id"]), z = E(), m = () => e.id ?? z, v = () => `${m()}-error`, x = () => `${m()}-helper`, $ = () => {
77
- const o = [];
78
- return e.error && o.push(v()), e.helperText && !e.error && o.push(x()), o.length > 0 ? o.join(" ") : void 0;
79
+ function Pe(t) {
80
+ const e = R(), [r, b] = N(t, ["error", "helperText", "aria-describedby", "class", "id"]), z = M(), v = () => r.id ?? e.id ?? z, x = () => `${v()}-error`, I = () => `${v()}-helper`, w = () => {
81
+ const s = [];
82
+ return r.error && s.push(x()), r.helperText && !r.error && s.push(I()), s.length > 0 ? s.join(" ") : void 0;
79
83
  };
80
84
  return (() => {
81
- var o = me(), g = o.firstChild;
82
- return B(g, L({
85
+ var s = be(), c = s.firstChild;
86
+ return F(c, L(e, {
87
+ "data-floe-control": "input",
83
88
  get id() {
84
- return m();
89
+ return v();
85
90
  },
91
+ "data-floe-surface": "inset",
86
92
  get "aria-invalid"() {
87
- return e.error ? !0 : void 0;
93
+ return T(() => !!r.error)() ? !0 : e["aria-invalid"];
88
94
  },
89
95
  get "aria-describedby"() {
90
- return $();
96
+ return j(e["aria-describedby"], r["aria-describedby"], w());
91
97
  },
92
98
  get class() {
93
- return I("floe-field w-full min-h-16 p-2.5 text-[length:var(--floe-type-control)]", "focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-60", "resize-y", e.class);
99
+ return O("floe-field w-full min-h-16 p-2.5 text-[length:var(--floe-type-control)]", "focus:outline-none", "disabled:cursor-not-allowed disabled:opacity-60", "resize-y", r.class);
94
100
  }
95
- }, b), !1, !1), l(o, c(w, {
101
+ }, b), !1, !1), o(s, h(p, {
96
102
  get when() {
97
- return e.error;
103
+ return r.error;
98
104
  },
99
105
  get children() {
100
- var s = M();
101
- return l(s, () => e.error), y(() => h(s, "id", v())), s;
106
+ var a = q();
107
+ return o(a, () => r.error), y(() => m(a, "id", x())), a;
102
108
  }
103
- }), null), l(o, c(w, {
109
+ }), null), o(s, h(p, {
104
110
  get when() {
105
- return _(() => !!e.helperText)() && !e.error;
111
+ return T(() => !!r.helperText)() && !r.error;
106
112
  },
107
113
  get children() {
108
- var s = R();
109
- return l(s, () => e.helperText), y(() => h(s, "id", x())), s;
114
+ var a = A();
115
+ return o(a, () => r.helperText), y(() => m(a, "id", I())), a;
110
116
  }
111
- }), null), o;
117
+ }), null), s;
112
118
  })();
113
119
  }
114
- function Pe(r) {
115
- const e = E(), b = `${e}-error`, z = `${e}-helper`, m = () => r.step ?? 1, v = () => r.min ?? -1 / 0, x = () => r.max ?? 1 / 0, $ = (t) => Math.min(x(), Math.max(v(), t)), o = () => !r.disabled && r.value > v(), g = () => !r.disabled && r.value < x(), s = () => {
116
- o() && r.onChange($(r.value - m()));
117
- }, T = () => {
118
- g() && r.onChange($(r.value + m()));
119
- }, P = (t) => {
120
- const d = parseFloat(t.currentTarget.value);
121
- isNaN(d) || r.onChange($(d));
122
- }, i = (t) => {
123
- const d = parseFloat(t.currentTarget.value);
124
- isNaN(d) ? r.onChange(v() === -1 / 0 ? 0 : v()) : r.onChange($(d));
125
- }, u = () => {
126
- const t = [];
127
- return r.error && t.push(b), r.helperText && !r.error && t.push(z), t.length > 0 ? t.join(" ") : void 0;
128
- }, f = {
120
+ function De(t) {
121
+ const e = R(), r = ue(), b = M(), z = () => t.id ?? e.id ?? b, v = () => z() + "-error", x = () => z() + "-helper", I = () => t.step ?? 1, w = () => t.min ?? -1 / 0, s = () => t.max ?? 1 / 0, c = (g) => Math.min(s(), Math.max(w(), g)), a = () => !(t.disabled ?? e.disabled) && !(t.readOnly ?? e.readOnly) && t.value > w(), D = () => !(t.disabled ?? e.disabled) && !(t.readOnly ?? e.readOnly) && t.value < s(), l = () => {
122
+ a() && t.onChange(c(t.value - I()));
123
+ }, $ = () => {
124
+ D() && t.onChange(c(t.value + I()));
125
+ }, i = (g) => {
126
+ const C = parseFloat(g.currentTarget.value);
127
+ isNaN(C) || t.onChange(c(C));
128
+ }, u = (g) => {
129
+ const C = parseFloat(g.currentTarget.value);
130
+ isNaN(C) ? t.onChange(w() === -1 / 0 ? 0 : w()) : t.onChange(c(C));
131
+ }, f = () => {
132
+ const g = [];
133
+ return t.error && g.push(v()), t.helperText && !t.error && g.push(x()), g.length > 0 ? g.join(" ") : void 0;
134
+ }, n = {
129
135
  sm: {
130
136
  height: "h-7",
131
137
  btnSize: "w-7",
@@ -141,36 +147,82 @@ function Pe(r) {
141
147
  btnSize: "w-9",
142
148
  iconSize: "w-4 h-4"
143
149
  }
144
- }, a = () => f[r.size ?? "md"];
150
+ }, k = () => n[t.size ?? "md"];
145
151
  return (() => {
146
- var t = pe(), d = t.firstChild, S = d.firstChild, p = S.nextSibling, O = p.nextSibling;
147
- return S.$$click = s, l(S, c(ce, {
152
+ var g = me(), C = g.firstChild, P = C.firstChild, V = P.nextSibling, B = V.nextSibling;
153
+ return P.$$click = l, o(P, h(ce, {
154
+ get class() {
155
+ return k().iconSize;
156
+ }
157
+ })), F(V, L(e, {
158
+ get name() {
159
+ return t.name ?? e.name;
160
+ },
161
+ get required() {
162
+ return t.required ?? e.required;
163
+ },
164
+ get "aria-label"() {
165
+ return t.ariaLabel;
166
+ },
167
+ get id() {
168
+ return z();
169
+ },
170
+ type: "number",
171
+ get value() {
172
+ return t.value;
173
+ },
174
+ onInput: i,
175
+ onBlur: u,
176
+ get min() {
177
+ return t.min;
178
+ },
179
+ get max() {
180
+ return t.max;
181
+ },
182
+ get step() {
183
+ return t.step;
184
+ },
185
+ get disabled() {
186
+ return t.disabled ?? e.disabled;
187
+ },
188
+ get readOnly() {
189
+ return t.inputDisabled || (t.readOnly ?? e.readOnly);
190
+ },
191
+ get placeholder() {
192
+ return t.placeholder;
193
+ },
194
+ get "aria-invalid"() {
195
+ return T(() => !!t.error)() ? !0 : e["aria-invalid"];
196
+ },
197
+ get "aria-describedby"() {
198
+ return j(e["aria-describedby"], t.ariaDescribedBy, f());
199
+ },
148
200
  get class() {
149
- return a().iconSize;
201
+ return O("w-16 text-center text-[length:var(--floe-type-control)] 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");
150
202
  }
151
- })), p.addEventListener("blur", i), p.$$input = P, h(p, "id", e), O.$$click = T, l(O, c(ve, {
203
+ }), !1, !1), B.$$click = $, o(B, h(fe, {
152
204
  get class() {
153
- return a().iconSize;
205
+ return k().iconSize;
154
206
  }
155
- })), l(t, c(w, {
207
+ })), o(g, h(p, {
156
208
  get when() {
157
- return r.error;
209
+ return t.error;
158
210
  },
159
211
  get children() {
160
- var n = M();
161
- return h(n, "id", b), l(n, () => r.error), n;
212
+ var d = q();
213
+ return o(d, () => t.error), y(() => m(d, "id", v())), d;
162
214
  }
163
- }), null), l(t, c(w, {
215
+ }), null), o(g, h(p, {
164
216
  get when() {
165
- return _(() => !!r.helperText)() && !r.error;
217
+ return T(() => !!t.helperText)() && !t.error;
166
218
  },
167
219
  get children() {
168
- var n = R();
169
- return h(n, "id", z), l(n, () => r.helperText), n;
220
+ var d = A();
221
+ return o(d, () => t.helperText), y(() => m(d, "id", x())), d;
170
222
  }
171
- }), null), y((n) => {
172
- var V = r.class, j = r.error ? !0 : void 0, A = r.disabled ? !0 : void 0, F = I("floe-field inline-flex items-center", r.disabled && "cursor-not-allowed", a().height), q = !o(), W = I("flex items-center justify-center border-r border-[var(--floe-line)] cursor-pointer", "text-[var(--floe-ink-soft)] transition-colors", "hover:bg-[var(--floe-state-hover)] hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[var(--floe-ink-soft)]", a().btnSize, a().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 = u(), Z = I("w-16 text-center text-[length:var(--floe-type-control)] 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 = !g(), te = I("flex items-center justify-center border-l border-[var(--floe-line)] cursor-pointer", "text-[var(--floe-ink-soft)] transition-colors", "hover:bg-[var(--floe-state-hover)] hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[var(--floe-ink-soft)]", a().btnSize, a().height);
173
- return V !== n.e && k(t, n.e = V), j !== n.t && h(d, "aria-invalid", n.t = j), A !== n.a && h(d, "aria-disabled", n.a = A), F !== n.o && k(d, n.o = F), q !== n.i && (S.disabled = n.i = q), W !== n.n && k(S, n.n = W), H !== n.s && h(p, "min", n.s = H), G !== n.h && h(p, "max", n.h = G), U !== n.r && h(p, "step", n.r = U), X !== n.d && (p.disabled = n.d = X), J !== n.l && (p.readOnly = n.l = J), K !== n.u && h(p, "placeholder", n.u = K), Q !== n.c && h(p, "aria-invalid", n.c = Q), Y !== n.w && h(p, "aria-describedby", n.w = Y), Z !== n.m && k(p, n.m = Z), ee !== n.f && (O.disabled = n.f = ee), te !== n.y && k(O, n.y = te), n;
223
+ }), null), y((d) => {
224
+ var W = t.class, H = t.error ? !0 : e["aria-invalid"], G = t.disabled ? !0 : void 0, U = O("floe-field inline-flex items-center", t.disabled && "cursor-not-allowed", k().height), X = !a(), J = O("flex items-center justify-center border-r border-[var(--floe-line)] cursor-pointer", "text-[var(--floe-ink-soft)] transition-colors", "hover:bg-[var(--floe-state-hover)] hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[var(--floe-ink-soft)]", k().btnSize, k().height), K = r.t("decrease"), Q = !D(), Y = O("flex items-center justify-center border-l border-[var(--floe-line)] cursor-pointer", "text-[var(--floe-ink-soft)] transition-colors", "hover:bg-[var(--floe-state-hover)] hover:text-foreground", "focus:outline-none", "disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-[var(--floe-ink-soft)]", k().btnSize, k().height), Z = r.t("increase");
225
+ return W !== d.e && S(g, d.e = W), H !== d.t && m(C, "aria-invalid", d.t = H), G !== d.a && m(C, "aria-disabled", d.a = G), U !== d.o && S(C, d.o = U), X !== d.i && (P.disabled = d.i = X), J !== d.n && S(P, d.n = J), K !== d.s && m(P, "aria-label", d.s = K), Q !== d.h && (B.disabled = d.h = Q), Y !== d.r && S(B, d.r = Y), Z !== d.d && m(B, "aria-label", d.d = Z), d;
174
226
  }, {
175
227
  e: void 0,
176
228
  t: void 0,
@@ -181,23 +233,16 @@ function Pe(r) {
181
233
  s: void 0,
182
234
  h: void 0,
183
235
  r: void 0,
184
- d: void 0,
185
- l: void 0,
186
- u: void 0,
187
- c: void 0,
188
- w: void 0,
189
- m: void 0,
190
- f: void 0,
191
- y: void 0
192
- }), y(() => p.value = r.value), t;
236
+ d: void 0
237
+ }), g;
193
238
  })();
194
239
  }
195
- const D = 8;
196
- function De(r) {
197
- const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), z = E(), m = () => e.id ?? z, v = () => `${m()}-error`, x = () => `${m()}-helper`, $ = () => {
198
- const u = [];
199
- return e.error && u.push(v()), e.helperText && !e.error && u.push(x()), u.length > 0 ? u.join(" ") : void 0;
200
- }, o = {
240
+ const E = 8;
241
+ function Be(t) {
242
+ const [e, r] = N(t, ["size", "error", "helperText", "aria-describedby", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), b = R(), z = M(), v = () => e.id ?? b.id ?? z, x = () => `${v()}-error`, I = () => `${v()}-helper`, w = () => {
243
+ const i = [];
244
+ return e.error && i.push(x()), e.helperText && !e.error && i.push(I()), i.length > 0 ? i.join(" ") : void 0;
245
+ }, s = {
201
246
  sm: {
202
247
  height: "h-7",
203
248
  text: "text-xs",
@@ -213,26 +258,26 @@ function De(r) {
213
258
  text: "text-sm",
214
259
  px: "px-3"
215
260
  }
216
- }, g = () => o[e.size ?? "md"], s = () => !!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((u) => u.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, i = () => e.suffix ? e.suffix : e.suffixOptions?.find((u) => u.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
261
+ }, c = () => s[e.size ?? "md"], a = () => !!e.prefix || e.prefixOptions && e.prefixOptions.length > 0, D = () => !!e.suffix || e.suffixOptions && e.suffixOptions.length > 0, l = () => e.prefix ? e.prefix : e.prefixOptions?.find((i) => i.value === e.prefixValue)?.label ?? e.prefixOptions?.[0]?.label, $ = () => e.suffix ? e.suffix : e.suffixOptions?.find((i) => i.value === e.suffixValue)?.label ?? e.suffixOptions?.[0]?.label;
217
262
  return (() => {
218
- var u = we(), f = u.firstChild, a = f.firstChild;
219
- return l(f, c(w, {
263
+ var i = pe(), u = i.firstChild, f = u.firstChild;
264
+ return o(u, h(p, {
220
265
  get when() {
221
- return s();
266
+ return a();
222
267
  },
223
268
  get children() {
224
- return c(w, {
269
+ return h(p, {
225
270
  get when() {
226
- return _(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
271
+ return T(() => !!e.prefixOptions)() && e.prefixOptions.length > 0;
227
272
  },
228
273
  get fallback() {
229
274
  return (() => {
230
- var t = oe();
231
- return l(t, () => e.prefix), y(() => k(t, I("flex items-center border-r border-[var(--floe-line)] bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", g().text, g().px, g().height))), t;
275
+ var n = ne();
276
+ return o(n, () => e.prefix), y(() => S(n, O("flex items-center border-r border-[var(--floe-line)] bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", c().text, c().px, c().height))), n;
232
277
  })();
233
278
  },
234
279
  get children() {
235
- return c(le, {
280
+ return h(ie, {
236
281
  get options() {
237
282
  return e.prefixOptions;
238
283
  },
@@ -243,49 +288,52 @@ function De(r) {
243
288
  return e.onPrefixChange;
244
289
  },
245
290
  get label() {
246
- return P();
291
+ return l();
247
292
  },
248
293
  get size() {
249
294
  return e.size;
250
295
  },
251
296
  position: "prefix",
252
297
  get disabled() {
253
- return b.disabled;
298
+ return r.disabled;
254
299
  }
255
300
  });
256
301
  }
257
302
  });
258
303
  }
259
- }), a), B(a, L({
304
+ }), f), F(f, L(b, {
305
+ get readOnly() {
306
+ return t.readOnly ?? b.readOnly;
307
+ },
260
308
  get id() {
261
- return m();
309
+ return v();
262
310
  },
263
311
  get "aria-invalid"() {
264
- return e.error ? !0 : void 0;
312
+ return T(() => !!e.error)() ? !0 : b["aria-invalid"];
265
313
  },
266
314
  get "aria-describedby"() {
267
- return $();
315
+ return j(b["aria-describedby"], e["aria-describedby"], w());
268
316
  },
269
317
  get class() {
270
- return I("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-[var(--floe-field-placeholder)]", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", g().text, g().px);
318
+ return O("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-[var(--floe-field-placeholder)]", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", c().text, c().px);
271
319
  }
272
- }, b), !1, !1), l(f, c(w, {
320
+ }, r), !1, !1), o(u, h(p, {
273
321
  get when() {
274
- return T();
322
+ return D();
275
323
  },
276
324
  get children() {
277
- return c(w, {
325
+ return h(p, {
278
326
  get when() {
279
- return _(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
327
+ return T(() => !!e.suffixOptions)() && e.suffixOptions.length > 0;
280
328
  },
281
329
  get fallback() {
282
330
  return (() => {
283
- var t = oe();
284
- return l(t, () => e.suffix), y(() => k(t, I("flex items-center border-l border-[var(--floe-line)] bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", g().text, g().px, g().height))), t;
331
+ var n = ne();
332
+ return o(n, () => e.suffix), y(() => S(n, O("flex items-center border-l border-[var(--floe-line)] bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", c().text, c().px, c().height))), n;
285
333
  })();
286
334
  },
287
335
  get children() {
288
- return c(le, {
336
+ return h(ie, {
289
337
  get options() {
290
338
  return e.suffixOptions;
291
339
  },
@@ -296,53 +344,53 @@ function De(r) {
296
344
  return e.onSuffixChange;
297
345
  },
298
346
  get label() {
299
- return i();
347
+ return $();
300
348
  },
301
349
  get size() {
302
350
  return e.size;
303
351
  },
304
352
  position: "suffix",
305
353
  get disabled() {
306
- return b.disabled;
354
+ return r.disabled;
307
355
  }
308
356
  });
309
357
  }
310
358
  });
311
359
  }
312
- }), null), l(u, c(w, {
360
+ }), null), o(i, h(p, {
313
361
  get when() {
314
362
  return e.error;
315
363
  },
316
364
  get children() {
317
- var t = M();
318
- return l(t, () => e.error), y(() => h(t, "id", v())), t;
365
+ var n = q();
366
+ return o(n, () => e.error), y(() => m(n, "id", x())), n;
319
367
  }
320
- }), null), l(u, c(w, {
368
+ }), null), o(i, h(p, {
321
369
  get when() {
322
- return _(() => !!e.helperText)() && !e.error;
370
+ return T(() => !!e.helperText)() && !e.error;
323
371
  },
324
372
  get children() {
325
- var t = R();
326
- return l(t, () => e.helperText), y(() => h(t, "id", x())), t;
373
+ var n = A();
374
+ return o(n, () => e.helperText), y(() => m(n, "id", I())), n;
327
375
  }
328
- }), null), y((t) => {
329
- var d = e.class, S = e.error ? !0 : void 0, p = b.disabled ? !0 : void 0, O = I("floe-field inline-flex items-center", b.disabled && "cursor-not-allowed", g().height);
330
- return d !== t.e && k(u, t.e = d), S !== t.t && h(f, "aria-invalid", t.t = S), p !== t.a && h(f, "aria-disabled", t.a = p), O !== t.o && k(f, t.o = O), t;
376
+ }), null), y((n) => {
377
+ var k = e.class, g = e.error ? !0 : b["aria-invalid"], C = r.disabled ? !0 : void 0, P = O("floe-field inline-flex items-center", r.disabled && "cursor-not-allowed", c().height);
378
+ return k !== n.e && S(i, n.e = k), g !== n.t && m(u, "aria-invalid", n.t = g), C !== n.a && m(u, "aria-disabled", n.a = C), P !== n.o && S(u, n.o = P), n;
331
379
  }, {
332
380
  e: void 0,
333
381
  t: void 0,
334
382
  a: void 0,
335
383
  o: void 0
336
- }), u;
384
+ }), i;
337
385
  })();
338
386
  }
339
- function le(r) {
340
- const [e, b] = ie(!1), [z, m] = ie({
387
+ function ie(t) {
388
+ const [e, r] = re(!1), [b, z] = re({
341
389
  x: -9999,
342
390
  y: -9999
343
391
  });
344
392
  let v, x;
345
- const $ = {
393
+ const I = {
346
394
  sm: {
347
395
  height: "h-7",
348
396
  text: "text-xs",
@@ -358,86 +406,86 @@ function le(r) {
358
406
  text: "text-sm",
359
407
  px: "px-3"
360
408
  }
361
- }, o = () => $[r.size ?? "md"], g = () => {
409
+ }, w = () => I[t.size ?? "md"], s = () => {
362
410
  if (!v || !x) return;
363
- const i = v.getBoundingClientRect(), u = x.getBoundingClientRect(), f = window.innerWidth, a = window.innerHeight;
364
- let t = i.left, d = i.bottom + 2;
365
- t + u.width > f - D && (t = i.right - u.width), t = Math.max(D, t), d + u.height > a - D && (d = i.top - u.height - 2), d = Math.max(D, d), m({
366
- x: t,
367
- y: d
411
+ const l = v.getBoundingClientRect(), $ = x.getBoundingClientRect(), i = window.innerWidth, u = window.innerHeight;
412
+ let f = l.left, n = l.bottom + 2;
413
+ f + $.width > i - E && (f = l.right - $.width), f = Math.max(E, f), n + $.height > u - E && (n = l.top - $.height - 2), n = Math.max(E, n), z({
414
+ x: f,
415
+ y: n
368
416
  });
369
- }, s = (i) => {
370
- v && !v.contains(i.target) && x && !x.contains(i.target) && b(!1);
371
- }, T = (i) => {
372
- i.key === "Escape" && b(!1);
373
- }, P = (i) => {
374
- r.onChange?.(i), b(!1);
417
+ }, c = (l) => {
418
+ v && !v.contains(l.target) && x && !x.contains(l.target) && r(!1);
419
+ }, a = (l) => {
420
+ l.key === "Escape" && r(!1);
421
+ }, D = (l) => {
422
+ t.onChange?.(l), r(!1);
375
423
  };
376
- return de(() => {
424
+ return ae(() => {
377
425
  if (!e()) {
378
- m({
426
+ z({
379
427
  x: -9999,
380
428
  y: -9999
381
429
  });
382
430
  return;
383
431
  }
384
- typeof document > "u" || (document.addEventListener("mousedown", s), document.addEventListener("keydown", T), requestAnimationFrame(g), ue(() => {
385
- document.removeEventListener("mousedown", s), document.removeEventListener("keydown", T);
432
+ typeof document > "u" || (document.addEventListener("mousedown", c), document.addEventListener("keydown", a), requestAnimationFrame(s), de(() => {
433
+ document.removeEventListener("mousedown", c), document.removeEventListener("keydown", a);
386
434
  }));
387
435
  }), [(() => {
388
- var i = ye(), u = i.firstChild;
389
- i.$$click = () => {
390
- b((a) => !a);
436
+ var l = ye(), $ = l.firstChild;
437
+ l.$$click = () => {
438
+ r((u) => !u);
391
439
  };
392
- var f = v;
393
- return typeof f == "function" ? ne(f, i) : v = i, l(u, () => r.label), l(i, c(he, {
440
+ var i = v;
441
+ return typeof i == "function" ? te(i, l) : v = l, o($, () => t.label), o(l, h(he, {
394
442
  class: "w-3 h-3 opacity-60"
395
- }), null), y((a) => {
396
- var t = r.disabled, d = I("flex items-center gap-1 cursor-pointer", "bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", "hover:bg-[var(--floe-state-press)] hover:text-foreground", "transition-[background-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "focus:outline-none", "disabled:cursor-not-allowed disabled:bg-[var(--floe-state-hover)] disabled:hover:text-[var(--floe-ink-soft)]", r.position === "prefix" ? "border-r border-[var(--floe-line)]" : "border-l border-[var(--floe-line)]", o().text, o().px, o().height);
397
- return t !== a.e && (i.disabled = a.e = t), d !== a.t && k(i, a.t = d), a;
443
+ }), null), y((u) => {
444
+ var f = t.disabled, n = O("flex items-center gap-1 cursor-pointer", "bg-[var(--floe-state-hover)] text-[var(--floe-ink-soft)]", "hover:bg-[var(--floe-state-press)] hover:text-foreground", "transition-[background-color,color] duration-[var(--floe-duration-fast)] ease-[var(--floe-ease-out)]", "focus:outline-none", "disabled:cursor-not-allowed disabled:bg-[var(--floe-state-hover)] disabled:hover:text-[var(--floe-ink-soft)]", t.position === "prefix" ? "border-r border-[var(--floe-line)]" : "border-l border-[var(--floe-line)]", w().text, w().px, w().height);
445
+ return f !== u.e && (l.disabled = u.e = f), n !== u.t && S(l, u.t = n), u;
398
446
  }, {
399
447
  e: void 0,
400
448
  t: void 0
401
- }), i;
402
- })(), c(w, {
449
+ }), l;
450
+ })(), h(p, {
403
451
  get when() {
404
452
  return e();
405
453
  },
406
454
  get children() {
407
- return c(ae, {
455
+ return h(le, {
408
456
  get children() {
409
- var i = Ie(), u = x;
410
- return typeof u == "function" ? ne(u, i) : x = i, l(i, c(fe, {
457
+ var l = we(), $ = x;
458
+ return typeof $ == "function" ? te($, l) : x = l, o(l, h(se, {
411
459
  get each() {
412
- return r.options;
460
+ return t.options;
413
461
  },
414
- children: (f) => (() => {
415
- var a = $e();
416
- return a.$$click = () => P(f.value), l(a, () => f.label), y((t) => {
417
- var d = I("w-full flex items-center px-2.5 cursor-pointer", "min-h-[var(--floe-row-height)] rounded-sm", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]", "text-[var(--floe-ink-soft)] hover:text-foreground", "focus:outline-none", r.value === f.value && "bg-[var(--floe-state-selected)] text-foreground font-medium"), S = r.value === f.value;
418
- return d !== t.e && k(a, t.e = d), S !== t.t && h(a, "aria-selected", t.t = S), t;
462
+ children: (i) => (() => {
463
+ var u = Ie();
464
+ return u.$$click = () => D(i.value), o(u, () => i.label), y((f) => {
465
+ var n = O("w-full flex items-center px-2.5 cursor-pointer", "min-h-[var(--floe-row-height)] rounded-sm", "text-[length:var(--floe-type-control)] leading-[var(--floe-line-control)]", "text-[var(--floe-ink-soft)] hover:text-foreground", "focus:outline-none", t.value === i.value && "bg-[var(--floe-state-selected)] text-foreground font-medium"), k = t.value === i.value;
466
+ return n !== f.e && S(u, f.e = n), k !== f.t && m(u, "aria-selected", f.t = k), f;
419
467
  }, {
420
468
  e: void 0,
421
469
  t: void 0
422
- }), a;
470
+ }), u;
423
471
  })()
424
- })), y((f) => {
425
- var a = I("fixed z-50 min-w-24 py-0.5", "bg-popover text-popover-foreground", "rounded-group border border-[var(--floe-line)]", "shadow-[var(--floe-elevation-float)]", "floe-floating-presence floe-floating-menu"), t = `${z().x}px`, d = `${z().y}px`;
426
- return a !== f.e && k(i, f.e = a), t !== f.t && re(i, "left", f.t = t), d !== f.a && re(i, "top", f.a = d), f;
472
+ })), y((i) => {
473
+ var u = O("fixed z-50 min-w-24 py-0.5", "bg-popover text-popover-foreground", "rounded-group border border-[var(--floe-line)]", "shadow-[var(--floe-elevation-float)]", "floe-floating-presence floe-floating-menu"), f = `${b().x}px`, n = `${b().y}px`;
474
+ return u !== i.e && S(l, i.e = u), f !== i.t && ee(l, "left", i.t = f), n !== i.a && ee(l, "top", i.a = n), i;
427
475
  }, {
428
476
  e: void 0,
429
477
  t: void 0,
430
478
  a: void 0
431
- }), i;
479
+ }), l;
432
480
  }
433
481
  });
434
482
  }
435
483
  })];
436
484
  }
437
- se(["click", "input"]);
485
+ oe(["click"]);
438
486
  export {
439
- De as AffixInput,
487
+ Be as AffixInput,
440
488
  Te as Input,
441
- Pe as NumberInput,
442
- _e as Textarea
489
+ De as NumberInput,
490
+ Pe as Textarea
443
491
  };