mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-18 22:11:43 +01:00
feat(Badge): add support within button groups (#3224)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
committed by
GitHub
parent
deddc7cf97
commit
10fb843f8f
@@ -38,6 +38,7 @@ export interface BadgeSlots {
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Primitive } from 'reka-ui'
|
||||
import { useButtonGroup } from '../composables/useButtonGroup'
|
||||
import { useComponentIcons } from '../composables/useComponentIcons'
|
||||
import UIcon from './Icon.vue'
|
||||
import UAvatar from './Avatar.vue'
|
||||
@@ -47,12 +48,14 @@ const props = withDefaults(defineProps<BadgeProps>(), {
|
||||
})
|
||||
defineSlots<BadgeSlots>()
|
||||
|
||||
const { orientation, size: buttonGroupSize } = useButtonGroup<BadgeProps>(props)
|
||||
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props)
|
||||
|
||||
const ui = computed(() => badge({
|
||||
color: props.color,
|
||||
variant: props.variant,
|
||||
size: props.size
|
||||
size: buttonGroupSize.value || props.size,
|
||||
buttonGroup: orientation.value
|
||||
}))
|
||||
|
||||
extendDevtoolsMeta({ defaultProps: { label: 'Badge' } })
|
||||
|
||||
Reference in New Issue
Block a user