@progress/kendo-react-animation
Version:
React Animation component assists with animating HTML elements. KendoReact Animation package
51 lines (50 loc) • 1.66 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import * as t from "react";
import e from "prop-types";
import { useUnstyled as R, classNames as q, uAnimation as C } from "@progress/kendo-react-common";
import { AnimationChild as b } from "./AnimationChild.mjs";
import { TransitionGroup as A } from "react-transition-group";
const g = (i) => {
const {
id: o,
style: r,
children: s,
component: a = "div",
className: l,
childFactory: c,
stackChildren: x,
componentChildStyle: m,
componentChildClassName: d,
...p
} = i, u = R(), n = i.unstyled || u, y = n && n.uAnimation, h = {
id: o,
style: r,
component: a,
childFactory: c,
className: q(C.child({ c: y }), l)
}, f = t.Children.map(s || null, (N) => /* @__PURE__ */ t.createElement(b, { ...p, unstyled: n, style: m, className: d }, N));
return /* @__PURE__ */ t.createElement(A, { ...h }, f);
};
g.propTypes = {
children: e.oneOfType([e.arrayOf(e.node), e.node]),
childFactory: e.any,
className: e.string,
component: e.string,
id: e.string,
style: e.any,
transitionName: e.string.isRequired,
appear: e.bool.isRequired,
enter: e.bool.isRequired,
exit: e.bool.isRequired,
transitionEnterDuration: e.number.isRequired,
transitionExitDuration: e.number.isRequired
};
export {
g as Animation
};