@m5kdev/web-ui 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/dist/src/animations/card.motion.d.ts +7 -2
  2. package/dist/src/animations/card.motion.js +25 -6
  3. package/dist/src/animations/card.motion.js.map +1 -0
  4. package/dist/src/components/AvatarUpload.d.ts +14 -5
  5. package/dist/src/components/AvatarUpload.js +105 -63
  6. package/dist/src/components/AvatarUpload.js.map +1 -0
  7. package/dist/src/components/Button.d.ts +14 -4
  8. package/dist/src/components/Button.js +13 -4
  9. package/dist/src/components/Button.js.map +1 -0
  10. package/dist/src/components/Calendar.d.ts +33 -31
  11. package/dist/src/components/Calendar.js +14 -6
  12. package/dist/src/components/Calendar.js.map +1 -0
  13. package/dist/src/components/{Calendar.css → Calendar2.css} +757 -684
  14. package/dist/src/components/CardsSelect.d.ts +25 -21
  15. package/dist/src/components/CardsSelect.js +75 -42
  16. package/dist/src/components/CardsSelect.js.map +1 -0
  17. package/dist/src/components/CollapsibleSidebarMenuItem.d.ts +22 -9
  18. package/dist/src/components/CollapsibleSidebarMenuItem.js +31 -8
  19. package/dist/src/components/CollapsibleSidebarMenuItem.js.map +1 -0
  20. package/dist/src/components/ColorPicker.d.ts +15 -4
  21. package/dist/src/components/ColorPicker.js +46 -16
  22. package/dist/src/components/ColorPicker.js.map +1 -0
  23. package/dist/src/components/CopyButton.d.ts +18 -6
  24. package/dist/src/components/CopyButton.js +28 -19
  25. package/dist/src/components/CopyButton.js.map +1 -0
  26. package/dist/src/components/CropDialog.d.ts +20 -8
  27. package/dist/src/components/CropDialog.js +108 -62
  28. package/dist/src/components/CropDialog.js.map +1 -0
  29. package/dist/src/components/DialogProvider.d.ts +22 -14
  30. package/dist/src/components/DialogProvider.js +67 -45
  31. package/dist/src/components/DialogProvider.js.map +1 -0
  32. package/dist/src/components/ErrorFallback.d.ts +13 -4
  33. package/dist/src/components/ErrorFallback.js +29 -4
  34. package/dist/src/components/ErrorFallback.js.map +1 -0
  35. package/dist/src/components/FileDropzone.d.ts +12 -4
  36. package/dist/src/components/FileDropzone.js +98 -60
  37. package/dist/src/components/FileDropzone.js.map +1 -0
  38. package/dist/src/components/MultiSelectDropdown.d.ts +25 -22
  39. package/dist/src/components/MultiSelectDropdown.js +99 -49
  40. package/dist/src/components/MultiSelectDropdown.js.map +1 -0
  41. package/dist/src/components/Orb.d.ts +17 -6
  42. package/dist/src/components/Orb.js +263 -255
  43. package/dist/src/components/Orb.js.map +1 -0
  44. package/dist/src/components/PageAlert.d.ts +20 -15
  45. package/dist/src/components/PageAlert.js +67 -39
  46. package/dist/src/components/PageAlert.js.map +1 -0
  47. package/dist/src/components/SelectChips.d.ts +21 -10
  48. package/dist/src/components/SelectChips.js +21 -9
  49. package/dist/src/components/SelectChips.js.map +1 -0
  50. package/dist/src/components/SidebarItem.d.ts +18 -7
  51. package/dist/src/components/SidebarItem.js +16 -4
  52. package/dist/src/components/SidebarItem.js.map +1 -0
  53. package/dist/src/components/Steps.d.ts +21 -16
  54. package/dist/src/components/Steps.js +193 -27
  55. package/dist/src/components/Steps.js.map +1 -0
  56. package/dist/src/components/TablerIconPicker.d.ts +13 -2
  57. package/dist/src/components/TablerIconPicker.js +4254 -4234
  58. package/dist/src/components/TablerIconPicker.js.map +1 -0
  59. package/dist/src/components/app-header.d.ts +14 -6
  60. package/dist/src/components/app-header.js +27 -6
  61. package/dist/src/components/app-header.js.map +1 -0
  62. package/dist/src/components/blur-card.d.ts +25 -11
  63. package/dist/src/components/blur-card.js +134 -31
  64. package/dist/src/components/blur-card.js.map +1 -0
  65. package/dist/src/components/features-section-demo-1.d.ts +22 -6
  66. package/dist/src/components/features-section-demo-1.js +119 -47
  67. package/dist/src/components/features-section-demo-1.js.map +1 -0
  68. package/dist/src/components/features-section-demo-2.d.ts +7 -1
  69. package/dist/src/components/features-section-demo-2.js +80 -49
  70. package/dist/src/components/features-section-demo-2.js.map +1 -0
  71. package/dist/src/components/features-section-demo-3.d.ts +16 -8
  72. package/dist/src/components/features-section-demo-3.js +239 -103
  73. package/dist/src/components/features-section-demo-3.js.map +1 -0
  74. package/dist/src/components/mode-toggle.d.ts +7 -1
  75. package/dist/src/components/mode-toggle.js +42 -7
  76. package/dist/src/components/mode-toggle.js.map +1 -0
  77. package/dist/src/components/nav-main.d.ts +20 -12
  78. package/dist/src/components/nav-main.js +31 -5
  79. package/dist/src/components/nav-main.js.map +1 -0
  80. package/dist/src/components/pricing-cards.d.ts +7 -1
  81. package/dist/src/components/pricing-cards.js +125 -24
  82. package/dist/src/components/pricing-cards.js.map +1 -0
  83. package/dist/src/components/shared/ButtonCopy.d.ts +17 -6
  84. package/dist/src/components/shared/ButtonCopy.js +31 -20
  85. package/dist/src/components/shared/ButtonCopy.js.map +1 -0
  86. package/dist/src/components/team-switcher.d.ts +16 -8
  87. package/dist/src/components/team-switcher.js +70 -8
  88. package/dist/src/components/team-switcher.js.map +1 -0
  89. package/dist/src/components/theme-provider.d.ts +18 -8
  90. package/dist/src/components/theme-provider.js +42 -38
  91. package/dist/src/components/theme-provider.js.map +1 -0
  92. package/dist/src/components/typewriter.d.ts +35 -14
  93. package/dist/src/components/typewriter.js +45 -36
  94. package/dist/src/components/typewriter.js.map +1 -0
  95. package/dist/src/components/ui/alert-dialog.d.ts +48 -13
  96. package/dist/src/components/ui/alert-dialog.js +58 -15
  97. package/dist/src/components/ui/alert-dialog.js.map +1 -0
  98. package/dist/src/components/ui/alert.d.ts +24 -8
  99. package/dist/src/components/ui/alert.js +28 -15
  100. package/dist/src/components/ui/alert.js.map +1 -0
  101. package/dist/src/components/ui/avatar.d.ts +9 -5
  102. package/dist/src/components/ui/avatar.js +23 -7
  103. package/dist/src/components/ui/avatar.js.map +1 -0
  104. package/dist/src/components/ui/badge.d.ts +17 -8
  105. package/dist/src/components/ui/badge.js +17 -14
  106. package/dist/src/components/ui/badge.js.map +1 -0
  107. package/dist/src/components/ui/bento-grid.d.ts +26 -11
  108. package/dist/src/components/ui/bento-grid.js +30 -6
  109. package/dist/src/components/ui/bento-grid.js.map +1 -0
  110. package/dist/src/components/ui/bento-grid2.d.ts +30 -14
  111. package/dist/src/components/ui/bento-grid2.js +45 -9
  112. package/dist/src/components/ui/bento-grid2.js.map +1 -0
  113. package/dist/src/components/ui/breadcrumb.d.ts +27 -15
  114. package/dist/src/components/ui/breadcrumb.js +54 -14
  115. package/dist/src/components/ui/breadcrumb.js.map +1 -0
  116. package/dist/src/components/ui/button.d.ts +14 -9
  117. package/dist/src/components/ui/button.js +37 -26
  118. package/dist/src/components/ui/button.js.map +1 -0
  119. package/dist/src/components/ui/card.d.ts +12 -8
  120. package/dist/src/components/ui/card.js +38 -10
  121. package/dist/src/components/ui/card.js.map +1 -0
  122. package/dist/src/components/ui/checkbox.d.ts +6 -2
  123. package/dist/src/components/ui/checkbox.js +17 -5
  124. package/dist/src/components/ui/checkbox.js.map +1 -0
  125. package/dist/src/components/ui/collapsible.d.ts +9 -4
  126. package/dist/src/components/ui/collapsible.js +5 -1
  127. package/dist/src/components/ui/collapsible.js.map +1 -0
  128. package/dist/src/components/ui/dialog.d.ts +44 -12
  129. package/dist/src/components/ui/dialog.js +64 -14
  130. package/dist/src/components/ui/dialog.js.map +1 -0
  131. package/dist/src/components/ui/dropdown-menu.d.ts +32 -24
  132. package/dist/src/components/ui/dropdown-menu.js +64 -14
  133. package/dist/src/components/ui/dropdown-menu.js.map +1 -0
  134. package/dist/src/components/ui/floating-navbar.d.ts +18 -9
  135. package/dist/src/components/ui/floating-navbar.js +49 -35
  136. package/dist/src/components/ui/floating-navbar.js.map +1 -0
  137. package/dist/src/components/ui/form.d.ts +30 -21
  138. package/dist/src/components/ui/form.js +76 -44
  139. package/dist/src/components/ui/form.js.map +1 -0
  140. package/dist/src/components/ui/image.d.ts +6 -2
  141. package/dist/src/components/ui/image.js +51 -11
  142. package/dist/src/components/ui/image.js.map +1 -0
  143. package/dist/src/components/ui/input.d.ts +6 -2
  144. package/dist/src/components/ui/input.js +14 -5
  145. package/dist/src/components/ui/input.js.map +1 -0
  146. package/dist/src/components/ui/label.d.ts +8 -3
  147. package/dist/src/components/ui/label.js +13 -5
  148. package/dist/src/components/ui/label.js.map +1 -0
  149. package/dist/src/components/ui/pagination.d.ts +39 -12
  150. package/dist/src/components/ui/pagination.js +64 -14
  151. package/dist/src/components/ui/pagination.js.map +1 -0
  152. package/dist/src/components/ui/progress.d.ts +6 -2
  153. package/dist/src/components/ui/progress.js +16 -4
  154. package/dist/src/components/ui/progress.js.map +1 -0
  155. package/dist/src/components/ui/resizable-navbar.d.ts +84 -43
  156. package/dist/src/components/ui/resizable-navbar.js +126 -74
  157. package/dist/src/components/ui/resizable-navbar.js.map +1 -0
  158. package/dist/src/components/ui/segment-control.d.ts +10 -7
  159. package/dist/src/components/ui/segment-control.js +83 -38
  160. package/dist/src/components/ui/segment-control.js.map +1 -0
  161. package/dist/src/components/ui/select.d.ts +16 -12
  162. package/dist/src/components/ui/select.js +63 -14
  163. package/dist/src/components/ui/select.js.map +1 -0
  164. package/dist/src/components/ui/separator.d.ts +6 -2
  165. package/dist/src/components/ui/separator.js +14 -4
  166. package/dist/src/components/ui/separator.js.map +1 -0
  167. package/dist/src/components/ui/sheet.d.ts +30 -19
  168. package/dist/src/components/ui/sheet.js +52 -23
  169. package/dist/src/components/ui/sheet.js.map +1 -0
  170. package/dist/src/components/ui/sidebar.d.ts +69 -62
  171. package/dist/src/components/ui/sidebar.js +326 -171
  172. package/dist/src/components/ui/sidebar.js.map +1 -0
  173. package/dist/src/components/ui/skeleton.d.ts +9 -1
  174. package/dist/src/components/ui/skeleton.js +10 -3
  175. package/dist/src/components/ui/skeleton.js.map +1 -0
  176. package/dist/src/components/ui/slider.d.ts +6 -2
  177. package/dist/src/components/ui/slider.js +16 -4
  178. package/dist/src/components/ui/slider.js.map +1 -0
  179. package/dist/src/components/ui/sonner.d.ts +10 -3
  180. package/dist/src/components/ui/sonner.js +18 -11
  181. package/dist/src/components/ui/sonner.js.map +1 -0
  182. package/dist/src/components/ui/spinner.d.ts +21 -10
  183. package/dist/src/components/ui/spinner.js +24 -24
  184. package/dist/src/components/ui/spinner.js.map +1 -0
  185. package/dist/src/components/ui/switch.d.ts +6 -2
  186. package/dist/src/components/ui/switch.js +13 -4
  187. package/dist/src/components/ui/switch.js.map +1 -0
  188. package/dist/src/components/ui/table.d.ts +39 -10
  189. package/dist/src/components/ui/table.js +51 -11
  190. package/dist/src/components/ui/table.js.map +1 -0
  191. package/dist/src/components/ui/tabs.d.ts +23 -6
  192. package/dist/src/components/ui/tabs.js +27 -7
  193. package/dist/src/components/ui/tabs.js.map +1 -0
  194. package/dist/src/components/ui/textarea.d.ts +10 -2
  195. package/dist/src/components/ui/textarea.js +11 -3
  196. package/dist/src/components/ui/textarea.js.map +1 -0
  197. package/dist/src/components/ui/timeline.d.ts +16 -9
  198. package/dist/src/components/ui/timeline.js +87 -24
  199. package/dist/src/components/ui/timeline.js.map +1 -0
  200. package/dist/src/components/ui/toast.d.ts +19 -14
  201. package/dist/src/components/ui/toast.js +48 -22
  202. package/dist/src/components/ui/toast.js.map +1 -0
  203. package/dist/src/components/ui/tooltip.d.ts +23 -6
  204. package/dist/src/components/ui/tooltip.js +27 -7
  205. package/dist/src/components/ui/tooltip.js.map +1 -0
  206. package/dist/src/components/ui/typewriter-effect.d.ts +28 -14
  207. package/dist/src/components/ui/typewriter-effect.js +102 -72
  208. package/dist/src/components/ui/typewriter-effect.js.map +1 -0
  209. package/dist/src/hooks/use-mobile.d.ts +5 -1
  210. package/dist/src/hooks/use-mobile.js +18 -13
  211. package/dist/src/hooks/use-mobile.js.map +1 -0
  212. package/dist/src/hooks/useDialog.d.ts +8 -4
  213. package/dist/src/hooks/useDialog.js +24 -20
  214. package/dist/src/hooks/useDialog.js.map +1 -0
  215. package/dist/src/icons/GoogleIcon.d.ts +9 -5
  216. package/dist/src/icons/GoogleIcon.js +32 -3
  217. package/dist/src/icons/GoogleIcon.js.map +1 -0
  218. package/dist/src/icons/LinkedInIcon.d.ts +9 -5
  219. package/dist/src/icons/LinkedInIcon.js +27 -3
  220. package/dist/src/icons/LinkedInIcon.js.map +1 -0
  221. package/dist/src/icons/MicrosoftIcon.d.ts +9 -5
  222. package/dist/src/icons/MicrosoftIcon.js +31 -3
  223. package/dist/src/icons/MicrosoftIcon.js.map +1 -0
  224. package/dist/src/lib/chatwoot.d.ts +19 -10
  225. package/dist/src/lib/chatwoot.js +25 -27
  226. package/dist/src/lib/chatwoot.js.map +1 -0
  227. package/dist/src/lib/utils.d.ts +7 -2
  228. package/dist/src/lib/utils.js +7 -2
  229. package/dist/src/lib/utils.js.map +1 -0
  230. package/dist/src/modules/app/components/AppLoader.d.ts +8 -2
  231. package/dist/src/modules/app/components/AppLoader.js +14 -3
  232. package/dist/src/modules/app/components/AppLoader.js.map +1 -0
  233. package/dist/src/modules/app/components/AppShell.d.ts +15 -6
  234. package/dist/src/modules/app/components/AppShell.js +14 -5
  235. package/dist/src/modules/app/components/AppShell.js.map +1 -0
  236. package/dist/src/modules/app/components/AppSidebar.d.ts +16 -6
  237. package/dist/src/modules/app/components/AppSidebar.js +17 -4
  238. package/dist/src/modules/app/components/AppSidebar.js.map +1 -0
  239. package/dist/src/modules/app/components/AppSidebarContent.d.ts +22 -13
  240. package/dist/src/modules/app/components/AppSidebarContent.js +34 -5
  241. package/dist/src/modules/app/components/AppSidebarContent.js.map +1 -0
  242. package/dist/src/modules/app/components/AppSidebarHeader.d.ts +18 -8
  243. package/dist/src/modules/app/components/AppSidebarHeader.js +37 -6
  244. package/dist/src/modules/app/components/AppSidebarHeader.js.map +1 -0
  245. package/dist/src/modules/app/components/AppSidebarInvites.d.ts +11 -3
  246. package/dist/src/modules/app/components/AppSidebarInvites.js +39 -8
  247. package/dist/src/modules/app/components/AppSidebarInvites.js.map +1 -0
  248. package/dist/src/modules/app/components/AppSidebarUser.d.ts +20 -10
  249. package/dist/src/modules/app/components/AppSidebarUser.js +121 -12
  250. package/dist/src/modules/app/components/AppSidebarUser.js.map +1 -0
  251. package/dist/src/modules/auth/components/AdminUserManagement.d.ts +11 -4
  252. package/dist/src/modules/auth/components/AdminUserManagement.js +970 -418
  253. package/dist/src/modules/auth/components/AdminUserManagement.js.map +1 -0
  254. package/dist/src/modules/auth/components/AdminWaitlist.d.ts +11 -4
  255. package/dist/src/modules/auth/components/AdminWaitlist.js +284 -115
  256. package/dist/src/modules/auth/components/AdminWaitlist.js.map +1 -0
  257. package/dist/src/modules/auth/components/AuthLayout.d.ts +12 -4
  258. package/dist/src/modules/auth/components/AuthLayout.js +17 -3
  259. package/dist/src/modules/auth/components/AuthLayout.js.map +1 -0
  260. package/dist/src/modules/auth/components/AuthProviders.d.ts +17 -6
  261. package/dist/src/modules/auth/components/AuthProviders.js +80 -41
  262. package/dist/src/modules/auth/components/AuthProviders.js.map +1 -0
  263. package/dist/src/modules/auth/components/AuthRouter.d.ts +16 -7
  264. package/dist/src/modules/auth/components/AuthRouter.js +46 -10
  265. package/dist/src/modules/auth/components/AuthRouter.js.map +1 -0
  266. package/dist/src/modules/auth/components/ClaimAccountRoute.d.ts +12 -4
  267. package/dist/src/modules/auth/components/ClaimAccountRoute.js +202 -139
  268. package/dist/src/modules/auth/components/ClaimAccountRoute.js.map +1 -0
  269. package/dist/src/modules/auth/components/ErrorAuthRoute.d.ts +7 -1
  270. package/dist/src/modules/auth/components/ErrorAuthRoute.js +125 -89
  271. package/dist/src/modules/auth/components/ErrorAuthRoute.js.map +1 -0
  272. package/dist/src/modules/auth/components/ForgotPasswordForm.d.ts +7 -1
  273. package/dist/src/modules/auth/components/ForgotPasswordForm.js +49 -23
  274. package/dist/src/modules/auth/components/ForgotPasswordForm.js.map +1 -0
  275. package/dist/src/modules/auth/components/ForgotPasswordRoute.d.ts +7 -1
  276. package/dist/src/modules/auth/components/ForgotPasswordRoute.js +34 -6
  277. package/dist/src/modules/auth/components/ForgotPasswordRoute.js.map +1 -0
  278. package/dist/src/modules/auth/components/InviteFriends.d.ts +12 -4
  279. package/dist/src/modules/auth/components/InviteFriends.js +275 -69
  280. package/dist/src/modules/auth/components/InviteFriends.js.map +1 -0
  281. package/dist/src/modules/auth/components/LastUsedBadge.d.ts +17 -5
  282. package/dist/src/modules/auth/components/LastUsedBadge.js +16 -6
  283. package/dist/src/modules/auth/components/LastUsedBadge.js.map +1 -0
  284. package/dist/src/modules/auth/components/LoginForm.d.ts +11 -3
  285. package/dist/src/modules/auth/components/LoginForm.js +107 -40
  286. package/dist/src/modules/auth/components/LoginForm.js.map +1 -0
  287. package/dist/src/modules/auth/components/LoginRoute.d.ts +11 -3
  288. package/dist/src/modules/auth/components/LoginRoute.js +41 -8
  289. package/dist/src/modules/auth/components/LoginRoute.js.map +1 -0
  290. package/dist/src/modules/auth/components/LogoutRoute.d.ts +7 -1
  291. package/dist/src/modules/auth/components/LogoutRoute.js +18 -12
  292. package/dist/src/modules/auth/components/LogoutRoute.js.map +1 -0
  293. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.d.ts +21 -8
  294. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js +107 -97
  295. package/dist/src/modules/auth/components/OrganizationAcceptInvitationRoute.js.map +1 -0
  296. package/dist/src/modules/auth/components/OrganizationMembersRoute.d.ts +58 -48
  297. package/dist/src/modules/auth/components/OrganizationMembersRoute.js +448 -349
  298. package/dist/src/modules/auth/components/OrganizationMembersRoute.js.map +1 -0
  299. package/dist/src/modules/auth/components/OrganizationPreferences.d.ts +27 -16
  300. package/dist/src/modules/auth/components/OrganizationPreferences.js +129 -124
  301. package/dist/src/modules/auth/components/OrganizationPreferences.js.map +1 -0
  302. package/dist/src/modules/auth/components/OrganizationSettingsRoute.d.ts +27 -18
  303. package/dist/src/modules/auth/components/OrganizationSettingsRoute.js +184 -144
  304. package/dist/src/modules/auth/components/OrganizationSettingsRoute.js.map +1 -0
  305. package/dist/src/modules/auth/components/OrganizationSwitcher.d.ts +17 -6
  306. package/dist/src/modules/auth/components/OrganizationSwitcher.js +91 -69
  307. package/dist/src/modules/auth/components/OrganizationSwitcher.js.map +1 -0
  308. package/dist/src/modules/auth/components/PreferencesEditor.d.ts +44 -33
  309. package/dist/src/modules/auth/components/PreferencesEditor.js +82 -58
  310. package/dist/src/modules/auth/components/PreferencesEditor.js.map +1 -0
  311. package/dist/src/modules/auth/components/ProfileRoute.d.ts +7 -1
  312. package/dist/src/modules/auth/components/ProfileRoute.js +79 -36
  313. package/dist/src/modules/auth/components/ProfileRoute.js.map +1 -0
  314. package/dist/src/modules/auth/components/RangeNuqsDatePicker.d.ts +44 -30
  315. package/dist/src/modules/auth/components/RangeNuqsDatePicker.js +234 -242
  316. package/dist/src/modules/auth/components/RangeNuqsDatePicker.js.map +1 -0
  317. package/dist/src/modules/auth/components/ResetPasswordForm.d.ts +7 -1
  318. package/dist/src/modules/auth/components/ResetPasswordForm.js +97 -35
  319. package/dist/src/modules/auth/components/ResetPasswordForm.js.map +1 -0
  320. package/dist/src/modules/auth/components/ResetPasswordRoute.d.ts +7 -1
  321. package/dist/src/modules/auth/components/ResetPasswordRoute.js +34 -6
  322. package/dist/src/modules/auth/components/ResetPasswordRoute.js.map +1 -0
  323. package/dist/src/modules/auth/components/SignupFormRoute.d.ts +15 -5
  324. package/dist/src/modules/auth/components/SignupFormRoute.js +142 -99
  325. package/dist/src/modules/auth/components/SignupFormRoute.js.map +1 -0
  326. package/dist/src/modules/auth/components/SignupRoute.d.ts +13 -5
  327. package/dist/src/modules/auth/components/SignupRoute.js +59 -13
  328. package/dist/src/modules/auth/components/SignupRoute.js.map +1 -0
  329. package/dist/src/modules/auth/components/UserPreferences.d.ts +22 -11
  330. package/dist/src/modules/auth/components/UserPreferences.js +24 -12
  331. package/dist/src/modules/auth/components/UserPreferences.js.map +1 -0
  332. package/dist/src/modules/auth/components/WaitlistCard.d.ts +11 -4
  333. package/dist/src/modules/auth/components/WaitlistCard.js +63 -28
  334. package/dist/src/modules/auth/components/WaitlistCard.js.map +1 -0
  335. package/dist/src/modules/auth/components/WaitlistCodeValidation.d.ts +13 -5
  336. package/dist/src/modules/auth/components/WaitlistCodeValidation.js +42 -40
  337. package/dist/src/modules/auth/components/WaitlistCodeValidation.js.map +1 -0
  338. package/dist/src/modules/billing/components/BillingBetaPage.d.ts +15 -6
  339. package/dist/src/modules/billing/components/BillingBetaPage.js +155 -8
  340. package/dist/src/modules/billing/components/BillingBetaPage.js.map +1 -0
  341. package/dist/src/modules/billing/components/BillingInvoicePage.d.ts +13 -5
  342. package/dist/src/modules/billing/components/BillingInvoicePage.js +160 -30
  343. package/dist/src/modules/billing/components/BillingInvoicePage.js.map +1 -0
  344. package/dist/src/modules/billing/components/BillingPlanSelect.d.ts +11 -4
  345. package/dist/src/modules/billing/components/BillingPlanSelect.js +10 -7
  346. package/dist/src/modules/billing/components/BillingPlanSelect.js.map +1 -0
  347. package/dist/src/modules/billing/components/BillingRouter.d.ts +15 -7
  348. package/dist/src/modules/billing/components/BillingRouter.js +19 -6
  349. package/dist/src/modules/billing/components/BillingRouter.js.map +1 -0
  350. package/dist/src/modules/billing/components/BillingSinglePlanSelect.d.ts +17 -7
  351. package/dist/src/modules/billing/components/BillingSinglePlanSelect.js +163 -42
  352. package/dist/src/modules/billing/components/BillingSinglePlanSelect.js.map +1 -0
  353. package/dist/src/modules/table/components/ColumnOrderAndVisibility.d.ts +18 -8
  354. package/dist/src/modules/table/components/ColumnOrderAndVisibility.js +81 -38
  355. package/dist/src/modules/table/components/ColumnOrderAndVisibility.js.map +1 -0
  356. package/dist/src/modules/table/components/NuqsTable.d.ts +33 -21
  357. package/dist/src/modules/table/components/NuqsTable.js +295 -221
  358. package/dist/src/modules/table/components/NuqsTable.js.map +1 -0
  359. package/dist/src/modules/table/components/TableFiltering.d.ts +33 -21
  360. package/dist/src/modules/table/components/TableFiltering.js +408 -226
  361. package/dist/src/modules/table/components/TableFiltering.js.map +1 -0
  362. package/dist/src/modules/table/components/TableGroupBy.d.ts +18 -8
  363. package/dist/src/modules/table/components/TableGroupBy.js +56 -16
  364. package/dist/src/modules/table/components/TableGroupBy.js.map +1 -0
  365. package/dist/src/modules/table/components/TablePagination.d.ts +17 -7
  366. package/dist/src/modules/table/components/TablePagination.js +64 -32
  367. package/dist/src/modules/table/components/TablePagination.js.map +1 -0
  368. package/dist/src/modules/table/components/table.types.d.ts +15 -10
  369. package/dist/src/modules/table/components/table.types.js +0 -1
  370. package/dist/src/modules/table/filterTransformers.d.ts +35 -30
  371. package/dist/src/modules/table/filterTransformers.js +198 -261
  372. package/dist/src/modules/table/filterTransformers.js.map +1 -0
  373. package/dist/src/types.d.ts +8 -3
  374. package/dist/src/types.js +0 -1
  375. package/package.json +8 -6
  376. package/dist/translations/en/web-ui.json +0 -209
  377. package/dist/tsconfig.lib.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ErrorAuthRoute.js","names":["Link"],"sources":["../../../../../src/modules/auth/components/ErrorAuthRoute.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { AlertCircle } from \"lucide-react\";\r\nimport { useQueryState } from \"nuqs\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\n\r\nexport function ErrorAuthRoute() {\r\n const { t } = useTranslation();\r\n const [error] = useQueryState(\"error\");\r\n\r\n const ErrorEnum = {\r\n invalid_callback_request: {\r\n title: \"Invalid callback request\",\r\n description: \"The callback request is invalid. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_not_found: {\r\n title: \"State not found\",\r\n description: \"The state was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n account_already_linked_to_different_user: {\r\n title: \"Account already linked to different user\",\r\n description: \"The account is already linked to a different user. Please try again.\",\r\n buttons: [\"signup\"],\r\n signupLabel: null,\r\n },\r\n \"email_doesn't_match\": {\r\n title: \"Email doesn't match\",\r\n description: \"The email doesn't match. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n email_not_found: {\r\n title: \"Email not found\",\r\n description: \"The email was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_callback_url: {\r\n title: \"No callback URL\",\r\n description: \"The callback URL is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n no_code: {\r\n title: \"No code\",\r\n description: \"The code is not set. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n oauth_provider_not_found: {\r\n title: \"OAuth provider not found\",\r\n description: \"The OAuth provider was not found. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_link_account: {\r\n title: \"Unable to link account\",\r\n description: \"The account could not be linked. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n unable_to_get_user_info: {\r\n title: \"Unable to get user info\",\r\n description: \"The user info could not be retrieved. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n state_mismatch: {\r\n title: \"State mismatch\",\r\n description: \"The state mismatch. Please try again.\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n signup_disabled: {\r\n title: \"Signup disabled\",\r\n description:\r\n \"The signup is disabled while we are in beta. Please join the waitlist to be notified when we launch.\",\r\n buttons: [\"signup\"],\r\n signupLabel: \"Join the waitlist\",\r\n },\r\n default: {\r\n title: \"Authentication Failed\",\r\n description: \"We encountered an issue with your authentication request\",\r\n buttons: [\"login\", \"signup\"],\r\n signupLabel: null,\r\n },\r\n };\r\n\r\n const errorData = ErrorEnum[error as keyof typeof ErrorEnum] || ErrorEnum.default;\r\n const { title, description, buttons, signupLabel } = errorData;\r\n\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-2 items-center\">\r\n <AlertCircle className=\"w-10 h-10 text-red-500\" />\r\n <p className=\"text-xl font-semibold\">{title}</p>\r\n <p className=\"text-sm text-default-600\">{description}</p>\r\n </CardHeader>\r\n <CardBody className=\"flex flex-col gap-4\">\r\n <div className=\"flex flex-col gap-2\">\r\n {buttons.includes(\"login\") && (\r\n <Button as={Link} to=\"/login\" variant=\"bordered\">\r\n {t(\"web-ui:auth.error.backToLogin\")}\r\n </Button>\r\n )}\r\n {buttons.includes(\"signup\") && (\r\n <Button as={Link} to=\"/signup\" variant=\"bordered\">\r\n {signupLabel || t(\"web-ui:auth.error.backToSignup\")}\r\n </Button>\r\n )}\r\n </div>\r\n </CardBody>\r\n </Card>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;;AAMA,SAAgB,iBAAiB;CAC/B,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,CAAC,SAAS,cAAc,QAAQ;CAEtC,MAAM,YAAY;EAChB,0BAA0B;GACxB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,0CAA0C;GACxC,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS;GACnB,aAAa;GACd;EACD,uBAAuB;GACrB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,SAAS;GACP,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,0BAA0B;GACxB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,wBAAwB;GACtB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,yBAAyB;GACvB,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,gBAAgB;GACd,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACD,iBAAiB;GACf,OAAO;GACP,aACE;GACF,SAAS,CAAC,SAAS;GACnB,aAAa;GACd;EACD,SAAS;GACP,OAAO;GACP,aAAa;GACb,SAAS,CAAC,SAAS,SAAS;GAC5B,aAAa;GACd;EACF;CAGD,MAAM,EAAE,OAAO,aAAa,SAAS,gBADnB,UAAU,UAAoC,UAAU;AAG1E,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB;IACE,oBAAC,aAAD,EAAa,WAAU,0BAA2B,CAAA;IAClD,oBAAC,KAAD;KAAG,WAAU;eAAyB;KAAU,CAAA;IAChD,oBAAC,KAAD;KAAG,WAAU;eAA4B;KAAgB,CAAA;IAC9C;MACb,oBAAC,UAAD;GAAU,WAAU;aAClB,qBAAC,OAAD;IAAK,WAAU;cAAf,CACG,QAAQ,SAAS,QAAQ,IACxB,oBAAC,QAAD;KAAQ,IAAIA;KAAM,IAAG;KAAS,SAAQ;eACnC,EAAE,gCAAgC;KAC5B,CAAA,EAEV,QAAQ,SAAS,SAAS,IACzB,oBAAC,QAAD;KAAQ,IAAIA;KAAM,IAAG;KAAU,SAAQ;eACpC,eAAe,EAAE,iCAAiC;KAC5C,CAAA,CAEP;;GACG,CAAA,CACN,EAAA,CAAA;EACH,CAAA"}
