mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
26 lines
721 B
Vue
26 lines
721 B
Vue
<template>
|
|
<UTooltip :text="color.value" class="capitalize" :open-delay="500">
|
|
<UButton
|
|
color="gray"
|
|
square
|
|
:ui="{
|
|
color: {
|
|
gray: {
|
|
solid: 'bg-gray-100 dark:bg-gray-800',
|
|
ghost: 'hover:bg-gray-50 dark:hover:bg-gray-800/50'
|
|
}
|
|
}
|
|
}"
|
|
:variant="color.value === selected.value ? 'solid' : 'ghost'"
|
|
@click.stop.prevent="$emit('select')"
|
|
>
|
|
<span class="inline-block w-3 h-3 rounded-full" :style="{ backgroundColor: color.hex }" />
|
|
</UButton>
|
|
</UTooltip>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
defineProps<{ color: { value: string, hex: string }, selected: { value: string} }>()
|
|
defineEmits(['select'])
|
|
</script>
|