Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
[CAP-313] New Upgrade Modal (#513)
Ameer Al Ashhab2e39a6f22250
diff --git a/apps/web/app/dashboard/_components/AdminNavbar/AdminNavItems.tsx b/apps/web/app/dashboard/_components/AdminNavbar/AdminNavItems.tsxindex 1a1b4e648..572fc3f2e 100644--- a/apps/web/app/dashboard/_components/AdminNavbar/AdminNavItems.tsx+++ b/apps/web/app/dashboard/_components/AdminNavbar/AdminNavItems.tsx@@ -6,29 +6,27 @@ import {CommandGroup,CommandInput,CommandItem,+ Dialog,+ DialogContent,+ DialogFooter,+ DialogHeader,+ DialogTitle,DialogTrigger,Popover,PopoverContent,- PopoverTrigger,+ PopoverTrigger} from "@cap/ui";import { classNames } from "@cap/utils";import { Check, ChevronDown, Plus } from "lucide-react";import Link from "next/link";import { usePathname } from "next/navigation";-import { useState } from "react";import { useSharedContext } from "@/app/dashboard/_components/DynamicSharedLayout";import { Avatar } from "@/app/s/[videoId]/_components/tabs/Activity";import { NewOrganization } from "@/components/forms/NewOrganization";import { Tooltip } from "@/components/Tooltip";import { UsageButton } from "@/components/UsageButton";-import {- Dialog,- DialogContent,- DialogDescription,- DialogHeader,- DialogTitle,-} from "@cap/ui";+import { buildEnv } from "@cap/env";import {faBuilding,faDownload,@@ -39,14 +37,14 @@ import {import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import clsx from "clsx";import { motion } from "framer-motion";-import { buildEnv } from "@cap/env";+import { useState } from "react";import { updateActiveOrganization } from "./server";export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {const pathname = usePathname();const [open, setOpen] = useState(false);- const { organizationData, activeOrganization, user, isSubscribed } =+ const { user } =useSharedContext();const manageNavigation = [@@ -90,6 +88,9 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {"flex items-center justify-start py-2 px-3 rounded-2xl outline-none tracking-tight w-full overflow-hidden";const [dialogOpen, setDialogOpen] = useState(false);+ const { organizationData: orgData, activeOrganization: activeOrg, isSubscribed: userIsSubscribed } =+ useSharedContext();+ const [formRef, setFormRef] = useState<HTMLFormElement | null>(null);return (<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>@@ -98,7 +99,7 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {disable={open || collapsed === false}position="right"content={- activeOrganization?.organization.name ?? "No organization found"+ activeOrg?.organization.name ?? "No organization found"}><PopoverTrigger asChild>@@ -118,12 +119,12 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {letterClass="text-gray-1 text-xs"className="relative flex-shrink-0 size-5"name={- activeOrganization?.organization.name ??+ activeOrg?.organization.name ??"No organization found"}/><p className="ml-2.5 text-sm text-gray-12 font-medium truncate">- {activeOrganization?.organization.name ??+ {activeOrg?.organization.name ??"No organization found"}</p></div>@@ -142,12 +143,17 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {<CommandInput placeholder="Search organizations..." /><CommandEmpty>No organizations found</CommandEmpty><CommandGroup>- {organizationData?.map((organization) => {+ {orgData?.map((organization) => {const isSelected =- activeOrganization?.organization.id ===+ activeOrg?.organization.id ===organization.organization.id;return (<CommandItem+ className={clsx(+ "transition-colors duration-300",+ isSelected ? "pointer-events-none text-gray-12"+ : "!text-gray-10 hover:!text-gray-12"+ )}key={organization.organization.name + "-organization"}onSelect={async () => {await updateActiveOrganization(@@ -157,13 +163,12 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {}}>{organization.organization.name}- <Check- size={18}- className={classNames(- "ml-auto",- isSelected ? "opacity-100" : "opacity-0"- )}- />+ {isSelected && (+ <Check+ size={18}+ className={"ml-auto"}+ />+ )}</CommandItem>);})}@@ -249,20 +254,40 @@ export const AdminNavItems = ({ collapsed }: { collapsed?: boolean }) => {<div className="pb-0 w-full lg:pb-5"><UsageButtoncollapsed={collapsed ?? false}- subscribed={isSubscribed}+ subscribed={userIsSubscribed}/><p className="mt-4 text-xs text-center truncate text-gray-10">Cap Software, Inc. {new Date().getFullYear()}.</p></div></nav>- <DialogContent>- <DialogHeader>- <DialogTitle>Create a new Organization</DialogTitle>+ <DialogContent className="p-0 w-full max-w-md rounded-xl border bg-gray-2 border-gray-4">+ <DialogHeader icon={<FontAwesomeIcon icon={faBuilding} />} description="A new organization to share caps with your team">+ <DialogTitle className="text-lg text-gray-12">Create New Organization</DialogTitle></DialogHeader>- <DialogDescription>- <NewOrganization onOrganizationCreated={() => setDialogOpen(false)} />- </DialogDescription>+ <div className="p-5">+ <NewOrganization+ onOrganizationCreated={() => setDialogOpen(false)}+ formRef={setFormRef}+ />+ </div>+ <DialogFooter>+ <Button+ variant="gray"+ size="sm"+ onClick={() => setDialogOpen(false)}+ >+ Cancel+ </Button>+ <Button+ variant="dark"+ size="sm"+ onClick={() => formRef?.requestSubmit()}+ type="submit"+ >+ Create+ </Button>+ </DialogFooter></DialogContent></Dialog>);diff --git a/apps/web/app/dashboard/_components/DashboardInner.tsx b/apps/web/app/dashboard/_components/DashboardInner.tsxindex 79e171a7b..b455196e5 100644--- a/apps/web/app/dashboard/_components/DashboardInner.tsx+++ b/apps/web/app/dashboard/_components/DashboardInner.tsx@@ -1,5 +1,11 @@"use client";+import {+ useSharedContext,+ useTheme,+} from "@/app/dashboard/_components/DynamicSharedLayout";+import { Avatar } from "@/app/s/[videoId]/_components/tabs/Activity";+import { UpgradeModal } from "@/components/UpgradeModal";import {Command,CommandGroup,@@ -8,28 +14,22 @@ import {PopoverContent,PopoverTrigger,} from "@cap/ui";-import { MoreVertical, Sparkles } from "lucide-react";-import { useState } from "react";-import {- useSharedContext,- useTheme,-} from "@/app/dashboard/_components/DynamicSharedLayout";-import { Avatar } from "@/app/s/[videoId]/_components/tabs/Activity";-import { UpgradeModal } from "@/components/UpgradeModal";import {+ faCrown,faGear,faHome,faMessage,faMoon,faSignOut,- faCrown,faSun,} from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import clsx from "clsx";+import { MoreVertical } from "lucide-react";import { signOut } from "next-auth/react";import Link from "next/link";import { usePathname } from "next/navigation";+import { useState } from "react";export default function DashboardInner({children,diff --git a/apps/web/app/dashboard/_components/DynamicSharedLayout.tsx b/apps/web/app/dashboard/_components/DynamicSharedLayout.tsxindex 20e85b4e3..3473575a1 100644--- a/apps/web/app/dashboard/_components/DynamicSharedLayout.tsx+++ b/apps/web/app/dashboard/_components/DynamicSharedLayout.tsx@@ -76,7 +76,7 @@ export default function DynamicSharedLayout({</aside>{/* Header/topbar is now expected to be rendered by children if needed */}{/* Main content area */}- <div className="overflow-y-auto col-span-1 row-span-2 focus:outline-none">+ <div className="overflow-y-auto col-span-1 row-span-2 custom-scroll focus:outline-none"><AdminMobileNav />{children}</div>diff --git a/apps/web/app/dashboard/caps/Caps.tsx b/apps/web/app/dashboard/caps/Caps.tsxindex 3ced677e9..41df5e364 100644--- a/apps/web/app/dashboard/caps/Caps.tsx+++ b/apps/web/app/dashboard/caps/Caps.tsx@@ -13,6 +13,7 @@ import { Button } from "@cap/ui";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";import { faTrash } from "@fortawesome/free-solid-svg-icons";import { deleteVideo } from "@/actions/videos/delete";+import NumberFlow from "@number-flow/react";type VideoData = {id: string;@@ -235,6 +236,7 @@ export const Caps = ({</div>)}+<AnimatePresence>{selectedCaps.length > 0 && (<motion.div@@ -253,28 +255,11 @@ export const Caps = ({stiffness: 200,}}>- <div className="flex gap-1 text-sm font-medium text-gray-12">- <AnimatePresence initial={false} mode="wait">- <motion.div- initial={{- opacity: 0,- y: animateDirection === "up" ? 10 : -10,- scale: 0.9,- }}- animate={{ opacity: 1, y: 0, scale: 1 }}- key={selectedCaps.length}- layoutId="selected-caps-count"- className="tabular-nums"- exit={{- opacity: 0,- y: animateDirection === "up" ? -10 : 10,- scale: 0.9,- }}- transition={{ duration: 0.1, ease: "easeInOut" }}- >- {selectedCaps.length}- </motion.div>- </AnimatePresence>+ <div className="flex gap-1 text-sm font-medium text-gray-10">+ <NumberFlow+ value={selectedCaps.length}+ className="tabular-nums text-md text-gray-12"+ />cap{selectedCaps.length !== 1 ? "s" : ""} selected</div><div className="flex gap-2 ml-4">diff --git a/apps/web/app/dashboard/caps/components/CapPagination.tsx b/apps/web/app/dashboard/caps/components/CapPagination.tsxindex 33e08cb32..4a82a8687 100644--- a/apps/web/app/dashboard/caps/components/CapPagination.tsx+++ b/apps/web/app/dashboard/caps/components/CapPagination.tsx@@ -1,4 +1,3 @@-import { serverEnv } from "@cap/env";import {Pagination,PaginationContent,@@ -40,6 +39,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{currentPage !== 1 && (<PaginationItem><PaginationLink+ className="min-w-[54px]"href={`/dashboard/caps?page=${currentPage}`}isActive={true}>@@ -50,6 +50,7 @@ export const CapPagination: React.FC<CapPaginationProps> = ({{totalPages > currentPage + 1 && (<PaginationItem><PaginationLink+ className="min-w-[54px]"href={`/dashboard/caps?page=${currentPage + 1}`}isActive={false}>diff --git a/apps/web/app/dashboard/caps/components/EmptyCapState.tsx b/apps/web/app/dashboard/caps/components/EmptyCapState.tsxindex be1a4e1bd..04bc06bfa 100644--- a/apps/web/app/dashboard/caps/components/EmptyCapState.tsx+++ b/apps/web/app/dashboard/caps/components/EmptyCapState.tsx@@ -9,7 +9,7 @@ interface EmptyCapStateProps {export const EmptyCapState: React.FC<EmptyCapStateProps> = ({ userName }) => {const { theme } = useTheme();const { RiveComponent: EmptyCap } = useRive({- src: "/rive/empty.riv",+ src: "/rive/main.riv",artboard: theme === "light" ? "empty" : "darkempty",autoplay: true,});diff --git a/apps/web/app/dashboard/caps/components/SharingDialog.tsx b/apps/web/app/dashboard/caps/components/SharingDialog.tsxindex a56c3c1df..0e56c784e 100644--- a/apps/web/app/dashboard/caps/components/SharingDialog.tsx+++ b/apps/web/app/dashboard/caps/components/SharingDialog.tsx@@ -1,10 +1,9 @@-import { Button, Input } from "@cap/ui";+import { Button, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, Input } from "@cap/ui";import { faShareNodes } from "@fortawesome/free-solid-svg-icons";import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";-import { Dialog, Transition } from "@headlessui/react";import clsx from "clsx";import { Plus, Search } from "lucide-react";-import { Fragment, useEffect, useState } from "react";+import { useEffect, useState } from "react";import { toast } from "react-hot-toast";interface SharingDialogProps {@@ -133,111 +132,76 @@ export const SharingDialog: React.FC<SharingDialogProps> = ({);return (- <Transition appear show={isOpen} as={Fragment}>- <Dialog- as="div"- open={isOpen}- onClose={onClose}- className="relative z-50"- >- <Transition.Child- enter="duration-300 ease-out"- enterFrom="opacity-0"- enterTo="opacity-100"- leave="duration-200 ease-in"- leaveFrom="opacity-100"- leaveTo="opacity-0"- className="fixed inset-0 bg-black/60"- />- <Transition.Child- enter="ease-out duration-300"- enterFrom="opacity-0 scale-95"- enterTo="opacity-100 scale-100"- leave="ease-in duration-200"- leaveFrom="opacity-100 scale-100"- leaveTo="opacity-0 scale-95"- className="flex fixed inset-0 justify-center items-center p-4 bg-gray-1/70"+ <Dialog open={isOpen} onOpenChange={onClose}>+ <DialogContent className="p-0 w-full max-w-md rounded-xl border bg-gray-2 border-gray-4">+ <DialogHeader+ icon={<FontAwesomeIcon icon={faShareNodes} className="size-3.5" />}+ description="Select the organizations you would like to share with">- <Dialog.Panel className="w-full max-w-md rounded-xl border bg-gray-1 border-gray-2">- <Dialog.Title className="p-5 font-semibold border-b flex gap-3 border-gray-2 text-[16px]">- <div className="flex justify-center items-center rounded-full border border-gray-3 bg-gray-2 size-10">- <FontAwesomeIcon- className="text-gray-10 size-3"- icon={faShareNodes}- />- </div>- <div className="flex flex-col">- <p className="text-gray-12 text-md">- Share{" "}- <span className="font-bold text-gray-12">{capName}</span>- </p>- <p className="text-sm text-gray-10">- Select the organizations you would like to share with- </p>- </div>- </Dialog.Title>- <div className="p-5">- <div className="relative mb-4">- <Input- type="text"- placeholder="Search..."- value={searchTerm}- className="pr-8"- onChange={(e) => setSearchTerm(e.target.value)}- />- <Search- className="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-10"- size={20}- />- </div>- <div className="overflow-y-auto max-h-60">- {filteredOrganizations && filteredOrganizations.length > 0 ? (- filteredOrganizations.map((organization) => (- <div- key={organization.id}- className={clsx(- `flex items-center border transition-colors duration-200 border-gray-3 justify-between p-3 rounded-xl cursor-pointer`,- selectedOrganizations.has(organization.id)- ? "bg-gray-1"- : "hover:bg-gray-3 hover:border-gray-4"- )}- onClick={() => handleToggleOrganization(organization.id)}- >- <div className="flex items-center">- <div className="flex justify-center items-center mr-3 w-8 h-8 font-semibold rounded-md bg-blue-10 text-gray-12">- {organization.name.charAt(0).toUpperCase()}- </div>- <span className="text-sm transition-colors duration-200 text-gray-12">- {organization.name}- </span>- </div>- {selectedOrganizations.has(organization.id) ? (- <span className="text-sm font-medium text-blue-500">- Added- </span>- ) : (- <Plus className="text-gray-10" size={20} />- )}+ <DialogTitle>+ Share <span className="font-bold text-gray-12">{capName}</span>+ </DialogTitle>+ </DialogHeader>+ <div className="p-5">+ <div className="relative mb-4">+ <Input+ type="text"+ placeholder="Search..."+ value={searchTerm}+ className="pr-8"+ onChange={(e) => setSearchTerm(e.target.value)}+ />+ <Search+ className="absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-10"+ size={20}+ />+ </div>+ <div className="flex overflow-y-auto flex-col gap-2.5 max-h-60">+ {filteredOrganizations && filteredOrganizations.length > 0 ? (+ filteredOrganizations.map((organization) => (+ <div+ key={organization.id}+ className={clsx(+ `flex items-center border transition-colors duration-200 border-gray-3 justify-between p-3 rounded-xl cursor-pointer`,+ selectedOrganizations.has(organization.id)+ ? "bg-gray-1"+ : "hover:bg-gray-3 hover:border-gray-4"+ )}+ onClick={() => handleToggleOrganization(organization.id)}+ >+ <div className="flex items-center">+ <div className="flex justify-center items-center mr-3 w-8 h-8 font-semibold rounded-md bg-blue-10 text-gray-12">+ {organization.name.charAt(0).toUpperCase()}</div>- ))- ) : (- <div className="flex gap-2 justify-center items-center pt-2 text-sm">- <p className="text-gray-12">No organizations found</p>+ <span className="text-sm transition-colors duration-200 text-gray-12">+ {organization.name}+ </span></div>- )}+ {selectedOrganizations.has(organization.id) ? (+ <span className="text-sm font-medium text-blue-500">+ Added+ </span>+ ) : (+ <Plus className="text-gray-10" size={20} />+ )}+ </div>+ ))+ ) : (+ <div className="flex gap-2 justify-center items-center pt-2 text-sm">+ <p className="text-gray-12">No organizations found</p></div>- </div>- <div className="flex justify-end p-5 space-x-2 border-t border-gray-2">- <Button size="sm" variant="gray" onClick={onClose}>- Cancel- </Button>- <Button size="sm" variant="dark" onClick={handleSave}>- Save- </Button>- </div>- </Dialog.Panel>- </Transition.Child>- </Dialog>- </Transition>+ )}+ </div>+ </div>+ <DialogFooter className="p-5 border-t border-gray-4">+ <Button size="sm" variant="gray" onClick={onClose}>+ Cancel+ </Button>+ <Button size="sm" variant="dark" onClick={handleSave}>+ Save+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>);};diff --git a/apps/web/app/dashboard/shared-caps/components/EmptySharedCapState.tsx b/apps/web/app/dashboard/shared-caps/components/EmptySharedCapState.tsxindex aef6086c5..99fdbeae4 100644--- a/apps/web/app/dashboard/shared-caps/components/EmptySharedCapState.tsx+++ b/apps/web/app/dashboard/shared-caps/components/EmptySharedCapState.tsx@@ -10,7 +10,7 @@ export const EmptySharedCapState: React.FC<EmptySharedCapStateProps> = ({}) => {const { theme } = useTheme();const { RiveComponent: EmptyCap } = useRive({- src: "/rive/empty.riv",+ src: "/rive/main.riv",artboard: theme === "light" ? "emptyshared" : "darkemptyshared",autoplay: true,});diff --git a/apps/web/app/globals.css b/apps/web/app/globals.cssindex c7d901e36..fb840539a 100644--- a/apps/web/app/globals.css+++ b/apps/web/app/globals.css@@ -46,6 +46,21 @@ html {background-color: white;}+::-webkit-scrollbar {+ width: 7px;+}++/* Track */+::-webkit-scrollbar-track {+ border-radius: 10px;+}++/* Handle */+::-webkit-scrollbar-thumb {+ background: rgb(116, 116, 116);+ border-radius: 10px;+}+::selection {background: black;color: #ffffff;@@ -458,6 +473,21 @@ slot:not(.dashboard-layout slot) {@apply bg-gray-50}+/* Custom scrollbar */+.custom-scroll {+ margin-right: 3px; /* Add margin to create space between scrollbar and window edge */+ overflow-y: scroll;+}++.custom-scroll::-webkit-scrollbar {+ width: 7px;+ background-color: transparent;+}++.custom-scroll::-webkit-scrollbar-thumb {+ @apply bg-gray-7 w-[7px] rounded-full;+}+#scrolling-section slot {display: block;}diff --git a/apps/web/components/UpgradeModal.tsx b/apps/web/components/UpgradeModal.tsxindex 05e0390cb..cfe9567fd 100644--- a/apps/web/components/UpgradeModal.tsx+++ b/apps/web/components/UpgradeModal.tsx@@ -1,8 +1,9 @@"use client";-import { Button, Dialog, DialogContent, DialogTitle, Switch } from "@cap/ui";+import { Button, Dialog, DialogContent, Switch } from "@cap/ui";import { getProPlanId } from "@cap/utils";-import { useRive } from "@rive-app/react-canvas";+import NumberFlow from '@number-flow/react';+import { Fit, Layout, useRive } from "@rive-app/react-canvas";import { AnimatePresence, motion } from "framer-motion";import {BarChart3,@@ -19,7 +20,7 @@ import {Users,} from "lucide-react";import { useRouter } from "next/navigation";-import { useState } from "react";+import { memo, useState } from "react";import toast from "react-hot-toast";interface UpgradeModalProps {@@ -64,67 +65,66 @@ export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {const totalPrice = pricePerUser * proQuantity;const billingText = isAnnual ? "billed annually" : "billed monthly";- const { RiveComponent: Pro, rive: riveInstance } = useRive({- src: "/rive/pricing.riv",- artboard: "pro",- animations: ["items-coming-out"],+ useRive({+ src: "/rive/main.riv",+ artboard: "cap-pro-modal",+ animations: ["animation"],+ layout: new Layout({+ fit: Fit.Cover+ }),autoplay: true,});- const handleProHover = () => {- if (riveInstance) {- riveInstance.play(["items-coming-out"]);- }- };+ const iconStyling = "text-blue-500 size-[18px]";const proFeatures = [{- icon: <Globe className="w-8 h-8 text-blue-500" />,+ icon: <Globe className={iconStyling} />,title: "Custom domain",description: "Connect your own domain to Cap",},{- icon: <Share2 className="w-8 h-8 text-blue-500" />,+ icon: <Share2 className={iconStyling} />,title: "Unlimited sharing",description: "Cloud storage & shareable links",},{- icon: <Database className="w-8 h-8 text-blue-500" />,+ icon: <Database className={iconStyling} />,title: "Custom storage",description: "Connect your own S3 bucket",},{- icon: <Shield className="w-8 h-8 text-blue-500" />,+ icon: <Shield className={iconStyling} />,title: "Commercial license",description: "Commercial license for desktop app automatically included",},{- icon: <Users className="w-8 h-8 text-blue-500" />,+ icon: <Users className={iconStyling} />,title: "Team features",description: "Collaborate with your team and create shared spaces",},{- icon: <Sparkles className="w-8 h-8 text-blue-500" />,+ icon: <Sparkles className={iconStyling} />,title: "Cap AI (Coming Soon)",description: "Automatic video chapters, summaries & more",},{- icon: <Infinity className="w-8 h-8 text-blue-500" />,+ icon: <Infinity className={iconStyling} />,title: "Unlimited views",description: "No limits on video views",},{- icon: <Lock className="w-8 h-8 text-blue-500" />,+ icon: <Lock className={iconStyling} />,title: "Password protected videos",description: "Enhanced security for your content",},{- icon: <BarChart3 className="w-8 h-8 text-blue-500" />,+ icon: <BarChart3 className={iconStyling} />,title: "Analytics",description: "Video viewing insights",},{- icon: <Headphones className="w-8 h-8 text-blue-500" />,+ icon: <Headphones className={iconStyling} />,title: "Priority support",description: "Get help when you need it",},@@ -165,55 +165,57 @@ export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[650px] bg-gray-2 border border-gray-4 max-h-[90vh] overflow-y-auto p-6">+ <DialogContent className="sm:max-w-[1100px] w-[calc(100%-20px)] custom-scroll bg-gray-2 border+ border-gray-4 overflow-y-auto md:overflow-hidden max-h-[90vh] p-0"><AnimatePresence mode="wait">{open && (<motion.div- className="relative"+ className="flex relative flex-col h-full md:flex-row"variants={modalVariants}initial="hidden"animate="visible"exit="exit">- <div className="sr-only">- <DialogTitle>Upgrade to Cap Pro</DialogTitle>- </div>-- <div className="flex flex-col items-center py-6">- <div className="flex flex-col items-center">- <Pro- className="w-[250px] h-[120px]"- onMouseEnter={handleProHover}- />+ <div className="flex relative flex-col flex-1 justify-between items-end self-stretch border-r-0 border-b md:border-b-0 md:border-r border-gray-4">+ <div+ className="h-[275px] border-b border-gray-4 w-full overflow-hidden">+ <ProRiveArt />+ </div>+ <div className="flex relative flex-col flex-1 justify-center items-center py-6 w-full">+ <div className="flex flex-col items-center"><h1 className="text-3xl font-bold text-gray-12">Upgrade to Cap Pro</h1></div>-- <p className="mt-1 text-lg text-gray-11">+ <p className="mt-1 text-lg text-center text-gray-11">You can cancel anytime. Early adopter pricing locked in.</p><div className="flex flex-col items-center mt-3 mb-4 w-full">- <div className="flex items-end mb-1">- <h3 className="text-3xl font-medium text-gray-12">- ${totalPrice}/mo- </h3>+ <div className="flex flex-col items-center mb-1 sm:items-end sm:flex-row">+ <NumberFlow+ value={totalPrice}+ className="text-3xl font-medium tabular-nums text-gray-12"+ format={{+ style: "currency",+ currency: "USD",+ }}+ /><span className="mb-1 ml-2 text-gray-11">{proQuantity === 1 ? (`per user, ${billingText}`) : (<>- for <strong>{proQuantity}</strong> users,{" "}+ for <NumberFlow value={proQuantity} className="tabular-nums text-gray-12" /> users,{" "}{billingText}</>)}</span></div>- <div className="flex justify-between items-center mt-8 w-full max-w-md">- <div className="flex items-center">- <span className="mr-3 text-gray-12">Annual billing</span>+ <div className="flex flex-col gap-6 justify-evenly items-center mt-8 w-full max-w-md sm:gap-10 sm:flex-row">+ <div className="flex gap-3 items-center">+ <span className="text-gray-12">Annual billing</span><Switchchecked={isAnnual}onCheckedChange={() => setIsAnnual(!isAnnual)}@@ -232,9 +234,7 @@ export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {><Minus className="w-4 h-4 text-gray-12" /></button>- <div className="flex justify-center items-center w-10 h-8 text-gray-12 bg-gray-3">- {proQuantity}- </div>+ <NumberFlow value={proQuantity} className="mx-auto w-6 text-sm tabular-nums text-center text-gray-12" /><buttononClick={() => setProQuantity(proQuantity + 1)}className="flex justify-center items-center w-8 h-8 rounded-r-md bg-gray-4 hover:bg-gray-5"@@ -249,26 +249,24 @@ export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {<Buttonvariant="primary"onClick={planCheckout}- className="w-full max-w-md h-14 text-lg rounded-xl"+ className="mt-5 w-full max-w-sm h-14 text-lg rounded-xl"disabled={proLoading}>{proLoading ? "Loading..." : "Upgrade to Cap Pro"}</Button></div>+ </div>- <div className="pt-8 mt-4 border-t border-gray-5">- <h2 className="mb-10 text-2xl font-bold text-center text-gray-12">- Here's what's included- </h2>-- <div className="grid grid-cols-1 gap-x-10 gap-y-12 md:grid-cols-2">++ <div className="flex flex-1 justify-center items-center self-stretch p-8 bg-transparent md:bg-gray-3">+ <div className="grid grid-cols-1 gap-8 md:grid-cols-2">{proFeatures.map((feature, index) => (- <div key={index} className="flex flex-col items-center">- <div className="mb-3">{feature.icon}</div>- <h3 className="mb-1 text-lg font-medium text-gray-12">+ <div key={index} className="flex flex-col justify-center items-center">+ <div className="mb-3.5 bg-gray-5 rounded-full size-10 flex items-center border border-gray-6 justify-center">{feature.icon}</div>+ <h3 className="text-base font-medium text-center text-gray-12">{feature.title}</h3>- <p className="text-center text-gray-11">+ <p className="text-sm text-center text-gray-11">{feature.description}</p></div>@@ -282,3 +280,17 @@ export const UpgradeModal = ({ open, onOpenChange }: UpgradeModalProps) => {</Dialog>);};++const ProRiveArt = memo(() => {+ const {RiveComponent: ProModal} = useRive({+ src: "/rive/main.riv",+ artboard: "cap-pro-modal",+ animations: ["animation"],+ layout: new Layout({+ fit: Fit.Cover+ }),+ autoplay: true,+ });++ return <ProModal className="w-full h-full" />;+});\ No newline at end of filediff --git a/apps/web/components/forms/NewOrganization.tsx b/apps/web/components/forms/NewOrganization.tsxindex 778d1017d..19939d70b 100644--- a/apps/web/components/forms/NewOrganization.tsx+++ b/apps/web/components/forms/NewOrganization.tsx@@ -2,55 +2,58 @@import { zodResolver } from "@hookform/resolvers/zod";import * as z from "zod";-import { Button } from "@cap/ui";import {Form,FormControl,FormField,- FormItem,- FormLabel,- FormMessage,+ Input,} from "@cap/ui";-import { Input } from "@cap/ui";import { useForm } from "react-hook-form";import { createOrganization } from "./server";-export function NewOrganization(props: { onOrganizationCreated: () => void }) {+export interface NewOrganizationProps {+ onOrganizationCreated: () => void;+ formRef?: React.Dispatch<React.SetStateAction<HTMLFormElement | null>>;+}++export const NewOrganization: React.FC<NewOrganizationProps> = (props) => {const formSchema = z.object({name: z.string().min(1),});const form = useForm<z.infer<typeof formSchema>>({resolver: zodResolver(formSchema),+ defaultValues: {+ name: "",+ },});return (<Form {...form}><form- onSubmit={form.handleSubmit(async (args) => {- await createOrganization(args);- props.onOrganizationCreated();+ className="space-y-4"+ ref={props.formRef ? (form) => props.formRef?.(form) : undefined}+ onSubmit={form.handleSubmit(async (values) => {+ try {+ await createOrganization(values);+ props.onOrganizationCreated();+ } catch (error) {+ console.error("Error creating organization:", error);+ }})}>- <div className="space-y-4 mb-8">+ <div className="space-y-4"><FormFieldcontrol={form.control}name="name"render={({ field }) => (- <FormItem>- <FormLabel>Name</FormLabel>- <FormControl>- <Input placeholder="Your organization name" {...field} />- </FormControl>- <FormMessage />- </FormItem>+ <FormControl>+ <Input required placeholder="Your organization name" {...field} />+ </FormControl>)}/></div>- <Button type="submit" disabled={form.formState.isSubmitting}>- {form.formState.isSubmitting ? "Loading..." : "Create Organization"}- </Button></form></Form>);-}+};diff --git a/apps/web/components/pages/PricingPage.tsx b/apps/web/components/pages/PricingPage.tsxindex 7212740a8..3d462cdca 100644--- a/apps/web/components/pages/PricingPage.tsx+++ b/apps/web/components/pages/PricingPage.tsx@@ -10,6 +10,7 @@ import {Switch,} from "@cap/ui";import { getProPlanId } from "@cap/utils";+import NumberFlow from "@number-flow/react";import clsx from "clsx";import { Check } from "lucide-react";import { useRouter, useSearchParams } from "next/navigation";@@ -46,29 +47,11 @@ export const PricingPage = () => {const { push } = useRouter();const searchParams = useSearchParams();- const faqContent = [- {- title: "Can I self-host Cap for free?",- answer:- "Yes, you can self-host Cap for free, for personal use. However, if you want to use Cap for commercial purposes, you will need to purchase a self-hosted license.",- },- {- title: "How much does a self-hosted license cost?",- answer:- "A self-hosted license costs $9/month, per user, with a minimum of 10 users.",- },- {- title: "What happens after the beta period ends?",- answer:- "Early adopters will keep their special pricing for the lifetime of their subscription, even after we move out of beta and adjust our regular pricing.",- },- ];useEffect(() => {const init = async () => {setInitialRender(false);const planFromUrl = searchParams.get("plan");- const next = searchParams.get("next");const pendingPriceId = localStorage.getItem("pendingPriceId");const pendingProQuantity = localStorage.getItem("pendingQuantity");@@ -238,7 +221,7 @@ export const PricingPage = () => {<div><div className="py-12 mt-16 space-y-24 wrapper"><div>- <div className="text-center mb-8">+ <div className="mb-8 text-center"><divclassName={clsx("mb-4", {"fade-in-down animate-delay-1": initialRender,@@ -263,7 +246,7 @@ export const PricingPage = () => {for the lifetime of your subscription.</p><a- className="mt-3 inline-flex text-gray-10 text-sm font-bold hover:underline fade-in-down animate-delay-1"+ className="inline-flex mt-3 text-sm font-bold text-gray-10 hover:underline fade-in-down animate-delay-1"href="#testimonials"onClick={scrollToTestimonials}>@@ -288,11 +271,17 @@ export const PricingPage = () => {</CardDescription><div><div className="flex items-center space-x-3">- <h3 className="text-4xl">- {isCommercialAnnual- ? `$${29 * licenseQuantity}`- : `$${58 * licenseQuantity}`}- </h3>+ <NumberFlow+ value={isCommercialAnnual+ ? `${29 * licenseQuantity}`+ : `${58 * licenseQuantity}`}+ className="text-4xl tabular-nums"+ format={{+ notation: "compact",+ style: "currency",+ currency: "USD",+ }}+ /><div><p className="text-sm font-medium">{isCommercialAnnual@@ -333,9 +322,7 @@ export const PricingPage = () => {>-</QuantityButton>- <span className="w-4 text-center">- {licenseQuantity}- </span>+ <NumberFlow value={licenseQuantity} className="text-sm tabular-nums" /><QuantityButtononClick={() =>setLicenseQuantity(licenseQuantity + 1)@@ -388,8 +375,7 @@ export const PricingPage = () => {<CardclassName={`bg-gray-1 rounded-xl min-h-[600px] flex-grow border-blue-500 border-4 ${- initialRender ? "fade-in-up animate-delay-2" : ""- }`}+ initialRender ? "fade-in-up animate-delay-2" : ""}`}><div className="space-y-3"><CardHeader>@@ -406,27 +392,35 @@ export const PricingPage = () => {</CardDescription><div><div className="flex items-center space-x-3">- <h3 className="text-4xl">- {isAnnual- ? `$${6 * proQuantity}/mo`- : `$${9 * proQuantity}/mo`}- </h3>+ <NumberFlow+ value={isAnnual+ ? `${6 * proQuantity}`+ : `${9 * proQuantity}`}+ className="text-4xl tabular-nums"+ format={{+ notation: "compact",+ style: "currency",+ currency: "USD",+ }}+ suffix="/mo"+ /><div><p className="text-sm font-medium">{isAnnual- ? proQuantity === 1+ ? (proQuantity === 1? "per user, billed annually."- : `for ${proQuantity} users, billed annually.`- : proQuantity === 1- ? "per user, billed monthly."- : `for ${proQuantity} users, billed monthly.`}+ : <>for <NumberFlow value={proQuantity} className="text-sm font-medium tabular-nums" /> users, billed annually.</>)+ : (proQuantity === 1+ ? "per user, billed monthly."+ : <>for <NumberFlow value={proQuantity} className="text-sm font-medium tabular-nums" /> users, billed monthly.</>)+ }</p>{isAnnual && (<p className="text-sm">- or, ${9 * proQuantity}/month,{" "}+ or, <NumberFlow value={9 * proQuantity} className="text-sm tabular-nums" format={{ notation: "compact", style: "currency", currency: "USD", }} suffix="/mo" />{" "}{proQuantity === 1? "per user, "- : `for ${proQuantity} users, `}+ : <>for <NumberFlow value={proQuantity} className="text-sm tabular-nums" /> users, </>}billed monthly.</p>)}@@ -452,7 +446,7 @@ export const PricingPage = () => {>-</QuantityButton>- <span className="w-4 text-center">{proQuantity}</span>+ <NumberFlow value={proQuantity} className="text-sm tabular-nums" /><QuantityButtononClick={() => setProQuantity(proQuantity + 1)}>diff --git a/apps/web/package.json b/apps/web/package.jsonindex 93ead0f08..537b3da19 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -32,6 +32,7 @@"@intercom/messenger-js-sdk": "^0.0.14","@mux/mux-node": "^8.5.1","@mux/mux-player-react": "^3.3.0",+ "@number-flow/react": "^0.5.9","@octokit/rest": "^20.0.2","@radix-ui/colors": "^3.0.0","@radix-ui/react-tooltip": "^1.2.0",diff --git a/apps/web/public/rive/empty.riv b/apps/web/public/rive/empty.rivdeleted file mode 100644index 98d24e8c6..000000000Binary files a/apps/web/public/rive/empty.riv and /dev/null differdiff --git a/apps/web/public/rive/main.riv b/apps/web/public/rive/main.rivnew file mode 100644index 000000000..9f5507d90Binary files /dev/null and b/apps/web/public/rive/main.riv differdiff --git a/packages/ui/src/components/Dialog.tsx b/packages/ui/src/components/Dialog.tsxindex 34b481859..59a201237 100644--- a/packages/ui/src/components/Dialog.tsx+++ b/packages/ui/src/components/Dialog.tsx@@ -26,14 +26,20 @@ const DialogContent = React.forwardRef<React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>>(({ className, children, ...props }, ref) => (<DialogPortal>- <DialogOverlay />+ <DialogOverlay className="animate-fadeIn" /><div className="flex fixed inset-0 z-50 justify-center items-center"><DialogPrimitive.Contentref={ref}className={classNames(- "relative p-6 w-full max-w-lg rounded-xl shadow-lg bg-gray-3 border-gray-9",+ "relative p-0 w-full max-w-md rounded-xl border shadow-lg bg-gray-2 border-gray-4 animate-contentShow",className)}+ style={{+ position: 'fixed',+ top: '50%',+ left: '50%',+ transform: 'translate(-50%, -50%)',+ }}{...props}>{children}@@ -47,17 +53,37 @@ const DialogContent = React.forwardRef<));DialogContent.displayName = DialogPrimitive.Content.displayName;+type DialogHeaderProps = React.HTMLAttributes<HTMLDivElement> & {+ icon?: React.JSX.Element;+ description?: string;+};+const DialogHeader = ({className,+ icon,+ description,+ children,...props-}: React.HTMLAttributes<HTMLDivElement>) => (+}: DialogHeaderProps) => (<divclassName={classNames(- "flex flex-col space-y-1.5 text-center sm:text-left pb-4 mb-4 border-b border-gray-6",+ "flex gap-3 items-center p-5 border-b border-gray-4",className)}{...props}- />+ >+ {icon && (+ <div className="flex justify-center items-center rounded-full border text-gray-12 border-gray-5 bg-gray-3 size-10">+ {icon}+ </div>+ )}+ <div className="flex flex-col">+ {children}+ {description && (+ <p className="text-sm text-gray-10">{description}</p>+ )}+ </div>+ </div>);DialogHeader.displayName = "DialogHeader";@@ -67,7 +93,7 @@ const DialogFooter = ({}: React.HTMLAttributes<HTMLDivElement>) => (<divclassName={classNames(- "flex flex-col-reverse pt-4 mt-6 border-t sm:flex-row sm:justify-end sm:space-x-2 border-subtle",+ "flex flex-col-reverse gap-1 p-5 border-t border-gray-4 sm:flex-row sm:justify-end sm:space-x-2",className)}{...props}@@ -82,7 +108,7 @@ const DialogTitle = React.forwardRef<<DialogPrimitive.Titleref={ref}className={classNames(- "text-xl font-bold tracking-tight leading-none text-gray-12",+ "text-lg font-bold text-gray-12",className)}{...props}@@ -96,7 +122,7 @@ const DialogDescription = React.forwardRef<>(({ className, ...props }, ref) => (<DialogPrimitive.Descriptionref={ref}- className={classNames("text-sm text-gray-11", className)}+ className={classNames("p-5 text-sm text-gray-11", className)}{...props}/>));@@ -109,5 +135,7 @@ export {DialogFooter,DialogHeader,DialogTitle,- DialogTrigger,+ DialogTrigger};++export type { DialogHeaderProps };diff --git a/packages/ui/src/components/Pagination.tsx b/packages/ui/src/components/Pagination.tsxindex ee21fc967..c2929188b 100644--- a/packages/ui/src/components/Pagination.tsx+++ b/packages/ui/src/components/Pagination.tsx@@ -69,8 +69,8 @@ const PaginationPrevious = ({className={classNames("gap-1 pl-2.5", className)}{...props}>- <ChevronLeft className="w-4 h-4" />- <span>Previous</span>+ <ChevronLeft className="size-4" />+ <p className="text-sm text-gray-12">Previous</p></PaginationLink>);PaginationPrevious.displayName = "PaginationPrevious";@@ -85,8 +85,8 @@ const PaginationNext = ({className={classNames("gap-1 pr-2.5", className)}{...props}>- <span>Next</span>- <ChevronRight className="w-4 h-4" />+ <p className="text-sm text-gray-12">Next</p>+ <ChevronRight className="size-4" /></PaginationLink>);PaginationNext.displayName = "PaginationNext";@@ -116,5 +116,6 @@ export {PaginationItem,PaginationLink,PaginationNext,- PaginationPrevious,+ PaginationPrevious};+diff --git a/packages/ui/style/tailwind.config.js b/packages/ui/style/tailwind.config.jsindex baee6b80f..9687ff37a 100644--- a/packages/ui/style/tailwind.config.js+++ b/packages/ui/style/tailwind.config.js@@ -139,9 +139,24 @@ function getColorScale(name, alpha = false) {opacity: "0",},},+ fadeIn: {+ from: { opacity: 0 },+ to: { opacity: 1 }+ },+ fadeOut: {+ from: { opacity: 1 },+ to: { opacity: 0 }+ },+ contentShow: {+ from: { opacity: 0, transform: "translate(-50%, -48%) scale(0.96)" },+ to: { opacity: 1, transform: "translate(-50%, -50%) scale(1)" }+ },},animation: {flyEmoji: "flyEmoji 1.5s forwards",+ fadeIn: "fadeIn 200ms ease-out",+ fadeOut: "fadeOut 150ms ease-in",+ contentShow: "contentShow 200ms ease-out",},},},diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex be68b96e9..f51586150 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -457,6 +457,9 @@ importers:'@mux/mux-player-react':specifier: ^3.3.0version: 3.4.0(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])+ '@number-flow/react':+ specifier: ^0.5.9'@octokit/rest':specifier: ^20.0.2version: 20.1.2@@ -3371,6 +3374,12 @@ packages:resolution: {integrity: sha512-y7efHHwghQfk28G2z3tlZ67pLG0XdfYbcVG26r7YIXALRsrVQcTq4/tdenSmdOrEsNahIYA/eh8aEVROWGFUDg==}engines: {node: ^16.14.0 || >=18.0.0}+ '@number-flow/[email protected]':+ resolution: {integrity: sha512-cletUjLUIV6NoNg36z4CR4khIff3fb4RWzuNx8TOZVw34pUpZlgWpnDpJb4UG8B2QyYAFbptVunW0RiqoHVCDA==}+ peerDependencies:+ react: ^18 || ^19+ react-dom: ^18 || ^19+'@octokit/[email protected]':resolution: {integrity: sha512-WELCamoCJo9SN0lf3SWZccf68CF0sBNPQuLYmZ/n87p5qvBJDe9aBtr5dHkh7T9nxWZ608pizwsUbypSzZAiUw==}engines: {node: '>= 18'}@@ -7928,6 +7937,9 @@ packages:deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options.hasBin: true+ resolution: {integrity: sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==}+resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==}engines: {node: ^10.12.0 || >=12.0.0}@@ -10401,6 +10413,9 @@ packages:resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==}deprecated: This package is no longer supported.+ resolution: {integrity: sha512-P83Y9rBgN3Xpz5677YDNtuQHZpIldw6WXeWRg0+edrfFthhV7QqRdABas5gtu07QPLvbA8XhfO69rIvbKRzYIg==}+resolution: {integrity: sha512-mn8wBFV9G9+UFHIrq+pZ2r2zL4aPau/by3kJb3cM7+5tQHMt6HGQB8FDIeKFYp8o0D2pnH6nVsO88N4AmUxIWg==}engines: {node: ^14.16.0 || >=16.10.0}@@ -15656,8 +15671,8 @@ snapshots:express-rate-limit: 7.5.0([email protected])pkce-challenge: 4.1.0raw-body: 3.0.0- zod: 3.24.2- zod-to-json-schema: 3.24.3([email protected])+ zod: 3.24.4+ zod-to-json-schema: 3.24.3([email protected])transitivePeerDependencies:- supports-color@@ -16014,6 +16029,13 @@ snapshots:- bluebird- supports-color+ dependencies:+ esm-env: 1.2.2+ number-flow: 0.5.7+ react: 18.3.1+ react-dom: 18.3.1([email protected])+'@octokit/[email protected]':dependencies:'@octokit/auth-app': 7.2.1@@ -21709,6 +21731,8 @@ snapshots:transitivePeerDependencies:- supports-color+ [email protected]: {}+dependencies:acorn: 7.4.1@@ -25076,6 +25100,10 @@ snapshots:gauge: 3.0.2set-blocking: 2.0.0+ dependencies:+ esm-env: 1.2.2+dependencies:citty: 0.1.6@@ -28399,6 +28427,10 @@ snapshots:dependencies:zod: 3.24.2+ dependencies:+ zod: 3.24.4+