chore: tidy up onboarding with new animations and illustrations (#25124)

<!-- This is an auto-generated description by cubic. -->
## Summary by cubic
Revamps onboarding with subtle route transitions, new org/teams illustrations, and clearer invite flows with real-time previews. Adds “Skip for now” on invites and guardrails to avoid incomplete team creation.

- **New Features**
  - Added email invite pages for organizations and teams with shared EmailInviteForm and RoleSelector.
  - Built a live invite browser preview that renders a 3×3 grid and updates as you type; works for orgs and teams.
  - Applied route-keyed framer-motion transitions to layout, cards, and browser views for smoother page changes.
  - Continuation prompt now detects saved org or team and routes to the right next step; localized copy.
  - Added loading state to plan selection to prevent double navigation.
  - Refreshed Organizations welcome modal with a new animated ring illustration and better scrolling.
  - Added “Skip for now” to org and team invite-by-email steps to proceed without invites.
  - Calendar browser preview now focuses on a time window around “now” for a more realistic demo.
  - Added an optional floating footer to keep actions visible on long, scrollable lists.

- **Refactors and Fixes**
  - Unified invite browser and replaced the org preview on the org email step.
  - Split and simplified legacy invite views; team and org routes are cleaner and easier to extend.
  - Streamlined the team invite step by removing a redundant action; non-admins are redirected to the email invite page.
  - Prevented creating teams with empty details by redirecting back to team details.
  - Minor UI cleanup: tighter borders, padding, and mobile max-heights across onboarding screens.
  - Hide team select on org invites when no teams exist.

<sup>Written for commit ae7f5277ab998560ae6e2f3f9144852a7b4959a7. Summary will update automatically on new commits.</sup>

<!-- End of auto-generated description by cubic. -->
This commit is contained in:
sean-brydon authored and GitHub committed 2025-11-20 10:20:38 +00:00
1 parent 1dcd54aab7
commit 956f81fab3
29 files changed
+1142 -672

No files matched your search

@@ -1,8 +1,8 @@
"use client";
import { AnimatePresence, motion } from "framer-motion";
import { AnimatePresence } from "framer-motion";
import { useRouter } from "next/navigation";
import { useEffect, useRef } from "react";
import { useEffect, useRef, useTransition } from "react";
import { isCompanyEmail } from "@calcom/features/ee/organizations/lib/utils";
import { useLocale } from "@calcom/lib/hooks/useLocale";
@@ -27,6 +27,7 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
const { t } = useLocale();
const { selectedPlan, setSelectedPlan } = useOnboardingStore();
const previousPlanRef = useRef<PlanType | null>(null);
const [isPending, startTransition] = useTransition();
// Plan order mapping for determining direction
const planOrder: Record<PlanType, number> = {
@@ -40,7 +41,7 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
if (!selectedPlan || !previousPlanRef.current) return "down";
const previousOrder = planOrder[previousPlanRef.current];
const currentOrder = planOrder[selectedPlan];
return currentOrder > previousOrder ? "down" : "up";
return currentOrder > previousOrder ? "up" : "down";
};
const direction = getDirection();
@@ -51,13 +52,15 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
}, [selectedPlan]);
const handleContinue = () => {
if (selectedPlan === "organization") {
router.push("/onboarding/organization/details");
} else if (selectedPlan === "team") {
router.push("/onboarding/teams/details");
} else if (selectedPlan === "personal") {
router.push("/onboarding/personal/settings");
}
startTransition(() => {
if (selectedPlan === "organization") {
router.push("/onboarding/organization/details");
} else if (selectedPlan === "team") {
router.push("/onboarding/teams/details");
} else if (selectedPlan === "personal") {
router.push("/onboarding/personal/settings");
}
});
};
const planIconByType: Record<PlanType, IconName> = {
@@ -106,15 +109,19 @@ export const OnboardingView = ({ userEmail }: OnboardingViewProps) => {
return (
<>
<OnboardingContinuationPrompt />
<OnboardingLayout userEmail={userEmail} currentStep={1} totalSteps={1}>
<OnboardingLayout userEmail={userEmail}>
{/* Left column - Main content */}
<OnboardingCard
title="Select plan"
title={t("onboarding_select_plan")}
subtitle={t("onboarding_welcome_question")}
footer={
<div className="flex w-full justify-end gap-2">
<Button color="primary" className="rounded-[10px]" onClick={handleContinue}>
{t("continue")}
<Button
color="primary"
className="rounded-[10px]"
onClick={handleContinue}
disabled={isPending}>
{isPending ? t("loading") : t("continue")}
</Button>
</div>
}>