Skip to content

Commit 77ce09a

Browse files
authored
fix(Avatar): remove leading-none from fallback (#6383)
1 parent ab203db commit 77ce09a

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/theme/avatar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ export default {
22
slots: {
33
root: 'inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated',
44
image: 'h-full w-full rounded-[inherit] object-cover',
5-
fallback: 'font-medium leading-none text-muted truncate',
5+
fallback: 'font-medium text-muted truncate',
66
icon: 'text-muted shrink-0'
77
},
88
variants: {

test/components/__snapshots__/Avatar-vue.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`Avatar > renders with alt correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">BC</span></span>"`;
3+
exports[`Avatar > renders with alt correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">BC</span></span>"`;
44

55
exports[`Avatar > renders with as (object) correctly 1`] = `
66
"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base">
@@ -10,11 +10,11 @@ exports[`Avatar > renders with as (object) correctly 1`] = `
1010

1111
exports[`Avatar > renders with as (partial object) correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><p src="https://github.com/benjamincanac.png" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></p></span>"`;
1212

13-
exports[`Avatar > renders with as correctly 1`] = `"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span></section>"`;
13+
exports[`Avatar > renders with as correctly 1`] = `"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span></section>"`;
1414

15-
exports[`Avatar > renders with chip correctly 1`] = `"<span data-slot="root" class="relative inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span><span data-slot="base" class="rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap bg-primary h-[8px] min-w-[8px] text-[8px] top-0 right-0 absolute">1</span></span>"`;
15+
exports[`Avatar > renders with chip correctly 1`] = `"<span data-slot="root" class="relative inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span><span data-slot="base" class="rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap bg-primary h-[8px] min-w-[8px] text-[8px] top-0 right-0 absolute">1</span></span>"`;
1616

17-
exports[`Avatar > renders with class correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle size-8 text-base bg-default"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span></span>"`;
17+
exports[`Avatar > renders with class correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle size-8 text-base bg-default"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span></span>"`;
1818

1919
exports[`Avatar > renders with custom size correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated text-base size-100"><img src="https://github.com/benjamincanac.png" width="400" height="400" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span>"`;
2020
@@ -42,6 +42,6 @@ exports[`Avatar > renders with size xs correctly 1`] = `"<span data-slot="root"
4242
4343
exports[`Avatar > renders with src correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><img src="https://github.com/benjamincanac.png" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span>"`;
4444
45-
exports[`Avatar > renders with text correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">+1</span></span>"`;
45+
exports[`Avatar > renders with text correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">+1</span></span>"`;
4646
47-
exports[`Avatar > renders with ui correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="leading-none text-muted truncate font-bold">&nbsp;</span></span>"`;
47+
exports[`Avatar > renders with ui correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="text-muted truncate font-bold">&nbsp;</span></span>"`;

test/components/__snapshots__/Avatar.spec.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`Avatar > renders with alt correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">BC</span></span>"`;
3+
exports[`Avatar > renders with alt correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">BC</span></span>"`;
44

55
exports[`Avatar > renders with as (object) correctly 1`] = `
66
"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base">
@@ -10,11 +10,11 @@ exports[`Avatar > renders with as (object) correctly 1`] = `
1010

1111
exports[`Avatar > renders with as (partial object) correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><p src="https://github.com/benjamincanac.png" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></p></span>"`;
1212

13-
exports[`Avatar > renders with as correctly 1`] = `"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span></section>"`;
13+
exports[`Avatar > renders with as correctly 1`] = `"<section data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span></section>"`;
1414

15-
exports[`Avatar > renders with chip correctly 1`] = `"<span data-slot="root" class="relative inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span><span data-slot="base" class="rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap bg-primary h-[8px] min-w-[8px] text-[8px] top-0 right-0 absolute">1</span></span>"`;
15+
exports[`Avatar > renders with chip correctly 1`] = `"<span data-slot="root" class="relative inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span><span data-slot="base" class="rounded-full ring ring-bg flex items-center justify-center text-inverted font-medium whitespace-nowrap bg-primary h-[8px] min-w-[8px] text-[8px] top-0 right-0 absolute">1</span></span>"`;
1616

17-
exports[`Avatar > renders with class correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle size-8 text-base bg-default"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">&nbsp;</span></span>"`;
17+
exports[`Avatar > renders with class correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle size-8 text-base bg-default"><span data-slot="fallback" class="font-medium text-muted truncate">&nbsp;</span></span>"`;
1818

1919
exports[`Avatar > renders with custom size correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated text-base size-100"><img src="https://github.com/benjamincanac.png" width="400" height="400" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span>"`;
2020
@@ -42,6 +42,6 @@ exports[`Avatar > renders with size xs correctly 1`] = `"<span data-slot="root"
4242
4343
exports[`Avatar > renders with src correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><img src="https://github.com/benjamincanac.png" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span>"`;
4444
45-
exports[`Avatar > renders with text correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">+1</span></span>"`;
45+
exports[`Avatar > renders with text correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="font-medium text-muted truncate">+1</span></span>"`;
4646
47-
exports[`Avatar > renders with ui correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="leading-none text-muted truncate font-bold">&nbsp;</span></span>"`;
47+
exports[`Avatar > renders with ui correctly 1`] = `"<span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none rounded-full align-middle bg-elevated size-8 text-base"><span data-slot="fallback" class="text-muted truncate font-bold">&nbsp;</span></span>"`;

test/components/__snapshots__/AvatarGroup-vue.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports[`AvatarGroup > renders with default slot correctly 1`] = `
1414
</div>"
1515
`;
1616

17-
exports[`AvatarGroup > renders with max correctly 1`] = `"<div data-slot="root" class="inline-flex flex-row-reverse justify-end"><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">+1</span></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/romhml.png" alt="Romain Hamel" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/benjamincanac.png" alt="Benjamin Canac" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span></div>"`;
17+
exports[`AvatarGroup > renders with max correctly 1`] = `"<div data-slot="root" class="inline-flex flex-row-reverse justify-end"><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><span data-slot="fallback" class="font-medium text-muted truncate">+1</span></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/romhml.png" alt="Romain Hamel" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/benjamincanac.png" alt="Benjamin Canac" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span></div>"`;
1818

1919
exports[`AvatarGroup > renders with size 2xl correctly 1`] = `
2020
"<div data-slot="root" class="inline-flex flex-row-reverse justify-end">

test/components/__snapshots__/AvatarGroup.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exports[`AvatarGroup > renders with default slot correctly 1`] = `
1414
</div>"
1515
`;
1616

17-
exports[`AvatarGroup > renders with max correctly 1`] = `"<div data-slot="root" class="inline-flex flex-row-reverse justify-end"><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><span data-slot="fallback" class="font-medium leading-none text-muted truncate">+1</span></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/romhml.png" alt="Romain Hamel" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/benjamincanac.png" alt="Benjamin Canac" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span></div>"`;
17+
exports[`AvatarGroup > renders with max correctly 1`] = `"<div data-slot="root" class="inline-flex flex-row-reverse justify-end"><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><span data-slot="fallback" class="font-medium text-muted truncate">+1</span></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/romhml.png" alt="Romain Hamel" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span><span data-slot="root" class="inline-flex items-center justify-center shrink-0 select-none align-middle bg-elevated size-8 text-base relative rounded-full ring-bg first:me-0 ring-2 -me-1.5"><img src="https://github.com/benjamincanac.png" alt="Benjamin Canac" width="32" height="32" data-slot="image" class="h-full w-full rounded-[inherit] object-cover"></span></div>"`;
1818

1919
exports[`AvatarGroup > renders with size 2xl correctly 1`] = `
2020
"<div data-slot="root" class="inline-flex flex-row-reverse justify-end">

0 commit comments

Comments
 (0)