@treenity/react 3.0.0

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 (297) hide show
  1. package/dist/AclEditor.d.ts +11 -0
  2. package/dist/AclEditor.d.ts.map +1 -0
  3. package/dist/AclEditor.js +152 -0
  4. package/dist/AclEditor.js.map +1 -0
  5. package/dist/App.d.ts +2 -0
  6. package/dist/App.d.ts.map +1 -0
  7. package/dist/App.js +521 -0
  8. package/dist/App.js.map +1 -0
  9. package/dist/Inspector.d.ts +12 -0
  10. package/dist/Inspector.d.ts.map +1 -0
  11. package/dist/Inspector.js +360 -0
  12. package/dist/Inspector.js.map +1 -0
  13. package/dist/Tree.d.ts +16 -0
  14. package/dist/Tree.d.ts.map +1 -0
  15. package/dist/Tree.js +100 -0
  16. package/dist/Tree.js.map +1 -0
  17. package/dist/ViewPage.d.ts +5 -0
  18. package/dist/ViewPage.d.ts.map +1 -0
  19. package/dist/ViewPage.js +13 -0
  20. package/dist/ViewPage.js.map +1 -0
  21. package/dist/bind/computed.d.ts +9 -0
  22. package/dist/bind/computed.d.ts.map +1 -0
  23. package/dist/bind/computed.js +61 -0
  24. package/dist/bind/computed.js.map +1 -0
  25. package/dist/bind/engine.d.ts +3 -0
  26. package/dist/bind/engine.d.ts.map +1 -0
  27. package/dist/bind/engine.js +184 -0
  28. package/dist/bind/engine.js.map +1 -0
  29. package/dist/bind/eval.d.ts +13 -0
  30. package/dist/bind/eval.d.ts.map +1 -0
  31. package/dist/bind/eval.js +97 -0
  32. package/dist/bind/eval.js.map +1 -0
  33. package/dist/bind/hook.d.ts +8 -0
  34. package/dist/bind/hook.d.ts.map +1 -0
  35. package/dist/bind/hook.js +99 -0
  36. package/dist/bind/hook.js.map +1 -0
  37. package/dist/bind/parse.d.ts +19 -0
  38. package/dist/bind/parse.d.ts.map +1 -0
  39. package/dist/bind/parse.js +86 -0
  40. package/dist/bind/parse.js.map +1 -0
  41. package/dist/bind/pipes.d.ts +4 -0
  42. package/dist/bind/pipes.d.ts.map +1 -0
  43. package/dist/bind/pipes.js +43 -0
  44. package/dist/bind/pipes.js.map +1 -0
  45. package/dist/cache.d.ts +27 -0
  46. package/dist/cache.d.ts.map +1 -0
  47. package/dist/cache.js +236 -0
  48. package/dist/cache.js.map +1 -0
  49. package/dist/client-tree.d.ts +9 -0
  50. package/dist/client-tree.d.ts.map +1 -0
  51. package/dist/client-tree.js +14 -0
  52. package/dist/client-tree.js.map +1 -0
  53. package/dist/client.d.ts +2 -0
  54. package/dist/client.d.ts.map +1 -0
  55. package/dist/client.js +10 -0
  56. package/dist/client.js.map +1 -0
  57. package/dist/components/ui/accordion.d.ts +8 -0
  58. package/dist/components/ui/accordion.d.ts.map +1 -0
  59. package/dist/components/ui/accordion.js +18 -0
  60. package/dist/components/ui/accordion.js.map +1 -0
  61. package/dist/components/ui/badge.d.ts +10 -0
  62. package/dist/components/ui/badge.d.ts.map +1 -0
  63. package/dist/components/ui/badge.js +19 -0
  64. package/dist/components/ui/badge.js.map +1 -0
  65. package/dist/components/ui/button.d.ts +11 -0
  66. package/dist/components/ui/button.d.ts.map +1 -0
  67. package/dist/components/ui/button.js +31 -0
  68. package/dist/components/ui/button.js.map +1 -0
  69. package/dist/components/ui/checkbox.d.ts +4 -0
  70. package/dist/components/ui/checkbox.d.ts.map +1 -0
  71. package/dist/components/ui/checkbox.js +7 -0
  72. package/dist/components/ui/checkbox.js.map +1 -0
  73. package/dist/components/ui/dialog.d.ts +18 -0
  74. package/dist/components/ui/dialog.d.ts.map +1 -0
  75. package/dist/components/ui/dialog.js +37 -0
  76. package/dist/components/ui/dialog.js.map +1 -0
  77. package/dist/components/ui/drawer.d.ts +14 -0
  78. package/dist/components/ui/drawer.d.ts.map +1 -0
  79. package/dist/components/ui/drawer.js +35 -0
  80. package/dist/components/ui/drawer.js.map +1 -0
  81. package/dist/components/ui/input.d.ts +4 -0
  82. package/dist/components/ui/input.d.ts.map +1 -0
  83. package/dist/components/ui/input.js +7 -0
  84. package/dist/components/ui/input.js.map +1 -0
  85. package/dist/components/ui/label.d.ts +5 -0
  86. package/dist/components/ui/label.d.ts.map +1 -0
  87. package/dist/components/ui/label.js +8 -0
  88. package/dist/components/ui/label.js.map +1 -0
  89. package/dist/components/ui/popover.d.ts +11 -0
  90. package/dist/components/ui/popover.d.ts.map +1 -0
  91. package/dist/components/ui/popover.js +26 -0
  92. package/dist/components/ui/popover.js.map +1 -0
  93. package/dist/components/ui/progress.d.ts +5 -0
  94. package/dist/components/ui/progress.d.ts.map +1 -0
  95. package/dist/components/ui/progress.js +9 -0
  96. package/dist/components/ui/progress.js.map +1 -0
  97. package/dist/components/ui/select.d.ts +16 -0
  98. package/dist/components/ui/select.d.ts.map +1 -0
  99. package/dist/components/ui/select.js +39 -0
  100. package/dist/components/ui/select.js.map +1 -0
  101. package/dist/components/ui/slider.d.ts +5 -0
  102. package/dist/components/ui/slider.d.ts.map +1 -0
  103. package/dist/components/ui/slider.js +15 -0
  104. package/dist/components/ui/slider.js.map +1 -0
  105. package/dist/components/ui/sonner.d.ts +4 -0
  106. package/dist/components/ui/sonner.d.ts.map +1 -0
  107. package/dist/components/ui/sonner.js +21 -0
  108. package/dist/components/ui/sonner.js.map +1 -0
  109. package/dist/components/ui/switch.d.ts +7 -0
  110. package/dist/components/ui/switch.d.ts.map +1 -0
  111. package/dist/components/ui/switch.js +9 -0
  112. package/dist/components/ui/switch.js.map +1 -0
  113. package/dist/components/ui/textarea.d.ts +4 -0
  114. package/dist/components/ui/textarea.d.ts.map +1 -0
  115. package/dist/components/ui/textarea.js +7 -0
  116. package/dist/components/ui/textarea.js.map +1 -0
  117. package/dist/components/ui/tooltip.d.ts +8 -0
  118. package/dist/components/ui/tooltip.d.ts.map +1 -0
  119. package/dist/components/ui/tooltip.js +18 -0
  120. package/dist/components/ui/tooltip.js.map +1 -0
  121. package/dist/context/index.d.ts +31 -0
  122. package/dist/context/index.d.ts.map +1 -0
  123. package/dist/context/index.js +98 -0
  124. package/dist/context/index.js.map +1 -0
  125. package/dist/context.d.ts +2 -0
  126. package/dist/context.d.ts.map +1 -0
  127. package/dist/context.js +2 -0
  128. package/dist/context.js.map +1 -0
  129. package/dist/hooks.d.ts +21 -0
  130. package/dist/hooks.d.ts.map +1 -0
  131. package/dist/hooks.js +156 -0
  132. package/dist/hooks.js.map +1 -0
  133. package/dist/idb.d.ts +13 -0
  134. package/dist/idb.d.ts.map +1 -0
  135. package/dist/idb.js +67 -0
  136. package/dist/idb.js.map +1 -0
  137. package/dist/lib/minimd.d.ts +3 -0
  138. package/dist/lib/minimd.d.ts.map +1 -0
  139. package/dist/lib/minimd.js +97 -0
  140. package/dist/lib/minimd.js.map +1 -0
  141. package/dist/lib/utils.d.ts +3 -0
  142. package/dist/lib/utils.d.ts.map +1 -0
  143. package/dist/lib/utils.js +6 -0
  144. package/dist/lib/utils.js.map +1 -0
  145. package/dist/load-client.d.ts +2 -0
  146. package/dist/load-client.d.ts.map +1 -0
  147. package/dist/load-client.js +6 -0
  148. package/dist/load-client.js.map +1 -0
  149. package/dist/main.d.ts +4 -0
  150. package/dist/main.d.ts.map +1 -0
  151. package/dist/main.js +16 -0
  152. package/dist/main.js.map +1 -0
  153. package/dist/mods/editor-ui/client.d.ts +6 -0
  154. package/dist/mods/editor-ui/client.d.ts.map +1 -0
  155. package/dist/mods/editor-ui/client.js +8 -0
  156. package/dist/mods/editor-ui/client.js.map +1 -0
  157. package/dist/mods/editor-ui/default-view.d.ts +2 -0
  158. package/dist/mods/editor-ui/default-view.d.ts.map +1 -0
  159. package/dist/mods/editor-ui/default-view.js +71 -0
  160. package/dist/mods/editor-ui/default-view.js.map +1 -0
  161. package/dist/mods/editor-ui/dir-view.d.ts +2 -0
  162. package/dist/mods/editor-ui/dir-view.d.ts.map +1 -0
  163. package/dist/mods/editor-ui/dir-view.js +42 -0
  164. package/dist/mods/editor-ui/dir-view.js.map +1 -0
  165. package/dist/mods/editor-ui/form-fields.d.ts +6 -0
  166. package/dist/mods/editor-ui/form-fields.d.ts.map +1 -0
  167. package/dist/mods/editor-ui/form-fields.js +401 -0
  168. package/dist/mods/editor-ui/form-fields.js.map +1 -0
  169. package/dist/mods/editor-ui/layout-view.d.ts +2 -0
  170. package/dist/mods/editor-ui/layout-view.d.ts.map +1 -0
  171. package/dist/mods/editor-ui/layout-view.js +22 -0
  172. package/dist/mods/editor-ui/layout-view.js.map +1 -0
  173. package/dist/mods/editor-ui/list-items.d.ts +2 -0
  174. package/dist/mods/editor-ui/list-items.d.ts.map +1 -0
  175. package/dist/mods/editor-ui/list-items.js +38 -0
  176. package/dist/mods/editor-ui/list-items.js.map +1 -0
  177. package/dist/mods/editor-ui/node-utils.d.ts +10 -0
  178. package/dist/mods/editor-ui/node-utils.d.ts.map +1 -0
  179. package/dist/mods/editor-ui/node-utils.js +76 -0
  180. package/dist/mods/editor-ui/node-utils.js.map +1 -0
  181. package/dist/mods/editor-ui/user-view.d.ts +2 -0
  182. package/dist/mods/editor-ui/user-view.d.ts.map +1 -0
  183. package/dist/mods/editor-ui/user-view.js +47 -0
  184. package/dist/mods/editor-ui/user-view.js.map +1 -0
  185. package/dist/mods/treenity/client.d.ts +4 -0
  186. package/dist/mods/treenity/client.d.ts.map +1 -0
  187. package/dist/mods/treenity/client.js +6 -0
  188. package/dist/mods/treenity/client.js.map +1 -0
  189. package/dist/mods/treenity/groups/index.d.ts +2 -0
  190. package/dist/mods/treenity/groups/index.d.ts.map +1 -0
  191. package/dist/mods/treenity/groups/index.js +27 -0
  192. package/dist/mods/treenity/groups/index.js.map +1 -0
  193. package/dist/mods/treenity/preview.d.ts +6 -0
  194. package/dist/mods/treenity/preview.d.ts.map +1 -0
  195. package/dist/mods/treenity/preview.js +95 -0
  196. package/dist/mods/treenity/preview.js.map +1 -0
  197. package/dist/mods/treenity/ref-view.d.ts +2 -0
  198. package/dist/mods/treenity/ref-view.d.ts.map +1 -0
  199. package/dist/mods/treenity/ref-view.js +29 -0
  200. package/dist/mods/treenity/ref-view.js.map +1 -0
  201. package/dist/mods/treenity/schema-form.d.ts +2 -0
  202. package/dist/mods/treenity/schema-form.d.ts.map +1 -0
  203. package/dist/mods/treenity/schema-form.js +38 -0
  204. package/dist/mods/treenity/schema-form.js.map +1 -0
  205. package/dist/mods/treenity/seed.d.ts +2 -0
  206. package/dist/mods/treenity/seed.d.ts.map +1 -0
  207. package/dist/mods/treenity/seed.js +53 -0
  208. package/dist/mods/treenity/seed.js.map +1 -0
  209. package/dist/mods/treenity/server.d.ts +2 -0
  210. package/dist/mods/treenity/server.d.ts.map +1 -0
  211. package/dist/mods/treenity/server.js +2 -0
  212. package/dist/mods/treenity/server.js.map +1 -0
  213. package/dist/mods/treenity/type-view.d.ts +2 -0
  214. package/dist/mods/treenity/type-view.d.ts.map +1 -0
  215. package/dist/mods/treenity/type-view.js +36 -0
  216. package/dist/mods/treenity/type-view.js.map +1 -0
  217. package/dist/remote-tree.d.ts +6 -0
  218. package/dist/remote-tree.d.ts.map +1 -0
  219. package/dist/remote-tree.js +18 -0
  220. package/dist/remote-tree.js.map +1 -0
  221. package/dist/schema-loader.d.ts +19 -0
  222. package/dist/schema-loader.d.ts.map +1 -0
  223. package/dist/schema-loader.js +63 -0
  224. package/dist/schema-loader.js.map +1 -0
  225. package/dist/trpc.d.ts +187 -0
  226. package/dist/trpc.d.ts.map +1 -0
  227. package/dist/trpc.js +21 -0
  228. package/dist/trpc.js.map +1 -0
  229. package/package.json +88 -0
  230. package/src/AclEditor.tsx +330 -0
  231. package/src/App.tsx +775 -0
  232. package/src/CLAUDE.md +16 -0
  233. package/src/Inspector.tsx +857 -0
  234. package/src/Tree.tsx +237 -0
  235. package/src/ViewPage.tsx +45 -0
  236. package/src/bind/bind.test.ts +316 -0
  237. package/src/bind/computed.ts +64 -0
  238. package/src/bind/engine.ts +198 -0
  239. package/src/bind/eval.ts +108 -0
  240. package/src/bind/hook.ts +112 -0
  241. package/src/bind/parse.ts +104 -0
  242. package/src/bind/pipes.ts +71 -0
  243. package/src/cache.test.ts +139 -0
  244. package/src/cache.ts +244 -0
  245. package/src/client-tree.test.ts +116 -0
  246. package/src/client-tree.ts +24 -0
  247. package/src/client.ts +11 -0
  248. package/src/components/ui/accordion.tsx +63 -0
  249. package/src/components/ui/badge.tsx +27 -0
  250. package/src/components/ui/button.tsx +44 -0
  251. package/src/components/ui/checkbox.tsx +19 -0
  252. package/src/components/ui/dialog.tsx +156 -0
  253. package/src/components/ui/drawer.tsx +132 -0
  254. package/src/components/ui/input.tsx +19 -0
  255. package/src/components/ui/label.tsx +21 -0
  256. package/src/components/ui/popover.tsx +86 -0
  257. package/src/components/ui/progress.tsx +30 -0
  258. package/src/components/ui/select.tsx +189 -0
  259. package/src/components/ui/slider.tsx +62 -0
  260. package/src/components/ui/sonner.tsx +32 -0
  261. package/src/components/ui/switch.tsx +34 -0
  262. package/src/components/ui/textarea.tsx +17 -0
  263. package/src/components/ui/tooltip.tsx +56 -0
  264. package/src/context/index.tsx +131 -0
  265. package/src/context.ts +1 -0
  266. package/src/hooks.ts +208 -0
  267. package/src/idb.ts +80 -0
  268. package/src/index.html +14 -0
  269. package/src/lib/minimd.css +28 -0
  270. package/src/lib/minimd.ts +95 -0
  271. package/src/lib/utils.ts +6 -0
  272. package/src/load-client.ts +5 -0
  273. package/src/main.tsx +22 -0
  274. package/src/mods/editor-ui/CLAUDE.md +3 -0
  275. package/src/mods/editor-ui/client.ts +8 -0
  276. package/src/mods/editor-ui/default-view.tsx +148 -0
  277. package/src/mods/editor-ui/dir-view.tsx +91 -0
  278. package/src/mods/editor-ui/form-fields.tsx +861 -0
  279. package/src/mods/editor-ui/layout-view.tsx +62 -0
  280. package/src/mods/editor-ui/list-items.tsx +63 -0
  281. package/src/mods/editor-ui/node-utils.ts +84 -0
  282. package/src/mods/editor-ui/user-view.tsx +101 -0
  283. package/src/mods/treenity/CLAUDE.md +7 -0
  284. package/src/mods/treenity/client.ts +6 -0
  285. package/src/mods/treenity/groups/index.tsx +65 -0
  286. package/src/mods/treenity/preview.tsx +133 -0
  287. package/src/mods/treenity/ref-view.tsx +87 -0
  288. package/src/mods/treenity/schema-form.tsx +65 -0
  289. package/src/mods/treenity/seed.ts +56 -0
  290. package/src/mods/treenity/server.ts +1 -0
  291. package/src/mods/treenity/type-view.tsx +116 -0
  292. package/src/remote-tree.test.ts +142 -0
  293. package/src/remote-tree.ts +25 -0
  294. package/src/schema-loader.ts +84 -0
  295. package/src/style.css +1269 -0
  296. package/src/trpc.ts +27 -0
  297. package/src/vite-env.d.ts +3 -0
