Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: integrate @nuxt/ui-pro #739

Merged
merged 154 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
993302c
docs: integrate `@nuxt/ui-pro`
benjamincanac Sep 22, 2023
27ddcc8
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 23, 2023
633a40c
up
benjamincanac Sep 23, 2023
ffee6d0
up
benjamincanac Sep 23, 2023
5a80952
up
benjamincanac Sep 23, 2023
b60049d
up
benjamincanac Sep 23, 2023
077f7ae
up
benjamincanac Sep 24, 2023
694ede2
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 24, 2023
8ddb705
up
benjamincanac Sep 24, 2023
55b4a8c
up
benjamincanac Sep 24, 2023
7bda5ad
up
benjamincanac Sep 24, 2023
3832032
up
benjamincanac Sep 25, 2023
604d49f
up
benjamincanac Sep 25, 2023
9f618ac
up
benjamincanac Sep 25, 2023
55a74b1
up
benjamincanac Sep 25, 2023
26617cb
up
benjamincanac Sep 25, 2023
2169056
up
benjamincanac Sep 25, 2023
0d65c8b
up
benjamincanac Sep 26, 2023
74f082b
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 26, 2023
b6d4a04
up
benjamincanac Sep 26, 2023
417d45f
up
benjamincanac Sep 27, 2023
691bded
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 27, 2023
3e62ce7
up
benjamincanac Sep 28, 2023
d299a81
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 28, 2023
d5ac53f
try `.vercel` top level symlink
pi0 Sep 28, 2023
66323cd
try with module
pi0 Sep 28, 2023
2b5acc8
improve module
pi0 Sep 28, 2023
b686707
up
benjamincanac Sep 28, 2023
4e52482
lint & typecheck
benjamincanac Sep 28, 2023
0570ffe
up
benjamincanac Sep 28, 2023
2264bdc
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 28, 2023
104e0c1
up
benjamincanac Sep 28, 2023
7d48380
try linking config only
pi0 Sep 28, 2023
349ebc8
up
benjamincanac Sep 29, 2023
dab39ce
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 29, 2023
17d8ba6
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 29, 2023
11bed9b
fix: github link in components
Flosciante Sep 29, 2023
8947422
up
benjamincanac Sep 29, 2023
7d7b150
add activate page
atinux Sep 29, 2023
372aea9
up
benjamincanac Sep 29, 2023
c6cd273
up
benjamincanac Sep 29, 2023
2e35339
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 29, 2023
d7523fa
up
benjamincanac Sep 29, 2023
920bc71
up
benjamincanac Sep 29, 2023
481e88b
Merge branch 'dev' into docs/ui-pro
benjamincanac Sep 29, 2023
6175bbb
up
benjamincanac Sep 29, 2023
1e2bb49
feat: activate pro license
atinux Sep 29, 2023
da1c790
up
atinux Sep 29, 2023
2eb4dfa
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 2, 2023
444c565
docs: remove `New` badges
benjamincanac Oct 2, 2023
d6412f9
docs: bump `@nuxt/ui-pro`
benjamincanac Oct 3, 2023
981a732
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 3, 2023
e4c23f3
docs: up
benjamincanac Oct 3, 2023
59a2435
docs: remove vercel module
benjamincanac Oct 3, 2023
495cf99
chore: add license_key detection from url
atinux Oct 3, 2023
1b51b49
docs(pro): update pro hero background
benjamincanac Oct 3, 2023
326a589
docs(pro): fix skip link
benjamincanac Oct 3, 2023
ccba95a
docs: enable `appManifest` for client-side route rules
benjamincanac Oct 3, 2023
1f45ca6
chore: up
atinux Oct 3, 2023
00f47d8
feat: new resizable component
Flosciante Oct 3, 2023
6a25469
up
benjamincanac Oct 3, 2023
2baaaeb
up
benjamincanac Oct 3, 2023
f720b5c
up
benjamincanac Oct 4, 2023
81ace3b
up
benjamincanac Oct 4, 2023
7397890
up
benjamincanac Oct 4, 2023
c520435
up
benjamincanac Oct 4, 2023
7f2f021
up
benjamincanac Oct 4, 2023
0804841
up
benjamincanac Oct 4, 2023
8718d77
up
benjamincanac Oct 4, 2023
dda10f2
up
benjamincanac Oct 4, 2023
a42edc0
up
benjamincanac Oct 4, 2023
4b84735
up
benjamincanac Oct 5, 2023
a27d6de
up
benjamincanac Oct 5, 2023
634e544
up
benjamincanac Oct 5, 2023
a642ccf
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 5, 2023
d268c8e
up
benjamincanac Oct 5, 2023
e66ad52
up
benjamincanac Oct 5, 2023
b661d4e
up
benjamincanac Oct 6, 2023
4b3ea5f
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 9, 2023
8b601e1
up
benjamincanac Oct 9, 2023
25587b4
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 9, 2023
a6994e9
pin c12 to 1.5.0 prerelease
pi0 Oct 9, 2023
c47d98b
fix type issue
pi0 Oct 9, 2023
07d5a8b
disable prettier on project
pi0 Oct 9, 2023
1a606b8
try to workaround ts limitation
pi0 Oct 9, 2023
7684451
disable prerender.failOnError
pi0 Oct 9, 2023
630b2f5
up
benjamincanac Oct 9, 2023
ea588e2
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 9, 2023
64953ff
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 10, 2023
a54a5ce
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 10, 2023
eeb6607
up
benjamincanac Oct 11, 2023
d64040f
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 12, 2023
0273375
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 12, 2023
24f975e
up
benjamincanac Oct 13, 2023
1657b29
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 15, 2023
9cbd493
up
benjamincanac Oct 17, 2023
3b20674
up
benjamincanac Oct 17, 2023
c5a95eb
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 17, 2023
045dced
up
benjamincanac Oct 17, 2023
8a64520
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 17, 2023
20dd4ea
up
benjamincanac Oct 18, 2023
c9699b9
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 18, 2023
9d24402
up
benjamincanac Oct 18, 2023
8481b53
up
benjamincanac Oct 19, 2023
2dbf4f6
up
benjamincanac Oct 19, 2023
7df8c17
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 19, 2023
232822c
up
benjamincanac Oct 19, 2023
bb2fec0
up
benjamincanac Oct 20, 2023
ff0135c
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 20, 2023
836587b
up
benjamincanac Oct 20, 2023
37578fd
up
benjamincanac Oct 20, 2023
8c6f75f
up
benjamincanac Oct 20, 2023
1a3222d
up
benjamincanac Oct 20, 2023
9acebb0
up
benjamincanac Oct 20, 2023
ae326fd
up
benjamincanac Oct 20, 2023
2d73931
up
benjamincanac Oct 23, 2023
adba315
up
benjamincanac Oct 24, 2023
a5d0f2e
up
benjamincanac Oct 24, 2023
c3d69e8
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 25, 2023
659bb38
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 25, 2023
12f3d31
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 25, 2023
36c071d
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 25, 2023
9e19e5f
up
benjamincanac Oct 26, 2023
e3b8c34
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 26, 2023
be3cb37
up
benjamincanac Oct 26, 2023
5d79072
up
benjamincanac Oct 26, 2023
f4db5e2
up
benjamincanac Oct 26, 2023
5194435
up
benjamincanac Oct 26, 2023
cd27222
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 26, 2023
00f353b
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 27, 2023
933c243
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 28, 2023
23c2f02
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 30, 2023
625355a
up
benjamincanac Oct 30, 2023
081bcc5
up
benjamincanac Oct 30, 2023
1b2b2f6
up
benjamincanac Oct 30, 2023
638fab0
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 31, 2023
d47bce0
up
benjamincanac Oct 31, 2023
c03a7e8
up
benjamincanac Oct 31, 2023
d7f6382
Merge branch 'dev' into docs/ui-pro
benjamincanac Oct 31, 2023
99bf1bf
up
benjamincanac Oct 31, 2023
ff2c0aa
fix
benjamincanac Oct 31, 2023
c59bc5c
up
benjamincanac Oct 31, 2023
2cb8c72
up
benjamincanac Oct 31, 2023
24d4f7e
bump
benjamincanac Nov 1, 2023
a96334f
up
benjamincanac Nov 1, 2023
76e5efc
up
benjamincanac Nov 1, 2023
d89c17a
up
benjamincanac Nov 2, 2023
709d7b4
Merge branch 'dev' into docs/ui-pro
benjamincanac Nov 2, 2023
d6767e9
docs: adapt footer depending on pro or not
atinux Nov 2, 2023
ddb2819
up
benjamincanac Nov 2, 2023
425967d
improve pro header
benjamincanac Nov 2, 2023
8322f2f
up
benjamincanac Nov 2, 2023
4bb87e2
up
benjamincanac Nov 2, 2023
3950419
up
benjamincanac Nov 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [18]

