@leafygreen-ui/button
Advanced tools
Comparing version 2.2.2 to 2.2.3
@@ -1,2 +0,2 @@ | ||
!function(o,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"),require("prop-types"),require("@leafygreen-ui/theme"),require("@leafygreen-ui/lib"),require("polished"));else if("function"==typeof define&&define.amd)define(["react","prop-types","@leafygreen-ui/theme","@leafygreen-ui/lib","polished"],e);else{var r="object"==typeof exports?e(require("react"),require("prop-types"),require("@leafygreen-ui/theme"),require("@leafygreen-ui/lib"),require("polished")):e(o.react,o["prop-types"],o["@leafygreen-ui/theme"],o["@leafygreen-ui/lib"],o.polished);for(var n in r)("object"==typeof exports?exports:o)[n]=r[n]}}(window,function(o,e,r,n,t){return function(o){var e={};function r(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return o[n].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=o,r.c=e,r.d=function(o,e,n){r.o(o,e)||Object.defineProperty(o,e,{enumerable:!0,get:n})},r.r=function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},r.t=function(o,e){if(1&e&&(o=r(o)),8&e)return o;if(4&e&&"object"==typeof o&&o&&o.__esModule)return o;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:o}),2&e&&"string"!=typeof o)for(var t in o)r.d(n,t,function(e){return o[e]}.bind(null,t));return n},r.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(e,"a",e),e},r.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},r.p="",r(r.s=0)}([function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}});var n,t=(n=r(1))&&n.__esModule?n:{default:n}},function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,t=function(o){if(o&&o.__esModule)return o;var e={};if(null!=o)for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(o,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=o[r]}return e.default=o,e}(r(2)),a=(n=r(3))&&n.__esModule?n:{default:n},l=r(4),i=r(5),c=r(6);function d(o){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}function s(){return(s=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[n]=r[n])}return o}).apply(this,arguments)}function g(o,e){if(null==o)return{};var r,n,t=function(o,e){if(null==o)return{};var r,n,t={},a=Object.keys(o);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(t[r]=o[r]);return t}(o,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(o);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(o,r)&&(t[r]=o[r])}return t}function u(o,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function b(o,e){return!e||"object"!==d(e)&&"function"!=typeof e?function(o){if(void 0===o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(o):e}function f(o){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function p(o,e){return(p=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o})(o,e)}function y(o,e,r){return e in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}var h=i.emotion.css,m={default:h("color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",l.colors.mongodb.white,",",(0,c.lighten)(.2,l.colors.gray[5])," );border-color:",l.colors.gray[6],";box-shadow:inset 0 -1px 0 ",l.colors.gray[6],";&:focus,&:hover{&:not(:disabled){color:",l.colors.gray[0],";border-color:",l.colors.gray[5],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.5,l.colors.gray[5]),",",(0,c.lighten)(.15,l.colors.gray[5])," );box-shadow:inset 0 -1px 0 ",l.colors.gray[5],",0 1px 4px rgba(0,0,0,0.1);}}&:active:not(:disabled){color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.15,l.colors.gray[5]),",",(0,c.lighten)(.5,l.colors.gray[5])," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);border-color:",l.colors.gray[5],";}"),primary:h("color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",l.colors.green[2],",",(0,c.lighten)(.025,l.colors.green[1])," );border-color:",(0,c.darken)(.02,l.colors.green[2]),";box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";border-color:",(0,c.darken)(.07,l.colors.green[1]),";background-color:",(0,c.darken)(.05,l.colors.green[2]),";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[2]),",",(0,c.darken)(.025,l.colors.green[1])," );box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15),0 1px 4px rgba(0,0,0,0.1);}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[1]),",",(0,c.darken)(.025,l.colors.green[2])," );border-color:",(0,c.darken)(.07,l.colors.green[1]),";box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);}"),info:h("color:",l.colors.green[2],";background-color:transparent;background-image:none;border-color:",l.colors.green[2],";box-shadow:none;&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-color:",(0,c.darken)(.05,l.colors.green[2]),";background-image:linear-gradient( ",l.colors.green[2],",",(0,c.lighten)(.025,l.colors.green[1])," );border-color:",(0,c.darken)(.02,l.colors.green[1]),";box-shadow:inset 0 -1px rgba(0,0,0,0.15);}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[1]),",",(0,c.darken)(.025,l.colors.green[2])," );border-color:",(0,c.darken)(.07,l.colors.green[1]),";box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);}"),danger:h("color:",l.colors.mongodb.white,";background-color:#bd180f;background-image:linear-gradient( ",(0,c.darken)(.1,l.colors.mongodb.alertRed),",",(0,c.darken)(.2,l.colors.mongodb.alertRed)," );border-color:#97130c;box-shadow:inset 0 -1px 0 0 ",(0,c.darken)(.25,l.colors.mongodb.alertRed),";&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-color:",(0,c.darken)(.05,"#BD180F"),";background-image:linear-gradient( ",(0,c.darken)(.15,l.colors.mongodb.alertRed),",",(0,c.darken)(.25,l.colors.mongodb.alertRed)," );border-color:",(0,c.darken)(.1,"#BD180F"),";box-shadow:0 1px 4px rgba(0,0,0,0.1),inset 0 -1px 0 ",(0,c.darken)(.25,l.colors.mongodb.alertRed),";}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:#bd180f;background-image:linear-gradient( ",(0,c.darken)(.2,l.colors.mongodb.alertRed),",",(0,c.darken)(.1,l.colors.mongodb.alertRed)," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);border-color:#97130c;}"),dark:h("color:",l.colors.mongodb.white,";border-color:",l.colors.gray[0],";background-image:linear-gradient(",l.colors.gray[3],",",l.colors.gray[1],");box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-image:linear-gradient(#7c7f82,#41474a);border-color:#303030;box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-image:linear-gradient(",l.colors.gray[1],",",l.colors.gray[3],");border-color:",l.colors.gray[0],";box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";}")},x={xsmall:h("height:22px;padding:0 8px;font-size:11px;line-height:21px;text-transform:uppercase;font-weight:bold;"),small:h("height:25px;padding:0 10px;line-height:23px;"),normal:h("height:32px;padding:0 12px;font-size:14px;line-height:32px;text-transform:none;font-weight:normal;"),large:h("height:45px;line-height:44px;font-size:16px;padding:0 20px;")},k=h("color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",l.colors.mongodb.white,",",(0,c.lighten)(.2,l.colors.gray[5])," );border:1px solid ",l.colors.gray[6],"};box-shadow:inset 0 -1px 0 ",l.colors.gray[6],";height:32px;padding:0 12px;font-size:14px;line-height:32px;text-transform:none;font-weight:normal;font-family:Akzidenz,'Helvetica Neue',Helvetica,Arial,sans-serif;box-sizing:border-box;border-radius:3px;display:inline-block;transition:all 120ms ease;text-decoration:none;cursor:pointer;&:disabled{color:",l.colors.gray[3],";border-color:",l.colors.gray[5],";background-color:",l.colors.gray[7],";background-image:none;box-shadow:none;cursor:not-allowed;}&:focus,&:hover{&:not(:disabled){color:",l.colors.gray[0],";border-color:",l.colors.gray[5],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.5,l.colors.gray[5]),",",(0,c.lighten)(.15,l.colors.gray[5])," );box-shadow:inset 0 -1px 0 ",l.colors.gray[5],",0 1px 4px rgba(0,0,0,0.1);outline:none;}}&:active:not(:disabled){border-color:",l.colors.gray[5],";background-color:linear-gradient( ",(0,c.lighten)(.15,l.colors.gray[5]),",",(0,c.lighten)(.5,l.colors.gray[5])," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);outline:none;}"),w=function(o){function e(){return function(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,f(e).apply(this,arguments))}var r,n,a;return function(o,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&p(o,e)}(e,t.Component),r=e,(n=[{key:"render",value:function(){var o=this.props,e=o.className,r=o.children,n=o.disabled,a=o.variant,l=o.size,c=o.as,d=o.href,u=g(o,["className","children","disabled","variant","size","as","href"]),b=d?"a":"button";c&&(b=c);var f=m[a],p=x[l];return t.default.createElement(b,s({},u,{href:d,className:(0,i.ccClassName)(h(k," ",p," ",f),e),disabled:n,"aria-disabled":n}),r)}}])&&u(r.prototype,n),a&&u(r,a),e}();e.default=w,y(w,"displayName","Button"),y(w,"propTypes",{variant:a.default.oneOf(["default","primary","info","danger","dark"]),size:a.default.oneOf(["xsmall","small","normal","large"]),className:a.default.string,children:a.default.node,disabled:a.default.bool,as:a.default.oneOfType([a.default.string,a.default.element]),href:a.default.string}),y(w,"defaultProps",{variant:"default",size:"normal",className:"",children:null,disabled:!1,type:"button"})},function(e,r){e.exports=o},function(o,r){o.exports=e},function(o,e){o.exports=r},function(o,e){o.exports=n},function(o,e){o.exports=t}])}); | ||
!function(o,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("react"),require("prop-types"),require("@leafygreen-ui/theme"),require("@leafygreen-ui/lib"),require("polished"));else if("function"==typeof define&&define.amd)define(["react","prop-types","@leafygreen-ui/theme","@leafygreen-ui/lib","polished"],e);else{var r="object"==typeof exports?e(require("react"),require("prop-types"),require("@leafygreen-ui/theme"),require("@leafygreen-ui/lib"),require("polished")):e(o.react,o["prop-types"],o["@leafygreen-ui/theme"],o["@leafygreen-ui/lib"],o.polished);for(var n in r)("object"==typeof exports?exports:o)[n]=r[n]}}(window,function(o,e,r,n,t){return function(o){var e={};function r(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return o[n].call(t.exports,t,t.exports,r),t.l=!0,t.exports}return r.m=o,r.c=e,r.d=function(o,e,n){r.o(o,e)||Object.defineProperty(o,e,{enumerable:!0,get:n})},r.r=function(o){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},r.t=function(o,e){if(1&e&&(o=r(o)),8&e)return o;if(4&e&&"object"==typeof o&&o&&o.__esModule)return o;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:o}),2&e&&"string"!=typeof o)for(var t in o)r.d(n,t,function(e){return o[e]}.bind(null,t));return n},r.n=function(o){var e=o&&o.__esModule?function(){return o.default}:function(){return o};return r.d(e,"a",e),e},r.o=function(o,e){return Object.prototype.hasOwnProperty.call(o,e)},r.p="",r(r.s=0)}([function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}});var n,t=(n=r(1))&&n.__esModule?n:{default:n}},function(o,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n,t=function(o){if(o&&o.__esModule)return o;var e={};if(null!=o)for(var r in o)if(Object.prototype.hasOwnProperty.call(o,r)){var n=Object.defineProperty&&Object.getOwnPropertyDescriptor?Object.getOwnPropertyDescriptor(o,r):{};n.get||n.set?Object.defineProperty(e,r,n):e[r]=o[r]}return e.default=o,e}(r(2)),a=(n=r(3))&&n.__esModule?n:{default:n},l=r(4),i=r(5),c=r(6);function d(o){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o})(o)}function s(){return(s=Object.assign||function(o){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(o[n]=r[n])}return o}).apply(this,arguments)}function g(o,e){if(null==o)return{};var r,n,t=function(o,e){if(null==o)return{};var r,n,t={},a=Object.keys(o);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||(t[r]=o[r]);return t}(o,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(o);for(n=0;n<a.length;n++)r=a[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(o,r)&&(t[r]=o[r])}return t}function u(o,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(o,n.key,n)}}function b(o,e){return!e||"object"!==d(e)&&"function"!=typeof e?function(o){if(void 0===o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}(o):e}function f(o){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(o){return o.__proto__||Object.getPrototypeOf(o)})(o)}function p(o,e){return(p=Object.setPrototypeOf||function(o,e){return o.__proto__=e,o})(o,e)}function y(o,e,r){return e in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}var h=i.emotion.css,m=i.emotion.cx,x={default:h("color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",l.colors.mongodb.white,",",(0,c.lighten)(.2,l.colors.gray[5])," );border-color:",l.colors.gray[6],";box-shadow:inset 0 -1px 0 ",l.colors.gray[6],";&:focus,&:hover{&:not(:disabled){color:",l.colors.gray[0],";border-color:",l.colors.gray[5],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.5,l.colors.gray[5]),",",(0,c.lighten)(.15,l.colors.gray[5])," );box-shadow:inset 0 -1px 0 ",l.colors.gray[5],",0 1px 4px rgba(0,0,0,0.1);}}&:active:not(:disabled){color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.15,l.colors.gray[5]),",",(0,c.lighten)(.5,l.colors.gray[5])," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);border-color:",l.colors.gray[5],";}"),primary:h("color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",l.colors.green[2],",",(0,c.lighten)(.025,l.colors.green[1])," );border-color:",(0,c.darken)(.02,l.colors.green[2]),";box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";border-color:",(0,c.darken)(.07,l.colors.green[1]),";background-color:",(0,c.darken)(.05,l.colors.green[2]),";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[2]),",",(0,c.darken)(.025,l.colors.green[1])," );box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15),0 1px 4px rgba(0,0,0,0.1);}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[1]),",",(0,c.darken)(.025,l.colors.green[2])," );border-color:",(0,c.darken)(.07,l.colors.green[1]),";box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);}"),info:h("color:",l.colors.green[2],";background-color:transparent;background-image:none;border-color:",l.colors.green[2],";box-shadow:none;&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-color:",(0,c.darken)(.05,l.colors.green[2]),";background-image:linear-gradient( ",l.colors.green[2],",",(0,c.lighten)(.025,l.colors.green[1])," );border-color:",(0,c.darken)(.02,l.colors.green[1]),";box-shadow:inset 0 -1px rgba(0,0,0,0.15);}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:",l.colors.green[2],";background-image:linear-gradient( ",(0,c.darken)(.025,l.colors.green[1]),",",(0,c.darken)(.025,l.colors.green[2])," );border-color:",(0,c.darken)(.07,l.colors.green[1]),";box-shadow:inset 0 2px 2px rgba(0,0,0,0.2);}"),danger:h("color:",l.colors.mongodb.white,";background-color:#bd180f;background-image:linear-gradient( ",(0,c.darken)(.1,l.colors.mongodb.alertRed),",",(0,c.darken)(.2,l.colors.mongodb.alertRed)," );border-color:#97130c;box-shadow:inset 0 -1px 0 0 ",(0,c.darken)(.25,l.colors.mongodb.alertRed),";&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-color:",(0,c.darken)(.05,"#BD180F"),";background-image:linear-gradient( ",(0,c.darken)(.15,l.colors.mongodb.alertRed),",",(0,c.darken)(.25,l.colors.mongodb.alertRed)," );border-color:",(0,c.darken)(.1,"#BD180F"),";box-shadow:0 1px 4px rgba(0,0,0,0.1),inset 0 -1px 0 ",(0,c.darken)(.25,l.colors.mongodb.alertRed),";}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-color:#bd180f;background-image:linear-gradient( ",(0,c.darken)(.2,l.colors.mongodb.alertRed),",",(0,c.darken)(.1,l.colors.mongodb.alertRed)," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);border-color:#97130c;}"),dark:h("color:",l.colors.mongodb.white,";border-color:",l.colors.gray[0],";background-image:linear-gradient(",l.colors.gray[3],",",l.colors.gray[1],");box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";&:focus,&:hover{&:not(:disabled){color:",l.colors.mongodb.white,";background-image:linear-gradient(#7c7f82,#41474a);border-color:#303030;box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";}}&:active:not(:disabled){color:",l.colors.mongodb.white,";background-image:linear-gradient(",l.colors.gray[1],",",l.colors.gray[3],");border-color:",l.colors.gray[0],";box-shadow:inset 0 -1px 0 ",l.colors.gray[0],";}")},k={xsmall:h("height:22px;padding:0 8px;font-size:11px;line-height:21px;text-transform:uppercase;font-weight:bold;"),small:h("height:25px;padding:0 10px;line-height:23px;"),normal:h("height:32px;padding:0 12px;font-size:14px;line-height:32px;text-transform:none;font-weight:normal;"),large:h("height:45px;line-height:44px;font-size:16px;padding:0 20px;")},w=h("color:",l.colors.gray[1],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",l.colors.mongodb.white,",",(0,c.lighten)(.2,l.colors.gray[5])," );border:1px solid ",l.colors.gray[6],"};box-shadow:inset 0 -1px 0 ",l.colors.gray[6],";height:32px;padding:0 12px;font-size:14px;line-height:32px;text-transform:none;font-weight:normal;font-family:Akzidenz,'Helvetica Neue',Helvetica,Arial,sans-serif;box-sizing:border-box;border-radius:3px;display:inline-block;transition:all 120ms ease;text-decoration:none;cursor:pointer;&:disabled{color:",l.colors.gray[3],";border-color:",l.colors.gray[5],";background-color:",l.colors.gray[7],";background-image:none;box-shadow:none;cursor:not-allowed;}&:focus,&:hover{&:not(:disabled){color:",l.colors.gray[0],";border-color:",l.colors.gray[5],";background-color:",l.colors.mongodb.white,";background-image:linear-gradient( ",(0,c.lighten)(.5,l.colors.gray[5]),",",(0,c.lighten)(.15,l.colors.gray[5])," );box-shadow:inset 0 -1px 0 ",l.colors.gray[5],",0 1px 4px rgba(0,0,0,0.1);outline:none;}}&:active:not(:disabled){border-color:",l.colors.gray[5],";background-color:linear-gradient( ",(0,c.lighten)(.15,l.colors.gray[5]),",",(0,c.lighten)(.5,l.colors.gray[5])," );box-shadow:inset 0 2px 2px rgba(0,0,0,0.1);outline:none;}"),v=function(o){function e(){return function(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,f(e).apply(this,arguments))}var r,n,a;return function(o,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),e&&p(o,e)}(e,t.Component),r=e,(n=[{key:"render",value:function(){var o=this.props,e=o.className,r=o.children,n=o.disabled,a=o.variant,l=o.size,i=o.as,c=o.href,d=g(o,["className","children","disabled","variant","size","as","href"]),u=c?"a":"button";return i&&(u=i),t.default.createElement(u,s({},d,{href:c,className:m(w,k[l],x[a],e),disabled:n,"aria-disabled":n}),r)}}])&&u(r.prototype,n),a&&u(r,a),e}();e.default=v,y(v,"displayName","Button"),y(v,"propTypes",{variant:a.default.oneOf(["default","primary","info","danger","dark"]),size:a.default.oneOf(["xsmall","small","normal","large"]),className:a.default.string,children:a.default.node,disabled:a.default.bool,as:a.default.oneOfType([a.default.string,a.default.element]),href:a.default.string}),y(v,"defaultProps",{variant:"default",size:"normal",className:"",children:null,disabled:!1,type:"button"})},function(e,r){e.exports=o},function(o,r){o.exports=e},function(o,e){o.exports=r},function(o,e){o.exports=n},function(o,e){o.exports=t}])}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@leafygreen-ui/button", | ||
"version": "2.2.2", | ||
"version": "2.2.3", | ||
"description": "leafyGreen UI Kit Button", | ||
@@ -14,6 +14,6 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@leafygreen-ui/lib": "^2.1.3", | ||
"@leafygreen-ui/theme": "^1.1.3" | ||
"@leafygreen-ui/lib": "^2.1.4", | ||
"@leafygreen-ui/theme": "^1.1.4" | ||
}, | ||
"gitHead": "bf431409f0e214d729ced5d82d379b6fb442e0b5" | ||
"gitHead": "02c7f4e02c3ef22492b6bfac36bd40b08be5582f" | ||
} |
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { colors } from '@leafygreen-ui/theme'; | ||
import { ccClassName, emotion } from '@leafygreen-ui/lib'; | ||
import { emotion } from '@leafygreen-ui/lib'; | ||
import { lighten, darken } from 'polished'; | ||
const { css } = emotion; | ||
const { css, cx } = emotion; | ||
@@ -310,5 +310,2 @@ const buttonVariants = { | ||
const variantStyle = buttonVariants[variant]; | ||
const sizeStyle = buttonSizes[size]; | ||
return ( | ||
@@ -318,4 +315,6 @@ <Root | ||
href={href} | ||
className={ccClassName( | ||
css`${baseStyle} ${sizeStyle} ${variantStyle}`, | ||
className={cx( | ||
baseStyle, | ||
buttonSizes[size], | ||
buttonVariants[variant], | ||
className, | ||
@@ -322,0 +321,0 @@ )} |
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
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
104487
11
Updated@leafygreen-ui/lib@^2.1.4
Updated@leafygreen-ui/theme@^1.1.4