feat: complete UI redesign with dark mode, sidebar navigation, and modern design system

Implemented comprehensive UI overhaul with three-layer architecture:

Layer 1 - Theme System:
- CSS variables for light/dark themes (theme.css)
- Theme composable with light/dark/auto mode (useTheme.ts)
- Sidebar state management composable (useSidebar.ts)
- Refactored main.css to use CSS variables throughout

Layer 2 - Core Components:
- AppSidebar with collapsible navigation (desktop) and overlay (mobile)
- CollapsibleSection reusable component for expandable cards
- Restructured App.vue with new sidebar layout
- Integrated Lucide icons library (lucide-vue-next)

Layer 3 - Views & Components:
- Updated all 14 views with CSS variables and responsive design
- Replaced inline SVG with Lucide icon components
- Added collapsible sections to Dashboard, Admin pages, UserProfile
- Updated 3 shared components (BookingForm, SpaceCalendar, AttachmentsList)

Features:
- Dark/light/auto theme with persistent preference
- Collapsible sidebar (icons-only on desktop, overlay on mobile)
- Consistent color palette using CSS variables
- Full responsive design across all pages
- Modern minimalist aesthetic with Indigo accent color

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-02-11 21:27:05 +00:00
parent 9c2846cf00
commit 0bf3e6a7e2
28 changed files with 1960 additions and 1641 deletions

View File

