Finished tabs for basic and advanced in toolbar and will work on building block UI

This commit is contained in:
Emir Karabeg
2025-01-07 01:59:30 -08:00
parent 5b1719057b
commit 1edb3574bd
18 changed files with 282 additions and 120 deletions

BIN
app/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -2,63 +2,67 @@
@tailwind components;
@tailwind utilities;
body {
font-family: Arial, Helvetica, sans-serif;
}
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--foreground: 222.2 84% 4.9%;
--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;
--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;
--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;
--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 222.2 47.4% 11.2%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
--muted: 210 40% 96.1%;
--muted-foreground: 215.4 16.3% 46.9%;
--accent: 210 40% 96.1%;
--accent-foreground: 222.2 47.4% 11.2%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 89.8%;
--input: 0 0% 89.8%;
--ring: 0 0% 3.9%;
--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%;
--destructive-foreground: 210 40% 98%;
--border: 214.3 31.8% 91.4%;
--input: 214.3 31.8% 91.4%;
--ring: 222.2 84% 4.9%;
--radius: 0.5rem;
}
.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;
--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;
--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;
--background: 222.2 84% 4.9%;
--foreground: 210 40% 98%;
--card: 222.2 84% 4.9%;
--card-foreground: 210 40% 98%;
--popover: 222.2 84% 4.9%;
--popover-foreground: 210 40% 98%;
--primary: 210 40% 98%;
--primary-foreground: 222.2 47.4% 11.2%;
--secondary: 217.2 32.6% 17.5%;
--secondary-foreground: 210 40% 98%;
--muted: 217.2 32.6% 17.5%;
--muted-foreground: 215 20.2% 65.1%;
--accent: 217.2 32.6% 17.5%;
--accent-foreground: 210 40% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 14.9%;
--input: 0 0% 14.9%;
--ring: 0 0% 83.1%;
--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%;
--destructive-foreground: 210 40% 98%;
--border: 217.2 32.6% 17.5%;
--input: 217.2 32.6% 17.5%;
--ring: 212.7 26.8% 83.9%;
}
}
@@ -66,7 +70,24 @@ body {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
/* Chrome, Safari, Edge, Opera */
input[type='search']::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}
/* Firefox */
input[type='search']::-moz-search-cancel-button {
display: none;
}
/* Microsoft Edge */
input[type='search']::-ms-clear {
display: none;
}

View File

@@ -1,34 +1,20 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
import type { Metadata } from 'next'
import './globals.css'
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
title: 'Sim Studio',
description:
'Drag and drop agents to create workflows. Powered by Simplicity',
}
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
children: React.ReactNode
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{children}
</body>
<body>{children}</body>
</html>
);
)
}

3
app/page.tsx Normal file
View File

@@ -0,0 +1,3 @@
export default function Home() {
return <div>Hello World</div>
}

View File

@@ -1,7 +1,7 @@
export default function Workflows() {
return (
<div>
<h1>Workflows</h1>
<></>
</div>
)
}

View File

@@ -0,0 +1,28 @@
'use client'
import { useState } from 'react'
import { ToolbarTabs } from './toolbar-tabs'
export function DesktopToolbar() {
const [activeTab, setActiveTab] = useState<'basic' | 'advanced'>('basic')
return (
<div className="fixed left-14 top-0 z-1 hidden h-full w-72 border-r bg-background sm:block">
<ToolbarTabs activeTab={activeTab} onTabChange={setActiveTab} />
<div className="p-4">
{activeTab === 'basic' ? (
<div>
{/* Basic tab content */}
Basic Content Here
</div>
) : (
<div>
{/* Advanced tab content */}
Advanced Content Here
</div>
)}
</div>
</div>
)
}

View File

@@ -0,0 +1,44 @@
'use client'
interface ToolbarTabsProps {
activeTab: 'basic' | 'advanced'
onTabChange: (tab: 'basic' | 'advanced') => void
}
export function ToolbarTabs({ activeTab, onTabChange }: ToolbarTabsProps) {
return (
<div className="relative pt-5">
<div className="flex gap-8 px-6">
<button
onClick={() => onTabChange('basic')}
className={`text-sm font-medium transition-colors hover:text-black ${
activeTab === 'basic' ? 'text-black' : 'text-gray-500'
}`}
>
Basic
</button>
<button
onClick={() => onTabChange('advanced')}
className={`text-sm font-medium transition-colors hover:text-black ${
activeTab === 'advanced' ? 'text-black' : 'text-gray-500'
}`}
>
Advanced
</button>
</div>
<div className="relative mt-2">
<div className="absolute bottom-0 h-[1px] w-full bg-gray-200" />
<div
className="absolute bottom-0 h-[1.5px] bg-black transition-transform duration-200"
style={{
width: activeTab === 'advanced' ? '68px' : '38px',
transform: `translateX(${
activeTab === 'advanced' ? '91px' : '23.75px'
})`,
}}
/>
</div>
</div>
)
}

