@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
@@ -1,32 +1,162 @@
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";
1
+ import { Button, Card, CardBody, CardHeader, Chip, Link, Spinner, Table, TableBody, TableCell, TableColumn, TableHeader, TableRow } from "@heroui/react";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
5
3
  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))) })] })) })] })] }));
4
+ import { useQuery } from "@tanstack/react-query";
5
+ import { useSubscription } from "@m5kdev/frontend/modules/billing/hooks/useSubscription";
6
+ //#region src/modules/billing/components/BillingInvoicePage.tsx
7
+ function BillingInvoicePage({ useTRPC, serverUrl }) {
8
+ const { data: invoices, isLoading } = useQuery(useTRPC().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
+ return (timestamp instanceof Date ? timestamp : /* @__PURE__ */ new Date(timestamp * 1e3)).toLocaleDateString(void 0, {
18
+ year: "numeric",
19
+ month: "long",
20
+ day: "numeric"
21
+ });
22
+ };
23
+ const cancelAt = activeSubscription?.cancelAt || activeSubscription?.cancelAtPeriodEnd;
24
+ return /* @__PURE__ */ jsxs("div", {
25
+ className: "container mx-auto p-10 space-y-8",
26
+ children: [/* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
27
+ className: "flex flex-col items-start gap-1 px-6 pt-6",
28
+ children: [/* @__PURE__ */ jsx("h1", {
29
+ className: "text-xl font-bold",
30
+ children: "Active Subscription"
31
+ }), /* @__PURE__ */ jsx("p", {
32
+ className: "text-small text-default-500",
33
+ children: "Manage your active subscription."
34
+ })]
35
+ }), /* @__PURE__ */ jsx(CardBody, {
36
+ className: "px-6 pb-6",
37
+ children: isLoadingSubscriptions ? /* @__PURE__ */ jsx("div", {
38
+ className: "flex justify-center py-8",
39
+ children: /* @__PURE__ */ jsx(Spinner, {})
40
+ }) : !activeSubscription ? /* @__PURE__ */ jsxs("div", {
41
+ className: "flex flex-col items-center justify-center py-8 text-center gap-4",
42
+ children: [
43
+ /* @__PURE__ */ jsx("div", {
44
+ className: "p-4 rounded-full bg-default-100",
45
+ children: /* @__PURE__ */ jsx(AlertCircle, { className: "w-8 h-8 text-default-500" })
46
+ }),
47
+ /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
48
+ className: "text-lg font-medium",
49
+ children: "No active subscription"
50
+ }), /* @__PURE__ */ jsx("p", {
51
+ className: "text-small text-default-500",
52
+ children: "You are currently on the free tier. Upgrade to access premium features."
53
+ })] }),
54
+ /* @__PURE__ */ jsx(Button, {
55
+ as: Link,
56
+ href: "/pricing",
57
+ color: "primary",
58
+ children: "View Plans"
59
+ })
60
+ ]
61
+ }) : /* @__PURE__ */ jsx("div", {
62
+ className: "space-y-6",
63
+ children: /* @__PURE__ */ jsxs("div", {
64
+ 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",
65
+ children: [/* @__PURE__ */ jsxs("div", {
66
+ className: "space-y-1",
67
+ children: [/* @__PURE__ */ jsxs("div", {
68
+ className: "flex items-center gap-2",
69
+ children: [/* @__PURE__ */ jsx("h3", {
70
+ className: "text-lg font-semibold capitalize",
71
+ children: activeSubscription.plan || "Premium Plan"
72
+ }), /* @__PURE__ */ jsx(Chip, {
73
+ color: cancelAt ? "danger" : activeSubscription.status === "active" ? "success" : "warning",
74
+ variant: "flat",
75
+ size: "sm",
76
+ startContent: /* @__PURE__ */ jsx(CheckCircle2, { className: "w-3 h-3 ml-1" }),
77
+ children: cancelAt ? "Cancelled" : activeSubscription.status
78
+ })]
79
+ }), /* @__PURE__ */ jsxs("p", {
80
+ className: "text-small text-default-500 flex items-center gap-2",
81
+ children: [
82
+ cancelAt ? "Your subscription will end on " : "Next billing date: ",
83
+ /* @__PURE__ */ jsx("span", {
84
+ className: "font-medium text-foreground",
85
+ children: activeSubscription.periodEnd ? formatDate(activeSubscription.periodEnd) : "N/A"
86
+ }),
87
+ /* @__PURE__ */ jsx("span", {
88
+ className: "text-small text-default-500",
89
+ children: `(${activeSubscription.interval === "month" ? "Monthly" : "Annually"})`
90
+ })
91
+ ]
92
+ })]
93
+ }), /* @__PURE__ */ jsx("div", {
94
+ className: "flex gap-3",
95
+ children: /* @__PURE__ */ jsx(Button, {
96
+ variant: "bordered",
97
+ as: "a",
98
+ href: `${serverUrl}/stripe/portal`,
99
+ children: "Manage Subscription"
100
+ })
101
+ })]
102
+ })
103
+ })
104
+ })] }), /* @__PURE__ */ jsxs(Card, { children: [/* @__PURE__ */ jsxs(CardHeader, {
105
+ className: "flex flex-col items-start gap-1 px-6 pt-6",
106
+ children: [/* @__PURE__ */ jsx("h1", {
107
+ className: "text-xl font-bold",
108
+ children: "Invoices"
109
+ }), /* @__PURE__ */ jsx("p", {
110
+ className: "text-small text-default-500",
111
+ children: "View your invoice history and download past invoices."
112
+ })]
113
+ }), /* @__PURE__ */ jsx(CardBody, {
114
+ className: "px-6 pb-6",
115
+ children: isLoading ? /* @__PURE__ */ jsx("div", {
116
+ className: "flex justify-center py-8",
117
+ children: /* @__PURE__ */ jsx(Spinner, {})
118
+ }) : /* @__PURE__ */ jsxs(Table, {
119
+ "aria-label": "Invoices table",
120
+ removeWrapper: true,
121
+ children: [/* @__PURE__ */ jsxs(TableHeader, { children: [
122
+ /* @__PURE__ */ jsx(TableColumn, { children: "Date" }),
123
+ /* @__PURE__ */ jsx(TableColumn, { children: "Amount" }),
124
+ /* @__PURE__ */ jsx(TableColumn, { children: "Status" }),
125
+ /* @__PURE__ */ jsx(TableColumn, {
126
+ align: "end",
127
+ children: "Action"
128
+ })
129
+ ] }), /* @__PURE__ */ jsx(TableBody, {
130
+ emptyContent: "No invoices found.",
131
+ children: (invoices || []).map((invoice) => /* @__PURE__ */ jsxs(TableRow, { children: [
132
+ /* @__PURE__ */ jsx(TableCell, { children: formatDate(invoice.created) }),
133
+ /* @__PURE__ */ jsx(TableCell, { children: formatCurrency(invoice.total, invoice.currency) }),
134
+ /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Chip, {
135
+ color: invoice.status === "paid" ? "success" : "default",
136
+ variant: "flat",
137
+ size: "sm",
138
+ children: invoice.status
139
+ }) }),
140
+ /* @__PURE__ */ jsx(TableCell, {
141
+ className: "text-right",
142
+ children: invoice.hosted_invoice_url && /* @__PURE__ */ jsx(Button, {
143
+ as: Link,
144
+ href: invoice.hosted_invoice_url,
145
+ target: "_blank",
146
+ rel: "noopener noreferrer",
147
+ variant: "light",
148
+ size: "sm",
149
+ endContent: /* @__PURE__ */ jsx(ExternalLink, { className: "h-4 w-4" }),
150
+ children: "View"
151
+ })
152
+ })
153
+ ] }, invoice.id))
154
+ })]
155
+ })
156
+ })] })]
157
+ });
32
158
  }