@@ -0,0 +1,43 @@
1
+ // Pipe registry — Angular-style transforms for $map expressions
2
+ const registry = new Map();
3
+ export function registerPipe(name, fn) {
4
+ registry.set(name, fn);
5
+ }
6
+ export function getPipe(name) {
7
+ return registry.get(name);
8
+ }
9
+ // ── Collection pipes ──
10
+ registerPipe('last', (input) => {
11
+ const arr = input;
12
+ return arr.length ? arr[arr.length - 1] : undefined;
13
+ });
14
+ registerPipe('first', (input) => {
15
+ const arr = input;
16
+ return arr.length ? arr[0] : undefined;
17
+ });
18
+ registerPipe('count', (input) => input.length);
19
+ registerPipe('map', (input, field) => {
20
+ return input.map(item => item[field]);
21
+ });
22
+ registerPipe('sum', (input) => {
23
+ return input.reduce((a, b) => a + b, 0);
24
+ });
25
+ registerPipe('avg', (input) => {
26
+ const arr = input;
27
+ return arr.length ? arr.reduce((a, b) => a + b, 0) / arr.length : 0;
28
+ });
29
+ registerPipe('max', (input) => Math.max(...input));
30
+ registerPipe('min', (input) => Math.min(...input));
31
+ // ── Scalar pipes ──
32
+ registerPipe('div', (input, n) => input / n);
33
+ registerPipe('mul', (input, n) => input * n);
34
+ registerPipe('add', (input, n) => input + n);
35
+ registerPipe('sub', (input, n) => input - n);
36
+ registerPipe('clamp', (input, min, max) => Math.min(Math.max(input, min), max));
37
+ registerPipe('round', (input) => Math.round(input));
38
+ registerPipe('abs', (input) => Math.abs(input));
39
+ registerPipe('floor', (input) => Math.floor(input));
40
+ registerPipe('ceil', (input) => Math.ceil(input));
41
+ // ── Reactivity control ──
42
+ registerPipe('once', (input) => input);
43
+ //# sourceMappingURL=pipes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipes.js","sourceRoot":"","sources":["../../src/bind/pipes.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAMhE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAkB,CAAC;AAE3C,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,EAAU;IACnD,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACzB,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAY;IAClC,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,yBAAyB;AAEzB,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;IAC7B,MAAM,GAAG,GAAG,KAAmB,CAAC;IAChC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;IAC9B,MAAM,GAAG,GAAG,KAAmB,CAAC;IAChC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAE,KAAmB,CAAC,MAAM,CAAC,CAAC;AAE9D,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;IACnC,OAAQ,KAAmC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,CAAC;AACjF,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC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AG,EAAE,EAAE,CACxC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAe,EAAE,GAAa,CAAC,EAAE,GAAa,CAAC,CAAC,CAAC;AAErE,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC,CAAC;AAE9D,YAAY,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAe,CAAC,CAAC,CAAC;AAE1D,YAAY,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAe,CAAC,CAAC,CAAC;AAE9D,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC,CAAC;AAE5D,2BAA2B;AAE3B,YAAY,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { NodeData } from '@treenity/core/core';
2
+ type Sub = () => void;
3
+ export declare const getLastUpdated: (path: string) => number;
4
+ export declare const get: (path: string) => NodeData | undefined;
5
+ export declare const has: (path: string) => boolean;
6
+ export declare const size: () => number;
7
+ export declare const getVersion: () => number;
8
+ export declare function getChildren(parent: string): NodeData[];
9
+ export declare function addToParent(path: string, parent: string): void;
10
+ export declare function removeFromParent(path: string, parent: string): void;
11
+ export declare function put(node: NodeData, virtualParent?: string): void;
12
+ export declare function putMany(items: NodeData[], virtualParent?: string): void;
13
+ export declare function remove(path: string, virtualParent?: string): void;
14
+ export declare const subscribePath: (path: string, cb: Sub) => () => void;
15
+ export declare const subscribeChildren: (parent: string, cb: Sub) => () => void;
16
+ export declare const subscribeGlobal: (cb: Sub) => (() => void);
17
+ export declare function onNodePut(cb: (path: string) => void): () => void;
18
+ export declare function notifyPath(path: string): void;
19
+ export declare function getSnapshot(path: string): NodeData | undefined;
20
+ export declare const getSSEGen: () => number;
21
+ export declare function subscribeSSEGen(cb: Sub): () => boolean;
22
+ export declare function signalReconnect(): void;
23
+ export declare function clear(): void;
24
+ export declare function hydrate(): Promise<void>;
25
+ export declare const raw: () => Map<string, NodeData>;
26
+ export {};
27
+ //# sourceMappingURL=cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAGpD,KAAK,GAAG,GAAG,MAAM,IAAI,CAAC;AAetB,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,WAA+B,CAAC;AAgC3E,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,yBAAoB,CAAC;AACrD,eAAO,MAAM,GAAG,GAAI,MAAM,MAAM,YAAoB,CAAC;AACrD,eAAO,MAAM,IAAI,cAAmB,CAAC;AACrC,eAAO,MAAM,UAAU,cAAgB,CAAC;AAExC,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,EAAE,CAyBtD;AAID,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAQvD;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAQ5D;AAID,wBAAgB,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE,aAAa,CAAC,EAAE,MAAM,QAgBzD;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,aAAa,CAAC,EAAE,MAAM,QA2BhE;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,QAY1D;AAID,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,IAAI,GAAG,WArJsB,IAqJS,CAAC;AACnF,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,EAAE,IAAI,GAAG,WAtJgB,IAsJkB,CAAC;AAC5F,eAAO,MAAM,eAAe,GAAI,IAAI,GAAG,KAAG,CAAC,MAAM,IAAI,CAGpD,CAAC;AAIF,wBAAgB,SAAS,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,MAAM,IAAI,CAGhE;AAGD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,QAA2B;AAClE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAI9D;AAOD,eAAO,MAAM,SAAS,cAAe,CAAC;AACtC,wBAAgB,eAAe,CAAC,EAAE,EAAE,GAAG,iBAGtC;AACD,wBAAgB,eAAe,SAG9B;AAID,wBAAgB,KAAK,SAOpB;AAID,wBAAsB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAiB7C;AAGD,eAAO,MAAM,GAAG,6BAAc,CAAC"}
package/dist/cache.js ADDED
@@ -0,0 +1,236 @@
1
+ // Treenity Client Cache — reactive node store
2
+ // useSyncExternalStore-friendly: stable snapshots, targeted notifications
3
+ // IDB persistence: fire-and-forget writes, hydrate() on startup.
4
+ import * as idb from './idb';
5
+ const nodes = new Map();
6
+ // Explicit parent -> children index. This allows nodes to have their real $path
7
+ // while still appearing as children of virtual folders like query mounts.
8
+ const parentIndex = new Map();
9
+ const pathSubs = new Map();
10
+ const childSubs = new Map();
11
+ const globalSubs = new Set();
12
+ const childSnap = new Map();
13
+ let version = 0;
14
+ // lastUpdated: timestamp of last put() per path.
15
+ // Used for reconnect refresh ordering (most recently viewed first).
16
+ const lastUpdated = new Map();
17
+ export const getLastUpdated = (path) => lastUpdated.get(path) ?? 0;
18
+ function addSub(map, key, cb) {
19
+ if (!map.has(key))
20
+ map.set(key, new Set());
21
+ map.get(key).add(cb);
22
+ return () => {
23
+ const s = map.get(key);
24
+ if (s) {
25
+ s.delete(cb);
26
+ if (!s.size)
27
+ map.delete(key);
28
+ }
29
+ };
30
+ }
31
+ function fire(map, key) {
32
+ const s = map.get(key);
33
+ if (s)
34
+ for (const cb of s)
35
+ cb();
36
+ }
37
+ function bump() {
38
+ version++;
39
+ for (const cb of globalSubs)
40
+ cb();
41
+ }
42
+ function parentOf(p) {
43
+ if (p === '/')
44
+ return null;
45
+ const i = p.lastIndexOf('/');
46
+ return i <= 0 ? '/' : p.slice(0, i);
47
+ }
48
+ // ── Reads ──
49
+ export const get = (path) => nodes.get(path);
50
+ export const has = (path) => nodes.has(path);
51
+ export const size = () => nodes.size;
52
+ export const getVersion = () => version;
53
+ export function getChildren(parent) {
54
+ let snap = childSnap.get(parent);
55
+ if (snap)
56
+ return snap;
57
+ const out = [];
58
+ const children = parentIndex.get(parent);
59
+ if (children) {
60
+ for (const p of children) {
61
+ const n = nodes.get(p);
62
+ if (n)
63
+ out.push(n);
64
+ }
65
+ }
66
+ else {
67
+ // Fallback: If not indexed explicitly, find children by string prefix
68
+ const prefix = parent === '/' ? '/' : parent + '/';
69
+ for (const [p, n] of nodes) {
70
+ if (p === parent || !p.startsWith(prefix))
71
+ continue;
72
+ const rest = parent === '/' ? p.slice(1) : p.slice(prefix.length);
73
+ if (rest && !rest.includes('/'))
74
+ out.push(n);
75
+ }
76
+ }
77
+ out.sort((a, b) => a.$path.localeCompare(b.$path));
78
+ childSnap.set(parent, out);
79
+ return out;
80
+ }
81
+ // ── Parent Index Management ──
82
+ export function addToParent(path, parent) {
83
+ if (!parentIndex.has(parent))
84
+ parentIndex.set(parent, new Set());
85
+ if (!parentIndex.get(parent).has(path)) {
86
+ parentIndex.get(parent).add(path);
87
+ childSnap.delete(parent);
88
+ fire(childSubs, parent);
89
+ bump();
90
+ }
91
+ }
92
+ export function removeFromParent(path, parent) {
93
+ const children = parentIndex.get(parent);
94
+ if (children && children.has(path)) {
95
+ children.delete(path);
96
+ childSnap.delete(parent);
97
+ fire(childSubs, parent);
98
+ bump();
99
+ }
100
+ }
101
+ // ── Writes ──
102
+ export function put(node, virtualParent) {
103
+ nodes.set(node.$path, node);
104
+ const p = virtualParent ?? parentOf(node.$path);
105
+ if (p !== null) {
106
+ if (!parentIndex.has(p))
107
+ parentIndex.set(p, new Set());
108
+ parentIndex.get(p).add(node.$path);
109
+ childSnap.delete(p);
110
+ }
111
+ fire(pathSubs, node.$path);
112
+ if (p !== null)
113
+ fire(childSubs, p);
114
+ bump();
115
+ for (const h of putHooks)
116
+ h(node.$path);
117
+ const ts = Date.now();
118
+ lastUpdated.set(node.$path, ts);
119
+ idb.save({ path: node.$path, data: node, lastUpdated: ts, virtualParent }).catch(() => { });
120
+ }
121
+ export function putMany(items, virtualParent) {
122
+ const dirty = new Set();
123
+ if (virtualParent) {
124
+ if (!parentIndex.has(virtualParent))
125
+ parentIndex.set(virtualParent, new Set());
126
+ dirty.add(virtualParent);
127
+ }
128
+ const ts = Date.now();
129
+ const idbEntries = [];
130
+ for (const n of items) {
131
+ nodes.set(n.$path, n);
132
+ lastUpdated.set(n.$path, ts);
133
+ fire(pathSubs, n.$path);
134
+ const p = virtualParent ?? parentOf(n.$path);
135
+ if (p !== null) {
136
+ if (!parentIndex.has(p))
137
+ parentIndex.set(p, new Set());
138
+ parentIndex.get(p).add(n.$path);
139
+ dirty.add(p);
140
+ childSnap.delete(p);
141
+ }
142
+ idbEntries.push({ path: n.$path, data: n, lastUpdated: ts, virtualParent });
143
+ }
144
+ for (const p of dirty) {
145
+ childSnap.delete(p);
146
+ fire(childSubs, p);
147
+ }
148
+ if (items.length || dirty.size)
149
+ bump();
150
+ idb.saveMany(idbEntries).catch(() => { });
151
+ }
152
+ export function remove(path, virtualParent) {
153
+ nodes.delete(path);
154
+ lastUpdated.delete(path);
155
+ const p = virtualParent ?? parentOf(path);
156
+ if (p !== null) {
157
+ parentIndex.get(p)?.delete(path);
158
+ childSnap.delete(p);
159
+ }
160
+ fire(pathSubs, path);
161
+ if (p !== null)
162
+ fire(childSubs, p);
163
+ bump();
164
+ idb.del(path).catch(() => { });
165
+ }
166
+ // ── Subscriptions ──
167
+ export const subscribePath = (path, cb) => addSub(pathSubs, path, cb);
168
+ export const subscribeChildren = (parent, cb) => addSub(childSubs, parent, cb);
169
+ export const subscribeGlobal = (cb) => {
170
+ globalSubs.add(cb);
171
+ return () => globalSubs.delete(cb);
172
+ };
173
+ // ── Per-put hook (used by bind engine) ──
174
+ const putHooks = new Set();
175
+ export function onNodePut(cb) {
176
+ putHooks.add(cb);
177
+ return () => putHooks.delete(cb);
178
+ }
179
+ // ── Extra accessors ──
180
+ export function notifyPath(path) { fire(pathSubs, path); }
181
+ export function getSnapshot(path) {
182
+ const node = nodes.get(path);
183
+ if (!node)
184
+ return undefined;
185
+ return structuredClone(node);
186
+ }
187
+ // ── SSE Reconnect ──
188
+ // Generation counter — bumped when SSE reconnects with preserved=false.
189
+ // useChildren depends on this to re-fetch and re-register watches.
190
+ let sseGen = 0;
191
+ const genSubs = new Set();
192
+ export const getSSEGen = () => sseGen;
193
+ export function subscribeSSEGen(cb) {
194
+ genSubs.add(cb);
195
+ return () => genSubs.delete(cb);
196
+ }
197
+ export function signalReconnect() {
198
+ sseGen++;
199
+ for (const cb of genSubs)
200
+ cb();
201
+ }
202
+ // ── Bulk ──
203
+ export function clear() {
204
+ nodes.clear();
205
+ parentIndex.clear();
206
+ childSnap.clear();
207
+ lastUpdated.clear();
208
+ bump();
209
+ idb.clearAll().catch(() => { });
210
+ }
211
+ // Populate cache from IDB on startup — no IDB writes triggered.
212
+ // Call before first render for instant stale paint.
213
+ export async function hydrate() {
214
+ try {
215
+ const entries = await idb.loadAll();
216
+ for (const { data, lastUpdated: ts, virtualParent } of entries) {
217
+ nodes.set(data.$path, data);
218
+ lastUpdated.set(data.$path, ts);
219
+ const p = virtualParent ?? parentOf(data.$path);
220
+ if (p !== null) {
221
+ if (!parentIndex.has(p))
222
+ parentIndex.set(p, new Set());
223
+ parentIndex.get(p).add(data.$path);
224
+ childSnap.delete(p);
225
+ }
226
+ }
227
+ if (entries.length)
228
+ bump();
229
+ }
230
+ catch {
231
+ // IDB unavailable (private browsing, etc.) — continue without persistence
232
+ }
233
+ }
234
+ // Expose raw Map for Tree component (read-only contract)
235
+ export const raw = () => nodes;
236
+ //# sourceMappingURL=cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache.js","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,0EAA0E;AAC1E,iEAAiE;AAGjE,OAAO,KAAK,GAAG,MAAM,OAAO,CAAC;AAI7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;AAC1C,gFAAgF;AAChF,0EAA0E;AAC1E,MAAM,WAAW,GAAG,IAAI,GAAG,EAAuB,CAAC;AACnD,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;AAC7C,MAAM,SAAS,GAAG,IAAI,GAAG,EAAoB,CAAC;AAC9C,MAAM,UAAU,GAAG,IAAI,GAAG,EAAO,CAAC;AAClC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAsB,CAAC;AAChD,IAAI,OAAO,GAAG,CAAC,CAAC;AAEhB,iDAAiD;AACjD,oEAAoE;AACpE,MAAM,WAAW,GAAG,IAAI,GAAG,EAAkB,CAAC;AAC9C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAE3E,SAAS,MAAM,CAAC,GAA0B,EAAE,GAAW,EAAE,EAAO;IAC9D,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;QAAE,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;IAC3C,GAAG,CAAC,GAAG,CAAC,GAAG,CAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACtB,OAAO,GAAG,EAAE;QACV,MAAM,CAAC,GAAG,GAAG,CAAC,GA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gE;AAChE,oDAAoD;AACpD,MAAM,CAAC,KAAK,UAAU,OAAO;IAC3B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,EAAE,CAAC;QACpC,KAAK,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,OAAO,EAAE,CAAC;YAC/D,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC5B,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YAChC,MAAM,CAAC,GAAG,aAAa,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChD,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;oBAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;gBACvD,WAAW,CAAC,GAAG,CAAC,CAAC,CAAE,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACpC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM;YAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,0EAA0E;IAC5E,CAAC;AACH,CAAC;AAED,yDAAyD;AACzD,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,KAAK,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { trpc } from './trpc';
2
+ type TrpcClient = typeof trpc;
3
+ export declare function createClientTree(client: TrpcClient): {
4
+ tree: import("@treenity/core/tree").Tree;
5
+ local: import("@treenity/core/tree").Tree;
6
+ remote: import("@treenity/core/tree").Tree;
7
+ };
8
+ export {};
9
+ //# sourceMappingURL=client-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-tree.d.ts","sourceRoot":"","sources":["../src/client-tree.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,KAAK,UAAU,GAAG,OAAO,IAAI,CAAC;AAE9B,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU;;;;EAWlD"}
@@ -0,0 +1,14 @@
1
+ // Unified Client Tree — the browser as a peer node.
2
+ // /local/* paths live in browser memory only (never hit the network).
3
+ // Everything else routes through tRPC to the server.
4
+ // Same Tree interface everywhere — components don't know where data lives.
5
+ import { createFilterTree, createMemoryTree } from '@treenity/core/tree';
6
+ import { withCache } from '@treenity/core/tree/cache';
7
+ import { createRemoteTree } from './remote-tree';
8
+ export function createClientTree(client) {
9
+ const local = createMemoryTree();
10
+ const remote = withCache(createRemoteTree(client));
11
+ const tree = createFilterTree(local, remote, (node) => node.$path.startsWith('/local'));
12
+ return { tree, local, remote };
13
+ }
14
+ //# sourceMappingURL=client-tree.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-tree.js","sourceRoot":"","sources":["../src/client-tree.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,sEAAsE;AACtE,qDAAqD;AACrD,2EAA2E;AAE3E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAKjD,MAAM,UAAU,gBAAgB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAG,gBAAgB,EAAE,CAAC;IACjC,MAAM,MAAM,GAAG,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEnD,MAAM,IAAI,GAAG,gBAAgB,CAC3B,KAAK,EACL,MAAM,EACN,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,CAAC,CAC1C,CAAC;IAEF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const tree: import("@treenity/core/tree").Tree, local: import("@treenity/core/tree").Tree, remote: import("@treenity/core/tree").Tree;
2
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,eAAO,MAAQ,IAAI,sCAAE,KAAK,sCAAE,MAAM,oCAA2B,CAAC"}
package/dist/client.js ADDED
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+ // The browser peer node — singleton client tree.
3
+ // /local/* in memory, everything else via tRPC.
4
+ import { createClientTree } from './client-tree';
5
+ import { trpc } from './trpc';
6
+ export const { tree, local, remote } = createClientTree(trpc);
7
+ // Dev: expose tree for console debugging (e.g. __tree.get('/local/ui/theme'))
8
+ if (import.meta.env?.DEV)
9
+ globalThis.__tree = tree;
10
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,iDAAiD;AACjD,gDAAgD;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAE9D,8EAA8E;AAC9E,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG;IAAG,UAAkB,CAAC,MAAM,GAAG,IAAI,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { Accordion as AccordionPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Accordion({ ...props }: React.ComponentProps<typeof AccordionPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function AccordionItem({ className, ...props }: React.ComponentProps<typeof AccordionPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
5
+ declare function AccordionTrigger({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function AccordionContent({ className, children, ...props }: React.ComponentProps<typeof AccordionPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
8
+ //# sourceMappingURL=accordion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.d.ts","sourceRoot":"","sources":["../../../src/components/ui/accordion.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,iBAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAEtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,IAAI,CAAC,2CAQtD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAgBzD;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,kBAAkB,CAAC,OAAO,CAAC,2CAUzD;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '#lib/utils';
3
+ import { ChevronDownIcon } from 'lucide-react';
4
+ import { Accordion as AccordionPrimitive } from 'radix-ui';
5
+ function Accordion({ ...props }) {
6
+ return _jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
7
+ }
8
+ function AccordionItem({ className, ...props }) {
9
+ return (_jsx(AccordionPrimitive.Item, { "data-slot": "accordion-item", className: cn("border-b last:border-b-0", className), ...props }));
10
+ }
11
+ function AccordionTrigger({ className, children, ...props }) {
12
+ return (_jsx(AccordionPrimitive.Header, { className: "flex", children: _jsxs(AccordionPrimitive.Trigger, { "data-slot": "accordion-trigger", className: cn("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })] }) }));
13
+ }
14
+ function AccordionContent({ className, children, ...props }) {
15
+ return (_jsx(AccordionPrimitive.Content, { "data-slot": "accordion-content", className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm", ...props, children: _jsx("div", { className: cn("pt-0 pb-4", className), children: children }) }));
16
+ }
17
+ export { Accordion, AccordionItem, AccordionTrigger, AccordionContent };
18
+ //# sourceMappingURL=accordion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accordion.js","sourceRoot":"","sources":["../../../src/components/ui/accordion.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG3D,SAAS,SAAS,CAAC,EACjB,GAAG,KAAK,EAC6C;IACrD,OAAO,KAAC,kBAAkB,CAAC,IAAI,iBAAW,WAAW,KAAK,KAAK,GAAI,CAAA;AACrE,CAAC;AAED,SAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EAC6C;IACrD,OAAO,CACL,KAAC,kBAAkB,CAAC,IAAI,iBACZ,gBAAgB,EAC1B,SAAS,EAAE,EAAE,CAAC,0BAA0B,EAAE,SAAS,CAAC,KAChD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD;IACxD,OAAO,CACL,KAAC,kBAAkB,CAAC,MAAM,IAAC,SAAS,EAAC,MAAM,YACzC,MAAC,kBAAkB,CAAC,OAAO,iBACf,mBAAmB,EAC7B,SAAS,EAAE,EAAE,CACX,4SAA4S,EAC5S,SAAS,CACV,KACG,KAAK,aAER,QAAQ,EACT,KAAC,eAAe,IAAC,SAAS,EAAC,6GAA6G,GAAG,IAChH,GACH,CAC7B,CAAA;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACgD;IACxD,OAAO,CACL,KAAC,kBAAkB,CAAC,OAAO,iBACf,mBAAmB,EAC7B,SAAS,EAAC,2GAA2G,KACjH,KAAK,YAET,cAAK,SAAS,EAAE,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC,YAAG,QAAQ,GAAO,GACjC,CAC9B,CAAA;AACH,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,10 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { type HTMLAttributes } from 'react';
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ export interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
7
+ }
8
+ declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
9
+ export { Badge, badgeVariants };
10
+ //# sourceMappingURL=badge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,QAAA,MAAM,aAAa;;8EAalB,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;CAAG;AAE/E,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,2CAE1D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '#lib/utils';
3
+ import { cva } from 'class-variance-authority';
4
+ const badgeVariants = cva('inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2', {
5
+ variants: {
6
+ variant: {
7
+ default: 'border-transparent bg-primary text-primary-foreground shadow',
8
+ secondary: 'border-transparent bg-secondary text-secondary-foreground',
9
+ destructive: 'border-transparent bg-destructive text-destructive-foreground shadow',
10
+ outline: 'text-foreground',
11
+ },
12
+ },
13
+ defaultVariants: { variant: 'default' },
14
+ });
15
+ function Badge({ className, variant, ...props }) {
16
+ return _jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
17
+ }
18
+ export { Badge, badgeVariants };
19
+ //# sourceMappingURL=badge.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../src/components/ui/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAGlE,MAAM,aAAa,GAAG,GAAG,CACvB,sKAAsK,EACtK;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,8DAA8D;YACvE,SAAS,EAAE,2DAA2D;YACtE,WAAW,EAAE,sEAAsE;YACnF,OAAO,EAAE,iBAAiB;SAC3B;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;CACxC,CACF,CAAC;AAKF,SAAS,KAAK,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,KAAK,EAAc;IACzD,OAAO,cAAK,SAAS,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAClF,CAAC;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type VariantProps } from 'class-variance-authority';
2
+ import { type ButtonHTMLAttributes } from 'react';
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "destructive" | "outline" | "outlined" | "secondary" | "ghost" | "link" | "primary" | "transparent" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
8
+ }
9
+ declare const Button: import("react").ForwardRefExoticComponent<ButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
10
+ export { Button, buttonVariants };
11
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,OAAO,CAAC;AAE9D,QAAA,MAAM,cAAc;;;8EA2BnB,CAAC;AAEF,MAAM,WAAW,WACf,SAAQ,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC;CAAG;AAEzF,QAAA,MAAM,MAAM,2GAIX,CAAC;AAGF,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '#lib/utils';
3
+ import { cva } from 'class-variance-authority';
4
+ import { forwardRef } from 'react';
5
+ const buttonVariants = cva('inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
6
+ variants: {
7
+ variant: {
8
+ default: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
9
+ destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
10
+ outline: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
11
+ outlined: 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',
12
+ secondary: 'bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80',
13
+ ghost: 'hover:bg-accent hover:text-accent-foreground',
14
+ link: 'text-primary underline-offset-4 hover:underline',
15
+ primary: 'bg-primary text-primary-foreground shadow hover:bg-primary/90',
16
+ transparent: 'bg-transparent hover:bg-accent hover:text-accent-foreground',
17
+ },
18
+ size: {
19
+ default: 'h-9 px-4 py-2',
20
+ sm: 'h-8 rounded-md px-3 text-xs',
21
+ lg: 'h-10 rounded-md px-8',
22
+ icon: 'h-9 w-9',
23
+ 'icon-sm': 'h-8 w-8',
24
+ },
25
+ },
26
+ defaultVariants: { variant: 'default', size: 'default' },
27
+ });
28
+ const Button = forwardRef(({ className, variant, size, ...props }, ref) => (_jsx("button", { className: cn(buttonVariants({ variant, size, className })), ref: ref, ...props })));
29
+ Button.displayName = 'Button';
30
+ export { Button, buttonVariants };
31
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../src/components/ui/button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAA6B,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9D,MAAM,cAAc,GAAG,GAAG,CACxB,uSAAuS,EACvS;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,+DAA+D;YACxE,WAAW,EAAE,8EAA8E;YAC3F,OAAO,EACL,0FAA0F;YAC5F,QAAQ,EACN,0FAA0F;YAC5F,SAAS,EAAE,wEAAwE;YACnF,KAAK,EAAE,8CAA8C;YACrD,IAAI,EAAE,iDAAiD;YACvD,OAAO,EAAE,+DAA+D;YACxE,WAAW,EAAE,6DAA6D;SAC3E;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,eAAe;YACxB,EAAE,EAAE,6BAA6B;YACjC,EAAE,EAAE,sBAAsB;YAC1B,IAAI,EAAE,SAAS;YACf,SAAS,EAAE,SAAS;SACrB;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACzD,CACF,CAAC;AAKF,MAAM,MAAM,GAAG,UAAU,CACvB,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAC/C,iBAAQ,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,KAAM,KAAK,GAAI,CAC7F,CACF,CAAC;AACF,MAAM,CAAC,WAAW,GAAG,QAAQ,CAAC;AAE9B,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type InputHTMLAttributes } from 'react';
2
+ declare const Checkbox: import("react").ForwardRefExoticComponent<InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
3
+ export { Checkbox };
4
+ //# sourceMappingURL=checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAE7D,QAAA,MAAM,QAAQ,oIAYb,CAAC;AAGF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '#lib/utils';
3
+ import { forwardRef } from 'react';
4
+ const Checkbox = forwardRef(({ className, ...props }, ref) => (_jsx("input", { type: "checkbox", className: cn('h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 accent-primary', className), ref: ref, ...props })));
5
+ Checkbox.displayName = 'Checkbox';
6
+ export { Checkbox };
7
+ //# sourceMappingURL=checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.js","sourceRoot":"","sources":["../../../src/components/ui/checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,UAAU,EAA4B,MAAM,OAAO,CAAC;AAE7D,MAAM,QAAQ,GAAG,UAAU,CACzB,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,CAChC,gBACE,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,EAAE,CACX,iMAAiM,EACjM,SAAS,CACV,EACD,GAAG,EAAE,GAAG,KACJ,KAAK,GACT,CACH,CACF,CAAC;AACF,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { Dialog as DialogPrimitive } from 'radix-ui';
2
+ import * as React from 'react';
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
13
+ showCloseButton?: boolean;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
16
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
17
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
18
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,2CAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,2CAErD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,2CAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,2CAyBA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,2CAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,2CAkBA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,2CAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,2CAQ1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from '#components/ui/button';
3
+ import { cn } from '#lib/utils';
4
+ import { XIcon } from 'lucide-react';
5
+ import { Dialog as DialogPrimitive } from 'radix-ui';
6
+ function Dialog({ ...props }) {
7
+ return _jsx(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
8
+ }
9
+ function DialogTrigger({ ...props }) {
10
+ return _jsx(DialogPrimitive.Trigger, { "data-slot": "dialog-trigger", ...props });
11
+ }
12
+ function DialogPortal({ ...props }) {
13
+ return _jsx(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
14
+ }
15
+ function DialogClose({ ...props }) {
16
+ return _jsx(DialogPrimitive.Close, { "data-slot": "dialog-close", ...props });
17
+ }
18
+ function DialogOverlay({ className, ...props }) {
19
+ return (_jsx(DialogPrimitive.Overlay, { "data-slot": "dialog-overlay", className: cn("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-black/50", className), ...props }));
20
+ }
21
+ function DialogContent({ className, children, showCloseButton = true, ...props }) {
22
+ return (_jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [_jsx(DialogOverlay, {}), _jsxs(DialogPrimitive.Content, { "data-slot": "dialog-content", className: cn("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg", className), ...props, children: [children, showCloseButton && (_jsxs(DialogPrimitive.Close, { "data-slot": "dialog-close", className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [_jsx(XIcon, {}), _jsx("span", { className: "sr-only", children: "Close" })] }))] })] }));
23
+ }
24
+ function DialogHeader({ className, ...props }) {
25
+ return (_jsx("div", { "data-slot": "dialog-header", className: cn("flex flex-col gap-2 text-center sm:text-left", className), ...props }));
26
+ }
27
+ function DialogFooter({ className, showCloseButton = false, children, ...props }) {
28
+ return (_jsxs("div", { "data-slot": "dialog-footer", className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className), ...props, children: [children, showCloseButton && (_jsx(DialogPrimitive.Close, { asChild: true, children: _jsx(Button, { variant: "outline", children: "Close" }) }))] }));
29
+ }
30
+ function DialogTitle({ className, ...props }) {
31
+ return (_jsx(DialogPrimitive.Title, { "data-slot": "dialog-title", className: cn("text-lg leading-none font-semibold", className), ...props }));
32
+ }
33
+ function DialogDescription({ className, ...props }) {
34
+ return (_jsx(DialogPrimitive.Description, { "data-slot": "dialog-description", className: cn("text-muted-foreground text-sm", className), ...props }));
35
+ }
36
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
37
+ //# sourceMappingURL=dialog.js.map