@@ -1 +1,7 @@
1
- export declare function ForgotPasswordForm(): import("react/jsx-runtime").JSX.Element;
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/modules/auth/components/ForgotPasswordForm.d.ts
4
+ declare function ForgotPasswordForm(): _$react_jsx_runtime0.JSX.Element;
5
+ //#endregion
6
+ export { ForgotPasswordForm };
7
+ //# sourceMappingURL=ForgotPasswordForm.d.ts.map
@@ -1,27 +1,53 @@
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
1
  import { useState } from "react";
5
- import { useForm } from "react-hook-form";
2
+ import { Button, Input } from "@heroui/react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
6
4
  import { useTranslation } from "react-i18next";
7
5
  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") })] }));
6
+ import { useForm } from "react-hook-form";
7
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
8
+ //#region src/modules/auth/components/ForgotPasswordForm.tsx
9
+ function ForgotPasswordForm() {
10
+ const { t } = useTranslation();
11
+ const { register, handleSubmit, formState: { errors } } = useForm();
12
+ const [isBusy, setIsBusy] = useState(false);
13
+ const onSubmit = (data) => {
14
+ setIsBusy(true);
15
+ authClient.requestPasswordReset({
16
+ email: data.email,
17
+ redirectTo: "/reset-password"
18
+ }).then(() => {
19
+ toast.success(t("web-ui:auth.forgotPassword.success"));
20
+ }).catch(() => {
21
+ toast.error(t("web-ui:auth.forgotPassword.error"));
22
+ });
23
+ };
24
+ return /* @__PURE__ */ jsxs("form", {
25
+ onSubmit: handleSubmit(onSubmit),
26
+ className: "grid gap-6",
27
+ children: [/* @__PURE__ */ jsxs("div", {
28
+ className: "grid gap-2",
29
+ children: [/* @__PURE__ */ jsx(Input, {
30
+ labelPlacement: "outside",
31
+ label: t("web-ui:auth.login.email"),
32
+ type: "email",
33
+ placeholder: t("web-ui:auth.login.placeholder.email"),
34
+ variant: "bordered",
35
+ isRequired: true,
36
+ ...register("email", { required: true })
37
+ }), errors.email && /* @__PURE__ */ jsx("span", {
38
+ className: "text-red-500 text-xs",
39
+ children: t("web-ui:auth.signup.emailRequired")
40
+ })]
41
+ }), /* @__PURE__ */ jsx(Button, {
42
+ type: "submit",
43
+ className: "w-full",
44
+ color: "primary",
45
+ isDisabled: isBusy,
46
+ children: t("web-ui:auth.forgotPassword.button")
47
+ })]
48
+ });
27
49
  }