@@ -0,0 +1,320 @@
<template>
<aside class="sidebar" :class="{ collapsed, 'mobile-open': mobileOpen }">
<div class="sidebar-header">
<LayoutDashboard :size="24" class="sidebar-logo-icon" />
<span v-show="!collapsed" class="sidebar-title">Space Booking</span>
</div>
<nav class="sidebar-nav">
<div class="nav-section">
<span v-show="!collapsed" class="nav-section-label">Main</span>
<router-link
v-for="item in mainNav"
:key="item.to"
:to="item.to"
class="nav-link"
:class="{ active: isActive(item.to) }"
@click="closeMobile"
>
<component :is="item.icon" :size="20" class="nav-icon" />
<span v-show="!collapsed" class="nav-label">{{ item.label }}</span>
</router-link>
</div>
<div v-if="authStore.isAdmin" class="nav-section">
<span v-show="!collapsed" class="nav-section-label">Admin</span>
<router-link
v-for="item in adminNav"
:key="item.to"
:to="item.to"
class="nav-link"
:class="{ active: isActive(item.to) }"
@click="closeMobile"
>
<component :is="item.icon" :size="20" class="nav-icon" />
<span v-show="!collapsed" class="nav-label">{{ item.label }}</span>
</router-link>
</div>
</nav>
<div class="sidebar-footer">
<div v-show="!collapsed" class="user-info">
<div class="user-avatar">
{{ authStore.user?.email?.charAt(0).toUpperCase() }}
</div>
<span class="user-email">{{ authStore.user?.email }}</span>
</div>
<div class="footer-actions">
<button class="footer-btn" @click="toggleTheme" :title="themeTitle">
<Sun v-if="resolvedTheme === 'light'" :size="18" />
<Moon v-else-if="resolvedTheme === 'dark'" :size="18" />
</button>
<button class="footer-btn collapse-toggle desktop-only" @click="toggle" :title="collapsed ? 'Expand sidebar' : 'Collapse sidebar'">
<ChevronRight v-if="collapsed" :size="18" />
<ChevronLeft v-else :size="18" />
</button>
<button class="footer-btn logout-btn" @click="handleLogout" title="Logout">
<LogOut :size="18" />
</button>
</div>
</div>
</aside>
<div v-if="mobileOpen" class="sidebar-overlay" @click="closeMobile" />
</template>
<script setup lang="ts">
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import { useSidebar } from '@/composables/useSidebar'
import { useTheme } from '@/composables/useTheme'
import {
LayoutDashboard,
Building2,
CalendarDays,
User,
Settings2,
Users,
ClipboardCheck,
Sliders,
BarChart3,
ScrollText,
Sun,
Moon,
ChevronLeft,
ChevronRight,
LogOut
} from 'lucide-vue-next'
const authStore = useAuthStore()
const route = useRoute()
const router = useRouter()
const { collapsed, mobileOpen, toggle, closeMobile } = useSidebar()
const { theme, resolvedTheme, toggleTheme } = useTheme()
const themeTitle = computed(() => {
if (theme.value === 'light') return 'Switch to dark mode'
if (theme.value === 'dark') return 'Switch to auto mode'
return 'Switch to light mode'
})
const mainNav = [
{ to: '/dashboard', icon: LayoutDashboard, label: 'Dashboard' },
{ to: '/spaces', icon: Building2, label: 'Spaces' },
{ to: '/my-bookings', icon: CalendarDays, label: 'My Bookings' },
{ to: '/profile', icon: User, label: 'Profile' },
]
const adminNav = [
{ to: '/admin', icon: Settings2, label: 'Spaces Admin' },
{ to: '/users', icon: Users, label: 'Users' },
{ to: '/admin/pending', icon: ClipboardCheck, label: 'Pending' },
{ to: '/admin/settings', icon: Sliders, label: 'Settings' },
{ to: '/admin/reports', icon: BarChart3, label: 'Reports' },
{ to: '/admin/audit-log', icon: ScrollText, label: 'Audit Log' },
]
const isActive = (path: string) => {
if (path === '/dashboard') return route.path === '/dashboard'
return route.path.startsWith(path)
}
const handleLogout = () => {
authStore.logout()
router.push('/login')
}
</script>
<style scoped>
.sidebar {
position: fixed;
top: 0;
left: 0;
bottom: 0;
width: var(--sidebar-width);
background: var(--sidebar-bg);
display: flex;
flex-direction: column;
z-index: 100;
transition: width var(--transition-normal), transform var(--transition-normal);
overflow: hidden;
}
.sidebar.collapsed {
width: var(--sidebar-collapsed-width);
}
/* Header */
.sidebar-header {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 1.25rem 1.25rem 1rem;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
min-height: 60px;
}
.sidebar-logo-icon {
color: var(--color-accent);
flex-shrink: 0;
}
.sidebar-title {
font-size: 1.1rem;
font-weight: 700;
color: var(--sidebar-text-active);
white-space: nowrap;
overflow: hidden;
}
/* Navigation */
.sidebar-nav {
flex: 1;
overflow-y: auto;
padding: 0.75rem 0;
}
.nav-section {
margin-bottom: 0.5rem;
}
.nav-section-label {
display: block;
padding: 0.5rem 1.25rem 0.25rem;
font-size: 0.7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.05em;
color: var(--sidebar-text);
opacity: 0.6;
}
.nav-link {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.6rem 1.25rem;
color: var(--sidebar-text);
text-decoration: none;
transition: all var(--transition-fast);
border-left: 3px solid transparent;
white-space: nowrap;
}
.nav-link:hover {
background: var(--sidebar-hover-bg);
color: var(--sidebar-text-active);
}
.nav-link.active {
color: var(--sidebar-text-active);
background: var(--sidebar-hover-bg);
border-left-color: var(--color-accent);
}
.nav-icon {
flex-shrink: 0;
}
.nav-label {
overflow: hidden;
text-overflow: ellipsis;
}
/* Footer */
.sidebar-footer {
border-top: 1px solid rgba(255, 255, 255, 0.08);
padding: 0.75rem 1rem;
}
.user-info {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.5rem 0.25rem;
margin-bottom: 0.5rem;
overflow: hidden;
}
.user-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
background: var(--color-accent);
color: white;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.85rem;
font-weight: 600;
flex-shrink: 0;
}
.user-email {
font-size: 0.8rem;
color: var(--sidebar-text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.footer-actions {
display: flex;
align-items: center;
gap: 0.25rem;
}
.footer-btn {
background: transparent;
border: none;
color: var(--sidebar-text);
cursor: pointer;
padding: 0.5rem;
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
transition: all var(--transition-fast);
}
.footer-btn:hover {
background: var(--sidebar-hover-bg);
color: var(--sidebar-text-active);
}
.logout-btn:hover {
color: var(--color-danger);
}
/* Sidebar overlay for mobile */
.sidebar-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.5);
z-index: 99;
}
/* Mobile styles */
@media (max-width: 768px) {
.sidebar {
transform: translateX(-100%);
width: var(--sidebar-width);
}
.sidebar.mobile-open {
transform: translateX(0);
}
.sidebar.collapsed {
width: var(--sidebar-width);
}
.desktop-only {
display: none;
}
}
</style>

