@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,28 +0,0 @@
1
- import React, { ComponentType } from "react";
2
- import { render } from "@testing-library/react";
3
- import { MountedHook } from "./mount-react-hook.types";
4
-
5
- /**
6
- * React hook to mount a hook in an unit test.
7
- * @public
8
- * @param Component - The component to be tested.
9
- * @param props - Props passed to the component.
10
- * @returns The component, the value it returns and a function to unmount the component.
11
- */
12
- export const mountReactHook = (
13
- Component: ComponentType,
14
- props: ObjectLiteral = {},
15
- ): MountedHook => {
16
- let value: ObjectLiteral | Primitive = null;
17
-
18
- const { container, unmount } = render(
19
- <Component {...props}>
20
- {(hookValue: ObjectLiteral | Primitive) => {
21
- value = hookValue;
22
- return null;
23
- }}
24
- </Component>,
25
- );
26
-
27
- return { container, unmount, value };
28
- };
@@ -1,5 +0,0 @@
1
- export type MountedHook = {
2
- container: HTMLElement;
3
- unmount: () => void;
4
- value: ObjectLiteral | Primitive;
5
- };
@@ -1,2 +0,0 @@
1
- export * from "./pagination";
2
- export * from "./pagination.types";
@@ -1,31 +0,0 @@
1
- .container {
2
- --hover-background-color: lightgrey;
3
- --hover-text-color: black;
4
- --selected-background-color: black;
5
- --selected-text-color: white;
6
-
7
- display: flex;
8
- }
9
-
10
- .item {
11
- border-style: solid;
12
- border-width: 1px 1px 1px 0;
13
- padding: 0.5rem 1rem 0.5rem 1rem;
14
- display: flex;
15
- align-items: center;
16
- cursor: pointer;
17
-
18
- &:first-child {
19
- border-width: 1px 1px 1px 1px;
20
- }
21
-
22
- &:hover:not(.selected) {
23
- background-color: var(--hover-background-color);
24
- color: var(--hover-text-color);
25
- }
26
-
27
- &.selected {
28
- background-color: var(--selected-background-color);
29
- color: var(--selected-text-color);
30
- }
31
- }
@@ -1,90 +0,0 @@
1
- import React, { CSSProperties, ReactNode } from "react";
2
- import clsx from "clsx";
3
- import styles from "./pagination.module.css";
4
- import { PaginationData, PaginationColors } from "..";
5
-
6
- export enum ArrowPosition {
7
- LEFT,
8
- RIGHT,
9
- }
10
-
11
- type Props = PaginationData & {
12
- colors?: PaginationColors;
13
- renderSingleArrow?: (position: ArrowPosition) => ReactNode;
14
- renderDoubleArrow?: (position: ArrowPosition) => ReactNode;
15
- };
16
-
17
- /**
18
- * React component used to display a pagination (with numbers).
19
- * @public
20
- * @param props - An object which contains:
21
- * - properties inherited from the Pagination interface in usePagination hook
22
- * - some properties to customise the rendering
23
- * @returns A React component.
24
- */
25
- export const Pagination = ({
26
- page,
27
- total,
28
- items,
29
- colors,
30
- goToFirst,
31
- goToLeft,
32
- goToRight,
33
- goToLast,
34
- goToPage,
35
- renderSingleArrow,
36
- renderDoubleArrow,
37
- }: Props) => {
38
- const CSSVariables = {
39
- "--hover-background-color": colors?.hover.background,
40
- "--hover-text-color": colors?.hover.text,
41
- "--selected-background-color": colors?.selected.background,
42
- "--selected-text-color": colors?.selected.text,
43
- } as CSSProperties;
44
-
45
- return (
46
- <div className={styles.container} style={CSSVariables}>
47
- {page > 1 && (
48
- <>
49
- {renderDoubleArrow && (
50
- <div className={styles.item} onClick={() => goToFirst()}>
51
- {renderDoubleArrow(ArrowPosition.LEFT)}
52
- </div>
53
- )}
54
-
55
- {renderSingleArrow && (
56
- <div className={styles.item} onClick={() => goToLeft()}>
57
- {renderSingleArrow(ArrowPosition.LEFT)}
58
- </div>
59
- )}
60
- </>
61
- )}
62
-
63
- {items.map((currentPage: number, index: number) => (
64
- <div
65
- className={clsx(styles.item, currentPage === page && styles.selected)}
66
- key={index}
67
- onClick={() => goToPage(currentPage)}
68
- >
69
- {currentPage}
70
- </div>
71
- ))}
72
-
73
- {page < total && (
74
- <>
75
- {renderSingleArrow && (
76
- <div className={styles.item} onClick={() => goToRight()}>
77
- {renderSingleArrow(ArrowPosition.RIGHT)}
78
- </div>
79
- )}
80
-
81
- {renderDoubleArrow && (
82
- <div className={styles.item} onClick={() => goToLast()}>
83
- {renderDoubleArrow(ArrowPosition.RIGHT)}
84
- </div>
85
- )}
86
- </>
87
- )}
88
- </div>
89
- );
90
- };
@@ -1,4 +0,0 @@
1
- export type PaginationColors = {
2
- hover: { background: string; text: string };
3
- selected: { background: string; text: string };
4
- };
@@ -1,12 +0,0 @@
1
- import * as React from "react";
2
- import type { SVGProps } from "react";
3
- const SvgArrowBottom = (props: SVGProps<SVGSVGElement>) => (
4
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 18" {...props}>
5
- <path
6
- fill="#171D27"
7
- fillRule="nonzero"
8
- d="m17.202 17.352 13.46-13.577a2.224 2.224 0 0 0 0-3.127 2.179 2.179 0 0 0-3.1 0l-11.91 12.014L3.742.648a2.18 2.18 0 0 0-3.1 0 2.225 2.225 0 0 0 0 3.127l13.46 13.578a2.175 2.175 0 0 0 3.1 0Z"
9
- />
10
- </svg>
11
- );
12
- export default SvgArrowBottom;
@@ -1 +0,0 @@
1
- export { default as ArrowBottom } from "./ArrowBottom";
@@ -1,2 +0,0 @@
1
- export * from "./select";
2
- export * from "./select.types";
@@ -1,54 +0,0 @@
1
- .container {
2
- width: fit-content;
3
- }
4
-
5
- .selected-option-container {
6
- display: flex;
7
- align-items: center;
8
- cursor: pointer;
9
- user-select: none;
10
- padding: 10px;
11
- background-color: white;
12
- border-radius: 5px;
13
- }
14
-
15
- .selected-option-text {
16
- padding-right: 10px;
17
- border-right: 1px solid black;
18
- }
19
-
20
- .selected-option-arrow {
21
- width: 15px;
22
- margin-left: 10px;
23
- }
24
-
25
- .options-list {
26
- width: 100%;
27
- list-style: none;
28
- padding: 0;
29
- margin: 10px 0 0 0;
30
- user-select: none;
31
- background-color: white;
32
- border-radius: 5px;
33
- }
34
-
35
- .option {
36
- padding: 10px;
37
- cursor: pointer;
38
-
39
- &:hover {
40
- background-color: #ecf0f1;
41
-
42
- &:first-child {
43
- border-radius: 5px 5px 0 0;
44
- }
45
-
46
- &:last-child {
47
- border-radius: 0 0 5px 5px;
48
- }
49
-
50
- &:only-child {
51
- border-radius: 5px;
52
- }
53
- }
54
- }
@@ -1,85 +0,0 @@
1
- import React, { useEffect, useRef, useState } from "react";
2
- import styles from "./select.module.css";
3
- import { SelectOptionWithoutId, SelectOption } from "./select.types";
4
- import { useOutsideAlerter } from "..";
5
- import { ArrowBottom } from "./icons";
6
-
7
- type Props = {
8
- options: SelectOptionWithoutId[];
9
- selectedValue?: string;
10
- onChange?: (option: SelectOption) => void;
11
- };
12
-
13
- export const Select = ({ options: optionsProps, selectedValue, onChange }: Props) => {
14
- const [options, setOptions] = useState<SelectOption[]>(null);
15
- const [isListVisible, setListVisibility] = useState<boolean>(false);
16
- const [selectedOption, setSelectedOption] = useState<SelectOption>(null);
17
- const ref = useRef(null);
18
- const { hasClickedOutside, onReset: onResetOutsideAlerter } = useOutsideAlerter(ref);
19
-
20
- const handleSelectedOptionClick = () => {
21
- onResetOutsideAlerter();
22
- setListVisibility(!isListVisible);
23
- };
24
-
25
- const handleOptionClick = (option: SelectOption) => {
26
- setSelectedOption(option);
27
- setListVisibility(false);
28
-
29
- if (onChange) {
30
- onChange(option);
31
- }
32
- };
33
-
34
- useEffect(() => {
35
- setOptions(
36
- optionsProps.map((option: SelectOptionWithoutId, index: number) => ({
37
- ...option,
38
- id: index,
39
- })),
40
- );
41
- }, [optionsProps]);
42
-
43
- useEffect(() => {
44
- if (options && !selectedOption) {
45
- setSelectedOption(
46
- selectedValue ? options.find((option) => option.value === selectedValue) : options[0],
47
- );
48
- }
49
- }, [options]);
50
-
51
- useEffect(() => {
52
- if (hasClickedOutside) {
53
- setListVisibility(false);
54
- }
55
- }, [hasClickedOutside]);
56
-
57
- if (!options || !selectedOption) {
58
- return null;
59
- }
60
-
61
- return (
62
- <div className={styles.container} ref={ref}>
63
- <div className={styles["selected-option-container"]} onClick={handleSelectedOptionClick}>
64
- <span className={styles["selected-option-text"]}>{selectedOption.label}</span>
65
- <ArrowBottom className={styles["selected-option-arrow"]} />
66
- </div>
67
-
68
- {isListVisible && (
69
- <ul className={styles["options-list"]}>
70
- {options
71
- .filter((option: SelectOption) => option.id !== selectedOption.id)
72
- .map((option: SelectOption) => (
73
- <li
74
- className={styles.option}
75
- key={option.id}
76
- onClick={() => handleOptionClick(option)}
77
- >
78
- {option.label}
79
- </li>
80
- ))}
81
- </ul>
82
- )}
83
- </div>
84
- );
85
- };
@@ -1,9 +0,0 @@
1
- import { ReactNode } from "react";
2
-
3
- export type SelectOption = {
4
- id: number;
5
- label: string | ReactNode;
6
- value: string;
7
- };
8
-
9
- export type SelectOptionWithoutId = Omit<SelectOption, "id">;
@@ -1,2 +0,0 @@
1
- export * from "./table";
2
- export * from "./table.types";
@@ -1,33 +0,0 @@
1
- .container {
2
- display: flex;
3
- flex-flow: column;
4
- }
5
-
6
- .main {
7
- width: 100%;
8
- table-layout: fixed;
9
- border-collapse: collapse;
10
- }
11
-
12
- .tbody {
13
- user-select: text;
14
- tr:last-child {
15
- border: none;
16
- }
17
- }
18
-
19
- .th {
20
- padding: 2rem 1rem 1rem 0;
21
- word-wrap: break-word;
22
- white-space: nowrap;
23
- }
24
-
25
- .tr {
26
- text-align: center;
27
- border-bottom: 2px solid black;
28
- }
29
-
30
- .td {
31
- padding: 2rem 1rem 1rem 0;
32
- word-wrap: break-word;
33
- }
@@ -1,83 +0,0 @@
1
- import React, { ReactNode, PropsWithChildren } from "react";
2
- import styles from "./table.module.css";
3
- import { Column } from "./table.types";
4
-
5
- type Props<T> = {
6
- columns: Column[];
7
- records: T[];
8
- renderHeader?: () => ReactNode;
9
- renderFooter?: () => ReactNode;
10
- renderColumnsRow?: (columns: ReactNode) => ReactNode;
11
- renderColumnsCell?: (column: Column, key: string) => ReactNode;
12
- renderRecordsRow?: (cells: ReactNode, key: string) => ReactNode;
13
- renderRecordsCell?: (cell: Primitive, key: string) => ReactNode;
14
- renderRecordsEmptyCell?: (key: string) => ReactNode;
15
- renderNoRecords?: () => ReactNode;
16
- };
17
-
18
- /**
19
- * React component used to display a data table.
20
- * @public
21
- * @param props - An Object which contains:
22
- * - columns: the table columns
23
- * - records: the table records
24
- * - some properties to customise the rendering
25
- * @returns A React component.
26
- */
27
- export const Table = <T,>({
28
- columns,
29
- records,
30
- renderHeader = () => null,
31
- renderFooter = () => null,
32
- renderColumnsRow = (columns: ReactNode) => <tr>{columns}</tr>,
33
- renderColumnsCell = (column: Column, key: string) => <Th key={key}>{column.name}</Th>,
34
- renderRecordsRow = (cells: ReactNode, key: string) => <Tr key={key}>{cells}</Tr>,
35
- renderRecordsCell = (cell: Primitive, key: string) => <Td key={key}>{cell}</Td>,
36
- renderRecordsEmptyCell = (key: string) => <Td key={key}>X</Td>,
37
- renderNoRecords = () => null,
38
- }: Props<T>) => {
39
- const displayColumns = () =>
40
- renderColumnsRow(
41
- columns.map((column: Column, index: number) => renderColumnsCell(column, `column-${index}`)),
42
- );
43
-
44
- const displayRows = () => {
45
- const columnNames: string[] = columns.map((column: Column) => column.name);
46
-
47
- return records.map((record: T, rowIndex: number) => {
48
- const cells: Primitive[] = columnNames.map((name: string) => (record as ObjectLiteral)[name]);
49
-
50
- return renderRecordsRow(
51
- cells.map((cell: Primitive, cellIndex: number) =>
52
- cell
53
- ? renderRecordsCell(cell, `cell-${cellIndex}`)
54
- : renderRecordsEmptyCell(`cell-${cellIndex}`),
55
- ),
56
- `row-${rowIndex}`,
57
- );
58
- });
59
- };
60
-
61
- return (
62
- <div className={styles.container}>
63
- {renderHeader()}
64
-
65
- {records.length === 0 ? (
66
- renderNoRecords()
67
- ) : (
68
- <>
69
- <table className={styles.main}>
70
- <thead>{displayColumns()}</thead>
71
- <tbody className={styles.tbody}>{displayRows()}</tbody>
72
- </table>
73
- </>
74
- )}
75
-
76
- {renderFooter()}
77
- </div>
78
- );
79
- };
80
-
81
- export const Th = ({ children }: PropsWithChildren) => <th className={styles.th}>{children}</th>;
82
- export const Tr = ({ children }: PropsWithChildren) => <tr className={styles.tr}>{children}</tr>;
83
- export const Td = ({ children }: PropsWithChildren) => <th className={styles.td}>{children}</th>;
@@ -1,5 +0,0 @@
1
- export type Column = {
2
- name: string;
3
- label: string;
4
- [field: string]: any;
5
- };
@@ -1,2 +0,0 @@
1
- export * from "./use-breadcrumb";
2
- export * from "./use-breadcrumb.types";
@@ -1,35 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { BreadcrumbType, BreadcrumbElementType } from "./use-breadcrumb.types";
3
-
4
- export const useBreadcrumb = ({
5
- url = new URL(location.href),
6
- mapping,
7
- }: BreadcrumbType): BreadcrumbElementType[] => {
8
- const [elements, setElements] = useState<BreadcrumbElementType[]>([]);
9
-
10
- const prepareElements = (paths: string[]) => {
11
- let previousPath: string = "";
12
- paths.shift();
13
-
14
- return paths.map((path: string) => {
15
- let label: string = path;
16
- const url = `${previousPath}/${path}`;
17
- previousPath = url;
18
-
19
- if (mapping) {
20
- const value = mapping.find((value) => value.url === path);
21
- label = value ? value.label : path;
22
- }
23
-
24
- return { label, url };
25
- });
26
- };
27
-
28
- useEffect(() => {
29
- const paths: string[] = url.pathname.split("/");
30
-
31
- setElements(prepareElements(paths));
32
- }, []);
33
-
34
- return elements;
35
- };
@@ -1,12 +0,0 @@
1
- export type BreadcrumbElementType = {
2
- label: string;
3
- url: string;
4
- };
5
-
6
- export type BreadcrumbType = {
7
- url?: URL;
8
- mapping?: {
9
- url: string;
10
- label: string;
11
- }[];
12
- };
@@ -1,2 +0,0 @@
1
- export * from "./use-match-device";
2
- export * from "./use-match-device.types";
@@ -1,41 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import UAParser from "ua-parser-js";
3
- import { Device } from "./use-match-device.types";
4
-
5
- /**
6
- * React hook to detect the device (mobile, tablet or desktop) based on the user agent.
7
- * @public
8
- * @param UA - The user agent.
9
- * @returns An object with multiple properties (isMobile, isTablet...) used to detect the device.
10
- */
11
- export const useMatchDevice = (UA: string): Device => {
12
- const isClientSide: boolean = typeof window !== "undefined";
13
-
14
- const compute = () => {
15
- const parser = new UAParser.UAParser(UA);
16
- const { type } = parser.getDevice();
17
-
18
- const device: Device = {
19
- isMobile: type === "mobile",
20
- isTablet: type === "tablet",
21
- isMobileOrTablet: false,
22
- isDesktop: !type,
23
- };
24
-
25
- device.isMobileOrTablet = device.isMobile || device.isTablet;
26
-
27
- return device;
28
- };
29
-
30
- if (!isClientSide) {
31
- return compute();
32
- }
33
-
34
- const [device, setDevice] = useState<Device>(compute());
35
-
36
- useEffect(() => {
37
- setDevice(compute());
38
- }, [UA]);
39
-
40
- return device;
41
- };
@@ -1,6 +0,0 @@
1
- export type Device = {
2
- isMobile: boolean;
3
- isTablet: boolean;
4
- isMobileOrTablet: boolean;
5
- isDesktop: boolean;
6
- };
@@ -1,2 +0,0 @@
1
- export * from "./use-match-resolution";
2
- export * from "./use-match-resolution.types";
@@ -1,72 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { Breakpoints, MatchResolution, Resolution } from "./use-match-resolution.types";
3
- import { useMatchDevice } from "..";
4
-
5
- export const defaultBreakpoints: Breakpoints = {
6
- desktop: "(min-width: 1281px)",
7
- laptop: "(min-width: 1025px) and (max-width: 1280px)",
8
- laptopOrUpper: "(min-width: 1025px)",
9
- laptopOrLower: "(max-width: 1280px)",
10
- tablet: "(min-width: 768px) and (max-width: 1024px)",
11
- tabletOrUpper: "(min-width: 768px)",
12
- tabletOrLower: "(max-width: 1024px)",
13
- largeMobile: "(min-width: 481px) and (max-width: 767px)",
14
- largeMobileOrUpper: "(min-width: 481px)",
15
- largeMobileOrLower: "(max-width: 767px)",
16
- mobile: "(min-width: 320px) and (max-width: 480px)",
17
- portrait: "(orientation: portrait)",
18
- landscape: "(orientation: landscape)",
19
- };
20
-
21
- /**
22
- * React hook to detect the resolution (desktop, laptop, tablet, mobile...).
23
- * @public
24
- * @param breakpoints - List of breakpoints (used for determine when a resolution is a "desktop", a "laptop" etc.).
25
- * @param UA - The user agent (used for determine the resolution in case of SSR).
26
- * @returns An object with three properties:
27
- * - resolution: object with multiple properties (isDesktop, isLaptop...) used for know the current resolution
28
- * - breakpoints: the breakpoints passed as parameters
29
- * - match: function used to detect the current resolution with a custom breakpoint
30
- */
31
- export const useMatchResolution = (
32
- breakpoints: Breakpoints = defaultBreakpoints,
33
- UA: string = "",
34
- ): MatchResolution => {
35
- const isClientSide: boolean = typeof window !== "undefined";
36
- const { isDesktop, isMobile } = useMatchDevice(UA);
37
-
38
- const match = (query: string): boolean => isClientSide && window.matchMedia(query).matches;
39
-
40
- const compute = (): Resolution => ({
41
- isDesktop: isClientSide ? match(breakpoints.desktop) : isDesktop,
42
- isLaptop: isClientSide ? match(breakpoints.laptop) : isDesktop,
43
- isLaptopOrUpper: isClientSide ? match(breakpoints.laptopOrUpper) : isDesktop,
44
- isLaptopOrLower: isClientSide ? match(breakpoints.laptopOrLower) : false,
45
- isTablet: isClientSide ? match(breakpoints.tablet) : isMobile,
46
- isTabletOrUpper: isClientSide ? match(breakpoints.tabletOrUpper) : false,
47
- isTabletOrLower: isClientSide ? match(breakpoints.tabletOrLower) : isMobile,
48
- isLargeMobile: isClientSide ? match(breakpoints.largeMobile) : isMobile,
49
- isLargeMobileOrUpper: isClientSide ? match(breakpoints.largeMobileOrUpper) : false,
50
- isLargeMobileOrLower: isClientSide ? match(breakpoints.largeMobileOrLower) : isMobile,
51
- isMobile: isClientSide ? match(breakpoints.mobile) : isMobile,
52
- isPortrait: isClientSide ? match(breakpoints.portrait) : false,
53
- isLandscape: isClientSide ? match(breakpoints.landscape) : false,
54
- });
55
-
56
- const [resolution, setResolution] = useState<Resolution>(compute());
57
-
58
- useEffect(() => {
59
- const onResize = () => setResolution(compute());
60
-
61
- window.addEventListener("resize", onResize);
62
- return () => {
63
- window.removeEventListener("resize", onResize);
64
- };
65
- }, []);
66
-
67
- useEffect(() => {
68
- setResolution(compute());
69
- }, [breakpoints]);
70
-
71
- return { resolution, breakpoints, match };
72
- };