50
+ //#endregion
51
+ export { ForgotPasswordForm };
52
+
53
+ //# sourceMappingURL=ForgotPasswordForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForgotPasswordForm.js","names":[],"sources":["../../../../../src/modules/auth/components/ForgotPasswordForm.tsx"],"sourcesContent":["import { Button, Input } from \"@heroui/react\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { useState } from \"react\";\r\nimport { type SubmitHandler, useForm } from \"react-hook-form\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { toast } from \"sonner\";\r\n\r\ntype Inputs = {\r\n email: string;\r\n};\r\n\r\nexport function ForgotPasswordForm() {\r\n const { t } = useTranslation();\r\n const {\r\n register,\r\n handleSubmit,\r\n formState: { errors },\r\n } = useForm<Inputs>();\r\n\r\n const [isBusy, setIsBusy] = useState(false);\r\n\r\n const onSubmit: SubmitHandler<Inputs> = (data) => {\r\n setIsBusy(true);\r\n authClient\r\n .requestPasswordReset({\r\n email: data.email,\r\n redirectTo: \"/reset-password\",\r\n })\r\n .then(() => {\r\n toast.success(t(\"web-ui:auth.forgotPassword.success\"));\r\n })\r\n .catch(() => {\r\n toast.error(t(\"web-ui:auth.forgotPassword.error\"));\r\n });\r\n };\r\n\r\n return (\r\n <form onSubmit={handleSubmit(onSubmit)} className=\"grid gap-6\">\r\n <div className=\"grid gap-2\">\r\n <Input\r\n labelPlacement=\"outside\"\r\n label={t(\"web-ui:auth.login.email\")}\r\n type=\"email\"\r\n placeholder={t(\"web-ui:auth.login.placeholder.email\")}\r\n variant=\"bordered\"\r\n isRequired\r\n {...register(\"email\", { required: true })}\r\n />\r\n {errors.email && (\r\n <span className=\"text-red-500 text-xs\">{t(\"web-ui:auth.signup.emailRequired\")}</span>\r\n )}\r\n </div>\r\n <Button type=\"submit\" className=\"w-full\" color=\"primary\" isDisabled={isBusy}>\r\n {t(\"web-ui:auth.forgotPassword.button\")}\r\n </Button>\r\n </form>\r\n );\r\n}\r\n"],"mappings":";;;;;;;;AAWA,SAAgB,qBAAqB;CACnC,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EACJ,UACA,cACA,WAAW,EAAE,aACX,SAAiB;CAErB,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM;CAE3C,MAAM,YAAmC,SAAS;AAChD,YAAU,KAAK;AACf,aACG,qBAAqB;GACpB,OAAO,KAAK;GACZ,YAAY;GACb,CAAC,CACD,WAAW;AACV,SAAM,QAAQ,EAAE,qCAAqC,CAAC;IACtD,CACD,YAAY;AACX,SAAM,MAAM,EAAE,mCAAmC,CAAC;IAClD;;AAGN,QACE,qBAAC,QAAD;EAAM,UAAU,aAAa,SAAS;EAAE,WAAU;YAAlD,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,OAAD;IACE,gBAAe;IACf,OAAO,EAAE,0BAA0B;IACnC,MAAK;IACL,aAAa,EAAE,sCAAsC;IACrD,SAAQ;IACR,YAAA;IACA,GAAI,SAAS,SAAS,EAAE,UAAU,MAAM,CAAC;IACzC,CAAA,EACD,OAAO,SACN,oBAAC,QAAD;IAAM,WAAU;cAAwB,EAAE,mCAAmC;IAAQ,CAAA,CAEnF;MACN,oBAAC,QAAD;GAAQ,MAAK;GAAS,WAAU;GAAS,OAAM;GAAU,YAAY;aAClE,EAAE,oCAAoC;GAChC,CAAA,CACJ"}
@@ -1 +1,7 @@
1
- export declare function ForgotPasswordRoute(): import("react/jsx-runtime").JSX.Element;
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+
3
+ //#region src/modules/auth/components/ForgotPasswordRoute.d.ts
4
+ declare function ForgotPasswordRoute(): _$react_jsx_runtime0.JSX.Element;
5
+ //#endregion
6
+ export { ForgotPasswordRoute };
7
+ //# sourceMappingURL=ForgotPasswordRoute.d.ts.map
@@ -1,9 +1,37 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { ForgotPasswordForm } from "./ForgotPasswordForm.js";
2
2
  import { Card, CardBody, CardHeader } from "@heroui/react";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
