@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.
- package/dist/chat.css +0 -6
- package/dist/components/chat/input/ChatInput.js +50 -49
- package/dist/components/file-browser/FileBrowserToolbar.js +2 -2
- package/dist/components/ui/CommandPalette.js +1 -1
- package/dist/components/ui/DirectoryInput.js +31 -30
- package/dist/components/ui/Input.js +133 -129
- package/dist/components/ui/Pagination.js +2 -2
- package/dist/floe.css +43 -1
- package/dist/styles.css +1 -1
- package/dist/workbench.css +0 -4
- package/package.json +1 -1
|
@@ -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
|
|
2
|
-
import { splitProps as N, createUniqueId as E, Show as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Minus as
|
|
5
|
-
var
|
|
6
|
-
const
|
|
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
|
|
12
|
-
const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(),
|
|
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(
|
|
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 =
|
|
18
|
-
return l(o, f(
|
|
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
|
|
24
|
-
return l(
|
|
23
|
+
var a = xe();
|
|
24
|
+
return l(a, () => e.leftIcon), a;
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
26
|
+
}), x), B(x, L({
|
|
27
27
|
get id() {
|
|
28
|
-
return
|
|
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
|
|
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
|
|
41
|
+
"focus:outline-none",
|
|
42
42
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
43
|
-
e.error && "border-error
|
|
44
|
-
|
|
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(
|
|
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
|
|
57
|
-
return l(
|
|
56
|
+
var a = ve();
|
|
57
|
+
return l(a, () => e.rightIcon), a;
|
|
58
58
|
}
|
|
59
|
-
}), null), l(o, f(
|
|
59
|
+
}), null), l(o, f(w, {
|
|
60
60
|
get when() {
|
|
61
61
|
return e.error;
|
|
62
62
|
},
|
|
63
63
|
get children() {
|
|
64
|
-
var
|
|
65
|
-
return l(
|
|
64
|
+
var a = M();
|
|
65
|
+
return l(a, () => e.error), y(() => g(a, "id", h())), a;
|
|
66
66
|
}
|
|
67
|
-
}), null), l(o, f(
|
|
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
|
|
73
|
-
return l(
|
|
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
|
|
79
|
-
const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(),
|
|
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(
|
|
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 =
|
|
85
|
-
return B(
|
|
84
|
+
var o = me(), x = o.firstChild;
|
|
85
|
+
return B(x, L({
|
|
86
86
|
get id() {
|
|
87
|
-
return
|
|
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
|
|
93
|
+
return $();
|
|
94
94
|
},
|
|
95
95
|
get class() {
|
|
96
|
-
return
|
|
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(
|
|
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
|
|
104
|
-
return l(
|
|
103
|
+
var a = M();
|
|
104
|
+
return l(a, () => e.error), y(() => g(a, "id", h())), a;
|
|
105
105
|
}
|
|
106
|
-
}), null), l(o, f(
|
|
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
|
|
112
|
-
return l(
|
|
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
|
|
118
|
-
const e = E(), b = `${e}-error`, S = `${e}-helper`,
|
|
119
|
-
o() && r.onChange(
|
|
120
|
-
},
|
|
121
|
-
|
|
122
|
-
},
|
|
123
|
-
const
|
|
124
|
-
isNaN(
|
|
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
|
|
127
|
-
isNaN(
|
|
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 =
|
|
150
|
-
return k.$$click =
|
|
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
|
-
})),
|
|
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(
|
|
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
|
|
164
|
+
return g(n, "id", b), l(n, () => r.error), n;
|
|
165
165
|
}
|
|
166
|
-
}), null), l(t, f(
|
|
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
|
|
172
|
+
return g(n, "id", S), l(n, () => r.helperText), n;
|
|
173
173
|
}
|
|
174
174
|
}), null), y((n) => {
|
|
175
|
-
var V = r.class, j =
|
|
176
|
-
return V !== n.e && C(t, n.e = V), j !== n.t &&
|
|
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
|
-
|
|
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
|
|
198
|
-
const [e, b] = N(r, ["size", "error", "helperText", "prefix", "suffix", "prefixOptions", "prefixValue", "onPrefixChange", "suffixOptions", "suffixValue", "onSuffixChange", "class", "id"]), S = E(),
|
|
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(
|
|
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
|
-
},
|
|
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 =
|
|
220
|
-
return l(c, f(
|
|
221
|
+
var s = we(), c = s.firstChild, d = c.firstChild;
|
|
222
|
+
return l(c, f(w, {
|
|
221
223
|
get when() {
|
|
222
|
-
return
|
|
224
|
+
return a();
|
|
223
225
|
},
|
|
224
226
|
get children() {
|
|
225
|
-
return f(
|
|
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 =
|
|
232
|
-
return l(t, () => e.prefix), y(() => C(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(
|
|
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
|
|
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
|
|
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
|
|
270
|
+
return $();
|
|
269
271
|
},
|
|
270
272
|
get class() {
|
|
271
|
-
return
|
|
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(
|
|
275
|
+
}, b), !1, !1), l(c, f(w, {
|
|
274
276
|
get when() {
|
|
275
|
-
return
|
|
277
|
+
return T();
|
|
276
278
|
},
|
|
277
279
|
get children() {
|
|
278
|
-
return f(
|
|
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 =
|
|
285
|
-
return l(t, () => e.suffix), y(() => C(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(
|
|
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(
|
|
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(() =>
|
|
321
|
+
return l(t, () => e.error), y(() => g(t, "id", h())), t;
|
|
320
322
|
}
|
|
321
|
-
}), null), l(s, f(
|
|
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(() =>
|
|
329
|
+
return l(t, () => e.helperText), y(() => g(t, "id", v())), t;
|
|
328
330
|
}
|
|
329
331
|
}), null), y((t) => {
|
|
330
|
-
var
|
|
331
|
-
return
|
|
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
|
|
339
|
-
const [e, b] =
|
|
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,
|
|
344
|
-
const
|
|
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 = () =>
|
|
361
|
-
if (!h || !
|
|
362
|
-
const i = h.getBoundingClientRect(), s =
|
|
363
|
-
let t = i.left,
|
|
364
|
-
t + s.width > c - D && (t = i.right - s.width), t = Math.max(D, t),
|
|
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:
|
|
370
|
+
y: u
|
|
367
371
|
});
|
|
368
|
-
},
|
|
369
|
-
h && !h.contains(i.target) &&
|
|
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
|
|
379
|
+
return ue(() => {
|
|
376
380
|
if (!e()) {
|
|
377
|
-
|
|
381
|
+
m({
|
|
378
382
|
x: -9999,
|
|
379
383
|
y: -9999
|
|
380
384
|
});
|
|
381
385
|
return;
|
|
382
386
|
}
|
|
383
|
-
typeof document > "u" || (document.addEventListener("mousedown",
|
|
384
|
-
document.removeEventListener("mousedown",
|
|
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 =
|
|
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" ?
|
|
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,
|
|
396
|
-
return t !== d.e && (i.disabled = d.e = t),
|
|
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(
|
|
405
|
+
})(), f(w, {
|
|
402
406
|
get when() {
|
|
403
407
|
return e();
|
|
404
408
|
},
|
|
405
409
|
get children() {
|
|
406
|
-
return f(
|
|
410
|
+
return f(de, {
|
|
407
411
|
get children() {
|
|
408
|
-
var i =
|
|
409
|
-
return typeof s == "function" ?
|
|
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 =
|
|
415
|
-
return d.$$click = () =>
|
|
416
|
-
var
|
|
417
|
-
return
|
|
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 =
|
|
425
|
-
return d !== c.e && C(i, c.e = d), t !== c.t &&
|
|
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
|
-
|
|
440
|
+
ae(["click", "input"]);
|
|
437
441
|
export {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
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
|
|
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
|
|
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 {
|