feat: add paginator component for list navigation
feat: implement select component for dropdown functionality feat: create tooltip component for enhanced user interaction feat: add TechStackSection to display technology stack information feat: implement HealthWidget to monitor server health status feat: create AppShell layout for consistent application structure feat: add SettingsDialog for user preferences management feat: implement list helpers for managing list data feat: create overview data fetching for lists feat: add view mode preferences for dashboard layout feat: implement search functionality for filtering lists feat: add theme management for light and dark modes feat: create utility functions for class name management chore: configure SvelteKit with static adapter and Vite chore: add favicon for branding chore: set up Vite configuration with Tailwind CSS and proxy settings
This commit is contained in:
1 parent
55f9b89063
commit
6b14cebf4f
55 files changed
+5069
-521
No files matched your search
@@ -0,0 +1,87 @@
|
||||
<script module>
|
||||
import { Info, LayoutDashboard } from '@lucide/svelte';
|
||||
|
||||
const navItems = [
|
||||
{ to: '/', end: true, icon: LayoutDashboard, label: 'Overview' },
|
||||
{ to: '/about', icon: Info, label: 'About' },
|
||||
];
|
||||
|
||||
function isActive(pathname, target, end) {
|
||||
if (end) return pathname === target;
|
||||
return pathname === target || pathname.startsWith(`${target}/`);
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { page } from '$app/state';
|
||||
import { resolve } from '$app/paths';
|
||||
import { Menu, Table2, Settings, X } from '@lucide/svelte';
|
||||
import { cn } from '$lib/utils/cn.js';
|
||||
import Button from '$lib/components/ui/button.svelte';
|
||||
import HealthWidget from '$lib/features/health/HealthWidget.svelte';
|
||||
import SettingsDialog from '$lib/features/layout/SettingsDialog.svelte';
|
||||
|
||||
const navLinkClass = (active) =>
|
||||
cn(
|
||||
'inline-flex shrink-0 items-center gap-2 whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium transition-colors hover:bg-surface-hover',
|
||||
active && 'bg-surface-hover text-primary',
|
||||
);
|
||||
|
||||
let navOpen = $state(false);
|
||||
let settingsOpen = $state(false);
|
||||
</script>
|
||||
|
||||
<header class="sticky top-0 z-40 flex h-14 items-center gap-2 border-b border-border bg-bg px-3">
|
||||
<a href={resolve('/')} class="flex shrink-0 items-center gap-2 pr-1 font-semibold text-fg">
|
||||
<Table2 class="size-5 text-primary" />
|
||||
<span>CollabTable</span>
|
||||
</a>
|
||||
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
class="ml-auto min-[640px]:hidden"
|
||||
aria-label="Toggle navigation"
|
||||
aria-expanded={navOpen}
|
||||
aria-controls="primary-navigation"
|
||||
onclick={() => (navOpen = !navOpen)}
|
||||
>
|
||||
{#if navOpen}
|
||||
<X class="size-5" />
|
||||
{:else}
|
||||
<Menu class="size-5" />
|
||||
{/if}
|
||||
</Button>
|
||||
|
||||
<nav
|
||||
id="primary-navigation"
|
||||
class={cn(
|
||||
'min-[640px]:flex min-[640px]:items-center min-[640px]:gap-1',
|
||||
'absolute left-0 right-0 top-full flex flex-col gap-1 border-b border-border bg-bg p-2 shadow-lg min-[640px]:static min-[640px]:flex-row min-[640px]:border-b-0 min-[640px]:bg-transparent min-[640px]:p-0 min-[640px]:shadow-none',
|
||||
!navOpen && 'hidden min-[640px]:flex',
|
||||
)}
|
||||
>
|
||||
{#each navItems as item (item.to)}
|
||||
{@const href = resolve(item.to)}
|
||||
<a
|
||||
{href}
|
||||
class={cn(
|
||||
navLinkClass(isActive(page.url.pathname, href, item.end)),
|
||||
'w-full justify-start py-2 min-[640px]:w-auto min-[640px]:py-1.5',
|
||||
)}
|
||||
onclick={() => (navOpen = false)}
|
||||
>
|
||||
<item.icon class="size-4" />
|
||||
{item.label}
|
||||
</a>
|
||||
{/each}
|
||||
</nav>
|
||||
|
||||
<div class="flex shrink-0 items-center gap-1 min-[640px]:ml-auto">
|
||||
<HealthWidget />
|
||||
<Button variant="ghost" size="icon" aria-label="Settings" onclick={() => (settingsOpen = true)}>
|
||||
<Settings class="size-5" />
|
||||
</Button>
|
||||
</div>
|
||||
</header>
|
||||
<SettingsDialog bind:open={settingsOpen} />
|
||||
Reference in new issue
Block a user