@vuer-ai/vuer-uikit 0.0.76 → 0.0.77

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.
Files changed (59) hide show
  1. package/dist/chunk-33ZAFHOY.cjs +99 -0
  2. package/dist/{chunk-TSHZODTT.mjs → chunk-3HERIMKO.mjs} +1 -1
  3. package/dist/{chunk-2DA6GE5K.mjs → chunk-3LM4LVYM.mjs} +8 -5
  4. package/dist/chunk-6E4NTY34.cjs +494 -0
  5. package/dist/chunk-7644AY3P.cjs +855 -0
  6. package/dist/chunk-AOAM6HV2.mjs +94 -0
  7. package/dist/chunk-CSSMBHBD.mjs +853 -0
  8. package/dist/chunk-CW6FHIAT.cjs +624 -0
  9. package/dist/chunk-D5YKZOUG.mjs +247 -0
  10. package/dist/chunk-HOJOWLJT.mjs +142 -0
  11. package/dist/chunk-HTHCG2AN.cjs +125 -0
  12. package/dist/chunk-IZJYFVS7.mjs +15 -0
  13. package/dist/chunk-KQXLV6YW.mjs +489 -0
  14. package/dist/chunk-NEOSSUNE.mjs +599 -0
  15. package/dist/chunk-TE5JNR5C.mjs +117 -0
  16. package/dist/{chunk-IMN6FIOY.cjs → chunk-UHDBWDHS.cjs} +8 -5
  17. package/dist/{chunk-IQAZZPJD.cjs → chunk-V2OROE7H.cjs} +1 -1
  18. package/dist/chunk-XKIB3LSS.cjs +167 -0
  19. package/dist/chunk-YPQYI63K.cjs +249 -0
  20. package/dist/chunk-ZO3X2NDT.cjs +21 -0
  21. package/dist/highlight-cursor/enhanced-components.cjs +8 -8
  22. package/dist/highlight-cursor/enhanced-components.mjs +3 -3
  23. package/dist/highlight-cursor/index.cjs +12 -12
  24. package/dist/highlight-cursor/index.mjs +3 -3
  25. package/dist/index.cjs +430 -430
  26. package/dist/index.mjs +46 -46
  27. package/dist/ui/UIKitBadge.cjs +5 -5
  28. package/dist/ui/UIKitBadge.mjs +1 -1
  29. package/dist/ui/badge.d.cts +1 -1
  30. package/dist/ui/badge.d.ts +1 -1
  31. package/dist/ui/index.cjs +345 -345
  32. package/dist/ui/index.mjs +45 -45
  33. package/dist/ui/inputs/index.cjs +18 -18
  34. package/dist/ui/inputs/index.mjs +4 -4
  35. package/dist/ui/inputs/input.d.cts +1 -1
  36. package/dist/ui/inputs/input.d.ts +1 -1
  37. package/dist/ui/inputs/number-inputs/index.cjs +15 -15
  38. package/dist/ui/inputs/number-inputs/index.mjs +3 -3
  39. package/dist/ui/pagination.cjs +9 -9
  40. package/dist/ui/pagination.mjs +2 -2
  41. package/dist/ui/select.d.cts +1 -1
  42. package/dist/ui/select.d.ts +1 -1
  43. package/dist/ui/sidebar.cjs +26 -26
  44. package/dist/ui/sidebar.mjs +2 -2
  45. package/dist/ui/tabs.cjs +6 -6
  46. package/dist/ui/tabs.mjs +2 -2
  47. package/dist/ui/textarea.d.cts +1 -1
  48. package/dist/ui/textarea.d.ts +1 -1
  49. package/dist/ui/timeline.cjs +4 -4
  50. package/dist/ui/timeline.mjs +3 -3
  51. package/dist/ui/tree-view/TreeView.cjs +3 -3
  52. package/dist/ui/tree-view/TreeView.mjs +1 -1
  53. package/dist/ui/tree-view/index.cjs +3 -3
  54. package/dist/ui/tree-view/index.mjs +1 -1
  55. package/dist/ui/tree-view-legacy.cjs +6 -6
  56. package/dist/ui/tree-view-legacy.mjs +2 -2
  57. package/dist/ui/waterfall/index.cjs +8 -8
  58. package/dist/ui/waterfall/index.mjs +7 -7
  59. package/package.json +1 -1
