@floegence/floe-webapp-core 0.53.0 → 0.53.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/BottomBar.js +22 -22
- package/dist/components/layout/TopBar.js +7 -7
- package/dist/components/ui/Button.js +1 -1
- package/dist/components/ui/Card.js +1 -1
- package/dist/components/ui/Checkbox.js +69 -69
- package/dist/components/ui/CommandPalette.js +29 -30
- package/dist/components/ui/Dialog.js +1 -1
- package/dist/components/ui/Dropdown.js +36 -38
- package/dist/components/ui/FloatingWindow.js +2 -3
- package/dist/components/ui/Input.js +3 -3
- package/dist/components/ui/Radio.js +26 -26
- package/dist/components/ui/SegmentedControl.js +6 -6
- package/dist/components/ui/Tabs.js +43 -43
- package/dist/components/ui/floatingPresence.js +1 -1
- package/dist/context/ThemeContext.js +75 -65
- package/dist/floe.css +27 -55
- package/dist/styles/themes/classicSemanticTokens.d.ts +142 -0
- package/dist/styles/themes/classicSemanticTokens.js +100 -94
- package/dist/styles/themes/presets.d.ts +3 -1
- package/dist/styles/themes/presets.js +126 -63
- package/dist/styles/tokens.d.ts +252 -252
- package/dist/styles/tokens.js +165 -164
- package/dist/styles.css +1 -1
- package/dist/surface.css +17 -42
- package/dist/themes/dark.css +41 -95
- package/dist/themes/light.css +43 -95
- package/dist/themes/shell-presets.generated.css +146 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createComponent as c, Portal as R, effect as C, className as _, setStyleProperty as E, setAttribute as x, insert as
|
|
1
|
+
import { createComponent as c, Portal as R, effect as C, className as _, setStyleProperty as E, setAttribute as x, insert as a, Dynamic as T, template as f, use as F, delegateEvents as j } from "solid-js/web";
|
|
2
2
|
import { createSignal as B, createEffect as H, createMemo as L, Show as h, For as I } from "solid-js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as S } from "../../utils/cn.js";
|
|
4
4
|
import { useCommand as N } from "../../context/CommandContext.js";
|
|
5
5
|
import { Search as U } from "../icons/index.js";
|
|
6
6
|
import { useResolvedFloeConfig as W } from "../../context/FloeConfigContext.js";
|
|
@@ -10,14 +10,13 @@ import { createFloatingPresence as J } from "./floatingPresence.js";
|
|
|
10
10
|
var Q = /* @__PURE__ */ f("<div>"), V = /* @__PURE__ */ f('<div data-floe-surface=floating><div data-floe-input-surface data-floe-surface=inset class="flex items-center gap-3 px-4 pt-1 border-b border-border"><input type=text><kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono"></kbd></div><div class="max-h-80 overflow-y-auto overscroll-contain py-2">'), X = /* @__PURE__ */ f('<div class="px-4 py-8 text-center text-sm text-muted-foreground">'), Y = /* @__PURE__ */ f('<div><div class="px-4 py-1 text-xs font-semibold text-muted-foreground uppercase tracking-wider">'), Z = /* @__PURE__ */ f('<span class="w-5 h-5 flex items-center justify-center text-muted-foreground">'), ee = /* @__PURE__ */ f('<span class="ml-2 text-muted-foreground text-xs">'), te = /* @__PURE__ */ f('<kbd class="text-xs text-muted-foreground px-1.5 py-0.5 rounded bg-muted font-mono">'), re = /* @__PURE__ */ f('<button type=button><div class="flex-1 text-left"><span>');
|
|
11
11
|
function fe(b = {}) {
|
|
12
12
|
const n = N(), k = W();
|
|
13
|
-
let
|
|
14
|
-
const [
|
|
15
|
-
open: n.isOpen
|
|
16
|
-
exitDurationMs: 120
|
|
13
|
+
let M, z;
|
|
14
|
+
const [D, w] = B(0), v = J({
|
|
15
|
+
open: n.isOpen
|
|
17
16
|
});
|
|
18
17
|
q({
|
|
19
18
|
open: n.isOpen,
|
|
20
|
-
root: () =>
|
|
19
|
+
root: () => z,
|
|
21
20
|
onClose: () => n.close(),
|
|
22
21
|
lockBodyScroll: !0,
|
|
23
22
|
trapFocus: !0,
|
|
@@ -44,30 +43,30 @@ function fe(b = {}) {
|
|
|
44
43
|
e.preventDefault();
|
|
45
44
|
const r = t.length;
|
|
46
45
|
if (r <= 0) return;
|
|
47
|
-
w((
|
|
46
|
+
w((i) => Math.max(0, Math.min(i + 1, r - 1)));
|
|
48
47
|
break;
|
|
49
48
|
}
|
|
50
49
|
case "ArrowUp": {
|
|
51
50
|
e.preventDefault();
|
|
52
51
|
const r = t.length;
|
|
53
52
|
if (r <= 0) return;
|
|
54
|
-
w((
|
|
53
|
+
w((i) => Math.max(0, Math.min(i - 1, r - 1)));
|
|
55
54
|
break;
|
|
56
55
|
}
|
|
57
56
|
case "Enter":
|
|
58
|
-
e.preventDefault(), t[
|
|
57
|
+
e.preventDefault(), t[D()] && n.execute(t[D()].id);
|
|
59
58
|
break;
|
|
60
59
|
}
|
|
61
60
|
}, A = L(() => {
|
|
62
61
|
const e = n.filteredCommands(), t = /* @__PURE__ */ new Map();
|
|
63
|
-
return e.forEach((r,
|
|
62
|
+
return e.forEach((r, i) => {
|
|
64
63
|
const m = r.category ?? "Commands", s = t.get(m);
|
|
65
64
|
s ? s.push({
|
|
66
65
|
cmd: r,
|
|
67
|
-
index:
|
|
66
|
+
index: i
|
|
68
67
|
}) : t.set(m, [{
|
|
69
68
|
cmd: r,
|
|
70
|
-
index:
|
|
69
|
+
index: i
|
|
71
70
|
}]);
|
|
72
71
|
}), Array.from(t.entries());
|
|
73
72
|
});
|
|
@@ -81,8 +80,8 @@ function fe(b = {}) {
|
|
|
81
80
|
return [(() => {
|
|
82
81
|
var e = Q();
|
|
83
82
|
return e.$$click = () => n.close(), C((t) => {
|
|
84
|
-
var r =
|
|
85
|
-
return r !== t.e && _(e, t.e = r),
|
|
83
|
+
var r = S("fixed inset-0 bg-background/60 backdrop-blur-sm floe-floating-presence floe-floating-backdrop", b.zIndex === void 0 && "z-50"), i = b.zIndex, m = v.state(), s = v.exiting() ? "true" : void 0;
|
|
84
|
+
return r !== t.e && _(e, t.e = r), i !== t.t && E(e, "z-index", t.t = i), m !== t.a && x(e, "data-floating-presence", t.a = m), s !== t.o && x(e, "aria-hidden", t.o = s), t;
|
|
86
85
|
}, {
|
|
87
86
|
e: void 0,
|
|
88
87
|
t: void 0,
|
|
@@ -90,21 +89,21 @@ function fe(b = {}) {
|
|
|
90
89
|
o: void 0
|
|
91
90
|
}), e;
|
|
92
91
|
})(), (() => {
|
|
93
|
-
var e = V(), t = e.firstChild, r = t.firstChild,
|
|
92
|
+
var e = V(), t = e.firstChild, r = t.firstChild, i = r.nextSibling, m = t.nextSibling;
|
|
94
93
|
e.$$keydown = O;
|
|
95
|
-
var s =
|
|
96
|
-
typeof s == "function" ? F(s, e) :
|
|
94
|
+
var s = z;
|
|
95
|
+
typeof s == "function" ? F(s, e) : z = e, a(t, c(U, {
|
|
97
96
|
class: "w-5 h-5 text-muted-foreground flex-shrink-0"
|
|
98
97
|
}), r), r.$$input = (o) => n.setSearch(o.currentTarget.value);
|
|
99
|
-
var P =
|
|
100
|
-
return typeof P == "function" ? F(P, r) :
|
|
98
|
+
var P = M;
|
|
99
|
+
return typeof P == "function" ? F(P, r) : M = r, a(i, () => k.config.strings.commandPalette.esc), a(m, c(h, {
|
|
101
100
|
get when() {
|
|
102
101
|
return n.filteredCommands().length > 0;
|
|
103
102
|
},
|
|
104
103
|
get fallback() {
|
|
105
104
|
return (() => {
|
|
106
105
|
var o = X();
|
|
107
|
-
return
|
|
106
|
+
return a(o, () => k.config.strings.commandPalette.empty), o;
|
|
108
107
|
})();
|
|
109
108
|
},
|
|
110
109
|
get children() {
|
|
@@ -114,47 +113,47 @@ function fe(b = {}) {
|
|
|
114
113
|
},
|
|
115
114
|
children: ([o, y]) => (() => {
|
|
116
115
|
var g = Y(), $ = g.firstChild;
|
|
117
|
-
return
|
|
116
|
+
return a($, o), a(g, c(I, {
|
|
118
117
|
each: y,
|
|
119
118
|
children: (l) => (() => {
|
|
120
119
|
var d = re(), p = d.firstChild, K = p.firstChild;
|
|
121
|
-
return d.addEventListener("mouseenter", () => w(l.index)), d.$$click = () => n.execute(l.cmd.id),
|
|
120
|
+
return d.addEventListener("mouseenter", () => w(l.index)), d.$$click = () => n.execute(l.cmd.id), a(d, c(h, {
|
|
122
121
|
get when() {
|
|
123
122
|
return l.cmd.icon;
|
|
124
123
|
},
|
|
125
124
|
get children() {
|
|
126
125
|
var u = Z();
|
|
127
|
-
return
|
|
126
|
+
return a(u, c(T, {
|
|
128
127
|
get component() {
|
|
129
128
|
return l.cmd.icon;
|
|
130
129
|
},
|
|
131
130
|
class: "w-5 h-5"
|
|
132
131
|
})), u;
|
|
133
132
|
}
|
|
134
|
-
}), p),
|
|
133
|
+
}), p), a(K, () => l.cmd.title), a(p, c(h, {
|
|
135
134
|
get when() {
|
|
136
135
|
return l.cmd.description;
|
|
137
136
|
},
|
|
138
137
|
get children() {
|
|
139
138
|
var u = ee();
|
|
140
|
-
return
|
|
139
|
+
return a(u, () => l.cmd.description), u;
|
|
141
140
|
}
|
|
142
|
-
}), null),
|
|
141
|
+
}), null), a(d, c(h, {
|
|
143
142
|
get when() {
|
|
144
143
|
return l.cmd.keybind;
|
|
145
144
|
},
|
|
146
145
|
get children() {
|
|
147
146
|
var u = te();
|
|
148
|
-
return
|
|
147
|
+
return a(u, () => n.getKeybindDisplay(l.cmd.keybind)), u;
|
|
149
148
|
}
|
|
150
|
-
}), null), C(() => _(d,
|
|
149
|
+
}), null), C(() => _(d, S("w-full flex items-center gap-3 px-4 py-2 text-sm cursor-pointer", "transition-colors duration-75", "focus:outline-none", D() === l.index ? "bg-accent text-accent-foreground" : "hover:bg-accent/50"))), d;
|
|
151
150
|
})()
|
|
152
151
|
}), null), g;
|
|
153
152
|
})()
|
|
154
153
|
});
|
|
155
154
|
}
|
|
156
155
|
})), C((o) => {
|
|
157
|
-
var y =
|
|
156
|
+
var y = S("fixed left-1/2 top-[20%] -translate-x-1/2", b.zIndex === void 0 && "z-50", "w-full max-w-xl", "bg-popover text-popover-foreground rounded-lg shadow-2xl", "border border-border", "floe-floating-presence floe-floating-dialog-panel", "overflow-hidden"), g = b.zIndex, $ = v.state(), l = v.exiting() ? "true" : void 0, d = k.config.strings.commandPalette.placeholder, p = S("flex-1 h-12 bg-transparent text-sm", "placeholder:text-muted-foreground", "focus:outline-none");
|
|
158
157
|
return y !== o.e && _(e, o.e = y), g !== o.t && E(e, "z-index", o.t = g), $ !== o.a && x(e, "data-floating-presence", o.a = $), l !== o.o && x(e, "aria-hidden", o.o = l), d !== o.i && x(r, "placeholder", o.i = d), p !== o.n && _(r, o.n = p), o;
|
|
159
158
|
}, {
|
|
160
159
|
e: void 0,
|
|
@@ -39,7 +39,7 @@ function pe(e) {
|
|
|
39
39
|
const [R, z] = I(null), [M, Z] = I(0), [V, W] = I(0), m = () => e.presentation === "bottom-drawer", u = me({
|
|
40
40
|
open: () => e.open && !!R() && M() > 0,
|
|
41
41
|
get exitDurationMs() {
|
|
42
|
-
return m() ? 180 :
|
|
42
|
+
return m() ? 180 : 160;
|
|
43
43
|
}
|
|
44
44
|
}), y = () => u.mounted() && !!R() && M() > 0;
|
|
45
45
|
G(() => e.onPresenceChange?.(y())), j(() => e.onPresenceChange?.(!1));
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { setAttribute as f, insert as g, createComponent as l, Portal as W, use as
|
|
1
|
+
import { setAttribute as f, insert as g, createComponent as l, Portal as W, use as O, spread as G, mergeProps as J, effect as F, className as D, template as P, memo as z, delegateEvents as te } from "solid-js/web";
|
|
2
2
|
import { createSignal as _, createMemo as ne, createEffect as Q, onCleanup as re, Show as y, Index as V } from "solid-js";
|
|
3
|
-
import { cn as
|
|
3
|
+
import { cn as k } from "../../utils/cn.js";
|
|
4
4
|
import { deferNonBlocking as oe } from "../../utils/defer.js";
|
|
5
5
|
import { ChevronDown as ae, Check as ie, ChevronRight as ue } from "../icons/index.js";
|
|
6
|
-
import { focusMenuItem as
|
|
6
|
+
import { focusMenuItem as I, MENU_ITEM_SELECTOR as le, moveMenuFocus as U, calculateMenuPosition as se, calculateSubmenuPosition as de } from "./menuUtils.js";
|
|
7
7
|
import { LOCAL_INTERACTION_SURFACE_ATTR as X } from "./localInteractionSurface.js";
|
|
8
8
|
import { createFloatingPresence as Y } from "./floatingPresence.js";
|
|
9
9
|
import { useOverlayMask as ce } from "../../hooks/useOverlayMask.js";
|
|
10
10
|
import { resolveSurfacePortalHost as fe, projectSurfacePortalPosition as me, resolveSurfacePortalBoundaryRect as ge, isSurfacePortalMode as ve, resolveSurfacePortalMount as be } from "./dialogSurfaceScope.js";
|
|
11
11
|
var H = /* @__PURE__ */ P("<div>"), he = /* @__PURE__ */ P("<div><div role=button aria-haspopup=menu data-floe-dropdown-trigger>"), Z = /* @__PURE__ */ P('<div class="my-1 h-px bg-border"role=separator>'), we = /* @__PURE__ */ P('<button type=button role=menuitem><span class="w-3.5 h-3.5 flex items-center justify-center"></span><span class="flex-1 text-left">'), ye = /* @__PURE__ */ P("<div class=relative>"), xe = /* @__PURE__ */ P('<span class="w-3.5 h-3.5 flex items-center justify-center">'), Se = /* @__PURE__ */ P("<span>");
|
|
12
|
-
let
|
|
12
|
+
let ke = 0, Me = 0;
|
|
13
13
|
function Pe(e, c) {
|
|
14
14
|
switch (e) {
|
|
15
15
|
case "Enter":
|
|
@@ -36,14 +36,13 @@ function Pe(e, c) {
|
|
|
36
36
|
}
|
|
37
37
|
function $e(e) {
|
|
38
38
|
const [c, d] = _(!1), o = Y({
|
|
39
|
-
open: c
|
|
40
|
-
|
|
41
|
-
}), [B, k] = _({
|
|
39
|
+
open: c
|
|
40
|
+
}), [B, M] = _({
|
|
42
41
|
x: -9999,
|
|
43
42
|
y: -9999
|
|
44
43
|
});
|
|
45
44
|
let v, h;
|
|
46
|
-
const b = `floe-dropdown-${
|
|
45
|
+
const b = `floe-dropdown-${ke += 1}`, $ = `${b}-menu`, w = ne(() => o.mounted() ? fe({
|
|
47
46
|
owner: v
|
|
48
47
|
}) : {
|
|
49
48
|
host: null,
|
|
@@ -75,11 +74,11 @@ function $e(e) {
|
|
|
75
74
|
const C = () => {
|
|
76
75
|
if (!v || !h) return;
|
|
77
76
|
const r = v.getBoundingClientRect(), n = h.getBoundingClientRect(), i = se(r, n, e.align ?? "start", m.boundaryRect());
|
|
78
|
-
|
|
77
|
+
M(i);
|
|
79
78
|
};
|
|
80
79
|
Q(() => {
|
|
81
80
|
if (!o.mounted()) {
|
|
82
|
-
|
|
81
|
+
M({
|
|
83
82
|
x: -9999,
|
|
84
83
|
y: -9999
|
|
85
84
|
});
|
|
@@ -91,7 +90,7 @@ function $e(e) {
|
|
|
91
90
|
i && typeof i.closest == "function" && i.closest(`[data-floe-dropdown="${b}"]`) || d(!1);
|
|
92
91
|
};
|
|
93
92
|
document.addEventListener("pointerdown", r, !0), requestAnimationFrame(() => {
|
|
94
|
-
C(),
|
|
93
|
+
C(), I(h, e.value ? "selected" : "first");
|
|
95
94
|
}), re(() => {
|
|
96
95
|
document.removeEventListener("pointerdown", r, !0);
|
|
97
96
|
});
|
|
@@ -103,7 +102,7 @@ function $e(e) {
|
|
|
103
102
|
})), oe(() => n(r.id));
|
|
104
103
|
}, R = (r, n = "first") => {
|
|
105
104
|
e.disabled || (d(r), requestAnimationFrame(() => {
|
|
106
|
-
C(),
|
|
105
|
+
C(), I(h, n);
|
|
107
106
|
}));
|
|
108
107
|
}, T = (r) => {
|
|
109
108
|
if (e.disabled) return;
|
|
@@ -128,10 +127,10 @@ function $e(e) {
|
|
|
128
127
|
r.preventDefault(), U(i, t, -1);
|
|
129
128
|
return;
|
|
130
129
|
case "Home":
|
|
131
|
-
r.preventDefault(),
|
|
130
|
+
r.preventDefault(), I(i, "first");
|
|
132
131
|
return;
|
|
133
132
|
case "End":
|
|
134
|
-
r.preventDefault(),
|
|
133
|
+
r.preventDefault(), I(i, "last");
|
|
135
134
|
return;
|
|
136
135
|
case "Tab":
|
|
137
136
|
r.preventDefault(), d(!1), v?.focus();
|
|
@@ -152,7 +151,7 @@ function $e(e) {
|
|
|
152
151
|
}
|
|
153
152
|
};
|
|
154
153
|
var i = v;
|
|
155
|
-
return typeof i == "function" ?
|
|
154
|
+
return typeof i == "function" ? O(i, n) : v = n, f(n, "aria-controls", $), g(n, () => e.trigger), g(r, l(y, {
|
|
156
155
|
get when() {
|
|
157
156
|
return o.mounted();
|
|
158
157
|
},
|
|
@@ -163,9 +162,9 @@ function $e(e) {
|
|
|
163
162
|
},
|
|
164
163
|
get children() {
|
|
165
164
|
var t = H(), s = h;
|
|
166
|
-
return typeof s == "function" ?
|
|
165
|
+
return typeof s == "function" ? O(s, t) : h = t, f(t, "data-floe-dropdown", b), G(t, J({
|
|
167
166
|
get class() {
|
|
168
|
-
return
|
|
167
|
+
return k(m.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu");
|
|
169
168
|
},
|
|
170
169
|
get "data-floating-presence"() {
|
|
171
170
|
return o.state();
|
|
@@ -217,8 +216,8 @@ function $e(e) {
|
|
|
217
216
|
});
|
|
218
217
|
}
|
|
219
218
|
}), null), F((t) => {
|
|
220
|
-
var s =
|
|
221
|
-
return s !== t.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, L = e.triggerInputSurface ? "true" : void 0, p = 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), L !== t.s && f(n, "data-floe-input-surface", t.s = L), p !== t.h && f(n, "data-floe-surface", t.h = p), t;
|
|
222
221
|
}, {
|
|
223
222
|
e: void 0,
|
|
224
223
|
t: void 0,
|
|
@@ -232,17 +231,16 @@ function $e(e) {
|
|
|
232
231
|
})();
|
|
233
232
|
}
|
|
234
233
|
function ee(e) {
|
|
235
|
-
const [c, d] = _(!1), o = () => e.item.children && e.item.children.length > 0,
|
|
236
|
-
open: () => !!(c() && o())
|
|
237
|
-
exitDurationMs: 100
|
|
234
|
+
const [c, d] = _(!1), o = () => e.item.children && e.item.children.length > 0, M = Y({
|
|
235
|
+
open: () => !!(c() && o())
|
|
238
236
|
}), [v, h] = _({
|
|
239
237
|
x: -9999,
|
|
240
238
|
y: -9999
|
|
241
239
|
});
|
|
242
240
|
let b, $, w, m;
|
|
243
|
-
const A = `floe-dropdown-item-${
|
|
241
|
+
const A = `floe-dropdown-item-${Me += 1}`;
|
|
244
242
|
Q(() => {
|
|
245
|
-
|
|
243
|
+
M.mounted() || h({
|
|
246
244
|
x: -9999,
|
|
247
245
|
y: -9999
|
|
248
246
|
});
|
|
@@ -269,7 +267,7 @@ function ee(e) {
|
|
|
269
267
|
}
|
|
270
268
|
}, q = (n = "first") => {
|
|
271
269
|
o() && (d(!0), requestAnimationFrame(() => {
|
|
272
|
-
C(),
|
|
270
|
+
C(), I(w, n);
|
|
273
271
|
}));
|
|
274
272
|
}, r = () => {
|
|
275
273
|
d(!1), requestAnimationFrame(() => $?.focus());
|
|
@@ -278,15 +276,15 @@ function ee(e) {
|
|
|
278
276
|
var n = ye();
|
|
279
277
|
n.addEventListener("mouseleave", R), n.addEventListener("mouseenter", j);
|
|
280
278
|
var i = b;
|
|
281
|
-
return typeof i == "function" ?
|
|
279
|
+
return typeof i == "function" ? O(i, n) : b = n, g(n, l(y, {
|
|
282
280
|
get when() {
|
|
283
281
|
return e.item.content;
|
|
284
282
|
},
|
|
285
283
|
get children() {
|
|
286
284
|
var t = H();
|
|
287
285
|
return t.$$click = T, g(t, e.item.content), F((s) => {
|
|
288
|
-
var u =
|
|
289
|
-
return u !== s.e &&
|
|
286
|
+
var u = k("w-full px-2 py-1.5", e.item.tone === "danger" && "text-destructive", e.item.disabled && "opacity-50 pointer-events-none"), x = e.item.tone ?? "default";
|
|
287
|
+
return u !== s.e && D(t, s.e = u), x !== s.t && f(t, "data-tone", s.t = x), s;
|
|
290
288
|
}, {
|
|
291
289
|
e: void 0,
|
|
292
290
|
t: void 0
|
|
@@ -302,7 +300,7 @@ function ee(e) {
|
|
|
302
300
|
e.item.disabled || o() && ((a.key === "ArrowRight" || a.key === "Enter" || a.key === " ") && (a.preventDefault(), q("first")), a.key === "ArrowLeft" && (a.preventDefault(), r()));
|
|
303
301
|
}, t.$$click = T;
|
|
304
302
|
var x = $;
|
|
305
|
-
return typeof x == "function" ?
|
|
303
|
+
return typeof x == "function" ? O(x, t) : $ = t, f(t, "id", A), g(s, l(y, {
|
|
306
304
|
get when() {
|
|
307
305
|
return z(() => !!e.selected)() && !o();
|
|
308
306
|
},
|
|
@@ -330,8 +328,8 @@ function ee(e) {
|
|
|
330
328
|
});
|
|
331
329
|
}
|
|
332
330
|
}), null), F((a) => {
|
|
333
|
-
var S =
|
|
334
|
-
return S !== a.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, L = o() ? "menu" : void 0, p = 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), L !== a.a && f(t, "aria-haspopup", a.a = L), p !== a.o && f(t, "aria-expanded", a.o = p), K !== a.i && f(t, "data-floe-selected", a.i = K), N !== a.n && f(t, "data-tone", a.n = N), a;
|
|
335
333
|
}, {
|
|
336
334
|
e: void 0,
|
|
337
335
|
t: void 0,
|
|
@@ -343,7 +341,7 @@ function ee(e) {
|
|
|
343
341
|
}
|
|
344
342
|
}), null), g(n, l(y, {
|
|
345
343
|
get when() {
|
|
346
|
-
return z(() => !!
|
|
344
|
+
return z(() => !!M.mounted())() && o();
|
|
347
345
|
},
|
|
348
346
|
get children() {
|
|
349
347
|
return l(W, {
|
|
@@ -352,18 +350,18 @@ function ee(e) {
|
|
|
352
350
|
},
|
|
353
351
|
get children() {
|
|
354
352
|
var t = H(), s = w;
|
|
355
|
-
return typeof s == "function" ?
|
|
353
|
+
return typeof s == "function" ? O(s, t) : w = t, G(t, J({
|
|
356
354
|
get class() {
|
|
357
|
-
return
|
|
355
|
+
return k(e.portalLayout.isSurfaceMode() ? "absolute z-20 min-w-36 py-0.5" : "fixed z-50 min-w-36 py-0.5", "bg-popover text-popover-foreground", "rounded border border-border shadow-md", "floe-floating-presence floe-floating-menu floe-floating-submenu");
|
|
358
356
|
},
|
|
359
357
|
get "data-floe-dropdown"() {
|
|
360
358
|
return e.dropdownId;
|
|
361
359
|
},
|
|
362
360
|
get "data-floating-presence"() {
|
|
363
|
-
return
|
|
361
|
+
return M.state();
|
|
364
362
|
},
|
|
365
363
|
get "aria-hidden"() {
|
|
366
|
-
return
|
|
364
|
+
return M.exiting() ? "true" : void 0;
|
|
367
365
|
}
|
|
368
366
|
}, () => ({
|
|
369
367
|
[X]: e.portalLayout.isSurfaceMode() ? "true" : void 0
|
|
@@ -431,12 +429,12 @@ function Fe(e) {
|
|
|
431
429
|
return l($e, {
|
|
432
430
|
triggerInputSurface: !0,
|
|
433
431
|
get triggerClass() {
|
|
434
|
-
return
|
|
432
|
+
return k("flex items-center justify-between gap-2 h-8 px-2.5 w-full", "rounded border border-input bg-background text-xs shadow-sm", "transition-colors duration-100", e.class);
|
|
435
433
|
},
|
|
436
434
|
get trigger() {
|
|
437
435
|
return [(() => {
|
|
438
436
|
var o = Se();
|
|
439
|
-
return g(o, () => c()?.label ?? e.placeholder ?? "Select..."), F(() =>
|
|
437
|
+
return g(o, () => c()?.label ?? e.placeholder ?? "Select..."), F(() => D(o, k("truncate", !c() && "text-muted-foreground"))), o;
|
|
440
438
|
})(), l(ae, {
|
|
441
439
|
class: "w-3.5 h-3.5 text-muted-foreground"
|
|
442
440
|
})];
|
|
@@ -33,8 +33,7 @@ function Dt(n) {
|
|
|
33
33
|
width: 400,
|
|
34
34
|
height: 300
|
|
35
35
|
}), [c, Me] = g(!1), [k, ae] = g(!1), [M, se] = g(!1), [Te, q] = g(!1), S = st({
|
|
36
|
-
open: () => n.open
|
|
37
|
-
exitDurationMs: 120
|
|
36
|
+
open: () => n.open
|
|
38
37
|
});
|
|
39
38
|
let de = {
|
|
40
39
|
x: 0,
|
|
@@ -413,7 +412,7 @@ function Dt(n) {
|
|
|
413
412
|
},
|
|
414
413
|
get style() {
|
|
415
414
|
return {
|
|
416
|
-
"border-radius": c() ? "0" : "
|
|
415
|
+
"border-radius": c() ? "0" : "var(--floe-radius-floating)"
|
|
417
416
|
};
|
|
418
417
|
},
|
|
419
418
|
get "data-floating-presence"() {
|
|
@@ -36,7 +36,7 @@ function Te(r) {
|
|
|
36
36
|
get class() {
|
|
37
37
|
return I(
|
|
38
38
|
"w-full rounded border border-input bg-background shadow-sm",
|
|
39
|
-
"placeholder:text-muted-foreground
|
|
39
|
+
"placeholder:text-muted-foreground",
|
|
40
40
|
"transition-colors duration-100",
|
|
41
41
|
"focus:outline-none",
|
|
42
42
|
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
@@ -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-xs shadow-sm", "placeholder:text-muted-foreground
|
|
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", "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() {
|
|
@@ -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
|
|
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", x().text, x().px);
|
|
274
274
|
}
|
|
275
275
|
}, b), !1, !1), l(c, f(w, {
|
|
276
276
|
get when() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createComponent as l, spread as G, mergeProps as I, insert as a, effect as
|
|
1
|
+
import { createComponent as l, spread as G, mergeProps as I, insert as a, effect as f, className as v, setAttribute as p, template as b } from "solid-js/web";
|
|
2
2
|
import { splitProps as j, createUniqueId as M, For as A, Switch as B, Match as R, Show as x, createContext as D, useContext as F } from "solid-js";
|
|
3
3
|
import { cn as c } from "../../utils/cn.js";
|
|
4
|
-
var H = /* @__PURE__ */
|
|
4
|
+
var H = /* @__PURE__ */ b("<div role=radiogroup>"), U = /* @__PURE__ */ b("<input data-floe-choice-input type=radio>"), V = /* @__PURE__ */ b("<div data-floe-surface=inset data-floe-surface-part=indicator><div data-floe-surface=flat data-floe-surface-part=radio-dot>"), $ = /* @__PURE__ */ b("<span>"), J = /* @__PURE__ */ b('<div class="flex flex-col">'), K = /* @__PURE__ */ b('<label><div class="relative flex items-center justify-center pt-0.5">'), Q = /* @__PURE__ */ b("<label data-floe-surface-part=choice><span class=font-medium>"), T = /* @__PURE__ */ b('<div class="absolute top-2 right-2"><svg class="w-4 h-4 text-primary"fill=currentColor viewBox="0 0 20 20"><path fill-rule=evenodd d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"clip-rule=evenodd>'), W = /* @__PURE__ */ b('<label data-floe-surface-part=choice><div class="flex items-start gap-3"><div class="flex items-center justify-center pt-0.5"></div><div class="flex flex-col flex-1 min-w-0">'), X = /* @__PURE__ */ b('<div class="absolute top-1.5 right-1.5"><div class="w-2 h-2 rounded-full bg-primary">'), Y = /* @__PURE__ */ b("<label data-floe-surface-part=choice>"), Z = /* @__PURE__ */ b("<div>");
|
|
5
5
|
const O = D();
|
|
6
6
|
function ee() {
|
|
7
7
|
const y = F(O);
|
|
@@ -51,7 +51,7 @@ const C = {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
function ne(y) {
|
|
54
|
-
const [s, t] = j(y, ["value", "onChange", "size", "orientation", "variant", "disabled", "name", "class", "children"]), w = M(), k = () => s.name ?? w, _ = () => s.variant ?? "default",
|
|
54
|
+
const [s, t] = j(y, ["value", "onChange", "size", "orientation", "variant", "disabled", "name", "class", "children"]), w = M(), k = () => s.name ?? w, _ = () => s.variant ?? "default", g = {
|
|
55
55
|
value: () => s.value,
|
|
56
56
|
onChange: (u) => s.onChange?.(u),
|
|
57
57
|
size: () => s.size ?? "md",
|
|
@@ -63,7 +63,7 @@ function ne(y) {
|
|
|
63
63
|
return u === "button" ? c("inline-flex rounded-md border border-border overflow-hidden", d ? "flex-row" : "flex-col") : u === "card" || u === "tile" ? c("grid gap-2", d ? "grid-flow-col auto-cols-fr" : "grid-cols-1") : c("flex", d ? "flex-row flex-wrap gap-4" : "flex-col gap-2");
|
|
64
64
|
};
|
|
65
65
|
return l(O.Provider, {
|
|
66
|
-
value:
|
|
66
|
+
value: g,
|
|
67
67
|
get children() {
|
|
68
68
|
var u = H();
|
|
69
69
|
return G(u, I({
|
|
@@ -81,7 +81,7 @@ function ne(y) {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
function oe(y) {
|
|
84
|
-
const s = ee(), [t, w] = j(y, ["value", "label", "description", "icon", "size", "class", "disabled", "id"]), k = M(), _ = () => t.id ?? k,
|
|
84
|
+
const s = ee(), [t, w] = j(y, ["value", "label", "description", "icon", "size", "class", "disabled", "id"]), k = M(), _ = () => t.id ?? k, g = () => t.size ?? s.size(), h = () => s.variant(), u = () => t.disabled ?? s.disabled(), d = () => s.value() === t.value, q = () => {
|
|
85
85
|
u() || s.onChange(t.value);
|
|
86
86
|
}, S = (e) => (() => {
|
|
87
87
|
var r = U();
|
|
@@ -107,9 +107,9 @@ function oe(y) {
|
|
|
107
107
|
}, w), !1, !1), r;
|
|
108
108
|
})(), L = () => (() => {
|
|
109
109
|
var e = V(), r = e.firstChild;
|
|
110
|
-
return
|
|
111
|
-
var i = d() ? "true" : void 0, o = c("rounded-full border-2 transition-colors duration-150", "flex items-center justify-center", C[
|
|
112
|
-
return i !== n.e && p(e, "data-floe-selected", n.e = i), o !== n.t &&
|
|
110
|
+
return f((n) => {
|
|
111
|
+
var i = d() ? "true" : void 0, o = c("rounded-full border-2 transition-colors duration-150", "flex items-center justify-center", C[g()].outer, d() ? "border-primary bg-primary" : c("border-input bg-background", h() === "default" && "hover:border-primary/50"), u() && "cursor-not-allowed", "peer-focus-visible:ring-2 peer-focus-visible:ring-ring peer-focus-visible:ring-offset-2"), m = c("rounded-full bg-primary-foreground transition-transform duration-150", C[g()].inner, d() ? "scale-100" : "scale-0");
|
|
112
|
+
return i !== n.e && p(e, "data-floe-selected", n.e = i), o !== n.t && v(e, n.t = o), m !== n.a && v(r, n.a = m), n;
|
|
113
113
|
}, {
|
|
114
114
|
e: void 0,
|
|
115
115
|
t: void 0,
|
|
@@ -136,7 +136,7 @@ function oe(y) {
|
|
|
136
136
|
},
|
|
137
137
|
get children() {
|
|
138
138
|
var i = $();
|
|
139
|
-
return a(i, () => t.label),
|
|
139
|
+
return a(i, () => t.label), f(() => v(i, c("text-foreground", C[g()].label))), i;
|
|
140
140
|
}
|
|
141
141
|
}), null), a(n, l(x, {
|
|
142
142
|
get when() {
|
|
@@ -144,11 +144,11 @@ function oe(y) {
|
|
|
144
144
|
},
|
|
145
145
|
get children() {
|
|
146
146
|
var i = $();
|
|
147
|
-
return a(i, () => t.description),
|
|
147
|
+
return a(i, () => t.description), f(() => v(i, c("text-muted-foreground", C[g()].description))), i;
|
|
148
148
|
}
|
|
149
149
|
}), null), n;
|
|
150
150
|
}
|
|
151
|
-
}), null),
|
|
151
|
+
}), null), f(() => v(e, c("inline-flex items-start gap-2 cursor-pointer select-none", u() && "opacity-50 cursor-not-allowed", t.class))), e;
|
|
152
152
|
}
|
|
153
153
|
}), l(R, {
|
|
154
154
|
get when() {
|
|
@@ -158,9 +158,9 @@ function oe(y) {
|
|
|
158
158
|
var e = Q(), r = e.firstChild;
|
|
159
159
|
return a(e, l(S, {
|
|
160
160
|
class: "sr-only"
|
|
161
|
-
}), r), a(r, () => t.label),
|
|
162
|
-
var i = d() ? "inset" : "raised", o = d() ? "true" : void 0,
|
|
163
|
-
return i !== n.e && p(e, "data-floe-surface", n.e = i), o !== n.t && p(e, "data-floe-selected", n.t = o),
|
|
161
|
+
}), r), a(r, () => t.label), f((n) => {
|
|
162
|
+
var i = d() ? "inset" : "raised", o = d() ? "true" : void 0, m = h(), z = c("cursor-pointer select-none transition-colors duration-150", "border-r border-border last:border-r-0", re[g()], d() ? "bg-primary text-primary-foreground" : "bg-background text-foreground hover:bg-muted", u() && "opacity-50 cursor-not-allowed", t.class);
|
|
163
|
+
return i !== n.e && p(e, "data-floe-surface", n.e = i), o !== n.t && p(e, "data-floe-selected", n.t = o), m !== n.a && p(e, "data-floe-choice-variant", n.a = m), z !== n.o && v(e, n.o = z), n;
|
|
164
164
|
}, {
|
|
165
165
|
e: void 0,
|
|
166
166
|
t: void 0,
|
|
@@ -180,7 +180,7 @@ function oe(y) {
|
|
|
180
180
|
},
|
|
181
181
|
get children() {
|
|
182
182
|
var o = $();
|
|
183
|
-
return a(o, () => t.label),
|
|
183
|
+
return a(o, () => t.label), f(() => v(o, c("font-medium text-foreground", C[g()].label))), o;
|
|
184
184
|
}
|
|
185
185
|
}), null), a(i, l(x, {
|
|
186
186
|
get when() {
|
|
@@ -188,7 +188,7 @@ function oe(y) {
|
|
|
188
188
|
},
|
|
189
189
|
get children() {
|
|
190
190
|
var o = $();
|
|
191
|
-
return a(o, () => t.description),
|
|
191
|
+
return a(o, () => t.description), f(() => v(o, c("text-muted-foreground mt-0.5", C[g()].description))), o;
|
|
192
192
|
}
|
|
193
193
|
}), null), a(e, l(x, {
|
|
194
194
|
get when() {
|
|
@@ -197,9 +197,9 @@ function oe(y) {
|
|
|
197
197
|
get children() {
|
|
198
198
|
return T();
|
|
199
199
|
}
|
|
200
|
-
}), null),
|
|
201
|
-
var
|
|
202
|
-
return
|
|
200
|
+
}), null), f((o) => {
|
|
201
|
+
var m = d() ? "inset" : "raised", z = d() ? "true" : void 0, N = h(), P = c("relative cursor-pointer select-none rounded-lg border-2 transition-[background-color,border-color,color] duration-120", te[g()], d() ? "border-primary bg-primary/5" : "border-border bg-background hover:border-primary/50 hover:bg-muted/50", u() && "opacity-50 cursor-not-allowed", t.class);
|
|
202
|
+
return m !== o.e && p(e, "data-floe-surface", o.e = m), z !== o.t && p(e, "data-floe-selected", o.t = z), N !== o.a && p(e, "data-floe-choice-variant", o.a = N), P !== o.o && v(e, o.o = P), o;
|
|
203
203
|
}, {
|
|
204
204
|
e: void 0,
|
|
205
205
|
t: void 0,
|
|
@@ -225,9 +225,9 @@ function oe(y) {
|
|
|
225
225
|
var i = Z();
|
|
226
226
|
return a(i, l(n, {
|
|
227
227
|
get class() {
|
|
228
|
-
return E[
|
|
228
|
+
return E[g()].icon;
|
|
229
229
|
}
|
|
230
|
-
})),
|
|
230
|
+
})), f(() => v(i, c("mb-2 transition-colors duration-150", d() ? "text-primary" : "text-muted-foreground"))), i;
|
|
231
231
|
})();
|
|
232
232
|
}
|
|
233
233
|
}), null), a(e, l(x, {
|
|
@@ -236,7 +236,7 @@ function oe(y) {
|
|
|
236
236
|
},
|
|
237
237
|
get children() {
|
|
238
238
|
var r = $();
|
|
239
|
-
return a(r, () => t.label),
|
|
239
|
+
return a(r, () => t.label), f(() => v(r, c("font-medium transition-colors duration-150", C[g()].label, d() ? "text-primary" : "text-foreground"))), r;
|
|
240
240
|
}
|
|
241
241
|
}), null), a(e, l(x, {
|
|
242
242
|
get when() {
|
|
@@ -244,7 +244,7 @@ function oe(y) {
|
|
|
244
244
|
},
|
|
245
245
|
get children() {
|
|
246
246
|
var r = $();
|
|
247
|
-
return a(r, () => t.description),
|
|
247
|
+
return a(r, () => t.description), f(() => v(r, c("text-muted-foreground mt-0.5", C[g()].description))), r;
|
|
248
248
|
}
|
|
249
249
|
}), null), a(e, l(x, {
|
|
250
250
|
get when() {
|
|
@@ -253,9 +253,9 @@ function oe(y) {
|
|
|
253
253
|
get children() {
|
|
254
254
|
return X();
|
|
255
255
|
}
|
|
256
|
-
}), null),
|
|
257
|
-
var n = d() ? "inset" : "raised", i = d() ? "true" : void 0, o = h(),
|
|
258
|
-
return n !== r.e && p(e, "data-floe-surface", r.e = n), i !== r.t && p(e, "data-floe-selected", r.t = i), o !== r.a && p(e, "data-floe-choice-variant", r.a = o),
|
|
256
|
+
}), null), f((r) => {
|
|
257
|
+
var n = d() ? "inset" : "raised", i = d() ? "true" : void 0, o = h(), m = c("relative flex flex-col items-center justify-center cursor-pointer select-none", "rounded-lg border-2 transition-[background-color,border-color,color] duration-120 text-center", E[g()].container, d() ? "border-primary bg-primary/5" : "border-border bg-background hover:border-primary/50 hover:bg-muted/50", u() && "opacity-50 cursor-not-allowed", t.class);
|
|
258
|
+
return n !== r.e && p(e, "data-floe-surface", r.e = n), i !== r.t && p(e, "data-floe-selected", r.t = i), o !== r.a && p(e, "data-floe-choice-variant", r.a = o), m !== r.o && v(e, r.o = m), r;
|
|
259
259
|
}, {
|
|
260
260
|
e: void 0,
|
|
261
261
|
t: void 0,
|