@deck9/ui 0.17.0-next.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -11
- package/dist/Button/Button.vue.d.ts +6 -2
- package/dist/Menu/MenuContainer.vue.d.ts +5 -0
- package/dist/Select/Select.vue.d.ts +18 -5
- package/dist/Spinner/Spinner.vue.d.ts +28 -1
- package/dist/src/ui.mjs +432 -508
- package/dist/src/ui.umd.js +2 -2
- package/package.json +6 -8
package/dist/src/ui.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@fortawesome/vue-fontawesome"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/free-brands-svg-icons"),require("uuid"),require("@vueuse/core"),require("@headlessui/vue"),require("@floating-ui/vue")):typeof define=="function"&&define.amd?define(["exports","vue","@fortawesome/vue-fontawesome","@fortawesome/fontawesome-svg-core","@fortawesome/free-solid-svg-icons","@fortawesome/free-brands-svg-icons","uuid","@vueuse/core","@headlessui/vue","@floating-ui/vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.ui={},i.Vue,i.vueFontawesome,i.fontawesomeSvgCore,i.fasIcons,i.fabIcon,i.uuid,i.VueUse,i.HeadlessUIVue,i.FloatingUIVue))})(this,function(i,e,U,x,j,O,D,R,g,C){"use strict";function S(n){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const l=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(o,r,l.get?l:{enumerable:!0,get:()=>n[r]})}}return o.default=n,Object.freeze(o)}const t=S(j),_=S(O);var L="fas",P="numeric-input",$=512,M=512,E=[],I="",T="m409.445 111 2.112.004c34.066.146 46.74 3.848 59.517 10.681 13.037 6.973 23.268 17.204 30.24 30.241l.415.782c6.705 12.782 10.271 25.9 10.271 60.847v72.002c-.15 34.066-3.852 46.74-10.685 59.517-6.973 13.037-17.204 23.268-30.241 30.24l-.782.415C457.51 382.434 444.392 386 409.445 386h-306.89l-2.112-.004c-34.066-.146-46.74-3.848-59.517-10.681-13.037-6.973-23.268-17.204-30.24-30.241l-.415-.782C3.566 331.51 0 318.392 0 283.445v-69.89c0-35.66 3.713-48.592 10.685-61.629 6.973-13.037 17.204-23.268 30.241-30.24l.782-.415C54.49 114.566 67.608 111 102.555 111h306.89Zm.806 36H102.555l-2.387.005c-22.69.089-31.789 1.488-39.667 5.128l-.523.246c-.696.332-1.385.683-2.074 1.052-6.764 3.617-11.856 8.71-15.473 15.473l-.282.533c-4.492 8.62-6.116 17.401-6.148 43.312v71.502l.012 3.09c.161 24.044 1.9 32.308 6.418 40.755 3.617 6.764 8.71 11.856 15.473 15.473l.533.282c8.62 4.492 17.401 6.116 43.312 6.149h307.696c27.078 0 35.763-1.677 44.651-6.43 6.764-3.618 11.856-8.71 15.473-15.474l.282-.533c4.492-8.62 6.116-17.401 6.149-43.312v-70.696c0-27.078-1.677-35.763-6.43-44.651-3.618-6.764-8.71-11.856-15.474-15.473l-.533-.282c-8.62-4.492-17.401-6.116-43.312-6.149Zm-164.715 19c11.682 0 22.013 1.976 30.994 5.929 8.98 3.952 16.005 9.38 21.074 16.284 5.07 6.904 7.578 14.797 7.527 23.677.103 8.829-2.92 16.066-9.07 21.713-6.15 5.646-13.935 8.983-23.353 10.01v1.231c12.764 1.386 22.362 5.274 28.794 11.665 6.433 6.39 9.598 14.411 9.496 24.061.051 9.24-2.715 17.427-8.299 24.562-5.584 7.135-13.33 12.73-23.236 16.785-9.907 4.055-21.319 6.083-34.236 6.083-12.454 0-23.506-2.143-33.156-6.43-9.65-4.285-17.227-10.201-22.734-17.747-5.506-7.545-8.286-16.22-8.337-26.025h43.23c.051 3.029.99 5.737 2.817 8.124 1.827 2.386 4.336 4.247 7.527 5.582 3.19 1.334 6.845 2.002 10.962 2.002 3.962 0 7.462-.706 10.498-2.118 3.037-1.411 5.404-3.375 7.102-5.89 1.699-2.515 2.522-5.39 2.47-8.623.052-3.183-.913-6.006-2.894-8.47-1.982-2.464-4.748-4.389-8.299-5.775-3.55-1.386-7.642-2.079-12.274-2.079h-16.057v-29.566h16.057c4.271 0 8.041-.693 11.31-2.08 3.267-1.385 5.815-3.31 7.642-5.774s2.714-5.287 2.663-8.47c.051-3.08-.695-5.8-2.239-8.161-1.544-2.361-3.692-4.21-6.446-5.544-2.753-1.334-5.93-2.002-9.533-2.002-3.912 0-7.398.693-10.46 2.08-3.063 1.385-5.468 3.31-7.218 5.774s-2.65 5.287-2.702 8.47h-41.068c.051-9.65 2.715-18.172 7.99-25.563 5.275-7.392 12.518-13.192 21.73-17.401 9.212-4.21 19.788-6.314 31.728-6.314Zm-133.074 0c12.615 0 23.55 2.017 32.807 6.05 9.257 4.033 16.41 9.698 21.462 16.994 5.051 7.296 7.577 15.851 7.577 25.665 0 6.063-1.257 12.087-3.77 18.073-2.512 5.986-7.025 12.601-13.538 19.846-6.513 7.245-15.77 15.877-27.77 25.896l-14.768 12.331v.925H176V326H55.077v-30.829l58.77-48.709c3.897-3.237 7.243-6.28 10.038-9.133 2.794-2.851 4.948-5.793 6.461-8.824 1.513-3.032 2.27-6.397 2.27-10.097 0-4.059-.86-7.527-2.578-10.404-1.717-2.877-4.09-5.1-7.115-6.667-3.026-1.567-6.513-2.35-10.461-2.35-3.95 0-7.424.796-10.424 2.389-3 1.593-5.32 3.93-6.961 7.013-1.641 3.083-2.462 6.834-2.462 11.253H52c0-11.099 2.487-20.655 7.462-28.67 4.974-8.016 12-14.182 21.076-18.498 9.077-4.316 19.718-6.474 31.924-6.474Z";const F={prefix:L,iconName:P,icon:[$,M,E,I,T]},q={definition:F,faAlignJustify:F,prefix:L,iconName:P,width:$,height:M,ligatures:E,unicode:I,svgPathData:T,aliases:E};x.library.add(t.faAlignCenter,t.faAlignLeft,t.faAlignRight,t.faArrowRight,t.faArrowUp19,t.faAsterisk,t.faAt,t.faBold,t.faBolt,t.faCalendar,t.faChartPie,t.faCheck,t.faCheckCircle,t.faChevronDown,t.faChevronLeft,t.faChevronRight,t.faChevronUp,t.faCircleCheck,t.faCircleNodes,t.faCircleNotch,t.faClipboard,t.faCloudDownload,t.faCloudUpload,t.faCode,t.faCodeBranch,t.faCodeFork,t.faCog,t.faCompass,t.faCrown,t.faDiagramProject,t.faDoorOpen,t.faDotCircle,t.faEllipsis,t.faEllipsisVertical,t.faEnvelope,t.faExclamationTriangle,t.faExternalLink,t.faEye,t.faEyeDropper,t.faEyeSlash,t.faFileLines,t.faFilePdf,t.faFileUpload,t.faFileVideo,t.faFileWaveform,t.faFilter,t.faFilter,t.faFingerprint,t.faFont,t.faGears,t.faGlobe,t.faGripHorizontal,t.faGripVertical,t.faHandPointRight,t.faHandPointRight,t.faHashtag,t.faHeading,t.faHeart,t.faImage,t.faInfoCircle,t.faItalic,t.faLayerGroup,t.faLink,t.faLinkSlash,t.faList,t.faListOl,t.faListUl,t.faLocationArrow,t.faLocationCrosshairs,t.faLock,t.faLockOpen,t.faMedal,t.faMessage,t.faMicrochip,t.faPencilAlt,t.faPenToSquare,t.faPhone,t.faPlayCircle,t.faPlus,t.faPlusCircle,t.faPoo,t.faPuzzlePiece,t.faQuestion,t.faQuoteLeft,t.faQuoteRight,t.faReply,t.faReplyAll,t.faRightLong,t.faRobot,t.faSave,t.faShield,t.faSignal,t.faSignature,t.faSignature,t.faSquareCheck,t.faStar,t.faStrikethrough,t.faTerminal,t.faTextSlash,t.faTimes,t.faTrash,t.faTree,t.faTrophy,t.faTurnDown,t.faUnderline,t.faUpload,t.faUser,t.faUserShield,t.faWandMagicSparkles,_.faTwitter,_.faInstagram,_.faGithub,_.faLinkedin,_.faFacebook,q.definition);const A=[...Object.keys(x.library.definitions.fas)].sort(),N=[...Object.keys(x.library.definitions.fab)].sort(),p=e.defineComponent({__name:"Icon",props:{name:{default:"user"}},setup(n){const o=n,r=e.computed(()=>N.includes(o.name)?"fab":"fas"),l=e.computed(()=>A.includes(o.name)||N.includes(o.name)?!0:(console.warn("could not load icon, because it is not available",o.name),!1));return(a,c)=>l.value?(e.openBlock(),e.createBlock(e.unref(U.FontAwesomeIcon),e.mergeProps({key:0,icon:[r.value,a.name]},a.$attrs),null,16,["icon"])):e.createCommentVNode("",!0)}}),G=["aria-label","disabled","aria-busy"],Z={key:0,class:"absolute inset-0 flex items-center justify-center"},Q=e.defineComponent({__name:"Button",props:{label:{},size:{default:"medium"},color:{default:"primary"},isLoading:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},icon:{},iconPosition:{default:"right"}},setup(n){const o=n,r=e.computed(()=>{const a={"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900":o.color==="primary","text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900":o.color==="light","text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900":o.color==="dark","text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900":o.color==="danger"},c={"pointer-events-none opacity-75 cursor-not-allowed":o.isDisabled},d={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":o.size==="small","px-5 py-2 text-sm leading-4 font-medium rounded-lg":o.size==="medium","px-8 py-3 text-base leading-6 font-medium rounded-lg":o.size==="large"};return{...a,...c,...d}}),l=e.computed(()=>{const a={"mr-2 -ml-1":["small","medium"].includes(o.size)&&o.iconPosition==="left","mr-4 -ml-2":["large"].includes(o.size)&&o.iconPosition==="left"},c={"ml-3 -mr-1":["small","medium"].includes(o.size)&&o.iconPosition==="right","ml-3 -mr-3":["large"].includes(o.size)&&o.iconPosition==="right"},d={"text-white":o.color==="primary","text-blue-600":o.color==="light","text-grey-50":o.color==="dark"};return{...a,...c,...d}});return(a,c)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",r.value]),type:"button","aria-label":a.label,disabled:a.isDisabled||a.isLoading,"aria-busy":a.isLoading},[e.createElementVNode("div",{class:e.normalizeClass(!a.isLoading||"invisible")},[a.icon&&a.iconPosition==="left"?(e.openBlock(),e.createBlock(p,{key:0,name:a.icon,class:e.normalizeClass(l.value)},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.label),1),a.icon&&a.iconPosition==="right"?(e.openBlock(),e.createBlock(p,{key:1,name:a.icon,class:e.normalizeClass(l.value)},null,8,["name","class"])):e.createCommentVNode("",!0)],2),a.isLoading?(e.openBlock(),e.createElementBlock("span",Z,[e.createVNode(p,{class:"animate-spin",name:"circle-notch"})])):e.createCommentVNode("",!0)],10,G))}}),W={class:"relative flex items-start"},J=["checked","id"],K={class:"ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed"},X=["for"],Y={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},v={inheritAttrs:!1},ee=e.defineComponent({...v,__name:"Checkbox",props:{id:{default:()=>D.v4()},label:{},modelValue:{type:Boolean},description:{}},emits:["update:modelValue"],setup(n,{emit:o}){const r=o,l=a=>{r("update:modelValue",a.target.checked)};return(a,c)=>(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("input",e.mergeProps({class:"peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"checkbox",checked:a.modelValue,onChange:l,id:a.id},a.$attrs),null,16,J),e.createElementVNode("div",K,[e.createElementVNode("label",{for:a.id,class:"font-medium text-grey-700 dark:text-grey-200 casual-25"},e.toDisplayString(a.label),9,X),a.description?(e.openBlock(),e.createElementBlock("p",Y,e.toDisplayString(a.description),1)):e.createCommentVNode("",!0)])]))}});function z(n){const o=e.computed(()=>({"pl-3 pr-10 py-2":!n.icon&&n.type!=="color"&&n.size==="small","pl-4 pr-10 py-3":!n.icon&&n.type!=="color"&&n.size==="medium","pl-6 pr-10 py-3":!n.icon&&n.type!=="color"&&n.size==="large","pl-10 pr-10 py-1":(n.icon||n.type==="color")&&n.size==="small","pl-12 pr-10 py-3":(n.icon||n.type==="color")&&(n.size==="medium"||n.size==="large"),"w-full block":n.block===!0})),r=e.computed(()=>({"pointer-events-none opacity-50 cursor-not-allowed":n.isDisabled})),l=e.computed(()=>({"text-xs leading-4":n.size==="small","text-sm leading-4":n.size==="medium","text-base leading-5":n.size==="large"}));return{inputClasses:o,disabledClasses:r,textSizeClasses:l}}const te=["placeholder","type","min","max","disabled","value"],oe={class:"absolute inset-y-2 left-2 w-8 cursor-pointer"},ae=["disabled"],ne=["disabled"],le={inheritAttrs:!1},re=e.defineComponent({...le,__name:"Input",props:{modelValue:{},type:{default:"text"},placeholder:{},size:{default:"medium"},icon:{},min:{},max:{},isDisabled:{type:Boolean,default:!1},block:{type:Boolean},showColorPicker:{type:Boolean}},emits:["update:modelValue"],setup(n,{expose:o,emit:r}){const l=n,a=e.ref(null),c=e.ref(l.modelValue??""),d=s=>l.type==="number"&&s!==""&&s!==null?Number(s):s;e.watch(()=>l.modelValue,s=>{typeof s<"u"&&s!==d(c.value)&&(c.value=s)});const b=r,{inputClasses:h,disabledClasses:y,textSizeClasses:B}=z(l),u=e.computed(()=>l.type==="color"?"text":l.type),{isSupported:f,open:H,sRGBHex:m}=R.useEyeDropper(),w=()=>{H()};e.watch(m,s=>{c.value=s,b("update:modelValue",s)});const V=function(s){c.value=(s==null?void 0:s.target).value,b("update:modelValue",d(c.value))},Ae=function(){const s=d(c.value);if(typeof s!="number")return;const k=Math.min(Math.max(s,l.min??-1/0),l.max??1/0);k!==s&&(c.value=k,b("update:modelValue",k))};return o({focus:()=>{var s;l.isDisabled||(s=a.value)==null||s.focus()}}),(s,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative",[s.block?"w-full block":"inline-block"]])},[e.createElementVNode("input",e.mergeProps({class:["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(h),e.unref(B),e.unref(y)]],placeholder:s.placeholder,type:u.value,min:s.min,max:s.max,disabled:s.isDisabled,value:c.value},s.$attrs,{ref_key:"inputElement",ref:a,onInput:V,onChange:Ae}),null,16,te),s.type==="color"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",oe,[e.withDirectives(e.createElementVNode("input",{class:"invisible",type:"color",disabled:s.isDisabled,"onUpdate:modelValue":k[0]||(k[0]=He=>c.value=He),onInput:V},null,40,ae),[[e.vModelText,c.value]]),e.createElementVNode("span",{class:"border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",style:e.normalizeStyle(`background-color: ${c.value}`)},null,4)]),e.unref(f)&&s.showColorPicker?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",disabled:s.isDisabled,onClick:w},[e.createVNode(p,{size:"xs",name:"eyedropper"})],8,ne)):e.createCommentVNode("",!0)],64)):s.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",e.unref(B)])},[e.createVNode(p,{name:s.icon},null,8,["name"])],2)):e.createCommentVNode("",!0)],2))}}),se={class:"inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20"},ie=["id","for"],ce={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},de=e.defineComponent({__name:"Label",props:{id:{},label:{},description:{}},setup(n){return(o,r)=>(e.openBlock(),e.createElementBlock("span",se,[e.createElementVNode("label",{id:o.id?`${o.id}-label`:void 0,for:o.id},e.toDisplayString(o.label),9,ie),o.description?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(o.description),1)):e.createCommentVNode("",!0)]))}}),fe=e.defineComponent({__name:"MenuContainer",props:{position:{default:"left"},usePortal:{type:[Boolean,String],default:!1}},setup(n){const o=n,r=e.ref(null),l=e.ref(null),a=o.position==="left"?"bottom-end":"bottom-start",{floatingStyles:c}=C.useFloating(r,l,{placement:a,whileElementsMounted:C.autoUpdate,middleware:[C.offset(6),C.flip(),C.shift({padding:6})]});return(d,b)=>(e.openBlock(),e.createBlock(e.unref(g.Menu),{as:"div",class:"inline-block text-left"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.MenuButton),{class:"focus:outline-none",ref_key:"reference",ref:r},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"button",{},()=>[e.createVNode(e.unref(p),{class:"fill-current",name:"ellipsis-h"})])]),_:3},512),(e.openBlock(),e.createBlock(e.Teleport,{to:typeof d.usePortal=="string"?d.usePortal:"body",disabled:!d.usePortal},[e.createElementVNode("div",{class:"w-56 z-20",style:e.normalizeStyle(e.unref(c)),ref_key:"floating",ref:l},[e.createVNode(e.Transition,{"enter-active-class":"transition duration-200 ease-in-out","enter-from-class":"transform -translate-y-4 opacity-0","enter-to-class":"transform opacity-100","leave-active-class":"transition duration-100 ease-in-out","leave-from-class":"transform opacity-100","leave-to-class":"transform -translate-y-2 opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.MenuItems),{class:e.normalizeClass(["z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"])},{default:e.withCtx(()=>[e.renderSlot(d.$slots,"default")]),_:3})]),_:3})],4)],8,["to","disabled"]))]),_:3}))}}),me={key:0,class:"bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"},pe=e.defineComponent({__name:"MenuLink",props:{label:{},meta:{},disabled:{type:Boolean},as:{}},setup(n){return(o,r)=>(e.openBlock(),e.createBlock(e.unref(g.MenuItem),e.normalizeProps(e.guardReactiveProps({disabled:o.disabled})),{default:e.withCtx(({active:l})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.as||"span"),{class:e.normalizeClass(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg",[l?"bg-grey-200":"",o.disabled?"opacity-50 pointer-events-none":"hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"]])},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(o.label),1),o.meta?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(o.meta),1)):e.createCommentVNode("",!0)]),_:2},1032,["class"]))]),_:1},16))}}),ue={class:"relative"},ge={key:0,class:"absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},be={key:1,class:"block truncate"},ye=["innerHTML"],he={key:2,class:"text-grey-500 truncate"},ke={class:"absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},Ce={class:"absolute right-2 inset-y-0 flex items-center"},_e={key:0,class:"bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"},Be=["innerHTML"],Ve=e.defineComponent({__name:"Select",props:{id:{},modelValue:{},size:{default:"medium"},icon:{},placeholder:{},isDisabled:{type:Boolean,default:!1},options:{},disabledBadge:{}},emits:["update:modelValue"],setup(n,{emit:o}){const r=n,l=e.ref(r.modelValue??null),a=o,{inputClasses:c,disabledClasses:d,textSizeClasses:b}=z(r),h=e.ref(!1),y=()=>{h.value=!!r.id&&!!document.getElementById(`${r.id}-label`)};e.onMounted(y),e.watch(()=>r.id,y,{flush:"post"});const B=e.computed(()=>h.value?`${r.id}-label ${r.id}`:void 0);e.watch(()=>r.modelValue,f=>{l.value=f??null});const u=f=>{l.value=f,a("update:modelValue",f)};return(f,H)=>(e.openBlock(),e.createBlock(e.unref(g.Listbox),{as:"div","model-value":l.value,"onUpdate:modelValue":u,disabled:f.isDisabled},{default:e.withCtx(()=>[e.createElementVNode("div",ue,[e.createVNode(e.unref(g.ListboxButton),{id:f.id,"aria-labelledby":B.value,class:e.normalizeClass(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left",[e.unref(c),e.unref(b),e.unref(d)]])},{default:e.withCtx(()=>{var m;return[f.icon?(e.openBlock(),e.createElementBlock("span",ge,[e.createVNode(p,{name:((m=l.value)==null?void 0:m.icon)??f.icon},null,8,["name"])])):e.createCommentVNode("",!0),l.value?(e.openBlock(),e.createElementBlock("span",be,[e.createElementVNode("span",{innerHTML:l.value.label},null,8,ye)])):(e.openBlock(),e.createElementBlock("span",he,e.toDisplayString(f.placeholder),1)),e.createElementVNode("span",ke,[e.createVNode(p,{class:"text-grey-400",name:"chevron-down","aria-hidden":"true"})])]}),_:1},8,["id","aria-labelledby","class"]),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(g.ListboxOptions),{class:"absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.options,m=>(e.openBlock(),e.createBlock(e.unref(g.ListboxOption),{as:"template",key:m.id,value:m,disabled:m.disabled},{default:e.withCtx(({active:w,selected:V})=>[e.createElementVNode("li",{class:e.normalizeClass([w?"text-white bg-blue-500":"text-grey-900 dark:text-grey-50","cursor-default select-none relative py-2 pl-3 pr-12",{"opacity-50 bg-grey-100":m.disabled}])},[e.createElementVNode("div",Ce,[m.disabled&&f.disabledBadge?(e.openBlock(),e.createElementBlock("span",_e,e.toDisplayString(f.disabledBadge),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass([V?"font-semibold":"font-normal","block truncate"])},[m.icon?(e.openBlock(),e.createBlock(p,{key:0,class:"inline-block mr-1",name:m.icon},null,8,["name"])):e.createCommentVNode("",!0),e.createElementVNode("span",{innerHTML:m.label},null,8,Be)],2),V?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([w?"text-blue-100":"text-blue-500","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(p,{name:"check",class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value","disabled"]))),128))]),_:1})]),_:1})])]),_:1},8,["model-value","disabled"]))}}),we={class:"animate-pulse"},xe={class:"flex items-center justify-between space-x-4"},Ee={key:0,class:"w-12 h-12 bg-current rounded-full shrink-0"},Ne={key:1,class:"w-full h-8 bg-current rounded-lg"},ze={key:0,class:"mt-6 space-y-2"},De={key:1,class:"w-1/3 h-10 mt-6 bg-current rounded-lg"},Se=e.defineComponent({__name:"Skeleton",props:{avatar:{type:Boolean,default:!1},title:{type:Boolean,default:!0},lines:{default:3},footer:{type:Boolean,default:!1}},setup(n){const o=n,r=new Array(o.lines).fill(void 0).map(()=>{const l=[4,5,6,8,10,16,24,32];return{margin:`mr-${l[Math.floor(Math.random()*l.length)]}`}});return(l,a)=>(e.openBlock(),e.createElementBlock("div",we,[e.createElementVNode("div",xe,[l.avatar?(e.openBlock(),e.createElementBlock("div",Ee)):e.createCommentVNode("",!0),l.title?(e.openBlock(),e.createElementBlock("div",Ne)):e.createCommentVNode("",!0)]),l.lines>0?(e.openBlock(),e.createElementBlock("div",ze,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),(c,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-4 bg-current rounded-lg",c.margin]),key:d},null,2))),128))])):e.createCommentVNode("",!0),l.footer?(e.openBlock(),e.createElementBlock("div",De)):e.createCommentVNode("",!0)]))}}),Le=e.defineComponent({__name:"Spinner",setup(n){return(o,r)=>(e.openBlock(),e.createBlock(e.unref(p),{class:"animate-spin",name:"circle-notch"}))}}),Pe={class:"sr-only"},$e=e.defineComponent({__name:"Switch",props:{id:{default:()=>D.v4()},label:{},modelValue:{type:Boolean},onLabel:{default:"on"},offLabel:{default:"off"}},emits:["update:modelValue","change"],setup(n,{emit:o}){const r=o,l=a=>{r("update:modelValue",a),r("change",a)};return(a,c)=>(e.openBlock(),e.createBlock(e.unref(g.Switch),{id:a.id,modelValue:a.modelValue,class:e.normalizeClass([a.modelValue?"bg-blue-700":"bg-grey-700","relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),"onUpdate:modelValue":l},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["absolute text-xs text-center text-white inset-x-2",a.modelValue?"pr-3":"pl-3"])},e.toDisplayString(a.modelValue===!0?a.onLabel:a.offLabel),3),e.createElementVNode("span",Pe,e.toDisplayString(a.label),1),e.createElementVNode("span",{class:e.normalizeClass([a.modelValue?"translate-x-9":"translate-x-1","inline-block w-4 h-4 transition bg-white rounded-full"])},null,2)]),_:1},8,["id","modelValue","class"]))}}),Me={class:"relative"},Ie=["disabled","value"],Te={inheritAttrs:!1},Fe=e.defineComponent({...Te,__name:"Textarea",props:{modelValue:{},size:{default:"medium"},isDisabled:{type:Boolean,default:!1},block:{type:Boolean}},emits:["update:modelValue"],setup(n,{expose:o,emit:r}){const l=n,a=r,{inputClasses:c,disabledClasses:d,textSizeClasses:b}=z(l),h=function(u){a("update:modelValue",(u==null?void 0:u.target).value)},y=e.ref(null);return o({focus:()=>{l.isDisabled||y.value.focus()}}),(u,f)=>(e.openBlock(),e.createElementBlock("div",Me,[e.createElementVNode("textarea",e.mergeProps({class:["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(c),e.unref(b),e.unref(d)]],disabled:u.isDisabled,value:u.modelValue??""},u.$attrs,{ref_key:"input",ref:y,cols:"56",rows:"8",onInput:h}),`
|
|
2
|
-
`,16,
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/vue-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("uuid"),require("@vueuse/core"),require("@headlessui/vue"),require("@floating-ui/vue")):typeof define=="function"&&define.amd?define(["exports","vue","@fortawesome/fontawesome-svg-core","@fortawesome/vue-fontawesome","@fortawesome/free-solid-svg-icons","uuid","@vueuse/core","@headlessui/vue","@floating-ui/vue"],e):(i=typeof globalThis<"u"?globalThis:i||self,e(i.ui={},i.Vue,i.fontawesomeSvgCore,i.vueFontawesome,i.freeSolidSvgIcons,i.uuid,i.VueUse,i.HeadlessUIVue,i.FloatingUIVue))})(this,function(i,e,x,$,_,E,S,y,V){"use strict";const D=[_.faCheck,_.faChevronDown,_.faCircleNotch,_.faEllipsis,_.faEyeDropper];x.library.add(...D);const L=D.map(({iconName:l})=>l),P=[],g=e.defineComponent({__name:"Icon",props:{name:{default:"user"}},setup(l){const s=l,t=e.computed(()=>{const o=s.name,n=x.findIconDefinition({prefix:"fab",iconName:o})??x.findIconDefinition({prefix:"fas",iconName:o});return n||console.warn("could not load icon, because it is not available",s.name),n});return(o,n)=>t.value?(e.openBlock(),e.createBlock(e.unref($.FontAwesomeIcon),e.mergeProps({key:0,icon:t.value},o.$attrs),null,16,["icon"])):e.createCommentVNode("",!0)}}),M=["aria-label","disabled","aria-disabled","aria-busy"],I={key:0,class:"absolute inset-0 flex items-center justify-center"},T=e.defineComponent({__name:"Button",props:{label:{},size:{default:"medium"},color:{default:"primary"},isLoading:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},icon:{},iconPosition:{default:"right"}},emits:["click"],setup(l,{emit:s}){const t=l,o=s,n=e.computed(()=>{const a={"text-white bg-blue-600 border-transparent hover:bg-blue-700 active:bg-blue-700 dark:ring-blue-800 ring-offset-2 dark:ring-offset-grey-900":t.color==="primary","text-blue-600 bg-grey-100 border-transparent hover:bg-blue-100 hover:text-blue-700 active:bg-grey-100 ring-blue-300 ring-offset-2 dark:ring-offset-grey-900":t.color==="light","text-grey-50 bg-grey-700 border-transparent hover:bg-grey-800 active:bg-grey-700 ring-grey-500 dark:ring-grey-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-grey-900":t.color==="dark","text-red-50 bg-red-500 border-transparent hover:bg-red-600 active:bg-red-600 ring-red-400 dark:ring-red-400 dark:ring-opacity-50 ring-offset-2 dark:ring-offset-red-900":t.color==="danger"},m={"pointer-events-none opacity-75 cursor-not-allowed":t.isDisabled,"cursor-default":t.isLoading},b={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":t.size==="small","px-5 py-2 text-sm leading-4 font-medium rounded-lg":t.size==="medium","px-8 py-3 text-base leading-6 font-medium rounded-lg":t.size==="large"};return{...a,...m,...b}}),c=e.computed(()=>{const a={"mr-2 -ml-1":["small","medium"].includes(t.size)&&t.iconPosition==="left","mr-4 -ml-2":["large"].includes(t.size)&&t.iconPosition==="left"},m={"ml-3 -mr-1":["small","medium"].includes(t.size)&&t.iconPosition==="right","ml-3 -mr-3":["large"].includes(t.size)&&t.iconPosition==="right"},b={"text-white":t.color==="primary","text-blue-600":t.color==="light","text-grey-50":t.color==="dark"};return{...a,...m,...b}});function u(a){if(t.isLoading){a.preventDefault();return}o("click",a)}return(a,m)=>(e.openBlock(),e.createElementBlock("button",{class:e.normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",n.value]),type:"button","aria-label":a.label,disabled:a.isDisabled,"aria-disabled":a.isLoading||void 0,"aria-busy":a.isLoading,onClick:u},[e.createElementVNode("div",{class:e.normalizeClass(!a.isLoading||"invisible")},[a.icon&&a.iconPosition==="left"?(e.openBlock(),e.createBlock(g,{key:0,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0),e.createElementVNode("span",null,e.toDisplayString(a.label),1),a.icon&&a.iconPosition==="right"?(e.openBlock(),e.createBlock(g,{key:1,name:a.icon,class:e.normalizeClass(c.value)},null,8,["name","class"])):e.createCommentVNode("",!0)],2),a.isLoading?(e.openBlock(),e.createElementBlock("span",I,[e.createVNode(g,{class:"animate-spin",name:"circle-notch"})])):e.createCommentVNode("",!0)],10,M))}}),j={class:"relative flex items-start"},q=["checked","id"],A={class:"ml-2 text-sm leading-5 peer-disabled:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:[&>label]:cursor-not-allowed"},F=["for"],U={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},O={inheritAttrs:!1},R=e.defineComponent({...O,__name:"Checkbox",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},description:{}},emits:["update:modelValue"],setup(l,{emit:s}){const t=s,o=n=>{t("update:modelValue",n.target.checked)};return(n,c)=>(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("input",e.mergeProps({class:"peer mt-0.5 h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm disabled:opacity-50 disabled:cursor-not-allowed",type:"checkbox",checked:n.modelValue,onChange:o,id:n.id},n.$attrs),null,16,q),e.createElementVNode("div",A,[e.createElementVNode("label",{for:n.id,class:"font-medium text-grey-700 dark:text-grey-200 casual-25"},e.toDisplayString(n.label),9,F),n.description?(e.openBlock(),e.createElementBlock("p",U,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))}});function N(l){const s=e.computed(()=>({"pl-3 pr-10 py-2":!l.icon&&l.type!=="color"&&l.size==="small","pl-4 pr-10 py-3":!l.icon&&l.type!=="color"&&l.size==="medium","pl-6 pr-10 py-3":!l.icon&&l.type!=="color"&&l.size==="large","pl-10 pr-10 py-1":(l.icon||l.type==="color")&&l.size==="small","pl-12 pr-10 py-3":(l.icon||l.type==="color")&&(l.size==="medium"||l.size==="large"),"w-full block":l.block===!0})),t=e.computed(()=>({"pointer-events-none opacity-50 cursor-not-allowed":l.isDisabled})),o=e.computed(()=>({"text-xs leading-4":l.size==="small","text-sm leading-4":l.size==="medium","text-base leading-5":l.size==="large"}));return{inputClasses:s,disabledClasses:t,textSizeClasses:o}}const H=["placeholder","type","min","max","disabled","value"],G={class:"absolute inset-y-2 left-2 w-8 cursor-pointer"},K=["disabled"],J=["disabled"],Q={inheritAttrs:!1},W=e.defineComponent({...Q,__name:"Input",props:{modelValue:{},type:{default:"text"},placeholder:{},size:{default:"medium"},icon:{},min:{},max:{},isDisabled:{type:Boolean,default:!1},block:{type:Boolean},showColorPicker:{type:Boolean}},emits:["update:modelValue"],setup(l,{expose:s,emit:t}){const o=l,n=e.ref(null),c=e.ref(o.modelValue??""),u=r=>o.type==="number"&&r!==""&&r!==null?Number(r):r;e.watch(()=>o.modelValue,r=>{typeof r<"u"&&r!==u(c.value)&&(c.value=r)});const a=t,{inputClasses:m,disabledClasses:b,textSizeClasses:k}=N(o),f=e.computed(()=>o.type==="color"?"text":o.type),{isSupported:w,open:d,sRGBHex:z}=S.useEyeDropper(),p=()=>{d()};e.watch(z,r=>{c.value=r,a("update:modelValue",r)});const h=function(r){c.value=(r==null?void 0:r.target).value,a("update:modelValue",u(c.value))},C=function(){const r=u(c.value);if(typeof r!="number")return;const B=Math.min(Math.max(r,o.min??-1/0),o.max??1/0);B!==r&&(c.value=B,a("update:modelValue",B))};return s({focus:()=>{var r;o.isDisabled||(r=n.value)==null||r.focus()}}),(r,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative",[r.block?"w-full block":"inline-block"]])},[e.createElementVNode("input",e.mergeProps({class:["relative mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(m),e.unref(k),e.unref(b)]],placeholder:r.placeholder,type:f.value,min:r.min,max:r.max,disabled:r.isDisabled,value:c.value},r.$attrs,{ref_key:"inputElement",ref:n,onInput:h,onChange:C}),null,16,H),r.type==="color"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("label",G,[e.withDirectives(e.createElementVNode("input",{class:"invisible",type:"color",disabled:r.isDisabled,"onUpdate:modelValue":B[0]||(B[0]=ze=>c.value=ze),onInput:h},null,40,K),[[e.vModelText,c.value]]),e.createElementVNode("span",{class:"border-1 absolute inset-0 block rounded border border-grey-600/25 bg-clip-border shadow",style:e.normalizeStyle(`background-color: ${c.value}`)},null,4)]),e.unref(w)&&r.showColorPicker?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute inset-y-2 right-2 h-7 w-7 rounded-full hover:bg-grey-200",disabled:r.isDisabled,onClick:p},[e.createVNode(g,{size:"xs",name:"eyedropper"})],8,J)):e.createCommentVNode("",!0)],64)):r.icon?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",e.unref(k)])},[e.createVNode(g,{name:r.icon},null,8,["name"])],2)):e.createCommentVNode("",!0)],2))}}),X={class:"inline-block text-grey-700 dark:text-grey-200 text-sm font-medium casual-20"},Y=["id","for"],Z={key:0,class:"block text-xs text-grey-400 font-normal mono-0 casual-60"},v=e.defineComponent({__name:"Label",props:{id:{},label:{},description:{}},setup(l){return(s,t)=>(e.openBlock(),e.createElementBlock("span",X,[e.createElementVNode("label",{id:s.id?`${s.id}-label`:void 0,for:s.id},e.toDisplayString(s.label),9,Y),s.description?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(s.description),1)):e.createCommentVNode("",!0)]))}}),ee={key:0,class:"sr-only"},te=e.defineComponent({__name:"MenuContainer",props:{position:{default:"left"},usePortal:{type:[Boolean,String],default:!1},label:{default:"Open menu"}},setup(l){const s=l,t=(a=[])=>a.some(m=>typeof m.children=="string"?m.type!==e.Comment&&m.children.trim()!=="":Array.isArray(m.children)&&t(m.children)),o=e.ref(null),n=e.ref(null),c=s.position==="left"?"bottom-end":"bottom-start",{floatingStyles:u}=V.useFloating(o,n,{placement:c,transform:!1,whileElementsMounted:V.autoUpdate,middleware:[V.offset(6),V.flip(),V.shift({padding:6})]});return(a,m)=>(e.openBlock(),e.createBlock(e.unref(y.Menu),{as:"div",class:"inline-block text-left"},{default:e.withCtx(({open:b})=>[e.createVNode(e.unref(y.MenuButton),{class:"focus:outline-none",ref_key:"reference",ref:o},{default:e.withCtx(()=>{var k,f;return[e.renderSlot(a.$slots,"button",{},()=>[e.createVNode(e.unref(g),{class:"fill-current",name:"ellipsis-h"})]),t((f=(k=a.$slots).button)==null?void 0:f.call(k))?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(a.label),1))]}),_:3},512),(e.openBlock(),e.createBlock(e.Teleport,{to:typeof a.usePortal=="string"?a.usePortal:"body",disabled:!a.usePortal},[e.createVNode(e.Transition,{"enter-active-class":"transition duration-200 ease-in-out","enter-from-class":"transform -translate-y-4 opacity-0","enter-to-class":"transform opacity-100","leave-active-class":"transition duration-100 ease-in-out","leave-from-class":"transform opacity-100","leave-to-class":"transform -translate-y-2 opacity-0"},{default:e.withCtx(()=>[b?(e.openBlock(),e.createElementBlock("div",{key:0,class:"w-56 z-20",style:e.normalizeStyle(e.unref(u)),ref_key:"floating",ref:n},[e.createVNode(e.unref(y.MenuItems),{static:"",class:e.normalizeClass(["z-40 mt-1 p-1 bg-white rounded shadow-lg text-grey-700 focus:outline-none w-full"])},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})],4)):e.createCommentVNode("",!0)]),_:2},1024)],8,["to","disabled"]))]),_:3}))}}),oe={key:0,class:"bg-grey-300 px-2 rounded-lg max-w-[66px] truncate"},ne=e.defineComponent({__name:"MenuLink",props:{label:{},meta:{},disabled:{type:Boolean},as:{}},setup(l){return(s,t)=>(e.openBlock(),e.createBlock(e.unref(y.MenuItem),e.normalizeProps(e.guardReactiveProps({disabled:s.disabled})),{default:e.withCtx(({active:o})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s.as||"span"),{class:e.normalizeClass(["flex items-center justify-between px-4 py-2 text-xs leading-5 transition-colors duration-100 rounded-lg",[o?"bg-grey-200":"",s.disabled?"opacity-50 pointer-events-none":"hover:bg-grey-200 focus:bg-grey-200 focus:outline-none"]])},{default:e.withCtx(()=>[e.createElementVNode("span",null,e.toDisplayString(s.label),1),s.meta?(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(s.meta),1)):e.createCommentVNode("",!0)]),_:2},1032,["class"]))]),_:1},16))}}),le={class:"relative"},ae={key:0,class:"absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},se={key:1,class:"block truncate"},re={key:2,class:"text-grey-500 truncate"},ie={class:"absolute right-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4 pointer-events-none"},ce={class:"absolute right-2 inset-y-0 flex items-center"},de={key:0,class:"bg-grey-500 text-grey-100 rounded text-xs px-2 py-1"},me=e.defineComponent({__name:"Select",props:{id:{},modelValue:{},size:{default:"medium"},icon:{},placeholder:{},isDisabled:{type:Boolean,default:!1},options:{},disabledBadge:{},by:{}},emits:["update:modelValue"],setup(l,{emit:s}){const t=l,o=e.ref(t.modelValue??null),n=s,c=d=>typeof t.by=="string"?d[t.by]:d.id,{inputClasses:u,disabledClasses:a,textSizeClasses:m}=N(t),b=e.ref(!1),k=()=>{b.value=!!t.id&&!!document.getElementById(`${t.id}-label`)};e.onMounted(k),e.watch(()=>t.id,k,{flush:"post"});const f=e.computed(()=>b.value?`${t.id}-label ${t.id}`:void 0);e.watch(()=>t.modelValue,d=>{o.value=d??null});const w=d=>{o.value=d,n("update:modelValue",d)};return(d,z)=>(e.openBlock(),e.createBlock(e.unref(y.Listbox),{as:"div","model-value":o.value,"onUpdate:modelValue":w,by:d.by,disabled:d.isDisabled},{default:e.withCtx(()=>[e.createElementVNode("div",le,[e.createVNode(e.unref(y.ListboxButton),{id:d.id,"aria-labelledby":f.value,class:e.normalizeClass(["w-full mono-50 bg-white text-grey-800 placeholder-grey-600 border border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:ring-2 focus:border-blue-400 focus:ring-blue-400 focus:outline-none dark:focus:border-blue-800 dark:focus:ring-blue-800 cursor-default rounded font-normal text-left",[e.unref(u),e.unref(m),e.unref(a)]])},{default:e.withCtx(()=>{var p;return[d.icon?(e.openBlock(),e.createElementBlock("span",ae,[e.createVNode(g,{name:((p=o.value)==null?void 0:p.icon)??d.icon},null,8,["name"])])):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("span",se,[e.renderSlot(d.$slots,"option",{option:o.value,active:!1,selected:!0},()=>[e.createTextVNode(e.toDisplayString(o.value.label),1)])])):(e.openBlock(),e.createElementBlock("span",re,e.toDisplayString(d.placeholder),1)),e.createElementVNode("span",ie,[e.createVNode(g,{class:"text-grey-400",name:"chevron-down","aria-hidden":"true"})])]}),_:3},8,["id","aria-labelledby","class"]),e.createVNode(e.Transition,{"leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[e.createVNode(e.unref(y.ListboxOptions),{class:"absolute z-10 mt-1 w-full bg-white dark:bg-grey-700 dark:text-grey-50 shadow-lg max-h-60 rounded-md py-1 text-base ring-1 ring-black ring-opacity-5 overflow-auto focus:outline-none sm:text-sm"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.options,p=>(e.openBlock(),e.createBlock(e.unref(y.ListboxOption),{as:"template",key:c(p),value:p,disabled:p.disabled},{default:e.withCtx(({active:h,selected:C})=>[e.createElementVNode("li",{class:e.normalizeClass([h?"text-white bg-blue-500":"text-grey-900 dark:text-grey-50","cursor-default select-none relative py-2 pl-3 pr-12",{"opacity-50 bg-grey-100":p.disabled}])},[e.createElementVNode("div",ce,[p.disabled&&d.disabledBadge?(e.openBlock(),e.createElementBlock("span",de,e.toDisplayString(d.disabledBadge),1)):e.createCommentVNode("",!0)]),e.createElementVNode("span",{class:e.normalizeClass([C?"font-semibold":"font-normal","block truncate"])},[p.icon?(e.openBlock(),e.createBlock(g,{key:0,class:"inline-block mr-1",name:p.icon},null,8,["name"])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"option",{option:p,active:h,selected:C},()=>[e.createTextVNode(e.toDisplayString(p.label),1)])],2),C?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([h?"text-blue-100":"text-blue-500","absolute inset-y-0 right-0 flex items-center pr-4"])},[e.createVNode(g,{name:"check",class:"h-5 w-5","aria-hidden":"true"})],2)):e.createCommentVNode("",!0)],2)]),_:2},1032,["value","disabled"]))),128))]),_:3})]),_:3})])]),_:3},8,["model-value","by","disabled"]))}}),fe={class:"animate-pulse"},pe={class:"flex items-center justify-between space-x-4"},ue={key:0,class:"w-12 h-12 bg-current rounded-full shrink-0"},be={key:1,class:"w-full h-8 bg-current rounded-lg"},ge={key:0,class:"mt-6 space-y-2"},ye={key:1,class:"w-1/3 h-10 mt-6 bg-current rounded-lg"},ke=e.defineComponent({__name:"Skeleton",props:{avatar:{type:Boolean,default:!1},title:{type:Boolean,default:!0},lines:{default:3},footer:{type:Boolean,default:!1}},setup(l){const s=l,t=["mr-4","mr-5","mr-6","mr-8","mr-10","mr-16","mr-24","mr-32"],o=e.computed(()=>Array.from({length:Math.max(0,Math.floor(s.lines))},()=>({margin:t[Math.floor(Math.random()*t.length)]})));return(n,c)=>(e.openBlock(),e.createElementBlock("div",fe,[e.createElementVNode("div",pe,[n.avatar?(e.openBlock(),e.createElementBlock("div",ue)):e.createCommentVNode("",!0),n.title?(e.openBlock(),e.createElementBlock("div",be)):e.createCommentVNode("",!0)]),o.value.length>0?(e.openBlock(),e.createElementBlock("div",ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(u,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["h-4 bg-current rounded-lg",u.margin]),key:a},null,2))),128))])):e.createCommentVNode("",!0),n.footer?(e.openBlock(),e.createElementBlock("div",ye)):e.createCommentVNode("",!0)]))}}),he={role:"status",class:"inline-flex align-[-0.125em]"},Be={class:"sr-only"},_e={inheritAttrs:!1},Ve=e.defineComponent({..._e,__name:"Spinner",props:{label:{default:"Loading"}},setup(l){const s=e.ref(!1);let t;return e.onMounted(()=>{t=setTimeout(()=>s.value=!0,100)}),e.onUnmounted(()=>clearTimeout(t)),(o,n)=>(e.openBlock(),e.createElementBlock("span",he,[e.createVNode(e.unref(g),e.mergeProps({class:"animate-spin",name:"circle-notch"},o.$attrs),null,16),e.createElementVNode("span",Be,e.toDisplayString(s.value?o.label:""),1)]))}}),Ce={class:"sr-only"},we=e.defineComponent({__name:"Switch",props:{id:{default:()=>E.v4()},label:{},modelValue:{type:Boolean},onLabel:{default:"on"},offLabel:{default:"off"}},emits:["update:modelValue","change"],setup(l,{emit:s}){const t=s,o=n=>{t("update:modelValue",n),t("change",n)};return(n,c)=>(e.openBlock(),e.createBlock(e.unref(y.Switch),{id:n.id,modelValue:n.modelValue,class:e.normalizeClass([n.modelValue?"bg-blue-700":"bg-grey-700","relative inline-flex items-center h-6 transition rounded-full w-14 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-grey-900 focus:ring-blue-300"]),"onUpdate:modelValue":o},{default:e.withCtx(()=>[e.createElementVNode("span",{class:e.normalizeClass(["absolute text-xs text-center text-white inset-x-2",n.modelValue?"pr-3":"pl-3"])},e.toDisplayString(n.modelValue===!0?n.onLabel:n.offLabel),3),e.createElementVNode("span",Ce,e.toDisplayString(n.label),1),e.createElementVNode("span",{class:e.normalizeClass([n.modelValue?"translate-x-9":"translate-x-1","inline-block w-4 h-4 transition bg-white rounded-full"])},null,2)]),_:1},8,["id","modelValue","class"]))}}),xe={class:"relative"},Ne=["disabled","value"],Ee={inheritAttrs:!1},De=e.defineComponent({...Ee,__name:"Textarea",props:{modelValue:{},size:{default:"medium"},isDisabled:{type:Boolean,default:!1},block:{type:Boolean}},emits:["update:modelValue"],setup(l,{expose:s,emit:t}){const o=l,n=t,{inputClasses:c,disabledClasses:u,textSizeClasses:a}=N(o),m=function(f){n("update:modelValue",(f==null?void 0:f.target).value)},b=e.ref(null);return s({focus:()=>{o.isDisabled||b.value.focus()}}),(f,w)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("textarea",e.mergeProps({class:["mono-50 bg-white text-grey-800 placeholder:text-grey-400 placeholder:font-normal border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder:text-grey-500 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800 rounded",[e.unref(c),e.unref(a),e.unref(u)]],disabled:f.isDisabled,value:f.modelValue??""},f.$attrs,{ref_key:"input",ref:b,cols:"56",rows:"8",onInput:m}),`
|
|
2
|
+
`,16,Ne)]))}});i.D9Button=T,i.D9Checkbox=R,i.D9Icon=g,i.D9Input=W,i.D9Label=v,i.D9Menu=te,i.D9MenuLink=ne,i.D9Select=me,i.D9Skeleton=ke,i.D9Spinner=Ve,i.D9Switch=we,i.D9Textarea=De,i.brands=P,i.icons=L,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck9/ui",
|
|
3
|
-
"version": "0.17.0
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "The UI components used in deck9 software applications.",
|
|
5
5
|
"author": "Philipp Reinking <philipp@deck9.co> (https://deck9.co)",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
7
|
"check": "vue-tsc --noEmit",
|
|
8
|
+
"lint": "eslint . --max-warnings 0",
|
|
9
9
|
"build": "vue-tsc --noEmit && vite build",
|
|
10
|
-
"
|
|
10
|
+
"test": "vitest run",
|
|
11
11
|
"storybook": "storybook dev -p 6006",
|
|
12
12
|
"build-storybook": "storybook build"
|
|
13
13
|
},
|
|
@@ -49,22 +49,19 @@
|
|
|
49
49
|
"@storybook/vue3-vite": "^7.6.17",
|
|
50
50
|
"@tailwindcss/forms": "^0.5.7",
|
|
51
51
|
"@tailwindcss/typography": "^0.5.9",
|
|
52
|
-
"@types/lodash": "^4.14.202",
|
|
53
52
|
"@types/web": "^0.0.122",
|
|
54
53
|
"@typescript-eslint/eslint-plugin": "^5.28.0",
|
|
55
54
|
"@typescript-eslint/parser": "^5.28.0",
|
|
56
55
|
"@vitejs/plugin-vue": "^4.5.0",
|
|
57
|
-
"@vue/cli-plugin-babel": "^5.0.8",
|
|
58
|
-
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
59
56
|
"@vue/eslint-config-prettier": "^7.0.0",
|
|
60
57
|
"@vue/eslint-config-typescript": "^11.0.2",
|
|
61
|
-
"@
|
|
58
|
+
"@vue/test-utils": "2.4.6",
|
|
62
59
|
"autoprefixer": "^10.4.13",
|
|
63
60
|
"eslint": "^8.54.0",
|
|
64
61
|
"eslint-plugin-prettier": "^4.0.0",
|
|
65
62
|
"eslint-plugin-storybook": "^0.6.15",
|
|
66
63
|
"eslint-plugin-vue": "^9.1.1",
|
|
67
|
-
"
|
|
64
|
+
"jsdom": "^26.1.0",
|
|
68
65
|
"react": "^18.2.0",
|
|
69
66
|
"react-dom": "^18.2.0",
|
|
70
67
|
"storybook": "^7.6.17",
|
|
@@ -73,6 +70,7 @@
|
|
|
73
70
|
"typescript": "^4.9.3",
|
|
74
71
|
"vite": "^5.0.2",
|
|
75
72
|
"vite-plugin-dts": "^3.6.3",
|
|
73
|
+
"vitest": "^3.2.7",
|
|
76
74
|
"vue": "^3.3.9",
|
|
77
75
|
"vue-tsc": "^1.8.22"
|
|
78
76
|
},
|