mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(app): improve aside navigation (#2875)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -18,6 +18,7 @@ onMounted(() => {
|
|||||||
indicator: 'bg-[var(--ui-bg)]',
|
indicator: 'bg-[var(--ui-bg)]',
|
||||||
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
||||||
}"
|
}"
|
||||||
|
size="sm"
|
||||||
@update:model-value="(framework = $event as string)"
|
@update:model-value="(framework = $event as string)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -76,15 +76,22 @@ defineShortcuts({
|
|||||||
<USeparator type="dashed" class="mt-4 mb-6" />
|
<USeparator type="dashed" class="mt-4 mb-6" />
|
||||||
|
|
||||||
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] mb-5.5 -mx-2.5">
|
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] mb-5.5 -mx-2.5">
|
||||||
<ModuleSelect />
|
|
||||||
<FrameworkSelect />
|
<FrameworkSelect />
|
||||||
|
<ModuleSelect />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<UContentNavigation :navigation="navigation" highlight>
|
<UContentNavigation :navigation="navigation" highlight>
|
||||||
<template #link-title="{ link }">
|
<template #link-title="{ link }">
|
||||||
{{ link.title }}
|
<span class="inline-flex items-center gap-0.5">
|
||||||
|
{{ link.title }}
|
||||||
|
|
||||||
<UIcon v-if="link.module === 'ui-pro' && link.path.startsWith('/components')" name="i-lucide-codesandbox" class="size-[14px] ml-0.5 align-middle mb-[3px] text-(--ui-text-dimmed)" />
|
<sup v-if="link.module === 'ui-pro' && link.path.startsWith('/components')" class="text-[8px] font-medium text-(--ui-primary)">PRO</sup>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template #link-trailing="{ link }">
|
||||||
|
<UBadge v-if="link.badge" variant="subtle" size="sm" color="neutral" class="rounded-[var(--ui-radius)] text-[9px] font-semibold uppercase">
|
||||||
|
{{ link.badge }}
|
||||||
|
</UBadge>
|
||||||
</template>
|
</template>
|
||||||
</UContentNavigation>
|
</UContentNavigation>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ onMounted(() => {
|
|||||||
:items="modules"
|
:items="modules"
|
||||||
:content="false"
|
:content="false"
|
||||||
color="neutral"
|
color="neutral"
|
||||||
:ui="{ indicator: 'bg-[var(--ui-bg)]', trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]' }"
|
:ui="{
|
||||||
|
indicator: 'bg-[var(--ui-bg)]',
|
||||||
|
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
||||||
|
}"
|
||||||
|
size="sm"
|
||||||
@update:model-value="(module = $event as string)"
|
@update:model-value="(module = $event as string)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ export function useSharedData() {
|
|||||||
|
|
||||||
const module = useCookie('nuxt-ui-module', { default: () => 'ui' })
|
const module = useCookie('nuxt-ui-module', { default: () => 'ui' })
|
||||||
const modules = computed(() => [{
|
const modules = computed(() => [{
|
||||||
label: 'nuxt/ui',
|
label: 'UI',
|
||||||
icon: 'i-lucide-box',
|
icon: 'i-lucide-box',
|
||||||
value: 'ui',
|
value: 'ui',
|
||||||
onSelect: () => module.value = 'ui'
|
onSelect: () => module.value = 'ui'
|
||||||
}, {
|
}, {
|
||||||
label: 'nuxt/ui-pro',
|
label: 'UI Pro',
|
||||||
icon: 'i-lucide-codesandbox',
|
icon: 'i-lucide-panels-top-left',
|
||||||
value: 'ui-pro',
|
value: 'ui-pro',
|
||||||
disabled: framework.value === 'vue',
|
disabled: framework.value === 'vue',
|
||||||
onSelect: () => module.value = 'ui-pro'
|
onSelect: () => module.value = 'ui-pro'
|
||||||
|
|||||||
@@ -12,18 +12,23 @@ const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
|||||||
<UPageAside>
|
<UPageAside>
|
||||||
<template #top>
|
<template #top>
|
||||||
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] -mx-2.5">
|
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] -mx-2.5">
|
||||||
<ModuleSelect />
|
|
||||||
<FrameworkSelect />
|
<FrameworkSelect />
|
||||||
|
<ModuleSelect />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<UContentNavigation :navigation="navigation" highlight>
|
<UContentNavigation :navigation="navigation" highlight>
|
||||||
<template #link-title="{ link }">
|
<template #link-title="{ link }">
|
||||||
{{ link.title }}
|
<span class="inline-flex items-center gap-0.5">
|
||||||
|
{{ link.title }}
|
||||||
|
|
||||||
<UTooltip v-if="link.module === 'ui-pro' && link.path.startsWith('/components')" text="Only available in nuxt/ui-pro" :content="{ side: 'right' }">
|
<sup v-if="link.module === 'ui-pro' && link.path.startsWith('/components')" class="text-[8px] font-medium text-(--ui-primary)">PRO</sup>
|
||||||
<UIcon name="i-lucide-codesandbox" class="size-[14px] ml-0.5 align-middle mb-[3px] text-(--ui-text-dimmed) hover:text-(--ui-text-muted) transition-colors" />
|
</span>
|
||||||
</UTooltip>
|
</template>
|
||||||
|
<template #link-trailing="{ link }">
|
||||||
|
<UBadge v-if="link.badge" variant="subtle" size="sm" color="neutral" class="rounded-[var(--ui-radius)] text-[9px] font-semibold uppercase">
|
||||||
|
{{ link.badge }}
|
||||||
|
</UBadge>
|
||||||
</template>
|
</template>
|
||||||
</UContentNavigation>
|
</UContentNavigation>
|
||||||
</UPageAside>
|
</UPageAside>
|
||||||
|
|||||||
Reference in New Issue
Block a user