@knymbus/voxel-ui 1.0.9 → 1.0.10
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/chunks/Button-BgQwvn3C.js +65 -0
- package/dist/chunks/button-dHcpTNIG.js +97 -0
- package/dist/chunks/icons-BpfDVwCQ.js +719 -0
- package/dist/chunks/search-BnD-97mv.js +205 -0
- package/dist/components/button/index.js +3 -0
- package/dist/components/icons/index.js +2 -0
- package/dist/components/search/index.js +2 -0
- package/dist/index.js +8 -1074
- package/package.json +4 -1
- package/{vite.config.ts → vite.config.mts} +6 -1
- package/dist/assets/voxel-ui.css +0 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { t as e } from "./jsx-runtime-Boo2vksn.js";
|
|
2
|
+
import { t } from "./Button-BgQwvn3C.js";
|
|
3
|
+
import { E as n, S as r } from "./icons-BpfDVwCQ.js";
|
|
4
|
+
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
5
|
+
//#region src/components/search/SearchInput.tsx
|
|
6
|
+
var s = e();
|
|
7
|
+
function c({ variant: e = "simple", value: c, onChange: l, onClear: u, placeholder: d = "Search manifests or tracking codes...", resultsCount: f = 0, menuResults: p = [], onResultClick: m, onViewMoreClick: h, className: g = "", showFloatPeek: _ = !1, resultIndicatorPanel: v }) {
|
|
8
|
+
let [y, b] = o(!1), [x, S] = o(!1), C = a(null), w = a(null);
|
|
9
|
+
i(() => {
|
|
10
|
+
let t = (t) => {
|
|
11
|
+
C.current && !C.current.contains(t.target) && (S(!1), e === "float" && c === "" && b(!1));
|
|
12
|
+
};
|
|
13
|
+
return window.addEventListener("mousedown", t), () => window.removeEventListener("mousedown", t);
|
|
14
|
+
}, [e, c]);
|
|
15
|
+
let T = (e) => {
|
|
16
|
+
e.stopPropagation(), l(""), u && u(), w.current && w.current.focus();
|
|
17
|
+
}, E = () => {
|
|
18
|
+
b(!0), setTimeout(() => w.current?.focus(), 50);
|
|
19
|
+
}, D = "relative flex flex-col font-sans text-xs select-none";
|
|
20
|
+
if (e === "simple") {
|
|
21
|
+
let e = c.length > 0;
|
|
22
|
+
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
23
|
+
className: `${D} ${g}`.trim(),
|
|
24
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
25
|
+
className: "relative flex items-center bg-vsc-bg-input border border-vsc-border rounded-sm h-8 group hover:border-vsc-accent transition-colors z-20",
|
|
26
|
+
children: [
|
|
27
|
+
/* @__PURE__ */ (0, s.jsx)(r, {
|
|
28
|
+
size: 14,
|
|
29
|
+
className: "absolute left-2.5 text-vsc-muted group-hover:text-vsc-text"
|
|
30
|
+
}),
|
|
31
|
+
/* @__PURE__ */ (0, s.jsx)("input", {
|
|
32
|
+
ref: w,
|
|
33
|
+
type: "text",
|
|
34
|
+
value: c,
|
|
35
|
+
onChange: (e) => l(e.target.value),
|
|
36
|
+
placeholder: d,
|
|
37
|
+
className: "w-full h-full pl-8 pr-10 bg-transparent text-vsc-text border-none outline-none focus:outline-none placeholder-vsc-muted"
|
|
38
|
+
}),
|
|
39
|
+
c && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
40
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2 flex items-center",
|
|
41
|
+
children: /* @__PURE__ */ (0, s.jsx)(t, {
|
|
42
|
+
icon: n,
|
|
43
|
+
color: "ghost",
|
|
44
|
+
iconOnly: !0,
|
|
45
|
+
onClick: T,
|
|
46
|
+
size: "xs"
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
]
|
|
50
|
+
}), /* @__PURE__ */ (0, s.jsx)("div", {
|
|
51
|
+
className: `absolute left-0 right-0 top-8 z-50 overflow-hidden transition-all duration-200 cubic-bezier(0.34, 1.56, 0.64, 1) ${e ? "" : "pointer-events-none"}`,
|
|
52
|
+
style: {
|
|
53
|
+
height: e ? "auto" : "0px",
|
|
54
|
+
opacity: +!!e,
|
|
55
|
+
transform: e ? "translateY(0px)" : "translateY(-4px)"
|
|
56
|
+
},
|
|
57
|
+
children: /* @__PURE__ */ (0, s.jsx)("div", {
|
|
58
|
+
className: "bg-vsc-sidebar shadow-sm p-1.5 pt-1 ",
|
|
59
|
+
children: f === 0 ? /* @__PURE__ */ (0, s.jsx)("div", {
|
|
60
|
+
className: "pl-1 text-start text-[11px] text-vsc-muted italic",
|
|
61
|
+
children: "No record match your search query constraints."
|
|
62
|
+
}) : v || /* @__PURE__ */ (0, s.jsxs)("p", {
|
|
63
|
+
className: "text-[10px] font-mono text-vsc-muted pl-1 truncate",
|
|
64
|
+
children: [
|
|
65
|
+
"Showing ",
|
|
66
|
+
/* @__PURE__ */ (0, s.jsx)("span", {
|
|
67
|
+
className: "text-vsc-accent font-bold",
|
|
68
|
+
children: f
|
|
69
|
+
}),
|
|
70
|
+
" matching database metrics records"
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})]
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (e === "float") {
|
|
78
|
+
let e = _ && f > 0 && c.length > 0;
|
|
79
|
+
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
80
|
+
ref: C,
|
|
81
|
+
className: `${D} ${g}`.trim(),
|
|
82
|
+
children: [/* @__PURE__ */ (0, s.jsx)("div", {
|
|
83
|
+
className: `flex items-center bg-vsc-bg-input border rounded-sm h-8 transition-all duration-300 ease-in-out overflow-hidden ${y || c ? "w-64 border-vsc-accent px-2" : "w-8 border-transparent bg-transparent justify-center"}`,
|
|
84
|
+
children: y || c ? /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
85
|
+
className: "relative flex items-center w-full h-full",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ (0, s.jsx)(r, {
|
|
88
|
+
size: 14,
|
|
89
|
+
className: "text-vsc-text shrink-0"
|
|
90
|
+
}),
|
|
91
|
+
/* @__PURE__ */ (0, s.jsx)("input", {
|
|
92
|
+
ref: w,
|
|
93
|
+
type: "text",
|
|
94
|
+
value: c,
|
|
95
|
+
onChange: (e) => l(e.target.value),
|
|
96
|
+
placeholder: d,
|
|
97
|
+
className: "w-full h-full pl-2 pr-6 bg-transparent text-vsc-text border-none outline-none focus:outline-none placeholder-vsc-muted"
|
|
98
|
+
}),
|
|
99
|
+
c && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
100
|
+
className: "absolute right-0 top-1/2 -translate-y-1/2 flex items-center",
|
|
101
|
+
children: /* @__PURE__ */ (0, s.jsx)(t, {
|
|
102
|
+
iconOnly: !0,
|
|
103
|
+
color: "ghost",
|
|
104
|
+
icon: n,
|
|
105
|
+
onClick: T,
|
|
106
|
+
size: "xs"
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
}) : /* @__PURE__ */ (0, s.jsx)(t, {
|
|
111
|
+
iconOnly: !0,
|
|
112
|
+
size: "sm",
|
|
113
|
+
icon: r,
|
|
114
|
+
onClick: E,
|
|
115
|
+
color: "ghost",
|
|
116
|
+
className: "text-vsc-muted hover:text-vsc-text transition-colors",
|
|
117
|
+
title: "Open Expandable Search"
|
|
118
|
+
})
|
|
119
|
+
}), /* @__PURE__ */ (0, s.jsx)("div", {
|
|
120
|
+
className: "overflow-hidden transition-all duration-200 ease-out w-64 absolute top-8",
|
|
121
|
+
style: {
|
|
122
|
+
height: e ? "20px" : "0px",
|
|
123
|
+
opacity: +!!e
|
|
124
|
+
},
|
|
125
|
+
children: /* @__PURE__ */ (0, s.jsxs)("p", {
|
|
126
|
+
className: "text-[9px] font-mono text-vsc-accent pt-1 pl-1 truncate bg-vsc-sidebar border border-t-0 border-vsc-border p-1 rounded-b shadow-sm",
|
|
127
|
+
children: [
|
|
128
|
+
"Quick Peek: Found ",
|
|
129
|
+
f,
|
|
130
|
+
" rows"
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
})]
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
137
|
+
ref: C,
|
|
138
|
+
className: `${D} ${g}`.trim(),
|
|
139
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
140
|
+
className: "relative flex items-center bg-vsc-bg-input border border-vsc-border rounded-sm h-8 focus-within:border-vsc-accent",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ (0, s.jsx)(r, {
|
|
143
|
+
size: 14,
|
|
144
|
+
className: "absolute left-2.5 text-vsc-muted"
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ (0, s.jsx)("input", {
|
|
147
|
+
ref: w,
|
|
148
|
+
type: "text",
|
|
149
|
+
value: c,
|
|
150
|
+
onChange: (e) => {
|
|
151
|
+
l(e.target.value), S(!0);
|
|
152
|
+
},
|
|
153
|
+
onFocus: () => S(!0),
|
|
154
|
+
placeholder: d,
|
|
155
|
+
className: "w-full h-full pl-8 pr-10 bg-transparent text-vsc-text border-none outline-none focus:outline-none placeholder-vsc-muted"
|
|
156
|
+
}),
|
|
157
|
+
c && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
158
|
+
className: "absolute right-1 top-1/2 -translate-y-1/2 flex items-center",
|
|
159
|
+
children: /* @__PURE__ */ (0, s.jsx)(t, {
|
|
160
|
+
iconOnly: !0,
|
|
161
|
+
icon: n,
|
|
162
|
+
color: "ghost",
|
|
163
|
+
onClick: T,
|
|
164
|
+
size: "xs"
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
]
|
|
168
|
+
}), x && c && /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
169
|
+
className: "absolute top-9 left-0 w-full bg-vsc-sidebar border border-vsc-border rounded shadow-xl z-50 p-1 flex flex-col max-h-64 animate-in fade-in slide-in-from-top-1 duration-150",
|
|
170
|
+
children: [/* @__PURE__ */ (0, s.jsx)("div", {
|
|
171
|
+
className: "overflow-y-auto flex-1",
|
|
172
|
+
children: p.length === 0 ? /* @__PURE__ */ (0, s.jsx)("div", {
|
|
173
|
+
className: "p-4 text-center text-[11px] text-vsc-muted italic",
|
|
174
|
+
children: "No indexed record entities match your text query constraints."
|
|
175
|
+
}) : p.map((e) => /* @__PURE__ */ (0, s.jsxs)("div", {
|
|
176
|
+
onClick: () => {
|
|
177
|
+
m && m(e), S(!1);
|
|
178
|
+
},
|
|
179
|
+
className: "w-full p-2 hover:bg-vsc-hover text-left rounded-sm cursor-pointer flex flex-col space-y-0.5 transition-colors",
|
|
180
|
+
children: [/* @__PURE__ */ (0, s.jsxs)("div", {
|
|
181
|
+
className: "font-semibold text-vsc-text flex justify-between items-center",
|
|
182
|
+
children: [/* @__PURE__ */ (0, s.jsx)("span", {
|
|
183
|
+
className: "truncate",
|
|
184
|
+
children: e.title
|
|
185
|
+
}), e.category && /* @__PURE__ */ (0, s.jsx)("span", {
|
|
186
|
+
className: "text-[9px] font-mono font-bold bg-vsc-accent/10 border border-vsc-accent/20 text-vsc-accent px-1 rounded-sm uppercase tracking-wide",
|
|
187
|
+
children: e.category
|
|
188
|
+
})]
|
|
189
|
+
}), e.subtitle && /* @__PURE__ */ (0, s.jsx)("div", {
|
|
190
|
+
className: "text-[10px] text-vsc-muted truncate",
|
|
191
|
+
children: e.subtitle
|
|
192
|
+
})]
|
|
193
|
+
}, e.id))
|
|
194
|
+
}), p.length > 0 && h && /* @__PURE__ */ (0, s.jsx)("button", {
|
|
195
|
+
onClick: () => {
|
|
196
|
+
h(), S(!1);
|
|
197
|
+
},
|
|
198
|
+
className: "w-full border-t border-vsc-border bg-vsc-bg hover:bg-vsc-hover/60 p-2 text-center text-[10px] font-bold text-vsc-accent tracking-wide uppercase transition-colors rounded-b-sm border-none cursor-pointer",
|
|
199
|
+
children: "View All Matching Search Metrics Records →"
|
|
200
|
+
})]
|
|
201
|
+
})]
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
//#endregion
|
|
205
|
+
export { c as t };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "../../chunks/icons-BpfDVwCQ.js";
|
|
2
|
+
export { S as Add, m as BlankDoc, l as Chat, T as ChevronDown, t as Close, p as Comment, x as DeleteChat, C as Document, u as Expand, e as Folder, h as Group, d as Minimize, i as Minus, g as More, y as OpenFolder, f as Person, c as PlusChat, s as PlusComment, _ as PlusDoc, b as PlusDocBadge, v as PlusPerson, w as Refresh, n as Search, r as Terminal, o as Trash, a as Truck };
|