@studiocubics/cms 0.0.2 → 0.0.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 (284) hide show
  1. package/dist/client/clerk/rbacConfig.js +2 -0
  2. package/dist/client/clerk/rbacConfig.js.map +1 -0
  3. package/dist/client/constants/defaults.d.ts +3 -0
  4. package/dist/client/constants/defaults.js +2 -0
  5. package/dist/client/constants/defaults.js.map +1 -0
  6. package/dist/client/constants/pageLimits.js +2 -0
  7. package/dist/client/constants/pageLimits.js.map +1 -0
  8. package/dist/{index.d.ts → client/index.d.ts} +1 -2
  9. package/dist/client/index.js +2 -0
  10. package/dist/client/index.js.map +1 -0
  11. package/dist/client/providers/CMSRootProviders.js +2 -0
  12. package/dist/client/providers/CMSRootProviders.js.map +1 -0
  13. package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +2 -0
  14. package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +1 -0
  15. package/dist/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +2 -0
  16. package/dist/{ui → client/ui}/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js.map +1 -1
  17. package/dist/client/ui/Layout/CMSSecurityLayout.js +2 -0
  18. package/dist/client/ui/Layout/CMSSecurityLayout.js.map +1 -0
  19. package/dist/client/ui/Layout/CMSSidebar/CMSSidebar.js +2 -0
  20. package/dist/client/ui/Layout/CMSSidebar/CMSSidebar.js.map +1 -0
  21. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarBody.js +2 -0
  22. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +1 -0
  23. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +2 -0
  24. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +1 -0
  25. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +2 -0
  26. package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js.map +1 -1
  27. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +2 -0
  28. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +1 -0
  29. package/dist/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +2 -0
  30. package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js.map +1 -1
  31. package/dist/client/ui/System/Auth/SignIn/SignIn.js +2 -0
  32. package/dist/client/ui/System/Auth/SignIn/SignIn.js.map +1 -0
  33. package/dist/client/ui/System/Auth/SignIn/SignIn.module.css.js +2 -0
  34. package/dist/{ui → client/ui}/System/Auth/SignIn/SignIn.module.css.js.map +1 -1
  35. package/dist/client/ui/System/Auth/SignIn/useSignInForm.js +2 -0
  36. package/dist/client/ui/System/Auth/SignIn/useSignInForm.js.map +1 -0
  37. package/dist/client/ui/System/Auth/SignUp/SignUp.js +2 -0
  38. package/dist/client/ui/System/Auth/SignUp/SignUp.js.map +1 -0
  39. package/dist/client/ui/System/Auth/SignUp/SignUp.module.css.js +2 -0
  40. package/dist/{ui → client/ui}/System/Auth/SignUp/SignUp.module.css.js.map +1 -1
  41. package/dist/client/ui/System/Auth/SignUp/useSignUpForm.js +2 -0
  42. package/dist/client/ui/System/Auth/SignUp/useSignUpForm.js.map +1 -0
  43. package/dist/client/ui/System/Invitations/InvitationList.js +2 -0
  44. package/dist/client/ui/System/Invitations/InvitationList.js.map +1 -0
  45. package/dist/client/ui/System/Invitations/InvitationListActions.js +2 -0
  46. package/dist/client/ui/System/Invitations/InvitationListActions.js.map +1 -0
  47. package/dist/client/ui/System/Invitations/InvitationListCard.js +2 -0
  48. package/dist/client/ui/System/Invitations/InvitationListCard.js.map +1 -0
  49. package/dist/client/ui/System/Invitations/InvitationListPage.js +2 -0
  50. package/dist/client/ui/System/Invitations/InvitationListPage.js.map +1 -0
  51. package/dist/client/ui/System/Invitations/InvitationListPagination.js +2 -0
  52. package/dist/client/ui/System/Invitations/InvitationListPagination.js.map +1 -0
  53. package/dist/client/ui/System/Permissions/RoleListCard.js +2 -0
  54. package/dist/client/ui/System/Permissions/RoleListCard.js.map +1 -0
  55. package/dist/client/ui/System/Permissions/RolePermissionsPage.js +2 -0
  56. package/dist/client/ui/System/Permissions/RolePermissionsPage.js.map +1 -0
  57. package/dist/client/ui/System/Permissions/RolePermissionsTable.js +2 -0
  58. package/dist/client/ui/System/Permissions/RolePermissionsTable.js.map +1 -0
  59. package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +2 -0
  60. package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +1 -0
  61. package/dist/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +2 -0
  62. package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js.map +1 -1
  63. package/dist/client/ui/System/SystemUser/CurrentSystemUserPage.js +2 -0
  64. package/dist/client/ui/System/SystemUser/CurrentSystemUserPage.js.map +1 -0
  65. package/dist/client/ui/System/SystemUser/SystemUserActions.js +2 -0
  66. package/dist/client/ui/System/SystemUser/SystemUserActions.js.map +1 -0
  67. package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +2 -0
  68. package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +1 -0
  69. package/dist/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +2 -0
  70. package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js.map +1 -1
  71. package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +2 -0
  72. package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +1 -0
  73. package/dist/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +2 -0
  74. package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js.map +1 -1
  75. package/dist/client/ui/System/SystemUser/SystemUserList.js +2 -0
  76. package/dist/client/ui/System/SystemUser/SystemUserList.js.map +1 -0
  77. package/dist/client/ui/System/SystemUser/SystemUserListActions.js +2 -0
  78. package/dist/client/ui/System/SystemUser/SystemUserListActions.js.map +1 -0
  79. package/dist/client/ui/System/SystemUser/SystemUserListCard.js +2 -0
  80. package/dist/client/ui/System/SystemUser/SystemUserListCard.js.map +1 -0
  81. package/dist/client/ui/System/SystemUser/SystemUserListPage.js +2 -0
  82. package/dist/client/ui/System/SystemUser/SystemUserListPage.js.map +1 -0
  83. package/dist/client/ui/System/SystemUser/SystemUserListPagination.js +2 -0
  84. package/dist/client/ui/System/SystemUser/SystemUserListPagination.js.map +1 -0
  85. package/dist/client/ui/System/SystemUser/SystemUserPage.js +2 -0
  86. package/dist/client/ui/System/SystemUser/SystemUserPage.js.map +1 -0
  87. package/dist/client/ui/System/SystemUser/SystemUserPageContent.js +2 -0
  88. package/dist/client/ui/System/SystemUser/SystemUserPageContent.js.map +1 -0
  89. package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +2 -0
  90. package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +1 -0
  91. package/dist/client/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +2 -0
  92. package/dist/{ui → client/ui}/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js.map +1 -1
  93. package/dist/client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +2 -0
  94. package/dist/client/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +1 -0
  95. package/dist/client/ui/System/SystemUser/SystemUserTimestamps.js +2 -0
  96. package/dist/client/ui/System/SystemUser/SystemUserTimestamps.js.map +1 -0
  97. package/dist/client/ui/System/WelcomePage/WelcomePage.js +2 -0
  98. package/dist/client/ui/System/WelcomePage/WelcomePage.js.map +1 -0
  99. package/dist/client/ui/System/WelcomePage/WelcomePage.module.css.js +2 -0
  100. package/dist/{ui → client/ui}/System/WelcomePage/WelcomePage.module.css.js.map +1 -1
  101. package/dist/{ui → client/ui}/System/types.d.ts +1 -1
  102. package/dist/index.css +1 -215
  103. package/dist/{clerk → server/clerk}/_index.d.ts +1 -1
  104. package/dist/{clerk → server/clerk}/actions/invitations.d.ts +1 -1
  105. package/dist/server/clerk/actions/invitations.js +2 -0
  106. package/dist/server/clerk/actions/invitations.js.map +1 -0
  107. package/dist/{clerk → server/clerk}/actions/systemUsers.d.ts +2 -2
  108. package/dist/server/clerk/actions/systemUsers.js +2 -0
  109. package/dist/server/clerk/actions/systemUsers.js.map +1 -0
  110. package/dist/{clerk → server/clerk}/auth.d.ts +1 -1
  111. package/dist/server/clerk/auth.js +2 -0
  112. package/dist/server/clerk/auth.js.map +1 -0
  113. package/dist/{clerk → server/clerk}/hasPermission.d.ts +1 -1
  114. package/dist/server/clerk/hasPermission.js +2 -0
  115. package/dist/server/clerk/hasPermission.js.map +1 -0
  116. package/dist/server/clerk/schemas/invitation.js +2 -0
  117. package/dist/server/clerk/schemas/invitation.js.map +1 -0
  118. package/dist/server/clerk/toClientSafeUser.js +2 -0
  119. package/dist/server/clerk/toClientSafeUser.js.map +1 -0
  120. package/dist/server/index.d.ts +5 -0
  121. package/dist/server/index.js +2 -0
  122. package/dist/server/index.js.map +1 -0
  123. package/package.json +14 -10
  124. package/dist/clerk/actions/invitations.js +0 -59
  125. package/dist/clerk/actions/invitations.js.map +0 -1
  126. package/dist/clerk/actions/systemUsers.js +0 -64
  127. package/dist/clerk/actions/systemUsers.js.map +0 -1
  128. package/dist/clerk/auth.js +0 -21
  129. package/dist/clerk/auth.js.map +0 -1
  130. package/dist/clerk/hasPermission.js +0 -78
  131. package/dist/clerk/hasPermission.js.map +0 -1
  132. package/dist/clerk/rbacConfig.js +0 -48
  133. package/dist/clerk/rbacConfig.js.map +0 -1
  134. package/dist/clerk/schemas/invitation.js +0 -20
  135. package/dist/clerk/schemas/invitation.js.map +0 -1
  136. package/dist/clerk/toClientSafeUser.js +0 -46
  137. package/dist/clerk/toClientSafeUser.js.map +0 -1
  138. package/dist/constants/defaults.d.ts +0 -6
  139. package/dist/constants/defaults.js +0 -56
  140. package/dist/constants/defaults.js.map +0 -1
  141. package/dist/constants/pageLimits.js +0 -5
  142. package/dist/constants/pageLimits.js.map +0 -1
  143. package/dist/index.js +0 -45
  144. package/dist/index.js.map +0 -1
  145. package/dist/providers/CMSRootProviders.js +0 -11
  146. package/dist/providers/CMSRootProviders.js.map +0 -1
  147. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +0 -13
  148. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +0 -1
  149. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +0 -4
  150. package/dist/ui/Layout/CMSSecurityLayout.js +0 -18
  151. package/dist/ui/Layout/CMSSecurityLayout.js.map +0 -1
  152. package/dist/ui/Layout/CMSSidebar/CMSSidebar.js +0 -15
  153. package/dist/ui/Layout/CMSSidebar/CMSSidebar.js.map +0 -1
  154. package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js +0 -18
  155. package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +0 -1
  156. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +0 -39
  157. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +0 -1
  158. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +0 -4
  159. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +0 -16
  160. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +0 -1
  161. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +0 -4
  162. package/dist/ui/System/Auth/SignIn/SignIn.js +0 -28
  163. package/dist/ui/System/Auth/SignIn/SignIn.js.map +0 -1
  164. package/dist/ui/System/Auth/SignIn/SignIn.module.css.js +0 -4
  165. package/dist/ui/System/Auth/SignIn/useSignInForm.js +0 -46
  166. package/dist/ui/System/Auth/SignIn/useSignInForm.js.map +0 -1
  167. package/dist/ui/System/Auth/SignUp/SignUp.js +0 -36
  168. package/dist/ui/System/Auth/SignUp/SignUp.js.map +0 -1
  169. package/dist/ui/System/Auth/SignUp/SignUp.module.css.js +0 -4
  170. package/dist/ui/System/Auth/SignUp/useSignUpForm.js +0 -58
  171. package/dist/ui/System/Auth/SignUp/useSignUpForm.js.map +0 -1
  172. package/dist/ui/System/Invitations/InvitationList.js +0 -11
  173. package/dist/ui/System/Invitations/InvitationList.js.map +0 -1
  174. package/dist/ui/System/Invitations/InvitationListActions.js +0 -39
  175. package/dist/ui/System/Invitations/InvitationListActions.js.map +0 -1
  176. package/dist/ui/System/Invitations/InvitationListCard.js +0 -16
  177. package/dist/ui/System/Invitations/InvitationListCard.js.map +0 -1
  178. package/dist/ui/System/Invitations/InvitationListPage.js +0 -22
  179. package/dist/ui/System/Invitations/InvitationListPage.js.map +0 -1
  180. package/dist/ui/System/Invitations/InvitationListPagination.js +0 -11
  181. package/dist/ui/System/Invitations/InvitationListPagination.js.map +0 -1
  182. package/dist/ui/System/Permissions/RoleListCard.js +0 -11
  183. package/dist/ui/System/Permissions/RoleListCard.js.map +0 -1
  184. package/dist/ui/System/Permissions/RolePermissionsPage.js +0 -14
  185. package/dist/ui/System/Permissions/RolePermissionsPage.js.map +0 -1
  186. package/dist/ui/System/Permissions/RolePermissionsTable.js +0 -28
  187. package/dist/ui/System/Permissions/RolePermissionsTable.js.map +0 -1
  188. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +0 -31
  189. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +0 -1
  190. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +0 -4
  191. package/dist/ui/System/SystemUser/CurrentSystemUserPage.js +0 -17
  192. package/dist/ui/System/SystemUser/CurrentSystemUserPage.js.map +0 -1
  193. package/dist/ui/System/SystemUser/SystemUserActions.js +0 -14
  194. package/dist/ui/System/SystemUser/SystemUserActions.js.map +0 -1
  195. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +0 -16
  196. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +0 -1
  197. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +0 -4
  198. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +0 -26
  199. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +0 -1
  200. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +0 -4
  201. package/dist/ui/System/SystemUser/SystemUserList.js +0 -11
  202. package/dist/ui/System/SystemUser/SystemUserList.js.map +0 -1
  203. package/dist/ui/System/SystemUser/SystemUserListActions.js +0 -11
  204. package/dist/ui/System/SystemUser/SystemUserListActions.js.map +0 -1
  205. package/dist/ui/System/SystemUser/SystemUserListCard.js +0 -34
  206. package/dist/ui/System/SystemUser/SystemUserListCard.js.map +0 -1
  207. package/dist/ui/System/SystemUser/SystemUserListPage.js +0 -24
  208. package/dist/ui/System/SystemUser/SystemUserListPage.js.map +0 -1
  209. package/dist/ui/System/SystemUser/SystemUserListPagination.js +0 -11
  210. package/dist/ui/System/SystemUser/SystemUserListPagination.js.map +0 -1
  211. package/dist/ui/System/SystemUser/SystemUserPage.js +0 -17
  212. package/dist/ui/System/SystemUser/SystemUserPage.js.map +0 -1
  213. package/dist/ui/System/SystemUser/SystemUserPageContent.js +0 -13
  214. package/dist/ui/System/SystemUser/SystemUserPageContent.js.map +0 -1
  215. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +0 -21
  216. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +0 -1
  217. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +0 -4
  218. package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +0 -19
  219. package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +0 -1
  220. package/dist/ui/System/SystemUser/SystemUserTimestamps.js +0 -27
  221. package/dist/ui/System/SystemUser/SystemUserTimestamps.js.map +0 -1
  222. package/dist/ui/System/WelcomePage/WelcomePage.js +0 -16
  223. package/dist/ui/System/WelcomePage/WelcomePage.js.map +0 -1
  224. package/dist/ui/System/WelcomePage/WelcomePage.module.css.js +0 -4
  225. package/dist/utils/_index.d.ts +0 -1
  226. package/dist/utils/proxyFunctions.d.ts +0 -4
  227. package/dist/utils/proxyFunctions.js +0 -34
  228. package/dist/utils/proxyFunctions.js.map +0 -1
  229. package/rollup.config.js +0 -48
  230. /package/dist/{clerk → client/clerk}/rbacConfig.d.ts +0 -0
  231. /package/dist/{constants → client/constants}/_index.d.ts +0 -0
  232. /package/dist/{constants → client/constants}/pageLimits.d.ts +0 -0
  233. /package/dist/{providers → client/providers}/CMSRootProviders.d.ts +0 -0
  234. /package/dist/{providers → client/providers}/_index.d.ts +0 -0
  235. /package/dist/{ui → client/ui}/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.d.ts +0 -0
  236. /package/dist/{ui → client/ui}/Inputs/_index.d.ts +0 -0
  237. /package/dist/{ui → client/ui}/Layout/CMSSecurityLayout.d.ts +0 -0
  238. /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebar.d.ts +0 -0
  239. /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarBody.d.ts +0 -0
  240. /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.d.ts +0 -0
  241. /package/dist/{ui → client/ui}/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.d.ts +0 -0
  242. /package/dist/{ui → client/ui}/Layout/CMSSidebar/_index.d.ts +0 -0
  243. /package/dist/{ui → client/ui}/Layout/_index.d.ts +0 -0
  244. /package/dist/{ui → client/ui}/System/Auth/SignIn/SignIn.d.ts +0 -0
  245. /package/dist/{ui → client/ui}/System/Auth/SignIn/_index.d.ts +0 -0
  246. /package/dist/{ui → client/ui}/System/Auth/SignIn/useSignInForm.d.ts +0 -0
  247. /package/dist/{ui → client/ui}/System/Auth/SignUp/SignUp.d.ts +0 -0
  248. /package/dist/{ui → client/ui}/System/Auth/SignUp/_index.d.ts +0 -0
  249. /package/dist/{ui → client/ui}/System/Auth/SignUp/useSignUpForm.d.ts +0 -0
  250. /package/dist/{ui → client/ui}/System/Auth/_index.d.ts +0 -0
  251. /package/dist/{ui → client/ui}/System/Invitations/InvitationList.d.ts +0 -0
  252. /package/dist/{ui → client/ui}/System/Invitations/InvitationListActions.d.ts +0 -0
  253. /package/dist/{ui → client/ui}/System/Invitations/InvitationListCard.d.ts +0 -0
  254. /package/dist/{ui → client/ui}/System/Invitations/InvitationListPage.d.ts +0 -0
  255. /package/dist/{ui → client/ui}/System/Invitations/InvitationListPagination.d.ts +0 -0
  256. /package/dist/{ui → client/ui}/System/Invitations/_index.d.ts +0 -0
  257. /package/dist/{ui → client/ui}/System/Permissions/RoleListCard.d.ts +0 -0
  258. /package/dist/{ui → client/ui}/System/Permissions/RolePermissionsPage.d.ts +0 -0
  259. /package/dist/{ui → client/ui}/System/Permissions/RolePermissionsTable.d.ts +0 -0
  260. /package/dist/{ui → client/ui}/System/Permissions/_index.d.ts +0 -0
  261. /package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.d.ts +0 -0
  262. /package/dist/{ui → client/ui}/System/SystemUser/CurrentSystemUserPage.d.ts +0 -0
  263. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserActions.d.ts +0 -0
  264. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetails/SystemUserDetails.d.ts +0 -0
  265. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.d.ts +0 -0
  266. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserList.d.ts +0 -0
  267. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListActions.d.ts +0 -0
  268. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListCard.d.ts +0 -0
  269. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListPage.d.ts +0 -0
  270. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserListPagination.d.ts +0 -0
  271. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserPage.d.ts +0 -0
  272. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserPageContent.d.ts +0 -0
  273. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserRole/SystemUserRole.d.ts +0 -0
  274. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.d.ts +0 -0
  275. /package/dist/{ui → client/ui}/System/SystemUser/SystemUserTimestamps.d.ts +0 -0
  276. /package/dist/{ui → client/ui}/System/SystemUser/_index.d.ts +0 -0
  277. /package/dist/{ui → client/ui}/System/WelcomePage/WelcomePage.d.ts +0 -0
  278. /package/dist/{ui → client/ui}/System/_index.d.ts +0 -0
  279. /package/dist/{ui → client/ui}/_index.d.ts +0 -0
  280. /package/dist/{clerk → server/clerk}/actions/_index.d.ts +0 -0
  281. /package/dist/{clerk → server/clerk}/schemas/_index.d.ts +0 -0
  282. /package/dist/{clerk → server/clerk}/schemas/invitation.d.ts +0 -0
  283. /package/dist/{clerk → server/clerk}/schemas/systemUser.d.ts +0 -0
  284. /package/dist/{clerk → server/clerk}/toClientSafeUser.d.ts +0 -0
