codeforlife 2.8.3 → 2.9.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 (454) hide show
  1. package/dist/Countdown-DFI1RljW.js +28 -0
  2. package/dist/Countdown-DFI1RljW.js.map +1 -0
  3. package/dist/Countdown-zY3nMzmi.cjs +2 -0
  4. package/dist/Countdown-zY3nMzmi.cjs.map +1 -0
  5. package/dist/Image-D5jC9UoX.js +21 -0
  6. package/dist/Image-D5jC9UoX.js.map +1 -0
  7. package/dist/Image-mgT45r_B.cjs +2 -0
  8. package/dist/Image-mgT45r_B.cjs.map +1 -0
  9. package/dist/LinkButton-BYFkvL_O.cjs +2 -0
  10. package/dist/LinkButton-BYFkvL_O.cjs.map +1 -0
  11. package/dist/LinkButton-oK0RThqn.js +12 -0
  12. package/dist/LinkButton-oK0RThqn.js.map +1 -0
  13. package/dist/Navigate-Dq47aqC8.js +25 -0
  14. package/dist/Navigate-Dq47aqC8.js.map +1 -0
  15. package/dist/Navigate-dQocLhzN.cjs +2 -0
  16. package/dist/Navigate-dQocLhzN.cjs.map +1 -0
  17. package/dist/api/createApi.d.ts +7 -0
  18. package/dist/api/endpoints/authFactor.d.ts +11 -0
  19. package/dist/api/endpoints/index.cjs.js +2 -0
  20. package/dist/api/endpoints/index.cjs.js.map +1 -0
  21. package/dist/api/endpoints/index.d.ts +9 -0
  22. package/dist/api/endpoints/index.es.js +78 -0
  23. package/dist/api/endpoints/index.es.js.map +1 -0
  24. package/dist/api/endpoints/klass.d.ts +26 -0
  25. package/dist/api/endpoints/school.d.ts +11 -0
  26. package/dist/api/endpoints/session.d.ts +9 -0
  27. package/dist/api/endpoints/user.d.ts +19 -0
  28. package/dist/api/index.cjs.js +4 -0
  29. package/dist/api/index.cjs.js.map +1 -0
  30. package/dist/api/index.d.ts +5 -0
  31. package/dist/api/index.es.js +541 -0
  32. package/dist/api/index.es.js.map +1 -0
  33. package/dist/api/models.d.ts +92 -0
  34. package/dist/api/schemas.d.ts +20 -0
  35. package/dist/api/tagTypes.d.ts +3 -0
  36. package/dist/api/urls.d.ts +31 -0
  37. package/dist/api-Cbyt3rw0.js +92 -0
  38. package/dist/api-Cbyt3rw0.js.map +1 -0
  39. package/dist/api-CnMfjRk3.cjs +2 -0
  40. package/dist/api-CnMfjRk3.cjs.map +1 -0
  41. package/dist/api-Cs4Y-WeI.js +20 -0
  42. package/dist/api-Cs4Y-WeI.js.map +1 -0
  43. package/dist/api-DIgp_6Vr.cjs +2 -0
  44. package/dist/api-DIgp_6Vr.cjs.map +1 -0
  45. package/dist/auth-BPfUPjmM.js +237 -0
  46. package/dist/auth-BPfUPjmM.js.map +1 -0
  47. package/dist/auth-Vf1MgMci.cjs +2 -0
  48. package/dist/auth-Vf1MgMci.cjs.map +1 -0
  49. package/dist/components/App.d.ts +18 -0
  50. package/dist/components/ClickableTooltip.d.ts +6 -0
  51. package/dist/components/CopyIconButton.d.ts +7 -0
  52. package/dist/components/CopyIconButton.test.d.ts +1 -0
  53. package/dist/components/Countdown.d.ts +9 -0
  54. package/dist/components/DownloadFileButton.d.ts +13 -0
  55. package/dist/components/ElevatedAppBar.d.ts +8 -0
  56. package/dist/components/Image.d.ts +10 -0
  57. package/dist/components/InputFileButton.d.ts +7 -0
  58. package/dist/components/ItemizedList.d.ts +11 -0
  59. package/dist/components/OrderedGrid.d.ts +21 -0
  60. package/dist/components/ScrollIntoViewLink.d.ts +8 -0
  61. package/dist/components/SyncError.d.ts +5 -0
  62. package/dist/components/TablePagination.d.ts +20 -0
  63. package/dist/components/YouTubeVideo.d.ts +7 -0
  64. package/dist/components/form/ApiAutocompleteField.d.ts +14 -0
  65. package/dist/components/form/AutocompleteField.d.ts +11 -0
  66. package/dist/components/form/CheckboxField.d.ts +11 -0
  67. package/dist/components/form/CountryField.d.ts +10 -0
  68. package/dist/components/form/DatePickerField.d.ts +10 -0
  69. package/dist/components/form/EmailField.d.ts +5 -0
  70. package/dist/components/form/FirstNameField.d.ts +5 -0
  71. package/dist/components/form/Form.d.ts +36 -0
  72. package/dist/components/form/OtpField.d.ts +5 -0
  73. package/dist/components/form/PasswordField.d.ts +9 -0
  74. package/dist/components/form/RepeatField.d.ts +9 -0
  75. package/dist/components/form/SubmitButton.d.ts +6 -0
  76. package/dist/components/form/TextField.d.ts +14 -0
  77. package/dist/components/form/UkCountyField.d.ts +10 -0
  78. package/dist/components/form/index.cjs.js +2 -0
  79. package/dist/components/form/index.cjs.js.map +1 -0
  80. package/dist/components/form/index.d.ts +14 -0
  81. package/dist/components/form/index.es.js +18 -0
  82. package/dist/components/form/index.es.js.map +1 -0
  83. package/dist/components/index.cjs.js +11 -0
  84. package/dist/components/index.cjs.js.map +1 -0
  85. package/dist/components/index.d.ts +18 -0
  86. package/dist/components/index.es.js +383 -0
  87. package/dist/components/index.es.js.map +1 -0
  88. package/dist/components/page/Banner.d.ts +13 -0
  89. package/dist/components/page/Notification.d.ts +10 -0
  90. package/dist/components/page/Page.d.ts +19 -0
  91. package/dist/components/page/Section.d.ts +7 -0
  92. package/dist/components/page/TabBar.d.ts +13 -0
  93. package/dist/components/page/index.cjs.js +2 -0
  94. package/dist/components/page/index.cjs.js.map +1 -0
  95. package/dist/components/page/index.d.ts +5 -0
  96. package/dist/components/page/index.es.js +9 -0
  97. package/dist/components/page/index.es.js.map +1 -0
  98. package/dist/components/router/Link.d.ts +9 -0
  99. package/dist/components/router/LinkButton.d.ts +9 -0
  100. package/dist/components/router/LinkIconButton.d.ts +9 -0
  101. package/dist/components/router/LinkListItem.d.ts +9 -0
  102. package/dist/components/router/LinkTab.d.ts +9 -0
  103. package/dist/components/router/Navigate.d.ts +15 -0
  104. package/dist/components/router/index.cjs.js +2 -0
  105. package/dist/components/router/index.cjs.js.map +1 -0
  106. package/dist/components/router/index.d.ts +6 -0
  107. package/dist/components/router/index.es.js +11 -0
  108. package/dist/components/router/index.es.js.map +1 -0
  109. package/dist/components/table/CellStack.d.ts +7 -0
  110. package/dist/components/table/Table.d.ts +12 -0
  111. package/dist/components/table/index.cjs.js +2 -0
  112. package/dist/components/table/index.cjs.js.map +1 -0
  113. package/dist/components/table/index.d.ts +3 -0
  114. package/dist/components/table/index.es.js +9 -0
  115. package/dist/components/table/index.es.js.map +1 -0
  116. package/dist/en-gb-B_rK7Jx1.js +20 -0
  117. package/dist/en-gb-B_rK7Jx1.js.map +1 -0
  118. package/dist/en-gb-CpyEkKq3.cjs +2 -0
  119. package/dist/en-gb-CpyEkKq3.cjs.map +1 -0
  120. package/dist/features/InactiveDialog.d.ts +7 -0
  121. package/dist/features/ScreenTimeDialog.d.ts +7 -0
  122. package/dist/features/index.cjs.js +2 -0
  123. package/dist/features/index.cjs.js.map +1 -0
  124. package/dist/features/index.d.ts +4 -0
  125. package/dist/features/index.es.js +47 -0
  126. package/dist/features/index.es.js.map +1 -0
  127. package/dist/general-BPbbmkeX.cjs +2 -0
  128. package/dist/general-BPbbmkeX.cjs.map +1 -0
  129. package/dist/general-CtTJPCJn.js +58 -0
  130. package/dist/general-CtTJPCJn.js.map +1 -0
  131. package/dist/hooks/api.d.ts +15 -0
  132. package/dist/hooks/auth.d.ts +46 -0
  133. package/{src/hooks/form.tsx → dist/hooks/form.d.ts} +2 -5
  134. package/dist/hooks/general.d.ts +13 -0
  135. package/dist/hooks/index.cjs.js +2 -0
  136. package/dist/hooks/index.cjs.js.map +1 -0
  137. package/dist/hooks/index.d.ts +5 -0
  138. package/dist/hooks/index.es.js +25 -0
  139. package/dist/hooks/index.es.js.map +1 -0
  140. package/dist/hooks/router.d.ts +29 -0
  141. package/dist/index-2W--_sNE.js +30 -0
  142. package/dist/index-2W--_sNE.js.map +1 -0
  143. package/dist/index-BUMdUVBH.cjs +5 -0
  144. package/dist/index-BUMdUVBH.cjs.map +1 -0
  145. package/dist/index-B_Zy_zwA.cjs +2 -0
  146. package/dist/index-B_Zy_zwA.cjs.map +1 -0
  147. package/dist/index-BgsynEGX.cjs +2 -0
  148. package/dist/index-BgsynEGX.cjs.map +1 -0
  149. package/dist/index-CA-ugBSa.cjs +2 -0
  150. package/dist/index-CA-ugBSa.cjs.map +1 -0
  151. package/dist/index-CNtOlJ49.js +572 -0
  152. package/dist/index-CNtOlJ49.js.map +1 -0
  153. package/dist/index-DkM_cG3a.js +237 -0
  154. package/dist/index-DkM_cG3a.js.map +1 -0
  155. package/dist/index-Dqp7dpn3.js +1111 -0
  156. package/dist/index-Dqp7dpn3.js.map +1 -0
  157. package/dist/index.cjs.js +2 -0
  158. package/dist/index.cjs.js.map +1 -0
  159. package/dist/index.d.ts +2 -0
  160. package/dist/index.es.js +7 -0
  161. package/dist/index.es.js.map +1 -0
  162. package/dist/jsx-runtime-CeSfJrVB.cjs +31 -0
  163. package/dist/jsx-runtime-CeSfJrVB.cjs.map +1 -0
  164. package/dist/jsx-runtime-Dpn_P65e.js +634 -0
  165. package/dist/jsx-runtime-Dpn_P65e.js.map +1 -0
  166. package/dist/middlewares/index.cjs.js +2 -0
  167. package/dist/middlewares/index.cjs.js.map +1 -0
  168. package/dist/middlewares/index.d.ts +1 -0
  169. package/dist/middlewares/index.es.js +10 -0
  170. package/dist/middlewares/index.es.js.map +1 -0
  171. package/dist/middlewares/session.d.ts +2 -0
  172. package/dist/palette-CE2mKYse.cjs +2 -0
  173. package/dist/palette-CE2mKYse.cjs.map +1 -0
  174. package/dist/palette-C_L0akN_.js +43 -0
  175. package/dist/palette-C_L0akN_.js.map +1 -0
  176. package/dist/rtk-query.modern-CjetfYPg.js +3038 -0
  177. package/dist/rtk-query.modern-CjetfYPg.js.map +1 -0
  178. package/dist/rtk-query.modern-PBCErCqb.cjs +15 -0
  179. package/dist/rtk-query.modern-PBCErCqb.cjs.map +1 -0
  180. package/dist/schemas-BZbJpkD5.cjs +2 -0
  181. package/dist/schemas-BZbJpkD5.cjs.map +1 -0
  182. package/dist/schemas-DlOtf2vf.js +162 -0
  183. package/dist/schemas-DlOtf2vf.js.map +1 -0
  184. package/dist/scripts/index.d.ts +0 -0
  185. package/dist/server.cjs.js +6 -0
  186. package/dist/server.cjs.js.map +1 -0
  187. package/dist/server.d.ts +44 -0
  188. package/dist/server.es.js +127 -0
  189. package/dist/server.es.js.map +1 -0
  190. package/dist/session-CE2U7oL1.cjs +2 -0
  191. package/dist/session-CE2U7oL1.cjs.map +1 -0
  192. package/dist/session-CacrgFSv.cjs +2 -0
  193. package/dist/session-CacrgFSv.cjs.map +1 -0
  194. package/dist/session-D312kYKk.js +32 -0
  195. package/dist/session-D312kYKk.js.map +1 -0
  196. package/dist/session-oI-Ht2C8.js +30 -0
  197. package/dist/session-oI-Ht2C8.js.map +1 -0
  198. package/dist/settings/custom.d.ts +11 -0
  199. package/dist/settings/index.cjs.js +2 -0
  200. package/dist/settings/index.cjs.js.map +1 -0
  201. package/dist/settings/index.d.ts +4 -0
  202. package/dist/settings/index.es.js +17 -0
  203. package/dist/settings/index.es.js.map +1 -0
  204. package/dist/settings/vite.d.ts +10 -0
  205. package/dist/setupTests.d.ts +0 -0
  206. package/dist/slices/createSlice.d.ts +3 -0
  207. package/dist/slices/index.cjs.js +2 -0
  208. package/dist/slices/index.cjs.js.map +1 -0
  209. package/dist/slices/index.d.ts +2 -0
  210. package/dist/slices/index.es.js +6 -0
  211. package/dist/slices/index.es.js.map +1 -0
  212. package/dist/slices/session.d.ts +28 -0
  213. package/dist/style.css +1 -0
  214. package/dist/theme/ThemedBox.d.ts +10 -0
  215. package/dist/theme/colors.d.ts +18 -0
  216. package/dist/theme/components/MuiAccordion.d.ts +3 -0
  217. package/dist/theme/components/MuiAutocomplete.d.ts +3 -0
  218. package/dist/theme/components/MuiButton.d.ts +3 -0
  219. package/dist/theme/components/MuiCardActions.d.ts +3 -0
  220. package/dist/theme/components/MuiCheckbox.d.ts +3 -0
  221. package/dist/theme/components/MuiContainer.d.ts +3 -0
  222. package/dist/theme/components/MuiDialog.d.ts +3 -0
  223. package/dist/theme/components/MuiFormControlLabel.d.ts +3 -0
  224. package/dist/theme/components/MuiFormHelperText.d.ts +3 -0
  225. package/dist/theme/components/MuiGrid2.d.ts +3 -0
  226. package/dist/theme/components/MuiInputBase.d.ts +3 -0
  227. package/dist/theme/components/MuiLink.d.ts +3 -0
  228. package/dist/theme/components/MuiList.d.ts +3 -0
  229. package/dist/theme/components/MuiListItemText.d.ts +3 -0
  230. package/dist/theme/components/MuiMenu.d.ts +3 -0
  231. package/dist/theme/components/MuiMenuItem.d.ts +3 -0
  232. package/dist/theme/components/MuiSelect.d.ts +3 -0
  233. package/dist/theme/components/MuiTab.d.ts +3 -0
  234. package/dist/theme/components/MuiTable.d.ts +3 -0
  235. package/dist/theme/components/MuiTableBody.d.ts +3 -0
  236. package/dist/theme/components/MuiTableHead.d.ts +3 -0
  237. package/dist/theme/components/MuiTabs.d.ts +3 -0
  238. package/dist/theme/components/MuiTextField.d.ts +3 -0
  239. package/dist/theme/components/MuiToolbar.d.ts +3 -0
  240. package/dist/theme/components/MuiTypography.d.ts +3 -0
  241. package/dist/theme/components/_components.d.ts +11 -0
  242. package/dist/theme/components/index.cjs.js +2 -0
  243. package/dist/theme/components/index.cjs.js.map +1 -0
  244. package/dist/theme/components/index.d.ts +3 -0
  245. package/dist/theme/components/index.es.js +6 -0
  246. package/dist/theme/components/index.es.js.map +1 -0
  247. package/dist/theme/index.cjs.js +2 -0
  248. package/dist/theme/index.cjs.js.map +1 -0
  249. package/dist/theme/index.d.ts +7 -0
  250. package/dist/theme/index.es.js +222 -0
  251. package/dist/theme/index.es.js.map +1 -0
  252. package/dist/theme/palette.d.ts +79 -0
  253. package/dist/theme/spacing.d.ts +1 -0
  254. package/dist/theme/typography.d.ts +4 -0
  255. package/dist/urls-DtHr1d3H.js +14 -0
  256. package/dist/urls-DtHr1d3H.js.map +1 -0
  257. package/dist/urls-MaVXL_C2.cjs +2 -0
  258. package/dist/urls-MaVXL_C2.cjs.map +1 -0
  259. package/dist/utils/api.cjs.js +2 -0
  260. package/dist/utils/api.cjs.js.map +1 -0
  261. package/dist/utils/api.d.ts +72 -0
  262. package/dist/utils/api.es.js +16 -0
  263. package/dist/utils/api.es.js.map +1 -0
  264. package/dist/utils/api.test.d.ts +1 -0
  265. package/dist/utils/auth.cjs.js +2 -0
  266. package/dist/utils/auth.cjs.js.map +1 -0
  267. package/dist/utils/auth.d.ts +28 -0
  268. package/dist/utils/auth.es.js +117 -0
  269. package/dist/utils/auth.es.js.map +1 -0
  270. package/dist/utils/form.cjs.js +2 -0
  271. package/dist/utils/form.cjs.js.map +1 -0
  272. package/dist/utils/form.d.ts +25 -0
  273. package/dist/utils/form.es.js +76 -0
  274. package/dist/utils/form.es.js.map +1 -0
  275. package/dist/utils/form.test.d.ts +1 -0
  276. package/dist/utils/general.cjs.js +2 -0
  277. package/dist/utils/general.cjs.js.map +1 -0
  278. package/dist/utils/general.d.ts +30 -0
  279. package/{src/utils/general.ts → dist/utils/general.es.js} +87 -165
  280. package/dist/utils/general.es.js.map +1 -0
  281. package/dist/utils/general.test.d.ts +1 -0
  282. package/dist/utils/router.cjs.js +2 -0
  283. package/dist/utils/router.cjs.js.map +1 -0
  284. package/dist/utils/router.d.ts +19 -0
  285. package/dist/utils/router.es.js +33 -0
  286. package/dist/utils/router.es.js.map +1 -0
  287. package/dist/utils/router.test.d.ts +1 -0
  288. package/dist/utils/schema.cjs.js +2 -0
  289. package/dist/utils/schema.cjs.js.map +1 -0
  290. package/dist/utils/schema.d.ts +43 -0
  291. package/dist/utils/schema.es.js +123 -0
  292. package/dist/utils/schema.es.js.map +1 -0
  293. package/dist/utils/store.cjs.js +2 -0
  294. package/dist/utils/store.cjs.js.map +1 -0
  295. package/dist/utils/store.d.ts +10 -0
  296. package/dist/utils/store.es.js +20 -0
  297. package/dist/utils/store.es.js.map +1 -0
  298. package/dist/utils/test.cjs.js +2 -0
  299. package/dist/utils/test.cjs.js.map +1 -0
  300. package/dist/utils/test.d.ts +53 -0
  301. package/dist/utils/test.es.js +60 -0
  302. package/dist/utils/test.es.js.map +1 -0
  303. package/dist/utils/theme.cjs.js +2 -0
  304. package/dist/utils/theme.cjs.js.map +1 -0
  305. package/dist/utils/theme.d.ts +11 -0
  306. package/dist/utils/theme.es.js +12 -0
  307. package/dist/utils/theme.es.js.map +1 -0
  308. package/dist/utils/window.cjs.js +2 -0
  309. package/dist/utils/window.cjs.js.map +1 -0
  310. package/dist/utils/window.d.ts +2 -0
  311. package/dist/utils/window.es.js +11 -0
  312. package/dist/utils/window.es.js.map +1 -0
  313. package/package.json +142 -37
  314. package/.github/workflows/main.yml +0 -55
  315. package/.prettierignore +0 -1
  316. package/CHANGELOG.md +0 -2027
  317. package/CONTRIBUTING.md +0 -3
  318. package/eslint.config.js +0 -17
  319. package/src/api/createApi.ts +0 -91
  320. package/src/api/endpoints/authFactor.ts +0 -31
  321. package/src/api/endpoints/index.ts +0 -9
  322. package/src/api/endpoints/klass.ts +0 -87
  323. package/src/api/endpoints/school.ts +0 -34
  324. package/src/api/endpoints/session.ts +0 -47
  325. package/src/api/endpoints/user.ts +0 -70
  326. package/src/api/index.ts +0 -5
  327. package/src/api/models.ts +0 -145
  328. package/src/api/schemas.ts +0 -243
  329. package/src/api/tagTypes.ts +0 -12
  330. package/src/api/urls.ts +0 -13
  331. package/src/components/App.css +0 -38
  332. package/src/components/App.tsx +0 -152
  333. package/src/components/ClickableTooltip.tsx +0 -43
  334. package/src/components/CopyIconButton.test.tsx +0 -16
  335. package/src/components/CopyIconButton.tsx +0 -27
  336. package/src/components/Countdown.tsx +0 -42
  337. package/src/components/DownloadFileButton.tsx +0 -55
  338. package/src/components/ElevatedAppBar.tsx +0 -41
  339. package/src/components/Image.tsx +0 -41
  340. package/src/components/InputFileButton.tsx +0 -27
  341. package/src/components/ItemizedList.tsx +0 -63
  342. package/src/components/OrderedGrid.tsx +0 -92
  343. package/src/components/ScrollIntoViewLink.tsx +0 -22
  344. package/src/components/SyncError.tsx +0 -14
  345. package/src/components/TablePagination.tsx +0 -142
  346. package/src/components/YouTubeVideo.tsx +0 -26
  347. package/src/components/form/ApiAutocompleteField.tsx +0 -187
  348. package/src/components/form/AutocompleteField.tsx +0 -135
  349. package/src/components/form/CheckboxField.tsx +0 -86
  350. package/src/components/form/CountryField.tsx +0 -75
  351. package/src/components/form/DatePickerField.tsx +0 -126
  352. package/src/components/form/EmailField.tsx +0 -38
  353. package/src/components/form/FirstNameField.tsx +0 -40
  354. package/src/components/form/Form.tsx +0 -165
  355. package/src/components/form/OtpField.tsx +0 -28
  356. package/src/components/form/PasswordField.tsx +0 -71
  357. package/src/components/form/RepeatField.tsx +0 -123
  358. package/src/components/form/SubmitButton.tsx +0 -57
  359. package/src/components/form/TextField.tsx +0 -150
  360. package/src/components/form/UkCountyField.tsx +0 -68
  361. package/src/components/form/index.tsx +0 -35
  362. package/src/components/index.ts +0 -28
  363. package/src/components/page/Banner.tsx +0 -95
  364. package/src/components/page/Notification.tsx +0 -71
  365. package/src/components/page/Page.tsx +0 -73
  366. package/src/components/page/Section.tsx +0 -21
  367. package/src/components/page/TabBar.tsx +0 -131
  368. package/src/components/page/index.ts +0 -10
  369. package/src/components/router/Link.tsx +0 -23
  370. package/src/components/router/LinkButton.tsx +0 -22
  371. package/src/components/router/LinkIconButton.tsx +0 -22
  372. package/src/components/router/LinkListItem.tsx +0 -22
  373. package/src/components/router/LinkTab.tsx +0 -22
  374. package/src/components/router/Navigate.tsx +0 -33
  375. package/src/components/router/index.tsx +0 -9
  376. package/src/components/table/CellStack.tsx +0 -19
  377. package/src/components/table/Table.tsx +0 -55
  378. package/src/components/table/index.tsx +0 -8
  379. package/src/features/InactiveDialog.tsx +0 -40
  380. package/src/features/ScreenTimeDialog.tsx +0 -30
  381. package/src/features/index.ts +0 -4
  382. package/src/fonts/ttf/Inter-VariableFont_slnt,wght.ttf +0 -0
  383. package/src/fonts/ttf/SpaceGrotesk-VariableFont_wght.ttf +0 -0
  384. package/src/hooks/api.tsx +0 -39
  385. package/src/hooks/auth.tsx +0 -397
  386. package/src/hooks/general.tsx +0 -110
  387. package/src/hooks/index.ts +0 -5
  388. package/src/hooks/router.tsx +0 -168
  389. package/src/images/svg/brain.svg +0 -1
  390. package/src/index.ts +0 -2
  391. package/src/middlewares/index.ts +0 -1
  392. package/src/middlewares/session.ts +0 -21
  393. package/src/scripts/freshDesk.js +0 -473
  394. package/src/scripts/index.ts +0 -1
  395. package/src/server.js +0 -187
  396. package/src/settings/custom.ts +0 -22
  397. package/src/settings/index.ts +0 -7
  398. package/src/settings/vite.ts +0 -26
  399. package/src/setupTests.ts +0 -2
  400. package/src/slices/createSlice.ts +0 -8
  401. package/src/slices/index.ts +0 -2
  402. package/src/slices/session.ts +0 -32
  403. package/src/theme/ThemedBox.tsx +0 -265
  404. package/src/theme/colors.ts +0 -57
  405. package/src/theme/components/MuiAccordion.tsx +0 -13
  406. package/src/theme/components/MuiAutocomplete.tsx +0 -11
  407. package/src/theme/components/MuiButton.ts +0 -70
  408. package/src/theme/components/MuiCardActions.tsx +0 -12
  409. package/src/theme/components/MuiCheckbox.ts +0 -12
  410. package/src/theme/components/MuiContainer.ts +0 -19
  411. package/src/theme/components/MuiDialog.tsx +0 -16
  412. package/src/theme/components/MuiFormControlLabel.ts +0 -18
  413. package/src/theme/components/MuiFormHelperText.ts +0 -12
  414. package/src/theme/components/MuiGrid2.ts +0 -16
  415. package/src/theme/components/MuiInputBase.ts +0 -14
  416. package/src/theme/components/MuiLink.ts +0 -41
  417. package/src/theme/components/MuiList.ts +0 -12
  418. package/src/theme/components/MuiListItemText.ts +0 -18
  419. package/src/theme/components/MuiMenu.ts +0 -14
  420. package/src/theme/components/MuiMenuItem.ts +0 -15
  421. package/src/theme/components/MuiSelect.ts +0 -16
  422. package/src/theme/components/MuiTab.ts +0 -29
  423. package/src/theme/components/MuiTable.ts +0 -29
  424. package/src/theme/components/MuiTableBody.ts +0 -15
  425. package/src/theme/components/MuiTableHead.ts +0 -26
  426. package/src/theme/components/MuiTabs.ts +0 -26
  427. package/src/theme/components/MuiTextField.ts +0 -86
  428. package/src/theme/components/MuiToolbar.ts +0 -11
  429. package/src/theme/components/MuiTypography.ts +0 -12
  430. package/src/theme/components/_components.ts +0 -95
  431. package/src/theme/components/index.ts +0 -57
  432. package/src/theme/index.ts +0 -25
  433. package/src/theme/palette.ts +0 -98
  434. package/src/theme/spacing.ts +0 -8
  435. package/src/theme/typography.ts +0 -101
  436. package/src/utils/api.test.ts +0 -19
  437. package/src/utils/api.tsx +0 -339
  438. package/src/utils/auth.ts +0 -78
  439. package/src/utils/form.test.ts +0 -50
  440. package/src/utils/form.ts +0 -193
  441. package/src/utils/general.test.ts +0 -55
  442. package/src/utils/router.test.ts +0 -156
  443. package/src/utils/router.ts +0 -67
  444. package/src/utils/schema.ts +0 -290
  445. package/src/utils/store.ts +0 -31
  446. package/src/utils/test.tsx +0 -82
  447. package/src/utils/theme.tsx +0 -83
  448. package/src/utils/window.ts +0 -11
  449. package/src/vite-env.d.ts +0 -1
  450. package/tsconfig.app.json +0 -4
  451. package/tsconfig.json +0 -7
  452. package/tsconfig.node.json +0 -4
  453. package/types/fixes.d.ts +0 -18
  454. package/vite.config.ts +0 -23
