@studiocubics/cms 0.0.1 → 0.0.2

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 (244) hide show
  1. package/dist/clerk/actions/invitations.d.ts +6 -0
  2. package/dist/clerk/actions/invitations.js +59 -0
  3. package/dist/clerk/actions/invitations.js.map +1 -0
  4. package/dist/clerk/actions/systemUsers.d.ts +8 -0
  5. package/dist/clerk/actions/systemUsers.js +64 -0
  6. package/dist/clerk/actions/systemUsers.js.map +1 -0
  7. package/dist/clerk/auth.d.ts +8 -0
  8. package/dist/clerk/auth.js +21 -0
  9. package/dist/clerk/auth.js.map +1 -0
  10. package/dist/clerk/hasPermission.d.ts +33 -0
  11. package/dist/clerk/hasPermission.js +78 -0
  12. package/dist/clerk/hasPermission.js.map +1 -0
  13. package/dist/clerk/rbacConfig.d.ts +31 -0
  14. package/dist/clerk/rbacConfig.js +48 -0
  15. package/dist/clerk/rbacConfig.js.map +1 -0
  16. package/dist/clerk/schemas/invitation.d.ts +12 -0
  17. package/dist/clerk/schemas/invitation.js +20 -0
  18. package/dist/clerk/schemas/invitation.js.map +1 -0
  19. package/dist/clerk/schemas/systemUser.d.ts +6 -0
  20. package/dist/clerk/toClientSafeUser.d.ts +48 -0
  21. package/dist/clerk/toClientSafeUser.js +46 -0
  22. package/dist/clerk/toClientSafeUser.js.map +1 -0
  23. package/dist/constants/defaults.d.ts +6 -0
  24. package/dist/constants/defaults.js +56 -0
  25. package/dist/constants/defaults.js.map +1 -0
  26. package/dist/constants/pageLimits.d.ts +2 -0
  27. package/dist/constants/pageLimits.js +5 -0
  28. package/dist/constants/pageLimits.js.map +1 -0
  29. package/dist/index.css +215 -0
  30. package/dist/index.js +45 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/providers/CMSRootProviders.d.ts +4 -0
  33. package/dist/providers/CMSRootProviders.js +11 -0
  34. package/dist/providers/CMSRootProviders.js.map +1 -0
  35. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.d.ts +2 -0
  36. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +13 -0
  37. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +1 -0
  38. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +4 -0
  39. package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js.map +1 -0
  40. package/dist/ui/Layout/CMSSecurityLayout.d.ts +2 -0
  41. package/dist/ui/Layout/CMSSecurityLayout.js +18 -0
  42. package/dist/ui/Layout/CMSSecurityLayout.js.map +1 -0
  43. package/dist/ui/Layout/CMSSidebar/CMSSidebar.d.ts +6 -0
  44. package/dist/ui/Layout/CMSSidebar/CMSSidebar.js +15 -0
  45. package/dist/ui/Layout/CMSSidebar/CMSSidebar.js.map +1 -0
  46. package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.d.ts +4 -0
  47. package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js +18 -0
  48. package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +1 -0
  49. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.d.ts +1 -0
  50. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +39 -0
  51. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +1 -0
  52. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +4 -0
  53. package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js.map +1 -0
  54. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.d.ts +1 -0
  55. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +16 -0
  56. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +1 -0
  57. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +4 -0
  58. package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js.map +1 -0
  59. package/dist/ui/Layout/_index.d.ts +2 -0
  60. package/dist/ui/System/Auth/SignIn/SignIn.d.ts +1 -0
  61. package/dist/ui/System/Auth/SignIn/SignIn.js +28 -0
  62. package/dist/ui/System/Auth/SignIn/SignIn.js.map +1 -0
  63. package/dist/ui/System/Auth/SignIn/SignIn.module.css.js +4 -0
  64. package/dist/ui/System/Auth/SignIn/SignIn.module.css.js.map +1 -0
  65. package/dist/ui/System/Auth/SignIn/useSignInForm.d.ts +14 -0
  66. package/dist/ui/System/Auth/SignIn/useSignInForm.js +46 -0
  67. package/dist/ui/System/Auth/SignIn/useSignInForm.js.map +1 -0
  68. package/dist/ui/System/Auth/SignUp/SignUp.d.ts +1 -0
  69. package/dist/ui/System/Auth/SignUp/SignUp.js +36 -0
  70. package/dist/ui/System/Auth/SignUp/SignUp.js.map +1 -0
  71. package/dist/ui/System/Auth/SignUp/SignUp.module.css.js +4 -0
  72. package/dist/ui/System/Auth/SignUp/SignUp.module.css.js.map +1 -0
  73. package/dist/ui/System/Auth/SignUp/useSignUpForm.d.ts +19 -0
  74. package/dist/ui/System/Auth/SignUp/useSignUpForm.js +58 -0
  75. package/dist/ui/System/Auth/SignUp/useSignUpForm.js.map +1 -0
  76. package/dist/ui/System/Invitations/InvitationList.d.ts +1 -0
  77. package/dist/ui/System/Invitations/InvitationList.js +11 -0
  78. package/dist/ui/System/Invitations/InvitationList.js.map +1 -0
  79. package/dist/ui/System/Invitations/InvitationListActions.d.ts +11 -0
  80. package/dist/ui/System/Invitations/InvitationListActions.js +39 -0
  81. package/dist/ui/System/Invitations/InvitationListActions.js.map +1 -0
  82. package/dist/ui/System/Invitations/InvitationListCard.d.ts +4 -0
  83. package/dist/ui/System/Invitations/InvitationListCard.js +16 -0
  84. package/dist/ui/System/Invitations/InvitationListCard.js.map +1 -0
  85. package/dist/ui/System/Invitations/InvitationListPage.d.ts +2 -0
  86. package/dist/ui/System/Invitations/InvitationListPage.js +22 -0
  87. package/dist/ui/System/Invitations/InvitationListPage.js.map +1 -0
  88. package/dist/ui/System/Invitations/InvitationListPagination.d.ts +4 -0
  89. package/dist/ui/System/Invitations/InvitationListPagination.js +11 -0
  90. package/dist/ui/System/Invitations/InvitationListPagination.js.map +1 -0
  91. package/dist/ui/System/Permissions/RoleListCard.d.ts +6 -0
  92. package/dist/ui/System/Permissions/RoleListCard.js +11 -0
  93. package/dist/ui/System/Permissions/RoleListCard.js.map +1 -0
  94. package/dist/ui/System/Permissions/RolePermissionsPage.d.ts +4 -0
  95. package/dist/ui/System/Permissions/RolePermissionsPage.js +14 -0
  96. package/dist/ui/System/Permissions/RolePermissionsPage.js.map +1 -0
  97. package/dist/ui/System/Permissions/RolePermissionsTable.d.ts +2 -0
  98. package/dist/ui/System/Permissions/RolePermissionsTable.js +28 -0
  99. package/dist/ui/System/Permissions/RolePermissionsTable.js.map +1 -0
  100. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.d.ts +5 -0
  101. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +31 -0
  102. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +1 -0
  103. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +4 -0
  104. package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js.map +1 -0
  105. package/dist/ui/System/SystemUser/CurrentSystemUserPage.d.ts +1 -0
  106. package/dist/ui/System/SystemUser/CurrentSystemUserPage.js +17 -0
  107. package/dist/ui/System/SystemUser/CurrentSystemUserPage.js.map +1 -0
  108. package/dist/ui/System/SystemUser/SystemUserActions.d.ts +6 -0
  109. package/dist/ui/System/SystemUser/SystemUserActions.js +14 -0
  110. package/dist/ui/System/SystemUser/SystemUserActions.js.map +1 -0
  111. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.d.ts +12 -0
  112. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +16 -0
  113. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +1 -0
  114. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +4 -0
  115. package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js.map +1 -0
  116. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.d.ts +11 -0
  117. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +26 -0
  118. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +1 -0
  119. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +4 -0
  120. package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js.map +1 -0
  121. package/dist/ui/System/SystemUser/SystemUserList.d.ts +1 -0
  122. package/dist/ui/System/SystemUser/SystemUserList.js +11 -0
  123. package/dist/ui/System/SystemUser/SystemUserList.js.map +1 -0
  124. package/dist/ui/System/SystemUser/SystemUserListActions.d.ts +1 -0
  125. package/dist/ui/System/SystemUser/SystemUserListActions.js +11 -0
  126. package/dist/ui/System/SystemUser/SystemUserListActions.js.map +1 -0
  127. package/dist/ui/System/SystemUser/SystemUserListCard.d.ts +11 -0
  128. package/dist/ui/System/SystemUser/SystemUserListCard.js +34 -0
  129. package/dist/ui/System/SystemUser/SystemUserListCard.js.map +1 -0
  130. package/dist/ui/System/SystemUser/SystemUserListPage.d.ts +2 -0
  131. package/dist/ui/System/SystemUser/SystemUserListPage.js +24 -0
  132. package/dist/ui/System/SystemUser/SystemUserListPage.js.map +1 -0
  133. package/dist/ui/System/SystemUser/SystemUserListPagination.d.ts +4 -0
  134. package/dist/ui/System/SystemUser/SystemUserListPagination.js +11 -0
  135. package/dist/ui/System/SystemUser/SystemUserListPagination.js.map +1 -0
  136. package/dist/ui/System/SystemUser/SystemUserPage.d.ts +1 -0
  137. package/dist/ui/System/SystemUser/SystemUserPage.js +17 -0
  138. package/dist/ui/System/SystemUser/SystemUserPage.js.map +1 -0
  139. package/dist/ui/System/SystemUser/SystemUserPageContent.d.ts +5 -0
  140. package/dist/ui/System/SystemUser/SystemUserPageContent.js +13 -0
  141. package/dist/ui/System/SystemUser/SystemUserPageContent.js.map +1 -0
  142. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.d.ts +6 -0
  143. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +21 -0
  144. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +1 -0
  145. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +4 -0
  146. package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js.map +1 -0
  147. package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.d.ts +9 -0
  148. package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +19 -0
  149. package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +1 -0
  150. package/dist/ui/System/SystemUser/SystemUserTimestamps.d.ts +9 -0
  151. package/dist/ui/System/SystemUser/SystemUserTimestamps.js +27 -0
  152. package/dist/ui/System/SystemUser/SystemUserTimestamps.js.map +1 -0
  153. package/dist/ui/System/WelcomePage/WelcomePage.d.ts +1 -0
  154. package/dist/ui/System/WelcomePage/WelcomePage.js +16 -0
  155. package/dist/ui/System/WelcomePage/WelcomePage.js.map +1 -0
  156. package/dist/ui/System/WelcomePage/WelcomePage.module.css.js +4 -0
  157. package/dist/ui/System/WelcomePage/WelcomePage.module.css.js.map +1 -0
  158. package/{src/ui/System/types.ts → dist/ui/System/types.d.ts} +3 -5
  159. package/dist/utils/proxyFunctions.d.ts +4 -0
  160. package/dist/utils/proxyFunctions.js +34 -0
  161. package/dist/utils/proxyFunctions.js.map +1 -0
  162. package/package.json +14 -14
  163. package/rollup.config.js +1 -1
  164. package/.turbo/turbo-build.log +0 -7
  165. package/CHANGELOG.md +0 -12
  166. package/eslint.config.js +0 -21
  167. package/src/clerk/actions/invitations.ts +0 -78
  168. package/src/clerk/actions/systemUsers.ts +0 -94
  169. package/src/clerk/auth.ts +0 -34
  170. package/src/clerk/clerk.d.ts +0 -105
  171. package/src/clerk/hasPermission.ts +0 -96
  172. package/src/clerk/rbacConfig.ts +0 -68
  173. package/src/clerk/schemas/invitation.ts +0 -17
  174. package/src/clerk/schemas/systemUser.ts +0 -16
  175. package/src/clerk/toClientSafeUser.ts +0 -77
  176. package/src/constants/defaults.tsx +0 -62
  177. package/src/constants/pageLimits.ts +0 -2
  178. package/src/declaration.d.ts +0 -5
  179. package/src/providers/CMSRootProviders.tsx +0 -13
  180. package/src/routes.d.ts +0 -96
  181. package/src/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css +0 -4
  182. package/src/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.tsx +0 -16
  183. package/src/ui/Layout/CMSSecurityLayout.tsx +0 -27
  184. package/src/ui/Layout/CMSSidebar/CMSSidebar.tsx +0 -39
  185. package/src/ui/Layout/CMSSidebar/CMSSidebarBody.tsx +0 -43
  186. package/src/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css +0 -7
  187. package/src/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.tsx +0 -59
  188. package/src/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css +0 -44
  189. package/src/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.tsx +0 -30
  190. package/src/ui/Layout/_index.ts +0 -2
  191. package/src/ui/System/Auth/SignIn/SignIn.module.css +0 -50
  192. package/src/ui/System/Auth/SignIn/SignIn.tsx +0 -79
  193. package/src/ui/System/Auth/SignIn/useSignInForm.tsx +0 -42
  194. package/src/ui/System/Auth/SignUp/SignUp.module.css +0 -48
  195. package/src/ui/System/Auth/SignUp/SignUp.tsx +0 -138
  196. package/src/ui/System/Auth/SignUp/useSignUpForm.tsx +0 -54
  197. package/src/ui/System/Invitations/InvitationList.tsx +0 -9
  198. package/src/ui/System/Invitations/InvitationListActions.tsx +0 -167
  199. package/src/ui/System/Invitations/InvitationListCard.tsx +0 -79
  200. package/src/ui/System/Invitations/InvitationListPage.tsx +0 -32
  201. package/src/ui/System/Invitations/InvitationListPagination.tsx +0 -19
  202. package/src/ui/System/Permissions/RoleListCard.tsx +0 -33
  203. package/src/ui/System/Permissions/RolePermissionsPage.tsx +0 -18
  204. package/src/ui/System/Permissions/RolePermissionsTable.tsx +0 -36
  205. package/src/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css +0 -5
  206. package/src/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.tsx +0 -102
  207. package/src/ui/System/SystemUser/CurrentSystemUserPage.tsx +0 -12
  208. package/src/ui/System/SystemUser/SystemUserActions.tsx +0 -45
  209. package/src/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css +0 -6
  210. package/src/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.tsx +0 -71
  211. package/src/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css +0 -7
  212. package/src/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.tsx +0 -114
  213. package/src/ui/System/SystemUser/SystemUserList.tsx +0 -18
  214. package/src/ui/System/SystemUser/SystemUserListActions.tsx +0 -17
  215. package/src/ui/System/SystemUser/SystemUserListCard.tsx +0 -85
  216. package/src/ui/System/SystemUser/SystemUserListPage.tsx +0 -33
  217. package/src/ui/System/SystemUser/SystemUserListPagination.tsx +0 -19
  218. package/src/ui/System/SystemUser/SystemUserPage.tsx +0 -30
  219. package/src/ui/System/SystemUser/SystemUserPageContent.tsx +0 -54
  220. package/src/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css +0 -17
  221. package/src/ui/System/SystemUser/SystemUserRole/SystemUserRole.tsx +0 -64
  222. package/src/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.tsx +0 -51
  223. package/src/ui/System/SystemUser/SystemUserTimestamps.tsx +0 -56
  224. package/src/ui/System/WelcomePage/WelcomePage.module.css +0 -18
  225. package/src/ui/System/WelcomePage/WelcomePage.tsx +0 -43
  226. package/src/utils/proxyFunctions.ts +0 -37
  227. package/tsconfig.json +0 -32
  228. /package/{src/clerk/_index.ts → dist/clerk/_index.d.ts} +0 -0
  229. /package/{src/clerk/actions/_index.ts → dist/clerk/actions/_index.d.ts} +0 -0
  230. /package/{src/clerk/schemas/_index.ts → dist/clerk/schemas/_index.d.ts} +0 -0
  231. /package/{src/constants/_index.ts → dist/constants/_index.d.ts} +0 -0
  232. /package/{src/index.ts → dist/index.d.ts} +0 -0
  233. /package/{src/providers/_index.ts → dist/providers/_index.d.ts} +0 -0
  234. /package/{src/ui/Inputs/_index.ts → dist/ui/Inputs/_index.d.ts} +0 -0
  235. /package/{src/ui/Layout/CMSSidebar/_index.ts → dist/ui/Layout/CMSSidebar/_index.d.ts} +0 -0
  236. /package/{src/ui/System/Auth/SignIn/_index.ts → dist/ui/System/Auth/SignIn/_index.d.ts} +0 -0
  237. /package/{src/ui/System/Auth/SignUp/_index.ts → dist/ui/System/Auth/SignUp/_index.d.ts} +0 -0
  238. /package/{src/ui/System/Auth/_index.ts → dist/ui/System/Auth/_index.d.ts} +0 -0
  239. /package/{src/ui/System/Invitations/_index.ts → dist/ui/System/Invitations/_index.d.ts} +0 -0
  240. /package/{src/ui/System/Permissions/_index.ts → dist/ui/System/Permissions/_index.d.ts} +0 -0
  241. /package/{src/ui/System/SystemUser/_index.ts → dist/ui/System/SystemUser/_index.d.ts} +0 -0
  242. /package/{src/ui/System/_index.ts → dist/ui/System/_index.d.ts} +0 -0
  243. /package/{src/ui/_index.ts → dist/ui/_index.d.ts} +0 -0
  244. /package/{src/utils/_index.ts → dist/utils/_index.d.ts} +0 -0
