xertica-ui 2.1.10 → 2.2.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 (1043) hide show
  1. package/CHANGELOG.md +525 -469
  2. package/README.md +382 -299
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +748 -548
  6. package/bin/generate-tokens.ts +262 -262
  7. package/bin/language-config.ts +361 -0
  8. package/components/assets/xertica-orbe-animation.ts +1162 -1162
  9. package/components/assistant/code-block/CodeBlock.tsx +268 -266
  10. package/components/assistant/code-block/code-block.stories.tsx +57 -57
  11. package/components/assistant/code-block/code-block.test.tsx +44 -44
  12. package/components/assistant/code-block/index.ts +1 -1
  13. package/components/assistant/formatted-document/FormattedDocument.tsx +147 -145
  14. package/components/assistant/formatted-document/formatted-document.stories.tsx +51 -51
  15. package/components/assistant/formatted-document/formatted-document.test.tsx +42 -42
  16. package/components/assistant/formatted-document/index.ts +1 -1
  17. package/components/assistant/index.ts +6 -6
  18. package/components/assistant/markdown-message/MarkdownMessage.tsx +152 -152
  19. package/components/assistant/markdown-message/index.ts +1 -1
  20. package/components/assistant/markdown-message/markdown-message.stories.tsx +50 -50
  21. package/components/assistant/markdown-message/markdown-message.test.tsx +33 -33
  22. package/components/assistant/modern-chat-input/ModernChatInput.tsx +36 -31
  23. package/components/assistant/modern-chat-input/index.ts +1 -1
  24. package/components/assistant/modern-chat-input/modern-chat-input.stories.tsx +131 -131
  25. package/components/assistant/modern-chat-input/modern-chat-input.test.tsx +79 -79
  26. package/components/assistant/xertica-assistant/index.ts +3 -3
  27. package/components/assistant/xertica-assistant/parts/AssistantCollapsedView.tsx +99 -97
  28. package/components/assistant/xertica-assistant/parts/AssistantConversationList.tsx +106 -104
  29. package/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.tsx +81 -79
  30. package/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.tsx +78 -74
  31. package/components/assistant/xertica-assistant/parts/AssistantHeader.tsx +75 -73
  32. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +560 -558
  33. package/components/assistant/xertica-assistant/parts/AssistantTabBar.tsx +67 -65
  34. package/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.tsx +41 -41
  35. package/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.tsx +103 -101
  36. package/components/assistant/xertica-assistant/parts/index.ts +16 -16
  37. package/components/assistant/xertica-assistant/types.ts +134 -134
  38. package/components/assistant/xertica-assistant/use-assistant.ts +615 -608
  39. package/components/assistant/xertica-assistant/xertica-assistant.stories.tsx +407 -407
  40. package/components/assistant/xertica-assistant/xertica-assistant.test.tsx +65 -65
  41. package/components/assistant/xertica-assistant/xertica-assistant.tsx +613 -609
  42. package/components/blocks/card-patterns/ActivityCard.tsx +100 -81
  43. package/components/blocks/card-patterns/ActivityCardSkeleton.tsx +56 -0
  44. package/components/blocks/card-patterns/FeatureCard.tsx +109 -109
  45. package/components/blocks/card-patterns/FeatureCardSkeleton.tsx +63 -0
  46. package/components/blocks/card-patterns/NotificationCard.tsx +140 -137
  47. package/components/blocks/card-patterns/NotificationCardSkeleton.tsx +81 -0
  48. package/components/blocks/card-patterns/ProfileCard.tsx +114 -100
  49. package/components/blocks/card-patterns/ProfileCardSkeleton.tsx +69 -0
  50. package/components/blocks/card-patterns/ProjectCard.tsx +123 -110
  51. package/components/blocks/card-patterns/ProjectCardSkeleton.tsx +72 -0
  52. package/components/blocks/card-patterns/QuickActionCard.tsx +68 -68
  53. package/components/blocks/card-patterns/QuickActionCardSkeleton.tsx +44 -0
  54. package/components/blocks/card-patterns/card-patterns.mdx +123 -0
  55. package/components/blocks/card-patterns/card-patterns.stories.tsx +594 -515
  56. package/components/blocks/card-patterns/index.ts +29 -17
  57. package/components/blocks/index.ts +1 -1
  58. package/components/brand/branding/branding.stories.tsx +57 -57
  59. package/components/brand/index.ts +6 -6
  60. package/components/brand/language-selector/LanguageSelector.tsx +47 -12
  61. package/components/brand/language-selector/index.ts +1 -1
  62. package/components/brand/language-selector/language-selector.mdx +126 -57
  63. package/components/brand/language-selector/language-selector.stories.tsx +66 -16
  64. package/components/brand/language-selector/language-selector.test.tsx +64 -8
  65. package/components/brand/theme-toggle/ThemeToggle.tsx +70 -68
  66. package/components/brand/theme-toggle/index.ts +1 -1
  67. package/components/brand/theme-toggle/theme-toggle.stories.tsx +34 -34
  68. package/components/brand/theme-toggle/theme-toggle.test.tsx +34 -34
  69. package/components/brand/xertica-logo/XerticaLogo.stories.tsx +82 -82
  70. package/components/brand/xertica-logo/XerticaLogo.tsx +104 -104
  71. package/components/brand/xertica-logo/index.ts +1 -1
  72. package/components/brand/xertica-logo/xertica-logo.test.tsx +26 -26
  73. package/components/brand/xertica-orbe/XerticaOrbe.tsx +1927 -1927
  74. package/components/brand/xertica-orbe/index.ts +1 -1
  75. package/components/brand/xertica-orbe/xertica-orbe.stories.tsx +40 -40
  76. package/components/brand/xertica-orbe/xertica-orbe.test.tsx +19 -19
  77. package/components/brand/xertica-provider/XerticaProvider.tsx +38 -2
  78. package/components/brand/xertica-provider/index.ts +1 -1
  79. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  80. package/components/brand/xertica-provider/xertica-provider.test.tsx +74 -74
  81. package/components/brand/xertica-xlogo/XerticaXLogo.stories.tsx +79 -79
  82. package/components/brand/xertica-xlogo/XerticaXLogo.tsx +65 -65
  83. package/components/brand/xertica-xlogo/index.ts +1 -1
  84. package/components/brand/xertica-xlogo/xertica-xlogo.test.tsx +16 -16
  85. package/components/examples/ApiKeyMapExample.tsx +71 -71
  86. package/components/examples/DrawingMapExample.tsx +565 -565
  87. package/components/examples/FilterableMapExample.tsx +393 -393
  88. package/components/examples/LocationPickerExample.tsx +348 -348
  89. package/components/examples/MapExamples.tsx +268 -268
  90. package/components/examples/MapGmpExample.tsx +169 -169
  91. package/components/examples/MapShowcase.tsx +471 -471
  92. package/components/examples/RouteMapExamples.tsx +329 -329
  93. package/components/examples/SidebarLogoExample.tsx +65 -65
  94. package/components/examples/SimpleFilterableMap.tsx +219 -219
  95. package/components/examples/index.ts +45 -45
  96. package/components/figma/ImageWithFallback.tsx +27 -27
  97. package/components/hooks/index.ts +13 -13
  98. package/components/hooks/use-layout-shortcuts.ts +43 -43
  99. package/components/index.ts +90 -77
  100. package/components/layout/header/header.stories.tsx +204 -204
  101. package/components/layout/header/header.test.tsx +75 -75
  102. package/components/layout/header/header.tsx +349 -349
  103. package/components/layout/header/index.ts +1 -1
  104. package/components/layout/index.ts +2 -2
  105. package/components/layout/sidebar/index.ts +3 -3
  106. package/components/layout/sidebar/sidebar.mdx +1 -1
  107. package/components/layout/sidebar/sidebar.stories.tsx +586 -586
  108. package/components/layout/sidebar/sidebar.test.tsx +76 -76
  109. package/components/layout/sidebar/sidebar.tsx +1073 -1068
  110. package/components/layout/sidebar/use-sidebar.ts +104 -104
  111. package/components/media/FloatingMediaWrapper.tsx +371 -368
  112. package/components/media/audio-player/AudioPlayer.stories.tsx +124 -124
  113. package/components/media/audio-player/AudioPlayer.test.tsx +106 -106
  114. package/components/media/audio-player/AudioPlayer.tsx +765 -762
  115. package/components/media/audio-player/index.ts +1 -1
  116. package/components/media/audio-player/use-audio-player.ts +312 -312
  117. package/components/media/index.ts +3 -3
  118. package/components/media/video-player/VideoPlayer.stories.tsx +98 -98
  119. package/components/media/video-player/VideoPlayer.test.tsx +73 -73
  120. package/components/media/video-player/VideoPlayer.tsx +310 -308
  121. package/components/media/video-player/index.ts +1 -1
  122. package/components/pages/forgot-password-page/ForgotPasswordPage.stories.tsx +24 -24
  123. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +188 -188
  124. package/components/pages/forgot-password-page/forgot-password-page.test.tsx +45 -45
  125. package/components/pages/forgot-password-page/index.ts +1 -1
  126. package/components/pages/home-content/HomeContent.stories.tsx +43 -43
  127. package/components/pages/home-content/HomeContent.tsx +120 -125
  128. package/components/pages/home-content/home-content.mdx +62 -62
  129. package/components/pages/home-content/index.ts +1 -1
  130. package/components/pages/home-page/HomePage.stories.tsx +39 -39
  131. package/components/pages/home-page/HomePage.tsx +74 -75
  132. package/components/pages/home-page/home-page.mdx +53 -53
  133. package/components/pages/home-page/home-page.test.tsx +53 -53
  134. package/components/pages/home-page/index.ts +1 -1
  135. package/components/pages/index.ts +8 -8
  136. package/components/pages/login-page/LoginPage.stories.tsx +39 -39
  137. package/components/pages/login-page/LoginPage.tsx +216 -216
  138. package/components/pages/login-page/index.ts +1 -1
  139. package/components/pages/login-page/login-page.test.tsx +63 -63
  140. package/components/pages/reset-password-page/ResetPasswordPage.stories.tsx +24 -24
  141. package/components/pages/reset-password-page/ResetPasswordPage.tsx +239 -237
  142. package/components/pages/reset-password-page/index.ts +1 -1
  143. package/components/pages/template-content/TemplateContent.stories.tsx +43 -43
  144. package/components/pages/template-content/TemplateContent.tsx +1235 -1237
  145. package/components/pages/template-content/index.ts +1 -1
  146. package/components/pages/template-content/template-content.mdx +61 -61
  147. package/components/pages/template-page/TemplatePage.stories.tsx +39 -39
  148. package/components/pages/template-page/TemplatePage.tsx +62 -62
  149. package/components/pages/template-page/index.ts +1 -1
  150. package/components/pages/template-page/template-page.mdx +53 -53
  151. package/components/pages/template-page/template-page.test.tsx +52 -52
  152. package/components/pages/verify-email-page/VerifyEmailPage.stories.tsx +41 -41
  153. package/components/pages/verify-email-page/VerifyEmailPage.tsx +206 -206
  154. package/components/pages/verify-email-page/index.ts +1 -1
  155. package/components/public-api-smoke.test.tsx +52 -52
  156. package/components/shared/CustomTooltipContent.tsx +48 -48
  157. package/components/shared/assistant-utils.test.ts +16 -16
  158. package/components/shared/assistant-utils.ts +225 -225
  159. package/components/shared/error-boundary.stories.tsx +132 -132
  160. package/components/shared/error-boundary.tsx +154 -154
  161. package/components/shared/error-fallbacks.tsx +226 -226
  162. package/components/shared/layout-constants.ts +8 -8
  163. package/components/shared/navigation.ts +35 -35
  164. package/components/shared/use-mobile.test.ts +16 -16
  165. package/components/shared/use-mobile.ts +36 -36
  166. package/components/shared/utils.test.ts +14 -14
  167. package/components/shared/utils.ts +6 -6
  168. package/components/ui/accordion/accordion.mdx +8 -8
  169. package/components/ui/accordion/accordion.stories.tsx +105 -105
  170. package/components/ui/accordion/accordion.test.tsx +59 -59
  171. package/components/ui/accordion/accordion.tsx +77 -77
  172. package/components/ui/accordion/index.ts +1 -1
  173. package/components/ui/alert/alert.mdx +8 -8
  174. package/components/ui/alert/alert.stories.tsx +86 -86
  175. package/components/ui/alert/alert.test.tsx +53 -53
  176. package/components/ui/alert/alert.tsx +93 -93
  177. package/components/ui/alert/index.ts +1 -1
  178. package/components/ui/alert-dialog/alert-dialog.mdx +8 -8
  179. package/components/ui/alert-dialog/alert-dialog.stories.tsx +84 -84
  180. package/components/ui/alert-dialog/alert-dialog.test.tsx +70 -70
  181. package/components/ui/alert-dialog/alert-dialog.tsx +149 -149
  182. package/components/ui/alert-dialog/index.ts +1 -1
  183. package/components/ui/aspect-ratio/aspect-ratio.mdx +8 -8
  184. package/components/ui/aspect-ratio/aspect-ratio.stories.tsx +46 -46
  185. package/components/ui/aspect-ratio/aspect-ratio.test.tsx +28 -28
  186. package/components/ui/aspect-ratio/aspect-ratio.tsx +20 -20
  187. package/components/ui/aspect-ratio/index.ts +1 -1
  188. package/components/ui/assistant-chart/AssistantChart.tsx +64 -64
  189. package/components/ui/assistant-chart/assistant-chart.mdx +8 -8
  190. package/components/ui/assistant-chart/assistant-chart.stories.tsx +44 -44
  191. package/components/ui/assistant-chart/assistant-chart.test.tsx +46 -46
  192. package/components/ui/assistant-chart/index.ts +1 -1
  193. package/components/ui/avatar/avatar.mdx +8 -8
  194. package/components/ui/avatar/avatar.stories.tsx +86 -86
  195. package/components/ui/avatar/avatar.test.tsx +55 -55
  196. package/components/ui/avatar/avatar.tsx +71 -71
  197. package/components/ui/avatar/index.ts +1 -1
  198. package/components/ui/badge/badge.mdx +8 -8
  199. package/components/ui/badge/badge.stories.tsx +72 -72
  200. package/components/ui/badge/badge.test.tsx +40 -40
  201. package/components/ui/badge/badge.tsx +58 -58
  202. package/components/ui/badge/index.ts +1 -1
  203. package/components/ui/breadcrumb/breadcrumb.mdx +8 -8
  204. package/components/ui/breadcrumb/breadcrumb.stories.tsx +123 -123
  205. package/components/ui/breadcrumb/breadcrumb.test.tsx +70 -70
  206. package/components/ui/breadcrumb/breadcrumb.tsx +114 -114
  207. package/components/ui/breadcrumb/index.ts +1 -1
  208. package/components/ui/button/button.mdx +8 -8
  209. package/components/ui/button/button.stories.tsx +183 -183
  210. package/components/ui/button/button.test.tsx +64 -64
  211. package/components/ui/button/button.tsx +98 -98
  212. package/components/ui/button/index.ts +1 -1
  213. package/components/ui/calendar/calendar.mdx +8 -8
  214. package/components/ui/calendar/calendar.stories.tsx +108 -108
  215. package/components/ui/calendar/calendar.test.tsx +53 -53
  216. package/components/ui/calendar/calendar.tsx +230 -230
  217. package/components/ui/calendar/index.ts +1 -1
  218. package/components/ui/card/card.mdx +8 -8
  219. package/components/ui/card/card.stories.tsx +301 -301
  220. package/components/ui/card/card.test.tsx +55 -55
  221. package/components/ui/card/card.tsx +83 -83
  222. package/components/ui/card/index.ts +1 -1
  223. package/components/ui/carousel/carousel.mdx +8 -8
  224. package/components/ui/carousel/carousel.stories.tsx +80 -80
  225. package/components/ui/carousel/carousel.test.tsx +75 -75
  226. package/components/ui/carousel/carousel.tsx +242 -242
  227. package/components/ui/carousel/index.ts +1 -1
  228. package/components/ui/chart/chart.mdx +8 -8
  229. package/components/ui/chart/chart.stories.tsx +1328 -1328
  230. package/components/ui/chart/chart.test.tsx +178 -178
  231. package/components/ui/chart/chart.tsx +2232 -2232
  232. package/components/ui/chart/index.ts +1 -1
  233. package/components/ui/checkbox/checkbox.mdx +8 -8
  234. package/components/ui/checkbox/checkbox.stories.tsx +109 -109
  235. package/components/ui/checkbox/checkbox.test.tsx +49 -49
  236. package/components/ui/checkbox/checkbox.tsx +68 -68
  237. package/components/ui/checkbox/index.ts +1 -1
  238. package/components/ui/collapsible/collapsible.mdx +8 -8
  239. package/components/ui/collapsible/collapsible.stories.tsx +45 -45
  240. package/components/ui/collapsible/collapsible.test.tsx +51 -51
  241. package/components/ui/collapsible/collapsible.tsx +32 -32
  242. package/components/ui/collapsible/index.ts +1 -1
  243. package/components/ui/command/command.mdx +8 -8
  244. package/components/ui/command/command.stories.tsx +134 -134
  245. package/components/ui/command/command.test.tsx +48 -48
  246. package/components/ui/command/command.tsx +163 -163
  247. package/components/ui/command/index.ts +1 -1
  248. package/components/ui/context-menu/context-menu.mdx +8 -8
  249. package/components/ui/context-menu/context-menu.stories.tsx +76 -76
  250. package/components/ui/context-menu/context-menu.test.tsx +61 -61
  251. package/components/ui/context-menu/context-menu.tsx +236 -236
  252. package/components/ui/context-menu/index.ts +1 -1
  253. package/components/ui/dialog/dialog.mdx +8 -8
  254. package/components/ui/dialog/dialog.stories.tsx +174 -174
  255. package/components/ui/dialog/dialog.test.tsx +78 -78
  256. package/components/ui/dialog/dialog.tsx +189 -189
  257. package/components/ui/dialog/index.ts +1 -1
  258. package/components/ui/drawer/drawer.mdx +8 -8
  259. package/components/ui/drawer/drawer.stories.tsx +71 -71
  260. package/components/ui/drawer/drawer.test.tsx +67 -67
  261. package/components/ui/drawer/drawer.tsx +146 -146
  262. package/components/ui/drawer/index.ts +1 -1
  263. package/components/ui/dropdown-menu/dropdown-menu.mdx +8 -8
  264. package/components/ui/dropdown-menu/dropdown-menu.stories.tsx +156 -156
  265. package/components/ui/dropdown-menu/dropdown-menu.test.tsx +62 -62
  266. package/components/ui/dropdown-menu/dropdown-menu.tsx +240 -240
  267. package/components/ui/dropdown-menu/index.ts +1 -1
  268. package/components/ui/empty/empty.mdx +8 -8
  269. package/components/ui/empty/empty.stories.tsx +85 -85
  270. package/components/ui/empty/empty.test.tsx +31 -31
  271. package/components/ui/empty/empty.tsx +88 -88
  272. package/components/ui/empty/index.ts +1 -1
  273. package/components/ui/file-upload/file-upload.mdx +8 -8
  274. package/components/ui/file-upload/file-upload.stories.tsx +144 -144
  275. package/components/ui/file-upload/file-upload.test.tsx +65 -65
  276. package/components/ui/file-upload/file-upload.tsx +142 -142
  277. package/components/ui/file-upload/index.ts +2 -2
  278. package/components/ui/file-upload/use-file-upload.ts +177 -177
  279. package/components/ui/form/form.stories.tsx +85 -85
  280. package/components/ui/form/form.test.tsx +75 -75
  281. package/components/ui/form/form.tsx +163 -163
  282. package/components/ui/form/index.ts +1 -1
  283. package/components/ui/google-maps-loader/google-maps-loader.test.tsx +35 -35
  284. package/components/ui/google-maps-loader/google-maps-loader.tsx +465 -465
  285. package/components/ui/google-maps-loader/index.ts +1 -1
  286. package/components/ui/hover-card/hover-card.mdx +8 -8
  287. package/components/ui/hover-card/hover-card.stories.tsx +61 -61
  288. package/components/ui/hover-card/hover-card.test.tsx +48 -48
  289. package/components/ui/hover-card/hover-card.tsx +50 -50
  290. package/components/ui/hover-card/index.ts +1 -1
  291. package/components/ui/index.ts +400 -400
  292. package/components/ui/input/index.ts +1 -1
  293. package/components/ui/input/input.mdx +8 -8
  294. package/components/ui/input/input.stories.tsx +153 -153
  295. package/components/ui/input/input.test.tsx +47 -47
  296. package/components/ui/input/input.tsx +57 -57
  297. package/components/ui/input-otp/index.ts +1 -1
  298. package/components/ui/input-otp/input-otp.mdx +8 -8
  299. package/components/ui/input-otp/input-otp.stories.tsx +120 -120
  300. package/components/ui/input-otp/input-otp.test.tsx +74 -74
  301. package/components/ui/input-otp/input-otp.tsx +101 -101
  302. package/components/ui/label/index.ts +1 -1
  303. package/components/ui/label/label.mdx +8 -8
  304. package/components/ui/label/label.stories.tsx +74 -74
  305. package/components/ui/label/label.test.tsx +45 -45
  306. package/components/ui/label/label.tsx +53 -53
  307. package/components/ui/map/index.ts +1 -1
  308. package/components/ui/map/map.mdx +8 -8
  309. package/components/ui/map/map.stories.tsx +86 -86
  310. package/components/ui/map/map.test.tsx +82 -82
  311. package/components/ui/map/map.tsx +506 -506
  312. package/components/ui/map/mock.test.tsx +13 -13
  313. package/components/ui/map-config/index.ts +1 -1
  314. package/components/ui/map-config/map-config.ts +18 -18
  315. package/components/ui/map-layers/index.ts +1 -1
  316. package/components/ui/map-layers/map-layers.test.tsx +48 -48
  317. package/components/ui/map-layers/map-layers.tsx +126 -126
  318. package/components/ui/map.exports/index.ts +1 -1
  319. package/components/ui/map.exports/map.exports.ts +31 -31
  320. package/components/ui/menubar/index.ts +1 -1
  321. package/components/ui/menubar/menubar.mdx +8 -8
  322. package/components/ui/menubar/menubar.stories.tsx +130 -130
  323. package/components/ui/menubar/menubar.test.tsx +53 -53
  324. package/components/ui/menubar/menubar.tsx +265 -265
  325. package/components/ui/navigation-menu/index.ts +1 -1
  326. package/components/ui/navigation-menu/navigation-menu.mdx +8 -8
  327. package/components/ui/navigation-menu/navigation-menu.stories.tsx +126 -126
  328. package/components/ui/navigation-menu/navigation-menu.test.tsx +47 -47
  329. package/components/ui/navigation-menu/navigation-menu.tsx +165 -165
  330. package/components/ui/notification-badge/index.ts +1 -1
  331. package/components/ui/notification-badge/notification-badge.mdx +8 -8
  332. package/components/ui/notification-badge/notification-badge.stories.tsx +66 -66
  333. package/components/ui/notification-badge/notification-badge.test.tsx +61 -61
  334. package/components/ui/notification-badge/notification-badge.tsx +91 -91
  335. package/components/ui/page-header/index.ts +1 -1
  336. package/components/ui/page-header/page-header.stories.tsx +69 -69
  337. package/components/ui/page-header/page-header.test.tsx +37 -37
  338. package/components/ui/page-header/page-header.tsx +124 -124
  339. package/components/ui/pagination/index.ts +3 -3
  340. package/components/ui/pagination/pagination.mdx +8 -8
  341. package/components/ui/pagination/pagination.stories.tsx +210 -210
  342. package/components/ui/pagination/pagination.test.tsx +63 -63
  343. package/components/ui/pagination/pagination.tsx +140 -140
  344. package/components/ui/pagination/use-pagination.ts +173 -173
  345. package/components/ui/popover/index.ts +1 -1
  346. package/components/ui/popover/popover.mdx +8 -8
  347. package/components/ui/popover/popover.stories.tsx +73 -73
  348. package/components/ui/popover/popover.test.tsx +48 -48
  349. package/components/ui/popover/popover.tsx +54 -54
  350. package/components/ui/progress/index.ts +1 -1
  351. package/components/ui/progress/progress.mdx +8 -8
  352. package/components/ui/progress/progress.stories.tsx +55 -55
  353. package/components/ui/progress/progress.test.tsx +23 -23
  354. package/components/ui/progress/progress.tsx +68 -68
  355. package/components/ui/radio-group/index.ts +1 -1
  356. package/components/ui/radio-group/radio-group.mdx +8 -8
  357. package/components/ui/radio-group/radio-group.stories.tsx +114 -114
  358. package/components/ui/radio-group/radio-group.test.tsx +78 -78
  359. package/components/ui/radio-group/radio-group.tsx +93 -93
  360. package/components/ui/rating/index.ts +1 -1
  361. package/components/ui/rating/rating.mdx +8 -8
  362. package/components/ui/rating/rating.stories.tsx +50 -50
  363. package/components/ui/rating/rating.test.tsx +48 -48
  364. package/components/ui/rating/rating.tsx +145 -145
  365. package/components/ui/resizable/index.ts +1 -1
  366. package/components/ui/resizable/resizable.mdx +8 -8
  367. package/components/ui/resizable/resizable.stories.tsx +88 -88
  368. package/components/ui/resizable/resizable.test.tsx +61 -61
  369. package/components/ui/resizable/resizable.tsx +452 -452
  370. package/components/ui/rich-text-editor/index.ts +7 -7
  371. package/components/ui/rich-text-editor/rich-text-editor.stories.tsx +290 -290
  372. package/components/ui/rich-text-editor/rich-text-editor.test.tsx +86 -86
  373. package/components/ui/rich-text-editor/rich-text-editor.tsx +634 -634
  374. package/components/ui/rich-text-editor/use-rich-text-editor.ts +453 -453
  375. package/components/ui/route-map/index.ts +1 -1
  376. package/components/ui/route-map/route-map.mdx +8 -8
  377. package/components/ui/route-map/route-map.stories.tsx +48 -48
  378. package/components/ui/route-map/route-map.test.tsx +108 -108
  379. package/components/ui/route-map/route-map.tsx +349 -349
  380. package/components/ui/scroll-area/index.ts +1 -1
  381. package/components/ui/scroll-area/scroll-area.mdx +8 -8
  382. package/components/ui/scroll-area/scroll-area.stories.tsx +31 -31
  383. package/components/ui/scroll-area/scroll-area.test.tsx +27 -27
  384. package/components/ui/scroll-area/scroll-area.tsx +70 -70
  385. package/components/ui/search/index.ts +1 -1
  386. package/components/ui/search/search.mdx +8 -8
  387. package/components/ui/search/search.stories.tsx +107 -107
  388. package/components/ui/search/search.test.tsx +67 -67
  389. package/components/ui/search/search.tsx +141 -141
  390. package/components/ui/select/index.ts +1 -1
  391. package/components/ui/select/select.mdx +8 -8
  392. package/components/ui/select/select.stories.tsx +163 -163
  393. package/components/ui/select/select.test.tsx +99 -99
  394. package/components/ui/select/select.tsx +195 -195
  395. package/components/ui/separator/index.ts +1 -1
  396. package/components/ui/separator/separator.mdx +8 -8
  397. package/components/ui/separator/separator.stories.tsx +55 -55
  398. package/components/ui/separator/separator.test.tsx +23 -23
  399. package/components/ui/separator/separator.tsx +39 -39
  400. package/components/ui/sheet/index.ts +1 -1
  401. package/components/ui/sheet/sheet.mdx +8 -8
  402. package/components/ui/sheet/sheet.stories.tsx +93 -93
  403. package/components/ui/sheet/sheet.test.tsx +62 -62
  404. package/components/ui/sheet/sheet.tsx +149 -149
  405. package/components/ui/simple-map/index.ts +1 -1
  406. package/components/ui/simple-map/simple-map.mdx +8 -8
  407. package/components/ui/simple-map/simple-map.stories.tsx +44 -44
  408. package/components/ui/simple-map/simple-map.test.tsx +36 -36
  409. package/components/ui/simple-map/simple-map.tsx +92 -92
  410. package/components/ui/skeleton/index.ts +1 -1
  411. package/components/ui/skeleton/skeleton.mdx +8 -8
  412. package/components/ui/skeleton/skeleton.stories.tsx +36 -36
  413. package/components/ui/skeleton/skeleton.test.tsx +19 -19
  414. package/components/ui/skeleton/skeleton.tsx +25 -25
  415. package/components/ui/slider/index.ts +1 -1
  416. package/components/ui/slider/slider.mdx +8 -8
  417. package/components/ui/slider/slider.stories.tsx +44 -44
  418. package/components/ui/slider/slider.test.tsx +25 -25
  419. package/components/ui/slider/slider.tsx +66 -66
  420. package/components/ui/sonner/index.ts +1 -1
  421. package/components/ui/sonner/sonner.mdx +8 -8
  422. package/components/ui/sonner/sonner.stories.tsx +41 -41
  423. package/components/ui/sonner/sonner.test.tsx +24 -24
  424. package/components/ui/sonner/sonner.tsx +74 -74
  425. package/components/ui/stats-card/index.ts +2 -1
  426. package/components/ui/stats-card/stats-card-skeleton.tsx +62 -0
  427. package/components/ui/stats-card/stats-card.mdx +8 -8
  428. package/components/ui/stats-card/stats-card.stories.tsx +99 -77
  429. package/components/ui/stats-card/stats-card.test.tsx +34 -34
  430. package/components/ui/stats-card/stats-card.tsx +93 -93
  431. package/components/ui/stepper/index.ts +3 -3
  432. package/components/ui/stepper/stepper.mdx +8 -8
  433. package/components/ui/stepper/stepper.stories.tsx +171 -171
  434. package/components/ui/stepper/stepper.test.tsx +47 -47
  435. package/components/ui/stepper/stepper.tsx +190 -190
  436. package/components/ui/stepper/use-stepper.ts +139 -139
  437. package/components/ui/switch/index.ts +1 -1
  438. package/components/ui/switch/switch.mdx +8 -8
  439. package/components/ui/switch/switch.stories.tsx +93 -93
  440. package/components/ui/switch/switch.test.tsx +44 -44
  441. package/components/ui/switch/switch.tsx +70 -70
  442. package/components/ui/table/index.ts +1 -1
  443. package/components/ui/table/table.mdx +8 -8
  444. package/components/ui/table/table.stories.tsx +114 -114
  445. package/components/ui/table/table.test.tsx +43 -43
  446. package/components/ui/table/table.tsx +104 -104
  447. package/components/ui/tabs/index.ts +1 -1
  448. package/components/ui/tabs/tabs.mdx +8 -8
  449. package/components/ui/tabs/tabs.stories.tsx +140 -140
  450. package/components/ui/tabs/tabs.test.tsx +50 -50
  451. package/components/ui/tabs/tabs.tsx +66 -66
  452. package/components/ui/textarea/index.ts +1 -1
  453. package/components/ui/textarea/textarea.mdx +8 -8
  454. package/components/ui/textarea/textarea.stories.tsx +69 -69
  455. package/components/ui/textarea/textarea.test.tsx +41 -41
  456. package/components/ui/textarea/textarea.tsx +61 -61
  457. package/components/ui/timeline/index.ts +1 -1
  458. package/components/ui/timeline/timeline.mdx +8 -8
  459. package/components/ui/timeline/timeline.stories.tsx +97 -97
  460. package/components/ui/timeline/timeline.test.tsx +53 -53
  461. package/components/ui/timeline/timeline.tsx +124 -124
  462. package/components/ui/toggle/index.ts +1 -1
  463. package/components/ui/toggle/toggle.mdx +8 -8
  464. package/components/ui/toggle/toggle.stories.tsx +56 -56
  465. package/components/ui/toggle/toggle.test.tsx +32 -32
  466. package/components/ui/toggle/toggle.tsx +55 -55
  467. package/components/ui/toggle-group/index.ts +1 -1
  468. package/components/ui/toggle-group/toggle-group.mdx +8 -8
  469. package/components/ui/toggle-group/toggle-group.stories.tsx +66 -66
  470. package/components/ui/toggle-group/toggle-group.test.tsx +47 -47
  471. package/components/ui/toggle-group/toggle-group.tsx +79 -79
  472. package/components/ui/tooltip/index.ts +1 -1
  473. package/components/ui/tooltip/tooltip.mdx +8 -8
  474. package/components/ui/tooltip/tooltip.stories.tsx +83 -83
  475. package/components/ui/tooltip/tooltip.test.tsx +39 -39
  476. package/components/ui/tooltip/tooltip.tsx +69 -69
  477. package/components/ui/tree-view/index.ts +4 -4
  478. package/components/ui/tree-view/tree-view.mdx +8 -8
  479. package/components/ui/tree-view/tree-view.stories.tsx +154 -154
  480. package/components/ui/tree-view/tree-view.test.tsx +58 -58
  481. package/components/ui/tree-view/tree-view.tsx +171 -171
  482. package/components/ui/tree-view/use-tree-view.ts +237 -237
  483. package/components.json +892 -892
  484. package/contexts/ApiKeyContext.test.tsx +26 -26
  485. package/contexts/ApiKeyContext.tsx +196 -196
  486. package/contexts/AssistenteContext.test.tsx +17 -17
  487. package/contexts/AssistenteContext.tsx +113 -113
  488. package/contexts/AuthContext.tsx +118 -118
  489. package/contexts/BrandColorsContext.test.tsx +21 -21
  490. package/contexts/BrandColorsContext.tsx +251 -251
  491. package/contexts/LanguageContext.test.tsx +108 -16
  492. package/contexts/LanguageContext.tsx +202 -17
  493. package/contexts/LayoutContext.test.tsx +29 -29
  494. package/contexts/LayoutContext.tsx +140 -140
  495. package/contexts/ThemeContext.test.tsx +38 -38
  496. package/contexts/ThemeContext.tsx +111 -111
  497. package/contexts/index.ts +8 -8
  498. package/contexts/theme-data.ts +340 -340
  499. package/dist/{AssistantChart-DoZCyS5r.cjs → AssistantChart-9w31gdAb.cjs} +4 -4
  500. package/dist/{AssistantChart-CldVCVDe.cjs → AssistantChart-BAudAfne.cjs} +5 -5
  501. package/dist/{AssistantChart-Bdd44uBn.cjs → AssistantChart-BAx9VQvb.cjs} +127 -388
  502. package/dist/{AssistantChart-Cu3m7RBo.js → AssistantChart-BP8upjMk.js} +5 -5
  503. package/dist/{use-mobile-BXuYROXM.js → AssistantChart-BXU1ACnh.js} +958 -1671
  504. package/dist/{AssistantChart-CFhDdGyU.js → AssistantChart-CVko2A1W.js} +130 -391
  505. package/dist/{AssistantChart-C_hwFRRr.js → AssistantChart-CVzmmhx4.js} +4 -4
  506. package/dist/{use-mobile-CG2-SdXV.cjs → AssistantChart-D0A1FPYt.cjs} +980 -1700
  507. package/dist/{AudioPlayer-IAU5q5T1.cjs → AudioPlayer-1ypwE2Wh.cjs} +1 -1
  508. package/dist/AudioPlayer-BWDW6TN9.cjs +1279 -0
  509. package/dist/AudioPlayer-CM962GEh.js +1280 -0
  510. package/dist/{AudioPlayer-CySJIyvL.js → AudioPlayer-DuKXrCfy.js} +1 -1
  511. package/dist/CodeBlock-CV6dtsTM.cjs +220 -0
  512. package/dist/CodeBlock-CjeFavqV.js +221 -0
  513. package/dist/{FeatureCard-DbHWCb4E.js → FeatureCard-Cfs6Ishq.js} +221 -37
  514. package/dist/FeatureCard-ie3L8Fpr.cjs +484 -0
  515. package/dist/FeatureCardSkeleton-CAgu8stE.js +27 -0
  516. package/dist/FeatureCardSkeleton-mO3Bdm_V.cjs +26 -0
  517. package/dist/{LanguageContext-CS14yCpi.js → LanguageContext-BwhwC3G2.js} +2 -2
  518. package/dist/{LanguageContext-B_KFTCzT.cjs → LanguageContext-DvUt5jBg.cjs} +2 -2
  519. package/dist/{ThemeContext-C2EwAPDt.js → ThemeContext-BbBNoFTG.js} +2 -2
  520. package/dist/ThemeContext-BblcjQup.cjs +1855 -0
  521. package/dist/ThemeContext-Bo-W2WZH.js +1856 -0
  522. package/dist/ThemeContext-CP3a0jxy.cjs +1855 -0
  523. package/dist/{ThemeContext-vTjumZeM.cjs → ThemeContext-Cmr8Ex8H.cjs} +2 -2
  524. package/dist/ThemeContext-CpqYShLq.cjs +324 -0
  525. package/dist/{ThemeContext-CQSo4Iwc.js → ThemeContext-D3LzacmG.js} +8 -1
  526. package/dist/ThemeContext-Du2nE1PL.js +325 -0
  527. package/dist/ThemeContext-GeEBTJ3q.cjs +1621 -0
  528. package/dist/ThemeContext-JyLK9B1o.js +1622 -0
  529. package/dist/{ThemeContext-CGk3KK0k.cjs → ThemeContext-U4dEYc6C.cjs} +8 -1
  530. package/dist/ThemeContext-ept8jhXI.js +1856 -0
  531. package/dist/{VerifyEmailPage-C0c2e5n0.js → VerifyEmailPage-BE-L9mB7.js} +7 -7
  532. package/dist/VerifyEmailPage-BIBOKV7Z.js +3214 -0
  533. package/dist/{VerifyEmailPage--1Vurewl.cjs → VerifyEmailPage-BRSP-Pwt.cjs} +3 -3
  534. package/dist/{VerifyEmailPage-Cwi3kbol.cjs → VerifyEmailPage-Bae2cBXT.cjs} +7 -7
  535. package/dist/{VerifyEmailPage-DjQKRlUS.cjs → VerifyEmailPage-BiRm7Nh4.cjs} +1185 -796
  536. package/dist/VerifyEmailPage-Bvfv8HVQ.js +3214 -0
  537. package/dist/{VerifyEmailPage-BComraR7.cjs → VerifyEmailPage-CR7kb5df.cjs} +22 -12
  538. package/dist/{VerifyEmailPage-MTD7AG1Z.js → VerifyEmailPage-C_ihbcth.js} +4 -4
  539. package/dist/{VerifyEmailPage-1WwWczAn.js → VerifyEmailPage-CbgjOF0v.js} +22 -12
  540. package/dist/{VerifyEmailPage-DvMLZgFt.js → VerifyEmailPage-CdYPSJoO.js} +1 -1
  541. package/dist/VerifyEmailPage-D-FRj5TU.cjs +3213 -0
  542. package/dist/{VerifyEmailPage-s-1X3LDJ.cjs → VerifyEmailPage-DF2ilhum.cjs} +1049 -665
  543. package/dist/{VerifyEmailPage-CYXtbKi3.cjs → VerifyEmailPage-DMBh4NM9.cjs} +1 -1
  544. package/dist/{VerifyEmailPage-CgMxRb4z.js → VerifyEmailPage-DTtFfC-J.js} +3 -3
  545. package/dist/{VerifyEmailPage-CFLMls1p.cjs → VerifyEmailPage-Dt7zgA4w.cjs} +4 -4
  546. package/dist/VerifyEmailPage-EhudUdqF.js +3211 -0
  547. package/dist/VerifyEmailPage-hdB8JQGv.cjs +3213 -0
  548. package/dist/VerifyEmailPage-vYHbYK3q.js +3214 -0
  549. package/dist/XerticaProvider-AChwphCO.cjs +48 -0
  550. package/dist/XerticaProvider-AbWlr7Af.cjs +48 -0
  551. package/dist/{XerticaProvider-D-yNhF94.cjs → XerticaProvider-B8CaV7xu.cjs} +1 -1
  552. package/dist/{XerticaProvider-CEoWMTxu.js → XerticaProvider-BITjgC5p.js} +2 -2
  553. package/dist/{XerticaProvider-CllrbMEJ.cjs → XerticaProvider-By8q3Roe.cjs} +2 -2
  554. package/dist/XerticaProvider-CUYJZc32.js +49 -0
  555. package/dist/{XerticaProvider-ET0ihewn.cjs → XerticaProvider-CW9hpCdF.cjs} +2 -2
  556. package/dist/XerticaProvider-CWgby5mY.js +49 -0
  557. package/dist/XerticaProvider-CWs6EwNa.js +49 -0
  558. package/dist/XerticaProvider-CjQAQPcn.cjs +48 -0
  559. package/dist/XerticaProvider-D5lLumH-.js +49 -0
  560. package/dist/{XerticaProvider-DYq4JWtg.js → XerticaProvider-DQtvJU7m.js} +1 -1
  561. package/dist/XerticaProvider-qQUDop71.cjs +48 -0
  562. package/dist/{XerticaProvider-B7EVH-NF.js → XerticaProvider-siSt9uG2.js} +2 -2
  563. package/dist/{LanguageSelector-D6uacAIM.cjs → XerticaXLogo-8TTzBjHw.cjs} +136 -115
  564. package/dist/{LanguageSelector-B5YfbHra.js → XerticaXLogo-BWaag64t.js} +136 -115
  565. package/dist/XerticaXLogo-CFuIlYFH.js +252 -0
  566. package/dist/XerticaXLogo-CU-U-GP4.cjs +251 -0
  567. package/dist/XerticaXLogo-ChryA6xj.js +252 -0
  568. package/dist/{XerticaXLogo-CQUUjXoH.cjs → XerticaXLogo-CziKMQil.cjs} +8 -8
  569. package/dist/XerticaXLogo-DHz5SugF.js +252 -0
  570. package/dist/XerticaXLogo-DTee_y8X.cjs +251 -0
  571. package/dist/{XerticaXLogo-Cmsp-Eey.js → XerticaXLogo-DfUvz-lD.js} +9 -9
  572. package/dist/XerticaXLogo-kslQ8Tk_.cjs +251 -0
  573. package/dist/{alert-dialog-s-vmNkJ_.js → alert-dialog-iDe5VE5o.js} +3 -3
  574. package/dist/{alert-dialog-DSKByiKZ.cjs → alert-dialog-yckpaOpy.cjs} +3 -3
  575. package/dist/assistant.cjs.js +2 -2
  576. package/dist/assistant.es.js +2 -2
  577. package/dist/blocks.cjs.js +8 -1
  578. package/dist/blocks.es.js +10 -3
  579. package/dist/brand.cjs.js +2 -2
  580. package/dist/brand.es.js +2 -2
  581. package/dist/cli.js +524 -164
  582. package/dist/components/blocks/card-patterns/ActivityCardSkeleton.d.ts +19 -0
  583. package/dist/components/blocks/card-patterns/FeatureCardSkeleton.d.ts +18 -0
  584. package/dist/components/blocks/card-patterns/NotificationCardSkeleton.d.ts +21 -0
  585. package/dist/components/blocks/card-patterns/ProfileCardSkeleton.d.ts +20 -0
  586. package/dist/components/blocks/card-patterns/ProjectCardSkeleton.d.ts +18 -0
  587. package/dist/components/blocks/card-patterns/QuickActionCardSkeleton.d.ts +16 -0
  588. package/dist/components/blocks/card-patterns/index.d.ts +12 -0
  589. package/dist/components/brand/language-selector/LanguageSelector.d.ts +15 -1
  590. package/dist/components/brand/xertica-provider/XerticaProvider.d.ts +29 -1
  591. package/dist/components/index.d.ts +3 -0
  592. package/dist/components/ui/stats-card/index.d.ts +1 -0
  593. package/dist/components/ui/stats-card/stats-card-skeleton.d.ts +25 -0
  594. package/dist/contexts/LanguageContext.d.ts +66 -5
  595. package/dist/features/assistant/data/mock.d.ts +2 -2
  596. package/dist/features/assistant/hooks/useAssistantConfig.d.ts +0 -1
  597. package/dist/features/assistant/index.d.ts +1 -1
  598. package/dist/features/home/hooks/useDashboardStats.d.ts +0 -1
  599. package/dist/features/home/hooks/useFeatureCards.d.ts +0 -1
  600. package/dist/features/home/hooks/useTeamMembers.d.ts +0 -1
  601. package/dist/features/home/index.d.ts +3 -3
  602. package/dist/{google-maps-loader-Y-QkD-Li.cjs → google-maps-loader-BqsYL48U.cjs} +0 -5
  603. package/dist/{google-maps-loader-CTYySAun.js → google-maps-loader-t2IlYBzw.js} +0 -4
  604. package/dist/hooks.cjs.js +2 -1
  605. package/dist/hooks.es.js +2 -1
  606. package/dist/i18n.d.ts +13 -0
  607. package/dist/index-CkTUgOwX.js +8 -0
  608. package/dist/{index-COtD8bRW.cjs → index-D3RLKRAs.cjs} +1 -1
  609. package/dist/index.cjs.js +34 -19
  610. package/dist/index.es.js +71 -56
  611. package/dist/index.umd.js +454 -1027
  612. package/dist/layout.cjs.js +1 -1
  613. package/dist/layout.es.js +1 -1
  614. package/dist/media.cjs.js +1 -1
  615. package/dist/media.es.js +1 -1
  616. package/dist/pages.cjs.js +1 -1
  617. package/dist/pages.es.js +1 -1
  618. package/dist/{rich-text-editor-Bp3zQqMC.js → rich-text-editor-1UW3Y2JK.js} +989 -1052
  619. package/dist/{rich-text-editor-CeucBdIv.cjs → rich-text-editor-CyggTOLQ.cjs} +989 -1052
  620. package/dist/{sidebar-DQj1z3jG.cjs → sidebar-B3EYhli0.cjs} +269 -227
  621. package/dist/{sidebar-CK_0ZQHj.cjs → sidebar-B9NR0lCe.cjs} +271 -274
  622. package/dist/sidebar-BvF5I2Ue.cjs +800 -0
  623. package/dist/{sidebar-q7P2Godd.cjs → sidebar-C5B_LHek.cjs} +1 -1
  624. package/dist/{sidebar-LluMXfam.js → sidebar-CA6_ek3f.js} +269 -227
  625. package/dist/{sidebar-BxGXsDAd.cjs → sidebar-CVUGHOS_.cjs} +8 -16
  626. package/dist/{sidebar-BViy8Eeu.js → sidebar-CmvwjnVb.js} +9 -17
  627. package/dist/{sidebar-CUuOvYhK.js → sidebar-CplprZpM.js} +272 -258
  628. package/dist/{sidebar-BbVIQvlP.js → sidebar-Dz7bd3zP.js} +1 -1
  629. package/dist/sidebar-KIS0C2JH.js +801 -0
  630. package/dist/sidebar-OTO_up7Z.js +801 -0
  631. package/dist/sidebar-zowjejT2.cjs +800 -0
  632. package/dist/skeleton-4zoHiFJ_.cjs +83 -0
  633. package/dist/skeleton-C4bHqUBf.js +84 -0
  634. package/dist/ui.cjs.js +12 -11
  635. package/dist/ui.es.js +46 -45
  636. package/dist/{use-audio-player-nv8ZSGa1.js → use-audio-player-Bkh23vQ3.js} +3 -7
  637. package/dist/{use-audio-player-NKsWyjWu.cjs → use-audio-player-Dn1NR9xN.cjs} +3 -7
  638. package/dist/{xertica-assistant-dyP7KHM5.cjs → xertica-assistant-B1IaHXnB.cjs} +388 -529
  639. package/dist/{xertica-assistant-ciJaWqm1.js → xertica-assistant-BMqdyRVi.js} +10 -28
  640. package/dist/{xertica-assistant-BdiZag0h.js → xertica-assistant-BbgzsgsG.js} +539 -562
  641. package/dist/{xertica-assistant-V_IdW4WF.cjs → xertica-assistant-Bj3vBCq_.cjs} +9 -27
  642. package/dist/{xertica-assistant-yX1CFBBo.js → xertica-assistant-DPsESB6t.js} +390 -531
  643. package/dist/{CodeBlock-7TTgmdGG.cjs → xertica-assistant-Qp3ydksa.cjs} +51 -263
  644. package/dist/{xertica-assistant-DUBpmEgo.cjs → xertica-assistant-d2qs2Vd9.cjs} +538 -561
  645. package/dist/{CodeBlock-DnYNI8rQ.js → xertica-assistant-gnCJdcZY.js} +7 -219
  646. package/dist/xertica-ui.css +2 -2
  647. package/docs/ai-usage.md +195 -195
  648. package/docs/architecture-improvements.md +456 -476
  649. package/docs/architecture.md +306 -273
  650. package/docs/components/accordion.md +109 -109
  651. package/docs/components/alert-dialog.md +127 -127
  652. package/docs/components/alert.md +106 -106
  653. package/docs/components/aspect-ratio.md +58 -58
  654. package/docs/components/assistant-chart.md +47 -47
  655. package/docs/components/assistant.md +426 -426
  656. package/docs/components/audio-player.md +167 -167
  657. package/docs/components/avatar.md +101 -101
  658. package/docs/components/badge.md +84 -84
  659. package/docs/components/branding.md +252 -249
  660. package/docs/components/breadcrumb.md +104 -104
  661. package/docs/components/button.md +156 -156
  662. package/docs/components/calendar.md +141 -141
  663. package/docs/components/card-patterns.md +445 -376
  664. package/docs/components/card.md +245 -245
  665. package/docs/components/carousel.md +100 -100
  666. package/docs/components/chart.md +638 -638
  667. package/docs/components/checkbox.md +88 -88
  668. package/docs/components/code-block.md +105 -105
  669. package/docs/components/collapsible.md +86 -86
  670. package/docs/components/command.md +113 -113
  671. package/docs/components/context-menu.md +81 -81
  672. package/docs/components/dialog.md +198 -198
  673. package/docs/components/drawer.md +105 -105
  674. package/docs/components/dropdown-menu.md +127 -127
  675. package/docs/components/empty.md +127 -127
  676. package/docs/components/error-boundary.md +191 -191
  677. package/docs/components/file-upload.md +189 -189
  678. package/docs/components/floating-media-wrapper.md +63 -63
  679. package/docs/components/form.md +177 -177
  680. package/docs/components/formatted-document.md +105 -105
  681. package/docs/components/google-maps-loader.md +44 -44
  682. package/docs/components/header.md +177 -177
  683. package/docs/components/hooks.md +430 -425
  684. package/docs/components/hover-card.md +86 -86
  685. package/docs/components/image-with-fallback.md +107 -107
  686. package/docs/components/input-otp.md +95 -95
  687. package/docs/components/input.md +130 -130
  688. package/docs/components/label.md +69 -69
  689. package/docs/components/language-selector.md +71 -16
  690. package/docs/components/map-layers.md +138 -138
  691. package/docs/components/map.md +84 -84
  692. package/docs/components/markdown-message.md +47 -47
  693. package/docs/components/menubar.md +89 -89
  694. package/docs/components/modern-chat-input.md +164 -164
  695. package/docs/components/navigation-menu.md +83 -83
  696. package/docs/components/notification-badge.md +78 -78
  697. package/docs/components/page-header.md +93 -93
  698. package/docs/components/pages.md +309 -309
  699. package/docs/components/pagination.md +334 -334
  700. package/docs/components/popover.md +116 -116
  701. package/docs/components/progress.md +103 -103
  702. package/docs/components/radio-group.md +133 -133
  703. package/docs/components/rating.md +77 -77
  704. package/docs/components/resizable.md +84 -84
  705. package/docs/components/rich-text-editor.md +255 -255
  706. package/docs/components/route-map.md +124 -124
  707. package/docs/components/scroll-area.md +58 -58
  708. package/docs/components/search.md +87 -87
  709. package/docs/components/select.md +144 -144
  710. package/docs/components/separator.md +58 -58
  711. package/docs/components/sheet.md +122 -122
  712. package/docs/components/sidebar.md +314 -314
  713. package/docs/components/simple-map.md +51 -51
  714. package/docs/components/skeleton.md +99 -99
  715. package/docs/components/slider.md +84 -84
  716. package/docs/components/sonner.md +115 -115
  717. package/docs/components/stats-card.md +120 -120
  718. package/docs/components/stepper.md +268 -268
  719. package/docs/components/switch.md +106 -106
  720. package/docs/components/table.md +138 -138
  721. package/docs/components/tabs.md +117 -117
  722. package/docs/components/textarea.md +86 -86
  723. package/docs/components/theme-toggle.md +73 -73
  724. package/docs/components/timeline.md +121 -121
  725. package/docs/components/toggle-group.md +68 -68
  726. package/docs/components/toggle.md +62 -62
  727. package/docs/components/tooltip.md +116 -116
  728. package/docs/components/tree-view.md +238 -238
  729. package/docs/components/use-mobile.md +96 -96
  730. package/docs/components/video-player.md +68 -68
  731. package/docs/components/xertica-logo.md +36 -36
  732. package/docs/components/xertica-orbe.md +35 -35
  733. package/docs/components/xertica-provider.md +65 -65
  734. package/docs/components/xertica-xlogo.md +35 -35
  735. package/docs/decision-tree.md +293 -293
  736. package/docs/doc-audit.md +243 -224
  737. package/docs/form-sizing.md +162 -162
  738. package/docs/getting-started.md +591 -568
  739. package/docs/guidelines.md +328 -222
  740. package/docs/i18n.md +324 -43
  741. package/docs/installation.md +267 -267
  742. package/docs/layout.md +143 -143
  743. package/docs/llms.md +295 -295
  744. package/docs/patterns/analytics.md +194 -194
  745. package/docs/patterns/crud.md +149 -149
  746. package/docs/patterns/dashboard.md +138 -138
  747. package/docs/patterns/detail-page.md +296 -296
  748. package/docs/patterns/form.md +241 -241
  749. package/docs/patterns/login.md +156 -156
  750. package/docs/patterns/settings.md +368 -368
  751. package/docs/patterns/wizard.md +213 -213
  752. package/docs/state-management.md +289 -283
  753. package/guidelines/Guidelines.md +406 -257
  754. package/hooks/useTheme.test.tsx +16 -16
  755. package/hooks/useTheme.ts +4 -4
  756. package/imports/Podcast.tsx +540 -540
  757. package/imports/XerticaAi.tsx +46 -46
  758. package/imports/XerticaX.tsx +15 -15
  759. package/imports/svg-aueiaqngck.ts +20 -20
  760. package/imports/svg-v9krss1ozd.ts +23 -23
  761. package/imports/svg-vhrdofe3qe.ts +6 -6
  762. package/llms-compact.txt +1 -1
  763. package/llms-full.txt +5 -2
  764. package/llms.txt +186 -186
  765. package/mcp/resources.json +22 -22
  766. package/mcp/tools.json +35 -35
  767. package/package.json +213 -213
  768. package/scripts/ai-validator.ts +91 -91
  769. package/scripts/cleanup-case-dupes.ts +62 -62
  770. package/scripts/generate-ai-manifests.ts +107 -107
  771. package/styles/globals.css +13 -13
  772. package/styles/xertica/app-overrides/chat.css +61 -61
  773. package/styles/xertica/app-overrides/scrollbar.css +33 -33
  774. package/styles/xertica/base.css +71 -71
  775. package/styles/xertica/integrations/google-maps.css +76 -76
  776. package/styles/xertica/integrations/sonner.css +73 -73
  777. package/styles/xertica/theme-map.css +99 -99
  778. package/styles/xertica/tokens.css +236 -236
  779. package/templates/.prettierignore +4 -4
  780. package/templates/.prettierrc +10 -10
  781. package/templates/CLAUDE.md +180 -180
  782. package/templates/eslint.config.js +26 -26
  783. package/templates/guidelines/Guidelines.md +553 -335
  784. package/templates/package.json +69 -69
  785. package/templates/postcss.config.js +6 -6
  786. package/templates/src/app/App.tsx +46 -46
  787. package/templates/src/app/components/AppLayout.tsx +55 -55
  788. package/templates/src/app/components/AuthGuard.tsx +82 -82
  789. package/templates/src/app/context/AuthContext.tsx +108 -108
  790. package/templates/src/features/assistant/data/mock.ts +21 -12
  791. package/templates/src/features/assistant/hooks/useAssistantConfig.ts +4 -3
  792. package/templates/src/features/assistant/index.ts +5 -5
  793. package/templates/src/features/auth/index.ts +4 -4
  794. package/templates/src/features/auth/ui/AuthPageShell.tsx +32 -32
  795. package/templates/src/features/auth/ui/ForgotPasswordContent.tsx +70 -70
  796. package/templates/src/features/auth/ui/LoginContent.tsx +90 -90
  797. package/templates/src/features/auth/ui/ResetPasswordContent.tsx +177 -177
  798. package/templates/src/features/auth/ui/SocialLoginButtons.tsx +73 -73
  799. package/templates/src/features/auth/ui/VerifyEmailContent.tsx +82 -82
  800. package/templates/src/features/home/data/mock.ts +35 -35
  801. package/templates/src/features/home/hooks/useFeatureCards.ts +4 -3
  802. package/templates/src/features/home/index.ts +11 -11
  803. package/templates/src/features/home/store/dashboardStore.ts +25 -25
  804. package/templates/src/features/home/ui/HomeContent.tsx +119 -121
  805. package/templates/src/features/template/index.ts +5 -5
  806. package/templates/src/features/template/ui/CrudTemplate.tsx +32 -17
  807. package/templates/src/features/template/ui/DashboardTemplate.tsx +31 -15
  808. package/templates/src/features/template/ui/FormTemplate.tsx +21 -21
  809. package/templates/src/features/template/ui/LoginTemplate.tsx +14 -7
  810. package/templates/src/features/template/ui/TemplateContent.tsx +403 -288
  811. package/templates/src/i18n.ts +97 -11
  812. package/templates/src/locales/en/common.json +21 -0
  813. package/templates/src/locales/en/components/activityCard.json +10 -0
  814. package/templates/src/locales/en/components/assistant.json +105 -0
  815. package/templates/src/locales/en/components/media.json +29 -0
  816. package/templates/src/locales/en/components/notificationCard.json +5 -0
  817. package/templates/src/locales/en/components/profileCard.json +8 -0
  818. package/templates/src/locales/en/components/projectCard.json +10 -0
  819. package/templates/src/locales/en/components/sidebar.json +14 -0
  820. package/templates/src/locales/en/components/stats.json +8 -0
  821. package/templates/src/locales/en/components/team.json +14 -0
  822. package/templates/src/locales/en/errors.json +9 -0
  823. package/templates/src/locales/en/languageSelector.json +7 -0
  824. package/templates/src/locales/en/nav.json +6 -0
  825. package/templates/src/locales/en/pages/crudTemplate.json +25 -0
  826. package/templates/src/locales/en/pages/dashboardTemplate.json +20 -0
  827. package/templates/src/locales/en/pages/formTemplate.json +16 -0
  828. package/templates/src/locales/en/pages/home.json +7 -0
  829. package/templates/src/locales/en/pages/login.json +15 -0
  830. package/templates/src/locales/en/pages/loginTemplate.json +9 -0
  831. package/templates/src/locales/en/pages/resetPassword.json +18 -0
  832. package/templates/src/locales/en/pages/templates.json +317 -0
  833. package/templates/src/locales/en/pages/verifyEmail.json +12 -0
  834. package/templates/src/locales/en/themeToggle.json +6 -0
  835. package/templates/src/locales/es/common.json +21 -0
  836. package/templates/src/locales/es/components/activityCard.json +10 -0
  837. package/templates/src/locales/es/components/assistant.json +105 -0
  838. package/templates/src/locales/es/components/media.json +29 -0
  839. package/templates/src/locales/es/components/notificationCard.json +5 -0
  840. package/templates/src/locales/es/components/profileCard.json +8 -0
  841. package/templates/src/locales/es/components/projectCard.json +10 -0
  842. package/templates/src/locales/es/components/sidebar.json +14 -0
  843. package/templates/src/locales/es/components/stats.json +8 -0
  844. package/templates/src/locales/es/components/team.json +14 -0
  845. package/templates/src/locales/es/errors.json +9 -0
  846. package/templates/src/locales/es/languageSelector.json +7 -0
  847. package/templates/src/locales/es/nav.json +6 -0
  848. package/templates/src/locales/es/pages/crudTemplate.json +25 -0
  849. package/templates/src/locales/es/pages/dashboardTemplate.json +20 -0
  850. package/templates/src/locales/es/pages/formTemplate.json +16 -0
  851. package/templates/src/locales/es/pages/home.json +7 -0
  852. package/templates/src/locales/es/pages/login.json +15 -0
  853. package/templates/src/locales/es/pages/loginTemplate.json +9 -0
  854. package/templates/src/locales/es/pages/resetPassword.json +18 -0
  855. package/templates/src/locales/es/pages/templates.json +317 -0
  856. package/templates/src/locales/es/pages/verifyEmail.json +12 -0
  857. package/templates/src/locales/es/themeToggle.json +6 -0
  858. package/templates/src/locales/pt-BR/common.json +21 -0
  859. package/templates/src/locales/pt-BR/components/activityCard.json +10 -0
  860. package/templates/src/locales/pt-BR/components/assistant.json +105 -0
  861. package/templates/src/locales/pt-BR/components/media.json +29 -0
  862. package/templates/src/locales/pt-BR/components/notificationCard.json +5 -0
  863. package/templates/src/locales/pt-BR/components/profileCard.json +8 -0
  864. package/templates/src/locales/pt-BR/components/projectCard.json +10 -0
  865. package/templates/src/locales/pt-BR/components/sidebar.json +14 -0
  866. package/templates/src/locales/pt-BR/components/stats.json +8 -0
  867. package/templates/src/locales/pt-BR/components/team.json +14 -0
  868. package/templates/src/locales/pt-BR/errors.json +9 -0
  869. package/templates/src/locales/pt-BR/languageSelector.json +7 -0
  870. package/templates/src/locales/pt-BR/nav.json +6 -0
  871. package/templates/src/locales/pt-BR/pages/crudTemplate.json +25 -0
  872. package/templates/src/locales/pt-BR/pages/dashboardTemplate.json +20 -0
  873. package/templates/src/locales/pt-BR/pages/formTemplate.json +16 -0
  874. package/templates/src/locales/pt-BR/pages/home.json +7 -0
  875. package/templates/src/locales/pt-BR/pages/login.json +15 -0
  876. package/templates/src/locales/pt-BR/pages/loginTemplate.json +9 -0
  877. package/templates/src/locales/pt-BR/pages/resetPassword.json +18 -0
  878. package/templates/src/locales/pt-BR/pages/templates.json +317 -0
  879. package/templates/src/locales/pt-BR/pages/verifyEmail.json +12 -0
  880. package/templates/src/locales/pt-BR/themeToggle.json +6 -0
  881. package/templates/src/main.tsx +11 -11
  882. package/templates/src/pages/AssistantPage.tsx +463 -463
  883. package/templates/src/pages/ForgotPasswordPage.tsx +6 -6
  884. package/templates/src/pages/HomePage.tsx +49 -50
  885. package/templates/src/pages/LoginPage.tsx +10 -10
  886. package/templates/src/pages/ResetPasswordPage.tsx +6 -6
  887. package/templates/src/pages/TemplatePage.tsx +28 -28
  888. package/templates/src/pages/VerifyEmailPage.tsx +6 -6
  889. package/templates/src/shared/config/navigation.ts +19 -19
  890. package/templates/src/shared/error-boundary.tsx +154 -154
  891. package/templates/src/shared/error-fallbacks.tsx +226 -226
  892. package/templates/src/shared/lib/auth.ts +20 -20
  893. package/templates/src/shared/types/auth.ts +3 -3
  894. package/templates/src/styles/index.css +95 -95
  895. package/templates/src/styles/xertica/tokens.css +236 -236
  896. package/templates/tsconfig.json +25 -25
  897. package/templates/tsconfig.node.json +12 -12
  898. package/templates/vite-env.d.ts +1 -1
  899. package/templates/vite.config.ts +51 -21
  900. package/utils/color-utils.ts +72 -72
  901. package/utils/demo-responses.test.ts +10 -10
  902. package/utils/demo-responses.ts +151 -151
  903. package/utils/gemini.test.ts +25 -25
  904. package/utils/gemini.ts +155 -155
  905. package/dist/AssistantChart-DIpshm3i.js +0 -4784
  906. package/dist/AssistantChart-zjsy2GaZ.cjs +0 -4810
  907. package/dist/AudioPlayer-B1lt5cPl.cjs +0 -989
  908. package/dist/AudioPlayer-BZ7bibzU.cjs +0 -982
  909. package/dist/AudioPlayer-C12BjQBV.cjs +0 -997
  910. package/dist/AudioPlayer-CFeV8t-5.cjs +0 -936
  911. package/dist/AudioPlayer-CGRUtUdN.js +0 -937
  912. package/dist/AudioPlayer-DMcG_c7L.js +0 -990
  913. package/dist/AudioPlayer-DcFKRJE_.js +0 -998
  914. package/dist/AudioPlayer-e8LfNoqO.js +0 -983
  915. package/dist/CodeBlock-BeSt1h5P.js +0 -2078
  916. package/dist/CodeBlock-BgfYL_rD.cjs +0 -2094
  917. package/dist/CodeBlock-BlcqlA9M.cjs +0 -2094
  918. package/dist/CodeBlock-Bnmeu5ez.cjs +0 -2094
  919. package/dist/CodeBlock-BtfPlbAI.js +0 -2078
  920. package/dist/CodeBlock-CIySIuYr.js +0 -2078
  921. package/dist/CodeBlock-CuPtUM-7.cjs +0 -2094
  922. package/dist/CodeBlock-D6ffWXgc.js +0 -2078
  923. package/dist/CodeBlock-D8dcwbit.cjs +0 -2094
  924. package/dist/CodeBlock-DMZrFnlw.cjs +0 -2094
  925. package/dist/CodeBlock-DlBehYN8.js +0 -2078
  926. package/dist/CodeBlock-DvKWbSnE.cjs +0 -2094
  927. package/dist/CodeBlock-DwMCfkFY.js +0 -2078
  928. package/dist/CodeBlock-Dy6CNYyj.js +0 -2078
  929. package/dist/CodeBlock-U1pPOQI7.cjs +0 -2094
  930. package/dist/CodeBlock-f_GpNhEB.js +0 -2078
  931. package/dist/CodeBlock-oB6u8nI1.js +0 -2078
  932. package/dist/CodeBlock-tZC31B73.cjs +0 -2094
  933. package/dist/FeatureCard-CxC-7C-C.cjs +0 -300
  934. package/dist/ImageWithFallback-CGtidP6B.cjs +0 -4542
  935. package/dist/ImageWithFallback-lsg3pdFg.js +0 -4508
  936. package/dist/LayoutContext-BAql6ZRY.js +0 -97
  937. package/dist/LayoutContext-BvK-ggDa.cjs +0 -96
  938. package/dist/ThemeContext-BoH4NLfN.js +0 -734
  939. package/dist/ThemeContext-r69W20Xg.cjs +0 -733
  940. package/dist/VerifyEmailPage-COiyNl1y.js +0 -2825
  941. package/dist/VerifyEmailPage-CqKsR2v8.js +0 -2827
  942. package/dist/XerticaOrbe-KL1RBHzw.cjs +0 -1354
  943. package/dist/XerticaOrbe-zwS1p2a8.js +0 -1355
  944. package/dist/XerticaProvider-6btlAlzc.js +0 -17
  945. package/dist/XerticaProvider-BNoNOxQ5.cjs +0 -16
  946. package/dist/XerticaProvider-BlY2limY.cjs +0 -38
  947. package/dist/XerticaProvider-DDuiIcKo.js +0 -39
  948. package/dist/XerticaProvider-cI9hSs27.cjs +0 -38
  949. package/dist/XerticaProvider-hSwhNQex.js +0 -39
  950. package/dist/breadcrumb-CqJ7bHY5.js +0 -161
  951. package/dist/breadcrumb-m9Hb2_XN.cjs +0 -177
  952. package/dist/components/assistant/xertica-assistant/hooks/index.d.ts +0 -6
  953. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-conversations.d.ts +0 -21
  954. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-messages.d.ts +0 -49
  955. package/dist/components/assistant/xertica-assistant/hooks/use-assistant-suggestions.d.ts +0 -16
  956. package/dist/components/blocks/audio-player/AudioPlayer.d.ts +0 -35
  957. package/dist/components/blocks/audio-player/index.d.ts +0 -1
  958. package/dist/components/blocks/document-editor/DocumentEditor.d.ts +0 -26
  959. package/dist/components/blocks/document-editor/index.d.ts +0 -1
  960. package/dist/components/blocks/podcast-player/PodcastPlayer.d.ts +0 -41
  961. package/dist/components/blocks/podcast-player/index.d.ts +0 -1
  962. package/dist/components/ui/chart/parts/chart-dashboard.d.ts +0 -113
  963. package/dist/components/ui/chart/parts/chart-metric.d.ts +0 -118
  964. package/dist/components/ui/chart/parts/chart-primitives.d.ts +0 -101
  965. package/dist/components/ui/chart/parts/chart-shared.d.ts +0 -20
  966. package/dist/components/ui/chart/parts/chart-utils.d.ts +0 -12
  967. package/dist/components/ui/chart/parts/index.d.ts +0 -5
  968. package/dist/dropdown-menu-BDB5CmQs.cjs +0 -247
  969. package/dist/dropdown-menu-DQidbKBD.js +0 -231
  970. package/dist/google-maps-loader-BFWp6VPd.js +0 -287
  971. package/dist/google-maps-loader-eS3uQ5TA.cjs +0 -287
  972. package/dist/header-Cgy6vYPk.cjs +0 -731
  973. package/dist/header-DRlT4jgI.js +0 -715
  974. package/dist/header-Dux00SI4.cjs +0 -731
  975. package/dist/header-EkGKXPsD.js +0 -715
  976. package/dist/header-WfEywpyc.cjs +0 -731
  977. package/dist/header-tifNQn2U.js +0 -715
  978. package/dist/index-BhapVLVj.js +0 -8
  979. package/dist/index-D6fxYEY8.cjs +0 -7
  980. package/dist/index-DW5tYe26.js +0 -8
  981. package/dist/input-2R4loU86.js +0 -127
  982. package/dist/input-DWANSKGb.cjs +0 -145
  983. package/dist/progress-DPtzoVV8.js +0 -175
  984. package/dist/progress-EeaoqqUs.cjs +0 -191
  985. package/dist/rich-text-editor-0mraWT5y.cjs +0 -2376
  986. package/dist/rich-text-editor-B6jMRLzk.cjs +0 -1939
  987. package/dist/rich-text-editor-B8_oYcIR.js +0 -1730
  988. package/dist/rich-text-editor-B9UbSXNb.js +0 -1203
  989. package/dist/rich-text-editor-BYuRBNBU.js +0 -2373
  990. package/dist/rich-text-editor-Bb9pySTs.cjs +0 -2374
  991. package/dist/rich-text-editor-BcL6L3cm.cjs +0 -2374
  992. package/dist/rich-text-editor-BoVZYtTs.cjs +0 -2391
  993. package/dist/rich-text-editor-CMgSN_w2.js +0 -1189
  994. package/dist/rich-text-editor-CPV1lEPH.cjs +0 -1748
  995. package/dist/rich-text-editor-CoKqbCtu.cjs +0 -1799
  996. package/dist/rich-text-editor-Cw56T_mB.js +0 -2356
  997. package/dist/rich-text-editor-Cyt8qs2b.js +0 -1921
  998. package/dist/rich-text-editor-D6H84OcX.cjs +0 -1220
  999. package/dist/rich-text-editor-D76gD-QI.js +0 -2328
  1000. package/dist/rich-text-editor-DKkokOnA.js +0 -1781
  1001. package/dist/rich-text-editor-DNsdpN64.cjs +0 -2359
  1002. package/dist/rich-text-editor-DfG8bCyY.js +0 -2358
  1003. package/dist/rich-text-editor-Dxjw31Z4.js +0 -2341
  1004. package/dist/rich-text-editor-DzP0Epmb.js +0 -2356
  1005. package/dist/rich-text-editor-lyYE2ZG5.cjs +0 -1207
  1006. package/dist/rich-text-editor-skplNlBM.cjs +0 -2345
  1007. package/dist/select-Bkbr0f-Z.cjs +0 -162
  1008. package/dist/select-CvIVdX2n.js +0 -145
  1009. package/dist/sidebar-Djn5syhi.cjs +0 -786
  1010. package/dist/sidebar-_rT7rBMk.js +0 -787
  1011. package/dist/slider-Bc5Hd0y1.js +0 -56
  1012. package/dist/slider-N7hFFj6X.cjs +0 -73
  1013. package/dist/tooltip-Ded96neP.cjs +0 -137
  1014. package/dist/tooltip-HDOoD2-0.js +0 -120
  1015. package/dist/use-audio-player-BkmEmj8Q.js +0 -185
  1016. package/dist/use-audio-player-CLFTWFW1.cjs +0 -184
  1017. package/dist/use-file-upload-BcjEo2S5.js +0 -404
  1018. package/dist/use-file-upload-CRJR68Tj.cjs +0 -403
  1019. package/dist/use-mobile-B0hNy_Y6.cjs +0 -4303
  1020. package/dist/use-mobile-Bbd51ASU.cjs +0 -4392
  1021. package/dist/use-mobile-Bk6CX-TC.js +0 -4359
  1022. package/dist/use-mobile-BvYdisLP.js +0 -4202
  1023. package/dist/use-mobile-BzuxjzNX.cjs +0 -4392
  1024. package/dist/use-mobile-CKb5pqTs.js +0 -4269
  1025. package/dist/use-mobile-CYuAuGDl.js +0 -4202
  1026. package/dist/use-mobile-CaENcqm-.js +0 -4508
  1027. package/dist/use-mobile-CbrYgJGJ.js +0 -4203
  1028. package/dist/use-mobile-DMOvImGQ.cjs +0 -4542
  1029. package/dist/use-mobile-DRB3BQgD.cjs +0 -4235
  1030. package/dist/use-mobile-DZvv7QMR.js +0 -4359
  1031. package/dist/use-mobile-DdI_TXam.cjs +0 -4235
  1032. package/dist/use-mobile-DlceKf8a.js +0 -4359
  1033. package/dist/use-mobile-DsOnow1o.cjs +0 -4236
  1034. package/dist/use-mobile-Kcj6jSnK.cjs +0 -4392
  1035. package/dist/use-mobile-bnKcua_i.js +0 -4202
  1036. package/dist/use-mobile-ncXBeE2z.cjs +0 -4235
  1037. package/dist/use-rich-text-editor-DjiddBGv.js +0 -282
  1038. package/dist/use-rich-text-editor-lpeswbCs.cjs +0 -281
  1039. package/templates/src/locales/en.json +0 -79
  1040. package/templates/src/locales/es.json +0 -79
  1041. package/templates/src/locales/pt-BR.json +0 -79
  1042. package/dist/{rich-text-editor-DgF8s7xW.js → rich-text-editor-BmsjY03B.js} +26 -26
  1043. package/dist/{rich-text-editor-mWoaSCE4.cjs → rich-text-editor-GS2kpTAK.cjs} +26 -26