View File

@@ -126,7 +126,7 @@ onMounted(() => {
.attachments-title {
font-size: 16px;
font-weight: 600;
color: #111827;
color: var(--color-text-primary);
margin: 0 0 12px 0;
}
@@ -134,19 +134,19 @@ onMounted(() => {
.error,
.no-attachments {
padding: 12px;
border-radius: 6px;
border-radius: var(--radius-sm);
font-size: 14px;
}
.loading,
.no-attachments {
background: #f3f4f6;
color: #6b7280;
background: var(--color-bg-tertiary);
color: var(--color-text-secondary);
}
.error {
background: #fee2e2;
color: #991b1b;
background: color-mix(in srgb, var(--color-danger) 10%, transparent);
color: var(--color-danger);
}
.attachment-items {
@@ -160,9 +160,9 @@ onMounted(() => {
align-items: center;
justify-content: space-between;
padding: 12px;
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 6px;
background: var(--color-bg-secondary);
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
margin-bottom: 8px;
gap: 12px;
}
@@ -189,7 +189,7 @@ onMounted(() => {
.attachment-name {
font-size: 14px;
color: #3b82f6;
color: var(--color-accent);
text-decoration: none;
font-weight: 500;
overflow: hidden;
@@ -203,23 +203,23 @@ onMounted(() => {
.attachment-meta {
font-size: 12px;
color: #6b7280;
color: var(--color-text-secondary);
}
.btn-delete {
padding: 6px 12px;
background: white;
color: #ef4444;
border: 1px solid #ef4444;
border-radius: 4px;
background: var(--color-surface);
color: var(--color-danger);
border: 1px solid var(--color-danger);
border-radius: var(--radius-sm);
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
transition: all var(--transition-fast);
flex-shrink: 0;
}
.btn-delete:hover:not(:disabled) {
background: #fef2f2;
background: color-mix(in srgb, var(--color-danger) 5%, transparent);
}
.btn-delete:disabled {

View File

@@ -437,7 +437,7 @@ onMounted(() => {
display: block;
margin-bottom: 6px;
font-weight: 500;
color: #374151;
color: var(--color-text-primary);
font-size: 14px;
}
@@ -445,7 +445,7 @@ onMounted(() => {
display: block;
margin-bottom: 4px;
font-weight: 400;
color: #6b7280;
color: var(--color-text-secondary);
font-size: 12px;
}
@@ -464,26 +464,28 @@ onMounted(() => {
.form-textarea {
width: 100%;
padding: 8px 12px;
border: 1px solid #d1d5db;
border-radius: 4px;
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
font-size: 14px;
font-family: inherit;
transition: border-color 0.2s;
transition: border-color var(--transition-fast);
background: var(--color-surface);
color: var(--color-text-primary);
}
.form-input:focus,
.form-textarea:focus {
outline: none;
border-color: #3b82f6;
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
border-color: var(--color-accent);
box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 15%, transparent);
}
.form-input-error {
border-color: #ef4444;
border-color: var(--color-danger);
}
.form-input:disabled {
background-color: #f3f4f6;
background-color: var(--color-bg-tertiary);
cursor: not-allowed;
}
@@ -494,24 +496,24 @@ onMounted(() => {
.form-error {
display: block;
margin-top: 4px;
color: #ef4444;
color: var(--color-danger);
font-size: 13px;
}
.api-error {
padding: 12px;
background: #fee2e2;
color: #991b1b;
border-radius: 4px;
background: color-mix(in srgb, var(--color-danger) 10%, transparent);
color: var(--color-danger);
border-radius: var(--radius-sm);
margin-bottom: 16px;
font-size: 14px;
}
.success-message {
padding: 12px;
background: #d1fae5;
color: #065f46;
border-radius: 4px;
background: color-mix(in srgb, var(--color-success) 10%, transparent);
color: var(--color-success);
border-radius: var(--radius-sm);
margin-bottom: 16px;
font-size: 14px;
}
@@ -525,11 +527,11 @@ onMounted(() => {
.btn {
padding: 10px 20px;
border: none;
border-radius: 4px;
border-radius: var(--radius-sm);
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
transition: all var(--transition-fast);
}
.btn:disabled {
@@ -538,33 +540,34 @@ onMounted(() => {
}
.btn-primary {
background: #3b82f6;
background: var(--color-accent);
color: white;
}
.btn-primary:hover:not(:disabled) {
background: #2563eb;
background: var(--color-accent-hover);
}
.btn-secondary {
background: #6b7280;
background: var(--color-text-secondary);
color: white;
}
.btn-secondary:hover:not(:disabled) {
background: #4b5563;
background: var(--color-text-primary);
}
.warning-banner {
background: #fff3cd;
border: 1px solid #ffc107;
border-radius: 4px;
background: color-mix(in srgb, var(--color-warning) 15%, transparent);
border: 1px solid var(--color-warning);
border-radius: var(--radius-sm);
padding: 12px;
margin-bottom: 16px;
display: flex;
gap: 12px;
align-items: flex-start;
font-size: 14px;
color: var(--color-text-primary);
}
.warning-icon {

View File

@@ -0,0 +1,94 @@
<template>
<div class="collapsible-section">
<div class="section-header" @click="toggle" role="button" :aria-expanded="isOpen">
<component :is="icon" v-if="icon" :size="20" class="section-icon" />
<h3 class="section-title">{{ title }}</h3>
<div class="header-actions" @click.stop>
<slot name="header-actions" />
</div>
<ChevronDown class="chevron" :class="{ rotated: !isOpen }" :size="18" />
</div>
<div v-show="isOpen" class="section-content">
<slot />
</div>
</div>
</template>
<script setup lang="ts">
import { ref, type Component } from 'vue'
import { ChevronDown } from 'lucide-vue-next'
const props = withDefaults(defineProps<{
title: string
icon?: Component
defaultOpen?: boolean
}>(), {
defaultOpen: true
})
const isOpen = ref(props.defaultOpen)
const toggle = () => {
isOpen.value = !isOpen.value
}
defineExpose({ isOpen, toggle })
</script>
<style scoped>
.collapsible-section {
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-sm);
overflow: hidden;
}
.section-header {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 1rem 1.25rem;
cursor: pointer;
user-select: none;
transition: background var(--transition-fast);
}
.section-header:hover {
background: var(--color-surface-hover);
}
.section-icon {
color: var(--color-accent);
flex-shrink: 0;
}
.section-title {
margin: 0;
font-size: 1rem;
font-weight: 600;
color: var(--color-text-primary);
flex: 1;
}
.header-actions {
display: flex;
align-items: center;
gap: 0.5rem;
}
.chevron {
color: var(--color-text-muted);
transition: transform var(--transition-normal);
flex-shrink: 0;
}
.chevron.rotated {
transform: rotate(-90deg);
}
.section-content {
padding: 1.25rem;
border-top: 1px solid var(--color-border-light);
}
</style>

View File

@@ -313,32 +313,32 @@ defineExpose({ refresh })
<style scoped>
.space-calendar {
background: white;
border-radius: 8px;
background: var(--color-surface);
border-radius: var(--radius-md);
padding: 24px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
box-shadow: var(--shadow-sm);
}
.admin-notice {
background: #e3f2fd;
background: color-mix(in srgb, var(--color-info) 15%, transparent);
padding: 8px 16px;
margin-bottom: 16px;
border-radius: 4px;
color: #1976d2;
border-radius: var(--radius-sm);
color: var(--color-info);
font-size: 14px;
}
.error {
padding: 12px;
background: #fee2e2;
color: #991b1b;
border-radius: 4px;
background: color-mix(in srgb, var(--color-danger) 10%, transparent);
color: var(--color-danger);
border-radius: var(--radius-sm);
margin-bottom: 16px;
}
.loading {
text-align: center;
color: #6b7280;
color: var(--color-text-secondary);
padding: 24px;
}
@@ -357,23 +357,23 @@ defineExpose({ refresh })
}
.modal-content {
background: white;
background: var(--color-surface);
padding: 24px;
border-radius: 8px;
border-radius: var(--radius-md);
max-width: 500px;
width: 90%;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
box-shadow: var(--shadow-lg);
}
.modal-content h3 {
margin-top: 0;
margin-bottom: 16px;
color: #1f2937;
color: var(--color-text-primary);
}
.modal-content p {
margin-bottom: 20px;
color: #6b7280;
color: var(--color-text-secondary);
}
.time-comparison {
@@ -382,26 +382,27 @@ defineExpose({ refresh })
gap: 16px;
margin: 20px 0;
padding: 16px;
background: #f9fafb;
border-radius: 4px;
background: var(--color-bg-secondary);
border-radius: var(--radius-sm);
}
.old-time,
.new-time {
flex: 1;
font-size: 14px;
color: var(--color-text-secondary);
}
.old-time strong,
.new-time strong {
color: #374151;
color: var(--color-text-primary);
display: block;
margin-bottom: 4px;
}
.arrow {
font-size: 24px;
color: #9ca3af;
color: var(--color-text-muted);
}
.modal-actions {
@@ -412,40 +413,40 @@ defineExpose({ refresh })
}
.btn-primary {
background: #3b82f6;
background: var(--color-accent);
color: white;
border: none;
padding: 10px 20px;
border-radius: 4px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background 0.2s;
transition: background var(--transition-fast);
}
.btn-primary:hover:not(:disabled) {
background: #2563eb;
background: var(--color-accent-hover);
}
.btn-primary:disabled {
background: #93c5fd;
opacity: 0.6;
cursor: not-allowed;
}
.btn-secondary {
background: #f3f4f6;
color: #374151;
border: 1px solid #d1d5db;
background: var(--color-bg-tertiary);
color: var(--color-text-primary);
border: 1px solid var(--color-border);
padding: 10px 20px;
border-radius: 4px;
border-radius: var(--radius-sm);
cursor: pointer;
font-size: 14px;
font-weight: 500;
transition: background 0.2s;
transition: background var(--transition-fast);
}
.btn-secondary:hover:not(:disabled) {
background: #e5e7eb;
background: var(--color-border);
}
.btn-secondary:disabled {
@@ -459,28 +460,28 @@ defineExpose({ refresh })
}
:deep(.fc-button) {
background: #3b82f6;
border-color: #3b82f6;
background: var(--color-accent);
border-color: var(--color-accent);
text-transform: capitalize;
}
:deep(.fc-button:hover) {
background: #2563eb;
border-color: #2563eb;
background: var(--color-accent-hover);
border-color: var(--color-accent-hover);
}
:deep(.fc-button-active) {
background: #1d4ed8 !important;
border-color: #1d4ed8 !important;
background: var(--color-accent-hover) !important;
border-color: var(--color-accent-hover) !important;
}
:deep(.fc-daygrid-day-number) {
color: #374151;
color: var(--color-text-primary);
font-weight: 500;
}
:deep(.fc-col-header-cell-cushion) {
color: #374151;
color: var(--color-text-primary);
font-weight: 600;
}