"use client"; import * as React from "react"; import { AnimatePresence, motion } from "framer-motion"; import { IconAlertTriangle, IconCircleCheck, IconCircleX, IconInfoCircle, IconX, } from "@tabler/icons-react"; import { cn } from "../lib/utils"; import { transitions } from "../lib/motion"; type BannerTone = "info" | "success" | "warning" | "danger"; // Annotated so the published declarations don't need React's internal types. const TONES: Record; box: string; text: string }> = { info: { icon: IconInfoCircle, box: "border-action/25 bg-action/[0.06]", text: "text-action" }, success: { icon: IconCircleCheck, box: "border-positive/25 bg-positive/[0.06]", text: "text-positive-fg" }, warning: { icon: IconAlertTriangle, box: "border-attention/30 bg-attention/[0.07]", text: "text-attention-fg" }, danger: { icon: IconCircleX, box: "border-risk/25 bg-risk/[0.06]", text: "text-risk-fg" }, }; /** An inline message with a tone, an optional action, and dismissal. */ export function Banner({ tone = "info", title, children, action, onDismiss, className, }: { tone?: keyof typeof TONES; title: React.ReactNode; children?: React.ReactNode; action?: React.ReactNode; onDismiss?: () => void; className?: string; }) { const meta = TONES[tone]; const Icon = meta.icon; return (
); } /** Animates a banner (or anything) in and out. */ export function Presence({ show, children }: { show: boolean; children: React.ReactNode }) { return ( {show ? ( {children} ) : null} ); }