1 line
1.6 KiB
JavaScript
1 line
1.6 KiB
JavaScript
import{a as t,j as e}from"./vendor-react-Dkpvlwai.js";import{d as i}from"./index-VJPzCABl.js";import{X as p,a as u,A as g,C as h,I as b}from"./vendor-icons-CbmLcMl-.js";const N=t.forwardRef(({variant:s="default",title:r,onClose:a,className:l,children:d,...x},m)=>{const f={destructive:"error",default:"info"}[s]||s,o={info:"bg-muted/10 border-border/30 text-muted-foreground",success:"bg-success/10 border-success/30 text-success",warning:"bg-warning/10 border-warning/30 text-warning",error:"bg-destructive/10 border-destructive/30 text-destructive"},n={info:e.jsx(b,{className:"w-5 h-5 flex-shrink-0"}),success:e.jsx(h,{className:"w-5 h-5 flex-shrink-0"}),warning:e.jsx(g,{className:"w-5 h-5 flex-shrink-0"}),error:e.jsx(u,{className:"w-5 h-5 flex-shrink-0"})},c=f;return e.jsxs("div",{ref:m,role:"alert",className:i("p-4 rounded-lg border flex gap-4",o[c]||o.info,l),...x,children:[n[c]||n.info,e.jsxs("div",{className:"flex-1",children:[r&&e.jsx("h5",{className:"font-bold mb-1",children:r}),e.jsx("div",{className:"text-sm opacity-90",children:d})]}),a&&e.jsx("button",{onClick:a,className:"opacity-70 hover:opacity-100 transition-opacity","aria-label":"Fermer l'alerte",children:e.jsx(p,{className:"w-4 h-4"})})]})});N.displayName="Alert";const j=t.forwardRef(({className:s,...r},a)=>e.jsx("h5",{ref:a,className:i("mb-1 font-bold leading-none tracking-tight text-foreground",s),...r}));j.displayName="AlertTitle";const w=t.forwardRef(({className:s,...r},a)=>e.jsx("div",{ref:a,className:i("text-sm opacity-90 [&_p]:leading-relaxed",s),...r}));w.displayName="AlertDescription";export{N as A,w as a};
|