feat(SW-556): add surprise notification component

This commit is contained in:
Christian Andolf
2024-10-08 17:18:20 +02:00
parent 0898ff3cd4
commit 3206319254
20 changed files with 723 additions and 65 deletions

View File

@@ -49,7 +49,7 @@ export function Toast({ message, onClose, variant }: ToastsProps) {
}
export const toast = {
success: (message: string, options?: ExternalToast) =>
success: (message: React.ReactNode, options?: ExternalToast) =>
sonnerToast.custom(
(t) => (
<Toast
@@ -60,7 +60,7 @@ export const toast = {
),
options
),
info: (message: string, options?: ExternalToast) =>
info: (message: React.ReactNode, options?: ExternalToast) =>
sonnerToast.custom(
(t) => (
<Toast
@@ -71,7 +71,7 @@ export const toast = {
),
options
),
error: (message: string, options?: ExternalToast) =>
error: (message: React.ReactNode, options?: ExternalToast) =>
sonnerToast.custom(
(t) => (
<Toast
@@ -82,7 +82,7 @@ export const toast = {
),
options
),
warning: (message: string, options?: ExternalToast) =>
warning: (message: React.ReactNode, options?: ExternalToast) =>
sonnerToast.custom(
(t) => (
<Toast

View File

@@ -5,6 +5,6 @@ import type { VariantProps } from "class-variance-authority"
export interface ToastsProps
extends Omit<React.AnchorHTMLAttributes<HTMLDivElement>, "color">,
VariantProps<typeof toastVariants> {
message: string
message: React.ReactNode
onClose: () => void
}