@tulip-systems/core 0.5.8 → 0.5.9

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 (275) hide show
  1. package/dist/components/client.mjs +7 -7
  2. package/dist/components/common/icons.d.mts +52 -52
  3. package/dist/components/common/icons.d.mts.map +1 -1
  4. package/dist/components/common/status.d.mts +3 -3
  5. package/dist/components/common/status.d.mts.map +1 -1
  6. package/dist/components/editor/components/content.client.d.mts +2 -2
  7. package/dist/components/editor/components/content.client.d.mts.map +1 -1
  8. package/dist/components/editor/components/editor.client.d.mts +7 -7
  9. package/dist/components/editor/components/editor.client.d.mts.map +1 -1
  10. package/dist/components/editor/components/menu.client.d.mts +3 -3
  11. package/dist/components/editor/components/menu.client.d.mts.map +1 -1
  12. package/dist/components/editor/components/menu.client.mjs +1 -1
  13. package/dist/components/editor/lib/constants.d.mts +27 -27
  14. package/dist/components/header/back-button.client.d.mts +2 -2
  15. package/dist/components/header/back-button.client.d.mts.map +1 -1
  16. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  17. package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
  18. package/dist/components/header/bottom-bar.client.mjs +1 -1
  19. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  20. package/dist/components/header/breadcrumbs.client.d.mts.map +1 -1
  21. package/dist/components/header/breadcrumbs.client.mjs +1 -1
  22. package/dist/components/header/header.client.d.mts +2 -2
  23. package/dist/components/header/header.client.d.mts.map +1 -1
  24. package/dist/components/header/mobile-nav-switcher.client.d.mts +2 -2
  25. package/dist/components/header/mobile-nav-switcher.client.d.mts.map +1 -1
  26. package/dist/components/header/top-bar.client.d.mts +4 -4
  27. package/dist/components/header/top-bar.client.d.mts.map +1 -1
  28. package/dist/components/header/top-bar.client.mjs +1 -1
  29. package/dist/components/layouts/admin-content.client.d.mts +2 -2
  30. package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
  31. package/dist/components/layouts/admin-error-pages.d.mts +23 -0
  32. package/dist/components/layouts/admin-error-pages.d.mts.map +1 -0
  33. package/dist/components/layouts/admin-error-pages.mjs +60 -0
  34. package/dist/components/layouts/admin-error-pages.mjs.map +1 -0
  35. package/dist/components/layouts/admin-layout.d.mts +2 -2
  36. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  37. package/dist/components/layouts/admin-loading.d.mts +2 -2
  38. package/dist/components/layouts/admin-loading.d.mts.map +1 -1
  39. package/dist/components/layouts/empty-page.d.mts +4 -4
  40. package/dist/components/layouts/empty-page.d.mts.map +1 -1
  41. package/dist/components/layouts/empty-page.mjs.map +1 -1
  42. package/dist/components/layouts/error-page.d.mts +35 -10
  43. package/dist/components/layouts/error-page.d.mts.map +1 -1
  44. package/dist/components/layouts/error-page.mjs +36 -40
  45. package/dist/components/layouts/error-page.mjs.map +1 -1
  46. package/dist/components/layouts/error-sections.d.mts +29 -0
  47. package/dist/components/layouts/error-sections.d.mts.map +1 -0
  48. package/dist/components/layouts/error-sections.mjs +47 -0
  49. package/dist/components/layouts/error-sections.mjs.map +1 -0
  50. package/dist/components/layouts/list-layout.d.mts +2 -2
  51. package/dist/components/layouts/list-layout.d.mts.map +1 -1
  52. package/dist/components/layouts/providers.client.d.mts +2 -2
  53. package/dist/components/layouts/providers.client.d.mts.map +1 -1
  54. package/dist/components/layouts/root-error-pages.d.mts +10 -0
  55. package/dist/components/layouts/root-error-pages.d.mts.map +1 -0
  56. package/dist/components/layouts/root-error-pages.mjs +17 -0
  57. package/dist/components/layouts/root-error-pages.mjs.map +1 -0
  58. package/dist/components/layouts/root-layout.server.d.mts +2 -2
  59. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  60. package/dist/components/layouts/root-loading.d.mts +2 -2
  61. package/dist/components/layouts/root-loading.d.mts.map +1 -1
  62. package/dist/components/layouts/tab-layout.d.mts +2 -2
  63. package/dist/components/layouts/tab-layout.d.mts.map +1 -1
  64. package/dist/components/layouts/tab-layout.mjs +1 -1
  65. package/dist/components/lists/data-list.d.mts +5 -5
  66. package/dist/components/lists/data-list.d.mts.map +1 -1
  67. package/dist/components/lists/data-stack.d.mts +8 -8
  68. package/dist/components/lists/data-stack.d.mts.map +1 -1
  69. package/dist/components/navigation/admin-sidebar-header.client.mjs +2 -2
  70. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  71. package/dist/components/navigation/admin-sidebar-paths.client.mjs +1 -1
  72. package/dist/components/navigation/admin-sidebar-skeleton.mjs +1 -1
  73. package/dist/components/ui/accordion.d.mts +5 -5
  74. package/dist/components/ui/accordion.d.mts.map +1 -1
  75. package/dist/components/ui/alert-dialog.d.mts +12 -12
  76. package/dist/components/ui/alert-dialog.d.mts.map +1 -1
  77. package/dist/components/ui/alert.d.mts +6 -6
  78. package/dist/components/ui/alert.d.mts.map +1 -1
  79. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  80. package/dist/components/ui/aspect-ratio.d.mts.map +1 -1
  81. package/dist/components/ui/avatar.client.d.mts +4 -4
  82. package/dist/components/ui/badge.d.mts +4 -4
  83. package/dist/components/ui/badge.d.mts.map +1 -1
  84. package/dist/components/ui/breadcrumb.d.mts +8 -8
  85. package/dist/components/ui/breadcrumb.d.mts.map +1 -1
  86. package/dist/components/ui/button.d.mts +5 -5
  87. package/dist/components/ui/calendar.d.mts +3 -3
  88. package/dist/components/ui/card.d.mts +7 -7
  89. package/dist/components/ui/carousel.d.mts +6 -6
  90. package/dist/components/ui/chart.client.d.mts +5 -5
  91. package/dist/components/ui/checkbox.d.mts +2 -2
  92. package/dist/components/ui/collapsible.client.d.mts +4 -4
  93. package/dist/components/ui/color-picker.client.d.mts +2 -2
  94. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  95. package/dist/components/ui/combobox-dropdown.client.mjs +1 -1
  96. package/dist/components/ui/combobox.client.d.mts +2 -2
  97. package/dist/components/ui/combobox.client.mjs +1 -1
  98. package/dist/components/ui/command.d.mts +10 -10
  99. package/dist/components/ui/context-menu.d.mts +16 -16
  100. package/dist/components/ui/date-picker.client.d.mts +2 -2
  101. package/dist/components/ui/date-picker.client.mjs +1 -1
  102. package/dist/components/ui/dialog.client.d.mts +11 -11
  103. package/dist/components/ui/drawer.client.d.mts +11 -11
  104. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  105. package/dist/components/ui/form.client.d.mts +7 -7
  106. package/dist/components/ui/hover-card.client.d.mts +4 -4
  107. package/dist/components/ui/input-recipient.d.mts +2 -2
  108. package/dist/components/ui/input.d.mts +2 -2
  109. package/dist/components/ui/label.d.mts +2 -2
  110. package/dist/components/ui/navigation-menu.d.mts +11 -11
  111. package/dist/components/ui/pagination.d.mts +8 -8
  112. package/dist/components/ui/popover.d.mts +5 -5
  113. package/dist/components/ui/progress.client.d.mts +2 -2
  114. package/dist/components/ui/radio-group.d.mts +3 -3
  115. package/dist/components/ui/resizable.client.d.mts +4 -4
  116. package/dist/components/ui/scroll-area.d.mts +3 -3
  117. package/dist/components/ui/select.client.d.mts +11 -11
  118. package/dist/components/ui/separator.d.mts +2 -2
  119. package/dist/components/ui/sheet.client.d.mts +9 -9
  120. package/dist/components/ui/sidebar.client.d.mts +26 -26
  121. package/dist/components/ui/sidebar.client.mjs +2 -2
  122. package/dist/components/ui/skeleton.d.mts +2 -2
  123. package/dist/components/ui/slider.d.mts +2 -2
  124. package/dist/components/ui/sonner.client.d.mts +2 -2
  125. package/dist/components/ui/switch.d.mts +2 -2
  126. package/dist/components/ui/tabs.d.mts +5 -5
  127. package/dist/components/ui/textarea.d.mts +2 -2
  128. package/dist/components/ui/time-input.client.d.mts +2 -2
  129. package/dist/components/ui/toggle-group.client.d.mts +3 -3
  130. package/dist/components/ui/toggle.d.mts +4 -4
  131. package/dist/components/ui/toggle.d.mts.map +1 -1
  132. package/dist/components/ui/tooltip.client.d.mts +5 -5
  133. package/dist/components/ui/tooltip.client.d.mts.map +1 -1
  134. package/dist/components.d.mts +5 -4
  135. package/dist/components.mjs +18 -17
  136. package/dist/lib/hooks/use-action.d.mts +2 -2
  137. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  138. package/dist/lib.mjs +1 -1
  139. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  140. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  141. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  142. package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
  143. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  144. package/dist/modules/auth/components/create-first-user-page.client.mjs +1 -1
  145. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  146. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  147. package/dist/modules/auth/components/guard.server.d.mts +2 -2
  148. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  149. package/dist/modules/auth/components/login-page.client.mjs +1 -1
  150. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  151. package/dist/modules/auth/components/reset-password-page.client.mjs +1 -1
  152. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  153. package/dist/modules/auth/db/schema.d.mts +73 -73
  154. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  155. package/dist/modules/auth/handler/client.client.d.mts +147 -147
  156. package/dist/modules/auth/handler/client.client.d.mts.map +1 -1
  157. package/dist/modules/auth/handler/init.d.mts +131 -131
  158. package/dist/modules/auth/handler/init.d.mts.map +1 -1
  159. package/dist/modules/auth/lib/helpers.server.d.mts +2 -2
  160. package/dist/modules/auth/lib/validators.d.mts +2 -2
  161. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  162. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +10 -10
  163. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  164. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  165. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  166. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  167. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  168. package/dist/modules/commands/components/command-trigger.client.mjs +1 -1
  169. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  170. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  171. package/dist/modules/commands/components/dialog-command.client.mjs +1 -1
  172. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  173. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  174. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  175. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  176. package/dist/modules/commands/components/form-dialog-command.client.d.mts +11 -11
  177. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  178. package/dist/modules/commands/components/form-dialog-command.client.mjs +1 -1
  179. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +3 -3
  180. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  181. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  182. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  183. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  184. package/dist/modules/commands/menus/dropdown-menu.client.mjs +1 -1
  185. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  186. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  187. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  188. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  189. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  190. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  191. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  192. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  193. package/dist/modules/config/db/helpers.d.mts +5 -5
  194. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  195. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  196. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  197. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  198. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  199. package/dist/modules/data-tables/components/filters/combobox.client.d.mts.map +1 -1
  200. package/dist/modules/data-tables/components/filters/combobox.client.mjs +1 -1
  201. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  202. package/dist/modules/data-tables/components/filters/slider.client.d.mts.map +1 -1
  203. package/dist/modules/data-tables/components/filters/slider.client.mjs +1 -1
  204. package/dist/modules/data-tables/components/header.d.mts +4 -4
  205. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  206. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  207. package/dist/modules/data-tables/components/search-input.client.d.mts.map +1 -1
  208. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  209. package/dist/modules/data-tables/components/table.d.mts +7 -7
  210. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  211. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  212. package/dist/modules/data-tables/hooks/use-context.client.d.mts.map +1 -1
  213. package/dist/modules/data-tables/lib/converters/search.mjs +2 -2
  214. package/dist/modules/data-tables/lib/converters/search.mjs.map +1 -1
  215. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  216. package/dist/modules/data-tables/tables/data-table/components/table.d.mts.map +1 -1
  217. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  218. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts.map +1 -1
  219. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  220. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts.map +1 -1
  221. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +2 -2
  222. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts.map +1 -1
  223. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  224. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts.map +1 -1
  225. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  226. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts.map +1 -1
  227. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.mjs +1 -1
  228. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
  229. package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
  230. package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
  231. package/dist/modules/inline-edit/components/date-input.client.mjs +1 -1
  232. package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
  233. package/dist/modules/inline-edit/components/date-picker.client.mjs +1 -1
  234. package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
  235. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
  236. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
  237. package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
  238. package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
  239. package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
  240. package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
  241. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  242. package/dist/modules/inline-edit/lib/variants.d.mts +2 -2
  243. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  244. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  245. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  246. package/dist/modules/storage/components/image-grid.client.mjs +3 -3
  247. package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
  248. package/dist/modules/storage/lib/router.server.d.mts +2311 -2311
  249. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  250. package/dist/modules/storage/lib/schema.d.mts +92 -92
  251. package/dist/modules/storage/lib/schema.mjs +1 -1
  252. package/dist/modules/storage/lib/service.server.d.mts +15 -15
  253. package/dist/modules/storage/lib/service.server.mjs +1 -1
  254. package/dist/modules/storage/lib/validators.d.mts +80 -80
  255. package/package.json +1 -1
  256. package/src/components/entry.ts +3 -2
  257. package/src/components/layouts/admin-error-pages.tsx +109 -0
  258. package/src/components/layouts/empty-page.tsx +0 -17
  259. package/src/components/layouts/error-page.tsx +58 -44
  260. package/src/components/layouts/error-sections.tsx +52 -0
  261. package/src/components/layouts/root-error-pages.tsx +12 -0
  262. package/src/modules/data-tables/lib/converters/search.ts +2 -2
  263. package/dist/components/layouts/not-allowed-page.d.mts +0 -22
  264. package/dist/components/layouts/not-allowed-page.d.mts.map +0 -1
  265. package/dist/components/layouts/not-allowed-page.mjs +0 -25
  266. package/dist/components/layouts/not-allowed-page.mjs.map +0 -1
  267. package/dist/components/layouts/not-found-page.d.mts +0 -8
  268. package/dist/components/layouts/not-found-page.d.mts.map +0 -1
  269. package/dist/components/layouts/not-found-page.mjs +0 -20
  270. package/dist/components/layouts/not-found-page.mjs.map +0 -1
  271. package/dist/components/layouts/not-found-section.mjs +0 -30
  272. package/dist/components/layouts/not-found-section.mjs.map +0 -1
  273. package/src/components/layouts/not-allowed-page.tsx +0 -44
  274. package/src/components/layouts/not-found-page.tsx +0 -17
  275. package/src/components/layouts/not-found-section.tsx +0 -26