159
+ //#endregion
160
+ export { BillingInvoicePage };
161
+
162
+ //# sourceMappingURL=BillingInvoicePage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingInvoicePage.js","names":[],"sources":["../../../../../src/modules/billing/components/BillingInvoicePage.tsx"],"sourcesContent":["import {\r\n Button,\r\n Card,\r\n CardBody,\r\n CardHeader,\r\n Chip,\r\n Link,\r\n Spinner,\r\n Table,\r\n TableBody,\r\n TableCell,\r\n TableColumn,\r\n TableHeader,\r\n TableRow,\r\n} from \"@heroui/react\";\r\nimport { useSubscription } from \"@m5kdev/frontend/modules/billing/hooks/useSubscription\";\r\nimport { useQuery } from \"@tanstack/react-query\";\r\nimport { AlertCircle, CheckCircle2, ExternalLink } from \"lucide-react\";\r\n\r\nimport type { UseBackendTRPC } from \"../../../types\";\r\n\r\ninterface BillingInvoicePageProps {\r\n useTRPC: UseBackendTRPC;\r\n serverUrl: string;\r\n}\r\n\r\nexport function BillingInvoicePage({ useTRPC, serverUrl }: BillingInvoicePageProps) {\r\n const trpc = useTRPC();\r\n const { data: invoices, isLoading } = useQuery(trpc.billing.listInvoices.queryOptions());\r\n\r\n const { data: activeSubscription, isLoading: isLoadingSubscriptions } = useSubscription();\r\n const formatCurrency = (amount: number, currency: string) => {\r\n return new Intl.NumberFormat(\"en-US\", {\r\n style: \"currency\",\r\n currency: currency.toUpperCase(),\r\n }).format(amount / 100);\r\n };\r\n\r\n const formatDate = (timestamp: number | Date) => {\r\n const date = timestamp instanceof Date ? timestamp : new Date(timestamp * 1000);\r\n return date.toLocaleDateString(undefined, {\r\n year: \"numeric\",\r\n month: \"long\",\r\n day: \"numeric\",\r\n });\r\n };\r\n\r\n const cancelAt = activeSubscription?.cancelAt || activeSubscription?.cancelAtPeriodEnd;\r\n return (\r\n <div className=\"container mx-auto p-10 space-y-8\">\r\n <Card>\r\n <CardHeader className=\"flex flex-col items-start gap-1 px-6 pt-6\">\r\n <h1 className=\"text-xl font-bold\">Active Subscription</h1>\r\n <p className=\"text-small text-default-500\">Manage your active subscription.</p>\r\n </CardHeader>\r\n <CardBody className=\"px-6 pb-6\">\r\n {isLoadingSubscriptions ? (\r\n <div className=\"flex justify-center py-8\">\r\n <Spinner />\r\n </div>\r\n ) : !activeSubscription ? (\r\n <div className=\"flex flex-col items-center justify-center py-8 text-center gap-4\">\r\n <div className=\"p-4 rounded-full bg-default-100\">\r\n <AlertCircle className=\"w-8 h-8 text-default-500\" />\r\n </div>\r\n <div>\r\n <p className=\"text-lg font-medium\">No active subscription</p>\r\n <p className=\"text-small text-default-500\">\r\n You are currently on the free tier. Upgrade to access premium features.\r\n </p>\r\n </div>\r\n <Button as={Link} href=\"/pricing\" color=\"primary\">\r\n View Plans\r\n </Button>\r\n </div>\r\n ) : (\r\n <div className=\"space-y-6\">\r\n <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\">\r\n <div className=\"space-y-1\">\r\n <div className=\"flex items-center gap-2\">\r\n <h3 className=\"text-lg font-semibold capitalize\">\r\n {activeSubscription.plan || \"Premium Plan\"}\r\n </h3>\r\n\r\n <Chip\r\n color={\r\n cancelAt\r\n ? \"danger\"\r\n : activeSubscription.status === \"active\"\r\n ? \"success\"\r\n : \"warning\"\r\n }\r\n variant=\"flat\"\r\n size=\"sm\"\r\n startContent={<CheckCircle2 className=\"w-3 h-3 ml-1\" />}\r\n >\r\n {cancelAt ? \"Cancelled\" : activeSubscription.status}\r\n </Chip>\r\n </div>\r\n <p className=\"text-small text-default-500 flex items-center gap-2\">\r\n {cancelAt ? \"Your subscription will end on \" : \"Next billing date: \"}\r\n <span className=\"font-medium text-foreground\">\r\n {activeSubscription.periodEnd\r\n ? formatDate(activeSubscription.periodEnd)\r\n : \"N/A\"}\r\n </span>\r\n <span className=\"text-small text-default-500\">\r\n {`(${activeSubscription.interval === \"month\" ? \"Monthly\" : \"Annually\"})`}\r\n </span>\r\n </p>\r\n </div>\r\n <div className=\"flex gap-3\">\r\n <Button variant=\"bordered\" as=\"a\" href={`${serverUrl}/stripe/portal`}>\r\n Manage Subscription\r\n </Button>\r\n </div>\r\n </div>\r\n </div>\r\n )}\r\n </CardBody>\r\n </Card>\r\n <Card>\r\n <CardHeader className=\"flex flex-col items-start gap-1 px-6 pt-6\">\r\n <h1 className=\"text-xl font-bold\">Invoices</h1>\r\n <p className=\"text-small text-default-500\">\r\n View your invoice history and download past invoices.\r\n </p>\r\n </CardHeader>\r\n <CardBody className=\"px-6 pb-6\">\r\n {isLoading ? (\r\n <div className=\"flex justify-center py-8\">\r\n <Spinner />\r\n </div>\r\n ) : (\r\n <Table aria-label=\"Invoices table\" removeWrapper>\r\n <TableHeader>\r\n <TableColumn>Date</TableColumn>\r\n <TableColumn>Amount</TableColumn>\r\n <TableColumn>Status</TableColumn>\r\n <TableColumn align=\"end\">Action</TableColumn>\r\n </TableHeader>\r\n <TableBody emptyContent=\"No invoices found.\">\r\n {(invoices || []).map((invoice) => (\r\n <TableRow key={invoice.id}>\r\n <TableCell>{formatDate(invoice.created)}</TableCell>\r\n <TableCell>{formatCurrency(invoice.total, invoice.currency)}</TableCell>\r\n <TableCell>\r\n <Chip\r\n color={invoice.status === \"paid\" ? \"success\" : \"default\"}\r\n variant=\"flat\"\r\n size=\"sm\"\r\n >\r\n {invoice.status}\r\n </Chip>\r\n </TableCell>\r\n <TableCell className=\"text-right\">\r\n {invoice.hosted_invoice_url && (\r\n <Button\r\n as={Link}\r\n href={invoice.hosted_invoice_url}\r\n target=\"_blank\"\r\n rel=\"noopener noreferrer\"\r\n variant=\"light\"\r\n size=\"sm\"\r\n endContent={<ExternalLink className=\"h-4 w-4\" />}\r\n >\r\n View\r\n </Button>\r\n )}\r\n </TableCell>\r\n </TableRow>\r\n ))}\r\n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AD,EAAA,UAAA;KACE,oBAAC,aAAD,EAAA,UAAa,QAAkB,CAAA;KAC/B,oBAAC,aAAD,EAAA,UAAa,UAAoB,CAAA;KACjC,oBAAC,aAAD,EAAA,UAAa,UAAoB,CAAA;KACjC,oBAAC,aAAD;MAAa,OAAM;gBAAM;MAAoB,CAAA;KACjC,EAAA,CAAA,EACd,oBAAC,WAAD;KAAW,cAAa;gBACpB,YAAY,EAAE,EAAE,KAAK,YACrB,qBAAC,UAAD,EAAA,UAAA;MACE,oBAAC,WAAD,EAAA,UAAY,WAAW,QAAQ,QAAQ,EAAa,CAAA;MACpD,oBAAC,WAAD,EAAA,UAAY,eAAe,QAAQ,OAAO,QAAQ,SAAS,EAAa,CAAA;MACxE,oBAAC,WAAD,EAAA,UACE,oBAAC,MAAD;OACE,OAAO,QAAQ,WAAW,SAAS,YAAY;OAC/C,SAAQ;OACR,MAAK;iBAEJ,QAAQ;OACJ,CAAA,EACG,CAAA;MACZ,oBAAC,WAAD;OAAW,WAAU;iBAClB,QAAQ,sBACP,oBAAC,QAAD;QACE,IAAI;QACJ,MAAM,QAAQ;QACd,QAAO;QACP,KAAI;QACJ,SAAQ;QACR,MAAK;QACL,YAAY,oBAAC,cAAD,EAAc,WAAU,WAAY,CAAA;kBACjD;QAEQ,CAAA;OAED,CAAA;MACH,EAAA,EA3BI,QAAQ,GA2BZ,CACX;KACQ,CAAA,CACN;;GAED,CAAA,CACN,EAAA,CAAA,CACH"}
@@ -1,6 +1,13 @@
1
- import type { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
3
+
4
+ //#region src/modules/billing/components/BillingPlanSelect.d.ts
2
5
  interface BillingPlanSelectProps {
3
- plans: StripePlan[];
6
+ plans: StripePlan[];
4
7
  }
5
- export declare function BillingPlanSelect({ plans }: BillingPlanSelectProps): import("react/jsx-runtime").JSX.Element | "Multiple plans selection not implemented yet";
6
- export {};
8
+ declare function BillingPlanSelect({
9
+ plans
10
+ }: BillingPlanSelectProps): _$react_jsx_runtime0.JSX.Element | "Multiple plans selection not implemented yet";
11
+ //#endregion
12
+ export { BillingPlanSelect };
13
+ //# sourceMappingURL=BillingPlanSelect.d.ts.map
@@ -1,8 +1,11 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { BillingSinglePlanSelect } from "./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";
1
+ import { BillingSinglePlanSelect } from "./BillingSinglePlanSelect.js";
2
+ import { jsx } from "react/jsx-runtime";
3
+ //#region src/modules/billing/components/BillingPlanSelect.tsx
4
+ function BillingPlanSelect({ plans }) {
5
+ if (plans.length === 1) return /* @__PURE__ */ jsx(BillingSinglePlanSelect, { plan: plans[0] });
6
+ return "Multiple plans selection not implemented yet";
8
7
  }
8
+ //#endregion
9
+ export { BillingPlanSelect };
10
+
11
+ //# sourceMappingURL=BillingPlanSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingPlanSelect.js","names":[],"sources":["../../../../../src/modules/billing/components/BillingPlanSelect.tsx"],"sourcesContent":["import type { StripePlan } from \"@m5kdev/commons/modules/billing/billing.types\";\r\nimport { BillingSinglePlanSelect } from \"./BillingSinglePlanSelect\";\r\n\r\ninterface BillingPlanSelectProps {\r\n plans: StripePlan[];\r\n}\r\n\r\nexport function BillingPlanSelect({ plans }: BillingPlanSelectProps) {\r\n if (plans.length === 1) {\r\n return <BillingSinglePlanSelect plan={plans[0]} />;\r\n }\r\n\r\n return \"Multiple plans selection not implemented yet\";\r\n}\r\n"],"mappings":";;;AAOA,SAAgB,kBAAkB,EAAE,SAAiC;AACnE,KAAI,MAAM,WAAW,EACnB,QAAO,oBAAC,yBAAD,EAAyB,MAAM,MAAM,IAAM,CAAA;AAGpD,QAAO"}
@@ -1,9 +1,17 @@
1
- import type { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
2
- import type { UseBackendTRPC } from "../../../types";
1
+ import { UseBackendTRPC } from "../../../types.js";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
+ import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
4
+
5
+ //#region src/modules/billing/components/BillingRouter.d.ts
3
6
  interface BillingRouterProps {
4
- useTRPC?: UseBackendTRPC;
5
- serverUrl: string;
6
- plans: StripePlan[];
7
+ useTRPC?: UseBackendTRPC;
8
+ serverUrl: string;
9
+ plans: StripePlan[];
7
10
  }
8
- export declare function BillingRouter({ useTRPC, serverUrl }: BillingRouterProps): import("react/jsx-runtime").JSX.Element | null;
9
- export {};
11
+ declare function BillingRouter({
12
+ useTRPC,
13
+ serverUrl
14
+ }: BillingRouterProps): _$react_jsx_runtime0.JSX.Element | null;
15
+ //#endregion
16
+ export { BillingRouter };
17
+ //# sourceMappingURL=BillingRouter.d.ts.map
@@ -1,8 +1,21 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { BillingInvoicePage } from "./BillingInvoicePage.js";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { Route } from "react-router";
3
- import { BillingInvoicePage } from "./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 }) }) }));
4
+ //#region src/modules/billing/components/BillingRouter.tsx
5
+ function BillingRouter({ useTRPC, serverUrl }) {
6
+ if (!useTRPC) return null;
7
+ return /* @__PURE__ */ jsx(Route, {
8
+ path: "billing",
9
+ children: /* @__PURE__ */ jsx(Route, {
10
+ index: true,
11
+ element: /* @__PURE__ */ jsx(BillingInvoicePage, {
12
+ useTRPC,
13
+ serverUrl
14
+ })
15
+ })
16
+ });
8
17
  }
18
+ //#endregion
19
+ export { BillingRouter };
20
+
21
+ //# sourceMappingURL=BillingRouter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingRouter.js","names":[],"sources":["../../../../../src/modules/billing/components/BillingRouter.tsx"],"sourcesContent":["import type { StripePlan } from \"@m5kdev/commons/modules/billing/billing.types\";\r\nimport { Route } from \"react-router\";\r\nimport { BillingInvoicePage } from \"./BillingInvoicePage\";\r\nimport type { UseBackendTRPC } from \"../../../types\";\r\n\r\ninterface BillingRouterProps {\r\n useTRPC?: UseBackendTRPC;\r\n serverUrl: string;\r\n plans: StripePlan[];\r\n}\r\n\r\nexport function BillingRouter({ useTRPC, serverUrl }: BillingRouterProps) {\r\n if (!useTRPC) return null;\r\n\r\n return (\r\n <Route path=\"billing\">\r\n <Route index element={<BillingInvoicePage useTRPC={useTRPC} serverUrl={serverUrl} />} />\r\n </Route>\r\n );\r\n}\r\n"],"mappings":";;;;AAWA,SAAgB,cAAc,EAAE,SAAS,aAAiC;AACxE,KAAI,CAAC,QAAS,QAAO;AAErB,QACE,oBAAC,OAAD;EAAO,MAAK;YACV,oBAAC,OAAD;GAAO,OAAA;GAAM,SAAS,oBAAC,oBAAD;IAA6B;IAAoB;IAAa,CAAA;GAAI,CAAA;EAClF,CAAA"}
@@ -1,8 +1,18 @@
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;
1
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
2
+ import { StripePlan } from "@m5kdev/commons/modules/billing/billing.types";
3
+
4
+ //#region src/modules/billing/components/BillingSinglePlanSelect.d.ts
5
+ interface BillingSinglePlanSelectProps {
6
+ plan: StripePlan;
7
+ features?: string[];
8
+ /** URL for the Terms of Service link. Override for your app's legal page. */
9
+ termsOfServiceUrl?: string;
7
10
  }
8
- export declare function BillingSinglePlanSelect({ plan, termsOfServiceUrl, features, }: BillingSinglePlanSelectProps): import("react/jsx-runtime").JSX.Element;
11
+ declare function BillingSinglePlanSelect({
12
+ plan,
13
+ termsOfServiceUrl,
14
+ features
15
+ }: BillingSinglePlanSelectProps): _$react_jsx_runtime0.JSX.Element;
16
+ //#endregion
17
+ export { BillingSinglePlanSelect, BillingSinglePlanSelectProps };
18
+ //# sourceMappingURL=BillingSinglePlanSelect.d.ts.map
@@ -1,46 +1,167 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { Card as Card$1, CardContent, CardDescription, CardFooter, CardHeader as CardHeader$1, CardTitle } from "../../../components/ui/card.js";
3
+ import { Tabs, TabsList, TabsTrigger } from "../../../components/ui/tabs.js";
4
+ import { useState } from "react";
2
5
  import { Button } from "@heroui/react";
3
- import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
4
7
  import { Check, LogOut } from "lucide-react";
5
- import { useState } from "react";
6
8
  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 "../../../lib/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")] }) })] }));
