@hanzo/ui 5.0.3 → 5.1.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 (517) hide show
  1. package/README.md +192 -185
  2. package/bin/cli.js +100 -0
  3. package/bin/create-registry.js +108 -0
  4. package/bin/mcp.js +403 -0
  5. package/bin/npx-registry-mcp.js +15 -0
  6. package/bin/registry-mcp-wrapper.sh +19 -0
  7. package/bin/registry-mcp.js +100 -0
  8. package/bin/start-mcp-server.sh +22 -0
  9. package/bin/test-mcp.sh +52 -0
  10. package/bin/update-registry.js +196 -0
  11. package/dist/accordion.js +1 -0
  12. package/dist/accordion.mjs +1 -0
  13. package/dist/alert-dialog.js +1 -0
  14. package/dist/alert-dialog.mjs +1 -0
  15. package/dist/alert.js +1 -0
  16. package/dist/alert.mjs +1 -0
  17. package/dist/avatar.js +1 -0
  18. package/dist/avatar.mjs +1 -0
  19. package/dist/badge.js +1 -0
  20. package/dist/badge.mjs +1 -0
  21. package/dist/breadcrumb.js +1 -0
  22. package/dist/breadcrumb.mjs +1 -0
  23. package/dist/calendar.js +1 -0
  24. package/dist/calendar.mjs +1 -0
  25. package/dist/carousel.js +1 -0
  26. package/dist/carousel.mjs +1 -0
  27. package/dist/checkbox.js +1 -0
  28. package/dist/checkbox.mjs +1 -0
  29. package/dist/chunk-3H5S2OQ3.mjs +1 -0
  30. package/dist/chunk-5LS2F5OV.mjs +1 -0
  31. package/dist/chunk-5VHN5OKZ.js +1 -0
  32. package/dist/chunk-63HNMH7C.js +1 -0
  33. package/dist/chunk-72TOQ4DM.mjs +1 -0
  34. package/dist/chunk-7M4AVV2R.js +1 -0
  35. package/dist/chunk-DKPVJSBC.js +1 -0
  36. package/dist/chunk-EI7MMDWY.js +1 -0
  37. package/dist/chunk-GANGDIZG.mjs +1 -0
  38. package/dist/chunk-GRGT2Z4K.js +1 -0
  39. package/dist/chunk-JCUUC6NY.mjs +1 -0
  40. package/dist/chunk-JW6PGL6X.js +1 -0
  41. package/dist/chunk-PRVEIITE.js +1 -0
  42. package/dist/chunk-PZPKFU2D.mjs +1 -0
  43. package/dist/chunk-SH52AKNZ.js +1 -0
  44. package/dist/chunk-TU67EJEW.mjs +1 -0
  45. package/dist/chunk-WN5KN73U.mjs +1 -0
  46. package/dist/chunk-YSXGDEY5.mjs +1 -0
  47. package/dist/collapsible.js +1 -0
  48. package/dist/collapsible.mjs +1 -0
  49. package/dist/command.js +1 -0
  50. package/dist/command.mjs +1 -0
  51. package/dist/context-menu.js +1 -0
  52. package/dist/context-menu.mjs +1 -0
  53. package/dist/dialog.js +1 -0
  54. package/dist/dialog.mjs +1 -0
  55. package/dist/drawer.js +1 -0
  56. package/dist/drawer.mjs +1 -0
  57. package/dist/dropdown-menu.js +1 -0
  58. package/dist/dropdown-menu.mjs +1 -0
  59. package/dist/form.js +1 -0
  60. package/dist/form.mjs +1 -0
  61. package/dist/hover-card.js +1 -0
  62. package/dist/hover-card.mjs +1 -0
  63. package/dist/index.js +1 -1096
  64. package/dist/index.mjs +1 -47
  65. package/dist/input-otp.js +1 -0
  66. package/dist/input-otp.mjs +1 -0
  67. package/dist/lib/utils.js +1 -12
  68. package/dist/lib/utils.mjs +1 -3
  69. package/dist/navigation-menu.js +1 -0
  70. package/dist/navigation-menu.mjs +1 -0
  71. package/dist/popover.js +1 -0
  72. package/dist/popover.mjs +1 -0
  73. package/dist/progress.js +1 -0
  74. package/dist/progress.mjs +1 -0
  75. package/dist/radio-group.js +1 -0
  76. package/dist/radio-group.mjs +1 -0
  77. package/dist/resizable.js +1 -0
  78. package/dist/resizable.mjs +1 -0
  79. package/dist/scroll-area.js +1 -0
  80. package/dist/scroll-area.mjs +1 -0
  81. package/dist/select.js +1 -0
  82. package/dist/select.mjs +1 -0
  83. package/dist/separator.js +1 -0
  84. package/dist/separator.mjs +1 -0
  85. package/dist/sheet.js +1 -0
  86. package/dist/sheet.mjs +1 -0
  87. package/dist/skeleton.js +1 -0
  88. package/dist/skeleton.mjs +1 -0
  89. package/dist/slider.js +1 -0
  90. package/dist/slider.mjs +1 -0
  91. package/dist/sonner.js +1 -0
  92. package/dist/sonner.mjs +1 -0
  93. package/dist/src/utils.js +1 -0
  94. package/dist/src/utils.mjs +1 -0
  95. package/dist/switch.js +1 -0
  96. package/dist/switch.mjs +1 -0
  97. package/dist/table.js +1 -0
  98. package/dist/table.mjs +1 -0
  99. package/dist/tabs.js +1 -0
  100. package/dist/tabs.mjs +1 -0
  101. package/dist/tailwind/index.js +1 -0
  102. package/dist/tailwind/index.mjs +1 -0
  103. package/dist/textarea.js +1 -0
  104. package/dist/textarea.mjs +1 -0
  105. package/dist/toggle-group.js +1 -0
  106. package/dist/toggle-group.mjs +1 -0
  107. package/dist/toggle.js +1 -0
  108. package/dist/toggle.mjs +1 -0
  109. package/dist/tooltip.js +1 -0
  110. package/dist/tooltip.mjs +1 -0
  111. package/dist/types/index.js +1 -0
  112. package/dist/types/index.mjs +1 -0
  113. package/package.json +335 -155
  114. package/style/drawer.css +163 -0
  115. package/style/globals.css +13 -0
  116. package/style/hanzo-common.css +31 -0
  117. package/style/hanzo-default-colors.css +82 -0
  118. package/style/theme-provider.tsx +20 -0
  119. package/CHANGELOG.md +0 -184
  120. package/LICENSE +0 -21
  121. package/dist/ai/index.js +0 -53
  122. package/dist/ai/index.js.map +0 -1
  123. package/dist/ai/index.mjs +0 -4
  124. package/dist/ai/index.mjs.map +0 -1
  125. package/dist/blocks/index.js +0 -983
  126. package/dist/blocks/index.js.map +0 -1
  127. package/dist/blocks/index.mjs +0 -945
  128. package/dist/blocks/index.mjs.map +0 -1
  129. package/dist/calendar/index.js +0 -14
  130. package/dist/calendar/index.js.map +0 -1
  131. package/dist/calendar/index.mjs +0 -5
  132. package/dist/calendar/index.mjs.map +0 -1
  133. package/dist/carousel/index.js +0 -220
  134. package/dist/carousel/index.js.map +0 -1
  135. package/dist/carousel/index.mjs +0 -191
  136. package/dist/carousel/index.mjs.map +0 -1
  137. package/dist/charts/index.js +0 -945
  138. package/dist/charts/index.js.map +0 -1
  139. package/dist/charts/index.mjs +0 -901
  140. package/dist/charts/index.mjs.map +0 -1
  141. package/dist/chunk-26T4V5QU.mjs +0 -111
  142. package/dist/chunk-26T4V5QU.mjs.map +0 -1
  143. package/dist/chunk-2A5KXDLJ.js +0 -22
  144. package/dist/chunk-2A5KXDLJ.js.map +0 -1
  145. package/dist/chunk-2CJ4HMF4.js +0 -79
  146. package/dist/chunk-2CJ4HMF4.js.map +0 -1
  147. package/dist/chunk-2OIQKC5E.js +0 -236
  148. package/dist/chunk-2OIQKC5E.js.map +0 -1
  149. package/dist/chunk-2X3KSYBN.js +0 -44
  150. package/dist/chunk-2X3KSYBN.js.map +0 -1
  151. package/dist/chunk-3PBQGYR7.mjs +0 -100
  152. package/dist/chunk-3PBQGYR7.mjs.map +0 -1
  153. package/dist/chunk-3POQQ6L7.js +0 -62
  154. package/dist/chunk-3POQQ6L7.js.map +0 -1
  155. package/dist/chunk-4B47GITH.mjs +0 -28
  156. package/dist/chunk-4B47GITH.mjs.map +0 -1
  157. package/dist/chunk-4BC2OH6B.js +0 -129
  158. package/dist/chunk-4BC2OH6B.js.map +0 -1
  159. package/dist/chunk-5AQSGH4R.js +0 -130
  160. package/dist/chunk-5AQSGH4R.js.map +0 -1
  161. package/dist/chunk-5IHRJFOO.mjs +0 -102
  162. package/dist/chunk-5IHRJFOO.mjs.map +0 -1
  163. package/dist/chunk-5LDGR7YN.mjs +0 -28
  164. package/dist/chunk-5LDGR7YN.mjs.map +0 -1
  165. package/dist/chunk-5MCN3VYM.mjs +0 -23
  166. package/dist/chunk-5MCN3VYM.mjs.map +0 -1
  167. package/dist/chunk-6AVAMRMB.mjs +0 -47
  168. package/dist/chunk-6AVAMRMB.mjs.map +0 -1
  169. package/dist/chunk-6H62JRNM.mjs +0 -120
  170. package/dist/chunk-6H62JRNM.mjs.map +0 -1
  171. package/dist/chunk-6KCII3F6.mjs +0 -126
  172. package/dist/chunk-6KCII3F6.mjs.map +0 -1
  173. package/dist/chunk-7EHB43BJ.js +0 -155
  174. package/dist/chunk-7EHB43BJ.js.map +0 -1
  175. package/dist/chunk-7LRD23Q5.js +0 -191
  176. package/dist/chunk-7LRD23Q5.js.map +0 -1
  177. package/dist/chunk-7SAHKOJG.mjs +0 -45
  178. package/dist/chunk-7SAHKOJG.mjs.map +0 -1
  179. package/dist/chunk-A3D2YZK3.js +0 -50
  180. package/dist/chunk-A3D2YZK3.js.map +0 -1
  181. package/dist/chunk-AL4QFH7V.js +0 -63
  182. package/dist/chunk-AL4QFH7V.js.map +0 -1
  183. package/dist/chunk-B3WFEG6U.js +0 -69
  184. package/dist/chunk-B3WFEG6U.js.map +0 -1
  185. package/dist/chunk-BDZQJ6GK.js +0 -242
  186. package/dist/chunk-BDZQJ6GK.js.map +0 -1
  187. package/dist/chunk-BRWFYRGX.js +0 -61
  188. package/dist/chunk-BRWFYRGX.js.map +0 -1
  189. package/dist/chunk-C5DNTLBO.js +0 -53
  190. package/dist/chunk-C5DNTLBO.js.map +0 -1
  191. package/dist/chunk-CRALRACO.js +0 -54
  192. package/dist/chunk-CRALRACO.js.map +0 -1
  193. package/dist/chunk-CVACQJRM.js +0 -149
  194. package/dist/chunk-CVACQJRM.js.map +0 -1
  195. package/dist/chunk-DEIUKFPZ.mjs +0 -63
  196. package/dist/chunk-DEIUKFPZ.mjs.map +0 -1
  197. package/dist/chunk-DN2AEEA2.js +0 -13
  198. package/dist/chunk-DN2AEEA2.js.map +0 -1
  199. package/dist/chunk-DTNRWU4B.mjs +0 -35
  200. package/dist/chunk-DTNRWU4B.mjs.map +0 -1
  201. package/dist/chunk-DXIUEWRJ.mjs +0 -31
  202. package/dist/chunk-DXIUEWRJ.mjs.map +0 -1
  203. package/dist/chunk-DYFV66JX.mjs +0 -54
  204. package/dist/chunk-DYFV66JX.mjs.map +0 -1
  205. package/dist/chunk-F3WMAHXV.mjs +0 -86
  206. package/dist/chunk-F3WMAHXV.mjs.map +0 -1
  207. package/dist/chunk-F4RWPBBB.js +0 -79
  208. package/dist/chunk-F4RWPBBB.js.map +0 -1
  209. package/dist/chunk-FEGAPM6U.js +0 -194
  210. package/dist/chunk-FEGAPM6U.js.map +0 -1
  211. package/dist/chunk-G5TS56PW.mjs +0 -160
  212. package/dist/chunk-G5TS56PW.mjs.map +0 -1
  213. package/dist/chunk-GG6VGOEN.mjs +0 -590
  214. package/dist/chunk-GG6VGOEN.mjs.map +0 -1
  215. package/dist/chunk-GLAMGK32.mjs +0 -54
  216. package/dist/chunk-GLAMGK32.mjs.map +0 -1
  217. package/dist/chunk-GNMMUJXD.mjs +0 -200
  218. package/dist/chunk-GNMMUJXD.mjs.map +0 -1
  219. package/dist/chunk-GNPBULLS.mjs +0 -600
  220. package/dist/chunk-GNPBULLS.mjs.map +0 -1
  221. package/dist/chunk-GTE2DELE.js +0 -65
  222. package/dist/chunk-GTE2DELE.js.map +0 -1
  223. package/dist/chunk-GUQAFFTH.js +0 -94
  224. package/dist/chunk-GUQAFFTH.js.map +0 -1
  225. package/dist/chunk-H5VOYZHT.mjs +0 -34
  226. package/dist/chunk-H5VOYZHT.mjs.map +0 -1
  227. package/dist/chunk-HR6PBOGG.mjs +0 -59
  228. package/dist/chunk-HR6PBOGG.mjs.map +0 -1
  229. package/dist/chunk-HROONQS3.js +0 -55
  230. package/dist/chunk-HROONQS3.js.map +0 -1
  231. package/dist/chunk-IAO7SOQ3.mjs +0 -56
  232. package/dist/chunk-IAO7SOQ3.mjs.map +0 -1
  233. package/dist/chunk-K2QKU3K6.mjs +0 -40
  234. package/dist/chunk-K2QKU3K6.mjs.map +0 -1
  235. package/dist/chunk-KEUZZCCP.js +0 -53
  236. package/dist/chunk-KEUZZCCP.js.map +0 -1
  237. package/dist/chunk-KJXSLTG7.mjs +0 -73
  238. package/dist/chunk-KJXSLTG7.mjs.map +0 -1
  239. package/dist/chunk-L5AFUCVH.mjs +0 -26
  240. package/dist/chunk-L5AFUCVH.mjs.map +0 -1
  241. package/dist/chunk-LB3I52KZ.mjs +0 -42
  242. package/dist/chunk-LB3I52KZ.mjs.map +0 -1
  243. package/dist/chunk-LN75MJQ2.js +0 -71
  244. package/dist/chunk-LN75MJQ2.js.map +0 -1
  245. package/dist/chunk-LRBOFJUV.js +0 -60
  246. package/dist/chunk-LRBOFJUV.js.map +0 -1
  247. package/dist/chunk-MMNYRBOU.js +0 -157
  248. package/dist/chunk-MMNYRBOU.js.map +0 -1
  249. package/dist/chunk-MO65YF6P.js +0 -236
  250. package/dist/chunk-MO65YF6P.js.map +0 -1
  251. package/dist/chunk-N4KHP5FC.mjs +0 -33
  252. package/dist/chunk-N4KHP5FC.mjs.map +0 -1
  253. package/dist/chunk-NP2J7AB7.mjs +0 -121
  254. package/dist/chunk-NP2J7AB7.mjs.map +0 -1
  255. package/dist/chunk-OLR6SGYO.js +0 -57
  256. package/dist/chunk-OLR6SGYO.js.map +0 -1
  257. package/dist/chunk-ON7NQ4DY.js +0 -21
  258. package/dist/chunk-ON7NQ4DY.js.map +0 -1
  259. package/dist/chunk-PE3VFRLV.mjs +0 -198
  260. package/dist/chunk-PE3VFRLV.mjs.map +0 -1
  261. package/dist/chunk-Q7LOOIE5.mjs +0 -8
  262. package/dist/chunk-Q7LOOIE5.mjs.map +0 -1
  263. package/dist/chunk-QFA6U75G.mjs +0 -51
  264. package/dist/chunk-QFA6U75G.mjs.map +0 -1
  265. package/dist/chunk-QJQPT4WX.js +0 -638
  266. package/dist/chunk-QJQPT4WX.js.map +0 -1
  267. package/dist/chunk-QKHQPBSR.mjs +0 -20
  268. package/dist/chunk-QKHQPBSR.mjs.map +0 -1
  269. package/dist/chunk-SJD4XRFJ.mjs +0 -141
  270. package/dist/chunk-SJD4XRFJ.mjs.map +0 -1
  271. package/dist/chunk-SOOJLU4C.mjs +0 -19
  272. package/dist/chunk-SOOJLU4C.mjs.map +0 -1
  273. package/dist/chunk-T66B5IM5.js +0 -51
  274. package/dist/chunk-T66B5IM5.js.map +0 -1
  275. package/dist/chunk-T7RPZDO4.js +0 -645
  276. package/dist/chunk-T7RPZDO4.js.map +0 -1
  277. package/dist/chunk-TGRMDGTV.mjs +0 -38
  278. package/dist/chunk-TGRMDGTV.mjs.map +0 -1
  279. package/dist/chunk-TH2UKMCO.mjs +0 -11
  280. package/dist/chunk-TH2UKMCO.mjs.map +0 -1
  281. package/dist/chunk-TMV45OKE.mjs +0 -113
  282. package/dist/chunk-TMV45OKE.mjs.map +0 -1
  283. package/dist/chunk-TUJ7EVEK.js +0 -171
  284. package/dist/chunk-TUJ7EVEK.js.map +0 -1
  285. package/dist/chunk-ULNWDOI7.js +0 -122
  286. package/dist/chunk-ULNWDOI7.js.map +0 -1
  287. package/dist/chunk-UNUTTHCH.mjs +0 -210
  288. package/dist/chunk-UNUTTHCH.mjs.map +0 -1
  289. package/dist/chunk-VJMI6BG4.mjs +0 -10
  290. package/dist/chunk-VJMI6BG4.mjs.map +0 -1
  291. package/dist/chunk-VZVOB5MG.mjs +0 -26
  292. package/dist/chunk-VZVOB5MG.mjs.map +0 -1
  293. package/dist/chunk-WD67O22C.js +0 -50
  294. package/dist/chunk-WD67O22C.js.map +0 -1
  295. package/dist/chunk-WYPMLIJN.js +0 -53
  296. package/dist/chunk-WYPMLIJN.js.map +0 -1
  297. package/dist/chunk-X32I34NH.js +0 -109
  298. package/dist/chunk-X32I34NH.js.map +0 -1
  299. package/dist/chunk-X5MOZ3YL.js +0 -65
  300. package/dist/chunk-X5MOZ3YL.js.map +0 -1
  301. package/dist/chunk-Y4JVIPQZ.mjs +0 -31
  302. package/dist/chunk-Y4JVIPQZ.mjs.map +0 -1
  303. package/dist/chunk-Y6WOV2LZ.js +0 -95
  304. package/dist/chunk-Y6WOV2LZ.js.map +0 -1
  305. package/dist/chunk-YAEN5SCU.mjs +0 -41
  306. package/dist/chunk-YAEN5SCU.mjs.map +0 -1
  307. package/dist/chunk-YH6XDF3N.js +0 -121
  308. package/dist/chunk-YH6XDF3N.js.map +0 -1
  309. package/dist/chunk-YJKA4D75.mjs +0 -124
  310. package/dist/chunk-YJKA4D75.mjs.map +0 -1
  311. package/dist/chunk-ZANAF7WB.js +0 -88
  312. package/dist/chunk-ZANAF7WB.js.map +0 -1
  313. package/dist/chunk-ZDBWNPLO.js +0 -30
  314. package/dist/chunk-ZDBWNPLO.js.map +0 -1
  315. package/dist/chunk-ZDT2IOK2.js +0 -56
  316. package/dist/chunk-ZDT2IOK2.js.map +0 -1
  317. package/dist/chunk-ZKGVLTSI.js +0 -25
  318. package/dist/chunk-ZKGVLTSI.js.map +0 -1
  319. package/dist/chunk-ZLELESO7.js +0 -34
  320. package/dist/chunk-ZLELESO7.js.map +0 -1
  321. package/dist/chunk-ZUFUEQTX.mjs +0 -157
  322. package/dist/chunk-ZUFUEQTX.mjs.map +0 -1
  323. package/dist/chunk-ZZZWRQQE.mjs +0 -42
  324. package/dist/chunk-ZZZWRQQE.mjs.map +0 -1
  325. package/dist/command/index.js +0 -138
  326. package/dist/command/index.js.map +0 -1
  327. package/dist/command/index.mjs +0 -128
  328. package/dist/command/index.mjs.map +0 -1
  329. package/dist/components/accordion.js +0 -25
  330. package/dist/components/accordion.js.map +0 -1
  331. package/dist/components/accordion.mjs +0 -4
  332. package/dist/components/accordion.mjs.map +0 -1
  333. package/dist/components/alert.js +0 -21
  334. package/dist/components/alert.js.map +0 -1
  335. package/dist/components/alert.mjs +0 -4
  336. package/dist/components/alert.mjs.map +0 -1
  337. package/dist/components/aspect-ratio.js +0 -12
  338. package/dist/components/aspect-ratio.js.map +0 -1
  339. package/dist/components/aspect-ratio.mjs +0 -3
  340. package/dist/components/aspect-ratio.mjs.map +0 -1
  341. package/dist/components/avatar.js +0 -21
  342. package/dist/components/avatar.js.map +0 -1
  343. package/dist/components/avatar.mjs +0 -4
  344. package/dist/components/avatar.mjs.map +0 -1
  345. package/dist/components/badge.js +0 -17
  346. package/dist/components/badge.js.map +0 -1
  347. package/dist/components/badge.mjs +0 -4
  348. package/dist/components/badge.mjs.map +0 -1
  349. package/dist/components/breadcrumb.js +0 -37
  350. package/dist/components/breadcrumb.js.map +0 -1
  351. package/dist/components/breadcrumb.mjs +0 -4
  352. package/dist/components/breadcrumb.mjs.map +0 -1
  353. package/dist/components/button.js +0 -17
  354. package/dist/components/button.js.map +0 -1
  355. package/dist/components/button.mjs +0 -4
  356. package/dist/components/button.mjs.map +0 -1
  357. package/dist/components/card.js +0 -37
  358. package/dist/components/card.js.map +0 -1
  359. package/dist/components/card.mjs +0 -4
  360. package/dist/components/card.mjs.map +0 -1
  361. package/dist/components/checkbox.js +0 -13
  362. package/dist/components/checkbox.js.map +0 -1
  363. package/dist/components/checkbox.mjs +0 -4
  364. package/dist/components/checkbox.mjs.map +0 -1
  365. package/dist/components/collapsible.js +0 -20
  366. package/dist/components/collapsible.js.map +0 -1
  367. package/dist/components/collapsible.mjs +0 -3
  368. package/dist/components/collapsible.mjs.map +0 -1
  369. package/dist/components/context-menu.js +0 -69
  370. package/dist/components/context-menu.js.map +0 -1
  371. package/dist/components/context-menu.mjs +0 -4
  372. package/dist/components/context-menu.mjs.map +0 -1
  373. package/dist/components/dialog.js +0 -49
  374. package/dist/components/dialog.js.map +0 -1
  375. package/dist/components/dialog.mjs +0 -4
  376. package/dist/components/dialog.mjs.map +0 -1
  377. package/dist/components/drawer.js +0 -49
  378. package/dist/components/drawer.js.map +0 -1
  379. package/dist/components/drawer.mjs +0 -4
  380. package/dist/components/drawer.mjs.map +0 -1
  381. package/dist/components/dropdown-menu.js +0 -69
  382. package/dist/components/dropdown-menu.js.map +0 -1
  383. package/dist/components/dropdown-menu.mjs +0 -4
  384. package/dist/components/dropdown-menu.mjs.map +0 -1
  385. package/dist/components/form.js +0 -42
  386. package/dist/components/form.js.map +0 -1
  387. package/dist/components/form.mjs +0 -5
  388. package/dist/components/form.mjs.map +0 -1
  389. package/dist/components/hover-card.js +0 -21
  390. package/dist/components/hover-card.js.map +0 -1
  391. package/dist/components/hover-card.mjs +0 -4
  392. package/dist/components/hover-card.mjs.map +0 -1
  393. package/dist/components/index.js +0 -1047
  394. package/dist/components/index.js.map +0 -1
  395. package/dist/components/index.mjs +0 -46
  396. package/dist/components/index.mjs.map +0 -1
  397. package/dist/components/input-otp.js +0 -25
  398. package/dist/components/input-otp.js.map +0 -1
  399. package/dist/components/input-otp.mjs +0 -4
  400. package/dist/components/input-otp.mjs.map +0 -1
  401. package/dist/components/input.js +0 -13
  402. package/dist/components/input.js.map +0 -1
  403. package/dist/components/input.mjs +0 -4
  404. package/dist/components/input.mjs.map +0 -1
  405. package/dist/components/label.js +0 -13
  406. package/dist/components/label.js.map +0 -1
  407. package/dist/components/label.mjs +0 -4
  408. package/dist/components/label.mjs.map +0 -1
  409. package/dist/components/menubar.js +0 -73
  410. package/dist/components/menubar.js.map +0 -1
  411. package/dist/components/menubar.mjs +0 -4
  412. package/dist/components/menubar.mjs.map +0 -1
  413. package/dist/components/navigation-menu.js +0 -45
  414. package/dist/components/navigation-menu.js.map +0 -1
  415. package/dist/components/navigation-menu.mjs +0 -4
  416. package/dist/components/navigation-menu.mjs.map +0 -1
  417. package/dist/components/pagination.js +0 -38
  418. package/dist/components/pagination.js.map +0 -1
  419. package/dist/components/pagination.mjs +0 -5
  420. package/dist/components/pagination.mjs.map +0 -1
  421. package/dist/components/popover.js +0 -25
  422. package/dist/components/popover.js.map +0 -1
  423. package/dist/components/popover.mjs +0 -4
  424. package/dist/components/popover.mjs.map +0 -1
  425. package/dist/components/progress.js +0 -13
  426. package/dist/components/progress.js.map +0 -1
  427. package/dist/components/progress.mjs +0 -4
  428. package/dist/components/progress.mjs.map +0 -1
  429. package/dist/components/radio-group.js +0 -17
  430. package/dist/components/radio-group.js.map +0 -1
  431. package/dist/components/radio-group.mjs +0 -4
  432. package/dist/components/radio-group.mjs.map +0 -1
  433. package/dist/components/resizable.js +0 -21
  434. package/dist/components/resizable.js.map +0 -1
  435. package/dist/components/resizable.mjs +0 -4
  436. package/dist/components/resizable.mjs.map +0 -1
  437. package/dist/components/scroll-area.js +0 -17
  438. package/dist/components/scroll-area.js.map +0 -1
  439. package/dist/components/scroll-area.mjs +0 -4
  440. package/dist/components/scroll-area.mjs.map +0 -1
  441. package/dist/components/select.js +0 -49
  442. package/dist/components/select.js.map +0 -1
  443. package/dist/components/select.mjs +0 -4
  444. package/dist/components/select.mjs.map +0 -1
  445. package/dist/components/separator.js +0 -13
  446. package/dist/components/separator.js.map +0 -1
  447. package/dist/components/separator.mjs +0 -4
  448. package/dist/components/separator.mjs.map +0 -1
  449. package/dist/components/sheet.js +0 -49
  450. package/dist/components/sheet.js.map +0 -1
  451. package/dist/components/sheet.mjs +0 -4
  452. package/dist/components/sheet.mjs.map +0 -1
  453. package/dist/components/sidebar.js +0 -111
  454. package/dist/components/sidebar.js.map +0 -1
  455. package/dist/components/sidebar.mjs +0 -10
  456. package/dist/components/sidebar.mjs.map +0 -1
  457. package/dist/components/skeleton.js +0 -13
  458. package/dist/components/skeleton.js.map +0 -1
  459. package/dist/components/skeleton.mjs +0 -4
  460. package/dist/components/skeleton.mjs.map +0 -1
  461. package/dist/components/slider.js +0 -13
  462. package/dist/components/slider.js.map +0 -1
  463. package/dist/components/slider.mjs +0 -4
  464. package/dist/components/slider.mjs.map +0 -1
  465. package/dist/components/switch.js +0 -13
  466. package/dist/components/switch.js.map +0 -1
  467. package/dist/components/switch.mjs +0 -4
  468. package/dist/components/switch.mjs.map +0 -1
  469. package/dist/components/table.js +0 -41
  470. package/dist/components/table.js.map +0 -1
  471. package/dist/components/table.mjs +0 -4
  472. package/dist/components/table.mjs.map +0 -1
  473. package/dist/components/tabs.js +0 -25
  474. package/dist/components/tabs.js.map +0 -1
  475. package/dist/components/tabs.mjs +0 -4
  476. package/dist/components/tabs.mjs.map +0 -1
  477. package/dist/components/textarea.js +0 -13
  478. package/dist/components/textarea.js.map +0 -1
  479. package/dist/components/textarea.mjs +0 -4
  480. package/dist/components/textarea.mjs.map +0 -1
  481. package/dist/components/toast.js +0 -37
  482. package/dist/components/toast.js.map +0 -1
  483. package/dist/components/toast.mjs +0 -4
  484. package/dist/components/toast.mjs.map +0 -1
  485. package/dist/components/toggle-group.js +0 -18
  486. package/dist/components/toggle-group.js.map +0 -1
  487. package/dist/components/toggle-group.mjs +0 -5
  488. package/dist/components/toggle-group.mjs.map +0 -1
  489. package/dist/components/toggle.js +0 -17
  490. package/dist/components/toggle.js.map +0 -1
  491. package/dist/components/toggle.mjs +0 -4
  492. package/dist/components/toggle.mjs.map +0 -1
  493. package/dist/components/tooltip.js +0 -25
  494. package/dist/components/tooltip.js.map +0 -1
  495. package/dist/components/tooltip.mjs +0 -4
  496. package/dist/components/tooltip.mjs.map +0 -1
  497. package/dist/effects/index.js +0 -162
  498. package/dist/effects/index.js.map +0 -1
  499. package/dist/effects/index.mjs +0 -156
  500. package/dist/effects/index.mjs.map +0 -1
  501. package/dist/index.js.map +0 -1
  502. package/dist/index.mjs.map +0 -1
  503. package/dist/lib/utils.js.map +0 -1
  504. package/dist/lib/utils.mjs.map +0 -1
  505. package/dist/markdown/index.js +0 -669
  506. package/dist/markdown/index.js.map +0 -1
  507. package/dist/markdown/index.mjs +0 -635
  508. package/dist/markdown/index.mjs.map +0 -1
  509. package/dist/qr/index.js +0 -101
  510. package/dist/qr/index.js.map +0 -1
  511. package/dist/qr/index.mjs +0 -98
  512. package/dist/qr/index.mjs.map +0 -1
  513. package/dist/upload/index.js +0 -166
  514. package/dist/upload/index.js.map +0 -1
  515. package/dist/upload/index.mjs +0 -163
  516. package/dist/upload/index.mjs.map +0 -1
  517. package/publish.sh +0 -27
