gentelella
Version:
Gentelella v4 — free admin template. 60 pages, 20 chart variants, fully interactive inbox & kanban, live theme generator, component playground, PWA-ready. Vite 8, vanilla JS, no Bootstrap, no jQuery.
1 lines • 641 B
JavaScript
import{n as t}from"./rolldown-runtime-DEgBLETi.js";var e,n=t({showToast:()=>s});function s(t,n={}){const{variant:s="default",duration:o=2600}=n,a=document.createElement("div");a.className=`toast toast-${s}`,a.textContent=t,(e&&e.isConnected||((e=document.createElement("div")).className="toast-host",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),document.body.appendChild(e)),e).appendChild(a),a.getBoundingClientRect(),a.classList.add("show");const i=()=>{a.classList.remove("show"),a.addEventListener("transitionend",()=>a.remove(),{once:!0})};return setTimeout(i,o),a.addEventListener("click",i),a}export{n,s as t};