From 1a77229752174e1731412bd70d56abc9d9b412d0 Mon Sep 17 00:00:00 2001 From: Robb Niznik Date: Tue, 15 Oct 2024 16:39:50 -0400 Subject: [PATCH] feat(components): add `error` variant to `Toast` --- .changeset/tidy-falcons-obey.md | 5 +++++ packages/components/src/Toast.tsx | 2 ++ 2 files changed, 7 insertions(+) create mode 100644 .changeset/tidy-falcons-obey.md diff --git a/.changeset/tidy-falcons-obey.md b/.changeset/tidy-falcons-obey.md new file mode 100644 index 000000000..6eb25dfb2 --- /dev/null +++ b/.changeset/tidy-falcons-obey.md @@ -0,0 +1,5 @@ +--- +"@launchpad-ui/components": patch +--- + +Add `error` variant to `Toast` diff --git a/packages/components/src/Toast.tsx b/packages/components/src/Toast.tsx index fc6ce5a5b..47ab710b5 100644 --- a/packages/components/src/Toast.tsx +++ b/packages/components/src/Toast.tsx @@ -187,6 +187,8 @@ const snackbarQueue = new AriaToastQueue({ const timeout = 6000; const ToastQueue = { + error: (children: ToastContent['children'], options?: ToastOptions) => + toastQueue.add({ children, status: 'error' }, { ...options, timeout }), info: (children: ToastContent['children'], options?: ToastOptions) => toastQueue.add({ children, status: 'info' }, { ...options, timeout }), success: (children: ToastContent['children'], options?: ToastOptions) =>