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