@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.
41 lines (31 loc) • 1.24 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.resolvePulseAnimation = exports.resolveHeight = exports.resolveValue = void 0;
var _styledComponents = require("styled-components");
var resolveValue = function resolveValue(value) {
if (typeof value === "string") return value;
if (typeof value === "number") return "".concat(value, "px");
return "100%";
};
exports.resolveValue = resolveValue;
var resolveHeight = function resolveHeight(_ref) {
var calculatedHeight = _ref.calculatedHeight,
height = _ref.height;
if (calculatedHeight) return "".concat(calculatedHeight, "px");
if (height) return resolveValue(height);
return "100%";
};
exports.resolveHeight = resolveHeight;
var pulseAnimation = (0, _styledComponents.keyframes)(["0%{opacity:1;}50%{opacity:0.5;}100%{opacity:1;}"]);
var resolvePulseAnimation = function resolvePulseAnimation(_ref2) {
var animate = _ref2.animate,
duration = _ref2.duration,
interval = _ref2.interval;
if (animate) {
return (0, _styledComponents.css)(["animation:", " ", " ease-in-out ", " infinite;"], pulseAnimation, duration, interval);
}
return null;
};
exports.resolvePulseAnimation = resolvePulseAnimation;