@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.
- package/dist/clerk/actions/invitations.d.ts +6 -0
- package/dist/clerk/actions/invitations.js +59 -0
- package/dist/clerk/actions/invitations.js.map +1 -0
- package/dist/clerk/actions/systemUsers.d.ts +8 -0
- package/dist/clerk/actions/systemUsers.js +64 -0
- package/dist/clerk/actions/systemUsers.js.map +1 -0
- package/dist/clerk/auth.d.ts +8 -0
- package/dist/clerk/auth.js +21 -0
- package/dist/clerk/auth.js.map +1 -0
- package/dist/clerk/hasPermission.d.ts +33 -0
- package/dist/clerk/hasPermission.js +78 -0
- package/dist/clerk/hasPermission.js.map +1 -0
- package/dist/clerk/rbacConfig.d.ts +31 -0
- package/dist/clerk/rbacConfig.js +48 -0
- package/dist/clerk/rbacConfig.js.map +1 -0
- package/dist/clerk/schemas/invitation.d.ts +12 -0
- package/dist/clerk/schemas/invitation.js +20 -0
- package/dist/clerk/schemas/invitation.js.map +1 -0
- package/dist/clerk/schemas/systemUser.d.ts +6 -0
- package/dist/clerk/toClientSafeUser.d.ts +48 -0
- package/dist/clerk/toClientSafeUser.js +46 -0
- package/dist/clerk/toClientSafeUser.js.map +1 -0
- package/dist/constants/defaults.d.ts +6 -0
- package/dist/constants/defaults.js +56 -0
- package/dist/constants/defaults.js.map +1 -0
- package/dist/constants/pageLimits.d.ts +2 -0
- package/dist/constants/pageLimits.js +5 -0
- package/dist/constants/pageLimits.js.map +1 -0
- package/dist/index.css +215 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/CMSRootProviders.d.ts +4 -0
- package/dist/providers/CMSRootProviders.js +11 -0
- package/dist/providers/CMSRootProviders.js.map +1 -0
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.d.ts +2 -0
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js +13 -0
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.js.map +1 -0
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js +4 -0
- package/dist/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css.js.map +1 -0
- package/dist/ui/Layout/CMSSecurityLayout.d.ts +2 -0
- package/dist/ui/Layout/CMSSecurityLayout.js +18 -0
- package/dist/ui/Layout/CMSSecurityLayout.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebar.d.ts +6 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebar.js +15 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebar.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.d.ts +4 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js +18 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarBody.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.d.ts +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js +39 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js +4 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.d.ts +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js +16 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.js.map +1 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js +4 -0
- package/dist/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css.js.map +1 -0
- package/dist/ui/Layout/_index.d.ts +2 -0
- package/dist/ui/System/Auth/SignIn/SignIn.d.ts +1 -0
- package/dist/ui/System/Auth/SignIn/SignIn.js +28 -0
- package/dist/ui/System/Auth/SignIn/SignIn.js.map +1 -0
- package/dist/ui/System/Auth/SignIn/SignIn.module.css.js +4 -0
- package/dist/ui/System/Auth/SignIn/SignIn.module.css.js.map +1 -0
- package/dist/ui/System/Auth/SignIn/useSignInForm.d.ts +14 -0
- package/dist/ui/System/Auth/SignIn/useSignInForm.js +46 -0
- package/dist/ui/System/Auth/SignIn/useSignInForm.js.map +1 -0
- package/dist/ui/System/Auth/SignUp/SignUp.d.ts +1 -0
- package/dist/ui/System/Auth/SignUp/SignUp.js +36 -0
- package/dist/ui/System/Auth/SignUp/SignUp.js.map +1 -0
- package/dist/ui/System/Auth/SignUp/SignUp.module.css.js +4 -0
- package/dist/ui/System/Auth/SignUp/SignUp.module.css.js.map +1 -0
- package/dist/ui/System/Auth/SignUp/useSignUpForm.d.ts +19 -0
- package/dist/ui/System/Auth/SignUp/useSignUpForm.js +58 -0
- package/dist/ui/System/Auth/SignUp/useSignUpForm.js.map +1 -0
- package/dist/ui/System/Invitations/InvitationList.d.ts +1 -0
- package/dist/ui/System/Invitations/InvitationList.js +11 -0
- package/dist/ui/System/Invitations/InvitationList.js.map +1 -0
- package/dist/ui/System/Invitations/InvitationListActions.d.ts +11 -0
- package/dist/ui/System/Invitations/InvitationListActions.js +39 -0
- package/dist/ui/System/Invitations/InvitationListActions.js.map +1 -0
- package/dist/ui/System/Invitations/InvitationListCard.d.ts +4 -0
- package/dist/ui/System/Invitations/InvitationListCard.js +16 -0
- package/dist/ui/System/Invitations/InvitationListCard.js.map +1 -0
- package/dist/ui/System/Invitations/InvitationListPage.d.ts +2 -0
- package/dist/ui/System/Invitations/InvitationListPage.js +22 -0
- package/dist/ui/System/Invitations/InvitationListPage.js.map +1 -0
- package/dist/ui/System/Invitations/InvitationListPagination.d.ts +4 -0
- package/dist/ui/System/Invitations/InvitationListPagination.js +11 -0
- package/dist/ui/System/Invitations/InvitationListPagination.js.map +1 -0
- package/dist/ui/System/Permissions/RoleListCard.d.ts +6 -0
- package/dist/ui/System/Permissions/RoleListCard.js +11 -0
- package/dist/ui/System/Permissions/RoleListCard.js.map +1 -0
- package/dist/ui/System/Permissions/RolePermissionsPage.d.ts +4 -0
- package/dist/ui/System/Permissions/RolePermissionsPage.js +14 -0
- package/dist/ui/System/Permissions/RolePermissionsPage.js.map +1 -0
- package/dist/ui/System/Permissions/RolePermissionsTable.d.ts +2 -0
- package/dist/ui/System/Permissions/RolePermissionsTable.js +28 -0
- package/dist/ui/System/Permissions/RolePermissionsTable.js.map +1 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.d.ts +5 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js +31 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.js.map +1 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js +4 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css.js.map +1 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserPage.d.ts +1 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserPage.js +17 -0
- package/dist/ui/System/SystemUser/CurrentSystemUserPage.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserActions.d.ts +6 -0
- package/dist/ui/System/SystemUser/SystemUserActions.js +14 -0
- package/dist/ui/System/SystemUser/SystemUserActions.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.d.ts +12 -0
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js +16 -0
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js +4 -0
- package/dist/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.d.ts +11 -0
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js +26 -0
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js +4 -0
- package/dist/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserList.d.ts +1 -0
- package/dist/ui/System/SystemUser/SystemUserList.js +11 -0
- package/dist/ui/System/SystemUser/SystemUserList.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserListActions.d.ts +1 -0
- package/dist/ui/System/SystemUser/SystemUserListActions.js +11 -0
- package/dist/ui/System/SystemUser/SystemUserListActions.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserListCard.d.ts +11 -0
- package/dist/ui/System/SystemUser/SystemUserListCard.js +34 -0
- package/dist/ui/System/SystemUser/SystemUserListCard.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserListPage.d.ts +2 -0
- package/dist/ui/System/SystemUser/SystemUserListPage.js +24 -0
- package/dist/ui/System/SystemUser/SystemUserListPage.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserListPagination.d.ts +4 -0
- package/dist/ui/System/SystemUser/SystemUserListPagination.js +11 -0
- package/dist/ui/System/SystemUser/SystemUserListPagination.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserPage.d.ts +1 -0
- package/dist/ui/System/SystemUser/SystemUserPage.js +17 -0
- package/dist/ui/System/SystemUser/SystemUserPage.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserPageContent.d.ts +5 -0
- package/dist/ui/System/SystemUser/SystemUserPageContent.js +13 -0
- package/dist/ui/System/SystemUser/SystemUserPageContent.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.d.ts +6 -0
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js +21 -0
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js +4 -0
- package/dist/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.d.ts +9 -0
- package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js +19 -0
- package/dist/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.js.map +1 -0
- package/dist/ui/System/SystemUser/SystemUserTimestamps.d.ts +9 -0
- package/dist/ui/System/SystemUser/SystemUserTimestamps.js +27 -0
- package/dist/ui/System/SystemUser/SystemUserTimestamps.js.map +1 -0
- package/dist/ui/System/WelcomePage/WelcomePage.d.ts +1 -0
- package/dist/ui/System/WelcomePage/WelcomePage.js +16 -0
- package/dist/ui/System/WelcomePage/WelcomePage.js.map +1 -0
- package/dist/ui/System/WelcomePage/WelcomePage.module.css.js +4 -0
- package/dist/ui/System/WelcomePage/WelcomePage.module.css.js.map +1 -0
- package/{src/ui/System/types.ts → dist/ui/System/types.d.ts} +3 -5
- package/dist/utils/proxyFunctions.d.ts +4 -0
- package/dist/utils/proxyFunctions.js +34 -0
- package/dist/utils/proxyFunctions.js.map +1 -0
- package/package.json +14 -14
- package/rollup.config.js +1 -1
- package/.turbo/turbo-build.log +0 -7
- package/CHANGELOG.md +0 -12
- package/eslint.config.js +0 -21
- package/src/clerk/actions/invitations.ts +0 -78
- package/src/clerk/actions/systemUsers.ts +0 -94
- package/src/clerk/auth.ts +0 -34
- package/src/clerk/clerk.d.ts +0 -105
- package/src/clerk/hasPermission.ts +0 -96
- package/src/clerk/rbacConfig.ts +0 -68
- package/src/clerk/schemas/invitation.ts +0 -17
- package/src/clerk/schemas/systemUser.ts +0 -16
- package/src/clerk/toClientSafeUser.ts +0 -77
- package/src/constants/defaults.tsx +0 -62
- package/src/constants/pageLimits.ts +0 -2
- package/src/declaration.d.ts +0 -5
- package/src/providers/CMSRootProviders.tsx +0 -13
- package/src/routes.d.ts +0 -96
- package/src/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.module.css +0 -4
- package/src/ui/Inputs/ThemedMonacoEditor/ThemedMonacoEditor.tsx +0 -16
- package/src/ui/Layout/CMSSecurityLayout.tsx +0 -27
- package/src/ui/Layout/CMSSidebar/CMSSidebar.tsx +0 -39
- package/src/ui/Layout/CMSSidebar/CMSSidebarBody.tsx +0 -43
- package/src/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.module.css +0 -7
- package/src/ui/Layout/CMSSidebar/CMSSidebarFooter/CMSSidebarFooter.tsx +0 -59
- package/src/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.module.css +0 -44
- package/src/ui/Layout/CMSSidebar/CMSSidebarHeader/CMSSidebarHeader.tsx +0 -30
- package/src/ui/Layout/_index.ts +0 -2
- package/src/ui/System/Auth/SignIn/SignIn.module.css +0 -50
- package/src/ui/System/Auth/SignIn/SignIn.tsx +0 -79
- package/src/ui/System/Auth/SignIn/useSignInForm.tsx +0 -42
- package/src/ui/System/Auth/SignUp/SignUp.module.css +0 -48
- package/src/ui/System/Auth/SignUp/SignUp.tsx +0 -138
- package/src/ui/System/Auth/SignUp/useSignUpForm.tsx +0 -54
- package/src/ui/System/Invitations/InvitationList.tsx +0 -9
- package/src/ui/System/Invitations/InvitationListActions.tsx +0 -167
- package/src/ui/System/Invitations/InvitationListCard.tsx +0 -79
- package/src/ui/System/Invitations/InvitationListPage.tsx +0 -32
- package/src/ui/System/Invitations/InvitationListPagination.tsx +0 -19
- package/src/ui/System/Permissions/RoleListCard.tsx +0 -33
- package/src/ui/System/Permissions/RolePermissionsPage.tsx +0 -18
- package/src/ui/System/Permissions/RolePermissionsTable.tsx +0 -36
- package/src/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.module.css +0 -5
- package/src/ui/System/SystemUser/CurrentSystemUserButton/CurrentSystemUserButton.tsx +0 -102
- package/src/ui/System/SystemUser/CurrentSystemUserPage.tsx +0 -12
- package/src/ui/System/SystemUser/SystemUserActions.tsx +0 -45
- package/src/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.module.css +0 -6
- package/src/ui/System/SystemUser/SystemUserDetails/SystemUserDetails.tsx +0 -71
- package/src/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.module.css +0 -7
- package/src/ui/System/SystemUser/SystemUserDetailsForm/SystemUserDetailsForm.tsx +0 -114
- package/src/ui/System/SystemUser/SystemUserList.tsx +0 -18
- package/src/ui/System/SystemUser/SystemUserListActions.tsx +0 -17
- package/src/ui/System/SystemUser/SystemUserListCard.tsx +0 -85
- package/src/ui/System/SystemUser/SystemUserListPage.tsx +0 -33
- package/src/ui/System/SystemUser/SystemUserListPagination.tsx +0 -19
- package/src/ui/System/SystemUser/SystemUserPage.tsx +0 -30
- package/src/ui/System/SystemUser/SystemUserPageContent.tsx +0 -54
- package/src/ui/System/SystemUser/SystemUserRole/SystemUserRole.module.css +0 -17
- package/src/ui/System/SystemUser/SystemUserRole/SystemUserRole.tsx +0 -64
- package/src/ui/System/SystemUser/SystemUserRoleForm/SystemUserRoleForm.tsx +0 -51
- package/src/ui/System/SystemUser/SystemUserTimestamps.tsx +0 -56
- package/src/ui/System/WelcomePage/WelcomePage.module.css +0 -18
- package/src/ui/System/WelcomePage/WelcomePage.tsx +0 -43
- package/src/utils/proxyFunctions.ts +0 -37
- package/tsconfig.json +0 -32
- /package/{src/clerk/_index.ts → dist/clerk/_index.d.ts} +0 -0
- /package/{src/clerk/actions/_index.ts → dist/clerk/actions/_index.d.ts} +0 -0
- /package/{src/clerk/schemas/_index.ts → dist/clerk/schemas/_index.d.ts} +0 -0
- /package/{src/constants/_index.ts → dist/constants/_index.d.ts} +0 -0
- /package/{src/index.ts → dist/index.d.ts} +0 -0
- /package/{src/providers/_index.ts → dist/providers/_index.d.ts} +0 -0
- /package/{src/ui/Inputs/_index.ts → dist/ui/Inputs/_index.d.ts} +0 -0
- /package/{src/ui/Layout/CMSSidebar/_index.ts → dist/ui/Layout/CMSSidebar/_index.d.ts} +0 -0
- /package/{src/ui/System/Auth/SignIn/_index.ts → dist/ui/System/Auth/SignIn/_index.d.ts} +0 -0
- /package/{src/ui/System/Auth/SignUp/_index.ts → dist/ui/System/Auth/SignUp/_index.d.ts} +0 -0
- /package/{src/ui/System/Auth/_index.ts → dist/ui/System/Auth/_index.d.ts} +0 -0
- /package/{src/ui/System/Invitations/_index.ts → dist/ui/System/Invitations/_index.d.ts} +0 -0
- /package/{src/ui/System/Permissions/_index.ts → dist/ui/System/Permissions/_index.d.ts} +0 -0
- /package/{src/ui/System/SystemUser/_index.ts → dist/ui/System/SystemUser/_index.d.ts} +0 -0
- /package/{src/ui/System/_index.ts → dist/ui/System/_index.d.ts} +0 -0
- /package/{src/ui/_index.ts → dist/ui/_index.d.ts} +0 -0
- /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,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
|
-
}
|
package/src/ui/Layout/_index.ts
DELETED
|
@@ -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‘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
|
-
}
|