Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
wip: Landing page redesign
Richie McIlroyda1c3fb948b3
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.tomlindex 523243ade..5aa94a183 100644--- a/apps/desktop/src-tauri/Cargo.toml+++ b/apps/desktop/src-tauri/Cargo.toml@@ -1,7 +1,7 @@[package]name = "cap"version = "0.0.0"-description = "Beautiful, shareable screen recordings. Open-source and privacy-friendly."+description = "Effortless, instant screen sharing. Open source and cross-platform."authors = ["you"]license = ""repository = ""diff --git a/apps/web/app/globals.css b/apps/web/app/globals.cssindex 8e3a1fcf5..f746aefb8 100644--- a/apps/web/app/globals.css+++ b/apps/web/app/globals.css@@ -160,10 +160,23 @@ button {@apply transition-all;}+nav ul {+ @apply list-none;+}+nav a {@apply text-sm md:text-base;}+nav.mobile a {+ @apply flex w-full;+}++nav.mobile a:not(.button),+nav.mobile a:not(.button) * {+ @apply text-[1.3rem] text-gray-700;+}+label {@apply text-left text-sm font-semibold block;}@@ -177,6 +190,15 @@ label {);}+.muted-custom-bg {+ background: radial-gradient(+ 50.01% 50.01% at 53.53% 49.99%,+ var(--tertiary-3) 4.65%,+ var(--tertiary-3) 68.48%,+ #ffffff 100%+ );+}+.styled-links a {@apply font-semibold underline;}diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsxindex 49d610402..677085d68 100644--- a/apps/web/app/layout.tsx+++ b/apps/web/app/layout.tsx@@ -6,13 +6,15 @@ import type { Metadata } from "next";import { getCurrentUser } from "@cap/database/auth/session";export const metadata: Metadata = {- title: "Cap — Beautiful, shareable screen recordings. Open source.",+ title:+ "Cap — Effortless, instant screen sharing. Open source and cross-platform.",description:- "Cap is an open source and privacy focused alternative to Loom. It's a video messaging tool that allows you to record, edit and share videos in seconds.",+ "Cap is the open source alternative to Loom. Lightweight, powerful, and stunning. Record and share in seconds.",openGraph: {- title: "Cap — Beautiful, shareable screen recordings. Open source.",+ title:+ "Cap — Effortless, instant screen sharing. Open source and cross-platform.",description:- "Cap is an open source and privacy focused alternative to Loom. It's a video messaging tool that allows you to record, edit and share videos in seconds.",+ "Cap is the open source alternative to Loom. Lightweight, powerful, and stunning. Record and share in seconds.",type: "website",url: "https://cap.so",images: ["https://cap.so/og.png"],diff --git a/apps/web/app/login/form.tsx b/apps/web/app/login/form.tsxindex 542c386b1..a2e255341 100644--- a/apps/web/app/login/form.tsx+++ b/apps/web/app/login/form.tsx@@ -36,7 +36,9 @@ export function LoginForm() {setLoading(false);if (res?.ok && !res?.error) {setEmail("");- toast.success("Email sent - check your inbox!");+ toast.success("Email sent - check your inbox!", {+ duration: 20000,+ });} else {toast.error("Error sending email - try again?");}@@ -63,12 +65,38 @@ export function LoginForm() {onChange={(e) => {setEmail(e.target.value);}}- className="mt-1 block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-black focus:outline-none focus:ring-black sm:text-sm"+ className="block w-full appearance-none rounded-full border border-gray-300 px-3 h-12 placeholder-gray-400 shadow-sm focus:border-black focus:outline-none focus:ring-black text-lg"/></div>- <Button variant="default" type="submit" disabled={loading}>+ <Button+ variant="default"+ size="lg"+ className="h-12 text-lg"+ type="submit"+ disabled={loading}+ >Continue with Email</Button>+ <p className="text-xs text-gray-500 pt-2">+ By typing your email and clicking continue, you acknowledge that you+ have both read and agree to Cap's{" "}+ <a+ href="/terms"+ target="_blank"+ className="text-gray-600 font-semibold"+ >+ Terms of Service+ </a>{" "}+ and{" "}+ <a+ href="/privacy"+ target="_blank"+ className="text-gray-600 font-semibold"+ >+ Privacy Policy+ </a>+ .+ </p></form></>);diff --git a/apps/web/app/login/page.tsx b/apps/web/app/login/page.tsxindex 6a72f3bce..f37a00c79 100644--- a/apps/web/app/login/page.tsx+++ b/apps/web/app/login/page.tsx@@ -7,27 +7,23 @@ import { redirect } from "next/navigation";export default async function LoginPage() {const session = await getCurrentUser();- console.log('session:')- console.log(session);-if (session) {redirect("/dashboard");}return (- <div className="wrapper w-full h-screen flex items-center justify-center">- <div className="relative overflow-hidden border-y border-gray-200 sm:rounded-2xl sm:border sm:shadow-xl">- <div className="flex flex-col items-center justify-center space-y-3 border-b border-gray-200 bg-white px-4 py-6 pt-8 text-center sm:px-16">- <a href="/">- <LogoBadge className="h-12 w-auto" />- </a>- <h3 className="text-xl font-semibold">Sign in to Cap</h3>- <p className="text-sm text-gray-500">- Beautiful, shareable screen recordings. Open source and- privacy-focused.+ <div className="muted-custom-bg wrapper w-full h-screen flex items-center justify-center">+ <div className="w-full max-w-lg relative overflow-hidden sm:rounded-2xl p-4 space-y-4">+ <a href="/">+ <LogoBadge className="h-12 w-auto" />+ </a>+ <div className="text-left flex flex-col items-start justify-center space-y-3">+ <h1 className="text-3xl font-semibold">Sign in to Cap.</h1>+ <p className="text-2xl text-gray-500">+ Effortless, instant screen sharing. Open source and cross-platform.</p></div>- <div className="flex flex-col space-y-3 bg-gray-50 px-4 py-8 sm:px-16">+ <div className="flex flex-col space-y-3"><Suspensefallback={<>diff --git a/apps/web/components/Navbar.tsx b/apps/web/components/Navbar.tsxindex 91fbce0a7..d856b1122 100644--- a/apps/web/components/Navbar.tsx+++ b/apps/web/components/Navbar.tsx@@ -1,13 +1,26 @@"use client";import { usePathname } from "next/navigation";-import { Logo } from "@cap/ui";-import { Button } from "@cap/ui";+import { Button, ListItem } from "@cap/ui";+import {+ NavigationMenu,+ NavigationMenuContent,+ NavigationMenuItem,+ NavigationMenuLink,+ NavigationMenuList,+ NavigationMenuTrigger,+ Logo,+ navigationMenuTriggerStyle,+} from "@cap/ui";import Link from "next/link";+import { useState } from "react";+import { Menu, X } from "lucide-react";+import { classNames } from "../../../packages/utils/src/helpers";export const Navbar = ({ auth }: { auth: boolean }) => {const pathname = usePathname();const isHomePage = pathname === "/";+ const [showMobileMenu, setShowMobileMenu] = useState(false);if (pathname === "/login" ||@@ -18,60 +31,186 @@ export const Navbar = ({ auth }: { auth: boolean }) => {return null;return (- <nav- className={`${- isHomePage === true- ? "bg-transparent border-transparent"- : "bg-white border-gray-100"- } border-b-2 z-20 p-5 relative transition-all flex justify-between wrapper w-full`}- >- <div>- <a href="/">- <Logo className="w-20 sm:w-24 h-auto" />- </a>- </div>- <ul className="p-0 m-0 space-x-5 text-lg flex items-center list-none text-black">- <li>- <a- href="https://capso.notion.site/7aac740edeee49b5a23be901a7cb734e?v=7c1f56484be4497aae03e1aa5fba0f34"- target="_blank"- >- Roadmap- </a>- </li>- <li>- <a href="/faq">FAQ</a>- </li>- <li>- <a href="https://discord.gg/y8gdQ3WRN3" target="_blank">- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className="w-6 h-6 md:w-7 md:w-7"- viewBox="0 0 24 24"- >- <path d="M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"></path>- </svg>+ <>+ <div+ className={`${+ isHomePage === true+ ? "bg-transparent border-transparent"+ : "bg-white border-gray-100"+ } border-b-2 z-20 p-5 relative transition-all flex justify-between w-full max-w-3xl mx-auto`}+ >+ <div>+ <a href="/">+ <Logo className="w-20 sm:w-24 h-auto" /></a>- </li>- <li>- <a href="https://github.com/CapSoftware/cap" target="_blank">- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className="w-5 h-5 md:w-6 md:h-6"- viewBox="0 0 24 24"- >- <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path>- </svg>- </a>- </li>- {auth === true && (- <li>- <Button href="/dashboard">Dashboard</Button>- </li>- )}- </ul>- </nav>+ </div>+ <div className="block md:hidden">+ <button onClick={() => setShowMobileMenu(!showMobileMenu)}>+ <Menu className="w-[28px] h-[28px]" />+ </button>+ </div>+ <div className="hidden md:block">+ <NavigationMenu>+ <NavigationMenuList>+ <NavigationMenuItem>+ <NavigationMenuTrigger>Product</NavigationMenuTrigger>+ <NavigationMenuContent>+ <ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">+ <ListItem href="/changelog" title="Changelog">+ The latest updates and changes to Cap.+ </ListItem>+ <ListItem href="/download" title="Download">+ Download for macOS. Windows and Linux coming soon.+ </ListItem>+ <ListItem+ href="https://github.com/CapSoftware/Cap"+ title="Open source"+ target="_blank"+ >+ Cap is open source and available on GitHub.+ </ListItem>+ <ListItem+ href="https://discord.gg/y8gdQ3WRN3"+ title="Join the community"+ target="_blank"+ >+ Join the Cap discord community.+ </ListItem>+ </ul>+ </NavigationMenuContent>+ </NavigationMenuItem>+ <NavigationMenuItem>+ <Link href="/pricing" legacyBehavior passHref>+ <NavigationMenuLink className={navigationMenuTriggerStyle()}>+ Pricing+ </NavigationMenuLink>+ </Link>+ </NavigationMenuItem>+ <NavigationMenuItem>+ <Link href="/updates" legacyBehavior passHref>+ <NavigationMenuLink className={navigationMenuTriggerStyle()}>+ Updates+ </NavigationMenuLink>+ </Link>+ </NavigationMenuItem>+ <NavigationMenuItem>+ <NavigationMenuTrigger>Help</NavigationMenuTrigger>+ <NavigationMenuContent>+ <ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">+ <ListItem href="/faqs" title="FAQs">+ Frequently asked questions about Cap.+ </ListItem>+ <ListItem href="mailto:[email protected]" title="Email support">+ Support via email+ </ListItem>+ <ListItem href="#" title="Live chat">+ Support via live chat+ </ListItem>+ </ul>+ </NavigationMenuContent>+ </NavigationMenuItem>+ <NavigationMenuItem>+ <Link+ href={auth === false ? "/login" : "/dashboard"}+ legacyBehavior+ passHref+ >+ <NavigationMenuLink className={navigationMenuTriggerStyle()}>+ {auth === false ? "Sign in" : "Dashboard"}+ </NavigationMenuLink>+ </Link>+ </NavigationMenuItem>+ <NavigationMenuItem>+ <Button href="/download" size="sm">+ Download+ </Button>+ </NavigationMenuItem>+ </NavigationMenuList>+ </NavigationMenu>+ </div>+ </div>+ {showMobileMenu && (+ <div className="fixed top-0 left-0 w-full h-full px-5 bg-white z-[100000] overflow-auto">+ <div className="bg-gradient-to-b from-white to-[rgba(255,255,255,0.3)] pt-5 pb-12 sticky top-0 flex items-center justify-between">+ <a href="/">+ <Logo className="w-20 sm:w-24 h-auto" />+ </a>+ <button onClick={() => setShowMobileMenu(!showMobileMenu)}>+ <X className="w-[28px] h-[28px]" />+ </button>+ </div>+ <div className="pb-12">+ <nav className="mobile">+ <ul className="p-0 space-y-10">+ <li>+ <Link href="/pricing" passHref>+ Pricing+ </Link>+ </li>+ <li>+ <Link href="/changelog" passHref>+ Updates+ </Link>+ </li>+ <li>+ <Link href="/download" passHref>+ Download+ </Link>+ </li>+ <li>+ <Link href="/login" passHref>+ Get started+ </Link>+ </li>+ <li>+ <Link+ href="https://github.com/CapSoftware/Cap"+ passHref+ target="_blank"+ className="flex items-center"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className="w-6 h-6"+ viewBox="0 0 24 24"+ >+ <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path>+ </svg>+ <span className="ml-2">Open Source</span>+ </Link>+ </li>+ <li>+ <Link+ href="https://discord.gg/y8gdQ3WRN3"+ passHref+ target="_blank"+ className="flex items-center"+ >+ <svg+ xmlns="http://www.w3.org/2000/svg"+ fill="currentColor"+ className="w-6 h-6"+ viewBox="0 0 24 24"+ >+ <path d="M20.317 4.37a19.791 19.791 0 00-4.885-1.515.074.074 0 00-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 00-5.487 0 12.64 12.64 0 00-.617-1.25.077.077 0 00-.079-.037A19.736 19.736 0 003.677 4.37a.07.07 0 00-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 00.031.057 19.9 19.9 0 005.993 3.03.078.078 0 00.084-.028c.462-.63.874-1.295 1.226-1.994a.076.076 0 00-.041-.106 13.107 13.107 0 01-1.872-.892.077.077 0 01-.008-.128 10.2 10.2 0 00.372-.292.074.074 0 01.077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 01.078.01c.12.098.246.198.373.292a.077.077 0 01-.006.127 12.299 12.299 0 01-1.873.892.077.077 0 00-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 00.084.028 19.839 19.839 0 006.002-3.03.077.077 0 00.032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 00-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"></path>+ </svg>+ <span className="ml-2">Join the community</span>+ </Link>+ </li>+ <li>+ <Button+ href={auth === false ? "/login" : "/dashboard"}+ size="lg"+ >+ {auth === false ? "Sign in" : "Dashboard"}+ </Button>+ </li>+ </ul>+ </nav>+ </div>+ </div>+ )}+ </>);};diff --git a/apps/web/components/pages/HomePage.tsx b/apps/web/components/pages/HomePage.tsxindex 1a426d3b7..0ac86b759 100644--- a/apps/web/components/pages/HomePage.tsx+++ b/apps/web/components/pages/HomePage.tsx@@ -6,6 +6,9 @@ import { useState, useRef } from "react";import { Parallax } from "react-scroll-parallax";import toast from "react-hot-toast";import { ParallaxProvider } from "react-scroll-parallax";+import { Button } from "@cap/ui";+import Link from "next/link";+import { Newspaper } from "lucide-react";export const HomePage = () => {const [showEmail, setShowEmail] = useState<boolean>(false);@@ -47,8 +50,8 @@ export const HomePage = () => {<ParallaxProvider><div className="w-full custom-bg"><div className="wrapper wrapper-sm mx-auto">- <div className="mb-auto -mt-20 text-center md:px-4 pt-32 pb-52 md:pt-44 md:pb-64 space-y-8">- <h1 className="fade-in-down text-3xl sm:text-5xl lg:text-7xl relative z-10 text-black">+ <div className="mb-auto -mt-20 text-center md:px-4 pt-32 pb-52 md:pb-64 space-y-8">+ <h1 className="fade-in-down text-3xl lg:text-5xl relative z-10 text-black">Effortless, instant screen sharing.</h1><p className="fade-in-down animate-delay-1 text-base sm:text-xl max-w-2xl mx-auto text-black mb-8">@@ -114,39 +117,13 @@ export const HomePage = () => {) : (<div className="fade-in-up animate-delay-2"><div className="flex items-center justify-center space-x-2 mb-3">- <button- onClick={() => {- setShowEmail(true);- emailRef.current?.focus();- }}- className="bg-primary-2 hover:bg-primary-3 border border-primary text-white font-medium text-sm sm:text-base rounded-lg py-1.5 px-3"- >- Join Waitlist- </button>- <a- href="https://github.com/CapSoftware/cap"- target="_blank"- className="bg-gray-700 hover:bg-gray-800 border border-gray-600 flex items-center space-x-2 text-white font-medium text-sm sm:text-base rounded-lg py-1.5 px-3"- >- <svg- xmlns="http://www.w3.org/2000/svg"- fill="currentColor"- className="w-5 h-5"- viewBox="0 0 24 24"- >- <path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"></path>- </svg>- <span className="text-white">Star on GitHub</span>- </a>+ <Button href="/download" size="lg">+ Download for free+ </Button></div><p className="text-gray-500 text-sm">- Early access testing is currently underway in our{" "}- <a- href="https://discord.gg/y8gdQ3WRN3"- className="font-semibold text-gray-500 hover:underline"- >- Discord community- </a>+ Cap is currently available for macOS and Windows in public+ beta. Linux coming soon.</p></div>)}diff --git a/packages/ui/package.json b/packages/ui/package.jsonindex 9d3bd0f36..2c8e39161 100644--- a/packages/ui/package.json+++ b/packages/ui/package.json@@ -36,16 +36,17 @@"vite-tsconfig-paths": "^4.2.1"},"dependencies": {+ "@cap/utils": "workspace:*","@radix-ui/react-dialog": "^1.0.5","@radix-ui/react-label": "^2.0.2",+ "@radix-ui/react-navigation-menu": "^1.1.4","@radix-ui/react-popover": "^1.0.7","@radix-ui/react-slot": "^1.0.2","class-variance-authority": "^0.7.0","cmdk": "^0.2.0","lucide-react": "^0.294.0","react-hook-form": "^7.49.2",- "react-loading-skeleton": "^3.3.1",- "@cap/utils": "workspace:*"+ "react-loading-skeleton": "^3.3.1"},"engines": {"node": "20"diff --git a/packages/ui/src/components/Button.tsx b/packages/ui/src/components/Button.tsxindex 8706e21f3..a27313bcd 100644--- a/packages/ui/src/components/Button.tsx+++ b/packages/ui/src/components/Button.tsx@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority";import { classNames } from "@cap/utils";const buttonVariants = cva(- "inline-flex items-center justify-center rounded-full text-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 tracking-tight",+ "button inline-flex items-center justify-center rounded-full text-base transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 tracking-tight",{variants: {variant: {@@ -13,7 +13,8 @@ const buttonVariants = cva("default-button group relative isolate font-medium inline-flex items-center justify-center overflow-hidden text-sm transition duration-300 ease-[cubic-bezier(0.4,0.36,0,1)] before:duration-300 before:ease-[cubic-bezier(0.4,0.36,0,1)] before:transtion-opacity rounded-full ring-1 before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-full before:bg-gradient-to-b before:from-white/20 before:opacity-50 hover:before:opacity-100 after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-full after:bg-gradient-to-b after:from-white/10 after:from-[46%] after:to-[54%] after:mix-blend-overlay dark:ring-0 bg-primary ring-2 text-white ring-primary",destructive:"group relative isolate font-medium inline-flex items-center justify-center overflow-hidden text-sm transition duration-300 ease-[cubic-bezier(0.4,0.36,0,1)] before:duration-300 before:ease-[cubic-bezier(0.4,0.36,0,1)] before:transtion-opacity rounded-full ring-1 before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-full before:bg-gradient-to-b before:from-white/20 before:opacity-50 hover:before:opacity-100 after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-full after:bg-gradient-to-b after:from-white/10 after:from-[46%] after:to-[54%] after:mix-blend-overlay dark:ring-0 bg-red-900 ring-2 text-white ring-900",- outline: "border border-input bg-white text-primary hover:bg-gray-50",+ outline:+ "default-button group relative isolate font-medium inline-flex items-center justify-center overflow-hidden text-sm transition duration-300 ease-[cubic-bezier(0.4,0.36,0,1)] before:duration-300 before:ease-[cubic-bezier(0.4,0.36,0,1)] before:transtion-opacity rounded-full ring-1 before:pointer-events-none before:absolute before:inset-0 before:-z-10 before:rounded-full before:bg-gradient-to-b before:from-white/20 before:opacity-50 hover:before:opacity-100 after:pointer-events-none after:absolute after:inset-0 after:-z-10 after:rounded-full after:bg-gradient-to-b after:from-white/10 after:from-[46%] after:to-[54%] after:mix-blend-overlay dark:ring-0 bg-white ring-2 text-primary ring-primary",secondary: "bg-secondary text-white hover:bg-secondary-1",},size: {diff --git a/packages/ui/src/components/NavigationMenu.tsx b/packages/ui/src/components/NavigationMenu.tsxnew file mode 100644index 000000000..b35eaa6fe--- /dev/null+++ b/packages/ui/src/components/NavigationMenu.tsx@@ -0,0 +1,155 @@+import * as React from "react";+import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu";+import { cva } from "class-variance-authority";+import { ChevronDown } from "lucide-react";++import { classNames } from "@cap/utils";++const NavigationMenu = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>+>(({ className, children, ...props }, ref) => (+ <NavigationMenuPrimitive.Root+ ref={ref}+ className={classNames(+ "relative z-10 flex max-w-max flex-1 items-center justify-center",+ className+ )}+ {...props}+ >+ {children}+ <NavigationMenuViewport />+ </NavigationMenuPrimitive.Root>+));+NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName;++const NavigationMenuList = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.List>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>+>(({ className, ...props }, ref) => (+ <NavigationMenuPrimitive.List+ ref={ref}+ className={classNames(+ "group flex flex-1 list-none items-center justify-center space-x-1",+ className+ )}+ {...props}+ />+));+NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;++const NavigationMenuItem = NavigationMenuPrimitive.Item;++const navigationMenuTriggerStyle = cva(+ "group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50 hover:underline"+);++const NavigationMenuTrigger = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>+>(({ className, children, ...props }, ref) => (+ <NavigationMenuPrimitive.Trigger+ ref={ref}+ className={classNames(navigationMenuTriggerStyle(), "group", className)}+ {...props}+ >+ {children}{" "}+ <ChevronDown+ className="relative top-[-1px] ml-[1px] h-4 w-4 transition duration-200 group-data-[state=open]:rotate-180"+ aria-hidden="true"+ />+ </NavigationMenuPrimitive.Trigger>+));+NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName;++const NavigationMenuContent = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>+>(({ className, ...props }, ref) => (+ <NavigationMenuPrimitive.Content+ ref={ref}+ className={classNames(+ "bg-white left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",+ className+ )}+ {...props}+ />+));+NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName;++const NavigationMenuLink = NavigationMenuPrimitive.Link;++const NavigationMenuViewport = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>+>(({ className, ...props }, ref) => (+ <div className={classNames("absolute left-0 top-full flex justify-center")}>+ <NavigationMenuPrimitive.Viewport+ className={classNames(+ "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",+ className+ )}+ ref={ref}+ {...props}+ />+ </div>+));+NavigationMenuViewport.displayName =+ NavigationMenuPrimitive.Viewport.displayName;++const NavigationMenuIndicator = React.forwardRef<+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>+>(({ className, ...props }, ref) => (+ <NavigationMenuPrimitive.Indicator+ ref={ref}+ className={classNames(+ "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",+ className+ )}+ {...props}+ >+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />+ </NavigationMenuPrimitive.Indicator>+));+NavigationMenuIndicator.displayName =+ NavigationMenuPrimitive.Indicator.displayName;++const ListItem = React.forwardRef<+ React.ElementRef<"a">,+ React.ComponentPropsWithoutRef<"a">+>(({ className, title, children, ...props }, ref) => {+ return (+ <li>+ <NavigationMenuLink asChild>+ <a+ ref={ref}+ className={classNames(+ "block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",+ className+ )}+ {...props}+ >+ <div className="text-base font-semibold leading-none">{title}</div>+ <p className="line-clamp-2 text-sm leading-snug text-muted-foreground">+ {children}+ </p>+ </a>+ </NavigationMenuLink>+ </li>+ );+});+ListItem.displayName = "ListItem";++export {+ navigationMenuTriggerStyle,+ NavigationMenu,+ NavigationMenuList,+ NavigationMenuItem,+ NavigationMenuContent,+ NavigationMenuTrigger,+ NavigationMenuLink,+ NavigationMenuIndicator,+ NavigationMenuViewport,+ ListItem,+};diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsxindex d5de538de..eda4055f0 100644--- a/packages/ui/src/index.tsx+++ b/packages/ui/src/index.tsx@@ -16,6 +16,7 @@ export * from "./components/Cmdk";export * from "./components/Dialog";export * from "./components/Popover";export * from "./components/Card";+export * from "./components/NavigationMenu";// Forms & Inputsexport * from "./components/input/Form";diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex e5a5e8e3e..b2d098458 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -392,6 +392,9 @@ importers:'@radix-ui/react-label':specifier: ^2.0.2version: 2.0.2(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-navigation-menu':+ specifier: ^1.1.4+ version: 1.1.4(@types/[email protected])(@types/[email protected])([email protected])([email protected])'@radix-ui/react-popover':specifier: ^1.0.7version: 1.0.7(@types/[email protected])(@types/[email protected])([email protected])([email protected])@@ -2618,6 +2621,30 @@ packages:react-dom: 18.2.0([email protected])dev: false+ /@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-3SzW+0PW7yBBoQlT8wNcGtaxaD0XSu0uLUFgrtHY08Acx05TaHaOmVLR73c0j/cqpDy53KBMO7s0dx2wmOIDIA==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+ dependencies:+ '@babel/runtime': 7.23.8+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-slot': 1.0.2(@types/[email protected])([email protected])+ '@types/react': 18.2.48+ '@types/react-dom': 18.2.18+ react: 18.2.0+ react-dom: 18.2.0([email protected])+ dev: false+/@radix-ui/[email protected]([email protected]):resolution: {integrity: sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA==}peerDependencies:@@ -2725,6 +2752,20 @@ packages:react-remove-scroll: 2.5.5(@types/[email protected])([email protected])dev: false+ resolution: {integrity: sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ dependencies:+ '@babel/runtime': 7.23.8+ '@types/react': 18.2.48+ react: 18.2.0+ dev: false+resolution: {integrity: sha512-n7kDRfx+LB1zLueRDvZ1Pd0bxdJWDUZNQ/GWoxDn2prnuJKRdxsjulejX/ePkOsLi2tTm6P24mDqlMSgQpsT6g==}peerDependencies:@@ -2872,6 +2913,40 @@ packages:react-dom: 18.2.0([email protected])dev: false+ /@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-Cc+seCS3PmWmjI51ufGG7zp1cAAIRqHVw7C9LOA2TZ+R4hG6rDvHcTqIsEEFLmZO3zNVH72jOOE7kKNy8W+RtA==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+ dependencies:+ '@babel/runtime': 7.23.8+ '@radix-ui/primitive': 1.0.1+ '@radix-ui/react-collection': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-compose-refs': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-context': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-direction': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-dismissable-layer': 1.0.5(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-id': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-presence': 1.0.1(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@radix-ui/react-use-callback-ref': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-controllable-state': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-layout-effect': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-use-previous': 1.0.1(@types/[email protected])([email protected])+ '@radix-ui/react-visually-hidden': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@types/react': 18.2.48+ '@types/react-dom': 18.2.18+ react: 18.2.0+ react-dom: 18.2.0([email protected])+ dev: false+/@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):resolution: {integrity: sha512-shtvVnlsxT6faMnK/a7n0wptwBD23xc1Z5mdrtKLwVEfsEMXodS0r5s0/g5P0hX//EKYZS2sxUjqfzlg52ZSnQ==}peerDependencies:@@ -3159,6 +3234,20 @@ packages:react: 18.2.0dev: false+ resolution: {integrity: sha512-cV5La9DPwiQ7S0gf/0qiD6YgNqM5Fk97Kdrlc5yBcrF3jyEZQwm7vYFqMo4IfeHgJXsRaMvLABFtd0OVEmZhDw==}+ peerDependencies:+ '@types/react': '*'+ react: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ dependencies:+ '@babel/runtime': 7.23.8+ '@types/react': 18.2.48+ react: 18.2.0+ dev: false+resolution: {integrity: sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw==}peerDependencies:@@ -3189,6 +3278,27 @@ packages:react: 18.2.0dev: false+ /@radix-ui/[email protected](@types/[email protected])(@types/[email protected])([email protected])([email protected]):+ resolution: {integrity: sha512-D4w41yN5YRKtu464TLnByKzMDG/JlMPHtfZgQAu9v6mNakUqGUI9vUrfQKz8NK41VMm/xbZbh76NUTVtIYqOMA==}+ peerDependencies:+ '@types/react': '*'+ '@types/react-dom': '*'+ react: ^16.8 || ^17.0 || ^18.0+ react-dom: ^16.8 || ^17.0 || ^18.0+ peerDependenciesMeta:+ '@types/react':+ optional: true+ '@types/react-dom':+ optional: true+ dependencies:+ '@babel/runtime': 7.23.8+ '@radix-ui/react-primitive': 1.0.3(@types/[email protected])(@types/[email protected])([email protected])([email protected])+ '@types/react': 18.2.48+ '@types/react-dom': 18.2.18+ react: 18.2.0+ react-dom: 18.2.0([email protected])+ dev: false+/@radix-ui/[email protected]:resolution: {integrity: sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ==}dependencies: