Comparing version 0.0.13 to 0.0.14
@@ -17,3 +17,3 @@ var __defProp = Object.defineProperty; | ||
}; | ||
import { computed as computed$1, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, ref, provide, Fragment, renderList, toDisplayString, inject, withDirectives, vShow } from "vue"; | ||
import { computed as computed$1, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode, ref, provide, Fragment, renderList, toDisplayString, inject, withDirectives, vShow, resolveComponent, createVNode, createCommentVNode } from "vue"; | ||
var index = ""; | ||
@@ -114,3 +114,3 @@ function variant(name, defaultValue) { | ||
}; | ||
const _sfc_main$6 = { | ||
const _sfc_main$8 = { | ||
mixins: [ | ||
@@ -171,3 +171,3 @@ string("tag", "p", [ | ||
}; | ||
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({ class: $setup.classes }, _ctx.$attrs), { | ||
@@ -180,4 +180,4 @@ default: withCtx(() => [ | ||
} | ||
var LuiText = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]); | ||
const _sfc_main$5 = { | ||
var LuiText = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]); | ||
const _sfc_main$7 = { | ||
mixins: [variant(), boolean("border"), size(), filter()], | ||
@@ -199,3 +199,3 @@ setup(props) { | ||
}; | ||
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("span", { | ||
@@ -205,4 +205,4 @@ class: normalizeClass($setup.computedClasses) | ||
} | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); | ||
const _sfc_main$4 = { | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]); | ||
const _sfc_main$6 = { | ||
mixins: [size("sm", ["sm", "lg"])], | ||
@@ -255,5 +255,5 @@ inheritAttrs: false, | ||
}; | ||
const _hoisted_1$3 = { class: "container" }; | ||
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$3, [ | ||
const _hoisted_1$5 = { class: "container" }; | ||
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$5, [ | ||
createElementVNode("input", mergeProps({ | ||
@@ -268,4 +268,4 @@ type: "checkbox", | ||
} | ||
var LuiSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]); | ||
const _sfc_main$3 = { | ||
var LuiSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]); | ||
const _sfc_main$5 = { | ||
mixins: [size("sm", ["sm", "md", "lg"])], | ||
@@ -323,5 +323,5 @@ inheritAttrs: false, | ||
}; | ||
const _hoisted_1$2 = { class: "container" }; | ||
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$2, [ | ||
const _hoisted_1$4 = { class: "container" }; | ||
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$4, [ | ||
createElementVNode("input", mergeProps({ | ||
@@ -336,4 +336,4 @@ type: "radio", | ||
} | ||
var LuiRadio = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); | ||
const _sfc_main$2 = { | ||
var LuiRadio = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); | ||
const _sfc_main$4 = { | ||
mixins: [ | ||
@@ -409,4 +409,4 @@ string("alignTabs", "left", ["left", "center", "right"]), | ||
}; | ||
const _hoisted_1$1 = ["tabindex", "aria-selected", "disabled", "onClick", "onKeydown"]; | ||
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { | ||
const _hoisted_1$3 = ["tabindex", "aria-selected", "disabled", "onClick", "onKeydown"]; | ||
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", { | ||
@@ -438,3 +438,3 @@ class: normalizeClass($setup.computedClasses.tabMenuContainer) | ||
}, toDisplayString(prop.title), 3) | ||
], 42, _hoisted_1$1); | ||
], 42, _hoisted_1$3); | ||
}), 128)) | ||
@@ -449,4 +449,4 @@ ], 2), | ||
} | ||
var LuiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); | ||
const _sfc_main$1 = { | ||
var LuiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]); | ||
const _sfc_main$3 = { | ||
mixins: [string("title", "Title"), boolean("active"), boolean("disabled")], | ||
@@ -458,8 +458,8 @@ setup() { | ||
}; | ||
const _hoisted_1 = { | ||
const _hoisted_1$2 = { | ||
role: "tabpanel", | ||
tabindex: "0" | ||
}; | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [ | ||
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { | ||
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$2, [ | ||
renderSlot(_ctx.$slots, "default") | ||
@@ -470,3 +470,3 @@ ], 512)), [ | ||
} | ||
var LuiTab = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); | ||
var LuiTab = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); | ||
const NOOP = () => { | ||
@@ -680,3 +680,3 @@ }; | ||
Promise.resolve(); | ||
const _sfc_main = { | ||
const _sfc_main$2 = { | ||
mixins: [ | ||
@@ -717,6 +717,124 @@ string("name", true), | ||
}; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("i", mergeProps({ class: $setup.classes }, _ctx.$attrs), null, 16); | ||
} | ||
var LuiIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { LuiBadge, LuiIcon, LuiRadio, LuiSwitch, LuiTab, LuiTabs, LuiText }; | ||
var LuiIcon = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); | ||
const _sfc_main$1 = { | ||
components: { LuiIcon }, | ||
mixins: [string("title", "title"), boolean("active"), boolean("disabled")], | ||
setup(props) { | ||
let activeAccordion = inject("activeAccordion", ref(null)); | ||
let isActive = computed$1(() => { | ||
return activeAccordion.value === props.title; | ||
}); | ||
function expandItem() { | ||
if (activeAccordion.value !== props.title) { | ||
activeAccordion.value = props.title; | ||
} else { | ||
activeAccordion.value = ""; | ||
} | ||
} | ||
let btnFocus = ref(false); | ||
const computedClasses = computed$1(() => { | ||
const classes = { | ||
wrapper: { | ||
width: "w-full", | ||
border: "border", | ||
borderColor: props.disabled ? "border-secondary-100" : "border-secondary-200", | ||
borderRadius: "rounded-2xl", | ||
paddingY: "py-8", | ||
paddingX: "px-6", | ||
margin: "mb-7", | ||
focus: btnFocus.value ? "ring-2 ring-primary ring-offset-2" : "" | ||
}, | ||
button: { | ||
width: "w-full", | ||
display: "flex", | ||
alignItems: "items-center", | ||
justifyContent: "justify-between", | ||
disabled: "text-secondary-700 disabled:text-secondary-300", | ||
outline: "outline-none" | ||
}, | ||
title: { | ||
fontSize: "text-lg", | ||
fontWeight: "font-semibold", | ||
lineHeight: "leading-6" | ||
}, | ||
icon: { | ||
fontSize: "text-2xl" | ||
}, | ||
content: { | ||
marginTop: "mt-6", | ||
fontColor: "text-secondary-600" | ||
} | ||
}; | ||
const { wrapper, button, title, icon, content } = classes; | ||
return { | ||
wrapper: generateClasses([__spreadValues({}, wrapper)]), | ||
button: generateClasses([__spreadValues({}, button)]), | ||
title: generateClasses([__spreadValues({}, title)]), | ||
icon: generateClasses([__spreadValues({}, icon)]), | ||
content: generateClasses([__spreadValues({}, content)]) | ||
}; | ||
}); | ||
return { | ||
expandItem, | ||
isActive, | ||
computedClasses, | ||
btnFocus | ||
}; | ||
} | ||
}; | ||
const _hoisted_1$1 = ["aria-expanded", "disabled"]; | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
const _component_lui_icon = resolveComponent("lui-icon"); | ||
return openBlock(), createElementBlock("div", { | ||
class: normalizeClass($setup.computedClasses.wrapper) | ||
}, [ | ||
createElementVNode("h3", null, [ | ||
createElementVNode("button", { | ||
"aria-expanded": $setup.isActive, | ||
disabled: _ctx.disabled, | ||
class: normalizeClass($setup.computedClasses.button), | ||
onClick: _cache[0] || (_cache[0] = (...args) => $setup.expandItem && $setup.expandItem(...args)), | ||
onFocus: _cache[1] || (_cache[1] = ($event) => $setup.btnFocus = true), | ||
onFocusout: _cache[2] || (_cache[2] = ($event) => $setup.btnFocus = false) | ||
}, [ | ||
createElementVNode("span", { | ||
class: normalizeClass($setup.computedClasses.title) | ||
}, toDisplayString(_ctx.title), 3), | ||
createVNode(_component_lui_icon, { | ||
name: $setup.isActive ? "close" : "add", | ||
line: "", | ||
class: normalizeClass($setup.computedClasses.icon) | ||
}, null, 8, ["name", "class"]) | ||
], 42, _hoisted_1$1) | ||
]), | ||
$setup.isActive ? (openBlock(), createElementBlock("div", { | ||
key: 0, | ||
class: normalizeClass($setup.computedClasses.content), | ||
role: "region", | ||
tabindex: "0" | ||
}, [ | ||
renderSlot(_ctx.$slots, "default") | ||
], 2)) : createCommentVNode("", true) | ||
], 2); | ||
} | ||
var LuiAccordion = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); | ||
const _sfc_main = { | ||
setup() { | ||
let activeTitle = ref(null); | ||
provide("activeAccordion", activeTitle); | ||
} | ||
}; | ||
const _hoisted_1 = { | ||
ref: "LuiAccordionGroup", | ||
class: "accordionGroup" | ||
}; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1, [ | ||
renderSlot(_ctx.$slots, "default") | ||
], 512); | ||
} | ||
var LuiAccordionGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { LuiAccordion, LuiAccordionGroup, LuiBadge, LuiIcon, LuiRadio, LuiSwitch, LuiTab, LuiTabs, LuiText }; |
@@ -1,1 +0,1 @@ | ||
var Re=Object.defineProperty;var P=Object.getOwnPropertySymbols;var Le=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var V=(o,n,l)=>n in o?Re(o,n,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[n]=l,c=(o,n)=>{for(var l in n||(n={}))Le.call(n,l)&&V(o,l,n[l]);if(P)for(var l of P(n))Pe.call(n,l)&&V(o,l,n[l]);return o};(function(o,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(o=typeof globalThis!="undefined"?globalThis:o||self,n(o.LuiVue={},o.Vue))})(this,function(o,n){"use strict";var l="";function S(e,t){return{props:{[e||"variant"]:{type:String,default:t||"primary",validator(r){return(e==="variant"?["primary","secondary","info","success","warning","danger"]:["light","dark","white","black","primary","secondary","info","success","warning","danger"]).includes(r)}}}}}function j(e){return{props:{[e||"filter"]:{type:String,default:"none",validator(t){return["darker","lighter","none"].includes(t)}}}}}function y(e,t){const s=t||["2xs","xs","sm","md","lg"];return{props:{size:{type:String,default:e||"md",validator:i=>s.includes(i)}}}}function p(e,t){return{props:{[e]:{type:Boolean,default:t||!1}}}}function k(e,t,r){let s={type:String,default:t||"none"};return r!==void 0&&(s.validator=i=>r.includes(i)),{props:{[e]:s}}}function h(e){const t=[];return e.map(r=>{t.push(...Object.values(r))}),t.join(" ").toString().replace(/\s+/g," ")}function N(e,t){const r=t==="none"?`bg-${e}`:t==="darker"?`bg-${e}-800`:`bg-${e}-100`,s=t==="none"?"text-white":t==="darker"?`text-${e}-100`:`text-${e}-800`;return{backgroundColor:r,fontColor:s}}var g=(e,t)=>{const r=e.__vccOpts||e;for(const[s,i]of t)r[s]=i;return r};const I={mixins:[k("tag","p",["p","span","br","strong","em","quotes","blockquote","code","pre","mark","ins","del","sup","sub","small","i","b","abbr","address","bdi","bdo","cite","dfn","kbs","meter","q","rp","rt","ruby","s","samp","time","u","var","wbr"]),y("md",["xs","sm","md","lg"]),S("variant","secondary")],setup(e){return{classes:n.computed(()=>{const r={fontColor:`text-${e.variant}-600`,fontSize:e.size==="xs"?"text-xs":e.size==="sm"?"text-sm":e.size==="md"?"text-base":"text-xl",lineHeight:e.size==="xs"?"leading-3":e.size==="sm"?"leading-4.5":e.size==="md"?"leading-5":"leading-6"};return h([c({},r)])})}}};function D(e,t,r,s,i,d){return n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tag),n.mergeProps({class:s.classes},e.$attrs),{default:n.withCtx(()=>[n.renderSlot(e.$slots,"default")]),_:3},16,["class"])}var M=g(I,[["render",D]]);const W={mixins:[S(),p("border"),y(),j()],setup(e){return{computedClasses:n.computed(()=>{const r={width:e.size==="2xs"?"w-2":e.size==="xs"?"w-3":e.size==="sm"?"w-4":e.size==="md"?"w-5":"w-6",height:e.size==="2xs"?"h-2":e.size==="xs"?"h-3":e.size==="sm"?"h-4":e.size==="md"?"h-5":"h-6",backgroundColor:N(e.variant,e.filter).backgroundColor,border:e.border?"border border-white":"",display:"inline-block",borderRadius:"rounded-full"};return h([c({},r)])})}}};function A(e,t,r,s,i,d){return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(s.computedClasses)},null,2)}var O=g(W,[["render",A]]);const q={mixins:[y("sm",["sm","lg"])],inheritAttrs:!1,setup(e){function t(s){return s[e.size]}return{computedClasses:n.computed(()=>{const s={input:{position:"absolute",opacity:"opacity-0",width:t({sm:"w-8",lg:"w-10"}),height:t({sm:"h-4",lg:"h-5"}),cursor:"cursor-pointer",peer:"peer"},span:{display:"flex items-center",alignItems:"peer-checked:justify-end",width:t({sm:"w-8",lg:"w-10"}),height:t({sm:"h-4",lg:"h-5"}),borderRadius:"rounded-full",backgroundColor:"bg-secondary-300 peer-checked:bg-success",borderWidth:"border",borderColor:"border-secondary-200 peer-checked:border-success-100",ringWidth:"peer-focus:ring-2",ringOffset:"peer-focus:ring-offset-2",ringColor:"peer-focus:ring-success",paddigX:"px-0.5"},spanBefore:{width:t({sm:"before:w-3",lg:"before:w-4"}),height:t({sm:"before:h-3",lg:"before:h-4"}),borderRadius:"before:rounded-full",backgroundColor:"before:bg-white",borderWidth:"before:border",borderColor:"before:border-secondary-200 peer-checked:before:border-success-100"}};return{input:h([c({},s.input)]),span:h([c({},s.span),c({},s.spanBefore)])}})}}},v={class:"container"};function K(e,t,r,s,i,d){return n.openBlock(),n.createElementBlock("div",v,[n.createElementVNode("input",n.mergeProps({type:"checkbox",class:s.computedClasses.input},e.$attrs),null,16),n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.span)},null,2)])}var F=g(q,[["render",K]]);const G={mixins:[y("sm",["sm","md","lg"])],inheritAttrs:!1,props:{state:{type:[String,Boolean,null],default:null,validator(e){return[null,"warning",!0,!1].includes(e)}}},setup(e){function t(s){return s[e.size]}return{computedClasses:n.computed(()=>{const s={input:{position:"absolute",opacity:"opacity-0",width:t({sm:"w-4",md:"w-5",lg:"w-6"}),height:t({sm:"h-4",md:"h-5",lg:"h-6"}),peer:"peer"},span:{width:t({sm:"w-4",md:"w-5",lg:"w-6"}),height:t({sm:"h-4",md:"h-5",lg:"h-6"}),display:"flex items-center justify-center",borderWidth:t({sm:"border-1.5",md:"border-2",lg:"border-2.5"}),borderColor:e.state===null?"border-primary":e.state==="warning"?"border-warning":e.state===!0?"border-success":"border-danger",borderRadius:"rounded-full",backgroundColor:"bg-white",ringWidth:e.size==="sm"?"peer-focus:ring-1":"peer-focus:ring-2",ringOffset:"peer-focus:ring-offset-2",ringColor:e.state===null?"peer-focus:ring-primary":e.state==="warning"?"peer-focus:ring-warning":e.state===!0?"peer-focus:ring-success":"peer-focus:ring-danger"},spanBefore:{width:t({sm:"before:w-2",md:"before:w-2.5",lg:"before:w-3"}),height:t({sm:"before:h-2",md:"before:h-2.5",lg:"before:h-3"}),borderRadius:"before:rounded-full",backgroundColor:"before:bg-white",backgroundColorChecked:e.state===null?"peer-checked:before:bg-primary":e.state==="warning"?"peer-checked:before:bg-warning":e.state===!0?"peer-checked:before:bg-success":"peer-checked:before:bg-danger"}};return{input:h([c({},s.input)]),span:h([c({},s.span),c({},s.spanBefore)])}})}}},H={class:"container"};function X(e,t,r,s,i,d){return n.openBlock(),n.createElementBlock("div",H,[n.createElementVNode("input",n.mergeProps({type:"radio",class:s.computedClasses.input},e.$attrs),null,16),n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.span)},null,2)])}var J=g(G,[["render",X]]);const Q={mixins:[k("alignTabs","left",["left","center","right"]),k("alignContent","left",["left","center","right"]),p("stretch")],setup(e,{slots:t}){const r=n.ref(t.default().map(a=>a.props));let s=r.value.findIndex(a=>a.active!==void 0);s=s===-1?!1:s;let i=n.ref(r.value[s||0].title);const d=n.ref([]);n.provide("selectedTitle",i);function u(a,w){let f=null;a.keyCode===39&&this.tabProps.length>w+1&&(f=w+1),a.keyCode===37&&w-1>=0&&(f=w-1),a.keyCode===36&&(f=0),a.keyCode===35&&(f=this.tabProps.length-1),f!==null&&this.tabProps[f].disabled===void 0&&(this.selectedTitle=this.tabProps[f].title,d.value[f].focus())}const T=n.computed(()=>{const a={width:"w-full",display:"flex",margin:"mb-8",flexWrap:"flex-wrap",alingItems:"items-center",justifyContent:e.alignTabs==="left"?"justify-start":e.alignTabs==="center"?"justify-center":"justify-end"},w={lineHeight:"leading-5",fontSize:"text-base",fontWeight:"font-semibold",position:"relative",margin:"mb-2",flexGrow:e.stretch?"flex-grow":"",disabled:"disabled:text-secondary-300",after:"after:w-full after:h-0.5 after:absolute after:-bottom-2 after:left-0 after:inline-block after:rounded-full after:bg-transparent"},f=e.alignContent==="left"?"text-left":e.alignContent==="center"?"text-center":"text-right",ze="text-primary after:bg-primary",Se="text-secondary-500",Be="w-full",Ee="px-4";return{tabContainer:h([c({},a)]),tab:h([c({},w)]),panel:f,activeTab:ze,defaultTab:Se,tabMenuContainer:Be,tabText:Ee}});return{tabProps:r,selectedTitle:i,elements:d,computedClasses:T,handleKeyEvents:u}}},U=["tabindex","aria-selected","disabled","onClick","onKeydown"];function Y(e,t,r,s,i,d){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.computedClasses.tabMenuContainer)},[n.createElementVNode("div",{class:n.normalizeClass(s.computedClasses.tabContainer),role:"tablist"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.tabProps,(u,T)=>(n.openBlock(),n.createElementBlock("button",{key:u.title,ref_for:!0,ref:a=>s.elements[T]=a,role:"tab",tabindex:s.selectedTitle===u.title?"0":"-1","aria-selected":s.selectedTitle===u.title,disabled:u.disabled!==void 0,class:n.normalizeClass([s.computedClasses.tab,s.selectedTitle===u.title?s.computedClasses.activeTab:s.computedClasses.defaultTab]),onClick:a=>s.selectedTitle=u.title,onKeydown:a=>s.handleKeyEvents(a,T)},[n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.tabText)},n.toDisplayString(u.title),3)],42,U))),128))],2),n.createElementVNode("div",{class:n.normalizeClass(s.computedClasses.panel)},[n.renderSlot(e.$slots,"default")],2)],2)}var Z=g(Q,[["render",Y]]);const ee={mixins:[k("title","Title"),p("active"),p("disabled")],setup(){return{selectedTitle:n.inject("selectedTitle")}}},te={role:"tabpanel",tabindex:"0"};function ne(e,t,r,s,i,d){return n.withDirectives((n.openBlock(),n.createElementBlock("div",te,[n.renderSlot(e.$slots,"default")],512)),[[n.vShow,e.title==s.selectedTitle]])}var se=g(ee,[["render",ne]]);const re=()=>{},ie=Array.isArray,oe=e=>typeof e=="function",ae=e=>typeof e=="symbol";let le;function ce(e,t){t=t||le,t&&t.active&&t.effects.push(e)}const de=e=>{const t=new Set(e);return t.w=0,t.n=0,t},B=e=>(e.w&m)>0,E=e=>(e.n&m)>0,fe=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=m},ue=e=>{const{deps:t}=e;if(t.length){let r=0;for(let s=0;s<t.length;s++){const i=t[s];B(i)&&!E(i)?i.delete(e):t[r++]=i,i.w&=~m,i.n&=~m}t.length=r}};let _=0,m=1;const z=30,C=[];let b;class he{constructor(t,r=null,s){this.fn=t,this.scheduler=r,this.active=!0,this.deps=[],ce(this,s)}run(){if(!this.active)return this.fn();if(!C.includes(this))try{return C.push(b=this),me(),m=1<<++_,_<=z?fe(this):R(this),this.fn()}finally{_<=z&&ue(this),m=1<<--_,ge(),C.pop();const t=C.length;b=t>0?C[t-1]:void 0}}stop(){this.active&&(R(this),this.onStop&&this.onStop(),this.active=!1)}}function R(e){const{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}let x=!0;const L=[];function me(){L.push(x),x=!0}function ge(){const e=L.pop();x=e===void 0?!0:e}function be(){return x&&b!==void 0}function pe(e,t){let r=!1;_<=z?E(e)||(e.n|=m,r=!B(e)):r=!e.has(b),r&&(e.add(b),b.deps.push(e))}function we(e,t){for(const r of ie(e)?e:[...e])(r!==b||r.allowRecurse)&&(r.scheduler?r.scheduler():r.run())}new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(ae));function $(e){const t=e&&e.__v_raw;return t?$(t):e}function ye(e){be()&&(e=$(e),e.dep||(e.dep=de()),pe(e.dep))}function ke(e,t){e=$(e),e.dep&&we(e.dep)}class _e{constructor(t,r,s){this._setter=r,this.dep=void 0,this._dirty=!0,this.__v_isRef=!0,this.effect=new he(t,()=>{this._dirty||(this._dirty=!0,ke(this))}),this.__v_isReadonly=s}get value(){const t=$(this);return ye(t),t._dirty&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function Ce(e,t){let r,s;const i=oe(e);return i?(r=e,s=re):(r=e.get,s=e.set),new _e(r,s,i||!s)}Promise.resolve();const xe={mixins:[k("name",!0),p("fill"),p("line"),y("none",["lg","xl","xxs","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x","fw","fwh","none"])],setup(e){return{classes:Ce(()=>[`ri-${e.name}${e.fill?"-fill":""}${e.line?"-line":""}`,e.size!=="none"?`ri-${e.size}`:""])}}};function $e(e,t,r,s,i,d){return n.openBlock(),n.createElementBlock("i",n.mergeProps({class:s.classes},e.$attrs),null,16)}var Te=g(xe,[["render",$e]]);o.LuiBadge=O,o.LuiIcon=Te,o.LuiRadio=J,o.LuiSwitch=F,o.LuiTab=se,o.LuiTabs=Z,o.LuiText=M,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"}); | ||
var De=Object.defineProperty;var j=Object.getOwnPropertySymbols;var We=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable;var P=(o,n,m)=>n in o?De(o,n,{enumerable:!0,configurable:!0,writable:!0,value:m}):o[n]=m,a=(o,n)=>{for(var m in n||(n={}))We.call(n,m)&&P(o,m,n[m]);if(j)for(var m of j(n))Fe.call(n,m)&&P(o,m,n[m]);return o};(function(o,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(o=typeof globalThis!="undefined"?globalThis:o||self,n(o.LuiVue={},o.Vue))})(this,function(o,n){"use strict";var m="";function B(e,t){return{props:{[e||"variant"]:{type:String,default:t||"primary",validator(r){return(e==="variant"?["primary","secondary","info","success","warning","danger"]:["light","dark","white","black","primary","secondary","info","success","warning","danger"]).includes(r)}}}}}function N(e){return{props:{[e||"filter"]:{type:String,default:"none",validator(t){return["darker","lighter","none"].includes(t)}}}}}function C(e,t){const s=t||["2xs","xs","sm","md","lg"];return{props:{size:{type:String,default:e||"md",validator:i=>s.includes(i)}}}}function h(e,t){return{props:{[e]:{type:Boolean,default:t||!1}}}}function k(e,t,r){let s={type:String,default:t||"none"};return r!==void 0&&(s.validator=i=>r.includes(i)),{props:{[e]:s}}}function d(e){const t=[];return e.map(r=>{t.push(...Object.values(r))}),t.join(" ").toString().replace(/\s+/g," ")}function I(e,t){const r=t==="none"?`bg-${e}`:t==="darker"?`bg-${e}-800`:`bg-${e}-100`,s=t==="none"?"text-white":t==="darker"?`text-${e}-100`:`text-${e}-800`;return{backgroundColor:r,fontColor:s}}var g=(e,t)=>{const r=e.__vccOpts||e;for(const[s,i]of t)r[s]=i;return r};const D={mixins:[k("tag","p",["p","span","br","strong","em","quotes","blockquote","code","pre","mark","ins","del","sup","sub","small","i","b","abbr","address","bdi","bdo","cite","dfn","kbs","meter","q","rp","rt","ruby","s","samp","time","u","var","wbr"]),C("md",["xs","sm","md","lg"]),B("variant","secondary")],setup(e){return{classes:n.computed(()=>{const r={fontColor:`text-${e.variant}-600`,fontSize:e.size==="xs"?"text-xs":e.size==="sm"?"text-sm":e.size==="md"?"text-base":"text-xl",lineHeight:e.size==="xs"?"leading-3":e.size==="sm"?"leading-4.5":e.size==="md"?"leading-5":"leading-6"};return d([a({},r)])})}}};function W(e,t,r,s,i,c){return n.openBlock(),n.createBlock(n.resolveDynamicComponent(e.tag),n.mergeProps({class:s.classes},e.$attrs),{default:n.withCtx(()=>[n.renderSlot(e.$slots,"default")]),_:3},16,["class"])}var F=g(D,[["render",W]]);const M={mixins:[B(),h("border"),C(),N()],setup(e){return{computedClasses:n.computed(()=>{const r={width:e.size==="2xs"?"w-2":e.size==="xs"?"w-3":e.size==="sm"?"w-4":e.size==="md"?"w-5":"w-6",height:e.size==="2xs"?"h-2":e.size==="xs"?"h-3":e.size==="sm"?"h-4":e.size==="md"?"h-5":"h-6",backgroundColor:I(e.variant,e.filter).backgroundColor,border:e.border?"border border-white":"",display:"inline-block",borderRadius:"rounded-full"};return d([a({},r)])})}}};function G(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("span",{class:n.normalizeClass(s.computedClasses)},null,2)}var O=g(M,[["render",G]]);const q={mixins:[C("sm",["sm","lg"])],inheritAttrs:!1,setup(e){function t(s){return s[e.size]}return{computedClasses:n.computed(()=>{const s={input:{position:"absolute",opacity:"opacity-0",width:t({sm:"w-8",lg:"w-10"}),height:t({sm:"h-4",lg:"h-5"}),cursor:"cursor-pointer",peer:"peer"},span:{display:"flex items-center",alignItems:"peer-checked:justify-end",width:t({sm:"w-8",lg:"w-10"}),height:t({sm:"h-4",lg:"h-5"}),borderRadius:"rounded-full",backgroundColor:"bg-secondary-300 peer-checked:bg-success",borderWidth:"border",borderColor:"border-secondary-200 peer-checked:border-success-100",ringWidth:"peer-focus:ring-2",ringOffset:"peer-focus:ring-offset-2",ringColor:"peer-focus:ring-success",paddigX:"px-0.5"},spanBefore:{width:t({sm:"before:w-3",lg:"before:w-4"}),height:t({sm:"before:h-3",lg:"before:h-4"}),borderRadius:"before:rounded-full",backgroundColor:"before:bg-white",borderWidth:"before:border",borderColor:"before:border-secondary-200 peer-checked:before:border-success-100"}};return{input:d([a({},s.input)]),span:d([a({},s.span),a({},s.spanBefore)])}})}}},K={class:"container"};function H(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("div",K,[n.createElementVNode("input",n.mergeProps({type:"checkbox",class:s.computedClasses.input},e.$attrs),null,16),n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.span)},null,2)])}var X=g(q,[["render",H]]);const Y={mixins:[C("sm",["sm","md","lg"])],inheritAttrs:!1,props:{state:{type:[String,Boolean,null],default:null,validator(e){return[null,"warning",!0,!1].includes(e)}}},setup(e){function t(s){return s[e.size]}return{computedClasses:n.computed(()=>{const s={input:{position:"absolute",opacity:"opacity-0",width:t({sm:"w-4",md:"w-5",lg:"w-6"}),height:t({sm:"h-4",md:"h-5",lg:"h-6"}),peer:"peer"},span:{width:t({sm:"w-4",md:"w-5",lg:"w-6"}),height:t({sm:"h-4",md:"h-5",lg:"h-6"}),display:"flex items-center justify-center",borderWidth:t({sm:"border-1.5",md:"border-2",lg:"border-2.5"}),borderColor:e.state===null?"border-primary":e.state==="warning"?"border-warning":e.state===!0?"border-success":"border-danger",borderRadius:"rounded-full",backgroundColor:"bg-white",ringWidth:e.size==="sm"?"peer-focus:ring-1":"peer-focus:ring-2",ringOffset:"peer-focus:ring-offset-2",ringColor:e.state===null?"peer-focus:ring-primary":e.state==="warning"?"peer-focus:ring-warning":e.state===!0?"peer-focus:ring-success":"peer-focus:ring-danger"},spanBefore:{width:t({sm:"before:w-2",md:"before:w-2.5",lg:"before:w-3"}),height:t({sm:"before:h-2",md:"before:h-2.5",lg:"before:h-3"}),borderRadius:"before:rounded-full",backgroundColor:"before:bg-white",backgroundColorChecked:e.state===null?"peer-checked:before:bg-primary":e.state==="warning"?"peer-checked:before:bg-warning":e.state===!0?"peer-checked:before:bg-success":"peer-checked:before:bg-danger"}};return{input:d([a({},s.input)]),span:d([a({},s.span),a({},s.spanBefore)])}})}}},v={class:"container"};function J(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("div",v,[n.createElementVNode("input",n.mergeProps({type:"radio",class:s.computedClasses.input},e.$attrs),null,16),n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.span)},null,2)])}var Q=g(Y,[["render",J]]);const U={mixins:[k("alignTabs","left",["left","center","right"]),k("alignContent","left",["left","center","right"]),h("stretch")],setup(e,{slots:t}){const r=n.ref(t.default().map(l=>l.props));let s=r.value.findIndex(l=>l.active!==void 0);s=s===-1?!1:s;let i=n.ref(r.value[s||0].title);const c=n.ref([]);n.provide("selectedTitle",i);function f(l,y){let u=null;l.keyCode===39&&this.tabProps.length>y+1&&(u=y+1),l.keyCode===37&&y-1>=0&&(u=y-1),l.keyCode===36&&(u=0),l.keyCode===35&&(u=this.tabProps.length-1),u!==null&&this.tabProps[u].disabled===void 0&&(this.selectedTitle=this.tabProps[u].title,c.value[u].focus())}const b=n.computed(()=>{const l={width:"w-full",display:"flex",margin:"mb-8",flexWrap:"flex-wrap",alingItems:"items-center",justifyContent:e.alignTabs==="left"?"justify-start":e.alignTabs==="center"?"justify-center":"justify-end"},y={lineHeight:"leading-5",fontSize:"text-base",fontWeight:"font-semibold",position:"relative",margin:"mb-2",flexGrow:e.stretch?"flex-grow":"",disabled:"disabled:text-secondary-300",after:"after:w-full after:h-0.5 after:absolute after:-bottom-2 after:left-0 after:inline-block after:rounded-full after:bg-transparent"},u=e.alignContent==="left"?"text-left":e.alignContent==="center"?"text-center":"text-right",S="text-primary after:bg-primary",Pe="text-secondary-500",Ne="w-full",Ie="px-4";return{tabContainer:d([a({},l)]),tab:d([a({},y)]),panel:u,activeTab:S,defaultTab:Pe,tabMenuContainer:Ne,tabText:Ie}});return{tabProps:r,selectedTitle:i,elements:c,computedClasses:b,handleKeyEvents:f}}},Z=["tabindex","aria-selected","disabled","onClick","onKeydown"];function ee(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.computedClasses.tabMenuContainer)},[n.createElementVNode("div",{class:n.normalizeClass(s.computedClasses.tabContainer),role:"tablist"},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.tabProps,(f,b)=>(n.openBlock(),n.createElementBlock("button",{key:f.title,ref_for:!0,ref:l=>s.elements[b]=l,role:"tab",tabindex:s.selectedTitle===f.title?"0":"-1","aria-selected":s.selectedTitle===f.title,disabled:f.disabled!==void 0,class:n.normalizeClass([s.computedClasses.tab,s.selectedTitle===f.title?s.computedClasses.activeTab:s.computedClasses.defaultTab]),onClick:l=>s.selectedTitle=f.title,onKeydown:l=>s.handleKeyEvents(l,b)},[n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.tabText)},n.toDisplayString(f.title),3)],42,Z))),128))],2),n.createElementVNode("div",{class:n.normalizeClass(s.computedClasses.panel)},[n.renderSlot(e.$slots,"default")],2)],2)}var te=g(U,[["render",ee]]);const ne={mixins:[k("title","Title"),h("active"),h("disabled")],setup(){return{selectedTitle:n.inject("selectedTitle")}}},se={role:"tabpanel",tabindex:"0"};function re(e,t,r,s,i,c){return n.withDirectives((n.openBlock(),n.createElementBlock("div",se,[n.renderSlot(e.$slots,"default")],512)),[[n.vShow,e.title==s.selectedTitle]])}var ie=g(ne,[["render",re]]);const oe=()=>{},le=Array.isArray,ae=e=>typeof e=="function",ce=e=>typeof e=="symbol";let de;function fe(e,t){t=t||de,t&&t.active&&t.effects.push(e)}const ue=e=>{const t=new Set(e);return t.w=0,t.n=0,t},E=e=>(e.w&p)>0,L=e=>(e.n&p)>0,me=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=p},be=e=>{const{deps:t}=e;if(t.length){let r=0;for(let s=0;s<t.length;s++){const i=t[s];E(i)&&!L(i)?i.delete(e):t[r++]=i,i.w&=~p,i.n&=~p}t.length=r}};let _=0,p=1;const T=30,x=[];let w;class ge{constructor(t,r=null,s){this.fn=t,this.scheduler=r,this.active=!0,this.deps=[],fe(this,s)}run(){if(!this.active)return this.fn();if(!x.includes(this))try{return x.push(w=this),he(),p=1<<++_,_<=T?me(this):A(this),this.fn()}finally{_<=T&&be(this),p=1<<--_,pe(),x.pop();const t=x.length;w=t>0?x[t-1]:void 0}}stop(){this.active&&(A(this),this.onStop&&this.onStop(),this.active=!1)}}function A(e){const{deps:t}=e;if(t.length){for(let r=0;r<t.length;r++)t[r].delete(e);t.length=0}}let $=!0;const R=[];function he(){R.push($),$=!0}function pe(){const e=R.pop();$=e===void 0?!0:e}function ye(){return $&&w!==void 0}function we(e,t){let r=!1;_<=T?L(e)||(e.n|=p,r=!E(e)):r=!e.has(w),r&&(e.add(w),w.deps.push(e))}function ke(e,t){for(const r of le(e)?e:[...e])(r!==w||r.allowRecurse)&&(r.scheduler?r.scheduler():r.run())}new Set(Object.getOwnPropertyNames(Symbol).map(e=>Symbol[e]).filter(ce));function z(e){const t=e&&e.__v_raw;return t?z(t):e}function Ce(e){ye()&&(e=z(e),e.dep||(e.dep=ue()),we(e.dep))}function _e(e,t){e=z(e),e.dep&&ke(e.dep)}class xe{constructor(t,r,s){this._setter=r,this.dep=void 0,this._dirty=!0,this.__v_isRef=!0,this.effect=new ge(t,()=>{this._dirty||(this._dirty=!0,_e(this))}),this.__v_isReadonly=s}get value(){const t=z(this);return Ce(t),t._dirty&&(t._dirty=!1,t._value=t.effect.run()),t._value}set value(t){this._setter(t)}}function $e(e,t){let r,s;const i=ae(e);return i?(r=e,s=oe):(r=e.get,s=e.set),new xe(r,s,i||!s)}Promise.resolve();const ze={mixins:[k("name",!0),h("fill"),h("line"),C("none",["lg","xl","xxs","xs","sm","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x","fw","fwh","none"])],setup(e){return{classes:$e(()=>[`ri-${e.name}${e.fill?"-fill":""}${e.line?"-line":""}`,e.size!=="none"?`ri-${e.size}`:""])}}};function Te(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("i",n.mergeProps({class:s.classes},e.$attrs),null,16)}var V=g(ze,[["render",Te]]);const Se={components:{LuiIcon:V},mixins:[k("title","title"),h("active"),h("disabled")],setup(e){let t=n.inject("activeAccordion",n.ref(null)),r=n.computed(()=>t.value===e.title);function s(){t.value!==e.title?t.value=e.title:t.value=""}let i=n.ref(!1);const c=n.computed(()=>{const f={wrapper:{width:"w-full",border:"border",borderColor:e.disabled?"border-secondary-100":"border-secondary-200",borderRadius:"rounded-2xl",paddingY:"py-8",paddingX:"px-6",margin:"mb-7",focus:i.value?"ring-2 ring-primary ring-offset-2":""},button:{width:"w-full",display:"flex",alignItems:"items-center",justifyContent:"justify-between",disabled:"text-secondary-700 disabled:text-secondary-300",outline:"outline-none"},title:{fontSize:"text-lg",fontWeight:"font-semibold",lineHeight:"leading-6"},icon:{fontSize:"text-2xl"},content:{marginTop:"mt-6",fontColor:"text-secondary-600"}},{wrapper:b,button:l,title:y,icon:u,content:S}=f;return{wrapper:d([a({},b)]),button:d([a({},l)]),title:d([a({},y)]),icon:d([a({},u)]),content:d([a({},S)])}});return{expandItem:s,isActive:r,computedClasses:c,btnFocus:i}}},Be=["aria-expanded","disabled"];function Ee(e,t,r,s,i,c){const f=n.resolveComponent("lui-icon");return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(s.computedClasses.wrapper)},[n.createElementVNode("h3",null,[n.createElementVNode("button",{"aria-expanded":s.isActive,disabled:e.disabled,class:n.normalizeClass(s.computedClasses.button),onClick:t[0]||(t[0]=(...b)=>s.expandItem&&s.expandItem(...b)),onFocus:t[1]||(t[1]=b=>s.btnFocus=!0),onFocusout:t[2]||(t[2]=b=>s.btnFocus=!1)},[n.createElementVNode("span",{class:n.normalizeClass(s.computedClasses.title)},n.toDisplayString(e.title),3),n.createVNode(f,{name:s.isActive?"close":"add",line:"",class:n.normalizeClass(s.computedClasses.icon)},null,8,["name","class"])],42,Be)]),s.isActive?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(s.computedClasses.content),role:"region",tabindex:"0"},[n.renderSlot(e.$slots,"default")],2)):n.createCommentVNode("",!0)],2)}var Le=g(Se,[["render",Ee]]);const Ae={setup(){let e=n.ref(null);n.provide("activeAccordion",e)}},Re={ref:"LuiAccordionGroup",class:"accordionGroup"};function Ve(e,t,r,s,i,c){return n.openBlock(),n.createElementBlock("div",Re,[n.renderSlot(e.$slots,"default")],512)}var je=g(Ae,[["render",Ve]]);o.LuiAccordion=Le,o.LuiAccordionGroup=je,o.LuiBadge=O,o.LuiIcon=V,o.LuiRadio=Q,o.LuiSwitch=X,o.LuiTab=ie,o.LuiTabs=te,o.LuiText=F,Object.defineProperty(o,"__esModule",{value:!0}),o[Symbol.toStringTag]="Module"}); |
{ | ||
"name": "lvjst", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "vite", |
Sorry, the diff of this file is not supported yet
177182
1392