@rei/cdr-button
Advanced tools
Comparing version 1.0.2 to 1.0.3-alpha.0
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@rei/cdr-icon"),require("@rei/cdr-icon/dist/cdr-icon.css")):"function"==typeof define&&define.amd?define("CdrButton",["@rei/cdr-icon","@rei/cdr-icon/dist/cdr-icon.css"],n):"object"==typeof exports?exports.CdrButton=n(require("@rei/cdr-icon"),require("@rei/cdr-icon/dist/cdr-icon.css")):t.CdrButton=n(t["@rei/cdr-icon"],t["@rei/cdr-icon/dist/cdr-icon.css"])}("undefined"!=typeof self?self:this,function(t,n){return function(t){var n={};function r(o){if(n[o])return n[o].exports;var e=n[o]={i:o,l:!1,exports:{}};return t[o].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=t,r.c=n,r.d=function(t,n,o){r.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="/",r(r.s=13)}([function(t,n,r){"use strict";var o=r(14),e=r(2),s=r(17),i=r(1);var u=Object(i.a)(e.a,o.a,o.b,!1,function(t){this.$style=s.default.locals||s.default},null,null);n.a=u.exports},function(t,n,r){"use strict";n.a=function(t,n,r,o,e,s,i,u){var c,a="function"==typeof t?t.options:t;n&&(a.render=n,a.staticRenderFns=r,a._compiled=!0);o&&(a.functional=!0);s&&(a._scopeId="data-v-"+s);i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),e&&e.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},a._ssrRegister=c):e&&(c=u?function(){e.call(this,this.$root.$options.shadowRoot)}:e);if(c)if(a.functional){a._injectStyles=c;var l=a.render;a.render=function(t,n){return c.call(n),l(t,n)}}else{var d=a.beforeCreate;a.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:a}}},function(t,n,r){"use strict";var o=r(3);n.a=o.a},function(t,n,r){"use strict";var o=r(16);n.a={name:"CdrButton",mixins:[o.a],props:{tag:{type:String,default:"button",validator:function(t){return["button","a"].indexOf(t)>=0||!1}},type:{type:String,default:"button",validator:function(t){return["button","submit","reset"].indexOf(t)>=0||!1}},onClick:{type:Function,default:function(){return function(){return null}}},fullWidth:{type:Boolean,default:!1,validator:function(t){return"boolean"==typeof t}},size:{type:String,default:"medium",validator:function(t){return["small","medium","large"].indexOf(t)>=0||!1}},responsiveSize:{type:Array},iconOnly:{type:Boolean,default:!1},onDark:{type:Boolean,default:!1}},computed:{baseClass:function(){return"cdr-button"},sizeClass:function(){return this.iconOnly?null:this.modifyClassName(this.baseClass,this.size)},responsiveClass:function(){var t=this,n=[];return this.responsiveSize&&!this.iconOnly&&this.responsiveSize.forEach(function(r){n.push(t.modifyClassName(t.baseClass,r))}),n.join(" ")},iconClass:function(){var t=[];return this.$slots.icon&&this.$slots.default&&t.push(this.modifyClassName(this.baseClass,"has-icon")),this.iconOnly&&(t.push(this.modifyClassName(this.baseClass,"icon-only")),this.onDark&&t.push(this.modifyClassName(this.baseClass,"on-dark"))),t.join(" ")},fullWidthClass:function(){return this.fullWidth&&!this.iconOnly?this.modifyClassName(this.baseClass,"full-width"):null}}}},function(t,n){t.exports={"cdr-button":"cdr-button_1.0.2","cdr-button--secondary":"cdr-button--secondary_1.0.2","cdr-button--large":"cdr-button--large_1.0.2","cdr-button--has-icon":"cdr-button--has-icon_1.0.2","cdr-button--medium":"cdr-button--medium_1.0.2","cdr-button--small":"cdr-button--small_1.0.2","cdr-button--full-width":"cdr-button--full-width_1.0.2","cdr-button--icon-only":"cdr-button--icon-only_1.0.2","cdr-button--on-dark":"cdr-button--on-dark_1.0.2","cdr-button--small@xs":"cdr-button--small@xs_1.0.2","cdr-button--medium@xs":"cdr-button--medium@xs_1.0.2","cdr-button--large@xs":"cdr-button--large@xs_1.0.2","cdr-button--small@sm":"cdr-button--small@sm_1.0.2","cdr-button--medium@sm":"cdr-button--medium@sm_1.0.2","cdr-button--large@sm":"cdr-button--large@sm_1.0.2","cdr-button--small@md":"cdr-button--small@md_1.0.2","cdr-button--medium@md":"cdr-button--medium@md_1.0.2","cdr-button--large@md":"cdr-button--large@md_1.0.2","cdr-button--small@lg":"cdr-button--small@lg_1.0.2","cdr-button--medium@lg":"cdr-button--medium@lg_1.0.2","cdr-button--large@lg":"cdr-button--large@lg_1.0.2"}},function(t,n,r){"use strict";var o=r(6);n.a=o.a},function(t,n,r){"use strict";var o=r(7),e=(r.n(o),r(8)),s=(r.n(e),r(0));n.a={name:"CdrCloseButton",components:{IconXLg:o.IconXLg,CdrButton:s.a},extends:s.a}},function(n,r){n.exports=t},function(t,r){t.exports=n},function(t,n){},function(t,n,r){"use strict";var o=r(11);n.a=o.a},function(t,n,r){"use strict";var o=r(7),e=(r.n(o),r(8)),s=(r.n(e),r(0));n.a={name:"CdrPlayButton",components:{IconPlay:o.IconPlay,CdrButton:s.a},extends:s.a}},function(t,n){},function(t,n,r){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=r(0);r.d(n,"CdrButton",function(){return o.a});var e=r(18);r.d(n,"CdrCloseButton",function(){return e.a});var s=r(22);r.d(n,"CdrPlayButton",function(){return s.a})},function(t,n,r){"use strict";var o=r(15);r.d(n,"a",function(){return o.a}),r.d(n,"b",function(){return o.b})},function(t,n,r){"use strict";r.d(n,"a",function(){return o}),r.d(n,"b",function(){return e});var o=function(){var t=this,n=t.$createElement;return(t._self._c||n)(t.tag,{tag:"component",class:[t.modifierClass,t.sizeClass,t.fullWidthClass,t.responsiveClass,t.iconClass],attrs:{type:"button"===t.tag?t.type:null},on:{click:t.onClick}},[t._t("icon"),t._v(" "),t._t("default")],2)},e=[]},function(t,n,r){"use strict";n.a={props:{modifier:String},computed:{modifierClass:function(){var t=this,n=this.baseClass,r=this.modifier?this.modifier.split(" "):[],o=[];return this.$style?(o.push(this.moduleClass(n)),o=o.concat(r.map(function(r){return t.modifyClassName(n,r)}))):(o.push(""+n),o=o.concat(r.map(function(r){return t.modifyClassName(n,r)}))),o.join(" ")}},methods:{moduleClass:function(t){return this.$style[""+t]},modifyClassName:function(t,n){return this.$style?this.moduleClass(t+"--"+n):t+"--"+n}}}},function(t,n,r){"use strict";var o=r(4),e=r.n(o);n.default=e.a},function(t,n,r){"use strict";var o=r(19),e=r(5),s=(r(21),r(1)),i=Object(s.a)(e.a,o.a,o.b,!1,null,null,null);n.a=i.exports},function(t,n,r){"use strict";var o=r(20);r.d(n,"a",function(){return o.a}),r.d(n,"b",function(){return o.b})},function(t,n,r){"use strict";r.d(n,"a",function(){return o}),r.d(n,"b",function(){return e});var o=function(){var t=this.$createElement,n=this._self._c||t;return n("cdr-button",{attrs:{"icon-only":!0,"on-dark":this.onDark,"aria-label":"Close"}},[n("icon-x-lg",{staticClass:"cdr-button__icon",attrs:{slot:"icon"},slot:"icon"})],1)},e=[]},function(t,n,r){"use strict";var o=r(9);r.n(o).a},function(t,n,r){"use strict";var o=r(23),e=r(10),s=(r(25),r(1)),i=Object(s.a)(e.a,o.a,o.b,!1,null,null,null);n.a=i.exports},function(t,n,r){"use strict";var o=r(24);r.d(n,"a",function(){return o.a}),r.d(n,"b",function(){return o.b})},function(t,n,r){"use strict";r.d(n,"a",function(){return o}),r.d(n,"b",function(){return e});var o=function(){var t=this.$createElement,n=this._self._c||t;return n("cdr-button",{attrs:{"icon-only":!0,"on-dark":this.onDark,"aria-label":"Play"}},[n("icon-play",{staticClass:"cdr-button__icon",attrs:{slot:"icon"},slot:"icon"})],1)},e=[]},function(t,n,r){"use strict";var o=r(12);r.n(o).a}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("@rei/cdr-icon")):"function"==typeof define&&define.amd?define("CdrButton",["@rei/cdr-icon"],n):"object"==typeof exports?exports.CdrButton=n(require("@rei/cdr-icon")):t.CdrButton=n(t["@rei/cdr-icon"])}("undefined"!=typeof self?self:this,function(t){return function(t){var n={};function o(e){if(n[e])return n[e].exports;var r=n[e]={i:e,l:!1,exports:{}};return t[e].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=t,o.c=n,o.d=function(t,n,e){o.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:e})},o.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(n,"a",n),n},o.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},o.p="/",o(o.s=11)}([function(t,n,o){"use strict";var e=o(12),r=o(2),a=o(15),s=(o(16),o(1));var i=Object(s.a)(r.a,e.a,e.b,!1,function(t){this.$style=a.default.locals||a.default},null,null);n.a=i.exports},function(t,n,o){"use strict";n.a=function(t,n,o,e,r,a,s,i){var u,c="function"==typeof t?t.options:t;n&&(c.render=n,c.staticRenderFns=o,c._compiled=!0);e&&(c.functional=!0);a&&(c._scopeId="data-v-"+a);s?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},c._ssrRegister=u):r&&(u=i?function(){r.call(this,this.$root.$options.shadowRoot)}:r);if(u)if(c.functional){c._injectStyles=u;var l=c.render;c.render=function(t,n){return u.call(n),l(t,n)}}else{var d=c.beforeCreate;c.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:c}}},function(t,n,o){"use strict";var e=o(3);n.a=e.a},function(t,n,o){"use strict";var e=o(14);n.a={name:"CdrButton",mixins:[e.a],props:{tag:{type:String,default:"button",validator:function(t){return["button","a"].indexOf(t)>=0||!1}},type:{type:String,default:"button",validator:function(t){return["button","submit","reset"].indexOf(t)>=0||!1}},onClick:{type:Function,default:function(){return function(){return null}}},fullWidth:{type:Boolean,default:!1,validator:function(t){return"boolean"==typeof t}},size:{type:String,default:"medium",validator:function(t){return["small","medium","large"].indexOf(t)>=0||!1}},responsiveSize:{type:Array},iconOnly:{type:Boolean,default:!1},onDark:{type:Boolean,default:!1}},computed:{baseClass:function(){return"cdr-button"},sizeClass:function(){return this.iconOnly?null:this.modifyClassName(this.baseClass,this.size)},responsiveClass:function(){var t=this,n=[];return this.responsiveSize&&!this.iconOnly&&this.responsiveSize.forEach(function(o){n.push(t.modifyClassName(t.baseClass,o))}),n.join(" ")},iconClass:function(){var t=[];return this.$slots.icon&&this.$slots.default&&t.push(this.modifyClassName(this.baseClass,"has-icon")),this.iconOnly&&(t.push(this.modifyClassName(this.baseClass,"icon-only")),this.onDark&&t.push(this.modifyClassName(this.baseClass,"on-dark"))),t.join(" ")},fullWidthClass:function(){return this.fullWidth&&!this.iconOnly?this.modifyClassName(this.baseClass,"full-width"):null}}}},function(t,n){t.exports={"cdr-button":"cdr-button_1.0.3-alpha.0","cdr-button--secondary":"cdr-button--secondary_1.0.3-alpha.0","cdr-button--large":"cdr-button--large_1.0.3-alpha.0","cdr-button--has-icon":"cdr-button--has-icon_1.0.3-alpha.0","cdr-button--medium":"cdr-button--medium_1.0.3-alpha.0","cdr-button--small":"cdr-button--small_1.0.3-alpha.0","cdr-button--full-width":"cdr-button--full-width_1.0.3-alpha.0","cdr-button--icon-only":"cdr-button--icon-only_1.0.3-alpha.0","cdr-button--on-dark":"cdr-button--on-dark_1.0.3-alpha.0","cdr-button--small@xs":"cdr-button--small@xs_1.0.3-alpha.0","cdr-button--medium@xs":"cdr-button--medium@xs_1.0.3-alpha.0","cdr-button--large@xs":"cdr-button--large@xs_1.0.3-alpha.0","cdr-button--small@sm":"cdr-button--small@sm_1.0.3-alpha.0","cdr-button--medium@sm":"cdr-button--medium@sm_1.0.3-alpha.0","cdr-button--large@sm":"cdr-button--large@sm_1.0.3-alpha.0","cdr-button--small@md":"cdr-button--small@md_1.0.3-alpha.0","cdr-button--medium@md":"cdr-button--medium@md_1.0.3-alpha.0","cdr-button--large@md":"cdr-button--large@md_1.0.3-alpha.0","cdr-button--small@lg":"cdr-button--small@lg_1.0.3-alpha.0","cdr-button--medium@lg":"cdr-button--medium@lg_1.0.3-alpha.0","cdr-button--large@lg":"cdr-button--large@lg_1.0.3-alpha.0"}},function(t,n){},function(t,n,o){"use strict";var e=o(7);n.a=e.a},function(t,n,o){"use strict";var e=o(8),r=(o.n(e),o(0));n.a={name:"CdrCloseButton",components:{IconXLg:e.IconXLg,CdrButton:r.a},extends:r.a}},function(n,o){n.exports=t},function(t,n,o){"use strict";var e=o(10);n.a=e.a},function(t,n,o){"use strict";var e=o(8),r=(o.n(e),o(0));n.a={name:"CdrPlayButton",components:{IconPlay:e.IconPlay,CdrButton:r.a},extends:r.a}},function(t,n,o){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var e=o(0);o.d(n,"CdrButton",function(){return e.a});var r=o(17);o.d(n,"CdrCloseButton",function(){return r.a});var a=o(20);o.d(n,"CdrPlayButton",function(){return a.a})},function(t,n,o){"use strict";var e=o(13);o.d(n,"a",function(){return e.a}),o.d(n,"b",function(){return e.b})},function(t,n,o){"use strict";o.d(n,"a",function(){return e}),o.d(n,"b",function(){return r});var e=function(){var t=this,n=t.$createElement;return(t._self._c||n)(t.tag,{tag:"component",class:[t.modifierClass,t.sizeClass,t.fullWidthClass,t.responsiveClass,t.iconClass],attrs:{type:"button"===t.tag?t.type:null},on:{click:t.onClick}},[t._t("icon"),t._v(" "),t._t("default")],2)},r=[]},function(t,n,o){"use strict";n.a={props:{modifier:String},computed:{modifierClass:function(){var t=this,n=this.baseClass,o=this.modifier?this.modifier.split(" "):[],e=[];return this.$style?(e.push(this.moduleClass(n)),e=e.concat(o.map(function(o){return t.modifyClassName(n,o)}))):(e.push(""+n),e=e.concat(o.map(function(o){return t.modifyClassName(n,o)}))),e.join(" ")}},methods:{moduleClass:function(t){return this.$style[""+t]},modifyClassName:function(t,n){return this.$style?this.moduleClass(t+"--"+n):t+"--"+n}}}},function(t,n,o){"use strict";var e=o(4),r=o.n(e);n.default=r.a},function(t,n,o){"use strict";var e=o(5);o.n(e).a},function(t,n,o){"use strict";var e=o(18),r=o(6),a=o(1),s=Object(a.a)(r.a,e.a,e.b,!1,null,null,null);n.a=s.exports},function(t,n,o){"use strict";var e=o(19);o.d(n,"a",function(){return e.a}),o.d(n,"b",function(){return e.b})},function(t,n,o){"use strict";o.d(n,"a",function(){return e}),o.d(n,"b",function(){return r});var e=function(){var t=this.$createElement,n=this._self._c||t;return n("cdr-button",{attrs:{"icon-only":!0,"on-dark":this.onDark,"aria-label":"Close"}},[n("icon-x-lg",{staticClass:"cdr-button__icon",attrs:{slot:"icon"},slot:"icon"})],1)},r=[]},function(t,n,o){"use strict";var e=o(21),r=o(9),a=o(1),s=Object(a.a)(r.a,e.a,e.b,!1,null,null,null);n.a=s.exports},function(t,n,o){"use strict";var e=o(22);o.d(n,"a",function(){return e.a}),o.d(n,"b",function(){return e.b})},function(t,n,o){"use strict";o.d(n,"a",function(){return e}),o.d(n,"b",function(){return r});var e=function(){var t=this.$createElement,n=this._self._c||t;return n("cdr-button",{attrs:{"icon-only":!0,"on-dark":this.onDark,"aria-label":"Play"}},[n("icon-play",{staticClass:"cdr-button__icon",attrs:{slot:"icon"},slot:"icon"})],1)},r=[]}])}); |
@@ -1,1 +0,1 @@ | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("CdrButton",[],n):"object"==typeof exports?exports.CdrButton=n():t.CdrButton=n()}("undefined"!=typeof self?self:this,function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,e),s.l=!0,s.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s=3)}([function(t,n,e){"use strict";var o=e(1);n.a=o.a},function(t,n,e){"use strict";var o=e(7);n.a={name:"CdrButton",mixins:[o.a],props:{tag:{type:String,default:"button",validator:function(t){return["button","a"].indexOf(t)>=0||!1}},type:{type:String,default:"button",validator:function(t){return["button","submit","reset"].indexOf(t)>=0||!1}},onClick:{type:Function,default:function(){return function(){return null}}},fullWidth:{type:Boolean,default:!1,validator:function(t){return"boolean"==typeof t}},size:{type:String,default:"medium",validator:function(t){return["small","medium","large"].indexOf(t)>=0||!1}},responsiveSize:{type:Array},iconOnly:{type:Boolean,default:!1},onDark:{type:Boolean,default:!1}},computed:{baseClass:function(){return"cdr-button"},sizeClass:function(){return this.iconOnly?null:this.modifyClassName(this.baseClass,this.size)},responsiveClass:function(){var t=this,n=[];return this.responsiveSize&&!this.iconOnly&&this.responsiveSize.forEach(function(e){n.push(t.modifyClassName(t.baseClass,e))}),n.join(" ")},iconClass:function(){var t=[];return this.$slots.icon&&this.$slots.default&&t.push(this.modifyClassName(this.baseClass,"has-icon")),this.iconOnly&&(t.push(this.modifyClassName(this.baseClass,"icon-only")),this.onDark&&t.push(this.modifyClassName(this.baseClass,"on-dark"))),t.join(" ")},fullWidthClass:function(){return this.fullWidth&&!this.iconOnly?this.modifyClassName(this.baseClass,"full-width"):null}}}},function(t,n){t.exports={"cdr-button":"cdr-button_1.0.2","cdr-button--secondary":"cdr-button--secondary_1.0.2","cdr-button--large":"cdr-button--large_1.0.2","cdr-button--has-icon":"cdr-button--has-icon_1.0.2","cdr-button--medium":"cdr-button--medium_1.0.2","cdr-button--small":"cdr-button--small_1.0.2","cdr-button--full-width":"cdr-button--full-width_1.0.2","cdr-button--icon-only":"cdr-button--icon-only_1.0.2","cdr-button--on-dark":"cdr-button--on-dark_1.0.2","cdr-button--small@xs":"cdr-button--small@xs_1.0.2","cdr-button--medium@xs":"cdr-button--medium@xs_1.0.2","cdr-button--large@xs":"cdr-button--large@xs_1.0.2","cdr-button--small@sm":"cdr-button--small@sm_1.0.2","cdr-button--medium@sm":"cdr-button--medium@sm_1.0.2","cdr-button--large@sm":"cdr-button--large@sm_1.0.2","cdr-button--small@md":"cdr-button--small@md_1.0.2","cdr-button--medium@md":"cdr-button--medium@md_1.0.2","cdr-button--large@md":"cdr-button--large@md_1.0.2","cdr-button--small@lg":"cdr-button--small@lg_1.0.2","cdr-button--medium@lg":"cdr-button--medium@lg_1.0.2","cdr-button--large@lg":"cdr-button--large@lg_1.0.2"}},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(4);function s(t){t.component("cdr-button",o.a)}"undefined"!=typeof window&&window.Vue&&window.Vue.use(s),n.default=s},function(t,n,e){"use strict";var o=e(5),s=e(0),r=e(8),i=e(9);var u=Object(i.a)(s.a,o.a,o.b,!1,function(t){this.$style=r.default.locals||r.default},null,null);n.a=u.exports},function(t,n,e){"use strict";var o=e(6);e.d(n,"a",function(){return o.a}),e.d(n,"b",function(){return o.b})},function(t,n,e){"use strict";e.d(n,"a",function(){return o}),e.d(n,"b",function(){return s});var o=function(){var t=this,n=t.$createElement;return(t._self._c||n)(t.tag,{tag:"component",class:[t.modifierClass,t.sizeClass,t.fullWidthClass,t.responsiveClass,t.iconClass],attrs:{type:"button"===t.tag?t.type:null},on:{click:t.onClick}},[t._t("icon"),t._v(" "),t._t("default")],2)},s=[]},function(t,n,e){"use strict";n.a={props:{modifier:String},computed:{modifierClass:function(){var t=this,n=this.baseClass,e=this.modifier?this.modifier.split(" "):[],o=[];return this.$style?(o.push(this.moduleClass(n)),o=o.concat(e.map(function(e){return t.modifyClassName(n,e)}))):(o.push(""+n),o=o.concat(e.map(function(e){return t.modifyClassName(n,e)}))),o.join(" ")}},methods:{moduleClass:function(t){return this.$style[""+t]},modifyClassName:function(t,n){return this.$style?this.moduleClass(t+"--"+n):t+"--"+n}}}},function(t,n,e){"use strict";var o=e(2),s=e.n(o);n.default=s.a},function(t,n,e){"use strict";n.a=function(t,n,e,o,s,r,i,u){var a,l="function"==typeof t?t.options:t;n&&(l.render=n,l.staticRenderFns=e,l._compiled=!0);o&&(l.functional=!0);r&&(l._scopeId="data-v-"+r);i?(a=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=a):s&&(a=u?function(){s.call(this,this.$root.$options.shadowRoot)}:s);if(a)if(l.functional){l._injectStyles=a;var d=l.render;l.render=function(t,n){return a.call(n),d(t,n)}}else{var c=l.beforeCreate;l.beforeCreate=c?[].concat(c,a):[a]}return{exports:t,options:l}}}])}); | ||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("CdrButton",[],n):"object"==typeof exports?exports.CdrButton=n():t.CdrButton=n()}("undefined"!=typeof self?self:this,function(){return function(t){var n={};function e(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,e),s.l=!0,s.exports}return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="/",e(e.s=4)}([function(t,n,e){"use strict";var o=e(1);n.a=o.a},function(t,n,e){"use strict";var o=e(8);n.a={name:"CdrButton",mixins:[o.a],props:{tag:{type:String,default:"button",validator:function(t){return["button","a"].indexOf(t)>=0||!1}},type:{type:String,default:"button",validator:function(t){return["button","submit","reset"].indexOf(t)>=0||!1}},onClick:{type:Function,default:function(){return function(){return null}}},fullWidth:{type:Boolean,default:!1,validator:function(t){return"boolean"==typeof t}},size:{type:String,default:"medium",validator:function(t){return["small","medium","large"].indexOf(t)>=0||!1}},responsiveSize:{type:Array},iconOnly:{type:Boolean,default:!1},onDark:{type:Boolean,default:!1}},computed:{baseClass:function(){return"cdr-button"},sizeClass:function(){return this.iconOnly?null:this.modifyClassName(this.baseClass,this.size)},responsiveClass:function(){var t=this,n=[];return this.responsiveSize&&!this.iconOnly&&this.responsiveSize.forEach(function(e){n.push(t.modifyClassName(t.baseClass,e))}),n.join(" ")},iconClass:function(){var t=[];return this.$slots.icon&&this.$slots.default&&t.push(this.modifyClassName(this.baseClass,"has-icon")),this.iconOnly&&(t.push(this.modifyClassName(this.baseClass,"icon-only")),this.onDark&&t.push(this.modifyClassName(this.baseClass,"on-dark"))),t.join(" ")},fullWidthClass:function(){return this.fullWidth&&!this.iconOnly?this.modifyClassName(this.baseClass,"full-width"):null}}}},function(t,n){t.exports={"cdr-button":"cdr-button_1.0.3-alpha.0","cdr-button--secondary":"cdr-button--secondary_1.0.3-alpha.0","cdr-button--large":"cdr-button--large_1.0.3-alpha.0","cdr-button--has-icon":"cdr-button--has-icon_1.0.3-alpha.0","cdr-button--medium":"cdr-button--medium_1.0.3-alpha.0","cdr-button--small":"cdr-button--small_1.0.3-alpha.0","cdr-button--full-width":"cdr-button--full-width_1.0.3-alpha.0","cdr-button--icon-only":"cdr-button--icon-only_1.0.3-alpha.0","cdr-button--on-dark":"cdr-button--on-dark_1.0.3-alpha.0","cdr-button--small@xs":"cdr-button--small@xs_1.0.3-alpha.0","cdr-button--medium@xs":"cdr-button--medium@xs_1.0.3-alpha.0","cdr-button--large@xs":"cdr-button--large@xs_1.0.3-alpha.0","cdr-button--small@sm":"cdr-button--small@sm_1.0.3-alpha.0","cdr-button--medium@sm":"cdr-button--medium@sm_1.0.3-alpha.0","cdr-button--large@sm":"cdr-button--large@sm_1.0.3-alpha.0","cdr-button--small@md":"cdr-button--small@md_1.0.3-alpha.0","cdr-button--medium@md":"cdr-button--medium@md_1.0.3-alpha.0","cdr-button--large@md":"cdr-button--large@md_1.0.3-alpha.0","cdr-button--small@lg":"cdr-button--small@lg_1.0.3-alpha.0","cdr-button--medium@lg":"cdr-button--medium@lg_1.0.3-alpha.0","cdr-button--large@lg":"cdr-button--large@lg_1.0.3-alpha.0"}},function(t,n){},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=e(5);function s(t){t.component("cdr-button",o.a)}"undefined"!=typeof window&&window.Vue&&window.Vue.use(s),n.default=s},function(t,n,e){"use strict";var o=e(6),s=e(0),r=e(9),a=(e(10),e(11));var i=Object(a.a)(s.a,o.a,o.b,!1,function(t){this.$style=r.default.locals||r.default},null,null);n.a=i.exports},function(t,n,e){"use strict";var o=e(7);e.d(n,"a",function(){return o.a}),e.d(n,"b",function(){return o.b})},function(t,n,e){"use strict";e.d(n,"a",function(){return o}),e.d(n,"b",function(){return s});var o=function(){var t=this,n=t.$createElement;return(t._self._c||n)(t.tag,{tag:"component",class:[t.modifierClass,t.sizeClass,t.fullWidthClass,t.responsiveClass,t.iconClass],attrs:{type:"button"===t.tag?t.type:null},on:{click:t.onClick}},[t._t("icon"),t._v(" "),t._t("default")],2)},s=[]},function(t,n,e){"use strict";n.a={props:{modifier:String},computed:{modifierClass:function(){var t=this,n=this.baseClass,e=this.modifier?this.modifier.split(" "):[],o=[];return this.$style?(o.push(this.moduleClass(n)),o=o.concat(e.map(function(e){return t.modifyClassName(n,e)}))):(o.push(""+n),o=o.concat(e.map(function(e){return t.modifyClassName(n,e)}))),o.join(" ")}},methods:{moduleClass:function(t){return this.$style[""+t]},modifyClassName:function(t,n){return this.$style?this.moduleClass(t+"--"+n):t+"--"+n}}}},function(t,n,e){"use strict";var o=e(2),s=e.n(o);n.default=s.a},function(t,n,e){"use strict";var o=e(3);e.n(o).a},function(t,n,e){"use strict";n.a=function(t,n,e,o,s,r,a,i){var u,l="function"==typeof t?t.options:t;n&&(l.render=n,l.staticRenderFns=e,l._compiled=!0);o&&(l.functional=!0);r&&(l._scopeId="data-v-"+r);a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},l._ssrRegister=u):s&&(u=i?function(){s.call(this,this.$root.$options.shadowRoot)}:s);if(u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(t,n){return u.call(n),c(t,n)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,u):[u]}return{exports:t,options:l}}}])}); |
{ | ||
"name": "@rei/cdr-button", | ||
"version": "1.0.2", | ||
"version": "1.0.3-alpha.0", | ||
"author": "REI Software Engineering", | ||
@@ -32,3 +32,3 @@ "description": "REI Cedar Style Framework - Vue Component for Button", | ||
"@rei/cdr-icon": "^1.0.0", | ||
"vue": "^2.5.13" | ||
"vue": "^2.5.17" | ||
}, | ||
@@ -39,6 +39,3 @@ "devDependencies": { | ||
"pkg-ok": "^1.1.0" | ||
}, | ||
"dependencies": { | ||
"vue": "^2.5.17" | ||
} | ||
} |
107
README.md
@@ -8,3 +8,3 @@ # CdrButton | ||
| tag | string | button | | ||
| Render CdrButton as a `<button>` or `<a>` element. When using a value of a, this element renders as an anchor link. Possible values: { button, a } | | ||
| Renders CdrButton as a <button> or <a> element. When using the value of <a>, this element renders as an achor link. Possible values: { 'button' | 'a' } | | ||
@@ -14,3 +14,3 @@ | Name | Type | Default | | ||
| type| string | button | | ||
| Set the button type. Possible values: { button, submit, reset} | | ||
| Sets the button type. Possible values: { 'button' | 'submit' | 'reset' } | | ||
@@ -20,3 +20,3 @@ | Name | Type | Default | | ||
| onClick | function | return null | | ||
| Add custom click actions. | | ||
| Adds custom click actions. | | ||
@@ -26,3 +26,3 @@ | Name | Type | Default | | ||
| fullWidth | boolean | false | | ||
| Set button width to 100%. Setting it to true will set the button width to 100% of the parent container. Use the full-width prop with the size prop to control top and bottom padding. | | ||
| Sets button width to 100%. Setting it to true will set the button width to 100% of the parent container. Use the full-width prop with the size prop to control top and bottom padding. | | ||
@@ -32,3 +32,3 @@ | Name | Type | Default | | ||
| size | string | medium | | ||
| Set the button size. Possible values: { small, medium, large } | | ||
| Sets the button size. Possible values: { 'small' | 'medium' | 'large' } | | ||
@@ -38,3 +38,3 @@ | Name | Type | Default | | ||
| responsiveSize | array | n/a | | ||
| Set the button size at different responsive breakpoints. Breakpoints are expressed as t-shirt sizing with values: `xs`, `sm`, `md`, and `lg`. Example: [‘large@xs’, ‘small@lg’] | | ||
| Sets the button size at different responsive breakpoints. Breakpoints are expressed as t-shirt sizing with values: xs, sm, md, and lg. Examples: { ‘large@xs’ | ‘small@lg’ } | | ||
@@ -44,3 +44,3 @@ | Name | Type | Default | | ||
| iconOnly | boolean | false | | ||
| Renders an icon-only button. Overrides size and responsiveSize props. | | ||
| Renders an icon-only button. When this value is true, it will override the size and responsiveSize props | | ||
@@ -50,4 +50,9 @@ | Name | Type | Default | | ||
| onDark | boolean | false | | ||
| Renders an icon-only button with a light fill color for use on dark backgrounds. iconOnly must also be true. | | ||
| Renders an icon-only button with a light fill color for use on dark backgrounds. The 'iconOnly' prop must be true. | | ||
| Name | Type | Default | | ||
|:-----|:-------|:--------| | ||
| modifier | string | n/a | | ||
| Modifies the style variant for this component. Possible values: { 'secondary' } | | ||
## Slots | ||
@@ -62,17 +67,5 @@ | ||
## Additional Properties | ||
| Name | Type | Value | | ||
|:-----|:-------|:--------| | ||
| modifier | string | Allows style variants to be defined. | | ||
## Modifiers | ||
Following are modifiers for `cdrButton` component: | ||
- Secondary | ||
## Installation | ||
Resources are available within the [cdr-button package:](https://www.npmjs.com/search?q=cdr-button) | ||
Resources are available within the [CdrButton package:](https://www.npmjs.com/search?q=cdr-button) | ||
@@ -88,3 +81,3 @@ | Name | Type | Description | | ||
Install the `cdr-button` package using `npm` in your terminal: | ||
Install the CdrButton package using `npm` in your terminal: | ||
@@ -149,6 +142,39 @@ _Terminal_ | ||
### Composing with icons | ||
### Modifiers | ||
`cdr-button` can be used with the icon component from the @rei/cdr-icon package. | ||
Following variants are available to the `cdr-button` modifier attribute: | ||
| Value | Description | | ||
|:----------- |:------------------------------------------------ | | ||
| `secondary` | Sets the secondary style for the button | | ||
### Click Actions | ||
Use the `on-click` prop to attach custom actions and event handling. | ||
```vue | ||
<template> | ||
<cdr-button | ||
:on-click="greet" | ||
> | ||
Greet | ||
</cdr-button> | ||
</template> | ||
<script> | ||
export default { | ||
... | ||
methods: { | ||
greet() { | ||
console.log(‘Hello there’); | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
## Composing with icons | ||
CdrButton can be used with the icon component from the CdrIcon package. | ||
### Text and Icon | ||
@@ -158,3 +184,3 @@ | ||
In the below example, a Download button is rendered as a button with icon and text using `cdr-icon` and the icon sprite. | ||
In the below example, a _Download_ button is rendered as a button with icon and text using `cdr-icon` and the icon sprite. | ||
@@ -191,6 +217,6 @@ ```vue | ||
- Default slot must be empty. If text is present in default slot, the text will render | ||
- `Size` prop is disable when `icon-only` prop is true | ||
- `size` prop is disable when `icon-only` prop is true | ||
- For the SVG files: | ||
- If the `fill` color is dark, assign true to the `on-dark` prop | ||
- `On-dark` prop only works if `icon-only` prop is also true | ||
- `on-dark` prop only works if `icon-only` prop is also true | ||
- Add `aria-label` text to describe the button’s action when clicked or tapped | ||
@@ -212,30 +238,5 @@ | ||
### Click Actions | ||
Use the `on-click` prop to attach custom actions and event handling. | ||
```vue | ||
<template> | ||
<cdr-button | ||
:on-click="greet" | ||
> | ||
Greet | ||
</cdr-button> | ||
</template> | ||
<script> | ||
export default { | ||
... | ||
methods: { | ||
greet() { | ||
console.log(‘Hello there’); | ||
} | ||
} | ||
} | ||
</script> | ||
``` | ||
### CdrCloseButton & CdrPlayButton | ||
The cdr-button package includes two specific icon-only variants. CdrCloseButton and CdrPlayButton include their respective icons and aria-label text for accessibility. | ||
The CdrButton package includes two specific icon-only variants. CdrCloseButton and CdrPlayButton include their respective icons and `aria-label` text for accessibility. | ||
@@ -242,0 +243,0 @@ ```vue |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
3
0
253
30102
6
2
- Removedvue@^2.5.17