Added toast on deleted entities

This commit is contained in:
Alexis
2024-09-08 19:26:38 +02:00
parent a69553e089
commit 2f79de8483
9 changed files with 64 additions and 10 deletions

View File

@@ -13,7 +13,7 @@ const delegatedProps = computed(() => {
</script>
<template>
<ToastTitle v-bind="delegatedProps" :class="cn('text-sm font-semibold', props.class)">
<ToastTitle v-bind="delegatedProps" :class="cn('text-[.85em] font-semibold', props.class)">
<slot />
</ToastTitle>
</template>

View File

@@ -14,13 +14,13 @@ export { default as ToastProvider } from "./ToastProvider.vue"
export { toast, useToast } from "./use-toast"
export const toastVariants = cva(
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[--radix-toast-swipe-end-x] data-[swipe=move]:translate-x-[--radix-toast-swipe-move-x] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
"group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[--radix-toast-swipe-end-x] data-[swipe=move]:translate-x-[--radix-toast-swipe-move-x] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",
{
variants: {
variant: {
default: "border bg-background text-foreground",
destructive:
"destructive group border-destructive bg-destructive text-destructive-foreground",
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
success: "success group border-success bg-success-muted text-success-foreground"
},
},
defaultVariants: {

View File

@@ -2,7 +2,7 @@ import { computed, ref } from "vue"
import type { Component, VNode } from "vue"
import type { ToastProps } from "."
const TOAST_LIMIT = 1
const TOAST_LIMIT = 3
const TOAST_REMOVE_DELAY = 1000000
export type StringOrVNode =