@constructive-io/ui 0.12.0 → 0.14.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 (493) hide show
  1. package/README.md +1 -1
  2. package/dist/{ai-CiaH2sfF.js → ai-4JrVVL3q.js} +1794 -250
  3. package/dist/ai-4JrVVL3q.js.map +1 -0
  4. package/dist/{ai-lAkichk8.cjs → ai-B08ufcbD.cjs} +1888 -248
  5. package/dist/ai-B08ufcbD.cjs.map +1 -0
  6. package/dist/{alert-BXuP0ayz.d.ts → alert-CJ4Qyk6W.d.cts} +4 -2
  7. package/dist/{alert-BXuP0ayz.d.cts → alert-CJ4Qyk6W.d.ts} +4 -2
  8. package/dist/components/accordion.cjs +60 -0
  9. package/dist/components/accordion.cjs.map +1 -0
  10. package/dist/components/accordion.d.cts +14 -0
  11. package/dist/components/accordion.d.ts +14 -0
  12. package/dist/components/accordion.js +54 -0
  13. package/dist/components/accordion.js.map +1 -0
  14. package/dist/components/ai/index.cjs +17 -1
  15. package/dist/components/ai/index.d.cts +2 -2
  16. package/dist/components/ai/index.d.ts +2 -2
  17. package/dist/components/ai/index.js +2 -2
  18. package/dist/components/alert-dialog.cjs +17 -8
  19. package/dist/components/alert-dialog.cjs.map +1 -1
  20. package/dist/components/alert-dialog.d.cts +1 -1
  21. package/dist/components/alert-dialog.d.ts +1 -1
  22. package/dist/components/alert-dialog.js +17 -8
  23. package/dist/components/alert-dialog.js.map +1 -1
  24. package/dist/components/alert.cjs +18 -8
  25. package/dist/components/alert.cjs.map +1 -1
  26. package/dist/components/alert.d.cts +2 -2
  27. package/dist/components/alert.d.ts +2 -2
  28. package/dist/components/alert.js +18 -9
  29. package/dist/components/alert.js.map +1 -1
  30. package/dist/components/autocomplete.cjs +9 -5
  31. package/dist/components/autocomplete.cjs.map +1 -1
  32. package/dist/components/autocomplete.js +9 -5
  33. package/dist/components/autocomplete.js.map +1 -1
  34. package/dist/components/avatar.cjs +9 -3
  35. package/dist/components/avatar.cjs.map +1 -1
  36. package/dist/components/avatar.d.cts +6 -0
  37. package/dist/components/avatar.d.ts +6 -0
  38. package/dist/components/avatar.js +9 -3
  39. package/dist/components/avatar.js.map +1 -1
  40. package/dist/components/badge.cjs +25 -18
  41. package/dist/components/badge.cjs.map +1 -1
  42. package/dist/components/badge.d.cts +2 -2
  43. package/dist/components/badge.d.ts +2 -2
  44. package/dist/components/badge.js +25 -18
  45. package/dist/components/badge.js.map +1 -1
  46. package/dist/components/breadcrumb.cjs +9 -6
  47. package/dist/components/breadcrumb.cjs.map +1 -1
  48. package/dist/components/breadcrumb.js +9 -6
  49. package/dist/components/breadcrumb.js.map +1 -1
  50. package/dist/components/button-group.cjs +57 -0
  51. package/dist/components/button-group.cjs.map +1 -0
  52. package/dist/components/button-group.d.cts +16 -0
  53. package/dist/components/button-group.d.ts +16 -0
  54. package/dist/components/button-group.js +51 -0
  55. package/dist/components/button-group.js.map +1 -0
  56. package/dist/components/button.cjs +62 -18
  57. package/dist/components/button.cjs.map +1 -1
  58. package/dist/components/button.d.cts +32 -2
  59. package/dist/components/button.d.ts +32 -2
  60. package/dist/components/button.js +62 -18
  61. package/dist/components/button.js.map +1 -1
  62. package/dist/components/calendar-rac.cjs +14 -8
  63. package/dist/components/calendar-rac.cjs.map +1 -1
  64. package/dist/components/calendar-rac.js +14 -8
  65. package/dist/components/calendar-rac.js.map +1 -1
  66. package/dist/components/card.cjs +35 -23
  67. package/dist/components/card.cjs.map +1 -1
  68. package/dist/components/card.d.cts +3 -2
  69. package/dist/components/card.d.ts +3 -2
  70. package/dist/components/card.js +35 -23
  71. package/dist/components/card.js.map +1 -1
  72. package/dist/components/checkbox.cjs +5 -5
  73. package/dist/components/checkbox.cjs.map +1 -1
  74. package/dist/components/checkbox.js +5 -5
  75. package/dist/components/checkbox.js.map +1 -1
  76. package/dist/components/collapsible.cjs +3 -3
  77. package/dist/components/collapsible.cjs.map +1 -1
  78. package/dist/components/collapsible.js +3 -3
  79. package/dist/components/collapsible.js.map +1 -1
  80. package/dist/components/combobox.cjs +24 -12
  81. package/dist/components/combobox.cjs.map +1 -1
  82. package/dist/components/combobox.d.cts +2 -1
  83. package/dist/components/combobox.d.ts +2 -1
  84. package/dist/components/combobox.js +24 -12
  85. package/dist/components/combobox.js.map +1 -1
  86. package/dist/components/command.cjs +30 -14
  87. package/dist/components/command.cjs.map +1 -1
  88. package/dist/components/command.d.cts +9 -2
  89. package/dist/components/command.d.ts +9 -2
  90. package/dist/components/command.js +30 -14
  91. package/dist/components/command.js.map +1 -1
  92. package/dist/components/dialog.cjs +22 -12
  93. package/dist/components/dialog.cjs.map +1 -1
  94. package/dist/components/dialog.d.cts +5 -2
  95. package/dist/components/dialog.d.ts +5 -2
  96. package/dist/components/dialog.js +22 -12
  97. package/dist/components/dialog.js.map +1 -1
  98. package/dist/components/dock.cjs +50 -27
  99. package/dist/components/dock.cjs.map +1 -1
  100. package/dist/components/dock.d.cts +1 -1
  101. package/dist/components/dock.d.ts +1 -1
  102. package/dist/components/dock.js +51 -28
  103. package/dist/components/dock.js.map +1 -1
  104. package/dist/components/drawer.cjs +22 -14
  105. package/dist/components/drawer.cjs.map +1 -1
  106. package/dist/components/drawer.js +22 -14
  107. package/dist/components/drawer.js.map +1 -1
  108. package/dist/components/dropdown-menu.cjs +34 -28
  109. package/dist/components/dropdown-menu.cjs.map +1 -1
  110. package/dist/components/dropdown-menu.d.cts +2 -2
  111. package/dist/components/dropdown-menu.d.ts +2 -2
  112. package/dist/components/dropdown-menu.js +52 -46
  113. package/dist/components/dropdown-menu.js.map +1 -1
  114. package/dist/components/empty.cjs +4 -4
  115. package/dist/components/empty.cjs.map +1 -1
  116. package/dist/components/empty.js +4 -4
  117. package/dist/components/empty.js.map +1 -1
  118. package/dist/components/field.cjs +33 -33
  119. package/dist/components/field.cjs.map +1 -1
  120. package/dist/components/field.js +34 -34
  121. package/dist/components/field.js.map +1 -1
  122. package/dist/components/flickering-grid.cjs +1 -1
  123. package/dist/components/flickering-grid.cjs.map +1 -1
  124. package/dist/components/flickering-grid.js +1 -1
  125. package/dist/components/flickering-grid.js.map +1 -1
  126. package/dist/components/flow-zoom-panel.cjs +10 -5
  127. package/dist/components/flow-zoom-panel.cjs.map +1 -1
  128. package/dist/components/flow-zoom-panel.d.cts +8 -1
  129. package/dist/components/flow-zoom-panel.d.ts +8 -1
  130. package/dist/components/flow-zoom-panel.js +10 -5
  131. package/dist/components/flow-zoom-panel.js.map +1 -1
  132. package/dist/components/form-control.cjs +12 -8
  133. package/dist/components/form-control.cjs.map +1 -1
  134. package/dist/components/form-control.js +12 -8
  135. package/dist/components/form-control.js.map +1 -1
  136. package/dist/components/form.cjs +5 -5
  137. package/dist/components/form.cjs.map +1 -1
  138. package/dist/components/form.js +5 -5
  139. package/dist/components/form.js.map +1 -1
  140. package/dist/components/input-group.cjs +13 -7
  141. package/dist/components/input-group.cjs.map +1 -1
  142. package/dist/components/input-group.d.cts +2 -2
  143. package/dist/components/input-group.d.ts +2 -2
  144. package/dist/components/input-group.js +11 -7
  145. package/dist/components/input-group.js.map +1 -1
  146. package/dist/components/input-otp.cjs +252 -0
  147. package/dist/components/input-otp.cjs.map +1 -0
  148. package/dist/components/input-otp.d.cts +44 -0
  149. package/dist/components/input-otp.d.ts +44 -0
  150. package/dist/components/input-otp.js +251 -0
  151. package/dist/components/input-otp.js.map +1 -0
  152. package/dist/components/input.cjs +10 -4
  153. package/dist/components/input.cjs.map +1 -1
  154. package/dist/components/input.d.cts +11 -2
  155. package/dist/components/input.d.ts +11 -2
  156. package/dist/components/input.js +10 -4
  157. package/dist/components/input.js.map +1 -1
  158. package/dist/components/item.cjs +151 -0
  159. package/dist/components/item.cjs.map +1 -0
  160. package/dist/components/item.d.cts +37 -0
  161. package/dist/components/item.d.ts +37 -0
  162. package/dist/components/item.js +137 -0
  163. package/dist/components/item.js.map +1 -0
  164. package/dist/components/json-input.cjs +4 -143
  165. package/dist/components/json-input.d.cts +6 -4
  166. package/dist/components/json-input.d.ts +6 -4
  167. package/dist/components/json-input.js +2 -140
  168. package/dist/components/kbd.cjs +35 -0
  169. package/dist/components/kbd.cjs.map +1 -0
  170. package/dist/components/kbd.d.cts +16 -0
  171. package/dist/components/kbd.d.ts +16 -0
  172. package/dist/components/kbd.js +31 -0
  173. package/dist/components/kbd.js.map +1 -0
  174. package/dist/components/label.cjs +3 -3
  175. package/dist/components/label.cjs.map +1 -1
  176. package/dist/components/label.js +3 -3
  177. package/dist/components/label.js.map +1 -1
  178. package/dist/components/motion-grid.cjs +20 -8
  179. package/dist/components/motion-grid.cjs.map +1 -1
  180. package/dist/components/motion-grid.js +20 -8
  181. package/dist/components/motion-grid.js.map +1 -1
  182. package/dist/components/multi-select.cjs +77 -67
  183. package/dist/components/multi-select.cjs.map +1 -1
  184. package/dist/components/multi-select.js +77 -67
  185. package/dist/components/multi-select.js.map +1 -1
  186. package/dist/components/page-header.cjs +12 -9
  187. package/dist/components/page-header.cjs.map +1 -1
  188. package/dist/components/page-header.js +12 -9
  189. package/dist/components/page-header.js.map +1 -1
  190. package/dist/components/pagination.cjs +10 -4
  191. package/dist/components/pagination.cjs.map +1 -1
  192. package/dist/components/pagination.d.cts +1 -1
  193. package/dist/components/pagination.d.ts +1 -1
  194. package/dist/components/pagination.js +10 -4
  195. package/dist/components/pagination.js.map +1 -1
  196. package/dist/components/phone-input.cjs +228 -0
  197. package/dist/components/phone-input.cjs.map +1 -0
  198. package/dist/components/phone-input.d.cts +42 -0
  199. package/dist/components/phone-input.d.ts +42 -0
  200. package/dist/components/phone-input.js +220 -0
  201. package/dist/components/phone-input.js.map +1 -0
  202. package/dist/components/popover.cjs +12 -4
  203. package/dist/components/popover.cjs.map +1 -1
  204. package/dist/components/popover.d.cts +7 -1
  205. package/dist/components/popover.d.ts +7 -1
  206. package/dist/components/popover.js +12 -5
  207. package/dist/components/popover.js.map +1 -1
  208. package/dist/components/progress.cjs +20 -3
  209. package/dist/components/progress.cjs.map +1 -1
  210. package/dist/components/progress.d.cts +1 -1
  211. package/dist/components/progress.d.ts +1 -1
  212. package/dist/components/progress.js +20 -3
  213. package/dist/components/progress.js.map +1 -1
  214. package/dist/components/progressive-blur-scroll-container.cjs +2 -2
  215. package/dist/components/progressive-blur-scroll-container.cjs.map +1 -1
  216. package/dist/components/progressive-blur-scroll-container.d.cts +1 -1
  217. package/dist/components/progressive-blur-scroll-container.d.ts +1 -1
  218. package/dist/components/progressive-blur-scroll-container.js +2 -2
  219. package/dist/components/progressive-blur-scroll-container.js.map +1 -1
  220. package/dist/components/progressive-blur.cjs +3 -2
  221. package/dist/components/progressive-blur.cjs.map +1 -1
  222. package/dist/components/progressive-blur.js +3 -2
  223. package/dist/components/progressive-blur.js.map +1 -1
  224. package/dist/components/radio-group.cjs +2 -2
  225. package/dist/components/radio-group.cjs.map +1 -1
  226. package/dist/components/radio-group.js +2 -2
  227. package/dist/components/radio-group.js.map +1 -1
  228. package/dist/components/record-picker.cjs +1 -1
  229. package/dist/components/record-picker.js +1 -1
  230. package/dist/components/resizable.cjs +2 -2
  231. package/dist/components/resizable.cjs.map +1 -1
  232. package/dist/components/resizable.js +2 -2
  233. package/dist/components/resizable.js.map +1 -1
  234. package/dist/components/responsive-diagram.cjs +43 -21
  235. package/dist/components/responsive-diagram.cjs.map +1 -1
  236. package/dist/components/responsive-diagram.d.cts +7 -1
  237. package/dist/components/responsive-diagram.d.ts +7 -1
  238. package/dist/components/responsive-diagram.js +43 -21
  239. package/dist/components/responsive-diagram.js.map +1 -1
  240. package/dist/components/scroll-area.cjs +2 -2
  241. package/dist/components/scroll-area.cjs.map +1 -1
  242. package/dist/components/scroll-area.js +2 -2
  243. package/dist/components/scroll-area.js.map +1 -1
  244. package/dist/components/select.cjs +84 -20
  245. package/dist/components/select.cjs.map +1 -1
  246. package/dist/components/select.d.cts +12 -7
  247. package/dist/components/select.d.ts +12 -7
  248. package/dist/components/select.js +84 -20
  249. package/dist/components/select.js.map +1 -1
  250. package/dist/components/separator.cjs +1 -1
  251. package/dist/components/separator.cjs.map +1 -1
  252. package/dist/components/separator.d.cts +11 -2
  253. package/dist/components/separator.d.ts +11 -2
  254. package/dist/components/separator.js +1 -1
  255. package/dist/components/separator.js.map +1 -1
  256. package/dist/components/sheet.cjs +1 -1
  257. package/dist/components/sheet.d.cts +11 -5
  258. package/dist/components/sheet.d.ts +12 -6
  259. package/dist/components/sheet.js +1 -1
  260. package/dist/components/sidebar.cjs +2 -1
  261. package/dist/components/sidebar.d.cts +8 -7
  262. package/dist/components/sidebar.d.ts +8 -7
  263. package/dist/components/sidebar.js +2 -1
  264. package/dist/components/slider.cjs +47 -0
  265. package/dist/components/slider.cjs.map +1 -0
  266. package/dist/components/slider.d.cts +8 -0
  267. package/dist/components/slider.d.ts +8 -0
  268. package/dist/components/slider.js +44 -0
  269. package/dist/components/slider.js.map +1 -0
  270. package/dist/components/sonner.cjs +15 -4
  271. package/dist/components/sonner.cjs.map +1 -1
  272. package/dist/components/sonner.d.cts +10 -1
  273. package/dist/components/sonner.d.ts +10 -1
  274. package/dist/components/sonner.js +16 -5
  275. package/dist/components/sonner.js.map +1 -1
  276. package/dist/components/spinner.cjs +25 -0
  277. package/dist/components/spinner.cjs.map +1 -0
  278. package/dist/components/spinner.d.cts +16 -0
  279. package/dist/components/spinner.d.ts +16 -0
  280. package/dist/components/spinner.js +22 -0
  281. package/dist/components/spinner.js.map +1 -0
  282. package/dist/components/stack/index.cjs +1 -1
  283. package/dist/components/stack/index.d.cts +1 -1
  284. package/dist/components/stack/index.d.ts +1 -1
  285. package/dist/components/stack/index.js +1 -1
  286. package/dist/components/stepper.cjs +23 -17
  287. package/dist/components/stepper.cjs.map +1 -1
  288. package/dist/components/stepper.d.cts +2 -2
  289. package/dist/components/stepper.d.ts +2 -2
  290. package/dist/components/stepper.js +23 -17
  291. package/dist/components/stepper.js.map +1 -1
  292. package/dist/components/switch.cjs +5 -5
  293. package/dist/components/switch.cjs.map +1 -1
  294. package/dist/components/switch.js +5 -5
  295. package/dist/components/switch.js.map +1 -1
  296. package/dist/components/table.cjs +26 -7
  297. package/dist/components/table.cjs.map +1 -1
  298. package/dist/components/table.d.cts +20 -2
  299. package/dist/components/table.d.ts +20 -2
  300. package/dist/components/table.js +26 -8
  301. package/dist/components/table.js.map +1 -1
  302. package/dist/components/tabs.cjs +64 -8
  303. package/dist/components/tabs.cjs.map +1 -1
  304. package/dist/components/tabs.d.cts +13 -2
  305. package/dist/components/tabs.d.ts +13 -2
  306. package/dist/components/tabs.js +66 -11
  307. package/dist/components/tabs.js.map +1 -1
  308. package/dist/components/tags.cjs +10 -5
  309. package/dist/components/tags.cjs.map +1 -1
  310. package/dist/components/tags.d.cts +1 -1
  311. package/dist/components/tags.d.ts +1 -1
  312. package/dist/components/tags.js +10 -5
  313. package/dist/components/tags.js.map +1 -1
  314. package/dist/components/textarea.cjs +5 -4
  315. package/dist/components/textarea.cjs.map +1 -1
  316. package/dist/components/textarea.js +5 -4
  317. package/dist/components/textarea.js.map +1 -1
  318. package/dist/components/toast/index.cjs +1 -1
  319. package/dist/components/toast/index.d.cts +2 -2
  320. package/dist/components/toast/index.d.ts +2 -2
  321. package/dist/components/toast/index.js +1 -1
  322. package/dist/components/toggle-group.cjs +69 -0
  323. package/dist/components/toggle-group.cjs.map +1 -0
  324. package/dist/components/toggle-group.d.cts +27 -0
  325. package/dist/components/toggle-group.d.ts +27 -0
  326. package/dist/components/toggle-group.js +65 -0
  327. package/dist/components/toggle-group.js.map +1 -0
  328. package/dist/components/toggle.cjs +54 -0
  329. package/dist/components/toggle.cjs.map +1 -0
  330. package/dist/components/toggle.d.cts +13 -0
  331. package/dist/components/toggle.d.ts +13 -0
  332. package/dist/components/toggle.js +50 -0
  333. package/dist/components/toggle.js.map +1 -0
  334. package/dist/components/tooltip.cjs +18 -6
  335. package/dist/components/tooltip.cjs.map +1 -1
  336. package/dist/components/tooltip.d.cts +1 -1
  337. package/dist/components/tooltip.d.ts +1 -1
  338. package/dist/components/tooltip.js +18 -6
  339. package/dist/components/tooltip.js.map +1 -1
  340. package/dist/components/unlink-button.cjs +2 -2
  341. package/dist/components/unlink-button.cjs.map +1 -1
  342. package/dist/components/unlink-button.d.cts +1 -0
  343. package/dist/components/unlink-button.d.ts +1 -0
  344. package/dist/components/unlink-button.js +2 -2
  345. package/dist/components/unlink-button.js.map +1 -1
  346. package/dist/components/workspace-kit/index.cjs +1507 -0
  347. package/dist/components/workspace-kit/index.cjs.map +1 -0
  348. package/dist/components/workspace-kit/index.d.cts +728 -0
  349. package/dist/components/workspace-kit/index.d.ts +728 -0
  350. package/dist/components/workspace-kit/index.js +1440 -0
  351. package/dist/components/workspace-kit/index.js.map +1 -0
  352. package/dist/compose-refs-Mbma1O3M.js +47 -0
  353. package/dist/compose-refs-Mbma1O3M.js.map +1 -0
  354. package/dist/compose-refs-uPrvNoiU.cjs +52 -0
  355. package/dist/compose-refs-uPrvNoiU.cjs.map +1 -0
  356. package/dist/fluid-highlight-CNELHV8o.js +134 -0
  357. package/dist/fluid-highlight-CNELHV8o.js.map +1 -0
  358. package/dist/fluid-highlight-YWFRZXsw.cjs +145 -0
  359. package/dist/fluid-highlight-YWFRZXsw.cjs.map +1 -0
  360. package/dist/{index-BzLmDsId.d.cts → index-B7cT7gZU.d.cts} +3 -3
  361. package/dist/{index-BzLmDsId.d.ts → index-B7cT7gZU.d.ts} +3 -3
  362. package/dist/{index-UnM04j0t.d.ts → index-BQZxmMpw.d.cts} +11 -31
  363. package/dist/{index-UnM04j0t.d.cts → index-BQZxmMpw.d.ts} +11 -31
  364. package/dist/{index-CyaFaZe2.d.cts → index-Cluc_xc5.d.ts} +345 -20
  365. package/dist/{index-B0wXxIAb.d.ts → index-DXoG0ghv.d.cts} +345 -20
  366. package/dist/index.cjs +107 -17
  367. package/dist/index.d.cts +64 -14
  368. package/dist/index.d.ts +64 -14
  369. package/dist/index.js +27 -14
  370. package/dist/initial-focus-B8RLtyOZ.cjs +67 -0
  371. package/dist/initial-focus-B8RLtyOZ.cjs.map +1 -0
  372. package/dist/initial-focus-j2E0EnIx.js +61 -0
  373. package/dist/initial-focus-j2E0EnIx.js.map +1 -0
  374. package/dist/initials-DSkWTOb0.cjs +127 -0
  375. package/dist/initials-DSkWTOb0.cjs.map +1 -0
  376. package/dist/initials-kCcHgrSy.js +97 -0
  377. package/dist/initials-kCcHgrSy.js.map +1 -0
  378. package/dist/json-input-CH5aEmoA.js +293 -0
  379. package/dist/json-input-CH5aEmoA.js.map +1 -0
  380. package/dist/json-input-D8yM578l.cjs +311 -0
  381. package/dist/json-input-D8yM578l.cjs.map +1 -0
  382. package/dist/{motion-config-COCFHq1L.cjs → motion-config-DZ7w5Uhq.cjs} +32 -2
  383. package/dist/motion-config-DZ7w5Uhq.cjs.map +1 -0
  384. package/dist/{motion-config-COsZ6azM.js → motion-config-DoFp4I8f.js} +21 -3
  385. package/dist/motion-config-DoFp4I8f.js.map +1 -0
  386. package/dist/{record-picker-Bz4FApxD.cjs → record-picker-BQ1-Vx0g.cjs} +23 -8
  387. package/dist/record-picker-BQ1-Vx0g.cjs.map +1 -0
  388. package/dist/{record-picker-BbxngCeV.js → record-picker-DSRo4RXV.js} +23 -8
  389. package/dist/record-picker-DSRo4RXV.js.map +1 -0
  390. package/dist/{sheet-BdA0rfIz.cjs → sheet-OxWlnT_G.cjs} +25 -32
  391. package/dist/sheet-OxWlnT_G.cjs.map +1 -0
  392. package/dist/{sheet-BLHnhLRH.js → sheet-wPF_l9Cn.js} +25 -32
  393. package/dist/sheet-wPF_l9Cn.js.map +1 -0
  394. package/dist/{sidebar-BavjjJp0.cjs → sidebar-BEEWmJwC.cjs} +74 -57
  395. package/dist/sidebar-BEEWmJwC.cjs.map +1 -0
  396. package/dist/{sidebar-DeoL2ttp.js → sidebar-DWl1Azyv.js} +74 -57
  397. package/dist/sidebar-DWl1Azyv.js.map +1 -0
  398. package/dist/{stack-ci2lkfkr.cjs → stack-CEvmUSwF.cjs} +12 -10
  399. package/dist/stack-CEvmUSwF.cjs.map +1 -0
  400. package/dist/{stack-C9GROTGA.js → stack-Kqu7YaR0.js} +12 -10
  401. package/dist/stack-Kqu7YaR0.js.map +1 -0
  402. package/dist/text-runs-CdmlS5C7.cjs +52 -0
  403. package/dist/text-runs-CdmlS5C7.cjs.map +1 -0
  404. package/dist/text-runs-DqcEO8L_.js +45 -0
  405. package/dist/text-runs-DqcEO8L_.js.map +1 -0
  406. package/dist/theme-CKpIa4Fj.d.cts +536 -0
  407. package/dist/theme-CKpIa4Fj.d.ts +536 -0
  408. package/dist/theme-dials-config.cjs +273 -0
  409. package/dist/theme-dials-config.cjs.map +1 -0
  410. package/dist/theme-dials-config.d.cts +95 -0
  411. package/dist/theme-dials-config.d.ts +95 -0
  412. package/dist/theme-dials-config.js +269 -0
  413. package/dist/theme-dials-config.js.map +1 -0
  414. package/dist/theme-presets.cjs +922 -0
  415. package/dist/theme-presets.cjs.map +1 -0
  416. package/dist/theme-presets.d.cts +89 -0
  417. package/dist/theme-presets.d.ts +89 -0
  418. package/dist/theme-presets.js +912 -0
  419. package/dist/theme-presets.js.map +1 -0
  420. package/dist/theme-tuning-CTOHSrsh.d.cts +158 -0
  421. package/dist/theme-tuning-DOko6Pmy.d.ts +158 -0
  422. package/dist/theme-tuning.cjs +349 -0
  423. package/dist/theme-tuning.cjs.map +1 -0
  424. package/dist/theme-tuning.d.cts +2 -0
  425. package/dist/theme-tuning.d.ts +2 -0
  426. package/dist/theme-tuning.js +333 -0
  427. package/dist/theme-tuning.js.map +1 -0
  428. package/dist/theme.cjs +438 -0
  429. package/dist/theme.cjs.map +1 -0
  430. package/dist/theme.d.cts +2 -0
  431. package/dist/theme.d.ts +2 -0
  432. package/dist/theme.js +436 -0
  433. package/dist/theme.js.map +1 -0
  434. package/dist/toast-08jF1DBQ.cjs +193 -0
  435. package/dist/toast-08jF1DBQ.cjs.map +1 -0
  436. package/dist/toast-CVW5XY4u.js +164 -0
  437. package/dist/toast-CVW5XY4u.js.map +1 -0
  438. package/dist/toast-details-BdxxSLlN.cjs +209 -0
  439. package/dist/toast-details-BdxxSLlN.cjs.map +1 -0
  440. package/dist/toast-details-CfsB1Vxb.js +198 -0
  441. package/dist/toast-details-CfsB1Vxb.js.map +1 -0
  442. package/dist/{tooltip-CTRQoN1A.d.ts → tooltip-Fqb4JK-g.d.cts} +2 -2
  443. package/dist/{tooltip-CTRQoN1A.d.cts → tooltip-Fqb4JK-g.d.ts} +2 -2
  444. package/dist/tuning-BKVFsxLr.js +48 -0
  445. package/dist/tuning-BKVFsxLr.js.map +1 -0
  446. package/dist/tuning-BRPG7U1U.cjs +71 -0
  447. package/dist/tuning-BRPG7U1U.cjs.map +1 -0
  448. package/dist/use-document-theme-BSEuNsEE.cjs +43 -0
  449. package/dist/use-document-theme-BSEuNsEE.cjs.map +1 -0
  450. package/dist/use-document-theme-Ch_PqxZz.js +38 -0
  451. package/dist/use-document-theme-Ch_PqxZz.js.map +1 -0
  452. package/dist/use-scroll-fade-CaHp52u4.cjs +79 -0
  453. package/dist/use-scroll-fade-CaHp52u4.cjs.map +1 -0
  454. package/dist/use-scroll-fade-ilq-o00-.js +72 -0
  455. package/dist/use-scroll-fade-ilq-o00-.js.map +1 -0
  456. package/package.json +166 -27
  457. package/src/styles/globals.css +194 -97
  458. package/dist/ai-CiaH2sfF.js.map +0 -1
  459. package/dist/ai-lAkichk8.cjs.map +0 -1
  460. package/dist/button-Bvh83YGs.d.cts +0 -20
  461. package/dist/button-Bvh83YGs.d.ts +0 -20
  462. package/dist/components/app-bar.cjs +0 -81
  463. package/dist/components/app-bar.cjs.map +0 -1
  464. package/dist/components/app-bar.d.cts +0 -27
  465. package/dist/components/app-bar.d.ts +0 -27
  466. package/dist/components/app-bar.js +0 -77
  467. package/dist/components/app-bar.js.map +0 -1
  468. package/dist/components/app-shell.cjs +0 -267
  469. package/dist/components/app-shell.cjs.map +0 -1
  470. package/dist/components/app-shell.d.cts +0 -98
  471. package/dist/components/app-shell.d.ts +0 -98
  472. package/dist/components/app-shell.js +0 -264
  473. package/dist/components/app-shell.js.map +0 -1
  474. package/dist/components/json-input.cjs.map +0 -1
  475. package/dist/components/json-input.js.map +0 -1
  476. package/dist/input-CBrCuMH8.d.cts +0 -11
  477. package/dist/input-CBrCuMH8.d.ts +0 -11
  478. package/dist/motion-config-COCFHq1L.cjs.map +0 -1
  479. package/dist/motion-config-COsZ6azM.js.map +0 -1
  480. package/dist/record-picker-BbxngCeV.js.map +0 -1
  481. package/dist/record-picker-Bz4FApxD.cjs.map +0 -1
  482. package/dist/separator-BQEsr0Rc.d.cts +0 -11
  483. package/dist/separator-BQEsr0Rc.d.ts +0 -11
  484. package/dist/sheet-BLHnhLRH.js.map +0 -1
  485. package/dist/sheet-BdA0rfIz.cjs.map +0 -1
  486. package/dist/sidebar-BavjjJp0.cjs.map +0 -1
  487. package/dist/sidebar-DeoL2ttp.js.map +0 -1
  488. package/dist/stack-C9GROTGA.js.map +0 -1
  489. package/dist/stack-ci2lkfkr.cjs.map +0 -1
  490. package/dist/toast-D6MqijT2.cjs +0 -316
  491. package/dist/toast-D6MqijT2.cjs.map +0 -1
  492. package/dist/toast-D_BOLzm3.js +0 -287
  493. package/dist/toast-D_BOLzm3.js.map +0 -1