9
+ import { Link as Link$1, useNavigate } from "react-router";
10
+ import { authClient } from "@m5kdev/frontend/modules/auth/auth.lib";
11
+ //#region src/modules/billing/components/BillingSinglePlanSelect.tsx
12
+ function BillingSinglePlanSelect({ plan, termsOfServiceUrl, features = [
13
+ "Unlimited access to all features",
14
+ "Priority support",
15
+ "Early access to new features",
16
+ "Secure data storage",
17
+ "Cancel anytime"
18
+ ] }) {
19
+ const { t } = useTranslation("web-ui");
20
+ const navigate = useNavigate();
21
+ const [billingInterval, setBillingInterval] = useState("annually");
22
+ const handleLogout = async () => {
23
+ await authClient.signOut();
24
+ navigate("/login");
25
+ };
26
+ const isAnnual = billingInterval === "annually";
27
+ const currentPriceId = isAnnual ? plan.annualDiscountPriceId : plan.priceId;
28
+ const hasAnnualOption = !!plan.annualDiscountPriceId;
29
+ const priceUnitAmount = plan.priceUnitAmount ?? NaN;
30
+ const annualPriceUnitAmount = plan.annualPriceUnitAmount ?? 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 ? `Save ${Math.floor((priceUnitAmount - annualPriceUnitAmount / 12) / priceUnitAmount * 100).toFixed(0)}%` : ""
41
+ }
42
+ };
43
+ return /* @__PURE__ */ jsxs("div", {
44
+ className: "w-full max-w-3xl mx-auto px-4 py-8",
45
+ children: [/* @__PURE__ */ jsxs("div", {
46
+ className: "flex flex-col items-center gap-8",
47
+ children: [
48
+ /* @__PURE__ */ jsxs("div", {
49
+ className: "text-center space-y-2",
50
+ children: [/* @__PURE__ */ jsx("h2", {
51
+ className: "text-3xl font-bold tracking-tight sm:text-4xl",
52
+ children: t("billing.plans.title", "Simple, transparent pricing")
53
+ }), /* @__PURE__ */ jsx("p", {
54
+ className: "text-muted-foreground text-lg",
55
+ children: t("billing.plans.subtitle", "Choose the plan that's right for you")
56
+ })]
57
+ }),
58
+ hasAnnualOption && /* @__PURE__ */ jsx(Tabs, {
59
+ defaultValue: "annually",
60
+ value: billingInterval,
61
+ onValueChange: (v) => setBillingInterval(v),
62
+ className: "w-full max-w-xs",
63
+ children: /* @__PURE__ */ jsxs(TabsList, {
64
+ className: "grid w-full grid-cols-2",
65
+ children: [/* @__PURE__ */ jsx(TabsTrigger, {
66
+ value: "monthly",
67
+ children: "Monthly"
68
+ }), /* @__PURE__ */ jsxs(TabsTrigger, {
69
+ value: "annually",
70
+ className: "relative",
71
+ children: ["Annually", priceDisplay.annually.discountLabel && /* @__PURE__ */ jsx("span", {
72
+ 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",
73
+ children: priceDisplay.annually.discountLabel
74
+ })]
75
+ })]
76
+ })
77
+ }),
78
+ /* @__PURE__ */ jsxs(Card$1, {
79
+ className: cn("w-full max-w-md border-2 border-primary"),
80
+ children: [
81
+ /* @__PURE__ */ jsxs(CardHeader$1, { children: [/* @__PURE__ */ jsx(CardTitle, {
82
+ className: "flex justify-between items-start",
83
+ children: /* @__PURE__ */ jsx("span", {
84
+ className: "text-xl font-bold",
85
+ children: plan.name
86
+ })
87
+ }), /* @__PURE__ */ jsx(CardDescription, { children: isAnnual ? "Perfect for long-term commitment" : "Flexible monthly billing" })] }),
88
+ /* @__PURE__ */ jsxs(CardContent, {
89
+ className: "space-y-6",
90
+ children: [
91
+ /* @__PURE__ */ jsxs("div", {
92
+ className: "flex items-baseline gap-1",
93
+ children: [/* @__PURE__ */ jsx("span", {
94
+ className: "text-4xl font-bold",
95
+ children: isAnnual ? priceDisplay.annually.amount : priceDisplay.monthly.amount
96
+ }), /* @__PURE__ */ jsx("span", {
97
+ className: "text-muted-foreground",
98
+ children: isAnnual ? priceDisplay.annually.label : priceDisplay.monthly.label
99
+ })]
100
+ }),
101
+ isAnnual && priceDisplay.annually.originalAmount && /* @__PURE__ */ jsxs("p", {
102
+ className: "text-sm text-green-500 line-through",
103
+ children: [
104
+ " ",
105
+ priceDisplay.annually.originalAmount,
106
+ " / month"
107
+ ]
108
+ }),
109
+ /* @__PURE__ */ jsx("div", {
110
+ className: "space-y-3",
111
+ children: features.map((feature) => /* @__PURE__ */ jsxs("div", {
112
+ className: "flex items-center gap-2",
113
+ children: [/* @__PURE__ */ jsx("div", {
114
+ className: "h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center shrink-0",
115
+ children: /* @__PURE__ */ jsx(Check, { className: "h-3 w-3 text-primary" })
116
+ }), /* @__PURE__ */ jsx("span", {
117
+ className: "text-sm text-muted-foreground",
118
+ children: feature
119
+ })]
120
+ }, feature))
121
+ })
122
+ ]
123
+ }),
124
+ /* @__PURE__ */ jsx(CardFooter, { children: /* @__PURE__ */ jsx(Button, {
125
+ className: "w-full",
126
+ color: "primary",
127
+ size: "lg",
128
+ as: "a",
129
+ href: `${import.meta.env.VITE_SERVER_URL}/stripe/checkout/${currentPriceId}`,
130
+ children: isAnnual ? "Subscribe Annually" : "Subscribe Monthly"
131
+ }) })
132
+ ]
133
+ }),
134
+ /* @__PURE__ */ jsxs("div", {
135
+ className: "text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary",
136
+ children: [
137
+ /* @__PURE__ */ jsx("a", {
138
+ href: termsOfServiceUrl,
139
+ rel: "noopener noreferrer",
140
+ target: "_blank",
141
+ children: t("common.termsOfService", "Terms of Service")
142
+ }),
143
+ " ",
144
+ t("common.and", "and"),
145
+ " ",
146
+ /* @__PURE__ */ jsx(Link$1, {
147
+ to: "/privacy",
148
+ children: t("common.privacyPolicy", "Privacy Policy")
149
+ })
150
+ ]
151
+ })
152
+ ]
153
+ }), /* @__PURE__ */ jsx("div", {
154
+ className: "fixed bottom-4 left-4",
155
+ children: /* @__PURE__ */ jsxs(Button, {
156
+ variant: "light",
157
+ onPress: handleLogout,
158
+ className: "gap-2",
159
+ children: [/* @__PURE__ */ jsx(LogOut, { className: "h-4 w-4" }), t("sidebar.user.logout", "Log out")]
160
+ })
161
+ })]
162
+ });
46
163
  }
