xertica-ui 2.1.2 → 2.1.3

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 (402) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +1 -1
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +1 -1
  6. package/bin/generate-tokens.ts +13 -7
  7. package/components/assistant/index.ts +6 -6
  8. package/components/assistant/xertica-assistant/index.ts +2 -0
  9. package/components/assistant/xertica-assistant/use-assistant.ts +564 -0
  10. package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +200 -0
  11. package/components/assistant/xertica-assistant/xertica-assistant.tsx +183 -474
  12. package/components/blocks/card-patterns/ActivityCard.tsx +72 -72
  13. package/components/blocks/card-patterns/FeatureCard.tsx +100 -100
  14. package/components/blocks/card-patterns/NotificationCard.tsx +127 -127
  15. package/components/blocks/card-patterns/ProfileCard.tsx +84 -84
  16. package/components/blocks/card-patterns/ProjectCard.tsx +89 -89
  17. package/components/blocks/card-patterns/QuickActionCard.tsx +62 -62
  18. package/components/blocks/card-patterns/card-patterns.stories.tsx +445 -445
  19. package/components/blocks/card-patterns/index.ts +17 -17
  20. package/components/blocks/index.ts +1 -1
  21. package/components/brand/index.ts +6 -6
  22. package/components/brand/xertica-provider/XerticaProvider.tsx +48 -48
  23. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  24. package/components/brand/xertica-provider/xertica-provider.test.tsx +52 -52
  25. package/components/examples/MapExamples.tsx +282 -282
  26. package/components/examples/SimpleFilterableMap.tsx +191 -191
  27. package/components/examples/index.ts +51 -51
  28. package/components/figma/ImageWithFallback.tsx +27 -27
  29. package/components/hooks/index.ts +7 -7
  30. package/components/index.ts +5 -5
  31. package/components/layout/header/header.test.tsx +8 -8
  32. package/components/layout/header/header.tsx +4 -4
  33. package/components/layout/index.ts +2 -2
  34. package/components/layout/sidebar/index.ts +2 -0
  35. package/components/layout/sidebar/sidebar.mdx +1 -1
  36. package/components/layout/sidebar/sidebar.stories.tsx +160 -8
  37. package/components/layout/sidebar/sidebar.test.tsx +11 -11
  38. package/components/layout/sidebar/sidebar.tsx +610 -471
  39. package/components/layout/sidebar/use-sidebar.ts +113 -0
  40. package/components/media/FloatingMediaWrapper.tsx +11 -11
  41. package/components/media/audio-player/AudioPlayer.tsx +22 -22
  42. package/components/media/index.ts +3 -3
  43. package/components/pages/home-content/HomeContent.tsx +7 -7
  44. package/components/pages/home-content/home-content.mdx +62 -62
  45. package/components/pages/home-page/HomePage.stories.tsx +39 -39
  46. package/components/pages/home-page/HomePage.tsx +1 -1
  47. package/components/pages/home-page/home-page.mdx +53 -53
  48. package/components/pages/index.ts +8 -8
  49. package/components/pages/template-content/TemplateContent.tsx +5 -5
  50. package/components/pages/template-content/template-content.mdx +61 -61
  51. package/components/pages/template-page/TemplatePage.stories.tsx +39 -39
  52. package/components/pages/template-page/TemplatePage.tsx +5 -5
  53. package/components/pages/template-page/template-page.mdx +53 -53
  54. package/components/public-api-smoke.test.tsx +52 -52
  55. package/components/shared/assistant-utils.ts +43 -43
  56. package/components/shared/layout-constants.ts +1 -1
  57. package/components/ui/accordion/accordion.mdx +8 -8
  58. package/components/ui/accordion/accordion.stories.tsx +53 -53
  59. package/components/ui/alert/alert.mdx +8 -8
  60. package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
  61. package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
  62. package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
  63. package/components/ui/avatar/avatar.mdx +8 -8
  64. package/components/ui/badge/badge.mdx +8 -8
  65. package/components/ui/badge/badge.tsx +9 -9
  66. package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
  67. package/components/ui/button/button.mdx +8 -8
  68. package/components/ui/calendar/calendar.mdx +8 -8
  69. package/components/ui/calendar/calendar.tsx +258 -258
  70. package/components/ui/card/card.mdx +8 -8
  71. package/components/ui/card/card.stories.tsx +245 -245
  72. package/components/ui/carousel/carousel.mdx +8 -8
  73. package/components/ui/chart/chart.mdx +8 -8
  74. package/components/ui/chart/chart.stories.tsx +1303 -344
  75. package/components/ui/chart/chart.test.tsx +154 -154
  76. package/components/ui/chart/chart.tsx +2367 -1494
  77. package/components/ui/checkbox/checkbox.mdx +8 -8
  78. package/components/ui/checkbox/checkbox.stories.tsx +20 -20
  79. package/components/ui/collapsible/collapsible.mdx +8 -8
  80. package/components/ui/command/command.mdx +8 -8
  81. package/components/ui/context-menu/context-menu.mdx +8 -8
  82. package/components/ui/dialog/dialog.mdx +8 -8
  83. package/components/ui/drawer/drawer.mdx +8 -8
  84. package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
  85. package/components/ui/empty/empty.mdx +8 -8
  86. package/components/ui/file-upload/file-upload.mdx +8 -8
  87. package/components/ui/file-upload/file-upload.stories.tsx +100 -0
  88. package/components/ui/file-upload/file-upload.tsx +14 -74
  89. package/components/ui/file-upload/index.ts +1 -0
  90. package/components/ui/file-upload/use-file-upload.ts +181 -0
  91. package/components/ui/google-maps-loader/google-maps-loader.tsx +2 -2
  92. package/components/ui/hover-card/hover-card.mdx +8 -8
  93. package/components/ui/input/input.mdx +8 -8
  94. package/components/ui/input-otp/input-otp.mdx +8 -8
  95. package/components/ui/input-otp/input-otp.stories.tsx +6 -6
  96. package/components/ui/label/label.mdx +8 -8
  97. package/components/ui/map/map.mdx +8 -8
  98. package/components/ui/map/map.stories.tsx +51 -51
  99. package/components/ui/map/map.tsx +2 -2
  100. package/components/ui/menubar/menubar.mdx +8 -8
  101. package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
  102. package/components/ui/notification-badge/notification-badge.mdx +8 -8
  103. package/components/ui/pagination/index.ts +2 -0
  104. package/components/ui/pagination/pagination.mdx +8 -8
  105. package/components/ui/pagination/pagination.stories.tsx +94 -0
  106. package/components/ui/pagination/use-pagination.ts +194 -0
  107. package/components/ui/popover/popover.mdx +8 -8
  108. package/components/ui/progress/progress.mdx +8 -8
  109. package/components/ui/progress/progress.tsx +68 -68
  110. package/components/ui/radio-group/radio-group.mdx +8 -8
  111. package/components/ui/rating/rating.mdx +8 -8
  112. package/components/ui/resizable/resizable.mdx +8 -8
  113. package/components/ui/rich-text-editor/index.ts +2 -0
  114. package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +129 -1
  115. package/components/ui/rich-text-editor/rich-text-editor.tsx +86 -305
  116. package/components/ui/rich-text-editor/use-rich-text-editor.ts +439 -0
  117. package/components/ui/route-map/route-map.mdx +8 -8
  118. package/components/ui/route-map/route-map.stories.tsx +54 -54
  119. package/components/ui/route-map/route-map.tsx +2 -2
  120. package/components/ui/scroll-area/scroll-area.mdx +8 -8
  121. package/components/ui/search/search.mdx +8 -8
  122. package/components/ui/select/select.mdx +8 -8
  123. package/components/ui/select/select.stories.tsx +9 -9
  124. package/components/ui/separator/separator.mdx +8 -8
  125. package/components/ui/sheet/sheet.mdx +8 -8
  126. package/components/ui/sheet/sheet.stories.tsx +95 -95
  127. package/components/ui/simple-map/simple-map.mdx +8 -8
  128. package/components/ui/simple-map/simple-map.stories.tsx +48 -48
  129. package/components/ui/skeleton/skeleton.mdx +8 -8
  130. package/components/ui/slider/slider.mdx +8 -8
  131. package/components/ui/sonner/sonner.mdx +8 -8
  132. package/components/ui/stats-card/stats-card.mdx +8 -8
  133. package/components/ui/stepper/index.ts +3 -1
  134. package/components/ui/stepper/stepper.mdx +8 -8
  135. package/components/ui/stepper/stepper.stories.tsx +116 -0
  136. package/components/ui/stepper/stepper.tsx +4 -4
  137. package/components/ui/stepper/use-stepper.ts +137 -0
  138. package/components/ui/switch/switch.mdx +8 -8
  139. package/components/ui/switch/switch.stories.tsx +20 -20
  140. package/components/ui/table/table.mdx +8 -8
  141. package/components/ui/tabs/tabs.mdx +8 -8
  142. package/components/ui/tabs/tabs.stories.tsx +26 -26
  143. package/components/ui/textarea/textarea.mdx +8 -8
  144. package/components/ui/timeline/timeline.mdx +8 -8
  145. package/components/ui/toggle/toggle.mdx +8 -8
  146. package/components/ui/toggle-group/toggle-group.mdx +8 -8
  147. package/components/ui/tooltip/tooltip.mdx +8 -8
  148. package/components/ui/tree-view/index.ts +4 -1
  149. package/components/ui/tree-view/tree-view.mdx +8 -8
  150. package/components/ui/tree-view/tree-view.stories.tsx +110 -4
  151. package/components/ui/tree-view/tree-view.tsx +17 -125
  152. package/components/ui/tree-view/use-tree-view.ts +229 -0
  153. package/components.json +1512 -1512
  154. package/contexts/ApiKeyContext.tsx +72 -72
  155. package/contexts/BrandColorsContext.tsx +26 -26
  156. package/contexts/LanguageContext.tsx +13 -13
  157. package/contexts/LayoutContext.test.tsx +11 -11
  158. package/contexts/LayoutContext.tsx +29 -29
  159. package/contexts/ThemeContext.tsx +26 -26
  160. package/contexts/theme-data.ts +4 -4
  161. package/dist/{AssistantChart-CVzmmhx4.js → AssistantChart-C_hwFRRr.js} +4 -4
  162. package/dist/{AssistantChart-BAx9VQvb.cjs → AssistantChart-CldVCVDe.cjs} +311 -94
  163. package/dist/{AssistantChart-CVko2A1W.js → AssistantChart-Cu3m7RBo.js} +314 -97
  164. package/dist/{AssistantChart-9w31gdAb.cjs → AssistantChart-DoZCyS5r.cjs} +4 -4
  165. package/dist/AudioPlayer-B1lt5cPl.cjs +989 -0
  166. package/dist/AudioPlayer-BZ7bibzU.cjs +982 -0
  167. package/dist/AudioPlayer-C12BjQBV.cjs +997 -0
  168. package/dist/AudioPlayer-DMcG_c7L.js +990 -0
  169. package/dist/AudioPlayer-DcFKRJE_.js +998 -0
  170. package/dist/AudioPlayer-e8LfNoqO.js +983 -0
  171. package/dist/{xertica-assistant-Qp3ydksa.cjs → CodeBlock-7TTgmdGG.cjs} +263 -51
  172. package/dist/{xertica-assistant-gnCJdcZY.js → CodeBlock-BeSt1h5P.js} +219 -7
  173. package/dist/CodeBlock-BgfYL_rD.cjs +2094 -0
  174. package/dist/CodeBlock-BlcqlA9M.cjs +2094 -0
  175. package/dist/CodeBlock-Bnmeu5ez.cjs +2094 -0
  176. package/dist/CodeBlock-BtfPlbAI.js +2078 -0
  177. package/dist/CodeBlock-CIySIuYr.js +2078 -0
  178. package/dist/CodeBlock-CuPtUM-7.cjs +2094 -0
  179. package/dist/CodeBlock-D6ffWXgc.js +2078 -0
  180. package/dist/CodeBlock-D8dcwbit.cjs +2094 -0
  181. package/dist/CodeBlock-DMZrFnlw.cjs +2094 -0
  182. package/dist/CodeBlock-DlBehYN8.js +2078 -0
  183. package/dist/CodeBlock-DnYNI8rQ.js +2078 -0
  184. package/dist/CodeBlock-DvKWbSnE.cjs +2094 -0
  185. package/dist/CodeBlock-DwMCfkFY.js +2078 -0
  186. package/dist/CodeBlock-Dy6CNYyj.js +2078 -0
  187. package/dist/CodeBlock-U1pPOQI7.cjs +2094 -0
  188. package/dist/CodeBlock-f_GpNhEB.js +2078 -0
  189. package/dist/CodeBlock-oB6u8nI1.js +2078 -0
  190. package/dist/CodeBlock-tZC31B73.cjs +2094 -0
  191. package/dist/ImageWithFallback-CGtidP6B.cjs +4542 -0
  192. package/dist/ImageWithFallback-lsg3pdFg.js +4508 -0
  193. package/dist/LanguageSelector-B5YfbHra.js +231 -0
  194. package/dist/LanguageSelector-D6uacAIM.cjs +230 -0
  195. package/dist/LayoutContext-BAql6ZRY.js +97 -0
  196. package/dist/LayoutContext-BvK-ggDa.cjs +96 -0
  197. package/dist/ThemeContext-BoH4NLfN.js +734 -0
  198. package/dist/{ThemeContext-BbBNoFTG.js → ThemeContext-C2EwAPDt.js} +2 -2
  199. package/dist/ThemeContext-r69W20Xg.cjs +733 -0
  200. package/dist/{ThemeContext-Cmr8Ex8H.cjs → ThemeContext-vTjumZeM.cjs} +2 -2
  201. package/dist/{VerifyEmailPage-BE-L9mB7.js → VerifyEmailPage-C0c2e5n0.js} +7 -7
  202. package/dist/{VerifyEmailPage-DMBh4NM9.cjs → VerifyEmailPage-CYXtbKi3.cjs} +1 -1
  203. package/dist/{VerifyEmailPage-CR7kb5df.cjs → VerifyEmailPage-Cwi3kbol.cjs} +7 -7
  204. package/dist/{VerifyEmailPage-CdYPSJoO.js → VerifyEmailPage-DvMLZgFt.js} +1 -1
  205. package/dist/XerticaOrbe-KL1RBHzw.cjs +1354 -0
  206. package/dist/XerticaOrbe-zwS1p2a8.js +1355 -0
  207. package/dist/XerticaProvider-6btlAlzc.js +17 -0
  208. package/dist/XerticaProvider-BNoNOxQ5.cjs +16 -0
  209. package/dist/XerticaProvider-BlY2limY.cjs +38 -0
  210. package/dist/{XerticaProvider-BITjgC5p.js → XerticaProvider-CEoWMTxu.js} +2 -2
  211. package/dist/{XerticaProvider-By8q3Roe.cjs → XerticaProvider-CllrbMEJ.cjs} +2 -2
  212. package/dist/XerticaProvider-DDuiIcKo.js +39 -0
  213. package/dist/XerticaProvider-cI9hSs27.cjs +38 -0
  214. package/dist/XerticaProvider-hSwhNQex.js +39 -0
  215. package/dist/{alert-dialog-yckpaOpy.cjs → alert-dialog-DSKByiKZ.cjs} +3 -3
  216. package/dist/{alert-dialog-iDe5VE5o.js → alert-dialog-s-vmNkJ_.js} +3 -3
  217. package/dist/assistant.cjs.js +2 -1
  218. package/dist/assistant.es.js +3 -2
  219. package/dist/brand.cjs.js +1 -1
  220. package/dist/brand.es.js +1 -1
  221. package/dist/breadcrumb-CqJ7bHY5.js +161 -0
  222. package/dist/breadcrumb-m9Hb2_XN.cjs +177 -0
  223. package/dist/cli.js +14 -8
  224. package/dist/components/assistant/xertica-assistant/index.d.ts +2 -0
  225. package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +126 -0
  226. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +7 -2
  227. package/dist/components/blocks/audio-player/AudioPlayer.d.ts +35 -0
  228. package/dist/components/blocks/audio-player/index.d.ts +1 -0
  229. package/dist/components/blocks/document-editor/DocumentEditor.d.ts +26 -0
  230. package/dist/components/blocks/document-editor/index.d.ts +1 -0
  231. package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +41 -0
  232. package/dist/components/blocks/podcast-player/index.d.ts +1 -0
  233. package/dist/components/layout/sidebar/index.d.ts +2 -0
  234. package/dist/components/layout/sidebar/sidebar.d.ts +80 -0
  235. package/dist/components/layout/sidebar/use-sidebar.d.ts +22 -0
  236. package/dist/components/shared/layout-constants.d.ts +1 -1
  237. package/dist/components/ui/button/button.d.ts +1 -1
  238. package/dist/components/ui/chart/chart.d.ts +162 -5
  239. package/dist/components/ui/file-upload/file-upload.d.ts +2 -0
  240. package/dist/components/ui/file-upload/index.d.ts +1 -0
  241. package/dist/components/ui/file-upload/use-file-upload.d.ts +49 -0
  242. package/dist/components/ui/pagination/index.d.ts +2 -0
  243. package/dist/components/ui/pagination/use-pagination.d.ts +78 -0
  244. package/dist/components/ui/rich-text-editor/index.d.ts +2 -0
  245. package/dist/components/ui/rich-text-editor/use-rich-text-editor.d.ts +107 -0
  246. package/dist/components/ui/stepper/index.d.ts +3 -1
  247. package/dist/components/ui/stepper/stepper.d.ts +2 -2
  248. package/dist/components/ui/stepper/use-stepper.d.ts +60 -0
  249. package/dist/components/ui/tree-view/index.d.ts +4 -1
  250. package/dist/components/ui/tree-view/tree-view.d.ts +4 -6
  251. package/dist/components/ui/tree-view/use-tree-view.d.ts +60 -0
  252. package/dist/dropdown-menu-BDB5CmQs.cjs +247 -0
  253. package/dist/dropdown-menu-DQidbKBD.js +231 -0
  254. package/dist/google-maps-loader-BFWp6VPd.js +287 -0
  255. package/dist/{google-maps-loader-t2IlYBzw.js → google-maps-loader-CTYySAun.js} +4 -0
  256. package/dist/{google-maps-loader-BqsYL48U.cjs → google-maps-loader-Y-QkD-Li.cjs} +5 -0
  257. package/dist/google-maps-loader-eS3uQ5TA.cjs +287 -0
  258. package/dist/header-Cgy6vYPk.cjs +731 -0
  259. package/dist/header-DRlT4jgI.js +715 -0
  260. package/dist/header-Dux00SI4.cjs +731 -0
  261. package/dist/header-EkGKXPsD.js +715 -0
  262. package/dist/header-WfEywpyc.cjs +731 -0
  263. package/dist/header-tifNQn2U.js +715 -0
  264. package/dist/hooks.cjs.js +1 -1
  265. package/dist/hooks.es.js +1 -1
  266. package/dist/index-BhapVLVj.js +8 -0
  267. package/dist/{index-D3RLKRAs.cjs → index-COtD8bRW.cjs} +1 -1
  268. package/dist/index-D6fxYEY8.cjs +7 -0
  269. package/dist/index-DW5tYe26.js +8 -0
  270. package/dist/index.cjs.js +19 -8
  271. package/dist/index.es.js +39 -28
  272. package/dist/index.umd.js +1043 -470
  273. package/dist/input-2R4loU86.js +127 -0
  274. package/dist/input-DWANSKGb.cjs +145 -0
  275. package/dist/layout.cjs.js +89 -1
  276. package/dist/layout.es.js +90 -2
  277. package/dist/pages.cjs.js +1 -1
  278. package/dist/pages.es.js +1 -1
  279. package/dist/rich-text-editor-0mraWT5y.cjs +2376 -0
  280. package/dist/rich-text-editor-B6jMRLzk.cjs +1939 -0
  281. package/dist/rich-text-editor-B8_oYcIR.js +1730 -0
  282. package/dist/rich-text-editor-B9UbSXNb.js +1203 -0
  283. package/dist/rich-text-editor-BYuRBNBU.js +2373 -0
  284. package/dist/rich-text-editor-Bb9pySTs.cjs +2374 -0
  285. package/dist/rich-text-editor-BcL6L3cm.cjs +2374 -0
  286. package/dist/rich-text-editor-BoVZYtTs.cjs +2391 -0
  287. package/dist/rich-text-editor-CPV1lEPH.cjs +1748 -0
  288. package/dist/rich-text-editor-CoKqbCtu.cjs +1799 -0
  289. package/dist/rich-text-editor-Cw56T_mB.js +2356 -0
  290. package/dist/rich-text-editor-Cyt8qs2b.js +1921 -0
  291. package/dist/rich-text-editor-D6H84OcX.cjs +1220 -0
  292. package/dist/rich-text-editor-D76gD-QI.js +2328 -0
  293. package/dist/rich-text-editor-DKkokOnA.js +1781 -0
  294. package/dist/rich-text-editor-DNsdpN64.cjs +2359 -0
  295. package/dist/rich-text-editor-DfG8bCyY.js +2358 -0
  296. package/dist/rich-text-editor-DgF8s7xW.js +2949 -0
  297. package/dist/rich-text-editor-Dxjw31Z4.js +2341 -0
  298. package/dist/rich-text-editor-DzP0Epmb.js +2356 -0
  299. package/dist/rich-text-editor-mWoaSCE4.cjs +2966 -0
  300. package/dist/rich-text-editor-skplNlBM.cjs +2345 -0
  301. package/dist/select-Bkbr0f-Z.cjs +162 -0
  302. package/dist/select-CvIVdX2n.js +145 -0
  303. package/dist/sidebar-CK_0ZQHj.cjs +803 -0
  304. package/dist/sidebar-CUuOvYhK.js +787 -0
  305. package/dist/slider-Bc5Hd0y1.js +56 -0
  306. package/dist/slider-N7hFFj6X.cjs +73 -0
  307. package/dist/tooltip-Ded96neP.cjs +137 -0
  308. package/dist/tooltip-HDOoD2-0.js +120 -0
  309. package/dist/ui.cjs.js +14 -4
  310. package/dist/ui.es.js +26 -16
  311. package/dist/use-mobile-B0hNy_Y6.cjs +4303 -0
  312. package/dist/use-mobile-BXuYROXM.js +4202 -0
  313. package/dist/use-mobile-Bbd51ASU.cjs +4392 -0
  314. package/dist/use-mobile-Bk6CX-TC.js +4359 -0
  315. package/dist/use-mobile-BvYdisLP.js +4202 -0
  316. package/dist/use-mobile-BzuxjzNX.cjs +4392 -0
  317. package/dist/use-mobile-CG2-SdXV.cjs +4235 -0
  318. package/dist/use-mobile-CKb5pqTs.js +4269 -0
  319. package/dist/use-mobile-CYuAuGDl.js +4202 -0
  320. package/dist/use-mobile-CaENcqm-.js +4508 -0
  321. package/dist/use-mobile-CbrYgJGJ.js +4203 -0
  322. package/dist/use-mobile-DMOvImGQ.cjs +4542 -0
  323. package/dist/use-mobile-DRB3BQgD.cjs +4235 -0
  324. package/dist/use-mobile-DZvv7QMR.js +4359 -0
  325. package/dist/use-mobile-DdI_TXam.cjs +4235 -0
  326. package/dist/use-mobile-DlceKf8a.js +4359 -0
  327. package/dist/use-mobile-DsOnow1o.cjs +4236 -0
  328. package/dist/use-mobile-Kcj6jSnK.cjs +4392 -0
  329. package/dist/use-mobile-bnKcua_i.js +4202 -0
  330. package/dist/use-mobile-ncXBeE2z.cjs +4235 -0
  331. package/dist/{xertica-assistant-B1IaHXnB.cjs → xertica-assistant-dyP7KHM5.cjs} +533 -392
  332. package/dist/{xertica-assistant-DPsESB6t.js → xertica-assistant-yX1CFBBo.js} +535 -394
  333. package/dist/xertica-ui.css +2 -2
  334. package/docs/ai-usage.md +28 -10
  335. package/docs/architecture.md +76 -0
  336. package/docs/components/assistant.md +159 -0
  337. package/docs/components/calendar.md +154 -154
  338. package/docs/components/card-patterns.md +337 -337
  339. package/docs/components/card.md +235 -235
  340. package/docs/components/chart.md +354 -39
  341. package/docs/components/file-upload.md +119 -2
  342. package/docs/components/map.md +84 -84
  343. package/docs/components/pagination.md +187 -0
  344. package/docs/components/rich-text-editor.md +164 -0
  345. package/docs/components/sidebar.md +153 -4
  346. package/docs/components/stepper.md +157 -12
  347. package/docs/components/tree-view.md +164 -6
  348. package/docs/components/xertica-provider.md +24 -24
  349. package/docs/decision-tree.md +287 -287
  350. package/docs/getting-started.md +1 -1
  351. package/docs/guidelines.md +14 -8
  352. package/docs/layout.md +2 -2
  353. package/docs/llms.md +4 -4
  354. package/guidelines/Guidelines.md +252 -250
  355. package/hooks/useTheme.ts +3 -3
  356. package/imports/Podcast.tsx +388 -388
  357. package/imports/XerticaAi.tsx +45 -45
  358. package/imports/XerticaX.tsx +19 -19
  359. package/imports/svg-aueiaqngck.ts +11 -11
  360. package/imports/svg-v9krss1ozd.ts +16 -16
  361. package/imports/svg-vhrdofe3qe.ts +5 -5
  362. package/llms-compact.txt +327 -327
  363. package/llms.txt +160 -160
  364. package/package.json +203 -203
  365. package/styles/xertica/app-overrides/chat.css +61 -61
  366. package/styles/xertica/app-overrides/scrollbar.css +33 -33
  367. package/styles/xertica/integrations/google-maps.css +76 -76
  368. package/styles/xertica/integrations/sonner.css +73 -73
  369. package/styles/xertica/tokens.css +41 -12
  370. package/templates/CLAUDE.md +182 -172
  371. package/templates/guidelines/Guidelines.md +325 -313
  372. package/templates/package.json +3 -3
  373. package/templates/src/features/auth/index.ts +4 -4
  374. package/templates/src/features/auth/ui/AuthPageShell.tsx +34 -34
  375. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
  376. package/templates/src/features/auth/ui/LoginContent.tsx +90 -90
  377. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +151 -151
  378. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +59 -59
  379. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +82 -82
  380. package/templates/src/features/home/index.ts +1 -1
  381. package/templates/src/features/home/ui/HomeContent.tsx +100 -100
  382. package/templates/src/features/template/index.ts +5 -5
  383. package/templates/src/features/template/ui/CrudTemplate.tsx +3 -3
  384. package/templates/src/features/template/ui/DashboardTemplate.tsx +3 -3
  385. package/templates/src/features/template/ui/FormTemplate.tsx +120 -120
  386. package/templates/src/features/template/ui/LoginTemplate.tsx +3 -3
  387. package/templates/src/pages/AssistantPage.tsx +328 -328
  388. package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
  389. package/templates/src/pages/HomePage.tsx +57 -57
  390. package/templates/src/pages/LoginPage.tsx +10 -10
  391. package/templates/src/pages/ResetPasswordPage.tsx +6 -6
  392. package/templates/src/pages/TemplatePage.tsx +30 -30
  393. package/templates/src/pages/VerifyEmailPage.tsx +6 -6
  394. package/templates/src/shared/config/navigation.ts +20 -20
  395. package/templates/src/shared/lib/auth.ts +20 -20
  396. package/templates/src/shared/types/auth.ts +3 -3
  397. package/templates/src/styles/xertica/tokens.css +39 -10
  398. package/templates/tsconfig.json +5 -5
  399. package/utils/gemini.ts +140 -140
  400. package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
  401. package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
  402. package/dist/index-CkTUgOwX.js +0 -8
