@floegence/floe-webapp-core 0.35.29 → 0.35.30
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/ui/DirectoryInput.js +1 -1
- package/dist/components/ui/DirectoryPicker.js +1 -1
- package/dist/components/ui/FileSavePicker.js +1 -1
- package/dist/components/ui/picker/PickerBase.d.ts +2 -1
- package/dist/components/ui/picker/PickerBase.js +126 -118
- package/dist/styles/tokens.d.ts +80 -0
- package/dist/styles/tokens.js +57 -9
- package/dist/styles.css +1 -1
- package/dist/themes/dark.css +8 -0
- package/dist/themes/light.css +8 -0
- package/dist/ui.css +10 -10
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ function A(b) {
|
|
|
27
27
|
d() && e.files.length === 0 && e.onExpand && e.onExpand("/");
|
|
28
28
|
});
|
|
29
29
|
const n = T({
|
|
30
|
-
initialPath: e.initialPath ?? "/",
|
|
30
|
+
initialPath: () => e.initialPath ?? "/",
|
|
31
31
|
open: () => !0,
|
|
32
32
|
files: () => e.files,
|
|
33
33
|
onExpand: (r) => e.onExpand?.(r),
|
|
@@ -8,7 +8,7 @@ import { usePickerTree as P, PathInputBar as x, PickerBreadcrumb as C, PickerFol
|
|
|
8
8
|
var b = /* @__PURE__ */ i('<div class="flex flex-col gap-2 -mt-1">'), y = /* @__PURE__ */ i('<div class="flex items-center w-full gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">');
|
|
9
9
|
function E(t) {
|
|
10
10
|
const e = P({
|
|
11
|
-
initialPath: t.initialPath,
|
|
11
|
+
initialPath: () => t.initialPath,
|
|
12
12
|
open: () => t.open,
|
|
13
13
|
files: () => t.files,
|
|
14
14
|
// eslint-disable-next-line solid/reactivity -- filter is a static callback
|
|
@@ -10,7 +10,7 @@ import { usePickerTree as O, normalizePath as R, PathInputBar as G, PickerBreadc
|
|
|
10
10
|
var A = /* @__PURE__ */ m('<div class="flex flex-col gap-2 -mt-1"><div class="flex border border-border rounded overflow-hidden"style=height:260px><div class="w-1/2 min-w-0 overflow-y-auto">'), H = /* @__PURE__ */ m('<div class="flex flex-col w-full gap-2"><div class="flex items-center gap-1.5"><label class="text-xs text-muted-foreground flex-shrink-0">File name:</label><div class=flex-1></div></div><div class="flex items-center gap-2"><span class="flex-1 text-[11px] text-muted-foreground truncate">'), J = /* @__PURE__ */ m('<div class="flex items-center justify-center h-full text-xs text-muted-foreground">No files in this directory'), Q = /* @__PURE__ */ m('<span class="ml-auto text-[10px] text-muted-foreground/60 flex-shrink-0">'), U = /* @__PURE__ */ m("<button type=button><span class=truncate>");
|
|
11
11
|
function ie(e) {
|
|
12
12
|
const [u, f] = F(e.initialFileName ?? ""), [w, s] = F(""), r = O({
|
|
13
|
-
initialPath: e.initialPath,
|
|
13
|
+
initialPath: () => e.initialPath,
|
|
14
14
|
open: () => e.open,
|
|
15
15
|
files: () => e.files,
|
|
16
16
|
// eslint-disable-next-line solid/reactivity -- filter is a static callback
|
|
@@ -57,7 +57,7 @@ export declare function getParentPath(path: string): string;
|
|
|
57
57
|
/** Build a path → FileItem map for all folders in the tree */
|
|
58
58
|
export declare function useFolderIndex(files: Accessor<FileItem[]>): Accessor<Map<string, FileItem>>;
|
|
59
59
|
export interface UsePickerTreeOptions {
|
|
60
|
-
initialPath?: string
|
|
60
|
+
initialPath?: string | Accessor<string | undefined>;
|
|
61
61
|
open: Accessor<boolean>;
|
|
62
62
|
files: Accessor<FileItem[]>;
|
|
63
63
|
filter?: (item: FileItem) => boolean;
|
|
@@ -105,6 +105,7 @@ export interface PickerTreeState {
|
|
|
105
105
|
/** Convert internal tree path to display (real filesystem) path */
|
|
106
106
|
toDisplayPath: (internalPath: string) => string;
|
|
107
107
|
}
|
|
108
|
+
export declare function resolvePickerInitialPath(initialPath: string | undefined, homePath: string | undefined): string;
|
|
108
109
|
export declare function usePickerTree(opts: UsePickerTreeOptions): PickerTreeState;
|
|
109
110
|
export interface NewFolderSectionProps {
|
|
110
111
|
parentPath: Accessor<string>;
|
|
@@ -1,64 +1,71 @@
|
|
|
1
|
-
import { insert as d, createComponent as c, effect as T, className as p, style as Z, memo as
|
|
2
|
-
import { createSignal as _, createMemo as L, createEffect as K, on as G, For as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { insert as d, createComponent as c, effect as T, className as p, style as Z, memo as z, template as $, setAttribute as ee, setStyleProperty as te, delegateEvents as ne } from "solid-js/web";
|
|
2
|
+
import { createSignal as _, createMemo as L, createEffect as K, on as G, For as N, Show as F } from "solid-js";
|
|
3
|
+
import { cn as I } from "../../../utils/cn.js";
|
|
4
4
|
import { deferAfterPaint as re } from "../../../utils/defer.js";
|
|
5
|
-
import { Button as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { ChevronRight as
|
|
8
|
-
import { FolderOpenIcon as
|
|
9
|
-
var O = /* @__PURE__ */
|
|
10
|
-
function
|
|
5
|
+
import { Button as B } from "../Button.js";
|
|
6
|
+
import { Input as W } from "../Input.js";
|
|
7
|
+
import { ChevronRight as j, Check as oe, X as le, Plus as ie } from "../../icons/index.js";
|
|
8
|
+
import { FolderOpenIcon as M, FolderIcon as ae } from "../../file-browser/FileIcons.js";
|
|
9
|
+
var O = /* @__PURE__ */ $('<div class="flex items-center gap-1.5"><div class=flex-1>'), ce = /* @__PURE__ */ $('<p class="text-[11px] text-muted-foreground -mt-1">Creating in: '), se = /* @__PURE__ */ $("<button type=button><span>New Folder"), ue = /* @__PURE__ */ $('<nav class="flex items-center gap-0.5 min-w-0 overflow-x-auto py-0.5"aria-label="Selected path">'), V = /* @__PURE__ */ $("<button type=button>"), de = /* @__PURE__ */ $('<div class="flex items-center justify-center py-6 text-xs text-muted-foreground">'), he = /* @__PURE__ */ $("<div><button type=button><span>"), fe = /* @__PURE__ */ $("<div class=overflow-hidden>"), ge = /* @__PURE__ */ $('<div class="flex flex-col"><div><button type=button><span class="flex-shrink-0 w-4 h-4"></span><span class=truncate>'), me = /* @__PURE__ */ $('<span class="flex-shrink-0 w-4 h-4">');
|
|
10
|
+
function y(e) {
|
|
11
11
|
const l = (e ?? "").trim();
|
|
12
12
|
if (l === "" || l === "/") return "/";
|
|
13
|
-
const
|
|
14
|
-
return
|
|
13
|
+
const n = l.replace(/\/+$/, "");
|
|
14
|
+
return n.startsWith("/") ? n : "/" + n;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const l = e.split("/").filter(Boolean),
|
|
18
|
-
let
|
|
19
|
-
for (let
|
|
20
|
-
|
|
21
|
-
return
|
|
16
|
+
function H(e) {
|
|
17
|
+
const l = e.split("/").filter(Boolean), n = [];
|
|
18
|
+
let r = "";
|
|
19
|
+
for (let i = 0; i < l.length - 1; i++)
|
|
20
|
+
r += "/" + l[i], n.push(r);
|
|
21
|
+
return n;
|
|
22
22
|
}
|
|
23
23
|
function ve(e) {
|
|
24
24
|
return L(() => {
|
|
25
|
-
const l = /* @__PURE__ */ new Map(),
|
|
26
|
-
for (const
|
|
27
|
-
|
|
25
|
+
const l = /* @__PURE__ */ new Map(), n = (r) => {
|
|
26
|
+
for (const i of r)
|
|
27
|
+
i.type === "folder" && (l.set(y(i.path), i), i.children?.length && n(i.children));
|
|
28
28
|
};
|
|
29
|
-
return
|
|
29
|
+
return n(e()), l;
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
const
|
|
32
|
+
function xe(e, l) {
|
|
33
|
+
const n = y(e ?? "/"), r = l ? y(l) : void 0;
|
|
34
|
+
return !r || r === "/" ? n : n === r ? "/" : n.startsWith(r + "/") ? y(n.slice(r.length)) : n;
|
|
35
|
+
}
|
|
36
|
+
function pe(e) {
|
|
37
|
+
const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root", n = () => {
|
|
34
38
|
const t = typeof e.homePath == "function" ? e.homePath() : e.homePath;
|
|
35
|
-
return t ?
|
|
36
|
-
},
|
|
37
|
-
const
|
|
39
|
+
return t ? y(t) : void 0;
|
|
40
|
+
}, r = () => {
|
|
41
|
+
const t = typeof e.initialPath == "function" ? e.initialPath() : e.initialPath;
|
|
42
|
+
return xe(t, n());
|
|
43
|
+
}, i = (t) => {
|
|
44
|
+
const a = n();
|
|
38
45
|
if (!a) return t;
|
|
39
|
-
const h =
|
|
46
|
+
const h = y(t);
|
|
40
47
|
return h === "/" ? a : a === "/" ? h : a + h;
|
|
41
48
|
}, u = (t) => {
|
|
42
|
-
const a =
|
|
43
|
-
if (!a) return
|
|
44
|
-
const h =
|
|
45
|
-
return h === a ? "/" : a !== "/" && h.startsWith(a + "/") ? h.slice(a.length) || "/" :
|
|
46
|
-
}, [b, v] = _(
|
|
49
|
+
const a = n();
|
|
50
|
+
if (!a) return y(t);
|
|
51
|
+
const h = y(t);
|
|
52
|
+
return h === a ? "/" : a !== "/" && h.startsWith(a + "/") ? h.slice(a.length) || "/" : y(t);
|
|
53
|
+
}, [b, v] = _(r()), [P, f] = _(/* @__PURE__ */ new Set(["/"])), [k, o] = _(i(r())), [x, w] = _(""), s = ve(e.files), g = L(() => e.files().filter((t) => t.type === "folder"));
|
|
47
54
|
K(G(e.open, (t) => {
|
|
48
55
|
if (t) {
|
|
49
|
-
const a =
|
|
50
|
-
v(a),
|
|
51
|
-
const h =
|
|
56
|
+
const a = r();
|
|
57
|
+
v(a), o(i(a)), w("");
|
|
58
|
+
const h = H(a);
|
|
52
59
|
f(/* @__PURE__ */ new Set(["/", ...h])), e.onReset?.(a);
|
|
53
60
|
}
|
|
54
61
|
})), K(G(b, (t) => {
|
|
55
|
-
|
|
62
|
+
o(i(t)), w("");
|
|
56
63
|
}));
|
|
57
|
-
const
|
|
58
|
-
const a =
|
|
64
|
+
const S = (t) => {
|
|
65
|
+
const a = y(t);
|
|
59
66
|
return a === "/" || s().has(a);
|
|
60
|
-
},
|
|
61
|
-
const a =
|
|
67
|
+
}, C = (t) => e.filter ? e.filter(t) : !0, E = (t) => {
|
|
68
|
+
const a = H(t);
|
|
62
69
|
f((h) => {
|
|
63
70
|
const m = new Set(h);
|
|
64
71
|
for (const D of a) m.add(D);
|
|
@@ -71,7 +78,7 @@ function _e(e) {
|
|
|
71
78
|
return m.has(t) ? m.delete(t) : m.add(t), m;
|
|
72
79
|
}), a || e.onExpand?.(t);
|
|
73
80
|
}, J = (t) => {
|
|
74
|
-
if (!
|
|
81
|
+
if (!C(t)) return;
|
|
75
82
|
v(t.path);
|
|
76
83
|
const a = P().has(t.path);
|
|
77
84
|
f((h) => {
|
|
@@ -81,12 +88,12 @@ function _e(e) {
|
|
|
81
88
|
}, Q = () => {
|
|
82
89
|
v("/");
|
|
83
90
|
}, R = () => {
|
|
84
|
-
const t = u(
|
|
85
|
-
|
|
91
|
+
const t = u(k().trim());
|
|
92
|
+
S(t) ? (v(t), w(""), E(t)) : w("Path not found");
|
|
86
93
|
}, U = (t) => {
|
|
87
94
|
t.key === "Enter" && (t.preventDefault(), R());
|
|
88
95
|
}, Y = L(() => {
|
|
89
|
-
const t = b(), a =
|
|
96
|
+
const t = b(), a = l();
|
|
90
97
|
if (t === "/" || t === "") return [{
|
|
91
98
|
name: a,
|
|
92
99
|
path: "/"
|
|
@@ -108,48 +115,48 @@ function _e(e) {
|
|
|
108
115
|
setSelectedPath: v,
|
|
109
116
|
expandedPaths: P,
|
|
110
117
|
toggleExpand: q,
|
|
111
|
-
pathInput:
|
|
112
|
-
setPathInput:
|
|
118
|
+
pathInput: k,
|
|
119
|
+
setPathInput: o,
|
|
113
120
|
pathInputError: x,
|
|
114
121
|
setPathInputError: w,
|
|
115
122
|
folderIndex: s,
|
|
116
123
|
rootFolders: g,
|
|
117
|
-
isValidPath:
|
|
118
|
-
isSelectable:
|
|
124
|
+
isValidPath: S,
|
|
125
|
+
isSelectable: C,
|
|
119
126
|
handleSelectFolder: J,
|
|
120
127
|
handleSelectRoot: Q,
|
|
121
128
|
handlePathInputGo: R,
|
|
122
129
|
handlePathInputKeyDown: U,
|
|
123
|
-
expandToPath:
|
|
130
|
+
expandToPath: E,
|
|
124
131
|
breadcrumbSegments: Y,
|
|
125
132
|
handleBreadcrumbClick: (t) => {
|
|
126
|
-
v(t),
|
|
133
|
+
v(t), E(t);
|
|
127
134
|
},
|
|
128
|
-
homeLabel:
|
|
129
|
-
toDisplayPath:
|
|
135
|
+
homeLabel: l,
|
|
136
|
+
toDisplayPath: i
|
|
130
137
|
};
|
|
131
138
|
}
|
|
132
|
-
function
|
|
133
|
-
const [l,
|
|
134
|
-
|
|
139
|
+
function Ie(e) {
|
|
140
|
+
const [l, n] = _(!1), [r, i] = _(""), [u, b] = _(!1), v = () => {
|
|
141
|
+
n(!0), i("");
|
|
135
142
|
}, P = () => {
|
|
136
|
-
|
|
143
|
+
n(!1), i("");
|
|
137
144
|
}, f = () => {
|
|
138
|
-
const
|
|
139
|
-
if (!
|
|
145
|
+
const o = r().trim();
|
|
146
|
+
if (!o || u()) return;
|
|
140
147
|
b(!0);
|
|
141
|
-
const x = e.parentPath(), w =
|
|
148
|
+
const x = e.parentPath(), w = o, s = e.onCreateFolder;
|
|
142
149
|
re(() => {
|
|
143
150
|
s(x, w).then(() => {
|
|
144
|
-
|
|
151
|
+
n(!1), i("");
|
|
145
152
|
}).catch((g) => {
|
|
146
153
|
console.error("Failed to create folder:", g);
|
|
147
154
|
}).finally(() => {
|
|
148
155
|
b(!1);
|
|
149
156
|
});
|
|
150
157
|
});
|
|
151
|
-
},
|
|
152
|
-
|
|
158
|
+
}, k = (o) => {
|
|
159
|
+
o.key === "Enter" ? (o.preventDefault(), f()) : o.key === "Escape" && (o.preventDefault(), P());
|
|
153
160
|
};
|
|
154
161
|
return c(F, {
|
|
155
162
|
get when() {
|
|
@@ -157,28 +164,28 @@ function pe(e) {
|
|
|
157
164
|
},
|
|
158
165
|
get fallback() {
|
|
159
166
|
return (() => {
|
|
160
|
-
var
|
|
161
|
-
return
|
|
167
|
+
var o = se(), x = o.firstChild;
|
|
168
|
+
return o.$$click = v, d(o, c(ie, {
|
|
162
169
|
class: "w-3.5 h-3.5"
|
|
163
|
-
}), x), T(() => p(
|
|
170
|
+
}), x), T(() => p(o, I("flex items-center gap-1 text-xs text-muted-foreground cursor-pointer", "hover:text-foreground transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded px-1 py-0.5"))), o;
|
|
164
171
|
})();
|
|
165
172
|
},
|
|
166
173
|
get children() {
|
|
167
174
|
return [(() => {
|
|
168
|
-
var
|
|
169
|
-
return d(x, c(
|
|
175
|
+
var o = O(), x = o.firstChild;
|
|
176
|
+
return d(x, c(W, {
|
|
170
177
|
size: "sm",
|
|
171
178
|
get value() {
|
|
172
|
-
return
|
|
179
|
+
return r();
|
|
173
180
|
},
|
|
174
|
-
onInput: (w) =>
|
|
175
|
-
onKeyDown:
|
|
181
|
+
onInput: (w) => i(w.currentTarget.value),
|
|
182
|
+
onKeyDown: k,
|
|
176
183
|
placeholder: "Folder name",
|
|
177
184
|
get disabled() {
|
|
178
185
|
return u();
|
|
179
186
|
},
|
|
180
187
|
autofocus: !0
|
|
181
|
-
})), d(
|
|
188
|
+
})), d(o, c(B, {
|
|
182
189
|
variant: "primary",
|
|
183
190
|
size: "sm",
|
|
184
191
|
onClick: f,
|
|
@@ -186,14 +193,14 @@ function pe(e) {
|
|
|
186
193
|
return u();
|
|
187
194
|
},
|
|
188
195
|
get disabled() {
|
|
189
|
-
return !
|
|
196
|
+
return !r().trim();
|
|
190
197
|
},
|
|
191
198
|
get children() {
|
|
192
199
|
return c(oe, {
|
|
193
200
|
class: "w-3.5 h-3.5"
|
|
194
201
|
});
|
|
195
202
|
}
|
|
196
|
-
}), null), d(
|
|
203
|
+
}), null), d(o, c(B, {
|
|
197
204
|
variant: "ghost-destructive",
|
|
198
205
|
size: "sm",
|
|
199
206
|
onClick: P,
|
|
@@ -205,26 +212,26 @@ function pe(e) {
|
|
|
205
212
|
class: "w-3.5 h-3.5"
|
|
206
213
|
});
|
|
207
214
|
}
|
|
208
|
-
}), null),
|
|
215
|
+
}), null), o;
|
|
209
216
|
})(), (() => {
|
|
210
|
-
var
|
|
211
|
-
return
|
|
212
|
-
var x =
|
|
217
|
+
var o = ce();
|
|
218
|
+
return o.firstChild, d(o, (() => {
|
|
219
|
+
var x = z(() => !!e.toDisplayPath);
|
|
213
220
|
return () => x() ? e.toDisplayPath(e.parentPath()) : e.parentPath();
|
|
214
|
-
})(), null),
|
|
221
|
+
})(), null), o;
|
|
215
222
|
})()];
|
|
216
223
|
}
|
|
217
224
|
});
|
|
218
225
|
}
|
|
219
226
|
function Ee(e) {
|
|
220
227
|
return (() => {
|
|
221
|
-
var l = O(),
|
|
222
|
-
return d(
|
|
228
|
+
var l = O(), n = l.firstChild;
|
|
229
|
+
return d(n, c(W, {
|
|
223
230
|
size: "sm",
|
|
224
231
|
get value() {
|
|
225
232
|
return e.value();
|
|
226
233
|
},
|
|
227
|
-
onInput: (
|
|
234
|
+
onInput: (r) => e.onInput(r.currentTarget.value),
|
|
228
235
|
get onKeyDown() {
|
|
229
236
|
return e.onKeyDown;
|
|
230
237
|
},
|
|
@@ -234,7 +241,7 @@ function Ee(e) {
|
|
|
234
241
|
get error() {
|
|
235
242
|
return e.error();
|
|
236
243
|
}
|
|
237
|
-
})), d(l, c(
|
|
244
|
+
})), d(l, c(B, {
|
|
238
245
|
variant: "outline",
|
|
239
246
|
size: "sm",
|
|
240
247
|
get onClick() {
|
|
@@ -244,36 +251,36 @@ function Ee(e) {
|
|
|
244
251
|
}), null), l;
|
|
245
252
|
})();
|
|
246
253
|
}
|
|
247
|
-
function
|
|
254
|
+
function Fe(e) {
|
|
248
255
|
return (() => {
|
|
249
256
|
var l = ue();
|
|
250
|
-
return d(l, c(
|
|
257
|
+
return d(l, c(N, {
|
|
251
258
|
get each() {
|
|
252
259
|
return e.segments();
|
|
253
260
|
},
|
|
254
|
-
children: (
|
|
261
|
+
children: (n, r) => [c(F, {
|
|
255
262
|
get when() {
|
|
256
|
-
return
|
|
263
|
+
return r() > 0;
|
|
257
264
|
},
|
|
258
265
|
get children() {
|
|
259
|
-
return c(
|
|
266
|
+
return c(j, {
|
|
260
267
|
class: "w-3 h-3 text-muted-foreground/50 flex-shrink-0"
|
|
261
268
|
});
|
|
262
269
|
}
|
|
263
270
|
}), (() => {
|
|
264
|
-
var
|
|
265
|
-
return
|
|
271
|
+
var i = V();
|
|
272
|
+
return i.$$click = () => e.onClick(n.path), d(i, () => n.name), T(() => p(i, I("text-xs px-1 py-0.5 rounded cursor-pointer flex-shrink-0", "transition-colors duration-100", "focus:outline-none focus-visible:ring-1 focus-visible:ring-ring", r() === e.segments().length - 1 ? "font-medium text-foreground" : "text-muted-foreground hover:text-foreground hover:bg-muted/50"))), i;
|
|
266
273
|
})()]
|
|
267
274
|
})), l;
|
|
268
275
|
})();
|
|
269
276
|
}
|
|
270
|
-
function
|
|
277
|
+
function Te(e) {
|
|
271
278
|
const l = () => (typeof e.homeLabel == "function" ? e.homeLabel() : e.homeLabel) ?? "Root";
|
|
272
279
|
return (() => {
|
|
273
|
-
var
|
|
274
|
-
return
|
|
280
|
+
var n = he(), r = n.firstChild, i = r.firstChild;
|
|
281
|
+
return r.$$click = () => e.onSelectRoot(), d(r, c(M, {
|
|
275
282
|
class: "w-4 h-4 flex-shrink-0"
|
|
276
|
-
}),
|
|
283
|
+
}), i), d(i, l), d(n, c(N, {
|
|
277
284
|
get each() {
|
|
278
285
|
return e.rootFolders();
|
|
279
286
|
},
|
|
@@ -296,7 +303,7 @@ function Fe(e) {
|
|
|
296
303
|
return e.isSelectable;
|
|
297
304
|
}
|
|
298
305
|
})
|
|
299
|
-
}), null), d(
|
|
306
|
+
}), null), d(n, c(F, {
|
|
300
307
|
get when() {
|
|
301
308
|
return e.rootFolders().length === 0;
|
|
302
309
|
},
|
|
@@ -305,24 +312,24 @@ function Fe(e) {
|
|
|
305
312
|
return d(u, () => e.emptyText ?? "No directories available"), u;
|
|
306
313
|
}
|
|
307
314
|
}), null), T((u) => {
|
|
308
|
-
var b =
|
|
309
|
-
return b !== u.e && p(
|
|
315
|
+
var b = I("border border-border rounded overflow-y-auto", e.class), v = e.style, P = I("flex items-center gap-1.5 w-full text-left text-xs py-1.5 px-2 cursor-pointer", "transition-colors duration-100", "hover:bg-accent/60", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring", e.selectedPath() === "/" && "bg-accent text-accent-foreground font-medium");
|
|
316
|
+
return b !== u.e && p(n, u.e = b), u.t = Z(n, v, u.t), P !== u.a && p(r, u.a = P), u;
|
|
310
317
|
}, {
|
|
311
318
|
e: void 0,
|
|
312
319
|
t: void 0,
|
|
313
320
|
a: void 0
|
|
314
|
-
}),
|
|
321
|
+
}), n;
|
|
315
322
|
})();
|
|
316
323
|
}
|
|
317
324
|
function X(e) {
|
|
318
|
-
const l = () => e.expandedPaths().has(e.item.path),
|
|
325
|
+
const l = () => e.expandedPaths().has(e.item.path), n = () => e.selectedPath() === e.item.path, r = () => e.isSelectable(e.item), i = L(() => e.item.children?.filter((f) => f.type === "folder") ?? []), u = () => i().length > 0, b = () => e.item.type === "folder", v = (f) => {
|
|
319
326
|
f.stopPropagation(), e.onToggle(e.item.path);
|
|
320
327
|
}, P = () => {
|
|
321
328
|
e.onSelect(e.item);
|
|
322
329
|
};
|
|
323
330
|
return (() => {
|
|
324
|
-
var f = ge(),
|
|
325
|
-
return d(
|
|
331
|
+
var f = ge(), k = f.firstChild, o = k.firstChild, x = o.firstChild, w = x.nextSibling;
|
|
332
|
+
return d(k, c(F, {
|
|
326
333
|
get when() {
|
|
327
334
|
return b();
|
|
328
335
|
},
|
|
@@ -331,39 +338,39 @@ function X(e) {
|
|
|
331
338
|
},
|
|
332
339
|
get children() {
|
|
333
340
|
var s = V();
|
|
334
|
-
return s.$$click = v, d(s, c(
|
|
341
|
+
return s.$$click = v, d(s, c(j, {
|
|
335
342
|
class: "w-3 h-3 opacity-60"
|
|
336
343
|
})), T((g) => {
|
|
337
|
-
var
|
|
338
|
-
return
|
|
344
|
+
var S = I("flex-shrink-0 w-4 h-4 flex items-center justify-center cursor-pointer", "transition-transform duration-150", l() && "rotate-90", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring"), C = l() ? "Collapse folder" : "Expand folder";
|
|
345
|
+
return S !== g.e && p(s, g.e = S), C !== g.t && ee(s, "aria-label", g.t = C), g;
|
|
339
346
|
}, {
|
|
340
347
|
e: void 0,
|
|
341
348
|
t: void 0
|
|
342
349
|
}), s;
|
|
343
350
|
}
|
|
344
|
-
}),
|
|
351
|
+
}), o), o.$$click = P, d(x, c(F, {
|
|
345
352
|
get when() {
|
|
346
|
-
return
|
|
353
|
+
return z(() => !!u())() && l();
|
|
347
354
|
},
|
|
348
355
|
get fallback() {
|
|
349
|
-
return c(
|
|
356
|
+
return c(ae, {
|
|
350
357
|
class: "w-4 h-4"
|
|
351
358
|
});
|
|
352
359
|
},
|
|
353
360
|
get children() {
|
|
354
|
-
return c(
|
|
361
|
+
return c(M, {
|
|
355
362
|
class: "w-4 h-4"
|
|
356
363
|
});
|
|
357
364
|
}
|
|
358
365
|
})), d(w, () => e.item.name), d(f, c(F, {
|
|
359
366
|
get when() {
|
|
360
|
-
return
|
|
367
|
+
return z(() => !!l())() && u();
|
|
361
368
|
},
|
|
362
369
|
get children() {
|
|
363
370
|
var s = fe();
|
|
364
|
-
return d(s, c(
|
|
371
|
+
return d(s, c(N, {
|
|
365
372
|
get each() {
|
|
366
|
-
return
|
|
373
|
+
return i();
|
|
367
374
|
},
|
|
368
375
|
children: (g) => c(X, {
|
|
369
376
|
item: g,
|
|
@@ -389,8 +396,8 @@ function X(e) {
|
|
|
389
396
|
})), s;
|
|
390
397
|
}
|
|
391
398
|
}), null), T((s) => {
|
|
392
|
-
var g =
|
|
393
|
-
return g !== s.e && p(
|
|
399
|
+
var g = I("group flex items-center w-full text-xs", "transition-colors duration-100", r() ? "hover:bg-accent/60" : "opacity-50", n() && r() && "bg-accent text-accent-foreground font-medium"), S = `${4 + e.depth * 14}px`, C = !r(), E = I("flex items-center gap-1 flex-1 min-w-0 text-left py-1.5 pl-0.5 pr-2", r() ? "cursor-pointer" : "cursor-not-allowed", "focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring");
|
|
400
|
+
return g !== s.e && p(k, s.e = g), S !== s.t && te(k, "padding-left", s.t = S), C !== s.a && (o.disabled = s.a = C), E !== s.o && p(o, s.o = E), s;
|
|
394
401
|
}, {
|
|
395
402
|
e: void 0,
|
|
396
403
|
t: void 0,
|
|
@@ -401,13 +408,14 @@ function X(e) {
|
|
|
401
408
|
}
|
|
402
409
|
ne(["click"]);
|
|
403
410
|
export {
|
|
404
|
-
|
|
411
|
+
Ie as NewFolderSection,
|
|
405
412
|
Ee as PathInputBar,
|
|
406
|
-
|
|
407
|
-
|
|
413
|
+
Fe as PickerBreadcrumb,
|
|
414
|
+
Te as PickerFolderTree,
|
|
408
415
|
X as PickerTreeNode,
|
|
409
|
-
|
|
410
|
-
|
|
416
|
+
H as getAncestorPaths,
|
|
417
|
+
y as normalizePath,
|
|
418
|
+
xe as resolvePickerInitialPath,
|
|
411
419
|
ve as useFolderIndex,
|
|
412
|
-
|
|
420
|
+
pe as usePickerTree
|
|
413
421
|
};
|
package/dist/styles/tokens.d.ts
CHANGED
|
@@ -210,6 +210,46 @@ export declare const floeColorTokenCategories: readonly [{
|
|
|
210
210
|
readonly darkValue: "hsl(0 0% 100%)";
|
|
211
211
|
readonly description: "Foreground color used on info surfaces.";
|
|
212
212
|
}];
|
|
213
|
+
}, {
|
|
214
|
+
readonly name: "Highlight Blocks";
|
|
215
|
+
readonly description: "Dedicated accent colors for HighlightBlock variants so callouts can diverge from shared status tokens.";
|
|
216
|
+
readonly tokens: readonly [{
|
|
217
|
+
readonly name: "Highlight Block Info Accent";
|
|
218
|
+
readonly variable: "--highlight-block-info-accent";
|
|
219
|
+
readonly lightValue: "oklch(0.52 0.14 245)";
|
|
220
|
+
readonly darkValue: "oklch(0.62 0.12 240)";
|
|
221
|
+
readonly description: "Info accent used by HighlightBlock surfaces and borders.";
|
|
222
|
+
}, {
|
|
223
|
+
readonly name: "Highlight Block Warning Accent";
|
|
224
|
+
readonly variable: "--highlight-block-warning-accent";
|
|
225
|
+
readonly lightValue: "oklch(0.62 0.16 65)";
|
|
226
|
+
readonly darkValue: "oklch(0.7 0.14 65)";
|
|
227
|
+
readonly description: "Warning accent used by HighlightBlock surfaces and borders.";
|
|
228
|
+
}, {
|
|
229
|
+
readonly name: "Highlight Block Success Accent";
|
|
230
|
+
readonly variable: "--highlight-block-success-accent";
|
|
231
|
+
readonly lightValue: "oklch(0.55 0.14 155)";
|
|
232
|
+
readonly darkValue: "oklch(0.62 0.12 155)";
|
|
233
|
+
readonly description: "Success accent used by HighlightBlock surfaces and borders.";
|
|
234
|
+
}, {
|
|
235
|
+
readonly name: "Highlight Block Error Accent";
|
|
236
|
+
readonly variable: "--highlight-block-error-accent";
|
|
237
|
+
readonly lightValue: "oklch(0.55 0.16 25)";
|
|
238
|
+
readonly darkValue: "oklch(0.6 0.14 25)";
|
|
239
|
+
readonly description: "Error accent used by HighlightBlock surfaces and borders.";
|
|
240
|
+
}, {
|
|
241
|
+
readonly name: "Highlight Block Note Accent";
|
|
242
|
+
readonly variable: "--highlight-block-note-accent";
|
|
243
|
+
readonly lightValue: "oklch(0.52 0.16 285)";
|
|
244
|
+
readonly darkValue: "oklch(0.62 0.14 285)";
|
|
245
|
+
readonly description: "Note accent used by HighlightBlock surfaces and borders.";
|
|
246
|
+
}, {
|
|
247
|
+
readonly name: "Highlight Block Tip Accent";
|
|
248
|
+
readonly variable: "--highlight-block-tip-accent";
|
|
249
|
+
readonly lightValue: "oklch(0.52 0.12 175)";
|
|
250
|
+
readonly darkValue: "oklch(0.6 0.1 175)";
|
|
251
|
+
readonly description: "Tip accent used by HighlightBlock surfaces and borders.";
|
|
252
|
+
}];
|
|
213
253
|
}, {
|
|
214
254
|
readonly name: "Shell Chrome";
|
|
215
255
|
readonly description: "Stable shell chrome borders that can be overridden through theme.tokens.";
|
|
@@ -760,6 +800,46 @@ export declare const floeDesignTokens: {
|
|
|
760
800
|
readonly darkValue: "hsl(0 0% 100%)";
|
|
761
801
|
readonly description: "Foreground color used on info surfaces.";
|
|
762
802
|
}];
|
|
803
|
+
}, {
|
|
804
|
+
readonly name: "Highlight Blocks";
|
|
805
|
+
readonly description: "Dedicated accent colors for HighlightBlock variants so callouts can diverge from shared status tokens.";
|
|
806
|
+
readonly tokens: readonly [{
|
|
807
|
+
readonly name: "Highlight Block Info Accent";
|
|
808
|
+
readonly variable: "--highlight-block-info-accent";
|
|
809
|
+
readonly lightValue: "oklch(0.52 0.14 245)";
|
|
810
|
+
readonly darkValue: "oklch(0.62 0.12 240)";
|
|
811
|
+
readonly description: "Info accent used by HighlightBlock surfaces and borders.";
|
|
812
|
+
}, {
|
|
813
|
+
readonly name: "Highlight Block Warning Accent";
|
|
814
|
+
readonly variable: "--highlight-block-warning-accent";
|
|
815
|
+
readonly lightValue: "oklch(0.62 0.16 65)";
|
|
816
|
+
readonly darkValue: "oklch(0.7 0.14 65)";
|
|
817
|
+
readonly description: "Warning accent used by HighlightBlock surfaces and borders.";
|
|
818
|
+
}, {
|
|
819
|
+
readonly name: "Highlight Block Success Accent";
|
|
820
|
+
readonly variable: "--highlight-block-success-accent";
|
|
821
|
+
readonly lightValue: "oklch(0.55 0.14 155)";
|
|
822
|
+
readonly darkValue: "oklch(0.62 0.12 155)";
|
|
823
|
+
readonly description: "Success accent used by HighlightBlock surfaces and borders.";
|
|
824
|
+
}, {
|
|
825
|
+
readonly name: "Highlight Block Error Accent";
|
|
826
|
+
readonly variable: "--highlight-block-error-accent";
|
|
827
|
+
readonly lightValue: "oklch(0.55 0.16 25)";
|
|
828
|
+
readonly darkValue: "oklch(0.6 0.14 25)";
|
|
829
|
+
readonly description: "Error accent used by HighlightBlock surfaces and borders.";
|
|
830
|
+
}, {
|
|
831
|
+
readonly name: "Highlight Block Note Accent";
|
|
832
|
+
readonly variable: "--highlight-block-note-accent";
|
|
833
|
+
readonly lightValue: "oklch(0.52 0.16 285)";
|
|
834
|
+
readonly darkValue: "oklch(0.62 0.14 285)";
|
|
835
|
+
readonly description: "Note accent used by HighlightBlock surfaces and borders.";
|
|
836
|
+
}, {
|
|
837
|
+
readonly name: "Highlight Block Tip Accent";
|
|
838
|
+
readonly variable: "--highlight-block-tip-accent";
|
|
839
|
+
readonly lightValue: "oklch(0.52 0.12 175)";
|
|
840
|
+
readonly darkValue: "oklch(0.6 0.1 175)";
|
|
841
|
+
readonly description: "Tip accent used by HighlightBlock surfaces and borders.";
|
|
842
|
+
}];
|
|
763
843
|
}, {
|
|
764
844
|
readonly name: "Shell Chrome";
|
|
765
845
|
readonly description: "Stable shell chrome borders that can be overridden through theme.tokens.";
|