(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i["@limonische/vue3-transition-expand"]={},i.Vue))})(this,function(i,e){"use strict";const l=e.defineComponent({__name:"TransitionExpand",props:{tag:null,direction:{default:"vertical"},duration:{default:300}},setup(s){const n=s;e.useCssVars(t=>({"52407dc9":e.unref(_)}));const r=e.computed(()=>n.tag?e.TransitionGroup:e.Transition),o=e.computed(()=>n.direction==="vertical"?"height":"width"),a=e.computed(()=>n.direction!=="vertical"?"height":"width"),_=e.computed(()=>`${n.duration}ms`),y=e.computed(()=>({name:`expand--${n.direction}`,...n.tag&&{tag:n.tag}})),f=t=>{t.style.transition="none",t.style[a.value]=getComputedStyle(t)[a.value],t.style.position="absolute",t.style.visibility="hidden",t.classList.remove(`expand--${n.direction}-enter-from`);const d=(({width:v,height:g})=>({width:v,height:g}))(getComputedStyle(t));t.classList.add(`expand--${n.direction}-enter-from`),t.style[a.value]="",t.style.position="",t.style.visibility="",getComputedStyle(t)[o.value],t.style.transition="",requestAnimationFrame(()=>{t.style[o.value]=d[o.value]})},x=t=>{const d=getComputedStyle(t);t.style[o.value]=d[o.value],getComputedStyle(t)[o.value],requestAnimationFrame(()=>{t.style[o.value]="0"})},u=t=>{t.style[o.value]=""};return(t,d)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),e.mergeProps(e.unref(y),{onEnter:f,onAfterEnter:u,onLeave:x,onAfterLeave:u}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{},void 0,!0)]),_:3},16))}}),m="",h="",c=((s,n)=>{const r=s.__vccOpts||s;for(const[o,a]of n)r[o]=a;return r})(l,[["__scopeId","data-v-dea32ab4"]]),p={install:(s,n={})=>{s.component((n==null?void 0:n.componentName)??"TransitionExpand",{extends:c,setup:c.setup,props:{duration:{default:n==null?void 0:n.duration}}})}};i.TransitionExpand=c,i.default=p,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});