@lui-ui/lui-vue
Advanced tools
Comparing version 0.28.1 to 0.28.2
@@ -1,1 +0,1 @@ | ||
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.LuiVue={},y.Vue))})(this,function(y,e){"use strict";function G(t){const l=e.computed(()=>({backgroundColor:t.variant.value==="solid"?{[`bg-${t.color.value}-500`]:t.filter.value==="none",[`bg-${t.color.value}-100`]:t.filter.value==="lighten",[`bg-${t.color.value}-800`]:t.filter.value==="darken"}:null})),n=e.computed(()=>({textColor:t.variant.value==="solid"?{["text-white"]:t.filter.value==="none",[`text-${t.color.value}-500`]:t.filter.value==="lighten",[`text-${t.color.value}-100`]:t.filter.value==="darken"}:{[`text-${t.color.value}-500`]:t.filter.value==="none",[`text-${t.color.value}-100`]:t.filter.value==="lighten",[`text-${t.color.value}-800`]:t.filter.value==="darken"}})),o=e.computed(()=>({borderColor:t.variant.value==="outline"?{[`border-${t.color.value}-500`]:t.filter.value==="none",[`border-${t.color.value}-100`]:t.filter.value==="lighten",[`border-${t.color.value}-800`]:t.filter.value==="darken"}:t.border.value?{["border-white"]:t.filter.value==="none",[`border-${t.color.value}-500`]:t.filter.value==="lighten",[`border-${t.color.value}-100`]:t.filter.value==="darken"}:"border-transparent"}));return{backgroundColorClasses:l.value,textColorClasses:n.value,borderColorClasses:o.value}}function W(){return{position:"absolute",overflow:"overflow-hidden",outlineStyle:"outline-none",cursor:"disabled:cursor-not-allowed",borderWidth:"border-0",opacity:"opacity-0",zIndex:"z-10",peer:"peer"}}function A(t,l){return{descriptionClasses:e.computed(()=>{const o={fontSize:"text-sm",lineHeight:"leading-normal",margin:"mt-1",textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-200 dark:text-secondary-700":{"text-secondary-600 dark:text-secondary-400":t.state.value===null,"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...o})})}}function H(t,l){const n=e.toRef(t,"modelValue"),o=function(c){if(typeof t.modelValue=="boolean"||t.modelValue===void 0)return c.target.checked;if(c.target.checked)n.value.push(c.target.value);else{const a=n.value.indexOf(c.target.value);n.value.splice(a,1)}return n.value},i=e.computed(()=>t.modelValue===void 0?l.checked!==void 0?l.checked:!1:typeof t.modelValue=="boolean"?t.modelValue:n.value.includes(t.value));return{handleVModel:o,isInputChecked:i}}const ee=["src","alt"],te={name:"LuiAvatar"},le=e.defineComponent({...te,props:{variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},border:{type:Boolean,default:!1},rounded:{type:[Boolean,String],default:!1},text:{type:String,default:""},src:{type:String,default:""},alt:{type:String,default:""}},setup(t){const l=t,{backgroundColorClasses:n,textColorClasses:o,borderColorClasses:i}=G(e.toRefs(l)),c=e.computed(()=>{const s={borderWidth:"border",borderStyle:"border-solid",display:"block",width:"w-full",height:"h-full",objectFit:"object-cover",borderRadius:{"rounded-lg":l.rounded===!0,"rounded-full":l.rounded==="full"},borderColor:i.borderColor};return Object.values(s)}),a=e.computed(()=>Object.values({display:"flex",justifyContent:"justify-center",alignItems:"items-center"})),d=e.computed(()=>{const s={display:"flex",borderRadius:{"rounded-lg":l.rounded===!0,"rounded-full":l.rounded==="full"},borderWidth:"border",borderStyle:"border-solid",justifyContent:"justify-center",alignItems:"items-center",width:{"w-6":l.size==="xs","w-8":l.size==="sm","w-12":l.size==="md","w-16":l.size==="lg","w-20":l.size==="xl"},height:{"h-6":l.size==="xs","h-8":l.size==="sm","h-12":l.size==="md","h-16":l.size==="lg","h-20":l.size==="xl"},fontSize:{"text-sm":l.size==="xs"||l.size==="sm","text-xl":l.size==="md","text-3xl":l.size==="lg"||l.size==="xl"},backgroundColor:l.src.length===0?n.backgroundColor:null,textColor:o.textColor,borderColor:l.src.length===0?i.borderColor:"border-transparent"};return Object.values(s)});return(s,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["lui-avatar",e.unref(d)])},[t.src.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,class:e.normalizeClass(e.unref(c))},null,10,ee)):e.createCommentVNode("",!0),s.$slots.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a))},[e.renderSlot(s.$slots,"icon")],2)):e.createCommentVNode("",!0),t.text.length>0?(e.openBlock(),e.createElementBlock("span",{key:2,ref:"avatarContent"},e.toDisplayString(t.text),513)):e.createCommentVNode("",!0)],2))}}),ne={name:"LuiBadge"},oe=e.defineComponent({...ne,props:{variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},border:{type:Boolean,default:!1},text:{type:String,default:""},position:{type:String,default:"bottom-right"}},setup(t){const l=t,n=e.useSlots(),{backgroundColorClasses:o,textColorClasses:i,borderColorClasses:c}=G(e.toRefs(l)),a=e.ref(null),d=e.ref(null),s=e.ref(!1);e.watchEffect(()=>{var I,k;const b=(I=a.value)==null?void 0:I.scrollWidth,S=(k=d.value)==null?void 0:k.scrollWidth;b&&S&&(S>b?s.value=!0:s.value=!1)});const f=e.computed(()=>Object.values({position:"relative",display:"inline-block"})),u=e.computed(()=>Object.values({display:"flex",justifyContent:"justify-center",alignItems:"items-center"})),z=e.computed(()=>{const b={display:s.value?"inline-block":"flex",position:{absolute:!!n.default},top:n.default?{"top-0":l.position==="top-left"||l.position==="top-right"}:null,bottom:n.default?{"bottom-0":l.position==="bottom-left"||l.position==="bottom-right"}:null,left:n.default?{"left-0":l.position==="bottom-left"||l.position==="top-left"}:null,right:n.default?{"right-0":l.position==="bottom-right"||l.position==="top-right"}:null,translate:n.default?{"-translate-y-1/2 -translate-x-1/2":l.position==="top-left","-translate-y-1/2 translate-x-1/2":l.position==="top-right","translate-y-1/2 -translate-x-1/2":l.position==="bottom-left","translate-y-1/2 translate-x-1/2":l.position==="bottom-right"}:null,borderRadius:"rounded-full",borderWidth:"border",borderStyle:"border-solid",justifyContent:{["justify-center"]:!s.value},alignItems:{["items-center"]:!s.value},padding:l.text.length>0||!!n.icon?{"px-0.5":l.size==="xs","px-1":l.size==="sm","px-1.5":l.size==="md","px-2":l.size==="lg","px-2.5":l.size==="xl"}:null,width:l.text.length>0||!!n.icon?s.value?null:{"w-3":l.size==="xs","w-4":l.size==="sm","w-5":l.size==="md","w-6":l.size==="lg","w-7":l.size==="xl"}:{"w-1.5":l.size==="xs","w-2":l.size==="sm","w-2.5":l.size==="md","w-3":l.size==="lg","w-3.5":l.size==="xl"},height:l.text.length>0||!!n.icon?s.value?null:{"h-3":l.size==="xs","h-4":l.size==="sm","h-5":l.size==="md","h-6":l.size==="lg","h-7":l.size==="xl"}:{"h-1.5":l.size==="xs","h-2":l.size==="sm","h-2.5":l.size==="md","h-3":l.size==="lg","h-3.5":l.size==="xl"},fontSize:{"text-xs":l.size==="xs"||l.size==="sm","text-sm":l.size==="md","text-base":l.size==="lg"||l.size==="xl"},backgroundColor:o.backgroundColor,textColor:i.textColor,borderColor:c.borderColor};return Object.values(b)});return(b,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["lui-badge",e.unref(f)])},[e.renderSlot(b.$slots,"default"),e.createElementVNode("div",{ref_key:"badgeWrapper",ref:a,class:e.normalizeClass(e.unref(z))},[b.$slots.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(u))},[e.renderSlot(b.$slots,"icon")],2)):e.createCommentVNode("",!0),l.text.length>0?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"badgeContent",ref:d},e.toDisplayString(t.text),513)):e.createCommentVNode("",!0)],2)],2))}});function se(t){const l=e.useSlots(),n=e.computed(()=>!!l.icon),o=e.computed(()=>!!l.icon||!!l.prepend||!!l.append),i=e.computed(()=>{const a={outlineStyle:"outline-none",ringWidth:"focus-visible:ring-4",transitionProperty:"transition-colors transition-transform",translate:"active:translate-y-0.5 disabled:translate-y-0",cursor:{["cursor-pointer disabled:cursor-not-allowed"]:t.tag.value==="button"},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},backgroundColor:t.variant.value==="solid"?{[`bg-${t.color.value}-500 hover:bg-${t.color.value}-400 disabled:bg-secondary-500`]:t.filter.value==="none",[`bg-${t.color.value}-100 hover:bg-${t.color.value}-50 disabled:bg-secondary-100`]:t.filter.value==="lighten",[`bg-${t.color.value}-800 hover:bg-${t.color.value}-700 disabled:bg-secondary-800`]:t.filter.value==="darken"}:null,textColor:t.variant.value==="solid"?{["text-white disabled:text-secondary-300"]:t.filter.value==="none",[`text-${t.color.value}-500 disabled:text-secondary-300`]:t.filter.value==="lighten",[`text-${t.color.value}-100 disabled:text-secondary-300`]:t.filter.value==="darken"}:{[`text-${t.color.value}-500 hover:text-${t.color.value}-400 disabled:text-secondary-500`]:t.filter.value==="none",[`text-${t.color.value}-100 hover:text-${t.color.value}-50 disabled:text-secondary-100`]:t.filter.value==="lighten",[`text-${t.color.value}-800 hover:text-${t.color.value}-700 disabled:text-secondary-800`]:t.filter.value==="darken"},borderColor:t.variant.value==="text"?"border-transparent":t.variant.value==="solid"||t.variant.value==="outline"?{[`border-${t.color.value}-500 hover:border-${t.color.value}-400 disabled:border-secondary-500`]:t.filter.value==="none",[`border-${t.color.value}-100 hover:border-${t.color.value}-50 disabled:border-secondary-100`]:t.filter.value==="lighten",[`border-${t.color.value}-800 hover:border-${t.color.value}-700 disabled:border-secondary-800`]:t.filter.value==="darken"}:null,borderWidth:{border:t.variant.value!="link"},borderStyle:{"border-solid":t.variant.value!="link"},width:{"w-full":t.block.value&&t.variant.value!=="link"},ringColor:`focus-visible:ring-${t.color.value}-500/40`,padding:t.variant.value!=="link"?n.value?{"p-1.5":t.size.value==="xs","p-2":t.size.value==="sm","p-2.5":t.size.value==="md","p-3.5":t.size.value==="lg","p-4":t.size.value==="xl"}:{"py-1 px-3":t.size.value==="xs","py-1.5 px-4":t.size.value==="sm","py-2 px-5":t.size.value==="md","py-2.5 px-6":t.size.value==="lg","py-3.5 px-7":t.size.value==="xl"}:"p-0",borderRadius:{"rounded-lg":t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},display:{flex:o.value,"inline-block":!o.value&&t.tag.value!=="button"},alignItems:{"items-center":o.value},justifyContent:{"justify-center":o.value},space:!!l.prepend||!!l.append?{"space-x-1":t.size.value==="xs"||t.size.value==="sm","space-x-1.5":t.size.value==="md","space-x-2":t.size.value==="lg"||t.size.value==="xl"}:""};return Object.values({...a})}),c=e.computed(()=>t.size.value==="xs"?"text-xs":t.size.value==="sm"?"text-base":t.size.value==="xl"?"text-2xl":"text-xl");return{buttonClasses:i,computedIconSize:c}}const ae={name:"LuiButton",inheritAttrs:!1},q=e.defineComponent({...ae,props:{tag:{type:String,default:"button"},variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1}},setup(t){const l=t,{buttonClasses:n,computedIconSize:o}=se(e.toRefs(l)),i=e.useSlots();return(c,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(c.$attrs,{class:[e.unref(n),"lui-button"]}),{default:e.withCtx(()=>[e.unref(i).icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"icon")],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i).prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"default")]),e.unref(i).append?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"append")],2)):e.createCommentVNode("",!0)],64))]),_:3},16,["class"]))}});function re(t){const l=e.computed(()=>{const i={...W(),width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"}};return Object.values({...i})}),n=e.computed(()=>{const i={display:"inline-flex",alignItems:"items-center",justifyContent:"justify-center",width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:{rounded:t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},backgroundColor:"bg-secondary-50 dark:bg-secondary-900 peer-checked:bg-primary-500 dark:peer-disabled:bg-secondary-800 peer-disabled:bg-secondary-200",borderWidth:"border peer-checked:border-0",borderColor:"border-secondary-200 dark:border-secondary-700 peer-checked:border-transparent",ringOffsetColor:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0},transitionProperty:"transition-colors"};return Object.values({...i})}),o=e.computed(()=>Object.values({...{position:"absolute",left:"left-0",right:"right-0",top:"top-0",bottom:"bottom-0",margin:"m-auto",display:"hidden peer-checked:block",textColor:"text-white peer-disabled:text-secondary-300 dark:peer-disabled:text-secondary-600"}}));return{inputClasses:l,spanClasses:n,iconClasses:o}}const ie={class:"inline-block leading-3"},de={class:"relative inline-flex"},ce=["checked","value"],ue=["width","height"],fe=[e.createElementVNode("path",{d:"M9.64286 3.42857L4.63393 8.57143L2.35714 6.23376",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)],me=[e.createElementVNode("path",{d:"M1 1H9",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"},null,-1)],he=[e.createElementVNode("path",{d:"M1 1H11",stroke:"white","stroke-width":"1.75","stroke-linecap":"round"},null,-1)],ge=[e.createElementVNode("path",{d:"M1 1H15",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],be=[e.createElementVNode("path",{d:"M1 1H17",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],xe=[e.createElementVNode("path",{d:"M1 1H21",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],ye={name:"LuiCheckbox",inheritAttrs:!1},ze=e.defineComponent({...ye,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1,validator(t){return[!0,!1,"full"].includes(t)}},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},indeterminate:{type:Boolean,default:!1},value:{type:[String,Boolean],default:!1},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c,iconClasses:a}=re(e.toRefs(n)),{descriptionClasses:d}=A(e.toRefs(n),o),{handleVModel:s,isInputChecked:f}=H(n,o);function u(b){l("update:modelValue",s(b))}const z=e.computed(()=>n.size==="xs"?{checkbox:"12",indeterminate:{width:"10",stroke:"1.5",viewBox:"0 0 10 2"}}:n.size==="sm"?{checkbox:"16",indeterminate:{width:"12",stroke:"1.75",viewBox:"0 0 12 2"}}:n.size==="md"?{checkbox:"20",indeterminate:{width:"16",stroke:"2",viewBox:"0 0 16 2"}}:n.size==="lg"?{checkbox:"24",indeterminate:{width:"18",stroke:"2",viewBox:"0 0 18 2"}}:{checkbox:"28",indeterminate:{width:"22",stroke:"2",viewBox:"0 0 22 2"}});return(b,S)=>(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",de,[e.createElementVNode("input",e.mergeProps({type:"checkbox",checked:e.unref(f),value:t.value,onChange:u,class:e.unref(i)},b.$attrs),null,16,ce),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2),t.indeterminate?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(e.unref(a)),width:e.unref(z).checkbox,height:e.unref(z).checkbox,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fe,10,ue)),t.indeterminate&&t.size==="xs"?(e.openBlock(),e.createElementBlock("svg",{key:1,width:"10",height:"2",viewBox:"0 0 10 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},me,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="sm"?(e.openBlock(),e.createElementBlock("svg",{key:2,width:"12",height:"2",viewBox:"0 0 12 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},he,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="md"?(e.openBlock(),e.createElementBlock("svg",{key:3,width:"16",height:"2",viewBox:"0 0 16 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},ge,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="lg"?(e.openBlock(),e.createElementBlock("svg",{key:4,width:"18",height:"2",viewBox:"0 0 18 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},be,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="xl"?(e.openBlock(),e.createElementBlock("svg",{key:5,width:"22",height:"2",viewBox:"0 0 22 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},xe,2)):e.createCommentVNode("",!0)]),t.description!==null?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(d))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}});function Z(t,l){function n(o){var i;(i=ke(t))!=null&&i.contains(o.target)||l()}e.onMounted(()=>document.addEventListener("click",n)),e.onUnmounted(()=>document.removeEventListener("click",n))}function ke(t){var l;return t==null||t.value==null?null:(l=t.value.$el)!=null?l:t.value}function J(t){var l;return t==null||t.value==null?null:(l=t.value.$el)!=null?l:t.value}function Q(t){const l=e.ref("bottom");function n(){var c;if(J(t)===null){l.value="bottom";return}const o=(c=J(t))==null?void 0:c.getBoundingClientRect(),i=window.innerHeight;if((o==null?void 0:o.bottom)===void 0||(o==null?void 0:o.y)===void 0){l.value="bottom";return}i-(o==null?void 0:o.bottom)>=(o==null?void 0:o.y)?l.value="bottom":l.value="top"}return e.onMounted(()=>window.addEventListener("scroll",n)),e.onUnmounted(()=>window.removeEventListener("scroll",n)),{properPosition:l}}let pe=0;function we(){return++pe}function D(){return we()}const Ce=["width","height"],ve=[e.createElementVNode("path",{d:"M5.99999 6.58599L8.47499 4.11099L9.18199 4.81799L5.99999 7.99999L2.81799 4.81799L3.52499 4.11099L5.99999 6.58599Z",fill:"white"},null,-1)],Be=["aria-activedescendant"],Se={name:"LuiDropdown",inheritAttrs:!1},$e=e.defineComponent({...Se,props:{text:{type:String,default:""},menuPosition:{type:String,default:"bottomLeft"},variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1}},emits:["onTrigger"],setup(t,{emit:l}){const n=t;console.log(n);const o=e.useSlots(),i=e.ref(null),c=e.ref(null),a=e.ref(null),d=e.ref(!1),s=`lui-dropdown-button-${D()}`,f=`lui-dropdown-menu-${D()}`,u=e.reactive({items:[],currentIndex:0,currentId:""});Z(c,()=>I());const{properPosition:z}=Q(i),b={bottomLeft:{classes:"top-full mt-1",oppositeClasses:"bottom-full mb-1 left-0",direction:"bottom"},topLeft:{classes:"bottom-full mb-1 left-0",oppositeClasses:"top-full mt-1",direction:"top"},bottomRight:{classes:"top-full mt-1 right-0",oppositeClasses:"bottom-full mb-1 right-0",direction:"bottom"},topRight:{classes:"bottom-full mb-1 right-0",oppositeClasses:"top-full mt-1 right-0",direction:"top"},leftTop:{classes:"top-0 mr-1 right-full",oppositeClasses:"bottom-0 mr-1 right-full",direction:"bottom"},leftBottom:{classes:"bottom-0 mr-1 right-full",oppositeClasses:"top-0 mr-1 right-full",direction:"top"},rightTop:{classes:"top-0 ml-1 left-full",oppositeClasses:"bottom-0 ml-1 left-full",direction:"bottom"},rightBottom:{classes:"bottom-0 ml-1 left-full",oppositeClasses:"top-0 ml-1 left-full",direction:"top"}},S=e.computed(()=>b[n.menuPosition].direction===z.value?b[n.menuPosition].classes:b[n.menuPosition].oppositeClasses);function I(){d.value=!1,l("onTrigger",d.value)}function k(){d.value=!0,l("onTrigger",d.value)}function B(){d.value=!d.value,l("onTrigger",d.value)}(function(){const C=o.default&&o.default().map(p=>p.type.toString()==="Symbol(Fragment)"?p.children.map(j=>j.props):p.props).flat();C&&C.length&&(u.items=C)})();function v(m){var C;switch(m.code){case"ArrowDown":m.preventDefault(),$(a.value,p=>p+1);break;case"ArrowUp":m.preventDefault(),$(a.value,p=>p-1);break;case"Enter":m.preventDefault(),m.stopPropagation(),((C=a.value)==null?void 0:C.children[u.currentIndex]).click();break;case"Home":m.preventDefault(),$(a.value,p=>p+1,0);break;case"End":m.preventDefault();{const p=u.items.length-1;$(a.value,j=>j-1,p)}break;case"Escape":m.preventDefault(),I();break;case"Tab":m.preventDefault(),m.stopPropagation();break}}function N(m){switch(m.code){case"ArrowDown":case"Enter":case"Space":m.preventDefault(),k(),$(a.value,C=>C+1,0);break}}function $(m,C,p=null){const j=h=>h>=0&&h<=u.items.length-1,K=h=>{var g,w;return((g=u.items[h])==null?void 0:g.disabled)===void 0||((w=u.items[h])==null?void 0:w.disabled)===!1};let _=u.currentIndex;if(p!==null?_=p:_=C(_),!j(_))return;for(;!K(_);)if(_=C(_),!j(_))return;u.currentIndex=_;const r=m==null?void 0:m.children[u.currentIndex];(r==null?void 0:r.id)!==void 0&&(u.currentId=r==null?void 0:r.id,e.nextTick(()=>r==null?void 0:r.focus({preventScroll:!0})))}const P=e.computed(()=>{const m={position:"absolute",zIndex:"z-[999]",backgroundColor:"bg-secondary-50 dark:bg-secondary-900",borderWidth:"border",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:{"rounded-md":n.rounded===!0,"rounded-2xl":n.rounded==="full"},padding:{"p-1.5":n.size==="xs"||n.size==="sm","p-2":n.size==="md","p-2.5":n.size==="lg"||n.size==="xl"},boxShadow:"shadow-lg",bottom:z.value=="top"?"bottom-full":"",top:z.value=="bottom"?"top-full":"",margin:z.value=="bottom"?"mt-2":"mb-2",space:n.size==="xs"||n.size==="sm"?"space-y-1.5":"space-y-2"};return Object.values({...m})}),F=e.computed(()=>({color:n.color,block:n.block,rounded:n.rounded,size:n.size,variant:n.variant,filter:n.filter}));function R(m){return m==="xs"?"12":m==="sm"?"16":m==="xl"?"24":"20"}return(m,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"luiDropdownWrapper",ref:i,class:"relative leading-3 w-fit"},[e.createElementVNode("div",{ref_key:"luiDropdownButton",ref:c,class:"trigger-wrapper"},[e.renderSlot(m.$slots,"trigger",{id:s,type:"button",ariaHaspopup:"true",ariaExpanded:d.value,ariaControls:f,onClick:B,onKeydown:N},()=>[e.createVNode(q,e.mergeProps({id:s,type:"button","aria-haspopup":"true","aria-expanded":d.value,"aria-controls":f,onClick:B,onKeydown:N},e.unref(F)),{append:e.withCtx(()=>[e.renderSlot(m.$slots,"triggerAppend",{},()=>[(e.openBlock(),e.createElementBlock("svg",{viewBox:"0 0 12 12",width:R(t.size),height:R(t.size),fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},ve,8,Ce))])]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text)+" ",1)]),_:3},16,["aria-expanded"])])],512),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{id:f,role:"menu",ref_key:"luiDropdownMenu",ref:a,"aria-labelledby":s,"aria-activedescendant":String(u.currentIndex),tabindex:"0",class:e.normalizeClass([e.unref(S),e.unref(P)]),onKeydown:v},[e.renderSlot(m.$slots,"default")],42,Be),[[e.vShow,d.value]])]),_:3})],512))}}),_e={name:"LuiDropdownItem"},Ve=e.defineComponent({..._e,props:{disabled:{type:Boolean,default:!1},tag:{type:String,default:"button"},color:{type:String,default:"secondary"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1}},setup(t){const l=t,n=e.useSlots(),o=`lui-dropdown-item-${D()}`,i=e.computed(()=>{const d={width:"w-full",display:"flex",justifyContent:"justify-between",alignItems:"items-center",outlineWidth:"outline-none",textColor:`text-${l.color}-600 dark:text-${l.color}-400 disabled:text-secondary-300 disabled:dark:text-secondary-700`,backgroundColor:`hover:bg-${l.color}-600/20 focus:bg-${l.color}-600/20 dark:hover:bg-${l.color}-400/20 dark:focus:bg-${l.color}-400/20 disabled:bg-transparent disabled:dark:bg-transparent`,fontSize:{"text-xs":l.size==="xs","text-sm":l.size==="sm","text-base":l.size==="md","text-lg":l.size==="lg","text-xl":l.size==="xl"},padding:{"py-1 px-1.5":l.size==="xs","py-1.5 px-2":l.size==="sm","py-2 px-2.5":l.size==="md","py-2.5 px-2.5":l.size==="lg","py-3.5 px-3":l.size==="xl"},borderRadius:{"rounded-md":l.rounded===!0,"rounded-full":l.rounded==="full"},space:!!n.prepend||!!n.append?{"space-x-1.5":l.size==="xs","space-x-2":l.size==="sm","space-x-2.5":l.size==="md"||l.size==="lg","space-x-3":l.size==="xl"}:"",cursor:{["cursor-pointer disabled:cursor-not-allowed"]:l.tag==="button"},pointerEvents:l.disabled?"pointer-events-none":""};return Object.values(d)}),c=e.computed(()=>Object.values({display:"flex",alignItems:"items-center",justifyContent:"justify-center"})),a=e.computed(()=>Object.values({display:"flex flex-1",alignItems:"items-center"}));return(d,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps({role:"menuitem",class:"lui-menu-item",id:o},d.$attrs,{class:e.unref(i)}),{default:e.withCtx(()=>[d.$slots.prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(c))},[e.renderSlot(d.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a))},[e.renderSlot(d.$slots,"default")],2),d.$slots.append?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(c))},[e.renderSlot(d.$slots,"append")],2)):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});function Ee(t,l){const n=e.useSlots(),o=e.computed(()=>t.stateIcon.value===!0&&t.state.value!==null||t.clear.value===!0?n.prepend?"twoIcon":"rightIcon":n.prepend?"leftIcon":"noIcon"),i={position:"absolute",translate:"-translate-y-1/2",top:"top-2/4",fontSize:{"text-xs":t.size.value==="xs","text-base":t.size.value==="sm","text-xl":t.size.value==="md"||t.size.value==="lg","text-2xl":t.size.value==="xl"}},c=e.computed(()=>{const f={peer:"peer",width:"w-full",textColor:"text-secondary-600 placeholder:text-secondary-400 disabled:placeholder:text-secondary-300 dark:text-secondary-300 dark:placeholder:text-secondary-600 dark:disabled:text-secondary-700",backgroundColor:"bg-secondary-50 disabled:bg-secondary-100 dark:bg-secondary-900 dark:disabled:secondary-800",outlineStyle:"outline-none",borderWidth:"border",borderStyle:"border-solid",cursor:"disabled:cursor-not-allowed",borderColor:{["border-secondary-200 focus:border-primary-500 disabled:border-secondary-200"]:t.state.value===null,["disabled:border-secondary-200 border-warning-500"]:t.state.value==="warning",["disabled:border-secondary-200 border-danger-500"]:t.state.value===!1,["disabled:border-secondary-200 border-success-500"]:t.state.value===!0},ringWidth:l.disabled!==void 0&&l.disabled===!0?"ring-0":t.state.value===null?"focus:ring-4":"ring-4",ringColor:{"focus:ring-primary-500/40":t.state.value===null,"ring-warning-500/40":t.state.value==="warning","ring-danger-500/40":t.state.value===!1,"ring-success-500/40":t.state.value===!0},borderRadius:{"rounded-lg":t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},padding:o.value==="noIcon"?{"py-1 px-1.5":t.size.value==="xs","py-1.5 px-2":t.size.value==="sm","py-2 px-2.5":t.size.value==="md","py-2.5 px-2.5":t.size.value==="lg","py-3.5 px-3":t.size.value==="xl"}:o.value==="rightIcon"?{"py-1 pl-1.5 pr-6":t.size.value==="xs","py-1.5 pl-2 pr-8":t.size.value==="sm","py-2 pl-2.5 pr-10":t.size.value==="md","py-2.5 pl-2.5 pr-10":t.size.value==="lg","py-3.5 pl-3 pr-12":t.size.value==="xl"}:o.value==="twoIcon"?{"py-1 px-6":t.size.value==="xs","py-1.5 px-8":t.size.value==="sm","py-2 px-10":t.size.value==="md","py-2.5 px-10":t.size.value==="lg","py-3.5 px-12":t.size.value==="xl"}:{"py-1 pr-1.5 pl-6":t.size.value==="xs","py-1.5 pr-2 pl-8":t.size.value==="sm","py-2 pr-2.5 pl-10":t.size.value==="md","py-2.5 pr-2.5 pl-10":t.size.value==="lg","py-3.5 pr-3 pl-12":t.size.value==="xl"}};return Object.values({...f})}),a=e.computed(()=>{const f={...i,left:{"left-2":t.size.value==="xs","left-2.5":t.size.value==="sm","left-3":t.size.value==="md"||t.size.value==="lg","left-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled.value?"text-secondary-300 dark:text-secondary-700":"text-secondary-400 peer-focus:text-secondary-600 dark:text-secondary-600 dark:peer-focus:text-secondary-300"};return Object.values({...f})}),d=e.computed(()=>{const f={...i,right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-300":{"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...f})}),s=e.computed(()=>{const f={...i,right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},display:"flex",outlineStyle:"outline-none",textColor:"text-secondary-400 peer-focus:text-secondary-600 dark:text-secondary-600 dark:peer-focus:text-secondary-300",ringWidth:"focus-visible:ring-2",ringColor:"focus-visible:ring-secondary-200"};return Object.values({...f})});return{inputClasses:c,prependClasses:a,stateIconClasses:d,closeIconClasses:s}}const Ie={class:"relative"},Ne=["value"],Oe=["width","height"],Le=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"},null,-1)],je=["width","height"],Me=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455zM4 18.385L5.763 17H20V5H4v13.385zM11 13h2v2h-2v-2zm0-6h2v5h-2V7z"},null,-1)],De=["width","height"],Ae=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)],Pe=["width","height"],Re=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"},null,-1)],We=["width","height"],He=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm4.891-11.477l-8.368 8.368a6.04 6.04 0 0 1-1.414-1.414l8.368-8.368a6.04 6.04 0 0 1 1.414 1.414z"},null,-1)],Te={name:"LuiInput",inheritAttrs:!1},X=e.defineComponent({...Te,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},block:{type:Boolean,default:!1},clear:{type:Boolean,default:!1},description:{type:[String,null],default:null},modelValue:{type:[String,Number],default:""}},emits:["update:modelValue"],setup(t,{expose:l,emit:n}){const o=t,i=e.useAttrs(),c=e.useSlots(),a=e.ref(null),{inputClasses:d,prependClasses:s,stateIconClasses:f,closeIconClasses:u}=Ee(e.toRefs(o),i),{descriptionClasses:z}=A(e.toRefs(o),i);function b(){a.value.value="",a.value.focus()}l({focus:()=>a.value.focus()});function I(v){n("update:modelValue",v.target.value)}const k=e.computed(()=>o.size==="xs"?"12":o.size==="sm"?"16":o.size==="xl"?"24":"20"),B=e.computed(()=>i.disabled!==void 0&&i.disabled===!0);return(v,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-block leading-3",t.block?"w-full":"w-48"])},[e.createElementVNode("div",Ie,[e.createElementVNode("input",e.mergeProps({ref_key:"LuiInputRef",ref:a,value:t.modelValue,class:e.unref(d)},v.$attrs,{onInput:N[0]||(N[0]=$=>I($))}),null,16,Ne),e.unref(c).prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(s),"leading-none"])},[e.renderSlot(v.$slots,"prepend")],2)):e.createCommentVNode("",!0),t.clear&&!e.unref(i).disabled?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:b,class:e.normalizeClass(e.unref(u))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Le,8,Oe))],2)):e.createCommentVNode("",!0),t.stateIcon&&t.state!==null&&!e.unref(B)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(f))},[t.state==="warning"?(e.openBlock(),e.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Me,8,je)):e.createCommentVNode("",!0),t.state===!1?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Ae,8,De)):e.createCommentVNode("",!0),t.state===!0?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Re,8,Pe)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,[t.stateIcon&&e.unref(B)?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(e.unref(f)),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},He,10,We)):e.createCommentVNode("",!0)])]),t.description!==null?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(z))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)],2))}});function Fe(t){const l=e.computed(()=>{const o={...W(),width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:"rounded-full"};return Object.values({...o})}),n=e.computed(()=>{const o={lineHeight:"leading-none",width:{"w-4 before:w-2":t.size.value==="xs","w-5 before:w-2.5":t.size.value==="sm","w-6 before:w-3":t.size.value==="md","w-7 before:w-3.5":t.size.value==="lg","w-8 before:w-4":t.size.value==="xl"},height:{"h-4 before:h-2":t.size.value==="xs","h-5 before:h-2.5":t.size.value==="sm","h-6 before:h-3":t.size.value==="md","h-7 before:h-3.5":t.size.value==="lg","h-8 before:h-4":t.size.value==="xl"},borderWidth:"border peer-checked:border-0",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:"rounded-full before:rounded-full",backgroundColor:"bg-secondary-50 dark:bg-secondary-900 peer-checked:bg-primary-500 before:bg-transparent peer-checked:before:bg-white peer-disabled:before:bg-seconday-200 dark:peer-disabled:bg-secondary-800 dark:peer-disabled:bg-secondary-800 peer-disabled:bg-secondary-200",ringWidth:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0},display:"inline-flex",alignItems:"items-center",justifyContent:"justify-center",flexShrink:"shrink-0",transitionProperty:"transition-colors before:transition-colors"};return Object.values({...o})});return{inputClasses:l,spanClasses:n}}const Ke={class:"inline-block leading-3"},Ue={class:"relative"},Ge=["checked","value"],qe={name:"LuiRadio",inheritAttrs:!1},Ze=e.defineComponent({...qe,props:{size:{type:String,default:"md"},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},value:{type:String,default:""},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c}=Fe(e.toRefs(n)),{descriptionClasses:a}=A(e.toRefs(n),o),{handleVModel:d,isInputChecked:s}=H(n,o);function f(u){l("update:modelValue",d(u))}return(u,z)=>(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Ue,[e.createElementVNode("input",e.mergeProps({type:"checkbox",class:e.unref(i),checked:e.unref(s),value:t.value,onChange:f},u.$attrs),null,16,Ge),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(a))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}}),Y=Symbol("ContextKey"),Je=["aria-selected"],Qe={key:0},Xe={key:1,class:"ml-auto"},Ye={name:"LuiOption",inheritAttrs:!1},T=e.defineComponent({...Ye,props:{selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},value:{type:[String,Number],default:""},text:{type:String,default:""}},setup(t){const l=t,n=e.inject(Y),o=e.useSlots(),i=`lui-option-${D()}`;e.nextTick(()=>{(n==null?void 0:n.selectedOption.value)===void 0&&l.selected&&!l.disabled&&(n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:l.selected}))}),e.watch(()=>l.selected,s=>{n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:s})});function c(s){s.preventDefault(),n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:l.selected}),e.nextTick(()=>n==null?void 0:n.focusButton())}const a=e.computed(()=>(n==null?void 0:n.selectedOption.value)===void 0?l.selected:typeof(n==null?void 0:n.selectedOption.value)=="string"?l.text===(n==null?void 0:n.selectedOption.value):l.text===(n==null?void 0:n.selectedOption.value.text)),d=e.computed(()=>{const s={backgroundColor:l.disabled?"":a.value===!0?"bg-primary-500 hover:text-primary-600 focus:text-primary-600":"hover:bg-primary-500/20 focus:bg-primary-500/20",padding:{"px-1.5 py-1":l.size==="xs","px-2 py-1.5":l.size==="sm","px-2 py-2.5":l.size==="md","p-2.5":l.size==="lg","px-3 py-3.5":l.size==="xl"},textColor:l.disabled?"text-secondary-300 dark:text-secondary-700":a.value===!0?"text-white":"text-secondary-600 dark:text-secondary-300 hover:text-primary-500 focus:text-primary-500",outlineWidth:"outline-none",borderRadius:{"rounded-md":l.rounded===!0,"rounded-2xl":l.rounded==="full"},display:o.prepend||o.append?"flex":"",alignItems:o.prepend||o.append?"items-center":"",cursor:l.disabled?"cursor-not-allowed":"",pointerEvents:l.disabled?"pointer-events-none":""};return Object.values({...s})});return(s,f)=>(e.openBlock(),e.createElementBlock("li",e.mergeProps({role:"option",tabindex:"-1"},s.$attrs,{id:i,"aria-selected":e.unref(a),class:e.unref(d),onClick:c}),[s.$slots.prepend?(e.openBlock(),e.createElementBlock("span",Qe,[e.renderSlot(s.$slots,"prepend")])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(s.$slots.prepend?"ml-1":"")},e.toDisplayString(t.text),3),s.$slots.append?(e.openBlock(),e.createElementBlock("span",Xe,[e.renderSlot(s.$slots,"append")])):e.createCommentVNode("",!0)],16,Je))}}),et=["aria-expanded"],tt=["aria-activedescendant"],lt={name:"LuiSelect",inheritAttrs:!1},nt=e.defineComponent({...lt,props:{rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},size:{type:String,default:"md"},description:{type:[String,null],default:null},modelValue:{type:[Object,String,void 0],default:void 0}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=e.useSlots(),i=e.useAttrs(),c=e.ref(null),a=e.ref(null),d=e.ref(null),s=e.ref(!1),f=e.ref(void 0),u=e.reactive({items:[],currentIndex:0,currentId:""}),z=`lui-listbox-button-${D()}`,b=`lui-listbox-wrapper-${D()}`,S=["LuiOption"],I={missing:{modelValue:"Missing field for modelValue, label and value fields are required when modelValue is object",options:"Options missing: should use options prop or LuiOption component as slot"}},{properPosition:k}=Q(d);Z(d,()=>$()),e.nextTick(()=>{R(),F()}),e.provide(Y,{selectedOption:f,updateSelectedOption:v,focusButton:N}),e.watch(()=>n.modelValue,r=>v(r));function B(r,h,g=null){const w=M=>M>=0&&M<=u.items.length-1,U=M=>{const E=u.items[M];return typeof E!="string"&&((E==null?void 0:E.disabled)===void 0||(E==null?void 0:E.disabled)===!1)};let V=u.currentIndex;if(g!==null?V=g:V=h(V),!w(V))return;for(;!U(V);)if(V=h(V),!w(V))return;u.currentIndex=V;const O=r==null?void 0:r.children[u.currentIndex];u.currentId=O==null?void 0:O.id,e.nextTick(()=>O==null?void 0:O.focus({preventScroll:!0}))}function v(r){f.value=r,l("update:modelValue",r),l("change",r)}function N(){var r;(r=c.value)==null||r.focus()}function $(){console.log("close calisti..."),s.value=!1}function P(){s.value=!s.value,console.log("aaaa",s.value)}function F(){const r=o.default&&o.default().map(g=>g.type.toString()==="Symbol(Fragment)"?g.children.map(w=>w.props):g.props).flat(),h=[...n.options].concat(r||[]);u.items=h}function R(){var O,M,E;const r=n.modelValue!==void 0&&typeof n.modelValue!="string"&&(((O=n.modelValue)==null?void 0:O.text)===void 0||((M=n.modelValue)==null?void 0:M.value)===void 0),h=n.options.length>0,g=()=>n.options.some(x=>typeof x!="string"&&x.selected);function w(x){n.placeholder===""?v(x):v(n.placeholder)}const U=()=>o.default&&o.default().some(x=>x.type.toString()=="Symbol(Fragment)"?x.children.some(L=>L.props.selected!==void 0&&L.props.selected===!0):x.props.selected!==void 0&&x.props.selected===!0),V=()=>o.default&&o.default().some(x=>x.type.toString()=="Symbol(Fragment)"?x.children.some(L=>L.type.name!==void 0&&S.includes(L.type.name)):x.type.name!==void 0&&S.includes(x.type.name));if(r)throw new Error(I.missing.modelValue);if(n.modelValue!==void 0){v(n.modelValue);return}if(h&&!g()){w(n.options[0]);return}if(!h&&!V())throw new Error(`Options missing: should use options prop or one of the valid slots: ${S}`);if(!h&&!U()){const x=o.default&&o.default()[0];let L;o.default&&(x==null?void 0:x.type.toString())==="Symbol(Fragment)"?L=(E=x==null?void 0:x.children[0])==null?void 0:E.props:L=x==null?void 0:x.props,w(L)}}function m(r){switch(r.code){case"ArrowDown":case"ArrowUp":case"Enter":case"Space":{r.preventDefault(),s.value||P();let h=u.items.findIndex(g=>{var w;return typeof g=="string"?g===f.value:(g==null?void 0:g.text)===((w=f.value)==null?void 0:w.text)});h===-1?B(a.value,g=>g+1,0):B(a.value,g=>g+1,h)}break}}function C(r){switch(r.code){case"ArrowDown":r.preventDefault(),B(a.value,h=>h+1);break;case"ArrowUp":r.preventDefault(),B(a.value,h=>h-1);break;case"Enter":r.preventDefault(),r.stopPropagation(),v(u.items[u.currentIndex]),$(),e.nextTick(()=>N());break;case"Home":r.preventDefault(),B(a.value,h=>h+1,0);break;case"End":r.preventDefault();{const h=u.items.length-1;B(a.value,g=>g-1,h)}break;case"Escape":r.preventDefault(),$(),e.nextTick(()=>N());break;case"Tab":r.preventDefault(),r.stopPropagation();break}}const p=e.computed(()=>{const r={position:"absolute",zIndex:"z-[999]",backgroundColor:"bg-secondary-50 dark:bg-secondary-900",borderWidth:"border",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:{"rounded-md":n.rounded===!0,"rounded-2xl":n.rounded==="full"},padding:{"p-1.5":n.size==="xs"||n.size==="sm","p-2":n.size==="md","p-2.5":n.size==="lg"||n.size==="xl"},boxShadow:"shadow-lg",bottom:k.value=="top"?"bottom-full":"",top:k.value=="bottom"?"top-full":"",margin:k.value=="bottom"?"mt-2":"mb-2",space:n.size==="xs"||n.size==="sm"?"space-y-1.5":"space-y-2"};return Object.values({...r})}),j=e.computed(()=>({rounded:n.rounded,block:n.block,state:n.state,stateIcon:n.stateIcon,placeholder:n.placeholder,size:n.size,description:n.description,...i})),K=r=>typeof r=="string"?{text:r}:{...r},_=e.computed(()=>{var r;return typeof f.value=="string"?f.value:(r=f.value)==null?void 0:r.text});return(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:"relative",role:"combobox",ref_key:"selectWrapperRef",ref:d,"aria-haspopup":"listbox","aria-expanded":s.value,"aria-controls":b,tabindex:"-1",onClick:P},[e.createVNode(X,e.mergeProps({ref_key:"selectRef",ref:c,id:z,value:e.unref(_),readonly:""},e.unref(j),{onKeydown:h[0]||(h[0]=g=>m(g))}),null,16,["value"]),e.withDirectives(e.createElementVNode("ul",{ref_key:"optionsRef",ref:a,id:b,"aria-orientation":"vertical","aria-labelledby":z,role:"listbox",tabindex:"0",class:e.normalizeClass(e.unref(p)),"aria-activedescendant":u.currentId,onKeydown:h[1]||(h[1]=g=>C(g))},[t.placeholder!==""?(e.openBlock(),e.createBlock(T,{key:0,disabled:"",text:t.placeholder},null,8,["text"])):e.createCommentVNode("",!0),t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,(g,w)=>(e.openBlock(),e.createBlock(T,e.mergeProps({key:w},K(g)),null,16))),128)):e.createCommentVNode("",!0),r.$slots.default?e.renderSlot(r.$slots,"default",{key:2}):e.createCommentVNode("",!0)],42,tt),[[e.vShow,s.value]])],8,et))}});function ot(t){const l=e.computed(()=>{const o={...W(),width:{"w-8":t.size.value==="xs","w-10":t.size.value==="sm","w-12":t.size.value==="md","w-14":t.size.value==="lg","w-16":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:{"rounded-full":t.rounded.value==="full",rounded:t.rounded.value===!0}};return Object.values({...o})}),n=e.computed(()=>{const o={lineHeight:"leading-none",width:{"w-8 before:w-3":t.size.value==="xs","w-10 before:w-4":t.size.value==="sm","w-12 before:w-5":t.size.value==="md","w-14 before:w-6":t.size.value==="lg","w-16 before:w-7":t.size.value==="xl"},height:{"h-4 before:h-3":t.size.value==="xs","h-5 before:h-4":t.size.value==="sm","h-6 before:h-5":t.size.value==="md","h-7 before:h-6":t.size.value==="lg","h-8 before:h-7":t.size.value==="xl"},backgroundColor:"bg-secondary-500 dark:bg-secondary-800 peer-disabled:bg-secondary-100 peer-checked:peer-disabled:bg-success-100 peer-checked:bg-success-500 before:bg-white",borderRadius:{"rounded-full before:rounded-full":t.rounded.value==="full","rounded before:rounded-sm":t.rounded.value===!0},display:"inline-flex",position:"relative before:absolute",top:"before:top-0",bottom:"before:bottom-0",translate:{"before:translate-x-0.5 peer-checked:before:translate-x-[1.125rem]":t.size.value==="xs","before:translate-x-0.5 peer-checked:before:translate-x-[1.375rem]":t.size.value==="sm","before:translate-x-0.5 peer-checked:before:translate-x-[1.625rem]":t.size.value==="md","before:translate-x-0.5 peer-checked:before:translate-x-[1.875rem]":t.size.value==="lg","before:translate-x-0.5 peer-checked:before:translate-x-[2.125rem]":t.size.value==="xl"},margin:"before:my-auto",transitionProperty:"before:transition transition",ringWidth:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0}};return Object.values({...o})});return{inputClasses:l,spanClasses:n}}const st={class:"inline-block leading-3"},at={class:"relative"},rt=["checked","value"],it={name:"LuiSwitch",inheritAttrs:!1},dt=e.defineComponent({...it,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:"full"},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},value:{type:String,default:""},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c}=ot(e.toRefs(n)),{descriptionClasses:a}=A(e.toRefs(n),o),{handleVModel:d,isInputChecked:s}=H(n,o);function f(u){l("update:modelValue",d(u))}return(u,z)=>(e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",at,[e.createElementVNode("input",e.mergeProps({type:"checkbox",class:e.unref(i),checked:e.unref(s),value:t.value,onChange:f},u.$attrs),null,16,rt),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(a))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}});function ct(t,l){const n=e.useSlots(),o=e.computed(()=>!!(t.stateIcon.value===!0&&t.state.value!==null||n.prepend)),i={position:"absolute",fontSize:{"text-xs":t.size.value==="xs","text-base":t.size.value==="sm","text-xl":t.size.value==="md"||t.size.value==="lg","text-2xl":t.size.value==="xl"}},c=e.computed(()=>{const d={peer:"peer",width:"w-full",textColor:"text-secondary-600 placeholder:text-secondary-400 disabled:placeholder:text-secondary-300 dark:text-secondary-300 dark:placeholder:text-secondary-600 dark:disabled:text-secondary-700",backgroundColor:"bg-secondary-50 disabled:bg-secondary-100 dark:bg-secondary-900 dark:disabled:secondary-800",outlineStyle:"outline-none",borderWidth:"border",borderStyle:"border-solid",cursor:"disabled:cursor-not-allowed",borderColor:{["border-secondary-200 focus:border-primary-500 disabled:border-secondary-200"]:t.state.value===null,["disabled:border-secondary-200 border-warning-500"]:t.state.value==="warning",["disabled:border-secondary-200 border-danger-500"]:t.state.value===!1,["disabled:border-secondary-200 border-success-500"]:t.state.value===!0},ringWidth:l.disabled!==void 0&&l.disabled===!0?"ring-0":t.state.value===null?"focus:ring-4":"ring-4",ringColor:{"focus:ring-primary-500/40":t.state.value===null,"ring-warning-500/40":t.state.value==="warning","ring-danger-500/40":t.state.value===!1,"ring-success-500/40":t.state.value===!0},borderRadius:{"rounded-md":t.rounded.value===!0},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},padding:o.value?{"py-1 pl-1.5 pr-6":t.size.value==="xs","py-1.5 pl-2 pr-8":t.size.value==="sm","py-2 pl-2.5 pr-10":t.size.value==="md","py-2.5 pl-2.5 pr-10":t.size.value==="lg","py-3.5 pl-3 pr-12":t.size.value==="xl"}:{"py-1 px-1.5":t.size.value==="xs","py-1.5 px-2":t.size.value==="sm","py-2 px-2.5":t.size.value==="md","p-2.5":t.size.value==="lg","py-3.5 px-3":t.size.value==="xl"},resize:{resize:t.resize.value==!0,"resize-none":t.resize.value==!1,"resize-x":t.resize.value=="x","resize-y":t.resize.value=="y"}};return Object.values({...d})}),a=e.computed(()=>{const d={...i,top:t.size.value==="xl"||t.size.value==="lg"?"top-4":"top-3",right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-300":{"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...d})});return{textareaClasses:c,stateIconClasses:a}}const ut={class:"relative"},ft=["width","height"],mt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455zM4 18.385L5.763 17H20V5H4v13.385zM11 13h2v2h-2v-2zm0-6h2v5h-2V7z"},null,-1)],ht=["width","height"],gt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)],bt=["width","height"],xt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"},null,-1)],yt=["width","height"],zt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm4.891-11.477l-8.368 8.368a6.04 6.04 0 0 1-1.414-1.414l8.368-8.368a6.04 6.04 0 0 1 1.414 1.414z"},null,-1)],kt={name:"LuiTextarea",inheritAttrs:!1},pt=e.defineComponent({...kt,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:"full"},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},description:{type:[String,null],default:null},resize:{type:[Boolean,String],default:!0},block:{type:Boolean,default:!1},modelValue:{type:[String],default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{descriptionClasses:i}=A(e.toRefs(n),o),{textareaClasses:c,stateIconClasses:a}=ct(e.toRefs(n),o);function d(u){l("update:modelValue",u.target.value)}const s=e.computed(()=>n.size==="xs"?"12":n.size==="sm"?"16":n.size==="xl"?"24":"20"),f=e.computed(()=>o.disabled!==void 0&&o.disabled===!0);return(u,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-block leading-3",t.block?"w-full":"w-48"])},[e.createElementVNode("div",ut,[e.createElementVNode("textarea",e.mergeProps(u.$attrs,{class:e.unref(c),onInput:z[0]||(z[0]=b=>d(b))}),null,16),t.stateIcon&&t.state!==null&&!e.unref(f)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a))},[t.state==="warning"?(e.openBlock(),e.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},mt,8,ft)):e.createCommentVNode("",!0),t.state===!1?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},gt,8,ht)):e.createCommentVNode("",!0),t.state===!0?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},xt,8,bt)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),t.stateIcon&&e.unref(f)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},zt,8,yt))],2)):e.createCommentVNode("",!0)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass([e.unref(i),""])},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)],2))}}),wt=require("./src/plugin/lui-ui");y.LuiAvatar=le,y.LuiBadge=oe,y.LuiButton=q,y.LuiCheckbox=ze,y.LuiInput=X,y.LuiMenuDropdown=$e,y.LuiMenuItem=Ve,y.LuiOption=T,y.LuiRadio=Ze,y.LuiSelect=nt,y.LuiSwitch=dt,y.LuiTextarea=pt,y.luiPlugin=wt,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.LuiVue={},y.Vue))})(this,function(y,e){"use strict";function G(t){const l=e.computed(()=>({backgroundColor:t.variant.value==="solid"?{[`bg-${t.color.value}-500`]:t.filter.value==="none",[`bg-${t.color.value}-100`]:t.filter.value==="lighten",[`bg-${t.color.value}-800`]:t.filter.value==="darken"}:null})),n=e.computed(()=>({textColor:t.variant.value==="solid"?{["text-white"]:t.filter.value==="none",[`text-${t.color.value}-500`]:t.filter.value==="lighten",[`text-${t.color.value}-100`]:t.filter.value==="darken"}:{[`text-${t.color.value}-500`]:t.filter.value==="none",[`text-${t.color.value}-100`]:t.filter.value==="lighten",[`text-${t.color.value}-800`]:t.filter.value==="darken"}})),o=e.computed(()=>({borderColor:t.variant.value==="outline"?{[`border-${t.color.value}-500`]:t.filter.value==="none",[`border-${t.color.value}-100`]:t.filter.value==="lighten",[`border-${t.color.value}-800`]:t.filter.value==="darken"}:t.border.value?{["border-white"]:t.filter.value==="none",[`border-${t.color.value}-500`]:t.filter.value==="lighten",[`border-${t.color.value}-100`]:t.filter.value==="darken"}:"border-transparent"}));return{backgroundColorClasses:l.value,textColorClasses:n.value,borderColorClasses:o.value}}function W(){return{position:"absolute",overflow:"overflow-hidden",outlineStyle:"outline-none",cursor:"disabled:cursor-not-allowed",borderWidth:"border-0",opacity:"opacity-0",zIndex:"z-10",peer:"peer"}}function A(t,l){return{descriptionClasses:e.computed(()=>{const o={fontSize:"text-sm",lineHeight:"leading-normal",margin:"mt-1",textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-200 dark:text-secondary-700":{"text-secondary-600 dark:text-secondary-400":t.state.value===null,"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...o})})}}function H(t,l){const n=e.toRef(t,"modelValue"),o=function(c){if(typeof t.modelValue=="boolean"||t.modelValue===void 0)return c.target.checked;if(c.target.checked)n.value.push(c.target.value);else{const a=n.value.indexOf(c.target.value);n.value.splice(a,1)}return n.value},i=e.computed(()=>t.modelValue===void 0?l.checked!==void 0?l.checked:!1:typeof t.modelValue=="boolean"?t.modelValue:n.value.includes(t.value));return{handleVModel:o,isInputChecked:i}}const ee=["src","alt"],te={name:"LuiAvatar"},le=e.defineComponent({...te,props:{variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},border:{type:Boolean,default:!1},rounded:{type:[Boolean,String],default:!1},text:{type:String,default:""},src:{type:String,default:""},alt:{type:String,default:""}},setup(t){const l=t,{backgroundColorClasses:n,textColorClasses:o,borderColorClasses:i}=G(e.toRefs(l)),c=e.computed(()=>{const s={borderWidth:"border",borderStyle:"border-solid",display:"block",width:"w-full",height:"h-full",objectFit:"object-cover",borderRadius:{"rounded-lg":l.rounded===!0,"rounded-full":l.rounded==="full"},borderColor:i.borderColor};return Object.values(s)}),a=e.computed(()=>Object.values({display:"flex",justifyContent:"justify-center",alignItems:"items-center"})),d=e.computed(()=>{const s={display:"flex",borderRadius:{"rounded-lg":l.rounded===!0,"rounded-full":l.rounded==="full"},borderWidth:"border",borderStyle:"border-solid",justifyContent:"justify-center",alignItems:"items-center",width:{"w-6":l.size==="xs","w-8":l.size==="sm","w-12":l.size==="md","w-16":l.size==="lg","w-20":l.size==="xl"},height:{"h-6":l.size==="xs","h-8":l.size==="sm","h-12":l.size==="md","h-16":l.size==="lg","h-20":l.size==="xl"},fontSize:{"text-sm":l.size==="xs"||l.size==="sm","text-xl":l.size==="md","text-3xl":l.size==="lg"||l.size==="xl"},backgroundColor:l.src.length===0?n.backgroundColor:null,textColor:o.textColor,borderColor:l.src.length===0?i.borderColor:"border-transparent"};return Object.values(s)});return(s,f)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["lui-avatar",e.unref(d)])},[t.src.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.src,alt:t.alt,class:e.normalizeClass(e.unref(c))},null,10,ee)):e.createCommentVNode("",!0),s.$slots.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a))},[e.renderSlot(s.$slots,"icon")],2)):e.createCommentVNode("",!0),t.text.length>0?(e.openBlock(),e.createElementBlock("span",{key:2,ref:"avatarContent"},e.toDisplayString(t.text),513)):e.createCommentVNode("",!0)],2))}}),ne={name:"LuiBadge"},oe=e.defineComponent({...ne,props:{variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},border:{type:Boolean,default:!1},text:{type:String,default:""},position:{type:String,default:"bottom-right"}},setup(t){const l=t,n=e.useSlots(),{backgroundColorClasses:o,textColorClasses:i,borderColorClasses:c}=G(e.toRefs(l)),a=e.ref(null),d=e.ref(null),s=e.ref(!1);e.watchEffect(()=>{var I,k;const b=(I=a.value)==null?void 0:I.scrollWidth,S=(k=d.value)==null?void 0:k.scrollWidth;b&&S&&(S>b?s.value=!0:s.value=!1)});const f=e.computed(()=>Object.values({position:"relative",display:"inline-block"})),u=e.computed(()=>Object.values({display:"flex",justifyContent:"justify-center",alignItems:"items-center"})),z=e.computed(()=>{const b={display:s.value?"inline-block":"flex",position:{absolute:!!n.default},top:n.default?{"top-0":l.position==="top-left"||l.position==="top-right"}:null,bottom:n.default?{"bottom-0":l.position==="bottom-left"||l.position==="bottom-right"}:null,left:n.default?{"left-0":l.position==="bottom-left"||l.position==="top-left"}:null,right:n.default?{"right-0":l.position==="bottom-right"||l.position==="top-right"}:null,translate:n.default?{"-translate-y-1/2 -translate-x-1/2":l.position==="top-left","-translate-y-1/2 translate-x-1/2":l.position==="top-right","translate-y-1/2 -translate-x-1/2":l.position==="bottom-left","translate-y-1/2 translate-x-1/2":l.position==="bottom-right"}:null,borderRadius:"rounded-full",borderWidth:"border",borderStyle:"border-solid",justifyContent:{["justify-center"]:!s.value},alignItems:{["items-center"]:!s.value},padding:l.text.length>0||!!n.icon?{"px-0.5":l.size==="xs","px-1":l.size==="sm","px-1.5":l.size==="md","px-2":l.size==="lg","px-2.5":l.size==="xl"}:null,width:l.text.length>0||!!n.icon?s.value?null:{"w-3":l.size==="xs","w-4":l.size==="sm","w-5":l.size==="md","w-6":l.size==="lg","w-7":l.size==="xl"}:{"w-1.5":l.size==="xs","w-2":l.size==="sm","w-2.5":l.size==="md","w-3":l.size==="lg","w-3.5":l.size==="xl"},height:l.text.length>0||!!n.icon?s.value?null:{"h-3":l.size==="xs","h-4":l.size==="sm","h-5":l.size==="md","h-6":l.size==="lg","h-7":l.size==="xl"}:{"h-1.5":l.size==="xs","h-2":l.size==="sm","h-2.5":l.size==="md","h-3":l.size==="lg","h-3.5":l.size==="xl"},fontSize:{"text-xs":l.size==="xs"||l.size==="sm","text-sm":l.size==="md","text-base":l.size==="lg"||l.size==="xl"},backgroundColor:o.backgroundColor,textColor:i.textColor,borderColor:c.borderColor};return Object.values(b)});return(b,S)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["lui-badge",e.unref(f)])},[e.renderSlot(b.$slots,"default"),e.createElementVNode("div",{ref_key:"badgeWrapper",ref:a,class:e.normalizeClass(e.unref(z))},[b.$slots.icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(u))},[e.renderSlot(b.$slots,"icon")],2)):e.createCommentVNode("",!0),l.text.length>0?(e.openBlock(),e.createElementBlock("span",{key:1,ref_key:"badgeContent",ref:d},e.toDisplayString(t.text),513)):e.createCommentVNode("",!0)],2)],2))}});function se(t){const l=e.useSlots(),n=e.computed(()=>!!l.icon),o=e.computed(()=>!!l.icon||!!l.prepend||!!l.append),i=e.computed(()=>{const a={outlineStyle:"outline-none",ringWidth:"focus-visible:ring-4",transitionProperty:"transition-colors transition-transform",translate:"active:translate-y-0.5 disabled:translate-y-0",cursor:{["cursor-pointer disabled:cursor-not-allowed"]:t.tag.value==="button"},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},backgroundColor:t.variant.value==="solid"?{[`bg-${t.color.value}-500 hover:bg-${t.color.value}-400 disabled:bg-secondary-500`]:t.filter.value==="none",[`bg-${t.color.value}-100 hover:bg-${t.color.value}-50 disabled:bg-secondary-100`]:t.filter.value==="lighten",[`bg-${t.color.value}-800 hover:bg-${t.color.value}-700 disabled:bg-secondary-800`]:t.filter.value==="darken"}:null,textColor:t.variant.value==="solid"?{["text-white disabled:text-secondary-300"]:t.filter.value==="none",[`text-${t.color.value}-500 disabled:text-secondary-300`]:t.filter.value==="lighten",[`text-${t.color.value}-100 disabled:text-secondary-300`]:t.filter.value==="darken"}:{[`text-${t.color.value}-500 hover:text-${t.color.value}-400 disabled:text-secondary-500`]:t.filter.value==="none",[`text-${t.color.value}-100 hover:text-${t.color.value}-50 disabled:text-secondary-100`]:t.filter.value==="lighten",[`text-${t.color.value}-800 hover:text-${t.color.value}-700 disabled:text-secondary-800`]:t.filter.value==="darken"},borderColor:t.variant.value==="text"?"border-transparent":t.variant.value==="solid"||t.variant.value==="outline"?{[`border-${t.color.value}-500 hover:border-${t.color.value}-400 disabled:border-secondary-500`]:t.filter.value==="none",[`border-${t.color.value}-100 hover:border-${t.color.value}-50 disabled:border-secondary-100`]:t.filter.value==="lighten",[`border-${t.color.value}-800 hover:border-${t.color.value}-700 disabled:border-secondary-800`]:t.filter.value==="darken"}:null,borderWidth:{border:t.variant.value!="link"},borderStyle:{"border-solid":t.variant.value!="link"},width:{"w-full":t.block.value&&t.variant.value!=="link"},ringColor:`focus-visible:ring-${t.color.value}-500/40`,padding:t.variant.value!=="link"?n.value?{"p-1.5":t.size.value==="xs","p-2":t.size.value==="sm","p-2.5":t.size.value==="md","p-3.5":t.size.value==="lg","p-4":t.size.value==="xl"}:{"py-1 px-3":t.size.value==="xs","py-1.5 px-4":t.size.value==="sm","py-2 px-5":t.size.value==="md","py-2.5 px-6":t.size.value==="lg","py-3.5 px-7":t.size.value==="xl"}:"p-0",borderRadius:{"rounded-lg":t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},display:{flex:o.value,"inline-block":!o.value&&t.tag.value!=="button"},alignItems:{"items-center":o.value},justifyContent:{"justify-center":o.value},space:!!l.prepend||!!l.append?{"space-x-1":t.size.value==="xs"||t.size.value==="sm","space-x-1.5":t.size.value==="md","space-x-2":t.size.value==="lg"||t.size.value==="xl"}:""};return Object.values({...a})}),c=e.computed(()=>t.size.value==="xs"?"text-xs":t.size.value==="sm"?"text-base":t.size.value==="xl"?"text-2xl":"text-xl");return{buttonClasses:i,computedIconSize:c}}const ae={name:"LuiButton",inheritAttrs:!1},q=e.defineComponent({...ae,props:{tag:{type:String,default:"button"},variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1}},setup(t){const l=t,{buttonClasses:n,computedIconSize:o}=se(e.toRefs(l)),i=e.useSlots();return(c,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps(c.$attrs,{class:[e.unref(n),"lui-button"]}),{default:e.withCtx(()=>[e.unref(i).icon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"icon")],2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.unref(i).prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,[e.renderSlot(c.$slots,"default")]),e.unref(i).append?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass([e.unref(o),"leading-none flex items-center"])},[e.renderSlot(c.$slots,"append")],2)):e.createCommentVNode("",!0)],64))]),_:3},16,["class"]))}});function re(t){const l=e.computed(()=>{const i={...W(),width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"}};return Object.values({...i})}),n=e.computed(()=>{const i={display:"inline-flex",alignItems:"items-center",justifyContent:"justify-center",width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:{rounded:t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},backgroundColor:"bg-secondary-50 dark:bg-secondary-900 peer-checked:bg-primary-500 dark:peer-disabled:bg-secondary-800 peer-disabled:bg-secondary-200",borderWidth:"border peer-checked:border-0",borderColor:"border-secondary-200 dark:border-secondary-700 peer-checked:border-transparent",ringOffsetColor:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0},transitionProperty:"transition-colors"};return Object.values({...i})}),o=e.computed(()=>Object.values({...{position:"absolute",left:"left-0",right:"right-0",top:"top-0",bottom:"bottom-0",margin:"m-auto",display:"hidden peer-checked:block",textColor:"text-white peer-disabled:text-secondary-300 dark:peer-disabled:text-secondary-600"}}));return{inputClasses:l,spanClasses:n,iconClasses:o}}const ie={class:"inline-block leading-3"},de={class:"relative inline-flex"},ce=["checked","value"],ue=["width","height"],fe=[e.createElementVNode("path",{d:"M9.64286 3.42857L4.63393 8.57143L2.35714 6.23376",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)],me=[e.createElementVNode("path",{d:"M1 1H9",stroke:"white","stroke-width":"1.5","stroke-linecap":"round"},null,-1)],he=[e.createElementVNode("path",{d:"M1 1H11",stroke:"white","stroke-width":"1.75","stroke-linecap":"round"},null,-1)],ge=[e.createElementVNode("path",{d:"M1 1H15",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],be=[e.createElementVNode("path",{d:"M1 1H17",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],xe=[e.createElementVNode("path",{d:"M1 1H21",stroke:"white","stroke-width":"2","stroke-linecap":"round"},null,-1)],ye={name:"LuiCheckbox",inheritAttrs:!1},ze=e.defineComponent({...ye,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1,validator(t){return[!0,!1,"full"].includes(t)}},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},indeterminate:{type:Boolean,default:!1},value:{type:[String,Boolean],default:!1},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c,iconClasses:a}=re(e.toRefs(n)),{descriptionClasses:d}=A(e.toRefs(n),o),{handleVModel:s,isInputChecked:f}=H(n,o);function u(b){l("update:modelValue",s(b))}const z=e.computed(()=>n.size==="xs"?{checkbox:"12",indeterminate:{width:"10",stroke:"1.5",viewBox:"0 0 10 2"}}:n.size==="sm"?{checkbox:"16",indeterminate:{width:"12",stroke:"1.75",viewBox:"0 0 12 2"}}:n.size==="md"?{checkbox:"20",indeterminate:{width:"16",stroke:"2",viewBox:"0 0 16 2"}}:n.size==="lg"?{checkbox:"24",indeterminate:{width:"18",stroke:"2",viewBox:"0 0 18 2"}}:{checkbox:"28",indeterminate:{width:"22",stroke:"2",viewBox:"0 0 22 2"}});return(b,S)=>(e.openBlock(),e.createElementBlock("div",ie,[e.createElementVNode("div",de,[e.createElementVNode("input",e.mergeProps({type:"checkbox",checked:e.unref(f),value:t.value,onChange:u,class:e.unref(i)},b.$attrs),null,16,ce),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2),t.indeterminate?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(e.unref(a)),width:e.unref(z).checkbox,height:e.unref(z).checkbox,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fe,10,ue)),t.indeterminate&&t.size==="xs"?(e.openBlock(),e.createElementBlock("svg",{key:1,width:"10",height:"2",viewBox:"0 0 10 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},me,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="sm"?(e.openBlock(),e.createElementBlock("svg",{key:2,width:"12",height:"2",viewBox:"0 0 12 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},he,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="md"?(e.openBlock(),e.createElementBlock("svg",{key:3,width:"16",height:"2",viewBox:"0 0 16 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},ge,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="lg"?(e.openBlock(),e.createElementBlock("svg",{key:4,width:"18",height:"2",viewBox:"0 0 18 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},be,2)):e.createCommentVNode("",!0),t.indeterminate&&t.size==="xl"?(e.openBlock(),e.createElementBlock("svg",{key:5,width:"22",height:"2",viewBox:"0 0 22 2",class:e.normalizeClass(e.unref(a)),fill:"none",xmlns:"http://www.w3.org/2000/svg"},xe,2)):e.createCommentVNode("",!0)]),t.description!==null?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(d))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}});function Z(t,l){function n(o){var i;(i=ke(t))!=null&&i.contains(o.target)||l()}e.onMounted(()=>document.addEventListener("click",n)),e.onUnmounted(()=>document.removeEventListener("click",n))}function ke(t){var l;return t==null||t.value==null?null:(l=t.value.$el)!=null?l:t.value}function J(t){var l;return t==null||t.value==null?null:(l=t.value.$el)!=null?l:t.value}function Q(t){const l=e.ref("bottom");function n(){var c;if(J(t)===null){l.value="bottom";return}const o=(c=J(t))==null?void 0:c.getBoundingClientRect(),i=window.innerHeight;if((o==null?void 0:o.bottom)===void 0||(o==null?void 0:o.y)===void 0){l.value="bottom";return}i-(o==null?void 0:o.bottom)>=(o==null?void 0:o.y)?l.value="bottom":l.value="top"}return e.onMounted(()=>window.addEventListener("scroll",n)),e.onUnmounted(()=>window.removeEventListener("scroll",n)),{properPosition:l}}let pe=0;function we(){return++pe}function D(){return we()}const Ce=["width","height"],ve=[e.createElementVNode("path",{d:"M5.99999 6.58599L8.47499 4.11099L9.18199 4.81799L5.99999 7.99999L2.81799 4.81799L3.52499 4.11099L5.99999 6.58599Z",fill:"white"},null,-1)],Be=["aria-activedescendant"],Se={name:"LuiDropdown",inheritAttrs:!1},$e=e.defineComponent({...Se,props:{text:{type:String,default:""},menuPosition:{type:String,default:"bottomLeft"},variant:{type:String,default:"solid"},color:{type:String,default:"primary"},filter:{type:String,default:"none"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1}},emits:["onTrigger"],setup(t,{emit:l}){const n=t;console.log(n);const o=e.useSlots(),i=e.ref(null),c=e.ref(null),a=e.ref(null),d=e.ref(!1),s=`lui-dropdown-button-${D()}`,f=`lui-dropdown-menu-${D()}`,u=e.reactive({items:[],currentIndex:0,currentId:""});Z(c,()=>I());const{properPosition:z}=Q(i),b={bottomLeft:{classes:"top-full mt-1",oppositeClasses:"bottom-full mb-1 left-0",direction:"bottom"},topLeft:{classes:"bottom-full mb-1 left-0",oppositeClasses:"top-full mt-1",direction:"top"},bottomRight:{classes:"top-full mt-1 right-0",oppositeClasses:"bottom-full mb-1 right-0",direction:"bottom"},topRight:{classes:"bottom-full mb-1 right-0",oppositeClasses:"top-full mt-1 right-0",direction:"top"},leftTop:{classes:"top-0 mr-1 right-full",oppositeClasses:"bottom-0 mr-1 right-full",direction:"bottom"},leftBottom:{classes:"bottom-0 mr-1 right-full",oppositeClasses:"top-0 mr-1 right-full",direction:"top"},rightTop:{classes:"top-0 ml-1 left-full",oppositeClasses:"bottom-0 ml-1 left-full",direction:"bottom"},rightBottom:{classes:"bottom-0 ml-1 left-full",oppositeClasses:"top-0 ml-1 left-full",direction:"top"}},S=e.computed(()=>b[n.menuPosition].direction===z.value?b[n.menuPosition].classes:b[n.menuPosition].oppositeClasses);function I(){d.value=!1,l("onTrigger",d.value)}function k(){d.value=!0,l("onTrigger",d.value)}function B(){d.value=!d.value,l("onTrigger",d.value)}(function(){const C=o.default&&o.default().map(p=>p.type.toString()==="Symbol(Fragment)"?p.children.map(j=>j.props):p.props).flat();C&&C.length&&(u.items=C)})();function v(m){var C;switch(m.code){case"ArrowDown":m.preventDefault(),$(a.value,p=>p+1);break;case"ArrowUp":m.preventDefault(),$(a.value,p=>p-1);break;case"Enter":m.preventDefault(),m.stopPropagation(),((C=a.value)==null?void 0:C.children[u.currentIndex]).click();break;case"Home":m.preventDefault(),$(a.value,p=>p+1,0);break;case"End":m.preventDefault();{const p=u.items.length-1;$(a.value,j=>j-1,p)}break;case"Escape":m.preventDefault(),I();break;case"Tab":m.preventDefault(),m.stopPropagation();break}}function N(m){switch(m.code){case"ArrowDown":case"Enter":case"Space":m.preventDefault(),k(),$(a.value,C=>C+1,0);break}}function $(m,C,p=null){const j=h=>h>=0&&h<=u.items.length-1,K=h=>{var g,w;return((g=u.items[h])==null?void 0:g.disabled)===void 0||((w=u.items[h])==null?void 0:w.disabled)===!1};let _=u.currentIndex;if(p!==null?_=p:_=C(_),!j(_))return;for(;!K(_);)if(_=C(_),!j(_))return;u.currentIndex=_;const r=m==null?void 0:m.children[u.currentIndex];(r==null?void 0:r.id)!==void 0&&(u.currentId=r==null?void 0:r.id,e.nextTick(()=>r==null?void 0:r.focus({preventScroll:!0})))}const P=e.computed(()=>{const m={position:"absolute",zIndex:"z-[999]",backgroundColor:"bg-secondary-50 dark:bg-secondary-900",borderWidth:"border",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:{"rounded-md":n.rounded===!0,"rounded-2xl":n.rounded==="full"},padding:{"p-1.5":n.size==="xs"||n.size==="sm","p-2":n.size==="md","p-2.5":n.size==="lg"||n.size==="xl"},boxShadow:"shadow-lg",bottom:z.value=="top"?"bottom-full":"",top:z.value=="bottom"?"top-full":"",margin:z.value=="bottom"?"mt-2":"mb-2",space:n.size==="xs"||n.size==="sm"?"space-y-1.5":"space-y-2"};return Object.values({...m})}),F=e.computed(()=>({color:n.color,block:n.block,rounded:n.rounded,size:n.size,variant:n.variant,filter:n.filter}));function R(m){return m==="xs"?"12":m==="sm"?"16":m==="xl"?"24":"20"}return(m,C)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"luiDropdownWrapper",ref:i,class:"relative leading-3 w-fit"},[e.createElementVNode("div",{ref_key:"luiDropdownButton",ref:c,class:"trigger-wrapper"},[e.renderSlot(m.$slots,"trigger",{id:s,type:"button",ariaHaspopup:"true",ariaExpanded:d.value,ariaControls:f,onClick:B,onKeydown:N},()=>[e.createVNode(q,e.mergeProps({id:s,type:"button","aria-haspopup":"true","aria-expanded":d.value,"aria-controls":f,onClick:B,onKeydown:N},e.unref(F)),{append:e.withCtx(()=>[e.renderSlot(m.$slots,"triggerAppend",{},()=>[(e.openBlock(),e.createElementBlock("svg",{viewBox:"0 0 12 12",width:R(t.size),height:R(t.size),fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},ve,8,Ce))])]),default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.text)+" ",1)]),_:3},16,["aria-expanded"])])],512),e.createVNode(e.Transition,{"enter-active-class":"transition duration-100 ease-out","enter-from-class":"transform scale-95 opacity-0","enter-to-class":"transform scale-100 opacity-100","leave-active-class":"transition duration-75 ease-in","leave-from-class":"transform scale-100 opacity-100","leave-to-class":"transform scale-95 opacity-0"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{id:f,role:"menu",ref_key:"luiDropdownMenu",ref:a,"aria-labelledby":s,"aria-activedescendant":String(u.currentIndex),tabindex:"0",class:e.normalizeClass([e.unref(S),e.unref(P)]),onKeydown:v},[e.renderSlot(m.$slots,"default")],42,Be),[[e.vShow,d.value]])]),_:3})],512))}}),_e={name:"LuiDropdownItem"},Ve=e.defineComponent({..._e,props:{disabled:{type:Boolean,default:!1},tag:{type:String,default:"button"},color:{type:String,default:"secondary"},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1}},setup(t){const l=t,n=e.useSlots(),o=`lui-dropdown-item-${D()}`,i=e.computed(()=>{const d={width:"w-full",display:"flex",justifyContent:"justify-between",alignItems:"items-center",outlineWidth:"outline-none",textColor:`text-${l.color}-600 dark:text-${l.color}-400 disabled:text-secondary-300 disabled:dark:text-secondary-700`,backgroundColor:`hover:bg-${l.color}-600/20 focus:bg-${l.color}-600/20 dark:hover:bg-${l.color}-400/20 dark:focus:bg-${l.color}-400/20 disabled:bg-transparent disabled:dark:bg-transparent`,fontSize:{"text-xs":l.size==="xs","text-sm":l.size==="sm","text-base":l.size==="md","text-lg":l.size==="lg","text-xl":l.size==="xl"},padding:{"py-1 px-1.5":l.size==="xs","py-1.5 px-2":l.size==="sm","py-2 px-2.5":l.size==="md","py-2.5 px-2.5":l.size==="lg","py-3.5 px-3":l.size==="xl"},borderRadius:{"rounded-md":l.rounded===!0,"rounded-full":l.rounded==="full"},space:!!n.prepend||!!n.append?{"space-x-1.5":l.size==="xs","space-x-2":l.size==="sm","space-x-2.5":l.size==="md"||l.size==="lg","space-x-3":l.size==="xl"}:"",cursor:{["cursor-pointer disabled:cursor-not-allowed"]:l.tag==="button"},pointerEvents:l.disabled?"pointer-events-none":""};return Object.values(d)}),c=e.computed(()=>Object.values({display:"flex",alignItems:"items-center",justifyContent:"justify-center"})),a=e.computed(()=>Object.values({display:"flex flex-1",alignItems:"items-center"}));return(d,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),e.mergeProps({role:"menuitem",class:"lui-menu-item",id:o},d.$attrs,{class:e.unref(i)}),{default:e.withCtx(()=>[d.$slots.prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(c))},[e.renderSlot(d.$slots,"prepend")],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(a))},[e.renderSlot(d.$slots,"default")],2),d.$slots.append?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(c))},[e.renderSlot(d.$slots,"append")],2)):e.createCommentVNode("",!0)]),_:3},16,["class"]))}});function Ee(t,l){const n=e.useSlots(),o=e.computed(()=>t.stateIcon.value===!0&&t.state.value!==null||t.clear.value===!0?n.prepend?"twoIcon":"rightIcon":n.prepend?"leftIcon":"noIcon"),i={position:"absolute",translate:"-translate-y-1/2",top:"top-2/4",fontSize:{"text-xs":t.size.value==="xs","text-base":t.size.value==="sm","text-xl":t.size.value==="md"||t.size.value==="lg","text-2xl":t.size.value==="xl"}},c=e.computed(()=>{const f={peer:"peer",width:"w-full",textColor:"text-secondary-600 placeholder:text-secondary-400 disabled:placeholder:text-secondary-300 dark:text-secondary-300 dark:placeholder:text-secondary-600 dark:disabled:text-secondary-700",backgroundColor:"bg-secondary-50 disabled:bg-secondary-100 dark:bg-secondary-900 dark:disabled:secondary-800",outlineStyle:"outline-none",borderWidth:"border",borderStyle:"border-solid",cursor:"disabled:cursor-not-allowed",borderColor:{["border-secondary-200 focus:border-primary-500 disabled:border-secondary-200"]:t.state.value===null,["disabled:border-secondary-200 border-warning-500"]:t.state.value==="warning",["disabled:border-secondary-200 border-danger-500"]:t.state.value===!1,["disabled:border-secondary-200 border-success-500"]:t.state.value===!0},ringWidth:l.disabled!==void 0&&l.disabled===!0?"ring-0":t.state.value===null?"focus:ring-4":"ring-4",ringColor:{"focus:ring-primary-500/40":t.state.value===null,"ring-warning-500/40":t.state.value==="warning","ring-danger-500/40":t.state.value===!1,"ring-success-500/40":t.state.value===!0},borderRadius:{"rounded-lg":t.rounded.value===!0,"rounded-full":t.rounded.value==="full"},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},padding:o.value==="noIcon"?{"py-1 px-1.5":t.size.value==="xs","py-1.5 px-2":t.size.value==="sm","py-2 px-2.5":t.size.value==="md","py-2.5 px-2.5":t.size.value==="lg","py-3.5 px-3":t.size.value==="xl"}:o.value==="rightIcon"?{"py-1 pl-1.5 pr-6":t.size.value==="xs","py-1.5 pl-2 pr-8":t.size.value==="sm","py-2 pl-2.5 pr-10":t.size.value==="md","py-2.5 pl-2.5 pr-10":t.size.value==="lg","py-3.5 pl-3 pr-12":t.size.value==="xl"}:o.value==="twoIcon"?{"py-1 px-6":t.size.value==="xs","py-1.5 px-8":t.size.value==="sm","py-2 px-10":t.size.value==="md","py-2.5 px-10":t.size.value==="lg","py-3.5 px-12":t.size.value==="xl"}:{"py-1 pr-1.5 pl-6":t.size.value==="xs","py-1.5 pr-2 pl-8":t.size.value==="sm","py-2 pr-2.5 pl-10":t.size.value==="md","py-2.5 pr-2.5 pl-10":t.size.value==="lg","py-3.5 pr-3 pl-12":t.size.value==="xl"}};return Object.values({...f})}),a=e.computed(()=>{const f={...i,left:{"left-2":t.size.value==="xs","left-2.5":t.size.value==="sm","left-3":t.size.value==="md"||t.size.value==="lg","left-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled.value?"text-secondary-300 dark:text-secondary-700":"text-secondary-400 peer-focus:text-secondary-600 dark:text-secondary-600 dark:peer-focus:text-secondary-300"};return Object.values({...f})}),d=e.computed(()=>{const f={...i,right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-300":{"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...f})}),s=e.computed(()=>{const f={...i,right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},display:"flex",outlineStyle:"outline-none",textColor:"text-secondary-400 peer-focus:text-secondary-600 dark:text-secondary-600 dark:peer-focus:text-secondary-300",ringWidth:"focus-visible:ring-2",ringColor:"focus-visible:ring-secondary-200"};return Object.values({...f})});return{inputClasses:c,prependClasses:a,stateIconClasses:d,closeIconClasses:s}}const Ie={class:"relative"},Ne=["value"],Oe=["width","height"],Le=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z"},null,-1)],je=["width","height"],Me=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455zM4 18.385L5.763 17H20V5H4v13.385zM11 13h2v2h-2v-2zm0-6h2v5h-2V7z"},null,-1)],De=["width","height"],Ae=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)],Pe=["width","height"],Re=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"},null,-1)],We=["width","height"],He=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm4.891-11.477l-8.368 8.368a6.04 6.04 0 0 1-1.414-1.414l8.368-8.368a6.04 6.04 0 0 1 1.414 1.414z"},null,-1)],Te={name:"LuiInput",inheritAttrs:!1},X=e.defineComponent({...Te,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},block:{type:Boolean,default:!1},clear:{type:Boolean,default:!1},description:{type:[String,null],default:null},modelValue:{type:[String,Number],default:""}},emits:["update:modelValue"],setup(t,{expose:l,emit:n}){const o=t,i=e.useAttrs(),c=e.useSlots(),a=e.ref(null),{inputClasses:d,prependClasses:s,stateIconClasses:f,closeIconClasses:u}=Ee(e.toRefs(o),i),{descriptionClasses:z}=A(e.toRefs(o),i);function b(){a.value.value="",a.value.focus()}l({focus:()=>a.value.focus()});function I(v){n("update:modelValue",v.target.value)}const k=e.computed(()=>o.size==="xs"?"12":o.size==="sm"?"16":o.size==="xl"?"24":"20"),B=e.computed(()=>i.disabled!==void 0&&i.disabled===!0);return(v,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-block leading-3",t.block?"w-full":"w-48"])},[e.createElementVNode("div",Ie,[e.createElementVNode("input",e.mergeProps({ref_key:"LuiInputRef",ref:a,value:t.modelValue,class:e.unref(d)},v.$attrs,{onInput:N[0]||(N[0]=$=>I($))}),null,16,Ne),e.unref(c).prepend?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(s),"leading-none"])},[e.renderSlot(v.$slots,"prepend")],2)):e.createCommentVNode("",!0),t.clear&&!e.unref(i).disabled?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:b,class:e.normalizeClass(e.unref(u))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Le,8,Oe))],2)):e.createCommentVNode("",!0),t.stateIcon&&t.state!==null&&!e.unref(B)?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(f))},[t.state==="warning"?(e.openBlock(),e.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Me,8,je)):e.createCommentVNode("",!0),t.state===!1?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Ae,8,De)):e.createCommentVNode("",!0),t.state===!0?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},Re,8,Pe)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),e.createElementVNode("span",null,[t.stateIcon&&e.unref(B)?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(e.unref(f)),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(k),height:e.unref(k),fill:"currentColor"},He,10,We)):e.createCommentVNode("",!0)])]),t.description!==null?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(z))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)],2))}});function Fe(t){const l=e.computed(()=>{const o={...W(),width:{"w-4":t.size.value==="xs","w-5":t.size.value==="sm","w-6":t.size.value==="md","w-7":t.size.value==="lg","w-8":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:"rounded-full"};return Object.values({...o})}),n=e.computed(()=>{const o={lineHeight:"leading-none",width:{"w-4 before:w-2":t.size.value==="xs","w-5 before:w-2.5":t.size.value==="sm","w-6 before:w-3":t.size.value==="md","w-7 before:w-3.5":t.size.value==="lg","w-8 before:w-4":t.size.value==="xl"},height:{"h-4 before:h-2":t.size.value==="xs","h-5 before:h-2.5":t.size.value==="sm","h-6 before:h-3":t.size.value==="md","h-7 before:h-3.5":t.size.value==="lg","h-8 before:h-4":t.size.value==="xl"},borderWidth:"border peer-checked:border-0",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:"rounded-full before:rounded-full",backgroundColor:"bg-secondary-50 dark:bg-secondary-900 peer-checked:bg-primary-500 before:bg-transparent peer-checked:before:bg-white peer-disabled:before:bg-seconday-200 dark:peer-disabled:bg-secondary-800 dark:peer-disabled:bg-secondary-800 peer-disabled:bg-secondary-200",ringWidth:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0},display:"inline-flex",alignItems:"items-center",justifyContent:"justify-center",flexShrink:"shrink-0",transitionProperty:"transition-colors before:transition-colors"};return Object.values({...o})});return{inputClasses:l,spanClasses:n}}const Ke={class:"inline-block leading-3"},Ue={class:"relative"},Ge=["checked","value"],qe={name:"LuiRadio",inheritAttrs:!1},Ze=e.defineComponent({...qe,props:{size:{type:String,default:"md"},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},value:{type:String,default:""},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c}=Fe(e.toRefs(n)),{descriptionClasses:a}=A(e.toRefs(n),o),{handleVModel:d,isInputChecked:s}=H(n,o);function f(u){l("update:modelValue",d(u))}return(u,z)=>(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Ue,[e.createElementVNode("input",e.mergeProps({type:"checkbox",class:e.unref(i),checked:e.unref(s),value:t.value,onChange:f},u.$attrs),null,16,Ge),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(a))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}}),Y=Symbol("ContextKey"),Je=["aria-selected"],Qe={key:0},Xe={key:1,class:"ml-auto"},Ye={name:"LuiOption",inheritAttrs:!1},T=e.defineComponent({...Ye,props:{selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:!1},value:{type:[String,Number],default:""},text:{type:String,default:""}},setup(t){const l=t,n=e.inject(Y),o=e.useSlots(),i=`lui-option-${D()}`;e.nextTick(()=>{(n==null?void 0:n.selectedOption.value)===void 0&&l.selected&&!l.disabled&&(n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:l.selected}))}),e.watch(()=>l.selected,s=>{n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:s})});function c(s){s.preventDefault(),n==null||n.updateSelectedOption({value:l.value,text:l.text,selected:l.selected}),e.nextTick(()=>n==null?void 0:n.focusButton())}const a=e.computed(()=>(n==null?void 0:n.selectedOption.value)===void 0?l.selected:typeof(n==null?void 0:n.selectedOption.value)=="string"?l.text===(n==null?void 0:n.selectedOption.value):l.text===(n==null?void 0:n.selectedOption.value.text)),d=e.computed(()=>{const s={backgroundColor:l.disabled?"":a.value===!0?"bg-primary-500 hover:text-primary-600 focus:text-primary-600":"hover:bg-primary-500/20 focus:bg-primary-500/20",padding:{"px-1.5 py-1":l.size==="xs","px-2 py-1.5":l.size==="sm","px-2 py-2.5":l.size==="md","p-2.5":l.size==="lg","px-3 py-3.5":l.size==="xl"},textColor:l.disabled?"text-secondary-300 dark:text-secondary-700":a.value===!0?"text-white":"text-secondary-600 dark:text-secondary-300 hover:text-primary-500 focus:text-primary-500",outlineWidth:"outline-none",borderRadius:{"rounded-md":l.rounded===!0,"rounded-2xl":l.rounded==="full"},display:o.prepend||o.append?"flex":"",alignItems:o.prepend||o.append?"items-center":"",cursor:l.disabled?"cursor-not-allowed":"",pointerEvents:l.disabled?"pointer-events-none":""};return Object.values({...s})});return(s,f)=>(e.openBlock(),e.createElementBlock("li",e.mergeProps({role:"option",tabindex:"-1"},s.$attrs,{id:i,"aria-selected":e.unref(a),class:e.unref(d),onClick:c}),[s.$slots.prepend?(e.openBlock(),e.createElementBlock("span",Qe,[e.renderSlot(s.$slots,"prepend")])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(s.$slots.prepend?"ml-1":"")},e.toDisplayString(t.text),3),s.$slots.append?(e.openBlock(),e.createElementBlock("span",Xe,[e.renderSlot(s.$slots,"append")])):e.createCommentVNode("",!0)],16,Je))}}),et=["aria-expanded"],tt=["aria-activedescendant"],lt={name:"LuiSelect",inheritAttrs:!1},nt=e.defineComponent({...lt,props:{rounded:{type:[Boolean,String],default:!1},block:{type:Boolean,default:!1},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},options:{type:Array,default:()=>[]},placeholder:{type:String,default:""},size:{type:String,default:"md"},description:{type:[String,null],default:null},modelValue:{type:[Object,String,void 0],default:void 0}},emits:["update:modelValue","change"],setup(t,{emit:l}){const n=t,o=e.useSlots(),i=e.useAttrs(),c=e.ref(null),a=e.ref(null),d=e.ref(null),s=e.ref(!1),f=e.ref(void 0),u=e.reactive({items:[],currentIndex:0,currentId:""}),z=`lui-listbox-button-${D()}`,b=`lui-listbox-wrapper-${D()}`,S=["LuiOption"],I={missing:{modelValue:"Missing field for modelValue, label and value fields are required when modelValue is object",options:"Options missing: should use options prop or LuiOption component as slot"}},{properPosition:k}=Q(d);Z(d,()=>$()),e.nextTick(()=>{R(),F()}),e.provide(Y,{selectedOption:f,updateSelectedOption:v,focusButton:N}),e.watch(()=>n.modelValue,r=>v(r));function B(r,h,g=null){const w=M=>M>=0&&M<=u.items.length-1,U=M=>{const E=u.items[M];return typeof E!="string"&&((E==null?void 0:E.disabled)===void 0||(E==null?void 0:E.disabled)===!1)};let V=u.currentIndex;if(g!==null?V=g:V=h(V),!w(V))return;for(;!U(V);)if(V=h(V),!w(V))return;u.currentIndex=V;const O=r==null?void 0:r.children[u.currentIndex];u.currentId=O==null?void 0:O.id,e.nextTick(()=>O==null?void 0:O.focus({preventScroll:!0}))}function v(r){f.value=r,l("update:modelValue",r),l("change",r)}function N(){var r;(r=c.value)==null||r.focus()}function $(){console.log("close calisti..."),s.value=!1}function P(){s.value=!s.value,console.log("aaaa",s.value)}function F(){const r=o.default&&o.default().map(g=>g.type.toString()==="Symbol(Fragment)"?g.children.map(w=>w.props):g.props).flat(),h=[...n.options].concat(r||[]);u.items=h}function R(){var O,M,E;const r=n.modelValue!==void 0&&typeof n.modelValue!="string"&&(((O=n.modelValue)==null?void 0:O.text)===void 0||((M=n.modelValue)==null?void 0:M.value)===void 0),h=n.options.length>0,g=()=>n.options.some(x=>typeof x!="string"&&x.selected);function w(x){n.placeholder===""?v(x):v(n.placeholder)}const U=()=>o.default&&o.default().some(x=>x.type.toString()=="Symbol(Fragment)"?x.children.some(L=>L.props.selected!==void 0&&L.props.selected===!0):x.props.selected!==void 0&&x.props.selected===!0),V=()=>o.default&&o.default().some(x=>x.type.toString()=="Symbol(Fragment)"?x.children.some(L=>L.type.name!==void 0&&S.includes(L.type.name)):x.type.name!==void 0&&S.includes(x.type.name));if(r)throw new Error(I.missing.modelValue);if(n.modelValue!==void 0){v(n.modelValue);return}if(h&&!g()){w(n.options[0]);return}if(!h&&!V())throw new Error(`Options missing: should use options prop or one of the valid slots: ${S}`);if(!h&&!U()){const x=o.default&&o.default()[0];let L;o.default&&(x==null?void 0:x.type.toString())==="Symbol(Fragment)"?L=(E=x==null?void 0:x.children[0])==null?void 0:E.props:L=x==null?void 0:x.props,w(L)}}function m(r){switch(r.code){case"ArrowDown":case"ArrowUp":case"Enter":case"Space":{r.preventDefault(),s.value||P();let h=u.items.findIndex(g=>{var w;return typeof g=="string"?g===f.value:(g==null?void 0:g.text)===((w=f.value)==null?void 0:w.text)});h===-1?B(a.value,g=>g+1,0):B(a.value,g=>g+1,h)}break}}function C(r){switch(r.code){case"ArrowDown":r.preventDefault(),B(a.value,h=>h+1);break;case"ArrowUp":r.preventDefault(),B(a.value,h=>h-1);break;case"Enter":r.preventDefault(),r.stopPropagation(),v(u.items[u.currentIndex]),$(),e.nextTick(()=>N());break;case"Home":r.preventDefault(),B(a.value,h=>h+1,0);break;case"End":r.preventDefault();{const h=u.items.length-1;B(a.value,g=>g-1,h)}break;case"Escape":r.preventDefault(),$(),e.nextTick(()=>N());break;case"Tab":r.preventDefault(),r.stopPropagation();break}}const p=e.computed(()=>{const r={position:"absolute",zIndex:"z-[999]",backgroundColor:"bg-secondary-50 dark:bg-secondary-900",borderWidth:"border",borderColor:"border-secondary-200 dark:border-secondary-700",borderRadius:{"rounded-md":n.rounded===!0,"rounded-2xl":n.rounded==="full"},padding:{"p-1.5":n.size==="xs"||n.size==="sm","p-2":n.size==="md","p-2.5":n.size==="lg"||n.size==="xl"},boxShadow:"shadow-lg",bottom:k.value=="top"?"bottom-full":"",top:k.value=="bottom"?"top-full":"",margin:k.value=="bottom"?"mt-2":"mb-2",space:n.size==="xs"||n.size==="sm"?"space-y-1.5":"space-y-2"};return Object.values({...r})}),j=e.computed(()=>({rounded:n.rounded,block:n.block,state:n.state,stateIcon:n.stateIcon,placeholder:n.placeholder,size:n.size,description:n.description,...i})),K=r=>typeof r=="string"?{text:r}:{...r},_=e.computed(()=>{var r;return typeof f.value=="string"?f.value:(r=f.value)==null?void 0:r.text});return(r,h)=>(e.openBlock(),e.createElementBlock("div",{class:"relative",role:"combobox",ref_key:"selectWrapperRef",ref:d,"aria-haspopup":"listbox","aria-expanded":s.value,"aria-controls":b,tabindex:"-1",onClick:P},[e.createVNode(X,e.mergeProps({ref_key:"selectRef",ref:c,id:z,value:e.unref(_),readonly:""},e.unref(j),{onKeydown:h[0]||(h[0]=g=>m(g))}),null,16,["value"]),e.withDirectives(e.createElementVNode("ul",{ref_key:"optionsRef",ref:a,id:b,"aria-orientation":"vertical","aria-labelledby":z,role:"listbox",tabindex:"0",class:e.normalizeClass(e.unref(p)),"aria-activedescendant":u.currentId,onKeydown:h[1]||(h[1]=g=>C(g))},[t.placeholder!==""?(e.openBlock(),e.createBlock(T,{key:0,disabled:"",text:t.placeholder},null,8,["text"])):e.createCommentVNode("",!0),t.options.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.options,(g,w)=>(e.openBlock(),e.createBlock(T,e.mergeProps({key:w},K(g)),null,16))),128)):e.createCommentVNode("",!0),r.$slots.default?e.renderSlot(r.$slots,"default",{key:2}):e.createCommentVNode("",!0)],42,tt),[[e.vShow,s.value]])],8,et))}});function ot(t){const l=e.computed(()=>{const o={...W(),width:{"w-8":t.size.value==="xs","w-10":t.size.value==="sm","w-12":t.size.value==="md","w-14":t.size.value==="lg","w-16":t.size.value==="xl"},height:{"h-4":t.size.value==="xs","h-5":t.size.value==="sm","h-6":t.size.value==="md","h-7":t.size.value==="lg","h-8":t.size.value==="xl"},borderRadius:{"rounded-full":t.rounded.value==="full",rounded:t.rounded.value===!0}};return Object.values({...o})}),n=e.computed(()=>{const o={lineHeight:"leading-none",width:{"w-8 before:w-3":t.size.value==="xs","w-10 before:w-4":t.size.value==="sm","w-12 before:w-5":t.size.value==="md","w-14 before:w-6":t.size.value==="lg","w-16 before:w-7":t.size.value==="xl"},height:{"h-4 before:h-3":t.size.value==="xs","h-5 before:h-4":t.size.value==="sm","h-6 before:h-5":t.size.value==="md","h-7 before:h-6":t.size.value==="lg","h-8 before:h-7":t.size.value==="xl"},backgroundColor:"bg-secondary-500 dark:bg-secondary-800 peer-disabled:bg-secondary-100 peer-checked:peer-disabled:bg-success-100 peer-checked:bg-success-500 before:bg-white",borderRadius:{"rounded-full before:rounded-full":t.rounded.value==="full","rounded before:rounded-sm":t.rounded.value===!0},display:"inline-flex",position:"relative before:absolute",top:"before:top-0",bottom:"before:bottom-0",translate:{"before:translate-x-0.5 peer-checked:before:translate-x-[1.125rem]":t.size.value==="xs","before:translate-x-0.5 peer-checked:before:translate-x-[1.375rem]":t.size.value==="sm","before:translate-x-0.5 peer-checked:before:translate-x-[1.625rem]":t.size.value==="md","before:translate-x-0.5 peer-checked:before:translate-x-[1.875rem]":t.size.value==="lg","before:translate-x-0.5 peer-checked:before:translate-x-[2.125rem]":t.size.value==="xl"},margin:"before:my-auto",transitionProperty:"before:transition transition",ringWidth:"peer-focus-visible:ring-2",ringColor:{"peer-focus-visible:ring-primary-500/40":t.state.value===null,"peer-focus-visible:ring-warning-500/40":t.state.value==="warning","peer-focus-visible:ring-danger-500/40":t.state.value===!1,"peer-focus-visible:ring-success-500/40":t.state.value===!0}};return Object.values({...o})});return{inputClasses:l,spanClasses:n}}const st={class:"inline-block leading-3"},at={class:"relative"},rt=["checked","value"],it={name:"LuiSwitch",inheritAttrs:!1},dt=e.defineComponent({...it,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:"full"},state:{type:[String,Boolean,null],default:null},description:{type:[String,null],default:null},value:{type:String,default:""},modelValue:{type:[Array,Boolean,void 0],default:void 0}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{inputClasses:i,spanClasses:c}=ot(e.toRefs(n)),{descriptionClasses:a}=A(e.toRefs(n),o),{handleVModel:d,isInputChecked:s}=H(n,o);function f(u){l("update:modelValue",d(u))}return(u,z)=>(e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",at,[e.createElementVNode("input",e.mergeProps({type:"checkbox",class:e.unref(i),checked:e.unref(s),value:t.value,onChange:f},u.$attrs),null,16,rt),e.createElementVNode("span",{class:e.normalizeClass(e.unref(c))},null,2)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(a))},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)]))}});function ct(t,l){const n=e.useSlots(),o=e.computed(()=>!!(t.stateIcon.value===!0&&t.state.value!==null||n.prepend)),i={position:"absolute",fontSize:{"text-xs":t.size.value==="xs","text-base":t.size.value==="sm","text-xl":t.size.value==="md"||t.size.value==="lg","text-2xl":t.size.value==="xl"}},c=e.computed(()=>{const d={peer:"peer",width:"w-full",textColor:"text-secondary-600 placeholder:text-secondary-400 disabled:placeholder:text-secondary-300 dark:text-secondary-300 dark:placeholder:text-secondary-600 dark:disabled:text-secondary-700",backgroundColor:"bg-secondary-50 disabled:bg-secondary-100 dark:bg-secondary-900 dark:disabled:secondary-800",outlineStyle:"outline-none",borderWidth:"border",borderStyle:"border-solid",cursor:"disabled:cursor-not-allowed",borderColor:{["border-secondary-200 focus:border-primary-500 disabled:border-secondary-200"]:t.state.value===null,["disabled:border-secondary-200 border-warning-500"]:t.state.value==="warning",["disabled:border-secondary-200 border-danger-500"]:t.state.value===!1,["disabled:border-secondary-200 border-success-500"]:t.state.value===!0},ringWidth:l.disabled!==void 0&&l.disabled===!0?"ring-0":t.state.value===null?"focus:ring-4":"ring-4",ringColor:{"focus:ring-primary-500/40":t.state.value===null,"ring-warning-500/40":t.state.value==="warning","ring-danger-500/40":t.state.value===!1,"ring-success-500/40":t.state.value===!0},borderRadius:{"rounded-md":t.rounded.value===!0},fontSize:{"text-xs":t.size.value==="xs","text-sm":t.size.value==="sm","text-base":t.size.value==="md","text-lg":t.size.value==="lg","text-xl":t.size.value==="xl"},padding:o.value?{"py-1 pl-1.5 pr-6":t.size.value==="xs","py-1.5 pl-2 pr-8":t.size.value==="sm","py-2 pl-2.5 pr-10":t.size.value==="md","py-2.5 pl-2.5 pr-10":t.size.value==="lg","py-3.5 pl-3 pr-12":t.size.value==="xl"}:{"py-1 px-1.5":t.size.value==="xs","py-1.5 px-2":t.size.value==="sm","py-2 px-2.5":t.size.value==="md","p-2.5":t.size.value==="lg","py-3.5 px-3":t.size.value==="xl"},resize:{resize:t.resize.value==!0,"resize-none":t.resize.value==!1,"resize-x":t.resize.value=="x","resize-y":t.resize.value=="y"}};return Object.values({...d})}),a=e.computed(()=>{const d={...i,top:t.size.value==="xl"||t.size.value==="lg"?"top-4":"top-3",right:{"right-2":t.size.value==="xs","right-2.5":t.size.value==="sm","right-3":t.size.value==="md"||t.size.value==="lg","right-4":t.size.value==="xl"},textColor:l.disabled!==void 0&&l.disabled===!0?"text-secondary-300":{"text-warning-500":t.state.value==="warning","text-danger-500":t.state.value===!1,"text-success-500":t.state.value===!0}};return Object.values({...d})});return{textareaClasses:c,stateIconClasses:a}}const ut={class:"relative"},ft=["width","height"],mt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M6.455 19L2 22.5V4a1 1 0 0 1 1-1h18a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6.455zM4 18.385L5.763 17H20V5H4v13.385zM11 13h2v2h-2v-2zm0-6h2v5h-2V7z"},null,-1)],ht=["width","height"],gt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-1-5h2v2h-2v-2zm0-8h2v6h-2V7z"},null,-1)],bt=["width","height"],xt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm-.997-4L6.76 11.757l1.414-1.414 2.829 2.829 5.656-5.657 1.415 1.414L11.003 16z"},null,-1)],yt=["width","height"],zt=[e.createElementVNode("path",{fill:"none",d:"M0 0h24v24H0z"},null,-1),e.createElementVNode("path",{d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm0-2a8 8 0 1 0 0-16 8 8 0 0 0 0 16zm4.891-11.477l-8.368 8.368a6.04 6.04 0 0 1-1.414-1.414l8.368-8.368a6.04 6.04 0 0 1 1.414 1.414z"},null,-1)],kt={name:"LuiTextarea",inheritAttrs:!1},pt=e.defineComponent({...kt,props:{size:{type:String,default:"md"},rounded:{type:[Boolean,String],default:"full"},state:{type:[String,Boolean,null],default:null},stateIcon:{type:[Boolean],default:null},description:{type:[String,null],default:null},resize:{type:[Boolean,String],default:!0},block:{type:Boolean,default:!1},modelValue:{type:[String],default:""}},emits:["update:modelValue"],setup(t,{emit:l}){const n=t,o=e.useAttrs(),{descriptionClasses:i}=A(e.toRefs(n),o),{textareaClasses:c,stateIconClasses:a}=ct(e.toRefs(n),o);function d(u){l("update:modelValue",u.target.value)}const s=e.computed(()=>n.size==="xs"?"12":n.size==="sm"?"16":n.size==="xl"?"24":"20"),f=e.computed(()=>o.disabled!==void 0&&o.disabled===!0);return(u,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["inline-block leading-3",t.block?"w-full":"w-48"])},[e.createElementVNode("div",ut,[e.createElementVNode("textarea",e.mergeProps(u.$attrs,{class:e.unref(c),onInput:z[0]||(z[0]=b=>d(b))}),null,16),t.stateIcon&&t.state!==null&&!e.unref(f)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(a))},[t.state==="warning"?(e.openBlock(),e.createElementBlock("svg",{key:0,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},mt,8,ft)):e.createCommentVNode("",!0),t.state===!1?(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},gt,8,ht)):e.createCommentVNode("",!0),t.state===!0?(e.openBlock(),e.createElementBlock("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},xt,8,bt)):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),t.stateIcon&&e.unref(f)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(a))},[(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:e.unref(s),height:e.unref(s),fill:"currentColor"},zt,8,yt))],2)):e.createCommentVNode("",!0)]),t.description?(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass([e.unref(i),""])},e.toDisplayString(t.description),3)):e.createCommentVNode("",!0)],2))}}),wt=require("../plugin/lui-ui");y.LuiAvatar=le,y.LuiBadge=oe,y.LuiButton=q,y.LuiCheckbox=ze,y.LuiInput=X,y.LuiMenuDropdown=$e,y.LuiMenuItem=Ve,y.LuiOption=T,y.LuiRadio=Ze,y.LuiSelect=nt,y.LuiSwitch=dt,y.LuiTextarea=pt,y.luiPlugin=wt,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
{ | ||
"name": "@lui-ui/lui-vue", | ||
"version": "0.28.1", | ||
"version": "0.28.2", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "vite", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
135311