임동욱 임동욱 07-27
feat: 공용 Toast 비주얼 추가
Co-Authored-By: Claude Opus 5 
@84daf2cee51a185c5065e2e422c05bf76b136087
 
components/ui/toast.tsx (added)
+++ components/ui/toast.tsx
@@ -0,0 +1,30 @@
+import type { ReactNode } from "react";
+
+type ToastVariant = "info" | "success" | "danger" | "warning";
+
+const ACCENT_CLASSES: Record<ToastVariant, string> = {
+  info: "border-l-primary",
+  success: "border-l-success",
+  danger: "border-l-danger",
+  warning: "border-l-warning",
+};
+
+interface ToastProps {
+  variant?: ToastVariant;
+  children: ReactNode;
+}
+
+/**
+ * 알림 비주얼(토스트 1개). 위치·스택·표시 타이머는 호출부(feature) 책임 —
+ * 이 컴포넌트는 상태를 가지지 않는다.
+ */
+export function Toast({ variant = "info", children }: ToastProps) {
+  return (
+    <div
+      role="status"
+      className={`animate-toast-in rounded-lg border-l-4 bg-surface px-4 py-3 text-body-md text-foreground shadow-toast ${ACCENT_CLASSES[variant]}`}
+    >
+      {children}
+    </div>
+  );
+}
Add a comment
List