@@ -0,0 +1,2 @@
1
+ const e=["admin","manager","member"],s={admin:{desc:"Full system authority with unrestricted access and management capabilities.",isSystem:!0,permissions:[]},manager:{desc:"Responsible for overseeing teams and resources; can manage existing items and invite users.",inherits:["member"],permissions:[{resource:"systemUsers",actions:{create:!0,read:!0,update:!0},conditions:{ownerField:"id"}},{resource:"projects",actions:{create:!0,read:!0,update:!0,delete:!0}},{resource:"invitations",actions:{create:!0,read:!0,update:!0,delete:!0}}]},member:{desc:"Standard user with read-level access to assigned resources; limited modification rights.",permissions:[{resource:"systemUsers",actions:{read:!0}},{resource:"projects",actions:{read:!0}}]}},r=e=>{switch(e){case"admin":case"manager":return{role:e,onboardingComplete:!0};default:return{role:e,onboardingComplete:!1}}};export{s as RBAC_CONFIG,r as getInvitationPublicMetadata,e as roles};
2
+ //# sourceMappingURL=rbacConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbacConfig.js","sources":["../../../src/client/clerk/rbacConfig.ts"],"sourcesContent":["export const roles = [\"admin\", \"manager\", \"member\"] as const;\nexport const resources = [\"systemUsers\", \"projects\", \"invitations\"] as const;\n\nexport const RBAC_CONFIG: {\n [K in Role]: RoleDoc;\n} = {\n admin: {\n desc: \"Full system authority with unrestricted access and management capabilities.\",\n isSystem: true,\n permissions: [], // system role bypasses all checks\n },\n manager: {\n desc: \"Responsible for overseeing teams and resources; can manage existing items and invite users.\",\n inherits: [\"member\"],\n permissions: [\n {\n resource: \"systemUsers\",\n actions: { create: true, read: true, update: true },\n conditions: { ownerField: \"id\" },\n },\n {\n resource: \"projects\",\n actions: { create: true, read: true, update: true, delete: true },\n },\n {\n resource: \"invitations\",\n actions: { create: true, read: true, update: true, delete: true },\n },\n ],\n },\n member: {\n desc: \"Standard user with read-level access to assigned resources; limited modification rights.\",\n permissions: [\n { resource: \"systemUsers\", actions: { read: true } },\n { resource: \"projects\", actions: { read: true } },\n ],\n },\n} as const;\n\nexport type Role = (typeof roles)[number];\nexport type Resource = (typeof resources)[number];\n\nexport type RoleActions = \"create\" | \"read\" | \"update\" | \"delete\";\n\nexport type ResourcePermission = {\n resource: Resource;\n actions: Partial<Record<RoleActions, boolean>>;\n conditions?: {\n ownerField?: string; // e.g. “creatorId”\n };\n};\nexport type RoleDoc = {\n desc?: string;\n inherits?: string[];\n isSystem?: boolean;\n permissions: ResourcePermission[];\n};\n\nexport const getInvitationPublicMetadata = (role: Role) => {\n switch (role) {\n case \"admin\":\n return { role, onboardingComplete: true };\n case \"manager\":\n return { role, onboardingComplete: true };\n default:\n return { role, onboardingComplete: false };\n }\n};\n"],"names":["roles","RBAC_CONFIG","admin","desc","isSystem","permissions","manager","inherits","resource","actions","create","read","update","conditions","ownerField","delete","member","getInvitationPublicMetadata","role","onboardingComplete"],"mappings":"AAAO,MAAMA,EAAQ,CAAC,QAAS,UAAW,UAG7BC,EAET,CACFC,MAAO,CACLC,KAAM,8EACNC,UAAU,EACVC,YAAa,IAEfC,QAAS,CACPH,KAAM,8FACNI,SAAU,CAAC,UACXF,YAAa,CACX,CACEG,SAAU,cACVC,QAAS,CAAEC,QAAQ,EAAMC,MAAM,EAAMC,QAAQ,GAC7CC,WAAY,CAAEC,WAAY,OAE5B,CACEN,SAAU,WACVC,QAAS,CAAEC,QAAQ,EAAMC,MAAM,EAAMC,QAAQ,EAAMG,QAAQ,IAE7D,CACEP,SAAU,cACVC,QAAS,CAAEC,QAAQ,EAAMC,MAAM,EAAMC,QAAQ,EAAMG,QAAQ,MAIjEC,OAAQ,CACNb,KAAM,2FACNE,YAAa,CACX,CAAEG,SAAU,cAAeC,QAAS,CAAEE,MAAM,IAC5C,CAAEH,SAAU,WAAYC,QAAS,CAAEE,MAAM,OAwBlCM,EAA+BC,IAC1C,OAAQA,GACN,IAAK,QAEL,IAAK,UACH,MAAO,CAAEA,OAAMC,oBAAoB,GACrC,QACE,MAAO,CAAED,OAAMC,oBAAoB"}
@@ -0,0 +1,3 @@
1
+ import type { ListItemProps, TabProps } from "@studiocubics/components";
2
+ export declare const defaultNavLinks: ListItemProps[];
3
+ export declare const defaultSecurityLinks: TabProps[];
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{Newspaper as t,ShieldUser as s,Settings as e,SquareUser as n,DoorClosedLocked as o,Users as c,Send as i}from"lucide-react";const a=[{startIcon:r(t,{}),children:"Content",href:"/dashboard/content"},{startIcon:r(s,{}),href:"/dashboard/security",children:"Security"},{startIcon:r(e,{}),href:"/dashboard/settings",children:"Settings"}],d=[{children:"Your Account",startIcon:r(n,{}),href:"/dashboard/security/account"},{children:"Roles & Permissions",startIcon:r(o,{}),href:"/dashboard/security/permissions"},{children:"System Users",startIcon:r(c,{}),href:"/dashboard/security/systemUsers"},{children:"Invitations",startIcon:r(i,{}),href:"/dashboard/security/invitations"}];export{a as defaultNavLinks,d as defaultSecurityLinks};
2
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sources":["../../../src/client/constants/defaults.tsx"],"sourcesContent":["import type { ListItemProps, TabProps } from \"@studiocubics/components\";\nimport {\n Newspaper,\n Settings,\n ShieldUser,\n SquareUser,\n DoorClosedLocked,\n Users,\n Send,\n} from \"lucide-react\";\n\nexport const defaultNavLinks: ListItemProps[] = [\n {\n startIcon: <Newspaper />,\n children: \"Content\",\n href: \"/dashboard/content\",\n },\n {\n startIcon: <ShieldUser />,\n href: \"/dashboard/security\",\n children: \"Security\",\n },\n {\n startIcon: <Settings />,\n href: \"/dashboard/settings\",\n children: \"Settings\",\n },\n];\nexport const defaultSecurityLinks: TabProps[] = [\n {\n children: \"Your Account\",\n startIcon: <SquareUser />,\n href: \"/dashboard/security/account\",\n },\n {\n children: \"Roles & Permissions\",\n startIcon: <DoorClosedLocked />,\n href: \"/dashboard/security/permissions\",\n },\n {\n children: \"System Users\",\n startIcon: <Users />,\n href: \"/dashboard/security/systemUsers\",\n },\n {\n children: \"Invitations\",\n startIcon: <Send />,\n href: \"/dashboard/security/invitations\",\n },\n];\n"],"names":["defaultNavLinks","startIcon","_jsx","Newspaper","children","href","ShieldUser","Settings","defaultSecurityLinks","SquareUser","DoorClosedLocked","Users","Send"],"mappings":"0KAWO,MAAMA,EAAmC,CAC9C,CACEC,UAAWC,EAACC,EAAS,IACrBC,SAAU,UACVC,KAAM,sBAER,CACEJ,UAAWC,EAACI,EAAU,IACtBD,KAAM,sBACND,SAAU,YAEZ,CACEH,UAAWC,EAACK,EAAQ,IACpBF,KAAM,sBACND,SAAU,aAGDI,EAAmC,CAC9C,CACEJ,SAAU,eACVH,UAAWC,EAACO,EAAU,IACtBJ,KAAM,+BAER,CACED,SAAU,sBACVH,UAAWC,EAACQ,EAAgB,IAC5BL,KAAM,mCAER,CACED,SAAU,eACVH,UAAWC,EAACS,EAAK,IACjBN,KAAM,mCAER,CACED,SAAU,cACVH,UAAWC,EAACU,EAAI,IAChBP,KAAM"}
@@ -0,0 +1,2 @@
1
+ const o=10,t=10;export{t as INVITATIONS_PAGE_LIMIT,o as SYSTEM_USERS_PAGE_LIMIT};
2
+ //# sourceMappingURL=pageLimits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageLimits.js","sources":["../../../src/client/constants/pageLimits.ts"],"sourcesContent":["export const SYSTEM_USERS_PAGE_LIMIT = 10;\nexport const INVITATIONS_PAGE_LIMIT = 10;\n"],"names":["SYSTEM_USERS_PAGE_LIMIT","INVITATIONS_PAGE_LIMIT"],"mappings":"AAAO,MAAMA,EAA0B,GAC1BC,EAAyB"}
@@ -1,5 +1,4 @@
1
- export * from "./clerk/_index";
1
+ export * from "./clerk/rbacConfig";
2
2
  export * from "./constants/_index";
3
3
  export * from "./providers/_index";
4
4
  export * from "./ui/_index";
