Skip to content

Commit

Permalink
fix: changed animation names to match the old ones, updated docs (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
mateki0 authored Jan 26, 2023
1 parent 65589ff commit 8642b28
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
7 changes: 7 additions & 0 deletions docs/docs/api/apiReference.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ We've prepared a couple of ready-to-use animations for you (just import them fro
- `ZoomInDownZoomOutDown`
- `RotateInRotateOut`
- `SlideInLeftSlideOutRight`
- `ZoomInZoomOut`
- `MoveUp`
- `MoveDown`
- `SlideInLeft`
- `FadeInFadeOut`
- `VeryCustomTransition`
- `DiagonalSlideInLeftSlideOutRight`

---

Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/animationBuilder.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { mergeStylesFunctions } from 'src/core/hooks/useAnimationAPI'
import {
AnimationBuilder,
FadeIn,
FadeInFadeOut,
MoveDownAnimation,
MoveUpAnimation,
RotateZIn,
Expand All @@ -18,8 +18,8 @@ describe('props merger tests', function () {

it('should merge styles properly with add method', () => {
const MoveDown = new AnimationBuilder(MoveDownAnimation)
const MoveDownFadeIn = FadeIn.add(MoveDown).transitionInStylesQueue
const styles = mergeStylesFunctions(MoveDownFadeIn, { value: 1 })
const MoveDownFadeInFadeOut = FadeInFadeOut.add(MoveDown).transitionInStylesQueue
const styles = mergeStylesFunctions(MoveDownFadeInFadeOut, { value: 1 })

expect(styles).toMatchObject({
opacity: 1,
Expand Down
9 changes: 4 additions & 5 deletions src/core/utils/generateAnimationConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,20 +336,19 @@ const DiagonalSlideInLeftSlideOutRightAnimation: CustomAnimationConfig = {

export const MoveDown = new AnimationBuilder(MoveDownAnimation)
export const MoveUp = new AnimationBuilder(MoveUpAnimation)
export const ZoomIn = new AnimationBuilder(ZoomInAnimation)
export const ZoomInZoomOut = new AnimationBuilder(ZoomInAnimation)
export const SlideInLeft = new AnimationBuilder(SlideInLeftAnimation)
export const SlideInLeftSlideOutRight = new AnimationBuilder(SlideInLeftSlideOutRightAnimation)
export const RotateIn = new AnimationBuilder(RotateInAnimation)
export const RotateInRotateOut = new AnimationBuilder(RotateInAnimation)
export const RotateZIn = new AnimationBuilder(RotateZInAnimation)
export const FadeIn = new AnimationBuilder(FadeInAnimation)
export const FadeInFadeOut = new AnimationBuilder(FadeInAnimation)
export const CrazyAnimationConfig = new AnimationBuilder(CrazyAnimationConfigAnimation)
export const VeryCustomTransition = new AnimationBuilder(VeryCustomTransitionAnimation)
export const DiagonalSlideInLeftSlideOutRight = new AnimationBuilder(
DiagonalSlideInLeftSlideOutRightAnimation
)
export const ZoomInDownZoomOutDown = new AnimationBuilder(ZoomInAnimation).add(MoveDown)
export const ZoomInDownZoomOutUp = new AnimationBuilder(ZoomIn).add(MoveUp)

export const ZoomInDownZoomOutUp = new AnimationBuilder(ZoomInZoomOut).add(MoveUp)
/**
* @deprecated since version > 0.0.1-beta.2
*/
Expand Down
12 changes: 6 additions & 6 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { defaultVariants } from './defaultConfig/defaultConfig'
import { useNotificationController } from './hooks/useNotificationController'
import {
SlideInLeftSlideOutRight,
ZoomIn,
ZoomInZoomOut,
MoveUp,
ZoomInDownZoomOutUp,
ZoomInDownZoomOutDown,
MoveDown,
SlideInLeft,
RotateZIn,
FadeIn,
RotateIn,
FadeInFadeOut,
RotateInRotateOut,
VeryCustomTransition,
DiagonalSlideInLeftSlideOutRight,
} from './core/utils/generateAnimationConfig'
Expand All @@ -26,16 +26,16 @@ export { defaultVariants }
export {
generateAnimationConfig,
AnimationBuilder,
ZoomIn,
ZoomInZoomOut,
ZoomInDownZoomOutDown,
MoveDown,
ZoomInDownZoomOutUp,
MoveUp,
SlideInLeft,
SlideInLeftSlideOutRight,
RotateZIn,
FadeIn,
RotateIn,
FadeInFadeOut,
RotateInRotateOut,
VeryCustomTransition,
DiagonalSlideInLeftSlideOutRight,
}
Expand Down

0 comments on commit 8642b28

Please sign in to comment.