@vuer-ai/vuer-uikit 0.0.19 → 0.0.20

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 (246) hide show
  1. package/dist/chunk-2JCULHBM.js +58 -0
  2. package/dist/chunk-2TRYGIGT.mjs +76 -0
  3. package/dist/chunk-2YCL2ET2.js +431 -0
  4. package/dist/chunk-3FR3WKI4.mjs +24 -0
  5. package/dist/chunk-44KW6PTD.mjs +111 -0
  6. package/dist/chunk-5OUTEHVX.js +48 -0
  7. package/dist/chunk-5SR53QBZ.js +143 -0
  8. package/dist/chunk-5TVG5JK5.js +93 -0
  9. package/dist/chunk-5ZZC23M7.mjs +60 -0
  10. package/dist/chunk-6N5422RT.js +110 -0
  11. package/dist/chunk-ALTUOIWV.mjs +15 -0
  12. package/dist/chunk-AOUGWGQR.js +609 -0
  13. package/dist/chunk-B2E7AY66.mjs +86 -0
  14. package/dist/chunk-BOPZFNFS.mjs +54 -0
  15. package/dist/chunk-CLTLT5XW.js +27 -0
  16. package/dist/chunk-DDOX4EEM.mjs +46 -0
  17. package/dist/chunk-DZ4J7I7I.mjs +114 -0
  18. package/dist/chunk-E33MW663.js +179 -0
  19. package/dist/chunk-EAZQH4IX.mjs +27 -0
  20. package/dist/chunk-EFIRD3FN.js +69 -0
  21. package/dist/chunk-EOFYA6CS.js +53 -0
  22. package/dist/chunk-EUY74AXP.mjs +341 -0
  23. package/dist/chunk-EYIFKSU2.mjs +259 -0
  24. package/dist/chunk-F56ZKT7B.mjs +1 -0
  25. package/dist/chunk-F776EMXP.mjs +82 -0
  26. package/dist/chunk-FORVP7XH.js +164 -0
  27. package/dist/chunk-FP26SRGL.js +377 -0
  28. package/dist/chunk-FRT225GK.mjs +34 -0
  29. package/dist/chunk-G5KMD72J.mjs +162 -0
  30. package/dist/chunk-G6PRZVSE.mjs +71 -0
  31. package/dist/chunk-H5P4IX7R.js +67 -0
  32. package/dist/chunk-IGBWUFZL.js +79 -0
  33. package/dist/chunk-IXHMIR5P.js +131 -0
  34. package/dist/chunk-JAMJUXBY.mjs +45 -0
  35. package/dist/chunk-JMPVDU2C.mjs +110 -0
  36. package/dist/chunk-KJ42IGH6.js +2 -0
  37. package/dist/chunk-KTNZSZ5Y.mjs +23 -0
  38. package/dist/chunk-LEPXSM36.mjs +46 -0
  39. package/dist/chunk-LLXRJYQB.mjs +31 -0
  40. package/dist/chunk-M4IVLZIH.mjs +1 -0
  41. package/dist/chunk-M4TZHOUK.js +41 -0
  42. package/dist/chunk-MRVMXKZO.mjs +106 -0
  43. package/dist/chunk-MZ4POL3U.js +301 -0
  44. package/dist/chunk-N7CINZS2.js +2 -0
  45. package/dist/chunk-OOI3SJDU.mjs +206 -0
  46. package/dist/chunk-OQ237S4Z.js +94 -0
  47. package/dist/chunk-OTPUWWEB.js +98 -0
  48. package/dist/chunk-PIR7EZC6.js +187 -0
  49. package/dist/chunk-PVRQNCSJ.js +49 -0
  50. package/dist/chunk-Q5KEB4UK.mjs +51 -0
  51. package/dist/chunk-QEY7BWIR.js +208 -0
  52. package/dist/chunk-QJR6MCTR.js +32 -0
  53. package/dist/chunk-QVUX6LLD.mjs +270 -0
  54. package/dist/chunk-QYRRQ65X.mjs +115 -0
  55. package/dist/chunk-SKO72K64.js +118 -0
  56. package/dist/chunk-T3VSSE2L.mjs +165 -0
  57. package/dist/chunk-T3WBC5YK.mjs +39 -0
  58. package/dist/chunk-TMBKCIVQ.mjs +148 -0
  59. package/dist/chunk-U2ZLDPOE.js +261 -0
  60. package/dist/chunk-U7SNLMJR.js +110 -0
  61. package/dist/chunk-UFHMEEGL.js +113 -0
  62. package/dist/chunk-UKFVRXAR.mjs +409 -0
  63. package/dist/chunk-VAXIFFOT.js +83 -0
  64. package/dist/chunk-VGCVIHBR.mjs +1 -0
  65. package/dist/chunk-VXHM7V6F.mjs +92 -0
  66. package/dist/chunk-W7D57QE6.js +21 -0
  67. package/dist/chunk-WDUTW7HS.mjs +87 -0
  68. package/dist/chunk-WJ7T7FAH.js +135 -0
  69. package/dist/chunk-WO3WHXDP.mjs +66 -0
  70. package/dist/chunk-X55EAYE2.js +94 -0
  71. package/dist/chunk-XMG3IVGZ.mjs +95 -0
  72. package/dist/chunk-XWS4SIB5.js +2 -0
  73. package/dist/chunk-XXWQ4RVP.js +25 -0
  74. package/dist/chunk-Y5I2GI4V.js +33 -0
  75. package/dist/chunk-YXDJPCAF.js +99 -0
  76. package/dist/chunk-ZVG2UKKC.mjs +603 -0
  77. package/dist/highlight-cursor/cursor-context.d.mts +7 -0
  78. package/dist/highlight-cursor/cursor-context.d.ts +7 -0
  79. package/dist/highlight-cursor/cursor-context.js +14 -0
  80. package/dist/highlight-cursor/cursor-context.mjs +1 -0
  81. package/dist/highlight-cursor/cursor-provider.d.mts +7 -0
  82. package/dist/highlight-cursor/cursor-provider.d.ts +7 -0
  83. package/dist/highlight-cursor/cursor-provider.js +12 -0
  84. package/dist/highlight-cursor/cursor-provider.mjs +3 -0
  85. package/dist/highlight-cursor/enhanced-components.d.mts +20 -0
  86. package/dist/highlight-cursor/enhanced-components.d.ts +20 -0
  87. package/dist/highlight-cursor/enhanced-components.js +37 -0
  88. package/dist/highlight-cursor/enhanced-components.mjs +12 -0
  89. package/dist/highlight-cursor/index.d.mts +16 -0
  90. package/dist/highlight-cursor/index.d.ts +16 -0
  91. package/dist/highlight-cursor/index.js +51 -0
  92. package/dist/highlight-cursor/index.mjs +14 -0
  93. package/dist/highlight-cursor/tabs-cursor-context.d.mts +14 -0
  94. package/dist/highlight-cursor/tabs-cursor-context.d.ts +14 -0
  95. package/dist/highlight-cursor/tabs-cursor-context.js +14 -0
  96. package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -0
  97. package/dist/highlight-cursor/types.d.mts +39 -0
  98. package/dist/highlight-cursor/types.d.ts +39 -0
  99. package/dist/highlight-cursor/types.js +2 -0
  100. package/dist/highlight-cursor/types.mjs +1 -0
  101. package/dist/highlight-cursor/with-cursor.d.mts +7 -0
  102. package/dist/highlight-cursor/with-cursor.d.ts +7 -0
  103. package/dist/highlight-cursor/with-cursor.js +11 -0
  104. package/dist/highlight-cursor/with-cursor.mjs +2 -0
  105. package/dist/index.css +318 -0
  106. package/dist/index.d.mts +55 -0
  107. package/dist/index.d.ts +55 -0
  108. package/dist/index.mjs +38 -0
  109. package/dist/styles/theme.css +192 -0
  110. package/dist/styles/theme.d.mts +2 -0
  111. package/dist/styles/theme.d.ts +2 -0
  112. package/dist/styles/toast.css +61 -0
  113. package/dist/styles/toast.d.mts +2 -0
  114. package/dist/styles/toast.d.ts +2 -0
  115. package/dist/styles/variables.css +188 -0
  116. package/dist/styles/variables.d.mts +2 -0
  117. package/dist/styles/variables.d.ts +2 -0
  118. package/dist/ui/avatar.d.mts +16 -0
  119. package/dist/ui/avatar.d.ts +16 -0
  120. package/dist/ui/avatar.js +25 -0
  121. package/dist/ui/avatar.mjs +4 -0
  122. package/dist/ui/badge.d.mts +14 -0
  123. package/dist/ui/badge.d.ts +14 -0
  124. package/dist/ui/badge.js +17 -0
  125. package/dist/ui/badge.mjs +4 -0
  126. package/dist/ui/button.d.mts +16 -0
  127. package/dist/ui/button.d.ts +16 -0
  128. package/dist/ui/button.js +13 -0
  129. package/dist/ui/button.mjs +4 -0
  130. package/dist/ui/card.d.mts +12 -0
  131. package/dist/ui/card.d.ts +12 -0
  132. package/dist/ui/card.js +37 -0
  133. package/dist/ui/card.mjs +4 -0
  134. package/dist/ui/checkbox.d.mts +11 -0
  135. package/dist/ui/checkbox.d.ts +11 -0
  136. package/dist/ui/checkbox.js +13 -0
  137. package/dist/ui/checkbox.mjs +4 -0
  138. package/dist/ui/collapsible.d.mts +9 -0
  139. package/dist/ui/collapsible.d.ts +9 -0
  140. package/dist/ui/collapsible.js +21 -0
  141. package/dist/ui/collapsible.mjs +4 -0
  142. package/dist/ui/dropdown.d.mts +28 -0
  143. package/dist/ui/dropdown.d.ts +28 -0
  144. package/dist/ui/dropdown.js +69 -0
  145. package/dist/ui/dropdown.mjs +4 -0
  146. package/dist/ui/index.d.mts +47 -0
  147. package/dist/ui/index.d.ts +47 -0
  148. package/dist/ui/index.js +414 -0
  149. package/dist/ui/index.mjs +33 -0
  150. package/dist/ui/input-numbers.d.mts +15 -0
  151. package/dist/ui/input-numbers.d.ts +15 -0
  152. package/dist/ui/input-numbers.js +14 -0
  153. package/dist/ui/input-numbers.mjs +5 -0
  154. package/dist/ui/input.d.mts +22 -0
  155. package/dist/ui/input.d.ts +22 -0
  156. package/dist/ui/input.js +17 -0
  157. package/dist/ui/input.mjs +4 -0
  158. package/dist/ui/layout.d.mts +12 -0
  159. package/dist/ui/layout.d.ts +12 -0
  160. package/dist/ui/layout.js +13 -0
  161. package/dist/ui/layout.mjs +4 -0
  162. package/dist/ui/modal.d.mts +28 -0
  163. package/dist/ui/modal.d.ts +28 -0
  164. package/dist/ui/modal.js +49 -0
  165. package/dist/ui/modal.mjs +4 -0
  166. package/dist/ui/popover.d.mts +10 -0
  167. package/dist/ui/popover.d.ts +10 -0
  168. package/dist/ui/popover.js +25 -0
  169. package/dist/ui/popover.mjs +4 -0
  170. package/dist/ui/radio-group.d.mts +8 -0
  171. package/dist/ui/radio-group.d.ts +8 -0
  172. package/dist/ui/radio-group.js +17 -0
  173. package/dist/ui/radio-group.mjs +4 -0
  174. package/dist/ui/select.d.mts +28 -0
  175. package/dist/ui/select.d.ts +28 -0
  176. package/dist/ui/select.js +49 -0
  177. package/dist/ui/select.mjs +4 -0
  178. package/dist/ui/sheet.d.mts +16 -0
  179. package/dist/ui/sheet.d.ts +16 -0
  180. package/dist/ui/sheet.js +39 -0
  181. package/dist/ui/sheet.mjs +2 -0
  182. package/dist/ui/slider.d.mts +10 -0
  183. package/dist/ui/slider.d.ts +10 -0
  184. package/dist/ui/slider.js +13 -0
  185. package/dist/ui/slider.mjs +4 -0
  186. package/dist/ui/switch.d.mts +7 -0
  187. package/dist/ui/switch.d.ts +7 -0
  188. package/dist/ui/switch.js +13 -0
  189. package/dist/ui/switch.mjs +4 -0
  190. package/dist/ui/tabs.d.mts +16 -0
  191. package/dist/ui/tabs.d.ts +16 -0
  192. package/dist/ui/tabs.js +26 -0
  193. package/dist/ui/tabs.mjs +5 -0
  194. package/dist/ui/textarea.d.mts +16 -0
  195. package/dist/ui/textarea.d.ts +16 -0
  196. package/dist/ui/textarea.js +13 -0
  197. package/dist/ui/textarea.mjs +4 -0
  198. package/dist/ui/theme-context.d.mts +17 -0
  199. package/dist/ui/theme-context.d.ts +17 -0
  200. package/dist/ui/theme-context.js +17 -0
  201. package/dist/ui/theme-context.mjs +4 -0
  202. package/dist/ui/timeline.d.mts +23 -0
  203. package/dist/ui/timeline.d.ts +23 -0
  204. package/dist/ui/timeline.js +15 -0
  205. package/dist/ui/timeline.mjs +6 -0
  206. package/dist/ui/toast.d.mts +7 -0
  207. package/dist/ui/toast.d.ts +7 -0
  208. package/dist/ui/toast.js +14 -0
  209. package/dist/ui/toast.mjs +1 -0
  210. package/dist/ui/toggle-group.d.mts +12 -0
  211. package/dist/ui/toggle-group.d.ts +12 -0
  212. package/dist/ui/toggle-group.js +18 -0
  213. package/dist/ui/toggle-group.mjs +5 -0
  214. package/dist/ui/toggle.d.mts +13 -0
  215. package/dist/ui/toggle.d.ts +13 -0
  216. package/dist/ui/toggle.js +17 -0
  217. package/dist/ui/toggle.mjs +4 -0
  218. package/dist/ui/tooltip.d.mts +10 -0
  219. package/dist/ui/tooltip.d.ts +10 -0
  220. package/dist/ui/tooltip.js +25 -0
  221. package/dist/ui/tooltip.mjs +4 -0
  222. package/dist/ui/tree-view-v2.d.mts +25 -0
  223. package/dist/ui/tree-view-v2.d.ts +25 -0
  224. package/dist/ui/tree-view-v2.js +14 -0
  225. package/dist/ui/tree-view-v2.mjs +5 -0
  226. package/dist/ui/tree-view.d.mts +28 -0
  227. package/dist/ui/tree-view.d.ts +28 -0
  228. package/dist/ui/tree-view.js +11 -0
  229. package/dist/ui/tree-view.mjs +2 -0
  230. package/dist/ui/version-badge.d.mts +26 -0
  231. package/dist/ui/version-badge.d.ts +26 -0
  232. package/dist/ui/version-badge.js +14 -0
  233. package/dist/ui/version-badge.mjs +5 -0
  234. package/dist/utils/cn.d.mts +5 -0
  235. package/dist/utils/cn.d.ts +5 -0
  236. package/dist/utils/cn.js +10 -0
  237. package/dist/utils/cn.mjs +1 -0
  238. package/dist/utils/index.d.mts +3 -0
  239. package/dist/utils/index.d.ts +3 -0
  240. package/dist/utils/index.js +16 -0
  241. package/dist/utils/index.mjs +3 -0
  242. package/dist/utils/use-local-storage.d.mts +3 -0
  243. package/dist/utils/use-local-storage.d.ts +3 -0
  244. package/dist/utils/use-local-storage.js +10 -0
  245. package/dist/utils/use-local-storage.mjs +1 -0
  246. package/package.json +3 -2
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
4
+ var CollapsiblePrimitive = require('@radix-ui/react-collapsible');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n.default = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var CollapsiblePrimitive__namespace = /*#__PURE__*/_interopNamespace(CollapsiblePrimitive);
26
+
27
+ function Collapsible({ ...props }) {
28
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.Root, { "data-slot": "collapsible", ...props });
29
+ }
30
+ function CollapsibleTrigger2({
31
+ ...props
32
+ }) {
33
+ return /* @__PURE__ */ jsxRuntime.jsx(CollapsiblePrimitive__namespace.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
34
+ }
35
+ function CollapsibleContent2({
36
+ className,
37
+ ...props
38
+ }) {
39
+ return /* @__PURE__ */ jsxRuntime.jsx(
40
+ CollapsiblePrimitive__namespace.CollapsibleContent,
41
+ {
42
+ "data-slot": "collapsible-content",
43
+ className: chunkXXWQ4RVP_js.cn(
44
+ [
45
+ "overflow-hidden",
46
+ "data-[state=open]:animate-collapsible-down",
47
+ "data-[state=closed]:animate-collapsible-up"
48
+ ],
49
+ className
50
+ ),
51
+ ...props
52
+ }
53
+ );
54
+ }
55
+
56
+ exports.Collapsible = Collapsible;
57
+ exports.CollapsibleContent = CollapsibleContent2;
58
+ exports.CollapsibleTrigger = CollapsibleTrigger2;
@@ -0,0 +1,76 @@
1
+ import { toggleVariants } from './chunk-WDUTW7HS.mjs';
2
+ import { cn } from './chunk-KTNZSZ5Y.mjs';
3
+ import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
4
+ import { createContext, useContext } from 'react';
5
+ import { jsx } from 'react/jsx-runtime';
6
+
7
+ var ToggleGroupContext = createContext({
8
+ size: "base",
9
+ variant: "primary"
10
+ });
11
+ function ToggleGroup({
12
+ className,
13
+ variant,
14
+ size,
15
+ children,
16
+ ...props
17
+ }) {
18
+ return /* @__PURE__ */ jsx(
19
+ ToggleGroupPrimitive.Root,
20
+ {
21
+ "data-slot": "toggle-group",
22
+ "data-variant": variant,
23
+ "data-size": size,
24
+ className: cn(
25
+ "group/toggle-group",
26
+ "flex",
27
+ "w-fit",
28
+ "items-center",
29
+ "rounded-uk-md",
30
+ "data-[variant=outline]:shadow-xs",
31
+ className
32
+ ),
33
+ ...props,
34
+ children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
35
+ }
36
+ );
37
+ }
38
+ function ToggleGroupItem({
39
+ className,
40
+ children,
41
+ variant,
42
+ size,
43
+ ...props
44
+ }) {
45
+ const context = useContext(ToggleGroupContext);
46
+ return /* @__PURE__ */ jsx(
47
+ ToggleGroupPrimitive.Item,
48
+ {
49
+ "data-slot": "toggle-group-item",
50
+ "data-variant": context.variant || variant,
51
+ "data-size": context.size || size,
52
+ className: cn(
53
+ toggleVariants({
54
+ variant: context.variant || variant,
55
+ size: context.size || size
56
+ }),
57
+ "min-w-0",
58
+ "flex-1",
59
+ "shrink-0",
60
+ "rounded-none",
61
+ "shadow-none",
62
+ "first:rounded-l-md",
63
+ "last:rounded-r-md",
64
+ "focus:z-10",
65
+ "focus-visible:z-10",
66
+ "data-[variant=outline]:border-l-0",
67
+ "data-[variant=outline]:first:border-l",
68
+ className
69
+ ),
70
+ ...props,
71
+ children
72
+ }
73
+ );
74
+ }
75
+
76
+ export { ToggleGroup, ToggleGroupItem };
@@ -0,0 +1,431 @@
1
+ 'use strict';
2
+
3
+ var chunkXXWQ4RVP_js = require('./chunk-XXWQ4RVP.js');
4
+ var AccordionPrimitive = require('@radix-ui/react-accordion');
5
+ var classVarianceAuthority = require('class-variance-authority');
6
+ var lucideReact = require('lucide-react');
7
+ var react = require('react');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var AccordionPrimitive__namespace = /*#__PURE__*/_interopNamespace(AccordionPrimitive);
29
+
30
+ var treeVariants = classVarianceAuthority.cva(
31
+ "text-uk-md group py-1 h-9 text-text-primary rounded transition-colors cursor-pointer text-left relative z-20"
32
+ );
33
+ var selectedTreeVariants = classVarianceAuthority.cva("");
34
+ var dragOverVariants = classVarianceAuthority.cva("bg-primary/20 text-primary-foreground");
35
+ var TreeView = react.forwardRef(
36
+ ({
37
+ data,
38
+ initialSelectedItemId,
39
+ onSelectChange,
40
+ expandAll,
41
+ defaultLeafIcon,
42
+ defaultNodeIcon,
43
+ className,
44
+ onDocumentDrag,
45
+ ...props
46
+ }, ref) => {
47
+ const [selectedItemId, setSelectedItemId] = react.useState(initialSelectedItemId);
48
+ const [draggedItem, setDraggedItem] = react.useState(null);
49
+ const [hoverBackgroundStyle, setHoverBackgroundStyle] = react.useState({ display: "none", top: 0, height: 0 });
50
+ const handleSelectChange = react.useCallback(
51
+ (item) => {
52
+ setSelectedItemId(item == null ? void 0 : item.id);
53
+ if (onSelectChange) {
54
+ onSelectChange(item);
55
+ }
56
+ },
57
+ [onSelectChange]
58
+ );
59
+ const handleDragStart = react.useCallback((item) => {
60
+ setDraggedItem(item);
61
+ }, []);
62
+ const handleDrop = react.useCallback(
63
+ (targetItem) => {
64
+ if (draggedItem && onDocumentDrag && draggedItem.id !== targetItem.id) {
65
+ onDocumentDrag(draggedItem, targetItem);
66
+ }
67
+ setDraggedItem(null);
68
+ },
69
+ [draggedItem, onDocumentDrag]
70
+ );
71
+ const handleItemHover = react.useCallback((element) => {
72
+ var _a;
73
+ if (element) {
74
+ const rect = element.getBoundingClientRect();
75
+ const containerRect = (_a = element.closest("[data-tree-container]")) == null ? void 0 : _a.getBoundingClientRect();
76
+ if (containerRect) {
77
+ setHoverBackgroundStyle({
78
+ display: "block",
79
+ top: rect.top - containerRect.top,
80
+ height: rect.height
81
+ });
82
+ }
83
+ } else {
84
+ setHoverBackgroundStyle({ display: "none", top: 0, height: 0 });
85
+ }
86
+ }, []);
87
+ const expandedItemIds = react.useMemo(() => {
88
+ if (!initialSelectedItemId) {
89
+ return [];
90
+ }
91
+ const ids = [];
92
+ function walkTreeItems(items, targetId) {
93
+ if (items instanceof Array) {
94
+ for (let i = 0; i < items.length; i++) {
95
+ ids.push(items[i].id);
96
+ if (walkTreeItems(items[i], targetId) && !expandAll) {
97
+ return true;
98
+ }
99
+ if (!expandAll) ids.pop();
100
+ }
101
+ } else if (!expandAll && items.id === targetId) {
102
+ return true;
103
+ } else if (items.children) {
104
+ return walkTreeItems(items.children, targetId);
105
+ }
106
+ }
107
+ walkTreeItems(data, initialSelectedItemId);
108
+ return ids;
109
+ }, [data, expandAll, initialSelectedItemId]);
110
+ return /* @__PURE__ */ jsxRuntime.jsxs(
111
+ "div",
112
+ {
113
+ className: chunkXXWQ4RVP_js.cn(
114
+ "bg-bg-primary rounded-uk-md relative max-w-[300px] min-w-[240px] overflow-hidden p-2",
115
+ className
116
+ ),
117
+ "data-tree-container": true,
118
+ children: [
119
+ /* @__PURE__ */ jsxRuntime.jsx(
120
+ "div",
121
+ {
122
+ className: "bg-bg-tertiary rounded-uk-sm pointer-events-none absolute right-2 left-2 z-10 transition-all duration-150",
123
+ style: {
124
+ display: hoverBackgroundStyle.display,
125
+ top: hoverBackgroundStyle.top,
126
+ height: hoverBackgroundStyle.height
127
+ }
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsxRuntime.jsx(
131
+ TreeItem,
132
+ {
133
+ data,
134
+ ref,
135
+ selectedItemId,
136
+ handleSelectChange,
137
+ expandedItemIds,
138
+ defaultLeafIcon,
139
+ defaultNodeIcon,
140
+ handleDragStart,
141
+ handleDrop,
142
+ draggedItem,
143
+ onItemHover: handleItemHover,
144
+ ...props
145
+ }
146
+ ),
147
+ /* @__PURE__ */ jsxRuntime.jsx(
148
+ "div",
149
+ {
150
+ className: "h-[48px] w-full",
151
+ onDrop: () => {
152
+ handleDrop({ id: "", name: "parent_div" });
153
+ }
154
+ }
155
+ )
156
+ ]
157
+ }
158
+ );
159
+ }
160
+ );
161
+ TreeView.displayName = "TreeView";
162
+ var TreeItem = react.forwardRef(
163
+ ({
164
+ className,
165
+ data,
166
+ selectedItemId,
167
+ handleSelectChange,
168
+ expandedItemIds,
169
+ defaultLeafIcon,
170
+ defaultNodeIcon,
171
+ handleDragStart,
172
+ handleDrop,
173
+ draggedItem,
174
+ onItemHover,
175
+ ...props
176
+ }, ref) => {
177
+ if (!(data instanceof Array)) {
178
+ data = [data];
179
+ }
180
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "tree", className, ...props, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { style: { margin: 0, paddingLeft: "1rem" }, children: data.map((item) => /* @__PURE__ */ jsxRuntime.jsx("li", { style: { margin: 0 }, children: item.children ? /* @__PURE__ */ jsxRuntime.jsx(
181
+ TreeNode,
182
+ {
183
+ item,
184
+ handleSelectChange,
185
+ expandedItemIds,
186
+ selectedItemId,
187
+ defaultNodeIcon,
188
+ defaultLeafIcon,
189
+ handleDragStart,
190
+ handleDrop,
191
+ draggedItem,
192
+ onItemHover
193
+ }
194
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
195
+ TreeLeaf,
196
+ {
197
+ item,
198
+ selectedItemId,
199
+ handleSelectChange,
200
+ defaultLeafIcon,
201
+ handleDragStart,
202
+ handleDrop,
203
+ draggedItem,
204
+ onItemHover
205
+ }
206
+ ) }, item.id)) }) });
207
+ }
208
+ );
209
+ TreeItem.displayName = "TreeItem";
210
+ var TreeNode = ({
211
+ item,
212
+ handleSelectChange,
213
+ expandedItemIds,
214
+ selectedItemId,
215
+ defaultNodeIcon,
216
+ defaultLeafIcon,
217
+ handleDragStart,
218
+ handleDrop,
219
+ draggedItem,
220
+ onItemHover
221
+ }) => {
222
+ const [value, setValue] = react.useState(expandedItemIds.includes(item.id) ? [item.id] : []);
223
+ const [isDragOver, setIsDragOver] = react.useState(false);
224
+ const [isHovered, setIsHovered] = react.useState(false);
225
+ const onDragStart = (e) => {
226
+ if (!item.draggable) {
227
+ e.preventDefault();
228
+ return;
229
+ }
230
+ e.dataTransfer.setData("text/plain", item.id);
231
+ handleDragStart == null ? void 0 : handleDragStart(item);
232
+ };
233
+ const onDragOver = (e) => {
234
+ if (item.droppable !== false && draggedItem && draggedItem.id !== item.id) {
235
+ e.preventDefault();
236
+ setIsDragOver(true);
237
+ }
238
+ };
239
+ const onDragLeave = () => {
240
+ setIsDragOver(false);
241
+ };
242
+ const onDrop = (e) => {
243
+ e.preventDefault();
244
+ setIsDragOver(false);
245
+ handleDrop == null ? void 0 : handleDrop(item);
246
+ };
247
+ return /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Root, { type: "multiple", value, onValueChange: (s) => setValue(s), children: /* @__PURE__ */ jsxRuntime.jsxs(AccordionPrimitive__namespace.Item, { value: item.id, className: "m-0", children: [
248
+ /* @__PURE__ */ jsxRuntime.jsxs(
249
+ AccordionTrigger,
250
+ {
251
+ style: { margin: 0 },
252
+ className: chunkXXWQ4RVP_js.cn(
253
+ treeVariants(),
254
+ selectedItemId === item.id && selectedTreeVariants(),
255
+ isDragOver && dragOverVariants(),
256
+ item.disabled && "hover:bg-bg-primary pointer-events-none cursor-not-allowed opacity-50"
257
+ ),
258
+ onClick: () => {
259
+ var _a;
260
+ if (item.disabled) return;
261
+ handleSelectChange(item);
262
+ (_a = item.onClick) == null ? void 0 : _a.call(item);
263
+ },
264
+ onMouseEnter: (e) => {
265
+ setIsHovered(true);
266
+ onItemHover == null ? void 0 : onItemHover(e.currentTarget);
267
+ },
268
+ onMouseLeave: () => {
269
+ setIsHovered(false);
270
+ onItemHover == null ? void 0 : onItemHover(null);
271
+ },
272
+ draggable: !!item.draggable && !item.disabled,
273
+ onDragStart,
274
+ onDragOver,
275
+ onDragLeave,
276
+ onDrop,
277
+ children: [
278
+ isHovered ? value.includes(item.id) ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "text-text-primary mr-2 h-4 w-4 shrink-0 transition-transform duration-200" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronRight, { className: "text-text-primary mr-2 h-4 w-4 shrink-0 transition-transform duration-200" }) : /* @__PURE__ */ jsxRuntime.jsx(
279
+ TreeIcon,
280
+ {
281
+ item,
282
+ isSelected: selectedItemId === item.id,
283
+ isOpen: value.includes(item.id),
284
+ default: defaultNodeIcon
285
+ }
286
+ ),
287
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-primary text-uk-md flex-grow truncate text-left", children: item.name }),
288
+ /* @__PURE__ */ jsxRuntime.jsx(TreeActions, { isSelected: selectedItemId === item.id && !item.disabled, children: item.actions })
289
+ ]
290
+ }
291
+ ),
292
+ /* @__PURE__ */ jsxRuntime.jsx(AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
293
+ TreeItem,
294
+ {
295
+ data: item.children ? item.children : item,
296
+ selectedItemId,
297
+ handleSelectChange,
298
+ expandedItemIds,
299
+ defaultLeafIcon,
300
+ defaultNodeIcon,
301
+ handleDragStart,
302
+ handleDrop,
303
+ draggedItem,
304
+ onItemHover
305
+ }
306
+ ) })
307
+ ] }) });
308
+ };
309
+ var TreeLeaf = react.forwardRef(
310
+ ({
311
+ className,
312
+ item,
313
+ selectedItemId,
314
+ handleSelectChange,
315
+ defaultLeafIcon,
316
+ handleDragStart,
317
+ handleDrop,
318
+ draggedItem,
319
+ onItemHover,
320
+ ...props
321
+ }, ref) => {
322
+ const [isDragOver, setIsDragOver] = react.useState(false);
323
+ const onDragStart = (e) => {
324
+ if (!item.draggable || item.disabled) {
325
+ e.preventDefault();
326
+ return;
327
+ }
328
+ e.dataTransfer.setData("text/plain", item.id);
329
+ handleDragStart == null ? void 0 : handleDragStart(item);
330
+ };
331
+ const onDragOver = (e) => {
332
+ if (item.droppable !== false && !item.disabled && draggedItem && draggedItem.id !== item.id) {
333
+ e.preventDefault();
334
+ setIsDragOver(true);
335
+ }
336
+ };
337
+ const onDragLeave = () => {
338
+ setIsDragOver(false);
339
+ };
340
+ const onDrop = (e) => {
341
+ if (item.disabled) return;
342
+ e.preventDefault();
343
+ setIsDragOver(false);
344
+ handleDrop == null ? void 0 : handleDrop(item);
345
+ };
346
+ return /* @__PURE__ */ jsxRuntime.jsxs(
347
+ "div",
348
+ {
349
+ ref,
350
+ className: chunkXXWQ4RVP_js.cn(
351
+ "relative flex items-center",
352
+ treeVariants(),
353
+ className,
354
+ selectedItemId === item.id && selectedTreeVariants(),
355
+ isDragOver && dragOverVariants(),
356
+ item.disabled && "hover:bg-bg-primary pointer-events-none cursor-not-allowed opacity-50"
357
+ ),
358
+ onClick: () => {
359
+ var _a;
360
+ if (item.disabled) return;
361
+ handleSelectChange(item);
362
+ (_a = item.onClick) == null ? void 0 : _a.call(item);
363
+ },
364
+ onMouseEnter: (e) => onItemHover == null ? void 0 : onItemHover(e.currentTarget),
365
+ onMouseLeave: () => onItemHover == null ? void 0 : onItemHover(null),
366
+ draggable: !!item.draggable && !item.disabled,
367
+ onDragStart,
368
+ onDragOver,
369
+ onDragLeave,
370
+ onDrop,
371
+ ...props,
372
+ children: [
373
+ /* @__PURE__ */ jsxRuntime.jsx(TreeIcon, { item, isSelected: selectedItemId === item.id, default: defaultLeafIcon }),
374
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-text-primary text-uk-md flex-grow truncate text-left", children: item.name }),
375
+ /* @__PURE__ */ jsxRuntime.jsx(TreeActions, { isSelected: selectedItemId === item.id && !item.disabled, children: item.actions })
376
+ ]
377
+ }
378
+ );
379
+ }
380
+ );
381
+ TreeLeaf.displayName = "TreeLeaf";
382
+ var AccordionTrigger = react.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(AccordionPrimitive__namespace.Header, { style: { margin: 0 }, children: /* @__PURE__ */ jsxRuntime.jsx(
383
+ AccordionPrimitive__namespace.Trigger,
384
+ {
385
+ ref,
386
+ className: chunkXXWQ4RVP_js.cn(
387
+ "relative flex w-full flex-1 items-center justify-between text-left font-medium transition-all",
388
+ className
389
+ ),
390
+ ...props,
391
+ children
392
+ }
393
+ ) }));
394
+ AccordionTrigger.displayName = AccordionPrimitive__namespace.Trigger.displayName;
395
+ var AccordionContent = react.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
396
+ AccordionPrimitive__namespace.Content,
397
+ {
398
+ ref,
399
+ className: chunkXXWQ4RVP_js.cn(
400
+ "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down text-uk-md overflow-hidden transition-all",
401
+ className
402
+ ),
403
+ ...props,
404
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-0 pb-0", children })
405
+ }
406
+ ));
407
+ AccordionContent.displayName = AccordionPrimitive__namespace.Content.displayName;
408
+ var TreeIcon = ({
409
+ item,
410
+ isOpen,
411
+ isSelected,
412
+ default: defaultIcon
413
+ }) => {
414
+ let Icon = defaultIcon;
415
+ if (isSelected && item.selectedIcon) {
416
+ Icon = item.selectedIcon;
417
+ } else if (isOpen && item.openIcon) {
418
+ Icon = item.openIcon;
419
+ } else if (item.icon) {
420
+ Icon = item.icon;
421
+ }
422
+ if (!Icon) {
423
+ Icon = item.children && item.children.length > 0 ? lucideReact.Folder : lucideReact.File;
424
+ }
425
+ return Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "text-text-primary mr-2 h-4 w-4 shrink-0" }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {});
426
+ };
427
+ var TreeActions = ({ children, isSelected }) => {
428
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkXXWQ4RVP_js.cn(isSelected ? "block" : "hidden", "absolute right-3 group-hover:block"), children });
429
+ };
430
+
431
+ exports.TreeView = TreeView;
@@ -0,0 +1,24 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ // src/highlight-cursor/cursor-context.tsx
4
+ var defaultDimensions = {
5
+ width: 0,
6
+ height: 0,
7
+ x: 0,
8
+ y: 0
9
+ };
10
+ var defaultContext = {
11
+ mousePosition: { x: 0, y: 0 },
12
+ hoveredElementId: null,
13
+ elementDimensions: defaultDimensions,
14
+ registerHoveredElement: () => {
15
+ },
16
+ unregisterHoveredElement: () => {
17
+ },
18
+ updateElementDimensions: () => {
19
+ }
20
+ };
21
+ var CursorContext = createContext(defaultContext);
22
+ var useCursor = () => useContext(CursorContext);
23
+
24
+ export { CursorContext, useCursor };
@@ -0,0 +1,111 @@
1
+ import { useCursor } from './chunk-3FR3WKI4.mjs';
2
+ import { forwardRef, useId, useRef } from 'react';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ var getVisibleRect = (element, elementRect) => {
6
+ let parent = element.parentElement;
7
+ let visibleRect = {
8
+ ...elementRect,
9
+ left: elementRect.left,
10
+ right: elementRect.right,
11
+ top: elementRect.top,
12
+ bottom: elementRect.bottom,
13
+ width: elementRect.width,
14
+ height: elementRect.height,
15
+ x: elementRect.x,
16
+ y: elementRect.y
17
+ };
18
+ while (parent) {
19
+ if (typeof window === "undefined") break;
20
+ const style = window.getComputedStyle(parent);
21
+ const hasOverflow = [style.overflowY, style.overflowX].some(
22
+ (overflow) => ["auto", "scroll", "hidden"].includes(overflow)
23
+ );
24
+ if (hasOverflow) {
25
+ const parentRect = parent.getBoundingClientRect();
26
+ const newLeft = Math.max(visibleRect.left, parentRect.left);
27
+ const newTop = Math.max(visibleRect.top, parentRect.top);
28
+ const newRight = Math.min(visibleRect.right, parentRect.right);
29
+ const newBottom = Math.min(visibleRect.bottom, parentRect.bottom);
30
+ visibleRect = {
31
+ ...visibleRect,
32
+ left: newLeft,
33
+ top: newTop,
34
+ right: newRight,
35
+ bottom: newBottom,
36
+ width: Math.max(0, newRight - newLeft),
37
+ height: Math.max(0, newBottom - newTop),
38
+ x: newLeft,
39
+ y: newTop
40
+ };
41
+ if (visibleRect.width <= 0 || visibleRect.height <= 0) {
42
+ return new DOMRect(0, 0, 0, 0);
43
+ }
44
+ }
45
+ parent = parent.parentElement;
46
+ }
47
+ return DOMRect.fromRect(visibleRect);
48
+ };
49
+ function withCursor(Component) {
50
+ const displayName = Component.displayName || Component.name || "Component";
51
+ const EnhancedComponent = forwardRef(
52
+ ({ id: propId, onMouseEnter, onMouseMove, onMouseLeave, ...props }, ref) => {
53
+ const { registerHoveredElement, unregisterHoveredElement, updateElementDimensions } = useCursor();
54
+ const generatedId = useId();
55
+ const id = propId || `cursor-element-${generatedId}`;
56
+ const elementRef = useRef(null);
57
+ const handleMouseEnter = (event) => {
58
+ if (elementRef.current) {
59
+ const elementRect = elementRef.current.getBoundingClientRect();
60
+ const visibleRect = getVisibleRect(elementRef.current, elementRect);
61
+ registerHoveredElement(id, visibleRect, elementRef.current);
62
+ }
63
+ onMouseEnter == null ? void 0 : onMouseEnter(event);
64
+ };
65
+ const handleMouseMove = (event) => {
66
+ if (elementRef.current) {
67
+ const elementRect = elementRef.current.getBoundingClientRect();
68
+ const visibleRect = getVisibleRect(elementRef.current, elementRect);
69
+ updateElementDimensions(visibleRect);
70
+ }
71
+ onMouseMove == null ? void 0 : onMouseMove(event);
72
+ };
73
+ const handleMouseOut = (event) => {
74
+ var _a;
75
+ const rect = (_a = elementRef.current) == null ? void 0 : _a.getBoundingClientRect();
76
+ if (rect) {
77
+ const { clientX, clientY } = event;
78
+ const isOutside = clientX < rect.left || clientX > rect.right || clientY < rect.top || clientY > rect.bottom;
79
+ if (isOutside) {
80
+ unregisterHoveredElement();
81
+ }
82
+ } else {
83
+ unregisterHoveredElement();
84
+ }
85
+ onMouseLeave == null ? void 0 : onMouseLeave(event);
86
+ };
87
+ return /* @__PURE__ */ jsx(
88
+ Component,
89
+ {
90
+ ...props,
91
+ id,
92
+ ref: (node) => {
93
+ if (typeof ref === "function") {
94
+ ref(node);
95
+ } else if (ref) {
96
+ ref.current = node;
97
+ }
98
+ elementRef.current = node;
99
+ },
100
+ onMouseEnter: handleMouseEnter,
101
+ onMouseMove: handleMouseMove,
102
+ onMouseOut: handleMouseOut
103
+ }
104
+ );
105
+ }
106
+ );
107
+ EnhancedComponent.displayName = `withCursor(${displayName})`;
108
+ return EnhancedComponent;
109
+ }
110
+
111
+ export { withCursor };