@floegence/floe-webapp-core 0.36.72 → 0.36.74
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/file-browser/DirectoryTree.js +72 -65
- package/dist/components/file-browser/FileGridView.js +78 -72
- package/dist/components/file-browser/FileItemDecorations.d.ts +9 -0
- package/dist/components/file-browser/FileItemDecorations.js +59 -0
- package/dist/components/file-browser/FileListView.js +195 -186
- package/dist/components/file-browser/index.d.ts +1 -1
- package/dist/components/file-browser/types.d.ts +15 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createComponent as f, insert as l, effect as x, setAttribute as c, className as b, template as p } from "solid-js/web";
|
|
2
|
+
import { Show as S } from "solid-js";
|
|
3
|
+
import { cn as w } from "../../utils/cn.js";
|
|
4
|
+
var v = /* @__PURE__ */ p("<span aria-hidden=true>");
|
|
5
|
+
const E = ["default", "primary", "info", "success", "warning", "error", "muted"], h = {
|
|
6
|
+
default: "bg-foreground text-background",
|
|
7
|
+
primary: "bg-primary text-primary-foreground",
|
|
8
|
+
info: "bg-info text-info-foreground",
|
|
9
|
+
success: "bg-success text-success-foreground",
|
|
10
|
+
warning: "bg-warning text-warning-foreground",
|
|
11
|
+
error: "bg-error text-error-foreground",
|
|
12
|
+
muted: "bg-muted text-muted-foreground"
|
|
13
|
+
}, A = {
|
|
14
|
+
default: "",
|
|
15
|
+
primary: "text-primary",
|
|
16
|
+
info: "text-info",
|
|
17
|
+
success: "text-success",
|
|
18
|
+
warning: "text-warning",
|
|
19
|
+
error: "text-error",
|
|
20
|
+
muted: "text-muted-foreground"
|
|
21
|
+
}, y = {
|
|
22
|
+
xs: "-left-0.5 -top-0.5 h-2 min-w-2 px-[1px] text-[5px] ring-[0.5px]",
|
|
23
|
+
sm: "-left-1 -top-1 h-3.5 min-w-3.5 px-[3px] text-[7px] ring-1 shadow-sm",
|
|
24
|
+
md: "-left-1 -top-1 h-4 min-w-4 px-1 text-[8px] ring-1 shadow-sm"
|
|
25
|
+
};
|
|
26
|
+
function d(e) {
|
|
27
|
+
const r = String(e ?? "").trim();
|
|
28
|
+
return E.includes(r) ? r : "default";
|
|
29
|
+
}
|
|
30
|
+
function C(e) {
|
|
31
|
+
return String(e.decoration?.badge?.label ?? "").trim().slice(0, 2).toUpperCase();
|
|
32
|
+
}
|
|
33
|
+
function _(e) {
|
|
34
|
+
const r = d(e.decoration?.nameTone);
|
|
35
|
+
return A[r];
|
|
36
|
+
}
|
|
37
|
+
function z(e) {
|
|
38
|
+
const r = () => C(e.item), o = () => d(e.item.decoration?.badge?.tone), u = () => String(e.item.decoration?.badge?.title ?? "").trim() || void 0, m = () => e.size ?? "sm";
|
|
39
|
+
return f(S, {
|
|
40
|
+
get when() {
|
|
41
|
+
return r();
|
|
42
|
+
},
|
|
43
|
+
children: (g) => (() => {
|
|
44
|
+
var n = v();
|
|
45
|
+
return l(n, g), x((t) => {
|
|
46
|
+
var i = u(), a = o(), s = w("pointer-events-none absolute z-10 inline-flex items-center justify-center rounded-full ring-background/90", "font-black leading-none", y[m()], h[o()], e.class);
|
|
47
|
+
return i !== t.e && c(n, "title", t.e = i), a !== t.t && c(n, "data-file-browser-decoration-badge", t.t = a), s !== t.a && b(n, t.a = s), t;
|
|
48
|
+
}, {
|
|
49
|
+
e: void 0,
|
|
50
|
+
t: void 0,
|
|
51
|
+
a: void 0
|
|
52
|
+
}), n;
|
|
53
|
+
})()
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
export {
|
|
57
|
+
z as FileItemDecorationBadge,
|
|
58
|
+
_ as fileItemDecorationNameClass
|
|
59
|
+
};
|