2022-12-23 15:08:36 +00:00
|
|
|
<script setup lang="ts">
|
2022-12-28 14:57:06 +00:00
|
|
|
import type { AriaLive } from '~/composables/aria'
|
2022-12-23 15:08:36 +00:00
|
|
|
|
|
|
|
// tsc complaining when using $defineProps
|
|
|
|
withDefaults(defineProps<{
|
|
|
|
ariaLive?: AriaLive
|
|
|
|
}>(), {
|
|
|
|
ariaLive: 'polite',
|
|
|
|
})
|
|
|
|
|
|
|
|
const { announceStatus, clearStatus, status } = useAriaStatus()
|
|
|
|
|
|
|
|
defineExpose({
|
|
|
|
announceStatus,
|
|
|
|
clearStatus,
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<slot />
|
|
|
|
<p sr-only role="status" :aria-live="ariaLive">
|
|
|
|
<slot name="status" :status="status">
|
|
|
|
{{ status }}
|
|
|
|
</slot>
|
|
|
|
</p>
|
|
|
|
</template>
|