feat: Implement new settings pages and refactor application layout and navigation with new components and hooks.

This commit is contained in:
syntaxbullet
2026-01-16 12:49:17 +01:00
parent 2f73f38877
commit 2a72beb0ef
33 changed files with 2584 additions and 1863 deletions

View File

@@ -1,25 +1,28 @@
import React from "react";
import { Link } from "react-router-dom";
import { Badge } from "../components/ui/badge";
import { Card, CardHeader, CardTitle, CardContent } from "../components/ui/card";
import { Card, CardHeader, CardTitle, CardContent, CardDescription, CardFooter } from "../components/ui/card";
import { Button } from "../components/ui/button";
import { Switch } from "../components/ui/switch";
import { Input } from "../components/ui/input";
import { Label } from "../components/ui/label";
import { Textarea } from "../components/ui/textarea";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../components/ui/select";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../components/ui/tabs";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../components/ui/tooltip";
import { FeatureCard } from "../components/feature-card";
import { InfoCard } from "../components/info-card";
import { SectionHeader } from "../components/section-header";
import { TestimonialCard } from "../components/testimonial-card";
import { StatCard } from "../components/stat-card";
import { LootdropCard } from "../components/lootdrop-card";
import { Activity, Coins, Flame, Trophy } from "lucide-react";
import { SettingsDrawer } from "../components/settings-drawer";
import { QuestForm } from "../components/quest-form";
import { RecentActivity } from "../components/recent-activity";
import { type RecentEvent } from "@shared/modules/dashboard/dashboard.types";
import { LeaderboardCard, type LeaderboardData } from "../components/leaderboard-card";
import { ActivityChart } from "../components/activity-chart";
import { type ActivityData } from "@shared/modules/dashboard/dashboard.types";
import { RecentActivity } from "../components/recent-activity";
import { QuestForm } from "../components/quest-form";
import { Activity, Coins, Flame, Trophy, Check, User, Mail, Shield, Bell } from "lucide-react";
import { type RecentEvent, type ActivityData } from "@shared/modules/dashboard/dashboard.types";
// Mock Data
const mockEvents: RecentEvent[] = [
{ type: 'success', message: 'User leveled up to 5', timestamp: new Date(Date.now() - 1000 * 60 * 5), icon: '⬆️' },
{ type: 'info', message: 'New user joined', timestamp: new Date(Date.now() - 1000 * 60 * 15), icon: '👋' },
@@ -37,474 +40,326 @@ const mockActivityData: ActivityData[] = Array.from({ length: 24 }).map((_, i) =
};
});
const mockManyEvents: RecentEvent[] = Array.from({ length: 15 }).map((_, i) => ({
type: i % 3 === 0 ? 'success' : i % 3 === 1 ? 'info' : 'error', // Use string literals matching the type definition
message: `Event #${i + 1} generated for testing scroll behavior`,
timestamp: new Date(Date.now() - 1000 * 60 * i * 10),
icon: i % 3 === 0 ? '✨' : i % 3 === 1 ? '' : '🚨',
}));
const mockLeaderboardData: LeaderboardData = {
topLevels: [
{ username: "StellarMage", level: 99 },
{ username: "MoonWalker", level: 85 },
{ username: "SunChaser", level: 72 },
{ username: "NebulaKnight", level: 68 },
{ username: "CometRider", level: 65 },
{ username: "VoidWalker", level: 60 },
{ username: "AstroBard", level: 55 },
{ username: "StarGazer", level: 50 },
{ username: "CosmicDruid", level: 45 },
{ username: "GalaxyGuard", level: 42 }
],
topWealth: [
{ username: "GoldHoarder", balance: "1000000" },
{ username: "MerchantKing", balance: "750000" },
{ username: "LuckyLooter", balance: "500000" },
{ username: "CryptoMiner", balance: "450000" },
{ username: "MarketMaker", balance: "300000" },
{ username: "TradeWind", balance: "250000" },
{ username: "CoinKeeper", balance: "150000" },
{ username: "GemHunter", balance: "100000" },
{ username: "DustCollector", balance: "50000" },
{ username: "BrokeBeginner", balance: "100" }
],
topNetWorth: [
{ username: "MerchantKing", netWorth: "1500000" },
{ username: "GoldHoarder", netWorth: "1250000" },
{ username: "LuckyLooter", netWorth: "850000" },
{ username: "MarketMaker", netWorth: "700000" },
{ username: "GemHunter", netWorth: "650000" },
{ username: "CryptoMiner", netWorth: "550000" },
{ username: "TradeWind", netWorth: "400000" },
{ username: "CoinKeeper", netWorth: "250000" },
{ username: "DustCollector", netWorth: "150000" },
{ username: "BrokeBeginner", netWorth: "5000" }
]
};
export function DesignSystem() {
return (
<div className="min-h-screen bg-aurora-page text-foreground font-outfit">
{/* Navigation */}
<nav className="fixed top-0 w-full z-50 glass-card border-b border-border/50 py-4 px-8 flex justify-between items-center">
<div className="flex items-center gap-2">
<div className="w-8 h-8 rounded-full bg-aurora sun-flare" />
<span className="text-xl font-bold tracking-tight text-primary">Aurora</span>
<div className="pt-8 px-8 max-w-7xl mx-auto space-y-8 text-center md:text-left pb-24">
{/* Header Section */}
<header className="space-y-4 animate-in fade-in">
<div className="flex flex-col md:flex-row items-center md:items-start justify-between gap-4">
<div className="space-y-2">
<Badge variant="aurora" className="mb-2">v2.0.0-solaris</Badge>
<h1 className="text-5xl md:text-6xl font-extrabold tracking-tight text-primary glow-text">
Aurora Design System
</h1>
<p className="text-xl text-muted-foreground max-w-2xl">
The Solaris design language. A cohesive collection of celestial components,
glassmorphic surfaces, and radiant interactions.
</p>
</div>
<div className="hidden md:block">
<div className="size-32 rounded-full bg-aurora opacity-20 blur-3xl animate-pulse" />
</div>
</div>
<div className="flex items-center gap-6">
<Link to="/" className="text-step--1 font-medium text-muted-foreground hover:text-primary transition-colors">
Home
</Link>
<Link to="/dashboard" className="text-step--1 font-medium text-muted-foreground hover:text-primary transition-colors">
Dashboard
</Link>
<Link to="/admin/quests" className="text-step--1 font-medium text-muted-foreground hover:text-primary transition-colors">
Admin
</Link>
</header>
<Tabs defaultValue="foundations" className="space-y-8 animate-in slide-up delay-100">
<div className="flex items-center justify-center md:justify-start">
<TabsList className="grid w-full max-w-md grid-cols-3">
<TabsTrigger value="foundations">Foundations</TabsTrigger>
<TabsTrigger value="components">Components</TabsTrigger>
<TabsTrigger value="patterns">Patterns</TabsTrigger>
</TabsList>
</div>
</nav>
<div className="pt-32 px-8 max-w-6xl mx-auto space-y-12 text-center md:text-left">
{/* Header Section */}
<header className="space-y-4 animate-in fade-in">
<Badge variant="aurora" className="mb-2">v1.2.0-solar</Badge>
<h1 className="text-6xl font-extrabold tracking-tight text-primary">
Aurora Design System
</h1>
<p className="text-xl text-muted-foreground max-w-2xl mx-auto md:mx-0">
Welcome to the Solaris Dark theme. A warm, celestial-inspired aesthetic designed for the Aurora astrology RPG.
</p>
</header>
{/* Color Palette */}
<section className="space-y-6 animate-in slide-up delay-100">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Color Palette
</h2>
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4">
<ColorSwatch label="Primary" color="bg-primary" text="text-primary-foreground" />
<ColorSwatch label="Secondary" color="bg-secondary" text="text-secondary-foreground" />
<ColorSwatch label="Background" color="bg-background" border />
<ColorSwatch label="Card" color="bg-card" border />
<ColorSwatch label="Accent" color="bg-accent" />
<ColorSwatch label="Muted" color="bg-muted" />
<ColorSwatch label="Destructive" color="bg-destructive" text="text-white" />
</div>
</section>
{/* Badges & Pills */}
<section className="space-y-6 animate-in slide-up delay-200">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Badges & Tags
</h2>
<div className="flex flex-wrap gap-4 items-center justify-center md:justify-start">
<Badge className="hover-scale cursor-default">Primary</Badge>
<Badge variant="secondary" className="hover-scale cursor-default">Secondary</Badge>
<Badge variant="aurora" className="hover-scale cursor-default">Solaris</Badge>
<Badge variant="glass" className="hover-scale cursor-default">Celestial Glass</Badge>
<Badge variant="outline" className="hover-scale cursor-default">Outline</Badge>
<Badge variant="destructive" className="hover-scale cursor-default">Destructive</Badge>
</div>
</section>
{/* Animations & Interactions */}
<section className="space-y-6 animate-in slide-up delay-300">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Animations & Interactions
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<div className="glass-card p-6 rounded-xl hover-lift cursor-pointer space-y-2">
<h3 className="font-bold text-primary">Hover Lift</h3>
<p className="text-sm text-muted-foreground">Smooth upward translation with enhanced depth.</p>
{/* FOUNDATIONS TAB */}
<TabsContent value="foundations" className="space-y-12">
{/* Color Palette */}
<section className="space-y-6">
<div className="flex items-center gap-4">
<div className="h-px bg-border flex-1" />
<h2 className="text-2xl font-bold text-foreground">Color Palette</h2>
<div className="h-px bg-border flex-1" />
</div>
<div className="glass-card p-6 rounded-xl hover-glow cursor-pointer space-y-2">
<h3 className="font-bold text-primary">Hover Glow</h3>
<p className="text-sm text-muted-foreground">Subtle border and shadow illumination on hover.</p>
<div className="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-4">
<ColorSwatch label="Primary" color="bg-primary" text="text-primary-foreground" />
<ColorSwatch label="Secondary" color="bg-secondary" text="text-secondary-foreground" />
<ColorSwatch label="Background" color="bg-background" border />
<ColorSwatch label="Card" color="bg-card" border />
<ColorSwatch label="Accent" color="bg-accent" />
<ColorSwatch label="Muted" color="bg-muted" />
<ColorSwatch label="Destructive" color="bg-destructive" text="text-white" />
</div>
<div className="flex items-center justify-center p-6">
<Button className="bg-primary text-primary-foreground active-press font-bold px-8 py-6 rounded-xl shadow-lg">
Press Interaction
</Button>
</div>
</div>
</section>
</section>
{/* Gradients & Special Effects */}
<section className="space-y-6 animate-in slide-up delay-400">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Gradients & Effects
</h2>
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 text-center">
<div className="space-y-4">
<h3 className="text-xl font-medium text-muted-foreground">The Solaris Gradient (Background)</h3>
<div className="h-32 w-full rounded-xl bg-aurora-page sun-flare flex items-center justify-center border border-border hover-glow transition-all">
<span className="text-primary font-bold text-2xl">Celestial Void</span>
{/* Gradients & Special Effects */}
<section className="space-y-6">
<div className="flex items-center gap-4">
<div className="h-px bg-border flex-1" />
<h2 className="text-2xl font-bold text-foreground">Gradients & Effects</h2>
<div className="h-px bg-border flex-1" />
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-8 text-center">
<div className="space-y-4">
<h3 className="text-xl font-medium text-muted-foreground">The Solaris Gradient</h3>
<div className="h-32 w-full rounded-xl bg-aurora-page sun-flare flex items-center justify-center border border-border hover-glow transition-all">
<span className="text-primary font-bold text-2xl">Celestial Void</span>
</div>
</div>
</div>
<div className="space-y-4">
<h3 className="text-xl font-medium text-muted-foreground">Glassmorphism</h3>
<div className="h-32 w-full rounded-xl glass-card flex items-center justify-center p-6 bg-[url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?auto=format&fit=crop&q=80&w=2342')] bg-cover bg-center overflow-hidden">
<div className="glass-card p-4 rounded-lg text-center w-full hover-lift transition-all backdrop-blur-md">
<span className="font-bold">Frosted Celestial Glass</span>
<div className="space-y-4">
<h3 className="text-xl font-medium text-muted-foreground">Glassmorphism</h3>
<div className="h-32 w-full rounded-xl glass-card flex items-center justify-center p-6 bg-[url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?auto=format&fit=crop&q=80&w=2342')] bg-cover bg-center overflow-hidden">
<div className="glass-card p-4 rounded-lg text-center w-full hover-lift transition-all backdrop-blur-md">
<span className="font-bold">Frosted Celestial Glass</span>
</div>
</div>
</div>
</div>
</div>
</section>
</section>
{/* Components Showcase */}
<section className="space-y-6 animate-in slide-up delay-500">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Component Showcase
</h2>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
{/* Action Card with Tags */}
<Card className="glass-card sun-flare overflow-hidden border-none text-left hover-lift transition-all">
<div className="h-2 bg-primary w-full" />
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-primary">Celestial Action</CardTitle>
<Badge variant="aurora" className="h-5">New</Badge>
</CardHeader>
<CardContent className="space-y-4">
<div className="flex gap-2">
<Badge variant="glass" className="text-[10px] uppercase">Quest</Badge>
<Badge variant="glass" className="text-[10px] uppercase">Level 15</Badge>
</div>
<p className="text-muted-foreground text-sm">
Experience the warmth of the sun in every interaction and claim your rewards.
</p>
<div className="flex gap-2 pt-2">
<Button className="bg-primary text-primary-foreground active-press font-bold px-6">
Ascend
</Button>
</div>
</CardContent>
</Card>
{/* Profile/Entity Card with Tags */}
<Card className="glass-card text-left hover-lift transition-all">
<CardHeader className="pb-2">
<div className="flex justify-between items-start">
<div className="w-12 h-12 rounded-full bg-aurora border-2 border-primary/20 hover-scale transition-transform cursor-pointer" />
<Badge variant="secondary" className="bg-green-500/10 text-green-500 border-green-500/20">Online</Badge>
</div>
<CardTitle className="mt-4">Stellar Navigator</CardTitle>
<p className="text-xs text-muted-foreground uppercase tracking-wider">Level 42 Mage</p>
</CardHeader>
<CardContent className="space-y-4">
<div className="flex flex-wrap gap-2">
<Badge variant="outline" className="text-[10px] py-0 hover-scale cursor-default">Astronomy</Badge>
<Badge variant="outline" className="text-[10px] py-0 hover-scale cursor-default">Pyromancy</Badge>
<Badge variant="outline" className="text-[10px] py-0 hover-scale cursor-default">Leadership</Badge>
</div>
<div className="h-1.5 w-full bg-secondary/20 rounded-full overflow-hidden">
<div className="h-full bg-aurora w-[75%] animate-in slide-up delay-500" />
</div>
</CardContent>
</Card>
{/* Interactive Card with Tags */}
<Card className="glass-card text-left hover-glow transition-all">
<CardHeader>
<div className="flex items-center gap-2 mb-2">
<Badge variant="glass" className="bg-primary/10 text-primary border-primary/20">Beta</Badge>
</div>
<div className="flex justify-between items-center">
<CardTitle>System Settings</CardTitle>
<SettingsDrawer />
</div>
</CardHeader>
<CardContent className="space-y-6">
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<div className="font-medium">Starry Background</div>
<div className="text-sm text-muted-foreground">Enable animated SVG stars</div>
</div>
<Switch defaultChecked />
</div>
<div className="flex items-center justify-between">
<div className="space-y-0.5">
<div className="font-medium flex items-center gap-2">
Solar Flare Glow
<Badge className="bg-amber-500/10 text-amber-500 border-amber-500/20 text-[9px] h-4">Pro</Badge>
</div>
<div className="text-sm text-muted-foreground">Add bloom to primary elements</div>
</div>
<Switch defaultChecked />
</div>
</CardContent>
</Card>
</div>
</section>
{/* Refactored Application Components */}
<section className="space-y-6 animate-in slide-up delay-600">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Application Components
</h2>
<div className="space-y-12">
{/* Section Header Demo */}
<div className="border border-border/50 rounded-xl p-8 bg-background/50">
<SectionHeader
badge="Components"
title="Section Headers"
description="Standardized header component for defining page sections with badge, title, and description."
/>
{/* Typography */}
<section className="space-y-8">
<div className="flex items-center gap-4">
<div className="h-px bg-border flex-1" />
<h2 className="text-2xl font-bold text-foreground">Typography</h2>
<div className="h-px bg-border flex-1" />
</div>
<div className="space-y-2 border border-border/50 rounded-xl p-8 bg-card/50">
<TypographyRow step="-2" className="text-step--2" label="Step -2 (Small Print)" />
<TypographyRow step="-1" className="text-step--1" label="Step -1 (Small)" />
<TypographyRow step="0" className="text-step-0" label="Step 0 (Base / Body)" />
<TypographyRow step="1" className="text-step-1" label="Step 1 (H4 / Subhead)" />
<TypographyRow step="2" className="text-step-2" label="Step 2 (H3 / Section)" />
<TypographyRow step="3" className="text-step-3 text-primary" label="Step 3 (H2 / Header)" />
<TypographyRow step="4" className="text-step-4 text-primary" label="Step 4 (H1 / Title)" />
<TypographyRow step="5" className="text-step-5 text-primary font-black" label="Step 5 (Display)" />
</div>
</section>
</TabsContent>
{/* Feature Cards Demo */}
{/* COMPONENTS TAB */}
<TabsContent value="components" className="space-y-12">
{/* Buttons & Badges */}
<section className="space-y-6">
<SectionTitle title="Buttons & Badges" />
<Card className="p-8">
<div className="space-y-8">
<div className="space-y-4">
<Label>Buttons</Label>
<div className="flex flex-wrap gap-4">
<Button variant="default">Default</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="destructive">Destructive</Button>
<Button variant="link">Link</Button>
<Button variant="aurora">Aurora</Button>
<Button variant="glass">Glass</Button>
</div>
</div>
<div className="space-y-4">
<Label>Badges</Label>
<div className="flex flex-wrap gap-4">
<Badge>Primary</Badge>
<Badge variant="secondary">Secondary</Badge>
<Badge variant="outline">Outline</Badge>
<Badge variant="destructive">Destructive</Badge>
<Badge variant="aurora">Aurora</Badge>
<Badge variant="glass">Glass</Badge>
</div>
</div>
</div>
</Card>
</section>
{/* Form Controls */}
<section className="space-y-6">
<SectionTitle title="Form Controls" />
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<FeatureCard
title="Feature Card"
category="UI Element"
description="A versatile card component for the bento grid layout."
icon={<div className="w-20 h-20 bg-primary/20 rounded-full animate-pulse" />}
/>
<FeatureCard
title="Interactive Feature"
category="Interactive"
description="Supports custom children nodes for complex content."
>
<div className="mt-2 p-3 bg-secondary/10 border border-secondary/20 rounded text-center text-secondary text-sm font-bold">
Custom Child Content
<Card className="p-6 space-y-6">
<div className="space-y-2">
<Label htmlFor="email">Email Address</Label>
<Input id="email" placeholder="enter@email.com" type="email" />
</div>
</FeatureCard>
<div className="space-y-2">
<Label htmlFor="bio">Bio</Label>
<Textarea id="bio" placeholder="Tell us about yourself..." />
</div>
<div className="flex items-center justify-between">
<Label htmlFor="notifications">Enable Notifications</Label>
<Switch id="notifications" />
</div>
</Card>
<Card className="p-6 space-y-6">
<div className="space-y-2">
<Label>Role Selection</Label>
<Select>
<SelectTrigger>
<SelectValue placeholder="Select a role" />
</SelectTrigger>
<SelectContent>
<SelectItem value="admin">Administrator</SelectItem>
<SelectItem value="mod">Moderator</SelectItem>
<SelectItem value="user">User</SelectItem>
</SelectContent>
</Select>
</div>
<div className="space-y-2">
<Label>Tooltip Demo</Label>
<div className="p-4 border border-dashed rounded-lg flex items-center justify-center">
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="outline">Hover Me</Button>
</TooltipTrigger>
<TooltipContent>
<p>This is a glowing tooltip!</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
</div>
</Card>
</div>
</section>
{/* Info Cards Demo */}
{/* Cards & Containers */}
<section className="space-y-6">
<SectionTitle title="Cards & Containers" />
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<InfoCard
icon={<div className="w-6 h-6 rounded-full bg-primary animate-ping" />}
title="Info Card"
description="Compact card for highlighting features or perks with an icon."
iconWrapperClassName="bg-primary/20 text-primary"
/>
</div>
<Card className="hover-lift">
<CardHeader>
<CardTitle>Standard Card</CardTitle>
<CardDescription>Default glassmorphic style</CardDescription>
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground">The default card component comes with built-in separation and padding.</p>
</CardContent>
<CardFooter>
<Button size="sm" variant="secondary" className="w-full">Action</Button>
</CardFooter>
</Card>
{/* Stat Cards Demo */}
<Card className="bg-aurora/10 border-primary/20 hover-glow">
<CardHeader>
<CardTitle className="text-primary">Highlighted Card</CardTitle>
<CardDescription>Active or featured state</CardDescription>
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground">Use this variation to draw attention to specific content blocks.</p>
</CardContent>
</Card>
<Card className="border-dashed shadow-none bg-transparent">
<CardHeader>
<CardTitle>Ghost/Dashed Card</CardTitle>
<CardDescription>Placeholder or empty state</CardDescription>
</CardHeader>
<CardContent className="flex items-center justify-center py-8">
<div className="bg-muted p-4 rounded-full">
<Activity className="size-6 text-muted-foreground" />
</div>
</CardContent>
</Card>
</div>
</section>
</TabsContent>
{/* PATTERNS TAB */}
<TabsContent value="patterns" className="space-y-12">
{/* Dashboard Widgets */}
<section className="space-y-6">
<SectionTitle title="Dashboard Widgets" />
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<StatCard
title="Standard Stat"
value="1,234"
subtitle="Active users"
title="Total XP"
value="1,240,500"
subtitle="+12% from last week"
icon={Trophy}
isLoading={false}
iconClassName="text-yellow-500"
/>
<StatCard
title="Active Users"
value="3,405"
subtitle="Currently online"
icon={User}
isLoading={false}
iconClassName="text-blue-500"
/>
<StatCard
title="System Load"
value="42%"
subtitle="Optimal performance"
icon={Activity}
isLoading={false}
iconClassName="text-green-500"
/>
<StatCard
title="Colored Stat"
value="9,999 AU"
subtitle="Total Wealth"
icon={Coins}
</div>
</section>
{/* Complex Lists */}
<section className="space-y-6">
<SectionTitle title="Complex Lists & Charts" />
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<RecentActivity
events={mockEvents}
isLoading={false}
valueClassName="text-primary"
iconClassName="text-primary"
className="h-[400px]"
/>
<StatCard
title="Loading State"
value={null}
icon={Flame}
isLoading={true}
<LeaderboardCard
data={mockLeaderboardData}
isLoading={false}
className="h-[400px]"
/>
</div>
</div>
</section>
{/* Data Visualization Demo */}
<div className="space-y-4">
<h3 className="text-xl font-semibold text-muted-foreground">Data Visualization</h3>
<div className="grid grid-cols-1 gap-6">
<ActivityChart
data={mockActivityData}
/>
<ActivityChart
// Empty charts (loading state)
/>
</div>
</div>
{/* Application Patterns */}
<section className="space-y-6">
<SectionTitle title="Application Forms" />
<div className="max-w-xl mx-auto">
<QuestForm />
</div>
</section>
</TabsContent>
</Tabs>
</div>
);
}
{/* Game Event Cards Demo */}
<div className="space-y-4">
<h3 className="text-xl font-semibold text-muted-foreground">Game Event Cards</h3>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<LootdropCard
isLoading={true}
/>
<LootdropCard
drop={null}
state={{
monitoredChannels: 3,
hottestChannel: {
id: "123",
messages: 42,
progress: 42,
cooldown: false
},
config: { requiredMessages: 100, dropChance: 0.1 }
}}
isLoading={false}
/>
<LootdropCard
drop={null}
state={{
monitoredChannels: 3,
hottestChannel: {
id: "123",
messages: 100,
progress: 100,
cooldown: true
},
config: { requiredMessages: 100, dropChance: 0.1 }
}}
isLoading={false}
/>
<LootdropCard
drop={{
rewardAmount: 500,
currency: "AU",
createdAt: new Date().toISOString(),
expiresAt: new Date(Date.now() + 60000).toISOString()
}}
isLoading={false}
/>
</div>
</div>
{/* Leaderboard Demo */}
<div className="space-y-4">
<h3 className="text-xl font-semibold text-muted-foreground">Leaderboard Cards</h3>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<LeaderboardCard
isLoading={true}
/>
<LeaderboardCard
data={mockLeaderboardData}
isLoading={false}
/>
</div>
</div>
{/* Testimonial Cards Demo */}
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<TestimonialCard
quote="The testimonial card is perfect for social proof sections."
author="Jane Doe"
role="Beta Tester"
avatarGradient="bg-gradient-to-br from-pink-500 to-rose-500"
/>
</div>
{/* Recent Activity Demo */}
<div className="space-y-4">
<h3 className="text-xl font-semibold text-muted-foreground">Recent Activity Feed</h3>
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-6 h-[500px]">
<RecentActivity
events={[]}
isLoading={true}
className="h-full"
/>
<RecentActivity
events={[]}
isLoading={false}
className="h-full"
/>
<RecentActivity
events={mockEvents}
isLoading={false}
className="h-full"
/>
<RecentActivity
events={mockManyEvents}
isLoading={false}
className="h-full"
/>
</div>
</div>
</div>
</section>
{/* Administrative Tools Showcase */}
<section className="space-y-6 animate-in slide-up delay-700">
<h2 className="text-3xl font-bold flex items-center justify-center md:justify-start gap-2">
<span className="w-8 h-8 rounded-full bg-primary inline-block" />
Administrative Tools
</h2>
<div className="grid grid-cols-1 gap-6 text-left">
<QuestForm />
</div>
</section>
{/* Typography */}
<section className="space-y-8 pb-12">
<h2 className="text-step-3 font-bold text-center">Fluid Typography</h2>
<div className="space-y-6">
<TypographyRow step="-2" className="text-step--2" label="Step -2 (Small Print)" />
<TypographyRow step="-1" className="text-step--1" label="Step -1 (Small)" />
<TypographyRow step="0" className="text-step-0" label="Step 0 (Base / Body)" />
<TypographyRow step="1" className="text-step-1" label="Step 1 (H4 / Subhead)" />
<TypographyRow step="2" className="text-step-2" label="Step 2 (H3 / Section)" />
<TypographyRow step="3" className="text-step-3 text-primary" label="Step 3 (H2 / Header)" />
<TypographyRow step="4" className="text-step-4 text-primary" label="Step 4 (H1 / Title)" />
<TypographyRow step="5" className="text-step-5 text-primary font-black" label="Step 5 (Display)" />
</div>
<p className="text-step--1 text-muted-foreground text-center italic">
Try resizing your browser window to see the text scale smoothly.
</p>
</section>
</div>
function SectionTitle({ title }: { title: string }) {
return (
<div className="flex items-center gap-4 py-4">
<div className="h-0.5 bg-gradient-to-r from-transparent via-primary/50 to-transparent flex-1" />
<h2 className="text-xl font-bold text-foreground/80 uppercase tracking-widest">{title}</h2>
<div className="h-0.5 bg-gradient-to-r from-transparent via-primary/50 to-transparent flex-1" />
</div>
);
}
function TypographyRow({ step, className, label }: { step: string, className: string, label: string }) {
return (
<div className="flex flex-col md:flex-row md:items-baseline gap-4 border-b border-border/50 pb-4">
<span className="text-step--2 font-mono text-muted-foreground w-20">Step {step}</span>
<div className="flex flex-col md:flex-row md:items-baseline gap-4 border-b border-border/50 pb-4 last:border-0 last:pb-0">
<span className="text-xs font-mono text-muted-foreground w-24 shrink-0">var(--step-{step})</span>
<p className={`${className} font-medium truncate`}>{label}</p>
</div>
);
@@ -512,9 +367,13 @@ function TypographyRow({ step, className, label }: { step: string, className: st
function ColorSwatch({ label, color, text = "text-foreground", border = false }: { label: string, color: string, text?: string, border?: boolean }) {
return (
<div className="space-y-2">
<div className={`h-20 w-full rounded-lg ${color} ${border ? 'border border-border' : ''} flex items-end p-2 shadow-lg`}>
<span className={`text-xs font-bold uppercase tracking-widest ${text}`}>{label}</span>
<div className="group space-y-2 cursor-pointer">
<div className={`h-24 w-full rounded-xl ${color} ${border ? 'border border-border' : ''} flex items-end p-3 shadow-lg group-hover:scale-105 transition-transform duration-300 relative overflow-hidden`}>
<div className="absolute inset-0 bg-gradient-to-b from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity" />
<span className={`text-xs font-bold uppercase tracking-widest ${text} relative z-10`}>{label}</span>
</div>
<div className="flex justify-between text-xs text-muted-foreground px-1">
<span>{color.replace('bg-', '')}</span>
</div>
</div>
);