UNPKG

@infinityfx/lively

Version:

Feature complete, lightweight react animation library.

4 lines (3 loc) 577 B
"use client"; import{jsx as r,Fragment as t}from"react/jsx-runtime";import{Children as i,isValidElement as e,cloneElement as n}from"react";import a from"./animatable.js";function o({children:o,animations:p=[{translate:["0px 16px","0px 0px"],opacity:[0,1],duration:.35}],levels:l=2,...m}){return r(t,{children:function t(o,c=l){let s,u=l-c;for(;!(s=p[u])&&u>=0;)u--;return c<1||i.count(o)<1?o:r(a,{...m,animate:s,inherit:c<l||m.inherit,children:i.map(o,(r=>e(r)?n(r,{},t(r.props.children,c-1)):r))})}(o)})}o.isLively=!0;export{o as default}; //# sourceMappingURL=animate.js.map