File size: 5,693 Bytes
d8d73ee
1
import{Transition as e,__plugin_vue_export_helper_default as t,computed as n,createBaseVNode as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createTextVNode as s,createVNode as c,defineComponent as l,guardReactiveProps as u,mergeModels as d,mergeProps as f,normalizeClass as p,normalizeProps as m,openBlock as h,renderSlot as g,toDisplayString as _,unref as v,useModel as y,watchEffect as b,withCtx as x}from"./index-BtAisBe9.js";var S=l({__name:`BidirectionalTransition`,props:{fromClass:null,activeClass:null,toClass:null},setup(t){return(n,r)=>(h(),i(e,{"enter-from-class":t.fromClass,"enter-active-class":t.activeClass,"enter-to-class":t.toClass,"leave-from-class":t.toClass,"leave-active-class":t.activeClass,"leave-to-class":t.fromClass},{default:x(()=>[g(n.$slots,`default`)]),_:3},8,[`enter-from-class`,`enter-active-class`,`enter-to-class`,`leave-from-class`,`leave-active-class`,`leave-to-class`]))}}),C=S;const w=`0px`;var T=l({__name:`TransitionVertical`,props:{duration:{default:250},easingEnter:{default:`ease-in-out`},easingLeave:{default:`ease-in-out`},opacityClosed:{default:0},opacityOpened:{default:1}},setup(t){let n=t;function r(e){return{height:e.style.height,width:e.style.width,position:e.style.position,visibility:e.style.visibility,overflow:e.style.overflow,paddingTop:e.style.paddingTop,paddingBottom:e.style.paddingBottom,borderTopWidth:e.style.borderTopWidth,borderBottomWidth:e.style.borderBottomWidth,marginTop:e.style.marginTop,marginBottom:e.style.marginBottom}}function a(e,t){let{width:n}=getComputedStyle(e);e.style.width=n,e.style.position=`absolute`,e.style.visibility=`hidden`,e.style.height=``;let{height:r}=getComputedStyle(e);return e.style.width=t.width,e.style.position=t.position,e.style.visibility=t.visibility,e.style.height=w,e.style.overflow=`hidden`,t.height&&t.height!==w?t.height:r}function o(e,t,n,r,i){let a=e.animate(r,i);e.style.height=t.height,a.onfinish=()=>{e.style.overflow=t.overflow,n()}}function s(e,t){return[{height:w,opacity:n.opacityClosed,paddingTop:w,paddingBottom:w,borderTopWidth:w,borderBottomWidth:w,marginTop:w,marginBottom:w},{height:e,opacity:n.opacityOpened,paddingTop:t.paddingTop,paddingBottom:t.paddingBottom,borderTopWidth:t.borderTopWidth,borderBottomWidth:t.borderBottomWidth,marginTop:t.marginTop,marginBottom:t.marginBottom}]}function c(e,t){let i=e,c=r(i),l=a(i,c),u=s(l,c),d={duration:n.duration,easing:n.easingEnter};o(i,c,t,u,d)}function l(e,t){let i=e,a=r(i),{height:c}=getComputedStyle(i);i.style.height=c,i.style.overflow=`hidden`;let l=s(c,a).reverse(),u={duration:n.duration,easing:n.easingLeave};o(i,a,t,l,u)}return(t,n)=>(h(),i(e,{css:!1,onEnter:c,onLeave:l},{default:x(()=>[g(t.$slots,`default`)]),_:3}))}}),E=T;const D={op50:``};var O=l({__name:`Collapsable`,props:d({default:{type:Boolean},label:null},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=y(e,`modelValue`);b(()=>{t.default!=null&&(n.value=!!t.default)});function i(e){return n.value=e,e}return(e,l)=>(h(),o(`div`,null,[g(e.$slots,`trigger`,m(u({visible:n.value,setVisible:i})),()=>[r(`button`,{sticky:``,"top-0":``,"z-10":``,flex:``,"items-center":``,"justify-between":``,px2:``,py1:``,"text-sm":``,"backdrop-blur-xl":``,onClick:l[0]||=e=>n.value=!n.value},[r(`span`,null,_(t.label??`Collapsable`),1),l[1]||=s(),r(`span`,D,_(n.value?`▲`:`▼`),1)])]),c(v(E),null,{default:x(()=>[n.value?g(e.$slots,`default`,m(f({key:0},{visible:n.value,setVisible:i}))):a(``,!0)]),_:3})]))}}),k=O,A=l({__name:`Skeleton`,props:{animation:{default:`pulse`}},setup(e){let t=e;return(e,n)=>(h(),o(`div`,{class:p([`skeleton`,t.animation===`none`?``:`skeleton-${t.animation}`]),bg:`neutral-200 dark:neutral-800`,overflow:`hidden`},[g(e.$slots,`default`,{},void 0,!0)],2))}}),j=t(A,[[`__scopeId`,`data-v-f404da2a`]]);const M=[`disabled`],N={class:`flex flex-row items-center justify-center`},P={key:0,class:`mr-2 w-4`},F={key:0,class:`i-svg-spinners:ring-resize h-4 w-4`},I={key:0};var L=l({__name:`Button`,props:{icon:null,label:null,disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},variant:{default:`primary`},size:{default:`md`},block:{type:Boolean,default:!1}},setup(e){let t=e,i=n(()=>t.disabled||t.loading),s={primary:`bg-primary-500 hover:bg-primary-600 dark:bg-primary-400 dark:hover:bg-primary-500 focus:ring-primary-500/50 dark:focus:ring-primary-400/50 text-white`,secondary:`bg-neutral-100 hover:bg-neutral-200 dark:bg-neutral-600 dark:hover:bg-neutral-500 focus:ring-neutral-300/50 dark:focus:ring-neutral-600/50 text-neutral-900 dark:text-neutral-100`,danger:`bg-red-500 hover:bg-red-600 dark:bg-red-400 dark:hover:bg-red-500 focus:ring-red-600/50 dark:focus:ring-red-500/50 text-white`},l={sm:`px-3 py-1.5 text-xs`,md:`px-4 py-2 text-sm`,lg:`px-6 py-3 text-base`},u=n(()=>[`rounded-lg font-medium outline-none transition-all duration-200 ease-in-out`,`disabled:cursor-not-allowed disabled:opacity-50`,t.block?`w-full`:``,l[t.size],s[t.variant],{"opacity-50 cursor-not-allowed":i.value},`focus:ring-2 focus:ring-offset-2 focus:ring-offset-white dark:focus:ring-offset-neutral-900`]);return(t,n)=>(h(),o(`button`,{disabled:i.value,class:p(u.value)},[r(`div`,N,[c(v(C),{"from-class":`opacity-0 mr-0! w-0!`,"active-class":`transition-[width,margin] ease-in-out overflow-hidden`},{default:x(()=>[e.loading||e.icon?(h(),o(`div`,P,[e.loading?(h(),o(`div`,F)):e.icon?(h(),o(`div`,{key:1,class:p([`h-4 w-4`,e.icon])},null,2)):a(``,!0)])):a(``,!0)]),_:1}),e.label?(h(),o(`span`,I,_(e.label),1)):g(t.$slots,`default`,{key:1})])],10,M))}}),R=L;export{R as Button_default,k as Collapsable_default,j as Skeleton_default,E as TransitionVertical_default};