Added toast from shadcn

This commit is contained in:
Alexis
2024-09-08 18:10:54 +02:00
parent 680e5fe35c
commit a69553e089
10 changed files with 368 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
<script setup lang="ts">
import { type HTMLAttributes, computed } from "vue"
import { ToastViewport, type ToastViewportProps } from "radix-vue"
import { cn } from "@/lib/utils"
const props = defineProps<ToastViewportProps & { class?: HTMLAttributes["class"] }>()
const delegatedProps = computed(() => {
const { class: _, ...delegated } = props
return delegated
})
</script>
<template>
<ToastViewport v-bind="delegatedProps" :class="cn('fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]', props.class)" />
</template>