xertica-ui 2.5.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (577) hide show
  1. package/CHANGELOG.md +687 -656
  2. package/README.md +482 -482
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +1293 -1256
  6. package/bin/generate-tokens.ts +256 -262
  7. package/bin/language-config.test.ts +32 -0
  8. package/bin/language-config.ts +36 -11
  9. package/components/Introduction.mdx +121 -121
  10. package/components/assistant/code-block/CodeBlock.tsx +7 -6
  11. package/components/assistant/code-block/code-block.mdx +38 -38
  12. package/components/assistant/code-block/code-block.test.tsx +2 -1
  13. package/components/assistant/formatted-document/FormattedDocument.tsx +3 -0
  14. package/components/assistant/formatted-document/formatted-document.mdx +31 -31
  15. package/components/assistant/formatted-document/formatted-document.test.tsx +5 -4
  16. package/components/assistant/markdown-message/MarkdownMessage.tsx +1 -1
  17. package/components/assistant/markdown-message/markdown-message.mdx +44 -44
  18. package/components/assistant/modern-chat-input/modern-chat-input.mdx +71 -71
  19. package/components/assistant/modern-chat-input/modern-chat-input.test.tsx +3 -2
  20. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +1 -1
  21. package/components/assistant/xertica-assistant/types.ts +3 -2
  22. package/components/assistant/xertica-assistant/use-assistant.ts +5 -4
  23. package/components/assistant/xertica-assistant/xertica-assistant.mdx +66 -66
  24. package/components/assistant/xertica-assistant/xertica-assistant.test.tsx +2 -1
  25. package/components/blocks/card-patterns/card-patterns.mdx +123 -123
  26. package/components/brand/branding/branding.mdx +27 -27
  27. package/components/brand/language-selector/language-selector.mdx +126 -126
  28. package/components/brand/theme-toggle/theme-toggle.mdx +47 -47
  29. package/components/brand/theme-toggle/theme-toggle.test.tsx +6 -2
  30. package/components/brand/xertica-logo/xertica-logo.mdx +56 -56
  31. package/components/brand/xertica-orbe/xertica-orbe.mdx +38 -38
  32. package/components/brand/xertica-provider/XerticaProvider.tsx +112 -112
  33. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  34. package/components/brand/xertica-provider/xertica-provider.test.tsx +25 -13
  35. package/components/brand/xertica-xlogo/xertica-xlogo.mdx +55 -55
  36. package/components/examples/DrawingMapExample.tsx +1 -4
  37. package/components/layout/header/header.mdx +117 -117
  38. package/components/layout/header/header.test.tsx +2 -1
  39. package/components/layout/sidebar/sidebar.mdx +99 -99
  40. package/components/layout/sidebar/sidebar.stories.tsx +1033 -1033
  41. package/components/layout/sidebar/sidebar.test.tsx +2 -1
  42. package/components/layout/sidebar/sidebar.tsx +1509 -1501
  43. package/components/media/audio-player/AudioPlayer.mdx +67 -67
  44. package/components/media/audio-player/AudioPlayer.test.tsx +2 -1
  45. package/components/media/floating-media-wrapper.mdx +74 -74
  46. package/components/media/video-player/VideoPlayer.mdx +102 -102
  47. package/components/media/video-player/VideoPlayer.test.tsx +3 -2
  48. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +188 -188
  49. package/components/pages/forgot-password-page/forgot-password-page.mdx +60 -60
  50. package/components/pages/forgot-password-page/forgot-password-page.test.tsx +2 -1
  51. package/components/pages/home-content/HomeContent.tsx +2 -3
  52. package/components/pages/home-content/home-content.mdx +62 -62
  53. package/components/pages/home-page/HomePage.stories.tsx +8 -15
  54. package/components/pages/home-page/home-page.mdx +53 -53
  55. package/components/pages/home-page/home-page.test.tsx +2 -1
  56. package/components/pages/login-page/LoginPage.mdx +31 -31
  57. package/components/pages/login-page/LoginPage.tsx +218 -218
  58. package/components/pages/login-page/login-page.test.tsx +2 -1
  59. package/components/pages/reset-password-page/ResetPasswordPage.tsx +243 -243
  60. package/components/pages/reset-password-page/reset-password-page.mdx +63 -63
  61. package/components/pages/template-content/TemplateContent.tsx +2 -3
  62. package/components/pages/template-content/template-content.mdx +61 -61
  63. package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
  64. package/components/pages/template-page/template-page.mdx +53 -53
  65. package/components/pages/template-page/template-page.test.tsx +2 -1
  66. package/components/pages/verify-email-page/VerifyEmailPage.tsx +206 -206
  67. package/components/pages/verify-email-page/verify-email-page.mdx +55 -55
  68. package/components/public-api-smoke.test.tsx +10 -6
  69. package/components/shared/assistant-utils.ts +3 -2
  70. package/components/shared/navigation.ts +2 -2
  71. package/components/ui/accordion/accordion.mdx +29 -29
  72. package/components/ui/alert/alert.mdx +29 -29
  73. package/components/ui/alert-dialog/alert-dialog.mdx +26 -26
  74. package/components/ui/aspect-ratio/aspect-ratio.mdx +25 -25
  75. package/components/ui/assistant-chart/AssistantChart.tsx +8 -2
  76. package/components/ui/assistant-chart/assistant-chart.mdx +25 -25
  77. package/components/ui/avatar/avatar.mdx +26 -26
  78. package/components/ui/badge/badge.mdx +28 -28
  79. package/components/ui/breadcrumb/breadcrumb.mdx +26 -26
  80. package/components/ui/button/button.mdx +29 -29
  81. package/components/ui/calendar/calendar.mdx +26 -26
  82. package/components/ui/card/card.mdx +26 -26
  83. package/components/ui/carousel/carousel.mdx +26 -26
  84. package/components/ui/chart/chart.mdx +26 -26
  85. package/components/ui/chart/chart.test.tsx +178 -178
  86. package/components/ui/chart/chart.tsx +2252 -2245
  87. package/components/ui/checkbox/checkbox.mdx +26 -26
  88. package/components/ui/collapsible/collapsible.mdx +25 -25
  89. package/components/ui/command/command.mdx +26 -26
  90. package/components/ui/context-menu/context-menu.mdx +26 -26
  91. package/components/ui/dialog/dialog.mdx +26 -26
  92. package/components/ui/drawer/drawer.mdx +26 -26
  93. package/components/ui/dropdown-menu/dropdown-menu.mdx +26 -26
  94. package/components/ui/empty/empty.mdx +26 -26
  95. package/components/ui/file-upload/file-upload.mdx +26 -26
  96. package/components/ui/form/form.mdx +20 -20
  97. package/components/ui/google-maps-loader/google-maps-loader.mdx +68 -68
  98. package/components/ui/hover-card/hover-card.mdx +26 -26
  99. package/components/ui/input/input.mdx +29 -29
  100. package/components/ui/input-otp/input-otp.mdx +26 -26
  101. package/components/ui/label/label.mdx +25 -25
  102. package/components/ui/map/map.mdx +26 -26
  103. package/components/ui/map/map.tsx +6 -1
  104. package/components/ui/menubar/menubar.mdx +26 -26
  105. package/components/ui/navigation-menu/navigation-menu.mdx +26 -26
  106. package/components/ui/notification-badge/notification-badge.mdx +26 -26
  107. package/components/ui/page-header/page-header.mdx +44 -44
  108. package/components/ui/pagination/pagination.mdx +26 -26
  109. package/components/ui/popover/popover.mdx +26 -26
  110. package/components/ui/progress/progress.mdx +25 -25
  111. package/components/ui/radio-group/radio-group.mdx +26 -26
  112. package/components/ui/rating/rating.mdx +26 -26
  113. package/components/ui/resizable/resizable.mdx +26 -26
  114. package/components/ui/resizable/resizable.tsx +13 -8
  115. package/components/ui/rich-text-editor/rich-text-editor.mdx +47 -47
  116. package/components/ui/route-map/route-map.mdx +26 -26
  117. package/components/ui/scroll-area/scroll-area.mdx +25 -25
  118. package/components/ui/search/search.mdx +27 -27
  119. package/components/ui/select/select.mdx +26 -26
  120. package/components/ui/separator/separator.mdx +25 -25
  121. package/components/ui/sheet/sheet.mdx +26 -26
  122. package/components/ui/simple-map/simple-map.mdx +25 -25
  123. package/components/ui/skeleton/skeleton.mdx +25 -25
  124. package/components/ui/slider/slider.mdx +26 -26
  125. package/components/ui/sonner/sonner.mdx +26 -26
  126. package/components/ui/stats-card/stats-card.mdx +26 -26
  127. package/components/ui/stats-card/stats-card.stories.tsx +117 -117
  128. package/components/ui/stats-card/stats-card.tsx +109 -109
  129. package/components/ui/stepper/stepper.mdx +26 -26
  130. package/components/ui/switch/switch.mdx +25 -25
  131. package/components/ui/table/table.mdx +27 -27
  132. package/components/ui/tabs/tabs.mdx +26 -26
  133. package/components/ui/textarea/textarea.mdx +25 -25
  134. package/components/ui/timeline/timeline.mdx +26 -26
  135. package/components/ui/toggle/toggle.mdx +26 -26
  136. package/components/ui/toggle-group/toggle-group.mdx +26 -26
  137. package/components/ui/tooltip/tooltip.mdx +26 -26
  138. package/components/ui/tree-view/tree-view.mdx +26 -26
  139. package/components.json +511 -511
  140. package/contexts/BrandColorsContext.tsx +282 -282
  141. package/contexts/i18n-singleton.test.tsx +57 -0
  142. package/contexts/theme-data.ts +391 -391
  143. package/dist/{AssistantChart-DMJJ_Amf.js → AssistantChart-BMNSA_Pk.js} +5 -5
  144. package/dist/{AssistantChart-D0A1FPYt.cjs → AssistantChart-BzM7plyc.cjs} +150 -114
  145. package/dist/{AssistantChart-BXU1ACnh.js → AssistantChart-C842evTi.js} +134 -240
  146. package/dist/{AssistantChart-BZTPJ5dP.cjs → AssistantChart-CVF2uh37.cjs} +5 -5
  147. package/dist/{AssistantChart-COGiOV-g.cjs → AssistantChart-JooMdVQU.cjs} +17 -7
  148. package/dist/{AssistantChart-CWX1OWNM.js → AssistantChart-KHS-tp-L.js} +17 -7
  149. package/dist/{BrandColorsContext-BwY-b6M4.cjs → BrandColorsContext-B4_81eas.cjs} +2 -2
  150. package/dist/{BrandColorsContext-BMRJ04Wf.js → BrandColorsContext-DbK5LnQ_.js} +2 -2
  151. package/dist/{CodeBlock-CjeFavqV.js → CodeBlock-DiKO8ocT.js} +11 -11
  152. package/dist/{CodeBlock-CV6dtsTM.cjs → CodeBlock-ZYThr7Kn.cjs} +12 -9
  153. package/dist/{XerticaXLogo-mqjoBiLI.js → LanguageSelector-CmTj3lWq.js} +85 -82
  154. package/dist/{XerticaXLogo-BX3ueACh.js → LanguageSelector-DxW6o7bt.js} +81 -81
  155. package/dist/{XerticaXLogo-uQgwns_E.cjs → LanguageSelector-Sw73qvWV.cjs} +84 -81
  156. package/dist/{ThemeContext-BgclCB35.js → ThemeContext-BGeh_Kdr.js} +290 -212
  157. package/dist/{ThemeContext-BblcjQup.cjs → ThemeContext-D50irx5T.cjs} +291 -205
  158. package/dist/{VerifyEmailPage-C_Zk6Gen.cjs → VerifyEmailPage-B6bOrybJ.cjs} +17 -17
  159. package/dist/{VerifyEmailPage-B31mCrMc.js → VerifyEmailPage-BRE5Fz59.js} +8 -8
  160. package/dist/{VerifyEmailPage-BJjAMUTW.js → VerifyEmailPage-BcCluouh.js} +151 -78
  161. package/dist/VerifyEmailPage-Bx1sr0uQ.cjs +3298 -0
  162. package/dist/{VerifyEmailPage-X14vhdyl.js → VerifyEmailPage-DUYyXCX9.js} +12 -12
  163. package/dist/VerifyEmailPage-DXXMHbzq.js +3289 -0
  164. package/dist/{VerifyEmailPage-u_Dn7t1U.cjs → VerifyEmailPage-DpYtFk35.cjs} +21 -21
  165. package/dist/{VerifyEmailPage-Cyl55sJb.js → VerifyEmailPage-NXKWW3Dk.js} +134 -64
  166. package/dist/{VerifyEmailPage-Bv8Ah_TK.cjs → VerifyEmailPage-QrCz4Wqr.cjs} +143 -73
  167. package/dist/{VerifyEmailPage-CkBYfsNy.cjs → VerifyEmailPage-ZmQra0Wi.cjs} +160 -87
  168. package/dist/{XerticaProvider-BErr83Bg.js → XerticaProvider-BF3q_myt.js} +5 -4
  169. package/dist/{XerticaProvider-CeS5G_n5.cjs → XerticaProvider-C_JSOz1U.cjs} +2 -2
  170. package/dist/{XerticaProvider-CwOkHxiT.cjs → XerticaProvider-D5zjrqZq.cjs} +5 -4
  171. package/dist/{XerticaProvider-ra2NciRq.js → XerticaProvider-KTGl4Cn1.js} +2 -2
  172. package/dist/{alert-dialog-DqlRW_An.js → alert-dialog-BrpwXKwS.js} +3 -3
  173. package/dist/{alert-dialog-DhwPioBa.cjs → alert-dialog-CZU1Zase.cjs} +3 -3
  174. package/dist/{alert-dialog-KpoabzJb.js → alert-dialog-ClRoLH7l.js} +40 -56
  175. package/dist/{alert-dialog-B4M3vQKS.cjs → alert-dialog-DBBqvU-V.cjs} +53 -38
  176. package/dist/assistant.cjs.js +2 -2
  177. package/dist/assistant.es.js +2 -2
  178. package/dist/brand.cjs.js +6 -6
  179. package/dist/brand.es.js +2 -2
  180. package/dist/cli.js +63 -21
  181. package/dist/components/assistant/code-block/CodeBlock.d.ts +2 -1
  182. package/dist/components/assistant/formatted-document/FormattedDocument.d.ts +2 -1
  183. package/dist/components/assistant/markdown-message/MarkdownMessage.d.ts +2 -1
  184. package/dist/components/assistant/modern-chat-input/ModernChatInput.d.ts +2 -1
  185. package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +2 -1
  186. package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +2 -1
  187. package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +2 -1
  188. package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +2 -1
  189. package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +2 -1
  190. package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +2 -1
  191. package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +2 -1
  192. package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +2 -1
  193. package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +2 -1
  194. package/dist/components/assistant/xertica-assistant/types.d.ts +3 -2
  195. package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +1 -1
  196. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +2 -1
  197. package/dist/components/blocks/card-patterns/ActivityCard.d.ts +1 -1
  198. package/dist/components/blocks/card-patterns/ActivityCardSkeleton.d.ts +1 -1
  199. package/dist/components/blocks/card-patterns/FeatureCard.d.ts +1 -1
  200. package/dist/components/blocks/card-patterns/FeatureCardSkeleton.d.ts +1 -1
  201. package/dist/components/blocks/card-patterns/NotificationCard.d.ts +1 -1
  202. package/dist/components/blocks/card-patterns/NotificationCardSkeleton.d.ts +1 -1
  203. package/dist/components/blocks/card-patterns/ProfileCard.d.ts +1 -1
  204. package/dist/components/blocks/card-patterns/ProfileCardSkeleton.d.ts +1 -1
  205. package/dist/components/blocks/card-patterns/ProjectCard.d.ts +1 -1
  206. package/dist/components/blocks/card-patterns/ProjectCardSkeleton.d.ts +1 -1
  207. package/dist/components/blocks/card-patterns/QuickActionCard.d.ts +1 -1
  208. package/dist/components/blocks/card-patterns/QuickActionCardSkeleton.d.ts +1 -1
  209. package/dist/components/brand/language-selector/LanguageSelector.d.ts +2 -1
  210. package/dist/components/brand/theme-toggle/ThemeToggle.d.ts +2 -1
  211. package/dist/components/brand/xertica-logo/XerticaLogo.d.ts +2 -1
  212. package/dist/components/brand/xertica-orbe/XerticaOrbe.d.ts +2 -1
  213. package/dist/components/brand/xertica-provider/XerticaProvider.d.ts +1 -1
  214. package/dist/components/brand/xertica-xlogo/XerticaXLogo.d.ts +2 -1
  215. package/dist/components/examples/DrawingMapExample.d.ts +2 -1
  216. package/dist/components/examples/FilterableMapExample.d.ts +1 -1
  217. package/dist/components/examples/MapShowcase.d.ts +2 -1
  218. package/dist/components/examples/SimpleFilterableMap.d.ts +2 -1
  219. package/dist/components/figma/ImageWithFallback.d.ts +1 -1
  220. package/dist/components/layout/header/header.d.ts +1 -1
  221. package/dist/components/layout/sidebar/sidebar.d.ts +25 -13
  222. package/dist/components/media/FloatingMediaWrapper.d.ts +1 -1
  223. package/dist/components/media/audio-player/AudioPlayer.d.ts +2 -1
  224. package/dist/components/media/video-player/VideoPlayer.d.ts +2 -1
  225. package/dist/components/pages/forgot-password-page/ForgotPasswordPage.d.ts +2 -1
  226. package/dist/components/pages/home-content/HomeContent.d.ts +2 -1
  227. package/dist/components/pages/home-page/HomePage.d.ts +2 -1
  228. package/dist/components/pages/login-page/LoginPage.d.ts +2 -1
  229. package/dist/components/pages/reset-password-page/ResetPasswordPage.d.ts +2 -1
  230. package/dist/components/pages/template-content/TemplateContent.d.ts +2 -1
  231. package/dist/components/pages/template-page/TemplatePage.d.ts +2 -1
  232. package/dist/components/pages/verify-email-page/VerifyEmailPage.d.ts +2 -1
  233. package/dist/components/shared/CustomTooltipContent.d.ts +1 -1
  234. package/dist/components/shared/assistant-utils.d.ts +3 -2
  235. package/dist/components/shared/error-boundary.d.ts +4 -4
  236. package/dist/components/shared/error-fallbacks.d.ts +4 -3
  237. package/dist/components/shared/navigation.d.ts +6 -2
  238. package/dist/components/ui/accordion/accordion.d.ts +4 -4
  239. package/dist/components/ui/alert/alert.d.ts +3 -3
  240. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +10 -10
  241. package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts +1 -1
  242. package/dist/components/ui/assistant-chart/AssistantChart.d.ts +4 -3
  243. package/dist/components/ui/avatar/avatar.d.ts +3 -3
  244. package/dist/components/ui/badge/badge.d.ts +1 -1
  245. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +7 -7
  246. package/dist/components/ui/calendar/calendar.d.ts +2 -2
  247. package/dist/components/ui/card/card.d.ts +7 -7
  248. package/dist/components/ui/carousel/carousel.d.ts +5 -5
  249. package/dist/components/ui/chart/chart.d.ts +16 -16
  250. package/dist/components/ui/collapsible/collapsible.d.ts +3 -3
  251. package/dist/components/ui/command/command.d.ts +9 -9
  252. package/dist/components/ui/context-menu/context-menu.d.ts +15 -15
  253. package/dist/components/ui/dialog/dialog.d.ts +9 -9
  254. package/dist/components/ui/drawer/drawer.d.ts +10 -10
  255. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +15 -15
  256. package/dist/components/ui/form/form.d.ts +7 -7
  257. package/dist/components/ui/google-maps-loader/google-maps-loader.d.ts +3 -3
  258. package/dist/components/ui/hover-card/hover-card.d.ts +3 -3
  259. package/dist/components/ui/input-otp/input-otp.d.ts +4 -4
  260. package/dist/components/ui/label/label.d.ts +1 -1
  261. package/dist/components/ui/menubar/menubar.d.ts +16 -16
  262. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +8 -8
  263. package/dist/components/ui/page-header/page-header.d.ts +3 -3
  264. package/dist/components/ui/pagination/pagination.d.ts +7 -7
  265. package/dist/components/ui/popover/popover.d.ts +4 -4
  266. package/dist/components/ui/progress/progress.d.ts +1 -1
  267. package/dist/components/ui/resizable/resizable.d.ts +11 -7
  268. package/dist/components/ui/rich-text-editor/rich-text-editor.d.ts +1 -1
  269. package/dist/components/ui/scroll-area/scroll-area.d.ts +2 -2
  270. package/dist/components/ui/separator/separator.d.ts +1 -1
  271. package/dist/components/ui/sheet/sheet.d.ts +10 -10
  272. package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
  273. package/dist/components/ui/sonner/sonner.d.ts +2 -1
  274. package/dist/components/ui/stats-card/stats-card-skeleton.d.ts +1 -1
  275. package/dist/components/ui/table/table.d.ts +8 -8
  276. package/dist/components/ui/tabs/tabs.d.ts +4 -4
  277. package/dist/components/ui/tooltip/tooltip.d.ts +4 -4
  278. package/dist/contexts/ApiKeyContext.d.ts +2 -2
  279. package/dist/contexts/AssistenteContext.d.ts +1 -1
  280. package/dist/contexts/AuthContext.d.ts +1 -1
  281. package/dist/contexts/LanguageContext.d.ts +2 -2
  282. package/dist/contexts/LayoutContext.d.ts +2 -2
  283. package/dist/contexts/ThemeContext.d.ts +1 -1
  284. package/dist/features/assistant/hooks/useAssistantConfig.d.ts +1 -1
  285. package/dist/features/home/hooks/useDashboardStats.d.ts +1 -1
  286. package/dist/features/home/hooks/useFeatureCards.d.ts +1 -1
  287. package/dist/features/home/hooks/useTeamMembers.d.ts +1 -1
  288. package/dist/{google-maps-loader-BCe58h9D.js → google-maps-loader-BOug999f.js} +0 -4
  289. package/dist/{google-maps-loader-casMyxlo.cjs → google-maps-loader-DfeBRI8Q.cjs} +0 -5
  290. package/dist/hooks.cjs.js +2 -2
  291. package/dist/hooks.es.js +2 -2
  292. package/dist/{index-9GWd0qxq.cjs → index-BQjx1Mdf.cjs} +1 -1
  293. package/dist/index-Bei5DzAL.js +6 -0
  294. package/dist/index.cjs.js +18 -18
  295. package/dist/index.es.js +12 -12
  296. package/dist/{input-cc-PTD4R.js → input-B0_vbA3g.js} +3 -61
  297. package/dist/{input-C_UiS2Py.cjs → input-ByYuOv8A.cjs} +1 -62
  298. package/dist/layout.cjs.js +1 -1
  299. package/dist/layout.es.js +1 -1
  300. package/dist/pages.cjs.js +1 -1
  301. package/dist/pages.es.js +1 -1
  302. package/dist/{rich-text-editor-DxO1Hz3a.cjs → rich-text-editor-BuqSu718.cjs} +70 -5
  303. package/dist/{rich-text-editor-DqLICivI.js → rich-text-editor-CV8FtA_l.js} +68 -6
  304. package/dist/{rich-text-editor-DloeW0wc.js → rich-text-editor-DV1SixzE.js} +61 -3
  305. package/dist/{rich-text-editor-B2CKz7nx.cjs → rich-text-editor-DnSDglzW.cjs} +63 -2
  306. package/dist/{sidebar-BS1p2V7t.cjs → sidebar-BGJ0j567.cjs} +367 -9
  307. package/dist/{sidebar-3XyzjVBw.js → sidebar-BI6mZlC8.js} +364 -6
  308. package/dist/{sidebar-DyYvgyBj.cjs → sidebar-BtmotOg-.cjs} +367 -9
  309. package/dist/{sidebar-Duermn32.js → sidebar-D3EgGVxF.js} +77 -63
  310. package/dist/{sidebar-CLmIjgNd.cjs → sidebar-DDTqMGnR.cjs} +80 -66
  311. package/dist/{sidebar-B4ZWaMrE.js → sidebar-I7EXyf5D.js} +364 -6
  312. package/dist/ui.cjs.js +7 -7
  313. package/dist/ui.es.js +5 -5
  314. package/dist/{xertica-assistant-QFUnv5I2.cjs → xertica-assistant-BrF9jScR.cjs} +4 -4
  315. package/dist/{xertica-assistant-BbgzsgsG.js → xertica-assistant-CJVnvMqU.js} +55 -45
  316. package/dist/{xertica-assistant-d2qs2Vd9.cjs → xertica-assistant-CKPtc1z5.cjs} +58 -40
  317. package/dist/{xertica-assistant-CyikE3N_.js → xertica-assistant-CsBsxTsI.js} +2 -2
  318. package/dist/{xertica-assistant-CIaUlbIt.cjs → xertica-assistant-DER0brPQ.cjs} +6 -5
  319. package/dist/{xertica-assistant-B1NaSFFj.js → xertica-assistant-DQCjpk5M.js} +4 -3
  320. package/dist/{xertica-assistant-B687qEPU.js → xertica-assistant-Dk-9AJzw.js} +16 -7
  321. package/dist/{xertica-assistant-sOHwTgIP.cjs → xertica-assistant-DxhIKvuY.cjs} +18 -9
  322. package/dist/xertica-ui.css +2 -2
  323. package/docs/components/audio-player.md +1 -1
  324. package/docs/components/sidebar.md +331 -331
  325. package/docs/components/stats-card.md +138 -138
  326. package/docs/components/toggle.md +12 -0
  327. package/docs/doc-audit.md +35 -229
  328. package/docs/i18n.md +31 -10
  329. package/docs/llms.md +6 -4
  330. package/llms-compact.txt +444 -444
  331. package/llms-full.txt +12144 -12144
  332. package/llms.txt +187 -187
  333. package/package.json +223 -219
  334. package/scripts/a11y-audit.mjs +162 -162
  335. package/scripts/fix-stories.cjs +19 -19
  336. package/styles/globals.css +0 -1
  337. package/styles/xertica/base.css +8 -0
  338. package/styles/xertica/tokens.css +240 -240
  339. package/templates/.env.example +2 -2
  340. package/templates/.prettierignore +4 -4
  341. package/templates/.prettierrc +10 -10
  342. package/templates/guidelines/Guidelines.md +865 -865
  343. package/templates/index.html +13 -13
  344. package/templates/package.json +69 -69
  345. package/templates/src/app/components/AuthGuard.tsx +11 -0
  346. package/templates/src/features/auth/ui/AuthPageShell.tsx +32 -32
  347. package/templates/src/features/home/ui/HomeContent.tsx +2 -3
  348. package/templates/src/features/settings/index.ts +2 -0
  349. package/templates/src/features/settings/ui/SettingsContent.tsx +134 -0
  350. package/templates/src/features/template/ui/TemplateContent.tsx +2 -3
  351. package/templates/src/i18n.ts +36 -13
  352. package/templates/src/locales/en/pages/settings.json +15 -0
  353. package/templates/src/locales/es/pages/settings.json +15 -0
  354. package/templates/src/locales/pt-BR/pages/settings.json +15 -0
  355. package/templates/src/pages/SettingsPage.tsx +28 -0
  356. package/templates/src/shared/config/navigation.ts +2 -2
  357. package/templates/src/styles/xertica/tokens.css +240 -240
  358. package/templates/vite.config.d.ts +2 -2
  359. package/templates/vite.config.js +20 -20
  360. package/utils/gemini.ts +2 -2
  361. package/dist/AssistantChart-9w31gdAb.cjs +0 -3363
  362. package/dist/AssistantChart-BAudAfne.cjs +0 -3591
  363. package/dist/AssistantChart-BAx9VQvb.cjs +0 -3374
  364. package/dist/AssistantChart-BP8upjMk.js +0 -3565
  365. package/dist/AssistantChart-CVko2A1W.js +0 -3348
  366. package/dist/AssistantChart-CVzmmhx4.js +0 -3337
  367. package/dist/AssistantChart-CeU2dIb6.js +0 -3469
  368. package/dist/AssistantChart-DO5UuX4J.cjs +0 -3495
  369. package/dist/AudioPlayer-1ypwE2Wh.cjs +0 -936
  370. package/dist/AudioPlayer-BJ2IuRQW.cjs +0 -1275
  371. package/dist/AudioPlayer-BWDW6TN9.cjs +0 -1279
  372. package/dist/AudioPlayer-CM962GEh.js +0 -1280
  373. package/dist/AudioPlayer-CbZId7cj.cjs +0 -998
  374. package/dist/AudioPlayer-DU8zt8-z.js +0 -999
  375. package/dist/AudioPlayer-DuKXrCfy.js +0 -937
  376. package/dist/AudioPlayer-Xxma6_-H.js +0 -1276
  377. package/dist/BrandColorsContext-DLVJgtmH.js +0 -666
  378. package/dist/BrandColorsContext-DZT7JjeD.js +0 -659
  379. package/dist/BrandColorsContext-GUyFmkX0.cjs +0 -665
  380. package/dist/BrandColorsContext-awnBCmC4.cjs +0 -666
  381. package/dist/CodeBlock-C2ZUXt8V.js +0 -219
  382. package/dist/CodeBlock-C5oYnLQp.cjs +0 -218
  383. package/dist/CodeBlock-DuxdtN-l.js +0 -219
  384. package/dist/CodeBlock-POVYONvC.cjs +0 -218
  385. package/dist/CustomTooltipContent-BT6brkVJ.cjs +0 -49
  386. package/dist/CustomTooltipContent-CfOfikhq.js +0 -33
  387. package/dist/CustomTooltipContent-DHjkY0ww.js +0 -40
  388. package/dist/CustomTooltipContent-c_K-DWRr.cjs +0 -56
  389. package/dist/FeatureCard-9GhnlgL3.js +0 -336
  390. package/dist/FeatureCard-Bcb3Zi54.js +0 -302
  391. package/dist/FeatureCard-Cfs6Ishq.js +0 -485
  392. package/dist/FeatureCard-CkPd2psQ.cjs +0 -301
  393. package/dist/FeatureCard-Dkp-xmzM.cjs +0 -335
  394. package/dist/FeatureCard-ie3L8Fpr.cjs +0 -484
  395. package/dist/FeatureCardSkeleton-CAgu8stE.js +0 -27
  396. package/dist/FeatureCardSkeleton-mO3Bdm_V.cjs +0 -26
  397. package/dist/LanguageContext-BwhwC3G2.js +0 -657
  398. package/dist/LanguageContext-DvUt5jBg.cjs +0 -656
  399. package/dist/LayoutContext-BDmcZfMH.cjs +0 -84
  400. package/dist/LayoutContext-C4kKN9RV.cjs +0 -93
  401. package/dist/LayoutContext-CGEe1oPq.js +0 -94
  402. package/dist/LayoutContext-CwT5KLiW.cjs +0 -104
  403. package/dist/LayoutContext-DVLCsoQn.js +0 -105
  404. package/dist/LayoutContext-dbQvdC4O.js +0 -85
  405. package/dist/ThemeContext-BbBNoFTG.js +0 -735
  406. package/dist/ThemeContext-Bo-W2WZH.js +0 -1856
  407. package/dist/ThemeContext-CP3a0jxy.cjs +0 -1855
  408. package/dist/ThemeContext-Cmr8Ex8H.cjs +0 -734
  409. package/dist/ThemeContext-CpqYShLq.cjs +0 -324
  410. package/dist/ThemeContext-D3LzacmG.js +0 -188
  411. package/dist/ThemeContext-DQUOeziy.cjs +0 -1855
  412. package/dist/ThemeContext-Du2nE1PL.js +0 -325
  413. package/dist/ThemeContext-GeEBTJ3q.cjs +0 -1621
  414. package/dist/ThemeContext-JyLK9B1o.js +0 -1622
  415. package/dist/ThemeContext-RTy1m2Uq.js +0 -82
  416. package/dist/ThemeContext-U4dEYc6C.cjs +0 -187
  417. package/dist/ThemeContext-bSzuOit2.cjs +0 -81
  418. package/dist/ThemeContext-ept8jhXI.js +0 -1856
  419. package/dist/VerifyEmailPage-BE-L9mB7.js +0 -2828
  420. package/dist/VerifyEmailPage-BIBOKV7Z.js +0 -3214
  421. package/dist/VerifyEmailPage-BRSP-Pwt.cjs +0 -3196
  422. package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
  423. package/dist/VerifyEmailPage-BiRm7Nh4.cjs +0 -3213
  424. package/dist/VerifyEmailPage-Bvfv8HVQ.js +0 -3214
  425. package/dist/VerifyEmailPage-CR7kb5df.cjs +0 -2827
  426. package/dist/VerifyEmailPage-C_ihbcth.js +0 -2828
  427. package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
  428. package/dist/VerifyEmailPage-CdYPSJoO.js +0 -2828
  429. package/dist/VerifyEmailPage-D-FRj5TU.cjs +0 -3213
  430. package/dist/VerifyEmailPage-DF2ilhum.cjs +0 -3210
  431. package/dist/VerifyEmailPage-DMBh4NM9.cjs +0 -2827
  432. package/dist/VerifyEmailPage-DTtFfC-J.js +0 -3197
  433. package/dist/VerifyEmailPage-Dt7zgA4w.cjs +0 -2827
  434. package/dist/VerifyEmailPage-EhudUdqF.js +0 -3211
  435. package/dist/VerifyEmailPage-RrUApqBN.js +0 -3214
  436. package/dist/VerifyEmailPage-VoMI7MYH.cjs +0 -3213
  437. package/dist/VerifyEmailPage-hdB8JQGv.cjs +0 -3213
  438. package/dist/VerifyEmailPage-vYHbYK3q.js +0 -3214
  439. package/dist/XerticaOrbe-BCUVSPPB.cjs +0 -1924
  440. package/dist/XerticaOrbe-BGIB1CTK.js +0 -1355
  441. package/dist/XerticaOrbe-By8eEvR-.js +0 -1925
  442. package/dist/XerticaOrbe-FWGjBj0U.cjs +0 -1354
  443. package/dist/XerticaProvider-AChwphCO.cjs +0 -48
  444. package/dist/XerticaProvider-AbWlr7Af.cjs +0 -48
  445. package/dist/XerticaProvider-B8CaV7xu.cjs +0 -39
  446. package/dist/XerticaProvider-BITjgC5p.js +0 -39
  447. package/dist/XerticaProvider-BSyFrmC0.js +0 -49
  448. package/dist/XerticaProvider-By8q3Roe.cjs +0 -38
  449. package/dist/XerticaProvider-CUYJZc32.js +0 -49
  450. package/dist/XerticaProvider-CW9hpCdF.cjs +0 -39
  451. package/dist/XerticaProvider-CWgby5mY.js +0 -49
  452. package/dist/XerticaProvider-CWs6EwNa.js +0 -49
  453. package/dist/XerticaProvider-CiNKjMx1.cjs +0 -48
  454. package/dist/XerticaProvider-CjQAQPcn.cjs +0 -48
  455. package/dist/XerticaProvider-D5lLumH-.js +0 -49
  456. package/dist/XerticaProvider-DQtvJU7m.js +0 -40
  457. package/dist/XerticaProvider-DUOJg9iX.js +0 -49
  458. package/dist/XerticaProvider-Dl_b72_l.cjs +0 -51
  459. package/dist/XerticaProvider-qQUDop71.cjs +0 -48
  460. package/dist/XerticaProvider-siSt9uG2.js +0 -40
  461. package/dist/XerticaXLogo-8TTzBjHw.cjs +0 -251
  462. package/dist/XerticaXLogo-B2svDGZh.cjs +0 -251
  463. package/dist/XerticaXLogo-BWaag64t.js +0 -252
  464. package/dist/XerticaXLogo-CFuIlYFH.js +0 -252
  465. package/dist/XerticaXLogo-CU-U-GP4.cjs +0 -251
  466. package/dist/XerticaXLogo-ChryA6xj.js +0 -252
  467. package/dist/XerticaXLogo-CowGv7BC.js +0 -252
  468. package/dist/XerticaXLogo-CziKMQil.cjs +0 -242
  469. package/dist/XerticaXLogo-D8jf0SNv.cjs +0 -214
  470. package/dist/XerticaXLogo-DHz5SugF.js +0 -252
  471. package/dist/XerticaXLogo-DTee_y8X.cjs +0 -251
  472. package/dist/XerticaXLogo-DfUvz-lD.js +0 -243
  473. package/dist/XerticaXLogo-DzXKZBtG.js +0 -231
  474. package/dist/XerticaXLogo-fAJMy3H4.js +0 -215
  475. package/dist/XerticaXLogo-kslQ8Tk_.cjs +0 -251
  476. package/dist/XerticaXLogo-xWbElCZj.cjs +0 -230
  477. package/dist/alert-dialog-iDe5VE5o.js +0 -842
  478. package/dist/alert-dialog-yckpaOpy.cjs +0 -865
  479. package/dist/avatar-Cq5_E8r9.cjs +0 -78
  480. package/dist/avatar-CuYu2MKt.cjs +0 -72
  481. package/dist/avatar-Cxyofu1H.js +0 -56
  482. package/dist/avatar-DSBfJMRJ.js +0 -62
  483. package/dist/breadcrumb-CVzzzqfo.js +0 -103
  484. package/dist/breadcrumb-DIJ0X3Ot.js +0 -96
  485. package/dist/breadcrumb-DjSxkjlQ.cjs +0 -95
  486. package/dist/breadcrumb-DnDlQFg2.cjs +0 -102
  487. package/dist/button-0CXwCRTm.cjs +0 -85
  488. package/dist/button-Bnv9SvYK.cjs +0 -79
  489. package/dist/button-C6uvh0rV.js +0 -63
  490. package/dist/button-qkz7Icqf.js +0 -69
  491. package/dist/card-B8-Gl5DL.js +0 -73
  492. package/dist/card-Bv_c57KU.cjs +0 -72
  493. package/dist/card-DJTsYhLL.cjs +0 -89
  494. package/dist/card-fi8zAN-I.js +0 -90
  495. package/dist/dropdown-menu-B_uEXNc4.cjs +0 -220
  496. package/dist/dropdown-menu-CFuCssWA.js +0 -204
  497. package/dist/dropdown-menu-Ze1YZFyc.cjs +0 -247
  498. package/dist/dropdown-menu-nc_Lvg-u.js +0 -231
  499. package/dist/google-maps-loader-BVoVhUwA.js +0 -316
  500. package/dist/google-maps-loader-BqsYL48U.cjs +0 -285
  501. package/dist/google-maps-loader-DjJaYhV6.cjs +0 -316
  502. package/dist/google-maps-loader-t2IlYBzw.js +0 -286
  503. package/dist/index-B7A523O_.js +0 -8
  504. package/dist/index-BabBx2pa.js +0 -6
  505. package/dist/index-CkTUgOwX.js +0 -8
  506. package/dist/index-D3RLKRAs.cjs +0 -7
  507. package/dist/index-DmHhnb7a.cjs +0 -7
  508. package/dist/index.umd.js +0 -13712
  509. package/dist/input-CNFHVKvo.cjs +0 -145
  510. package/dist/input-CPl84zAx.cjs +0 -151
  511. package/dist/input-D-6IsAca.js +0 -133
  512. package/dist/input-wPYg0d0P.js +0 -127
  513. package/dist/progress-BLwqortq.cjs +0 -105
  514. package/dist/progress-Cs9i4DPx.js +0 -81
  515. package/dist/progress-D9mtsf6j.js +0 -89
  516. package/dist/progress-DDeuWPZw.cjs +0 -97
  517. package/dist/rich-text-editor-1UW3Y2JK.js +0 -2891
  518. package/dist/rich-text-editor-BM-LPpTh.js +0 -2902
  519. package/dist/rich-text-editor-BmsjY03B.js +0 -2949
  520. package/dist/rich-text-editor-BrdC5evx.js +0 -2244
  521. package/dist/rich-text-editor-CyggTOLQ.cjs +0 -2908
  522. package/dist/rich-text-editor-DbV-S7Fi.cjs +0 -2261
  523. package/dist/rich-text-editor-DoCkKhzk.cjs +0 -2919
  524. package/dist/rich-text-editor-GS2kpTAK.cjs +0 -2966
  525. package/dist/routes.d.ts +0 -10
  526. package/dist/select-Cmb8zF7w.cjs +0 -156
  527. package/dist/select-CprSNX0z.js +0 -139
  528. package/dist/select-DT7Zjn42.cjs +0 -162
  529. package/dist/select-En8DkoaQ.js +0 -145
  530. package/dist/sidebar-B3EYhli0.cjs +0 -800
  531. package/dist/sidebar-B9NR0lCe.cjs +0 -800
  532. package/dist/sidebar-BcJ6LxvX.cjs +0 -733
  533. package/dist/sidebar-BvF5I2Ue.cjs +0 -800
  534. package/dist/sidebar-C5B_LHek.cjs +0 -795
  535. package/dist/sidebar-CA6_ek3f.js +0 -801
  536. package/dist/sidebar-CRMiBtAi.js +0 -801
  537. package/dist/sidebar-CVUGHOS_.cjs +0 -756
  538. package/dist/sidebar-CZ2mWaMM.cjs +0 -800
  539. package/dist/sidebar-CmvwjnVb.js +0 -757
  540. package/dist/sidebar-CplprZpM.js +0 -801
  541. package/dist/sidebar-Dz7bd3zP.js +0 -796
  542. package/dist/sidebar-KIS0C2JH.js +0 -801
  543. package/dist/sidebar-OTO_up7Z.js +0 -801
  544. package/dist/sidebar-WoKvFWCN.js +0 -717
  545. package/dist/sidebar-zowjejT2.cjs +0 -800
  546. package/dist/skeleton-4zoHiFJ_.cjs +0 -83
  547. package/dist/skeleton-C4bHqUBf.js +0 -84
  548. package/dist/slider-C0JKA9k3.js +0 -56
  549. package/dist/slider-CPmwzm_3.cjs +0 -73
  550. package/dist/slider-DcJharR9.cjs +0 -73
  551. package/dist/slider-Pay3fka2.js +0 -56
  552. package/dist/sonner-DeUIj0Zg.cjs +0 -63
  553. package/dist/sonner-g9RIfi35.js +0 -47
  554. package/dist/tooltip-CNtsL5cB.cjs +0 -71
  555. package/dist/tooltip-CTyZCD8h.js +0 -55
  556. package/dist/tooltip-CwgSdy3h.cjs +0 -67
  557. package/dist/tooltip-D-OrYnKO.js +0 -51
  558. package/dist/use-audio-player-BJFV24XW.js +0 -188
  559. package/dist/use-audio-player-Bkh23vQ3.js +0 -177
  560. package/dist/use-audio-player-Dn1NR9xN.cjs +0 -176
  561. package/dist/use-audio-player-DyVYlOnR.cjs +0 -187
  562. package/dist/use-mobile-BB4M_4Ru.cjs +0 -47
  563. package/dist/use-mobile-CLu9nqGL.js +0 -31
  564. package/dist/use-mobile-CNwiBNxu.js +0 -33
  565. package/dist/use-mobile-Dlf74ufz.cjs +0 -49
  566. package/dist/xertica-assistant-B1IaHXnB.cjs +0 -1894
  567. package/dist/xertica-assistant-BMqdyRVi.js +0 -2082
  568. package/dist/xertica-assistant-Bj3vBCq_.cjs +0 -2081
  569. package/dist/xertica-assistant-CfBCo21g.js +0 -2148
  570. package/dist/xertica-assistant-DIM_Do1k.js +0 -1866
  571. package/dist/xertica-assistant-DPsESB6t.js +0 -1878
  572. package/dist/xertica-assistant-DrsRwla1.cjs +0 -2147
  573. package/dist/xertica-assistant-Qp3ydksa.cjs +0 -1882
  574. package/dist/xertica-assistant-gnCJdcZY.js +0 -1866
  575. package/dist/xertica-assistant-yyrR0JKl.cjs +0 -1882
  576. package/styles/xertica/app-overrides/scrollbar.css +0 -33
  577. package/dist/{XerticaXLogo-qBPhwK3g.cjs → LanguageSelector-1cINLJ23.cjs} +80 -80
