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