docs(content): improve examples

This commit is contained in:
Benjamin Canac
2025-04-14 12:42:07 +02:00
parent 0a3cc5a25d
commit d5bcb0da59
14 changed files with 248 additions and 217 deletions

View File

@@ -11,7 +11,6 @@ const items = shallowRef<AccordionItem[]>([
{ {
label: 'Colors', label: 'Colors',
icon: 'i-lucide-swatch-book', icon: 'i-lucide-swatch-book',
slot: 'colors' as const,
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.' content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
}, },
{ {

View File

@@ -1,26 +1,35 @@
<script setup lang="ts"> <script setup lang="ts">
import type { BreadcrumbItem } from '@nuxt/ui' import type { BreadcrumbItem } from '@nuxt/ui'
const items = [{ const items = [
{
label: 'Home', label: 'Home',
to: '/' to: '/'
}, { },
{
slot: 'dropdown' as const, slot: 'dropdown' as const,
icon: 'i-lucide-ellipsis', icon: 'i-lucide-ellipsis',
children: [{ children: [
{
label: 'Documentation' label: 'Documentation'
}, { },
{
label: 'Themes' label: 'Themes'
}, { },
{
label: 'GitHub' label: 'GitHub'
}] }
}, { ]
},
{
label: 'Components', label: 'Components',
to: '/components' to: '/components'
}, { },
{
label: 'Breadcrumb', label: 'Breadcrumb',
to: '/components/breadcrumb' to: '/components/breadcrumb'
}] satisfies BreadcrumbItem[] }
] satisfies BreadcrumbItem[]
</script> </script>
<template> <template>

View File

@@ -1,16 +1,20 @@
<script setup lang="ts"> <script setup lang="ts">
import type { BreadcrumbItem } from '@nuxt/ui' import type { BreadcrumbItem } from '@nuxt/ui'
const items: BreadcrumbItem[] = [{ const items: BreadcrumbItem[] = [
{
label: 'Home', label: 'Home',
to: '/' to: '/'
}, { },
{
label: 'Components', label: 'Components',
to: '/components' to: '/components'
}, { },
{
label: 'Breadcrumb', label: 'Breadcrumb',
to: '/components/breadcrumb' to: '/components/breadcrumb'
}] }
]
</script> </script>
<template> <template>

View File

@@ -1,23 +1,30 @@
<script setup lang="ts"> <script setup lang="ts">
import type { DropdownMenuItem } from '@nuxt/ui' import type { DropdownMenuItem } from '@nuxt/ui'
const items: DropdownMenuItem[] = [{ const items: DropdownMenuItem[] = [
{
label: 'Team', label: 'Team',
icon: 'i-lucide-users' icon: 'i-lucide-users'
}, { },
{
label: 'Invite users', label: 'Invite users',
icon: 'i-lucide-user-plus', icon: 'i-lucide-user-plus',
children: [{ children: [
{
label: 'Invite by email', label: 'Invite by email',
icon: 'i-lucide-send-horizontal' icon: 'i-lucide-send-horizontal'
}, { },
{
label: 'Invite by link', label: 'Invite by link',
icon: 'i-lucide-link' icon: 'i-lucide-link'
}] }
}, { ]
},
{
label: 'New team', label: 'New team',
icon: 'i-lucide-plus' icon: 'i-lucide-plus'
}] }
]
</script> </script>
<template> <template>

View File

@@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
const groups = [{ const groups = [
{
id: 'settings', id: 'settings',
items: [ items: [
{ {
@@ -22,7 +23,8 @@ const groups = [{
icon: 'i-lucide-lock' icon: 'i-lucide-lock'
} }
] ]
}, { },
{
id: 'users', id: 'users',
label: 'Users', label: 'Users',
slot: 'users' as const, slot: 'users' as const,
@@ -70,7 +72,8 @@ const groups = [{
target: '_blank' target: '_blank'
} }
] ]
}] }
]
</script> </script>
<template> <template>

View File

@@ -3,14 +3,18 @@ import type { ContextMenuItem } from '@nuxt/ui'
const loading = ref(true) const loading = ref(true)
const items: ContextMenuItem[] = [{ const items = [
{
label: 'Refresh the Page', label: 'Refresh the Page',
slot: 'refresh' slot: 'refresh' as const
}, { },
{
label: 'Clear Cookies and Refresh' label: 'Clear Cookies and Refresh'
}, { },
{
label: 'Clear Cache and Refresh' label: 'Clear Cache and Refresh'
}] }
] satisfies ContextMenuItem[]
</script> </script>
<template> <template>

View File

@@ -1,23 +1,21 @@
<script setup lang="ts"> <script setup lang="ts">
import type { NavigationMenuItem } from '@nuxt/ui' import type { NavigationMenuItem } from '@nuxt/ui'
const items: NavigationMenuItem[] = [ const items = [
{ {
label: 'Guide', label: 'Guide',
icon: 'i-lucide-book-open' icon: 'i-lucide-book-open'
}, },
{ {
label: 'Composables', label: 'Composables',
icon: 'i-lucide-database' icon: 'i-lucide-database'
}, },
{ {
label: 'Components', label: 'Components',
icon: 'i-lucide-box', icon: 'i-lucide-box',
slot: 'components' slot: 'components' as const
} }
] ] satisfies NavigationMenuItem[]
</script> </script>
<template> <template>

View File

@@ -1,23 +1,23 @@
<script setup lang="ts"> <script setup lang="ts">
import type { StepperItem } from '@nuxt/ui' import type { StepperItem } from '@nuxt/ui'
const items: StepperItem[] = [ const items = [
{ {
slot: 'address', slot: 'address' as const,
title: 'Address', title: 'Address',
description: 'Add your address here', description: 'Add your address here',
icon: 'i-lucide-house' icon: 'i-lucide-house'
}, { }, {
slot: 'shipping', slot: 'shipping' as const,
title: 'Shipping', title: 'Shipping',
description: 'Set your preferred shipping method', description: 'Set your preferred shipping method',
icon: 'i-lucide-truck' icon: 'i-lucide-truck'
}, { }, {
slot: 'checkout', slot: 'checkout' as const,
title: 'Checkout', title: 'Checkout',
description: 'Confirm your order' description: 'Confirm your order'
} }
] ] satisfies StepperItem[]
</script> </script>
<template> <template>

View File

@@ -3,17 +3,14 @@ import type { StepperItem } from '@nuxt/ui'
const items: StepperItem[] = [ const items: StepperItem[] = [
{ {
slot: 'address',
title: 'Address', title: 'Address',
description: 'Add your address here', description: 'Add your address here',
icon: 'i-lucide-house' icon: 'i-lucide-house'
}, { }, {
slot: 'shipping',
title: 'Shipping', title: 'Shipping',
description: 'Set your preferred shipping method', description: 'Set your preferred shipping method',
icon: 'i-lucide-truck' icon: 'i-lucide-truck'
}, { }, {
slot: 'checkout',
title: 'Checkout', title: 'Checkout',
description: 'Confirm your order' description: 'Confirm your order'
} }

View File

@@ -6,7 +6,8 @@ const items = [
label: 'app/', label: 'app/',
slot: 'app' as const, slot: 'app' as const,
defaultExpanded: true, defaultExpanded: true,
children: [{ children: [
{
label: 'composables/', label: 'composables/',
children: [ children: [
{ label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' }, { label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' },
@@ -20,7 +21,8 @@ const items = [
{ label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' } { label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' }
] ]
}] }
]
}, },
{ label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' } { label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' }

View File

@@ -5,7 +5,8 @@ const items: TreeItem[] = [
{ {
label: 'app/', label: 'app/',
value: 'app', value: 'app',
children: [{ children: [
{
label: 'composables/', label: 'composables/',
value: 'composables', value: 'composables',
children: [ children: [
@@ -20,7 +21,8 @@ const items: TreeItem[] = [
{ label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' } { label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' }
] ]
}] }
]
}, },
{ label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' } { label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' }

View File

@@ -5,7 +5,8 @@ const items: TreeItem[] = [
{ {
label: 'app/', label: 'app/',
defaultExpanded: true, defaultExpanded: true,
children: [{ children: [
{
label: 'composables/', label: 'composables/',
children: [ children: [
{ label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' }, { label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' },
@@ -19,7 +20,8 @@ const items: TreeItem[] = [
{ label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' } { label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' }
] ]
}] }
]
}, },
{ label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' } { label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' }

View File

@@ -8,7 +8,8 @@ const items: TreeItem[] = [
onSelect: (e: Event) => { onSelect: (e: Event) => {
e.preventDefault() e.preventDefault()
}, },
children: [{ children: [
{
label: 'composables/', label: 'composables/',
children: [ children: [
{ label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' }, { label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' },
@@ -22,7 +23,8 @@ const items: TreeItem[] = [
{ label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' } { label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' }
] ]
}] }
]
}, },
{ label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' } { label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' }

View File

@@ -8,7 +8,8 @@ const items: TreeItem[] = [
onToggle: (e: Event) => { onToggle: (e: Event) => {
e.preventDefault() e.preventDefault()
}, },
children: [{ children: [
{
label: 'composables/', label: 'composables/',
children: [ children: [
{ label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' }, { label: 'useAuth.ts', icon: 'i-vscode-icons-file-type-typescript' },
@@ -22,7 +23,8 @@ const items: TreeItem[] = [
{ label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'Card.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' } { label: 'Button.vue', icon: 'i-vscode-icons-file-type-vue' }
] ]
}] }
]
}, },
{ label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' }, { label: 'app.vue', icon: 'i-vscode-icons-file-type-vue' },
{ label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' } { label: 'nuxt.config.ts', icon: 'i-vscode-icons-file-type-nuxt' }