react-ui-animate 4.2.0 → 4.3.0-rc.1
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/.releaserc.json +33 -0
- package/README.md +129 -144
- package/package.json +14 -3
- package/dist/animation/controllers/index.d.ts +0 -8
- package/dist/animation/controllers/withDecay.d.ts +0 -11
- package/dist/animation/controllers/withDelay.d.ts +0 -4
- package/dist/animation/controllers/withEase.d.ts +0 -8
- package/dist/animation/controllers/withLoop.d.ts +0 -8
- package/dist/animation/controllers/withNative.d.ts +0 -5
- package/dist/animation/controllers/withSequence.d.ts +0 -8
- package/dist/animation/controllers/withSpring.d.ts +0 -12
- package/dist/animation/controllers/withTiming.d.ts +0 -11
- package/dist/animation/helpers/animationType.d.ts +0 -63
- package/dist/animation/helpers/getToValue.d.ts +0 -2
- package/dist/animation/helpers/index.d.ts +0 -2
- package/dist/animation/hooks/index.d.ts +0 -3
- package/dist/animation/hooks/useMount.d.ts +0 -10
- package/dist/animation/hooks/useValue.d.ts +0 -7
- package/dist/animation/hooks/useValues.d.ts +0 -7
- package/dist/animation/index.d.ts +0 -5
- package/dist/animation/interpolation/colors.d.ts +0 -25
- package/dist/animation/interpolation/index.d.ts +0 -1
- package/dist/animation/interpolation/interpolate.d.ts +0 -11
- package/dist/animation/interpolation/interpolateNumbers.d.ts +0 -8
- package/dist/animation/modules/MountedBlock.d.ts +0 -11
- package/dist/animation/modules/ScrollableBlock.d.ts +0 -11
- package/dist/animation/modules/index.d.ts +0 -2
- package/dist/animation/types.d.ts +0 -16
- package/dist/gestures/controllers/DragGesture.d.ts +0 -17
- package/dist/gestures/controllers/Gesture.d.ts +0 -20
- package/dist/gestures/controllers/MouseMoveGesture.d.ts +0 -13
- package/dist/gestures/controllers/ScrollGesture.d.ts +0 -14
- package/dist/gestures/controllers/WheelGesture.d.ts +0 -15
- package/dist/gestures/controllers/index.d.ts +0 -4
- package/dist/gestures/helpers/eventAttacher.d.ts +0 -11
- package/dist/gestures/helpers/index.d.ts +0 -1
- package/dist/gestures/helpers/math.d.ts +0 -34
- package/dist/gestures/helpers/withDefault.d.ts +0 -4
- package/dist/gestures/hooks/index.d.ts +0 -5
- package/dist/gestures/hooks/useDrag.d.ts +0 -4
- package/dist/gestures/hooks/useGesture.d.ts +0 -9
- package/dist/gestures/hooks/useMouseMove.d.ts +0 -4
- package/dist/gestures/hooks/useRecognizer.d.ts +0 -10
- package/dist/gestures/hooks/useScroll.d.ts +0 -4
- package/dist/gestures/hooks/useWheel.d.ts +0 -4
- package/dist/gestures/types/index.d.ts +0 -51
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/useMeasure.d.ts +0 -14
- package/dist/hooks/useOutsideClick.d.ts +0 -2
- package/dist/hooks/useWindowDimension.d.ts +0 -9
- package/dist/index.d.ts +0 -9
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
package/.releaserc.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"branches": [
|
|
3
|
+
{ "name": "main", "channel": "latest" },
|
|
4
|
+
{ "name": "next", "prerelease": "rc" }
|
|
5
|
+
],
|
|
6
|
+
"plugins": [
|
|
7
|
+
[
|
|
8
|
+
"@semantic-release/commit-analyzer",
|
|
9
|
+
{
|
|
10
|
+
"preset": "angular",
|
|
11
|
+
"releaseRules": [
|
|
12
|
+
{ "type": "chore", "release": false },
|
|
13
|
+
{ "type": "docs", "release": false }
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"@semantic-release/release-notes-generator",
|
|
18
|
+
[
|
|
19
|
+
"@semantic-release/npm",
|
|
20
|
+
{
|
|
21
|
+
"npmPublish": true
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
"@semantic-release/git",
|
|
26
|
+
{
|
|
27
|
+
"assets": ["package.json", "CHANGELOG.md"],
|
|
28
|
+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"@semantic-release/github"
|
|
32
|
+
]
|
|
33
|
+
}
|
package/README.md
CHANGED
|
@@ -6,215 +6,200 @@
|
|
|
6
6
|
|
|
7
7
|
### Install
|
|
8
8
|
|
|
9
|
-
You can install react-ui-animate via `npm` or `yarn`:
|
|
9
|
+
You can install `react-ui-animate` via `npm` or `yarn`:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm
|
|
12
|
+
npm install react-ui-animate
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
16
|
yarn add react-ui-animate
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Getting Started
|
|
22
|
+
|
|
23
|
+
The `react-ui-animate` library provides a straightforward way to add animations and gestures to your React components. Below are some common use cases.
|
|
20
24
|
|
|
21
|
-
|
|
25
|
+
### 1. useValue
|
|
22
26
|
|
|
23
|
-
|
|
24
|
-
import { animate, useValue } from 'react-ui-animate';
|
|
27
|
+
Use `useValue` to initialize and update an animated value.
|
|
25
28
|
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
```tsx
|
|
30
|
+
import React from 'react';
|
|
31
|
+
import {
|
|
32
|
+
animate,
|
|
33
|
+
useValue,
|
|
34
|
+
withSpring,
|
|
35
|
+
withTiming,
|
|
36
|
+
withSequence,
|
|
37
|
+
} from 'react-ui-animate';
|
|
38
|
+
|
|
39
|
+
export const UseValue: React.FC = () => {
|
|
40
|
+
const [width, setWidth] = useValue(100);
|
|
28
41
|
|
|
29
42
|
return (
|
|
30
43
|
<>
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
width: 100,
|
|
35
|
-
padding: 20,
|
|
36
|
-
background: '#39F',
|
|
44
|
+
<button
|
|
45
|
+
onClick={() => {
|
|
46
|
+
setWidth(withSequence([withTiming(100), withSpring(0)]));
|
|
37
47
|
}}
|
|
38
48
|
>
|
|
39
|
-
|
|
40
|
-
</
|
|
41
|
-
|
|
42
|
-
<button
|
|
49
|
+
SEQUENCE (100 → 0)
|
|
50
|
+
</button>
|
|
51
|
+
<button
|
|
43
52
|
onClick={() => {
|
|
44
|
-
|
|
53
|
+
setWidth(withSpring(200));
|
|
45
54
|
}}
|
|
46
55
|
>
|
|
47
|
-
|
|
56
|
+
SPRING (→ 200)
|
|
48
57
|
</button>
|
|
58
|
+
<button
|
|
59
|
+
onClick={() => {
|
|
60
|
+
setWidth(400);
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
IMMEDIATE (→ 400)
|
|
64
|
+
</button>
|
|
65
|
+
|
|
66
|
+
<animate.div
|
|
67
|
+
style={{
|
|
68
|
+
width,
|
|
69
|
+
height: 100,
|
|
70
|
+
backgroundColor: 'red',
|
|
71
|
+
left: 0,
|
|
72
|
+
top: 0,
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
49
75
|
</>
|
|
50
76
|
);
|
|
51
|
-
}
|
|
77
|
+
};
|
|
52
78
|
```
|
|
53
79
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
---
|
|
80
|
+
### 2. useMount
|
|
57
81
|
|
|
58
|
-
|
|
82
|
+
Use `useMount` to animate component mount and unmount transitions.
|
|
59
83
|
|
|
60
|
-
|
|
84
|
+
```tsx
|
|
85
|
+
import React from 'react';
|
|
86
|
+
import {
|
|
87
|
+
animate,
|
|
88
|
+
useMount,
|
|
89
|
+
withDecay,
|
|
90
|
+
withSequence,
|
|
91
|
+
withSpring,
|
|
92
|
+
withTiming,
|
|
93
|
+
} from 'react-ui-animate';
|
|
61
94
|
|
|
62
|
-
|
|
95
|
+
export const UseMount: React.FC = () => {
|
|
96
|
+
const [open, setOpen] = React.useState(true);
|
|
97
|
+
const mounted = useMount(open, { from: 0, enter: 1, exit: 0 });
|
|
63
98
|
|
|
64
|
-
|
|
65
|
-
|
|
99
|
+
return (
|
|
100
|
+
<>
|
|
101
|
+
{mounted(
|
|
102
|
+
(animation, isMounted) =>
|
|
103
|
+
isMounted && (
|
|
104
|
+
<animate.div
|
|
105
|
+
style={{
|
|
106
|
+
width: 100,
|
|
107
|
+
height: 100,
|
|
108
|
+
backgroundColor: 'teal',
|
|
109
|
+
opacity: animation,
|
|
110
|
+
}}
|
|
111
|
+
/>
|
|
112
|
+
)
|
|
113
|
+
)}
|
|
114
|
+
|
|
115
|
+
<button onClick={() => setOpen((prev) => !prev)}>ANIMATE ME</button>
|
|
116
|
+
</>
|
|
117
|
+
);
|
|
118
|
+
};
|
|
66
119
|
```
|
|
67
120
|
|
|
68
|
-
|
|
121
|
+
### 3. Interpolation
|
|
69
122
|
|
|
70
|
-
|
|
123
|
+
Interpolate values for complex mappings like color transitions or movement.
|
|
71
124
|
|
|
72
|
-
```
|
|
73
|
-
import {
|
|
125
|
+
```tsx
|
|
126
|
+
import React, { useLayoutEffect, useState } from 'react';
|
|
127
|
+
import { animate, useValue, withSpring } from 'react-ui-animate';
|
|
74
128
|
|
|
75
|
-
const
|
|
129
|
+
export const Interpolation: React.FC = () => {
|
|
130
|
+
const [open, setOpen] = useState(false);
|
|
131
|
+
const [x, setX] = useValue(0);
|
|
76
132
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
height: 100,
|
|
81
|
-
backgroundColor: '#39f',
|
|
82
|
-
}}
|
|
83
|
-
/>;
|
|
84
|
-
```
|
|
133
|
+
useLayoutEffect(() => {
|
|
134
|
+
setX(withSpring(open ? 500 : 0));
|
|
135
|
+
}, [open, setX]);
|
|
85
136
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
137
|
+
return (
|
|
138
|
+
<>
|
|
139
|
+
<animate.div
|
|
140
|
+
style={{
|
|
141
|
+
width: 100,
|
|
142
|
+
height: 100,
|
|
143
|
+
backgroundColor: x.to([0, 500], ['red', 'blue']),
|
|
144
|
+
translateX: x,
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
94
147
|
|
|
95
|
-
<button
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}}
|
|
100
|
-
>
|
|
101
|
-
Update
|
|
102
|
-
</button>
|
|
148
|
+
<button onClick={() => setOpen((p) => !p)}>ANIMATE ME</button>
|
|
149
|
+
</>
|
|
150
|
+
);
|
|
151
|
+
};
|
|
103
152
|
```
|
|
104
153
|
|
|
105
|
-
In this example, `withSpring` runs spring animation when updating the value.
|
|
106
|
-
|
|
107
154
|
---
|
|
108
155
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
The `interpolate()` function is useful for mapping values from one range to another, enabling more complex animations.
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
import { useValue, animate, interpolate } from 'react-ui-animate';
|
|
115
|
-
|
|
116
|
-
const width = useValue(100);
|
|
117
|
-
|
|
118
|
-
<animate.div
|
|
119
|
-
style={{
|
|
120
|
-
width: width.value,
|
|
121
|
-
height: 100,
|
|
122
|
-
backgroundColor: interpolate(width.value, [100, 200], ['red', 'blue']),
|
|
123
|
-
}}
|
|
124
|
-
/>;
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
In this example, as the width changes from 100 to 200, the background color smoothly transitions from red to blue.
|
|
128
|
-
|
|
129
|
-
#### Modifiers
|
|
130
|
-
|
|
131
|
-
You can dynamically modify animation configurations by assigning values to an animated value using various animation functions.
|
|
132
|
-
|
|
133
|
-
To apply a spring animation and update the value to `10`:
|
|
134
|
-
|
|
135
|
-
```jsx
|
|
136
|
-
x.value = withSpring(10);
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
To apply a timing animation with a duration of 5000 milliseconds:
|
|
156
|
+
## API Overview
|
|
140
157
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
To create sequential transitions using the `withSequence` function with dynamic modifiers like `withSpring` and `withTiming`:
|
|
146
|
-
|
|
147
|
-
```jsx
|
|
148
|
-
x.value = withSequence([withSpring(50), withTiming(100), withEase(200)]);
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
#### `useMount()`
|
|
158
|
+
- **`useValue(initial)`**: Initializes an animated value.
|
|
159
|
+
- **`animate`**: JSX wrapper for animatable elements (`animate.div`, `animate.span`, etc.).
|
|
160
|
+
- **Modifiers**: `withSpring`, `withTiming`, `withDecay`, `withSequence` — functions to define animation behavior.
|
|
161
|
+
- **`useMount(state, config)`**: Manages mount/unmount transitions. `config` includes `from`, `enter`, and `exit` values.
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
## Gestures
|
|
154
164
|
|
|
155
|
-
|
|
156
|
-
import { useMount } from 'react-ui-animate';
|
|
157
|
-
|
|
158
|
-
export default function App() {
|
|
159
|
-
const [visible, setVisible] = useState(false);
|
|
160
|
-
|
|
161
|
-
const open = useMount(visible);
|
|
162
|
-
|
|
163
|
-
return open((animation, mounted) => mounted && <animate.div />);
|
|
164
|
-
}
|
|
165
|
-
```
|
|
165
|
+
`react-ui-animate` also provides hooks for handling gestures:
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
- `useDrag`
|
|
168
|
+
- `useMove`
|
|
169
|
+
- `useScroll`
|
|
170
|
+
- `useWheel`
|
|
168
171
|
|
|
169
|
-
|
|
170
|
-
2. The `useMount` hook takes `visible` as an argument and provides animation states for mounting and unmounting.
|
|
171
|
-
3. The `open` function, returned by `useMount`, is used to conditionally render `animate.div` based on the `mounted` boolean and apply the transition animation.
|
|
172
|
+
**Example: `useDrag`**
|
|
172
173
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
### Gestures
|
|
176
|
-
|
|
177
|
-
The `react-ui-animate` library also provides several hooks for handling different types of gestures:
|
|
178
|
-
|
|
179
|
-
1. `useDrag`: Handles drag gestures on elements.
|
|
180
|
-
2. `useMouseMove`: Handles mouse movements.
|
|
181
|
-
3. `useScroll`: Handles scrolling of the document.
|
|
182
|
-
4. `useWheel`: Handles wheel rotation gestures.
|
|
183
|
-
5. `useGesture`: Handles combinations of various gestures.
|
|
184
|
-
|
|
185
|
-
**Example**: `useDrag`
|
|
186
|
-
|
|
187
|
-
Here’s an example of using the useDrag hook to enable drag gestures:
|
|
188
|
-
|
|
189
|
-
```jsx
|
|
174
|
+
```tsx
|
|
175
|
+
import React from 'react';
|
|
190
176
|
import { useValue, animate, useDrag, withSpring } from 'react-ui-animate';
|
|
191
177
|
|
|
192
|
-
export const Draggable = () => {
|
|
193
|
-
const
|
|
178
|
+
export const Draggable: React.FC = () => {
|
|
179
|
+
const ref = useRef(null);
|
|
180
|
+
const [translateX, setTranslateX] = useValue(0);
|
|
194
181
|
|
|
195
|
-
|
|
196
|
-
|
|
182
|
+
useDrag(ref, ({ down, movement }) => {
|
|
183
|
+
setTranslateX(down ? movement.x : withSpring(0));
|
|
197
184
|
});
|
|
198
185
|
|
|
199
186
|
return (
|
|
200
187
|
<animate.div
|
|
201
|
-
{
|
|
188
|
+
ref={ref}
|
|
202
189
|
style={{
|
|
203
190
|
width: 100,
|
|
204
191
|
height: 100,
|
|
205
192
|
backgroundColor: '#3399ff',
|
|
206
|
-
translateX
|
|
193
|
+
translateX,
|
|
207
194
|
}}
|
|
208
195
|
/>
|
|
209
196
|
);
|
|
210
197
|
};
|
|
211
198
|
```
|
|
212
199
|
|
|
213
|
-
In this example, the blue block can be dragged horizontally by clicking and dragging.
|
|
214
|
-
|
|
215
200
|
## Documentation
|
|
216
201
|
|
|
217
|
-
For detailed documentation and examples, visit the official [react-ui-animate documentation](
|
|
202
|
+
For detailed documentation and examples, visit the official [react-ui-animate documentation](https://react-ui-animate.js.org/).
|
|
218
203
|
|
|
219
204
|
## License
|
|
220
205
|
|
package/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-ui-animate",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0-rc.1",
|
|
4
4
|
"description": "React library for gestures and animation",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"react": ">=16.8.0 || >=17.0.0 || >=18.0.0"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@raidipesh78/re-motion": "^
|
|
10
|
+
"@raidipesh78/re-motion": "^5.2.3"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@rollup/plugin-terser": "^0.4.4",
|
|
14
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
15
|
+
"@semantic-release/git": "^10.0.1",
|
|
16
|
+
"@semantic-release/github": "^11.0.3",
|
|
17
|
+
"@semantic-release/npm": "^12.0.2",
|
|
18
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
14
19
|
"@types/jest": "^29.5.12",
|
|
15
20
|
"@types/node": "^20.14.9",
|
|
16
21
|
"@types/react": "^18.3.3",
|
|
@@ -23,16 +28,22 @@
|
|
|
23
28
|
"rimraf": "^6.0.1",
|
|
24
29
|
"rollup": "^4.18.0",
|
|
25
30
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
31
|
+
"semantic-release": "^24.2.6",
|
|
26
32
|
"typescript": "^5.5.2"
|
|
27
33
|
},
|
|
28
34
|
"scripts": {
|
|
29
35
|
"clean": "rimraf -rf dist",
|
|
30
36
|
"build": "npm run clean && rollup -c",
|
|
31
37
|
"start": "npm run clean && rollup -c -w",
|
|
38
|
+
"start:dev": "cd example && npm start",
|
|
32
39
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
33
40
|
"version:minor": "npm version --no-git-tag-version minor",
|
|
34
41
|
"version:major": "npm version --no-git-tag-version major",
|
|
35
|
-
"version:patch": "npm version --no-git-tag-version patch"
|
|
42
|
+
"version:patch": "npm version --no-git-tag-version patch",
|
|
43
|
+
"version:rc": "npm version prerelease --no-git-tag-version --preid=rc",
|
|
44
|
+
"version:prepatch": "npm version prepatch --no-git-tag-version --preid=rc",
|
|
45
|
+
"publish:next": "npm publish --tag next",
|
|
46
|
+
"publish:latest": "npm publish --tag latest"
|
|
36
47
|
},
|
|
37
48
|
"repository": {
|
|
38
49
|
"type": "git",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { withDecay } from './withDecay';
|
|
2
|
-
export { withDelay } from './withDelay';
|
|
3
|
-
export { withSequence } from './withSequence';
|
|
4
|
-
export { withSpring } from './withSpring';
|
|
5
|
-
export { withTiming } from './withTiming';
|
|
6
|
-
export { withLoop } from './withLoop';
|
|
7
|
-
export { withNative } from './withNative';
|
|
8
|
-
export { withEase } from './withEase';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { WithCallbacks } from '../types';
|
|
3
|
-
interface WithDecayConfig extends WithCallbacks {
|
|
4
|
-
velocity?: number;
|
|
5
|
-
deceleration?: number;
|
|
6
|
-
}
|
|
7
|
-
export declare const withDecay: (config?: WithDecayConfig, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
8
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
9
|
-
callback: ((result: any) => void) | undefined;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { WithCallbacks } from '../types';
|
|
2
|
-
interface WithEaseConfig extends WithCallbacks {
|
|
3
|
-
}
|
|
4
|
-
export declare const withEase: (toValue: number, config?: WithEaseConfig, callback?: (result: any) => void) => (value: import("@raidipesh78/re-motion").FluidValue) => {
|
|
5
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
6
|
-
callback: ((result: any) => void) | undefined;
|
|
7
|
-
};
|
|
8
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FluidValue, loop } from '@raidipesh78/re-motion';
|
|
2
|
-
export declare const withLoop: (animations: (value: FluidValue) => {
|
|
3
|
-
controller: ReturnType<typeof loop>;
|
|
4
|
-
callback?: (result: any) => void;
|
|
5
|
-
}, iterations: number, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
6
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
7
|
-
callback: ((result: any) => void) | undefined;
|
|
8
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
export declare const withNative: (toValue: number | string, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
3
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
4
|
-
callback: ((result: any) => void) | undefined;
|
|
5
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FluidValue, sequence } from '@raidipesh78/re-motion';
|
|
2
|
-
export declare const withSequence: (animations: Array<(value: FluidValue) => {
|
|
3
|
-
controller: ReturnType<typeof sequence>;
|
|
4
|
-
callback?: (result: any) => void;
|
|
5
|
-
}>, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
6
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
7
|
-
callback: ((result: any) => void) | undefined;
|
|
8
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { WithCallbacks } from '../types';
|
|
3
|
-
interface WithSpringConfig extends WithCallbacks {
|
|
4
|
-
mass?: number;
|
|
5
|
-
friction?: number;
|
|
6
|
-
tension?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare const withSpring: (toValue: number, config?: WithSpringConfig, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
9
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
10
|
-
callback: ((result: any) => void) | undefined;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { WithCallbacks } from '../types';
|
|
3
|
-
interface WithTimingConfig extends WithCallbacks {
|
|
4
|
-
duration?: number;
|
|
5
|
-
easing?: (t: number) => number;
|
|
6
|
-
}
|
|
7
|
-
export declare const withTiming: (toValue: number, config?: WithTimingConfig, callback?: (result: any) => void) => (value: FluidValue) => {
|
|
8
|
-
controller: import("@raidipesh78/re-motion/dist/controllers/types").ControllerAnimation;
|
|
9
|
-
callback: ((result: any) => void) | undefined;
|
|
10
|
-
};
|
|
11
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Easing } from '@raidipesh78/re-motion';
|
|
2
|
-
export declare const AnimationConfig: {
|
|
3
|
-
Timing: {
|
|
4
|
-
BOUNCE: {
|
|
5
|
-
duration: number;
|
|
6
|
-
easing: typeof Easing.bounce;
|
|
7
|
-
};
|
|
8
|
-
EASE_IN: {
|
|
9
|
-
duration: number;
|
|
10
|
-
easing: (t: number) => number;
|
|
11
|
-
};
|
|
12
|
-
EASE_OUT: {
|
|
13
|
-
duration: number;
|
|
14
|
-
easing: (t: number) => number;
|
|
15
|
-
};
|
|
16
|
-
EASE_IN_OUT: {
|
|
17
|
-
duration: number;
|
|
18
|
-
easing: (t: number) => number;
|
|
19
|
-
};
|
|
20
|
-
POWER1: {
|
|
21
|
-
duration: number;
|
|
22
|
-
easing: (t: number) => number;
|
|
23
|
-
};
|
|
24
|
-
POWER2: {
|
|
25
|
-
duration: number;
|
|
26
|
-
easing: (t: number) => number;
|
|
27
|
-
};
|
|
28
|
-
POWER3: {
|
|
29
|
-
duration: number;
|
|
30
|
-
easing: (t: number) => number;
|
|
31
|
-
};
|
|
32
|
-
POWER4: {
|
|
33
|
-
duration: number;
|
|
34
|
-
easing: (t: number) => number;
|
|
35
|
-
};
|
|
36
|
-
LINEAR: {
|
|
37
|
-
duration: number;
|
|
38
|
-
easing: typeof Easing.linear;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
Spring: {
|
|
42
|
-
ELASTIC: {
|
|
43
|
-
mass: number;
|
|
44
|
-
friction: number;
|
|
45
|
-
tension: number;
|
|
46
|
-
};
|
|
47
|
-
EASE: {
|
|
48
|
-
mass: number;
|
|
49
|
-
friction: number;
|
|
50
|
-
tension: number;
|
|
51
|
-
};
|
|
52
|
-
STIFF: {
|
|
53
|
-
mass: number;
|
|
54
|
-
friction: number;
|
|
55
|
-
tension: number;
|
|
56
|
-
};
|
|
57
|
-
WOBBLE: {
|
|
58
|
-
mass: number;
|
|
59
|
-
friction: number;
|
|
60
|
-
tension: number;
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { ToValue } from '../types';
|
|
3
|
-
export interface UseMountConfig {
|
|
4
|
-
from?: number;
|
|
5
|
-
enter?: ToValue;
|
|
6
|
-
exit?: ToValue;
|
|
7
|
-
}
|
|
8
|
-
export declare const useMount: (state: boolean, config?: UseMountConfig) => (fn: (animation: {
|
|
9
|
-
value: FluidValue;
|
|
10
|
-
}, mounted: boolean) => React.ReactNode) => import("react").ReactNode;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { ToValue } from '../types';
|
|
3
|
-
export declare function useValue(initialValue: number | string): {
|
|
4
|
-
get value(): FluidValue;
|
|
5
|
-
set value(to: number | string | ToValue);
|
|
6
|
-
readonly currentValue: string | number;
|
|
7
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FluidValue } from '@raidipesh78/re-motion';
|
|
2
|
-
import type { ToValue } from '../types';
|
|
3
|
-
export declare function useValues(initialValue: number[] | string[]): {
|
|
4
|
-
get value(): FluidValue[];
|
|
5
|
-
set value(to: number[] | string[] | ToValue[]);
|
|
6
|
-
readonly currentValue: (string | number)[];
|
|
7
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { interpolate, bInterpolate } from './interpolation';
|
|
2
|
-
export { MountedBlock, ScrollableBlock } from './modules';
|
|
3
|
-
export { useValue, useMount, useValues, type UseMountConfig } from './hooks';
|
|
4
|
-
export { withSpring, withTiming, withSequence, withDelay, withDecay, withLoop, withEase, } from './controllers';
|
|
5
|
-
export { AnimationConfig } from './helpers';
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare const COLOR_NUMBER_REGEX: RegExp;
|
|
2
|
-
export declare const HEX_NAME_COLOR: RegExp;
|
|
3
|
-
interface classNameType {
|
|
4
|
-
[name: string]: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const colorNames: classNameType;
|
|
7
|
-
export declare function hexToRgba(hex: string): {
|
|
8
|
-
r: number;
|
|
9
|
-
g: number;
|
|
10
|
-
b: number;
|
|
11
|
-
a: number;
|
|
12
|
-
};
|
|
13
|
-
export declare function rgbaToHex(rgba: {
|
|
14
|
-
r: number;
|
|
15
|
-
g: number;
|
|
16
|
-
b: number;
|
|
17
|
-
a: number;
|
|
18
|
-
}): string;
|
|
19
|
-
export declare function processColor(color: number | string): {
|
|
20
|
-
r: number;
|
|
21
|
-
g: number;
|
|
22
|
-
b: number;
|
|
23
|
-
a: number;
|
|
24
|
-
};
|
|
25
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { interpolate, bInterpolate } from './interpolate';
|