@m5kdev/web-ui 0.1.2 → 0.1.4

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 (371) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +12 -0
  3. package/dist/src/animations/card.motion.d.ts +3 -0
  4. package/dist/src/animations/card.motion.d.ts.map +1 -0
  5. package/dist/src/animations/card.motion.js +7 -0
  6. package/dist/src/components/AvatarUpload.d.ts +8 -0
  7. package/dist/src/components/AvatarUpload.d.ts.map +1 -0
  8. package/dist/src/components/AvatarUpload.js +67 -0
  9. package/dist/src/components/Button.d.ts +6 -0
  10. package/dist/src/components/Button.d.ts.map +1 -0
  11. package/dist/src/components/Button.js +5 -0
  12. package/dist/src/components/Calendar.d.ts +36 -0
  13. package/dist/src/components/Calendar.d.ts.map +1 -0
  14. package/dist/src/components/Calendar.js +10 -0
  15. package/dist/src/components/CardsSelect.d.ts +24 -0
  16. package/dist/src/components/CardsSelect.d.ts.map +1 -0
  17. package/dist/src/components/CardsSelect.js +46 -0
  18. package/dist/src/components/CollapsibleSidebarMenuItem.d.ts +10 -0
  19. package/dist/src/components/CollapsibleSidebarMenuItem.d.ts.map +1 -0
  20. package/dist/src/components/CollapsibleSidebarMenuItem.js +11 -0
  21. package/dist/src/components/ColorPicker.d.ts +5 -0
  22. package/dist/src/components/ColorPicker.d.ts.map +1 -0
  23. package/dist/src/components/ColorPicker.js +21 -0
  24. package/dist/src/components/CopyButton.d.ts +7 -0
  25. package/dist/src/components/CopyButton.d.ts.map +1 -0
  26. package/dist/src/components/CopyButton.js +24 -0
  27. package/dist/src/components/CropDialog.d.ts +11 -0
  28. package/dist/src/components/CropDialog.d.ts.map +1 -0
  29. package/dist/src/components/CropDialog.js +67 -0
  30. package/dist/src/components/DialogProvider.d.ts +16 -0
  31. package/dist/src/components/DialogProvider.d.ts.map +1 -0
  32. package/dist/src/components/DialogProvider.js +50 -0
  33. package/dist/src/components/ErrorFallback.d.ts +5 -0
  34. package/dist/src/components/ErrorFallback.d.ts.map +1 -0
  35. package/dist/src/components/ErrorFallback.js +5 -0
  36. package/dist/src/components/FileDropzone.d.ts +7 -0
  37. package/dist/src/components/FileDropzone.d.ts.map +1 -0
  38. package/dist/src/components/FileDropzone.js +63 -0
  39. package/dist/src/components/MultiSelectDropdown.d.ts +27 -0
  40. package/dist/src/components/MultiSelectDropdown.d.ts.map +1 -0
  41. package/dist/src/components/MultiSelectDropdown.js +53 -0
  42. package/dist/src/components/Orb.d.ts +7 -0
  43. package/dist/src/components/Orb.d.ts.map +1 -0
  44. package/dist/src/components/Orb.js +259 -0
  45. package/dist/src/components/PageAlert.d.ts +19 -0
  46. package/dist/src/components/PageAlert.d.ts.map +1 -0
  47. package/dist/src/components/PageAlert.js +48 -0
  48. package/dist/src/components/SelectChips.d.ts +11 -0
  49. package/dist/src/components/SelectChips.d.ts.map +1 -0
  50. package/dist/src/components/SelectChips.js +11 -0
  51. package/dist/src/components/SidebarItem.d.ts +8 -0
  52. package/dist/src/components/SidebarItem.d.ts.map +1 -0
  53. package/dist/src/components/SidebarItem.js +6 -0
  54. package/dist/src/components/Steps.d.ts +20 -0
  55. package/dist/src/components/Steps.d.ts.map +1 -0
  56. package/dist/src/components/Steps.js +34 -0
  57. package/dist/src/components/TablerIconPicker.d.ts +3 -0
  58. package/dist/src/components/TablerIconPicker.d.ts.map +1 -0
  59. package/dist/src/components/TablerIconPicker.js +4238 -0
  60. package/dist/src/components/app-header.d.ts +7 -0
  61. package/dist/src/components/app-header.d.ts.map +1 -0
  62. package/dist/src/components/app-header.js +8 -0
  63. package/dist/src/components/blur-card.d.ts +14 -0
  64. package/dist/src/components/blur-card.d.ts.map +1 -0
  65. package/dist/src/components/blur-card.js +34 -0
  66. package/dist/src/components/features-section-demo-1.d.ts +7 -0
  67. package/dist/src/components/features-section-demo-1.d.ts.map +1 -0
  68. package/dist/src/components/features-section-demo-1.js +53 -0
  69. package/dist/src/components/features-section-demo-2.d.ts +2 -0
  70. package/dist/src/components/features-section-demo-2.d.ts.map +1 -0
  71. package/dist/src/components/features-section-demo-2.js +51 -0
  72. package/dist/src/components/features-section-demo-3.d.ts +9 -0
  73. package/dist/src/components/features-section-demo-3.d.ts.map +1 -0
  74. package/dist/src/components/features-section-demo-3.js +116 -0
  75. package/dist/src/components/mode-toggle.d.ts +2 -0
  76. package/dist/src/components/mode-toggle.d.ts.map +1 -0
  77. package/dist/src/components/mode-toggle.js +9 -0
  78. package/dist/src/components/nav-main.d.ts +14 -0
  79. package/dist/src/components/nav-main.d.ts.map +1 -0
  80. package/dist/src/components/nav-main.js +9 -0
  81. package/dist/src/components/pricing-cards.d.ts +2 -0
  82. package/dist/src/components/pricing-cards.d.ts.map +1 -0
  83. package/dist/src/components/pricing-cards.js +27 -0
  84. package/dist/src/components/shared/ButtonCopy.d.ts +7 -0
  85. package/dist/src/components/shared/ButtonCopy.d.ts.map +1 -0
  86. package/dist/src/components/shared/ButtonCopy.js +24 -0
  87. package/dist/src/components/team-switcher.d.ts +9 -0
  88. package/dist/src/components/team-switcher.d.ts.map +1 -0
  89. package/dist/src/components/team-switcher.js +10 -0
  90. package/dist/src/components/theme-provider.d.ts +14 -0
  91. package/dist/src/components/theme-provider.d.ts.map +1 -0
  92. package/dist/src/components/theme-provider.js +41 -0
  93. package/dist/src/components/typewriter.d.ts +19 -0
  94. package/dist/src/components/typewriter.d.ts.map +1 -0
  95. package/dist/src/components/typewriter.js +38 -0
  96. package/dist/src/components/ui/alert-dialog.d.ts +15 -0
  97. package/dist/src/components/ui/alert-dialog.d.ts.map +1 -0
  98. package/dist/src/components/ui/alert-dialog.js +38 -0
  99. package/dist/src/components/ui/alert.d.ts +10 -0
  100. package/dist/src/components/ui/alert.d.ts.map +1 -0
  101. package/dist/src/components/ui/alert.js +24 -0
  102. package/dist/src/components/ui/avatar.d.ts +7 -0
  103. package/dist/src/components/ui/avatar.d.ts.map +1 -0
  104. package/dist/src/components/ui/avatar.js +12 -0
  105. package/dist/src/components/ui/badge.d.ts +10 -0
  106. package/dist/src/components/ui/badge.d.ts.map +1 -0
  107. package/dist/src/components/ui/badge.js +20 -0
  108. package/dist/src/components/ui/bento-grid.d.ts +12 -0
  109. package/dist/src/components/ui/bento-grid.d.ts.map +1 -0
  110. package/dist/src/components/ui/bento-grid.js +8 -0
  111. package/dist/src/components/ui/bento-grid2.d.ts +16 -0
  112. package/dist/src/components/ui/bento-grid2.d.ts.map +1 -0
  113. package/dist/src/components/ui/bento-grid2.js +13 -0
  114. package/dist/src/components/ui/breadcrumb.d.ts +20 -0
  115. package/dist/src/components/ui/breadcrumb.d.ts.map +1 -0
  116. package/dist/src/components/ui/breadcrumb.js +23 -0
  117. package/dist/src/components/ui/button.d.ts +12 -0
  118. package/dist/src/components/ui/button.d.ts.map +1 -0
  119. package/dist/src/components/ui/button.js +33 -0
  120. package/dist/src/components/ui/card.d.ts +9 -0
  121. package/dist/src/components/ui/card.d.ts.map +1 -0
  122. package/dist/src/components/ui/card.js +16 -0
  123. package/dist/src/components/ui/checkbox.d.ts +5 -0
  124. package/dist/src/components/ui/checkbox.d.ts.map +1 -0
  125. package/dist/src/components/ui/checkbox.js +8 -0
  126. package/dist/src/components/ui/collapsible.d.ts +6 -0
  127. package/dist/src/components/ui/collapsible.d.ts.map +1 -0
  128. package/dist/src/components/ui/collapsible.js +5 -0
  129. package/dist/src/components/ui/dialog.d.ts +14 -0
  130. package/dist/src/components/ui/dialog.d.ts.map +1 -0
  131. package/dist/src/components/ui/dialog.js +35 -0
  132. package/dist/src/components/ui/dropdown-menu.d.ts +28 -0
  133. package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -0
  134. package/dist/src/components/ui/dropdown-menu.js +32 -0
  135. package/dist/src/components/ui/floating-navbar.d.ts +10 -0
  136. package/dist/src/components/ui/floating-navbar.d.ts.map +1 -0
  137. package/dist/src/components/ui/floating-navbar.js +38 -0
  138. package/dist/src/components/ui/form.d.ts +24 -0
  139. package/dist/src/components/ui/form.d.ts.map +1 -0
  140. package/dist/src/components/ui/form.js +60 -0
  141. package/dist/src/components/ui/image.d.ts +7 -0
  142. package/dist/src/components/ui/image.d.ts.map +1 -0
  143. package/dist/src/components/ui/image.js +15 -0
  144. package/dist/src/components/ui/input.d.ts +4 -0
  145. package/dist/src/components/ui/input.d.ts.map +1 -0
  146. package/dist/src/components/ui/input.js +8 -0
  147. package/dist/src/components/ui/label.d.ts +6 -0
  148. package/dist/src/components/ui/label.d.ts.map +1 -0
  149. package/dist/src/components/ui/label.js +9 -0
  150. package/dist/src/components/ui/pagination.d.ts +14 -0
  151. package/dist/src/components/ui/pagination.d.ts.map +1 -0
  152. package/dist/src/components/ui/pagination.js +29 -0
  153. package/dist/src/components/ui/progress.d.ts +5 -0
  154. package/dist/src/components/ui/progress.d.ts.map +1 -0
  155. package/dist/src/components/ui/progress.js +7 -0
  156. package/dist/src/components/ui/resizable-navbar.d.ts +57 -0
  157. package/dist/src/components/ui/resizable-navbar.d.ts.map +1 -0
  158. package/dist/src/components/ui/resizable-navbar.js +86 -0
  159. package/dist/src/components/ui/segment-control.d.ts +10 -0
  160. package/dist/src/components/ui/segment-control.d.ts.map +1 -0
  161. package/dist/src/components/ui/segment-control.js +42 -0
  162. package/dist/src/components/ui/select.d.ts +14 -0
  163. package/dist/src/components/ui/select.d.ts.map +1 -0
  164. package/dist/src/components/ui/select.js +26 -0
  165. package/dist/src/components/ui/separator.d.ts +5 -0
  166. package/dist/src/components/ui/separator.d.ts.map +1 -0
  167. package/dist/src/components/ui/separator.js +7 -0
  168. package/dist/src/components/ui/sheet.d.ts +26 -0
  169. package/dist/src/components/ui/sheet.d.ts.map +1 -0
  170. package/dist/src/components/ui/sheet.js +37 -0
  171. package/dist/src/components/ui/sidebar.d.ts +67 -0
  172. package/dist/src/components/ui/sidebar.d.ts.map +1 -0
  173. package/dist/src/components/ui/sidebar.js +222 -0
  174. package/dist/src/components/ui/skeleton.d.ts +3 -0
  175. package/dist/src/components/ui/skeleton.d.ts.map +1 -0
  176. package/dist/src/components/ui/skeleton.js +6 -0
  177. package/dist/src/components/ui/slider.d.ts +5 -0
  178. package/dist/src/components/ui/slider.d.ts.map +1 -0
  179. package/dist/src/components/ui/slider.js +7 -0
  180. package/dist/src/components/ui/sonner.d.ts +5 -0
  181. package/dist/src/components/ui/sonner.d.ts.map +1 -0
  182. package/dist/src/components/ui/sonner.js +15 -0
  183. package/dist/src/components/ui/spinner.d.ts +15 -0
  184. package/dist/src/components/ui/spinner.d.ts.map +1 -0
  185. package/dist/src/components/ui/spinner.js +30 -0
  186. package/dist/src/components/ui/switch.d.ts +5 -0
  187. package/dist/src/components/ui/switch.d.ts.map +1 -0
  188. package/dist/src/components/ui/switch.js +7 -0
  189. package/dist/src/components/ui/table.d.ts +11 -0
  190. package/dist/src/components/ui/table.d.ts.map +1 -0
  191. package/dist/src/components/ui/table.js +27 -0
  192. package/dist/src/components/ui/tabs.d.ts +8 -0
  193. package/dist/src/components/ui/tabs.d.ts.map +1 -0
  194. package/dist/src/components/ui/tabs.js +16 -0
  195. package/dist/src/components/ui/textarea.d.ts +4 -0
  196. package/dist/src/components/ui/textarea.d.ts.map +1 -0
  197. package/dist/src/components/ui/textarea.js +6 -0
  198. package/dist/src/components/ui/timeline.d.ts +12 -0
  199. package/dist/src/components/ui/timeline.d.ts.map +1 -0
  200. package/dist/src/components/ui/timeline.js +27 -0
  201. package/dist/src/components/ui/toast.d.ts +16 -0
  202. package/dist/src/components/ui/toast.d.ts.map +1 -0
  203. package/dist/src/components/ui/toast.js +33 -0
  204. package/dist/src/components/ui/tooltip.d.ts +8 -0
  205. package/dist/src/components/ui/tooltip.d.ts.map +1 -0
  206. package/dist/src/components/ui/tooltip.js +16 -0
  207. package/dist/src/components/ui/typewriter-effect.d.ts +17 -0
  208. package/dist/src/components/ui/typewriter-effect.d.ts.map +1 -0
  209. package/dist/src/components/ui/typewriter-effect.js +76 -0
  210. package/dist/src/hooks/use-mobile.d.ts +2 -0
  211. package/dist/src/hooks/use-mobile.d.ts.map +1 -0
  212. package/dist/src/hooks/use-mobile.js +15 -0
  213. package/dist/src/hooks/useDialog.d.ts +5 -0
  214. package/dist/src/hooks/useDialog.d.ts.map +1 -0
  215. package/dist/src/hooks/useDialog.js +22 -0
  216. package/dist/src/icons/GoogleIcon.d.ts +6 -0
  217. package/dist/src/icons/GoogleIcon.d.ts.map +1 -0
  218. package/dist/src/icons/GoogleIcon.js +4 -0
  219. package/dist/src/icons/LinkedInIcon.d.ts +6 -0
  220. package/dist/src/icons/LinkedInIcon.d.ts.map +1 -0
  221. package/dist/src/icons/LinkedInIcon.js +4 -0
  222. package/dist/src/icons/MicrosoftIcon.d.ts +6 -0
  223. package/dist/src/icons/MicrosoftIcon.d.ts.map +1 -0
  224. package/dist/src/icons/MicrosoftIcon.js +4 -0
  225. package/dist/src/lib/chatwoot.d.ts +12 -0
  226. package/dist/src/lib/chatwoot.d.ts.map +1 -0
  227. package/dist/src/lib/chatwoot.js +28 -0
  228. package/dist/src/lib/utils.d.ts +3 -0
  229. package/dist/src/lib/utils.d.ts.map +1 -0
  230. package/dist/src/lib/utils.js +5 -0
  231. package/dist/src/modules/app/components/AppLoader.d.ts +3 -0
  232. package/dist/src/modules/app/components/AppLoader.d.ts.map +1 -0
  233. package/dist/src/modules/app/components/AppLoader.js +5 -0
  234. package/dist/src/modules/app/components/AppShell.d.ts +8 -0
  235. package/dist/src/modules/app/components/AppShell.d.ts.map +1 -0
  236. package/dist/src/modules/app/components/AppShell.js +7 -0
  237. package/dist/src/modules/app/components/AppSidebar.d.ts +8 -0
  238. package/dist/src/modules/app/components/AppSidebar.d.ts.map +1 -0
  239. package/dist/src/modules/app/components/AppSidebar.js +5 -0
  240. package/dist/src/modules/app/components/AppSidebarContent.d.ts +17 -0
  241. package/dist/src/modules/app/components/AppSidebarContent.d.ts.map +1 -0
  242. package/dist/src/modules/app/components/AppSidebarContent.js +7 -0
  243. package/dist/src/modules/app/components/AppSidebarHeader.d.ts +9 -0
  244. package/dist/src/modules/app/components/AppSidebarHeader.d.ts.map +1 -0
  245. package/dist/src/modules/app/components/AppSidebarHeader.js +10 -0
  246. package/dist/src/modules/app/components/AppSidebarInvites.d.ts +4 -0
  247. package/dist/src/modules/app/components/AppSidebarInvites.d.ts.map +1 -0
  248. package/dist/src/modules/app/components/AppSidebarInvites.js +12 -0
  249. package/dist/src/modules/app/components/AppSidebarUser.d.ts +12 -0
  250. package/dist/src/modules/app/components/AppSidebarUser.d.ts.map +1 -0
  251. package/dist/src/modules/app/components/AppSidebarUser.js +16 -0
  252. package/dist/src/modules/auth/components/AdminUserManagement.d.ts +7 -0
  253. package/dist/src/modules/auth/components/AdminUserManagement.d.ts.map +1 -0
  254. package/dist/src/modules/auth/components/AdminUserManagement.js +422 -0
  255. package/dist/src/modules/auth/components/AdminWaitlist.d.ts +7 -0
  256. package/dist/src/modules/auth/components/AdminWaitlist.d.ts.map +1 -0
  257. package/dist/src/modules/auth/components/AdminWaitlist.js +118 -0
  258. package/dist/src/modules/auth/components/AuthLayout.d.ts +5 -0
  259. package/dist/src/modules/auth/components/AuthLayout.d.ts.map +1 -0
  260. package/dist/src/modules/auth/components/AuthLayout.js +5 -0
  261. package/dist/src/modules/auth/components/AuthProviders.d.ts +7 -0
  262. package/dist/src/modules/auth/components/AuthProviders.d.ts.map +1 -0
  263. package/dist/src/modules/auth/components/AuthProviders.js +45 -0
  264. package/dist/src/modules/auth/components/AuthRouter.d.ts +10 -0
  265. package/dist/src/modules/auth/components/AuthRouter.d.ts.map +1 -0
  266. package/dist/src/modules/auth/components/AuthRouter.js +12 -0
  267. package/dist/src/modules/auth/components/ClaimAccountRoute.d.ts +5 -0
  268. package/dist/src/modules/auth/components/ClaimAccountRoute.d.ts.map +1 -0
  269. package/dist/src/modules/auth/components/ClaimAccountRoute.js +143 -0
  270. package/dist/src/modules/auth/components/ErrorAuthRoute.d.ts +2 -0
  271. package/dist/src/modules/auth/components/ErrorAuthRoute.d.ts.map +1 -0
  272. package/dist/src/modules/auth/components/ErrorAuthRoute.js +93 -0
  273. package/dist/src/modules/auth/components/ForgotPasswordForm.d.ts +2 -0
  274. package/dist/src/modules/auth/components/ForgotPasswordForm.d.ts.map +1 -0
  275. package/dist/src/modules/auth/components/ForgotPasswordForm.js +27 -0
  276. package/dist/src/modules/auth/components/ForgotPasswordRoute.d.ts +2 -0
  277. package/dist/src/modules/auth/components/ForgotPasswordRoute.d.ts.map +1 -0
  278. package/dist/src/modules/auth/components/ForgotPasswordRoute.js +9 -0
  279. package/dist/src/modules/auth/components/InviteFriends.d.ts +6 -0
  280. package/dist/src/modules/auth/components/InviteFriends.d.ts.map +1 -0
  281. package/dist/src/modules/auth/components/InviteFriends.js +74 -0
  282. package/dist/src/modules/auth/components/LastUsedBadge.d.ts +6 -0
  283. package/dist/src/modules/auth/components/LastUsedBadge.d.ts.map +1 -0
  284. package/dist/src/modules/auth/components/LastUsedBadge.js +9 -0
  285. package/dist/src/modules/auth/components/LoginForm.d.ts +4 -0
  286. package/dist/src/modules/auth/components/LoginForm.d.ts.map +1 -0
  287. package/dist/src/modules/auth/components/LoginForm.js +44 -0
  288. package/dist/src/modules/auth/components/LoginRoute.d.ts +4 -0
  289. package/dist/src/modules/auth/components/LoginRoute.d.ts.map +1 -0
  290. package/dist/src/modules/auth/components/LoginRoute.js +11 -0
  291. package/dist/src/modules/auth/components/LogoutRoute.d.ts +2 -0
  292. package/dist/src/modules/auth/components/LogoutRoute.d.ts.map +1 -0
  293. package/dist/src/modules/auth/components/LogoutRoute.js +15 -0
  294. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.d.ts +10 -0
  295. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.d.ts.map +1 -0
  296. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js +102 -0
  297. package/dist/src/modules/auth/components/OrganizationMembersRoute.d.ts +52 -0
  298. package/dist/src/modules/auth/components/OrganizationMembersRoute.d.ts.map +1 -0
  299. package/dist/src/modules/auth/components/OrganizationMembersRoute.js +359 -0
  300. package/dist/src/modules/auth/components/OrganizationSettingsRoute.d.ts +21 -0
  301. package/dist/src/modules/auth/components/OrganizationSettingsRoute.d.ts.map +1 -0
  302. package/dist/src/modules/auth/components/OrganizationSettingsRoute.js +153 -0
  303. package/dist/src/modules/auth/components/OrganizationSwitcher.d.ts +8 -0
  304. package/dist/src/modules/auth/components/OrganizationSwitcher.d.ts.map +1 -0
  305. package/dist/src/modules/auth/components/OrganizationSwitcher.js +74 -0
  306. package/dist/src/modules/auth/components/ProfileRoute.d.ts +2 -0
  307. package/dist/src/modules/auth/components/ProfileRoute.d.ts.map +1 -0
  308. package/dist/src/modules/auth/components/ProfileRoute.js +42 -0
  309. package/dist/src/modules/auth/components/RangeNuqsDatePicker.d.ts +32 -0
  310. package/dist/src/modules/auth/components/RangeNuqsDatePicker.d.ts.map +1 -0
  311. package/dist/src/modules/auth/components/RangeNuqsDatePicker.js +236 -0
  312. package/dist/src/modules/auth/components/ResetPasswordForm.d.ts +2 -0
  313. package/dist/src/modules/auth/components/ResetPasswordForm.d.ts.map +1 -0
  314. package/dist/src/modules/auth/components/ResetPasswordForm.js +39 -0
  315. package/dist/src/modules/auth/components/ResetPasswordRoute.d.ts +2 -0
  316. package/dist/src/modules/auth/components/ResetPasswordRoute.d.ts.map +1 -0
  317. package/dist/src/modules/auth/components/ResetPasswordRoute.js +9 -0
  318. package/dist/src/modules/auth/components/SignupFormRoute.d.ts +6 -0
  319. package/dist/src/modules/auth/components/SignupFormRoute.d.ts.map +1 -0
  320. package/dist/src/modules/auth/components/SignupFormRoute.js +106 -0
  321. package/dist/src/modules/auth/components/SignupRoute.d.ts +8 -0
  322. package/dist/src/modules/auth/components/SignupRoute.d.ts.map +1 -0
  323. package/dist/src/modules/auth/components/SignupRoute.js +16 -0
  324. package/dist/src/modules/auth/components/UserPreferences.d.ts +31 -0
  325. package/dist/src/modules/auth/components/UserPreferences.d.ts.map +1 -0
  326. package/dist/src/modules/auth/components/UserPreferences.js +60 -0
  327. package/dist/src/modules/auth/components/WaitlistCard.d.ts +7 -0
  328. package/dist/src/modules/auth/components/WaitlistCard.d.ts.map +1 -0
  329. package/dist/src/modules/auth/components/WaitlistCard.js +32 -0
  330. package/dist/src/modules/auth/components/WaitlistCodeValidation.d.ts +8 -0
  331. package/dist/src/modules/auth/components/WaitlistCodeValidation.d.ts.map +1 -0
  332. package/dist/src/modules/auth/components/WaitlistCodeValidation.js +43 -0
  333. package/dist/src/modules/billing/components/BillingBetaPage.d.ts +9 -0
  334. package/dist/src/modules/billing/components/BillingBetaPage.d.ts.map +1 -0
  335. package/dist/src/modules/billing/components/BillingBetaPage.js +11 -0
  336. package/dist/src/modules/billing/components/BillingInvoicePage.d.ts +8 -0
  337. package/dist/src/modules/billing/components/BillingInvoicePage.d.ts.map +1 -0
  338. package/dist/src/modules/billing/components/BillingInvoicePage.js +32 -0
  339. package/dist/src/modules/billing/components/BillingPlanSelect.d.ts +7 -0
  340. package/dist/src/modules/billing/components/BillingPlanSelect.d.ts.map +1 -0
  341. package/dist/src/modules/billing/components/BillingPlanSelect.js +8 -0
  342. package/dist/src/modules/billing/components/BillingRouter.d.ts +10 -0
  343. package/dist/src/modules/billing/components/BillingRouter.d.ts.map +1 -0
  344. package/dist/src/modules/billing/components/BillingRouter.js +8 -0
  345. package/dist/src/modules/billing/components/BillingSinglePlanSelect.d.ts +9 -0
  346. package/dist/src/modules/billing/components/BillingSinglePlanSelect.d.ts.map +1 -0
  347. package/dist/src/modules/billing/components/BillingSinglePlanSelect.js +46 -0
  348. package/dist/src/modules/table/components/ColumnOrderAndVisibility.d.ts +11 -0
  349. package/dist/src/modules/table/components/ColumnOrderAndVisibility.d.ts.map +1 -0
  350. package/dist/src/modules/table/components/ColumnOrderAndVisibility.js +42 -0
  351. package/dist/src/modules/table/components/NuqsTable.d.ts +24 -0
  352. package/dist/src/modules/table/components/NuqsTable.d.ts.map +1 -0
  353. package/dist/src/modules/table/components/NuqsTable.js +198 -0
  354. package/dist/src/modules/table/components/TableFiltering.d.ts +24 -0
  355. package/dist/src/modules/table/components/TableFiltering.d.ts.map +1 -0
  356. package/dist/src/modules/table/components/TableFiltering.js +236 -0
  357. package/dist/src/modules/table/components/TablePagination.d.ts +10 -0
  358. package/dist/src/modules/table/components/TablePagination.d.ts.map +1 -0
  359. package/dist/src/modules/table/components/TablePagination.js +21 -0
  360. package/dist/src/modules/table/components/table.types.d.ts +13 -0
  361. package/dist/src/modules/table/components/table.types.d.ts.map +1 -0
  362. package/dist/src/modules/table/components/table.types.js +1 -0
  363. package/dist/src/modules/table/filterTransformers.d.ts +54 -0
  364. package/dist/src/modules/table/filterTransformers.d.ts.map +1 -0
  365. package/dist/src/modules/table/filterTransformers.js +276 -0
  366. package/dist/src/types.d.ts +4 -0
  367. package/dist/src/types.d.ts.map +1 -0
  368. package/dist/src/types.js +1 -0
  369. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  370. package/package.json +5 -5
  371. package/tsconfig.json +4 -1
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button } from "@heroui/react";
3
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
4
+ import { useTranslation } from "react-i18next";
5
+ import { toast } from "sonner";
6
+ import { GoogleIcon } from "#icons/GoogleIcon";
7
+ import { LinkedInIcon } from "#icons/LinkedInIcon";
8
+ import { MicrosoftIcon } from "#icons/MicrosoftIcon";
9
+ import { LastUsedBadge } from "./LastUsedBadge";
10
+ export function AuthProviders({ providers, lastMethod, code, requestSignUp = false, }) {
11
+ const { t } = useTranslation();
12
+ if (!providers || providers.length === 0)
13
+ return null;
14
+ const additionalData = code ? { waitlistInvitationCode: code } : {};
15
+ const handleSignIn = (result) => {
16
+ if (result.error) {
17
+ toast.error(t("web-ui:auth.errors.invitationCodeInvalid"));
18
+ }
19
+ };
20
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "flex flex-col gap-4", children: [providers.includes("google") && (_jsx(LastUsedBadge, { lastMethod: lastMethod, method: "google", children: _jsxs(Button, { type: "button", variant: "bordered", className: "w-full gap-2", onPress: () => {
21
+ authClient.signIn
22
+ .social({
23
+ provider: "google",
24
+ requestSignUp,
25
+ additionalData,
26
+ })
27
+ .then(handleSignIn);
28
+ }, children: [_jsx(GoogleIcon, { className: "h-5 w-5" }), t("web-ui:auth.login.google")] }) })), providers.includes("linkedin") && (_jsx(LastUsedBadge, { lastMethod: lastMethod, method: "linkedin", children: _jsxs(Button, { type: "button", variant: "bordered", className: "w-full", onPress: () => {
29
+ authClient.signIn
30
+ .social({
31
+ provider: "linkedin",
32
+ requestSignUp,
33
+ additionalData,
34
+ })
35
+ .then(handleSignIn);
36
+ }, children: [_jsx(LinkedInIcon, { className: "h-5 w-5" }), t("web-ui:auth.login.linkedin")] }) })), providers.includes("microsoft") && (_jsx(LastUsedBadge, { lastMethod: lastMethod, method: "microsoft", children: _jsxs(Button, { type: "button", variant: "bordered", className: "w-full", onPress: () => {
37
+ authClient.signIn
38
+ .social({
39
+ provider: "microsoft",
40
+ requestSignUp,
41
+ additionalData,
42
+ })
43
+ .then(handleSignIn);
44
+ }, children: [_jsx(MicrosoftIcon, { className: "h-5 w-5" }), t("web-ui:auth.login.microsoft")] }) }))] }), _jsx("div", { className: "relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border", children: _jsx("span", { className: "relative z-10 bg-background px-2 text-muted-foreground", children: t("web-ui:auth.login.orContinueWith") }) })] }));
45
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from "react";
2
+ import type { UseBackendTRPC } from "#types";
3
+ interface AuthRouterProps {
4
+ header: ReactNode;
5
+ providers?: string[];
6
+ useTRPC?: UseBackendTRPC;
7
+ }
8
+ export declare function AuthRouter({ header, providers, useTRPC }: AuthRouterProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=AuthRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthRouter.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/AuthRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AASvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,UAAU,eAAe;IACvB,MAAM,EAAE,SAAS,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,eAAe,2CAWzE"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Route } from "react-router";
3
+ import { AuthLayout } from "#modules/auth/components/AuthLayout";
4
+ import { ClaimAccountRoute } from "#modules/auth/components/ClaimAccountRoute";
5
+ import { ErrorAuthRoute } from "#modules/auth/components/ErrorAuthRoute";
6
+ import { ForgotPasswordRoute } from "#modules/auth/components/ForgotPasswordRoute";
7
+ import { LoginRoute } from "#modules/auth/components/LoginRoute";
8
+ import { ResetPasswordRoute } from "#modules/auth/components/ResetPasswordRoute";
9
+ import { SignupRoute } from "#modules/auth/components/SignupRoute";
10
+ export function AuthRouter({ header, providers, useTRPC }) {
11
+ return (_jsxs(Route, { element: _jsx(AuthLayout, { header: header }), children: [_jsx(Route, { path: "/login", element: _jsx(LoginRoute, { providers: providers }) }), _jsx(Route, { path: "/signup", element: _jsx(SignupRoute, { providers: providers, useTRPC: useTRPC }) }), _jsx(Route, { path: "/forgot-password", element: _jsx(ForgotPasswordRoute, {}) }), _jsx(Route, { path: "/reset-password", element: _jsx(ResetPasswordRoute, {}) }), _jsx(Route, { path: "/claim-account", element: _jsx(ClaimAccountRoute, { useTRPC: useTRPC }) }), _jsx(Route, { path: "/error-auth", element: _jsx(ErrorAuthRoute, {}) })] }));
12
+ }
@@ -0,0 +1,5 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ export declare function ClaimAccountRoute({ useTRPC }: {
3
+ useTRPC?: UseBackendTRPC;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=ClaimAccountRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClaimAccountRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/ClaimAccountRoute.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,2CAsO1E"}
@@ -0,0 +1,143 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Alert, Button, Card, CardBody, CardHeader, Input } from "@heroui/react";
3
+ import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
4
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
5
+ import { useEffect, useMemo, useState } from "react";
6
+ import { useLocation, useNavigate } from "react-router";
7
+ import { toast } from "sonner";
8
+ import { GoogleIcon } from "#icons/GoogleIcon";
9
+ import { LinkedInIcon } from "#icons/LinkedInIcon";
10
+ import { MicrosoftIcon } from "#icons/MicrosoftIcon";
11
+ export function ClaimAccountRoute({ useTRPC }) {
12
+ const { data: session, registerSession } = useSession();
13
+ const navigate = useNavigate();
14
+ const location = useLocation();
15
+ const queryClient = useQueryClient();
16
+ const [email, setEmail] = useState("");
17
+ const [newPassword, setNewPassword] = useState("");
18
+ const [busy, setBusy] = useState("none");
19
+ const trpc = useTRPC?.();
20
+ const linkedProvider = useMemo(() => {
21
+ const params = new URLSearchParams(location.search);
22
+ return params.get("linked");
23
+ }, [location.search]);
24
+ const claimStatusQuery = useQuery({
25
+ queryKey: ["auth", "claim-status", session?.user?.id ?? null],
26
+ enabled: !!trpc && !!session?.user,
27
+ queryFn: async () => {
28
+ if (!trpc)
29
+ return null;
30
+ return queryClient.fetchQuery(trpc.auth.getMyAccountClaimStatus.queryOptions());
31
+ },
32
+ });
33
+ const setEmailMutation = useMutation(trpc
34
+ ? trpc.auth.setMyAccountClaimEmail.mutationOptions()
35
+ : {
36
+ mutationFn: async () => ({ status: false }),
37
+ });
38
+ const acceptClaimMutation = useMutation(trpc
39
+ ? trpc.auth.acceptMyAccountClaim.mutationOptions()
40
+ : {
41
+ mutationFn: async () => ({ status: false }),
42
+ });
43
+ useEffect(() => {
44
+ if (session?.user?.email) {
45
+ setEmail(session.user.email);
46
+ }
47
+ }, [session?.user?.email]);
48
+ useEffect(() => {
49
+ if (!linkedProvider || !trpc)
50
+ return;
51
+ acceptClaimMutation
52
+ .mutateAsync(undefined)
53
+ .then(() => {
54
+ toast.success("Account provider linked");
55
+ queryClient.invalidateQueries({ queryKey: trpc.auth.getMyAccountClaimStatus.queryKey() });
56
+ })
57
+ .catch((error) => {
58
+ toast.error(error.message);
59
+ })
60
+ .finally(() => {
61
+ navigate("/claim-account", { replace: true });
62
+ });
63
+ }, [acceptClaimMutation, linkedProvider, navigate, queryClient, trpc]);
64
+ if (!trpc) {
65
+ return (_jsx(Alert, { color: "warning", variant: "faded", title: "Claim flow is unavailable because backend TRPC is not configured." }));
66
+ }
67
+ if (!session?.user) {
68
+ return (_jsx(Alert, { color: "warning", variant: "faded", title: "You need to sign in with your magic link before claiming this account." }));
69
+ }
70
+ const claim = claimStatusQuery.data;
71
+ const hasClaimEmail = Boolean(claim?.claimedEmail);
72
+ const onSetEmail = async () => {
73
+ setBusy("email");
74
+ try {
75
+ await setEmailMutation.mutateAsync({ email });
76
+ registerSession(() => undefined);
77
+ await queryClient.invalidateQueries({
78
+ queryKey: trpc.auth.getMyAccountClaimStatus.queryKey(),
79
+ });
80
+ toast.success("Email updated");
81
+ }
82
+ catch (error) {
83
+ toast.error(error instanceof Error ? error.message : "Unable to set email");
84
+ }
85
+ finally {
86
+ setBusy("none");
87
+ }
88
+ };
89
+ const onSetPassword = async () => {
90
+ setBusy("password");
91
+ try {
92
+ const response = await fetch(`${import.meta.env.VITE_SERVER_URL}/api/auth/set-password`, {
93
+ method: "POST",
94
+ credentials: "include",
95
+ headers: {
96
+ "Content-Type": "application/json",
97
+ },
98
+ body: JSON.stringify({
99
+ newPassword,
100
+ }),
101
+ });
102
+ const payload = await response.json().catch(() => ({}));
103
+ if (!response.ok) {
104
+ throw new Error(payload?.message ?? "Unable to set password");
105
+ }
106
+ await acceptClaimMutation.mutateAsync(undefined);
107
+ await queryClient.invalidateQueries({
108
+ queryKey: trpc.auth.getMyAccountClaimStatus.queryKey(),
109
+ });
110
+ toast.success("Password set. Account claimed.");
111
+ }
112
+ catch (error) {
113
+ toast.error(error instanceof Error ? error.message : "Unable to set password");
114
+ }
115
+ finally {
116
+ setBusy("none");
117
+ }
118
+ };
119
+ const onLinkProvider = async (provider) => {
120
+ setBusy("link");
121
+ try {
122
+ const response = await fetch(`${import.meta.env.VITE_SERVER_URL}/api/auth/link-social`, {
123
+ method: "POST",
124
+ credentials: "include",
125
+ headers: { "Content-Type": "application/json" },
126
+ body: JSON.stringify({
127
+ provider,
128
+ callbackURL: `${window.location.origin}/claim-account?linked=${provider}`,
129
+ }),
130
+ });
131
+ const payload = await response.json().catch(() => ({}));
132
+ if (!response.ok || !payload?.url) {
133
+ throw new Error(payload?.message ?? "Unable to start provider linking");
134
+ }
135
+ window.location.href = payload.url;
136
+ }
137
+ catch (error) {
138
+ toast.error(error instanceof Error ? error.message : "Unable to link provider");
139
+ setBusy("none");
140
+ }
141
+ };
142
+ return (_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-col gap-1", children: [_jsx("p", { className: "text-xl font-semibold", children: "Claim your account" }), _jsx("p", { className: "text-sm text-default-600", children: "You are signed in and can now set your permanent login methods." })] }), _jsxs(CardBody, { className: "grid gap-6", children: [claimStatusQuery.isLoading ? (_jsx(Alert, { color: "default", variant: "faded", title: "Loading claim status..." })) : !claim ? (_jsx(Alert, { color: "warning", variant: "faded", title: "No pending account claim was found for your user." })) : null, _jsxs("div", { className: "grid gap-2", children: [_jsx(Input, { type: "email", label: "Email", value: email, onValueChange: setEmail, description: "Set your real email before linking providers and password." }), _jsx(Button, { onPress: onSetEmail, isDisabled: !email || busy !== "none" || !claim, children: busy === "email" ? "Saving..." : "Save Email" })] }), _jsxs("div", { className: "grid gap-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Link a provider" }), _jsxs("div", { className: "grid gap-3 sm:grid-cols-3", children: [_jsxs(Button, { variant: "bordered", onPress: () => onLinkProvider("google"), isDisabled: busy !== "none" || !hasClaimEmail || !claim, children: [_jsx(GoogleIcon, { className: "h-4 w-4" }), " Google"] }), _jsxs(Button, { variant: "bordered", onPress: () => onLinkProvider("linkedin"), isDisabled: busy !== "none" || !hasClaimEmail || !claim, children: [_jsx(LinkedInIcon, { className: "h-4 w-4" }), " LinkedIn"] }), _jsxs(Button, { variant: "bordered", onPress: () => onLinkProvider("microsoft"), isDisabled: busy !== "none" || !hasClaimEmail || !claim, children: [_jsx(MicrosoftIcon, { className: "h-4 w-4" }), " Microsoft"] })] })] }), _jsxs("div", { className: "grid gap-2", children: [_jsx(Input, { type: "password", label: "Set password", value: newPassword, onValueChange: setNewPassword }), _jsx(Button, { onPress: onSetPassword, isDisabled: !newPassword || busy !== "none" || !hasClaimEmail || !claim, children: busy === "password" ? "Saving..." : "Set Password and Claim" })] })] })] }));
143
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ErrorAuthRoute(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=ErrorAuthRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorAuthRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/ErrorAuthRoute.tsx"],"names":[],"mappings":"AAMA,wBAAgB,cAAc,4CAkH7B"}
@@ -0,0 +1,93 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Card, CardBody, CardHeader } from "@heroui/react";
3
+ import { AlertCircle } from "lucide-react";
4
+ import { useQueryState } from "nuqs";
5
+ import { useTranslation } from "react-i18next";
6
+ import { Link } from "react-router";
7
+ export function ErrorAuthRoute() {
8
+ const { t } = useTranslation();
9
+ const [error] = useQueryState("error");
10
+ const ErrorEnum = {
11
+ invalid_callback_request: {
12
+ title: "Invalid callback request",
13
+ description: "The callback request is invalid. Please try again.",
14
+ buttons: ["login", "signup"],
15
+ signupLabel: null,
16
+ },
17
+ state_not_found: {
18
+ title: "State not found",
19
+ description: "The state was not found. Please try again.",
20
+ buttons: ["login", "signup"],
21
+ signupLabel: null,
22
+ },
23
+ account_already_linked_to_different_user: {
24
+ title: "Account already linked to different user",
25
+ description: "The account is already linked to a different user. Please try again.",
26
+ buttons: ["signup"],
27
+ signupLabel: null,
28
+ },
29
+ "email_doesn't_match": {
30
+ title: "Email doesn't match",
31
+ description: "The email doesn't match. Please try again.",
32
+ buttons: ["login", "signup"],
33
+ signupLabel: null,
34
+ },
35
+ email_not_found: {
36
+ title: "Email not found",
37
+ description: "The email was not found. Please try again.",
38
+ buttons: ["login", "signup"],
39
+ signupLabel: null,
40
+ },
41
+ no_callback_url: {
42
+ title: "No callback URL",
43
+ description: "The callback URL is not set. Please try again.",
44
+ buttons: ["login", "signup"],
45
+ signupLabel: null,
46
+ },
47
+ no_code: {
48
+ title: "No code",
49
+ description: "The code is not set. Please try again.",
50
+ buttons: ["login", "signup"],
51
+ signupLabel: null,
52
+ },
53
+ oauth_provider_not_found: {
54
+ title: "OAuth provider not found",
55
+ description: "The OAuth provider was not found. Please try again.",
56
+ buttons: ["login", "signup"],
57
+ signupLabel: null,
58
+ },
59
+ unable_to_link_account: {
60
+ title: "Unable to link account",
61
+ description: "The account could not be linked. Please try again.",
62
+ buttons: ["login", "signup"],
63
+ signupLabel: null,
64
+ },
65
+ unable_to_get_user_info: {
66
+ title: "Unable to get user info",
67
+ description: "The user info could not be retrieved. Please try again.",
68
+ buttons: ["login", "signup"],
69
+ signupLabel: null,
70
+ },
71
+ state_mismatch: {
72
+ title: "State mismatch",
73
+ description: "The state mismatch. Please try again.",
74
+ buttons: ["login", "signup"],
75
+ signupLabel: null,
76
+ },
77
+ signup_disabled: {
78
+ title: "Signup disabled",
79
+ description: "The signup is disabled while we are in beta. Please join the waitlist to be notified when we launch.",
80
+ buttons: ["signup"],
81
+ signupLabel: "Join the waitlist",
82
+ },
83
+ default: {
84
+ title: "Authentication Failed",
85
+ description: "We encountered an issue with your authentication request",
86
+ buttons: ["login", "signup"],
87
+ signupLabel: null,
88
+ },
89
+ };
90
+ const errorData = ErrorEnum[error] || ErrorEnum.default;
91
+ const { title, description, buttons, signupLabel } = errorData;
92
+ return (_jsx("div", { className: "flex flex-col gap-6", children: _jsxs(Card, { children: [_jsxs(CardHeader, { className: "text-center flex flex-col gap-2 items-center", children: [_jsx(AlertCircle, { className: "w-10 h-10 text-red-500" }), _jsx("p", { className: "text-xl font-semibold", children: title }), _jsx("p", { className: "text-sm text-default-600", children: description })] }), _jsx(CardBody, { className: "flex flex-col gap-4", children: _jsxs("div", { className: "flex flex-col gap-2", children: [buttons.includes("login") && (_jsx(Button, { as: Link, to: "/login", variant: "bordered", children: t("web-ui:auth.error.backToLogin") })), buttons.includes("signup") && (_jsx(Button, { as: Link, to: "/signup", variant: "bordered", children: signupLabel || t("web-ui:auth.error.backToSignup") }))] }) })] }) }));
93
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ForgotPasswordForm(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=ForgotPasswordForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForgotPasswordForm.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/ForgotPasswordForm.tsx"],"names":[],"mappings":"AAWA,wBAAgB,kBAAkB,4CA8CjC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Input } from "@heroui/react";
3
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
4
+ import { useState } from "react";
5
+ import { useForm } from "react-hook-form";
6
+ import { useTranslation } from "react-i18next";
7
+ import { toast } from "sonner";
8
+ export function ForgotPasswordForm() {
9
+ const { t } = useTranslation();
10
+ const { register, handleSubmit, formState: { errors }, } = useForm();
11
+ const [isBusy, setIsBusy] = useState(false);
12
+ const onSubmit = (data) => {
13
+ setIsBusy(true);
14
+ authClient
15
+ .requestPasswordReset({
16
+ email: data.email,
17
+ redirectTo: "/reset-password",
18
+ })
19
+ .then(() => {
20
+ toast.success(t("web-ui:auth.forgotPassword.success"));
21
+ })
22
+ .catch(() => {
23
+ toast.error(t("web-ui:auth.forgotPassword.error"));
24
+ });
25
+ };
26
+ return (_jsxs("form", { onSubmit: handleSubmit(onSubmit), className: "grid gap-6", children: [_jsxs("div", { className: "grid gap-2", children: [_jsx(Input, { labelPlacement: "outside", label: t("web-ui:auth.login.email"), type: "email", placeholder: t("web-ui:auth.login.placeholder.email"), variant: "bordered", isRequired: true, ...register("email", { required: true }) }), errors.email && (_jsx("span", { className: "text-red-500 text-xs", children: t("web-ui:auth.signup.emailRequired") }))] }), _jsx(Button, { type: "submit", className: "w-full", color: "primary", isDisabled: isBusy, children: t("web-ui:auth.forgotPassword.button") })] }));
27
+ }
@@ -0,0 +1,2 @@
1
+ export declare function ForgotPasswordRoute(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=ForgotPasswordRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForgotPasswordRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/ForgotPasswordRoute.tsx"],"names":[],"mappings":"AAKA,wBAAgB,mBAAmB,4CAqBlC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardBody, CardHeader } from "@heroui/react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { Link } from "react-router";
5
+ import { ForgotPasswordForm } from "#modules/auth/components/ForgotPasswordForm";
6
+ export function ForgotPasswordRoute() {
7
+ const { t } = useTranslation();
8
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "text-center flex flex-col gap-1", children: [_jsx("p", { className: "text-xl font-semibold", children: t("web-ui:auth.forgotPassword.title") }), _jsx("p", { className: "text-sm text-default-600", children: t("web-ui:auth.forgotPassword.description") })] }), _jsx(CardBody, { children: _jsx(ForgotPasswordForm, {}) })] }), _jsxs("div", { className: "text-center text-xs text-muted-foreground", children: [t("web-ui:auth.forgotPassword.rememberPassword"), " ", _jsx(Link, { to: "/login", className: "underline underline-offset-4 hover:text-primary", children: t("web-ui:auth.login.button") })] })] }));
9
+ }
@@ -0,0 +1,6 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ export interface InviteFriendsProps {
3
+ useTRPC: UseBackendTRPC;
4
+ }
5
+ export declare function InviteFriends({ useTRPC }: InviteFriendsProps): import("react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=InviteFriends.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteFriends.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/InviteFriends.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,2CAmQ5D"}
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Card, CardBody, CardHeader, Chip, Input } from "@heroui/react";
3
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
+ import { CheckCircle2, Link2Icon, Mail, Send, Ticket, Users, Zap } from "lucide-react";
5
+ import { useMemo, useState } from "react";
6
+ import { toast } from "sonner";
7
+ import { z } from "zod";
8
+ import { CopyButton } from "#components/CopyButton";
9
+ export function InviteFriends({ useTRPC }) {
10
+ const trpc = useTRPC();
11
+ const queryClient = useQueryClient();
12
+ const { data: waitlist = [] } = useQuery(trpc.auth.listWaitlist.queryOptions());
13
+ const { data: count = 0 } = useQuery(trpc.auth.getUserWaitlistCount.queryOptions());
14
+ const invitesAvailable = Math.max(0, 3 - count);
15
+ const inviteMutation = useMutation(trpc.auth.inviteToWaitlist.mutationOptions({
16
+ onSuccess: (result) => {
17
+ queryClient.setQueryData(trpc.auth.getUserWaitlistCount.queryKey(), (old) => (old ?? 0) + 1);
18
+ queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [
19
+ ...(old ?? []),
20
+ result,
21
+ ]);
22
+ toast.success("Invitation sent successfully!");
23
+ },
24
+ onError: (error) => {
25
+ toast.error(error.message);
26
+ },
27
+ }));
28
+ const createInvitationCodeMutation = useMutation(trpc.auth.createInvitationCode.mutationOptions({
29
+ onSuccess: (result) => {
30
+ queryClient.setQueryData(trpc.auth.getUserWaitlistCount.queryKey(), (old) => (old ?? 0) + 1);
31
+ queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [
32
+ ...(old ?? []),
33
+ result,
34
+ ]);
35
+ toast.success("Code created successfully!");
36
+ },
37
+ onError: (error) => {
38
+ toast.error(error.message);
39
+ },
40
+ }));
41
+ const [email, setEmail] = useState("");
42
+ const [name, setName] = useState("");
43
+ const isLoading = inviteMutation.isPending || createInvitationCodeMutation.isPending;
44
+ const isEmailValid = useMemo(() => {
45
+ return z.email().safeParse(email).success;
46
+ }, [email]);
47
+ const handleInvite = async (e) => {
48
+ e.preventDefault();
49
+ if (!email)
50
+ return;
51
+ inviteMutation.mutate({ email, name: name.length > 0 ? name : undefined });
52
+ setEmail("");
53
+ setName("");
54
+ };
55
+ const handleCreateCode = async () => {
56
+ createInvitationCodeMutation.mutate({ name: name.length > 0 ? name : undefined });
57
+ setEmail("");
58
+ setName("");
59
+ };
60
+ const getStatusColor = (status) => {
61
+ switch (status.toLowerCase()) {
62
+ case "accepted":
63
+ case "completed":
64
+ return "success";
65
+ case "invited":
66
+ return "warning";
67
+ case "waitlist":
68
+ return "default";
69
+ default:
70
+ return "default";
71
+ }
72
+ };
73
+ return (_jsxs("div", { className: "max-w-3xl mx-auto p-6 space-y-8", children: [_jsxs("div", { className: "text-center space-y-4", children: [_jsx("div", { className: "inline-flex items-center justify-center p-4 bg-primary/10 rounded-full mb-2 ring-1 ring-primary/20", children: _jsx(Ticket, { className: "w-8 h-8 text-primary" }) }), _jsx("h1", { className: "text-3xl md:text-4xl font-bold tracking-tight", children: "Invite Friends & Skip the Waitlist" }), _jsxs("p", { className: "text-lg text-default-600 max-w-lg mx-auto leading-relaxed", children: ["Encourage your friends to join! Friends invited by you get", " ", _jsx("span", { className: "text-foreground font-medium", children: "immediate access" }), " and skip the waitlist completely."] }), _jsx("div", { className: "flex justify-center mt-4", children: _jsxs(Chip, { color: invitesAvailable > 0 ? "warning" : "default", variant: "flat", size: "lg", startContent: _jsx(Zap, { size: 16, className: invitesAvailable > 0 ? "text-warning-600" : "" }), className: "font-medium", children: [invitesAvailable, " ", invitesAvailable === 1 ? "Invite" : "Invites", " Remaining"] }) })] }), _jsxs("div", { className: "grid gap-6", children: [_jsxs(Card, { className: "shadow-sm border border-default-200", children: [_jsxs(CardHeader, { className: "flex flex-col items-start gap-1 px-6 pt-6 pb-2", children: [_jsx("h3", { className: "text-xl font-semibold", children: "Send an Invitation via Email" }), _jsx("p", { className: "text-small text-default-600", children: "They'll receive a unique code to join instantly." })] }), _jsx(CardBody, { className: "px-6 pb-6", children: _jsxs("form", { onSubmit: handleInvite, className: "flex flex-col gap-4", children: [_jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsx(Input, { label: "Friend's Name (Optional)", placeholder: "e.g. Alex", value: name, onValueChange: setName, variant: "bordered", labelPlacement: "outside" }), _jsx(Input, { type: "email", label: "Email Address (Required for sending)", placeholder: "friend@example.com", value: email, onValueChange: setEmail, variant: "bordered", labelPlacement: "outside", startContent: _jsx(Mail, { className: "text-default-400 pointer-events-none flex-shrink-0", size: 16 }) })] }), _jsxs("div", { className: "flex justify-end pt-2 gap-2", children: [_jsx(Button, { color: "primary", variant: "bordered", type: "button", isLoading: isLoading, isDisabled: invitesAvailable <= 0, onPress: handleCreateCode, className: "font-medium", endContent: !isLoading && _jsx(Link2Icon, { size: 16 }), children: "Create Invitation Link" }), _jsx(Button, { color: "primary", type: "submit", isLoading: isLoading, isDisabled: invitesAvailable <= 0 || !isEmailValid, className: "font-medium", endContent: !isLoading && _jsx(Send, { size: 16 }), children: "Send Invitation" })] })] }) })] }), _jsxs("div", { className: "space-y-4", children: [_jsx("div", { className: "flex items-center justify-between", children: _jsx("h3", { className: "text-xl font-semibold", children: "Created Invitations" }) }), waitlist.length > 0 ? (_jsx("div", { className: "flex flex-col gap-3", children: waitlist.map((item) => (_jsxs("div", { className: "flex items-center justify-between p-4 border border-default-200 rounded-lg bg-content1", children: [_jsxs("div", { className: "flex flex-row gap-3", children: [_jsx("div", { children: _jsx("span", { className: "text-sm font-medium", children: item.email || item.name || "Open Invitation Link" }) }), _jsx(Chip, { size: "sm", color: getStatusColor(item.status), variant: "flat", className: "capitalize", children: item.status.toLowerCase() })] }), _jsx("div", { className: "flex items-center gap-3", children: item.code && (_jsx(CopyButton, { variant: "flat", color: "success", size: "sm", text: `${import.meta.env.VITE_APP_URL}/signup?code=${item.code}`, isIconOnly: true })) })] }, item.id))) })) : (_jsx("div", { className: "text-center py-8 text-default-600 border border-dashed border-default-200 rounded-lg", children: "No invitations created yet." }))] })] }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4 py-4", children: [_jsxs("div", { className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm", children: [_jsx("div", { className: "p-3 bg-warning/10 text-warning rounded-full mb-4", children: _jsx(Zap, { className: "w-6 h-6" }) }), _jsx("h3", { className: "font-semibold mb-2", children: "Instant Access" }), _jsx("p", { className: "text-sm text-default-600", children: "Friends you invite skip the waitlist completely and get in right away." })] }), _jsxs("div", { className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm", children: [_jsx("div", { className: "p-3 bg-primary/10 text-primary rounded-full mb-4", children: _jsx(Users, { className: "w-6 h-6" }) }), _jsx("h3", { className: "font-semibold mb-2", children: "Grow Your Network" }), _jsx("p", { className: "text-sm text-default-600", children: "Build your circle within the app from day one." })] }), _jsxs("div", { className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm", children: [_jsx("div", { className: "p-3 bg-success/10 text-success rounded-full mb-4", children: _jsx(CheckCircle2, { className: "w-6 h-6" }) }), _jsx("h3", { className: "font-semibold mb-2", children: "Verified Status" }), _jsx("p", { className: "text-sm text-default-600", children: "Invited members get a verified badge on their profile." })] })] })] }));
74
+ }
@@ -0,0 +1,6 @@
1
+ import { type BadgeProps } from "@heroui/react";
2
+ export declare function LastUsedBadge({ lastMethod, method, children, ...props }: BadgeProps & {
3
+ lastMethod?: string | null;
4
+ method?: string | null;
5
+ }): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
6
+ //# sourceMappingURL=LastUsedBadge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LastUsedBadge.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/LastUsedBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,eAAe,CAAC;AAGvD,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,MAAM,EACN,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,UAAU,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,2WAarE"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Badge } from "@heroui/react";
3
+ import { useTranslation } from "react-i18next";
4
+ export function LastUsedBadge({ lastMethod, method, children, ...props }) {
5
+ const { t } = useTranslation();
6
+ if (lastMethod !== method)
7
+ return children;
8
+ return (_jsx(Badge, { ...props, content: t("web-ui:auth.login.lastUsed"), color: "warning", className: "px-2 !right-[10%]", children: children }));
9
+ }
@@ -0,0 +1,4 @@
1
+ export declare function LoginForm({ providers }: {
2
+ providers?: string[];
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=LoginForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginForm.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/LoginForm.tsx"],"names":[],"mappings":"AAeA,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,2CAwFhE"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Input } from "@heroui/react";
3
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
4
+ import { useSession } from "@m5kdev/frontend/modules/auth/hooks/useSession";
5
+ import { useForm } from "react-hook-form";
6
+ import { useTranslation } from "react-i18next";
7
+ import { Link, useNavigate } from "react-router";
8
+ import { toast } from "sonner";
9
+ import { AuthProviders } from "./AuthProviders";
10
+ import { LastUsedBadge } from "./LastUsedBadge";
11
+ export function LoginForm({ providers }) {
12
+ const lastMethod = authClient.getLastUsedLoginMethod();
13
+ const { register, handleSubmit } = useForm();
14
+ const { registerSession } = useSession();
15
+ const navigate = useNavigate();
16
+ const { t } = useTranslation();
17
+ const onSubmit = (data) => {
18
+ console.log(data);
19
+ authClient.signIn
20
+ .email({
21
+ email: data.email,
22
+ password: data.password,
23
+ })
24
+ .then((res) => {
25
+ console.log(res);
26
+ if (res.data?.user) {
27
+ registerSession(() => {
28
+ navigate("/");
29
+ });
30
+ }
31
+ else if (res.error) {
32
+ toast.error(t("web-ui:auth.errors.authentication"), {
33
+ description: res.error.message,
34
+ });
35
+ }
36
+ })
37
+ .catch((error) => {
38
+ toast.error(t("web-ui:auth.errors.server"), {
39
+ description: error.message,
40
+ });
41
+ });
42
+ };
43
+ return (_jsx("form", { onSubmit: handleSubmit(onSubmit), children: _jsxs("div", { className: "grid gap-6", children: [_jsx(AuthProviders, { providers: providers, lastMethod: lastMethod }), _jsxs("div", { className: "grid gap-6", children: [_jsxs("div", { className: "grid gap-2", children: [_jsx(LastUsedBadge, { lastMethod: lastMethod, method: "email", children: _jsx("label", { htmlFor: "email", className: "text-sm font-medium", children: t("web-ui:auth.login.email") }) }), _jsx(Input, { type: "email", placeholder: t("web-ui:auth.login.placeholder.email"), variant: "bordered", isRequired: true, ...register("email", { required: true }) })] }), _jsxs("div", { className: "grid gap-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("label", { htmlFor: "password", className: "text-sm font-medium", children: t("web-ui:auth.login.password") }), _jsx(Link, { to: "/forgot-password", className: "ml-auto text-sm underline-offset-4 hover:underline", children: t("web-ui:auth.login.forgotPassword") })] }), _jsx(Input, { placeholder: t("web-ui:auth.login.password"), type: "password", variant: "bordered", isRequired: true, ...register("password", { required: true }) })] }), _jsx(Button, { type: "submit", className: "w-full", color: "primary", children: t("web-ui:auth.login.button") })] }), _jsxs("div", { className: "text-center text-sm", children: [t("web-ui:auth.login.noAccount"), " ", _jsx(Link, { to: "/signup", className: "underline underline-offset-4", children: t("web-ui:auth.login.signUp") })] })] }) }));
44
+ }
@@ -0,0 +1,4 @@
1
+ export declare function LoginRoute({ providers }: {
2
+ providers?: string[];
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=LoginRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LoginRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/LoginRoute.tsx"],"names":[],"mappings":"AAKA,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,2CAyBjE"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardBody, CardHeader } from "@heroui/react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { Link } from "react-router";
5
+ import { LoginForm } from "./LoginForm";
6
+ export function LoginRoute({ providers }) {
7
+ const { t } = useTranslation();
8
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "text-center flex flex-col gap-1", children: [_jsx("p", { className: "text-xl font-semibold", children: t("web-ui:auth.login.welcome") }), _jsx("p", { className: "text-sm text-default-600", children: providers
9
+ ? t("web-ui:auth.login.descriptionWithProviders")
10
+ : t("web-ui:auth.login.description") })] }), _jsx(CardBody, { children: _jsx(LoginForm, { providers: providers }) })] }), _jsxs("div", { className: "text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary ", children: [t("web-ui:common.byClickingContinue"), " ", _jsx(Link, { to: "/terms-of-service", children: t("web-ui:common.termsOfService") }), " ", t("web-ui:common.and"), " ", _jsx(Link, { to: "/privacy-policy", children: t("web-ui:common.privacyPolicy") }), "."] })] }));
11
+ }
@@ -0,0 +1,2 @@
1
+ export default function Logout(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=LogoutRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LogoutRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/LogoutRoute.tsx"],"names":[],"mappings":"AAKA,MAAM,CAAC,OAAO,UAAU,MAAM,4CAe7B"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Spinner } from "@heroui/react";
3
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
4
+ import { useEffect } from "react";
5
+ import { useNavigate } from "react-router";
6
+ export default function Logout() {
7
+ const navigate = useNavigate();
8
+ // biome-ignore lint/correctness/useExhaustiveDependencies(authClient): authClient is a singleton
9
+ // biome-ignore lint/correctness/useExhaustiveDependencies(navigate): navigate is a global hook
10
+ useEffect(() => {
11
+ authClient.signOut();
12
+ navigate("/login");
13
+ }, []);
14
+ return (_jsx("div", { className: "flex-1 justify-center align-center", children: _jsx(Spinner, {}) }));
15
+ }