shadcn-vue/apps/www/registry/default/block/Dashboard02.vue
2024-11-21 11:52:31 +08:00

223 lines
8.7 KiB
Vue

<script lang="ts">
export const description = 'A products dashboard with a sidebar navigation and a main content area. The dashboard has a header with a search input and a user menu. The sidebar has a logo, navigation links, and a card with a call to action. The main content area shows an empty state with a call to action.'
export const iframeHeight = '800px'
export const containerClass = 'w-full h-full'
</script>
<script setup lang="ts">
import { Badge } from '@/lib/registry/default/ui/badge'
import { Button } from '@/lib/registry/default/ui/button'
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/lib/registry/default/ui/card'
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from '@/lib/registry/default/ui/dropdown-menu'
import { Input } from '@/lib/registry/default/ui/input'
import { Sheet, SheetContent, SheetTrigger } from '@/lib/registry/default/ui/sheet'
import { Bell, CircleUser, Home, LineChart, Menu, Package, Package2, Search, ShoppingCart, Users } from 'lucide-vue-next'
</script>
<template>
<div class="grid min-h-screen w-full md:grid-cols-[220px_1fr] lg:grid-cols-[280px_1fr]">
<div class="hidden border-r bg-muted/40 md:block">
<div class="flex h-full max-h-screen flex-col gap-2">
<div class="flex h-14 items-center border-b px-4 lg:h-[60px] lg:px-6">
<a href="/" class="flex items-center gap-2 font-semibold">
<Package2 class="h-6 w-6" />
<span class="">Acme Inc</span>
</a>
<Button variant="outline" size="icon" class="ml-auto h-8 w-8">
<Bell class="h-4 w-4" />
<span class="sr-only">Toggle notifications</span>
</Button>
</div>
<div class="flex-1">
<nav class="grid items-start px-2 text-sm font-medium lg:px-4">
<a
href="/"
class="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Home class="h-4 w-4" />
Dashboard
</a>
<a
href="#"
class="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<ShoppingCart class="h-4 w-4" />
Orders
<Badge class="ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded-full">
6
</Badge>
</a>
<a
href="#"
class="flex items-center gap-3 rounded-lg bg-muted px-3 py-2 text-primary transition-all hover:text-primary"
>
<Package class="h-4 w-4" />
Products
</a>
<a
href="#"
class="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<Users class="h-4 w-4" />
Customers
</a>
<a
href="#"
class="flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary"
>
<LineChart class="h-4 w-4" />
Analytics
</a>
</nav>
</div>
<div class="mt-auto p-4">
<Card>
<CardHeader class="p-2 pt-0 md:p-4">
<CardTitle>Upgrade to Pro</CardTitle>
<CardDescription>
Unlock all features and get unlimited access to our support
team.
</CardDescription>
</CardHeader>
<CardContent class="p-2 pt-0 md:p-4 md:pt-0">
<Button size="sm" class="w-full">
Upgrade
</Button>
</CardContent>
</Card>
</div>
</div>
</div>
<div class="flex flex-col">
<header class="flex h-14 items-center gap-4 border-b bg-muted/40 px-4 lg:h-[60px] lg:px-6">
<Sheet>
<SheetTrigger as-child>
<Button
variant="outline"
size="icon"
class="shrink-0 md:hidden"
>
<Menu class="h-5 w-5" />
<span class="sr-only">Toggle navigation menu</span>
</Button>
</SheetTrigger>
<SheetContent side="left" class="flex flex-col">
<nav class="grid gap-2 text-lg font-medium">
<a
href="#"
class="flex items-center gap-2 text-lg font-semibold"
>
<Package2 class="h-6 w-6" />
<span class="sr-only">Acme Inc</span>
</a>
<a
href="#"
class="mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 text-muted-foreground hover:text-foreground"
>
<Home class="h-5 w-5" />
Dashboard
</a>
<a
href="#"
class="mx-[-0.65rem] flex items-center gap-4 rounded-xl bg-muted px-3 py-2 text-foreground hover:text-foreground"
>
<ShoppingCart class="h-5 w-5" />
Orders
<Badge class="ml-auto flex h-6 w-6 shrink-0 items-center justify-center rounded-full">
6
</Badge>
</a>
<a
href="#"
class="mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 text-muted-foreground hover:text-foreground"
>
<Package class="h-5 w-5" />
Products
</a>
<a
href="#"
class="mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 text-muted-foreground hover:text-foreground"
>
<Users class="h-5 w-5" />
Customers
</a>
<a
href="#"
class="mx-[-0.65rem] flex items-center gap-4 rounded-xl px-3 py-2 text-muted-foreground hover:text-foreground"
>
<LineChart class="h-5 w-5" />
Analytics
</a>
</nav>
<div class="mt-auto">
<Card>
<CardHeader>
<CardTitle>Upgrade to Pro</CardTitle>
<CardDescription>
Unlock all features and get unlimited access to our
support team.
</CardDescription>
</CardHeader>
<CardContent>
<Button size="sm" class="w-full">
Upgrade
</Button>
</CardContent>
</Card>
</div>
</SheetContent>
</Sheet>
<div class="w-full flex-1">
<form>
<div class="relative">
<Search class="absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" />
<Input
type="search"
placeholder="Search products..."
class="w-full appearance-none bg-background pl-8 shadow-none md:w-2/3 lg:w-1/3"
/>
</div>
</form>
</div>
<DropdownMenu>
<DropdownMenuTrigger as-child>
<Button variant="secondary" size="icon" class="rounded-full">
<CircleUser class="h-5 w-5" />
<span class="sr-only">Toggle user menu</span>
</Button>
</DropdownMenuTrigger>
<DropdownMenuContent align="end">
<DropdownMenuLabel>My Account</DropdownMenuLabel>
<DropdownMenuSeparator />
<DropdownMenuItem>Settings</DropdownMenuItem>
<DropdownMenuItem>Support</DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem>Logout</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</header>
<main class="flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6">
<div class="flex items-center">
<h1 class="text-lg font-semibold md:text-2xl">
Inventory
</h1>
</div>
<div class="flex flex-1 items-center justify-center rounded-lg border border-dashed shadow-sm">
<div class="flex flex-col items-center gap-1 text-center">
<h3 class="text-2xl font-bold tracking-tight">
You have no products
</h3>
<p class="text-sm text-muted-foreground">
You can start selling as soon as you add a product.
</p>
<Button class="mt-4">
Add Product
</Button>
</div>
</div>
</main>
</div>
</div>
</template>