diff --git a/docs/content/1.getting-started/3.theme.md b/docs/content/1.getting-started/3.theme.md index a20c90b494..f90d07a342 100644 --- a/docs/content/1.getting-started/3.theme.md +++ b/docs/content/1.getting-started/3.theme.md @@ -1,7 +1,7 @@ --- title: Theme description: 'Learn how to customize Nuxt UI components using Tailwind CSS v4, CSS variables and the Tailwind Variants API for powerful and flexible theming.' -navigation.icon: i-lucide-palette +navigation.icon: i-lucide-swatch-book --- ## Tailwind CSS diff --git a/docs/content/3.components/avatar.md b/docs/content/3.components/avatar.md index 79d6900855..ab3bdde4c6 100644 --- a/docs/content/3.components/avatar.md +++ b/docs/content/3.components/avatar.md @@ -1,9 +1,6 @@ --- description: An img element with fallback and Nuxt Image support. links: - - label: Avatar - 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 diff --git a/src/runtime/components/Avatar.vue b/src/runtime/components/Avatar.vue index 46d2e626f5..ed713c9a52 100644 --- a/src/runtime/components/Avatar.vue +++ b/src/runtime/components/Avatar.vue @@ -1,6 +1,5 @@ diff --git a/src/theme/avatar.ts b/src/theme/avatar.ts index 5097f77b35..85b000603a 100644 --- a/src/theme/avatar.ts +++ b/src/theme/avatar.ts @@ -1,7 +1,7 @@ export default { slots: { root: 'inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-(--ui-bg-elevated)', - image: 'h-full w-full rounded-[inherit] object-cover data-[error]:hidden', + image: 'h-full w-full rounded-[inherit] object-cover', fallback: 'font-medium leading-none text-(--ui-text-muted) truncate', icon: 'text-(--ui-text-muted) shrink-0' }, diff --git a/test/components/__snapshots__/Alert-vue.spec.ts.snap b/test/components/__snapshots__/Alert-vue.spec.ts.snap index adfd0b515b..eff77498f4 100644 --- a/test/components/__snapshots__/Alert-vue.spec.ts.snap +++ b/test/components/__snapshots__/Alert-vue.spec.ts.snap @@ -28,7 +28,7 @@ exports[`Alert > renders with as correctly 1`] = ` `; exports[`Alert > renders with avatar correctly 1`] = ` -"
  +"
