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(app): enable support for @nuxt/ui-pro with vue #3191

Draft
wants to merge 34 commits into
base: v3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7c16151
feat(docs): Support UI Pro with Vue
HugoRCD Jan 28, 2025
cd4aa55
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 28, 2025
2c056d5
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 28, 2025
ff7f622
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 28, 2025
5cda951
fix(NavigationMenu): remove negative mb causing overflow issues
benjamincanac Jan 29, 2025
f210e8c
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 29, 2025
894d1f8
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 30, 2025
380fa25
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Jan 30, 2025
becee2d
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 1, 2025
7c471e8
up
HugoRCD Feb 1, 2025
698f07b
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 1, 2025
c62f960
Merge branch 'v3' into feat/ui-pro-vue-support
HugoRCD Feb 3, 2025
d1a4886
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 3, 2025
333e72d
chore(package): export utils
benjamincanac Feb 4, 2025
1ab9719
chore(deps): update all non-major dependencies (v3) (#3231)
renovate[bot] Feb 4, 2025
560d4c5
fix(types): export `utils`
benjamincanac Feb 4, 2025
5364e2f
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 4, 2025
0a081f1
chore(package): export `utils`
benjamincanac Feb 4, 2025
5d9008d
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 4, 2025
6feaa79
chore(build.config): set `#build/app.config` as external
benjamincanac Feb 4, 2025
c0ebc87
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 4, 2025
e15859d
remove useless export
HugoRCD Feb 4, 2025
8399b14
chore(package): export `utils`
benjamincanac Feb 4, 2025
aa74a4f
chore(templates): import from `@nuxt/ui`
benjamincanac Feb 4, 2025
8aaedf8
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 4, 2025
7fbc55a
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 4, 2025
fbbf32a
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 5, 2025
6f64503
ComponentTheme vue support
HugoRCD Feb 5, 2025
e10ca5f
up
HugoRCD Feb 5, 2025
9bf4e5a
up
HugoRCD Feb 5, 2025
d9ffc1a
up
HugoRCD Feb 5, 2025
082b18f
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 5, 2025
87dc671
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 6, 2025
a8c95e6
Merge remote-tracking branch 'origin/v3' into feat/ui-pro-vue-support
HugoRCD Feb 6, 2025
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
2 changes: 1 addition & 1 deletion build.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ export default defineBuildConfig({
options.addRelativeDeclarationExtensions = false
}
},
externals: ['#build/ui', 'vite']
externals: ['#build/ui', '#build/app.config', 'vite']
})
4 changes: 2 additions & 2 deletions docs/app/components/content/ComponentTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ export default defineAppConfig(${json5.stringify(component.value, null, 2).repla
\`\`\`ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
import ${props.pro ? 'uiPro' : 'ui'} from '${props.pro ? '@nuxt/ui-pro/vite' : '@nuxt/ui/vite'}'

export default defineConfig({
plugins: [
vue(),
ui(${json5.stringify(component.value, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')
${props.pro ? 'uiPro' : 'ui'}(${json5.stringify(component.value, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')
.split('\n')
.map((line, i) => i === 0 ? line : ` ${line}`)
.join('\n')})
Expand Down
2 changes: 0 additions & 2 deletions docs/app/composables/useSharedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function useSharedData() {
label: 'Vue',
icon: 'i-simple-icons-vuedotjs',
value: 'vue',
disabled: module.value === 'ui-pro',
onSelect: () => {
if (module.value === 'ui-pro') {
return
Expand All @@ -29,7 +28,6 @@ export function useSharedData() {
label: 'UI Pro',
icon: 'i-lucide-panels-top-left',
value: 'ui-pro',
disabled: framework.value === 'vue',
onSelect: () => {
if (framework.value === 'vue') {
return
Expand Down
90 changes: 88 additions & 2 deletions docs/content/1.getting-started/3.theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ export default defineAppConfig({
::

#vue
::div
::module-only
#ui
:::div
You can configure these color aliases at runtime in your `vite.config.ts` file under the `ui.colors` key:

```ts [vite.config.ts]
Expand All @@ -176,6 +178,29 @@ export default defineConfig({
]
})
```
:::

#ui-pro
:::div
You can configure these color aliases at runtime in your `vite.config.ts` file under the `uiPro.colors` key:
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'

export default defineConfig({
plugins: [
vue(),
uiPro({
colors: {
primary: 'blue',
neutral: 'zinc'
}
})
]
})
```
:::

::

Expand Down Expand Up @@ -224,6 +249,8 @@ export default defineNuxtConfig({
:::

#vue
::module-only
#ui
:::tip
You can add you own dynamic color aliases in your `vite.config.ts`, you just have to make sure to also define them in the [`theme.colors`](/getting-started/installation/vue#themecolors) option of the `ui` plugin.

Expand All @@ -250,6 +277,34 @@ export default defineConfig({
```

:::

#ui-pro
:::tip
You can add you own dynamic color aliases in your `vite.config.ts`, you just have to make sure to also define them in the [`theme.colors`](/getting-started/installation/vue#themecolors) option of the `uiPro` plugin.

```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'

export default defineConfig({
plugins: [
vue(),
uiPro({
colors: {
tertiary: 'indigo'
},
uiPro: {
colors: ['primary', 'secondary', 'tertiary', 'info', 'success', 'warning', 'error']
}
})
]
})
```

:::

::
::

### Tokens
Expand Down Expand Up @@ -783,7 +838,10 @@ export default defineAppConfig({
::

#vue
::div

::module-only
#ui
:::div
You can override the theme of components globally inside your `vite.config.ts` by using the exact same structure as the theme object.

Let's say you want to change the font weight of all your buttons, you can do it like this:
Expand All @@ -808,7 +866,35 @@ export default defineConfig({
]
})
```
:::

#ui-pro
:::div
You can override the theme of components globally inside your `vite.config.ts` by using the exact same structure as the theme object.

Let's say you want to change the font weight of all your buttons, you can do it like this:

```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'

export default defineConfig({
plugins: [
vue(),
uiPro({
uiPro: {
button: {
slots: {
base: 'font-bold'
}
}
}
})
]
})
```
:::
::

::
Expand Down
24 changes: 24 additions & 0 deletions docs/content/1.getting-started/6.color-mode/2.vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const mode = useColorMode()

You can disable this plugin with the `colorMode` option in your `vite.config.ts`:

::module-only
#ui
:::div
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
Expand All @@ -45,3 +48,24 @@ export default defineConfig({
]
})
```

:::

#ui-pro
:::div
```ts [vite.config.ts]
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import uiPro from '@nuxt/ui-pro/vite'

export default defineConfig({
plugins: [
vue(),
uiPro({
colorMode: false
})
]
})
```
:::
::
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
},
"imports": {
"#build/ui/*": "./.nuxt/ui/*.ts",
"#build/ui.css": "./.nuxt/ui.css"
"#build/ui.css": "./.nuxt/ui.css",
"#build/app.config": "./.nuxt/app.config.mjs"
},
"bin": {
"nuxt-ui": "./cli/index.mjs"
Expand Down