@zendeskgarden/react-loaders
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -6,2 +6,10 @@ # Change Log | ||
## [0.2.1](https://github.com/zendeskgarden/react-components/compare/@zendeskgarden/react-loaders@0.2.0...@zendeskgarden/react-loaders@0.2.1) (2018-10-30) | ||
**Note:** Version bump only for package @zendeskgarden/react-loaders | ||
<a name="0.2.0"></a> | ||
@@ -8,0 +16,0 @@ # [0.2.0](https://github.com/zendeskgarden/react-components/compare/@zendeskgarden/react-loaders@0.1.3...@zendeskgarden/react-loaders@0.2.0) (2018-10-17) |
@@ -192,3 +192,3 @@ /*! | ||
}, | ||
'data-garden-version': "0.2.0", | ||
'data-garden-version': "0.2.1", | ||
xmlns: 'http://www.w3.org/2000/svg', | ||
@@ -195,0 +195,0 @@ width: function width(_ref4) { |
@@ -7,3 +7,3 @@ /*! | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("rop-types"),require("styled-components"),require("@zendeskgarden/react-theming")):"function"==typeof define&&define.amd?define(["react","prop-types","styled-components","@zendeskgarden/react-theming"],t):"object"==typeof exports?exports.GardenLoaders=t(require("react"),require("rop-types"),require("styled-components"),require("@zendeskgarden/react-theming")):e.GardenLoaders=t(e.React,e.PropTypes,e.styled,e.GardenTheming)}(window,function(r,n,o,a){return function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}([function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadingPlaceholder=t.StyledSVG=t.SpinnerCircle=t.DotsCircle=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=l(r(0)),n=l(r(1)),o=l(r(8)),a=r(9);function l(e){return e&&e.__esModule?e:{default:e}}(t.DotsCircle=o.default.circle.attrs({cx:9,cy:9,r:9,transform:function(e){return e.transform}}).withConfig({displayName:"styled-elements__DotsCircle",componentId:"sc-19dhio6-0"})([""])).propTypes={transform:n.default.string},(t.SpinnerCircle=o.default.circle.attrs({cx:40,cy:40,r:34,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:function(e){return e.strokeWidthValue},strokeDasharray:function(e){return e.dasharrayValue+" 250"},transform:function(e){return e.transform}}).withConfig({displayName:"styled-elements__SpinnerCircle",componentId:"sc-19dhio6-1"})([""])).propTypes={dasharrayValue:n.default.string,strokeWidthValue:n.default.string,transform:n.default.string};var f=o.default.svg.attrs({"data-garden-id":function(e){return e.dataGardenId},"data-garden-version":"0.2.0",xmlns:"http://www.w3.org/2000/svg",width:function(e){return e.width},height:function(e){return e.height},focusable:"false",viewBox:function(e){return"0 0 "+e.width+" "+e.height},role:"progressbar"}).withConfig({displayName:"styled-elements__StyledSvg",componentId:"sc-19dhio6-2"})(["width:1em;height:0.9em;color:",";font-size:",";",";"],function(e){return e.color||"inherit"},function(e){return e.fontSize||"inherit"},function(e){return(0,a.retrieveTheme)(e.dataGardenId,e)});f.propTypes={color:n.default.string,fontSize:n.default.any};var c=function(e){var t=e.children,r=e.fontSize,n=e.width,o=e.height,a=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["children","fontSize","width","height"]);return u.default.createElement(f,i({fontSize:r,width:n,height:o},a),t)};(t.StyledSVG=c).propTypes={children:n.default.node,fontSize:n.default.any,height:n.default.oneOfType([n.default.string,n.default.number]),width:n.default.oneOfType([n.default.string,n.default.number])},(t.LoadingPlaceholder=o.default.div.attrs({role:"progressbar"}).withConfig({displayName:"styled-elements__LoadingPlaceholder",componentId:"sc-19dhio6-3"})(["display:inline;width:1em;height:0.9em;font-size:",";"],function(e){return e.fontSize})).propTypes={fontSize:n.default.any}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),o=r(0),i=l(o),a=l(r(1)),u=r(2);function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(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}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.state={delayComplete:!1},t}return function(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)}(r,o.Component),n(r,[{key:"componentDidMount",value:function(){var e=this,t=this.props.delayMS;this.renderingDelayTimeout=setTimeout(function(){e.setState({delayComplete:!0},function(){e.performAnimationFrame()})},t)}},{key:"componentDidUpdate",value:function(){this.performAnimationFrame()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.renderingDelayTimeout),cancelAnimationFrame(this.tick)}},{key:"performAnimationFrame",value:function(){this.tick=requestAnimationFrame(this.props.tick)}},{key:"render",value:function(){var e=this.props,t=e.delayMS,r=e.size,n=e.children,o=e.render,a=void 0===o?n:o;return this.state.delayComplete||0===t?a():i.default.createElement(u.LoadingPlaceholder,{fontSize:r}," ")}}]),r}();f.propTypes={size:a.default.any,delayMS:a.default.number,tick:a.default.func,children:a.default.func,render:a.default.func},f.defaultProps={delayMS:750},t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5);Object.defineProperty(t,"Dots",{enumerable:!0,get:function(){return a(n).default}});var o=r(10);function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Spinner",{enumerable:!0,get:function(){return a(o).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),f=a(r(0)),o=a(r(1)),c=r(6),s=r(2),d=a(r(3));function a(e){return e&&e.__esModule?e:{default:e}}function u(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}var i=function(e){function i(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];return(t=r=u(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(o)))).state={frame:0,timestamp:0},r.performAnimationFrame=function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=r.props.velocity,o=e;e<-1?o=-.9:1<e&&(o=1),r.setState(function(e){var t=1e3+1e3*o,r=(n-e.timestamp)/t;return{frame:e.frame+r%c.KEYFRAME_MAX,timestamp:n}})},r.retrieveFrame=function(e){var t=2*c.KEYFRAME_MAX;return(r.state.frame+e*t)%t},u(r,t)}return function(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)}(i,f.default.Component),n(i,[{key:"render",value:function(){var e=this.props,t=e.size,r=e.color,n=e.delayMS,o=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","color","delayMS"]),a=this.retrieveFrame(0),i=this.retrieveFrame(1/3),u=this.retrieveFrame(2/3);return f.default.createElement(d.default,{tick:this.performAnimationFrame,size:t,delayMS:n},function(){return f.default.createElement(s.StyledSVG,l({fontSize:t,color:r,width:"80",height:"72","data-garden-id":"loaders.dots"},o),f.default.createElement("g",{fill:"currentColor"},f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(a)+" "+(0,c.retrieveYCoordinate)(a)+")"}),f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(i)+" "+(0,c.retrieveYCoordinate)(i)+")"}),f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(u)+" "+(0,c.retrieveYCoordinate)(u)+")"})))})}}]),i}();i.propTypes={size:o.default.any,velocity:o.default.number,color:o.default.string,delayMS:o.default.number},i.defaultProps={size:"inherit",color:"inherit",velocity:.05,delayMS:750},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEYFRAME_MAX=t.KEYFRAME_5=t.KEYFRAME_4=t.KEYFRAME_3=t.KEYFRAME_2=t.KEYFRAME_1=void 0,t.retrieveXCoordinate=function(e){var t=void 0,r=e%y;{if(r<c)return m;if(r<l){var n=r-c,o=l-c,a=(0,f.easeInOutCubic)(n/o);t=m-a*m}else if(r<d)t=0;else{var i=r-d,u=y-d;t=m*(i/u)}}y<=e&&(t=2*m-t);return t},t.retrieveYCoordinate=function(e){var t=e%y;{if(t<c)return t/c*-1*(v-h)+v;if(t<s)return h;if(t<d){var r=t-s,n=d-s;return r/n*(v-h)+h}if(t<p){var o=t-d,a=p-d,i=(0,f.easeOutCubic)(o/a);return v-i*v}}var u=t-p,l=y-p;return(0,f.easeInCubic)(u/l)*v};var f=r(7),c=t.KEYFRAME_1=.166666667,l=t.KEYFRAME_2=.55,s=t.KEYFRAME_3=1.166666667,d=t.KEYFRAME_4=1.333333333,p=t.KEYFRAME_5=1.533333333,y=t.KEYFRAME_MAX=1.766666667,m=31,h=27,v=h+5},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.easeInCubic=function(e){return e*e*e},t.easeOutCubic=function(e){var t=e-1;return t*t*t+1},t.easeInOutCubic=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),c=i(r(0)),o=i(r(1)),a=r(11),s=r(2),d=i(r(3));function i(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.state={frame:0,rawFrame:0,totalFrames:100,delayComplete:!1,timestamp:0},u.computeFrames=function(e){var m=u.props.duration,h=u.state.totalFrames;return Object.entries(e).reduce(function(e,t,r,n){var o=v(t,2),a=o[0],i=o[1],u=n[r+1]||[h,n[0][1]],l=v(u,2),f=l[0],c=l[1],s=f-a,d=m/(h-1)*s,p=i;e[a]=i;for(var y=0;y<s;y++)p+=1e3/60/d*(c-p),d=m/(h-1)*(s-y),e[parseInt(a,10)+y+1]=p;return e[f]=c,e},{})},u.performAnimationFrame=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=u.state,r=e.totalFrames,n=e.rawFrame,o=e.timestamp,a=u.props.duration,i=t-o;u.setState(function(){var e=n+i*((r+1)/a);return{frame:Math.floor(e)%r,rawFrame:e%r,timestamp:t}})},u.strokeWidthValues=u.computeFrames(a.STROKE_WIDTH_FRAMES),u.rotationValues=u.computeFrames(a.ROTATION_FRAMES),u.dasharrayValues=u.computeFrames(a.DASHARRAY_FRAMES),u}return function(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)}(t,c.default.Component),n(t,[{key:"render",value:function(){var e=this.props,t=e.size,r=e.color,n=e.delayMS,o=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","color","delayMS"]),a=this.state.frame,i=this.strokeWidthValues[a],u=this.rotationValues[a],l=this.dasharrayValues[a];return c.default.createElement(d.default,{tick:this.performAnimationFrame,size:t,delayMS:n},function(){return c.default.createElement(s.StyledSVG,f({fontSize:t,color:r,width:80,height:80,"data-garden-id":"loaders.spinner"},o),c.default.createElement(s.SpinnerCircle,{strokeDasharray:l+" 250",strokeWidth:i,transform:"rotate("+u+", 40, 40)"}))})}}]),t}();u.propTypes={size:o.default.any,duration:o.default.number,color:o.default.string,delayMS:o.default.number},u.defaultProps={size:"inherit",color:"inherit",delayMS:750,duration:1250},t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.STROKE_WIDTH_FRAMES={0:6,14:5,26:4,36:3,46:2,58:3,70:4,80:5,91:6},t.ROTATION_FRAMES={0:-90,8:-81,36:-30,41:-18,44:-8,48:0,55:22,63:53,64:62,66:67,68:78,69:90,71:99,73:112,74:129,76:138,78:159,79:180,81:190,83:207,84:221,86:226,88:235,90:243,99:270},t.DASHARRAY_FRAMES={0:0,13:2,26:13,53:86,58:90,63:89,64:88,66:86,68:83,69:81,71:76,73:70,74:62,76:58,78:47,79:37,81:31,83:23,84:16,88:10,89:7,98:1,99:0}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("rop-types"),require("styled-components"),require("@zendeskgarden/react-theming")):"function"==typeof define&&define.amd?define(["react","prop-types","styled-components","@zendeskgarden/react-theming"],t):"object"==typeof exports?exports.GardenLoaders=t(require("react"),require("rop-types"),require("styled-components"),require("@zendeskgarden/react-theming")):e.GardenLoaders=t(e.React,e.PropTypes,e.styled,e.GardenTheming)}(window,function(r,n,o,a){return function(r){var n={};function o(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}return o.m=r,o.c=n,o.d=function(e,t,r){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(o.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(r,n,function(e){return t[e]}.bind(null,n));return r},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=4)}([function(e,t){e.exports=r},function(e,t){e.exports=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoadingPlaceholder=t.StyledSVG=t.SpinnerCircle=t.DotsCircle=void 0;var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u=l(r(0)),n=l(r(1)),o=l(r(8)),a=r(9);function l(e){return e&&e.__esModule?e:{default:e}}(t.DotsCircle=o.default.circle.attrs({cx:9,cy:9,r:9,transform:function(e){return e.transform}}).withConfig({displayName:"styled-elements__DotsCircle",componentId:"sc-19dhio6-0"})([""])).propTypes={transform:n.default.string},(t.SpinnerCircle=o.default.circle.attrs({cx:40,cy:40,r:34,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:function(e){return e.strokeWidthValue},strokeDasharray:function(e){return e.dasharrayValue+" 250"},transform:function(e){return e.transform}}).withConfig({displayName:"styled-elements__SpinnerCircle",componentId:"sc-19dhio6-1"})([""])).propTypes={dasharrayValue:n.default.string,strokeWidthValue:n.default.string,transform:n.default.string};var f=o.default.svg.attrs({"data-garden-id":function(e){return e.dataGardenId},"data-garden-version":"0.2.1",xmlns:"http://www.w3.org/2000/svg",width:function(e){return e.width},height:function(e){return e.height},focusable:"false",viewBox:function(e){return"0 0 "+e.width+" "+e.height},role:"progressbar"}).withConfig({displayName:"styled-elements__StyledSvg",componentId:"sc-19dhio6-2"})(["width:1em;height:0.9em;color:",";font-size:",";",";"],function(e){return e.color||"inherit"},function(e){return e.fontSize||"inherit"},function(e){return(0,a.retrieveTheme)(e.dataGardenId,e)});f.propTypes={color:n.default.string,fontSize:n.default.any};var c=function(e){var t=e.children,r=e.fontSize,n=e.width,o=e.height,a=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["children","fontSize","width","height"]);return u.default.createElement(f,i({fontSize:r,width:n,height:o},a),t)};(t.StyledSVG=c).propTypes={children:n.default.node,fontSize:n.default.any,height:n.default.oneOfType([n.default.string,n.default.number]),width:n.default.oneOfType([n.default.string,n.default.number])},(t.LoadingPlaceholder=o.default.div.attrs({role:"progressbar"}).withConfig({displayName:"styled-elements__LoadingPlaceholder",componentId:"sc-19dhio6-3"})(["display:inline;width:1em;height:0.9em;font-size:",";"],function(e){return e.fontSize})).propTypes={fontSize:n.default.any}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),o=r(0),i=l(o),a=l(r(1)),u=r(2);function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function r(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r);var t=function(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}(this,(r.__proto__||Object.getPrototypeOf(r)).call(this,e));return t.state={delayComplete:!1},t}return function(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)}(r,o.Component),n(r,[{key:"componentDidMount",value:function(){var e=this,t=this.props.delayMS;this.renderingDelayTimeout=setTimeout(function(){e.setState({delayComplete:!0},function(){e.performAnimationFrame()})},t)}},{key:"componentDidUpdate",value:function(){this.performAnimationFrame()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.renderingDelayTimeout),cancelAnimationFrame(this.tick)}},{key:"performAnimationFrame",value:function(){this.tick=requestAnimationFrame(this.props.tick)}},{key:"render",value:function(){var e=this.props,t=e.delayMS,r=e.size,n=e.children,o=e.render,a=void 0===o?n:o;return this.state.delayComplete||0===t?a():i.default.createElement(u.LoadingPlaceholder,{fontSize:r}," ")}}]),r}();f.propTypes={size:a.default.any,delayMS:a.default.number,tick:a.default.func,children:a.default.func,render:a.default.func},f.defaultProps={delayMS:750},t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5);Object.defineProperty(t,"Dots",{enumerable:!0,get:function(){return a(n).default}});var o=r(10);function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"Spinner",{enumerable:!0,get:function(){return a(o).default}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),f=a(r(0)),o=a(r(1)),c=r(6),s=r(2),d=a(r(3));function a(e){return e&&e.__esModule?e:{default:e}}function u(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}var i=function(e){function i(){var e,t,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i);for(var n=arguments.length,o=Array(n),a=0;a<n;a++)o[a]=arguments[a];return(t=r=u(this,(e=i.__proto__||Object.getPrototypeOf(i)).call.apply(e,[this].concat(o)))).state={frame:0,timestamp:0},r.performAnimationFrame=function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=r.props.velocity,o=e;e<-1?o=-.9:1<e&&(o=1),r.setState(function(e){var t=1e3+1e3*o,r=(n-e.timestamp)/t;return{frame:e.frame+r%c.KEYFRAME_MAX,timestamp:n}})},r.retrieveFrame=function(e){var t=2*c.KEYFRAME_MAX;return(r.state.frame+e*t)%t},u(r,t)}return function(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)}(i,f.default.Component),n(i,[{key:"render",value:function(){var e=this.props,t=e.size,r=e.color,n=e.delayMS,o=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","color","delayMS"]),a=this.retrieveFrame(0),i=this.retrieveFrame(1/3),u=this.retrieveFrame(2/3);return f.default.createElement(d.default,{tick:this.performAnimationFrame,size:t,delayMS:n},function(){return f.default.createElement(s.StyledSVG,l({fontSize:t,color:r,width:"80",height:"72","data-garden-id":"loaders.dots"},o),f.default.createElement("g",{fill:"currentColor"},f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(a)+" "+(0,c.retrieveYCoordinate)(a)+")"}),f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(i)+" "+(0,c.retrieveYCoordinate)(i)+")"}),f.default.createElement(s.DotsCircle,{transform:"translate("+(0,c.retrieveXCoordinate)(u)+" "+(0,c.retrieveYCoordinate)(u)+")"})))})}}]),i}();i.propTypes={size:o.default.any,velocity:o.default.number,color:o.default.string,delayMS:o.default.number},i.defaultProps={size:"inherit",color:"inherit",velocity:.05,delayMS:750},t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KEYFRAME_MAX=t.KEYFRAME_5=t.KEYFRAME_4=t.KEYFRAME_3=t.KEYFRAME_2=t.KEYFRAME_1=void 0,t.retrieveXCoordinate=function(e){var t=void 0,r=e%y;{if(r<c)return m;if(r<l){var n=r-c,o=l-c,a=(0,f.easeInOutCubic)(n/o);t=m-a*m}else if(r<d)t=0;else{var i=r-d,u=y-d;t=m*(i/u)}}y<=e&&(t=2*m-t);return t},t.retrieveYCoordinate=function(e){var t=e%y;{if(t<c)return t/c*-1*(v-h)+v;if(t<s)return h;if(t<d){var r=t-s,n=d-s;return r/n*(v-h)+h}if(t<p){var o=t-d,a=p-d,i=(0,f.easeOutCubic)(o/a);return v-i*v}}var u=t-p,l=y-p;return(0,f.easeInCubic)(u/l)*v};var f=r(7),c=t.KEYFRAME_1=.166666667,l=t.KEYFRAME_2=.55,s=t.KEYFRAME_3=1.166666667,d=t.KEYFRAME_4=1.333333333,p=t.KEYFRAME_5=1.533333333,y=t.KEYFRAME_MAX=1.766666667,m=31,h=27,v=h+5},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.easeInCubic=function(e){return e*e*e},t.easeOutCubic=function(e){var t=e-1;return t*t*t+1},t.easeInOutCubic=function(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}},function(e,t){e.exports=o},function(e,t){e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{!n&&u.return&&u.return()}finally{if(o)throw a}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=function(){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}}(),c=i(r(0)),o=i(r(1)),a=r(11),s=r(2),d=i(r(3));function i(e){return e&&e.__esModule?e:{default:e}}var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var u=function(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}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return u.state={frame:0,rawFrame:0,totalFrames:100,delayComplete:!1,timestamp:0},u.computeFrames=function(e){var m=u.props.duration,h=u.state.totalFrames;return Object.entries(e).reduce(function(e,t,r,n){var o=v(t,2),a=o[0],i=o[1],u=n[r+1]||[h,n[0][1]],l=v(u,2),f=l[0],c=l[1],s=f-a,d=m/(h-1)*s,p=i;e[a]=i;for(var y=0;y<s;y++)p+=1e3/60/d*(c-p),d=m/(h-1)*(s-y),e[parseInt(a,10)+y+1]=p;return e[f]=c,e},{})},u.performAnimationFrame=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,e=u.state,r=e.totalFrames,n=e.rawFrame,o=e.timestamp,a=u.props.duration,i=t-o;u.setState(function(){var e=n+i*((r+1)/a);return{frame:Math.floor(e)%r,rawFrame:e%r,timestamp:t}})},u.strokeWidthValues=u.computeFrames(a.STROKE_WIDTH_FRAMES),u.rotationValues=u.computeFrames(a.ROTATION_FRAMES),u.dasharrayValues=u.computeFrames(a.DASHARRAY_FRAMES),u}return function(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)}(t,c.default.Component),n(t,[{key:"render",value:function(){var e=this.props,t=e.size,r=e.color,n=e.delayMS,o=function(e,t){var r={};for(var n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["size","color","delayMS"]),a=this.state.frame,i=this.strokeWidthValues[a],u=this.rotationValues[a],l=this.dasharrayValues[a];return c.default.createElement(d.default,{tick:this.performAnimationFrame,size:t,delayMS:n},function(){return c.default.createElement(s.StyledSVG,f({fontSize:t,color:r,width:80,height:80,"data-garden-id":"loaders.spinner"},o),c.default.createElement(s.SpinnerCircle,{strokeDasharray:l+" 250",strokeWidth:i,transform:"rotate("+u+", 40, 40)"}))})}}]),t}();u.propTypes={size:o.default.any,duration:o.default.number,color:o.default.string,delayMS:o.default.number},u.defaultProps={size:"inherit",color:"inherit",delayMS:750,duration:1250},t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.STROKE_WIDTH_FRAMES={0:6,14:5,26:4,36:3,46:2,58:3,70:4,80:5,91:6},t.ROTATION_FRAMES={0:-90,8:-81,36:-30,41:-18,44:-8,48:0,55:22,63:53,64:62,66:67,68:78,69:90,71:99,73:112,74:129,76:138,78:159,79:180,81:190,83:207,84:221,86:226,88:235,90:243,99:270},t.DASHARRAY_FRAMES={0:0,13:2,26:13,53:86,58:90,63:89,64:88,66:86,68:83,69:81,71:76,73:70,74:62,76:58,78:47,79:37,81:31,83:23,84:16,88:10,89:7,98:1,99:0}}])}); | ||
//# sourceMappingURL=bundle.min.js.map |
@@ -11,3 +11,3 @@ { | ||
}, | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"main": "./dist/index.js", | ||
@@ -33,3 +33,3 @@ "files": [ | ||
"devDependencies": { | ||
"@zendeskgarden/css-variables": "5.1.1", | ||
"@zendeskgarden/css-variables": "5.1.2", | ||
"@zendeskgarden/react-theming": "^3.1.1" | ||
@@ -48,3 +48,3 @@ }, | ||
"zendeskgarden:src": "src/index.js", | ||
"gitHead": "5ae8ec8841b4321ea37c04335315f2fd293afbac" | ||
"gitHead": "b94f5ca655d4fb17b1c0a355ab69c5fc180129a1" | ||
} |
138609