react-ui-animate 4.1.1 → 4.2.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.
- package/README.md +55 -43
- package/dist/animation/controllers/index.d.ts +2 -2
- package/dist/animation/controllers/withDecay.d.ts +9 -5
- package/dist/animation/controllers/withDelay.d.ts +4 -6
- package/dist/animation/controllers/withEase.d.ts +6 -4
- package/dist/animation/controllers/withLoop.d.ts +8 -2
- package/dist/animation/controllers/withNative.d.ts +5 -0
- package/dist/animation/controllers/withSequence.d.ts +8 -2
- package/dist/animation/controllers/withSpring.d.ts +10 -5
- package/dist/animation/controllers/withTiming.d.ts +9 -5
- package/dist/animation/helpers/animationType.d.ts +59 -55
- package/dist/animation/helpers/getToValue.d.ts +2 -2
- package/dist/animation/helpers/index.d.ts +1 -3
- package/dist/animation/hooks/index.d.ts +1 -1
- package/dist/animation/hooks/useMount.d.ts +6 -11
- package/dist/animation/hooks/useValue.d.ts +3 -13
- package/dist/animation/hooks/useValues.d.ts +3 -4
- package/dist/animation/index.d.ts +4 -4
- package/dist/animation/modules/MountedBlock.d.ts +4 -13
- package/dist/animation/modules/ScrollableBlock.d.ts +2 -13
- package/dist/animation/modules/index.d.ts +0 -1
- package/dist/animation/types.d.ts +16 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/dist/animation/controllers/withConfig.d.ts +0 -5
- package/dist/animation/core/FluidArrayController.d.ts +0 -7
- package/dist/animation/core/FluidController.d.ts +0 -34
- package/dist/animation/core/useFluidValue.d.ts +0 -3
- package/dist/animation/core/useFluidValues.d.ts +0 -3
- package/dist/animation/core/useMount.d.ts +0 -18
- package/dist/animation/helpers/delay.d.ts +0 -5
- package/dist/animation/helpers/isDefined.d.ts +0 -1
- package/dist/animation/modules/TransitionBlock.d.ts +0 -18
|
@@ -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 +0,0 @@
|
|
|
1
|
-
export declare const isDefined: <T>(value: T) => value is NonNullable<T>;
|
|
@@ -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 {};
|