3
4
  import { useTranslation } from "react-i18next";
4
- import { Link } from "react-router";
5
- import { ForgotPasswordForm } from "./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") })] })] }));
5
+ import { Link as Link$1 } from "react-router";
6
+ //#region src/modules/auth/components/ForgotPasswordRoute.tsx
7
+ function ForgotPasswordRoute() {
8
+ const { t } = useTranslation();
9
+ return /* @__PURE__ */ jsxs("div", {
10
+ className: "flex flex-col gap-6",
11
+ children: [/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
12
+ className: "text-center flex flex-col gap-1",
13
+ children: [/* @__PURE__ */ jsx("p", {
14
+ className: "text-xl font-semibold",
15
+ children: t("web-ui:auth.forgotPassword.title")
16
+ }), /* @__PURE__ */ jsx("p", {
17
+ className: "text-sm text-default-600",
18
+ children: t("web-ui:auth.forgotPassword.description")
19
+ })]
20
+ }), /* @__PURE__ */ jsx(CardBody, { children: /* @__PURE__ */ jsx(ForgotPasswordForm, {}) })] }), /* @__PURE__ */ jsxs("div", {
21
+ className: "text-center text-xs text-muted-foreground",
22
+ children: [
23
+ t("web-ui:auth.forgotPassword.rememberPassword"),
24
+ " ",
25
+ /* @__PURE__ */ jsx(Link$1, {
26
+ to: "/login",
27
+ className: "underline underline-offset-4 hover:text-primary",
28
+ children: t("web-ui:auth.login.button")
29
+ })
30
+ ]
31
+ })]
32
+ });
9
33
  }
