xertica-ui 2.5.2 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (577) hide show
  1. package/CHANGELOG.md +687 -656
  2. package/README.md +482 -482
  3. package/assets/xertica-logo.svg +37 -37
  4. package/assets/xertica-x-logo.svg +20 -20
  5. package/bin/cli.ts +1293 -1256
  6. package/bin/generate-tokens.ts +256 -262
  7. package/bin/language-config.test.ts +32 -0
  8. package/bin/language-config.ts +36 -11
  9. package/components/Introduction.mdx +121 -121
  10. package/components/assistant/code-block/CodeBlock.tsx +7 -6
  11. package/components/assistant/code-block/code-block.mdx +38 -38
  12. package/components/assistant/code-block/code-block.test.tsx +2 -1
  13. package/components/assistant/formatted-document/FormattedDocument.tsx +3 -0
  14. package/components/assistant/formatted-document/formatted-document.mdx +31 -31
  15. package/components/assistant/formatted-document/formatted-document.test.tsx +5 -4
  16. package/components/assistant/markdown-message/MarkdownMessage.tsx +1 -1
  17. package/components/assistant/markdown-message/markdown-message.mdx +44 -44
  18. package/components/assistant/modern-chat-input/modern-chat-input.mdx +71 -71
  19. package/components/assistant/modern-chat-input/modern-chat-input.test.tsx +3 -2
  20. package/components/assistant/xertica-assistant/parts/AssistantMessageBubble.tsx +1 -1
  21. package/components/assistant/xertica-assistant/types.ts +3 -2
  22. package/components/assistant/xertica-assistant/use-assistant.ts +5 -4
  23. package/components/assistant/xertica-assistant/xertica-assistant.mdx +66 -66
  24. package/components/assistant/xertica-assistant/xertica-assistant.test.tsx +2 -1
  25. package/components/blocks/card-patterns/card-patterns.mdx +123 -123
  26. package/components/brand/branding/branding.mdx +27 -27
  27. package/components/brand/language-selector/language-selector.mdx +126 -126
  28. package/components/brand/theme-toggle/theme-toggle.mdx +47 -47
  29. package/components/brand/theme-toggle/theme-toggle.test.tsx +6 -2
  30. package/components/brand/xertica-logo/xertica-logo.mdx +56 -56
  31. package/components/brand/xertica-orbe/xertica-orbe.mdx +38 -38
  32. package/components/brand/xertica-provider/XerticaProvider.tsx +112 -112
  33. package/components/brand/xertica-provider/xertica-provider.mdx +61 -61
  34. package/components/brand/xertica-provider/xertica-provider.test.tsx +25 -13
  35. package/components/brand/xertica-xlogo/xertica-xlogo.mdx +55 -55
  36. package/components/examples/DrawingMapExample.tsx +1 -4
  37. package/components/layout/header/header.mdx +117 -117
  38. package/components/layout/header/header.test.tsx +2 -1
  39. package/components/layout/sidebar/sidebar.mdx +99 -99
  40. package/components/layout/sidebar/sidebar.stories.tsx +1033 -1033
  41. package/components/layout/sidebar/sidebar.test.tsx +2 -1
  42. package/components/layout/sidebar/sidebar.tsx +1509 -1501
  43. package/components/media/audio-player/AudioPlayer.mdx +67 -67
  44. package/components/media/audio-player/AudioPlayer.test.tsx +2 -1
  45. package/components/media/floating-media-wrapper.mdx +74 -74
  46. package/components/media/video-player/VideoPlayer.mdx +102 -102
  47. package/components/media/video-player/VideoPlayer.test.tsx +3 -2
  48. package/components/pages/forgot-password-page/ForgotPasswordPage.tsx +188 -188
  49. package/components/pages/forgot-password-page/forgot-password-page.mdx +60 -60
  50. package/components/pages/forgot-password-page/forgot-password-page.test.tsx +2 -1
  51. package/components/pages/home-content/HomeContent.tsx +2 -3
  52. package/components/pages/home-content/home-content.mdx +62 -62
  53. package/components/pages/home-page/HomePage.stories.tsx +8 -15
  54. package/components/pages/home-page/home-page.mdx +53 -53
  55. package/components/pages/home-page/home-page.test.tsx +2 -1
  56. package/components/pages/login-page/LoginPage.mdx +31 -31
  57. package/components/pages/login-page/LoginPage.tsx +218 -218
  58. package/components/pages/login-page/login-page.test.tsx +2 -1
  59. package/components/pages/reset-password-page/ResetPasswordPage.tsx +243 -243
  60. package/components/pages/reset-password-page/reset-password-page.mdx +63 -63
  61. package/components/pages/template-content/TemplateContent.tsx +2 -3
  62. package/components/pages/template-content/template-content.mdx +61 -61
  63. package/components/pages/template-page/TemplatePage.stories.tsx +32 -32
  64. package/components/pages/template-page/template-page.mdx +53 -53
  65. package/components/pages/template-page/template-page.test.tsx +2 -1
  66. package/components/pages/verify-email-page/VerifyEmailPage.tsx +206 -206
  67. package/components/pages/verify-email-page/verify-email-page.mdx +55 -55
  68. package/components/public-api-smoke.test.tsx +10 -6
  69. package/components/shared/assistant-utils.ts +3 -2
  70. package/components/shared/navigation.ts +2 -2
  71. package/components/ui/accordion/accordion.mdx +29 -29
  72. package/components/ui/alert/alert.mdx +29 -29
  73. package/components/ui/alert-dialog/alert-dialog.mdx +26 -26
  74. package/components/ui/aspect-ratio/aspect-ratio.mdx +25 -25
  75. package/components/ui/assistant-chart/AssistantChart.tsx +8 -2
  76. package/components/ui/assistant-chart/assistant-chart.mdx +25 -25
  77. package/components/ui/avatar/avatar.mdx +26 -26
  78. package/components/ui/badge/badge.mdx +28 -28
  79. package/components/ui/breadcrumb/breadcrumb.mdx +26 -26
  80. package/components/ui/button/button.mdx +29 -29
  81. package/components/ui/calendar/calendar.mdx +26 -26
  82. package/components/ui/card/card.mdx +26 -26
  83. package/components/ui/carousel/carousel.mdx +26 -26
  84. package/components/ui/chart/chart.mdx +26 -26
  85. package/components/ui/chart/chart.test.tsx +178 -178
  86. package/components/ui/chart/chart.tsx +2252 -2245
  87. package/components/ui/checkbox/checkbox.mdx +26 -26
  88. package/components/ui/collapsible/collapsible.mdx +25 -25
  89. package/components/ui/command/command.mdx +26 -26
  90. package/components/ui/context-menu/context-menu.mdx +26 -26
  91. package/components/ui/dialog/dialog.mdx +26 -26
  92. package/components/ui/drawer/drawer.mdx +26 -26
  93. package/components/ui/dropdown-menu/dropdown-menu.mdx +26 -26
  94. package/components/ui/empty/empty.mdx +26 -26
  95. package/components/ui/file-upload/file-upload.mdx +26 -26
  96. package/components/ui/form/form.mdx +20 -20
  97. package/components/ui/google-maps-loader/google-maps-loader.mdx +68 -68
  98. package/components/ui/hover-card/hover-card.mdx +26 -26
  99. package/components/ui/input/input.mdx +29 -29
  100. package/components/ui/input-otp/input-otp.mdx +26 -26
  101. package/components/ui/label/label.mdx +25 -25
  102. package/components/ui/map/map.mdx +26 -26
  103. package/components/ui/map/map.tsx +6 -1
  104. package/components/ui/menubar/menubar.mdx +26 -26
  105. package/components/ui/navigation-menu/navigation-menu.mdx +26 -26
  106. package/components/ui/notification-badge/notification-badge.mdx +26 -26
  107. package/components/ui/page-header/page-header.mdx +44 -44
  108. package/components/ui/pagination/pagination.mdx +26 -26
  109. package/components/ui/popover/popover.mdx +26 -26
  110. package/components/ui/progress/progress.mdx +25 -25
  111. package/components/ui/radio-group/radio-group.mdx +26 -26
  112. package/components/ui/rating/rating.mdx +26 -26
  113. package/components/ui/resizable/resizable.mdx +26 -26
  114. package/components/ui/resizable/resizable.tsx +13 -8
  115. package/components/ui/rich-text-editor/rich-text-editor.mdx +47 -47
  116. package/components/ui/route-map/route-map.mdx +26 -26
  117. package/components/ui/scroll-area/scroll-area.mdx +25 -25
  118. package/components/ui/search/search.mdx +27 -27
  119. package/components/ui/select/select.mdx +26 -26
  120. package/components/ui/separator/separator.mdx +25 -25
  121. package/components/ui/sheet/sheet.mdx +26 -26
  122. package/components/ui/simple-map/simple-map.mdx +25 -25
  123. package/components/ui/skeleton/skeleton.mdx +25 -25
  124. package/components/ui/slider/slider.mdx +26 -26
  125. package/components/ui/sonner/sonner.mdx +26 -26
  126. package/components/ui/stats-card/stats-card.mdx +26 -26
  127. package/components/ui/stats-card/stats-card.stories.tsx +117 -117
  128. package/components/ui/stats-card/stats-card.tsx +109 -109
  129. package/components/ui/stepper/stepper.mdx +26 -26
  130. package/components/ui/switch/switch.mdx +25 -25
  131. package/components/ui/table/table.mdx +27 -27
  132. package/components/ui/tabs/tabs.mdx +26 -26
  133. package/components/ui/textarea/textarea.mdx +25 -25
  134. package/components/ui/timeline/timeline.mdx +26 -26
  135. package/components/ui/toggle/toggle.mdx +26 -26
  136. package/components/ui/toggle-group/toggle-group.mdx +26 -26
  137. package/components/ui/tooltip/tooltip.mdx +26 -26
  138. package/components/ui/tree-view/tree-view.mdx +26 -26
  139. package/components.json +511 -511
  140. package/contexts/BrandColorsContext.tsx +282 -282
  141. package/contexts/i18n-singleton.test.tsx +57 -0
  142. package/contexts/theme-data.ts +391 -391
  143. package/dist/{AssistantChart-DMJJ_Amf.js → AssistantChart-BMNSA_Pk.js} +5 -5
  144. package/dist/{AssistantChart-D0A1FPYt.cjs → AssistantChart-BzM7plyc.cjs} +150 -114
  145. package/dist/{AssistantChart-BXU1ACnh.js → AssistantChart-C842evTi.js} +134 -240
  146. package/dist/{AssistantChart-BZTPJ5dP.cjs → AssistantChart-CVF2uh37.cjs} +5 -5
  147. package/dist/{AssistantChart-COGiOV-g.cjs → AssistantChart-JooMdVQU.cjs} +17 -7
  148. package/dist/{AssistantChart-CWX1OWNM.js → AssistantChart-KHS-tp-L.js} +17 -7
  149. package/dist/{BrandColorsContext-BwY-b6M4.cjs → BrandColorsContext-B4_81eas.cjs} +2 -2
  150. package/dist/{BrandColorsContext-BMRJ04Wf.js → BrandColorsContext-DbK5LnQ_.js} +2 -2
  151. package/dist/{CodeBlock-CjeFavqV.js → CodeBlock-DiKO8ocT.js} +11 -11
  152. package/dist/{CodeBlock-CV6dtsTM.cjs → CodeBlock-ZYThr7Kn.cjs} +12 -9
  153. package/dist/{XerticaXLogo-mqjoBiLI.js → LanguageSelector-CmTj3lWq.js} +85 -82
  154. package/dist/{XerticaXLogo-BX3ueACh.js → LanguageSelector-DxW6o7bt.js} +81 -81
  155. package/dist/{XerticaXLogo-uQgwns_E.cjs → LanguageSelector-Sw73qvWV.cjs} +84 -81
  156. package/dist/{ThemeContext-BgclCB35.js → ThemeContext-BGeh_Kdr.js} +290 -212
  157. package/dist/{ThemeContext-BblcjQup.cjs → ThemeContext-D50irx5T.cjs} +291 -205
  158. package/dist/{VerifyEmailPage-C_Zk6Gen.cjs → VerifyEmailPage-B6bOrybJ.cjs} +17 -17
  159. package/dist/{VerifyEmailPage-B31mCrMc.js → VerifyEmailPage-BRE5Fz59.js} +8 -8
  160. package/dist/{VerifyEmailPage-BJjAMUTW.js → VerifyEmailPage-BcCluouh.js} +151 -78
  161. package/dist/VerifyEmailPage-Bx1sr0uQ.cjs +3298 -0
  162. package/dist/{VerifyEmailPage-X14vhdyl.js → VerifyEmailPage-DUYyXCX9.js} +12 -12
  163. package/dist/VerifyEmailPage-DXXMHbzq.js +3289 -0
  164. package/dist/{VerifyEmailPage-u_Dn7t1U.cjs → VerifyEmailPage-DpYtFk35.cjs} +21 -21
  165. package/dist/{VerifyEmailPage-Cyl55sJb.js → VerifyEmailPage-NXKWW3Dk.js} +134 -64
  166. package/dist/{VerifyEmailPage-Bv8Ah_TK.cjs → VerifyEmailPage-QrCz4Wqr.cjs} +143 -73
  167. package/dist/{VerifyEmailPage-CkBYfsNy.cjs → VerifyEmailPage-ZmQra0Wi.cjs} +160 -87
  168. package/dist/{XerticaProvider-BErr83Bg.js → XerticaProvider-BF3q_myt.js} +5 -4
  169. package/dist/{XerticaProvider-CeS5G_n5.cjs → XerticaProvider-C_JSOz1U.cjs} +2 -2
  170. package/dist/{XerticaProvider-CwOkHxiT.cjs → XerticaProvider-D5zjrqZq.cjs} +5 -4
  171. package/dist/{XerticaProvider-ra2NciRq.js → XerticaProvider-KTGl4Cn1.js} +2 -2
  172. package/dist/{alert-dialog-DqlRW_An.js → alert-dialog-BrpwXKwS.js} +3 -3
  173. package/dist/{alert-dialog-DhwPioBa.cjs → alert-dialog-CZU1Zase.cjs} +3 -3
  174. package/dist/{alert-dialog-KpoabzJb.js → alert-dialog-ClRoLH7l.js} +40 -56
  175. package/dist/{alert-dialog-B4M3vQKS.cjs → alert-dialog-DBBqvU-V.cjs} +53 -38
  176. package/dist/assistant.cjs.js +2 -2
  177. package/dist/assistant.es.js +2 -2
  178. package/dist/brand.cjs.js +6 -6
  179. package/dist/brand.es.js +2 -2
  180. package/dist/cli.js +63 -21
  181. package/dist/components/assistant/code-block/CodeBlock.d.ts +2 -1
  182. package/dist/components/assistant/formatted-document/FormattedDocument.d.ts +2 -1
  183. package/dist/components/assistant/markdown-message/MarkdownMessage.d.ts +2 -1
  184. package/dist/components/assistant/modern-chat-input/ModernChatInput.d.ts +2 -1
  185. package/dist/components/assistant/xertica-assistant/parts/AssistantCollapsedView.d.ts +2 -1
  186. package/dist/components/assistant/xertica-assistant/parts/AssistantConversationList.d.ts +2 -1
  187. package/dist/components/assistant/xertica-assistant/parts/AssistantDocumentEditor.d.ts +2 -1
  188. package/dist/components/assistant/xertica-assistant/parts/AssistantFeedbackDialog.d.ts +2 -1
  189. package/dist/components/assistant/xertica-assistant/parts/AssistantHeader.d.ts +2 -1
  190. package/dist/components/assistant/xertica-assistant/parts/AssistantMessageBubble.d.ts +2 -1
  191. package/dist/components/assistant/xertica-assistant/parts/AssistantTabBar.d.ts +2 -1
  192. package/dist/components/assistant/xertica-assistant/parts/AssistantTypingIndicator.d.ts +2 -1
  193. package/dist/components/assistant/xertica-assistant/parts/AssistantWelcomeScreen.d.ts +2 -1
  194. package/dist/components/assistant/xertica-assistant/types.d.ts +3 -2
  195. package/dist/components/assistant/xertica-assistant/use-assistant.d.ts +1 -1
  196. package/dist/components/assistant/xertica-assistant/xertica-assistant.d.ts +2 -1
  197. package/dist/components/blocks/card-patterns/ActivityCard.d.ts +1 -1
  198. package/dist/components/blocks/card-patterns/ActivityCardSkeleton.d.ts +1 -1
  199. package/dist/components/blocks/card-patterns/FeatureCard.d.ts +1 -1
  200. package/dist/components/blocks/card-patterns/FeatureCardSkeleton.d.ts +1 -1
  201. package/dist/components/blocks/card-patterns/NotificationCard.d.ts +1 -1
  202. package/dist/components/blocks/card-patterns/NotificationCardSkeleton.d.ts +1 -1
  203. package/dist/components/blocks/card-patterns/ProfileCard.d.ts +1 -1
  204. package/dist/components/blocks/card-patterns/ProfileCardSkeleton.d.ts +1 -1
  205. package/dist/components/blocks/card-patterns/ProjectCard.d.ts +1 -1
  206. package/dist/components/blocks/card-patterns/ProjectCardSkeleton.d.ts +1 -1
  207. package/dist/components/blocks/card-patterns/QuickActionCard.d.ts +1 -1
  208. package/dist/components/blocks/card-patterns/QuickActionCardSkeleton.d.ts +1 -1
  209. package/dist/components/brand/language-selector/LanguageSelector.d.ts +2 -1
  210. package/dist/components/brand/theme-toggle/ThemeToggle.d.ts +2 -1
  211. package/dist/components/brand/xertica-logo/XerticaLogo.d.ts +2 -1
  212. package/dist/components/brand/xertica-orbe/XerticaOrbe.d.ts +2 -1
  213. package/dist/components/brand/xertica-provider/XerticaProvider.d.ts +1 -1
  214. package/dist/components/brand/xertica-xlogo/XerticaXLogo.d.ts +2 -1
  215. package/dist/components/examples/DrawingMapExample.d.ts +2 -1
  216. package/dist/components/examples/FilterableMapExample.d.ts +1 -1
  217. package/dist/components/examples/MapShowcase.d.ts +2 -1
  218. package/dist/components/examples/SimpleFilterableMap.d.ts +2 -1
  219. package/dist/components/figma/ImageWithFallback.d.ts +1 -1
  220. package/dist/components/layout/header/header.d.ts +1 -1
  221. package/dist/components/layout/sidebar/sidebar.d.ts +25 -13
  222. package/dist/components/media/FloatingMediaWrapper.d.ts +1 -1
  223. package/dist/components/media/audio-player/AudioPlayer.d.ts +2 -1
  224. package/dist/components/media/video-player/VideoPlayer.d.ts +2 -1
  225. package/dist/components/pages/forgot-password-page/ForgotPasswordPage.d.ts +2 -1
  226. package/dist/components/pages/home-content/HomeContent.d.ts +2 -1
  227. package/dist/components/pages/home-page/HomePage.d.ts +2 -1
  228. package/dist/components/pages/login-page/LoginPage.d.ts +2 -1
  229. package/dist/components/pages/reset-password-page/ResetPasswordPage.d.ts +2 -1
  230. package/dist/components/pages/template-content/TemplateContent.d.ts +2 -1
  231. package/dist/components/pages/template-page/TemplatePage.d.ts +2 -1
  232. package/dist/components/pages/verify-email-page/VerifyEmailPage.d.ts +2 -1
  233. package/dist/components/shared/CustomTooltipContent.d.ts +1 -1
  234. package/dist/components/shared/assistant-utils.d.ts +3 -2
  235. package/dist/components/shared/error-boundary.d.ts +4 -4
  236. package/dist/components/shared/error-fallbacks.d.ts +4 -3
  237. package/dist/components/shared/navigation.d.ts +6 -2
  238. package/dist/components/ui/accordion/accordion.d.ts +4 -4
  239. package/dist/components/ui/alert/alert.d.ts +3 -3
  240. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +10 -10
  241. package/dist/components/ui/aspect-ratio/aspect-ratio.d.ts +1 -1
  242. package/dist/components/ui/assistant-chart/AssistantChart.d.ts +4 -3
  243. package/dist/components/ui/avatar/avatar.d.ts +3 -3
  244. package/dist/components/ui/badge/badge.d.ts +1 -1
  245. package/dist/components/ui/breadcrumb/breadcrumb.d.ts +7 -7
  246. package/dist/components/ui/calendar/calendar.d.ts +2 -2
  247. package/dist/components/ui/card/card.d.ts +7 -7
  248. package/dist/components/ui/carousel/carousel.d.ts +5 -5
  249. package/dist/components/ui/chart/chart.d.ts +16 -16
  250. package/dist/components/ui/collapsible/collapsible.d.ts +3 -3
  251. package/dist/components/ui/command/command.d.ts +9 -9
  252. package/dist/components/ui/context-menu/context-menu.d.ts +15 -15
  253. package/dist/components/ui/dialog/dialog.d.ts +9 -9
  254. package/dist/components/ui/drawer/drawer.d.ts +10 -10
  255. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +15 -15
  256. package/dist/components/ui/form/form.d.ts +7 -7
  257. package/dist/components/ui/google-maps-loader/google-maps-loader.d.ts +3 -3
  258. package/dist/components/ui/hover-card/hover-card.d.ts +3 -3
  259. package/dist/components/ui/input-otp/input-otp.d.ts +4 -4
  260. package/dist/components/ui/label/label.d.ts +1 -1
  261. package/dist/components/ui/menubar/menubar.d.ts +16 -16
  262. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +8 -8
  263. package/dist/components/ui/page-header/page-header.d.ts +3 -3
  264. package/dist/components/ui/pagination/pagination.d.ts +7 -7
  265. package/dist/components/ui/popover/popover.d.ts +4 -4
  266. package/dist/components/ui/progress/progress.d.ts +1 -1
  267. package/dist/components/ui/resizable/resizable.d.ts +11 -7
  268. package/dist/components/ui/rich-text-editor/rich-text-editor.d.ts +1 -1
  269. package/dist/components/ui/scroll-area/scroll-area.d.ts +2 -2
  270. package/dist/components/ui/separator/separator.d.ts +1 -1
  271. package/dist/components/ui/sheet/sheet.d.ts +10 -10
  272. package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
  273. package/dist/components/ui/sonner/sonner.d.ts +2 -1
  274. package/dist/components/ui/stats-card/stats-card-skeleton.d.ts +1 -1
  275. package/dist/components/ui/table/table.d.ts +8 -8
  276. package/dist/components/ui/tabs/tabs.d.ts +4 -4
  277. package/dist/components/ui/tooltip/tooltip.d.ts +4 -4
  278. package/dist/contexts/ApiKeyContext.d.ts +2 -2
  279. package/dist/contexts/AssistenteContext.d.ts +1 -1
  280. package/dist/contexts/AuthContext.d.ts +1 -1
  281. package/dist/contexts/LanguageContext.d.ts +2 -2
  282. package/dist/contexts/LayoutContext.d.ts +2 -2
  283. package/dist/contexts/ThemeContext.d.ts +1 -1
  284. package/dist/features/assistant/hooks/useAssistantConfig.d.ts +1 -1
  285. package/dist/features/home/hooks/useDashboardStats.d.ts +1 -1
  286. package/dist/features/home/hooks/useFeatureCards.d.ts +1 -1
  287. package/dist/features/home/hooks/useTeamMembers.d.ts +1 -1
  288. package/dist/{google-maps-loader-BCe58h9D.js → google-maps-loader-BOug999f.js} +0 -4
  289. package/dist/{google-maps-loader-casMyxlo.cjs → google-maps-loader-DfeBRI8Q.cjs} +0 -5
  290. package/dist/hooks.cjs.js +2 -2
  291. package/dist/hooks.es.js +2 -2
  292. package/dist/{index-9GWd0qxq.cjs → index-BQjx1Mdf.cjs} +1 -1
  293. package/dist/index-Bei5DzAL.js +6 -0
  294. package/dist/index.cjs.js +18 -18
  295. package/dist/index.es.js +12 -12
  296. package/dist/{input-cc-PTD4R.js → input-B0_vbA3g.js} +3 -61
  297. package/dist/{input-C_UiS2Py.cjs → input-ByYuOv8A.cjs} +1 -62
  298. package/dist/layout.cjs.js +1 -1
  299. package/dist/layout.es.js +1 -1
  300. package/dist/pages.cjs.js +1 -1
  301. package/dist/pages.es.js +1 -1
  302. package/dist/{rich-text-editor-DxO1Hz3a.cjs → rich-text-editor-BuqSu718.cjs} +70 -5
  303. package/dist/{rich-text-editor-DqLICivI.js → rich-text-editor-CV8FtA_l.js} +68 -6
  304. package/dist/{rich-text-editor-DloeW0wc.js → rich-text-editor-DV1SixzE.js} +61 -3
  305. package/dist/{rich-text-editor-B2CKz7nx.cjs → rich-text-editor-DnSDglzW.cjs} +63 -2
  306. package/dist/{sidebar-BS1p2V7t.cjs → sidebar-BGJ0j567.cjs} +367 -9
  307. package/dist/{sidebar-3XyzjVBw.js → sidebar-BI6mZlC8.js} +364 -6
  308. package/dist/{sidebar-DyYvgyBj.cjs → sidebar-BtmotOg-.cjs} +367 -9
  309. package/dist/{sidebar-Duermn32.js → sidebar-D3EgGVxF.js} +77 -63
  310. package/dist/{sidebar-CLmIjgNd.cjs → sidebar-DDTqMGnR.cjs} +80 -66
  311. package/dist/{sidebar-B4ZWaMrE.js → sidebar-I7EXyf5D.js} +364 -6
  312. package/dist/ui.cjs.js +7 -7
  313. package/dist/ui.es.js +5 -5
  314. package/dist/{xertica-assistant-QFUnv5I2.cjs → xertica-assistant-BrF9jScR.cjs} +4 -4
  315. package/dist/{xertica-assistant-BbgzsgsG.js → xertica-assistant-CJVnvMqU.js} +55 -45
  316. package/dist/{xertica-assistant-d2qs2Vd9.cjs → xertica-assistant-CKPtc1z5.cjs} +58 -40
  317. package/dist/{xertica-assistant-CyikE3N_.js → xertica-assistant-CsBsxTsI.js} +2 -2
  318. package/dist/{xertica-assistant-CIaUlbIt.cjs → xertica-assistant-DER0brPQ.cjs} +6 -5
  319. package/dist/{xertica-assistant-B1NaSFFj.js → xertica-assistant-DQCjpk5M.js} +4 -3
  320. package/dist/{xertica-assistant-B687qEPU.js → xertica-assistant-Dk-9AJzw.js} +16 -7
  321. package/dist/{xertica-assistant-sOHwTgIP.cjs → xertica-assistant-DxhIKvuY.cjs} +18 -9
  322. package/dist/xertica-ui.css +2 -2
  323. package/docs/components/audio-player.md +1 -1
  324. package/docs/components/sidebar.md +331 -331
  325. package/docs/components/stats-card.md +138 -138
  326. package/docs/components/toggle.md +12 -0
  327. package/docs/doc-audit.md +35 -229
  328. package/docs/i18n.md +31 -10
  329. package/docs/llms.md +6 -4
  330. package/llms-compact.txt +444 -444
  331. package/llms-full.txt +12144 -12144
  332. package/llms.txt +187 -187
  333. package/package.json +223 -219
  334. package/scripts/a11y-audit.mjs +162 -162
  335. package/scripts/fix-stories.cjs +19 -19
  336. package/styles/globals.css +0 -1
  337. package/styles/xertica/base.css +8 -0
  338. package/styles/xertica/tokens.css +240 -240
  339. package/templates/.env.example +2 -2
  340. package/templates/.prettierignore +4 -4
  341. package/templates/.prettierrc +10 -10
  342. package/templates/guidelines/Guidelines.md +865 -865
  343. package/templates/index.html +13 -13
  344. package/templates/package.json +69 -69
  345. package/templates/src/app/components/AuthGuard.tsx +11 -0
  346. package/templates/src/features/auth/ui/AuthPageShell.tsx +32 -32
  347. package/templates/src/features/home/ui/HomeContent.tsx +2 -3
  348. package/templates/src/features/settings/index.ts +2 -0
  349. package/templates/src/features/settings/ui/SettingsContent.tsx +134 -0
  350. package/templates/src/features/template/ui/TemplateContent.tsx +2 -3
  351. package/templates/src/i18n.ts +36 -13
  352. package/templates/src/locales/en/pages/settings.json +15 -0
  353. package/templates/src/locales/es/pages/settings.json +15 -0
  354. package/templates/src/locales/pt-BR/pages/settings.json +15 -0
  355. package/templates/src/pages/SettingsPage.tsx +28 -0
  356. package/templates/src/shared/config/navigation.ts +2 -2
  357. package/templates/src/styles/xertica/tokens.css +240 -240
  358. package/templates/vite.config.d.ts +2 -2
  359. package/templates/vite.config.js +20 -20
  360. package/utils/gemini.ts +2 -2
  361. package/dist/AssistantChart-9w31gdAb.cjs +0 -3363
  362. package/dist/AssistantChart-BAudAfne.cjs +0 -3591
  363. package/dist/AssistantChart-BAx9VQvb.cjs +0 -3374
  364. package/dist/AssistantChart-BP8upjMk.js +0 -3565
  365. package/dist/AssistantChart-CVko2A1W.js +0 -3348
  366. package/dist/AssistantChart-CVzmmhx4.js +0 -3337
  367. package/dist/AssistantChart-CeU2dIb6.js +0 -3469
  368. package/dist/AssistantChart-DO5UuX4J.cjs +0 -3495
  369. package/dist/AudioPlayer-1ypwE2Wh.cjs +0 -936
  370. package/dist/AudioPlayer-BJ2IuRQW.cjs +0 -1275
  371. package/dist/AudioPlayer-BWDW6TN9.cjs +0 -1279
  372. package/dist/AudioPlayer-CM962GEh.js +0 -1280
  373. package/dist/AudioPlayer-CbZId7cj.cjs +0 -998
  374. package/dist/AudioPlayer-DU8zt8-z.js +0 -999
  375. package/dist/AudioPlayer-DuKXrCfy.js +0 -937
  376. package/dist/AudioPlayer-Xxma6_-H.js +0 -1276
  377. package/dist/BrandColorsContext-DLVJgtmH.js +0 -666
  378. package/dist/BrandColorsContext-DZT7JjeD.js +0 -659
  379. package/dist/BrandColorsContext-GUyFmkX0.cjs +0 -665
  380. package/dist/BrandColorsContext-awnBCmC4.cjs +0 -666
  381. package/dist/CodeBlock-C2ZUXt8V.js +0 -219
  382. package/dist/CodeBlock-C5oYnLQp.cjs +0 -218
  383. package/dist/CodeBlock-DuxdtN-l.js +0 -219
  384. package/dist/CodeBlock-POVYONvC.cjs +0 -218
  385. package/dist/CustomTooltipContent-BT6brkVJ.cjs +0 -49
  386. package/dist/CustomTooltipContent-CfOfikhq.js +0 -33
  387. package/dist/CustomTooltipContent-DHjkY0ww.js +0 -40
  388. package/dist/CustomTooltipContent-c_K-DWRr.cjs +0 -56
  389. package/dist/FeatureCard-9GhnlgL3.js +0 -336
  390. package/dist/FeatureCard-Bcb3Zi54.js +0 -302
  391. package/dist/FeatureCard-Cfs6Ishq.js +0 -485
  392. package/dist/FeatureCard-CkPd2psQ.cjs +0 -301
  393. package/dist/FeatureCard-Dkp-xmzM.cjs +0 -335
  394. package/dist/FeatureCard-ie3L8Fpr.cjs +0 -484
  395. package/dist/FeatureCardSkeleton-CAgu8stE.js +0 -27
  396. package/dist/FeatureCardSkeleton-mO3Bdm_V.cjs +0 -26
  397. package/dist/LanguageContext-BwhwC3G2.js +0 -657
  398. package/dist/LanguageContext-DvUt5jBg.cjs +0 -656
  399. package/dist/LayoutContext-BDmcZfMH.cjs +0 -84
  400. package/dist/LayoutContext-C4kKN9RV.cjs +0 -93
  401. package/dist/LayoutContext-CGEe1oPq.js +0 -94
  402. package/dist/LayoutContext-CwT5KLiW.cjs +0 -104
  403. package/dist/LayoutContext-DVLCsoQn.js +0 -105
  404. package/dist/LayoutContext-dbQvdC4O.js +0 -85
  405. package/dist/ThemeContext-BbBNoFTG.js +0 -735
  406. package/dist/ThemeContext-Bo-W2WZH.js +0 -1856
  407. package/dist/ThemeContext-CP3a0jxy.cjs +0 -1855
  408. package/dist/ThemeContext-Cmr8Ex8H.cjs +0 -734
  409. package/dist/ThemeContext-CpqYShLq.cjs +0 -324
  410. package/dist/ThemeContext-D3LzacmG.js +0 -188
  411. package/dist/ThemeContext-DQUOeziy.cjs +0 -1855
  412. package/dist/ThemeContext-Du2nE1PL.js +0 -325
  413. package/dist/ThemeContext-GeEBTJ3q.cjs +0 -1621
  414. package/dist/ThemeContext-JyLK9B1o.js +0 -1622
  415. package/dist/ThemeContext-RTy1m2Uq.js +0 -82
  416. package/dist/ThemeContext-U4dEYc6C.cjs +0 -187
  417. package/dist/ThemeContext-bSzuOit2.cjs +0 -81
  418. package/dist/ThemeContext-ept8jhXI.js +0 -1856
  419. package/dist/VerifyEmailPage-BE-L9mB7.js +0 -2828
  420. package/dist/VerifyEmailPage-BIBOKV7Z.js +0 -3214
  421. package/dist/VerifyEmailPage-BRSP-Pwt.cjs +0 -3196
  422. package/dist/VerifyEmailPage-Bae2cBXT.cjs +0 -2827
  423. package/dist/VerifyEmailPage-BiRm7Nh4.cjs +0 -3213
  424. package/dist/VerifyEmailPage-Bvfv8HVQ.js +0 -3214
  425. package/dist/VerifyEmailPage-CR7kb5df.cjs +0 -2827
  426. package/dist/VerifyEmailPage-C_ihbcth.js +0 -2828
  427. package/dist/VerifyEmailPage-CbgjOF0v.js +0 -2828
  428. package/dist/VerifyEmailPage-CdYPSJoO.js +0 -2828
  429. package/dist/VerifyEmailPage-D-FRj5TU.cjs +0 -3213
  430. package/dist/VerifyEmailPage-DF2ilhum.cjs +0 -3210
  431. package/dist/VerifyEmailPage-DMBh4NM9.cjs +0 -2827
  432. package/dist/VerifyEmailPage-DTtFfC-J.js +0 -3197
  433. package/dist/VerifyEmailPage-Dt7zgA4w.cjs +0 -2827
  434. package/dist/VerifyEmailPage-EhudUdqF.js +0 -3211
  435. package/dist/VerifyEmailPage-RrUApqBN.js +0 -3214
  436. package/dist/VerifyEmailPage-VoMI7MYH.cjs +0 -3213
  437. package/dist/VerifyEmailPage-hdB8JQGv.cjs +0 -3213
  438. package/dist/VerifyEmailPage-vYHbYK3q.js +0 -3214
  439. package/dist/XerticaOrbe-BCUVSPPB.cjs +0 -1924
  440. package/dist/XerticaOrbe-BGIB1CTK.js +0 -1355
  441. package/dist/XerticaOrbe-By8eEvR-.js +0 -1925
  442. package/dist/XerticaOrbe-FWGjBj0U.cjs +0 -1354
  443. package/dist/XerticaProvider-AChwphCO.cjs +0 -48
  444. package/dist/XerticaProvider-AbWlr7Af.cjs +0 -48
  445. package/dist/XerticaProvider-B8CaV7xu.cjs +0 -39
  446. package/dist/XerticaProvider-BITjgC5p.js +0 -39
  447. package/dist/XerticaProvider-BSyFrmC0.js +0 -49
  448. package/dist/XerticaProvider-By8q3Roe.cjs +0 -38
  449. package/dist/XerticaProvider-CUYJZc32.js +0 -49
  450. package/dist/XerticaProvider-CW9hpCdF.cjs +0 -39
  451. package/dist/XerticaProvider-CWgby5mY.js +0 -49
  452. package/dist/XerticaProvider-CWs6EwNa.js +0 -49
  453. package/dist/XerticaProvider-CiNKjMx1.cjs +0 -48
  454. package/dist/XerticaProvider-CjQAQPcn.cjs +0 -48
  455. package/dist/XerticaProvider-D5lLumH-.js +0 -49
  456. package/dist/XerticaProvider-DQtvJU7m.js +0 -40
  457. package/dist/XerticaProvider-DUOJg9iX.js +0 -49
  458. package/dist/XerticaProvider-Dl_b72_l.cjs +0 -51
  459. package/dist/XerticaProvider-qQUDop71.cjs +0 -48
  460. package/dist/XerticaProvider-siSt9uG2.js +0 -40
  461. package/dist/XerticaXLogo-8TTzBjHw.cjs +0 -251
  462. package/dist/XerticaXLogo-B2svDGZh.cjs +0 -251
  463. package/dist/XerticaXLogo-BWaag64t.js +0 -252
  464. package/dist/XerticaXLogo-CFuIlYFH.js +0 -252
  465. package/dist/XerticaXLogo-CU-U-GP4.cjs +0 -251
  466. package/dist/XerticaXLogo-ChryA6xj.js +0 -252
  467. package/dist/XerticaXLogo-CowGv7BC.js +0 -252
  468. package/dist/XerticaXLogo-CziKMQil.cjs +0 -242
  469. package/dist/XerticaXLogo-D8jf0SNv.cjs +0 -214
  470. package/dist/XerticaXLogo-DHz5SugF.js +0 -252
  471. package/dist/XerticaXLogo-DTee_y8X.cjs +0 -251
  472. package/dist/XerticaXLogo-DfUvz-lD.js +0 -243
  473. package/dist/XerticaXLogo-DzXKZBtG.js +0 -231
  474. package/dist/XerticaXLogo-fAJMy3H4.js +0 -215
  475. package/dist/XerticaXLogo-kslQ8Tk_.cjs +0 -251
  476. package/dist/XerticaXLogo-xWbElCZj.cjs +0 -230
  477. package/dist/alert-dialog-iDe5VE5o.js +0 -842
  478. package/dist/alert-dialog-yckpaOpy.cjs +0 -865
  479. package/dist/avatar-Cq5_E8r9.cjs +0 -78
  480. package/dist/avatar-CuYu2MKt.cjs +0 -72
  481. package/dist/avatar-Cxyofu1H.js +0 -56
  482. package/dist/avatar-DSBfJMRJ.js +0 -62
  483. package/dist/breadcrumb-CVzzzqfo.js +0 -103
  484. package/dist/breadcrumb-DIJ0X3Ot.js +0 -96
  485. package/dist/breadcrumb-DjSxkjlQ.cjs +0 -95
  486. package/dist/breadcrumb-DnDlQFg2.cjs +0 -102
  487. package/dist/button-0CXwCRTm.cjs +0 -85
  488. package/dist/button-Bnv9SvYK.cjs +0 -79
  489. package/dist/button-C6uvh0rV.js +0 -63
  490. package/dist/button-qkz7Icqf.js +0 -69
  491. package/dist/card-B8-Gl5DL.js +0 -73
  492. package/dist/card-Bv_c57KU.cjs +0 -72
  493. package/dist/card-DJTsYhLL.cjs +0 -89
  494. package/dist/card-fi8zAN-I.js +0 -90
  495. package/dist/dropdown-menu-B_uEXNc4.cjs +0 -220
  496. package/dist/dropdown-menu-CFuCssWA.js +0 -204
  497. package/dist/dropdown-menu-Ze1YZFyc.cjs +0 -247
  498. package/dist/dropdown-menu-nc_Lvg-u.js +0 -231
  499. package/dist/google-maps-loader-BVoVhUwA.js +0 -316
  500. package/dist/google-maps-loader-BqsYL48U.cjs +0 -285
  501. package/dist/google-maps-loader-DjJaYhV6.cjs +0 -316
  502. package/dist/google-maps-loader-t2IlYBzw.js +0 -286
  503. package/dist/index-B7A523O_.js +0 -8
  504. package/dist/index-BabBx2pa.js +0 -6
  505. package/dist/index-CkTUgOwX.js +0 -8
  506. package/dist/index-D3RLKRAs.cjs +0 -7
  507. package/dist/index-DmHhnb7a.cjs +0 -7
  508. package/dist/index.umd.js +0 -13712
  509. package/dist/input-CNFHVKvo.cjs +0 -145
  510. package/dist/input-CPl84zAx.cjs +0 -151
  511. package/dist/input-D-6IsAca.js +0 -133
  512. package/dist/input-wPYg0d0P.js +0 -127
  513. package/dist/progress-BLwqortq.cjs +0 -105
  514. package/dist/progress-Cs9i4DPx.js +0 -81
  515. package/dist/progress-D9mtsf6j.js +0 -89
  516. package/dist/progress-DDeuWPZw.cjs +0 -97
  517. package/dist/rich-text-editor-1UW3Y2JK.js +0 -2891
  518. package/dist/rich-text-editor-BM-LPpTh.js +0 -2902
  519. package/dist/rich-text-editor-BmsjY03B.js +0 -2949
  520. package/dist/rich-text-editor-BrdC5evx.js +0 -2244
  521. package/dist/rich-text-editor-CyggTOLQ.cjs +0 -2908
  522. package/dist/rich-text-editor-DbV-S7Fi.cjs +0 -2261
  523. package/dist/rich-text-editor-DoCkKhzk.cjs +0 -2919
  524. package/dist/rich-text-editor-GS2kpTAK.cjs +0 -2966
  525. package/dist/routes.d.ts +0 -10
  526. package/dist/select-Cmb8zF7w.cjs +0 -156
  527. package/dist/select-CprSNX0z.js +0 -139
  528. package/dist/select-DT7Zjn42.cjs +0 -162
  529. package/dist/select-En8DkoaQ.js +0 -145
  530. package/dist/sidebar-B3EYhli0.cjs +0 -800
  531. package/dist/sidebar-B9NR0lCe.cjs +0 -800
  532. package/dist/sidebar-BcJ6LxvX.cjs +0 -733
  533. package/dist/sidebar-BvF5I2Ue.cjs +0 -800
  534. package/dist/sidebar-C5B_LHek.cjs +0 -795
  535. package/dist/sidebar-CA6_ek3f.js +0 -801
  536. package/dist/sidebar-CRMiBtAi.js +0 -801
  537. package/dist/sidebar-CVUGHOS_.cjs +0 -756
  538. package/dist/sidebar-CZ2mWaMM.cjs +0 -800
  539. package/dist/sidebar-CmvwjnVb.js +0 -757
  540. package/dist/sidebar-CplprZpM.js +0 -801
  541. package/dist/sidebar-Dz7bd3zP.js +0 -796
  542. package/dist/sidebar-KIS0C2JH.js +0 -801
  543. package/dist/sidebar-OTO_up7Z.js +0 -801
  544. package/dist/sidebar-WoKvFWCN.js +0 -717
  545. package/dist/sidebar-zowjejT2.cjs +0 -800
  546. package/dist/skeleton-4zoHiFJ_.cjs +0 -83
  547. package/dist/skeleton-C4bHqUBf.js +0 -84
  548. package/dist/slider-C0JKA9k3.js +0 -56
  549. package/dist/slider-CPmwzm_3.cjs +0 -73
  550. package/dist/slider-DcJharR9.cjs +0 -73
  551. package/dist/slider-Pay3fka2.js +0 -56
  552. package/dist/sonner-DeUIj0Zg.cjs +0 -63
  553. package/dist/sonner-g9RIfi35.js +0 -47
  554. package/dist/tooltip-CNtsL5cB.cjs +0 -71
  555. package/dist/tooltip-CTyZCD8h.js +0 -55
  556. package/dist/tooltip-CwgSdy3h.cjs +0 -67
  557. package/dist/tooltip-D-OrYnKO.js +0 -51
  558. package/dist/use-audio-player-BJFV24XW.js +0 -188
  559. package/dist/use-audio-player-Bkh23vQ3.js +0 -177
  560. package/dist/use-audio-player-Dn1NR9xN.cjs +0 -176
  561. package/dist/use-audio-player-DyVYlOnR.cjs +0 -187
  562. package/dist/use-mobile-BB4M_4Ru.cjs +0 -47
  563. package/dist/use-mobile-CLu9nqGL.js +0 -31
  564. package/dist/use-mobile-CNwiBNxu.js +0 -33
  565. package/dist/use-mobile-Dlf74ufz.cjs +0 -49
  566. package/dist/xertica-assistant-B1IaHXnB.cjs +0 -1894
  567. package/dist/xertica-assistant-BMqdyRVi.js +0 -2082
  568. package/dist/xertica-assistant-Bj3vBCq_.cjs +0 -2081
  569. package/dist/xertica-assistant-CfBCo21g.js +0 -2148
  570. package/dist/xertica-assistant-DIM_Do1k.js +0 -1866
  571. package/dist/xertica-assistant-DPsESB6t.js +0 -1878
  572. package/dist/xertica-assistant-DrsRwla1.cjs +0 -2147
  573. package/dist/xertica-assistant-Qp3ydksa.cjs +0 -1882
  574. package/dist/xertica-assistant-gnCJdcZY.js +0 -1866
  575. package/dist/xertica-assistant-yyrR0JKl.cjs +0 -1882
  576. package/styles/xertica/app-overrides/scrollbar.css +0 -33
  577. package/dist/{XerticaXLogo-qBPhwK3g.cjs → LanguageSelector-1cINLJ23.cjs} +80 -80