View File

@@ -10,6 +10,7 @@ import {
Settings,
PanelLeft,
Package2,
Plus,
} from 'lucide-react'
import {
Tooltip,
@@ -17,7 +18,12 @@ import {
TooltipTrigger,
} from '@/components/ui/tooltip'
import { Button } from '@/components/ui/button'
import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet'
import {
Sheet,
SheetContent,
SheetTrigger,
SheetTitle,
} from '@/components/ui/sheet'
import {
Breadcrumb,
BreadcrumbItem,
@@ -28,6 +34,9 @@ import {
} from '@/components/ui/breadcrumb'
import { SearchInput } from './components/search'
import { User } from './components/user'
import Image from 'next/image'
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
import { DesktopToolbar } from './components/desktop-toolbar'
export default function WorkspaceLayout({
children,
@@ -37,13 +46,13 @@ export default function WorkspaceLayout({
return (
<Providers>
<main className="flex min-h-screen w-full flex-col bg-muted/40">
<DesktopNav />
<div className="flex flex-col sm:gap-4 sm:py-4 sm:pl-14">
<div className="flex">
<DesktopNav />
<DesktopToolbar />
</div>
<div className="flex flex-col sm:gap-4 sm:py-4 sm:pl-[344px]">
<header className="sticky top-0 z-30 flex h-14 items-center gap-4 border-b bg-background px-4 sm:static sm:h-auto sm:border-0 sm:bg-transparent sm:px-6">
<MobileNav />
<DashboardBreadcrumb />
<SearchInput />
<User />
</header>
<main className="grid flex-1 items-start gap-2 p-4 sm:px-6 sm:py-0 md:gap-4 bg-muted/40">
{children}
@@ -59,31 +68,29 @@ function DesktopNav() {
<aside className="fixed inset-y-0 left-0 z-10 hidden w-14 flex-col border-r bg-background sm:flex">
<nav className="flex flex-col items-center gap-4 px-2 sm:py-5">
<Link
href="https://vercel.com/templates/next.js/admin-dashboard-tailwind-postgres-react-nextjs"
className="group flex h-9 w-9 shrink-0 items-center justify-center gap-2 rounded-full bg-primary text-lg font-semibold text-primary-foreground md:h-8 md:w-8 md:text-base"
href="#"
className="group flex h-8 w-8 items-center justify-center rounded-lg bg-[#7F2FFF]"
>
{/* <VercelLogo className="h-3 w-3 transition-all group-hover:scale-110" /> */}
<span className="sr-only">Acme Inc</span>
<Image
src="/logo.svg"
alt="Sim Studio"
width={20}
height={20}
className="transition-all group-hover:scale-110 -translate-y-[0.5px]"
/>
<span className="sr-only">Sim Studio</span>
</Link>
<NavItem href="/" label="Dashboard">
<Home className="h-5 w-5" />
<NavItem href="#" label="Add Workflow">
<Plus className="h-5 w-5" />
</NavItem>
<NavItem href="/" label="Orders">
<ShoppingCart className="h-5 w-5" />
<NavItem href="#" label="Workflow 1">
<div className="h-4 w-4 rounded-full bg-[#3972F6]" />
</NavItem>
<NavItem href="/" label="Products">
<Package className="h-5 w-5" />
</NavItem>
<NavItem href="/" label="Customers">
<Users2 className="h-5 w-5" />
</NavItem>
<NavItem href="/" label="Analytics">
<LineChart className="h-5 w-5" />
<NavItem href="#" label="Workflow 2">
<div className="h-4 w-4 rounded-full bg-[#F639DD]" />
</NavItem>
</nav>
<nav className="mt-auto flex flex-col items-center gap-4 px-2 sm:py-5">
@@ -114,6 +121,7 @@ function MobileNav() {
</Button>
</SheetTrigger>
<SheetContent side="left" className="sm:max-w-xs">
<SheetTitle className="sr-only">Navigation Menu</SheetTitle>
<nav className="grid gap-6 text-lg font-medium">
<Link
href="#"
@@ -162,27 +170,3 @@ function MobileNav() {
</Sheet>
)
}
function DashboardBreadcrumb() {
return (
<Breadcrumb className="hidden md:flex">
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink asChild>
<Link href="#">Dashboard</Link>
</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbLink asChild>
<Link href="#">Products</Link>
</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator />
<BreadcrumbItem>
<BreadcrumbPage>All Products</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
)
}

View File

@@ -3,5 +3,9 @@
import { TooltipProvider } from '@/components/ui/tooltip'
export default function Providers({ children }: { children: React.ReactNode }) {
return <TooltipProvider>{children}</TooltipProvider>
return (
<TooltipProvider delayDuration={100} skipDelayDuration={0}>
{children}
</TooltipProvider>
)
}

55
components/ui/tabs.tsx Normal file
View File

@@ -0,0 +1,55 @@
"use client"
import * as React from "react"
import * as TabsPrimitive from "@radix-ui/react-tabs"
import { cn } from "@/lib/utils"
const Tabs = TabsPrimitive.Root
const TabsList = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.List>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
>(({ className, ...props }, ref) => (
<TabsPrimitive.List
ref={ref}
className={cn(
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
className
)}
{...props}
/>
))
TabsList.displayName = TabsPrimitive.List.displayName
const TabsTrigger = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Trigger>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Trigger
ref={ref}
className={cn(
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
className
)}
{...props}
/>
))
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName
const TabsContent = React.forwardRef<
React.ElementRef<typeof TabsPrimitive.Content>,
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
>(({ className, ...props }, ref) => (
<TabsPrimitive.Content
ref={ref}
className={cn(
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
className
)}
{...props}
/>
))
TabsContent.displayName = TabsPrimitive.Content.displayName
export { Tabs, TabsList, TabsTrigger, TabsContent }

31
package-lock.json generated
View File

@@ -11,6 +11,7 @@
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.4",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
@@ -1461,6 +1462,36 @@
}
}
},
"node_modules/@radix-ui/react-tabs": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.2.tgz",
"integrity": "sha512-9u/tQJMcC2aGq7KXpGivMm1mgq7oRJKXphDwdypPd/j21j/2znamPU8WkXgnhUaTrSFNIt8XhOyCAupg8/GbwQ==",
"license": "MIT",
"dependencies": {
"@radix-ui/primitive": "1.1.1",
"@radix-ui/react-context": "1.1.1",
"@radix-ui/react-direction": "1.1.0",
"@radix-ui/react-id": "1.1.0",
"@radix-ui/react-presence": "1.1.2",
"@radix-ui/react-primitive": "2.0.1",
"@radix-ui/react-roving-focus": "1.1.1",
"@radix-ui/react-use-controllable-state": "1.1.0"
},
"peerDependencies": {
"@types/react": "*",
"@types/react-dom": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc",
"react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
},
"@types/react-dom": {
"optional": true
}
}
},
"node_modules/@radix-ui/react-tooltip": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.1.6.tgz",

View File

@@ -12,6 +12,7 @@
"@radix-ui/react-dialog": "^1.1.4",
"@radix-ui/react-dropdown-menu": "^2.1.4",
"@radix-ui/react-slot": "^1.1.1",
"@radix-ui/react-tabs": "^1.1.2",
"@radix-ui/react-tooltip": "^1.1.6",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",

5
public/logo.svg Normal file
View File

@@ -0,0 +1,5 @@
<svg width="21" height="24" viewBox="0 0 21 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.6667 9.25H4.66667C2.64162 9.25 1 10.8916 1 12.9167V18.4167C1 20.4417 2.64162 22.0833 4.66667 22.0833H15.6667C17.6917 22.0833 19.3333 20.4417 19.3333 18.4167V12.9167C19.3333 10.8916 17.6917 9.25 15.6667 9.25Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.1663 5.58464C11.1789 5.58464 11.9997 4.76382 11.9997 3.7513C11.9997 2.73878 11.1789 1.91797 10.1663 1.91797C9.15382 1.91797 8.33301 2.73878 8.33301 3.7513C8.33301 4.76382 9.15382 5.58464 10.1663 5.58464Z" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M10.167 5.58594V9.2526M7.41699 16.5859V14.7526M12.917 14.7526V16.5859" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 866 B

BIN
public/placeholder-user.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB