-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigationMenu.vue
More file actions
158 lines (148 loc) · 5.42 KB
/
Copy pathNavigationMenu.vue
File metadata and controls
158 lines (148 loc) · 5.42 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<script setup lang="ts">
const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
const variants = ['pill', 'link'] as const
const horizontalItems = [
{
label: 'Jobs',
icon: 'i-material-symbols-work-outline',
children: [
{ label: 'Active Jobs', description: 'View all running agent jobs.', icon: 'i-material-symbols-play-circle-outline' },
{ label: 'Scheduled', description: 'Inspect upcoming scheduled runs.', icon: 'i-material-symbols-schedule-outline' },
{ label: 'Completed', description: 'Browse historical job records.', icon: 'i-material-symbols-check-circle-outline' },
],
},
{
label: 'Agents',
icon: 'i-material-symbols-smart-toy-outline',
children: [
{ label: 'Registry', description: 'Registered agent definitions.', icon: 'i-material-symbols-inventory-2-outline' },
{ label: 'Runtimes', description: 'Connected runtime environments.', icon: 'i-material-symbols-terminal-outline' },
{ label: 'Leases', description: 'Active execution leases.', icon: 'i-material-symbols-key-outline' },
],
},
{
label: 'Traces',
icon: 'i-material-symbols-analytics-outline',
},
{
label: 'Sessions',
icon: 'i-material-symbols-hub-outline',
badge: 3,
},
]
const verticalItems = [
{
label: 'Overview',
icon: 'i-material-symbols-dashboard-outline',
},
{
label: 'Jobs',
icon: 'i-material-symbols-work-outline',
defaultOpen: true,
children: [
{ label: 'Active', icon: 'i-material-symbols-play-circle-outline' },
{ label: 'Queued', icon: 'i-material-symbols-hourglass-outline', badge: 4 },
{ label: 'Failed', icon: 'i-material-symbols-error-outline', badge: { label: 1, color: 'error' } },
],
},
{
label: 'Agents',
icon: 'i-material-symbols-smart-toy-outline',
children: [
{ label: 'Registry', icon: 'i-material-symbols-inventory-2-outline' },
{ label: 'Runtimes', icon: 'i-material-symbols-terminal-outline' },
],
},
{
label: 'Events',
icon: 'i-material-symbols-notifications-outline',
badge: { label: 'New', color: 'info', variant: 'soft' },
},
{
label: 'Settings',
icon: 'i-material-symbols-settings-outline',
},
]
const colorItems = (color: string) => [
{ label: 'Jobs', icon: 'i-material-symbols-work-outline' },
{ label: 'Agents', icon: 'i-material-symbols-smart-toy-outline' },
{ label: 'Traces', icon: 'i-material-symbols-analytics-outline' },
]
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Horizontal (with dropdowns)">
<UNavigationMenu :items="horizontalItems" orientation="horizontal" />
</GallerySection>
<GallerySection title="Vertical">
<div class="w-56 rounded-lg border border-(--ui-border) p-2">
<UNavigationMenu :items="verticalItems" orientation="vertical" />
</div>
</GallerySection>
<GallerySection title="Variants">
<div class="flex flex-col gap-4">
<div v-for="v in variants" :key="v" class="flex flex-col gap-1">
<p class="text-xs text-(--ui-text-muted) capitalize">{{ v }}</p>
<UNavigationMenu
:items="[
{ label: 'Jobs', icon: 'i-material-symbols-work-outline' },
{ label: 'Agents', icon: 'i-material-symbols-smart-toy-outline' },
{ label: 'Traces', icon: 'i-material-symbols-analytics-outline' },
]"
:variant="v"
orientation="horizontal"
/>
</div>
</div>
</GallerySection>
<GallerySection title="Colors">
<div class="flex flex-col gap-4">
<div v-for="c in colors" :key="c" class="flex flex-col gap-1">
<p class="text-xs text-(--ui-text-muted) capitalize">{{ c }}</p>
<UNavigationMenu
:items="colorItems(c)"
:color="c"
orientation="horizontal"
highlight
:highlight-color="c"
:default-value="'item-0'"
/>
</div>
</div>
</GallerySection>
<GallerySection title="With highlight">
<UNavigationMenu
:items="[
{ label: 'Overview', icon: 'i-material-symbols-dashboard-outline', value: 'overview' },
{ label: 'Jobs', icon: 'i-material-symbols-work-outline', value: 'jobs' },
{ label: 'Sessions', icon: 'i-material-symbols-hub-outline', value: 'sessions' },
{ label: 'Traces', icon: 'i-material-symbols-analytics-outline', value: 'traces' },
]"
orientation="horizontal"
highlight
default-value="jobs"
/>
</GallerySection>
<GallerySection title="Collapsed vertical (icons only)">
<div class="w-14 rounded-lg border border-(--ui-border) p-2">
<UNavigationMenu
:items="verticalItems"
orientation="vertical"
collapsed
tooltip
/>
</div>
</GallerySection>
<GallerySection title="With badges">
<UNavigationMenu
:items="[
{ label: 'Active Jobs', icon: 'i-material-symbols-play-circle-outline', badge: 12 },
{ label: 'Queued', icon: 'i-material-symbols-hourglass-outline', badge: 4 },
{ label: 'Alerts', icon: 'i-material-symbols-notifications-outline', badge: { label: 'New', color: 'error', variant: 'soft' } },
{ label: 'Settings', icon: 'i-material-symbols-settings-outline' },
]"
orientation="horizontal"
/>
</GallerySection>
</div>
</template>