react-useanimations 2.0.9 → 3.0.0-beta.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.
Files changed (534) hide show
  1. package/README.md +112 -67
  2. package/index.d.mts +144 -0
  3. package/index.d.ts +144 -0
  4. package/index.js +288 -0
  5. package/index.mjs +258 -0
  6. package/lib/activity/index.d.mts +5 -0
  7. package/lib/activity/index.d.ts +5 -0
  8. package/lib/activity/index.js +32 -0
  9. package/lib/activity/index.mjs +9 -0
  10. package/lib/airplay/index.d.mts +5 -0
  11. package/lib/airplay/index.d.ts +5 -0
  12. package/lib/airplay/index.js +32 -0
  13. package/lib/airplay/index.mjs +9 -0
  14. package/lib/alertCircle/index.d.mts +5 -0
  15. package/lib/alertCircle/index.d.ts +5 -0
  16. package/lib/alertCircle/index.js +32 -0
  17. package/lib/alertCircle/index.mjs +9 -0
  18. package/lib/alertOctagon/index.d.mts +5 -0
  19. package/lib/alertOctagon/index.d.ts +5 -0
  20. package/lib/alertOctagon/index.js +32 -0
  21. package/lib/alertOctagon/index.mjs +9 -0
  22. package/lib/alertTriangle/index.d.mts +5 -0
  23. package/lib/alertTriangle/index.d.ts +5 -0
  24. package/lib/alertTriangle/index.js +32 -0
  25. package/lib/alertTriangle/index.mjs +9 -0
  26. package/lib/archive/index.d.mts +5 -0
  27. package/lib/archive/index.d.ts +5 -0
  28. package/lib/archive/index.js +32 -0
  29. package/lib/archive/index.mjs +9 -0
  30. package/lib/arrowDown/index.d.mts +5 -0
  31. package/lib/arrowDown/index.d.ts +5 -0
  32. package/lib/arrowDown/index.js +32 -0
  33. package/lib/arrowDown/index.mjs +9 -0
  34. package/lib/arrowDownCircle/index.d.mts +5 -0
  35. package/lib/arrowDownCircle/index.d.ts +5 -0
  36. package/lib/arrowDownCircle/index.js +32 -0
  37. package/lib/arrowDownCircle/index.mjs +9 -0
  38. package/lib/arrowLeftCircle/index.d.mts +5 -0
  39. package/lib/arrowLeftCircle/index.d.ts +5 -0
  40. package/lib/arrowLeftCircle/index.js +32 -0
  41. package/lib/arrowLeftCircle/index.mjs +9 -0
  42. package/lib/arrowRightCircle/index.d.mts +5 -0
  43. package/lib/arrowRightCircle/index.d.ts +5 -0
  44. package/lib/arrowRightCircle/index.js +32 -0
  45. package/lib/arrowRightCircle/index.mjs +9 -0
  46. package/lib/arrowUp/index.d.mts +5 -0
  47. package/lib/arrowUp/index.d.ts +5 -0
  48. package/lib/arrowUp/index.js +32 -0
  49. package/lib/arrowUp/index.mjs +9 -0
  50. package/lib/arrowUpCircle/index.d.mts +5 -0
  51. package/lib/arrowUpCircle/index.d.ts +5 -0
  52. package/lib/arrowUpCircle/index.js +32 -0
  53. package/lib/arrowUpCircle/index.mjs +9 -0
  54. package/lib/behance/index.d.mts +5 -0
  55. package/lib/behance/index.d.ts +5 -0
  56. package/lib/behance/index.js +32 -0
  57. package/lib/behance/index.mjs +9 -0
  58. package/lib/bookmark/index.d.mts +5 -0
  59. package/lib/bookmark/index.d.ts +5 -0
  60. package/lib/bookmark/index.js +32 -0
  61. package/lib/bookmark/index.mjs +9 -0
  62. package/lib/calendar/index.d.mts +5 -0
  63. package/lib/calendar/index.d.ts +5 -0
  64. package/lib/calendar/index.js +32 -0
  65. package/lib/calendar/index.mjs +9 -0
  66. package/lib/checkBox/index.d.mts +5 -0
  67. package/lib/checkBox/index.d.ts +5 -0
  68. package/lib/checkBox/index.js +32 -0
  69. package/lib/checkBox/index.mjs +9 -0
  70. package/lib/checkmark/index.d.mts +5 -0
  71. package/lib/checkmark/index.d.ts +5 -0
  72. package/lib/checkmark/index.js +32 -0
  73. package/lib/checkmark/index.mjs +9 -0
  74. package/lib/chevronLeft/index.d.mts +5 -0
  75. package/lib/chevronLeft/index.d.ts +5 -0
  76. package/lib/chevronLeft/index.js +32 -0
  77. package/lib/chevronLeft/index.mjs +9 -0
  78. package/lib/chevronRight/index.d.mts +5 -0
  79. package/lib/chevronRight/index.d.ts +5 -0
  80. package/lib/chevronRight/index.js +32 -0
  81. package/lib/chevronRight/index.mjs +9 -0
  82. package/lib/codepen/index.d.mts +5 -0
  83. package/lib/codepen/index.d.ts +5 -0
  84. package/lib/codepen/index.js +32 -0
  85. package/lib/codepen/index.mjs +9 -0
  86. package/lib/copy/index.d.mts +5 -0
  87. package/lib/copy/index.d.ts +5 -0
  88. package/lib/copy/index.js +32 -0
  89. package/lib/copy/index.mjs +9 -0
  90. package/lib/download/index.d.mts +5 -0
  91. package/lib/download/index.d.ts +5 -0
  92. package/lib/download/index.js +32 -0
  93. package/lib/download/index.mjs +9 -0
  94. package/lib/dribbble/index.d.mts +5 -0
  95. package/lib/dribbble/index.d.ts +5 -0
  96. package/lib/dribbble/index.js +32 -0
  97. package/lib/dribbble/index.mjs +9 -0
  98. package/lib/edit/index.d.mts +5 -0
  99. package/lib/edit/index.d.ts +5 -0
  100. package/lib/edit/index.js +32 -0
  101. package/lib/edit/index.mjs +9 -0
  102. package/lib/error/index.d.mts +5 -0
  103. package/lib/error/index.d.ts +5 -0
  104. package/lib/error/index.js +32 -0
  105. package/lib/error/index.mjs +9 -0
  106. package/lib/explore/index.d.mts +5 -0
  107. package/lib/explore/index.d.ts +5 -0
  108. package/lib/explore/index.js +32 -0
  109. package/lib/explore/index.mjs +9 -0
  110. package/lib/facebook/index.d.mts +5 -0
  111. package/lib/facebook/index.d.ts +5 -0
  112. package/lib/facebook/index.js +32 -0
  113. package/lib/facebook/index.mjs +9 -0
  114. package/lib/filter/index.d.mts +5 -0
  115. package/lib/filter/index.d.ts +5 -0
  116. package/lib/filter/index.js +32 -0
  117. package/lib/filter/index.mjs +9 -0
  118. package/lib/folder/index.d.mts +5 -0
  119. package/lib/folder/index.d.ts +5 -0
  120. package/lib/folder/index.js +32 -0
  121. package/lib/folder/index.mjs +9 -0
  122. package/lib/github/index.d.mts +5 -0
  123. package/lib/github/index.d.ts +5 -0
  124. package/lib/github/index.js +32 -0
  125. package/lib/github/index.mjs +9 -0
  126. package/lib/heart/index.d.mts +5 -0
  127. package/lib/heart/index.d.ts +5 -0
  128. package/lib/heart/index.js +32 -0
  129. package/lib/heart/index.mjs +9 -0
  130. package/lib/help/index.d.mts +5 -0
  131. package/lib/help/index.d.ts +5 -0
  132. package/lib/help/index.js +32 -0
  133. package/lib/help/index.mjs +9 -0
  134. package/lib/home/index.d.mts +5 -0
  135. package/lib/home/index.d.ts +5 -0
  136. package/lib/home/index.js +32 -0
  137. package/lib/home/index.mjs +9 -0
  138. package/lib/infinity/index.d.mts +5 -0
  139. package/lib/infinity/index.d.ts +5 -0
  140. package/lib/infinity/index.js +32 -0
  141. package/lib/infinity/index.mjs +9 -0
  142. package/lib/info/index.d.mts +5 -0
  143. package/lib/info/index.d.ts +5 -0
  144. package/lib/info/index.js +32 -0
  145. package/lib/info/index.mjs +9 -0
  146. package/lib/instagram/index.d.mts +5 -0
  147. package/lib/instagram/index.d.ts +5 -0
  148. package/lib/instagram/index.js +32 -0
  149. package/lib/instagram/index.mjs +9 -0
  150. package/lib/linkedin/index.d.mts +5 -0
  151. package/lib/linkedin/index.d.ts +5 -0
  152. package/lib/linkedin/index.js +32 -0
  153. package/lib/linkedin/index.mjs +9 -0
  154. package/lib/loading/index.d.mts +5 -0
  155. package/lib/loading/index.d.ts +5 -0
  156. package/lib/loading/index.js +32 -0
  157. package/lib/loading/index.mjs +9 -0
  158. package/lib/loading2/index.d.mts +5 -0
  159. package/lib/loading2/index.d.ts +5 -0
  160. package/lib/loading2/index.js +32 -0
  161. package/lib/loading2/index.mjs +9 -0
  162. package/lib/loading3/index.d.mts +5 -0
  163. package/lib/loading3/index.d.ts +5 -0
  164. package/lib/loading3/index.js +32 -0
  165. package/lib/loading3/index.mjs +9 -0
  166. package/lib/loading4/index.d.mts +5 -0
  167. package/lib/loading4/index.d.ts +5 -0
  168. package/lib/loading4/index.js +32 -0
  169. package/lib/loading4/index.mjs +9 -0
  170. package/lib/lock/index.d.mts +5 -0
  171. package/lib/lock/index.d.ts +5 -0
  172. package/lib/lock/index.js +32 -0
  173. package/lib/lock/index.mjs +9 -0
  174. package/lib/mail/index.d.mts +5 -0
  175. package/lib/mail/index.d.ts +5 -0
  176. package/lib/mail/index.js +32 -0
  177. package/lib/mail/index.mjs +9 -0
  178. package/lib/maximizeMinimize/index.d.mts +5 -0
  179. package/lib/maximizeMinimize/index.d.ts +5 -0
  180. package/lib/maximizeMinimize/index.js +32 -0
  181. package/lib/maximizeMinimize/index.mjs +9 -0
  182. package/lib/maximizeMinimize2/index.d.mts +5 -0
  183. package/lib/maximizeMinimize2/index.d.ts +5 -0
  184. package/lib/maximizeMinimize2/index.js +32 -0
  185. package/lib/maximizeMinimize2/index.mjs +9 -0
  186. package/lib/menu/index.d.mts +5 -0
  187. package/lib/menu/index.d.ts +5 -0
  188. package/lib/menu/index.js +32 -0
  189. package/lib/menu/index.mjs +9 -0
  190. package/lib/menu2/index.d.mts +5 -0
  191. package/lib/menu2/index.d.ts +5 -0
  192. package/lib/menu2/index.js +32 -0
  193. package/lib/menu2/index.mjs +9 -0
  194. package/lib/menu3/index.d.mts +5 -0
  195. package/lib/menu3/index.d.ts +5 -0
  196. package/lib/menu3/index.js +32 -0
  197. package/lib/menu3/index.mjs +9 -0
  198. package/lib/menu4/index.d.mts +5 -0
  199. package/lib/menu4/index.d.ts +5 -0
  200. package/lib/menu4/index.js +32 -0
  201. package/lib/menu4/index.mjs +9 -0
  202. package/lib/microphone/index.d.mts +5 -0
  203. package/lib/microphone/index.d.ts +5 -0
  204. package/lib/microphone/index.js +32 -0
  205. package/lib/microphone/index.mjs +9 -0
  206. package/lib/microphone2/index.d.mts +5 -0
  207. package/lib/microphone2/index.d.ts +5 -0
  208. package/lib/microphone2/index.js +32 -0
  209. package/lib/microphone2/index.mjs +9 -0
  210. package/lib/notification/index.d.mts +5 -0
  211. package/lib/notification/index.d.ts +5 -0
  212. package/lib/notification/index.js +32 -0
  213. package/lib/notification/index.mjs +9 -0
  214. package/lib/notification2/index.d.mts +5 -0
  215. package/lib/notification2/index.d.ts +5 -0
  216. package/lib/notification2/index.js +32 -0
  217. package/lib/notification2/index.mjs +9 -0
  218. package/lib/notification3/index.d.mts +5 -0
  219. package/lib/notification3/index.d.ts +5 -0
  220. package/lib/notification3/index.js +32 -0
  221. package/lib/notification3/index.mjs +9 -0
  222. package/lib/notification4/index.d.mts +5 -0
  223. package/lib/notification4/index.d.ts +5 -0
  224. package/lib/notification4/index.js +32 -0
  225. package/lib/notification4/index.mjs +9 -0
  226. package/lib/playPause/index.d.mts +5 -0
  227. package/lib/playPause/index.d.ts +5 -0
  228. package/lib/playPause/index.js +32 -0
  229. package/lib/playPause/index.mjs +9 -0
  230. package/lib/playPauseCircle/index.d.mts +5 -0
  231. package/lib/playPauseCircle/index.d.ts +5 -0
  232. package/lib/playPauseCircle/index.js +32 -0
  233. package/lib/playPauseCircle/index.mjs +9 -0
  234. package/lib/plusToX/index.d.mts +5 -0
  235. package/lib/plusToX/index.d.ts +5 -0
  236. package/lib/plusToX/index.js +32 -0
  237. package/lib/plusToX/index.mjs +9 -0
  238. package/lib/pocket/index.d.mts +5 -0
  239. package/lib/pocket/index.d.ts +5 -0
  240. package/lib/pocket/index.js +32 -0
  241. package/lib/pocket/index.mjs +9 -0
  242. package/lib/radioButton/index.d.mts +5 -0
  243. package/lib/radioButton/index.d.ts +5 -0
  244. package/lib/radioButton/index.js +32 -0
  245. package/lib/radioButton/index.mjs +9 -0
  246. package/lib/refresh/index.d.mts +5 -0
  247. package/lib/refresh/index.d.ts +5 -0
  248. package/lib/refresh/index.js +32 -0
  249. package/lib/refresh/index.mjs +9 -0
  250. package/lib/scrollDown/index.d.mts +5 -0
  251. package/lib/scrollDown/index.d.ts +5 -0
  252. package/lib/scrollDown/index.js +32 -0
  253. package/lib/scrollDown/index.mjs +9 -0
  254. package/lib/searchToX/index.d.mts +5 -0
  255. package/lib/searchToX/index.d.ts +5 -0
  256. package/lib/searchToX/index.js +32 -0
  257. package/lib/searchToX/index.mjs +9 -0
  258. package/lib/settings/index.d.mts +5 -0
  259. package/lib/settings/index.d.ts +5 -0
  260. package/lib/settings/index.js +32 -0
  261. package/lib/settings/index.mjs +9 -0
  262. package/lib/settings2/index.d.mts +5 -0
  263. package/lib/settings2/index.d.ts +5 -0
  264. package/lib/settings2/index.js +32 -0
  265. package/lib/settings2/index.mjs +9 -0
  266. package/lib/share/index.d.mts +5 -0
  267. package/lib/share/index.d.ts +5 -0
  268. package/lib/share/index.js +32 -0
  269. package/lib/share/index.mjs +9 -0
  270. package/lib/skipBack/index.d.mts +5 -0
  271. package/lib/skipBack/index.d.ts +5 -0
  272. package/lib/skipBack/index.js +32 -0
  273. package/lib/skipBack/index.mjs +9 -0
  274. package/lib/skipForward/index.d.mts +5 -0
  275. package/lib/skipForward/index.d.ts +5 -0
  276. package/lib/skipForward/index.js +32 -0
  277. package/lib/skipForward/index.mjs +9 -0
  278. package/lib/star/index.d.mts +5 -0
  279. package/lib/star/index.d.ts +5 -0
  280. package/lib/star/index.js +32 -0
  281. package/lib/star/index.mjs +9 -0
  282. package/lib/thumbUp/index.d.mts +5 -0
  283. package/lib/thumbUp/index.d.ts +5 -0
  284. package/lib/thumbUp/index.js +32 -0
  285. package/lib/thumbUp/index.mjs +9 -0
  286. package/lib/toggle/index.d.mts +5 -0
  287. package/lib/toggle/index.d.ts +5 -0
  288. package/lib/toggle/index.js +32 -0
  289. package/lib/toggle/index.mjs +9 -0
  290. package/lib/trash/index.d.mts +5 -0
  291. package/lib/trash/index.d.ts +5 -0
  292. package/lib/trash/index.js +32 -0
  293. package/lib/trash/index.mjs +9 -0
  294. package/lib/trash2/index.d.mts +5 -0
  295. package/lib/trash2/index.d.ts +5 -0
  296. package/lib/trash2/index.js +32 -0
  297. package/lib/trash2/index.mjs +9 -0
  298. package/lib/twitter/index.d.mts +5 -0
  299. package/lib/twitter/index.d.ts +5 -0
  300. package/lib/twitter/index.js +32 -0
  301. package/lib/twitter/index.mjs +9 -0
  302. package/lib/userMinus/index.d.mts +5 -0
  303. package/lib/userMinus/index.d.ts +5 -0
  304. package/lib/userMinus/index.js +32 -0
  305. package/lib/userMinus/index.mjs +9 -0
  306. package/lib/userPlus/index.d.mts +5 -0
  307. package/lib/userPlus/index.d.ts +5 -0
  308. package/lib/userPlus/index.js +32 -0
  309. package/lib/userPlus/index.mjs +9 -0
  310. package/lib/userX/index.d.mts +5 -0
  311. package/lib/userX/index.d.ts +5 -0
  312. package/lib/userX/index.js +32 -0
  313. package/lib/userX/index.mjs +9 -0
  314. package/lib/video/index.d.mts +5 -0
  315. package/lib/video/index.d.ts +5 -0
  316. package/lib/video/index.js +32 -0
  317. package/lib/video/index.mjs +9 -0
  318. package/lib/video2/index.d.mts +5 -0
  319. package/lib/video2/index.d.ts +5 -0
  320. package/lib/video2/index.js +32 -0
  321. package/lib/video2/index.mjs +9 -0
  322. package/lib/visibility/index.d.mts +5 -0
  323. package/lib/visibility/index.d.ts +5 -0
  324. package/lib/visibility/index.js +32 -0
  325. package/lib/visibility/index.mjs +9 -0
  326. package/lib/visibility2/index.d.mts +5 -0
  327. package/lib/visibility2/index.d.ts +5 -0
  328. package/lib/visibility2/index.js +32 -0
  329. package/lib/visibility2/index.mjs +9 -0
  330. package/lib/visibility3/index.d.mts +5 -0
  331. package/lib/visibility3/index.d.ts +5 -0
  332. package/lib/visibility3/index.js +32 -0
  333. package/lib/visibility3/index.mjs +9 -0
  334. package/lib/volume/index.d.mts +5 -0
  335. package/lib/volume/index.d.ts +5 -0
  336. package/lib/volume/index.js +32 -0
  337. package/lib/volume/index.mjs +9 -0
  338. package/lib/youtube/index.d.mts +5 -0
  339. package/lib/youtube/index.d.ts +5 -0
  340. package/lib/youtube/index.js +32 -0
  341. package/lib/youtube/index.mjs +9 -0
  342. package/lib/youtube2/index.d.mts +5 -0
  343. package/lib/youtube2/index.d.ts +5 -0
  344. package/lib/youtube2/index.js +32 -0
  345. package/lib/youtube2/index.mjs +9 -0
  346. package/lib/zoomIn/index.d.mts +5 -0
  347. package/lib/zoomIn/index.d.ts +5 -0
  348. package/lib/zoomIn/index.js +32 -0
  349. package/lib/zoomIn/index.mjs +9 -0
  350. package/lib/zoomOut/index.d.mts +5 -0
  351. package/lib/zoomOut/index.d.ts +5 -0
  352. package/lib/zoomOut/index.js +32 -0
  353. package/lib/zoomOut/index.mjs +9 -0
  354. package/package.json +55 -65
  355. package/.babelrc +0 -4
  356. package/.editorconfig +0 -15
  357. package/.eslintignore +0 -2
  358. package/.eslintrc.json +0 -31
  359. package/.gitattributes +0 -1
  360. package/.prettierrc +0 -10
  361. package/.storybook/main.js +0 -15
  362. package/.vscode/settings.json +0 -5
  363. package/README_v1.md +0 -46
  364. package/src/bin/addAnimationFiles.sh +0 -28
  365. package/src/bin/generateStories.sh +0 -34
  366. package/src/index.tsx +0 -177
  367. package/src/lib/activity/activity.json +0 -1
  368. package/src/lib/activity/index.ts +0 -4
  369. package/src/lib/airplay/airplay.json +0 -1
  370. package/src/lib/airplay/index.ts +0 -4
  371. package/src/lib/alertCircle/alertCircle.json +0 -1
  372. package/src/lib/alertCircle/index.ts +0 -4
  373. package/src/lib/alertOctagon/alertOctagon.json +0 -1
  374. package/src/lib/alertOctagon/index.ts +0 -4
  375. package/src/lib/alertTriangle/alertTriangle.json +0 -1
  376. package/src/lib/alertTriangle/index.ts +0 -4
  377. package/src/lib/archive/archive.json +0 -1
  378. package/src/lib/archive/index.ts +0 -4
  379. package/src/lib/arrowDown/arrowDown.json +0 -1
  380. package/src/lib/arrowDown/index.ts +0 -4
  381. package/src/lib/arrowDownCircle/arrowDownCircle.json +0 -1
  382. package/src/lib/arrowDownCircle/index.ts +0 -4
  383. package/src/lib/arrowLeftCircle/arrowLeftCircle.json +0 -1
  384. package/src/lib/arrowLeftCircle/index.ts +0 -4
  385. package/src/lib/arrowRightCircle/arrowRightCircle.json +0 -1
  386. package/src/lib/arrowRightCircle/index.ts +0 -4
  387. package/src/lib/arrowUp/arrowUp.json +0 -1
  388. package/src/lib/arrowUp/index.ts +0 -4
  389. package/src/lib/arrowUpCircle/arrowUpCircle.json +0 -1
  390. package/src/lib/arrowUpCircle/index.ts +0 -4
  391. package/src/lib/behance/behance.json +0 -1
  392. package/src/lib/behance/index.ts +0 -4
  393. package/src/lib/bookmark/bookmark.json +0 -1
  394. package/src/lib/bookmark/index.ts +0 -4
  395. package/src/lib/calendar/calendar.json +0 -1
  396. package/src/lib/calendar/index.ts +0 -4
  397. package/src/lib/checkBox/checkBox.json +0 -1
  398. package/src/lib/checkBox/index.ts +0 -4
  399. package/src/lib/checkmark/checkmark.json +0 -1
  400. package/src/lib/checkmark/index.ts +0 -4
  401. package/src/lib/codepen/codepen.json +0 -1
  402. package/src/lib/codepen/index.ts +0 -4
  403. package/src/lib/copy/copy.json +0 -1
  404. package/src/lib/copy/index.ts +0 -4
  405. package/src/lib/download/download.json +0 -1
  406. package/src/lib/download/index.ts +0 -4
  407. package/src/lib/dribbble/dribbble.json +0 -1
  408. package/src/lib/dribbble/index.ts +0 -4
  409. package/src/lib/edit/edit.json +0 -1
  410. package/src/lib/edit/index.ts +0 -4
  411. package/src/lib/error/error.json +0 -1
  412. package/src/lib/error/index.ts +0 -4
  413. package/src/lib/explore/explore.json +0 -1
  414. package/src/lib/explore/index.ts +0 -4
  415. package/src/lib/facebook/facebook.json +0 -1
  416. package/src/lib/facebook/index.ts +0 -4
  417. package/src/lib/folder/folder.json +0 -1
  418. package/src/lib/folder/index.ts +0 -4
  419. package/src/lib/github/github.json +0 -1
  420. package/src/lib/github/index.ts +0 -4
  421. package/src/lib/heart/heart.json +0 -1
  422. package/src/lib/heart/index.ts +0 -4
  423. package/src/lib/help/help.json +0 -1
  424. package/src/lib/help/index.ts +0 -4
  425. package/src/lib/home/home.json +0 -1
  426. package/src/lib/home/index.ts +0 -4
  427. package/src/lib/infinity/index.ts +0 -4
  428. package/src/lib/infinity/infinity.json +0 -1
  429. package/src/lib/info/index.ts +0 -4
  430. package/src/lib/info/info.json +0 -1
  431. package/src/lib/instagram/index.ts +0 -4
  432. package/src/lib/instagram/instagram.json +0 -1
  433. package/src/lib/linkedin/index.ts +0 -4
  434. package/src/lib/linkedin/linkedin.json +0 -1
  435. package/src/lib/loading/index.ts +0 -4
  436. package/src/lib/loading/loading.json +0 -1
  437. package/src/lib/loading2/index.ts +0 -4
  438. package/src/lib/loading2/loading2.json +0 -1
  439. package/src/lib/loading3/index.ts +0 -4
  440. package/src/lib/loading3/loading3.json +0 -1
  441. package/src/lib/lock/index.ts +0 -4
  442. package/src/lib/lock/lock.json +0 -1
  443. package/src/lib/mail/index.ts +0 -4
  444. package/src/lib/mail/mail.json +0 -1
  445. package/src/lib/maximizeMinimize/index.ts +0 -4
  446. package/src/lib/maximizeMinimize/maximizeMinimize.json +0 -1
  447. package/src/lib/maximizeMinimize2/index.ts +0 -4
  448. package/src/lib/maximizeMinimize2/maximizeMinimize2.json +0 -1
  449. package/src/lib/menu/index.ts +0 -4
  450. package/src/lib/menu/menu.json +0 -1
  451. package/src/lib/menu2/index.ts +0 -4
  452. package/src/lib/menu2/menu2.json +0 -1
  453. package/src/lib/menu3/index.ts +0 -4
  454. package/src/lib/menu3/menu3.json +0 -1
  455. package/src/lib/menu4/index.ts +0 -4
  456. package/src/lib/menu4/menu4.json +0 -1
  457. package/src/lib/microphone/index.ts +0 -4
  458. package/src/lib/microphone/microphone.json +0 -1
  459. package/src/lib/microphone2/index.ts +0 -4
  460. package/src/lib/microphone2/microphone2.json +0 -1
  461. package/src/lib/notification/index.ts +0 -4
  462. package/src/lib/notification/notification.json +0 -1
  463. package/src/lib/notification2/index.ts +0 -4
  464. package/src/lib/notification2/notification2.json +0 -1
  465. package/src/lib/playPause/index.ts +0 -4
  466. package/src/lib/playPause/playPause.json +0 -1
  467. package/src/lib/playPauseCircle/index.ts +0 -4
  468. package/src/lib/playPauseCircle/playPauseCircle.json +0 -1
  469. package/src/lib/plusToX/index.ts +0 -4
  470. package/src/lib/plusToX/plusToX.json +0 -1
  471. package/src/lib/pocket/index.ts +0 -4
  472. package/src/lib/pocket/pocket.json +0 -1
  473. package/src/lib/radioButton/index.ts +0 -4
  474. package/src/lib/radioButton/radioButton.json +0 -1
  475. package/src/lib/scrollDown/index.ts +0 -4
  476. package/src/lib/scrollDown/scrollDown.json +0 -1
  477. package/src/lib/searchToX/index.ts +0 -4
  478. package/src/lib/searchToX/searchToX.json +0 -1
  479. package/src/lib/settings/index.ts +0 -4
  480. package/src/lib/settings/settings.json +0 -1
  481. package/src/lib/settings2/index.ts +0 -4
  482. package/src/lib/settings2/settings2.json +0 -1
  483. package/src/lib/share/index.ts +0 -4
  484. package/src/lib/share/share.json +0 -1
  485. package/src/lib/skipBack/index.ts +0 -4
  486. package/src/lib/skipBack/skipBack.json +0 -1
  487. package/src/lib/skipForward/index.ts +0 -4
  488. package/src/lib/skipForward/skipForward.json +0 -1
  489. package/src/lib/star/index.ts +0 -4
  490. package/src/lib/star/star.json +0 -1
  491. package/src/lib/thumbUp/index.ts +0 -4
  492. package/src/lib/thumbUp/thumbUp.json +0 -1
  493. package/src/lib/toggle/index.ts +0 -4
  494. package/src/lib/toggle/toggle.json +0 -1
  495. package/src/lib/trash/index.ts +0 -4
  496. package/src/lib/trash/trash.json +0 -1
  497. package/src/lib/trash2/index.ts +0 -4
  498. package/src/lib/trash2/trash2.json +0 -1
  499. package/src/lib/twitter/index.ts +0 -4
  500. package/src/lib/twitter/twitter.json +0 -1
  501. package/src/lib/userMinus/index.ts +0 -4
  502. package/src/lib/userMinus/userMinus.json +0 -1
  503. package/src/lib/userPlus/index.ts +0 -4
  504. package/src/lib/userPlus/userPlus.json +0 -1
  505. package/src/lib/userX/index.ts +0 -4
  506. package/src/lib/userX/userX.json +0 -1
  507. package/src/lib/video/index.ts +0 -4
  508. package/src/lib/video/video.json +0 -1
  509. package/src/lib/video2/index.ts +0 -4
  510. package/src/lib/video2/video2.json +0 -1
  511. package/src/lib/visibility/index.ts +0 -4
  512. package/src/lib/visibility/visibility.json +0 -1
  513. package/src/lib/visibility2/index.ts +0 -4
  514. package/src/lib/visibility2/visibility2.json +0 -1
  515. package/src/lib/volume/index.ts +0 -4
  516. package/src/lib/volume/volume.json +0 -1
  517. package/src/lib/youtube/index.ts +0 -4
  518. package/src/lib/youtube/youtube.json +0 -1
  519. package/src/lib/youtube2/index.ts +0 -4
  520. package/src/lib/youtube2/youtube2.json +0 -1
  521. package/src/lib/zoomIn/index.ts +0 -4
  522. package/src/lib/zoomIn/zoomIn.json +0 -1
  523. package/src/lib/zoomOut/index.ts +0 -4
  524. package/src/lib/zoomOut/zoomOut.json +0 -1
  525. package/src/stories/controlled.stories.tsx +0 -257
  526. package/src/stories/generated.stories.tsx +0 -406
  527. package/src/stories/variants.stories.tsx +0 -237
  528. package/src/typings.d.ts +0 -6
  529. package/src/utils/constants.ts +0 -93
  530. package/src/utils/getEffect.ts +0 -91
  531. package/src/utils/getEvents.ts +0 -81
  532. package/src/utils/index.ts +0 -3
  533. package/tsconfig.json +0 -67
  534. package/useanimations-preview.gif +0 -0
