Comparing version 0.0.12 to 0.0.13
@@ -17,3 +17,3 @@ var __defProp = Object.defineProperty; | ||
}; | ||
import { computed, 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 } from "vue"; | ||
var index = ""; | ||
@@ -114,3 +114,3 @@ function variant(name, defaultValue) { | ||
}; | ||
const _sfc_main$5 = { | ||
const _sfc_main$6 = { | ||
mixins: [ | ||
@@ -158,3 +158,3 @@ string("tag", "p", [ | ||
setup(props) { | ||
const classes = computed(() => { | ||
const classes = computed$1(() => { | ||
const styles = { | ||
@@ -172,3 +172,3 @@ fontColor: `text-${props.variant}-600`, | ||
}; | ||
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), mergeProps({ class: $setup.classes }, _ctx.$attrs), { | ||
@@ -181,7 +181,7 @@ default: withCtx(() => [ | ||
} | ||
var LuiText = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); | ||
const _sfc_main$4 = { | ||
var LuiText = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]); | ||
const _sfc_main$5 = { | ||
mixins: [variant(), boolean("border"), size(), filter()], | ||
setup(props) { | ||
const computedClasses = computed(() => { | ||
const computedClasses = computed$1(() => { | ||
const classes = { | ||
@@ -200,3 +200,3 @@ width: props.size === "2xs" ? "w-2" : props.size === "xs" ? "w-3" : props.size === "sm" ? "w-4" : props.size === "md" ? "w-5" : "w-6", | ||
}; | ||
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("span", { | ||
@@ -206,4 +206,4 @@ class: normalizeClass($setup.computedClasses) | ||
} | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]); | ||
const _sfc_main$3 = { | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]); | ||
const _sfc_main$4 = { | ||
mixins: [size("sm", ["sm", "lg"])], | ||
@@ -215,3 +215,3 @@ inheritAttrs: false, | ||
} | ||
const computedClasses = computed(() => { | ||
const computedClasses = computed$1(() => { | ||
const classes = { | ||
@@ -258,3 +258,3 @@ input: { | ||
const _hoisted_1$3 = { class: "container" }; | ||
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$3, [ | ||
@@ -270,4 +270,4 @@ createElementVNode("input", mergeProps({ | ||
} | ||
var LuiSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); | ||
const _sfc_main$2 = { | ||
var LuiSwitch = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]); | ||
const _sfc_main$3 = { | ||
mixins: [size("sm", ["sm", "md", "lg"])], | ||
@@ -288,3 +288,3 @@ inheritAttrs: false, | ||
} | ||
const computedClasses = computed(() => { | ||
const computedClasses = computed$1(() => { | ||
const classes = { | ||
@@ -327,3 +327,3 @@ input: { | ||
const _hoisted_1$2 = { class: "container" }; | ||
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1$2, [ | ||
@@ -339,4 +339,4 @@ createElementVNode("input", mergeProps({ | ||
} | ||
var LuiRadio = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); | ||
const _sfc_main$1 = { | ||
var LuiRadio = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); | ||
const _sfc_main$2 = { | ||
mixins: [ | ||
@@ -369,3 +369,3 @@ string("alignTabs", "left", ["left", "center", "right"]), | ||
} | ||
const computedClasses = computed(() => { | ||
const computedClasses = computed$1(() => { | ||
const tabContainer = { | ||
@@ -414,3 +414,3 @@ width: "w-full", | ||
const _hoisted_1$1 = ["tabindex", "aria-selected", "disabled", "onClick", "onKeydown"]; | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", { | ||
@@ -452,4 +452,4 @@ class: normalizeClass($setup.computedClasses.tabMenuContainer) | ||
} | ||
var LuiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); | ||
const _sfc_main = { | ||
var LuiTabs = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); | ||
const _sfc_main$1 = { | ||
mixins: [string("title", "Title"), boolean("active"), boolean("disabled")], | ||
@@ -465,3 +465,3 @@ setup() { | ||
}; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [ | ||
@@ -473,3 +473,251 @@ renderSlot(_ctx.$slots, "default") | ||
} | ||
var LuiTab = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { LuiBadge, LuiRadio, LuiSwitch, LuiTab, LuiTabs, LuiText }; | ||
var LuiTab = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); | ||
const NOOP = () => { | ||
}; | ||
const isArray = Array.isArray; | ||
const isFunction = (val) => typeof val === "function"; | ||
const isSymbol = (val) => typeof val === "symbol"; | ||
let activeEffectScope; | ||
function recordEffectScope(effect, scope) { | ||
scope = scope || activeEffectScope; | ||
if (scope && scope.active) { | ||
scope.effects.push(effect); | ||
} | ||
} | ||
const createDep = (effects) => { | ||
const dep = new Set(effects); | ||
dep.w = 0; | ||
dep.n = 0; | ||
return dep; | ||
}; | ||
const wasTracked = (dep) => (dep.w & trackOpBit) > 0; | ||
const newTracked = (dep) => (dep.n & trackOpBit) > 0; | ||
const initDepMarkers = ({ deps }) => { | ||
if (deps.length) { | ||
for (let i = 0; i < deps.length; i++) { | ||
deps[i].w |= trackOpBit; | ||
} | ||
} | ||
}; | ||
const finalizeDepMarkers = (effect) => { | ||
const { deps } = effect; | ||
if (deps.length) { | ||
let ptr = 0; | ||
for (let i = 0; i < deps.length; i++) { | ||
const dep = deps[i]; | ||
if (wasTracked(dep) && !newTracked(dep)) { | ||
dep.delete(effect); | ||
} else { | ||
deps[ptr++] = dep; | ||
} | ||
dep.w &= ~trackOpBit; | ||
dep.n &= ~trackOpBit; | ||
} | ||
deps.length = ptr; | ||
} | ||
}; | ||
let effectTrackDepth = 0; | ||
let trackOpBit = 1; | ||
const maxMarkerBits = 30; | ||
const effectStack = []; | ||
let activeEffect; | ||
class ReactiveEffect { | ||
constructor(fn, scheduler = null, scope) { | ||
this.fn = fn; | ||
this.scheduler = scheduler; | ||
this.active = true; | ||
this.deps = []; | ||
recordEffectScope(this, scope); | ||
} | ||
run() { | ||
if (!this.active) { | ||
return this.fn(); | ||
} | ||
if (!effectStack.includes(this)) { | ||
try { | ||
effectStack.push(activeEffect = this); | ||
enableTracking(); | ||
trackOpBit = 1 << ++effectTrackDepth; | ||
if (effectTrackDepth <= maxMarkerBits) { | ||
initDepMarkers(this); | ||
} else { | ||
cleanupEffect(this); | ||
} | ||
return this.fn(); | ||
} finally { | ||
if (effectTrackDepth <= maxMarkerBits) { | ||
finalizeDepMarkers(this); | ||
} | ||
trackOpBit = 1 << --effectTrackDepth; | ||
resetTracking(); | ||
effectStack.pop(); | ||
const n = effectStack.length; | ||
activeEffect = n > 0 ? effectStack[n - 1] : void 0; | ||
} | ||
} | ||
} | ||
stop() { | ||
if (this.active) { | ||
cleanupEffect(this); | ||
if (this.onStop) { | ||
this.onStop(); | ||
} | ||
this.active = false; | ||
} | ||
} | ||
} | ||
function cleanupEffect(effect) { | ||
const { deps } = effect; | ||
if (deps.length) { | ||
for (let i = 0; i < deps.length; i++) { | ||
deps[i].delete(effect); | ||
} | ||
deps.length = 0; | ||
} | ||
} | ||
let shouldTrack = true; | ||
const trackStack = []; | ||
function enableTracking() { | ||
trackStack.push(shouldTrack); | ||
shouldTrack = true; | ||
} | ||
function resetTracking() { | ||
const last = trackStack.pop(); | ||
shouldTrack = last === void 0 ? true : last; | ||
} | ||
function isTracking() { | ||
return shouldTrack && activeEffect !== void 0; | ||
} | ||
function trackEffects(dep, debuggerEventExtraInfo) { | ||
let shouldTrack2 = false; | ||
if (effectTrackDepth <= maxMarkerBits) { | ||
if (!newTracked(dep)) { | ||
dep.n |= trackOpBit; | ||
shouldTrack2 = !wasTracked(dep); | ||
} | ||
} else { | ||
shouldTrack2 = !dep.has(activeEffect); | ||
} | ||
if (shouldTrack2) { | ||
dep.add(activeEffect); | ||
activeEffect.deps.push(dep); | ||
} | ||
} | ||
function triggerEffects(dep, debuggerEventExtraInfo) { | ||
for (const effect of isArray(dep) ? dep : [...dep]) { | ||
if (effect !== activeEffect || effect.allowRecurse) { | ||
if (effect.scheduler) { | ||
effect.scheduler(); | ||
} else { | ||
effect.run(); | ||
} | ||
} | ||
} | ||
} | ||
new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol)); | ||
function toRaw(observed) { | ||
const raw = observed && observed["__v_raw"]; | ||
return raw ? toRaw(raw) : observed; | ||
} | ||
function trackRefValue(ref2) { | ||
if (isTracking()) { | ||
ref2 = toRaw(ref2); | ||
if (!ref2.dep) { | ||
ref2.dep = createDep(); | ||
} | ||
{ | ||
trackEffects(ref2.dep); | ||
} | ||
} | ||
} | ||
function triggerRefValue(ref2, newVal) { | ||
ref2 = toRaw(ref2); | ||
if (ref2.dep) { | ||
{ | ||
triggerEffects(ref2.dep); | ||
} | ||
} | ||
} | ||
class ComputedRefImpl { | ||
constructor(getter, _setter, isReadonly) { | ||
this._setter = _setter; | ||
this.dep = void 0; | ||
this._dirty = true; | ||
this.__v_isRef = true; | ||
this.effect = new ReactiveEffect(getter, () => { | ||
if (!this._dirty) { | ||
this._dirty = true; | ||
triggerRefValue(this); | ||
} | ||
}); | ||
this["__v_isReadonly"] = isReadonly; | ||
} | ||
get value() { | ||
const self = toRaw(this); | ||
trackRefValue(self); | ||
if (self._dirty) { | ||
self._dirty = false; | ||
self._value = self.effect.run(); | ||
} | ||
return self._value; | ||
} | ||
set value(newValue) { | ||
this._setter(newValue); | ||
} | ||
} | ||
function computed(getterOrOptions, debugOptions) { | ||
let getter; | ||
let setter; | ||
const onlyGetter = isFunction(getterOrOptions); | ||
if (onlyGetter) { | ||
getter = getterOrOptions; | ||
setter = NOOP; | ||
} else { | ||
getter = getterOrOptions.get; | ||
setter = getterOrOptions.set; | ||
} | ||
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter); | ||
return cRef; | ||
} | ||
Promise.resolve(); | ||
const _sfc_main = { | ||
mixins: [ | ||
string("name", true), | ||
boolean("fill"), | ||
boolean("line"), | ||
size("none", [ | ||
"lg", | ||
"xl", | ||
"xxs", | ||
"xs", | ||
"sm", | ||
"1x", | ||
"2x", | ||
"3x", | ||
"4x", | ||
"5x", | ||
"6x", | ||
"7x", | ||
"8x", | ||
"9x", | ||
"10x", | ||
"fw", | ||
"fwh", | ||
"none" | ||
]) | ||
], | ||
setup(props) { | ||
const classes = computed(() => { | ||
return [ | ||
`ri-${props.name}${props.fill ? "-fill" : ""}${props.line ? "-line" : ""}`, | ||
props.size !== "none" ? `ri-${props.size}` : "" | ||
]; | ||
}); | ||
return { classes }; | ||
} | ||
}; | ||
function _sfc_render(_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 }; |
@@ -1,1 +0,1 @@ | ||
var Y=Object.defineProperty;var k=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var _=(i,t,l)=>t in i?Y(i,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):i[t]=l,c=(i,t)=>{for(var l in t||(t={}))Z.call(t,l)&&_(i,l,t[l]);if(k)for(var l of k(t))v.call(t,l)&&_(i,l,t[l]);return i};(function(i,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.LuiVue={},i.Vue))})(this,function(i,t){"use strict";var l="";function y(e,s){return{props:{[e||"variant"]:{type:String,default:s||"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 x(e){return{props:{[e||"filter"]:{type:String,default:"none",validator(s){return["darker","lighter","none"].includes(s)}}}}}function h(e,s){const n=s||["2xs","xs","sm","md","lg"];return{props:{size:{type:String,default:e||"md",validator:o=>n.includes(o)}}}}function p(e,s){return{props:{[e]:{type:Boolean,default:s||!1}}}}function C(e,s,r){let n={type:String,default:s||"none"};return r!==void 0&&(n.validator=o=>r.includes(o)),{props:{[e]:n}}}function u(e){const s=[];return e.map(r=>{s.push(...Object.values(r))}),s.join(" ").toString().replace(/\s+/g," ")}function z(e,s){const r=s==="none"?`bg-${e}`:s==="darker"?`bg-${e}-800`:`bg-${e}-100`,n=s==="none"?"text-white":s==="darker"?`text-${e}-100`:`text-${e}-800`;return{backgroundColor:r,fontColor:n}}var m=(e,s)=>{const r=e.__vccOpts||e;for(const[n,o]of s)r[n]=o;return r};const T={mixins:[C("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"]),h("md",["xs","sm","md","lg"]),y("variant","secondary")],setup(e){return{classes:t.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 u([c({},r)])})}}};function $(e,s,r,n,o,b){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),t.mergeProps({class:n.classes},e.$attrs),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["class"])}var B=m(T,[["render",$]]);const S={mixins:[y(),p("border"),h(),x()],setup(e){return{computedClasses:t.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:z(e.variant,e.filter).backgroundColor,border:e.border?"border border-white":"",display:"inline-block",borderRadius:"rounded-full"};return u([c({},r)])})}}};function E(e,s,r,n,o,b){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(n.computedClasses)},null,2)}var L=m(S,[["render",E]]);const j={mixins:[h("sm",["sm","lg"])],inheritAttrs:!1,setup(e){function s(n){return n[e.size]}return{computedClasses:t.computed(()=>{const n={input:{position:"absolute",opacity:"opacity-0",width:s({sm:"w-8",lg:"w-10"}),height:s({sm:"h-4",lg:"h-5"}),cursor:"cursor-pointer",peer:"peer"},span:{display:"flex items-center",alignItems:"peer-checked:justify-end",width:s({sm:"w-8",lg:"w-10"}),height:s({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:s({sm:"before:w-3",lg:"before:w-4"}),height:s({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:u([c({},n.input)]),span:u([c({},n.span),c({},n.spanBefore)])}})}}},P={class:"container"};function V(e,s,r,n,o,b){return t.openBlock(),t.createElementBlock("div",P,[t.createElementVNode("input",t.mergeProps({type:"checkbox",class:n.computedClasses.input},e.$attrs),null,16),t.createElementVNode("span",{class:t.normalizeClass(n.computedClasses.span)},null,2)])}var N=m(j,[["render",V]]);const R={mixins:[h("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 s(n){return n[e.size]}return{computedClasses:t.computed(()=>{const n={input:{position:"absolute",opacity:"opacity-0",width:s({sm:"w-4",md:"w-5",lg:"w-6"}),height:s({sm:"h-4",md:"h-5",lg:"h-6"}),peer:"peer"},span:{width:s({sm:"w-4",md:"w-5",lg:"w-6"}),height:s({sm:"h-4",md:"h-5",lg:"h-6"}),display:"flex items-center justify-center",borderWidth:s({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:s({sm:"before:w-2",md:"before:w-2.5",lg:"before:w-3"}),height:s({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:u([c({},n.input)]),span:u([c({},n.span),c({},n.spanBefore)])}})}}},W={class:"container"};function O(e,s,r,n,o,b){return t.openBlock(),t.createElementBlock("div",W,[t.createElementVNode("input",t.mergeProps({type:"radio",class:n.computedClasses.input},e.$attrs),null,16),t.createElementVNode("span",{class:t.normalizeClass(n.computedClasses.span)},null,2)])}var q=m(R,[["render",O]]);const K={mixins:[C("alignTabs","left",["left","center","right"]),C("alignContent","left",["left","center","right"]),p("stretch")],setup(e,{slots:s}){const r=t.ref(s.default().map(a=>a.props));let n=r.value.findIndex(a=>a.active!==void 0);n=n===-1?!1:n;let o=t.ref(r.value[n||0].title);const b=t.ref([]);t.provide("selectedTitle",o);function f(a,g){let d=null;a.keyCode===39&&this.tabProps.length>g+1&&(d=g+1),a.keyCode===37&&g-1>=0&&(d=g-1),a.keyCode===36&&(d=0),a.keyCode===35&&(d=this.tabProps.length-1),d!==null&&this.tabProps[d].disabled===void 0&&(this.selectedTitle=this.tabProps[d].title,b.value[d].focus())}const w=t.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"},g={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"},d=e.alignContent==="left"?"text-left":e.alignContent==="center"?"text-center":"text-right",X="text-primary after:bg-primary",J="text-secondary-500",Q="w-full",U="px-4";return{tabContainer:u([c({},a)]),tab:u([c({},g)]),panel:d,activeTab:X,defaultTab:J,tabMenuContainer:Q,tabText:U}});return{tabProps:r,selectedTitle:o,elements:b,computedClasses:w,handleKeyEvents:f}}},M=["tabindex","aria-selected","disabled","onClick","onKeydown"];function A(e,s,r,n,o,b){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(n.computedClasses.tabMenuContainer)},[t.createElementVNode("div",{class:t.normalizeClass(n.computedClasses.tabContainer),role:"tablist"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.tabProps,(f,w)=>(t.openBlock(),t.createElementBlock("button",{key:f.title,ref_for:!0,ref:a=>n.elements[w]=a,role:"tab",tabindex:n.selectedTitle===f.title?"0":"-1","aria-selected":n.selectedTitle===f.title,disabled:f.disabled!==void 0,class:t.normalizeClass([n.computedClasses.tab,n.selectedTitle===f.title?n.computedClasses.activeTab:n.computedClasses.defaultTab]),onClick:a=>n.selectedTitle=f.title,onKeydown:a=>n.handleKeyEvents(a,w)},[t.createElementVNode("span",{class:t.normalizeClass(n.computedClasses.tabText)},t.toDisplayString(f.title),3)],42,M))),128))],2),t.createElementVNode("div",{class:t.normalizeClass(n.computedClasses.panel)},[t.renderSlot(e.$slots,"default")],2)],2)}var D=m(K,[["render",A]]);const I={mixins:[C("title","Title"),p("active"),p("disabled")],setup(){return{selectedTitle:t.inject("selectedTitle")}}},H={role:"tabpanel",tabindex:"0"};function F(e,s,r,n,o,b){return t.withDirectives((t.openBlock(),t.createElementBlock("div",H,[t.renderSlot(e.$slots,"default")],512)),[[t.vShow,e.title==n.selectedTitle]])}var G=m(I,[["render",F]]);i.LuiBadge=L,i.LuiRadio=q,i.LuiSwitch=N,i.LuiTab=G,i.LuiTabs=D,i.LuiText=B,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"}); | ||
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"}); |
{ | ||
"name": "lvjst", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "vite", |
169915
1261