react-useanimations 2.0.3 → 2.0.7
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/index.d.ts +4 -1
- package/index.js +74 -41
- package/lib/behance/behance.json +1 -0
- package/lib/behance/index.d.ts +3 -0
- package/lib/behance/index.js +16 -0
- package/lib/checkmark/checkmark.json +1 -0
- package/lib/checkmark/index.d.ts +3 -0
- package/lib/checkmark/index.js +16 -0
- package/lib/dribbble/dribbble.json +1 -0
- package/lib/dribbble/index.d.ts +3 -0
- package/lib/dribbble/index.js +16 -0
- package/lib/error/error.json +1 -0
- package/lib/error/index.d.ts +3 -0
- package/lib/error/index.js +16 -0
- package/lib/folder/folder.json +1 -0
- package/lib/folder/index.d.ts +3 -0
- package/lib/folder/index.js +16 -0
- package/lib/help/help.json +1 -0
- package/lib/help/index.d.ts +3 -0
- package/lib/help/index.js +16 -0
- package/lib/home/home.json +1 -0
- package/lib/home/index.d.ts +3 -0
- package/lib/home/index.js +16 -0
- package/lib/zoomIn/index.d.ts +3 -0
- package/lib/zoomIn/index.js +16 -0
- package/lib/zoomIn/zoomIn.json +1 -0
- package/lib/zoomOut/index.d.ts +3 -0
- package/lib/zoomOut/index.js +16 -0
- package/lib/zoomOut/zoomOut.json +1 -0
- package/package.json +4 -3
- package/stories/controlled.stories.d.ts +44 -1
- package/stories/controlled.stories.js +165 -3
- package/stories/generated.stories.d.ts +3 -0
- package/stories/generated.stories.js +108 -0
- package/stories/variants.stories.d.ts +54 -3
- package/stories/variants.stories.js +101 -3
- package/typings.d.ts +2 -0
- package/utils/constants.d.ts +1 -1
- package/utils/getEffect.js +10 -1
- package/README.md +0 -86
package/utils/constants.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare type Animation = {
|
|
|
3
3
|
animationData: any;
|
|
4
4
|
animationKey: AnimationKey;
|
|
5
5
|
};
|
|
6
|
-
export declare type AnimationKey = 'activity' | 'airplay' | 'alertCircle' | 'alertOctagon' | 'alertTriangle' | 'archive' | 'arrowDown' | 'arrowDownCircle' | 'arrowLeftCircle' | 'arrowRightCircle' | 'arrowUp' | 'arrowUpCircle' | 'bookmark' | 'calendar' | 'checkBox' | 'codepen' | 'copy' | 'download' | 'edit' | 'explore' | 'facebook' | 'github' | 'heart' | 'infinity' | 'info' | 'instagram' | 'linkedin' | 'loading' | 'loading2' | 'loading3' | 'lock' | 'mail' | 'maximizeMinimize' | 'maximizeMinimize2' | 'menu' | 'menu2' | 'menu3' | 'menu4' | 'microphone' | 'microphone2' | 'notification' | 'notification2' | 'playPause' | 'playPauseCircle' | 'plusToX' | 'pocket' | 'radioButton' | 'scrollDown' | 'searchToX' | 'settings' | 'settings2' | 'share' | 'skipBack' | 'skipForward' | 'star' | 'thumbUp' | 'toggle' | 'trash' | 'trash2' | 'twitter' | 'userMinus' | 'userPlus' | 'userX' | 'video' | 'video2' | 'visibility' | 'visibility2' | 'volume' | 'youtube' | 'youtube2';
|
|
6
|
+
export declare type AnimationKey = 'activity' | 'airplay' | 'alertCircle' | 'alertOctagon' | 'alertTriangle' | 'archive' | 'arrowDown' | 'arrowDownCircle' | 'arrowLeftCircle' | 'arrowRightCircle' | 'arrowUp' | 'arrowUpCircle' | 'bookmark' | 'behance' | 'calendar' | 'checkBox' | 'checkmark' | 'codepen' | 'copy' | 'download' | 'dribbble' | 'edit' | 'error' | 'explore' | 'facebook' | 'folder' | 'github' | 'heart' | 'help' | 'home' | 'infinity' | 'info' | 'instagram' | 'linkedin' | 'loading' | 'loading2' | 'loading3' | 'lock' | 'mail' | 'maximizeMinimize' | 'maximizeMinimize2' | 'menu' | 'menu2' | 'menu3' | 'menu4' | 'microphone' | 'microphone2' | 'notification' | 'notification2' | 'playPause' | 'playPauseCircle' | 'plusToX' | 'pocket' | 'radioButton' | 'scrollDown' | 'searchToX' | 'settings' | 'settings2' | 'share' | 'skipBack' | 'skipForward' | 'star' | 'thumbUp' | 'toggle' | 'trash' | 'trash2' | 'twitter' | 'userMinus' | 'userPlus' | 'userX' | 'video' | 'video2' | 'visibility' | 'visibility2' | 'volume' | 'youtube' | 'youtube2' | 'zoomIn' | 'zoomOut';
|
package/utils/getEffect.js
CHANGED
|
@@ -18,16 +18,23 @@ var animations = {
|
|
|
18
18
|
arrowUp: 'LOOP_PLAY',
|
|
19
19
|
arrowUpCircle: 'CLICK_PLAY_AND_BACKWARDS',
|
|
20
20
|
bookmark: 'CLICK_PLAY_AND_BACKWARDS',
|
|
21
|
+
behance: 'HOVER_PLAY_AND_STOP',
|
|
21
22
|
calendar: 'HOVER_PLAY_AND_STOP',
|
|
22
23
|
checkBox: 'CLICK_PLAY_AND_BACKWARDS',
|
|
24
|
+
checkmark: 'LOOP_PLAY',
|
|
23
25
|
codepen: 'HOVER_PLAY_AND_STOP',
|
|
24
26
|
copy: 'CLICK_PLAY',
|
|
25
27
|
download: 'CLICK_PLAY',
|
|
28
|
+
dribbble: 'HOVER_PLAY_AND_BACKWARDS',
|
|
26
29
|
edit: 'CLICK_PLAY',
|
|
30
|
+
error: 'LOOP_PLAY',
|
|
27
31
|
explore: 'HOVER_PLAY_AND_BACKWARDS',
|
|
28
32
|
facebook: 'HOVER_PLAY_AND_STOP',
|
|
33
|
+
folder: 'HOVER_PLAY_AND_STOP',
|
|
29
34
|
github: 'HOVER_PLAY_AND_STOP',
|
|
35
|
+
help: 'LOOP_PLAY',
|
|
30
36
|
heart: 'CLICK_PLAY_AND_BACKWARDS',
|
|
37
|
+
home: 'HOVER_PLAY_AND_STOP',
|
|
31
38
|
infinity: 'LOOP_PLAY',
|
|
32
39
|
info: 'HOVER_PLAY_AND_BACKWARDS',
|
|
33
40
|
instagram: 'HOVER_PLAY_AND_STOP',
|
|
@@ -74,7 +81,9 @@ var animations = {
|
|
|
74
81
|
visibility2: 'CLICK_PLAY_AND_BACKWARDS',
|
|
75
82
|
volume: 'CLICK_PLAY_AND_BACKWARDS',
|
|
76
83
|
youtube: 'HOVER_PLAY_AND_STOP',
|
|
77
|
-
youtube2: 'HOVER_PLAY_AND_STOP'
|
|
84
|
+
youtube2: 'HOVER_PLAY_AND_STOP',
|
|
85
|
+
zoomIn: 'LOOP_PLAY',
|
|
86
|
+
zoomOut: 'LOOP_PLAY'
|
|
78
87
|
};
|
|
79
88
|
|
|
80
89
|
var getEffect = function getEffect(animationKey) {
|
package/README.md
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
## React UseAnimations Icons
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/react-useanimations) [](https://www.npmjs.com/package/react-useanimations)
|
|
4
|
-
|
|
5
|
-
#### What is react-useanimations?
|
|
6
|
-
|
|
7
|
-
React-useanimations is a collection of free animated open source icons for React.js.
|
|
8
|
-
|
|
9
|
-
#### Collection
|
|
10
|
-
|
|
11
|
-
[https://react.useanimations.com](https://react.useanimations.com/) and play with examples or visit our [Storybook](https://useanimations.github.io/react-useanimations/)
|
|
12
|
-
|
|
13
|
-

|
|
14
|
-
|
|
15
|
-
### Installation
|
|
16
|
-
|
|
17
|
-
Using Yarn:
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
yarn add react-useanimations
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
or using NPM:
|
|
24
|
-
|
|
25
|
-
```
|
|
26
|
-
npm install -S react-useanimations
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
### Usage
|
|
30
|
-
If you still need to use v1, please refer to this README instead - [react-useanimations@v1](https://github.com/useAnimations/react-useanimations/blob/master/README_v1.md)
|
|
31
|
-
|
|
32
|
-
Basic usage
|
|
33
|
-
```javascript
|
|
34
|
-
import React from 'react';
|
|
35
|
-
import UseAnimations from 'react-useanimations';
|
|
36
|
-
// EVERY ANIMATION NEEDS TO BE IMPORTED FIRST -> YOUR BUNDLE WILL INCLUDE ONLY WHAT IT NEEDS
|
|
37
|
-
import github from 'react-useanimations/lib/github'
|
|
38
|
-
|
|
39
|
-
const App = () => <UseAnimations animation={github} />;
|
|
40
|
-
|
|
41
|
-
export default App;
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Icons can be configured with inline props:
|
|
45
|
-
|
|
46
|
-
```javascript
|
|
47
|
-
<UseAnimations animation={github} size={56} wrapperStyle={{ padding: 100 }} />
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
These props are available:
|
|
51
|
-
| Prop | Default | Definition |
|
|
52
|
-
| :------------- | :----------: | -----------: |
|
|
53
|
-
| animation | / | animation file |
|
|
54
|
-
| size | `24` | animation size |
|
|
55
|
-
| strokeColor | `'inherit'` | animation color |
|
|
56
|
-
| wrapperStyle | `{}` | wrapper div styles |
|
|
57
|
-
| pathCss | `''` | css string for the animation path element |
|
|
58
|
-
| reverse | `false` | assing to `true` when eg. checkbox should be checked initally |
|
|
59
|
-
| autoplay | `false`* | false except in animations like loading etc. |
|
|
60
|
-
| loop | `false`* | false except in animations like loading etc. |
|
|
61
|
-
| options | `{}` | provide any other custom options which will override the default ones |
|
|
62
|
-
|
|
63
|
-
<br />
|
|
64
|
-
Controlled Checkbox example
|
|
65
|
-
|
|
66
|
-
```javascript
|
|
67
|
-
export const RadioButton = () => {
|
|
68
|
-
// JUST EXAMPLE - THIS PART OF THE STATE WILL PROBABLY COME FROM A PARENT FORM COMPONENT
|
|
69
|
-
const [checked, setChecked] = useState(true);
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
<div style={{ padding: '20px' }}>
|
|
73
|
-
<span>radioButton</span>
|
|
74
|
-
<UseAnimation
|
|
75
|
-
reverse={checked}
|
|
76
|
-
onClick={() => {
|
|
77
|
-
setChecked(!checked);
|
|
78
|
-
}}
|
|
79
|
-
size={40}
|
|
80
|
-
wrapperStyle={{ marginTop: '5px' }}
|
|
81
|
-
animation={radioButton}
|
|
82
|
-
/>
|
|
83
|
-
</div>
|
|
84
|
-
);
|
|
85
|
-
};
|
|
86
|
-
```
|