package/README.md CHANGED
@@ -4,37 +4,26 @@
4
4
 
5
5
  #### What is react-useanimations?
6
6
 
7
- React-useanimations is a collection of free animated open source icons for React.js.
7
+ React-useanimations is the official React component for [useAnimations](https://useanimations.com), a free library of 85+ animated Lottie icons.
8
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/)
9
+ 📖 **Documentation:** [useanimations.com/documentation](https://useanimations.com/documentation): React props and all import names, plus plain HTML/JS, Vue, iOS and Android guides.
12
10
 
13
11
  ![](useanimations-preview.gif)
14
12
 
15
13
  ### Installation
16
14
 
17
- Using Yarn:
18
-
19
15
  ```
20
- yarn add react-useanimations
16
+ npm install react-useanimations
21
17
  ```
22
18
 
23
- or using NPM:
24
-
25
- ```
26
- npm install -S react-useanimations
27
- ```
19
+ Requires React 16.8+ (tested with React 18 and 19). Works with StrictMode, Next.js (App Router) and other SSR frameworks.
28
20
 
29
21
  ### 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
22
 
32
- Basic usage
33
23
  ```javascript
34
- import React from 'react';
35
24
  import UseAnimations from 'react-useanimations';
36
25
  // EVERY ANIMATION NEEDS TO BE IMPORTED FIRST -> YOUR BUNDLE WILL INCLUDE ONLY WHAT IT NEEDS
37
- import github from 'react-useanimations/lib/github'
26
+ import github from 'react-useanimations/lib/github';
38
27
 
39
28
  const App = () => <UseAnimations animation={github} />;
40
29
 
@@ -44,67 +33,123 @@ export default App;
44
33
  Icons can be configured with inline props:
45
34
 
46
35
  ```javascript
47
- <UseAnimations animation={github} size={56} wrapperStyle={{ padding: 100 }} />
36
+ <UseAnimations
37
+ animation={github}
38
+ size={56}
39
+ strokeColor="currentColor"
40
+ wrapperStyle={{ padding: 100 }}
41
+ />
48
42
  ```
49
43
 
50
44
  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
45
+
46
+ | Prop | Default | Definition |
47
+ | :----------- | :-------: | ---------------------------------------------------------------------------------------------------------------------------: |
48
+ | animation | / | animation imported from `react-useanimations/lib/<name>` |
49
+ | size | `24` | animation size in px |
50
+ | strokeColor | / | stroke color of the icon, e.g. `'currentColor'` |
51
+ | fillColor | / | fill color of the icon |
52
+ | pathCss | / | extra CSS declarations for the icon's paths |
53
+ | wrapperStyle | `{}` | wrapper div styles |
54
+ | interaction | per icon* | `'loop'`, `'click-toggle'`, `'click-replay'`, `'hover'` or `'hover-loop'` |
55
+ | reverse | `false` | for `click-toggle` icons: `true` shows the end state (e.g. a checked checkbox); can be controlled |
56
+ | autoplay | per icon* | `true` for looping icons like loaders |
57
+ | loop | per icon* | `true` for looping icons like loaders |
58
+ | speed | `1` | playback speed (1 is normal speed) |
59
+ | options | `{}` | any other [lottie-web options](https://github.com/airbnb/lottie-web#other-loading-options); applied when the animation loads |
60
+ | render | / | render prop for a custom wrapper, see below |
61
+
62
+ \* Each icon has a default interaction matching [useanimations.com](https://useanimations.com):
63
+
64
+ - `loop`: plays continuously (loaders, alerts).
65
+ - `click-toggle`: toggles between two states on click (menu, checkbox, play/pause).
66
+ - `click-replay`: replays from the start on every click.
67
+ - `hover`: plays forward on mouse enter and backward on mouse leave.
68
+ - `hover-loop`: loops while hovered (social icons).
69
+
70
+ Any other prop (`className`, `aria-label`, `onClick`, `onMouseEnter`, …) is passed to the wrapper div. Your event handlers run before the animation's; call `event.preventDefault()` to skip the animation.
71
+
72
+ #### Controlled toggle
67
73
 
68
74
  ```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);
