2026-03-16 23:20:54 +01:00
|
|
|
import { A, useLocation } from '@solidjs/router';
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
import { For, Show, createSignal } from 'solid-js';
|
2026-03-24 02:36:40 +01:00
|
|
|
import {
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
LayoutGrid, Building2, Briefcase, Users, ShieldCheck, FileText,
|
|
|
|
|
LayoutDashboard, ClipboardList, UserRoundSearch, UserCircle,
|
|
|
|
|
Camera, Palette, BookOpen, Code2, BriefcaseBusiness, HandHelping,
|
|
|
|
|
WalletCards, CreditCard, Tag, Percent, Receipt, ShoppingCart,
|
|
|
|
|
FileCheck, Star, HeadphonesIcon, BarChart3, BookMarked, Bell,
|
|
|
|
|
ChevronLeft,
|
2026-03-24 02:36:40 +01:00
|
|
|
} from 'lucide-solid';
|
|
|
|
|
|
|
|
|
|
type Item = {
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
href: string;
|
|
|
|
|
label: string;
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
icon: any;
|
feat(admin): Phase 0 — Tailwind v4 foundation, shell rewrite, modern dashboard
- Install Tailwind CSS v4 via @tailwindcss/vite; configure vite.config.ts
- Rewrite app.css: Tailwind base, Exo 2 font, brand tokens (orange #fd6216, navy #050026), scrollbar utility; fix @import order
- Rewrite AdminShell.tsx: fixed header, fixed inset body grid (sidebar + main), session check, sub-tab system, logout, admin avatar/name/role
- Rewrite AdminSidebar.tsx: collapsible w-64/w-20, orange active rail + badge/dot, CSS filter for SVG icon tinting, min-h-0 flex fix
- Replace 84 route stub CSS classes (page-title, card, btn, table-wrap, etc.) with Tailwind equivalents via safe class-attr-only regex script
- Rewrite admin dashboard: Lucide icons in colored chip backgrounds, 4-col KPI grid, Control Plane 6-module grid, hover lift animations
- Disable SSR (ssr: false) to fix Vinxi dev manifest error; clear stale .vinxi cache
- Add lucide-solid icon library
- Add scripts/cleanup-css.mjs for class migration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:00:21 +01:00
|
|
|
aliasPrefix?: string;
|
|
|
|
|
};
|
2026-03-19 03:36:46 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const items: Item[] = [
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{ href: '/admin', label: 'Dashboard', icon: LayoutGrid },
|
|
|
|
|
{ href: '/admin/department', label: 'Department Management', icon: Building2 },
|
|
|
|
|
{ href: '/admin/designation', label: 'Designation Management', icon: Briefcase },
|
|
|
|
|
{ href: '/admin/employees', label: 'Internal User Management', icon: Users },
|
|
|
|
|
{ href: '/admin/roles', label: 'Internal Role Management', icon: ShieldCheck },
|
|
|
|
|
{ href: '/admin/runtime-roles', label: 'External Role Management', icon: ShieldCheck },
|
|
|
|
|
{ href: '/admin/onboarding-management', label: 'Onboarding Management', icon: FileText, aliasPrefix: '/admin/onboarding-schemas' },
|
|
|
|
|
{ href: '/admin/internal-dashboard-management',label: 'Internal Dashboard Management', icon: LayoutDashboard },
|
|
|
|
|
{ href: '/admin/external-dashboard-management',label: 'External Dashboard Management', icon: LayoutDashboard, aliasPrefix: '/admin/role-ui-configs' },
|
|
|
|
|
{ href: '/admin/approval', label: 'Approval Management', icon: ClipboardList },
|
|
|
|
|
{ href: '/admin/users', label: 'External User Management', icon: UserRoundSearch },
|
|
|
|
|
{ href: '/admin/customer', label: 'Customer Management', icon: UserCircle },
|
|
|
|
|
{ href: '/admin/company', label: 'Company Management', icon: Building2 },
|
|
|
|
|
{ href: '/admin/candidate', label: 'Candidate Management', icon: UserCircle },
|
|
|
|
|
{ href: '/admin/photographer', label: 'Photographer Management', icon: Camera },
|
|
|
|
|
{ href: '/admin/makeup-artist', label: 'Makeup Artist Management', icon: Palette },
|
|
|
|
|
{ href: '/admin/tutors', label: 'Tutor Management', icon: BookOpen },
|
|
|
|
|
{ href: '/admin/developers', label: 'Developer Management', icon: Code2 },
|
|
|
|
|
{ href: '/admin/jobs', label: 'Jobs Management', icon: BriefcaseBusiness },
|
|
|
|
|
{ href: '/admin/leads', label: 'Leads Management', icon: HandHelping },
|
|
|
|
|
{ href: '/admin/pricing', label: 'Pricing Management', icon: WalletCards },
|
|
|
|
|
{ href: '/admin/credit', label: 'Credit Management', icon: CreditCard },
|
|
|
|
|
{ href: '/admin/coupon', label: 'Coupon Management', icon: Tag },
|
|
|
|
|
{ href: '/admin/discount', label: 'Discount Management', icon: Percent },
|
|
|
|
|
{ href: '/admin/tax', label: 'Tax Management', icon: Receipt },
|
|
|
|
|
{ href: '/admin/order', label: 'Order Management', icon: ShoppingCart },
|
|
|
|
|
{ href: '/admin/invoice', label: 'Invoice Management', icon: FileCheck },
|
|
|
|
|
{ href: '/admin/review', label: 'Review Management', icon: Star },
|
|
|
|
|
{ href: '/admin/kb', label: 'Knowledge Base Management', icon: BookMarked },
|
|
|
|
|
{ href: '/admin/notifications', label: 'Notifications', icon: Bell },
|
|
|
|
|
{ href: '/admin/support', label: 'Support Management', icon: HeadphonesIcon },
|
|
|
|
|
{ href: '/admin/report', label: 'Report Management', icon: BarChart3 },
|
|
|
|
|
{ href: '/admin/ledger', label: 'Ledger Management', icon: Receipt },
|
2026-03-16 23:20:54 +01:00
|
|
|
];
|
|
|
|
|
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
export default function AdminSidebar(props: {
|
|
|
|
|
collapsed: boolean;
|
|
|
|
|
onToggle: () => void;
|
|
|
|
|
onNavigate?: () => void;
|
|
|
|
|
onLogout?: () => void;
|
|
|
|
|
}) {
|
2026-03-24 02:36:40 +01:00
|
|
|
const location = useLocation();
|
2026-03-16 23:20:54 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
const active = (item: Item) => {
|
|
|
|
|
if (item.href === '/admin') return location.pathname === '/admin';
|
|
|
|
|
if (item.aliasPrefix && location.pathname.startsWith(item.aliasPrefix)) return true;
|
|
|
|
|
return location.pathname === item.href || location.pathname.startsWith(`${item.href}/`);
|
feat(ui): apply stitch design system — left-accent KPI cards, Intelligence Hub, glassmorphism header
- app.css: Exo 2 font, #0a1d37 navy + #fd6216 orange tokens, #f9f9fd background
- AdminShell: backdrop-blur-xl glassmorphism header, centered search bar, settings icon,
name + bordered avatar, ambient shadow-[0_4px_24px_rgba(10,29,55,0.04)]
- AdminSidebar: white bg, left orange 4px pill accent on active (before: pseudo),
bg-slate-50 active state, MANAGEMENT/FINANCE/PLATFORM group labels, user card at bottom
- Dashboard: KPI cards with absolute left-0 accent bar + ambient shadows, big font-black numbers,
System Activity bar chart, Intelligence Hub dark navy panel with quick-action buttons,
Pipeline Status cards with progress bars, Control Plane 3-col grid
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-23 23:34:33 +01:00
|
|
|
};
|
|
|
|
|
|
2026-03-16 23:20:54 +01:00
|
|
|
return (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<aside class={`flex h-full flex-col border-r border-slate-200 bg-[#fcfcfd] transition-all duration-300 ${props.collapsed ? 'w-20' : 'w-64'}`}>
|
|
|
|
|
{/* Collapse toggle */}
|
|
|
|
|
<div class="flex justify-end px-3 pt-4 pb-3">
|
|
|
|
|
<button
|
|
|
|
|
type="button"
|
|
|
|
|
onClick={() => props.onToggle()}
|
|
|
|
|
class="rounded-lg p-2 text-slate-500 transition hover:bg-slate-100 hover:text-slate-700"
|
|
|
|
|
>
|
|
|
|
|
<ChevronLeft
|
|
|
|
|
size={16}
|
|
|
|
|
class={`transition-transform duration-300 ${props.collapsed ? 'rotate-180' : ''}`}
|
|
|
|
|
/>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{/* Nav */}
|
|
|
|
|
<nav class="scrollbar min-h-0 flex-1 space-y-1.5 overflow-y-auto px-3 pb-3">
|
2026-03-24 02:36:40 +01:00
|
|
|
<For each={items}>
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
{(item) => {
|
ui: match stitch design system — navy accents, tighter rounding, sidebar groups
- AdminSidebar: group labels (Management/Organisation/Service Providers/Operations),
navy active state (bg-[#e8edf5] + [#0a1d37] left bar + navy icon), width 268px,
13.5px font, 40px item height, lucide-solid icons only (no img fallback), min-w-0
truncation fix, tighter py spacing
- AdminShell: header height 64px (was 86px), compact search bar 40px/rounded-lg,
navy avatar square (was orange gradient), tab indicator navy (was orange), sidebar
width 268px, main bg #f3f4f8
- Dashboard: rounded-xl→rounded-lg cards, rounded-2xl→rounded-xl sections, navy
accent bars on KPI cards, tabular-nums on values, navy pipeline progress bars
- app.css: table thead now navy (#0a1d37) with white text matching reference screenshot,
focus rings navy, admin-segment/admin-link-tabs active state navy, reduced border
radii on segmented controls and list items
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 02:49:09 +01:00
|
|
|
const isActive = () => active(item);
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
const Icon = item.icon;
|
ui: match stitch design system — navy accents, tighter rounding, sidebar groups
- AdminSidebar: group labels (Management/Organisation/Service Providers/Operations),
navy active state (bg-[#e8edf5] + [#0a1d37] left bar + navy icon), width 268px,
13.5px font, 40px item height, lucide-solid icons only (no img fallback), min-w-0
truncation fix, tighter py spacing
- AdminShell: header height 64px (was 86px), compact search bar 40px/rounded-lg,
navy avatar square (was orange gradient), tab indicator navy (was orange), sidebar
width 268px, main bg #f3f4f8
- Dashboard: rounded-xl→rounded-lg cards, rounded-2xl→rounded-xl sections, navy
accent bars on KPI cards, tabular-nums on values, navy pipeline progress bars
- app.css: table thead now navy (#0a1d37) with white text matching reference screenshot,
focus rings navy, admin-segment/admin-link-tabs active state navy, reduced border
radii on segmented controls and list items
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 02:49:09 +01:00
|
|
|
|
2026-03-24 02:36:40 +01:00
|
|
|
return (
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
<A
|
|
|
|
|
href={item.href}
|
|
|
|
|
onClick={() => props.onNavigate?.()}
|
|
|
|
|
title={props.collapsed ? item.label : undefined}
|
|
|
|
|
aria-current={isActive() ? 'page' : undefined}
|
|
|
|
|
class={`group relative flex items-center gap-3 rounded-xl border px-3 py-3 text-[15px] leading-5 transition-all ${
|
|
|
|
|
props.collapsed ? 'justify-center px-2' : ''
|
|
|
|
|
} ${
|
|
|
|
|
isActive()
|
|
|
|
|
? 'border-orange-200 bg-gradient-to-r from-orange-50 to-orange-100/70 text-slate-900'
|
|
|
|
|
: 'border-transparent text-slate-500 hover:border-slate-200 hover:bg-white hover:text-slate-800'
|
|
|
|
|
}`}
|
|
|
|
|
>
|
|
|
|
|
{/* Right orange accent bar */}
|
|
|
|
|
<span
|
|
|
|
|
class={`absolute right-0 top-2 bottom-2 w-[3px] rounded-l-full bg-orange-500 transition-opacity ${
|
|
|
|
|
isActive() ? 'opacity-100' : 'opacity-0'
|
2026-03-24 02:36:40 +01:00
|
|
|
}`}
|
ui(step-0): rewrite sidebar/shell to match reference admin panel
- AdminSidebar: flat nav list, orange right-border active indicator,
ACTIVE pill badge, ChevronLeft collapse (rotates 180° when collapsed)
- AdminShell: h-16 header with logo+title left, Bell+avatar+logout right,
sidebar collapse state, bg-gray-50 main area
- app.css: shared classes — data-table (navy header), table-card,
btn-primary (navy), btn-secondary, search-input, action-btn,
status-badge variants, page-title
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 04:25:17 +01:00
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
|
size={18}
|
|
|
|
|
class={`shrink-0 transition-colors ${
|
|
|
|
|
isActive() ? 'text-orange-600' : 'text-slate-500 group-hover:text-slate-700'
|
|
|
|
|
}`}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<Show when={!props.collapsed}>
|
|
|
|
|
<span class={`min-w-0 flex-1 truncate font-medium ${isActive() ? 'text-slate-900' : 'text-slate-600 group-hover:text-slate-800'}`}>
|
|
|
|
|
{item.label}
|
|
|
|
|
</span>
|
|
|
|
|
<Show when={isActive()}>
|
|
|
|
|
<span class="ml-auto shrink-0 rounded-full border border-orange-200 bg-orange-100 px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-orange-700">
|
|
|
|
|
Active
|
|
|
|
|
</span>
|
|
|
|
|
</Show>
|
|
|
|
|
</Show>
|
|
|
|
|
|
|
|
|
|
{/* Collapsed active dot */}
|
|
|
|
|
<Show when={props.collapsed && isActive()}>
|
|
|
|
|
<span class="absolute -right-0.5 top-1/2 h-2 w-2 -translate-y-1/2 rounded-full bg-orange-500" />
|
|
|
|
|
</Show>
|
|
|
|
|
</A>
|
2026-03-24 02:36:40 +01:00
|
|
|
);
|
|
|
|
|
}}
|
|
|
|
|
</For>
|
|
|
|
|
</nav>
|
2026-03-16 23:20:54 +01:00
|
|
|
</aside>
|
|
|
|
|
);
|
|
|
|
|
}
|