@progress/kendo-react-animation 10.2.0-develop.1 → 10.2.0-develop.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("react-transition-group")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","react-transition-group"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactAnimation={},t.React,t.PropTypes,t.KendoReactCommon,t.ReactTransitionGroup)}(this,(function(t,n,e,i,r){"use strict";function a(t){var n=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),n.default=t,Object.freeze(n)}var o=a(n);const s=o.forwardRef(((t,n)=>{const e=o.useRef(null),{mountOnEnter:a=c.mountOnEnter,unmountOnExit:s=c.unmountOnExit,onEnter:l=c.onEnter,onEntering:u=c.onEntering,onEntered:d=c.onEntered,onExit:m=c.onExit,onExiting:p=c.onExiting,onExited:E=c.onExited,onAfterExited:x=c.onAfterExited,animationEnteringStyle:y=c.animationEnteringStyle,animationEnteredStyle:f=c.animationEnteredStyle,animationExitingStyle:g=c.animationExitingStyle,animationExitedStyle:h=c.animationExitedStyle,children:D,style:N,appear:O,enter:v,exit:S,transitionName:b,transitionEnterDuration:A,transitionExitDuration:C,className:R,unstyled:T,...w}=t,F={transitionDelay:"0ms",...N},k=T&&T.uAnimation,q=i.classNames(R,i.uAnimation.childContainer({c:k})),j=o.useRef({element:e.current,props:t}),$=o.useRef(null);o.useImperativeHandle($,(()=>({element:e.current,props:t}))),o.useImperativeHandle(n,(()=>$.current),[]);const H={entering:{transitionDuration:`${A}ms`,...y},entered:{...f},exiting:{transitionDuration:`${C}ms`,...g},exited:{...h}},W={in:t.in,appear:O,enter:v,exit:S,mountOnEnter:a,unmountOnExit:s,timeout:{enter:A,exit:C},onEnter:()=>{l&&l.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntering:()=>{u&&u.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntered:()=>{d&&d.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExit:()=>{m&&m.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExiting:()=>{p&&p.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExited:()=>{x&&x.call(void 0,{animatedElement:e.current,target:$.current||j.current}),E&&E.call(void 0,{animatedElement:e.current,target:$.current||j.current})},classNames:{appear:i.classNames(i.uAnimation.appear({c:k,transitionName:b})),appearActive:i.classNames(i.uAnimation.appearActive({c:k,transitionName:b})),enter:i.classNames(i.uAnimation.enter({c:k,transitionName:b})),enterActive:i.classNames(i.uAnimation.enterActive({c:k,transitionName:b})),exit:i.classNames(i.uAnimation.exit({c:k,transitionName:b})),exitActive:i.classNames(i.uAnimation.exitActive({c:k,transitionName:b}))}};return o.createElement(r.CSSTransition,{...W,...w,nodeRef:e},(t=>o.createElement("div",{style:{...F,...H[t]},className:q,ref:t=>{e.current=t,j.current.element=t}},D)))})),c={mountOnEnter:!0,unmountOnExit:!1,onEnter:i.noop,onEntering:i.noop,onEntered:i.noop,onExit:i.noop,onExiting:i.noop,onExited:i.noop,onAfterExited:i.noop,animationEnteringStyle:{},animationEnteredStyle:{},animationExitingStyle:{},animationExitedStyle:{}};s.displayName="KendoReactAnimationChild",s.propTypes={in:e.bool,children:e.oneOfType([e.arrayOf(e.node),e.node]),transitionName:e.string.isRequired,className:e.string,appear:e.bool,enter:e.bool,exit:e.bool,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired,mountOnEnter:e.bool,unmountOnExit:e.bool,animationEnteringStyle:e.object,animationEnteredStyle:e.object,animationExitingStyle:e.object,animationExitedStyle:e.object};const l=t=>{const{id:n,style:e,children:a,component:c="div",className:l,childFactory:u,stackChildren:d,componentChildStyle:m,componentChildClassName:p,...E}=t,x=i.useUnstyled(),y=t.unstyled||x,f=y&&y.uAnimation,g={id:n,style:e,component:c,childFactory:u,className:i.classNames(i.uAnimation.child({c:f}),l)},h=o.Children.map(a||null,(t=>o.createElement(s,{...E,unstyled:y,style:m,className:p},t)));return o.createElement(r.TransitionGroup,{...g},h)};l.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};const u=t=>{const{appear:n=d.appear,enter:e=d.enter,exit:i=d.exit,transitionEnterDuration:r=d.transitionEnterDuration,transitionExitDuration:a=d.transitionExitDuration,children:s,...c}=t;return o.createElement(l,{transitionName:"fade",appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...c},s)},d={appear:!1,enter:!0,exit:!1,transitionEnterDuration:500,transitionExitDuration:500};u.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};const m=t=>{const{appear:n=p.appear,enter:e=p.enter,exit:i=p.exit,transitionEnterDuration:r=p.transitionEnterDuration,transitionExitDuration:a=p.transitionExitDuration,direction:s=p.direction,children:c,...u}=t,d={transitionName:`expand-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},p={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};m.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};const E={position:"absolute",top:"0",left:"0"},x=t=>{const{appear:n=y.appear,enter:e=y.enter,exit:i=y.exit,transitionEnterDuration:r=y.transitionEnterDuration,transitionExitDuration:a=y.transitionExitDuration,stackChildren:s=y.stackChildren,direction:c=y.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`push-${c}`,animationExitingStyle:t.stackChildren?E:void 0},u)},y={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"right",stackChildren:!1};x.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const f=t=>{const{appear:n=g.appear,enter:e=g.enter,exit:i=g.exit,transitionEnterDuration:r=g.transitionEnterDuration,transitionExitDuration:a=g.transitionExitDuration,direction:s=g.direction,children:c,...u}=t,d={transitionName:`slide-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},g={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"down"};f.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any};const h={position:"absolute",top:"0",left:"0"},D=t=>{const{appear:n=N.appear,enter:e=N.enter,exit:i=N.exit,transitionEnterDuration:r=N.transitionEnterDuration,transitionExitDuration:a=N.transitionExitDuration,stackChildren:s=N.stackChildren,direction:c=N.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`zoom-${c}`,animationExitingStyle:t.stackChildren?h:void 0},u)},N={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"out",stackChildren:!1};D.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["in","out"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const O=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginTop),i=parseFloat(n.marginBottom);return t.offsetHeight+e+i},v=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginLeft),i=parseFloat(n.marginRight);return t.offsetWidth+e+i},S=(i.animationStyles,t=>{const[n,e]=o.useState(),[i,r]=o.useState(),[a,s]=o.useState({}),{appear:c=b.appear,enter:u=b.enter,exit:d=b.exit,transitionEnterDuration:m=b.transitionEnterDuration,transitionExitDuration:p=b.transitionExitDuration,direction:E=b.direction,children:x,childFactory:y,...f}=t;let g;g="vertical"===E?{maxHeight:n?`${n}px`:""}:{maxWidth:i?`${i}px`:""};const h={maxHeight:g.maxHeight,maxWidth:g.maxWidth};o.useEffect((()=>{t&&a.name&&t[a.name]&&t[a.name].call(void 0,a.event)}),[n,i,a]);const D=(t,n)=>{const i=t.animatedElement.firstChild;if(i){const a=O(i),o=v(i);e(a),r(o),s({name:n,event:t})}};return o.createElement(l,{...f,appear:c,enter:u,exit:d,transitionEnterDuration:m,transitionExitDuration:p,childFactory:t=>{const n=y?y(t):t;return n.props.in?n:o.cloneElement(n,{...n.props,style:{...n.props.style,maxHeight:g.maxHeight,maxWidth:g.maxWidth}})},onEnter:n=>{const{onBeforeEnter:e}=t;e&&e.call(void 0,n),D(n,"onEnter")},onEntering:t=>{D(t,"onEntering")},onExit:t=>{D(t,"onExit")},animationEnteringStyle:h,transitionName:`reveal-${E}`},x)}),b={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};S.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};t.Animation=l,t.AnimationChild=s,t.Expand=m,t.Fade=u,t.Push=x,t.Reveal=S,t.Slide=f,t.Zoom=D,t.useAnimation=(t,n)=>{const e=o.useRef(0),i=o.useRef(!1),r=o.useRef();o.useEffect((()=>((t=>{const n=t.duration;let i,a;const o=e.current&&1-e.current;t.onStart&&t.onStart();const s=c=>{i||(i=c),a=c-i+1;const l=a/n+o;l<=1?(t.onUpdate&&t.onUpdate(l),r.current=window.requestAnimationFrame(s),e.current=l):(t.onEnd&&t.onEnd(1),e.current=0)};r.current=window.requestAnimationFrame(s)})(t),()=>{r.current&&window.cancelAnimationFrame(r.current)})),n),o.useEffect((()=>{i.current=!0}),[])}}));
15
+ !function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react"),require("prop-types"),require("@progress/kendo-react-common"),require("react-transition-group")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","@progress/kendo-react-common","react-transition-group"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).KendoReactAnimation={},t.React,t.PropTypes,t.KendoReactCommon,t.ReactTransitionGroup)}(this,(function(t,n,e,i,r){"use strict";function a(t){var n=Object.create(null);return t&&Object.keys(t).forEach((function(e){if("default"!==e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}})),n.default=t,Object.freeze(n)}var o=a(n);const s=o.forwardRef(((t,n)=>{const e=o.useRef(null),{mountOnEnter:a=c.mountOnEnter,unmountOnExit:s=c.unmountOnExit,onEnter:l=c.onEnter,onEntering:u=c.onEntering,onEntered:d=c.onEntered,onExit:m=c.onExit,onExiting:p=c.onExiting,onExited:E=c.onExited,onAfterExited:x=c.onAfterExited,animationEnteringStyle:y=c.animationEnteringStyle,animationEnteredStyle:f=c.animationEnteredStyle,animationExitingStyle:g=c.animationExitingStyle,animationExitedStyle:h=c.animationExitedStyle,children:D,style:N,appear:O,enter:v,exit:S,transitionName:b,transitionEnterDuration:A,transitionExitDuration:C,className:R,unstyled:T,...w}=t,F={transitionDelay:"0ms",...N},k=T&&T.uAnimation,q=i.classNames(R,i.uAnimation.childContainer({c:k})),j=o.useRef({element:e.current,props:t}),$=o.useRef(null);o.useImperativeHandle($,(()=>({element:e.current,props:t}))),o.useImperativeHandle(n,(()=>$.current),[]);const H={entering:{transitionDuration:`${A}ms`,...y},entered:{...f},exiting:{transitionDuration:`${C}ms`,...g},exited:{...h}},W={in:t.in,appear:O,enter:v,exit:S,mountOnEnter:a,unmountOnExit:s,timeout:{enter:A,exit:C},onEnter:()=>{l&&l.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntering:()=>{u&&u.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onEntered:()=>{d&&d.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExit:()=>{m&&m.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExiting:()=>{p&&p.call(void 0,{animatedElement:e.current,target:$.current||j.current})},onExited:()=>{x&&x.call(void 0,{animatedElement:e.current,target:$.current||j.current}),E&&E.call(void 0,{animatedElement:e.current,target:$.current||j.current})},classNames:{appear:i.classNames(i.uAnimation.appear({c:k,transitionName:b})),appearActive:i.classNames(i.uAnimation.appearActive({c:k,transitionName:b})),enter:i.classNames(i.uAnimation.enter({c:k,transitionName:b})),enterActive:i.classNames(i.uAnimation.enterActive({c:k,transitionName:b})),exit:i.classNames(i.uAnimation.exit({c:k,transitionName:b})),exitActive:i.classNames(i.uAnimation.exitActive({c:k,transitionName:b}))}};return o.createElement(r.CSSTransition,{...W,...w,nodeRef:e},(t=>o.createElement("div",{style:{...F,...H[t]},className:q,ref:t=>{e.current=t,j.current.element=t}},D)))})),c={mountOnEnter:!0,unmountOnExit:!1,onEnter:i.noop,onEntering:i.noop,onEntered:i.noop,onExit:i.noop,onExiting:i.noop,onExited:i.noop,onAfterExited:i.noop,animationEnteringStyle:{},animationEnteredStyle:{},animationExitingStyle:{},animationExitedStyle:{}};s.displayName="KendoReactAnimationChild",s.propTypes={in:e.bool,children:e.oneOfType([e.arrayOf(e.node),e.node]),transitionName:e.string.isRequired,className:e.string,appear:e.bool,enter:e.bool,exit:e.bool,transitionEnterDuration:e.number.isRequired,transitionExitDuration:e.number.isRequired,mountOnEnter:e.bool,unmountOnExit:e.bool,animationEnteringStyle:e.object,animationEnteredStyle:e.object,animationExitingStyle:e.object,animationExitedStyle:e.object};const l=t=>{const{id:n,style:e,children:a,component:c="div",className:l,childFactory:u,stackChildren:d,componentChildStyle:m,componentChildClassName:p,...E}=t,x=i.useUnstyled(),y=t.unstyled||x,f=y&&y.uAnimation,g={id:n,style:e,component:c,childFactory:u,className:i.classNames(i.uAnimation.child({c:f}),l)},h=o.Children.map(a||null,(t=>o.createElement(s,{...E,unstyled:y,style:m,className:p},t)));return o.createElement(r.TransitionGroup,{...g},h)};l.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};const u=t=>{const{appear:n=d.appear,enter:e=d.enter,exit:i=d.exit,transitionEnterDuration:r=d.transitionEnterDuration,transitionExitDuration:a=d.transitionExitDuration,children:s,...c}=t;return o.createElement(l,{transitionName:"fade",appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...c},s)},d={appear:!1,enter:!0,exit:!1,transitionEnterDuration:500,transitionExitDuration:500};u.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};const m=t=>{const{appear:n=p.appear,enter:e=p.enter,exit:i=p.exit,transitionEnterDuration:r=p.transitionEnterDuration,transitionExitDuration:a=p.transitionExitDuration,direction:s=p.direction,children:c,...u}=t,d={transitionName:`expand-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},p={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};m.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};const E={position:"absolute",top:"0",left:"0"},x=t=>{const{appear:n=y.appear,enter:e=y.enter,exit:i=y.exit,transitionEnterDuration:r=y.transitionEnterDuration,transitionExitDuration:a=y.transitionExitDuration,stackChildren:s=y.stackChildren,direction:c=y.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`push-${c}`,animationExitingStyle:t.stackChildren?E:void 0},u)},y={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"right",stackChildren:!1};x.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const f=t=>{const{appear:n=g.appear,enter:e=g.enter,exit:i=g.exit,transitionEnterDuration:r=g.transitionEnterDuration,transitionExitDuration:a=g.transitionExitDuration,direction:s=g.direction,children:c,...u}=t,d={transitionName:`slide-${s}`};return o.createElement(l,{...d,appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,...u},c)},g={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"down"};f.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["up","down","left","right"]),component:e.string,id:e.string,style:e.any};const h={position:"absolute",top:"0",left:"0"},D=t=>{const{appear:n=N.appear,enter:e=N.enter,exit:i=N.exit,transitionEnterDuration:r=N.transitionEnterDuration,transitionExitDuration:a=N.transitionExitDuration,stackChildren:s=N.stackChildren,direction:c=N.direction,children:u,...d}=t;return o.createElement(l,{appear:n,enter:e,exit:i,transitionEnterDuration:r,transitionExitDuration:a,stackChildren:s,...d,transitionName:`zoom-${c}`,animationExitingStyle:t.stackChildren?h:void 0},u)},N={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"out",stackChildren:!1};D.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["in","out"]),component:e.string,id:e.string,style:e.any,stackChildren:e.bool};const O=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginTop),i=parseFloat(n.marginBottom);return t.offsetHeight+e+i},v=t=>{if(!t||!t.ownerDocument.defaultView)return 0;const n=t.ownerDocument.defaultView.getComputedStyle(t),e=parseFloat(n.marginLeft),i=parseFloat(n.marginRight);return t.offsetWidth+e+i},S=(i.animationStyles,t=>{const[n,e]=o.useState(),[i,r]=o.useState(),[a,s]=o.useState({}),{appear:c=b.appear,enter:u=b.enter,exit:d=b.exit,transitionEnterDuration:m=b.transitionEnterDuration,transitionExitDuration:p=b.transitionExitDuration,direction:E=b.direction,children:x,childFactory:y,...f}=t;let g;g="vertical"===E?{maxHeight:n?`${n}px`:""}:{maxWidth:i?`${i}px`:""};const h={maxHeight:g.maxHeight,maxWidth:g.maxWidth};o.useEffect((()=>{t&&a.name&&t[a.name]&&t[a.name].call(void 0,a.event)}),[n,i,a]);const D=(t,n)=>{const i=t.animatedElement.firstChild;if(i){const a=O(i),o=v(i);e(a),r(o),s({name:n,event:t})}};return o.createElement(l,{...f,appear:c,enter:u,exit:d,transitionEnterDuration:m,transitionExitDuration:p,childFactory:t=>{const n=y?y(t):t;return n.props.in?n:o.cloneElement(n,{...n.props,style:{...n.props.style,maxHeight:g.maxHeight,maxWidth:g.maxWidth}})},onEnter:n=>{const{onBeforeEnter:e}=t;e&&e.call(void 0,n),D(n,"onEnter")},onEntering:t=>{D(t,"onEntering")},onExit:t=>{D(t,"onExit")},animationEnteringStyle:h,transitionName:`reveal-${E}`},x)}),b={appear:!1,enter:!0,exit:!0,transitionEnterDuration:300,transitionExitDuration:300,direction:"vertical"};S.propTypes={children:e.oneOfType([e.arrayOf(e.node),e.node]),childFactory:e.any,className:e.string,direction:e.oneOf(["horizontal","vertical"]),component:e.string,id:e.string,style:e.any};t.Animation=l,t.AnimationChild=s,t.Expand=m,t.Fade=u,t.Push=x,t.Reveal=S,t.Slide=f,t.Zoom=D,t.useAnimation=(t,n)=>{const e=o.useRef(0),i=o.useRef(!1),r=o.useRef(null);o.useEffect((()=>((t=>{const n=t.duration;let i,a;const o=e.current&&1-e.current;t.onStart&&t.onStart();const s=c=>{i||(i=c),a=c-i+1;const l=a/n+o;l<=1?(t.onUpdate&&t.onUpdate(l),r.current=window.requestAnimationFrame(s),e.current=l):(t.onEnd&&t.onEnd(1),e.current=0)};r.current=window.requestAnimationFrame(s)})(t),()=>{r.current&&window.cancelAnimationFrame(r.current)})),n),o.useEffect((()=>{i.current=!0}),[])}}));
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=g(b),w=(t,r)=>{const e=o.useRef(0),c=o.useRef(!1),u=o.useRef(),d=n=>{const m=n.duration;let a,f;const p=e.current&&1-e.current;n.onStart&&n.onStart();const i=l=>{a||(a=l),f=l-a+1;const s=f/m+p;s<=1?(n.onUpdate&&n.onUpdate(s),u.current=window.requestAnimationFrame(i),e.current=s):(n.onEnd&&n.onEnd(1),e.current=0)};u.current=window.requestAnimationFrame(i)};o.useEffect(()=>(d(t),()=>{u.current&&window.cancelAnimationFrame(u.current)}),r),o.useEffect(()=>{c.current=!0},[])};exports.useAnimation=w;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,c.get?c:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const o=g(b),w=(t,r)=>{const e=o.useRef(0),c=o.useRef(!1),u=o.useRef(null),d=n=>{const m=n.duration;let a,f;const p=e.current&&1-e.current;n.onStart&&n.onStart();const i=l=>{a||(a=l),f=l-a+1;const s=f/m+p;s<=1?(n.onUpdate&&n.onUpdate(s),u.current=window.requestAnimationFrame(i),e.current=s):(n.onEnd&&n.onEnd(1),e.current=0)};u.current=window.requestAnimationFrame(i)};o.useEffect(()=>(d(t),()=>{u.current&&window.cancelAnimationFrame(u.current)}),r),o.useEffect(()=>{c.current=!0},[])};exports.useAnimation=w;
@@ -5,23 +5,23 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import * as t from "react";
8
+ import * as n from "react";
9
9
  const p = (s, m) => {
10
- const n = t.useRef(0), i = t.useRef(!1), r = t.useRef(), d = (e) => {
11
- const w = e.duration;
10
+ const t = n.useRef(0), i = n.useRef(!1), r = n.useRef(null), d = (e) => {
11
+ const l = e.duration;
12
12
  let o, u;
13
- const l = n.current && 1 - n.current;
13
+ const w = t.current && 1 - t.current;
14
14
  e.onStart && e.onStart();
15
15
  const a = (f) => {
16
16
  o || (o = f), u = f - o + 1;
17
- const c = u / w + l;
18
- c <= 1 ? (e.onUpdate && e.onUpdate(c), r.current = window.requestAnimationFrame(a), n.current = c) : (e.onEnd && e.onEnd(1), n.current = 0);
17
+ const c = u / l + w;
18
+ c <= 1 ? (e.onUpdate && e.onUpdate(c), r.current = window.requestAnimationFrame(a), t.current = c) : (e.onEnd && e.onEnd(1), t.current = 0);
19
19
  };
20
20
  r.current = window.requestAnimationFrame(a);
21
21
  };
22
- t.useEffect(() => (d(s), () => {
22
+ n.useEffect(() => (d(s), () => {
23
23
  r.current && window.cancelAnimationFrame(r.current);
24
- }), m), t.useEffect(() => {
24
+ }), m), n.useEffect(() => {
25
25
  i.current = !0;
26
26
  }, []);
27
27
  };
package/index.d.mts CHANGED
@@ -7,11 +7,11 @@
7
7
  */
8
8
  import { AnimationsClassStructure } from '@progress/kendo-react-common';
9
9
  import { default as default_2 } from 'prop-types';
10
- import { JSX as JSX_2 } from 'react/jsx-runtime';
10
+ import { JSX } from 'react/jsx-runtime';
11
11
  import * as React_2 from 'react';
12
12
 
13
13
  declare const Animation_2: {
14
- (props: AnimationProps): JSX_2.Element;
14
+ (props: AnimationProps): JSX.Element;
15
15
  propTypes: {
16
16
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
17
17
  childFactory: default_2.Requireable<any>;
@@ -54,35 +54,61 @@ export declare interface AnimationChildProps extends AnimationInterface {
54
54
  */
55
55
  in?: boolean;
56
56
  /**
57
- * @hidden
57
+ * Custom inline styles to apply to the Animation container.
58
+ *
59
+ * @example
60
+ * <AnimationChild style={{ backgroundColor: "red" }} />
58
61
  */
59
62
  style?: any;
60
63
  /**
61
- * @hidden
64
+ * Custom CSS class to apply to the Animation container.
65
+ *
66
+ * @example
67
+ * <AnimationChild className="custom-animation-class" />
62
68
  */
63
69
  className?: string;
64
70
  /**
65
- * Specifies the transition class which will be applied on the appear, enter, and exit transition.
71
+ * Specifies the base class name for the transition. This class will be used
72
+ * to generate the `appear`, `enter`, and `exit` transition classes.
73
+ *
74
+ * @example
75
+ * <AnimationChild transitionName="fade" />
66
76
  */
67
77
  transitionName: string;
68
78
  /**
69
79
  * Specifies the style which will be applied when the Animation reaches its entering state.
80
+ *
81
+ * @example
82
+ * <AnimationChild animationEnteringStyle={{ opacity: 0.5 }} />
70
83
  */
71
84
  animationEnteringStyle?: any;
72
85
  /**
73
- * Specifies the style which will be applied when the Animation reaches its entered state.
86
+ * Inline styles applied when the Animation has entered.
87
+ *
88
+ * @example
89
+ * <AnimationChild animationEnteredStyle={{ opacity: 1 }} />
74
90
  */
75
91
  animationEnteredStyle?: any;
76
92
  /**
77
93
  * Specifies the style which will be applied when the Animation reaches its exiting state.
94
+ *
95
+ * @example
96
+ * <AnimationChild animationExitingStyle={{ opacity: 0.5 }} />
78
97
  */
79
98
  animationExitingStyle?: any;
80
99
  /**
81
- * Specifies the style which will be applied when the Animation reaches its exited state.
100
+ * Inline styles applied when the Animation has exited.
101
+ *
102
+ * @example
103
+ * <AnimationChild animationExitedStyle={{ opacity: 0 }} />
82
104
  */
83
105
  animationExitedStyle?: any;
84
106
  /**
85
- * The unstyled option classes.
107
+ * Provides unstyled options for the Animation. Accepts an object
108
+ * implementing the `AnimationsClassStructure` interface.
109
+ *
110
+ * @example
111
+ * <AnimationChild unstyled={{ appear: "custom-appear-class" }} />
86
112
  */
87
113
  unstyled?: AnimationsClassStructure;
88
114
  }
@@ -191,57 +217,93 @@ declare interface AnimationInterface {
191
217
  */
192
218
  export declare interface AnimationProps extends AnimationInterface {
193
219
  /**
194
- * When the element reaches its exit state, it is no longer available in the DOM ([see example]({% slug exitingchildcomponents_animation %})).
220
+ * A function for customizing the rendering of child elements.
221
+ *
222
+ * @example
223
+ * <Animation childFactory={(child) => React.cloneElement(child, { ariaHidden: true })} />
195
224
  */
196
225
  childFactory?: any;
197
226
  /**
198
- * Specifies the name of the CSS class which is set to the Animation.
227
+ * Specifies the CSS class names to be applied to the Animation container.
228
+ *
229
+ * @example
230
+ * <Animation className="animation-container" />
199
231
  */
200
232
  className?: string;
201
233
  /**
202
- * Specifies the node type of the parent Animation. Defaults to `div`.
234
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
235
+ *
236
+ * @example
237
+ * <Animation component="main" />
203
238
  */
204
239
  component?: string;
205
240
  /**
206
- * Specifies the id of the Animation.
241
+ * Specifies the `id` attribute of the Animation container.
242
+ *
243
+ * @example
244
+ * <Animation id="animation-container" />
207
245
  */
208
246
  id?: string;
209
247
  /**
210
- * Specifies the style of the parent Animation.
248
+ * Specifies the inline styles to be applied to the Animation container.
249
+ *
250
+ * @example
251
+ * <Animation style={{ width: "100%" }} />
211
252
  */
212
253
  style?: any;
213
254
  /**
214
- * Specifies whether the Animation children will stack on top of each other without interfering ([see example]({% slug stacked_animation %})).
255
+ * Determines whether child elements will stack on top of each other during the animation.
256
+ *
257
+ * @example
258
+ * <Animation stackChildren={true} />
215
259
  */
216
260
  stackChildren?: boolean;
217
261
  /**
218
- * Specifies the `classNames` which will be applied during the transition ([see example]({% slug customizing_animation %})).
262
+ * Specifies the base class name for the transition.
263
+ *
264
+ * @example
265
+ * <Animation transitionName="fade" />
219
266
  */
220
267
  transitionName: string;
221
268
  /**
222
- * Specifies the style which will be applied when the Animation reaches its entering state.
269
+ * Specifies the inline styles applied when the Animation is entering.
270
+ *
271
+ * @example
272
+ * <Animation animationEnteringStyle={{ opacity: 0.5 }} />
223
273
  */
224
274
  animationEnteringStyle?: any;
225
275
  /**
226
- * Specifies the style which will be applied when the Animation reaches its entered state.
276
+ * Specifies the inline styles applied when the Animation has entered.
277
+ *
278
+ * @example
279
+ * <Animation animationEnteredStyle={{ opacity: 1 }} />
227
280
  */
228
281
  animationEnteredStyle?: any;
229
282
  /**
230
- * Specifies the style which will be applied when the Animation reaches its exiting state.
283
+ * Specifies the inline styles applied when the Animation is exiting.
284
+ *
285
+ * @example
286
+ * <Animation animationExitingStyle={{ opacity: 0.5 }} />
231
287
  */
232
288
  animationExitingStyle?: any;
233
289
  /**
234
- * Specifies the style which will be applied when the Animation reaches its exited state.
290
+ * Specifies the inline styles applied when the Animation has exited.
291
+ *
292
+ * @example
293
+ * <Animation animationExitedStyle={{ opacity: 0 }} />
235
294
  */
236
295
  animationExitedStyle?: any;
237
296
  /**
238
- * The unstyled option classes.
297
+ * Provides unstyled options for the Animation.
298
+ *
299
+ * @example
300
+ * <Animation unstyled={{ appear: "unstyled-appear" }} />
239
301
  */
240
302
  unstyled?: AnimationsClassStructure;
241
303
  }
242
304
 
243
305
  export declare const Expand: {
244
- (props: ExpandProps): JSX_2.Element;
306
+ (props: ExpandProps): JSX.Element;
245
307
  propTypes: {
246
308
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
247
309
  childFactory: default_2.Requireable<any>;
@@ -274,33 +336,51 @@ export declare type ExpandDirection = 'horizontal' | 'vertical';
274
336
  */
275
337
  export declare interface ExpandProps extends AnimationInterface {
276
338
  /**
277
- * After the element reached its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
339
+ * A function for customizing the rendering of child elements.
340
+ *
341
+ * @example
342
+ * <Expand childFactory={(child) => React.cloneElement(child, { role: "button" })} />
278
343
  */
279
344
  childFactory?: any;
280
345
  /**
281
- * Specifies the CSS class names which are set to the Animation.
346
+ * Specifies the CSS class names to be applied to the Animation container.
347
+ *
348
+ * @example
349
+ * <Expand className="expand-animation" />
282
350
  */
283
351
  className?: string;
284
352
  /**
285
353
  * Specifies the direction of the Expand Animation. Defaults to `vertical`.
354
+ *
355
+ * @example
356
+ * <Expand direction="horizontal" />
286
357
  */
287
358
  direction?: ExpandDirection;
288
359
  /**
289
- * Specifies the node type of the parent Animation. Defaults to `div`.
360
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
361
+ *
362
+ * @example
363
+ * <Expand component="nav" />
290
364
  */
291
365
  component?: string;
292
366
  /**
293
- * Specifies the id of the Animation.
367
+ * Specifies the `id` attribute of the Animation container.
368
+ *
369
+ * @example
370
+ * <Expand id="expand-animation-container" />
294
371
  */
295
372
  id?: string;
296
373
  /**
297
- * Specifies the style of the parent Animation.
374
+ * Specifies the inline styles to be applied to the Animation container.
375
+ *
376
+ * @example
377
+ * <Expand style={{ display: "flex" }} />
298
378
  */
299
379
  style?: any;
300
380
  }
301
381
 
302
382
  export declare const Fade: {
303
- (props: FadeProps): JSX_2.Element;
383
+ (props: FadeProps): JSX.Element;
304
384
  propTypes: {
305
385
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
306
386
  childFactory: default_2.Requireable<any>;
@@ -323,29 +403,44 @@ export declare const Fade: {
323
403
  */
324
404
  export declare interface FadeProps extends AnimationInterface {
325
405
  /**
326
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
406
+ * A function for customizing the rendering of child elements.
407
+ *
408
+ * @example
409
+ * <Fade childFactory={(child) => React.cloneElement(child, { draggable: true })} />
327
410
  */
328
411
  childFactory?: any;
329
412
  /**
330
- * Specifies CSS class names which are set to the Animation.
413
+ * Specifies the CSS class names to be applied to the Animation container.
414
+ *
415
+ * @example
416
+ * <Fade className="fade-animation" />
331
417
  */
332
418
  className?: string;
333
419
  /**
334
- * Specifies the node type of the parent Animation. Defaults to `div`.
420
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
421
+ *
422
+ * @example
423
+ * <Fade component="header" />
335
424
  */
336
425
  component?: string;
337
426
  /**
338
- * Specifies the id of the Animation.
427
+ * Specifies the `id` attribute of the Animation container.
428
+ *
429
+ * @example
430
+ * <Fade id="fade-animation-container" />
339
431
  */
340
432
  id?: string;
341
433
  /**
342
- * Specifies the style of the parent Animation.
434
+ * Specifies the inline styles to be applied to the Animation container.
435
+ *
436
+ * @example
437
+ * <Fade style={{ color: "blue" }} />
343
438
  */
344
439
  style?: any;
345
440
  }
346
441
 
347
442
  export declare const Push: {
348
- (props: PushProps): JSX_2.Element;
443
+ (props: PushProps): JSX.Element;
349
444
  propTypes: {
350
445
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
351
446
  childFactory: default_2.Requireable<any>;
@@ -381,37 +476,58 @@ export declare type PushDirection = 'up' | 'down' | 'left' | 'right';
381
476
  */
382
477
  export declare interface PushProps extends AnimationInterface {
383
478
  /**
384
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
479
+ * A function for customizing the rendering of child elements.
480
+ *
481
+ * @example
482
+ * <Push childFactory={(child) => React.cloneElement(child, { tabIndex: 0 })} />
385
483
  */
386
484
  childFactory?: any;
387
485
  /**
388
- * Specifies the CSS class names which are set to the Animation.
486
+ * Specifies the CSS class names to be applied to the Animation container.
487
+ *
488
+ * @example
489
+ * <Push className="push-animation" />
389
490
  */
390
491
  className?: string;
391
492
  /**
392
- * Specifies the direction of the Push Animation. Defaults to `out`.
493
+ * Specifies the direction of the Push Animation. Defaults to `right`.
494
+ *
495
+ * @example
496
+ * <Push direction="up" />
393
497
  */
394
498
  direction?: PushDirection;
395
499
  /**
396
- * Specifies the node type of the parent Animation. Defaults to `div`.
500
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
501
+ *
502
+ * @example
503
+ * <Push component="footer" />
397
504
  */
398
505
  component?: string;
399
506
  /**
400
- * Specifies the id of the Animation.
507
+ * Specifies the `id` attribute of the Animation container.
508
+ *
509
+ * @example
510
+ * <Push id="push-animation-container" />
401
511
  */
402
512
  id?: string;
403
513
  /**
404
- * Specifies the style of the parent Animation.
514
+ * Specifies the inline styles to be applied to the Animation container.
515
+ *
516
+ * @example
517
+ * <Push style={{ border: "1px solid black" }} />
405
518
  */
406
519
  style?: any;
407
520
  /**
408
- * Specifies whether the child elements will stack on top of each other without interfering ([more information and examples]({% slug stacked_animation %})).
521
+ * Determines whether child elements will stack on top of each other during the animation. Defaults to `false`.
522
+ *
523
+ * @example
524
+ * <Push stackChildren={true} />
409
525
  */
410
526
  stackChildren?: boolean;
411
527
  }
412
528
 
413
529
  export declare const Reveal: {
414
- (props: RevealProps): JSX_2.Element;
530
+ (props: RevealProps): JSX.Element;
415
531
  propTypes: {
416
532
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
417
533
  childFactory: default_2.Requireable<any>;
@@ -444,27 +560,45 @@ export declare type RevealDirection = 'horizontal' | 'vertical';
444
560
  */
445
561
  export declare interface RevealProps extends AnimationInterface {
446
562
  /**
447
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
563
+ * A function for customizing the rendering of child elements.
564
+ *
565
+ * @example
566
+ * <Reveal childFactory={(child) => React.cloneElement(child, { hidden: true })} />
448
567
  */
449
568
  childFactory?: any;
450
569
  /**
451
- * Specifies the CSS class names which are set to the Animation.
570
+ * Specifies the CSS class names to be applied to the Animation container.
571
+ *
572
+ * @example
573
+ * <Reveal className="reveal-animation" />
452
574
  */
453
575
  className?: string;
454
576
  /**
455
577
  * Specifies the direction of the Reveal Animation. Defaults to `vertical`.
578
+ *
579
+ * @example
580
+ * <Reveal direction="horizontal" />
456
581
  */
457
582
  direction?: RevealDirection;
458
583
  /**
459
- * Specifies the node type of the parent Animation. Defaults to `div`.
584
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
585
+ *
586
+ * @example
587
+ * <Reveal component="aside" />
460
588
  */
461
589
  component?: string;
462
590
  /**
463
- * Specifies the id of the Animation.
591
+ * Specifies the `id` attribute of the Animation container.
592
+ *
593
+ * @example
594
+ * <Reveal id="reveal-animation-container" />
464
595
  */
465
596
  id?: string;
466
597
  /**
467
- * Specifies the style of the parent Animation.
598
+ * Specifies the inline styles to be applied to the Animation container.
599
+ *
600
+ * @example
601
+ * <Reveal style={{ padding: "20px" }} />
468
602
  */
469
603
  style?: any;
470
604
  /**
@@ -475,7 +609,7 @@ export declare interface RevealProps extends AnimationInterface {
475
609
  }
476
610
 
477
611
  export declare const Slide: {
478
- (props: SlideProps): JSX_2.Element;
612
+ (props: SlideProps): JSX.Element;
479
613
  propTypes: {
480
614
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
481
615
  childFactory: default_2.Requireable<any>;
@@ -510,27 +644,45 @@ export declare type SlideDirection = 'up' | 'down' | 'left' | 'right';
510
644
  */
511
645
  export declare interface SlideProps extends AnimationInterface {
512
646
  /**
513
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
647
+ * A function for customizing the rendering of child elements.
648
+ *
649
+ * @example
650
+ * <Slide childFactory={(child) => React.cloneElement(child, { style: { opacity: 0.5 } })} />
514
651
  */
515
652
  childFactory?: any;
516
653
  /**
517
- * Specifies the CSS class names which are set to the Animation.
654
+ * Specifies the CSS class names to be applied to the Animation container.
655
+ *
656
+ * @example
657
+ * <Slide className="slide-animation" />
518
658
  */
519
659
  className?: string;
520
660
  /**
521
661
  * Specifies the direction of the Slide Animation. Defaults to `down`.
662
+ *
663
+ * @example
664
+ * <Slide direction="left" />
522
665
  */
523
666
  direction?: SlideDirection;
524
667
  /**
525
- * Specifies the node type of the parent Animation. Defaults to `div`.
668
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
669
+ *
670
+ * @example
671
+ * <Slide component="article" />
526
672
  */
527
673
  component?: string;
528
674
  /**
529
- * Specifies the id of the Animation.
675
+ * Specifies the `id` attribute of the Animation container.
676
+ *
677
+ * @example
678
+ * <Slide id="slide-animation-container" />
530
679
  */
531
680
  id?: string;
532
681
  /**
533
- * Specifies the style of the parent Animation.
682
+ * Specifies the inline styles to be applied to the Animation container.
683
+ *
684
+ * @example
685
+ * <Slide style={{ margin: "10px" }} />
534
686
  */
535
687
  style?: any;
536
688
  }
@@ -539,7 +691,7 @@ export declare interface SlideProps extends AnimationInterface {
539
691
  export declare const useAnimation: (config: AnimationConfig, deps: any[]) => void;
540
692
 
541
693
  export declare const Zoom: {
542
- (props: ZoomProps): JSX_2.Element;
694
+ (props: ZoomProps): JSX.Element;
543
695
  propTypes: {
544
696
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
545
697
  childFactory: default_2.Requireable<any>;
@@ -573,31 +725,52 @@ export declare type ZoomDirection = 'in' | 'out';
573
725
  */
574
726
  export declare interface ZoomProps extends AnimationInterface {
575
727
  /**
576
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
728
+ * A function for customizing the rendering of child elements.
729
+ *
730
+ * @example
731
+ * <Zoom childFactory={(child) => React.cloneElement(child, { className: 'custom-class' })} />
577
732
  */
578
733
  childFactory?: any;
579
734
  /**
580
- * Specifies the CSS class names which are set to the Animation.
735
+ * Specifies the CSS class names to be applied to the Animation container.
736
+ *
737
+ * @example
738
+ * <Zoom className="zoom-animation" />
581
739
  */
582
740
  className?: string;
583
741
  /**
584
- * Specifies the direction of the Zoom Animation. Defaults to `down`.
742
+ * Specifies the direction of the Zoom Animation. Defaults to `out`.
743
+ *
744
+ * @example
745
+ * <Zoom direction="in" />
585
746
  */
586
747
  direction?: ZoomDirection;
587
748
  /**
588
- * Specifies the node type of the parent Animation. Defaults to `div`.
749
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
750
+ *
751
+ * @example
752
+ * <Zoom component="section" />
589
753
  */
590
754
  component?: string;
591
755
  /**
592
- * Specifies the id of the Animation.
756
+ * Specifies the `id` attribute of the Animation container.
757
+ *
758
+ * @example
759
+ * <Zoom id="zoom-animation-container" />
593
760
  */
594
761
  id?: string;
595
762
  /**
596
- * Specifies the style of the parent Animation.
763
+ * Specifies the inline styles to be applied to the Animation container.
764
+ *
765
+ * @example
766
+ * <Zoom style={{ backgroundColor: "red" }} />
597
767
  */
598
768
  style?: any;
599
769
  /**
600
- * Specifies whether the child elements will stack on top of each other without interfering ([more information and examples]({% slug stacked_animation %})).
770
+ * Determines whether child elements will stack on top of each other during the animation. Defaults to `false`.
771
+ *
772
+ * @example
773
+ * <Zoom stackChildren={true} />
601
774
  */
602
775
  stackChildren?: boolean;
603
776
  }
package/index.d.ts CHANGED
@@ -7,11 +7,11 @@
7
7
  */
8
8
  import { AnimationsClassStructure } from '@progress/kendo-react-common';
9
9
  import { default as default_2 } from 'prop-types';
10
- import { JSX as JSX_2 } from 'react/jsx-runtime';
10
+ import { JSX } from 'react/jsx-runtime';
11
11
  import * as React_2 from 'react';
12
12
 
13
13
  declare const Animation_2: {
14
- (props: AnimationProps): JSX_2.Element;
14
+ (props: AnimationProps): JSX.Element;
15
15
  propTypes: {
16
16
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
17
17
  childFactory: default_2.Requireable<any>;
@@ -54,35 +54,61 @@ export declare interface AnimationChildProps extends AnimationInterface {
54
54
  */
55
55
  in?: boolean;
56
56
  /**
57
- * @hidden
57
+ * Custom inline styles to apply to the Animation container.
58
+ *
59
+ * @example
60
+ * <AnimationChild style={{ backgroundColor: "red" }} />
58
61
  */
59
62
  style?: any;
60
63
  /**
61
- * @hidden
64
+ * Custom CSS class to apply to the Animation container.
65
+ *
66
+ * @example
67
+ * <AnimationChild className="custom-animation-class" />
62
68
  */
63
69
  className?: string;
64
70
  /**
65
- * Specifies the transition class which will be applied on the appear, enter, and exit transition.
71
+ * Specifies the base class name for the transition. This class will be used
72
+ * to generate the `appear`, `enter`, and `exit` transition classes.
73
+ *
74
+ * @example
75
+ * <AnimationChild transitionName="fade" />
66
76
  */
67
77
  transitionName: string;
68
78
  /**
69
79
  * Specifies the style which will be applied when the Animation reaches its entering state.
80
+ *
81
+ * @example
82
+ * <AnimationChild animationEnteringStyle={{ opacity: 0.5 }} />
70
83
  */
71
84
  animationEnteringStyle?: any;
72
85
  /**
73
- * Specifies the style which will be applied when the Animation reaches its entered state.
86
+ * Inline styles applied when the Animation has entered.
87
+ *
88
+ * @example
89
+ * <AnimationChild animationEnteredStyle={{ opacity: 1 }} />
74
90
  */
75
91
  animationEnteredStyle?: any;
76
92
  /**
77
93
  * Specifies the style which will be applied when the Animation reaches its exiting state.
94
+ *
95
+ * @example
96
+ * <AnimationChild animationExitingStyle={{ opacity: 0.5 }} />
78
97
  */
79
98
  animationExitingStyle?: any;
80
99
  /**
81
- * Specifies the style which will be applied when the Animation reaches its exited state.
100
+ * Inline styles applied when the Animation has exited.
101
+ *
102
+ * @example
103
+ * <AnimationChild animationExitedStyle={{ opacity: 0 }} />
82
104
  */
83
105
  animationExitedStyle?: any;
84
106
  /**
85
- * The unstyled option classes.
107
+ * Provides unstyled options for the Animation. Accepts an object
108
+ * implementing the `AnimationsClassStructure` interface.
109
+ *
110
+ * @example
111
+ * <AnimationChild unstyled={{ appear: "custom-appear-class" }} />
86
112
  */
87
113
  unstyled?: AnimationsClassStructure;
88
114
  }
@@ -191,57 +217,93 @@ declare interface AnimationInterface {
191
217
  */
192
218
  export declare interface AnimationProps extends AnimationInterface {
193
219
  /**
194
- * When the element reaches its exit state, it is no longer available in the DOM ([see example]({% slug exitingchildcomponents_animation %})).
220
+ * A function for customizing the rendering of child elements.
221
+ *
222
+ * @example
223
+ * <Animation childFactory={(child) => React.cloneElement(child, { ariaHidden: true })} />
195
224
  */
196
225
  childFactory?: any;
197
226
  /**
198
- * Specifies the name of the CSS class which is set to the Animation.
227
+ * Specifies the CSS class names to be applied to the Animation container.
228
+ *
229
+ * @example
230
+ * <Animation className="animation-container" />
199
231
  */
200
232
  className?: string;
201
233
  /**
202
- * Specifies the node type of the parent Animation. Defaults to `div`.
234
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
235
+ *
236
+ * @example
237
+ * <Animation component="main" />
203
238
  */
204
239
  component?: string;
205
240
  /**
206
- * Specifies the id of the Animation.
241
+ * Specifies the `id` attribute of the Animation container.
242
+ *
243
+ * @example
244
+ * <Animation id="animation-container" />
207
245
  */
208
246
  id?: string;
209
247
  /**
210
- * Specifies the style of the parent Animation.
248
+ * Specifies the inline styles to be applied to the Animation container.
249
+ *
250
+ * @example
251
+ * <Animation style={{ width: "100%" }} />
211
252
  */
212
253
  style?: any;
213
254
  /**
214
- * Specifies whether the Animation children will stack on top of each other without interfering ([see example]({% slug stacked_animation %})).
255
+ * Determines whether child elements will stack on top of each other during the animation.
256
+ *
257
+ * @example
258
+ * <Animation stackChildren={true} />
215
259
  */
216
260
  stackChildren?: boolean;
217
261
  /**
218
- * Specifies the `classNames` which will be applied during the transition ([see example]({% slug customizing_animation %})).
262
+ * Specifies the base class name for the transition.
263
+ *
264
+ * @example
265
+ * <Animation transitionName="fade" />
219
266
  */
220
267
  transitionName: string;
221
268
  /**
222
- * Specifies the style which will be applied when the Animation reaches its entering state.
269
+ * Specifies the inline styles applied when the Animation is entering.
270
+ *
271
+ * @example
272
+ * <Animation animationEnteringStyle={{ opacity: 0.5 }} />
223
273
  */
224
274
  animationEnteringStyle?: any;
225
275
  /**
226
- * Specifies the style which will be applied when the Animation reaches its entered state.
276
+ * Specifies the inline styles applied when the Animation has entered.
277
+ *
278
+ * @example
279
+ * <Animation animationEnteredStyle={{ opacity: 1 }} />
227
280
  */
228
281
  animationEnteredStyle?: any;
229
282
  /**
230
- * Specifies the style which will be applied when the Animation reaches its exiting state.
283
+ * Specifies the inline styles applied when the Animation is exiting.
284
+ *
285
+ * @example
286
+ * <Animation animationExitingStyle={{ opacity: 0.5 }} />
231
287
  */
232
288
  animationExitingStyle?: any;
233
289
  /**
234
- * Specifies the style which will be applied when the Animation reaches its exited state.
290
+ * Specifies the inline styles applied when the Animation has exited.
291
+ *
292
+ * @example
293
+ * <Animation animationExitedStyle={{ opacity: 0 }} />
235
294
  */
236
295
  animationExitedStyle?: any;
237
296
  /**
238
- * The unstyled option classes.
297
+ * Provides unstyled options for the Animation.
298
+ *
299
+ * @example
300
+ * <Animation unstyled={{ appear: "unstyled-appear" }} />
239
301
  */
240
302
  unstyled?: AnimationsClassStructure;
241
303
  }
242
304
 
243
305
  export declare const Expand: {
244
- (props: ExpandProps): JSX_2.Element;
306
+ (props: ExpandProps): JSX.Element;
245
307
  propTypes: {
246
308
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
247
309
  childFactory: default_2.Requireable<any>;
@@ -274,33 +336,51 @@ export declare type ExpandDirection = 'horizontal' | 'vertical';
274
336
  */
275
337
  export declare interface ExpandProps extends AnimationInterface {
276
338
  /**
277
- * After the element reached its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
339
+ * A function for customizing the rendering of child elements.
340
+ *
341
+ * @example
342
+ * <Expand childFactory={(child) => React.cloneElement(child, { role: "button" })} />
278
343
  */
279
344
  childFactory?: any;
280
345
  /**
281
- * Specifies the CSS class names which are set to the Animation.
346
+ * Specifies the CSS class names to be applied to the Animation container.
347
+ *
348
+ * @example
349
+ * <Expand className="expand-animation" />
282
350
  */
283
351
  className?: string;
284
352
  /**
285
353
  * Specifies the direction of the Expand Animation. Defaults to `vertical`.
354
+ *
355
+ * @example
356
+ * <Expand direction="horizontal" />
286
357
  */
287
358
  direction?: ExpandDirection;
288
359
  /**
289
- * Specifies the node type of the parent Animation. Defaults to `div`.
360
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
361
+ *
362
+ * @example
363
+ * <Expand component="nav" />
290
364
  */
291
365
  component?: string;
292
366
  /**
293
- * Specifies the id of the Animation.
367
+ * Specifies the `id` attribute of the Animation container.
368
+ *
369
+ * @example
370
+ * <Expand id="expand-animation-container" />
294
371
  */
295
372
  id?: string;
296
373
  /**
297
- * Specifies the style of the parent Animation.
374
+ * Specifies the inline styles to be applied to the Animation container.
375
+ *
376
+ * @example
377
+ * <Expand style={{ display: "flex" }} />
298
378
  */
299
379
  style?: any;
300
380
  }
301
381
 
302
382
  export declare const Fade: {
303
- (props: FadeProps): JSX_2.Element;
383
+ (props: FadeProps): JSX.Element;
304
384
  propTypes: {
305
385
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
306
386
  childFactory: default_2.Requireable<any>;
@@ -323,29 +403,44 @@ export declare const Fade: {
323
403
  */
324
404
  export declare interface FadeProps extends AnimationInterface {
325
405
  /**
326
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
406
+ * A function for customizing the rendering of child elements.
407
+ *
408
+ * @example
409
+ * <Fade childFactory={(child) => React.cloneElement(child, { draggable: true })} />
327
410
  */
328
411
  childFactory?: any;
329
412
  /**
330
- * Specifies CSS class names which are set to the Animation.
413
+ * Specifies the CSS class names to be applied to the Animation container.
414
+ *
415
+ * @example
416
+ * <Fade className="fade-animation" />
331
417
  */
332
418
  className?: string;
333
419
  /**
334
- * Specifies the node type of the parent Animation. Defaults to `div`.
420
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
421
+ *
422
+ * @example
423
+ * <Fade component="header" />
335
424
  */
336
425
  component?: string;
337
426
  /**
338
- * Specifies the id of the Animation.
427
+ * Specifies the `id` attribute of the Animation container.
428
+ *
429
+ * @example
430
+ * <Fade id="fade-animation-container" />
339
431
  */
340
432
  id?: string;
341
433
  /**
342
- * Specifies the style of the parent Animation.
434
+ * Specifies the inline styles to be applied to the Animation container.
435
+ *
436
+ * @example
437
+ * <Fade style={{ color: "blue" }} />
343
438
  */
344
439
  style?: any;
345
440
  }
346
441
 
347
442
  export declare const Push: {
348
- (props: PushProps): JSX_2.Element;
443
+ (props: PushProps): JSX.Element;
349
444
  propTypes: {
350
445
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
351
446
  childFactory: default_2.Requireable<any>;
@@ -381,37 +476,58 @@ export declare type PushDirection = 'up' | 'down' | 'left' | 'right';
381
476
  */
382
477
  export declare interface PushProps extends AnimationInterface {
383
478
  /**
384
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
479
+ * A function for customizing the rendering of child elements.
480
+ *
481
+ * @example
482
+ * <Push childFactory={(child) => React.cloneElement(child, { tabIndex: 0 })} />
385
483
  */
386
484
  childFactory?: any;
387
485
  /**
388
- * Specifies the CSS class names which are set to the Animation.
486
+ * Specifies the CSS class names to be applied to the Animation container.
487
+ *
488
+ * @example
489
+ * <Push className="push-animation" />
389
490
  */
390
491
  className?: string;
391
492
  /**
392
- * Specifies the direction of the Push Animation. Defaults to `out`.
493
+ * Specifies the direction of the Push Animation. Defaults to `right`.
494
+ *
495
+ * @example
496
+ * <Push direction="up" />
393
497
  */
394
498
  direction?: PushDirection;
395
499
  /**
396
- * Specifies the node type of the parent Animation. Defaults to `div`.
500
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
501
+ *
502
+ * @example
503
+ * <Push component="footer" />
397
504
  */
398
505
  component?: string;
399
506
  /**
400
- * Specifies the id of the Animation.
507
+ * Specifies the `id` attribute of the Animation container.
508
+ *
509
+ * @example
510
+ * <Push id="push-animation-container" />
401
511
  */
402
512
  id?: string;
403
513
  /**
404
- * Specifies the style of the parent Animation.
514
+ * Specifies the inline styles to be applied to the Animation container.
515
+ *
516
+ * @example
517
+ * <Push style={{ border: "1px solid black" }} />
405
518
  */
406
519
  style?: any;
407
520
  /**
408
- * Specifies whether the child elements will stack on top of each other without interfering ([more information and examples]({% slug stacked_animation %})).
521
+ * Determines whether child elements will stack on top of each other during the animation. Defaults to `false`.
522
+ *
523
+ * @example
524
+ * <Push stackChildren={true} />
409
525
  */
410
526
  stackChildren?: boolean;
411
527
  }
412
528
 
413
529
  export declare const Reveal: {
414
- (props: RevealProps): JSX_2.Element;
530
+ (props: RevealProps): JSX.Element;
415
531
  propTypes: {
416
532
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
417
533
  childFactory: default_2.Requireable<any>;
@@ -444,27 +560,45 @@ export declare type RevealDirection = 'horizontal' | 'vertical';
444
560
  */
445
561
  export declare interface RevealProps extends AnimationInterface {
446
562
  /**
447
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
563
+ * A function for customizing the rendering of child elements.
564
+ *
565
+ * @example
566
+ * <Reveal childFactory={(child) => React.cloneElement(child, { hidden: true })} />
448
567
  */
449
568
  childFactory?: any;
450
569
  /**
451
- * Specifies the CSS class names which are set to the Animation.
570
+ * Specifies the CSS class names to be applied to the Animation container.
571
+ *
572
+ * @example
573
+ * <Reveal className="reveal-animation" />
452
574
  */
453
575
  className?: string;
454
576
  /**
455
577
  * Specifies the direction of the Reveal Animation. Defaults to `vertical`.
578
+ *
579
+ * @example
580
+ * <Reveal direction="horizontal" />
456
581
  */
457
582
  direction?: RevealDirection;
458
583
  /**
459
- * Specifies the node type of the parent Animation. Defaults to `div`.
584
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
585
+ *
586
+ * @example
587
+ * <Reveal component="aside" />
460
588
  */
461
589
  component?: string;
462
590
  /**
463
- * Specifies the id of the Animation.
591
+ * Specifies the `id` attribute of the Animation container.
592
+ *
593
+ * @example
594
+ * <Reveal id="reveal-animation-container" />
464
595
  */
465
596
  id?: string;
466
597
  /**
467
- * Specifies the style of the parent Animation.
598
+ * Specifies the inline styles to be applied to the Animation container.
599
+ *
600
+ * @example
601
+ * <Reveal style={{ padding: "20px" }} />
468
602
  */
469
603
  style?: any;
470
604
  /**
@@ -475,7 +609,7 @@ export declare interface RevealProps extends AnimationInterface {
475
609
  }
476
610
 
477
611
  export declare const Slide: {
478
- (props: SlideProps): JSX_2.Element;
612
+ (props: SlideProps): JSX.Element;
479
613
  propTypes: {
480
614
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
481
615
  childFactory: default_2.Requireable<any>;
@@ -510,27 +644,45 @@ export declare type SlideDirection = 'up' | 'down' | 'left' | 'right';
510
644
  */
511
645
  export declare interface SlideProps extends AnimationInterface {
512
646
  /**
513
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
647
+ * A function for customizing the rendering of child elements.
648
+ *
649
+ * @example
650
+ * <Slide childFactory={(child) => React.cloneElement(child, { style: { opacity: 0.5 } })} />
514
651
  */
515
652
  childFactory?: any;
516
653
  /**
517
- * Specifies the CSS class names which are set to the Animation.
654
+ * Specifies the CSS class names to be applied to the Animation container.
655
+ *
656
+ * @example
657
+ * <Slide className="slide-animation" />
518
658
  */
519
659
  className?: string;
520
660
  /**
521
661
  * Specifies the direction of the Slide Animation. Defaults to `down`.
662
+ *
663
+ * @example
664
+ * <Slide direction="left" />
522
665
  */
523
666
  direction?: SlideDirection;
524
667
  /**
525
- * Specifies the node type of the parent Animation. Defaults to `div`.
668
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
669
+ *
670
+ * @example
671
+ * <Slide component="article" />
526
672
  */
527
673
  component?: string;
528
674
  /**
529
- * Specifies the id of the Animation.
675
+ * Specifies the `id` attribute of the Animation container.
676
+ *
677
+ * @example
678
+ * <Slide id="slide-animation-container" />
530
679
  */
531
680
  id?: string;
532
681
  /**
533
- * Specifies the style of the parent Animation.
682
+ * Specifies the inline styles to be applied to the Animation container.
683
+ *
684
+ * @example
685
+ * <Slide style={{ margin: "10px" }} />
534
686
  */
535
687
  style?: any;
536
688
  }
@@ -539,7 +691,7 @@ export declare interface SlideProps extends AnimationInterface {
539
691
  export declare const useAnimation: (config: AnimationConfig, deps: any[]) => void;
540
692
 
541
693
  export declare const Zoom: {
542
- (props: ZoomProps): JSX_2.Element;
694
+ (props: ZoomProps): JSX.Element;
543
695
  propTypes: {
544
696
  children: default_2.Requireable<NonNullable<default_2.ReactNodeLike>>;
545
697
  childFactory: default_2.Requireable<any>;
@@ -573,31 +725,52 @@ export declare type ZoomDirection = 'in' | 'out';
573
725
  */
574
726
  export declare interface ZoomProps extends AnimationInterface {
575
727
  /**
576
- * After the element reaches its exit state, it is no longer available in the DOM. If a DOM operation is required, access it trough the `childFactory` function.
728
+ * A function for customizing the rendering of child elements.
729
+ *
730
+ * @example
731
+ * <Zoom childFactory={(child) => React.cloneElement(child, { className: 'custom-class' })} />
577
732
  */
578
733
  childFactory?: any;
579
734
  /**
580
- * Specifies the CSS class names which are set to the Animation.
735
+ * Specifies the CSS class names to be applied to the Animation container.
736
+ *
737
+ * @example
738
+ * <Zoom className="zoom-animation" />
581
739
  */
582
740
  className?: string;
583
741
  /**
584
- * Specifies the direction of the Zoom Animation. Defaults to `down`.
742
+ * Specifies the direction of the Zoom Animation. Defaults to `out`.
743
+ *
744
+ * @example
745
+ * <Zoom direction="in" />
585
746
  */
586
747
  direction?: ZoomDirection;
587
748
  /**
588
- * Specifies the node type of the parent Animation. Defaults to `div`.
749
+ * Specifies the HTML tag of the parent Animation container. Defaults to `div`.
750
+ *
751
+ * @example
752
+ * <Zoom component="section" />
589
753
  */
590
754
  component?: string;
591
755
  /**
592
- * Specifies the id of the Animation.
756
+ * Specifies the `id` attribute of the Animation container.
757
+ *
758
+ * @example
759
+ * <Zoom id="zoom-animation-container" />
593
760
  */
594
761
  id?: string;
595
762
  /**
596
- * Specifies the style of the parent Animation.
763
+ * Specifies the inline styles to be applied to the Animation container.
764
+ *
765
+ * @example
766
+ * <Zoom style={{ backgroundColor: "red" }} />
597
767
  */
598
768
  style?: any;
599
769
  /**
600
- * Specifies whether the child elements will stack on top of each other without interfering ([more information and examples]({% slug stacked_animation %})).
770
+ * Determines whether child elements will stack on top of each other during the animation. Defaults to `false`.
771
+ *
772
+ * @example
773
+ * <Zoom stackChildren={true} />
601
774
  */
602
775
  stackChildren?: boolean;
603
776
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-animation",
3
- "version": "10.2.0-develop.1",
3
+ "version": "10.2.0-develop.11",
4
4
  "description": "React Animation component assists with animating HTML elements. KendoReact Animation package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -26,7 +26,7 @@
26
26
  "sideEffects": false,
27
27
  "peerDependencies": {
28
28
  "@progress/kendo-licensing": "^1.5.1",
29
- "@progress/kendo-react-common": "10.2.0-develop.1",
29
+ "@progress/kendo-react-common": "10.2.0-develop.11",
30
30
  "@progress/kendo-svg-icons": "^4.0.0",
31
31
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
32
32
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",