diff --git a/packages/ui/src/components/primitives/sonner.tsx b/packages/ui/src/components/primitives/sonner.tsx index 47eb54ce0f..cfc1579607 100644 --- a/packages/ui/src/components/primitives/sonner.tsx +++ b/packages/ui/src/components/primitives/sonner.tsx @@ -386,61 +386,42 @@ interface QuickLoadingProps extends QuickApiProps { promise: ToastProps['promise'] } -toast.info = (message: ReactNode, data?: QuickApiProps) => { +toast.info = (message: ReactNode, data?: QuickApiProps) => toast({ type: 'info', title: message, ...data }) -} -toast.success = (message: ReactNode, data?: QuickApiProps) => { +toast.success = (message: ReactNode, data?: QuickApiProps) => toast({ type: 'success', title: message, ...data }) -} -toast.warning = (message: ReactNode, data?: QuickApiProps) => { +toast.warning = (message: ReactNode, data?: QuickApiProps) => toast({ type: 'warning', title: message, ...data }) -} -toast.error = (message: ReactNode, data?: QuickApiProps) => { +toast.error = (message: ReactNode, data?: QuickApiProps) => toast({ type: 'error', title: message, ...data }) -} -toast.loading = (message: ReactNode, data: QuickLoadingProps) => { +toast.loading = (message: ReactNode, data: QuickLoadingProps) => toast({ type: 'loading', title: message, ...data }) -} -toast.dismiss = (id: ToastProps['id']) => { - sonnerToast.dismiss(id) -} - -// const toastColorVariants = cva(undefined, { -// variants: { -// type: { -// info: 'text-blue-500', -// warning: 'text-warning-base', -// error: 'text-error-base', -// success: 'text-success-base', -// loading: 'text-foreground-muted' -// } -// } -// }) +toast.dismiss = (id: ToastProps['id']) => sonnerToast.dismiss(id) const toastBgColorVariants = cva(undefined, { variants: { @@ -454,99 +435,6 @@ const toastBgColorVariants = cva(undefined, { } }) -// function Toast({ -// id, -// type, -// title, -// description, -// coloredMessage, -// colored: coloredBackground, -// dismissable, -// onDismiss, -// button, -// link -// }: ToastProps) { -// const icon = useMemo(() => { -// switch (type) { -// case 'info': -// return -// case 'error': -// return -// case 'loading': -// return -// case 'success': -// return -// case 'warning': -// return -// } -// }, [type]) - -// const handleDismiss = useCallback(() => { -// sonnerToast.dismiss(id) -// onDismiss?.() -// }, [id, onDismiss]) - -// return ( -//
-// {dismissable && ( -// -// )} -//
-// {icon} -//
-//
-// {title} -//
-//
-//

-// {coloredMessage && {coloredMessage} } -// {description} -//

-//
-// {link && ( -// // FIXME: missing typography/typography components/p/letter-spacing -// -// )} -//
-//
-// {button !== undefined && ( -// -// )} -//
-// ) -// } - const Toaster = ({ ...props }: ToasterProps) => { return (