mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 12:39:35 +01:00
Compare commits
70 Commits
docs/prere
...
v3.0.0-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
83c2b70d98 | ||
|
|
3b9ca2263d | ||
|
|
6636543256 | ||
|
|
f98b91c22a | ||
|
|
857238ff14 | ||
|
|
8b5d412fd7 | ||
|
|
ed44d9d101 | ||
|
|
5a900e460b | ||
|
|
4b241ba3c3 | ||
|
|
80befc107c | ||
|
|
6c946dc0e7 | ||
|
|
2d81c02356 | ||
|
|
d3b3b9bef3 | ||
|
|
b7ba2c7759 | ||
|
|
198d04de51 | ||
|
|
16e0339e7a | ||
|
|
6f1f9f4d81 | ||
|
|
46f4e5a24d | ||
|
|
b983ea2aec | ||
|
|
bd4abfa880 | ||
|
|
c1ff978370 | ||
|
|
984bb0899c | ||
|
|
a938d24f90 | ||
|
|
0f8c398673 | ||
|
|
695224f91f | ||
|
|
4b653ef773 | ||
|
|
816bb69deb | ||
|
|
5a7c3b13d3 | ||
|
|
b741ef3313 | ||
|
|
bc80a0121f | ||
|
|
e475b6438d | ||
|
|
3e283117d2 | ||
|
|
6484d010a1 | ||
|
|
d539109357 | ||
|
|
01c3934403 | ||
|
|
e79103131f | ||
|
|
37f05e2ba8 | ||
|
|
81ac076219 | ||
|
|
c440c91a29 | ||
|
|
b7ff7d8aa6 | ||
|
|
68a10f09d5 | ||
|
|
004a577467 | ||
|
|
f712135576 | ||
|
|
e2aaf5ba21 | ||
|
|
d65c7376d9 | ||
|
|
f04c2082ad | ||
|
|
bda6098db3 | ||
|
|
8344d852a5 | ||
|
|
6bd8a06871 | ||
|
|
148b02464d | ||
|
|
1240a3b604 | ||
|
|
e3b8d0e60e | ||
|
|
0d41210c91 | ||
|
|
bc2bcb30d9 | ||
|
|
ed2722257a | ||
|
|
f06fbafc1e | ||
|
|
ecc4755a17 | ||
|
|
9b58ce05f0 | ||
|
|
a481410c5f | ||
|
|
cd7ab3b2b9 | ||
|
|
9a17f90985 | ||
|
|
3496b2d541 | ||
|
|
a6c22052e1 | ||
|
|
6eb0bbbe1b | ||
|
|
a2512f680d | ||
|
|
4eb79021ed | ||
|
|
8a45c25df3 | ||
|
|
004fa1ebcb | ||
|
|
0f648024e0 | ||
|
|
e7995e7a0b |
54
CHANGELOG.md
54
CHANGELOG.md
@@ -1,5 +1,59 @@
|
||||
# Changelog
|
||||
|
||||
## [3.0.0-alpha.10](https://github.com/nuxt/ui/compare/v3.0.0-alpha.9...v3.0.0-alpha.10) (2024-12-09)
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* **module:** migrate to `reka-ui` (#2448)
|
||||
* **Form:** resolve async validation in yup & issue directly mutate state (#2702)
|
||||
|
||||
### Features
|
||||
|
||||
* **Avatar:** add `default` slot for fallback ([b741ef3](https://github.com/nuxt/ui/commit/b741ef3313bb894beaed0eaa7323ee3d951bf935))
|
||||
* **Calendar:** add `icon` props ([#2778](https://github.com/nuxt/ui/issues/2778)) ([0f64802](https://github.com/nuxt/ui/commit/0f648024e0468d34c1499bb5b5d2ed32e0e7de4f))
|
||||
* **Calendar:** implement component ([#2618](https://github.com/nuxt/ui/issues/2618)) ([2e9aeb5](https://github.com/nuxt/ui/commit/2e9aeb5f05e94d63ea453c4f07a3e84ee2a02773))
|
||||
* **ColorPicker:** implement component ([#2670](https://github.com/nuxt/ui/issues/2670)) ([e475b64](https://github.com/nuxt/ui/commit/e475b6438d405e4695ffb19155d456534d16b897))
|
||||
* **CommandPalette:** add `active` field on items for consistency ([3765537](https://github.com/nuxt/ui/commit/37655377e9675982e2fce422bdd79ea651424548))
|
||||
* **css:** use `color-scheme` utilities on body ([a2512f6](https://github.com/nuxt/ui/commit/a2512f680dc0df7add48bc17ef3be30d579be782))
|
||||
* **i18n:** add Dutch locale ([#2728](https://github.com/nuxt/ui/issues/2728)) ([3baddfd](https://github.com/nuxt/ui/commit/3baddfd12186a68cc302f31cf0934cb9cf48060d))
|
||||
* **i18n:** add Turkish locale ([#2716](https://github.com/nuxt/ui/issues/2716)) ([de8228e](https://github.com/nuxt/ui/commit/de8228e504affd1a57106101f5168a33702d4d53))
|
||||
* **locale:** add Brazilian Portuguese language ([#2825](https://github.com/nuxt/ui/issues/2825)) ([b7ff7d8](https://github.com/nuxt/ui/commit/b7ff7d8aa63c41cf7afbecaa31824e098ea291af))
|
||||
* **locale:** add Japanese language ([#2794](https://github.com/nuxt/ui/issues/2794)) ([ecc4755](https://github.com/nuxt/ui/commit/ecc4755a17874e59e06e70307a40dfd3fb3f20a0))
|
||||
* **locale:** add Portuguese language ([#2855](https://github.com/nuxt/ui/issues/2855)) ([8b5d412](https://github.com/nuxt/ui/commit/8b5d412fd70b14a53cffa9129f5edd8a40e0f2e8))
|
||||
* **locale:** add Slovak language ([#2821](https://github.com/nuxt/ui/issues/2821)) ([68a10f0](https://github.com/nuxt/ui/commit/68a10f09d5f164f2f5f07e65297e29fa2d939425))
|
||||
* **locale:** translate Korean ([#2703](https://github.com/nuxt/ui/issues/2703)) ([2cbf83e](https://github.com/nuxt/ui/commit/2cbf83eb8484ad9abebd6ca01ad344918570af5b))
|
||||
* **module:** migrate to `reka-ui` ([#2448](https://github.com/nuxt/ui/issues/2448)) ([81ac076](https://github.com/nuxt/ui/commit/81ac076219c3d7ef151f641414a0fbeca2da0bdd))
|
||||
* **NavigationMenu:** handle `item.trailingIcon` display ([4b653ef](https://github.com/nuxt/ui/commit/4b653ef7735d9d2dfea65260433ade05eb3d3bd7))
|
||||
* **Stepper:** new component ([#2733](https://github.com/nuxt/ui/issues/2733)) ([6484d01](https://github.com/nuxt/ui/commit/6484d010a1eee6f5d86968e4701b945953089b17))
|
||||
* **Table:** handle `meta.class` on `th` and `td` ([#2790](https://github.com/nuxt/ui/issues/2790)) ([004a577](https://github.com/nuxt/ui/commit/004a5774678da24ccc267e96697c6088c51d5eea))
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Breadcrumb:** missing `aria-hidden` on presentation items ([a7a1227](https://github.com/nuxt/ui/commit/a7a1227c93110727e24f822fa50b547eb66bb16e)), closes [#2725](https://github.com/nuxt/ui/issues/2725)
|
||||
* **Calendar:** handle icons in RTL mode ([#2770](https://github.com/nuxt/ui/issues/2770)) ([e7b69b7](https://github.com/nuxt/ui/commit/e7b69b7d6f0ebb3c578b9f58bcddf8ad36e6c6ce))
|
||||
* **Calendar:** omit `as` / `asChild` props ([9478fc0](https://github.com/nuxt/ui/commit/9478fc076846d4a7fef13e63bdc274cd8d161063))
|
||||
* **ColorPicker:** handle RTL mode ([#2858](https://github.com/nuxt/ui/issues/2858)) ([f98b91c](https://github.com/nuxt/ui/commit/f98b91c22ae21071a25f69cc8682eb6197a54c5a))
|
||||
* **CommandPalette:** keep `ignoreFilter` groups at their place ([#2833](https://github.com/nuxt/ui/issues/2833)) ([3b9ca22](https://github.com/nuxt/ui/commit/3b9ca2263de1b936639b1b20ad0baf1cb059fda5))
|
||||
* **components:** apply class on `trigger` instead of `content` when present ([a6ecef0](https://github.com/nuxt/ui/commit/a6ecef0f0d87a8dff4e4cb9ec507058ec94ed82b)), closes [#2132](https://github.com/nuxt/ui/issues/2132)
|
||||
* **components:** specify collisionPadding to all menus ([148b024](https://github.com/nuxt/ui/commit/148b02464d47ada421313327585924b17f4e3f2d))
|
||||
* **ContextMenu:** remove close animation ([#2798](https://github.com/nuxt/ui/issues/2798)) ([ed27222](https://github.com/nuxt/ui/commit/ed2722257a22c770eda811fbad58980bcef9dad5))
|
||||
* **defineShortcuts:** return `useEventListener` to unregister the listener ([80befc1](https://github.com/nuxt/ui/commit/80befc107c6c6e7ab99dbe12376976babf315158)), closes [#2031](https://github.com/nuxt/ui/issues/2031)
|
||||
* **devtools:** error with renderer when `colorMode` is disabled ([#2792](https://github.com/nuxt/ui/issues/2792)) ([f06fbaf](https://github.com/nuxt/ui/commit/f06fbafc1e709c7b4e54e2ba40d44c5770685a5d))
|
||||
* **Form:** resolve async validation in yup & issue directly mutate state ([#2702](https://github.com/nuxt/ui/issues/2702)) ([c9806da](https://github.com/nuxt/ui/commit/c9806da6d850ea50ff8d2f11a1fbc5a43459b71f))
|
||||
* **icons:** make `loading` icon clockwise ([#2797](https://github.com/nuxt/ui/issues/2797)) ([bc2bcb3](https://github.com/nuxt/ui/commit/bc2bcb30d97e2e873c4c7d535f82a4980cd35b02))
|
||||
* **Link:** partial query match for Vue ([#2787](https://github.com/nuxt/ui/issues/2787)) ([a6c2205](https://github.com/nuxt/ui/commit/a6c22052e1c70e4ce6b2c7f783667a7f8c6cafa4))
|
||||
* **locale:** improve German translation ([#2826](https://github.com/nuxt/ui/issues/2826)) ([c440c91](https://github.com/nuxt/ui/commit/c440c91a29fc1acd281a7f9d9b0cf74f5341553d))
|
||||
* **Modal:** prevent from going out of screen ([b7ba2c7](https://github.com/nuxt/ui/commit/b7ba2c7759485ddb0a8bae589e4b6536ac9b1c96)), closes [#2711](https://github.com/nuxt/ui/issues/2711)
|
||||
* **NavigationMenu:** wrong badge class ([86f2b48](https://github.com/nuxt/ui/commit/86f2b4856cc6beaf0440795500a5c74f9af04f36)), closes [#2766](https://github.com/nuxt/ui/issues/2766)
|
||||
* **Progress:** handle `horizontal` animation in RTL mode ([#2723](https://github.com/nuxt/ui/issues/2723)) ([0baa3a0](https://github.com/nuxt/ui/commit/0baa3a06d449ab97093c451bd16215cf83c39447))
|
||||
* **Stepper:** handle RTL mode ([#2844](https://github.com/nuxt/ui/issues/2844)) ([198d04d](https://github.com/nuxt/ui/commit/198d04de51d16ec7fcaa546370e4f67aa73bfee0))
|
||||
* **Stepper:** missing import ([816bb69](https://github.com/nuxt/ui/commit/816bb69debdbf83f36c3ed3627985142e62b7dd1))
|
||||
* **Table:** handle `loading` animation in RTL mode ([#2771](https://github.com/nuxt/ui/issues/2771)) ([b1550d5](https://github.com/nuxt/ui/commit/b1550d58adfeb09977619ad3ff7e776782a89603))
|
||||
* **Tabs:** prevent hover on disabled ([a938d24](https://github.com/nuxt/ui/commit/a938d24f90431494c2da89411c301a228ab8d3f7))
|
||||
* **Tabs:** truncate not working ([c1ff978](https://github.com/nuxt/ui/commit/c1ff978370fb343950837b380ccf02a33db53ccb))
|
||||
* **types:** handle array of strings in AppConfig ([#2854](https://github.com/nuxt/ui/issues/2854)) ([4b241ba](https://github.com/nuxt/ui/commit/4b241ba3c32f4456252768b664488799a8278f0e))
|
||||
* **useLocale:** update locale import to enable tree shaking ([#2735](https://github.com/nuxt/ui/issues/2735)) ([3bccb67](https://github.com/nuxt/ui/commit/3bccb6782a601e686df5d0ee405d738572f182e1))
|
||||
|
||||
## [3.0.0-alpha.9](https://github.com/nuxt/ui/compare/v3.0.0-alpha.8...v3.0.0-alpha.9) (2024-11-19)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
[![License][license-src]][license-href]
|
||||
[![Nuxt][nuxt-src]][nuxt-href]
|
||||
|
||||
We're thrilled to introduce Nuxt UI v3, a significant upgrade to our UI library that delivers extensive improvements and robust new capabilities. This major update harnesses the combined strengths of [Radix Vue](https://www.radix-vue.com/), [Tailwind CSS v4](https://tailwindcss.com/docs/v4-beta), and [Tailwind Variants](https://www.tailwind-variants.org/) to offer developers an unparalleled set of tools for creating sophisticated, accessible, and highly performant user interfaces.
|
||||
We're thrilled to introduce Nuxt UI v3, a significant upgrade to our UI library that delivers extensive improvements and robust new capabilities. This major update harnesses the combined strengths of [Reka UI](https://reka-ui.com/), [Tailwind CSS v4](https://tailwindcss.com/docs/v4-beta), and [Tailwind Variants](https://www.tailwind-variants.org/) to offer developers an unparalleled set of tools for creating sophisticated, accessible, and highly performant user interfaces.
|
||||
|
||||
> [!NOTE]
|
||||
> You are on the `v3` development branch, check out the [dev branch](https://github.com/nuxt/ui) for Nuxt UI v2.
|
||||
@@ -99,7 +99,7 @@ Learn more in the [installation guide](https://ui3.nuxt.dev/getting-started/inst
|
||||
- [nuxt/icon](https://github.com/nuxt/icon)
|
||||
- [nuxt/fonts](https://github.com/nuxt/fonts)
|
||||
- [nuxt-modules/color-mode](https://github.com/nuxt-modules/color-mode)
|
||||
- [radix-vue/radix-vue](https://github.com/radix-vue/radix-vue)
|
||||
- [unovue/reka-ui](https://github.com/unovue/reka-ui)
|
||||
- [tailwindlabs/tailwindcss](https://github.com/tailwindlabs/tailwindcss)
|
||||
- [vueuse/vueuse](https://github.com/vueuse/vueuse)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export interface ${upperName}Slots {
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Primitive } from 'radix-vue'
|
||||
import { Primitive } from 'reka-ui'
|
||||
|
||||
const props = withDefaults(defineProps<${upperName}Props>(), { as: 'div' })
|
||||
defineSlots<${upperName}Slots>()
|
||||
@@ -72,7 +72,7 @@ const ui = ${camelName}()
|
||||
: `
|
||||
<script lang="ts">
|
||||
import { tv, type VariantProps } from 'tailwind-variants'
|
||||
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'radix-vue'
|
||||
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
|
||||
import type { AppConfig } from '@nuxt/schema'
|
||||
import _appConfig from '#build/app.config'
|
||||
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
||||
@@ -94,7 +94,7 @@ export interface ${upperName}Slots {}
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ${upperName}Root, useForwardPropsEmits } from 'radix-vue'
|
||||
import { ${upperName}Root, useForwardPropsEmits } from 'reka-ui'
|
||||
import { reactivePick } from '@vueuse/core'
|
||||
|
||||
const props = defineProps<${upperName}Props>()
|
||||
@@ -149,7 +149,7 @@ import ComponentRender from '../${content ? '../' : ''}component-render'
|
||||
describe('${upperName}', () => {
|
||||
it.each([
|
||||
// Props
|
||||
['with as', { props: { as: 'div' } }],
|
||||
['with as', { props: { as: 'section' } }],
|
||||
['with class', { props: { class: '' } }],
|
||||
['with ui', { props: { ui: {} } }],
|
||||
// Slots
|
||||
@@ -175,8 +175,8 @@ links: ${pro
|
||||
? ''
|
||||
: `
|
||||
- label: ${upperName}
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/${kebabName}.html`}
|
||||
icon: i-custom-reka-ui
|
||||
to: https://www.reka-ui.com/components/${kebabName}.html`}
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/${pro ? 'ui-pro' : 'ui'}/tree/v3/src/runtime/components/${upperName}.vue
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@nuxt/ui": "latest",
|
||||
"knitwork": "^1.1.0",
|
||||
"nuxt": "^3.14.1592",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier": "^3.4.2",
|
||||
"zod": "^3.23.8"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ const route = useRoute()
|
||||
const appConfig = useAppConfig()
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content'))
|
||||
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content', ['framework', 'module']))
|
||||
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('content'), {
|
||||
server: false
|
||||
})
|
||||
@@ -73,41 +73,10 @@ useServerSeoMeta({
|
||||
twitterCard: 'summary_large_image'
|
||||
})
|
||||
|
||||
const { framework, frameworks } = useSharedData()
|
||||
const { frameworks, modules } = useSharedData()
|
||||
const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation)
|
||||
|
||||
const groups = computed(() => {
|
||||
return [{
|
||||
id: 'framework',
|
||||
label: 'Framework',
|
||||
items: frameworks.value
|
||||
}]
|
||||
})
|
||||
|
||||
function filterFrameworkItems(items: any[]) {
|
||||
return items?.filter(item => !item.framework || item.framework === framework.value)
|
||||
}
|
||||
|
||||
function processNavigationItem(item: any): any {
|
||||
if (item.shadow) {
|
||||
const matchingChild = filterFrameworkItems(item.children)?.[0]
|
||||
return matchingChild
|
||||
? {
|
||||
...matchingChild,
|
||||
title: item.title,
|
||||
children: matchingChild.children ? processNavigationItem(matchingChild) : undefined
|
||||
}
|
||||
: item
|
||||
}
|
||||
|
||||
return {
|
||||
...item,
|
||||
children: item.children?.length ? filterFrameworkItems(item.children)?.map(processNavigationItem) : undefined
|
||||
}
|
||||
}
|
||||
|
||||
const filteredNavigation = computed(() => navigation.value?.map(processNavigationItem))
|
||||
|
||||
provide('navigation', filteredNavigation)
|
||||
provide('navigation', mappedNavigation)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -115,7 +84,7 @@ provide('navigation', filteredNavigation)
|
||||
<NuxtLoadingIndicator color="#FFF" />
|
||||
|
||||
<template v-if="!route.path.startsWith('/examples')">
|
||||
<Banner />
|
||||
<!-- <Banner /> -->
|
||||
|
||||
<Header :links="links" />
|
||||
</template>
|
||||
@@ -125,13 +94,21 @@ provide('navigation', filteredNavigation)
|
||||
</NuxtLayout>
|
||||
|
||||
<template v-if="!route.path.startsWith('/examples')">
|
||||
<Footer />
|
||||
<!-- <Footer /> -->
|
||||
|
||||
<ClientOnly>
|
||||
<LazyUContentSearch
|
||||
v-model:search-term="searchTerm"
|
||||
:files="files"
|
||||
:groups="groups"
|
||||
:groups="[{
|
||||
id: 'framework',
|
||||
label: 'Framework',
|
||||
items: frameworks
|
||||
}, {
|
||||
id: 'module',
|
||||
label: 'Module',
|
||||
items: modules
|
||||
}]"
|
||||
:navigation="filteredNavigation"
|
||||
:fuse="{ resultLimit: 42 }"
|
||||
/>
|
||||
@@ -167,4 +144,11 @@ provide('navigation', filteredNavigation)
|
||||
:root {
|
||||
--ui-container: var(--container-8xl);
|
||||
}
|
||||
|
||||
html[data-framework="nuxt"] .vue-only,
|
||||
html[data-framework="vue"] .nuxt-only,
|
||||
html[data-module="ui-pro"] .ui-only,
|
||||
html[data-module="ui"] .ui-pro-only {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -1,25 +1,23 @@
|
||||
<script setup lang="ts">
|
||||
const { framework, frameworks } = useSharedData()
|
||||
|
||||
const value = ref<string | undefined>(undefined)
|
||||
|
||||
onMounted(() => {
|
||||
value.value = framework.value
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UDropdownMenu
|
||||
v-slot="{ open }"
|
||||
:modal="false"
|
||||
<UTabs
|
||||
v-model="value"
|
||||
:items="frameworks"
|
||||
:ui="{ content: 'w-(--radix-dropdown-menu-trigger-width)' }"
|
||||
>
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="outline"
|
||||
v-bind="frameworks.find(f => f.value === framework)"
|
||||
block
|
||||
trailing-icon="i-lucide-chevron-down"
|
||||
:class="[open && 'bg-[var(--ui-bg-elevated)]']"
|
||||
:ui="{
|
||||
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' ')
|
||||
}"
|
||||
class="-mx-2 w-[calc(100%+1rem)]"
|
||||
/>
|
||||
</UDropdownMenu>
|
||||
:content="false"
|
||||
color="neutral"
|
||||
:ui="{
|
||||
indicator: 'bg-[var(--ui-bg)]',
|
||||
trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]'
|
||||
}"
|
||||
@update:model-value="(framework = $event as string)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
@@ -7,6 +7,7 @@ const props = defineProps<{
|
||||
}>()
|
||||
|
||||
const config = useRuntimeConfig().public
|
||||
const { module } = useSharedData()
|
||||
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
|
||||
@@ -20,13 +21,32 @@ defineShortcuts({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UHeader :ui="{ left: 'min-w-0' }">
|
||||
<UHeader :ui="{ left: 'min-w-0', toggle: '-mr-1.5' }" mode="drawer" :menu="{ shouldScaleBackground: true }">
|
||||
<template #left>
|
||||
<NuxtLink to="/" class="flex items-end gap-2 font-bold text-xl text-[var(--ui-text-highlighted)] min-w-0 focus-visible:outline-[var(--ui-primary)]" aria-label="Nuxt UI">
|
||||
<Logo class="w-auto h-6 shrink-0" />
|
||||
|
||||
<UBadge :label="`v${config.version}`" variant="subtle" size="sm" class="-mb-[2px] rounded-[var(--ui-radius)] font-semibold inline-block truncate" />
|
||||
<NuxtLink to="/" class="flex items-end gap-2 font-bold text-xl text-[var(--ui-text-highlighted)] min-w-0 focus-visible:outline-[var(--ui-primary)] shrink-0" aria-label="Nuxt UI">
|
||||
<LogoPro class="w-auto h-6 shrink-0 ui-pro-only" />
|
||||
<Logo class="w-auto h-6 shrink-0 ui-only" />
|
||||
</NuxtLink>
|
||||
|
||||
<UDropdownMenu
|
||||
v-slot="{ open }"
|
||||
:modal="false"
|
||||
:items="[{ label: `v${config.version}`, active: true, color: 'primary', checked: true, type: 'checkbox' }, { label: module === 'ui-pro' ? 'v1.5' : 'v2.19', to: module === 'ui-pro' ? 'https://ui.nuxt.com/pro' : 'https://ui.nuxt.com' }]"
|
||||
:ui="{ content: 'w-(--reka-dropdown-menu-trigger-width) min-w-0' }"
|
||||
size="xs"
|
||||
>
|
||||
<UButton
|
||||
:label="`v${config.version}`"
|
||||
variant="subtle"
|
||||
trailing-icon="i-lucide-chevron-down"
|
||||
size="xs"
|
||||
class="-mb-[6px] font-semibold rounded-full truncate"
|
||||
:class="[open && 'bg-[var(--ui-primary)]/15 ']"
|
||||
:ui="{
|
||||
trailingIcon: ['transition-transform duration-200', open ? 'rotate-180' : undefined].filter(Boolean).join(' ')
|
||||
}"
|
||||
/>
|
||||
</UDropdownMenu>
|
||||
</template>
|
||||
|
||||
<UNavigationMenu :items="items" variant="link" />
|
||||
@@ -38,7 +58,7 @@ defineShortcuts({
|
||||
<UContentSearchButton />
|
||||
</UTooltip>
|
||||
|
||||
<UTooltip text="Open on GitHub" :kbds="['meta', 'G']">
|
||||
<UTooltip text="Open on GitHub" :kbds="['meta', 'G']" class="hidden lg:flex">
|
||||
<UButton
|
||||
color="neutral"
|
||||
variant="ghost"
|
||||
@@ -51,11 +71,14 @@ defineShortcuts({
|
||||
</template>
|
||||
|
||||
<template #content>
|
||||
<UNavigationMenu orientation="vertical" :items="links" class="-ml-2.5" />
|
||||
<UNavigationMenu orientation="vertical" :items="links" class="-mx-2.5" />
|
||||
|
||||
<USeparator type="dashed" class="my-4" />
|
||||
<USeparator type="dashed" class="mt-4 mb-6" />
|
||||
|
||||
<FrameworkSelect class="mb-4" />
|
||||
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] mb-5.5 -mx-2.5">
|
||||
<ModuleSelect />
|
||||
<FrameworkSelect />
|
||||
</div>
|
||||
|
||||
<UContentNavigation :navigation="navigation" highlight />
|
||||
</template>
|
||||
|
||||
14
docs/app/components/LogoPro.vue
Normal file
14
docs/app/components/LogoPro.vue
Normal file
@@ -0,0 +1,14 @@
|
||||
<template>
|
||||
<svg width="1352" height="200" viewBox="0 0 1352 200" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M377 200C379.16 200 381 198.209 381 196V103C381 103 386 112 395 127L434 194C435.785 197.74 439.744 200 443 200H470V50H443C441.202 50 439 51.4941 439 54V148L421 116L385 55C383.248 51.8912 379.479 50 376 50H350V200H377Z" fill="currentColor" />
|
||||
<path d="M726 92H739C742.314 92 745 89.3137 745 86V60H773V92H800V116H773V159C773 169.5 778.057 174 787 174H800V200H783C759.948 200 745 185.071 745 160V116H726V92Z" fill="currentColor" />
|
||||
<path d="M591 92V154C591 168.004 585.742 179.809 578 188C570.258 196.191 559.566 200 545 200C530.434 200 518.742 196.191 511 188C503.389 179.809 498 168.004 498 154V92H514C517.412 92 520.769 92.622 523 95C525.231 97.2459 526 98.5652 526 102V154C526 162.059 526.457 167.037 530 171C533.543 174.831 537.914 176 545 176C552.217 176 555.457 174.831 559 171C562.543 167.037 563 162.059 563 154V102C563 98.5652 563.769 96.378 566 94C567.96 91.9107 570.028 91.9599 573 92C573.411 92.0055 574.586 92 575 92H591Z" fill="currentColor" />
|
||||
<path d="M676 144L710 92H684C680.723 92 677.812 93.1758 676 96L660 120L645 97C643.188 94.1758 639.277 92 636 92H611L645 143L608 200H634C637.25 200 640.182 196.787 642 194L660 167L679 195C680.818 197.787 683.75 200 687 200H713L676 144Z" fill="currentColor" />
|
||||
<path d="M168 200H279C282.542 200 285.932 198.756 289 197C292.068 195.244 295.23 193.041 297 190C298.77 186.959 300.002 183.51 300 179.999C299.998 176.488 298.773 173.04 297 170.001L222 41C220.23 37.96 218.067 35.7552 215 34C211.933 32.2448 207.542 31 204 31C200.458 31 197.067 32.2448 194 34C190.933 35.7552 188.77 37.96 187 41L168 74L130 9.99764C128.228 6.95784 126.068 3.75491 123 2C119.932 0.245087 116.542 0 113 0C109.458 0 106.068 0.245087 103 2C99.9323 3.75491 96.7717 6.95784 95 9.99764L2 170.001C0.226979 173.04 0.00154312 176.488 1.90993e-06 179.999C-0.0015393 183.51 0.229648 186.959 2 190C3.77035 193.04 6.93245 195.244 10 197C13.0675 198.756 16.4578 200 20 200H90C117.737 200 137.925 187.558 152 164L186 105L204 74L259 168H186L168 200ZM89 168H40L113 42L150 105L125.491 147.725C116.144 163.01 105.488 168 89 168Z" fill="var(--ui-primary)" />
|
||||
<path d="M958 60.0001H938C933.524 60.0001 929.926 59.9395 927 63C924.074 65.8905 925 67.5792 925 72V141C925 151.372 923.648 156.899 919 162C914.352 166.931 908.468 169 899 169C889.705 169 882.648 166.931 878 162C873.352 156.899 873 151.372 873 141V72.0001C873 67.5793 872.926 65.8906 870 63.0001C867.074 59.9396 863.476 60.0001 859 60.0001H840V141C840 159.023 845.016 173.458 855 184C865.156 194.542 879.893 200 899 200C918.107 200 932.844 194.542 943 184C953.156 173.458 958 159.023 958 141V60.0001Z" fill="currentColor" />
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M1000 60.0233L1020 60V77L1020 128V156.007L1020 181L1020 189.004C1020 192.938 1019.98 194.429 1017 197.001C1014.02 199.725 1009.56 200 1005 200H986.001V181.006L986 130.012V70.0215C986 66.1576 986.016 64.5494 989 62.023C991.819 59.6358 995.437 60.0233 1000 60.0233Z" fill="currentColor" />
|
||||
<path d="M1060 200V60H1117C1126.67 60 1134.98 61.2896 1142 65C1149.16 68.7104 1155.29 74.3744 1159 81C1162.71 87.6256 1164 95.3867 1164 104C1164 112.481 1162.71 120.374 1159 127C1155.29 133.626 1149.16 138.157 1142 142C1134.98 145.71 1126.67 148 1117 148H1090V200H1060ZM1115 123C1121.63 123 1126.69 121.578 1130 118C1133.31 114.29 1135 109.433 1135 104C1135 98.567 1133.31 93.5778 1130 90C1126.69 86.2896 1121.63 85 1115 85H1090V123H1115Z" fill="var(--ui-primary)" />
|
||||
<path d="M1226 123C1219.37 123 1214.31 124.965 1211 130C1207.69 135.035 1206 142.122 1206 151V200H1178V100H1200C1203.31 100 1206 102.686 1206 106V116C1208.65 109.904 1211.16 106.518 1215 104C1218.98 101.482 1224.77 100 1231 100H1242V123H1226Z" fill="var(--ui-primary)" />
|
||||
<path d="M1299 200C1288.93 200 1280.08 197.373 1272 193C1263.92 188.495 1257.51 182.818 1253 175C1248.49 167.049 1246 157.806 1246 148C1246 138.194 1248.49 129.818 1253 122C1257.51 114.049 1263.92 107.373 1272 103C1280.08 98.4946 1288.93 97 1299 97C1309.07 97 1318.92 98.4946 1327 103C1335.08 107.373 1340.49 114.049 1345 122C1349.51 129.818 1352 138.194 1352 148C1352 157.806 1349.51 167.049 1345 175C1340.49 182.818 1335.08 188.495 1327 193C1318.92 197.373 1309.07 200 1299 200ZM1299 176C1306.42 176 1312.36 173.168 1317 168C1321.64 162.832 1324 156.216 1324 148C1324 139.652 1321.64 133.168 1317 128C1312.36 122.832 1306.42 120 1299 120C1291.58 120 1285.64 122.832 1281 128C1276.36 133.168 1274 139.652 1274 148C1274 156.216 1276.36 162.832 1281 168C1285.64 173.168 1291.58 176 1299 176Z" fill="var(--ui-primary)" />
|
||||
</svg>
|
||||
</template>
|
||||
20
docs/app/components/ModuleSelect.vue
Normal file
20
docs/app/components/ModuleSelect.vue
Normal file
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
const { module, modules } = useSharedData()
|
||||
|
||||
const value = ref<string | undefined>(undefined)
|
||||
|
||||
onMounted(() => {
|
||||
value.value = module.value
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UTabs
|
||||
v-model="value"
|
||||
:items="modules"
|
||||
:content="false"
|
||||
color="neutral"
|
||||
:ui="{ indicator: 'bg-[var(--ui-bg)]', trigger: 'px-1 data-[state=active]:text-[var(--ui-text-highlighted)]' }"
|
||||
@update:model-value="(module = $event as string)"
|
||||
/>
|
||||
</template>
|
||||
@@ -280,7 +280,7 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
container: 'mt-0'
|
||||
}"
|
||||
>
|
||||
<USelectMenu
|
||||
<USelect
|
||||
v-if="option.items?.length"
|
||||
:model-value="getComponentProp(option.name)"
|
||||
:items="option.items"
|
||||
@@ -288,7 +288,6 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
color="neutral"
|
||||
variant="soft"
|
||||
class="rounded-[var(--ui-radius)] rounded-l-none min-w-12"
|
||||
:search-input="false"
|
||||
:class="[option.name.toLowerCase().endsWith('color') && 'pl-6']"
|
||||
:ui="{ itemLeadingChip: 'size-2' }"
|
||||
@update:model-value="setComponentProp(option.name, $event)"
|
||||
@@ -303,7 +302,7 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
class="size-2"
|
||||
/>
|
||||
</template>
|
||||
</USelectMenu>
|
||||
</USelect>
|
||||
<UInput
|
||||
v-else
|
||||
:type="option.type?.includes('number') ? 'number' : 'text'"
|
||||
@@ -320,9 +319,9 @@ const { data: ast } = await useAsyncData(`component-code-${name}-${hash({ props:
|
||||
<div v-if="component" class="flex justify-center border border-b-0 border-[var(--ui-border-muted)] relative p-4 z-[1]" :class="[!options.length && 'rounded-t-[calc(var(--ui-radius)*1.5)]', props.class]">
|
||||
<component :is="component" v-bind="{ ...componentProps, ...componentEvents }">
|
||||
<template v-for="slot in Object.keys(slots || {})" :key="slot" #[slot]>
|
||||
<MDCSlot :name="slot" unwrap="p">
|
||||
<slot :name="slot" mdc-unwrap="p">
|
||||
{{ slots?.[slot] }}
|
||||
</MDCSlot>
|
||||
</slot>
|
||||
</template>
|
||||
</component>
|
||||
</div>
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
import { upperFirst, camelCase } from 'scule'
|
||||
import type { ComponentMeta } from 'vue-component-meta'
|
||||
import * as theme from '#build/ui'
|
||||
import * as themePro from '#build/ui-pro'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
ignore?: string[]
|
||||
pro?: boolean
|
||||
}>(), {
|
||||
ignore: () => [
|
||||
'activeClass',
|
||||
@@ -32,7 +34,7 @@ const route = useRoute()
|
||||
const camelName = camelCase(route.params.slug?.[route.params.slug.length - 1] ?? '')
|
||||
const name = `U${upperFirst(camelName)}`
|
||||
|
||||
const componentTheme = (theme as any)[camelName]
|
||||
const componentTheme = ((props.pro ? themePro : theme) as any)[camelName]
|
||||
const meta = await fetchComponentMeta(name as any)
|
||||
|
||||
const metaProps: ComputedRef<ComponentMeta['props']> = computed(() => {
|
||||
|
||||
@@ -2,6 +2,11 @@
|
||||
import json5 from 'json5'
|
||||
import { camelCase } from 'scule'
|
||||
import * as theme from '#build/ui'
|
||||
import * as themePro from '#build/ui-pro'
|
||||
|
||||
const props = defineProps<{
|
||||
pro?: boolean
|
||||
}>()
|
||||
|
||||
const route = useRoute()
|
||||
const { framework } = useSharedData()
|
||||
@@ -12,7 +17,7 @@ const strippedCompoundVariants = ref(false)
|
||||
|
||||
const strippedTheme = computed(() => {
|
||||
const strippedTheme = {
|
||||
...(theme as any)[name]
|
||||
...((props.pro ? themePro : theme) as any)[name]
|
||||
}
|
||||
|
||||
if (strippedTheme?.compoundVariants) {
|
||||
@@ -50,22 +55,24 @@ const strippedTheme = computed(() => {
|
||||
|
||||
const component = computed(() => {
|
||||
return {
|
||||
ui: {
|
||||
[props.pro ? 'uiPro' : 'ui']: {
|
||||
[name]: strippedTheme.value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const { data: ast } = await useAsyncData(`component-theme-${name}-${framework.value}`, async () => {
|
||||
const { data: ast } = await useAsyncData(`component-theme-${name}`, async () => {
|
||||
const md = `
|
||||
::code-collapse
|
||||
${framework.value === 'nuxt'
|
||||
? `
|
||||
::code-collapse{class="nuxt-only"}
|
||||
|
||||
\`\`\`ts [app.config.ts]
|
||||
export default defineAppConfig(${json5.stringify(component.value, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')})
|
||||
\`\`\`\
|
||||
`
|
||||
: `
|
||||
|
||||
::
|
||||
|
||||
::code-collapse{class="vue-only"}
|
||||
|
||||
\`\`\`ts [vite.config.ts]
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
@@ -81,7 +88,7 @@ export default defineConfig({
|
||||
]
|
||||
})
|
||||
\`\`\`
|
||||
`}
|
||||
|
||||
::
|
||||
|
||||
${strippedCompoundVariants.value
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
const { framework } = useSharedData()
|
||||
import { Slot } from 'reka-ui'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<slot :name="framework" />
|
||||
<Slot class="nuxt-only">
|
||||
<slot name="nuxt" />
|
||||
</Slot>
|
||||
<Slot class="vue-only">
|
||||
<slot name="vue" />
|
||||
</Slot>
|
||||
</template>
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
import json5 from 'json5'
|
||||
import icons from '../../../../src/theme/icons'
|
||||
|
||||
const { framework } = useSharedData()
|
||||
const appConfig = useAppConfig()
|
||||
const { framework, module } = useSharedData()
|
||||
|
||||
const { data: ast } = await useAsyncData(`icons-theme-${framework.value}`, async () => {
|
||||
const { data: ast } = await useAsyncData(`icons-theme`, async () => {
|
||||
const md = `
|
||||
::code-collapse
|
||||
${framework.value === 'nuxt'
|
||||
? `
|
||||
::code-collapse{class="ui-only nuxt-only"}
|
||||
|
||||
\`\`\`ts [app.config.ts]
|
||||
export default defineAppConfig(${json5.stringify({
|
||||
ui: {
|
||||
@@ -16,8 +16,27 @@ export default defineAppConfig(${json5.stringify({
|
||||
}
|
||||
}, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')})
|
||||
\`\`\`\
|
||||
`
|
||||
: `
|
||||
|
||||
::
|
||||
|
||||
::code-collapse{class="ui-pro-only nuxt-only"}
|
||||
|
||||
\`\`\`ts [app.config.ts]
|
||||
export default defineAppConfig(${json5.stringify({
|
||||
ui: {
|
||||
icons: appConfig.ui.icons
|
||||
}
|
||||
}, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')})
|
||||
\`\`\`\
|
||||
|
||||
::
|
||||
|
||||
::caution{class="ui-pro-only vue-only"}
|
||||
Nuxt UI Pro v3 does not support Vue yet.
|
||||
::
|
||||
|
||||
::code-collapse{class="vue-only"}
|
||||
|
||||
\`\`\`ts [vite.config.ts]
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
@@ -37,12 +56,12 @@ export default defineConfig({
|
||||
]
|
||||
})
|
||||
\`\`\`
|
||||
`}
|
||||
|
||||
::
|
||||
`
|
||||
|
||||
return parseMarkdown(md)
|
||||
}, { watch: [framework] })
|
||||
}, { watch: [framework, module] })
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
12
docs/app/components/content/ModuleOnly.vue
Normal file
12
docs/app/components/content/ModuleOnly.vue
Normal file
@@ -0,0 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { Slot } from 'reka-ui'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Slot class="ui-only">
|
||||
<slot name="ui" />
|
||||
</Slot>
|
||||
<Slot class="ui-pro-only">
|
||||
<slot name="ui-pro" />
|
||||
</Slot>
|
||||
</template>
|
||||
@@ -1,27 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import type { Locale } from '@nuxt/ui'
|
||||
import * as locales from '@nuxt/ui/locale'
|
||||
|
||||
type LocaleKey = keyof typeof locales
|
||||
type LocaleComputed = Locale & { flag: string }
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
default?: string
|
||||
}>(), {
|
||||
default: 'en'
|
||||
})
|
||||
|
||||
const countries = await $fetch('/api/locales.json')
|
||||
|
||||
const getLocaleKeys = Object.keys(locales) as LocaleKey[]
|
||||
const localesList = getLocaleKeys.map<LocaleComputed>((code) => {
|
||||
const locale: Locale = locales[code]
|
||||
|
||||
return {
|
||||
...locale,
|
||||
flag: countries[locale.code] || ''
|
||||
function getEmojiFlag(locale: string): string {
|
||||
// Map language codes to default country codes
|
||||
const languageToCountry: Record<string, string> = {
|
||||
en: 'gb',
|
||||
ar: 'sa',
|
||||
cs: 'cz',
|
||||
zh: 'cn',
|
||||
ja: 'jp',
|
||||
ko: 'kr'
|
||||
}
|
||||
})
|
||||
|
||||
// Get base language code before any region specifier
|
||||
const baseLanguage = locale.split('-')[0]?.toLowerCase() || locale
|
||||
|
||||
// Use mapped country code or extract from locale if it contains a region
|
||||
const countryCode = languageToCountry[baseLanguage] || locale.replace(/^.*-/, '').slice(0, 2)
|
||||
|
||||
return countryCode
|
||||
.split('')
|
||||
.map((char: string) => {
|
||||
const codePoint = char.toUpperCase().codePointAt(0)
|
||||
return codePoint ? String.fromCodePoint(0x1F1A5 + codePoint) : ''
|
||||
})
|
||||
.join('')
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- eslint-disable vue/singleline-html-element-content-newline -->
|
||||
@@ -31,9 +41,12 @@ const localesList = getLocaleKeys.map<LocaleComputed>((code) => {
|
||||
By default, the <ProseCode>{{ props.default }}</ProseCode> locale is used.
|
||||
</ProseP>
|
||||
<div class="grid gap-6 grid-cols-2 md:grid-cols-3">
|
||||
<div v-for="locale in localesList" :key="locale.code">
|
||||
<div v-for="locale in locales" :key="locale.code">
|
||||
<div class="flex gap-3 items-center">
|
||||
<UAvatar :text="locale.flag" size="xl" />
|
||||
<UAvatar size="xl">
|
||||
{{ getEmojiFlag(locale.code) }}
|
||||
</UAvatar>
|
||||
|
||||
<div class="text-sm">
|
||||
<div class="font-semibold">{{ locale.name }}</div>
|
||||
<div class="mt-1">Code: <ProseCode class="text-xs">{{ locale.code }}</ProseCode></div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { CalendarDate } from '@internationalized/date'
|
||||
import type { Matcher } from 'radix-vue/date'
|
||||
import type { Matcher } from 'reka-ui/date'
|
||||
|
||||
const modelValue = shallowRef({
|
||||
start: new CalendarDate(2022, 1, 1),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { CalendarDate } from '@internationalized/date'
|
||||
import type { Matcher } from 'radix-vue/date'
|
||||
import type { Matcher } from 'reka-ui/date'
|
||||
|
||||
const modelValue = shallowRef({
|
||||
start: new CalendarDate(2022, 1, 1),
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<script setup lang="ts">
|
||||
const color = ref('#00C16A')
|
||||
|
||||
const chip = computed(() => ({ backgroundColor: color.value }))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UPopover>
|
||||
<UButton label="Choose color" color="neutral" variant="outline">
|
||||
<template #leading>
|
||||
<span :style="chip" class="size-3 rounded-full" />
|
||||
</template>
|
||||
</UButton>
|
||||
|
||||
<template #content>
|
||||
<UColorPicker v-model="color" class="p-2" />
|
||||
</template>
|
||||
</UPopover>
|
||||
</template>
|
||||
@@ -14,7 +14,7 @@ const groups = computed(() => [{
|
||||
id: 'users',
|
||||
label: searchTerm.value ? `Users matching “${searchTerm.value}”...` : 'Users',
|
||||
items: users.value || [],
|
||||
filter: false
|
||||
ignoreFilter: true
|
||||
}])
|
||||
</script>
|
||||
|
||||
@@ -11,8 +11,8 @@ const items = [
|
||||
level: 2
|
||||
},
|
||||
{
|
||||
id: '/getting-started#radix-vue-3',
|
||||
label: 'Radix Vue',
|
||||
id: '/getting-started#reka-ui-radix-vue',
|
||||
label: 'Reka UI',
|
||||
level: 3
|
||||
},
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ const users = [
|
||||
}
|
||||
]
|
||||
|
||||
const searchTerm = ref('')
|
||||
const searchTerm = ref('B')
|
||||
|
||||
function onSelect() {
|
||||
searchTerm.value = ''
|
||||
|
||||
@@ -22,7 +22,7 @@ const items = [{
|
||||
</template>
|
||||
|
||||
<template #refresh-trailing>
|
||||
<UIcon v-if="loading" name="i-lucide-refresh-ccw" class="shrink-0 size-5 text-[var(--ui-primary)] animate-spin" />
|
||||
<UIcon v-if="loading" name="i-lucide-refresh-cw" class="shrink-0 size-5 text-[var(--ui-primary)] animate-spin" />
|
||||
</template>
|
||||
</UContextMenu>
|
||||
</template>
|
||||
|
||||
@@ -13,7 +13,7 @@ const groups = computed(() => [{
|
||||
id: 'users',
|
||||
label: searchTerm.value ? `Users matching “${searchTerm.value}”...` : 'Users',
|
||||
items: users.value || [],
|
||||
filter: false
|
||||
ignoreFilter: true
|
||||
}])
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
|
||||
const value = ref('Backlog')
|
||||
|
||||
function onCreate(item: string) {
|
||||
items.value.push(item)
|
||||
|
||||
value.value = item
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UInputMenu
|
||||
v-model="value"
|
||||
create-item
|
||||
:items="items"
|
||||
class="w-48"
|
||||
@create="onCreate"
|
||||
/>
|
||||
</template>
|
||||
@@ -16,7 +16,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
<UInputMenu
|
||||
:items="users || []"
|
||||
:loading="status === 'pending'"
|
||||
:filter="['label', 'email']"
|
||||
:filter-fields="['label', 'email']"
|
||||
icon="i-lucide-user"
|
||||
placeholder="Select user"
|
||||
class="w-80"
|
||||
|
||||
@@ -20,7 +20,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
v-model:search-term="searchTerm"
|
||||
:items="users || []"
|
||||
:loading="status === 'pending'"
|
||||
:filter="false"
|
||||
ignore-filter
|
||||
icon="i-lucide-user"
|
||||
placeholder="Select user"
|
||||
>
|
||||
@@ -13,7 +13,7 @@ const groups = computed(() => [{
|
||||
id: 'users',
|
||||
label: searchTerm.value ? `Users matching “${searchTerm.value}”...` : 'Users',
|
||||
items: users.value || [],
|
||||
filter: false
|
||||
ignoreFilter: true
|
||||
}])
|
||||
</script>
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ const items = [
|
||||
:items="items"
|
||||
class="justify-center"
|
||||
:ui="{
|
||||
viewport: 'sm:w-[var(--radix-navigation-menu-viewport-width)]',
|
||||
viewport: 'sm:w-[var(--reka-navigation-menu-viewport-width)]',
|
||||
childList: 'sm:w-96',
|
||||
childLinkDescription: 'text-balance line-clamp-2'
|
||||
}"
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup lang="ts">
|
||||
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
|
||||
const value = ref('Backlog')
|
||||
|
||||
function onCreate(item: string) {
|
||||
items.value.push(item)
|
||||
|
||||
value.value = item
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<USelectMenu
|
||||
v-model="value"
|
||||
create-item
|
||||
:items="items"
|
||||
class="w-48"
|
||||
@create="onCreate"
|
||||
/>
|
||||
</template>
|
||||
@@ -16,7 +16,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
<USelectMenu
|
||||
:items="users || []"
|
||||
:loading="status === 'pending'"
|
||||
:filter="['label', 'email']"
|
||||
:filter-fields="['label', 'email']"
|
||||
icon="i-lucide-user"
|
||||
placeholder="Select user"
|
||||
class="w-80"
|
||||
|
||||
@@ -20,7 +20,7 @@ const { data: users, status } = await useFetch('https://jsonplaceholder.typicode
|
||||
v-model:search-term="searchTerm"
|
||||
:items="users || []"
|
||||
:loading="status === 'pending'"
|
||||
:filter="false"
|
||||
ignore-filter
|
||||
icon="i-lucide-user"
|
||||
placeholder="Select user"
|
||||
class="w-48"
|
||||
@@ -26,7 +26,7 @@ function getUserAvatar(value: string) {
|
||||
<template #leading="{ modelValue, ui }">
|
||||
<UAvatar
|
||||
v-if="modelValue"
|
||||
v-bind="getUserAvatar(modelValue)"
|
||||
v-bind="getUserAvatar(modelValue as string)"
|
||||
:size="ui.leadingAvatarSize()"
|
||||
:class="ui.leadingAvatar()"
|
||||
/>
|
||||
|
||||
@@ -34,7 +34,7 @@ function getChip(value: string) {
|
||||
<template #leading="{ modelValue, ui }">
|
||||
<UChip
|
||||
v-if="modelValue"
|
||||
v-bind="getChip(modelValue)"
|
||||
v-bind="getChip(modelValue as string)"
|
||||
inset
|
||||
standalone
|
||||
:size="ui.itemLeadingChipSize()"
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
const items = [
|
||||
{
|
||||
title: 'Address',
|
||||
description: 'Add your address here',
|
||||
icon: 'i-lucide-house'
|
||||
}, {
|
||||
title: 'Shipping',
|
||||
description: 'Set your preferred shipping method',
|
||||
icon: 'i-lucide-truck'
|
||||
}, {
|
||||
title: 'Checkout',
|
||||
description: 'Confirm your order'
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UStepper ref="stepper" :items="items" class="w-full">
|
||||
<template #content="{ item }">
|
||||
<Placeholder class="aspect-video">
|
||||
This is the {{ item?.title }} step.
|
||||
</Placeholder>
|
||||
</template>
|
||||
</UStepper>
|
||||
</template>
|
||||
@@ -0,0 +1,41 @@
|
||||
<script setup lang="ts">
|
||||
const items = [
|
||||
{
|
||||
slot: 'address',
|
||||
title: 'Address',
|
||||
description: 'Add your address here',
|
||||
icon: 'i-lucide-house'
|
||||
}, {
|
||||
slot: 'shipping',
|
||||
title: 'Shipping',
|
||||
description: 'Set your preferred shipping method',
|
||||
icon: 'i-lucide-truck'
|
||||
}, {
|
||||
slot: 'checkout',
|
||||
title: 'Checkout',
|
||||
description: 'Confirm your order'
|
||||
}
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UStepper :items="items" class="w-full">
|
||||
<template #address>
|
||||
<Placeholder class="aspect-video">
|
||||
Address
|
||||
</Placeholder>
|
||||
</template>
|
||||
|
||||
<template #shipping>
|
||||
<Placeholder class="aspect-video">
|
||||
Shipping
|
||||
</Placeholder>
|
||||
</template>
|
||||
|
||||
<template #checkout>
|
||||
<Placeholder class="aspect-video">
|
||||
Checkout
|
||||
</Placeholder>
|
||||
</template>
|
||||
</UStepper>
|
||||
</template>
|
||||
@@ -0,0 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue'
|
||||
|
||||
const items = [
|
||||
{
|
||||
title: 'Address',
|
||||
description: 'Add your address here',
|
||||
icon: 'i-lucide-house'
|
||||
}, {
|
||||
title: 'Shipping',
|
||||
description: 'Set your preferred shipping method',
|
||||
icon: 'i-lucide-truck'
|
||||
}, {
|
||||
title: 'Checkout',
|
||||
description: 'Confirm your order'
|
||||
}
|
||||
]
|
||||
|
||||
const active = ref(0)
|
||||
|
||||
// Note: This is for demonstration purposes only. Don't do this at home.
|
||||
onMounted(() => {
|
||||
setInterval(() => {
|
||||
active.value = (active.value + 1) % items.length
|
||||
}, 2000)
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UStepper v-model="active" :items="items" class="w-full">
|
||||
<template #content="{ item }">
|
||||
<Placeholder class="aspect-video">
|
||||
This is the {{ item?.title }} step.
|
||||
</Placeholder>
|
||||
</template>
|
||||
</UStepper>
|
||||
</template>
|
||||
@@ -0,0 +1,51 @@
|
||||
<script setup lang="ts">
|
||||
const items = [
|
||||
{
|
||||
slot: 'address',
|
||||
title: 'Address',
|
||||
description: 'Add your address here',
|
||||
icon: 'i-lucide-house'
|
||||
}, {
|
||||
slot: 'shipping',
|
||||
title: 'Shipping',
|
||||
description: 'Set your preferred shipping method',
|
||||
icon: 'i-lucide-truck'
|
||||
}, {
|
||||
slot: 'checkout',
|
||||
title: 'Checkout',
|
||||
description: 'Confirm your order'
|
||||
}
|
||||
]
|
||||
|
||||
const stepper = useTemplateRef('stepper')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="w-full">
|
||||
<UStepper ref="stepper" :items="items">
|
||||
<template #content="{ item }">
|
||||
<Placeholder class="aspect-video">
|
||||
{{ item.title }}
|
||||
</Placeholder>
|
||||
</template>
|
||||
</UStepper>
|
||||
|
||||
<div class="flex gap-2 justify-between mt-4">
|
||||
<UButton
|
||||
leading-icon="i-lucide-arrow-left"
|
||||
:disabled="!stepper?.hasPrev"
|
||||
@click="stepper?.prev()"
|
||||
>
|
||||
Prev
|
||||
</UButton>
|
||||
|
||||
<UButton
|
||||
trailing-icon="i-lucide-arrow-right"
|
||||
:disabled="!stepper?.hasNext"
|
||||
@click="stepper?.next()"
|
||||
>
|
||||
Next
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -143,14 +143,13 @@ const data = ref<Payment[]>([{
|
||||
const columns: TableColumn<Payment>[] = [{
|
||||
id: 'select',
|
||||
header: ({ table }) => h(UCheckbox, {
|
||||
'modelValue': table.getIsAllPageRowsSelected(),
|
||||
'indeterminate': table.getIsSomePageRowsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean) => table.toggleAllPageRowsSelected(!!value),
|
||||
'modelValue': table.getIsSomePageRowsSelected() ? 'indeterminate' : table.getIsAllPageRowsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean | 'indeterminate') => table.toggleAllPageRowsSelected(!!value),
|
||||
'ariaLabel': 'Select all'
|
||||
}),
|
||||
cell: ({ row }) => h(UCheckbox, {
|
||||
'modelValue': row.getIsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean) => row.toggleSelected(!!value),
|
||||
'onUpdate:modelValue': (value: boolean | 'indeterminate') => row.toggleSelected(!!value),
|
||||
'ariaLabel': 'Select row'
|
||||
}),
|
||||
enableSorting: false,
|
||||
|
||||
@@ -48,14 +48,13 @@ const data = ref<Payment[]>([{
|
||||
const columns: TableColumn<Payment>[] = [{
|
||||
id: 'select',
|
||||
header: ({ table }) => h(UCheckbox, {
|
||||
'modelValue': table.getIsAllPageRowsSelected(),
|
||||
'indeterminate': table.getIsSomePageRowsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean) => table.toggleAllPageRowsSelected(!!value),
|
||||
'modelValue': table.getIsSomePageRowsSelected() ? 'indeterminate' : table.getIsAllPageRowsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean | 'indeterminate') => table.toggleAllPageRowsSelected(!!value),
|
||||
'ariaLabel': 'Select all'
|
||||
}),
|
||||
cell: ({ row }) => h(UCheckbox, {
|
||||
'modelValue': row.getIsSelected(),
|
||||
'onUpdate:modelValue': (value: boolean) => row.toggleSelected(!!value),
|
||||
'onUpdate:modelValue': (value: boolean | 'indeterminate') => row.toggleSelected(!!value),
|
||||
'ariaLabel': 'Select row'
|
||||
})
|
||||
}, {
|
||||
|
||||
@@ -10,7 +10,7 @@ function showToast() {
|
||||
title: 'Uh oh! Something went wrong.',
|
||||
description: props.description,
|
||||
actions: [{
|
||||
icon: 'i-lucide-refresh-ccw',
|
||||
icon: 'i-lucide-refresh-cw',
|
||||
label: 'Retry',
|
||||
color: 'neutral',
|
||||
variant: 'outline',
|
||||
|
||||
40
docs/app/composables/useContentNavigation.ts
Normal file
40
docs/app/composables/useContentNavigation.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { ContentNavigationItem } from '@nuxt/content'
|
||||
|
||||
function processNavigationItem(item: ContentNavigationItem, parent?: ContentNavigationItem): any {
|
||||
if (item.shadow) {
|
||||
return item.children?.flatMap(child => processNavigationItem(child, item))
|
||||
}
|
||||
|
||||
return {
|
||||
...item,
|
||||
title: parent?.title && parent.title !== 'Pro' ? parent.title : item.title,
|
||||
badge: parent?.badge || item.badge,
|
||||
class: [item.framework && `${item.framework}-only`, item.module && `${item.module}-only`].filter(Boolean),
|
||||
children: item.children?.length ? item.children?.flatMap(child => processNavigationItem(child)) : undefined
|
||||
}
|
||||
}
|
||||
|
||||
export const useContentNavigation = (navigation: Ref<ContentNavigationItem[] | undefined>) => {
|
||||
const { framework, module } = useSharedData()
|
||||
|
||||
const mappedNavigation = computed(() => navigation.value?.map(item => processNavigationItem(item)))
|
||||
const filteredNavigation = computed(() => mappedNavigation.value?.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
children: item.children?.filter((child: any) => {
|
||||
if (child.framework && child.framework !== framework.value) {
|
||||
return false
|
||||
}
|
||||
if (child.module && child.module !== module.value) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
}))
|
||||
|
||||
return {
|
||||
mappedNavigation,
|
||||
filteredNavigation
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,36 @@
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
|
||||
function _useSharedData() {
|
||||
export function useSharedData() {
|
||||
const framework = useCookie('nuxt-ui-framework', { default: () => 'nuxt' })
|
||||
const frameworks = computed(() => [{
|
||||
label: 'Nuxt',
|
||||
icon: 'i-logos-nuxt-icon',
|
||||
icon: 'i-simple-icons-nuxtdotjs',
|
||||
value: 'nuxt',
|
||||
onSelect: () => framework.value = 'nuxt'
|
||||
}, {
|
||||
label: 'Vue',
|
||||
icon: 'i-logos-vue',
|
||||
icon: 'i-simple-icons-vuedotjs',
|
||||
value: 'vue',
|
||||
disabled: module.value === 'ui-pro',
|
||||
onSelect: () => framework.value = 'vue'
|
||||
}].map(f => ({ ...f, active: framework.value === f.value })))
|
||||
|
||||
const module = useCookie('nuxt-ui-module', { default: () => 'ui' })
|
||||
const modules = computed(() => [{
|
||||
label: 'nuxt/ui',
|
||||
icon: 'i-lucide-box',
|
||||
value: 'ui',
|
||||
onSelect: () => module.value = 'ui'
|
||||
}, {
|
||||
label: 'nuxt/ui-pro',
|
||||
icon: 'i-lucide-boxes',
|
||||
value: 'ui-pro',
|
||||
disabled: framework.value === 'vue',
|
||||
onSelect: () => module.value = 'ui-pro'
|
||||
}].map(m => ({ ...m, active: module.value === m.value })))
|
||||
|
||||
return {
|
||||
framework,
|
||||
frameworks
|
||||
frameworks,
|
||||
module,
|
||||
modules
|
||||
}
|
||||
}
|
||||
|
||||
export const useSharedData = createSharedComposable(_useSharedData)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import colors from 'tailwindcss/colors'
|
||||
// import { debounce } from 'perfect-debounce'
|
||||
import type { NuxtError } from '#app'
|
||||
|
||||
const props = defineProps<{
|
||||
@@ -10,8 +11,20 @@ const route = useRoute()
|
||||
const appConfig = useAppConfig()
|
||||
const colorMode = useColorMode()
|
||||
|
||||
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content'))
|
||||
const { data: files } = await useAsyncData('files', () => queryCollectionSearchSections('content', { ignoredTags: ['style'] }))
|
||||
const { data: navigation } = await useAsyncData('navigation', () => queryCollectionNavigation('content', ['framework', 'module']))
|
||||
const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSections('content'), {
|
||||
server: false
|
||||
})
|
||||
|
||||
const searchTerm = ref('')
|
||||
|
||||
// watch(searchTerm, debounce((query: string) => {
|
||||
// if (!query) {
|
||||
// return
|
||||
// }
|
||||
|
||||
// useTrackEvent('Search', { props: { query: `${query} - ${searchTerm.value?.commandPaletteRef.results.length} results` } })
|
||||
// }, 500))
|
||||
|
||||
const links = computed(() => [{
|
||||
label: 'Docs',
|
||||
@@ -68,23 +81,40 @@ useServerSeoMeta({
|
||||
twitterCard: 'summary_large_image'
|
||||
})
|
||||
|
||||
provide('navigation', navigation)
|
||||
const { frameworks, modules } = useSharedData()
|
||||
const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation)
|
||||
|
||||
provide('navigation', mappedNavigation)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UApp>
|
||||
<NuxtLoadingIndicator color="#FFF" />
|
||||
|
||||
<Banner />
|
||||
<!-- <Banner /> -->
|
||||
|
||||
<Header :links="links" />
|
||||
|
||||
<UError :error="error" />
|
||||
|
||||
<Footer />
|
||||
<!-- <Footer /> -->
|
||||
|
||||
<ClientOnly>
|
||||
<LazyUContentSearch :files="files" :navigation="navigation" :fuse="{ resultLimit: 42 }" />
|
||||
<LazyUContentSearch
|
||||
v-model:search-term="searchTerm"
|
||||
:files="files"
|
||||
:groups="[{
|
||||
id: 'framework',
|
||||
label: 'Framework',
|
||||
items: frameworks
|
||||
}, {
|
||||
id: 'module',
|
||||
label: 'Module',
|
||||
items: modules
|
||||
}]"
|
||||
:navigation="filteredNavigation"
|
||||
:fuse="{ resultLimit: 42 }"
|
||||
/>
|
||||
</ClientOnly>
|
||||
</UApp>
|
||||
</template>
|
||||
|
||||
@@ -11,7 +11,10 @@ const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
<template #left>
|
||||
<UPageAside>
|
||||
<template #top>
|
||||
<FrameworkSelect />
|
||||
<div class="flex flex-col gap-2 w-[calc(100%+1.25rem)] -mx-2.5">
|
||||
<ModuleSelect />
|
||||
<FrameworkSelect />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<UContentNavigation :navigation="navigation" highlight />
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { ContentNavigationItem } from '@nuxt/content'
|
||||
import { findPageBreadcrumb, mapContentNavigation } from '#ui-pro/utils/content'
|
||||
|
||||
const route = useRoute()
|
||||
const { framework, module } = useSharedData()
|
||||
|
||||
definePageMeta({
|
||||
layout: 'docs'
|
||||
@@ -13,40 +14,59 @@ if (!page.value) {
|
||||
throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true })
|
||||
}
|
||||
|
||||
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => queryCollectionItemSurroundings('content', route.path, {
|
||||
fields: ['description']
|
||||
}))
|
||||
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
|
||||
return queryCollectionItemSurroundings('content', route.path, {
|
||||
fields: ['description']
|
||||
}).orWhere(group => group.where('framework', '=', framework.value).where('framework', 'IS NULL'))
|
||||
.orWhere(group => group.where('module', '=', module.value).where('module', 'IS NULL'))
|
||||
}, {
|
||||
watch: [framework, module]
|
||||
})
|
||||
|
||||
const navigation = inject<Ref<ContentNavigationItem[]>>('navigation')
|
||||
|
||||
const breadcrumb = computed(() => mapContentNavigation(findPageBreadcrumb(navigation?.value, page.value)).map(({ icon, ...link }) => link))
|
||||
|
||||
const { framework } = useSharedData()
|
||||
|
||||
// Redirect to the correct framework version if the page is not the current framework
|
||||
if (!import.meta.prerender) {
|
||||
// Redirect to the correct framework version if the page is not the current framework
|
||||
watch(framework, () => {
|
||||
if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
|
||||
if (route.path.endsWith(`/${page.value?.navigation?.framework}`)) {
|
||||
if (page.value?.framework && page.value?.framework !== framework.value) {
|
||||
if (route.path.endsWith(`/${page.value?.framework}`)) {
|
||||
navigateTo(`${route.path.split('/').slice(0, -1).join('/')}/${framework.value}`)
|
||||
} else {
|
||||
navigateTo(`/getting-started`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// Redirect to the correct module version if the page is not the current module
|
||||
watch(module, () => {
|
||||
if (page.value?.module && page.value?.module !== module.value) {
|
||||
if (page.value?.module === 'ui-pro' && route.path.includes('/pro')) {
|
||||
navigateTo(`${route.path.replace('/pro', '')}`)
|
||||
} else if (page.value?.module === 'ui' && !route.path.includes('/pro')) {
|
||||
navigateTo(`${route.path.replace(`/${framework.value}`, '')}/pro/${framework.value}`)
|
||||
} else {
|
||||
navigateTo(`/getting-started`)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Update the framework if the page has a different framework
|
||||
// Update the framework/module if the page has different ones
|
||||
watch(page, () => {
|
||||
if (page.value?.navigation?.framework && page.value?.navigation?.framework !== framework.value) {
|
||||
framework.value = page.value?.navigation?.framework as string
|
||||
if (page.value?.framework && page.value?.framework !== framework.value) {
|
||||
framework.value = page.value?.framework as string
|
||||
}
|
||||
if (page.value?.module && page.value?.module !== module.value) {
|
||||
module.value = page.value?.module as string
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
useSeoMeta({
|
||||
titleTemplate: '%s - Nuxt UI v3',
|
||||
title: typeof page.value.navigation === 'object' && page.value.navigation.title ? page.value.navigation.title : page.value.title,
|
||||
ogTitle: `${typeof page.value.navigation === 'object' && page.value.navigation.title ? page.value.navigation.title : page.value.title} - Nuxt UI v3`,
|
||||
titleTemplate: `%s - Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} v3${page.value.framework === 'vue' ? ' for Vue' : ''}`,
|
||||
title: page.value.navigation?.title ? page.value.navigation.title : page.value.title,
|
||||
ogTitle: `${page.value.navigation?.title ? page.value.navigation.title : page.value.title} - Nuxt UI ${page.value.module === 'ui-pro' ? 'Pro' : ''} v3${page.value.framework === 'vue' ? ' for Vue' : ''}`,
|
||||
description: page.value.description,
|
||||
ogDescription: page.value.description
|
||||
})
|
||||
@@ -96,12 +116,13 @@ const communityLinks = computed(() => [{
|
||||
<MDC v-if="page.description" :value="page.description" unwrap="p" />
|
||||
</template>
|
||||
|
||||
<template #links>
|
||||
<template v-if="page.links?.length" #links>
|
||||
<UButton
|
||||
v-for="link in page.links"
|
||||
:key="link.label"
|
||||
color="neutral"
|
||||
variant="outline"
|
||||
target="_blank"
|
||||
v-bind="link"
|
||||
>
|
||||
<template v-if="link.avatar" #leading>
|
||||
|
||||
@@ -20,7 +20,7 @@ const src = computed(() => `https://volta.net/embed/${token}?theme=${colorMode.v
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="h-[calc(100vh-var(--ui-header-height)-var(--ui-header-height)-48px-1px)]">
|
||||
<div class="h-[calc(100vh-var(--ui-header-height))]">
|
||||
<ClientOnly>
|
||||
<iframe :src="src" width="100%" height="100%" />
|
||||
</ClientOnly>
|
||||
|
||||
38
docs/app/plugins/data.ts
Normal file
38
docs/app/plugins/data.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
export default defineNuxtPlugin({
|
||||
enforce: 'post',
|
||||
setup() {
|
||||
const { framework, module } = useSharedData()
|
||||
|
||||
if (import.meta.client) {
|
||||
useHead({
|
||||
htmlAttrs: {
|
||||
'data-framework': framework,
|
||||
'data-module': module
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if (import.meta.server) {
|
||||
useHead({
|
||||
script: [{
|
||||
innerHTML: `
|
||||
function getCookie(name) {
|
||||
var value = '; ' + window.document.cookie;
|
||||
var parts = value.split('; ' + name + '=');
|
||||
if (parts.length === 2) {
|
||||
return parts.pop()?.split(';').shift();
|
||||
}
|
||||
}
|
||||
|
||||
var f = getCookie('nuxt-ui-framework');
|
||||
document.documentElement.setAttribute('data-framework', f || 'nuxt');
|
||||
var m = getCookie('nuxt-ui-module');
|
||||
document.documentElement.setAttribute('data-module', m || 'ui');
|
||||
`.replace(/\s+/g, ' '),
|
||||
type: 'text/javascript',
|
||||
tagPriority: -1
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -1,24 +1,45 @@
|
||||
import { defineCollection, z } from '@nuxt/content'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const schema = z.object({
|
||||
framework: z.string().optional(),
|
||||
module: z.string().optional(),
|
||||
navigation: z.object({
|
||||
title: z.string().optional()
|
||||
}),
|
||||
links: z.array(z.object({
|
||||
label: z.string(),
|
||||
icon: z.string(),
|
||||
avatar: z.object({
|
||||
src: z.string(),
|
||||
alt: z.string()
|
||||
}).optional(),
|
||||
to: z.string(),
|
||||
target: z.string().optional()
|
||||
}))
|
||||
})
|
||||
|
||||
const pro = process.env.NUXT_UI_PRO_PATH
|
||||
? {
|
||||
cwd: resolve(__dirname, process.env.NUXT_UI_PRO_PATH, 'docs'),
|
||||
include: 'content/**',
|
||||
prefix: '/'
|
||||
}
|
||||
: process.env.NUXT_GITHUB_TOKEN
|
||||
? {
|
||||
repository: 'https://github.com/nuxt/ui-pro/tree/v3',
|
||||
include: 'docs/content/**',
|
||||
prefix: '/',
|
||||
authToken: process.env.NUXT_GITHUB_TOKEN
|
||||
}
|
||||
: undefined
|
||||
|
||||
export const collections = {
|
||||
content: defineCollection({
|
||||
type: 'page',
|
||||
source: '**/*',
|
||||
schema: z.object({
|
||||
navigation: z.object({
|
||||
title: z.string().optional(),
|
||||
framework: z.string().optional()
|
||||
}),
|
||||
links: z.array(z.object({
|
||||
label: z.string(),
|
||||
icon: z.string(),
|
||||
avatar: z.object({
|
||||
src: z.string(),
|
||||
alt: z.string()
|
||||
}).optional(),
|
||||
to: z.string(),
|
||||
target: z.string().optional()
|
||||
}))
|
||||
})
|
||||
source: [{
|
||||
include: '**/*'
|
||||
}, pro!].filter(Boolean),
|
||||
schema
|
||||
})
|
||||
}
|
||||
|
||||
@@ -8,12 +8,12 @@ We're thrilled to introduce this major update to our UI library, bringing signif
|
||||
|
||||
## What's New in v3?
|
||||
|
||||
### Radix Vue
|
||||
### Reka UI (Radix Vue)
|
||||
|
||||
We've transitioned from [Headless UI](https://headlessui.com/) to [Radix Vue](https://www.radix-vue.com/) as our core component foundation. This shift brings several key advantages:
|
||||
We've transitioned from [Headless UI](https://headlessui.com/) to [Reka UI](https://reka-ui.com/) as our core component foundation. This shift brings several key advantages:
|
||||
|
||||
- **Extensive Component Library**: With 55+ primitives, Radix Vue significantly expands our component offerings.
|
||||
- **Active Development**: Radix Vue's growing popularity ensures ongoing improvements and updates.
|
||||
- **Extensive Component Library**: With 55+ primitives, Reka UI significantly expands our component offerings.
|
||||
- **Active Development**: Reka UI's growing popularity ensures ongoing improvements and updates.
|
||||
- **Enhanced Accessibility**: Built-in accessibility features align with our commitment to inclusive design.
|
||||
- **Vue 3 Optimization**: Seamless integration with Vue 3 and the Composition API.
|
||||
|
||||
@@ -28,8 +28,8 @@ Nuxt UI v3 integrates the latest Tailwind CSS v4 beta (released Nov 21, 2024), b
|
||||
- **CSS-first configuration**: A reimagined developer experience where you customize and extend the framework directly in CSS instead of a JavaScript configuration file.
|
||||
- **Designed for the modern web**: Built on native cascade layers, wide-gamut colors, and including first-class support for modern CSS features like container queries, @starting-style, popovers, and more.
|
||||
|
||||
::note
|
||||
For a comprehensive overview of Tailwind CSS v4 beta features, read the [prerelease documentation](https://tailwindcss.com/docs/v4-beta).
|
||||
::note{to="https://tailwindcss.com/docs/v4-beta" target="_blank"}
|
||||
For a comprehensive overview of Tailwind CSS v4 beta features, read the **prerelease documentation**.
|
||||
::
|
||||
|
||||
### Tailwind Variants
|
||||
@@ -103,7 +103,7 @@ Key points to consider:
|
||||
::
|
||||
|
||||
::accordion-item{label="How does Nuxt UI v3 handle accessibility?"}
|
||||
Nuxt UI v3 enhances accessibility through Radix Vue integration. This provides automatic ARIA attributes, keyboard navigation support, intelligent focus management, and screen reader announcements. While offering a strong foundation, proper implementation and testing in your specific use case remains crucial for full accessibility compliance. For more detailed information, refer to [Radix Vue's accessibility documentation](https://www.radix-vue.com/overview/accessibility.html).
|
||||
Nuxt UI v3 enhances accessibility through Reka UI integration. This provides automatic ARIA attributes, keyboard navigation support, intelligent focus management, and screen reader announcements. While offering a strong foundation, proper implementation and testing in your specific use case remains crucial for full accessibility compliance. For more detailed information, refer to [Reka UI's accessibility documentation](https://reka-ui.com/docs/overview/accessibility).
|
||||
::
|
||||
|
||||
::accordion-item{label="What is the testing approach for Nuxt UI v3?"}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: Installation
|
||||
description: 'Learn how to install and configure Nuxt UI in your Nuxt application.'
|
||||
navigation.framework: nuxt
|
||||
framework: nuxt
|
||||
module: ui
|
||||
---
|
||||
|
||||
::callout{to="/getting-started/installation/vue" icon="i-logos-vue" class="hidden"}
|
||||
@@ -10,6 +11,8 @@ Looking for the **Vue** version?
|
||||
|
||||
## Setup
|
||||
|
||||
### Add to a Nuxt project
|
||||
|
||||
::steps{level="4"}
|
||||
|
||||
#### Install the Nuxt UI v3 alpha package
|
||||
@@ -53,7 +56,7 @@ export default defineNuxtConfig({
|
||||
@import "@nuxt/ui";
|
||||
```
|
||||
|
||||
::note
|
||||
::tip
|
||||
Use the `css` property in your `nuxt.config.ts` to import your CSS file.
|
||||
|
||||
```ts [nuxt.config.ts]
|
||||
@@ -64,9 +67,10 @@ export default defineNuxtConfig({
|
||||
```
|
||||
::
|
||||
|
||||
::tip
|
||||
::callout{icon="i-simple-icons-visualstudiocode"}
|
||||
It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) extension for VSCode and add the following settings:
|
||||
```json
|
||||
|
||||
```json [settings.json]
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss"
|
||||
},
|
||||
@@ -77,8 +81,43 @@ It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.
|
||||
|
||||
::
|
||||
|
||||
#### Wrap your app with App component
|
||||
|
||||
```vue [app.vue]
|
||||
<template>
|
||||
<UApp>
|
||||
<NuxtPage />
|
||||
</UApp>
|
||||
</template>
|
||||
```
|
||||
|
||||
::note{to="/components/app"}
|
||||
The `App` component provides global configurations and is required for **Toast** and **Tooltip** components to work.
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
### Use our Nuxt Starter
|
||||
|
||||
Start your project with a Nuxt template with Nuxt UI v3 pre-configured by using our [Nuxt UI Starter](https://github.com/nuxt/starter/tree/ui3).
|
||||
|
||||
Create a new project locally by running the following command:
|
||||
|
||||
```bash [Terminal]
|
||||
npx nuxi@latest init -t ui3 <my-app>
|
||||
```
|
||||
|
||||
::note
|
||||
The `<my-app>` argument is the name of the directory where the project will be created, replace it with your project name.
|
||||
::
|
||||
|
||||
Once the installation is complete, navigate into your project and start the development server:
|
||||
|
||||
```bash [Terminal]
|
||||
cd <my-app>
|
||||
npm run dev
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
You can customize Nuxt UI by providing options in your `nuxt.config.ts`.
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: Installation
|
||||
description: 'Learn how to install and configure Nuxt UI in your Vue application.'
|
||||
navigation.framework: vue
|
||||
framework: vue
|
||||
module: ui
|
||||
---
|
||||
|
||||
::callout{to="/getting-started/installation/nuxt" icon="i-logos-nuxt-icon" class="hidden"}
|
||||
@@ -90,7 +91,7 @@ app.mount('#app')
|
||||
@import "@nuxt/ui";
|
||||
```
|
||||
|
||||
::note
|
||||
::tip
|
||||
Import the CSS file in your `main.ts`.
|
||||
|
||||
```ts [main.ts]{1}
|
||||
@@ -108,9 +109,10 @@ app.mount('#app')
|
||||
```
|
||||
::
|
||||
|
||||
::tip
|
||||
::callout{icon="i-simple-icons-visualstudiocode"}
|
||||
It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) extension for VSCode and add the following settings:
|
||||
```json
|
||||
|
||||
```json [settings.json]
|
||||
"files.associations": {
|
||||
"*.css": "tailwindcss"
|
||||
},
|
||||
@@ -121,6 +123,20 @@ It's recommended to install the [Tailwind CSS IntelliSense](https://marketplace.
|
||||
|
||||
::
|
||||
|
||||
#### Wrap your app with App component
|
||||
|
||||
```vue [App.vue]
|
||||
<template>
|
||||
<UApp>
|
||||
<RouterView />
|
||||
</UApp>
|
||||
</template>
|
||||
```
|
||||
|
||||
::note{to="/components/app"}
|
||||
The `App` component provides global configurations and is required for **Toast** and **Tooltip** components to work.
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
## Options
|
||||
|
||||
@@ -11,6 +11,9 @@ Nuxt UI v3 uses Tailwind CSS v4 beta, you can read the [prerelease documentation
|
||||
|
||||
Tailwind CSS v4 takes a CSS-first configuration approach, you now customize your theme with CSS variables inside a `@theme` directive:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -33,6 +36,34 @@ Tailwind CSS v4 takes a CSS-first configuration approach, you now customize your
|
||||
--color-green-950: #052E16;
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@theme {
|
||||
--font-sans: 'Public Sans', sans-serif;
|
||||
|
||||
--breakpoint-3xl: 1920px;
|
||||
|
||||
--color-green-50: #EFFDF5;
|
||||
--color-green-100: #D9FBE8;
|
||||
--color-green-200: #B3F5D1;
|
||||
--color-green-300: #75EDAE;
|
||||
--color-green-400: #00DC82;
|
||||
--color-green-500: #00C16A;
|
||||
--color-green-600: #00A155;
|
||||
--color-green-700: #007F45;
|
||||
--color-green-800: #016538;
|
||||
--color-green-900: #0A5331;
|
||||
--color-green-950: #052E16;
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
The `@theme` directive tells Tailwind to make new utilities and variants available based on these variables. It's the equivalent of the `theme.extend` key in Tailwind CSS v3 `tailwind.config.ts` file.
|
||||
|
||||
@@ -46,12 +77,27 @@ You can use the `@source` directive to add explicit content glob patterns if you
|
||||
|
||||
This can be useful when writing Tailwind classes in markdown files with [`@nuxt/content`](https://github.com/nuxt/content):
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
|
||||
@source "../content";
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@source "../content";
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::note{to="https://tailwindcss.com/docs/v4-beta#adding-content-sources"}
|
||||
Learn how to add content sources in Tailwind CSS v4.
|
||||
@@ -61,12 +107,27 @@ Learn how to add content sources in Tailwind CSS v4.
|
||||
|
||||
You can use the `@plugin` directive to import Tailwind CSS plugins.
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
|
||||
@plugin "@tailwindcss/typography";
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@plugin "@tailwindcss/typography";
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::note{to="https://tailwindcss.com/docs/v4-beta#using-plugins"}
|
||||
Learn more about using plugins in Tailwind CSS v4.
|
||||
@@ -98,6 +159,7 @@ Nuxt UI leverages Vite config to provide customizable color aliases based on [Ta
|
||||
|
||||
::framework-only
|
||||
#nuxt
|
||||
::div
|
||||
You can configure these color aliases at runtime in your `app.config.ts` file under the `ui.colors` key, allowing for dynamic theme customization without requiring an application rebuild:
|
||||
|
||||
```ts [app.config.ts]
|
||||
@@ -110,8 +172,10 @@ export default defineAppConfig({
|
||||
}
|
||||
})
|
||||
```
|
||||
::
|
||||
|
||||
#vue
|
||||
::div
|
||||
You can configure these color aliases at runtime in your `vite.config.ts` file under the `ui.colors` key:
|
||||
|
||||
```ts [vite.config.ts]
|
||||
@@ -135,6 +199,8 @@ export default defineConfig({
|
||||
```
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
::note
|
||||
Try the :prose-icon{name="i-lucide-swatch-book" class="text-[var(--ui-primary)]"} theme picker in the header above to change `primary` and `neutral` colors.
|
||||
::
|
||||
@@ -209,6 +275,9 @@ These color aliases are not automatically defined as Tailwind CSS colors, so cla
|
||||
|
||||
However, you can generate these classes using Tailwind's `@theme` directive, allowing you to use custom color utility classes while maintaining dynamic color aliases:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -227,6 +296,31 @@ However, you can generate these classes using Tailwind's `@theme` directive, all
|
||||
--color-primary-950: var(--ui-color-primary-950);
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@theme {
|
||||
--color-primary-50: var(--ui-color-primary-50);
|
||||
--color-primary-100: var(--ui-color-primary-100);
|
||||
--color-primary-200: var(--ui-color-primary-200);
|
||||
--color-primary-300: var(--ui-color-primary-300);
|
||||
--color-primary-400: var(--ui-color-primary-400);
|
||||
--color-primary-500: var(--ui-color-primary-500);
|
||||
--color-primary-600: var(--ui-color-primary-600);
|
||||
--color-primary-700: var(--ui-color-primary-700);
|
||||
--color-primary-800: var(--ui-color-primary-800);
|
||||
--color-primary-900: var(--ui-color-primary-900);
|
||||
--color-primary-950: var(--ui-color-primary-950);
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
### Tokens
|
||||
@@ -270,6 +364,9 @@ You can use these variables in classes like `text-[var(--ui-primary)]`, it will
|
||||
::tip
|
||||
You can change which shade is used for each color on light and dark mode:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -282,6 +379,25 @@ You can change which shade is used for each color on light and dark mode:
|
||||
--ui-primary: var(--ui-color-primary-200);
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
:root {
|
||||
--ui-primary: var(--ui-color-primary-700);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--ui-primary: var(--ui-color-primary-200);
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
#### Neutral Palette
|
||||
@@ -375,6 +491,9 @@ body {
|
||||
::tip
|
||||
You can customize these CSS variables to tailor the appearance of your application:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -389,6 +508,27 @@ You can customize these CSS variables to tailor the appearance of your applicati
|
||||
--ui-border: var(--ui-color-neutral-900);
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
:root {
|
||||
--ui-bg: var(--ui-color-neutral-50);
|
||||
--ui-text: var(--ui-color-neutral-900);
|
||||
}
|
||||
|
||||
.dark {
|
||||
--ui-bg: var(--ui-color-neutral-950);
|
||||
--ui-border: var(--ui-color-neutral-900);
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
#### Border Radius
|
||||
@@ -408,6 +548,9 @@ Try the :prose-icon{name="i-lucide-swatch-book" class="text-[var(--ui-primary)]"
|
||||
::tip
|
||||
You can customize the default radius value using the default Tailwind CSS variables or a value of your choice:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -416,6 +559,21 @@ You can customize the default radius value using the default Tailwind CSS variab
|
||||
--ui-radius: var(--radius-sm);
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
:root {
|
||||
--ui-radius: var(--radius-sm);
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
#### Container
|
||||
@@ -431,6 +589,9 @@ Nuxt UI uses a global `--ui-container` CSS variable to define the width of the c
|
||||
::tip
|
||||
You can customize the default container width using the default Tailwind CSS variables or a value of your choice:
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -443,6 +604,25 @@ You can customize the default container width using the default Tailwind CSS var
|
||||
--ui-container: var(--container-8xl);
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@theme {
|
||||
--container-8xl: 90rem;
|
||||
}
|
||||
|
||||
:root {
|
||||
--ui-container: var(--container-8xl);
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
## Components theme
|
||||
@@ -570,20 +750,21 @@ These default values can be customized in your [`vite.config.ts`](#config) to ad
|
||||
You have multiple ways to customize the appearance of Nuxt UI components, you can do it for all components at once or on a per-component basis.
|
||||
|
||||
::note
|
||||
Tailwind Variants uses [tailwind-merge](https://github.com/dcastil/tailwind-merge) under the hood to merge classes so you don't have to worry about conflicting classes.
|
||||
Tailwind Variants uses [`tailwind-merge`](https://github.com/dcastil/tailwind-merge) under the hood to merge classes so you don't have to worry about conflicting classes.
|
||||
::
|
||||
|
||||
::tip
|
||||
You can explore the theme for each component in two ways:
|
||||
|
||||
- Check the `Theme` section in the documentation of each individual component.
|
||||
- Browse the source code directly in the GitHub repository at https://github.com/nuxt/ui/tree/v3/src/theme.
|
||||
- Browse the source code directly in the GitHub repository at [`v3/src/theme`](https://github.com/nuxt/ui/tree/v3/src/theme).
|
||||
::
|
||||
|
||||
### Config
|
||||
|
||||
::framework-only
|
||||
#nuxt
|
||||
::div
|
||||
You can override the theme of components globally inside your `app.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:
|
||||
@@ -599,8 +780,10 @@ export default defineAppConfig({
|
||||
}
|
||||
})
|
||||
```
|
||||
::
|
||||
|
||||
#vue
|
||||
::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:
|
||||
@@ -627,6 +810,8 @@ export default defineConfig({
|
||||
```
|
||||
::
|
||||
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, the `font-bold` class will override the default `font-medium` class on all buttons.
|
||||
::
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Icons
|
||||
description: 'Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.'
|
||||
navigation.framework: nuxt
|
||||
framework: nuxt
|
||||
links:
|
||||
- label: 'Iconify'
|
||||
to: https://iconify.design/
|
||||
@@ -124,6 +124,6 @@ Read more about this in the `@nuxt/icon` documentation.
|
||||
|
||||
## Theme
|
||||
|
||||
You can change the default icons used by Nuxt UI components in your `app.config.ts`:
|
||||
You can change the default icons used by components in your `app.config.ts`:
|
||||
|
||||
:icons-theme
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Icons
|
||||
description: 'Nuxt UI integrates with Iconify to access over 200,000+ icons.'
|
||||
navigation.framework: vue
|
||||
framework: vue
|
||||
links:
|
||||
- label: 'Iconify'
|
||||
to: https://iconify.design/
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Fonts
|
||||
description: 'Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.'
|
||||
navigation.framework: nuxt
|
||||
framework: nuxt
|
||||
links:
|
||||
- label: 'nuxt/fonts'
|
||||
to: https://github.com/nuxt/fonts
|
||||
@@ -13,6 +13,9 @@ links:
|
||||
|
||||
Nuxt UI automatically registers the [`@nuxt/fonts`](https://github.com/nuxt/fonts) module for you, so there's no additional setup required. To use a font in your Nuxt UI application, you can simply declare it in your CSS. It will be automatically loaded and optimized for you.
|
||||
|
||||
::module-only
|
||||
#ui
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui";
|
||||
@@ -21,6 +24,20 @@ Nuxt UI automatically registers the [`@nuxt/fonts`](https://github.com/nuxt/font
|
||||
--font-sans: 'Public Sans', sans-serif;
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
#ui-pro
|
||||
:::div
|
||||
```css [main.css]
|
||||
@import "tailwindcss";
|
||||
@import "@nuxt/ui-pro";
|
||||
|
||||
@theme {
|
||||
--font-sans: 'Public Sans', sans-serif;
|
||||
}
|
||||
```
|
||||
:::
|
||||
::
|
||||
|
||||
You can disable the `@nuxt/fonts` module with the `ui.fonts` option in your `nuxt.config.ts`:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Color Mode
|
||||
description: 'Nuxt UI integrates with Nuxt Color Mode to allow for easy switching between light and dark themes.'
|
||||
navigation.framework: nuxt
|
||||
framework: nuxt
|
||||
links:
|
||||
- label: 'nuxtjs/color-mode'
|
||||
to: https://github.com/nuxt-modules/color-mode
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Color Mode
|
||||
description: 'Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.'
|
||||
navigation.framework: vue
|
||||
framework: vue
|
||||
---
|
||||
|
||||
::callout{to="/getting-started/color-mode/nuxt" icon="i-logos-nuxt-icon" class="hidden"}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Internationalization (i18n)
|
||||
description: 'Learn how to internationalize your Nuxt app with multi-directional support (LTR/RTL).'
|
||||
navigation.framework: nuxt
|
||||
framework: nuxt
|
||||
---
|
||||
|
||||
::callout{to="/getting-started/i18n/vue" icon="i-logos-vue" class="hidden"}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Internationalization (i18n)
|
||||
description: 'Learn how to internationalize your Vue app with multi-directional support (LTR/RTL).'
|
||||
navigation.framework: vue
|
||||
framework: vue
|
||||
---
|
||||
|
||||
::callout{to="/getting-started/i18n/nuxt" icon="i-logos-nuxt-icon" class="hidden"}
|
||||
|
||||
@@ -18,7 +18,7 @@ const toast = useToast()
|
||||
- When removing a toast, there's a 200ms delay before it's actually removed from the state, allowing for exit animations.
|
||||
|
||||
::warning
|
||||
Make sure to wrap your app with the [App](/components/app) component which uses our [Toaster](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Toaster.vue) component which uses the [ToastProvider](https://www.radix-vue.com/components/toast.html#provider) component from Radix Vue.
|
||||
Make sure to wrap your app with the [`App`](/components/app) component which uses our [`Toaster`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Toaster.vue) component which uses the [`ToastProvider`](https://reka-ui.com/docs/components/toast#provider) component from Reka UI.
|
||||
::
|
||||
|
||||
::tip{to="/components/toast"}
|
||||
|
||||
@@ -9,13 +9,13 @@ links:
|
||||
|
||||
## Usage
|
||||
|
||||
This component implements Radix Vue [ConfigProvider](https://www.radix-vue.com/utilities/config-provider.html) to provide global configuration to all components:
|
||||
This component implements Reka UI [ConfigProvider](https://reka-ui.com/docs/utilities/config-provider) to provide global configuration to all components:
|
||||
|
||||
- Enables all primitives to inherit global reading direction.
|
||||
- Enables changing the behavior of scroll body when setting body lock.
|
||||
- Much more controls to prevent layout shifts.
|
||||
|
||||
It's also using [ToastProvider](https://www.radix-vue.com/components/toast.html#provider) and [TooltipProvider](https://www.radix-vue.com/components/tooltip.html#provider) to provide global toasts and tooltips, as well as programmatic modals and slideovers.
|
||||
It's also using [ToastProvider](https://reka-ui.com/docs/components/toast#provider) and [TooltipProvider](https://reka-ui.com/docs/components/tooltip#provider) to provide global toasts and tooltips, as well as programmatic modals and slideovers.
|
||||
|
||||
Use it as at the root of your app:
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A stacked set of collapsible panels.
|
||||
links:
|
||||
- label: Accordion
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/accordion.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/accordion
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Accordion.vue
|
||||
@@ -104,6 +104,38 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
### Unmount
|
||||
|
||||
Use the `unmount-on-hide` prop to prevent the content from being unmounted when the accordion is collapsed. Defaults to `true`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- items
|
||||
external:
|
||||
- items
|
||||
hide:
|
||||
- class
|
||||
props:
|
||||
class: 'px-4'
|
||||
unmountOnHide: false
|
||||
items:
|
||||
- label: 'Icons'
|
||||
icon: 'i-lucide-smile'
|
||||
content: 'You have nothing to do, @nuxt/icon will handle it automatically.'
|
||||
- label: 'Colors'
|
||||
icon: 'i-lucide-swatch-book'
|
||||
content: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
|
||||
- label: 'Components'
|
||||
icon: 'i-lucide-box'
|
||||
content: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
You can inspect the DOM to see each item's content being rendered.
|
||||
::
|
||||
|
||||
### Disabled
|
||||
|
||||
Use the `disabled` property to disable the Accordion.
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: An img element with fallback and Nuxt Image support.
|
||||
links:
|
||||
- label: Avatar
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/avatar.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/avatar
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Avatar.vue
|
||||
|
||||
@@ -184,7 +184,7 @@ This also works with the [Form](/components/form) component.
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
|
||||
@@ -3,8 +3,8 @@ title: Calendar
|
||||
description: A calendar component for selecting single dates, multiple dates or date ranges.
|
||||
links:
|
||||
- label: Calendar
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/calendar.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://www.reka-ui.com/components/calendar.html
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Calendar.vue
|
||||
@@ -12,7 +12,7 @@ navigation.badge: New
|
||||
---
|
||||
|
||||
::note
|
||||
This component relies on the [@internationalized/date](https://react-spectrum.adobe.com/internationalized/date/index.html) package which provides objects and functions for representing and manipulating dates and times in a locale-aware manner.
|
||||
This component relies on the [`@internationalized/date`](https://react-spectrum.adobe.com/internationalized/date/index.html) package which provides objects and functions for representing and manipulating dates and times in a locale-aware manner.
|
||||
::
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: An input element to toggle between checked and unchecked states.
|
||||
links:
|
||||
- label: Checkbox
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/checkbox.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/checkbox
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Checkbox.vue
|
||||
@@ -37,12 +37,14 @@ props:
|
||||
|
||||
### Indeterminate
|
||||
|
||||
Use the `indeterminate` prop to set the Checkbox to an [indeterminate state](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).
|
||||
Use the `indeterminate` value in the `v-model` directive or `default-value` prop to set the Checkbox to an [indeterminate state](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes).
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- defaultValue
|
||||
props:
|
||||
indeterminate: true
|
||||
defaultValue: 'indeterminate'
|
||||
---
|
||||
::
|
||||
|
||||
@@ -52,8 +54,10 @@ Use the `indeterminate-icon` prop to customize the indeterminate icon. Defaults
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- defaultValue
|
||||
props:
|
||||
indeterminate: true
|
||||
defaultValue: 'indeterminate'
|
||||
indeterminateIcon: 'i-lucide-plus'
|
||||
---
|
||||
::
|
||||
|
||||
@@ -120,7 +120,7 @@ props:
|
||||
::
|
||||
|
||||
::note
|
||||
It's used this way in the [CommandPalette](/components/command-palette), [InputMenu](/components/input-menu), [Select](/components/select) or [SelectMenu](/components/select-menu) components for example.
|
||||
It's used this way in the [`CommandPalette`](/components/command-palette), [`InputMenu`](/components/input-menu), [`Select`](/components/select) or [`SelectMenu`](/components/select-menu) components for example.
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A collapsible element to toggle visibility of its content.
|
||||
links:
|
||||
- label: Collapsible
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/collapsible.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/collapsible
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Collapsible.vue
|
||||
@@ -38,6 +38,38 @@ slots:
|
||||
:placeholder{class="h-48"}
|
||||
::
|
||||
|
||||
### Unmount
|
||||
|
||||
Use the `unmount-on-hide` prop to prevent the content from being unmounted when the Collapsible is collapsed. Defaults to `true`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
prettier: true
|
||||
ignore:
|
||||
- class
|
||||
props:
|
||||
unmountOnHide: false
|
||||
class: 'flex flex-col gap-2 w-48'
|
||||
slots:
|
||||
default: |
|
||||
|
||||
<UButton label="Open" color="neutral" variant="subtle" trailing-icon="i-lucide-chevron-down" block />
|
||||
|
||||
content: |
|
||||
|
||||
<Placeholder class="h-48" />
|
||||
---
|
||||
|
||||
:u-button{label="Open" color="neutral" variant="subtle" trailing-icon="i-lucide-chevron-down" block}
|
||||
|
||||
#content
|
||||
:placeholder{class="h-48"}
|
||||
::
|
||||
|
||||
::note
|
||||
You can inspect the DOM to see the content being rendered.
|
||||
::
|
||||
|
||||
### Disabled
|
||||
|
||||
Use the `disabled` prop to disable the Collapsible.
|
||||
@@ -79,7 +111,7 @@ name: 'collapsible-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Collapsible by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Collapsible by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
::tip
|
||||
|
||||
150
docs/content/3.components/color-picker.md
Normal file
150
docs/content/3.components/color-picker.md
Normal file
@@ -0,0 +1,150 @@
|
||||
---
|
||||
title: ColorPicker
|
||||
description: A component to select a color.
|
||||
links:
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/ColorPicker.vue
|
||||
navigation.badge: New
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
Use the `v-model` directive to control the value of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- modelValue
|
||||
external:
|
||||
- modelValue
|
||||
props:
|
||||
modelValue: '#00C16A'
|
||||
---
|
||||
::
|
||||
|
||||
Use the `default-value` prop to set the initial value when you do not need to control its state.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- defaultValue
|
||||
props:
|
||||
defaultValue: '#00BCD4'
|
||||
---
|
||||
::
|
||||
|
||||
### RGB Format
|
||||
|
||||
Use the `format` prop to set `rgb` value of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- modelValue
|
||||
- format
|
||||
external:
|
||||
- modelValue
|
||||
props:
|
||||
format: rgb
|
||||
modelValue: 'rgb(0, 193, 106)'
|
||||
---
|
||||
::
|
||||
|
||||
### HSL Format
|
||||
|
||||
Use the `format` prop to set `hsl` value of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- modelValue
|
||||
- format
|
||||
external:
|
||||
- modelValue
|
||||
props:
|
||||
format: hsl
|
||||
modelValue: 'hsl(153, 100%, 37.8%)'
|
||||
---
|
||||
::
|
||||
|
||||
### HWB Format
|
||||
|
||||
Use the `format` prop to set `hwb` value of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- modelValue
|
||||
- format
|
||||
external:
|
||||
- modelValue
|
||||
props:
|
||||
format: hwb
|
||||
modelValue: 'hwb(150, 0%, 24%)'
|
||||
---
|
||||
::
|
||||
|
||||
### Throttle
|
||||
|
||||
Use the `throttle` prop to set the throttle value of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- modelValue
|
||||
external:
|
||||
- modelValue
|
||||
props:
|
||||
throttle: 100
|
||||
modelValue: '#00C16A'
|
||||
---
|
||||
::
|
||||
|
||||
### Size
|
||||
|
||||
Use the `size` prop to set the size of the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
props:
|
||||
size: xl
|
||||
---
|
||||
::
|
||||
|
||||
### Disabled
|
||||
|
||||
Use the `disabled` prop to disable the ColorPicker.
|
||||
|
||||
::component-code
|
||||
---
|
||||
props:
|
||||
disabled: true
|
||||
---
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
### As a Color chooser
|
||||
|
||||
Use a [Button](/components/button) and a [Popover](/components/popover) component to create a color chooser.
|
||||
|
||||
::component-example
|
||||
---
|
||||
name: 'color-picker-chooser-example'
|
||||
---
|
||||
::
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
||||
:component-props
|
||||
|
||||
### Emits
|
||||
|
||||
:component-emits
|
||||
|
||||
## Theme
|
||||
|
||||
:component-theme
|
||||
@@ -6,8 +6,8 @@ links:
|
||||
to: https://fusejs.io/
|
||||
target: _blank
|
||||
- label: Combobox
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/combobox.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/combobox
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/CommandPalette.vue
|
||||
@@ -29,7 +29,7 @@ The CommandPalette component filters groups and ranks matching commands by relev
|
||||
- `label?: string`{lang="ts-type"}
|
||||
- `slot?: string`{lang="ts-type"}
|
||||
- `items?: CommandPaletteItem[]`{lang="ts-type"}
|
||||
- [`filter?: boolean`{lang="ts-type"}](#without-internal-search)
|
||||
- [`ignoreFilter?: boolean`{lang="ts-type"}](#with-ignore-filter)
|
||||
- [`postFilter?: (searchTerm: string, items: T[]) => T[]`{lang="ts-type"}](#with-post-filtered-items)
|
||||
- `highlightedIcon?: string`{lang="ts-type"}
|
||||
|
||||
@@ -258,7 +258,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -478,20 +478,20 @@ class: '!p-0'
|
||||
---
|
||||
::
|
||||
|
||||
### Without internal search
|
||||
### With ignore filter
|
||||
|
||||
You can set the `filter` field to `false` on a group to disable the internal search and use your own search logic.
|
||||
You can set the `ignoreFilter` field to `true` on a group to disable the internal search and use your own search logic.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'command-palette-filter-example'
|
||||
name: 'command-palette-ignore-filter-example'
|
||||
class: '!p-0'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
This example uses [refDebounced](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
This example uses [`refDebounced`](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
::
|
||||
|
||||
### With post-filtered items
|
||||
@@ -585,7 +585,7 @@ name: 'command-palette-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
This can be useful when using the CommandPalette inside a [Modal](/components/modal) for example.
|
||||
This can be useful when using the CommandPalette inside a [`Modal`](/components/modal) for example.
|
||||
::
|
||||
|
||||
### With custom slot
|
||||
|
||||
@@ -3,8 +3,8 @@ title: ContextMenu
|
||||
description: A menu to display actions when right-clicking on an element.
|
||||
links:
|
||||
- label: ContextMenu
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/context-menu.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/context-menu
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/ContextMenu.vue
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A drawer that smoothly slides in & out of the screen.
|
||||
links:
|
||||
- label: Drawer
|
||||
icon: i-custom-radix-vue
|
||||
to: https://github.com/radix-vue/vaul-vue
|
||||
icon: i-custom-reka-ui
|
||||
to: https://github.com/unovue/vaul-vue
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Drawer.vue
|
||||
@@ -259,7 +259,7 @@ name: 'drawer-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Drawer by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Drawer by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
::tip
|
||||
|
||||
@@ -3,8 +3,8 @@ title: DropdownMenu
|
||||
description: A menu to display actions when clicking on an element.
|
||||
links:
|
||||
- label: DropdownMenu
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/dropdown-menu.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/dropdown-menu
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/DropdownMenu.vue
|
||||
@@ -301,7 +301,7 @@ name: 'dropdown-menu-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the DropdownMenu by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the DropdownMenu by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
### With custom slot
|
||||
|
||||
@@ -117,7 +117,7 @@ options:
|
||||
::
|
||||
|
||||
::tip
|
||||
You can use the [useFormField](/composables/use-form-field) composable to implement this inside your own components.
|
||||
You can use the [`useFormField`](/composables/use-form-field) composable to implement this inside your own components.
|
||||
::
|
||||
|
||||
### Error Event
|
||||
|
||||
@@ -3,8 +3,8 @@ title: InputMenu
|
||||
description: An autocomplete input with real-time suggestions.
|
||||
links:
|
||||
- label: Combobox
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/combobox.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/combobox
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/InputMenu.vue
|
||||
@@ -15,11 +15,11 @@ links:
|
||||
Use the `v-model` directive to control the value of the InputMenu or the `default-value` prop to set the initial value when you do not need to control its state.
|
||||
|
||||
::tip
|
||||
Use this over an [Input](/components/input) to take advantage of Radix Vue's [Combobox](https://www.radix-vue.com/components/combobox.html) component that offers autocomplete capabilities.
|
||||
Use this over an [`Input`](/components/input) to take advantage of Reka UI's [`Combobox`](https://reka-ui.com/docs/components/combobox) component that offers autocomplete capabilities.
|
||||
::
|
||||
|
||||
::note
|
||||
This component is similar to the [SelectMenu](/components/select-menu) but it's using an Input instead of a Select.
|
||||
This component is similar to the [`SelectMenu`](/components/select-menu) but it's using an Input instead of a Select.
|
||||
::
|
||||
|
||||
### Items
|
||||
@@ -222,42 +222,6 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
### Create Item
|
||||
|
||||
Use the `create-item` prop to allow user input.
|
||||
|
||||
::component-code
|
||||
---
|
||||
prettier: true
|
||||
ignore:
|
||||
- modelValue
|
||||
- items
|
||||
external:
|
||||
- items
|
||||
- modelValue
|
||||
items:
|
||||
createItem:
|
||||
- true
|
||||
- 'always'
|
||||
props:
|
||||
modelValue: 'Backlog'
|
||||
items:
|
||||
- Backlog
|
||||
- Todo
|
||||
- In Progress
|
||||
- Done
|
||||
createItem: true
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
The create option shows when no match is found by default. Set it to `always` to show it even when similar values exist.
|
||||
::
|
||||
|
||||
::tip{to="#emits"}
|
||||
Use the `@create` event to handle the creation of the item. You will receive the event and the item as arguments.
|
||||
::
|
||||
|
||||
### Content
|
||||
|
||||
Use the `content` prop to control how the InputMenu content is rendered, like its `align` or `side` for example.
|
||||
@@ -282,7 +246,7 @@ items:
|
||||
- top
|
||||
- bottom
|
||||
props:
|
||||
modelValue: Backlog
|
||||
modelValue: 'Backlog'
|
||||
content:
|
||||
align: center
|
||||
side: bottom
|
||||
@@ -310,7 +274,7 @@ external:
|
||||
- items
|
||||
- modelValue
|
||||
props:
|
||||
modelValue: Backlog
|
||||
modelValue: 'Backlog'
|
||||
arrow: true
|
||||
items:
|
||||
- Backlog
|
||||
@@ -551,7 +515,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -701,7 +665,7 @@ name: 'input-menu-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the InputMenu by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the InputMenu by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
### Control open state on focus
|
||||
@@ -734,6 +698,25 @@ name: 'input-menu-icon-example'
|
||||
---
|
||||
::
|
||||
|
||||
### With create item
|
||||
|
||||
Use the `create-item` prop to enable users to add custom values that aren't in the predefined options.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'input-menu-create-item-example'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
The create option shows when no match is found by default. Set it to `always` to show it even when similar values exist.
|
||||
::
|
||||
|
||||
::tip{to="#emits"}
|
||||
Use the `@create` event to handle the creation of the item. You will receive the event and the item as arguments.
|
||||
::
|
||||
|
||||
### With fetched items
|
||||
|
||||
You can fetch items from an API and use them in the InputMenu.
|
||||
@@ -745,24 +728,24 @@ name: 'input-menu-fetch-example'
|
||||
---
|
||||
::
|
||||
|
||||
### Without internal search
|
||||
### With ignore filter
|
||||
|
||||
Set the `filter` prop to `false` to disable the internal search and use your own search logic.
|
||||
Set the `ignore-filter` prop to `true` to disable the internal search and use your own search logic.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'input-menu-filter-example'
|
||||
name: 'input-menu-ignore-filter-example'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
This example uses [refDebounced](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
This example uses [`refDebounced`](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
::
|
||||
|
||||
### With custom search
|
||||
### With filter fields
|
||||
|
||||
Use the `filter` prop with an array of fields to filter on. Defaults to `[labelKey]`.
|
||||
Use the `filter-fields` prop with an array of fields to filter on. Defaults to `[labelKey]`.
|
||||
|
||||
::component-example
|
||||
---
|
||||
|
||||
@@ -3,8 +3,8 @@ title: InputNumber
|
||||
description: Input numerical values with a customizable range.
|
||||
links:
|
||||
- label: Number Field
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/number-field
|
||||
icon: i-custom-reka-ui
|
||||
to: https://www.reka-ui.com/components/input-number
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/InputNumber.vue
|
||||
@@ -12,7 +12,7 @@ navigation.badge: New
|
||||
---
|
||||
|
||||
::note
|
||||
This component relies on the [@internationalized/number](https://react-spectrum.adobe.com/internationalized/number/index.html) package which provides utilities for formatting and parsing numbers across locales and numbering systems.
|
||||
This component relies on the [`@internationalized/number`](https://react-spectrum.adobe.com/internationalized/number/index.html) package which provides utilities for formatting and parsing numbers across locales and numbering systems.
|
||||
::
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -171,7 +171,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
|
||||
@@ -18,7 +18,7 @@ The Link component is a wrapper around [`<NuxtLink>`](https://nuxt.com/docs/api/
|
||||
The incentive behind this is to provide the same API as NuxtLink back in Nuxt 2 / Vue 2. You can read more about it in the Vue Router [migration from Vue 2](https://router.vuejs.org/guide/migration/#removal-of-the-exact-prop-in-router-link) guide.
|
||||
|
||||
::note
|
||||
It is used by the [Breadcrumb](/components/breadcrumb), [Button](/components/button), [ContextMenu](/components/context-menu), [DropdownMenu](/components/dropdown-menu) and [NavigationMenu](/components/navigation-menu) components.
|
||||
It is used by the [`Breadcrumb`](/components/breadcrumb), [`Button`](/components/button), [`ContextMenu`](/components/context-menu), [`DropdownMenu`](/components/dropdown-menu) and [`NavigationMenu`](/components/navigation-menu) components.
|
||||
::
|
||||
|
||||
### Tag
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A dialog window that can be used to display a message or request user input.
|
||||
links:
|
||||
- label: Dialog
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/dialog.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/dialog
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Modal.vue
|
||||
@@ -295,7 +295,7 @@ name: 'modal-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Modal by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Modal by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
::tip
|
||||
@@ -307,7 +307,7 @@ This allows you to move the trigger outside of the Modal or remove it entirely.
|
||||
You can use the [`useModal`](/composables/use-modal) composable to open a Modal programatically.
|
||||
|
||||
::warning
|
||||
Make sure to wrap your app with the [App](/components/app) component which uses the [ModalProvider](https://github.com/nuxt/ui/blob/v3/src/runtime/components/ModalProvider.vue) component.
|
||||
Make sure to wrap your app with the [`App`](/components/app) component which uses the [`ModalProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/ModalProvider.vue) component.
|
||||
::
|
||||
|
||||
First, create a modal component that will be opened programatically:
|
||||
|
||||
@@ -3,8 +3,8 @@ title: NavigationMenu
|
||||
description: A list of links that can be displayed horizontally or vertically.
|
||||
links:
|
||||
- label: NavigationMenu
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/navigation-menu.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/navigation-menu
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/NavigationMenu.vue
|
||||
@@ -249,7 +249,7 @@ external:
|
||||
- items
|
||||
props:
|
||||
highlight: true
|
||||
highlightColor: ''
|
||||
highlightColor: 'primary'
|
||||
orientation: 'horizontal'
|
||||
items:
|
||||
- - label: Guide
|
||||
@@ -538,6 +538,98 @@ props:
|
||||
The arrow is animated to follow the active item.
|
||||
::
|
||||
|
||||
### Unmount
|
||||
|
||||
Use the `unmount-on-hide` prop to control the content unmounting behavior. Defaults to `true`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
collapse: true
|
||||
ignore:
|
||||
- items
|
||||
- arrow
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
unmountOnHide: false
|
||||
items:
|
||||
- label: Guide
|
||||
icon: i-lucide-book-open
|
||||
to: /getting-started
|
||||
children:
|
||||
- label: Introduction
|
||||
description: Fully styled and customizable components for Nuxt.
|
||||
icon: i-lucide-house
|
||||
- label: Installation
|
||||
description: Learn how to install and configure Nuxt UI in your application.
|
||||
icon: i-lucide-cloud-download
|
||||
- label: 'Icons'
|
||||
icon: 'i-lucide-smile'
|
||||
description: 'You have nothing to do, @nuxt/icon will handle it automatically.'
|
||||
- label: 'Colors'
|
||||
icon: 'i-lucide-swatch-book'
|
||||
description: 'Choose a primary and a neutral color from your Tailwind CSS theme.'
|
||||
- label: 'Theme'
|
||||
icon: 'i-lucide-cog'
|
||||
description: 'You can customize components by using the `class` / `ui` props or in your app.config.ts.'
|
||||
- label: Composables
|
||||
icon: i-lucide-database
|
||||
to: /composables
|
||||
children:
|
||||
- label: defineShortcuts
|
||||
icon: i-lucide-file-text
|
||||
description: Define shortcuts for your application.
|
||||
to: /composables/define-shortcuts
|
||||
- label: useModal
|
||||
icon: i-lucide-file-text
|
||||
description: Display a modal within your application.
|
||||
to: /composables/use-modal
|
||||
- label: useSlideover
|
||||
icon: i-lucide-file-text
|
||||
description: Display a slideover within your application.
|
||||
to: /composables/use-slideover
|
||||
- label: useToast
|
||||
icon: i-lucide-file-text
|
||||
description: Display a toast within your application.
|
||||
to: /composables/use-toast
|
||||
- label: Components
|
||||
icon: i-lucide-box
|
||||
to: /components
|
||||
active: true
|
||||
children:
|
||||
- label: Link
|
||||
icon: i-lucide-file-text
|
||||
description: Use NuxtLink with superpowers.
|
||||
to: /components/link
|
||||
- label: Modal
|
||||
icon: i-lucide-file-text
|
||||
description: Display a modal within your application.
|
||||
to: /components/modal
|
||||
- label: NavigationMenu
|
||||
icon: i-lucide-file-text
|
||||
description: Display a list of links.
|
||||
to: /components/navigation-menu
|
||||
- label: Pagination
|
||||
icon: i-lucide-file-text
|
||||
description: Display a list of pages.
|
||||
to: /components/pagination
|
||||
- label: Popover
|
||||
icon: i-lucide-file-text
|
||||
description: Display a non-modal dialog that floats around a trigger element.
|
||||
to: /components/popover
|
||||
- label: Progress
|
||||
icon: i-lucide-file-text
|
||||
description: Show a horizontal bar to indicate task progression.
|
||||
to: /components/progress
|
||||
class: 'justify-center'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
You can inspect the DOM to see each item's content being rendered.
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
### Control active item
|
||||
@@ -552,7 +644,7 @@ name: 'navigation-menu-model-value-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can switch the active item by pressing :kbd{value="1"}, :kbd{value="2"}, or :kbd{value="3"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can switch the active item by pressing :kbd{value="1"}, :kbd{value="2"}, or :kbd{value="3"}.
|
||||
::
|
||||
|
||||
::tip
|
||||
@@ -592,7 +684,7 @@ name: 'navigation-menu-content-slot-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, we add the `sm:w-[var(--radix-navigation-menu-viewport-width)]` class on the `viewport` to have a dynamic width. This requires to set a width on the content's first child.
|
||||
In this example, we add the `sm:w-[var(--reka-navigation-menu-viewport-width)]` class on the `viewport` to have a dynamic width. This requires to set a width on the content's first child.
|
||||
::
|
||||
|
||||
## API
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A list of buttons or links to navigate through pages.
|
||||
links:
|
||||
- label: Pagination
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/pagination.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/pagination
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Pagination.vue
|
||||
@@ -14,7 +14,7 @@ links:
|
||||
Use the `default-page` prop or the `v-model:page` directive to control the current page.
|
||||
|
||||
::note
|
||||
The Pagination component uses some [Button](/components/button) to display the pages, use [`color`](#color), [`variant`](#variant) and [`size`](#size) props to style them.
|
||||
The Pagination component uses some [`Button`](/components/button) to display the pages, use [`color`](#color), [`variant`](#variant) and [`size`](#size) props to style them.
|
||||
::
|
||||
|
||||
### Total
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
---
|
||||
description: A non-modal dialog that floats around a trigger element.
|
||||
links:
|
||||
- label: HoverCard
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/hover-card
|
||||
- label: Popover
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/popover.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/popover
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Popover.vue
|
||||
@@ -64,7 +67,7 @@ slots:
|
||||
::
|
||||
|
||||
::note
|
||||
When using the `hover` mode, the Radix Vue [HoverCard](https://www.radix-vue.com/components/hover-card.html) component is used instead of the [Popover](https://www.radix-vue.com/components/popover.html).
|
||||
When using the `hover` mode, the Reka UI [`HoverCard`](https://reka-ui.com/docs/components/hover-card) component is used instead of the [`Popover`](https://reka-ui.com/docs/components/popover).
|
||||
::
|
||||
|
||||
### Delay
|
||||
@@ -174,7 +177,7 @@ name: 'popover-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Popover by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Popover by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
### With command palette
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: An indicator showing the progress of a task.
|
||||
links:
|
||||
- label: Progress
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/progress.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/progress
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Progress.vue
|
||||
|
||||
@@ -3,8 +3,8 @@ title: RadioGroup
|
||||
description: A set of radio buttons to select a single option from a list.
|
||||
links:
|
||||
- label: RadioGroup
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/radio-group.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/radio-group
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/RadioGroup.vue
|
||||
|
||||
@@ -3,8 +3,8 @@ title: SelectMenu
|
||||
description: An advanced searchable select element.
|
||||
links:
|
||||
- label: Combobox
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/combobox.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/combobox
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/SelectMenu.vue
|
||||
@@ -15,11 +15,11 @@ links:
|
||||
Use the `v-model` directive to control the value of the SelectMenu or the `default-value` prop to set the initial value when you do not need to control its state.
|
||||
|
||||
::tip
|
||||
Use this over a [Select](/components/select) to take advantage of Radix Vue's [Combobox](https://www.radix-vue.com/components/combobox.html) component that offers search capabilities and multiple selection.
|
||||
Use this over a [`Select`](/components/select) to take advantage of Reka UI's [`Combobox`](https://reka-ui.com/docs/components/combobox) component that offers search capabilities and multiple selection.
|
||||
::
|
||||
|
||||
::note
|
||||
This component is similar to the [InputMenu](/components/input-menu) but it's using a Select instead of an Input with the search inside the menu.
|
||||
This component is similar to the [`InputMenu`](/components/input-menu) but it's using a Select instead of an Input with the search inside the menu.
|
||||
::
|
||||
|
||||
### Items
|
||||
@@ -79,7 +79,7 @@ props:
|
||||
::
|
||||
|
||||
::caution
|
||||
Unlike the [Select](/components/select) component, the SelectMenu expects the whole object to be passed to the `v-model` directive or the `default-value` prop by default.
|
||||
Unlike the [`Select`](/components/select) component, the SelectMenu expects the whole object to be passed to the `v-model` directive or the `default-value` prop by default.
|
||||
::
|
||||
|
||||
You can also pass an array of arrays to the `items` prop to display separated groups of items.
|
||||
@@ -239,44 +239,6 @@ props:
|
||||
You can set the `search-input` prop to `false` to hide the search input.
|
||||
::
|
||||
|
||||
### Create Item
|
||||
|
||||
Use the `create-item` prop to allow user input.
|
||||
|
||||
::component-code
|
||||
---
|
||||
prettier: true
|
||||
ignore:
|
||||
- modelValue
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
- modelValue
|
||||
items:
|
||||
createItem:
|
||||
- true
|
||||
- 'always'
|
||||
props:
|
||||
modelValue: 'Backlog'
|
||||
createItem: true
|
||||
items:
|
||||
- Backlog
|
||||
- Todo
|
||||
- In Progress
|
||||
- Done
|
||||
class: 'w-48'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
The create option shows when no match is found by default. Set it to `always` to show it even when similar values exist.
|
||||
::
|
||||
|
||||
::tip{to="#emits"}
|
||||
Use the `@create` event to handle the creation of the item. You will receive the event and the item as arguments.
|
||||
::
|
||||
|
||||
### Content
|
||||
|
||||
Use the `content` prop to control how the SelectMenu content is rendered, like its `align` or `side` for example.
|
||||
@@ -302,7 +264,7 @@ items:
|
||||
- top
|
||||
- bottom
|
||||
props:
|
||||
modelValue: Backlog
|
||||
modelValue: 'Backlog'
|
||||
content:
|
||||
align: center
|
||||
side: bottom
|
||||
@@ -332,7 +294,7 @@ external:
|
||||
- items
|
||||
- modelValue
|
||||
props:
|
||||
modelValue: Backlog
|
||||
modelValue: 'Backlog'
|
||||
arrow: true
|
||||
items:
|
||||
- Backlog
|
||||
@@ -590,7 +552,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -746,7 +708,7 @@ name: 'select-menu-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the SelectMenu by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the SelectMenu by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
### Control search term
|
||||
@@ -769,6 +731,25 @@ name: 'select-menu-icon-example'
|
||||
---
|
||||
::
|
||||
|
||||
### With create item
|
||||
|
||||
Use the `create-item` prop to enable users to add custom values that aren't in the predefined options.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'select-menu-create-item-example'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
The create option shows when no match is found by default. Set it to `always` to show it even when similar values exist.
|
||||
::
|
||||
|
||||
::tip{to="#emits"}
|
||||
Use the `@create` event to handle the creation of the item. You will receive the event and the item as arguments.
|
||||
::
|
||||
|
||||
### With fetched items
|
||||
|
||||
You can fetch items from an API and use them in the SelectMenu.
|
||||
@@ -780,24 +761,24 @@ name: 'select-menu-fetch-example'
|
||||
---
|
||||
::
|
||||
|
||||
### Without internal search
|
||||
### With ignore filter
|
||||
|
||||
Set the `filter` prop to `false` to disable the internal search and use your own search logic.
|
||||
Set the `ignore-filter` prop to `true` to disable the internal search and use your own search logic.
|
||||
|
||||
::component-example
|
||||
---
|
||||
collapse: true
|
||||
name: 'select-menu-filter-example'
|
||||
name: 'select-menu-ignore-filter-example'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
This example uses [refDebounced](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
This example uses [`refDebounced`](https://vueuse.org/shared/refDebounced/#refdebounced) to debounce the API calls.
|
||||
::
|
||||
|
||||
### With custom search
|
||||
### With filter fields
|
||||
|
||||
Use the `filter` prop with an array of fields to filter on. Defaults to `[labelKey]`.
|
||||
Use the `filter-fields` prop with an array of fields to filter on. Defaults to `[labelKey]`.
|
||||
|
||||
::component-example
|
||||
---
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A select element to choose from a list of options.
|
||||
links:
|
||||
- label: Select
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/select.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/select
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Select.vue
|
||||
@@ -135,6 +135,39 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
### Multiple
|
||||
|
||||
Use the `multiple` prop to allow multiple selections, the selected items will be separated by a comma in the trigger.
|
||||
|
||||
::component-code
|
||||
---
|
||||
prettier: true
|
||||
ignore:
|
||||
- modelValue
|
||||
- items
|
||||
- multiple
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
- modelValue
|
||||
props:
|
||||
modelValue:
|
||||
- Backlog
|
||||
- Todo
|
||||
multiple: true
|
||||
items:
|
||||
- Backlog
|
||||
- Todo
|
||||
- In Progress
|
||||
- Done
|
||||
class: 'w-48'
|
||||
---
|
||||
::
|
||||
|
||||
::caution
|
||||
Ensure to pass an array to the `default-value` prop or the `v-model` directive.
|
||||
::
|
||||
|
||||
### Placeholder
|
||||
|
||||
Use the `placeholder` prop to set a placeholder text.
|
||||
@@ -160,11 +193,7 @@ props:
|
||||
|
||||
### Content
|
||||
|
||||
Use the `content` prop to control how the Select content is rendered, like its `align`, `side` or `position` for example.
|
||||
|
||||
::warning
|
||||
The `content.align`, `content.side`, etc. properties only apply when `content.position` is set to `popper`.
|
||||
::
|
||||
Use the `content` prop to control how the Select content is rendered, like its `align` or `side` for example.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -177,9 +206,6 @@ external:
|
||||
- items
|
||||
- modelValue
|
||||
items:
|
||||
content.position:
|
||||
- 'item-aligned'
|
||||
- 'popper'
|
||||
content.align:
|
||||
- start
|
||||
- center
|
||||
@@ -190,9 +216,8 @@ items:
|
||||
- top
|
||||
- bottom
|
||||
props:
|
||||
modelValue: 'Todo'
|
||||
modelValue: 'Backlog'
|
||||
content:
|
||||
position: 'item-aligned'
|
||||
align: center
|
||||
side: bottom
|
||||
sideOffset: 8
|
||||
@@ -205,11 +230,6 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
::note{to="https://www.radix-vue.com/components/select.html#change-the-positioning-mode"}
|
||||
Read more about the `content.position` prop in the **Radix Vue** documentation.
|
||||
::
|
||||
|
||||
<!--
|
||||
### Arrow
|
||||
|
||||
Use the `arrow` prop to display an arrow on the Select.
|
||||
@@ -226,7 +246,7 @@ external:
|
||||
- items
|
||||
- modelValue
|
||||
props:
|
||||
modelValue: 'Todo'
|
||||
modelValue: 'Backlog'
|
||||
arrow: true
|
||||
items:
|
||||
- Backlog
|
||||
@@ -237,8 +257,6 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
-->
|
||||
|
||||
### Color
|
||||
|
||||
Use the `color` prop to change the ring color when the Select is focused.
|
||||
@@ -486,7 +504,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -650,7 +668,7 @@ name: 'select-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Select by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Select by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
### With rotating icon
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: Separates content horizontally or vertically.
|
||||
links:
|
||||
- label: Separator
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/separator.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/separator
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Separator.vue
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A dialog that slides in from any side of the screen.
|
||||
links:
|
||||
- label: Dialog
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/dialog.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/dialog
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Slideover.vue
|
||||
@@ -294,7 +294,7 @@ name: 'slideover-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Slideover by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Slideover by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
::tip
|
||||
@@ -306,7 +306,7 @@ This allows you to move the trigger outside of the Slideover or remove it entire
|
||||
You can use the [`useSlideover`](/composables/use-slideover) composable to open a Slideover programatically.
|
||||
|
||||
::warning
|
||||
Make sure to wrap your app with the [App](/components/app) component which uses the [SlideoverProvider](https://github.com/nuxt/ui/blob/v3/src/runtime/components/SlideoverProvider.vue) component.
|
||||
Make sure to wrap your app with the [`App`](/components/app) component which uses the [`SlideoverProvider`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/SlideoverProvider.vue) component.
|
||||
::
|
||||
|
||||
First, create a slideover component that will be opened programatically:
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: An input to select a numeric value within a range.
|
||||
links:
|
||||
- label: Slider
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/slider.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/slider
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Slider.vue
|
||||
|
||||
232
docs/content/3.components/stepper.md
Normal file
232
docs/content/3.components/stepper.md
Normal file
@@ -0,0 +1,232 @@
|
||||
---
|
||||
description: A set of steps that are used to indicate progress through a multi-step process.
|
||||
links:
|
||||
- label: Stepper
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/stepper
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Stepper.vue
|
||||
navigation.badge: New
|
||||
---
|
||||
|
||||
## Usage
|
||||
|
||||
### Items
|
||||
|
||||
Use the `items` prop as an array of objects with the following properties:
|
||||
|
||||
- `title?: string`{lang="ts-type"}
|
||||
- `description?: AvatarProps`{lang="ts-type"}
|
||||
- `content?: string`{lang="ts-type"}
|
||||
- `icon?: string`{lang="ts-type"}
|
||||
- `value?: string | number`{lang="ts-type"}
|
||||
- `disabled?: boolean`{lang="ts-type"}
|
||||
- [`slot?: string`{lang="ts-type"}](#with-custom-slot)
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
items:
|
||||
- title: 'Address'
|
||||
description: 'Add your address here'
|
||||
icon: 'i-lucide-house'
|
||||
- title: 'Shipping'
|
||||
description: 'Set your preferred shipping method'
|
||||
icon: 'i-lucide-truck'
|
||||
- title: 'Checkout'
|
||||
description: 'Confirm your order'
|
||||
class: 'w-full'
|
||||
---
|
||||
::
|
||||
|
||||
::note
|
||||
Click on the items to navigate through the steps.
|
||||
::
|
||||
|
||||
### Color
|
||||
|
||||
Use the `color` prop to change the color of the Stepper.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- content
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
color: neutral
|
||||
items:
|
||||
- title: 'Address'
|
||||
description: 'Add your address here'
|
||||
icon: 'i-lucide-house'
|
||||
- title: 'Shipping'
|
||||
description: 'Set your preferred shipping method'
|
||||
icon: 'i-lucide-truck'
|
||||
- title: 'Checkout'
|
||||
description: 'Confirm your order'
|
||||
class: 'w-full'
|
||||
---
|
||||
::
|
||||
|
||||
### Size
|
||||
|
||||
Use the `size` prop to change the size of the Stepper.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- content
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
size: xl
|
||||
items:
|
||||
- title: 'Address'
|
||||
description: 'Add your address here'
|
||||
icon: 'i-lucide-house'
|
||||
- title: 'Shipping'
|
||||
description: 'Set your preferred shipping method'
|
||||
icon: 'i-lucide-truck'
|
||||
- title: 'Checkout'
|
||||
description: 'Confirm your order'
|
||||
class: 'w-full'
|
||||
---
|
||||
::
|
||||
|
||||
### Orientation
|
||||
|
||||
Use the `orientation` prop to change the orientation of the Stepper. Defaults to `horizontal`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- content
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
orientation: vertical
|
||||
items:
|
||||
- title: 'Address'
|
||||
description: 'Add your address here'
|
||||
icon: 'i-lucide-house'
|
||||
- title: 'Shipping'
|
||||
description: 'Set your preferred shipping method'
|
||||
icon: 'i-lucide-truck'
|
||||
- title: 'Checkout'
|
||||
description: 'Confirm your order'
|
||||
class: 'w-full'
|
||||
---
|
||||
::
|
||||
|
||||
### Disabled
|
||||
|
||||
Use the `disabled` prop to disable navigation through the steps.
|
||||
|
||||
::component-code
|
||||
---
|
||||
ignore:
|
||||
- content
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
disabled: true
|
||||
items:
|
||||
- title: 'Address'
|
||||
description: 'Add your address here'
|
||||
icon: 'i-lucide-house'
|
||||
- title: 'Shipping'
|
||||
description: 'Set your preferred shipping method'
|
||||
icon: 'i-lucide-truck'
|
||||
- title: 'Checkout'
|
||||
description: 'Confirm your order'
|
||||
---
|
||||
::
|
||||
|
||||
::note{to="#with-controls"}
|
||||
This can be useful when you want to force navigation with controls.
|
||||
::
|
||||
|
||||
## Examples
|
||||
|
||||
### With controls
|
||||
|
||||
You can add additional controls for the stepper using buttons.
|
||||
|
||||
:component-example{name="stepper-with-controls-example"}
|
||||
|
||||
### Control active item
|
||||
|
||||
You can control the active item by using the `default-value` prop or the `v-model` directive with the index of the item.
|
||||
|
||||
:component-example{name="stepper-model-value-example"}
|
||||
|
||||
::tip
|
||||
You can also pass the `value` of one of the items if provided.
|
||||
::
|
||||
|
||||
### With content slot
|
||||
|
||||
Use the `#content` slot to customize the content of each item.
|
||||
|
||||
:component-example{name="stepper-content-slot-example"}
|
||||
|
||||
### With custom slot
|
||||
|
||||
Use the `slot` property to customize a specific item.
|
||||
|
||||
:component-example{name="stepper-custom-slot-example"}
|
||||
|
||||
## API
|
||||
|
||||
### Props
|
||||
|
||||
:component-props
|
||||
|
||||
### Slots
|
||||
|
||||
:component-slots
|
||||
|
||||
### Emits
|
||||
|
||||
:component-emits
|
||||
|
||||
### Expose
|
||||
|
||||
You can access the typed component instance using [`useTemplateRef`](https://vuejs.org/api/composition-api-helpers.html#usetemplateref).
|
||||
|
||||
```vue
|
||||
<script setup lang="ts">
|
||||
const stepper = useTemplateRef('stepper')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UStepper ref="stepper" />
|
||||
</template>
|
||||
```
|
||||
|
||||
This will give you access to the following:
|
||||
|
||||
| Name | Type |
|
||||
| ---- | ---- |
|
||||
| `next`{lang="ts-type"} | `() => void`{lang="ts-type"} |
|
||||
| `prev`{lang="ts-type"} | `() => void`{lang="ts-type"} |
|
||||
| `hasNext`{lang="ts-type"} | `Ref<boolean>`{lang="ts-type"} |
|
||||
| `hasPrev`{lang="ts-type"} | `Ref<boolean>`{lang="ts-type"} |
|
||||
|
||||
## Theme
|
||||
|
||||
:component-theme
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A control that toggles between two states.
|
||||
links:
|
||||
- label: Switch
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/switch.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/switch
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Switch.vue
|
||||
@@ -108,7 +108,7 @@ props:
|
||||
|
||||
### Loading Icon
|
||||
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-ccw`.
|
||||
Use the `loading-icon` prop to customize the loading icon. Defaults to `i-lucide-refresh-cw`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
|
||||
@@ -245,7 +245,7 @@ You can use the `expanded` prop to control the expandable state of the rows (can
|
||||
::
|
||||
|
||||
::note
|
||||
You could also add this action to the [DropdownMenu](/components/dropdown-menu) component inside the `actions` column.
|
||||
You could also add this action to the [`DropdownMenu`](/components/dropdown-menu) component inside the `actions` column.
|
||||
::
|
||||
|
||||
### With row selection
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A set of tab panels that are displayed one at a time.
|
||||
links:
|
||||
- label: Tabs
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/tabs.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/tabs
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Tabs.vue
|
||||
@@ -44,9 +44,7 @@ props:
|
||||
|
||||
### Content
|
||||
|
||||
Use the `content` prop to control how the Tabs are rendered.
|
||||
|
||||
You can set it to `false` to prevent the Tabs from rendering any content and act as a toggle.
|
||||
Set the `content` prop to `false` to turn the Tabs into a toggle-only control without displaying any content. Defaults to `true`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
@@ -69,20 +67,20 @@ props:
|
||||
---
|
||||
::
|
||||
|
||||
You can also choose to only render the content of the active tab by setting `content.forceMount` to `false`.
|
||||
### Unmount
|
||||
|
||||
Use the `unmount-on-hide` prop to prevent the content from being unmounted when the Tabs is collapsed. Defaults to `true`.
|
||||
|
||||
::component-code
|
||||
---
|
||||
prettier: true
|
||||
ignore:
|
||||
- content.forceMount
|
||||
- content
|
||||
- items
|
||||
- class
|
||||
external:
|
||||
- items
|
||||
props:
|
||||
content:
|
||||
forceMount: false
|
||||
unmountOnHide: false
|
||||
items:
|
||||
- label: Account
|
||||
icon: 'i-lucide-user'
|
||||
@@ -95,7 +93,7 @@ props:
|
||||
::
|
||||
|
||||
::note
|
||||
You can inspect the DOM to see that the content of the inactive tab is not rendered.
|
||||
You can inspect the DOM to see each item's content being rendered.
|
||||
::
|
||||
|
||||
### Color
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A succinct message to provide information or feedback to the user.
|
||||
links:
|
||||
- label: Toast
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/toast.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/toast
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Toast.vue
|
||||
@@ -14,7 +14,7 @@ links:
|
||||
Use the [useToast](/composables/use-toast) composable to display a toast in your application.
|
||||
|
||||
::warning
|
||||
Make sure to wrap your app with the [App](/components/app) component which uses our [Toaster](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Toaster.vue) component which uses the [ToastProvider](https://www.radix-vue.com/components/toast.html#provider) component from Radix Vue.
|
||||
Make sure to wrap your app with the [`App`](/components/app) component which uses our [`Toaster`](https://github.com/nuxt/ui/blob/v3/src/runtime/components/Toaster.vue) component which uses the [`ToastProvider`](https://reka-ui.com/docs/components/toast#provider) component from Reka UI.
|
||||
::
|
||||
|
||||
::tip{to="/components/app#props"}
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
description: A popup that reveals information when hovering over an element.
|
||||
links:
|
||||
- label: Tooltip
|
||||
icon: i-custom-radix-vue
|
||||
to: https://www.radix-vue.com/components/tooltip.html
|
||||
icon: i-custom-reka-ui
|
||||
to: https://reka-ui.com/docs/components/tooltip
|
||||
- label: GitHub
|
||||
icon: i-simple-icons-github
|
||||
to: https://github.com/nuxt/ui/tree/v3/src/runtime/components/Tooltip.vue
|
||||
@@ -14,7 +14,7 @@ links:
|
||||
Use a [Button](/components/button) or any other component in the default slot of the Tooltip.
|
||||
|
||||
::warning
|
||||
Make sure to wrap your app with the [App](/components/app) component which uses the [TooltipProvider](https://www.radix-vue.com/components/tooltip.html#provider) component from Radix Vue.
|
||||
Make sure to wrap your app with the [`App`](/components/app) component which uses the [`TooltipProvider`](https://reka-ui.com/docs/components/tooltip#provider) component from Reka UI.
|
||||
::
|
||||
|
||||
::tip{to="/components/app#props"}
|
||||
@@ -89,7 +89,7 @@ slots:
|
||||
::
|
||||
|
||||
::tip
|
||||
This can be configured globally through the `tooltip.delayDuration` option in the [App](/components/app) component.
|
||||
This can be configured globally through the `tooltip.delayDuration` option in the [`App`](/components/app) component.
|
||||
::
|
||||
|
||||
### Content
|
||||
@@ -182,7 +182,7 @@ name: 'tooltip-open-example'
|
||||
::
|
||||
|
||||
::note
|
||||
In this example, leveraging [defineShortcuts](/composables/define-shortcuts), you can toggle the Tooltip by pressing :kbd{value="O"}.
|
||||
In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts), you can toggle the Tooltip by pressing :kbd{value="O"}.
|
||||
::
|
||||
|
||||
## API
|
||||
|
||||
@@ -4,9 +4,9 @@ import pkg from '../package.json'
|
||||
const { resolve } = createResolver(import.meta.url)
|
||||
|
||||
export default defineNuxtConfig({
|
||||
// extends: [
|
||||
// process.env.NUXT_UI_PRO_PATH ? resolve(process.env.NUXT_UI_PRO_PATH, 'docs') : process.env.NUXT_GITHUB_TOKEN && ['github:nuxt/ui-pro/docs#dev', { giget: { auth: process.env.NUXT_GITHUB_TOKEN } }]
|
||||
// ],
|
||||
extends: [
|
||||
process.env.NUXT_UI_PRO_PATH ? resolve(process.env.NUXT_UI_PRO_PATH, 'docs') : process.env.NUXT_GITHUB_TOKEN && ['github:nuxt/ui-pro/docs#v3', { giget: { auth: process.env.NUXT_GITHUB_TOKEN } }]
|
||||
],
|
||||
|
||||
modules: [
|
||||
'../src/module',
|
||||
@@ -26,6 +26,17 @@ export default defineNuxtConfig({
|
||||
],
|
||||
|
||||
app: {
|
||||
head: {
|
||||
// LemonSqueezy affiliate
|
||||
script: [{
|
||||
key: 'lmsqueezy-config',
|
||||
innerHTML: 'window.lemonSqueezyAffiliateConfig = { store: "nuxt" };'
|
||||
}, {
|
||||
key: 'lmsqueezy',
|
||||
src: 'https://lmsqueezy.com/affiliate.js',
|
||||
defer: true
|
||||
}]
|
||||
},
|
||||
rootAttrs: {
|
||||
'vaul-drawer-wrapper': '',
|
||||
'class': 'bg-[var(--ui-bg)]'
|
||||
@@ -41,15 +52,6 @@ export default defineNuxtConfig({
|
||||
markdown: {
|
||||
highlight: {
|
||||
langs: ['bash', 'ts', 'typescript', 'diff', 'vue', 'json', 'yml', 'css', 'mdc']
|
||||
},
|
||||
remarkPlugins: {
|
||||
'remark-mdc': {
|
||||
options: {
|
||||
experimental: {
|
||||
autoUnwrap: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,7 +96,6 @@ export default defineNuxtConfig({
|
||||
],
|
||||
crawlLinks: true,
|
||||
autoSubfolderIndex: false
|
||||
// ignore: !process.env.NUXT_GITHUB_TOKEN ? ['/pro'] : []
|
||||
},
|
||||
cloudflare: {
|
||||
pages: {
|
||||
@@ -102,8 +103,7 @@ export default defineNuxtConfig({
|
||||
exclude: [
|
||||
'/components/*',
|
||||
'/getting-started/*',
|
||||
'/composables/*',
|
||||
'/api/*'
|
||||
'/composables/*'
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -119,14 +119,13 @@ export default defineNuxtConfig({
|
||||
'@nuxt/content',
|
||||
'@nuxt/icon',
|
||||
'@nuxt/image',
|
||||
'@nuxt/ui-pro',
|
||||
'@nuxtjs/color-mode',
|
||||
'@nuxtjs/mdc',
|
||||
'@nuxtjs/plausible',
|
||||
'nuxt/dist',
|
||||
'nuxt-og-image',
|
||||
resolve('./app/components')
|
||||
// process.env.NUXT_UI_PRO_PATH ? resolve(process.env.NUXT_UI_PRO_PATH, 'docs', 'components') : '.c12'
|
||||
resolve('./app/components'),
|
||||
process.env.NUXT_UI_PRO_PATH ? resolve(process.env.NUXT_UI_PRO_PATH, 'docs', 'components') : '.c12'
|
||||
],
|
||||
metaFields: {
|
||||
type: false,
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@iconify-json/logos": "^1.2.3",
|
||||
"@iconify-json/lucide": "^1.2.16",
|
||||
"@iconify-json/simple-icons": "^1.2.13",
|
||||
"@iconify-json/vscode-icons": "^1.2.2",
|
||||
"@nuxt/content": "3.0.0-alpha.7",
|
||||
"@iconify-json/lucide": "^1.2.18",
|
||||
"@iconify-json/simple-icons": "^1.2.14",
|
||||
"@iconify-json/vscode-icons": "^1.2.3",
|
||||
"@nuxt/content": "https://pkg.pr.new/@nuxt/content@c5b1a4f",
|
||||
"@nuxt/image": "^1.8.1",
|
||||
"@nuxt/ui": "latest",
|
||||
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@1408077",
|
||||
"@nuxt/ui-pro": "https://pkg.pr.new/@nuxt/ui-pro@3fcaf55",
|
||||
"@nuxthub/core": "^0.8.7",
|
||||
"@nuxtjs/plausible": "^1.1.1",
|
||||
"@nuxtjs/plausible": "^1.2.0",
|
||||
"@octokit/rest": "^21.0.2",
|
||||
"@vueuse/nuxt": "^11.3.0",
|
||||
"@vueuse/nuxt": "^12.0.0",
|
||||
"joi": "^17.13.3",
|
||||
"nuxt": "^3.14.1592",
|
||||
"nuxt-component-meta": "^0.9.0",
|
||||
"nuxt-og-image": "^3.1.1",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier": "^3.4.2",
|
||||
"shiki-transformer-color-highlight": "^0.2.0",
|
||||
"superstruct": "^2.0.2",
|
||||
"ufo": "^1.5.4",
|
||||
"valibot": "^0.42.1",
|
||||
"yup": "^1.4.0",
|
||||
"yup": "^1.5.0",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"wrangler": "^3.90.0"
|
||||
"wrangler": "^3.93.0"
|
||||
}
|
||||
}
|
||||
|
||||
49
package.json
49
package.json
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"name": "@nuxt/ui",
|
||||
"description": "A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.",
|
||||
"version": "3.0.0-alpha.9",
|
||||
"packageManager": "pnpm@9.14.2",
|
||||
"version": "3.0.0-alpha.10",
|
||||
"packageManager": "pnpm@9.15.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/nuxt/ui.git"
|
||||
@@ -73,21 +73,23 @@
|
||||
"release": "release-it --preRelease=alpha --npm.tag=next"
|
||||
},
|
||||
"dependencies": {
|
||||
"@iconify/vue": "^4.1.2",
|
||||
"@iconify/vue": "^4.2.0",
|
||||
"@internationalized/date": "^3.6.0",
|
||||
"@internationalized/number": "^3.6.0",
|
||||
"@nuxt/devtools-kit": "^1.6.1",
|
||||
"@nuxt/fonts": "^0.10.2",
|
||||
"@nuxt/icon": "^1.8.2",
|
||||
"@nuxt/devtools-kit": "^1.6.3",
|
||||
"@nuxt/fonts": "^0.10.3",
|
||||
"@nuxt/icon": "^1.9.1",
|
||||
"@nuxt/kit": "^3.14.1592",
|
||||
"@nuxt/schema": "^3.14.1592",
|
||||
"@nuxtjs/color-mode": "^3.5.2",
|
||||
"@tailwindcss/postcss": "4.0.0-beta.2",
|
||||
"@tailwindcss/vite": "4.0.0-beta.2",
|
||||
"@tailwindcss/postcss": "4.0.0-beta.6",
|
||||
"@tailwindcss/vite": "4.0.0-beta.6",
|
||||
"@tanstack/vue-table": "^8.20.5",
|
||||
"@unhead/vue": "^1.11.11",
|
||||
"@vueuse/core": "^11.3.0",
|
||||
"@vueuse/integrations": "^11.3.0",
|
||||
"@types/color": "^4.2.0",
|
||||
"@unhead/vue": "^1.11.13",
|
||||
"@vueuse/core": "^12.0.0",
|
||||
"@vueuse/integrations": "^12.0.0",
|
||||
"color": "^4.2.3",
|
||||
"consola": "^3.2.3",
|
||||
"defu": "^6.1.4",
|
||||
"embla-carousel-auto-height": "^8.5.1",
|
||||
@@ -100,30 +102,30 @@
|
||||
"fuse.js": "^7.0.0",
|
||||
"get-port-please": "^3.1.2",
|
||||
"knitwork": "^1.1.0",
|
||||
"magic-string": "^0.30.13",
|
||||
"magic-string": "^0.30.14",
|
||||
"mlly": "^1.7.3",
|
||||
"ohash": "^1.1.4",
|
||||
"reka-ui": "1.0.0-alpha.6",
|
||||
"pathe": "^1.1.2",
|
||||
"radix-vue": "^1.9.10",
|
||||
"scule": "^1.3.0",
|
||||
"sirv": "^3.0.0",
|
||||
"tailwind-variants": "^0.3.0",
|
||||
"tailwindcss": "4.0.0-beta.2",
|
||||
"tailwindcss": "4.0.0-beta.6",
|
||||
"tinyglobby": "^0.2.10",
|
||||
"unplugin": "^1.16.0",
|
||||
"unplugin-auto-import": "^0.18.5",
|
||||
"unplugin-vue-components": "^0.27.4",
|
||||
"unplugin-auto-import": "^0.18.6",
|
||||
"unplugin-vue-components": "^0.27.5",
|
||||
"vaul-vue": "^0.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nuxt/eslint-config": "^0.7.1",
|
||||
"@nuxt/eslint-config": "^0.7.2",
|
||||
"@nuxt/module-builder": "^0.8.4",
|
||||
"@nuxt/test-utils": "^3.14.4",
|
||||
"@nuxt/test-utils": "^3.15.1",
|
||||
"@release-it/conventional-changelog": "^9.0.3",
|
||||
"@standard-schema/spec": "1.0.0-beta.3",
|
||||
"@standard-schema/spec": "1.0.0-beta.4",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"embla-carousel": "^8.5.1",
|
||||
"eslint": "^9.15.0",
|
||||
"eslint": "^9.16.0",
|
||||
"happy-dom": "^15.7.4",
|
||||
"joi": "^17.13.3",
|
||||
"knitwork": "^1.1.0",
|
||||
@@ -132,10 +134,10 @@
|
||||
"release-it": "^17.10.0",
|
||||
"superstruct": "^2.0.2",
|
||||
"valibot": "^0.42.1",
|
||||
"vitest": "^2.1.5",
|
||||
"vitest": "^2.1.8",
|
||||
"vitest-environment-nuxt": "^1.0.1",
|
||||
"vue-tsc": "^2.1.10",
|
||||
"yup": "^1.4.0",
|
||||
"yup": "^1.5.0",
|
||||
"zod": "^3.23.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
@@ -145,6 +147,7 @@
|
||||
"@nuxt/ui": "workspace:*",
|
||||
"happy-dom": "14.12.3",
|
||||
"rollup": "^4.24.0",
|
||||
"typescript": "5.6.3"
|
||||
"typescript": "5.6.3",
|
||||
"chokidar": "3.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user