@vuer-ai/vuer-uikit 0.0.2 → 0.0.4

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 (230) hide show
  1. package/README.md +80 -0
  2. package/dist/chunk-25GQKTNF.mjs +105 -0
  3. package/dist/chunk-277NQUJD.js +99 -0
  4. package/dist/chunk-3FR3WKI4.mjs +24 -0
  5. package/dist/chunk-3Q75Z2CT.mjs +76 -0
  6. package/dist/chunk-5BIQ3IN7.js +93 -0
  7. package/dist/chunk-5GPQ7U5B.mjs +50 -0
  8. package/dist/chunk-66JQXJEV.mjs +272 -0
  9. package/dist/chunk-6ILSFDR5.mjs +161 -0
  10. package/dist/chunk-6L4KPPOD.mjs +90 -0
  11. package/dist/chunk-75QDQ67T.js +56 -0
  12. package/dist/chunk-7A7VNE3J.mjs +31 -0
  13. package/dist/chunk-7SXCVFSA.mjs +200 -0
  14. package/dist/chunk-7V4ELMOH.js +52 -0
  15. package/dist/chunk-7WUQTWQX.js +303 -0
  16. package/dist/chunk-A2Z57NAA.js +202 -0
  17. package/dist/chunk-ATDHGFVI.mjs +82 -0
  18. package/dist/chunk-ATEHWT2R.mjs +78 -0
  19. package/dist/chunk-B5EMQBVL.js +93 -0
  20. package/dist/chunk-CLTLT5XW.js +27 -0
  21. package/dist/chunk-COFRS37Z.mjs +337 -0
  22. package/dist/chunk-CP7QYV4N.mjs +110 -0
  23. package/dist/chunk-CZSRIDXN.mjs +165 -0
  24. package/dist/chunk-D4C5V4EN.mjs +53 -0
  25. package/dist/chunk-DWIK2CUV.mjs +45 -0
  26. package/dist/chunk-ECWCQWV5.js +148 -0
  27. package/dist/chunk-ENZI5WM7.js +108 -0
  28. package/dist/chunk-FVT46HEE.js +21 -0
  29. package/dist/chunk-FXIL4NQZ.js +58 -0
  30. package/dist/chunk-FYS6YECN.js +33 -0
  31. package/dist/chunk-G7XNQVPB.js +187 -0
  32. package/dist/chunk-GSXXTAQ3.js +373 -0
  33. package/dist/chunk-HUQZOPYD.js +2 -0
  34. package/dist/chunk-HW6SLBO3.mjs +9 -0
  35. package/dist/chunk-IPKCIMU4.mjs +156 -0
  36. package/dist/chunk-J7PTSP4Q.mjs +19 -0
  37. package/dist/chunk-KJ42IGH6.js +2 -0
  38. package/dist/chunk-KO7BQ6RR.js +83 -0
  39. package/dist/chunk-KQHNQQUZ.js +103 -0
  40. package/dist/chunk-KVFK3YC7.js +187 -0
  41. package/dist/chunk-KYKEJFJT.js +110 -0
  42. package/dist/chunk-LD7Y34QT.js +79 -0
  43. package/dist/chunk-LVSI4HYF.mjs +409 -0
  44. package/dist/chunk-M3KBBKQR.mjs +15 -0
  45. package/dist/chunk-MASRZTZC.mjs +34 -0
  46. package/dist/chunk-NN7R5DNL.mjs +119 -0
  47. package/dist/chunk-OE56M4MX.js +93 -0
  48. package/dist/chunk-OTDY2E2A.js +163 -0
  49. package/dist/chunk-PKGNHHWG.mjs +60 -0
  50. package/dist/chunk-Q3APPCB2.mjs +91 -0
  51. package/dist/chunk-QOUX33X5.mjs +111 -0
  52. package/dist/chunk-QS7WS6DD.mjs +1 -0
  53. package/dist/chunk-QZASHJNJ.js +24 -0
  54. package/dist/chunk-R6XNT4PN.js +431 -0
  55. package/dist/chunk-RACVRWME.js +136 -0
  56. package/dist/chunk-S2F2GRDB.mjs +1 -0
  57. package/dist/chunk-SI56IQWH.js +102 -0
  58. package/dist/chunk-ST4P6AN6.js +2 -0
  59. package/dist/chunk-TOZYLDAL.mjs +72 -0
  60. package/dist/chunk-UFR656UY.mjs +87 -0
  61. package/dist/chunk-UWO6RBCE.js +11 -0
  62. package/dist/chunk-VGCVIHBR.mjs +1 -0
  63. package/dist/chunk-WOG6UIG5.mjs +71 -0
  64. package/dist/chunk-X2QENXCS.mjs +54 -0
  65. package/dist/chunk-XACRGXGF.js +75 -0
  66. package/dist/chunk-XPNUQSKQ.mjs +94 -0
  67. package/dist/chunk-YQORMF34.js +110 -0
  68. package/dist/chunk-Z37VNICQ.js +67 -0
  69. package/dist/chunk-ZJXBC33M.js +112 -0
  70. package/dist/highlight-cursor/cursor-context.d.mts +7 -0
  71. package/dist/highlight-cursor/cursor-context.d.ts +7 -0
  72. package/dist/highlight-cursor/cursor-context.js +14 -0
  73. package/dist/highlight-cursor/cursor-context.mjs +1 -0
  74. package/dist/highlight-cursor/cursor-provider.d.mts +7 -0
  75. package/dist/highlight-cursor/cursor-provider.d.ts +7 -0
  76. package/dist/highlight-cursor/cursor-provider.js +12 -0
  77. package/dist/highlight-cursor/cursor-provider.mjs +3 -0
  78. package/dist/highlight-cursor/enhanced-components.d.mts +20 -0
  79. package/dist/highlight-cursor/enhanced-components.d.ts +20 -0
  80. package/dist/highlight-cursor/enhanced-components.js +36 -0
  81. package/dist/highlight-cursor/enhanced-components.mjs +11 -0
  82. package/dist/highlight-cursor/index.d.mts +16 -0
  83. package/dist/highlight-cursor/index.d.ts +16 -0
  84. package/dist/highlight-cursor/index.js +50 -0
  85. package/dist/highlight-cursor/index.mjs +13 -0
  86. package/dist/highlight-cursor/tabs-cursor-context.d.mts +14 -0
  87. package/dist/highlight-cursor/tabs-cursor-context.d.ts +14 -0
  88. package/dist/highlight-cursor/tabs-cursor-context.js +14 -0
  89. package/dist/highlight-cursor/tabs-cursor-context.mjs +1 -0
  90. package/dist/highlight-cursor/types.d.mts +39 -0
  91. package/dist/highlight-cursor/types.d.ts +39 -0
  92. package/dist/highlight-cursor/types.js +2 -0
  93. package/dist/highlight-cursor/types.mjs +1 -0
  94. package/dist/highlight-cursor/with-cursor.d.mts +7 -0
  95. package/dist/highlight-cursor/with-cursor.d.ts +7 -0
  96. package/dist/highlight-cursor/with-cursor.js +11 -0
  97. package/dist/highlight-cursor/with-cursor.mjs +2 -0
  98. package/dist/index.css +314 -0
  99. package/dist/index.d.mts +51 -0
  100. package/dist/index.d.ts +51 -0
  101. package/dist/index.js +425 -6744
  102. package/dist/index.mjs +34 -0
  103. package/dist/styles/theme.css +191 -0
  104. package/dist/styles/theme.d.mts +2 -0
  105. package/dist/styles/theme.d.ts +2 -0
  106. package/dist/styles/toast.css +58 -0
  107. package/dist/styles/toast.d.mts +2 -0
  108. package/dist/styles/toast.d.ts +2 -0
  109. package/dist/styles/variables.css +188 -0
  110. package/dist/styles/variables.d.mts +2 -0
  111. package/dist/styles/variables.d.ts +2 -0
  112. package/dist/ui/avatar.d.mts +16 -0
  113. package/dist/ui/avatar.d.ts +16 -0
  114. package/dist/ui/avatar.js +23 -0
  115. package/dist/ui/avatar.mjs +2 -0
  116. package/dist/ui/badge.d.mts +14 -0
  117. package/dist/ui/badge.d.ts +14 -0
  118. package/dist/ui/badge.js +16 -0
  119. package/dist/ui/badge.mjs +3 -0
  120. package/dist/ui/button.d.mts +16 -0
  121. package/dist/ui/button.d.ts +16 -0
  122. package/dist/ui/button.js +12 -0
  123. package/dist/ui/button.mjs +3 -0
  124. package/dist/ui/card.d.mts +12 -0
  125. package/dist/ui/card.d.ts +12 -0
  126. package/dist/ui/card.js +36 -0
  127. package/dist/ui/card.mjs +3 -0
  128. package/dist/ui/checkbox.d.mts +11 -0
  129. package/dist/ui/checkbox.d.ts +11 -0
  130. package/dist/ui/checkbox.js +12 -0
  131. package/dist/ui/checkbox.mjs +3 -0
  132. package/dist/ui/collapsible.d.mts +9 -0
  133. package/dist/ui/collapsible.d.ts +9 -0
  134. package/dist/ui/collapsible.js +20 -0
  135. package/dist/ui/collapsible.mjs +3 -0
  136. package/dist/ui/dropdown.d.mts +28 -0
  137. package/dist/ui/dropdown.d.ts +28 -0
  138. package/dist/ui/dropdown.js +68 -0
  139. package/dist/ui/dropdown.mjs +3 -0
  140. package/dist/ui/index.d.mts +44 -0
  141. package/dist/ui/index.d.ts +44 -0
  142. package/dist/ui/index.js +398 -0
  143. package/dist/ui/index.mjs +29 -0
  144. package/dist/ui/input-numbers.d.mts +15 -0
  145. package/dist/ui/input-numbers.d.ts +15 -0
  146. package/dist/ui/input-numbers.js +13 -0
  147. package/dist/ui/input-numbers.mjs +4 -0
  148. package/dist/ui/input.d.mts +22 -0
  149. package/dist/ui/input.d.ts +22 -0
  150. package/dist/ui/input.js +16 -0
  151. package/dist/ui/input.mjs +3 -0
  152. package/dist/ui/layout.d.mts +12 -0
  153. package/dist/ui/layout.d.ts +12 -0
  154. package/dist/ui/layout.js +12 -0
  155. package/dist/ui/layout.mjs +3 -0
  156. package/dist/ui/modal.d.mts +28 -0
  157. package/dist/ui/modal.d.ts +28 -0
  158. package/dist/ui/modal.js +48 -0
  159. package/dist/ui/modal.mjs +3 -0
  160. package/dist/ui/popover.d.mts +10 -0
  161. package/dist/ui/popover.d.ts +10 -0
  162. package/dist/ui/popover.js +23 -0
  163. package/dist/ui/popover.mjs +2 -0
  164. package/dist/ui/radio-group.d.mts +8 -0
  165. package/dist/ui/radio-group.d.ts +8 -0
  166. package/dist/ui/radio-group.js +16 -0
  167. package/dist/ui/radio-group.mjs +3 -0
  168. package/dist/ui/select.d.mts +28 -0
  169. package/dist/{types/ui → ui}/select.d.ts +18 -14
  170. package/dist/ui/select.js +48 -0
  171. package/dist/ui/select.mjs +3 -0
  172. package/dist/ui/sheet.d.mts +16 -0
  173. package/dist/ui/sheet.d.ts +16 -0
  174. package/dist/ui/sheet.js +39 -0
  175. package/dist/ui/sheet.mjs +2 -0
  176. package/dist/ui/slider.d.mts +10 -0
  177. package/dist/ui/slider.d.ts +10 -0
  178. package/dist/ui/slider.js +12 -0
  179. package/dist/ui/slider.mjs +3 -0
  180. package/dist/ui/switch.d.mts +7 -0
  181. package/dist/ui/switch.d.ts +7 -0
  182. package/dist/ui/switch.js +12 -0
  183. package/dist/ui/switch.mjs +3 -0
  184. package/dist/ui/tabs.d.mts +16 -0
  185. package/dist/ui/tabs.d.ts +16 -0
  186. package/dist/ui/tabs.js +25 -0
  187. package/dist/ui/tabs.mjs +4 -0
  188. package/dist/ui/textarea.d.mts +16 -0
  189. package/dist/ui/textarea.d.ts +16 -0
  190. package/dist/ui/textarea.js +12 -0
  191. package/dist/ui/textarea.mjs +3 -0
  192. package/dist/ui/theme-context.d.mts +17 -0
  193. package/dist/{types/ui → ui}/theme-context.d.ts +5 -3
  194. package/dist/ui/theme-context.js +14 -0
  195. package/dist/ui/theme-context.mjs +1 -0
  196. package/dist/ui/toast.d.mts +7 -0
  197. package/dist/ui/toast.d.ts +7 -0
  198. package/dist/ui/toast.js +14 -0
  199. package/dist/ui/toast.mjs +1 -0
  200. package/dist/ui/toggle-group.d.mts +12 -0
  201. package/dist/ui/toggle-group.d.ts +12 -0
  202. package/dist/ui/toggle-group.js +17 -0
  203. package/dist/ui/toggle-group.mjs +4 -0
  204. package/dist/ui/toggle.d.mts +13 -0
  205. package/dist/ui/toggle.d.ts +13 -0
  206. package/dist/ui/toggle.js +16 -0
  207. package/dist/ui/toggle.mjs +3 -0
  208. package/dist/ui/tooltip.d.mts +10 -0
  209. package/dist/ui/tooltip.d.ts +10 -0
  210. package/dist/ui/tooltip.js +23 -0
  211. package/dist/ui/tooltip.mjs +2 -0
  212. package/dist/ui/tree-view.d.mts +27 -0
  213. package/dist/ui/tree-view.d.ts +27 -0
  214. package/dist/ui/tree-view.js +11 -0
  215. package/dist/ui/tree-view.mjs +2 -0
  216. package/dist/utils/cn.d.mts +5 -0
  217. package/dist/utils/cn.d.ts +5 -0
  218. package/dist/utils/cn.js +10 -0
  219. package/dist/utils/cn.mjs +1 -0
  220. package/dist/utils/index.d.mts +2 -0
  221. package/dist/utils/index.d.ts +2 -0
  222. package/dist/utils/index.js +11 -0
  223. package/dist/utils/index.mjs +2 -0
  224. package/package.json +49 -27
  225. package/dist/index.umd.js +0 -74
  226. package/dist/types/index.d.ts +0 -4
  227. package/dist/types/lib/utils.d.ts +0 -2
  228. package/dist/types/ui/button.d.ts +0 -13
  229. package/dist/types/ui/input.d.ts +0 -19
  230. package/dist/vuer-uikit.css +0 -1
