react-ui-animate 4.1.2 → 4.3.0

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.
Files changed (37) hide show
  1. package/README.md +55 -43
  2. package/dist/animation/AnimationConfig.d.ts +63 -0
  3. package/dist/animation/controllers.d.ts +30 -0
  4. package/dist/animation/hooks/index.d.ts +0 -1
  5. package/dist/animation/hooks/useMount.d.ts +8 -13
  6. package/dist/animation/hooks/useValue.d.ts +6 -16
  7. package/dist/animation/index.d.ts +5 -5
  8. package/dist/animation/interpolation/index.d.ts +1 -1
  9. package/dist/animation/modules/MountedBlock.d.ts +5 -14
  10. package/dist/animation/modules/ScrollableBlock.d.ts +4 -15
  11. package/dist/animation/modules/index.d.ts +0 -1
  12. package/dist/animation/types.d.ts +25 -0
  13. package/dist/index.d.ts +6 -6
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/package.json +6 -6
  17. package/dist/animation/controllers/index.d.ts +0 -8
  18. package/dist/animation/controllers/withConfig.d.ts +0 -5
  19. package/dist/animation/controllers/withDecay.d.ts +0 -7
  20. package/dist/animation/controllers/withDelay.d.ts +0 -6
  21. package/dist/animation/controllers/withEase.d.ts +0 -6
  22. package/dist/animation/controllers/withLoop.d.ts +0 -2
  23. package/dist/animation/controllers/withSequence.d.ts +0 -2
  24. package/dist/animation/controllers/withSpring.d.ts +0 -7
  25. package/dist/animation/controllers/withTiming.d.ts +0 -7
  26. package/dist/animation/core/FluidArrayController.d.ts +0 -7
  27. package/dist/animation/core/FluidController.d.ts +0 -34
  28. package/dist/animation/core/useFluidValue.d.ts +0 -3
  29. package/dist/animation/core/useFluidValues.d.ts +0 -3
  30. package/dist/animation/core/useMount.d.ts +0 -18
  31. package/dist/animation/helpers/animationType.d.ts +0 -59
  32. package/dist/animation/helpers/getToValue.d.ts +0 -2
  33. package/dist/animation/helpers/index.d.ts +0 -3
  34. package/dist/animation/helpers/isDefined.d.ts +0 -1
  35. package/dist/animation/hooks/useValues.d.ts +0 -8
  36. package/dist/animation/interpolation/interpolate.d.ts +0 -11
  37. package/dist/animation/modules/TransitionBlock.d.ts +0 -18
