@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
47 lines (35 loc) • 1.36 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolvePulseAnimation = exports.resolveWidth = exports.resolveHeight = void 0;
var _styledComponents = require("styled-components");
var resolveHeight = function resolveHeight(_ref) {
var calculatedHeight = _ref.calculatedHeight,
height = _ref.height;
if (calculatedHeight) return "".concat(calculatedHeight, "px");
if (height) {
if (typeof height === "number") return "".concat(height, "px");
if (typeof height === "string") return height;
}
return "100%";
};
exports.resolveHeight = resolveHeight;
var resolveWidth = function resolveWidth(_ref2) {
var width = _ref2.width;
if (typeof width === "number") return "".concat(width, "px");
if (typeof width === "string") return width;
return "100%";
};
exports.resolveWidth = resolveWidth;
var pulseAnimation = (0, _styledComponents.keyframes)(["0%{opacity:1;}50%{opacity:0.5;}100%{opacity:1;}"]);
var resolvePulseAnimation = function resolvePulseAnimation(_ref3) {
var animate = _ref3.animate,
duration = _ref3.duration,
interval = _ref3.interval;
if (animate) {
return (0, _styledComponents.css)(["animation:", " ", " ease-in-out ", " infinite;"], pulseAnimation, duration, interval);
}
return null;
};
exports.resolvePulseAnimation = resolvePulseAnimation;