Skip to content

Commit 1384c37

Browse files
committed
chore(examples): add ticket dashboard example
1 parent 3a8854f commit 1384c37

File tree

4 files changed

+387
-9
lines changed

4 files changed

+387
-9
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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>

app/components/Mainnav.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,8 @@
3939
</div>
4040
</UiDropdownMenuTrigger>
4141
<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>
5144
</UiDropdownMenuItem>
5245
<template v-for="l in externalProjects" :key="l.name">
5346
<UiDropdownMenuItem as-child>
@@ -155,5 +148,11 @@
155148
const externalProjects = [
156149
{ name: "Settings Dashboard", link: "https://settings-dash.behonbaker.com/" },
157150
{ 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" },
158157
];
159158
</script>

0 commit comments

Comments
 (0)