Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-awesome-button

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-awesome-button - npm Package Compare versions

Comparing version 6.0.0 to 6.1.0

.prettierrc

7

.eslintrc.json
{
"parser": "babel-eslint",
"extends": "airbnb",
"extends": ["airbnb", "prettier"],
"env": {

@@ -10,6 +10,3 @@ "browser": true,

},
"plugins": [
"react",
"jsx-a11y"
],
"plugins": ["react", "jsx-a11y"],
"parserOptions": {

@@ -16,0 +13,0 @@ "ecmaVersion": 6,

@@ -20,5 +20,3 @@ import React from 'react';

render() {
const {
theme,
} = this.props;
const { theme } = this.props;

@@ -30,17 +28,9 @@ const Module = Modules.Modules[theme];

<div className={styles.section}>
<AwesomeButton
cssModule={Module}
>
<AwesomeButton cssModule={Module}>
<i className="fa fa-codepen" aria-hidden /> Primary
</AwesomeButton>
<AwesomeButton
cssModule={Module}
type="secondary"
>
<AwesomeButton cssModule={Module} type="secondary">
Secondary
</AwesomeButton>
<AwesomeButton
cssModule={Module}
type="link"
>
<AwesomeButton cssModule={Module} type="link">
Anchor

@@ -53,3 +43,3 @@ </AwesomeButton>

type="primary"
action={(element, next) => {
onPress={(element, next) => {
setTimeout(() => {

@@ -65,8 +55,3 @@ // debugger;

<div className={`${styles.loadData} ${styles.section}`}>
<AwesomeButton
bubbles
cssModule={Module}
placeholder
type="secondary"
>
<AwesomeButton bubbles cssModule={Module} placeholder type="secondary">
{this.state.placeholderButtonText}

@@ -88,7 +73,3 @@ </AwesomeButton>

<div className={`${styles.loadData} ${styles.section}`}>
<AwesomeButton
cssModule={Module}
bubbles
disabled={this.state.isDisabled}
>
<AwesomeButton cssModule={Module} bubbles disabled={this.state.isDisabled}>
Disabled

@@ -133,3 +114,4 @@ </AwesomeButton>

type="instagram"
url="https://instagram.com"
target="_blank"
href="https://instagram.com/rcaferati"
cssModule={Module}

@@ -136,0 +118,0 @@ >

@@ -10,3 +10,3 @@ {

"article": "//caferati.me/labs/awesome-button",
"domain": "/demo/react-awesome-button",
"domain": "",
"themes": [

@@ -30,2 +30,2 @@ {

]
}
}

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports["react-awesome-button"]=t(require("react"),require("prop-types")):e["react-awesome-button"]=t(e.React,e.PropTypes)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);Object.defineProperty(t,"AwesomeButton",{enumerable:!0,get:function(){return r(o).default}});var c=n(6);Object.defineProperty(t,"AwesomeButtonSocial",{enumerable:!0,get:function(){return r(c).default}});var i=n(9);Object.defineProperty(t,"AwesomeButtonProgress",{enumerable:!0,get:function(){return r(i).default}})},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";return Object.entries(e).map(function(e){var t=a(e,2);return t[0]+"="+t[1]}).join(t)}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(!t)return e.join(" ").trim();for(var n=[],r=e.length;r--;)t[e[r]]&&n.push(t[e[r]]);return n.join(" ").trim()}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];return t?t[e]||e:e}function i(e,t,n){if(!e)return!1;var r=t.charAt(0).toUpperCase()+t.slice(1);return void 0!==e.style["Webkit"+r]?e.addEventListener("webkit"+r+"End",n):void 0!==e.style.OTransition?e.addEventListener("o"+t+"End",n):e.addEventListener(t+"End",n)}function l(e){var t=e.element,n=e.root,r=e.cssModule,c=void 0===r?null:r,i=e.state,l=void 0===i?null:i;if(!t)return!1;if(!l)return t.classList.remove(o([n+"--"+u[0]],c),o([n+"--"+u[1]],c),o([n+"--"+u[2]],c)),!1;for(var s=u.filter(function(e){return e!==l}),a=s.length;a--;)t.classList.remove(o([n+"--"+s[a]],c));return t.classList.add(o([n+"--"+l],c)),!0}function s(e){var t=e.event,n=e.button,r=e.content,o=e.className,c=n.getBoundingClientRect(),l=window.pageYOffset||document.documentElement.scrolltop||0,s=document.createElement("span"),a=c.width<50?3*c.width:2*c.width;s.className=o,s.style.top="-"+(a/2-(t.pageY-c.top-l))+"px",s.style.left="-"+(a/2-(t.pageX-c.left))+"px",s.style.width=a+"px",s.style.height=a+"px",i(s,"animation",function(){window.requestAnimationFrame(function(){r.removeChild(s)})}),window.requestAnimationFrame(function(){r.appendChild(s)})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var n=[],r=!0,o=!1,c=void 0;try{for(var i,l=e[Symbol.iterator]();!(r=(i=l.next()).done)&&(n.push(i.value),!t||n.length!==t);r=!0);}catch(e){o=!0,c=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw c}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.serialize=r,t.classToModules=o,t.getClassName=c,t.setCssEndEvent=i,t.toggleMoveClasses=l,t.createBubbleEffect=s;var u=["middle","left","right"]},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(3)),h="aws-btn",v=function(e){return p.default.createElement("a",e)},m=function(e){return p.default.createElement("button",e)},b=function(e){function t(e){c(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.rootElement=e.rootElement||h,n.animationStage=0,n.extraProps={},n.state={disabled:e.disabled||e.placeholder&&!e.children},n.checkProps(e),n}return l(t,e),a(t,[{key:"componentDidMount",value:function(){this.container=this.button&&this.button.parentNode}},{key:"componentWillReceiveProps",value:function(e){this.checkPlaceholder(e),this.checkProps(e),this.checkActive(e)}},{key:"componentWillUnmount",value:function(){this.clearTimer&&clearTimeout(this.clearTimer)}},{key:"getRootClassName",value:function(){var e=this.rootElement,t=this.props,n=t.type,r=t.size,c=t.placeholder,i=t.children,l=t.visible,s=t.cssModule,a=this.state,u=a.disabled,p=a.pressPosition,d=[this.rootElement,n&&e+"--"+n,r&&e+"--"+r,l&&e+"--visible",c&&!i&&e+"--placeholder"||null];return!0===u&&d.push(e+"--disabled"),p&&d.push(p),this.props.className&&d.push.apply(d,o(this.props.className.split(" "))),s&&s["aws-btn"]?(0,f.classToModules)(d,s):d.join(" ").trim().replace(/[\s]+/gi," ")}},{key:"checkActive",value:function(e){e.active!==this.props.active&&(!0===e.active?this.setState({pressPosition:this.rootElement+"--active"}):this.clearPress(!0))}},{key:"checkProps",value:function(e){var t=e.to,n=e.href,r=e.target,o=e.element;this.extraProps.to=t||null,this.extraProps.href=n||null,this.extraProps.target=r||null,this.renderComponent=o||(this.props.href?v:m)}},{key:"checkPlaceholder",value:function(e){var t=e.disabled,n=e.placeholder,r=e.children;!0===n?r?this.setState({disabled:!1}):this.setState({disabled:!0}):this.setState({disabled:t})}},{key:"clearPress",value:function(e){(0,f.toggleMoveClasses)({element:this.container,root:this.rootElement,cssModule:this.props.cssModule});var t=this.props.active&&!e?this.rootElement+"--active":null;this.setState({pressPosition:t})}},{key:"pressIn",value:function(){!0!==this.state.disabled&&!0!==this.props.blocked&&(this.pressed=(new Date).getTime(),this.setState({pressPosition:this.rootElement+"--active"}))}},{key:"pressOut",value:function(){var e=this;this.clearTimer&&clearTimeout(this.clearTimer);var t=(new Date).getTime()-this.pressed;if(!0===this.props.ripple&&this.createBubble(event),"undefined"!=typeof window&&this.button){var n=new Event("action");this.button.dispatchEvent(n)}this.action(),this.clearTimer=setTimeout(function(){e.clearPress()},100-t)}},{key:"action",value:function(){this.props.action&&this.button&&this.props.action(this.container)}},{key:"createBubble",value:function(e){(0,f.createBubbleEffect)({event:e,button:this.button,content:this.content,className:(0,f.getClassName)(this.rootElement+"__bubble",this.props.cssModule)})}},{key:"moveEvents",value:function(){var e=this,t={onClick:function(t){e.props.href&&e.state.disabled&&(t.preventDefault(),t.stopPropagation())},onMouseLeave:function(){e.clearPress()},onMouseDown:function(t){t&&1!==t.nativeEvent.which||e.pressIn()},onMouseUp:function(t){if(!0===e.state.disabled||!0===e.props.blocked)return t.preventDefault(),void t.stopPropagation();e.pressOut()}};return!0===this.props.moveEvents?t.onMouseMove=function(t){if(!0!==e.state.disabled){var n=e.button,r=n.getBoundingClientRect(),o=r.left,c=n.offsetWidth,i=t.pageX<o+.3*c?"left":t.pageX>o+.65*c?"right":"middle";(0,f.toggleMoveClasses)({element:e.container,root:e.rootElement,cssModule:e.props.cssModule,state:i})}}:t.onMouseEnter=function(){e.container.classList.add((0,f.classToModules)([e.rootElement+"--middle"],e.props.cssModule))},t}},{key:"render",value:function(){var e=this,t=this.renderComponent,n=this.props,r=n.title,o=n.style,c=n.cssModule,i=n.children;return p.default.createElement(t,s({style:o,className:this.getRootClassName(),role:"button",title:r},this.extraProps,this.moveEvents()),p.default.createElement("span",{ref:function(t){e.button=t},className:(0,f.getClassName)(this.rootElement+"__wrapper",c)},p.default.createElement("span",{ref:function(t){e.content=t},className:(0,f.getClassName)(this.rootElement+"__content",c)},p.default.createElement("span",{ref:function(t){e.child=t}},i))))}}]),t}(p.default.Component);b.defaultProps={action:null,ripple:!1,blocked:!1,cssModule:null,children:null,disabled:!1,title:null,element:null,href:null,className:null,moveEvents:!0,placeholder:!1,rootElement:h,size:null,style:{},target:null,to:null,type:"primary",visible:!0,active:!1},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(2)),h=n(7),v=r(h),m=n(8),b=r(m),g=function(e){function t(e){c(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.action=function(){if(null===n.props.href){var e=n.props,t=e.type,r=e.user,o=e.phone,c=(0,v.default)({height:600,width:575,url:n.getUrl(),message:n.getMessage(),type:t,user:r,phone:o});n.window&&window.open(c.url,c.title,c.extra)}},n.window="undefined"!=typeof window,n}return l(t,e),a(t,[{key:"getUrl",value:function(){return this.props.url?this.props.url:this.window?window.location.href:null}},{key:"getMessage",value:function(){if(this.props.message)return this.props.message;if("undefined"!==this.window){var e=document.querySelector("title");if(e)return e.innerHTML}return null}},{key:"getImage",value:function(){if(null!==this.props.image)return this.props.image;if(null!==this.window){var e=document.querySelector('meta[property="og:image"]');if(e)return e.getAttribute("content")}return null}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.icon,r=e.type,c=(e.action,e.iconWidth),i=e.iconHeight,l=e.href,a=o(e,["children","icon","type","action","iconWidth","iconHeight","href"]);return p.default.createElement(f.AwesomeButton,s({type:r,action:this.action,href:l},a),n&&(0,b.default)({type:r,width:c,height:i,color:this.props.disabled?"rgba(255,255,255,0.35)":"#FFF"})," ",t)}}]),t}(p.default.Component);g.defaultProps={action:null,children:null,disabled:!1,href:null,icon:!0,iconHeight:23,iconWidth:30,image:null,message:null,phone:null,url:null,user:null},t.default=g},function(e,t,n){"use strict";function r(e,t){if("undefined"==typeof window)return{top:0,left:0};var n=void 0!==window.screenLeft?window.screenLeft:screen.left,r=void 0!==window.screenTop?window.screenTop:screen.top,o=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;return{top:(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height)/2-t/2+r,left:o/2-e/2+n}}function o(e){var t=e.url,n=e.message,o=e.title,l=e.image,s=e.user,a=e.type,u=e.phone,p=e.width,d=e.height,f={},h={};switch(a){case"facebook":h.s=100,h["p[url]"]=t,f.url="https://www.facebook.com/sharer.php?"+(0,i.serialize)(h,"&"),f.title="Facebook Sharer";break;case"twitter":h.text=n,h.url=t,f.height=250,f.url="https://twitter.com/share?"+(0,i.serialize)(h,"&"),f.title="Twitter Sharer";break;case"pinterest":h.url=t,l&&(h.media=l),f.url="https://pinterest.com/pin/create/button/?"+(0,i.serialize)(h,"&"),f.title="Pinterest Sharer";break;case"google":case"gplus":h.url=t,f.url="https://plus.google.com/share?"+(0,i.serialize)(h,"&"),f.title="Google+ Sharer",f.width=400;break;case"linkedin":h.mini=!0,h.url=t,h.title=n||o,f.url="https://www.linkedin.com/shareArticle?"+(0,i.serialize)(h,"&"),f.title="Linkedin Sharer";break;case"reddit":h.url=t,h.title=n||o,f.url="https://www.reddit.com/submit?"+(0,i.serialize)(h,"&"),f.title="",f.width=850;break;case"whatsapp":h.phone=u.replace(/\+|(|)/gim,""),h.title=n||o,f.url="https://api.whatsapp.com/send?"+(0,i.serialize)(h,"&"),f.title="Whatsapp Message",f.width=850;break;case"messenger":f.url="https://m.me/"+s,f.title="Messenger Message",f.width=850;break;case"mail":f.url="mailto:"+t,f.title="_self";break;default:return f}return f.extra=(0,i.serialize)(c({width:(f.width||p)+"px",height:(f.height||d)+"px"},r(f.width||p,f.height||d)),","),f}Object.defineProperty(t,"__esModule",{value:!0});var c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=o;var i=n(3)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.type,n=e.width,r=e.height,o=e.margin,c=e.color;return i.default.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet",space:"preserve",viewBox:"0 0 50 50",style:{marginRight:o},width:n,height:r},i.default.createElement("path",{fill:c,d:s[t]}))}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),i=r(c),l=n(1),s=(r(l),{youtube:"M38.1,23H11.9c-4.1,0-7.6,3.4-7.6,7.6v6.1c0,4.1,3.4,7.6,7.6,7.6h26.3c4.1,0,7.6-3.4,7.6-7.6v-6.1C45.8,26.4,42.4,23,38.1,23z M17.4,27.7h-2.5v12.2h-2.4V27.7h-2.5v-2h7.3V27.7z M24.3,39.9h-2.1v-1.2c-0.4,0.4-0.8,0.8-1.2,0.9c-0.4,0.3-0.8,0.3-1.2,0.3c-0.5,0-0.8-0.2-1.1-0.5c-0.3-0.3-0.3-0.8-0.3-1.4v-8.6h2.1v8c0,0.3,0.1,0.4,0.2,0.5c0.1,0.1,0.3,0.2,0.4,0.2c0.2,0,0.3-0.1,0.6-0.3c0.3-0.2,0.4-0.3,0.7-0.6v-7.9h2.1v10.6H24.3z M31.9,37.7c0,0.8-0.2,1.4-0.5,1.7C31,39.8,30.5,40,29.9,40c-0.4,0-0.8-0.1-1.1-0.3c-0.3-0.2-0.6-0.4-0.9-0.7v0.8h-2.1V25.7h2.1v4.6c0.3-0.3,0.6-0.6,0.9-0.8c0.3-0.2,0.7-0.3,0.9-0.3c0.7,0,1.2,0.3,1.5,0.7s0.5,1.1,0.5,1.9L31.9,37.7L31.9,37.7z M39.2,34.9h-4v1.9c0,0.6,0.1,0.9,0.2,1.2c0.2,0.3,0.3,0.3,0.7,0.3c0.3,0,0.6-0.1,0.8-0.3c0.2-0.2,0.2-0.6,0.2-1.2v-0.5h2.2v0.5c0,1.1-0.3,1.9-0.8,2.5c-0.5,0.5-1.3,0.8-2.4,0.8c-0.9,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1-0.5-0.2-0.8-0.2c-0.2,0-0.5,0.1-0.7,0.2c-2.1,1.1-4.6,1.7-7.1,1.7c-1.9,0-3.7-0.3-5.4-1.1l0,0l0,0c-0.3-0.1-0.5-0.3-0.9-0.5c-0.2-0.1-0.3-0.2-0.5-0.2C17.3,29,17.1,29,16.9,29s-0.4,0-0.6,0.1l0,0l0,0c-0.3,0.1-0.5,0.3-0.7,0.5s-0.2,0.5-0.2,0.7s0.1,0.5,0.2,0.7c0.1,0.2,0.3,0.4,0.6,0.5c2.4,1.4,5.2,2.1,8.1,2.1c2.6,0,5.2-0.5,7.5-1.5l0,0l0,0c0.3-0.2,0.7-0.3,1.1-0.5c0.2-0.1,0.4-0.2,0.5-0.4c0.2-0.2,0.3-0.4,0.4-0.6l0,0c0-0.1,0-0.2,0-0.3c0-0.2-0.1-0.4-0.1-0.5C33.3,29.5,33.1,29.3,32.9,29.2zM16.8,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C19.9,21.1,18.5,19.8,16.8,19.8z M32.1,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C35.1,21.1,33.8,19.8,32.1,19.8z"});t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(2)),h=n(3),v="aws-btn",m=function(e){function t(e){c(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.action=function(){n.startLoading(),n.props.action&&setTimeout(function(){n.props.action(n.container,n.endLoading.bind(n))},250)},n.rootElement=e.rootElement||v,n.animationStage=0,n.loading=!1,n.state={loadingEnd:!1,loadingStart:!1,loadingError:!1,errorLabel:null,blocked:!1,active:!1},n}return l(t,e),a(t,[{key:"componentDidMount",value:function(){(0,h.setCssEndEvent)(this.content,"transition",this.clearStagedWrapperAnimation.bind(this))}},{key:"componentWillReceiveProps",value:function(e){this.checkFakePress(e)}},{key:"getRootClassName",value:function(){var e=this.rootElement,t=this.state,n=t.loadingStart,r=t.loadingEnd,o=t.loadingError;return[n&&e+"--start"||null,r&&e+"--end"||null,o&&e+"--errored"||null,e+"--progress"].join(" ").trim().replace(/[\s]+/gi," ")}},{key:"checkFakePress",value:function(e){e.fakePress!==this.props.fakePress&&!0===e.fakePress&&this.action()}},{key:"endLoading",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.setState({loadingEnd:!0,loadingError:!e,errorLabel:t}),this.animationStage=1}},{key:"startLoading",value:function(){var e=this;this.loading=!0,this.setState({blocked:!0,active:!0},function(){window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){e.setState({loadingStart:!0})})})})}},{key:"clearLoading",value:function(e){this.loading=!1,this.setState({loadingStart:!1,loadingEnd:!1,active:!1},e)}},{key:"clearStagedWrapperAnimation",value:function(){var e=this;if(0!==this.animationStage){if(4===this.animationStage)return this.animationStage=0,void setTimeout(function(){"undefined"!=typeof window&&window.requestAnimationFrame(function(){e.clearLoading(function(){setTimeout(function(){e.setState({blocked:!1,loadingError:!1,errorLabel:null})},500)})})},this.props.releaseDelay);this.animationStage+=1}}},{key:"moveEvents",value:function(){var e=this;return{onMouseDown:function(t){!0===e.props.disabled||!0===e.loading||!0===e.state.blocked||t&&1!==t.nativeEvent.which||(e.loading=!0)},onMouseUp:function(t){if(!0===e.props.disabled||!0===e.loading||!0===e.state.blocked)return t.preventDefault(),void t.stopPropagation();e.action()}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.size,c=t.cssModule,i=t.loadingLabel,l=t.resultLabel,a=(t.action,t.type),u=o(t,["children","size","cssModule","loadingLabel","resultLabel","action","type"]),d=this.state,v=d.active,m=d.blocked,b=d.errorLabel;return p.default.createElement(f.AwesomeButton,s({size:r,type:a,className:this.getRootClassName(),action:this.action,cssModule:c,active:v,blocked:m},this.moveEvents(),u),p.default.createElement("span",{ref:function(t){e.content=t},"data-loading":i||null,"data-status":b||l||null,className:(0,h.getClassName)(this.rootElement+"__progress",c)},p.default.createElement("span",null,n)))}}]),t}(p.default.Component);m.defaultProps={action:null,rootElement:null,loadingLabel:"Wait..",resultLabel:"Success!",disabled:!1,cssModule:null,fakePress:!1,children:null,size:null,type:null,releaseDelay:500},t.default=m}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["react","prop-types"],t):"object"==typeof exports?exports["react-awesome-button"]=t(require("react"),require("prop-types")):e["react-awesome-button"]=t(e.React,e.PropTypes)}("undefined"!=typeof self?self:this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(5);Object.defineProperty(t,"AwesomeButton",{enumerable:!0,get:function(){return r(o).default}});var i=n(6);Object.defineProperty(t,"AwesomeButtonSocial",{enumerable:!0,get:function(){return r(i).default}});var c=n(9);Object.defineProperty(t,"AwesomeButtonProgress",{enumerable:!0,get:function(){return r(c).default}})},function(e,t,n){"use strict";function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&";return Object.entries(e).map(function(e){var t=a(e,2);return t[0]+"="+t[1]}).join(t)}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(!t)return e.join(" ").trim();for(var n=[],r=e.length;r--;)t[e[r]]&&n.push(t[e[r]]);return n.join(" ").trim()}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1];return t?t[e]||e:e}function c(e,t,n){if(!e)return!1;var r=t.charAt(0).toUpperCase()+t.slice(1);return void 0!==e.style["Webkit"+r]?e.addEventListener("webkit"+r+"End",n):void 0!==e.style.OTransition?e.addEventListener("o"+t+"End",n):e.addEventListener(t+"End",n)}function l(e){var t=e.element,n=e.root,r=e.cssModule,i=void 0===r?null:r,c=e.state,l=void 0===c?null:c;if(!t)return!1;if(!l)return t.classList.remove(o([n+"--"+u[0]],i),o([n+"--"+u[1]],i),o([n+"--"+u[2]],i)),!1;for(var s=u.filter(function(e){return e!==l}),a=s.length;a--;)t.classList.remove(o([n+"--"+s[a]],i));return t.classList.add(o([n+"--"+l],i)),!0}function s(e){var t=e.event,n=e.button,r=e.content,o=e.className,i=n.getBoundingClientRect(),l=window.pageYOffset||document.documentElement.scrolltop||0,s=document.createElement("span"),a=i.width<50?3*i.width:2*i.width;s.className=o,s.style.top="-"+(a/2-(t.pageY-i.top-l))+"px",s.style.left="-"+(a/2-(t.pageX-i.left))+"px",s.style.width=a+"px",s.style.height=a+"px",c(s,"animation",function(){window.requestAnimationFrame(function(){r.removeChild(s)})}),window.requestAnimationFrame(function(){r.appendChild(s)})}Object.defineProperty(t,"__esModule",{value:!0});var a=function(){function e(e,t){var n=[],r=!0,o=!1,i=void 0;try{for(var c,l=e[Symbol.iterator]();!(r=(c=l.next()).done)&&(n.push(c.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{!r&&l.return&&l.return()}finally{if(o)throw i}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.serialize=r,t.classToModules=o,t.getClassName=i,t.setCssEndEvent=c,t.toggleMoveClasses=l,t.createBubbleEffect=s;var u=["middle","left","right"]},function(e,t,n){e.exports=n(2)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(3)),h="aws-btn",v=function(e){return p.default.createElement("a",e)},m=function(e){return p.default.createElement("button",e)},b=function(e){function t(e){i(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.rootElement=e.rootElement||h,n.animationStage=0,n.extraProps={},n.state={disabled:e.disabled||e.placeholder&&!e.children},n.checkProps(e),n}return l(t,e),a(t,[{key:"componentDidMount",value:function(){this.container=this.button&&this.button.parentNode}},{key:"componentWillReceiveProps",value:function(e){this.checkPlaceholder(e),this.checkProps(e),this.checkActive(e)}},{key:"componentWillUnmount",value:function(){this.clearTimer&&clearTimeout(this.clearTimer)}},{key:"getRootClassName",value:function(){var e=this.rootElement,t=this.props,n=t.type,r=t.size,i=t.placeholder,c=t.children,l=t.visible,s=t.cssModule,a=this.state,u=a.disabled,p=a.pressPosition,d=[this.rootElement,n&&e+"--"+n,r&&e+"--"+r,l&&e+"--visible",i&&!c&&e+"--placeholder"||null];return!0===u&&d.push(e+"--disabled"),p&&d.push(p),this.props.className&&d.push.apply(d,o(this.props.className.split(" "))),s&&s["aws-btn"]?(0,f.classToModules)(d,s):d.join(" ").trim().replace(/[\s]+/gi," ")}},{key:"checkActive",value:function(e){e.active!==this.props.active&&(!0===e.active?this.setState({pressPosition:this.rootElement+"--active"}):this.clearPress(!0))}},{key:"checkProps",value:function(e){var t=e.to,n=e.href,r=e.target,o=e.element;this.extraProps.to=t||null,this.extraProps.href=n||null,this.extraProps.target=r||null,this.renderComponent=o||(this.props.href?v:m)}},{key:"checkPlaceholder",value:function(e){var t=e.disabled,n=e.placeholder,r=e.children;!0===n?r?this.setState({disabled:!1}):this.setState({disabled:!0}):this.setState({disabled:t})}},{key:"clearPress",value:function(e){(0,f.toggleMoveClasses)({element:this.container,root:this.rootElement,cssModule:this.props.cssModule});var t=this.props.active&&!e?this.rootElement+"--active":null;this.setState({pressPosition:t})}},{key:"pressIn",value:function(){!0!==this.state.disabled&&!0!==this.props.blocked&&(this.pressed=(new Date).getTime(),this.setState({pressPosition:this.rootElement+"--active"}))}},{key:"pressOut",value:function(){var e=this;this.clearTimer&&clearTimeout(this.clearTimer);var t=(new Date).getTime()-this.pressed;if(!0===this.props.ripple&&this.createBubble(event),"undefined"!=typeof window&&this.button){var n=new Event("action");this.button.dispatchEvent(n)}this.action(),this.clearTimer=setTimeout(function(){e.clearPress()},100-t)}},{key:"action",value:function(){var e=this.props,t=e.action,n=e.onPress;if(this.button){if(t)return void t(this.container);n&&n(this.container)}}},{key:"createBubble",value:function(e){(0,f.createBubbleEffect)({event:e,button:this.button,content:this.content,className:(0,f.getClassName)(this.rootElement+"__bubble",this.props.cssModule)})}},{key:"moveEvents",value:function(){var e=this,t={onClick:function(t){e.props.href&&e.state.disabled&&(t.preventDefault(),t.stopPropagation())},onMouseLeave:function(){e.clearPress()},onMouseDown:function(t){t&&1!==t.nativeEvent.which||e.pressIn()},onMouseUp:function(t){if(!0===e.state.disabled||!0===e.props.blocked)return t.preventDefault(),void t.stopPropagation();e.pressOut()}};return!0===this.props.moveEvents?t.onMouseMove=function(t){if(!0!==e.state.disabled){var n=e.button,r=n.getBoundingClientRect(),o=r.left,i=n.offsetWidth,c=t.pageX<.3*(o+i)?"left":t.pageX>.65*(o+i)?"right":"middle";(0,f.toggleMoveClasses)({element:e.container,root:e.rootElement,cssModule:e.props.cssModule,state:c})}}:t.onMouseEnter=function(){e.container.classList.add((0,f.classToModules)([e.rootElement+"--middle"],e.props.cssModule))},t}},{key:"render",value:function(){var e=this,t=this.renderComponent,n=this.props,r=n.title,o=n.style,i=n.cssModule,c=n.children;return p.default.createElement(t,s({style:o,className:this.getRootClassName(),role:"button",title:r},this.extraProps,this.moveEvents()),p.default.createElement("span",{ref:function(t){e.button=t},className:(0,f.getClassName)(this.rootElement+"__wrapper",i)},p.default.createElement("span",{ref:function(t){e.content=t},className:(0,f.getClassName)(this.rootElement+"__content",i)},p.default.createElement("span",{ref:function(t){e.child=t}},c))))}}]),t}(p.default.Component);b.defaultProps={action:null,onPress:null,ripple:!1,blocked:!1,cssModule:null,children:null,disabled:!1,title:null,element:null,href:null,className:null,moveEvents:!0,placeholder:!1,rootElement:h,size:null,style:{},target:null,to:null,type:"primary",visible:!0,active:!1},t.default=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(2)),h=n(7),v=r(h),m=n(8),b=r(m),g=function(e){function t(e){i(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.action=function(e){var t=n.props,r=t.action,o=t.onPress,i=t.href,c=t.type,l=t.user,s=t.phone;if(r)return void r(e);if(o)return void o(e);if(null===i){var a=(0,v.default)({height:600,width:575,url:n.getUrl(),message:n.getMessage(),type:c,user:l,phone:s});n.window&&window.open(a.url,a.title,a.extra)}},n.window="undefined"!=typeof window,n}return l(t,e),a(t,[{key:"getUrl",value:function(){return this.props.url?this.props.url:this.window?window.location.href:null}},{key:"getMessage",value:function(){if(this.props.message)return this.props.message;if("undefined"!==this.window){var e=document.querySelector("title");if(e)return e.innerHTML}return null}},{key:"getImage",value:function(){if(null!==this.props.image)return this.props.image;if(null!==this.window){var e=document.querySelector('meta[property="og:image"]');if(e)return e.getAttribute("content")}return null}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.icon,r=e.type,i=(e.action,e.onPress,e.iconWidth),c=e.iconHeight,l=e.href,a=o(e,["children","icon","type","action","onPress","iconWidth","iconHeight","href"]);return p.default.createElement(f.AwesomeButton,s({type:r,action:this.action,href:l},a),n&&(0,b.default)({type:r,width:i,height:c,color:this.props.disabled?"rgba(255,255,255,0.35)":"#FFF"})," ",t)}}]),t}(p.default.Component);g.defaultProps={action:null,onPress:null,children:null,disabled:!1,href:null,icon:!0,iconHeight:23,iconWidth:30,image:null,message:null,phone:null,url:null,user:null},t.default=g},function(e,t,n){"use strict";function r(e,t){if("undefined"==typeof window)return{top:0,left:0};var n=void 0!==window.screenLeft?window.screenLeft:screen.left,r=void 0!==window.screenTop?window.screenTop:screen.top,o=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width;return{top:(window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height)/2-t/2+r,left:o/2-e/2+n}}function o(e){var t=e.url,n=e.message,o=e.title,l=e.image,s=e.user,a=e.type,u=e.phone,p=e.width,d=e.height,f={},h={};switch(a){case"facebook":h.s=100,h["p[url]"]=t,f.url="https://www.facebook.com/sharer.php?"+(0,c.serialize)(h,"&"),f.title="Facebook Sharer";break;case"twitter":h.text=n,h.url=t,f.height=250,f.url="https://twitter.com/share?"+(0,c.serialize)(h,"&"),f.title="Twitter Sharer";break;case"pinterest":h.url=t,l&&(h.media=l),f.url="https://pinterest.com/pin/create/button/?"+(0,c.serialize)(h,"&"),f.title="Pinterest Sharer";break;case"google":case"gplus":h.url=t,f.url="https://plus.google.com/share?"+(0,c.serialize)(h,"&"),f.title="Google+ Sharer",f.width=400;break;case"linkedin":h.mini=!0,h.url=t,h.title=n||o,f.url="https://www.linkedin.com/shareArticle?"+(0,c.serialize)(h,"&"),f.title="Linkedin Sharer";break;case"reddit":h.url=t,h.title=n||o,f.url="https://www.reddit.com/submit?"+(0,c.serialize)(h,"&"),f.title="",f.width=850;break;case"whatsapp":h.phone=u.replace(/\+|(|)/gim,""),h.title=n||o,f.url="https://api.whatsapp.com/send?"+(0,c.serialize)(h,"&"),f.title="Whatsapp Message",f.width=850;break;case"messenger":f.url="https://m.me/"+s,f.title="Messenger Message",f.width=850;break;case"mail":f.url="mailto:"+t,f.title="_self";break;case"instagram":f.url=t,f.title="_self";break;default:return f}return f.extra=(0,c.serialize)(i({width:(f.width||p)+"px",height:(f.height||d)+"px"},r(f.width||p,f.height||d)),","),f}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=o;var c=n(3)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){var t=e.type,n=e.width,r=e.height,o=e.margin,i=e.color;return c.default.createElement("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",preserveAspectRatio:"xMidYMid meet",space:"preserve",viewBox:"0 0 50 50",style:{marginRight:o},width:n,height:r},c.default.createElement("path",{fill:i,d:s[t]}))}Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),c=r(i),l=n(1),s=(r(l),{youtube:"M38.1,23H11.9c-4.1,0-7.6,3.4-7.6,7.6v6.1c0,4.1,3.4,7.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2.1c2.6,0,5.2-0.5,7.5-1.5l0,0l0,0c0.3-0.2,0.7-0.3,1.1-0.5c0.2-0.1,0.4-0.2,0.5-0.4c0.2-0.2,0.3-0.4,0.4-0.6l0,0c0-0.1,0-0.2,0-0.3c0-0.2-0.1-0.4-0.1-0.5C33.3,29.5,33.1,29.3,32.9,29.2zM16.8,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C19.9,21.1,18.5,19.8,16.8,19.8z M32.1,19.8c-1.7,0-3.1,1.4-3.1,3.1s1.4,3.1,3.1,3.1s3.1-1.4,3.1-3.1C35.1,21.1,33.8,19.8,32.1,19.8z"});t.default=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},a=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),u=n(0),p=r(u),d=n(1),f=(r(d),n(2)),h=n(3),v="aws-btn",m=function(e){function t(e){i(this,t);var n=c(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.action=function(){n.startLoading();var e=n.props.action||n.props.onPress;e&&setTimeout(function(){e(n.container,n.endLoading.bind(n))},250)},n.rootElement=e.rootElement||v,n.animationStage=0,n.loading=!1,n.state={loadingEnd:!1,loadingStart:!1,loadingError:!1,errorLabel:null,blocked:!1,active:!1},n}return l(t,e),a(t,[{key:"componentDidMount",value:function(){(0,h.setCssEndEvent)(this.content,"transition",this.clearStagedWrapperAnimation.bind(this))}},{key:"componentWillReceiveProps",value:function(e){this.checkFakePress(e)}},{key:"getRootClassName",value:function(){var e=this.rootElement,t=this.state,n=t.loadingStart,r=t.loadingEnd,o=t.loadingError;return[n&&e+"--start"||null,r&&e+"--end"||null,o&&e+"--errored"||null,e+"--progress"].join(" ").trim().replace(/[\s]+/gi," ")}},{key:"checkFakePress",value:function(e){e.fakePress!==this.props.fakePress&&!0===e.fakePress&&this.action()}},{key:"endLoading",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.setState({loadingEnd:!0,loadingError:!e,errorLabel:t}),this.animationStage=1}},{key:"startLoading",value:function(){var e=this;this.loading=!0,this.setState({blocked:!0,active:!0},function(){window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){e.setState({loadingStart:!0})})})})}},{key:"clearLoading",value:function(e){this.loading=!1,this.setState({loadingStart:!1,loadingEnd:!1,active:!1},e)}},{key:"clearStagedWrapperAnimation",value:function(){var e=this;if(0!==this.animationStage){if(4===this.animationStage)return this.animationStage=0,void setTimeout(function(){"undefined"!=typeof window&&window.requestAnimationFrame(function(){e.clearLoading(function(){setTimeout(function(){e.setState({blocked:!1,loadingError:!1,errorLabel:null})},500)})})},this.props.releaseDelay);this.animationStage+=1}}},{key:"moveEvents",value:function(){var e=this;return{onMouseDown:function(t){!0===e.props.disabled||!0===e.loading||!0===e.state.blocked||t&&1!==t.nativeEvent.which||(e.loading=!0)},onMouseUp:function(t){if(!0===e.props.disabled||!0===e.loading||!0===e.state.blocked)return t.preventDefault(),void t.stopPropagation();e.action()}}}},{key:"render",value:function(){var e=this,t=this.props,n=t.children,r=t.size,i=t.cssModule,c=t.loadingLabel,l=t.resultLabel,a=(t.action,t.type),u=o(t,["children","size","cssModule","loadingLabel","resultLabel","action","type"]),d=this.state,v=d.active,m=d.blocked,b=d.errorLabel;return p.default.createElement(f.AwesomeButton,s({size:r,type:a,className:this.getRootClassName(),action:this.action,cssModule:i,active:v,blocked:m},this.moveEvents(),u),p.default.createElement("span",{ref:function(t){e.content=t},"data-loading":c||null,"data-status":b||l||null,className:(0,h.getClassName)(this.rootElement+"__progress",i)},p.default.createElement("span",null,n)))}}]),t}(p.default.Component);m.defaultProps={action:null,onPress:null,rootElement:null,loadingLabel:"Wait..",resultLabel:"Success!",disabled:!1,cssModule:null,fakePress:!1,children:null,size:null,type:null,releaseDelay:500},t.default=m}])});
{
"name": "react-awesome-button",
"version": "6.0.0",
"version": "6.1.0",
"description": "Performant, extendable, highly customisable, production ready React Component that renders an animated basic set of UI buttons",

@@ -61,2 +61,3 @@ "main": "dist/index.js",

"eslint-config-airbnb": "^16.1.0",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-import": "^2.2.0",

@@ -63,0 +64,0 @@ "eslint-plugin-jsx-a11y": "^6.0.3",

@@ -19,4 +19,4 @@ import React from 'react';

const Anchor = props => (<a {...props} />);
const Button = props => (<button {...props} />);
const Anchor = (props) => <a {...props} />;
const Button = (props) => <button {...props} />;

@@ -26,2 +26,3 @@ export default class AwesomeButton extends React.Component {

action: PropTypes.func,
onPress: PropTypes.func,
ripple: PropTypes.bool,

@@ -47,4 +48,6 @@ children: PropTypes.node,

};
static defaultProps = {
action: null,
onPress: null,
ripple: false,

@@ -70,2 +73,3 @@ blocked: false,

};
constructor(props) {

@@ -81,5 +85,7 @@ super(props);

}
componentDidMount() {
this.container = this.button && this.button.parentNode;
}
componentWillReceiveProps(newProps) {

@@ -90,2 +96,3 @@ this.checkPlaceholder(newProps);

}
componentWillUnmount() {

@@ -99,14 +106,4 @@ if (this.clearTimer) {

const { rootElement } = this;
const {
type,
size,
placeholder,
children,
visible,
cssModule,
} = this.props;
const {
disabled,
pressPosition,
} = this.state;
const { type, size, placeholder, children, visible, cssModule } = this.props;
const { disabled, pressPosition } = this.state;
const className = [

@@ -131,4 +128,8 @@ this.rootElement,

}
return className.join(' ').trim().replace(/[\s]+/ig, ' ');
return className
.join(' ')
.trim()
.replace(/[\s]+/gi, ' ');
}
checkActive(newProps) {

@@ -145,9 +146,5 @@ if (newProps.active !== this.props.active) {

}
checkProps(newProps) {
const {
to,
href,
target,
element,
} = newProps;
const { to, href, target, element } = newProps;
this.extraProps.to = to || null;

@@ -158,2 +155,3 @@ this.extraProps.href = href || null;

}
checkPlaceholder(newProps) {

@@ -177,2 +175,3 @@ const { disabled, placeholder, children } = newProps;

}
clearPress(force) {

@@ -189,6 +188,5 @@ toggleMoveClasses({

}
pressIn() {
if (this.state.disabled === true ||
this.props.blocked === true
) {
if (this.state.disabled === true || this.props.blocked === true) {
return;

@@ -201,2 +199,3 @@ }

}
pressOut() {

@@ -219,7 +218,17 @@ if (this.clearTimer) {

}
action() {
if (this.props.action && this.button) {
this.props.action(this.container);
const { action, onPress } = this.props;
if (this.button) {
if (action) {
action(this.container);
return;
}
if (onPress) {
onPress(this.container);
}
}
}
createBubble(event) {

@@ -233,2 +242,3 @@ createBubbleEffect({

}
moveEvents() {

@@ -252,4 +262,3 @@ const events = {

onMouseUp: (event) => {
if (this.state.disabled === true ||
this.props.blocked === true) {
if (this.state.disabled === true || this.props.blocked === true) {
event.preventDefault();

@@ -270,5 +279,6 @@ event.stopPropagation();

const width = button.offsetWidth;
const state = event.pageX < (left + (width * 0.3))
? 'left'
: event.pageX > (left + (width * 0.65))
const state =
event.pageX < (left + width) * 0.3
? 'left'
: event.pageX > (left + width) * 0.65
? 'right'

@@ -285,3 +295,5 @@ : 'middle';

events.onMouseEnter = () => {
this.container.classList.add(classToModules([`${this.rootElement}--middle`], this.props.cssModule));
this.container.classList.add(
classToModules([`${this.rootElement}--middle`], this.props.cssModule)
);
};

@@ -294,8 +306,3 @@ }

const RenderComponent = this.renderComponent;
const {
title,
style,
cssModule,
children,
} = this.props;
const { title, style, cssModule, children } = this.props;
return (

@@ -311,10 +318,20 @@ <RenderComponent

<span
ref={(button) => { this.button = button; }}
ref={(button) => {
this.button = button;
}}
className={getClassName(`${this.rootElement}__wrapper`, cssModule)}
>
<span
ref={(content) => { this.content = content; }}
ref={(content) => {
this.content = content;
}}
className={getClassName(`${this.rootElement}__content`, cssModule)}
>
<span ref={(child) => { this.child = child; }}>{children}</span>
<span
ref={(child) => {
this.child = child;
}}
>
{children}
</span>
</span>

@@ -321,0 +338,0 @@ </span>

import React from 'react';
import PropTypes from 'prop-types';
import { AwesomeButton } from '../../index';
import {
getClassName,
setCssEndEvent,
} from '../../helpers/components';
import { getClassName, setCssEndEvent } from '../../helpers/components';

@@ -12,6 +9,6 @@ const ROOTELM = 'aws-btn';

export default class AwesomeProgress extends React.Component {
static propTypes = {
action: PropTypes.func,
onPress: PropTypes.func,
loadingLabel: PropTypes.string,

@@ -28,4 +25,6 @@ resultLabel: PropTypes.string,

};
static defaultProps = {
action: null,
onPress: null,
rootElement: null,

@@ -42,2 +41,3 @@ loadingLabel: 'Wait..',

};
constructor(props) {

@@ -57,17 +57,14 @@ super(props);

}
componentDidMount() {
setCssEndEvent(this.content, 'transition', this.clearStagedWrapperAnimation.bind(this));
}
componentWillReceiveProps(newProps) {
this.checkFakePress(newProps);
}
getRootClassName() {
const {
rootElement,
} = this;
const {
loadingStart,
loadingEnd,
loadingError,
} = this.state;
const { rootElement } = this;
const { loadingStart, loadingEnd, loadingError } = this.state;
const className = [

@@ -79,4 +76,8 @@ (loadingStart && `${rootElement}--start`) || null,

];
return className.join(' ').trim().replace(/[\s]+/ig, ' ');
return className
.join(' ')
.trim()
.replace(/[\s]+/gi, ' ');
}
checkFakePress(newProps) {

@@ -89,2 +90,3 @@ if (newProps.fakePress !== this.props.fakePress) {

}
endLoading(state = true, errorLabel = null) {

@@ -98,9 +100,12 @@ this.setState({

}
startLoading() {
this.loading = true;
this.setState({
blocked: true,
active: true,
}, () => {
/*
this.setState(
{
blocked: true,
active: true,
},
() => {
/*
To avoid the button eventual flickering I've changed the display strategy

@@ -110,19 +115,25 @@ for that to work in a controlled way we need to set the loadingStart

*/
window.requestAnimationFrame(() => {
window.requestAnimationFrame(() => {
this.setState({
loadingStart: true,
window.requestAnimationFrame(() => {
this.setState({
loadingStart: true,
});
});
});
});
});
}
);
}
clearLoading(callback) {
this.loading = false;
this.setState({
loadingStart: false,
loadingEnd: false,
active: false,
}, callback);
this.setState(
{
loadingStart: false,
loadingEnd: false,
active: false,
},
callback
);
}
clearStagedWrapperAnimation() {

@@ -152,17 +163,18 @@ if (this.animationStage !== 0) {

}
action = () => {
this.startLoading();
if (this.props.action) {
const action = this.props.action || this.props.onPress;
if (action) {
setTimeout(() => {
this.props.action(
this.container,
this.endLoading.bind(this),
);
action(this.container, this.endLoading.bind(this));
}, 250);
}
}
};
moveEvents() {
const events = {
onMouseDown: (event) => {
if (this.props.disabled === true ||
if (
this.props.disabled === true ||
this.loading === true ||

@@ -177,5 +189,3 @@ this.state.blocked === true ||

onMouseUp: (event) => {
if (this.props.disabled === true ||
this.loading === true ||
this.state.blocked === true) {
if (this.props.disabled === true || this.loading === true || this.state.blocked === true) {
event.preventDefault();

@@ -190,2 +200,3 @@ event.stopPropagation();

}
render() {

@@ -202,7 +213,5 @@ const {

} = this.props;
const {
active,
blocked,
errorLabel,
} = this.state;
const { active, blocked, errorLabel } = this.state;
return (

@@ -221,5 +230,7 @@ <AwesomeButton

<span
ref={(content) => { this.content = content; }}
data-loading={(loadingLabel) || null}
data-status={(errorLabel) || (resultLabel) || null}
ref={(content) => {
this.content = content;
}}
data-loading={loadingLabel || null}
data-status={errorLabel || resultLabel || null}
className={getClassName(`${this.rootElement}__progress`, cssModule)}

@@ -226,0 +237,0 @@ >

@@ -13,2 +13,3 @@ import React from 'react';

action: PropTypes.func,
onPress: PropTypes.func,
children: PropTypes.node,

@@ -30,2 +31,3 @@ disabled: PropTypes.bool,

action: null,
onPress: null,
children: null,

@@ -85,7 +87,16 @@ disabled: false,

action = () => {
if (this.props.href !== null) {
action = (container) => {
const { action, onPress, href, type, user, phone } = this.props;
if (action) {
action(container);
return;
}
const { type, user, phone } = this.props;
if (onPress) {
onPress(container);
return;
}
if (href !== null) {
return;
}

@@ -101,6 +112,7 @@ const sharer = Sharer({

});
if (this.window) {
window.open(sharer.url, sharer.title, sharer.extra);
}
}
};

@@ -113,2 +125,3 @@ render() {

action,
onPress,
iconWidth,

@@ -121,14 +134,11 @@ iconHeight,

return (
<AwesomeButton
type={type}
action={this.action}
href={href}
{...extra}
>
{icon && getIcon({
type,
width: iconWidth,
height: iconHeight,
color: this.props.disabled ? 'rgba(255,255,255,0.35)' : '#FFF',
})} {children}
<AwesomeButton type={type} action={this.action} href={href} {...extra}>
{icon &&
getIcon({
type,
width: iconWidth,
height: iconHeight,
color: this.props.disabled ? 'rgba(255,255,255,0.35)' : '#FFF',
})}{' '}
{children}
</AwesomeButton>

@@ -135,0 +145,0 @@ );

@@ -12,25 +12,19 @@ import { serialize } from '../../helpers/components';

const screenTop = window.screenTop !== undefined ? window.screenTop : screen.top;
const windowWidth = window.innerWidth ?
window.innerWidth : document.documentElement.clientWidth ?
document.documentElement.clientWidth : screen.width;
const windowHeight = window.innerHeight ?
window.innerHeight : document.documentElement.clientHeight ?
document.documentElement.clientHeight : screen.height;
const windowWidth = window.innerWidth
? window.innerWidth
: document.documentElement.clientWidth
? document.documentElement.clientWidth
: screen.width;
const windowHeight = window.innerHeight
? window.innerHeight
: document.documentElement.clientHeight
? document.documentElement.clientHeight
: screen.height;
return {
top: ((windowHeight / 2) - (height / 2)) + screenTop,
left: ((windowWidth / 2) - (width / 2)) + screenLeft,
top: windowHeight / 2 - height / 2 + screenTop,
left: windowWidth / 2 - width / 2 + screenLeft,
};
}
export default function Sharer({
url,
message,
title,
image,
user,
type,
phone,
width,
height,
}) {
export default function Sharer({ url, message, title, image, user, type, phone, width, height }) {
const args = {};

@@ -82,3 +76,3 @@ const params = {};

case 'whatsapp':
params.phone = phone.replace(/\+|(|)/mig, '');
params.phone = phone.replace(/\+|(|)/gim, '');
params.title = message || title;

@@ -98,11 +92,20 @@ args.url = `https://api.whatsapp.com/send?${serialize(params, '&')}`;

break;
case 'instagram':
args.url = url;
args.title = '_self';
break;
default:
return args;
}
args.extra = serialize({
width: `${args.width || width}px`,
height: `${args.height || height}px`,
...centerWindow(args.width || width, args.height || height),
}, ',');
args.extra = serialize(
{
width: `${args.width || width}px`,
height: `${args.height || height}px`,
...centerWindow(args.width || width, args.height || height),
},
','
);
return args;
}

@@ -16,3 +16,3 @@ import React from 'react';

cssModule={defaultStyles} /* Skipped props */
action={action('clicked')}
onPress={action('clicked')}
>

@@ -25,20 +25,10 @@ Primary

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>
Secondary
</AwesomeButton>
<AwesomeButton
size="medium"
type="link"
cssModule={defaultStyles}
action={action('clicked')}
>
<AwesomeButton size="medium" type="link" cssModule={defaultStyles} onPress={action('clicked')}>
Link
</AwesomeButton>
<AwesomeButton
size="medium"
disabled
cssModule={defaultStyles}
action={action('clicked')}
>
<AwesomeButton size="medium" disabled cssModule={defaultStyles} onPress={action('clicked')}>
Disabled

@@ -51,3 +41,3 @@ </AwesomeButton>

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
/>

@@ -68,3 +58,3 @@ </List>

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>

@@ -81,3 +71,3 @@ {text('text', 'Primary')}

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>

@@ -96,3 +86,3 @@ {text('text', 'Secondary')}

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>

@@ -109,3 +99,3 @@ {text('text', 'Anchored Link')}

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>

@@ -123,3 +113,3 @@ {text('Text', 'Disabled')}

cssModule={defaultStyles}
action={action('clicked')}
onPress={action('clicked')}
>

@@ -126,0 +116,0 @@ {text('text', null)}

@@ -19,3 +19,3 @@ import React from 'react';

cssModule={cssModule}
action={(element, next) => {
onPress={(element, next) => {
action('clicked');

@@ -39,3 +39,3 @@ setTimeout(() => {

cssModule={cssModule}
action={(element, next) => {
onPress={(element, next) => {
action('clicked');

@@ -60,3 +60,3 @@ setTimeout(() => {

cssModule={cssModule}
action={(element, next) => {
onPress={(element, next) => {
setTimeout(() => {

@@ -76,3 +76,3 @@ next(false, 'Error Message :(');

cssModule={cssModule}
action={(element, next) => {
onPress={(element, next) => {
action('clicked');

@@ -79,0 +79,0 @@ setTimeout(() => {

@@ -10,8 +10,16 @@ import React from 'react';

const renderTheme = module => (
const renderTheme = (module) => (
<List>
<AwesomeButton size="medium" type="primary" cssModule={module}>Primary</AwesomeButton>
<AwesomeButton size="medium" type="secondary" cssModule={module}>Secondary</AwesomeButton>
<AwesomeButton size="medium" type="link" cssModule={module}>Link</AwesomeButton>
<AwesomeButton size="medium" disabled cssModule={module}>Disabled</AwesomeButton>
<AwesomeButton size="medium" type="primary" cssModule={module}>
Primary
</AwesomeButton>
<AwesomeButton size="medium" type="secondary" cssModule={module}>
Secondary
</AwesomeButton>
<AwesomeButton size="medium" type="link" cssModule={module}>
Link
</AwesomeButton>
<AwesomeButton size="medium" disabled cssModule={module}>
Disabled
</AwesomeButton>
<AwesomeButton size="medium" disabled placeholder cssModule={module} />

@@ -18,0 +26,0 @@ </List>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc