@krak-stack/registry 0.10.19 → 0.11.1

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 (472) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/README.md +28 -7
  3. package/dist/components/agent/index.d.ts +454 -0
  4. package/dist/components/agent/react.d.ts +55 -0
  5. package/dist/components/agent/react.js +2594 -0
  6. package/dist/components/agent/schema.d.ts +55 -0
  7. package/dist/components/animated-list/classes.d.ts +9 -0
  8. package/dist/components/animated-list/html.d.ts +11 -0
  9. package/dist/components/animated-list/html.js +533 -0
  10. package/dist/components/animated-list/index.d.ts +205 -0
  11. package/dist/components/animated-list/react.d.ts +11 -0
  12. package/dist/components/animated-list/react.js +711 -0
  13. package/dist/components/animated-list/schema.d.ts +44 -0
  14. package/dist/components/animated-number/html.d.ts +19 -0
  15. package/dist/components/animated-number/html.js +101 -0
  16. package/dist/components/animated-number/index.d.ts +80 -0
  17. package/dist/components/{ui/animated-number.d.ts → animated-number/react.d.ts} +2 -7
  18. package/dist/components/animated-number/react.js +278 -0
  19. package/dist/components/animated-number/schema.d.ts +9 -0
  20. package/dist/components/app-brand/classes.d.ts +11 -0
  21. package/dist/components/app-brand/html.d.ts +26 -0
  22. package/dist/components/app-brand/html.js +78 -0
  23. package/dist/components/app-brand/react.d.ts +12 -0
  24. package/dist/components/app-brand/react.js +86 -0
  25. package/dist/components/app-brand/schema.d.ts +36 -0
  26. package/dist/components/app-switcher/classes.d.ts +15 -0
  27. package/dist/components/app-switcher/html.d.ts +72 -0
  28. package/dist/components/app-switcher/html.js +327 -0
  29. package/dist/components/app-switcher/index.d.ts +47 -0
  30. package/dist/components/app-switcher/react.d.ts +12 -0
  31. package/dist/components/{ui/app-switcher.js → app-switcher/react.js} +84 -15
  32. package/dist/components/app-switcher/schema.d.ts +39 -0
  33. package/dist/components/async-action-button/classes.d.ts +11 -0
  34. package/dist/components/async-action-button/html.d.ts +46 -0
  35. package/dist/components/async-action-button/html.js +266 -0
  36. package/dist/components/async-action-button/index.d.ts +73 -0
  37. package/dist/components/async-action-button/react.d.ts +10 -0
  38. package/dist/components/async-action-button/react.js +378 -0
  39. package/dist/components/async-action-button/schema.d.ts +28 -0
  40. package/dist/{services/events/client/audit-log-table.d.ts → components/audit-log-table/react.d.ts} +2 -2
  41. package/dist/{services/events/client/audit-log-table.js → components/audit-log-table/react.js} +2195 -918
  42. package/dist/components/auto-height/html.d.ts +8 -0
  43. package/dist/components/auto-height/html.js +81 -0
  44. package/dist/components/auto-height/index.d.ts +2 -0
  45. package/dist/components/{ui/auto-height.d.ts → auto-height/react.d.ts} +2 -4
  46. package/dist/components/auto-height/react.js +75 -0
  47. package/dist/components/auto-height/schema.d.ts +7 -0
  48. package/dist/components/bulk-list-input/classes.d.ts +7 -0
  49. package/dist/components/bulk-list-input/html.d.ts +41 -0
  50. package/dist/components/bulk-list-input/html.js +265 -0
  51. package/dist/components/bulk-list-input/index.d.ts +76 -0
  52. package/dist/components/bulk-list-input/react.d.ts +12 -0
  53. package/dist/components/{ui/bulk-list-input.js → bulk-list-input/react.js} +71 -4
  54. package/dist/components/bulk-list-input/schema.d.ts +33 -0
  55. package/dist/components/choice-cards/classes.d.ts +19 -0
  56. package/dist/components/choice-cards/html.d.ts +76 -0
  57. package/dist/components/choice-cards/html.js +237 -0
  58. package/dist/components/choice-cards/index.d.ts +1 -0
  59. package/dist/components/choice-cards/react.d.ts +21 -0
  60. package/dist/components/{ui/choice-cards.js → choice-cards/react.js} +29 -10
  61. package/dist/components/choice-cards/schema.d.ts +100 -0
  62. package/dist/components/code-block/classes.d.ts +13 -0
  63. package/dist/components/code-block/html.d.ts +21 -0
  64. package/dist/components/code-block/html.js +381 -0
  65. package/dist/components/code-block/index.d.ts +4 -0
  66. package/dist/components/code-block/react.d.ts +4 -0
  67. package/dist/components/code-block/react.js +493 -0
  68. package/dist/components/code-block/schema.d.ts +29 -0
  69. package/dist/components/color-input/classes.d.ts +9 -0
  70. package/dist/components/color-input/html.d.ts +48 -0
  71. package/dist/components/color-input/html.js +187 -0
  72. package/dist/components/color-input/index.d.ts +88 -0
  73. package/dist/components/color-input/react.d.ts +7 -0
  74. package/dist/components/{ui/color-picker.js → color-input/react.js} +165 -233
  75. package/dist/components/color-input/schema.d.ts +40 -0
  76. package/dist/components/copy-button/html.d.ts +48 -0
  77. package/dist/components/copy-button/html.js +266 -0
  78. package/dist/components/copy-button/index.d.ts +73 -0
  79. package/dist/components/copy-button/react.d.ts +12 -0
  80. package/dist/components/copy-button/react.js +388 -0
  81. package/dist/components/copy-button/schema.d.ts +37 -0
  82. package/dist/components/copy-value/html.d.ts +37 -0
  83. package/dist/components/copy-value/html.js +426 -0
  84. package/dist/components/copy-value/index.d.ts +57 -0
  85. package/dist/components/copy-value/react.d.ts +9 -0
  86. package/dist/components/copy-value/react.js +682 -0
  87. package/dist/components/copy-value/schema.d.ts +45 -0
  88. package/dist/components/cron-input/classes.d.ts +25 -0
  89. package/dist/components/cron-input/html.d.ts +36 -0
  90. package/dist/components/cron-input/html.js +204 -0
  91. package/dist/components/cron-input/index.d.ts +59 -0
  92. package/dist/components/cron-input/react.d.ts +7 -0
  93. package/dist/components/{ui/cron-expression-editor.js → cron-input/react.js} +126 -54
  94. package/dist/components/cron-input/schema.d.ts +24 -0
  95. package/dist/components/danger-confirmation/classes.d.ts +7 -0
  96. package/dist/components/danger-confirmation/html.d.ts +39 -0
  97. package/dist/components/danger-confirmation/html.js +227 -0
  98. package/dist/components/danger-confirmation/index.d.ts +113 -0
  99. package/dist/components/{ui/danger-confirmation.d.ts → danger-confirmation/react.d.ts} +3 -12
  100. package/dist/components/danger-confirmation/react.js +550 -0
  101. package/dist/components/danger-confirmation/schema.d.ts +34 -0
  102. package/dist/components/data-table/classes.d.ts +63 -0
  103. package/dist/components/data-table/html.d.ts +1938 -0
  104. package/dist/components/data-table/html.js +2682 -0
  105. package/dist/components/data-table/index.d.ts +2686 -0
  106. package/dist/components/data-table/react.d.ts +578 -0
  107. package/dist/components/{ui/data-table.js → data-table/react.js} +2189 -906
  108. package/dist/components/data-table/schema.d.ts +3012 -0
  109. package/dist/components/date-input/classes.d.ts +17 -0
  110. package/dist/components/date-input/html.d.ts +60 -0
  111. package/dist/components/date-input/html.js +418 -0
  112. package/dist/components/date-input/index.d.ts +91 -0
  113. package/dist/components/date-input/react.d.ts +10 -0
  114. package/dist/components/{ui/date-picker.js → date-input/react.js} +233 -79
  115. package/dist/components/date-input/schema.d.ts +41 -0
  116. package/dist/components/editable-text/classes.d.ts +17 -0
  117. package/dist/components/editable-text/html.d.ts +51 -0
  118. package/dist/components/editable-text/html.js +370 -0
  119. package/dist/components/editable-text/index.d.ts +143 -0
  120. package/dist/components/editable-text/react.d.ts +6 -0
  121. package/dist/components/editable-text/react.js +499 -0
  122. package/dist/components/editable-text/schema.d.ts +31 -0
  123. package/dist/components/editing-locale-switcher/classes.d.ts +7 -0
  124. package/dist/components/editing-locale-switcher/html.d.ts +27 -0
  125. package/dist/components/editing-locale-switcher/html.js +250 -0
  126. package/dist/components/editing-locale-switcher/index.d.ts +52 -0
  127. package/dist/components/editing-locale-switcher/react.d.ts +7 -0
  128. package/dist/components/{ui/editing-locale-switcher.js → editing-locale-switcher/react.js} +70 -17
  129. package/dist/components/editing-locale-switcher/schema.d.ts +16 -0
  130. package/dist/components/{ui/effect-form.d.ts → effect-form/react.d.ts} +2 -2
  131. package/dist/components/{ui/effect-form.js → effect-form/react.js} +309 -83
  132. package/dist/components/effectcn/alert-dialog.d.ts +13 -0
  133. package/dist/components/effectcn/button.d.ts +31 -0
  134. package/dist/components/effectcn/calendar.d.ts +12 -0
  135. package/dist/components/effectcn/checkbox.d.ts +10 -0
  136. package/dist/components/effectcn/combobox.d.ts +25 -0
  137. package/dist/components/effectcn/dialog.d.ts +19 -0
  138. package/dist/components/effectcn/field.d.ts +11 -0
  139. package/dist/components/effectcn/file-drop.d.ts +8 -0
  140. package/dist/components/effectcn/input.d.ts +26 -0
  141. package/dist/components/effectcn/menu.d.ts +85 -0
  142. package/dist/components/effectcn/menubar.d.ts +8 -0
  143. package/dist/components/effectcn/popover.d.ts +18 -0
  144. package/dist/components/effectcn/scroll-area.d.ts +12 -0
  145. package/dist/components/effectcn/select.d.ts +68 -0
  146. package/dist/components/effectcn/toast.d.ts +29 -0
  147. package/dist/components/email-composer/index.d.ts +229 -0
  148. package/dist/components/email-composer/labels.d.ts +12 -0
  149. package/dist/components/email-composer/react.d.ts +5 -0
  150. package/dist/components/email-composer/react.js +1354 -0
  151. package/dist/components/email-composer/schema.d.ts +42 -0
  152. package/dist/components/email-editor/classes.d.ts +21 -0
  153. package/dist/components/email-editor/html.d.ts +360 -0
  154. package/dist/components/email-editor/html.js +1706 -0
  155. package/dist/components/email-editor/index.d.ts +693 -0
  156. package/dist/components/{ui/email-editor.d.ts → email-editor/labels.d.ts} +1 -19
  157. package/dist/components/email-editor/legacy-editor.html.d.ts +160 -0
  158. package/dist/components/email-editor/react.d.ts +11 -0
  159. package/dist/components/{ui/email-editor.js → email-editor/react.js} +1057 -712
  160. package/dist/components/email-editor/schema.d.ts +162 -0
  161. package/dist/components/error-component/classes.d.ts +7 -0
  162. package/dist/components/error-component/html.d.ts +120 -0
  163. package/dist/components/error-component/html.js +346 -0
  164. package/dist/components/error-component/index.d.ts +69 -0
  165. package/dist/components/error-component/react.d.ts +8 -0
  166. package/dist/components/error-component/react.js +744 -0
  167. package/dist/components/error-component/schema.d.ts +56 -0
  168. package/dist/components/file-input/classes.d.ts +7 -0
  169. package/dist/components/file-input/html.d.ts +95 -0
  170. package/dist/components/file-input/html.js +368 -0
  171. package/dist/components/file-input/index.d.ts +99 -0
  172. package/dist/components/file-input/react.d.ts +11 -0
  173. package/dist/components/{ui/file-picker.js → file-input/react.js} +122 -19
  174. package/dist/components/file-input/schema.d.ts +37 -0
  175. package/dist/components/{ui/form.d.ts → form/react.d.ts} +4 -4
  176. package/dist/components/{ui/form.js → form/react.js} +314 -84
  177. package/dist/components/icon-input/html.d.ts +55 -0
  178. package/dist/components/icon-input/html.js +538 -0
  179. package/dist/components/icon-input/index.d.ts +143 -0
  180. package/dist/components/icon-input/react.d.ts +6 -0
  181. package/dist/components/{ui/icon-input.js → icon-input/react.js} +459 -89
  182. package/dist/components/icon-input/schema.d.ts +23 -0
  183. package/dist/components/image-crop-editor/classes.d.ts +19 -0
  184. package/dist/components/image-crop-editor/html.d.ts +66 -0
  185. package/dist/components/image-crop-editor/html.js +561 -0
  186. package/dist/components/image-crop-editor/index.d.ts +183 -0
  187. package/dist/components/image-crop-editor/react.d.ts +8 -0
  188. package/dist/components/image-crop-editor/react.js +802 -0
  189. package/dist/components/image-crop-editor/schema.d.ts +54 -0
  190. package/dist/components/krakstack-provider/html.d.ts +17 -0
  191. package/dist/components/krakstack-provider/html.js +37 -0
  192. package/dist/components/krakstack-provider/index.d.ts +7 -0
  193. package/dist/components/krakstack-provider/react.d.ts +8 -0
  194. package/dist/components/{ui/krakstack-provider.js → krakstack-provider/react.js} +14 -5
  195. package/dist/components/krakstack-provider/schema.d.ts +6 -0
  196. package/dist/components/loading/classes.d.ts +5 -0
  197. package/dist/components/loading/html.d.ts +18 -0
  198. package/dist/components/loading/html.js +166 -0
  199. package/dist/components/loading/index.d.ts +6 -0
  200. package/dist/components/loading/react.d.ts +4 -0
  201. package/dist/components/loading/react.js +51 -0
  202. package/dist/components/loading/schema.d.ts +23 -0
  203. package/dist/components/locale-switcher/html.d.ts +22 -0
  204. package/dist/components/locale-switcher/html.js +264 -0
  205. package/dist/components/locale-switcher/index.d.ts +50 -0
  206. package/dist/components/locale-switcher/react.d.ts +7 -0
  207. package/dist/components/{ui/locale-switcher.js → locale-switcher/react.js} +55 -22
  208. package/dist/components/locale-switcher/schema.d.ts +12 -0
  209. package/dist/components/map-menu/classes.d.ts +13 -0
  210. package/dist/components/map-menu/google-maps.d.ts +80 -0
  211. package/dist/components/map-menu/google-viewport.d.ts +7 -0
  212. package/dist/components/map-menu/html.d.ts +274 -0
  213. package/dist/components/map-menu/html.js +934 -0
  214. package/dist/components/map-menu/index.d.ts +246 -0
  215. package/dist/components/map-menu/map.d.ts +47 -0
  216. package/dist/components/map-menu/react.d.ts +40 -0
  217. package/dist/components/{ui/map-menu.js → map-menu/react.js} +502 -141
  218. package/dist/components/map-menu/schema.d.ts +132 -0
  219. package/dist/components/markdown/classes.d.ts +1 -0
  220. package/dist/components/markdown/html.d.ts +23 -0
  221. package/dist/components/markdown/html.js +510 -0
  222. package/dist/components/markdown/index.d.ts +6 -0
  223. package/dist/components/markdown/react.d.ts +3 -0
  224. package/dist/components/markdown/react.js +546 -0
  225. package/dist/components/markdown/schema.d.ts +20 -0
  226. package/dist/components/notification-menu/classes.d.ts +11 -0
  227. package/dist/components/notification-menu/html.d.ts +67 -0
  228. package/dist/components/notification-menu/html.js +425 -0
  229. package/dist/components/notification-menu/index.d.ts +132 -0
  230. package/dist/components/notification-menu/react.d.ts +57 -0
  231. package/dist/components/notification-menu/react.js +829 -0
  232. package/dist/components/notification-menu/schema.d.ts +59 -0
  233. package/dist/components/pagination/classes.d.ts +19 -0
  234. package/dist/components/pagination/html.d.ts +49 -0
  235. package/dist/components/pagination/html.js +387 -0
  236. package/dist/components/pagination/index.d.ts +109 -0
  237. package/dist/components/pagination/react.d.ts +9 -0
  238. package/dist/components/{ui/pagination.js → pagination/react.js} +130 -30
  239. package/dist/components/pagination/schema.d.ts +36 -0
  240. package/dist/components/phone-number-input/classes.d.ts +17 -0
  241. package/dist/components/phone-number-input/html.d.ts +52 -0
  242. package/dist/components/phone-number-input/html.js +655 -0
  243. package/dist/components/phone-number-input/index.d.ts +59 -0
  244. package/dist/components/phone-number-input/react.d.ts +11 -0
  245. package/dist/components/{ui/phone-number-input.js → phone-number-input/react.js} +368 -138
  246. package/dist/components/phone-number-input/schema.d.ts +31 -0
  247. package/dist/components/presence-transition/html.d.ts +13 -0
  248. package/dist/components/presence-transition/html.js +128 -0
  249. package/dist/components/presence-transition/index.d.ts +57 -0
  250. package/dist/components/{ui/presence-transition.d.ts → presence-transition/react.d.ts} +3 -5
  251. package/dist/components/presence-transition/react.js +293 -0
  252. package/dist/components/presence-transition/schema.d.ts +7 -0
  253. package/dist/components/registry-previews/component-example.d.ts +31 -0
  254. package/dist/components/registry-previews/component-example.js +679 -0
  255. package/dist/components/registry-previews/html-preview.d.ts +17 -0
  256. package/dist/components/registry-previews/html-preview.js +83 -0
  257. package/dist/components/rich-text-editor/classes.d.ts +15 -0
  258. package/dist/components/rich-text-editor/engine.d.ts +9 -0
  259. package/dist/components/rich-text-editor/html.d.ts +246 -0
  260. package/dist/components/rich-text-editor/html.js +830 -0
  261. package/dist/components/rich-text-editor/index.d.ts +453 -0
  262. package/dist/components/rich-text-editor/labels.d.ts +42 -0
  263. package/dist/components/rich-text-editor/react.d.ts +19 -0
  264. package/dist/components/rich-text-editor/react.js +1175 -0
  265. package/dist/components/rich-text-editor/schema.d.ts +116 -0
  266. package/dist/components/search-menu/classes.d.ts +9 -0
  267. package/dist/components/search-menu/html.d.ts +127 -0
  268. package/dist/components/search-menu/html.js +432 -0
  269. package/dist/components/search-menu/index.d.ts +85 -0
  270. package/dist/components/search-menu/react.d.ts +18 -0
  271. package/dist/components/{ui/search-menu.js → search-menu/react.js} +290 -31
  272. package/dist/components/search-menu/schema.d.ts +78 -0
  273. package/dist/components/select-with-custom-input/classes.d.ts +17 -0
  274. package/dist/components/select-with-custom-input/html.d.ts +60 -0
  275. package/dist/components/select-with-custom-input/html.js +238 -0
  276. package/dist/components/select-with-custom-input/index.d.ts +114 -0
  277. package/dist/components/select-with-custom-input/react.d.ts +7 -0
  278. package/dist/components/{ui/select-with-custom-input.js → select-with-custom-input/react.js} +134 -29
  279. package/dist/components/select-with-custom-input/schema.d.ts +54 -0
  280. package/dist/components/sidebar-layout/classes.d.ts +21 -0
  281. package/dist/components/sidebar-layout/html.d.ts +97 -0
  282. package/dist/components/sidebar-layout/html.js +361 -0
  283. package/dist/components/sidebar-layout/index.d.ts +57 -0
  284. package/dist/components/sidebar-layout/react.d.ts +30 -0
  285. package/dist/components/{ui/sidebar-layout.js → sidebar-layout/react.js} +353 -39
  286. package/dist/components/sidebar-layout/schema.d.ts +54 -0
  287. package/dist/components/stats-card/classes.d.ts +11 -0
  288. package/dist/components/stats-card/html.d.ts +15 -0
  289. package/dist/components/stats-card/html.js +55 -0
  290. package/dist/components/stats-card/react.d.ts +7 -0
  291. package/dist/components/{ui/stats-card.js → stats-card/react.js} +19 -15
  292. package/dist/components/stats-card/schema.d.ts +14 -0
  293. package/dist/components/stepper/classes.d.ts +39 -0
  294. package/dist/components/stepper/html.d.ts +107 -0
  295. package/dist/components/stepper/html.js +397 -0
  296. package/dist/components/stepper/index.d.ts +83 -0
  297. package/dist/components/stepper/react.d.ts +17 -0
  298. package/dist/components/{ui/stepper.js → stepper/react.js} +120 -21
  299. package/dist/components/stepper/schema.d.ts +52 -0
  300. package/dist/components/support/classes.d.ts +55 -0
  301. package/dist/components/support/form.d.ts +19 -0
  302. package/dist/components/support/html.d.ts +266 -0
  303. package/dist/components/support/html.js +604 -0
  304. package/dist/components/support/index.d.ts +226 -0
  305. package/dist/components/support/multipart.d.ts +21 -0
  306. package/dist/components/support/react.d.ts +54 -0
  307. package/dist/components/support/react.js +1252 -0
  308. package/dist/components/support/schema.d.ts +69 -0
  309. package/dist/components/support.d.ts +1 -66
  310. package/dist/components/theme-switcher/html.d.ts +28 -0
  311. package/dist/components/theme-switcher/html.js +288 -0
  312. package/dist/components/theme-switcher/index.d.ts +59 -0
  313. package/dist/components/{ui/theme-switcher.d.ts → theme-switcher/react.d.ts} +4 -12
  314. package/dist/components/{ui/theme-switcher.js → theme-switcher/react.js} +69 -35
  315. package/dist/components/theme-switcher/schema.d.ts +33 -0
  316. package/dist/components/time-input/classes.d.ts +23 -0
  317. package/dist/components/time-input/html.d.ts +75 -0
  318. package/dist/components/time-input/html.js +571 -0
  319. package/dist/components/time-input/index.d.ts +164 -0
  320. package/dist/components/time-input/react.d.ts +7 -0
  321. package/dist/components/{ui/time-picker.js → time-input/react.js} +286 -114
  322. package/dist/components/time-input/schema.d.ts +96 -0
  323. package/dist/components/timezone-input/classes.d.ts +13 -0
  324. package/dist/components/timezone-input/html.d.ts +58 -0
  325. package/dist/components/timezone-input/html.js +804 -0
  326. package/dist/components/timezone-input/index.d.ts +170 -0
  327. package/dist/components/timezone-input/react.d.ts +9 -0
  328. package/dist/components/{ui/timezone-select.js → timezone-input/react.js} +493 -106
  329. package/dist/components/timezone-input/schema.d.ts +43 -0
  330. package/dist/components/toast/classes.d.ts +7 -0
  331. package/dist/components/toast/html.d.ts +34 -0
  332. package/dist/components/toast/html.js +280 -0
  333. package/dist/components/toast/index.d.ts +10 -0
  334. package/dist/components/toast/react.d.ts +9 -0
  335. package/dist/components/{ui/toast.js → toast/react.js} +35 -15
  336. package/dist/components/toast/schema.d.ts +24 -0
  337. package/dist/{services/events/client/tracking-notice.d.ts → components/tracking-notice/react.d.ts} +7 -1
  338. package/dist/{services/events/client/tracking-notice.js → components/tracking-notice/react.js} +13 -7
  339. package/dist/components/ui/animated-list.d.ts +1 -21
  340. package/dist/components/ui/app-brand.d.ts +1 -33
  341. package/dist/components/ui/async-action-button.d.ts +1 -17
  342. package/dist/components/ui/code-block.d.ts +1 -14
  343. package/dist/components/ui/copy-button.d.ts +1 -21
  344. package/dist/components/ui/data-table.d.ts +1 -584
  345. package/dist/components/ui/krakstack-provider.d.ts +1 -9
  346. package/dist/components/ui/loading.d.ts +1 -13
  347. package/dist/components/ui/pagination.d.ts +1 -47
  348. package/dist/components/ui/rich-text-editor.d.ts +1 -70
  349. package/dist/components/ui/search-menu.d.ts +1 -36
  350. package/dist/components/ui/select.js +159 -0
  351. package/dist/components/ui/sidebar-layout.d.ts +1 -40
  352. package/dist/components/ui/virtualized-combobox.d.ts +1 -59
  353. package/dist/components/unsaved-changes-guard/html.d.ts +34 -0
  354. package/dist/components/unsaved-changes-guard/html.js +172 -0
  355. package/dist/components/unsaved-changes-guard/index.d.ts +56 -0
  356. package/dist/components/unsaved-changes-guard/react.d.ts +4 -0
  357. package/dist/components/{ui/unsaved-changes-guard.js → unsaved-changes-guard/react.js} +74 -11
  358. package/dist/components/unsaved-changes-guard/schema.d.ts +37 -0
  359. package/dist/components/upload-attachment/classes.d.ts +11 -0
  360. package/dist/components/upload-attachment/html.d.ts +84 -0
  361. package/dist/components/upload-attachment/html.js +312 -0
  362. package/dist/components/upload-attachment/index.d.ts +72 -0
  363. package/dist/components/upload-attachment/react.d.ts +9 -0
  364. package/dist/components/{ui/upload-attachment.js → upload-attachment/react.js} +114 -17
  365. package/dist/components/upload-attachment/schema.d.ts +53 -0
  366. package/dist/components/virtualized-combobox/classes.d.ts +7 -0
  367. package/dist/components/virtualized-combobox/html.d.ts +97 -0
  368. package/dist/components/virtualized-combobox/html.js +310 -0
  369. package/dist/components/virtualized-combobox/index.d.ts +182 -0
  370. package/dist/components/virtualized-combobox/react.d.ts +31 -0
  371. package/dist/components/{ui/virtualized-combobox.js → virtualized-combobox/react.js} +160 -40
  372. package/dist/components/virtualized-combobox/schema.d.ts +92 -0
  373. package/dist/components/webhook-delivery-table/html.d.ts +216 -0
  374. package/dist/components/webhook-delivery-table/html.js +3008 -0
  375. package/dist/components/webhook-delivery-table/index.d.ts +405 -0
  376. package/dist/components/webhook-delivery-table/react.d.ts +13 -0
  377. package/dist/{services/webhooks/client/delivery-table.js → components/webhook-delivery-table/react.js} +2475 -956
  378. package/dist/components/webhook-delivery-table/schema.d.ts +134 -0
  379. package/dist/lib/docs.d.ts +17 -1
  380. package/dist/lib/docs.integrations.server.js +358 -73
  381. package/dist/lib/docs.js +861 -293
  382. package/dist/lib/docs.server.js +342 -57
  383. package/dist/lib/documentation-toolkit.d.ts +4 -4
  384. package/dist/lib/documentation-toolkit.js +354 -69
  385. package/dist/lib/effect-ui-adapter/model-runtime.d.ts +17 -0
  386. package/dist/lib/effect-ui-adapter/use-model.d.ts +9 -0
  387. package/dist/lib/effectcn-form.d.ts +3 -0
  388. package/dist/lib/effectcn-form.js +54 -0
  389. package/dist/lib/email-composer/index.d.ts +12 -0
  390. package/dist/lib/email-composer/index.js +110 -0
  391. package/dist/lib/email-composer/schema.d.ts +14 -0
  392. package/dist/lib/email-composer/schema.js +13 -0
  393. package/dist/lib/email-document/legacy-rich-text/editor.d.ts +70 -0
  394. package/dist/lib/email-document/legacy-rich-text/model.d.ts +19 -0
  395. package/dist/lib/email-document/legacy-rich-text/schema.d.ts +65 -0
  396. package/dist/lib/email-document/legacy-rich-text/tiptap.d.ts +39 -0
  397. package/dist/lib/email-document/model.d.ts +1 -1
  398. package/dist/lib/email-document/model.js +2 -2
  399. package/dist/lib/email-document/render.js +2 -2
  400. package/dist/lib/email-document/schema.js +1 -1
  401. package/dist/lib/httpapi-toolkit.d.ts +1 -1
  402. package/dist/lib/lucide-effect.d.ts +39 -0
  403. package/dist/lib/markdown/content.d.ts +1 -12
  404. package/dist/lib/rich-text/model.d.ts +5 -19
  405. package/dist/lib/rich-text/model.js +79 -111
  406. package/dist/lib/rich-text/schema.d.ts +5 -55
  407. package/dist/lib/rich-text/schema.js +17 -36
  408. package/dist/lib/rich-text/tiptap.d.ts +12 -0
  409. package/dist/lib/webfetch-toolkit.d.ts +1 -1
  410. package/dist/services/agent/client/index.js +695 -179
  411. package/dist/services/agent/client/widget.d.ts +1 -55
  412. package/dist/services/notification/client/index.js +138 -27
  413. package/dist/services/notification/client/notification-menu.d.ts +1 -85
  414. package/dist/services/notification/public.js +138 -27
  415. package/dist/services/opentelemetry/browser.js +15 -9
  416. package/dist/services/webhooks/index.d.ts +4 -3
  417. package/package.json +199 -137
  418. package/dist/components/support-dialog.js +0 -881
  419. package/dist/components/support.js +0 -881
  420. package/dist/components/ui/animated-list.js +0 -414
  421. package/dist/components/ui/animated-number.js +0 -75
  422. package/dist/components/ui/app-brand.js +0 -126
  423. package/dist/components/ui/app-switcher.d.ts +0 -26
  424. package/dist/components/ui/async-action-button.js +0 -149
  425. package/dist/components/ui/auto-height.js +0 -86
  426. package/dist/components/ui/bulk-list-input.d.ts +0 -25
  427. package/dist/components/ui/choice-cards.d.ts +0 -33
  428. package/dist/components/ui/code-block.js +0 -221
  429. package/dist/components/ui/color-picker.d.ts +0 -31
  430. package/dist/components/ui/copy-button.js +0 -138
  431. package/dist/components/ui/copy-value.d.ts +0 -24
  432. package/dist/components/ui/copy-value.js +0 -352
  433. package/dist/components/ui/cron-expression-editor.d.ts +0 -16
  434. package/dist/components/ui/cron-expression-editor.schema.d.ts +0 -7
  435. package/dist/components/ui/danger-confirmation.js +0 -398
  436. package/dist/components/ui/date-picker.d.ts +0 -33
  437. package/dist/components/ui/date-picker.schema.d.ts +0 -9
  438. package/dist/components/ui/editable-text.d.ts +0 -19
  439. package/dist/components/ui/editable-text.js +0 -341
  440. package/dist/components/ui/editing-locale-switcher.d.ts +0 -11
  441. package/dist/components/ui/error-component.d.ts +0 -34
  442. package/dist/components/ui/error-component.js +0 -387
  443. package/dist/components/ui/file-picker.d.ts +0 -37
  444. package/dist/components/ui/icon-input.d.ts +0 -58
  445. package/dist/components/ui/image-crop-editor.d.ts +0 -41
  446. package/dist/components/ui/image-crop-editor.js +0 -417
  447. package/dist/components/ui/loading.js +0 -39
  448. package/dist/components/ui/locale-switcher.d.ts +0 -11
  449. package/dist/components/ui/map-menu-map.d.ts +0 -115
  450. package/dist/components/ui/map-menu.d.ts +0 -87
  451. package/dist/components/ui/phone-number-input.d.ts +0 -22
  452. package/dist/components/ui/phone-number-input.schema.d.ts +0 -7
  453. package/dist/components/ui/presence-transition.js +0 -94
  454. package/dist/components/ui/rich-text-editor.js +0 -1135
  455. package/dist/components/ui/select-with-custom-input.d.ts +0 -36
  456. package/dist/components/ui/stats-card.d.ts +0 -12
  457. package/dist/components/ui/stepper.d.ts +0 -37
  458. package/dist/components/ui/time-picker.d.ts +0 -50
  459. package/dist/components/ui/time-picker.schema.d.ts +0 -28
  460. package/dist/components/ui/timezone-select.d.ts +0 -57
  461. package/dist/components/ui/timezone-select.schema.d.ts +0 -9
  462. package/dist/components/ui/toast.d.ts +0 -18
  463. package/dist/components/ui/unsaved-changes-guard.d.ts +0 -16
  464. package/dist/components/ui/upload-attachment.d.ts +0 -39
  465. package/dist/lib/rich-text/dom.d.ts +0 -40
  466. package/dist/services/notification/persistence/drizzle.d.ts +0 -868
  467. package/dist/services/notification/persistence/drizzle.js +0 -214
  468. package/dist/services/notification/persistence/index.d.ts +0 -2
  469. package/dist/services/notification/persistence/index.js +0 -227
  470. package/dist/services/notification/persistence/schema.d.ts +0 -143
  471. package/dist/services/notification/persistence/schema.js +0 -118
  472. package/dist/services/webhooks/client/delivery-table.d.ts +0 -62
package/dist/lib/docs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // ../../src/lib/docs.tsx
2
2
  import { createIsomorphicFn } from "@tanstack/react-start";
3
3
  import { getCookie } from "@tanstack/react-start/server";
4
- import { Option as Option2, Schema as Schema3 } from "effect";
4
+ import { Option as Option2, Schema as Schema8 } from "effect";
5
5
  import { Cookies as Cookies2 } from "effect/http";
6
6
  import {
7
7
  forwardRef,
@@ -10,130 +10,89 @@ import {
10
10
  useState as useState5
11
11
  } from "react";
12
12
 
13
- // ../../src/components/ui/app-brand.tsx
14
- import { Link } from "@tanstack/react-router";
15
-
16
13
  // ../../src/lib/utils.ts
17
14
  import { cn } from "cn";
18
15
 
19
- // ../../src/components/ui/app-brand.tsx
20
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
21
- var isStaticBrand = (props) => props.to === null;
22
- var isAnchorBrand = (props) => props.href !== undefined;
23
- function AppBrand(brandProps) {
24
- const {
25
- className,
26
- classNames,
16
+ // ../../src/components/app-brand/classes.ts
17
+ var appBrandClasses = ({ className, classNames, classes, variant }, hasImage) => {
18
+ const sidebar = variant === "sidebar";
19
+ return {
20
+ root: [
21
+ classes?.root ?? [
22
+ "flex min-w-0 items-center gap-2 text-foreground hover:text-foreground",
23
+ sidebar && "p-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0"
24
+ ].filter(Boolean).join(" "),
25
+ className
26
+ ].filter(Boolean).join(" "),
27
+ visual: cn(classes?.visual ?? cn("flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md", hasImage ? "bg-background border" : sidebar ? "bg-sidebar-primary" : "bg-primary"), classNames?.visual),
28
+ image: cn(classes?.image ?? "size-full object-cover", classNames?.image),
29
+ icon: cn(classes?.icon ?? "size-4", classNames?.icon),
30
+ iconColor: sidebar ? "var(--sidebar-primary-foreground)" : "var(--primary-foreground)",
31
+ content: cn(classes?.content ?? cn("flex min-w-0 flex-col leading-tight", sidebar && "group-data-[collapsible=icon]:hidden"), classNames?.content),
32
+ label: cn(classes?.label ?? "truncate font-semibold tracking-tight", classNames?.label),
33
+ subtitle: cn(classes?.subtitle ?? "text-muted-foreground truncate text-xs", classNames?.subtitle)
34
+ };
35
+ };
36
+
37
+ // ../../src/components/app-brand/react.tsx
38
+ import { jsx, jsxs } from "react/jsx-runtime";
39
+ function AppBrand({
40
+ label,
41
+ subtitle,
42
+ icon: Icon,
43
+ imageSrc,
44
+ className,
45
+ classNames,
46
+ classes: classOverrides,
47
+ variant,
48
+ ...props
49
+ }) {
50
+ const classes = appBrandClasses({
27
51
  label,
28
52
  subtitle,
29
- icon: Icon,
30
- imageSrc,
31
- variant = "default"
32
- } = brandProps;
33
- const iconClassName = variant === "sidebar" ? "bg-sidebar-primary" : "bg-primary";
34
- const iconColor = variant === "sidebar" ? "var(--sidebar-primary-foreground)" : "var(--primary-foreground)";
35
- const contentClassName = variant === "sidebar" ? "group-data-[collapsible=icon]:hidden" : undefined;
36
- const content = /* @__PURE__ */ jsxs(Fragment, {
53
+ className,
54
+ classNames,
55
+ classes: classOverrides,
56
+ variant
57
+ }, Boolean(imageSrc));
58
+ return /* @__PURE__ */ jsxs("div", {
59
+ "data-slot": "app-brand",
60
+ className: classes.root,
61
+ ...props,
37
62
  children: [
38
63
  /* @__PURE__ */ jsx("div", {
39
64
  "data-slot": "app-brand-visual",
40
- className: cn("flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-md", imageSrc ? "bg-background border" : iconClassName, classNames?.visual),
65
+ className: classes.visual,
41
66
  children: imageSrc ? /* @__PURE__ */ jsx("img", {
42
67
  "data-slot": "app-brand-image",
43
68
  src: imageSrc,
44
69
  alt: label,
45
- className: cn("size-full object-cover", classNames?.image)
70
+ className: classes.image
46
71
  }) : Icon ? /* @__PURE__ */ jsx(Icon, {
47
72
  "data-slot": "app-brand-icon",
48
- className: cn("size-4", classNames?.icon),
49
- color: iconColor
73
+ className: classes.icon,
74
+ color: classes.iconColor
50
75
  }) : null
51
76
  }),
52
77
  /* @__PURE__ */ jsxs("div", {
53
78
  "data-slot": "app-brand-content",
54
- className: cn("flex min-w-0 flex-col leading-tight", contentClassName, classNames?.content),
79
+ className: classes.content,
55
80
  children: [
56
81
  /* @__PURE__ */ jsx("span", {
57
82
  "data-slot": "app-brand-label",
58
- className: cn("truncate font-semibold tracking-tight", classNames?.label),
83
+ className: classes.label,
59
84
  children: label
60
85
  }),
61
86
  subtitle ? /* @__PURE__ */ jsx("span", {
62
87
  "data-slot": "app-brand-subtitle",
63
- className: cn("text-muted-foreground truncate text-xs", classNames?.subtitle),
88
+ className: classes.subtitle,
64
89
  children: subtitle
65
90
  }) : null
66
91
  ]
67
92
  })
68
93
  ]
69
94
  });
70
- const brandClassName = [
71
- "flex min-w-0 items-center gap-2 text-foreground hover:text-foreground",
72
- variant === "sidebar" ? "p-2 group-data-[collapsible=icon]:justify-center group-data-[collapsible=icon]:p-0" : "",
73
- className
74
- ].filter(Boolean).join(" ");
75
- if (isStaticBrand(brandProps)) {
76
- const {
77
- className: _className,
78
- classNames: _classNames,
79
- label: _label,
80
- subtitle: _subtitle,
81
- icon: _icon,
82
- imageSrc: _imageSrc,
83
- variant: _variant,
84
- to: _to,
85
- href: _href,
86
- ...props
87
- } = brandProps;
88
- return /* @__PURE__ */ jsx("div", {
89
- "data-slot": "app-brand",
90
- className: brandClassName,
91
- ...props,
92
- children: content
93
- });
94
- }
95
- if (isAnchorBrand(brandProps)) {
96
- const {
97
- className: _className,
98
- classNames: _classNames,
99
- label: _label,
100
- subtitle: _subtitle,
101
- icon: _icon,
102
- imageSrc: _imageSrc,
103
- variant: _variant,
104
- to: _to,
105
- href,
106
- ...props
107
- } = brandProps;
108
- return /* @__PURE__ */ jsx("a", {
109
- "data-slot": "app-brand",
110
- className: brandClassName,
111
- href,
112
- ...props,
113
- children: content
114
- });
115
- }
116
- const {
117
- className: _className,
118
- classNames: _classNames,
119
- label: _label,
120
- subtitle: _subtitle,
121
- icon: _icon,
122
- imageSrc: _imageSrc,
123
- variant: _variant,
124
- href: _href,
125
- to,
126
- ...props
127
- } = brandProps;
128
- return /* @__PURE__ */ jsx(Link, {
129
- "data-slot": "app-brand",
130
- to: to ?? "/",
131
- className: brandClassName,
132
- ...props,
133
- children: content
134
- });
135
95
  }
136
-
137
96
  // ../../src/components/ui/badge.tsx
138
97
  import { mergeProps } from "@base-ui/react/merge-props";
139
98
  import { useRender } from "@base-ui/react/use-render";
@@ -215,20 +174,265 @@ function Button({
215
174
  });
216
175
  }
217
176
 
218
- // ../../src/components/ui/copy-button.tsx
177
+ // ../../src/components/copy-button/react.tsx
219
178
  import { Check, Copy, TriangleAlert } from "lucide-react";
220
- import { useEffect, useRef, useState } from "react";
221
- import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider";
222
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
223
- var messages = {
179
+ import { Redacted as Redacted2 } from "effect";
180
+ import { Component as Component2 } from "effect/ui";
181
+ import { useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState2 } from "react";
182
+ import { useKrakstackLocale } from "@krak-stack/registry/krakstack-provider/react";
183
+
184
+ // ../../src/lib/effect-ui-adapter/use-model.ts
185
+ import { MessageLog as MessageLog2 } from "effect/ui";
186
+ import {
187
+ createContext,
188
+ useCallback,
189
+ useContext,
190
+ useEffect,
191
+ useLayoutEffect,
192
+ useRef,
193
+ useState,
194
+ useSyncExternalStore
195
+ } from "react";
196
+
197
+ // ../../src/lib/effect-ui-adapter/model-runtime.ts
198
+ import { MessageLog, Renderer, View } from "effect/ui";
199
+ import { BrowserHost, Html } from "effect/ui/html";
200
+ import { Cause, Effect, Fiber } from "effect";
201
+ var node = () => ({ children: [] });
202
+ var modelHost = (commit) => {
203
+ const remove = (child) => {
204
+ if (!child.parent)
205
+ return;
206
+ child.parent.children.splice(child.parent.children.indexOf(child), 1);
207
+ delete child.parent;
208
+ };
209
+ return {
210
+ createElement: node,
211
+ createText: node,
212
+ setText: () => {},
213
+ setAttr: () => {},
214
+ setProp: () => {},
215
+ setEvents: () => {},
216
+ insertBefore: (parent, child, before) => {
217
+ if (child === before)
218
+ return;
219
+ remove(child);
220
+ const index = before ? parent.children.indexOf(before) : parent.children.length;
221
+ parent.children.splice(index, 0, child);
222
+ child.parent = parent;
223
+ },
224
+ remove,
225
+ parentOf: (child) => child.parent,
226
+ nextOf: (child) => child.parent?.children[child.parent.children.indexOf(child) + 1],
227
+ elements: ["html"],
228
+ controlled: new Set,
229
+ runsMounts: false,
230
+ commit
231
+ };
232
+ };
233
+ var mountModel = (component, props, publishSnapshot, messageLog, onEmit) => {
234
+ let currentProps = props;
235
+ let root;
236
+ let active = true;
237
+ let failure;
238
+ const publish = () => {
239
+ if (!active)
240
+ return;
241
+ if (failure) {
242
+ publishSnapshot({ error: failure });
243
+ return;
244
+ }
245
+ const current = root?.model();
246
+ if (current !== undefined)
247
+ publishSnapshot({ model: current });
248
+ };
249
+ const fiber = Effect.runFork(Effect.scoped(Effect.gen(function* () {
250
+ const mounted = yield* Renderer.mount(component, Effect.succeed(props), node(), {
251
+ head: false,
252
+ onEmit,
253
+ fallback: ({ cause }) => {
254
+ failure = new Error("Effect UI root failed", {
255
+ cause: Cause.squash(cause)
256
+ });
257
+ return View.text("");
258
+ }
259
+ });
260
+ if (!active)
261
+ return;
262
+ root = mounted;
263
+ if (props !== currentProps)
264
+ mounted.setProps(currentProps);
265
+ publish();
266
+ return yield* Effect.never;
267
+ }).pipe(Effect.provide(Renderer.layer(modelHost(publish))), Effect.provideService(Html.Host, BrowserHost.htmlHost), Effect.provideService(MessageLog.MessageLog, messageLog))));
268
+ return {
269
+ send: (message) => {
270
+ root?.send(message);
271
+ publish();
272
+ },
273
+ setProps: (next) => {
274
+ currentProps = next;
275
+ root?.setProps(next);
276
+ },
277
+ dispose: () => {
278
+ active = false;
279
+ root = undefined;
280
+ Effect.runFork(Fiber.interrupt(fiber));
281
+ }
282
+ };
283
+ };
284
+
285
+ // ../../src/lib/effect-ui-adapter/use-model.ts
286
+ "use client";
287
+ var ModelMessageLogContext = createContext(undefined);
288
+ var useModel = (component, props, options = {}) => {
289
+ const contextLog = useContext(ModelMessageLogContext);
290
+ const messageLog = options.messageLog ?? (contextLog === undefined ? MessageLog2.noop : contextLog);
291
+ const [store] = useState(() => {
292
+ const initial = { model: component.init(props).model };
293
+ let snapshot = initial;
294
+ const listeners = new Set;
295
+ return {
296
+ subscribe: (listener) => {
297
+ listeners.add(listener);
298
+ return () => {
299
+ listeners.delete(listener);
300
+ };
301
+ },
302
+ getSnapshot: () => snapshot,
303
+ getServerSnapshot: () => initial,
304
+ publish: (next) => {
305
+ if ("model" in snapshot && "model" in next && Object.is(snapshot.model, next.model))
306
+ return;
307
+ if ("error" in snapshot && "error" in next && snapshot.error === next.error)
308
+ return;
309
+ snapshot = next;
310
+ listeners.forEach((listener) => listener());
311
+ }
312
+ };
313
+ });
314
+ const snapshot = useSyncExternalStore(store.subscribe, store.getSnapshot, store.getServerSnapshot);
315
+ const committed = useRef(props);
316
+ const onEmit = useRef(options.onEmit);
317
+ const runtime = useRef(undefined);
318
+ const send = useCallback((message) => runtime.current?.send(message), []);
319
+ useLayoutEffect(() => {
320
+ onEmit.current = options.onEmit;
321
+ committed.current = props;
322
+ runtime.current?.setProps(props);
323
+ }, [props, options.onEmit]);
324
+ useEffect(() => {
325
+ if (messageLog === null)
326
+ return;
327
+ const mounted = mountModel(component, committed.current, store.publish, messageLog, (event) => onEmit.current?.(event));
328
+ runtime.current = mounted;
329
+ return () => {
330
+ runtime.current = undefined;
331
+ mounted.dispose();
332
+ };
333
+ }, [component, messageLog, store]);
334
+ if ("error" in snapshot)
335
+ throw snapshot.error;
336
+ return { model: snapshot.model, send };
337
+ };
338
+
339
+ // ../../src/components/copy-button/index.ts
340
+ import { Effect as Effect2, Redacted, Schema as Schema2 } from "effect";
341
+ import { Command, Component, UiSchema, View as View2 } from "effect/ui";
342
+
343
+ // ../../src/components/copy-button/schema.ts
344
+ import { Schema } from "effect";
345
+ var MessageOverrides = Schema.Struct({
346
+ copy: Schema.optional(Schema.String),
347
+ copied: Schema.optional(Schema.String),
348
+ copyFailed: Schema.optional(Schema.String)
349
+ }).annotate({ identifier: "CopyButtonMessageOverrides" });
350
+ var CopyButtonTranslations = Schema.Record(Schema.String, Schema.UndefinedOr(MessageOverrides));
351
+ var copyButtonVariants = [
352
+ "default",
353
+ "secondary",
354
+ "outline",
355
+ "ghost",
356
+ "destructive",
357
+ "link"
358
+ ];
359
+ var CopyButtonModelProps = Schema.Struct({
360
+ value: Schema.Redacted(Schema.String, { disallowJsonEncode: true }),
361
+ disabled: Schema.optional(Schema.Boolean),
362
+ resetDelay: Schema.optional(Schema.Finite)
363
+ }).annotate({ identifier: "CopyButtonModelProps" });
364
+ var copyButtonSharedProps = Schema.Struct({
365
+ ...CopyButtonModelProps.fields,
366
+ valueDescription: Schema.optional(Schema.String),
367
+ copyVariant: Schema.optional(Schema.Literals(["default", "sm", "large"])),
368
+ variant: Schema.optional(Schema.Literals(copyButtonVariants)),
369
+ locale: Schema.optional(Schema.String),
370
+ messages: Schema.optional(CopyButtonTranslations)
371
+ }).annotate({ identifier: "CopyButtonSharedProps" });
372
+
373
+ // ../../src/components/copy-button/index.ts
374
+ var labels = {
224
375
  en: { copy: "Copy", copied: "Copied", copyFailed: "Copy failed" },
225
376
  fr: { copy: "Copier", copied: "Copié", copyFailed: "Échec de la copie" }
226
377
  };
227
378
  var copyButtonMessages = (locale = "en", translations) => ({
228
- ...locale.startsWith("fr") ? messages.fr : messages.en,
379
+ ...locale.startsWith("fr") ? labels.fr : labels.en,
229
380
  ...translations?.[locale.split("-")[0] ?? locale],
230
381
  ...translations?.[locale]
231
382
  });
383
+ var copyButtonLabel = (copy, description) => description ? `${copy} ${description}` : copy;
384
+ var CopyButtonMessage = UiSchema.TaggedEnum({
385
+ Pressed: {},
386
+ Finished: { success: Schema2.Boolean },
387
+ Reset: {}
388
+ }).annotate({ identifier: "CopyButtonMessage" });
389
+
390
+ class WriteClipboard extends Command.Service()("copy-button/WriteClipboard", {
391
+ args: {
392
+ value: Schema2.Redacted(Schema2.String, { disallowJsonEncode: true })
393
+ },
394
+ success: CopyButtonMessage
395
+ }) {
396
+ static layerFromWrite = (write) => WriteClipboard.toLayer(({ value }) => Effect2.tryPromise(() => write(Redacted.value(value))).pipe(Effect2.match({
397
+ onSuccess: () => CopyButtonMessage.Finished({ success: true }),
398
+ onFailure: () => CopyButtonMessage.Finished({ success: false })
399
+ })));
400
+ static browser = WriteClipboard.layerFromWrite((value) => navigator.clipboard.writeText(value));
401
+ }
402
+ var ResetClipboardFeedback = Command.make("copy-button/ResetFeedback", { args: { delay: Schema2.Number }, mode: "switch" }, ({ delay }) => Effect2.sleep(Math.max(0, delay)).pipe(Effect2.as(CopyButtonMessage.Reset())));
403
+ var copyButtonOptions = {
404
+ name: "CopyButton",
405
+ props: CopyButtonModelProps,
406
+ model: Schema2.Struct({
407
+ status: Schema2.Literals(["idle", "copied", "failed"])
408
+ }).annotate({ identifier: "CopyButtonModel" }),
409
+ message: CopyButtonMessage,
410
+ restore: false
411
+ };
412
+ var Definition = Component.define(copyButtonOptions);
413
+ var update = Definition.update({
414
+ Pressed: ($) => $.props.disabled ? $.model : $.run(WriteClipboard.make({ value: $.props.value })),
415
+ Finished: ($, { success }) => $.evolve({ status: success ? "copied" : "failed" }).run(ResetClipboardFeedback.make({ delay: $.props.resetDelay ?? 1500 })),
416
+ Reset: ($) => $.evolve({ status: "idle" })
417
+ });
418
+ var copyButtonBehaviours = {
419
+ init: () => ({ status: "idle" }),
420
+ update
421
+ };
422
+ var CopyButtonModel = Definition.make({
423
+ ...copyButtonBehaviours,
424
+ view: () => View2.text("")
425
+ });
426
+ var copyButtonStatus = (status, copy, description) => {
427
+ if (status === "idle")
428
+ return "";
429
+ const text = status === "copied" ? copy.copied : copy.copyFailed;
430
+ return description ? `${text}: ${description}` : text;
431
+ };
432
+
433
+ // ../../src/components/copy-button/react.tsx
434
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
435
+ "use client";
232
436
  function CopyButton({
233
437
  value,
234
438
  valueDescription,
@@ -244,39 +448,44 @@ function CopyButton({
244
448
  ...props
245
449
  }) {
246
450
  const locale = useKrakstackLocale(localeOverride);
247
- const [copyState, setCopyState] = useState("idle");
248
- const copyTimeout = useRef(undefined);
249
451
  const labels = copyButtonMessages(locale, messages);
250
- const accessibleLabel = ariaLabel ?? (valueDescription ? `${labels.copy} ${valueDescription}` : labels.copy);
251
- const isLarge = copyVariant === "large";
252
- const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
253
- useEffect(() => {
254
- return () => {
255
- if (copyTimeout.current)
256
- clearTimeout(copyTimeout.current);
452
+ const callbacks = useRef2({
453
+ onCopied,
454
+ onCopyError,
455
+ failureLabel: labels.copyFailed
456
+ });
457
+ useLayoutEffect2(() => {
458
+ callbacks.current = {
459
+ onCopied,
460
+ onCopyError,
461
+ failureLabel: labels.copyFailed
257
462
  };
258
- }, []);
259
- const resetCopyState = () => {
260
- if (copyTimeout.current)
261
- clearTimeout(copyTimeout.current);
262
- copyTimeout.current = setTimeout(() => setCopyState("idle"), resetDelay);
263
- };
264
- const copy = async () => {
463
+ }, [onCopied, onCopyError, labels.copyFailed]);
464
+ const [component] = useState2(() => CopyButtonModel.pipe(Component2.provide(WriteClipboard.layerFromWrite(async (text) => {
465
+ const { onCopied, onCopyError, failureLabel } = callbacks.current;
265
466
  try {
266
- await navigator.clipboard.writeText(value);
267
- setCopyState("copied");
467
+ await navigator.clipboard.writeText(text);
268
468
  onCopied?.();
269
- } catch (error) {
270
- setCopyState("failed");
271
- onCopyError?.(error instanceof Error ? error : new Error(labels.copyFailed, { cause: error }));
469
+ } catch (cause) {
470
+ onCopyError?.(cause instanceof Error ? cause : new Error(failureLabel, { cause }));
471
+ throw cause;
272
472
  }
273
- resetCopyState();
274
- };
275
- const status = copyState === "copied" ? valueDescription ? `${labels.copied}: ${valueDescription}` : labels.copied : copyState === "failed" ? valueDescription ? `${labels.copyFailed}: ${valueDescription}` : labels.copyFailed : "";
473
+ }))));
474
+ const {
475
+ model: { status },
476
+ send
477
+ } = useModel(component, {
478
+ value: Redacted2.make(value),
479
+ disabled: disabled ?? false,
480
+ resetDelay
481
+ });
482
+ const accessibleLabel = ariaLabel ?? copyButtonLabel(labels.copy, valueDescription);
483
+ const isLarge = copyVariant === "large";
484
+ const defaultSize = copyVariant === "sm" ? "icon-xs" : isLarge ? "sm" : "icon-sm";
276
485
  return /* @__PURE__ */ jsxs2(Button, {
277
486
  "aria-label": accessibleLabel,
278
487
  disabled,
279
- onClick: copy,
488
+ onClick: () => send(CopyButtonMessage.Pressed()),
280
489
  size: size ?? defaultSize,
281
490
  ...props,
282
491
  children: [
@@ -284,15 +493,15 @@ function CopyButton({
284
493
  "aria-live": "polite",
285
494
  className: "sr-only",
286
495
  role: "status",
287
- children: status
496
+ children: copyButtonStatus(status, labels, valueDescription)
288
497
  }),
289
- copyState === "copied" ? /* @__PURE__ */ jsx3(Check, {
498
+ status === "copied" ? /* @__PURE__ */ jsx3(Check, {
290
499
  "aria-hidden": "true"
291
500
  }) : null,
292
- copyState === "failed" ? /* @__PURE__ */ jsx3(TriangleAlert, {
501
+ status === "failed" ? /* @__PURE__ */ jsx3(TriangleAlert, {
293
502
  "aria-hidden": "true"
294
503
  }) : null,
295
- copyState === "idle" ? /* @__PURE__ */ jsx3(Copy, {
504
+ status === "idle" ? /* @__PURE__ */ jsx3(Copy, {
296
505
  "aria-hidden": "true"
297
506
  }) : null,
298
507
  isLarge ? /* @__PURE__ */ jsx3("span", {
@@ -302,14 +511,30 @@ function CopyButton({
302
511
  });
303
512
  }
304
513
 
305
- // ../../src/components/ui/code-block.tsx
514
+ // ../../src/components/ui/copy-button.tsx
515
+ "use client";
516
+
517
+ // ../../src/components/code-block/react.tsx
306
518
  import { highlight } from "@tanstack/highlight";
519
+ import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider/react";
520
+
521
+ // ../../src/components/code-block/classes.ts
522
+ var codeBlockClasses = {
523
+ root: "not-prose bg-muted overflow-hidden rounded-md border text-[var(--th-token)]",
524
+ header: "bg-background border-border/60 flex items-center justify-between border-b px-3 py-2",
525
+ language: "text-muted-foreground font-mono text-xs",
526
+ viewport: "max-h-full overflow-auto font-mono text-[0.875rem] leading-[1.625]"
527
+ };
528
+ var resolveCodeBlockClasses = (overrides) => ({
529
+ ...codeBlockClasses,
530
+ ...overrides
531
+ });
532
+
533
+ // ../../src/components/code-block/index.ts
307
534
  import { createThemeCss } from "@tanstack/highlight/theme";
308
535
  import { githubDarkTheme } from "@tanstack/highlight/themes/github-dark";
309
536
  import { githubLightTheme } from "@tanstack/highlight/themes/github-light";
310
- import { useKrakstackLocale as useKrakstackLocale2 } from "@krak-stack/registry/krakstack-provider";
311
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
312
- var themeCss = `${createThemeCss({
537
+ var codeThemeCss = `${createThemeCss({
313
538
  light: githubLightTheme,
314
539
  dark: githubDarkTheme,
315
540
  lightSelector: "[data-code-theme]",
@@ -325,7 +550,7 @@ var themeCss = `${createThemeCss({
325
550
  color: inherit;
326
551
  }
327
552
  [data-code-theme] pre.th-code code { font: inherit; }`;
328
- var messages2 = {
553
+ var messages = {
329
554
  en: {
330
555
  codeDescription: (language) => `${language} code`,
331
556
  copy: "Copy",
@@ -340,54 +565,82 @@ var messages2 = {
340
565
  }
341
566
  };
342
567
  var codeBlockMessages = (locale = "en", translations) => ({
343
- ...locale.startsWith("fr") ? messages2.fr : messages2.en,
568
+ ...locale.startsWith("fr") ? messages.fr : messages.en,
344
569
  ...translations?.[locale.split("-")[0] ?? locale],
345
570
  ...translations?.[locale]
346
571
  });
572
+ var codeLanguage = (language = "text") => language.toLowerCase() || "text";
573
+
574
+ // ../../src/components/code-block/react.tsx
575
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
347
576
  function CodeBlock({
577
+ classes: classOverrides,
348
578
  code,
349
579
  language = "text",
350
580
  locale: localeOverride,
351
581
  messages
352
582
  }) {
583
+ const codeBlockClasses = resolveCodeBlockClasses(classOverrides);
353
584
  const locale = useKrakstackLocale2(localeOverride);
354
- const normalizedLanguage = language.toLowerCase() || "text";
585
+ const normalizedLanguage = codeLanguage(language);
355
586
  const highlighted = highlight(code, { lang: normalizedLanguage });
356
587
  const labels = codeBlockMessages(locale, messages);
357
588
  return /* @__PURE__ */ jsxs3("div", {
358
- className: "not-prose bg-muted overflow-hidden rounded-md border text-[var(--th-token)]",
589
+ className: codeBlockClasses.root,
359
590
  "data-code-theme": true,
360
591
  children: [
361
592
  /* @__PURE__ */ jsx4("style", {
362
- children: themeCss
593
+ children: codeThemeCss
363
594
  }),
364
595
  /* @__PURE__ */ jsxs3("div", {
365
- className: "bg-background border-border/60 flex items-center justify-between border-b px-3 py-2",
596
+ className: codeBlockClasses.header,
366
597
  children: [
367
598
  /* @__PURE__ */ jsx4("span", {
368
- className: "text-muted-foreground font-mono text-xs",
599
+ className: codeBlockClasses.language,
369
600
  children: highlighted.lang
370
601
  }),
371
602
  /* @__PURE__ */ jsx4(CopyButton, {
372
603
  value: code,
373
604
  valueDescription: labels.codeDescription(highlighted.lang),
374
- variant: "secondary",
605
+ variant: "ghost",
375
606
  locale,
376
607
  messages: { [locale]: labels }
377
608
  })
378
609
  ]
379
610
  }),
380
611
  /* @__PURE__ */ jsx4("div", {
381
- className: "max-h-full overflow-auto font-mono text-[0.875rem] leading-[1.625]",
612
+ className: codeBlockClasses.viewport,
382
613
  dangerouslySetInnerHTML: { __html: highlighted.html }
383
614
  })
384
615
  ]
385
616
  });
386
617
  }
618
+ // ../../src/components/markdown/classes.ts
619
+ var markdownClass = "[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_[data-markdown-table]]:overflow-x-auto [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5 [&_li]:my-1 [&_li>ol]:my-2 [&_li>p]:my-2 [&_li>ul]:my-2 [&_ol]:list-decimal [&_ol]:ps-6 [&_ul]:list-disc [&_ul]:ps-6";
620
+
621
+ // ../../src/components/markdown/index.ts
622
+ var markdownSegments = ({
623
+ html,
624
+ codeBlocks
625
+ }) => {
626
+ let remainingHtml = html;
627
+ const segments = [];
628
+ codeBlocks.forEach((block, index) => {
629
+ const marker = `<markdown-code-block data-index="${index}"></markdown-code-block>`;
630
+ const at = remainingHtml.indexOf(marker);
631
+ if (at === -1)
632
+ return;
633
+ segments.push({ html: remainingHtml.slice(0, at), index, block });
634
+ remainingHtml = remainingHtml.slice(at + marker.length);
635
+ });
636
+ segments.push({ html: remainingHtml, index: codeBlocks.length });
637
+ return segments;
638
+ };
387
639
 
388
- // ../../src/lib/markdown/content.tsx
640
+ // ../../src/components/markdown/react.tsx
389
641
  import { jsx as jsx5 } from "react/jsx-runtime";
390
642
  var MarkdownContent = ({
643
+ classes,
391
644
  className,
392
645
  codeBlocks,
393
646
  html,
@@ -395,36 +648,27 @@ var MarkdownContent = ({
395
648
  messages
396
649
  }) => {
397
650
  const content = [];
398
- let remainingHtml = html;
399
- codeBlocks.forEach((block, index) => {
400
- const marker = `<markdown-code-block data-index="${index}"></markdown-code-block>`;
401
- const markerIndex = remainingHtml.indexOf(marker);
402
- if (markerIndex === -1)
403
- return;
651
+ for (const segment of markdownSegments({ html, codeBlocks })) {
652
+ const { block, index } = segment;
404
653
  content.push(/* @__PURE__ */ jsx5("div", {
405
- dangerouslySetInnerHTML: {
406
- __html: remainingHtml.slice(0, markerIndex)
407
- }
408
- }, `html-${index}`), /* @__PURE__ */ jsx5("div", {
409
- className: "my-5",
410
- children: /* @__PURE__ */ jsx5(CodeBlock, {
411
- code: block.code,
412
- language: block.language,
413
- locale,
414
- messages
415
- })
416
- }, `code-${index}`));
417
- remainingHtml = remainingHtml.slice(markerIndex + marker.length);
418
- });
419
- content.push(/* @__PURE__ */ jsx5("div", {
420
- dangerouslySetInnerHTML: { __html: remainingHtml }
421
- }, "html-final"));
654
+ dangerouslySetInnerHTML: { __html: segment.html }
655
+ }, `html-${index}`));
656
+ if (block)
657
+ content.push(/* @__PURE__ */ jsx5("div", {
658
+ className: "my-5",
659
+ children: /* @__PURE__ */ jsx5(CodeBlock, {
660
+ code: block.code,
661
+ language: block.language,
662
+ locale,
663
+ messages
664
+ })
665
+ }, `code-${index}`));
666
+ }
422
667
  return /* @__PURE__ */ jsx5("div", {
423
- className: cn("[&_a:hover]:text-primary [&_a]:decoration-border [&_blockquote]:border-primary/40 [&_blockquote]:bg-muted/40 [&_h2_a]:text-muted-foreground [&_h3_a]:text-muted-foreground [&_[data-inline-code]]:bg-muted text-[0.98rem] leading-7 [&_[data-markdown-table]]:overflow-x-auto [&_[data-inline-code]]:rounded [&_[data-inline-code]]:px-1.5 [&_[data-inline-code]]:py-0.5 [&_[data-inline-code]]:font-mono [&_[data-inline-code]]:text-[0.875em] [&_a]:font-medium [&_a]:underline [&_a]:decoration-1 [&_a]:underline-offset-4 [&_a]:transition-colors [&_blockquote]:my-5 [&_blockquote]:rounded-r-lg [&_blockquote]:border-l-4 [&_blockquote]:px-5 [&_blockquote]:py-1 [&_h2]:mt-12 [&_h2]:scroll-mt-20 [&_h2]:border-t [&_h2]:pt-8 [&_h2]:text-2xl [&_h2]:font-bold [&_h2]:tracking-tight [&_h2_a]:ml-2 [&_h2_a]:no-underline [&_h2:first-of-type]:mt-0 [&_h2:first-of-type]:border-t-0 [&_h2:first-of-type]:pt-0 [&_h3]:mt-8 [&_h3]:scroll-mt-20 [&_h3]:text-xl [&_h3]:font-semibold [&_h3]:tracking-tight [&_h3_a]:ml-2 [&_h3_a]:no-underline [&_ol]:my-5 [&_p]:my-5 [&_table]:w-full [&_table]:text-sm [&_td]:border-b [&_td]:p-2 [&_th]:border-b [&_th]:p-2 [&_th]:text-left [&_ul]:my-5", "[&_li]:my-1 [&_li>ol]:my-2 [&_li>p]:my-2 [&_li>ul]:my-2 [&_ol]:list-decimal [&_ol]:ps-6 [&_ul]:list-disc [&_ul]:ps-6", className),
668
+ className: cn(classes?.root ?? markdownClass, className),
424
669
  children: content
425
670
  });
426
671
  };
427
-
428
672
  // ../../src/components/ui/collapsible.tsx
429
673
  import { Collapsible as CollapsiblePrimitive } from "@base-ui/react/collapsible";
430
674
  import { jsx as jsx6 } from "react/jsx-runtime";
@@ -447,9 +691,9 @@ function CollapsibleContent({ ...props }) {
447
691
  });
448
692
  }
449
693
 
450
- // ../../src/components/ui/search-menu.tsx
694
+ // ../../src/components/search-menu/react.tsx
451
695
  import { SearchIcon as SearchIcon2, XIcon as XIcon2 } from "lucide-react";
452
- import { useCallback, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
696
+ import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef3, useState as useState3 } from "react";
453
697
 
454
698
  // ../../src/components/ui/command.tsx
455
699
  import { Command as CommandPrimitive } from "cmdk";
@@ -544,7 +788,7 @@ function DialogDescription({
544
788
 
545
789
  // ../../src/components/ui/command.tsx
546
790
  import { jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
547
- function Command({
791
+ function Command2({
548
792
  className,
549
793
  ...props
550
794
  }) {
@@ -655,10 +899,69 @@ function CommandShortcut({
655
899
  });
656
900
  }
657
901
 
658
- // ../../src/components/ui/search-menu.tsx
659
- import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider";
660
- import { jsx as jsx9, jsxs as jsxs6, Fragment as Fragment2 } from "react/jsx-runtime";
661
- var messages3 = {
902
+ // ../../src/components/search-menu/react.tsx
903
+ import { useKrakstackLocale as useKrakstackLocale3 } from "@krak-stack/registry/krakstack-provider/react";
904
+ import { Component as Component4, View as View3 } from "effect/ui";
905
+
906
+ // ../../src/components/search-menu/classes.ts
907
+ var searchMenuClasses = {
908
+ resultTitle: "truncate font-medium",
909
+ resultDescription: "text-muted-foreground truncate text-xs"
910
+ };
911
+ var resolveSearchMenuClasses = (overrides) => ({
912
+ ...searchMenuClasses,
913
+ ...overrides
914
+ });
915
+
916
+ // ../../src/components/search-menu/index.ts
917
+ import { Schema as Schema4 } from "effect";
918
+ import { Component as Component3, UiSchema as UiSchema2 } from "effect/ui";
919
+
920
+ // ../../src/components/search-menu/schema.ts
921
+ import { Schema as Schema3, Struct } from "effect";
922
+ var text = Schema3.optional(Schema3.String);
923
+ var Messages = Schema3.Struct({
924
+ title: text,
925
+ description: text,
926
+ placeholder: text,
927
+ inputPlaceholder: text,
928
+ emptyMessage: text,
929
+ clearSearch: text
930
+ });
931
+ var Translations = Schema3.Record(Schema3.String, Schema3.UndefinedOr(Messages));
932
+ var SearchMenuItemSchema = Schema3.Struct({
933
+ id: Schema3.String,
934
+ label: Schema3.String,
935
+ description: text,
936
+ keywords: Schema3.optional(Schema3.Array(Schema3.String)),
937
+ shortcut: text,
938
+ disabled: Schema3.optional(Schema3.Boolean)
939
+ }).annotate({ identifier: "SearchMenuItem" });
940
+ var Group = Schema3.Struct({
941
+ heading: Schema3.String,
942
+ items: Schema3.Array(SearchMenuItemSchema)
943
+ });
944
+ var SearchMenuClassesOverridesSchema = Schema3.Record(Schema3.Literals(Struct.keys(searchMenuClasses)), Schema3.optionalKey(Schema3.String)).annotate({ identifier: "SearchMenuClassesOverrides" });
945
+ var SearchMenuPropsSchema = Schema3.Struct({
946
+ classes: Schema3.optional(SearchMenuClassesOverridesSchema),
947
+ title: text,
948
+ description: text,
949
+ placeholder: text,
950
+ inputPlaceholder: text,
951
+ emptyMessage: text,
952
+ groups: Schema3.Array(Group),
953
+ locale: text,
954
+ messages: Schema3.optional(Translations),
955
+ shortcutLabel: text,
956
+ className: text,
957
+ query: text,
958
+ enableShortcut: Schema3.optional(Schema3.Boolean),
959
+ open: Schema3.optional(Schema3.Boolean),
960
+ shouldFilter: Schema3.optional(Schema3.Boolean)
961
+ }).annotate({ identifier: "SearchMenuProps" });
962
+
963
+ // ../../src/components/search-menu/index.ts
964
+ var defaults = {
662
965
  en: {
663
966
  title: "Search",
664
967
  description: "Search for an item to open.",
@@ -676,12 +979,55 @@ var messages3 = {
676
979
  clearSearch: "Effacer la recherche"
677
980
  }
678
981
  };
679
- var searchMenuMessages = (locale, translations) => ({
680
- ...locale.startsWith("fr") ? messages3.fr : messages3.en,
982
+ var searchMenuMessages = (locale = "en", translations) => ({
983
+ ...locale.startsWith("fr") ? defaults.fr : defaults.en,
681
984
  ...translations?.[locale.split("-")[0] ?? locale],
682
985
  ...translations?.[locale]
683
986
  });
987
+ var SearchMenuMessage = UiSchema2.TaggedEnum({
988
+ SetOpen: { open: Schema4.Boolean },
989
+ Reset: {},
990
+ SetQuery: { query: Schema4.String },
991
+ Picked: { id: Schema4.String }
992
+ }).annotate({ identifier: "SearchMenuMessage" });
993
+ var searchMenuOptions = {
994
+ name: "SearchMenu",
995
+ props: SearchMenuPropsSchema,
996
+ model: Schema4.Struct({ open: Schema4.Boolean, query: Schema4.String }).annotate({ identifier: "SearchMenuModel" }),
997
+ message: SearchMenuMessage,
998
+ restore: false
999
+ };
1000
+ var updateSearchMenu = (model, props, message) => {
1001
+ switch (message._tag) {
1002
+ case "SetOpen":
1003
+ return props.open === undefined ? { open: message.open, query: message.open ? model.query : "" } : model;
1004
+ case "Reset":
1005
+ return model.query === "" ? model : { ...model, query: "" };
1006
+ case "SetQuery":
1007
+ return props.query === undefined ? { ...model, query: message.query } : model;
1008
+ case "Picked":
1009
+ return props.open === undefined ? { open: false, query: "" } : model;
1010
+ }
1011
+ };
1012
+ var update2 = Component3.define(searchMenuOptions).update({
1013
+ SetOpen: ($, message) => updateSearchMenu($.model, $.props, message),
1014
+ Reset: ($, message) => updateSearchMenu($.model, $.props, message),
1015
+ SetQuery: ($, message) => updateSearchMenu($.model, $.props, message),
1016
+ Picked: ($, message) => updateSearchMenu($.model, $.props, message)
1017
+ });
1018
+ var searchMenuBehaviours = {
1019
+ init: () => ({ open: false, query: "" }),
1020
+ update: update2
1021
+ };
1022
+
1023
+ // ../../src/components/search-menu/react.tsx
1024
+ import { jsx as jsx9, jsxs as jsxs6, Fragment } from "react/jsx-runtime";
1025
+ var SearchModel = Component4.define(searchMenuOptions).make({
1026
+ ...searchMenuBehaviours,
1027
+ view: () => View3.text("")
1028
+ });
684
1029
  function SearchMenu({
1030
+ classes: classOverrides,
685
1031
  groups,
686
1032
  locale: localeOverride,
687
1033
  title,
@@ -691,6 +1037,7 @@ function SearchMenu({
691
1037
  emptyMessage,
692
1038
  messages,
693
1039
  shortcutLabel = "⌘K",
1040
+ enableShortcut = true,
694
1041
  className,
695
1042
  open,
696
1043
  onOpenChange,
@@ -699,6 +1046,7 @@ function SearchMenu({
699
1046
  onQueryChange,
700
1047
  shouldFilter
701
1048
  }) {
1049
+ const searchMenuClasses = resolveSearchMenuClasses(classOverrides);
702
1050
  const locale = useKrakstackLocale3(localeOverride);
703
1051
  const labels = searchMenuMessages(locale, messages);
704
1052
  const resolvedTitle = title ?? labels.title;
@@ -706,28 +1054,26 @@ function SearchMenu({
706
1054
  const resolvedPlaceholder = placeholder ?? labels.placeholder;
707
1055
  const resolvedInputPlaceholder = inputPlaceholder ?? labels.inputPlaceholder;
708
1056
  const resolvedEmptyMessage = emptyMessage ?? labels.emptyMessage;
709
- const [uncontrolledOpen, setUncontrolledOpen] = useState2(false);
710
- const [uncontrolledQuery, setUncontrolledQuery] = useState2("");
711
- const isControlled = open !== undefined;
712
- const isOpen = open ?? uncontrolledOpen;
713
- const searchQuery = query ?? uncontrolledQuery;
1057
+ const { model, send } = useModel(SearchModel, { groups, open, query });
1058
+ const isOpen = open ?? model.open;
1059
+ const searchQuery = query ?? model.query;
714
1060
  const externalGroups = shouldFilter === false ? groups : undefined;
715
- const [selection, setSelection] = useState2();
1061
+ const [selection, setSelection] = useState3();
716
1062
  const externalItems = externalGroups?.flatMap(({ items }) => items.filter(({ disabled }) => !disabled));
717
1063
  const selectedValue = selection?.groups === externalGroups && selection?.query === searchQuery && externalItems?.some(({ label }) => label.trim() === selection?.value) ? selection.value : externalItems?.[0]?.label.trim() ?? "";
718
- const inputRef = useRef2(null);
719
- const listRef = useRef2(null);
1064
+ const inputRef = useRef3(null);
1065
+ const listRef = useRef3(null);
720
1066
  const setQuery = (value) => {
721
1067
  if (query === undefined)
722
- setUncontrolledQuery(value);
1068
+ send(SearchMenuMessage.SetQuery({ query: value }));
723
1069
  onQueryChange?.(value);
724
1070
  };
725
1071
  useEffect2(() => {
726
1072
  if (!isOpen) {
727
- setUncontrolledQuery("");
1073
+ send(SearchMenuMessage.Reset());
728
1074
  setSelection(undefined);
729
1075
  }
730
- }, [isOpen]);
1076
+ }, [isOpen, send]);
731
1077
  useEffect2(() => {
732
1078
  const list = listRef.current;
733
1079
  if (!isOpen || !list)
@@ -737,12 +1083,14 @@ function SearchMenu({
737
1083
  });
738
1084
  return () => cancelAnimationFrame(frame);
739
1085
  }, [isOpen, searchQuery, externalGroups]);
740
- const setOpen = useCallback((value) => {
741
- if (!isControlled)
742
- setUncontrolledOpen(value);
1086
+ const setOpen = useCallback2((value) => {
1087
+ if (open === undefined)
1088
+ send(SearchMenuMessage.SetOpen({ open: value }));
743
1089
  onOpenChange?.(value);
744
- }, [isControlled, onOpenChange]);
1090
+ }, [open, onOpenChange, send]);
745
1091
  useEffect2(() => {
1092
+ if (!enableShortcut)
1093
+ return;
746
1094
  const onKeyDown = (event) => {
747
1095
  if (event.key.toLowerCase() !== "k")
748
1096
  return;
@@ -753,8 +1101,8 @@ function SearchMenu({
753
1101
  };
754
1102
  document.addEventListener("keydown", onKeyDown);
755
1103
  return () => document.removeEventListener("keydown", onKeyDown);
756
- }, [isOpen, setOpen]);
757
- return /* @__PURE__ */ jsxs6(Fragment2, {
1104
+ }, [enableShortcut, isOpen, setOpen]);
1105
+ return /* @__PURE__ */ jsxs6(Fragment, {
758
1106
  children: [
759
1107
  /* @__PURE__ */ jsxs6(Button, {
760
1108
  "aria-label": resolvedPlaceholder,
@@ -771,10 +1119,10 @@ function SearchMenu({
771
1119
  className: "text-muted-foreground hidden min-w-0 flex-1 truncate text-left font-normal sm:block",
772
1120
  children: resolvedPlaceholder
773
1121
  }),
774
- /* @__PURE__ */ jsx9("kbd", {
1122
+ enableShortcut ? /* @__PURE__ */ jsx9("kbd", {
775
1123
  className: "bg-muted text-muted-foreground pointer-events-none hidden h-5 items-center rounded border px-1.5 font-mono text-[10px] font-medium sm:inline-flex",
776
1124
  children: shortcutLabel
777
- })
1125
+ }) : null
778
1126
  ]
779
1127
  }),
780
1128
  /* @__PURE__ */ jsx9(CommandDialog, {
@@ -783,7 +1131,7 @@ function SearchMenu({
783
1131
  title: resolvedTitle,
784
1132
  description: resolvedDescription,
785
1133
  className: "[&>[data-slot=dialog-close]]:hidden",
786
- children: /* @__PURE__ */ jsxs6(Command, {
1134
+ children: /* @__PURE__ */ jsxs6(Command2, {
787
1135
  ...shouldFilter === undefined ? {} : { shouldFilter },
788
1136
  ...externalGroups && {
789
1137
  value: selectedValue,
@@ -848,11 +1196,11 @@ function SearchMenu({
848
1196
  className: "flex min-w-0 flex-1 flex-col gap-0.5",
849
1197
  children: [
850
1198
  /* @__PURE__ */ jsx9("span", {
851
- className: "truncate font-medium",
1199
+ className: searchMenuClasses.resultTitle,
852
1200
  children: item.label
853
1201
  }),
854
1202
  item.description ? /* @__PURE__ */ jsx9("span", {
855
- className: "text-muted-foreground truncate text-xs",
1203
+ className: searchMenuClasses.resultDescription,
856
1204
  children: item.description
857
1205
  }) : null
858
1206
  ]
@@ -871,12 +1219,9 @@ function SearchMenu({
871
1219
  ]
872
1220
  });
873
1221
  }
874
-
875
- // ../../src/components/ui/sidebar-layout.tsx
876
- import { Link as Link2, Outlet } from "@tanstack/react-router";
877
- import { Option, Schema as Schema2 } from "effect";
878
- import { Cookies } from "effect/http";
879
- import { useState as useState4 } from "react";
1222
+ // ../../src/components/sidebar-layout/react.tsx
1223
+ import { Link, Outlet } from "@tanstack/react-router";
1224
+ import { Component as Component6, View as View4 } from "effect/ui";
880
1225
 
881
1226
  // ../../src/components/ui/sidebar.tsx
882
1227
  import * as React2 from "react";
@@ -1039,7 +1384,7 @@ function TooltipContent({
1039
1384
 
1040
1385
  // ../../src/components/ui/sidebar.tsx
1041
1386
  import { PanelLeftIcon } from "lucide-react";
1042
- import { Schema } from "effect";
1387
+ import { Schema as Schema5 } from "effect";
1043
1388
  import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1044
1389
  var SIDEBAR_COOKIE_NAME = "sidebar_state";
1045
1390
  var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -1363,7 +1708,7 @@ function SidebarMenuButton({
1363
1708
  if (!tooltip) {
1364
1709
  return comp;
1365
1710
  }
1366
- const tooltipProps = Schema.is(Schema.String)(tooltip) ? { children: tooltip } : tooltip;
1711
+ const tooltipProps = Schema5.is(Schema5.String)(tooltip) ? { children: tooltip } : tooltip;
1367
1712
  return /* @__PURE__ */ jsxs9(Tooltip, {
1368
1713
  children: [
1369
1714
  comp,
@@ -1376,16 +1721,145 @@ function SidebarMenuButton({
1376
1721
  ]
1377
1722
  });
1378
1723
  }
1724
+ function SidebarMenuSub({ className, ...props }) {
1725
+ return /* @__PURE__ */ jsx12("ul", {
1726
+ "data-slot": "sidebar-menu-sub",
1727
+ "data-sidebar": "menu-sub",
1728
+ className: cn("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden", className),
1729
+ ...props
1730
+ });
1731
+ }
1732
+ function SidebarMenuSubItem({
1733
+ className,
1734
+ ...props
1735
+ }) {
1736
+ return /* @__PURE__ */ jsx12("li", {
1737
+ "data-slot": "sidebar-menu-sub-item",
1738
+ "data-sidebar": "menu-sub-item",
1739
+ className: cn("group/menu-sub-item relative", className),
1740
+ ...props
1741
+ });
1742
+ }
1743
+ function SidebarMenuSubButton({
1744
+ render,
1745
+ size = "md",
1746
+ isActive = false,
1747
+ className,
1748
+ ...props
1749
+ }) {
1750
+ return useRender2({
1751
+ defaultTagName: "a",
1752
+ props: mergeProps2({
1753
+ className: cn("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground", className)
1754
+ }, props),
1755
+ render,
1756
+ state: {
1757
+ slot: "sidebar-menu-sub-button",
1758
+ sidebar: "menu-sub-button",
1759
+ size,
1760
+ active: isActive
1761
+ }
1762
+ });
1763
+ }
1379
1764
 
1380
- // ../../src/components/ui/sidebar-layout.tsx
1381
- import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1382
- var SIDEBAR_COOKIE_NAME2 = "sidebar_state";
1383
- var SidebarOpenCookie = Schema2.Literals(["true", "false"]).annotate({
1765
+ // ../../src/components/sidebar-layout/classes.ts
1766
+ var sidebarLayoutClasses = {
1767
+ header: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
1768
+ headerMain: "flex flex-col gap-2",
1769
+ headerText: "flex flex-col gap-1",
1770
+ title: "text-3xl font-bold tracking-tight",
1771
+ description: "text-muted-foreground max-w-2xl text-sm",
1772
+ toolbar: "ml-auto flex items-center gap-2",
1773
+ content: "isolate",
1774
+ desktopViewport: "xl:h-svh xl:min-h-0 xl:overflow-hidden"
1775
+ };
1776
+ var resolveSidebarLayoutClasses = (overrides) => ({
1777
+ ...sidebarLayoutClasses,
1778
+ ...overrides
1779
+ });
1780
+
1781
+ // ../../src/components/sidebar-layout/index.ts
1782
+ import { Option, Schema as Schema7 } from "effect";
1783
+ import { Cookies } from "effect/http";
1784
+ import { Component as Component5, UiSchema as UiSchema3 } from "effect/ui";
1785
+
1786
+ // ../../src/components/sidebar-layout/schema.ts
1787
+ import { Schema as Schema6, Struct as Struct2 } from "effect";
1788
+ var SidebarCollapsibleSchema = Schema6.Literals([
1789
+ "icon",
1790
+ "offcanvas",
1791
+ "none"
1792
+ ]);
1793
+ var NavItemSchema = Schema6.Struct({
1794
+ label: Schema6.String,
1795
+ href: Schema6.String,
1796
+ exact: Schema6.optional(Schema6.Boolean),
1797
+ badge: Schema6.optional(Schema6.String),
1798
+ external: Schema6.optional(Schema6.Boolean)
1799
+ }).annotate({ identifier: "SidebarNavItem" });
1800
+ var NavGroupSchema = Schema6.Struct({
1801
+ label: Schema6.String,
1802
+ items: Schema6.Array(NavItemSchema)
1803
+ }).annotate({ identifier: "SidebarNavGroup" });
1804
+ var layoutSlots = ["toolbar", "content", "desktopViewport"];
1805
+ var SidebarLayoutClassesOverridesSchema = Schema6.Record(Schema6.Literals(Struct2.keys(Struct2.pick(sidebarLayoutClasses, layoutSlots))), Schema6.optionalKey(Schema6.String)).annotate({ identifier: "SidebarLayoutClassesOverrides" });
1806
+ var SidebarPageHeaderClassesOverridesSchema = Schema6.Record(Schema6.Literals(Struct2.keys(Struct2.omit(sidebarLayoutClasses, layoutSlots))), Schema6.optionalKey(Schema6.String)).annotate({ identifier: "SidebarPageHeaderClassesOverrides" });
1807
+ var SidebarLayoutPropsSchema = Schema6.Struct({
1808
+ classes: Schema6.optional(SidebarLayoutClassesOverridesSchema),
1809
+ groups: Schema6.Array(NavGroupSchema),
1810
+ contentClassName: Schema6.optional(Schema6.String),
1811
+ fullPage: Schema6.optional(Schema6.Boolean),
1812
+ sidebarCollapsible: Schema6.optional(SidebarCollapsibleSchema),
1813
+ defaultOpen: Schema6.optional(Schema6.Boolean)
1814
+ }).annotate({ identifier: "SidebarLayoutProps" });
1815
+ var SidebarPageHeaderPropsSchema = Schema6.Struct({
1816
+ classes: Schema6.optional(SidebarPageHeaderClassesOverridesSchema),
1817
+ title: Schema6.String,
1818
+ description: Schema6.optional(Schema6.String),
1819
+ badge: Schema6.optional(Schema6.Struct({
1820
+ label: Schema6.String,
1821
+ variant: Schema6.optional(Schema6.Literals(["default", "secondary", "outline", "destructive"]))
1822
+ }))
1823
+ }).annotate({ identifier: "SidebarPageHeaderProps" });
1824
+
1825
+ // ../../src/components/sidebar-layout/index.ts
1826
+ var cookieName = "sidebar_state";
1827
+ var SidebarOpenCookie = Schema7.Literals(["true", "false"]).annotate({
1384
1828
  identifier: "SidebarOpenCookie"
1385
1829
  });
1386
- var getSidebarDefaultOpen = (defaultOpen) => {
1387
- return Schema2.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[SIDEBAR_COOKIE_NAME2]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
1830
+ var getSidebarDefaultOpen = (defaultOpen) => Schema7.decodeUnknownOption(SidebarOpenCookie)(Cookies.parseHeader(globalThis.document?.cookie ?? "")[cookieName]).pipe(Option.map((value) => value === "true"), Option.getOrElse(() => defaultOpen));
1831
+ var SidebarLayoutMessage = UiSchema3.TaggedEnum({
1832
+ SetOpen: { open: Schema7.Boolean },
1833
+ SetMobileOpen: { open: Schema7.Boolean }
1834
+ }).annotate({ identifier: "SidebarLayoutMessage" });
1835
+ var sidebarLayoutOptions = {
1836
+ name: "SidebarLayout",
1837
+ props: SidebarLayoutPropsSchema,
1838
+ model: Schema7.Struct({
1839
+ open: Schema7.Boolean,
1840
+ mobileOpen: Schema7.Boolean
1841
+ }).annotate({ identifier: "SidebarLayoutModel" }),
1842
+ message: SidebarLayoutMessage,
1843
+ restore: false
1844
+ };
1845
+ var update3 = Component5.define(sidebarLayoutOptions).update({
1846
+ SetOpen: ($, { open }) => ({ ...$.model, open }),
1847
+ SetMobileOpen: ($, { open }) => ({ ...$.model, mobileOpen: open })
1848
+ });
1849
+ var sidebarLayoutBehaviours = {
1850
+ init: ({ props }) => ({
1851
+ open: getSidebarDefaultOpen(props.defaultOpen ?? true),
1852
+ mobileOpen: false
1853
+ }),
1854
+ update: update3
1388
1855
  };
1856
+
1857
+ // ../../src/components/sidebar-layout/react.tsx
1858
+ import { jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
1859
+ var SidebarModel = Component6.define(sidebarLayoutOptions).make({
1860
+ ...sidebarLayoutBehaviours,
1861
+ view: () => View4.text("")
1862
+ });
1389
1863
  function AppSidebar({ collapsible, footer, groups, header }) {
1390
1864
  const { isMobile, setOpenMobile } = useSidebar();
1391
1865
  const closeMobileSidebar = () => {
@@ -1407,12 +1881,13 @@ function AppSidebar({ collapsible, footer, groups, header }) {
1407
1881
  }),
1408
1882
  /* @__PURE__ */ jsx13(SidebarGroupContent, {
1409
1883
  children: /* @__PURE__ */ jsx13(SidebarMenu, {
1884
+ "aria-label": group.label(),
1410
1885
  children: group.items.map((item) => {
1411
1886
  const render = item.external ? /* @__PURE__ */ jsx13("a", {
1412
1887
  href: item.href,
1413
1888
  target: "_blank",
1414
1889
  rel: "noreferrer"
1415
- }) : /* @__PURE__ */ jsx13(Link2, {
1890
+ }) : /* @__PURE__ */ jsx13(Link, {
1416
1891
  to: item.href,
1417
1892
  activeOptions: {
1418
1893
  exact: item.exact ?? false,
@@ -1420,24 +1895,45 @@ function AppSidebar({ collapsible, footer, groups, header }) {
1420
1895
  },
1421
1896
  activeProps: { "data-active": "" }
1422
1897
  });
1423
- return /* @__PURE__ */ jsx13(SidebarMenuItem, {
1424
- children: /* @__PURE__ */ jsxs10(SidebarMenuButton, {
1425
- className: "h-auto min-h-8",
1426
- onClick: closeMobileSidebar,
1427
- render,
1428
- tooltip: item.label(),
1429
- children: [
1430
- item.icon ? /* @__PURE__ */ jsx13(item.icon, {}) : null,
1431
- /* @__PURE__ */ jsx13("span", {
1432
- children: item.label()
1433
- }),
1434
- item.badge ? /* @__PURE__ */ jsx13(Badge, {
1435
- className: "ml-auto",
1436
- variant: "secondary",
1437
- children: item.badge()
1438
- }) : null
1439
- ]
1440
- })
1898
+ return /* @__PURE__ */ jsxs10(SidebarMenuItem, {
1899
+ children: [
1900
+ /* @__PURE__ */ jsxs10(SidebarMenuButton, {
1901
+ className: "h-auto min-h-8",
1902
+ onClick: closeMobileSidebar,
1903
+ render,
1904
+ tooltip: item.label(),
1905
+ children: [
1906
+ item.icon ? /* @__PURE__ */ jsx13(item.icon, {}) : null,
1907
+ /* @__PURE__ */ jsx13("span", {
1908
+ children: item.label()
1909
+ }),
1910
+ item.badge ? /* @__PURE__ */ jsx13(Badge, {
1911
+ className: "ml-auto",
1912
+ variant: "secondary",
1913
+ children: item.badge()
1914
+ }) : null
1915
+ ]
1916
+ }),
1917
+ item.children?.length ? /* @__PURE__ */ jsx13(SidebarMenuSub, {
1918
+ "aria-label": item.label(),
1919
+ children: item.children.map((child) => /* @__PURE__ */ jsx13(SidebarMenuSubItem, {
1920
+ children: /* @__PURE__ */ jsx13(SidebarMenuSubButton, {
1921
+ onClick: closeMobileSidebar,
1922
+ render: /* @__PURE__ */ jsx13(Link, {
1923
+ to: child.href,
1924
+ activeOptions: {
1925
+ exact: true,
1926
+ includeSearch: false
1927
+ },
1928
+ activeProps: { "data-active": "" }
1929
+ }),
1930
+ children: /* @__PURE__ */ jsx13("span", {
1931
+ children: child.label()
1932
+ })
1933
+ })
1934
+ }, child.href))
1935
+ }) : null
1936
+ ]
1441
1937
  }, item.href);
1442
1938
  })
1443
1939
  })
@@ -1453,6 +1949,7 @@ function AppSidebar({ collapsible, footer, groups, header }) {
1453
1949
  });
1454
1950
  }
1455
1951
  function SidebarLayout({
1952
+ classes: classOverrides,
1456
1953
  groups,
1457
1954
  children,
1458
1955
  sidebarFooter,
@@ -1463,11 +1960,18 @@ function SidebarLayout({
1463
1960
  sidebarCollapsible = "icon",
1464
1961
  defaultOpen = true
1465
1962
  }) {
1466
- const [sidebarOpen, setSidebarOpen] = useState4(() => getSidebarDefaultOpen(defaultOpen));
1963
+ const sidebarLayoutClasses = resolveSidebarLayoutClasses(classOverrides);
1964
+ const {
1965
+ model: { open: sidebarOpen },
1966
+ send
1967
+ } = useModel(SidebarModel, {
1968
+ groups: [],
1969
+ defaultOpen
1970
+ });
1467
1971
  return /* @__PURE__ */ jsxs10(SidebarProvider, {
1468
1972
  open: sidebarOpen,
1469
- onOpenChange: setSidebarOpen,
1470
- className: cn(fullPage && "xl:h-svh xl:min-h-0 xl:overflow-hidden"),
1973
+ onOpenChange: (open) => send(SidebarLayoutMessage.SetOpen({ open })),
1974
+ className: cn(fullPage && sidebarLayoutClasses.desktopViewport),
1471
1975
  children: [
1472
1976
  /* @__PURE__ */ jsx13(AppSidebar, {
1473
1977
  collapsible: sidebarCollapsible,
@@ -1476,7 +1980,7 @@ function SidebarLayout({
1476
1980
  header: sidebarHeader
1477
1981
  }),
1478
1982
  /* @__PURE__ */ jsxs10(SidebarInset, {
1479
- className: cn("min-w-0 overflow-x-clip", fullPage && "xl:h-svh xl:min-h-0 xl:overflow-hidden"),
1983
+ className: cn("min-w-0 overflow-x-clip", fullPage && sidebarLayoutClasses.desktopViewport),
1480
1984
  children: [
1481
1985
  /* @__PURE__ */ jsx13("div", {
1482
1986
  className: "h-14 shrink-0",
@@ -1485,14 +1989,14 @@ function SidebarLayout({
1485
1989
  children: [
1486
1990
  /* @__PURE__ */ jsx13(SidebarTrigger, {}),
1487
1991
  /* @__PURE__ */ jsx13("div", {
1488
- className: "ml-auto flex items-center gap-2",
1992
+ className: sidebarLayoutClasses.toolbar,
1489
1993
  children: headerActions
1490
1994
  })
1491
1995
  ]
1492
1996
  })
1493
1997
  }),
1494
1998
  /* @__PURE__ */ jsx13("div", {
1495
- className: cn("isolate", contentClassName ?? "flex flex-col gap-6 px-5 py-6 md:px-8"),
1999
+ className: cn(sidebarLayoutClasses.content, contentClassName ?? "flex flex-col gap-6 px-5 py-6 md:px-8"),
1496
2000
  children: children ?? /* @__PURE__ */ jsx13(Outlet, {})
1497
2001
  })
1498
2002
  ]
@@ -1500,7 +2004,6 @@ function SidebarLayout({
1500
2004
  ]
1501
2005
  });
1502
2006
  }
1503
-
1504
2007
  // ../../src/lib/seo.ts
1505
2008
  var localizedUrl = (origin, locale, path) => `${origin.replace(/\/$/, "")}/${locale}${path === "/" ? "/" : path}`;
1506
2009
  var seo = ({
@@ -1615,13 +2118,13 @@ var createSeo = (defaults) => (options) => seo({
1615
2118
  });
1616
2119
 
1617
2120
  // ../../src/lib/docs.tsx
1618
- import { jsx as jsx14, jsxs as jsxs11, Fragment as Fragment3 } from "react/jsx-runtime";
1619
- var SIDEBAR_COOKIE_NAME3 = "sidebar_state";
1620
- var SidebarOpenCookie2 = Schema3.Literals(["true", "false"]).annotate({
2121
+ import { jsx as jsx14, jsxs as jsxs11, Fragment as Fragment2 } from "react/jsx-runtime";
2122
+ var SIDEBAR_COOKIE_NAME2 = "sidebar_state";
2123
+ var SidebarOpenCookie2 = Schema8.Literals(["true", "false"]).annotate({
1621
2124
  identifier: "SidebarOpenCookie"
1622
2125
  });
1623
- var getSidebarOpenCookie = createIsomorphicFn().server(() => getCookie(SIDEBAR_COOKIE_NAME3)).client(() => Cookies2.parseHeader(globalThis.document?.cookie ?? "")[SIDEBAR_COOKIE_NAME3]);
1624
- var getSidebarDefaultOpen2 = () => Schema3.decodeUnknownOption(SidebarOpenCookie2)(getSidebarOpenCookie()).pipe(Option2.map((value) => value === "true"), Option2.getOrElse(() => true));
2126
+ var getSidebarOpenCookie = createIsomorphicFn().server(() => getCookie(SIDEBAR_COOKIE_NAME2)).client(() => Cookies2.parseHeader(globalThis.document?.cookie ?? "")[SIDEBAR_COOKIE_NAME2]);
2127
+ var getSidebarDefaultOpen2 = () => Schema8.decodeUnknownOption(SidebarOpenCookie2)(getSidebarOpenCookie()).pipe(Option2.map((value) => value === "true"), Option2.getOrElse(() => true));
1625
2128
  var makeIcon = (name, paths) => {
1626
2129
  const Icon = forwardRef(({ absoluteStrokeWidth: _absoluteStrokeWidth, size = 24, ...props }, ref) => /* @__PURE__ */ jsx14("svg", {
1627
2130
  "aria-hidden": "true",
@@ -1640,7 +2143,7 @@ var makeIcon = (name, paths) => {
1640
2143
  Icon.displayName = name;
1641
2144
  return Icon;
1642
2145
  };
1643
- var ArrowLeft = makeIcon("ArrowLeft", /* @__PURE__ */ jsxs11(Fragment3, {
2146
+ var ArrowLeft = makeIcon("ArrowLeft", /* @__PURE__ */ jsxs11(Fragment2, {
1644
2147
  children: [
1645
2148
  /* @__PURE__ */ jsx14("path", {
1646
2149
  d: "m12 19-7-7 7-7"
@@ -1650,7 +2153,7 @@ var ArrowLeft = makeIcon("ArrowLeft", /* @__PURE__ */ jsxs11(Fragment3, {
1650
2153
  })
1651
2154
  ]
1652
2155
  }));
1653
- var ArrowRight = makeIcon("ArrowRight", /* @__PURE__ */ jsxs11(Fragment3, {
2156
+ var ArrowRight = makeIcon("ArrowRight", /* @__PURE__ */ jsxs11(Fragment2, {
1654
2157
  children: [
1655
2158
  /* @__PURE__ */ jsx14("path", {
1656
2159
  d: "M5 12h14"
@@ -1660,7 +2163,7 @@ var ArrowRight = makeIcon("ArrowRight", /* @__PURE__ */ jsxs11(Fragment3, {
1660
2163
  })
1661
2164
  ]
1662
2165
  }));
1663
- var BookOpen = makeIcon("BookOpen", /* @__PURE__ */ jsxs11(Fragment3, {
2166
+ var BookOpen = makeIcon("BookOpen", /* @__PURE__ */ jsxs11(Fragment2, {
1664
2167
  children: [
1665
2168
  /* @__PURE__ */ jsx14("path", {
1666
2169
  d: "M12 7v14"
@@ -1673,7 +2176,7 @@ var BookOpen = makeIcon("BookOpen", /* @__PURE__ */ jsxs11(Fragment3, {
1673
2176
  var ChevronDown = makeIcon("ChevronDown", /* @__PURE__ */ jsx14("path", {
1674
2177
  d: "m6 9 6 6 6-6"
1675
2178
  }));
1676
- var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs11(Fragment3, {
2179
+ var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs11(Fragment2, {
1677
2180
  children: [
1678
2181
  /* @__PURE__ */ jsx14("path", {
1679
2182
  d: "M15 3h6v6"
@@ -1686,17 +2189,17 @@ var ExternalLink = makeIcon("ExternalLink", /* @__PURE__ */ jsxs11(Fragment3, {
1686
2189
  })
1687
2190
  ]
1688
2191
  }));
1689
- var DocsSection = Schema3.String.annotate({
2192
+ var DocsSection = Schema8.String.annotate({
1690
2193
  identifier: "DocsSection"
1691
2194
  });
1692
- var DocsPageType = Schema3.Literals([
2195
+ var DocsPageType = Schema8.Literals([
1693
2196
  "concept",
1694
2197
  "tutorial",
1695
2198
  "how-to",
1696
2199
  "reference",
1697
2200
  "runbook"
1698
2201
  ]).annotate({ identifier: "DocsPageType" });
1699
- var DocsDate = Schema3.String.pipe(Schema3.check(Schema3.makeFilter((date) => Number.isNaN(new Date(date).getTime()) ? "Expected a valid date" : undefined)));
2202
+ var DocsDate = Schema8.String.pipe(Schema8.check(Schema8.makeFilter((date) => Number.isNaN(new Date(date).getTime()) ? "Expected a valid date" : undefined)));
1700
2203
  var NEW_DOCS_PAGE_DAYS = 14;
1701
2204
  var isDocsPageNew = (createdAt, now = new Date) => {
1702
2205
  if (!createdAt)
@@ -1704,38 +2207,38 @@ var isDocsPageNew = (createdAt, now = new Date) => {
1704
2207
  const age = now.getTime() - new Date(createdAt).getTime();
1705
2208
  return age >= 0 && age < NEW_DOCS_PAGE_DAYS * 24 * 60 * 60 * 1000;
1706
2209
  };
1707
- var DocsFrontmatter = Schema3.Struct({
1708
- slug: Schema3.String,
1709
- path: Schema3.String,
1710
- title: Schema3.String,
1711
- description: Schema3.String,
1712
- icon: Schema3.optional(Schema3.String),
1713
- order: Schema3.Finite,
1714
- locale: Schema3.String,
2210
+ var DocsFrontmatter = Schema8.Struct({
2211
+ slug: Schema8.String,
2212
+ path: Schema8.String,
2213
+ title: Schema8.String,
2214
+ description: Schema8.String,
2215
+ icon: Schema8.optional(Schema8.String),
2216
+ order: Schema8.Finite,
2217
+ locale: Schema8.String,
1715
2218
  section: DocsSection,
1716
2219
  type: DocsPageType,
1717
- createdAt: Schema3.optional(DocsDate),
1718
- updatedAt: Schema3.optional(DocsDate),
1719
- legacySlugs: Schema3.optional(Schema3.Array(Schema3.String)),
1720
- tags: Schema3.optional(Schema3.Array(Schema3.NonEmptyString))
2220
+ createdAt: Schema8.optional(DocsDate),
2221
+ updatedAt: Schema8.optional(DocsDate),
2222
+ legacySlugs: Schema8.optional(Schema8.Array(Schema8.String)),
2223
+ tags: Schema8.optional(Schema8.Array(Schema8.NonEmptyString))
1721
2224
  }).annotate({ identifier: "DocsFrontmatter" });
1722
- var DocsHeadingSchema = Schema3.Struct({
1723
- depth: Schema3.Literals([2, 3]),
1724
- id: Schema3.String,
1725
- title: Schema3.String
2225
+ var DocsHeadingSchema = Schema8.Struct({
2226
+ depth: Schema8.Literals([2, 3]),
2227
+ id: Schema8.String,
2228
+ title: Schema8.String
1726
2229
  }).annotate({ identifier: "DocsHeading" });
1727
- var DocsCodeBlockSchema = Schema3.Struct({
1728
- code: Schema3.String,
1729
- language: Schema3.String
2230
+ var DocsCodeBlockSchema = Schema8.Struct({
2231
+ code: Schema8.String,
2232
+ language: Schema8.String
1730
2233
  }).annotate({ identifier: "DocsCodeBlock" });
1731
- var DocsPageSchema = Schema3.Struct({
2234
+ var DocsPageSchema = Schema8.Struct({
1732
2235
  ...DocsFrontmatter.fields,
1733
- codeBlocks: Schema3.Array(DocsCodeBlockSchema),
1734
- headings: Schema3.Array(DocsHeadingSchema),
1735
- html: Schema3.String,
1736
- searchText: Schema3.String,
1737
- sourceFile: Schema3.String,
1738
- source: Schema3.String
2236
+ codeBlocks: Schema8.Array(DocsCodeBlockSchema),
2237
+ headings: Schema8.Array(DocsHeadingSchema),
2238
+ html: Schema8.String,
2239
+ searchText: Schema8.String,
2240
+ sourceFile: Schema8.String,
2241
+ source: Schema8.String
1739
2242
  }).annotate({ identifier: "DocsPage" });
1740
2243
  var slugifyDocsHeading = (value) => value.normalize("NFKD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[`*_~]/g, "").replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
1741
2244
  var validateDocsPages = (pages, config) => {
@@ -1806,7 +2309,7 @@ var createDocsSource = (config) => {
1806
2309
  if (new Set(config.locales).size !== config.locales.length) {
1807
2310
  throw new Error("Documentation source locales must be unique");
1808
2311
  }
1809
- const pages = validateDocsPages(config.pages.map((page) => Schema3.decodeUnknownSync(DocsPageSchema)(page)), config);
2312
+ const pages = validateDocsPages(config.pages.map((page) => Schema8.decodeUnknownSync(DocsPageSchema)(page)), config);
1810
2313
  const getPage = (slug, locale) => pages.find((page) => page.slug === slug && page.locale === locale);
1811
2314
  const resolvePage = (slug, locale) => pages.find((page) => page.locale === locale && (page.slug === slug || page.legacySlugs?.includes(slug)));
1812
2315
  const getPages = (locale) => pages.filter((page) => page.locale === locale).sort((left, right) => left.order - right.order);
@@ -1953,6 +2456,7 @@ var makeDocs = (config) => {
1953
2456
  origin,
1954
2457
  resources: config.resources,
1955
2458
  sidebarGroups: config.sidebarGroups,
2459
+ sidebarParents: config.sidebarParents,
1956
2460
  source,
1957
2461
  pages,
1958
2462
  resolve,
@@ -1999,7 +2503,7 @@ var docsPageTypeMessages = {
1999
2503
  }
2000
2504
  };
2001
2505
  var defaultSectionLabel = (locale, section) => Object.entries(docsSectionMessages[locale]).find(([key]) => key === section)?.[1] ?? humanizeDocsValue(section);
2002
- var messages4 = {
2506
+ var messages2 = {
2003
2507
  en: {
2004
2508
  title: "Documentation",
2005
2509
  description: "Guides and technical reference.",
@@ -2062,7 +2566,7 @@ var messages4 = {
2062
2566
  }
2063
2567
  };
2064
2568
  var getDocsMessages = (locale, overrides) => ({
2065
- ...locale.startsWith("fr") ? messages4.fr : messages4.en,
2569
+ ...locale.startsWith("fr") ? messages2.fr : messages2.en,
2066
2570
  ...overrides
2067
2571
  });
2068
2572
  var iconFor = (icons, name) => name ? icons[name] : undefined;
@@ -2254,13 +2758,17 @@ var DocsLayout = ({
2254
2758
  }) => {
2255
2759
  const { brand, resources, sidebarGroups } = docs;
2256
2760
  const resolvedMessages = docs.getMessages(locale);
2257
- const groups = docs.sections(locale).map((section) => ({
2761
+ const sections = docs.sections(locale);
2762
+ const visiblePages = sections.flatMap((section) => section.pages);
2763
+ const parentOf = (page) => visiblePages.find(({ slug }) => slug === docs.sidebarParents?.[page.slug]);
2764
+ const groups = sections.map((section) => ({
2258
2765
  label: () => resolvedMessages.sectionLabel(section.id),
2259
- items: section.pages.map((item) => {
2766
+ items: section.pages.filter((page) => !parentOf(page)).map((item) => {
2260
2767
  const navItem = {
2261
2768
  label: () => item.title,
2262
2769
  href: item.path,
2263
- exact: true
2770
+ exact: true,
2771
+ children: visiblePages.filter((child) => parentOf(child) === item).map((child) => ({ label: () => child.title, href: child.path }))
2264
2772
  };
2265
2773
  const ItemIcon = iconFor(docs.icons, item.icon);
2266
2774
  if (ItemIcon)
@@ -2270,7 +2778,7 @@ var DocsLayout = ({
2270
2778
  }
2271
2779
  return navItem;
2272
2780
  })
2273
- }));
2781
+ })).filter(({ items }) => items.length > 0);
2274
2782
  if (sidebarGroups) {
2275
2783
  groups.push(...sidebarGroups.map((group) => ({
2276
2784
  label: group.label,
@@ -2306,14 +2814,16 @@ var DocsLayout = ({
2306
2814
  defaultOpen: getSidebarDefaultOpen2(),
2307
2815
  groups,
2308
2816
  sidebarCollapsible,
2309
- sidebarHeader: /* @__PURE__ */ jsx14(AppBrand, {
2310
- label: brand.label,
2311
- subtitle: brand.subtitle(),
2312
- icon: brand.icon,
2817
+ sidebarHeader: /* @__PURE__ */ jsx14("a", {
2313
2818
  href: brand.href,
2314
- variant: "sidebar"
2819
+ children: /* @__PURE__ */ jsx14(AppBrand, {
2820
+ label: brand.label,
2821
+ subtitle: brand.subtitle(),
2822
+ icon: brand.icon,
2823
+ variant: "sidebar"
2824
+ })
2315
2825
  }),
2316
- headerActions: /* @__PURE__ */ jsxs11(Fragment3, {
2826
+ headerActions: /* @__PURE__ */ jsxs11(Fragment2, {
2317
2827
  children: [
2318
2828
  docs.githubUrl ? /* @__PURE__ */ jsxs11("a", {
2319
2829
  className: "text-muted-foreground hover:text-foreground hidden items-center gap-1.5 text-sm lg:flex",
@@ -2377,15 +2887,20 @@ var DocsHeader = ({ docs, resolution }) => {
2377
2887
  ]
2378
2888
  });
2379
2889
  };
2380
- var DocsContent = ({ docs, resolution }) => {
2890
+ var DocsContent = ({
2891
+ children,
2892
+ docs,
2893
+ resolution
2894
+ }) => {
2381
2895
  const { page } = resolution;
2382
2896
  const resolvedMessages = docs.getMessages(page.locale);
2383
- return /* @__PURE__ */ jsxs11(Fragment3, {
2897
+ return /* @__PURE__ */ jsxs11(Fragment2, {
2384
2898
  children: [
2385
2899
  /* @__PURE__ */ jsx14(DocsMobileTableOfContents, {
2386
2900
  headings: page.headings,
2387
2901
  label: resolvedMessages.onThisPage
2388
2902
  }),
2903
+ children,
2389
2904
  /* @__PURE__ */ jsx14(DocsArticle, {
2390
2905
  locale: page.locale,
2391
2906
  messages: resolvedMessages,
@@ -2469,10 +2984,62 @@ var DocsFooter = ({ docs, resolution }) => {
2469
2984
  ]
2470
2985
  });
2471
2986
  };
2987
+ var ComponentDocsPage = ({
2988
+ docs,
2989
+ resolution,
2990
+ example,
2991
+ installation,
2992
+ dependencies,
2993
+ afterFooter,
2994
+ labels
2995
+ }) => {
2996
+ const heading = (id, title) => ({
2997
+ id,
2998
+ title,
2999
+ depth: 2
3000
+ });
3001
+ const { page } = resolution;
3002
+ const withHeadings = {
3003
+ ...resolution,
3004
+ page: {
3005
+ ...page,
3006
+ headings: [
3007
+ ...example ? [heading("preview", labels.preview), heading("usage", labels.usage)] : [],
3008
+ ...installation ? [heading("installation", labels.installation)] : [],
3009
+ ...page.headings,
3010
+ ...dependencies && labels.dependencies ? [heading("dependencies", labels.dependencies)] : []
3011
+ ]
3012
+ }
3013
+ };
3014
+ return /* @__PURE__ */ jsxs11(DocsPage, {
3015
+ docs,
3016
+ resolution: withHeadings,
3017
+ children: [
3018
+ /* @__PURE__ */ jsx14(DocsHeader, {
3019
+ docs,
3020
+ resolution
3021
+ }),
3022
+ /* @__PURE__ */ jsxs11(DocsContent, {
3023
+ docs,
3024
+ resolution: withHeadings,
3025
+ children: [
3026
+ example,
3027
+ installation
3028
+ ]
3029
+ }),
3030
+ dependencies,
3031
+ /* @__PURE__ */ jsx14(DocsFooter, {
3032
+ docs,
3033
+ resolution
3034
+ }),
3035
+ afterFooter
3036
+ ]
3037
+ });
3038
+ };
2472
3039
  var DocsPage = ({ children, docs, resolution }) => {
2473
3040
  const { page } = resolution;
2474
3041
  const resolvedMessages = docs.getMessages(page.locale);
2475
- const content = children ?? /* @__PURE__ */ jsxs11(Fragment3, {
3042
+ const content = children ?? /* @__PURE__ */ jsxs11(Fragment2, {
2476
3043
  children: [
2477
3044
  /* @__PURE__ */ jsx14(DocsHeader, {
2478
3045
  docs,
@@ -2488,7 +3055,7 @@ var DocsPage = ({ children, docs, resolution }) => {
2488
3055
  })
2489
3056
  ]
2490
3057
  });
2491
- return /* @__PURE__ */ jsxs11(Fragment3, {
3058
+ return /* @__PURE__ */ jsxs11(Fragment2, {
2492
3059
  children: [
2493
3060
  /* @__PURE__ */ jsx14("a", {
2494
3061
  className: "bg-background focus:ring-ring fixed top-2 left-2 z-50 -translate-y-20 rounded-md border px-3 py-2 text-sm shadow-sm focus:translate-y-0 focus:ring-2",
@@ -2545,6 +3112,7 @@ var DocsNotFound = ({
2545
3112
  });
2546
3113
  };
2547
3114
  export {
3115
+ ComponentDocsPage,
2548
3116
  DocsCodeBlockSchema,
2549
3117
  DocsContent,
2550
3118
  DocsFooter,