164
+ //#endregion
165
+ export { BillingSinglePlanSelect };
166
+
167
+ //# sourceMappingURL=BillingSinglePlanSelect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillingSinglePlanSelect.js","names":["Card","CardHeader","Link"],"sources":["../../../../../src/modules/billing/components/BillingSinglePlanSelect.tsx"],"sourcesContent":["import { Button } from \"@heroui/react\";\r\nimport type { StripePlan } from \"@m5kdev/commons/modules/billing/billing.types\";\r\nimport { authClient } from \"@m5kdev/frontend/modules/auth/auth.lib\";\r\nimport { Check, LogOut } from \"lucide-react\";\r\nimport { useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { Link, useNavigate } from \"react-router\";\r\nimport {\r\n Card,\r\n CardContent,\r\n CardDescription,\r\n CardFooter,\r\n CardHeader,\r\n CardTitle,\r\n} from \"../../../components/ui/card\";\r\nimport { Tabs, TabsList, TabsTrigger } from \"../../../components/ui/tabs\";\r\nimport { cn } from \"../../../lib/utils\";\r\n\r\nexport interface BillingSinglePlanSelectProps {\r\n plan: StripePlan;\r\n features?: string[];\r\n /** URL for the Terms of Service link. Override for your app's legal page. */\r\n termsOfServiceUrl?: string;\r\n}\r\n\r\nexport function BillingSinglePlanSelect({\r\n plan,\r\n termsOfServiceUrl,\r\n features = [\r\n \"Unlimited access to all features\",\r\n \"Priority support\",\r\n \"Early access to new features\",\r\n \"Secure data storage\",\r\n \"Cancel anytime\",\r\n ],\r\n}: BillingSinglePlanSelectProps) {\r\n const { t } = useTranslation(\"web-ui\");\r\n const navigate = useNavigate();\r\n const [billingInterval, setBillingInterval] = useState<\"monthly\" | \"annually\">(\"annually\");\r\n\r\n const handleLogout = async () => {\r\n await authClient.signOut();\r\n navigate(\"/login\");\r\n };\r\n\r\n const isAnnual = billingInterval === \"annually\";\r\n const currentPriceId = isAnnual ? plan.annualDiscountPriceId : plan.priceId;\r\n\r\n // Fallback if no annual price ID exists\r\n const hasAnnualOption = !!plan.annualDiscountPriceId;\r\n\r\n const priceUnitAmount = plan.priceUnitAmount ?? Number.NaN;\r\n const annualPriceUnitAmount = plan.annualPriceUnitAmount ?? Number.NaN;\r\n\r\n const priceDisplay = {\r\n monthly: {\r\n amount: `$${priceUnitAmount / 100}`,\r\n label: \"/ month\",\r\n },\r\n annually: {\r\n amount: `$${annualPriceUnitAmount / 100 / 12}`,\r\n originalAmount: `$${priceUnitAmount / 100}`,\r\n label: \"/ month, billed annually\",\r\n discountLabel: plan.annualPriceUnitAmount\r\n ? `Save ${Math.floor(((priceUnitAmount - annualPriceUnitAmount / 12) / priceUnitAmount) * 100).toFixed(0)}%`\r\n : \"\",\r\n },\r\n };\r\n\r\n return (\r\n <div className=\"w-full max-w-3xl mx-auto px-4 py-8\">\r\n <div className=\"flex flex-col items-center gap-8\">\r\n <div className=\"text-center space-y-2\">\r\n <h2 className=\"text-3xl font-bold tracking-tight sm:text-4xl\">\r\n {t(\"billing.plans.title\", \"Simple, transparent pricing\")}\r\n </h2>\r\n <p className=\"text-muted-foreground text-lg\">\r\n {t(\"billing.plans.subtitle\", \"Choose the plan that's right for you\")}\r\n </p>\r\n </div>\r\n\r\n {hasAnnualOption && (\r\n <Tabs\r\n defaultValue=\"annually\"\r\n value={billingInterval}\r\n onValueChange={(v) => setBillingInterval(v as \"monthly\" | \"annually\")}\r\n className=\"w-full max-w-xs\"\r\n >\r\n <TabsList className=\"grid w-full grid-cols-2\">\r\n <TabsTrigger value=\"monthly\">Monthly</TabsTrigger>\r\n <TabsTrigger value=\"annually\" className=\"relative\">\r\n Annually\r\n {priceDisplay.annually.discountLabel && (\r\n <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\">\r\n {priceDisplay.annually.discountLabel}\r\n </span>\r\n )}\r\n </TabsTrigger>\r\n </TabsList>\r\n </Tabs>\r\n )}\r\n\r\n <Card className={cn(\"w-full max-w-md border-2 border-primary\")}>\r\n <CardHeader>\r\n <CardTitle className=\"flex justify-between items-start\">\r\n <span className=\"text-xl font-bold\">{plan.name}</span>\r\n </CardTitle>\r\n <CardDescription>\r\n {isAnnual ? \"Perfect for long-term commitment\" : \"Flexible monthly billing\"}\r\n </CardDescription>\r\n </CardHeader>\r\n\r\n <CardContent className=\"space-y-6\">\r\n <div className=\"flex items-baseline gap-1\">\r\n <span className=\"text-4xl font-bold\">\r\n {isAnnual ? priceDisplay.annually.amount : priceDisplay.monthly.amount}\r\n </span>\r\n <span className=\"text-muted-foreground\">\r\n {isAnnual ? priceDisplay.annually.label : priceDisplay.monthly.label}\r\n </span>\r\n </div>\r\n\r\n {isAnnual && priceDisplay.annually.originalAmount && (\r\n <p className=\"text-sm text-green-500 line-through\">\r\n {\" \"}\r\n {priceDisplay.annually.originalAmount} / month\r\n </p>\r\n )}\r\n\r\n <div className=\"space-y-3\">\r\n {features.map((feature) => (\r\n <div key={feature} className=\"flex items-center gap-2\">\r\n <div className=\"h-5 w-5 rounded-full bg-primary/10 flex items-center justify-center shrink-0\">\r\n <Check className=\"h-3 w-3 text-primary\" />\r\n </div>\r\n <span className=\"text-sm text-muted-foreground\">{feature}</span>\r\n </div>\r\n ))}\r\n </div>\r\n </CardContent>\r\n\r\n <CardFooter>\r\n <Button\r\n className=\"w-full\"\r\n color=\"primary\"\r\n size=\"lg\"\r\n as=\"a\"\r\n href={`${import.meta.env.VITE_SERVER_URL}/stripe/checkout/${currentPriceId}`}\r\n >\r\n {isAnnual ? \"Subscribe Annually\" : \"Subscribe Monthly\"}\r\n </Button>\r\n </CardFooter>\r\n </Card>\r\n\r\n <div className=\"text-balance text-center text-xs text-muted-foreground [&_a]:underline [&_a]:underline-offset-4 [&_a]:hover:text-primary\">\r\n <a href={termsOfServiceUrl} rel=\"noopener noreferrer\" target=\"_blank\">\r\n {t(\"common.termsOfService\", \"Terms of Service\")}\r\n </a>{\" \"}\r\n {t(\"common.and\", \"and\")}{\" \"}\r\n <Link to=\"/privacy\">{t(\"common.privacyPolicy\", \"Privacy Policy\")}</Link>\r\n </div>\r\n </div>\r\n\r\n <div className=\"fixed bottom-4 left-4\">\r\n <Button variant=\"light\" onPress={handleLogout} className=\"gap-2\">\r\n <LogOut className=\"h-4 w-4\" />\r\n {t(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