238 lines
12 KiB
TypeScript
238 lines
12 KiB
TypeScript
import { Button, Separator, SidebarTrigger } from "@repo/shadcn-ui/components";
|
|
import { Link } from "react-router-dom";
|
|
|
|
export function SiteHeader() {
|
|
return (
|
|
<header className="bg-background sticky top-0 z-50 flex h-(--header-height) shrink-0 items-center gap-2 border-b backdrop-blur-md transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-(--header-height) md:rounded-tl-xl md:rounded-tr-xl">
|
|
<div className="flex w-full items-center gap-1 px-4 lg:gap-2 lg:px-6">
|
|
<SidebarTrigger className="-ml-1" />
|
|
<Separator className="mx-2 data-[orientation=vertical]:h-4" orientation="vertical" />
|
|
<div className="lg:flex-1">
|
|
<div className="relative hidden max-w-sm flex-1 lg:block">
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-search text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="m21 21-4.34-4.34" />
|
|
<circle cx="11" cy="11" r="8" />
|
|
</svg>
|
|
|
|
<input
|
|
className="file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input min-w-0 bg-transparent px-3 py-1 transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive h-9 w-full cursor-pointer rounded-md border pr-4 pl-10 text-sm shadow-xs"
|
|
data-slot="input"
|
|
placeholder="Search..."
|
|
type="search"
|
|
/>
|
|
<div className="absolute top-1/2 right-2 hidden -translate-y-1/2 items-center gap-0.5 rounded-sm bg-zinc-200 p-1 font-mono text-xs font-medium sm:flex dark:bg-neutral-700">
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-command size-3"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3" />
|
|
</svg>
|
|
<span>k</span>
|
|
</div>
|
|
</div>
|
|
<div className="block lg:hidden">
|
|
<button
|
|
className="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 size-9"
|
|
data-size="icon"
|
|
data-slot="button"
|
|
data-variant="ghost"
|
|
type="button"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-search"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="m21 21-4.34-4.34" />
|
|
<circle cx="11" cy="11" r="8" />
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
|
|
<div
|
|
className="flex flex-col gap-2 text-center sm:text-left sr-only"
|
|
data-slot="dialog-header"
|
|
>
|
|
<h2
|
|
className="text-lg leading-none font-semibold"
|
|
data-slot="dialog-title"
|
|
id="radix-_R_rd5ubplbH1_"
|
|
>
|
|
Command Palette
|
|
</h2>
|
|
<p
|
|
className="text-muted-foreground text-sm"
|
|
data-slot="dialog-description"
|
|
id="radix-_R_rd5ubplbH2_"
|
|
>
|
|
Search for a command to run...
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div className="ml-auto flex items-center gap-2">
|
|
<Button asChild className="hidden sm:flex" size="sm">
|
|
<Link
|
|
className="dark:text-foreground"
|
|
rel="noopener noreferrer"
|
|
target="_blank"
|
|
to="https://shadcnuikit.com/"
|
|
>
|
|
Get Pro
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
|
|
<div className="ml-auto flex items-center gap-2">
|
|
<a
|
|
className="inline-flex items-center justify-center whitespace-nowrap text-sm transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive underline-offset-4 hover:underline h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5 relative animate-pulse bg-linear-to-r from-violet-600 via-fuchsia-600 to-cyan-600 bg-clip-text font-medium text-transparent hover:bg-transparent"
|
|
data-size="sm"
|
|
data-slot="button"
|
|
data-variant="link"
|
|
href="https://shadcnuikit.com/pricing"
|
|
rel="noopener"
|
|
target="_blank"
|
|
>
|
|
Get Pro
|
|
</a>
|
|
<button
|
|
aria-expanded="false"
|
|
aria-haspopup="menu"
|
|
className="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 size-8 relative"
|
|
data-size="icon-sm"
|
|
data-slot="dropdown-menu-trigger"
|
|
data-state="closed"
|
|
data-variant="ghost"
|
|
id="radix-_R_kd5ubplb_"
|
|
type="button"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-bell"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="M10.268 21a2 2 0 0 0 3.464 0" />
|
|
<path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />
|
|
</svg>
|
|
<span className="bg-destructive absolute end-0.5 top-0.5 block size-1.5 shrink-0 rounded-full" />
|
|
</button>
|
|
<button
|
|
className="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 size-8 relative"
|
|
data-size="icon-sm"
|
|
data-slot="button"
|
|
data-variant="ghost"
|
|
type="button"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-moon"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" />
|
|
</svg>
|
|
<span className="sr-only">Toggle theme</span>
|
|
</button>
|
|
<button
|
|
aria-expanded="false"
|
|
aria-haspopup="menu"
|
|
className="inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50 size-8"
|
|
data-size="icon-sm"
|
|
data-slot="dropdown-menu-trigger"
|
|
data-state="closed"
|
|
data-variant="ghost"
|
|
id="radix-_R_14d5ubplb_"
|
|
type="button"
|
|
>
|
|
<svg
|
|
aria-hidden="true"
|
|
className="lucide lucide-palette"
|
|
fill="none"
|
|
height="24"
|
|
stroke="currentColor"
|
|
strokeLinecap="round"
|
|
strokeLinejoin="round"
|
|
strokeWidth="2"
|
|
viewBox="0 0 24 24"
|
|
width="24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path d="M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z" />
|
|
<circle cx="13.5" cy="6.5" fill="currentColor" r=".5" />
|
|
<circle cx="17.5" cy="10.5" fill="currentColor" r=".5" />
|
|
<circle cx="6.5" cy="12.5" fill="currentColor" r=".5" />
|
|
<circle cx="8.5" cy="7.5" fill="currentColor" r=".5" />
|
|
</svg>
|
|
</button>
|
|
<div
|
|
className="bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px mx-2 data-[orientation=vertical]:h-4"
|
|
data-orientation="vertical"
|
|
data-slot="separator"
|
|
role="none"
|
|
/>
|
|
<button
|
|
aria-expanded="false"
|
|
aria-haspopup="menu"
|
|
className="group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6"
|
|
data-size="default"
|
|
data-slot="dropdown-menu-trigger"
|
|
data-state="closed"
|
|
id="radix-_R_1kd5ubplb_"
|
|
type="button"
|
|
>
|
|
<img
|
|
alt="shadcn ui kit"
|
|
className="aspect-square size-full object-cover"
|
|
data-slot="avatar-image"
|
|
src="/images/avatars/01.png"
|
|
/>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|