@@ -0,0 +1,1440 @@
1
+ 'use client';
2
+ import { t as cn } from "../../utils-BkMLyah9.js";
3
+ import { a as plural, i as nameList, n as formatCount, r as graphemes, t as initials } from "../../initials-kCcHgrSy.js";
4
+ import { d as SheetTitle, i as SheetContent, n as Sheet } from "../../sheet-wPF_l9Cn.js";
5
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../tooltip.js";
6
+ import { DropdownMenuTrigger } from "../dropdown-menu.js";
7
+ import { t as useScrollFade } from "../../use-scroll-fade-ilq-o00-.js";
8
+ import * as React$1 from "react";
9
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
10
+ import { Building2, ChevronsUpDown, Loader2, Menu, Minus, Monitor, Moon, PanelLeft, Plus, Scan, Search, Sun, SunMoon, X } from "lucide-react";
11
+ import { useDirection } from "@base-ui/react/direction-provider";
12
+ import { AnimateView } from "motion/react-animate-view";
13
+
14
+ //#region src/components/workspace-kit/shell.tsx
15
+ const WorkspaceShellContext = React$1.createContext({ openNav: () => {} });
16
+ /** The enclosing workspace shell. Outside one, `openNav` is a no-op. */
17
+ function useWorkspaceShell() {
18
+ return React$1.useContext(WorkspaceShellContext);
19
+ }
20
+ /**
21
+ * Workspace layout shared by the application templates: a collapsible sidebar
22
+ * rail beside the main region, a left drawer below the `3xl` container width,
23
+ * a skip link, and one tooltip provider. The root is the `ws` container, so
24
+ * every view sizes itself to the space it is given rather than the viewport.
25
+ */
26
+ function WorkspaceShell({ sidebar, children, slot = "workspace-shell", defaultSidebarCollapsed = false, framed = false, className }) {
27
+ const [collapsed, setCollapsed] = React$1.useState(defaultSidebarCollapsed);
28
+ const [navOpen, setNavOpen] = React$1.useState(false);
29
+ const mainId = React$1.useId();
30
+ const context = React$1.useMemo(() => ({ openNav: () => setNavOpen(true) }), []);
31
+ const closeNav = React$1.useCallback(() => setNavOpen(false), []);
32
+ const shell = /* @__PURE__ */ jsxs("div", {
33
+ "data-slot": slot,
34
+ "data-framed": framed || void 0,
35
+ className: cn("@container/ws relative flex h-full min-h-0 w-full overflow-hidden bg-background text-foreground", framed ? "min-w-0 flex-1 rounded-xl border border-border shadow-xs" : className),
36
+ children: [
37
+ /* @__PURE__ */ jsx("a", {
38
+ href: `#${mainId}`,
39
+ className: "sr-only z-50 rounded-md bg-card px-3 py-2 text-sm shadow-card focus:not-sr-only focus:absolute focus:top-2 focus:start-2",
40
+ children: "Skip to main content"
41
+ }),
42
+ /* @__PURE__ */ jsx("div", {
43
+ className: "hidden h-full @3xl/ws:flex",
44
+ children: sidebar({
45
+ mode: "rail",
46
+ collapsed,
47
+ onCollapsedChange: setCollapsed,
48
+ onNavigate: () => {}
49
+ })
50
+ }),
51
+ /* @__PURE__ */ jsx("main", {
52
+ id: mainId,
53
+ tabIndex: -1,
54
+ className: "@container/view flex min-w-0 flex-1 outline-none",
55
+ children
56
+ })
57
+ ]
58
+ });
59
+ return /* @__PURE__ */ jsx(WorkspaceShellContext.Provider, {
60
+ value: context,
61
+ children: /* @__PURE__ */ jsxs(TooltipProvider, { children: [framed ? /* @__PURE__ */ jsx("div", {
62
+ "data-slot": "workspace-canvas",
63
+ className: cn("flex h-full min-h-0 w-full bg-[color-mix(in_oklab,var(--background),var(--foreground)_6%)] p-2 sm:p-3", "dark:bg-[color-mix(in_oklab,var(--background),black_35%)]", className),
64
+ children: shell
65
+ }) : shell, /* @__PURE__ */ jsx(Sheet, {
66
+ open: navOpen,
67
+ onOpenChange: setNavOpen,
68
+ children: /* @__PURE__ */ jsxs(SheetContent, {
69
+ side: "left",
70
+ showClose: false,
71
+ className: "w-72 max-w-[85vw] gap-0 p-0 sm:max-w-72",
72
+ children: [/* @__PURE__ */ jsx(SheetTitle, {
73
+ className: "sr-only",
74
+ children: "Navigation"
75
+ }), sidebar({
76
+ mode: "drawer",
77
+ collapsed: false,
78
+ onCollapsedChange: setCollapsed,
79
+ onNavigate: closeNav
80
+ })]
81
+ })
82
+ })] })
83
+ });
84
+ }
85
+
86
+ //#endregion
87
+ //#region src/components/workspace-kit/primitives.tsx
88
+ /** Tactile press for custom controls: 0.96, never lower. */
89
+ const pressClass = "transition-transform duration-(--duration-fast) ease-out motion-safe:active:scale-[0.96]";
90
+ /** Grows a small control's hit area to at least 40px without changing its box. */
91
+ const hitAreaClass = "relative before:absolute before:-inset-2 before:content-[''] pointer-coarse:before:-inset-2.5";
92
+ const focusRingClass = "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50";
93
+ const ICON_BUTTON_VARIANT = {
94
+ ghost: "text-muted-foreground hover:bg-overlay-hover hover:text-foreground",
95
+ raised: "bg-card text-foreground shadow-card hover:bg-muted"
96
+ };
97
+ const ICON_BUTTON_SIZE = {
98
+ sm: "size-6",
99
+ md: "size-7",
100
+ lg: "size-8"
101
+ };
102
+ /**
103
+ * The look of `TooltipIconButton`, for icon-only controls that render their own
104
+ * element, such as a menu trigger. Hover state is instant; press scales to 0.96.
105
+ */
106
+ function iconButtonClass({ variant = "ghost", size = "md", extendHitArea = true, menu = false } = {}) {
107
+ return cn("grid shrink-0 cursor-pointer place-items-center rounded-md disabled:cursor-not-allowed disabled:opacity-40", ICON_BUTTON_VARIANT[variant], ICON_BUTTON_SIZE[size], pressClass, focusRingClass, extendHitArea && "relative before:absolute before:-inset-2 before:content-[''] pointer-coarse:before:-inset-2.5", menu && "data-popup-open:bg-overlay-hover");
108
+ }
109
+ /**
110
+ * Icon-only button with a matching tooltip and accessible name. Hover state is
111
+ * instant; press scales to 0.96.
112
+ */
113
+ function TooltipIconButton({ label, side = "top", variant, size, extendHitArea, className, children, ...props }) {
114
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx("button", {
115
+ type: "button",
116
+ "aria-label": label,
117
+ className: cn(iconButtonClass({
118
+ variant,
119
+ size,
120
+ extendHitArea
121
+ }), className),
122
+ ...props,
123
+ children
124
+ }) }), /* @__PURE__ */ jsx(TooltipContent, {
125
+ side,
126
+ children: label
127
+ })] });
128
+ }
129
+ /** CSS colour for each non-neutral tone, for tints mixed at runtime. */
130
+ const TONE_COLOR = {
131
+ primary: "var(--primary)",
132
+ warning: "var(--warning)",
133
+ violet: "var(--chart-3)",
134
+ amber: "var(--chart-4)",
135
+ success: "var(--success)",
136
+ danger: "var(--destructive)",
137
+ info: "var(--info)"
138
+ };
139
+ /**
140
+ * Tone fills mixed from `--tone`. On a white page the fill carries the colour and the
141
+ * border only defines the edge; dark keeps a fainter fill under a stronger border.
142
+ * The light edge is translucent so it sits on any row tint, and where relative colours
143
+ * work its chroma is capped first: a translucent edge of a tone outside sRGB (the info
144
+ * blue) otherwise renders yellow at the rounded corners.
145
+ */
146
+ const toneBadgeClass = cn("[--tone-edge:color-mix(in_oklab,var(--tone)_25%,transparent)]", "supports-[color:oklch(from_red_l_c_h)]:[--tone-edge:color-mix(in_oklab,oklch(from_var(--tone)_l_min(c,0.12)_h)_25%,transparent)]", "border-(--tone-edge) bg-[color-mix(in_oklab,var(--tone)_14%,transparent)]", "text-[color-mix(in_oklab,var(--tone),var(--foreground)_32%)]", "dark:border-[color-mix(in_oklab,var(--tone)_35%,transparent)] dark:bg-[color-mix(in_oklab,var(--tone)_9%,transparent)]");
147
+ /** Small tinted label. Clickable when `onClick` is set. */
148
+ function ToneBadge({ tone, children, onClick, className }) {
149
+ const color = tone === "neutral" ? null : TONE_COLOR[tone];
150
+ const props = {
151
+ className: cn("inline-flex h-5 shrink-0 items-center gap-1 whitespace-nowrap rounded-[5px] border px-1.5 text-xs [&_svg]:size-3", color ? toneBadgeClass : "border-border bg-muted/60 text-muted-foreground", onClick && cn("cursor-pointer", "transition-transform duration-(--duration-fast) ease-out motion-safe:active:scale-[0.96]", "outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50"), className),
152
+ style: color ? { "--tone": color } : void 0
153
+ };
154
+ return onClick ? /* @__PURE__ */ jsx("button", {
155
+ type: "button",
156
+ onClick,
157
+ ...props,
158
+ children
159
+ }) : /* @__PURE__ */ jsx("span", {
160
+ ...props,
161
+ children
162
+ });
163
+ }
164
+ /** Compact search input with a leading glyph and a visually hidden label. */
165
+ function SearchField({ label, trailing, inputRef, className, ...props }) {
166
+ return /* @__PURE__ */ jsxs("label", {
167
+ className: cn("flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 shadow-2xs focus-within:ring-[3px] focus-within:ring-ring/50", className),
168
+ children: [
169
+ /* @__PURE__ */ jsx(Search, {
170
+ "aria-hidden": "true",
171
+ className: "size-3.5 shrink-0 text-muted-foreground"
172
+ }),
173
+ /* @__PURE__ */ jsx("span", {
174
+ className: "sr-only",
175
+ children: label
176
+ }),
177
+ /* @__PURE__ */ jsx("input", {
178
+ ref: inputRef,
179
+ type: "search",
180
+ className: "min-w-0 flex-1 bg-transparent text-[0.8125rem] text-foreground outline-none placeholder:text-subtle-foreground pointer-coarse:text-base [&::-webkit-search-cancel-button]:hidden",
181
+ ...props
182
+ }),
183
+ trailing
184
+ ]
185
+ });
186
+ }
187
+ /** Opens the navigation drawer; only rendered below the sidebar breakpoint. */
188
+ function NavMenuButton() {
189
+ const { openNav } = useWorkspaceShell();
190
+ return /* @__PURE__ */ jsx(TooltipIconButton, {
191
+ label: "Open navigation",
192
+ side: "bottom",
193
+ className: "-ms-1 text-foreground @3xl/ws:hidden",
194
+ onClick: openNav,
195
+ children: /* @__PURE__ */ jsx(Menu, {
196
+ "aria-hidden": "true",
197
+ className: "size-4"
198
+ })
199
+ });
200
+ }
201
+ /**
202
+ * View header at least 48px tall: icon and title on the left, actions on the
203
+ * right. The title keeps a floor of 8rem, so on a narrow view the actions wrap
204
+ * onto a second row instead of squeezing it to an ellipsis.
205
+ */
206
+ function ViewHeader({ icon: Icon, title, children, divider = true }) {
207
+ return /* @__PURE__ */ jsxs("header", {
208
+ className: cn("flex min-h-12 shrink-0 flex-wrap content-center items-center gap-x-2 gap-y-1 px-3 py-1.5", divider && "border-b border-border"),
209
+ children: [
210
+ /* @__PURE__ */ jsx(NavMenuButton, {}),
211
+ /* @__PURE__ */ jsxs("div", {
212
+ className: "flex min-w-0 flex-1 basis-32 items-center gap-1.5",
213
+ children: [/* @__PURE__ */ jsx(Icon, {
214
+ "aria-hidden": "true",
215
+ className: "hidden size-3.5 shrink-0 text-muted-foreground @3xl/ws:block"
216
+ }), /* @__PURE__ */ jsx("h1", {
217
+ title: typeof title === "string" ? title : void 0,
218
+ className: "truncate text-sm font-medium text-foreground",
219
+ children: title
220
+ })]
221
+ }),
222
+ children ? /* @__PURE__ */ jsx("div", {
223
+ className: "ms-auto flex shrink-0 items-center gap-2",
224
+ children
225
+ }) : null
226
+ ]
227
+ });
228
+ }
229
+ /**
230
+ * A full view: the 48px header over a scrolling, centred content column with
231
+ * container-relative padding. Views keep their own scroll so the sidebar
232
+ * never moves.
233
+ */
234
+ function ViewFrame({ icon, title, actions, label, maxWidth = "max-w-6xl", className, children }) {
235
+ return /* @__PURE__ */ jsxs("section", {
236
+ "aria-label": label ?? (typeof title === "string" ? title : void 0),
237
+ className: "flex min-h-0 min-w-0 flex-1 flex-col",
238
+ children: [/* @__PURE__ */ jsx(ViewHeader, {
239
+ icon,
240
+ title,
241
+ children: actions
242
+ }), /* @__PURE__ */ jsx("div", {
243
+ className: "min-h-0 flex-1 overflow-y-auto",
244
+ children: /* @__PURE__ */ jsx("div", {
245
+ className: cn("mx-auto flex w-full flex-col gap-6 px-4 py-5 @3xl/view:px-6 @3xl/view:py-6", maxWidth, className),
246
+ children
247
+ })
248
+ })]
249
+ });
250
+ }
251
+ /**
252
+ * Sideways-scrolling row whose children keep their shadows. A scroll container
253
+ * clips everything outside its padding box, which would shave the ring and
254
+ * drop shadow off raised children; the matching negative margin and padding
255
+ * give them room without moving the row.
256
+ */
257
+ const scrollRowClass = "-m-2 overflow-x-auto p-2 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
258
+ /** Single-choice filter pills with optional counts; scrolls sideways when narrow. */
259
+ function FilterGroup({ label, value, options, onChange, compact = false, className, rootClassName, locale }) {
260
+ const rtl = useDirection() === "rtl";
261
+ const { ref, style } = useScrollFade();
262
+ return /* @__PURE__ */ jsx("div", {
263
+ ref,
264
+ style,
265
+ className: cn(scrollRowClass, "min-w-0", rootClassName),
266
+ children: /* @__PURE__ */ jsx("div", {
267
+ role: "radiogroup",
268
+ "aria-label": label,
269
+ className: cn("flex w-max gap-1", className),
270
+ children: options.map((option, index) => {
271
+ const active = value === option.value;
272
+ return /* @__PURE__ */ jsxs("button", {
273
+ type: "button",
274
+ role: "radio",
275
+ "aria-checked": active,
276
+ tabIndex: active ? 0 : -1,
277
+ onKeyDown: (event) => {
278
+ const nextIndex = event.key === "Home" ? 0 : event.key === "End" ? options.length - 1 : event.key === (rtl ? "ArrowLeft" : "ArrowRight") || event.key === "ArrowDown" ? (index + 1) % options.length : event.key === (rtl ? "ArrowRight" : "ArrowLeft") || event.key === "ArrowUp" ? (index - 1 + options.length) % options.length : void 0;
279
+ if (nextIndex === void 0) return;
280
+ event.preventDefault();
281
+ event.currentTarget.parentElement?.querySelectorAll("[role=\"radio\"]")[nextIndex]?.focus();
282
+ onChange(options[nextIndex].value);
283
+ },
284
+ onClick: () => onChange(option.value),
285
+ className: cn("inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 rounded-md px-2 text-[0.8125rem] pointer-coarse:h-9", pressClass, focusRingClass, active ? "bg-card font-medium text-foreground shadow-card" : "text-muted-foreground hover:text-foreground"),
286
+ children: [
287
+ option.icon ? /* @__PURE__ */ jsx(option.icon, {
288
+ "aria-hidden": "true",
289
+ className: "size-3.5 shrink-0"
290
+ }) : null,
291
+ /* @__PURE__ */ jsx("span", {
292
+ className: compact && option.icon ? "sr-only @md/view:not-sr-only" : void 0,
293
+ children: option.label
294
+ }),
295
+ option.count === void 0 ? null : /* @__PURE__ */ jsx("span", {
296
+ className: cn("text-xs tabular-nums", active ? "text-muted-foreground" : "text-subtle-foreground"),
297
+ children: formatCount(option.count, locale)
298
+ })
299
+ ]
300
+ }, option.value);
301
+ })
302
+ })
303
+ });
304
+ }
305
+ /**
306
+ * Two-to-four option segmented control. The track has a 6px radius and 2px
307
+ * padding, so each segment is 4px (concentric with the track).
308
+ */
309
+ function Segmented({ label, value, options, onChange, className }) {
310
+ return /* @__PURE__ */ jsx("div", {
311
+ role: "radiogroup",
312
+ "aria-label": label,
313
+ className: cn("flex gap-0.5 rounded-sm bg-muted p-0.5", className),
314
+ children: options.map((option) => {
315
+ const Icon = option.icon;
316
+ const active = value === option.value;
317
+ return /* @__PURE__ */ jsx("button", {
318
+ type: "button",
319
+ role: "radio",
320
+ "aria-checked": active,
321
+ "aria-label": Icon ? option.label : void 0,
322
+ onClick: () => onChange(option.value),
323
+ className: cn("grid h-7 flex-1 cursor-pointer place-items-center whitespace-nowrap rounded-[4px] px-2 text-[0.8125rem]", pressClass, focusRingClass, active ? "bg-card font-medium text-foreground shadow-card" : "text-muted-foreground hover:text-foreground"),
324
+ children: Icon ? /* @__PURE__ */ jsx(Icon, {
325
+ "aria-hidden": "true",
326
+ className: "size-3.5"
327
+ }) : option.label
328
+ }, option.value);
329
+ })
330
+ });
331
+ }
332
+ /**
333
+ * Card surfaces whose full-bleed children (tinted strips, sticky columns,
334
+ * table heads, canvas grids) must not cover the edge. `shadow-card` draws its
335
+ * edge as an inset shadow in both modes, which keeps it safe from any clipping
336
+ * ancestor but paints it beneath children, so the surface gets a 1px inset and
337
+ * every child lives in `SurfaceBody`.
338
+ */
339
+ const surfaceInsetClass = "overflow-hidden p-px";
340
+ function SurfaceBody({ className, children, ...props }) {
341
+ return /* @__PURE__ */ jsx("div", {
342
+ className: cn("relative h-full overflow-hidden rounded-[inherit]", className),
343
+ ...props,
344
+ children
345
+ });
346
+ }
347
+ /** Staggered entrance for a column of blocks: each child waits `step` ms longer. */
348
+ function staggerStyle(index, step = 80) {
349
+ return { animationDelay: `${index * step}ms` };
350
+ }
351
+ const enterClass = "animate-[ai-fade-up_var(--duration-slow)_var(--ease-out)_both] motion-reduce:animate-none";
352
+ /**
353
+ * Ref that toggles the DOM `inert` property. React 18 has no `inert` prop and
354
+ * React 19 treats it as boolean, so setting the property works on both.
355
+ */
356
+ function useInert(inert) {
357
+ return React$1.useCallback((node) => {
358
+ if (node) node.inert = inert;
359
+ }, [inert]);
360
+ }
361
+
362
+ //#endregion
363
+ //#region src/components/workspace-kit/reduced-motion.ts
364
+ const REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
365
+ function prefersReducedMotion() {
366
+ return typeof window !== "undefined" && Boolean(window.matchMedia?.(REDUCED_MOTION_QUERY).matches);
367
+ }
368
+ function subscribeReducedMotion(onChange) {
369
+ const query = typeof window === "undefined" ? void 0 : window.matchMedia?.(REDUCED_MOTION_QUERY);
370
+ query?.addEventListener("change", onChange);
371
+ return () => query?.removeEventListener("change", onChange);
372
+ }
373
+ /** Reduced-motion preference that renders `false` on the server and hydrates without a mismatch. */
374
+ function useReducedMotion() {
375
+ return React$1.useSyncExternalStore(subscribeReducedMotion, prefersReducedMotion, () => false);
376
+ }
377
+
378
+ //#endregion
379
+ //#region src/components/workspace-kit/canvas.tsx
380
+ const ZOOM_STEP = .25;
381
+ const DEFAULT_INSET = {
382
+ side: 24,
383
+ top: 64,
384
+ bottom: 68
385
+ };
386
+ const EASE = {
387
+ pan: "240ms cubic-bezier(0.5, 0, 0.1, 1)",
388
+ reveal: "600ms cubic-bezier(0.32, 0, 0.08, 1)"
389
+ };
390
+ /** Elements marked with this attribute (and native controls) never start a pan or swallow wheel scrolling. */
391
+ const NO_PAN_ATTRIBUTE = "data-no-pan";
392
+ /** Nodes that handle their own presses (select, drag) but still let the wheel pan and zoom over them. */
393
+ const CANVAS_NODE_ATTRIBUTE = "data-canvas-node";
394
+ const NO_PAN_SELECTOR = `button, a, input, textarea, select, [${NO_PAN_ATTRIBUTE}], [${CANVAS_NODE_ATTRIBUTE}]`;
395
+ function zoomAround(view, zoom, cx, cy) {
396
+ const px = (cx - view.x) / view.zoom;
397
+ const py = (cy - view.y) / view.zoom;
398
+ return {
399
+ zoom,
400
+ x: cx - px * zoom,
401
+ y: cy - py * zoom
402
+ };
403
+ }
404
+ /**
405
+ * Pan and zoom state for a canvas: drag, pinch, wheel, ctrl/⌘-wheel,
406
+ * keyboard, and zoom buttons, plus `reveal` to ease a node into view and
407
+ * `fit` to frame the content again. The view keeps fitting its container
408
+ * until the person pans or zooms. Transitions are skipped while dragging so
409
+ * the canvas tracks the pointer 1:1.
410
+ */
411
+ function useCanvasViewport(contentWidth, options = {}) {
412
+ const { fit: fitMode = "width", contentHeight = 0, minZoom = .5, maxZoom = 2 } = options;
413
+ const minFitZoom = options.minFitZoom ?? minZoom;
414
+ const originX = options.contentOrigin?.x ?? 0;
415
+ const originY = options.contentOrigin?.y ?? 0;
416
+ const { side, top, bottom } = options.inset ?? DEFAULT_INSET;
417
+ const viewportRef = React$1.useRef(null);
418
+ const [element, setElement] = React$1.useState(null);
419
+ const attach = React$1.useCallback((node) => {
420
+ viewportRef.current = node;
421
+ setElement(node);
422
+ }, []);
423
+ /** Active pointers by id; one drags, two pinch. */
424
+ const pointers = React$1.useRef(/* @__PURE__ */ new Map());
425
+ const gesture = React$1.useRef(null);
426
+ const [view, setView] = React$1.useState({
427
+ x: side,
428
+ y: top,
429
+ zoom: 1
430
+ });
431
+ const [transition, setTransition] = React$1.useState("none");
432
+ const [dragging, setDragging] = React$1.useState(false);
433
+ const viewRef = React$1.useRef(view);
434
+ React$1.useLayoutEffect(() => {
435
+ viewRef.current = view;
436
+ });
437
+ /** Set once the person pans or zooms; until then the view keeps fitting its container. */
438
+ const touched = React$1.useRef(false);
439
+ /** Whether the last press moved far enough to count as a pan rather than a click. */
440
+ const panned = React$1.useRef(false);
441
+ const clampZoom = React$1.useCallback((zoom) => Math.min(maxZoom, Math.max(minZoom, zoom)), [maxZoom, minZoom]);
442
+ const place = React$1.useCallback((update, ease) => {
443
+ setTransition(ease && !prefersReducedMotion() ? EASE[ease] : "none");
444
+ setView(update);
445
+ }, []);
446
+ const move = React$1.useCallback((update, ease) => {
447
+ touched.current = true;
448
+ place(update, ease);
449
+ }, [place]);
450
+ const fitted = React$1.useCallback(() => {
451
+ const viewport = viewportRef.current;
452
+ if (!viewport || viewport.clientWidth === 0 || contentWidth === 0) return null;
453
+ const width = viewport.clientWidth;
454
+ const availableWidth = width - side * 2;
455
+ if (fitMode === "width") {
456
+ const zoom = Math.max(minZoom, Math.min(1, Math.floor(availableWidth / contentWidth * 20) / 20));
457
+ return {
458
+ x: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom,
459
+ y: top - originY * zoom,
460
+ zoom
461
+ };
462
+ }
463
+ const availableHeight = viewport.clientHeight - top - bottom;
464
+ const fitZoom = Math.min(1, availableWidth / contentWidth, contentHeight ? availableHeight / contentHeight : 1);
465
+ const zoom = Math.max(minFitZoom, Math.floor(fitZoom * 20) / 20);
466
+ return {
467
+ x: Math.max(side, Math.round((width - contentWidth * zoom) / 2)) - originX * zoom,
468
+ y: Math.round(top + Math.max(0, (availableHeight - contentHeight * zoom) / 2) - originY * zoom),
469
+ zoom
470
+ };
471
+ }, [
472
+ bottom,
473
+ contentHeight,
474
+ contentWidth,
475
+ fitMode,
476
+ minFitZoom,
477
+ minZoom,
478
+ originX,
479
+ originY,
480
+ side,
481
+ top
482
+ ]);
483
+ const refit = React$1.useCallback((ease) => {
484
+ if (touched.current) return;
485
+ const next = fitted();
486
+ if (next) place(() => next, ease);
487
+ }, [fitted, place]);
488
+ const latestRefit = React$1.useRef(refit);
489
+ const fittedElement = React$1.useRef(null);
490
+ React$1.useLayoutEffect(() => {
491
+ latestRefit.current = refit;
492
+ if (element) refit(fittedElement.current === element ? "reveal" : null);
493
+ fittedElement.current = element;
494
+ }, [element, refit]);
495
+ React$1.useLayoutEffect(() => {
496
+ if (!element) return;
497
+ let size = [element.clientWidth, element.clientHeight];
498
+ const observer = new ResizeObserver(() => {
499
+ if (size[0] === element.clientWidth && size[1] === element.clientHeight) return;
500
+ size = [element.clientWidth, element.clientHeight];
501
+ latestRefit.current(null);
502
+ });
503
+ observer.observe(element);
504
+ return () => observer.disconnect();
505
+ }, [element]);
506
+ /** Keeps the current view and stops fitting, as a pan would; for edits the person makes to the content. */
507
+ const hold = React$1.useCallback(() => {
508
+ touched.current = true;
509
+ }, []);
510
+ /** Frames the content again and resumes fitting on resize. */
511
+ const fit = React$1.useCallback(() => {
512
+ const next = fitted();
513
+ if (!next) return;
514
+ touched.current = false;
515
+ place(() => next, "pan");
516
+ }, [fitted, place]);
517
+ const zoomTo = React$1.useCallback((zoom) => {
518
+ const viewport = viewportRef.current;
519
+ if (!viewport) return;
520
+ move((current) => zoomAround(current, clampZoom(zoom), viewport.clientWidth / 2, viewport.clientHeight / 2), "pan");
521
+ }, [clampZoom, move]);
522
+ /**
523
+ * Eases the view just enough to bring a node inside the canvas margins.
524
+ * Pass a `CanvasBox` for a node that is still moving to where it will settle.
525
+ */
526
+ const reveal = React$1.useCallback((target) => {
527
+ const viewport = viewportRef.current;
528
+ if (!viewport) return;
529
+ const frame = viewport.getBoundingClientRect();
530
+ const { x, y, zoom } = viewRef.current;
531
+ const rect = target instanceof Element ? target.getBoundingClientRect() : {
532
+ left: frame.left + x + target.x * zoom,
533
+ top: frame.top + y + target.y * zoom,
534
+ right: frame.left + x + (target.x + target.width) * zoom,
535
+ bottom: frame.top + y + (target.y + target.height) * zoom
536
+ };
537
+ let dx = 0;
538
+ let dy = 0;
539
+ if (rect.right > frame.right - side) dx = frame.right - side - rect.right;
540
+ if (rect.left + dx < frame.left + side) dx = frame.left + side - rect.left;
541
+ if (rect.bottom > frame.bottom - bottom) dy = frame.bottom - bottom - rect.bottom;
542
+ if (rect.top + dy < frame.top + side) dy = frame.top + side - rect.top;
543
+ if (dx || dy) place((current) => ({
544
+ ...current,
545
+ x: current.x + dx,
546
+ y: current.y + dy
547
+ }), "reveal");
548
+ }, [
549
+ bottom,
550
+ place,
551
+ side
552
+ ]);
553
+ React$1.useEffect(() => {
554
+ if (!element) return;
555
+ const onWheel = (event) => {
556
+ if (event.target.closest(`[${"data-no-pan"}]`)) return;
557
+ event.preventDefault();
558
+ if (event.ctrlKey || event.metaKey) {
559
+ const rect = element.getBoundingClientRect();
560
+ move((current) => zoomAround(current, clampZoom(current.zoom * Math.exp(-event.deltaY * .01)), event.clientX - rect.left, event.clientY - rect.top), null);
561
+ } else move((current) => ({
562
+ ...current,
563
+ x: current.x - event.deltaX,
564
+ y: current.y - event.deltaY
565
+ }), null);
566
+ };
567
+ element.addEventListener("wheel", onWheel, { passive: false });
568
+ return () => element.removeEventListener("wheel", onWheel);
569
+ }, [
570
+ clampZoom,
571
+ element,
572
+ move
573
+ ]);
574
+ /** Snapshot of the gesture origin: centroid and spread of the active pointers. */
575
+ const beginGesture = (current) => {
576
+ const points = [...pointers.current.values()];
577
+ const x = points.reduce((sum, point) => sum + point.x, 0) / points.length;
578
+ const y = points.reduce((sum, point) => sum + point.y, 0) / points.length;
579
+ const distance = points.length > 1 ? Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y) : 0;
580
+ gesture.current = {
581
+ view: current,
582
+ x,
583
+ y,
584
+ distance
585
+ };
586
+ };
587
+ const handlers = {
588
+ onPointerDown(event) {
589
+ if (event.button !== 0 || event.target.closest(NO_PAN_SELECTOR)) return;
590
+ event.currentTarget.setPointerCapture(event.pointerId);
591
+ pointers.current.set(event.pointerId, {
592
+ x: event.clientX,
593
+ y: event.clientY
594
+ });
595
+ if (pointers.current.size === 1) panned.current = false;
596
+ beginGesture(viewRef.current);
597
+ setDragging(true);
598
+ },
599
+ onPointerMove(event) {
600
+ const start = gesture.current;
601
+ if (!start || !pointers.current.has(event.pointerId)) return;
602
+ if ((event.buttons & 1) === 0) {
603
+ handlers.onPointerUp(event);
604
+ return;
605
+ }
606
+ pointers.current.set(event.pointerId, {
607
+ x: event.clientX,
608
+ y: event.clientY
609
+ });
610
+ const points = [...pointers.current.values()];
611
+ const x = points.reduce((sum, point) => sum + point.x, 0) / points.length;
612
+ const y = points.reduce((sum, point) => sum + point.y, 0) / points.length;
613
+ if (!panned.current && Math.hypot(x - start.x, y - start.y) < 3) return;
614
+ panned.current = true;
615
+ const next = {
616
+ ...start.view,
617
+ x: start.view.x + x - start.x,
618
+ y: start.view.y + y - start.y
619
+ };
620
+ if (points.length < 2 || !start.distance) {
621
+ move(() => next, null);
622
+ return;
623
+ }
624
+ const rect = event.currentTarget.getBoundingClientRect();
625
+ const scale = Math.hypot(points[0].x - points[1].x, points[0].y - points[1].y) / start.distance;
626
+ move(() => zoomAround(next, clampZoom(start.view.zoom * scale), x - rect.left, y - rect.top), null);
627
+ },
628
+ onPointerUp(event) {
629
+ if (!pointers.current.delete(event.pointerId)) return;
630
+ if (pointers.current.size === 0) {
631
+ gesture.current = null;
632
+ setDragging(false);
633
+ } else beginGesture(viewRef.current);
634
+ },
635
+ onKeyDown(event) {
636
+ if (event.target !== event.currentTarget) return;
637
+ const step = event.shiftKey ? 120 : 40;
638
+ const delta = {
639
+ ArrowLeft: [step, 0],
640
+ ArrowRight: [-step, 0],
641
+ ArrowUp: [0, step],
642
+ ArrowDown: [0, -step]
643
+ }[event.key];
644
+ if (delta) {
645
+ event.preventDefault();
646
+ move((current) => ({
647
+ ...current,
648
+ x: current.x + delta[0],
649
+ y: current.y + delta[1]
650
+ }), "pan");
651
+ } else if (event.key === "+" || event.key === "=") zoomTo(view.zoom + ZOOM_STEP);
652
+ else if (event.key === "-") zoomTo(view.zoom - ZOOM_STEP);
653
+ else if (event.key === "0") zoomTo(1);
654
+ }
655
+ };
656
+ return {
657
+ /** Read-only handle on the canvas element; attach it with `attach`. */
658
+ viewportRef,
659
+ attach,
660
+ view,
661
+ transition,
662
+ dragging,
663
+ handlers: {
664
+ ...handlers,
665
+ onPointerCancel: handlers.onPointerUp,
666
+ onLostPointerCapture: handlers.onPointerUp
667
+ },
668
+ zoomTo,
669
+ zoomIn: () => zoomTo(view.zoom + ZOOM_STEP),
670
+ zoomOut: () => zoomTo(view.zoom - ZOOM_STEP),
671
+ canZoomIn: view.zoom < maxZoom,
672
+ canZoomOut: view.zoom > minZoom,
673
+ fit,
674
+ reveal,
675
+ hold,
676
+ /** True when the last press panned; use it to ignore the click that ends a drag. */
677
+ wasPanned: () => panned.current
678
+ };
679
+ }
680
+ /**
681
+ * The canvas card: a dotted grid that pans and zooms with a transformed layer
682
+ * of nodes, and an overlay for pinned controls. Spread the viewport handlers
683
+ * here once; mark interactive node parts with `NO_PAN_ATTRIBUTE`.
684
+ */
685
+ function CanvasSurface({ viewport, label, layerRef, children, overlay, onPaneClick, className }) {
686
+ const { view, transition } = viewport;
687
+ const eased = transition !== "none";
688
+ const grid = 16 * view.zoom * (view.zoom < .5 ? 2 : 1);
689
+ return /* @__PURE__ */ jsx("div", {
690
+ ref: viewport.attach,
691
+ dir: "ltr",
692
+ tabIndex: 0,
693
+ role: "region",
694
+ "aria-roledescription": "canvas",
695
+ "aria-label": label,
696
+ ...viewport.handlers,
697
+ onClick: onPaneClick ? (event) => {
698
+ if (!viewport.wasPanned() && !event.target.closest(NO_PAN_SELECTOR)) onPaneClick();
699
+ } : void 0,
700
+ className: cn("h-full touch-none rounded-xl bg-card shadow-card select-none", surfaceInsetClass, focusRingClass, viewport.dragging ? "cursor-grabbing" : "cursor-grab", className),
701
+ children: /* @__PURE__ */ jsxs(SurfaceBody, { children: [
702
+ /* @__PURE__ */ jsx("div", {
703
+ "aria-hidden": "true",
704
+ className: "absolute inset-0",
705
+ style: {
706
+ backgroundImage: "radial-gradient(circle, color-mix(in oklab, var(--foreground) 13%, transparent) 1px, transparent 1.2px)",
707
+ backgroundSize: `${grid}px ${grid}px`,
708
+ backgroundPosition: `${view.x}px ${view.y}px`,
709
+ transition: eased ? `background-size ${transition}, background-position ${transition}` : "none"
710
+ }
711
+ }),
712
+ /* @__PURE__ */ jsx("div", {
713
+ ref: layerRef,
714
+ className: "absolute top-0 start-0 will-change-transform",
715
+ style: {
716
+ transform: `translate(${view.x}px, ${view.y}px) scale(${view.zoom})`,
717
+ transformOrigin: "0 0",
718
+ transition: eased ? `transform ${transition}` : "none"
719
+ },
720
+ children
721
+ }),
722
+ overlay
723
+ ] })
724
+ });
725
+ }
726
+ /** Floating zoom pill: out, the current percentage (resets to 100%), in, and an optional fit. */
727
+ function CanvasZoomControls({ viewport, fit = false, className }) {
728
+ const percent = Math.round(viewport.view.zoom * 100);
729
+ return /* @__PURE__ */ jsxs("div", {
730
+ role: "group",
731
+ "aria-label": "Zoom",
732
+ className: cn("absolute bottom-3 left-1/2 z-10 flex -translate-x-1/2 items-center gap-0.5 rounded-lg bg-card p-0.5 shadow-card-lg", className),
733
+ children: [
734
+ /* @__PURE__ */ jsx(TooltipIconButton, {
735
+ label: "Zoom out",
736
+ extendHitArea: false,
737
+ disabled: !viewport.canZoomOut,
738
+ onClick: viewport.zoomOut,
739
+ children: /* @__PURE__ */ jsx(Minus, {
740
+ "aria-hidden": "true",
741
+ className: "size-3.5"
742
+ })
743
+ }),
744
+ /* @__PURE__ */ jsxs("button", {
745
+ type: "button",
746
+ "aria-label": `Zoom ${percent}%, reset to 100%`,
747
+ onClick: () => viewport.zoomTo(1),
748
+ className: cn("h-7 w-12 cursor-pointer rounded-md text-[0.8125rem] text-foreground tabular-nums hover:bg-overlay-hover", pressClass, focusRingClass),
749
+ children: [percent, "%"]
750
+ }),
751
+ /* @__PURE__ */ jsx(TooltipIconButton, {
752
+ label: "Zoom in",
753
+ extendHitArea: false,
754
+ disabled: !viewport.canZoomIn,
755
+ onClick: viewport.zoomIn,
756
+ children: /* @__PURE__ */ jsx(Plus, {
757
+ "aria-hidden": "true",
758
+ className: "size-3.5"
759
+ })
760
+ }),
761
+ fit ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
762
+ "aria-hidden": "true",
763
+ className: "mx-0.5 h-4 w-px bg-border"
764
+ }), /* @__PURE__ */ jsx(TooltipIconButton, {
765
+ label: "Fit to view",
766
+ extendHitArea: false,
767
+ onClick: viewport.fit,
768
+ children: /* @__PURE__ */ jsx(Scan, {
769
+ "aria-hidden": "true",
770
+ className: "size-3.5"
771
+ })
772
+ })] }) : null
773
+ ]
774
+ });
775
+ }
776
+ /** Shell radius; its 1px border and 3px inset make the inner card 10px (concentric). */
777
+ const NODE_RADIUS = "rounded-[14px]";
778
+ const INNER_RADIUS = "rounded-[10px]";
779
+ const TINT = {
780
+ new: {
781
+ borderColor: "color-mix(in oklab, var(--primary) 40%, transparent)",
782
+ backgroundColor: "color-mix(in oklab, var(--primary) 7%, var(--muted))"
783
+ },
784
+ target: {
785
+ borderColor: "color-mix(in oklab, var(--primary) 60%, transparent)",
786
+ backgroundColor: "color-mix(in oklab, var(--primary) 14%, var(--muted))"
787
+ }
788
+ };
789
+ /**
790
+ * Double-framed canvas node: a quiet bezel around a raised card, with
791
+ * concentric corners. Selected nodes get a primary edge and a soft halo.
792
+ */
793
+ function NodeShell({ as: Element = "div", tone = "plain", selected = false, underlay, cardClassName, innerClassName, className, style, children, ...props }) {
794
+ return /* @__PURE__ */ jsxs(Element, {
795
+ "data-selected": selected || void 0,
796
+ style: {
797
+ ...TINT[tone],
798
+ ...style
799
+ },
800
+ className: cn("relative isolate flex flex-col border p-[3px] transition-[border-color,background-color,box-shadow] duration-(--duration-moderate) ease-out motion-reduce:transition-none", NODE_RADIUS, tone === "plain" ? "border-foreground/[0.07] bg-muted/80" : "border-dashed", selected && "border-primary/50 shadow-[0_0_0_3px_color-mix(in_oklab,var(--primary)_16%,transparent)]", className),
801
+ ...props,
802
+ children: [underlay, /* @__PURE__ */ jsx("div", {
803
+ className: cn(surfaceInsetClass, "bg-card shadow-card", INNER_RADIUS, cardClassName),
804
+ children: /* @__PURE__ */ jsx(SurfaceBody, {
805
+ className: innerClassName,
806
+ children
807
+ })
808
+ })]
809
+ });
810
+ }
811
+ /** Small framed tile holding a node's primary-tinted icon. */
812
+ function NodeIconTile({ icon: Icon }) {
813
+ return /* @__PURE__ */ jsx("span", {
814
+ "aria-hidden": "true",
815
+ className: "grid size-[22px] shrink-0 place-items-center rounded-[6px] bg-card text-primary shadow-card",
816
+ children: /* @__PURE__ */ jsx(Icon, {
817
+ className: "size-3",
818
+ strokeWidth: 2
819
+ })
820
+ });
821
+ }
822
+ const WIRE_STROKE = {
823
+ rest: "color-mix(in oklab, var(--foreground) 20%, transparent)",
824
+ live: "color-mix(in oklab, var(--primary) 55%, transparent)",
825
+ warn: "color-mix(in oklab, var(--warning) 70%, transparent)"
826
+ };
827
+ /** One decimal is below a device pixel at any zoom the canvas allows. */
828
+ const round = (value) => Math.round(value * 10) / 10;
829
+ /** Cubic bezier between two anchors, leaving and entering along `axis`. */
830
+ function wirePath(start, end, axis = "horizontal") {
831
+ const [x1, y1, x2, y2] = [
832
+ start[0],
833
+ start[1],
834
+ end[0],
835
+ end[1]
836
+ ].map(round);
837
+ if (axis === "vertical") {
838
+ const dy = round(Math.max(24, (y2 - y1) / 2));
839
+ return `M ${x1} ${y1} C ${x1} ${round(y1 + dy)}, ${x2} ${round(y2 - dy)}, ${x2} ${y2}`;
840
+ }
841
+ const dx = round(Math.max(40, (x2 - x1) / 2));
842
+ return `M ${x1} ${y1} C ${round(x1 + dx)} ${y1}, ${round(x2 - dx)} ${y2}, ${x2} ${y2}`;
843
+ }
844
+ const GLIDE = "d var(--duration-slow) var(--ease-out), cx var(--duration-slow) var(--ease-out), cy var(--duration-slow) var(--ease-out), stroke var(--duration-moderate)";
845
+ /** Anchor dot; its position also lives in CSS so `glide` can ease it. */
846
+ function WireDot({ at, glide = false, stroke }) {
847
+ return /* @__PURE__ */ jsx("circle", {
848
+ cx: at[0],
849
+ cy: at[1],
850
+ r: 3,
851
+ fill: "var(--card)",
852
+ stroke,
853
+ strokeWidth: stroke ? 1 : void 0,
854
+ style: glide ? {
855
+ cx: at[0],
856
+ cy: at[1],
857
+ transition: GLIDE
858
+ } : void 0
859
+ });
860
+ }
861
+ /**
862
+ * One wire with anchor dots. Render inside an SVG in layer coordinates.
863
+ * `rest` wires are solid; `live` and `warn` wires are dashed.
864
+ */
865
+ function CanvasWire({ start, end, tone = "rest", axis = "horizontal", animated = false, startDot = true, glide = false }) {
866
+ const d = wirePath(start, end, axis);
867
+ return /* @__PURE__ */ jsxs("g", {
868
+ stroke: WIRE_STROKE[tone],
869
+ strokeWidth: 1,
870
+ className: "transition-[stroke] duration-(--duration-moderate)",
871
+ children: [
872
+ /* @__PURE__ */ jsx("path", {
873
+ d,
874
+ fill: "none",
875
+ strokeDasharray: tone === "rest" ? void 0 : "4 4",
876
+ strokeLinecap: "round",
877
+ style: glide ? {
878
+ d: `path("${d}")`,
879
+ transition: GLIDE
880
+ } : void 0,
881
+ children: animated ? /* @__PURE__ */ jsx("animate", {
882
+ attributeName: "stroke-dashoffset",
883
+ from: "8",
884
+ to: "0",
885
+ dur: "0.5s",
886
+ repeatCount: "indefinite"
887
+ }) : null
888
+ }),
889
+ startDot ? /* @__PURE__ */ jsx(WireDot, {
890
+ at: start,
891
+ glide
892
+ }) : null,
893
+ /* @__PURE__ */ jsx(WireDot, {
894
+ at: end,
895
+ glide
896
+ })
897
+ ]
898
+ });
899
+ }
900
+
901
+ //#endregion
902
+ //#region src/components/workspace-kit/menu.tsx
903
+ const THEMES = [
904
+ {
905
+ value: "light",
906
+ label: "Light",
907
+ icon: Sun
908
+ },
909
+ {
910
+ value: "dark",
911
+ label: "Dark",
912
+ icon: Moon
913
+ },
914
+ {
915
+ value: "system",
916
+ label: "System",
917
+ icon: Monitor
918
+ }
919
+ ];
920
+ /** The appearance row every workspace menu carries: light, dark, or system. */
921
+ function AppearanceRow({ value, onChange }) {
922
+ return /* @__PURE__ */ jsxs("div", {
923
+ className: "flex items-center gap-2 px-2 py-1 text-sm",
924
+ children: [
925
+ /* @__PURE__ */ jsx(SunMoon, {
926
+ "aria-hidden": "true",
927
+ className: "size-3.5 text-muted-foreground"
928
+ }),
929
+ /* @__PURE__ */ jsx("span", {
930
+ className: "flex-1",
931
+ children: "Appearance"
932
+ }),
933
+ /* @__PURE__ */ jsx(Segmented, {
934
+ label: "Appearance",
935
+ value,
936
+ options: THEMES,
937
+ onChange
938
+ })
939
+ ]
940
+ });
941
+ }
942
+ /** Up to two initials for a name: "Northwind Labs" → "NL". Empty for a name with nothing to show; `SwitcherTrigger` then draws an icon. */
943
+ function monogram(name) {
944
+ return initials(name) ?? "";
945
+ }
946
+ /** Sidebar header trigger for a workspace or account switcher menu. */
947
+ function SwitcherTrigger({ label, name, glyph, collapsed }) {
948
+ return /* @__PURE__ */ jsxs(DropdownMenuTrigger, {
949
+ "aria-label": label,
950
+ className: cn("flex h-8 min-w-0 cursor-pointer items-center gap-2 rounded-md px-1.5 text-start hover:bg-overlay-hover data-popup-open:bg-overlay-hover", focusRingClass, collapsed ? "w-8 justify-center px-0" : "flex-1"),
951
+ children: [/* @__PURE__ */ jsx("span", {
952
+ className: "grid size-5 shrink-0 place-items-center rounded-md bg-foreground text-[0.5625rem] font-semibold text-background",
953
+ children: glyph || /* @__PURE__ */ jsx(Building2, {
954
+ "aria-hidden": "true",
955
+ className: "size-3"
956
+ })
957
+ }), collapsed ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
958
+ title: name,
959
+ className: "min-w-0 flex-1 truncate text-sm font-medium text-foreground",
960
+ children: /* @__PURE__ */ jsx("bdi", { children: name })
961
+ }), /* @__PURE__ */ jsx(ChevronsUpDown, {
962
+ "aria-hidden": "true",
963
+ className: "size-3.5 shrink-0 text-muted-foreground"
964
+ })] })]
965
+ });
966
+ }
967
+
968
+ //#endregion
969
+ //#region src/components/workspace-kit/nav.tsx
970
+ const ROW = cn("relative flex h-8 cursor-pointer items-center rounded-md text-start text-sm pointer-coarse:h-10", focusRingClass);
971
+ /**
972
+ * Full-width row with a label, or a centred square matching the rail's icon
973
+ * buttons. A rail badge stretches the square into a capsule: the glyph, then
974
+ * the word, filling the rail's width so the word never overhangs the fill.
975
+ */
976
+ const rowShape = (collapsed, badge = false) => collapsed ? badge ? "h-auto w-full shrink-0 flex-col justify-center gap-0.5 py-1.5" : "size-8 shrink-0 justify-center pointer-coarse:size-10" : "w-full gap-2 px-2";
977
+ /**
978
+ * Labels a rail control with a tooltip while the sidebar is collapsed. A `tip`
979
+ * adds a line under the label there, and is the whole tooltip when expanded.
980
+ */
981
+ function RailTip({ label, collapsed, tip, children }) {
982
+ if (!collapsed && !tip) return children;
983
+ return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: children }), /* @__PURE__ */ jsx(TooltipContent, {
984
+ side: "right",
985
+ children: collapsed ? /* @__PURE__ */ jsxs(Fragment, { children: [label, tip ? /* @__PURE__ */ jsx("span", {
986
+ className: "block text-pretty text-muted-foreground",
987
+ children: tip
988
+ }) : null] }) : tip
989
+ })] });
990
+ }
991
+ /**
992
+ * One sidebar row. Focus reads through weight and a tinted fill, never a
993
+ * coloured dot; hover is instant because rows are clicked constantly.
994
+ */
995
+ function NavRow({ label, collapsed, active, leading, labelNode, trailing, tip, railBadge, muted, disabled, busy, onClick, href, renderLink }) {
996
+ const badge = collapsed ? railBadge : null;
997
+ const content = /* @__PURE__ */ jsxs(Fragment, { children: [
998
+ leading,
999
+ badge,
1000
+ collapsed ? null : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
1001
+ title: tip ? void 0 : label,
1002
+ className: "min-w-0 flex-1 truncate",
1003
+ children: /* @__PURE__ */ jsx("bdi", { children: labelNode ?? label })
1004
+ }), busy ? /* @__PURE__ */ jsx(Loader2, {
1005
+ "aria-hidden": "true",
1006
+ className: "size-3.5 shrink-0 text-muted-foreground motion-safe:animate-spin"
1007
+ }) : trailing] })
1008
+ ] });
1009
+ const tone = active ? "bg-sidebar-accent font-medium text-foreground" : muted ? "text-muted-foreground" : "text-sidebar-foreground";
1010
+ const shared = {
1011
+ "aria-label": collapsed ? label : void 0,
1012
+ "aria-current": active ? "page" : void 0,
1013
+ "aria-busy": busy || void 0
1014
+ };
1015
+ let row;
1016
+ if (href !== void 0) {
1017
+ const props = {
1018
+ ...shared,
1019
+ href,
1020
+ "aria-disabled": disabled || void 0,
1021
+ onClick: (event) => {
1022
+ if (disabled) event.preventDefault();
1023
+ else onClick?.();
1024
+ },
1025
+ className: cn(ROW, rowShape(collapsed, Boolean(badge)), "no-underline", disabled ? "cursor-not-allowed opacity-50" : cn("hover:bg-overlay-hover", muted && !active && "hover:text-foreground"), tone),
1026
+ children: content
1027
+ };
1028
+ row = renderLink ? renderLink(props) : /* @__PURE__ */ jsx("a", { ...props });
1029
+ } else row = /* @__PURE__ */ jsx("button", {
1030
+ type: "button",
1031
+ ...shared,
1032
+ disabled,
1033
+ onClick,
1034
+ className: cn(ROW, rowShape(collapsed, Boolean(badge)), "disabled:cursor-not-allowed disabled:opacity-50", active ? tone : cn("enabled:hover:bg-overlay-hover", tone, muted && "enabled:hover:text-foreground")),
1035
+ children: content
1036
+ });
1037
+ return /* @__PURE__ */ jsx("li", {
1038
+ className: collapsed ? "flex justify-center" : void 0,
1039
+ children: /* @__PURE__ */ jsx(RailTip, {
1040
+ label,
1041
+ collapsed,
1042
+ tip,
1043
+ children: row
1044
+ })
1045
+ });
1046
+ }
1047
+ function NavIcon({ icon: Icon, active }) {
1048
+ return /* @__PURE__ */ jsx(Icon, {
1049
+ "aria-hidden": "true",
1050
+ className: cn("size-3.5 shrink-0", active ? "text-foreground" : "text-muted-foreground")
1051
+ });
1052
+ }
1053
+ /**
1054
+ * Quiet trailing count for a nav row; hidden from assistive tech, which reads
1055
+ * the label instead. A number is grouped (`1,284`); pass a string to format it yourself.
1056
+ */
1057
+ function NavCount({ value, tone = "muted", locale }) {
1058
+ return /* @__PURE__ */ jsx("span", {
1059
+ "aria-hidden": "true",
1060
+ className: cn("text-xs tabular-nums", tone === "muted" && "text-muted-foreground", tone === "warning" && "font-medium text-warning", tone === "danger" && "font-medium text-destructive"),
1061
+ children: typeof value === "number" ? formatCount(value, locale) : value
1062
+ });
1063
+ }
1064
+ /** A group of rows with an optional small heading. */
1065
+ function NavSection({ title, collapsed, action, children }) {
1066
+ const headingId = React$1.useId();
1067
+ return /* @__PURE__ */ jsxs("div", {
1068
+ className: "flex w-full flex-col gap-1",
1069
+ children: [title && !collapsed || action ? /* @__PURE__ */ jsxs("div", {
1070
+ className: cn("flex h-7 items-center gap-2 ps-2", collapsed && "justify-center ps-0"),
1071
+ children: [collapsed || !title ? null : /* @__PURE__ */ jsx("h2", {
1072
+ id: headingId,
1073
+ className: "flex-1 truncate text-xs text-muted-foreground",
1074
+ children: title
1075
+ }), action]
1076
+ }) : null, /* @__PURE__ */ jsx("ul", {
1077
+ "aria-labelledby": title && !collapsed ? headingId : void 0,
1078
+ "aria-label": title && collapsed ? title : void 0,
1079
+ className: "flex flex-col gap-0.5",
1080
+ children
1081
+ })]
1082
+ });
1083
+ }
1084
+ /**
1085
+ * Sidebar chrome: a 48px header with the switcher and a collapse (or close)
1086
+ * control, a scrolling body, and an optional pinned footer. 224px wide, or a
1087
+ * 52px icon rail when collapsed.
1088
+ */
1089
+ function SidebarFrame({ label, menu, collapsed: collapsedProp, onCollapsedChange, drawer = false, onClose, children, footer, className }) {
1090
+ const collapsed = !drawer && collapsedProp;
1091
+ return /* @__PURE__ */ jsxs("aside", {
1092
+ "aria-label": label,
1093
+ "data-collapsed": collapsed || void 0,
1094
+ className: cn("flex h-full shrink-0 flex-col bg-sidebar", drawer ? "w-full" : cn("border-e border-sidebar-border", collapsed ? "w-[52px]" : "w-56"), className),
1095
+ children: [
1096
+ /* @__PURE__ */ jsxs("div", {
1097
+ className: cn("flex h-12 shrink-0 items-center gap-1 px-2.5", collapsed && "justify-center px-0"),
1098
+ children: [menu, drawer ? /* @__PURE__ */ jsx(TooltipIconButton, {
1099
+ label: "Close navigation",
1100
+ onClick: onClose,
1101
+ children: /* @__PURE__ */ jsx(X, {
1102
+ "aria-hidden": "true",
1103
+ className: "size-3.5"
1104
+ })
1105
+ }) : collapsed ? null : /* @__PURE__ */ jsx(TooltipIconButton, {
1106
+ label: "Collapse sidebar",
1107
+ "aria-expanded": true,
1108
+ onClick: () => onCollapsedChange?.(true),
1109
+ children: /* @__PURE__ */ jsx(PanelLeft, {
1110
+ "aria-hidden": "true",
1111
+ className: "size-3.5 rtl:-scale-x-100"
1112
+ })
1113
+ })]
1114
+ }),
1115
+ /* @__PURE__ */ jsxs("div", {
1116
+ className: cn("-mt-1 flex min-h-0 flex-1 flex-col gap-3 overflow-y-auto px-2.5 pt-1 pb-3", collapsed && "items-center px-2"),
1117
+ children: [collapsed ? /* @__PURE__ */ jsx(TooltipIconButton, {
1118
+ label: "Expand sidebar",
1119
+ side: "right",
1120
+ size: "lg",
1121
+ "aria-expanded": false,
1122
+ onClick: () => onCollapsedChange?.(false),
1123
+ children: /* @__PURE__ */ jsx(PanelLeft, {
1124
+ "aria-hidden": "true",
1125
+ className: "size-3.5 -scale-x-100 rtl:scale-x-100"
1126
+ })
1127
+ }) : null, children]
1128
+ }),
1129
+ footer
1130
+ ]
1131
+ });
1132
+ }
1133
+
1134
+ //#endregion
1135
+ //#region src/components/workspace-kit/middle-truncate.tsx
1136
+ const EXTENSION = /\.[A-Za-z0-9]{1,8}$/;
1137
+ /** The text split into what the line gives up first and what it always keeps, or `null` when it is too short to bother. */
1138
+ function splitMiddle(text, tail) {
1139
+ const extension = EXTENSION.exec(text)?.[0];
1140
+ const asked = tail ?? (extension ? extension.length + 4 : 8);
1141
+ const keep = Number.isFinite(asked) ? Math.max(0, Math.floor(asked)) : 0;
1142
+ if (keep === 0 || text.length <= keep * 2) return null;
1143
+ const pieces = graphemes(text);
1144
+ if (pieces.length <= keep * 2) return null;
1145
+ return [pieces.slice(0, -keep).join(""), pieces.slice(-keep).join("")];
1146
+ }
1147
+ /**
1148
+ * `MiddleTruncate` — one line that gives up its middle when it runs out of room, keeping the start and the end.
1149
+ * Names and keys differ at the end (`…edited_edited.HEIC`, `…/2025/09/14/`), so clipping only the end would make
1150
+ * different files read the same. The full text is the tooltip.
1151
+ *
1152
+ * A long text is drawn as two pieces, so the text itself is in the document once more, visually hidden: that copy is
1153
+ * what assistive tech reads and what a selection or copy picks up, so a copied name is the original string once. The
1154
+ * two visible pieces cannot be selected themselves. Graphemes are never cut, so an emoji or accent stays whole.
1155
+ */
1156
+ function MiddleTruncate({ text, tail, title = text, className }) {
1157
+ const parts = React$1.useMemo(() => splitMiddle(text, tail), [text, tail]);
1158
+ const tooltip = title === false ? void 0 : title;
1159
+ if (!parts) return /* @__PURE__ */ jsx("span", {
1160
+ dir: "auto",
1161
+ className: cn("block min-w-0 overflow-hidden text-ellipsis whitespace-pre", className),
1162
+ title: tooltip,
1163
+ children: text
1164
+ });
1165
+ return /* @__PURE__ */ jsxs("span", {
1166
+ dir: "auto",
1167
+ className: cn("flex min-w-0 max-w-full", className),
1168
+ title: tooltip,
1169
+ children: [
1170
+ /* @__PURE__ */ jsx("span", {
1171
+ className: "sr-only",
1172
+ children: text
1173
+ }),
1174
+ /* @__PURE__ */ jsx("span", {
1175
+ "aria-hidden": "true",
1176
+ className: "min-w-0 overflow-hidden text-ellipsis whitespace-pre select-none",
1177
+ children: parts[0]
1178
+ }),
1179
+ /* @__PURE__ */ jsx("span", {
1180
+ "aria-hidden": "true",
1181
+ className: "max-w-full shrink-0 overflow-hidden text-ellipsis whitespace-pre select-none",
1182
+ children: parts[1]
1183
+ })
1184
+ ]
1185
+ });
1186
+ }
1187
+
1188
+ //#endregion
1189
+ //#region src/components/workspace-kit/surface.tsx
1190
+ /** Hairline dashed rule used between sections of one surface. */
1191
+ const dashedRule = "border-dashed border-foreground/10";
1192
+ /** Header row and body row classes shared by every workspace table. */
1193
+ const tableHeadClass = "bg-muted/60 text-left rtl:text-right text-xs font-normal text-muted-foreground [&_th]:px-4 [&_th]:py-2 [&_th]:font-normal";
1194
+ const tableRowClass = "border-t border-border align-middle [&_td]:px-4 [&_td]:py-2.5";
1195
+ /**
1196
+ * Heading row that opens a group of body rows, tinted like the header so the
1197
+ * break reads without a heavier line. Pair it with `<th scope="rowgroup" colSpan>`.
1198
+ */
1199
+ const tableGroupRowClass = "border-t border-border bg-muted/60 [&_th]:px-4 [&_th]:py-1.5 [&_th]:text-start [&_th]:text-xs [&_th]:font-medium [&_th]:text-muted-foreground";
1200
+ /** A native select styled like the kit's inputs. */
1201
+ const nativeSelectClass = cn("h-8 rounded-md border border-border bg-card px-2 text-[0.8125rem] text-foreground shadow-2xs", focusRingClass);
1202
+ /**
1203
+ * Card around a table that scrolls sideways below `minWidth`, keeping the card
1204
+ * edge visible over full-bleed header rows. An edge fades while there is more
1205
+ * to scroll to, so a table cut off on a phone reads as scrollable.
1206
+ */
1207
+ function TableSurface({ children, className, minWidth = "40rem" }) {
1208
+ const { ref, style } = useScrollFade();
1209
+ return /* @__PURE__ */ jsx("div", {
1210
+ className: cn(surfaceInsetClass, "rounded-xl bg-card shadow-card", className),
1211
+ children: /* @__PURE__ */ jsx(SurfaceBody, { children: /* @__PURE__ */ jsx("div", {
1212
+ ref,
1213
+ className: "relative overflow-x-auto",
1214
+ style,
1215
+ children: /* @__PURE__ */ jsx("table", {
1216
+ className: "w-full border-collapse text-[0.8125rem]",
1217
+ style: { minWidth },
1218
+ children
1219
+ })
1220
+ }) })
1221
+ });
1222
+ }
1223
+ /** Small tinted status label from a presentation map entry. */
1224
+ function StatusBadge({ presentation, className, children }) {
1225
+ return /* @__PURE__ */ jsxs(ToneBadge, {
1226
+ tone: presentation.tone,
1227
+ className,
1228
+ children: [children, presentation.label]
1229
+ });
1230
+ }
1231
+ /**
1232
+ * The basic workspace surface: a card with an optional header, a body, and a
1233
+ * tinted footer strip. Full-bleed children never cover the card edge (see
1234
+ * `SurfaceBody`).
1235
+ */
1236
+ function Panel({ title, description, actions, footer, bodyClassName, className, children, ...props }) {
1237
+ const headingId = React$1.useId();
1238
+ return /* @__PURE__ */ jsx("section", {
1239
+ "aria-labelledby": title ? headingId : void 0,
1240
+ className: cn(surfaceInsetClass, "rounded-xl bg-card shadow-card", className),
1241
+ ...props,
1242
+ children: /* @__PURE__ */ jsxs(SurfaceBody, {
1243
+ className: "flex flex-col",
1244
+ children: [
1245
+ title || actions ? /* @__PURE__ */ jsxs("header", {
1246
+ className: "flex flex-wrap items-start gap-x-3 gap-y-2 px-4 pt-3.5 pb-3",
1247
+ children: [/* @__PURE__ */ jsxs("div", {
1248
+ className: "min-w-0 flex-1 basis-48",
1249
+ children: [title ? /* @__PURE__ */ jsx("h2", {
1250
+ id: headingId,
1251
+ className: "text-sm font-medium text-foreground",
1252
+ children: title
1253
+ }) : null, description ? /* @__PURE__ */ jsx("p", {
1254
+ className: "mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground",
1255
+ children: description
1256
+ }) : null]
1257
+ }), actions ? /* @__PURE__ */ jsx("div", {
1258
+ className: "flex shrink-0 items-center gap-2",
1259
+ children: actions
1260
+ }) : null]
1261
+ }) : null,
1262
+ children ? /* @__PURE__ */ jsx("div", {
1263
+ className: cn("min-w-0 flex-1 px-4 pb-4", !(title || actions) && "pt-4", bodyClassName),
1264
+ children
1265
+ }) : null,
1266
+ footer ? /* @__PURE__ */ jsx("div", {
1267
+ className: cn("border-t bg-muted/50 px-4 py-2.5 text-xs text-muted-foreground", dashedRule),
1268
+ children: footer
1269
+ }) : null
1270
+ ]
1271
+ })
1272
+ });
1273
+ }
1274
+ /**
1275
+ * Double frame: a quiet 3px bezel around a raised card. The bezel is 14px and
1276
+ * the card 11px, so the corners stay concentric.
1277
+ */
1278
+ function Bezel({ className, innerClassName, muted, children, ...props }) {
1279
+ return /* @__PURE__ */ jsx("div", {
1280
+ className: cn("rounded-[14px] border border-foreground/[0.07] p-[3px]", muted ? "bg-muted/40" : "bg-muted/80", className),
1281
+ ...props,
1282
+ children: /* @__PURE__ */ jsx("div", {
1283
+ className: cn(surfaceInsetClass, "h-full w-full rounded-[11px] bg-card shadow-card"),
1284
+ children: /* @__PURE__ */ jsx(SurfaceBody, {
1285
+ className: innerClassName,
1286
+ children
1287
+ })
1288
+ })
1289
+ });
1290
+ }
1291
+ /** Label over a large tabular figure, with an optional hint below. */
1292
+ function StatTile({ label, value, hint, icon: Icon, className }) {
1293
+ return /* @__PURE__ */ jsxs("div", {
1294
+ className: cn("flex min-w-0 flex-col gap-1", className),
1295
+ children: [
1296
+ /* @__PURE__ */ jsxs("span", {
1297
+ className: "flex items-center gap-1.5 text-xs text-muted-foreground",
1298
+ children: [Icon ? /* @__PURE__ */ jsx(Icon, {
1299
+ "aria-hidden": "true",
1300
+ className: "size-3.5 shrink-0"
1301
+ }) : null, label]
1302
+ }),
1303
+ /* @__PURE__ */ jsx("span", {
1304
+ className: "text-xl font-semibold tracking-tight text-foreground tabular-nums [overflow-wrap:anywhere]",
1305
+ children: value
1306
+ }),
1307
+ hint ? /* @__PURE__ */ jsx("span", {
1308
+ className: "text-xs text-muted-foreground tabular-nums",
1309
+ children: hint
1310
+ }) : null
1311
+ ]
1312
+ });
1313
+ }
1314
+ /** Label and value rows separated by dashed rules. */
1315
+ function KeyValueList({ items, className }) {
1316
+ return /* @__PURE__ */ jsx("dl", {
1317
+ className: cn("flex flex-col text-[0.8125rem]", className),
1318
+ children: items.map((item, index) => /* @__PURE__ */ jsxs("div", {
1319
+ className: cn("flex items-baseline justify-between gap-4 py-2", index > 0 && cn("border-t", "border-dashed border-foreground/10")),
1320
+ children: [/* @__PURE__ */ jsx("dt", {
1321
+ className: "text-muted-foreground",
1322
+ children: item.label
1323
+ }), /* @__PURE__ */ jsx("dd", {
1324
+ className: "min-w-0 text-end text-foreground tabular-nums [overflow-wrap:anywhere]",
1325
+ children: item.value
1326
+ })]
1327
+ }, item.key ?? index))
1328
+ });
1329
+ }
1330
+ /** Centred empty or blocked state with one next step. */
1331
+ function EmptyState({ icon: Icon, title, description, action, className }) {
1332
+ return /* @__PURE__ */ jsxs("div", {
1333
+ className: cn("flex flex-col items-center gap-3 px-6 py-10 text-center", className),
1334
+ children: [
1335
+ /* @__PURE__ */ jsx("span", {
1336
+ className: "grid size-9 place-items-center rounded-[10px] bg-card text-muted-foreground shadow-card",
1337
+ children: /* @__PURE__ */ jsx(Icon, {
1338
+ "aria-hidden": "true",
1339
+ className: "size-4"
1340
+ })
1341
+ }),
1342
+ /* @__PURE__ */ jsxs("div", {
1343
+ className: "max-w-sm",
1344
+ children: [/* @__PURE__ */ jsx("p", {
1345
+ className: "text-sm font-medium text-foreground",
1346
+ children: title
1347
+ }), description ? /* @__PURE__ */ jsx("p", {
1348
+ className: "mt-1 text-pretty text-[0.8125rem] text-muted-foreground",
1349
+ children: description
1350
+ }) : null]
1351
+ }),
1352
+ action
1353
+ ]
1354
+ });
1355
+ }
1356
+ /** Heading row between groups of panels inside a view. */
1357
+ function SectionHeading({ title, description, actions, id }) {
1358
+ return /* @__PURE__ */ jsxs("div", {
1359
+ className: "flex flex-wrap items-end justify-between gap-x-4 gap-y-2",
1360
+ children: [/* @__PURE__ */ jsxs("div", {
1361
+ className: "min-w-0",
1362
+ children: [/* @__PURE__ */ jsx("h2", {
1363
+ id,
1364
+ className: "text-[0.9375rem] font-medium tracking-tight text-foreground",
1365
+ children: title
1366
+ }), description ? /* @__PURE__ */ jsx("p", {
1367
+ className: "mt-0.5 text-pretty text-[0.8125rem] text-muted-foreground",
1368
+ children: description
1369
+ }) : null]
1370
+ }), actions ? /* @__PURE__ */ jsx("div", {
1371
+ className: "flex items-center gap-2",
1372
+ children: actions
1373
+ }) : null]
1374
+ });
1375
+ }
1376
+ /** Tinted icon tile used as a leading glyph in rows and notices. */
1377
+ function IconTile({ icon: Icon, tone = "neutral", className }) {
1378
+ const color = tone === "neutral" ? void 0 : TONE_COLOR[tone];
1379
+ return /* @__PURE__ */ jsx("span", {
1380
+ "aria-hidden": "true",
1381
+ className: cn("grid size-7 shrink-0 place-items-center rounded-lg", color ? null : "bg-muted text-muted-foreground", className),
1382
+ style: color ? {
1383
+ backgroundColor: `color-mix(in oklab, ${color} 12%, transparent)`,
1384
+ color: `color-mix(in oklab, ${color}, var(--foreground) 25%)`
1385
+ } : void 0,
1386
+ children: /* @__PURE__ */ jsx(Icon, { className: "size-3.5" })
1387
+ });
1388
+ }
1389
+
1390
+ //#endregion
1391
+ //#region src/components/workspace-kit/view-transition.tsx
1392
+ /**
1393
+ * React 19.3 ships `ViewTransition` and `addTransitionType`; older React keeps
1394
+ * working, just without these view swaps. Read at runtime so the template
1395
+ * builds against any React 18/19 host.
1396
+ */
1397
+ const react = React$1;
1398
+ const supported = typeof react.ViewTransition !== "undefined";
1399
+ /** Timing for view swaps: short enough that the non-interruptible transition never blocks the next click. */
1400
+ const VIEW_TRANSITION = {
1401
+ duration: .2,
1402
+ ease: [
1403
+ .22,
1404
+ 1,
1405
+ .36,
1406
+ 1
1407
+ ]
1408
+ };
1409
+ /**
1410
+ * `AnimateView` for full-view swaps (route-like changes, list swaps, shared
1411
+ * elements). Renders children untouched when React lacks `ViewTransition`, and
1412
+ * zeroes durations under reduced motion because view-transition pseudo-elements
1413
+ * sit outside the app's reduced-motion CSS.
1414
+ */
1415
+ function ViewAnimation({ children, transition, ...props }) {
1416
+ const reduced = useReducedMotion();
1417
+ if (!supported) return /* @__PURE__ */ jsx(Fragment, { children });
1418
+ return /* @__PURE__ */ jsx(AnimateView, {
1419
+ ...props,
1420
+ transition: reduced ? { duration: 0 } : {
1421
+ ...VIEW_TRANSITION,
1422
+ ...transition
1423
+ },
1424
+ children
1425
+ });
1426
+ }
1427
+ /**
1428
+ * Runs a state update as a view transition, tagging it with `types` (e.g. a
1429
+ * direction) that `enter`/`exit`/`update` functions can read.
1430
+ */
1431
+ function startViewTransition(update, ...types) {
1432
+ React$1.startTransition(() => {
1433
+ if (supported) for (const type of types) react.addTransitionType?.(type);
1434
+ update();
1435
+ });
1436
+ }
1437
+
1438
+ //#endregion
1439
+ export { AppearanceRow, Bezel, CANVAS_NODE_ATTRIBUTE, CanvasSurface, CanvasWire, CanvasZoomControls, EmptyState, FilterGroup, IconTile, KeyValueList, MiddleTruncate, NODE_RADIUS, NO_PAN_ATTRIBUTE, NavCount, NavIcon, NavMenuButton, NavRow, NavSection, NodeIconTile, NodeShell, Panel, RailTip, SearchField, SectionHeading, Segmented, SidebarFrame, StatTile, StatusBadge, SurfaceBody, SwitcherTrigger, TONE_COLOR, TableSurface, ToneBadge, TooltipIconButton, ViewAnimation, ViewFrame, ViewHeader, WIRE_STROKE, WireDot, WorkspaceShell, WorkspaceShellContext, dashedRule, enterClass, focusRingClass, formatCount, hitAreaClass, monogram, nameList, nativeSelectClass, plural, prefersReducedMotion, pressClass, scrollRowClass, staggerStyle, startViewTransition, surfaceInsetClass, tableGroupRowClass, tableHeadClass, tableRowClass, useCanvasViewport, useInert, useReducedMotion, useScrollFade, useWorkspaceShell, wirePath };
1440
+ //# sourceMappingURL=index.js.map