From 08168c2b80bbc73c7503e71e199fc1f54fd9b007 Mon Sep 17 00:00:00 2001
From: BrickheadJohnny <92519134+BrickheadJohnny@users.noreply.github.com>
Date: Mon, 25 Nov 2024 15:31:55 +0100
Subject: [PATCH] feat: Toast component with Sonner (#1559)
* feat: Toast component with Sonner
* fix: button width in storybook
* fix(Toaster): add ring on focus-visible
---
package.json | 1 +
src/app/layout.tsx | 2 ++
src/components/ui/Toaster.tsx | 31 +++++++++++++++++++
src/stories/Toast.stories.tsx | 56 +++++++++++++++++++++++++++++++++++
4 files changed, 90 insertions(+)
create mode 100644 src/components/ui/Toaster.tsx
create mode 100644 src/stories/Toast.stories.tsx
diff --git a/package.json b/package.json
index e18764f217..0952095441 100644
--- a/package.json
+++ b/package.json
@@ -41,6 +41,7 @@
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-hook-form": "^7.53.2",
+ "sonner": "^1.7.0",
"tailwind-merge": "^2.5.4",
"tailwindcss-animate": "^1.0.7",
"vaul": "^1.1.1",
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 646f617485..14103eaca6 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -3,6 +3,7 @@ import "@/styles/globals.css";
import { Header } from "@/components/Header";
import { Providers } from "@/components/Providers";
import { SignInDialog } from "@/components/SignInDialog";
+import { Toaster } from "@/components/ui/Toaster";
import { dystopian, inter } from "@/lib/fonts";
import { cn } from "lib/cssUtils";
@@ -30,6 +31,7 @@ const RootLayout = ({
{/* TODO: maybe load this dynamically? */}
+