-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsidebar.html
More file actions
118 lines (112 loc) · 4.84 KB
/
Copy pathsidebar.html
File metadata and controls
118 lines (112 loc) · 4.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!-- Mobile Drawer Overlay -->
@if (shellState.mobileDrawerOpen()) {
<div
class="fixed inset-0 bg-slate-900/40 dark:bg-black/60 backdrop-blur-xs z-40 lg:hidden transition-opacity"
(click)="shellState.closeMobileDrawer()"
(keydown.escape)="shellState.closeMobileDrawer()"
tabindex="0"
role="button"
aria-label="Fechar navegação lateral"
></div>
}
<!-- Sidebar Container -->
<aside
[class.w-[280px]]="shellState.sidebarExpanded() && !shellState.mobileDrawerOpen()"
[class.w-[72px]]="!shellState.sidebarExpanded() && !shellState.mobileDrawerOpen()"
[class.translate-x-0]="shellState.mobileDrawerOpen()"
[class.-translate-x-full]="!shellState.mobileDrawerOpen()"
class="fixed top-[64px] bottom-0 left-0 z-40 bg-white dark:bg-slate-800 border-r border-gray-200/80 dark:border-slate-700/80 flex flex-col justify-between transition-all duration-200 ease-in-out lg:translate-x-0 overflow-x-hidden"
>
<!-- Navigation Menu Groups -->
<div class="flex-1 overflow-y-auto py-4 px-3 space-y-6">
@for (group of shellState.menuGroups(); track group.id) {
<div>
<!-- Group Header (Only visible when expanded or in drawer) -->
@if (shellState.sidebarExpanded() || shellState.mobileDrawerOpen()) {
<div class="px-3 mb-2 flex items-center justify-between">
<span
class="text-[11px] font-bold uppercase tracking-wider text-gray-400 dark:text-slate-400"
>
{{ group.title }}
</span>
</div>
} @else {
<div class="my-2 border-t border-gray-100 dark:border-slate-700/60"></div>
}
<!-- Group Items -->
<div class="space-y-1">
@for (item of group.items; track item.id) {
<div>
<!-- Main Item Link or Toggle Header -->
<button
type="button"
(click)="onItemClick(item)"
[class]="getItemClasses(item)"
[title]="item.label"
>
<div class="flex items-center gap-3 min-w-0">
<app-icon
[name]="item.icon"
[size]="shellState.sidebarExpanded() || shellState.mobileDrawerOpen() ? 'w-5 h-5' : 'w-5 h-5 mx-auto'"
[class.text-[#4F8A6B]]="isRouteActive(item.route)"
/>
@if (shellState.sidebarExpanded() || shellState.mobileDrawerOpen()) {
<span class="truncate font-medium">{{ item.label }}</span>
}
</div>
@if (shellState.sidebarExpanded() || shellState.mobileDrawerOpen()) {
<div class="flex items-center gap-1.5 shrink-0">
@if (item.badge) {
<app-badge variant="primary">{{ item.badge }}</app-badge>
} @if (item.children && item.children.length > 0) {
<app-icon
[name]="isExpanded(item.id) ? 'chevron-down' : 'chevron-right'"
size="w-4 h-4 text-gray-400"
/>
}
</div>
}
</button>
<!-- Collapsible Submenu -->
@if (item.children && item.children.length > 0 && isExpanded(item.id) &&
(shellState.sidebarExpanded() || shellState.mobileDrawerOpen())) {
<div class="ml-4 pl-3 my-1 space-y-1 border-l-2 border-gray-100 dark:border-slate-700">
@for (child of item.children; track child.id) {
<button
type="button"
(click)="onChildClick(child.route)"
[class.text-[#4F8A6B]]="isRouteActive(child.route)"
[class.font-semibold]="isRouteActive(child.route)"
[class.bg-[#EAF4EE]]="isRouteActive(child.route)"
[class.dark:bg-[#4F8A6B]/20]="isRouteActive(child.route)"
class="w-full text-left px-3 py-1.5 text-xs rounded-md text-gray-600 dark:text-slate-300 hover:text-gray-900 dark:hover:text-slate-100 hover:bg-gray-100/60 dark:hover:bg-slate-700/60 transition-colors flex items-center justify-between cursor-pointer select-none"
>
<span class="truncate">{{ child.label }}</span>
@if (child.badge) {
<app-badge variant="neutral">{{ child.badge }}</app-badge>
}
</button>
}
</div>
}
</div>
}
</div>
</div>
}
</div>
<!-- Footer Quick Status Card inside Sidebar -->
@if (shellState.sidebarExpanded() || shellState.mobileDrawerOpen()) {
<div class="p-3 m-3 bg-[#EAF4EE] dark:bg-[#4F8A6B]/15 rounded-[12px] border border-[#4F8A6B]/20">
<div class="flex items-center gap-2 mb-1">
<span class="w-2 h-2 rounded-full bg-[#4F8A6B] animate-pulse"></span>
<span class="text-xs font-semibold text-gray-900 dark:text-slate-100">
API Reccos Conectada
</span>
</div>
<p class="text-[10px] text-gray-500 dark:text-slate-400">
Sincronização em tempo real com o banco mestre de autopeças.
</p>
</div>
}
</aside>