@constructive-io/ui 0.4.1 → 0.6.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 (343) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -22
  3. package/dist/components/alert-dialog.cjs +333 -0
  4. package/dist/components/alert-dialog.cjs.map +1 -0
  5. package/dist/components/alert-dialog.d.cts +32 -0
  6. package/dist/components/alert-dialog.d.ts +16 -15
  7. package/dist/components/alert-dialog.js +89 -102
  8. package/dist/components/alert-dialog.js.map +1 -1
  9. package/dist/components/alert.cjs +119 -0
  10. package/dist/components/alert.cjs.map +1 -0
  11. package/dist/components/alert.d.cts +19 -0
  12. package/dist/components/alert.d.ts +10 -5
  13. package/dist/components/alert.js +62 -6
  14. package/dist/components/alert.js.map +1 -1
  15. package/dist/components/app-bar.cjs +367 -0
  16. package/dist/components/app-bar.cjs.map +1 -0
  17. package/dist/components/app-bar.d.cts +26 -0
  18. package/dist/components/app-bar.d.ts +26 -0
  19. package/dist/components/app-bar.js +344 -0
  20. package/dist/components/app-bar.js.map +1 -0
  21. package/dist/components/app-shell.cjs +1792 -0
  22. package/dist/components/app-shell.cjs.map +1 -0
  23. package/dist/components/app-shell.d.cts +106 -0
  24. package/dist/components/app-shell.d.ts +106 -0
  25. package/dist/components/app-shell.js +1771 -0
  26. package/dist/components/app-shell.js.map +1 -0
  27. package/dist/components/autocomplete.cjs +418 -0
  28. package/dist/components/autocomplete.cjs.map +1 -0
  29. package/dist/components/autocomplete.d.cts +28 -0
  30. package/dist/components/autocomplete.d.ts +15 -15
  31. package/dist/components/autocomplete.js +9 -30
  32. package/dist/components/autocomplete.js.map +1 -1
  33. package/dist/components/avatar.cjs +51 -0
  34. package/dist/components/avatar.cjs.map +1 -0
  35. package/dist/components/avatar.d.cts +12 -0
  36. package/dist/components/avatar.d.ts +3 -4
  37. package/dist/components/avatar.js +11 -1
  38. package/dist/components/avatar.js.map +1 -1
  39. package/dist/components/badge.cjs +66 -0
  40. package/dist/components/badge.cjs.map +1 -0
  41. package/dist/components/badge.d.cts +15 -0
  42. package/dist/components/badge.js +1 -1
  43. package/dist/components/badge.js.map +1 -1
  44. package/dist/components/breadcrumb.cjs +118 -0
  45. package/dist/components/breadcrumb.cjs.map +1 -0
  46. package/dist/components/breadcrumb.d.cts +14 -0
  47. package/dist/components/breadcrumb.d.ts +9 -9
  48. package/dist/components/breadcrumb.js +19 -83
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button.cjs +169 -0
  51. package/dist/components/button.cjs.map +1 -0
  52. package/dist/components/button.d.cts +20 -0
  53. package/dist/components/button.d.ts +3 -0
  54. package/dist/components/button.js +105 -21
  55. package/dist/components/button.js.map +1 -1
  56. package/dist/components/calendar-rac.cjs +85 -0
  57. package/dist/components/calendar-rac.cjs.map +1 -0
  58. package/dist/components/calendar-rac.d.cts +13 -0
  59. package/dist/components/calendar-rac.d.ts +3 -3
  60. package/dist/components/card.cjs +99 -0
  61. package/dist/components/card.cjs.map +1 -0
  62. package/dist/components/card.d.cts +18 -0
  63. package/dist/components/card.d.ts +7 -8
  64. package/dist/components/card.js +23 -8
  65. package/dist/components/card.js.map +1 -1
  66. package/dist/components/checkbox-group.cjs +18 -0
  67. package/dist/components/checkbox-group.cjs.map +1 -0
  68. package/dist/components/checkbox-group.d.cts +7 -0
  69. package/dist/components/checkbox-group.d.ts +2 -2
  70. package/dist/components/checkbox.cjs +121 -0
  71. package/dist/components/checkbox.cjs.map +1 -0
  72. package/dist/components/checkbox.d.cts +8 -0
  73. package/dist/components/checkbox.d.ts +3 -3
  74. package/dist/components/checkbox.js +73 -41
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +127 -0
  77. package/dist/components/collapsible.cjs.map +1 -0
  78. package/dist/components/collapsible.d.cts +44 -0
  79. package/dist/components/collapsible.d.ts +8 -18
  80. package/dist/components/collapsible.js +7 -27
  81. package/dist/components/collapsible.js.map +1 -1
  82. package/dist/components/combobox.cjs +551 -0
  83. package/dist/components/combobox.cjs.map +1 -0
  84. package/dist/components/combobox.d.cts +43 -0
  85. package/dist/components/combobox.d.ts +17 -18
  86. package/dist/components/combobox.js +37 -48
  87. package/dist/components/combobox.js.map +1 -1
  88. package/dist/components/command.cjs +236 -0
  89. package/dist/components/command.cjs.map +1 -0
  90. package/dist/components/command.d.cts +23 -0
  91. package/dist/components/command.d.ts +14 -15
  92. package/dist/components/command.js +5 -38
  93. package/dist/components/command.js.map +1 -1
  94. package/dist/components/dialog.cjs +431 -0
  95. package/dist/components/dialog.cjs.map +1 -0
  96. package/dist/components/dialog.d.cts +30 -0
  97. package/dist/components/dialog.d.ts +13 -18
  98. package/dist/components/dialog.js +75 -119
  99. package/dist/components/dialog.js.map +1 -1
  100. package/dist/components/dock.cjs +121 -0
  101. package/dist/components/dock.cjs.map +1 -0
  102. package/dist/components/dock.d.cts +30 -0
  103. package/dist/components/dock.d.ts +1 -2
  104. package/dist/components/dock.js +7 -5
  105. package/dist/components/dock.js.map +1 -1
  106. package/dist/components/drawer.cjs +149 -0
  107. package/dist/components/drawer.cjs.map +1 -0
  108. package/dist/components/drawer.d.cts +15 -0
  109. package/dist/components/drawer.d.ts +10 -11
  110. package/dist/components/drawer.js +11 -40
  111. package/dist/components/drawer.js.map +1 -1
  112. package/dist/components/dropdown-menu.cjs +292 -0
  113. package/dist/components/dropdown-menu.cjs.map +1 -0
  114. package/dist/components/dropdown-menu.d.cts +52 -0
  115. package/dist/components/dropdown-menu.d.ts +23 -21
  116. package/dist/components/dropdown-menu.js +67 -191
  117. package/dist/components/dropdown-menu.js.map +1 -1
  118. package/dist/components/empty.cjs +106 -0
  119. package/dist/components/empty.cjs.map +1 -0
  120. package/dist/components/empty.d.cts +15 -0
  121. package/dist/components/empty.d.ts +15 -0
  122. package/dist/components/empty.js +99 -0
  123. package/dist/components/empty.js.map +1 -0
  124. package/dist/components/field.cjs +295 -0
  125. package/dist/components/field.cjs.map +1 -0
  126. package/dist/components/field.d.cts +46 -0
  127. package/dist/components/field.d.ts +34 -39
  128. package/dist/components/field.js +220 -72
  129. package/dist/components/field.js.map +1 -1
  130. package/dist/components/flickering-grid.cjs +176 -0
  131. package/dist/components/flickering-grid.cjs.map +1 -0
  132. package/dist/components/flickering-grid.d.cts +15 -0
  133. package/dist/components/flickering-grid.js +25 -2
  134. package/dist/components/flickering-grid.js.map +1 -1
  135. package/dist/components/flow-zoom-panel.cjs +194 -0
  136. package/dist/components/flow-zoom-panel.cjs.map +1 -0
  137. package/dist/components/flow-zoom-panel.d.cts +12 -0
  138. package/dist/components/flow-zoom-panel.d.ts +12 -0
  139. package/dist/components/flow-zoom-panel.js +173 -0
  140. package/dist/components/flow-zoom-panel.js.map +1 -0
  141. package/dist/components/form-control.cjs +193 -0
  142. package/dist/components/form-control.cjs.map +1 -0
  143. package/dist/components/form-control.d.cts +14 -0
  144. package/dist/components/form-control.d.ts +1 -2
  145. package/dist/components/form-control.js +2 -4
  146. package/dist/components/form-control.js.map +1 -1
  147. package/dist/components/form.cjs +208 -0
  148. package/dist/components/form.cjs.map +1 -0
  149. package/dist/components/form.d.cts +36 -0
  150. package/dist/components/form.d.ts +7 -8
  151. package/dist/components/input-group.cjs +184 -0
  152. package/dist/components/input-group.cjs.map +1 -0
  153. package/dist/components/input-group.d.cts +17 -0
  154. package/dist/components/input-group.d.ts +6 -7
  155. package/dist/components/input-group.js +3 -2
  156. package/dist/components/input-group.js.map +1 -1
  157. package/dist/components/input.cjs +62 -0
  158. package/dist/components/input.cjs.map +1 -0
  159. package/dist/components/input.d.cts +10 -0
  160. package/dist/components/input.d.ts +1 -2
  161. package/dist/components/input.js +1 -1
  162. package/dist/components/input.js.map +1 -1
  163. package/dist/components/json-input.cjs +351 -0
  164. package/dist/components/json-input.cjs.map +1 -0
  165. package/dist/components/json-input.d.cts +25 -0
  166. package/dist/components/json-input.d.ts +3 -3
  167. package/dist/components/json-input.js +89 -112
  168. package/dist/components/json-input.js.map +1 -1
  169. package/dist/components/label.cjs +29 -0
  170. package/dist/components/label.cjs.map +1 -0
  171. package/dist/components/label.d.cts +10 -0
  172. package/dist/components/label.d.ts +1 -2
  173. package/dist/components/motion-grid.cjs +108 -0
  174. package/dist/components/motion-grid.cjs.map +1 -0
  175. package/dist/components/motion-grid.d.cts +19 -0
  176. package/dist/components/motion-grid.d.ts +1 -2
  177. package/dist/components/motion-grid.js +9 -4
  178. package/dist/components/motion-grid.js.map +1 -1
  179. package/dist/components/multi-select.cjs +796 -0
  180. package/dist/components/multi-select.cjs.map +1 -0
  181. package/dist/components/multi-select.d.cts +198 -0
  182. package/dist/components/multi-select.js +54 -162
  183. package/dist/components/multi-select.js.map +1 -1
  184. package/dist/components/page-header.cjs +19 -0
  185. package/dist/components/page-header.cjs.map +1 -0
  186. package/dist/components/page-header.d.cts +17 -0
  187. package/dist/components/page-header.d.ts +2 -2
  188. package/dist/components/pagination.cjs +295 -0
  189. package/dist/components/pagination.cjs.map +1 -0
  190. package/dist/components/pagination.d.cts +18 -0
  191. package/dist/components/pagination.d.ts +7 -8
  192. package/dist/components/pagination.js +152 -29
  193. package/dist/components/pagination.js.map +1 -1
  194. package/dist/components/popover.cjs +140 -0
  195. package/dist/components/popover.cjs.map +1 -0
  196. package/dist/components/popover.d.cts +39 -0
  197. package/dist/components/popover.d.ts +13 -9
  198. package/dist/components/popover.js +56 -132
  199. package/dist/components/popover.js.map +1 -1
  200. package/dist/components/portal.cjs +109 -0
  201. package/dist/components/portal.cjs.map +1 -0
  202. package/dist/components/portal.d.cts +117 -0
  203. package/dist/components/portal.d.ts +16 -7
  204. package/dist/components/portal.js +13 -8
  205. package/dist/components/portal.js.map +1 -1
  206. package/dist/components/progress.cjs +31 -0
  207. package/dist/components/progress.cjs.map +1 -0
  208. package/dist/components/progress.d.cts +9 -0
  209. package/dist/components/progress.d.ts +1 -2
  210. package/dist/components/progress.js +1 -2
  211. package/dist/components/progress.js.map +1 -1
  212. package/dist/components/progressive-blur-scroll-container.cjs +144 -0
  213. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -0
  214. package/dist/components/progressive-blur-scroll-container.d.cts +25 -0
  215. package/dist/components/progressive-blur-scroll-container.d.ts +2 -2
  216. package/dist/components/progressive-blur.cjs +70 -0
  217. package/dist/components/progressive-blur.cjs.map +1 -0
  218. package/dist/components/progressive-blur.d.cts +16 -0
  219. package/dist/components/progressive-blur.d.ts +2 -2
  220. package/dist/components/radio-group.cjs +52 -0
  221. package/dist/components/radio-group.cjs.map +1 -0
  222. package/dist/components/radio-group.d.cts +10 -0
  223. package/dist/components/radio-group.d.ts +3 -3
  224. package/dist/components/radio-group.js +21 -10
  225. package/dist/components/radio-group.js.map +1 -1
  226. package/dist/components/record-picker.cjs +420 -0
  227. package/dist/components/record-picker.cjs.map +1 -0
  228. package/dist/components/record-picker.d.cts +16 -0
  229. package/dist/components/record-picker.d.ts +2 -2
  230. package/dist/components/record-picker.js +76 -43
  231. package/dist/components/record-picker.js.map +1 -1
  232. package/dist/components/resizable.cjs +76 -0
  233. package/dist/components/resizable.cjs.map +1 -0
  234. package/dist/components/resizable.d.cts +10 -0
  235. package/dist/components/resizable.d.ts +3 -4
  236. package/dist/components/responsive-diagram.cjs +67 -0
  237. package/dist/components/responsive-diagram.cjs.map +1 -0
  238. package/dist/components/responsive-diagram.d.cts +10 -0
  239. package/dist/components/responsive-diagram.d.ts +2 -2
  240. package/dist/components/scroll-area.cjs +92 -0
  241. package/dist/components/scroll-area.cjs.map +1 -0
  242. package/dist/components/scroll-area.d.cts +11 -0
  243. package/dist/components/scroll-area.d.ts +5 -6
  244. package/dist/components/select.cjs +329 -0
  245. package/dist/components/select.cjs.map +1 -0
  246. package/dist/components/select.d.cts +46 -0
  247. package/dist/components/select.d.ts +13 -14
  248. package/dist/components/select.js +76 -67
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +26 -0
  251. package/dist/components/separator.cjs.map +1 -0
  252. package/dist/components/separator.d.cts +10 -0
  253. package/dist/components/separator.d.ts +1 -2
  254. package/dist/components/sheet.cjs +489 -0
  255. package/dist/components/sheet.cjs.map +1 -0
  256. package/dist/components/sheet.d.cts +107 -0
  257. package/dist/components/sheet.d.ts +14 -19
  258. package/dist/components/sheet.js +119 -264
  259. package/dist/components/sheet.js.map +1 -1
  260. package/dist/components/sidebar.cjs +1300 -0
  261. package/dist/components/sidebar.cjs.map +1 -0
  262. package/dist/components/sidebar.d.cts +70 -0
  263. package/dist/components/sidebar.d.ts +32 -39
  264. package/dist/components/sidebar.js +401 -362
  265. package/dist/components/sidebar.js.map +1 -1
  266. package/dist/components/skeleton.cjs +36 -0
  267. package/dist/components/skeleton.cjs.map +1 -0
  268. package/dist/components/skeleton.d.cts +10 -0
  269. package/dist/components/skeleton.d.ts +5 -2
  270. package/dist/components/skeleton.js +19 -1
  271. package/dist/components/skeleton.js.map +1 -1
  272. package/dist/components/sonner.cjs +25 -0
  273. package/dist/components/sonner.cjs.map +1 -0
  274. package/dist/components/sonner.d.cts +10 -0
  275. package/dist/components/sonner.d.ts +2 -2
  276. package/dist/components/stack/index.cjs +1516 -0
  277. package/dist/components/stack/index.cjs.map +1 -0
  278. package/dist/components/stack/index.d.cts +672 -0
  279. package/dist/components/stack/index.d.ts +36 -38
  280. package/dist/components/stack/index.js +42 -31
  281. package/dist/components/stack/index.js.map +1 -1
  282. package/dist/components/stepper.cjs +314 -0
  283. package/dist/components/stepper.cjs.map +1 -0
  284. package/dist/components/stepper.d.cts +31 -0
  285. package/dist/components/stepper.d.ts +9 -8
  286. package/dist/components/stepper.js +22 -15
  287. package/dist/components/stepper.js.map +1 -1
  288. package/dist/components/switch.cjs +46 -0
  289. package/dist/components/switch.cjs.map +1 -0
  290. package/dist/components/switch.d.cts +7 -0
  291. package/dist/components/switch.d.ts +1 -2
  292. package/dist/components/switch.js +9 -5
  293. package/dist/components/switch.js.map +1 -1
  294. package/dist/components/table.cjs +133 -0
  295. package/dist/components/table.cjs.map +1 -0
  296. package/dist/components/table.d.cts +22 -0
  297. package/dist/components/table.d.ts +19 -12
  298. package/dist/components/table.js +72 -13
  299. package/dist/components/table.js.map +1 -1
  300. package/dist/components/tabs.cjs +53 -0
  301. package/dist/components/tabs.cjs.map +1 -0
  302. package/dist/components/tabs.d.cts +9 -0
  303. package/dist/components/tabs.d.ts +4 -5
  304. package/dist/components/tabs.js +2 -2
  305. package/dist/components/tabs.js.map +1 -1
  306. package/dist/components/tags.cjs +451 -0
  307. package/dist/components/tags.cjs.map +1 -0
  308. package/dist/components/tags.d.cts +40 -0
  309. package/dist/components/tags.d.ts +10 -10
  310. package/dist/components/tags.js +129 -154
  311. package/dist/components/tags.js.map +1 -1
  312. package/dist/components/textarea.cjs +56 -0
  313. package/dist/components/textarea.cjs.map +1 -0
  314. package/dist/components/textarea.d.cts +9 -0
  315. package/dist/components/textarea.d.ts +1 -2
  316. package/dist/components/toast/index.cjs +612 -0
  317. package/dist/components/toast/index.cjs.map +1 -0
  318. package/dist/components/toast/index.d.cts +52 -0
  319. package/dist/components/toast/index.js +90 -127
  320. package/dist/components/toast/index.js.map +1 -1
  321. package/dist/components/tooltip.cjs +92 -0
  322. package/dist/components/tooltip.cjs.map +1 -0
  323. package/dist/components/tooltip.d.cts +28 -0
  324. package/dist/components/tooltip.d.ts +5 -6
  325. package/dist/components/tooltip.js +23 -130
  326. package/dist/components/tooltip.js.map +1 -1
  327. package/dist/components/unlink-button.cjs +197 -0
  328. package/dist/components/unlink-button.cjs.map +1 -0
  329. package/dist/components/unlink-button.d.cts +14 -0
  330. package/dist/components/unlink-button.d.ts +2 -2
  331. package/dist/components/unlink-button.js +105 -21
  332. package/dist/components/unlink-button.js.map +1 -1
  333. package/dist/index.cjs +2074 -2723
  334. package/dist/index.cjs.map +1 -1
  335. package/dist/index.d.cts +492 -904
  336. package/dist/index.d.ts +492 -904
  337. package/dist/index.js +1897 -2569
  338. package/dist/index.js.map +1 -1
  339. package/package.json +286 -45
  340. package/src/styles/globals.css +155 -203
  341. package/dist/components/org-chart/index.d.ts +0 -54
  342. package/dist/components/org-chart/index.js +0 -861
  343. package/dist/components/org-chart/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import * as React3 from 'react';
