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