Skip to content

Commit

Permalink
feat(components): add error variant to Toast
Browse files Browse the repository at this point in the history
  • Loading branch information
Niznikr committed Oct 15, 2024
1 parent d1243b7 commit 1a77229
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-falcons-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@launchpad-ui/components": patch
---

Add `error` variant to `Toast`
2 changes: 2 additions & 0 deletions packages/components/src/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ const snackbarQueue = new AriaToastQueue<SnackbarValue>({
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) =>
Expand Down

0 comments on commit 1a77229

Please sign in to comment.