shadcn-vue/apps/www/registry/new-york/ui/stepper/StepperSeparator.vue
2024-11-21 11:52:31 +08:00

32 lines
783 B
Vue

<script lang="ts" setup>
import type { StepperSeparatorProps } from 'reka-ui'
import { cn } from '@/lib/utils'
import { StepperSeparator, useForwardProps } from 'reka-ui'
import { computed, type HTMLAttributes } from 'vue'
const props = defineProps<StepperSeparatorProps & { class?: HTMLAttributes['class'] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
const forwarded = useForwardProps(delegatedProps)
</script>
<template>
<StepperSeparator
v-bind="forwarded"
:class="cn(
'bg-muted',
// Disabled
'group-data-[disabled]:bg-muted group-data-[disabled]:opacity-50',
// Completed
'group-data-[state=completed]:bg-accent-foreground',
props.class,
)"
/>
</template>