Skip to content

Commit 8e511c3

Browse files
feat: import @nuxt/ui-pro components (#4675)
Co-authored-by: Hugo Richard <[email protected]>
1 parent f1d79b7 commit 8e511c3

File tree

761 files changed

+64523
-5080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

761 files changed

+64523
-5080
lines changed

.github/workflows/module.yml

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -205,58 +205,3 @@ jobs:
205205

206206
- name: Build
207207
run: pnpm run build
208-
209-
nuxt-ui-pro:
210-
needs: build
211-
212-
# Only run this job if not a fork PR (when push event or PR from same repo)
213-
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
214-
215-
runs-on: ${{ matrix.os }}
216-
217-
permissions:
218-
contents: read
219-
pull-requests: read
220-
221-
strategy:
222-
matrix:
223-
os: [ubuntu-latest] # macos-latest, windows-latest
224-
node: [22]
225-
226-
env:
227-
NUXT_UI_PRO_LICENSE: ${{ secrets.NUXT_UI_PRO_LICENSE }}
228-
229-
steps:
230-
- name: Checkout
231-
uses: actions/checkout@v5
232-
with:
233-
repository: nuxt/ui-pro
234-
token: ${{ secrets.NUXT_GITHUB_TOKEN }}
235-
236-
- name: Store commit SHA
237-
run: |
238-
echo "COMMIT_SHA=$(echo ${{ github.event.pull_request.head.sha || github.sha }} | cut -c1-7)" >> $GITHUB_ENV
239-
240-
- name: Install pnpm
241-
uses: pnpm/action-setup@v4
242-
243-
- name: Install node
244-
uses: actions/setup-node@v4
245-
with:
246-
node-version: 22
247-
cache: pnpm
248-
249-
- name: Install latest nuxt/ui
250-
run: pnpm install https://pkg.pr.new/@nuxt/ui@${{ env.COMMIT_SHA }} --lockfile-only
251-
252-
- name: Install dependencies
253-
run: pnpm install
254-
255-
- name: Prepare
256-
run: pnpm run dev:prepare
257-
258-
- name: Typecheck
259-
run: pnpm run typecheck
260-
261-
- name: Build
262-
run: pnpm run build

.nuxtrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
experimental.normalizeComponentNames=false
2+
modules[]=@nuxt/content

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ Nuxt UI harnesses the combined strengths of [Reka UI](https://reka-ui.com/), [Ta
1616
> [!NOTE]
1717
> You are on the `v4` development branch, check out the [v2 branch](https://github.com/nuxt/ui/tree/v2) for Nuxt UI v2.
1818
19-
> [!TIP]
20-
> **Looking for more components ?**
21-
> Check out [Nuxt UI Pro](https://ui.nuxt.com/pro), a collection of premium Vue components, composables, and utilities built on top of Nuxt UI for faster and more powerful app development.
22-
2319
## Documentation
2420

2521
Visit https://ui.nuxt.com to explore the documentation.
@@ -59,7 +55,7 @@ export default defineNuxtConfig({
5955
@import "@nuxt/ui";
6056
```
6157

62-
Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/nuxt).
58+
Learn more in the [installation guide](https://ui.nuxt.com/docs/getting-started/installation/nuxt).
6359

6460
### Vue
6561

@@ -106,18 +102,18 @@ app.mount('#app')
106102
@import "@nuxt/ui";
107103
```
108104

109-
Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/vue).
105+
Learn more in the [installation guide](https://ui.nuxt.com/docs/getting-started/installation/vue).
110106

111107
## Contribution
112108

113109
Thank you for considering contributing to Nuxt UI. Here are a few ways you can get involved:
114110

115111
- Reporting Bugs: If you come across any bugs or issues, please check out the reporting bugs guide to learn how to submit a bug report.
116-
- Suggestions: Have any thoughts to enhance Nuxt UI? We'd love to hear them! Check out the [contribution guide](https://ui.nuxt.com/getting-started/contribution) to share your suggestions.
112+
- Suggestions: Have any thoughts to enhance Nuxt UI? We'd love to hear them! Check out the [contribution guide](https://ui.nuxt.com/docs/getting-started/contribution) to share your suggestions.
117113

118114
## Local Development
119115

120-
Follow the docs to [set up your local development environment](https://ui.nuxt.com/getting-started/contribution#local-development) and contribute.
116+
Follow the docs to [set up your local development environment](https://ui.nuxt.com/docs/getting-started/contribution#local-development) and contribute.
121117

122118
## Credits
123119

cli/commands/make/component.mjs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,13 @@ export default defineCommand({
2121
type: 'boolean',
2222
description: 'Create a primitive component.'
2323
},
24-
pro: {
25-
type: 'boolean',
26-
description: 'Create a pro component.'
27-
},
2824
prose: {
2925
type: 'boolean',
30-
description: 'Create a prose component (with --pro).'
26+
description: 'Create a prose component.'
3127
},
3228
content: {
3329
type: 'boolean',
34-
description: 'Create a content component (with --pro).'
30+
description: 'Create a content component.'
3531
},
3632
template: {
3733
type: 'string',
@@ -45,15 +41,6 @@ export default defineCommand({
4541
process.exit(1)
4642
}
4743

48-
if (args.prose && !args.pro) {
49-
consola.error('`--prose` flag can only be used with `--pro` flag!')
50-
process.exit(1)
51-
}
52-
if (args.content && !args.pro) {
53-
consola.error('`--content` flag can only be used with `--pro` flag!')
54-
process.exit(1)
55-
}
56-
5744
const path = resolve('.')
5845

5946
for (const template of Object.keys(templates)) {

cli/templates.mjs

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
22

3-
const playground = ({ name, pro }) => {
3+
const playground = ({ name }) => {
44
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
55
const kebabName = kebabCase(name)
66

77
return {
88
filename: `playgrounds/nuxt/app/pages/components/${kebabName}.vue`,
9-
contents: pro
10-
? undefined
11-
: `
9+
contents: `
1210
<template>
1311
<div>
1412
<U${upperName} />
@@ -18,24 +16,21 @@ const playground = ({ name, pro }) => {
1816
}
1917
}
2018

21-
const component = ({ name, primitive, pro, prose, content }) => {
19+
const component = ({ name, primitive, prose, content }) => {
2220
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
2321
const camelName = camelCase(name)
2422
const kebabName = kebabCase(name)
25-
const key = pro ? 'uiPro' : 'ui'
26-
const path = pro ? 'ui-pro' : 'ui'
2723

2824
return {
2925
filename: `src/runtime/components/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${upperName}.vue`,
3026
contents: primitive
3127
? `
3228
<script lang="ts">
3329
import type { AppConfig } from '@nuxt/schema'
34-
${pro ? `import type { ComponentConfig } from '@nuxt/ui'` : ''}
35-
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
36-
${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
30+
import theme from '#build/ui/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
31+
import type { ComponentConfig } from '../types/tv'
3732
38-
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'${pro ? `, '${key}'` : ''}>
33+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
3934
4035
export interface ${upperName}Props {
4136
/**
@@ -63,7 +58,7 @@ defineSlots<${upperName}Slots>()
6358
6459
const appConfig = useAppConfig() as ${upperName}['AppConfig']
6560
66-
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.${pro ? 'uiPro' : 'ui'}?.${camelName} || {}) })())
61+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
6762
</script>
6863
6964
<template>
@@ -76,11 +71,10 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.${pro ? 'uiPro'
7671
<script lang="ts">
7772
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
7873
import type { AppConfig } from '@nuxt/schema'
79-
${pro ? `import type { ComponentConfig } from '@nuxt/ui'` : ''}
80-
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
81-
${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
74+
import theme from '#build/ui/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
75+
import type { ComponentConfig } from '../types/tv'
8276
83-
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'${pro ? `, '${key}'` : ''}>
77+
type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
8478
8579
export interface ${upperName}Props extends Pick<${upperName}RootProps> {
8680
class?: any
@@ -107,7 +101,7 @@ const appConfig = useAppConfig() as ${upperName}['AppConfig']
107101
108102
const rootProps = useForwardPropsEmits(reactivePick(props), emits)
109103
110-
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.${pro ? 'uiPro' : 'ui'}?.${camelName} || {}) })())
104+
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
111105
</script>
112106
113107
<template>
@@ -168,18 +162,15 @@ describe('${upperName}', () => {
168162
}
169163
}
170164

171-
const docs = ({ name, pro, primitive }) => {
165+
const docs = ({ name, primitive }) => {
172166
const kebabName = kebabCase(name)
173167
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
174168

175169
return {
176170
filename: `docs/content/3.components/${kebabName}.md`,
177171
contents: `---
178172
title: ${upperName}
179-
description: ''${pro
180-
? `
181-
module: ui-pro`
182-
: ''}
173+
description: ''
183174
links:${primitive
184175
? ''
185176
: `
@@ -188,7 +179,7 @@ links:${primitive
188179
to: https://reka-ui.com/docs/components/${kebabName}`}
189180
- label: GitHub
190181
icon: i-simple-icons-github
191-
to: https://github.com/nuxt/${pro ? 'ui-pro' : 'ui'}/tree/v4/src/runtime/components/${upperName}.vue
182+
to: https://github.com/nuxt/ui/blob/v4/src/runtime/components/${upperName}.vue
192183
navigation.badge: Soon
193184
---
194185
@@ -200,19 +191,19 @@ navigation.badge: Soon
200191
201192
### Props
202193
203-
:component-props${pro ? '{pro}' : ''}
194+
:component-props
204195
205196
### Slots
206197
207-
:component-slots${pro ? '{pro}' : ''}
198+
:component-slots
208199
209200
### Emits
210201
211-
:component-emits${pro ? '{pro}' : ''}
202+
:component-emits
212203
213204
## Theme
214205
215-
:component-theme${pro ? '{pro}' : ''}
206+
:component-theme
216207
217208
## Changelog
218209

docs/.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# Specify the path of @nuxt/ui-pro locally
2-
NUXT_UI_PRO_PATH=
3-
# Production token for @nuxt/ui-pro, purchase on https://ui.nuxt.com/pro/purchase
4-
NUXT_UI_PRO_LICENSE=
51
# Used when pre-rendering the docs for dynamic OG images
62
NUXT_PUBLIC_SITE_URL=
73
# Used to fetch `nuxt/ui-pro` docs content

docs/app/app.vue

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ const route = useRoute()
66
const appConfig = useAppConfig()
77
const colorMode = useColorMode()
88
9-
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content', ['framework', 'module']))
10-
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('content'), {
9+
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('docs', ['framework', 'category']))
10+
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('docs'), {
1111
server: false
1212
})
1313
14-
const links = useLinks()
14+
const links = useHeaderLinks()
1515
const searchLinks = useSearchLinks()
1616
const color = computed(() => colorMode.value === 'dark' ? (colors as any)[appConfig.ui.colors.neutral][900] : 'white')
1717
const radius = computed(() => `:root { --ui-radius: ${appConfig.theme.radius}rem; }`)
@@ -42,7 +42,7 @@ useServerSeoMeta({
4242
4343
useFaviconFromTheme()
4444
45-
const { frameworks, modules } = useSharedData()
45+
const { frameworks } = useSharedData()
4646
const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation)
4747
4848
provide('navigation', mappedNavigation)
@@ -52,40 +52,44 @@ provide('navigation', mappedNavigation)
5252
<UApp :toaster="appConfig.toaster">
5353
<NuxtLoadingIndicator color="var(--ui-primary)" :height="2" />
5454

55-
<template v-if="!route.path.startsWith('/examples')">
56-
<Banner />
57-
58-
<Header :links="links" />
59-
</template>
60-
61-
<NuxtLayout>
62-
<NuxtPage />
63-
</NuxtLayout>
64-
65-
<template v-if="!route.path.startsWith('/examples')">
66-
<Footer />
67-
68-
<ClientOnly>
69-
<LazyUContentSearch
70-
:links="searchLinks"
71-
:files="files"
72-
:groups="[{
73-
id: 'framework',
74-
label: 'Framework',
75-
items: frameworks
76-
}, {
77-
id: 'module',
78-
label: 'Module',
79-
items: modules
80-
}]"
81-
:navigation="filteredNavigation"
82-
:fuse="{ resultLimit: 100 }"
83-
/>
84-
</ClientOnly>
85-
</template>
55+
<div :class="[route.path.startsWith('/docs/') && 'root']">
56+
<template v-if="!route.path.startsWith('/examples')">
57+
<Banner />
58+
59+
<Header :links="links" />
60+
</template>
61+
62+
<NuxtLayout>
63+
<NuxtPage />
64+
</NuxtLayout>
65+
66+
<template v-if="!route.path.startsWith('/examples')">
67+
<Footer />
68+
69+
<ClientOnly>
70+
<LazyUContentSearch
71+
:links="searchLinks"
72+
:files="files"
73+
:groups="[{
74+
id: 'framework',
75+
label: 'Framework',
76+
items: frameworks
77+
}]"
78+
:navigation="filteredNavigation"
79+
:fuse="{ resultLimit: 120 }"
80+
/>
81+
</ClientOnly>
82+
</template>
83+
</div>
8684
</UApp>
8785
</template>
8886

8987
<style>
9088
/* Safelist (do not remove): [&>div]:*:my-0 [&>div]:*:w-full h-64 !px-0 !py-0 !pt-0 !pb-0 !p-0 !justify-start !justify-end !min-h-96 h-136 max-h-[341px] */
89+
90+
@media (min-width: 1024px) {
91+
.root {
92+
--ui-header-height: 113px;
93+
}
94+
}
9195
</style>

0 commit comments

Comments
 (0)