xertica-ui 2.5.0 → 2.5.2

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