Comparing version 0.0.9 to 0.0.10
@@ -17,3 +17,3 @@ var __defProp = Object.defineProperty; | ||
}; | ||
import { computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass } from "vue"; | ||
import { computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, withCtx, renderSlot, createElementBlock, normalizeClass, createElementVNode } from "vue"; | ||
var index = ""; | ||
@@ -114,3 +114,3 @@ function variant(name, defaultValue) { | ||
}; | ||
const _sfc_main$1 = { | ||
const _sfc_main$2 = { | ||
mixins: [ | ||
@@ -171,3 +171,3 @@ string("tag", "p", [ | ||
}; | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$2(_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$1, [["render", _sfc_render$1]]); | ||
const _sfc_main = { | ||
var LuiText = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); | ||
const _sfc_main$1 = { | ||
mixins: [variant(), boolean("border"), size(), filter()], | ||
@@ -199,3 +199,3 @@ setup(props) { | ||
}; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("span", { | ||
@@ -205,3 +205,69 @@ class: normalizeClass($setup.computedClasses) | ||
} | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { LuiBadge, LuiText }; | ||
var LuiBadge = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]); | ||
const _sfc_main = { | ||
mixins: [size("sm", ["sm", "md", "lg"])], | ||
inheritAttrs: false, | ||
props: { | ||
state: { | ||
type: [String, Boolean, null], | ||
default: null, | ||
validator(value) { | ||
return [null, "warning", true, false].includes(value); | ||
} | ||
} | ||
}, | ||
setup(props) { | ||
function findSize(sizes) { | ||
return sizes[props.size]; | ||
} | ||
const computedClasses = computed(() => { | ||
const classes = { | ||
input: { | ||
position: "absolute", | ||
opacity: "opacity-0", | ||
width: findSize({ sm: "w-4", md: "w-5", lg: "w-6" }), | ||
height: findSize({ sm: "h-4", md: "h-5", lg: "h-6" }), | ||
peer: "peer" | ||
}, | ||
span: { | ||
width: findSize({ sm: "w-4", md: "w-5", lg: "w-6" }), | ||
height: findSize({ sm: "h-4", md: "h-5", lg: "h-6" }), | ||
display: "flex items-center justify-center", | ||
borderWidth: findSize({ sm: "border-1.5", md: "border-2", lg: "border-2.5" }), | ||
borderColor: props.state === null ? "border-primary" : props.state === "warning" ? "border-warning" : props.state === true ? "border-success" : "border-danger", | ||
borderRadius: "rounded-full", | ||
backgroundColor: "bg-white", | ||
ringWidth: props.size === "sm" ? "peer-focus:ring-1" : "peer-focus:ring-2", | ||
ringOffset: "peer-focus:ring-offset-2", | ||
ringColor: props.state === null ? "peer-focus:ring-primary" : props.state === "warning" ? "peer-focus:ring-warning" : props.state === true ? "peer-focus:ring-success" : "peer-focus:ring-danger" | ||
}, | ||
spanBefore: { | ||
width: findSize({ sm: "before:w-2", md: "before:w-2.5", lg: "before:w-3" }), | ||
height: findSize({ sm: "before:h-2", md: "before:h-2.5", lg: "before:h-3" }), | ||
borderRadius: "before:rounded-full", | ||
backgroundColor: "before:bg-white", | ||
backgroundColorChecked: props.state === null ? "peer-checked:before:bg-primary" : props.state === "warning" ? "peer-checked:before:bg-warning" : props.state === true ? "peer-checked:before:bg-success" : "peer-checked:before:bg-danger" | ||
} | ||
}; | ||
return { | ||
input: generateClasses([__spreadValues({}, classes.input)]), | ||
span: generateClasses([__spreadValues({}, classes.span), __spreadValues({}, classes.spanBefore)]) | ||
}; | ||
}); | ||
return { computedClasses }; | ||
} | ||
}; | ||
const _hoisted_1 = { class: "container" }; | ||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { | ||
return openBlock(), createElementBlock("div", _hoisted_1, [ | ||
createElementVNode("input", mergeProps({ | ||
type: "radio", | ||
class: $setup.computedClasses.input | ||
}, _ctx.$attrs), null, 16), | ||
createElementVNode("span", { | ||
class: normalizeClass($setup.computedClasses.span) | ||
}, null, 2) | ||
]); | ||
} | ||
var LuiSwitch = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); | ||
export { LuiBadge, LuiSwitch, LuiText }; |
@@ -1,1 +0,1 @@ | ||
var S=Object.defineProperty;var m=Object.getOwnPropertySymbols;var v=Object.prototype.hasOwnProperty,B=Object.prototype.propertyIsEnumerable;var g=(r,t,o)=>t in r?S(r,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[t]=o,d=(r,t)=>{for(var o in t||(t={}))v.call(t,o)&&g(r,o,t[o]);if(m)for(var o of m(t))B.call(t,o)&&g(r,o,t[o]);return r};(function(r,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(r=typeof globalThis!="undefined"?globalThis:r||self,t(r.LuiVue={},r.Vue))})(this,function(r,t){"use strict";var o="";function c(e,n){return{props:{[e||"variant"]:{type:String,default:n||"primary",validator(s){return(e==="variant"?["primary","secondary","info","success","warning","danger"]:["light","dark","white","black","primary","secondary","info","success","warning","danger"]).includes(s)}}}}}function b(e){return{props:{[e||"filter"]:{type:String,default:"none",validator(n){return["darker","lighter","none"].includes(n)}}}}}function l(e,n){const i=n||["2xs","xs","sm","md","lg"];return{props:{size:{type:String,default:e||"md",validator:a=>i.includes(a)}}}}function p(e,n){return{props:{[e]:{type:Boolean,default:n||!1}}}}function x(e,n,s){let i={type:String,default:n||"none"};return s!==void 0&&(i.validator=a=>s.includes(a)),{props:{[e]:i}}}function u(e){const n=[];return e.map(s=>{n.push(...Object.values(s))}),n.join(" ").toString().replace(/\s+/g," ")}function h(e,n){const s=n==="none"?`bg-${e}`:n==="darker"?`bg-${e}-800`:`bg-${e}-100`,i=n==="none"?"text-white":n==="darker"?`text-${e}-100`:`text-${e}-800`;return{backgroundColor:s,fontColor:i}}var f=(e,n)=>{const s=e.__vccOpts||e;for(const[i,a]of n)s[i]=a;return s};const y={mixins:[x("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"]),l("md",["xs","sm","md","lg"]),c("variant","secondary")],setup(e){return{classes:t.computed(()=>{const s={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([d({},s)])})}}};function z(e,n,s,i,a,C){return t.openBlock(),t.createBlock(t.resolveDynamicComponent(e.tag),t.mergeProps({class:i.classes},e.$attrs),{default:t.withCtx(()=>[t.renderSlot(e.$slots,"default")]),_:3},16,["class"])}var k=f(y,[["render",z]]);const _={mixins:[c(),p("border"),l(),b()],setup(e){return{computedClasses:t.computed(()=>{const s={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:h(e.variant,e.filter).backgroundColor,border:e.border?"border border-white":"",display:"inline-block",borderRadius:"rounded-full"};return u([d({},s)])})}}};function $(e,n,s,i,a,C){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(i.computedClasses)},null,2)}var w=f(_,[["render",$]]);r.LuiBadge=w,r.LuiText=k,Object.defineProperty(r,"__esModule",{value:!0}),r[Symbol.toStringTag]="Module"}); | ||
var O=Object.defineProperty;var m=Object.getOwnPropertySymbols;var T=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var b=(i,t,o)=>t in i?O(i,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[t]=o,d=(i,t)=>{for(var o in t||(t={}))T.call(t,o)&&b(i,o,t[o]);if(m)for(var o of m(t))V.call(t,o)&&b(i,o,t[o]);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 o="";function f(e,r){return{props:{[e||"variant"]:{type:String,default:r||"primary",validator(s){return(e==="variant"?["primary","secondary","info","success","warning","danger"]:["light","dark","white","black","primary","secondary","info","success","warning","danger"]).includes(s)}}}}}function h(e){return{props:{[e||"filter"]:{type:String,default:"none",validator(r){return["darker","lighter","none"].includes(r)}}}}}function l(e,r){const n=r||["2xs","xs","sm","md","lg"];return{props:{size:{type:String,default:e||"md",validator:a=>n.includes(a)}}}}function p(e,r){return{props:{[e]:{type:Boolean,default:r||!1}}}}function w(e,r,s){let n={type:String,default:r||"none"};return s!==void 0&&(n.validator=a=>s.includes(a)),{props:{[e]:n}}}function c(e){const r=[];return e.map(s=>{r.push(...Object.values(s))}),r.join(" ").toString().replace(/\s+/g," ")}function y(e,r){const s=r==="none"?`bg-${e}`:r==="darker"?`bg-${e}-800`:`bg-${e}-100`,n=r==="none"?"text-white":r==="darker"?`text-${e}-100`:`text-${e}-800`;return{backgroundColor:s,fontColor:n}}var u=(e,r)=>{const s=e.__vccOpts||e;for(const[n,a]of r)s[n]=a;return s};const k={mixins:[w("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"]),l("md",["xs","sm","md","lg"]),f("variant","secondary")],setup(e){return{classes:t.computed(()=>{const s={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 c([d({},s)])})}}};function x(e,r,s,n,a,g){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 z=u(k,[["render",x]]);const C={mixins:[f(),p("border"),l(),h()],setup(e){return{computedClasses:t.computed(()=>{const s={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:y(e.variant,e.filter).backgroundColor,border:e.border?"border border-white":"",display:"inline-block",borderRadius:"rounded-full"};return c([d({},s)])})}}};function _(e,r,s,n,a,g){return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass(n.computedClasses)},null,2)}var $=u(C,[["render",_]]);const S={mixins:[l("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 r(n){return n[e.size]}return{computedClasses:t.computed(()=>{const n={input:{position:"absolute",opacity:"opacity-0",width:r({sm:"w-4",md:"w-5",lg:"w-6"}),height:r({sm:"h-4",md:"h-5",lg:"h-6"}),peer:"peer"},span:{width:r({sm:"w-4",md:"w-5",lg:"w-6"}),height:r({sm:"h-4",md:"h-5",lg:"h-6"}),display:"flex items-center justify-center",borderWidth:r({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:r({sm:"before:w-2",md:"before:w-2.5",lg:"before:w-3"}),height:r({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:c([d({},n.input)]),span:c([d({},n.span),d({},n.spanBefore)])}})}}},B={class:"container"};function L(e,r,s,n,a,g){return t.openBlock(),t.createElementBlock("div",B,[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 j=u(S,[["render",L]]);i.LuiBadge=$,i.LuiSwitch=j,i.LuiText=z,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"}); |
{ | ||
"name": "lvjst", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "dev": "vite", |
Sorry, the diff of this file is not supported yet
148143
790