fix(lib): consistency code
This commit is contained in:
parent
42f0086586
commit
72ca85c677
|
|
@ -1,15 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { defineProps } from 'vue'
|
||||
import { AccordionItem, type AccordionItemProps } from 'radix-vue'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
const props = defineProps<AccordionItemProps & { class?: string }>()
|
||||
const computeClasses = cn('border-b', props.class ?? '')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AccordionItem
|
||||
v-bind="props"
|
||||
:class="cn('border-b', props.class ?? '')"
|
||||
>
|
||||
<AccordionItem v-bind="props" :class="computeClasses">
|
||||
<slot />
|
||||
</AccordionItem>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
<script setup lang="ts">
|
||||
import { type AlertDialogEmits, type AlertDialogProps, AlertDialogRoot, useForwardPropsEmits } from 'radix-vue'
|
||||
import { defineEmits, defineProps } from 'vue'
|
||||
import {
|
||||
type AlertDialogEmits,
|
||||
type AlertDialogProps,
|
||||
AlertDialogRoot,
|
||||
useForwardPropsEmits,
|
||||
} from 'radix-vue'
|
||||
|
||||
const props = defineProps<AlertDialogProps>()
|
||||
const emits = defineEmits<AlertDialogEmits>()
|
||||
|
||||
const forwarded = useForwardPropsEmits(props, emits)
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { defineProps } from 'vue'
|
||||
import { alertVariants } from '.'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
||||
|
|
@ -8,10 +9,11 @@ interface Props {
|
|||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const computeClasses = cn(alertVariants({ variant: props.variant }), props.class ?? '')
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="cn(alertVariants({ variant }), props.class ?? '')">
|
||||
<div :class="computeClasses">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { defineProps } from 'vue'
|
||||
import { AspectRatio, type AspectRatioProps } from 'radix-vue'
|
||||
|
||||
const props = defineProps<AspectRatioProps>()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<script setup lang="ts">
|
||||
import { defineProps, withDefaults } from 'vue'
|
||||
import { AvatarRoot } from 'radix-vue'
|
||||
import { avatarVariant } from '.'
|
||||
import { cn } from '@/lib/utils'
|
||||
|
|
@ -13,10 +14,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|||
size: 'sm',
|
||||
shape: 'circle',
|
||||
})
|
||||
const computedClasses = cn(avatarVariant({ size: props.size, shape: props.shape }), props.class)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AvatarRoot :class="cn(avatarVariant({ size, shape }), props.class)">
|
||||
<AvatarRoot :class="computedClasses">
|
||||
<slot />
|
||||
</AvatarRoot>
|
||||
</template>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user