File tree Expand file tree Collapse file tree 4 files changed +387
-9
lines changed Expand file tree Collapse file tree 4 files changed +387
-9
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <template v-for =" (item , index ) in items " :key =" index " >
3
+ <template v-if =" ! item .items " >
4
+ <NuxtLink
5
+ v-tippy.right =" isCollapsed ? item.title : ''"
6
+ :to =" item.link"
7
+ class =" group mb-2 flex items-center gap-2.5 rounded-md px-2 py-2 text-sm transition hover:bg-accent"
8
+ >
9
+ <Icon
10
+ v-if =" item.icon"
11
+ :name =" item.icon"
12
+ class =" size-4 shrink-0 transition group-hover:text-primary"
13
+ />
14
+ <span
15
+ class =" transition group-hover:text-primary group-data-[state=collapsed]/splitter:hidden"
16
+ >{{ item.title }}</span
17
+ >
18
+ </NuxtLink >
19
+ </template >
20
+ <template v-else >
21
+ <UiCollapsible >
22
+ <UiCollapsibleTrigger
23
+ v-tippy.right =" isCollapsed ? item.title : ''"
24
+ class =" group mb-2 flex w-full items-center gap-2.5 rounded-md px-2 py-2 text-sm transition hover:bg-accent"
25
+ >
26
+ <Icon
27
+ v-if =" item.icon"
28
+ :name =" item.icon"
29
+ class =" size-4 shrink-0 transition group-hover:text-primary"
30
+ />
31
+ <span
32
+ class =" transition group-hover:text-primary group-data-[state=collapsed]/splitter:hidden"
33
+ >{{ item.title }}</span
34
+ >
35
+ <Icon
36
+ name =" solar:alt-arrow-down-broken"
37
+ class =" ml-auto size-4 shrink-0 transition group-hover:text-primary group-data-[state=collapsed]/splitter:hidden group-data-[state=open]:rotate-180"
38
+ />
39
+ </UiCollapsibleTrigger >
40
+ <UiCollapsibleContent class =" pl-4 group-data-[state=collapsed]/splitter:hidden" >
41
+ <ExamplesTicketDashboardNavMenu :items =" item.items" />
42
+ </UiCollapsibleContent >
43
+ </UiCollapsible >
44
+ </template >
45
+ </template >
46
+ </template >
47
+ <script lang="ts" setup>
48
+ type Item = {
49
+ title: string ;
50
+ icon? : string ;
51
+ items? : {
52
+ title: string ;
53
+ link: string ;
54
+ icon? : string ;
55
+ }[];
56
+ link? : string ;
57
+ };
58
+ defineProps <{
59
+ items: Item [];
60
+ isCollapsed? : boolean ;
61
+ }>();
62
+ </script >
Original file line number Diff line number Diff line change 39
39
</div >
40
40
</UiDropdownMenuTrigger >
41
41
<UiDropdownMenuContent class =" min-w-[180px]" align =" start" :side-offset =" 5" >
42
- <UiDropdownMenuItem as-child >
43
- <NuxtLink class =" cursor-pointer hover:bg-muted" to =" /examples/cards"
44
- >Cards</NuxtLink
45
- >
46
- </UiDropdownMenuItem >
47
- <UiDropdownMenuItem as-child >
48
- <NuxtLink class =" cursor-pointer hover:bg-muted" to =" /examples/dashboard"
49
- >Dashboard</NuxtLink
50
- >
42
+ <UiDropdownMenuItem v-for =" l in localProjects" :key =" l.name" as-child >
43
+ <NuxtLink class =" cursor-pointer hover:bg-muted" :to =" l.link" >{{ l.name }}</NuxtLink >
51
44
</UiDropdownMenuItem >
52
45
<template v-for =" l in externalProjects " :key =" l .name " >
53
46
<UiDropdownMenuItem as-child >
155
148
const externalProjects = [
156
149
{ name: " Settings Dashboard" , link: " https://settings-dash.behonbaker.com/" },
157
150
{ name: " ETag Topup UI" , link: " https://etag-ui.behonbaker.com/" },
151
+ { name: " UI Todo" , link: " https://ui-todo.behonbaker.com/" },
152
+ ];
153
+ const localProjects = [
154
+ { name: " Cards" , link: " /examples/cards" },
155
+ { name: " Dashboard" , link: " /examples/dashboard" },
156
+ { name: " Ticket Dashboard" , link: " /examples/ticket-dashboard" },
158
157
];
159
158
</script >
You can’t perform that action at this time.
0 commit comments