ptitlutins/app/components/molecules/MetaPill.vue
2026-06-10 23:37:21 +02:00

78 lines
1.3 KiB
Vue

<script setup lang="ts">
withDefaults(
defineProps<{
icon: string
ghost?: boolean
tone?: "violet" | "neutral"
title?: string
}>(),
{
ghost: false,
tone: "violet",
title: undefined,
},
)
defineEmits<{
click: []
}>()
</script>
<template>
<button
type="button"
class="metapill"
:class="ghost ? 'ghost' : tone"
:title="title"
@click.stop="$emit('click')"
>
<Icon :name="icon" size="0.85rem" />
<slot />
</button>
</template>
<style scoped>
.metapill {
display: inline-flex;
align-items: center;
gap: 5px;
padding: 2px 9px;
border-radius: var(--radius-pill);
cursor: pointer;
white-space: nowrap;
font-family: var(--font-body);
font-size: 0.72rem;
font-weight: var(--weight-semibold);
transition:
filter 120ms ease,
background 120ms ease;
}
.metapill.violet {
background: var(--color-9);
border: 1px solid var(--color-8);
color: var(--color-3);
}
.metapill.neutral {
background: var(--neutral-10);
border: 1px solid var(--neutral-20);
color: var(--text-muted);
}
.metapill.ghost {
background: transparent;
border: 1px dashed var(--neutral-30);
color: var(--text-faint);
}
.metapill:hover {
filter: brightness(0.97);
box-shadow: var(--shadow-1);
}
.metapill.ghost:hover {
filter: none;
background: var(--color-9);
}
</style>