@@ -0,0 +1,1220 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const RechartsPrimitive = require("recharts");
5
+ const tooltip = require("./tooltip-Ded96neP.cjs");
6
+ const DialogPrimitive = require("@radix-ui/react-dialog");
7
+ const lucideReact = require("lucide-react");
8
+ const classVarianceAuthority = require("class-variance-authority");
9
+ const dropdownMenu = require("./dropdown-menu-BDB5CmQs.cjs");
10
+ const input = require("./input-DWANSKGb.cjs");
11
+ function _interopNamespaceDefault(e) {
12
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
13
+ if (e) {
14
+ for (const k in e) {
15
+ if (k !== "default") {
16
+ const d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: () => e[k]
20
+ });
21
+ }
22
+ }
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
28
+ const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
29
+ const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
30
+ const THEMES = { light: "", dark: ".dark" };
31
+ const ChartContext = React__namespace.createContext(null);
32
+ function useChart() {
33
+ const context = React__namespace.useContext(ChartContext);
34
+ if (!context) {
35
+ throw new Error("useChart must be used within a <ChartContainer />");
36
+ }
37
+ return context;
38
+ }
39
+ function ChartContainer({
40
+ id,
41
+ className,
42
+ children,
43
+ config,
44
+ ...props
45
+ }) {
46
+ const uniqueId = React__namespace.useId();
47
+ const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
48
+ return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
49
+ "div",
50
+ {
51
+ "data-slot": "chart",
52
+ "data-chart": chartId,
53
+ className: tooltip.cn(
54
+ "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex justify-center text-xs overflow-hidden [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden h-[300px] w-full",
55
+ className
56
+ ),
57
+ ...props,
58
+ children: [
59
+ /* @__PURE__ */ jsxRuntime.jsx(ChartStyle, { id: chartId, config }),
60
+ /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { width: "100%", height: "100%", children })
61
+ ]
62
+ }
63
+ ) });
64
+ }
65
+ const ChartStyle = ({ id, config }) => {
66
+ const colorConfig = Object.entries(config).filter(
67
+ ([, config2]) => config2.theme || config2.color
68
+ );
69
+ if (!colorConfig.length) {
70
+ return null;
71
+ }
72
+ return /* @__PURE__ */ jsxRuntime.jsx(
73
+ "style",
74
+ {
75
+ dangerouslySetInnerHTML: {
76
+ __html: Object.entries(THEMES).map(
77
+ ([theme, prefix]) => `
78
+ ${prefix} [data-chart=${id}] {
79
+ ${colorConfig.map(([key, itemConfig]) => {
80
+ var _a;
81
+ const color = ((_a = itemConfig.theme) == null ? void 0 : _a[theme]) || itemConfig.color;
82
+ return color ? ` --color-${key}: ${color};` : null;
83
+ }).join("\n")}
84
+ }
85
+ `
86
+ ).join("\n")
87
+ }
88
+ }
89
+ );
90
+ };
91
+ const ChartTooltip = RechartsPrimitive__namespace.Tooltip;
92
+ function ChartTooltipContent({
93
+ active,
94
+ payload,
95
+ className,
96
+ indicator = "dot",
97
+ hideLabel = false,
98
+ hideIndicator = false,
99
+ label,
100
+ labelFormatter,
101
+ labelClassName,
102
+ formatter,
103
+ color,
104
+ nameKey,
105
+ labelKey
106
+ }) {
107
+ const { config } = useChart();
108
+ const tooltipLabel = React__namespace.useMemo(() => {
109
+ var _a;
110
+ if (hideLabel || !(payload == null ? void 0 : payload.length)) {
111
+ return null;
112
+ }
113
+ const [item] = payload;
114
+ const key = `${labelKey || (item == null ? void 0 : item.dataKey) || (item == null ? void 0 : item.name) || "value"}`;
115
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
116
+ const value = !labelKey && typeof label === "string" ? ((_a = config[label]) == null ? void 0 : _a.label) || label : itemConfig == null ? void 0 : itemConfig.label;
117
+ if (labelFormatter) {
118
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tooltip.cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
119
+ }
120
+ if (!value) {
121
+ return null;
122
+ }
123
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tooltip.cn("font-medium", labelClassName), children: value });
124
+ }, [
125
+ label,
126
+ labelFormatter,
127
+ payload,
128
+ hideLabel,
129
+ labelClassName,
130
+ config,
131
+ labelKey
132
+ ]);
133
+ if (!active || !(payload == null ? void 0 : payload.length)) {
134
+ return null;
135
+ }
136
+ const nestLabel = payload.length === 1 && indicator !== "dot";
137
+ return /* @__PURE__ */ jsxRuntime.jsxs(
138
+ "div",
139
+ {
140
+ className: tooltip.cn(
141
+ "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
142
+ className
143
+ ),
144
+ children: [
145
+ !nestLabel ? tooltipLabel : null,
146
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
147
+ var _a;
148
+ const key = `${nameKey || item.name || item.dataKey || "value"}`;
149
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
150
+ const indicatorColor = color || ((_a = item.payload) == null ? void 0 : _a.fill) || item.color;
151
+ return /* @__PURE__ */ jsxRuntime.jsx(
152
+ "div",
153
+ {
154
+ className: tooltip.cn(
155
+ "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
156
+ indicator === "dot" && "items-center"
157
+ ),
158
+ children: formatter && (item == null ? void 0 : item.value) !== void 0 && item.name ? formatter(item.value, item.name, item, index, item.payload) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
159
+ (itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntime.jsx(
160
+ "div",
161
+ {
162
+ className: tooltip.cn(
163
+ "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
164
+ {
165
+ "h-2.5 w-2.5": indicator === "dot",
166
+ "w-1": indicator === "line",
167
+ "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
168
+ "my-0.5": nestLabel && indicator === "dashed"
169
+ }
170
+ ),
171
+ style: {
172
+ "--color-bg": indicatorColor,
173
+ "--color-border": indicatorColor
174
+ }
175
+ }
176
+ ),
177
+ /* @__PURE__ */ jsxRuntime.jsxs(
178
+ "div",
179
+ {
180
+ className: tooltip.cn(
181
+ "flex flex-1 justify-between leading-none",
182
+ nestLabel ? "items-end" : "items-center"
183
+ ),
184
+ children: [
185
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1.5", children: [
186
+ nestLabel ? tooltipLabel : null,
187
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
188
+ ] }),
189
+ item.value && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() })
190
+ ]
191
+ }
192
+ )
193
+ ] })
194
+ },
195
+ item.dataKey
196
+ );
197
+ }) })
198
+ ]
199
+ }
200
+ );
201
+ }
202
+ const ChartLegend = RechartsPrimitive__namespace.Legend;
203
+ function ChartLegendContent({
204
+ className,
205
+ hideIcon = false,
206
+ payload,
207
+ verticalAlign = "bottom",
208
+ nameKey
209
+ }) {
210
+ const { config } = useChart();
211
+ if (!(payload == null ? void 0 : payload.length)) {
212
+ return null;
213
+ }
214
+ return /* @__PURE__ */ jsxRuntime.jsx(
215
+ "div",
216
+ {
217
+ className: tooltip.cn(
218
+ "flex items-center justify-center gap-4",
219
+ verticalAlign === "top" ? "pb-3" : "pt-3",
220
+ className
221
+ ),
222
+ children: payload.map((item) => {
223
+ const key = `${nameKey || item.dataKey || "value"}`;
224
+ const itemConfig = getPayloadConfigFromPayload(config, item, key);
225
+ return /* @__PURE__ */ jsxRuntime.jsxs(
226
+ "div",
227
+ {
228
+ className: tooltip.cn(
229
+ "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
230
+ ),
231
+ children: [
232
+ (itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(
233
+ "div",
234
+ {
235
+ className: "h-2 w-2 shrink-0 rounded-[2px] bg-[--color-bg]",
236
+ style: {
237
+ "--color-bg": item.color
238
+ }
239
+ }
240
+ ),
241
+ itemConfig == null ? void 0 : itemConfig.label
242
+ ]
243
+ },
244
+ item.value
245
+ );
246
+ })
247
+ }
248
+ );
249
+ }
250
+ function getPayloadConfigFromPayload(config, payload, key) {
251
+ if (typeof payload !== "object" || payload === null) {
252
+ return void 0;
253
+ }
254
+ const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
255
+ let configLabelKey = key;
256
+ if (key in payload && typeof payload[key] === "string") {
257
+ configLabelKey = payload[key];
258
+ } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
259
+ configLabelKey = payloadPayload[key];
260
+ }
261
+ return configLabelKey in config ? config[configLabelKey] : config[key];
262
+ }
263
+ function Table({ className, ...props }) {
264
+ return /* @__PURE__ */ jsxRuntime.jsx(
265
+ "div",
266
+ {
267
+ "data-slot": "table-container",
268
+ className: "relative w-full overflow-x-auto",
269
+ children: /* @__PURE__ */ jsxRuntime.jsx(
270
+ "table",
271
+ {
272
+ "data-slot": "table",
273
+ className: tooltip.cn("w-full caption-bottom text-sm", className),
274
+ ...props
275
+ }
276
+ )
277
+ }
278
+ );
279
+ }
280
+ function TableHeader({ className, ...props }) {
281
+ return /* @__PURE__ */ jsxRuntime.jsx(
282
+ "thead",
283
+ {
284
+ "data-slot": "table-header",
285
+ className: tooltip.cn("[&_tr]:border-b", className),
286
+ ...props
287
+ }
288
+ );
289
+ }
290
+ function TableBody({ className, ...props }) {
291
+ return /* @__PURE__ */ jsxRuntime.jsx(
292
+ "tbody",
293
+ {
294
+ "data-slot": "table-body",
295
+ className: tooltip.cn("[&_tr:last-child]:border-0", className),
296
+ ...props
297
+ }
298
+ );
299
+ }
300
+ function TableFooter({ className, ...props }) {
301
+ return /* @__PURE__ */ jsxRuntime.jsx(
302
+ "tfoot",
303
+ {
304
+ "data-slot": "table-footer",
305
+ className: tooltip.cn(
306
+ "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
307
+ className
308
+ ),
309
+ ...props
310
+ }
311
+ );
312
+ }
313
+ function TableRow({ className, ...props }) {
314
+ return /* @__PURE__ */ jsxRuntime.jsx(
315
+ "tr",
316
+ {
317
+ "data-slot": "table-row",
318
+ className: tooltip.cn(
319
+ "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
320
+ className
321
+ ),
322
+ ...props
323
+ }
324
+ );
325
+ }
326
+ function TableHead({ className, ...props }) {
327
+ return /* @__PURE__ */ jsxRuntime.jsx(
328
+ "th",
329
+ {
330
+ "data-slot": "table-head",
331
+ className: tooltip.cn(
332
+ "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
333
+ className
334
+ ),
335
+ ...props
336
+ }
337
+ );
338
+ }
339
+ function TableCell({ className, ...props }) {
340
+ return /* @__PURE__ */ jsxRuntime.jsx(
341
+ "td",
342
+ {
343
+ "data-slot": "table-cell",
344
+ className: tooltip.cn(
345
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
346
+ className
347
+ ),
348
+ ...props
349
+ }
350
+ );
351
+ }
352
+ function TableCaption({
353
+ className,
354
+ ...props
355
+ }) {
356
+ return /* @__PURE__ */ jsxRuntime.jsx(
357
+ "caption",
358
+ {
359
+ "data-slot": "table-caption",
360
+ className: tooltip.cn("text-muted-foreground mt-4 text-sm", className),
361
+ ...props
362
+ }
363
+ );
364
+ }
365
+ function Dialog({
366
+ ...props
367
+ }) {
368
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
369
+ }
370
+ function DialogTrigger({
371
+ ...props
372
+ }) {
373
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
374
+ }
375
+ function DialogPortal({
376
+ ...props
377
+ }) {
378
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
379
+ }
380
+ function DialogClose({
381
+ ...props
382
+ }) {
383
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
384
+ }
385
+ const DialogOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
386
+ DialogPrimitive__namespace.Overlay,
387
+ {
388
+ ref,
389
+ "data-slot": "dialog-overlay",
390
+ className: tooltip.cn(
391
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/40 backdrop-blur-sm",
392
+ className
393
+ ),
394
+ ...props
395
+ }
396
+ ));
397
+ DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
398
+ const dialogVariants = classVarianceAuthority.cva(
399
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 flex flex-col w-full translate-x-[-50%] translate-y-[-50%] border shadow-elevation-sm duration-200 rounded-[var(--radius-card)] overflow-hidden max-h-[calc(100dvh-2rem)]",
400
+ {
401
+ variants: {
402
+ size: {
403
+ sm: "max-w-sm",
404
+ md: "max-w-md",
405
+ lg: "max-w-lg",
406
+ xl: "max-w-xl",
407
+ "2xl": "max-w-2xl",
408
+ "3xl": "max-w-3xl",
409
+ "4xl": "max-w-4xl",
410
+ "5xl": "max-w-5xl",
411
+ full: "max-w-[calc(100vw-2rem)] h-[calc(100dvh-2rem)]"
412
+ }
413
+ },
414
+ defaultVariants: {
415
+ size: "lg"
416
+ }
417
+ }
418
+ );
419
+ const DialogContent = React__namespace.forwardRef(({ className, children, size, showClose = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
420
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
421
+ /* @__PURE__ */ jsxRuntime.jsxs(
422
+ DialogPrimitive__namespace.Content,
423
+ {
424
+ ref,
425
+ "data-slot": "dialog-content",
426
+ className: tooltip.cn(dialogVariants({ size }), className),
427
+ ...props,
428
+ children: [
429
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 p-6 overflow-y-auto flex-1 min-h-0", children }),
430
+ showClose && /* @__PURE__ */ jsxRuntime.jsxs(DialogPrimitive__namespace.Close, { className: "absolute top-4 right-4 z-10 rounded-full p-2 opacity-70 transition-all hover:opacity-100 hover:bg-accent focus:ring-2 focus:ring-primary focus:ring-offset-2 focus:outline-none disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
431
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
432
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
433
+ ] })
434
+ ]
435
+ }
436
+ )
437
+ ] }));
438
+ DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
439
+ function DialogHeader({ className, ...props }) {
440
+ return /* @__PURE__ */ jsxRuntime.jsx(
441
+ "div",
442
+ {
443
+ "data-slot": "dialog-header",
444
+ className: tooltip.cn("flex flex-col gap-2 text-left shrink-0", className),
445
+ ...props
446
+ }
447
+ );
448
+ }
449
+ function DialogBody({ className, ...props }) {
450
+ return /* @__PURE__ */ jsxRuntime.jsx(
451
+ "div",
452
+ {
453
+ "data-slot": "dialog-body",
454
+ className: tooltip.cn("flex-1 overflow-y-auto min-h-0 -mx-6 px-6", className),
455
+ ...props
456
+ }
457
+ );
458
+ }
459
+ function DialogFooter({ className, ...props }) {
460
+ return /* @__PURE__ */ jsxRuntime.jsx(
461
+ "div",
462
+ {
463
+ "data-slot": "dialog-footer",
464
+ className: tooltip.cn(
465
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end shrink-0",
466
+ className
467
+ ),
468
+ ...props
469
+ }
470
+ );
471
+ }
472
+ function DialogTitle({
473
+ className,
474
+ ...props
475
+ }) {
476
+ return /* @__PURE__ */ jsxRuntime.jsx(
477
+ DialogPrimitive__namespace.Title,
478
+ {
479
+ "data-slot": "dialog-title",
480
+ className: tooltip.cn("text-foreground font-semibold leading-tight text-[length:var(--text-h4)]", className),
481
+ ...props
482
+ }
483
+ );
484
+ }
485
+ function DialogDescription({
486
+ className,
487
+ ...props
488
+ }) {
489
+ return /* @__PURE__ */ jsxRuntime.jsx(
490
+ DialogPrimitive__namespace.Description,
491
+ {
492
+ "data-slot": "dialog-description",
493
+ className: tooltip.cn("text-muted-foreground", className),
494
+ ...props
495
+ }
496
+ );
497
+ }
498
+ const Textarea = React__namespace.forwardRef(
499
+ ({ className, size = "md", ...props }, ref) => {
500
+ const sizeClasses = {
501
+ sm: "px-2 py-1 text-sm",
502
+ md: "px-3 py-2 text-base",
503
+ lg: "px-4 py-3 text-base"
504
+ };
505
+ return /* @__PURE__ */ jsxRuntime.jsx(
506
+ "textarea",
507
+ {
508
+ "data-slot": "textarea",
509
+ className: tooltip.cn(
510
+ "flex min-h-16 w-full bg-background rounded-[var(--radius)] border border-border transition-colors outline-none resize-none text-foreground",
511
+ "placeholder:text-muted-foreground",
512
+ "focus:ring-2 focus:ring-primary focus:border-transparent",
513
+ "disabled:cursor-not-allowed disabled:opacity-50",
514
+ sizeClasses[size],
515
+ className
516
+ ),
517
+ ref,
518
+ ...props
519
+ }
520
+ );
521
+ }
522
+ );
523
+ Textarea.displayName = "Textarea";
524
+ function RichTextEditor({
525
+ value,
526
+ onChange,
527
+ placeholder,
528
+ className,
529
+ actionButton,
530
+ allowSearch = true,
531
+ allowLinks = true,
532
+ allowUndoRedo = true,
533
+ allowHeadings = true,
534
+ allowFormatting = true,
535
+ allowAlignment = true,
536
+ allowLists = true,
537
+ showWordCount = true,
538
+ showCharacterCount = true,
539
+ disabled = false,
540
+ readOnly = false,
541
+ onFocus,
542
+ onBlur,
543
+ minHeight,
544
+ maxHeight
545
+ }) {
546
+ const isEditable = !disabled && !readOnly;
547
+ const showToolbar = isEditable;
548
+ const editorRef = React.useRef(null);
549
+ const [activeFormats, setActiveFormats] = React.useState({});
550
+ const [isSearchOpen, setIsSearchOpen] = React.useState(false);
551
+ const [searchQuery, setSearchQuery] = React.useState("");
552
+ const [linkUrl, setLinkUrl] = React.useState("https://");
553
+ const [isLinkOpen, setIsLinkOpen] = React.useState(false);
554
+ const searchInputRef = React.useRef(null);
555
+ const linkInputRef = React.useRef(null);
556
+ const savedSelection = React.useRef(null);
557
+ const findParentTag = (node, tagName) => {
558
+ let current = node;
559
+ while (current && current !== editorRef.current) {
560
+ if (current.nodeName === tagName) return current;
561
+ current = current.parentNode;
562
+ }
563
+ return null;
564
+ };
565
+ const updateActiveFormats = () => {
566
+ let formatBlock = "";
567
+ try {
568
+ formatBlock = document.queryCommandValue("formatBlock");
569
+ } catch (e) {
570
+ }
571
+ const selection = window.getSelection();
572
+ const anchorNode = selection == null ? void 0 : selection.anchorNode;
573
+ const focusNode = selection == null ? void 0 : selection.focusNode;
574
+ setActiveFormats({
575
+ bold: document.queryCommandState("bold"),
576
+ italic: document.queryCommandState("italic"),
577
+ underline: document.queryCommandState("underline"),
578
+ justifyLeft: document.queryCommandState("justifyLeft"),
579
+ justifyCenter: document.queryCommandState("justifyCenter"),
580
+ justifyRight: document.queryCommandState("justifyRight"),
581
+ insertUnorderedList: document.queryCommandState("insertUnorderedList"),
582
+ insertOrderedList: document.queryCommandState("insertOrderedList"),
583
+ link: !!(findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A")),
584
+ h1: formatBlock === "h1" || formatBlock === "H1",
585
+ h2: formatBlock === "h2" || formatBlock === "H2",
586
+ h3: formatBlock === "h3" || formatBlock === "H3",
587
+ p: formatBlock === "p" || formatBlock === "P" || formatBlock === "div" || formatBlock === "DIV" || formatBlock === ""
588
+ });
589
+ };
590
+ const getCurrentBlockLabel = () => {
591
+ if (activeFormats.h1) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
592
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 mr-1 shrink-0" }),
593
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 1" })
594
+ ] });
595
+ if (activeFormats.h2) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
596
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 mr-1 shrink-0" }),
597
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 2" })
598
+ ] });
599
+ if (activeFormats.h3) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
600
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 mr-1 shrink-0" }),
601
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 3" })
602
+ ] });
603
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
604
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 mr-1 shrink-0" }),
605
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Parágrafo" })
606
+ ] });
607
+ };
608
+ React.useEffect(() => {
609
+ if (editorRef.current && editorRef.current.innerHTML !== value) {
610
+ editorRef.current.innerHTML = value;
611
+ }
612
+ const handleSelectionChange = () => {
613
+ if (document.activeElement === editorRef.current) {
614
+ updateActiveFormats();
615
+ }
616
+ };
617
+ document.addEventListener("selectionchange", handleSelectionChange);
618
+ return () => document.removeEventListener("selectionchange", handleSelectionChange);
619
+ }, []);
620
+ const execCommand = (command, value2 = "") => {
621
+ var _a;
622
+ document.execCommand(command, false, value2);
623
+ updateActiveFormats();
624
+ (_a = editorRef.current) == null ? void 0 : _a.focus();
625
+ handleInput();
626
+ };
627
+ const handleInput = () => {
628
+ if (editorRef.current) {
629
+ onChange == null ? void 0 : onChange(editorRef.current.innerHTML);
630
+ updateActiveFormats();
631
+ }
632
+ };
633
+ const getWordCount = () => {
634
+ var _a;
635
+ const text = ((_a = editorRef.current) == null ? void 0 : _a.innerText) || "";
636
+ return text.trim() ? text.trim().split(/\s+/).length : 0;
637
+ };
638
+ const getCharacterCount = () => {
639
+ var _a;
640
+ const text = ((_a = editorRef.current) == null ? void 0 : _a.innerText) || "";
641
+ return text.trim() ? text.length : 0;
642
+ };
643
+ const performSearch = (text, backward = false) => {
644
+ var _a, _b;
645
+ if (!text || !editorRef.current) return;
646
+ const editor = editorRef.current;
647
+ const selection = window.getSelection();
648
+ if (!selection) return;
649
+ const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT);
650
+ const segments = [];
651
+ let offset = 0;
652
+ let node;
653
+ while (node = walker.nextNode()) {
654
+ segments.push({ node, start: offset });
655
+ offset += node.length;
656
+ }
657
+ const fullText = segments.reduce((acc, s) => acc + (s.node.textContent ?? ""), "");
658
+ let searchFrom = 0;
659
+ if (selection.rangeCount > 0) {
660
+ const range2 = selection.getRangeAt(0);
661
+ if (editor.contains(range2.startContainer)) {
662
+ const seg = segments.find((s) => s.node === range2.startContainer);
663
+ if (seg) {
664
+ searchFrom = backward ? seg.start + range2.startOffset - 1 : seg.start + range2.endOffset;
665
+ }
666
+ }
667
+ }
668
+ const lowerFull = fullText.toLowerCase();
669
+ const lowerQuery = text.toLowerCase();
670
+ let matchStart = -1;
671
+ if (backward) {
672
+ matchStart = lowerFull.lastIndexOf(lowerQuery, Math.max(0, searchFrom));
673
+ if (matchStart === -1) matchStart = lowerFull.lastIndexOf(lowerQuery);
674
+ } else {
675
+ matchStart = lowerFull.indexOf(lowerQuery, searchFrom);
676
+ if (matchStart === -1) matchStart = lowerFull.indexOf(lowerQuery);
677
+ }
678
+ if (matchStart === -1) return;
679
+ const matchEnd = matchStart + text.length;
680
+ const range = document.createRange();
681
+ let startSet = false;
682
+ let endSet = false;
683
+ for (let i = 0; i < segments.length && !endSet; i++) {
684
+ const seg = segments[i];
685
+ const segEnd = seg.start + seg.node.length;
686
+ if (!startSet && matchStart < segEnd && matchStart >= seg.start) {
687
+ range.setStart(seg.node, matchStart - seg.start);
688
+ startSet = true;
689
+ }
690
+ if (startSet && matchEnd <= segEnd) {
691
+ range.setEnd(seg.node, matchEnd - seg.start);
692
+ endSet = true;
693
+ }
694
+ }
695
+ if (startSet && endSet) {
696
+ selection.removeAllRanges();
697
+ selection.addRange(range);
698
+ (_b = (_a = range.startContainer.parentElement) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, { block: "nearest" });
699
+ }
700
+ };
701
+ const handleCreateLink = () => {
702
+ if (savedSelection.current) {
703
+ const selection2 = window.getSelection();
704
+ selection2 == null ? void 0 : selection2.removeAllRanges();
705
+ selection2 == null ? void 0 : selection2.addRange(savedSelection.current);
706
+ }
707
+ const selection = window.getSelection();
708
+ const anchorNode = selection == null ? void 0 : selection.anchorNode;
709
+ const existingLink = findParentTag(anchorNode || null, "A");
710
+ if (existingLink) {
711
+ if (linkUrl) {
712
+ existingLink.setAttribute("href", linkUrl);
713
+ existingLink.setAttribute("target", "_blank");
714
+ existingLink.setAttribute("rel", "noopener noreferrer");
715
+ existingLink.style.color = "hsl(var(--primary))";
716
+ existingLink.style.textDecoration = "underline";
717
+ existingLink.style.cursor = "pointer";
718
+ }
719
+ handleInput();
720
+ setIsLinkOpen(false);
721
+ savedSelection.current = null;
722
+ return;
723
+ }
724
+ if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
725
+ return;
726
+ }
727
+ if (linkUrl) {
728
+ execCommand("createLink", linkUrl);
729
+ setTimeout(() => {
730
+ var _a;
731
+ const anchor = findParentTag(((_a = window.getSelection()) == null ? void 0 : _a.anchorNode) || null, "A");
732
+ if (anchor) {
733
+ anchor.setAttribute("target", "_blank");
734
+ anchor.setAttribute("rel", "noopener noreferrer");
735
+ anchor.style.color = "hsl(var(--primary))";
736
+ anchor.style.textDecoration = "underline";
737
+ anchor.style.cursor = "pointer";
738
+ }
739
+ handleInput();
740
+ }, 10);
741
+ setIsLinkOpen(false);
742
+ savedSelection.current = null;
743
+ }
744
+ };
745
+ const handleUnlink = () => {
746
+ const selection = window.getSelection();
747
+ const anchorNode = selection == null ? void 0 : selection.anchorNode;
748
+ const existingLink = findParentTag(anchorNode || null, "A");
749
+ if (existingLink) {
750
+ const parent = existingLink.parentNode;
751
+ while (existingLink.firstChild) {
752
+ parent == null ? void 0 : parent.insertBefore(existingLink.firstChild, existingLink);
753
+ }
754
+ parent == null ? void 0 : parent.removeChild(existingLink);
755
+ handleInput();
756
+ } else {
757
+ execCommand("unlink");
758
+ }
759
+ };
760
+ const onLinkPopoverOpenChange = (open) => {
761
+ if (open) {
762
+ const selection = window.getSelection();
763
+ const anchorNode = selection == null ? void 0 : selection.anchorNode;
764
+ const focusNode = selection == null ? void 0 : selection.focusNode;
765
+ const existingLink = findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A");
766
+ if (existingLink) {
767
+ setLinkUrl(existingLink.getAttribute("href") || "https://");
768
+ } else {
769
+ setLinkUrl("https://");
770
+ }
771
+ if (selection && selection.rangeCount > 0 && (!selection.isCollapsed || existingLink)) {
772
+ savedSelection.current = selection.getRangeAt(0).cloneRange();
773
+ } else {
774
+ savedSelection.current = null;
775
+ }
776
+ setTimeout(() => {
777
+ var _a;
778
+ return (_a = linkInputRef.current) == null ? void 0 : _a.focus();
779
+ }, 100);
780
+ }
781
+ setIsLinkOpen(open);
782
+ };
783
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tooltip.cn("flex flex-col h-full w-full bg-background sm:border border-border sm:shadow-sm sm:rounded-lg overflow-hidden", disabled && "opacity-50 pointer-events-none", className), children: [
784
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
785
+ [contenteditable]:empty:before {
786
+ content: attr(data-placeholder);
787
+ color: hsl(var(--muted-foreground));
788
+ pointer-events: none;
789
+ display: block;
790
+ }
791
+ .prose-editor ul {
792
+ list-style-type: disc !important;
793
+ padding-left: 1.5rem !important;
794
+ margin-top: 0.5rem !important;
795
+ margin-bottom: 0.5rem !important;
796
+ }
797
+ .prose-editor ol {
798
+ list-style-type: decimal !important;
799
+ padding-left: 1.5rem !important;
800
+ margin-top: 0.5rem !important;
801
+ margin-bottom: 0.5rem !important;
802
+ }
803
+ .prose-editor b, .prose-editor strong {
804
+ font-weight: 600 !important;
805
+ }
806
+ .prose-editor i, .prose-editor em {
807
+ font-style: italic !important;
808
+ }
809
+ .prose-editor u {
810
+ text-decoration: underline !important;
811
+ }
812
+ .prose-editor h1 {
813
+ font-size: 2.25rem !important;
814
+ font-weight: 700 !important;
815
+ margin-bottom: 1.25rem !important;
816
+ line-height: 1.2 !important;
817
+ margin-top: 2rem !important;
818
+ color: hsl(var(--foreground));
819
+ }
820
+ .prose-editor h2 {
821
+ font-size: 1.75rem !important;
822
+ font-weight: 600 !important;
823
+ margin-bottom: 1rem !important;
824
+ margin-top: 1.5rem !important;
825
+ color: hsl(var(--foreground));
826
+ }
827
+ .prose-editor h3 {
828
+ font-size: 1.35rem !important;
829
+ font-weight: 600 !important;
830
+ margin-bottom: 0.75rem !important;
831
+ margin-top: 1.25rem !important;
832
+ color: hsl(var(--foreground));
833
+ }
834
+ .prose-editor p {
835
+ margin-bottom: 1rem !important;
836
+ line-height: 1.6 !important;
837
+ }
838
+ .prose-editor a {
839
+ color: var(--info) !important;
840
+ text-decoration: underline !important;
841
+ cursor: pointer !important;
842
+ }
843
+ .prose-editor h1:first-child, .prose-editor h2:first-child, .prose-editor h3:first-child, .prose-editor p:first-child {
844
+ margin-top: 0 !important;
845
+ }
846
+ .prose-editor {
847
+ outline: none !important;
848
+ }
849
+ ` }),
850
+ showToolbar && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-2 border-b border-border bg-muted/30 flex items-center gap-1 flex-wrap shrink-0", children: [
851
+ allowUndoRedo && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
852
+ /* @__PURE__ */ jsxRuntime.jsx(
853
+ tooltip.Button,
854
+ {
855
+ variant: "ghost",
856
+ size: "icon",
857
+ className: "h-8 w-8 text-muted-foreground",
858
+ onClick: () => execCommand("undo"),
859
+ title: "Desfazer",
860
+ "aria-label": "Desfazer",
861
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-4 h-4" })
862
+ }
863
+ ),
864
+ /* @__PURE__ */ jsxRuntime.jsx(
865
+ tooltip.Button,
866
+ {
867
+ variant: "ghost",
868
+ size: "icon",
869
+ className: "h-8 w-8 text-muted-foreground",
870
+ onClick: () => execCommand("redo"),
871
+ title: "Refazer",
872
+ "aria-label": "Refazer",
873
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Redo, { className: "w-4 h-4" })
874
+ }
875
+ ),
876
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
877
+ ] }),
878
+ allowHeadings && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
879
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { modal: false, children: [
880
+ /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Button, { variant: "ghost", size: "sm", className: "h-8 gap-0 text-muted-foreground w-[120px] justify-start px-2", children: [
881
+ getCurrentBlockLabel(),
882
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 ml-auto opacity-50 shrink-0" })
883
+ ] }) }),
884
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "start", className: "w-[160px]", style: { zIndex: 9999 }, children: [
885
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "P"), className: "gap-2", children: [
886
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 text-muted-foreground" }),
887
+ " Parágrafo"
888
+ ] }),
889
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H1"), className: "gap-2", children: [
890
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 text-muted-foreground" }),
891
+ " Título 1"
892
+ ] }),
893
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H2"), className: "gap-2", children: [
894
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 text-muted-foreground" }),
895
+ " Título 2"
896
+ ] }),
897
+ /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H3"), className: "gap-2", children: [
898
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 text-muted-foreground" }),
899
+ " Título 3"
900
+ ] })
901
+ ] })
902
+ ] }),
903
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
904
+ ] }),
905
+ allowFormatting && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
906
+ /* @__PURE__ */ jsxRuntime.jsx(
907
+ tooltip.Button,
908
+ {
909
+ variant: "ghost",
910
+ size: "icon",
911
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.bold && "bg-muted text-foreground"),
912
+ onClick: () => execCommand("bold"),
913
+ title: "Negrito",
914
+ "aria-label": "Negrito",
915
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: "w-4 h-4" })
916
+ }
917
+ ),
918
+ /* @__PURE__ */ jsxRuntime.jsx(
919
+ tooltip.Button,
920
+ {
921
+ variant: "ghost",
922
+ size: "icon",
923
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.italic && "bg-muted text-foreground"),
924
+ onClick: () => execCommand("italic"),
925
+ title: "Itálico",
926
+ "aria-label": "Itálico",
927
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: "w-4 h-4" })
928
+ }
929
+ ),
930
+ /* @__PURE__ */ jsxRuntime.jsx(
931
+ tooltip.Button,
932
+ {
933
+ variant: "ghost",
934
+ size: "icon",
935
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.underline && "bg-muted text-foreground"),
936
+ onClick: () => execCommand("underline"),
937
+ title: "Sublinhado",
938
+ "aria-label": "Sublinhado",
939
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: "w-4 h-4" })
940
+ }
941
+ ),
942
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
943
+ ] }),
944
+ allowAlignment && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
945
+ /* @__PURE__ */ jsxRuntime.jsx(
946
+ tooltip.Button,
947
+ {
948
+ variant: "ghost",
949
+ size: "icon",
950
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyLeft && "bg-muted text-foreground"),
951
+ onClick: () => execCommand("justifyLeft"),
952
+ title: "Alinhar à esquerda",
953
+ "aria-label": "Alinhar à esquerda",
954
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeft, { className: "w-4 h-4" })
955
+ }
956
+ ),
957
+ /* @__PURE__ */ jsxRuntime.jsx(
958
+ tooltip.Button,
959
+ {
960
+ variant: "ghost",
961
+ size: "icon",
962
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyCenter && "bg-muted text-foreground"),
963
+ onClick: () => execCommand("justifyCenter"),
964
+ title: "Centralizar",
965
+ "aria-label": "Centralizar",
966
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignCenter, { className: "w-4 h-4" })
967
+ }
968
+ ),
969
+ /* @__PURE__ */ jsxRuntime.jsx(
970
+ tooltip.Button,
971
+ {
972
+ variant: "ghost",
973
+ size: "icon",
974
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyRight && "bg-muted text-foreground"),
975
+ onClick: () => execCommand("justifyRight"),
976
+ title: "Alinhar à direita",
977
+ "aria-label": "Alinhar à direita",
978
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignRight, { className: "w-4 h-4" })
979
+ }
980
+ ),
981
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
982
+ ] }),
983
+ allowLists && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
984
+ /* @__PURE__ */ jsxRuntime.jsx(
985
+ tooltip.Button,
986
+ {
987
+ variant: "ghost",
988
+ size: "icon",
989
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.insertUnorderedList && "bg-muted text-foreground"),
990
+ onClick: () => execCommand("insertUnorderedList"),
991
+ title: "Lista com marcadores",
992
+ "aria-label": "Lista com marcadores",
993
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "w-4 h-4" })
994
+ }
995
+ ),
996
+ /* @__PURE__ */ jsxRuntime.jsx(
997
+ tooltip.Button,
998
+ {
999
+ variant: "ghost",
1000
+ size: "icon",
1001
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.insertOrderedList && "bg-muted text-foreground"),
1002
+ onClick: () => execCommand("insertOrderedList"),
1003
+ title: "Lista numerada",
1004
+ "aria-label": "Lista numerada",
1005
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "w-4 h-4" })
1006
+ }
1007
+ ),
1008
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
1009
+ ] }),
1010
+ allowLinks && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1011
+ /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { open: isLinkOpen, onOpenChange: onLinkPopoverOpenChange, modal: false, children: [
1012
+ /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1013
+ tooltip.Button,
1014
+ {
1015
+ variant: "ghost",
1016
+ size: "icon",
1017
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", (activeFormats.link || isLinkOpen) && "bg-muted text-foreground"),
1018
+ title: "Inserir link",
1019
+ "aria-label": "Inserir link",
1020
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "w-4 h-4" })
1021
+ }
1022
+ ) }),
1023
+ /* @__PURE__ */ jsxRuntime.jsx(input.PopoverContent, { className: "w-80 p-3", align: "start", style: { zIndex: 9999 }, children: !savedSelection.current && !activeFormats.link ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground py-1", children: "Selecione um texto para criar um link." }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
1024
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium", children: activeFormats.link ? "Editar Link" : "Inserir Link" }),
1025
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
1026
+ /* @__PURE__ */ jsxRuntime.jsx(
1027
+ input.Input,
1028
+ {
1029
+ ref: linkInputRef,
1030
+ placeholder: "https://...",
1031
+ value: linkUrl,
1032
+ onChange: (e) => setLinkUrl(e.target.value),
1033
+ onKeyDown: (e) => e.key === "Enter" && handleCreateLink(),
1034
+ className: "h-8 text-xs"
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ jsxRuntime.jsx(tooltip.Button, { size: "sm", className: "h-8", onClick: handleCreateLink, children: "Aplicar" })
1038
+ ] })
1039
+ ] }) })
1040
+ ] }),
1041
+ /* @__PURE__ */ jsxRuntime.jsx(
1042
+ tooltip.Button,
1043
+ {
1044
+ variant: "ghost",
1045
+ size: "icon",
1046
+ className: "h-8 w-8 text-muted-foreground",
1047
+ onClick: handleUnlink,
1048
+ title: "Remover link",
1049
+ "aria-label": "Remover link",
1050
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
1051
+ }
1052
+ ),
1053
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
1054
+ ] }),
1055
+ (allowFormatting || allowHeadings || allowAlignment || allowLists || allowLinks) && /* @__PURE__ */ jsxRuntime.jsx(
1056
+ tooltip.Button,
1057
+ {
1058
+ variant: "ghost",
1059
+ size: "icon",
1060
+ className: "h-8 w-8 text-muted-foreground",
1061
+ onClick: () => execCommand("removeFormat"),
1062
+ title: "Limpar formatação",
1063
+ "aria-label": "Limpar formatação",
1064
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4" })
1065
+ }
1066
+ ),
1067
+ allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
1068
+ tooltip.Button,
1069
+ {
1070
+ variant: "ghost",
1071
+ size: "icon",
1072
+ className: tooltip.cn("h-8 w-8 text-muted-foreground", isSearchOpen && "bg-muted text-foreground"),
1073
+ onClick: () => {
1074
+ setIsSearchOpen(!isSearchOpen);
1075
+ if (!isSearchOpen) setTimeout(() => {
1076
+ var _a;
1077
+ return (_a = searchInputRef.current) == null ? void 0 : _a.focus();
1078
+ }, 100);
1079
+ },
1080
+ title: "Buscar",
1081
+ "aria-label": "Buscar",
1082
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" })
1083
+ }
1084
+ ),
1085
+ actionButton && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
1087
+ actionButton
1088
+ ] })
1089
+ ] }),
1090
+ isSearchOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 border-b border-border bg-muted/20 flex items-center gap-2", children: [
1091
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 max-w-sm", children: [
1092
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-muted-foreground" }),
1093
+ /* @__PURE__ */ jsxRuntime.jsx(
1094
+ input.Input,
1095
+ {
1096
+ ref: searchInputRef,
1097
+ placeholder: "Buscar no texto...",
1098
+ value: searchQuery,
1099
+ onChange: (e) => setSearchQuery(e.target.value),
1100
+ onKeyDown: (e) => {
1101
+ if (e.key === "Enter") {
1102
+ e.preventDefault();
1103
+ performSearch(searchQuery, e.shiftKey);
1104
+ }
1105
+ if (e.key === "Escape") {
1106
+ setIsSearchOpen(false);
1107
+ }
1108
+ },
1109
+ className: "h-8 pl-8 text-xs bg-background"
1110
+ }
1111
+ )
1112
+ ] }),
1113
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
1114
+ /* @__PURE__ */ jsxRuntime.jsx(
1115
+ tooltip.Button,
1116
+ {
1117
+ variant: "ghost",
1118
+ size: "icon",
1119
+ className: "h-7 w-7",
1120
+ onMouseDown: (e) => e.preventDefault(),
1121
+ onClick: () => performSearch(searchQuery, true),
1122
+ title: "Anterior",
1123
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "w-4 h-4" })
1124
+ }
1125
+ ),
1126
+ /* @__PURE__ */ jsxRuntime.jsx(
1127
+ tooltip.Button,
1128
+ {
1129
+ variant: "ghost",
1130
+ size: "icon",
1131
+ className: "h-7 w-7",
1132
+ onMouseDown: (e) => e.preventDefault(),
1133
+ onClick: () => performSearch(searchQuery, false),
1134
+ title: "Próximo",
1135
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-4 h-4" })
1136
+ }
1137
+ ),
1138
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-border mx-1" }),
1139
+ /* @__PURE__ */ jsxRuntime.jsx(
1140
+ tooltip.Button,
1141
+ {
1142
+ variant: "ghost",
1143
+ size: "icon",
1144
+ className: "h-7 w-7 text-muted-foreground hover:text-foreground",
1145
+ onClick: () => setIsSearchOpen(false),
1146
+ title: "Fechar busca",
1147
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
1148
+ }
1149
+ )
1150
+ ] }),
1151
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hidden sm:block text-[10px] text-muted-foreground ml-auto uppercase tracking-wider font-medium", children: "Pressione Enter para buscar" })
1152
+ ] }),
1153
+ /* @__PURE__ */ jsxRuntime.jsx(
1154
+ "div",
1155
+ {
1156
+ className: "flex-1 overflow-y-auto p-4 sm:p-8 bg-background scrollbar-thin",
1157
+ style: { minHeight, maxHeight },
1158
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1159
+ "div",
1160
+ {
1161
+ ref: editorRef,
1162
+ contentEditable: isEditable,
1163
+ onInput: handleInput,
1164
+ onSelect: isEditable ? updateActiveFormats : void 0,
1165
+ onFocus: () => {
1166
+ updateActiveFormats();
1167
+ onFocus == null ? void 0 : onFocus();
1168
+ },
1169
+ onBlur,
1170
+ className: "prose-editor min-h-full max-w-none focus:outline-none",
1171
+ "data-placeholder": placeholder
1172
+ }
1173
+ )
1174
+ }
1175
+ ),
1176
+ (showWordCount || showCharacterCount) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 border-t border-border bg-muted/20 flex items-center justify-between", children: [
1177
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] sm:text-xs text-muted-foreground font-medium uppercase tracking-wider flex items-center gap-2", children: [
1178
+ showWordCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1179
+ getWordCount(),
1180
+ " ",
1181
+ getWordCount() === 1 ? "palavra" : "palavras"
1182
+ ] }),
1183
+ showWordCount && showCharacterCount && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/40", children: "•" }),
1184
+ showCharacterCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
1185
+ getCharacterCount(),
1186
+ " ",
1187
+ getCharacterCount() === 1 ? "caractere" : "caracteres"
1188
+ ] })
1189
+ ] }),
1190
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] sm:text-xs text-muted-foreground/60 italic", children: "Auto-save ativo" })
1191
+ ] })
1192
+ ] });
1193
+ }
1194
+ exports.ChartContainer = ChartContainer;
1195
+ exports.ChartLegend = ChartLegend;
1196
+ exports.ChartLegendContent = ChartLegendContent;
1197
+ exports.ChartStyle = ChartStyle;
1198
+ exports.ChartTooltip = ChartTooltip;
1199
+ exports.ChartTooltipContent = ChartTooltipContent;
1200
+ exports.Dialog = Dialog;
1201
+ exports.DialogBody = DialogBody;
1202
+ exports.DialogClose = DialogClose;
1203
+ exports.DialogContent = DialogContent;
1204
+ exports.DialogDescription = DialogDescription;
1205
+ exports.DialogFooter = DialogFooter;
1206
+ exports.DialogHeader = DialogHeader;
1207
+ exports.DialogOverlay = DialogOverlay;
1208
+ exports.DialogPortal = DialogPortal;
1209
+ exports.DialogTitle = DialogTitle;
1210
+ exports.DialogTrigger = DialogTrigger;
1211
+ exports.RichTextEditor = RichTextEditor;
1212
+ exports.Table = Table;
1213
+ exports.TableBody = TableBody;
1214
+ exports.TableCaption = TableCaption;
1215
+ exports.TableCell = TableCell;
1216
+ exports.TableFooter = TableFooter;
1217
+ exports.TableHead = TableHead;
1218
+ exports.TableHeader = TableHeader;
1219
+ exports.TableRow = TableRow;
1220
+ exports.Textarea = Textarea;