react-loadingg
Version:
A React component library.
90 lines (71 loc) • 4.54 kB
JavaScript
;
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _style = require("../utils/style");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _templateObject2() {
var data = _taggedTemplateLiteral(["\n height: ", ";\n width: ", ";\n border: 1px ", " solid;\n border-radius: 0px 0px 5px 5px;\n position: relative;\n &::after {\n content: '';\n width: 5px;\n height: 12px;\n position: absolute;\n border: 1px solid ", ";\n border-left: none;\n border-radius: 0px ", " ", " 0px;\n top: 4px;\n left: ", ";\n }\n &::before {\n content: '';\n width: 1px;\n height: 6px;\n position: absolute;\n background-color: ", ";\n top: -10px;\n left: ", "px;\n box-shadow: 5px 0px 0px 0px ", ", 5px -5px 0px 0px ", ", 10px 0px 0px 0px ", ";\n animation: ", " ", "s linear infinite alternate;\n }\n"]);
_templateObject2 = function _templateObject2() {
return data;
};
return data;
}
function _templateObject() {
var data = _taggedTemplateLiteral(["\n 0%{\n height: 0px;\n },\n 100%{\n height: 6px;\n }\n"]);
_templateObject = function _templateObject() {
return data;
};
return data;
}
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var changeSharp = (0, _styledComponents.keyframes)(_templateObject());
var LoadContainer = _styledComponents.default.div(_templateObject2(), function (props) {
return _style.sizeContainer[props.size] || _style.sizeContainer['default'];
}, function (props) {
return _style.sizeContainer[props.size] || _style.sizeContainer['default'];
}, function (props) {
return props.color || '#00adb5';
}, function (props) {
return props.color || '#00adb5';
}, function (props) {
return _style.sizeContainer[props.size] || _style.sizeContainer['default'];
}, function (props) {
return _style.sizeContainer[props.size] || _style.sizeContainer['default'];
}, function (props) {
return _style.sizeContainer[props.size] || _style.sizeContainer['default'];
}, function (props) {
return props.color || '#00adb5';
}, function (props) {
return props.size === 'small' ? 6 : props.size === 'large' ? 12 : 8;
}, function (props) {
return props.color || '#00adb5';
}, function (props) {
return props.color || '#00adb5';
}, function (props) {
return props.color || '#00adb5';
}, changeSharp, function (props) {
return props.speed || 1;
});
var CoffeeLoading = function CoffeeLoading(_ref) {
var _ref$style = _ref.style,
style = _ref$style === void 0 ? _style.commonStyle : _ref$style,
color = _ref.color,
_ref$size = _ref.size,
size = _ref$size === void 0 ? 'default' : _ref$size,
speed = _ref.speed;
return _react.default.createElement(LoadContainer, {
style: style,
color: color,
size: size,
speed: speed
});
};
var _default = CoffeeLoading;
exports.default = _default;