@@ -1,3469 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
3
- import { GripVerticalIcon, ChevronDownIcon, MoreHorizontalIcon, ChevronRightIcon, ChevronLeftIcon, MinusIcon, ChevronLeft, ChevronRight, ChevronDown, XIcon, CheckIcon, CircleIcon, SearchIcon, TrendingUp, TrendingDown, Minus, ArrowRight, ArrowLeft, X, Check, Upload, AlertCircle, FileIcon, Star, Search as Search$1 } from "lucide-react";
4
- import * as React from "react";
5
- import React__default, { useState, useCallback, useMemo, useRef, useEffect } from "react";
6
- import { c as cn, b as buttonVariants, B as Button } from "./button-C6uvh0rV.js";
7
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";
8
- import { cva } from "class-variance-authority";
9
- import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
10
- import * as TogglePrimitive from "@radix-ui/react-toggle";
11
- import { OTPInput, OTPInputContext } from "input-otp";
12
- import { Slot } from "@radix-ui/react-slot";
13
- import { FormProvider, Controller, useFormContext, useFormState } from "react-hook-form";
14
- import { L as Label, M as Map$1 } from "./alert-dialog-KpoabzJb.js";
15
- import { getDefaultClassNames, DayPicker } from "react-day-picker";
16
- import * as DialogPrimitive from "@radix-ui/react-dialog";
17
- import { Drawer as Drawer$1 } from "vaul";
18
- import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
19
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
20
- import * as MenubarPrimitive from "@radix-ui/react-menubar";
21
- import { Command as Command$1 } from "cmdk";
22
- import { k as Dialog, q as DialogHeader, t as DialogTitle, o as DialogDescription, n as DialogContent, c as ChartContainer, g as ChartTooltip, h as ChartTooltipContent } from "./rich-text-editor-BM-LPpTh.js";
23
- import { C as Card, b as CardContent } from "./card-B8-Gl5DL.js";
24
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
25
- import * as AccordionPrimitive from "@radix-ui/react-accordion";
26
- import useEmblaCarousel from "embla-carousel-react";
27
- import { u as useGoogleMapsLoader } from "./google-maps-loader-BVoVhUwA.js";
28
- import { BarChart, CartesianGrid, XAxis, Bar } from "recharts";
29
- function AspectRatio({ ...props }) {
30
- return /* @__PURE__ */ jsx(AspectRatioPrimitive.Root, { "data-slot": "aspect-ratio", ...props });
31
- }
32
- const ResizableContext = React.createContext(null);
33
- const ResizablePanelGroup = ({
34
- children,
35
- className,
36
- direction = "horizontal",
37
- id,
38
- autoSaveId,
39
- storage,
40
- onLayout,
41
- ...props
42
- }) => {
43
- const [panels, setPanels] = React.useState(/* @__PURE__ */ new Map());
44
- const [handles, setHandles] = React.useState(/* @__PURE__ */ new Map());
45
- const [sizes, setSizes] = React.useState(/* @__PURE__ */ new Map());
46
- const [isDragging, setIsDragging] = React.useState(false);
47
- const containerRef = React.useRef(null);
48
- const getSortedItems = React.useCallback(
49
- (items) => {
50
- if (!containerRef.current) return [];
51
- return Array.from(items.values()).sort((a, b) => {
52
- if (!a.ref.current || !b.ref.current) return 0;
53
- const position = a.ref.current.compareDocumentPosition(b.ref.current);
54
- if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
55
- if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
56
- return 0;
57
- });
58
- },
59
- []
60
- );
61
- React.useEffect(() => {
62
- const sortedPanels = getSortedItems(panels);
63
- if (sortedPanels.length === 0) return;
64
- const uninitialized = sortedPanels.some((p) => !sizes.has(p.id));
65
- if (uninitialized) {
66
- const newSizes = new Map(sizes);
67
- const remainingSpace = 100;
68
- const defaultSizeCount = sortedPanels.filter((p) => p.defaultSize).length;
69
- let usedSpace = 0;
70
- sortedPanels.forEach((p) => {
71
- if (p.defaultSize) usedSpace += p.defaultSize;
72
- });
73
- const spaceForOthers = Math.max(0, remainingSpace - usedSpace);
74
- const countOthers = sortedPanels.length - defaultSizeCount;
75
- const sizeForOthers = countOthers > 0 ? spaceForOthers / countOthers : 0;
76
- sortedPanels.forEach((p) => {
77
- if (!newSizes.has(p.id)) {
78
- newSizes.set(p.id, p.defaultSize ?? sizeForOthers);
79
- }
80
- });
81
- setSizes(newSizes);
82
- }
83
- }, [panels, sizes, getSortedItems]);
84
- const registerPanel = React.useCallback((data) => {
85
- setPanels((prev) => {
86
- const next = new Map(prev);
87
- next.set(data.id, data);
88
- return next;
89
- });
90
- }, []);
91
- const unregisterPanel = React.useCallback((id2) => {
92
- setPanels((prev) => {
93
- const next = new Map(prev);
94
- next.delete(id2);
95
- return next;
96
- });
97
- setSizes((prev) => {
98
- const next = new Map(prev);
99
- next.delete(id2);
100
- return next;
101
- });
102
- }, []);
103
- const registerHandle = React.useCallback((data) => {
104
- setHandles((prev) => {
105
- const next = new Map(prev);
106
- next.set(data.id, data);
107
- return next;
108
- });
109
- }, []);
110
- const unregisterHandle = React.useCallback((id2) => {
111
- setHandles((prev) => {
112
- const next = new Map(prev);
113
- next.delete(id2);
114
- return next;
115
- });
116
- }, []);
117
- const startDragging = React.useCallback(
118
- (handleId, event) => {
119
- var _a, _b;
120
- event.preventDefault();
121
- setIsDragging(true);
122
- const sortedPanels = getSortedItems(panels);
123
- const sortedHandles = getSortedItems(handles);
124
- const handleIndex = sortedHandles.findIndex((h) => h.id === handleId);
125
- if (handleIndex === -1) return;
126
- const leftPanel = sortedPanels[handleIndex];
127
- const rightPanel = sortedPanels[handleIndex + 1];
128
- if (!leftPanel || !rightPanel) return;
129
- const startX = "touches" in event ? event.touches[0].clientX : event.clientX;
130
- const startY = "touches" in event ? event.touches[0].clientY : event.clientY;
131
- const startSizeLeft = sizes.get(leftPanel.id) || 0;
132
- const startSizeRight = sizes.get(rightPanel.id) || 0;
133
- const containerSize = direction === "horizontal" ? ((_a = containerRef.current) == null ? void 0 : _a.offsetWidth) || 1 : ((_b = containerRef.current) == null ? void 0 : _b.offsetHeight) || 1;
134
- const onMove = (e) => {
135
- var _a2, _b2;
136
- const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
137
- const currentY = "touches" in e ? e.touches[0].clientY : e.clientY;
138
- const deltaPixels = direction === "horizontal" ? currentX - startX : currentY - startY;
139
- const deltaPercent = deltaPixels / containerSize * 100;
140
- let finalLeft = startSizeLeft + deltaPercent;
141
- let finalRight = startSizeRight - deltaPercent;
142
- if (leftPanel.minSize !== void 0 && finalLeft < leftPanel.minSize) {
143
- const diff = leftPanel.minSize - finalLeft;
144
- finalLeft = leftPanel.minSize;
145
- finalRight -= diff;
146
- }
147
- if (rightPanel.minSize !== void 0 && finalRight < rightPanel.minSize) {
148
- const diff = rightPanel.minSize - finalRight;
149
- finalRight = rightPanel.minSize;
150
- finalLeft -= diff;
151
- }
152
- if (leftPanel.maxSize !== void 0 && finalLeft > leftPanel.maxSize) {
153
- const diff = finalLeft - leftPanel.maxSize;
154
- finalLeft = leftPanel.maxSize;
155
- finalRight += diff;
156
- }
157
- if (rightPanel.maxSize !== void 0 && finalRight > rightPanel.maxSize) {
158
- const diff = finalRight - rightPanel.maxSize;
159
- finalRight = rightPanel.maxSize;
160
- finalLeft -= diff;
161
- }
162
- finalLeft = Math.max(0, Math.min(100, finalLeft));
163
- finalRight = Math.max(0, Math.min(100, finalRight));
164
- setSizes((prev) => {
165
- const next = new Map(prev);
166
- next.set(leftPanel.id, finalLeft);
167
- next.set(rightPanel.id, finalRight);
168
- return next;
169
- });
170
- (_a2 = leftPanel.onResize) == null ? void 0 : _a2.call(leftPanel, finalLeft);
171
- (_b2 = rightPanel.onResize) == null ? void 0 : _b2.call(rightPanel, finalRight);
172
- };
173
- const onUp = () => {
174
- setIsDragging(false);
175
- window.removeEventListener("mousemove", onMove);
176
- window.removeEventListener("mouseup", onUp);
177
- window.removeEventListener("touchmove", onMove);
178
- window.removeEventListener("touchend", onUp);
179
- if (onLayout) {
180
- onLayout(sortedPanels.map((p) => sizes.get(p.id) || 0));
181
- }
182
- };
183
- window.addEventListener("mousemove", onMove);
184
- window.addEventListener("mouseup", onUp);
185
- window.addEventListener("touchmove", onMove);
186
- window.addEventListener("touchend", onUp);
187
- },
188
- [panels, handles, sizes, direction, getSortedItems, onLayout]
189
- );
190
- const getPanelStyle = React.useCallback(
191
- (id2) => {
192
- const size = sizes.get(id2);
193
- if (size === void 0) return { flex: "1 1 0%", overflow: "hidden" };
194
- return { flex: `${size} 1 0%`, overflow: "hidden" };
195
- },
196
- [sizes]
197
- );
198
- const contextValue = React.useMemo(
199
- () => ({
200
- direction,
201
- registerPanel,
202
- unregisterPanel,
203
- registerHandle,
204
- unregisterHandle,
205
- isDragging,
206
- startDragging,
207
- getPanelStyle
208
- }),
209
- [
210
- direction,
211
- registerPanel,
212
- unregisterPanel,
213
- registerHandle,
214
- unregisterHandle,
215
- isDragging,
216
- startDragging,
217
- getPanelStyle
218
- ]
219
- );
220
- return /* @__PURE__ */ jsx(ResizableContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx(
221
- "div",
222
- {
223
- ref: containerRef,
224
- "data-slot": "resizable-panel-group",
225
- "data-panel-group-direction": direction,
226
- className: cn(
227
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
228
- className
229
- ),
230
- ...props,
231
- children
232
- }
233
- ) });
234
- };
235
- const ResizablePanel = ({
236
- className,
237
- defaultSize,
238
- minSize = 0,
239
- maxSize = 100,
240
- collapsible,
241
- collapsedSize,
242
- onCollapse,
243
- onExpand,
244
- onResize,
245
- order,
246
- tagName,
247
- id: propId,
248
- children,
249
- ...props
250
- }) => {
251
- const context = React.useContext(ResizableContext);
252
- const ref = React.useRef(null);
253
- const [generatedId] = React.useState(() => Math.random().toString(36).substr(2, 9));
254
- const id = propId || generatedId;
255
- const registerPanel = context == null ? void 0 : context.registerPanel;
256
- const unregisterPanel = context == null ? void 0 : context.unregisterPanel;
257
- React.useLayoutEffect(() => {
258
- if (!registerPanel || !unregisterPanel) return;
259
- registerPanel({
260
- id,
261
- ref,
262
- defaultSize,
263
- minSize,
264
- maxSize,
265
- collapsible,
266
- onCollapse,
267
- onExpand,
268
- onResize
269
- });
270
- return () => unregisterPanel(id);
271
- }, [
272
- registerPanel,
273
- unregisterPanel,
274
- id,
275
- defaultSize,
276
- minSize,
277
- maxSize,
278
- collapsible,
279
- onCollapse,
280
- onExpand,
281
- onResize
282
- ]);
283
- if (!context) {
284
- return /* @__PURE__ */ jsx("div", { className: cn("flex-1", className), ...props, children });
285
- }
286
- return /* @__PURE__ */ jsx(
287
- "div",
288
- {
289
- ref,
290
- "data-slot": "resizable-panel",
291
- className: cn("relative transition-[flex-grow] duration-0", className),
292
- style: context.getPanelStyle(id),
293
- ...props,
294
- children
295
- }
296
- );
297
- };
298
- const ResizableHandle = ({
299
- withHandle,
300
- className,
301
- id: propId,
302
- tagName,
303
- ...props
304
- }) => {
305
- const context = React.useContext(ResizableContext);
306
- const ref = React.useRef(null);
307
- const [generatedId] = React.useState(() => Math.random().toString(36).substr(2, 9));
308
- const id = propId || generatedId;
309
- const registerHandle = context == null ? void 0 : context.registerHandle;
310
- const unregisterHandle = context == null ? void 0 : context.unregisterHandle;
311
- React.useLayoutEffect(() => {
312
- if (!registerHandle || !unregisterHandle) return;
313
- registerHandle({ id, ref });
314
- return () => unregisterHandle(id);
315
- }, [registerHandle, unregisterHandle, id]);
316
- const handleMouseDown = (e) => {
317
- if (context) {
318
- context.startDragging(id, e);
319
- }
320
- };
321
- if (!context) return null;
322
- return /* @__PURE__ */ jsx(
323
- "div",
324
- {
325
- ref,
326
- "data-slot": "resizable-handle",
327
- className: cn(
328
- "bg-border relative flex items-center justify-center focus-visible:outline-hidden",
329
- "touch-none select-none",
330
- context.direction === "vertical" ? "h-px w-full cursor-row-resize after:left-0 after:h-1 after:w-full after:-translate-y-1/2 hover:after:h-4" : "w-px h-full cursor-col-resize after:top-0 after:w-1 after:h-full after:-translate-x-1/2 hover:after:w-4",
331
- "after:absolute after:z-10",
332
- className
333
- ),
334
- onMouseDown: handleMouseDown,
335
- onTouchStart: handleMouseDown,
336
- ...props,
337
- children: withHandle && /* @__PURE__ */ jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border", children: /* @__PURE__ */ jsx(GripVerticalIcon, { className: "size-2.5" }) })
338
- }
339
- );
340
- };
341
- function NavigationMenu({
342
- className,
343
- children,
344
- viewport = true,
345
- ...props
346
- }) {
347
- return /* @__PURE__ */ jsxs(
348
- NavigationMenuPrimitive.Root,
349
- {
350
- "data-slot": "navigation-menu",
351
- className: cn("relative z-10 flex w-full flex-1 items-center justify-center", className),
352
- ...props,
353
- children: [
354
- children,
355
- viewport && /* @__PURE__ */ jsx(NavigationMenuViewport, {})
356
- ]
357
- }
358
- );
359
- }
360
- function NavigationMenuList({
361
- className,
362
- ...props
363
- }) {
364
- return /* @__PURE__ */ jsx(
365
- NavigationMenuPrimitive.List,
366
- {
367
- "data-slot": "navigation-menu-list",
368
- className: cn("group flex flex-1 list-none items-center justify-center gap-1", className),
369
- ...props
370
- }
371
- );
372
- }
373
- function NavigationMenuItem({
374
- className,
375
- ...props
376
- }) {
377
- return /* @__PURE__ */ jsx(
378
- NavigationMenuPrimitive.Item,
379
- {
380
- "data-slot": "navigation-menu-item",
381
- className: cn("relative", className),
382
- ...props
383
- }
384
- );
385
- }
386
- const navigationMenuTriggerStyle = cva(
387
- "group inline-flex h-10 w-max items-center justify-center rounded-[var(--radius)] bg-background px-4 py-2 text-[var(--text-p)] font-[var(--font-weight-medium)] hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:bg-accent/50 outline-none focus-visible:ring-2 focus-visible:ring-ring"
388
- );
389
- function NavigationMenuTrigger({
390
- className,
391
- children,
392
- ...props
393
- }) {
394
- return /* @__PURE__ */ jsxs(
395
- NavigationMenuPrimitive.Trigger,
396
- {
397
- "data-slot": "navigation-menu-trigger",
398
- className: cn(navigationMenuTriggerStyle(), "group", className),
399
- ...props,
400
- children: [
401
- children,
402
- " ",
403
- /* @__PURE__ */ jsx(
404
- ChevronDownIcon,
405
- {
406
- className: "relative top-[1px] ml-1 size-3 group-data-[state=open]:rotate-180",
407
- "aria-hidden": "true"
408
- }
409
- )
410
- ]
411
- }
412
- );
413
- }
414
- function NavigationMenuContent({
415
- className,
416
- ...props
417
- }) {
418
- return /* @__PURE__ */ jsx(
419
- NavigationMenuPrimitive.Content,
420
- {
421
- "data-slot": "navigation-menu-content",
422
- className: cn("left-0 top-0 w-full md:w-auto", className),
423
- ...props
424
- }
425
- );
426
- }
427
- function NavigationMenuViewport({
428
- className,
429
- ...props
430
- }) {
431
- return /* @__PURE__ */ jsx("div", { className: cn("absolute left-0 top-full flex justify-center w-full"), children: /* @__PURE__ */ jsx(
432
- NavigationMenuPrimitive.Viewport,
433
- {
434
- "data-slot": "navigation-menu-viewport",
435
- className: cn(
436
- "origin-top-center relative mt-1.5 overflow-hidden rounded-[var(--radius)] border border-border bg-popover text-popover-foreground shadow-lg",
437
- className
438
- ),
439
- ...props
440
- }
441
- ) });
442
- }
443
- function NavigationMenuLink({
444
- className,
445
- ...props
446
- }) {
447
- return /* @__PURE__ */ jsx(
448
- NavigationMenuPrimitive.Link,
449
- {
450
- "data-slot": "navigation-menu-link",
451
- className: cn(
452
- "block select-none space-y-1 rounded-[var(--radius)] p-3 leading-none no-underline outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",
453
- className
454
- ),
455
- ...props
456
- }
457
- );
458
- }
459
- function NavigationMenuIndicator({
460
- className,
461
- ...props
462
- }) {
463
- return /* @__PURE__ */ jsx(
464
- NavigationMenuPrimitive.Indicator,
465
- {
466
- "data-slot": "navigation-menu-indicator",
467
- className: cn(
468
- "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
469
- className
470
- ),
471
- ...props,
472
- children: /* @__PURE__ */ jsx("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
473
- }
474
- );
475
- }
476
- function Pagination({ className, ...props }) {
477
- return /* @__PURE__ */ jsx(
478
- "nav",
479
- {
480
- role: "navigation",
481
- "aria-label": "pagination",
482
- "data-slot": "pagination",
483
- className: cn("mx-auto flex w-full justify-center", className),
484
- ...props
485
- }
486
- );
487
- }
488
- function PaginationContent({ className, ...props }) {
489
- return /* @__PURE__ */ jsx(
490
- "ul",
491
- {
492
- "data-slot": "pagination-content",
493
- className: cn("flex flex-row items-center gap-1", className),
494
- ...props
495
- }
496
- );
497
- }
498
- function PaginationItem({ ...props }) {
499
- return /* @__PURE__ */ jsx("li", { "data-slot": "pagination-item", ...props });
500
- }
501
- function PaginationLink({
502
- className,
503
- isActive,
504
- disabled,
505
- size = "icon",
506
- href,
507
- ...props
508
- }) {
509
- return /* @__PURE__ */ jsx(
510
- "a",
511
- {
512
- "aria-current": isActive ? "page" : void 0,
513
- "aria-disabled": disabled || void 0,
514
- tabIndex: disabled ? -1 : void 0,
515
- "data-slot": "pagination-link",
516
- "data-active": isActive,
517
- href: disabled ? void 0 : href ?? "#",
518
- className: cn(
519
- buttonVariants({
520
- variant: isActive ? "outline" : "ghost",
521
- size
522
- }),
523
- disabled && "pointer-events-none opacity-50",
524
- className
525
- ),
526
- ...props
527
- }
528
- );
529
- }
530
- function PaginationPrevious({
531
- className,
532
- disabled,
533
- ...props
534
- }) {
535
- return /* @__PURE__ */ jsxs(
536
- PaginationLink,
537
- {
538
- "aria-label": "Go to previous page",
539
- size: "default",
540
- disabled,
541
- className: cn("gap-1 px-2.5 sm:pl-2.5", className),
542
- ...props,
543
- children: [
544
- /* @__PURE__ */ jsx(ChevronLeftIcon, {}),
545
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Previous" })
546
- ]
547
- }
548
- );
549
- }
550
- function PaginationNext({
551
- className,
552
- disabled,
553
- ...props
554
- }) {
555
- return /* @__PURE__ */ jsxs(
556
- PaginationLink,
557
- {
558
- "aria-label": "Go to next page",
559
- size: "default",
560
- disabled,
561
- className: cn("gap-1 px-2.5 sm:pr-2.5", className),
562
- ...props,
563
- children: [
564
- /* @__PURE__ */ jsx("span", { className: "hidden sm:block", children: "Next" }),
565
- /* @__PURE__ */ jsx(ChevronRightIcon, {})
566
- ]
567
- }
568
- );
569
- }
570
- function PaginationEllipsis({ className, ...props }) {
571
- return /* @__PURE__ */ jsxs(
572
- "span",
573
- {
574
- "aria-hidden": true,
575
- "data-slot": "pagination-ellipsis",
576
- className: cn("flex size-9 items-center justify-center", className),
577
- ...props,
578
- children: [
579
- /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "size-4" }),
580
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "More pages" })
581
- ]
582
- }
583
- );
584
- }
585
- function usePagination({
586
- totalItems,
587
- pageSize = 10,
588
- initialPage = 1,
589
- page: controlledPage,
590
- onPageChange,
591
- siblingCount = 1
592
- }) {
593
- const [internalPage, setInternalPage] = useState(initialPage);
594
- const isControlled = controlledPage !== void 0;
595
- const currentPage = isControlled ? controlledPage : internalPage;
596
- const totalPages = Math.max(1, Math.ceil(totalItems / pageSize));
597
- const setPage = useCallback(
598
- (p) => {
599
- const clamped = Math.min(Math.max(1, p), totalPages);
600
- if (!isControlled) setInternalPage(clamped);
601
- onPageChange == null ? void 0 : onPageChange(clamped);
602
- },
603
- [isControlled, onPageChange, totalPages]
604
- );
605
- const startIndex = (currentPage - 1) * pageSize;
606
- const endIndex = Math.min(startIndex + pageSize, totalItems);
607
- const canGoPrev = currentPage > 1;
608
- const canGoNext = currentPage < totalPages;
609
- const isFirstPage = currentPage === 1;
610
- const isLastPage = currentPage === totalPages;
611
- const items = useMemo(() => {
612
- const pageSet = /* @__PURE__ */ new Set();
613
- pageSet.add(1);
614
- if (totalPages > 1) pageSet.add(totalPages);
615
- for (let p = Math.max(2, currentPage - siblingCount); p <= Math.min(totalPages - 1, currentPage + siblingCount); p++) {
616
- pageSet.add(p);
617
- }
618
- const sorted = Array.from(pageSet).sort((a, b) => a - b);
619
- const result = [];
620
- for (let i = 0; i < sorted.length; i++) {
621
- result.push({ type: "page", page: sorted[i] });
622
- if (i < sorted.length - 1 && sorted[i + 1] - sorted[i] > 1) {
623
- result.push({ type: "ellipsis", key: `ellipsis-${sorted[i]}` });
624
- }
625
- }
626
- return result;
627
- }, [currentPage, siblingCount, totalPages]);
628
- const goTo = useCallback((p) => setPage(p), [setPage]);
629
- const next = useCallback(() => setPage(currentPage + 1), [currentPage, setPage]);
630
- const prev = useCallback(() => setPage(currentPage - 1), [currentPage, setPage]);
631
- const first = useCallback(() => setPage(1), [setPage]);
632
- const last = useCallback(() => setPage(totalPages), [setPage, totalPages]);
633
- return {
634
- currentPage,
635
- totalPages,
636
- startIndex,
637
- endIndex,
638
- canGoPrev,
639
- canGoNext,
640
- isFirstPage,
641
- isLastPage,
642
- items,
643
- goTo,
644
- next,
645
- prev,
646
- first,
647
- last
648
- };
649
- }
650
- const toggleVariants = cva(
651
- "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",
652
- {
653
- variants: {
654
- variant: {
655
- default: "bg-transparent",
656
- outline: "border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"
657
- },
658
- size: {
659
- default: "h-9 px-2 min-w-9",
660
- sm: "h-8 px-1.5 min-w-8",
661
- lg: "h-10 px-2.5 min-w-10"
662
- }
663
- },
664
- defaultVariants: {
665
- variant: "default",
666
- size: "default"
667
- }
668
- }
669
- );
670
- const Toggle = React.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsx(
671
- TogglePrimitive.Root,
672
- {
673
- ref,
674
- "data-slot": "toggle",
675
- className: cn(toggleVariants({ variant, size, className })),
676
- ...props
677
- }
678
- ));
679
- Toggle.displayName = TogglePrimitive.Root.displayName;
680
- const ToggleGroupContext = React.createContext({
681
- size: "default",
682
- variant: "default"
683
- });
684
- const ToggleGroup = React.forwardRef(({ className, variant, size, children, ...props }, ref) => /* @__PURE__ */ jsx(
685
- ToggleGroupPrimitive.Root,
686
- {
687
- ref,
688
- "data-slot": "toggle-group",
689
- "data-variant": variant,
690
- "data-size": size,
691
- className: cn(
692
- "group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs",
693
- className
694
- ),
695
- ...props,
696
- children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
697
- }
698
- ));
699
- ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
700
- const ToggleGroupItem = React.forwardRef(({ className, children, variant, size, ...props }, ref) => {
701
- const context = React.useContext(ToggleGroupContext);
702
- return /* @__PURE__ */ jsx(
703
- ToggleGroupPrimitive.Item,
704
- {
705
- ref,
706
- "data-slot": "toggle-group-item",
707
- "data-variant": context.variant || variant,
708
- "data-size": context.size || size,
709
- className: cn(
710
- toggleVariants({
711
- variant: context.variant || variant,
712
- size: context.size || size
713
- }),
714
- "min-w-0 flex-1 shrink-0 rounded-none shadow-none first:rounded-l-md last:rounded-r-md focus:z-10 focus-visible:z-10 data-[variant=outline]:border-l-0 data-[variant=outline]:first:border-l",
715
- className
716
- ),
717
- ...props,
718
- children
719
- }
720
- );
721
- });
722
- ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
723
- function InputOTP({
724
- className,
725
- containerClassName,
726
- ...props
727
- }) {
728
- return /* @__PURE__ */ jsx(
729
- OTPInput,
730
- {
731
- "data-slot": "input-otp",
732
- containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
733
- className: cn("disabled:cursor-not-allowed", className),
734
- ...props
735
- }
736
- );
737
- }
738
- function InputOTPGroup({ className, ...props }) {
739
- return /* @__PURE__ */ jsx(
740
- "div",
741
- {
742
- "data-slot": "input-otp-group",
743
- className: cn("flex items-center gap-1", className),
744
- ...props
745
- }
746
- );
747
- }
748
- function InputOTPSlot({
749
- index,
750
- className,
751
- size = "md",
752
- ...props
753
- }) {
754
- const inputOTPContext = React.useContext(OTPInputContext);
755
- const { char, hasFakeCaret, isActive } = (inputOTPContext == null ? void 0 : inputOTPContext.slots[index]) ?? {};
756
- const sizeClasses = {
757
- sm: "h-8 w-8 text-sm",
758
- md: "h-10 w-10 text-base",
759
- lg: "h-12 w-12 text-lg"
760
- };
761
- return /* @__PURE__ */ jsxs(
762
- "div",
763
- {
764
- "data-slot": "input-otp-slot",
765
- "data-active": isActive,
766
- className: cn(
767
- "data-[active=true]:border-primary data-[active=true]:ring-primary/20 data-[active=true]:aria-invalid:ring-destructive/20 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive relative flex items-center justify-center border border-border rounded-[var(--radius)] bg-background transition-all outline-none data-[active=true]:z-10 data-[active=true]:ring-2",
768
- sizeClasses[size],
769
- className
770
- ),
771
- ...props,
772
- children: [
773
- char,
774
- hasFakeCaret && /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
775
- ]
776
- }
777
- );
778
- }
779
- function InputOTPSeparator({ ...props }) {
780
- return /* @__PURE__ */ jsx("div", { "data-slot": "input-otp-separator", role: "separator", ...props, children: /* @__PURE__ */ jsx(MinusIcon, {}) });
781
- }
782
- const Form = FormProvider;
783
- const FormFieldContext = React.createContext({});
784
- const FormField = ({
785
- ...props
786
- }) => {
787
- return /* @__PURE__ */ jsx(FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ jsx(Controller, { ...props }) });
788
- };
789
- const useFormField = () => {
790
- const fieldContext = React.useContext(FormFieldContext);
791
- const itemContext = React.useContext(FormItemContext);
792
- const { getFieldState } = useFormContext();
793
- const formState = useFormState({ name: fieldContext.name });
794
- const fieldState = getFieldState(fieldContext.name, formState);
795
- if (!fieldContext) {
796
- throw new Error("useFormField should be used within <FormField>");
797
- }
798
- const { id } = itemContext;
799
- return {
800
- id,
801
- name: fieldContext.name,
802
- formItemId: `${id}-form-item`,
803
- formDescriptionId: `${id}-form-item-description`,
804
- formMessageId: `${id}-form-item-message`,
805
- ...fieldState
806
- };
807
- };
808
- const FormItemContext = React.createContext({});
809
- function FormItem({ className, ...props }) {
810
- const id = React.useId();
811
- return /* @__PURE__ */ jsx(FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ jsx("div", { "data-slot": "form-item", className: cn("grid gap-2", className), ...props }) });
812
- }
813
- function FormLabel({ className, ...props }) {
814
- const { error, formItemId } = useFormField();
815
- return /* @__PURE__ */ jsx(
816
- Label,
817
- {
818
- "data-slot": "form-label",
819
- "data-error": !!error,
820
- className: cn("data-[error=true]:text-destructive", className),
821
- htmlFor: formItemId,
822
- ...props
823
- }
824
- );
825
- }
826
- function FormControl({ ...props }) {
827
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
828
- return /* @__PURE__ */ jsx(
829
- Slot,
830
- {
831
- "data-slot": "form-control",
832
- id: formItemId,
833
- "aria-describedby": !error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`,
834
- "aria-invalid": !!error,
835
- ...props
836
- }
837
- );
838
- }
839
- function FormDescription({ className, ...props }) {
840
- const { formDescriptionId } = useFormField();
841
- return /* @__PURE__ */ jsx(
842
- "p",
843
- {
844
- "data-slot": "form-description",
845
- id: formDescriptionId,
846
- className: cn("text-muted-foreground text-sm", className),
847
- ...props
848
- }
849
- );
850
- }
851
- function FormMessage({ className, ...props }) {
852
- const { error, formMessageId } = useFormField();
853
- const body = error ? String((error == null ? void 0 : error.message) ?? "") : props.children;
854
- if (!body) {
855
- return null;
856
- }
857
- return /* @__PURE__ */ jsx(
858
- "p",
859
- {
860
- "data-slot": "form-message",
861
- id: formMessageId,
862
- className: cn("text-destructive text-sm", className),
863
- ...props,
864
- children: body
865
- }
866
- );
867
- }
868
- function Calendar({
869
- className,
870
- classNames,
871
- showOutsideDays = true,
872
- captionLayout = "label",
873
- buttonVariant = "ghost",
874
- formatters,
875
- components,
876
- ...props
877
- }) {
878
- const defaultClassNames = getDefaultClassNames();
879
- const isDropdownCaption = captionLayout.startsWith("dropdown");
880
- return /* @__PURE__ */ jsx(
881
- DayPicker,
882
- {
883
- showOutsideDays,
884
- className: cn(
885
- "bg-background group/calendar p-4 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent font-sans",
886
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
887
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
888
- className
889
- ),
890
- captionLayout,
891
- formatters,
892
- classNames: {
893
- root: cn("w-fit", defaultClassNames.root),
894
- months: cn("flex gap-6 flex-col md:flex-row relative", defaultClassNames.months),
895
- month: cn("flex flex-col w-full gap-5", defaultClassNames.month),
896
- nav: cn(
897
- "flex items-center gap-2 w-full absolute top-0 inset-x-0 justify-between",
898
- defaultClassNames.nav
899
- ),
900
- button_previous: cn(
901
- buttonVariants({ variant: buttonVariant }),
902
- "size-(--cell-size) aria-disabled:opacity-40 p-0 select-none hover:bg-accent/50 transition-colors duration-200",
903
- defaultClassNames.button_previous
904
- ),
905
- button_next: cn(
906
- buttonVariants({ variant: buttonVariant }),
907
- "size-(--cell-size) aria-disabled:opacity-40 p-0 select-none hover:bg-accent/50 transition-colors duration-200",
908
- defaultClassNames.button_next
909
- ),
910
- month_caption: cn(
911
- "flex items-center justify-center w-full",
912
- isDropdownCaption ? "h-auto px-0" : "h-(--cell-size) px-(--cell-size)",
913
- defaultClassNames.month_caption
914
- ),
915
- dropdowns: cn(
916
- "w-full flex items-center justify-center gap-2",
917
- isDropdownCaption ? "h-auto" : "h-(--cell-size)",
918
- defaultClassNames.dropdowns
919
- ),
920
- dropdown_root: cn(
921
- isDropdownCaption ? "relative flex min-w-[7rem] items-center rounded-[var(--radius)] border border-border bg-background text-foreground transition-colors outline-none focus-within:ring-2 focus-within:ring-primary focus-within:border-transparent data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 px-2.5 py-1" : "relative rounded-[var(--radius)] hover:bg-accent transition-colors",
922
- defaultClassNames.dropdown_root
923
- ),
924
- dropdown: cn(
925
- isDropdownCaption ? "absolute inset-0 cursor-pointer opacity-0" : "absolute bg-popover inset-0 opacity-0 cursor-pointer",
926
- defaultClassNames.dropdown
927
- ),
928
- caption_label: cn(
929
- "select-none font-[family-name:var(--font-family,Roboto)] tracking-tight transition-all duration-200",
930
- captionLayout === "label" ? "rounded-[var(--radius)] px-2 py-1 text-[length:var(--calendar-caption-size)] font-[number:var(--font-weight-semibold)] hover:bg-accent hover:text-accent-foreground" : "flex h-full w-full items-center justify-between gap-2 rounded-[var(--radius)] text-[length:var(--calendar-caption-size)] font-[number:var(--font-weight-semibold)] [&>svg]:text-muted-foreground [&>svg]:size-4",
931
- defaultClassNames.caption_label
932
- ),
933
- table: "w-full border-collapse mt-1",
934
- weekdays: cn("flex gap-1", defaultClassNames.weekdays),
935
- weekday: cn(
936
- "text-muted-foreground rounded-(--cell-radius) flex-1 select-none text-[length:var(--calendar-weekday-size)] font-[number:var(--font-weight-medium)] uppercase tracking-wider",
937
- defaultClassNames.weekday
938
- ),
939
- week: cn("flex w-full gap-1", defaultClassNames.week),
940
- week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
941
- week_number: cn(
942
- "select-none text-muted-foreground text-[length:var(--calendar-weekday-size)]",
943
- defaultClassNames.week_number
944
- ),
945
- day: cn(
946
- "relative w-full rounded-(--cell-radius) h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius) group/day aspect-square select-none",
947
- props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
948
- defaultClassNames.day
949
- ),
950
- range_start: cn(
951
- "rounded-l-(--cell-radius) bg-accent/50 relative after:bg-accent/50 after:absolute after:inset-y-0 after:w-2 after:right-0 -z-0 isolate",
952
- defaultClassNames.range_start
953
- ),
954
- range_middle: cn("rounded-none bg-accent/30", defaultClassNames.range_middle),
955
- range_end: cn(
956
- "rounded-r-(--cell-radius) bg-accent/50 relative after:bg-accent/50 after:absolute after:inset-y-0 after:w-2 after:left-0 -z-0 isolate",
957
- defaultClassNames.range_end
958
- ),
959
- today: cn(
960
- "bg-accent/60 text-accent-foreground rounded-(--cell-radius) data-[selected=true]:rounded-none font-[number:var(--font-weight-semibold)]",
961
- defaultClassNames.today
962
- ),
963
- outside: cn(
964
- "text-muted-foreground aria-selected:text-muted-foreground",
965
- defaultClassNames.outside
966
- ),
967
- disabled: cn("text-muted-foreground/30 opacity-40", defaultClassNames.disabled),
968
- hidden: cn("invisible", defaultClassNames.hidden),
969
- ...classNames
970
- },
971
- components: {
972
- Root: ({ className: className2, rootRef, ...props2 }) => {
973
- return /* @__PURE__ */ jsx("div", { "data-slot": "calendar", ref: rootRef, className: cn(className2), ...props2 });
974
- },
975
- Chevron: ({ className: className2, orientation, ...props2 }) => {
976
- if (orientation === "left") {
977
- return /* @__PURE__ */ jsx(
978
- ChevronLeft,
979
- {
980
- className: cn("size-5 transition-transform group-hover:scale-110", className2),
981
- ...props2
982
- }
983
- );
984
- }
985
- if (orientation === "right") {
986
- return /* @__PURE__ */ jsx(
987
- ChevronRight,
988
- {
989
- className: cn("size-5 transition-transform group-hover:scale-110", className2),
990
- ...props2
991
- }
992
- );
993
- }
994
- return /* @__PURE__ */ jsx(ChevronDown, { className: cn("size-4", className2), ...props2 });
995
- },
996
- DayButton: CalendarDayButton,
997
- WeekNumber: ({ children, ...props2 }) => {
998
- return /* @__PURE__ */ jsx("td", { ...props2, children: /* @__PURE__ */ jsx("div", { className: "flex size-(--cell-size) items-center justify-center text-center font-[number:var(--font-weight-medium)]", children }) });
999
- },
1000
- ...components
1001
- },
1002
- ...props
1003
- }
1004
- );
1005
- }
1006
- function CalendarDayButton({
1007
- className,
1008
- day,
1009
- modifiers,
1010
- ...props
1011
- }) {
1012
- const defaultClassNames = getDefaultClassNames();
1013
- const ref = React.useRef(null);
1014
- React.useEffect(() => {
1015
- var _a;
1016
- if (modifiers.focused) (_a = ref.current) == null ? void 0 : _a.focus();
1017
- }, [modifiers.focused]);
1018
- return /* @__PURE__ */ jsx(
1019
- Button,
1020
- {
1021
- ref,
1022
- variant: "ghost",
1023
- size: "icon",
1024
- "data-day": day.date.toLocaleDateString(),
1025
- "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
1026
- "data-range-start": modifiers.range_start,
1027
- "data-range-end": modifiers.range_end,
1028
- "data-range-middle": modifiers.range_middle,
1029
- className: cn(
1030
- "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col items-center justify-center gap-1 border-0 leading-none transition-all duration-200 cursor-pointer disabled:cursor-not-allowed",
1031
- "text-[length:var(--calendar-day-size)] font-[number:var(--font-weight-regular)]",
1032
- "hover:bg-accent/70 hover:text-accent-foreground hover:scale-105",
1033
- "data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[selected-single=true]:font-[number:var(--font-weight-semibold)] data-[selected-single=true]:shadow-sm",
1034
- "data-[range-middle=true]:bg-accent/50 data-[range-middle=true]:text-foreground",
1035
- "data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-start=true]:font-[number:var(--font-weight-semibold)] data-[range-start=true]:shadow-sm",
1036
- "data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-end=true]:font-[number:var(--font-weight-semibold)] data-[range-end=true]:shadow-sm",
1037
- "group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 group-data-[focused=true]/day:ring-2 group-data-[focused=true]/day:ring-offset-2 group-data-[focused=true]/day:ring-offset-background",
1038
- "data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius)",
1039
- "data-[range-middle=true]:rounded-none",
1040
- "data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius)",
1041
- "[&>span]:opacity-80",
1042
- defaultClassNames.day,
1043
- className
1044
- ),
1045
- ...props,
1046
- children: day.date.getDate()
1047
- }
1048
- );
1049
- }
1050
- function Sheet({ ...props }) {
1051
- return /* @__PURE__ */ jsx(DialogPrimitive.Root, { "data-slot": "sheet", ...props });
1052
- }
1053
- function SheetTrigger({ ...props }) {
1054
- return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { "data-slot": "sheet-trigger", ...props });
1055
- }
1056
- function SheetClose({ ...props }) {
1057
- return /* @__PURE__ */ jsx(DialogPrimitive.Close, { "data-slot": "sheet-close", ...props });
1058
- }
1059
- function SheetPortal({ ...props }) {
1060
- return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
1061
- }
1062
- const SheetOverlay = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1063
- DialogPrimitive.Overlay,
1064
- {
1065
- className: cn(
1066
- "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/50",
1067
- className
1068
- ),
1069
- ...props,
1070
- ref
1071
- }
1072
- ));
1073
- SheetOverlay.displayName = DialogPrimitive.Overlay.displayName;
1074
- function SheetContent({
1075
- className,
1076
- children,
1077
- side = "right",
1078
- ...props
1079
- }) {
1080
- return /* @__PURE__ */ jsxs(SheetPortal, { children: [
1081
- /* @__PURE__ */ jsx(SheetOverlay, {}),
1082
- /* @__PURE__ */ jsxs(
1083
- DialogPrimitive.Content,
1084
- {
1085
- "data-slot": "sheet-content",
1086
- className: cn(
1087
- "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
1088
- side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
1089
- side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
1090
- side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
1091
- side === "bottom" && "data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
1092
- className
1093
- ),
1094
- ...props,
1095
- children: [
1096
- children,
1097
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
1098
- /* @__PURE__ */ jsx(XIcon, { className: "size-4" }),
1099
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
1100
- ] })
1101
- ]
1102
- }
1103
- )
1104
- ] });
1105
- }
1106
- function SheetHeader({ className, ...props }) {
1107
- return /* @__PURE__ */ jsx(
1108
- "div",
1109
- {
1110
- "data-slot": "sheet-header",
1111
- className: cn("flex flex-col gap-1.5 px-6 pt-6", className),
1112
- ...props
1113
- }
1114
- );
1115
- }
1116
- function SheetBody({ className, ...props }) {
1117
- return /* @__PURE__ */ jsx("div", { "data-slot": "sheet-body", className: cn("flex-1 overflow-auto px-6", className), ...props });
1118
- }
1119
- function SheetFooter({ className, ...props }) {
1120
- return /* @__PURE__ */ jsx(
1121
- "div",
1122
- {
1123
- "data-slot": "sheet-footer",
1124
- className: cn("mt-auto flex flex-col gap-2 px-6 pb-6", className),
1125
- ...props
1126
- }
1127
- );
1128
- }
1129
- function SheetTitle({ className, ...props }) {
1130
- return /* @__PURE__ */ jsx(
1131
- DialogPrimitive.Title,
1132
- {
1133
- "data-slot": "sheet-title",
1134
- className: cn("text-foreground font-semibold", className),
1135
- ...props
1136
- }
1137
- );
1138
- }
1139
- function SheetDescription({
1140
- className,
1141
- ...props
1142
- }) {
1143
- return /* @__PURE__ */ jsx(
1144
- DialogPrimitive.Description,
1145
- {
1146
- "data-slot": "sheet-description",
1147
- className: cn("text-muted-foreground text-sm", className),
1148
- ...props
1149
- }
1150
- );
1151
- }
1152
- function Drawer({ ...props }) {
1153
- return /* @__PURE__ */ jsx(Drawer$1.Root, { "data-slot": "drawer", ...props });
1154
- }
1155
- function DrawerTrigger({ ...props }) {
1156
- return /* @__PURE__ */ jsx(Drawer$1.Trigger, { "data-slot": "drawer-trigger", ...props });
1157
- }
1158
- function DrawerPortal({ ...props }) {
1159
- return /* @__PURE__ */ jsx(Drawer$1.Portal, { "data-slot": "drawer-portal", ...props });
1160
- }
1161
- function DrawerClose({ ...props }) {
1162
- return /* @__PURE__ */ jsx(Drawer$1.Close, { "data-slot": "drawer-close", ...props });
1163
- }
1164
- const DrawerOverlay = React.forwardRef(({ className, ...props }, ref) => {
1165
- return /* @__PURE__ */ jsx(
1166
- Drawer$1.Overlay,
1167
- {
1168
- ref,
1169
- "data-slot": "drawer-overlay",
1170
- className: cn(
1171
- "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/50",
1172
- className
1173
- ),
1174
- ...props
1175
- }
1176
- );
1177
- });
1178
- DrawerOverlay.displayName = Drawer$1.Overlay.displayName;
1179
- function DrawerContent({
1180
- className,
1181
- children,
1182
- ...props
1183
- }) {
1184
- return /* @__PURE__ */ jsxs(DrawerPortal, { "data-slot": "drawer-portal", children: [
1185
- /* @__PURE__ */ jsx(DrawerOverlay, {}),
1186
- /* @__PURE__ */ jsxs(
1187
- Drawer$1.Content,
1188
- {
1189
- "data-slot": "drawer-content",
1190
- className: cn(
1191
- "group/drawer-content bg-background fixed z-50 flex h-auto flex-col",
1192
- "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
1193
- "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
1194
- "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
1195
- "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
1196
- className
1197
- ),
1198
- ...props,
1199
- children: [
1200
- /* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }),
1201
- children
1202
- ]
1203
- }
1204
- )
1205
- ] });
1206
- }
1207
- function DrawerHeader({ className, ...props }) {
1208
- return /* @__PURE__ */ jsx(
1209
- "div",
1210
- {
1211
- "data-slot": "drawer-header",
1212
- className: cn("flex flex-col gap-1.5 p-4", className),
1213
- ...props
1214
- }
1215
- );
1216
- }
1217
- function DrawerFooter({ className, ...props }) {
1218
- return /* @__PURE__ */ jsx(
1219
- "div",
1220
- {
1221
- "data-slot": "drawer-footer",
1222
- className: cn("mt-auto flex flex-col gap-2 p-4", className),
1223
- ...props
1224
- }
1225
- );
1226
- }
1227
- function DrawerTitle({ className, ...props }) {
1228
- return /* @__PURE__ */ jsx(
1229
- Drawer$1.Title,
1230
- {
1231
- "data-slot": "drawer-title",
1232
- className: cn("text-foreground font-semibold", className),
1233
- ...props
1234
- }
1235
- );
1236
- }
1237
- function DrawerDescription({
1238
- className,
1239
- ...props
1240
- }) {
1241
- return /* @__PURE__ */ jsx(
1242
- Drawer$1.Description,
1243
- {
1244
- "data-slot": "drawer-description",
1245
- className: cn("text-muted-foreground text-sm", className),
1246
- ...props
1247
- }
1248
- );
1249
- }
1250
- function DrawerHandle({ className, ...props }) {
1251
- return /* @__PURE__ */ jsx(
1252
- "div",
1253
- {
1254
- "data-slot": "drawer-handle",
1255
- className: cn("bg-muted mx-auto mt-4 h-2 w-[100px] shrink-0 rounded-full", className),
1256
- ...props
1257
- }
1258
- );
1259
- }
1260
- function HoverCard({ ...props }) {
1261
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Root, { "data-slot": "hover-card", ...props });
1262
- }
1263
- function HoverCardTrigger({ ...props }) {
1264
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
1265
- }
1266
- function HoverCardContent({
1267
- className,
1268
- align = "center",
1269
- sideOffset = 4,
1270
- ...props
1271
- }) {
1272
- return /* @__PURE__ */ jsx(HoverCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: /* @__PURE__ */ jsx(
1273
- HoverCardPrimitive.Content,
1274
- {
1275
- "data-slot": "hover-card-content",
1276
- align,
1277
- sideOffset,
1278
- className: cn(
1279
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
1280
- className
1281
- ),
1282
- ...props
1283
- }
1284
- ) });
1285
- }
1286
- function ContextMenu({ ...props }) {
1287
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Root, { "data-slot": "context-menu", ...props });
1288
- }
1289
- function ContextMenuTrigger({
1290
- ...props
1291
- }) {
1292
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Trigger, { "data-slot": "context-menu-trigger", ...props });
1293
- }
1294
- function ContextMenuGroup({ ...props }) {
1295
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Group, { "data-slot": "context-menu-group", ...props });
1296
- }
1297
- function ContextMenuPortal({ ...props }) {
1298
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { "data-slot": "context-menu-portal", ...props });
1299
- }
1300
- function ContextMenuSub({ ...props }) {
1301
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Sub, { "data-slot": "context-menu-sub", ...props });
1302
- }
1303
- function ContextMenuRadioGroup({
1304
- ...props
1305
- }) {
1306
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.RadioGroup, { "data-slot": "context-menu-radio-group", ...props });
1307
- }
1308
- function ContextMenuSubTrigger({
1309
- className,
1310
- inset,
1311
- children,
1312
- ...props
1313
- }) {
1314
- return /* @__PURE__ */ jsxs(
1315
- ContextMenuPrimitive.SubTrigger,
1316
- {
1317
- "data-slot": "context-menu-sub-trigger",
1318
- "data-inset": inset,
1319
- className: cn(
1320
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1321
- className
1322
- ),
1323
- ...props,
1324
- children: [
1325
- children,
1326
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto" })
1327
- ]
1328
- }
1329
- );
1330
- }
1331
- function ContextMenuSubContent({
1332
- className,
1333
- ...props
1334
- }) {
1335
- return /* @__PURE__ */ jsx(
1336
- ContextMenuPrimitive.SubContent,
1337
- {
1338
- "data-slot": "context-menu-sub-content",
1339
- className: cn(
1340
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
1341
- className
1342
- ),
1343
- ...props
1344
- }
1345
- );
1346
- }
1347
- function ContextMenuContent({
1348
- className,
1349
- ...props
1350
- }) {
1351
- return /* @__PURE__ */ jsx(ContextMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(
1352
- ContextMenuPrimitive.Content,
1353
- {
1354
- "data-slot": "context-menu-content",
1355
- className: cn(
1356
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",
1357
- className
1358
- ),
1359
- ...props
1360
- }
1361
- ) });
1362
- }
1363
- function ContextMenuItem({
1364
- className,
1365
- inset,
1366
- variant = "default",
1367
- ...props
1368
- }) {
1369
- return /* @__PURE__ */ jsx(
1370
- ContextMenuPrimitive.Item,
1371
- {
1372
- "data-slot": "context-menu-item",
1373
- "data-inset": inset,
1374
- "data-variant": variant,
1375
- className: cn(
1376
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1377
- className
1378
- ),
1379
- ...props
1380
- }
1381
- );
1382
- }
1383
- function ContextMenuCheckboxItem({
1384
- className,
1385
- children,
1386
- checked,
1387
- ...props
1388
- }) {
1389
- return /* @__PURE__ */ jsxs(
1390
- ContextMenuPrimitive.CheckboxItem,
1391
- {
1392
- "data-slot": "context-menu-checkbox-item",
1393
- className: cn(
1394
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1395
- className
1396
- ),
1397
- checked,
1398
- ...props,
1399
- children: [
1400
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
1401
- children
1402
- ]
1403
- }
1404
- );
1405
- }
1406
- function ContextMenuRadioItem({
1407
- className,
1408
- children,
1409
- ...props
1410
- }) {
1411
- return /* @__PURE__ */ jsxs(
1412
- ContextMenuPrimitive.RadioItem,
1413
- {
1414
- "data-slot": "context-menu-radio-item",
1415
- className: cn(
1416
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1417
- className
1418
- ),
1419
- ...props,
1420
- children: [
1421
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(ContextMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
1422
- children
1423
- ]
1424
- }
1425
- );
1426
- }
1427
- function ContextMenuLabel({
1428
- className,
1429
- inset,
1430
- ...props
1431
- }) {
1432
- return /* @__PURE__ */ jsx(
1433
- ContextMenuPrimitive.Label,
1434
- {
1435
- "data-slot": "context-menu-label",
1436
- "data-inset": inset,
1437
- className: cn("text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
1438
- ...props
1439
- }
1440
- );
1441
- }
1442
- function ContextMenuSeparator({
1443
- className,
1444
- ...props
1445
- }) {
1446
- return /* @__PURE__ */ jsx(
1447
- ContextMenuPrimitive.Separator,
1448
- {
1449
- "data-slot": "context-menu-separator",
1450
- className: cn("bg-border -mx-1 my-1 h-px", className),
1451
- ...props
1452
- }
1453
- );
1454
- }
1455
- function ContextMenuShortcut({ className, ...props }) {
1456
- return /* @__PURE__ */ jsx(
1457
- "span",
1458
- {
1459
- "data-slot": "context-menu-shortcut",
1460
- className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1461
- ...props
1462
- }
1463
- );
1464
- }
1465
- function Menubar({ className, ...props }) {
1466
- return /* @__PURE__ */ jsx(
1467
- MenubarPrimitive.Root,
1468
- {
1469
- "data-slot": "menubar",
1470
- className: cn(
1471
- "bg-background flex h-9 items-center gap-1 rounded-md border p-1 shadow-xs",
1472
- className
1473
- ),
1474
- ...props
1475
- }
1476
- );
1477
- }
1478
- function MenubarMenu({ ...props }) {
1479
- return /* @__PURE__ */ jsx(MenubarPrimitive.Menu, { "data-slot": "menubar-menu", ...props });
1480
- }
1481
- function MenubarGroup({ ...props }) {
1482
- return /* @__PURE__ */ jsx(MenubarPrimitive.Group, { "data-slot": "menubar-group", ...props });
1483
- }
1484
- function MenubarPortal({ ...props }) {
1485
- return /* @__PURE__ */ jsx(MenubarPrimitive.Portal, { "data-slot": "menubar-portal", ...props });
1486
- }
1487
- function MenubarRadioGroup({ ...props }) {
1488
- return /* @__PURE__ */ jsx(MenubarPrimitive.RadioGroup, { "data-slot": "menubar-radio-group", ...props });
1489
- }
1490
- function MenubarTrigger({
1491
- className,
1492
- ...props
1493
- }) {
1494
- return /* @__PURE__ */ jsx(
1495
- MenubarPrimitive.Trigger,
1496
- {
1497
- "data-slot": "menubar-trigger",
1498
- className: cn(
1499
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex items-center rounded-sm px-2 py-1 text-sm font-medium outline-hidden select-none",
1500
- className
1501
- ),
1502
- ...props
1503
- }
1504
- );
1505
- }
1506
- function MenubarContent({
1507
- className,
1508
- align = "start",
1509
- alignOffset = -4,
1510
- sideOffset = 8,
1511
- ...props
1512
- }) {
1513
- return /* @__PURE__ */ jsx(MenubarPortal, { children: /* @__PURE__ */ jsx(
1514
- MenubarPrimitive.Content,
1515
- {
1516
- "data-slot": "menubar-content",
1517
- align,
1518
- alignOffset,
1519
- sideOffset,
1520
- className: cn(
1521
- "bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-md",
1522
- className
1523
- ),
1524
- ...props
1525
- }
1526
- ) });
1527
- }
1528
- function MenubarItem({
1529
- className,
1530
- inset,
1531
- variant = "default",
1532
- ...props
1533
- }) {
1534
- return /* @__PURE__ */ jsx(
1535
- MenubarPrimitive.Item,
1536
- {
1537
- "data-slot": "menubar-item",
1538
- "data-inset": inset,
1539
- "data-variant": variant,
1540
- className: cn(
1541
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1542
- className
1543
- ),
1544
- ...props
1545
- }
1546
- );
1547
- }
1548
- function MenubarCheckboxItem({
1549
- className,
1550
- children,
1551
- checked,
1552
- ...props
1553
- }) {
1554
- return /* @__PURE__ */ jsxs(
1555
- MenubarPrimitive.CheckboxItem,
1556
- {
1557
- "data-slot": "menubar-checkbox-item",
1558
- className: cn(
1559
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1560
- className
1561
- ),
1562
- checked,
1563
- ...props,
1564
- children: [
1565
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "size-4" }) }) }),
1566
- children
1567
- ]
1568
- }
1569
- );
1570
- }
1571
- function MenubarRadioItem({
1572
- className,
1573
- children,
1574
- ...props
1575
- }) {
1576
- return /* @__PURE__ */ jsxs(
1577
- MenubarPrimitive.RadioItem,
1578
- {
1579
- "data-slot": "menubar-radio-item",
1580
- className: cn(
1581
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1582
- className
1583
- ),
1584
- ...props,
1585
- children: [
1586
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute left-2 flex size-3.5 items-center justify-center", children: /* @__PURE__ */ jsx(MenubarPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CircleIcon, { className: "size-2 fill-current" }) }) }),
1587
- children
1588
- ]
1589
- }
1590
- );
1591
- }
1592
- function MenubarLabel({
1593
- className,
1594
- inset,
1595
- ...props
1596
- }) {
1597
- return /* @__PURE__ */ jsx(
1598
- MenubarPrimitive.Label,
1599
- {
1600
- "data-slot": "menubar-label",
1601
- "data-inset": inset,
1602
- className: cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className),
1603
- ...props
1604
- }
1605
- );
1606
- }
1607
- function MenubarSeparator({
1608
- className,
1609
- ...props
1610
- }) {
1611
- return /* @__PURE__ */ jsx(
1612
- MenubarPrimitive.Separator,
1613
- {
1614
- "data-slot": "menubar-separator",
1615
- className: cn("bg-border -mx-1 my-1 h-px", className),
1616
- ...props
1617
- }
1618
- );
1619
- }
1620
- function MenubarShortcut({ className, ...props }) {
1621
- return /* @__PURE__ */ jsx(
1622
- "span",
1623
- {
1624
- "data-slot": "menubar-shortcut",
1625
- className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1626
- ...props
1627
- }
1628
- );
1629
- }
1630
- function MenubarSub({ ...props }) {
1631
- return /* @__PURE__ */ jsx(MenubarPrimitive.Sub, { "data-slot": "menubar-sub", ...props });
1632
- }
1633
- function MenubarSubTrigger({
1634
- className,
1635
- inset,
1636
- children,
1637
- ...props
1638
- }) {
1639
- return /* @__PURE__ */ jsxs(
1640
- MenubarPrimitive.SubTrigger,
1641
- {
1642
- "data-slot": "menubar-sub-trigger",
1643
- "data-inset": inset,
1644
- className: cn(
1645
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[inset]:pl-8",
1646
- className
1647
- ),
1648
- ...props,
1649
- children: [
1650
- children,
1651
- /* @__PURE__ */ jsx(ChevronRightIcon, { className: "ml-auto h-4 w-4" })
1652
- ]
1653
- }
1654
- );
1655
- }
1656
- function MenubarSubContent({
1657
- className,
1658
- ...props
1659
- }) {
1660
- return /* @__PURE__ */ jsx(
1661
- MenubarPrimitive.SubContent,
1662
- {
1663
- "data-slot": "menubar-sub-content",
1664
- className: cn(
1665
- "bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-menubar-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
1666
- className
1667
- ),
1668
- ...props
1669
- }
1670
- );
1671
- }
1672
- function Command({ className, ...props }) {
1673
- return /* @__PURE__ */ jsx(
1674
- Command$1,
1675
- {
1676
- "data-slot": "command",
1677
- className: cn(
1678
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
1679
- className
1680
- ),
1681
- ...props
1682
- }
1683
- );
1684
- }
1685
- function CommandDialog({
1686
- title = "Command Palette",
1687
- description = "Search for a command to run...",
1688
- children,
1689
- ...props
1690
- }) {
1691
- return /* @__PURE__ */ jsxs(Dialog, { ...props, children: [
1692
- /* @__PURE__ */ jsxs(DialogHeader, { className: "sr-only", children: [
1693
- /* @__PURE__ */ jsx(DialogTitle, { children: title }),
1694
- /* @__PURE__ */ jsx(DialogDescription, { children: description })
1695
- ] }),
1696
- /* @__PURE__ */ jsx(DialogContent, { className: "overflow-hidden p-0", children: /* @__PURE__ */ jsx(Command, { className: "[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children }) })
1697
- ] });
1698
- }
1699
- function CommandInput({
1700
- className,
1701
- ...props
1702
- }) {
1703
- return /* @__PURE__ */ jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [
1704
- /* @__PURE__ */ jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
1705
- /* @__PURE__ */ jsx(
1706
- Command$1.Input,
1707
- {
1708
- "data-slot": "command-input",
1709
- className: cn(
1710
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
1711
- className
1712
- ),
1713
- ...props
1714
- }
1715
- )
1716
- ] });
1717
- }
1718
- function CommandList({ className, ...props }) {
1719
- return /* @__PURE__ */ jsx(
1720
- Command$1.List,
1721
- {
1722
- "data-slot": "command-list",
1723
- role: "listbox",
1724
- className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className),
1725
- ...props
1726
- }
1727
- );
1728
- }
1729
- function CommandEmpty({ ...props }) {
1730
- return /* @__PURE__ */ jsx(
1731
- Command$1.Empty,
1732
- {
1733
- "data-slot": "command-empty",
1734
- className: "py-6 text-center text-sm",
1735
- ...props
1736
- }
1737
- );
1738
- }
1739
- function CommandGroup({
1740
- className,
1741
- ...props
1742
- }) {
1743
- return /* @__PURE__ */ jsx(
1744
- Command$1.Group,
1745
- {
1746
- "data-slot": "command-group",
1747
- className: cn(
1748
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
1749
- className
1750
- ),
1751
- ...props
1752
- }
1753
- );
1754
- }
1755
- function CommandSeparator({
1756
- className,
1757
- ...props
1758
- }) {
1759
- return /* @__PURE__ */ jsx(
1760
- Command$1.Separator,
1761
- {
1762
- "data-slot": "command-separator",
1763
- className: cn("bg-border -mx-1 h-px", className),
1764
- ...props
1765
- }
1766
- );
1767
- }
1768
- function CommandItem({ className, ...props }) {
1769
- return /* @__PURE__ */ jsx(
1770
- Command$1.Item,
1771
- {
1772
- "data-slot": "command-item",
1773
- role: "option",
1774
- className: cn(
1775
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
1776
- className
1777
- ),
1778
- ...props
1779
- }
1780
- );
1781
- }
1782
- function CommandShortcut({ className, ...props }) {
1783
- return /* @__PURE__ */ jsx(
1784
- "span",
1785
- {
1786
- "data-slot": "command-shortcut",
1787
- className: cn("text-muted-foreground ml-auto text-xs tracking-widest", className),
1788
- ...props
1789
- }
1790
- );
1791
- }
1792
- const variantStyles = {
1793
- default: "bg-primary text-primary-foreground",
1794
- secondary: "bg-secondary text-secondary-foreground",
1795
- destructive: "bg-destructive text-destructive-foreground",
1796
- outline: "border-2 border-primary bg-background text-primary",
1797
- success: "bg-success text-success-foreground",
1798
- info: "bg-info text-info-foreground",
1799
- warning: "bg-warning text-warning-foreground"
1800
- };
1801
- const NotificationBadge = React.forwardRef(
1802
- ({
1803
- className,
1804
- count = 0,
1805
- max = 99,
1806
- showZero = false,
1807
- dot = false,
1808
- variant = "destructive",
1809
- children,
1810
- ...props
1811
- }, ref) => {
1812
- const displayCount = count > max ? `${max}+` : count;
1813
- const shouldShow = count > 0 || showZero;
1814
- if (!shouldShow && !dot) {
1815
- return /* @__PURE__ */ jsx("div", { ref, className, ...props, children });
1816
- }
1817
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("relative inline-block", className), ...props, children: [
1818
- children,
1819
- /* @__PURE__ */ jsx(
1820
- "span",
1821
- {
1822
- className: cn(
1823
- "absolute -right-1 -top-1 flex items-center justify-center rounded-full",
1824
- variantStyles[variant],
1825
- dot ? "h-2 w-2" : "min-w-[1.25rem] h-5 px-1.5"
1826
- ),
1827
- children: !dot && shouldShow && /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium leading-none", children: displayCount })
1828
- }
1829
- )
1830
- ] });
1831
- }
1832
- );
1833
- NotificationBadge.displayName = "NotificationBadge";
1834
- const StatsCard = React.forwardRef(
1835
- ({ className, title, value, description, trend, icon, ...props }, ref) => {
1836
- const getTrendIcon = () => {
1837
- if (!trend) return null;
1838
- if (trend.value > 0) {
1839
- return /* @__PURE__ */ jsx(TrendingUp, { className: "h-4 w-4 text-success" });
1840
- } else if (trend.value < 0) {
1841
- return /* @__PURE__ */ jsx(TrendingDown, { className: "h-4 w-4 text-destructive" });
1842
- } else {
1843
- return /* @__PURE__ */ jsx(Minus, { className: "h-4 w-4 text-muted-foreground" });
1844
- }
1845
- };
1846
- const getTrendColor = () => {
1847
- if (!trend) return "";
1848
- if (trend.value > 0) {
1849
- return "text-success";
1850
- } else if (trend.value < 0) {
1851
- return "text-destructive";
1852
- } else {
1853
- return "text-muted-foreground";
1854
- }
1855
- };
1856
- return /* @__PURE__ */ jsx(Card, { ref, className: cn("", className), ...props, children: /* @__PURE__ */ jsx(CardContent, { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
1857
- /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
1858
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-1 text-sm", children: title }),
1859
- /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-baseline gap-2", children: [
1860
- /* @__PURE__ */ jsx("h3", { className: "text-foreground text-xl sm:text-2xl", children: value }),
1861
- trend && /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-1 text-sm", getTrendColor()), children: [
1862
- getTrendIcon(),
1863
- /* @__PURE__ */ jsxs("span", { children: [
1864
- Math.abs(trend.value),
1865
- "%"
1866
- ] })
1867
- ] })
1868
- ] }),
1869
- (description || (trend == null ? void 0 : trend.label)) && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1 text-xs sm:text-sm", children: (trend == null ? void 0 : trend.label) || description })
1870
- ] }),
1871
- icon && /* @__PURE__ */ jsx("div", { className: "rounded-[var(--radius)] bg-muted p-2 sm:p-3 text-muted-foreground flex-shrink-0", children: icon })
1872
- ] }) }) });
1873
- }
1874
- );
1875
- StatsCard.displayName = "StatsCard";
1876
- const Timeline = React.forwardRef(
1877
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("ol", { ref, className: cn("relative border-l border-border", className), ...props })
1878
- );
1879
- Timeline.displayName = "Timeline";
1880
- const TimelineItem = React.forwardRef(
1881
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("li", { ref, className: cn("mb-10 ml-6", className), ...props })
1882
- );
1883
- TimelineItem.displayName = "TimelineItem";
1884
- const TimelineDot = React.forwardRef(({ className, variant = "default", icon, children, ...props }, ref) => {
1885
- const variantStyles2 = {
1886
- default: "bg-muted border-border",
1887
- primary: "bg-primary border-primary",
1888
- success: "bg-success border-success",
1889
- info: "bg-info border-info",
1890
- warning: "bg-warning border-warning",
1891
- destructive: "bg-destructive border-destructive",
1892
- outline: "bg-background border-border"
1893
- };
1894
- const iconColorStyles = {
1895
- default: "text-muted-foreground",
1896
- primary: "text-primary-foreground",
1897
- success: "text-success-foreground",
1898
- info: "text-info-foreground",
1899
- warning: "text-warning-foreground",
1900
- destructive: "text-destructive-foreground",
1901
- outline: "text-foreground"
1902
- };
1903
- if (icon || children) {
1904
- return /* @__PURE__ */ jsx(
1905
- "div",
1906
- {
1907
- ref,
1908
- className: cn(
1909
- "absolute -left-[17px] mt-0.5 h-8 w-8 rounded-full border-2 flex items-center justify-center",
1910
- variantStyles2[variant],
1911
- className
1912
- ),
1913
- ...props,
1914
- children: /* @__PURE__ */ jsx("span", { className: cn("h-4 w-4", iconColorStyles[variant]), children: icon || children })
1915
- }
1916
- );
1917
- }
1918
- return /* @__PURE__ */ jsx(
1919
- "div",
1920
- {
1921
- ref,
1922
- className: cn(
1923
- "absolute -left-[9px] mt-1.5 h-4 w-4 rounded-full border-2",
1924
- variantStyles2[variant],
1925
- className
1926
- ),
1927
- ...props
1928
- }
1929
- );
1930
- });
1931
- TimelineDot.displayName = "TimelineDot";
1932
- const TimelineContent = React.forwardRef(
1933
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props })
1934
- );
1935
- TimelineContent.displayName = "TimelineContent";
1936
- const TimelineHeading = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("mb-1 text-foreground", className), ...props }));
1937
- TimelineHeading.displayName = "TimelineHeading";
1938
- const TimelineTime = React.forwardRef(
1939
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("time", { ref, className: cn("mb-2 block text-muted-foreground", className), ...props })
1940
- );
1941
- TimelineTime.displayName = "TimelineTime";
1942
- const TimelineDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-muted-foreground", className), ...props }));
1943
- TimelineDescription.displayName = "TimelineDescription";
1944
- function useTreeView({
1945
- data,
1946
- defaultExpanded = [],
1947
- selectedNodeId,
1948
- onNodeClick,
1949
- onNodeSelect
1950
- }) {
1951
- const [expanded, setExpanded] = useState(new Set(defaultExpanded));
1952
- const [internalSelectedId, setInternalSelectedId] = useState(void 0);
1953
- const nodeRefs = useRef(/* @__PURE__ */ new Map());
1954
- const isControlled = selectedNodeId !== void 0;
1955
- const effectiveSelectedId = isControlled ? selectedNodeId : internalSelectedId;
1956
- const getNodeRef = useCallback(
1957
- (nodeId) => (el) => {
1958
- if (el) nodeRefs.current.set(nodeId, el);
1959
- else nodeRefs.current.delete(nodeId);
1960
- },
1961
- []
1962
- );
1963
- const getVisibleNodes = useCallback(() => {
1964
- const result = [];
1965
- const traverse = (nodes) => {
1966
- var _a;
1967
- for (const node of nodes) {
1968
- result.push(node);
1969
- if (((_a = node.children) == null ? void 0 : _a.length) && expanded.has(node.id)) traverse(node.children);
1970
- }
1971
- };
1972
- traverse(data);
1973
- return result;
1974
- }, [data, expanded]);
1975
- const findParent = useCallback(
1976
- (nodes, targetId) => {
1977
- var _a;
1978
- for (const n of nodes) {
1979
- if ((_a = n.children) == null ? void 0 : _a.some((c) => c.id === targetId)) return n;
1980
- if (n.children) {
1981
- const found = findParent(n.children, targetId);
1982
- if (found) return found;
1983
- }
1984
- }
1985
- return null;
1986
- },
1987
- // findParent is a pure recursive function over `data` — no reactive deps needed
1988
- // eslint-disable-next-line react-hooks/exhaustive-deps
1989
- []
1990
- );
1991
- const toggleExpand = useCallback((nodeId) => {
1992
- setExpanded((prev) => {
1993
- const next = new Set(prev);
1994
- next.has(nodeId) ? next.delete(nodeId) : next.add(nodeId);
1995
- return next;
1996
- });
1997
- }, []);
1998
- const handleSelect = useCallback(
1999
- (node) => {
2000
- if (!isControlled) setInternalSelectedId(node.id);
2001
- onNodeSelect == null ? void 0 : onNodeSelect(node);
2002
- onNodeClick == null ? void 0 : onNodeClick(node);
2003
- },
2004
- [isControlled, onNodeClick, onNodeSelect]
2005
- );
2006
- const handleKeyDown = useCallback(
2007
- (e, node) => {
2008
- var _a, _b;
2009
- const visibleNodes = getVisibleNodes();
2010
- const idx = visibleNodes.findIndex((n) => n.id === node.id);
2011
- const hasChildren = !!((_a = node.children) == null ? void 0 : _a.length);
2012
- const isExpanded = expanded.has(node.id);
2013
- const focusNode = (id) => {
2014
- var _a2;
2015
- (_a2 = nodeRefs.current.get(id)) == null ? void 0 : _a2.focus();
2016
- };
2017
- switch (e.key) {
2018
- case "ArrowDown": {
2019
- e.preventDefault();
2020
- const next = visibleNodes[idx + 1];
2021
- if (next) focusNode(next.id);
2022
- break;
2023
- }
2024
- case "ArrowUp": {
2025
- e.preventDefault();
2026
- const prev = visibleNodes[idx - 1];
2027
- if (prev) focusNode(prev.id);
2028
- break;
2029
- }
2030
- case "ArrowRight": {
2031
- e.preventDefault();
2032
- if (hasChildren && !isExpanded) {
2033
- toggleExpand(node.id);
2034
- } else if (hasChildren && isExpanded && ((_b = node.children) == null ? void 0 : _b.length)) {
2035
- focusNode(node.children[0].id);
2036
- }
2037
- break;
2038
- }
2039
- case "ArrowLeft": {
2040
- e.preventDefault();
2041
- if (hasChildren && isExpanded) {
2042
- toggleExpand(node.id);
2043
- } else {
2044
- const parent = findParent(data, node.id);
2045
- if (parent) focusNode(parent.id);
2046
- }
2047
- break;
2048
- }
2049
- case "Home": {
2050
- e.preventDefault();
2051
- if (visibleNodes.length > 0) focusNode(visibleNodes[0].id);
2052
- break;
2053
- }
2054
- case "End": {
2055
- e.preventDefault();
2056
- const last = visibleNodes[visibleNodes.length - 1];
2057
- if (last) focusNode(last.id);
2058
- break;
2059
- }
2060
- case " ": {
2061
- e.preventDefault();
2062
- if (hasChildren) {
2063
- toggleExpand(node.id);
2064
- } else {
2065
- handleSelect(node);
2066
- }
2067
- break;
2068
- }
2069
- case "Enter": {
2070
- e.preventDefault();
2071
- if (hasChildren) toggleExpand(node.id);
2072
- handleSelect(node);
2073
- break;
2074
- }
2075
- }
2076
- },
2077
- [data, expanded, findParent, getVisibleNodes, handleSelect, toggleExpand]
2078
- );
2079
- return {
2080
- expanded,
2081
- effectiveSelectedId,
2082
- nodeRefs,
2083
- getNodeRef,
2084
- toggleExpand,
2085
- handleSelect,
2086
- handleKeyDown,
2087
- getVisibleNodes
2088
- };
2089
- }
2090
- const TreeView = React.forwardRef(
2091
- ({
2092
- className,
2093
- data,
2094
- onNodeClick,
2095
- onNodeSelect,
2096
- defaultExpanded = [],
2097
- selectedNodeId,
2098
- ariaLabel,
2099
- ...props
2100
- }, ref) => {
2101
- var _a;
2102
- const { expanded, effectiveSelectedId, getNodeRef, toggleExpand, handleSelect, handleKeyDown } = useTreeView({ data, defaultExpanded, selectedNodeId, onNodeClick, onNodeSelect });
2103
- const focusableId = effectiveSelectedId ?? ((_a = data[0]) == null ? void 0 : _a.id);
2104
- return /* @__PURE__ */ jsx(
2105
- "div",
2106
- {
2107
- ref,
2108
- className: cn("w-full", className),
2109
- role: "tree",
2110
- "aria-label": ariaLabel ?? "Navegação em árvore",
2111
- ...props,
2112
- children: data.map((node) => /* @__PURE__ */ jsx(
2113
- TreeNodeComponent,
2114
- {
2115
- node,
2116
- level: 0,
2117
- expanded,
2118
- selectedId: effectiveSelectedId,
2119
- focusableId,
2120
- onToggle: toggleExpand,
2121
- onSelect: handleSelect,
2122
- onKeyDown: handleKeyDown,
2123
- getNodeRef
2124
- },
2125
- node.id
2126
- ))
2127
- }
2128
- );
2129
- }
2130
- );
2131
- TreeView.displayName = "TreeView";
2132
- const TreeNodeComponent = ({
2133
- node,
2134
- level,
2135
- expanded,
2136
- selectedId,
2137
- focusableId,
2138
- onToggle,
2139
- onSelect,
2140
- onKeyDown,
2141
- getNodeRef
2142
- }) => {
2143
- var _a;
2144
- const hasChildren = !!((_a = node.children) == null ? void 0 : _a.length);
2145
- const isExpanded = expanded.has(node.id);
2146
- const isSelected = node.id === selectedId;
2147
- const handleClick = () => {
2148
- if (hasChildren) onToggle(node.id);
2149
- onSelect(node);
2150
- };
2151
- return /* @__PURE__ */ jsxs("div", { role: "none", children: [
2152
- /* @__PURE__ */ jsxs(
2153
- "button",
2154
- {
2155
- ref: getNodeRef(node.id),
2156
- role: "treeitem",
2157
- "aria-expanded": hasChildren ? isExpanded : void 0,
2158
- "aria-selected": isSelected,
2159
- tabIndex: node.id === focusableId ? 0 : -1,
2160
- onClick: handleClick,
2161
- onKeyDown: (e) => onKeyDown(e, node),
2162
- className: cn(
2163
- "flex w-full items-center gap-2 rounded-[var(--radius)] px-2 py-1.5 text-left transition-colors",
2164
- "hover:bg-muted focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1",
2165
- isSelected && "bg-primary/10 text-primary font-medium"
2166
- ),
2167
- style: { paddingLeft: `${level * 1.5 + 0.5}rem` },
2168
- children: [
2169
- hasChildren ? /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4" }) }) : /* @__PURE__ */ jsx("span", { className: "w-4 flex-shrink-0", "aria-hidden": "true" }),
2170
- node.icon && /* @__PURE__ */ jsx("span", { className: "flex-shrink-0 text-muted-foreground", children: node.icon }),
2171
- /* @__PURE__ */ jsx("span", { className: "flex-1 text-foreground", children: node.label })
2172
- ]
2173
- }
2174
- ),
2175
- hasChildren && isExpanded && /* @__PURE__ */ jsx("div", { role: "group", children: node.children.map((child) => /* @__PURE__ */ jsx(
2176
- TreeNodeComponent,
2177
- {
2178
- node: child,
2179
- level: level + 1,
2180
- expanded,
2181
- selectedId,
2182
- focusableId,
2183
- onToggle,
2184
- onSelect,
2185
- onKeyDown,
2186
- getNodeRef
2187
- },
2188
- child.id
2189
- )) })
2190
- ] });
2191
- };
2192
- function Collapsible({ ...props }) {
2193
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.Root, { "data-slot": "collapsible", ...props });
2194
- }
2195
- function CollapsibleTrigger({
2196
- ...props
2197
- }) {
2198
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleTrigger, { "data-slot": "collapsible-trigger", ...props });
2199
- }
2200
- function CollapsibleContent({
2201
- ...props
2202
- }) {
2203
- return /* @__PURE__ */ jsx(CollapsiblePrimitive.CollapsibleContent, { "data-slot": "collapsible-content", ...props });
2204
- }
2205
- function Accordion({ ...props }) {
2206
- return /* @__PURE__ */ jsx(AccordionPrimitive.Root, { "data-slot": "accordion", ...props });
2207
- }
2208
- function AccordionItem({
2209
- className,
2210
- ...props
2211
- }) {
2212
- return /* @__PURE__ */ jsx(
2213
- AccordionPrimitive.Item,
2214
- {
2215
- "data-slot": "accordion-item",
2216
- className: cn("border-b last:border-b-0", className),
2217
- ...props
2218
- }
2219
- );
2220
- }
2221
- function AccordionTrigger({
2222
- className,
2223
- children,
2224
- ...props
2225
- }) {
2226
- return /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
2227
- AccordionPrimitive.Trigger,
2228
- {
2229
- "data-slot": "accordion-trigger",
2230
- className: cn(
2231
- "focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
2232
- className
2233
- ),
2234
- ...props,
2235
- children: [
2236
- children,
2237
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" })
2238
- ]
2239
- }
2240
- ) });
2241
- }
2242
- function AccordionContent({
2243
- className,
2244
- children,
2245
- ...props
2246
- }) {
2247
- return /* @__PURE__ */ jsx(
2248
- AccordionPrimitive.Content,
2249
- {
2250
- "data-slot": "accordion-content",
2251
- className: "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",
2252
- ...props,
2253
- children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4", className), children })
2254
- }
2255
- );
2256
- }
2257
- const CarouselContext = React.createContext(null);
2258
- function useCarousel() {
2259
- const context = React.useContext(CarouselContext);
2260
- if (!context) {
2261
- throw new Error("useCarousel must be used within a <Carousel />");
2262
- }
2263
- return context;
2264
- }
2265
- function Carousel({
2266
- orientation = "horizontal",
2267
- opts,
2268
- setApi,
2269
- plugins,
2270
- className,
2271
- children,
2272
- ...props
2273
- }) {
2274
- const [carouselRef, api] = useEmblaCarousel(
2275
- {
2276
- ...opts,
2277
- axis: orientation === "horizontal" ? "x" : "y"
2278
- },
2279
- plugins
2280
- );
2281
- const [canScrollPrev, setCanScrollPrev] = React.useState(false);
2282
- const [canScrollNext, setCanScrollNext] = React.useState(false);
2283
- const onSelect = React.useCallback((api2) => {
2284
- if (!api2) return;
2285
- setCanScrollPrev(api2.canScrollPrev());
2286
- setCanScrollNext(api2.canScrollNext());
2287
- }, []);
2288
- const scrollPrev = React.useCallback(() => {
2289
- api == null ? void 0 : api.scrollPrev();
2290
- }, [api]);
2291
- const scrollNext = React.useCallback(() => {
2292
- api == null ? void 0 : api.scrollNext();
2293
- }, [api]);
2294
- const handleKeyDown = React.useCallback(
2295
- (event) => {
2296
- if (event.key === "ArrowLeft") {
2297
- event.preventDefault();
2298
- scrollPrev();
2299
- } else if (event.key === "ArrowRight") {
2300
- event.preventDefault();
2301
- scrollNext();
2302
- }
2303
- },
2304
- [scrollPrev, scrollNext]
2305
- );
2306
- React.useEffect(() => {
2307
- if (!api || !setApi) return;
2308
- setApi(api);
2309
- }, [api, setApi]);
2310
- React.useEffect(() => {
2311
- if (!api) return;
2312
- onSelect(api);
2313
- api.on("reInit", onSelect);
2314
- api.on("select", onSelect);
2315
- return () => {
2316
- api == null ? void 0 : api.off("select", onSelect);
2317
- };
2318
- }, [api, onSelect]);
2319
- return /* @__PURE__ */ jsx(
2320
- CarouselContext.Provider,
2321
- {
2322
- value: {
2323
- carouselRef,
2324
- api,
2325
- opts,
2326
- orientation: orientation || ((opts == null ? void 0 : opts.axis) === "y" ? "vertical" : "horizontal"),
2327
- scrollPrev,
2328
- scrollNext,
2329
- canScrollPrev,
2330
- canScrollNext
2331
- },
2332
- children: /* @__PURE__ */ jsx(
2333
- "div",
2334
- {
2335
- onKeyDownCapture: handleKeyDown,
2336
- className: cn("relative", className),
2337
- role: "region",
2338
- "aria-roledescription": "carousel",
2339
- "data-slot": "carousel",
2340
- ...props,
2341
- children
2342
- }
2343
- )
2344
- }
2345
- );
2346
- }
2347
- function CarouselContent({ className, ...props }) {
2348
- const { carouselRef, orientation } = useCarousel();
2349
- return /* @__PURE__ */ jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: /* @__PURE__ */ jsx(
2350
- "div",
2351
- {
2352
- className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
2353
- ...props
2354
- }
2355
- ) });
2356
- }
2357
- function CarouselItem({ className, ...props }) {
2358
- const { orientation } = useCarousel();
2359
- return /* @__PURE__ */ jsx(
2360
- "div",
2361
- {
2362
- role: "group",
2363
- "aria-roledescription": "slide",
2364
- "data-slot": "carousel-item",
2365
- className: cn(
2366
- "min-w-0 shrink-0 grow-0 basis-full",
2367
- orientation === "horizontal" ? "pl-4" : "pt-4",
2368
- className
2369
- ),
2370
- ...props
2371
- }
2372
- );
2373
- }
2374
- function CarouselPrevious({
2375
- className,
2376
- variant = "outline",
2377
- size = "icon",
2378
- ...props
2379
- }) {
2380
- const { orientation, scrollPrev, canScrollPrev } = useCarousel();
2381
- return /* @__PURE__ */ jsxs(
2382
- Button,
2383
- {
2384
- "data-slot": "carousel-previous",
2385
- variant,
2386
- size,
2387
- className: cn(
2388
- "absolute size-8 rounded-full",
2389
- orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
2390
- className
2391
- ),
2392
- disabled: !canScrollPrev,
2393
- onClick: scrollPrev,
2394
- ...props,
2395
- children: [
2396
- /* @__PURE__ */ jsx(ArrowLeft, {}),
2397
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Previous slide" })
2398
- ]
2399
- }
2400
- );
2401
- }
2402
- function CarouselNext({
2403
- className,
2404
- variant = "outline",
2405
- size = "icon",
2406
- ...props
2407
- }) {
2408
- const { orientation, scrollNext, canScrollNext } = useCarousel();
2409
- return /* @__PURE__ */ jsxs(
2410
- Button,
2411
- {
2412
- "data-slot": "carousel-next",
2413
- variant,
2414
- size,
2415
- className: cn(
2416
- "absolute size-8 rounded-full",
2417
- orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
2418
- className
2419
- ),
2420
- disabled: !canScrollNext,
2421
- onClick: scrollNext,
2422
- ...props,
2423
- children: [
2424
- /* @__PURE__ */ jsx(ArrowRight, {}),
2425
- /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Next slide" })
2426
- ]
2427
- }
2428
- );
2429
- }
2430
- const StepperContext = React.createContext(void 0);
2431
- const useStepperContext = () => {
2432
- const context = React.useContext(StepperContext);
2433
- if (!context) throw new Error("useStepperContext must be used within a Stepper");
2434
- return context;
2435
- };
2436
- const Stepper = React.forwardRef(
2437
- ({ currentStep, orientation = "horizontal", className, children, ...props }, ref) => {
2438
- const totalSteps = React.Children.count(children);
2439
- return /* @__PURE__ */ jsx(StepperContext.Provider, { value: { currentStep, totalSteps, orientation }, children: /* @__PURE__ */ jsx("div", { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsx(
2440
- "div",
2441
- {
2442
- className: cn(
2443
- orientation === "horizontal" ? "flex items-start justify-between" : "flex flex-col gap-0"
2444
- ),
2445
- role: "list",
2446
- "aria-label": `Progresso: etapa ${currentStep} de ${totalSteps}`,
2447
- children
2448
- }
2449
- ) }) });
2450
- }
2451
- );
2452
- Stepper.displayName = "Stepper";
2453
- const Step = React.forwardRef(
2454
- ({ step, label, description, error = false, className, ...props }, ref) => {
2455
- const { currentStep, totalSteps, orientation } = useStepperContext();
2456
- const isActive = step === currentStep;
2457
- const isCompleted = step < currentStep && !error;
2458
- const isFirst = step === 1;
2459
- const isLast = step === totalSteps;
2460
- const circleClasses = cn(
2461
- "relative flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-full border-2 transition-colors",
2462
- isActive && !error && "border-primary bg-primary text-primary-foreground",
2463
- isCompleted && "border-primary bg-primary text-primary-foreground",
2464
- error && "border-destructive bg-destructive text-destructive-foreground",
2465
- !isActive && !isCompleted && !error && "border-muted bg-background text-muted-foreground"
2466
- );
2467
- const connectorClasses = (filled) => cn("transition-colors", filled ? "bg-primary" : "bg-muted");
2468
- if (orientation === "vertical") {
2469
- return /* @__PURE__ */ jsxs(
2470
- "div",
2471
- {
2472
- ref,
2473
- className: cn("flex gap-4", className),
2474
- role: "listitem",
2475
- "aria-current": isActive ? "step" : void 0,
2476
- "aria-label": `Etapa ${step}: ${label}${isCompleted ? ", concluída" : isActive ? ", atual" : ""}`,
2477
- ...props,
2478
- children: [
2479
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
2480
- /* @__PURE__ */ jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx("span", { children: step }) }),
2481
- !isLast && /* @__PURE__ */ jsx(
2482
- "div",
2483
- {
2484
- className: cn(
2485
- "w-0.5 flex-1 min-h-[2rem] mt-1",
2486
- connectorClasses(step < currentStep)
2487
- )
2488
- }
2489
- )
2490
- ] }),
2491
- /* @__PURE__ */ jsxs("div", { className: cn("pb-6", isLast && "pb-0"), children: [
2492
- /* @__PURE__ */ jsx(
2493
- "div",
2494
- {
2495
- className: cn(
2496
- "transition-colors",
2497
- isActive || error ? "text-foreground" : "text-muted-foreground"
2498
- ),
2499
- children: label
2500
- }
2501
- ),
2502
- description && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
2503
- ] })
2504
- ]
2505
- }
2506
- );
2507
- }
2508
- return /* @__PURE__ */ jsxs(
2509
- "div",
2510
- {
2511
- ref,
2512
- className: cn("flex flex-1 flex-col items-center", className),
2513
- role: "listitem",
2514
- "aria-current": isActive ? "step" : void 0,
2515
- "aria-label": `Etapa ${step}: ${label}${isCompleted ? ", concluída" : isActive ? ", atual" : ""}`,
2516
- ...props,
2517
- children: [
2518
- /* @__PURE__ */ jsxs("div", { className: "flex w-full items-start", children: [
2519
- step > 1 && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step <= currentStep)) }),
2520
- /* @__PURE__ */ jsx("div", { className: circleClasses, children: error ? /* @__PURE__ */ jsx(X, { className: "h-5 w-5" }) : isCompleted ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5" }) : /* @__PURE__ */ jsx("span", { children: step }) }),
2521
- step < totalSteps && /* @__PURE__ */ jsx("div", { className: cn("h-0.5 flex-1 mt-[18px]", connectorClasses(step < currentStep)) })
2522
- ] }),
2523
- /* @__PURE__ */ jsxs(
2524
- "div",
2525
- {
2526
- className: cn(
2527
- "mt-2 px-1",
2528
- isFirst && "text-left self-start",
2529
- isLast && "text-right self-end",
2530
- !isFirst && !isLast && "text-center w-full"
2531
- ),
2532
- children: [
2533
- /* @__PURE__ */ jsx(
2534
- "div",
2535
- {
2536
- className: cn(
2537
- "transition-colors",
2538
- isActive || error ? "text-foreground" : "text-muted-foreground"
2539
- ),
2540
- children: label
2541
- }
2542
- ),
2543
- description && /* @__PURE__ */ jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: description })
2544
- ]
2545
- }
2546
- )
2547
- ]
2548
- }
2549
- );
2550
- }
2551
- );
2552
- Step.displayName = "Step";
2553
- function useStepper({
2554
- totalSteps,
2555
- initialStep = 1,
2556
- step: controlledStep,
2557
- onStepChange,
2558
- onBeforeNext
2559
- }) {
2560
- const [internalStep, setInternalStep] = useState(
2561
- () => Math.min(Math.max(1, initialStep), totalSteps)
2562
- );
2563
- const isControlled = controlledStep !== void 0;
2564
- const currentStep = isControlled ? controlledStep : internalStep;
2565
- const setStep = useCallback(
2566
- (s) => {
2567
- const clamped = Math.min(Math.max(1, s), totalSteps);
2568
- if (!isControlled) setInternalStep(clamped);
2569
- onStepChange == null ? void 0 : onStepChange(clamped);
2570
- },
2571
- [isControlled, onStepChange, totalSteps]
2572
- );
2573
- const isFirstStep = currentStep === 1;
2574
- const isLastStep = currentStep === totalSteps;
2575
- const canGoPrev = currentStep > 1;
2576
- const canGoNext = currentStep < totalSteps;
2577
- const next = useCallback(async () => {
2578
- if (!canGoNext) return;
2579
- if (onBeforeNext) {
2580
- const allowed = await onBeforeNext(currentStep);
2581
- if (!allowed) return;
2582
- }
2583
- setStep(currentStep + 1);
2584
- }, [canGoNext, currentStep, onBeforeNext, setStep]);
2585
- const prev = useCallback(() => {
2586
- if (!canGoPrev) return;
2587
- setStep(currentStep - 1);
2588
- }, [canGoPrev, currentStep, setStep]);
2589
- const goTo = useCallback((s) => setStep(s), [setStep]);
2590
- const reset = useCallback(() => setStep(1), [setStep]);
2591
- return {
2592
- currentStep,
2593
- totalSteps,
2594
- isFirstStep,
2595
- isLastStep,
2596
- canGoPrev,
2597
- canGoNext,
2598
- next,
2599
- prev,
2600
- goTo,
2601
- reset
2602
- };
2603
- }
2604
- function useFileUpload({
2605
- maxFiles = 1,
2606
- maxSize = 5 * 1024 * 1024,
2607
- onFilesChange,
2608
- onError,
2609
- disabled = false
2610
- } = {}) {
2611
- const [files, setFiles] = useState([]);
2612
- const [dragActive, setDragActive] = useState(false);
2613
- const [errorMessage, setErrorMessage] = useState(null);
2614
- const inputRef = useRef(null);
2615
- const handleFiles = useCallback(
2616
- (newFiles) => {
2617
- if (!newFiles) return;
2618
- setErrorMessage(null);
2619
- const filesArray = Array.from(newFiles);
2620
- const oversized = filesArray.filter((f) => f.size > maxSize);
2621
- const validFiles = filesArray.filter((f) => f.size <= maxSize);
2622
- if (oversized.length > 0) {
2623
- const limitMB = (maxSize / 1024 / 1024).toFixed(0);
2624
- setErrorMessage(
2625
- `${oversized.length} file(s) exceed the ${limitMB}MB limit and were not added.`
2626
- );
2627
- onError == null ? void 0 : onError(oversized, "size");
2628
- }
2629
- const merged = maxFiles === 1 ? validFiles.slice(0, 1) : [...files, ...validFiles].slice(0, maxFiles);
2630
- const countRejected = maxFiles === 1 ? validFiles.slice(1) : [...files, ...validFiles].slice(maxFiles);
2631
- if (countRejected.length > 0) {
2632
- setErrorMessage(
2633
- `Only ${maxFiles} file(s) allowed. ${countRejected.length} file(s) were not added.`
2634
- );
2635
- onError == null ? void 0 : onError(countRejected, "count");
2636
- }
2637
- setFiles(merged);
2638
- onFilesChange == null ? void 0 : onFilesChange(merged);
2639
- },
2640
- // eslint-disable-next-line react-hooks/exhaustive-deps
2641
- [files, maxFiles, maxSize, onError, onFilesChange]
2642
- );
2643
- const handleDrag = useCallback((e) => {
2644
- e.preventDefault();
2645
- e.stopPropagation();
2646
- if (e.type === "dragenter" || e.type === "dragover") {
2647
- setDragActive(true);
2648
- } else if (e.type === "dragleave") {
2649
- setDragActive(false);
2650
- }
2651
- }, []);
2652
- const handleDrop = useCallback(
2653
- (e) => {
2654
- e.preventDefault();
2655
- e.stopPropagation();
2656
- setDragActive(false);
2657
- if (disabled) return;
2658
- handleFiles(e.dataTransfer.files);
2659
- },
2660
- [disabled, handleFiles]
2661
- );
2662
- const handleChange = useCallback(
2663
- (e) => {
2664
- e.preventDefault();
2665
- if (disabled) return;
2666
- handleFiles(e.target.files);
2667
- },
2668
- [disabled, handleFiles]
2669
- );
2670
- const removeFile = useCallback(
2671
- (index) => {
2672
- setFiles((prev) => {
2673
- const updated = prev.filter((_, i) => i !== index);
2674
- onFilesChange == null ? void 0 : onFilesChange(updated);
2675
- if (updated.length === 0) setErrorMessage(null);
2676
- return updated;
2677
- });
2678
- },
2679
- [onFilesChange]
2680
- );
2681
- const openFileDialog = useCallback(() => {
2682
- var _a;
2683
- if (!disabled) {
2684
- setErrorMessage(null);
2685
- (_a = inputRef.current) == null ? void 0 : _a.click();
2686
- }
2687
- }, [disabled]);
2688
- return {
2689
- files,
2690
- dragActive,
2691
- errorMessage,
2692
- inputRef,
2693
- handleFiles,
2694
- handleDrag,
2695
- handleDrop,
2696
- handleChange,
2697
- removeFile,
2698
- openFileDialog
2699
- };
2700
- }
2701
- const FileUpload = React.forwardRef(
2702
- ({
2703
- className,
2704
- onFilesChange,
2705
- maxFiles = 1,
2706
- maxSize = 5 * 1024 * 1024,
2707
- // 5MB default
2708
- showPreview = true,
2709
- onError,
2710
- accept,
2711
- disabled,
2712
- ...props
2713
- }, ref) => {
2714
- const {
2715
- files,
2716
- dragActive,
2717
- errorMessage,
2718
- inputRef,
2719
- handleDrag,
2720
- handleDrop,
2721
- handleChange,
2722
- removeFile,
2723
- openFileDialog
2724
- } = useFileUpload({ maxFiles, maxSize, onFilesChange, onError, disabled });
2725
- return /* @__PURE__ */ jsxs("div", { ref, className: cn("w-full", className), children: [
2726
- /* @__PURE__ */ jsxs(
2727
- "div",
2728
- {
2729
- onDragEnter: handleDrag,
2730
- onDragLeave: handleDrag,
2731
- onDragOver: handleDrag,
2732
- onDrop: handleDrop,
2733
- onClick: openFileDialog,
2734
- className: cn(
2735
- "relative flex cursor-pointer flex-col items-center justify-center rounded-[var(--radius)] border-2 border-dashed border-border bg-background p-8 transition-colors hover:bg-muted/50",
2736
- dragActive && "border-primary bg-primary/5",
2737
- errorMessage && "border-destructive/50",
2738
- disabled && "cursor-not-allowed opacity-50"
2739
- ),
2740
- children: [
2741
- /* @__PURE__ */ jsx(Upload, { className: "mb-4 h-10 w-10 text-muted-foreground" }),
2742
- /* @__PURE__ */ jsxs("p", { className: "mb-2 text-foreground", children: [
2743
- /* @__PURE__ */ jsx("span", { className: "text-primary", children: "Click to upload" }),
2744
- " or drag and drop"
2745
- ] }),
2746
- /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
2747
- maxFiles > 1 ? `Up to ${maxFiles} files` : "1 file",
2748
- " • Max",
2749
- " ",
2750
- (maxSize / 1024 / 1024).toFixed(0),
2751
- "MB"
2752
- ] }),
2753
- /* @__PURE__ */ jsx(
2754
- "input",
2755
- {
2756
- ...props,
2757
- ref: inputRef,
2758
- type: "file",
2759
- className: "hidden",
2760
- onChange: handleChange,
2761
- multiple: maxFiles > 1,
2762
- accept,
2763
- disabled
2764
- }
2765
- )
2766
- ]
2767
- }
2768
- ),
2769
- errorMessage && /* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-2 rounded-[var(--radius)] border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive", children: [
2770
- /* @__PURE__ */ jsx(AlertCircle, { className: "h-4 w-4 shrink-0" }),
2771
- /* @__PURE__ */ jsx("span", { children: errorMessage })
2772
- ] }),
2773
- showPreview && files.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-4 space-y-2", children: files.map((file, index) => /* @__PURE__ */ jsxs(
2774
- "div",
2775
- {
2776
- className: "flex items-center justify-between rounded-[var(--radius)] border border-border bg-card p-3",
2777
- children: [
2778
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
2779
- /* @__PURE__ */ jsx(FileIcon, { className: "h-5 w-5 text-muted-foreground" }),
2780
- /* @__PURE__ */ jsxs("div", { children: [
2781
- /* @__PURE__ */ jsx("p", { className: "text-foreground", children: file.name }),
2782
- /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground", children: [
2783
- (file.size / 1024).toFixed(2),
2784
- " KB"
2785
- ] })
2786
- ] })
2787
- ] }),
2788
- /* @__PURE__ */ jsx(
2789
- Button,
2790
- {
2791
- type: "button",
2792
- variant: "ghost",
2793
- size: "sm",
2794
- onClick: (e) => {
2795
- e.stopPropagation();
2796
- removeFile(index);
2797
- },
2798
- disabled,
2799
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
2800
- }
2801
- )
2802
- ]
2803
- },
2804
- index
2805
- )) })
2806
- ] });
2807
- }
2808
- );
2809
- FileUpload.displayName = "FileUpload";
2810
- const Rating = React.forwardRef(
2811
- ({
2812
- className,
2813
- value = 0,
2814
- onChange,
2815
- max = 5,
2816
- readonly = false,
2817
- disabled = false,
2818
- size = "md",
2819
- showValue = false,
2820
- allowHalf = false,
2821
- getAriaLabel,
2822
- ...props
2823
- }, ref) => {
2824
- const [hoverValue, setHoverValue] = React.useState(null);
2825
- const isInteractive = !readonly && !disabled;
2826
- const sizeStyles = {
2827
- sm: "h-4 w-4",
2828
- md: "h-5 w-5",
2829
- lg: "h-6 w-6"
2830
- };
2831
- const handleClick = (rating) => {
2832
- if (isInteractive) onChange == null ? void 0 : onChange(rating);
2833
- };
2834
- const handleMouseMove = (e, rating) => {
2835
- if (!isInteractive) return;
2836
- if (allowHalf) {
2837
- const rect = e.currentTarget.getBoundingClientRect();
2838
- setHoverValue(e.clientX - rect.left < rect.width / 2 ? rating - 0.5 : rating);
2839
- } else {
2840
- setHoverValue(rating);
2841
- }
2842
- };
2843
- const handleMouseLeave = () => {
2844
- if (isInteractive) setHoverValue(null);
2845
- };
2846
- const handleClickWithHalf = (e, rating) => {
2847
- if (!isInteractive) return;
2848
- if (allowHalf) {
2849
- const rect = e.currentTarget.getBoundingClientRect();
2850
- const half = e.clientX - rect.left < rect.width / 2 ? rating - 0.5 : rating;
2851
- onChange == null ? void 0 : onChange(half);
2852
- } else {
2853
- handleClick(rating);
2854
- }
2855
- };
2856
- const displayValue = hoverValue ?? value;
2857
- return /* @__PURE__ */ jsxs(
2858
- "div",
2859
- {
2860
- ref,
2861
- className: cn("flex items-center gap-1", disabled && "opacity-50", className),
2862
- ...props,
2863
- children: [
2864
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5", role: "group", "aria-label": "Rating", children: Array.from({ length: max }, (_, index) => {
2865
- const rating = index + 1;
2866
- const isFull = rating <= displayValue;
2867
- const isHalf = allowHalf && !isFull && rating - 0.5 <= displayValue;
2868
- return /* @__PURE__ */ jsxs(
2869
- "button",
2870
- {
2871
- type: "button",
2872
- onClick: (e) => handleClickWithHalf(e, rating),
2873
- onMouseMove: (e) => handleMouseMove(e, rating),
2874
- onMouseLeave: handleMouseLeave,
2875
- disabled: readonly || disabled,
2876
- "aria-label": getAriaLabel ? getAriaLabel(rating, max) : `${rating} / ${max}`,
2877
- className: cn(
2878
- "relative transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
2879
- isInteractive && "cursor-pointer hover:scale-110",
2880
- !isInteractive && "cursor-default"
2881
- ),
2882
- children: [
2883
- /* @__PURE__ */ jsx(Star, { className: cn(sizeStyles[size], "fill-none text-muted-foreground") }),
2884
- (isFull || isHalf) && /* @__PURE__ */ jsx(
2885
- "span",
2886
- {
2887
- className: cn("absolute inset-0 overflow-hidden", isHalf ? "w-1/2" : "w-full"),
2888
- children: /* @__PURE__ */ jsx(Star, { className: cn(sizeStyles[size], "fill-warning text-warning") })
2889
- }
2890
- )
2891
- ]
2892
- },
2893
- index
2894
- );
2895
- }) }),
2896
- showValue && /* @__PURE__ */ jsx("span", { className: "ml-2 text-sm text-muted-foreground", children: value % 1 === 0 ? value.toFixed(0) : value.toFixed(1) })
2897
- ]
2898
- }
2899
- );
2900
- }
2901
- );
2902
- Rating.displayName = "Rating";
2903
- const Search = React.forwardRef(
2904
- ({
2905
- className,
2906
- containerClassName,
2907
- onSearch,
2908
- onClear,
2909
- onChange,
2910
- size = "md",
2911
- searchLabel = "Search",
2912
- clearLabel = "Clear search",
2913
- value: controlledValue,
2914
- defaultValue,
2915
- ...props
2916
- }, ref) => {
2917
- const isControlled = controlledValue !== void 0;
2918
- const [internalValue, setInternalValue] = React.useState(
2919
- isControlled ? "" : defaultValue ?? ""
2920
- );
2921
- const displayValue = isControlled ? controlledValue : internalValue;
2922
- const sizeClasses = {
2923
- sm: "h-8 px-8 py-1 text-sm",
2924
- md: "h-10 px-10 py-2 text-base",
2925
- lg: "h-12 px-12 py-3 text-base"
2926
- };
2927
- const iconSizeClasses = {
2928
- sm: "left-2 h-3.5 w-3.5",
2929
- md: "left-3 h-4 w-4",
2930
- lg: "left-4 h-5 w-5"
2931
- };
2932
- const clearSizeClasses = {
2933
- sm: "right-2",
2934
- md: "right-3",
2935
- lg: "right-4"
2936
- };
2937
- const handleChange = (e) => {
2938
- const newValue = e.target.value;
2939
- if (!isControlled) setInternalValue(newValue);
2940
- onChange == null ? void 0 : onChange(e);
2941
- onSearch == null ? void 0 : onSearch(newValue);
2942
- };
2943
- const handleClear = () => {
2944
- if (!isControlled) setInternalValue("");
2945
- onClear == null ? void 0 : onClear();
2946
- onSearch == null ? void 0 : onSearch("");
2947
- };
2948
- const handleKeyDown = (e) => {
2949
- var _a;
2950
- if (e.key === "Escape") {
2951
- handleClear();
2952
- }
2953
- (_a = props.onKeyDown) == null ? void 0 : _a.call(props, e);
2954
- };
2955
- return /* @__PURE__ */ jsxs("div", { className: cn("relative w-full", containerClassName), children: [
2956
- /* @__PURE__ */ jsx(
2957
- Search$1,
2958
- {
2959
- "aria-hidden": "true",
2960
- className: cn(
2961
- "absolute top-1/2 -translate-y-1/2 text-muted-foreground",
2962
- iconSizeClasses[size]
2963
- )
2964
- }
2965
- ),
2966
- /* @__PURE__ */ jsx(
2967
- "input",
2968
- {
2969
- ref,
2970
- type: "text",
2971
- value: displayValue,
2972
- onChange: handleChange,
2973
- onKeyDown: handleKeyDown,
2974
- className: cn(
2975
- "flex w-full rounded-[var(--radius)] border border-border bg-background text-foreground transition-colors outline-none",
2976
- "placeholder:text-muted-foreground",
2977
- "focus:ring-2 focus:ring-primary focus:border-transparent",
2978
- "disabled:cursor-not-allowed disabled:opacity-50",
2979
- sizeClasses[size],
2980
- className
2981
- ),
2982
- "aria-label": props.placeholder || searchLabel,
2983
- ...props
2984
- }
2985
- ),
2986
- displayValue && /* @__PURE__ */ jsx(
2987
- "button",
2988
- {
2989
- type: "button",
2990
- onClick: handleClear,
2991
- "aria-label": clearLabel,
2992
- className: cn(
2993
- "absolute top-1/2 -translate-y-1/2 text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
2994
- clearSizeClasses[size]
2995
- ),
2996
- children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
2997
- }
2998
- )
2999
- ] });
3000
- }
3001
- );
3002
- Search.displayName = "Search";
3003
- const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false, "VITE_GEMINI_API_KEY": "AIzaSyBnoWKe4LjQzlIklON_dVXMXNUl2gvfH6U", "VITE_GOOGLE_MAPS_API_KEY": "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" };
3004
- const RouteMapContent = React__default.forwardRef(
3005
- ({ apiKey, ...props }, ref) => {
3006
- const { isLoaded, loadError, load } = useGoogleMapsLoader();
3007
- const {
3008
- origin,
3009
- destination,
3010
- waypoints = [],
3011
- travelMode = "DRIVING",
3012
- height = "450px",
3013
- mapContainerClassName,
3014
- disableDefaultUI = false,
3015
- zoomControl = true,
3016
- streetViewControl = false,
3017
- mapTypeControl = false,
3018
- fullscreenControl = true,
3019
- onRouteCalculated,
3020
- className,
3021
- ...divProps
3022
- } = props;
3023
- const mapRef = useRef(null);
3024
- const gmpMapRef = useRef(null);
3025
- const directionsRendererRef = useRef(null);
3026
- useRef(false);
3027
- const isCalculatingRef = useRef(false);
3028
- useEffect(() => {
3029
- if (!isLoaded && apiKey && !loadError && load) {
3030
- load(apiKey).catch(console.error);
3031
- }
3032
- }, [isLoaded, apiKey, loadError, load]);
3033
- useEffect(() => {
3034
- if (!isLoaded || !gmpMapRef.current) return;
3035
- const setupMap = (map) => {
3036
- mapRef.current = map;
3037
- const computedStyle = getComputedStyle(document.documentElement);
3038
- const primaryColor = computedStyle.getPropertyValue("--primary").trim() || "#4F46E5";
3039
- if (!directionsRendererRef.current) {
3040
- directionsRendererRef.current = new google.maps.DirectionsRenderer({
3041
- map,
3042
- suppressMarkers: false,
3043
- polylineOptions: {
3044
- strokeColor: primaryColor,
3045
- strokeWeight: 5,
3046
- strokeOpacity: 0.8
3047
- }
3048
- });
3049
- } else {
3050
- directionsRendererRef.current.setMap(map);
3051
- }
3052
- };
3053
- const gmpMap = gmpMapRef.current;
3054
- if (gmpMap.innerMap) {
3055
- setupMap(gmpMap.innerMap);
3056
- } else {
3057
- const interval = setInterval(() => {
3058
- if (gmpMap.innerMap) {
3059
- setupMap(gmpMap.innerMap);
3060
- clearInterval(interval);
3061
- }
3062
- }, 100);
3063
- return () => clearInterval(interval);
3064
- }
3065
- return () => {
3066
- if (directionsRendererRef.current) {
3067
- directionsRendererRef.current.setMap(null);
3068
- }
3069
- mapRef.current = null;
3070
- };
3071
- }, [isLoaded]);
3072
- useEffect(() => {
3073
- if (gmpMapRef.current && origin) {
3074
- gmpMapRef.current.center = origin;
3075
- }
3076
- }, [origin.lat, origin.lng]);
3077
- useEffect(() => {
3078
- if (gmpMapRef.current) {
3079
- gmpMapRef.current.zoom = 13;
3080
- }
3081
- }, []);
3082
- useEffect(() => {
3083
- const map = mapRef.current;
3084
- const renderer = directionsRendererRef.current;
3085
- if (!map || !renderer || !isLoaded || isCalculatingRef.current) return;
3086
- if (!origin || !destination) return;
3087
- isCalculatingRef.current = true;
3088
- const directionsService = new google.maps.DirectionsService();
3089
- const request = {
3090
- origin,
3091
- destination,
3092
- waypoints: waypoints.map((wp) => ({
3093
- location: wp,
3094
- stopover: true
3095
- })),
3096
- travelMode: google.maps.TravelMode[travelMode]
3097
- };
3098
- directionsService.route(request, (result, status) => {
3099
- var _a;
3100
- isCalculatingRef.current = false;
3101
- if (status === "OK" && result) {
3102
- renderer.setDirections(result);
3103
- const route = result.routes[0];
3104
- if (((_a = route == null ? void 0 : route.legs) == null ? void 0 : _a.length) > 0 && onRouteCalculated) {
3105
- let totalDistance = 0;
3106
- let totalDuration = 0;
3107
- route.legs.forEach((leg) => {
3108
- if (leg.distance) totalDistance += leg.distance.value;
3109
- if (leg.duration) totalDuration += leg.duration.value;
3110
- });
3111
- const distanceKm = (totalDistance / 1e3).toFixed(1);
3112
- const distanceText = `${distanceKm} km`;
3113
- const hours = Math.floor(totalDuration / 3600);
3114
- const minutes = Math.floor(totalDuration % 3600 / 60);
3115
- const durationText = hours > 0 ? `${hours}h ${minutes}min` : `${minutes} min`;
3116
- onRouteCalculated(distanceText, durationText);
3117
- }
3118
- }
3119
- });
3120
- }, [
3121
- isLoaded,
3122
- origin.lat,
3123
- origin.lng,
3124
- destination.lat,
3125
- destination.lng,
3126
- travelMode,
3127
- mapRef.current
3128
- ]);
3129
- if (loadError) {
3130
- return /* @__PURE__ */ jsx(
3131
- "div",
3132
- {
3133
- ref,
3134
- className: cn(
3135
- "relative rounded-[var(--radius-card)] border border-destructive/50 overflow-hidden bg-destructive/5",
3136
- className
3137
- ),
3138
- style: { height },
3139
- ...divProps,
3140
- children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsxs("div", { className: "text-center space-y-2 p-6", children: [
3141
- /* @__PURE__ */ jsx("div", { className: "text-destructive", children: /* @__PURE__ */ jsx(
3142
- "svg",
3143
- {
3144
- className: "w-12 h-12 mx-auto",
3145
- fill: "none",
3146
- stroke: "currentColor",
3147
- viewBox: "0 0 24 24",
3148
- children: /* @__PURE__ */ jsx(
3149
- "path",
3150
- {
3151
- strokeLinecap: "round",
3152
- strokeLinejoin: "round",
3153
- strokeWidth: 2,
3154
- d: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
3155
- }
3156
- )
3157
- }
3158
- ) }),
3159
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: "Failed to load Google Maps" }),
3160
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Check API key in Settings" })
3161
- ] }) })
3162
- }
3163
- );
3164
- }
3165
- if (!isLoaded) {
3166
- return /* @__PURE__ */ jsx(
3167
- "div",
3168
- {
3169
- ref,
3170
- className: cn(
3171
- "relative rounded-[var(--radius-card)] border border-border overflow-hidden bg-muted animate-pulse",
3172
- className
3173
- ),
3174
- style: { height },
3175
- ...divProps
3176
- }
3177
- );
3178
- }
3179
- return /* @__PURE__ */ jsx(
3180
- "div",
3181
- {
3182
- ref,
3183
- className: cn(
3184
- "relative rounded-[var(--radius-card)] border border-border overflow-hidden",
3185
- className
3186
- ),
3187
- style: { height },
3188
- ...divProps,
3189
- children: /* @__PURE__ */ jsx(
3190
- "gmp-map",
3191
- {
3192
- ref: gmpMapRef,
3193
- style: { height: "100%", width: "100%", display: "block" },
3194
- "map-id": props.mapId || "xertica-route-map"
3195
- }
3196
- )
3197
- }
3198
- );
3199
- }
3200
- );
3201
- RouteMapContent.displayName = "RouteMapContent";
3202
- const RouteMap = React__default.forwardRef((props, ref) => {
3203
- const { isLoaded, loadError } = useGoogleMapsLoader();
3204
- const effectiveApiKey = props.apiKey || typeof import.meta !== "undefined" && __vite_import_meta_env__ && "AIzaSyCj19NndSgZOb8057q24UbJtSsfVJiyVdo" || "";
3205
- const isValidKey = effectiveApiKey && effectiveApiKey !== "YOUR_GOOGLE_MAPS_API_KEY_HERE" && effectiveApiKey.startsWith("AIza");
3206
- if (isLoaded || isValidKey || loadError) {
3207
- return /* @__PURE__ */ jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
3208
- }
3209
- const isScriptInjected = typeof document !== "undefined" && !!document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]');
3210
- if (isScriptInjected) {
3211
- return /* @__PURE__ */ jsx(RouteMapContent, { ref, ...props, apiKey: effectiveApiKey });
3212
- }
3213
- const {
3214
- origin,
3215
- destination,
3216
- waypoints,
3217
- travelMode,
3218
- height,
3219
- apiKey,
3220
- mapContainerClassName,
3221
- disableDefaultUI,
3222
- zoomControl,
3223
- streetViewControl,
3224
- mapTypeControl,
3225
- fullscreenControl,
3226
- onRouteCalculated,
3227
- ...divProps
3228
- } = props;
3229
- return /* @__PURE__ */ jsx(
3230
- "div",
3231
- {
3232
- ref,
3233
- className: cn(
3234
- "relative rounded-[var(--radius-card)] border border-border overflow-hidden bg-muted",
3235
- props.className
3236
- ),
3237
- style: { height: props.height || "450px" },
3238
- ...divProps,
3239
- children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-gradient-to-br from-muted/50 to-muted", children: /* @__PURE__ */ jsxs("div", { className: "text-center space-y-3 p-6", children: [
3240
- /* @__PURE__ */ jsx("div", { className: "w-16 h-16 mx-auto bg-primary/10 rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsxs(
3241
- "svg",
3242
- {
3243
- className: "w-8 h-8 text-primary",
3244
- fill: "none",
3245
- stroke: "currentColor",
3246
- viewBox: "0 0 24 24",
3247
- children: [
3248
- /* @__PURE__ */ jsx(
3249
- "path",
3250
- {
3251
- strokeLinecap: "round",
3252
- strokeLinejoin: "round",
3253
- strokeWidth: 2,
3254
- d: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"
3255
- }
3256
- ),
3257
- /* @__PURE__ */ jsx(
3258
- "path",
3259
- {
3260
- strokeLinecap: "round",
3261
- strokeLinejoin: "round",
3262
- strokeWidth: 2,
3263
- d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
3264
- }
3265
- )
3266
- ]
3267
- }
3268
- ) }),
3269
- /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Configure Google Maps API Key in Settings" })
3270
- ] }) })
3271
- }
3272
- );
3273
- });
3274
- RouteMap.displayName = "RouteMap";
3275
- const SimpleMap = React__default.forwardRef(
3276
- ({
3277
- center,
3278
- address,
3279
- markerTitle,
3280
- markerInfo,
3281
- showMarker = true,
3282
- zoom = 15,
3283
- height = "350px",
3284
- ...props
3285
- }, ref) => {
3286
- const markers = showMarker && center ? [
3287
- {
3288
- position: center,
3289
- title: markerTitle || address || "Location",
3290
- info: markerInfo || address
3291
- }
3292
- ] : [];
3293
- return /* @__PURE__ */ jsx(Map$1, { ref, center, zoom, height, markers, ...props });
3294
- }
3295
- );
3296
- SimpleMap.displayName = "SimpleMap";
3297
- function AssistantChart({
3298
- data,
3299
- config,
3300
- categoryKey = "month",
3301
- bars,
3302
- xAxisFormatter,
3303
- className
3304
- }) {
3305
- const resolvedBars = bars ?? Object.keys(config).map((key) => ({ dataKey: key }));
3306
- const formatTick = xAxisFormatter ?? ((value) => value.slice(0, 3));
3307
- return /* @__PURE__ */ jsx(ChartContainer, { config, className: cn("min-h-[200px] w-full", className), children: /* @__PURE__ */ jsxs(BarChart, { accessibilityLayer: true, data, children: [
3308
- /* @__PURE__ */ jsx(CartesianGrid, { vertical: false }),
3309
- /* @__PURE__ */ jsx(
3310
- XAxis,
3311
- {
3312
- dataKey: categoryKey,
3313
- tickLine: false,
3314
- tickMargin: 10,
3315
- axisLine: false,
3316
- tickFormatter: formatTick
3317
- }
3318
- ),
3319
- /* @__PURE__ */ jsx(ChartTooltip, { cursor: false, content: /* @__PURE__ */ jsx(ChartTooltipContent, { indicator: "dashed" }) }),
3320
- resolvedBars.map((bar) => /* @__PURE__ */ jsx(
3321
- Bar,
3322
- {
3323
- dataKey: bar.dataKey,
3324
- fill: bar.fill ?? `var(--color-${bar.dataKey})`,
3325
- radius: bar.radius ?? 4
3326
- },
3327
- bar.dataKey
3328
- ))
3329
- ] }) });
3330
- }
3331
- export {
3332
- FormControl as $,
3333
- Accordion as A,
3334
- ContextMenuGroup as B,
3335
- Calendar as C,
3336
- ContextMenuItem as D,
3337
- ContextMenuLabel as E,
3338
- ContextMenuPortal as F,
3339
- ContextMenuRadioGroup as G,
3340
- ContextMenuRadioItem as H,
3341
- ContextMenuSeparator as I,
3342
- ContextMenuShortcut as J,
3343
- ContextMenuSub as K,
3344
- ContextMenuSubContent as L,
3345
- ContextMenuSubTrigger as M,
3346
- ContextMenuTrigger as N,
3347
- Drawer as O,
3348
- DrawerClose as P,
3349
- DrawerContent as Q,
3350
- DrawerDescription as R,
3351
- DrawerFooter as S,
3352
- DrawerHandle as T,
3353
- DrawerHeader as U,
3354
- DrawerOverlay as V,
3355
- DrawerPortal as W,
3356
- DrawerTitle as X,
3357
- DrawerTrigger as Y,
3358
- FileUpload as Z,
3359
- Form as _,
3360
- AccordionContent as a,
3361
- Stepper as a$,
3362
- FormDescription as a0,
3363
- FormField as a1,
3364
- FormItem as a2,
3365
- FormLabel as a3,
3366
- FormMessage as a4,
3367
- HoverCard as a5,
3368
- HoverCardContent as a6,
3369
- HoverCardTrigger as a7,
3370
- InputOTP as a8,
3371
- InputOTPGroup as a9,
3372
- NotificationBadge as aA,
3373
- Pagination as aB,
3374
- PaginationContent as aC,
3375
- PaginationEllipsis as aD,
3376
- PaginationItem as aE,
3377
- PaginationLink as aF,
3378
- PaginationNext as aG,
3379
- PaginationPrevious as aH,
3380
- Rating as aI,
3381
- ResizableHandle as aJ,
3382
- ResizablePanel as aK,
3383
- ResizablePanelGroup as aL,
3384
- RouteMap as aM,
3385
- Search as aN,
3386
- Sheet as aO,
3387
- SheetBody as aP,
3388
- SheetClose as aQ,
3389
- SheetContent as aR,
3390
- SheetDescription as aS,
3391
- SheetFooter as aT,
3392
- SheetHeader as aU,
3393
- SheetPortal as aV,
3394
- SheetTitle as aW,
3395
- SheetTrigger as aX,
3396
- SimpleMap as aY,
3397
- StatsCard as aZ,
3398
- Step as a_,
3399
- InputOTPSeparator as aa,
3400
- InputOTPSlot as ab,
3401
- Menubar as ac,
3402
- MenubarCheckboxItem as ad,
3403
- MenubarContent as ae,
3404
- MenubarGroup as af,
3405
- MenubarItem as ag,
3406
- MenubarLabel as ah,
3407
- MenubarMenu as ai,
3408
- MenubarPortal as aj,
3409
- MenubarRadioGroup as ak,
3410
- MenubarRadioItem as al,
3411
- MenubarSeparator as am,
3412
- MenubarShortcut as an,
3413
- MenubarSub as ao,
3414
- MenubarSubContent as ap,
3415
- MenubarSubTrigger as aq,
3416
- MenubarTrigger as ar,
3417
- NavigationMenu as as,
3418
- NavigationMenuContent as at,
3419
- NavigationMenuIndicator as au,
3420
- NavigationMenuItem as av,
3421
- NavigationMenuLink as aw,
3422
- NavigationMenuList as ax,
3423
- NavigationMenuTrigger as ay,
3424
- NavigationMenuViewport as az,
3425
- AccordionItem as b,
3426
- Timeline as b0,
3427
- TimelineContent as b1,
3428
- TimelineDescription as b2,
3429
- TimelineDot as b3,
3430
- TimelineHeading as b4,
3431
- TimelineItem as b5,
3432
- TimelineTime as b6,
3433
- Toggle as b7,
3434
- ToggleGroup as b8,
3435
- ToggleGroupItem as b9,
3436
- TreeView as ba,
3437
- navigationMenuTriggerStyle as bb,
3438
- toggleVariants as bc,
3439
- useFileUpload as bd,
3440
- useFormField as be,
3441
- usePagination as bf,
3442
- useStepper as bg,
3443
- useStepperContext as bh,
3444
- useTreeView as bi,
3445
- AccordionTrigger as c,
3446
- AspectRatio as d,
3447
- AssistantChart as e,
3448
- CalendarDayButton as f,
3449
- Carousel as g,
3450
- CarouselContent as h,
3451
- CarouselItem as i,
3452
- CarouselNext as j,
3453
- CarouselPrevious as k,
3454
- Collapsible as l,
3455
- CollapsibleContent as m,
3456
- CollapsibleTrigger as n,
3457
- Command as o,
3458
- CommandDialog as p,
3459
- CommandEmpty as q,
3460
- CommandGroup as r,
3461
- CommandInput as s,
3462
- CommandItem as t,
3463
- CommandList as u,
3464
- CommandSeparator as v,
3465
- CommandShortcut as w,
3466
- ContextMenu as x,
3467
- ContextMenuCheckboxItem as y,
3468
- ContextMenuContent as z
3469
- };