@@ -0,0 +1,109 @@
1
+ import { ServerError } from "@/modules/router/lib/error.server";
2
+ import { CommonORPCErrorCode } from "@orpc/client";
3
+ import { Header } from "../header/header.client";
4
+ import { Topbar, TopbarTitle } from "../header/top-bar.client";
5
+ import {
6
+ DefaultErrorSection,
7
+ NotAllowedSection,
8
+ NotFoundSection,
9
+ ServerErrorSection,
10
+ } from "./error-sections";
11
+
12
+ /**
13
+ * Admin Not Found Page
14
+ */
15
+ export function AdminNotFoundPage() {
16
+ return (
17
+ <>
18
+ <Header>
19
+ <Topbar>
20
+ <TopbarTitle breadcrumbs={[{ label: "404" }]} />
21
+ </Topbar>
22
+ </Header>
23
+
24
+ <div className="p-content">
25
+ <NotFoundSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
26
+ </div>
27
+ </>
28
+ );
29
+ }
30
+
31
+ /**
32
+ * Admin Not Allowed Page
33
+ */
34
+ export function AdminNotAllowedPage() {
35
+ return (
36
+ <>
37
+ <Header>
38
+ <Topbar>
39
+ <TopbarTitle breadcrumbs={[{ label: "Unauthorized" }]} />
40
+ </Topbar>
41
+ </Header>
42
+
43
+ <div className="p-content">
44
+ <NotAllowedSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
45
+ </div>
46
+ </>
47
+ );
48
+ }
49
+
50
+ /**
51
+ * ErrorPage
52
+ * - If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
53
+ * - If the error is a ServerError and the code is "NOT_FOUND", show the NotFoundSection
54
+ * - Else show the ErrorPage
55
+ */
56
+ export function AdminErrorPage(props: { error: Error }) {
57
+ const serverErrorCode: CommonORPCErrorCode =
58
+ props.error instanceof ServerError ? props.error.code : undefined;
59
+
60
+ /**
61
+ * If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
62
+ */
63
+ if (serverErrorCode === "UNAUTHORIZED") {
64
+ return <AdminNotAllowedPage />;
65
+ }
66
+
67
+ /**
68
+ * If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
69
+ */
70
+ if (serverErrorCode === "NOT_FOUND") {
71
+ return <AdminNotFoundPage />;
72
+ }
73
+
74
+ /**
75
+ * If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
76
+ */
77
+ if (serverErrorCode === "INTERNAL_SERVER_ERROR") {
78
+ return (
79
+ <>
80
+ <Header>
81
+ <Topbar>
82
+ <TopbarTitle breadcrumbs={[{ label: "Server Error" }]} />
83
+ </Topbar>
84
+ </Header>
85
+
86
+ <div className="p-content">
87
+ <ServerErrorSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
88
+ </div>
89
+ </>
90
+ );
91
+ }
92
+
93
+ /**
94
+ * Else show the ErrorPage
95
+ */
96
+ return (
97
+ <>
98
+ <Header>
99
+ <Topbar>
100
+ <TopbarTitle breadcrumbs={[{ label: "Error" }]} />
101
+ </Topbar>
102
+ </Header>
103
+
104
+ <div className="p-content">
105
+ <DefaultErrorSection className="min-h-[calc(100dvh-var(--header-top-bar-height)-var(--content)-var(--content))]" />
106
+ </div>
107
+ </>
108
+ );
109
+ }
@@ -40,20 +40,3 @@ export function EmptyPageDescription({ className, children, ...props }: Componen
40
40
  </p>
41
41
  );
