baby-i-am-faded
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,11 +0,3 @@ | ||
/** @jsx jsx */ | ||
import { Keyframes } from '@emotion/serialize'; | ||
import React from 'react'; | ||
import { Keyframes } from '@emotion/serialize'; | ||
export declare function getAnimationCss({ duration, delay, timingFunction, keyframes, iterationCount, }: { | ||
duration?: number; | ||
delay?: number; | ||
timingFunction?: string; | ||
keyframes?: Keyframes; | ||
iterationCount?: number; | ||
}): import("@emotion/utils").SerializedStyles; | ||
export declare type FadedProps = { | ||
@@ -21,1 +13,8 @@ cascade?: boolean; | ||
export declare const Faded: React.ForwardRefExoticComponent<FadedProps & React.RefAttributes<unknown>>; | ||
export declare function getAnimationCss({ duration, delay, timingFunction, keyframes, iterationCount, }: { | ||
duration?: number; | ||
delay?: number; | ||
timingFunction?: string; | ||
keyframes?: Keyframes; | ||
iterationCount?: number; | ||
}): import("@emotion/utils").SerializedStyles; |
@@ -28,25 +28,21 @@ "use strict"; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; | ||
result["default"] = mod; | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** @jsx jsx */ | ||
var react_1 = __importDefault(require("react")); | ||
var core_1 = require("@emotion/core"); | ||
var react_1 = __importStar(require("react")); | ||
var react_intersection_observer_1 = require("react-intersection-observer"); | ||
var react_is_1 = require("react-is"); | ||
var react_intersection_observer_1 = require("react-intersection-observer"); | ||
var core_1 = require("@emotion/core"); | ||
var react_2 = require("react"); | ||
var index_1 = require("./animations/index"); | ||
function getAnimationCss(_a) { | ||
var _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.timingFunction, timingFunction = _d === void 0 ? 'ease' : _d, _e = _a.keyframes, keyframes = _e === void 0 ? index_1.fadeInUp : _e, _f = _a.iterationCount, iterationCount = _f === void 0 ? 1 : _f; | ||
return core_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "], ["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "])), duration, timingFunction, delay, keyframes, iterationCount); | ||
} | ||
exports.getAnimationCss = getAnimationCss; | ||
var cloneElement = function (element, props) { | ||
return core_1.jsx(element.type, __assign(__assign({ key: element.key, ref: element.ref }, element.props), props)); | ||
}; | ||
exports.Faded = react_2.forwardRef(function (_a, ref1) { | ||
var support_1 = require("./support"); | ||
exports.Faded = react_1.forwardRef(function (_a, ref1) { | ||
var _b = _a.cascade, cascade = _b === void 0 ? true : _b, _c = _a.damping, damping = _c === void 0 ? 0.3 : _c, _d = _a.duration, duration = _d === void 0 ? 600 : _d, _e = _a.threshold, threshold = _e === void 0 ? 0.3 : _e, _f = _a.triggerOnce, triggerOnce = _f === void 0 ? true : _f, _g = _a.animation, animation = _g === void 0 ? index_1.fadeInUp : _g, children = _a.children, rest = __rest(_a, ["cascade", "damping", "duration", "threshold", "triggerOnce", "animation", "children"]); | ||
var _h = react_intersection_observer_1.useInView({ threshold: threshold, triggerOnce: triggerOnce }), ref = _h[0], inView = _h[1]; | ||
var combinedRef = useCombinedRefs(ref, ref1); | ||
var combinedRef = support_1.useCombinedRefs(ref, ref1); | ||
function makeAnimated(nodes) { | ||
@@ -77,3 +73,3 @@ if (!nodes) { | ||
} | ||
return cloneElement(childElement, { | ||
return support_1.cloneElement(childElement, { | ||
css: css, | ||
@@ -85,22 +81,7 @@ }); | ||
}); | ||
function useCombinedRefs() { | ||
var refs = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
refs[_i] = arguments[_i]; | ||
} | ||
var targetRef = react_1.default.useRef(); | ||
react_1.default.useEffect(function () { | ||
refs.forEach(function (ref) { | ||
if (!ref) | ||
return; | ||
if (typeof ref === 'function') { | ||
ref(targetRef.current); | ||
} | ||
else { | ||
ref.current = targetRef.current; | ||
} | ||
}); | ||
}, [refs]); | ||
return targetRef; | ||
function getAnimationCss(_a) { | ||
var _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.timingFunction, timingFunction = _d === void 0 ? 'ease' : _d, _e = _a.keyframes, keyframes = _e === void 0 ? index_1.fadeInUp : _e, _f = _a.iterationCount, iterationCount = _f === void 0 ? 1 : _f; | ||
return core_1.css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "], ["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "])), duration, timingFunction, delay, keyframes, iterationCount); | ||
} | ||
exports.getAnimationCss = getAnimationCss; | ||
var templateObject_1; |
@@ -1,11 +0,3 @@ | ||
/** @jsx jsx */ | ||
import { Keyframes } from '@emotion/serialize'; | ||
import React from 'react'; | ||
import { Keyframes } from '@emotion/serialize'; | ||
export declare function getAnimationCss({ duration, delay, timingFunction, keyframes, iterationCount, }: { | ||
duration?: number; | ||
delay?: number; | ||
timingFunction?: string; | ||
keyframes?: Keyframes; | ||
iterationCount?: number; | ||
}): import("@emotion/utils").SerializedStyles; | ||
export declare type FadedProps = { | ||
@@ -21,1 +13,8 @@ cascade?: boolean; | ||
export declare const Faded: React.ForwardRefExoticComponent<FadedProps & React.RefAttributes<unknown>>; | ||
export declare function getAnimationCss({ duration, delay, timingFunction, keyframes, iterationCount, }: { | ||
duration?: number; | ||
delay?: number; | ||
timingFunction?: string; | ||
keyframes?: Keyframes; | ||
iterationCount?: number; | ||
}): import("@emotion/utils").SerializedStyles; |
@@ -28,15 +28,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) { | ||
/** @jsx jsx */ | ||
import React from 'react'; | ||
import { css, jsx } from '@emotion/core'; | ||
import React, { forwardRef } from 'react'; | ||
import { useInView } from 'react-intersection-observer'; | ||
import { isFragment } from 'react-is'; | ||
import { useInView } from 'react-intersection-observer'; | ||
import { jsx, css } from '@emotion/core'; | ||
import { forwardRef } from 'react'; | ||
import { fadeInUp } from './animations/index'; | ||
export function getAnimationCss(_a) { | ||
var _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.timingFunction, timingFunction = _d === void 0 ? 'ease' : _d, _e = _a.keyframes, keyframes = _e === void 0 ? fadeInUp : _e, _f = _a.iterationCount, iterationCount = _f === void 0 ? 1 : _f; | ||
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "], ["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "])), duration, timingFunction, delay, keyframes, iterationCount); | ||
} | ||
var cloneElement = function (element, props) { | ||
return jsx(element.type, __assign(__assign({ key: element.key, ref: element.ref }, element.props), props)); | ||
}; | ||
import { useCombinedRefs, cloneElement } from './support'; | ||
export var Faded = forwardRef(function (_a, ref1) { | ||
@@ -78,22 +71,6 @@ var _b = _a.cascade, cascade = _b === void 0 ? true : _b, _c = _a.damping, damping = _c === void 0 ? 0.3 : _c, _d = _a.duration, duration = _d === void 0 ? 600 : _d, _e = _a.threshold, threshold = _e === void 0 ? 0.3 : _e, _f = _a.triggerOnce, triggerOnce = _f === void 0 ? true : _f, _g = _a.animation, animation = _g === void 0 ? fadeInUp : _g, children = _a.children, rest = __rest(_a, ["cascade", "damping", "duration", "threshold", "triggerOnce", "animation", "children"]); | ||
}); | ||
function useCombinedRefs() { | ||
var refs = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
refs[_i] = arguments[_i]; | ||
} | ||
var targetRef = React.useRef(); | ||
React.useEffect(function () { | ||
refs.forEach(function (ref) { | ||
if (!ref) | ||
return; | ||
if (typeof ref === 'function') { | ||
ref(targetRef.current); | ||
} | ||
else { | ||
ref.current = targetRef.current; | ||
} | ||
}); | ||
}, [refs]); | ||
return targetRef; | ||
export function getAnimationCss(_a) { | ||
var _b = _a.duration, duration = _b === void 0 ? 1000 : _b, _c = _a.delay, delay = _c === void 0 ? 0 : _c, _d = _a.timingFunction, timingFunction = _d === void 0 ? 'ease' : _d, _e = _a.keyframes, keyframes = _e === void 0 ? fadeInUp : _e, _f = _a.iterationCount, iterationCount = _f === void 0 ? 1 : _f; | ||
return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "], ["\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n animation-delay: ", "ms;\n animation-name: ", ";\n animation-direction: normal;\n animation-fill-mode: both;\n animation-iteration-count: ", ";\n "])), duration, timingFunction, delay, keyframes, iterationCount); | ||
} | ||
var templateObject_1; |
{ | ||
"name": "baby-i-am-faded", | ||
"_": "[bump if baby-i-am-faded]", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "", | ||
@@ -6,0 +6,0 @@ "main": "dist/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202170
330
5030