shadcn-vue/apps/www/src/lib/registry/default/ui/select/SelectItem.vue
zernonia 02fe76d1f0
refactor: replace iconify icons with @radix-icons/vue for newyork style (#87)
* refactor: changes all instance of unplugin-icons to radix-icons

* chore: build registry

* test: fix new deps
2023-09-27 12:26:24 +08:00

35 lines
888 B
Vue

<script setup lang="ts">
import {
SelectItem,
SelectItemIndicator,
type SelectItemProps,
SelectItemText,
} from 'radix-vue'
import { Check } from 'lucide-vue-next'
import { cn } from '@/lib/utils'
const props = defineProps<SelectItemProps & { class?: string }>()
</script>
<template>
<SelectItem
v-bind="props"
:class="
cn(
'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
props.class,
)
"
>
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
<SelectItemIndicator>
<Check class="h-4 w-4" />
</SelectItemIndicator>
</span>
<SelectItemText>
<slot />
</SelectItemText>
</SelectItem>
</template>