42
42
  }
43
-
44
- {
45
- /* <div className="flex h-full flex-col place-items-center justify-center space-y-6 border border-dashed">
46
- <span className="space-y-2 text-center">
47
- <h2 className="text-2xl font-bold tracking-tight">{title}</h2>
48
- {description && (
49
- <p className="text-muted-foreground max-w-[40ch] text-sm">{description}</p>
50
- )}
51
- </span>
52
-
53
- {callToAction && (
54
- <Link href={callToAction.href} className={cn(buttonVariants({ variant: "default" }))}>
55
- {callToAction.title}
56
- </Link>
57
- )}
58
- </div> */
59
- }
@@ -1,61 +1,75 @@
1
1
  import { cn } from "@/lib/utils/cn";
2
- import { ServerError } from "@/modules/router/lib/error.server";
3
- import { CommonORPCErrorCode } from "@orpc/client";
4
- import { BugIcon } from "lucide-react";
2
+ import { BugIcon, ServerCrashIcon, ShieldBanIcon } from "lucide-react";
5
3
  import { ComponentProps } from "react";
6
- import { NotAllowedPage } from "./not-allowed-page";
7
- import { NotFoundSection } from "./not-found-section";
8
4
 
9
5
  /**
10
6
  * ErrorPage
11
7
  */
