@vuer-ai/vuer-uikit 0.0.66 → 0.0.68

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 (228) hide show
  1. package/README.md +4 -4
  2. package/dist/SyncScroll/SyncScroll.cjs +15 -12
  3. package/dist/SyncScroll/SyncScroll.mjs +9 -6
  4. package/dist/SyncScroll/index.cjs +15 -12
  5. package/dist/SyncScroll/index.mjs +9 -6
  6. package/dist/{chunk-UGIIFY42.mjs → chunk-3QT5VABC.mjs} +1 -0
  7. package/dist/chunk-3ZOVTCPN.cjs +171 -0
  8. package/dist/{chunk-4WSB6SKT.mjs → chunk-4MW4SKOD.mjs} +17 -25
  9. package/dist/chunk-6BOWMGFG.cjs +69 -0
  10. package/dist/{chunk-MPF74YSO.cjs → chunk-7WO5ATT3.cjs} +1 -1
  11. package/dist/{chunk-YO34TYBG.cjs → chunk-BIG2DXM3.cjs} +3 -3
  12. package/dist/chunk-BZS2B2V4.cjs +294 -0
  13. package/dist/{chunk-MPB4237J.mjs → chunk-CGFJLQRG.mjs} +5 -1
  14. package/dist/{chunk-4DPLDAHW.cjs → chunk-D6326INV.cjs} +5 -1
  15. package/dist/chunk-DSWSIBVQ.cjs +100 -0
  16. package/dist/{chunk-CEHN5RWA.mjs → chunk-DWU32IXO.mjs} +1 -1
  17. package/dist/chunk-ES4LBRHV.mjs +18 -0
  18. package/dist/chunk-EWAKGFQG.mjs +200 -0
  19. package/dist/{chunk-5RQE4EDL.mjs → chunk-HAN5TKHH.mjs} +1 -1
  20. package/dist/chunk-I5XHCZDG.mjs +853 -0
  21. package/dist/chunk-IZARTVYN.mjs +67 -0
  22. package/dist/chunk-JR4TVE43.cjs +31 -0
  23. package/dist/chunk-KC7D4OEU.cjs +224 -0
  24. package/dist/chunk-KNH5OI32.mjs +161 -0
  25. package/dist/{chunk-QESAYFKT.cjs → chunk-LH5AV54U.cjs} +17 -25
  26. package/dist/{chunk-BN7JFMO6.cjs → chunk-LUAVB7SY.cjs} +3 -3
  27. package/dist/chunk-MTB2EWG2.mjs +26 -0
  28. package/dist/chunk-NJEIDGQY.cjs +20 -0
  29. package/dist/chunk-NWA32DT2.cjs +28 -0
  30. package/dist/{chunk-DI43KCLF.mjs → chunk-PIRVEHSD.mjs} +3 -3
  31. package/dist/chunk-PWOICFNA.cjs +269 -0
  32. package/dist/{chunk-B4UCHLYR.cjs → chunk-Q7E73DVJ.cjs} +1 -0
  33. package/dist/chunk-QCD2WTD3.mjs +98 -0
  34. package/dist/chunk-QFMQNY4G.cjs +20 -0
  35. package/dist/chunk-RHX3D3GE.mjs +18 -0
  36. package/dist/chunk-UFNFQMRO.cjs +41 -0
  37. package/dist/{chunk-2XRTRMJT.cjs → chunk-WRR5LMHR.cjs} +11 -11
  38. package/dist/chunk-XHJDRQD7.mjs +29 -0
  39. package/dist/{chunk-ICPSHW4S.mjs → chunk-YGNSDC5I.mjs} +2 -2
  40. package/dist/chunk-YTM334QC.mjs +243 -0
  41. package/dist/chunk-ZC2T7IM5.cjs +855 -0
  42. package/dist/chunk-ZCSTMP5D.mjs +39 -0
  43. package/dist/chunk-ZPRXGADK.mjs +292 -0
  44. package/dist/highlight-cursor/enhanced-components.cjs +8 -5
  45. package/dist/highlight-cursor/enhanced-components.mjs +8 -5
  46. package/dist/highlight-cursor/index.cjs +8 -5
  47. package/dist/highlight-cursor/index.mjs +8 -5
  48. package/dist/hooks/index.cjs +26 -11
  49. package/dist/hooks/index.d.cts +3 -0
  50. package/dist/hooks/index.d.ts +3 -0
  51. package/dist/hooks/index.mjs +8 -5
  52. package/dist/hooks/useDocument.cjs +2 -2
  53. package/dist/hooks/useDocument.mjs +1 -1
  54. package/dist/hooks/useDragSelect.cjs +2 -2
  55. package/dist/hooks/useDragSelect.mjs +1 -1
  56. package/dist/hooks/useIsMobile.cjs +10 -0
  57. package/dist/hooks/useIsMobile.mjs +1 -0
  58. package/dist/hooks/useLocalStorage.cjs +2 -2
  59. package/dist/hooks/useLocalStorage.mjs +1 -1
  60. package/dist/hooks/useLocation.cjs +10 -0
  61. package/dist/hooks/useLocation.d.cts +14 -0
  62. package/dist/hooks/useLocation.d.ts +14 -0
  63. package/dist/hooks/useLocation.mjs +1 -0
  64. package/dist/hooks/useQueryParams.cjs +12 -0
  65. package/dist/hooks/useQueryParams.d.cts +3 -0
  66. package/dist/hooks/useQueryParams.d.ts +3 -0
  67. package/dist/hooks/useQueryParams.mjs +3 -0
  68. package/dist/hooks/useWindow.cjs +2 -2
  69. package/dist/hooks/useWindow.d.cts +1 -1
  70. package/dist/hooks/useWindow.d.ts +1 -1
  71. package/dist/hooks/useWindow.mjs +1 -1
  72. package/dist/index.cjs +321 -271
  73. package/dist/index.d.cts +5 -1
  74. package/dist/index.d.ts +5 -1
  75. package/dist/index.mjs +35 -33
  76. package/dist/ui/avatar.cjs +8 -5
  77. package/dist/ui/avatar.mjs +8 -5
  78. package/dist/ui/badge.cjs +8 -5
  79. package/dist/ui/badge.d.cts +2 -2
  80. package/dist/ui/badge.d.ts +2 -2
  81. package/dist/ui/badge.mjs +8 -5
  82. package/dist/ui/button.cjs +8 -5
  83. package/dist/ui/button.mjs +8 -5
  84. package/dist/ui/card.cjs +8 -5
  85. package/dist/ui/card.mjs +8 -5
  86. package/dist/ui/checkbox.cjs +8 -5
  87. package/dist/ui/checkbox.mjs +8 -5
  88. package/dist/ui/collapsible.cjs +8 -5
  89. package/dist/ui/collapsible.mjs +8 -5
  90. package/dist/ui/color-input.cjs +8 -5
  91. package/dist/ui/color-input.mjs +8 -5
  92. package/dist/ui/drawer.cjs +8 -5
  93. package/dist/ui/drawer.mjs +8 -5
  94. package/dist/ui/dropdown.cjs +8 -5
  95. package/dist/ui/dropdown.mjs +8 -5
  96. package/dist/ui/form/CmInput.cjs +8 -5
  97. package/dist/ui/form/CmInput.mjs +8 -5
  98. package/dist/ui/form/DegInput.cjs +8 -5
  99. package/dist/ui/form/DegInput.mjs +8 -5
  100. package/dist/ui/form/EulerDegInput.cjs +8 -5
  101. package/dist/ui/form/EulerDegInput.mjs +8 -5
  102. package/dist/ui/form/EulerInput.cjs +8 -5
  103. package/dist/ui/form/EulerInput.mjs +8 -5
  104. package/dist/ui/form/EulerRadInput.cjs +8 -5
  105. package/dist/ui/form/EulerRadInput.mjs +8 -5
  106. package/dist/ui/form/InchInput.cjs +8 -5
  107. package/dist/ui/form/InchInput.mjs +8 -5
  108. package/dist/ui/form/IntInput.cjs +8 -5
  109. package/dist/ui/form/IntInput.mjs +8 -5
  110. package/dist/ui/form/KVectorInput.cjs +8 -5
  111. package/dist/ui/form/KVectorInput.mjs +8 -5
  112. package/dist/ui/form/NumberInput.cjs +8 -5
  113. package/dist/ui/form/NumberInput.mjs +8 -5
  114. package/dist/ui/form/QuaternionInput.cjs +8 -5
  115. package/dist/ui/form/QuaternionInput.mjs +8 -5
  116. package/dist/ui/form/RadInput.cjs +8 -5
  117. package/dist/ui/form/RadInput.mjs +8 -5
  118. package/dist/ui/form/TimeInput.cjs +8 -5
  119. package/dist/ui/form/TimeInput.mjs +8 -5
  120. package/dist/ui/form/Vec3Input.cjs +8 -5
  121. package/dist/ui/form/Vec3Input.mjs +8 -5
  122. package/dist/ui/form/VectorInput.cjs +8 -5
  123. package/dist/ui/form/VectorInput.mjs +8 -5
  124. package/dist/ui/form/index.cjs +28 -25
  125. package/dist/ui/form/index.mjs +12 -9
  126. package/dist/ui/index.cjs +296 -258
  127. package/dist/ui/index.d.cts +30 -5
  128. package/dist/ui/index.d.ts +30 -5
  129. package/dist/ui/index.mjs +34 -32
  130. package/dist/ui/input-numbers.cjs +8 -5
  131. package/dist/ui/input-numbers.mjs +8 -5
  132. package/dist/ui/input.cjs +8 -5
  133. package/dist/ui/input.d.cts +1 -1
  134. package/dist/ui/input.d.ts +1 -1
  135. package/dist/ui/input.mjs +8 -5
  136. package/dist/ui/label.cjs +8 -5
  137. package/dist/ui/label.mjs +8 -5
  138. package/dist/ui/layout.cjs +8 -5
  139. package/dist/ui/layout.mjs +8 -5
  140. package/dist/ui/layouts/dock-layout/DockLayoutView.cjs +11 -8
  141. package/dist/ui/layouts/dock-layout/DockLayoutView.mjs +10 -7
  142. package/dist/ui/layouts/dock-layout/LayoutSlots.cjs +15 -12
  143. package/dist/ui/layouts/dock-layout/LayoutSlots.mjs +9 -6
  144. package/dist/ui/layouts/dock-layout/index.cjs +17 -14
  145. package/dist/ui/layouts/dock-layout/index.mjs +10 -7
  146. package/dist/ui/layouts/index.cjs +18 -15
  147. package/dist/ui/layouts/index.mjs +11 -8
  148. package/dist/ui/layouts/liquid-layout/LayoutSlots.cjs +8 -5
  149. package/dist/ui/layouts/liquid-layout/LayoutSlots.mjs +8 -5
  150. package/dist/ui/layouts/liquid-layout/LiquidLayoutView.cjs +8 -5
  151. package/dist/ui/layouts/liquid-layout/LiquidLayoutView.mjs +8 -5
  152. package/dist/ui/layouts/liquid-layout/index.cjs +8 -5
  153. package/dist/ui/layouts/liquid-layout/index.mjs +8 -5
  154. package/dist/ui/modal.cjs +8 -5
  155. package/dist/ui/modal.mjs +8 -5
  156. package/dist/ui/pagination.cjs +8 -5
  157. package/dist/ui/pagination.mjs +8 -5
  158. package/dist/ui/panel.cjs +8 -5
  159. package/dist/ui/panel.mjs +8 -5
  160. package/dist/ui/popover.cjs +8 -5
  161. package/dist/ui/popover.mjs +8 -5
  162. package/dist/ui/presets-input.cjs +8 -5
  163. package/dist/ui/presets-input.mjs +8 -5
  164. package/dist/ui/radio-group.cjs +8 -5
  165. package/dist/ui/radio-group.mjs +8 -5
  166. package/dist/ui/resizable.cjs +8 -5
  167. package/dist/ui/resizable.mjs +8 -5
  168. package/dist/ui/select.cjs +8 -5
  169. package/dist/ui/select.d.cts +1 -1
  170. package/dist/ui/select.d.ts +1 -1
  171. package/dist/ui/select.mjs +8 -5
  172. package/dist/ui/separator.cjs +8 -5
  173. package/dist/ui/separator.mjs +8 -5
  174. package/dist/ui/sheet.cjs +8 -5
  175. package/dist/ui/sheet.mjs +8 -5
  176. package/dist/ui/sidebar.cjs +34 -32
  177. package/dist/ui/sidebar.d.cts +1 -1
  178. package/dist/ui/sidebar.d.ts +1 -1
  179. package/dist/ui/sidebar.mjs +10 -8
  180. package/dist/ui/skeleton.cjs +8 -5
  181. package/dist/ui/skeleton.mjs +8 -5
  182. package/dist/ui/slider.cjs +8 -5
  183. package/dist/ui/slider.mjs +8 -5
  184. package/dist/ui/switch.cjs +8 -5
  185. package/dist/ui/switch.mjs +8 -5
  186. package/dist/ui/tabs.cjs +8 -5
  187. package/dist/ui/tabs.mjs +8 -5
  188. package/dist/ui/textarea.cjs +8 -5
  189. package/dist/ui/textarea.d.cts +1 -1
  190. package/dist/ui/textarea.d.ts +1 -1
  191. package/dist/ui/textarea.mjs +8 -5
  192. package/dist/ui/theme/ThemeToggles.cjs +11 -8
  193. package/dist/ui/theme/ThemeToggles.mjs +9 -6
  194. package/dist/ui/theme/index.cjs +11 -8
  195. package/dist/ui/theme/index.mjs +9 -6
  196. package/dist/ui/timeline.cjs +11 -8
  197. package/dist/ui/timeline.mjs +10 -7
  198. package/dist/ui/toggle-buttons.cjs +14 -11
  199. package/dist/ui/toggle-buttons.mjs +9 -6
  200. package/dist/ui/toggle-group.cjs +12 -9
  201. package/dist/ui/toggle-group.mjs +9 -6
  202. package/dist/ui/toggle.cjs +8 -5
  203. package/dist/ui/toggle.mjs +8 -5
  204. package/dist/ui/toolbar.cjs +8 -5
  205. package/dist/ui/toolbar.mjs +8 -5
  206. package/dist/ui/tooltip.cjs +8 -5
  207. package/dist/ui/tooltip.mjs +8 -5
  208. package/dist/ui/tree-view-v2.cjs +10 -7
  209. package/dist/ui/tree-view-v2.mjs +9 -6
  210. package/dist/ui/tree-view.cjs +8 -5
  211. package/dist/ui/tree-view.mjs +8 -5
  212. package/dist/ui/version-badge.cjs +10 -7
  213. package/dist/ui/version-badge.mjs +9 -6
  214. package/package.json +2 -1
  215. package/dist/chunk-C7I2Y5NY.cjs +0 -16
  216. package/dist/chunk-IWH3T7TD.mjs +0 -48
  217. package/dist/chunk-LZPXMTJ7.cjs +0 -16
  218. package/dist/chunk-NXTGTCPA.mjs +0 -19
  219. package/dist/chunk-PR4VD5F2.mjs +0 -14
  220. package/dist/chunk-QG5Z4C65.mjs +0 -14
  221. package/dist/chunk-RFHOLY3Q.cjs +0 -41
  222. package/dist/chunk-Z3BZQSWV.cjs +0 -50
  223. package/dist/hooks/use-mobile.cjs +0 -10
  224. package/dist/hooks/use-mobile.mjs +0 -1
  225. /package/dist/{chunk-AYKQVWMR.mjs → chunk-F7ZHPSLA.mjs} +0 -0
  226. /package/dist/{chunk-5HZ6JUMF.cjs → chunk-QN4N4I3Z.cjs} +0 -0
  227. /package/dist/hooks/{use-mobile.d.cts → useIsMobile.d.cts} +0 -0
  228. /package/dist/hooks/{use-mobile.d.ts → useIsMobile.d.ts} +0 -0