@@ -1,43 +0,0 @@
1
- "use client";
2
-
3
- import {
4
- List,
5
- useSidebar,
6
- SidebarBody,
7
- ListItem,
8
- type ListItemProps,
9
- } from "@studiocubics/ui";
10
- import { usePathname } from "next/navigation";
11
- import Link from "next/link";
12
- import { useScreenSize } from "@studiocubics/hooks";
13
-
14
- export function CMSSidebarBody({
15
- sidebarLinks,
16
- }: {
17
- sidebarLinks: ListItemProps[];
18
- }) {
19
- const { sidebarOpen, toggleSidebar } = useSidebar();
20
- const pathname = usePathname();
21
- const screenSize = useScreenSize();
22
-
23
- return (
24
- <SidebarBody>
25
- <List>
26
- {sidebarLinks.map((sl, i) => (
27
- <ListItem
28
- LinkComponent={Link}
29
- key={i}
30
- {...sl}
31
- onClick={
32
- screenSize?.ltMedium && !sl.childNodes?.length && sidebarOpen
33
- ? toggleSidebar
34
- : undefined
35
- }
36
- shortened={!sidebarOpen}
37
- selected={sl.href ? pathname.startsWith(sl.href) : undefined}
38
- />
39
- ))}
40
- </List>
41
- </SidebarBody>
42
- );
43
- }
@@ -1,7 +0,0 @@
1
- .root {
2
- display: flex;
3
- flex-direction: column;
4
- justify-content: flex-end;
5
- height: 100%;
6
- gap: var(--spacing-gap-2);
7
- }
@@ -1,59 +0,0 @@
1
- "use client";
2
-
3
- import { useMounted } from "@studiocubics/hooks";
4
- import {
5
- useSidebar,
6
- SidebarFooter,
7
- ThemeToggleListItem,
8
- type ThemeObject,
9
- List,
10
- } from "@studiocubics/ui";
11
- import { Moon, Sun, Monitor } from "lucide-react";
12
- import { useTheme } from "next-themes";
13
- import styles from "./CMSSidebarFooter.module.css";
14
- import { CurrentSystemUserButton } from "../../../System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton";
15
-
16
- export function CMSSidebarFooter() {
17
- const { sidebarOpen } = useSidebar();
18
- const { theme, setTheme } = useTheme();
19
- const { mounted } = useMounted();
20
- if (!mounted) return;
21
- return (
22
- <SidebarFooter>
23
- <div className={styles.root}>
24
- {theme && (
25
- <List>
26
- <ThemeToggleListItem
27
- shortened={!sidebarOpen}
28
- currentTheme={theme as keyof ThemeObject}
29
- themeObject={{
30
- dark: {
31
- icon: <Moon />,
32
- onClick: () => {
33
- setTheme("dark");
34
- },
35
- },
36
- light: {
37
- icon: <Sun />,
38
- onClick: () => {
39
- setTheme("light");
40
- },
41
- },
42
- system: {
43
- icon: <Monitor />,
44
- onClick: () => {
45
- setTheme("system");
46
- },
47
- },
48
- }}
49
- />
50
- </List>
51
- )}
52
- <CurrentSystemUserButton
53
- clickable
54
- variant={sidebarOpen ? "compact" : "image-only"}
55
- />
56
- </div>
57
- </SidebarFooter>
58
- );
59
- }
@@ -1,44 +0,0 @@
1
- .root {
2
- flex: 1;
3
- display: flex;
4
- flex-direction: row;
5
- align-items: center;
6
- padding-inline: 8.33%;
7
- gap: var(--spacing-gap);
8
-
9
- padding-top: var(--spacing-gap-3);
10
- padding-bottom: var(--spacing-gap-2);
11
- transition: padding var(--transition-time) var(--transition-tf);
12
- }
13
- .logoContainer {
14
- flex: 1;
15
- display: flex;
16
- justify-content: flex-start;
17
- align-items: center;
18
- }
19
-
20
- .logo {
21
- max-width: 6rem;
22
- height: auto;
23
- width: 40%;
24
- }
25
-
26
- @media (min-width: 600px) {
27
- .root {
28
- flex: 0 1 0%;
29
- flex-direction: column;
30
- align-items: center;
31
- padding-inline: 0;
32
- }
33
- .root[data-open="true"] {
34
- flex-direction: row;
35
- justify-content: space-between;
36
- padding-top: var(--spacing-gap-2);
37
- & .logo {
38
- width: 100%;
39
- }
40
- }
41
- .logoContainer {
42
- justify-content: center;
43
- }
44
- }
@@ -1,30 +0,0 @@
1
- "use client";
2
-
3
- import { useScreenSize } from "@studiocubics/hooks";
4
- import {
5
- Button,
6
- CubicsUILogo,
7
- SidebarHeader,
8
- useSidebar,
9
- } from "@studiocubics/ui";
10
- import styles from "./CMSSidebarHeader.module.css";
11
- import { cn } from "@studiocubics/utils";
12
- import { PanelLeftClose, PanelLeftOpen } from "lucide-react";
13
-
14
- export function CMSSidebarHeader() {
15
- const { sidebarOpen, toggleSidebar } = useSidebar();
16
- const screen = useScreenSize();
17
- return (
18
- <SidebarHeader className={styles.root}>
19
- <div className={styles.logoContainer}>
20
- <CubicsUILogo
21
- onlyFavicon={screen?.gtSmall ? !sidebarOpen : false}
22
- className={cn(styles.logo)}
23
- />
24
- </div>
25
- <Button square onClick={toggleSidebar}>
26
- {sidebarOpen ? <PanelLeftClose /> : <PanelLeftOpen />}
27
- </Button>
28
- </SidebarHeader>
29
- );
30
- }
@@ -1,2 +0,0 @@
1
- export * from "./CMSSecurityLayout"
2
- export * from "./CMSSidebar/_index"
@@ -1,50 +0,0 @@
1
- /* Yes this is seperate its meant to be separate dont make the SignUp and SignIn styles into one eventhough they are the exact same. Just dont do it ples! */
2
- .root,
3
- .body,
4
- .header,
5
- .form,
6
- .footer {
7
- display: flex;
8
- flex-direction: column;
9
- }
10
- .root {
11
- width: clamp(350px, 50vw, 550px);
12
- align-items: center;
13
- gap: var(--spacing-gap-7);
14
- & p {
15
- font-size: var(--fs-body2);
16
- text-align: center;
17
- }
18
- }
19
- .body {
20
- width: 100%;
21
- align-items: center;
22
- gap: var(--spacing-gap-3);
23
- }
24
- .header {
25
- align-items: center;
26
- text-align: center;
27
- gap: var(--spacing-gap);
28
- & > h1 {
29
- font-size: var(--fs-h3);
30
- }
31
- & > p {
32
- font-size: var(--fs-body2);
33
- color: var(--color-on-background-faint);
34
- }
35
- }
36
- .form {
37
- width: 100%;
38
- gap: var(--spacing-gap-2);
39
- }
40
- .footer {
41
- width: 100%;
42
- padding: var(--spacing-gap-3);
43
- align-items: center;
44
- border-top: 1px solid var(--color-outline);
45
- }
46
- .error {
47
- font-size: 2rem;
48
- color: var(--color-error);
49
- }
50
-
@@ -1,79 +0,0 @@
1
- "use client";
2
-
3
- import { useUser } from "@clerk/nextjs";
4
- import {
5
- Button,
6
- Card,
7
- CubicsUILogo,
8
- PasswordInput,
9
- TextInput,
10
- PoweredByBanner,
11
- } from "@studiocubics/ui";
12
- import { useRouter } from "next/navigation";
13
- import { type ChangeEvent, useEffect } from "react";
14
- import styles from "./SignIn.module.css";
15
- import { useSignInForm } from "./useSignInForm";
16
- import Link from "next/link";
17
-
18
- export function SignIn() {
19
- const { user } = useUser();
20
- const router = useRouter();
21
- const { formState, setFormState, pending, error, handleSubmit } =
22
- useSignInForm();
23
-
24
- useEffect(() => {
25
- if (user?.id) {
26
- router.push("/dashboard");
27
- }
28
- }, [user]);
29
-
30
- function handleFormStateChange(e: ChangeEvent<HTMLInputElement>) {
31
- const target = e.currentTarget as HTMLInputElement;
32
- setFormState({ ...formState, [target.id]: target.value });
33
- }
34
-
35
- return (
36
- <Card size="lg" className={styles.root}>
37
- <div className={styles.body}>
38
- <CubicsUILogo width={"120px"} />
39
- <header className={styles.header}>
40
- <h1>Sign in to your Account</h1>
41
- <p>Welcome Back! Lets get started.</p>
42
- </header>
43
- <form onSubmit={handleSubmit} className={styles.form}>
44
- <div id="clerk-captcha" />
45
-
46
- <TextInput
47
- label={"Email Address"}
48
- id="email"
49
- value={formState.email}
50
- onChange={handleFormStateChange}
51
- required
52
- fullWidth
53
- type="email"
54
- />
55
- <PasswordInput
56
- label={"Password"}
57
- id="password"
58
- value={formState.password}
59
- onChange={handleFormStateChange}
60
- required
61
- fullWidth
62
- disabled={pending}
63
- />
64
- <Button type="submit" variant="contained">
65
- Confirm
66
- </Button>
67
- {error && <p className={styles.error}>{error}</p>}
68
- </form>
69
- </div>
70
- <div className={styles.footer}>
71
- <p>
72
- Dont have an account?{" "}
73
- <Link href={"/auth/requestAccount"}>Request</Link> one from an admin
74
- </p>
75
- <PoweredByBanner />
76
- </div>
77
- </Card>
78
- );
79
- }
@@ -1,42 +0,0 @@
1
- "use client";
2
-
3
- import { useSignIn } from "@clerk/nextjs";
4
- import { type SubmitEvent, useState } from "react";
5
-
6
- export function useSignInForm() {
7
- const clerkSignIn = useSignIn();
8
- const [formState, setFormState] = useState({
9
- email: "",
10
- password: "",
11
- });
12
- const [pending, setPending] = useState(false);
13
- const [error, setError] = useState("");
14
-
15
- async function handleSubmit(e: SubmitEvent) {
16
- e.preventDefault();
17
- const { email, password } = formState;
18
- if (!clerkSignIn.isLoaded) return;
19
-
20
- try {
21
- setPending(true);
22
- const signInAttempt = await clerkSignIn.signIn.create({
23
- identifier: email,
24
- password,
25
- });
26
- if (signInAttempt.status === "complete") {
27
- await clerkSignIn.setActive({
28
- session: signInAttempt.createdSessionId,
29
- });
30
- } else {
31
- throw new Error("Sign In failed to complete");
32
- }
33
- } catch (err) {
34
- console.error(err);
35
- if (err instanceof Error) setError(err.message);
36
- } finally {
37
- setPending(false);
38
- }
39
- }
40
-
41
- return { formState, setFormState, pending, error, handleSubmit };
42
- }
@@ -1,48 +0,0 @@
1
- .root,
2
- .body,
3
- .header,
4
- .form,
5
- .footer {
6
- display: flex;
7
- flex-direction: column;
8
- }
9
- .root {
10
- width: clamp(350px, 50vw, 550px);
11
- align-items: center;
12
- gap: var(--spacing-gap-7);
13
- & p {
14
- font-size: var(--fs-body2);
15
- text-align: center;
16
- }
17
- }
18
- .body {
19
- width: 100%;
20
- align-items: center;
21
- gap: var(--spacing-gap-3);
22
- }
23
- .header {
24
- align-items: center;
25
- text-align: center;
26
- gap: var(--spacing-gap);
27
- & > h1 {
28
- font-size: var(--fs-h3);
29
- }
30
- & > p {
31
- font-size: var(--fs-body2);
32
- color: var(--color-on-background-faint);
33
- }
34
- }
35
- .form {
36
- width: 100%;
37
- gap: var(--spacing-gap-2);
38
- }
39
- .footer {
40
- width: 100%;
41
- padding: var(--spacing-gap-3);
42
- align-items: center;
43
- border-top: 1px solid var(--color-outline);
44
- }
45
- .error {
46
- font-size: 2rem;
47
- color: var(--color-error);
48
- }
@@ -1,138 +0,0 @@
1
- "use client";
2
-
3
- import { useUser } from "@clerk/nextjs";
4
- import {
5
- Card,
6
- CubicsUILogo,
7
- TextInput,
8
- PasswordInput,
9
- Button,
10
- PoweredByBanner,
11
- } from "@studiocubics/ui";
12
- import Link from "next/link";
13
- import { useRouter } from "next/navigation";
14
- import { useState, useEffect, type ChangeEvent } from "react";
15
- import styles from "./SignUp.module.css";
16
- import { useSignUpForm } from "./useSignUpForm";
17
-
18
- export function SignUp() {
19
- const { user } = useUser();
20
- const router = useRouter();
21
- const { ticket, setFormState, formState, pending, error, handleSubmit } =
22
- useSignUpForm();
23
- const [step, setStep] = useState(0);
24
-
25
- // Handle signed-in users visiting this page
26
- // This will also redirect the user once they finish the sign-up process
27
- useEffect(() => {
28
- if (user?.id) {
29
- router.push("/dashboard");
30
- }
31
- }, [user]);
32
-
33
- // If there is no invitation ticket, restrict access to this page
34
- if (!ticket) {
35
- return (
36
- <Card size="lg" className={styles.root}>
37
- <p>
38
- Looks like you haven&lsquo;t been invited!
39
- <br /> Please <Link href={"/auth/requestAccount"}>request</Link> an
40
- invitation from an admin.
41
- </p>
42
- </Card>
43
- );
44
- }
45
-
46
- function handleFormStateChange(e: ChangeEvent<HTMLInputElement>) {
47
- setFormState({ ...formState, [e.target.id]: e.target.value });
48
- }
49
-
50
- const Step0 = (
51
- <>
52
- <TextInput
53
- label={"First Name"}
54
- id="firstName"
55
- value={formState.firstName}
56
- onChange={handleFormStateChange}
57
- required
58
- fullWidth
59
- />
60
- <TextInput
61
- label={"Last Name"}
62
- id="lastName"
63
- value={formState.lastName}
64
- onChange={handleFormStateChange}
65
- required
66
- fullWidth
67
- />
68
- <Button
69
- type="button"
70
- variant="contained"
71
- onClick={() => setStep(1)}
72
- fullWidth
73
- disabled={!formState.firstName || !formState.lastName}
74
- >
75
- Continue
76
- </Button>
77
- </>
78
- );
79
- const Step1 = (
80
- <>
81
- <PasswordInput
82
- label={"Password"}
83
- id="password"
84
- value={formState.password}
85
- onChange={handleFormStateChange}
86
- required
87
- fullWidth
88
- disabled={pending}
89
- disableStrengthMeter={false}
90
- />
91
- <PasswordInput
92
- label={"Confirm Password"}
93
- id="confirmPassword"
94
- value={formState.confirmPassword}
95
- onChange={handleFormStateChange}
96
- required
97
- fullWidth
98
- disabled={pending}
99
- />
100
- <Button disabled={pending} variant="contained" type="submit" fullWidth>
101
- Register
102
- </Button>
103
- </>
104
- );
105
- return (
106
- <Card size="lg" className={styles.root}>
107
- <div className={styles.body}>
108
- <CubicsUILogo width={"120px"} />
109
- <header className={styles.header}>
110
- <h1>Create your account</h1>
111
- <p>Welcome! Please fill in the details to get started.</p>
112
- </header>
113
- <form onSubmit={handleSubmit} className={styles.form}>
114
- <div id="clerk-captcha" />
115
- {step == 0 && Step0}
116
- {step == 1 && Step1}
117
- {step > 0 && (
118
- <Button
119
- disabled={pending}
120
- type="button"
121
- onClick={() => setStep(step - 1)}
122
- fullWidth
123
- >
124
- Go back
125
- </Button>
126
- )}
127
- {error && <p className={styles.error}>{error}</p>}
128
- </form>
129
- </div>
130
- <div className={styles.footer}>
131
- <p>
132
- Already have an account? <Link href={"/auth/signIn/"}>Sign In</Link>
133
- </p>
134
- <PoweredByBanner />
135
- </div>
136
- </Card>
137
- );
138
- }
@@ -1,54 +0,0 @@
1
- "use client";
2
-
3
- import { useSignUp } from "@clerk/nextjs";
4
- import { useSearchParams } from "next/navigation";
5
- import { type SubmitEvent, useState } from "react";
6
-
7
- export function useSignUpForm() {
8
- const clerkSignUp = useSignUp();
9
- const [formState, setFormState] = useState({
10
- firstName: "",
11
- lastName: "",
12
- password: "",
13
- confirmPassword: "",
14
- });
15
- const [pending, setPending] = useState(false);
16
- const [error, setError] = useState("");
17
-
18
- const ticket = useSearchParams().get("__clerk_ticket");
19
-
20
- async function handleSubmit(e: SubmitEvent) {
21
- e.preventDefault();
22
- const { firstName, lastName, password, confirmPassword } = formState;
23
- if (!clerkSignUp.isLoaded) return;
24
- if (!ticket) return;
25
- if (password != confirmPassword) {
26
- return setError("Passwords dont match!");
27
- }
28
-
29
- try {
30
- setPending(true);
31
- const signUpAttempt = await clerkSignUp.signUp.create({
32
- strategy: "ticket",
33
- ticket,
34
- firstName,
35
- lastName,
36
- password,
37
- });
38
- if (signUpAttempt.status === "complete") {
39
- await clerkSignUp.setActive({
40
- session: signUpAttempt.createdSessionId,
41
- });
42
- } else {
43
- throw new Error("Sign Up failed to complete");
44
- }
45
- } catch (err) {
46
- console.error(err);
47
- if (err instanceof Error) setError(err.message);
48
- } finally {
49
- setPending(false);
50
- }
51
- }
52
-
53
- return { formState, setFormState, pending, ticket, error, handleSubmit };
54
- }
@@ -1,9 +0,0 @@
1
- import { invitationListReadAction } from "../../../clerk/actions/invitations";
2
- import { InvitationListCard } from "./InvitationListCard";
3
-
4
- export async function InvitationList(params: ClerkInvitationListParams) {
5
- const invitationList = await invitationListReadAction(params);
6
- return invitationList.data.map((inv) => (
7
- <InvitationListCard key={inv.id} invitation={inv} />
8
- ));
9
- }