12
- export function ErrorPage({ className, ...props }: ComponentProps<"div">) {
8
+ export function ErrorPage({ className, children, ...props }: ComponentProps<"div">) {
13
9
  return (
14
- <div {...props} className={cn("relative z-0 grid h-dvh w-full place-items-center", className)}>
15
- <div className="flex flex-col items-center gap-12 text-center">
16
- <span className="text-destructive flex flex-col items-center gap-2">
17
- <BugIcon className="size-20 xl:size-32" />
18
- <h1 className="text-2xl font-bold lg:text-3xl">Oeps, er is iets fout gegaan.</h1>
19
- </span>
20
- </div>
10
+ <div
11
+ {...props}
12
+ className={cn(
13
+ "min-h-120 flex h-full w-full flex-col items-center justify-center gap-y-3 border border-dashed text-center",
14
+ className,
15
+ )}
16
+ >
17
+ {children}
21
18
  </div>
22
19
  );
23
20
  }
24
21
 
25
22
  /**
26
- * ErrorPage
27
- * - If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
28
- * - If the error is a ServerError and the code is "NOT_FOUND", show the NotFoundSection
29
- * - Else show the ErrorPage
23
+ * ErrorPageCode
30
24
  */
31
- export function AdminErrorPage(props: { error: Error }) {
32
- const serverErrorCode: CommonORPCErrorCode =
33
- props.error instanceof ServerError ? props.error.code : undefined;
25
+ export function ErrorPageCode({ className, children, ...props }: ComponentProps<"h2">) {
26
+ return (
27
+ <h2 className={cn("text-9xl font-bold leading-none", className)} {...props}>
28
+ {children}
29
+ </h2>
30
+ );
31
+ }
34
32
 
35
- /**
36
- * If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
37
- */
38
- if (serverErrorCode === "UNAUTHORIZED") {
39
- return (
40
- <div className="p-content h-dvh">
41
- <NotAllowedPage className="h-full" />
42
- </div>
43
- );
44
- }
33
+ /**
34
+ * ErrorPageIcon
35
+ */
36
+ const errorPageIcons = {
37
+ serverError: ServerCrashIcon,
38
+ notAllowed: ShieldBanIcon,
39
+ default: BugIcon,
40
+ // 404: BombIcon,
41
+ };
45
42
 
46
- /**
47
- * If the error is a ServerError and the code is "UNAUTHORIZED", show the NotAllowedPage
48
- */
49
- if (serverErrorCode === "NOT_FOUND") {
50
- return (
51
- <div className="relative z-0 grid h-dvh w-full place-items-center">
52
- <NotFoundSection href="/admin" />
53
- </div>
54
- );
55
- }
43
+ export function ErrorPageIcon({
44
+ variant = "default",
45
+ className,
46
+ ...props
47
+ }: ComponentProps<"svg"> & { variant?: keyof typeof errorPageIcons }) {
48
+ const Icon = errorPageIcons[variant];
56
49
 
57
- /**
58
- * Else show the ErrorPage
59
- */
60
- return <ErrorPage />;
50
+ return <Icon className={cn("size-16 xl:size-24", className)} {...props} />;
61
51
  }
52
+
53
+ /**
54
+ * ErrorPageDescription
55
+ */
56
+ export function ErrorPageDescription({ className, children, ...props }: ComponentProps<"p">) {
57
+ return (
58
+ <p className={cn("text-2xl font-bold lg:text-3xl", className)} {...props}>
59
+ {children}
60
+ </p>
61
+ );
62
+ }
63
+
64
+ // export function ErrorPage({ className, ...props }: ComponentProps<"div">) {
65
+ // return (
66
+ // <div {...props} className={cn("relative z-0 grid w-full place-items-center", className)}>
67
+ // <div className="flex flex-col items-center gap-12 text-center">
68
+ // <span className="text-destructive flex flex-col items-center gap-2">
69
+ // <BugIcon className="size-20 xl:size-32" />
70
+ // <h1 className="text-2xl font-bold lg:text-3xl">Oeps, er is iets fout gegaan.</h1>
71
+ // </span>
72
+ // </div>
73
+ // </div>
74
+ // );
75
+ // }
@@ -0,0 +1,52 @@
1
+ import { cn } from "@/lib/utils/cn";
2
+ import { ComponentProps } from "react";
3
+ import { ErrorPage, ErrorPageCode, ErrorPageDescription, ErrorPageIcon } from "./error-page";
4
+
5
+ /**
6
+ * DefaultErrorSection
7
+ */
8
+ export function DefaultErrorSection({ className, ...props }: ComponentProps<"div">) {
9
+ return (
10
+ <ErrorPage {...props} className={cn("text-destructive", className)}>
11
+ {/* <BugIcon className="size-16 xl:size-24" /> */}
12
+ <ErrorPageIcon variant="default" />
13
+ <ErrorPageDescription>Oeps, er is iets fout gegaan</ErrorPageDescription>
14
+ </ErrorPage>
15
+ );
16
+ }
17
+
18
+ /**
19
+ * ServerErrorSection
20
+ */
21
+ export function ServerErrorSection({ className, ...props }: ComponentProps<"div">) {
22
+ return (
23
+ <ErrorPage {...props} className={cn("text-destructive", className)}>
24
+ <ErrorPageIcon variant="serverError" />
25
+ <ErrorPageDescription>Oeps, er is iets fout gegaan met de server</ErrorPageDescription>
26
+ </ErrorPage>
27
+ );
28
+ }
29
+
30
+ /**
31
+ * NotFoundSection
32
+ */
33
+ export function NotFoundSection(props: ComponentProps<"div">) {
34
+ return (
35
+ <ErrorPage {...props}>
36
+ <ErrorPageCode>404</ErrorPageCode>
37
+ <ErrorPageDescription>Oeps, deze pagina is niet gevonden.</ErrorPageDescription>
38
+ </ErrorPage>
39
+ );
40
+ }
41
+
42
+ /**
43
+ * Not Allowed Section
44
+ */
45
+ export function NotAllowedSection(props: ComponentProps<"div">) {
46
+ return (
47
+ <ErrorPage {...props}>
48
+ <ErrorPageIcon variant="notAllowed" />
49
+ <ErrorPageDescription>Je hebt geen toegang tot deze pagina.</ErrorPageDescription>
50
+ </ErrorPage>
51
+ );
52
+ }
@@ -0,0 +1,12 @@
1
+ import { NotFoundSection } from "./error-sections";
2
+
3
+ /**
4
+ * Admin Not Found Page
5
+ */
6
+ export function RootNotFoundPage() {
7
+ return (
8
+ <div className="relative z-0 grid h-dvh w-full place-items-center">
9
+ <NotFoundSection className="h-full" />
10
+ </div>
11
+ );
12
+ }
@@ -1,4 +1,4 @@
1
- import { type SQL, ilike, or } from "drizzle-orm";
1
+ import { type SQL, ilike, or, sql } from "drizzle-orm";
2
2
  import type { PgColumn } from "drizzle-orm/pg-core";
3
3
  import { TableQuerySchema } from "../validators";
4
4
 
@@ -16,7 +16,7 @@ export function convertSearchToQueryParams(
16
16
  if (!search) return undefined;
17
17
 
18
18
  // create an array of search fields with the search query applied
19
- const searchFields = fields.map((field) => ilike(field, `%${search}%`));
19
+ const searchFields = fields.map((field) => ilike(sql`${field}::text`, `%${search}%`));
20
20
 
21
21
  // return the query with the search fields
22
22
  return or(...searchFields);
@@ -1,22 +0,0 @@
1
- import * as react_jsx_runtime247 from "react/jsx-runtime";
2
- import { HTMLAttributes } from "react";
3
- import { Route } from "next";
4
-
5
- //#region src/components/layouts/not-allowed-page.d.ts
6
- type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {
7
- title?: string;
8
- description?: string;
9
- callToAction?: {
10
- href: Route;
11
- title: string;
12
- };
13
- };
14
- declare function NotAllowedPage({
15
- title,
16
- description,
17
- callToAction,
18
- ...props
19
- }: NotAllowedPageProps): react_jsx_runtime247.JSX.Element;
20
- //#endregion
21
- export { NotAllowedPage, NotAllowedPageProps };
22
- //# sourceMappingURL=not-allowed-page.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"not-allowed-page.d.mts","names":[],"sources":["../../../src/components/layouts/not-allowed-page.tsx"],"sourcesContent":[],"mappings":";;;;;KAOY,mBAAA,GAAsB,eAAe;;;EAArC,YAAA,CAAA,EAAA;IAAqC,IAAA,EAIvC,KAJuC;IAAf,KAAA,EAAA,MAAA;EAIxB,CAAA;CAAK;AAKC,iBAAA,cAAA,CAAc;EAAA,KAAA;EAAA,WAAA;EAAA,YAAA;EAAA,GAAA;AAAA,CAAA,EAK3B,mBAL2B,CAAA,EAKR,oBAAA,CAAA,GAAA,CAAA,OALQ"}
@@ -1,25 +0,0 @@
1
- import { cn } from "../../lib/utils/cn.mjs";
2
- import { EmptyPage, EmptyPageDescription, EmptyPageTitle } from "./empty-page.mjs";
3
- import { buttonVariants } from "../ui/button.mjs";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import Link from "next/link";
6
-
7
- //#region src/components/layouts/not-allowed-page.tsx
8
- function NotAllowedPage({ title, description, callToAction, ...props }) {
9
- return /* @__PURE__ */ jsxs(EmptyPage, {
10
- ...props,
11
- children: [
12
- /* @__PURE__ */ jsx(EmptyPageTitle, { children: title ?? "Geen toegang" }),
13
- /* @__PURE__ */ jsx(EmptyPageDescription, { children: description ?? "Je hebt geen toegang tot deze pagina." }),
14
- callToAction && /* @__PURE__ */ jsx(Link, {
15
- href: callToAction.href,
16
- className: cn(buttonVariants({ variant: "default" })),
17
- children: callToAction.title
18
- })
19
- ]
20
- });
21
- }
22
-
23
- //#endregion
24
- export { NotAllowedPage };
25
- //# sourceMappingURL=not-allowed-page.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"not-allowed-page.mjs","names":[],"sources":["../../../src/components/layouts/not-allowed-page.tsx"],"sourcesContent":["import { cn } from \"@/lib/utils/cn\";\nimport type { Route } from \"next\";\nimport Link from \"next/link\";\nimport type { HTMLAttributes } from \"react\";\nimport { buttonVariants } from \"../ui/button\";\nimport { EmptyPage, EmptyPageDescription, EmptyPageTitle } from \"./empty-page\";\n\nexport type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {\n title?: string;\n description?: string;\n callToAction?: {\n href: Route;\n title: string;\n };\n};\n\nexport function NotAllowedPage({\n title,\n description,\n callToAction,\n ...props\n}: NotAllowedPageProps) {\n return (\n <EmptyPage {...props}>\n <EmptyPageTitle>{title ?? \"Geen toegang\"}</EmptyPageTitle>\n <EmptyPageDescription>\n {description ?? \"Je hebt geen toegang tot deze pagina.\"}\n </EmptyPageDescription>\n\n {callToAction && (\n <Link href={callToAction.href} className={cn(buttonVariants({ variant: \"default\" }))}>\n {callToAction.title}\n </Link>\n )}\n </EmptyPage>\n );\n}\n\n// <EmptyPage\n// {...props}\n// title={title ?? \"Geen toegang\"}\n// description={description ?? \"Je hebt geen toegang tot deze pagina.\"}\n// callToAction={callToAction ?? { href: \"/admin\", title: \"Terug naar dashboard\" }}\n// />\n"],"mappings":";;;;;;;AAgBA,SAAgB,eAAe,EAC7B,OACA,aACA,cACA,GAAG,SACmB;AACtB,QACE,qBAAC;EAAU,GAAI;;GACb,oBAAC,4BAAgB,SAAS,iBAAgC;GAC1D,oBAAC,kCACE,eAAe,0CACK;GAEtB,gBACC,oBAAC;IAAK,MAAM,aAAa;IAAM,WAAW,GAAG,eAAe,EAAE,SAAS,WAAW,CAAC,CAAC;cACjF,aAAa;KACT;;GAEC"}
@@ -1,8 +0,0 @@
1
- import * as react_jsx_runtime248 from "react/jsx-runtime";
2
-
3
- //#region src/components/layouts/not-found-page.d.ts
4
- declare function AdminNotFoundPage(): react_jsx_runtime248.JSX.Element;
5
- declare function NotFoundPage(): react_jsx_runtime248.JSX.Element;
6
- //#endregion
7
- export { AdminNotFoundPage, NotFoundPage };
8
- //# sourceMappingURL=not-found-page.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"not-found-page.d.mts","names":[],"sources":["../../../src/components/layouts/not-found-page.tsx"],"sourcesContent":[],"mappings":";;;iBAEgB,iBAAA,CAAA,GAAiB,oBAAA,CAAA,GAAA,CAAA;iBAQjB,YAAA,CAAA,GAAY,oBAAA,CAAA,GAAA,CAAA"}
@@ -1,20 +0,0 @@
1
- import { NotFoundSection } from "./not-found-section.mjs";
2
- import { jsx } from "react/jsx-runtime";
3
-
4
- //#region src/components/layouts/not-found-page.tsx
5
- function AdminNotFoundPage() {
6
- return /* @__PURE__ */ jsx("div", {
7
- className: "relative z-0 grid h-[100dvh] w-full place-items-center",
8
- children: /* @__PURE__ */ jsx(NotFoundSection, { href: "/admin" })
9
- });
10
- }
11
- function NotFoundPage() {
12
- return /* @__PURE__ */ jsx("div", {
13
- className: "relative z-0 grid h-[100dvh] w-full place-items-center",
14
- children: /* @__PURE__ */ jsx(NotFoundSection, {})
15
- });
16
- }
17
-
18
- //#endregion
19
- export { AdminNotFoundPage, NotFoundPage };
20
- //# sourceMappingURL=not-found-page.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"not-found-page.mjs","names":[],"sources":["../../../src/components/layouts/not-found-page.tsx"],"sourcesContent":["import { NotFoundSection } from \"./not-found-section\";\n\nexport function AdminNotFoundPage() {\n return (\n <div className=\"relative z-0 grid h-[100dvh] w-full place-items-center\">\n <NotFoundSection href=\"/admin\" />\n </div>\n );\n}\n\nexport function NotFoundPage() {\n return (\n <div className=\"relative z-0 grid h-[100dvh] w-full place-items-center\">\n <NotFoundSection />\n </div>\n );\n}\n"],"mappings":";;;;AAEA,SAAgB,oBAAoB;AAClC,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC,mBAAgB,MAAK,WAAW;GAC7B;;AAIV,SAAgB,eAAe;AAC7B,QACE,oBAAC;EAAI,WAAU;YACb,oBAAC,oBAAkB;GACf"}
@@ -1,30 +0,0 @@
1
- import { cn } from "../../lib/utils/cn.mjs";
2
- import { buttonVariants } from "../ui/button.mjs";
3
- import { HomeIcon } from "lucide-react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- import Link from "next/link";
6
-
7
- //#region src/components/layouts/not-found-section.tsx
8
- function NotFoundSection({ href }) {
9
- return /* @__PURE__ */ jsxs("div", {
10
- className: "flex flex-col items-center gap-12 text-center",
11
- children: [/* @__PURE__ */ jsxs("span", {
12
- className: "text-foreground space-y-2",
13
- children: [/* @__PURE__ */ jsx("h2", {
14
- className: "text-9xl font-bold leading-none",
15
- children: "404"
16
- }), /* @__PURE__ */ jsx("h1", {
17
- className: "text-2xl font-bold lg:text-3xl",
18
- children: "Oeps, deze pagina is niet gevonden."
19
- })]
20
- }), href && /* @__PURE__ */ jsxs(Link, {
21
- href,
22
- className: cn(buttonVariants({ variant: "secondary" }), "text-foreground"),
23
- children: [/* @__PURE__ */ jsx(HomeIcon, { className: "mr-2 size-4" }), "Terug naar home"]
24
- })]
25
- });
26
- }
27
-
28
- //#endregion
29
- export { NotFoundSection };
30
- //# sourceMappingURL=not-found-section.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"not-found-section.mjs","names":[],"sources":["../../../src/components/layouts/not-found-section.tsx"],"sourcesContent":["import { buttonVariants } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils/cn\";\nimport { HomeIcon } from \"lucide-react\";\nimport type { Route } from \"next\";\nimport Link from \"next/link\";\n\nexport function NotFoundSection({ href }: { href?: Route }) {\n return (\n <div className=\"flex flex-col items-center gap-12 text-center\">\n <span className=\"text-foreground space-y-2\">\n <h2 className=\"text-9xl font-bold leading-none\">404</h2>\n <h1 className=\"text-2xl font-bold lg:text-3xl\">Oeps, deze pagina is niet gevonden.</h1>\n </span>\n\n {href && (\n <Link\n href={href}\n className={cn(buttonVariants({ variant: \"secondary\" }), \"text-foreground\")}\n >\n <HomeIcon className=\"mr-2 size-4\" />\n Terug naar home\n </Link>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;AAMA,SAAgB,gBAAgB,EAAE,QAA0B;AAC1D,QACE,qBAAC;EAAI,WAAU;aACb,qBAAC;GAAK,WAAU;cACd,oBAAC;IAAG,WAAU;cAAkC;KAAQ,EACxD,oBAAC;IAAG,WAAU;cAAiC;KAAwC;IAClF,EAEN,QACC,qBAAC;GACO;GACN,WAAW,GAAG,eAAe,EAAE,SAAS,aAAa,CAAC,EAAE,kBAAkB;cAE1E,oBAAC,YAAS,WAAU,gBAAgB;IAE/B;GAEL"}
@@ -1,44 +0,0 @@
1
- import { cn } from "@/lib/utils/cn";
2
- import type { Route } from "next";
3
- import Link from "next/link";
4
- import type { HTMLAttributes } from "react";
5
- import { buttonVariants } from "../ui/button";
6
- import { EmptyPage, EmptyPageDescription, EmptyPageTitle } from "./empty-page";
7
-
8
- export type NotAllowedPageProps = HTMLAttributes<HTMLDivElement> & {
9
- title?: string;
10
- description?: string;
11
- callToAction?: {
12
- href: Route;
13
- title: string;
14
- };
15
- };
16
-
17
- export function NotAllowedPage({
18
- title,
19
- description,
20
- callToAction,
21
- ...props
22
- }: NotAllowedPageProps) {
23
- return (
24
- <EmptyPage {...props}>
25
- <EmptyPageTitle>{title ?? "Geen toegang"}</EmptyPageTitle>
26
- <EmptyPageDescription>
27
- {description ?? "Je hebt geen toegang tot deze pagina."}
28
- </EmptyPageDescription>
29
-
30
- {callToAction && (
31
- <Link href={callToAction.href} className={cn(buttonVariants({ variant: "default" }))}>
32
- {callToAction.title}
33
- </Link>
34
- )}
35
- </EmptyPage>
36
- );
37
- }
38
-
39
- // <EmptyPage
40
- // {...props}
41
- // title={title ?? "Geen toegang"}
42
- // description={description ?? "Je hebt geen toegang tot deze pagina."}
43
- // callToAction={callToAction ?? { href: "/admin", title: "Terug naar dashboard" }}
44
- // />
@@ -1,17 +0,0 @@
1
- import { NotFoundSection } from "./not-found-section";
2
-
3
- export function AdminNotFoundPage() {
4
- return (
5
- <div className="relative z-0 grid h-[100dvh] w-full place-items-center">
6
- <NotFoundSection href="/admin" />
7
- </div>
8
- );
9
- }
10
-
11
- export function NotFoundPage() {
12
- return (
13
- <div className="relative z-0 grid h-[100dvh] w-full place-items-center">
14
- <NotFoundSection />
15
- </div>
16
- );
17
- }
@@ -1,26 +0,0 @@
1
- import { buttonVariants } from "@/components/ui/button";
2
- import { cn } from "@/lib/utils/cn";
3
- import { HomeIcon } from "lucide-react";
4
- import type { Route } from "next";
5
- import Link from "next/link";
6
-
7
- export function NotFoundSection({ href }: { href?: Route }) {
8
- return (
9
- <div className="flex flex-col items-center gap-12 text-center">
10
- <span className="text-foreground space-y-2">
11
- <h2 className="text-9xl font-bold leading-none">404</h2>
12
- <h1 className="text-2xl font-bold lg:text-3xl">Oeps, deze pagina is niet gevonden.</h1>
13
- </span>
14
-
15
- {href && (
16
- <Link
17
- href={href}
18
- className={cn(buttonVariants({ variant: "secondary" }), "text-foreground")}
19
- >
20
- <HomeIcon className="mr-2 size-4" />
21
- Terug naar home
22
- </Link>
23
- )}
24
- </div>
25
- );
26
- }