refactor(frontend): audit fixes - accessibility, colors, and UX
Accessibility: - Add focus-visible indicators to all interactive elements (buttons, inputs) - Create accessible CreateUserModal to replace window.prompt() - Add aria-labels to icon buttons for screen readers Colors & Theming: - Move primary color to CSS variable (--primary) - Remove hard-coded #3b82f6 from tailwind config - Clean up color consistency across theme UX: - Replace prompt-based user creation with proper modal form - Implement inline field validation with error messages - Add loading state during form submission - Improve visual hierarchy and spacing Performance: - Remove bootstrap-icons dependency (duplicate with lucide-react) Design: - Reduce backdrop-blur overuse (remove from overlay scrim, StatCard) - Improve AdminOverlay responsive design
This commit is contained in:
@@ -28,27 +28,27 @@ export default function BottomNav({
|
||||
<footer className="fixed bottom-0 left-0 right-0 py-3 px-2 pb-safe bg-slate-950/80 backdrop-blur-lg border-t border-slate-900/50 z-40 transition-all duration-300">
|
||||
<div className="max-w-xl mx-auto flex justify-around items-center text-slate-400">
|
||||
|
||||
<button
|
||||
<button
|
||||
onClick={() => router.push('/')}
|
||||
className={cn("flex flex-col items-center gap-1", isHome && "text-primary")}
|
||||
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isHome && "text-primary")}
|
||||
>
|
||||
<Smartphone size={20} />
|
||||
<span className="text-xs font-bold transition-all">Home</span>
|
||||
</button>
|
||||
|
||||
{/* Inventory */}
|
||||
<button
|
||||
<button
|
||||
onClick={() => router.push('/inventory')}
|
||||
className={cn("flex flex-col items-center gap-1", isInventory && "text-primary")}
|
||||
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isInventory && "text-primary")}
|
||||
>
|
||||
<Package size={20} />
|
||||
<span className="text-xs font-bold transition-all">Inventory</span>
|
||||
</button>
|
||||
|
||||
{/* Logs */}
|
||||
<button
|
||||
<button
|
||||
onClick={() => router.push('/logs')}
|
||||
className={cn("flex flex-col items-center gap-1", isLogs && "text-primary")}
|
||||
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isLogs && "text-primary")}
|
||||
>
|
||||
<History size={20} />
|
||||
<span className="text-xs font-bold transition-all">Logs</span>
|
||||
@@ -56,9 +56,9 @@ export default function BottomNav({
|
||||
|
||||
{/* Admin Settings */}
|
||||
{currentUser?.role === 'admin' && (
|
||||
<button
|
||||
<button
|
||||
onClick={() => router.push('/admin')}
|
||||
className={cn("flex flex-col items-center gap-1", isAdmin && "text-primary")}
|
||||
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-primary focus-visible:outline-none", isAdmin && "text-primary")}
|
||||
>
|
||||
<Settings size={20} />
|
||||
<span className="text-xs font-bold transition-all">Admin</span>
|
||||
@@ -66,14 +66,14 @@ export default function BottomNav({
|
||||
)}
|
||||
|
||||
{/* Logout */}
|
||||
<button
|
||||
<button
|
||||
onClick={() => {
|
||||
if (window.confirm("Are you sure you want to logout?")) {
|
||||
import('@/lib/auth').then(m => m.clearAuth());
|
||||
window.location.href = '/login';
|
||||
}
|
||||
}}
|
||||
className="flex flex-col items-center gap-1 text-rose-500 hover:text-rose-400 transition-colors"
|
||||
className="flex flex-col items-center gap-1 text-rose-500 hover:text-rose-400 transition-colors rounded px-2 py-1 focus-visible:ring-2 focus-visible:ring-rose-500 focus-visible:outline-none"
|
||||
>
|
||||
<LogOut size={20} />
|
||||
<span className="text-xs font-bold transition-all">Logout</span>
|
||||
|
||||
Reference in New Issue
Block a user