Alert
diff --git a/test/components/__snapshots__/Alert.spec.ts.snap b/test/components/__snapshots__/Alert.spec.ts.snap index 8bafd7e1e6..664a1aaa41 100644 --- a/test/components/__snapshots__/Alert.spec.ts.snap +++ b/test/components/__snapshots__/Alert.spec.ts.snap @@ -28,7 +28,7 @@ exports[`Alert > renders with as correctly 1`] = ` `; exports[`Alert > renders with avatar correctly 1`] = ` -"
  +"
Alert
diff --git a/test/components/__snapshots__/Avatar-vue.spec.ts.snap b/test/components/__snapshots__/Avatar-vue.spec.ts.snap index 2852ac7e5d..069a9c0bf6 100644 --- a/test/components/__snapshots__/Avatar-vue.spec.ts.snap +++ b/test/components/__snapshots__/Avatar-vue.spec.ts.snap @@ -1,39 +1,35 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Avatar > renders with alt correctly 1`] = `"BC"`; +exports[`Avatar > renders with alt correctly 1`] = `"BC"`; -exports[`Avatar > renders with as correctly 1`] = ` -"
-   -
" -`; +exports[`Avatar > renders with as correctly 1`] = `"
 
"`; -exports[`Avatar > renders with class correctly 1`] = `" "`; +exports[`Avatar > renders with class correctly 1`] = `" "`; -exports[`Avatar > renders with default slot correctly 1`] = `"🇫🇷"`; +exports[`Avatar > renders with default slot correctly 1`] = `"🇫🇷"`; -exports[`Avatar > renders with icon correctly 1`] = `""`; +exports[`Avatar > renders with icon correctly 1`] = `""`; -exports[`Avatar > renders with size 2xl correctly 1`] = `" "`; +exports[`Avatar > renders with size 2xl correctly 1`] = `""`; -exports[`Avatar > renders with size 2xs correctly 1`] = `" "`; +exports[`Avatar > renders with size 2xs correctly 1`] = `""`; -exports[`Avatar > renders with size 3xl correctly 1`] = `" "`; +exports[`Avatar > renders with size 3xl correctly 1`] = `""`; -exports[`Avatar > renders with size 3xs correctly 1`] = `" "`; +exports[`Avatar > renders with size 3xs correctly 1`] = `""`; -exports[`Avatar > renders with size lg correctly 1`] = `" "`; +exports[`Avatar > renders with size lg correctly 1`] = `""`; -exports[`Avatar > renders with size md correctly 1`] = `" "`; +exports[`Avatar > renders with size md correctly 1`] = `""`; -exports[`Avatar > renders with size sm correctly 1`] = `" "`; +exports[`Avatar > renders with size sm correctly 1`] = `""`; -exports[`Avatar > renders with size xl correctly 1`] = `" "`; +exports[`Avatar > renders with size xl correctly 1`] = `""`; -exports[`Avatar > renders with size xs correctly 1`] = `" "`; +exports[`Avatar > renders with size xs correctly 1`] = `""`; -exports[`Avatar > renders with src correctly 1`] = `" "`; +exports[`Avatar > renders with src correctly 1`] = `""`; -exports[`Avatar > renders with text correctly 1`] = `"+1"`; +exports[`Avatar > renders with text correctly 1`] = `"+1"`; -exports[`Avatar > renders with ui correctly 1`] = `" "`; +exports[`Avatar > renders with ui correctly 1`] = `" "`; diff --git a/test/components/__snapshots__/Avatar.spec.ts.snap b/test/components/__snapshots__/Avatar.spec.ts.snap index fd9b8db77c..c7bf2cebd3 100644 --- a/test/components/__snapshots__/Avatar.spec.ts.snap +++ b/test/components/__snapshots__/Avatar.spec.ts.snap @@ -1,39 +1,35 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`Avatar > renders with alt correctly 1`] = `"BC"`; +exports[`Avatar > renders with alt correctly 1`] = `"BC"`; -exports[`Avatar > renders with as correctly 1`] = ` -"
-   -
" -`; +exports[`Avatar > renders with as correctly 1`] = `"
 
"`; -exports[`Avatar > renders with class correctly 1`] = `" "`; +exports[`Avatar > renders with class correctly 1`] = `" "`; -exports[`Avatar > renders with default slot correctly 1`] = `"🇫🇷"`; +exports[`Avatar > renders with default slot correctly 1`] = `"🇫🇷"`; -exports[`Avatar > renders with icon correctly 1`] = `""`; +exports[`Avatar > renders with icon correctly 1`] = `""`; -exports[`Avatar > renders with size 2xl correctly 1`] = `" "`; +exports[`Avatar > renders with size 2xl correctly 1`] = `""`; -exports[`Avatar > renders with size 2xs correctly 1`] = `" "`; +exports[`Avatar > renders with size 2xs correctly 1`] = `""`; -exports[`Avatar > renders with size 3xl correctly 1`] = `" "`; +exports[`Avatar > renders with size 3xl correctly 1`] = `""`; -exports[`Avatar > renders with size 3xs correctly 1`] = `" "`; +exports[`Avatar > renders with size 3xs correctly 1`] = `""`; -exports[`Avatar > renders with size lg correctly 1`] = `" "`; +exports[`Avatar > renders with size lg correctly 1`] = `""`; -exports[`Avatar > renders with size md correctly 1`] = `" "`; +exports[`Avatar > renders with size md correctly 1`] = `""`; -exports[`Avatar > renders with size sm correctly 1`] = `" "`; +exports[`Avatar > renders with size sm correctly 1`] = `""`; -exports[`Avatar > renders with size xl correctly 1`] = `" "`; +exports[`Avatar > renders with size xl correctly 1`] = `""`; -exports[`Avatar > renders with size xs correctly 1`] = `" "`; +exports[`Avatar > renders with size xs correctly 1`] = `""`; -exports[`Avatar > renders with src correctly 1`] = `" "`; +exports[`Avatar > renders with src correctly 1`] = `""`; -exports[`Avatar > renders with text correctly 1`] = `"+1"`; +exports[`Avatar > renders with text correctly 1`] = `"+1"`; -exports[`Avatar > renders with ui correctly 1`] = `" "`; +exports[`Avatar > renders with ui correctly 1`] = `" "`; diff --git a/test/components/__snapshots__/AvatarGroup-vue.spec.ts.snap b/test/components/__snapshots__/AvatarGroup-vue.spec.ts.snap index 9d3999b56b..b1c2a275ad 100644 --- a/test/components/__snapshots__/AvatarGroup-vue.spec.ts.snap +++ b/test/components/__snapshots__/AvatarGroup-vue.spec.ts.snap @@ -1,77 +1,77 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AvatarGroup > renders with as correctly 1`] = `"NRRHBC"`; +exports[`AvatarGroup > renders with as correctly 1`] = `"Neil RichterRomain HamelBenjamin Canac"`; exports[`AvatarGroup > renders with class correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with default slot correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; -exports[`AvatarGroup > renders with max correctly 1`] = `"
+1RHBC
"`; +exports[`AvatarGroup > renders with max correctly 1`] = `"
+1Romain HamelBenjamin Canac
"`; exports[`AvatarGroup > renders with size 2xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 2xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 3xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 3xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size lg correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size md correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size sm correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with ui correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; diff --git a/test/components/__snapshots__/AvatarGroup.spec.ts.snap b/test/components/__snapshots__/AvatarGroup.spec.ts.snap index 9d3999b56b..b1c2a275ad 100644 --- a/test/components/__snapshots__/AvatarGroup.spec.ts.snap +++ b/test/components/__snapshots__/AvatarGroup.spec.ts.snap @@ -1,77 +1,77 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`AvatarGroup > renders with as correctly 1`] = `"NRRHBC"`; +exports[`AvatarGroup > renders with as correctly 1`] = `"Neil RichterRomain HamelBenjamin Canac"`; exports[`AvatarGroup > renders with class correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with default slot correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; -exports[`AvatarGroup > renders with max correctly 1`] = `"
+1RHBC
"`; +exports[`AvatarGroup > renders with max correctly 1`] = `"
+1Romain HamelBenjamin Canac
"`; exports[`AvatarGroup > renders with size 2xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 2xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 3xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size 3xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size lg correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size md correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size sm correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size xl correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with size xs correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; exports[`AvatarGroup > renders with ui correctly 1`] = ` "
- NRRHBC + Neil RichterRomain HamelBenjamin Canac
" `; diff --git a/test/components/__snapshots__/Badge-vue.spec.ts.snap b/test/components/__snapshots__/Badge-vue.spec.ts.snap index b26229f11b..ba6f47789f 100644 --- a/test/components/__snapshots__/Badge-vue.spec.ts.snap +++ b/test/components/__snapshots__/Badge-vue.spec.ts.snap @@ -10,12 +10,12 @@ exports[`Badge > renders with as correctly 1`] = ` exports[`Badge > renders with avatar and leadingIcon correctly 1`] = `""`; exports[`Badge > renders with avatar and trailingIcon correctly 1`] = ` -"  +" " `; exports[`Badge > renders with avatar correctly 1`] = ` -"  +" " `; diff --git a/test/components/__snapshots__/Badge.spec.ts.snap b/test/components/__snapshots__/Badge.spec.ts.snap index f9601239f3..4b2db91e2f 100644 --- a/test/components/__snapshots__/Badge.spec.ts.snap +++ b/test/components/__snapshots__/Badge.spec.ts.snap @@ -14,12 +14,12 @@ exports[`Badge > renders with avatar and leadingIcon correctly 1`] = ` `; exports[`Badge > renders with avatar and trailingIcon correctly 1`] = ` -"  +" " `; exports[`Badge > renders with avatar correctly 1`] = ` -"  +" " `; diff --git a/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap b/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap index 9671836b7f..8585a9402a 100644 --- a/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap +++ b/test/components/__snapshots__/Breadcrumb-vue.spec.ts.snap @@ -3,7 +3,7 @@ exports[`Breadcrumb > renders with as correctly 1`] = ` "
    -
  1.  Home
  2. +
  3. Home
  4. Components
  5. @@ -16,7 +16,7 @@ exports[`Breadcrumb > renders with as correctly 1`] = ` exports[`Breadcrumb > renders with class correctly 1`] = ` "
@@ -64,7 +64,7 @@ exports[`CommandPalette > renders with class correctly 1`] = `
@@ -98,7 +98,7 @@ exports[`CommandPalette > renders with close correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -132,7 +132,7 @@ exports[`CommandPalette > renders with close slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -166,7 +166,7 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -200,7 +200,7 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -236,7 +236,7 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -272,7 +272,7 @@ exports[`CommandPalette > renders with disabled correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -308,7 +308,7 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -344,7 +344,7 @@ exports[`CommandPalette > renders with groups correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -380,7 +380,7 @@ exports[`CommandPalette > renders with icon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -440,7 +440,7 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = `
-
Users
 Item label slot +
Users
Item label slot
@@ -500,7 +500,7 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = `
-
Users
 benjamincanacItem trailing slot +
Users
benjamincanacItem trailing slot
@@ -539,7 +539,7 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = `
-   +
@@ -577,7 +577,7 @@ exports[`CommandPalette > renders with loading correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -613,7 +613,7 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -649,7 +649,7 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -685,7 +685,7 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -721,7 +721,7 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -757,7 +757,7 @@ exports[`CommandPalette > renders with ui correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
diff --git a/test/components/__snapshots__/CommandPalette.spec.ts.snap b/test/components/__snapshots__/CommandPalette.spec.ts.snap index 3b5cfc0ca5..57650ed751 100644 --- a/test/components/__snapshots__/CommandPalette.spec.ts.snap +++ b/test/components/__snapshots__/CommandPalette.spec.ts.snap @@ -28,7 +28,7 @@ exports[`CommandPalette > renders with as correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -64,7 +64,7 @@ exports[`CommandPalette > renders with class correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -101,7 +101,7 @@ exports[`CommandPalette > renders with close correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -135,7 +135,7 @@ exports[`CommandPalette > renders with close slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -172,7 +172,7 @@ exports[`CommandPalette > renders with closeIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -206,7 +206,7 @@ exports[`CommandPalette > renders with custom slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -242,7 +242,7 @@ exports[`CommandPalette > renders with defaultValue correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -278,7 +278,7 @@ exports[`CommandPalette > renders with disabled correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -314,7 +314,7 @@ exports[`CommandPalette > renders with empty slot correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -350,7 +350,7 @@ exports[`CommandPalette > renders with groups correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -386,7 +386,7 @@ exports[`CommandPalette > renders with icon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -446,7 +446,7 @@ exports[`CommandPalette > renders with item-label slot correctly 1`] = `
-
Users
 Item label slot +
Users
Item label slot
@@ -506,7 +506,7 @@ exports[`CommandPalette > renders with item-trailing slot correctly 1`] = `
-
Users
 benjamincanacItem trailing slot +
Users
benjamincanacItem trailing slot
@@ -545,7 +545,7 @@ exports[`CommandPalette > renders with labelKey correctly 1`] = `
-   +
@@ -583,7 +583,7 @@ exports[`CommandPalette > renders with loading correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -619,7 +619,7 @@ exports[`CommandPalette > renders with loadingIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -655,7 +655,7 @@ exports[`CommandPalette > renders with modelValue correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -691,7 +691,7 @@ exports[`CommandPalette > renders with placeholder correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -727,7 +727,7 @@ exports[`CommandPalette > renders with selectedIcon correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
@@ -763,7 +763,7 @@ exports[`CommandPalette > renders with ui correctly 1`] = `
-
Users
 benjamincanac +
Users
benjamincanac
diff --git a/test/components/__snapshots__/DropdownMenu-vue.spec.ts.snap b/test/components/__snapshots__/DropdownMenu-vue.spec.ts.snap index f2dda592c8..d3063eafb3 100644 --- a/test/components/__snapshots__/DropdownMenu-vue.spec.ts.snap +++ b/test/components/__snapshots__/DropdownMenu-vue.spec.ts.snap @@ -9,7 +9,7 @@ exports[`DropdownMenu > renders with arrow correctly 1`] = `