@@ -0,0 +1,409 @@
1
+ import { cn } from './chunk-HW6SLBO3.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-[14px] 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 relative min-w-[240px] max-w-[300px] 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 pointer-events-none absolute left-2 right-2 z-10 rounded-uk-sm 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: (e) => {
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 flex-grow truncate text-left text-sm", 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 flex-grow truncate text-left text-sm", 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 overflow-hidden text-sm transition-all",
379
+ className
380
+ ),
381
+ ...props,
382
+ children: /* @__PURE__ */ jsx("div", { className: "pb-0 pt-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,15 @@
1
+ import { Tabs } from './chunk-QOUX33X5.mjs';
2
+ import { Textarea } from './chunk-5GPQ7U5B.mjs';
3
+ import { SelectTrigger } from './chunk-66JQXJEV.mjs';
4
+ import { Button } from './chunk-Q3APPCB2.mjs';
5
+ import { InputRoot } from './chunk-25GQKTNF.mjs';
6
+ import { withCursor } from './chunk-CP7QYV4N.mjs';
7
+
8
+ // src/highlight-cursor/enhanced-components.tsx
9
+ var CursorButton = withCursor(Button);
10
+ var CursorTabs = withCursor(Tabs);
11
+ var CursorInputRoot = withCursor(InputRoot);
12
+ var CursorSelectTrigger = withCursor(SelectTrigger);
13
+ var CursorTextarea = withCursor(Textarea);
14
+
15
+ export { CursorButton, CursorInputRoot, CursorSelectTrigger, CursorTabs, CursorTextarea };
@@ -0,0 +1,34 @@
1
+ import { cn } from './chunk-HW6SLBO3.mjs';
2
+ import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
3
+ import { jsx } from 'react/jsx-runtime';
4
+
5
+ function Collapsible({ ...props }) {
6
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
7
+ }
8
+ function CollapsibleTrigger2({
9
+ ...props
10
+ }) {
11
+ return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
12
+ }
13
+ function CollapsibleContent2({
14
+ className,
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(
18
+ CollapsiblePrimitive.CollapsibleContent,
19
+ {
20
+ "data-slot": "collapsible-content",
21
+ className: cn(
22
+ [
23
+ "overflow-hidden",
24
+ "data-[state=open]:animate-collapsible-down",
25
+ "data-[state=closed]:animate-collapsible-up"
26
+ ],
27
+ className
28
+ ),
29
+ ...props
30
+ }
31
+ );
32
+ }
33
+
34
+ export { Collapsible, CollapsibleContent2 as CollapsibleContent, CollapsibleTrigger2 as CollapsibleTrigger };
@@ -0,0 +1,119 @@
1
+ import { cn } from './chunk-HW6SLBO3.mjs';
2
+ import * as SheetPrimitive from '@radix-ui/react-dialog';
3
+ import { XIcon } from 'lucide-react';
4
+ import { jsx, jsxs } from 'react/jsx-runtime';
5
+
6
+ function Sheet({ ...props }) {
7
+ return /* @__PURE__ */ jsx(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
8
+ }
9
+ function SheetTrigger({
10
+ ...props
11
+ }) {
12
+ return /* @__PURE__ */ jsx(SheetPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
13
+ }
14
+ function SheetClose({
15
+ ...props
16
+ }) {
17
+ return /* @__PURE__ */ jsx(SheetPrimitive.Close, { "data-slot": "sheet-close", className: cn("focus:outline-none focus:ring-0"), ...props });
18
+ }
19
+ function SheetPortal({
20
+ ...props
21
+ }) {
22
+ return /* @__PURE__ */ jsx(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
23
+ }
24
+ function SheetOverlay({
25
+ className,
26
+ ...props
27
+ }) {
28
+ return /* @__PURE__ */ jsx(
29
+ SheetPrimitive.Overlay,
30
+ {
31
+ "data-slot": "sheet-overlay",
32
+ className: cn(
33
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-bg-primary/50",
34
+ className
35
+ ),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function SheetContent({
41
+ className,
42
+ children,
43
+ side = "right",
44
+ ...props
45
+ }) {
46
+ return /* @__PURE__ */ jsxs(SheetPortal, { children: [
47
+ /* @__PURE__ */ jsx(SheetOverlay, {}),
48
+ /* @__PURE__ */ jsxs(
49
+ SheetPrimitive.Content,
50
+ {
51
+ "data-slot": "sheet-content",
52
+ className: cn(
53
+ "liquid:liquid-bg bg-bg-primary data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 p-xl",
54
+ side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-[340px]",
55
+ side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-[340px]",
56
+ side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto",
57
+ side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto",
58
+ className
59
+ ),
60
+ ...props,
61
+ children: [
62
+ children,
63
+ /* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "text-icon-primary hover:text-icon-highlight absolute top-4 right-4 disabled:pointer-events-none", children: [
64
+ /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
65
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
66
+ ] })
67
+ ]
68
+ }
69
+ )
70
+ ] });
71
+ }
72
+ function SheetHeader({ className, ...props }) {
73
+ return /* @__PURE__ */ jsx(
74
+ "div",
75
+ {
76
+ "data-slot": "sheet-header",
77
+ className: cn("flex flex-col gap-md pb-xl", className),
78
+ ...props
79
+ }
80
+ );
81
+ }
82
+ function SheetFooter({ className, ...props }) {
83
+ return /* @__PURE__ */ jsx(
84
+ "div",
85
+ {
86
+ "data-slot": "sheet-footer",
87
+ className: cn("mt-auto flex flex-col gap-lg pt-xl", className),
88
+ ...props
89
+ }
90
+ );
91
+ }
92
+ function SheetTitle({
93
+ className,
94
+ ...props
95
+ }) {
96
+ return /* @__PURE__ */ jsx(
97
+ SheetPrimitive.Title,
98
+ {
99
+ "data-slot": "sheet-title",
100
+ className: cn("text-[14px] text-text-highlight font-medium", className),
101
+ ...props
102
+ }
103
+ );
104
+ }
105
+ function SheetDescription({
106
+ className,
107
+ ...props
108
+ }) {
109
+ return /* @__PURE__ */ jsx(
110
+ SheetPrimitive.Description,
111
+ {
112
+ "data-slot": "sheet-description",
113
+ className: cn("text-[12px] text-text-secondary", className),
114
+ ...props
115
+ }
116
+ );
117
+ }
118
+
119
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger };
@@ -0,0 +1,93 @@
1
+ 'use strict';
2
+
3
+ var chunkUWO6RBCE_js = require('./chunk-UWO6RBCE.js');
4
+ var CheckboxPrimitive = require('@radix-ui/react-checkbox');
5
+ var lucideReact = require('lucide-react');
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 CheckboxPrimitive__namespace = /*#__PURE__*/_interopNamespace(CheckboxPrimitive);
27
+
28
+ function Checkbox({ className, checkall, ...props }) {
29
+ return /* @__PURE__ */ jsxRuntime.jsx(
30
+ CheckboxPrimitive__namespace.Root,
31
+ {
32
+ "data-slot": "checkbox",
33
+ className: chunkUWO6RBCE_js.cn(
34
+ "group",
35
+ "relative",
36
+ "w-[16px]",
37
+ "h-[16px]",
38
+ "rounded-[3px]",
39
+ "border-[1.5px]",
40
+ "border-solid",
41
+ "border-bg-tertiary",
42
+ "data-[state=checked]:bg-brand-primary",
43
+ "data-[state=checked]:border-none",
44
+ "disabled:cursor-not-allowed",
45
+ "disabled:bg-bg-secondary",
46
+ "disabled:data-[state=checked]:bg-bg-secondary",
47
+ "disabled:data-[state=checked]:border-[1.5px]",
48
+ "disabled:data-[state=checked]:border-solid",
49
+ "disabled:data-[state=checked]:border-bg-tertiary",
50
+ checkall && [
51
+ "data-[state=checked]:bg-bg-transparent",
52
+ "data-[state=checked]:border-[1.5px]",
53
+ "data-[state=checked]:border-solid",
54
+ "data-[state=checked]:border-bg-tertiary"
55
+ ],
56
+ className
57
+ ),
58
+ ...props,
59
+ children: checkall ? /* @__PURE__ */ jsxRuntime.jsx(
60
+ CheckboxPrimitive__namespace.Indicator,
61
+ {
62
+ "data-slot": "checkbox-indicator",
63
+ className: chunkUWO6RBCE_js.cn(
64
+ "absolute",
65
+ "inset-0",
66
+ "m-auto",
67
+ "w-3/5",
68
+ "h-3/5",
69
+ "bg-brand-primary",
70
+ "group-disabled:bg-bg-tertiary"
71
+ )
72
+ }
73
+ ) : /* @__PURE__ */ jsxRuntime.jsx(
74
+ CheckboxPrimitive__namespace.Indicator,
75
+ {
76
+ "data-slot": "checkbox-indicator",
77
+ className: chunkUWO6RBCE_js.cn(
78
+ "flex",
79
+ "items-center",
80
+ "justify-center",
81
+ "text-current",
82
+ "transition-none",
83
+ "text-icon-withbg",
84
+ "group-disabled:text-bg-tertiary"
85
+ ),
86
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { className: "size-3.5" })
87
+ }
88
+ )
89
+ }
90
+ );
91
+ }
92
+
93
+ exports.Checkbox = Checkbox;