env:
NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }}

steps:
- uses: actions/setup-node@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
os: [ubuntu-latest] # macos-latest, windows-latest
node: [18]

env:
NUXT_GITHUB_TOKEN: ${{ secrets.NUXT_GITHUB_TOKEN }}

steps:
- uses: actions/setup-node@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"prettier.enable": false
}
8 changes: 5 additions & 3 deletions docs/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# To link Nuxt UI Pro in development
# Specify the path of @nuxt/ui-pro locally
NUXT_UI_PRO_PATH=
# To use Nuxt UI Pro in production
NUXT_UI_PRO_TOKEN=
# Production token for @nuxt/ui-pro, purchase on https://ui.nuxt.com/pro/purchase
NUXT_UI_PRO_LICENSE=
# Used when pre-rendering the docs for dynamic OG images
NUXT_PUBLIC_SITE_URL=
# Used to fetch `nuxt/ui-pro` docs content
NUXT_GITHUB_TOKEN=
67 changes: 61 additions & 6 deletions docs/app.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<div>
<Header />
<Header v-if="!$route.path.startsWith('/examples')" :links="links" />

<NuxtLayout>
<NuxtPage />
</NuxtLayout>

<Footer />
<Footer v-if="!$route.path.startsWith('/examples')" />

<ClientOnly>
<LazyUDocsSearch ref="searchRef" :files="files" :navigation="navigation" :groups="groups" />
<LazyUDocsSearch ref="searchRef" :files="files" :navigation="navigation" :groups="groups" :links="links" />
</ClientOnly>

