@deck9/ui 0.3.0 → 0.3.4
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/babel.config.js +2 -4
- package/dist/Button/index.d.ts +1 -0
- package/dist/Checkbox/index.d.ts +1 -0
- package/dist/Icon/index.d.ts +2 -0
- package/dist/Icon/registerIcons.d.ts +2 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Label/index.d.ts +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +16 -0
- package/dist/index.umd.js +16 -0
- package/dist/types.d.ts +5 -0
- package/package.json +19 -6
- package/src/Button/Button.vue +2 -2
- package/src/Icon/registerIcons.ts +2 -1
- package/src/Input/Input.vue +5 -5
- package/tsconfig.json +10 -9
- package/vite.config.ts +40 -0
package/babel.config.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as D9Button } from "./Button.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as D9Checkbox } from "./Checkbox.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as D9Input } from "./Input.vue";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as D9Label } from "./Label.vue";
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var e=Object.defineProperty,r=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,n=(r,t,i)=>t in r?e(r,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[t]=i,o=(e,o)=>{for(var a in o||(o={}))t.call(o,a)&&n(e,a,o[a]);if(r)for(var a of r(o))i.call(o,a)&&n(e,a,o[a]);return e};import{defineComponent as a,computed as l,openBlock as s,createElementBlock as d,normalizeClass as u,unref as c,createElementVNode as p,createBlock as f,createCommentVNode as g,toDisplayString as m,createVNode as y,mergeProps as b}from"vue";import{library as v}from"@fortawesome/fontawesome-svg-core";import*as x from"@fortawesome/free-solid-svg-icons";import{FontAwesomeIcon as h}from"@fortawesome/vue-fontawesome";const k=["aria-label","tabindex"],q={key:0,class:"absolute inset-0 flex items-center justify-center"},w=a({props:{label:{type:String,required:!0},size:{type:null,required:!1,default:"medium"},type:{type:null,required:!1,default:"primary"},isLoading:{type:Boolean,required:!1,default:!1},isDisabled:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1},iconPosition:{type:null,required:!1}},emits:["onClick"],setup(e,{emit:r}){const t=e,i=l((()=>{const e={"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":"primary"===t.type,"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":"light"===t.type,"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":"dark"===t.type},r={"pointer-events-none opacity-75 cursor-not-allowed":t.isDisabled},i={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":"small"===t.size,"px-5 py-2 text-sm leading-4 font-medium rounded-lg":"medium"===t.size,"px-8 py-3 text-base leading-6 font-medium rounded-lg":"large"===t.size};return o(o(o({},e),r),i)})),n=l((()=>{const e={"mr-2 -ml-1":["small","medium"].includes(t.size)&&"left"===t.iconPosition,"mr-4 -ml-2":["large"].includes(t.size)&&"left"===t.iconPosition},r={"ml-3 -mr-1":["small","medium"].includes(t.size)&&"right"===t.iconPosition,"ml-3 -mr-3":["large"].includes(t.size)&&"right"===t.iconPosition},i={"text-white":"primary"===t.type,"text-blue-600":"light"===t.type,"text-grey-50":"dark"===t.type};return o(o(o({},e),r),i)}));function a(){t.isDisabled||r("onClick")}return(r,t)=>(s(),d("button",{class:u(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",c(i)]),type:"button","aria-label":e.label,tabindex:e.isDisabled?"-1":void 0,onClick:a},[p("div",{class:u(!e.isLoading||"invisible")},[e.icon&&"left"===e.iconPosition?(s(),f(c(Y),{key:0,name:e.icon,class:u(c(n))},null,8,["name","class"])):g("",!0),p("span",null,m(e.label),1),e.icon&&"right"===e.iconPosition?(s(),f(c(Y),{key:1,name:e.icon,class:u(c(n))},null,8,["name","class"])):g("",!0)],2),e.isLoading?(s(),d("span",q,[y(c(Y),{class:"animate-spin",name:"circle-notch"})])):g("",!0)],10,k))}});var C={exports:{}},z="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(z){var S=new Uint8Array(16);C.exports=function(){return z(S),S}}else{var P=new Array(16);C.exports=function(){for(var e,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),P[r]=e>>>((3&r)<<3)&255;return P}}for(var D=[],j=0;j<256;++j)D[j]=(j+256).toString(16).substr(1);var O,R,V=function(e,r){var t=r||0,i=D;return[i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],"-",i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]],i[e[t++]]].join("")},A=C.exports,B=V,I=0,E=0;var L=function(e,r,t){var i=r&&t||0,n=r||[],o=(e=e||{}).node||O,a=void 0!==e.clockseq?e.clockseq:R;if(null==o||null==a){var l=A();null==o&&(o=O=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==a&&(a=R=16383&(l[6]<<8|l[7]))}var s=void 0!==e.msecs?e.msecs:(new Date).getTime(),d=void 0!==e.nsecs?e.nsecs:E+1,u=s-I+(d-E)/1e4;if(u<0&&void 0===e.clockseq&&(a=a+1&16383),(u<0||s>I)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");I=s,E=d,R=a;var c=(1e4*(268435455&(s+=122192928e5))+d)%4294967296;n[i++]=c>>>24&255,n[i++]=c>>>16&255,n[i++]=c>>>8&255,n[i++]=255&c;var p=s/4294967296*1e4&268435455;n[i++]=p>>>8&255,n[i++]=255&p,n[i++]=p>>>24&15|16,n[i++]=p>>>16&255,n[i++]=a>>>8|128,n[i++]=255&a;for(var f=0;f<6;++f)n[i+f]=o[f];return r||B(n)},T=C.exports,U=V;var H=L,M=function(e,r,t){var i=r&&t||0;"string"==typeof e&&(r="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||T)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r)for(var o=0;o<16;++o)r[i+o]=n[o];return r||U(n)},F=M;F.v1=H,F.v4=M;const G={class:"relative flex items-start"},N={class:"flex items-center h-5"},$=["checked","id"],J={class:"ml-2 text-sm leading-5"},K=["for"],Q={key:0,class:"text-grey-700 dark:text-grey-400 mono-0 casual-60"},W=a({props:{id:{type:String,required:!1,default:F.v4()},label:{type:String,required:!0},modelValue:{type:Boolean,required:!0},description:{type:String,required:!1},checked:{type:Boolean,required:!1}},emits:["update:modelValue"],setup:(e,{emit:r})=>(r,t)=>(s(),d("div",G,[p("div",N,[p("input",{class:"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",type:"checkbox",checked:e.modelValue,id:e.id},null,8,$)]),p("div",J,[p("label",{for:e.id,class:"font-medium text-grey-900 dark:text-grey-200 casual-25"},m(e.label),9,K),e.description?(s(),d("p",Q,m(e.description),1)):g("",!0)])]))});v.add(x.faChartPie,x.faCheck,x.faCheckCircle,x.faChevronDown,x.faChevronLeft,x.faChevronRight,x.faChevronUp,x.faCircleNotch,x.faClipboard,x.faCog,x.faDoorOpen,x.faEllipsisH,x.faEnvelope,x.faExclamationTriangle,x.faFingerprint,x.faGlobe,x.faHandPointRight,x.faInfoCircle,x.faPencilAlt,x.faPlayCircle,x.faPlus,x.faPlusCircle,x.faRobot,x.faSave,x.faShieldAlt,x.faTimes,x.faTrash,x.faUser,x.faUserShield);var X=
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
function(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var i=Array(e),n=0;for(r=0;r<t;r++)for(var o=arguments[r],a=0,l=o.length;a<l;a++,n++)i[n]=o[a];return i}(Object.keys(v.definitions.fas)).sort();var Y=a({props:{name:{type:String,required:!0,default:"user"}},setup(e){const r=e,t=l((()=>!!X.includes(r.name)||(console.warn("could not load icon, because it is not available",r.name),!1)));return(r,i)=>c(t)?(s(),f(c(h),b({key:0,icon:["fas",e.name]},r.$attrs),null,16,["icon"])):g("",!0)}});const Z={class:"relative"},_=["placeholder","type","tabindex"],ee=a({props:{type:{type:String,required:!0,default:"text"},placeholder:{type:String,required:!1},size:{type:null,required:!1,default:"medium"},icon:{type:String,required:!1},isDisabled:{type:Boolean,required:!1,default:!1}},emits:["onInput"],setup(e,{emit:r}){const t=e,i=l((()=>({"px-3 py-1 rounded font-normal":"small"===t.size,"px-4 py-3 rounded font-normal":"medium"===t.size,"px-6 py-3 rounded font-normal":"large"===t.size,"pl-10":t.icon&&"small"===t.size,"pl-12":t.icon&&("medium"===t.size||"large"===t.size)}))),n=l((()=>({"pointer-events-none opacity-50 cursor-not-allowed":t.isDisabled}))),a=l((()=>({"text-xs leading-4":"small"===t.size,"text-sm leading-4":"medium"===t.size,"text-base leading-4":"large"===t.size})));return(t,l)=>(s(),d("div",Z,[p("input",{class:u(["mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800",o(o(o({},c(i)),c(a)),c(n))]),placeholder:e.placeholder,type:e.type,onInput:l[0]||(l[0]=e=>{r("onInput",e)}),tabindex:e.isDisabled?"-1":void 0},null,42,_),e.icon?(s(),d("span",{key:0,class:u(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",c(a)])},[y(c(Y),{name:e.icon},null,8,["name"])],2)):g("",!0)]))}});const re={class:"inline-block text-blue-900 text-sm font-medium"},te=["for"],ie={key:0};var ne=((e,r)=>{for(const[t,i]of r)e[t]=i;return e})({props:{id:{type:String,required:!0},label:{type:String,required:!0},description:{type:String,default:void 0}}},[["render",function(e,r,t,i,n,o){return s(),d("span",re,[p("label",{for:t.id},m(t.label),9,te),t.description?(s(),d("span",ie,m(t.description),1)):g("",!0)])}]]);export{w as D9Button,W as D9Checkbox,Y as D9Icon,ee as D9Input,ne as D9Label,X as icons};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,r,t)=>r in e?__defProp(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,__spreadValues=(e,r)=>{for(var t in r||(r={}))__hasOwnProp.call(r,t)&&__defNormalProp(e,t,r[t]);if(__getOwnPropSymbols)for(var t of __getOwnPropSymbols(r))__propIsEnum.call(r,t)&&__defNormalProp(e,t,r[t]);return e};!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("vue"),require("@fortawesome/fontawesome-svg-core"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/vue-fontawesome")):"function"==typeof define&&define.amd?define(["exports","vue","@fortawesome/fontawesome-svg-core","@fortawesome/free-solid-svg-icons","@fortawesome/vue-fontawesome"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).index={},e.Vue,e.fontawesomeSvgCore,e.fasIcons,e.vueFontawesome)}(this,(function(e,r,t,o,n){"use strict";function a(e){if(e&&e.__esModule)return e;var r={__proto__:null,[Symbol.toStringTag]:"Module"};return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var i=a(o);const l=["aria-label","tabindex"],s={key:0,class:"absolute inset-0 flex items-center justify-center"},d=r.defineComponent({props:{label:{type:String,required:!0},size:{type:null,required:!1,default:"medium"},type:{type:null,required:!1,default:"primary"},isLoading:{type:Boolean,required:!1,default:!1},isDisabled:{type:Boolean,required:!1,default:!1},icon:{type:String,required:!1},iconPosition:{type:null,required:!1}},emits:["onClick"],setup(e,{emit:t}){const o=e,n=r.computed((()=>{const e={"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":"primary"===o.type,"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":"light"===o.type,"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":"dark"===o.type},r={"pointer-events-none opacity-75 cursor-not-allowed":o.isDisabled},t={"px-4 py-1 text-xs leading-5 mono-100 rounded-lg":"small"===o.size,"px-5 py-2 text-sm leading-4 font-medium rounded-lg":"medium"===o.size,"px-8 py-3 text-base leading-6 font-medium rounded-lg":"large"===o.size};return __spreadValues(__spreadValues(__spreadValues({},e),r),t)})),a=r.computed((()=>{const e={"mr-2 -ml-1":["small","medium"].includes(o.size)&&"left"===o.iconPosition,"mr-4 -ml-2":["large"].includes(o.size)&&"left"===o.iconPosition},r={"ml-3 -mr-1":["small","medium"].includes(o.size)&&"right"===o.iconPosition,"ml-3 -mr-3":["large"].includes(o.size)&&"right"===o.iconPosition},t={"text-white":"primary"===o.type,"text-blue-600":"light"===o.type,"text-grey-50":"dark"===o.type};return __spreadValues(__spreadValues(__spreadValues({},e),r),t)}));function i(){o.isDisabled||t("onClick")}return(t,o)=>(r.openBlock(),r.createElementBlock("button",{class:r.normalizeClass(["relative inline-flex items-center focus:outline-none focus:ring active:ring transition duration-150 ease-in-out",r.unref(n)]),type:"button","aria-label":e.label,tabindex:e.isDisabled?"-1":void 0,onClick:i},[r.createElementVNode("div",{class:r.normalizeClass(!e.isLoading||"invisible")},[e.icon&&"left"===e.iconPosition?(r.openBlock(),r.createBlock(r.unref(A),{key:0,name:e.icon,class:r.normalizeClass(r.unref(a))},null,8,["name","class"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(e.label),1),e.icon&&"right"===e.iconPosition?(r.openBlock(),r.createBlock(r.unref(A),{key:1,name:e.icon,class:r.normalizeClass(r.unref(a))},null,8,["name","class"])):r.createCommentVNode("",!0)],2),e.isLoading?(r.openBlock(),r.createElementBlock("span",s,[r.createVNode(r.unref(A),{class:"animate-spin",name:"circle-notch"})])):r.createCommentVNode("",!0)],10,l))}});var c={exports:{}},u="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(u){var p=new Uint8Array(16);c.exports=function(){return u(p),p}}else{var f=new Array(16);c.exports=function(){for(var e,r=0;r<16;r++)0==(3&r)&&(e=4294967296*Math.random()),f[r]=e>>>((3&r)<<3)&255;return f}}for(var m=[],g=0;g<256;++g)m[g]=(g+256).toString(16).substr(1);var y,b,v=function(e,r){var t=r||0,o=m;return[o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],"-",o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]],o[e[t++]]].join("")},k=c.exports,x=v,h=0,_=0;var C=function(e,r,t){var o=r&&t||0,n=r||[],a=(e=e||{}).node||y,i=void 0!==e.clockseq?e.clockseq:b;if(null==a||null==i){var l=k();null==a&&(a=y=[1|l[0],l[1],l[2],l[3],l[4],l[5]]),null==i&&(i=b=16383&(l[6]<<8|l[7]))}var s=void 0!==e.msecs?e.msecs:(new Date).getTime(),d=void 0!==e.nsecs?e.nsecs:_+1,c=s-h+(d-_)/1e4;if(c<0&&void 0===e.clockseq&&(i=i+1&16383),(c<0||s>h)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");h=s,_=d,b=i;var u=(1e4*(268435455&(s+=122192928e5))+d)%4294967296;n[o++]=u>>>24&255,n[o++]=u>>>16&255,n[o++]=u>>>8&255,n[o++]=255&u;var p=s/4294967296*1e4&268435455;n[o++]=p>>>8&255,n[o++]=255&p,n[o++]=p>>>24&15|16,n[o++]=p>>>16&255,n[o++]=i>>>8|128,n[o++]=255&i;for(var f=0;f<6;++f)n[o+f]=a[f];return r||x(n)},w=c.exports,V=v;var P=C,S=function(e,r,t){var o=r&&t||0;"string"==typeof e&&(r="binary"===e?new Array(16):null,e=null);var n=(e=e||{}).random||(e.rng||w)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r)for(var a=0;a<16;++a)r[o+a]=n[a];return r||V(n)},B=S;B.v1=P,B.v4=S;var q=B;const z={class:"relative flex items-start"},E={class:"flex items-center h-5"},D=["checked","id"],N={class:"ml-2 text-sm leading-5"},O=["for"],j={key:0,class:"text-grey-700 dark:text-grey-400 mono-0 casual-60"},I=r.defineComponent({props:{id:{type:String,required:!1,default:q.v4()},label:{type:String,required:!0},modelValue:{type:Boolean,required:!0},description:{type:String,required:!1},checked:{type:Boolean,required:!1}},emits:["update:modelValue"],setup:(e,{emit:t})=>(t,o)=>(r.openBlock(),r.createElementBlock("div",z,[r.createElementVNode("div",E,[r.createElementVNode("input",{class:"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",type:"checkbox",checked:e.modelValue,id:e.id},null,8,D)]),r.createElementVNode("div",N,[r.createElementVNode("label",{for:e.id,class:"font-medium text-grey-900 dark:text-grey-200 casual-25"},r.toDisplayString(e.label),9,O),e.description?(r.openBlock(),r.createElementBlock("p",j,r.toDisplayString(e.description),1)):r.createCommentVNode("",!0)])]))});t.library.add(i.faChartPie,i.faCheck,i.faCheckCircle,i.faChevronDown,i.faChevronLeft,i.faChevronRight,i.faChevronUp,i.faCircleNotch,i.faClipboard,i.faCog,i.faDoorOpen,i.faEllipsisH,i.faEnvelope,i.faExclamationTriangle,i.faFingerprint,i.faGlobe,i.faHandPointRight,i.faInfoCircle,i.faPencilAlt,i.faPlayCircle,i.faPlus,i.faPlusCircle,i.faRobot,i.faSave,i.faShieldAlt,i.faTimes,i.faTrash,i.faUser,i.faUserShield);var T=
|
|
2
|
+
/*! *****************************************************************************
|
|
3
|
+
Copyright (c) Microsoft Corporation.
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
function(){for(var e=0,r=0,t=arguments.length;r<t;r++)e+=arguments[r].length;var o=Array(e),n=0;for(r=0;r<t;r++)for(var a=arguments[r],i=0,l=a.length;i<l;i++,n++)o[n]=a[i];return o}(Object.keys(t.library.definitions.fas)).sort();var A=r.defineComponent({props:{name:{type:String,required:!0,default:"user"}},setup(e){const t=e,o=r.computed((()=>!!T.includes(t.name)||(console.warn("could not load icon, because it is not available",t.name),!1)));return(t,a)=>r.unref(o)?(r.openBlock(),r.createBlock(r.unref(n.FontAwesomeIcon),r.mergeProps({key:0,icon:["fas",e.name]},t.$attrs),null,16,["icon"])):r.createCommentVNode("",!0)}});const R={class:"relative"},M=["placeholder","type","tabindex"],L=r.defineComponent({props:{type:{type:String,required:!0,default:"text"},placeholder:{type:String,required:!1},size:{type:null,required:!1,default:"medium"},icon:{type:String,required:!1},isDisabled:{type:Boolean,required:!1,default:!1}},emits:["onInput"],setup(e,{emit:t}){const o=e,n=r.computed((()=>({"px-3 py-1 rounded font-normal":"small"===o.size,"px-4 py-3 rounded font-normal":"medium"===o.size,"px-6 py-3 rounded font-normal":"large"===o.size,"pl-10":o.icon&&"small"===o.size,"pl-12":o.icon&&("medium"===o.size||"large"===o.size)}))),a=r.computed((()=>({"pointer-events-none opacity-50 cursor-not-allowed":o.isDisabled}))),i=r.computed((()=>({"text-xs leading-4":"small"===o.size,"text-sm leading-4":"medium"===o.size,"text-base leading-4":"large"===o.size})));return(o,l)=>(r.openBlock(),r.createElementBlock("div",R,[r.createElementVNode("input",{class:r.normalizeClass(["mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800",__spreadValues(__spreadValues(__spreadValues({},r.unref(n)),r.unref(i)),r.unref(a))]),placeholder:e.placeholder,type:e.type,onInput:l[0]||(l[0]=e=>{t("onInput",e)}),tabindex:e.isDisabled?"-1":void 0},null,42,M),e.icon?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4",r.unref(i)])},[r.createVNode(r.unref(A),{name:e.icon},null,8,["name"])],2)):r.createCommentVNode("",!0)]))}});const U={class:"inline-block text-blue-900 text-sm font-medium"},F=["for"],H={key:0};var G=((e,r)=>{for(const[t,o]of r)e[t]=o;return e})({props:{id:{type:String,required:!0},label:{type:String,required:!0},description:{type:String,default:void 0}}},[["render",function(e,t,o,n,a,i){return r.openBlock(),r.createElementBlock("span",U,[r.createElementVNode("label",{for:o.id},r.toDisplayString(o.label),9,F),o.description?(r.openBlock(),r.createElementBlock("span",H,r.toDisplayString(o.description),1)):r.createCommentVNode("",!0)])}]]);e.D9Button=d,e.D9Checkbox=I,e.D9Icon=A,e.D9Input=L,e.D9Label=G,e.icons=T,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"}));
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare type ColorScheme = "light" | "dark" | "primary";
|
|
2
|
+
export declare type Size = "small" | "medium" | "large";
|
|
3
|
+
export declare type PositionHorizontal = "left" | "right";
|
|
4
|
+
export declare type PositionVertical = "top" | "bottom";
|
|
5
|
+
export declare type PositionBoth = PositionHorizontal | PositionVertical | "center";
|
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deck9/ui",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.4",
|
|
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
7
|
"build-storybook": "build-storybook",
|
|
8
|
-
"storybook": "start-storybook -p 6006"
|
|
8
|
+
"storybook": "start-storybook -p 6006",
|
|
9
|
+
"build": "vite build"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.umd.js",
|
|
12
|
+
"module": "./dist/index.es.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.es.js",
|
|
16
|
+
"require": "./dist/index.umd.js"
|
|
17
|
+
}
|
|
9
18
|
},
|
|
10
|
-
"main": "src/index.js",
|
|
11
19
|
"dependencies": {
|
|
12
20
|
"@deck9/tailwindcss-recursive-font-helper": "^1.0.0",
|
|
13
21
|
"@fortawesome/fontawesome-svg-core": "^1.2.36",
|
|
@@ -17,10 +25,13 @@
|
|
|
17
25
|
"@tailwindcss/forms": "^0.3.3",
|
|
18
26
|
"@tailwindcss/typography": "^0.4.1",
|
|
19
27
|
"core-js": "^3.6.5",
|
|
20
|
-
"
|
|
28
|
+
"rollup": "^2.57.0",
|
|
29
|
+
"tailwindcss": "^2.2.7",
|
|
30
|
+
"uuid": "^3.4.0"
|
|
21
31
|
},
|
|
22
32
|
"devDependencies": {
|
|
23
33
|
"@babel/core": "^7.15.0",
|
|
34
|
+
"@rollup/plugin-typescript": "^8.2.5",
|
|
24
35
|
"@storybook/addon-a11y": "^6.3.7",
|
|
25
36
|
"@storybook/addon-actions": "^6.3.7",
|
|
26
37
|
"@storybook/addon-docs": "^6.3.7",
|
|
@@ -33,6 +44,7 @@
|
|
|
33
44
|
"@types/uuid": "^8.3.1",
|
|
34
45
|
"@typescript-eslint/eslint-plugin": "^4.29.2",
|
|
35
46
|
"@typescript-eslint/parser": "^4.29.2",
|
|
47
|
+
"@vitejs/plugin-vue": "^1.9.0",
|
|
36
48
|
"@vue/cli-plugin-babel": "^4.5.13",
|
|
37
49
|
"@vue/cli-plugin-eslint": "^4.5.13",
|
|
38
50
|
"@vue/cli-plugin-typescript": "~4.5.0",
|
|
@@ -53,10 +65,11 @@
|
|
|
53
65
|
"prettier": "^2.2.1",
|
|
54
66
|
"storybook-dark-mode": "^1.0.8",
|
|
55
67
|
"typescript": "~4.1.5",
|
|
56
|
-
"
|
|
68
|
+
"vite": "^2.5.10",
|
|
57
69
|
"vue": "^3.2.4",
|
|
58
70
|
"vue-class-component": "^8.0.0-0",
|
|
59
|
-
"vue-loader": "^16.5.0"
|
|
71
|
+
"vue-loader": "^16.5.0",
|
|
72
|
+
"vue-tsc": "^0.3.0"
|
|
60
73
|
},
|
|
61
74
|
"browserslist": [
|
|
62
75
|
"> 1%",
|
package/src/Button/Button.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
type="button"
|
|
5
5
|
:aria-label="label"
|
|
6
6
|
:class="buttonClasses"
|
|
7
|
-
:tabindex="isDisabled ? '-1' :
|
|
7
|
+
:tabindex="isDisabled ? '-1' : undefined"
|
|
8
8
|
@click="onClick"
|
|
9
9
|
>
|
|
10
10
|
<div :class="!isLoading || 'invisible'">
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
<script setup lang="ts">
|
|
34
34
|
import { D9Icon } from "../index";
|
|
35
|
-
import { ColorScheme, PositionHorizontal, Size } from "
|
|
35
|
+
import { ColorScheme, PositionHorizontal, Size } from "../types";
|
|
36
36
|
import { computed, withDefaults } from "vue";
|
|
37
37
|
|
|
38
38
|
interface ButtonProps {
|
package/src/Input/Input.vue
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
:placeholder="placeholder"
|
|
6
6
|
:class="{ ...inputClasses, ...textSizeClasses, ...disabledClasses }"
|
|
7
7
|
:type="type"
|
|
8
|
-
@input="input"
|
|
9
|
-
:tabindex="isDisabled ? '-1' :
|
|
8
|
+
@input="input($event)"
|
|
9
|
+
:tabindex="isDisabled ? '-1' : undefined"
|
|
10
10
|
/>
|
|
11
11
|
|
|
12
12
|
<span
|
|
@@ -33,7 +33,7 @@ interface InputProps {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
interface InputEmits {
|
|
36
|
-
(e: "onInput", value:
|
|
36
|
+
(e: "onInput", value: Event): void;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const props = withDefaults(defineProps<InputProps>(), {
|
|
@@ -69,7 +69,7 @@ const textSizeClasses = computed(() => {
|
|
|
69
69
|
};
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
const input = function (
|
|
73
|
-
emit("onInput",
|
|
72
|
+
const input = function (payload: Event): void {
|
|
73
|
+
emit("onInput", payload);
|
|
74
74
|
};
|
|
75
75
|
</script>
|
package/tsconfig.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
4
|
-
"module": "
|
|
3
|
+
"target": "es5",
|
|
4
|
+
"module": "es2015",
|
|
5
5
|
"strict": true,
|
|
6
6
|
"jsx": "preserve",
|
|
7
7
|
"importHelpers": true,
|
|
@@ -11,15 +11,18 @@
|
|
|
11
11
|
"esModuleInterop": true,
|
|
12
12
|
"allowSyntheticDefaultImports": true,
|
|
13
13
|
"sourceMap": true,
|
|
14
|
+
"outDir": "dist",
|
|
15
|
+
"declaration": true,
|
|
16
|
+
"declarationDir": ".",
|
|
14
17
|
"baseUrl": ".",
|
|
15
|
-
"types": [
|
|
16
|
-
"webpack-env"
|
|
17
|
-
],
|
|
18
18
|
"paths": {
|
|
19
19
|
"@/*": [
|
|
20
20
|
"src/*"
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
|
+
"types": [
|
|
24
|
+
"webpack-env"
|
|
25
|
+
],
|
|
23
26
|
"lib": [
|
|
24
27
|
"esnext",
|
|
25
28
|
"dom",
|
|
@@ -29,13 +32,11 @@
|
|
|
29
32
|
},
|
|
30
33
|
"include": [
|
|
31
34
|
"src/**/*.ts",
|
|
32
|
-
"src/**/*.tsx",
|
|
33
35
|
"src/**/*.vue",
|
|
34
|
-
"tests/**/*.ts",
|
|
35
|
-
"tests/**/*.tsx"
|
|
36
36
|
],
|
|
37
37
|
"exclude": [
|
|
38
38
|
"node_modules",
|
|
39
|
-
"./tailwind.config.js"
|
|
39
|
+
"./tailwind.config.js",
|
|
40
|
+
"./**/*.stories.ts"
|
|
40
41
|
]
|
|
41
42
|
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { defineConfig } from "vite";
|
|
3
|
+
import vue from "@vitejs/plugin-vue";
|
|
4
|
+
import typescript from "@rollup/plugin-typescript";
|
|
5
|
+
|
|
6
|
+
// https://vitejs.dev/config/
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [vue()],
|
|
9
|
+
publicDir: false,
|
|
10
|
+
build: {
|
|
11
|
+
lib: {
|
|
12
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
13
|
+
name: "index",
|
|
14
|
+
fileName: (format) => `index.${format}.js`,
|
|
15
|
+
},
|
|
16
|
+
rollupOptions: {
|
|
17
|
+
external: [
|
|
18
|
+
"vue",
|
|
19
|
+
"@fortawesome/fontawesome-svg-core",
|
|
20
|
+
"@fortawesome/free-solid-svg-icons",
|
|
21
|
+
"@fortawesome/vue-fontawesome",
|
|
22
|
+
],
|
|
23
|
+
output: {
|
|
24
|
+
globals: {
|
|
25
|
+
vue: "Vue",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
plugins: [
|
|
29
|
+
typescript({
|
|
30
|
+
target: "es5",
|
|
31
|
+
rootDir: path.resolve(__dirname, "./src"),
|
|
32
|
+
declaration: true,
|
|
33
|
+
declarationDir: path.resolve(__dirname, "./dist"),
|
|
34
|
+
exclude: path.resolve(__dirname, "./node_modules/**"),
|
|
35
|
+
allowSyntheticDefaultImports: true,
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|