@vincentgraul/react-components 1.0.40 → 1.0.41

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 (363) hide show
  1. package/package.json +2 -1
  2. package/.circleci/config.yml +0 -52
  3. package/.prettierrc.json +0 -4
  4. package/.storybook/main.ts +0 -17
  5. package/.storybook/preview.ts +0 -15
  6. package/doc/.nojekyll +0 -1
  7. package/doc/assets/highlight.css +0 -22
  8. package/doc/assets/main.js +0 -54
  9. package/doc/assets/search.js +0 -1
  10. package/doc/assets/style.css +0 -1224
  11. package/doc/assets/widgets.png +0 -0
  12. package/doc/assets/widgets@2x.png +0 -0
  13. package/doc/enums/numbered_pagination_NumberedPagination.ArrowPosition.html +0 -78
  14. package/doc/functions/match_device_useMatchDevice.default.html +0 -70
  15. package/doc/functions/match_resolution_useMatchResolution.default.html +0 -82
  16. package/doc/functions/mount_react_hook_mountReactHook.default.html +0 -74
  17. package/doc/functions/numbered_pagination_NumberedPagination.default.html +0 -75
  18. package/doc/functions/pagination_usePagination.default.html +0 -85
  19. package/doc/functions/scroll_to_useScrollTo.default.html +0 -73
  20. package/doc/functions/table_Table.Td.html +0 -85
  21. package/doc/functions/table_Table.Th.html +0 -85
  22. package/doc/functions/table_Table.Tr.html +0 -85
  23. package/doc/functions/table_Table.default.html +0 -84
  24. package/doc/functions/visible_useVisible.default.html +0 -69
  25. package/doc/index.html +0 -98
  26. package/doc/interfaces/match_device_useMatchDevice.Device.html +0 -96
  27. package/doc/interfaces/match_resolution_useMatchResolution.Breakpoints.html +0 -159
  28. package/doc/interfaces/match_resolution_useMatchResolution.MatchResolution.html +0 -102
  29. package/doc/interfaces/match_resolution_useMatchResolution.Resolution.html +0 -159
  30. package/doc/interfaces/mount_react_hook_mountReactHook.MountedHook.html +0 -97
  31. package/doc/interfaces/numbered_pagination_NumberedPagination.Props.html +0 -234
  32. package/doc/interfaces/pagination_usePagination.Pagination.html +0 -178
  33. package/doc/interfaces/pagination_usePagination.Props.html +0 -103
  34. package/doc/interfaces/scroll_to_useScrollTo.ScrollEvents.html +0 -83
  35. package/doc/interfaces/table_Table.Column.html +0 -85
  36. package/doc/interfaces/table_Table.Props.html +0 -245
  37. package/doc/modules/match_device_useMatchDevice.html +0 -66
  38. package/doc/modules/match_resolution_useMatchResolution.html +0 -75
  39. package/doc/modules/mount_react_hook_mountReactHook.html +0 -66
  40. package/doc/modules/numbered_pagination_NumberedPagination.html +0 -71
  41. package/doc/modules/pagination_usePagination.html +0 -68
  42. package/doc/modules/scroll_to_useScrollTo.html +0 -66
  43. package/doc/modules/table_Table.html +0 -74
  44. package/doc/modules/visible_useVisible.html +0 -61
  45. package/doc/modules.html +0 -58
  46. package/doc/variables/match_resolution_useMatchResolution.defaultBreakpoints.html +0 -58
  47. package/eslint.config.js +0 -36
  48. package/jest.config.js +0 -5
  49. package/renovate.json +0 -14
  50. package/src/breadcrumb/breadcrumb.module.css +0 -17
  51. package/src/breadcrumb/breadcrumb.tsx +0 -30
  52. package/src/breadcrumb/icons/arrow.tsx +0 -24
  53. package/src/breadcrumb/icons/index.ts +0 -1
  54. package/src/breadcrumb/index.ts +0 -3
  55. package/src/country-selector/country-selector.module.css +0 -5
  56. package/src/country-selector/country-selector.tsx +0 -42
  57. package/src/country-selector/country-selector.types.ts +0 -6
  58. package/src/country-selector/icons/Ad.tsx +0 -86
  59. package/src/country-selector/icons/Ae.tsx +0 -22
  60. package/src/country-selector/icons/Af.tsx +0 -28
  61. package/src/country-selector/icons/Ag.tsx +0 -23
  62. package/src/country-selector/icons/Ai.tsx +0 -38
  63. package/src/country-selector/icons/Al.tsx +0 -17
  64. package/src/country-selector/icons/Am.tsx +0 -18
  65. package/src/country-selector/icons/Ao.tsx +0 -21
  66. package/src/country-selector/icons/Ar.tsx +0 -19
  67. package/src/country-selector/icons/As.tsx +0 -43
  68. package/src/country-selector/icons/At.tsx +0 -14
  69. package/src/country-selector/icons/Au.tsx +0 -25
  70. package/src/country-selector/icons/Aw.tsx +0 -22
  71. package/src/country-selector/icons/Az.tsx +0 -22
  72. package/src/country-selector/icons/Ba.tsx +0 -18
  73. package/src/country-selector/icons/Bb.tsx +0 -22
  74. package/src/country-selector/icons/Bd.tsx +0 -14
  75. package/src/country-selector/icons/Be.tsx +0 -18
  76. package/src/country-selector/icons/Bf.tsx +0 -21
  77. package/src/country-selector/icons/Bg.tsx +0 -18
  78. package/src/country-selector/icons/Bh.tsx +0 -17
  79. package/src/country-selector/icons/Bi.tsx +0 -45
  80. package/src/country-selector/icons/Bj.tsx +0 -21
  81. package/src/country-selector/icons/Bm.tsx +0 -103
  82. package/src/country-selector/icons/Bo.tsx +0 -177
  83. package/src/country-selector/icons/Br.tsx +0 -22
  84. package/src/country-selector/icons/Bs.tsx +0 -18
  85. package/src/country-selector/icons/Bt.tsx +0 -49
  86. package/src/country-selector/icons/Bw.tsx +0 -15
  87. package/src/country-selector/icons/By.tsx +0 -25
  88. package/src/country-selector/icons/Bz.tsx +0 -193
  89. package/src/country-selector/icons/Ca.tsx +0 -17
  90. package/src/country-selector/icons/Cd.tsx +0 -25
  91. package/src/country-selector/icons/Cf.tsx +0 -24
  92. package/src/country-selector/icons/Cg.tsx +0 -21
  93. package/src/country-selector/icons/Ch.tsx +0 -17
  94. package/src/country-selector/icons/Ci.tsx +0 -18
  95. package/src/country-selector/icons/Ck.tsx +0 -29
  96. package/src/country-selector/icons/Cl.tsx +0 -25
  97. package/src/country-selector/icons/Cm.tsx +0 -18
  98. package/src/country-selector/icons/Cn.tsx +0 -17
  99. package/src/country-selector/icons/Co.tsx +0 -18
  100. package/src/country-selector/icons/Cr.tsx +0 -79
  101. package/src/country-selector/icons/Cu.tsx +0 -24
  102. package/src/country-selector/icons/Cv.tsx +0 -19
  103. package/src/country-selector/icons/Cw.tsx +0 -18
  104. package/src/country-selector/icons/Cy.tsx +0 -22
  105. package/src/country-selector/icons/Cz.tsx +0 -21
  106. package/src/country-selector/icons/De.tsx +0 -18
  107. package/src/country-selector/icons/Dj.tsx +0 -25
  108. package/src/country-selector/icons/Dk.tsx +0 -17
  109. package/src/country-selector/icons/Dm.tsx +0 -60
  110. package/src/country-selector/icons/Do.tsx +0 -127
  111. package/src/country-selector/icons/Dz.tsx +0 -21
  112. package/src/country-selector/icons/Ec.tsx +0 -123
  113. package/src/country-selector/icons/Ee.tsx +0 -18
  114. package/src/country-selector/icons/Eg.tsx +0 -22
  115. package/src/country-selector/icons/Er.tsx +0 -25
  116. package/src/country-selector/icons/Es.tsx +0 -80
  117. package/src/country-selector/icons/Et.tsx +0 -26
  118. package/src/country-selector/icons/Fi.tsx +0 -17
  119. package/src/country-selector/icons/Fj.tsx +0 -112
  120. package/src/country-selector/icons/Fk.tsx +0 -96
  121. package/src/country-selector/icons/Fm.tsx +0 -17
  122. package/src/country-selector/icons/Fo.tsx +0 -21
  123. package/src/country-selector/icons/Fr.tsx +0 -18
  124. package/src/country-selector/icons/Ga.tsx +0 -18
  125. package/src/country-selector/icons/Gb.tsx +0 -21
  126. package/src/country-selector/icons/Gd.tsx +0 -24
  127. package/src/country-selector/icons/Ge.tsx +0 -17
  128. package/src/country-selector/icons/Gg.tsx +0 -21
  129. package/src/country-selector/icons/Gh.tsx +0 -22
  130. package/src/country-selector/icons/Gi.tsx +0 -25
  131. package/src/country-selector/icons/Gl.tsx +0 -21
  132. package/src/country-selector/icons/Gm.tsx +0 -19
  133. package/src/country-selector/icons/Gn.tsx +0 -18
  134. package/src/country-selector/icons/Gq.tsx +0 -42
  135. package/src/country-selector/icons/Gr.tsx +0 -23
  136. package/src/country-selector/icons/Gt.tsx +0 -102
  137. package/src/country-selector/icons/Gu.tsx +0 -42
  138. package/src/country-selector/icons/Gw.tsx +0 -25
  139. package/src/country-selector/icons/Hk.tsx +0 -18
  140. package/src/country-selector/icons/Hn.tsx +0 -18
  141. package/src/country-selector/icons/Hr.tsx +0 -78
  142. package/src/country-selector/icons/Ht.tsx +0 -17
  143. package/src/country-selector/icons/Hu.tsx +0 -18
  144. package/src/country-selector/icons/Id.tsx +0 -17
  145. package/src/country-selector/icons/Ie.tsx +0 -18
  146. package/src/country-selector/icons/Il.tsx +0 -18
  147. package/src/country-selector/icons/Im.tsx +0 -76
  148. package/src/country-selector/icons/In.tsx +0 -34
  149. package/src/country-selector/icons/Io.tsx +0 -37
  150. package/src/country-selector/icons/Iq.tsx +0 -22
  151. package/src/country-selector/icons/Ir.tsx +0 -25
  152. package/src/country-selector/icons/Is.tsx +0 -21
  153. package/src/country-selector/icons/It.tsx +0 -18
  154. package/src/country-selector/icons/Je.tsx +0 -74
  155. package/src/country-selector/icons/Jm.tsx +0 -18
  156. package/src/country-selector/icons/Jo.tsx +0 -26
  157. package/src/country-selector/icons/Jp.tsx +0 -14
  158. package/src/country-selector/icons/Ke.tsx +0 -35
  159. package/src/country-selector/icons/Kg.tsx +0 -17
  160. package/src/country-selector/icons/Kh.tsx +0 -18
  161. package/src/country-selector/icons/Ki.tsx +0 -38
  162. package/src/country-selector/icons/Km.tsx +0 -27
  163. package/src/country-selector/icons/Kn.tsx +0 -29
  164. package/src/country-selector/icons/Kp.tsx +0 -20
  165. package/src/country-selector/icons/Kr.tsx +0 -25
  166. package/src/country-selector/icons/Kw.tsx +0 -22
  167. package/src/country-selector/icons/Ky.tsx +0 -134
  168. package/src/country-selector/icons/Kz.tsx +0 -19
  169. package/src/country-selector/icons/La.tsx +0 -15
  170. package/src/country-selector/icons/Lb.tsx +0 -18
  171. package/src/country-selector/icons/Li.tsx +0 -25
  172. package/src/country-selector/icons/Lk.tsx +0 -67
  173. package/src/country-selector/icons/Lr.tsx +0 -34
  174. package/src/country-selector/icons/Ls.tsx +0 -22
  175. package/src/country-selector/icons/Lt.tsx +0 -18
  176. package/src/country-selector/icons/Lu.tsx +0 -18
  177. package/src/country-selector/icons/Lv.tsx +0 -14
  178. package/src/country-selector/icons/Ly.tsx +0 -22
  179. package/src/country-selector/icons/Ma.tsx +0 -17
  180. package/src/country-selector/icons/Mc.tsx +0 -17
  181. package/src/country-selector/icons/Md.tsx +0 -100
  182. package/src/country-selector/icons/Me.tsx +0 -33
  183. package/src/country-selector/icons/Mg.tsx +0 -18
  184. package/src/country-selector/icons/Mh.tsx +0 -25
  185. package/src/country-selector/icons/Mk.tsx +0 -17
  186. package/src/country-selector/icons/Ml.tsx +0 -18
  187. package/src/country-selector/icons/Mm.tsx +0 -22
  188. package/src/country-selector/icons/Mn.tsx +0 -24
  189. package/src/country-selector/icons/Mo.tsx +0 -21
  190. package/src/country-selector/icons/Mp.tsx +0 -53
  191. package/src/country-selector/icons/Mq.tsx +0 -17
  192. package/src/country-selector/icons/Mr.tsx +0 -17
  193. package/src/country-selector/icons/Ms.tsx +0 -62
  194. package/src/country-selector/icons/Mt.tsx +0 -51
  195. package/src/country-selector/icons/Mu.tsx +0 -19
  196. package/src/country-selector/icons/Mv.tsx +0 -18
  197. package/src/country-selector/icons/Mw.tsx +0 -21
  198. package/src/country-selector/icons/Mx.tsx +0 -65
  199. package/src/country-selector/icons/My.tsx +0 -37
  200. package/src/country-selector/icons/Mz.tsx +0 -36
  201. package/src/country-selector/icons/Na.tsx +0 -26
  202. package/src/country-selector/icons/Nato.tsx +0 -17
  203. package/src/country-selector/icons/Ne.tsx +0 -19
  204. package/src/country-selector/icons/Nf.tsx +0 -18
  205. package/src/country-selector/icons/Ng.tsx +0 -18
  206. package/src/country-selector/icons/Ni.tsx +0 -73
  207. package/src/country-selector/icons/Nl.tsx +0 -18
  208. package/src/country-selector/icons/No.tsx +0 -21
  209. package/src/country-selector/icons/Np.tsx +0 -25
  210. package/src/country-selector/icons/Nr.tsx +0 -18
  211. package/src/country-selector/icons/Nu.tsx +0 -30
  212. package/src/country-selector/icons/Nz.tsx +0 -49
  213. package/src/country-selector/icons/Om.tsx +0 -29
  214. package/src/country-selector/icons/Pa.tsx +0 -25
  215. package/src/country-selector/icons/Pe.tsx +0 -18
  216. package/src/country-selector/icons/Pf.tsx +0 -30
  217. package/src/country-selector/icons/Pg.tsx +0 -25
  218. package/src/country-selector/icons/Ph.tsx +0 -25
  219. package/src/country-selector/icons/Pk.tsx +0 -17
  220. package/src/country-selector/icons/Pl.tsx +0 -17
  221. package/src/country-selector/icons/Pn.tsx +0 -153
  222. package/src/country-selector/icons/Pr.tsx +0 -27
  223. package/src/country-selector/icons/Ps.tsx +0 -22
  224. package/src/country-selector/icons/Pt.tsx +0 -39
  225. package/src/country-selector/icons/Pw.tsx +0 -14
  226. package/src/country-selector/icons/Py.tsx +0 -31
  227. package/src/country-selector/icons/Qa.tsx +0 -17
  228. package/src/country-selector/icons/Ro.tsx +0 -18
  229. package/src/country-selector/icons/Rs.tsx +0 -89
  230. package/src/country-selector/icons/Ru.tsx +0 -18
  231. package/src/country-selector/icons/Rw.tsx +0 -22
  232. package/src/country-selector/icons/Sa.tsx +0 -23
  233. package/src/country-selector/icons/Sb.tsx +0 -25
  234. package/src/country-selector/icons/Sc.tsx +0 -29
  235. package/src/country-selector/icons/Sd.tsx +0 -22
  236. package/src/country-selector/icons/Se.tsx +0 -17
  237. package/src/country-selector/icons/Sg.tsx +0 -17
  238. package/src/country-selector/icons/Si.tsx +0 -33
  239. package/src/country-selector/icons/Sk.tsx +0 -34
  240. package/src/country-selector/icons/Sl.tsx +0 -18
  241. package/src/country-selector/icons/Sm.tsx +0 -102
  242. package/src/country-selector/icons/Sn.tsx +0 -22
  243. package/src/country-selector/icons/So.tsx +0 -17
  244. package/src/country-selector/icons/Sq.tsx +0 -41
  245. package/src/country-selector/icons/Sr.tsx +0 -19
  246. package/src/country-selector/icons/Ss.tsx +0 -30
  247. package/src/country-selector/icons/St.tsx +0 -22
  248. package/src/country-selector/icons/Sv.tsx +0 -141
  249. package/src/country-selector/icons/Sx.tsx +0 -71
  250. package/src/country-selector/icons/Sy.tsx +0 -22
  251. package/src/country-selector/icons/Sz.tsx +0 -60
  252. package/src/country-selector/icons/Tc.tsx +0 -53
  253. package/src/country-selector/icons/Td.tsx +0 -18
  254. package/src/country-selector/icons/Tg.tsx +0 -27
  255. package/src/country-selector/icons/Th.tsx +0 -14
  256. package/src/country-selector/icons/Tibet.tsx +0 -260
  257. package/src/country-selector/icons/Tj.tsx +0 -22
  258. package/src/country-selector/icons/Tk.tsx +0 -21
  259. package/src/country-selector/icons/Tm.tsx +0 -59
  260. package/src/country-selector/icons/Tn.tsx +0 -21
  261. package/src/country-selector/icons/To.tsx +0 -21
  262. package/src/country-selector/icons/Tr.tsx +0 -17
  263. package/src/country-selector/icons/Tt.tsx +0 -18
  264. package/src/country-selector/icons/Tv.tsx +0 -29
  265. package/src/country-selector/icons/Tw.tsx +0 -21
  266. package/src/country-selector/icons/Tz.tsx +0 -22
  267. package/src/country-selector/icons/Ua.tsx +0 -17
  268. package/src/country-selector/icons/Ug.tsx +0 -51
  269. package/src/country-selector/icons/Us.tsx +0 -25
  270. package/src/country-selector/icons/Uy.tsx +0 -53
  271. package/src/country-selector/icons/Uz.tsx +0 -27
  272. package/src/country-selector/icons/Ve.tsx +0 -22
  273. package/src/country-selector/icons/Vi.tsx +0 -42
  274. package/src/country-selector/icons/Vn.tsx +0 -17
  275. package/src/country-selector/icons/Vu.tsx +0 -29
  276. package/src/country-selector/icons/Ws.tsx +0 -21
  277. package/src/country-selector/icons/Ye.tsx +0 -18
  278. package/src/country-selector/icons/Za.tsx +0 -25
  279. package/src/country-selector/icons/Zm.tsx +0 -23
  280. package/src/country-selector/icons/Zw.tsx +0 -41
  281. package/src/country-selector/icons/index.ts +0 -223
  282. package/src/country-selector/index.ts +0 -2
  283. package/src/index.ts +0 -17
  284. package/src/input/index.ts +0 -2
  285. package/src/input/input.module.css +0 -71
  286. package/src/input/input.tsx +0 -38
  287. package/src/input/input.types.ts +0 -10
  288. package/src/loader/index.ts +0 -1
  289. package/src/loader/loader.module.css +0 -40
  290. package/src/loader/loader.tsx +0 -30
  291. package/src/modal/index.ts +0 -1
  292. package/src/modal/modal.module.css +0 -22
  293. package/src/modal/modal.tsx +0 -27
  294. package/src/mount-react-hook/index.ts +0 -2
  295. package/src/mount-react-hook/mount-react-hook.tsx +0 -28
  296. package/src/mount-react-hook/mount-react-hook.types.ts +0 -5
  297. package/src/pagination/index.ts +0 -2
  298. package/src/pagination/pagination.module.css +0 -31
  299. package/src/pagination/pagination.tsx +0 -90
  300. package/src/pagination/pagination.types.ts +0 -4
  301. package/src/select/icons/ArrowBottom.tsx +0 -12
  302. package/src/select/icons/index.ts +0 -1
  303. package/src/select/index.ts +0 -2
  304. package/src/select/select.module.css +0 -54
  305. package/src/select/select.tsx +0 -85
  306. package/src/select/select.types.ts +0 -9
  307. package/src/table/index.ts +0 -2
  308. package/src/table/table.module.css +0 -33
  309. package/src/table/table.tsx +0 -83
  310. package/src/table/table.types.ts +0 -5
  311. package/src/use-breadcrumb/index.ts +0 -2
  312. package/src/use-breadcrumb/use-breadcrumb.tsx +0 -35
  313. package/src/use-breadcrumb/use-breadcrumb.types.ts +0 -12
  314. package/src/use-match-device/index.ts +0 -2
  315. package/src/use-match-device/use-match-device.ts +0 -41
  316. package/src/use-match-device/use-match-device.types.ts +0 -6
  317. package/src/use-match-resolution/index.ts +0 -2
  318. package/src/use-match-resolution/use-match-resolution.ts +0 -72
  319. package/src/use-match-resolution/use-match-resolution.types.ts +0 -37
  320. package/src/use-outside-alerter/index.ts +0 -2
  321. package/src/use-outside-alerter/use-outside-alerter.tsx +0 -29
  322. package/src/use-outside-alerter/use-outside-alerter.types.ts +0 -4
  323. package/src/use-pagination/index.ts +0 -2
  324. package/src/use-pagination/use-pagination.ts +0 -86
  325. package/src/use-pagination/use-pagination.types.ts +0 -11
  326. package/src/use-scroll-to/index.ts +0 -2
  327. package/src/use-scroll-to/use-scroll-to.tsx +0 -25
  328. package/src/use-scroll-to/use-scroll-to.types.ts +0 -3
  329. package/src/use-visible/index.ts +0 -1
  330. package/src/use-visible/use-visible.ts +0 -31
  331. package/src/wizard/index.ts +0 -2
  332. package/src/wizard/wizard.tsx +0 -44
  333. package/src/wizard/wizard.types.ts +0 -7
  334. package/stories/breadcrumb/breadcrumb.stories.tsx +0 -21
  335. package/stories/country-selector/country-selector.stories.tsx +0 -14
  336. package/stories/input/input.stories.tsx +0 -42
  337. package/stories/loader/assets/white-loader.svg +0 -20
  338. package/stories/loader/loader.stories.tsx +0 -12
  339. package/stories/modal/modal.stories.tsx +0 -21
  340. package/stories/pagination/assets/double-left-arrow.svg +0 -13
  341. package/stories/pagination/assets/double-right-arrow.svg +0 -13
  342. package/stories/pagination/assets/single-left-arrow.svg +0 -10
  343. package/stories/pagination/assets/single-right-arrow.svg +0 -10
  344. package/stories/pagination/pagination.stories.tsx +0 -89
  345. package/stories/select/select.stories.tsx +0 -33
  346. package/stories/table/assets/double-left-arrow.svg +0 -13
  347. package/stories/table/assets/double-right-arrow.svg +0 -13
  348. package/stories/table/assets/single-left-arrow.svg +0 -10
  349. package/stories/table/assets/single-right-arrow.svg +0 -10
  350. package/stories/table/table.stories.tsx +0 -219
  351. package/stories/use-match-device/use-match-device.stories.tsx +0 -22
  352. package/stories/use-match-resolution/use-match-resolution.stories.tsx +0 -31
  353. package/stories/use-outside-alerter/use-outside-alerter.stories.tsx +0 -19
  354. package/stories/use-scroll-to/use-scroll-to.stories.tsx +0 -74
  355. package/stories/use-visible/use-visible.stories.tsx +0 -71
  356. package/stories/wizard/wizard.stories.tsx +0 -35
  357. package/tests/pagination/use-pagination.test.ts +0 -23
  358. package/tests/setup.js +0 -23
  359. package/tests/use-match-resolution/use-match-resolution.test.ts +0 -32
  360. package/tests/use-visible/use-visible.test.tsx +0 -53
  361. package/tsconfig.json +0 -16
  362. package/typedoc.json +0 -7
  363. package/types.d.ts +0 -5
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="44" height="44" viewBox="228 227 44 44" xml:space="preserve">
4
- <desc>Created with Fabric.js 4.6.0</desc>
5
- <defs>
6
- </defs>
7
- <g transform="matrix(1 0 0 1 243.5 249.65)" id="W9YXztRPzeX53cvyfGAaY" >
8
- <path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
9
- </g>
10
- <g transform="matrix(1 0 0 1 256.5 249.65)" id="FLRMreggRPo2fwdIwByo4" >
11
- <path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
12
- </g>
13
- </svg>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="30" height="43" viewBox="235 228 30 43" xml:space="preserve">
4
- <desc>Created with Fabric.js 4.6.0</desc>
5
- <defs>
6
- </defs>
7
- <g transform="matrix(-1 0 0 1 250 250)" id="pu0cgsJQk_zRNHFs5F4jS" >
8
- <path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
9
- </g>
10
- </svg>
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="30" height="43" viewBox="235 228 30 43" xml:space="preserve">
4
- <desc>Created with Fabric.js 4.6.0</desc>
5
- <defs>
6
- </defs>
7
- <g transform="matrix(1 0 0 1 250 250)" id="5cVC0zuSDvMfcCq1Pt2kU" >
8
- <path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
9
- </g>
10
- </svg>
@@ -1,219 +0,0 @@
1
- import { useState, useEffect, PropsWithChildren } from "react";
2
- import { Table, Column, Th, Td, Tr, usePagination, Pagination, ArrowPosition } from "../../src";
3
-
4
- export default {
5
- title: "Table",
6
- component: Table,
7
- };
8
-
9
- const columns: Column[] = [
10
- { name: "firstname", label: "Firstname" },
11
- { name: "lastname", label: "Lastname" },
12
- { name: "age", label: "Age" },
13
- { name: "sex", label: "Sex" },
14
- ];
15
-
16
- const records = [
17
- { lastname: "Dupont", firstname: "Jean", sex: "M", age: 28 },
18
- { firstname: "Bernard", lastname: "Durant", age: 43, sex: "M" },
19
- ];
20
-
21
- export const Basic = () => {
22
- return <Table columns={columns} records={records} />;
23
- };
24
-
25
- export const WithUnknownColumn = () => {
26
- const records = [
27
- { lastname: "Dupont", firstname: "Jean", city: "Paris", sex: "M", age: 28 },
28
- { firstname: "Bernard", lastname: "Durant", age: 43, sex: "M", country: "France" },
29
- ];
30
-
31
- return <Table columns={columns} records={records} />;
32
- };
33
-
34
- export const WithCustomColumnsRow = () => {
35
- return (
36
- <Table columns={columns} records={records} renderColumnsRow={(columns) => <Tr>{columns}</Tr>} />
37
- );
38
- };
39
-
40
- export const WithCustomColumnsCell = () => {
41
- return (
42
- <Table
43
- columns={columns}
44
- records={records}
45
- renderColumnsCell={(columns, key) => <Th key={key}>- {columns.name} -</Th>}
46
- />
47
- );
48
- };
49
-
50
- export const WithCustomRecordsRow = () => {
51
- return (
52
- <Table
53
- columns={columns}
54
- records={records}
55
- renderRecordsRow={(cells, key) => <Tr key={key}>{cells}</Tr>}
56
- />
57
- );
58
- };
59
-
60
- export const WithCustomRecordsCell = () => {
61
- return (
62
- <Table
63
- columns={columns}
64
- records={records}
65
- renderRecordsCell={(cell, key) => <Th key={key}>* {cell} *</Th>}
66
- />
67
- );
68
- };
69
-
70
- export const WithDefaultRecordsEmptyCell = () => {
71
- const records = [
72
- { lastname: "Dupont", firstname: "Jean", age: 28 },
73
- { lastname: "Durant", age: 43, sex: "M" },
74
- ];
75
-
76
- return <Table columns={columns} records={records} />;
77
- };
78
-
79
- export const WithCustomRecordsEmptyCell = () => {
80
- const records = [
81
- { lastname: "Dupont", firstname: "Jean", age: 28 },
82
- { lastname: "Durant", age: 43, sex: "M" },
83
- ];
84
-
85
- return (
86
- <Table
87
- columns={columns}
88
- records={records}
89
- renderRecordsEmptyCell={(key: string) => <Td key={key}>-</Td>}
90
- />
91
- );
92
- };
93
-
94
- export const WithHeader = () => {
95
- return (
96
- <Table
97
- columns={columns}
98
- records={records}
99
- renderHeader={() => (
100
- <div
101
- style={{
102
- backgroundColor: "black",
103
- color: "white",
104
- marginBottom: "2vw",
105
- padding: "0.2vw 1.5vw",
106
- }}
107
- >
108
- Users data
109
- </div>
110
- )}
111
- />
112
- );
113
- };
114
-
115
- export const WithFooter = () => {
116
- return (
117
- <Table
118
- columns={columns}
119
- records={records}
120
- renderFooter={() => (
121
- <div
122
- style={{
123
- backgroundColor: "black",
124
- color: "white",
125
- marginTop: "2vw",
126
- padding: "0.2vw 1.5vw",
127
- }}
128
- >
129
- Total: {records.length} records
130
- </div>
131
- )}
132
- />
133
- );
134
- };
135
-
136
- export const WithNoRecords = () => {
137
- const Block = ({ children }: PropsWithChildren) => (
138
- <div style={{ backgroundColor: "black", color: "white", padding: "0.2vw 1.5vw" }}>
139
- {children}
140
- </div>
141
- );
142
-
143
- return (
144
- <Table
145
- columns={columns}
146
- records={[]}
147
- renderHeader={() => <Block>Users data</Block>}
148
- renderFooter={() => <Block>Coypright 1990 - 2021</Block>}
149
- renderNoRecords={() => <div style={{ margin: "2vw 0", textAlign: "center" }}>No data</div>}
150
- />
151
- );
152
- };
153
-
154
- export const Advanced = () => {
155
- const [advancedTotalRecords, setAdvancedTotalRecords] = useState(records);
156
- const [advancedRecords, setAdvancedRecords] = useState<typeof records>([]);
157
- const pagination = usePagination({ page: 1, totalRecords: advancedTotalRecords.length });
158
-
159
- const handleAddRecord = () => {
160
- setAdvancedTotalRecords([...advancedTotalRecords, advancedTotalRecords[0]]);
161
- };
162
-
163
- useEffect(() => {
164
- const offset = (pagination.page - 1) * pagination.maxRecordsPerPage;
165
- setAdvancedRecords(advancedTotalRecords.slice(offset, offset + pagination.maxRecordsPerPage));
166
- }, [advancedTotalRecords, pagination.page]);
167
-
168
- const Block = ({ children }: PropsWithChildren) => (
169
- <div
170
- style={{ backgroundColor: "black", color: "white", padding: "1vw 0", textAlign: "center" }}
171
- >
172
- {children}
173
- </div>
174
- );
175
-
176
- return (
177
- <Table
178
- columns={columns}
179
- records={advancedRecords}
180
- renderHeader={() => (
181
- <Block>
182
- <button
183
- style={{ backgroundColor: "white", border: "none", width: "5vw", cursor: "pointer" }}
184
- onClick={handleAddRecord}
185
- >
186
- Add
187
- </button>
188
- </Block>
189
- )}
190
- renderFooter={() => (
191
- <Block>
192
- <Pagination
193
- {...pagination}
194
- renderSingleArrow={(position: ArrowPosition) => (
195
- <img
196
- style={{ minWidth: 0, minHeight: 0, width: "0.5rem" }}
197
- src={
198
- position === ArrowPosition.LEFT
199
- ? require("./assets/single-left-arrow.svg")
200
- : require("./assets/single-right-arrow.svg")
201
- }
202
- />
203
- )}
204
- renderDoubleArrow={(position: ArrowPosition) => (
205
- <img
206
- style={{ minWidth: 0, minHeight: 0, width: "0.8rem" }}
207
- src={
208
- position === ArrowPosition.LEFT
209
- ? require("./assets/double-left-arrow.svg")
210
- : require("./assets/double-right-arrow.svg")
211
- }
212
- />
213
- )}
214
- />
215
- </Block>
216
- )}
217
- />
218
- );
219
- };
@@ -1,22 +0,0 @@
1
- import { useMatchDevice, Device } from "../../src";
2
-
3
- export default {
4
- title: "useMatchDevice",
5
- component: useMatchDevice,
6
- };
7
-
8
- export const Basic = () => {
9
- const device: Device = useMatchDevice(navigator.userAgent);
10
-
11
- return (
12
- <div>
13
- <p>Device informations (based on user agent):</p>
14
- <ul>
15
- <li>{`isMobile: ${device.isMobile}`}</li>
16
- <li>{`isTablet: ${device.isTablet}`}</li>
17
- <li>{`isMobileOrTablet: ${device.isMobileOrTablet}`}</li>
18
- <li>{`isDesktop: ${device.isDesktop}`}</li>
19
- </ul>
20
- </div>
21
- );
22
- };
@@ -1,31 +0,0 @@
1
- import { useMatchResolution } from "../../src";
2
-
3
- export default {
4
- title: "useMatchResolution",
5
- component: useMatchResolution,
6
- };
7
-
8
- export const Basic = () => {
9
- const { resolution } = useMatchResolution();
10
-
11
- return (
12
- <div>
13
- <p>Screen resolutions:</p>
14
- <ul>
15
- <li>{`isDesktop: ${resolution.isDesktop}`}</li>
16
- <li>{`isLaptop: ${resolution.isLaptop}`}</li>
17
- <li>{`isLaptopOrUpper: ${resolution.isLaptopOrUpper}`}</li>
18
- <li>{`isLaptopOrLower: ${resolution.isLaptopOrLower}`}</li>
19
- <li>{`isTablet: ${resolution.isTablet}`}</li>
20
- <li>{`isTabletOrUpper: ${resolution.isTabletOrUpper}`}</li>
21
- <li>{`isTabletOrLower: ${resolution.isTabletOrLower}`}</li>
22
- <li>{`isLargeMobile: ${resolution.isLargeMobile}`}</li>
23
- <li>{`isLargeMobileOrUpper: ${resolution.isLargeMobileOrUpper}`}</li>
24
- <li>{`isLargeMobileOrLower: ${resolution.isLargeMobileOrLower}`}</li>
25
- <li>{`isMobile: ${resolution.isMobile}`}</li>
26
- <li>{`isPortrait: ${resolution.isPortrait}`}</li>
27
- <li>{`isLandscape: ${resolution.isLandscape}`}</li>
28
- </ul>
29
- </div>
30
- );
31
- };
@@ -1,19 +0,0 @@
1
- import { useRef } from "react";
2
- import { useOutsideAlerter } from "../../src";
3
-
4
- export default {
5
- title: "useOutsideAlerter",
6
- component: useOutsideAlerter,
7
- };
8
-
9
- export const Basic = () => {
10
- const ref = useRef(null);
11
- const { hasClickedOutside } = useOutsideAlerter(ref);
12
-
13
- return (
14
- <div>
15
- <p>Has clicked outside: {hasClickedOutside.toString()}</p>
16
- <p ref={ref}>Click on the text</p>
17
- </div>
18
- );
19
- };
@@ -1,74 +0,0 @@
1
- import { useRef } from "react";
2
- import { useScrollTo } from "../../src";
3
-
4
- export default {
5
- title: "useScrollTo",
6
- component: useScrollTo,
7
- };
8
-
9
- export const Basic = () => {
10
- const elementRef = useRef(null);
11
- const { scrollToTop } = useScrollTo(elementRef);
12
-
13
- return (
14
- <div>
15
- <p>
16
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et tortor rutrum,
17
- sollicitudin neque eu, mollis mi. Mauris mollis neque eu purus volutpat, sed sollicitudin
18
- risus placerat. Proin ornare magna in nisi ullamcorper, a pharetra velit ultricies. Ut
19
- tincidunt tellus et ex elementum scelerisque. Integer faucibus, erat nec pellentesque
20
- commodo, ligula turpis egestas lacus, at sagittis quam ante non ex. Morbi cursus, turpis
21
- auctor tempus venenatis, leo sem lacinia enim, tristique semper urna diam sed magna. Cras
22
- vitae tortor est. Cras vitae mattis sapien. Mauris hendrerit mollis egestas. Nulla augue
23
- eros, vestibulum in mollis et, ultricies at sem. Vivamus sed pretium elit, id vestibulum
24
- justo. Nam sed quam ex. Nam convallis augue et lorem accumsan, molestie bibendum erat
25
- bibendum. Morbi varius, dui sed viverra eleifend, nunc mauris rhoncus ligula, non feugiat
26
- sem urna sit amet metus. Sed in ante nisl. Vestibulum ac risus ipsum. Duis quis lacus magna.
27
- Maecenas at justo neque. Quisque posuere mi quis fringilla dapibus. Nulla non lorem
28
- consectetur, egestas est in, semper arcu. Praesent et nunc non nisl tincidunt dignissim.
29
- Curabitur porta purus non porttitor viverra. Suspendisse potenti. Pellentesque id leo in
30
- metus tempor cursus. Donec in ultrices ligula, in facilisis lacus. Cras eros tellus, ornare
31
- pulvinar congue eu, viverra nec ipsum. Proin laoreet arcu ac imperdiet pretium. Mauris
32
- placerat pulvinar mauris, ac convallis enim semper ac. Aenean et mi eget velit egestas
33
- commodo a nec metus. Curabitur in mi quis lacus tempus aliquet. Aliquam imperdiet, lorem a
34
- sagittis lobortis, nisi purus accumsan orci, in euismod magna quam sit amet turpis. Etiam
35
- quam diam, consectetur id fermentum at, rhoncus eget est. Sed gravida, magna in sollicitudin
36
- semper, neque risus dapibus dui, sed semper augue lorem eget nulla. Cras et pretium mi, quis
37
- auctor massa. Nulla convallis ipsum nunc, a maximus sem porta ac. Class aptent taciti
38
- sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent sed dui nec
39
- ex sodales viverra. Sed vehicula ornare urna, a hendrerit ante tristique vel.
40
- </p>
41
-
42
- <p ref={elementRef}>Scroll to !</p>
43
-
44
- <p>
45
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et tortor rutrum,
46
- sollicitudin neque eu, mollis mi. Mauris mollis neque eu purus volutpat, sed sollicitudin
47
- risus placerat. Proin ornare magna in nisi ullamcorper, a pharetra velit ultricies. Ut
48
- tincidunt tellus et ex elementum scelerisque. Integer faucibus, erat nec pellentesque
49
- commodo, ligula turpis egestas lacus, at sagittis quam ante non ex. Morbi cursus, turpis
50
- auctor tempus venenatis, leo sem lacinia enim, tristique semper urna diam sed magna. Cras
51
- vitae tortor est. Cras vitae mattis sapien. Mauris hendrerit mollis egestas. Nulla augue
52
- eros, vestibulum in mollis et, ultricies at sem. Vivamus sed pretium elit, id vestibulum
53
- justo. Nam sed quam ex. Nam convallis augue et lorem accumsan, molestie bibendum erat
54
- bibendum. Morbi varius, dui sed viverra eleifend, nunc mauris rhoncus ligula, non feugiat
55
- sem urna sit amet metus. Sed in ante nisl. Vestibulum ac risus ipsum. Duis quis lacus magna.
56
- Maecenas at justo neque. Quisque posuere mi quis fringilla dapibus. Nulla non lorem
57
- consectetur, egestas est in, semper arcu. Praesent et nunc non nisl tincidunt dignissim.
58
- Curabitur porta purus non porttitor viverra. Suspendisse potenti. Pellentesque id leo in
59
- metus tempor cursus. Donec in ultrices ligula, in facilisis lacus. Cras eros tellus, ornare
60
- pulvinar congue eu, viverra nec ipsum. Proin laoreet arcu ac imperdiet pretium. Mauris
61
- placerat pulvinar mauris, ac convallis enim semper ac. Aenean et mi eget velit egestas
62
- commodo a nec metus. Curabitur in mi quis lacus tempus aliquet. Aliquam imperdiet, lorem a
63
- sagittis lobortis, nisi purus accumsan orci, in euismod magna quam sit amet turpis. Etiam
64
- quam diam, consectetur id fermentum at, rhoncus eget est. Sed gravida, magna in sollicitudin
65
- semper, neque risus dapibus dui, sed semper augue lorem eget nulla. Cras et pretium mi, quis
66
- auctor massa. Nulla convallis ipsum nunc, a maximus sem porta ac. Class aptent taciti
67
- sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent sed dui nec
68
- ex sodales viverra. Sed vehicula ornare urna, a hendrerit ante tristique vel.
69
- </p>
70
-
71
- <button onClick={scrollToTop}>Scroll to</button>
72
- </div>
73
- );
74
- };
@@ -1,71 +0,0 @@
1
- import { useRef } from "react";
2
- import { useVisible } from "../../src";
3
-
4
- export default {
5
- title: "useVisible",
6
- component: useVisible,
7
- };
8
-
9
- export const Basic = () => {
10
- const elementRef = useRef(null);
11
- const isVisible = useVisible(elementRef);
12
-
13
- return (
14
- <div>
15
- <p
16
- style={{ position: "fixed", fontWeight: "bold", color: "red", zIndex: 2 }}
17
- >{`Title is visible: ${isVisible}`}</p>
18
- <h1 ref={elementRef}>Title</h1>
19
- <p>
20
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et tortor rutrum,
21
- sollicitudin neque eu, mollis mi. Mauris mollis neque eu purus volutpat, sed sollicitudin
22
- risus placerat. Proin ornare magna in nisi ullamcorper, a pharetra velit ultricies. Ut
23
- tincidunt tellus et ex elementum scelerisque. Integer faucibus, erat nec pellentesque
24
- commodo, ligula turpis egestas lacus, at sagittis quam ante non ex. Morbi cursus, turpis
25
- auctor tempus venenatis, leo sem lacinia enim, tristique semper urna diam sed magna. Cras
26
- vitae tortor est. Cras vitae mattis sapien. Mauris hendrerit mollis egestas. Nulla augue
27
- eros, vestibulum in mollis et, ultricies at sem. Vivamus sed pretium elit, id vestibulum
28
- justo. Nam sed quam ex. Nam convallis augue et lorem accumsan, molestie bibendum erat
29
- bibendum. Morbi varius, dui sed viverra eleifend, nunc mauris rhoncus ligula, non feugiat
30
- sem urna sit amet metus. Sed in ante nisl. Vestibulum ac risus ipsum. Duis quis lacus magna.
31
- Maecenas at justo neque. Quisque posuere mi quis fringilla dapibus. Nulla non lorem
32
- consectetur, egestas est in, semper arcu. Praesent et nunc non nisl tincidunt dignissim.
33
- Curabitur porta purus non porttitor viverra. Suspendisse potenti. Pellentesque id leo in
34
- metus tempor cursus. Donec in ultrices ligula, in facilisis lacus. Cras eros tellus, ornare
35
- pulvinar congue eu, viverra nec ipsum. Proin laoreet arcu ac imperdiet pretium. Mauris
36
- placerat pulvinar mauris, ac convallis enim semper ac. Aenean et mi eget velit egestas
37
- commodo a nec metus. Curabitur in mi quis lacus tempus aliquet. Aliquam imperdiet, lorem a
38
- sagittis lobortis, nisi purus accumsan orci, in euismod magna quam sit amet turpis. Etiam
39
- quam diam, consectetur id fermentum at, rhoncus eget est. Sed gravida, magna in sollicitudin
40
- semper, neque risus dapibus dui, sed semper augue lorem eget nulla. Cras et pretium mi, quis
41
- auctor massa. Nulla convallis ipsum nunc, a maximus sem porta ac. Class aptent taciti
42
- sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Praesent sed dui nec
43
- ex sodales viverra. Sed vehicula ornare urna, a hendrerit ante tristique vel. Lorem ipsum
44
- dolor sit amet, consectetur adipiscing elit. Praesent et tortor rutrum, sollicitudin neque
45
- eu, mollis mi. Mauris mollis neque eu purus volutpat, sed sollicitudin risus placerat. Proin
46
- ornare magna in nisi ullamcorper, a pharetra velit ultricies. Ut tincidunt tellus et ex
47
- elementum scelerisque. Integer faucibus, erat nec pellentesque commodo, ligula turpis
48
- egestas lacus, at sagittis quam ante non ex. Morbi cursus, turpis auctor tempus venenatis,
49
- leo sem lacinia enim, tristique semper urna diam sed magna. Cras vitae tortor est. Cras
50
- vitae mattis sapien. Mauris hendrerit mollis egestas. Nulla augue eros, vestibulum in mollis
51
- et, ultricies at sem. Vivamus sed pretium elit, id vestibulum justo. Nam sed quam ex. Nam
52
- convallis augue et lorem accumsan, molestie bibendum erat bibendum. Morbi varius, dui sed
53
- viverra eleifend, nunc mauris rhoncus ligula, non feugiat sem urna sit amet metus. Sed in
54
- ante nisl. Vestibulum ac risus ipsum. Duis quis lacus magna. Maecenas at justo neque.
55
- Quisque posuere mi quis fringilla dapibus. Nulla non lorem consectetur, egestas est in,
56
- semper arcu. Praesent et nunc non nisl tincidunt dignissim. Curabitur porta purus non
57
- porttitor viverra. Suspendisse potenti. Pellentesque id leo in metus tempor cursus. Donec in
58
- ultrices ligula, in facilisis lacus. Cras eros tellus, ornare pulvinar congue eu, viverra
59
- nec ipsum. Proin laoreet arcu ac imperdiet pretium. Mauris placerat pulvinar mauris, ac
60
- convallis enim semper ac. Aenean et mi eget velit egestas commodo a nec metus. Curabitur in
61
- mi quis lacus tempus aliquet. Aliquam imperdiet, lorem a sagittis lobortis, nisi purus
62
- accumsan orci, in euismod magna quam sit amet turpis. Etiam quam diam, consectetur id
63
- fermentum at, rhoncus eget est. Sed gravida, magna in sollicitudin semper, neque risus
64
- dapibus dui, sed semper augue lorem eget nulla. Cras et pretium mi, quis auctor massa. Nulla
65
- convallis ipsum nunc, a maximus sem porta ac. Class aptent taciti sociosqu ad litora
66
- torquent per conubia nostra, per inceptos himenaeos. Praesent sed dui nec ex sodales
67
- viverra. Sed vehicula ornare urna, a hendrerit ante tristique vel.
68
- </p>
69
- </div>
70
- );
71
- };
@@ -1,35 +0,0 @@
1
- import { Wizard } from "../../src";
2
-
3
- export default {
4
- title: "Wizard",
5
- component: Wizard,
6
- };
7
-
8
- export const Basic = () => {
9
- return (
10
- <Wizard
11
- step={10}
12
- renderHeader={() => <h1>My wizard</h1>}
13
- renderFooter={({ previousStep, nextStep }) => (
14
- <div>
15
- <button onClick={previousStep}>previous</button>
16
- <button onClick={nextStep}>next</button>
17
- </div>
18
- )}
19
- >
20
- <div>
21
- <h2>Step 1</h2>
22
- <p>Welcome to the first step</p>
23
- </div>
24
-
25
- <div>
26
- <h2>Step 2</h2>
27
- </div>
28
-
29
- <div>
30
- <h2>Step 3</h2>
31
- <p>Welcome to the last step</p>
32
- </div>
33
- </Wizard>
34
- );
35
- };
@@ -1,23 +0,0 @@
1
- import { usePagination, mountReactHook } from "../../src";
2
-
3
- describe("usePagination", () => {
4
- const Pagination = (props: ObjectLiteral) =>
5
- props.children(
6
- usePagination({
7
- page: 1,
8
- totalRecords: 15,
9
- maxRecordsPerPage: 10,
10
- itemNeighbours: 2,
11
- minItems: 5,
12
- }),
13
- );
14
-
15
- it("should return correct values", () => {
16
- const { value } = mountReactHook(Pagination);
17
-
18
- expect(value.page).toBe(1);
19
- expect(value.total).toBe(2);
20
- expect(value.items).toEqual([1, 2]);
21
- expect(value.maxRecordsPerPage).toBe(10);
22
- });
23
- });
package/tests/setup.js DELETED
@@ -1,23 +0,0 @@
1
- window.IntersectionObserver = class IntersectionObserver {
2
- observe() {
3
- return null;
4
- }
5
-
6
- unobserve() {
7
- return null;
8
- }
9
- };
10
-
11
- Object.defineProperty(window, "matchMedia", {
12
- writable: true,
13
- value: jest.fn().mockImplementation((query) => ({
14
- matches: query,
15
- media: query,
16
- onchange: null,
17
- addListener: jest.fn(), // deprecated
18
- removeListener: jest.fn(), // deprecated
19
- addEventListener: jest.fn(),
20
- removeEventListener: jest.fn(),
21
- dispatchEvent: jest.fn(),
22
- })),
23
- });
@@ -1,32 +0,0 @@
1
- import useMatchResolution from "../../src/match-resolution/use-match-resolution";
2
- import mountReactHook from "../../src/mount-react-hook/mount-react-hook";
3
-
4
- describe("useMatchResolution", () => {
5
- let addResizeListener: jest.SpyInstance;
6
- let removeResizeListener: jest.SpyInstance;
7
-
8
- const MatchResolution = (props: ObjectLiteral) => props.children(useMatchResolution());
9
-
10
- beforeAll(() => {
11
- addResizeListener = jest.spyOn(window, "addEventListener");
12
- removeResizeListener = jest.spyOn(window, "removeEventListener");
13
- });
14
-
15
- afterEach(() => {
16
- jest.clearAllMocks();
17
- });
18
-
19
- it("should add 'resize' event when component is mounted", () => {
20
- mountReactHook(MatchResolution);
21
-
22
- expect(addResizeListener).toHaveBeenCalledWith("resize", expect.any(Function));
23
- });
24
-
25
- it("should remove 'resize' event when component is unmounted", () => {
26
- const { unmount } = mountReactHook(MatchResolution);
27
-
28
- unmount();
29
-
30
- expect(removeResizeListener).toHaveBeenCalledWith("resize", expect.any(Function));
31
- });
32
- });
@@ -1,53 +0,0 @@
1
- import React, { ForwardedRef, forwardRef, RefObject } from "react";
2
- import ObjectLiteral from "@vincentgraul/types/src/ObjectLiteral";
3
- import useVisible from "../../src/visible/use-visible";
4
- import mountReactHook from "../../src/mount-react-hook/mount-react-hook";
5
-
6
- describe("useVisible", () => {
7
- let observeSpy: jest.SpyInstance;
8
- let unobserveSpy: jest.SpyInstance;
9
-
10
- const Visible = forwardRef((props: ObjectLiteral, ref: ForwardedRef<HTMLElement>) =>
11
- props.children(useVisible(ref as RefObject<HTMLElement>)),
12
- );
13
-
14
- beforeAll(() => {
15
- observeSpy = jest.spyOn(window.IntersectionObserver.prototype, "observe");
16
- unobserveSpy = jest.spyOn(window.IntersectionObserver.prototype, "unobserve");
17
- });
18
-
19
- afterEach(() => {
20
- jest.clearAllMocks();
21
- });
22
-
23
- it("should observe when element exists", () => {
24
- const ref = { current: <div>Test</div> };
25
-
26
- mountReactHook(Visible, { ref, options: { once: true } });
27
-
28
- expect(observeSpy).toHaveBeenCalledTimes(1);
29
- });
30
-
31
- it("should not observe element when element doesn't exists", () => {
32
- mountReactHook(Visible, { options: { once: true } });
33
-
34
- expect(observeSpy).toHaveBeenCalledTimes(0);
35
- });
36
-
37
- it("should unobserve when element exists", () => {
38
- const ref = { current: <div>Test</div> };
39
- const { unmount } = mountReactHook(Visible, { ref, options: { once: true } });
40
-
41
- unmount();
42
-
43
- expect(unobserveSpy).toHaveBeenCalledTimes(1);
44
- });
45
-
46
- it("should not unobserve when element doesn't exists", () => {
47
- const { unmount } = mountReactHook(Visible, { options: { once: true } });
48
-
49
- unmount();
50
-
51
- expect(unobserveSpy).toHaveBeenCalledTimes(0);
52
- });
53
- });
package/tsconfig.json DELETED
@@ -1,16 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2015",
4
- "module": "ESNext",
5
- "outDir": "dist",
6
- "moduleResolution": "Node",
7
- "jsx": "react-jsx",
8
- "declaration": true,
9
- "declarationMap": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "removeComments": true,
13
- "resolveJsonModule": true
14
- },
15
- "include": ["src", "types.d.ts"]
16
- }