@@ -0,0 +1,99 @@
1
+ 'use strict';
2
+
3
+ var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
4
+ var lucideReact = require('lucide-react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ var PACKAGE_VERSION = "0.0.75" ;
8
+ var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
9
+ var GIT_HASH = "f5eb08c" ;
10
+ function PackageBadge({
11
+ className,
12
+ packageName,
13
+ packageFullName,
14
+ versionText,
15
+ linkable = true,
16
+ gitHash
17
+ }) {
18
+ const npmUrl = packageFullName && versionText ? `https://www.npmjs.com/package/${packageFullName}/v/${versionText.replace("v", "")}` : void 0;
19
+ return /* @__PURE__ */ jsxRuntime.jsxs(
20
+ "div",
21
+ {
22
+ className: `rounded-uk-xs rounded-r-uk-xs text-uk-sm bg-icon-withbg inline-flex items-center ${className || ""}`,
23
+ style: linkable ? { cursor: "pointer" } : void 0,
24
+ children: [
25
+ (packageName || versionText) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-uk-xs inline-flex items-center overflow-hidden", children: [
26
+ packageName && /* @__PURE__ */ jsxRuntime.jsx(
27
+ "span",
28
+ {
29
+ className: "pl-sm pr-xs py-xxxs bg-brand-primary text-text-withbg text-uk-xs",
30
+ style: {
31
+ backgroundColor: "var(--color-brand-primary, var(--brand-primary))",
32
+ color: "white",
33
+ textShadow: "0 1px 2px rgba(0, 0, 0, 0.3), inset 0 -1px 0 rgba(255, 255, 255, 0.1)"
34
+ },
35
+ children: packageName
36
+ }
37
+ ),
38
+ versionText && /* @__PURE__ */ jsxRuntime.jsx(
39
+ "a",
40
+ {
41
+ href: linkable && npmUrl ? npmUrl : void 0,
42
+ className: chunkOHIB3TEN_cjs.cn(
43
+ "pl-xs pr-sm py-xxxs rounded-r-uk-xs",
44
+ "bg-alt-primary",
45
+ "text-text-secondary",
46
+ "text-text-primary text-uk-xs",
47
+ linkable && "hover:text-brand-primary"
48
+ ),
49
+ style: {
50
+ textShadow: "0 1px 1px rgba(0, 0, 0, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.05)"
51
+ },
52
+ onClick: !linkable ? (e) => e.preventDefault() : void 0,
53
+ children: versionText
54
+ }
55
+ )
56
+ ] }),
57
+ gitHash && gitHash !== "unknown" && /* @__PURE__ */ jsxRuntime.jsxs(
58
+ "a",
59
+ {
60
+ href: linkable ? `https://github.com/vuer-ai/vuer-uikit/commit/${gitHash}` : void 0,
61
+ className: "px-md rounded-uk-ssx font-number-input text-text-tertiary text-uk-xs ml-[0px] bg-transparent py-[0px]",
62
+ onClick: !linkable ? (e) => e.preventDefault() : void 0,
63
+ children: [
64
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GitBranch, { className: "mr-[2px] inline-block size-2" }),
65
+ gitHash
66
+ ]
67
+ }
68
+ )
69
+ ]
70
+ }
71
+ );
72
+ }
73
+ function UIKitBadge({
74
+ className,
75
+ package: showPackage = false,
76
+ prefix = false,
77
+ linkable = false,
78
+ version = false,
79
+ hash = false
80
+ }) {
81
+ const packageShortName = PACKAGE_NAME.split("/").pop() || PACKAGE_NAME;
82
+ const versionText = version ? prefix ? `v${PACKAGE_VERSION}` : PACKAGE_VERSION : void 0;
83
+ return /* @__PURE__ */ jsxRuntime.jsx(
84
+ PackageBadge,
85
+ {
86
+ className,
87
+ packageName: showPackage ? packageShortName : void 0,
88
+ packageFullName: PACKAGE_NAME,
89
+ versionText,
90
+ linkable,
91
+ gitHash: hash ? GIT_HASH : void 0
92
+ }
93
+ );
94
+ }
95
+
96
+ exports.GIT_HASH = GIT_HASH;
97
+ exports.PACKAGE_VERSION = PACKAGE_VERSION;
98
+ exports.PackageBadge = PackageBadge;
99
+ exports.UIKitBadge = UIKitBadge;
@@ -4,7 +4,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
4
4
 
