chore(Avatar): allow override of rounded class

This commit is contained in:
Benjamin Canac
2022-06-29 00:12:51 +02:00
parent d733e25bf0
commit 847788b2a0
2 changed files with 7 additions and 2 deletions

View File

@@ -66,6 +66,10 @@ const props = defineProps({
placeholderClass: {
type: String,
default: () => $ui.avatar.placeholder
},
roundedClass: {
type: String,
default: () => $ui.avatar.rounded
}
})
@@ -74,14 +78,14 @@ const wrapperClass = computed(() => {
props.wrapperClass,
props.backgroundClass,
$ui.avatar.size[props.size],
props.rounded ? 'rounded-full' : 'rounded-md'
props.rounded ? 'rounded-full' : props.roundedClass
)
})
const avatarClass = computed(() => {
return classNames(
$ui.avatar.size[props.size],
props.rounded ? 'rounded-full' : 'rounded-md'
props.rounded ? 'rounded-full' : props.roundedClass
)
})

View File

@@ -326,6 +326,7 @@ const pills = {
const avatar = {
wrapper: 'relative inline-flex items-center justify-center',
background: 'u-bg-gray-100',
rounded: 'rounded-md',
placeholder: 'text-xs font-medium leading-none u-text-black truncate',
size: {
xxxs: 'h-4 w-4 text-xs',