@sysvale/component-library
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -397,6 +397,11 @@ import hljs from 'highlight.js'; | ||
function install(Vue) { | ||
console.log('components: ', components); | ||
if (install.installed) { return; } | ||
install.installed = true; | ||
Object.keys(components).forEach(function (componentName) { | ||
Vue.component(componentName, components[componentName]); | ||
if (componentName !== 'CustomWrapper') { | ||
Vue.component(componentName, components[componentName]); | ||
} | ||
}); | ||
@@ -403,0 +408,0 @@ } |
@@ -1,1 +0,1 @@ | ||
var ComponentLibrary=function(e,t,o){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t,o=o&&o.hasOwnProperty("default")?o.default:o;var n={props:{status_type:{type:String,default:"Negative",description:"A status that defines the color of the badge that will be redered.\n\t\t\t\tThe options are: 'Negative', 'Neutral', and 'Positive'",required:!1},content:{type:String,default:"Negativo",description:"The text that will be displayed inside the badge.",required:!0}},computed:{style:function(){var e="";switch(this.status_type){case"Neutral":e="neutral-badge";break;case"Positive":e="positive-badge";break;default:e="negative-badge"}return e}}};function a(e,t,o,n,a,i,s,r,d,l){"boolean"!=typeof s&&(d=r,r=s,s=!1);var c,u="function"==typeof o?o.options:o;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,a&&(u.functional=!0)),n&&(u._scopeId=n),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=c):t&&(c=s?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),c)if(u.functional){var p=u.render;u.render=function(e,t){return c.call(t),p(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return o}var i,s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function r(e){return function(e,t){return function(e,t){var o=s?t.media||"default":e,n=d[o]||(d[o]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);var a=t.source;if(t.map&&(a+="\n/*# sourceURL="+t.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),void 0===i&&(i=document.head||document.getElementsByTagName("head")[0]),i.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{var r=n.ids.size-1,l=document.createTextNode(a),c=n.element.childNodes;c[r]&&n.element.removeChild(c[r]),c.length?n.element.insertBefore(l,c[r]):n.element.appendChild(l)}}}(e,t)}}var d={};var l=a({render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"badge-container px-3 d-flex justify-content-center",class:this.style},[t("small",{staticClass:"regular"},[this._v("\n\t\t"+this._s(this.content)+"\n\t")])])},staticRenderFns:[]},(function(e){e&&e("data-v-63feb5f4_0",{source:".badge-container{border-radius:8px!important;width:fit-content}.neutral-badge{color:#efb300;background-color:#ffc10726}.positive-badge{color:#28a745;background-color:#28a74526}.negative-badge{color:#dc3545;background-color:#dc354526}",map:void 0,media:void 0})}),n,void 0,!1,void 0,!1,r,void 0,void 0),c=a({render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"savi-wrapper"},[o("b-container",{staticClass:"mx-auto my-5"},[o("div",{staticClass:"header"},[o("small",{staticClass:"text-muted"},[e._v("\n\t\t\t\tCOMPONENT\n\t\t\t")]),e._v(" "),o("h1",{staticClass:"title bold display-3"},[e._v("\n\t\t\t\t"+e._s(e.componentName)+"\n\t\t\t")])]),e._v(" "),o("p",{staticClass:"my-3 h5 light"},[e._v("\n\t\t\t"+e._s(e.componentDescription)+"\n\t\t")]),e._v(" "),o("hr"),e._v(" "),o("h2",{staticClass:"mt-5 mb-4"},[e._v("\n\t\t\tUsage\n\t\t")]),e._v(" "),e._t("usage"),e._v(" "),o("h2",{staticClass:"mt-5 mb-4"},[e._v("\n\t\t\tExample\n\t\t")]),e._v(" "),o("div",{staticClass:"preview-container d-flex flex-column"},[o("div",{staticClass:"preview"},[e._t("component-preview")],2),e._v(" "),o("div",{staticClass:"w-100 d-flex justify-content-end"},[o("button",{directives:[{name:"b-toggle",rawName:"v-b-toggle.collapse-2",modifiers:{"collapse-2":!0}}],staticClass:"small m-0 copy-button",on:{click:e.showCode}},[e._v("\n\t\t\t\t\t"+e._s(e.showCodeButtonText)+"\n\t\t\t\t")])])]),e._v(" "),o("div",{staticClass:"info-body"},[o("div",{staticClass:"summary",attrs:{"v-html":e.exampleSourceCode}}),e._v(" "),o("b-collapse",{attrs:{id:"collapse-2"}},[o("div",{staticClass:"usage code"},[o("pre",{ref:"usage",staticClass:"codeblock"},[e._v("\t\t\t\t\t\t"),o("code",{staticClass:"qs"},[e._v("\n\t\t\t\t\t\t\t"+e._s(e.exampleSourceCode)+"\n\t\t\t\t\t\t")]),e._v("\n\t\t\t\t\t")]),e._v(" "),o("div",{staticClass:"d-flex justify-content-end align-self-end"},[o("button",{staticClass:"small m-0 copy-code",on:{click:e.copyCode}},[e._v("\n\t\t\t\t\t\t\t"+e._s(e.copyCodeButtonText)+"\n\t\t\t\t\t\t")])])])]),e._v(" "),o("h2",{staticClass:"heading mt-5"},[e._v("\n\t\t\t\tProps table\n\t\t\t")]),e._v(" "),o("b-table",{staticClass:"mt-4 props-table",attrs:{hover:"",fixed:!0,"no-border-collapse":!1,items:e.formattedProps}})],1)],2)],1)},staticRenderFns:[]},(function(e){e&&e("data-v-6b0c0880_0",{source:".savi-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;color:#1f1f1f;background-color:#fdfdfd;font-family:Raleway,sans-serif}.title{margin:0;line-height:1.1875;color:#074fa6}.props-table{background-color:#fff;min-height:64px;border:1px solid #f0f0f0;border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 1px 3px 1px,rgba(0,0,0,.067) 0 0 0 1px}.code{background-color:#2e3440;display:flex;justify-content:space-between}.copy-code{background-color:#20242d;color:#f0f0f0;border:none;border-radius:4px}th{font-weight:600}.preview-container{min-height:64px;border:1px solid #f0f0f0;border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 1px 3px 1px,rgba(0,0,0,.067) 0 0 0 1px;background-color:#fff}.preview{all:initial;display:block;position:relative;padding:32px 32px 0 32px;font-family:'Noto Sans SC',sans-serif;font-weight:300;line-height:1.6}.heading{margin:0;font-size:24px;line-height:1.208;font-weight:500}.codeblock{margin:0;padding:8px 16px;font-size:12px;align-self:flex-end;background-color:#444;border-radius:0 0 4px 4px}.copy-button{border:1px solid rgba(0,0,0,.15);border-radius:3px;background-color:#fff;cursor:pointer;font-size:12.8px;padding:3px 10px;margin:10px}",map:void 0,media:void 0})}),{props:{componentData:{type:Object,required:!0,default:function(){}},exampleSourceCode:{type:String,required:!0,default:""},componentName:{type:String,required:!0,default:""},componentDescription:{type:String,required:!0,default:""}},data:function(){return{showCodeButtonText:"Show code",copyCodeButtonText:"Copy code",formattedProps:[]}},computed:{summary:function(){if(!this.exampleSourceCode)return"";var e=new o.Renderer;return e.code=function(e,o){t.highlightAuto(e,o?[o]:void 0).value},o.setOptions({renderer:e}),o(this.exampleSourceCode)}},mounted:function(){var e=this;_.values(this.componentData.props).forEach((function(t,o){var n={};n.name=_.keys(e.componentData.props)[o],n.type=t.type.name||"--",n.required=t.required||!1,n.defaultValue=t.default||"--",n.description=t.description||"--",e.formattedProps.push(n)})),this.highlight();var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href","https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/nord.min.css"),t.dataset.saviHead="true",document.head.appendChild(t)},beforeDestroy:function(){var e=document.head.querySelector("link[data-savi-head]");e&&document.head.removeChild(e)},methods:{highlight:function(){this.$refs.usage&&t.highlightBlock(this.$refs.usage,{languages:["html"]})},copyCode:function(){var e=document.createElement("textarea");this.copyCodeButtonText="Copied",e.value=this.exampleSourceCode,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e);var t=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);e.select(),document.execCommand("copy"),document.body.removeChild(e),t&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(t))},showCode:function(){var e=this;setTimeout((function(){e.copyCodeButtonText="Copy code"}),100),this.showCodeButtonText="Hide Code"===this.showCodeButtonText?"Show Code":"Hide Code"}}},void 0,!1,void 0,!1,r,void 0,void 0),u=Object.freeze({__proto__:null,Badge:l,CustomWrapper:c});var p={install:function e(t){e.installed||(e.installed=!0,Object.keys(u).forEach((function(e){t.component(e,u[e])})))}},f=null;return"undefined"!=typeof window?f=window.Vue:"undefined"!=typeof global&&(f=global.Vue),f&&f.use(p),e.Badge=l,e.CustomWrapper=c,e.default=p,e}({},hljs,marked); | ||
var ComponentLibrary=function(e,t,o){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t,o=o&&o.hasOwnProperty("default")?o.default:o;var n={props:{status_type:{type:String,default:"Negative",description:"A status that defines the color of the badge that will be redered.\n\t\t\t\tThe options are: 'Negative', 'Neutral', and 'Positive'",required:!1},content:{type:String,default:"Negativo",description:"The text that will be displayed inside the badge.",required:!0}},computed:{style:function(){var e="";switch(this.status_type){case"Neutral":e="neutral-badge";break;case"Positive":e="positive-badge";break;default:e="negative-badge"}return e}}};function a(e,t,o,n,a,i,s,r,d,l){"boolean"!=typeof s&&(d=r,r=s,s=!1);var c,u="function"==typeof o?o.options:o;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,a&&(u.functional=!0)),n&&(u._scopeId=n),i?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},u._ssrRegister=c):t&&(c=s?function(e){t.call(this,l(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,r(e))}),c)if(u.functional){var p=u.render;u.render=function(e,t){return c.call(t),p(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,c):[c]}return o}var i,s="undefined"!=typeof navigator&&/msie [6-9]\\b/.test(navigator.userAgent.toLowerCase());function r(e){return function(e,t){return function(e,t){var o=s?t.media||"default":e,n=d[o]||(d[o]={ids:new Set,styles:[]});if(!n.ids.has(e)){n.ids.add(e);var a=t.source;if(t.map&&(a+="\n/*# sourceURL="+t.map.sources[0]+" */",a+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t.map))))+" */"),n.element||(n.element=document.createElement("style"),n.element.type="text/css",t.media&&n.element.setAttribute("media",t.media),void 0===i&&(i=document.head||document.getElementsByTagName("head")[0]),i.appendChild(n.element)),"styleSheet"in n.element)n.styles.push(a),n.element.styleSheet.cssText=n.styles.filter(Boolean).join("\n");else{var r=n.ids.size-1,l=document.createTextNode(a),c=n.element.childNodes;c[r]&&n.element.removeChild(c[r]),c.length?n.element.insertBefore(l,c[r]):n.element.appendChild(l)}}}(e,t)}}var d={};var l=a({render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{staticClass:"badge-container px-3 d-flex justify-content-center",class:this.style},[t("small",{staticClass:"regular"},[this._v("\n\t\t"+this._s(this.content)+"\n\t")])])},staticRenderFns:[]},(function(e){e&&e("data-v-63feb5f4_0",{source:".badge-container{border-radius:8px!important;width:fit-content}.neutral-badge{color:#efb300;background-color:#ffc10726}.positive-badge{color:#28a745;background-color:#28a74526}.negative-badge{color:#dc3545;background-color:#dc354526}",map:void 0,media:void 0})}),n,void 0,!1,void 0,!1,r,void 0,void 0),c=a({render:function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"savi-wrapper"},[o("b-container",{staticClass:"mx-auto my-5"},[o("div",{staticClass:"header"},[o("small",{staticClass:"text-muted"},[e._v("\n\t\t\t\tCOMPONENT\n\t\t\t")]),e._v(" "),o("h1",{staticClass:"title bold display-3"},[e._v("\n\t\t\t\t"+e._s(e.componentName)+"\n\t\t\t")])]),e._v(" "),o("p",{staticClass:"my-3 h5 light"},[e._v("\n\t\t\t"+e._s(e.componentDescription)+"\n\t\t")]),e._v(" "),o("hr"),e._v(" "),o("h2",{staticClass:"mt-5 mb-4"},[e._v("\n\t\t\tUsage\n\t\t")]),e._v(" "),e._t("usage"),e._v(" "),o("h2",{staticClass:"mt-5 mb-4"},[e._v("\n\t\t\tExample\n\t\t")]),e._v(" "),o("div",{staticClass:"preview-container d-flex flex-column"},[o("div",{staticClass:"preview"},[e._t("component-preview")],2),e._v(" "),o("div",{staticClass:"w-100 d-flex justify-content-end"},[o("button",{directives:[{name:"b-toggle",rawName:"v-b-toggle.collapse-2",modifiers:{"collapse-2":!0}}],staticClass:"small m-0 copy-button",on:{click:e.showCode}},[e._v("\n\t\t\t\t\t"+e._s(e.showCodeButtonText)+"\n\t\t\t\t")])])]),e._v(" "),o("div",{staticClass:"info-body"},[o("div",{staticClass:"summary",attrs:{"v-html":e.exampleSourceCode}}),e._v(" "),o("b-collapse",{attrs:{id:"collapse-2"}},[o("div",{staticClass:"usage code"},[o("pre",{ref:"usage",staticClass:"codeblock"},[e._v("\t\t\t\t\t\t"),o("code",{staticClass:"qs"},[e._v("\n\t\t\t\t\t\t\t"+e._s(e.exampleSourceCode)+"\n\t\t\t\t\t\t")]),e._v("\n\t\t\t\t\t")]),e._v(" "),o("div",{staticClass:"d-flex justify-content-end align-self-end"},[o("button",{staticClass:"small m-0 copy-code",on:{click:e.copyCode}},[e._v("\n\t\t\t\t\t\t\t"+e._s(e.copyCodeButtonText)+"\n\t\t\t\t\t\t")])])])]),e._v(" "),o("h2",{staticClass:"heading mt-5"},[e._v("\n\t\t\t\tProps table\n\t\t\t")]),e._v(" "),o("b-table",{staticClass:"mt-4 props-table",attrs:{hover:"",fixed:!0,"no-border-collapse":!1,items:e.formattedProps}})],1)],2)],1)},staticRenderFns:[]},(function(e){e&&e("data-v-6b0c0880_0",{source:".savi-wrapper{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;color:#1f1f1f;background-color:#fdfdfd;font-family:Raleway,sans-serif}.title{margin:0;line-height:1.1875;color:#074fa6}.props-table{background-color:#fff;min-height:64px;border:1px solid #f0f0f0;border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 1px 3px 1px,rgba(0,0,0,.067) 0 0 0 1px}.code{background-color:#2e3440;display:flex;justify-content:space-between}.copy-code{background-color:#20242d;color:#f0f0f0;border:none;border-radius:4px}th{font-weight:600}.preview-container{min-height:64px;border:1px solid #f0f0f0;border-radius:4px;box-shadow:rgba(0,0,0,.1) 0 1px 3px 1px,rgba(0,0,0,.067) 0 0 0 1px;background-color:#fff}.preview{all:initial;display:block;position:relative;padding:32px 32px 0 32px;font-family:'Noto Sans SC',sans-serif;font-weight:300;line-height:1.6}.heading{margin:0;font-size:24px;line-height:1.208;font-weight:500}.codeblock{margin:0;padding:8px 16px;font-size:12px;align-self:flex-end;background-color:#444;border-radius:0 0 4px 4px}.copy-button{border:1px solid rgba(0,0,0,.15);border-radius:3px;background-color:#fff;cursor:pointer;font-size:12.8px;padding:3px 10px;margin:10px}",map:void 0,media:void 0})}),{props:{componentData:{type:Object,required:!0,default:function(){}},exampleSourceCode:{type:String,required:!0,default:""},componentName:{type:String,required:!0,default:""},componentDescription:{type:String,required:!0,default:""}},data:function(){return{showCodeButtonText:"Show code",copyCodeButtonText:"Copy code",formattedProps:[]}},computed:{summary:function(){if(!this.exampleSourceCode)return"";var e=new o.Renderer;return e.code=function(e,o){t.highlightAuto(e,o?[o]:void 0).value},o.setOptions({renderer:e}),o(this.exampleSourceCode)}},mounted:function(){var e=this;_.values(this.componentData.props).forEach((function(t,o){var n={};n.name=_.keys(e.componentData.props)[o],n.type=t.type.name||"--",n.required=t.required||!1,n.defaultValue=t.default||"--",n.description=t.description||"--",e.formattedProps.push(n)})),this.highlight();var t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href","https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/nord.min.css"),t.dataset.saviHead="true",document.head.appendChild(t)},beforeDestroy:function(){var e=document.head.querySelector("link[data-savi-head]");e&&document.head.removeChild(e)},methods:{highlight:function(){this.$refs.usage&&t.highlightBlock(this.$refs.usage,{languages:["html"]})},copyCode:function(){var e=document.createElement("textarea");this.copyCodeButtonText="Copied",e.value=this.exampleSourceCode,e.setAttribute("readonly",""),e.style.position="absolute",e.style.left="-9999px",document.body.appendChild(e);var t=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);e.select(),document.execCommand("copy"),document.body.removeChild(e),t&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(t))},showCode:function(){var e=this;setTimeout((function(){e.copyCodeButtonText="Copy code"}),100),this.showCodeButtonText="Hide Code"===this.showCodeButtonText?"Show Code":"Hide Code"}}},void 0,!1,void 0,!1,r,void 0,void 0),u=Object.freeze({__proto__:null,Badge:l,CustomWrapper:c});var p={install:function e(t){console.log("components: ",u),e.installed||(e.installed=!0,Object.keys(u).forEach((function(e){"CustomWrapper"!==e&&t.component(e,u[e])})))}},f=null;return"undefined"!=typeof window?f=window.Vue:"undefined"!=typeof global&&(f=global.Vue),f&&f.use(p),e.Badge=l,e.CustomWrapper=c,e.default=p,e}({},hljs,marked); |
@@ -359,6 +359,11 @@ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});function _interopDefault(e){return(e&&(typeof e==='object')&&'default'in e)?e['default']:e}var hljs=_interopDefault(require('highlight.js')),marked=_interopDefault(require('marked'));// | ||
function install(Vue) { | ||
console.log('components: ', components); | ||
if (install.installed) { return; } | ||
install.installed = true; | ||
Object.keys(components).forEach(function (componentName) { | ||
Vue.component(componentName, components[componentName]); | ||
if (componentName !== 'CustomWrapper') { | ||
Vue.component(componentName, components[componentName]); | ||
} | ||
}); | ||
@@ -365,0 +370,0 @@ } |
{ | ||
"name": "@sysvale/component-library", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/@sysvale/component-library.ssr.js", |
66165
1113