5
5
  var PACKAGE_VERSION = "0.0.76" ;
6
6
  var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
7
- var GIT_HASH = "9073cde" ;
7
+ var GIT_HASH = "d181b80" ;
8
8
  function PackageBadge({
9
9
  className,
10
10
  packageName,
@@ -57,6 +57,9 @@ function TreeEntryItem({
57
57
  onSelectChange(selectedItemId === item.id ? null : item.id);
58
58
  }
59
59
  };
60
+ const ancestors = item.ancestors || [];
61
+ const indent = item.indent || 0;
62
+ const isLast = item.isLast !== void 0 ? item.isLast : false;
60
63
  return /* @__PURE__ */ jsxs(
61
64
  "div",
62
65
  {
@@ -72,7 +75,7 @@ function TreeEntryItem({
72
75
  onClick: handleItemSelect,
73
76
  children: [
74
77
  /* @__PURE__ */ jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
75
- item.ancestors.map((ancestor, index) => {
78
+ ancestors.map((ancestor, index) => {
76
79
  const parentIsLast = dataWithMeta.find((d) => d.id === ancestor.id)?.isLast;
77
80
  return /* @__PURE__ */ jsx(
78
81
  "div",
@@ -86,25 +89,25 @@ function TreeEntryItem({
86
89
  index
87
90
  );
88
91
  }),
89
- item.indent > 0 && /* @__PURE__ */ jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
92
+ indent > 0 && /* @__PURE__ */ jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
90
93
  /* @__PURE__ */ jsx(
91
94
  "div",
92
95
  {
93
96
  className: cn(
94
97
  "absolute top-0 left-0 h-1/2 w-1/2 border-b border-l",
95
- item.isLast ? "rounded-bl-md" : "",
98
+ isLast ? "rounded-bl-md" : "",
96
99
  "border-line-primary"
97
100
  )
98
101
  }
99
102
  ),
100
- !item.isLast && /* @__PURE__ */ jsx("div", { className: "border-line-primary absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
103
+ !isLast && /* @__PURE__ */ jsx("div", { className: "border-line-primary absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
101
104
  ] })
102
105
  ] }),
103
106
  /* @__PURE__ */ jsxs(
104
107
  "div",
105
108
  {
106
109
  className: "text-uk-md z-10 flex w-full items-center justify-between gap-2 px-2 whitespace-nowrap",
107
- style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
110
+ style: { paddingLeft: `${indent * 1.25 + 0.5}rem` },
108
111
  children: [
109
112
  /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
110
113
  alwaysShowExpand && hasDescendants(item.id) && !expandedItems.has(item.id) ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -0,0 +1,494 @@
1
+ 'use strict';
2
+
3
+ var chunkVBBJSIY7_cjs = require('./chunk-VBBJSIY7.cjs');
4
+ var chunkLCCNBVKZ_cjs = require('./chunk-LCCNBVKZ.cjs');
5
+ var chunkYQCSEMRB_cjs = require('./chunk-YQCSEMRB.cjs');
6
+ var chunkOHIB3TEN_cjs = require('./chunk-OHIB3TEN.cjs');
7
+ var lucideReact = require('lucide-react');
8
+ var react = require('react');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ function TreeView({
12
+ data,
13
+ getIcon,
14
+ onVisibleDataChange,
15
+ onItemHover,
16
+ className,
17
+ hoveredId,
18
+ isSelectable = false,
19
+ selectedItemId,
20
+ onSelectChange,
21
+ isSearchable = true,
22
+ alwaysShowExpand = false,
23
+ useSyncScroll = false,
24
+ // External search state props
25
+ searchQuery: externalSearchQuery,
26
+ onSearchQueryChange: externalOnSearchQueryChange,
27
+ isCaseSensitive: externalIsCaseSensitive,
28
+ onIsCaseSensitiveChange: externalOnIsCaseSensitiveChange,
29
+ isRegex: externalIsRegex,
30
+ onIsRegexChange: externalOnIsRegexChange
31
+ }) {
32
+ const [expandedItems, setExpandedItems] = react.useState(() => {
33
+ const initial = /* @__PURE__ */ new Set();
34
+ data.forEach((item) => {
35
+ if (item.isCollapsible) initial.add(item.id);
36
+ });
37
+ return initial;
38
+ });
39
+ const [internalSearchQuery, setInternalSearchQuery] = react.useState("");
40
+ const [internalIsCaseSensitive, setInternalIsCaseSensitive] = react.useState(false);
41
+ const [internalIsRegex, setInternalIsRegex] = react.useState(false);
42
+ const [isRegexValid, setIsRegexValid] = react.useState(true);
43
+ const searchQuery = externalSearchQuery ?? internalSearchQuery;
44
+ const setSearchQuery = externalOnSearchQueryChange ?? setInternalSearchQuery;
45
+ const isCaseSensitive = externalIsCaseSensitive ?? internalIsCaseSensitive;
46
+ const isRegex = externalIsRegex ?? internalIsRegex;
47
+ const setIsCaseSensitive = (value) => {
48
+ if (externalOnIsCaseSensitiveChange) {
49
+ externalOnIsCaseSensitiveChange(value);
50
+ } else {
51
+ setInternalIsCaseSensitive(value);
52
+ }
53
+ };
54
+ const setIsRegex = (value) => {
55
+ if (externalOnIsRegexChange) {
56
+ externalOnIsRegexChange(value);
57
+ } else {
58
+ setInternalIsRegex(value);
59
+ }
60
+ };
61
+ const toggleItem = (id) => {
62
+ setExpandedItems((prev) => {
63
+ const newSet = new Set(prev);
64
+ if (newSet.has(id)) {
65
+ newSet.delete(id);
66
+ } else {
67
+ newSet.add(id);
68
+ }
69
+ return newSet;
70
+ });
71
+ };
72
+ const handleItemSelect = (id) => {
73
+ if (isSelectable && onSelectChange) {
74
+ onSelectChange(selectedItemId === id ? null : id);
75
+ }
76
+ };
77
+ const hasDescendants = (itemId) => {
78
+ return (childrenMap.get(itemId) || []).length > 0;
79
+ };
80
+ const childrenMap = react.useMemo(() => {
81
+ const map = /* @__PURE__ */ new Map();
82
+ data.forEach((item) => {
83
+ if (!map.has(item.parentId)) {
84
+ map.set(item.parentId, []);
85
+ }
86
+ map.get(item.parentId).push(item);
87
+ });
88
+ return map;
89
+ }, [data]);
90
+ const dataWithMeta = react.useMemo(() => {
91
+ const dataMap = new Map(data.map((item) => [item.id, item]));
92
+ const getAncestors = (item) => {
93
+ const ancestors = [];
94
+ let current = item.parentId;
95
+ while (current) {
96
+ const parent = dataMap.get(current);
97
+ if (parent) {
98
+ ancestors.unshift(parent);
99
+ current = parent.parentId;
100
+ } else {
101
+ break;
102
+ }
103
+ }
104
+ return ancestors;
105
+ };
106
+ const sortedData = [];
107
+ const visited = /* @__PURE__ */ new Set();
108
+ const traverseNode = (nodeId, depth = 0) => {
109
+ const children = childrenMap.get(nodeId) || [];
110
+ children.forEach((child) => {
111
+ if (!visited.has(child.id)) {
112
+ visited.add(child.id);
113
+ sortedData.push(child);
114
+ traverseNode(child.id, depth + 1);
115
+ }
116
+ });
117
+ };
118
+ traverseNode(null);
119
+ return sortedData.map((item) => {
120
+ const siblings = childrenMap.get(item.parentId) || [];
121
+ const isLast = siblings.length > 0 && siblings[siblings.length - 1].id === item.id;
122
+ const ancestors = getAncestors(item);
123
+ const indent = ancestors.length;
124
+ return { ...item, indent, isLast, ancestors };
125
+ });
126
+ }, [data, childrenMap]);
127
+ const visibleData = react.useMemo(() => {
128
+ const dataMap = new Map(data.map((item) => [item.id, item]));
129
+ if (!searchQuery) {
130
+ const isVisible = (item) => {
131
+ return item.ancestors.every((ancestor) => expandedItems.has(ancestor.id));
132
+ };
133
+ return dataWithMeta.filter(isVisible);
134
+ }
135
+ const matchingAndAncestorIds = /* @__PURE__ */ new Set();
136
+ let regex = null;
137
+ if (isRegex) {
138
+ try {
139
+ regex = new RegExp(searchQuery, isCaseSensitive ? "" : "i");
140
+ if (!isRegexValid) setIsRegexValid(true);
141
+ } catch {
142
+ if (isRegexValid) setIsRegexValid(false);
143
+ return [];
144
+ }
145
+ }
146
+ data.forEach((item) => {
147
+ let labelMatches = false;
148
+ if (regex) {
149
+ labelMatches = regex.test(item.label);
150
+ } else {
151
+ const source = isCaseSensitive ? item.label : item.label.toLowerCase();
152
+ const query = isCaseSensitive ? searchQuery : searchQuery.toLowerCase();
153
+ labelMatches = source.includes(query);
154
+ }
155
+ if (labelMatches) {
156
+ matchingAndAncestorIds.add(item.id);
157
+ let current = item.parentId;
158
+ while (current) {
159
+ const parent = dataMap.get(current);
160
+ if (parent) {
161
+ matchingAndAncestorIds.add(parent.id);
162
+ current = parent.parentId;
163
+ } else {
164
+ break;
165
+ }
166
+ }
167
+ }
168
+ });
169
+ return dataWithMeta.filter((item) => matchingAndAncestorIds.has(item.id));
170
+ }, [searchQuery, dataWithMeta, expandedItems, isCaseSensitive, isRegex, isRegexValid, data]);
171
+ const searchResultsCount = react.useMemo(() => {
172
+ if (!searchQuery || !isRegexValid) return 0;
173
+ let count = 0;
174
+ let regex = null;
175
+ if (isRegex) {
176
+ try {
177
+ regex = new RegExp(searchQuery, isCaseSensitive ? "" : "i");
178
+ } catch {
179
+ return 0;
180
+ }
181
+ }
182
+ data.forEach((item) => {
183
+ let labelMatches = false;
184
+ if (regex) {
185
+ labelMatches = regex.test(item.label);
186
+ } else {
187
+ const source = isCaseSensitive ? item.label : item.label.toLowerCase();
188
+ const query = isCaseSensitive ? searchQuery : searchQuery.toLowerCase();
189
+ labelMatches = source.includes(query);
190
+ }
191
+ if (labelMatches) {
192
+ count++;
193
+ }
194
+ });
195
+ return count;
196
+ }, [searchQuery, data, isCaseSensitive, isRegex, isRegexValid]);
197
+ react.useEffect(() => {
198
+ onVisibleDataChange?.(visibleData);
199
+ }, [visibleData, onVisibleDataChange]);
200
+ const renderLabel = (label) => {
201
+ if (!searchQuery || !isRegexValid) {
202
+ return label;
203
+ }
204
+ let regex;
205
+ try {
206
+ regex = new RegExp(`(${searchQuery})`, isCaseSensitive ? "g" : "gi");
207
+ } catch {
208
+ return label;
209
+ }
210
+ const parts = label.split(regex);
211
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map(
212
+ (part, i) => i % 2 === 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-uk-xs bg-accent-warning", children: part }, i) : part
213
+ ) });
214
+ };
215
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkOHIB3TEN_cjs.cn("flex flex-col", className), children: [
216
+ isSearchable && /* @__PURE__ */ jsxRuntime.jsx(
217
+ TreeSearchBar,
218
+ {
219
+ searchQuery,
220
+ setSearchQuery,
221
+ isCaseSensitive,
222
+ setIsCaseSensitive,
223
+ isRegex,
224
+ setIsRegex,
225
+ isRegexValid,
226
+ searchResultsCount
227
+ }
228
+ ),
229
+ /* @__PURE__ */ jsxRuntime.jsx(
230
+ TreeEntries,
231
+ {
232
+ visibleData,
233
+ hoveredId,
234
+ onItemHover,
235
+ isSelectable,
236
+ selectedItemId,
237
+ handleItemSelect,
238
+ expandedItems,
239
+ toggleItem,
240
+ alwaysShowExpand,
241
+ hasDescendants,
242
+ getIcon,
243
+ renderLabel,
244
+ dataWithMeta,
245
+ useSyncScroll
246
+ }
247
+ )
248
+ ] });
249
+ }
250
+ function TreeSearchBar({
251
+ searchQuery,
252
+ setSearchQuery,
253
+ isCaseSensitive,
254
+ setIsCaseSensitive,
255
+ isRegex,
256
+ setIsRegex,
257
+ isRegexValid,
258
+ searchResultsCount
259
+ }) {
260
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "shrink-0", children: [
261
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1 py-1", children: /* @__PURE__ */ jsxRuntime.jsxs(
262
+ chunkYQCSEMRB_cjs.InputRoot,
263
+ {
264
+ type: "text",
265
+ placeholder: "Search...",
266
+ size: "md",
267
+ className: "flex-1",
268
+ inputClassName: chunkOHIB3TEN_cjs.cn(!isRegexValid && "text-red-500"),
269
+ value: searchQuery,
270
+ onChange: (e) => setSearchQuery(e.target.value),
271
+ children: [
272
+ /* @__PURE__ */ jsxRuntime.jsx(chunkYQCSEMRB_cjs.InputSlot, { side: "left", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "text-text-secondary size-4 stroke-1" }) }),
273
+ /* @__PURE__ */ jsxRuntime.jsx(chunkYQCSEMRB_cjs.InputSlot, { side: "right", children: /* @__PURE__ */ jsxRuntime.jsxs(chunkLCCNBVKZ_cjs.TooltipProvider, { delayDuration: 200, children: [
274
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkLCCNBVKZ_cjs.Tooltip, { children: [
275
+ /* @__PURE__ */ jsxRuntime.jsx(chunkLCCNBVKZ_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
276
+ "button",
277
+ {
278
+ onClick: () => setIsCaseSensitive((prev) => !prev),
279
+ className: chunkOHIB3TEN_cjs.cn(
280
+ "rounded-uk-sm mr-1 p-1",
281
+ isCaseSensitive ? "bg-shadow-secondary" : ""
282
+ ),
283
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CaseSensitive, { className: "size-4" })
284
+ }
285
+ ) }),
286
+ /* @__PURE__ */ jsxRuntime.jsx(chunkLCCNBVKZ_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Case Sensitive" }) })
287
+ ] }),
288
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkLCCNBVKZ_cjs.Tooltip, { children: [
289
+ /* @__PURE__ */ jsxRuntime.jsx(chunkLCCNBVKZ_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
290
+ "button",
291
+ {
292
+ onClick: () => setIsRegex((prev) => !prev),
293
+ className: chunkOHIB3TEN_cjs.cn("rounded-uk-sm p-1", isRegex && "bg-shadow-secondary"),
294
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Regex, { className: "size-4" })
295
+ }
296
+ ) }),
297
+ /* @__PURE__ */ jsxRuntime.jsx(chunkLCCNBVKZ_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Use Regular Expression" }) })
298
+ ] })
299
+ ] }) })
300
+ ]
301
+ }
302
+ ) }),
303
+ searchQuery && isRegexValid && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-end px-2 pb-1", children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-uk-xs text-text-secondary", children: [
304
+ searchResultsCount,
305
+ " result",
306
+ searchResultsCount !== 1 ? "s" : ""
307
+ ] }) })
308
+ ] });
309
+ }
310
+ function TreeEntryItem({
311
+ item,
312
+ hoveredId,
313
+ onItemHover,
314
+ isSelectable,
315
+ selectedItemId,
316
+ handleItemSelect,
317
+ expandedItems,
318
+ toggleItem,
319
+ alwaysShowExpand,
320
+ hasDescendants,
321
+ getIcon,
322
+ renderLabel,
323
+ dataWithMeta
324
+ }) {
325
+ return /* @__PURE__ */ jsxRuntime.jsxs(
326
+ "div",
327
+ {
328
+ className: chunkOHIB3TEN_cjs.cn(
329
+ "group relative flex h-[32px] items-center",
330
+ isSelectable && "rounded-uk-md",
331
+ !item.disable && "cursor-pointer",
332
+ hoveredId === item.id && !item.disable && "bg-bg-secondary",
333
+ isSelectable && selectedItemId === item.id && "bg-brand-primary text-text-withbg"
334
+ ),
335
+ onMouseEnter: () => onItemHover?.(item.id),
336
+ onMouseLeave: () => onItemHover?.(null),
337
+ onClick: () => !item.disable && handleItemSelect(item.id),
338
+ children: [
339
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
340
+ item.ancestors.map((ancestor, index) => {
341
+ const parentIsLast = dataWithMeta.find((d) => d.id === ancestor.id)?.isLast;
342
+ return /* @__PURE__ */ jsxRuntime.jsx(
343
+ "div",
344
+ {
345
+ className: chunkOHIB3TEN_cjs.cn(
346
+ "h-full w-[1.25rem]",
347
+ parentIsLast ? "" : "border-l",
348
+ "border-line-primary"
349
+ )
350
+ },
351
+ index
352
+ );
353
+ }),
354
+ item.indent > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
355
+ /* @__PURE__ */ jsxRuntime.jsx(
356
+ "div",
357
+ {
358
+ className: chunkOHIB3TEN_cjs.cn(
359
+ "absolute top-0 left-0 h-1/2 w-1/2 border-b border-l",
360
+ item.isLast ? "rounded-bl-md" : "",
361
+ "border-line-primary"
362
+ )
363
+ }
364
+ ),
365
+ !item.isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-line-primary absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
366
+ ] })
367
+ ] }),
368
+ /* @__PURE__ */ jsxRuntime.jsxs(
369
+ "div",
370
+ {
371
+ className: "text-uk-md z-10 flex w-full items-center justify-between gap-2 px-2 whitespace-nowrap",
372
+ style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
373
+ children: [
374
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
375
+ alwaysShowExpand && hasDescendants(item.id) && !expandedItems.has(item.id) ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
376
+ /* @__PURE__ */ jsxRuntime.jsx(
377
+ "button",
378
+ {
379
+ onClick: (e) => {
380
+ e.stopPropagation();
381
+ toggleItem(item.id);
382
+ },
383
+ className: "flex size-4 cursor-pointer items-center justify-center",
384
+ children: /* @__PURE__ */ jsxRuntime.jsx(
385
+ lucideReact.ChevronDown,
386
+ {
387
+ className: chunkOHIB3TEN_cjs.cn(
388
+ "size-4 -rotate-90 transition-transform",
389
+ item.disable && "text-icon-tertiary"
390
+ )
391
+ }
392
+ )
393
+ }
394
+ ),
395
+ /* @__PURE__ */ jsxRuntime.jsx(
396
+ "div",
397
+ {
398
+ className: chunkOHIB3TEN_cjs.cn(
399
+ "flex size-4 items-center justify-center",
400
+ item.disable && "text-icon-tertiary"
401
+ ),
402
+ children: getIcon(item)
403
+ }
404
+ )
405
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
406
+ item.isCollapsible && /* @__PURE__ */ jsxRuntime.jsx(
407
+ "button",
408
+ {
409
+ onClick: (e) => {
410
+ e.stopPropagation();
411
+ toggleItem(item.id);
412
+ },
413
+ className: "absolute z-20 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
414
+ children: /* @__PURE__ */ jsxRuntime.jsx(
415
+ lucideReact.ChevronDown,
416
+ {
417
+ className: chunkOHIB3TEN_cjs.cn(
418
+ "size-4 transition-transform",
419
+ !expandedItems.has(item.id) && "-rotate-90",
420
+ item.disable && "text-icon-tertiary"
421
+ )
422
+ }
423
+ )
424
+ }
425
+ ),
426
+ /* @__PURE__ */ jsxRuntime.jsx(
427
+ "div",
428
+ {
429
+ className: chunkOHIB3TEN_cjs.cn(
430
+ "cursor-pointer transition-opacity",
431
+ item.isCollapsible && "group-hover:opacity-0",
432
+ item.disable && "text-icon-tertiary"
433
+ ),
434
+ children: getIcon(item)
435
+ }
436
+ )
437
+ ] }),
438
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkOHIB3TEN_cjs.cn("truncate", item.disable && "text-text-tertiary"), children: renderLabel(item.label) })
439
+ ] }),
440
+ item.actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: item.actions })
441
+ ]
442
+ }
443
+ )
444
+ ]
445
+ },
446
+ item.id
447
+ );
448
+ }
449
+ function TreeEntries({
450
+ visibleData,
451
+ hoveredId,
452
+ onItemHover,
453
+ isSelectable,
454
+ selectedItemId,
455
+ handleItemSelect,
456
+ expandedItems,
457
+ toggleItem,
458
+ alwaysShowExpand,
459
+ hasDescendants,
460
+ getIcon,
461
+ renderLabel,
462
+ dataWithMeta,
463
+ useSyncScroll = false,
464
+ className
465
+ }) {
466
+ const content = visibleData.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
467
+ TreeEntryItem,
468
+ {
469
+ item,
470
+ hoveredId,
471
+ onItemHover,
472
+ isSelectable,
473
+ selectedItemId,
474
+ handleItemSelect,
475
+ expandedItems,
476
+ toggleItem,
477
+ alwaysShowExpand,
478
+ hasDescendants,
479
+ getIcon,
480
+ renderLabel,
481
+ dataWithMeta
482
+ },
483
+ item.id
484
+ ));
485
+ if (useSyncScroll) {
486
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkVBBJSIY7_cjs.SyncScroll, { className: chunkOHIB3TEN_cjs.cn("scrollbar-track-transparent flex-1", className), children: content });
487
+ }
488
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkOHIB3TEN_cjs.cn("flex-1 overflow-y-auto", className), children: content });
489
+ }
490
+
491
+ exports.TreeEntries = TreeEntries;
492
+ exports.TreeEntryItem = TreeEntryItem;
493
+ exports.TreeSearchBar = TreeSearchBar;
494
+ exports.TreeView = TreeView;