@@ -1,2 +0,0 @@
1
- import type { UpdateValue } from '../core/FluidController';
2
- export declare const withLoop: (updateValue: UpdateValue | UpdateValue[], loop: number) => UpdateValue[];
@@ -1,2 +0,0 @@
1
- import { type UpdateValue } from '../core/FluidController';
2
- export declare const withSequence: (animations: Array<UpdateValue | number | Array<UpdateValue | number>>) => UpdateValue[];
@@ -1,7 +0,0 @@
1
- import { type UseValueConfig } from '../hooks';
2
- import { type WithOnCallbacks } from './withConfig';
3
- import type { UpdateValue } from '../core/FluidController';
4
- interface WithSpringConfig extends Pick<UseValueConfig, 'mass' | 'friction' | 'tension'>, WithOnCallbacks {
5
- }
6
- export declare const withSpring: (toValue: number, config?: WithSpringConfig) => UpdateValue;
7
- export {};
@@ -1,7 +0,0 @@
1
- import { type UseValueConfig } from '../hooks';
2
- import { type WithOnCallbacks } from './withConfig';
3
- import type { UpdateValue } from '../core/FluidController';
4
- interface WithTimingConfig extends Pick<UseValueConfig, 'duration' | 'easing'>, WithOnCallbacks {
5
- }
6
- export declare const withTiming: (toValue: number, config?: WithTimingConfig) => UpdateValue;
7
- export {};
@@ -1,7 +0,0 @@
1
- import type { UpdateValue, UseFluidValueConfig } from './FluidController';
2
- export declare class FluidArrayController {
3
- private fluidControllers;
4
- constructor(values: number[] | string[], config?: UseFluidValueConfig);
5
- setFluid(updateValue: Array<UpdateValue | UpdateValue[]>, callback?: () => void): void;
6
- getFluid(): import("@raidipesh78/re-motion").FluidValue[];
7
- }
@@ -1,34 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- type Fn<T, U> = (value: T) => U;
3
- export interface UseFluidValueConfig {
4
- mass?: number;
5
- tension?: number;
6
- friction?: number;
7
- duration?: number;
8
- easing?: Fn<number, number>;
9
- immediate?: boolean;
10
- delay?: number;
11
- restDistance?: number;
12
- onChange?: Fn<number | string, void>;
13
- onRest?: Fn<number | string, void>;
14
- onStart?: Fn<number | string, void>;
15
- decay?: boolean;
16
- velocity?: number;
17
- deceleration?: number;
18
- loop?: number;
19
- }
20
- export type UpdateValue = {
21
- toValue?: number | string;
22
- config?: UseFluidValueConfig;
23
- };
24
- export declare class FluidController {
25
- private fluid;
26
- private defaultConfig?;
27
- private iterationsSoFar;
28
- constructor(value: number | string, config?: UseFluidValueConfig);
29
- private getAnimation;
30
- private runAnimation;
31
- setFluid(updateValue: UpdateValue | UpdateValue[], callback?: (value: number) => void): void;
32
- getFluid(): FluidValue;
33
- }
34
- export {};
@@ -1,3 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import { UpdateValue, UseFluidValueConfig } from './FluidController';
3
- export declare const useFluidValue: <T extends number | string>(value: T, config?: UseFluidValueConfig) => [FluidValue, (updateValue: UpdateValue | UpdateValue[], callback?: () => void) => void];
@@ -1,3 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import { UpdateValue, UseFluidValueConfig } from './FluidController';
3
- export declare const useFluidValues: <T extends number[] | string[]>(value: T, config?: UseFluidValueConfig) => [FluidValue[], (updateValue: Array<UpdateValue | UpdateValue[]>, callback?: () => void) => void];
@@ -1,18 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import type { UpdateValue, UseFluidValueConfig } from './FluidController';
3
- export interface UseMountConfig {
4
- from: number;
5
- enter: number | UpdateValue | number[] | UpdateValue[];
6
- exit: number | UpdateValue | number[] | UpdateValue[];
7
- config?: UseFluidValueConfig;
8
- }
9
- /**
10
- * `useMount`
11
- *
12
- * applies mounting and unmounting of a component according to state change
13
- * applying transitions
14
- *
15
- * @param state - boolean indicating mount state of a component
16
- * @param config - the config object `UseMountConfig`
17
- */
18
- export declare const useMount: (state: boolean, config: UseMountConfig) => (callback: (animation: FluidValue, mounted: boolean) => React.ReactNode) => import("react").ReactNode;
@@ -1,59 +0,0 @@
1
- import { Easing } from '@raidipesh78/re-motion';
2
- export declare const AnimationConfig: {
3
- ELASTIC: {
4
- mass: number;
5
- friction: number;
6
- tension: number;
7
- };
8
- BOUNCE: {
9
- duration: number;
10
- easing: typeof Easing.bounce;
11
- };
12
- EASE: {
13
- mass: number;
14
- friction: number;
15
- tension: number;
16
- };
17
- STIFF: {
18
- mass: number;
19
- friction: number;
20
- tension: number;
21
- };
22
- WOOBLE: {
23
- mass: number;
24
- friction: number;
25
- tension: number;
26
- };
27
- EASE_IN: {
28
- duration: number;
29
- easing: (t: number) => number;
30
- };
31
- EASE_OUT: {
32
- duration: number;
33
- easing: (t: number) => number;
34
- };
35
- EASE_IN_OUT: {
36
- duration: number;
37
- easing: (t: number) => number;
38
- };
39
- POWER1: {
40
- duration: number;
41
- easing: (t: number) => number;
42
- };
43
- POWER2: {
44
- duration: number;
45
- easing: (t: number) => number;
46
- };
47
- POWER3: {
48
- duration: number;
49
- easing: (t: number) => number;
50
- };
51
- POWER4: {
52
- duration: number;
53
- easing: (t: number) => number;
54
- };
55
- LINEAR: {
56
- duration: number;
57
- easing: typeof Easing.linear;
58
- };
59
- };
@@ -1,2 +0,0 @@
1
- import { UpdateValue, UseFluidValueConfig } from '../core/FluidController';
2
- export declare function getToValue(value: number | string | UpdateValue, config?: UseFluidValueConfig): UpdateValue;
@@ -1,3 +0,0 @@
1
- export * from './isDefined';
2
- export * from './getToValue';
3
- export * from './animationType';
@@ -1 +0,0 @@
1
- export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
@@ -1,8 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- import { type UpdateValue } from '../core/FluidController';
3
- import { type UseValueConfig } from './useValue';
4
- export declare function useValues<T extends number[] | string[]>(initialValue: T, config?: UseValueConfig): {
5
- get value(): FluidValue[];
6
- set value(to: Array<number | number[] | string | UpdateValue | UpdateValue[]>);
7
- readonly currentValue: (string | number)[];
8
- };
@@ -1,11 +0,0 @@
1
- import { FluidValue } from '@raidipesh78/re-motion';
2
- type ExtrapolateType = 'identity' | 'extend' | 'clamp';
3
- type ExtrapolateConfig = {
4
- extrapolate?: ExtrapolateType;
5
- extrapolateLeft?: ExtrapolateType;
6
- extrapolateRight?: ExtrapolateType;
7
- };
8
- type InterpolateReturnType<T> = T extends number ? number : ReturnType<FluidValue['interpolate']>;
9
- export declare const interpolate: <T extends number | FluidValue>(value: T, inputRange: number[], outputRange: number[] | string[], extrapolateConfig?: ExtrapolateConfig) => InterpolateReturnType<T>;
10
- export declare const bInterpolate: <T extends number | FluidValue>(value: T, minOutput: number | string, maxOutput: number | string, extrapolateConfig?: ExtrapolateConfig) => InterpolateReturnType<T>;
11
- export {};
@@ -1,18 +0,0 @@
1
- import * as React from 'react';
2
- import { FluidValue } from '@raidipesh78/re-motion';
3
- import { type UseValueConfig } from '../hooks';
4
- interface TransitionBlockProps {
5
- state: boolean;
6
- children: (animation: {
7
- value: FluidValue;
8
- }) => React.ReactNode;
9
- config?: UseValueConfig;
10
- }
11
- /**
12
- * TransitionBlock - Higher order component which animates on state change.
13
- * @prop { boolean } state - Boolean indicating the current state of animation, usually `false = 0 and true = 1`.
14
- * @prop { function } children - Child as a function with `AnimatedValue` on `.value` property.
15
- * @prop { UseValueConfig } config - Animation configuration.
16
- */
17
- export declare const TransitionBlock: ({ state, children, config, }: TransitionBlockProps) => import("react/jsx-runtime").JSX.Element;
18
- export {};