docs: update AI Studio design token audits
Refresh design token inventory files to reflect the latest UI sizing and layout configurations from the sandbox prototype.
This commit is contained in:
1 parent
50449e96ad
commit
d39d9f92f9
139 files changed
+10982
-6
No files matched your search
@@ -0,0 +1,28 @@
|
||||
import React from 'react';
|
||||
|
||||
export const Footer: React.FC = () => {
|
||||
return (
|
||||
<footer className="shrink-0 h-[26px] bg-[var(--bg-activity)] border-t border-[var(--border)] px-3 sm:px-4 flex items-center justify-between text-[10px] text-[var(--text-dim)] select-none">
|
||||
<div className="flex items-center gap-1.5 truncate min-w-0 pr-2">
|
||||
<span className="font-semibold text-[var(--text-muted)] tracking-tight">DataStack</span>
|
||||
<span className="text-[var(--border-strong)]">/</span>
|
||||
<span className="font-mono text-[9px] truncate">
|
||||
storage/data/{clientId}/{YYYY-MM-DD}.csv
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center gap-2 font-mono text-[9.5px] shrink-0 ml-auto">
|
||||
<span className="flex items-center gap-1">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] inline-block" />
|
||||
<span className="text-[var(--text-muted)]">:4000</span>
|
||||
</span>
|
||||
<span className="text-[var(--border-strong)]">•</span>
|
||||
<span className="flex items-center gap-1">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--accent)] inline-block" />
|
||||
<span className="text-[var(--text-muted)]">:3000</span>
|
||||
</span>
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
@@ -0,0 +1,44 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
import { Navbar } from './Navbar';
|
||||
import { Sidebar } from './Sidebar';
|
||||
import { Footer } from './Footer';
|
||||
|
||||
interface MainLayoutProps {
|
||||
children: React.ReactNode;
|
||||
showSidebar?: boolean;
|
||||
}
|
||||
|
||||
export const MainLayout: React.FC<MainLayoutProps> = ({
|
||||
children,
|
||||
showSidebar = false,
|
||||
}) => {
|
||||
const [sidebarOpen, setSidebarOpen] = useState(false);
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex flex-col bg-[var(--bg-main)] text-[var(--text)] antialiased">
|
||||
<Navbar
|
||||
showSidebarToggle={showSidebar}
|
||||
onToggleSidebar={() => setSidebarOpen((prev) => !prev)}
|
||||
/>
|
||||
|
||||
<div className="flex-1 flex min-h-0 overflow-hidden">
|
||||
{showSidebar && (
|
||||
<Sidebar
|
||||
isOpen={sidebarOpen}
|
||||
onClose={() => setSidebarOpen(false)}
|
||||
/>
|
||||
)}
|
||||
<main className="flex-1 overflow-y-auto flex flex-col min-w-0">
|
||||
<div className="flex-1 p-2 sm:p-3.5 max-w-[1360px] w-full mx-auto">
|
||||
{children}
|
||||
</div>
|
||||
<Footer />
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default MainLayout;
|
||||
@@ -0,0 +1,141 @@
|
||||
'use client';
|
||||
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { Icon } from '@/components/ui/Icon';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
|
||||
interface NavbarProps {
|
||||
onToggleSidebar?: () => void;
|
||||
showSidebarToggle?: boolean;
|
||||
}
|
||||
|
||||
export const Navbar: React.FC<NavbarProps> = ({
|
||||
onToggleSidebar,
|
||||
showSidebarToggle = false,
|
||||
}) => {
|
||||
const pathname = usePathname();
|
||||
const [theme, setTheme] = useState<'dark' | 'light'>('dark');
|
||||
|
||||
useEffect(() => {
|
||||
const saved = localStorage.getItem('datastack-theme') as 'dark' | 'light' | null;
|
||||
const initial = saved || 'dark';
|
||||
setTheme(initial);
|
||||
if (initial === 'light') {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.classList.add('light');
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
}
|
||||
}, []);
|
||||
|
||||
const toggleTheme = () => {
|
||||
const nextTheme = theme === 'dark' ? 'light' : 'dark';
|
||||
setTheme(nextTheme);
|
||||
localStorage.setItem('datastack-theme', nextTheme);
|
||||
if (nextTheme === 'light') {
|
||||
document.documentElement.classList.remove('dark');
|
||||
document.documentElement.classList.add('light');
|
||||
} else {
|
||||
document.documentElement.classList.add('dark');
|
||||
document.documentElement.classList.remove('light');
|
||||
}
|
||||
};
|
||||
|
||||
const isVcon = pathname?.startsWith('/vcon');
|
||||
|
||||
return (
|
||||
<header className="h-[38px] shrink-0 bg-[var(--bg-activity)] border-b border-[var(--border)] px-3 sm:px-4 flex items-center justify-between z-40 select-none">
|
||||
{/* Left: Mobile hamburger + Brand */}
|
||||
<div className="flex items-center gap-2">
|
||||
{showSidebarToggle && (
|
||||
<button
|
||||
onClick={onToggleSidebar}
|
||||
className="md:hidden w-[26px] h-[26px] flex items-center justify-center text-[var(--text-muted)] hover:text-[var(--text)] border border-[var(--border)] bg-[var(--bg-elevated)] cursor-pointer"
|
||||
aria-label="Toggle Navigation"
|
||||
>
|
||||
<Icon name="Menu" size={13} />
|
||||
</button>
|
||||
)}
|
||||
|
||||
<Link href="/" className="flex items-center gap-1.5">
|
||||
<div className="w-[17px] h-[17px] bg-[var(--accent)] text-[var(--text-on-accent)] flex items-center justify-center text-[9.5px] font-bold">
|
||||
DS
|
||||
</div>
|
||||
<span className="text-[12px] font-semibold text-[var(--text)] tracking-tight">
|
||||
DataStack
|
||||
</span>
|
||||
<span className="hidden sm:inline text-[9px] text-[var(--text-dim)] font-mono border border-[var(--border)] px-1 py-0.2">
|
||||
v2.4
|
||||
</span>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Middle: Links */}
|
||||
<nav className="hidden sm:flex items-center gap-1 text-[11px]">
|
||||
<Link
|
||||
href="/"
|
||||
className={`px-2.5 py-1 transition-colors border-b-2 ${
|
||||
pathname === '/'
|
||||
? 'border-[var(--accent)] text-[var(--text)] font-medium'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
Overview
|
||||
</Link>
|
||||
<Link
|
||||
href="/vcon/dashboard"
|
||||
className={`px-2.5 py-1 transition-colors border-b-2 flex items-center gap-1.5 ${
|
||||
isVcon
|
||||
? 'border-[var(--accent)] text-[var(--text)] font-medium'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
<span>Admin Console</span>
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] shrink-0" />
|
||||
</Link>
|
||||
<Link
|
||||
href="/vcon/export"
|
||||
className={`px-2.5 py-1 transition-colors border-b-2 ${
|
||||
pathname === '/vcon/export'
|
||||
? 'border-[var(--accent)] text-[var(--text)] font-medium'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)]'
|
||||
}`}
|
||||
>
|
||||
CSV Exporter
|
||||
</Link>
|
||||
</nav>
|
||||
|
||||
{/* Right: Port Badges + Theme Toggle + Console Action */}
|
||||
<div className="flex items-center gap-1.5">
|
||||
<div className="hidden lg:flex items-center gap-1.5 text-[9.5px] text-[var(--text-dim)] font-mono border border-[var(--border)] px-1.5 py-0.5 bg-[var(--bg-main)]">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] inline-block" />
|
||||
<span>:4000</span>
|
||||
<span className="text-[var(--border-strong)]">|</span>
|
||||
<span className="w-1.5 h-1.5 bg-[var(--accent)] inline-block" />
|
||||
<span>:3000</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
onClick={toggleTheme}
|
||||
aria-label="Toggle Theme"
|
||||
className="w-[26px] h-[26px] flex items-center justify-center border border-[var(--border)] bg-[var(--bg-elevated)] text-[var(--text-muted)] hover:text-[var(--text)] cursor-pointer"
|
||||
>
|
||||
<Icon name={theme === 'dark' ? 'Sun' : 'Moon'} size={12} />
|
||||
</button>
|
||||
|
||||
{!isVcon && (
|
||||
<Link href="/vcon/dashboard">
|
||||
<Button size="xs" variant="primary" icon="Terminal">
|
||||
/vcon/
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</header>
|
||||
);
|
||||
};
|
||||
|
||||
export default Navbar;
|
||||
@@ -0,0 +1,146 @@
|
||||
'use client';
|
||||
|
||||
import React from 'react';
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { Icon } from '@/components/ui/Icon';
|
||||
|
||||
interface SidebarProps {
|
||||
isOpen?: boolean;
|
||||
onClose?: () => void;
|
||||
}
|
||||
|
||||
export const Sidebar: React.FC<SidebarProps> = ({
|
||||
isOpen = false,
|
||||
onClose,
|
||||
}) => {
|
||||
const pathname = usePathname();
|
||||
|
||||
const navigation = [
|
||||
{
|
||||
group: 'Core Telemetry',
|
||||
items: [
|
||||
{ name: 'Dashboard', href: '/vcon/dashboard', icon: 'LayoutDashboard' },
|
||||
{ name: 'Live Data Sync', href: '/vcon/data', icon: 'Activity', badge: 'Live' },
|
||||
{ name: 'CSV Exporter', href: '/vcon/export', icon: 'Download' },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: 'Management',
|
||||
items: [
|
||||
{ name: 'Client SDKs', href: '/vcon/clients', icon: 'Key' },
|
||||
{ name: 'CSV Storage & Disk', href: '/vcon/storage', icon: 'HardDrive' },
|
||||
{ name: 'Engine Settings', href: '/vcon/settings', icon: 'Sliders' },
|
||||
],
|
||||
},
|
||||
{
|
||||
group: 'Integration',
|
||||
items: [
|
||||
{ name: 'Python SDK Guide', href: '/vcon/sdk', icon: 'FileCode2' },
|
||||
{ name: 'Live Simulator', href: '/vcon/simulator', icon: 'Play' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Mobile Backdrop */}
|
||||
{isOpen && (
|
||||
<div
|
||||
onClick={onClose}
|
||||
className="fixed inset-0 z-40 bg-black/60 md:hidden backdrop-blur-[1px]"
|
||||
/>
|
||||
)}
|
||||
|
||||
{/* Sidebar Container */}
|
||||
<aside
|
||||
className={cn(
|
||||
'fixed inset-y-0 left-0 z-50 md:static w-[210px] shrink-0 bg-[var(--bg-sidebar)] border-r border-[var(--border)] flex flex-col transition-transform duration-150 ease-in-out md:translate-x-0',
|
||||
isOpen ? 'translate-x-0' : '-translate-x-full'
|
||||
)}
|
||||
>
|
||||
{/* Top Header */}
|
||||
<div className="h-[38px] px-3 flex items-center justify-between border-b border-[var(--border)] bg-[var(--bg-activity)] shrink-0">
|
||||
<div className="flex items-center gap-1.5 min-w-0">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--accent)] shrink-0" />
|
||||
<span className="text-[10.5px] font-semibold text-[var(--text)] tracking-wider uppercase truncate">
|
||||
VCON ADMIN
|
||||
</span>
|
||||
</div>
|
||||
<button
|
||||
onClick={onClose}
|
||||
className="md:hidden text-[var(--text-dim)] hover:text-[var(--text)] p-1 cursor-pointer"
|
||||
aria-label="Close menu"
|
||||
>
|
||||
<Icon name="X" size={13} />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Navigation items */}
|
||||
<div className="flex-1 overflow-y-auto p-1.5 flex flex-col gap-2">
|
||||
{navigation.map((section, idx) => (
|
||||
<div key={idx} className="flex flex-col gap-0.5">
|
||||
<span className="text-[9px] font-semibold text-[var(--text-dim)] uppercase tracking-wider px-2 py-0.5">
|
||||
{section.group}
|
||||
</span>
|
||||
<div className="flex flex-col gap-0.5">
|
||||
{section.items.map((item) => {
|
||||
const isActive = pathname === item.href;
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
onClick={onClose}
|
||||
className={cn(
|
||||
'flex items-center justify-between px-2 py-1 text-[11px] transition-colors border',
|
||||
isActive
|
||||
? 'bg-[var(--accent-soft)] text-[var(--accent-hover)] font-medium border-[var(--accent)]'
|
||||
: 'border-transparent text-[var(--text-muted)] hover:text-[var(--text)] hover:bg-[var(--bg-hover)]'
|
||||
)}
|
||||
>
|
||||
<div className="flex items-center gap-2 min-w-0">
|
||||
<Icon
|
||||
name={item.icon}
|
||||
size={12}
|
||||
className={isActive ? 'text-[var(--accent)]' : 'text-[var(--text-dim)]'}
|
||||
/>
|
||||
<span className="truncate">{item.name}</span>
|
||||
</div>
|
||||
{item.badge && (
|
||||
<span className="text-[8px] px-1 py-0.2 bg-[var(--success-soft)] text-[var(--success)] font-mono border border-[var(--success)] shrink-0">
|
||||
{item.badge}
|
||||
</span>
|
||||
)}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
{/* Footer info */}
|
||||
<div className="p-2 border-t border-[var(--border)] bg-[var(--bg-main)] text-[9.5px] text-[var(--text-dim)] font-mono flex flex-col gap-1 shrink-0">
|
||||
<div className="flex items-center justify-between">
|
||||
<span>Buffer Worker</span>
|
||||
<span className="text-[var(--success)] flex items-center gap-1 font-semibold">
|
||||
<span className="w-1.5 h-1.5 bg-[var(--success)] inline-block" />
|
||||
Active
|
||||
</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<span>Storage Engine</span>
|
||||
<span className="text-[var(--text-muted)]">json2csv</span>
|
||||
</div>
|
||||
<div className="flex items-center justify-between">
|
||||
<span>Auth Handshake</span>
|
||||
<span className="text-[var(--text-muted)]">JWT</span>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
@@ -0,0 +1,15 @@
|
||||
# Layout Components Module Manifest
|
||||
|
||||
## Purpose
|
||||
Global layout shell, navigation, top bar, and admin sidebar complying with compact, zero-border-radius, zero-shadow design system.
|
||||
|
||||
## Components
|
||||
- **Navbar.tsx**: Top titlebar with brand, quick links, runtime port indicator (:4000/:3000), and dark/light theme switcher.
|
||||
- **Sidebar.tsx**: Dedicated `/vcon/` admin console sidebar with mobile drawer support, grouped telemetry & management links.
|
||||
- **Footer.tsx**: System runtime status line with storage convention display and port allocations.
|
||||
- **MainLayout.tsx**: Viewport-bounded responsive shell with mobile backdrop and scrolling main container.
|
||||
|
||||
## Dependencies
|
||||
- `components/ui`
|
||||
- `next/link`
|
||||
- `next/navigation`
|
||||
Reference in new issue
Block a user