@@ -1,2908 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const React = require("react");
4
- const RechartsPrimitive = require("recharts");
5
- const button = require("./button-Bnv9SvYK.cjs");
6
- const classVarianceAuthority = require("class-variance-authority");
7
- const lucideReact = require("lucide-react");
8
- const skeleton = require("./skeleton-4zoHiFJ_.cjs");
9
- const select = require("./select-Cmb8zF7w.cjs");
10
- const DialogPrimitive = require("@radix-ui/react-dialog");
11
- const dropdownMenu = require("./dropdown-menu-B_uEXNc4.cjs");
12
- const input = require("./input-CNFHVKvo.cjs");
13
- function _interopNamespaceDefault(e) {
14
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
15
- if (e) {
16
- for (const k in e) {
17
- if (k !== "default") {
18
- const d = Object.getOwnPropertyDescriptor(e, k);
19
- Object.defineProperty(n, k, d.get ? d : {
20
- enumerable: true,
21
- get: () => e[k]
22
- });
23
- }
24
- }
25
- }
26
- n.default = e;
27
- return Object.freeze(n);
28
- }
29
- const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
30
- const RechartsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(RechartsPrimitive);
31
- const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
32
- const alertVariants = classVarianceAuthority.cva(
33
- "relative w-full rounded-[var(--radius)] border-l-4 px-4 py-3 grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-5 [&>svg]:translate-y-0.5 [&>svg]:text-current",
34
- {
35
- variants: {
36
- variant: {
37
- default: "bg-muted/50 border-l-border text-foreground [&>svg]:text-muted-foreground",
38
- success: "bg-[color:var(--success)]/10 dark:bg-[color:var(--success)]/20 border-l-[color:var(--success)] text-foreground [&>svg]:text-[color:var(--success)]",
39
- info: "bg-[color:var(--info)]/10 dark:bg-[color:var(--info)]/20 border-l-[color:var(--info)] text-foreground [&>svg]:text-[color:var(--info)]",
40
- warning: "bg-[color:var(--warning)]/10 dark:bg-[color:var(--warning)]/20 border-l-[color:var(--warning)] text-foreground [&>svg]:text-[color:var(--warning)]",
41
- destructive: "bg-[color:var(--destructive)]/10 dark:bg-[color:var(--destructive)]/20 border-l-[color:var(--destructive)] text-foreground [&>svg]:text-[color:var(--destructive)]"
42
- }
43
- },
44
- defaultVariants: {
45
- variant: "default"
46
- }
47
- }
48
- );
49
- const alertIcons = {
50
- default: lucideReact.Info,
51
- success: lucideReact.CheckCircle,
52
- info: lucideReact.Info,
53
- warning: lucideReact.AlertTriangle,
54
- destructive: lucideReact.XCircle
55
- };
56
- function Alert({ className, variant, icon, children, ...props }) {
57
- const alertVariant = variant && variant in alertIcons ? variant : "default";
58
- const DefaultIcon = alertIcons[alertVariant];
59
- return /* @__PURE__ */ jsxRuntime.jsxs(
60
- "div",
61
- {
62
- "data-slot": "alert",
63
- role: "alert",
64
- className: button.cn(alertVariants({ variant }), className),
65
- ...props,
66
- children: [
67
- icon !== void 0 ? icon : /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, { className: "flex-shrink-0" }),
68
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children })
69
- ]
70
- }
71
- );
72
- }
73
- function AlertTitle({ className, ...props }) {
74
- return /* @__PURE__ */ jsxRuntime.jsx(
75
- "div",
76
- {
77
- "data-slot": "alert-title",
78
- className: button.cn("font-medium mb-1 leading-tight", className),
79
- ...props
80
- }
81
- );
82
- }
83
- function AlertDescription({ className, ...props }) {
84
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "alert-description", className: button.cn("leading-relaxed", className), ...props });
85
- }
86
- const Empty = React__namespace.forwardRef(
87
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
88
- "div",
89
- {
90
- ref,
91
- className: button.cn(
92
- "flex min-h-[400px] flex-col items-center justify-center rounded-[var(--radius-card)] border border-dashed border-border p-8 text-center animate-in fade-in-50",
93
- className
94
- ),
95
- ...props
96
- }
97
- )
98
- );
99
- Empty.displayName = "Empty";
100
- const EmptyIcon = React__namespace.forwardRef(
101
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
102
- "div",
103
- {
104
- ref,
105
- className: button.cn(
106
- "mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-muted",
107
- className
108
- ),
109
- ...props
110
- }
111
- )
112
- );
113
- EmptyIcon.displayName = "EmptyIcon";
114
- const EmptyImage = React__namespace.forwardRef(
115
- ({ className, alt, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
116
- "img",
117
- {
118
- ref,
119
- alt,
120
- className: button.cn("mx-auto mb-4 h-48 w-48 object-contain opacity-50", className),
121
- ...props
122
- }
123
- )
124
- );
125
- EmptyImage.displayName = "EmptyImage";
126
- const EmptyTitle = React__namespace.forwardRef(
127
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("h3", { ref, className: button.cn("mt-4 font-semibold text-foreground", className), ...props })
128
- );
129
- EmptyTitle.displayName = "EmptyTitle";
130
- const EmptyDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
131
- "p",
132
- {
133
- ref,
134
- className: button.cn("mt-2 text-sm text-muted-foreground max-w-sm mx-auto", className),
135
- ...props
136
- }
137
- ));
138
- EmptyDescription.displayName = "EmptyDescription";
139
- const EmptyAction = React__namespace.forwardRef(
140
- ({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
141
- "div",
142
- {
143
- ref,
144
- className: button.cn("mt-6 flex flex-col gap-2 sm:flex-row sm:gap-4", className),
145
- ...props
146
- }
147
- )
148
- );
149
- EmptyAction.displayName = "EmptyAction";
150
- const THEMES = { light: "", dark: ".dark" };
151
- const defaultPeriods = [
152
- { value: "7d", label: "7 days" },
153
- { value: "30d", label: "30 days" },
154
- { value: "90d", label: "90 days" }
155
- ];
156
- const defaultChartColors = [
157
- "var(--chart-1)",
158
- "var(--chart-2)",
159
- "var(--chart-3)",
160
- "var(--chart-4)",
161
- "var(--chart-5)",
162
- "var(--chart-6)",
163
- "var(--chart-7)",
164
- "var(--chart-8)"
165
- ];
166
- const chartBarSizes = {
167
- sm: 8,
168
- md: 14,
169
- lg: 22,
170
- xl: 32
171
- };
172
- const ChartContext = React__namespace.createContext(null);
173
- function useChart() {
174
- const context = React__namespace.useContext(ChartContext);
175
- if (!context) {
176
- throw new Error("useChart must be used within a <ChartContainer />");
177
- }
178
- return context;
179
- }
180
- function ChartContainer({
181
- id,
182
- className,
183
- children,
184
- config,
185
- ...props
186
- }) {
187
- const uniqueId = React__namespace.useId();
188
- const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
189
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
190
- "div",
191
- {
192
- "data-slot": "chart",
193
- "data-chart": chartId,
194
- className: button.cn(
195
- "[&_.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 relative h-[300px] min-h-[200px] w-full min-w-0 overflow-hidden text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
196
- className
197
- ),
198
- ...props,
199
- children: [
200
- /* @__PURE__ */ jsxRuntime.jsx(ChartStyle, { id: chartId, config }),
201
- /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { width: "100%", height: "100%", children })
202
- ]
203
- }
204
- ) });
205
- }
206
- const ChartStyle = ({ id, config }) => {
207
- const colorConfig = Object.entries(config).filter(([, config2]) => config2.theme || config2.color);
208
- if (!colorConfig.length) {
209
- return null;
210
- }
211
- return /* @__PURE__ */ jsxRuntime.jsx(
212
- "style",
213
- {
214
- dangerouslySetInnerHTML: {
215
- __html: Object.entries(THEMES).map(
216
- ([theme, prefix]) => `
217
- ${prefix} [data-chart=${id}] {
218
- ${colorConfig.map(([key, itemConfig]) => {
219
- var _a;
220
- const color = ((_a = itemConfig.theme) == null ? void 0 : _a[theme]) || itemConfig.color;
221
- return color ? ` --color-${key}: ${color};` : null;
222
- }).join("\n")}
223
- }
224
- `
225
- ).join("\n")
226
- }
227
- }
228
- );
229
- };
230
- const ChartTooltip = RechartsPrimitive__namespace.Tooltip;
231
- function ChartTooltipContent({
232
- active,
233
- payload,
234
- className,
235
- indicator = "dot",
236
- hideLabel = false,
237
- hideIndicator = false,
238
- label,
239
- labelFormatter,
240
- labelClassName,
241
- formatter,
242
- color,
243
- nameKey,
244
- labelKey
245
- }) {
246
- const { config } = useChart();
247
- const tooltipLabel = React__namespace.useMemo(() => {
248
- var _a;
249
- if (hideLabel || !(payload == null ? void 0 : payload.length)) {
250
- return null;
251
- }
252
- const [item] = payload;
253
- const key = `${labelKey || (item == null ? void 0 : item.dataKey) || (item == null ? void 0 : item.name) || "value"}`;
254
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
255
- const value = !labelKey && typeof label === "string" ? ((_a = config[label]) == null ? void 0 : _a.label) || label : itemConfig == null ? void 0 : itemConfig.label;
256
- if (labelFormatter) {
257
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
258
- }
259
- if (!value) {
260
- return null;
261
- }
262
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: button.cn("font-medium", labelClassName), children: value });
263
- }, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
264
- if (!active || !(payload == null ? void 0 : payload.length)) {
265
- return null;
266
- }
267
- const nestLabel = payload.length === 1 && indicator !== "dot";
268
- return /* @__PURE__ */ jsxRuntime.jsxs(
269
- "div",
270
- {
271
- className: button.cn(
272
- "border-border/50 bg-background/95 backdrop-blur-sm grid min-w-[8rem] items-start gap-1.5 rounded-xl border px-3 py-2 text-xs shadow-xl",
273
- className
274
- ),
275
- children: [
276
- !nestLabel ? tooltipLabel : null,
277
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
278
- var _a;
279
- const key = `${nameKey || item.name || item.dataKey || "value"}`;
280
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
281
- const indicatorColor = color || ((_a = item.payload) == null ? void 0 : _a.fill) || item.color;
282
- return /* @__PURE__ */ jsxRuntime.jsx(
283
- "div",
284
- {
285
- className: button.cn(
286
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
287
- indicator === "dot" && "items-center"
288
- ),
289
- 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: [
290
- (itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntime.jsx(
291
- "div",
292
- {
293
- className: button.cn(
294
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
295
- {
296
- "h-2.5 w-2.5": indicator === "dot",
297
- "w-1": indicator === "line",
298
- "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
299
- "my-0.5": nestLabel && indicator === "dashed"
300
- }
301
- ),
302
- style: {
303
- "--color-bg": indicatorColor,
304
- "--color-border": indicatorColor
305
- }
306
- }
307
- ),
308
- /* @__PURE__ */ jsxRuntime.jsxs(
309
- "div",
310
- {
311
- className: button.cn(
312
- "flex flex-1 justify-between leading-none",
313
- nestLabel ? "items-end" : "items-center"
314
- ),
315
- children: [
316
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1.5", children: [
317
- nestLabel ? tooltipLabel : null,
318
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
319
- ] }),
320
- item.value && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-mono font-semibold tabular-nums", children: item.value.toLocaleString() })
321
- ]
322
- }
323
- )
324
- ] })
325
- },
326
- item.dataKey
327
- );
328
- }) })
329
- ]
330
- }
331
- );
332
- }
333
- const ChartLegend = RechartsPrimitive__namespace.Legend;
334
- function ChartLegendContent({
335
- className,
336
- hideIcon = false,
337
- payload,
338
- verticalAlign = "bottom",
339
- nameKey
340
- }) {
341
- const { config } = useChart();
342
- if (!(payload == null ? void 0 : payload.length)) {
343
- return null;
344
- }
345
- return /* @__PURE__ */ jsxRuntime.jsx(
346
- "div",
347
- {
348
- className: button.cn(
349
- "flex items-center justify-center gap-4",
350
- verticalAlign === "top" ? "pb-3" : "pt-3",
351
- className
352
- ),
353
- children: payload.map((item) => {
354
- const key = `${nameKey ? item.value : item.dataKey || item.value || "value"}`;
355
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
356
- return /* @__PURE__ */ jsxRuntime.jsxs(
357
- "div",
358
- {
359
- className: button.cn(
360
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
361
- ),
362
- children: [
363
- (itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(
364
- "div",
365
- {
366
- className: "h-2 w-2 shrink-0 rounded-full bg-(--color-bg)",
367
- style: {
368
- "--color-bg": item.color || `var(--color-${key})`
369
- }
370
- }
371
- ),
372
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground text-xs", children: (itemConfig == null ? void 0 : itemConfig.label) || item.value })
373
- ]
374
- },
375
- item.value
376
- );
377
- })
378
- }
379
- );
380
- }
381
- function getPayloadConfigFromPayload(config, payload, key) {
382
- if (typeof payload !== "object" || payload === null) {
383
- return void 0;
384
- }
385
- const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
386
- let configLabelKey = key;
387
- if (key in payload && typeof payload[key] === "string") {
388
- configLabelKey = payload[key];
389
- } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
390
- configLabelKey = payloadPayload[key];
391
- }
392
- return configLabelKey in config ? config[configLabelKey] : config[key];
393
- }
394
- function getChartSeries(config, series) {
395
- if (series == null ? void 0 : series.length) {
396
- return series;
397
- }
398
- return Object.entries(config).map(([key, item]) => ({
399
- key,
400
- label: item.label
401
- }));
402
- }
403
- function getSeriesColor(key, index, colors) {
404
- if (Array.isArray(colors)) {
405
- return colors[index] || defaultChartColors[index % defaultChartColors.length];
406
- }
407
- return (colors == null ? void 0 : colors[key]) || defaultChartColors[index % defaultChartColors.length];
408
- }
409
- function getChartConfigWithColors(config, keys, colors) {
410
- return keys.reduce((nextConfig, key, index) => {
411
- const item = config[key];
412
- if ((item == null ? void 0 : item.theme) && !colors) {
413
- nextConfig[key] = item;
414
- return nextConfig;
415
- }
416
- nextConfig[key] = {
417
- label: (item == null ? void 0 : item.label) || key,
418
- icon: item == null ? void 0 : item.icon,
419
- color: colors ? getSeriesColor(key, index, colors) : (item == null ? void 0 : item.color) || getSeriesColor(key, index)
420
- };
421
- return nextConfig;
422
- }, {});
423
- }
424
- function buildChartConfig(keys, colors) {
425
- return keys.reduce((cfg, key, index) => {
426
- cfg[key] = {
427
- label: key,
428
- color: getSeriesColor(key, index, colors)
429
- };
430
- return cfg;
431
- }, {});
432
- }
433
- function formatTick(value) {
434
- if (typeof value !== "number") {
435
- return value;
436
- }
437
- return Intl.NumberFormat("en", {
438
- notation: "compact",
439
- maximumFractionDigits: 1
440
- }).format(value);
441
- }
442
- function defaultFilterData(data, period) {
443
- const match = period.match(/^(\d+)/);
444
- if (!match) {
445
- return data;
446
- }
447
- const limit = Number(match[1]);
448
- return data.slice(Math.max(data.length - limit, 0));
449
- }
450
- function getErrorDescription(error) {
451
- if (typeof error === "string") {
452
- return error;
453
- }
454
- if (error instanceof Error) {
455
- return error.message;
456
- }
457
- return void 0;
458
- }
459
- function getBarSize(barSize = "md") {
460
- return typeof barSize === "number" ? barSize : chartBarSizes[barSize];
461
- }
462
- function hasChartData(data, series) {
463
- if (!data.length || !series.length) {
464
- return false;
465
- }
466
- return data.some(
467
- (item) => series.some((serie) => {
468
- const value = item[serie.key];
469
- return value !== null && value !== void 0 && value !== "";
470
- })
471
- );
472
- }
473
- function hasPieData(data, nameKey, valueKey) {
474
- return data.some((item) => {
475
- const name = item[nameKey];
476
- const value = item[valueKey];
477
- return name !== null && name !== void 0 && name !== "" && value !== null && value !== void 0 && value !== "";
478
- });
479
- }
480
- function ChartState({
481
- type,
482
- className,
483
- error,
484
- onRetry,
485
- retryLabel = "Try again",
486
- emptyTitle = "No data available",
487
- emptyDescription = "There is no data available for this chart yet.",
488
- errorTitle = "Connection error",
489
- errorDescription,
490
- loadingLabel = "Loading chart data"
491
- }) {
492
- if (type === "loading") {
493
- return /* @__PURE__ */ jsxRuntime.jsxs(
494
- "div",
495
- {
496
- className: button.cn(
497
- "flex min-h-[240px] flex-col justify-end gap-3 rounded-[var(--radius-card)] border border-border p-6",
498
- className
499
- ),
500
- "aria-label": typeof loadingLabel === "string" ? loadingLabel : void 0,
501
- children: [
502
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-8 w-2/5" }),
503
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-14 w-3/5" }),
504
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-24 w-4/5" }),
505
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-36 w-full" })
506
- ]
507
- }
508
- );
509
- }
510
- if (type === "error") {
511
- return /* @__PURE__ */ jsxRuntime.jsx(
512
- "div",
513
- {
514
- className: button.cn(
515
- "flex min-h-[240px] items-center justify-center rounded-[var(--radius-card)] border border-border p-6",
516
- className
517
- ),
518
- children: /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "destructive", className: "max-w-xl", children: [
519
- /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: errorTitle }),
520
- /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { children: errorDescription || getErrorDescription(error) || "Unable to load chart data. Check your connection and try again." }),
521
- onRetry ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", variant: "outline", onClick: onRetry, children: [
522
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-4" }),
523
- retryLabel
524
- ] }) }) : null
525
- ] })
526
- }
527
- );
528
- }
529
- return /* @__PURE__ */ jsxRuntime.jsxs(Empty, { className: button.cn("min-h-[240px]", className), children: [
530
- /* @__PURE__ */ jsxRuntime.jsx(EmptyIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BarChart3, { className: "size-10 text-muted-foreground" }) }),
531
- /* @__PURE__ */ jsxRuntime.jsx(EmptyTitle, { children: emptyTitle }),
532
- /* @__PURE__ */ jsxRuntime.jsx(EmptyDescription, { children: emptyDescription }),
533
- onRetry ? /* @__PURE__ */ jsxRuntime.jsx(EmptyAction, { children: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { size: "sm", variant: "outline", onClick: onRetry, children: [
534
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.WifiOff, { className: "size-4" }),
535
- retryLabel
536
- ] }) }) : null
537
- ] });
538
- }
539
- function getChartState(state, hasData, className) {
540
- if (state.isLoading) {
541
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "loading", className });
542
- }
543
- if (state.error) {
544
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "error", className });
545
- }
546
- if (!hasData) {
547
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "empty", className });
548
- }
549
- return null;
550
- }
551
- function ChartCard({
552
- title,
553
- description,
554
- action,
555
- footer,
556
- children,
557
- className,
558
- contentClassName,
559
- ...props
560
- }) {
561
- return /* @__PURE__ */ jsxRuntime.jsxs(skeleton.Card, { className: button.cn("w-full min-w-0 overflow-hidden", className), ...props, children: [
562
- /* @__PURE__ */ jsxRuntime.jsxs(skeleton.CardHeader, { children: [
563
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardTitle, { children: title }),
564
- description ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardDescription, { children: description }) : null,
565
- action ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardAction, { children: action }) : null
566
- ] }),
567
- /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardContent, { className: contentClassName, children }),
568
- footer ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.CardFooter, { children: footer }) : null
569
- ] });
570
- }
571
- function AreaGradientDefs({
572
- seriesKeys,
573
- opacity = 0.3
574
- }) {
575
- return /* @__PURE__ */ jsxRuntime.jsx("defs", { children: seriesKeys.map((key) => /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `gradient-${key}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
576
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "5%", stopColor: `var(--color-${key})`, stopOpacity: opacity }),
577
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "95%", stopColor: `var(--color-${key})`, stopOpacity: 0 })
578
- ] }, key)) });
579
- }
580
- function DashboardBarChart({
581
- data,
582
- config,
583
- indexKey = "name",
584
- series,
585
- colors,
586
- barSize = "md",
587
- stacked = false,
588
- showGrid = true,
589
- showLegend = true,
590
- valueFormatter = formatTick,
591
- isLoading,
592
- error,
593
- onRetry,
594
- retryLabel,
595
- emptyTitle,
596
- emptyDescription,
597
- errorTitle,
598
- errorDescription,
599
- loadingLabel,
600
- stateClassName,
601
- className,
602
- ...props
603
- }) {
604
- const chartSeries = getChartSeries(config, series);
605
- const chartConfig = getChartConfigWithColors(
606
- config,
607
- chartSeries.map((item) => item.key),
608
- colors
609
- );
610
- const chartState = getChartState(
611
- {
612
- isLoading,
613
- error,
614
- onRetry,
615
- retryLabel,
616
- emptyTitle,
617
- emptyDescription,
618
- errorTitle,
619
- errorDescription,
620
- loadingLabel
621
- },
622
- hasChartData(data, chartSeries),
623
- button.cn("h-[320px] w-full", stateClassName)
624
- );
625
- const barElements = React__namespace.useMemo(() => {
626
- const topOfStack = /* @__PURE__ */ new Set();
627
- if (stacked) {
628
- const lastByStack = /* @__PURE__ */ new Map();
629
- chartSeries.forEach((s) => lastByStack.set(s.stackId || "total", s.key));
630
- lastByStack.forEach((key) => topOfStack.add(key));
631
- }
632
- return chartSeries.map((item) => {
633
- const isTop = !stacked || topOfStack.has(item.key);
634
- return /* @__PURE__ */ jsxRuntime.jsx(
635
- RechartsPrimitive__namespace.Bar,
636
- {
637
- dataKey: item.key,
638
- fill: `var(--color-${item.key})`,
639
- radius: isTop ? [4, 4, 0, 0] : [0, 0, 0, 0],
640
- barSize: getBarSize(barSize),
641
- stackId: stacked ? item.stackId || "total" : item.stackId,
642
- isAnimationActive: true,
643
- animationDuration: 600,
644
- animationEasing: "ease-out"
645
- },
646
- item.key
647
- );
648
- });
649
- }, [stacked, chartSeries]);
650
- if (chartState) {
651
- return chartState;
652
- }
653
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[320px] w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.BarChart, { data, accessibilityLayer: true, barGap: 4, children: [
654
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(
655
- RechartsPrimitive__namespace.CartesianGrid,
656
- {
657
- vertical: false,
658
- strokeDasharray: "3 3",
659
- stroke: "var(--border)",
660
- strokeOpacity: 0.5
661
- }
662
- ) : null,
663
- /* @__PURE__ */ jsxRuntime.jsx(
664
- RechartsPrimitive__namespace.XAxis,
665
- {
666
- dataKey: indexKey,
667
- tickLine: false,
668
- axisLine: false,
669
- tickMargin: 8
670
- }
671
- ),
672
- /* @__PURE__ */ jsxRuntime.jsx(
673
- RechartsPrimitive__namespace.YAxis,
674
- {
675
- tickLine: false,
676
- axisLine: false,
677
- tickMargin: 8,
678
- tickFormatter: valueFormatter
679
- }
680
- ),
681
- /* @__PURE__ */ jsxRuntime.jsx(
682
- ChartTooltip,
683
- {
684
- cursor: { fill: "var(--muted)", opacity: 0.4, radius: 4 },
685
- content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {})
686
- }
687
- ),
688
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
689
- barElements
690
- ] }) });
691
- }
692
- function DashboardLineChart({
693
- data,
694
- config,
695
- indexKey = "name",
696
- series,
697
- colors,
698
- showDots = false,
699
- showGrid = true,
700
- showLegend = true,
701
- curveType = "monotone",
702
- strokeWidth = 2,
703
- valueFormatter = formatTick,
704
- isLoading,
705
- error,
706
- onRetry,
707
- retryLabel,
708
- emptyTitle,
709
- emptyDescription,
710
- errorTitle,
711
- errorDescription,
712
- loadingLabel,
713
- stateClassName,
714
- className,
715
- ...props
716
- }) {
717
- const chartSeries = getChartSeries(config, series);
718
- const chartConfig = getChartConfigWithColors(
719
- config,
720
- chartSeries.map((item) => item.key),
721
- colors
722
- );
723
- const chartState = getChartState(
724
- {
725
- isLoading,
726
- error,
727
- onRetry,
728
- retryLabel,
729
- emptyTitle,
730
- emptyDescription,
731
- errorTitle,
732
- errorDescription,
733
- loadingLabel
734
- },
735
- hasChartData(data, chartSeries),
736
- button.cn("h-[320px] w-full", stateClassName)
737
- );
738
- if (chartState) {
739
- return chartState;
740
- }
741
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[320px] w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.LineChart, { data, accessibilityLayer: true, children: [
742
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(
743
- RechartsPrimitive__namespace.CartesianGrid,
744
- {
745
- vertical: false,
746
- strokeDasharray: "3 3",
747
- stroke: "var(--border)",
748
- strokeOpacity: 0.5
749
- }
750
- ) : null,
751
- /* @__PURE__ */ jsxRuntime.jsx(
752
- RechartsPrimitive__namespace.XAxis,
753
- {
754
- dataKey: indexKey,
755
- tickLine: false,
756
- axisLine: false,
757
- tickMargin: 8
758
- }
759
- ),
760
- /* @__PURE__ */ jsxRuntime.jsx(
761
- RechartsPrimitive__namespace.YAxis,
762
- {
763
- tickLine: false,
764
- axisLine: false,
765
- tickMargin: 8,
766
- tickFormatter: valueFormatter
767
- }
768
- ),
769
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { indicator: "line" }) }),
770
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
771
- chartSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
772
- RechartsPrimitive__namespace.Line,
773
- {
774
- type: curveType,
775
- dataKey: item.key,
776
- stroke: `var(--color-${item.key})`,
777
- strokeWidth,
778
- dot: showDots ? { r: 3, fill: `var(--color-${item.key})`, strokeWidth: 0 } : false,
779
- activeDot: { r: 5, strokeWidth: 0 },
780
- yAxisId: item.yAxisId,
781
- isAnimationActive: true,
782
- animationDuration: 600,
783
- animationEasing: "ease-out"
784
- },
785
- item.key
786
- ))
787
- ] }) });
788
- }
789
- function HorizontalBarChart({
790
- data,
791
- config,
792
- indexKey = "name",
793
- series,
794
- colors,
795
- barSize = "md",
796
- stacked = false,
797
- categoryWidth = 96,
798
- showGrid = true,
799
- showLegend = true,
800
- valueFormatter = formatTick,
801
- isLoading,
802
- error,
803
- onRetry,
804
- retryLabel,
805
- emptyTitle,
806
- emptyDescription,
807
- errorTitle,
808
- errorDescription,
809
- loadingLabel,
810
- stateClassName,
811
- className,
812
- ...props
813
- }) {
814
- const chartSeries = getChartSeries(config, series);
815
- const chartConfig = getChartConfigWithColors(
816
- config,
817
- chartSeries.map((item) => item.key),
818
- colors
819
- );
820
- const chartState = getChartState(
821
- {
822
- isLoading,
823
- error,
824
- onRetry,
825
- retryLabel,
826
- emptyTitle,
827
- emptyDescription,
828
- errorTitle,
829
- errorDescription,
830
- loadingLabel
831
- },
832
- hasChartData(data, chartSeries),
833
- button.cn("h-[320px] w-full", stateClassName)
834
- );
835
- if (chartState) {
836
- return chartState;
837
- }
838
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[320px] w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(
839
- RechartsPrimitive__namespace.BarChart,
840
- {
841
- data,
842
- layout: "vertical",
843
- accessibilityLayer: true,
844
- margin: { left: 8, right: 16 },
845
- children: [
846
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(
847
- RechartsPrimitive__namespace.CartesianGrid,
848
- {
849
- horizontal: false,
850
- strokeDasharray: "3 3",
851
- stroke: "var(--border)",
852
- strokeOpacity: 0.5
853
- }
854
- ) : null,
855
- /* @__PURE__ */ jsxRuntime.jsx(
856
- RechartsPrimitive__namespace.XAxis,
857
- {
858
- type: "number",
859
- tickLine: false,
860
- axisLine: false,
861
- tickMargin: 8,
862
- tickFormatter: valueFormatter
863
- }
864
- ),
865
- /* @__PURE__ */ jsxRuntime.jsx(
866
- RechartsPrimitive__namespace.YAxis,
867
- {
868
- dataKey: indexKey,
869
- type: "category",
870
- tickLine: false,
871
- axisLine: false,
872
- tickMargin: 8,
873
- width: categoryWidth
874
- }
875
- ),
876
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {}) }),
877
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
878
- chartSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
879
- RechartsPrimitive__namespace.Bar,
880
- {
881
- dataKey: item.key,
882
- fill: `var(--color-${item.key})`,
883
- radius: [0, 4, 4, 0],
884
- barSize: getBarSize(barSize),
885
- stackId: stacked ? item.stackId || "total" : item.stackId,
886
- isAnimationActive: true,
887
- animationDuration: 600,
888
- animationEasing: "ease-out"
889
- },
890
- item.key
891
- ))
892
- ]
893
- }
894
- ) });
895
- }
896
- function InteractiveTimeSeriesChart({
897
- data,
898
- config,
899
- indexKey = "date",
900
- series,
901
- colors,
902
- periods = defaultPeriods,
903
- defaultPeriod = ((_a) => (_a = periods[1]) == null ? void 0 : _a.value)() || ((_b) => (_b = periods[0]) == null ? void 0 : _b.value)() || "30d",
904
- defaultSeries,
905
- filterData = defaultFilterData,
906
- showGrid = true,
907
- showLegend = false,
908
- showDots = false,
909
- gradientFill = true,
910
- curveType = "monotone",
911
- strokeWidth = 2,
912
- valueFormatter = formatTick,
913
- isLoading,
914
- error,
915
- onRetry,
916
- retryLabel,
917
- emptyTitle,
918
- emptyDescription,
919
- errorTitle,
920
- errorDescription,
921
- loadingLabel,
922
- stateClassName,
923
- className,
924
- ...props
925
- }) {
926
- var _a2;
927
- const chartSeries = getChartSeries(config, series);
928
- const chartConfig = getChartConfigWithColors(
929
- config,
930
- chartSeries.map((item) => item.key),
931
- colors
932
- );
933
- const [period, setPeriod] = React__namespace.useState(defaultPeriod);
934
- const [activeSeries, setActiveSeries] = React__namespace.useState(
935
- defaultSeries || ((_a2 = chartSeries[0]) == null ? void 0 : _a2.key) || ""
936
- );
937
- const filteredData = React__namespace.useMemo(() => filterData(data, period), [data, filterData, period]);
938
- const visibleSeries = chartSeries.length > 1 ? chartSeries.filter((item) => item.key === activeSeries) : chartSeries;
939
- const chartState = getChartState(
940
- {
941
- isLoading,
942
- error,
943
- onRetry,
944
- retryLabel,
945
- emptyTitle,
946
- emptyDescription,
947
- errorTitle,
948
- errorDescription,
949
- loadingLabel
950
- },
951
- hasChartData(filteredData, visibleSeries),
952
- button.cn("h-[320px] w-full", stateClassName)
953
- );
954
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full space-y-4", children: [
955
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
956
- chartSeries.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(
957
- "div",
958
- {
959
- className: "inline-flex h-10 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
960
- role: "group",
961
- "aria-label": "Selecionar metrica do grafico",
962
- children: chartSeries.map((item) => {
963
- var _a3;
964
- const label = item.label || ((_a3 = config[item.key]) == null ? void 0 : _a3.label) || item.key;
965
- return /* @__PURE__ */ jsxRuntime.jsx(
966
- button.Button,
967
- {
968
- type: "button",
969
- variant: "ghost",
970
- size: "sm",
971
- "aria-pressed": activeSeries === item.key,
972
- onClick: () => setActiveSeries(item.key),
973
- className: button.cn(
974
- "h-8 px-3 text-sm font-medium transition-all",
975
- activeSeries === item.key ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"
976
- ),
977
- children: label
978
- },
979
- item.key
980
- );
981
- })
982
- }
983
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
984
- /* @__PURE__ */ jsxRuntime.jsxs(select.Select, { value: period, onValueChange: setPeriod, children: [
985
- /* @__PURE__ */ jsxRuntime.jsx(
986
- select.SelectTrigger,
987
- {
988
- className: "w-full sm:w-[160px]",
989
- size: "sm",
990
- "aria-label": "Selecionar periodo do grafico",
991
- children: /* @__PURE__ */ jsxRuntime.jsx(select.SelectValue, { placeholder: "Period" })
992
- }
993
- ),
994
- /* @__PURE__ */ jsxRuntime.jsx(select.SelectContent, { children: periods.map((item) => /* @__PURE__ */ jsxRuntime.jsx(select.SelectItem, { value: item.value, children: item.label }, item.value)) })
995
- ] })
996
- ] }),
997
- chartState || /* @__PURE__ */ jsxRuntime.jsx(
998
- ChartContainer,
999
- {
1000
- config: chartConfig,
1001
- className: button.cn("h-[320px] w-full", className),
1002
- ...props,
1003
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.AreaChart, { data: filteredData, accessibilityLayer: true, children: [
1004
- gradientFill && /* @__PURE__ */ jsxRuntime.jsx(AreaGradientDefs, { seriesKeys: visibleSeries.map((s) => s.key), opacity: 0.4 }),
1005
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(
1006
- RechartsPrimitive__namespace.CartesianGrid,
1007
- {
1008
- vertical: false,
1009
- strokeDasharray: "3 3",
1010
- stroke: "var(--border)",
1011
- strokeOpacity: 0.5
1012
- }
1013
- ) : null,
1014
- /* @__PURE__ */ jsxRuntime.jsx(
1015
- RechartsPrimitive__namespace.XAxis,
1016
- {
1017
- dataKey: indexKey,
1018
- tickLine: false,
1019
- axisLine: false,
1020
- tickMargin: 8
1021
- }
1022
- ),
1023
- /* @__PURE__ */ jsxRuntime.jsx(
1024
- RechartsPrimitive__namespace.YAxis,
1025
- {
1026
- tickLine: false,
1027
- axisLine: false,
1028
- tickMargin: 8,
1029
- tickFormatter: valueFormatter
1030
- }
1031
- ),
1032
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { indicator: "line" }) }),
1033
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
1034
- visibleSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1035
- RechartsPrimitive__namespace.Area,
1036
- {
1037
- type: curveType,
1038
- dataKey: item.key,
1039
- stroke: `var(--color-${item.key})`,
1040
- fill: gradientFill ? `url(#gradient-${item.key})` : `var(--color-${item.key})`,
1041
- fillOpacity: gradientFill ? 1 : 0.16,
1042
- strokeWidth,
1043
- dot: showDots ? { r: 3, fill: `var(--color-${item.key})`, strokeWidth: 0 } : false,
1044
- activeDot: { r: 5, strokeWidth: 0 },
1045
- isAnimationActive: true,
1046
- animationDuration: 600,
1047
- animationEasing: "ease-out"
1048
- },
1049
- item.key
1050
- ))
1051
- ] })
1052
- }
1053
- )
1054
- ] });
1055
- }
1056
- function ComboMetricChart({
1057
- data,
1058
- config,
1059
- indexKey = "name",
1060
- series,
1061
- colors,
1062
- barSize = "md",
1063
- showGrid = true,
1064
- showLegend = true,
1065
- gradientFill = false,
1066
- curveType = "monotone",
1067
- valueFormatter = formatTick,
1068
- isLoading,
1069
- error,
1070
- onRetry,
1071
- retryLabel,
1072
- emptyTitle,
1073
- emptyDescription,
1074
- errorTitle,
1075
- errorDescription,
1076
- loadingLabel,
1077
- stateClassName,
1078
- className,
1079
- ...props
1080
- }) {
1081
- const chartSeries = getChartSeries(config, series);
1082
- const chartConfig = getChartConfigWithColors(
1083
- config,
1084
- chartSeries.map((item) => item.key),
1085
- colors
1086
- );
1087
- const chartState = getChartState(
1088
- {
1089
- isLoading,
1090
- error,
1091
- onRetry,
1092
- retryLabel,
1093
- emptyTitle,
1094
- emptyDescription,
1095
- errorTitle,
1096
- errorDescription,
1097
- loadingLabel
1098
- },
1099
- hasChartData(data, chartSeries),
1100
- button.cn("h-[340px] w-full", stateClassName)
1101
- );
1102
- if (chartState) {
1103
- return chartState;
1104
- }
1105
- const areaSeries = gradientFill ? chartSeries.filter((s) => s.type === "area").map((s) => s.key) : [];
1106
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[340px] w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.ComposedChart, { data, accessibilityLayer: true, children: [
1107
- gradientFill && areaSeries.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(AreaGradientDefs, { seriesKeys: areaSeries, opacity: 0.35 }),
1108
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(
1109
- RechartsPrimitive__namespace.CartesianGrid,
1110
- {
1111
- vertical: false,
1112
- strokeDasharray: "3 3",
1113
- stroke: "var(--border)",
1114
- strokeOpacity: 0.5
1115
- }
1116
- ) : null,
1117
- /* @__PURE__ */ jsxRuntime.jsx(
1118
- RechartsPrimitive__namespace.XAxis,
1119
- {
1120
- dataKey: indexKey,
1121
- tickLine: false,
1122
- axisLine: false,
1123
- tickMargin: 8
1124
- }
1125
- ),
1126
- /* @__PURE__ */ jsxRuntime.jsx(
1127
- RechartsPrimitive__namespace.YAxis,
1128
- {
1129
- tickLine: false,
1130
- axisLine: false,
1131
- tickMargin: 8,
1132
- tickFormatter: valueFormatter
1133
- }
1134
- ),
1135
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {}) }),
1136
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
1137
- chartSeries.map(
1138
- (item) => item.type === "line" ? /* @__PURE__ */ jsxRuntime.jsx(
1139
- RechartsPrimitive__namespace.Line,
1140
- {
1141
- type: curveType,
1142
- dataKey: item.key,
1143
- stroke: `var(--color-${item.key})`,
1144
- strokeWidth: 2,
1145
- dot: false,
1146
- activeDot: { r: 5, strokeWidth: 0 },
1147
- yAxisId: item.yAxisId,
1148
- isAnimationActive: true,
1149
- animationDuration: 600,
1150
- animationEasing: "ease-out"
1151
- },
1152
- item.key
1153
- ) : item.type === "area" ? /* @__PURE__ */ jsxRuntime.jsx(
1154
- RechartsPrimitive__namespace.Area,
1155
- {
1156
- type: curveType,
1157
- dataKey: item.key,
1158
- stroke: `var(--color-${item.key})`,
1159
- fill: gradientFill ? `url(#gradient-${item.key})` : `var(--color-${item.key})`,
1160
- fillOpacity: gradientFill ? 1 : 0.12,
1161
- strokeWidth: 2,
1162
- dot: false,
1163
- activeDot: { r: 5, strokeWidth: 0 },
1164
- yAxisId: item.yAxisId,
1165
- isAnimationActive: true,
1166
- animationDuration: 600,
1167
- animationEasing: "ease-out"
1168
- },
1169
- item.key
1170
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1171
- RechartsPrimitive__namespace.Bar,
1172
- {
1173
- dataKey: item.key,
1174
- fill: `var(--color-${item.key})`,
1175
- radius: [4, 4, 0, 0],
1176
- barSize: getBarSize(barSize),
1177
- yAxisId: item.yAxisId,
1178
- isAnimationActive: true,
1179
- animationDuration: 600,
1180
- animationEasing: "ease-out"
1181
- },
1182
- item.key
1183
- )
1184
- )
1185
- ] }) });
1186
- }
1187
- function DonutBreakdownChart({
1188
- data,
1189
- config,
1190
- nameKey = "name",
1191
- valueKey = "value",
1192
- colors,
1193
- centerLabel,
1194
- centerValue,
1195
- showLegend = true,
1196
- innerRadius = "58%",
1197
- outerRadius = "82%",
1198
- isLoading,
1199
- error,
1200
- onRetry,
1201
- retryLabel,
1202
- emptyTitle,
1203
- emptyDescription,
1204
- errorTitle,
1205
- errorDescription,
1206
- loadingLabel,
1207
- stateClassName,
1208
- className,
1209
- ...props
1210
- }) {
1211
- const [activeIndex, setActiveIndex] = React__namespace.useState(0);
1212
- const chartKeys = data.map((entry, index) => String(entry[nameKey] || `segment-${index}`));
1213
- const chartConfig = getChartConfigWithColors(config, chartKeys, colors);
1214
- const chartState = getChartState(
1215
- {
1216
- isLoading,
1217
- error,
1218
- onRetry,
1219
- retryLabel,
1220
- emptyTitle,
1221
- emptyDescription,
1222
- errorTitle,
1223
- errorDescription,
1224
- loadingLabel
1225
- },
1226
- hasPieData(data, nameKey, valueKey),
1227
- button.cn("h-[320px] w-full", stateClassName)
1228
- );
1229
- if (chartState) {
1230
- return chartState;
1231
- }
1232
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[320px] w-full", className), ...props, children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.PieChart, { accessibilityLayer: true, children: [
1233
- /* @__PURE__ */ jsxRuntime.jsx(
1234
- ChartTooltip,
1235
- {
1236
- cursor: false,
1237
- content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { hideLabel: true, nameKey })
1238
- }
1239
- ),
1240
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, { nameKey }), verticalAlign: "bottom" }) : null,
1241
- /* @__PURE__ */ jsxRuntime.jsxs(
1242
- RechartsPrimitive__namespace.Pie,
1243
- {
1244
- data,
1245
- dataKey: valueKey,
1246
- nameKey,
1247
- innerRadius,
1248
- outerRadius,
1249
- paddingAngle: 3,
1250
- activeIndex,
1251
- onMouseEnter: (_, index) => setActiveIndex(index),
1252
- isAnimationActive: true,
1253
- animationDuration: 600,
1254
- animationEasing: "ease-out",
1255
- children: [
1256
- data.map((entry, index) => {
1257
- const key = String(entry[nameKey] || `segment-${index}`);
1258
- return /* @__PURE__ */ jsxRuntime.jsx(
1259
- RechartsPrimitive__namespace.Cell,
1260
- {
1261
- fill: `var(--color-${key})`,
1262
- opacity: index === activeIndex ? 1 : 0.7,
1263
- stroke: "transparent"
1264
- },
1265
- key
1266
- );
1267
- }),
1268
- centerValue || centerLabel ? /* @__PURE__ */ jsxRuntime.jsx(
1269
- RechartsPrimitive__namespace.Label,
1270
- {
1271
- position: "center",
1272
- content: ({ viewBox }) => {
1273
- if (!viewBox || !("cx" in viewBox) || !("cy" in viewBox)) {
1274
- return null;
1275
- }
1276
- return /* @__PURE__ */ jsxRuntime.jsxs("text", { x: viewBox.cx, y: viewBox.cy, textAnchor: "middle", dominantBaseline: "middle", children: [
1277
- centerValue ? /* @__PURE__ */ jsxRuntime.jsx(
1278
- "tspan",
1279
- {
1280
- x: viewBox.cx,
1281
- y: viewBox.cy,
1282
- className: "fill-foreground text-2xl font-semibold",
1283
- children: centerValue
1284
- }
1285
- ) : null,
1286
- centerLabel ? /* @__PURE__ */ jsxRuntime.jsx(
1287
- "tspan",
1288
- {
1289
- x: viewBox.cx,
1290
- y: Number(viewBox.cy) + 22,
1291
- className: "fill-muted-foreground text-xs",
1292
- children: centerLabel
1293
- }
1294
- ) : null
1295
- ] });
1296
- }
1297
- }
1298
- ) : null
1299
- ]
1300
- }
1301
- )
1302
- ] }) });
1303
- }
1304
- function SparklineChart({
1305
- data,
1306
- dataKey,
1307
- color = "var(--chart-1)",
1308
- filled = true,
1309
- showEndDot = true,
1310
- curveType = "monotone",
1311
- strokeWidth = 2,
1312
- className
1313
- }) {
1314
- const sparkId = React__namespace.useId().replace(/:/g, "");
1315
- const lastPoint = data[data.length - 1];
1316
- const lastValue = lastPoint ? lastPoint[dataKey] : void 0;
1317
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("relative h-12 w-full min-w-0", className), children: [
1318
- /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
1319
- RechartsPrimitive__namespace.AreaChart,
1320
- {
1321
- data,
1322
- margin: { top: 4, right: showEndDot ? 8 : 0, bottom: 0, left: 0 },
1323
- children: [
1324
- filled && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: `spark-gradient-${sparkId}`, x1: "0", y1: "0", x2: "0", y2: "1", children: [
1325
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "5%", stopColor: color, stopOpacity: 0.3 }),
1326
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "95%", stopColor: color, stopOpacity: 0 })
1327
- ] }) }),
1328
- /* @__PURE__ */ jsxRuntime.jsx(
1329
- RechartsPrimitive__namespace.Area,
1330
- {
1331
- type: curveType,
1332
- dataKey,
1333
- stroke: color,
1334
- strokeWidth,
1335
- fill: filled ? `url(#spark-gradient-${sparkId})` : "none",
1336
- fillOpacity: 1,
1337
- dot: false,
1338
- activeDot: false,
1339
- isAnimationActive: true,
1340
- animationDuration: 600,
1341
- animationEasing: "ease-out"
1342
- }
1343
- )
1344
- ]
1345
- }
1346
- ) }),
1347
- showEndDot && lastValue !== void 0 && lastValue !== null && /* @__PURE__ */ jsxRuntime.jsx(
1348
- "div",
1349
- {
1350
- className: "pointer-events-none absolute right-0 top-1/2 h-2.5 w-2.5 -translate-y-1/2 rounded-full ring-2 ring-background",
1351
- style: { backgroundColor: color }
1352
- }
1353
- )
1354
- ] });
1355
- }
1356
- function RadarMetricChart({
1357
- data,
1358
- labelKey,
1359
- series,
1360
- colors,
1361
- filled = true,
1362
- fillOpacity = 0.25,
1363
- showDots = false,
1364
- showGrid = true,
1365
- showLegend,
1366
- valueFormatter,
1367
- isLoading,
1368
- error,
1369
- onRetry,
1370
- retryLabel,
1371
- emptyTitle,
1372
- emptyDescription,
1373
- errorTitle,
1374
- errorDescription,
1375
- loadingLabel,
1376
- stateClassName,
1377
- className
1378
- }) {
1379
- const chartConfig = React__namespace.useMemo(
1380
- () => buildChartConfig(
1381
- series.map((s) => s.key),
1382
- colors
1383
- ),
1384
- [series, colors]
1385
- );
1386
- const hasData = data.length > 0 && series.length > 0;
1387
- const chartState = getChartState(
1388
- {
1389
- isLoading,
1390
- error,
1391
- emptyTitle,
1392
- emptyDescription,
1393
- errorTitle,
1394
- errorDescription,
1395
- loadingLabel,
1396
- stateClassName,
1397
- onRetry,
1398
- retryLabel
1399
- },
1400
- hasData
1401
- );
1402
- const displayLegend = showLegend ?? series.length > 1;
1403
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[300px] w-full", className), children: chartState ?? /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.RadarChart, { data, accessibilityLayer: true, children: [
1404
- showGrid && /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.PolarGrid, { stroke: "var(--border)", strokeOpacity: 0.6 }),
1405
- /* @__PURE__ */ jsxRuntime.jsx(
1406
- RechartsPrimitive__namespace.PolarAngleAxis,
1407
- {
1408
- dataKey: labelKey,
1409
- tick: { fill: "var(--muted-foreground)", fontSize: 12 }
1410
- }
1411
- ),
1412
- /* @__PURE__ */ jsxRuntime.jsx(
1413
- RechartsPrimitive__namespace.PolarRadiusAxis,
1414
- {
1415
- tick: false,
1416
- axisLine: false,
1417
- tickFormatter: valueFormatter
1418
- }
1419
- ),
1420
- /* @__PURE__ */ jsxRuntime.jsx(
1421
- ChartTooltip,
1422
- {
1423
- content: /* @__PURE__ */ jsxRuntime.jsx(
1424
- ChartTooltipContent,
1425
- {
1426
- formatter: valueFormatter ? (v) => valueFormatter(v) : void 0
1427
- }
1428
- )
1429
- }
1430
- ),
1431
- displayLegend && /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }),
1432
- series.map((s) => /* @__PURE__ */ jsxRuntime.jsx(
1433
- RechartsPrimitive__namespace.Radar,
1434
- {
1435
- name: s.label ?? s.key,
1436
- dataKey: s.key,
1437
- stroke: `var(--color-${s.key})`,
1438
- fill: filled ? `var(--color-${s.key})` : "none",
1439
- fillOpacity: filled ? fillOpacity : 0,
1440
- dot: showDots ? { r: 3, fill: `var(--color-${s.key})` } : false,
1441
- isAnimationActive: true,
1442
- animationDuration: 600,
1443
- animationEasing: "ease-out"
1444
- },
1445
- s.key
1446
- ))
1447
- ] }) });
1448
- }
1449
- function PieMetricChart({
1450
- data,
1451
- nameKey,
1452
- valueKey,
1453
- colors,
1454
- outerRadius = "80%",
1455
- innerRadius = 0,
1456
- showLabels = false,
1457
- showLegend = true,
1458
- explodeIndex,
1459
- explodeOffset = 12,
1460
- valueFormatter,
1461
- isLoading,
1462
- error,
1463
- onRetry,
1464
- retryLabel,
1465
- emptyTitle,
1466
- emptyDescription,
1467
- errorTitle,
1468
- errorDescription,
1469
- loadingLabel,
1470
- stateClassName,
1471
- className
1472
- }) {
1473
- const names = React__namespace.useMemo(() => data.map((d) => String(d[nameKey] ?? "")), [data, nameKey]);
1474
- const chartConfig = React__namespace.useMemo(() => buildChartConfig(names, colors), [names, colors]);
1475
- const hasData = hasPieData(data, nameKey, valueKey);
1476
- const chartState = getChartState(
1477
- {
1478
- isLoading,
1479
- error,
1480
- emptyTitle,
1481
- emptyDescription,
1482
- errorTitle,
1483
- errorDescription,
1484
- loadingLabel,
1485
- stateClassName,
1486
- onRetry,
1487
- retryLabel
1488
- },
1489
- hasData
1490
- );
1491
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: button.cn("h-[300px] w-full", className), children: chartState ?? /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.PieChart, { accessibilityLayer: true, children: [
1492
- /* @__PURE__ */ jsxRuntime.jsx(
1493
- ChartTooltip,
1494
- {
1495
- content: /* @__PURE__ */ jsxRuntime.jsx(
1496
- ChartTooltipContent,
1497
- {
1498
- nameKey,
1499
- formatter: valueFormatter ? (v) => valueFormatter(v) : void 0
1500
- }
1501
- )
1502
- }
1503
- ),
1504
- showLegend && /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, { nameKey }) }),
1505
- /* @__PURE__ */ jsxRuntime.jsx(
1506
- RechartsPrimitive__namespace.Pie,
1507
- {
1508
- data,
1509
- dataKey: valueKey,
1510
- nameKey,
1511
- outerRadius,
1512
- innerRadius,
1513
- paddingAngle: 2,
1514
- label: showLabels ? ({ cx, cy, midAngle, innerRadius: ir, outerRadius: or, percent }) => {
1515
- const RADIAN = Math.PI / 180;
1516
- const radius = Number(ir) + (Number(or) - Number(ir)) * 1.35;
1517
- const x = Number(cx) + radius * Math.cos(-midAngle * RADIAN);
1518
- const y = Number(cy) + radius * Math.sin(-midAngle * RADIAN);
1519
- return percent > 0.04 ? /* @__PURE__ */ jsxRuntime.jsx(
1520
- "text",
1521
- {
1522
- x,
1523
- y,
1524
- fill: "var(--foreground)",
1525
- textAnchor: x > Number(cx) ? "start" : "end",
1526
- dominantBaseline: "central",
1527
- fontSize: 12,
1528
- fontWeight: 500,
1529
- children: `${(percent * 100).toFixed(0)}%`
1530
- }
1531
- ) : null;
1532
- } : false,
1533
- labelLine: false,
1534
- isAnimationActive: true,
1535
- animationDuration: 600,
1536
- animationEasing: "ease-out",
1537
- children: data.map((entry, index) => {
1538
- var _a, _b;
1539
- const name = String(entry[nameKey] ?? "");
1540
- const isExploded = index === explodeIndex;
1541
- return /* @__PURE__ */ jsxRuntime.jsx(
1542
- RechartsPrimitive__namespace.Cell,
1543
- {
1544
- fill: ((_a = chartConfig[name]) == null ? void 0 : _a.color) ?? `var(--chart-${index % 8 + 1})`,
1545
- stroke: "var(--background)",
1546
- strokeWidth: 2,
1547
- style: isExploded ? {
1548
- filter: `drop-shadow(0 4px 8px color-mix(in srgb, ${((_b = chartConfig[name]) == null ? void 0 : _b.color) ?? "var(--chart-1)"} 40%, transparent))`
1549
- } : void 0
1550
- },
1551
- `cell-${index}`
1552
- );
1553
- })
1554
- }
1555
- )
1556
- ] }) });
1557
- }
1558
- function RadialBarMetricChart({
1559
- data,
1560
- dataKey = "value",
1561
- nameKey = "name",
1562
- colors,
1563
- innerRadius = "30%",
1564
- outerRadius = "100%",
1565
- startAngle = 90,
1566
- endAngle = -270,
1567
- showBackground = true,
1568
- showLegend = true,
1569
- valueFormatter,
1570
- isLoading,
1571
- error,
1572
- onRetry,
1573
- retryLabel,
1574
- emptyTitle,
1575
- emptyDescription,
1576
- errorTitle,
1577
- errorDescription,
1578
- loadingLabel,
1579
- stateClassName,
1580
- className
1581
- }) {
1582
- const names = React__namespace.useMemo(() => data.map((d) => String(d[nameKey] ?? "")), [data, nameKey]);
1583
- const chartConfig = React__namespace.useMemo(() => buildChartConfig(names, colors), [names, colors]);
1584
- const hasData = data.length > 0;
1585
- const chartState = getChartState(
1586
- {
1587
- isLoading,
1588
- error,
1589
- emptyTitle,
1590
- emptyDescription,
1591
- errorTitle,
1592
- errorDescription,
1593
- loadingLabel,
1594
- stateClassName,
1595
- onRetry,
1596
- retryLabel
1597
- },
1598
- hasData
1599
- );
1600
- const coloredData = React__namespace.useMemo(
1601
- () => data.map((item, index) => {
1602
- var _a;
1603
- const name = String(item[nameKey] ?? "");
1604
- return {
1605
- ...item,
1606
- fill: ((_a = chartConfig[name]) == null ? void 0 : _a.color) ?? `var(--chart-${index % 8 + 1})`
1607
- };
1608
- }),
1609
- [data, nameKey, chartConfig]
1610
- );
1611
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("flex w-full flex-col gap-3", className), children: [
1612
- /* @__PURE__ */ jsxRuntime.jsx(ChartContainer, { config: chartConfig, className: "h-[260px] w-full", children: chartState ?? /* @__PURE__ */ jsxRuntime.jsxs(
1613
- RechartsPrimitive__namespace.RadialBarChart,
1614
- {
1615
- data: coloredData,
1616
- innerRadius,
1617
- outerRadius,
1618
- startAngle,
1619
- endAngle,
1620
- accessibilityLayer: true,
1621
- children: [
1622
- /* @__PURE__ */ jsxRuntime.jsx(
1623
- ChartTooltip,
1624
- {
1625
- cursor: false,
1626
- content: /* @__PURE__ */ jsxRuntime.jsx(
1627
- ChartTooltipContent,
1628
- {
1629
- nameKey,
1630
- formatter: valueFormatter ? (v) => valueFormatter(v) : void 0
1631
- }
1632
- )
1633
- }
1634
- ),
1635
- /* @__PURE__ */ jsxRuntime.jsx(
1636
- RechartsPrimitive__namespace.RadialBar,
1637
- {
1638
- dataKey,
1639
- background: showBackground ? { fill: "var(--muted)" } : false,
1640
- cornerRadius: 6,
1641
- isAnimationActive: true,
1642
- animationDuration: 700,
1643
- animationEasing: "ease-out"
1644
- }
1645
- )
1646
- ]
1647
- }
1648
- ) }),
1649
- showLegend && !chartState && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap justify-center gap-x-4 gap-y-1.5 px-2", children: coloredData.map((item, index) => {
1650
- const d = item;
1651
- const name = String(d[nameKey] ?? "");
1652
- const fillColor = d.fill ?? `var(--chart-${index % 8 + 1})`;
1653
- const val = d[dataKey];
1654
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
1655
- /* @__PURE__ */ jsxRuntime.jsx(
1656
- "span",
1657
- {
1658
- className: "inline-block h-2.5 w-2.5 shrink-0 rounded-full",
1659
- style: { backgroundColor: fillColor }
1660
- }
1661
- ),
1662
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
1663
- name,
1664
- val !== void 0 && val !== null && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-1 font-medium text-foreground", children: valueFormatter ? valueFormatter(val) : String(val) })
1665
- ] })
1666
- ] }, name);
1667
- }) })
1668
- ] });
1669
- }
1670
- function GaugeChart({
1671
- value,
1672
- min = 0,
1673
- max = 100,
1674
- thresholds,
1675
- label,
1676
- valueFormatter,
1677
- showNeedle = true,
1678
- className
1679
- }) {
1680
- const percent = Math.min(1, Math.max(0, (value - min) / (max - min)));
1681
- const percentInt = Math.round(percent * 100);
1682
- const activeColor = React__namespace.useMemo(() => {
1683
- if (!thresholds || thresholds.length === 0) return "var(--chart-1)";
1684
- for (const t of thresholds) {
1685
- if (percentInt <= t.value) return t.color;
1686
- }
1687
- return thresholds[thresholds.length - 1].color;
1688
- }, [thresholds, percentInt]);
1689
- const displayText = valueFormatter ? valueFormatter(value, percentInt) : `${percentInt}%`;
1690
- const cx = 100;
1691
- const cy = 100;
1692
- const R = 80;
1693
- const r = 54;
1694
- const polar = (angleDeg, radius) => {
1695
- const rad = angleDeg * Math.PI / 180;
1696
- return {
1697
- x: cx + radius * Math.cos(rad),
1698
- y: cy - radius * Math.sin(rad)
1699
- };
1700
- };
1701
- const trackStart = polar(180, R);
1702
- const trackEnd = polar(0, R);
1703
- const trackStartI = polar(180, r);
1704
- const trackEndI = polar(0, r);
1705
- const trackPath = [
1706
- `M ${trackStart.x} ${trackStart.y}`,
1707
- `A ${R} ${R} 0 0 1 ${trackEnd.x} ${trackEnd.y}`,
1708
- `L ${trackEndI.x} ${trackEndI.y}`,
1709
- `A ${r} ${r} 0 0 0 ${trackStartI.x} ${trackStartI.y}`,
1710
- "Z"
1711
- ].join(" ");
1712
- const valueAngle = 180 - percent * 180;
1713
- const valueEnd = polar(valueAngle, R);
1714
- const valueEndI = polar(valueAngle, r);
1715
- const valuePath = percent <= 0 ? "" : percent >= 1 ? trackPath : [
1716
- `M ${trackStart.x} ${trackStart.y}`,
1717
- `A ${R} ${R} 0 0 1 ${valueEnd.x} ${valueEnd.y}`,
1718
- `L ${valueEndI.x} ${valueEndI.y}`,
1719
- `A ${r} ${r} 0 0 0 ${trackStartI.x} ${trackStartI.y}`,
1720
- "Z"
1721
- ].join(" ");
1722
- const needleAngle = 180 - percent * 180;
1723
- const needleTip = polar(needleAngle, r - 6);
1724
- const needleBase1 = polar(needleAngle + 90, 5);
1725
- const needleBase2 = polar(needleAngle - 90, 5);
1726
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: button.cn("flex flex-col items-center gap-2", className), children: [
1727
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative w-full max-w-[260px]", children: /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 200 130", className: "w-full", "aria-label": `Gauge: ${displayText}`, children: [
1728
- /* @__PURE__ */ jsxRuntime.jsx("path", { d: trackPath, fill: "var(--muted)" }),
1729
- valuePath && /* @__PURE__ */ jsxRuntime.jsx("path", { d: valuePath, fill: activeColor }),
1730
- showNeedle && /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
1731
- /* @__PURE__ */ jsxRuntime.jsx(
1732
- "polygon",
1733
- {
1734
- points: `${needleTip.x},${needleTip.y} ${needleBase1.x},${needleBase1.y} ${needleBase2.x},${needleBase2.y}`,
1735
- fill: "var(--foreground)",
1736
- opacity: 0.85
1737
- }
1738
- ),
1739
- /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r: 5, fill: "var(--foreground)" })
1740
- ] }),
1741
- /* @__PURE__ */ jsxRuntime.jsx(
1742
- "text",
1743
- {
1744
- x: cx,
1745
- y: cy + 18,
1746
- textAnchor: "middle",
1747
- dominantBaseline: "middle",
1748
- fontSize: 22,
1749
- fontWeight: 700,
1750
- fill: "currentColor",
1751
- className: "fill-foreground",
1752
- children: displayText
1753
- }
1754
- ),
1755
- label && /* @__PURE__ */ jsxRuntime.jsx(
1756
- "text",
1757
- {
1758
- x: cx,
1759
- y: cy + 36,
1760
- textAnchor: "middle",
1761
- dominantBaseline: "middle",
1762
- fontSize: 10,
1763
- fill: "currentColor",
1764
- className: "fill-muted-foreground",
1765
- children: label
1766
- }
1767
- )
1768
- ] }) }),
1769
- thresholds && thresholds.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-wrap justify-center gap-x-3 gap-y-1", children: thresholds.map((t, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1.5", children: [
1770
- /* @__PURE__ */ jsxRuntime.jsx(
1771
- "span",
1772
- {
1773
- className: "inline-block h-2 w-2 shrink-0 rounded-full",
1774
- style: { backgroundColor: t.color }
1775
- }
1776
- ),
1777
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", children: t.label })
1778
- ] }, i)) })
1779
- ] });
1780
- }
1781
- function Table({ className, ...props }) {
1782
- return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-slot": "table-container", className: "relative w-full overflow-x-auto", children: /* @__PURE__ */ jsxRuntime.jsx(
1783
- "table",
1784
- {
1785
- "data-slot": "table",
1786
- className: button.cn("w-full caption-bottom text-sm", className),
1787
- ...props
1788
- }
1789
- ) });
1790
- }
1791
- function TableHeader({ className, ...props }) {
1792
- return /* @__PURE__ */ jsxRuntime.jsx("thead", { "data-slot": "table-header", className: button.cn("[&_tr]:border-b", className), ...props });
1793
- }
1794
- function TableBody({ className, ...props }) {
1795
- return /* @__PURE__ */ jsxRuntime.jsx(
1796
- "tbody",
1797
- {
1798
- "data-slot": "table-body",
1799
- className: button.cn("[&_tr:last-child]:border-0", className),
1800
- ...props
1801
- }
1802
- );
1803
- }
1804
- function TableFooter({ className, ...props }) {
1805
- return /* @__PURE__ */ jsxRuntime.jsx(
1806
- "tfoot",
1807
- {
1808
- "data-slot": "table-footer",
1809
- className: button.cn("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0", className),
1810
- ...props
1811
- }
1812
- );
1813
- }
1814
- function TableRow({ className, ...props }) {
1815
- return /* @__PURE__ */ jsxRuntime.jsx(
1816
- "tr",
1817
- {
1818
- "data-slot": "table-row",
1819
- className: button.cn(
1820
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
1821
- className
1822
- ),
1823
- ...props
1824
- }
1825
- );
1826
- }
1827
- function TableHead({ className, ...props }) {
1828
- return /* @__PURE__ */ jsxRuntime.jsx(
1829
- "th",
1830
- {
1831
- "data-slot": "table-head",
1832
- className: button.cn(
1833
- "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1834
- className
1835
- ),
1836
- ...props
1837
- }
1838
- );
1839
- }
1840
- function TableCell({ className, ...props }) {
1841
- return /* @__PURE__ */ jsxRuntime.jsx(
1842
- "td",
1843
- {
1844
- "data-slot": "table-cell",
1845
- className: button.cn(
1846
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1847
- className
1848
- ),
1849
- ...props
1850
- }
1851
- );
1852
- }
1853
- function TableCaption({ className, ...props }) {
1854
- return /* @__PURE__ */ jsxRuntime.jsx(
1855
- "caption",
1856
- {
1857
- "data-slot": "table-caption",
1858
- className: button.cn("text-muted-foreground mt-4 text-sm", className),
1859
- ...props
1860
- }
1861
- );
1862
- }
1863
- const Textarea = React__namespace.forwardRef(
1864
- ({ className, size = "md", ...props }, ref) => {
1865
- const sizeClasses = {
1866
- sm: "px-2 py-1 text-sm",
1867
- md: "px-3 py-2 text-base",
1868
- lg: "px-4 py-3 text-base"
1869
- };
1870
- return /* @__PURE__ */ jsxRuntime.jsx(
1871
- "textarea",
1872
- {
1873
- "data-slot": "textarea",
1874
- className: button.cn(
1875
- "flex min-h-16 w-full bg-background rounded-[var(--radius)] border border-border transition-colors outline-none resize-none text-foreground",
1876
- "placeholder:text-muted-foreground",
1877
- "focus:ring-2 focus:ring-primary focus:border-transparent",
1878
- "disabled:cursor-not-allowed disabled:opacity-50",
1879
- sizeClasses[size],
1880
- className
1881
- ),
1882
- ref,
1883
- ...props
1884
- }
1885
- );
1886
- }
1887
- );
1888
- Textarea.displayName = "Textarea";
1889
- function Dialog({ ...props }) {
1890
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
1891
- }
1892
- function DialogTrigger({ ...props }) {
1893
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
1894
- }
1895
- function DialogPortal({ ...props }) {
1896
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
1897
- }
1898
- function DialogClose({ ...props }) {
1899
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
1900
- }
1901
- const DialogOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1902
- DialogPrimitive__namespace.Overlay,
1903
- {
1904
- ref,
1905
- "data-slot": "dialog-overlay",
1906
- className: button.cn(
1907
- "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",
1908
- className
1909
- ),
1910
- ...props
1911
- }
1912
- ));
1913
- DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
1914
- const dialogVariants = classVarianceAuthority.cva(
1915
- "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)]",
1916
- {
1917
- variants: {
1918
- size: {
1919
- sm: "max-w-sm",
1920
- md: "max-w-md",
1921
- lg: "max-w-lg",
1922
- xl: "max-w-xl",
1923
- "2xl": "max-w-2xl",
1924
- "3xl": "max-w-3xl",
1925
- "4xl": "max-w-4xl",
1926
- "5xl": "max-w-5xl",
1927
- full: "max-w-[calc(100vw-2rem)] h-[calc(100dvh-2rem)]"
1928
- }
1929
- },
1930
- defaultVariants: {
1931
- size: "lg"
1932
- }
1933
- }
1934
- );
1935
- const DialogContent = React__namespace.forwardRef(({ className, children, size, showClose = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
1936
- /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
1937
- /* @__PURE__ */ jsxRuntime.jsxs(
1938
- DialogPrimitive__namespace.Content,
1939
- {
1940
- ref,
1941
- "data-slot": "dialog-content",
1942
- className: button.cn(dialogVariants({ size }), className),
1943
- ...props,
1944
- children: [
1945
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 p-6 overflow-y-auto flex-1 min-h-0", children }),
1946
- 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: [
1947
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
1948
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
1949
- ] })
1950
- ]
1951
- }
1952
- )
1953
- ] }));
1954
- DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
1955
- function DialogHeader({ className, ...props }) {
1956
- return /* @__PURE__ */ jsxRuntime.jsx(
1957
- "div",
1958
- {
1959
- "data-slot": "dialog-header",
1960
- className: button.cn("flex flex-col gap-2 text-left shrink-0", className),
1961
- ...props
1962
- }
1963
- );
1964
- }
1965
- function DialogBody({ className, ...props }) {
1966
- return /* @__PURE__ */ jsxRuntime.jsx(
1967
- "div",
1968
- {
1969
- "data-slot": "dialog-body",
1970
- className: button.cn("flex-1 overflow-y-auto min-h-0 -mx-6 px-6", className),
1971
- ...props
1972
- }
1973
- );
1974
- }
1975
- function DialogFooter({ className, ...props }) {
1976
- return /* @__PURE__ */ jsxRuntime.jsx(
1977
- "div",
1978
- {
1979
- "data-slot": "dialog-footer",
1980
- className: button.cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end shrink-0", className),
1981
- ...props
1982
- }
1983
- );
1984
- }
1985
- function DialogTitle({ className, ...props }) {
1986
- return /* @__PURE__ */ jsxRuntime.jsx(
1987
- DialogPrimitive__namespace.Title,
1988
- {
1989
- "data-slot": "dialog-title",
1990
- className: button.cn(
1991
- "text-foreground font-semibold leading-tight text-[length:var(--text-h4)]",
1992
- className
1993
- ),
1994
- ...props
1995
- }
1996
- );
1997
- }
1998
- function DialogDescription({
1999
- className,
2000
- ...props
2001
- }) {
2002
- return /* @__PURE__ */ jsxRuntime.jsx(
2003
- DialogPrimitive__namespace.Description,
2004
- {
2005
- "data-slot": "dialog-description",
2006
- className: button.cn("text-muted-foreground", className),
2007
- ...props
2008
- }
2009
- );
2010
- }
2011
- function useRichTextEditor({
2012
- value,
2013
- onChange
2014
- }) {
2015
- const editorRef = React.useRef(null);
2016
- const searchInputRef = React.useRef(null);
2017
- const linkInputRef = React.useRef(null);
2018
- const savedSelection = React.useRef(null);
2019
- const [wordCount, setWordCount] = React.useState(0);
2020
- const [characterCount, setCharacterCount] = React.useState(0);
2021
- const [activeFormats, setActiveFormats] = React.useState({
2022
- bold: false,
2023
- italic: false,
2024
- underline: false,
2025
- justifyLeft: false,
2026
- justifyCenter: false,
2027
- justifyRight: false,
2028
- insertUnorderedList: false,
2029
- insertOrderedList: false,
2030
- link: false,
2031
- h1: false,
2032
- h2: false,
2033
- h3: false,
2034
- p: true
2035
- });
2036
- const [isSearchOpen, setIsSearchOpen] = React.useState(false);
2037
- const [searchQuery, setSearchQuery] = React.useState("");
2038
- const [linkUrl, setLinkUrl] = React.useState("https://");
2039
- const [isLinkOpen, setIsLinkOpen] = React.useState(false);
2040
- const [hasSavedSelection, setHasSavedSelection] = React.useState(false);
2041
- const findParentTag = React.useCallback((node, tagName) => {
2042
- let current = node;
2043
- while (current && current !== editorRef.current) {
2044
- if (current.nodeName === tagName) return current;
2045
- current = current.parentNode;
2046
- }
2047
- return null;
2048
- }, []);
2049
- const updateActiveFormats = React.useCallback(() => {
2050
- let formatBlock = "";
2051
- try {
2052
- formatBlock = document.queryCommandValue("formatBlock");
2053
- } catch (_e) {
2054
- }
2055
- const selection = window.getSelection();
2056
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
2057
- const focusNode = selection == null ? void 0 : selection.focusNode;
2058
- setActiveFormats({
2059
- bold: document.queryCommandState("bold"),
2060
- italic: document.queryCommandState("italic"),
2061
- underline: document.queryCommandState("underline"),
2062
- justifyLeft: document.queryCommandState("justifyLeft"),
2063
- justifyCenter: document.queryCommandState("justifyCenter"),
2064
- justifyRight: document.queryCommandState("justifyRight"),
2065
- insertUnorderedList: document.queryCommandState("insertUnorderedList"),
2066
- insertOrderedList: document.queryCommandState("insertOrderedList"),
2067
- link: !!(findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A")),
2068
- h1: formatBlock === "h1" || formatBlock === "H1",
2069
- h2: formatBlock === "h2" || formatBlock === "H2",
2070
- h3: formatBlock === "h3" || formatBlock === "H3",
2071
- p: formatBlock === "p" || formatBlock === "P" || formatBlock === "div" || formatBlock === "DIV" || formatBlock === ""
2072
- });
2073
- }, [findParentTag]);
2074
- const updateActiveFormatsRef = React.useRef(updateActiveFormats);
2075
- React.useEffect(() => {
2076
- updateActiveFormatsRef.current = updateActiveFormats;
2077
- }, [updateActiveFormats]);
2078
- React.useEffect(() => {
2079
- if (editorRef.current && editorRef.current.innerHTML !== value) {
2080
- editorRef.current.innerHTML = value;
2081
- }
2082
- const handleSelectionChange = () => {
2083
- if (document.activeElement === editorRef.current) {
2084
- updateActiveFormatsRef.current();
2085
- }
2086
- };
2087
- document.addEventListener("selectionchange", handleSelectionChange);
2088
- return () => document.removeEventListener("selectionchange", handleSelectionChange);
2089
- }, []);
2090
- React.useEffect(() => {
2091
- var _a;
2092
- const text = ((_a = editorRef.current) == null ? void 0 : _a.innerText) || "";
2093
- setWordCount(text.trim() ? text.trim().split(/\s+/).length : 0);
2094
- setCharacterCount(text.trim() ? text.length : 0);
2095
- }, [value]);
2096
- const handleInput = React.useCallback(() => {
2097
- if (editorRef.current) {
2098
- onChange == null ? void 0 : onChange(editorRef.current.innerHTML);
2099
- updateActiveFormats();
2100
- const text = editorRef.current.innerText || "";
2101
- setWordCount(text.trim() ? text.trim().split(/\s+/).length : 0);
2102
- setCharacterCount(text.trim() ? text.length : 0);
2103
- }
2104
- }, [onChange, updateActiveFormats]);
2105
- const execCommand = React.useCallback(
2106
- (command, val = "") => {
2107
- var _a;
2108
- document.execCommand(command, false, val);
2109
- updateActiveFormats();
2110
- (_a = editorRef.current) == null ? void 0 : _a.focus();
2111
- if (editorRef.current) {
2112
- onChange == null ? void 0 : onChange(editorRef.current.innerHTML);
2113
- }
2114
- },
2115
- [onChange, updateActiveFormats]
2116
- );
2117
- const performSearch = React.useCallback((text, backward = false) => {
2118
- var _a, _b;
2119
- if (!text || !editorRef.current) return;
2120
- const editor = editorRef.current;
2121
- const selection = window.getSelection();
2122
- if (!selection) return;
2123
- const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT);
2124
- const segments = [];
2125
- let offset = 0;
2126
- let node;
2127
- while (node = walker.nextNode()) {
2128
- segments.push({ node, start: offset });
2129
- offset += node.length;
2130
- }
2131
- const fullText = segments.reduce((acc, s) => acc + (s.node.textContent ?? ""), "");
2132
- let searchFrom = 0;
2133
- if (selection.rangeCount > 0) {
2134
- const range2 = selection.getRangeAt(0);
2135
- if (editor.contains(range2.startContainer)) {
2136
- const seg = segments.find((s) => s.node === range2.startContainer);
2137
- if (seg) {
2138
- searchFrom = backward ? seg.start + range2.startOffset - 1 : seg.start + range2.endOffset;
2139
- }
2140
- }
2141
- }
2142
- const lowerFull = fullText.toLowerCase();
2143
- const lowerQuery = text.toLowerCase();
2144
- let matchStart = -1;
2145
- if (backward) {
2146
- matchStart = lowerFull.lastIndexOf(lowerQuery, Math.max(0, searchFrom));
2147
- if (matchStart === -1) matchStart = lowerFull.lastIndexOf(lowerQuery);
2148
- } else {
2149
- matchStart = lowerFull.indexOf(lowerQuery, searchFrom);
2150
- if (matchStart === -1) matchStart = lowerFull.indexOf(lowerQuery);
2151
- }
2152
- if (matchStart === -1) return;
2153
- const matchEnd = matchStart + text.length;
2154
- const range = document.createRange();
2155
- let startSet = false;
2156
- let endSet = false;
2157
- for (let i = 0; i < segments.length && !endSet; i++) {
2158
- const seg = segments[i];
2159
- const segEnd = seg.start + seg.node.length;
2160
- if (!startSet && matchStart < segEnd && matchStart >= seg.start) {
2161
- range.setStart(seg.node, matchStart - seg.start);
2162
- startSet = true;
2163
- }
2164
- if (startSet && matchEnd <= segEnd) {
2165
- range.setEnd(seg.node, matchEnd - seg.start);
2166
- endSet = true;
2167
- }
2168
- }
2169
- if (startSet && endSet) {
2170
- selection.removeAllRanges();
2171
- selection.addRange(range);
2172
- (_b = (_a = range.startContainer.parentElement) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, { block: "nearest" });
2173
- }
2174
- }, []);
2175
- const handleCreateLink = React.useCallback(() => {
2176
- if (savedSelection.current) {
2177
- const selection2 = window.getSelection();
2178
- selection2 == null ? void 0 : selection2.removeAllRanges();
2179
- selection2 == null ? void 0 : selection2.addRange(savedSelection.current);
2180
- }
2181
- const selection = window.getSelection();
2182
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
2183
- const existingLink = findParentTag(anchorNode || null, "A");
2184
- if (existingLink) {
2185
- if (linkUrl) {
2186
- existingLink.setAttribute("href", linkUrl);
2187
- existingLink.setAttribute("target", "_blank");
2188
- existingLink.setAttribute("rel", "noopener noreferrer");
2189
- existingLink.style.color = "hsl(var(--primary))";
2190
- existingLink.style.textDecoration = "underline";
2191
- existingLink.style.cursor = "pointer";
2192
- }
2193
- handleInput();
2194
- setIsLinkOpen(false);
2195
- savedSelection.current = null;
2196
- return;
2197
- }
2198
- if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
2199
- return;
2200
- }
2201
- if (linkUrl) {
2202
- document.execCommand("createLink", false, linkUrl);
2203
- setTimeout(() => {
2204
- var _a;
2205
- const anchor = findParentTag(((_a = window.getSelection()) == null ? void 0 : _a.anchorNode) || null, "A");
2206
- if (anchor) {
2207
- anchor.setAttribute("target", "_blank");
2208
- anchor.setAttribute("rel", "noopener noreferrer");
2209
- anchor.style.color = "hsl(var(--primary))";
2210
- anchor.style.textDecoration = "underline";
2211
- anchor.style.cursor = "pointer";
2212
- }
2213
- handleInput();
2214
- }, 10);
2215
- setIsLinkOpen(false);
2216
- savedSelection.current = null;
2217
- }
2218
- }, [linkUrl, findParentTag, handleInput]);
2219
- const handleUnlink = React.useCallback(() => {
2220
- const selection = window.getSelection();
2221
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
2222
- const existingLink = findParentTag(anchorNode || null, "A");
2223
- if (existingLink) {
2224
- const parent = existingLink.parentNode;
2225
- while (existingLink.firstChild) {
2226
- parent == null ? void 0 : parent.insertBefore(existingLink.firstChild, existingLink);
2227
- }
2228
- parent == null ? void 0 : parent.removeChild(existingLink);
2229
- handleInput();
2230
- } else {
2231
- document.execCommand("unlink", false, "");
2232
- }
2233
- }, [findParentTag, handleInput]);
2234
- const onLinkPopoverOpenChange = React.useCallback(
2235
- (open) => {
2236
- if (open) {
2237
- const selection = window.getSelection();
2238
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
2239
- const focusNode = selection == null ? void 0 : selection.focusNode;
2240
- const existingLink = findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A");
2241
- if (existingLink) {
2242
- setLinkUrl(existingLink.getAttribute("href") || "https://");
2243
- } else {
2244
- setLinkUrl("https://");
2245
- }
2246
- if (selection && selection.rangeCount > 0 && (!selection.isCollapsed || existingLink)) {
2247
- savedSelection.current = selection.getRangeAt(0).cloneRange();
2248
- setHasSavedSelection(true);
2249
- } else {
2250
- savedSelection.current = null;
2251
- setHasSavedSelection(false);
2252
- }
2253
- setTimeout(() => {
2254
- var _a;
2255
- return (_a = linkInputRef.current) == null ? void 0 : _a.focus();
2256
- }, 100);
2257
- } else {
2258
- setHasSavedSelection(false);
2259
- }
2260
- setIsLinkOpen(open);
2261
- },
2262
- [findParentTag]
2263
- );
2264
- return {
2265
- // Refs
2266
- editorRef,
2267
- searchInputRef,
2268
- linkInputRef,
2269
- // State
2270
- activeFormats,
2271
- isSearchOpen,
2272
- setIsSearchOpen,
2273
- searchQuery,
2274
- setSearchQuery,
2275
- linkUrl,
2276
- setLinkUrl,
2277
- isLinkOpen,
2278
- hasSavedSelection,
2279
- // Computed
2280
- wordCount,
2281
- characterCount,
2282
- // Handlers
2283
- updateActiveFormats,
2284
- execCommand,
2285
- handleInput,
2286
- performSearch,
2287
- handleCreateLink,
2288
- handleUnlink,
2289
- onLinkPopoverOpenChange
2290
- };
2291
- }
2292
- function RichTextEditor({
2293
- value,
2294
- onChange,
2295
- placeholder,
2296
- className,
2297
- actionButton,
2298
- allowSearch = true,
2299
- allowLinks = true,
2300
- allowUndoRedo = true,
2301
- allowHeadings = true,
2302
- allowFormatting = true,
2303
- allowAlignment = true,
2304
- allowLists = true,
2305
- showWordCount = true,
2306
- showCharacterCount = true,
2307
- disabled = false,
2308
- readOnly = false,
2309
- onFocus,
2310
- onBlur,
2311
- minHeight,
2312
- maxHeight
2313
- }) {
2314
- const isEditable = !disabled && !readOnly;
2315
- const showToolbar = isEditable;
2316
- const {
2317
- editorRef,
2318
- searchInputRef,
2319
- linkInputRef,
2320
- activeFormats,
2321
- isSearchOpen,
2322
- setIsSearchOpen,
2323
- searchQuery,
2324
- setSearchQuery,
2325
- linkUrl,
2326
- setLinkUrl,
2327
- isLinkOpen,
2328
- hasSavedSelection,
2329
- wordCount,
2330
- characterCount,
2331
- updateActiveFormats,
2332
- execCommand,
2333
- handleInput,
2334
- performSearch,
2335
- handleCreateLink,
2336
- handleUnlink,
2337
- onLinkPopoverOpenChange
2338
- } = useRichTextEditor({ value, onChange });
2339
- const getCurrentBlockLabel = () => {
2340
- if (activeFormats.h1)
2341
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2342
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 mr-1 shrink-0" }),
2343
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 1" })
2344
- ] });
2345
- if (activeFormats.h2)
2346
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2347
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 mr-1 shrink-0" }),
2348
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 2" })
2349
- ] });
2350
- if (activeFormats.h3)
2351
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2352
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 mr-1 shrink-0" }),
2353
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 3" })
2354
- ] });
2355
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2356
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 mr-1 shrink-0" }),
2357
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Parágrafo" })
2358
- ] });
2359
- };
2360
- return /* @__PURE__ */ jsxRuntime.jsxs(
2361
- "div",
2362
- {
2363
- className: button.cn(
2364
- "flex flex-col h-full w-full bg-background sm:border border-border sm:shadow-sm sm:rounded-lg overflow-hidden",
2365
- disabled && "opacity-50 pointer-events-none",
2366
- className
2367
- ),
2368
- children: [
2369
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
2370
- [contenteditable]:empty:before {
2371
- content: attr(data-placeholder);
2372
- color: hsl(var(--muted-foreground));
2373
- pointer-events: none;
2374
- display: block;
2375
- }
2376
- .prose-editor ul {
2377
- list-style-type: disc !important;
2378
- padding-left: 1.5rem !important;
2379
- margin-top: 0.5rem !important;
2380
- margin-bottom: 0.5rem !important;
2381
- }
2382
- .prose-editor ol {
2383
- list-style-type: decimal !important;
2384
- padding-left: 1.5rem !important;
2385
- margin-top: 0.5rem !important;
2386
- margin-bottom: 0.5rem !important;
2387
- }
2388
- .prose-editor b, .prose-editor strong {
2389
- font-weight: 600 !important;
2390
- }
2391
- .prose-editor i, .prose-editor em {
2392
- font-style: italic !important;
2393
- }
2394
- .prose-editor u {
2395
- text-decoration: underline !important;
2396
- }
2397
- .prose-editor h1 {
2398
- font-size: 2.25rem !important;
2399
- font-weight: 700 !important;
2400
- margin-bottom: 1.25rem !important;
2401
- line-height: 1.2 !important;
2402
- margin-top: 2rem !important;
2403
- color: hsl(var(--foreground));
2404
- }
2405
- .prose-editor h2 {
2406
- font-size: 1.75rem !important;
2407
- font-weight: 600 !important;
2408
- margin-bottom: 1rem !important;
2409
- margin-top: 1.5rem !important;
2410
- color: hsl(var(--foreground));
2411
- }
2412
- .prose-editor h3 {
2413
- font-size: 1.35rem !important;
2414
- font-weight: 600 !important;
2415
- margin-bottom: 0.75rem !important;
2416
- margin-top: 1.25rem !important;
2417
- color: hsl(var(--foreground));
2418
- }
2419
- .prose-editor p {
2420
- margin-bottom: 1rem !important;
2421
- line-height: 1.6 !important;
2422
- }
2423
- .prose-editor a {
2424
- color: var(--info) !important;
2425
- text-decoration: underline !important;
2426
- cursor: pointer !important;
2427
- }
2428
- .prose-editor h1:first-child, .prose-editor h2:first-child, .prose-editor h3:first-child, .prose-editor p:first-child {
2429
- margin-top: 0 !important;
2430
- }
2431
- .prose-editor {
2432
- outline: none !important;
2433
- }
2434
- ` }),
2435
- 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: [
2436
- allowUndoRedo && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2437
- /* @__PURE__ */ jsxRuntime.jsx(
2438
- button.Button,
2439
- {
2440
- variant: "ghost",
2441
- size: "icon",
2442
- className: "h-8 w-8 text-muted-foreground",
2443
- onClick: () => execCommand("undo"),
2444
- title: "Desfazer",
2445
- "aria-label": "Desfazer",
2446
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-4 h-4" })
2447
- }
2448
- ),
2449
- /* @__PURE__ */ jsxRuntime.jsx(
2450
- button.Button,
2451
- {
2452
- variant: "ghost",
2453
- size: "icon",
2454
- className: "h-8 w-8 text-muted-foreground",
2455
- onClick: () => execCommand("redo"),
2456
- title: "Refazer",
2457
- "aria-label": "Refazer",
2458
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Redo, { className: "w-4 h-4" })
2459
- }
2460
- ),
2461
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2462
- ] }),
2463
- allowHeadings && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2464
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { modal: false, children: [
2465
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
2466
- button.Button,
2467
- {
2468
- variant: "ghost",
2469
- size: "sm",
2470
- className: "h-8 gap-0 text-muted-foreground w-[120px] justify-start px-2",
2471
- children: [
2472
- getCurrentBlockLabel(),
2473
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 ml-auto opacity-50 shrink-0" })
2474
- ]
2475
- }
2476
- ) }),
2477
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "start", className: "w-[160px]", style: { zIndex: 9999 }, children: [
2478
- /* @__PURE__ */ jsxRuntime.jsxs(
2479
- dropdownMenu.DropdownMenuItem,
2480
- {
2481
- onPointerDown: (e) => e.preventDefault(),
2482
- onClick: () => execCommand("formatBlock", "P"),
2483
- className: "gap-2",
2484
- children: [
2485
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 text-muted-foreground" }),
2486
- " Parágrafo"
2487
- ]
2488
- }
2489
- ),
2490
- /* @__PURE__ */ jsxRuntime.jsxs(
2491
- dropdownMenu.DropdownMenuItem,
2492
- {
2493
- onPointerDown: (e) => e.preventDefault(),
2494
- onClick: () => execCommand("formatBlock", "H1"),
2495
- className: "gap-2",
2496
- children: [
2497
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 text-muted-foreground" }),
2498
- " Título 1"
2499
- ]
2500
- }
2501
- ),
2502
- /* @__PURE__ */ jsxRuntime.jsxs(
2503
- dropdownMenu.DropdownMenuItem,
2504
- {
2505
- onPointerDown: (e) => e.preventDefault(),
2506
- onClick: () => execCommand("formatBlock", "H2"),
2507
- className: "gap-2",
2508
- children: [
2509
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 text-muted-foreground" }),
2510
- " Título 2"
2511
- ]
2512
- }
2513
- ),
2514
- /* @__PURE__ */ jsxRuntime.jsxs(
2515
- dropdownMenu.DropdownMenuItem,
2516
- {
2517
- onPointerDown: (e) => e.preventDefault(),
2518
- onClick: () => execCommand("formatBlock", "H3"),
2519
- className: "gap-2",
2520
- children: [
2521
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 text-muted-foreground" }),
2522
- " Título 3"
2523
- ]
2524
- }
2525
- )
2526
- ] })
2527
- ] }),
2528
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2529
- ] }),
2530
- allowFormatting && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2531
- /* @__PURE__ */ jsxRuntime.jsx(
2532
- button.Button,
2533
- {
2534
- variant: "ghost",
2535
- size: "icon",
2536
- className: button.cn(
2537
- "h-8 w-8 text-muted-foreground",
2538
- activeFormats.bold && "bg-muted text-foreground"
2539
- ),
2540
- onClick: () => execCommand("bold"),
2541
- title: "Negrito",
2542
- "aria-label": "Negrito",
2543
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: "w-4 h-4" })
2544
- }
2545
- ),
2546
- /* @__PURE__ */ jsxRuntime.jsx(
2547
- button.Button,
2548
- {
2549
- variant: "ghost",
2550
- size: "icon",
2551
- className: button.cn(
2552
- "h-8 w-8 text-muted-foreground",
2553
- activeFormats.italic && "bg-muted text-foreground"
2554
- ),
2555
- onClick: () => execCommand("italic"),
2556
- title: "Itálico",
2557
- "aria-label": "Itálico",
2558
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: "w-4 h-4" })
2559
- }
2560
- ),
2561
- /* @__PURE__ */ jsxRuntime.jsx(
2562
- button.Button,
2563
- {
2564
- variant: "ghost",
2565
- size: "icon",
2566
- className: button.cn(
2567
- "h-8 w-8 text-muted-foreground",
2568
- activeFormats.underline && "bg-muted text-foreground"
2569
- ),
2570
- onClick: () => execCommand("underline"),
2571
- title: "Sublinhado",
2572
- "aria-label": "Sublinhado",
2573
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: "w-4 h-4" })
2574
- }
2575
- ),
2576
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2577
- ] }),
2578
- allowAlignment && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2579
- /* @__PURE__ */ jsxRuntime.jsx(
2580
- button.Button,
2581
- {
2582
- variant: "ghost",
2583
- size: "icon",
2584
- className: button.cn(
2585
- "h-8 w-8 text-muted-foreground",
2586
- activeFormats.justifyLeft && "bg-muted text-foreground"
2587
- ),
2588
- onClick: () => execCommand("justifyLeft"),
2589
- title: "Alinhar à esquerda",
2590
- "aria-label": "Alinhar à esquerda",
2591
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeft, { className: "w-4 h-4" })
2592
- }
2593
- ),
2594
- /* @__PURE__ */ jsxRuntime.jsx(
2595
- button.Button,
2596
- {
2597
- variant: "ghost",
2598
- size: "icon",
2599
- className: button.cn(
2600
- "h-8 w-8 text-muted-foreground",
2601
- activeFormats.justifyCenter && "bg-muted text-foreground"
2602
- ),
2603
- onClick: () => execCommand("justifyCenter"),
2604
- title: "Centralizar",
2605
- "aria-label": "Centralizar",
2606
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignCenter, { className: "w-4 h-4" })
2607
- }
2608
- ),
2609
- /* @__PURE__ */ jsxRuntime.jsx(
2610
- button.Button,
2611
- {
2612
- variant: "ghost",
2613
- size: "icon",
2614
- className: button.cn(
2615
- "h-8 w-8 text-muted-foreground",
2616
- activeFormats.justifyRight && "bg-muted text-foreground"
2617
- ),
2618
- onClick: () => execCommand("justifyRight"),
2619
- title: "Alinhar à direita",
2620
- "aria-label": "Alinhar à direita",
2621
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignRight, { className: "w-4 h-4" })
2622
- }
2623
- ),
2624
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2625
- ] }),
2626
- allowLists && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2627
- /* @__PURE__ */ jsxRuntime.jsx(
2628
- button.Button,
2629
- {
2630
- variant: "ghost",
2631
- size: "icon",
2632
- className: button.cn(
2633
- "h-8 w-8 text-muted-foreground",
2634
- activeFormats.insertUnorderedList && "bg-muted text-foreground"
2635
- ),
2636
- onClick: () => execCommand("insertUnorderedList"),
2637
- title: "Lista com marcadores",
2638
- "aria-label": "Lista com marcadores",
2639
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "w-4 h-4" })
2640
- }
2641
- ),
2642
- /* @__PURE__ */ jsxRuntime.jsx(
2643
- button.Button,
2644
- {
2645
- variant: "ghost",
2646
- size: "icon",
2647
- className: button.cn(
2648
- "h-8 w-8 text-muted-foreground",
2649
- activeFormats.insertOrderedList && "bg-muted text-foreground"
2650
- ),
2651
- onClick: () => execCommand("insertOrderedList"),
2652
- title: "Lista numerada",
2653
- "aria-label": "Lista numerada",
2654
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "w-4 h-4" })
2655
- }
2656
- ),
2657
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2658
- ] }),
2659
- allowLinks && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2660
- /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { open: isLinkOpen, onOpenChange: onLinkPopoverOpenChange, modal: false, children: [
2661
- /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2662
- button.Button,
2663
- {
2664
- variant: "ghost",
2665
- size: "icon",
2666
- className: button.cn(
2667
- "h-8 w-8 text-muted-foreground",
2668
- (activeFormats.link || isLinkOpen) && "bg-muted text-foreground"
2669
- ),
2670
- title: "Inserir link",
2671
- "aria-label": "Inserir link",
2672
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "w-4 h-4" })
2673
- }
2674
- ) }),
2675
- /* @__PURE__ */ jsxRuntime.jsx(input.PopoverContent, { className: "w-80 p-3", align: "start", style: { zIndex: 9999 }, children: !activeFormats.link && !hasSavedSelection ? /* @__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: [
2676
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium", children: activeFormats.link ? "Editar Link" : "Inserir Link" }),
2677
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
2678
- /* @__PURE__ */ jsxRuntime.jsx(
2679
- input.Input,
2680
- {
2681
- ref: linkInputRef,
2682
- placeholder: "https://...",
2683
- value: linkUrl,
2684
- onChange: (e) => setLinkUrl(e.target.value),
2685
- onKeyDown: (e) => {
2686
- if (e.key === "Enter") {
2687
- e.preventDefault();
2688
- e.stopPropagation();
2689
- handleCreateLink();
2690
- }
2691
- },
2692
- className: "h-8 text-xs"
2693
- }
2694
- ),
2695
- /* @__PURE__ */ jsxRuntime.jsx(button.Button, { size: "sm", className: "h-8", onClick: handleCreateLink, children: "Aplicar" })
2696
- ] })
2697
- ] }) })
2698
- ] }),
2699
- /* @__PURE__ */ jsxRuntime.jsx(
2700
- button.Button,
2701
- {
2702
- variant: "ghost",
2703
- size: "icon",
2704
- className: "h-8 w-8 text-muted-foreground",
2705
- onClick: handleUnlink,
2706
- title: "Remover link",
2707
- "aria-label": "Remover link",
2708
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
2709
- }
2710
- ),
2711
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2712
- ] }),
2713
- (allowFormatting || allowHeadings || allowAlignment || allowLists || allowLinks) && /* @__PURE__ */ jsxRuntime.jsx(
2714
- button.Button,
2715
- {
2716
- variant: "ghost",
2717
- size: "icon",
2718
- className: "h-8 w-8 text-muted-foreground",
2719
- onClick: () => execCommand("removeFormat"),
2720
- title: "Limpar formatação",
2721
- "aria-label": "Limpar formatação",
2722
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4" })
2723
- }
2724
- ),
2725
- allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
2726
- button.Button,
2727
- {
2728
- variant: "ghost",
2729
- size: "icon",
2730
- className: button.cn(
2731
- "h-8 w-8 text-muted-foreground",
2732
- isSearchOpen && "bg-muted text-foreground"
2733
- ),
2734
- onClick: () => {
2735
- setIsSearchOpen(!isSearchOpen);
2736
- if (!isSearchOpen) setTimeout(() => {
2737
- var _a;
2738
- return (_a = searchInputRef.current) == null ? void 0 : _a.focus();
2739
- }, 100);
2740
- },
2741
- title: "Buscar",
2742
- "aria-label": "Buscar",
2743
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" })
2744
- }
2745
- ),
2746
- actionButton && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2747
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
2748
- actionButton
2749
- ] })
2750
- ] }),
2751
- isSearchOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 border-b border-border bg-muted/20 flex items-center gap-2", children: [
2752
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 max-w-sm", children: [
2753
- /* @__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" }),
2754
- /* @__PURE__ */ jsxRuntime.jsx(
2755
- input.Input,
2756
- {
2757
- ref: searchInputRef,
2758
- placeholder: "Buscar no texto...",
2759
- value: searchQuery,
2760
- onChange: (e) => setSearchQuery(e.target.value),
2761
- onKeyDown: (e) => {
2762
- if (e.key === "Enter") {
2763
- e.preventDefault();
2764
- performSearch(searchQuery, e.shiftKey);
2765
- }
2766
- if (e.key === "Escape") {
2767
- setIsSearchOpen(false);
2768
- }
2769
- },
2770
- className: "h-8 pl-8 text-xs bg-background"
2771
- }
2772
- )
2773
- ] }),
2774
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
2775
- /* @__PURE__ */ jsxRuntime.jsx(
2776
- button.Button,
2777
- {
2778
- variant: "ghost",
2779
- size: "icon",
2780
- className: "h-7 w-7",
2781
- onMouseDown: (e) => e.preventDefault(),
2782
- onClick: () => performSearch(searchQuery, true),
2783
- title: "Anterior",
2784
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "w-4 h-4" })
2785
- }
2786
- ),
2787
- /* @__PURE__ */ jsxRuntime.jsx(
2788
- button.Button,
2789
- {
2790
- variant: "ghost",
2791
- size: "icon",
2792
- className: "h-7 w-7",
2793
- onMouseDown: (e) => e.preventDefault(),
2794
- onClick: () => performSearch(searchQuery, false),
2795
- title: "Próximo",
2796
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-4 h-4" })
2797
- }
2798
- ),
2799
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-border mx-1" }),
2800
- /* @__PURE__ */ jsxRuntime.jsx(
2801
- button.Button,
2802
- {
2803
- variant: "ghost",
2804
- size: "icon",
2805
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
2806
- onClick: () => setIsSearchOpen(false),
2807
- title: "Fechar busca",
2808
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
2809
- }
2810
- )
2811
- ] }),
2812
- /* @__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" })
2813
- ] }),
2814
- /* @__PURE__ */ jsxRuntime.jsx(
2815
- "div",
2816
- {
2817
- className: "flex-1 overflow-y-auto p-4 sm:p-8 bg-background scrollbar-thin",
2818
- style: { minHeight, maxHeight },
2819
- children: /* @__PURE__ */ jsxRuntime.jsx(
2820
- "div",
2821
- {
2822
- ref: editorRef,
2823
- contentEditable: isEditable,
2824
- role: "textbox",
2825
- "aria-multiline": "true",
2826
- "aria-label": placeholder || "Editor de texto",
2827
- "aria-readonly": readOnly,
2828
- "aria-disabled": disabled,
2829
- onInput: handleInput,
2830
- onSelect: isEditable ? updateActiveFormats : void 0,
2831
- onFocus: () => {
2832
- updateActiveFormats();
2833
- onFocus == null ? void 0 : onFocus();
2834
- },
2835
- onBlur,
2836
- className: "prose-editor min-h-full max-w-none focus:outline-none",
2837
- "data-placeholder": placeholder
2838
- }
2839
- )
2840
- }
2841
- ),
2842
- (showWordCount || showCharacterCount) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-4 py-2 border-t border-border bg-muted/20 flex items-center justify-between", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] sm:text-xs text-muted-foreground font-medium uppercase tracking-wider flex items-center gap-2", children: [
2843
- showWordCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2844
- wordCount,
2845
- " ",
2846
- wordCount === 1 ? "palavra" : "palavras"
2847
- ] }),
2848
- showWordCount && showCharacterCount && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: "•" }),
2849
- showCharacterCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2850
- characterCount,
2851
- " ",
2852
- characterCount === 1 ? "caractere" : "caracteres"
2853
- ] })
2854
- ] }) })
2855
- ]
2856
- }
2857
- );
2858
- }
2859
- exports.Alert = Alert;
2860
- exports.AlertDescription = AlertDescription;
2861
- exports.AlertTitle = AlertTitle;
2862
- exports.ChartCard = ChartCard;
2863
- exports.ChartContainer = ChartContainer;
2864
- exports.ChartLegend = ChartLegend;
2865
- exports.ChartLegendContent = ChartLegendContent;
2866
- exports.ChartStyle = ChartStyle;
2867
- exports.ChartTooltip = ChartTooltip;
2868
- exports.ChartTooltipContent = ChartTooltipContent;
2869
- exports.ComboMetricChart = ComboMetricChart;
2870
- exports.DashboardBarChart = DashboardBarChart;
2871
- exports.DashboardLineChart = DashboardLineChart;
2872
- exports.Dialog = Dialog;
2873
- exports.DialogBody = DialogBody;
2874
- exports.DialogClose = DialogClose;
2875
- exports.DialogContent = DialogContent;
2876
- exports.DialogDescription = DialogDescription;
2877
- exports.DialogFooter = DialogFooter;
2878
- exports.DialogHeader = DialogHeader;
2879
- exports.DialogOverlay = DialogOverlay;
2880
- exports.DialogPortal = DialogPortal;
2881
- exports.DialogTitle = DialogTitle;
2882
- exports.DialogTrigger = DialogTrigger;
2883
- exports.DonutBreakdownChart = DonutBreakdownChart;
2884
- exports.Empty = Empty;
2885
- exports.EmptyAction = EmptyAction;
2886
- exports.EmptyDescription = EmptyDescription;
2887
- exports.EmptyIcon = EmptyIcon;
2888
- exports.EmptyImage = EmptyImage;
2889
- exports.EmptyTitle = EmptyTitle;
2890
- exports.GaugeChart = GaugeChart;
2891
- exports.HorizontalBarChart = HorizontalBarChart;
2892
- exports.InteractiveTimeSeriesChart = InteractiveTimeSeriesChart;
2893
- exports.PieMetricChart = PieMetricChart;
2894
- exports.RadarMetricChart = RadarMetricChart;
2895
- exports.RadialBarMetricChart = RadialBarMetricChart;
2896
- exports.RichTextEditor = RichTextEditor;
2897
- exports.SparklineChart = SparklineChart;
2898
- exports.Table = Table;
2899
- exports.TableBody = TableBody;
2900
- exports.TableCaption = TableCaption;
2901
- exports.TableCell = TableCell;
2902
- exports.TableFooter = TableFooter;
2903
- exports.TableHead = TableHead;
2904
- exports.TableHeader = TableHeader;
2905
- exports.TableRow = TableRow;
2906
- exports.Textarea = Textarea;
2907
- exports.useChart = useChart;
2908
- exports.useRichTextEditor = useRichTextEditor;