@@ -0,0 +1,294 @@
1
+ 'use strict';
2
+
3
+ var chunkMKKH4EGP_cjs = require('./chunk-MKKH4EGP.cjs');
4
+ var chunkDWD754BX_cjs = require('./chunk-DWD754BX.cjs');
5
+ var lucideReact = require('lucide-react');
6
+ var react = require('react');
7
+ var jsxRuntime = require('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
+ }) {
21
+ const [expandedItems, setExpandedItems] = react.useState(() => {
22
+ const initial = /* @__PURE__ */ new Set();
23
+ data.forEach((item) => {
24
+ if (item.isCollapsible) initial.add(item.id);
25
+ });
26
+ return initial;
27
+ });
28
+ const [searchQuery, setSearchQuery] = react.useState("");
29
+ const [isCaseSensitive, setIsCaseSensitive] = react.useState(false);
30
+ const [isRegex, setIsRegex] = react.useState(false);
31
+ const [isRegexValid, setIsRegexValid] = react.useState(true);
32
+ const toggleItem = (id) => {
33
+ setExpandedItems((prev) => {
34
+ const newSet = new Set(prev);
35
+ if (newSet.has(id)) {
36
+ newSet.delete(id);
37
+ } else {
38
+ newSet.add(id);
39
+ }
40
+ return newSet;
41
+ });
42
+ };
43
+ const handleItemSelect = (id) => {
44
+ if (isSelectable && onSelectChange) {
45
+ onSelectChange(selectedItemId === id ? null : id);
46
+ }
47
+ };
48
+ const childrenMap = react.useMemo(() => {
49
+ const map = /* @__PURE__ */ new Map();
50
+ data.forEach((item) => {
51
+ if (!map.has(item.parentId)) {
52
+ map.set(item.parentId, []);
53
+ }
54
+ map.get(item.parentId).push(item);
55
+ });
56
+ return map;
57
+ }, [data]);
58
+ const dataWithMeta = react.useMemo(() => {
59
+ const dataMap = new Map(data.map((item) => [item.id, item]));
60
+ const getAncestors = (item) => {
61
+ const ancestors = [];
62
+ let current = item.parentId;
63
+ while (current) {
64
+ const parent = dataMap.get(current);
65
+ if (parent) {
66
+ ancestors.unshift(parent);
67
+ current = parent.parentId;
68
+ } else {
69
+ break;
70
+ }
71
+ }
72
+ return ancestors;
73
+ };
74
+ const sortedData = [];
75
+ const visited = /* @__PURE__ */ new Set();
76
+ const traverseNode = (nodeId, depth = 0) => {
77
+ const children = childrenMap.get(nodeId) || [];
78
+ children.forEach((child) => {
79
+ if (!visited.has(child.id)) {
80
+ visited.add(child.id);
81
+ sortedData.push(child);
82
+ traverseNode(child.id, depth + 1);
83
+ }
84
+ });
85
+ };
86
+ traverseNode(null);
87
+ return sortedData.map((item) => {
88
+ const siblings = childrenMap.get(item.parentId) || [];
89
+ const isLast = siblings.length > 0 && siblings[siblings.length - 1].id === item.id;
90
+ const ancestors = getAncestors(item);
91
+ const indent = ancestors.length;
92
+ return { ...item, indent, isLast, ancestors };
93
+ });
94
+ }, [data, childrenMap]);
95
+ const visibleData = react.useMemo(() => {
96
+ const dataMap = new Map(data.map((item) => [item.id, item]));
97
+ if (!searchQuery) {
98
+ const isVisible = (item) => {
99
+ return item.ancestors.every((ancestor) => expandedItems.has(ancestor.id));
100
+ };
101
+ return dataWithMeta.filter(isVisible);
102
+ }
103
+ const matchingAndAncestorIds = /* @__PURE__ */ new Set();
104
+ let regex = null;
105
+ if (isRegex) {
106
+ try {
107
+ regex = new RegExp(searchQuery, isCaseSensitive ? "" : "i");
108
+ if (!isRegexValid) setIsRegexValid(true);
109
+ } catch {
110
+ if (isRegexValid) setIsRegexValid(false);
111
+ return [];
112
+ }
113
+ }
114
+ data.forEach((item) => {
115
+ let labelMatches = false;
116
+ if (regex) {
117
+ labelMatches = regex.test(item.label);
118
+ } else {
119
+ const source = isCaseSensitive ? item.label : item.label.toLowerCase();
120
+ const query = isCaseSensitive ? searchQuery : searchQuery.toLowerCase();
121
+ labelMatches = source.includes(query);
122
+ }
123
+ if (labelMatches) {
124
+ matchingAndAncestorIds.add(item.id);
125
+ let current = item.parentId;
126
+ while (current) {
127
+ const parent = dataMap.get(current);
128
+ if (parent) {
129
+ matchingAndAncestorIds.add(parent.id);
130
+ current = parent.parentId;
131
+ } else {
132
+ break;
133
+ }
134
+ }
135
+ }
136
+ });
137
+ return dataWithMeta.filter((item) => matchingAndAncestorIds.has(item.id));
138
+ }, [searchQuery, dataWithMeta, expandedItems, isCaseSensitive, isRegex, isRegexValid, data]);
139
+ react.useEffect(() => {
140
+ onVisibleDataChange?.(visibleData);
141
+ }, [visibleData, onVisibleDataChange]);
142
+ const renderLabel = (label) => {
143
+ if (!searchQuery || !isRegexValid) {
144
+ return label;
145
+ }
146
+ let regex;
147
+ try {
148
+ regex = new RegExp(`(${searchQuery})`, isCaseSensitive ? "g" : "gi");
149
+ } catch {
150
+ return label;
151
+ }
152
+ const parts = label.split(regex);
153
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: parts.map(
154
+ (part, i) => i % 2 === 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "rounded-uk-xs bg-yellow-300 dark:bg-yellow-700", children: part }, i) : part
155
+ ) });
156
+ };
157
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkDWD754BX_cjs.cn("border-line-primary flex flex-col", className), children: [
158
+ isSearchable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "border-line-primary flex h-[32px] shrink-0 items-center gap-1 border-b px-2", children: [
159
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "text-text-secondary size-4" }),
160
+ /* @__PURE__ */ jsxRuntime.jsx(
161
+ "input",
162
+ {
163
+ type: "text",
164
+ placeholder: "Search...",
165
+ className: chunkDWD754BX_cjs.cn(
166
+ "text-uk-md w-full bg-transparent focus:outline-none",
167
+ !isRegexValid && "text-red-500"
168
+ ),
169
+ value: searchQuery,
170
+ onChange: (e) => setSearchQuery(e.target.value)
171
+ }
172
+ ),
173
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkMKKH4EGP_cjs.TooltipProvider, { delayDuration: 200, children: [
174
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkMKKH4EGP_cjs.Tooltip, { children: [
175
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMKKH4EGP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
176
+ "button",
177
+ {
178
+ onClick: () => setIsCaseSensitive((prev) => !prev),
179
+ className: chunkDWD754BX_cjs.cn("rounded-uk-sm p-1", isCaseSensitive && "bg-bg-tertiary"),
180
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CaseSensitive, { className: "size-4" })
181
+ }
182
+ ) }),
183
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMKKH4EGP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Case Sensitive" }) })
184
+ ] }),
185
+ /* @__PURE__ */ jsxRuntime.jsxs(chunkMKKH4EGP_cjs.Tooltip, { children: [
186
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMKKH4EGP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
187
+ "button",
188
+ {
189
+ onClick: () => setIsRegex((prev) => !prev),
190
+ className: chunkDWD754BX_cjs.cn("rounded-uk-sm p-1", isRegex && "bg-bg-tertiary"),
191
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Regex, { className: "size-4" })
192
+ }
193
+ ) }),
194
+ /* @__PURE__ */ jsxRuntime.jsx(chunkMKKH4EGP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Use Regular Expression" }) })
195
+ ] })
196
+ ] })
197
+ ] }),
198
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "overflow-y-auto", children: visibleData.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
199
+ "div",
200
+ {
201
+ className: chunkDWD754BX_cjs.cn(
202
+ "group relative flex h-[32px] items-center",
203
+ isSelectable && "rounded-uk-md",
204
+ !item.disable && "cursor-pointer",
205
+ hoveredId === item.id && !item.disable && "bg-bg-secondary",
206
+ isSelectable && selectedItemId === item.id && "bg-brand-primary text-text-withbg"
207
+ ),
208
+ onMouseEnter: () => onItemHover?.(item.id),
209
+ onMouseLeave: () => onItemHover?.(null),
210
+ onClick: () => !item.disable && handleItemSelect(item.id),
211
+ children: [
212
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "absolute top-0 left-[-0.28rem] z-0 flex h-full items-center", children: [
213
+ item.ancestors.map((ancestor, index) => {
214
+ const parentIsLast = dataWithMeta.find((d) => d.id === ancestor.id)?.isLast;
215
+ return /* @__PURE__ */ jsxRuntime.jsx(
216
+ "div",
217
+ {
218
+ className: chunkDWD754BX_cjs.cn(
219
+ "h-full w-[1.25rem]",
220
+ parentIsLast ? "" : "border-l",
221
+ "border-line-primary"
222
+ )
223
+ },
224
+ index
225
+ );
226
+ }),
227
+ item.indent > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative h-full w-[1.24rem]", children: [
228
+ /* @__PURE__ */ jsxRuntime.jsx(
229
+ "div",
230
+ {
231
+ className: chunkDWD754BX_cjs.cn(
232
+ "absolute top-0 left-0 h-1/2 w-1/2 border-b border-l",
233
+ item.isLast ? "rounded-bl-md" : "",
234
+ "border-line-primary"
235
+ )
236
+ }
237
+ ),
238
+ !item.isLast && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-line-primary absolute top-1/2 left-0 h-1/2 w-1/2 border-l" })
239
+ ] })
240
+ ] }),
241
+ /* @__PURE__ */ jsxRuntime.jsxs(
242
+ "div",
243
+ {
244
+ className: "text-uk-md z-10 flex w-full items-center justify-between px-2 whitespace-nowrap",
245
+ style: { paddingLeft: `${item.indent * 1.25 + 0.5}rem` },
246
+ children: [
247
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
248
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex size-4 items-center justify-center", children: [
249
+ item.isCollapsible && /* @__PURE__ */ jsxRuntime.jsx(
250
+ "button",
251
+ {
252
+ onClick: (e) => {
253
+ e.stopPropagation();
254
+ toggleItem(item.id);
255
+ },
256
+ className: "absolute z-20 flex cursor-pointer items-center justify-center opacity-0 transition-opacity group-hover:opacity-100",
257
+ children: /* @__PURE__ */ jsxRuntime.jsx(
258
+ lucideReact.ChevronDown,
259
+ {
260
+ className: chunkDWD754BX_cjs.cn(
261
+ "size-4 transition-transform",
262
+ !expandedItems.has(item.id) && "-rotate-90",
263
+ item.disable && "text-icon-tertiary"
264
+ )
265
+ }
266
+ )
267
+ }
268
+ ),
269
+ /* @__PURE__ */ jsxRuntime.jsx(
270
+ "div",
271
+ {
272
+ className: chunkDWD754BX_cjs.cn(
273
+ "cursor-pointer transition-opacity",
274
+ item.isCollapsible && "group-hover:opacity-0",
275
+ item.disable && "text-icon-tertiary"
276
+ ),
277
+ children: getIcon(item)
278
+ }
279
+ )
280
+ ] }),
281
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkDWD754BX_cjs.cn("truncate", item.disable && "text-text-tertiary"), children: renderLabel(item.label) })
282
+ ] }),
283
+ item.actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", onClick: (e) => e.stopPropagation(), children: item.actions })
284
+ ]
285
+ }
286
+ )
287
+ ]
288
+ },
289
+ item.id
290
+ )) })
291
+ ] });
292
+ }
293
+
294
+ exports.TreeView = TreeView;
@@ -228,7 +228,11 @@ var SyncDragSlaveX = ({
228
228
  Comp,
229
229
  {
230
230
  ref,
231
- className: cn("cursor-grab overflow-x-auto overflow-y-hidden", isDragging && "cursor-grabbing", className),
231
+ className: cn(
232
+ "cursor-grab overflow-x-auto overflow-y-hidden",
233
+ isDragging && "cursor-grabbing",
234
+ className
235
+ ),
232
236
  style: { userSelect: isDragging ? "none" : "auto", ...props.style },
233
237
  ...props,
234
238
  children
@@ -230,7 +230,11 @@ var SyncDragSlaveX = ({
230
230
  Comp,
231
231
  {
232
232
  ref,
233
- className: chunkDWD754BX_cjs.cn("cursor-grab overflow-x-auto overflow-y-hidden", isDragging && "cursor-grabbing", className),
233
+ className: chunkDWD754BX_cjs.cn(
234
+ "cursor-grab overflow-x-auto overflow-y-hidden",
235
+ isDragging && "cursor-grabbing",
236
+ className
237
+ ),
234
238
  style: { userSelect: isDragging ? "none" : "auto", ...props.style },
235
239
  ...props,
236
240
  children
@@ -0,0 +1,100 @@
1
+ 'use strict';
2
+
3
+ var react = require('react');
4
+
5
+ // src/hooks/useLocalStorage.ts
6
+ var localStorageStore = /* @__PURE__ */ (() => {
7
+ const listeners = /* @__PURE__ */ new Map();
8
+ function subscribe(key, callback) {
9
+ if (!listeners.has(key)) {
10
+ listeners.set(key, /* @__PURE__ */ new Set());
11
+ }
12
+ listeners.get(key).add(callback);
13
+ const handleStorageChange = (e) => {
14
+ if (e.key === key && e.storageArea === localStorage) {
15
+ listeners.get(key)?.forEach((listener) => listener());
16
+ }
17
+ };
18
+ if (typeof window !== "undefined") {
19
+ window.addEventListener("storage", handleStorageChange);
20
+ }
21
+ return () => {
22
+ listeners.get(key)?.delete(callback);
23
+ if (listeners.get(key)?.size === 0) {
24
+ listeners.delete(key);
25
+ }
26
+ if (typeof window !== "undefined") {
27
+ window.removeEventListener("storage", handleStorageChange);
28
+ }
29
+ };
30
+ }
31
+ function notifyListeners(key) {
32
+ listeners.get(key)?.forEach((listener) => listener());
33
+ }
34
+ return { subscribe, notifyListeners };
35
+ })();
36
+ function useLocalStorage(key, initialValue) {
37
+ const keyRef = react.useRef(key);
38
+ const initialValueRef = react.useRef(initialValue);
39
+ keyRef.current = key;
40
+ initialValueRef.current = initialValue;
41
+ const subscribe = react.useCallback(
42
+ (callback) => localStorageStore.subscribe(keyRef.current, callback),
43
+ []
44
+ );
45
+ const getSnapshot = react.useCallback(() => {
46
+ if (typeof window === "undefined") {
47
+ return initialValueRef.current;
48
+ }
49
+ try {
50
+ const item = window.localStorage.getItem(keyRef.current);
51
+ if (item === null) return initialValueRef.current;
52
+ if (typeof initialValueRef.current === "string") {
53
+ return item;
54
+ } else if (typeof initialValueRef.current === "number") {
55
+ return parseFloat(item) || initialValueRef.current;
56
+ } else if (typeof initialValueRef.current === "boolean") {
57
+ return item === "true";
58
+ } else {
59
+ return JSON.parse(item);
60
+ }
61
+ } catch (error) {
62
+ console.warn(`Error reading localStorage key "${keyRef.current}":`, error);
63
+ return initialValueRef.current;
64
+ }
65
+ }, []);
66
+ const getServerSnapshot = react.useCallback(() => {
67
+ return initialValueRef.current;
68
+ }, []);
69
+ const storedValue = react.useSyncExternalStore(
70
+ subscribe,
71
+ getSnapshot,
72
+ getServerSnapshot
73
+ );
74
+ const setValue = react.useCallback(
75
+ (value) => {
76
+ try {
77
+ const currentValue = getSnapshot();
78
+ const valueToStore = value instanceof Function ? value(currentValue) : value;
79
+ if (typeof window !== "undefined") {
80
+ let stringValue;
81
+ if (typeof valueToStore === "string") {
82
+ stringValue = valueToStore;
83
+ } else if (typeof valueToStore === "number" || typeof valueToStore === "boolean") {
84
+ stringValue = valueToStore.toString();
85
+ } else {
86
+ stringValue = JSON.stringify(valueToStore);
87
+ }
88
+ window.localStorage.setItem(keyRef.current, stringValue);
89
+ localStorageStore.notifyListeners(keyRef.current);
90
+ }
91
+ } catch (error) {
92
+ console.warn(`Error setting localStorage key "${keyRef.current}":`, error);
93
+ }
94
+ },
95
+ [getSnapshot]
96
+ );
97
+ return [storedValue, setValue];
98
+ }
99
+
100
+ exports.useLocalStorage = useLocalStorage;
@@ -1,8 +1,8 @@
1
1
  import { useTheme } from './chunk-CWBLCQD7.mjs';
2
2
  import { Tooltip, TooltipTrigger, TooltipContent } from './chunk-XSJ6XVTR.mjs';
3
3
  import { Button } from './chunk-3MSEMXKG.mjs';
4
- import { useDocument } from './chunk-QG5Z4C65.mjs';
5
4
  import { createClientOnlyComponent } from './chunk-4F2GSF2T.mjs';
5
+ import { useDocument } from './chunk-ES4LBRHV.mjs';
6
6
  import { cn } from './chunk-KVFUDYD3.mjs';
7
7
  import { Droplet, Sun, SunMoon, Moon } from 'lucide-react';
8
8
  import { jsx, jsxs } from 'react/jsx-runtime';
@@ -0,0 +1,18 @@
1
+ import { useSyncExternalStore } from 'react';
2
+
3
+ // src/hooks/useDocument.tsx
4
+ function subscribe(callback) {
5
+ return () => {
6
+ };
7
+ }
8
+ function getSnapshot() {
9
+ return typeof document !== "undefined" ? document : void 0;
10
+ }
11
+ function getServerSnapshot() {
12
+ return void 0;
13
+ }
14
+ function useDocument() {
15
+ return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
16
+ }
17
+
18
+ export { useDocument };
@@ -0,0 +1,200 @@
1
+ import { createClientOnlyComponent } from './chunk-4F2GSF2T.mjs';
2
+ import { cn } from './chunk-KVFUDYD3.mjs';
3
+ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
4
+ import { cva } from 'class-variance-authority';
5
+ import { createContext, useContext } from 'react';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ var toggleGroupVariants = cva(
9
+ [
10
+ // Base button styling
11
+ "inline-flex",
12
+ "cursor-pointer",
13
+ "items-center",
14
+ "justify-center",
15
+ "shrink-0",
16
+ "whitespace-nowrap",
17
+ "font-normal",
18
+ "transition-all",
19
+ "[&_svg]:shrink-0",
20
+ "[&_svg]:pointer-events-none",
21
+ "outline-none",
22
+ "focus-visible:border-ring",
23
+ "focus-visible:ring-ring/50",
24
+ "focus-visible:ring-[3px]",
25
+ "focus-visible:bg-accent",
26
+ "aria-invalid:ring-destructive/20",
27
+ "aria-invalid:border-destructive",
28
+ // Toggle group specific styling
29
+ "min-w-0",
30
+ "flex-1",
31
+ "rounded-none",
32
+ "first:rounded-l-uk-sm",
33
+ "first:rounded-r-none",
34
+ "last:rounded-r-uk-sm",
35
+ "last:rounded-l-none",
36
+ "[&:not(:first-child):not(:last-child)]:rounded-none",
37
+ "focus:z-10",
38
+ "focus-visible:z-10",
39
+ // Disabled state
40
+ "disabled:pointer-events-none",
41
+ "disabled:text-text-secondary/30"
42
+ ],
43
+ {
44
+ variants: {
45
+ variant: {
46
+ primary: [
47
+ "text-text-secondary",
48
+ "bg-bg-tertiary",
49
+ "hover:bg-secondary",
50
+ "data-[state=on]:text-text-withbg",
51
+ "data-[state=on]:bg-brand-primary",
52
+ "data-[state=on]:shadow-[inset_0.5px_0_0_var(--secondary),inset_-0.5px_0_0_var(--secondary)]",
53
+ "data-[state=on]:first:shadow-[inset_-0.5px_0_0_var(--secondary)]",
54
+ "data-[state=on]:last:shadow-[inset_0.5px_0_0_var(--secondary)]"
55
+ ],
56
+ secondary: [
57
+ "text-text-secondary",
58
+ "bg-bg-secondary",
59
+ "hover:bg-group-hover",
60
+ "border-solid border border-transparent -mr-[1px]",
61
+ "dark:border-solid dark:border dark:-mr-[1px]",
62
+ "data-[state=on]:text-secondary-foreground",
63
+ "data-[state=on]:bg-group-primary",
64
+ "data-[state=on]:border-line-secondary",
65
+ "data-[state=on]:shadow-[inset_0.5px_0_0_var(--muted),inset_-0.5px_0_0_var(--muted)]"
66
+ ],
67
+ ghost: [
68
+ "hover:bg-tertiary",
69
+ "text-icon-secondary",
70
+ "data-[state=on]:text-icon-highlight",
71
+ "data-[state=on]:bg-bg-secondary",
72
+ "data-[state=on]:shadow-[inset_0.5px_0_0_var(--muted),inset_-0.5px_0_0_var(--muted)]",
73
+ "data-[state=on]:first:shadow-[inset_-0.5px_0_0_var(--muted)]",
74
+ "data-[state=on]:last:shadow-[inset_0.5px_0_0_var(--muted)]"
75
+ ]
76
+ },
77
+ size: {
78
+ sm: ["text-uk-sm", "h-6", "gap-xxs", "px-md", "[&_svg:not([class*='size-'])]:size-3"],
79
+ base: ["text-uk-md", "h-8", "gap-xs", "px-lg", "[&_svg:not([class*='size-'])]:size-4"],
80
+ lg: ["text-uk-lg", "h-9", "gap-xs", "px-xl", "[&_svg:not([class*='size-'])]:size-5"]
81
+ }
82
+ },
83
+ defaultVariants: {
84
+ variant: "primary",
85
+ size: "base"
86
+ }
87
+ }
88
+ );
89
+ var ToggleGroupContext = createContext({
90
+ size: "base",
91
+ variant: "primary"
92
+ });
93
+ function ToggleGroupRoot({
94
+ className,
95
+ variant,
96
+ size,
97
+ children,
98
+ ...props
99
+ }) {
100
+ return /* @__PURE__ */ jsx(
101
+ ToggleGroupPrimitive.Root,
102
+ {
103
+ "data-slot": "toggle-group",
104
+ "data-variant": variant,
105
+ "data-size": size,
106
+ className: cn(
107
+ "group/toggle-group",
108
+ "flex",
109
+ "w-fit",
110
+ "items-center",
111
+ "rounded-uk-md",
112
+ className
113
+ ),
114
+ ...props,
115
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
116
+ }
117
+ );
118
+ }
119
+ function ToggleGroupFallback({
120
+ className,
121
+ variant,
122
+ size,
123
+ children,
124
+ ...props
125
+ }) {
126
+ return /* @__PURE__ */ jsx(
127
+ "div",
128
+ {
129
+ "data-slot": "toggle-group",
130
+ "data-variant": variant,
131
+ "data-size": size,
132
+ className: cn(
133
+ "group/toggle-group",
134
+ "flex",
135
+ "w-fit",
136
+ "items-center",
137
+ "rounded-uk-md",
138
+ className
139
+ ),
140
+ ...props,
141
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
142
+ }
143
+ );
144
+ }
145
+ var ToggleGroup = createClientOnlyComponent(ToggleGroupRoot, ToggleGroupFallback);
146
+ function ToggleGroupItemRoot({
147
+ className,
148
+ children,
149
+ variant,
150
+ size,
151
+ ...props
152
+ }) {
153
+ const context = useContext(ToggleGroupContext);
154
+ return /* @__PURE__ */ jsx(
155
+ ToggleGroupPrimitive.Item,
156
+ {
157
+ "data-slot": "toggle-group-item",
158
+ "data-variant": context.variant || variant,
159
+ "data-size": context.size || size,
160
+ className: cn(
161
+ toggleGroupVariants({
162
+ variant: context.variant || variant,
163
+ size: context.size || size
164
+ }),
165
+ className
166
+ ),
167
+ ...props,
168
+ children
169
+ }
170
+ );
171
+ }
172
+ function ToggleGroupItemFallback({
173
+ className,
174
+ children,
175
+ variant,
176
+ size,
177
+ ...props
178
+ }) {
179
+ const context = useContext(ToggleGroupContext);
180
+ return /* @__PURE__ */ jsx(
181
+ "button",
182
+ {
183
+ "data-slot": "toggle-group-item",
184
+ "data-variant": context.variant || variant,
185
+ "data-size": context.size || size,
186
+ className: cn(
187
+ toggleGroupVariants({
188
+ variant: context.variant || variant,
189
+ size: context.size || size
190
+ }),
191
+ className
192
+ ),
193
+ ...props,
194
+ children
195
+ }
196
+ );
197
+ }
198
+ var ToggleGroupItem = createClientOnlyComponent(ToggleGroupItemRoot, ToggleGroupItemFallback);
199
+
200
+ export { ToggleGroup, ToggleGroupItem, toggleGroupVariants };
@@ -1,7 +1,7 @@
1
1
  import { Badge } from './chunk-Q27ILZE6.mjs';
2
2
  import { jsx } from 'react/jsx-runtime';
3
3
 
4
- var PACKAGE_VERSION = "0.0.66" ;
4
+ var PACKAGE_VERSION = "0.0.68" ;
5
5
  var PACKAGE_NAME = "@vuer-ai/vuer-uikit" ;
6
6
  function VersionBadge({
7
7
  className,