Menü: Symbole je Menüpunkt, gemeinsame Symbolauswahl
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m33s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m41s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 3m41s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 3m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m18s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m9s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m0s

- Optionales Symbol für jeden Menü- und Unterpunkt (Kopfzeile,
  Aufklappmenüs, „Mehr“, Handy-Menü)
- Gemeinsame Liste resources/icons/icons.json (66 Lucide-Symbole) für
  Menü, Schnellzugriffe und Pagebuilder; `npm run icons` erzeugt
  Frontend-Zuordnung und SVGs für die Vorschau im Admin
- Admin-Auswahl mit Symbolvorschau und Suche

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 14:14:52 +00:00
parent dda250aaad
commit 23c36d28b5
179 changed files with 872 additions and 684 deletions

View file

@ -18,6 +18,7 @@ import BrandLogo from '@/components/BrandLogo.vue';
import NotificationBell from '@/components/NotificationBell.vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
import NavLink from '@/components/nav/NavLink.vue';
import { icons } from '@/lib/icons';
import { useThemePreference } from '@/composables/useThemePreference';
defineProps({
@ -119,11 +120,11 @@ const themeOptions = [
<NavLink
v-if="item.href"
:item="item"
class="rounded-md px-3 py-2.5 text-[15px] font-medium"
class="flex items-center gap-2.5 rounded-md px-3 py-2.5 text-[15px] font-medium"
:class="item.active && !item.children.some((c) => c.active) ? 'bg-brand-soft text-brand-soft-foreground' : 'text-foreground/80 hover:bg-accent'"
@click="mobileNavOpen = false"
>
{{ item.label }}
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-[18px] opacity-80" />{{ item.label }}
</NavLink>
<p v-else class="px-3 pt-3 pb-1 text-xs font-semibold tracking-wide text-muted-foreground uppercase">{{ item.label }}</p>
<div v-if="item.children.length" class="mb-1 ml-3 grid gap-0.5 border-l pl-2">
@ -131,11 +132,11 @@ const themeOptions = [
v-for="child in item.children"
:key="child.key"
:item="child"
class="rounded-md px-3 py-2 text-sm"
class="flex items-center gap-2 rounded-md px-3 py-2 text-sm"
:class="child.active ? 'bg-brand-soft font-medium text-brand-soft-foreground' : 'text-foreground/75 hover:bg-accent'"
@click="mobileNavOpen = false"
>
{{ child.label }}
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 opacity-70" />{{ child.label }}
</NavLink>
</div>
</template>
@ -150,18 +151,18 @@ const themeOptions = [
<nav ref="navBox" class="relative hidden h-full min-w-0 flex-1 lg:block" aria-label="Hauptnavigation">
<!-- Unsichtbare Kopie zum Messen der Breiten -->
<ul ref="navMeasure" class="pointer-events-none invisible absolute flex gap-1" aria-hidden="true">
<li v-for="item in navigation" :key="item.key" class="flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap">
{{ item.label }}<ChevronDown v-if="item.children.length" class="size-4" />
<li v-for="item in navigation" :key="item.key" class="flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap">
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4" />{{ item.label }}<ChevronDown v-if="item.children.length" class="size-4" />
</li>
</ul>
<ul class="flex h-full items-stretch gap-1">
<li v-for="item in navVisible" :key="item.key" class="flex">
<DropdownMenu v-if="item.children.length">
<DropdownMenuTrigger
class="relative flex items-center gap-1 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none"
class="relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors outline-none"
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
>
{{ item.label }} <ChevronDown class="size-4 opacity-70" />
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 opacity-80" />{{ item.label }} <ChevronDown class="size-4 opacity-70" />
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
</DropdownMenuTrigger>
<DropdownMenuContent align="start" class="min-w-56">
@ -172,18 +173,20 @@ const themeOptions = [
<DropdownMenuSeparator />
</template>
<DropdownMenuItem v-for="child in item.children" :key="child.key" as-child>
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">{{ child.label }}</NavLink>
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 text-muted-foreground" />{{ child.label }}
</NavLink>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
<NavLink
v-else
:item="item"
class="relative flex items-center px-3 text-sm font-medium whitespace-nowrap transition-colors"
class="relative flex items-center gap-1.5 px-3 text-sm font-medium whitespace-nowrap transition-colors"
:class="item.active ? 'text-foreground' : 'text-foreground/70 hover:text-foreground'"
:aria-current="item.active ? 'page' : undefined"
>
{{ item.label }}
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 opacity-80" />{{ item.label }}
<span v-if="item.active" class="nav-underline absolute inset-x-3 bottom-0 h-[3px] rounded-t-full bg-brand" />
</NavLink>
</li>
@ -203,11 +206,15 @@ const themeOptions = [
<DropdownMenuLabel class="text-xs text-muted-foreground">{{ item.label }}</DropdownMenuLabel>
<DropdownMenuItem v-if="item.href" as-child><NavLink :item="item">Übersicht</NavLink></DropdownMenuItem>
<DropdownMenuItem v-for="child in item.children" :key="child.key" as-child>
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">{{ child.label }}</NavLink>
<NavLink :item="child" :class="child.active ? 'font-semibold text-brand-text' : ''">
<component :is="icons[child.icon]" v-if="icons[child.icon]" class="size-4 text-muted-foreground" />{{ child.label }}
</NavLink>
</DropdownMenuItem>
</template>
<DropdownMenuItem v-else as-child>
<NavLink :item="item" :class="item.active ? 'font-semibold text-brand-text' : ''">{{ item.label }}</NavLink>
<NavLink :item="item" :class="item.active ? 'font-semibold text-brand-text' : ''">
<component :is="icons[item.icon]" v-if="icons[item.icon]" class="size-4 text-muted-foreground" />{{ item.label }}
</NavLink>
</DropdownMenuItem>
</template>
</DropdownMenuContent>