import{l as D,p as M,r as P,J as S,g as V,s as E,c,z as s,o as l,v as r,b as d,h as O,x as i,y as n,u as e,a as b,M as f,t as o,N as h,w as v,C as W}from"./index-CdEV5Lsj.js";import{a as j,b as q}from"./index-DruWBKkm.js";import{_ as J}from"./BasePage-aJlR_RJI.js";const R="UAlert",x={wrapper:{base:"border p-4 flex flex-col rounded-dynamic",variants:{variant:{primary:"bg-{color}-600 text-white border-transparent",secondary:"border-{color}-600 text-{color}-600",thirdary:"bg-{color}-50 text-{color}-600 border-transparent"},size:{xs:"text-2xs",sm:"text-xs",md:"text-sm",lg:"text-base"}},compoundVariants:[{variant:"thirdary",bordered:!0,class:"border-{color}-100"},{color:"white",variant:"primary",class:"text-gray-900 bg-white"},{color:"white",variant:"secondary",class:"text-gray-900 border-gray-200"},{color:"white",variant:"thirdary",class:"text-gray-900 bg-white"},{color:"white",variant:"thirdary",bordered:!0,class:"border-gray-200"},{color:"grayscale",variant:"primary",class:"bg-gray-900"},{color:"grayscale",variant:"secondary",class:"text-gray-900 border-gray-900"},{color:"grayscale",variant:"thirdary",class:"text-gray-900 bg-gray-50"},{color:"grayscale",variant:"thirdary",bordered:!0,class:"border-gray-200"},{color:"gray",variant:"primary",class:"bg-gray-500"},{color:"gray",variant:"secondary",class:"text-gray-500 border-gray-500"},{color:"gray",variant:"thirdary",class:"text-gray-500 bg-gray-50"},{color:"gray",variant:"thirdary",bordered:!0,class:"border-gray-500"}]},body:"flex items-start justify-between",contentWrapper:"flex gap-2",content:"",title:{base:"font-bold leading-tight",variants:{size:{xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg"}}},description:"",text:{base:"{UText}",defaults:{size:{xs:"sm",sm:"sm",md:"md",lg:"lg"}}},closeButton:"{UButton}",closeIcon:{base:"{UIcon}",defaults:{size:{xs:"3xs",sm:"2xs",md:"xs",lg:"sm"}}},defaults:{variant:"primary",color:"brand",size:"md",timeout:0,bordered:!1,closable:!1,closeIcon:"close"}},F=["data-test"],G=["textContent"],H=["textContent"],Y=D({inheritAttrs:!1,__name:"UAlert",props:M({title:{},description:{},variant:{},bordered:{type:Boolean},size:{},color:{},timeout:{},closable:{type:Boolean},config:{},dataTest:{}},{...W(x,R)}),emits:["hidden"],setup(w,{emit:C}){const a=w,A=C,y=P(!0);S(()=>{a.timeout>0&&setTimeout(()=>u(),a.timeout)});function u(){y.value=!1,A("hidden")}const m=V(()=>a.variant==="primary"||a.color==="white"?a.color==="white"?"grayscale":"white":a.color),{getDataTest:g,config:p,wrapperAttrs:$,bodyAttrs:k,contentAttrs:B,textAttrs:z,titleAttrs:N,descriptionAttrs:I,closeButtonAttrs:U,closeIconAttrs:_,contentWrapperAttrs:T}=E(x);return(t,K)=>y.value?(l(),c("div",o({key:0},e($),{"data-test":e(g)()}),[r(t.$slots,"top"),d("div",i(n(e(k))),[d("div",i(n(e(T))),[r(t.$slots,"left"),d("div",i(n(e(B))),[e(f)(t.$slots.default)?s("",!0):r(t.$slots,"title",{key:0,title:t.title},()=>[t.title?(l(),c("div",o({key:0},e(N),{textContent:h(t.title)}),null,16,G)):s("",!0)]),e(f)(t.$slots.default)?s("",!0):r(t.$slots,"description",{key:1,description:t.description},()=>[t.description?(l(),c("div",o({key:0},e(I),{textContent:h(t.description)}),null,16,H)):s("",!0)]),b(J,i(n(e(z))),{default:v(()=>[r(t.$slots,"default")]),_:3},16)],16),r(t.$slots,"right")],16),t.closable?(l(),O(j,o({key:0,square:"",size:"xs",color:m.value,variant:"thirdary"},e(U),{onClick:u}),{default:v(()=>[r(t.$slots,"close",{iconName:e(p).defaults.closeIcon},()=>[b(q,o({internal:"",color:m.value,name:e(p).defaults.closeIcon},e(_),{"data-test":e(g)("button")}),null,16,["color","name","data-test"])])]),_:3},16,["color"])):s("",!0)],16),r(t.$slots,"bottom")],16,F)):s("",!0)}});export{Y as _};
