diff --git a/docs/pages/components/[component].vue b/docs/pages/components/[component].vue index f0c79d36..7be5a0cd 100644 --- a/docs/pages/components/[component].vue +++ b/docs/pages/components/[component].vue @@ -189,6 +189,10 @@ const defaultProps = { icon: 'heroicons-outline:external-link', to: 'https://google.fr', target: '_blank' + }, + { + label: 'Logout', + avatar: 'https://github.com/benjamincanac.png' } ] }, diff --git a/src/runtime/components/navigation/VerticalNavigation.vue b/src/runtime/components/navigation/VerticalNavigation.vue index 9f1d6d35..44f635d2 100644 --- a/src/runtime/components/navigation/VerticalNavigation.vue +++ b/src/runtime/components/navigation/VerticalNavigation.vue @@ -11,6 +11,14 @@ @click="link.click && link.click()" @keyup.enter="$event.target.blur()" > + + + import Icon from '../elements/Icon' import Link from '../elements/Link' +import Avatar from '../elements/Avatar' import $ui from '#build/ui' defineProps({ @@ -76,6 +85,18 @@ defineProps({ type: String, default: () => $ui.verticalNavigation.icon.inactive }, + avatarSize: { + type: String, + default: () => 'xs' + }, + avatarBaseClass: { + type: String, + default: () => $ui.verticalNavigation.avatar.base + }, + avatarSpacingClass: { + type: String, + default: () => $ui.verticalNavigation.avatar.spacing + }, badgeBaseClass: { type: String, default: () => $ui.verticalNavigation.badge.base diff --git a/src/runtime/presets/default.ts b/src/runtime/presets/default.ts index 9863cbb1..46afa24c 100644 --- a/src/runtime/presets/default.ts +++ b/src/runtime/presets/default.ts @@ -275,6 +275,10 @@ const verticalNavigation = { active: 'u-text-gray-500', inactive: 'u-text-gray-400 group-hover:u-text-gray-500' }, + avatar: { + base: 'flex-shrink-0', + spacing: '-ml-1 mr-3' + }, badge: { base: 'ml-auto inline-block py-0.5 px-3 text-xs rounded-full', active: 'u-bg-white',