package/src/utils/auth.ts DELETED
@@ -1,78 +0,0 @@
1
- import Cookies from "js-cookie"
2
-
3
- import {
4
- CSRF_COOKIE_NAME,
5
- SESSION_COOKIE_NAME,
6
- SESSION_METADATA_COOKIE_NAME,
7
- } from "../settings"
8
- import { generateSecureRandomString } from "./general"
9
-
10
- export function logout() {
11
- Cookies.remove(SESSION_COOKIE_NAME)
12
- Cookies.remove(SESSION_METADATA_COOKIE_NAME)
13
- }
14
-
15
- // https://docs.djangoproject.com/en/3.2/ref/csrf/
16
- export function getCsrfCookie() {
17
- return Cookies.get(CSRF_COOKIE_NAME)
18
- }
19
-
20
- export function makeOAuth2StorageKey(provider: string, key: string) {
21
- return `oauth2.${provider}.${key}`
22
- }
23
-
24
- export const OAUTH2_CODE_CHALLENGE_METHODS = ["S256"] as const
25
-
26
- export type OAuth2CodeChallengeMethods =
27
- (typeof OAUTH2_CODE_CHALLENGE_METHODS)[number]
28
-
29
- export const OAUTH2_CODE_CHALLENGE_LENGTHS = [
30
- 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
31
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
32
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
33
- 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
34
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
35
- ] as const
36
-
37
- export type OAuth2CodeChallengeLengths =
38
- (typeof OAUTH2_CODE_CHALLENGE_LENGTHS)[number]
39
-
40
- export type OAuth2RequestCodeUrlSearchParams = {
41
- client_id: string
42
- redirect_uri: string
43
- scope: string
44
- response_type: string
45
- access_type: string
46
- prompt?: string
47
- state: string
48
- code_challenge: string
49
- code_challenge_method: string
50
- }
51
-
52
- export type OAuth2ReceiveCodeUrlSearchParams = {
53
- code: string
54
- state: string
55
- }
56
-
57
- export type OAuth2CodeChallenge = {
58
- verifier: string
59
- challenge: string
60
- method: OAuth2CodeChallengeMethods
61
- }
62
-
63
- export async function generateOAuth2CodeChallenge(
64
- length: OAuth2CodeChallengeLengths,
65
- ): Promise<OAuth2CodeChallenge> {
66
- const verifier = generateSecureRandomString(length)
67
- const data = new TextEncoder().encode(verifier)
68
- const digest = await window.crypto.subtle.digest("SHA-256", data)
69
-
70
- return {
71
- verifier,
72
- challenge: btoa(String.fromCharCode(...new Uint8Array(digest)))
73
- .replace(/\+/g, "-")
74
- .replace(/\//g, "_")
75
- .replace(/=+$/, ""),
76
- method: "S256",
77
- }
78
- }
@@ -1,50 +0,0 @@
1
- import { getCleanNames, getDirty, isDirty } from "./form"
2
-
3
- const VALUES = {
4
- name: { first: "Peter", last: "Parker" },
5
- }
6
- const INITIAL_VALUES: typeof VALUES = {
7
- name: { first: "Peter", last: "Robbins" },
8
- }
9
-
10
- // isDirty
11
-
12
- test("value is dirty", () => {
13
- const value = isDirty(VALUES, INITIAL_VALUES, "name.last")
14
-
15
- expect(value).toBe(true)
16
- })
17
-
18
- test("value is clean", () => {
19
- const value = isDirty(VALUES, INITIAL_VALUES, "name.first")
20
-
21
- expect(value).toBe(false)
22
- })
23
-
24
- // getDirty
25
-
26
- test("get dirty values", () => {
27
- const dirty = getDirty(VALUES, INITIAL_VALUES)
28
-
29
- expect(dirty).toMatchObject({ "name.first": false, "name.last": true })
30
- })
31
-
32
- test("get subset of dirty values", () => {
33
- const dirty = getDirty(VALUES, INITIAL_VALUES, ["name.first"])
34
-
35
- expect(dirty).toMatchObject({ "name.first": false })
36
- })
37
-
38
- // getCleanNames
39
-
40
- test("get clean names", () => {
41
- const cleanNames = getCleanNames(VALUES, INITIAL_VALUES)
42
-
43
- expect(cleanNames).toMatchObject(["name.first"])
44
- })
45
-
46
- test("get subset of clean names", () => {
47
- const cleanNames = getCleanNames(VALUES, INITIAL_VALUES, ["name.last"])
48
-
49
- expect(cleanNames).toMatchObject([])
50
- })
package/src/utils/form.ts DELETED
@@ -1,193 +0,0 @@
1
- import type { FieldValidator, FormikHelpers } from "formik"
2
- import { type Schema, type ValidateOptions, ValidationError } from "yup"
3
- import type { TypedMutationTrigger } from "@reduxjs/toolkit/query/react"
4
-
5
- import { excludeKeyPaths, getKeyPaths, getNestedProperty } from "./general"
6
-
7
- export type FormValues = Record<string, any>
8
-
9
- export function isFormError(error: unknown): boolean {
10
- return (
11
- typeof error === "object" &&
12
- error !== null &&
13
- "status" in error &&
14
- error.status === 400 &&
15
- "data" in error &&
16
- typeof error.data === "object" &&
17
- error.data !== null
18
- )
19
- }
20
-
21
- export function setFormErrors(
22
- error: unknown,
23
- setErrors: (errors: object) => void,
24
- ): void {
25
- if (!isFormError(error)) throw error
26
-
27
- const data = Object.fromEntries(
28
- Object.entries((error as { data: object }).data).map(([field, errors]) => {
29
- if (Array.isArray(errors)) errors = errors.join(". ")
30
- return [field, errors]
31
- }),
32
- )
33
-
34
- setErrors(data)
35
- }
36
-
37
- export type SubmitFormOptions<
38
- Values extends FormValues,
39
- QueryArg extends FormValues,
40
- ResultType,
41
- > = Partial<{
42
- exclude: string[]
43
- include: string[]
44
- onlyDirtyValues: boolean
45
- then: (
46
- result: ResultType,
47
- values: Values,
48
- helpers: FormikHelpers<Values>,
49
- ) => void
50
- catch: (
51
- error: unknown,
52
- values: Values,
53
- helpers: FormikHelpers<Values>,
54
- ) => void
55
- finally: (values: Values, helpers: FormikHelpers<Values>) => void
56
- }> &
57
- (Values extends QueryArg
58
- ? { clean?: (values: Values) => QueryArg }
59
- : { clean: (values: Values) => QueryArg })
60
-
61
- export type SubmitFormHandler<Values extends FormValues> = (
62
- values: Values,
63
- helpers: FormikHelpers<Values>,
64
- ) => void | Promise<any>
65
-
66
- export function submitForm<
67
- Values extends QueryArg,
68
- QueryArg extends FormValues,
69
- ResultType,
70
- >(
71
- trigger: TypedMutationTrigger<ResultType, QueryArg, any>,
72
- initialValues: Values,
73
- options?: SubmitFormOptions<Values, QueryArg, ResultType>,
74
- ): SubmitFormHandler<Values>
75
-
76
- export function submitForm<
77
- Values extends FormValues,
78
- QueryArg extends FormValues,
79
- ResultType,
80
- >(
81
- trigger: TypedMutationTrigger<ResultType, QueryArg, any>,
82
- initialValues: Values,
83
- options: SubmitFormOptions<Values, QueryArg, ResultType>,
84
- ): SubmitFormHandler<Values>
85
-
86
- export function submitForm<
87
- Values extends FormValues,
88
- QueryArg extends FormValues,
89
- ResultType,
90
- >(
91
- trigger: TypedMutationTrigger<ResultType, QueryArg, any>,
92
- initialValues: Values,
93
- options?: SubmitFormOptions<Values, QueryArg, ResultType>,
94
- ): SubmitFormHandler<Values> {
95
- const {
96
- include,
97
- onlyDirtyValues = false,
98
- then,
99
- catch: _catch,
100
- finally: _finally,
101
- } = options || {}
102
- let { exclude = [] } = options || {}
103
-
104
- return (values, helpers) => {
105
- let arg =
106
- options && options.clean
107
- ? options.clean(values as QueryArg & FormValues)
108
- : (values as unknown as QueryArg)
109
-
110
- if (onlyDirtyValues) {
111
- exclude = [
112
- ...exclude,
113
- ...getCleanNames(values, initialValues).filter(
114
- cleanName => !exclude.includes(cleanName),
115
- ),
116
- ]
117
- }
118
-
119
- if (include) exclude = exclude.filter(name => !include.includes(name))
120
-
121
- if (exclude.length) arg = excludeKeyPaths(arg, exclude) as QueryArg
122
-
123
- trigger(arg)
124
- .unwrap()
125
- .then(result => {
126
- if (then) then(result, values, helpers)
127
- })
128
- .catch(error => {
129
- if (_catch) _catch(error, values, helpers)
130
- setFormErrors(error, helpers.setErrors)
131
- })
132
- .finally(() => {
133
- if (_finally) _finally(values, helpers)
134
- })
135
- }
136
- }
137
-
138
- export function schemaToFieldValidator(
139
- schema: Schema,
140
- options?: ValidateOptions,
141
- ): FieldValidator {
142
- return async value => {
143
- try {
144
- await schema.validate(value, options)
145
- } catch (error) {
146
- if (error instanceof ValidationError) {
147
- return error.errors.join(". ")
148
- }
149
-
150
- throw error
151
- }
152
- }
153
- }
154
-
155
- // Checking if individual fields are dirty is not currently supported.
156
- // https://github.com/jaredpalmer/formik/issues/1421
157
- export function getDirty<Values extends FormValues>(
158
- values: Values,
159
- initialValues: Values,
160
- names?: string[],
161
- ): Record<string, boolean> {
162
- if (!names) names = getKeyPaths(values)
163
-
164
- return Object.fromEntries(
165
- names.map(name => [name, isDirty(values, initialValues, name)]),
166
- )
167
- }
168
-
169
- export function isDirty<Values extends FormValues>(
170
- values: Values,
171
- initialValues: Values,
172
- name: string,
173
- ): boolean {
174
- const value: unknown = getNestedProperty(values, name)
175
- const initialValue: unknown = getNestedProperty(initialValues, name)
176
-
177
- return value !== initialValue
178
- }
179
-
180
- export function getCleanNames<Values extends FormValues>(
181
- values: Values,
182
- initialValues: Values,
183
- names?: string[],
184
- ): string[] {
185
- return Object.entries(getDirty(values, initialValues, names))
186
- .filter(
187
- ([
188
- _, // eslint-disable-line @typescript-eslint/no-unused-vars
189
- isDirty,
190
- ]) => !isDirty,
191
- )
192
- .map(([name]) => name)
193
- }
@@ -1,55 +0,0 @@
1
- import {
2
- excludeKeyPaths,
3
- getKeyPaths,
4
- getNestedProperty,
5
- withKeyPaths,
6
- } from "./general"
7
-
8
- // getNestedProperty
9
-
10
- const PERSON = { father: { father: { name: "John" } } }
11
-
12
- test("get a nested property with dot notation", () => {
13
- const name = getNestedProperty(PERSON, "father.father.name") as string
14
-
15
- expect(name).toEqual("John")
16
- })
17
-
18
- test("get a nested property with string array", () => {
19
- const name = getNestedProperty(PERSON, ["father", "father", "name"]) as string
20
-
21
- expect(name).toEqual("John")
22
- })
23
-
24
- test("get a nested property that doesn't exist", () => {
25
- const name = getNestedProperty(PERSON, "mother.mother.name") as undefined
26
-
27
- expect(name).toBeUndefined()
28
- })
29
-
30
- // withKeyPaths
31
-
32
- test("set the paths of nested keys", () => {
33
- const obj = withKeyPaths({ a: 1, b: { c: 2, d: { e: 3 } } })
34
-
35
- expect(obj).toMatchObject({ a: 1, b: { "b.c": 2, "b.d": { "b.d.e": 3 } } })
36
- })
37
-
38
- // getKeyPaths
39
-
40
- test("get the paths of nested keys", () => {
41
- const keyPaths = getKeyPaths({ a: 1, b: { c: 2, d: { e: 3 } } })
42
-
43
- expect(keyPaths).toMatchObject(["a", "b", "b.c", "b.d", "b.d.e"])
44
- })
45
-
46
- // excludeKeyPaths
47
-
48
- test("exclude nested keys by their path", () => {
49
- const obj = excludeKeyPaths({ a: 1, b: { c: 2, d: { e: 3 } } }, [
50
- "b.c",
51
- "b.d.e",
52
- ]) as object
53
-
54
- expect(obj).toMatchObject({ a: 1, b: { d: {} } })
55
- })
@@ -1,156 +0,0 @@
1
- import { type Parameters, type Path, path as p } from "./router"
2
-
3
- const m = <SubMatches extends Record<string, Path>>(
4
- _: string,
5
- __: string | Parameters,
6
- subMatches: SubMatches = {} as SubMatches,
7
- ) => ({ _, __, ...subMatches })
8
-
9
- function testPaths({
10
- name,
11
- paths,
12
- match,
13
- }: {
14
- name: string
15
- paths: Path
16
- match: Path
17
- }) {
18
- test(name, () => {
19
- expect(paths).toMatchObject(match)
20
- })
21
- }
22
-
23
- testPaths({
24
- name: "no nested paths",
25
- paths: p(""),
26
- match: m("/", ""),
27
- })
28
-
29
- testPaths({
30
- name: "nested paths",
31
- paths: p("", {
32
- a: p("/a", {
33
- b: p("/b"),
34
- }),
35
- }),
36
- match: m("/", "", {
37
- a: m("/a", "/a"),
38
- }),
39
- })
40
-
41
- testPaths({
42
- name: "one param",
43
- paths: p("", {
44
- person: p("/person", {
45
- name: p("/:name", {
46
- sam: p({ name: "samantha" }),
47
- }),
48
- }),
49
- }),
50
- match: m("/", "", {
51
- person: m("/person", "/person", {
52
- name: m("/person/:name", "/:name", {
53
- sam: m("/person/samantha", { name: "samantha" }),
54
- }),
55
- }),
56
- }),
57
- })
58
-
59
- testPaths({
60
- name: "multiple params",
61
- paths: p("", {
62
- hero: p("/hero", {
63
- firstAndLastName: p("/:firstName/:lastName", {
64
- spiderMan: p(
65
- { firstName: "peter", lastName: "parker" },
66
- {
67
- mainVillain: p("/green-goblin"),
68
- },
69
- ),
70
- }),
71
- }),
72
- }),
73
- match: m("/", "", {
74
- hero: m("/hero", "/hero", {
75
- firstAndLastName: m(
76
- "/hero/:firstName/:lastName",
77
- "/:firstName/:lastName",
78
- {
79
- spiderMan: m(
80
- "/hero/peter/parker",
81
- { firstName: "peter", lastName: "parker" },
82
- {
83
- mainVillain: m(
84
- "/hero/peter/parker/green-goblin",
85
- "/green-goblin",
86
- ),
87
- },
88
- ),
89
- },
90
- ),
91
- }),
92
- }),
93
- })
94
-
95
- testPaths({
96
- name: "nested params",
97
- paths: p("", {
98
- hero: p("/hero", {
99
- firstName: p("/:firstName", {
100
- spiderMan: p({ firstName: "peter" }),
101
- lastName: p("/:lastName?", {
102
- superMan: p(
103
- { firstName: "clark" },
104
- {
105
- superMan: p({ lastName: "kent" }),
106
- },
107
- ),
108
- }),
109
- batMan: p(
110
- { firstName: "bruce" },
111
- {
112
- lastName: p("/:lastName", {
113
- batMan: p(
114
- { lastName: "wayne" },
115
- {
116
- mainVillain: p("/joker"),
117
- },
118
- ),
119
- }),
120
- },
121
- ),
122
- }),
123
- }),
124
- }),
125
- match: m("/", "", {
126
- hero: m("/hero", "/hero", {
127
- firstName: m("/hero/:firstName", "/:firstName", {
128
- spiderMan: m("/hero/peter", { firstName: "peter" }),
129
- lastName: m("/hero/:firstName/:lastName?", "/:lastName?", {
130
- superMan: m(
131
- "/hero/clark",
132
- { firstName: "clark" },
133
- {
134
- superMan: m("/hero/clark/kent", { lastName: "kent" }),
135
- },
136
- ),
137
- }),
138
- batMan: m(
139
- "/hero/bruce",
140
- { firstName: "bruce" },
141
- {
142
- lastName: m("/hero/bruce/:lastName", "/:lastName", {
143
- batMan: m(
144
- "/hero/bruce/wayne",
145
- { lastName: "wayne" },
146
- {
147
- mainVillain: m("/hero/bruce/wayne/joker", "/joker"),
148
- },
149
- ),
150
- }),
151
- },
152
- ),
153
- }),
154
- }),
155
- }),
156
- })
@@ -1,67 +0,0 @@
1
- import {
2
- type To,
3
- type LinkProps as _LinkProps,
4
- generatePath,
5
- } from "react-router-dom"
6
-
7
- import { type PageState } from "../components/page/Page"
8
-
9
- export type LinkProps<
10
- Override extends "delta" | "to",
11
- State extends Record<string, any> = Record<string, any>,
12
- > = Omit<_LinkProps, "to" | "state"> &
13
- (Override extends "delta"
14
- ? { to: number }
15
- : { to: To; state?: State & Partial<PageState> })
16
-
17
- export type ReadOnly<T> = {
18
- readonly [P in keyof T]: T[P]
19
- }
20
-
21
- export type Parameters = Record<string, string>
22
-
23
- export interface Path {
24
- _: string
25
- __: string | Parameters
26
- [subpath: string]: string | Path | Parameters
27
- }
28
-
29
- export function path<Subpaths extends Record<string, Path>>(
30
- _: string | Parameters,
31
- subpaths: Subpaths = {} as Subpaths,
32
- ): Path & Subpaths {
33
- function updatePath(path: Path, root: boolean, params?: Parameters) {
34
- if (typeof path.__ === "object") {
35
- params = params ? { ...params, ...path.__ } : path.__
36
- }
37
-
38
- const _path = typeof _ === "string" && params ? generatePath(_, params) : _
39
-
40
- Object.entries(path).forEach(([key, subpath]) => {
41
- if (key !== "__") {
42
- subpath = subpath as string | Path
43
- if (typeof subpath === "string") {
44
- if (typeof _path === "string" && (!root || key !== "_")) {
45
- let __path = _path + subpath
46
- if (__path.endsWith("/")) __path = __path.slice(0, -1)
47
- path[key] = __path
48
- }
49
- } else {
50
- updatePath(subpath, false, params)
51
- }
52
- }
53
- })
54
- }
55
-
56
- const path = { ...subpaths, _: typeof _ === "string" ? _ : "", __: _ }
57
- if (_ === "") {
58
- path._ = "/"
59
- } else {
60
- updatePath(path, true)
61
- }
62
- return path
63
- }
64
-
65
- export function getParam(path: Path, key: string) {
66
- return (path.__ as Parameters)[key]
67
- }