<script setup lang="ts">
import type { UiButtonType, UiSeverity } from '../adapter/contracts'
import { useUiAdapter } from '../adapter/useUiAdapter'

withDefaults(defineProps<{ label?: string; severity?: UiSeverity; type?: UiButtonType; disabled?: boolean; loading?: boolean }>(), {
  severity: 'primary', type: 'button', disabled: false, loading: false
})
const emit = defineEmits<{ click: [event: MouseEvent] }>()
const adapter = useUiAdapter()
</script>

<template>
  <component :is="adapter.components.Button" v-bind="$props" @activate="emit('click', $event)"><slot /></component>
</template>