34
+ //#endregion
35
+ export { ForgotPasswordRoute };
36
+
37
+ //# sourceMappingURL=ForgotPasswordRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ForgotPasswordRoute.js","names":["Link"],"sources":["../../../../../src/modules/auth/components/ForgotPasswordRoute.tsx"],"sourcesContent":["import { Card, CardBody, CardHeader } from \"@heroui/react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link } from \"react-router\";\r\nimport { ForgotPasswordForm } from \"./ForgotPasswordForm\";\r\n\r\nexport function ForgotPasswordRoute() {\r\n const { t } = useTranslation();\r\n return (\r\n <div className=\"flex flex-col gap-6\">\r\n <Card>\r\n <CardHeader className=\"text-center flex flex-col gap-1\">\r\n <p className=\"text-xl font-semibold\">{t(\"web-ui:auth.forgotPassword.title\")}</p>\r\n <p className=\"text-sm text-default-600\">{t(\"web-ui:auth.forgotPassword.description\")}</p>\r\n </CardHeader>\r\n <CardBody>\r\n <ForgotPasswordForm />\r\n </CardBody>\r\n </Card>\r\n <div className=\"text-center text-xs text-muted-foreground\">\r\n {t(\"web-ui:auth.forgotPassword.rememberPassword\")}{\" \"}\r\n <Link to=\"/login\" className=\"underline underline-offset-4 hover:text-primary\">\r\n {t(\"web-ui:auth.login.button\")}\r\n </Link>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":";;;;;;AAKA,SAAgB,sBAAsB;CACpC,MAAM,EAAE,MAAM,gBAAgB;AAC9B,QACE,qBAAC,OAAD;EAAK,WAAU;YAAf,CACE,qBAAC,MAAD,EAAA,UAAA,CACE,qBAAC,YAAD;GAAY,WAAU;aAAtB,CACE,oBAAC,KAAD;IAAG,WAAU;cAAyB,EAAE,mCAAmC;IAAK,CAAA,EAChF,oBAAC,KAAD;IAAG,WAAU;cAA4B,EAAE,yCAAyC;IAAK,CAAA,CAC9E;MACb,oBAAC,UAAD,EAAA,UACE,oBAAC,oBAAD,EAAsB,CAAA,EACb,CAAA,CACN,EAAA,CAAA,EACP,qBAAC,OAAD;GAAK,WAAU;aAAf;IACG,EAAE,8CAA8C;IAAE;IACnD,oBAACA,QAAD;KAAM,IAAG;KAAS,WAAU;eACzB,EAAE,2BAA2B;KACzB,CAAA;IACH;KACF"}
@@ -1,5 +1,13 @@
1
- import type { UseBackendTRPC } from "../../../types";
2
- export interface InviteFriendsProps {
3
- useTRPC: UseBackendTRPC;
1
+ import { UseBackendTRPC } from "../../../types.js";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+
4
+ //#region src/modules/auth/components/InviteFriends.d.ts
5
+ interface InviteFriendsProps {
6
+ useTRPC: UseBackendTRPC;
4
7
  }
5
- export declare function InviteFriends({ useTRPC }: InviteFriendsProps): import("react/jsx-runtime").JSX.Element;
8
+ declare function InviteFriends({
9
+ useTRPC
10
+ }: InviteFriendsProps): _$react_jsx_runtime0.JSX.Element;
11
+ //#endregion
12
+ export { InviteFriends, InviteFriendsProps };
13
+ //# sourceMappingURL=InviteFriends.d.ts.map
@@ -1,74 +1,280 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { CopyButton } from "../../../components/CopyButton.js";
2
+ import { useMemo, useState } from "react";
2
3
  import { Button, Card, CardBody, CardHeader, Chip, Input } from "@heroui/react";
3
- import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
4
5
  import { CheckCircle2, Link2Icon, Mail, Send, Ticket, Users, Zap } from "lucide-react";
5
- import { useMemo, useState } from "react";
6
6
  import { toast } from "sonner";
7
+ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
7
8
  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." })] })] })] }));
9
+ //#region src/modules/auth/components/InviteFriends.tsx
10
+ function InviteFriends({ useTRPC }) {
11
+ const trpc = useTRPC();
12
+ const queryClient = useQueryClient();
13
+ const { data: waitlist = [] } = useQuery(trpc.auth.listWaitlist.queryOptions());
14
+ const { data: count = 0 } = useQuery(trpc.auth.getUserWaitlistCount.queryOptions());
15
+ const invitesAvailable = Math.max(0, 3 - count);
16
+ const inviteMutation = useMutation(trpc.auth.inviteToWaitlist.mutationOptions({
17
+ onSuccess: (result) => {
18
+ queryClient.setQueryData(trpc.auth.getUserWaitlistCount.queryKey(), (old) => (old ?? 0) + 1);
19
+ queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [...old ?? [], result]);
20
+ toast.success("Invitation sent successfully!");
21
+ },
22
+ onError: (error) => {
23
+ toast.error(error.message);
24
+ }
25
+ }));
26
+ const createInvitationCodeMutation = useMutation(trpc.auth.createInvitationCode.mutationOptions({
27
+ onSuccess: (result) => {
28
+ queryClient.setQueryData(trpc.auth.getUserWaitlistCount.queryKey(), (old) => (old ?? 0) + 1);
29
+ queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [...old ?? [], result]);
30
+ toast.success("Code created successfully!");
31
+ },
32
+ onError: (error) => {
33
+ toast.error(error.message);
34
+ }
35
+ }));
36
+ const [email, setEmail] = useState("");
37
+ const [name, setName] = useState("");
38
+ const isLoading = inviteMutation.isPending || createInvitationCodeMutation.isPending;
39
+ const isEmailValid = useMemo(() => {
40
+ return z.email().safeParse(email).success;
41
+ }, [email]);
42
+ const handleInvite = async (e) => {
43
+ e.preventDefault();
44
+ if (!email) return;
45
+ inviteMutation.mutate({
46
+ email,
47
+ name: name.length > 0 ? name : void 0
48
+ });
49
+ setEmail("");
50
+ setName("");
51
+ };
52
+ const handleCreateCode = async () => {
53
+ createInvitationCodeMutation.mutate({ name: name.length > 0 ? name : void 0 });
54
+ setEmail("");
55
+ setName("");
56
+ };
57
+ const getStatusColor = (status) => {
58
+ switch (status.toLowerCase()) {
59
+ case "accepted":
60
+ case "completed": return "success";
61
+ case "invited": return "warning";
62
+ case "waitlist": return "default";
63
+ default: return "default";
64
+ }
65
+ };
66
+ return /* @__PURE__ */ jsxs("div", {
67
+ className: "max-w-3xl mx-auto p-6 space-y-8",
68
+ children: [
69
+ /* @__PURE__ */ jsxs("div", {
70
+ className: "text-center space-y-4",
71
+ children: [
72
+ /* @__PURE__ */ jsx("div", {
73
+ className: "inline-flex items-center justify-center p-4 bg-primary/10 rounded-full mb-2 ring-1 ring-primary/20",
74
+ children: /* @__PURE__ */ jsx(Ticket, { className: "w-8 h-8 text-primary" })
75
+ }),
76
+ /* @__PURE__ */ jsx("h1", {
77
+ className: "text-3xl md:text-4xl font-bold tracking-tight",
78
+ children: "Invite Friends & Skip the Waitlist"
79
+ }),
80
+ /* @__PURE__ */ jsxs("p", {
81
+ className: "text-lg text-default-600 max-w-lg mx-auto leading-relaxed",
82
+ children: [
83
+ "Encourage your friends to join! Friends invited by you get",
84
+ " ",
85
+ /* @__PURE__ */ jsx("span", {
86
+ className: "text-foreground font-medium",
87
+ children: "immediate access"
88
+ }),
89
+ " and skip the waitlist completely."
90
+ ]
91
+ }),
92
+ /* @__PURE__ */ jsx("div", {
93
+ className: "flex justify-center mt-4",
94
+ children: /* @__PURE__ */ jsxs(Chip, {
95
+ color: invitesAvailable > 0 ? "warning" : "default",
96
+ variant: "flat",
97
+ size: "lg",
98
+ startContent: /* @__PURE__ */ jsx(Zap, {
99
+ size: 16,
100
+ className: invitesAvailable > 0 ? "text-warning-600" : ""
101
+ }),
102
+ className: "font-medium",
103
+ children: [
104
+ invitesAvailable,
105
+ " ",
106
+ invitesAvailable === 1 ? "Invite" : "Invites",
107
+ " Remaining"
108
+ ]
109
+ })
110
+ })
111
+ ]
112
+ }),
113
+ /* @__PURE__ */ jsxs("div", {
114
+ className: "grid gap-6",
115
+ children: [/* @__PURE__ */ jsxs(Card, {
116
+ className: "shadow-sm border border-default-200",
117
+ children: [/* @__PURE__ */ jsxs(CardHeader, {
118
+ className: "flex flex-col items-start gap-1 px-6 pt-6 pb-2",
119
+ children: [/* @__PURE__ */ jsx("h3", {
120
+ className: "text-xl font-semibold",
121
+ children: "Send an Invitation via Email"
122
+ }), /* @__PURE__ */ jsx("p", {
123
+ className: "text-small text-default-600",
124
+ children: "They'll receive a unique code to join instantly."
125
+ })]
126
+ }), /* @__PURE__ */ jsx(CardBody, {
127
+ className: "px-6 pb-6",
128
+ children: /* @__PURE__ */ jsxs("form", {
129
+ onSubmit: handleInvite,
130
+ className: "flex flex-col gap-4",
131
+ children: [/* @__PURE__ */ jsxs("div", {
132
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
133
+ children: [/* @__PURE__ */ jsx(Input, {
134
+ label: "Friend's Name (Optional)",
135
+ placeholder: "e.g. Alex",
136
+ value: name,
137
+ onValueChange: setName,
138
+ variant: "bordered",
139
+ labelPlacement: "outside"
140
+ }), /* @__PURE__ */ jsx(Input, {
141
+ type: "email",
142
+ label: "Email Address (Required for sending)",
143
+ placeholder: "friend@example.com",
144
+ value: email,
145
+ onValueChange: setEmail,
146
+ variant: "bordered",
147
+ labelPlacement: "outside",
148
+ startContent: /* @__PURE__ */ jsx(Mail, {
149
+ className: "text-default-400 pointer-events-none flex-shrink-0",
150
+ size: 16
151
+ })
152
+ })]
153
+ }), /* @__PURE__ */ jsxs("div", {
154
+ className: "flex justify-end pt-2 gap-2",
155
+ children: [/* @__PURE__ */ jsx(Button, {
156
+ color: "primary",
157
+ variant: "bordered",
158
+ type: "button",
159
+ isLoading,
160
+ isDisabled: invitesAvailable <= 0,
161
+ onPress: handleCreateCode,
162
+ className: "font-medium",
163
+ endContent: !isLoading && /* @__PURE__ */ jsx(Link2Icon, { size: 16 }),
164
+ children: "Create Invitation Link"
165
+ }), /* @__PURE__ */ jsx(Button, {
166
+ color: "primary",
167
+ type: "submit",
168
+ isLoading,
169
+ isDisabled: invitesAvailable <= 0 || !isEmailValid,
170
+ className: "font-medium",
171
+ endContent: !isLoading && /* @__PURE__ */ jsx(Send, { size: 16 }),
172
+ children: "Send Invitation"
173
+ })]
174
+ })]
175
+ })
176
+ })]
177
+ }), /* @__PURE__ */ jsxs("div", {
178
+ className: "space-y-4",
179
+ children: [/* @__PURE__ */ jsx("div", {
180
+ className: "flex items-center justify-between",
181
+ children: /* @__PURE__ */ jsx("h3", {
182
+ className: "text-xl font-semibold",
183
+ children: "Created Invitations"
184
+ })
185
+ }), waitlist.length > 0 ? /* @__PURE__ */ jsx("div", {
186
+ className: "flex flex-col gap-3",
187
+ children: waitlist.map((item) => /* @__PURE__ */ jsxs("div", {
188
+ className: "flex items-center justify-between p-4 border border-default-200 rounded-lg bg-content1",
189
+ children: [/* @__PURE__ */ jsxs("div", {
190
+ className: "flex flex-row gap-3",
191
+ children: [/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("span", {
192
+ className: "text-sm font-medium",
193
+ children: item.email || item.name || "Open Invitation Link"
194
+ }) }), /* @__PURE__ */ jsx(Chip, {
195
+ size: "sm",
196
+ color: getStatusColor(item.status),
197
+ variant: "flat",
198
+ className: "capitalize",
199
+ children: item.status.toLowerCase()
200
+ })]
201
+ }), /* @__PURE__ */ jsx("div", {
202
+ className: "flex items-center gap-3",
203
+ children: item.code && /* @__PURE__ */ jsx(CopyButton, {
204
+ variant: "flat",
205
+ color: "success",
206
+ size: "sm",
207
+ text: `${import.meta.env.VITE_APP_URL}/signup?code=${item.code}`,
208
+ isIconOnly: true
209
+ })
210
+ })]
211
+ }, item.id))
212
+ }) : /* @__PURE__ */ jsx("div", {
213
+ className: "text-center py-8 text-default-600 border border-dashed border-default-200 rounded-lg",
214
+ children: "No invitations created yet."
215
+ })]
216
+ })]
217
+ }),
218
+ /* @__PURE__ */ jsxs("div", {
219
+ className: "grid grid-cols-1 md:grid-cols-3 gap-4 py-4",
220
+ children: [
221
+ /* @__PURE__ */ jsxs("div", {
222
+ className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm",
223
+ children: [
224
+ /* @__PURE__ */ jsx("div", {
225
+ className: "p-3 bg-warning/10 text-warning rounded-full mb-4",
226
+ children: /* @__PURE__ */ jsx(Zap, { className: "w-6 h-6" })
227
+ }),
228
+ /* @__PURE__ */ jsx("h3", {
229
+ className: "font-semibold mb-2",
230
+ children: "Instant Access"
231
+ }),
232
+ /* @__PURE__ */ jsx("p", {
233
+ className: "text-sm text-default-600",
234
+ children: "Friends you invite skip the waitlist completely and get in right away."
235
+ })
236
+ ]
237
+ }),
238
+ /* @__PURE__ */ jsxs("div", {
239
+ className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm",
240
+ children: [
241
+ /* @__PURE__ */ jsx("div", {
242
+ className: "p-3 bg-primary/10 text-primary rounded-full mb-4",
243
+ children: /* @__PURE__ */ jsx(Users, { className: "w-6 h-6" })
244
+ }),
245
+ /* @__PURE__ */ jsx("h3", {
246
+ className: "font-semibold mb-2",
247
+ children: "Grow Your Network"
248
+ }),
249
+ /* @__PURE__ */ jsx("p", {
250
+ className: "text-sm text-default-600",
251
+ children: "Build your circle within the app from day one."
252
+ })
253
+ ]
254
+ }),
255
+ /* @__PURE__ */ jsxs("div", {
256
+ className: "flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm",
257
+ children: [
258
+ /* @__PURE__ */ jsx("div", {
259
+ className: "p-3 bg-success/10 text-success rounded-full mb-4",
260
+ children: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-6 h-6" })
261
+ }),
262
+ /* @__PURE__ */ jsx("h3", {
263
+ className: "font-semibold mb-2",
264
+ children: "Verified Status"
265
+ }),
266
+ /* @__PURE__ */ jsx("p", {
267
+ className: "text-sm text-default-600",
268
+ children: "Invited members get a verified badge on their profile."
269
+ })
270
+ ]
271
+ })
272
+ ]
273
+ })
274
+ ]
275
+ });
74
276
  }
