react-useanimations 2.0.9-RC → 2.0.9-RC1

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 (355) hide show
  1. package/{src/bin → bin}/addAnimationFiles.sh +0 -0
  2. package/{src/bin → bin}/generateStories.sh +0 -0
  3. package/index.d.ts +19 -0
  4. package/index.js +197 -0
  5. package/{src/lib → lib}/activity/activity.json +0 -0
  6. package/lib/activity/index.d.ts +3 -0
  7. package/lib/activity/index.js +16 -0
  8. package/{src/lib → lib}/airplay/airplay.json +0 -0
  9. package/lib/airplay/index.d.ts +3 -0
  10. package/lib/airplay/index.js +16 -0
  11. package/{src/lib → lib}/alertCircle/alertCircle.json +0 -0
  12. package/lib/alertCircle/index.d.ts +3 -0
  13. package/lib/alertCircle/index.js +16 -0
  14. package/{src/lib → lib}/alertOctagon/alertOctagon.json +0 -0
  15. package/lib/alertOctagon/index.d.ts +3 -0
  16. package/lib/alertOctagon/index.js +16 -0
  17. package/{src/lib → lib}/alertTriangle/alertTriangle.json +0 -0
  18. package/lib/alertTriangle/index.d.ts +3 -0
  19. package/lib/alertTriangle/index.js +16 -0
  20. package/{src/lib → lib}/archive/archive.json +0 -0
  21. package/lib/archive/index.d.ts +3 -0
  22. package/lib/archive/index.js +16 -0
  23. package/{src/lib → lib}/arrowDown/arrowDown.json +0 -0
  24. package/lib/arrowDown/index.d.ts +3 -0
  25. package/lib/arrowDown/index.js +16 -0
  26. package/{src/lib → lib}/arrowDownCircle/arrowDownCircle.json +0 -0
  27. package/lib/arrowDownCircle/index.d.ts +3 -0
  28. package/lib/arrowDownCircle/index.js +16 -0
  29. package/{src/lib → lib}/arrowLeftCircle/arrowLeftCircle.json +0 -0
  30. package/lib/arrowLeftCircle/index.d.ts +3 -0
  31. package/lib/arrowLeftCircle/index.js +16 -0
  32. package/{src/lib → lib}/arrowRightCircle/arrowRightCircle.json +0 -0
  33. package/lib/arrowRightCircle/index.d.ts +3 -0
  34. package/lib/arrowRightCircle/index.js +16 -0
  35. package/{src/lib → lib}/arrowUp/arrowUp.json +0 -0
  36. package/lib/arrowUp/index.d.ts +3 -0
  37. package/lib/arrowUp/index.js +16 -0
  38. package/{src/lib → lib}/arrowUpCircle/arrowUpCircle.json +0 -0
  39. package/lib/arrowUpCircle/index.d.ts +3 -0
  40. package/lib/arrowUpCircle/index.js +16 -0
  41. package/{src/lib → lib}/behance/behance.json +0 -0
  42. package/lib/behance/index.d.ts +3 -0
  43. package/lib/behance/index.js +16 -0
  44. package/{src/lib → lib}/bookmark/bookmark.json +0 -0
  45. package/lib/bookmark/index.d.ts +3 -0
  46. package/lib/bookmark/index.js +16 -0
  47. package/{src/lib → lib}/calendar/calendar.json +0 -0
  48. package/lib/calendar/index.d.ts +3 -0
  49. package/lib/calendar/index.js +16 -0
  50. package/{src/lib → lib}/checkBox/checkBox.json +0 -0
  51. package/lib/checkBox/index.d.ts +3 -0
  52. package/lib/checkBox/index.js +16 -0
  53. package/{src/lib → lib}/checkmark/checkmark.json +0 -0
  54. package/lib/checkmark/index.d.ts +3 -0
  55. package/lib/checkmark/index.js +16 -0
  56. package/{src/lib → lib}/codepen/codepen.json +0 -0
  57. package/lib/codepen/index.d.ts +3 -0
  58. package/lib/codepen/index.js +16 -0
  59. package/{src/lib → lib}/copy/copy.json +0 -0
  60. package/lib/copy/index.d.ts +3 -0
  61. package/lib/copy/index.js +16 -0
  62. package/{src/lib → lib}/download/download.json +0 -0
  63. package/lib/download/index.d.ts +3 -0
  64. package/lib/download/index.js +16 -0
  65. package/{src/lib → lib}/dribbble/dribbble.json +0 -0
  66. package/lib/dribbble/index.d.ts +3 -0
  67. package/lib/dribbble/index.js +16 -0
  68. package/{src/lib → lib}/edit/edit.json +0 -0
  69. package/lib/edit/index.d.ts +3 -0
  70. package/lib/edit/index.js +16 -0
  71. package/{src/lib → lib}/error/error.json +0 -0
  72. package/lib/error/index.d.ts +3 -0
  73. package/lib/error/index.js +16 -0
  74. package/{src/lib → lib}/explore/explore.json +0 -0
  75. package/lib/explore/index.d.ts +3 -0
  76. package/lib/explore/index.js +16 -0
  77. package/{src/lib → lib}/facebook/facebook.json +0 -0
  78. package/lib/facebook/index.d.ts +3 -0
  79. package/lib/facebook/index.js +16 -0
  80. package/{src/lib → lib}/folder/folder.json +0 -0
  81. package/lib/folder/index.d.ts +3 -0
  82. package/lib/folder/index.js +16 -0
  83. package/{src/lib → lib}/github/github.json +0 -0
  84. package/lib/github/index.d.ts +3 -0
  85. package/lib/github/index.js +16 -0
  86. package/{src/lib → lib}/heart/heart.json +0 -0
  87. package/lib/heart/index.d.ts +3 -0
  88. package/lib/heart/index.js +16 -0
  89. package/{src/lib → lib}/help/help.json +0 -0
  90. package/lib/help/index.d.ts +3 -0
  91. package/lib/help/index.js +16 -0
  92. package/{src/lib → lib}/home/home.json +0 -0
  93. package/lib/home/index.d.ts +3 -0
  94. package/lib/home/index.js +16 -0
  95. package/lib/infinity/index.d.ts +3 -0
  96. package/lib/infinity/index.js +16 -0
  97. package/{src/lib → lib}/infinity/infinity.json +0 -0
  98. package/lib/info/index.d.ts +3 -0
  99. package/lib/info/index.js +16 -0
  100. package/{src/lib → lib}/info/info.json +0 -0
  101. package/lib/instagram/index.d.ts +3 -0
  102. package/lib/instagram/index.js +16 -0
  103. package/{src/lib → lib}/instagram/instagram.json +0 -0
  104. package/lib/linkedin/index.d.ts +3 -0
  105. package/lib/linkedin/index.js +16 -0
  106. package/{src/lib → lib}/linkedin/linkedin.json +0 -0
  107. package/lib/loading/index.d.ts +3 -0
  108. package/lib/loading/index.js +16 -0
  109. package/{src/lib → lib}/loading/loading.json +0 -0
  110. package/lib/loading2/index.d.ts +3 -0
  111. package/lib/loading2/index.js +16 -0
  112. package/{src/lib → lib}/loading2/loading2.json +0 -0
  113. package/lib/loading3/index.d.ts +3 -0
  114. package/lib/loading3/index.js +16 -0
  115. package/{src/lib → lib}/loading3/loading3.json +0 -0
  116. package/lib/lock/index.d.ts +3 -0
  117. package/lib/lock/index.js +16 -0
  118. package/{src/lib → lib}/lock/lock.json +0 -0
  119. package/lib/mail/index.d.ts +3 -0
  120. package/lib/mail/index.js +16 -0
  121. package/{src/lib → lib}/mail/mail.json +0 -0
  122. package/lib/maximizeMinimize/index.d.ts +3 -0
  123. package/lib/maximizeMinimize/index.js +16 -0
  124. package/{src/lib → lib}/maximizeMinimize/maximizeMinimize.json +0 -0
  125. package/lib/maximizeMinimize2/index.d.ts +3 -0
  126. package/lib/maximizeMinimize2/index.js +16 -0
  127. package/{src/lib → lib}/maximizeMinimize2/maximizeMinimize2.json +0 -0
  128. package/lib/menu/index.d.ts +3 -0
  129. package/lib/menu/index.js +16 -0
  130. package/{src/lib → lib}/menu/menu.json +0 -0
  131. package/lib/menu2/index.d.ts +3 -0
  132. package/lib/menu2/index.js +16 -0
  133. package/{src/lib → lib}/menu2/menu2.json +0 -0
  134. package/lib/menu3/index.d.ts +3 -0
  135. package/lib/menu3/index.js +16 -0
  136. package/{src/lib → lib}/menu3/menu3.json +0 -0
  137. package/lib/menu4/index.d.ts +3 -0
  138. package/lib/menu4/index.js +16 -0
  139. package/{src/lib → lib}/menu4/menu4.json +0 -0
  140. package/lib/microphone/index.d.ts +3 -0
  141. package/lib/microphone/index.js +16 -0
  142. package/{src/lib → lib}/microphone/microphone.json +0 -0
  143. package/lib/microphone2/index.d.ts +3 -0
  144. package/lib/microphone2/index.js +16 -0
  145. package/{src/lib → lib}/microphone2/microphone2.json +0 -0
  146. package/lib/notification/index.d.ts +3 -0
  147. package/lib/notification/index.js +16 -0
  148. package/{src/lib → lib}/notification/notification.json +0 -0
  149. package/lib/notification2/index.d.ts +3 -0
  150. package/lib/notification2/index.js +16 -0
  151. package/{src/lib → lib}/notification2/notification2.json +0 -0
  152. package/lib/playPause/index.d.ts +3 -0
  153. package/lib/playPause/index.js +16 -0
  154. package/{src/lib → lib}/playPause/playPause.json +0 -0
  155. package/lib/playPauseCircle/index.d.ts +3 -0
  156. package/lib/playPauseCircle/index.js +16 -0
  157. package/{src/lib → lib}/playPauseCircle/playPauseCircle.json +0 -0
  158. package/lib/plusToX/index.d.ts +3 -0
  159. package/lib/plusToX/index.js +16 -0
  160. package/{src/lib → lib}/plusToX/plusToX.json +0 -0
  161. package/lib/pocket/index.d.ts +3 -0
  162. package/lib/pocket/index.js +16 -0
  163. package/{src/lib → lib}/pocket/pocket.json +0 -0
  164. package/lib/radioButton/index.d.ts +3 -0
  165. package/lib/radioButton/index.js +16 -0
  166. package/{src/lib → lib}/radioButton/radioButton.json +0 -0
  167. package/lib/scrollDown/index.d.ts +3 -0
  168. package/lib/scrollDown/index.js +16 -0
  169. package/{src/lib → lib}/scrollDown/scrollDown.json +0 -0
  170. package/lib/searchToX/index.d.ts +3 -0
  171. package/lib/searchToX/index.js +16 -0
  172. package/{src/lib → lib}/searchToX/searchToX.json +0 -0
  173. package/lib/settings/index.d.ts +3 -0
  174. package/lib/settings/index.js +16 -0
  175. package/{src/lib → lib}/settings/settings.json +0 -0
  176. package/lib/settings2/index.d.ts +3 -0
  177. package/lib/settings2/index.js +16 -0
  178. package/{src/lib → lib}/settings2/settings2.json +0 -0
  179. package/lib/share/index.d.ts +3 -0
  180. package/lib/share/index.js +16 -0
  181. package/{src/lib → lib}/share/share.json +0 -0
  182. package/lib/skipBack/index.d.ts +3 -0
  183. package/lib/skipBack/index.js +16 -0
  184. package/{src/lib → lib}/skipBack/skipBack.json +0 -0
  185. package/lib/skipForward/index.d.ts +3 -0
  186. package/lib/skipForward/index.js +16 -0
  187. package/{src/lib → lib}/skipForward/skipForward.json +0 -0
  188. package/lib/star/index.d.ts +3 -0
  189. package/lib/star/index.js +16 -0
  190. package/{src/lib → lib}/star/star.json +0 -0
  191. package/lib/thumbUp/index.d.ts +3 -0
  192. package/lib/thumbUp/index.js +16 -0
  193. package/{src/lib → lib}/thumbUp/thumbUp.json +0 -0
  194. package/lib/toggle/index.d.ts +3 -0
  195. package/lib/toggle/index.js +16 -0
  196. package/{src/lib → lib}/toggle/toggle.json +0 -0
  197. package/lib/trash/index.d.ts +3 -0
  198. package/lib/trash/index.js +16 -0
  199. package/{src/lib → lib}/trash/trash.json +0 -0
  200. package/lib/trash2/index.d.ts +3 -0
  201. package/lib/trash2/index.js +16 -0
  202. package/{src/lib → lib}/trash2/trash2.json +0 -0
  203. package/lib/twitter/index.d.ts +3 -0
  204. package/lib/twitter/index.js +16 -0
  205. package/{src/lib → lib}/twitter/twitter.json +0 -0
  206. package/lib/userMinus/index.d.ts +3 -0
  207. package/lib/userMinus/index.js +16 -0
  208. package/{src/lib → lib}/userMinus/userMinus.json +0 -0
  209. package/lib/userPlus/index.d.ts +3 -0
  210. package/lib/userPlus/index.js +16 -0
  211. package/{src/lib → lib}/userPlus/userPlus.json +0 -0
  212. package/lib/userX/index.d.ts +3 -0
  213. package/lib/userX/index.js +16 -0
  214. package/{src/lib → lib}/userX/userX.json +0 -0
  215. package/lib/video/index.d.ts +3 -0
  216. package/lib/video/index.js +16 -0
  217. package/{src/lib → lib}/video/video.json +0 -0
  218. package/lib/video2/index.d.ts +3 -0
  219. package/lib/video2/index.js +16 -0
  220. package/{src/lib → lib}/video2/video2.json +0 -0
  221. package/lib/visibility/index.d.ts +3 -0
  222. package/lib/visibility/index.js +16 -0
  223. package/{src/lib → lib}/visibility/visibility.json +0 -0
  224. package/lib/visibility2/index.d.ts +3 -0
  225. package/lib/visibility2/index.js +16 -0
  226. package/{src/lib → lib}/visibility2/visibility2.json +0 -0
  227. package/lib/volume/index.d.ts +3 -0
  228. package/lib/volume/index.js +16 -0
  229. package/{src/lib → lib}/volume/volume.json +0 -0
  230. package/lib/youtube/index.d.ts +3 -0
  231. package/lib/youtube/index.js +16 -0
  232. package/{src/lib → lib}/youtube/youtube.json +0 -0
  233. package/lib/youtube2/index.d.ts +3 -0
  234. package/lib/youtube2/index.js +16 -0
  235. package/{src/lib → lib}/youtube2/youtube2.json +0 -0
  236. package/lib/zoomIn/index.d.ts +3 -0
  237. package/lib/zoomIn/index.js +16 -0
  238. package/{src/lib → lib}/zoomIn/zoomIn.json +0 -0
  239. package/lib/zoomOut/index.d.ts +3 -0
  240. package/lib/zoomOut/index.js +16 -0
  241. package/{src/lib → lib}/zoomOut/zoomOut.json +0 -0
  242. package/package.json +5 -2
  243. package/stories/controlled.stories.d.ts +60 -0
  244. package/stories/controlled.stories.js +231 -0
  245. package/stories/generated.stories.d.ts +20 -0
  246. package/stories/generated.stories.js +977 -0
  247. package/stories/variants.stories.d.ts +70 -0
  248. package/stories/variants.stories.js +196 -0
  249. package/{src/typings.d.ts → typings.d.ts} +0 -0
  250. package/utils/constants.d.ts +6 -0
  251. package/utils/constants.js +1 -0
  252. package/utils/getEffect.d.ts +3 -0
  253. package/{src/utils/getEffect.ts → utils/getEffect.js} +12 -9
  254. package/utils/getEvents.d.ts +12 -0
  255. package/utils/getEvents.js +96 -0
  256. package/{src/utils/index.ts → utils/index.d.ts} +0 -0
  257. package/utils/index.js +23 -0
  258. package/.babelrc +0 -4
  259. package/.editorconfig +0 -15
  260. package/.eslintignore +0 -2
  261. package/.eslintrc.json +0 -31
  262. package/.gitattributes +0 -1
  263. package/.prettierrc +0 -10
  264. package/.storybook/main.js +0 -15
  265. package/.vscode/settings.json +0 -5
  266. package/LICENSE +0 -30
  267. package/README.md +0 -110
  268. package/README_v1.md +0 -46
  269. package/src/index.tsx +0 -177
  270. package/src/lib/activity/index.ts +0 -4
  271. package/src/lib/airplay/index.ts +0 -4
  272. package/src/lib/alertCircle/index.ts +0 -4
  273. package/src/lib/alertOctagon/index.ts +0 -4
  274. package/src/lib/alertTriangle/index.ts +0 -4
  275. package/src/lib/archive/index.ts +0 -4
  276. package/src/lib/arrowDown/index.ts +0 -4
  277. package/src/lib/arrowDownCircle/index.ts +0 -4
  278. package/src/lib/arrowLeftCircle/index.ts +0 -4
  279. package/src/lib/arrowRightCircle/index.ts +0 -4
  280. package/src/lib/arrowUp/index.ts +0 -4
  281. package/src/lib/arrowUpCircle/index.ts +0 -4
  282. package/src/lib/behance/index.ts +0 -4
  283. package/src/lib/bookmark/index.ts +0 -4
  284. package/src/lib/calendar/index.ts +0 -4
  285. package/src/lib/checkBox/index.ts +0 -4
  286. package/src/lib/checkmark/index.ts +0 -4
  287. package/src/lib/codepen/index.ts +0 -4
  288. package/src/lib/copy/index.ts +0 -4
  289. package/src/lib/download/index.ts +0 -4
  290. package/src/lib/dribbble/index.ts +0 -4
  291. package/src/lib/edit/index.ts +0 -4
  292. package/src/lib/error/index.ts +0 -4
  293. package/src/lib/explore/index.ts +0 -4
  294. package/src/lib/facebook/index.ts +0 -4
  295. package/src/lib/folder/index.ts +0 -4
  296. package/src/lib/github/index.ts +0 -4
  297. package/src/lib/heart/index.ts +0 -4
  298. package/src/lib/help/index.ts +0 -4
  299. package/src/lib/home/index.ts +0 -4
  300. package/src/lib/infinity/index.ts +0 -4
  301. package/src/lib/info/index.ts +0 -4
  302. package/src/lib/instagram/index.ts +0 -4
  303. package/src/lib/linkedin/index.ts +0 -4
  304. package/src/lib/loading/index.ts +0 -4
  305. package/src/lib/loading2/index.ts +0 -4
  306. package/src/lib/loading3/index.ts +0 -4
  307. package/src/lib/lock/index.ts +0 -4
  308. package/src/lib/mail/index.ts +0 -4
  309. package/src/lib/maximizeMinimize/index.ts +0 -4
  310. package/src/lib/maximizeMinimize2/index.ts +0 -4
  311. package/src/lib/menu/index.ts +0 -4
  312. package/src/lib/menu2/index.ts +0 -4
  313. package/src/lib/menu3/index.ts +0 -4
  314. package/src/lib/menu4/index.ts +0 -4
  315. package/src/lib/microphone/index.ts +0 -4
  316. package/src/lib/microphone2/index.ts +0 -4
  317. package/src/lib/notification/index.ts +0 -4
  318. package/src/lib/notification2/index.ts +0 -4
  319. package/src/lib/playPause/index.ts +0 -4
  320. package/src/lib/playPauseCircle/index.ts +0 -4
  321. package/src/lib/plusToX/index.ts +0 -4
  322. package/src/lib/pocket/index.ts +0 -4
  323. package/src/lib/radioButton/index.ts +0 -4
  324. package/src/lib/scrollDown/index.ts +0 -4
  325. package/src/lib/searchToX/index.ts +0 -4
  326. package/src/lib/settings/index.ts +0 -4
  327. package/src/lib/settings2/index.ts +0 -4
  328. package/src/lib/share/index.ts +0 -4
  329. package/src/lib/skipBack/index.ts +0 -4
  330. package/src/lib/skipForward/index.ts +0 -4
  331. package/src/lib/star/index.ts +0 -4
  332. package/src/lib/thumbUp/index.ts +0 -4
  333. package/src/lib/toggle/index.ts +0 -4
  334. package/src/lib/trash/index.ts +0 -4
  335. package/src/lib/trash2/index.ts +0 -4
  336. package/src/lib/twitter/index.ts +0 -4
  337. package/src/lib/userMinus/index.ts +0 -4
  338. package/src/lib/userPlus/index.ts +0 -4
  339. package/src/lib/userX/index.ts +0 -4
  340. package/src/lib/video/index.ts +0 -4
  341. package/src/lib/video2/index.ts +0 -4
  342. package/src/lib/visibility/index.ts +0 -4
  343. package/src/lib/visibility2/index.ts +0 -4
  344. package/src/lib/volume/index.ts +0 -4
  345. package/src/lib/youtube/index.ts +0 -4
  346. package/src/lib/youtube2/index.ts +0 -4
  347. package/src/lib/zoomIn/index.ts +0 -4
  348. package/src/lib/zoomOut/index.ts +0 -4
  349. package/src/stories/controlled.stories.tsx +0 -257
  350. package/src/stories/generated.stories.tsx +0 -406
  351. package/src/stories/variants.stories.tsx +0 -237
  352. package/src/utils/constants.ts +0 -93
  353. package/src/utils/getEvents.ts +0 -81
  354. package/tsconfig.json +0 -67
  355. package/useanimations-preview.gif +0 -0