@@ -1,2359 +0,0 @@
1
- "use strict";
2
- const jsxRuntime = require("react/jsx-runtime");
3
- const React = require("react");
4
- const RechartsPrimitive = require("recharts");
5
- const tooltip = require("./tooltip-Ded96neP.cjs");
6
- const classVarianceAuthority = require("class-variance-authority");
7
- const lucideReact = require("lucide-react");
8
- const select = require("./select-Bkbr0f-Z.cjs");
9
- const TabsPrimitive = require("@radix-ui/react-tabs");
10
- const DialogPrimitive = require("@radix-ui/react-dialog");
11
- const dropdownMenu = require("./dropdown-menu-BDB5CmQs.cjs");
12
- const input = require("./input-DWANSKGb.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 TabsPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(TabsPrimitive);
32
- const DialogPrimitive__namespace = /* @__PURE__ */ _interopNamespaceDefault(DialogPrimitive);
33
- const alertVariants = classVarianceAuthority.cva(
34
- "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",
35
- {
36
- variants: {
37
- variant: {
38
- default: "bg-muted/50 border-l-border text-foreground [&>svg]:text-muted-foreground",
39
- success: "bg-[color:var(--success)]/10 dark:bg-[color:var(--success)]/20 border-l-[color:var(--success)] text-foreground [&>svg]:text-[color:var(--success)]",
40
- info: "bg-[color:var(--info)]/10 dark:bg-[color:var(--info)]/20 border-l-[color:var(--info)] text-foreground [&>svg]:text-[color:var(--info)]",
41
- warning: "bg-[color:var(--warning)]/10 dark:bg-[color:var(--warning)]/20 border-l-[color:var(--warning)] text-foreground [&>svg]:text-[color:var(--warning)]",
42
- destructive: "bg-[color:var(--destructive)]/10 dark:bg-[color:var(--destructive)]/20 border-l-[color:var(--destructive)] text-foreground [&>svg]:text-[color:var(--destructive)]"
43
- }
44
- },
45
- defaultVariants: {
46
- variant: "default"
47
- }
48
- }
49
- );
50
- const alertIcons = {
51
- default: lucideReact.Info,
52
- success: lucideReact.CheckCircle,
53
- info: lucideReact.Info,
54
- warning: lucideReact.AlertTriangle,
55
- destructive: lucideReact.XCircle
56
- };
57
- function Alert({
58
- className,
59
- variant,
60
- icon,
61
- children,
62
- ...props
63
- }) {
64
- const alertVariant = variant && variant in alertIcons ? variant : "default";
65
- const DefaultIcon = alertIcons[alertVariant];
66
- return /* @__PURE__ */ jsxRuntime.jsxs(
67
- "div",
68
- {
69
- "data-slot": "alert",
70
- role: "alert",
71
- className: tooltip.cn(alertVariants({ variant }), className),
72
- ...props,
73
- children: [
74
- icon !== void 0 ? icon : /* @__PURE__ */ jsxRuntime.jsx(DefaultIcon, { className: "flex-shrink-0" }),
75
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1", children })
76
- ]
77
- }
78
- );
79
- }
80
- function AlertTitle({ className, ...props }) {
81
- return /* @__PURE__ */ jsxRuntime.jsx(
82
- "div",
83
- {
84
- "data-slot": "alert-title",
85
- className: tooltip.cn(
86
- "font-medium mb-1 leading-tight",
87
- className
88
- ),
89
- ...props
90
- }
91
- );
92
- }
93
- function AlertDescription({
94
- className,
95
- ...props
96
- }) {
97
- return /* @__PURE__ */ jsxRuntime.jsx(
98
- "div",
99
- {
100
- "data-slot": "alert-description",
101
- className: tooltip.cn(
102
- "leading-relaxed",
103
- className
104
- ),
105
- ...props
106
- }
107
- );
108
- }
109
- function Card({ className, ...props }) {
110
- return /* @__PURE__ */ jsxRuntime.jsx(
111
- "div",
112
- {
113
- "data-slot": "card",
114
- className: tooltip.cn(
115
- "bg-card text-card-foreground flex flex-col gap-6 rounded-[var(--radius-card)]",
116
- className
117
- ),
118
- ...props
119
- }
120
- );
121
- }
122
- function CardHeader({ className, ...props }) {
123
- return /* @__PURE__ */ jsxRuntime.jsx(
124
- "div",
125
- {
126
- "data-slot": "card-header",
127
- className: tooltip.cn(
128
- "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
129
- className
130
- ),
131
- ...props
132
- }
133
- );
134
- }
135
- function CardTitle({ className, ...props }) {
136
- return /* @__PURE__ */ jsxRuntime.jsx(
137
- "h4",
138
- {
139
- "data-slot": "card-title",
140
- className: tooltip.cn("leading-none", className),
141
- ...props
142
- }
143
- );
144
- }
145
- function CardDescription({ className, ...props }) {
146
- return /* @__PURE__ */ jsxRuntime.jsx(
147
- "p",
148
- {
149
- "data-slot": "card-description",
150
- className: tooltip.cn("text-muted-foreground", className),
151
- ...props
152
- }
153
- );
154
- }
155
- function CardAction({ className, ...props }) {
156
- return /* @__PURE__ */ jsxRuntime.jsx(
157
- "div",
158
- {
159
- "data-slot": "card-action",
160
- className: tooltip.cn(
161
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
162
- className
163
- ),
164
- ...props
165
- }
166
- );
167
- }
168
- function CardContent({ className, ...props }) {
169
- return /* @__PURE__ */ jsxRuntime.jsx(
170
- "div",
171
- {
172
- "data-slot": "card-content",
173
- className: tooltip.cn("px-6 [&:last-child]:pb-6", className),
174
- ...props
175
- }
176
- );
177
- }
178
- function CardFooter({ className, ...props }) {
179
- return /* @__PURE__ */ jsxRuntime.jsx(
180
- "div",
181
- {
182
- "data-slot": "card-footer",
183
- className: tooltip.cn("flex items-center px-6 pb-6 [.border-t]:pt-6", className),
184
- ...props
185
- }
186
- );
187
- }
188
- const Empty = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
189
- "div",
190
- {
191
- ref,
192
- className: tooltip.cn(
193
- "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",
194
- className
195
- ),
196
- ...props
197
- }
198
- ));
199
- Empty.displayName = "Empty";
200
- const EmptyIcon = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
201
- "div",
202
- {
203
- ref,
204
- className: tooltip.cn(
205
- "mx-auto flex h-20 w-20 items-center justify-center rounded-full bg-muted",
206
- className
207
- ),
208
- ...props
209
- }
210
- ));
211
- EmptyIcon.displayName = "EmptyIcon";
212
- const EmptyImage = React__namespace.forwardRef(({ className, alt, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
213
- "img",
214
- {
215
- ref,
216
- alt,
217
- className: tooltip.cn("mx-auto mb-4 h-48 w-48 object-contain opacity-50", className),
218
- ...props
219
- }
220
- ));
221
- EmptyImage.displayName = "EmptyImage";
222
- const EmptyTitle = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
223
- "h3",
224
- {
225
- ref,
226
- className: tooltip.cn("mt-4 font-semibold text-foreground", className),
227
- ...props
228
- }
229
- ));
230
- EmptyTitle.displayName = "EmptyTitle";
231
- const EmptyDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
232
- "p",
233
- {
234
- ref,
235
- className: tooltip.cn("mt-2 text-sm text-muted-foreground max-w-sm mx-auto", className),
236
- ...props
237
- }
238
- ));
239
- EmptyDescription.displayName = "EmptyDescription";
240
- const EmptyAction = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
241
- "div",
242
- {
243
- ref,
244
- className: tooltip.cn("mt-6 flex flex-col gap-2 sm:flex-row sm:gap-4", className),
245
- ...props
246
- }
247
- ));
248
- EmptyAction.displayName = "EmptyAction";
249
- function Skeleton({ className, ...props }) {
250
- return /* @__PURE__ */ jsxRuntime.jsx(
251
- "div",
252
- {
253
- "data-slot": "skeleton",
254
- className: tooltip.cn("bg-accent animate-pulse rounded-md", className),
255
- ...props
256
- }
257
- );
258
- }
259
- function Tabs({
260
- className,
261
- ...props
262
- }) {
263
- return /* @__PURE__ */ jsxRuntime.jsx(
264
- TabsPrimitive__namespace.Root,
265
- {
266
- "data-slot": "tabs",
267
- className: tooltip.cn("flex flex-col gap-2", className),
268
- ...props
269
- }
270
- );
271
- }
272
- function TabsList({
273
- className,
274
- ...props
275
- }) {
276
- return /* @__PURE__ */ jsxRuntime.jsx(
277
- TabsPrimitive__namespace.List,
278
- {
279
- "data-slot": "tabs-list",
280
- className: tooltip.cn(
281
- "relative inline-flex h-12 w-fit items-end justify-start border-b border-border bg-transparent",
282
- className
283
- ),
284
- ...props
285
- }
286
- );
287
- }
288
- function TabsTrigger({
289
- className,
290
- ...props
291
- }) {
292
- return /* @__PURE__ */ jsxRuntime.jsx(
293
- TabsPrimitive__namespace.Trigger,
294
- {
295
- "data-slot": "tabs-trigger",
296
- className: tooltip.cn(
297
- "relative inline-flex h-12 items-center justify-center gap-1.5 bg-transparent px-4 py-3 text-sm font-medium whitespace-nowrap transition-all duration-200 ease-in-out border-b-2 border-transparent text-muted-foreground hover:text-foreground hover:bg-accent/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50 data-[state=active]:text-primary data-[state=active]:border-primary data-[state=active]:bg-transparent [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
298
- className
299
- ),
300
- ...props
301
- }
302
- );
303
- }
304
- function TabsContent({
305
- className,
306
- ...props
307
- }) {
308
- return /* @__PURE__ */ jsxRuntime.jsx(
309
- TabsPrimitive__namespace.Content,
310
- {
311
- "data-slot": "tabs-content",
312
- className: tooltip.cn("flex-1 outline-none", className),
313
- ...props
314
- }
315
- );
316
- }
317
- const THEMES = { light: "", dark: ".dark" };
318
- const defaultPeriods = [
319
- { value: "7d", label: "7 days" },
320
- { value: "30d", label: "30 days" },
321
- { value: "90d", label: "90 days" }
322
- ];
323
- const defaultChartColors = [
324
- "var(--chart-1)",
325
- "var(--chart-2)",
326
- "var(--chart-3)",
327
- "var(--chart-4)",
328
- "var(--chart-5)"
329
- ];
330
- const ChartContext = React__namespace.createContext(null);
331
- function useChart() {
332
- const context = React__namespace.useContext(ChartContext);
333
- if (!context) {
334
- throw new Error("useChart must be used within a <ChartContainer />");
335
- }
336
- return context;
337
- }
338
- function ChartContainer({
339
- id,
340
- className,
341
- children,
342
- config,
343
- ...props
344
- }) {
345
- const uniqueId = React__namespace.useId();
346
- const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
347
- return /* @__PURE__ */ jsxRuntime.jsx(ChartContext.Provider, { value: { config }, children: /* @__PURE__ */ jsxRuntime.jsxs(
348
- "div",
349
- {
350
- "data-slot": "chart",
351
- "data-chart": chartId,
352
- className: tooltip.cn(
353
- "[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex justify-center text-xs overflow-hidden [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden h-[300px] w-full",
354
- className
355
- ),
356
- ...props,
357
- children: [
358
- /* @__PURE__ */ jsxRuntime.jsx(ChartStyle, { id: chartId, config }),
359
- /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.ResponsiveContainer, { width: "100%", height: "100%", children })
360
- ]
361
- }
362
- ) });
363
- }
364
- const ChartStyle = ({ id, config }) => {
365
- const colorConfig = Object.entries(config).filter(
366
- ([, config2]) => config2.theme || config2.color
367
- );
368
- if (!colorConfig.length) {
369
- return null;
370
- }
371
- return /* @__PURE__ */ jsxRuntime.jsx(
372
- "style",
373
- {
374
- dangerouslySetInnerHTML: {
375
- __html: Object.entries(THEMES).map(
376
- ([theme, prefix]) => `
377
- ${prefix} [data-chart=${id}] {
378
- ${colorConfig.map(([key, itemConfig]) => {
379
- var _a;
380
- const color = ((_a = itemConfig.theme) == null ? void 0 : _a[theme]) || itemConfig.color;
381
- return color ? ` --color-${key}: ${color};` : null;
382
- }).join("\n")}
383
- }
384
- `
385
- ).join("\n")
386
- }
387
- }
388
- );
389
- };
390
- const ChartTooltip = RechartsPrimitive__namespace.Tooltip;
391
- function ChartTooltipContent({
392
- active,
393
- payload,
394
- className,
395
- indicator = "dot",
396
- hideLabel = false,
397
- hideIndicator = false,
398
- label,
399
- labelFormatter,
400
- labelClassName,
401
- formatter,
402
- color,
403
- nameKey,
404
- labelKey
405
- }) {
406
- const { config } = useChart();
407
- const tooltipLabel = React__namespace.useMemo(() => {
408
- var _a;
409
- if (hideLabel || !(payload == null ? void 0 : payload.length)) {
410
- return null;
411
- }
412
- const [item] = payload;
413
- const key = `${labelKey || (item == null ? void 0 : item.dataKey) || (item == null ? void 0 : item.name) || "value"}`;
414
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
415
- const value = !labelKey && typeof label === "string" ? ((_a = config[label]) == null ? void 0 : _a.label) || label : itemConfig == null ? void 0 : itemConfig.label;
416
- if (labelFormatter) {
417
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tooltip.cn("font-medium", labelClassName), children: labelFormatter(value, payload) });
418
- }
419
- if (!value) {
420
- return null;
421
- }
422
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: tooltip.cn("font-medium", labelClassName), children: value });
423
- }, [
424
- label,
425
- labelFormatter,
426
- payload,
427
- hideLabel,
428
- labelClassName,
429
- config,
430
- labelKey
431
- ]);
432
- if (!active || !(payload == null ? void 0 : payload.length)) {
433
- return null;
434
- }
435
- const nestLabel = payload.length === 1 && indicator !== "dot";
436
- return /* @__PURE__ */ jsxRuntime.jsxs(
437
- "div",
438
- {
439
- className: tooltip.cn(
440
- "border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl",
441
- className
442
- ),
443
- children: [
444
- !nestLabel ? tooltipLabel : null,
445
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid gap-1.5", children: payload.map((item, index) => {
446
- var _a;
447
- const key = `${nameKey || item.name || item.dataKey || "value"}`;
448
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
449
- const indicatorColor = color || ((_a = item.payload) == null ? void 0 : _a.fill) || item.color;
450
- return /* @__PURE__ */ jsxRuntime.jsx(
451
- "div",
452
- {
453
- className: tooltip.cn(
454
- "[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5",
455
- indicator === "dot" && "items-center"
456
- ),
457
- 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: [
458
- (itemConfig == null ? void 0 : itemConfig.icon) ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : !hideIndicator && /* @__PURE__ */ jsxRuntime.jsx(
459
- "div",
460
- {
461
- className: tooltip.cn(
462
- "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
463
- {
464
- "h-2.5 w-2.5": indicator === "dot",
465
- "w-1": indicator === "line",
466
- "w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
467
- "my-0.5": nestLabel && indicator === "dashed"
468
- }
469
- ),
470
- style: {
471
- "--color-bg": indicatorColor,
472
- "--color-border": indicatorColor
473
- }
474
- }
475
- ),
476
- /* @__PURE__ */ jsxRuntime.jsxs(
477
- "div",
478
- {
479
- className: tooltip.cn(
480
- "flex flex-1 justify-between leading-none",
481
- nestLabel ? "items-end" : "items-center"
482
- ),
483
- children: [
484
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-1.5", children: [
485
- nestLabel ? tooltipLabel : null,
486
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: (itemConfig == null ? void 0 : itemConfig.label) || item.name })
487
- ] }),
488
- item.value && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground font-mono font-medium tabular-nums", children: item.value.toLocaleString() })
489
- ]
490
- }
491
- )
492
- ] })
493
- },
494
- item.dataKey
495
- );
496
- }) })
497
- ]
498
- }
499
- );
500
- }
501
- const ChartLegend = RechartsPrimitive__namespace.Legend;
502
- function ChartLegendContent({
503
- className,
504
- hideIcon = false,
505
- payload,
506
- verticalAlign = "bottom",
507
- nameKey
508
- }) {
509
- const { config } = useChart();
510
- if (!(payload == null ? void 0 : payload.length)) {
511
- return null;
512
- }
513
- return /* @__PURE__ */ jsxRuntime.jsx(
514
- "div",
515
- {
516
- className: tooltip.cn(
517
- "flex items-center justify-center gap-4",
518
- verticalAlign === "top" ? "pb-3" : "pt-3",
519
- className
520
- ),
521
- children: payload.map((item) => {
522
- const key = `${nameKey ? item.value : item.dataKey || item.value || "value"}`;
523
- const itemConfig = getPayloadConfigFromPayload(config, item, key);
524
- return /* @__PURE__ */ jsxRuntime.jsxs(
525
- "div",
526
- {
527
- className: tooltip.cn(
528
- "[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3"
529
- ),
530
- children: [
531
- (itemConfig == null ? void 0 : itemConfig.icon) && !hideIcon ? /* @__PURE__ */ jsxRuntime.jsx(itemConfig.icon, {}) : /* @__PURE__ */ jsxRuntime.jsx(
532
- "div",
533
- {
534
- className: "h-2 w-2 shrink-0 rounded-[2px] bg-(--color-bg)",
535
- style: {
536
- "--color-bg": item.color || `var(--color-${key})`
537
- }
538
- }
539
- ),
540
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: (itemConfig == null ? void 0 : itemConfig.label) || item.value })
541
- ]
542
- },
543
- item.value
544
- );
545
- })
546
- }
547
- );
548
- }
549
- function getPayloadConfigFromPayload(config, payload, key) {
550
- if (typeof payload !== "object" || payload === null) {
551
- return void 0;
552
- }
553
- const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : void 0;
554
- let configLabelKey = key;
555
- if (key in payload && typeof payload[key] === "string") {
556
- configLabelKey = payload[key];
557
- } else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
558
- configLabelKey = payloadPayload[key];
559
- }
560
- return configLabelKey in config ? config[configLabelKey] : config[key];
561
- }
562
- function getChartSeries(config, series) {
563
- if (series == null ? void 0 : series.length) {
564
- return series;
565
- }
566
- return Object.entries(config).map(([key, item]) => ({
567
- key,
568
- label: item.label
569
- }));
570
- }
571
- function getSeriesColor(key, index, colors) {
572
- if (Array.isArray(colors)) {
573
- return colors[index] || defaultChartColors[index % defaultChartColors.length];
574
- }
575
- return (colors == null ? void 0 : colors[key]) || defaultChartColors[index % defaultChartColors.length];
576
- }
577
- function getChartConfigWithColors(config, keys, colors) {
578
- return keys.reduce((nextConfig, key, index) => {
579
- const item = config[key];
580
- if ((item == null ? void 0 : item.theme) && !colors) {
581
- nextConfig[key] = item;
582
- return nextConfig;
583
- }
584
- nextConfig[key] = {
585
- label: (item == null ? void 0 : item.label) || key,
586
- icon: item == null ? void 0 : item.icon,
587
- color: colors ? getSeriesColor(key, index, colors) : (item == null ? void 0 : item.color) || getSeriesColor(key, index)
588
- };
589
- return nextConfig;
590
- }, {});
591
- }
592
- function formatTick(value) {
593
- if (typeof value !== "number") {
594
- return value;
595
- }
596
- return Intl.NumberFormat("en", {
597
- notation: "compact",
598
- maximumFractionDigits: 1
599
- }).format(value);
600
- }
601
- function defaultFilterData(data, period) {
602
- const match = period.match(/^(\d+)/);
603
- if (!match) {
604
- return data;
605
- }
606
- const limit = Number(match[1]);
607
- return data.slice(Math.max(data.length - limit, 0));
608
- }
609
- function getErrorDescription(error) {
610
- if (typeof error === "string") {
611
- return error;
612
- }
613
- if (error instanceof Error) {
614
- return error.message;
615
- }
616
- return void 0;
617
- }
618
- function hasChartData(data, series) {
619
- if (!data.length || !series.length) {
620
- return false;
621
- }
622
- return data.some(
623
- (item) => series.some((serie) => {
624
- const value = item[serie.key];
625
- return value !== null && value !== void 0 && value !== "";
626
- })
627
- );
628
- }
629
- function hasPieData(data, nameKey, valueKey) {
630
- return data.some((item) => {
631
- const name = item[nameKey];
632
- const value = item[valueKey];
633
- return name !== null && name !== void 0 && name !== "" && value !== null && value !== void 0 && value !== "";
634
- });
635
- }
636
- function ChartState({
637
- type,
638
- className,
639
- error,
640
- onRetry,
641
- retryLabel = "Try again",
642
- emptyTitle = "No data available",
643
- emptyDescription = "There is no data available for this chart yet.",
644
- errorTitle = "Connection error",
645
- errorDescription,
646
- loadingLabel = "Loading chart data"
647
- }) {
648
- if (type === "loading") {
649
- return /* @__PURE__ */ jsxRuntime.jsxs(
650
- "div",
651
- {
652
- className: tooltip.cn(
653
- "flex min-h-[240px] flex-col justify-end gap-3 rounded-[var(--radius-card)] border border-border p-6",
654
- className
655
- ),
656
- "aria-label": typeof loadingLabel === "string" ? loadingLabel : void 0,
657
- children: [
658
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-8 w-2/5" }),
659
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-14 w-3/5" }),
660
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-24 w-4/5" }),
661
- /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { className: "h-36 w-full" })
662
- ]
663
- }
664
- );
665
- }
666
- if (type === "error") {
667
- return /* @__PURE__ */ jsxRuntime.jsx(
668
- "div",
669
- {
670
- className: tooltip.cn(
671
- "flex min-h-[240px] items-center justify-center rounded-[var(--radius-card)] border border-border p-6",
672
- className
673
- ),
674
- children: /* @__PURE__ */ jsxRuntime.jsxs(Alert, { variant: "destructive", className: "max-w-xl", children: [
675
- /* @__PURE__ */ jsxRuntime.jsx(AlertTitle, { children: errorTitle }),
676
- /* @__PURE__ */ jsxRuntime.jsx(AlertDescription, { children: errorDescription || getErrorDescription(error) || "Unable to load chart data. Check your connection and try again." }),
677
- onRetry ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Button, { size: "sm", variant: "outline", onClick: onRetry, children: [
678
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RefreshCw, { className: "size-4" }),
679
- retryLabel
680
- ] }) }) : null
681
- ] })
682
- }
683
- );
684
- }
685
- return /* @__PURE__ */ jsxRuntime.jsxs(Empty, { className: tooltip.cn("min-h-[240px]", className), children: [
686
- /* @__PURE__ */ jsxRuntime.jsx(EmptyIcon, { children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BarChart3, { className: "size-10 text-muted-foreground" }) }),
687
- /* @__PURE__ */ jsxRuntime.jsx(EmptyTitle, { children: emptyTitle }),
688
- /* @__PURE__ */ jsxRuntime.jsx(EmptyDescription, { children: emptyDescription }),
689
- onRetry ? /* @__PURE__ */ jsxRuntime.jsx(EmptyAction, { children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Button, { size: "sm", variant: "outline", onClick: onRetry, children: [
690
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.WifiOff, { className: "size-4" }),
691
- retryLabel
692
- ] }) }) : null
693
- ] });
694
- }
695
- function getChartState(state, hasData, className) {
696
- if (state.isLoading) {
697
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "loading", className });
698
- }
699
- if (state.error) {
700
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "error", className });
701
- }
702
- if (!hasData) {
703
- return /* @__PURE__ */ jsxRuntime.jsx(ChartState, { ...state, type: "empty", className });
704
- }
705
- return null;
706
- }
707
- function ChartCard({
708
- title,
709
- description,
710
- action,
711
- footer,
712
- children,
713
- className,
714
- contentClassName,
715
- ...props
716
- }) {
717
- return /* @__PURE__ */ jsxRuntime.jsxs(Card, { className: tooltip.cn("overflow-hidden", className), ...props, children: [
718
- /* @__PURE__ */ jsxRuntime.jsxs(CardHeader, { children: [
719
- /* @__PURE__ */ jsxRuntime.jsx(CardTitle, { children: title }),
720
- description ? /* @__PURE__ */ jsxRuntime.jsx(CardDescription, { children: description }) : null,
721
- action ? /* @__PURE__ */ jsxRuntime.jsx(CardAction, { children: action }) : null
722
- ] }),
723
- /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: contentClassName, children }),
724
- footer ? /* @__PURE__ */ jsxRuntime.jsx(CardFooter, { children: footer }) : null
725
- ] });
726
- }
727
- function DashboardBarChart({
728
- data,
729
- config,
730
- indexKey = "name",
731
- series,
732
- colors,
733
- stacked = false,
734
- showGrid = true,
735
- showLegend = true,
736
- valueFormatter = formatTick,
737
- isLoading,
738
- error,
739
- onRetry,
740
- retryLabel,
741
- emptyTitle,
742
- emptyDescription,
743
- errorTitle,
744
- errorDescription,
745
- loadingLabel,
746
- stateClassName,
747
- className,
748
- ...props
749
- }) {
750
- const chartSeries = getChartSeries(config, series);
751
- const chartConfig = getChartConfigWithColors(
752
- config,
753
- chartSeries.map((item) => item.key),
754
- colors
755
- );
756
- const chartState = getChartState(
757
- {
758
- isLoading,
759
- error,
760
- onRetry,
761
- retryLabel,
762
- emptyTitle,
763
- emptyDescription,
764
- errorTitle,
765
- errorDescription,
766
- loadingLabel
767
- },
768
- hasChartData(data, chartSeries),
769
- tooltip.cn("h-[320px]", stateClassName)
770
- );
771
- if (chartState) {
772
- return chartState;
773
- }
774
- return /* @__PURE__ */ jsxRuntime.jsx(
775
- ChartContainer,
776
- {
777
- config: chartConfig,
778
- className: tooltip.cn("h-[320px] w-full", className),
779
- ...props,
780
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.BarChart, { data, accessibilityLayer: true, children: [
781
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.CartesianGrid, { vertical: false }) : null,
782
- /* @__PURE__ */ jsxRuntime.jsx(
783
- RechartsPrimitive__namespace.XAxis,
784
- {
785
- dataKey: indexKey,
786
- tickLine: false,
787
- axisLine: false,
788
- tickMargin: 8
789
- }
790
- ),
791
- /* @__PURE__ */ jsxRuntime.jsx(
792
- RechartsPrimitive__namespace.YAxis,
793
- {
794
- tickLine: false,
795
- axisLine: false,
796
- tickMargin: 8,
797
- tickFormatter: valueFormatter
798
- }
799
- ),
800
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {}) }),
801
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
802
- chartSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
803
- RechartsPrimitive__namespace.Bar,
804
- {
805
- dataKey: item.key,
806
- fill: `var(--color-${item.key})`,
807
- radius: [4, 4, 0, 0],
808
- stackId: stacked ? item.stackId || "total" : item.stackId
809
- },
810
- item.key
811
- ))
812
- ] })
813
- }
814
- );
815
- }
816
- function DashboardLineChart({
817
- data,
818
- config,
819
- indexKey = "name",
820
- series,
821
- colors,
822
- showDots = false,
823
- showGrid = true,
824
- showLegend = true,
825
- valueFormatter = formatTick,
826
- isLoading,
827
- error,
828
- onRetry,
829
- retryLabel,
830
- emptyTitle,
831
- emptyDescription,
832
- errorTitle,
833
- errorDescription,
834
- loadingLabel,
835
- stateClassName,
836
- className,
837
- ...props
838
- }) {
839
- const chartSeries = getChartSeries(config, series);
840
- const chartConfig = getChartConfigWithColors(
841
- config,
842
- chartSeries.map((item) => item.key),
843
- colors
844
- );
845
- const chartState = getChartState(
846
- {
847
- isLoading,
848
- error,
849
- onRetry,
850
- retryLabel,
851
- emptyTitle,
852
- emptyDescription,
853
- errorTitle,
854
- errorDescription,
855
- loadingLabel
856
- },
857
- hasChartData(data, chartSeries),
858
- tooltip.cn("h-[320px]", stateClassName)
859
- );
860
- if (chartState) {
861
- return chartState;
862
- }
863
- return /* @__PURE__ */ jsxRuntime.jsx(
864
- ChartContainer,
865
- {
866
- config: chartConfig,
867
- className: tooltip.cn("h-[320px] w-full", className),
868
- ...props,
869
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.LineChart, { data, accessibilityLayer: true, children: [
870
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.CartesianGrid, { vertical: false }) : null,
871
- /* @__PURE__ */ jsxRuntime.jsx(
872
- RechartsPrimitive__namespace.XAxis,
873
- {
874
- dataKey: indexKey,
875
- tickLine: false,
876
- axisLine: false,
877
- tickMargin: 8
878
- }
879
- ),
880
- /* @__PURE__ */ jsxRuntime.jsx(
881
- RechartsPrimitive__namespace.YAxis,
882
- {
883
- tickLine: false,
884
- axisLine: false,
885
- tickMargin: 8,
886
- tickFormatter: valueFormatter
887
- }
888
- ),
889
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { indicator: "line" }) }),
890
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
891
- chartSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
892
- RechartsPrimitive__namespace.Line,
893
- {
894
- type: "monotone",
895
- dataKey: item.key,
896
- stroke: `var(--color-${item.key})`,
897
- strokeWidth: 2,
898
- dot: showDots ? { r: 3, fill: `var(--color-${item.key})` } : false,
899
- activeDot: { r: 5 },
900
- yAxisId: item.yAxisId
901
- },
902
- item.key
903
- ))
904
- ] })
905
- }
906
- );
907
- }
908
- function HorizontalBarChart({
909
- data,
910
- config,
911
- indexKey = "name",
912
- series,
913
- colors,
914
- stacked = false,
915
- categoryWidth = 96,
916
- showGrid = true,
917
- showLegend = true,
918
- valueFormatter = formatTick,
919
- isLoading,
920
- error,
921
- onRetry,
922
- retryLabel,
923
- emptyTitle,
924
- emptyDescription,
925
- errorTitle,
926
- errorDescription,
927
- loadingLabel,
928
- stateClassName,
929
- className,
930
- ...props
931
- }) {
932
- const chartSeries = getChartSeries(config, series);
933
- const chartConfig = getChartConfigWithColors(
934
- config,
935
- chartSeries.map((item) => item.key),
936
- colors
937
- );
938
- const chartState = getChartState(
939
- {
940
- isLoading,
941
- error,
942
- onRetry,
943
- retryLabel,
944
- emptyTitle,
945
- emptyDescription,
946
- errorTitle,
947
- errorDescription,
948
- loadingLabel
949
- },
950
- hasChartData(data, chartSeries),
951
- tooltip.cn("h-[320px]", stateClassName)
952
- );
953
- if (chartState) {
954
- return chartState;
955
- }
956
- return /* @__PURE__ */ jsxRuntime.jsx(
957
- ChartContainer,
958
- {
959
- config: chartConfig,
960
- className: tooltip.cn("h-[320px] w-full", className),
961
- ...props,
962
- children: /* @__PURE__ */ jsxRuntime.jsxs(
963
- RechartsPrimitive__namespace.BarChart,
964
- {
965
- data,
966
- layout: "vertical",
967
- accessibilityLayer: true,
968
- margin: { left: 8, right: 16 },
969
- children: [
970
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.CartesianGrid, { horizontal: false }) : null,
971
- /* @__PURE__ */ jsxRuntime.jsx(
972
- RechartsPrimitive__namespace.XAxis,
973
- {
974
- type: "number",
975
- tickLine: false,
976
- axisLine: false,
977
- tickMargin: 8,
978
- tickFormatter: valueFormatter
979
- }
980
- ),
981
- /* @__PURE__ */ jsxRuntime.jsx(
982
- RechartsPrimitive__namespace.YAxis,
983
- {
984
- dataKey: indexKey,
985
- type: "category",
986
- tickLine: false,
987
- axisLine: false,
988
- tickMargin: 8,
989
- width: categoryWidth
990
- }
991
- ),
992
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {}) }),
993
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
994
- chartSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
995
- RechartsPrimitive__namespace.Bar,
996
- {
997
- dataKey: item.key,
998
- fill: `var(--color-${item.key})`,
999
- radius: [0, 4, 4, 0],
1000
- stackId: stacked ? item.stackId || "total" : item.stackId
1001
- },
1002
- item.key
1003
- ))
1004
- ]
1005
- }
1006
- )
1007
- }
1008
- );
1009
- }
1010
- function InteractiveTimeSeriesChart({
1011
- data,
1012
- config,
1013
- indexKey = "date",
1014
- series,
1015
- colors,
1016
- periods = defaultPeriods,
1017
- defaultPeriod = ((_a) => (_a = periods[1]) == null ? void 0 : _a.value)() || ((_b) => (_b = periods[0]) == null ? void 0 : _b.value)() || "30d",
1018
- defaultSeries,
1019
- filterData = defaultFilterData,
1020
- showGrid = true,
1021
- showLegend = false,
1022
- valueFormatter = formatTick,
1023
- isLoading,
1024
- error,
1025
- onRetry,
1026
- retryLabel,
1027
- emptyTitle,
1028
- emptyDescription,
1029
- errorTitle,
1030
- errorDescription,
1031
- loadingLabel,
1032
- stateClassName,
1033
- className,
1034
- ...props
1035
- }) {
1036
- var _a2;
1037
- const chartSeries = getChartSeries(config, series);
1038
- const chartConfig = getChartConfigWithColors(
1039
- config,
1040
- chartSeries.map((item) => item.key),
1041
- colors
1042
- );
1043
- const [period, setPeriod] = React__namespace.useState(defaultPeriod);
1044
- const [activeSeries, setActiveSeries] = React__namespace.useState(
1045
- defaultSeries || ((_a2 = chartSeries[0]) == null ? void 0 : _a2.key) || ""
1046
- );
1047
- const filteredData = React__namespace.useMemo(
1048
- () => filterData(data, period),
1049
- [data, filterData, period]
1050
- );
1051
- const visibleSeries = chartSeries.length > 1 ? chartSeries.filter((item) => item.key === activeSeries) : chartSeries;
1052
- const chartState = getChartState(
1053
- {
1054
- isLoading,
1055
- error,
1056
- onRetry,
1057
- retryLabel,
1058
- emptyTitle,
1059
- emptyDescription,
1060
- errorTitle,
1061
- errorDescription,
1062
- loadingLabel
1063
- },
1064
- hasChartData(filteredData, visibleSeries),
1065
- tooltip.cn("h-[320px]", stateClassName)
1066
- );
1067
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
1068
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between", children: [
1069
- chartSeries.length > 1 ? /* @__PURE__ */ jsxRuntime.jsx(Tabs, { value: activeSeries, onValueChange: setActiveSeries, children: /* @__PURE__ */ jsxRuntime.jsx(TabsList, { className: "h-10", children: chartSeries.map((item) => {
1070
- var _a3;
1071
- return /* @__PURE__ */ jsxRuntime.jsx(TabsTrigger, { value: item.key, className: "h-10", children: item.label || ((_a3 = config[item.key]) == null ? void 0 : _a3.label) || item.key }, item.key);
1072
- }) }) }) : /* @__PURE__ */ jsxRuntime.jsx("div", {}),
1073
- /* @__PURE__ */ jsxRuntime.jsxs(select.Select, { value: period, onValueChange: setPeriod, children: [
1074
- /* @__PURE__ */ jsxRuntime.jsx(select.SelectTrigger, { className: "w-full sm:w-[160px]", size: "sm", children: /* @__PURE__ */ jsxRuntime.jsx(select.SelectValue, { placeholder: "Period" }) }),
1075
- /* @__PURE__ */ jsxRuntime.jsx(select.SelectContent, { children: periods.map((item) => /* @__PURE__ */ jsxRuntime.jsx(select.SelectItem, { value: item.value, children: item.label }, item.value)) })
1076
- ] })
1077
- ] }),
1078
- chartState || /* @__PURE__ */ jsxRuntime.jsx(
1079
- ChartContainer,
1080
- {
1081
- config: chartConfig,
1082
- className: tooltip.cn("h-[320px] w-full", className),
1083
- ...props,
1084
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.AreaChart, { data: filteredData, accessibilityLayer: true, children: [
1085
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.CartesianGrid, { vertical: false }) : null,
1086
- /* @__PURE__ */ jsxRuntime.jsx(
1087
- RechartsPrimitive__namespace.XAxis,
1088
- {
1089
- dataKey: indexKey,
1090
- tickLine: false,
1091
- axisLine: false,
1092
- tickMargin: 8
1093
- }
1094
- ),
1095
- /* @__PURE__ */ jsxRuntime.jsx(
1096
- RechartsPrimitive__namespace.YAxis,
1097
- {
1098
- tickLine: false,
1099
- axisLine: false,
1100
- tickMargin: 8,
1101
- tickFormatter: valueFormatter
1102
- }
1103
- ),
1104
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { indicator: "line" }) }),
1105
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
1106
- visibleSeries.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
1107
- RechartsPrimitive__namespace.Area,
1108
- {
1109
- type: "monotone",
1110
- dataKey: item.key,
1111
- stroke: `var(--color-${item.key})`,
1112
- fill: `var(--color-${item.key})`,
1113
- fillOpacity: 0.16,
1114
- strokeWidth: 2,
1115
- dot: false
1116
- },
1117
- item.key
1118
- ))
1119
- ] })
1120
- }
1121
- )
1122
- ] });
1123
- }
1124
- function ComboMetricChart({
1125
- data,
1126
- config,
1127
- indexKey = "name",
1128
- series,
1129
- colors,
1130
- showGrid = true,
1131
- showLegend = true,
1132
- valueFormatter = formatTick,
1133
- isLoading,
1134
- error,
1135
- onRetry,
1136
- retryLabel,
1137
- emptyTitle,
1138
- emptyDescription,
1139
- errorTitle,
1140
- errorDescription,
1141
- loadingLabel,
1142
- stateClassName,
1143
- className,
1144
- ...props
1145
- }) {
1146
- const chartSeries = getChartSeries(config, series);
1147
- const chartConfig = getChartConfigWithColors(
1148
- config,
1149
- chartSeries.map((item) => item.key),
1150
- colors
1151
- );
1152
- const chartState = getChartState(
1153
- {
1154
- isLoading,
1155
- error,
1156
- onRetry,
1157
- retryLabel,
1158
- emptyTitle,
1159
- emptyDescription,
1160
- errorTitle,
1161
- errorDescription,
1162
- loadingLabel
1163
- },
1164
- hasChartData(data, chartSeries),
1165
- tooltip.cn("h-[340px]", stateClassName)
1166
- );
1167
- if (chartState) {
1168
- return chartState;
1169
- }
1170
- return /* @__PURE__ */ jsxRuntime.jsx(
1171
- ChartContainer,
1172
- {
1173
- config: chartConfig,
1174
- className: tooltip.cn("h-[340px] w-full", className),
1175
- ...props,
1176
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.ComposedChart, { data, accessibilityLayer: true, children: [
1177
- showGrid ? /* @__PURE__ */ jsxRuntime.jsx(RechartsPrimitive__namespace.CartesianGrid, { vertical: false }) : null,
1178
- /* @__PURE__ */ jsxRuntime.jsx(
1179
- RechartsPrimitive__namespace.XAxis,
1180
- {
1181
- dataKey: indexKey,
1182
- tickLine: false,
1183
- axisLine: false,
1184
- tickMargin: 8
1185
- }
1186
- ),
1187
- /* @__PURE__ */ jsxRuntime.jsx(
1188
- RechartsPrimitive__namespace.YAxis,
1189
- {
1190
- tickLine: false,
1191
- axisLine: false,
1192
- tickMargin: 8,
1193
- tickFormatter: valueFormatter
1194
- }
1195
- ),
1196
- /* @__PURE__ */ jsxRuntime.jsx(ChartTooltip, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, {}) }),
1197
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(ChartLegend, { content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, {}) }) : null,
1198
- chartSeries.map(
1199
- (item) => item.type === "line" ? /* @__PURE__ */ jsxRuntime.jsx(
1200
- RechartsPrimitive__namespace.Line,
1201
- {
1202
- type: "monotone",
1203
- dataKey: item.key,
1204
- stroke: `var(--color-${item.key})`,
1205
- strokeWidth: 2,
1206
- dot: false,
1207
- yAxisId: item.yAxisId
1208
- },
1209
- item.key
1210
- ) : item.type === "area" ? /* @__PURE__ */ jsxRuntime.jsx(
1211
- RechartsPrimitive__namespace.Area,
1212
- {
1213
- type: "monotone",
1214
- dataKey: item.key,
1215
- stroke: `var(--color-${item.key})`,
1216
- fill: `var(--color-${item.key})`,
1217
- fillOpacity: 0.12,
1218
- strokeWidth: 2,
1219
- dot: false,
1220
- yAxisId: item.yAxisId
1221
- },
1222
- item.key
1223
- ) : /* @__PURE__ */ jsxRuntime.jsx(
1224
- RechartsPrimitive__namespace.Bar,
1225
- {
1226
- dataKey: item.key,
1227
- fill: `var(--color-${item.key})`,
1228
- radius: [4, 4, 0, 0],
1229
- yAxisId: item.yAxisId
1230
- },
1231
- item.key
1232
- )
1233
- )
1234
- ] })
1235
- }
1236
- );
1237
- }
1238
- function DonutBreakdownChart({
1239
- data,
1240
- config,
1241
- nameKey = "name",
1242
- valueKey = "value",
1243
- colors,
1244
- centerLabel,
1245
- centerValue,
1246
- showLegend = true,
1247
- isLoading,
1248
- error,
1249
- onRetry,
1250
- retryLabel,
1251
- emptyTitle,
1252
- emptyDescription,
1253
- errorTitle,
1254
- errorDescription,
1255
- loadingLabel,
1256
- stateClassName,
1257
- className,
1258
- ...props
1259
- }) {
1260
- const [activeIndex, setActiveIndex] = React__namespace.useState(0);
1261
- const chartKeys = data.map(
1262
- (entry, index) => String(entry[nameKey] || `segment-${index}`)
1263
- );
1264
- const chartConfig = getChartConfigWithColors(config, chartKeys, colors);
1265
- const chartState = getChartState(
1266
- {
1267
- isLoading,
1268
- error,
1269
- onRetry,
1270
- retryLabel,
1271
- emptyTitle,
1272
- emptyDescription,
1273
- errorTitle,
1274
- errorDescription,
1275
- loadingLabel
1276
- },
1277
- hasPieData(data, nameKey, valueKey),
1278
- tooltip.cn("h-[320px]", stateClassName)
1279
- );
1280
- if (chartState) {
1281
- return chartState;
1282
- }
1283
- return /* @__PURE__ */ jsxRuntime.jsx(
1284
- ChartContainer,
1285
- {
1286
- config: chartConfig,
1287
- className: tooltip.cn("h-[320px] w-full", className),
1288
- ...props,
1289
- children: /* @__PURE__ */ jsxRuntime.jsxs(RechartsPrimitive__namespace.PieChart, { accessibilityLayer: true, children: [
1290
- /* @__PURE__ */ jsxRuntime.jsx(
1291
- ChartTooltip,
1292
- {
1293
- cursor: false,
1294
- content: /* @__PURE__ */ jsxRuntime.jsx(ChartTooltipContent, { hideLabel: true, nameKey })
1295
- }
1296
- ),
1297
- showLegend ? /* @__PURE__ */ jsxRuntime.jsx(
1298
- ChartLegend,
1299
- {
1300
- content: /* @__PURE__ */ jsxRuntime.jsx(ChartLegendContent, { nameKey }),
1301
- verticalAlign: "bottom"
1302
- }
1303
- ) : null,
1304
- /* @__PURE__ */ jsxRuntime.jsxs(
1305
- RechartsPrimitive__namespace.Pie,
1306
- {
1307
- data,
1308
- dataKey: valueKey,
1309
- nameKey,
1310
- innerRadius: "58%",
1311
- outerRadius: "82%",
1312
- paddingAngle: 2,
1313
- activeIndex,
1314
- onMouseEnter: (_, index) => setActiveIndex(index),
1315
- children: [
1316
- data.map((entry, index) => {
1317
- const key = String(entry[nameKey] || `segment-${index}`);
1318
- return /* @__PURE__ */ jsxRuntime.jsx(
1319
- RechartsPrimitive__namespace.Cell,
1320
- {
1321
- fill: `var(--color-${key})`,
1322
- opacity: index === activeIndex ? 1 : 0.72
1323
- },
1324
- key
1325
- );
1326
- }),
1327
- centerValue || centerLabel ? /* @__PURE__ */ jsxRuntime.jsx(
1328
- RechartsPrimitive__namespace.Label,
1329
- {
1330
- position: "center",
1331
- content: ({ viewBox }) => {
1332
- if (!viewBox || !("cx" in viewBox) || !("cy" in viewBox)) {
1333
- return null;
1334
- }
1335
- return /* @__PURE__ */ jsxRuntime.jsxs(
1336
- "text",
1337
- {
1338
- x: viewBox.cx,
1339
- y: viewBox.cy,
1340
- textAnchor: "middle",
1341
- dominantBaseline: "middle",
1342
- children: [
1343
- centerValue ? /* @__PURE__ */ jsxRuntime.jsx(
1344
- "tspan",
1345
- {
1346
- x: viewBox.cx,
1347
- y: viewBox.cy,
1348
- className: "fill-foreground text-2xl font-semibold",
1349
- children: centerValue
1350
- }
1351
- ) : null,
1352
- centerLabel ? /* @__PURE__ */ jsxRuntime.jsx(
1353
- "tspan",
1354
- {
1355
- x: viewBox.cx,
1356
- y: Number(viewBox.cy) + 22,
1357
- className: "fill-muted-foreground text-xs",
1358
- children: centerLabel
1359
- }
1360
- ) : null
1361
- ]
1362
- }
1363
- );
1364
- }
1365
- }
1366
- ) : null
1367
- ]
1368
- }
1369
- )
1370
- ] })
1371
- }
1372
- );
1373
- }
1374
- function Table({ className, ...props }) {
1375
- return /* @__PURE__ */ jsxRuntime.jsx(
1376
- "div",
1377
- {
1378
- "data-slot": "table-container",
1379
- className: "relative w-full overflow-x-auto",
1380
- children: /* @__PURE__ */ jsxRuntime.jsx(
1381
- "table",
1382
- {
1383
- "data-slot": "table",
1384
- className: tooltip.cn("w-full caption-bottom text-sm", className),
1385
- ...props
1386
- }
1387
- )
1388
- }
1389
- );
1390
- }
1391
- function TableHeader({ className, ...props }) {
1392
- return /* @__PURE__ */ jsxRuntime.jsx(
1393
- "thead",
1394
- {
1395
- "data-slot": "table-header",
1396
- className: tooltip.cn("[&_tr]:border-b", className),
1397
- ...props
1398
- }
1399
- );
1400
- }
1401
- function TableBody({ className, ...props }) {
1402
- return /* @__PURE__ */ jsxRuntime.jsx(
1403
- "tbody",
1404
- {
1405
- "data-slot": "table-body",
1406
- className: tooltip.cn("[&_tr:last-child]:border-0", className),
1407
- ...props
1408
- }
1409
- );
1410
- }
1411
- function TableFooter({ className, ...props }) {
1412
- return /* @__PURE__ */ jsxRuntime.jsx(
1413
- "tfoot",
1414
- {
1415
- "data-slot": "table-footer",
1416
- className: tooltip.cn(
1417
- "bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",
1418
- className
1419
- ),
1420
- ...props
1421
- }
1422
- );
1423
- }
1424
- function TableRow({ className, ...props }) {
1425
- return /* @__PURE__ */ jsxRuntime.jsx(
1426
- "tr",
1427
- {
1428
- "data-slot": "table-row",
1429
- className: tooltip.cn(
1430
- "hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",
1431
- className
1432
- ),
1433
- ...props
1434
- }
1435
- );
1436
- }
1437
- function TableHead({ className, ...props }) {
1438
- return /* @__PURE__ */ jsxRuntime.jsx(
1439
- "th",
1440
- {
1441
- "data-slot": "table-head",
1442
- className: tooltip.cn(
1443
- "text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1444
- className
1445
- ),
1446
- ...props
1447
- }
1448
- );
1449
- }
1450
- function TableCell({ className, ...props }) {
1451
- return /* @__PURE__ */ jsxRuntime.jsx(
1452
- "td",
1453
- {
1454
- "data-slot": "table-cell",
1455
- className: tooltip.cn(
1456
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
1457
- className
1458
- ),
1459
- ...props
1460
- }
1461
- );
1462
- }
1463
- function TableCaption({
1464
- className,
1465
- ...props
1466
- }) {
1467
- return /* @__PURE__ */ jsxRuntime.jsx(
1468
- "caption",
1469
- {
1470
- "data-slot": "table-caption",
1471
- className: tooltip.cn("text-muted-foreground mt-4 text-sm", className),
1472
- ...props
1473
- }
1474
- );
1475
- }
1476
- function Dialog({
1477
- ...props
1478
- }) {
1479
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
1480
- }
1481
- function DialogTrigger({
1482
- ...props
1483
- }) {
1484
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Trigger, { "data-slot": "dialog-trigger", ...props });
1485
- }
1486
- function DialogPortal({
1487
- ...props
1488
- }) {
1489
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
1490
- }
1491
- function DialogClose({
1492
- ...props
1493
- }) {
1494
- return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
1495
- }
1496
- const DialogOverlay = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
1497
- DialogPrimitive__namespace.Overlay,
1498
- {
1499
- ref,
1500
- "data-slot": "dialog-overlay",
1501
- className: tooltip.cn(
1502
- "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",
1503
- className
1504
- ),
1505
- ...props
1506
- }
1507
- ));
1508
- DialogOverlay.displayName = DialogPrimitive__namespace.Overlay.displayName;
1509
- const dialogVariants = classVarianceAuthority.cva(
1510
- "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)]",
1511
- {
1512
- variants: {
1513
- size: {
1514
- sm: "max-w-sm",
1515
- md: "max-w-md",
1516
- lg: "max-w-lg",
1517
- xl: "max-w-xl",
1518
- "2xl": "max-w-2xl",
1519
- "3xl": "max-w-3xl",
1520
- "4xl": "max-w-4xl",
1521
- "5xl": "max-w-5xl",
1522
- full: "max-w-[calc(100vw-2rem)] h-[calc(100dvh-2rem)]"
1523
- }
1524
- },
1525
- defaultVariants: {
1526
- size: "lg"
1527
- }
1528
- }
1529
- );
1530
- const DialogContent = React__namespace.forwardRef(({ className, children, size, showClose = true, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
1531
- /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
1532
- /* @__PURE__ */ jsxRuntime.jsxs(
1533
- DialogPrimitive__namespace.Content,
1534
- {
1535
- ref,
1536
- "data-slot": "dialog-content",
1537
- className: tooltip.cn(dialogVariants({ size }), className),
1538
- ...props,
1539
- children: [
1540
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-4 p-6 overflow-y-auto flex-1 min-h-0", children }),
1541
- 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: [
1542
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.XIcon, {}),
1543
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
1544
- ] })
1545
- ]
1546
- }
1547
- )
1548
- ] }));
1549
- DialogContent.displayName = DialogPrimitive__namespace.Content.displayName;
1550
- function DialogHeader({ className, ...props }) {
1551
- return /* @__PURE__ */ jsxRuntime.jsx(
1552
- "div",
1553
- {
1554
- "data-slot": "dialog-header",
1555
- className: tooltip.cn("flex flex-col gap-2 text-left shrink-0", className),
1556
- ...props
1557
- }
1558
- );
1559
- }
1560
- function DialogBody({ className, ...props }) {
1561
- return /* @__PURE__ */ jsxRuntime.jsx(
1562
- "div",
1563
- {
1564
- "data-slot": "dialog-body",
1565
- className: tooltip.cn("flex-1 overflow-y-auto min-h-0 -mx-6 px-6", className),
1566
- ...props
1567
- }
1568
- );
1569
- }
1570
- function DialogFooter({ className, ...props }) {
1571
- return /* @__PURE__ */ jsxRuntime.jsx(
1572
- "div",
1573
- {
1574
- "data-slot": "dialog-footer",
1575
- className: tooltip.cn(
1576
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end shrink-0",
1577
- className
1578
- ),
1579
- ...props
1580
- }
1581
- );
1582
- }
1583
- function DialogTitle({
1584
- className,
1585
- ...props
1586
- }) {
1587
- return /* @__PURE__ */ jsxRuntime.jsx(
1588
- DialogPrimitive__namespace.Title,
1589
- {
1590
- "data-slot": "dialog-title",
1591
- className: tooltip.cn("text-foreground font-semibold leading-tight text-[length:var(--text-h4)]", className),
1592
- ...props
1593
- }
1594
- );
1595
- }
1596
- function DialogDescription({
1597
- className,
1598
- ...props
1599
- }) {
1600
- return /* @__PURE__ */ jsxRuntime.jsx(
1601
- DialogPrimitive__namespace.Description,
1602
- {
1603
- "data-slot": "dialog-description",
1604
- className: tooltip.cn("text-muted-foreground", className),
1605
- ...props
1606
- }
1607
- );
1608
- }
1609
- const Textarea = React__namespace.forwardRef(
1610
- ({ className, size = "md", ...props }, ref) => {
1611
- const sizeClasses = {
1612
- sm: "px-2 py-1 text-sm",
1613
- md: "px-3 py-2 text-base",
1614
- lg: "px-4 py-3 text-base"
1615
- };
1616
- return /* @__PURE__ */ jsxRuntime.jsx(
1617
- "textarea",
1618
- {
1619
- "data-slot": "textarea",
1620
- className: tooltip.cn(
1621
- "flex min-h-16 w-full bg-background rounded-[var(--radius)] border border-border transition-colors outline-none resize-none text-foreground",
1622
- "placeholder:text-muted-foreground",
1623
- "focus:ring-2 focus:ring-primary focus:border-transparent",
1624
- "disabled:cursor-not-allowed disabled:opacity-50",
1625
- sizeClasses[size],
1626
- className
1627
- ),
1628
- ref,
1629
- ...props
1630
- }
1631
- );
1632
- }
1633
- );
1634
- Textarea.displayName = "Textarea";
1635
- function RichTextEditor({
1636
- value,
1637
- onChange,
1638
- placeholder,
1639
- className,
1640
- actionButton,
1641
- allowSearch = true,
1642
- allowLinks = true,
1643
- allowUndoRedo = true,
1644
- allowHeadings = true,
1645
- allowFormatting = true,
1646
- allowAlignment = true,
1647
- allowLists = true,
1648
- showWordCount = true,
1649
- showCharacterCount = true,
1650
- disabled = false,
1651
- readOnly = false,
1652
- onFocus,
1653
- onBlur,
1654
- minHeight,
1655
- maxHeight
1656
- }) {
1657
- const isEditable = !disabled && !readOnly;
1658
- const showToolbar = isEditable;
1659
- const editorRef = React.useRef(null);
1660
- const [activeFormats, setActiveFormats] = React.useState({});
1661
- const [isSearchOpen, setIsSearchOpen] = React.useState(false);
1662
- const [searchQuery, setSearchQuery] = React.useState("");
1663
- const [linkUrl, setLinkUrl] = React.useState("https://");
1664
- const [isLinkOpen, setIsLinkOpen] = React.useState(false);
1665
- const searchInputRef = React.useRef(null);
1666
- const linkInputRef = React.useRef(null);
1667
- const savedSelection = React.useRef(null);
1668
- const findParentTag = (node, tagName) => {
1669
- let current = node;
1670
- while (current && current !== editorRef.current) {
1671
- if (current.nodeName === tagName) return current;
1672
- current = current.parentNode;
1673
- }
1674
- return null;
1675
- };
1676
- const updateActiveFormats = () => {
1677
- let formatBlock = "";
1678
- try {
1679
- formatBlock = document.queryCommandValue("formatBlock");
1680
- } catch (e) {
1681
- }
1682
- const selection = window.getSelection();
1683
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
1684
- const focusNode = selection == null ? void 0 : selection.focusNode;
1685
- setActiveFormats({
1686
- bold: document.queryCommandState("bold"),
1687
- italic: document.queryCommandState("italic"),
1688
- underline: document.queryCommandState("underline"),
1689
- justifyLeft: document.queryCommandState("justifyLeft"),
1690
- justifyCenter: document.queryCommandState("justifyCenter"),
1691
- justifyRight: document.queryCommandState("justifyRight"),
1692
- insertUnorderedList: document.queryCommandState("insertUnorderedList"),
1693
- insertOrderedList: document.queryCommandState("insertOrderedList"),
1694
- link: !!(findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A")),
1695
- h1: formatBlock === "h1" || formatBlock === "H1",
1696
- h2: formatBlock === "h2" || formatBlock === "H2",
1697
- h3: formatBlock === "h3" || formatBlock === "H3",
1698
- p: formatBlock === "p" || formatBlock === "P" || formatBlock === "div" || formatBlock === "DIV" || formatBlock === ""
1699
- });
1700
- };
1701
- const getCurrentBlockLabel = () => {
1702
- if (activeFormats.h1) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1703
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 mr-1 shrink-0" }),
1704
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 1" })
1705
- ] });
1706
- if (activeFormats.h2) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1707
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 mr-1 shrink-0" }),
1708
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 2" })
1709
- ] });
1710
- if (activeFormats.h3) return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1711
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 mr-1 shrink-0" }),
1712
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Título 3" })
1713
- ] });
1714
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1715
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 mr-1 shrink-0" }),
1716
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: "Parágrafo" })
1717
- ] });
1718
- };
1719
- React.useEffect(() => {
1720
- if (editorRef.current && editorRef.current.innerHTML !== value) {
1721
- editorRef.current.innerHTML = value;
1722
- }
1723
- const handleSelectionChange = () => {
1724
- if (document.activeElement === editorRef.current) {
1725
- updateActiveFormats();
1726
- }
1727
- };
1728
- document.addEventListener("selectionchange", handleSelectionChange);
1729
- return () => document.removeEventListener("selectionchange", handleSelectionChange);
1730
- }, []);
1731
- const execCommand = (command, value2 = "") => {
1732
- var _a;
1733
- document.execCommand(command, false, value2);
1734
- updateActiveFormats();
1735
- (_a = editorRef.current) == null ? void 0 : _a.focus();
1736
- handleInput();
1737
- };
1738
- const handleInput = () => {
1739
- if (editorRef.current) {
1740
- onChange == null ? void 0 : onChange(editorRef.current.innerHTML);
1741
- updateActiveFormats();
1742
- }
1743
- };
1744
- const getWordCount = () => {
1745
- var _a;
1746
- const text = ((_a = editorRef.current) == null ? void 0 : _a.innerText) || "";
1747
- return text.trim() ? text.trim().split(/\s+/).length : 0;
1748
- };
1749
- const getCharacterCount = () => {
1750
- var _a;
1751
- const text = ((_a = editorRef.current) == null ? void 0 : _a.innerText) || "";
1752
- return text.trim() ? text.length : 0;
1753
- };
1754
- const performSearch = (text, backward = false) => {
1755
- var _a, _b;
1756
- if (!text || !editorRef.current) return;
1757
- const editor = editorRef.current;
1758
- const selection = window.getSelection();
1759
- if (!selection) return;
1760
- const walker = document.createTreeWalker(editor, NodeFilter.SHOW_TEXT);
1761
- const segments = [];
1762
- let offset = 0;
1763
- let node;
1764
- while (node = walker.nextNode()) {
1765
- segments.push({ node, start: offset });
1766
- offset += node.length;
1767
- }
1768
- const fullText = segments.reduce((acc, s) => acc + (s.node.textContent ?? ""), "");
1769
- let searchFrom = 0;
1770
- if (selection.rangeCount > 0) {
1771
- const range2 = selection.getRangeAt(0);
1772
- if (editor.contains(range2.startContainer)) {
1773
- const seg = segments.find((s) => s.node === range2.startContainer);
1774
- if (seg) {
1775
- searchFrom = backward ? seg.start + range2.startOffset - 1 : seg.start + range2.endOffset;
1776
- }
1777
- }
1778
- }
1779
- const lowerFull = fullText.toLowerCase();
1780
- const lowerQuery = text.toLowerCase();
1781
- let matchStart = -1;
1782
- if (backward) {
1783
- matchStart = lowerFull.lastIndexOf(lowerQuery, Math.max(0, searchFrom));
1784
- if (matchStart === -1) matchStart = lowerFull.lastIndexOf(lowerQuery);
1785
- } else {
1786
- matchStart = lowerFull.indexOf(lowerQuery, searchFrom);
1787
- if (matchStart === -1) matchStart = lowerFull.indexOf(lowerQuery);
1788
- }
1789
- if (matchStart === -1) return;
1790
- const matchEnd = matchStart + text.length;
1791
- const range = document.createRange();
1792
- let startSet = false;
1793
- let endSet = false;
1794
- for (let i = 0; i < segments.length && !endSet; i++) {
1795
- const seg = segments[i];
1796
- const segEnd = seg.start + seg.node.length;
1797
- if (!startSet && matchStart < segEnd && matchStart >= seg.start) {
1798
- range.setStart(seg.node, matchStart - seg.start);
1799
- startSet = true;
1800
- }
1801
- if (startSet && matchEnd <= segEnd) {
1802
- range.setEnd(seg.node, matchEnd - seg.start);
1803
- endSet = true;
1804
- }
1805
- }
1806
- if (startSet && endSet) {
1807
- selection.removeAllRanges();
1808
- selection.addRange(range);
1809
- (_b = (_a = range.startContainer.parentElement) == null ? void 0 : _a.scrollIntoView) == null ? void 0 : _b.call(_a, { block: "nearest" });
1810
- }
1811
- };
1812
- const handleCreateLink = () => {
1813
- if (savedSelection.current) {
1814
- const selection2 = window.getSelection();
1815
- selection2 == null ? void 0 : selection2.removeAllRanges();
1816
- selection2 == null ? void 0 : selection2.addRange(savedSelection.current);
1817
- }
1818
- const selection = window.getSelection();
1819
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
1820
- const existingLink = findParentTag(anchorNode || null, "A");
1821
- if (existingLink) {
1822
- if (linkUrl) {
1823
- existingLink.setAttribute("href", linkUrl);
1824
- existingLink.setAttribute("target", "_blank");
1825
- existingLink.setAttribute("rel", "noopener noreferrer");
1826
- existingLink.style.color = "hsl(var(--primary))";
1827
- existingLink.style.textDecoration = "underline";
1828
- existingLink.style.cursor = "pointer";
1829
- }
1830
- handleInput();
1831
- setIsLinkOpen(false);
1832
- savedSelection.current = null;
1833
- return;
1834
- }
1835
- if (!selection || selection.rangeCount === 0 || selection.isCollapsed) {
1836
- return;
1837
- }
1838
- if (linkUrl) {
1839
- execCommand("createLink", linkUrl);
1840
- setTimeout(() => {
1841
- var _a;
1842
- const anchor = findParentTag(((_a = window.getSelection()) == null ? void 0 : _a.anchorNode) || null, "A");
1843
- if (anchor) {
1844
- anchor.setAttribute("target", "_blank");
1845
- anchor.setAttribute("rel", "noopener noreferrer");
1846
- anchor.style.color = "hsl(var(--primary))";
1847
- anchor.style.textDecoration = "underline";
1848
- anchor.style.cursor = "pointer";
1849
- }
1850
- handleInput();
1851
- }, 10);
1852
- setIsLinkOpen(false);
1853
- savedSelection.current = null;
1854
- }
1855
- };
1856
- const handleUnlink = () => {
1857
- const selection = window.getSelection();
1858
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
1859
- const existingLink = findParentTag(anchorNode || null, "A");
1860
- if (existingLink) {
1861
- const parent = existingLink.parentNode;
1862
- while (existingLink.firstChild) {
1863
- parent == null ? void 0 : parent.insertBefore(existingLink.firstChild, existingLink);
1864
- }
1865
- parent == null ? void 0 : parent.removeChild(existingLink);
1866
- handleInput();
1867
- } else {
1868
- execCommand("unlink");
1869
- }
1870
- };
1871
- const onLinkPopoverOpenChange = (open) => {
1872
- if (open) {
1873
- const selection = window.getSelection();
1874
- const anchorNode = selection == null ? void 0 : selection.anchorNode;
1875
- const focusNode = selection == null ? void 0 : selection.focusNode;
1876
- const existingLink = findParentTag(anchorNode || null, "A") || findParentTag(focusNode || null, "A");
1877
- if (existingLink) {
1878
- setLinkUrl(existingLink.getAttribute("href") || "https://");
1879
- } else {
1880
- setLinkUrl("https://");
1881
- }
1882
- if (selection && selection.rangeCount > 0 && (!selection.isCollapsed || existingLink)) {
1883
- savedSelection.current = selection.getRangeAt(0).cloneRange();
1884
- } else {
1885
- savedSelection.current = null;
1886
- }
1887
- setTimeout(() => {
1888
- var _a;
1889
- return (_a = linkInputRef.current) == null ? void 0 : _a.focus();
1890
- }, 100);
1891
- }
1892
- setIsLinkOpen(open);
1893
- };
1894
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: tooltip.cn("flex flex-col h-full w-full bg-background sm:border border-border sm:shadow-sm sm:rounded-lg overflow-hidden", disabled && "opacity-50 pointer-events-none", className), children: [
1895
- /* @__PURE__ */ jsxRuntime.jsx("style", { children: `
1896
- [contenteditable]:empty:before {
1897
- content: attr(data-placeholder);
1898
- color: hsl(var(--muted-foreground));
1899
- pointer-events: none;
1900
- display: block;
1901
- }
1902
- .prose-editor ul {
1903
- list-style-type: disc !important;
1904
- padding-left: 1.5rem !important;
1905
- margin-top: 0.5rem !important;
1906
- margin-bottom: 0.5rem !important;
1907
- }
1908
- .prose-editor ol {
1909
- list-style-type: decimal !important;
1910
- padding-left: 1.5rem !important;
1911
- margin-top: 0.5rem !important;
1912
- margin-bottom: 0.5rem !important;
1913
- }
1914
- .prose-editor b, .prose-editor strong {
1915
- font-weight: 600 !important;
1916
- }
1917
- .prose-editor i, .prose-editor em {
1918
- font-style: italic !important;
1919
- }
1920
- .prose-editor u {
1921
- text-decoration: underline !important;
1922
- }
1923
- .prose-editor h1 {
1924
- font-size: 2.25rem !important;
1925
- font-weight: 700 !important;
1926
- margin-bottom: 1.25rem !important;
1927
- line-height: 1.2 !important;
1928
- margin-top: 2rem !important;
1929
- color: hsl(var(--foreground));
1930
- }
1931
- .prose-editor h2 {
1932
- font-size: 1.75rem !important;
1933
- font-weight: 600 !important;
1934
- margin-bottom: 1rem !important;
1935
- margin-top: 1.5rem !important;
1936
- color: hsl(var(--foreground));
1937
- }
1938
- .prose-editor h3 {
1939
- font-size: 1.35rem !important;
1940
- font-weight: 600 !important;
1941
- margin-bottom: 0.75rem !important;
1942
- margin-top: 1.25rem !important;
1943
- color: hsl(var(--foreground));
1944
- }
1945
- .prose-editor p {
1946
- margin-bottom: 1rem !important;
1947
- line-height: 1.6 !important;
1948
- }
1949
- .prose-editor a {
1950
- color: var(--info) !important;
1951
- text-decoration: underline !important;
1952
- cursor: pointer !important;
1953
- }
1954
- .prose-editor h1:first-child, .prose-editor h2:first-child, .prose-editor h3:first-child, .prose-editor p:first-child {
1955
- margin-top: 0 !important;
1956
- }
1957
- .prose-editor {
1958
- outline: none !important;
1959
- }
1960
- ` }),
1961
- 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: [
1962
- allowUndoRedo && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1963
- /* @__PURE__ */ jsxRuntime.jsx(
1964
- tooltip.Button,
1965
- {
1966
- variant: "ghost",
1967
- size: "icon",
1968
- className: "h-8 w-8 text-muted-foreground",
1969
- onClick: () => execCommand("undo"),
1970
- title: "Desfazer",
1971
- "aria-label": "Desfazer",
1972
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Undo, { className: "w-4 h-4" })
1973
- }
1974
- ),
1975
- /* @__PURE__ */ jsxRuntime.jsx(
1976
- tooltip.Button,
1977
- {
1978
- variant: "ghost",
1979
- size: "icon",
1980
- className: "h-8 w-8 text-muted-foreground",
1981
- onClick: () => execCommand("redo"),
1982
- title: "Refazer",
1983
- "aria-label": "Refazer",
1984
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Redo, { className: "w-4 h-4" })
1985
- }
1986
- ),
1987
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
1988
- ] }),
1989
- allowHeadings && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1990
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenu, { modal: false, children: [
1991
- /* @__PURE__ */ jsxRuntime.jsx(dropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(tooltip.Button, { variant: "ghost", size: "sm", className: "h-8 gap-0 text-muted-foreground w-[120px] justify-start px-2", children: [
1992
- getCurrentBlockLabel(),
1993
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-3 h-3 ml-auto opacity-50 shrink-0" })
1994
- ] }) }),
1995
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuContent, { align: "start", className: "w-[160px]", style: { zIndex: 9999 }, children: [
1996
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "P"), className: "gap-2", children: [
1997
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4 text-muted-foreground" }),
1998
- " Parágrafo"
1999
- ] }),
2000
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H1"), className: "gap-2", children: [
2001
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading1, { className: "w-4 h-4 text-muted-foreground" }),
2002
- " Título 1"
2003
- ] }),
2004
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H2"), className: "gap-2", children: [
2005
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading2, { className: "w-4 h-4 text-muted-foreground" }),
2006
- " Título 2"
2007
- ] }),
2008
- /* @__PURE__ */ jsxRuntime.jsxs(dropdownMenu.DropdownMenuItem, { onPointerDown: (e) => e.preventDefault(), onClick: () => execCommand("formatBlock", "H3"), className: "gap-2", children: [
2009
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Heading3, { className: "w-4 h-4 text-muted-foreground" }),
2010
- " Título 3"
2011
- ] })
2012
- ] })
2013
- ] }),
2014
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2015
- ] }),
2016
- allowFormatting && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2017
- /* @__PURE__ */ jsxRuntime.jsx(
2018
- tooltip.Button,
2019
- {
2020
- variant: "ghost",
2021
- size: "icon",
2022
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.bold && "bg-muted text-foreground"),
2023
- onClick: () => execCommand("bold"),
2024
- title: "Negrito",
2025
- "aria-label": "Negrito",
2026
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: "w-4 h-4" })
2027
- }
2028
- ),
2029
- /* @__PURE__ */ jsxRuntime.jsx(
2030
- tooltip.Button,
2031
- {
2032
- variant: "ghost",
2033
- size: "icon",
2034
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.italic && "bg-muted text-foreground"),
2035
- onClick: () => execCommand("italic"),
2036
- title: "Itálico",
2037
- "aria-label": "Itálico",
2038
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: "w-4 h-4" })
2039
- }
2040
- ),
2041
- /* @__PURE__ */ jsxRuntime.jsx(
2042
- tooltip.Button,
2043
- {
2044
- variant: "ghost",
2045
- size: "icon",
2046
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.underline && "bg-muted text-foreground"),
2047
- onClick: () => execCommand("underline"),
2048
- title: "Sublinhado",
2049
- "aria-label": "Sublinhado",
2050
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: "w-4 h-4" })
2051
- }
2052
- ),
2053
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2054
- ] }),
2055
- allowAlignment && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2056
- /* @__PURE__ */ jsxRuntime.jsx(
2057
- tooltip.Button,
2058
- {
2059
- variant: "ghost",
2060
- size: "icon",
2061
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyLeft && "bg-muted text-foreground"),
2062
- onClick: () => execCommand("justifyLeft"),
2063
- title: "Alinhar à esquerda",
2064
- "aria-label": "Alinhar à esquerda",
2065
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignLeft, { className: "w-4 h-4" })
2066
- }
2067
- ),
2068
- /* @__PURE__ */ jsxRuntime.jsx(
2069
- tooltip.Button,
2070
- {
2071
- variant: "ghost",
2072
- size: "icon",
2073
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyCenter && "bg-muted text-foreground"),
2074
- onClick: () => execCommand("justifyCenter"),
2075
- title: "Centralizar",
2076
- "aria-label": "Centralizar",
2077
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignCenter, { className: "w-4 h-4" })
2078
- }
2079
- ),
2080
- /* @__PURE__ */ jsxRuntime.jsx(
2081
- tooltip.Button,
2082
- {
2083
- variant: "ghost",
2084
- size: "icon",
2085
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.justifyRight && "bg-muted text-foreground"),
2086
- onClick: () => execCommand("justifyRight"),
2087
- title: "Alinhar à direita",
2088
- "aria-label": "Alinhar à direita",
2089
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlignRight, { className: "w-4 h-4" })
2090
- }
2091
- ),
2092
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2093
- ] }),
2094
- allowLists && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2095
- /* @__PURE__ */ jsxRuntime.jsx(
2096
- tooltip.Button,
2097
- {
2098
- variant: "ghost",
2099
- size: "icon",
2100
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.insertUnorderedList && "bg-muted text-foreground"),
2101
- onClick: () => execCommand("insertUnorderedList"),
2102
- title: "Lista com marcadores",
2103
- "aria-label": "Lista com marcadores",
2104
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "w-4 h-4" })
2105
- }
2106
- ),
2107
- /* @__PURE__ */ jsxRuntime.jsx(
2108
- tooltip.Button,
2109
- {
2110
- variant: "ghost",
2111
- size: "icon",
2112
- className: tooltip.cn("h-8 w-8 text-muted-foreground", activeFormats.insertOrderedList && "bg-muted text-foreground"),
2113
- onClick: () => execCommand("insertOrderedList"),
2114
- title: "Lista numerada",
2115
- "aria-label": "Lista numerada",
2116
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "w-4 h-4" })
2117
- }
2118
- ),
2119
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2120
- ] }),
2121
- allowLinks && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2122
- /* @__PURE__ */ jsxRuntime.jsxs(input.Popover, { open: isLinkOpen, onOpenChange: onLinkPopoverOpenChange, modal: false, children: [
2123
- /* @__PURE__ */ jsxRuntime.jsx(input.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
2124
- tooltip.Button,
2125
- {
2126
- variant: "ghost",
2127
- size: "icon",
2128
- className: tooltip.cn("h-8 w-8 text-muted-foreground", (activeFormats.link || isLinkOpen) && "bg-muted text-foreground"),
2129
- title: "Inserir link",
2130
- "aria-label": "Inserir link",
2131
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "w-4 h-4" })
2132
- }
2133
- ) }),
2134
- /* @__PURE__ */ jsxRuntime.jsx(input.PopoverContent, { className: "w-80 p-3", align: "start", style: { zIndex: 9999 }, children: !savedSelection.current && !activeFormats.link ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground py-1", children: "Selecione um texto para criar um link." }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
2135
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-medium", children: activeFormats.link ? "Editar Link" : "Inserir Link" }),
2136
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2", children: [
2137
- /* @__PURE__ */ jsxRuntime.jsx(
2138
- input.Input,
2139
- {
2140
- ref: linkInputRef,
2141
- placeholder: "https://...",
2142
- value: linkUrl,
2143
- onChange: (e) => setLinkUrl(e.target.value),
2144
- onKeyDown: (e) => e.key === "Enter" && handleCreateLink(),
2145
- className: "h-8 text-xs"
2146
- }
2147
- ),
2148
- /* @__PURE__ */ jsxRuntime.jsx(tooltip.Button, { size: "sm", className: "h-8", onClick: handleCreateLink, children: "Aplicar" })
2149
- ] })
2150
- ] }) })
2151
- ] }),
2152
- /* @__PURE__ */ jsxRuntime.jsx(
2153
- tooltip.Button,
2154
- {
2155
- variant: "ghost",
2156
- size: "icon",
2157
- className: "h-8 w-8 text-muted-foreground",
2158
- onClick: handleUnlink,
2159
- title: "Remover link",
2160
- "aria-label": "Remover link",
2161
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
2162
- }
2163
- ),
2164
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-6 bg-border mx-1 hidden sm:block" })
2165
- ] }),
2166
- (allowFormatting || allowHeadings || allowAlignment || allowLists || allowLinks) && /* @__PURE__ */ jsxRuntime.jsx(
2167
- tooltip.Button,
2168
- {
2169
- variant: "ghost",
2170
- size: "icon",
2171
- className: "h-8 w-8 text-muted-foreground",
2172
- onClick: () => execCommand("removeFormat"),
2173
- title: "Limpar formatação",
2174
- "aria-label": "Limpar formatação",
2175
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Type, { className: "w-4 h-4" })
2176
- }
2177
- ),
2178
- allowSearch && /* @__PURE__ */ jsxRuntime.jsx(
2179
- tooltip.Button,
2180
- {
2181
- variant: "ghost",
2182
- size: "icon",
2183
- className: tooltip.cn("h-8 w-8 text-muted-foreground", isSearchOpen && "bg-muted text-foreground"),
2184
- onClick: () => {
2185
- setIsSearchOpen(!isSearchOpen);
2186
- if (!isSearchOpen) setTimeout(() => {
2187
- var _a;
2188
- return (_a = searchInputRef.current) == null ? void 0 : _a.focus();
2189
- }, 100);
2190
- },
2191
- title: "Buscar",
2192
- "aria-label": "Buscar",
2193
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "w-4 h-4" })
2194
- }
2195
- ),
2196
- actionButton && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
2197
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
2198
- actionButton
2199
- ] })
2200
- ] }),
2201
- isSearchOpen && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-3 py-1.5 border-b border-border bg-muted/20 flex items-center gap-2", children: [
2202
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 max-w-sm", children: [
2203
- /* @__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" }),
2204
- /* @__PURE__ */ jsxRuntime.jsx(
2205
- input.Input,
2206
- {
2207
- ref: searchInputRef,
2208
- placeholder: "Buscar no texto...",
2209
- value: searchQuery,
2210
- onChange: (e) => setSearchQuery(e.target.value),
2211
- onKeyDown: (e) => {
2212
- if (e.key === "Enter") {
2213
- e.preventDefault();
2214
- performSearch(searchQuery, e.shiftKey);
2215
- }
2216
- if (e.key === "Escape") {
2217
- setIsSearchOpen(false);
2218
- }
2219
- },
2220
- className: "h-8 pl-8 text-xs bg-background"
2221
- }
2222
- )
2223
- ] }),
2224
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-1", children: [
2225
- /* @__PURE__ */ jsxRuntime.jsx(
2226
- tooltip.Button,
2227
- {
2228
- variant: "ghost",
2229
- size: "icon",
2230
- className: "h-7 w-7",
2231
- onMouseDown: (e) => e.preventDefault(),
2232
- onClick: () => performSearch(searchQuery, true),
2233
- title: "Anterior",
2234
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { className: "w-4 h-4" })
2235
- }
2236
- ),
2237
- /* @__PURE__ */ jsxRuntime.jsx(
2238
- tooltip.Button,
2239
- {
2240
- variant: "ghost",
2241
- size: "icon",
2242
- className: "h-7 w-7",
2243
- onMouseDown: (e) => e.preventDefault(),
2244
- onClick: () => performSearch(searchQuery, false),
2245
- title: "Próximo",
2246
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "w-4 h-4" })
2247
- }
2248
- ),
2249
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-4 bg-border mx-1" }),
2250
- /* @__PURE__ */ jsxRuntime.jsx(
2251
- tooltip.Button,
2252
- {
2253
- variant: "ghost",
2254
- size: "icon",
2255
- className: "h-7 w-7 text-muted-foreground hover:text-foreground",
2256
- onClick: () => setIsSearchOpen(false),
2257
- title: "Fechar busca",
2258
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
2259
- }
2260
- )
2261
- ] }),
2262
- /* @__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" })
2263
- ] }),
2264
- /* @__PURE__ */ jsxRuntime.jsx(
2265
- "div",
2266
- {
2267
- className: "flex-1 overflow-y-auto p-4 sm:p-8 bg-background scrollbar-thin",
2268
- style: { minHeight, maxHeight },
2269
- children: /* @__PURE__ */ jsxRuntime.jsx(
2270
- "div",
2271
- {
2272
- ref: editorRef,
2273
- contentEditable: isEditable,
2274
- onInput: handleInput,
2275
- onSelect: isEditable ? updateActiveFormats : void 0,
2276
- onFocus: () => {
2277
- updateActiveFormats();
2278
- onFocus == null ? void 0 : onFocus();
2279
- },
2280
- onBlur,
2281
- className: "prose-editor min-h-full max-w-none focus:outline-none",
2282
- "data-placeholder": placeholder
2283
- }
2284
- )
2285
- }
2286
- ),
2287
- (showWordCount || showCharacterCount) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "px-4 py-2 border-t border-border bg-muted/20 flex items-center justify-between", children: [
2288
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-[10px] sm:text-xs text-muted-foreground font-medium uppercase tracking-wider flex items-center gap-2", children: [
2289
- showWordCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2290
- getWordCount(),
2291
- " ",
2292
- getWordCount() === 1 ? "palavra" : "palavras"
2293
- ] }),
2294
- showWordCount && showCharacterCount && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground/40", children: "•" }),
2295
- showCharacterCount && /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
2296
- getCharacterCount(),
2297
- " ",
2298
- getCharacterCount() === 1 ? "caractere" : "caracteres"
2299
- ] })
2300
- ] }),
2301
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-[10px] sm:text-xs text-muted-foreground/60 italic", children: "Auto-save ativo" })
2302
- ] })
2303
- ] });
2304
- }
2305
- exports.Alert = Alert;
2306
- exports.AlertDescription = AlertDescription;
2307
- exports.AlertTitle = AlertTitle;
2308
- exports.Card = Card;
2309
- exports.CardAction = CardAction;
2310
- exports.CardContent = CardContent;
2311
- exports.CardDescription = CardDescription;
2312
- exports.CardFooter = CardFooter;
2313
- exports.CardHeader = CardHeader;
2314
- exports.CardTitle = CardTitle;
2315
- exports.ChartCard = ChartCard;
2316
- exports.ChartContainer = ChartContainer;
2317
- exports.ChartLegend = ChartLegend;
2318
- exports.ChartLegendContent = ChartLegendContent;
2319
- exports.ChartStyle = ChartStyle;
2320
- exports.ChartTooltip = ChartTooltip;
2321
- exports.ChartTooltipContent = ChartTooltipContent;
2322
- exports.ComboMetricChart = ComboMetricChart;
2323
- exports.DashboardBarChart = DashboardBarChart;
2324
- exports.DashboardLineChart = DashboardLineChart;
2325
- exports.Dialog = Dialog;
2326
- exports.DialogBody = DialogBody;
2327
- exports.DialogClose = DialogClose;
2328
- exports.DialogContent = DialogContent;
2329
- exports.DialogDescription = DialogDescription;
2330
- exports.DialogFooter = DialogFooter;
2331
- exports.DialogHeader = DialogHeader;
2332
- exports.DialogOverlay = DialogOverlay;
2333
- exports.DialogPortal = DialogPortal;
2334
- exports.DialogTitle = DialogTitle;
2335
- exports.DialogTrigger = DialogTrigger;
2336
- exports.DonutBreakdownChart = DonutBreakdownChart;
2337
- exports.Empty = Empty;
2338
- exports.EmptyAction = EmptyAction;
2339
- exports.EmptyDescription = EmptyDescription;
2340
- exports.EmptyIcon = EmptyIcon;
2341
- exports.EmptyImage = EmptyImage;
2342
- exports.EmptyTitle = EmptyTitle;
2343
- exports.HorizontalBarChart = HorizontalBarChart;
2344
- exports.InteractiveTimeSeriesChart = InteractiveTimeSeriesChart;
2345
- exports.RichTextEditor = RichTextEditor;
2346
- exports.Skeleton = Skeleton;
2347
- exports.Table = Table;
2348
- exports.TableBody = TableBody;
2349
- exports.TableCaption = TableCaption;
2350
- exports.TableCell = TableCell;
2351
- exports.TableFooter = TableFooter;
2352
- exports.TableHead = TableHead;
2353
- exports.TableHeader = TableHeader;
2354
- exports.TableRow = TableRow;
2355
- exports.Tabs = Tabs;
2356
- exports.TabsContent = TabsContent;
2357
- exports.TabsList = TabsList;
2358
- exports.TabsTrigger = TabsTrigger;
2359
- exports.Textarea = Textarea;