28 lines
1.2 KiB
Vue
28 lines
1.2 KiB
Vue
<script setup>
|
|
import { ref } from 'vue';
|
|
import { EMOJI_GROUPS } from '../lib/emojis';
|
|
|
|
const emit = defineEmits(['pick']);
|
|
const group = ref(0);
|
|
</script>
|
|
|
|
<template>
|
|
<div>
|
|
<div class="ih:flex ih:border-b ih:px-1" role="tablist" aria-label="Emoji-Gruppen">
|
|
<button
|
|
v-for="(g, i) in EMOJI_GROUPS"
|
|
:key="g.label"
|
|
type="button"
|
|
role="tab"
|
|
:aria-selected="group === i"
|
|
:title="g.label"
|
|
class="ih:grid ih:size-9 ih:place-items-center ih:text-lg ih:transition-opacity"
|
|
:class="group === i ? 'ih:border-b-2 ih:border-brand' : 'ih:opacity-60 ih:hover:opacity-100'"
|
|
@click="group = i"
|
|
>{{ g.icon }}</button>
|
|
</div>
|
|
<div class="ih:grid ih:max-h-60 ih:grid-cols-8 ih:gap-0.5 ih:overflow-y-auto ih:p-2" role="tabpanel" :aria-label="EMOJI_GROUPS[group].label">
|
|
<button v-for="emoji in EMOJI_GROUPS[group].emojis" :key="emoji" type="button" class="ih:grid ih:aspect-square ih:place-items-center ih:rounded ih:text-xl ih:hover:bg-accent" :aria-label="emoji" @click="emit('pick', emoji)">{{ emoji }}</button>
|
|
</div>
|
|
</div>
|
|
</template>
|