style: dark mode

This commit is contained in:
LAKHAN BAHETI 2023-11-18 20:05:23 +05:30
parent 8551faf314
commit da29dd3094
16 changed files with 550 additions and 450 deletions

View File

@ -176,6 +176,24 @@ module.exports = {
}, },
backdrop: "rgba(0, 0, 0, 0.25)", backdrop: "rgba(0, 0, 0, 0.25)",
}, },
onboarding: {
background: {
100: convertToRGB("--color-onboarding-background-100"),
200: convertToRGB("--color-onboarding-background-200"),
300: convertToRGB("--color-onboarding-background-300"),
400: convertToRGB("--color-onboarding-background-400"),
},
text:{
100: convertToRGB("--color-onboarding-text-100"),
200: convertToRGB("--color-onboarding-text-200"),
300: convertToRGB("--color-onboarding-text-300"),
400: convertToRGB("--color-onboarding-text-400"),
},
border: {
100: convertToRGB("--color-onboarding-border-100"),
200: convertToRGB("--color-onboarding-border-200"),
},
},
}, },
keyframes: { keyframes: {
leftToaster: { leftToaster: {

View File

@ -16,13 +16,12 @@ import { AlertTriangle } from "lucide-react";
type Props = { type Props = {
isOpen: boolean; isOpen: boolean;
onClose: () => void; onClose: () => void;
heading: string;
}; };
const authService = new AuthService(); const authService = new AuthService();
const DeleteAccountModal: React.FC<Props> = (props) => { const DeleteAccountModal: React.FC<Props> = (props) => {
const { isOpen, onClose, heading } = props; const { isOpen, onClose } = props;
const [isDeleteLoading, setIsDeleteLoading] = useState(false); const [isDeleteLoading, setIsDeleteLoading] = useState(false);
const router = useRouter(); const router = useRouter();
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();
@ -72,20 +71,20 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
leaveFrom="opacity-100 translate-y-0 sm:scale-100" leaveFrom="opacity-100 translate-y-0 sm:scale-100"
leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95" leaveTo="opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
> >
<Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-custom-background-100 text-left shadow-custom-shadow-md transition-all sm:my-8 sm:w-[40rem]"> <Dialog.Panel className="relative transform overflow-hidden rounded-lg bg-onboarding-background-200 text-left shadow-custom-shadow-md transition-all sm:my-8 sm:w-[40rem]">
<div className="px-4 pt-5 pb-4 sm:p-6 sm:pb-4"> <div className="px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div className=""> <div className="">
<div className="flex items-center gap-x-4"> <div className="flex items-center gap-x-4">
<div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"> <div className="mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10">
<AlertTriangle className="h-6 w-6 text-red-600" aria-hidden="true" /> <AlertTriangle className="h-6 w-6 text-red-600" aria-hidden="true" />
</div> </div>
<Dialog.Title as="h3" className="text-2xl font-medium leading-6 text-custom-text-100"> <Dialog.Title as="h3" className="text-2xl font-medium leading-6 text-onboarding-text-100">
{heading} Not the right workspace?
</Dialog.Title> </Dialog.Title>
</div> </div>
<div className="mt-6 px-4"> <div className="mt-6 px-4">
<p className="text-custom-text-400 font-normal text-base"> <p className="text-onboarding-text-300 font-normal text-base">
<li>Delete this account if you have another and wont use this account.</li> <li>Delete this account if you have another and wont use this account.</li>
<li>Switch to another account if youd like to come back to this account another time.</li> <li>Switch to another account if youd like to come back to this account another time.</li>
</p> </p>
@ -96,9 +95,9 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
<span className="text-sm font-medium hover:cursor-pointer" onClick={handleSignOut}> <span className="text-sm font-medium hover:cursor-pointer" onClick={handleSignOut}>
Switch account Switch account
</span> </span>
<Button variant="outline-danger" size="sm" tabIndex={1} loading={isDeleteLoading}> <button className="py-1.5 px-3 font-medium rounded-sm text-red-500 border border-red-500 text-sm ">
{isDeleteLoading ? "Deleting..." : "Delete account"} {isDeleteLoading ? "Deleting..." : "Delete account"}
</Button> </button>
</div> </div>
</Dialog.Panel> </Dialog.Panel>
</Transition.Child> </Transition.Child>

View File

@ -9,6 +9,7 @@ import useToast from "hooks/use-toast";
import useTimer from "hooks/use-timer"; import useTimer from "hooks/use-timer";
// icons // icons
import { XCircle } from "lucide-react"; import { XCircle } from "lucide-react";
import { useTheme } from "next-themes";
// types // types
type EmailCodeFormValues = { type EmailCodeFormValues = {
@ -93,10 +94,6 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
const emailOld = getValues("email"); const emailOld = getValues("email");
useEffect(() => {
setErrorResendingCode(false);
}, [emailOld]);
useEffect(() => { useEffect(() => {
const submitForm = (e: KeyboardEvent) => { const submitForm = (e: KeyboardEvent) => {
if (!codeSent && e.key === "Enter") { if (!codeSent && e.key === "Enter") {
@ -133,21 +130,21 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
<h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100"> <h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100">
Moving to the runway Moving to the runway
</h1> </h1>
<div className="text-center text-sm text-custom-text-100 mt-3"> <div className="text-center text-sm text-onboarding-text-200 mt-3">
<p>Paste the code you got at </p> <p>Paste the code you got at </p>
<span className="text-center text-sm text-custom-primary-80 mt-1 font-semibold ">{sentEmail} </span> <span className="text-center text-sm text-custom-primary-80 mt-1 font-semibold ">{sentEmail} </span>
<span>below.</span> <span className="text-onboarding-text-200">below.</span>
</div> </div>
</> </>
) : ( ) : (
<> <>
<h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-custom-text-100"> <h1 className="text-center text-2xl sm:text-2.5xl font-semibold text-onboarding-text-100">
Lets get you prepped! Lets get you prepped!
</h1> </h1>
<p className="text-center text-sm text-custom-text-100 mt-3"> <p className="text-center text-sm text-onboarding-text-200 mt-3">
This whole thing will take less than two minutes. This whole thing will take less than two minutes.
</p> </p>
<p className="text-center text-sm text-custom-text-100 mt-1">Promise!</p> <p className="text-center text-sm text-onboarding-text-200 mt-1">Promise!</p>
</> </>
)} )}
@ -164,7 +161,7 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
) || "Email address is not valid", ) || "Email address is not valid",
}} }}
render={({ field: { value, onChange, ref } }) => ( render={({ field: { value, onChange, ref } }) => (
<div className="flex items-center relative rounded-md bg-white"> <div className={`flex items-center relative rounded-md bg-onboarding-background-200`}>
<Input <Input
id="email" id="email"
name="email" name="email"
@ -174,8 +171,8 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
ref={ref} ref={ref}
hasError={Boolean(errors.email)} hasError={Boolean(errors.email)}
placeholder="orville.wright@firstflight.com" placeholder="orville.wright@firstflight.com"
className="w-full h-[46px] placeholder:text-custom-text-400/50 border-custom-border-200 pr-12" className={`w-full h-[46px] placeholder:text-onboarding-text-400 border border-onboarding-border-100 pr-12`}
></Input> />
{value.length > 0 && ( {value.length > 0 && (
<XCircle <XCircle
className="h-5 w-5 absolute stroke-custom-text-400 hover:cursor-pointer right-3" className="h-5 w-5 absolute stroke-custom-text-400 hover:cursor-pointer right-3"
@ -191,11 +188,11 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
<> <>
<div> <div>
{codeResent && sentEmail === getValues("email") ? ( {codeResent && sentEmail === getValues("email") ? (
<div className="text-sm my-2.5 text-custom-text-400 m-0"> <div className="text-sm my-2.5 text-onboarding-text-300 m-0">
You got a new code at <span className="font-semibold text-custom-primary-80">{sentEmail}</span>. You got a new code at <span className="font-semibold text-custom-primary-80">{sentEmail}</span>.
</div> </div>
) : sentEmail != getValues("email") && getValues("email").length > 0 ? ( ) : sentEmail != getValues("email") && getValues("email").length > 0 ? (
<div className="text-sm my-2.5 text-custom-text-400 m-0"> <div className="text-sm my-2.5 text-onboarding-text-300 m-0">
Hit enter Hit enter
<span> </span>or <span className="italic">Tab</span> to get a new code <span> </span>or <span className="italic">Tab</span> to get a new code
</div> </div>
@ -203,27 +200,28 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
<div className="my-4" /> <div className="my-4" />
)} )}
</div> </div>
<div className={`flex items-center relative rounded-md bg-onboarding-background-200`}>
<Controller <Controller
control={control} control={control}
name="token" name="token"
rules={{ rules={{
required: "Code is required", required: "Code is required",
}} }}
render={({ field: { value, onChange, ref } }) => ( render={({ field: { value, onChange, ref } }) => (
<Input <Input
id="token" id="token"
name="token" name="token"
type="token" type="token"
value={value ?? ""} value={value ?? ""}
onChange={onChange} onChange={onChange}
ref={ref} ref={ref}
hasError={Boolean(errors.token)} hasError={Boolean(errors.token)}
placeholder="get-set-fly" placeholder="get-set-fly"
className="border-custom-border-300 bg-white h-[46px] w-full" className="border-onboarding-border-100 h-[46px] w-full"
/> />
)} )}
/> />
</div>
</> </>
)} )}
{codeSent ? ( {codeSent ? (
@ -241,7 +239,7 @@ export const EmailCodeForm = ({ handleSignIn }: any) => {
{isLoading ? "Signing in..." : "Next step"} {isLoading ? "Signing in..." : "Next step"}
</Button> </Button>
<div className="w-[70%] my-4 mx-auto"> <div className="w-[70%] my-4 mx-auto">
<p className="text-xs text-custom-text-200"> <p className="text-xs text-onboarding-text-300">
When you click the button above, you agree with our{" "} When you click the button above, you agree with our{" "}
<a <a
href="https://plane.so/terms-and-conditions" href="https://plane.so/terms-and-conditions"

View File

@ -43,14 +43,16 @@ export const GithubLoginButton: FC<GithubLoginButtonProps> = (props) => {
<Link <Link
href={`https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${loginCallBackURL}&scope=read:user,user:email`} href={`https://github.com/login/oauth/authorize?client_id=${clientId}&redirect_uri=${loginCallBackURL}&scope=read:user,user:email`}
> >
<button className="flex w-full items-center justify-center gap-2 rounded border border-custom-primary-20 p-2 text-sm font-medium text-custom-text-100 duration-300 hover:bg-custom-background-80 h-[46px]"> <button
className={`flex w-full items-center justify-center gap-2 hover:bg-onboarding-background-300 rounded border border-onboarding-border-200 p-2 text-sm font-medium text-custom-text-100 duration-300 h-[46px]`}
>
<Image <Image
src={theme === "dark" ? githubWhiteImage : githubBlackImage} src={theme === "dark" ? githubWhiteImage : githubBlackImage}
height={20} height={20}
width={20} width={20}
alt="GitHub Logo" alt="GitHub Logo"
/> />
<span>Sign in with GitHub</span> <span className="text-onboarding-text-200">Sign in with GitHub</span>
</button> </button>
</Link> </Link>
</div> </div>

View File

@ -1,9 +1,9 @@
import React from "react"; import React, { useEffect } from "react";
import { Avatar, DiceIcon, PhotoFilterIcon } from "@plane/ui"; import { Avatar, DiceIcon, PhotoFilterIcon } from "@plane/ui";
// mobx store // mobx store
import { useMobxStore } from "lib/mobx/store-provider"; import { useMobxStore } from "lib/mobx/store-provider";
// react-hook-form // react-hook-form
import { Control, Controller, UseFormSetValue } from "react-hook-form"; import { Control, Controller, UseFormSetValue, UseFormWatch } from "react-hook-form";
// types // types
import { IWorkspace } from "types"; import { IWorkspace } from "types";
// icons // icons
@ -80,13 +80,13 @@ type Props = {
showProject: boolean; showProject: boolean;
control?: Control<IWorkspace, any>; control?: Control<IWorkspace, any>;
setValue?: UseFormSetValue<IWorkspace>; setValue?: UseFormSetValue<IWorkspace>;
watch?: UseFormWatch<IWorkspace>;
}; };
var timer: number = 0; var timer: number = 0;
var lastWorkspaceName: string = ""; var lastWorkspaceName: string = "";
const DummySidebar: React.FC<Props> = (props) => { const DummySidebar: React.FC<Props> = (props) => {
const { workspaceName, showProject, control, setValue } = props; const { workspaceName, showProject, control, setValue, watch } = props;
const { workspace: workspaceStore, user: userStore } = useMobxStore(); const { workspace: workspaceStore, user: userStore } = useMobxStore();
const workspace = workspaceStore.workspaces ? workspaceStore.workspaces[0] : null; const workspace = workspaceStore.workspaces ? workspaceStore.workspaces[0] : null;
const handleZoomWorkspace = (value: string) => { const handleZoomWorkspace = (value: string) => {
@ -104,14 +104,20 @@ const DummySidebar: React.FC<Props> = (props) => {
setValue!("name", lastWorkspaceName); setValue!("name", lastWorkspaceName);
clearInterval(interval); clearInterval(interval);
} }
console.log("timer", timer);
timer--; timer--;
}, 1000); }, 1000);
} }
}; };
console.log("CALLED"); useEffect(() => {
if (watch) {
watch();
}
});
return ( return (
<div className="border-r relative "> <div className="border-r h-full border-onboarding-border-100 relative ">
<div> <div>
{control && setValue ? ( {control && setValue ? (
<Controller <Controller
@ -122,8 +128,8 @@ const DummySidebar: React.FC<Props> = (props) => {
handleZoomWorkspace(value); handleZoomWorkspace(value);
} }
return timer > 0 ? ( return timer > 0 ? (
<div className="py-6 pl-4 top-3 mt-4 transition-all bg-custom-background-100 w-full max-w-screen-sm flex items-center ml-6 border-8 border-custom-primary-20 rounded-md"> <div className="py-6 pl-4 top-3 mt-4 transition-all bg-onboarding-background-200 w-full max-w-screen-sm flex items-center ml-6 border-8 border-onboarding-background-100 rounded-md">
<div className="bg-slate-200 w-full p-1 flex items-center"> <div className="bg-onboarding-background-100 w-full p-1 flex items-center">
<div className="flex flex-shrink-0"> <div className="flex flex-shrink-0">
<Avatar <Avatar
name={value.length > 0 ? value[0].toLocaleUpperCase() : "N"} name={value.length > 0 ? value[0].toLocaleUpperCase() : "N"}
@ -135,11 +141,11 @@ const DummySidebar: React.FC<Props> = (props) => {
/> />
</div> </div>
<span className="text-xl font-medium text-custom-text-300 ml-2 truncate">{value}</span> <span className="text-xl font-medium text-onboarding-text-100 ml-2 truncate">{value}</span>
</div> </div>
</div> </div>
) : ( ) : (
<div className="flex transition-all w-full items-center gap-y-2 px-4 pt-6 truncate"> <div className="flex transition-all w-full border border-transparent items-center gap-y-2 px-4 pt-6 truncate">
<div className="flex flex-shrink-0"> <div className="flex flex-shrink-0">
<Avatar <Avatar
name={value.length > 0 ? value : workspace ? workspace.name[0].toLocaleUpperCase() : "N"} name={value.length > 0 ? value : workspace ? workspace.name[0].toLocaleUpperCase() : "N"}
@ -211,26 +217,24 @@ const DummySidebar: React.FC<Props> = (props) => {
<div <div
className={`flex items-center justify-center rounded flex-shrink-0 p-2 outline-none className={`flex items-center justify-center rounded flex-shrink-0 p-2 outline-none
"shadow-custom-sidebar-shadow-2xs border-[0.5px] border-custom-border-200" shadow-custom-sidebar-shadow-2xs border-[0.5px] border-onboarding-border-200
`} `}
> >
<Search className="h-4 w-4 text-custom-sidebar-text-300" /> <Search className="h-4 w-4 text-onboarding-text-200" />
</div> </div>
</div> </div>
{workspaceLinks.map((link) => { {workspaceLinks.map((link) => (
return ( <a className="block w-full">
<a className="block w-full"> <div
<div className={`group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-base font-medium outline-none
className={`group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-base font-medium outline-none text-onboarding-text-200 focus:bg-custom-sidebar-background-80
text-custom-sidebar-text-200 focus:bg-custom-sidebar-background-80
`} `}
> >
{<link.Icon className="h-4 w-4" />} {<link.Icon className="h-4 w-4" />}
{link.name} {link.name}
</div> </div>
</a> </a>
); ))}
})}
</div> </div>
{showProject && ( {showProject && (
@ -243,20 +247,18 @@ const DummySidebar: React.FC<Props> = (props) => {
<span> Plane web</span> <span> Plane web</span>
<ChevronDown className="h-4 w-4" /> <ChevronDown className="h-4 w-4" />
</div> </div>
{projectLinks.map((link) => { {projectLinks.map((link) => (
return ( <a className="block w-full">
<a className="block w-full"> <div
<div className={`group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-base font-medium outline-none
className={`group flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-base font-medium outline-none
text-custom-sidebar-text-200 focus:bg-custom-sidebar-background-80 text-custom-sidebar-text-200 focus:bg-custom-sidebar-background-80
`} `}
> >
{<link.Icon className="h-4 w-4" />} {<link.Icon className="h-4 w-4" />}
{link.name} {link.name}
</div> </div>
</a> </a>
); ))}
})}
</div> </div>
</div> </div>
)} )}

View File

@ -1,23 +1,21 @@
import React from "react"; import React from "react";
const OnboardingStepIndicator = ({ step }: { step: number }) => { const OnboardingStepIndicator = ({ step }: { step: number }) => (
return ( <div className="flex items-center justify-center">
<div className="flex items-center justify-center"> <div className="h-4 w-4 rounded-full bg-custom-primary-100 z-10" />
<div className="h-4 w-4 rounded-full bg-custom-primary-100 z-10" /> <div className={`h-1 w-14 -ml-1 ${step >= 2 ? "bg-custom-primary-100" : "bg-onboarding-background-100"}`} />
<div className={`h-1 w-14 -ml-1 ${step >= 2 ? "bg-custom-primary-100" : "bg-custom-primary-20"}`} /> <div
<div className={` z-10 -ml-1 rounded-full ${
className={` z-10 -ml-1 rounded-full ${ step >= 2 ? "bg-custom-primary-100 h-4 w-4" : " h-3 w-3 bg-onboarding-background-100"
step >= 2 ? "bg-custom-primary-100 h-4 w-4" : " h-3 w-3 bg-custom-primary-20" }`}
}`} />
/> <div className={`h-1 w-14 -ml-1 ${step >= 3 ? "bg-custom-primary-100" : "bg-onboarding-background-100"}`} />
<div className={`h-1 w-14 -ml-1 ${step >= 3 ? "bg-custom-primary-100" : "bg-custom-primary-20"}`} /> <div
<div className={`rounded-full -ml-1 z-10 ${
className={`rounded-full -ml-1 z-10 ${ step >= 3 ? "bg-custom-primary-100 h-4 w-4" : "h-3 w-3 bg-onboarding-background-100"
step >= 3 ? "bg-custom-primary-100 h-4 w-4" : "h-3 w-3 bg-custom-primary-20" }`}
}`} />
/> </div>
</div> );
);
};
export default OnboardingStepIndicator; export default OnboardingStepIndicator;

View File

@ -1,7 +1,7 @@
// react // react
import React, { useState } from "react"; import React, { useState } from "react";
// components // components
import { Button } from "@plane/ui"; import { Button, Loader } from "@plane/ui";
// helpers // helpers
import { truncateText } from "helpers/string.helper"; import { truncateText } from "helpers/string.helper";
@ -17,24 +17,29 @@ import { ROLE } from "constants/workspace";
// types // types
import { IWorkspaceMemberInvitation } from "types"; import { IWorkspaceMemberInvitation } from "types";
// icons // icons
import { CheckCircle2 } from "lucide-react"; import { CheckCircle2, Search } from "lucide-react";
type Props = { type Props = {
handleNextStep: () => void; handleNextStep: () => void;
updateLastWorkspace: () => void; setTryDiffAccount: () => void;
}; };
const workspaceService = new WorkspaceService(); const workspaceService = new WorkspaceService();
const Invitations: React.FC<Props> = (props) => { const Invitations: React.FC<Props> = (props) => {
const { handleNextStep, updateLastWorkspace } = props; const { handleNextStep, setTryDiffAccount } = props;
const [isJoiningWorkspaces, setIsJoiningWorkspaces] = useState(false); const [isJoiningWorkspaces, setIsJoiningWorkspaces] = useState(false);
const [invitationsRespond, setInvitationsRespond] = useState<string[]>([]); const [invitationsRespond, setInvitationsRespond] = useState<string[]>([]);
const { workspace: workspaceStore } = useMobxStore(); const {
workspace: workspaceStore,
user: { updateCurrentUser },
} = useMobxStore();
const { data: invitations, mutate: mutateInvitations } = useSWR(USER_WORKSPACE_INVITATIONS, () => const {
workspaceService.userWorkspaceInvitations() data: invitations,
); mutate: mutateInvitations,
isLoading,
} = useSWR(USER_WORKSPACE_INVITATIONS, () => workspaceService.userWorkspaceInvitations());
const handleInvitation = (workspace_invitation: IWorkspaceMemberInvitation, action: "accepted" | "withdraw") => { const handleInvitation = (workspace_invitation: IWorkspaceMemberInvitation, action: "accepted" | "withdraw") => {
if (action === "accepted") { if (action === "accepted") {
@ -44,6 +49,13 @@ const Invitations: React.FC<Props> = (props) => {
} }
}; };
const updateLastWorkspace = async () => {
if (!workspaceStore.workspaces) return;
await updateCurrentUser({
last_workspace_id: workspaceStore.workspaces[0].id,
});
};
const submitInvitations = async () => { const submitInvitations = async () => {
if (invitationsRespond.length <= 0) return; if (invitationsRespond.length <= 0) return;
@ -61,55 +73,98 @@ const Invitations: React.FC<Props> = (props) => {
.finally(() => setIsJoiningWorkspaces(false)); .finally(() => setIsJoiningWorkspaces(false));
}; };
return ( return invitations && invitations.length > 0 ? (
<div className="space-y-4"> <div>
<p className="font-semibold pb-2 text-xl sm:text-2xl">Choose a workspace to join </p> <div className="space-y-4 md:w-2/3 ">
<div> <p className="font-semibold pb-2 text-xl sm:text-2xl">Choose a workspace to join </p>
{invitations && <div>
invitations.map((invitation) => { {invitations &&
const isSelected = invitationsRespond.includes(invitation.id); invitations.length > 0 &&
return ( invitations.map((invitation) => {
<div const isSelected = invitationsRespond.includes(invitation.id);
key={invitation.id} return (
className={`flex cursor-pointer items-center gap-2 border p-3.5 rounded ${ <div
isSelected ? "border-custom-primary-100" : "border-custom-border-200 hover:bg-custom-primary-10" key={invitation.id}
}`} className={`flex cursor-pointer items-center gap-2 border p-3.5 rounded ${
onClick={() => handleInvitation(invitation, isSelected ? "withdraw" : "accepted")} isSelected
> ? "border-custom-primary-100"
<div className="flex-shrink-0"> : "border-onboarding-border-200 hover:bg-onboarding-background-300/30"
<div className="grid place-items-center h-9 w-9 rounded"> }`}
{invitation.workspace.logo && invitation.workspace.logo !== "" ? ( onClick={() => handleInvitation(invitation, isSelected ? "withdraw" : "accepted")}
<img >
src={invitation.workspace.logo} <div className="flex-shrink-0">
height="100%" <div className="grid place-items-center h-9 w-9 rounded">
width="100%" {invitation.workspace.logo && invitation.workspace.logo !== "" ? (
className="rounded" <img
alt={invitation.workspace.name} src={invitation.workspace.logo}
/> height="100%"
) : ( width="100%"
<span className="grid place-items-center h-9 w-9 py-1.5 px-3 rounded bg-gray-700 uppercase text-white"> className="rounded"
{invitation.workspace.name[0]} alt={invitation.workspace.name}
</span> />
)} ) : (
<span className="grid place-items-center h-9 w-9 py-1.5 px-3 rounded bg-gray-700 uppercase text-white">
{invitation.workspace.name[0]}
</span>
)}
</div>
</div> </div>
<div className="min-w-0 flex-1">
<div className="text-sm font-medium">{truncateText(invitation.workspace.name, 30)}</div>
<p className="text-xs text-custom-text-200">{ROLE[invitation.role]}</p>
</div>
<span className={`flex-shrink-0 ${isSelected ? "text-custom-primary-100" : "text-custom-text-200"}`}>
<CheckCircle2 className="h-5 w-5" />
</span>
</div> </div>
<div className="min-w-0 flex-1"> );
<div className="text-sm font-medium">{truncateText(invitation.workspace.name, 30)}</div> })}
<p className="text-xs text-custom-text-200">{ROLE[invitation.role]}</p> </div>
</div>
<span className={`flex-shrink-0 ${isSelected ? "text-custom-primary-100" : "text-custom-text-200"}`}>
<CheckCircle2 className="h-5 w-5" />
</span>
</div>
);
})}
</div>
<Button variant="primary" onClick={submitInvitations}> <Button variant="primary" onClick={submitInvitations}>
{isJoiningWorkspaces ? "Joining..." : "Join your team"} {isJoiningWorkspaces ? "Joining..." : "Join your team"}
</Button> </Button>
</div>
<div className="py-3 px-4 mt-8 bg-onboarding-background-300/30 rounded-sm flex justify-between items-center">
<div className="flex items-center">
<Search className="h-4 w-4 mr-2" />
<span className="text-sm text-custom-text-200">Don&apos;t see your workspace?</span>
</div>
<div>
<div
className="bg-onboarding-background-200 py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200"
onClick={setTryDiffAccount}
>
Try a different email address
</div>
<p className="text-xs mt-2 text-custom-text-300">
Your right e-mail address could be from a Google or GitHub login.
</p>
</div>
</div>
</div> </div>
) : (
<EmptyInvitation />
); );
}; };
const EmptyInvitation = () => (
<div className="items-center md:w-4/5 bg-onboarding-background-300/30 my-16 border-onboarding-border-200 py-5 px-10 rounded border justify-center ">
<p className="text-lg text-onboarding-text-300 text-center font-semibold">Is your Team already on Plane?</p>
<p className="text-sm text-onboarding-text-300 mt-6 text-center">
We couldnt find any existing workspaces for the email address bhavesh@caravel.ai
</p>
<div
className="bg-onboarding-background-200 mt-6 py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200"
onClick={() => {}}
>
Try a different email address
</div>
<p className="text-xs mt-2 text-center text-custom-text-300">
Your right e-mail address could be from a Google or GitHub login.
</p>
</div>
);
export default Invitations; export default Invitations;

View File

@ -12,12 +12,16 @@ import { Button, Input } from "@plane/ui";
// hooks // hooks
import useDynamicDropdownPosition from "hooks/use-dynamic-dropdown"; import useDynamicDropdownPosition from "hooks/use-dynamic-dropdown";
// icons // icons
import { Check, ChevronDown, Plus, X, XCircle } from "lucide-react"; import { Check, ChevronDown, Plus, User2, X, XCircle } from "lucide-react";
// types // types
import { IUser, IWorkspace, TOnboardingSteps, TUserWorkspaceRole } from "types"; import { IUser, IWorkspace, TOnboardingSteps, TUserWorkspaceRole } from "types";
// constants // constants
import { ROLE } from "constants/workspace"; import { ROLE } from "constants/workspace";
import OnboardingStepIndicator from "components/account/step-indicator"; import OnboardingStepIndicator from "components/account/step-indicator";
import { useTheme } from "next-themes";
import user1 from "public/users/user-1.png";
import user2 from "public/users/user-2.png";
import Image from "next/image";
type Props = { type Props = {
finishOnboarding: () => Promise<void>; finishOnboarding: () => Promise<void>;
@ -59,7 +63,7 @@ const InviteMemberForm: React.FC<InviteMemberFormProps> = (props) => {
return ( return (
<div className="group relative grid grid-cols-11 gap-4"> <div className="group relative grid grid-cols-11 gap-4">
<div className="col-span-7"> <div className="col-span-7 bg-onboarding-background-200 rounded-md">
<Controller <Controller
control={control} control={control}
name={`emails.${index}.email`} name={`emails.${index}.email`}
@ -80,12 +84,12 @@ const InviteMemberForm: React.FC<InviteMemberFormProps> = (props) => {
ref={ref} ref={ref}
hasError={Boolean(errors.emails?.[index]?.email)} hasError={Boolean(errors.emails?.[index]?.email)}
placeholder="Enter their email..." placeholder="Enter their email..."
className="text-xs sm:text-sm w-full h-11 placeholder:text-custom-text-400/50" className="text-xs sm:text-sm w-full h-12 placeholder:text-onboarding-text-400 border-onboarding-border-100"
/> />
)} )}
/> />
</div> </div>
<div className="col-span-3"> <div className="col-span-3 bg-onboarding-background-200 rounded-md border items-center flex border-onboarding-border-100">
<Controller <Controller
control={control} control={control}
name={`emails.${index}.role`} name={`emails.${index}.role`}
@ -104,11 +108,11 @@ const InviteMemberForm: React.FC<InviteMemberFormProps> = (props) => {
type="button" type="button"
ref={buttonRef} ref={buttonRef}
onClick={() => setIsDropdownOpen((prev) => !prev)} onClick={() => setIsDropdownOpen((prev) => !prev)}
className="flex items-center px-2.5 h-11 py-2 text-xs justify-between gap-1 w-full rounded-md border border-custom-border-200 duration-300" className="flex items-center px-2.5 h-11 py-2 text-xs justify-between gap-1 w-full rounded-md duration-300"
> >
<span className="text-xs sm:text-sm">{ROLE[value]}</span> <span className="text-xs text-onboarding-text-400 sm:text-sm">{ROLE[value]}</span>
<ChevronDown className="h-4 w-4" /> <ChevronDown className="h-4 w-4 stroke-onboarding-text-400" />
</Listbox.Button> </Listbox.Button>
<Transition <Transition
@ -123,7 +127,7 @@ const InviteMemberForm: React.FC<InviteMemberFormProps> = (props) => {
> >
<Listbox.Options <Listbox.Options
ref={dropdownRef} ref={dropdownRef}
className="fixed w-36 z-10 border border-custom-border-200 mt-1 overflow-y-auto rounded-md bg-custom-background-90 text-xs shadow-lg focus:outline-none max-h-48" className="fixed w-36 z-10 border border-onboarding-border-100 mt-1 overflow-y-auto rounded-md bg-onboarding-background-200 text-xs shadow-lg focus:outline-none max-h-48"
> >
<div className="space-y-1 p-2"> <div className="space-y-1 p-2">
{Object.entries(ROLE).map(([key, value]) => ( {Object.entries(ROLE).map(([key, value]) => (
@ -132,8 +136,8 @@ const InviteMemberForm: React.FC<InviteMemberFormProps> = (props) => {
value={parseInt(key)} value={parseInt(key)}
className={({ active, selected }) => className={({ active, selected }) =>
`cursor-pointer select-none truncate rounded px-1 py-1.5 ${ `cursor-pointer select-none truncate rounded px-1 py-1.5 ${
active || selected ? "bg-custom-background-80" : "" active || selected ? "bg-onboarding-background-400/40" : ""
} ${selected ? "text-custom-text-100" : "text-custom-text-200"}` } ${selected ? "text-onboarding-text-100" : "text-custom-text-200"}`
} }
> >
{({ selected }) => ( {({ selected }) => (
@ -168,6 +172,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
const { finishOnboarding, stepChange, user, workspace } = props; const { finishOnboarding, stepChange, user, workspace } = props;
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();
const { resolvedTheme } = useTheme();
const { const {
control, control,
@ -224,33 +229,43 @@ export const InviteMembers: React.FC<Props> = (props) => {
return ( return (
<div className="flex py-14"> <div className="flex py-14">
<div className="hidden lg:block w-1/4 p-3 ml-auto rounded bg-gradient-to-b from-white to-custom-primary-10/30 border border-custom-border-100"> <div
<p className="text-base text-custom-text-400 font-semibold">Members</p> className={`hidden lg:block w-1/4 p-3 ml-auto rounded bg-gradient-to-b ${
resolvedTheme === "light" ? "from-white to-custom-primary-10/30" : " bg-onboarding-background-100/10"
} border border-onboarding-border-100 border-opacity-10`}
>
<p className="text-base text-onboarding-text-400 font-semibold">Members</p>
{Array.from({ length: 4 }).map(() => ( {Array.from({ length: 4 }).map(() => (
<div className="flex items-center gap-2 mt-4"> <div className="flex items-center gap-2 mt-4">
<div className="w-8 h-8 flex-shrink-0 rounded-full bg-custom-primary-10"></div> <div className="w-8 h-8 flex justify-center items-center flex-shrink-0 rounded-full bg-onboarding-background-400">
<User2 className="h-4 w-4 stroke-onboarding-background-300 fill-onboarding-background-400" />
</div>
<div className="w-full"> <div className="w-full">
<div className="rounded-md h-2.5 my-2 bg-custom-primary-30 w-2/3" /> <div className="rounded-md h-2.5 my-2 bg-onboarding-background-100 w-2/3" />
<div className="rounded-md h-2 bg-custom-primary-20 w-1/2" /> <div className="rounded-md h-2 bg-onboarding-background-400 w-1/2" />
</div> </div>
</div> </div>
))} ))}
<div className="relative mt-20 h-32"> <div className="relative mt-20 h-32">
<div className="flex absolute bg-custom-background-100 p-2 rounded-full gap-x-2 border border-custom-border-200 w-full mt-1 -left-1/2"> <div className="flex absolute bg-onboarding-background-200 p-2 rounded-full gap-x-2 border border-onboarding-border-100 w-full mt-1 -left-1/2">
<div className="w-8 h-8 flex-shrink-0 rounded-full bg-custom-primary-10"></div> <div className="w-8 h-8 flex-shrink-0 rounded-full bg-custom-primary-10">
<Image src={user2} alt="user" />
</div>
<div> <div>
<p className="text-sm font-medium">Murphy cooper</p> <p className="text-sm font-medium">Murphy cooper</p>
<p className="text-custom-text-400 text-sm">murphy@plane.so</p> <p className="text-onboarding-text-400 text-sm">murphy@plane.so</p>
</div> </div>
</div> </div>
<div className="flex absolute bg-custom-background-100 p-2 rounded-full gap-x-2 border border-custom-border-200 -left-1/3 mt-14 w-full"> <div className="flex absolute bg-onboarding-background-200 p-2 rounded-full gap-x-2 border border-onboarding-border-100 -left-1/3 mt-14 w-full">
<div className="w-8 h-8 flex-shrink-0 rounded-full bg-custom-primary-10"></div> <div className="w-8 h-8 flex-shrink-0 rounded-full bg-custom-primary-10">
<Image src={user1} alt="user" />
</div>
<div> <div>
<p className="text-sm font-medium">Else Thompson</p> <p className="text-sm font-medium">Else Thompson</p>
<p className="text-custom-text-400 text-sm">Elsa@plane.so</p> <p className="text-onboarding-text-400 text-sm">Elsa@plane.so</p>
</div> </div>
</div> </div>
</div> </div>
@ -298,7 +313,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
Copy invite link Copy invite link
</Button> */} </Button> */}
<span className="text-sm text-custom-text-400/50 hover:cursor-pointer" onClick={nextStep}> <span className="text-sm text-onboarding-text-400 hover:cursor-pointer" onClick={nextStep}>
Do this later Do this later
</span> </span>
</div> </div>

View File

@ -1,43 +1,26 @@
import React, { useState } from "react"; import React, { useState } from "react";
// services
import { WorkspaceService } from "services/workspace.service";
// hooks // hooks
import useUser from "hooks/use-user"; import useUser from "hooks/use-user";
// components // components
import Invitations from "./invitations"; import Invitations from "./invitations";
import DummySidebar from "components/account/sidebar"; import DummySidebar from "components/account/sidebar";
import OnboardingStepIndicator from "components/account/step-indicator"; import OnboardingStepIndicator from "components/account/step-indicator";
import { Button, Input } from "@plane/ui";
// hooks
import useToast from "hooks/use-toast";
// mobx
import { useMobxStore } from "lib/mobx/store-provider";
// types // types
import { IWorkspace, TOnboardingSteps } from "types"; import { IWorkspace, TOnboardingSteps } from "types";
// constants
import { RESTRICTED_URLS, ROLE } from "constants/workspace";
// react-hook-form // react-hook-form
import { Controller, useForm } from "react-hook-form"; import { Controller, useForm } from "react-hook-form";
// icons // icons
import { Search } from "lucide-react"; import { Workspace } from "./workspace";
type Props = { type Props = {
finishOnboarding: () => Promise<void>; finishOnboarding: () => Promise<void>;
stepChange: (steps: Partial<TOnboardingSteps>) => Promise<void>; stepChange: (steps: Partial<TOnboardingSteps>) => Promise<void>;
updateLastWorkspace: () => Promise<void>;
setTryDiffAccount: () => void; setTryDiffAccount: () => void;
}; };
// services export const JoinWorkspaces: React.FC<Props> = ({ stepChange, setTryDiffAccount }) => {
const workspaceService = new WorkspaceService();
export const JoinWorkspaces: React.FC<Props> = ({ stepChange, updateLastWorkspace, setTryDiffAccount }) => {
const [slugError, setSlugError] = useState(false);
const [invalidSlug, setInvalidSlug] = useState(false);
const { user } = useUser(); const { user } = useUser();
const { workspace: workspaceStore } = useMobxStore();
const { setToastAlert } = useToast();
const { const {
handleSubmit, handleSubmit,
control, control,
@ -57,60 +40,15 @@ export const JoinWorkspaces: React.FC<Props> = ({ stepChange, updateLastWorkspac
await stepChange({ workspace_join: true, workspace_create: true }); await stepChange({ workspace_join: true, workspace_create: true });
}; };
const handleCreateWorkspace = async (formData: IWorkspace) => {
const slug = formData.slug.split("/");
formData.slug = slug[slug.length - 1];
// TODO: remove this after adding organization size in backend
formData.organization_size = "Just myself";
console.log(formData.slug);
await workspaceService
.workspaceSlugCheck(formData.slug)
.then(async (res) => {
if (res.status === true && !RESTRICTED_URLS.includes(formData.slug)) {
setSlugError(false);
await workspaceStore
.createWorkspace(formData)
.then(async (res) => {
setToastAlert({
type: "success",
title: "Success!",
message: "Workspace created successfully.",
});
const payload: Partial<TOnboardingSteps> = {
workspace_create: true,
workspace_join: true,
};
await updateLastWorkspace();
await stepChange(payload);
})
.catch(() =>
setToastAlert({
type: "error",
title: "Error!",
message: "Workspace could not be created. Please try again.",
})
);
} else setSlugError(true);
})
.catch(() => {
setToastAlert({
type: "error",
title: "Error!",
message: "Some error occurred while creating workspace. Please try again.",
});
});
};
return ( return (
<div className="flex h-full w-full overflow-y-auto"> <div className="flex h-full w-full">
<div className="hidden lg:block w-3/12"> <div className="hidden lg:block w-3/12">
<Controller <Controller
control={control} control={control}
name="name" name="name"
render={({ field: { value, ref } }) => ( render={({ field: { value } }) => (
<DummySidebar <DummySidebar
watch={watch}
setValue={setValue} setValue={setValue}
control={control} control={control}
showProject={false} showProject={false}
@ -120,118 +58,27 @@ export const JoinWorkspaces: React.FC<Props> = ({ stepChange, updateLastWorkspac
/> />
</div> </div>
<div className="lg:w-3/5 md:w-4/5 md:px-0 px-7 w-full my-16 mx-auto"> <div className="w-full lg:w-1/2 md:w-4/5 md:px-0 px-7 my-16 mx-auto">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<p className="font-semibold text-xl sm:text-2xl">What will your workspace </p> <p className="font-semibold text-onboarding-text-200 text-xl sm:text-2xl">What will your workspace </p>
<OnboardingStepIndicator step={1} /> <OnboardingStepIndicator step={1} />
</div> </div>
<form className="mt-5 md:w-2/3" onSubmit={handleSubmit(handleCreateWorkspace)}> <Workspace
<div className="mb-5"> stepChange={stepChange}
<p className="text-base text-custom-text-400 mb-1">Name it.</p> user={user}
<Controller control={control}
control={control} handleSubmit={handleSubmit}
name="name" setValue={setValue}
rules={{ errors={errors}
required: "Workspace name is required", isSubmitting={isSubmitting}
validate: (value) => />
/^[\w\s-]*$/.test(value) || `Name can only contain (" "), ( - ), ( _ ) & alphanumeric characters.`, <div className="flex md:w-4/5 items-center my-8">
maxLength: { <hr className="border-onboarding-border-100 w-full" />
value: 80,
message: "Workspace name should not exceed 80 characters",
},
}}
render={({ field: { value, ref, onChange } }) => (
<div className="flex items-center relative rounded-md bg-white">
<Input
id="name"
name="name"
type="text"
value={value}
onChange={(event) => {
onChange(event.target.value);
setValue("name", event.target.value);
if (window && window.location.host) {
const host = window.location.host;
const slug = event.currentTarget.value.split("/");
setValue(
"slug",
`${host}/${slug[slug.length - 1].toLocaleLowerCase().trim().replace(/ /g, "-")}`
);
}
}}
placeholder="Enter workspace name..."
ref={ref}
hasError={Boolean(errors.name)}
className="w-full h-[46px] text-base placeholder:text-custom-text-400/50 placeholder:text-base border-custom-border-200"
></Input>
</div>
)}
/>
{errors.name && <span className="text-sm text-red-500">{errors.name.message}</span>}
<p className="text-base text-custom-text-400 mt-4 mb-1">You can edit the slug.</p>
<Controller
control={control}
name="slug"
render={({ field: { value, onChange, ref } }) => (
<div className="flex items-center relative rounded-md bg-white">
<Input
id="slug"
name="slug"
type="text"
prefix="asdasdasdas"
value={value.toLocaleLowerCase().trim().replace(/ /g, "-")}
onChange={(e) => {
const host = window.location.host;
const slug = e.currentTarget.value.split("/");
/^[a-zA-Z0-9_-]+$/.test(slug[slug.length - 1]) ? setInvalidSlug(false) : setInvalidSlug(true);
setValue(
"slug",
`${host}/${slug[slug.length - 1].toLocaleLowerCase().trim().replace(/ /g, "-")}`
);
}}
ref={ref}
hasError={Boolean(errors.slug)}
className="w-full h-[46px] border-custom-border-300"
></Input>
</div>
)}
/>
{slugError && <span className="-mt-3 text-sm text-red-500">Workspace URL is already taken!</span>}
{invalidSlug && (
<span className="text-sm text-red-500">{`URL can only contain ( - ), ( _ ) & alphanumeric characters.`}</span>
)}
</div>
<Button variant="primary" type="submit" size="md" disabled={!isValid} loading={isSubmitting}>
Make it live
</Button>
</form>
<div className="flex md:w-4/5 items-center my-5">
<hr className="border-custom-border-200 w-full" />
<p className="text-center text-sm text-custom-text-400 mx-3 flex-shrink-0">Or</p> <p className="text-center text-sm text-custom-text-400 mx-3 flex-shrink-0">Or</p>
<hr className="border-custom-border-200 w-full" /> <hr className="border-onboarding-border-100 w-full" />
</div> </div>
<div className="md:w-2/3 w-full"> <div className="w-full">
<Invitations handleNextStep={handleNextStep} updateLastWorkspace={updateLastWorkspace} /> <Invitations setTryDiffAccount={setTryDiffAccount} handleNextStep={handleNextStep} />
</div>
<div className="py-3 px-4 mt-8 bg-custom-primary-10 rounded-sm flex justify-between items-center">
<div className="flex items-center">
<Search className="h-4 w-4 mr-2" />
<span className="text-sm text-custom-text-200">Don't see your workspace?</span>
</div>
<div>
<div
className="bg-white py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200"
onClick={setTryDiffAccount}
>
Try a different email address
</div>
<p className="text-xs mt-2 text-custom-text-300">
Your right e-mail address could be from a Google or GitHub login.
</p>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -106,11 +106,11 @@ export const UserDetails: React.FC<Props> = observer((props) => {
<div className="flex mt-5 w-full "> <div className="flex mt-5 w-full ">
<button type="button" onClick={() => setIsImageUploadModalOpen(true)}> <button type="button" onClick={() => setIsImageUploadModalOpen(true)}>
{!watch("avatar") || watch("avatar") === "" ? ( {!watch("avatar") || watch("avatar") === "" ? (
<div className="h-16 hover:cursor-pointer justify-center items-center flex w-16 rounded-full flex-shrink-0 mr-3 relative bg-custom-primary-20"> <div className="h-16 hover:cursor-pointer justify-center items-center flex w-16 rounded-full flex-shrink-0 mr-3 relative bg-onboarding-background-300">
<div className="h-6 w-6 flex justify-center items-center bottom-1 border border-custom-primary-10 -right-1 bg-custom-background-100 rounded-full absolute"> <div className="h-6 w-6 flex justify-center items-center bottom-1 border border-onboarding-border-100 -right-1 bg-onboarding-background-100 rounded-full absolute">
<Camera className="h-4 w-4 stroke-custom-primary-40" /> <Camera className="h-4 w-4 stroke-onboarding-background-400" />
</div> </div>
<User2 className="h-10 w-10 stroke-custom-primary-20 fill-custom-primary-40" /> <User2 className="h-10 w-10 stroke-onboarding-background-300 fill-onboarding-background-400" />
</div> </div>
) : ( ) : (
<div className="relative h-16 w-16 overflow-hidden mr-3"> <div className="relative h-16 w-16 overflow-hidden mr-3">
@ -124,7 +124,7 @@ export const UserDetails: React.FC<Props> = observer((props) => {
)} )}
</button> </button>
<div className="my-2 bg-custom-background-100 w-full mr-10 rounded-md flex text-sm"> <div className="my-2 bg-onboarding-background-200 w-full mr-10 rounded-md flex text-sm">
<Controller <Controller
control={control} control={control}
name="first_name" name="first_name"
@ -146,7 +146,7 @@ export const UserDetails: React.FC<Props> = observer((props) => {
ref={ref} ref={ref}
hasError={Boolean(errors.first_name)} hasError={Boolean(errors.first_name)}
placeholder="Enter your full name..." placeholder="Enter your full name..."
className="w-full focus:border-custom-primary-100" className="w-full focus:border-custom-primary-100 border-onboarding-border-100"
/> />
)} )}
/> />
@ -157,17 +157,19 @@ export const UserDetails: React.FC<Props> = observer((props) => {
control={control} control={control}
name="first_name" name="first_name"
render={({ field: { value } }) => ( render={({ field: { value } }) => (
<p className="font-medium text-xl sm:text-2xl p-0">And how will you use Plane, {value} ?</p> <p className="font-medium text-onboarding-text-200 text-xl sm:text-2xl p-0">
And how will you use Plane, {value} ?
</p>
)} )}
/> />
<p className="font-medium text-sm my-3">Choose just one</p> <p className="font-medium text-onboarding-text-300 text-sm my-3">Choose just one</p>
<div className="flex flex-wrap break-all overflow-auto"> <div className="flex flex-wrap break-all overflow-auto">
{useCases.map((useCase, index) => ( {useCases.map((useCase, index) => (
<div <div
className={`border mb-3 hover:cursor-pointer hover:bg-custom-primary-10 flex-shrink-0 ${ className={`border mb-3 hover:cursor-pointer hover:bg-onboarding-background-300/30 flex-shrink-0 ${
selectedUsecase === index ? "border-custom-primary-100" : "border-custom-primary-40" selectedUsecase === index ? "border-custom-primary-100" : "border-onboarding-border-100"
} mr-3 rounded-sm p-3 text-sm font-medium`} } mr-3 rounded-sm p-3 text-sm font-medium`}
onClick={() => setSelectedUsecase(index)} onClick={() => setSelectedUsecase(index)}
> >

View File

@ -1,67 +1,168 @@
import { useState } from "react"; import { useState } from "react";
// ui // ui
import { Button } from "@plane/ui"; import { Button, Input } from "@plane/ui";
// types // types
import { IUser, IWorkspace, TOnboardingSteps } from "types"; import { IUser, IWorkspace, TOnboardingSteps } from "types";
// constants // constants
import { CreateWorkspaceForm } from "components/workspace"; import { RESTRICTED_URLS } from "constants/workspace";
import { Control, Controller, FieldErrors, UseFormHandleSubmit, UseFormSetValue } from "react-hook-form";
import { WorkspaceService } from "services/workspace.service";
import useToast from "hooks/use-toast";
import { useMobxStore } from "lib/mobx/store-provider";
type Props = { type Props = {
finishOnboarding: () => Promise<void>;
stepChange: (steps: Partial<TOnboardingSteps>) => Promise<void>; stepChange: (steps: Partial<TOnboardingSteps>) => Promise<void>;
updateLastWorkspace: () => Promise<void>;
user: IUser | undefined; user: IUser | undefined;
workspaces: IWorkspace[] | undefined; control: Control<IWorkspace, any>;
handleSubmit: UseFormHandleSubmit<IWorkspace, undefined>;
errors: FieldErrors<IWorkspace>;
setValue: UseFormSetValue<IWorkspace>;
isSubmitting: boolean;
}; };
export const Workspace: React.FC<Props> = (props) => { // services
const { finishOnboarding, stepChange, updateLastWorkspace, user, workspaces } = props; const workspaceService = new WorkspaceService();
const [defaultValues, setDefaultValues] = useState({ export const Workspace: React.FC<Props> = (props) => {
name: "", const { stepChange, user, control, handleSubmit, setValue, errors, isSubmitting } = props;
slug: "", const [slugError, setSlugError] = useState(false);
organization_size: "", const [invalidSlug, setInvalidSlug] = useState(false);
});
const {
workspace: workspaceStore,
user: { updateCurrentUser },
} = useMobxStore();
const { setToastAlert } = useToast();
const handleCreateWorkspace = async (formData: IWorkspace) => {
if (isSubmitting) return;
const slug = formData.slug.split("/");
formData.slug = slug[slug.length - 1];
await workspaceService
.workspaceSlugCheck(formData.slug)
.then(async (res) => {
if (res.status === true && !RESTRICTED_URLS.includes(formData.slug)) {
setSlugError(false);
await workspaceStore
.createWorkspace(formData)
.then(async (res) => {
setToastAlert({
type: "success",
title: "Success!",
message: "Workspace created successfully.",
});
await workspaceStore.fetchWorkspaces();
await completeStep();
})
.catch(() =>
setToastAlert({
type: "error",
title: "Error!",
message: "Workspace could not be created. Please try again.",
})
);
} else setSlugError(true);
})
.catch(() => {
setToastAlert({
type: "error",
title: "Error!",
message: "Some error occurred while creating workspace. Please try again.",
});
});
};
const completeStep = async () => { const completeStep = async () => {
if (!user) return; if (!user || !workspaceStore.workspaces) return;
const payload: Partial<TOnboardingSteps> = { const payload: Partial<TOnboardingSteps> = {
workspace_create: true, workspace_create: true,
workspace_join: true,
}; };
await stepChange(payload); await stepChange(payload);
await updateLastWorkspace(); await updateCurrentUser({
}; last_workspace_id: workspaceStore.workspaces[0]?.id,
});
const secondaryButtonAction = async () => {
if (workspaces && workspaces.length > 0) {
await stepChange({ workspace_create: true, workspace_invite: true, workspace_join: true });
await finishOnboarding();
} else await stepChange({ profile_complete: false, workspace_join: false });
}; };
return ( return (
<div className="w-full space-y-7 sm:space-y-10"> <form className="mt-5 md:w-2/3" onSubmit={handleSubmit(handleCreateWorkspace)}>
<h4 className="text-xl sm:text-2xl font-semibold">Create your workspace</h4> <div className="mb-5">
<div className="sm:w-3/4 md:w-2/5"> <p className="text-base text-custom-text-400 mb-1">Name it.</p>
<CreateWorkspaceForm <Controller
onSubmit={completeStep} control={control}
defaultValues={defaultValues} name="name"
setDefaultValues={setDefaultValues} rules={{
primaryButtonText={{ required: "Workspace name is required",
loading: "Creating...", validate: (value) =>
default: "Continue", /^[\w\s-]*$/.test(value) || `Name can only contain (" "), ( - ), ( _ ) & alphanumeric characters.`,
maxLength: {
value: 80,
message: "Workspace name should not exceed 80 characters",
},
}} }}
secondaryButton={ render={({ field: { value, ref, onChange } }) => (
workspaces ? ( <div className="flex items-center relative rounded-md bg-onboarding-background-200">
<Button variant="neutral-primary" onClick={secondaryButtonAction}> <Input
{workspaces.length > 0 ? "Skip & continue" : "Back"} id="name"
</Button> name="name"
) : undefined type="text"
} value={value}
onChange={(event) => {
onChange(event.target.value);
setValue("name", event.target.value);
if (window && window.location.host) {
const host = window.location.host;
const slug = event.currentTarget.value.split("/");
setValue("slug", `${host}/${slug[slug.length - 1].toLocaleLowerCase().trim().replace(/ /g, "-")}`);
}
}}
placeholder="Enter workspace name..."
ref={ref}
hasError={Boolean(errors.name)}
className="w-full h-[46px] text-base placeholder:text-custom-text-400/50 placeholder:text-base border-onboarding-border-100"
/>
</div>
)}
/> />
{errors.name && <span className="text-sm text-red-500">{errors.name.message}</span>}
<p className="text-base text-custom-text-400 mt-4 mb-1">You can edit the slug.</p>
<Controller
control={control}
name="slug"
render={({ field: { value, onChange, ref } }) => (
<div className="flex items-center relative rounded-md bg-onboarding-background-200">
<Input
id="slug"
name="slug"
type="text"
prefix="asdasdasdas"
value={value.toLocaleLowerCase().trim().replace(/ /g, "-")}
onChange={(e) => {
const host = window.location.host;
const slug = e.currentTarget.value.split("/");
/^[a-zA-Z0-9_-]+$/.test(slug[slug.length - 1]) ? setInvalidSlug(false) : setInvalidSlug(true);
setValue("slug", `${host}/${slug[slug.length - 1].toLocaleLowerCase().trim().replace(/ /g, "-")}`);
}}
ref={ref}
hasError={Boolean(errors.slug)}
className="w-full h-[46px] border-onboarding-border-100"
/>
</div>
)}
/>
{slugError && <span className="-mt-3 text-sm text-red-500">Workspace URL is already taken!</span>}
{invalidSlug && (
<span className="text-sm text-red-500">{`URL can only contain ( - ), ( _ ) & alphanumeric characters.`}</span>
)}
</div> </div>
</div> <Button variant="primary" type="submit" size="md">
{isSubmitting ? "Creating..." : "Make it live"}
</Button>
</form>
); );
}; };

View File

@ -19,11 +19,12 @@ import {
import { Loader, Spinner } from "@plane/ui"; import { Loader, Spinner } from "@plane/ui";
// images // images
import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png"; import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png";
import signInIssues from "public/onboarding/sign-in.svg"; import signInIssues from "public/onboarding/onboarding-issues.svg";
// types // types
import { IUser, IUserSettings } from "types"; import { IUser, IUserSettings } from "types";
// icons // icons
import { Lightbulb } from "lucide-react"; import { Lightbulb } from "lucide-react";
import { useTheme } from "next-themes";
const authService = new AuthService(); const authService = new AuthService();
@ -39,7 +40,9 @@ export const SignInView = observer(() => {
const [isLoading, setLoading] = useState(false); const [isLoading, setLoading] = useState(false);
// toast // toast
const { setToastAlert } = useToast(); const { setToastAlert } = useToast();
// computed const { resolvedTheme } = useTheme();
// computed.
const enableEmailPassword = const enableEmailPassword =
envConfig && envConfig &&
(envConfig?.email_password_login || (envConfig?.email_password_login ||
@ -69,7 +72,7 @@ export const SignInView = observer(() => {
const workspaceSlug = const workspaceSlug =
userSettings?.workspace?.last_workspace_slug || userSettings?.workspace?.fallback_workspace_slug; userSettings?.workspace?.last_workspace_slug || userSettings?.workspace?.fallback_workspace_slug;
if (workspaceSlug) router.push(`/${workspaceSlug}`); if (workspaceSlug) router.push(`/${workspaceSlug}`);
else if (userSettings.workspace.invites > 0) router.push("/invitations"); // else if (userSettings.workspace.invites > 0) router.push("/invitations");
else router.push("/create-workspace"); else router.push("/create-workspace");
}) })
.catch(() => { .catch(() => {
@ -183,7 +186,13 @@ export const SignInView = observer(() => {
<Spinner /> <Spinner />
</div> </div>
) : ( ) : (
<div className="bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/80 h-full overflow-y-auto"> <div
className={`${
resolvedTheme === "dark"
? "bg-[#18191B]"
: "bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/80"
} h-full overflow-y-auto`}
>
<div className="sm:py-5 pl-8 pb-4 sm:pl-16 lg:pl-28 "> <div className="sm:py-5 pl-8 pb-4 sm:pl-16 lg:pl-28 ">
<div className="flex text-3xl items-center mt-16 font-semibold"> <div className="flex text-3xl items-center mt-16 font-semibold">
<div className="h-[30px] w-[30px] mr-2"> <div className="h-[30px] w-[30px] mr-2">
@ -194,19 +203,29 @@ export const SignInView = observer(() => {
</div> </div>
<div className="md:w-2/3 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200"> <div className="md:w-2/3 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
<div className=" bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/30 p-4"> <div
<div className="bg-gradient-to-br px-7 sm:px-0 from-white/40 to-white/80 h-full pt-32 pb-20 rounded-md"> className={`${resolvedTheme === "dark" ? "" : "from-custom-primary-10/10 to-custom-primary-20/30"} p-4`}
>
<div
className={`px-7 sm:px-0 ${
resolvedTheme === "dark"
? "bg-gradient-to-br from-[#2f3035cc] to-[#212225cc]"
: "bg-gradient-to-br from-white/40 to-white/80"
} h-full pt-32 pb-20 rounded-md`}
>
{!envConfig ? ( {!envConfig ? (
<div className="pt-10 w-ful"> <div className="pt-10 mx-auto flex justify-center">
<Loader className="space-y-4 w-full pb-4"> <div>
<Loader.Item height="46px" width="360px" /> <Loader className="space-y-4 w-full pb-4 mx-auto">
<Loader.Item height="46px" width="360px" /> <Loader.Item height="46px" width="360px" />
</Loader> <Loader.Item height="46px" width="360px" />
</Loader>
<Loader className="space-y-4 w-full pt-4"> <Loader className="space-y-4 w-full pt-4 mx-auto">
<Loader.Item height="46px" width="360px" /> <Loader.Item height="46px" width="360px" />
<Loader.Item height="46px" width="360px" /> <Loader.Item height="46px" width="360px" />
</Loader> </Loader>
</div>
</div> </div>
) : ( ) : (
<> <>
@ -219,10 +238,12 @@ export const SignInView = observer(() => {
</div> </div>
</div> </div>
)} )}
<div className="flex sm:w-[360px] items-center mt-4 mx-auto"> <div className="flex sm:w-96 items-center mt-4 mx-auto">
<hr className="border-custom-border-200 w-full" /> <hr className={`border-onboarding-border-100 w-full`} />
<p className="text-center text-sm text-custom-text-400 mx-3 flex-shrink-0">Or continue with</p> <p className="text-center text-sm text-onboarding-text-400 mx-3 flex-shrink-0">
<hr className="border-custom-border-200 w-full" /> Or continue with
</p>
<hr className={`border-onboarding-border-100 w-full`} />
</div> </div>
<div className="flex flex-col items-center justify-center gap-4 pt-7 sm:w-96 mx-auto overflow-hidden"> <div className="flex flex-col items-center justify-center gap-4 pt-7 sm:w-96 mx-auto overflow-hidden">
{envConfig?.google_client_id && ( {envConfig?.google_client_id && (
@ -233,17 +254,21 @@ export const SignInView = observer(() => {
)} )}
</div> </div>
</> </>
<div className="flex py-2 bg-custom-primary-10 mx-auto rounded-sm border border-custom-primary-20 sm:w-96 mt-16"> <div className={`flex py-2 bg-onboarding-background-100 mx-auto rounded-sm sm:w-96 mt-16`}>
<Lightbulb className="h-7 w-7 mr-2 mx-3" /> <Lightbulb className="h-7 w-7 mr-2 mx-3" />
<p className=" text-sm text-left"> <p className={`text-sm text-left text-onboarding-text-200`}>
Try the latest features, like Tiptap editor, to write compelling responses.{" "} Try the latest features, like Tiptap editor, to write compelling responses.{" "}
<span className="font-medium underline hover:cursor-pointer" onClick={() => {}}> <span className="font-medium underline hover:cursor-pointer" onClick={() => {}}>
See new features See new features
</span> </span>
</p> </p>
</div> </div>
<div className="flex justify-center sm:w-96 sm:h-64 object-cover mt-6 mx-auto rounded-md "> <div className="flex justify-center sm:w-96 sm:h-64 object-cover mt-8 mx-auto rounded-md ">
<Image src={signInIssues} alt="Plane Logo" className="sm:w-96 sm:h-64" /> <Image
src={signInIssues}
alt="Plane Logo"
className={`flex object-cover rounded-md bg-onboarding-background-100`}
/>
</div> </div>
</> </>
)} )}

View File

@ -15,17 +15,16 @@ import { UserAuthWrapper } from "layouts/auth-layout";
// components // components
import { InviteMembers, JoinWorkspaces, UserDetails, Workspace } from "components/onboarding"; import { InviteMembers, JoinWorkspaces, UserDetails, Workspace } from "components/onboarding";
// ui // ui
import { Avatar, CustomMenu, Spinner } from "@plane/ui"; import { Avatar, Spinner } from "@plane/ui";
// images // images
import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png"; import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text.png";
import BlackHorizontalLogo from "public/plane-logos/black-horizontal-with-blue-logo.svg";
import WhiteHorizontalLogo from "public/plane-logos/white-horizontal-with-blue-logo.svg";
// types // types
import { IUser, TOnboardingSteps } from "types"; import { IUser, TOnboardingSteps } from "types";
import { NextPageWithLayout } from "types/app"; import { NextPageWithLayout } from "types/app";
import { ChevronDown } from "lucide-react"; import { ChevronDown } from "lucide-react";
import { Menu, Popover, Transition } from "@headlessui/react"; import { Menu, Popover, Transition } from "@headlessui/react";
import DeleteAccountModal from "components/account/delete-account-modal"; import DeleteAccountModal from "components/account/delete-account-modal";
import { useRouter } from "next/router";
// services // services
const workspaceService = new WorkspaceService(); const workspaceService = new WorkspaceService();
@ -33,17 +32,17 @@ const workspaceService = new WorkspaceService();
const OnboardingPage: NextPageWithLayout = observer(() => { const OnboardingPage: NextPageWithLayout = observer(() => {
const [step, setStep] = useState<number | null>(null); const [step, setStep] = useState<number | null>(null);
const [showDeleteModal, setShowDeleteModal] = useState(false); const [showDeleteModal, setShowDeleteModal] = useState(false);
const [tryDiffAccount, setTryDiffAccount] = useState(false);
const { const {
user: { currentUser, updateCurrentUser, updateUserOnBoard }, user: { currentUser, updateCurrentUser, updateUserOnBoard },
workspace: workspaceStore, workspace: workspaceStore,
} = useMobxStore(); } = useMobxStore();
const router = useRouter();
const user = currentUser ?? undefined; const user = currentUser ?? undefined;
const workspaces = workspaceStore.workspaces; const workspaces = workspaceStore.workspaces;
const { setTheme } = useTheme(); const { setTheme, resolvedTheme } = useTheme();
const {} = useUserAuth("onboarding"); const {} = useUserAuth("onboarding");
@ -51,16 +50,6 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
workspaceService.userWorkspaceInvitations() workspaceService.userWorkspaceInvitations()
); );
// update last active workspace details
const updateLastWorkspace = async () => {
console.log("Workspaces", workspaces);
if (!workspaces) return;
await updateCurrentUser({
last_workspace_id: workspaces[0]?.id,
});
};
// handle step change // handle step change
const stepChange = async (steps: Partial<TOnboardingSteps>) => { const stepChange = async (steps: Partial<TOnboardingSteps>) => {
if (!user) return; if (!user) return;
@ -76,9 +65,11 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
}; };
// complete onboarding // complete onboarding
const finishOnboarding = async () => { const finishOnboarding = async () => {
if (!user) return; if (!user || !workspaces) return;
await updateUserOnBoard(); await updateUserOnBoard();
router.replace(`/${workspaces[0].slug}`);
}; };
useEffect(() => { useEffect(() => {
@ -94,7 +85,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
if (!onboardingStep.workspace_join && !onboardingStep.workspace_create && step !== 1) setStep(1); if (!onboardingStep.workspace_join && !onboardingStep.workspace_create && step !== 1) setStep(1);
if (onboardingStep.workspace_join || onboardingStep.workspace_create) { if (onboardingStep.workspace_join || onboardingStep.workspace_create) {
if (!onboardingStep.profile_complete && step!==2) setStep(2); if (!onboardingStep.profile_complete && step !== 2) setStep(2);
} }
if ( if (
onboardingStep.profile_complete && onboardingStep.profile_complete &&
@ -111,15 +102,19 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
return ( return (
<> <>
<DeleteAccountModal <DeleteAccountModal
heading={tryDiffAccount ? "Try Different Email" : "Delete Account"} isOpen={showDeleteModal}
isOpen={showDeleteModal || tryDiffAccount}
onClose={() => { onClose={() => {
setShowDeleteModal(false); setShowDeleteModal(false);
setTryDiffAccount(false);
}} }}
/> />
{user && step !== null ? ( {user && step !== null ? (
<div className="bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/80 h-full overflow-y-auto"> <div
className={` ${
resolvedTheme === "dark"
? "bg-[#18191B]"
: "bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/80"
} h-full overflow-y-auto`}
>
<div className="sm:py-14 py-10 px-4 sm:px-7 md:px-14 lg:pl-28 lg:pr-24 flex items-center"> <div className="sm:py-14 py-10 px-4 sm:px-7 md:px-14 lg:pl-28 lg:pr-24 flex items-center">
<div className="w-full flex items-center justify-between font-semibold "> <div className="w-full flex items-center justify-between font-semibold ">
<div className="text-3xl flex items-center gap-x-1"> <div className="text-3xl flex items-center gap-x-1">
@ -138,7 +133,11 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
/> />
)} )}
<div> <div>
{step != 1 && <p className="text-sm text-custom-text-200 font-medium">{currentUser?.first_name}</p>} {step != 1 && (
<p className="text-sm text-custom-text-200 font-medium">
{currentUser?.first_name} {currentUser?.last_name}
</p>
)}
<Menu> <Menu>
<Menu.Button className={"flex items-center gap-x-2"}> <Menu.Button className={"flex items-center gap-x-2"}>
@ -153,10 +152,10 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
leaveFrom="transform scale-100 opacity-100" leaveFrom="transform scale-100 opacity-100"
leaveTo="transform scale-95 opacity-0" leaveTo="transform scale-95 opacity-0"
> >
<Menu.Items className={"absolute bg-slate-600 translate-x-full"}> <Menu.Items className={"absolute translate-x-full"}>
<Menu.Item> <Menu.Item>
<div <div
className="absolute pr-28 hover:cursor-pointer bg-custom-background-100 mr-auto mt-2 rounded-md text-custom-text-300 text-base font-normal p-3 shadow-sm border border-custom-border-200" className="absolute pr-28 hover:cursor-pointer bg-onboarding-background-200 mr-auto mt-2 rounded-md text-custom-text-300 text-base font-normal p-3 shadow-sm border border-custom-border-200"
onClick={() => { onClick={() => {
setShowDeleteModal(true); setShowDeleteModal(true);
}} }}
@ -172,16 +171,23 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
</div> </div>
</div> </div>
<div className="w-full lg:w-4/5 xl:w-3/4 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200"> <div className="w-full lg:w-4/5 xl:w-3/4 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
<div className=" bg-gradient-to-r from-custom-primary-10/80 to-custom-primary-20/30 p-4"> <div
<div className="bg-gradient-to-br from-white/40 to-white/80 h-full rounded-md"> className={`${resolvedTheme === "dark" ? "" : "from-custom-primary-10/10 to-custom-primary-20/30"} p-4`}
>
<div
className={`${
resolvedTheme === "dark"
? "bg-gradient-to-r from-[#2f3035cc] to-[#212225cc]"
: "bg-gradient-to-br from-white/40 to-white/80"
} h-full rounded-md`}
>
{step === 1 ? ( {step === 1 ? (
<JoinWorkspaces <JoinWorkspaces
setTryDiffAccount={() => { setTryDiffAccount={() => {
setTryDiffAccount(true); setShowDeleteModal(true);
}} }}
finishOnboarding={finishOnboarding} finishOnboarding={finishOnboarding}
stepChange={stepChange} stepChange={stepChange}
updateLastWorkspace={updateLastWorkspace}
/> />
) : step === 2 ? ( ) : step === 2 ? (
<UserDetails user={user} /> <UserDetails user={user} />

BIN
web/public/users/user-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
web/public/users/user-2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

@ -125,6 +125,21 @@
--color-border-200: 229, 229, 229; /* subtle border- 2 */ --color-border-200: 229, 229, 229; /* subtle border- 2 */
--color-border-300: 212, 212, 212; /* strong border- 1 */ --color-border-300: 212, 212, 212; /* strong border- 1 */
--color-border-400: 185, 185, 185; /* strong border- 2 */ --color-border-400: 185, 185, 185; /* strong border- 2 */
/* onboarding colors */
--color-onboarding-text-100: 23, 23, 23;
--color-onboarding-text-200: 58, 58, 58;
--color-onboarding-text-300: 82, 82, 82;
--color-onboarding-text-400: 163, 163, 163;
--color-onboarding-background-100: 236, 241, 255;
--color-onboarding-background-200: 255, 255, 255;
--color-onboarding-background-300: 236, 241, 255;
--color-onboarding-background-400: 177, 206, 250;
--color-onboarding-border-100: 229, 229, 229;
--color-onboarding-border-200: 217, 228, 255;
} }
[data-theme="light-contrast"] { [data-theme="light-contrast"] {
@ -172,6 +187,23 @@
--color-border-200: 38, 38, 38; /* subtle border- 2 */ --color-border-200: 38, 38, 38; /* subtle border- 2 */
--color-border-300: 46, 46, 46; /* strong border- 1 */ --color-border-300: 46, 46, 46; /* strong border- 1 */
--color-border-400: 58, 58, 58; /* strong border- 2 */ --color-border-400: 58, 58, 58; /* strong border- 2 */
/* onboarding colors */
--color-onboarding-text-100: 237, 238, 240;
--color-onboarding-text-200: 176, 180, 187;
--color-onboarding-text-300: 118, 123, 132;
--color-onboarding-text-400: 105, 110, 119;
--color-onboarding-background-100: 54, 58, 64;
--color-onboarding-background-200: 40, 42, 45;
--color-onboarding-background-300: 40, 42, 45;
--color-onboarding-background-400: 67, 72, 79;
--color-onboarding-border-100: 54, 58, 64;
--color-onboarding-border-200: 54, 58, 64;
} }
[data-theme="dark-contrast"] { [data-theme="dark-contrast"] {