AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
feat(builder): UI / UX upgrade and simplification of tailwind styles (#7647)
Andy Hookereac55480235d
diff --git a/rnd/autogpt_builder/src/app/build/page.tsx b/rnd/autogpt_builder/src/app/build/page.tsxindex 7200dee363..a3e1e1ef80 100644--- a/rnd/autogpt_builder/src/app/build/page.tsx+++ b/rnd/autogpt_builder/src/app/build/page.tsx@@ -1,5 +1,5 @@"use client";-import Image from "next/image";+import { useSearchParams } from "next/navigation";import FlowEditor from '@/components/Flow';@@ -7,38 +7,10 @@ export default function Home() {const query = useSearchParams();return (- <div className="flex flex-col items-center min-h-screen">- <div className="z-10 w-full flex items-center justify-between font-mono text-sm relative">- <p className="border border-gray-600 rounded-xl pb-4 pt-4 p-4">- Get started by adding a - <code className="font-mono font-bold">block</code>- </p>- <div className="absolute top-0 right-0 p-4">- <a- className="pointer-events-auto flex place-items-center gap-2"- href="https://news.agpt.co/"- target="_blank"- rel="noopener noreferrer"- >- By{" "}- <Image- src="/AUTOgpt_Logo_dark.png"- alt="AutoGPT Logo"- width={100}- height={24}- priority- />- </a>- </div>- </div>-- <div className="w-full flex justify-center mt-10">- <FlowEditor- className="flow-container w-full min-h-[75vh] border border-gray-300 dark:border-gray-700 rounded-lg"- flowID={query.get("flowID") ?? query.get("templateID") ?? undefined}- template={!!query.get("templateID")}- />- </div>- </div>+ <FlowEditor+ className="flow-container w-full min-h-[86vh] border border-gray-300 dark:border-gray-700 rounded-lg bg-secondary"+ flowID={query.get("flowID") ?? query.get("templateID") ?? undefined}+ template={!!query.get("templateID")}+ />);}diff --git a/rnd/autogpt_builder/src/app/globals.css b/rnd/autogpt_builder/src/app/globals.cssindex d90551d168..9df147e691 100644--- a/rnd/autogpt_builder/src/app/globals.css+++ b/rnd/autogpt_builder/src/app/globals.css@@ -10,49 +10,61 @@-:root {- --background: 180 100% 95%;- --foreground: 180 5% 0%;- --card: 180 50% 90%;- --card-foreground: 180 5% 10%;- --popover: 180 100% 95%;- --popover-foreground: 180 100% 0%;- --primary: 180 76.5% 30%;- --primary-foreground: 0 0% 100%;- --secondary: 180 30% 70%;- --secondary-foreground: 0 0% 0%;- --muted: 142 30% 85%;- --muted-foreground: 180 5% 35%;- --accent: 142 30% 80%;- --accent-foreground: 180 5% 10%;- --destructive: 0 100% 30%;- --destructive-foreground: 180 5% 90%;- --border: 180 30% 50%;- --input: 180 30% 18%;- --ring: 180 76.5% 30%;- --radius: 0.5rem;-}-.dark {- --background: 180 50% 5%;- --foreground: 180 5% 90%;- --card: 180 50% 0%;- --card-foreground: 180 5% 90%;- --popover: 180 50% 5%;- --popover-foreground: 180 5% 90%;- --primary: 180 76.5% 30%;- --primary-foreground: 0 0% 100%;- --secondary: 180 30% 10%;- --secondary-foreground: 0 0% 100%;- --muted: 142 30% 15%;- --muted-foreground: 180 5% 60%;- --accent: 142 30% 15%;- --accent-foreground: 180 5% 90%;- --destructive: 0 100% 30%;- --destructive-foreground: 180 5% 90%;- --border: 180 30% 18%;- --input: 180 30% 18%;- --ring: 180 76.5% 30%;- --radius: 0.5rem;+@layer base {+ :root {+ --background: 0 0% 100%;+ --foreground: 240 10% 3.9%;+ --card: 0 0% 100%;+ --card-foreground: 240 10% 3.9%;+ --popover: 0 0% 100%;+ --popover-foreground: 240 10% 3.9%;+ --primary: 240 5.9% 10%;+ --primary-foreground: 0 0% 98%;+ --secondary: 240 4.8% 95.9%;+ --secondary-foreground: 240 5.9% 10%;+ --muted: 240 4.8% 95.9%;+ --muted-foreground: 240 3.8% 46.1%;+ --accent: 240 4.8% 95.9%;+ --accent-foreground: 240 5.9% 10%;+ --destructive: 0 84.2% 60.2%;+ --destructive-foreground: 0 0% 98%;+ --border: 240 5.9% 90%;+ --input: 240 5.9% 90%;+ --ring: 240 5.9% 10%;+ --radius: 0.5rem;+ --chart-1: 12 76% 61%;+ --chart-2: 173 58% 39%;+ --chart-3: 197 37% 24%;+ --chart-4: 43 74% 66%;+ --chart-5: 27 87% 67%;+ }++ .dark {+ --background: 240 10% 3.9%;+ --foreground: 0 0% 98%;+ --card: 240 10% 3.9%;+ --card-foreground: 0 0% 98%;+ --popover: 240 10% 3.9%;+ --popover-foreground: 0 0% 98%;+ --primary: 0 0% 98%;+ --primary-foreground: 240 5.9% 10%;+ --secondary: 240 3.7% 15.9%;+ --secondary-foreground: 0 0% 98%;+ --muted: 240 3.7% 15.9%;+ --muted-foreground: 240 5% 64.9%;+ --accent: 240 3.7% 15.9%;+ --accent-foreground: 0 0% 98%;+ --destructive: 0 62.8% 30.6%;+ --destructive-foreground: 0 0% 98%;+ --border: 240 3.7% 15.9%;+ --input: 240 3.7% 15.9%;+ --ring: 240 4.9% 83.9%;+ --chart-1: 220 70% 50%;+ --chart-2: 160 60% 45%;+ --chart-3: 30 80% 55%;+ --chart-4: 280 65% 60%;+ --chart-5: 340 75% 55%;+ }}diff --git a/rnd/autogpt_builder/src/app/layout.tsx b/rnd/autogpt_builder/src/app/layout.tsxindex f7b4dc8ddb..24f882ed57 100644--- a/rnd/autogpt_builder/src/app/layout.tsx+++ b/rnd/autogpt_builder/src/app/layout.tsx@@ -1,17 +1,12 @@import React from 'react';import type { Metadata } from "next";import { Inter } from "next/font/google";-import Link from "next/link";-import { Pencil1Icon, TimerIcon } from "@radix-ui/react-icons";import "./globals.css";-import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";-import { Button, buttonVariants } from "@/components/ui/button";-import {- DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger-} from "@/components/ui/dropdown-menu";import { Providers } from "@/app/providers";+import {NavBar} from "@/components/NavBar";+import {cn} from "@/lib/utils";const inter = Inter({ subsets: ["latin"] });@@ -19,58 +14,34 @@ export const metadata: Metadata = {title: "NextGen AutoGPT",description: "Your one stop shop to creating AI Agents",};--const NavBar = () => (- <nav className="bg-white dark:bg-slate-800 p-4 flex justify-between items-center shadow">- <div className="flex space-x-4">- <Link href="/monitor" className={buttonVariants({ variant: "ghost" })}>- <TimerIcon className="mr-1" /> Monitor- </Link>- <Link href="/build" className={buttonVariants({ variant: "ghost" })}>- <Pencil1Icon className="mr-1" /> Build- </Link>- </div>- <DropdownMenu>- <DropdownMenuTrigger asChild>- <Button variant="ghost" className="h-8 w-8 rounded-full">- <Avatar>- <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />- <AvatarFallback>CN</AvatarFallback>- </Avatar>- </Button>- </DropdownMenuTrigger>- <DropdownMenuContent align="end">- <DropdownMenuItem>Profile</DropdownMenuItem>- <DropdownMenuItem>Settings</DropdownMenuItem>- <DropdownMenuItem>Switch Workspace</DropdownMenuItem>- <DropdownMenuItem>Log out</DropdownMenuItem>- </DropdownMenuContent>- </DropdownMenu>- </nav>-);export default function RootLayout({- children,+ children,}: Readonly<{- children: React.ReactNode;+ children: React.ReactNode;}>) {- return (- <html lang="en">- <body className={inter.className}>- <Providers- attribute="class"- defaultTheme="light"- // Feel free to remove this line if you want to use the system theme by default- // enableSystem- disableTransitionOnChange- >- <div className="min-h-screen bg-gray-200 text-gray-900">- <NavBar />- <main className="mx-auto p-4">- {children}- </main>- </div>- </Providers>- </body>- </html>- );+ return (+ <html lang="en">+ <body className={+ cn(+ 'antialiased transition-colors',+ inter.className+ )+ }>+ <Providers+ attribute="class"+ defaultTheme="light"+ // Feel free to remove this line if you want to use the system theme by default+ // enableSystem+ disableTransitionOnChange+ >+ <div className="flex flex-col min-h-screen ">+ <NavBar/>+ <main className="flex-1 p-4 overflow-hidden">+ {children}+ </main>+ </div>+ </Providers>+ </body>+ </html>+ );}diff --git a/rnd/autogpt_builder/src/components/NavBar.tsx b/rnd/autogpt_builder/src/components/NavBar.tsxnew file mode 100644index 0000000000..9a0ef90031--- /dev/null+++ b/rnd/autogpt_builder/src/components/NavBar.tsx@@ -0,0 +1,99 @@+import {+ DropdownMenu,+ DropdownMenuContent, DropdownMenuItem,+ DropdownMenuTrigger+} from "@/components/ui/dropdown-menu";+import Link from "next/link";+import { Menu } from "lucide-react";+import { Button } from "@/components/ui/button";+import React from "react";+import { Sheet, SheetContent, SheetTrigger } from "@/components/ui/sheet";+import { Pencil1Icon, TimerIcon } from "@radix-ui/react-icons";+import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";+import Image from "next/image";++export function NavBar() {+ return (+ <header className="sticky top-0 flex h-16 items-center gap-4 border-b bg-background px-4 md:px-6">+ <div className="flex items-center gap-4 flex-1">+ <Sheet>+ <SheetTrigger asChild>+ <Button+ variant="outline"+ size="icon"+ className="shrink-0 md:hidden"+ >+ <Menu className="size-5"/>+ <span className="sr-only">Toggle navigation menu</span>+ </Button>+ </SheetTrigger>+ <SheetContent side="left">+ <nav className="grid gap-6 text-lg font-medium">+ <Link+ href="/monitor"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 "+ >+ <TimerIcon className="size-6" /> Monitor+ </Link>+ <Link+ href="/build"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2"+ >+ <Pencil1Icon className="size-6"/> Build+ </Link>+ </nav>+ </SheetContent>+ </Sheet>+ <nav className="hidden md:flex md:flex-row md:items-center md:gap-5 lg:gap-6">+ <Link+ href="/monitor"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"+ >+ <TimerIcon className="size-4"/> Monitor+ </Link>+ <Link+ href="/build"+ className="text-muted-foreground hover:text-foreground flex flex-row gap-2 items-center"+ >+ <Pencil1Icon className="size-4"/> Build+ </Link>+ </nav>+ </div>+ <div className="flex-1 flex justify-center relative">+ <a+ className="pointer-events-auto flex place-items-center gap-2"+ href="https://news.agpt.co/"+ target="_blank"+ rel="noopener noreferrer"+ >+ By{" "}+ <Image+ src="/AUTOgpt_Logo_dark.png"+ alt="AutoGPT Logo"+ width={100}+ height={20}+ priority+ />+ </a>+ </div>+ <div className="flex items-center gap-4 flex-1 justify-end">+ <DropdownMenu>+ <DropdownMenuTrigger asChild>+ <Button variant="ghost" className="size-8">+ <Avatar>+ <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn"/>+ <AvatarFallback>CN</AvatarFallback>+ </Avatar>+ </Button>+ </DropdownMenuTrigger>+ <DropdownMenuContent align="end">+ <DropdownMenuItem>Profile</DropdownMenuItem>+ <DropdownMenuItem>Settings</DropdownMenuItem>+ <DropdownMenuItem>Switch Workspace</DropdownMenuItem>+ <DropdownMenuItem>Log out</DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ </div>+ </header>+ );+}\ No newline at end of filediff --git a/rnd/autogpt_builder/src/components/flow.css b/rnd/autogpt_builder/src/components/flow.cssindex de725f5f0a..79b789e6b7 100644--- a/rnd/autogpt_builder/src/components/flow.css+++ b/rnd/autogpt_builder/src/components/flow.css@@ -1,14 +1,9 @@/* flow.css or index.css */body {- margin: 0;font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen','Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',sans-serif;- -webkit-font-smoothing: antialiased;- -moz-osx-font-smoothing: grayscale;- background-color: #121212;- color: #e0e0e0;}code {@@ -131,7 +126,6 @@ input::placeholder, textarea::placeholder {.flow-container {width: 100%;height: 600px; /* Adjust this height as needed */- position: relative;}.flow-wrapper {diff --git a/rnd/autogpt_builder/src/components/ui/sheet.tsx b/rnd/autogpt_builder/src/components/ui/sheet.tsxnew file mode 100644index 0000000000..05670faaa0--- /dev/null+++ b/rnd/autogpt_builder/src/components/ui/sheet.tsx@@ -0,0 +1,143 @@+"use client";++import * as React from "react";+import * as SheetPrimitive from "@radix-ui/react-dialog";+import { Cross2Icon } from "@radix-ui/react-icons";+import { cva, type VariantProps } from "class-variance-authority";++import { cn } from "@/lib/utils";++const Sheet = SheetPrimitive.Root;++const SheetTrigger = SheetPrimitive.Trigger;++const SheetClose = SheetPrimitive.Close;++const SheetPortal = SheetPrimitive.Portal;++const SheetOverlay = React.forwardRef<+ React.ElementRef<typeof SheetPrimitive.Overlay>,+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>+>(({ className, ...props }, ref) => (+ <SheetPrimitive.Overlay+ className={cn(+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",+ className,+ )}+ {...props}+ ref={ref}+ />+));+SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;++const sheetVariants = cva(+ "fixed z-50 gap-4 bg-white p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out dark:bg-neutral-950",+ {+ variants: {+ side: {+ top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",+ bottom:+ "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",+ left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",+ right:+ "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",+ },+ },+ defaultVariants: {+ side: "right",+ },+ },+);++interface SheetContentProps+ extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>,+ VariantProps<typeof sheetVariants> {}++const SheetContent = React.forwardRef<+ React.ElementRef<typeof SheetPrimitive.Content>,+ SheetContentProps+>(({ side = "right", className, children, ...props }, ref) => (+ <SheetPortal>+ <SheetOverlay />+ <SheetPrimitive.Content+ ref={ref}+ className={cn(sheetVariants({ side }), className)}+ {...props}+ >+ <SheetPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-neutral-100 dark:ring-offset-neutral-950 dark:focus:ring-neutral-300 dark:data-[state=open]:bg-neutral-800">+ <Cross2Icon className="h-4 w-4" />+ <span className="sr-only">Close</span>+ </SheetPrimitive.Close>+ {children}+ </SheetPrimitive.Content>+ </SheetPortal>+));+SheetContent.displayName = SheetPrimitive.Content.displayName;++const SheetHeader = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLDivElement>) => (+ <div+ className={cn(+ "flex flex-col space-y-2 text-center sm:text-left",+ className,+ )}+ {...props}+ />+);+SheetHeader.displayName = "SheetHeader";++const SheetFooter = ({+ className,+ ...props+}: React.HTMLAttributes<HTMLDivElement>) => (+ <div+ className={cn(+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",+ className,+ )}+ {...props}+ />+);+SheetFooter.displayName = "SheetFooter";++const SheetTitle = React.forwardRef<+ React.ElementRef<typeof SheetPrimitive.Title>,+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>+>(({ className, ...props }, ref) => (+ <SheetPrimitive.Title+ ref={ref}+ className={cn(+ "text-lg font-semibold text-neutral-950 dark:text-neutral-50",+ className,+ )}+ {...props}+ />+));+SheetTitle.displayName = SheetPrimitive.Title.displayName;++const SheetDescription = React.forwardRef<+ React.ElementRef<typeof SheetPrimitive.Description>,+ React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>+>(({ className, ...props }, ref) => (+ <SheetPrimitive.Description+ ref={ref}+ className={cn("text-sm text-neutral-500 dark:text-neutral-400", className)}+ {...props}+ />+));+SheetDescription.displayName = SheetPrimitive.Description.displayName;++export {+ Sheet,+ SheetPortal,+ SheetOverlay,+ SheetTrigger,+ SheetClose,+ SheetContent,+ SheetHeader,+ SheetFooter,+ SheetTitle,+ SheetDescription,+};