@polygon.io/core
Version:
A set of themeable UI components for React
1 lines • 7.59 kB
JavaScript
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault"),_typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:!0}),exports["default"]=void 0;var _react=_interopRequireDefault(require("react")),_styledComponents=_interopRequireWildcard(require("styled-components")),_AnimatedSvg=_interopRequireDefault(require("./AnimatedSvg"));function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function(a){return a?c:b})(a)}function _interopRequireWildcard(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!==_typeof(a)&&"function"!=typeof a)return{default:a};var c=_getRequireWildcardCache(b);if(c&&c.has(a))return c.get(a);var d={},e=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in a)if("default"!=f&&Object.prototype.hasOwnProperty.call(a,f)){var g=e?Object.getOwnPropertyDescriptor(a,f):null;g&&(g.get||g.set)?Object.defineProperty(d,f,g):d[f]=a[f]}return d["default"]=a,c&&c.set(a,d),d}var __jsx=_react["default"].createElement,firstGAnimation=(0,_styledComponents.keyframes)(["0%{offset-distance:0%;animation-timing-function:cubic-bezier(0.42,0,1,1);}29%{offset-distance:41.812246%;animation-timing-function:cubic-bezier(0.42,0,1,1);}35%{offset-distance:47.935721%;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}50%{offset-distance:49.732245%;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}56%{offset-distance:57.442042%;animation-timing-function:cubic-bezier(0,0,0.58,1);}57%{offset-distance:59.105128%;}58%{offset-distance:60.655364%;}60%{offset-distance:63.226936%;animation-timing-function:cubic-bezier(0,0,0.58,1);}100%{offset-distance:100%;}"]),firstRectAnimation=(0,_styledComponents.keyframes)(["0%{width:19px;height:17px;}29%{width:19px;height:17px;animation-timing-function:cubic-bezier(0.42,0,1,1);}35%{width:23px;height:10px;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}50%{width:23px;height:8px;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}56%{width:19px;height:17px;}58%{width:15px;height:20px;}60%{width:15px;height:23px;animation-timing-function:cubic-bezier(0,0,0.58,1);}100%{width:19px;height:17px;}"]),secondGAnimation=(0,_styledComponents.keyframes)(["0%{offset-distance:0%;animation-timing-function:cubic-bezier( 0.326434,0.555852,0.685627,1 );}20%{offset-distance:11.596038%;animation-timing-function:cubic-bezier(0.42,0,1,1);}49%{offset-distance:53.408565%;animation-timing-function:cubic-bezier(0.42,0,1,1);}55%{offset-distance:59.532081%;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}70%{offset-distance:61.328616%;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}76%{offset-distance:69.038465%;animation-timing-function:cubic-bezier(0,0,0.58,1);}77%{offset-distance:70.701562%;}78%{offset-distance:72.251809%;}80%{offset-distance:74.823398%;animation-timing-function:cubic-bezier(0,0,0.454209,0.571919);}100%{offset-distance:100%;}"]),secondRectAnimation=(0,_styledComponents.keyframes)(["0%{width:17.738574px;height:18.89214px;animation-timing-function:cubic-bezier( 0.326434,0.555852,0.685627,1 );}20%{width:19px;height:17px;}49%{width:19px;height:17px;animation-timing-function:cubic-bezier(0.42,0,1,1);}55%{width:23px;height:10px;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}70%{width:23px;height:8px;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}76%{width:19px;height:17px;}78%{width:15px;height:20px;}80%{width:15px;height:23px;animation-timing-function:cubic-bezier(0,0,0.454209,0.571919);}100%{width:17.738574px;height:18.89214px;}"]),thirdGAnimation=(0,_styledComponents.keyframes)(["0%{offset-distance:0%;animation-timing-function:cubic-bezier( 0.342866,0.618673,0.682838,1 );}10%{offset-distance:3.436854%;animation-timing-function:cubic-bezier(0.42,0,1,1);}39%{offset-distance:45.249161%;animation-timing-function:cubic-bezier(0.42,0,1,1);}45%{offset-distance:51.372645%;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}60%{offset-distance:53.169171%;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}66%{offset-distance:60.87898%;animation-timing-function:cubic-bezier(0,0,0.58,1);}67%{offset-distance:62.542068%;}68%{offset-distance:64.092307%;}70%{offset-distance:66.663882%;animation-timing-function:cubic-bezier(0,0,0.508904,0.725912);}100%{offset-distance:100%;}"]),thirdRectAnimation=(0,_styledComponents.keyframes)(["0%{width:18.62614px;height:17.56079px;animation-timing-function:cubic-bezier( 0.342866,0.618673,0.682838,1 );}10%{width:19px;height:17px;}39%{width:19px;height:17px;animation-timing-function:cubic-bezier(0.42,0,1,1);}45%{width:23px;height:10px;animation-timing-function:cubic-bezier(0.55,0.055,0.675,0.19);}60%{width:23px;height:8px;animation-timing-function:cubic-bezier(0.975,0,0.745,0.715);}66%{width:19px;height:17px;}68%{width:15px;height:20px;}70%{width:15px;height:23px;animation-timing-function:cubic-bezier(0,0,0.508904,0.725912);}100%{width:18.62614px;height:17.56079px;}"]),StyledSvg=_styledComponents["default"].svg.withConfig({displayName:"LoadingBouncer__StyledSvg",componentId:"sc-fnaf9e-0"})(["g:first-of-type{offset-path:path( 'M44.5,41Q44.5,91,44.5,91C44.5,91,42.5,95.333333,42.5,98C42.5,98,42.5,97.333333,42.5,100Q42.5,100,44.5,91C44.5,91,45.473899,91.0738,45.473899,89.513051C45.473899,89.203109,46.5,88.403969,46.5,88C46.5,87.376595,46.5,85.644068,46.5,84.924858C46.5,74.678902,44.5,46.916312,44.5,41' );offset-rotate:0deg;animation:"," 1000ms linear infinite normal forwards;> rect{animation:"," 1000ms linear infinite normal forwards;}}g:nth-of-type(2){offset-path:path( 'M45.136063,54.851913Q44.782351,48.530072,44.5,41Q44.5,91,44.5,91C44.5,91,42.5,95.333333,42.5,98C42.5,98,42.5,97.333333,42.5,100Q42.5,100,44.5,91C44.5,91,45.473899,91.0738,45.473899,89.513051C45.473899,89.203109,46.5,88.403969,46.5,88C46.5,87.376595,46.5,85.644068,46.5,84.924858C46.5,78.52865,45.720582,65.306054,45.136063,54.851913' );offset-rotate:0deg;animation:"," 1000ms linear infinite normal forwards;> rect{animation:"," 1000ms linear infinite normal forwards;}}g:nth-of-type(3){offset-path:path( 'M44.626099,45.107826Q44.54661,43.315498,44.5,41Q44.5,91,44.5,91C44.5,91,42.5,95.333333,42.5,98C42.5,98,42.5,97.333333,42.5,100Q42.5,100,44.5,91C44.5,91,45.473899,91.0738,45.473899,89.513051C45.473899,89.203109,46.5,88.403969,46.5,88C46.5,87.376595,46.5,85.644068,46.5,84.924858C46.5,76.24305,45.06403,54.98456,44.626099,45.107826' );offset-rotate:0deg;animation:"," 1000ms linear infinite normal forwards;> rect{animation:"," 1000ms linear infinite normal forwards;}}"],firstGAnimation,firstRectAnimation,secondGAnimation,secondRectAnimation,thirdGAnimation,thirdRectAnimation),LoadingBouncer=function(a){var b=a.size,c=a.absolute,d=(0,_styledComponents.useTheme)(),e=d.color.indicator.incomplete;return __jsx(_AnimatedSvg["default"],{size:b,absolute:c},__jsx(StyledSvg,{xmlns:"http://www.w3.org/2000/svg",viewBox:"32 50 81 17.56","shape-rendering":"geometricPrecision","text-rendering":"geometricPrecision",height:"100%"},__jsx("g",null,__jsx("rect",{width:"19",height:"17",rx:"3",ry:"3",transform:"translate(-10,-17)",fill:e})),__jsx("g",null,__jsx("rect",{width:"17.738574",height:"18.89214",rx:"3",ry:"3",transform:"translate(50,-17)",fill:e})),__jsx("g",null,__jsx("rect",{width:"18.62614",height:"17.56079",rx:"3",ry:"3",transform:"translate(20,-17)",fill:e}))))};LoadingBouncer.defaultProps={size:void 0,absolute:!1};var _default=LoadingBouncer;exports["default"]=_default;