Skip to content

Commit

Permalink
chore(Avatar)!: remove chipVariant prop
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed May 26, 2023
1 parent 2c6db97 commit 1f22f84
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
3 changes: 1 addition & 2 deletions docs/content/2.elements/1.avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 1 addition & 4 deletions src/runtime/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -42,7 +40,6 @@ const avatar = {
default: {
size: 'sm',
chipColor: null,
chipVariant: 'solid',
chipPosition: 'top-right'
}
}
Expand Down
9 changes: 1 addition & 8 deletions src/runtime/components/elements/Avatar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
)
})
Expand Down

0 comments on commit 1f22f84

Please sign in to comment.