277
+ //#endregion
278
+ export { InviteFriends };
279
+
280
+ //# sourceMappingURL=InviteFriends.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InviteFriends.js","names":[],"sources":["../../../../../src/modules/auth/components/InviteFriends.tsx"],"sourcesContent":["import { Button, Card, CardBody, CardHeader, Chip, Input } from \"@heroui/react\";\r\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\r\nimport { CheckCircle2, Link2Icon, Mail, Send, Ticket, Users, Zap } from \"lucide-react\";\r\nimport { useMemo, useState } from \"react\";\r\nimport { toast } from \"sonner\";\r\nimport { z } from \"zod\";\r\nimport { CopyButton } from \"../../../components/CopyButton\";\r\nimport type { UseBackendTRPC } from \"../../../types\";\r\n\r\nexport interface InviteFriendsProps {\r\n useTRPC: UseBackendTRPC;\r\n}\r\n\r\nexport function InviteFriends({ useTRPC }: InviteFriendsProps) {\r\n const trpc = useTRPC();\r\n const queryClient = useQueryClient();\r\n\r\n const { data: waitlist = [] } = useQuery(trpc.auth.listWaitlist.queryOptions());\r\n const { data: count = 0 } = useQuery(trpc.auth.getUserWaitlistCount.queryOptions());\r\n\r\n const invitesAvailable = Math.max(0, 3 - count);\r\n\r\n const inviteMutation = useMutation(\r\n trpc.auth.inviteToWaitlist.mutationOptions({\r\n onSuccess: (result) => {\r\n queryClient.setQueryData(\r\n trpc.auth.getUserWaitlistCount.queryKey(),\r\n (old) => (old ?? 0) + 1\r\n );\r\n queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [\r\n ...(old ?? []),\r\n result,\r\n ]);\r\n toast.success(\"Invitation sent successfully!\");\r\n },\r\n onError: (error) => {\r\n toast.error(error.message);\r\n },\r\n })\r\n );\r\n\r\n const createInvitationCodeMutation = useMutation(\r\n trpc.auth.createInvitationCode.mutationOptions({\r\n onSuccess: (result) => {\r\n queryClient.setQueryData(\r\n trpc.auth.getUserWaitlistCount.queryKey(),\r\n (old) => (old ?? 0) + 1\r\n );\r\n queryClient.setQueryData(trpc.auth.listWaitlist.queryKey(), (old) => [\r\n ...(old ?? []),\r\n result,\r\n ]);\r\n toast.success(\"Code created successfully!\");\r\n },\r\n onError: (error) => {\r\n toast.error(error.message);\r\n },\r\n })\r\n );\r\n\r\n const [email, setEmail] = useState(\"\");\r\n const [name, setName] = useState(\"\");\r\n const isLoading = inviteMutation.isPending || createInvitationCodeMutation.isPending;\r\n\r\n const isEmailValid = useMemo(() => {\r\n return z.email().safeParse(email).success;\r\n }, [email]);\r\n\r\n const handleInvite = async (e: React.FormEvent) => {\r\n e.preventDefault();\r\n if (!email) return;\r\n\r\n inviteMutation.mutate({ email, name: name.length > 0 ? name : undefined });\r\n setEmail(\"\");\r\n setName(\"\");\r\n };\r\n\r\n const handleCreateCode = async () => {\r\n createInvitationCodeMutation.mutate({ name: name.length > 0 ? name : undefined });\r\n setEmail(\"\");\r\n setName(\"\");\r\n };\r\n\r\n const getStatusColor = (status: string) => {\r\n switch (status.toLowerCase()) {\r\n case \"accepted\":\r\n case \"completed\":\r\n return \"success\";\r\n case \"invited\":\r\n return \"warning\";\r\n case \"waitlist\":\r\n return \"default\";\r\n default:\r\n return \"default\";\r\n }\r\n };\r\n\r\n return (\r\n <div className=\"max-w-3xl mx-auto p-6 space-y-8\">\r\n {/* Hero Section */}\r\n <div className=\"text-center space-y-4\">\r\n <div className=\"inline-flex items-center justify-center p-4 bg-primary/10 rounded-full mb-2 ring-1 ring-primary/20\">\r\n <Ticket className=\"w-8 h-8 text-primary\" />\r\n </div>\r\n <h1 className=\"text-3xl md:text-4xl font-bold tracking-tight\">\r\n Invite Friends & Skip the Waitlist\r\n </h1>\r\n <p className=\"text-lg text-default-600 max-w-lg mx-auto leading-relaxed\">\r\n Encourage your friends to join! Friends invited by you get{\" \"}\r\n <span className=\"text-foreground font-medium\">immediate access</span> and skip the\r\n waitlist completely.\r\n </p>\r\n <div className=\"flex justify-center mt-4\">\r\n <Chip\r\n color={invitesAvailable > 0 ? \"warning\" : \"default\"}\r\n variant=\"flat\"\r\n size=\"lg\"\r\n startContent={\r\n <Zap size={16} className={invitesAvailable > 0 ? \"text-warning-600\" : \"\"} />\r\n }\r\n className=\"font-medium\"\r\n >\r\n {invitesAvailable} {invitesAvailable === 1 ? \"Invite\" : \"Invites\"} Remaining\r\n </Chip>\r\n </div>\r\n </div>\r\n\r\n <div className=\"grid gap-6\">\r\n {/* Invite Form */}\r\n <Card className=\"shadow-sm border border-default-200\">\r\n <CardHeader className=\"flex flex-col items-start gap-1 px-6 pt-6 pb-2\">\r\n <h3 className=\"text-xl font-semibold\">Send an Invitation via Email</h3>\r\n <p className=\"text-small text-default-600\">\r\n They'll receive a unique code to join instantly.\r\n </p>\r\n </CardHeader>\r\n <CardBody className=\"px-6 pb-6\">\r\n <form onSubmit={handleInvite} className=\"flex flex-col gap-4\">\r\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\r\n <Input\r\n label=\"Friend's Name (Optional)\"\r\n placeholder=\"e.g. Alex\"\r\n value={name}\r\n onValueChange={setName}\r\n variant=\"bordered\"\r\n labelPlacement=\"outside\"\r\n />\r\n <Input\r\n type=\"email\"\r\n label=\"Email Address (Required for sending)\"\r\n placeholder=\"friend@example.com\"\r\n value={email}\r\n onValueChange={setEmail}\r\n variant=\"bordered\"\r\n labelPlacement=\"outside\"\r\n startContent={\r\n <Mail\r\n className=\"text-default-400 pointer-events-none flex-shrink-0\"\r\n size={16}\r\n />\r\n }\r\n />\r\n </div>\r\n <div className=\"flex justify-end pt-2 gap-2\">\r\n <Button\r\n color=\"primary\"\r\n variant=\"bordered\"\r\n type=\"button\"\r\n isLoading={isLoading}\r\n isDisabled={invitesAvailable <= 0}\r\n onPress={handleCreateCode}\r\n className=\"font-medium\"\r\n endContent={!isLoading && <Link2Icon size={16} />}\r\n >\r\n Create Invitation Link\r\n </Button>\r\n <Button\r\n color=\"primary\"\r\n type=\"submit\"\r\n isLoading={isLoading}\r\n isDisabled={invitesAvailable <= 0 || !isEmailValid}\r\n className=\"font-medium\"\r\n endContent={!isLoading && <Send size={16} />}\r\n >\r\n Send Invitation\r\n </Button>\r\n </div>\r\n </form>\r\n </CardBody>\r\n </Card>\r\n\r\n {/* Created Invitations Section */}\r\n <div className=\"space-y-4\">\r\n <div className=\"flex items-center justify-between\">\r\n <h3 className=\"text-xl font-semibold\">Created Invitations</h3>\r\n </div>\r\n\r\n {waitlist.length > 0 ? (\r\n <div className=\"flex flex-col gap-3\">\r\n {waitlist.map((item) => (\r\n <div\r\n key={item.id}\r\n className=\"flex items-center justify-between p-4 border border-default-200 rounded-lg bg-content1\"\r\n >\r\n <div className=\"flex flex-row gap-3\">\r\n <div>\r\n <span className=\"text-sm font-medium\">\r\n {item.email || item.name || \"Open Invitation Link\"}\r\n </span>\r\n </div>\r\n <Chip\r\n size=\"sm\"\r\n color={getStatusColor(item.status)}\r\n variant=\"flat\"\r\n className=\"capitalize\"\r\n >\r\n {item.status.toLowerCase()}\r\n </Chip>\r\n </div>\r\n\r\n <div className=\"flex items-center gap-3\">\r\n {item.code && (\r\n <CopyButton\r\n variant=\"flat\"\r\n color=\"success\"\r\n size=\"sm\"\r\n text={`${import.meta.env.VITE_APP_URL}/signup?code=${item.code}`}\r\n isIconOnly\r\n />\r\n )}\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n ) : (\r\n <div className=\"text-center py-8 text-default-600 border border-dashed border-default-200 rounded-lg\">\r\n No invitations created yet.\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n\r\n {/* Benefits Grid */}\r\n <div className=\"grid grid-cols-1 md:grid-cols-3 gap-4 py-4\">\r\n <div className=\"flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm\">\r\n <div className=\"p-3 bg-warning/10 text-warning rounded-full mb-4\">\r\n <Zap className=\"w-6 h-6\" />\r\n </div>\r\n <h3 className=\"font-semibold mb-2\">Instant Access</h3>\r\n <p className=\"text-sm text-default-600\">\r\n Friends you invite skip the waitlist completely and get in right away.\r\n </p>\r\n </div>\r\n <div className=\"flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm\">\r\n <div className=\"p-3 bg-primary/10 text-primary rounded-full mb-4\">\r\n <Users className=\"w-6 h-6\" />\r\n </div>\r\n <h3 className=\"font-semibold mb-2\">Grow Your Network</h3>\r\n <p className=\"text-sm text-default-600\">Build your circle within the app from day one.</p>\r\n </div>\r\n <div className=\"flex flex-col items-center text-center p-6 rounded-2xl bg-content1 border border-default-100 shadow-sm\">\r\n <div className=\"p-3 bg-success/10 text-success rounded-full mb-4\">\r\n <CheckCircle2 className=\"w-6 h-6\" />\r\n </div>\r\n <h3 className=\"font-semibold mb-2\">Verified Status</h3>\r\n <p className=\"text-sm text-default-600\">\r\n Invited members get a verified badge on their profile.\r\n </p>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n}\r\n"],"mappings":"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"}
@@ -1,5 +1,17 @@
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 | import("react/jsx-runtime").JSX.Element | 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> | null | undefined;
1
+ import * as _$react from "react";
2
+ import { BadgeProps } from "@heroui/react";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
+
5
+ //#region src/modules/auth/components/LastUsedBadge.d.ts
6
+ declare function LastUsedBadge({
7
+ lastMethod,
8
+ method,
9
+ children,
10
+ ...props
11
+ }: BadgeProps & {
12
+ lastMethod?: string | null;
13
+ method?: string | null;
14
+ }): string | number | bigint | boolean | _$react_jsx_runtime0.JSX.Element | Iterable<_$react.ReactNode> | Promise<string | number | bigint | boolean | _$react.ReactPortal | _$react.ReactElement<unknown, string | _$react.JSXElementConstructor<any>> | Iterable<_$react.ReactNode> | null | undefined> | null | undefined;
15
+ //#endregion
16
+ export { LastUsedBadge };
17
+ //# sourceMappingURL=LastUsedBadge.d.ts.map