@@ -1,635 +0,0 @@
1
- import { CopyToClipboardIcon } from '../chunk-KJXSLTG7.mjs';
2
- import { Tooltip, TooltipTrigger, TooltipContent } from '../chunk-VZVOB5MG.mjs';
3
- import { Button } from '../chunk-QFA6U75G.mjs';
4
- import { cn } from '../chunk-TH2UKMCO.mjs';
5
- import { createContext, memo, useContext, useMemo, useRef, useState, useCallback, useEffect } from 'react';
6
- import ReactMarkdown from 'react-markdown';
7
- import { PrismAsyncLight } from 'react-syntax-highlighter';
8
- import python from 'react-syntax-highlighter/dist/esm/languages/prism/python';
9
- import tsx from 'react-syntax-highlighter/dist/esm/languages/prism/tsx';
10
- import github from 'react-syntax-highlighter/dist/esm/styles/hljs/github';
11
- import rehypeKatex from 'rehype-katex';
12
- import remarkGfm from 'remark-gfm';
13
- import remarkMath from 'remark-math';
14
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
15
- import { RotateCcw, Download } from 'lucide-react';
16
- import mermaid from 'mermaid';
17
- import { toast } from 'sonner';
18
- import svgPanZoom from 'svg-pan-zoom';
19
-
20
- var areChildrenEqual = (prev, next) => {
21
- if (typeof prev === "string") return prev === next;
22
- return JSON.stringify(prev) === JSON.stringify(next);
23
- };
24
- var areNodesEqual = (prev, next) => {
25
- if (!prev || !next) return false;
26
- const isEqual = JSON.stringify(prev?.properties) === JSON.stringify(next?.properties) && areChildrenEqual(prev?.children, next?.children);
27
- return isEqual;
28
- };
29
- var memoCompareNodes = (prev, next) => {
30
- return areNodesEqual(prev.node, next.node);
31
- };
32
- var memoizeMarkdownComponents = (components = {}) => {
33
- return Object.fromEntries(
34
- Object.entries(components ?? {}).map(([key, value]) => {
35
- if (!value) return [key, value];
36
- const Component = value;
37
- const WithoutNode = ({ node, ...props }) => {
38
- return /* @__PURE__ */ jsx(Component, { ...props });
39
- };
40
- return [key, memo(WithoutNode, memoCompareNodes)];
41
- })
42
- );
43
- };
44
- mermaid.initialize({
45
- startOnLoad: true,
46
- mindmap: {
47
- useWidth: 800
48
- },
49
- theme: "dark",
50
- fontSize: 18,
51
- darkMode: true,
52
- fontFamily: "Inter"
53
- });
54
- var generateId = () => `mermaid-${Math.random().toString(36).slice(2)}`;
55
- var downloadBlob = async (blob, filename) => {
56
- try {
57
- const url = URL.createObjectURL(blob);
58
- const link = document.createElement("a");
59
- link.href = url;
60
- link.download = filename;
61
- document.body.appendChild(link);
62
- link.click();
63
- document.body.removeChild(link);
64
- URL.revokeObjectURL(url);
65
- toast.success("Mermaid diagram saved successfully");
66
- } catch (error) {
67
- toast.error("Failed to save diagram");
68
- console.error("Download error:", error);
69
- }
70
- };
71
- var MermaidDiagram = ({
72
- code,
73
- className,
74
- isRunning
75
- }) => {
76
- const ref = useRef(null);
77
- const lastCode = useRef(null);
78
- const [instance, setInstance] = useState(null);
79
- const isComplete = !isRunning;
80
- const resetZoom = useCallback(() => {
81
- instance?.fit();
82
- instance?.center();
83
- }, [instance]);
84
- const downloadSVG = useCallback(() => {
85
- if (ref.current) {
86
- const svg = ref.current.innerHTML;
87
- const blob = new Blob([svg], { type: "image/svg+xml" });
88
- void downloadBlob(blob, "mermaid-diagram.svg");
89
- }
90
- }, []);
91
- const enableZoom = useCallback(() => {
92
- instance?.enablePan();
93
- instance?.enableZoom();
94
- }, [instance]);
95
- const disableZoom = useCallback(() => {
96
- instance?.disablePan();
97
- instance?.disableZoom();
98
- }, [instance]);
99
- const handleFocus = useCallback(() => {
100
- enableZoom();
101
- }, [enableZoom]);
102
- const handleBlur = useCallback(() => {
103
- disableZoom();
104
- }, [disableZoom]);
105
- const handleClick = useCallback(() => {
106
- if (ref.current) {
107
- ref.current.focus();
108
- }
109
- }, []);
110
- useEffect(() => {
111
- if (!isComplete || !ref.current || !code) return;
112
- if (lastCode.current === code) return;
113
- void (async () => {
114
- try {
115
- const id = generateId();
116
- const { svg } = await mermaid.render(id, code);
117
- if (ref.current) {
118
- ref.current.innerHTML = svg;
119
- const svgElement = ref.current.querySelector("svg");
120
- if (svgElement) {
121
- svgElement.setAttribute("height", "100%");
122
- svgElement.setAttribute("width", "100%");
123
- svgElement.style.height = "100%";
124
- svgElement.style.width = "100%";
125
- svgElement.style.position = "absolute";
126
- svgElement.style.top = "0";
127
- svgElement.style.left = "0";
128
- const panZoomInstance = svgPanZoom(svgElement);
129
- panZoomInstance.fit();
130
- panZoomInstance.center();
131
- panZoomInstance.zoomAtPoint(1, { x: 0, y: 0 });
132
- panZoomInstance.disablePan();
133
- panZoomInstance.disableZoom();
134
- setInstance(panZoomInstance);
135
- }
136
- }
137
- lastCode.current = code;
138
- } catch (e) {
139
- }
140
- })();
141
- }, [code, isComplete]);
142
- return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
143
- /* @__PURE__ */ jsxs("div", { className: "absolute top-2 right-2 z-10 flex gap-1", children: [
144
- /* @__PURE__ */ jsxs(Tooltip, { children: [
145
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
146
- Button,
147
- {
148
- variant: "tertiary",
149
- size: "icon",
150
- onClick: resetZoom,
151
- className: "text-text-secondary",
152
- children: /* @__PURE__ */ jsx(RotateCcw, { size: 14 })
153
- }
154
- ) }),
155
- /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Reset Zoom" }) })
156
- ] }),
157
- /* @__PURE__ */ jsxs(Tooltip, { children: [
158
- /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
159
- Button,
160
- {
161
- variant: "tertiary",
162
- size: "icon",
163
- onClick: downloadSVG,
164
- className: "text-text-secondary",
165
- children: /* @__PURE__ */ jsx(Download, { size: 14 })
166
- }
167
- ) }),
168
- /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsx("p", { children: "Download SVG" }) })
169
- ] })
170
- ] }),
171
- /* @__PURE__ */ jsx(
172
- "div",
173
- {
174
- onClick: handleClick,
175
- className: "text-text-secondary bg-bg-quaternary absolute right-2 bottom-2 z-10 rounded px-2 py-1 text-xs",
176
- children: "Click to focus, then scroll to zoom & drag to pan"
177
- }
178
- ),
179
- /* @__PURE__ */ jsx(
180
- "div",
181
- {
182
- ref,
183
- tabIndex: 0,
184
- onFocus: handleFocus,
185
- onBlur: handleBlur,
186
- onClick: handleClick,
187
- className: cn(
188
- "text-text-secondary bg-bg-quaternary focus:ring-opacity-50 relative w-full cursor-grab overflow-hidden rounded-b-lg p-4 py-10 text-center text-sm focus:cursor-grabbing focus:ring-2 focus:ring-blue-500 focus:outline-none",
189
- className
190
- ),
191
- style: { width: "100%", minHeight: "400px" },
192
- children: "Drawing diagram..."
193
- }
194
- )
195
- ] });
196
- };
197
- function useCallbackRef(callback) {
198
- const callbackRef = useRef(callback);
199
- callbackRef.current = callback;
200
- return useCallback((...args) => callbackRef.current?.(...args), []);
201
- }
202
- var CodeHeader = ({ language, code }) => {
203
- return /* @__PURE__ */ jsxs("div", { className: "code-header-root bg-bg-darker text-text-default flex items-center justify-between gap-4 rounded-t-lg px-4 py-1", children: [
204
- /* @__PURE__ */ jsx("span", { className: "code-header-language text-text-secondary text-xs font-medium lowercase", children: language }),
205
- /* @__PURE__ */ jsx(
206
- CopyToClipboardIcon,
207
- {
208
- className: cn(
209
- "text-text-secondary h-7 w-7 bg-transparent hover:bg-gray-900 [&>svg]:h-3 [&>svg]:w-3"
210
- ),
211
- string: code
212
- }
213
- )
214
- ] });
215
- };
216
- var makeMakeSyntaxHighlighter = (SyntaxHighlighter) => (config) => {
217
- const PrismSyntaxHighlighter = ({
218
- components: { Pre, Code: Code2 },
219
- language,
220
- code
221
- }) => {
222
- return /* @__PURE__ */ jsx(
223
- SyntaxHighlighter,
224
- {
225
- CodeTag: Code2,
226
- PreTag: Pre,
227
- ...config,
228
- language,
229
- children: code
230
- }
231
- );
232
- };
233
- PrismSyntaxHighlighter.displayName = "PrismSyntaxHighlighter";
234
- return PrismSyntaxHighlighter;
235
- };
236
- PrismAsyncLight.registerLanguage("js", tsx);
237
- PrismAsyncLight.registerLanguage("jsx", tsx);
238
- PrismAsyncLight.registerLanguage("ts", tsx);
239
- PrismAsyncLight.registerLanguage("tsx", tsx);
240
- PrismAsyncLight.registerLanguage("python", python);
241
- var makePrismAsyncLightSyntaxHighlighter = makeMakeSyntaxHighlighter(PrismAsyncLight);
242
- var SyntaxHighlighterBase = makePrismAsyncLightSyntaxHighlighter({
243
- style: github,
244
- customStyle: {
245
- margin: 0,
246
- width: "100%",
247
- background: "var(--color-bg-darker)",
248
- padding: "1.5rem 1rem",
249
- fontSize: "0.875em"
250
- }
251
- });
252
- var defaultComponents = memoizeMarkdownComponents({
253
- h1: ({ className, ...props }) => /* @__PURE__ */ jsx(
254
- "h1",
255
- {
256
- className: cn(
257
- "mt-[1em] mb-[0.7em] scroll-m-20 text-[1.375rem] font-bold last:mb-0",
258
- className
259
- ),
260
- ...props
261
- }
262
- ),
263
- h2: ({ className, ...props }) => /* @__PURE__ */ jsx(
264
- "h2",
265
- {
266
- className: cn(
267
- "text-em-xl mt-[0.8em] mb-[0.4em] scroll-m-20 font-semibold first:mt-0 last:mb-0",
268
- className
269
- ),
270
- ...props
271
- }
272
- ),
273
- h3: ({ className, ...props }) => /* @__PURE__ */ jsx(
274
- "h3",
275
- {
276
- className: cn(
277
- "text-em-lg mt-[1em] mb-[0.5em] scroll-m-20 font-semibold first:mt-0 last:mb-0",
278
- className
279
- ),
280
- ...props
281
- }
282
- ),
283
- h4: ({ className, ...props }) => /* @__PURE__ */ jsx(
284
- "h4",
285
- {
286
- className: cn(
287
- "text-em-base mt-[1em] mb-[0.5em] scroll-m-20 font-semibold first:mt-0 last:mb-0",
288
- className
289
- ),
290
- ...props
291
- }
292
- ),
293
- h5: ({ className, ...props }) => /* @__PURE__ */ jsx(
294
- "h5",
295
- {
296
- className: cn(
297
- "text-em-base mt-[1em] mb-[0.5em] font-semibold first:mt-0 last:mb-0",
298
- className
299
- ),
300
- ...props
301
- }
302
- ),
303
- h6: ({ className, ...props }) => /* @__PURE__ */ jsx(
304
- "h6",
305
- {
306
- className: cn(
307
- "text-em-base mt-[1em] mb-[0.5em] font-semibold first:mt-0 last:mb-0",
308
- className
309
- ),
310
- ...props
311
- }
312
- ),
313
- p: ({ className, ...props }) => /* @__PURE__ */ jsx(
314
- "p",
315
- {
316
- className: cn("text-em-base my-[0.5em] first:mt-0 last:mb-0", className),
317
- ...props
318
- }
319
- ),
320
- a: ({ className, ...props }) => /* @__PURE__ */ jsx(
321
- "a",
322
- {
323
- className: cn(
324
- "font-medium text-blue-400 underline underline-offset-4",
325
- className
326
- ),
327
- target: "_blank",
328
- ...props
329
- }
330
- ),
331
- blockquote: ({ className, ...props }) => /* @__PURE__ */ jsx(
332
- "blockquote",
333
- {
334
- className: cn("border-l-2 pl-6 italic", className),
335
- ...props
336
- }
337
- ),
338
- ul: ({ className, ...props }) => /* @__PURE__ */ jsx(
339
- "ul",
340
- {
341
- className: cn(
342
- "text-em-base my-[1em] ml-6 list-disc [&>li]:mt-2",
343
- className
344
- ),
345
- ...props
346
- }
347
- ),
348
- ol: ({ className, ...props }) => /* @__PURE__ */ jsx(
349
- "ol",
350
- {
351
- className: cn(
352
- "text-em-base my-[1em] ml-6 list-decimal [&>li]:mt-[0.5em]",
353
- className
354
- ),
355
- ...props
356
- }
357
- ),
358
- hr: ({ className, ...props }) => /* @__PURE__ */ jsx(
359
- "hr",
360
- {
361
- className: cn("border-divider my-[2.25em] border-b", className),
362
- ...props
363
- }
364
- ),
365
- table: ({ className, ...props }) => /* @__PURE__ */ jsx("div", { className: "my-[1.5em] size-full overflow-x-auto", children: /* @__PURE__ */ jsx("table", { className: "w-full border-collapse border-spacing-0", ...props }) }),
366
- thead: ({ className, ...props }) => /* @__PURE__ */ jsx("thead", { className: cn("[&>tr]:border-none", className), ...props }),
367
- th: ({ className, ...props }) => /* @__PURE__ */ jsx(
368
- "th",
369
- {
370
- className: cn(
371
- "text-em-sm px-[1em] py-[0.875em] text-left font-semibold first:rounded-tl-lg last:rounded-tr-lg [&[align=center]]:text-center [&[align=right]]:text-right",
372
- className
373
- ),
374
- ...props
375
- }
376
- ),
377
- td: ({ className, ...props }) => /* @__PURE__ */ jsx(
378
- "td",
379
- {
380
- className: cn(
381
- "text-em-sm border-divider border-b px-[1em] py-[0.875em] text-left [&[align=center]]:text-center [&[align=right]]:text-right",
382
- className
383
- ),
384
- ...props
385
- }
386
- ),
387
- tr: ({ className, ...props }) => /* @__PURE__ */ jsx(
388
- "tr",
389
- {
390
- className: cn(
391
- "m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",
392
- className
393
- ),
394
- ...props
395
- }
396
- ),
397
- sup: ({ className, ...props }) => /* @__PURE__ */ jsx(
398
- "sup",
399
- {
400
- className: cn("[&>a]:text-em-xs [&>a]:no-underline", className),
401
- ...props
402
- }
403
- ),
404
- pre: ({ className, ...props }) => /* @__PURE__ */ jsx(
405
- "pre",
406
- {
407
- className: cn(
408
- "bg-bg-darker text-text-default overflow-x-auto rounded-b-lg !px-[1em] !py-[0.5em]",
409
- className
410
- ),
411
- ...props
412
- }
413
- ),
414
- code: function Code({ className, ...props }) {
415
- const isCodeBlock = useIsMarkdownCodeBlock();
416
- return /* @__PURE__ */ jsx(
417
- "code",
418
- {
419
- className: cn(
420
- !isCodeBlock && "bg-bg-darker text-em-sm border-divider rounded-sm p-[0.25em] font-semibold",
421
- className
422
- ),
423
- ...props
424
- }
425
- );
426
- },
427
- CodeHeader,
428
- SyntaxHighlighter: SyntaxHighlighterBase
429
- });
430
- var PreContext = createContext(null);
431
- var IsRunningContext = createContext(void 0);
432
- var useIsMarkdownCodeBlock = () => {
433
- return useContext(PreContext) !== null;
434
- };
435
- var useIsRunning = () => {
436
- return useContext(IsRunningContext);
437
- };
438
- var PreOverride = ({ children, ...rest }) => {
439
- return /* @__PURE__ */ jsx(PreContext.Provider, { value: rest, children });
440
- };
441
- var DefaultPre = ({
442
- className,
443
- ...rest
444
- }) => /* @__PURE__ */ jsx("pre", { className, ...rest });
445
- var DefaultCode = ({
446
- className,
447
- ...rest
448
- }) => /* @__PURE__ */ jsx("code", { className, ...rest });
449
- var DefaultCodeBlockContent = ({ node, components: { Pre, Code: Code2 }, code }) => /* @__PURE__ */ jsx(Pre, { children: /* @__PURE__ */ jsx(Code2, { node, children: code }) });
450
- var DefaultCodeHeader = () => null;
451
- var DefaultCodeBlock = ({
452
- node,
453
- components: { Pre, Code: Code2, SyntaxHighlighter, CodeHeader: CodeHeader2 },
454
- language,
455
- code,
456
- isRunning
457
- }) => {
458
- const components = useMemo(() => ({ Pre, Code: Code2 }), [Pre, Code2]);
459
- const SH = !!language ? SyntaxHighlighter : DefaultCodeBlockContent;
460
- return /* @__PURE__ */ jsxs(Fragment, { children: [
461
- /* @__PURE__ */ jsx(CodeHeader2, { node, language, code }),
462
- /* @__PURE__ */ jsx(
463
- SH,
464
- {
465
- node,
466
- components,
467
- language: language ?? "unknown",
468
- code,
469
- isRunning
470
- }
471
- )
472
- ] });
473
- };
474
- var withDefaultProps = ({
475
- className,
476
- ...defaultProps
477
- }) => ({ className: classNameProp, ...props }) => {
478
- return {
479
- className: cn(className, classNameProp),
480
- ...defaultProps,
481
- ...props
482
- };
483
- };
484
- var CodeBlockOverride = ({
485
- node,
486
- components: {
487
- Pre,
488
- Code: Code2,
489
- SyntaxHighlighter: FallbackSyntaxHighlighter,
490
- CodeHeader: FallbackCodeHeader
491
- },
492
- componentsByLanguage = {},
493
- children,
494
- ...codeProps
495
- }) => {
496
- const preProps = useContext(PreContext);
497
- const isRunning = useIsRunning();
498
- const getPreProps = withDefaultProps(preProps);
499
- const WrappedPre = useCallbackRef((props) => /* @__PURE__ */ jsx(Pre, { ...getPreProps(props) }));
500
- const getCodeProps = withDefaultProps(codeProps);
501
- const WrappedCode = useCallbackRef((props) => /* @__PURE__ */ jsx(Code2, { ...getCodeProps(props) }));
502
- const language = /language-(\w+)/.exec(codeProps.className || "")?.[1] ?? "";
503
- if (typeof children !== "string") {
504
- return /* @__PURE__ */ jsx(
505
- DefaultCodeBlockContent,
506
- {
507
- code: children,
508
- components: { Pre: WrappedPre, Code: WrappedCode },
509
- node
510
- }
511
- );
512
- }
513
- const SyntaxHighlighter = componentsByLanguage[language]?.SyntaxHighlighter ?? FallbackSyntaxHighlighter;
514
- const CodeHeader2 = componentsByLanguage[language]?.CodeHeader ?? FallbackCodeHeader;
515
- return /* @__PURE__ */ jsx(
516
- DefaultCodeBlock,
517
- {
518
- node,
519
- components: {
520
- Pre: WrappedPre,
521
- Code: WrappedCode,
522
- SyntaxHighlighter,
523
- CodeHeader: CodeHeader2
524
- },
525
- language: language || "unknown",
526
- code: children,
527
- isRunning
528
- }
529
- );
530
- };
531
- var CodeOverrideBase = ({
532
- node,
533
- components,
534
- componentsByLanguage,
535
- ...props
536
- }) => {
537
- const isCodeBlock = useContext(PreContext) !== null;
538
- if (!isCodeBlock) return /* @__PURE__ */ jsx(components.Code, { ...props });
539
- return /* @__PURE__ */ jsx(
540
- CodeBlockOverride,
541
- {
542
- components,
543
- componentsByLanguage,
544
- node,
545
- ...props
546
- }
547
- );
548
- };
549
- var CodeOverride = memo(CodeOverrideBase, (prev, next) => {
550
- const isEqual = prev.components === next.components && prev.componentsByLanguage === next.componentsByLanguage && memoCompareNodes(prev, next);
551
- return isEqual;
552
- });
553
- var MarkdownTextPrimitive = ({
554
- components: userComponents,
555
- className,
556
- containerProps,
557
- containerComponent: Container = "div",
558
- content,
559
- componentsByLanguage,
560
- ref,
561
- isRunning,
562
- ...rest
563
- }) => {
564
- const {
565
- pre = DefaultPre,
566
- code = DefaultCode,
567
- SyntaxHighlighter = DefaultCodeBlockContent,
568
- CodeHeader: CodeHeader2 = DefaultCodeHeader
569
- } = userComponents ?? {};
570
- const useCodeOverrideComponents = useMemo(() => {
571
- return {
572
- Pre: pre,
573
- Code: code,
574
- SyntaxHighlighter,
575
- CodeHeader: CodeHeader2
576
- };
577
- }, [pre, code, SyntaxHighlighter, CodeHeader2]);
578
- const CodeComponent = useCallbackRef((props) => /* @__PURE__ */ jsx(
579
- CodeOverride,
580
- {
581
- components: useCodeOverrideComponents,
582
- componentsByLanguage,
583
- ...props
584
- }
585
- ));
586
- const components = useMemo(() => {
587
- const { pre: pre2, code: code2, SyntaxHighlighter: SyntaxHighlighter2, CodeHeader: CodeHeader3, ...componentsRest } = userComponents ?? {};
588
- return {
589
- ...componentsRest,
590
- pre: PreOverride,
591
- code: CodeComponent
592
- };
593
- }, [CodeComponent, userComponents]);
594
- return /* @__PURE__ */ jsx(
595
- Container,
596
- {
597
- ...containerProps,
598
- className: cn(className, containerProps?.className),
599
- ref,
600
- children: /* @__PURE__ */ jsx(IsRunningContext.Provider, { value: isRunning, children: /* @__PURE__ */ jsx(ReactMarkdown, { components, ...rest, children: content }) })
601
- }
602
- );
603
- };
604
- MarkdownTextPrimitive.displayName = "MarkdownTextPrimitive";
605
- var MarkdownTextBase = ({
606
- className,
607
- isRunning,
608
- components: userComponents,
609
- ...rest
610
- }) => {
611
- return /* @__PURE__ */ jsx(
612
- MarkdownTextPrimitive,
613
- {
614
- components: defaultComponents,
615
- remarkPlugins: [remarkGfm, remarkMath],
616
- rehypePlugins: [rehypeKatex],
617
- className: cn(isRunning && "md-running", className),
618
- isRunning,
619
- componentsByLanguage: {
620
- mermaid: {
621
- SyntaxHighlighter: MermaidDiagram
622
- }
623
- },
624
- ...rest
625
- }
626
- );
627
- };
628
- var MarkdownText = memo(
629
- MarkdownTextBase,
630
- (prev, next) => prev.content === next.content && prev.isRunning === next.isRunning && prev.className === next.className
631
- );
632
-
633
- export { CodeHeader, CodeOverride, CodeOverrideBase, DefaultCode, DefaultCodeBlock, DefaultCodeBlockContent, DefaultCodeHeader, DefaultPre, IsRunningContext, MarkdownText, MarkdownTextBase, MarkdownTextPrimitive, MermaidDiagram, PreContext, PreOverride, SyntaxHighlighterBase, defaultComponents, makePrismAsyncLightSyntaxHighlighter, useIsMarkdownCodeBlock, useIsRunning, withDefaultProps };
634
- //# sourceMappingURL=index.mjs.map
635
- //# sourceMappingURL=index.mjs.map