75
+ import { useState } from 'react';
76
+ import UseAnimations from 'react-useanimations';
77
+ import menu from 'react-useanimations/lib/menu';
78
+
79
+ export const MenuButton = () => {
80
+ const [open, setOpen] = useState(false);
72
81
 
73
82
  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>
83
+ <UseAnimations
84
+ animation={menu}
85
+ size={40}
86
+ reverse={open} // also animates when `open` changes elsewhere, e.g. the menu closes on Escape
87
+ onClick={() => setOpen(!open)}
88
+ />
86
89
  );
87
90
  };
88
91
  ```
89
92
 
90
- Animation wrapped in element (use render prop).
93
+ #### Changing the interaction
94
+
91
95
  ```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
- };
96
+ <UseAnimations animation={download} interaction="hover" />
109
97
  ```
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>`
98
+
99
+ #### Wrapping the animation in another element
100
+
101
+ ```javascript
102
+ import heart from 'react-useanimations/lib/heart';
103
+
104
+ export const LikeButton = () => (
105
+ <UseAnimations
106
+ animation={heart}
107
+ size={60}
108
+ onClick={() => console.log('liked')}
109
+ render={(eventProps, animationProps) => (
110
+ <button type="button" aria-label="Like" {...eventProps}>
111
+ <div {...animationProps} />
112
+ </button>
113
+ )}
114
+ />
115
+ );
116
+ ```
117
+
118
+ `eventProps` holds the `onClick`, `onMouseEnter` and `onMouseLeave` handlers for your interactive element (e.g. a button) and `animationProps` holds the animation itself, which you spread inside a plain `<div>`.
119
+
120
+ #### Next.js and other SSR frameworks
121
+
122
+ The component is marked `'use client'` and loads lottie-web only in the browser, so it can be rendered from server components without `dynamic(..., { ssr: false })`.
123
+
124
+ ### Available animations
125
+
126
+ <!-- icons:start -->
127
+
128
+ `activity`, `airplay`, `alertCircle`, `alertOctagon`, `alertTriangle`, `archive`, `arrowDown`, `arrowDownCircle`, `arrowLeftCircle`, `arrowRightCircle`, `arrowUp`, `arrowUpCircle`, `behance`, `bookmark`, `calendar`, `checkBox`, `checkmark`, `chevronLeft`, `chevronRight`, `codepen`, `copy`, `download`, `dribbble`, `edit`, `error`, `explore`, `facebook`, `filter`, `folder`, `github`, `heart`, `help`, `home`, `infinity`, `info`, `instagram`, `linkedin`, `loading`, `loading2`, `loading3`, `loading4`, `lock`, `mail`, `maximizeMinimize`, `maximizeMinimize2`, `menu`, `menu2`, `menu3`, `menu4`, `microphone`, `microphone2`, `notification`, `notification2`, `notification3`, `notification4`, `playPause`, `playPauseCircle`, `plusToX`, `pocket`, `radioButton`, `refresh`, `scrollDown`, `searchToX`, `settings`, `settings2`, `share`, `skipBack`, `skipForward`, `star`, `thumbUp`, `toggle`, `trash`, `trash2`, `twitter`, `userMinus`, `userPlus`, `userX`, `video`, `video2`, `visibility`, `visibility2`, `visibility3`, `volume`, `youtube`, `youtube2`, `zoomIn`, `zoomOut`
129
+ <!-- icons:end -->
130
+
131
+ Import each one from `react-useanimations/lib/<name>`.
132
+
133
+ ### Upgrading from v2
134
+
135
+ - Icon interactions now match useanimations.com (e.g. `zoomIn` plays on hover instead of looping, social icons loop while hovered). Pass `interaction` to keep a different behavior.
136
+ - `reverse` is now fully controlled: changing it from `true` to `false` animates back.
137
+ - `onMouseEnter` / `onMouseLeave` no longer replace the hover animation, and `style` is merged into the wrapper styles.
138
+ - `loop={false}` and `autoplay={false}` now override the defaults of looping icons.
139
+ - `options` is typed as lottie-web's `AnimationConfigWithData<'svg'>`.
140
+ - The `react-useanimations/utils/*` paths were removed; import the types (`Animation`, `AnimationKey`, `Interaction`, `UseAnimationsProps`) from `react-useanimations`.
141
+
142
+ ### Development
143
+
144
+ ```
145
+ npm install
146
+ npm test # vitest
147
+ npm run lint
148
+ npm run check-types
149
+ npm run build # builds dist/ (CJS + ESM + types)
150
+ npm run sync-icons # syncs src/lib with https://useanimations.com/icons.json
151
+ ```
152
+
153
+ ### License
154
+
155
+ The animations are free for personal and commercial use under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/). Attribution with a link to [useanimations.com](https://useanimations.com) is required; redistributing or reselling the files themselves (e.g. in icon packs, templates or UI kits) is not allowed. See [LICENSE](LICENSE) and [Licencing & Terms](https://useanimations.com/licencing-and-terms).
package/index.d.mts ADDED
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { AnimationConfigWithData } from 'lottie-web';
3
+
4
+ declare const interactions: {
5
+ readonly activity: "loop";
6
+ readonly airplay: "loop";
7
+ readonly alertCircle: "loop";
8
+ readonly alertOctagon: "loop";
9
+ readonly alertTriangle: "loop";
10
+ readonly archive: "hover";
11
+ readonly arrowDown: "loop";
12
+ readonly arrowDownCircle: "click-replay";
13
+ readonly arrowLeftCircle: "click-replay";
14
+ readonly arrowRightCircle: "click-replay";
15
+ readonly arrowUp: "loop";
16
+ readonly arrowUpCircle: "click-replay";
17
+ readonly behance: "hover-loop";
18
+ readonly bookmark: "click-toggle";
19
+ readonly calendar: "hover";
20
+ readonly checkBox: "click-toggle";
21
+ readonly checkmark: "loop";
22
+ readonly chevronLeft: "click-replay";
23
+ readonly chevronRight: "click-replay";
24
+ readonly codepen: "hover-loop";
25
+ readonly copy: "hover";
26
+ readonly download: "click-replay";
27
+ readonly dribbble: "hover-loop";
28
+ readonly edit: "hover";
29
+ readonly error: "loop";
30
+ readonly explore: "hover";
31
+ readonly facebook: "hover-loop";
32
+ readonly filter: "click-replay";
33
+ readonly folder: "hover";
34
+ readonly github: "hover-loop";
35
+ readonly heart: "click-toggle";
36
+ readonly help: "loop";
37
+ readonly home: "hover";
38
+ readonly infinity: "loop";
39
+ readonly info: "hover";
40
+ readonly instagram: "hover";
41
+ readonly linkedin: "hover-loop";
42
+ readonly loading: "loop";
43
+ readonly loading2: "loop";
44
+ readonly loading3: "loop";
45
+ readonly loading4: "loop";
46
+ readonly lock: "click-toggle";
47
+ readonly mail: "hover";
48
+ readonly maximizeMinimize: "click-toggle";
49
+ readonly maximizeMinimize2: "click-toggle";
50
+ readonly menu: "click-toggle";
51
+ readonly menu2: "click-toggle";
52
+ readonly menu3: "click-toggle";
53
+ readonly menu4: "click-toggle";
54
+ readonly microphone: "click-toggle";
55
+ readonly microphone2: "click-toggle";
56
+ readonly notification: "click-toggle";
57
+ readonly notification2: "click-toggle";
58
+ readonly notification3: "loop";
59
+ readonly notification4: "loop";
60
+ readonly playPause: "click-toggle";
61
+ readonly playPauseCircle: "click-toggle";
62
+ readonly plusToX: "click-toggle";
63
+ readonly pocket: "hover-loop";
64
+ readonly radioButton: "click-toggle";
65
+ readonly refresh: "click-replay";
66
+ readonly scrollDown: "loop";
67
+ readonly searchToX: "click-toggle";
68
+ readonly settings: "hover";
69
+ readonly settings2: "click-toggle";
70
+ readonly share: "hover";
71
+ readonly skipBack: "click-replay";
72
+ readonly skipForward: "click-replay";
73
+ readonly star: "click-toggle";
74
+ readonly thumbUp: "click-toggle";
75
+ readonly toggle: "click-toggle";
76
+ readonly trash: "hover";
77
+ readonly trash2: "hover";
78
+ readonly twitter: "hover-loop";
79
+ readonly userMinus: "hover";
80
+ readonly userPlus: "hover";
81
+ readonly userX: "hover";
82
+ readonly video: "click-toggle";
83
+ readonly video2: "click-toggle";
84
+ readonly visibility: "click-toggle";
85
+ readonly visibility2: "click-toggle";
86
+ readonly visibility3: "click-toggle";
87
+ readonly volume: "click-toggle";
88
+ readonly youtube: "hover";
89
+ readonly youtube2: "hover";
90
+ readonly zoomIn: "hover";
91
+ readonly zoomOut: "hover";
92
+ };
93
+ type AnimationKey = keyof typeof interactions;
94
+
95
+ /**
96
+ * How an icon reacts to the user, matching the `interaction` field of the useAnimations catalog.
97
+ * - `loop`: plays continuously.
98
+ * - `click-toggle`: toggles between two states on click (forward, then backward).
99
+ * - `click-replay`: replays from the start on every click.
100
+ * - `hover`: plays forward on mouse enter and backward on mouse leave.
101
+ * - `hover-loop`: loops while hovered and stops on mouse leave.
102
+ */
103
+ type Interaction = 'loop' | 'click-toggle' | 'click-replay' | 'hover' | 'hover-loop';
104
+ type Animation = {
105
+ animationData: unknown;
106
+ animationKey: AnimationKey;
107
+ };
108
+
109
+ type MouseHandler = (event: React.MouseEvent<HTMLElement>) => void;
110
+ type EventProps = {
111
+ onClick: MouseHandler;
112
+ onMouseEnter: MouseHandler;
113
+ onMouseLeave: MouseHandler;
114
+ };
115
+ type AnimationProps = React.HTMLAttributes<HTMLDivElement> & {
116
+ ref: React.Ref<HTMLDivElement>;
117
+ style: React.CSSProperties;
118
+ };
119
+ type OwnProps = {
120
+ /** Animation imported from `react-useanimations/lib/<name>`. */
121
+ animation: Animation;
122
+ /** Overrides the icon's default interaction, e.g. `'hover'` for an icon that normally plays on click. */
123
+ interaction?: Interaction;
124
+ /** For `click-toggle` icons: `true` shows the end state (e.g. a checked checkbox). Can be controlled. */
125
+ reverse?: boolean;
126
+ strokeColor?: string;
127
+ fillColor?: string;
128
+ /** Extra CSS declarations applied to every path of the icon. */
129
+ pathCss?: string;
130
+ /** Extra lottie-web options, applied when the animation loads. */
131
+ options?: Partial<AnimationConfigWithData<'svg'>>;
132
+ size?: number;
133
+ loop?: boolean | number;
134
+ autoplay?: boolean;
135
+ speed?: number;
136
+ wrapperStyle?: React.CSSProperties;
137
+ /** Renders a custom wrapper: spread `eventProps` on the interactive element, `animationProps` on a div. */
138
+ render?: (eventProps: EventProps, animationProps: AnimationProps) => React.ReactElement;
139
+ };
140
+ type UseAnimationsProps = OwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, keyof OwnProps>;
141
+
142
+ declare const UseAnimations: (props: UseAnimationsProps) => React.ReactElement;
143
+
144
+ export { type Animation, type AnimationKey, type AnimationProps, type EventProps, type Interaction, type UseAnimationsProps, UseAnimations as default };
package/index.d.ts ADDED
@@ -0,0 +1,144 @@
1
+ import React from 'react';
2
+ import { AnimationConfigWithData } from 'lottie-web';
3
+
4
+ declare const interactions: {
5
+ readonly activity: "loop";
6
+ readonly airplay: "loop";
7
+ readonly alertCircle: "loop";
8
+ readonly alertOctagon: "loop";
9
+ readonly alertTriangle: "loop";
10
+ readonly archive: "hover";
11
+ readonly arrowDown: "loop";
12
+ readonly arrowDownCircle: "click-replay";
13
+ readonly arrowLeftCircle: "click-replay";
14
+ readonly arrowRightCircle: "click-replay";
15
+ readonly arrowUp: "loop";
16
+ readonly arrowUpCircle: "click-replay";
17
+ readonly behance: "hover-loop";
18
+ readonly bookmark: "click-toggle";
19
+ readonly calendar: "hover";
20
+ readonly checkBox: "click-toggle";
21
+ readonly checkmark: "loop";
22
+ readonly chevronLeft: "click-replay";
23
+ readonly chevronRight: "click-replay";
24
+ readonly codepen: "hover-loop";
25
+ readonly copy: "hover";
26
+ readonly download: "click-replay";
27
+ readonly dribbble: "hover-loop";
28
+ readonly edit: "hover";
29
+ readonly error: "loop";
30
+ readonly explore: "hover";
31
+ readonly facebook: "hover-loop";
32
+ readonly filter: "click-replay";
33
+ readonly folder: "hover";
34
+ readonly github: "hover-loop";
35
+ readonly heart: "click-toggle";
36
+ readonly help: "loop";
37
+ readonly home: "hover";
38
+ readonly infinity: "loop";
39
+ readonly info: "hover";
40
+ readonly instagram: "hover";
41
+ readonly linkedin: "hover-loop";
42
+ readonly loading: "loop";
43
+ readonly loading2: "loop";
44
+ readonly loading3: "loop";
45
+ readonly loading4: "loop";
46
+ readonly lock: "click-toggle";
47
+ readonly mail: "hover";
48
+ readonly maximizeMinimize: "click-toggle";
49
+ readonly maximizeMinimize2: "click-toggle";
50
+ readonly menu: "click-toggle";
51
+ readonly menu2: "click-toggle";
52
+ readonly menu3: "click-toggle";
53
+ readonly menu4: "click-toggle";
54
+ readonly microphone: "click-toggle";
55
+ readonly microphone2: "click-toggle";
56
+ readonly notification: "click-toggle";
57
+ readonly notification2: "click-toggle";
58
+ readonly notification3: "loop";
59
+ readonly notification4: "loop";
60
+ readonly playPause: "click-toggle";
61
+ readonly playPauseCircle: "click-toggle";
62
+ readonly plusToX: "click-toggle";
63
+ readonly pocket: "hover-loop";
64
+ readonly radioButton: "click-toggle";
65
+ readonly refresh: "click-replay";
66
+ readonly scrollDown: "loop";
67
+ readonly searchToX: "click-toggle";
68
+ readonly settings: "hover";
69
+ readonly settings2: "click-toggle";
70
+ readonly share: "hover";
71
+ readonly skipBack: "click-replay";
72
+ readonly skipForward: "click-replay";
73
+ readonly star: "click-toggle";
74
+ readonly thumbUp: "click-toggle";
75
+ readonly toggle: "click-toggle";
76
+ readonly trash: "hover";
77
+ readonly trash2: "hover";
78
+ readonly twitter: "hover-loop";
79
+ readonly userMinus: "hover";
80
+ readonly userPlus: "hover";
81
+ readonly userX: "hover";
82
+ readonly video: "click-toggle";
83
+ readonly video2: "click-toggle";
84
+ readonly visibility: "click-toggle";
85
+ readonly visibility2: "click-toggle";
86
+ readonly visibility3: "click-toggle";
87
+ readonly volume: "click-toggle";
88
+ readonly youtube: "hover";
89
+ readonly youtube2: "hover";
90
+ readonly zoomIn: "hover";
91
+ readonly zoomOut: "hover";
92
+ };
93
+ type AnimationKey = keyof typeof interactions;
94
+
95
+ /**
96
+ * How an icon reacts to the user, matching the `interaction` field of the useAnimations catalog.
97
+ * - `loop`: plays continuously.
98
+ * - `click-toggle`: toggles between two states on click (forward, then backward).
99
+ * - `click-replay`: replays from the start on every click.
100
+ * - `hover`: plays forward on mouse enter and backward on mouse leave.
101
+ * - `hover-loop`: loops while hovered and stops on mouse leave.
102
+ */
103
+ type Interaction = 'loop' | 'click-toggle' | 'click-replay' | 'hover' | 'hover-loop';
104
+ type Animation = {
105
+ animationData: unknown;
106
+ animationKey: AnimationKey;
107
+ };
108
+
109
+ type MouseHandler = (event: React.MouseEvent<HTMLElement>) => void;
110
+ type EventProps = {
111
+ onClick: MouseHandler;
112
+ onMouseEnter: MouseHandler;
113
+ onMouseLeave: MouseHandler;
114
+ };
115
+ type AnimationProps = React.HTMLAttributes<HTMLDivElement> & {
116
+ ref: React.Ref<HTMLDivElement>;
117
+ style: React.CSSProperties;
118
+ };
119
+ type OwnProps = {
120
+ /** Animation imported from `react-useanimations/lib/<name>`. */
121
+ animation: Animation;
122
+ /** Overrides the icon's default interaction, e.g. `'hover'` for an icon that normally plays on click. */
123
+ interaction?: Interaction;
124
+ /** For `click-toggle` icons: `true` shows the end state (e.g. a checked checkbox). Can be controlled. */
125
+ reverse?: boolean;
126
+ strokeColor?: string;
127
+ fillColor?: string;
128
+ /** Extra CSS declarations applied to every path of the icon. */
129
+ pathCss?: string;
130
+ /** Extra lottie-web options, applied when the animation loads. */
131
+ options?: Partial<AnimationConfigWithData<'svg'>>;
132
+ size?: number;
133
+ loop?: boolean | number;
134
+ autoplay?: boolean;
135
+ speed?: number;
136
+ wrapperStyle?: React.CSSProperties;
137
+ /** Renders a custom wrapper: spread `eventProps` on the interactive element, `animationProps` on a div. */
138
+ render?: (eventProps: EventProps, animationProps: AnimationProps) => React.ReactElement;
139
+ };
140
+ type UseAnimationsProps = OwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, keyof OwnProps>;
141
+
142
+ declare const UseAnimations: (props: UseAnimationsProps) => React.ReactElement;
143
+
144
+ export { type Animation, type AnimationKey, type AnimationProps, type EventProps, type Interaction, type UseAnimationsProps, UseAnimations as default };