@m5kdev/web-ui 0.1.3 → 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 (370) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/CHANGELOG.md +6 -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
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Alert, 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 { useState } from "react";
6
+ import { useForm } from "react-hook-form";
7
+ import { useTranslation } from "react-i18next";
8
+ import { useNavigate } from "react-router";
9
+ import { toast } from "sonner";
10
+ function getEmailProviderUrl(email) {
11
+ const domain = email.split("@")[1]?.toLowerCase();
12
+ if (!domain)
13
+ return null;
14
+ const EMAIL_URLS = {
15
+ GMAIL: "https://mail.google.com/mail/u/0/#inbox",
16
+ OUTLOOK: "https://outlook.live.com/mail/0/inbox",
17
+ YAHOO: "https://mail.yahoo.com",
18
+ ICLOUD: "https://www.icloud.com/mail",
19
+ PROTON: "https://mail.proton.me",
20
+ };
21
+ const domainMap = {
22
+ "gmail.com": EMAIL_URLS.GMAIL,
23
+ "googlemail.com": EMAIL_URLS.GMAIL,
24
+ "outlook.com": EMAIL_URLS.OUTLOOK,
25
+ "hotmail.com": EMAIL_URLS.OUTLOOK,
26
+ "live.com": EMAIL_URLS.OUTLOOK,
27
+ "msn.com": EMAIL_URLS.OUTLOOK,
28
+ "yahoo.com": EMAIL_URLS.YAHOO,
29
+ "yahoo.co.uk": EMAIL_URLS.YAHOO,
30
+ "yahoo.fr": EMAIL_URLS.YAHOO,
31
+ "ymail.com": EMAIL_URLS.YAHOO,
32
+ "icloud.com": EMAIL_URLS.ICLOUD,
33
+ "me.com": EMAIL_URLS.ICLOUD,
34
+ "mac.com": EMAIL_URLS.ICLOUD,
35
+ "protonmail.com": EMAIL_URLS.PROTON,
36
+ "proton.me": EMAIL_URLS.PROTON,
37
+ };
38
+ return domainMap[domain] || null;
39
+ }
40
+ export function SignupForm({ code, email, waitlist, }) {
41
+ const { t } = useTranslation();
42
+ const [status, setStatus] = useState("start");
43
+ const [userEmail, setUserEmail] = useState(email || "");
44
+ const { registerSession } = useSession();
45
+ const navigate = useNavigate();
46
+ const { register, handleSubmit, formState: { errors }, } = useForm();
47
+ const onSubmit = (data) => {
48
+ console.log(data);
49
+ setStatus("busy");
50
+ setUserEmail(data.email);
51
+ authClient.signUp
52
+ .email({
53
+ name: data.email,
54
+ email: data.email,
55
+ password: data.password,
56
+ }, {
57
+ headers: {
58
+ "Waitlist-Invitation-Code": code || "",
59
+ },
60
+ })
61
+ .then((result) => {
62
+ console.log(result);
63
+ if (result.error) {
64
+ toast.error(t("web-ui:auth.errors.invitationCodeInvalid"));
65
+ setStatus("start");
66
+ return;
67
+ }
68
+ if (waitlist) {
69
+ authClient.signIn
70
+ .email({
71
+ email: data.email,
72
+ password: data.password,
73
+ })
74
+ .then((res) => {
75
+ console.log(res);
76
+ if (res.data?.user) {
77
+ registerSession(() => {
78
+ navigate("/");
79
+ });
80
+ }
81
+ else if (res.error) {
82
+ toast.error(t("web-ui:auth.errors.authentication"), {
83
+ description: res.error.message,
84
+ });
85
+ }
86
+ })
87
+ .catch((error) => {
88
+ toast.error(t("web-ui:auth.errors.server"), {
89
+ description: error.message,
90
+ });
91
+ });
92
+ }
93
+ else
94
+ setStatus("done");
95
+ })
96
+ .catch((error) => {
97
+ toast.error(error.message);
98
+ setStatus("start");
99
+ });
100
+ };
101
+ if (status === "done") {
102
+ const emailProviderUrl = userEmail ? getEmailProviderUrl(userEmail) : null;
103
+ return (_jsx(Alert, { color: "primary", variant: "faded", title: t("web-ui:auth.signup.verificationEmailSent.title"), children: _jsxs("div", { className: "mt-2", children: [t("web-ui:auth.signup.verificationEmailSent.description"), emailProviderUrl && (_jsx("div", { className: "mt-3", children: _jsx("a", { href: emailProviderUrl, target: "_blank", rel: "noopener noreferrer", className: "font-medium underline underline-offset-4 hover:opacity-80 transition-opacity", children: t("web-ui:auth.signup.verificationEmailSent.openEmail") }) }))] }) }));
104
+ }
105
+ 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, isDisabled: !!email, defaultValue: email ?? "", ...register("email", { required: true }) }), errors.email && (_jsx("span", { className: "text-red-500 text-xs", children: t("web-ui:auth.signup.emailRequired") }))] }), _jsxs("div", { className: "grid gap-2", children: [_jsx(Input, { labelPlacement: "outside", label: t("web-ui:auth.login.password"), placeholder: t("web-ui:auth.login.password"), type: "password", variant: "bordered", isRequired: true, ...register("password", { required: true }) }), errors.password && (_jsx("span", { className: "text-red-500 text-xs", children: t("web-ui:auth.signup.passwordRequired") }))] }), _jsx(Button, { type: "submit", className: "w-full", color: "primary", isDisabled: status === "busy", children: status === "busy" ? t("web-ui:auth.signup.signingUp") : t("web-ui:auth.signup.button") })] }));
106
+ }
@@ -0,0 +1,8 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ interface SignupRouteProps {
3
+ providers?: string[];
4
+ useTRPC?: UseBackendTRPC;
5
+ }
6
+ export declare function SignupRoute({ providers, useTRPC }: SignupRouteProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=SignupRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignupRoute.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/SignupRoute.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAK7C,UAAU,gBAAgB;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B;AAED,wBAAgB,WAAW,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAqCnE"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, CardBody, CardHeader } from "@heroui/react";
3
+ import { useQueryState } from "nuqs";
4
+ import { useTranslation } from "react-i18next";
5
+ import { Link } from "react-router";
6
+ import { SignupForm } from "#modules/auth/components/SignupFormRoute";
7
+ import { AuthProviders } from "./AuthProviders";
8
+ import { WaitlistCard } from "./WaitlistCard";
9
+ import { WaitlistCodeValidation } from "./WaitlistCodeValidation";
10
+ export function SignupRoute({ providers, useTRPC }) {
11
+ const { t } = useTranslation();
12
+ const [code] = useQueryState("code");
13
+ const [email] = useQueryState("email");
14
+ const hasWaitlist = !!useTRPC;
15
+ return (_jsxs("div", { className: "flex flex-col gap-6", children: [hasWaitlist && !code ? (_jsx(WaitlistCard, { useTRPC: useTRPC })) : (_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.signup.createAccount") }), _jsx("p", { className: "text-sm text-default-600", children: t("web-ui:auth.signup.description") })] }), _jsx(CardBody, { children: _jsxs("div", { className: "grid gap-6", children: [hasWaitlist && code && useTRPC && (_jsx(WaitlistCodeValidation, { code: code, useTRPC: useTRPC })), _jsx(AuthProviders, { providers: providers, code: code, requestSignUp: true }), _jsx(SignupForm, { code: code, email: email, waitlist: hasWaitlist })] }) })] })), _jsxs("div", { className: "text-center text-xs text-muted-foreground", children: [t("web-ui:auth.signup.alreadyHaveAccount"), " ", _jsx(Link, { to: "/login", className: "underline underline-offset-4 hover:text-primary", children: t("web-ui:auth.login.button") })] })] }));
16
+ }
@@ -0,0 +1,31 @@
1
+ import type { ReactElement } from "react";
2
+ import type { z } from "zod";
3
+ type UpdatePreferencesOptions = {
4
+ noOptimisticUpdate?: boolean;
5
+ onSuccess?: () => void;
6
+ onError?: (error: unknown) => void;
7
+ };
8
+ interface ControlDefinition {
9
+ label: string;
10
+ element: "switch" | "select" | "number";
11
+ options?: {
12
+ label: string;
13
+ value: string;
14
+ }[];
15
+ min?: number;
16
+ max?: number;
17
+ step?: number;
18
+ }
19
+ type ControlsFor<Preferences> = {
20
+ [K in keyof Preferences]: ControlDefinition;
21
+ };
22
+ export declare function UserPreferences<S extends z.ZodObject<z.ZodRawShape>>({ schema, controls, preferences, isLoading, isPending, updatePreferences, }: {
23
+ schema: S;
24
+ controls: ControlsFor<z.infer<S>>;
25
+ preferences: z.infer<S>;
26
+ isLoading: boolean;
27
+ isPending: boolean;
28
+ updatePreferences: (partialPreferences: Partial<z.infer<S>>, options: UpdatePreferencesOptions) => void;
29
+ }): ReactElement;
30
+ export {};
31
+ //# sourceMappingURL=UserPreferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserPreferences.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/UserPreferences.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B,KAAK,wBAAwB,GAAG;IAC9B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC,CAAC;AAEF,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;IACxC,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,KAAK,WAAW,CAAC,WAAW,IAAI;KAC7B,CAAC,IAAI,MAAM,WAAW,GAAG,iBAAiB;CAC5C,CAAC;AAEF,wBAAgB,eAAe,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,EACpE,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,SAAS,EACT,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAClC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CACjB,kBAAkB,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACvC,OAAO,EAAE,wBAAwB,KAC9B,IAAI,CAAC;CACX,GAAG,YAAY,CAqGf"}
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Form, Input, Select, SelectItem, Switch } from "@heroui/react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { toast } from "sonner";
5
+ export function UserPreferences({ schema, controls, preferences, isLoading, isPending, updatePreferences, }) {
6
+ const { t } = useTranslation("web-ui");
7
+ function handleSubmit(event) {
8
+ event.preventDefault();
9
+ const formData = new FormData(event.currentTarget);
10
+ const keys = Object.keys(controls);
11
+ const raw = {};
12
+ for (const key of keys) {
13
+ const control = controls[key];
14
+ if (control.element === "switch") {
15
+ raw[String(key)] = formData.get(String(key)) != null;
16
+ }
17
+ if (control.element === "select") {
18
+ raw[String(key)] = formData.get(String(key));
19
+ }
20
+ if (control.element === "number") {
21
+ const value = formData.get(String(key));
22
+ raw[String(key)] = value == null || value === "" ? undefined : Number(value);
23
+ }
24
+ }
25
+ const result = schema.safeParse(raw);
26
+ if (result.success) {
27
+ updatePreferences(result.data, {
28
+ noOptimisticUpdate: true,
29
+ onSuccess: () => {
30
+ toast.success("Preferences updated");
31
+ },
32
+ onError: () => {
33
+ toast.error("Failed to update preferences");
34
+ },
35
+ });
36
+ }
37
+ else {
38
+ // eslint-disable-next-line no-console
39
+ console.error(result.error);
40
+ }
41
+ }
42
+ const keys = Object.keys(controls);
43
+ if (isLoading) {
44
+ // FIXME: Add a loading state
45
+ return _jsx("div", { children: "Loading..." });
46
+ }
47
+ return (_jsxs(Form, { onSubmit: handleSubmit, className: "p-6 flex flex-col gap-4", children: [_jsx("h1", { className: "text-2xl font-bold", children: t("web-ui:preferences.title") }), keys.map((key) => {
48
+ const control = controls[key];
49
+ switch (control.element) {
50
+ case "switch":
51
+ return (_jsx(Switch, { name: String(key), value: "on", defaultSelected: Boolean(preferences[key]), children: control.label }, String(key)));
52
+ case "select":
53
+ return (_jsx(Select, { name: String(key), label: control.label, labelPlacement: "outside-top", defaultSelectedKeys: [String(preferences[key])], children: (control.options ?? []).map((option) => (_jsx(SelectItem, { children: option.label }, option.value))) }, String(key)));
54
+ case "number":
55
+ return (_jsx(Input, { name: String(key), type: "number", label: control.label, labelPlacement: "outside-top", defaultValue: String(preferences[key] ?? ""), min: control.min, max: control.max, step: control.step }, String(key)));
56
+ default:
57
+ return _jsx("div", { children: "Invalid control" }, String(key));
58
+ }
59
+ }), _jsx(Button, { type: "submit", color: "success", isLoading: isPending, children: t("web-ui:preferences.submit") })] }));
60
+ }
@@ -0,0 +1,7 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ interface WaitlistCardProps {
3
+ useTRPC: UseBackendTRPC;
4
+ }
5
+ export declare function WaitlistCard({ useTRPC }: WaitlistCardProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
7
+ //# sourceMappingURL=WaitlistCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WaitlistCard.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/WaitlistCard.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,UAAU,iBAAiB;IACzB,OAAO,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,2CAkE1D"}
@@ -0,0 +1,32 @@
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 { useMutation } from "@tanstack/react-query";
4
+ import { useState } from "react";
5
+ import { useTranslation } from "react-i18next";
6
+ import { toast } from "sonner";
7
+ export function WaitlistCard({ useTRPC }) {
8
+ const { t } = useTranslation();
9
+ const trpc = useTRPC();
10
+ const [email, setEmail] = useState("");
11
+ const [joined, setJoined] = useState(false);
12
+ const { mutate } = useMutation(trpc.auth.joinWaitlist.mutationOptions());
13
+ const handleSubmit = (e) => {
14
+ e.preventDefault();
15
+ mutate({ email }, {
16
+ onSuccess: () => {
17
+ setJoined(true);
18
+ },
19
+ onError: (error) => {
20
+ toast.error(error instanceof Error
21
+ ? error.message
22
+ : t("web-ui:auth.waitlist.error", {
23
+ defaultValue: "Failed to join waitlist. Please try again.",
24
+ }));
25
+ },
26
+ });
27
+ };
28
+ if (joined) {
29
+ return (_jsx(Card, { children: _jsx(CardBody, { className: "pt-6", children: _jsx(Alert, { color: "success", variant: "faded", title: t("web-ui:auth.waitlist.success") }) }) }));
30
+ }
31
+ return (_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.waitlist.title") }), _jsx("p", { className: "text-sm text-default-600", children: t("web-ui:auth.waitlist.description") })] }), _jsx(CardBody, { children: _jsxs("form", { onSubmit: handleSubmit, className: "grid gap-6", children: [_jsx("div", { className: "grid gap-2", children: _jsx(Input, { type: "email", label: t("web-ui:auth.waitlist.email"), labelPlacement: "outside", placeholder: t("web-ui:auth.waitlist.placeholder.email"), isRequired: true, variant: "bordered", value: email, onChange: (e) => setEmail(e.target.value) }) }), _jsx(Button, { type: "submit", color: "primary", children: t("web-ui:auth.waitlist.button") })] }) })] }));
32
+ }
@@ -0,0 +1,8 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ interface WaitlistCodeValidationProps {
3
+ useTRPC: UseBackendTRPC;
4
+ code: string;
5
+ }
6
+ export declare function WaitlistCodeValidation({ useTRPC, code }: WaitlistCodeValidationProps): import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
8
+ //# sourceMappingURL=WaitlistCodeValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WaitlistCodeValidation.d.ts","sourceRoot":"","sources":["../../../../../src/modules/auth/components/WaitlistCodeValidation.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,UAAU,2BAA2B;IACnC,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,2BAA2B,kDAoEpF"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Alert } from "@heroui/react";
3
+ import { useQuery } from "@tanstack/react-query";
4
+ import { useTranslation } from "react-i18next";
5
+ export function WaitlistCodeValidation({ useTRPC, code }) {
6
+ const { t } = useTranslation();
7
+ const trpc = useTRPC();
8
+ const { data, isLoading, error } = useQuery(trpc.auth.validateWaitlistCode.queryOptions({ code }));
9
+ const status = data?.status;
10
+ const className = "p-1";
11
+ if (isLoading) {
12
+ return (_jsx(Alert, { className: className, color: "default", variant: "faded", title: t("web-ui:auth.waitlist.validatingCode", {
13
+ defaultValue: "Validating the invitation code...",
14
+ }) }));
15
+ }
16
+ if (error) {
17
+ return (_jsx(Alert, { className: className, color: "danger", variant: "faded", title: t("web-ui:auth.waitlist.codeError", {
18
+ defaultValue: "An error occurred while validating the invitation code.",
19
+ }) }));
20
+ }
21
+ if (status === "VALID") {
22
+ return (_jsx(Alert, { className: className, color: "success", variant: "faded", title: t("web-ui:auth.waitlist.codeValid", {
23
+ defaultValue: "Invitation code is valid. You can proceed.",
24
+ }) }));
25
+ }
26
+ if (status) {
27
+ let message = t("web-ui:auth.waitlist.invalidCode", {
28
+ defaultValue: "Invalid invitation code.",
29
+ });
30
+ if (status === "EXPIRED") {
31
+ message = t("web-ui:auth.waitlist.expiredCode", {
32
+ defaultValue: "Invitation code has expired.",
33
+ });
34
+ }
35
+ else if (status === "NOT_FOUND") {
36
+ message = t("web-ui:auth.waitlist.codeNotFound", {
37
+ defaultValue: "Invitation code not found.",
38
+ });
39
+ }
40
+ return _jsx(Alert, { className: className, color: "danger", variant: "faded", title: message });
41
+ }
42
+ return null;
43
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from "react";
2
+ interface BillingBetaPageProps {
3
+ appName: string;
4
+ className?: string;
5
+ footer?: ReactNode;
6
+ }
7
+ export declare function BillingBetaPage({ appName, className, footer }: BillingBetaPageProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=BillingBetaPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingBetaPage.d.ts","sourceRoot":"","sources":["../../../../../src/modules/billing/components/BillingBetaPage.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,UAAU,oBAAoB;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAED,wBAAgB,eAAe,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,oBAAoB,2CA6GnF"}
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Bell, CheckCircle2, Clock3, Sparkles } from "lucide-react";
3
+ import { useTranslation } from "react-i18next";
4
+ import { Badge } from "#components/ui/badge";
5
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "#components/ui/card";
6
+ import { Separator } from "#components/ui/separator";
7
+ import { cn } from "#utils";
8
+ export function BillingBetaPage({ appName, className, footer }) {
9
+ const { t } = useTranslation("web-ui");
10
+ return (_jsxs("div", { className: cn("mx-auto max-w-5xl px-4 py-12 md:py-16", className), children: [_jsxs("div", { className: "flex flex-col items-center text-center gap-4", children: [_jsx(Badge, { variant: "secondary", className: "uppercase tracking-wide", children: t("billing.beta.badge") }), _jsxs("div", { className: "space-y-3", children: [_jsx("h1", { className: "text-3xl md:text-4xl font-semibold tracking-tight", children: t("billing.title") }), _jsx("p", { className: "text-muted-foreground max-w-2xl", children: t("billing.subtitle", { appName }) })] })] }), _jsx(Separator, { className: "my-8" }), _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4 md:gap-6", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-green-600 dark:text-green-500", children: [_jsx(Sparkles, { className: "h-5 w-5 shrink-0" }), _jsx(CardTitle, { children: t("billing.card.free.title") })] }), _jsx(CardDescription, { children: t("billing.card.free.description") })] }), _jsxs(CardContent, { children: [_jsxs("div", { className: "flex items-baseline gap-2", children: [_jsx("span", { className: "text-4xl font-bold tracking-tight", children: t("billing.card.free.price") }), _jsx("span", { className: "text-muted-foreground", children: t("billing.card.free.priceSuffix") })] }), _jsxs("ul", { className: "mt-4 space-y-2 text-sm", children: [_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-green-600" }), " ", t("billing.card.free.feature.fullAccess")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-green-600" }), " ", t("billing.card.free.feature.noCard")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-green-600" }), " ", t("billing.card.free.feature.riskFree")] })] })] })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-blue-600 dark:text-blue-500", children: [_jsx(Clock3, { className: "h-5 w-5 shrink-0" }), _jsx(CardTitle, { children: t("billing.card.progress.title") })] }), _jsx(CardDescription, { children: t("billing.card.progress.description") })] }), _jsx(CardContent, { children: _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-blue-600" }), " ", t("billing.card.progress.feature.transparentPlans")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-blue-600" }), " ", t("billing.card.progress.feature.fairValue")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-blue-600" }), " ", t("billing.card.progress.feature.simpleBilling")] })] }) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2 text-amber-600 dark:text-amber-500", children: [_jsx(Bell, { className: "h-5 w-5 shrink-0" }), _jsx(CardTitle, { children: t("billing.card.notice.title") })] }), _jsx(CardDescription, { children: t("billing.card.notice.description") })] }), _jsx(CardContent, { children: _jsxs("ul", { className: "space-y-2 text-sm", children: [_jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-amber-600" }), " ", t("billing.card.notice.feature.timeToDecide")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-amber-600" }), " ", t("billing.card.notice.feature.safeData")] }), _jsxs("li", { className: "flex items-center gap-2", children: [_jsx(CheckCircle2, { className: "h-4 w-4 shrink-0 text-amber-600" }), " ", t("billing.card.notice.feature.autoFreeTier")] })] }) })] })] }), footer] }));
11
+ }
@@ -0,0 +1,8 @@
1
+ import type { UseBackendTRPC } from "#types";
2
+ interface BillingInvoicePageProps {
3
+ useTRPC: UseBackendTRPC;
4
+ serverUrl: string;
5
+ }
6
+ export declare function BillingInvoicePage({ useTRPC, serverUrl }: BillingInvoicePageProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=BillingInvoicePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingInvoicePage.d.ts","sourceRoot":"","sources":["../../../../../src/modules/billing/components/BillingInvoicePage.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,UAAU,uBAAuB;IAC/B,OAAO,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,kBAAkB,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,uBAAuB,2CAyJjF"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Card, CardBody, CardHeader, Chip, Link, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow, } from "@heroui/react";
3
+ import { useSubscription } from "@m5kdev/frontend/modules/billing/hooks/useSubscription";
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import { AlertCircle, CheckCircle2, ExternalLink } from "lucide-react";
6
+ export function BillingInvoicePage({ useTRPC, serverUrl }) {
7
+ const trpc = useTRPC();
8
+ const { data: invoices, isLoading } = useQuery(trpc.billing.listInvoices.queryOptions());
9
+ const { data: activeSubscription, isLoading: isLoadingSubscriptions } = useSubscription();
10
+ const formatCurrency = (amount, currency) => {
11
+ return new Intl.NumberFormat("en-US", {
12
+ style: "currency",
13
+ currency: currency.toUpperCase(),
14
+ }).format(amount / 100);
15
+ };
16
+ const formatDate = (timestamp) => {
17
+ const date = timestamp instanceof Date ? timestamp : new Date(timestamp * 1000);
18
+ return date.toLocaleDateString(undefined, {
19
+ year: "numeric",
20
+ month: "long",
21
+ day: "numeric",
22
+ });
23
+ };
24
+ const cancelAt = activeSubscription?.cancelAt || activeSubscription?.cancelAtPeriodEnd;
25
+ return (_jsxs("div", { className: "container mx-auto p-10 space-y-8", children: [_jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-col items-start gap-1 px-6 pt-6", children: [_jsx("h1", { className: "text-xl font-bold", children: "Active Subscription" }), _jsx("p", { className: "text-small text-default-500", children: "Manage your active subscription." })] }), _jsx(CardBody, { className: "px-6 pb-6", children: isLoadingSubscriptions ? (_jsx("div", { className: "flex justify-center py-8", children: _jsx(Spinner, {}) })) : !activeSubscription ? (_jsxs("div", { className: "flex flex-col items-center justify-center py-8 text-center gap-4", children: [_jsx("div", { className: "p-4 rounded-full bg-default-100", children: _jsx(AlertCircle, { className: "w-8 h-8 text-default-500" }) }), _jsxs("div", { children: [_jsx("p", { className: "text-lg font-medium", children: "No active subscription" }), _jsx("p", { className: "text-small text-default-500", children: "You are currently on the free tier. Upgrade to access premium features." })] }), _jsx(Button, { as: Link, href: "/pricing", color: "primary", children: "View Plans" })] })) : (_jsx("div", { className: "space-y-6", children: _jsxs("div", { className: "flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 p-4 rounded-lg bg-default-50 border border-default-200", children: [_jsxs("div", { className: "space-y-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h3", { className: "text-lg font-semibold capitalize", children: activeSubscription.plan || "Premium Plan" }), _jsx(Chip, { color: cancelAt
26
+ ? "danger"
27
+ : activeSubscription.status === "active"
28
+ ? "success"
29
+ : "warning", variant: "flat", size: "sm", startContent: _jsx(CheckCircle2, { className: "w-3 h-3 ml-1" }), children: cancelAt ? "Cancelled" : activeSubscription.status })] }), _jsxs("p", { className: "text-small text-default-500 flex items-center gap-2", children: [cancelAt ? "Your subscription will end on " : "Next billing date: ", _jsx("span", { className: "font-medium text-foreground", children: activeSubscription.periodEnd
30
+ ? formatDate(activeSubscription.periodEnd)
31
+ : "N/A" }), _jsx("span", { className: "text-small text-default-500", children: `(${activeSubscription.interval === "month" ? "Monthly" : "Annually"})` })] })] }), _jsx("div", { className: "flex gap-3", children: _jsx(Button, { variant: "bordered", as: "a", href: `${serverUrl}/stripe/portal`, children: "Manage Subscription" }) })] }) })) })] }), _jsxs(Card, { children: [_jsxs(CardHeader, { className: "flex flex-col items-start gap-1 px-6 pt-6", children: [_jsx("h1", { className: "text-xl font-bold", children: "Invoices" }), _jsx("p", { className: "text-small text-default-500", children: "View your invoice history and download past invoices." })] }), _jsx(CardBody, { className: "px-6 pb-6", children: isLoading ? (_jsx("div", { className: "flex justify-center py-8", children: _jsx(Spinner, {}) })) : (_jsxs(Table, { "aria-label": "Invoices table", removeWrapper: true, children: [_jsxs(TableHeader, { children: [_jsx(TableColumn, { children: "Date" }), _jsx(TableColumn, { children: "Amount" }), _jsx(TableColumn, { children: "Status" }), _jsx(TableColumn, { align: "end", children: "Action" })] }), _jsx(TableBody, { emptyContent: "No invoices found.", children: (invoices || []).map((invoice) => (_jsxs(TableRow, { children: [_jsx(TableCell, { children: formatDate(invoice.created) }), _jsx(TableCell, { children: formatCurrency(invoice.total, invoice.currency) }), _jsx(TableCell, { children: _jsx(Chip, { color: invoice.status === "paid" ? "success" : "default", variant: "flat", size: "sm", children: invoice.status }) }), _jsx(TableCell, { className: "text-right", children: invoice.hosted_invoice_url && (_jsx(Button, { as: Link, href: invoice.hosted_invoice_url, target: "_blank", rel: "noopener noreferrer", variant: "light", size: "sm", endContent: _jsx(ExternalLink, { className: "h-4 w-4" }), children: "View" })) })] }, invoice.id))) })] })) })] })] }));
32
+ }
@@ -0,0 +1,7 @@
1
+ import type { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
2
+ interface BillingPlanSelectProps {
3
+ plans: StripePlan[];
4
+ }
5
+ export declare function BillingPlanSelect({ plans }: BillingPlanSelectProps): import("react/jsx-runtime").JSX.Element | "Multiple plans selection not implemented yet";
6
+ export {};
7
+ //# sourceMappingURL=BillingPlanSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingPlanSelect.d.ts","sourceRoot":"","sources":["../../../../../src/modules/billing/components/BillingPlanSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGhF,UAAU,sBAAsB;IAC9B,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE,sBAAsB,4FAMlE"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { BillingSinglePlanSelect } from "#modules/billing/components/BillingSinglePlanSelect";
3
+ export function BillingPlanSelect({ plans }) {
4
+ if (plans.length === 1) {
5
+ return _jsx(BillingSinglePlanSelect, { plan: plans[0] });
6
+ }
7
+ return "Multiple plans selection not implemented yet";
8
+ }
@@ -0,0 +1,10 @@
1
+ import type { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
2
+ import type { UseBackendTRPC } from "#types";
3
+ interface BillingRouterProps {
4
+ useTRPC?: UseBackendTRPC;
5
+ serverUrl: string;
6
+ plans: StripePlan[];
7
+ }
8
+ export declare function BillingRouter({ useTRPC, serverUrl }: BillingRouterProps): import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
10
+ //# sourceMappingURL=BillingRouter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingRouter.d.ts","sourceRoot":"","sources":["../../../../../src/modules/billing/components/BillingRouter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGhF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAE7C,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED,wBAAgB,aAAa,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,kDAQvE"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Route } from "react-router";
3
+ import { BillingInvoicePage } from "#modules/billing/components/BillingInvoicePage";
4
+ export function BillingRouter({ useTRPC, serverUrl }) {
5
+ if (!useTRPC)
6
+ return null;
7
+ return (_jsx(Route, { path: "billing", children: _jsx(Route, { index: true, element: _jsx(BillingInvoicePage, { useTRPC: useTRPC, serverUrl: serverUrl }) }) }));
8
+ }
@@ -0,0 +1,9 @@
1
+ import type { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
2
+ export interface BillingSinglePlanSelectProps {
3
+ plan: StripePlan;
4
+ features?: string[];
5
+ /** URL for the Terms of Service link. Override for your app's legal page. */
6
+ termsOfServiceUrl?: string;
7
+ }
8
+ export declare function BillingSinglePlanSelect({ plan, termsOfServiceUrl, features, }: BillingSinglePlanSelectProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=BillingSinglePlanSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingSinglePlanSelect.d.ts","sourceRoot":"","sources":["../../../../../src/modules/billing/components/BillingSinglePlanSelect.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAiBhF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,iBAAiB,EACjB,QAMC,GACF,EAAE,4BAA4B,2CAwI9B"}
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@heroui/react";
3
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
4
+ import { Check, LogOut } from "lucide-react";
5
+ import { useState } from "react";
6
+ import { useTranslation } from "react-i18next";
7
+ import { Link, useNavigate } from "react-router";
8
+ import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "#components/ui/card";
9
+ import { Tabs, TabsList, TabsTrigger } from "#components/ui/tabs";
10
+ import { cn } from "#utils";
11
+ export function BillingSinglePlanSelect({ plan, termsOfServiceUrl, features = [
12
+ "Unlimited access to all features",
13
+ "Priority support",
14
+ "Early access to new features",
15
+ "Secure data storage",
16
+ "Cancel anytime",
17
+ ], }) {
18
+ const { t } = useTranslation("web-ui");
19
+ const navigate = useNavigate();
20
+ const [billingInterval, setBillingInterval] = useState("annually");
21
+ const handleLogout = async () => {
22
+ await authClient.signOut();
23
+ navigate("/login");
24
+ };
25
+ const isAnnual = billingInterval === "annually";
26
+ const currentPriceId = isAnnual ? plan.annualDiscountPriceId : plan.priceId;
27
+ // Fallback if no annual price ID exists
28
+ const hasAnnualOption = !!plan.annualDiscountPriceId;
29
+ const priceUnitAmount = plan.priceUnitAmount ?? Number.NaN;
30
+ const annualPriceUnitAmount = plan.annualPriceUnitAmount ?? Number.NaN;
31
+ const priceDisplay = {
32
+ monthly: {
33
+ amount: `$${priceUnitAmount / 100}`,
34
+ label: "/ month",
35
+ },
36
+ annually: {
37
+ amount: `$${annualPriceUnitAmount / 100 / 12}`,
38
+ originalAmount: `$${priceUnitAmount / 100}`,
39
+ label: "/ month, billed annually",
40
+ discountLabel: plan.annualPriceUnitAmount
41
+ ? `Save ${Math.floor(((priceUnitAmount - annualPriceUnitAmount / 12) / priceUnitAmount) * 100).toFixed(0)}%`
42
+ : "",
43
+ },
44
+ };
45
+ return (_jsxs("div", { className: "w-full max-w-3xl mx-auto px-4 py-8", children: [_jsxs("div", { className: "flex flex-col items-center gap-8", children: [_jsxs("div", { className: "text-center space-y-2", children: [_jsx("h2", { className: "text-3xl font-bold tracking-tight sm:text-4xl", children: t("billing.plans.title", "Simple, transparent pricing") }), _jsx("p", { className: "text-muted-foreground text-lg", children: t("billing.plans.subtitle", "Choose the plan that's right for you") })] }), hasAnnualOption && (_jsx(Tabs, { defaultValue: "annually", value: billingInterval, onValueChange: (v) => setBillingInterval(v), className: "w-full max-w-xs", children: _jsxs(TabsList, { className: "grid w-full grid-cols-2", children: [_jsx(TabsTrigger, { value: "monthly", children: "Monthly" }), _jsxs(TabsTrigger, { value: "annually", className: "relative", children: ["Annually", priceDisplay.annually.discountLabel && (_jsx("span", { className: "absolute -top-3 -right-3 px-1.5 py-0.5 rounded-full bg-green-500 text-[10px] text-white font-medium transform rotate-12", children: priceDisplay.annually.discountLabel }))] })] }) })), _jsxs(Card, { className: cn("w-full max-w-md border-2 border-primary"), children: [_jsxs(CardHeader, { children: [_jsx(CardTitle, { className: "flex justify-between items-start", children: _jsx("span", { className: "text-xl font-bold", children: plan.name }) }), _jsx(CardDescription, { children: isAnnual ? "Perfect for long-term commitment" : "Flexible monthly billing" })] }), _jsxs(CardContent, { className: "space-y-6", children: [_jsxs("div", { className: "flex items-baseline gap-1", children: [_jsx("span", { className: "text-4xl font-bold", children: isAnnual ? priceDisplay.annually.amount : priceDisplay.monthly.amount }), _jsx("span", { className: "text-muted-foreground", children: isAnnual ? priceDisplay.annually.label : priceDisplay.monthly.label })] }), isAnnual && priceDisplay.annually.originalAmount && (_jsxs("p", { className: "text-sm text-green-500 line-through", children: [" ", priceDisplay.annually.originalAmount, " / month"] })), _jsx("div", { className: "space-y-3", children: features.map((feature) => (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center shrink-0", children: _jsx(Check, { className: "h-3 w-3 text-primary" }) }), _jsx("span", { className: "text-sm text-muted-foreground", children: feature })] }, feature))) })] }), _jsx(CardFooter, { children: _jsx(Button, { className: "w-full", color: "primary", size: "lg", as: "a", href: `${import.meta.env.VITE_SERVER_URL}/stripe/checkout/${currentPriceId}`, children: isAnnual ? "Subscribe Annually" : "Subscribe Monthly" }) })] }), _jsxs("div", { className: "text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary", children: [_jsx("a", { href: termsOfServiceUrl, rel: "noopener noreferrer", target: "_blank", children: t("common.termsOfService", "Terms of Service") }), " ", t("common.and", "and"), " ", _jsx(Link, { to: "/privacy", children: t("common.privacyPolicy", "Privacy Policy") })] })] }), _jsx("div", { className: "fixed bottom-4 left-4", children: _jsxs(Button, { variant: "light", onPress: handleLogout, className: "gap-2", children: [_jsx(LogOut, { className: "h-4 w-4" }), t("sidebar.user.logout", "Log out")] }) })] }));
46
+ }
@@ -0,0 +1,11 @@
1
+ import type { ColumnOrderState, VisibilityState } from "@tanstack/react-table";
2
+ import type { ColumnItem } from "./table.types";
3
+ interface ColumnOrderAndVisibilityProps {
4
+ layout: ColumnItem[];
5
+ onChangeOrder: (order: ColumnOrderState) => void;
6
+ onChangeVisibility: (visibility: VisibilityState) => void;
7
+ onClose: () => void;
8
+ }
9
+ export declare const ColumnOrderAndVisibility: ({ layout, onChangeOrder, onChangeVisibility, onClose, }: ColumnOrderAndVisibilityProps) => import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=ColumnOrderAndVisibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColumnOrderAndVisibility.d.ts","sourceRoot":"","sources":["../../../../../src/modules/table/components/ColumnOrderAndVisibility.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAyChD,UAAU,6BAA6B;IACrC,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,aAAa,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACjD,kBAAkB,EAAE,CAAC,UAAU,EAAE,eAAe,KAAK,IAAI,CAAC;IAC1D,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,eAAO,MAAM,wBAAwB,GAAI,yDAKtC,6BAA6B,4CA2D/B,CAAC"}
@@ -0,0 +1,42 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DndContext, KeyboardSensor, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
3
+ import { arrayMove, SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy, } from "@dnd-kit/sortable";
4
+ import { CSS } from "@dnd-kit/utilities";
5
+ import { EyeIcon, EyeOffIcon, GripVertical } from "lucide-react";
6
+ import { useCallback, useState } from "react";
7
+ import { Button } from "#components/ui/button";
8
+ const ColumnOrderAndVisibilityItem = ({ column, onChangeVisibilityState, }) => {
9
+ const { attributes, listeners, setNodeRef, transform, transition } = useSortable({
10
+ id: column.id,
11
+ });
12
+ return (_jsxs("div", { ref: setNodeRef, style: { transform: CSS.Transform.toString(transform), transition }, className: "flex justify-between items-center gap-2", children: [column.label, _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { ...attributes, ...listeners, className: "cursor-grab active:cursor-grabbing touch-none", children: _jsx(GripVertical, { className: "h-4 w-4" }) }), _jsx(Button, { variant: "ghost", size: "icon", onClick: () => onChangeVisibilityState(String(column.id)), children: column.visibility ? _jsx(EyeIcon, { className: "h-4 w-4" }) : _jsx(EyeOffIcon, { className: "h-4 w-4" }) })] })] }));
13
+ };
14
+ export const ColumnOrderAndVisibility = ({ layout, onChangeOrder, onChangeVisibility, onClose, }) => {
15
+ const [activeLayout, setActiveLayout] = useState([...layout]);
16
+ const onChangeVisibilityState = useCallback((columnId) => {
17
+ setActiveLayout((prev) => {
18
+ const index = prev.findIndex((c) => c.id === columnId);
19
+ if (index !== -1) {
20
+ const newLayout = [...prev];
21
+ newLayout[index] = { ...prev[index], visibility: !prev[index].visibility };
22
+ return newLayout;
23
+ }
24
+ return prev;
25
+ });
26
+ }, []);
27
+ const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
28
+ coordinateGetter: sortableKeyboardCoordinates,
29
+ }));
30
+ const onSubmit = useCallback(() => {
31
+ onChangeOrder(activeLayout.map((column) => column.id));
32
+ onChangeVisibility(Object.fromEntries(activeLayout.map((column) => [column.id, column.visibility])));
33
+ onClose();
34
+ }, [activeLayout, onChangeOrder, onChangeVisibility, onClose]);
35
+ return (_jsxs("div", { className: "flex flex-col gap-2 p-1 min-w-[200px]", children: [_jsx(DndContext, { onDragEnd: ({ active, over }) => {
36
+ if (over && active.id !== over?.id) {
37
+ const activeIndex = activeLayout.findIndex(({ id }) => id === active.id);
38
+ const overIndex = activeLayout.findIndex(({ id }) => id === over.id);
39
+ setActiveLayout(arrayMove(activeLayout, activeIndex, overIndex));
40
+ }
41
+ }, sensors: sensors, children: _jsx(SortableContext, { items: activeLayout.map((column) => column.id), strategy: verticalListSortingStrategy, children: activeLayout.map((column) => (_jsx(ColumnOrderAndVisibilityItem, { column: column, onChangeVisibilityState: onChangeVisibilityState }, column.id))) }) }), _jsx(Button, { onClick: onSubmit, children: "Apply" })] }));
42
+ };