mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
chore(Avatar)!: remove chipVariant prop
This commit is contained in:
@@ -29,13 +29,12 @@ baseProps:
|
||||
|
||||
### Chip
|
||||
|
||||
Use the `chip-color`, `chip-variant` and `chip-position` props to display a chip on the Avatar.
|
||||
Use the `chip-color` and `chip-position` props to display a chip on the Avatar.
|
||||
|
||||
::component-card
|
||||
---
|
||||
props:
|
||||
chipColor: 'primary'
|
||||
chipVariant: 'solid'
|
||||
chipPosition: 'top-right'
|
||||
baseProps:
|
||||
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
|
||||
|
||||
@@ -18,15 +18,13 @@ const avatar = {
|
||||
},
|
||||
chip: {
|
||||
base: 'absolute block rounded-full ring-1 ring-white dark:ring-gray-900',
|
||||
background: 'bg-{color}-400',
|
||||
position: {
|
||||
'top-right': 'top-0 right-0',
|
||||
'bottom-right': 'bottom-0 right-0',
|
||||
'top-left': 'top-0 left-0',
|
||||
'bottom-left': 'bottom-0 left-0'
|
||||
},
|
||||
variant: {
|
||||
solid: 'bg-{color}-400'
|
||||
},
|
||||
size: {
|
||||
'3xs': 'h-1 w-1',
|
||||
'2xs': 'h-1 w-1',
|
||||
@@ -42,7 +40,6 @@ const avatar = {
|
||||
default: {
|
||||
size: 'sm',
|
||||
chipColor: null,
|
||||
chipVariant: 'solid',
|
||||
chipPosition: 'top-right'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,13 +48,6 @@ export default defineComponent({
|
||||
return ['gray', ...appConfig.ui.colors].includes(value)
|
||||
}
|
||||
},
|
||||
chipVariant: {
|
||||
type: String,
|
||||
default: () => appConfig.ui.avatar.default.chipVariant,
|
||||
validator (value: string) {
|
||||
return Object.keys(appConfig.ui.avatar.chip.variant).includes(value)
|
||||
}
|
||||
},
|
||||
chipPosition: {
|
||||
type: String,
|
||||
default: () => appConfig.ui.avatar.default.chipPosition,
|
||||
@@ -94,7 +87,7 @@ export default defineComponent({
|
||||
ui.value.chip.base,
|
||||
ui.value.chip.size[props.size],
|
||||
ui.value.chip.position[props.chipPosition],
|
||||
ui.value.chip.variant[props.chipVariant]?.replaceAll('{color}', props.chipColor)
|
||||
ui.value.chip.background.replaceAll('{color}', props.chipColor)
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user