Files
leim-tools/app/components/ui/toast/index.ts
Alexis 7fdab8601f Migration to nuxt 4
Used codemods CLI and reworked most alias'd path that stopped working
2025-07-27 14:30:30 +02:00

39 lines
2.0 KiB
TypeScript

import type { ToastRootProps } from "radix-vue"
import type { HTMLAttributes } from "vue"
import { type VariantProps, cva } from "class-variance-authority"
export { default as Toaster } from "@/components/ui/toast/Toaster.vue"
export { default as Toast } from "@/components/ui/toast/Toast.vue"
export { default as ToastViewport } from "@/components/ui/toast/ToastViewport.vue"
export { default as ToastAction } from "@/components/ui/toast/ToastAction.vue"
export { default as ToastClose } from "@/components/ui/toast/ToastClose.vue"
export { default as ToastTitle } from "@/components/ui/toast/ToastTitle.vue"
export { default as ToastDescription } from "@/components/ui/toast/ToastDescription.vue"
export { default as ToastProvider } from "@/components/ui/toast/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-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 sm:data-[state=open]:slide-in-from-bottom-full",
{
variants: {
variant: {
default: "border bg-background text-foreground",
destructive: "destructive group border-destructive bg-destructive text-destructive-foreground",
success: "success group border-success bg-success-muted text-success-foreground"
},
},
defaultVariants: {
variant: "default",
},
},
)
type ToastVariants = VariantProps<typeof toastVariants>
export interface ToastProps extends ToastRootProps {
class?: HTMLAttributes["class"]
variant?: ToastVariants["variant"]
onOpenChange?: ((value: boolean) => void)
}