2
+ import * as React from 'react';
3
3
  import { useState, useEffect, useMemo, Suspense } from 'react';
4
4
  import { WandSparkles, Loader2, CircleAlert, CheckCircle2 } from 'lucide-react';
5
5
  import { clsx } from 'clsx';
@@ -7,79 +7,11 @@ import { twMerge } from 'tailwind-merge';
7
7
  import { cva } from 'class-variance-authority';
8
8
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
9
9
  import { Tooltip as Tooltip$1 } from '@base-ui/react/tooltip';
10
+ import { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';
10
11
 
11
12
  function cn(...inputs) {
12
13
  return twMerge(clsx(inputs));
13
14
  }
14
- var buttonVariants = cva(
15
- "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
16
- {
17
- defaultVariants: {
18
- size: "default",
19
- variant: "default"
20
- },
21
- variants: {
22
- size: {
23
- default: "h-9 px-[calc(--spacing(3)-1px)] sm:h-8",
24
- icon: "size-9 sm:size-8",
25
- "icon-lg": "size-10 sm:size-9",
26
- "icon-sm": "size-8 sm:size-7",
27
- "icon-xl": 'size-11 sm:size-10 [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
28
- "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-3.5',
29
- lg: "h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9",
30
- sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7",
31
- xl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*="size-"])]:size-5 sm:[&_svg:not([class*="size-"])]:size-4.5',
32
- xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*="size-"])]:size-4 sm:[&_svg:not([class*="size-"])]:size-3.5'
33
- },
34
- variant: {
35
- default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
36
- destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
37
- "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
38
- ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
39
- link: "border-transparent underline-offset-4 hover:underline",
40
- outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
41
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
42
- }
43
- }
44
- }
45
- );
46
- var Button = React3.forwardRef(
47
- ({ className, variant, size, asChild, children, type = "button", ...props }, ref) => {
48
- const buttonClasses = cn(buttonVariants({ className, size, variant }));
49
- if (asChild && React3.isValidElement(children)) {
50
- const childProps = children.props;
51
- return React3.cloneElement(children, {
52
- ...props,
53
- className: cn(buttonClasses, childProps.className),
54
- "data-slot": "button"
55
- });
56
- }
57
- return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
58
- }
59
- );
60
- Button.displayName = "Button";
61
- var PORTAL_ROOT_ID = "portal-root";
62
- var PortalContext = React3.createContext({
63
- layer: "base",
64
- depth: 0,
65
- floatingPortalStrategy: "root",
66
- floatingZIndex: "default"
67
- });
68
- function useRootPortalContainer() {
69
- const [container, setContainer] = React3.useState(null);
70
- React3.useLayoutEffect(() => {
71
- const el = document.getElementById(PORTAL_ROOT_ID);
72
- setContainer(el);
73
- }, []);
74
- return container;
75
- }
76
- function useFloatingOverlayPortalProps() {
77
- const rootContainer = useRootPortalContainer();
78
- const { floatingPortalStrategy, floatingZIndex } = React3.useContext(PortalContext);
79
- const container = floatingPortalStrategy === "nested" ? void 0 : rootContainer ?? null;
80
- const zIndexClass = floatingZIndex === "elevated" ? "z-[var(--z-layer-floating-elevated)]" : "z-[var(--z-layer-floating)]";
81
- return { container, zIndexClass };
82
- }
83
15
  function composeRefs(...refs) {
84
16
  return (node) => {
85
17
  refs.forEach((ref) => {
@@ -110,33 +42,23 @@ function mergeProps(slotProps, childProps) {
110
42
  }
111
43
  return { ...slotProps, ...overrideProps };
112
44
  }
113
- function mergePropsWithRef(parentProps, childElement) {
114
- const childProps = childElement.props;
115
- const parentRef = parentProps.ref;
116
- const childRef = childProps.ref;
117
- const mergedProps = mergeProps(parentProps, childProps);
118
- if (parentRef || childRef) {
119
- mergedProps.ref = composeRefs(parentRef, childRef);
120
- }
121
- return mergedProps;
122
- }
123
45
  function isSlottable(child) {
124
- return React3.isValidElement(child);
46
+ return React.isValidElement(child);
125
47
  }
126
- var Slot = React3.forwardRef((props, forwardedRef) => {
48
+ var Slot = React.forwardRef((props, forwardedRef) => {
127
49
  const { children, ...slotProps } = props;
128
50
  if (isSlottable(children)) {
129
51
  const childProps = children.props;
130
52
  const childRef = childProps.ref;
131
- return React3.cloneElement(children, {
53
+ return React.cloneElement(children, {
132
54
  ...mergeProps(slotProps, childProps),
133
55
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef
134
56
  });
135
57
  }
136
- if (React3.Children.count(children) > 1) {
137
- const childrenArray = React3.Children.toArray(children);
58
+ if (React.Children.count(children) > 1) {
59
+ const childrenArray = React.Children.toArray(children);
138
60
  const slottableChild = childrenArray.find(
139
- (child) => React3.isValidElement(child) && child.type === Slottable
61
+ (child) => React.isValidElement(child) && child.type === Slottable
140
62
  );
141
63
  if (slottableChild) {
142
64
  const newElement = slottableChild.props.children;
@@ -144,12 +66,12 @@ var Slot = React3.forwardRef((props, forwardedRef) => {
144
66
  const newElementProps = newElement.props;
145
67
  const newChildren = childrenArray.map((child) => {
146
68
  if (child === slottableChild) {
147
- return React3.Children.count(newElementProps.children) > 1 ? React3.Children.only(null) : newElementProps.children;
69
+ return React.Children.count(newElementProps.children) > 1 ? React.Children.only(null) : newElementProps.children;
148
70
  }
149
71
  return child;
150
72
  });
151
73
  const childRef = newElementProps.ref;
152
- return React3.cloneElement(newElement, {
74
+ return React.cloneElement(newElement, {
153
75
  ...mergeProps(slotProps, newElementProps),
154
76
  ref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,
155
77
  children: newChildren
@@ -163,30 +85,82 @@ Slot.displayName = "Slot";
163
85
  function Slottable({ children }) {
164
86
  return /* @__PURE__ */ jsx(Fragment, { children });
165
87
  }
88
+ var buttonVariants = cva(
89
+ "[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
90
+ {
91
+ defaultVariants: {
92
+ size: "default",
93
+ static: false,
94
+ variant: "default"
95
+ },
96
+ variants: {
97
+ static: {
98
+ false: "motion-safe:active:not-disabled:scale-[0.96]",
99
+ true: null
100
+ },
101
+ size: {
102
+ default: "h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
103
+ icon: "size-10 pointer-coarse:size-11",
104
+ "icon-lg": "size-11",
105
+ "icon-sm": "size-8 pointer-coarse:size-11",
106
+ "icon-xl": 'size-11 [&_svg:not([class*="size-"])]:size-5',
107
+ "icon-xs": 'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*="size-"])]:size-4',
108
+ lg: "h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]",
109
+ sm: "h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11",
110
+ xl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*="size-"])]:size-5',
111
+ xs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*="size-"])]:size-3.5'
112
+ },
113
+ variant: {
114
+ default: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
115
+ destructive: "not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none",
116
+ "destructive-outline": "border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8",
117
+ ghost: "border-transparent hover:bg-accent data-pressed:bg-accent",
118
+ link: "border-transparent underline-offset-4 hover:underline",
119
+ outline: "border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64",
120
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80"
121
+ }
122
+ }
123
+ }
124
+ );
125
+ var Button = React.forwardRef(
126
+ ({ className, variant, size, static: isStatic, asChild, children, type = "button", ...props }, ref) => {
127
+ const buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));
128
+ const Comp = asChild ? Slot : "button";
129
+ if (asChild) {
130
+ const SlottedComp = Comp;
131
+ return /* @__PURE__ */ jsx(
132
+ SlottedComp,
133
+ {
134
+ ref,
135
+ className: buttonClasses,
136
+ "data-slot": "button",
137
+ ...props,
138
+ children
139
+ }
140
+ );
141
+ }
142
+ return /* @__PURE__ */ jsx("button", { ref, type, className: buttonClasses, "data-slot": "button", ...props, children });
143
+ }
144
+ );
145
+ Button.displayName = "Button";
166
146
  function TooltipProvider({ delay = 0, delayDuration, ...props }) {
167
147
  return /* @__PURE__ */ jsx(Tooltip$1.Provider, { "data-slot": "tooltip-provider", delay: delayDuration ?? delay, ...props });
168
148
  }
169
149
  function Tooltip({ delayDuration: _delayDuration, ...props }) {
170
150
  return /* @__PURE__ */ jsx(Tooltip$1.Root, { "data-slot": "tooltip", ...props });
171
151
  }
172
- function TooltipTrigger({ delay = 0, asChild, children, ...props }) {
173
- if (asChild && React3.isValidElement(children)) {
174
- return /* @__PURE__ */ jsx(
175
- Tooltip$1.Trigger,
176
- {
177
- "data-slot": "tooltip-trigger",
178
- delay,
179
- ...props,
180
- render: (triggerProps) => {
181
- return React3.cloneElement(
182
- children,
183
- mergePropsWithRef(triggerProps, children)
184
- );
185
- }
186
- }
187
- );
188
- }
189
- return /* @__PURE__ */ jsx(Tooltip$1.Trigger, { "data-slot": "tooltip-trigger", delay, ...props, children });
152
+ function TooltipTrigger({ delay = 0, asChild, children, render, ...props }) {
153
+ const childRender = render === void 0 && asChild && React.isValidElement(children) ? children : void 0;
154
+ return /* @__PURE__ */ jsx(
155
+ Tooltip$1.Trigger,
156
+ {
157
+ "data-slot": "tooltip-trigger",
158
+ delay,
159
+ render: render ?? childRender,
160
+ ...props,
161
+ children: childRender ? void 0 : children
162
+ }
163
+ );
190
164
  }
191
165
  function TooltipContent({
192
166
  className,
@@ -203,14 +177,17 @@ function TooltipContent({
203
177
  {
204
178
  "data-slot": "tooltip-content",
205
179
  className: cn(
206
- `bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95
207
- data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95
208
- data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2
209
- data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2
210
- relative max-w-70 rounded-md border px-2 py-1 text-xs`,
180
+ `bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1
181
+ text-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95
182
+ data-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0
183
+ data-[side=bottom]:data-starting-style:-translate-y-2
184
+ data-[side=left]:data-starting-style:translate-x-2
185
+ data-[side=right]:data-starting-style:-translate-x-2
186
+ data-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,
211
187
  className
212
188
  ),
213
189
  ...props,
190
+ role: "tooltip",
214
191
  children: [
215
192
  children,
216
193
  showArrow && /* @__PURE__ */ jsx(Tooltip$1.Arrow, { className: "fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]" })
@@ -218,7 +195,7 @@ function TooltipContent({
218
195
  }
219
196
  ) }) });
220
197
  }
221
- var AceEditor = React3.lazy(async () => {
198
+ var AceEditor = React.lazy(async () => {
222
199
  const ace = await import('react-ace');
223
200
  await import('ace-builds/src-noconflict/mode-json');
224
201
  await import('ace-builds/src-noconflict/theme-textmate');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/button.tsx","../../src/components/portal.tsx","../../src/lib/slot.tsx","../../src/components/tooltip.tsx","../../src/components/json-input.tsx"],"names":["React","React2","jsx","TooltipPrimitive","React4","React5","useState","useMemo","jsxs"],"mappings":";;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACAA,IAAM,cAAA,GAAiB,GAAA;AAAA,EACtB,0uBAAA;AAAA,EACA;AAAA,IACC,eAAA,EAAiB;AAAA,MAChB,IAAA,EAAM,SAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACV;AAAA,IACA,QAAA,EAAU;AAAA,MACT,IAAA,EAAM;AAAA,QACL,OAAA,EAAS,wCAAA;AAAA,QACT,IAAA,EAAM,kBAAA;AAAA,QACN,SAAA,EAAW,mBAAA;AAAA,QACX,SAAA,EAAW,kBAAA;AAAA,QACX,SAAA,EAAW,mGAAA;AAAA,QACX,SAAA,EACC,sNAAA;AAAA,QACD,EAAA,EAAI,2CAAA;AAAA,QACJ,EAAA,EAAI,kDAAA;AAAA,QACJ,EAAA,EAAI,8IAAA;AAAA,QACJ,EAAA,EAAI;AAAA,OACL;AAAA,MACA,OAAA,EAAS;AAAA,QACR,OAAA,EACC,uRAAA;AAAA,QACD,WAAA,EACC,0RAAA;AAAA,QACD,qBAAA,EACC,ghBAAA;AAAA,QACD,KAAA,EAAO,2DAAA;AAAA,QACP,IAAA,EAAM,uDAAA;AAAA,QACN,OAAA,EACC,6eAAA;AAAA,QACD,SAAA,EACC;AAAA;AACF;AACD;AAEF,CAAA;AASA,IAAM,MAAA,GAAeA,MAAA,CAAA,UAAA;AAAA,EACpB,CAAC,EAAE,SAAA,EAAW,OAAA,EAAS,IAAA,EAAM,OAAA,EAAS,QAAA,EAAU,IAA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CAAC,CAAA;AAAA,EAChD,CAAA,CAAA,MAAQ;AACP,IAAA,OAAO,IAAA;AAAA,EACR;AACD,CAAA;AAEA,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA,CAAE,MAAA","file":"json-input.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-base outline-none transition-shadow before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] pointer-coarse:after:absolute pointer-coarse:after:size-full pointer-coarse:after:min-h-11 pointer-coarse:after:min-w-11 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 sm:text-sm [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4.5 sm:[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-9 px-[calc(--spacing(3)-1px)] sm:h-8',\n\t\t\t\ticon: 'size-9 sm:size-8',\n\t\t\t\t'icon-lg': 'size-10 sm:size-9',\n\t\t\t\t'icon-sm': 'size-8 sm:size-7',\n\t\t\t\t'icon-xl': 'size-11 sm:size-10 [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] sm:size-6 not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-4 sm:not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t\tlg: 'h-10 px-[calc(--spacing(3.5)-1px)] sm:h-9',\n\t\t\t\tsm: 'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] sm:h-7',\n\t\t\t\txl: 'h-11 px-[calc(--spacing(4)-1px)] text-lg sm:h-10 sm:text-base [&_svg:not([class*=\"size-\"])]:size-5 sm:[&_svg:not([class*=\"size-\"])]:size-4.5',\n\t\t\t\txs: 'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-sm before:rounded-[calc(var(--radius-md)-1px)] sm:h-6 sm:text-xs [&_svg:not([class*=\"size-\"])]:size-4 sm:[&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\tdestructive:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, variant }));\n\n\t\t// If asChild, render children with merged props (for wrapping Links, etc.)\n\t\tif (asChild && React.isValidElement(children)) {\n\t\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t\treturn React.cloneElement(children as React.ReactElement<Record<string, unknown>>, {\n\t\t\t\t...props,\n\t\t\t\tclassName: cn(buttonClasses, childProps.className as string | undefined),\n\t\t\t\t'data-slot': 'button',\n\t\t\t});\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","'use client';\n\nimport * as React from 'react';\n\n// ============================================================================\n// Types\n// ============================================================================\n\n/**\n * Overlay layer type:\n * - 'base': Root level (page content, base floating elements)\n * - 'modal': Inside a modal overlay (dialog, sheet, drawer)\n */\nexport type OverlayLayer = 'base' | 'modal';\n\n/**\n * Where floating overlays should portal:\n * - 'root': always portal into #portal-root\n * - 'nested': let Base UI nest portals into the nearest Base UI portal node\n */\nexport type FloatingPortalStrategy = 'root' | 'nested';\n\n/**\n * Z-index mode for floating overlays.\n * - 'default': --z-layer-floating\n * - 'elevated': --z-layer-floating-elevated\n */\nexport type FloatingZIndex = 'default' | 'elevated';\n\ninterface PortalContextValue {\n\t/** Current overlay layer */\n\tlayer: OverlayLayer;\n\t/** Modal nesting depth (0 for first modal, 1 for nested, etc.) */\n\tdepth: number;\n\t/** Strategy for where floating overlays should portal */\n\tfloatingPortalStrategy: FloatingPortalStrategy;\n\t/** Z-index mode for floating overlays */\n\tfloatingZIndex: FloatingZIndex;\n}\n\n// ============================================================================\n// Constants\n// ============================================================================\n\nexport const PORTAL_ROOT_ID = 'portal-root';\n\n// ============================================================================\n// Context\n// ============================================================================\n\nconst PortalContext = React.createContext<PortalContextValue>({\n\tlayer: 'base',\n\tdepth: 0,\n\tfloatingPortalStrategy: 'root',\n\tfloatingZIndex: 'default',\n});\n\n// ============================================================================\n// Providers\n// ============================================================================\n\n/**\n * Provider for modal overlays (Dialog, Sheet, Drawer, etc.)\n *\n * Wraps modal content to:\n * 1. Create a scoped portal container for nested floating elements\n * 2. Track the overlay layer (so floating elements know to use elevated z-index)\n * 3. Track nesting depth for stacked modals\n *\n * Usage:\n * ```tsx\n * <DialogPopup>\n * <ModalPortalScope>\n * {children} // Popovers inside here will render in the scoped container\n * </ModalPortalScope>\n * </DialogPopup>\n * ```\n */\nexport function ModalPortalScope({\n\tchildren,\n\tfloatingPortalStrategy = 'nested',\n\tfloatingZIndex = 'default',\n}: {\n\tchildren: React.ReactNode;\n\tfloatingPortalStrategy?: FloatingPortalStrategy;\n\tfloatingZIndex?: FloatingZIndex;\n}) {\n\tconst parentContext = React.useContext(PortalContext);\n\n\t// Increment depth from parent if already in modal layer\n\tconst depth = parentContext.layer === 'modal' ? parentContext.depth + 1 : 0;\n\n\tconst value = React.useMemo<PortalContextValue>(\n\t\t() => ({\n\t\t\tlayer: 'modal',\n\t\t\tdepth,\n\t\t\tfloatingPortalStrategy,\n\t\t\tfloatingZIndex,\n\t\t}),\n\t\t[depth, floatingPortalStrategy, floatingZIndex],\n\t);\n\n\treturn <PortalContext.Provider value={value}>{children}</PortalContext.Provider>;\n}\n\n// ============================================================================\n// Hooks\n// ============================================================================\n\n/**\n * Get the current portal context value.\n * Used internally by other hooks.\n */\nexport function usePortalContext(): PortalContextValue {\n\treturn React.useContext(PortalContext);\n}\n\nexport function useInModalOverlay(): boolean {\n\treturn React.useContext(PortalContext).layer === 'modal';\n}\n\n/**\n * Get the root portal container element.\n * Used by modal components (Dialog, Sheet, etc.) to render their portals.\n *\n * @returns The root portal container, or null during SSR/before mount\n */\nexport function useRootPortalContainer(): HTMLElement | null {\n\tconst [container, setContainer] = React.useState<HTMLElement | null>(null);\n\n\tReact.useLayoutEffect(() => {\n\t\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\t\tsetContainer(el);\n\t}, []);\n\n\treturn container;\n}\n\n/**\n * Centralized portal + z-index policy for floating overlays.\n *\n * - When `floatingPortalStrategy` is 'nested', Base UI will automatically portal\n * into the nearest Base UI portal node (so dialog \"inert\" behavior includes it).\n * - When it's 'root', we portal into #portal-root.\n */\nexport function useFloatingOverlayPortalProps(): {\n\tcontainer?: HTMLElement | null;\n\tzIndexClass: string;\n} {\n\tconst rootContainer = useRootPortalContainer();\n\tconst { floatingPortalStrategy, floatingZIndex } = React.useContext(PortalContext);\n\n\tconst container = floatingPortalStrategy === 'nested' ? undefined : (rootContainer ?? null);\n\tconst zIndexClass =\n\t\tfloatingZIndex === 'elevated'\n\t\t\t? 'z-[var(--z-layer-floating-elevated)]'\n\t\t\t: 'z-[var(--z-layer-floating)]';\n\n\treturn { container, zIndexClass };\n}\n\n// ============================================================================\n// Components\n// ============================================================================\n\n/**\n * Portal root component to render in app layout.\n * All overlay components will render their portals inside this container.\n *\n * Usage in layout.tsx:\n * ```tsx\n * import { PortalRoot } from '@constructive-io/ui/portal';\n *\n * export default function RootLayout({ children }) {\n * return (\n * <html>\n * <body>\n * {children}\n * <PortalRoot />\n * </body>\n * </html>\n * );\n * }\n * ```\n */\nexport function PortalRoot() {\n\treturn (\n\t\t<div\n\t\t\tid={PORTAL_ROOT_ID}\n\t\t\tdata-slot=\"portal-root\"\n\t\t\tstyle={{\n\t\t\t\tposition: 'fixed',\n\t\t\t\tinset: 0,\n\t\t\t\tzIndex: 'var(--z-layer-portal-root)',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// Children (portal contents) will have pointer-events: auto\n\t\t\t}}\n\t\t/>\n\t);\n}\n\n/**\n * Hook to get the portal container element for rendering floating UI elements.\n * Returns the element with id=\"portal-root\" if it exists in the DOM.\n *\n * @deprecated Use useRootPortalContainer or useFloatingOverlayPortalProps instead\n */\nexport function usePortalContainer(): HTMLElement | undefined {\n\tif (typeof document === 'undefined') return undefined;\n\tconst el = document.getElementById(PORTAL_ROOT_ID);\n\treturn el instanceof HTMLElement ? el : undefined;\n}\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from './portal';\nimport { mergePropsWithRef } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = Omit<React.ComponentProps<typeof TooltipPrimitive.Trigger>, 'render'> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, ...props }: TooltipTriggerProps) {\n\tif (asChild && React.isValidElement(children)) {\n\t\treturn (\n\t\t\t<TooltipPrimitive.Trigger\n\t\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\t\tdelay={delay}\n\t\t\t\t{...props}\n\t\t\trender={(triggerProps) => {\n\t\t\t\treturn React.cloneElement(\n\t\t\t\t\tchildren as React.ReactElement<Record<string, unknown>>,\n\t\t\t\t\tmergePropsWithRef(triggerProps as Record<string, unknown>, children as React.ReactElement),\n\t\t\t\t);\n\t\t\t}}\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" delay={delay} {...props}>\n\t\t\t{children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground data-[open]:animate-in data-[open]:fade-in-0 data-[open]:zoom-in-95\n\t\t\t\t\t\tdata-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95\n\t\t\t\t\t\tdata-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2\n\t\t\t\t\t\tdata-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2\n\t\t\t\t\t\trelative max-w-70 rounded-md border px-2 py-1 text-xs`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n","'use client';\n\nimport * as React from 'react';\nimport { useEffect, useMemo, useState, Suspense } from 'react';\nimport { CheckCircle2, CircleAlert, Loader2, WandSparkles } from 'lucide-react';\nimport type { IAceEditorProps } from 'react-ace';\n\nimport { cn } from '../lib/utils';\n\nimport { Button } from './button';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';\n\n// Lazy load AceEditor\nconst AceEditor = React.lazy(async () => {\n\tconst ace = await import('react-ace');\n\tawait import('ace-builds/src-noconflict/mode-json');\n\tawait import('ace-builds/src-noconflict/theme-textmate');\n\tawait import('ace-builds/src-noconflict/theme-cloud9_night');\n\treturn ace;\n});\n\nconst EditorLoading = () => (\n\t<div className=\"flex h-32 items-center justify-center\">\n\t\t<Loader2 className=\"h-6 w-6 animate-spin\" />\n\t</div>\n);\n\ntype JsonDisplay = {\n\ticon?: React.ReactNode;\n\ttext?: string;\n\tclassName?: string;\n};\n\ninterface JsonState {\n\tstate: 'empty' | 'loading' | 'success' | 'error';\n\terrMsg?: string;\n}\n\nconst displayJsonState = (jsonState: JsonState) => {\n\tconst jsonStateMap: Record<JsonState['state'], JsonDisplay> = {\n\t\tloading: {\n\t\t\ticon: <Loader2 className=\"text-muted-foreground size-[18px] animate-spin\" />,\n\t\t\ttext: 'Checking JSON Format...',\n\t\t\tclassName: 'text-muted-foreground',\n\t\t},\n\n\t\tsuccess: {\n\t\t\ticon: <CheckCircle2 className=\"size-[18px] text-green-600\" />,\n\t\t\ttext: 'Valid JSON Format',\n\t\t\tclassName: 'text-foreground',\n\t\t},\n\n\t\terror: {\n\t\t\ticon: <CircleAlert className=\"text-destructive size-[18px]\" />,\n\t\t\ttext: jsonState.errMsg || 'Invalid JSON Format',\n\t\t\tclassName: 'text-destructive',\n\t\t},\n\n\t\tempty: {},\n\t};\n\n\treturn jsonStateMap[jsonState.state];\n};\n\ntype JsonInputProps = {\n\tvalue: string;\n\tsetValue: (value: string) => void;\n\tminLines?: number;\n\tclassName?: string;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */\n\ttheme?: 'light' | 'dark';\n};\n\nexport const JsonInput = ({ value = '', setValue, minLines = 16, className, theme = 'light' }: JsonInputProps) => {\n\tconst [jsonState, setJsonState] = useState<JsonState>({ state: 'empty' });\n\n\tconst handleChange = (val: string) => {\n\t\tsetJsonState({ state: 'loading' });\n\t\tsetValue(val);\n\t};\n\n\tuseEffect(() => {\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\tconst error = validateJson(value);\n\n\t\t\tif (value.trim().length === 0) setJsonState({ state: 'empty' });\n\t\t\telse if (error) setJsonState({ state: 'error', errMsg: error });\n\t\t\telse setJsonState({ state: 'success' });\n\t\t}, 400);\n\n\t\treturn () => clearTimeout(timeoutId);\n\t}, [value]);\n\n\tconst { icon, text, className: textClassName } = displayJsonState(jsonState);\n\tconst isValidJson = validateJson(value) === null;\n\n\tconst lines = useMemo(() => {\n\t\treturn Math.max(countJsonLines(value), minLines);\n\t}, [value, minLines]);\n\n\treturn (\n\t\t<div>\n\t\t\t<div className={cn('border-border/60 relative overflow-y-auto rounded-md border p-2.5', className)}>\n\t\t\t\t<JsonEditor value={value} setValue={handleChange} lines={lines} theme={theme} />\n\t\t\t\t<TooltipProvider>\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"absolute top-2 right-2 size-8 rounded-xl\"\n\t\t\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdisabled={!isValidJson}\n\t\t\t\t\t\t\t\tonClick={() => setValue(prettifyJson(value))}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WandSparkles className=\"text-muted-foreground size-4\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>Format JSON</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</TooltipProvider>\n\t\t\t</div>\n\t\t\t{jsonState.state !== 'empty' && (\n\t\t\t\t<div className=\"mt-2 flex items-center gap-2\">\n\t\t\t\t\t{icon}\n\t\t\t\t\t<span className={cn('text-sm', textClassName)}>{text}</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\ntype JsonEditorProps = {\n\tvalue: string;\n\tlines: number;\n\tsetValue?: (value: string) => void;\n\treadOnly?: boolean;\n\tisValid?: boolean;\n\tenableFolding?: boolean;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */\n\ttheme?: 'light' | 'dark';\n};\n\nexport const JsonEditor = ({\n\tvalue,\n\tsetValue,\n\tlines,\n\treadOnly = false,\n\tisValid = true,\n\tenableFolding = false,\n\ttheme = 'light',\n}: JsonEditorProps) => {\n\tconst editorProps: IAceEditorProps = {\n\t\tmode: 'json',\n\t\ttheme: theme === 'light' ? 'textmate' : 'cloud9_night',\n\t\tfontSize: '14px',\n\t\treadOnly,\n\t\tstyle: {\n\t\t\twidth: '100%',\n\t\t\tbackground: 'transparent',\n\t\t\toffset: 0,\n\t\t},\n\t\tsetOptions: {\n\t\t\tuseWorker: false,\n\t\t\tprintMargin: false,\n\t\t\tshowFoldWidgets: enableFolding,\n\t\t\tfoldStyle: 'markbegin',\n\t\t},\n\t\ttabSize: 2,\n\t\twrapEnabled: readOnly && !isValid,\n\t\tshowGutter: enableFolding,\n\t\tminLines: lines,\n\t\tmaxLines: lines,\n\t\thighlightActiveLine: !readOnly,\n\t\tvalue,\n\t\tonChange: setValue,\n\t};\n\n\treturn (\n\t\t<Suspense fallback={<EditorLoading />}>\n\t\t\t<AceEditor {...editorProps} />\n\t\t</Suspense>\n\t);\n};\n\nexport const validateJson = (text: string) => {\n\ttry {\n\t\tif (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);\n\t\tJSON.parse(text);\n\t\treturn null;\n\t} catch (error) {\n\t\treturn (error as SyntaxError).message;\n\t}\n};\n\nconst prettifyJson = (text: string) => {\n\ttry {\n\t\treturn JSON.stringify(JSON.parse(text), null, 2);\n\t} catch {\n\t\treturn text;\n\t}\n};\n\nconst countJsonLines = (text: string) => text.split(/\\n/).length;\n"]}
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/lib/slot.tsx","../../src/components/button.tsx","../../src/components/tooltip.tsx","../../src/components/json-input.tsx"],"names":["React2","jsx","TooltipPrimitive","React3","React4","jsxs"],"mappings":";;;;;;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACGA,SAAS,eAAkB,IAAA,EAA0D;AACpF,EAAA,OAAO,CAAC,IAAA,KAAS;AAChB,IAAA,IAAA,CAAK,OAAA,CAAQ,CAAC,GAAA,KAAQ;AACrB,MAAA,IAAI,OAAO,QAAQ,UAAA,EAAY;AAC9B,QAAA,GAAA,CAAI,IAAI,CAAA;AAAA,MACT,CAAA,MAAA,IAAW,OAAO,IAAA,EAAM;AACvB,QAAC,IAAyC,OAAA,GAAU,IAAA;AAAA,MACrD;AAAA,IACD,CAAC,CAAA;AAAA,EACF,CAAA;AACD;AAMA,SAAS,UAAA,CACR,WACA,UAAA,EAC0B;AAC1B,EAAA,MAAM,aAAA,G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AiB;AAC7C,EAAA,IAAI;AACH,IAAA,IAAI,IAAA,CAAK,MAAK,CAAE,MAAA,KAAW,GAAG,MAAM,IAAI,YAAY,CAAA,sBAAA,CAAwB,CAAA;AAC5E,IAAA,IAAA,CAAK,MAAM,IAAI,CAAA;AACf,IAAA,OAAO,IAAA;AAAA,EACR,SAAS,KAAA,EAAO;AACf,IAAA,OAAQ,KAAA,CAAsB,OAAA;AAAA,EAC/B;AACD;AAEA,IAAM,YAAA,GAAe,CAAC,IAAA,KAAiB;AACtC,EAAA,IAAI;AACH,IAAA,OAAO,KAAK,SAAA,CAAU,IAAA,CAAK,MAAM,IAAI,CAAA,EAAG,MAAM,CAAC,CAAA;AAAA,EAChD,CAAA,CAAA,MAAQ;AACP,IAAA,OAAO,IAAA;AAAA,EACR;AACD,CAAA;AAEA,IAAM,iBAAiB,CAAC,IAAA,KAAiB,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA,CAAE,MAAA","file":"json-input.js","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\n\n/**\n * Merges refs into a single callback ref.\n * React 19 compatible - handles refs as regular props.\n */\nfunction composeRefs<T>(...refs: (React.Ref<T> | undefined)[]): React.RefCallback<T> {\n\treturn (node) => {\n\t\trefs.forEach((ref) => {\n\t\t\tif (typeof ref === 'function') {\n\t\t\t\tref(node);\n\t\t\t} else if (ref != null) {\n\t\t\t\t(ref as React.MutableRefObject<T | null>).current = node;\n\t\t\t}\n\t\t});\n\t};\n}\n\n/**\n * Merges props, handling special cases for className, style, and event handlers.\n * Excludes 'ref' from merging as it's handled separately.\n */\nfunction mergeProps(\n\tslotProps: Record<string, unknown>,\n\tchildProps: Record<string, unknown>,\n): Record<string, unknown> {\n\tconst overrideProps: Record<string, unknown> = { ...childProps };\n\n\tfor (const propName in childProps) {\n\t\t// Skip ref - handled separately for composition\n\t\tif (propName === 'ref') continue;\n\n\t\tconst slotPropValue = slotProps[propName];\n\t\tconst childPropValue = childProps[propName];\n\n\t\t// Compose event handlers\n\t\tif (/^on[A-Z]/.test(propName) && typeof slotPropValue === 'function' && typeof childPropValue === 'function') {\n\t\t\toverrideProps[propName] = (...args: unknown[]) => {\n\t\t\t\tchildPropValue(...args);\n\t\t\t\tslotPropValue(...args);\n\t\t\t};\n\t\t}\n\t\t// Merge className\n\t\telse if (propName === 'className' && typeof slotPropValue === 'string' && typeof childPropValue === 'string') {\n\t\t\toverrideProps[propName] = `${slotPropValue} ${childPropValue}`.trim();\n\t\t}\n\t\t// Merge style\n\t\telse if (propName === 'style' && typeof slotPropValue === 'object' && typeof childPropValue === 'object') {\n\t\t\toverrideProps[propName] = { ...slotPropValue, ...childPropValue };\n\t\t}\n\t}\n\n\treturn { ...slotProps, ...overrideProps };\n}\n\n/**\n * Merges props from a parent component with a child element's props,\n * including proper ref composition. Use this in render prop patterns\n * where the parent needs to merge its props with the child's.\n *\n * @param parentProps - Props from the parent component (e.g., triggerProps from Base UI)\n * @param childElement - The child React element whose props will be merged\n * @returns Merged props object ready to pass to React.cloneElement\n */\nfunction mergePropsWithRef<T = HTMLElement>(\n\tparentProps: Record<string, unknown>,\n\tchildElement: React.ReactElement,\n): Record<string, unknown> {\n\tconst childProps = childElement.props as Record<string, unknown>;\n\tconst parentRef = parentProps.ref as React.Ref<T> | undefined;\n\tconst childRef = childProps.ref as React.Ref<T> | undefined;\n\n\tconst mergedProps = mergeProps(parentProps, childProps);\n\n\t// Compose refs if either exists\n\tif (parentRef || childRef) {\n\t\tmergedProps.ref = composeRefs(parentRef, childRef);\n\t}\n\n\treturn mergedProps;\n}\n\n/**\n * Check if a value is a valid slottable child (single React element).\n */\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement {\n\treturn React.isValidElement(child);\n}\n\nexport interface SlotProps extends React.HTMLAttributes<HTMLElement> {\n\tchildren?: React.ReactNode;\n}\n\n/**\n * Slot component - renders its child element with merged props.\n * Used for the `asChild` pattern where parent props are passed to child.\n * React 19 compatible - accesses ref from props instead of element.ref.\n */\nconst Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n\tconst { children, ...slotProps } = props;\n\n\t// Handle single child\n\tif (isSlottable(children)) {\n\t\tconst childProps = children.props as Record<string, unknown>;\n\t\t// React 19: ref is now a regular prop, not element.ref\n\t\tconst childRef = childProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\treturn React.cloneElement(children, {\n\t\t\t...mergeProps(slotProps, childProps),\n\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t} as React.Attributes);\n\t}\n\n\t// Handle multiple children - wrap Slottable content\n\tif (React.Children.count(children) > 1) {\n\t\tconst childrenArray = React.Children.toArray(children);\n\t\tconst slottableChild = childrenArray.find(\n\t\t\t(child) => React.isValidElement(child) && child.type === Slottable,\n\t\t) as React.ReactElement<{ children: React.ReactNode }> | undefined;\n\n\t\tif (slottableChild) {\n\t\t\tconst newElement = slottableChild.props.children;\n\t\t\tif (isSlottable(newElement)) {\n\t\t\t\tconst newElementProps = newElement.props as Record<string, unknown> & { children?: React.ReactNode };\n\t\t\t\tconst newChildren = childrenArray.map((child) => {\n\t\t\t\t\tif (child === slottableChild) {\n\t\t\t\t\t\treturn React.Children.count(newElementProps.children) > 1\n\t\t\t\t\t\t\t? React.Children.only(null)\n\t\t\t\t\t\t\t: newElementProps.children;\n\t\t\t\t\t}\n\t\t\t\t\treturn child;\n\t\t\t\t});\n\n\t\t\t\t// React 19: ref is now a regular prop\n\t\t\t\tconst childRef = newElementProps.ref as React.Ref<HTMLElement> | undefined;\n\n\t\t\t\treturn React.cloneElement(newElement, {\n\t\t\t\t\t...mergeProps(slotProps, newElementProps),\n\t\t\t\t\tref: forwardedRef ? composeRefs(forwardedRef, childRef) : childRef,\n\t\t\t\t\tchildren: newChildren,\n\t\t\t\t} as React.Attributes);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Fallback: render children as-is (shouldn't normally happen with proper usage)\n\treturn <>{children}</>;\n});\n\nSlot.displayName = 'Slot';\n\n/**\n * Slottable component - marks content that should receive slot props.\n * Used when Slot has multiple children and you want to specify which one receives props.\n */\nfunction Slottable({ children }: { children: React.ReactNode }) {\n\treturn <>{children}</>;\n}\n\nexport { Slot, Slottable, composeRefs, mergeProps, mergePropsWithRef };\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { Slot } from '../lib/slot';\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n\t\"[&_svg]:-mx-0.5 relative inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-lg border font-medium text-sm outline-none transition-[box-shadow,scale] duration-150 ease-out before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-64 motion-reduce:transition-shadow [&_svg:not([class*='opacity-'])]:opacity-80 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n\t{\n\t\tdefaultVariants: {\n\t\t\tsize: 'default',\n\t\t\tstatic: false,\n\t\t\tvariant: 'default',\n\t\t},\n\t\tvariants: {\n\t\t\tstatic: {\n\t\t\t\tfalse: 'motion-safe:active:not-disabled:scale-[0.96]',\n\t\t\t\ttrue: null,\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tdefault: 'h-10 min-w-10 px-[calc(--spacing(3)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11',\n\t\t\t\ticon: 'size-10 pointer-coarse:size-11',\n\t\t\t\t'icon-lg': 'size-11',\n\t\t\t\t'icon-sm': 'size-8 pointer-coarse:size-11',\n\t\t\t\t'icon-xl': 'size-11 [&_svg:not([class*=\"size-\"])]:size-5',\n\t\t\t\t'icon-xs':\n\t\t\t\t\t'size-7 rounded-md before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:size-11 not-in-data-[slot=input-group]:[&_svg:not([class*=\"size-\"])]:size-4',\n\t\t\t\tlg: 'h-11 min-w-11 px-[calc(--spacing(3.5)-1px)]',\n\t\t\t\tsm:\n\t\t\t\t\t'h-8 gap-1.5 px-[calc(--spacing(2.5)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11',\n\t\t\t\txl: 'h-12 min-w-12 px-[calc(--spacing(4)-1px)] text-lg [&_svg:not([class*=\"size-\"])]:size-5',\n\t\t\t\txs:\n\t\t\t\t\t'h-7 gap-1 rounded-md px-[calc(--spacing(2)-1px)] text-xs before:rounded-[calc(var(--radius-md)-1px)] pointer-coarse:min-h-11 pointer-coarse:min-w-11 [&_svg:not([class*=\"size-\"])]:size-3.5',\n\t\t\t},\n\t\t\tvariant: {\n\t\t\t\tdefault:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-primary bg-primary text-primary-foreground shadow-primary/24 shadow-xs hover:bg-primary/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\tdestructive:\n\t\t\t\t\t'not-disabled:inset-shadow-[0_1px_--theme(--color-white/16%)] border-destructive bg-destructive text-white shadow-destructive/24 shadow-xs hover:bg-destructive/90 [:active,[data-pressed]]:inset-shadow-[0_1px_--theme(--color-black/8%)] [:disabled,:active,[data-pressed]]:shadow-none',\n\t\t\t\t'destructive-outline':\n\t\t\t\t\t'border-destructive/40 bg-transparent bg-clip-padding text-destructive shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:border-destructive/60 [:hover,[data-pressed]]:bg-destructive/8',\n\t\t\t\tghost: 'border-transparent hover:bg-accent data-pressed:bg-accent',\n\t\t\t\tlink: 'border-transparent underline-offset-4 hover:underline',\n\t\t\t\toutline:\n\t\t\t\t\t'border-border bg-background bg-clip-padding shadow-xs not-disabled:not-active:not-data-pressed:before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-input/32 dark:not-in-data-[slot=group]:bg-clip-border dark:not-disabled:before:shadow-[0_-1px_--theme(--color-white/4%)] dark:not-disabled:not-active:not-data-pressed:before:shadow-[0_-1px_--theme(--color-white/8%)] [:disabled,:active,[data-pressed]]:shadow-none [:hover,[data-pressed]]:bg-accent/50 dark:[:hover,[data-pressed]]:bg-input/64',\n\t\t\t\tsecondary:\n\t\t\t\t\t'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/90 [:active,[data-pressed]]:bg-secondary/80',\n\t\t\t},\n\t\t},\n\t},\n);\n\ninterface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n\tvariant?: VariantProps<typeof buttonVariants>['variant'];\n\tsize?: VariantProps<typeof buttonVariants>['size'];\n\t/** Disables tactile press scaling when motion would distract from the interaction. */\n\tstatic?: boolean;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n\t({ className, variant, size, static: isStatic, asChild, children, type = 'button', ...props }, ref) => {\n\t\tconst buttonClasses = cn(buttonVariants({ className, size, static: isStatic, variant }));\n\t\tconst Comp = asChild ? Slot : 'button';\n\n\t\tif (asChild) {\n\t\t\tconst SlottedComp = Comp as typeof Slot;\n\t\t\treturn (\n\t\t\t\t<SlottedComp\n\t\t\t\t\tref={ref as React.Ref<HTMLElement>}\n\t\t\t\t\tclassName={buttonClasses}\n\t\t\t\t\tdata-slot=\"button\"\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</SlottedComp>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<button ref={ref} type={type} className={buttonClasses} data-slot=\"button\" {...props}>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t);\n\t},\n);\nButton.displayName = 'Button';\n\nexport { Button, buttonVariants };\nexport type { ButtonProps };\n","'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from '@base-ui/react/tooltip';\n\nimport { useFloatingOverlayPortalProps } from '@constructive-io/ui/portal';\nimport { cn } from '../lib/utils';\n\ntype TooltipProviderProps = React.ComponentProps<typeof TooltipPrimitive.Provider> & {\n\t/** @deprecated Use delay instead */\n\tdelayDuration?: number;\n};\n\nfunction TooltipProvider({ delay = 0, delayDuration, ...props }: TooltipProviderProps) {\n\treturn <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delay={delayDuration ?? delay} {...props} />;\n}\n\ntype TooltipProps = React.ComponentProps<typeof TooltipPrimitive.Root> & {\n\t/** @deprecated Use delay on Trigger instead */\n\tdelayDuration?: number;\n};\n\nfunction Tooltip({ delayDuration: _delayDuration, ...props }: TooltipProps) {\n\treturn <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\ntype TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger> & {\n\tdelay?: number;\n\t/** When true, merges props onto the child element instead of rendering a button */\n\tasChild?: boolean;\n};\n\nfunction TooltipTrigger({ delay = 0, asChild, children, render, ...props }: TooltipTriggerProps) {\n\tconst childRender = render === undefined && asChild && React.isValidElement(children) ? children : undefined;\n\n\treturn (\n\t\t<TooltipPrimitive.Trigger\n\t\t\tdata-slot=\"tooltip-trigger\"\n\t\t\tdelay={delay}\n\t\t\trender={render ?? childRender}\n\t\t\t{...props}\n\t\t>\n\t\t\t{childRender ? undefined : children}\n\t\t</TooltipPrimitive.Trigger>\n\t);\n}\n\ntype TooltipContentProps = React.ComponentProps<typeof TooltipPrimitive.Popup> & {\n\tsideOffset?: number;\n\tshowArrow?: boolean;\n\tside?: 'top' | 'bottom' | 'left' | 'right';\n\talign?: 'start' | 'center' | 'end';\n};\n\nfunction TooltipContent({\n\tclassName,\n\tsideOffset = 4,\n\tshowArrow = false,\n\tside = 'top',\n\talign = 'center',\n\tchildren,\n\t...props\n}: TooltipContentProps) {\n\tconst { container, zIndexClass } = useFloatingOverlayPortalProps();\n\n\treturn (\n\t\t<TooltipPrimitive.Portal container={container}>\n\t\t\t<TooltipPrimitive.Positioner side={side} align={align} sideOffset={sideOffset} className={zIndexClass}>\n\t\t\t\t<TooltipPrimitive.Popup\n\t\t\t\t\tdata-slot=\"tooltip-content\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t`bg-popover text-popover-foreground origin-(--transform-origin) relative max-w-70 rounded-md border px-2 py-1\n\t\t\t\t\t\ttext-xs transition-[scale,opacity,translate] duration-150 ease-out data-starting-style:scale-95\n\t\t\t\t\t\tdata-ending-style:scale-95 data-starting-style:opacity-0 data-ending-style:opacity-0\n\t\t\t\t\t\tdata-[side=bottom]:data-starting-style:-translate-y-2\n\t\t\t\t\t\tdata-[side=left]:data-starting-style:translate-x-2\n\t\t\t\t\t\tdata-[side=right]:data-starting-style:-translate-x-2\n\t\t\t\t\t\tdata-[side=top]:data-starting-style:translate-y-2 motion-reduce:transition-none`,\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t\trole=\"tooltip\"\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t\t{showArrow && (\n\t\t\t\t\t\t<TooltipPrimitive.Arrow className='fill-popover -my-px drop-shadow-[0_1px_0_hsl(var(--border))]' />\n\t\t\t\t\t)}\n\t\t\t\t</TooltipPrimitive.Popup>\n\t\t\t</TooltipPrimitive.Positioner>\n\t\t</TooltipPrimitive.Portal>\n\t);\n}\n\nexport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };\n","'use client';\n\nimport * as React from 'react';\nimport { useEffect, useMemo, useState, Suspense } from 'react';\nimport { CheckCircle2, CircleAlert, Loader2, WandSparkles } from 'lucide-react';\nimport type { IAceEditorProps } from 'react-ace';\n\nimport { cn } from '../lib/utils';\n\nimport { Button } from './button';\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from './tooltip';\n\n// Lazy load AceEditor\nconst AceEditor = React.lazy(async () => {\n\tconst ace = await import('react-ace');\n\tawait import('ace-builds/src-noconflict/mode-json');\n\tawait import('ace-builds/src-noconflict/theme-textmate');\n\tawait import('ace-builds/src-noconflict/theme-cloud9_night');\n\treturn ace;\n});\n\nconst EditorLoading = () => (\n\t<div className=\"flex h-32 items-center justify-center\">\n\t\t<Loader2 className=\"h-6 w-6 animate-spin\" />\n\t</div>\n);\n\ntype JsonDisplay = {\n\ticon?: React.ReactNode;\n\ttext?: string;\n\tclassName?: string;\n};\n\ninterface JsonState {\n\tstate: 'empty' | 'loading' | 'success' | 'error';\n\terrMsg?: string;\n}\n\nconst displayJsonState = (jsonState: JsonState) => {\n\tconst jsonStateMap: Record<JsonState['state'], JsonDisplay> = {\n\t\tloading: {\n\t\t\ticon: <Loader2 className=\"text-muted-foreground size-[18px] animate-spin\" />,\n\t\t\ttext: 'Checking JSON Format...',\n\t\t\tclassName: 'text-muted-foreground',\n\t\t},\n\n\t\tsuccess: {\n\t\t\ticon: <CheckCircle2 className=\"size-[18px] text-green-600\" />,\n\t\t\ttext: 'Valid JSON Format',\n\t\t\tclassName: 'text-foreground',\n\t\t},\n\n\t\terror: {\n\t\t\ticon: <CircleAlert className=\"text-destructive size-[18px]\" />,\n\t\t\ttext: jsonState.errMsg || 'Invalid JSON Format',\n\t\t\tclassName: 'text-destructive',\n\t\t},\n\n\t\tempty: {},\n\t};\n\n\treturn jsonStateMap[jsonState.state];\n};\n\ntype JsonInputProps = {\n\tvalue: string;\n\tsetValue: (value: string) => void;\n\tminLines?: number;\n\tclassName?: string;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */\n\ttheme?: 'light' | 'dark';\n};\n\nexport const JsonInput = ({ value = '', setValue, minLines = 16, className, theme = 'light' }: JsonInputProps) => {\n\tconst [jsonState, setJsonState] = useState<JsonState>({ state: 'empty' });\n\n\tconst handleChange = (val: string) => {\n\t\tsetJsonState({ state: 'loading' });\n\t\tsetValue(val);\n\t};\n\n\tuseEffect(() => {\n\t\tconst timeoutId = setTimeout(() => {\n\t\t\tconst error = validateJson(value);\n\n\t\t\tif (value.trim().length === 0) setJsonState({ state: 'empty' });\n\t\t\telse if (error) setJsonState({ state: 'error', errMsg: error });\n\t\t\telse setJsonState({ state: 'success' });\n\t\t}, 400);\n\n\t\treturn () => clearTimeout(timeoutId);\n\t}, [value]);\n\n\tconst { icon, text, className: textClassName } = displayJsonState(jsonState);\n\tconst isValidJson = validateJson(value) === null;\n\n\tconst lines = useMemo(() => {\n\t\treturn Math.max(countJsonLines(value), minLines);\n\t}, [value, minLines]);\n\n\treturn (\n\t\t<div>\n\t\t\t<div className={cn('border-border/60 relative overflow-y-auto rounded-md border p-2.5', className)}>\n\t\t\t\t<JsonEditor value={value} setValue={handleChange} lines={lines} theme={theme} />\n\t\t\t\t<TooltipProvider>\n\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"absolute top-2 right-2 size-8 rounded-xl\"\n\t\t\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tdisabled={!isValidJson}\n\t\t\t\t\t\t\t\tonClick={() => setValue(prettifyJson(value))}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<WandSparkles className=\"text-muted-foreground size-4\" />\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t<TooltipContent>Format JSON</TooltipContent>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t</TooltipProvider>\n\t\t\t</div>\n\t\t\t{jsonState.state !== 'empty' && (\n\t\t\t\t<div className=\"mt-2 flex items-center gap-2\">\n\t\t\t\t\t{icon}\n\t\t\t\t\t<span className={cn('text-sm', textClassName)}>{text}</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\ntype JsonEditorProps = {\n\tvalue: string;\n\tlines: number;\n\tsetValue?: (value: string) => void;\n\treadOnly?: boolean;\n\tisValid?: boolean;\n\tenableFolding?: boolean;\n\t/** Theme for the editor: 'light' or 'dark'. Defaults to 'light'. */\n\ttheme?: 'light' | 'dark';\n};\n\nexport const JsonEditor = ({\n\tvalue,\n\tsetValue,\n\tlines,\n\treadOnly = false,\n\tisValid = true,\n\tenableFolding = false,\n\ttheme = 'light',\n}: JsonEditorProps) => {\n\tconst editorProps: IAceEditorProps = {\n\t\tmode: 'json',\n\t\ttheme: theme === 'light' ? 'textmate' : 'cloud9_night',\n\t\tfontSize: '14px',\n\t\treadOnly,\n\t\tstyle: {\n\t\t\twidth: '100%',\n\t\t\tbackground: 'transparent',\n\t\t\toffset: 0,\n\t\t},\n\t\tsetOptions: {\n\t\t\tuseWorker: false,\n\t\t\tprintMargin: false,\n\t\t\tshowFoldWidgets: enableFolding,\n\t\t\tfoldStyle: 'markbegin',\n\t\t},\n\t\ttabSize: 2,\n\t\twrapEnabled: readOnly && !isValid,\n\t\tshowGutter: enableFolding,\n\t\tminLines: lines,\n\t\tmaxLines: lines,\n\t\thighlightActiveLine: !readOnly,\n\t\tvalue,\n\t\tonChange: setValue,\n\t};\n\n\treturn (\n\t\t<Suspense fallback={<EditorLoading />}>\n\t\t\t<AceEditor {...editorProps} />\n\t\t</Suspense>\n\t);\n};\n\nexport const validateJson = (text: string) => {\n\ttry {\n\t\tif (text.trim().length === 0) throw new SyntaxError(`Can't use empty string`);\n\t\tJSON.parse(text);\n\t\treturn null;\n\t} catch (error) {\n\t\treturn (error as SyntaxError).message;\n\t}\n};\n\nconst prettifyJson = (text: string) => {\n\ttry {\n\t\treturn JSON.stringify(JSON.parse(text), null, 2);\n\t} catch {\n\t\treturn text;\n\t}\n};\n\nconst countJsonLines = (text: string) => text.split(/\\n/).length;\n"]}
@@ -0,0 +1,29 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var clsx = require('clsx');
5
+ var tailwindMerge = require('tailwind-merge');
6
+ var jsxRuntime = require('react/jsx-runtime');
7
+
8
+ function cn(...inputs) {
9
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
10
+ }
11
+ function Label({ className, ...props }) {
12
+ return /* @__PURE__ */ jsxRuntime.jsx(
13
+ "label",
14
+ {
15
+ "data-slot": "label",
16
+ className: cn(
17
+ `text-foreground text-sm leading-4 font-medium select-none group-data-[disabled=true]:pointer-events-none
18
+ group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50
19
+ data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,
20
+ className
21
+ ),
22
+ ...props
23
+ }
24
+ );
25
+ }
26
+
27
+ exports.Label = Label;
28
+ //# sourceMappingURL=label.cjs.map
29
+ //# sourceMappingURL=label.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/components/label.tsx"],"names":["twMerge","clsx","jsx"],"mappings":";;;;;;AAGO,SAAS,MAAM,MAAA,EAAsB;AAC1C,EAAA,OAAOA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;AAC7B;ACOA,SAAS,KAAA,CAAM,EAAE,SAAA,EAAW,GAAG,OAAM,EAAe;AACnD,EAAA,uBACCC,cAAA;AAAA,IAAC,OAAA;AAAA,IAAA;AAAA,MACA,WAAA,EAAU,OAAA;AAAA,MACV,SAAA,EAAW,EAAA;AAAA,QACV,CAAA;AAAA;AAAA,kEAAA,CAAA;AAAA,QAGA;AAAA,OACD;AAAA,MACC,GAAG;AAAA;AAAA,GACL;AAEF","file":"label.cjs","sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","'use client';\n\nimport * as React from 'react';\n\nimport { cn } from '../lib/utils';\n\ntype LabelProps = React.ComponentProps<'label'>;\n\n/**\n * Label component for form controls.\n * Uses a standard HTML label element for maximum compatibility.\n */\nfunction Label({ className, ...props }: LabelProps) {\n\treturn (\n\t\t<label\n\t\t\tdata-slot=\"label\"\n\t\t\tclassName={cn(\n\t\t\t\t`text-foreground text-sm leading-4 font-medium select-none group-data-[disabled=true]:pointer-events-none\n\t\t\t\tgroup-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50\n\t\t\t\tdata-[disabled]:pointer-events-none data-[disabled]:opacity-50`,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport { Label };\nexport type { LabelProps };\n"]}
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+
3
+ type LabelProps = React.ComponentProps<'label'>;
4
+ /**
5
+ * Label component for form controls.
6
+ * Uses a standard HTML label element for maximum compatibility.
7
+ */
8
+ declare function Label({ className, ...props }: LabelProps): React.JSX.Element;
9
+
10
+ export { Label, type LabelProps };
@@ -1,4 +1,3 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import * as React from 'react';
3
2
 
4
3
  type LabelProps = React.ComponentProps<'label'>;
@@ -6,6 +5,6 @@ type LabelProps = React.ComponentProps<'label'>;
6
5
  * Label component for form controls.
7
6
  * Uses a standard HTML label element for maximum compatibility.
8
7
  */
9
- declare function Label({ className, ...props }: LabelProps): react_jsx_runtime.JSX.Element;
8
+ declare function Label({ className, ...props }: LabelProps): React.JSX.Element;
10
9
 
11
10
  export { Label, type LabelProps };
@@ -0,0 +1,108 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var React = require('react');
5
+ var react = require('motion/react');
6
+ var clsx = require('clsx');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+
30
+ // src/lib/motion/motion-config.ts
31
+ var easings = {
32
+ /** Smooth both ways - good for hover states and toggles */
33
+ easeInOut: [0.42, 0, 0.58, 1]};
34
+ function cn(...inputs) {
35
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
36
+ }
37
+ var MotionGrid = ({
38
+ gridSize,
39
+ duration = 200,
40
+ animate = true,
41
+ cellClassName,
42
+ cellProps,
43
+ cellActiveClassName,
44
+ cellInactiveClassName,
45
+ className,
46
+ style,
47
+ ...props
48
+ }) => {
49
+ const [cols, rows] = gridSize;
50
+ const frames = useLoadingFrames(cols, rows);
51
+ const [index, setIndex] = React__namespace.useState(0);
52
+ const intervalRef = React__namespace.useRef(null);
53
+ const prefersReducedMotion = react.useReducedMotion();
54
+ const shouldAnimate = animate && !prefersReducedMotion;
55
+ React__namespace.useEffect(() => {
56
+ if (!shouldAnimate || frames.length === 0) {
57
+ setIndex(0);
58
+ return;
59
+ }
60
+ intervalRef.current = setInterval(() => setIndex((i) => (i + 1) % frames.length), duration);
61
+ return () => clearInterval(intervalRef.current);
62
+ }, [frames.length, duration, shouldAnimate]);
63
+ const active = new Set(frames[index]?.map(([x, y]) => y * cols + x) ?? []);
64
+ return /* @__PURE__ */ jsxRuntime.jsx(
65
+ "div",
66
+ {
67
+ className: cn("grid w-fit gap-0.5", className),
68
+ style: {
69
+ ...style,
70
+ gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,
71
+ gridAutoRows: "1fr"
72
+ },
73
+ ...props,
74
+ children: Array.from({ length: cols * rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
75
+ react.motion.div,
76
+ {
77
+ className: cn(
78
+ "aspect-square size-3 rounded-full",
79
+ active.has(i) ? cn("bg-primary scale-110", cellActiveClassName) : cn("bg-muted scale-100", cellInactiveClassName),
80
+ cellClassName
81
+ ),
82
+ ...cellProps,
83
+ transition: prefersReducedMotion ? { duration: 0 } : { duration: duration / 1e3, ease: easings.easeInOut }
84
+ },
85
+ i
86
+ ))
87
+ }
88
+ );
89
+ };
90
+ var useLoadingFrames = (cols = 8, rows = 4) => {
91
+ const loadingFrames = React__namespace.useMemo(() => {
92
+ const frames = [];
93
+ for (let s = 0; s < cols + rows; s++) {
94
+ const dots = [];
95
+ for (let y = 0; y < rows; y++) {
96
+ const x = s - y;
97
+ if (x >= 0 && x < cols) dots.push([x, y]);
98
+ }
99
+ frames.push(dots);
100
+ }
101
+ return frames;
102
+ }, [cols, rows]);
103
+ return loadingFrames;
104
+ };
105
+
106
+ exports.MotionGrid = MotionGrid;
107
+ //# sourceMappingURL=motion-grid.cjs.map
108
+ //# sourceMappingURL=motion-grid.cjs.map