mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
2 lines
3.7 KiB
JavaScript
2 lines
3.7 KiB
JavaScript
import{B as w,k as d,D as g,o as a,e as c,h as t,u as e,j as m,m as u,t as p,U as y,r as k,f as N,w as C,F as M,y as z,l as B,aM as L}from"./vendor.d12b5734.js";import{u as v,_ as b}from"./main.06577e8c.js";const S=["onClick"],$={class:"overflow-hidden rounded-lg shadow-xs"},j={class:"p-4"},T={class:"flex items-start"},O={class:"shrink-0"},V={key:0,class:"w-6 h-6 text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},I=t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1),D=[I],E={key:1,class:"w-6 h-6 text-blue-400",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},F=t("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"},null,-1),A=[F],G={key:2,class:"w-6 h-6 text-red-400",fill:"currentColor",viewBox:"0 0 24 24"},R=t("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"},null,-1),U=[R],q={class:"flex-1 w-0 ml-3 text-left"},H={class:"flex shrink-0"},J=t("svg",{class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},[t("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})],-1),K=[J],P={props:{notification:{type:Object,default:null}},setup(o){const i=o,f=v();let l=w("");const s=d(()=>i.notification.type=="success"),h=d(()=>i.notification.type=="error"),n=d(()=>i.notification.type=="info");function r(){f.hideNotification(i.notification)}function x(){clearTimeout(l)}function _(){l=setTimeout(()=>{f.hideNotification(i.notification)},i.notification.time||5e3)}return g(()=>{_()}),(Y,Z)=>(a(),c("div",{class:u([e(s)||e(n)?"bg-white":"bg-red-50","max-w-sm mb-3 rounded-lg shadow-lg cursor-pointer pointer-events-auto w-full md:w-96"]),onClick:y(r,["stop"]),onMouseenter:x,onMouseleave:_},[t("div",$,[t("div",j,[t("div",T,[t("div",O,[e(s)?(a(),c("svg",V,D)):m("",!0),e(n)?(a(),c("svg",E,A)):m("",!0),e(h)?(a(),c("svg",G,U)):m("",!0)]),t("div",q,[t("p",{class:u(`text-sm leading-5 font-medium ${e(s)||e(n)?"text-gray-900":"text-red-800"}`)},p(o.notification.title?o.notification.title:e(s)?"Success!":"Error"),3),t("p",{class:u(`mt-1 text-sm leading-5 ${e(s)||e(n)?"text-gray-500":"text-red-700"}`)},p(o.notification.message?o.notification.message:e(s)?"Successful":"Somthing went wrong"),3)]),t("div",H,[t("button",{class:u([e(s)||e(n)?" text-gray-400 focus:text-gray-500":"text-red-400 focus:text-red-500","inline-flex w-5 h-5 transition duration-150 ease-in-out focus:outline-none"]),onClick:r},K,2)])])])])],42,S))}},Q={components:{NotificationItem:P},setup(){const o=v();return{notifications:d(()=>o.notifications)}}},W={class:"fixed inset-0 z-50 flex flex-col items-end justify-start w-full px-4 py-6 pointer-events-none sm:p-6"};function X(o,i,f,l,s,h){const n=k("NotificationItem");return a(),c("div",W,[N(L,{"enter-active-class":"transition duration-300 ease-out","enter-from-class":"translate-y-2 opacity-0 sm:translate-y-0 sm:translate-x-2","enter-to-class":"translate-y-0 opacity-100 sm:translate-x-0","leave-active-class":"transition duration-100 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:C(()=>[(a(!0),c(M,null,z(l.notifications,r=>(a(),B(n,{key:r.id,notification:r},null,8,["notification"]))),128))]),_:1})])}var ot=b(Q,[["render",X]]);export{ot as N};
|