package/README.md DELETED
@@ -1,110 +0,0 @@
1
- ## React UseAnimations Icons
2
-
3
- [![npm version](https://img.shields.io/npm/v/react-useanimations.svg?style=flat-square)](https://www.npmjs.com/package/react-useanimations) [![npm downloads](https://img.shields.io/npm/dm/react-useanimations.svg?style=flat-square)](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
- ![](useanimations-preview.gif)
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 stroke color |
56
- | fillColor | `''` | animation fill color
57
- | wrapperStyle | `{}` | wrapper div styles |
58
- | pathCss | `''` | css string for the animation path element |
59
- | reverse | `false` | assing to `true` when eg. checkbox should be checked initally |
60
- | autoplay | `false`* | false except in animations like loading etc. |
61
- | loop | `false`* | false except in animations like loading etc. |
62
- | options | `{}` | provide any other custom options which will override the default ones |
63
- | speed | `1` | a number to determine the speed of lottie(1 is normal speed) |
64
-
65
- <br />
66
- Controlled checkbox example
67
-
68
- ```javascript
69
- export const RadioButton = () => {
70
- // JUST EXAMPLE - THIS PART OF THE STATE WILL PROBABLY COME FROM A PARENT FORM COMPONENT
71
- const [checked, setChecked] = useState(true);
72
-
73
- return (
74
- <div style={{ padding: '20px' }}>
75
- <span>radioButton</span>
76
- <UseAnimation
77
- reverse={checked}
78
- onClick={() => {
79
- setChecked(!checked);
80
- }}
81
- size={40}
82
- wrapperStyle={{ marginTop: '5px' }}
83
- animation={radioButton}
84
- />
85
- </div>
86
- );
87
- };
88
- ```
89
-
90
- Animation wrapped in element (use render prop).
91
- ```javascript
92
- export const WrapperElement = () => {
93
- return (
94
- <UseAnimation
95
- animation={heart}
96
- size={60}
97
- onClick={() => {
98
- // eslint-disable-next-line
99
- console.log('additional onClick cb is working');
100
- }}
101
- render={(eventProps, animationProps) => (
102
- <button style={{ padding: '20px' }} type="button" {...eventProps}>
103
- <div {...animationProps} />
104
- </button>
105
- )}
106
- />
107
- );
108
- };
109
- ```
110
- Note that `eventProps` consists of `onClick`, `mouseOver` and other DOM events which you probably want to assign to your wrapping element (e.g. Button) and `animationProps` consist of an actual animation which you should spread inside a simple `<div>`
package/README_v1.md DELETED
@@ -1,46 +0,0 @@
1
- ## React UseAnimations Icons
2
-
3
- [![npm version](https://img.shields.io/npm/v/react-useanimations.svg?style=flat-square)](https://www.npmjs.com/package/react-useanimations) [![npm downloads](https://img.shields.io/npm/dm/react-useanimations.svg?style=flat-square)](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.
12
-
13
- ![](useanimations-preview.gif)
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 react-useanimations
27
- ```
28
-
29
- ### Usage
30
- This is README for v1, consider upgrading to v2, it will improve your performance - [react-useanimations@v1](https://github.com/useAnimations/react-useanimations/blob/master/README.md)
31
-
32
- Basic Usage
33
- ```javascript
34
- import React from 'react';
35
- import UseAnimations from 'react-useanimations';
36
-
37
- const App = () => <UseAnimations animationKey="github" />;
38
-
39
- export default App;
40
- ```
41
-
42
- Icons can be configured with inline props:
43
-
44
- ```javascript
45
- <UseAnimations animationKey="alert" size={56} style={{ padding: 100 }} />
46
- ```
package/src/index.tsx DELETED
@@ -1,177 +0,0 @@
1
- /* eslint-disable react/require-default-props */
2
- import React, { useState, useEffect, useRef, ReactElement } from 'react';
3
- // UNFORTUNATELY WHEN LIGHT VERSION IS USED, SOME ANIMATIONS ARE NOT WORKING AS EXPECTED
4
- // import lottie from 'lottie-web/build/player/lottie_light';
5
- import lottie from 'lottie-web';
6
- import type { AnimationItem, AnimationConfigWithData, AnimationConfig } from 'lottie-web';
7
-
8
- import { getEffect, getEvents } from './utils';
9
- import type { Animation, AnimationEffect } from './utils';
10
-
11
- const getRandomId = (key: Animation['animationKey']) =>
12
- `${key}_i${Math.floor(Math.random() * 10000 + 1)}`;
13
-
14
- type Props = {
15
- animation: Animation;
16
- reverse?: boolean;
17
- strokeColor?: string;
18
- fillColor?: string;
19
- pathCss?: string;
20
- options?: Partial<AnimationConfig>;
21
- size?: number;
22
- loop?: AnimationConfig['loop'];
23
- autoplay?: AnimationConfig['autoplay'];
24
- speed?: number;
25
- wrapperStyle?: React.CSSProperties;
26
- render?: (eventProps: any, animationProps: any) => ReactElement;
27
- } & React.HTMLProps<HTMLDivElement>;
28
-
29
- const UseAnimations: React.FC<Props> = ({
30
- animation: { animationData, animationKey },
31
- reverse = false,
32
- size = 24,
33
- speed = 1,
34
- strokeColor,
35
- fillColor,
36
- pathCss,
37
- loop,
38
- autoplay,
39
- wrapperStyle,
40
- options,
41
- onClick,
42
- render,
43
- ...other
44
- }) => {
45
- const [animation, setAnimation] = useState<AnimationItem>();
46
- const [animationId] = useState<string>(getRandomId(animationKey));
47
- const [events, setEvents] = useState<any>({});
48
- const ref = useRef<HTMLDivElement>(null);
49
-
50
- const defaultStyles = {
51
- overflow: 'hidden',
52
- outline: 'none',
53
- width: `${size}px`,
54
- height: `${size}px`,
55
- ...wrapperStyle,
56
- };
57
-
58
- // INVOKE THE LOTTIE ANIMATION
59
- useEffect(() => {
60
- const animEffect: AnimationEffect = getEffect(animationKey);
61
-
62
- const defaultOptions: AnimationConfigWithData = {
63
- container: ref.current as Element,
64
- renderer: 'svg',
65
- animationData,
66
- loop: loop || animEffect === 'LOOP_PLAY',
67
- autoplay: autoplay || animEffect === 'LOOP_PLAY',
68
- rendererSettings: {
69
- // LOADS DOM ELEMENTS WHEN NEEDED. MIGHT SPEED UP INITIALIZATION FOR LARGE NUMBER OF ELEMENTS.
70
- progressiveLoad: true,
71
- // lottie-web missing id type
72
- // @ts-ignore-next-line
73
- id: animationId,
74
- },
75
- ...options,
76
- };
77
-
78
- setAnimation(lottie.loadAnimation(defaultOptions));
79
-
80
- return () => {
81
- animation?.destroy();
82
- setAnimation(undefined);
83
- };
84
- }, []);
85
-
86
- // HANDLE STYLING FOR ANIMATION
87
- useEffect(() => {
88
- if (strokeColor || fillColor || pathCss) {
89
- try {
90
- const css = `#${animationId} path { ${strokeColor ? `stroke: ${strokeColor};` : ''} ${
91
- fillColor ? `fill: ${fillColor};` : ''
92
- } ${pathCss || ''}}`;
93
- let sheetEl: any = document.getElementById('useAnimationsSheet');
94
-
95
- // STYLESHEET HASN'T BEEN CREATED YET
96
- if (!sheetEl) {
97
- sheetEl = document.createElement('style');
98
- sheetEl.setAttribute('id', 'useAnimationsSheet');
99
- sheetEl.appendChild(document.createTextNode(''));
100
- document.head.appendChild(sheetEl);
101
- }
102
-
103
- const sheet = sheetEl ? sheetEl.sheet || sheetEl.styleSheet : null;
104
- sheet.insertRule(css);
105
- } catch (err) {
106
- // eslint-disable-next-line
107
- console.warn(
108
- `There's been a problem with deleting a CSSRule, please report that issue in https://github.com/useAnimations/react-useanimations`,
109
- err
110
- );
111
- }
112
- }
113
-
114
- return () => {
115
- // DELETE CSS RULE
116
- try {
117
- const sheetEl: any = document.getElementById('useAnimationsSheet');
118
- const sheet = sheetEl ? sheetEl.sheet || sheetEl.styleSheet : null;
119
-
120
- if (sheet) {
121
- const animationRuleIndex = Array.from(sheet.cssRules).findIndex(
122
- (rule: any) => rule.selectorText === `#${animationId} path`
123
- );
124
-
125
- if (animationRuleIndex !== -1) {
126
- sheet.deleteRule(animationRuleIndex);
127
- }
128
- }
129
- } catch (err) {
130
- // eslint-disable-next-line
131
- console.warn(
132
- `There's been a problem with deleting a CSSRule, please report that issue in https://github.com/useAnimations/react-useanimations`,
133
- err
134
- );
135
- }
136
- };
137
- }, [strokeColor, fillColor, pathCss]);
138
-
139
- // SET NAVIGATION EVENTS
140
- useEffect(() => {
141
- // eslint-disable-next-line
142
- const events = animation
143
- ? getEvents({
144
- animation,
145
- reverse,
146
- animEffect: getEffect(animationKey),
147
- })
148
- : undefined;
149
-
150
- if (events) setEvents(events);
151
- }, [animation, reverse]);
152
-
153
- // SET ANIMATION SPEED
154
- useEffect(() => {
155
- if (animation) {
156
- animation.setSpeed(speed);
157
- }
158
- }, [animation, speed]);
159
-
160
- const eventProps = {
161
- ...events,
162
- onClick: (e: React.MouseEvent<HTMLDivElement>) => {
163
- if (onClick) onClick(e);
164
- if (events && 'onClick' in events) events.onClick();
165
- },
166
- };
167
-
168
- const animationProps = {
169
- ref,
170
- ...other,
171
- style: defaultStyles,
172
- };
173
-
174
- return render ? render(eventProps, animationProps) : <div {...eventProps} {...animationProps} />;
175
- };
176
-
177
- export default UseAnimations;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import activity from './activity.json';
3
-
4
- export default { animationData: activity, animationKey: 'activity' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import airplay from './airplay.json';
3
-
4
- export default { animationData: airplay, animationKey: 'airplay' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import alertCircle from './alertCircle.json';
3
-
4
- export default { animationData: alertCircle, animationKey: 'alertCircle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import alertOctagon from './alertOctagon.json';
3
-
4
- export default { animationData: alertOctagon, animationKey: 'alertOctagon' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import alertTriangle from './alertTriangle.json';
3
-
4
- export default { animationData: alertTriangle, animationKey: 'alertTriangle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import archive from './archive.json';
3
-
4
- export default { animationData: archive, animationKey: 'archive' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowDown from './arrowDown.json';
3
-
4
- export default { animationData: arrowDown, animationKey: 'arrowDown' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowDownCircle from './arrowDownCircle.json';
3
-
4
- export default { animationData: arrowDownCircle, animationKey: 'arrowDownCircle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowLeftCircle from './arrowLeftCircle.json';
3
-
4
- export default { animationData: arrowLeftCircle, animationKey: 'arrowLeftCircle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowRightCircle from './arrowRightCircle.json';
3
-
4
- export default { animationData: arrowRightCircle, animationKey: 'arrowRightCircle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowUp from './arrowUp.json';
3
-
4
- export default { animationData: arrowUp, animationKey: 'arrowUp' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import arrowUpCircle from './arrowUpCircle.json';
3
-
4
- export default { animationData: arrowUpCircle, animationKey: 'arrowUpCircle' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import behance from './behance.json';
3
-
4
- export default { animationData: behance, animationKey: 'behance' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import bookmark from './bookmark.json';
3
-
4
- export default { animationData: bookmark, animationKey: 'bookmark' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import calendar from './calendar.json';
3
-
4
- export default { animationData: calendar, animationKey: 'calendar' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import checkBox from './checkBox.json';
3
-
4
- export default { animationData: checkBox, animationKey: 'checkBox' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import checkmark from './checkmark.json';
3
-
4
- export default { animationData: checkmark, animationKey: 'checkmark' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import codepen from './codepen.json';
3
-
4
- export default { animationData: codepen, animationKey: 'codepen' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import copy from './copy.json';
3
-
4
- export default { animationData: copy, animationKey: 'copy' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import download from './download.json';
3
-
4
- export default { animationData: download, animationKey: 'download' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import dribbble from './dribbble.json';
3
-
4
- export default { animationData: dribbble, animationKey: 'dribbble' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import edit from './edit.json';
3
-
4
- export default { animationData: edit, animationKey: 'edit' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import error from './error.json';
3
-
4
- export default { animationData: error, animationKey: 'error' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import explore from './explore.json';
3
-
4
- export default { animationData: explore, animationKey: 'explore' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import facebook from './facebook.json';
3
-
4
- export default { animationData: facebook, animationKey: 'facebook' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import folder from './folder.json';
3
-
4
- export default { animationData: folder, animationKey: 'folder' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import github from './github.json';
3
-
4
- export default { animationData: github, animationKey: 'github' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import heart from './heart.json';
3
-
4
- export default { animationData: heart, animationKey: 'heart' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import help from './help.json';
3
-
4
- export default { animationData: help, animationKey: 'help' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import home from './home.json';
3
-
4
- export default { animationData: home, animationKey: 'home' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import infinity from './infinity.json';
3
-
4
- export default { animationData: infinity, animationKey: 'infinity' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import info from './info.json';
3
-
4
- export default { animationData: info, animationKey: 'info' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import instagram from './instagram.json';
3
-
4
- export default { animationData: instagram, animationKey: 'instagram' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import linkedin from './linkedin.json';
3
-
4
- export default { animationData: linkedin, animationKey: 'linkedin' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import loading from './loading.json';
3
-
4
- export default { animationData: loading, animationKey: 'loading' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import loading2 from './loading2.json';
3
-
4
- export default { animationData: loading2, animationKey: 'loading2' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import loading3 from './loading3.json';
3
-
4
- export default { animationData: loading3, animationKey: 'loading3' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import lock from './lock.json';
3
-
4
- export default { animationData: lock, animationKey: 'lock' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import mail from './mail.json';
3
-
4
- export default { animationData: mail, animationKey: 'mail' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import maximizeMinimize from './maximizeMinimize.json';
3
-
4
- export default { animationData: maximizeMinimize, animationKey: 'maximizeMinimize' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import maximizeMinimize2 from './maximizeMinimize2.json';
3
-
4
- export default { animationData: maximizeMinimize2, animationKey: 'maximizeMinimize2' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import menu from './menu.json';
3
-
4
- export default { animationData: menu, animationKey: 'menu' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import menu2 from './menu2.json';
3
-
4
- export default { animationData: menu2, animationKey: 'menu2' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import menu3 from './menu3.json';
3
-
4
- export default { animationData: menu3, animationKey: 'menu3' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import menu4 from './menu4.json';
3
-
4
- export default { animationData: menu4, animationKey: 'menu4' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import microphone from './microphone.json';
3
-
4
- export default { animationData: microphone, animationKey: 'microphone' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import microphone2 from './microphone2.json';
3
-
4
- export default { animationData: microphone2, animationKey: 'microphone2' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import notification from './notification.json';
3
-
4
- export default { animationData: notification, animationKey: 'notification' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import notification2 from './notification2.json';
3
-
4
- export default { animationData: notification2, animationKey: 'notification2' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import playPause from './playPause.json';
3
-
4
- export default { animationData: playPause, animationKey: 'playPause' } as Animation;
@@ -1,4 +0,0 @@
1
- import type { Animation } from '../../utils/constants';
2
- import playPauseCircle from './playPauseCircle.json';
3
-
4
- export default { animationData: playPauseCircle, animationKey: 'playPauseCircle' } as Animation;