@vuer-ai/vuer-uikit 0.0.19 → 0.0.21

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