@floegence/floe-webapp-core 0.77.3 → 0.78.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.
- package/dist/components/layout/MobileNavigationPanel.d.ts +20 -0
- package/dist/components/layout/MobileNavigationPanel.js +95 -0
- package/dist/components/layout/MobileTabBar.d.ts +2 -0
- package/dist/components/layout/MobileTabBar.js +95 -71
- package/dist/components/layout/Shell.d.ts +8 -0
- package/dist/components/layout/Shell.js +248 -213
- package/dist/components/layout/index.d.ts +1 -0
- package/dist/components/ui/Button.js +3 -3
- package/dist/components/ui/Dropdown.js +5 -5
- package/dist/components/ui/Input.js +36 -36
- package/dist/hooks/useOverlayMask.d.ts +2 -0
- package/dist/hooks/useOverlayMask.js +75 -70
- package/dist/primitives.css +22 -0
- package/dist/styles/tokens.d.ts +12 -0
- package/dist/styles/tokens.js +6 -0
- package/dist/styles.css +1 -1
- package/dist/ui.css +27 -25
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { Shell, type ShellProps, type ShellSlotClassNames } from './Shell';
|
|
2
|
+
export type { MobileNavigationPanelProps } from './MobileNavigationPanel';
|
|
2
3
|
export { ActivityBar, type ActivityBarItem, type ActivityBarProps } from './ActivityBar';
|
|
3
4
|
export type { BarItemContextMenuHandler, BarItemContextMenuRequest, BarItemContextMenuSource, } from './barItemContextMenu';
|
|
4
5
|
export { Sidebar, SidebarContent, SidebarItemList, SidebarSection, SidebarItem, type SidebarProps, type SidebarContentProps, type SidebarItemListProps, type SidebarSectionProps, type SidebarItemProps, } from './Sidebar';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { spread as d, mergeProps as c, insert as n, createComponent as t, memo as g, Dynamic as
|
|
1
|
+
import { spread as d, mergeProps as c, insert as n, createComponent as t, memo as g, Dynamic as l, template as u } from "solid-js/web";
|
|
2
2
|
import { splitProps as m, Show as b } from "solid-js";
|
|
3
3
|
import { cn as a } from "../../utils/cn.js";
|
|
4
4
|
import { Loader2 as p } from "../icons/index.js";
|
|
5
|
-
var h = /* @__PURE__ */
|
|
5
|
+
var h = /* @__PURE__ */ u("<button type=button data-floe-control=button data-floe-surface-part=action>");
|
|
6
6
|
const v = {
|
|
7
7
|
default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-primary/80",
|
|
8
8
|
primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-primary/80",
|
|
@@ -43,7 +43,7 @@ function k(i) {
|
|
|
43
43
|
return r.loading;
|
|
44
44
|
},
|
|
45
45
|
get fallback() {
|
|
46
|
-
return g(() => !!r.icon)() && t(
|
|
46
|
+
return g(() => !!r.icon)() && t(l, {
|
|
47
47
|
get component() {
|
|
48
48
|
return r.icon;
|
|
49
49
|
},
|
|
@@ -216,8 +216,8 @@ function $e(e) {
|
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
218
|
}), null), F((t) => {
|
|
219
|
-
var s = k("relative inline-block", e.class), u = k("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), x = e.disabled ? -1 : 0, a = c(), S = e.triggerAriaLabel, E = e.disabled ? "true" : void 0,
|
|
220
|
-
return s !== t.e && D(r, t.e = s), u !== t.t && D(n, t.t = u), x !== t.a && f(n, "tabindex", t.a = x), a !== t.o && f(n, "aria-expanded", t.o = a), S !== t.i && f(n, "aria-label", t.i = S), E !== t.n && f(n, "aria-disabled", t.n = E),
|
|
219
|
+
var s = k("relative inline-block", e.class), u = k("cursor-pointer", e.triggerClass, e.disabled && "pointer-events-none opacity-50"), x = e.disabled ? -1 : 0, a = c(), S = e.triggerAriaLabel, E = e.disabled ? "true" : void 0, p = e.triggerInputSurface ? "true" : void 0, L = e.triggerInputSurface ? "inset" : void 0;
|
|
220
|
+
return s !== t.e && D(r, t.e = s), u !== t.t && D(n, t.t = u), x !== t.a && f(n, "tabindex", t.a = x), a !== t.o && f(n, "aria-expanded", t.o = a), S !== t.i && f(n, "aria-label", t.i = S), E !== t.n && f(n, "aria-disabled", t.n = E), p !== t.s && f(n, "data-floe-input-surface", t.s = p), L !== t.h && f(n, "data-floe-surface", t.h = L), t;
|
|
221
221
|
}, {
|
|
222
222
|
e: void 0,
|
|
223
223
|
t: void 0,
|
|
@@ -328,8 +328,8 @@ function ee(e) {
|
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
330
|
}), null), F((a) => {
|
|
331
|
-
var S = k("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), E = e.item.disabled,
|
|
332
|
-
return S !== a.e && D(t, a.e = S), E !== a.t && (t.disabled = a.t = E),
|
|
331
|
+
var S = k("w-full flex items-center gap-1.5 px-2 py-1 text-xs", "transition-colors duration-75", "focus:outline-none focus:bg-accent", e.item.tone === "danger" && "text-destructive", e.item.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-accent cursor-pointer"), E = e.item.disabled, p = o() ? "menu" : void 0, L = o() ? c() : void 0, K = e.selected && !o() ? "true" : void 0, N = e.item.tone ?? "default";
|
|
332
|
+
return S !== a.e && D(t, a.e = S), E !== a.t && (t.disabled = a.t = E), p !== a.a && f(t, "aria-haspopup", a.a = p), L !== a.o && f(t, "aria-expanded", a.o = L), K !== a.i && f(t, "data-floe-selected", a.i = K), N !== a.n && f(t, "data-tone", a.n = N), a;
|
|
333
333
|
}, {
|
|
334
334
|
e: void 0,
|
|
335
335
|
t: void 0,
|
|
@@ -429,7 +429,7 @@ function Fe(e) {
|
|
|
429
429
|
return l($e, {
|
|
430
430
|
triggerInputSurface: !0,
|
|
431
431
|
get triggerClass() {
|
|
432
|
-
return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-
|
|
432
|
+
return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-[length:var(--floe-type-control)] shadow-sm", "transition-colors duration-100", e.class);
|
|
433
433
|
},
|
|
434
434
|
get trigger() {
|
|
435
435
|
return [(() => {
|
|
@@ -2,28 +2,28 @@ import { insert as l, createComponent as f, effect as y, className as C, memo as
|
|
|
2
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
3
|
import { cn as I } from "../../utils/cn.js";
|
|
4
4
|
import { Minus as fe, Plus as he, ChevronDown as ge } from "../icons/index.js";
|
|
5
|
-
var
|
|
5
|
+
var ve = /* @__PURE__ */ z('<div class="absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none">'), xe = /* @__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 data-floe-control=input data-floe-surface=inset>"), me = /* @__PURE__ */ z("<div><textarea data-floe-control=input data-floe-surface=inset>"), pe = /* @__PURE__ */ z('<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__ */ z("<div><div data-floe-input-surface data-floe-control=compound-input data-floe-surface=inset><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
6
|
const Ce = {
|
|
7
7
|
sm: "h-7 text-xs px-2",
|
|
8
|
-
md: "h-8 text-
|
|
8
|
+
md: "h-8 text-[length:var(--floe-type-control)] px-2.5",
|
|
9
9
|
lg: "h-9 text-sm px-3"
|
|
10
10
|
};
|
|
11
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`,
|
|
12
|
+
const [e, b] = N(r, ["size", "error", "helperText", "leftIcon", "rightIcon", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`, x = () => `${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(x()), o.length > 0 ? o.join(" ") : void 0;
|
|
15
15
|
};
|
|
16
16
|
return (() => {
|
|
17
|
-
var o = be(),
|
|
17
|
+
var o = be(), v = o.firstChild;
|
|
18
18
|
return l(o, f(w, {
|
|
19
19
|
get when() {
|
|
20
20
|
return e.leftIcon;
|
|
21
21
|
},
|
|
22
22
|
get children() {
|
|
23
|
-
var d =
|
|
23
|
+
var d = ve();
|
|
24
24
|
return l(d, () => e.leftIcon), d;
|
|
25
25
|
}
|
|
26
|
-
}),
|
|
26
|
+
}), v), B(v, L({
|
|
27
27
|
get id() {
|
|
28
28
|
return m();
|
|
29
29
|
},
|
|
@@ -53,7 +53,7 @@ function Te(r) {
|
|
|
53
53
|
return e.rightIcon;
|
|
54
54
|
},
|
|
55
55
|
get children() {
|
|
56
|
-
var d =
|
|
56
|
+
var d = xe();
|
|
57
57
|
return l(d, () => e.rightIcon), d;
|
|
58
58
|
}
|
|
59
59
|
}), null), l(o, f(w, {
|
|
@@ -70,19 +70,19 @@ function Te(r) {
|
|
|
70
70
|
},
|
|
71
71
|
get children() {
|
|
72
72
|
var d = R();
|
|
73
|
-
return l(d, () => e.helperText), y(() => g(d, "id",
|
|
73
|
+
return l(d, () => e.helperText), y(() => g(d, "id", x())), d;
|
|
74
74
|
}
|
|
75
75
|
}), null), o;
|
|
76
76
|
})();
|
|
77
77
|
}
|
|
78
78
|
function _e(r) {
|
|
79
|
-
const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`,
|
|
79
|
+
const [e, b] = N(r, ["error", "helperText", "class", "id"]), S = E(), m = () => e.id ?? S, h = () => `${m()}-error`, x = () => `${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(x()), o.length > 0 ? o.join(" ") : void 0;
|
|
82
82
|
};
|
|
83
83
|
return (() => {
|
|
84
|
-
var o = me(),
|
|
85
|
-
return B(
|
|
84
|
+
var o = me(), v = o.firstChild;
|
|
85
|
+
return B(v, L({
|
|
86
86
|
get id() {
|
|
87
87
|
return m();
|
|
88
88
|
},
|
|
@@ -93,7 +93,7 @@ function _e(r) {
|
|
|
93
93
|
return $();
|
|
94
94
|
},
|
|
95
95
|
get class() {
|
|
96
|
-
return I("w-full min-h-16 rounded border border-input bg-background p-2.5 text-
|
|
96
|
+
return I("w-full min-h-16 rounded border border-input bg-background p-2.5 text-[length:var(--floe-type-control)] shadow-sm", "placeholder:text-muted-foreground", "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
98
|
}, b), !1, !1), l(o, f(w, {
|
|
99
99
|
get when() {
|
|
@@ -109,16 +109,16 @@ function _e(r) {
|
|
|
109
109
|
},
|
|
110
110
|
get children() {
|
|
111
111
|
var d = R();
|
|
112
|
-
return l(d, () => e.helperText), y(() => g(d, "id",
|
|
112
|
+
return l(d, () => e.helperText), y(() => g(d, "id", x())), d;
|
|
113
113
|
}
|
|
114
114
|
}), null), o;
|
|
115
115
|
})();
|
|
116
116
|
}
|
|
117
117
|
function Pe(r) {
|
|
118
|
-
const e = E(), b = `${e}-error`, S = `${e}-helper`, m = () => r.step ?? 1, h = () => r.min ?? -1 / 0,
|
|
118
|
+
const e = E(), b = `${e}-error`, S = `${e}-helper`, m = () => r.step ?? 1, h = () => r.min ?? -1 / 0, x = () => r.max ?? 1 / 0, $ = (t) => Math.min(x(), Math.max(h(), t)), o = () => !r.disabled && r.value > h(), v = () => !r.disabled && r.value < x(), d = () => {
|
|
119
119
|
o() && r.onChange($(r.value - m()));
|
|
120
120
|
}, T = () => {
|
|
121
|
-
|
|
121
|
+
v() && r.onChange($(r.value + m()));
|
|
122
122
|
}, P = (t) => {
|
|
123
123
|
const u = parseFloat(t.currentTarget.value);
|
|
124
124
|
isNaN(u) || r.onChange($(u));
|
|
@@ -172,7 +172,7 @@ function Pe(r) {
|
|
|
172
172
|
return g(n, "id", S), l(n, () => r.helperText), n;
|
|
173
173
|
}
|
|
174
174
|
}), null), y((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", a().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", 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 = s(), Z = I("w-16 text-center text-
|
|
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", a().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", 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 = s(), 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 = !v(), 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", a().btnSize, a().height);
|
|
176
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,
|
|
@@ -197,9 +197,9 @@ function Pe(r) {
|
|
|
197
197
|
}
|
|
198
198
|
const D = 8;
|
|
199
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`,
|
|
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`, x = () => `${m()}-helper`, $ = () => {
|
|
201
201
|
const s = [];
|
|
202
|
-
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(x()), s.length > 0 ? s.join(" ") : void 0;
|
|
203
203
|
}, o = {
|
|
204
204
|
sm: {
|
|
205
205
|
height: "h-7",
|
|
@@ -208,7 +208,7 @@ function De(r) {
|
|
|
208
208
|
},
|
|
209
209
|
md: {
|
|
210
210
|
height: "h-8",
|
|
211
|
-
text: "text-
|
|
211
|
+
text: "text-[length:var(--floe-type-control)]",
|
|
212
212
|
px: "px-2.5"
|
|
213
213
|
},
|
|
214
214
|
lg: {
|
|
@@ -216,7 +216,7 @@ function De(r) {
|
|
|
216
216
|
text: "text-sm",
|
|
217
217
|
px: "px-3"
|
|
218
218
|
}
|
|
219
|
-
},
|
|
219
|
+
}, v = () => o[e.size ?? "md"], d = () => !!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;
|
|
220
220
|
return (() => {
|
|
221
221
|
var s = we(), c = s.firstChild, a = c.firstChild;
|
|
222
222
|
return l(c, f(w, {
|
|
@@ -231,7 +231,7 @@ function De(r) {
|
|
|
231
231
|
get fallback() {
|
|
232
232
|
return (() => {
|
|
233
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",
|
|
234
|
+
return l(t, () => e.prefix), y(() => C(t, I("flex items-center border-r border-input bg-muted/50 text-muted-foreground", v().text, v().px, v().height))), t;
|
|
235
235
|
})();
|
|
236
236
|
},
|
|
237
237
|
get children() {
|
|
@@ -270,7 +270,7 @@ function De(r) {
|
|
|
270
270
|
return $();
|
|
271
271
|
},
|
|
272
272
|
get class() {
|
|
273
|
-
return I("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed",
|
|
273
|
+
return I("flex-1 min-w-0 bg-transparent border-none", "placeholder:text-muted-foreground", "outline-none focus:outline-none focus:ring-0", "disabled:cursor-not-allowed", v().text, v().px);
|
|
274
274
|
}
|
|
275
275
|
}, b), !1, !1), l(c, f(w, {
|
|
276
276
|
get when() {
|
|
@@ -284,7 +284,7 @@ function De(r) {
|
|
|
284
284
|
get fallback() {
|
|
285
285
|
return (() => {
|
|
286
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",
|
|
287
|
+
return l(t, () => e.suffix), y(() => C(t, I("flex items-center border-l border-input bg-muted/50 text-muted-foreground", v().text, v().px, v().height))), t;
|
|
288
288
|
})();
|
|
289
289
|
},
|
|
290
290
|
get children() {
|
|
@@ -326,10 +326,10 @@ function De(r) {
|
|
|
326
326
|
},
|
|
327
327
|
get children() {
|
|
328
328
|
var t = R();
|
|
329
|
-
return l(t, () => e.helperText), y(() => g(t, "id",
|
|
329
|
+
return l(t, () => e.helperText), y(() => g(t, "id", x())), t;
|
|
330
330
|
}
|
|
331
331
|
}), null), y((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",
|
|
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", v().height);
|
|
333
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;
|
|
334
334
|
}, {
|
|
335
335
|
e: void 0,
|
|
@@ -344,7 +344,7 @@ function le(r) {
|
|
|
344
344
|
x: -9999,
|
|
345
345
|
y: -9999
|
|
346
346
|
});
|
|
347
|
-
let h,
|
|
347
|
+
let h, x;
|
|
348
348
|
const $ = {
|
|
349
349
|
sm: {
|
|
350
350
|
height: "h-7",
|
|
@@ -353,7 +353,7 @@ function le(r) {
|
|
|
353
353
|
},
|
|
354
354
|
md: {
|
|
355
355
|
height: "h-8",
|
|
356
|
-
text: "text-
|
|
356
|
+
text: "text-[length:var(--floe-type-control)]",
|
|
357
357
|
px: "px-2.5"
|
|
358
358
|
},
|
|
359
359
|
lg: {
|
|
@@ -361,16 +361,16 @@ function le(r) {
|
|
|
361
361
|
text: "text-sm",
|
|
362
362
|
px: "px-3"
|
|
363
363
|
}
|
|
364
|
-
}, o = () => $[r.size ?? "md"],
|
|
365
|
-
if (!h || !
|
|
366
|
-
const i = h.getBoundingClientRect(), s =
|
|
364
|
+
}, o = () => $[r.size ?? "md"], v = () => {
|
|
365
|
+
if (!h || !x) return;
|
|
366
|
+
const i = h.getBoundingClientRect(), s = x.getBoundingClientRect(), c = window.innerWidth, a = window.innerHeight;
|
|
367
367
|
let t = i.left, u = i.bottom + 2;
|
|
368
368
|
t + s.width > c - D && (t = i.right - s.width), t = Math.max(D, t), u + s.height > a - D && (u = i.top - s.height - 2), u = Math.max(D, u), m({
|
|
369
369
|
x: t,
|
|
370
370
|
y: u
|
|
371
371
|
});
|
|
372
372
|
}, d = (i) => {
|
|
373
|
-
h && !h.contains(i.target) &&
|
|
373
|
+
h && !h.contains(i.target) && x && !x.contains(i.target) && b(!1);
|
|
374
374
|
}, T = (i) => {
|
|
375
375
|
i.key === "Escape" && b(!1);
|
|
376
376
|
}, P = (i) => {
|
|
@@ -384,7 +384,7 @@ function le(r) {
|
|
|
384
384
|
});
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
typeof document > "u" || (document.addEventListener("mousedown", d), document.addEventListener("keydown", T), requestAnimationFrame(
|
|
387
|
+
typeof document > "u" || (document.addEventListener("mousedown", d), document.addEventListener("keydown", T), requestAnimationFrame(v), se(() => {
|
|
388
388
|
document.removeEventListener("mousedown", d), document.removeEventListener("keydown", T);
|
|
389
389
|
}));
|
|
390
390
|
}), [(() => {
|
|
@@ -409,8 +409,8 @@ function le(r) {
|
|
|
409
409
|
get children() {
|
|
410
410
|
return f(ae, {
|
|
411
411
|
get children() {
|
|
412
|
-
var i = Ie(), s =
|
|
413
|
-
return typeof s == "function" ? ne(s, i) :
|
|
412
|
+
var i = Ie(), s = x;
|
|
413
|
+
return typeof s == "function" ? ne(s, i) : x = i, l(i, f(ce, {
|
|
414
414
|
get each() {
|
|
415
415
|
return r.options;
|
|
416
416
|
},
|
|
@@ -5,6 +5,8 @@ type MaybeAccessor<T> = T | Accessor<T>;
|
|
|
5
5
|
export interface UseOverlayMaskOptions {
|
|
6
6
|
open: Accessor<boolean>;
|
|
7
7
|
root: Accessor<HTMLElement | undefined>;
|
|
8
|
+
/** Ordered focus regions that belong to one overlay, including persistent navigation. */
|
|
9
|
+
focusRoots?: Accessor<readonly HTMLElement[]>;
|
|
8
10
|
onClose?: () => void;
|
|
9
11
|
/** Treat additional nodes as part of the overlay surface (e.g. portaled layers). */
|
|
10
12
|
containsTarget?: (target: EventTarget | null) => boolean;
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { createEffect as
|
|
2
|
-
import { lockBodyStyle as
|
|
3
|
-
import { deferAfterPaint as
|
|
4
|
-
import { getFocusableElements as
|
|
5
|
-
import { matchKeybind as
|
|
6
|
-
const
|
|
7
|
-
function
|
|
1
|
+
import { createEffect as Q, onCleanup as U } from "solid-js";
|
|
2
|
+
import { lockBodyStyle as X } from "../utils/bodyStyleLock.js";
|
|
3
|
+
import { deferAfterPaint as K } from "../utils/defer.js";
|
|
4
|
+
import { getFocusableElements as x, getFirstFocusableElement as Y } from "../utils/focus.js";
|
|
5
|
+
import { matchKeybind as Z } from "../utils/keybind.js";
|
|
6
|
+
const H = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
function A(t) {
|
|
8
8
|
return typeof Node < "u" && t instanceof Node;
|
|
9
9
|
}
|
|
10
|
-
function p(t, o,
|
|
11
|
-
return
|
|
10
|
+
function p(t, o, c) {
|
|
11
|
+
return c ? c(o) : !t || !A(o) ? !1 : t.contains(o);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function W(t, o, c, i) {
|
|
14
|
+
return c === "none" ? !1 : c === "all" ? !0 : !p(t, o, i);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function _(t) {
|
|
17
17
|
return typeof t == "function" ? t() ?? [] : t ?? [];
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function s(t, o) {
|
|
20
20
|
return typeof t == "function" ? t() ?? o : t ?? o;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
22
|
+
function $(t, o) {
|
|
23
|
+
for (const c of _(o)) {
|
|
24
|
+
const i = c.trim();
|
|
25
|
+
if (i && Z(t, i))
|
|
26
26
|
return !0;
|
|
27
27
|
}
|
|
28
28
|
return !1;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
const o = () =>
|
|
32
|
-
const
|
|
30
|
+
function ue(t) {
|
|
31
|
+
const o = () => s(t.lockBodyScroll, !0), c = () => s(t.trapFocus, !0), i = () => {
|
|
32
|
+
const f = s(
|
|
33
33
|
t.closeOnEscape,
|
|
34
34
|
!0
|
|
35
35
|
);
|
|
36
|
-
return
|
|
37
|
-
},
|
|
38
|
-
|
|
36
|
+
return f === !1 ? "none" : f === "inside" ? "inside" : f === "none" ? "none" : "always";
|
|
37
|
+
}, I = () => s(t.blockHotkeys, !0), R = () => s(t.restoreFocus, !0), N = () => s(t.blockWheel, "none"), q = () => s(t.blockTouchMove, "none"), j = () => s(t.autoFocus, !0);
|
|
38
|
+
Q(() => {
|
|
39
39
|
if (!t.open() || typeof document > "u") return;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
global:
|
|
40
|
+
const f = o(), w = c(), v = i(), h = s(t.escapeKeyPhase, "capture"), z = I(), V = R(), g = N(), k = q(), E = j(), d = H.get(document) ?? [];
|
|
41
|
+
H.set(document, d);
|
|
42
|
+
const y = {
|
|
43
|
+
global: f || v === "always",
|
|
44
44
|
contains: (e) => p(t.root(), e, t.containsTarget)
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
let
|
|
48
|
-
const
|
|
49
|
-
|
|
46
|
+
d.push(y);
|
|
47
|
+
let T = !0;
|
|
48
|
+
const l = (e) => T && !d.slice(d.indexOf(y) + 1).some((n) => n.global || n.contains(e)), b = document.activeElement instanceof HTMLElement ? document.activeElement : null, G = f ? X({ overflow: "hidden" }) : null;
|
|
49
|
+
K(() => {
|
|
50
50
|
const e = t.root();
|
|
51
|
-
if (!e?.isConnected || !
|
|
52
|
-
const n = typeof E == "object" ? E.selector : void 0,
|
|
51
|
+
if (!e?.isConnected || !l(e) || E === !1 || y.contains(document.activeElement)) return;
|
|
52
|
+
const n = typeof E == "object" ? E.selector : void 0, r = (n ? e.querySelector(n) : null) ?? e.querySelector("[data-floe-autofocus]") ?? Y(e) ?? e;
|
|
53
53
|
try {
|
|
54
|
-
|
|
54
|
+
r.focus({ preventScroll: !0 });
|
|
55
55
|
} catch {
|
|
56
56
|
}
|
|
57
57
|
});
|
|
58
|
-
const
|
|
59
|
-
if (e.key !== "Tab" || !
|
|
58
|
+
const L = (e) => {
|
|
59
|
+
if (e.key !== "Tab" || !l(e.target)) return;
|
|
60
60
|
const n = t.root();
|
|
61
61
|
if (!n) return;
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
62
|
+
const m = t.focusRoots?.() ?? [n], r = t.focusRoots ? [...new Set(m.flatMap(x))].filter((u) => u.tabIndex >= 0 && !u.closest('[hidden], [inert], [aria-hidden="true"]')) : x(n);
|
|
63
|
+
if (!r.length) {
|
|
64
64
|
e.preventDefault();
|
|
65
65
|
try {
|
|
66
66
|
n.focus();
|
|
@@ -68,31 +68,36 @@ function oe(t) {
|
|
|
68
68
|
}
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const D = r[0], P = r[r.length - 1], a = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
72
|
+
if (t.focusRoots) {
|
|
73
|
+
const u = a ? r.indexOf(a) : -1, J = u < 0 ? e.shiftKey ? r.length - 1 : 0 : (u + (e.shiftKey ? -1 : 1) + r.length) % r.length;
|
|
74
|
+
e.preventDefault(), r[J]?.focus({ preventScroll: !0 });
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
72
77
|
if (e.shiftKey) {
|
|
73
|
-
if (
|
|
78
|
+
if (a === D || !a || !m.some((u) => u.contains(a))) {
|
|
74
79
|
e.preventDefault();
|
|
75
80
|
try {
|
|
76
81
|
P.focus();
|
|
77
82
|
} catch {
|
|
78
83
|
}
|
|
79
84
|
}
|
|
80
|
-
} else if (
|
|
85
|
+
} else if (a === P || !a || !m.some((u) => u.contains(a))) {
|
|
81
86
|
e.preventDefault();
|
|
82
87
|
try {
|
|
83
|
-
|
|
88
|
+
D.focus();
|
|
84
89
|
} catch {
|
|
85
90
|
}
|
|
86
91
|
}
|
|
87
|
-
},
|
|
88
|
-
if (e.key !== "Escape" || !
|
|
89
|
-
const n = t.root(),
|
|
92
|
+
}, M = (e) => {
|
|
93
|
+
if (e.key !== "Escape" || !l(e.target) || h === "bubble" && (e.defaultPrevented || e.isComposing) || v === "none") return;
|
|
94
|
+
const n = t.root(), m = p(
|
|
90
95
|
n,
|
|
91
|
-
|
|
96
|
+
A(e.target) ? e.target : document.activeElement,
|
|
92
97
|
t.containsTarget
|
|
93
98
|
);
|
|
94
|
-
if (
|
|
95
|
-
if (
|
|
99
|
+
if (v === "inside") {
|
|
100
|
+
if (m) {
|
|
96
101
|
e.preventDefault(), e.stopImmediatePropagation(), t.onClose?.();
|
|
97
102
|
return;
|
|
98
103
|
}
|
|
@@ -100,41 +105,41 @@ function oe(t) {
|
|
|
100
105
|
return;
|
|
101
106
|
}
|
|
102
107
|
e.preventDefault(), e.stopImmediatePropagation(), t.onClose?.();
|
|
103
|
-
}, M = (e) => {
|
|
104
|
-
if (!u(e.target)) return;
|
|
105
|
-
const n = t.root();
|
|
106
|
-
n && q && p(n, e.target, t.containsTarget) && (Y(e, t.allowHotkeys) || e.stopPropagation());
|
|
107
108
|
}, O = (e) => {
|
|
108
|
-
if (!
|
|
109
|
+
if (!l(e.target)) return;
|
|
109
110
|
const n = t.root();
|
|
110
|
-
|
|
111
|
+
n && z && p(n, e.target, t.containsTarget) && ($(e, t.allowHotkeys) || e.stopPropagation());
|
|
111
112
|
}, B = (e) => {
|
|
112
|
-
|
|
113
|
+
if (!l(e.target)) return;
|
|
114
|
+
const n = t.root();
|
|
115
|
+
W(n, e.target, g, t.containsTarget) && e.cancelable && e.preventDefault();
|
|
113
116
|
}, F = (e) => {
|
|
114
|
-
|
|
117
|
+
l(e.target) && e.stopPropagation();
|
|
118
|
+
}, S = (e) => {
|
|
119
|
+
if (!l(e.target)) return;
|
|
115
120
|
const n = t.root();
|
|
116
|
-
|
|
121
|
+
W(n, e.target, k, t.containsTarget) && e.cancelable && e.preventDefault();
|
|
117
122
|
};
|
|
118
|
-
|
|
119
|
-
const C =
|
|
120
|
-
|
|
123
|
+
w && document.addEventListener("keydown", L, !0);
|
|
124
|
+
const C = h === "capture" ? window : document;
|
|
125
|
+
v !== "none" && C.addEventListener(
|
|
121
126
|
"keydown",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
), document.addEventListener("keydown",
|
|
127
|
+
M,
|
|
128
|
+
h === "capture"
|
|
129
|
+
), document.addEventListener("keydown", O), g !== "none" && (document.addEventListener("wheel", B, { capture: !0, passive: !1 }), document.addEventListener("wheel", F)), k !== "none" && document.addEventListener("touchmove", S, {
|
|
125
130
|
capture: !0,
|
|
126
131
|
passive: !1
|
|
127
|
-
}),
|
|
128
|
-
|
|
132
|
+
}), U(() => {
|
|
133
|
+
T = !1, d.splice(d.indexOf(y), 1), w && document.removeEventListener("keydown", L, !0), v !== "none" && C.removeEventListener(
|
|
129
134
|
"keydown",
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
), document.removeEventListener("keydown",
|
|
135
|
+
M,
|
|
136
|
+
h === "capture"
|
|
137
|
+
), document.removeEventListener("keydown", O), g !== "none" && (document.removeEventListener("wheel", B, !0), document.removeEventListener("wheel", F)), k !== "none" && document.removeEventListener("touchmove", S, !0), G?.(), V && b && b.isConnected && K(() => {
|
|
133
138
|
if (typeof document > "u") return;
|
|
134
139
|
const e = document.activeElement;
|
|
135
140
|
if (!(e && e !== document.body && e !== document.documentElement))
|
|
136
141
|
try {
|
|
137
|
-
|
|
142
|
+
b.focus({ preventScroll: !0 });
|
|
138
143
|
} catch {
|
|
139
144
|
}
|
|
140
145
|
});
|
|
@@ -142,5 +147,5 @@ function oe(t) {
|
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
149
|
export {
|
|
145
|
-
|
|
150
|
+
ue as useOverlayMask
|
|
146
151
|
};
|
package/dist/primitives.css
CHANGED
|
@@ -4,9 +4,15 @@
|
|
|
4
4
|
--font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
5
5
|
--font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace;
|
|
6
6
|
--floe-type-caption: 0.6875rem;
|
|
7
|
+
--floe-type-supporting: 0.75rem;
|
|
7
8
|
--floe-type-control: 0.8125rem;
|
|
8
9
|
--floe-type-body: 0.875rem;
|
|
9
10
|
--floe-type-heading: 1rem;
|
|
11
|
+
--floe-line-control: 1.25rem;
|
|
12
|
+
--floe-line-body: 1.375rem;
|
|
13
|
+
--floe-control-height-sm: 1.75rem;
|
|
14
|
+
--floe-control-height-md: 2rem;
|
|
15
|
+
--floe-row-height: 2rem;
|
|
10
16
|
--floe-space-1: 0.25rem;
|
|
11
17
|
--floe-space-2: 0.5rem;
|
|
12
18
|
--floe-space-3: 0.75rem;
|
|
@@ -16,3 +22,19 @@
|
|
|
16
22
|
--floe-radius-group: 0.5rem;
|
|
17
23
|
--floe-radius-floating: 12px;
|
|
18
24
|
}
|
|
25
|
+
|
|
26
|
+
/* Compact visual controls retain usable, non-overlapping touch geometry. */
|
|
27
|
+
@media (pointer: coarse) {
|
|
28
|
+
[data-floe-control='button'],
|
|
29
|
+
[data-floe-control='input'],
|
|
30
|
+
[data-floe-control='compound-input'],
|
|
31
|
+
[data-floe-control='compound-input'] button,
|
|
32
|
+
button[data-floe-input-surface] {
|
|
33
|
+
min-height: 44px;
|
|
34
|
+
}
|
|
35
|
+
[data-floe-control='button'],
|
|
36
|
+
[data-floe-control='compound-input'] button { min-width: 44px; }
|
|
37
|
+
[data-floe-control='compound-input'] input { font-size: max(16px, 1rem); }
|
|
38
|
+
[data-floe-control='compound-input'] { height: auto; }
|
|
39
|
+
[data-floe-control='input'] { font-size: max(16px, 1rem); }
|
|
40
|
+
}
|
package/dist/styles/tokens.d.ts
CHANGED
|
@@ -48,9 +48,15 @@ export declare const floeSharedCssVariables: {
|
|
|
48
48
|
readonly '--font-sans': "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
|
|
49
49
|
readonly '--font-mono': "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace";
|
|
50
50
|
readonly '--floe-type-caption': "0.6875rem";
|
|
51
|
+
readonly '--floe-type-supporting': "0.75rem";
|
|
51
52
|
readonly '--floe-type-control': "0.8125rem";
|
|
52
53
|
readonly '--floe-type-body': "0.875rem";
|
|
53
54
|
readonly '--floe-type-heading': "1rem";
|
|
55
|
+
readonly '--floe-line-control': "1.25rem";
|
|
56
|
+
readonly '--floe-line-body': "1.375rem";
|
|
57
|
+
readonly '--floe-control-height-sm': "1.75rem";
|
|
58
|
+
readonly '--floe-control-height-md': "2rem";
|
|
59
|
+
readonly '--floe-row-height': "2rem";
|
|
54
60
|
readonly '--floe-space-1': "0.25rem";
|
|
55
61
|
readonly '--floe-space-2': "0.5rem";
|
|
56
62
|
readonly '--floe-space-3': "0.75rem";
|
|
@@ -1258,9 +1264,15 @@ export declare const floeDesignTokens: {
|
|
|
1258
1264
|
readonly '--font-sans': "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif";
|
|
1259
1265
|
readonly '--font-mono': "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace";
|
|
1260
1266
|
readonly '--floe-type-caption': "0.6875rem";
|
|
1267
|
+
readonly '--floe-type-supporting': "0.75rem";
|
|
1261
1268
|
readonly '--floe-type-control': "0.8125rem";
|
|
1262
1269
|
readonly '--floe-type-body': "0.875rem";
|
|
1263
1270
|
readonly '--floe-type-heading': "1rem";
|
|
1271
|
+
readonly '--floe-line-control': "1.25rem";
|
|
1272
|
+
readonly '--floe-line-body': "1.375rem";
|
|
1273
|
+
readonly '--floe-control-height-sm': "1.75rem";
|
|
1274
|
+
readonly '--floe-control-height-md': "2rem";
|
|
1275
|
+
readonly '--floe-row-height': "2rem";
|
|
1264
1276
|
readonly '--floe-space-1': "0.25rem";
|
|
1265
1277
|
readonly '--floe-space-2': "0.5rem";
|
|
1266
1278
|
readonly '--floe-space-3': "0.75rem";
|
package/dist/styles/tokens.js
CHANGED
|
@@ -4,9 +4,15 @@ const i = {
|
|
|
4
4
|
"--font-sans": "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
5
5
|
"--font-mono": "'JetBrains Mono', 'Fira Code', 'SF Mono', Menlo, Monaco, Consolas, monospace",
|
|
6
6
|
"--floe-type-caption": "0.6875rem",
|
|
7
|
+
"--floe-type-supporting": "0.75rem",
|
|
7
8
|
"--floe-type-control": "0.8125rem",
|
|
8
9
|
"--floe-type-body": "0.875rem",
|
|
9
10
|
"--floe-type-heading": "1rem",
|
|
11
|
+
"--floe-line-control": "1.25rem",
|
|
12
|
+
"--floe-line-body": "1.375rem",
|
|
13
|
+
"--floe-control-height-sm": "1.75rem",
|
|
14
|
+
"--floe-control-height-md": "2rem",
|
|
15
|
+
"--floe-row-height": "2rem",
|
|
10
16
|
"--floe-space-1": "0.25rem",
|
|
11
17
|
"--floe-space-2": "0.5rem",
|
|
12
18
|
"--floe-space-3": "0.75rem",
|