<UNotifications>
Expand Down Expand Up @@ -42,10 +42,17 @@ const { data: files } = useLazyFetch<ParsedContent[]>('/api/search.json', { defa
// Computed

const navigation = computed(() => {
const main = nav.value.filter(item => item._path !== '/dev')
const dev = nav.value.find(item => item._path === '/dev')?.children
if (branch.value?.name === 'dev') {
const dev = nav.value.find(item => item._path === '/dev')?.children
const pro = nav.value.find(item => item._path === '/pro')

return [
pro,
...dev
]
}

return branch.value?.name === 'dev' ? dev : main
return nav.value.filter(item => item._path !== '/dev')
})

const groups = computed(() => {
Expand All @@ -58,6 +65,54 @@ const groups = computed(() => {

const color = computed(() => colorMode.value === 'dark' ? '#18181b' : 'white')

const links = computed(() => {
return [{
label: 'Documentation',
icon: 'i-heroicons-book-open',
to: `${branch.value?.name === 'dev' ? '/dev' : ''}/getting-started`
}, {
label: 'Playground',
icon: 'i-simple-icons-stackblitz',
to: '/playground'
}, {
label: 'Roadmap',
icon: 'i-heroicons-academic-cap',
to: '/roadmap'
}, {
label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d',
to: '/pro',
children: [{
label: 'Features',
to: '/pro#features',
exactHash: true,
icon: 'i-heroicons-beaker',
description: 'Discover all the features of Nuxt UI Pro.'
}, {
label: 'Pricing',
to: '/pro#pricing',
exactHash: true,
icon: 'i-heroicons-credit-card',
description: 'A simple pricing, for solo developers or teams.'
}, {
label: 'Guide',
to: '/pro/guide',
icon: 'i-heroicons-book-open',
description: 'Learn how to use Nuxt UI Pro in your app.'
}, {
label: 'Components',
to: '/pro/components',
icon: 'i-heroicons-cube-transparent',
description: 'Discover all the components available in Nuxt UI Pro.'
}]
}, {
label: 'Releases',
icon: 'i-heroicons-rocket-launch',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}]
})

// Watch

watch(() => searchRef.value?.commandPaletteRef?.query, debounce((query: string) => {
Expand Down
20 changes: 7 additions & 13 deletions docs/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<template>
<div v-if="$route.path !== '/playground'" class="w-full h-px bg-gray-200 dark:bg-gray-800 flex items-center justify-center">
<div class="bg-white dark:bg-gray-900 px-4">
<div class="w-full h-px bg-gray-200 dark:bg-gray-800 flex items-center justify-center">
<div v-if="!['/playground', '/roadmap'].includes($route.path)" class="bg-white dark:bg-gray-900 px-4">
<LogoOnly class="w-5 h-5" />
</div>
</div>

<UFooter :links="[]" :ui="{ bottom: { container: 'lg:py-4' } }">
<UFooter>
<template #left>
<div class="text-sm text-gray-500 dark:text-gray-400">
Made by
<NuxtLink to="https://nuxtlabs.com" aria-label="NuxtLabs" class="inline-block">
<LogoLabs class="text-gray-900 dark:text-white h-4 w-auto" />
</NuxtLink>
</div>
</template>

<template #center>
<span class="text-sm text-gray-500 dark:text-gray-400">
<a v-if="$route.path.startsWith('/pro')" class="text-sm text-gray-500 dark:text-gray-400 hover:underline" href="https://ui.nuxt.com/pro/purchase" target="_blank">
Purchase Nuxt UI Pro
</a>
<span v-else class="text-sm text-gray-500 dark:text-gray-400">
Published under <NuxtLink to="https://github.com/nuxt/ui" target="_blank" class="text-gray-900 dark:text-white">
MIT License
</NuxtLink>
Expand Down
45 changes: 19 additions & 26 deletions docs/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,42 +31,35 @@
</template>

<template #panel>
<BranchSelect />
<UAsideLinks :links="links" />

<UNavigationTree :links="mapContentNavigation(navigation)" />
<UDivider type="dashed" class="mt-4 mb-3" />

<BranchSelect v-if="!route.path.startsWith('/pro')" />

<UNavigationTree :links="mapContentNavigation(navigation)" :multiple="false" default-open />
</template>
</UHeader>
</template>

<script setup lang="ts">
import type { NavItem } from '@nuxt/content/dist/runtime/types'
import type { Link } from '#ui-pro/types'

defineProps<{
links: Link[]
}>()

const route = useRoute()
const { metaSymbol } = useShortcuts()

const navigation = inject<Ref<NavItem[]>>('navigation')
const nav = inject<Ref<NavItem[]>>('navigation')

const navigation = computed(() => {
if (route.path.startsWith('/pro')) {
return nav.value.find(item => item._path === '/pro')?.children
}

const links = computed(() => {
return [{
label: 'Documentation',
icon: 'i-heroicons-book-open-solid',
to: '/getting-started'
}, {
label: 'Examples',
icon: 'i-heroicons-square-3-stack-3d',
to: '/getting-started/examples'
}, {
label: 'Playground',
icon: 'i-simple-icons-stackblitz',
to: '/playground'
}, {
label: 'Pro',
icon: 'i-heroicons-square-3-stack-3d',
to: '/pro'
}, {
label: 'Releases',
icon: 'i-heroicons-rocket-launch-solid',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
}]
return nav.value.filter(item => !item._path.startsWith('/pro'))
})
</script>
24 changes: 17 additions & 7 deletions docs/components/content/ComponentCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
</div>
</div>

<div class="flex border border-b-0 border-gray-200 dark:border-gray-700 relative not-prose" :class="[{ 'p-4': padding }, propsToSelect.length ? 'border-t-0' : 'rounded-t-md', backgroundClass, overflowClass]">
<component :is="name" v-model="vModel" v-bind="fullProps">
<div class="flex border border-b-0 border-gray-200 dark:border-gray-700 relative not-prose" :class="[{ 'p-4': padding }, propsToSelect.length ? 'border-t-0' : 'rounded-t-md', backgroundClass, extraClass]">
<component :is="name" v-model="vModel" v-bind="fullProps" :class="componentClass">
<ContentSlot v-if="$slots.default" :use="$slots.default" />

<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
Expand Down Expand Up @@ -99,13 +99,17 @@ const props = defineProps({
type: String,
default: 'bg-white dark:bg-gray-900'
},
overflowClass: {
extraClass: {
type: String,
default: ''
},
previewOnly: {
type: Boolean,
default: false
},
componentClass: {
type: String,
default: ''
}
})

Expand All @@ -116,10 +120,16 @@ const componentProps = reactive({ ...props.props })
const { $prettier } = useNuxtApp()
const appConfig = useAppConfig()
const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[route.params.slug.length - 1]
const camelName = camelCase(slug)
const name = `U${upperFirst(camelName)}`

let name = props.slug || `U${upperFirst(camelCase(route.params.slug[route.params.slug.length - 1]))}`

// TODO: Remove once merged on `main` branch
if (['AvatarGroup', 'ButtonGroup', 'MeterGroup'].includes(name)) {
name = `U${name}`
}
if (['avatar-group', 'button-group', 'radio'].includes(name)) {
name = `U${upperFirst(camelCase(name))}`
}

const meta = await fetchComponentMeta(name)

Expand Down
32 changes: 27 additions & 5 deletions docs/components/content/ComponentExample.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<template>
<div class="[&>div>pre]:!rounded-t-none [&>div>pre]:!mt-0">
<div
class="flex border border-gray-200 dark:border-gray-700 relative not-prose rounded-t-md"
:class="[{ 'p-4': padding, 'rounded-b-md': !hasCode, 'border-b-0': hasCode }, backgroundClass, overflowClass]"
class="flex border border-gray-200 dark:border-gray-700 relative rounded-t-md"
:class="[{ 'p-4': padding, 'rounded-b-md': !hasCode, 'border-b-0': hasCode, 'not-prose': !prose }, backgroundClass, extraClass]"
>
<component :is="camelName" v-if="component" v-bind="componentProps" />
<template v-if="component">
<iframe v-if="iframe" :src="`/examples/${component}`" v-bind="iframeProps" :class="backgroundClass" class="w-full" />
<component :is="camelName" v-else v-bind="componentProps" :class="componentClass" />
</template>

<ContentSlot v-if="$slots.default" :use="$slots.default" />
</div>
<template v-if="hasCode">
Expand Down Expand Up @@ -43,18 +47,36 @@ const props = defineProps({
type: Boolean,
default: true
},
prose: {
type: Boolean,
default: false
},
iframe: {
type: Boolean,
default: false
},
iframeProps: {
type: Object,
default: () => ({})
},
backgroundClass: {
type: String,
default: 'bg-white dark:bg-gray-900'
},
overflowClass: {
extraClass: {
type: String,
default: ''
}
})

let component = props.component
// TODO: Remove once merged on `main` branch
if (['command-palette-theme-algolia', 'command-palette-theme-raycast', 'vertical-navigation-theme-tailwind', 'pagination-theme-rounded'].includes(component)) {
component = component.replace('-theme', '-example-theme')
}

const instance = getCurrentInstance()
const camelName = camelCase(props.component)
const camelName = camelCase(component)
const data = await fetchContentExampleCode(camelName)

const hasCode = computed(() => !props.hiddenCode && (data?.code || instance.slots.code))
Expand Down
14 changes: 10 additions & 4 deletions docs/components/content/ComponentProps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ const props = defineProps({
})

const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[route.params.slug.length - 1]
const camelName = camelCase(slug)
const name = `U${upperFirst(camelName)}`

let name = props.slug || `U${upperFirst(camelCase(route.params.slug[route.params.slug.length - 1]))}`

// TODO: Remove once merged on `main` branch
if (['AvatarGroup', 'ButtonGroup', 'MeterGroup'].includes(name)) {
name = `U${name}`
}
if (['avatar-group', 'button-group', 'radio'].includes(name)) {
name = `U${upperFirst(camelCase(name))}`
}

const meta = await fetchComponentMeta(name)
</script>
9 changes: 6 additions & 3 deletions docs/components/content/ComponentPropsField.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<template>
<Field v-bind="prop">
<code v-if="prop.default">{{ prop.default }}</code>
<p v-if="prop.description">
{{ prop.description }}
</p>

<Collapsible v-if="prop.schema?.kind === 'array' && prop.schema?.schema?.filter(schema => schema.kind === 'object').length">
<FieldGroup v-for="schema in prop.schema.schema" :key="schema.name" class="!mt-0">
<FieldGroup v-for="schema in prop.schema.schema" :key="schema.name">
<ComponentPropsField v-for="subProp in Object.values(schema.schema)" :key="(subProp as any).name" :prop="subProp" />
</FieldGroup>
</Collapsible>
<Collapsible v-else-if="prop.schema?.kind === 'array' && prop.schema?.schema?.filter(schema => schema.kind === 'array').length">
<FieldGroup v-for="schema in prop.schema.schema" :key="schema.name" class="!mt-0">
<FieldGroup v-for="schema in prop.schema.schema" :key="schema.name">
<template v-for="subSchema in schema.schema" :key="subSchema.name">
<ComponentPropsField v-for="subProp in Object.values(subSchema.schema)" :key="(subProp as any).name" :prop="subProp" />
</template>
</FieldGroup>
</Collapsible>
<Collapsible v-else-if="prop.schema?.kind === 'object' && prop.schema.type !== 'Function' && Object.values(prop.schema.schema)?.length">
<FieldGroup class="!mt-0">
<FieldGroup>
<ComponentPropsField v-for="subProp in Object.values(prop.schema.schema)" :key="(subProp as any).name" :prop="subProp" />
</FieldGroup>
</Collapsible>
Expand Down
Loading
Loading