5
- export * from "./utils/_index";
@@ -0,0 +1,2 @@
1
+ export{RBAC_CONFIG,getInvitationPublicMetadata,resources,roles}from"./clerk/rbacConfig.js";export{INVITATIONS_PAGE_LIMIT,SYSTEM_USERS_PAGE_LIMIT}from"./constants/pageLimits.js";export{defaultNavLinks,defaultSecurityLinks}from"./constants/defaults.js";export{CMSRootProviders}from"./providers/CMSRootProviders.js";export{ThemedMonacoEditor}from"./ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js";export{CMSSecurityLayout}from"./ui/Layout/CMSSecurityLayout.js";export{CMSSidebar}from"./ui/Layout/CMSSidebar/CMSSidebar.js";export{CMSSidebarBody}from"./ui/Layout/CMSSidebar/CMSSidebarBody.js";export{CMSSidebarFooter}from"./ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js";export{CMSSidebarHeader}from"./ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js";export{SignIn}from"./ui/System/Auth/SignIn/SignIn.js";export{useSignInForm}from"./ui/System/Auth/SignIn/useSignInForm.js";export{SignUp}from"./ui/System/Auth/SignUp/SignUp.js";export{useSignUpForm}from"./ui/System/Auth/SignUp/useSignUpForm.js";export{InvitationList}from"./ui/System/Invitations/InvitationList.js";export{InvitationCreateDialog,InvitationListActions,InvitationRevokeDialog}from"./ui/System/Invitations/InvitationListActions.js";export{InvitationListCard}from"./ui/System/Invitations/InvitationListCard.js";export{InvitationListPage}from"./ui/System/Invitations/InvitationListPage.js";export{InvitationListPagination}from"./ui/System/Invitations/InvitationListPagination.js";export{RoleListCard}from"./ui/System/Permissions/RoleListCard.js";export{RolePermissionsPage}from"./ui/System/Permissions/RolePermissionsPage.js";export{RolePermissionsTable}from"./ui/System/Permissions/RolePermissionsTable.js";export{CurrentSystemUserButton,Logout}from"./ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js";export{CurrentSystemUserPage}from"./ui/System/SystemUser/CurrentSystemUserPage.js";export{SystemUserDeleteListItem}from"./ui/System/SystemUser/SystemUserActions.js";export{SystemUserDetails}from"./ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js";export{SystemUserDetailsForm}from"./ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js";export{SystemUserList}from"./ui/System/SystemUser/SystemUserList.js";export{SystemUserListActions}from"./ui/System/SystemUser/SystemUserListActions.js";export{SystemUserListCard}from"./ui/System/SystemUser/SystemUserListCard.js";export{SystemUserListPage}from"./ui/System/SystemUser/SystemUserListPage.js";export{SystemUserListPagination}from"./ui/System/SystemUser/SystemUserListPagination.js";export{SystemUserPage}from"./ui/System/SystemUser/SystemUserPage.js";export{SystemUserPageContent}from"./ui/System/SystemUser/SystemUserPageContent.js";export{SystemUserRole}from"./ui/System/SystemUser/SystemUserRole/SystemUserRole.js";export{CurrentSystemUserTimestamps,SystemUserTimestamps}from"./ui/System/SystemUser/SystemUserTimestamps.js";export{WelcomePage}from"./ui/System/WelcomePage/WelcomePage.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{ThemeProvider as r}from"next-themes";import{ClerkProvider as t}from"@clerk/nextjs";function n({children:n}){return e(r,{enableSystem:!0,children:e(t,{children:n})})}export{n as CMSRootProviders};
2
+ //# sourceMappingURL=CMSRootProviders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSRootProviders.js","sources":["../../../src/client/providers/CMSRootProviders.tsx"],"sourcesContent":["\"use client\";\n\nimport { ThemeProvider } from \"next-themes\";\nimport type { ReactNode } from \"react\";\nimport { ClerkProvider } from \"@clerk/nextjs\";\n\nexport function CMSRootProviders({ children }: { children: ReactNode }) {\n return (\n <ThemeProvider enableSystem>\n <ClerkProvider>{children}</ClerkProvider>\n </ThemeProvider>\n );\n}\n"],"names":["CMSRootProviders","children","_jsx","ThemeProvider","enableSystem","ClerkProvider"],"mappings":"+IAMM,SAAUA,GAAiBC,SAAEA,IACjC,OACEC,EAACC,EAAa,CAACC,cAAY,EAAAH,SACzBC,EAACG,EAAa,CAAAJ,SAAEA,KAGtB"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{Editor as o}from"@monaco-editor/react";import{useTheme as r}from"next-themes";import t from"./ThemedMonacoEditor.module.css.js";function m(m){const s=r();return e(o,{className:t.root,theme:"dark"==s.resolvedTheme?"vs-dark":"vs-light",...m})}export{m as ThemedMonacoEditor};
2
+ //# sourceMappingURL=ThemedMonacoEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemedMonacoEditor.js","sources":["../../../../../src/client/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.tsx"],"sourcesContent":["\"use client\";\n\nimport { Editor, type EditorProps } from \"@monaco-editor/react\";\nimport { useTheme } from \"next-themes\";\nimport styles from \"./ThemedMonacoEditor.module.css\";\nexport function ThemedMonacoEditor(props: EditorProps) {\n const theme = useTheme();\n\n return (\n <Editor\n className={styles.root}\n theme={theme.resolvedTheme == \"dark\" ? \"vs-dark\" : \"vs-light\"}\n {...props}\n />\n );\n}\n"],"names":["ThemedMonacoEditor","props","theme","useTheme","_jsx","Editor","className","styles","root","resolvedTheme"],"mappings":"4LAKM,SAAUA,EAAmBC,GACjC,MAAMC,EAAQC,IAEd,OACEC,EAACC,EAAM,CACLC,UAAWC,EAAOC,KAClBN,MAA8B,QAAvBA,EAAMO,cAA0B,UAAY,cAC/CR,GAGV"}
@@ -0,0 +1,2 @@
1
+ var o={root:"ThemedMonacoEditor-module_root__9pWgK"};export{o as default};
2
+ //# sourceMappingURL=ThemedMonacoEditor.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemedMonacoEditor.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"ThemedMonacoEditor.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as t}from"react/jsx-runtime";import{PageLayoutTabs as e}from"@studiocubics/components";import n from"next/link";import{usePathname as o}from"next/navigation";function i(i){const{menuItems:r}=i,m=o(),s=r?.find(t=>t.href&&m.startsWith(t.href)),c=s?r?.indexOf(s):void 0;return t(e,{...i,subtitle:"Manage your account and other System security options",title:"Security",selectedIndex:c,LinkComponent:n})}export{i as CMSSecurityLayout};
2
+ //# sourceMappingURL=CMSSecurityLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSSecurityLayout.js","sources":["../../../../src/client/ui/Layout/CMSSecurityLayout.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n PageLayoutTabs,\n type PageLayoutTabsProps,\n} from \"@studiocubics/components\";\nimport Link from \"next/link\";\nimport { usePathname } from \"next/navigation\";\n\nexport function CMSSecurityLayout(\n props: Omit<PageLayoutTabsProps, \"title\" | \"subtitle\" | \"selectedIndex\">,\n) {\n const { menuItems } = props;\n const pathname = usePathname();\n const selectedItem = menuItems?.find(\n (mi) => mi.href && pathname.startsWith(mi.href),\n );\n const selectedIndex = selectedItem\n ? menuItems?.indexOf(selectedItem)\n : undefined;\n return (\n <PageLayoutTabs\n {...props}\n subtitle={\"Manage your account and other System security options\"}\n title={\"Security\"}\n selectedIndex={selectedIndex}\n LinkComponent={Link}\n />\n );\n}\n"],"names":["CMSSecurityLayout","props","menuItems","pathname","usePathname","selectedItem","find","mi","href","startsWith","selectedIndex","indexOf","undefined","_jsx","PageLayoutTabs","subtitle","title","LinkComponent","Link"],"mappings":"sLASM,SAAUA,EACdC,GAEA,MAAMC,UAAEA,GAAcD,EAChBE,EAAWC,IACXC,EAAeH,GAAWI,KAC7BC,GAAOA,EAAGC,MAAQL,EAASM,WAAWF,EAAGC,OAEtCE,EAAgBL,EAClBH,GAAWS,QAAQN,QACnBO,EACJ,OACEC,EAACC,EAAc,IACTb,EACJc,SAAU,wDACVC,MAAO,WACPN,cAAeA,EACfO,cAAeC,GAGrB"}
@@ -0,0 +1,2 @@
1
+ import{jsx as r,jsxs as e}from"react/jsx-runtime";import{Sidebar as i,SidebarDrawer as o,SidebarViewport as t}from"@studiocubics/components";import{CMSSidebarHeader as a}from"./CMSSidebarHeader/CMSSidebarHeader.js";import{CMSSidebarFooter as d}from"./CMSSidebarFooter/CMSSidebarFooter.js";import{CMSSidebarBody as n}from"./CMSSidebarBody.js";import{cookies as s}from"next/headers";async function c({children:c,sidebarLinks:m}){const l=await s(),p="true"===l.get("sidebarOpen")?.value;return r("div",{style:{height:"100dvh"},children:e(i,{defaultOpen:p,children:[e(o,{children:[r(a,{}),r(n,{sidebarLinks:m}),r(d,{})]}),r(t,{style:{backgroundColor:"var(--color-surface-alpha)"},children:c})]})})}export{c as CMSSidebar};
2
+ //# sourceMappingURL=CMSSidebar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSSidebar.js","sources":["../../../../../src/client/ui/Layout/CMSSidebar/CMSSidebar.tsx"],"sourcesContent":["import {\n Sidebar,\n SidebarViewport,\n SidebarDrawer,\n type ListItemProps,\n} from \"@studiocubics/components\";\nimport type { ReactNode } from \"react\";\nimport { CMSSidebarHeader } from \"./CMSSidebarHeader/CMSSidebarHeader\";\nimport { CMSSidebarFooter } from \"./CMSSidebarFooter/CMSSidebarFooter\";\nimport { CMSSidebarBody } from \"./CMSSidebarBody\";\nimport { cookies } from \"next/headers\";\n\nexport async function CMSSidebar({\n children,\n sidebarLinks,\n}: {\n children: ReactNode;\n sidebarLinks: ListItemProps[];\n}) {\n const cookieStore = await cookies();\n const defaultOpen = cookieStore.get(\"sidebarOpen\")?.value === \"true\";\n\n return (\n <div style={{ height: \"100dvh\" }}>\n <Sidebar defaultOpen={defaultOpen}>\n <SidebarDrawer>\n <CMSSidebarHeader />\n <CMSSidebarBody sidebarLinks={sidebarLinks} />\n <CMSSidebarFooter />\n </SidebarDrawer>\n <SidebarViewport\n style={{ backgroundColor: \"var(--color-surface-alpha)\" }}\n >\n {children}\n </SidebarViewport>\n </Sidebar>\n </div>\n );\n}\n"],"names":["async","CMSSidebar","children","sidebarLinks","cookieStore","cookies","defaultOpen","get","value","_jsx","style","height","_jsxs","Sidebar","SidebarDrawer","CMSSidebarHeader","CMSSidebarBody","CMSSidebarFooter","SidebarViewport","backgroundColor"],"mappings":"6XAYOA,eAAeC,GAAWC,SAC/BA,EAAQC,aACRA,IAKA,MAAMC,QAAoBC,IACpBC,EAAwD,SAA1CF,EAAYG,IAAI,gBAAgBC,MAEpD,OACEC,EAAA,MAAA,CAAKC,MAAO,CAAEC,OAAQ,UAAUT,SAC9BU,EAACC,GAAQP,YAAaA,EAAWJ,SAAA,CAC/BU,EAACE,aACCL,EAACM,EAAgB,IACjBN,EAACO,GAAeb,aAAcA,IAC9BM,EAACQ,EAAgB,CAAA,MAEnBR,EAACS,EAAe,CACdR,MAAO,CAAES,gBAAiB,8BAA8BjB,SAEvDA,QAKX"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import{useSidebar as o,SidebarBody as e,List as t,ListItem as r}from"@studiocubics/components";import{usePathname as n}from"next/navigation";import s from"next/link";import{useScreenSize as m}from"@studiocubics/hooks";function c({sidebarLinks:c}){const{sidebarOpen:d,toggleSidebar:l}=o(),p=n(),h=m();return i(e,{children:i(t,{children:c.map((o,e)=>i(r,{LinkComponent:s,...o,onClick:h?.ltMedium&&!o.childNodes?.length&&d?l:void 0,shortened:!d,selected:o.href?p.startsWith(o.href):void 0},e))})})}export{c as CMSSidebarBody};
2
+ //# sourceMappingURL=CMSSidebarBody.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSSidebarBody.js","sources":["../../../../../src/client/ui/Layout/CMSSidebar/CMSSidebarBody.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n List,\n useSidebar,\n SidebarBody,\n ListItem,\n type ListItemProps,\n} from \"@studiocubics/components\";\nimport { usePathname } from \"next/navigation\";\nimport Link from \"next/link\";\nimport { useScreenSize } from \"@studiocubics/hooks\";\n\nexport function CMSSidebarBody({\n sidebarLinks,\n}: {\n sidebarLinks: ListItemProps[];\n}) {\n const { sidebarOpen, toggleSidebar } = useSidebar();\n const pathname = usePathname();\n const screenSize = useScreenSize();\n\n return (\n <SidebarBody>\n <List>\n {sidebarLinks.map((sl, i) => (\n <ListItem\n LinkComponent={Link}\n key={i}\n {...sl}\n onClick={\n screenSize?.ltMedium && !sl.childNodes?.length && sidebarOpen\n ? toggleSidebar\n : undefined\n }\n shortened={!sidebarOpen}\n selected={sl.href ? pathname.startsWith(sl.href) : undefined}\n />\n ))}\n </List>\n </SidebarBody>\n );\n}\n"],"names":["CMSSidebarBody","sidebarLinks","sidebarOpen","toggleSidebar","useSidebar","pathname","usePathname","screenSize","useScreenSize","_jsx","SidebarBody","List","map","sl","i","ListItem","LinkComponent","Link","onClick","ltMedium","childNodes","length","undefined","shortened","selected","href","startsWith"],"mappings":"+QAaM,SAAUA,GAAeC,aAC7BA,IAIA,MAAMC,YAAEA,EAAWC,cAAEA,GAAkBC,IACjCC,EAAWC,IACXC,EAAaC,IAEnB,OACEC,EAACC,YACCD,EAACE,YACEV,EAAaW,IAAI,CAACC,EAAIC,IACrBL,EAACM,EAAQ,CACPC,cAAeC,KAEXJ,EACJK,QACEX,GAAYY,WAAaN,EAAGO,YAAYC,QAAUnB,EAC9CC,OACAmB,EAENC,WAAYrB,EACZsB,SAAUX,EAAGY,KAAOpB,EAASqB,WAAWb,EAAGY,WAAQH,GAR9CR,OAcjB"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useMounted as o}from"@studiocubics/hooks";import{useSidebar as r,SidebarFooter as i,List as m,ThemeToggleListItem as s}from"@studiocubics/components";import{Monitor as c,Sun as n,Moon as u}from"lucide-react";import{useTheme as l}from"next-themes";import d from"./CMSSidebarFooter.module.css.js";import{CurrentSystemUserButton as a}from"../../../System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js";function h(){const{sidebarOpen:h}=r(),{theme:p,setTheme:f}=l(),{mounted:k}=o();if(k)return e(i,{children:t("div",{className:d.root,children:[p&&e(m,{children:e(s,{shortened:!h,currentTheme:p,themeObject:{dark:{icon:e(u,{}),onClick:()=>{f("dark")}},light:{icon:e(n,{}),onClick:()=>{f("light")}},system:{icon:e(c,{}),onClick:()=>{f("system")}}}})}),e(a,{clickable:!0,variant:h?"compact":"image-only"})]})})}export{h as CMSSidebarFooter};
2
+ //# sourceMappingURL=CMSSidebarFooter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSSidebarFooter.js","sources":["../../../../../../src/client/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.tsx"],"sourcesContent":["\"use client\";\n\nimport { useMounted } from \"@studiocubics/hooks\";\nimport {\n useSidebar,\n SidebarFooter,\n ThemeToggleListItem,\n type ThemeObject,\n List,\n} from \"@studiocubics/components\";\nimport { Moon, Sun, Monitor } from \"lucide-react\";\nimport { useTheme } from \"next-themes\";\nimport styles from \"./CMSSidebarFooter.module.css\";\nimport { CurrentSystemUserButton } from \"../../../System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton\";\n\nexport function CMSSidebarFooter() {\n const { sidebarOpen } = useSidebar();\n const { theme, setTheme } = useTheme();\n const { mounted } = useMounted();\n if (!mounted) return;\n return (\n <SidebarFooter>\n <div className={styles.root}>\n {theme && (\n <List>\n <ThemeToggleListItem\n shortened={!sidebarOpen}\n currentTheme={theme as keyof ThemeObject}\n themeObject={{\n dark: {\n icon: <Moon />,\n onClick: () => {\n setTheme(\"dark\");\n },\n },\n light: {\n icon: <Sun />,\n onClick: () => {\n setTheme(\"light\");\n },\n },\n system: {\n icon: <Monitor />,\n onClick: () => {\n setTheme(\"system\");\n },\n },\n }}\n />\n </List>\n )}\n <CurrentSystemUserButton\n clickable\n variant={sidebarOpen ? \"compact\" : \"image-only\"}\n />\n </div>\n </SidebarFooter>\n );\n}\n"],"names":["CMSSidebarFooter","sidebarOpen","useSidebar","theme","setTheme","useTheme","mounted","useMounted","_jsx","SidebarFooter","children","_jsxs","className","styles","root","List","ThemeToggleListItem","shortened","currentTheme","themeObject","dark","icon","Moon","onClick","light","Sun","system","Monitor","CurrentSystemUserButton","clickable","variant"],"mappings":"8eAegBA,IACd,MAAMC,YAAEA,GAAgBC,KAClBC,MAAEA,EAAKC,SAAEA,GAAaC,KACtBC,QAAEA,GAAYC,IACpB,GAAKD,EACL,OACEE,EAACC,EAAa,CAAAC,SACZC,EAAA,MAAA,CAAKC,UAAWC,EAAOC,KAAIJ,SAAA,CACxBP,GACCK,EAACO,EAAI,CAAAL,SACHF,EAACQ,EAAmB,CAClBC,WAAYhB,EACZiB,aAAcf,EACdgB,YAAa,CACXC,KAAM,CACJC,KAAMb,EAACc,EAAI,IACXC,QAAS,KACPnB,EAAS,UAGboB,MAAO,CACLH,KAAMb,EAACiB,EAAG,IACVF,QAAS,KACPnB,EAAS,WAGbsB,OAAQ,CACNL,KAAMb,EAACmB,EAAO,IACdJ,QAAS,KACPnB,EAAS,iBAOrBI,EAACoB,EAAuB,CACtBC,WAAS,EACTC,QAAS7B,EAAc,UAAY,mBAK7C"}
@@ -0,0 +1,2 @@
1
+ var o={root:"CMSSidebarFooter-module_root__ZMRx2"};export{o as default};
2
+ //# sourceMappingURL=CMSSidebarFooter.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CMSSidebarFooter.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"CMSSidebarFooter.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as o,jsx as r}from"react/jsx-runtime";import{useScreenSize as i}from"@studiocubics/hooks";import{useSidebar as e,SidebarHeader as s,CubicsUILogo as t,Button as c}from"@studiocubics/components";import m from"./CMSSidebarHeader.module.css.js";import{cn as l}from"@studiocubics/utils";import{PanelLeftClose as n,PanelLeftOpen as a}from"lucide-react";function u(){const{sidebarOpen:u,toggleSidebar:d}=e(),p=i();return o(s,{className:m.root,children:[r("div",{className:m.logoContainer,children:r(t,{onlyFavicon:!!p?.gtSmall&&!u,className:l(m.logo)})}),r(c,{square:!0,onClick:d,children:r(u?n:a,{})})]})}export{u as CMSSidebarHeader};
2
+ //# sourceMappingURL=CMSSidebarHeader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CMSSidebarHeader.js","sources":["../../../../../../src/client/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.tsx"],"sourcesContent":["\"use client\";\n\nimport { useScreenSize } from \"@studiocubics/hooks\";\nimport {\n Button,\n CubicsUILogo,\n SidebarHeader,\n useSidebar,\n} from \"@studiocubics/components\";\nimport styles from \"./CMSSidebarHeader.module.css\";\nimport { cn } from \"@studiocubics/utils\";\nimport { PanelLeftClose, PanelLeftOpen } from \"lucide-react\";\n\nexport function CMSSidebarHeader() {\n const { sidebarOpen, toggleSidebar } = useSidebar();\n const screen = useScreenSize();\n return (\n <SidebarHeader className={styles.root}>\n <div className={styles.logoContainer}>\n <CubicsUILogo\n onlyFavicon={screen?.gtSmall ? !sidebarOpen : false}\n className={cn(styles.logo)}\n />\n </div>\n <Button square onClick={toggleSidebar}>\n {sidebarOpen ? <PanelLeftClose /> : <PanelLeftOpen />}\n </Button>\n </SidebarHeader>\n );\n}\n"],"names":["CMSSidebarHeader","sidebarOpen","toggleSidebar","useSidebar","screen","useScreenSize","_jsxs","SidebarHeader","className","styles","root","children","_jsx","logoContainer","CubicsUILogo","onlyFavicon","gtSmall","cn","logo","Button","square","onClick","PanelLeftClose","PanelLeftOpen"],"mappings":"6XAagBA,IACd,MAAMC,YAAEA,EAAWC,cAAEA,GAAkBC,IACjCC,EAASC,IACf,OACEC,EAACC,EAAa,CAACC,UAAWC,EAAOC,KAAIC,SAAA,CACnCC,EAAA,MAAA,CAAKJ,UAAWC,EAAOI,cAAaF,SAClCC,EAACE,EAAY,CACXC,cAAaX,GAAQY,UAAWf,EAChCO,UAAWS,EAAGR,EAAOS,UAGzBN,EAACO,EAAM,CAACC,QAAM,EAACC,QAASnB,EAAaS,SACpBC,EAAdX,EAAeqB,EAAqBC,EAAP,QAItC"}
@@ -0,0 +1,2 @@
1
+ var o={root:"CMSSidebarHeader-module_root__QUbml",logoContainer:"CMSSidebarHeader-module_logoContainer__1tdc3",logo:"CMSSidebarHeader-module_logo__qCMLH"};export{o as default};
2
+ //# sourceMappingURL=CMSSidebarHeader.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CMSSidebarHeader.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"CMSSidebarHeader.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as e,jsx as r}from"react/jsx-runtime";import{useUser as i}from"@clerk/nextjs";import{Card as o,CubicsUILogo as t,TextInput as n,PasswordInput as a,Button as s,PoweredByBanner as d}from"@studiocubics/components";import{useRouter as c}from"next/navigation";import{useEffect as l}from"react";import m from"./SignIn.module.css.js";import{useSignInForm as u}from"./useSignInForm.js";import h from"next/link";function p(){const{user:p}=i(),f=c(),{formState:g,setFormState:b,pending:v,error:S,handleSubmit:x}=u();function N(e){const r=e.currentTarget;b({...g,[r.id]:r.value})}return l(()=>{p?.id&&f.push("/dashboard")},[p]),e(o,{size:"lg",className:m.root,children:[e("div",{className:m.body,children:[r(t,{width:"120px"}),e("header",{className:m.header,children:[r("h1",{children:"Sign in to your Account"}),r("p",{children:"Welcome Back! Lets get started."})]}),e("form",{onSubmit:x,className:m.form,children:[r("div",{id:"clerk-captcha"}),r(n,{label:"Email Address",id:"email",value:g.email,onChange:N,required:!0,fullWidth:!0,type:"email"}),r(a,{label:"Password",id:"password",value:g.password,onChange:N,required:!0,fullWidth:!0,disabled:v}),r(s,{type:"submit",variant:"contained",children:"Confirm"}),S&&r("p",{className:m.error,children:S})]})]}),e("div",{className:m.footer,children:[e("p",{children:["Dont have an account?"," ",r(h,{href:"/auth/requestAccount",children:"Request"})," one from an admin"]}),r(d,{})]})]})}export{p as SignIn};
2
+ //# sourceMappingURL=SignIn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignIn.js","sources":["../../../../../../src/client/ui/System/Auth/SignIn/SignIn.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@clerk/nextjs\";\nimport {\n Button,\n Card,\n CubicsUILogo,\n PasswordInput,\n TextInput,\n PoweredByBanner,\n} from \"@studiocubics/components\";\nimport { useRouter } from \"next/navigation\";\nimport { type ChangeEvent, useEffect } from \"react\";\nimport styles from \"./SignIn.module.css\";\nimport { useSignInForm } from \"./useSignInForm\";\nimport Link from \"next/link\";\n\nexport function SignIn() {\n const { user } = useUser();\n const router = useRouter();\n const { formState, setFormState, pending, error, handleSubmit } =\n useSignInForm();\n\n useEffect(() => {\n if (user?.id) {\n router.push(\"/dashboard\");\n }\n }, [user]);\n\n function handleFormStateChange(e: ChangeEvent<HTMLInputElement>) {\n const target = e.currentTarget as HTMLInputElement;\n setFormState({ ...formState, [target.id]: target.value });\n }\n\n return (\n <Card size=\"lg\" className={styles.root}>\n <div className={styles.body}>\n <CubicsUILogo width={\"120px\"} />\n <header className={styles.header}>\n <h1>Sign in to your Account</h1>\n <p>Welcome Back! Lets get started.</p>\n </header>\n <form onSubmit={handleSubmit} className={styles.form}>\n <div id=\"clerk-captcha\" />\n\n <TextInput\n label={\"Email Address\"}\n id=\"email\"\n value={formState.email}\n onChange={handleFormStateChange}\n required\n fullWidth\n type=\"email\"\n />\n <PasswordInput\n label={\"Password\"}\n id=\"password\"\n value={formState.password}\n onChange={handleFormStateChange}\n required\n fullWidth\n disabled={pending}\n />\n <Button type=\"submit\" variant=\"contained\">\n Confirm\n </Button>\n {error && <p className={styles.error}>{error}</p>}\n </form>\n </div>\n <div className={styles.footer}>\n <p>\n Dont have an account?{\" \"}\n <Link href={\"/auth/requestAccount\"}>Request</Link> one from an admin\n </p>\n <PoweredByBanner />\n </div>\n </Card>\n );\n}\n"],"names":["SignIn","user","useUser","router","useRouter","formState","setFormState","pending","error","handleSubmit","useSignInForm","handleFormStateChange","e","target","currentTarget","id","value","useEffect","push","_jsxs","Card","size","className","styles","root","body","children","_jsx","CubicsUILogo","width","header","onSubmit","form","TextInput","label","email","onChange","required","fullWidth","type","PasswordInput","password","disabled","Button","variant","footer","Link","href","PoweredByBanner"],"mappings":"qbAiBgBA,IACd,MAAMC,KAAEA,GAASC,IACXC,EAASC,KACTC,UAAEA,EAASC,aAAEA,EAAYC,QAAEA,EAAOC,MAAEA,EAAKC,aAAEA,GAC/CC,IAQF,SAASC,EAAsBC,GAC7B,MAAMC,EAASD,EAAEE,cACjBR,EAAa,IAAKD,EAAW,CAACQ,EAAOE,IAAKF,EAAOG,OACnD,CAEA,OAXAC,EAAU,KACJhB,GAAMc,IACRZ,EAAOe,KAAK,eAEb,CAACjB,IAQFkB,EAACC,EAAI,CAACC,KAAK,KAAKC,UAAWC,EAAOC,eAChCL,EAAA,MAAA,CAAKG,UAAWC,EAAOE,KAAIC,SAAA,CACzBC,EAACC,EAAY,CAACC,MAAO,UACrBV,EAAA,SAAA,CAAQG,UAAWC,EAAOO,iBACxBH,EAAA,KAAA,CAAAD,SAAA,4BACAC,uDAEFR,EAAA,OAAA,CAAMY,SAAUtB,EAAca,UAAWC,EAAOS,KAAIN,SAAA,CAClDC,EAAA,MAAA,CAAKZ,GAAG,kBAERY,EAACM,EAAS,CACRC,MAAO,gBACPnB,GAAG,QACHC,MAAOX,EAAU8B,MACjBC,SAAUzB,EACV0B,UAAQ,EACRC,WAAS,EACTC,KAAK,UAEPZ,EAACa,EAAa,CACZN,MAAO,WACPnB,GAAG,WACHC,MAAOX,EAAUoC,SACjBL,SAAUzB,EACV0B,YACAC,WAAS,EACTI,SAAUnC,IAEZoB,EAACgB,EAAM,CAACJ,KAAK,SAASK,QAAQ,YAAWlB,SAAA,YAGxClB,GAASmB,OAAGL,UAAWC,EAAOf,MAAKkB,SAAGlB,UAG3CW,EAAA,MAAA,CAAKG,UAAWC,EAAOsB,OAAMnB,SAAA,CAC3BP,yCACwB,IACtBQ,EAACmB,EAAI,CAACC,KAAM,uBAAsBrB,SAAA,YAAgB,wBAEpDC,EAACqB,WAIT"}
@@ -0,0 +1,2 @@
1
+ var o={root:"SignIn-module_root__QZuyy",body:"SignIn-module_body__2yvpI",header:"SignIn-module_header__XEjx6",form:"SignIn-module_form__IjD6r",footer:"SignIn-module_footer__KKVs7",error:"SignIn-module_error__q4xLf"};export{o as default};
2
+ //# sourceMappingURL=SignIn.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignIn.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"SignIn.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{useSignIn as e}from"@clerk/nextjs";import{useState as t}from"react";function r(){const r=e(),[o,n]=t({email:"",password:""}),[s,i]=t(!1),[a,c]=t("");return{formState:o,setFormState:n,pending:s,error:a,handleSubmit:async function(e){e.preventDefault();const{email:t,password:n}=o;if(r.isLoaded)try{i(!0);const e=await r.signIn.create({identifier:t,password:n});if("complete"!==e.status)throw new Error("Sign In failed to complete");await r.setActive({session:e.createdSessionId})}catch(e){console.error(e),e instanceof Error&&c(e.message)}finally{i(!1)}}}}export{r as useSignInForm};
2
+ //# sourceMappingURL=useSignInForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignInForm.js","sources":["../../../../../../src/client/ui/System/Auth/SignIn/useSignInForm.tsx"],"sourcesContent":["\"use client\";\n\nimport { useSignIn } from \"@clerk/nextjs\";\nimport { type FormEvent, useState } from \"react\";\n\nexport function useSignInForm() {\n const clerkSignIn = useSignIn();\n const [formState, setFormState] = useState({\n email: \"\",\n password: \"\",\n });\n const [pending, setPending] = useState(false);\n const [error, setError] = useState(\"\");\n\n async function handleSubmit(e: FormEvent) {\n e.preventDefault();\n const { email, password } = formState;\n if (!clerkSignIn.isLoaded) return;\n\n try {\n setPending(true);\n const signInAttempt = await clerkSignIn.signIn.create({\n identifier: email,\n password,\n });\n if (signInAttempt.status === \"complete\") {\n await clerkSignIn.setActive({\n session: signInAttempt.createdSessionId,\n });\n } else {\n throw new Error(\"Sign In failed to complete\");\n }\n } catch (err) {\n console.error(err);\n if (err instanceof Error) setError(err.message);\n } finally {\n setPending(false);\n }\n }\n\n return { formState, setFormState, pending, error, handleSubmit };\n}\n"],"names":["useSignInForm","clerkSignIn","useSignIn","formState","setFormState","useState","email","password","pending","setPending","error","setError","handleSubmit","async","e","preventDefault","isLoaded","signInAttempt","signIn","create","identifier","status","Error","setActive","session","createdSessionId","err","console","message"],"mappings":"iGAKgBA,IACd,MAAMC,EAAcC,KACbC,EAAWC,GAAgBC,EAAS,CACzCC,MAAO,GACPC,SAAU,MAELC,EAASC,GAAcJ,GAAS,IAChCK,EAAOC,GAAYN,EAAS,IA4BnC,MAAO,CAAEF,YAAWC,eAAcI,UAASE,QAAOE,aA1BlDC,eAA4BC,GAC1BA,EAAEC,iBACF,MAAMT,MAAEA,EAAKC,SAAEA,GAAaJ,EAC5B,GAAKF,EAAYe,SAEjB,IACEP,GAAW,GACX,MAAMQ,QAAsBhB,EAAYiB,OAAOC,OAAO,CACpDC,WAAYd,EACZC,aAEF,GAA6B,aAAzBU,EAAcI,OAKhB,MAAM,IAAIC,MAAM,oCAJVrB,EAAYsB,UAAU,CAC1BC,QAASP,EAAcQ,kBAK7B,CAAE,MAAOC,GACPC,QAAQjB,MAAMgB,GACVA,aAAeJ,OAAOX,EAASe,EAAIE,QACzC,SACEnB,GAAW,EACb,CACF,EAGF"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e,jsxs as i,Fragment as r}from"react/jsx-runtime";import{useUser as t}from"@clerk/nextjs";import{Card as a,TextInput as n,Button as l,PasswordInput as o,CubicsUILogo as d,PoweredByBanner as s}from"@studiocubics/components";import c from"next/link";import{useRouter as m}from"next/navigation";import{useState as h,useEffect as u}from"react";import f from"./SignUp.module.css.js";import{useSignUpForm as p}from"./useSignUpForm.js";function b(){const{user:b}=t(),g=m(),{ticket:v,setFormState:N,formState:k,pending:C,error:S,handleSubmit:W}=p(),[w,y]=h(0);if(u(()=>{b?.id&&g.push("/dashboard")},[b]),!v)return e(a,{size:"lg",className:f.root,children:i("p",{children:["Looks like you haven‘t been invited!",e("br",{})," Please ",e(c,{href:"/auth/requestAccount",children:"request"})," an invitation from an admin."]})});function q(e){N({...k,[e.target.id]:e.target.value})}const x=i(r,{children:[e(n,{label:"First Name",id:"firstName",value:k.firstName,onChange:q,required:!0,fullWidth:!0}),e(n,{label:"Last Name",id:"lastName",value:k.lastName,onChange:q,required:!0,fullWidth:!0}),e(l,{type:"button",variant:"contained",onClick:()=>y(1),fullWidth:!0,disabled:!k.firstName||!k.lastName,children:"Continue"})]}),P=i(r,{children:[e(o,{label:"Password",id:"password",value:k.password,onChange:q,required:!0,fullWidth:!0,disabled:C,disableStrengthMeter:!1}),e(o,{label:"Confirm Password",id:"confirmPassword",value:k.confirmPassword,onChange:q,required:!0,fullWidth:!0,disabled:C}),e(l,{disabled:C,variant:"contained",type:"submit",fullWidth:!0,children:"Register"})]});return i(a,{size:"lg",className:f.root,children:[i("div",{className:f.body,children:[e(d,{width:"120px"}),i("header",{className:f.header,children:[e("h1",{children:"Create your account"}),e("p",{children:"Welcome! Please fill in the details to get started."})]}),i("form",{onSubmit:W,className:f.form,children:[e("div",{id:"clerk-captcha"}),0==w&&x,1==w&&P,w>0&&e(l,{disabled:C,type:"button",onClick:()=>y(w-1),fullWidth:!0,children:"Go back"}),S&&e("p",{className:f.error,children:S})]})]}),i("div",{className:f.footer,children:[i("p",{children:["Already have an account? ",e(c,{href:"/auth/signIn/",children:"Sign In"})]}),e(s,{})]})]})}export{b as SignUp};
2
+ //# sourceMappingURL=SignUp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SignUp.js","sources":["../../../../../../src/client/ui/System/Auth/SignUp/SignUp.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@clerk/nextjs\";\nimport {\n Card,\n CubicsUILogo,\n TextInput,\n PasswordInput,\n Button,\n PoweredByBanner,\n} from \"@studiocubics/components\";\nimport Link from \"next/link\";\nimport { useRouter } from \"next/navigation\";\nimport { useState, useEffect, type ChangeEvent } from \"react\";\nimport styles from \"./SignUp.module.css\";\nimport { useSignUpForm } from \"./useSignUpForm\";\n\nexport function SignUp() {\n const { user } = useUser();\n const router = useRouter();\n const { ticket, setFormState, formState, pending, error, handleSubmit } =\n useSignUpForm();\n const [step, setStep] = useState(0);\n\n // Handle signed-in users visiting this page\n // This will also redirect the user once they finish the sign-up process\n useEffect(() => {\n if (user?.id) {\n router.push(\"/dashboard\");\n }\n }, [user]);\n\n // If there is no invitation ticket, restrict access to this page\n if (!ticket) {\n return (\n <Card size=\"lg\" className={styles.root}>\n <p>\n Looks like you haven&lsquo;t been invited!\n <br /> Please <Link href={\"/auth/requestAccount\"}>request</Link> an\n invitation from an admin.\n </p>\n </Card>\n );\n }\n\n function handleFormStateChange(e: ChangeEvent<HTMLInputElement>) {\n setFormState({ ...formState, [e.target.id]: e.target.value });\n }\n\n const Step0 = (\n <>\n <TextInput\n label={\"First Name\"}\n id=\"firstName\"\n value={formState.firstName}\n onChange={handleFormStateChange}\n required\n fullWidth\n />\n <TextInput\n label={\"Last Name\"}\n id=\"lastName\"\n value={formState.lastName}\n onChange={handleFormStateChange}\n required\n fullWidth\n />\n <Button\n type=\"button\"\n variant=\"contained\"\n onClick={() => setStep(1)}\n fullWidth\n disabled={!formState.firstName || !formState.lastName}\n >\n Continue\n </Button>\n </>\n );\n const Step1 = (\n <>\n <PasswordInput\n label={\"Password\"}\n id=\"password\"\n value={formState.password}\n onChange={handleFormStateChange}\n required\n fullWidth\n disabled={pending}\n disableStrengthMeter={false}\n />\n <PasswordInput\n label={\"Confirm Password\"}\n id=\"confirmPassword\"\n value={formState.confirmPassword}\n onChange={handleFormStateChange}\n required\n fullWidth\n disabled={pending}\n />\n <Button disabled={pending} variant=\"contained\" type=\"submit\" fullWidth>\n Register\n </Button>\n </>\n );\n return (\n <Card size=\"lg\" className={styles.root}>\n <div className={styles.body}>\n <CubicsUILogo width={\"120px\"} />\n <header className={styles.header}>\n <h1>Create your account</h1>\n <p>Welcome! Please fill in the details to get started.</p>\n </header>\n <form onSubmit={handleSubmit} className={styles.form}>\n <div id=\"clerk-captcha\" />\n {step == 0 && Step0}\n {step == 1 && Step1}\n {step > 0 && (\n <Button\n disabled={pending}\n type=\"button\"\n onClick={() => setStep(step - 1)}\n fullWidth\n >\n Go back\n </Button>\n )}\n {error && <p className={styles.error}>{error}</p>}\n </form>\n </div>\n <div className={styles.footer}>\n <p>\n Already have an account? <Link href={\"/auth/signIn/\"}>Sign In</Link>\n </p>\n <PoweredByBanner />\n </div>\n </Card>\n );\n}\n"],"names":["SignUp","user","useUser","router","useRouter","ticket","setFormState","formState","pending","error","handleSubmit","useSignUpForm","step","setStep","useState","useEffect","id","push","_jsx","Card","size","className","styles","root","children","_jsxs","Link","href","handleFormStateChange","e","target","value","Step0","_Fragment","TextInput","label","firstName","onChange","required","fullWidth","lastName","Button","type","variant","onClick","disabled","Step1","PasswordInput","password","disableStrengthMeter","confirmPassword","body","CubicsUILogo","width","header","onSubmit","form","footer","PoweredByBanner"],"mappings":"idAiBgBA,IACd,MAAMC,KAAEA,GAASC,IACXC,EAASC,KACTC,OAAEA,EAAMC,aAAEA,EAAYC,UAAEA,EAASC,QAAEA,EAAOC,MAAEA,EAAKC,aAAEA,GACvDC,KACKC,EAAMC,GAAWC,EAAS,GAWjC,GAPAC,EAAU,KACJd,GAAMe,IACRb,EAAOc,KAAK,eAEb,CAAChB,KAGCI,EACH,OACEa,EAACC,EAAI,CAACC,KAAK,KAAKC,UAAWC,EAAOC,KAAIC,SACpCC,EAAA,IAAA,CAAAD,SAAA,CAAA,uCAEEN,EAAA,KAAA,CAAA,GAAM,WAAQA,EAACQ,EAAI,CAACC,KAAM,uBAAsBH,SAAA,YAAgB,qCAOxE,SAASI,EAAsBC,GAC7BvB,EAAa,IAAKC,EAAW,CAACsB,EAAEC,OAAOd,IAAKa,EAAEC,OAAOC,OACvD,CAEA,MAAMC,EACJP,EAAAQ,EAAA,CAAAT,SAAA,CACEN,EAACgB,EAAS,CACRC,MAAO,aACPnB,GAAG,YACHe,MAAOxB,EAAU6B,UACjBC,SAAUT,EACVU,UAAQ,EACRC,eAEFrB,EAACgB,EAAS,CACRC,MAAO,YACPnB,GAAG,WACHe,MAAOxB,EAAUiC,SACjBH,SAAUT,EACVU,YACAC,WAAS,IAEXrB,EAACuB,GACCC,KAAK,SACLC,QAAQ,YACRC,QAAS,IAAM/B,EAAQ,GACvB0B,WAAS,EACTM,UAAWtC,EAAU6B,YAAc7B,EAAUiC,SAAQhB,SAAA,gBAMrDsB,EACJrB,eACEP,EAAC6B,GACCZ,MAAO,WACPnB,GAAG,WACHe,MAAOxB,EAAUyC,SACjBX,SAAUT,EACVU,UAAQ,EACRC,aACAM,SAAUrC,EACVyC,sBAAsB,IAExB/B,EAAC6B,GACCZ,MAAO,mBACPnB,GAAG,kBACHe,MAAOxB,EAAU2C,gBACjBb,SAAUT,EACVU,YACAC,WAAS,EACTM,SAAUrC,IAEZU,EAACuB,EAAM,CAACI,SAAUrC,EAASmC,QAAQ,YAAYD,KAAK,SAASH,WAAS,EAAAf,SAAA,gBAK1E,OACEC,EAACN,EAAI,CAACC,KAAK,KAAKC,UAAWC,EAAOC,KAAIC,SAAA,CACpCC,EAAA,MAAA,CAAKJ,UAAWC,EAAO6B,KAAI3B,SAAA,CACzBN,EAACkC,EAAY,CAACC,MAAO,UACrB5B,EAAA,SAAA,CAAQJ,UAAWC,EAAOgC,OAAM9B,SAAA,CAC9BN,EAAA,KAAA,CAAAM,SAAA,wBACAN,EAAA,IAAA,CAAAM,SAAA,2DAEFC,EAAA,OAAA,CAAM8B,SAAU7C,EAAcW,UAAWC,EAAOkC,KAAIhC,SAAA,CAClDN,EAAA,MAAA,CAAKF,GAAG,kBACC,GAARJ,GAAaoB,EACL,GAARpB,GAAakC,EACblC,EAAO,GACNM,EAACuB,EAAM,CACLI,SAAUrC,EACVkC,KAAK,SACLE,QAAS,IAAM/B,EAAQD,EAAO,GAC9B2B,WAAS,EAAAf,SAAA,YAKZf,GAASS,EAAA,IAAA,CAAGG,UAAWC,EAAOb,MAAKe,SAAGf,UAG3CgB,EAAA,MAAA,CAAKJ,UAAWC,EAAOmC,OAAMjC,SAAA,CAC3BC,EAAA,IAAA,CAAAD,SAAA,CAAA,4BAC2BN,EAACQ,EAAI,CAACC,KAAM,gBAAeH,SAAA,eAEtDN,EAACwC,EAAe,CAAA,QAIxB"}
@@ -0,0 +1,2 @@
1
+ var o={root:"SignUp-module_root__gyyhf",body:"SignUp-module_body__TciO0",header:"SignUp-module_header__ol6o4",form:"SignUp-module_form__8wMar",footer:"SignUp-module_footer__NhgL2",error:"SignUp-module_error__VRpFj"};export{o as default};
2
+ //# sourceMappingURL=SignUp.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SignUp.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"SignUp.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{useSignUp as t}from"@clerk/nextjs";import{useSearchParams as e}from"next/navigation";import{useState as r}from"react";function s(){const s=t(),[a,o]=r({firstName:"",lastName:"",password:"",confirmPassword:""}),[i,n]=r(!1),[c,m]=r(""),f=e().get("__clerk_ticket");return{formState:a,setFormState:o,pending:i,ticket:f,error:c,handleSubmit:async function(t){t.preventDefault();const{firstName:e,lastName:r,password:o,confirmPassword:i}=a;if(s.isLoaded&&f){if(o!=i)return m("Passwords dont match!");try{n(!0);const t=await s.signUp.create({strategy:"ticket",ticket:f,firstName:e,lastName:r,password:o});if("complete"!==t.status)throw new Error("Sign Up failed to complete");await s.setActive({session:t.createdSessionId})}catch(t){console.error(t),t instanceof Error&&m(t.message)}finally{n(!1)}}}}}export{s as useSignUpForm};
2
+ //# sourceMappingURL=useSignUpForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSignUpForm.js","sources":["../../../../../../src/client/ui/System/Auth/SignUp/useSignUpForm.tsx"],"sourcesContent":["\"use client\";\n\nimport { useSignUp } from \"@clerk/nextjs\";\nimport { useSearchParams } from \"next/navigation\";\nimport { type FormEvent, useState } from \"react\";\n\nexport function useSignUpForm() {\n const clerkSignUp = useSignUp();\n const [formState, setFormState] = useState({\n firstName: \"\",\n lastName: \"\",\n password: \"\",\n confirmPassword: \"\",\n });\n const [pending, setPending] = useState(false);\n const [error, setError] = useState(\"\");\n\n const ticket = useSearchParams().get(\"__clerk_ticket\");\n\n async function handleSubmit(e: FormEvent) {\n e.preventDefault();\n const { firstName, lastName, password, confirmPassword } = formState;\n if (!clerkSignUp.isLoaded) return;\n if (!ticket) return;\n if (password != confirmPassword) {\n return setError(\"Passwords dont match!\");\n }\n\n try {\n setPending(true);\n const signUpAttempt = await clerkSignUp.signUp.create({\n strategy: \"ticket\",\n ticket,\n firstName,\n lastName,\n password,\n });\n if (signUpAttempt.status === \"complete\") {\n await clerkSignUp.setActive({\n session: signUpAttempt.createdSessionId,\n });\n } else {\n throw new Error(\"Sign Up failed to complete\");\n }\n } catch (err) {\n console.error(err);\n if (err instanceof Error) setError(err.message);\n } finally {\n setPending(false);\n }\n }\n\n return { formState, setFormState, pending, ticket, error, handleSubmit };\n}\n"],"names":["useSignUpForm","clerkSignUp","useSignUp","formState","setFormState","useState","firstName","lastName","password","confirmPassword","pending","setPending","error","setError","ticket","useSearchParams","get","handleSubmit","async","e","preventDefault","isLoaded","signUpAttempt","signUp","create","strategy","status","Error","setActive","session","createdSessionId","err","console","message"],"mappings":"mJAMgBA,IACd,MAAMC,EAAcC,KACbC,EAAWC,GAAgBC,EAAS,CACzCC,UAAW,GACXC,SAAU,GACVC,SAAU,GACVC,gBAAiB,MAEZC,EAASC,GAAcN,GAAS,IAChCO,EAAOC,GAAYR,EAAS,IAE7BS,EAASC,IAAkBC,IAAI,kBAmCrC,MAAO,CAAEb,YAAWC,eAAcM,UAASI,SAAQF,QAAOK,aAjC1DC,eAA4BC,GAC1BA,EAAEC,iBACF,MAAMd,UAAEA,EAASC,SAAEA,EAAQC,SAAEA,EAAQC,gBAAEA,GAAoBN,EAC3D,GAAKF,EAAYoB,UACZP,EAAL,CACA,GAAIN,GAAYC,EACd,OAAOI,EAAS,yBAGlB,IACEF,GAAW,GACX,MAAMW,QAAsBrB,EAAYsB,OAAOC,OAAO,CACpDC,SAAU,SACVX,SACAR,YACAC,WACAC,aAEF,GAA6B,aAAzBc,EAAcI,OAKhB,MAAM,IAAIC,MAAM,oCAJV1B,EAAY2B,UAAU,CAC1BC,QAASP,EAAcQ,kBAK7B,CAAE,MAAOC,GACPC,QAAQpB,MAAMmB,GACVA,aAAeJ,OAAOd,EAASkB,EAAIE,QACzC,SACEtB,GAAW,EACb,CA1Ba,CA2Bf,EAGF"}
@@ -0,0 +1,2 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{invitationListReadAction as i}from"../../../../server/clerk/actions/invitations.js";import{InvitationListCard as r}from"./InvitationListCard.js";async function a(a){return(await i(a)).data.map(i=>t(r,{invitation:i},i.id))}export{a as InvitationList};
2
+ //# sourceMappingURL=InvitationList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationList.js","sources":["../../../../../src/client/ui/System/Invitations/InvitationList.tsx"],"sourcesContent":["import { invitationListReadAction } from \"../../../../server/clerk/actions/invitations\";\nimport { InvitationListCard } from \"./InvitationListCard\";\n\nexport async function InvitationList(params: ClerkInvitationListParams) {\n const invitationList = await invitationListReadAction(params);\n return invitationList.data.map((inv) => (\n <InvitationListCard key={inv.id} invitation={inv} />\n ));\n}\n"],"names":["async","InvitationList","params","invitationListReadAction","data","map","inv","_jsx","InvitationListCard","invitation","id"],"mappings":"gMAGOA,eAAeC,EAAeC,GAEnC,aAD6BC,EAAyBD,IAChCE,KAAKC,IAAKC,GAC9BC,EAACC,EAAkB,CAAcC,WAAYH,GAApBA,EAAII,IAEjC"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{useDisclosure as n}from"@studiocubics/hooks";import{Button as o,Dialog as s,ConfirmationForm as t,TextInput as l,Switch as a,Select as d}from"@studiocubics/components";import{Eye as c,EyeClosed as m,Ban as u,UserPlus as p}from"lucide-react";import h from"next/link";import{initialiseForm as f,toCapitalised as b}from"@studiocubics/utils";import{useActionState as v,useEffect as k}from"react";import{invitationDeleteAction as y,invitationCreateAction as I}from"../../../../server/clerk/actions/invitations.js";import{roles as C}from"../../../clerk/rbacConfig.js";function x({status:n}){const s="revoked"==n;return e(r,{children:[i(h,{href:"?status="+(s?"":"revoked"),children:e(o,{startIcon:i(s?c:m,{}),size:"sm",color:s?"primary":void 0,children:[s?"Hide":"Show"," Revoked"]})}),i(w,{})]})}function g({id:l}){const{open:a,handleOpen:d,handleStrictClose:c,handleClose:m}=n(),[p,h,b]=v(y.bind(null,l),f());return k(()=>{p.success&&m()},[p]),e(r,{children:[i(o,{color:"error",type:"submit",startIcon:i(u,{}),onClick:d,disabled:b,children:"Revoke Invitation"}),i(s,{open:a,onClose:c,children:i(t,{variant:"danger",onCancel:m,action:h,formTitle:"Revoke Invitation",confirmText:"Revoke",disabled:b,children:"Are you sure you want to revoke this invitation?"})})]})}const E=f("emailAddress","expiresInDays","role");function w(){const{open:c,handleOpen:m,handleStrictClose:u,handleClose:h}=n(),[f,y,x]=v(I,E);return k(()=>{f.success&&h()},[f]),e(r,{children:[i(o,{size:"sm",startIcon:i(p,{}),variant:"contained",onClick:m,children:"Invite New"}),i(s,{open:c,onClose:u,children:e(t,{onCancel:h,action:y,formTitle:"Invite New",disabled:x,children:[i(l,{required:!0,type:"email",name:"emailAddress",label:"Email Address",disabled:x,error:f.fieldErrors?.emailAddress}),i(l,{type:"number",name:"expiresInDays",label:"Expires in Days",endIcon:i("strong",{children:"Days  "}),defaultValue:30,disabled:x,error:f.fieldErrors?.expiresInDays}),i(a,{name:"ignoreExisting",label:"Ignore Existing Invites",disabled:x}),i(a,{name:"notify",value:!0,label:"Notify with email",disabled:x}),i(d,{name:"role",label:"Select Role to assign user on sign up",disabled:x,error:f.fieldErrors?.role,children:C.map(e=>i("option",{value:e,children:b(e)},e))})]})})]})}export{w as InvitationCreateDialog,x as InvitationListActions,g as InvitationRevokeDialog};
2
+ //# sourceMappingURL=InvitationListActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationListActions.js","sources":["../../../../../src/client/ui/System/Invitations/InvitationListActions.tsx"],"sourcesContent":["\"use client\";\n\nimport { useDisclosure } from \"@studiocubics/hooks\";\nimport {\n Button,\n Dialog,\n Switch,\n TextInput,\n ConfirmationForm,\n Select,\n} from \"@studiocubics/components\";\nimport { Ban, Eye, EyeClosed, UserPlus } from \"lucide-react\";\nimport Link from \"next/link\";\nimport type { Invitation } from \"@clerk/nextjs/server\";\nimport { initialiseForm, toCapitalised } from \"@studiocubics/utils\";\nimport { useActionState, useEffect } from \"react\";\nimport {\n invitationDeleteAction,\n invitationCreateAction,\n} from \"../../../../server/clerk/actions/invitations\";\nimport { roles } from \"../../../clerk/rbacConfig\";\n\nexport function InvitationListActions({\n status,\n}: {\n status: ClerkInvitationListParams[\"status\"];\n}) {\n const isShowRevoked = status == \"revoked\";\n return (\n <>\n <Link href={`?status=${!isShowRevoked ? \"revoked\" : \"\"}`}>\n <Button\n startIcon={isShowRevoked ? <Eye /> : <EyeClosed />}\n size=\"sm\"\n color={isShowRevoked ? \"primary\" : undefined}\n >\n {isShowRevoked ? \"Hide\" : \"Show\"} Revoked\n </Button>\n </Link>\n <InvitationCreateDialog />\n </>\n );\n}\nexport function InvitationRevokeDialog({ id }: { id: Invitation[\"id\"] }) {\n const { open, handleOpen, handleStrictClose, handleClose } = useDisclosure();\n const [state, action, pending] = useActionState(\n invitationDeleteAction.bind(null, id),\n initialiseForm(),\n );\n useEffect(() => {\n if (state.success) {\n handleClose();\n }\n }, [state]);\n return (\n <>\n <Button\n color=\"error\"\n type=\"submit\"\n startIcon={<Ban />}\n onClick={handleOpen}\n disabled={pending}\n >\n Revoke Invitation\n </Button>\n <Dialog open={open} onClose={handleStrictClose}>\n <ConfirmationForm\n variant=\"danger\"\n onCancel={handleClose}\n action={action}\n formTitle=\"Revoke Invitation\"\n confirmText=\"Revoke\"\n disabled={pending}\n >\n Are you sure you want to revoke this invitation?\n </ConfirmationForm>\n </Dialog>\n </>\n );\n}\nconst initialInvitationCreateState = initialiseForm(\n \"emailAddress\",\n \"expiresInDays\",\n \"role\",\n);\nexport type InvitationCreateState = typeof initialInvitationCreateState;\nexport function InvitationCreateDialog() {\n const { open, handleOpen, handleStrictClose, handleClose } = useDisclosure();\n const [state, action, pending] = useActionState<\n InvitationCreateState,\n FormData\n >(invitationCreateAction, initialInvitationCreateState);\n useEffect(() => {\n if (state.success) {\n handleClose();\n }\n }, [state]);\n return (\n <>\n <Button\n size=\"sm\"\n startIcon={<UserPlus />}\n variant=\"contained\"\n onClick={handleOpen}\n >\n Invite New\n </Button>\n <Dialog open={open} onClose={handleStrictClose}>\n <ConfirmationForm\n onCancel={handleClose}\n action={action}\n formTitle=\"Invite New\"\n disabled={pending}\n >\n <TextInput\n required\n type=\"email\"\n name=\"emailAddress\"\n label=\"Email Address\"\n disabled={pending}\n error={state.fieldErrors?.emailAddress}\n />\n <TextInput\n type=\"number\"\n name=\"expiresInDays\"\n label=\"Expires in Days\"\n endIcon={<strong>Days&nbsp;&nbsp;</strong>}\n defaultValue={30}\n disabled={pending}\n error={state.fieldErrors?.expiresInDays}\n />\n <Switch\n name=\"ignoreExisting\"\n label=\"Ignore Existing Invites\"\n disabled={pending}\n />\n <Switch\n name=\"notify\"\n value={true}\n label=\"Notify with email\"\n disabled={pending}\n />\n <Select\n name=\"role\"\n label=\"Select Role to assign user on sign up\"\n disabled={pending}\n error={state.fieldErrors?.role}\n >\n {roles.map((r) => (\n <option key={r} value={r}>\n {toCapitalised(r)}\n </option>\n ))}\n </Select>\n </ConfirmationForm>\n </Dialog>\n </>\n );\n}\n\n// emailAddress: string;\n// expiresInDays?: number;\n// ignoreExisting?: boolean;\n// notify?: boolean;\n// publicMetadata?: UserPublicMetadata;\n// redirectUrl?: string;\n// templateSlug?: \"invitation\" | \"waitlist_invitation\";\n"],"names":["InvitationListActions","status","isShowRevoked","_jsxs","_Fragment","children","_jsx","Link","href","Button","startIcon","Eye","EyeClosed","size","color","undefined","InvitationCreateDialog","InvitationRevokeDialog","id","open","handleOpen","handleStrictClose","handleClose","useDisclosure","state","action","pending","useActionState","invitationDeleteAction","bind","initialiseForm","useEffect","success","type","Ban","onClick","disabled","Dialog","onClose","ConfirmationForm","variant","onCancel","formTitle","confirmText","initialInvitationCreateState","invitationCreateAction","UserPlus","TextInput","required","name","label","error","fieldErrors","emailAddress","endIcon","defaultValue","expiresInDays","Switch","value","Select","role","roles","map","r","toCapitalised"],"mappings":"soBAsBM,SAAUA,GAAsBC,OACpCA,IAIA,MAAMC,EAA0B,WAAVD,EACtB,OACEE,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,GAAKC,KAAM,YAAYN,EAA4B,GAAZ,WAAgBG,SACtDF,EAACM,EAAM,CACLC,UAA2BJ,EAAhBJ,EAAiBS,EAAUC,EAAP,CAAA,GAC/BC,KAAK,KACLC,MAAOZ,EAAgB,eAAYa,EAASV,SAAA,CAE3CH,EAAgB,OAAS,OAAM,gBAGpCI,EAACU,EAAsB,MAG7B,CACM,SAAUC,GAAuBC,GAAEA,IACvC,MAAMC,KAAEA,EAAIC,WAAEA,EAAUC,kBAAEA,EAAiBC,YAAEA,GAAgBC,KACtDC,EAAOC,EAAQC,GAAWC,EAC/BC,EAAuBC,KAAK,KAAMX,GAClCY,KAOF,OALAC,EAAU,KACJP,EAAMQ,SACRV,KAED,CAACE,IAEFrB,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACG,GACCK,MAAM,QACNmB,KAAK,SACLvB,UAAWJ,EAAC4B,EAAG,CAAA,GACfC,QAASf,EACTgB,SAAUV,EAAOrB,SAAA,sBAInBC,EAAC+B,EAAM,CAAClB,KAAMA,EAAMmB,QAASjB,EAAiBhB,SAC5CC,EAACiC,EAAgB,CACfC,QAAQ,SACRC,SAAUnB,EACVG,OAAQA,EACRiB,UAAU,oBACVC,YAAY,SACZP,SAAUV,EAAOrB,SAAA,yDAO3B,CACA,MAAMuC,EAA+Bd,EACnC,eACA,gBACA,iBAGcd,IACd,MAAMG,KAAEA,EAAIC,WAAEA,EAAUC,kBAAEA,EAAiBC,YAAEA,GAAgBC,KACtDC,EAAOC,EAAQC,GAAWC,EAG/BkB,EAAwBD,GAM1B,OALAb,EAAU,KACJP,EAAMQ,SACRV,KAED,CAACE,IAEFrB,eACEG,EAACG,GACCI,KAAK,KACLH,UAAWJ,EAACwC,EAAQ,CAAA,GACpBN,QAAQ,YACRL,QAASf,EAAUf,SAAA,eAIrBC,EAAC+B,EAAM,CAAClB,KAAMA,EAAMmB,QAASjB,EAAiBhB,SAC5CF,EAACoC,GACCE,SAAUnB,EACVG,OAAQA,EACRiB,UAAU,aACVN,SAAUV,EAAOrB,SAAA,CAEjBC,EAACyC,EAAS,CACRC,UAAQ,EACRf,KAAK,QACLgB,KAAK,eACLC,MAAM,gBACNd,SAAUV,EACVyB,MAAO3B,EAAM4B,aAAaC,eAE5B/C,EAACyC,EAAS,CACRd,KAAK,SACLgB,KAAK,gBACLC,MAAM,kBACNI,QAAShD,EAAA,SAAA,CAAAD,SAAA,WACTkD,aAAc,GACdnB,SAAUV,EACVyB,MAAO3B,EAAM4B,aAAaI,gBAE5BlD,EAACmD,EAAM,CACLR,KAAK,iBACLC,MAAM,0BACNd,SAAUV,IAEZpB,EAACmD,EAAM,CACLR,KAAK,SACLS,OAAO,EACPR,MAAM,oBACNd,SAAUV,IAEZpB,EAACqD,EAAM,CACLV,KAAK,OACLC,MAAM,wCACNd,SAAUV,EACVyB,MAAO3B,EAAM4B,aAAaQ,KAAIvD,SAE7BwD,EAAMC,IAAKC,GACVzD,YAAgBoD,MAAOK,EAAC1D,SACrB2D,EAAcD,IADJA,aAS3B"}
@@ -0,0 +1,2 @@
1
+ import{jsxs as t,jsx as i,Fragment as e}from"react/jsx-runtime";import{AccordionItem as d,SectionWrapper as r,LabeledValue as n,Chip as a,CopyableText as l,CollectionItemCard as s,Tooltip as o}from"@studiocubics/components";import{toCapitalised as c,formatDate as u,relativeTime as m}from"@studiocubics/utils";import{InvitationRevokeDialog as h}from"./InvitationListActions.js";import{ThemedMonacoEditor as p}from"../../Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js";function b({invitation:b}){return t(d,{summary:i(s,{id:b.id,title:b.emailAddress,subtitle:t(e,{children:["Invited ",i(o,{children:i("span",{children:m(b.createdAt)})})]}),chip:c(b.status),description:i("span",{})}),name:"InvitationListCard",children:[t(r,{title:"Basic Details",noBorders:!0,children:[i(n,{label:"Id",children:b.id}),i(n,{label:"Email Address",children:b.emailAddress}),i(n,{label:"Status",children:i(a,{color:"accepted"==b.status?"primary":"pending"==b.status?"secondary":"error",children:i("strong",{children:c(b.status)})})})]}),t(r,{title:"Timestamps",children:[i(n,{label:"Created At",children:u(b.createdAt)}),i(n,{label:"Updated At",children:u(b.updatedAt)})]}),i(r,{title:"Invite Link",children:i(l,{children:b.url??"No link found!"})}),i(r,{title:"Public Metadata",children:i(p,{options:{readOnly:!0},height:"10vh",defaultLanguage:"json",defaultValue:JSON.stringify(b.publicMetadata)})}),"pending"==b.status&&i(h,{id:b.id})]})}export{b as InvitationListCard};
2
+ //# sourceMappingURL=InvitationListCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationListCard.js","sources":["../../../../../src/client/ui/System/Invitations/InvitationListCard.tsx"],"sourcesContent":["import type { Invitation } from \"@clerk/nextjs/server\";\nimport {\n AccordionItem,\n Chip,\n CollectionItemCard,\n CopyableText,\n LabeledValue,\n SectionWrapper,\n Tooltip,\n} from \"@studiocubics/components\";\nimport { formatDate, relativeTime, toCapitalised } from \"@studiocubics/utils\";\nimport { InvitationRevokeDialog } from \"./InvitationListActions\";\nimport { ThemedMonacoEditor } from \"../../Inputs/ThemedMonacoEditor/ThemedMonacoEditor\";\n\nexport function InvitationListCard({ invitation }: { invitation: Invitation }) {\n return (\n <AccordionItem\n summary={\n <CollectionItemCard\n id={invitation.id}\n title={invitation.emailAddress}\n subtitle={\n <>\n Invited&thinsp;\n <Tooltip>\n <span>{relativeTime(invitation.createdAt)}</span>\n </Tooltip>\n </>\n }\n chip={toCapitalised(invitation.status)}\n description={<span></span>}\n />\n }\n name=\"InvitationListCard\"\n >\n <SectionWrapper title={\"Basic Details\"} noBorders>\n <LabeledValue label={\"Id\"}>{invitation.id}</LabeledValue>\n <LabeledValue label={\"Email Address\"}>\n {invitation.emailAddress}\n </LabeledValue>\n <LabeledValue label={\"Status\"}>\n <Chip\n color={\n invitation.status == \"accepted\"\n ? \"primary\"\n : invitation.status == \"pending\"\n ? \"secondary\"\n : \"error\"\n }\n >\n <strong>{toCapitalised(invitation.status)}</strong>\n </Chip>\n </LabeledValue>\n </SectionWrapper>\n <SectionWrapper title={\"Timestamps\"}>\n <LabeledValue label={\"Created At\"}>\n {formatDate(invitation.createdAt)}\n </LabeledValue>\n <LabeledValue label={\"Updated At\"}>\n {formatDate(invitation.updatedAt)}\n </LabeledValue>\n </SectionWrapper>\n <SectionWrapper title={\"Invite Link\"}>\n <CopyableText>{invitation.url ?? \"No link found!\"}</CopyableText>\n </SectionWrapper>\n <SectionWrapper title={\"Public Metadata\"}>\n <ThemedMonacoEditor\n options={{ readOnly: true }}\n height=\"10vh\"\n defaultLanguage=\"json\"\n defaultValue={JSON.stringify(invitation.publicMetadata)}\n />\n </SectionWrapper>\n {invitation.status == \"pending\" && (\n <InvitationRevokeDialog id={invitation.id} />\n )}\n </AccordionItem>\n );\n}\n"],"names":["InvitationListCard","invitation","_jsxs","AccordionItem","summary","_jsx","CollectionItemCard","id","title","emailAddress","subtitle","_Fragment","children","Tooltip","relativeTime","createdAt","chip","toCapitalised","status","description","name","SectionWrapper","noBorders","LabeledValue","label","Chip","color","formatDate","updatedAt","CopyableText","url","ThemedMonacoEditor","options","readOnly","height","defaultLanguage","defaultValue","JSON","stringify","publicMetadata","InvitationRevokeDialog"],"mappings":"qdAcM,SAAUA,GAAmBC,WAAEA,IACnC,OACEC,EAACC,EAAa,CACZC,QACEC,EAACC,EAAkB,CACjBC,GAAIN,EAAWM,GACfC,MAAOP,EAAWQ,aAClBC,SACER,EAAAS,EAAA,CAAAC,SAAA,CAAA,WAEEP,EAACQ,EAAO,CAAAD,SACNP,EAAA,OAAA,CAAAO,SAAOE,EAAab,EAAWc,kBAIrCC,KAAMC,EAAchB,EAAWiB,QAC/BC,YAAad,EAAA,OAAA,CAAA,KAGjBe,KAAK,+BAELlB,EAACmB,GAAeb,MAAO,gBAAiBc,WAAS,EAAAV,SAAA,CAC/CP,EAACkB,EAAY,CAACC,MAAO,KAAIZ,SAAGX,EAAWM,KACvCF,EAACkB,GAAaC,MAAO,gBAAeZ,SACjCX,EAAWQ,eAEdJ,EAACkB,EAAY,CAACC,MAAO,SAAQZ,SAC3BP,EAACoB,EAAI,CACHC,MACuB,YAArBzB,EAAWiB,OACP,UACqB,WAArBjB,EAAWiB,OACT,YACA,QAAON,SAGfP,EAAA,SAAA,CAAAO,SAASK,EAAchB,EAAWiB,iBAIxChB,EAACmB,EAAc,CAACb,MAAO,aAAYI,SAAA,CACjCP,EAACkB,EAAY,CAACC,MAAO,sBAClBG,EAAW1B,EAAWc,aAEzBV,EAACkB,EAAY,CAACC,MAAO,aAAYZ,SAC9Be,EAAW1B,EAAW2B,gBAG3BvB,EAACgB,EAAc,CAACb,MAAO,cAAaI,SAClCP,EAACwB,EAAY,CAAAjB,SAAEX,EAAW6B,KAAO,qBAEnCzB,EAACgB,EAAc,CAACb,MAAO,kBAAiBI,SACtCP,EAAC0B,EAAkB,CACjBC,QAAS,CAAEC,UAAU,GACrBC,OAAO,OACPC,gBAAgB,OAChBC,aAAcC,KAAKC,UAAUrC,EAAWsC,oBAGtB,WAArBtC,EAAWiB,QACVb,EAACmC,EAAsB,CAACjC,GAAIN,EAAWM,OAI/C"}
@@ -0,0 +1,2 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{INVITATIONS_PAGE_LIMIT as i}from"../../../constants/pageLimits.js";import{PageLayoutPagination as s}from"@studiocubics/components";import{InvitationListPagination as o}from"./InvitationListPagination.js";import{InvitationList as n}from"./InvitationList.js";import{InvitationListActions as r}from"./InvitationListActions.js";async function a({searchParams:a,securityLinks:m}){const e=await a,c=e.status,p=Number(e.page??1),u={limit:i,offset:(p-1)*i,status:c};return t(s,{size:"sm",title:m[3]?.children,actions:t(r,{status:c}),paginationComponent:t(o,{page:p,...u}),children:t(n,{...u})})}export{a as InvitationListPage};
2
+ //# sourceMappingURL=InvitationListPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationListPage.js","sources":["../../../../../src/client/ui/System/Invitations/InvitationListPage.tsx"],"sourcesContent":["import { INVITATIONS_PAGE_LIMIT as limit } from \"../../../constants/pageLimits\";\nimport { PageLayoutPagination } from \"@studiocubics/components\";\nimport { InvitationListPagination } from \"./InvitationListPagination\";\nimport { InvitationList } from \"./InvitationList\";\nimport type { SecurityPageProps } from \"../types\";\nimport { InvitationListActions } from \"./InvitationListActions\";\n\nexport async function InvitationListPage({\n searchParams,\n securityLinks,\n}: SecurityPageProps) {\n const sp = await searchParams;\n const status = sp.status as ClerkInvitationListParams[\"status\"];\n const page = Number(sp.page ?? 1);\n const offset = (page - 1) * limit;\n const params = {\n limit,\n offset,\n status,\n };\n\n return (\n <PageLayoutPagination\n size=\"sm\"\n title={securityLinks[3]?.children}\n actions={<InvitationListActions status={status} />}\n paginationComponent={<InvitationListPagination page={page} {...params} />}\n >\n <InvitationList {...params} />\n </PageLayoutPagination>\n );\n}\n"],"names":["async","InvitationListPage","searchParams","securityLinks","sp","status","page","Number","params","limit","offset","_jsx","PageLayoutPagination","size","title","children","actions","InvitationListActions","paginationComponent","InvitationListPagination","InvitationList"],"mappings":"mXAOOA,eAAeC,GAAmBC,aACvCA,EAAYC,cACZA,IAEA,MAAMC,QAAWF,EACXG,EAASD,EAAGC,OACZC,EAAOC,OAAOH,EAAGE,MAAQ,GAEzBE,EAAS,OACbC,EACAC,QAHcJ,EAAO,GAAKG,EAI1BJ,UAGF,OACEM,EAACC,EAAoB,CACnBC,KAAK,KACLC,MAAOX,EAAc,IAAIY,SACzBC,QAASL,EAACM,EAAqB,CAACZ,OAAQA,IACxCa,oBAAqBP,EAACQ,EAAwB,CAACb,KAAMA,KAAUE,aAE/DG,EAACS,MAAmBZ,KAG1B"}
@@ -0,0 +1,2 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{NextSSRPagination as i}from"@studiocubics/next";import{invitationListReadAction as o}from"../../../../server/clerk/actions/invitations.js";async function r({page:r,...n}){const a=await o(n);return t(i,{page:r,limit:n.limit,total:a.totalCount})}export{r as InvitationListPagination};
2
+ //# sourceMappingURL=InvitationListPagination.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InvitationListPagination.js","sources":["../../../../../src/client/ui/System/Invitations/InvitationListPagination.tsx"],"sourcesContent":["import { NextSSRPagination } from \"@studiocubics/next\";\nimport { invitationListReadAction } from \"../../../../server/clerk/actions/invitations\";\n\nexport async function InvitationListPagination({\n page,\n ...params\n}: {\n page: number;\n limit: number;\n} & ClerkInvitationListParams) {\n const invitationList = await invitationListReadAction(params);\n return (\n <NextSSRPagination\n page={page}\n limit={params.limit}\n total={invitationList.totalCount}\n />\n );\n}\n"],"names":["async","InvitationListPagination","page","params","invitationList","invitationListReadAction","_jsx","NextSSRPagination","limit","total","totalCount"],"mappings":"0LAGOA,eAAeC,GAAyBC,KAC7CA,KACGC,IAKH,MAAMC,QAAuBC,EAAyBF,GACtD,OACEG,EAACC,EAAiB,CAChBL,KAAMA,EACNM,MAAOL,EAAOK,MACdC,MAAOL,EAAeM,YAG5B"}
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{AccordionItem as e,SectionWrapper as o,CollectionItemCard as s}from"@studiocubics/components";import{RolePermissionsTable as i}from"./RolePermissionsTable.js";function t(t){const{role:m,rbacConfig:n}=t;return r(e,{name:"RoleCard",summary:r(s,{title:m,chip:n.isSystem?"System User":"",description:n.desc}),children:r(o,{title:`${m}'s Permissions`,noBorders:!0,children:r(i,{...t})})})}export{t as RoleListCard};
2
+ //# sourceMappingURL=RoleListCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoleListCard.js","sources":["../../../../../src/client/ui/System/Permissions/RoleListCard.tsx"],"sourcesContent":["import {\n AccordionItem,\n CollectionItemCard,\n SectionWrapper,\n} from \"@studiocubics/components\";\nimport { RolePermissionsTable } from \"./RolePermissionsTable\";\nimport type { Role, RoleDoc } from \"../../../clerk/rbacConfig\";\n\nexport interface RoleCardProps {\n role: Role;\n rbacConfig: RoleDoc;\n}\n\nexport function RoleListCard(props: RoleCardProps) {\n const { role, rbacConfig } = props;\n\n return (\n <AccordionItem\n name=\"RoleCard\"\n summary={\n <CollectionItemCard\n title={role}\n chip={rbacConfig.isSystem ? \"System User\" : \"\"}\n description={rbacConfig.desc}\n />\n }\n >\n <SectionWrapper title={`${role}'s Permissions`} noBorders>\n <RolePermissionsTable {...props} />\n </SectionWrapper>\n </AccordionItem>\n );\n}\n"],"names":["RoleListCard","props","role","rbacConfig","_jsx","AccordionItem","name","summary","CollectionItemCard","title","chip","isSystem","description","desc","children","SectionWrapper","noBorders","RolePermissionsTable"],"mappings":"8MAaM,SAAUA,EAAaC,GAC3B,MAAMC,KAAEA,EAAIC,WAAEA,GAAeF,EAE7B,OACEG,EAACC,EAAa,CACZC,KAAK,WACLC,QACEH,EAACI,EAAkB,CACjBC,MAAOP,EACPQ,KAAMP,EAAWQ,SAAW,cAAgB,GAC5CC,YAAaT,EAAWU,OACxBC,SAGJV,EAACW,EAAc,CAACN,MAAO,GAAGP,kBAAsBc,WAAS,EAAAF,SACvDV,EAACa,EAAoB,IAAKhB,OAIlC"}
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{PageLayoutPagination as o}from"@studiocubics/components";import{RoleListCard as t}from"./RoleListCard.js";import{RBAC_CONFIG as i}from"../../../clerk/rbacConfig.js";function e({securityLinks:e}){return r(o,{size:"sm",title:e[1]?.children,children:Object.keys(i).map(o=>{const e=i[o];return r(t,{role:o,rbacConfig:e},o)})})}export{e as RolePermissionsPage};
2
+ //# sourceMappingURL=RolePermissionsPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RolePermissionsPage.js","sources":["../../../../../src/client/ui/System/Permissions/RolePermissionsPage.tsx"],"sourcesContent":["import { PageLayoutPagination, type TabProps } from \"@studiocubics/components\";\nimport { RoleListCard } from \"./RoleListCard\";\nimport { RBAC_CONFIG } from \"../../../clerk/rbacConfig\";\n\nexport function RolePermissionsPage({\n securityLinks,\n}: {\n securityLinks: TabProps[];\n}) {\n return (\n <PageLayoutPagination size=\"sm\" title={securityLinks[1]?.children}>\n {(Object.keys(RBAC_CONFIG) as (keyof typeof RBAC_CONFIG)[]).map((k) => {\n const item = RBAC_CONFIG[k];\n return <RoleListCard key={k} role={k} rbacConfig={item} />;\n })}\n </PageLayoutPagination>\n );\n}\n"],"names":["RolePermissionsPage","securityLinks","_jsx","PageLayoutPagination","size","title","children","Object","keys","RBAC_CONFIG","map","k","item","RoleListCard","role","rbacConfig"],"mappings":"oNAIM,SAAUA,GAAoBC,cAClCA,IAIA,OACEC,EAACC,EAAoB,CAACC,KAAK,KAAKC,MAAOJ,EAAc,IAAIK,SAAQA,SAC7DC,OAAOC,KAAKC,GAA8CC,IAAKC,IAC/D,MAAMC,EAAOH,EAAYE,GACzB,OAAOT,EAACW,EAAY,CAASC,KAAMH,EAAGI,WAAYH,GAAxBD,MAIlC"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e}from"react/jsx-runtime";import{Check as t,X as r}from"lucide-react";import{useCallback as o,useMemo as a}from"react";import{Table as s}from"@studiocubics/components";function i({rbacConfig:i}){const c=i.permissions,n=o(o=>e(o?t:r,{}),[]),m=a(()=>[["","create","delete","read","update"],...c.map(e=>[e.resource,n(e.actions.create),n(e.actions.delete),n(e.actions.read),n(e.actions.update)])],[c]);return c&&c.length?e(s,{data:m}):e("p",{children:"This is a root system user role, all resource actions are permitted to anyone with this role. Make sure to always have atleast one admin user."})}export{i as RolePermissionsTable};
2
+ //# sourceMappingURL=RolePermissionsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RolePermissionsTable.js","sources":["../../../../../src/client/ui/System/Permissions/RolePermissionsTable.tsx"],"sourcesContent":["\"use client\";\n\nimport { Check, X } from \"lucide-react\";\nimport type { RoleCardProps } from \"./RoleListCard\";\nimport { useCallback, useMemo } from \"react\";\nimport { Table, type TableData } from \"@studiocubics/components\";\n\nexport function RolePermissionsTable({ rbacConfig }: RoleCardProps) {\n const permissions = rbacConfig.permissions;\n const icon = useCallback((check?: boolean) => {\n return check ? <Check /> : <X />;\n }, []);\n const tableData: TableData = useMemo(\n () => [\n [\"\", \"create\", \"delete\", \"read\", \"update\"],\n ...permissions.map((p) => [\n p.resource,\n icon(p.actions.create),\n icon(p.actions.delete),\n icon(p.actions.read),\n icon(p.actions.update),\n ]),\n ],\n [permissions],\n );\n\n if (!permissions || !permissions.length)\n return (\n <p>\n This is a root system user role, all resource actions are permitted to\n anyone with this role. Make sure to always have atleast one admin user.\n </p>\n );\n\n return <Table data={tableData} />;\n}\n"],"names":["RolePermissionsTable","rbacConfig","permissions","icon","useCallback","check","_jsx","Check","X","tableData","useMemo","map","p","resource","actions","create","delete","read","update","length","Table","data","children"],"mappings":"mMAOM,SAAUA,GAAqBC,WAAEA,IACrC,MAAMC,EAAcD,EAAWC,YACzBC,EAAOC,EAAaC,GACTC,EAARD,EAASE,EAAYC,EAAP,CAAA,GACpB,IACGC,EAAuBC,EAC3B,IAAM,CACJ,CAAC,GAAI,SAAU,SAAU,OAAQ,aAC9BR,EAAYS,IAAKC,GAAM,CACxBA,EAAEC,SACFV,EAAKS,EAAEE,QAAQC,QACfZ,EAAKS,EAAEE,QAAQE,QACfb,EAAKS,EAAEE,QAAQG,MACfd,EAAKS,EAAEE,QAAQI,WAGnB,CAAChB,IAGH,OAAKA,GAAgBA,EAAYiB,OAQ1Bb,EAACc,EAAK,CAACC,KAAMZ,IANhBH,EAAA,IAAA,CAAAgB,SAAA,kJAON"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as o,jsxs as e,Fragment as r}from"react/jsx-runtime";import{useUser as t,useClerk as n}from"@clerk/nextjs";import{useAnchorElement as i,useDisclosure as c}from"@studiocubics/hooks";import{Skeleton as l,IdentityDisplay as s,Chip as a,Popover as u,List as d,ListItem as m,Dialog as h,ConfirmationForm as p}from"@studiocubics/components";import{toCapitalised as f}from"@studiocubics/utils";import{UserCog as g,LogOut as C}from"lucide-react";import b from"./CurrentSystemUserButton.module.css.js";function y(n){const c=t(),{clickable:h=!0,...p}=n,{open:C,anchorEl:y,handleClick:v,handleClose:N}=i();return c.isLoaded?e(r,{children:[o(s,{onClick:h?v:void 0,profileImage:c.user?.imageUrl??"",role:c.user?.primaryEmailAddress?.emailAddress,...p,profileName:e("div",{className:b.title,children:[o("h4",{children:c.user?.fullName})," ",o(a,{size:"sm",color:"primary",children:o("strong",{children:f(c.user?.publicMetadata.role)})})]})}),h&&o(u,{anchorEl:y,open:C,onClose:N,anchorPosition:{vertical:"top",horizontal:"right"},transformOrigin:{vertical:"bottom",horizontal:"left"},children:e(d,{className:"surfaceContainer",children:[o(m,{startIcon:o(g,{}),href:"/dashboard/security/account",children:"Account Settings"}),o(k,{})]})})]}):o(l,{height:78})}function k(){const{open:t,handleClose:i,handleStrictClose:l,handleOpen:s}=c(),a=n();return e(r,{children:[o(m,{className:b.logoutButton,onClick:s,startIcon:o(C,{}),color:"error",children:"Log out"}),o(h,{open:t,onClose:l,children:o(p,{variant:"danger",formTitle:"Logout",onCancel:i,onSubmit:async function(o){o.preventDefault(),await a.signOut()},children:"Are you sure you want to sign out of this account?"})})]})}export{y as CurrentSystemUserButton,k as Logout};
2
+ //# sourceMappingURL=CurrentSystemUserButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentSystemUserButton.js","sources":["../../../../../../src/client/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.tsx"],"sourcesContent":["\"use client\";\n\nimport { useClerk, useUser } from \"@clerk/nextjs\";\nimport { useAnchorElement, useDisclosure } from \"@studiocubics/hooks\";\nimport {\n Chip,\n ConfirmationForm,\n Dialog,\n IdentityDisplay,\n type IdentityDisplayProps,\n List,\n ListItem,\n Popover,\n Skeleton,\n} from \"@studiocubics/components\";\nimport { toCapitalised } from \"@studiocubics/utils\";\nimport { LogOut, UserCog } from \"lucide-react\";\nimport type { FormEvent } from \"react\";\nimport styles from \"./CurrentSystemUserButton.module.css\";\nimport type { Role } from \"../../../../clerk/rbacConfig\";\n\nexport function CurrentSystemUserButton(\n props: { clickable?: boolean } & Omit<IdentityDisplayProps, \"profileName\">,\n) {\n const user = useUser();\n\n const { clickable = true, ...rest } = props;\n const { open, anchorEl, handleClick, handleClose } = useAnchorElement();\n\n if (!user.isLoaded) return <Skeleton height={78} />;\n\n return (\n <>\n <IdentityDisplay\n onClick={clickable ? handleClick : undefined}\n profileImage={user.user?.imageUrl ?? \"\"}\n role={user.user?.primaryEmailAddress?.emailAddress}\n {...rest}\n profileName={\n <div className={styles.title}>\n <h4>{user.user?.fullName}</h4>{\" \"}\n <Chip size=\"sm\" color=\"primary\">\n <strong>\n {toCapitalised(user.user?.publicMetadata.role as Role)}\n </strong>\n </Chip>\n </div>\n }\n />\n {clickable && (\n <Popover\n anchorEl={anchorEl}\n open={open}\n onClose={handleClose}\n anchorPosition={{ vertical: \"top\", horizontal: \"right\" }}\n transformOrigin={{ vertical: \"bottom\", horizontal: \"left\" }}\n >\n <List className=\"surfaceContainer\">\n <ListItem\n startIcon={<UserCog />}\n href=\"/dashboard/security/account\"\n >\n Account Settings\n </ListItem>\n <Logout />\n </List>\n </Popover>\n )}\n </>\n );\n}\nexport function Logout() {\n const { open, handleClose, handleStrictClose, handleOpen } = useDisclosure();\n const clerk = useClerk();\n async function handleSubmit(e: FormEvent<HTMLFormElement>) {\n e.preventDefault();\n await clerk.signOut();\n }\n return (\n <>\n <ListItem\n className={styles.logoutButton}\n onClick={handleOpen}\n // disabled\n startIcon={<LogOut />}\n color=\"error\"\n >\n Log out\n </ListItem>\n <Dialog open={open} onClose={handleStrictClose}>\n <ConfirmationForm\n variant=\"danger\"\n formTitle=\"Logout\"\n onCancel={handleClose}\n onSubmit={handleSubmit}\n >\n Are you sure you want to sign out of this account?\n </ConfirmationForm>\n </Dialog>\n </>\n );\n}\n"],"names":["CurrentSystemUserButton","props","user","useUser","clickable","rest","open","anchorEl","handleClick","handleClose","useAnchorElement","isLoaded","_jsxs","_Fragment","children","_jsx","IdentityDisplay","onClick","undefined","profileImage","imageUrl","role","primaryEmailAddress","emailAddress","profileName","className","styles","title","fullName","Chip","size","color","toCapitalised","publicMetadata","Popover","onClose","anchorPosition","vertical","horizontal","transformOrigin","List","ListItem","startIcon","UserCog","href","Logout","Skeleton","height","handleStrictClose","handleOpen","useDisclosure","clerk","useClerk","logoutButton","LogOut","Dialog","ConfirmationForm","variant","formTitle","onCancel","onSubmit","async","e","preventDefault","signOut"],"mappings":"qgBAqBM,SAAUA,EACdC,GAEA,MAAMC,EAAOC,KAEPC,UAAEA,GAAY,KAASC,GAASJ,GAChCK,KAAEA,EAAIC,SAAEA,EAAQC,YAAEA,EAAWC,YAAEA,GAAgBC,IAErD,OAAKR,EAAKS,SAGRC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,EAAe,CACdC,QAASb,EAAYI,OAAcU,EACnCC,aAAcjB,EAAKA,MAAMkB,UAAY,GACrCC,KAAMnB,EAAKA,MAAMoB,qBAAqBC,gBAClClB,EACJmB,YACEZ,EAAA,MAAA,CAAKa,UAAWC,EAAOC,MAAKb,SAAA,CAC1BC,EAAA,KAAA,CAAAD,SAAKZ,EAAKA,MAAM0B,WAAe,IAC/Bb,EAACc,GAAKC,KAAK,KAAKC,MAAM,UAASjB,SAC7BC,EAAA,SAAA,CAAAD,SACGkB,EAAc9B,EAAKA,MAAM+B,eAAeZ,eAMlDjB,GACCW,EAACmB,GACC3B,SAAUA,EACVD,KAAMA,EACN6B,QAAS1B,EACT2B,eAAgB,CAAEC,SAAU,MAAOC,WAAY,SAC/CC,gBAAiB,CAAEF,SAAU,SAAUC,WAAY,QAAQxB,SAE3DF,EAAC4B,EAAI,CAACf,UAAU,mBAAkBX,SAAA,CAChCC,EAAC0B,EAAQ,CACPC,UAAW3B,EAAC4B,EAAO,CAAA,GACnBC,KAAK,8BAA6B9B,SAAA,qBAIpCC,EAAC8B,cAnCgB9B,EAAC+B,EAAQ,CAACC,OAAQ,IAyC/C,UACgBF,IACd,MAAMvC,KAAEA,EAAIG,YAAEA,EAAWuC,kBAAEA,EAAiBC,WAAEA,GAAeC,IACvDC,EAAQC,IAKd,OACExC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAAC0B,EAAQ,CACPhB,UAAWC,EAAO2B,aAClBpC,QAASgC,EAETP,UAAW3B,EAACuC,MACZvB,MAAM,QAAOjB,SAAA,YAIfC,EAACwC,GAAOjD,KAAMA,EAAM6B,QAASa,EAAiBlC,SAC5CC,EAACyC,EAAgB,CACfC,QAAQ,SACRC,UAAU,SACVC,SAAUlD,EACVmD,SApBRC,eAA4BC,GAC1BA,EAAEC,uBACIZ,EAAMa,SACd,sEAwBF"}
@@ -0,0 +1,2 @@
1
+ var t={title:"CurrentSystemUserButton-module_title__RFrLD"};export{t as default};
2
+ //# sourceMappingURL=CurrentSystemUserButton.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentSystemUserButton.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"CurrentSystemUserButton.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{currentUser as t}from"@clerk/nextjs/server";import{redirect as e}from"next/navigation";import{SystemUserPageContent as s}from"./SystemUserPageContent.js";import{auth as o}from"../../../../server/clerk/auth.js";async function a(){const a=await t(),i=await o(),n=await i.hasPermission("systemUsers","update");return a||e("/auth/signIn/"),r(s,{user:a,allowEdit:n})}export{a as CurrentSystemUserPage};
2
+ //# sourceMappingURL=CurrentSystemUserPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurrentSystemUserPage.js","sources":["../../../../../src/client/ui/System/SystemUser/CurrentSystemUserPage.tsx"],"sourcesContent":["import { currentUser } from \"@clerk/nextjs/server\";\nimport { redirect } from \"next/navigation\";\nimport { SystemUserPageContent } from \"./SystemUserPageContent\";\nimport { auth } from \"../../../../server/clerk/auth\";\n\nexport async function CurrentSystemUserPage() {\n const user = await currentUser();\n const session = await auth();\n const allowEdit = await session.hasPermission(\"systemUsers\", \"update\");\n if (!user) redirect(\"/auth/signIn/\");\n return <SystemUserPageContent user={user} allowEdit={allowEdit} />;\n}\n"],"names":["async","CurrentSystemUserPage","user","currentUser","session","auth","allowEdit","hasPermission","redirect","_jsx","SystemUserPageContent"],"mappings":"iQAKOA,eAAeC,IACpB,MAAMC,QAAaC,IACbC,QAAgBC,IAChBC,QAAkBF,EAAQG,cAAc,cAAe,UAE7D,OADKL,GAAMM,EAAS,iBACbC,EAACC,EAAqB,CAACR,KAAMA,EAAMI,UAAWA,GACvD"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as e,Fragment as o,jsx as r}from"react/jsx-runtime";import{useDisclosure as t}from"@studiocubics/hooks";import{ListItem as n,Dialog as i,ConfirmationForm as l,TextInput as c}from"@studiocubics/components";import{Trash as s}from"lucide-react";function d(d){const{uid:a,fullName:u,...m}=d,{open:h,handleOpen:f,handleStrictClose:p,handleClose:b}=t();return e(o,{children:[r(n,{...m,color:"error",startIcon:r(s,{}),onClick:f,children:"Delete User"}),r(i,{open:h,onClose:p,children:e(l,{formTitle:"Delete System User",variant:"danger",onCancel:b,children:["Are you sure you want to delete ",u?`${u}'s`:"this"," ","system account?",r("br",{}),"All information will be deleted, this action is irreversible and cannot be undone.",r(c,{fullWidth:!0})]})})]})}export{d as SystemUserDeleteListItem};
2
+ //# sourceMappingURL=SystemUserActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemUserActions.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserActions.tsx"],"sourcesContent":["\"use client\";\n\nimport type { User } from \"@clerk/nextjs/server\";\nimport { useDisclosure } from \"@studiocubics/hooks\";\nimport {\n ConfirmationForm,\n Dialog,\n ListItem,\n type ListItemProps,\n TextInput,\n} from \"@studiocubics/components\";\nimport { Trash } from \"lucide-react\";\n\nexport function SystemUserDeleteListItem(\n props: ListItemProps & { uid: User[\"id\"]; fullName?: User[\"fullName\"] },\n) {\n const { uid, fullName, ...rest } = props;\n const { open, handleOpen, handleStrictClose, handleClose } = useDisclosure();\n return (\n <>\n <ListItem\n {...rest}\n color=\"error\"\n startIcon={<Trash />}\n onClick={handleOpen}\n >\n Delete User\n </ListItem>\n <Dialog open={open} onClose={handleStrictClose}>\n <ConfirmationForm\n formTitle=\"Delete System User\"\n variant=\"danger\"\n onCancel={handleClose}\n >\n Are you sure you want to delete {fullName ? `${fullName}'s` : \"this\"}{\" \"}\n system account?\n <br />\n All information will be deleted, this action is irreversible and\n cannot be undone.\n <TextInput fullWidth />\n </ConfirmationForm>\n </Dialog>\n </>\n );\n}\n"],"names":["SystemUserDeleteListItem","props","uid","fullName","rest","open","handleOpen","handleStrictClose","handleClose","useDisclosure","_jsxs","_Fragment","children","_jsx","ListItem","color","startIcon","Trash","onClick","Dialog","onClose","ConfirmationForm","formTitle","variant","onCancel","TextInput","fullWidth"],"mappings":"2QAaM,SAAUA,EACdC,GAEA,MAAMC,IAAEA,EAAGC,SAAEA,KAAaC,GAASH,GAC7BI,KAAEA,EAAIC,WAAEA,EAAUC,kBAAEA,EAAiBC,YAAEA,GAAgBC,IAC7D,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,MACKV,EACJW,MAAM,QACNC,UAAWH,EAACI,EAAK,CAAA,GACjBC,QAASZ,EAAUM,SAAA,gBAIrBC,EAACM,EAAM,CAACd,KAAMA,EAAMe,QAASb,EAAiBK,SAC5CF,EAACW,EAAgB,CACfC,UAAU,qBACVC,QAAQ,SACRC,SAAUhB,+CAEuBL,EAAW,GAAGA,MAAe,OAAQ,IAAG,kBAEzEU,WAAM,qFAGNA,EAACY,EAAS,CAACC,WAAS,WAK9B"}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{TransitionAnimation as t,IdentityDisplay as o,Button as s}from"@studiocubics/components";import n from"./SystemUserDetails.module.css.js";import{Edit as m}from"lucide-react";import{useDisclosure as l}from"@studiocubics/hooks";import"@clerk/nextjs/server";import{SystemUserDetailsForm as a}from"../SystemUserDetailsForm/SystemUserDetailsForm.js";function c({id:c,fullName:d,firstName:u,lastName:p,imageUrl:f,emailAddress:h,editable:g}){const{open:N,handleOpen:O,handleClose:x}=l();return e(r,{children:[i(t,{in:N,transformOrigin:"top right",mountOnly:!0,unmountOnExit:!0,children:i(a,{imageUrl:f,firstName:u,lastName:p,onClose:x})}),i(t,{in:!N,transformOrigin:"top",mountOnly:!0,unmountOnExit:!0,children:e("div",{className:n.root,children:[i(o,{profileName:d,profileImage:f,role:e("p",{children:[h,i("br",{}),i("strong",{children:c})]})}),g&&i(s,{size:"sm",startIcon:i(m,{}),onClick:O,children:"Edit Details"})]})})]})}export{c as SystemUserDetails};
2
+ //# sourceMappingURL=SystemUserDetails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemUserDetails.js","sources":["../../../../../../src/client/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.tsx"],"sourcesContent":["\"use client\";\n\nimport { Button, IdentityDisplay, TransitionAnimation } from \"@studiocubics/components\";\nimport styles from \"./SystemUserDetails.module.css\";\nimport { Edit } from \"lucide-react\";\nimport { useDisclosure } from \"@studiocubics/hooks\";\nimport { type User } from \"@clerk/nextjs/server\";\nimport { SystemUserDetailsForm } from \"../SystemUserDetailsForm/SystemUserDetailsForm\";\n\ninterface SystemUserDetailsProps {\n id: User[\"id\"];\n fullName: User[\"fullName\"];\n firstName: User[\"firstName\"];\n lastName?: User[\"lastName\"];\n imageUrl: User[\"imageUrl\"];\n emailAddress?: NonNullable<User[\"primaryEmailAddress\"]>[\"emailAddress\"];\n editable?: boolean;\n}\nexport function SystemUserDetails({\n id,\n fullName,\n firstName,\n lastName,\n imageUrl,\n emailAddress,\n editable,\n}: SystemUserDetailsProps) {\n const { open, handleOpen, handleClose } = useDisclosure();\n return (\n <>\n <TransitionAnimation\n in={open}\n transformOrigin={\"top right\"}\n mountOnly\n unmountOnExit\n >\n <SystemUserDetailsForm\n imageUrl={imageUrl}\n firstName={firstName}\n lastName={lastName}\n onClose={handleClose}\n />\n </TransitionAnimation>\n <TransitionAnimation\n in={!open}\n transformOrigin={\"top\"}\n mountOnly\n unmountOnExit\n >\n <div className={styles.root}>\n <IdentityDisplay\n profileName={fullName}\n profileImage={imageUrl}\n role={\n <p>\n {emailAddress}\n <br />\n <strong>{id}</strong>\n </p>\n }\n />\n {editable && (\n <Button size=\"sm\" startIcon={<Edit />} onClick={handleOpen}>\n Edit Details\n </Button>\n )}\n </div>\n </TransitionAnimation>\n </>\n );\n}\n"],"names":["SystemUserDetails","id","fullName","firstName","lastName","imageUrl","emailAddress","editable","open","handleOpen","handleClose","useDisclosure","_jsxs","_Fragment","children","_jsx","TransitionAnimation","in","transformOrigin","mountOnly","unmountOnExit","SystemUserDetailsForm","onClose","className","styles","root","IdentityDisplay","profileName","profileImage","role","Button","size","startIcon","Edit","onClick"],"mappings":"sbAkBgBA,GAAkBC,GAChCA,EAAEC,SACFA,EAAQC,UACRA,EAASC,SACTA,EAAQC,SACRA,EAAQC,aACRA,EAAYC,SACZA,IAEA,MAAMC,KAAEA,EAAIC,WAAEA,EAAUC,YAAEA,GAAgBC,IAC1C,OACEC,EAAAC,EAAA,CAAAC,SAAA,CACEC,EAACC,EAAmB,CAClBC,GAAIT,EACJU,gBAAiB,YACjBC,WAAS,EACTC,eAAa,EAAAN,SAEbC,EAACM,GACChB,SAAUA,EACVF,UAAWA,EACXC,SAAUA,EACVkB,QAASZ,MAGbK,EAACC,GACCC,IAAKT,EACLU,gBAAiB,MACjBC,WAAS,EACTC,eAAa,EAAAN,SAEbF,EAAA,MAAA,CAAKW,UAAWC,EAAOC,KAAIX,SAAA,CACzBC,EAACW,EAAe,CACdC,YAAazB,EACb0B,aAAcvB,EACdwB,KACEjB,EAAA,IAAA,CAAAE,SAAA,CACGR,EACDS,EAAA,KAAA,IACAA,EAAA,SAAA,CAAAD,SAASb,SAIdM,GACCQ,EAACe,GAAOC,KAAK,KAAKC,UAAWjB,EAACkB,EAAI,CAAA,GAAKC,QAASzB,EAAUK,SAAA,wBAQtE"}
@@ -0,0 +1,2 @@
1
+ var e={root:"SystemUserDetails-module_root__KsYgB"};export{e as default};
2
+ //# sourceMappingURL=SystemUserDetails.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SystemUserDetails.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"SystemUserDetails.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Card as i,ConfirmationForm as l,IdentityDisplay as s,Button as t,toast as a,TextInput as o}from"@studiocubics/components";import m from"./SystemUserDetailsForm.module.css.js";import{initialiseForm as n}from"@studiocubics/utils";import"../../../../../server/clerk/actions/invitations.js";import{systemUserDetailsUpdateAction as c}from"../../../../../server/clerk/actions/systemUsers.js";import"@clerk/nextjs/server";import"../../../../../server/clerk/schemas/invitation.js";import{useActionState as d,useState as f,useRef as u,useEffect as p}from"react";const h=n("firstName","lastName","imageUrl");function N({imageUrl:n,firstName:N,lastName:b,onClose:g,...v}){const[j,k,U]=d(c.bind(null,"hello"),h),[R,C]=f(n),[x,y]=f(),z=u(null);return p(()=>{x&&C(URL.createObjectURL(x))},[x]),e(i,{fullWidth:!0,...v,children:r(l,{formTitle:"Edit Details",onCancel:g,action:k,disabled:U,children:[e(s,{profileImage:R,profileName:r("div",{className:m.formRow,children:[e(t,{size:"sm",variant:"outlined",disabled:U,onClick:()=>z.current?.click(),children:"Upload"}),e("input",{type:"file",accept:"image/jpg, image/png",ref:z,name:"imageFile",onChange:e=>e.target?.files&&y(e.target.files[0]),hidden:!0,disabled:U}),e(t,{size:"sm",color:"error",onClick:()=>a("hello"),disabled:U,children:"Remove"})]}),role:"Recommended size 1:1, up to 10MB."}),r("div",{className:m.formRow,children:[e(o,{fullWidth:!0,label:"First Name",defaultValue:N,name:"firstName",error:j.fieldErrors?.firstName,disabled:U}),e(o,{fullWidth:!0,label:"Last Name",defaultValue:b,name:"lastName",error:j.fieldErrors?.lastName,disabled:U})]})]})})}export{N as SystemUserDetailsForm};
2
+ //# sourceMappingURL=SystemUserDetailsForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemUserDetailsForm.js","sources":["../../../../../../src/client/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.tsx"],"sourcesContent":["\"use client\";\n\nimport type { User } from \"@clerk/nextjs/server\";\nimport {\n type CardProps,\n Card,\n ConfirmationForm,\n IdentityDisplay,\n Button,\n TextInput,\n toast,\n} from \"@studiocubics/components\";\nimport styles from \"./SystemUserDetailsForm.module.css\";\nimport { initialiseForm } from \"@studiocubics/utils\";\nimport { systemUserDetailsUpdateAction } from \"../../../../../server/clerk/_index\";\nimport { useActionState, useEffect, useRef, useState } from \"react\";\n\nconst initialSystemUserDetailsUpdateState = initialiseForm(\n \"firstName\",\n \"lastName\",\n \"imageUrl\",\n);\nexport type SystemUserDetailsUpdateState =\n typeof initialSystemUserDetailsUpdateState;\n\nexport function SystemUserDetailsForm({\n imageUrl,\n firstName,\n lastName,\n onClose,\n ...rest\n}: {\n imageUrl?: User[\"imageUrl\"];\n firstName?: User[\"firstName\"];\n lastName?: User[\"lastName\"];\n onClose(): void;\n} & CardProps) {\n const [state, action, pending] = useActionState(\n systemUserDetailsUpdateAction.bind(null, \"hello\"),\n initialSystemUserDetailsUpdateState,\n );\n const [imagePreview, setImagePreview] = useState(imageUrl);\n const [inputImage, setInputImage] = useState<File>();\n const imageInputRef = useRef<HTMLInputElement | null>(null);\n\n useEffect(() => {\n if (inputImage) setImagePreview(URL.createObjectURL(inputImage));\n }, [inputImage]);\n\n return (\n <Card fullWidth {...rest}>\n <ConfirmationForm\n formTitle=\"Edit Details\"\n onCancel={onClose}\n action={action}\n disabled={pending}\n >\n <IdentityDisplay\n profileImage={imagePreview}\n profileName={\n <div className={styles.formRow}>\n <Button\n size=\"sm\"\n variant=\"outlined\"\n disabled={pending}\n onClick={() => imageInputRef.current?.click()}\n >\n Upload\n </Button>\n <input\n type=\"file\"\n accept=\"image/jpg, image/png\"\n ref={imageInputRef}\n name={\"imageFile\"}\n onChange={(e) =>\n e.target?.files && setInputImage(e.target.files[0])\n }\n hidden\n disabled={pending}\n />\n <Button\n size=\"sm\"\n color=\"error\"\n onClick={() => toast(\"hello\")}\n disabled={pending}\n >\n Remove\n </Button>\n </div>\n }\n role={\"Recommended size 1:1, up to 10MB.\"}\n />\n <div className={styles.formRow}>\n <TextInput\n fullWidth\n label=\"First Name\"\n defaultValue={firstName!}\n name=\"firstName\"\n error={state.fieldErrors?.firstName}\n disabled={pending}\n />\n <TextInput\n fullWidth\n label=\"Last Name\"\n defaultValue={lastName!}\n name=\"lastName\"\n error={state.fieldErrors?.lastName}\n disabled={pending}\n />\n </div>\n </ConfirmationForm>\n </Card>\n );\n}\n"],"names":["initialSystemUserDetailsUpdateState","initialiseForm","SystemUserDetailsForm","imageUrl","firstName","lastName","onClose","rest","state","action","pending","useActionState","systemUserDetailsUpdateAction","bind","imagePreview","setImagePreview","useState","inputImage","setInputImage","imageInputRef","useRef","useEffect","URL","createObjectURL","_jsx","Card","fullWidth","children","_jsxs","ConfirmationForm","formTitle","onCancel","disabled","IdentityDisplay","profileImage","profileName","className","styles","formRow","Button","size","variant","onClick","current","click","type","accept","ref","name","onChange","e","target","files","hidden","color","toast","role","TextInput","label","defaultValue","error","fieldErrors"],"mappings":"+mBAiBA,MAAMA,EAAsCC,EAC1C,YACA,WACA,YAKI,SAAUC,GAAsBC,SACpCA,EAAQC,UACRA,EAASC,SACTA,EAAQC,QACRA,KACGC,IAOH,MAAOC,EAAOC,EAAQC,GAAWC,EAC/BC,EAA8BC,KAAK,KAAM,SACzCb,IAEKc,EAAcC,GAAmBC,EAASb,IAC1Cc,EAAYC,GAAiBF,IAC9BG,EAAgBC,EAAgC,MAMtD,OAJAC,EAAU,KACJJ,GAAYF,EAAgBO,IAAIC,gBAAgBN,KACnD,CAACA,IAGFO,EAACC,EAAI,CAACC,gBAAcnB,EAAIoB,SACtBC,EAACC,EAAgB,CACfC,UAAU,eACVC,SAAUzB,EACVG,OAAQA,EACRuB,SAAUtB,YAEVc,EAACS,EAAe,CACdC,aAAcpB,EACdqB,YACEP,EAAA,MAAA,CAAKQ,UAAWC,EAAOC,QAAOX,SAAA,CAC5BH,EAACe,EAAM,CACLC,KAAK,KACLC,QAAQ,WACRT,SAAUtB,EACVgC,QAAS,IAAMvB,EAAcwB,SAASC,QAAOjB,SAAA,WAI/CH,EAAA,QAAA,CACEqB,KAAK,OACLC,OAAO,uBACPC,IAAK5B,EACL6B,KAAM,YACNC,SAAWC,GACTA,EAAEC,QAAQC,OAASlC,EAAcgC,EAAEC,OAAOC,MAAM,IAElDC,QAAM,EACNrB,SAAUtB,IAEZc,EAACe,EAAM,CACLC,KAAK,KACLc,MAAM,QACNZ,QAAS,IAAMa,EAAM,SACrBvB,SAAUtB,EAAOiB,SAAA,cAMvB6B,KAAM,sCAER5B,EAAA,MAAA,CAAKQ,UAAWC,EAAOC,QAAOX,SAAA,CAC5BH,EAACiC,EAAS,CACR/B,WAAS,EACTgC,MAAM,aACNC,aAAcvD,EACd4C,KAAK,YACLY,MAAOpD,EAAMqD,aAAazD,UAC1B4B,SAAUtB,IAEZc,EAACiC,EAAS,CACR/B,WAAS,EACTgC,MAAM,YACNC,aAActD,EACd2C,KAAK,WACLY,MAAOpD,EAAMqD,aAAaxD,SAC1B2B,SAAUtB,WAMtB"}
@@ -0,0 +1,2 @@
1
+ var o={formRow:"SystemUserDetailsForm-module_formRow__YpJTg"};export{o as default};
2
+ //# sourceMappingURL=SystemUserDetailsForm.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SystemUserDetailsForm.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"SystemUserDetailsForm.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ import{jsx as r}from"react/jsx-runtime";import{systemUserListReadAction as e}from"../../../../server/clerk/actions/systemUsers.js";import{SystemUserListCard as a}from"./SystemUserListCard.js";async function s(s){return(await e(s)).data.map(e=>r(a,{id:e.id,fullName:e.fullName,imageUrl:e.imageUrl,emailAddress:e.primaryEmailAddress?.emailAddress,role:e.publicMetadata.role,lastSignInAt:e.lastSignInAt},e.id))}export{s as SystemUserList};
2
+ //# sourceMappingURL=SystemUserList.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SystemUserList.js","sources":["../../../../../src/client/ui/System/SystemUser/SystemUserList.tsx"],"sourcesContent":["import { systemUserListReadAction } from \"../../../../server/clerk/actions/systemUsers\";\nimport type { Role } from \"../../../clerk/rbacConfig\";\nimport { SystemUserListCard } from \"./SystemUserListCard\";\n\nexport async function SystemUserList(params: ClerkUserListParams) {\n const systemUserList = await systemUserListReadAction(params);\n return systemUserList.data.map((user) => (\n <SystemUserListCard\n key={user.id}\n id={user.id}\n fullName={user.fullName}\n imageUrl={user.imageUrl}\n emailAddress={user.primaryEmailAddress?.emailAddress}\n role={user.publicMetadata.role as Role}\n lastSignInAt={user.lastSignInAt}\n />\n ));\n}\n"],"names":["async","SystemUserList","params","systemUserListReadAction","data","map","user","_jsx","SystemUserListCard","id","fullName","imageUrl","emailAddress","primaryEmailAddress","role","publicMetadata","lastSignInAt"],"mappings":"gMAIOA,eAAeC,EAAeC,GAEnC,aAD6BC,EAAyBD,IAChCE,KAAKC,IAAKC,GAC9BC,EAACC,EAAkB,CAEjBC,GAAIH,EAAKG,GACTC,SAAUJ,EAAKI,SACfC,SAAUL,EAAKK,SACfC,aAAcN,EAAKO,qBAAqBD,aACxCE,KAAMR,EAAKS,eAAeD,KAC1BE,aAAcV,EAAKU,cANdV,EAAKG,IAShB"}