@tulip-systems/core 0.5.14 → 0.5.16

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 (355) hide show
  1. package/dist/auth/client.d.mts +5 -4
  2. package/dist/auth/client.mjs +6 -5
  3. package/dist/auth.mjs +2 -2
  4. package/dist/components/client.d.mts +1 -3
  5. package/dist/components/client.mjs +3 -5
  6. package/dist/components/common/icons.d.mts +52 -52
  7. package/dist/components/common/icons.d.mts.map +1 -1
  8. package/dist/components/common/status.d.mts +3 -3
  9. package/dist/components/editor/components/content.client.d.mts +2 -2
  10. package/dist/components/editor/components/content.client.d.mts.map +1 -1
  11. package/dist/components/editor/components/editor.client.d.mts +6 -6
  12. package/dist/components/editor/components/editor.client.d.mts.map +1 -1
  13. package/dist/components/editor/components/menu.client.d.mts +3 -3
  14. package/dist/components/editor/components/menu.client.d.mts.map +1 -1
  15. package/dist/components/editor/lib/constants.d.mts +27 -27
  16. package/dist/components/header/back-button.client.d.mts +2 -2
  17. package/dist/components/header/back-button.client.d.mts.map +1 -1
  18. package/dist/components/header/bottom-bar.client.d.mts +3 -3
  19. package/dist/components/header/bottom-bar.client.d.mts.map +1 -1
  20. package/dist/components/header/breadcrumbs.client.d.mts +7 -7
  21. package/dist/components/header/breadcrumbs.client.d.mts.map +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/layouts/admin-content.client.d.mts +2 -2
  29. package/dist/components/layouts/admin-content.client.d.mts.map +1 -1
  30. package/dist/components/layouts/admin-error-pages.d.mts +4 -4
  31. package/dist/components/layouts/admin-layout.d.mts +2 -2
  32. package/dist/components/layouts/admin-layout.d.mts.map +1 -1
  33. package/dist/components/layouts/admin-layout.mjs +1 -1
  34. package/dist/components/layouts/admin-layout.mjs.map +1 -1
  35. package/dist/components/layouts/admin-loading.d.mts +2 -2
  36. package/dist/components/layouts/empty-page.d.mts +4 -4
  37. package/dist/components/layouts/error-page.d.mts +9 -9
  38. package/dist/components/layouts/error-page.d.mts.map +1 -1
  39. package/dist/components/layouts/error-sections.d.mts +5 -5
  40. package/dist/components/layouts/list-layout.d.mts +2 -2
  41. package/dist/components/layouts/providers.client.d.mts +2 -2
  42. package/dist/components/layouts/providers.client.d.mts.map +1 -1
  43. package/dist/components/layouts/root-error-pages.d.mts +2 -2
  44. package/dist/components/layouts/root-layout.server.d.mts +4 -4
  45. package/dist/components/layouts/root-layout.server.d.mts.map +1 -1
  46. package/dist/components/layouts/root-loading.d.mts +2 -2
  47. package/dist/components/layouts/tab-layout.d.mts +2 -2
  48. package/dist/components/lists/data-list.d.mts +5 -5
  49. package/dist/components/lists/data-stack.d.mts +8 -8
  50. package/dist/components/navigation/admin-sidebar-header.client.mjs +3 -2
  51. package/dist/components/navigation/admin-sidebar-header.client.mjs.map +1 -1
  52. package/dist/components/navigation/admin-sidebar-paths.client.d.mts +10 -10
  53. package/dist/components/navigation/admin-sidebar-paths.client.d.mts.map +1 -1
  54. package/dist/components/ui/accordion.d.mts +5 -5
  55. package/dist/components/ui/alert-dialog.d.mts +12 -12
  56. package/dist/components/ui/alert.d.mts +6 -6
  57. package/dist/components/ui/aspect-ratio.d.mts +2 -2
  58. package/dist/components/ui/avatar.client.d.mts +4 -4
  59. package/dist/components/ui/avatar.client.d.mts.map +1 -1
  60. package/dist/components/ui/badge.d.mts +5 -5
  61. package/dist/components/ui/breadcrumb.d.mts +8 -8
  62. package/dist/components/ui/button.d.mts +5 -5
  63. package/dist/components/ui/calendar.d.mts +3 -3
  64. package/dist/components/ui/card.d.mts +7 -7
  65. package/dist/components/ui/carousel.d.mts +6 -6
  66. package/dist/components/ui/chart.client.d.mts +5 -5
  67. package/dist/components/ui/chart.client.d.mts.map +1 -1
  68. package/dist/components/ui/checkbox.d.mts +2 -2
  69. package/dist/components/ui/collapsible.client.d.mts +4 -4
  70. package/dist/components/ui/collapsible.client.d.mts.map +1 -1
  71. package/dist/components/ui/color-picker.client.d.mts +2 -2
  72. package/dist/components/ui/color-picker.client.d.mts.map +1 -1
  73. package/dist/components/ui/combobox-dropdown.client.d.mts +2 -2
  74. package/dist/components/ui/combobox-dropdown.client.d.mts.map +1 -1
  75. package/dist/components/ui/combobox.client.d.mts +2 -2
  76. package/dist/components/ui/combobox.client.d.mts.map +1 -1
  77. package/dist/components/ui/command.d.mts +10 -10
  78. package/dist/components/ui/context-menu.d.mts +16 -16
  79. package/dist/components/ui/date-picker.client.d.mts +2 -2
  80. package/dist/components/ui/date-picker.client.d.mts.map +1 -1
  81. package/dist/components/ui/dialog.client.d.mts +11 -11
  82. package/dist/components/ui/dialog.client.d.mts.map +1 -1
  83. package/dist/components/ui/drawer.client.d.mts +11 -11
  84. package/dist/components/ui/drawer.client.d.mts.map +1 -1
  85. package/dist/components/ui/dropdown-menu.d.mts +16 -16
  86. package/dist/components/ui/form.client.d.mts +7 -7
  87. package/dist/components/ui/form.client.d.mts.map +1 -1
  88. package/dist/components/ui/hover-card.client.d.mts +4 -4
  89. package/dist/components/ui/hover-card.client.d.mts.map +1 -1
  90. package/dist/components/ui/input-date-time.d.mts +23 -0
  91. package/dist/components/ui/input-date-time.d.mts.map +1 -0
  92. package/dist/components/ui/input-date-time.mjs +34 -0
  93. package/dist/components/ui/input-date-time.mjs.map +1 -0
  94. package/dist/components/ui/input-date.d.mts +14 -0
  95. package/dist/components/ui/input-date.d.mts.map +1 -0
  96. package/dist/components/ui/input-date.mjs +16 -0
  97. package/dist/components/ui/input-date.mjs.map +1 -0
  98. package/dist/components/ui/input-recipient.d.mts +2 -2
  99. package/dist/components/ui/input-time.d.mts +14 -0
  100. package/dist/components/ui/input-time.d.mts.map +1 -0
  101. package/dist/components/ui/input-time.mjs +16 -0
  102. package/dist/components/ui/input-time.mjs.map +1 -0
  103. package/dist/components/ui/input.d.mts +2 -2
  104. package/dist/components/ui/label.d.mts +2 -2
  105. package/dist/components/ui/navigation-menu.d.mts +11 -11
  106. package/dist/components/ui/pagination.d.mts +8 -8
  107. package/dist/components/ui/popover.d.mts +5 -5
  108. package/dist/components/ui/progress.client.d.mts +2 -2
  109. package/dist/components/ui/progress.client.d.mts.map +1 -1
  110. package/dist/components/ui/radio-group.d.mts +3 -3
  111. package/dist/components/ui/resizable.client.d.mts +4 -4
  112. package/dist/components/ui/resizable.client.d.mts.map +1 -1
  113. package/dist/components/ui/scroll-area.d.mts +3 -3
  114. package/dist/components/ui/select.client.d.mts +11 -11
  115. package/dist/components/ui/select.client.d.mts.map +1 -1
  116. package/dist/components/ui/separator.d.mts +2 -2
  117. package/dist/components/ui/sheet.client.d.mts +9 -9
  118. package/dist/components/ui/sheet.client.d.mts.map +1 -1
  119. package/dist/components/ui/sidebar.client.d.mts +26 -26
  120. package/dist/components/ui/sidebar.client.d.mts.map +1 -1
  121. package/dist/components/ui/skeleton.d.mts +2 -2
  122. package/dist/components/ui/slider.d.mts +2 -2
  123. package/dist/components/ui/sonner.client.d.mts +2 -2
  124. package/dist/components/ui/sonner.client.mjs +1 -1
  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/toggle-group.client.d.mts +3 -3
  129. package/dist/components/ui/toggle.d.mts +4 -4
  130. package/dist/components/ui/tooltip.client.d.mts +5 -5
  131. package/dist/components.d.mts +4 -1
  132. package/dist/components.mjs +6 -3
  133. package/dist/inline-edit/client.d.mts +3 -1
  134. package/dist/inline-edit/client.mjs +3 -1
  135. package/dist/lib/client.mjs +1 -1
  136. package/dist/lib/hooks/use-indicator.d.mts +2 -2
  137. package/dist/lib/hooks/use-indicator.d.mts.map +1 -1
  138. package/dist/modules/auth/components/allowed.client.d.mts +2 -2
  139. package/dist/modules/auth/components/allowed.client.d.mts.map +1 -1
  140. package/dist/modules/auth/components/allowed.client.mjs +2 -3
  141. package/dist/modules/auth/components/allowed.client.mjs.map +1 -1
  142. package/dist/modules/auth/components/auth-layout.server.d.mts +2 -2
  143. package/dist/modules/auth/components/auth-layout.server.d.mts.map +1 -1
  144. package/dist/modules/auth/components/auth-loading.d.mts +2 -2
  145. package/dist/modules/auth/components/auth-loading.d.mts.map +1 -1
  146. package/dist/modules/auth/components/create-first-user-page.client.d.mts +2 -2
  147. package/dist/modules/auth/components/create-first-user-page.client.d.mts.map +1 -1
  148. package/dist/modules/auth/components/create-first-user-page.client.mjs +4 -3
  149. package/dist/modules/auth/components/create-first-user-page.client.mjs.map +1 -1
  150. package/dist/modules/auth/components/forget-password-page.client.d.mts +2 -2
  151. package/dist/modules/auth/components/forget-password-page.client.d.mts.map +1 -1
  152. package/dist/modules/auth/components/forget-password-page.client.mjs +4 -3
  153. package/dist/modules/auth/components/forget-password-page.client.mjs.map +1 -1
  154. package/dist/modules/auth/components/guard-first-user.server.d.mts +2 -2
  155. package/dist/modules/auth/components/guard-first-user.server.d.mts.map +1 -1
  156. package/dist/modules/auth/components/guard.server.d.mts +3 -2
  157. package/dist/modules/auth/components/guard.server.d.mts.map +1 -1
  158. package/dist/modules/auth/components/guard.server.mjs +1 -0
  159. package/dist/modules/auth/components/guard.server.mjs.map +1 -1
  160. package/dist/modules/auth/components/login-page.client.d.mts +2 -2
  161. package/dist/modules/auth/components/login-page.client.d.mts.map +1 -1
  162. package/dist/modules/auth/components/login-page.client.mjs +4 -3
  163. package/dist/modules/auth/components/login-page.client.mjs.map +1 -1
  164. package/dist/modules/auth/components/reset-password-page.client.d.mts +2 -2
  165. package/dist/modules/auth/components/reset-password-page.client.d.mts.map +1 -1
  166. package/dist/modules/auth/components/reset-password-page.client.mjs +4 -3
  167. package/dist/modules/auth/components/reset-password-page.client.mjs.map +1 -1
  168. package/dist/modules/auth/components/update-password-command.d.mts +2 -2
  169. package/dist/modules/auth/components/update-password-command.d.mts.map +1 -1
  170. package/dist/modules/auth/components/update-password-command.mjs +1 -1
  171. package/dist/modules/auth/db/schema.d.mts +73 -73
  172. package/dist/modules/auth/db/schema.d.mts.map +1 -1
  173. package/dist/modules/auth/handler/{client.client.d.mts → create-client.client.d.mts} +328 -188
  174. package/dist/modules/auth/handler/create-client.client.d.mts.map +1 -0
  175. package/dist/modules/auth/handler/create-client.client.mjs +26 -0
  176. package/dist/modules/auth/handler/create-client.client.mjs.map +1 -0
  177. package/dist/modules/auth/handler/init.d.mts +116 -130
  178. package/dist/modules/auth/handler/init.d.mts.map +1 -1
  179. package/dist/modules/auth/hooks/use-auth-client.d.mts +24 -0
  180. package/dist/modules/auth/hooks/use-auth-client.d.mts.map +1 -0
  181. package/dist/modules/auth/hooks/use-auth-client.mjs +31 -0
  182. package/dist/modules/auth/hooks/use-auth-client.mjs.map +1 -0
  183. package/dist/modules/auth/hooks/use-permission.d.mts +8 -35
  184. package/dist/modules/auth/hooks/use-permission.d.mts.map +1 -1
  185. package/dist/modules/auth/hooks/use-permission.mjs +47 -93
  186. package/dist/modules/auth/hooks/use-permission.mjs.map +1 -1
  187. package/dist/modules/auth/hooks/use-session.d.mts +5 -119
  188. package/dist/modules/auth/hooks/use-session.d.mts.map +1 -1
  189. package/dist/modules/auth/hooks/use-session.mjs +15 -17
  190. package/dist/modules/auth/hooks/use-session.mjs.map +1 -1
  191. package/dist/modules/auth/lib/helpers.server.d.mts +2 -2
  192. package/dist/modules/auth/lib/helpers.server.d.mts.map +1 -1
  193. package/dist/modules/auth/lib/helpers.server.mjs +1 -1
  194. package/dist/modules/auth/lib/validators.d.mts +2 -2
  195. package/dist/modules/auth/lib/validators.d.mts.map +1 -1
  196. package/dist/modules/commands/components/alert-dialog-command.client.d.mts +11 -11
  197. package/dist/modules/commands/components/alert-dialog-command.client.d.mts.map +1 -1
  198. package/dist/modules/commands/components/click-command.client.d.mts +2 -2
  199. package/dist/modules/commands/components/click-command.client.d.mts.map +1 -1
  200. package/dist/modules/commands/components/command-trigger.client.d.mts +6 -6
  201. package/dist/modules/commands/components/command-trigger.client.d.mts.map +1 -1
  202. package/dist/modules/commands/components/dialog-command.client.d.mts +8 -8
  203. package/dist/modules/commands/components/dialog-command.client.d.mts.map +1 -1
  204. package/dist/modules/commands/components/dropdown-command.client.d.mts +5 -5
  205. package/dist/modules/commands/components/dropdown-command.client.d.mts.map +1 -1
  206. package/dist/modules/commands/components/empty-command.client.d.mts +2 -2
  207. package/dist/modules/commands/components/empty-command.client.d.mts.map +1 -1
  208. package/dist/modules/commands/components/form-dialog-command.client.d.mts +12 -12
  209. package/dist/modules/commands/components/form-dialog-command.client.d.mts.map +1 -1
  210. package/dist/modules/commands/hooks/use-command-menu.client.mjs.map +1 -1
  211. package/dist/modules/commands/hooks/use-command-mutation.client.d.mts +2 -2
  212. package/dist/modules/commands/hooks/use-command-mutation.client.mjs +1 -1
  213. package/dist/modules/commands/menus/context-menu.client.d.mts +2 -2
  214. package/dist/modules/commands/menus/context-menu.client.d.mts.map +1 -1
  215. package/dist/modules/commands/menus/dropdown-menu.client.d.mts +3 -3
  216. package/dist/modules/commands/menus/dropdown-menu.client.d.mts.map +1 -1
  217. package/dist/modules/commands/menus/inline-menu.client.d.mts +3 -3
  218. package/dist/modules/commands/menus/inline-menu.client.d.mts.map +1 -1
  219. package/dist/modules/commands/menus/responsive-menu.client.d.mts +3 -3
  220. package/dist/modules/commands/menus/responsive-menu.client.d.mts.map +1 -1
  221. package/dist/modules/commands/utils/archive-command.client.d.mts +3 -3
  222. package/dist/modules/commands/utils/archive-command.client.d.mts.map +1 -1
  223. package/dist/modules/commands/utils/delete-command.client.d.mts +3 -3
  224. package/dist/modules/commands/utils/delete-command.client.d.mts.map +1 -1
  225. package/dist/modules/config/db/helpers.d.mts +5 -5
  226. package/dist/modules/config/db/helpers.d.mts.map +1 -1
  227. package/dist/modules/config/lib/config.d.mts +1 -1
  228. package/dist/modules/config/lib/config.mjs.map +1 -1
  229. package/dist/modules/data-tables/components/cell/common.client.d.mts +5 -5
  230. package/dist/modules/data-tables/components/cell/common.client.d.mts.map +1 -1
  231. package/dist/modules/data-tables/components/column-header.d.mts +2 -2
  232. package/dist/modules/data-tables/components/column-header.d.mts.map +1 -1
  233. package/dist/modules/data-tables/components/filters/combobox.client.d.mts +2 -2
  234. package/dist/modules/data-tables/components/filters/slider.client.d.mts +2 -2
  235. package/dist/modules/data-tables/components/header.d.mts +4 -4
  236. package/dist/modules/data-tables/components/header.d.mts.map +1 -1
  237. package/dist/modules/data-tables/components/layout.d.mts +2 -2
  238. package/dist/modules/data-tables/components/layout.d.mts.map +1 -1
  239. package/dist/modules/data-tables/components/search-input.client.d.mts +2 -2
  240. package/dist/modules/data-tables/components/skeleton.d.mts +2 -2
  241. package/dist/modules/data-tables/components/skeleton.d.mts.map +1 -1
  242. package/dist/modules/data-tables/components/table.d.mts +7 -7
  243. package/dist/modules/data-tables/components/table.d.mts.map +1 -1
  244. package/dist/modules/data-tables/components/toolbar.d.mts +3 -3
  245. package/dist/modules/data-tables/components/toolbar.d.mts.map +1 -1
  246. package/dist/modules/data-tables/hooks/use-context.client.d.mts +2 -2
  247. package/dist/modules/data-tables/strategies/helpers/sorting.mjs +1 -1
  248. package/dist/modules/data-tables/tables/data-table/components/table.d.mts +2 -2
  249. package/dist/modules/data-tables/tables/inline-table/components/cells/common.d.mts +2 -2
  250. package/dist/modules/data-tables/tables/inline-table/components/cells/drag-handle.client.d.mts +2 -2
  251. package/dist/modules/data-tables/tables/inline-table/components/cells/read-only.d.mts +2 -2
  252. package/dist/modules/data-tables/tables/inline-table/components/table.d.mts +2 -2
  253. package/dist/modules/data-tables/tables/inline-table/hooks/context.client.d.mts +2 -2
  254. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts +2 -2
  255. package/dist/modules/inline-edit/components/combobox-dropdown.client.d.mts.map +1 -1
  256. package/dist/modules/inline-edit/components/combobox.client.d.mts +2 -2
  257. package/dist/modules/inline-edit/components/combobox.client.d.mts.map +1 -1
  258. package/dist/modules/inline-edit/components/date-input.client.d.mts +2 -2
  259. package/dist/modules/inline-edit/components/date-input.client.d.mts.map +1 -1
  260. package/dist/modules/inline-edit/components/date-picker.client.d.mts +2 -2
  261. package/dist/modules/inline-edit/components/date-picker.client.d.mts.map +1 -1
  262. package/dist/modules/inline-edit/components/date-time.client.d.mts +21 -0
  263. package/dist/modules/inline-edit/components/date-time.client.d.mts.map +1 -0
  264. package/dist/modules/inline-edit/components/date-time.client.mjs +33 -0
  265. package/dist/modules/inline-edit/components/date-time.client.mjs.map +1 -0
  266. package/dist/modules/inline-edit/components/editor.client.d.mts +2 -2
  267. package/dist/modules/inline-edit/components/editor.client.d.mts.map +1 -1
  268. package/dist/modules/inline-edit/components/input-recipient.client.d.mts +2 -2
  269. package/dist/modules/inline-edit/components/input-recipient.client.d.mts.map +1 -1
  270. package/dist/modules/inline-edit/components/input-toggle.client.d.mts +2 -2
  271. package/dist/modules/inline-edit/components/input-toggle.client.d.mts.map +1 -1
  272. package/dist/modules/inline-edit/components/input.client.d.mts +4 -4
  273. package/dist/modules/inline-edit/components/input.client.d.mts.map +1 -1
  274. package/dist/modules/inline-edit/components/select.client.d.mts +6 -6
  275. package/dist/modules/inline-edit/components/select.client.d.mts.map +1 -1
  276. package/dist/modules/inline-edit/components/switch.client.d.mts +2 -2
  277. package/dist/modules/inline-edit/components/switch.client.d.mts.map +1 -1
  278. package/dist/modules/inline-edit/components/toggle.client.d.mts +2 -2
  279. package/dist/modules/inline-edit/components/toggle.client.d.mts.map +1 -1
  280. package/dist/modules/inline-edit/hooks/context.client.d.mts +2 -2
  281. package/dist/modules/inline-edit/hooks/context.client.d.mts.map +1 -1
  282. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts +15 -2
  283. package/dist/modules/inline-edit/hooks/use-inline.client.d.mts.map +1 -1
  284. package/dist/modules/inline-edit/hooks/use-inline.client.mjs +2 -6
  285. package/dist/modules/inline-edit/hooks/use-inline.client.mjs.map +1 -1
  286. package/dist/modules/router/handler/init.server.d.mts +6 -6
  287. package/dist/modules/router/handler/init.server.d.mts.map +1 -1
  288. package/dist/modules/router/lib/query-client.server.d.mts +2 -2
  289. package/dist/modules/router/lib/query-client.server.d.mts.map +1 -1
  290. package/dist/modules/storage/components/dropzone-context.client.d.mts +2 -2
  291. package/dist/modules/storage/components/dropzone-context.client.d.mts.map +1 -1
  292. package/dist/modules/storage/components/dropzone.client.d.mts +5 -5
  293. package/dist/modules/storage/components/dropzone.client.d.mts.map +1 -1
  294. package/dist/modules/storage/components/image-grid.client.d.mts +3 -3
  295. package/dist/modules/storage/components/image-grid.client.d.mts.map +1 -1
  296. package/dist/modules/storage/components/image-grid.client.mjs +1 -1
  297. package/dist/modules/storage/components/upload-zone.client.d.mts +2 -2
  298. package/dist/modules/storage/components/upload-zone.client.d.mts.map +1 -1
  299. package/dist/modules/storage/components/upload-zone.client.mjs +1 -1
  300. package/dist/modules/storage/lib/create-upload.client.d.mts.map +1 -1
  301. package/dist/modules/storage/lib/proxy.server.mjs +1 -1
  302. package/dist/modules/storage/lib/router.server.d.mts +2359 -2359
  303. package/dist/modules/storage/lib/router.server.d.mts.map +1 -1
  304. package/dist/modules/storage/lib/router.server.mjs +1 -1
  305. package/dist/modules/storage/lib/schema.d.mts +92 -92
  306. package/dist/modules/storage/lib/service.server.d.mts +24 -24
  307. package/dist/modules/storage/lib/service.server.mjs +1 -1
  308. package/dist/modules/storage/lib/validators.d.mts +90 -90
  309. package/dist/modules/storage/lib/validators.d.mts.map +1 -1
  310. package/package.json +3 -10
  311. package/src/components/entry.client.ts +0 -2
  312. package/src/components/entry.ts +3 -0
  313. package/src/components/layouts/admin-layout.tsx +1 -3
  314. package/src/components/navigation/admin-sidebar-header.client.tsx +3 -20
  315. package/src/components/ui/input-date-time.tsx +58 -0
  316. package/src/components/ui/input-date.tsx +20 -0
  317. package/src/components/ui/input-time.tsx +20 -0
  318. package/src/modules/auth/components/allowed.client.tsx +2 -2
  319. package/src/modules/auth/components/create-first-user-page.client.tsx +3 -2
  320. package/src/modules/auth/components/forget-password-page.client.tsx +2 -1
  321. package/src/modules/auth/components/guard.server.tsx +2 -0
  322. package/src/modules/auth/components/login-page.client.tsx +2 -1
  323. package/src/modules/auth/components/reset-password-page.client.tsx +3 -1
  324. package/src/modules/auth/entry.client.ts +13 -1
  325. package/src/modules/auth/entry.ts +11 -0
  326. package/src/modules/auth/handler/create-client.client.ts +53 -0
  327. package/src/modules/auth/hooks/use-auth-client.tsx +38 -0
  328. package/src/modules/auth/hooks/use-permission.ts +49 -94
  329. package/src/modules/auth/hooks/use-session.ts +16 -16
  330. package/src/modules/commands/hooks/use-command-menu.client.tsx +0 -6
  331. package/src/modules/config/lib/config.ts +3 -2
  332. package/src/modules/inline-edit/components/date-time.client.tsx +38 -0
  333. package/src/modules/inline-edit/entry.client.ts +9 -0
  334. package/src/modules/inline-edit/entry.server.ts +3 -0
  335. package/src/modules/inline-edit/entry.ts +3 -0
  336. package/src/modules/inline-edit/hooks/use-inline.client.tsx +1 -1
  337. package/dist/components/ui/time-input.client.d.mts +0 -16
  338. package/dist/components/ui/time-input.client.d.mts.map +0 -1
  339. package/dist/components/ui/time-input.client.mjs +0 -53
  340. package/dist/components/ui/time-input.client.mjs.map +0 -1
  341. package/dist/components/ui/time-picker-input.client.d.mts +0 -15
  342. package/dist/components/ui/time-picker-input.client.d.mts.map +0 -1
  343. package/dist/components/ui/time-picker-input.client.mjs +0 -64
  344. package/dist/components/ui/time-picker-input.client.mjs.map +0 -1
  345. package/dist/lib/utils/time-picker.d.mts +0 -6
  346. package/dist/lib/utils/time-picker.d.mts.map +0 -1
  347. package/dist/lib/utils/time-picker.mjs +0 -104
  348. package/dist/lib/utils/time-picker.mjs.map +0 -1
  349. package/dist/modules/auth/handler/client.client.d.mts.map +0 -1
  350. package/dist/modules/auth/handler/client.client.mjs +0 -21
  351. package/dist/modules/auth/handler/client.client.mjs.map +0 -1
  352. package/src/components/ui/time-input.client.tsx +0 -56
  353. package/src/components/ui/time-picker-input.client.tsx +0 -107
  354. package/src/modules/auth/components/guard.client.tsx +0 -12
  355. package/src/modules/auth/handler/client.client.ts +0 -16
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.mts","names":[],"sources":["../../../../src/modules/storage/lib/validators.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAYY,IAAA,UAAc,KAAA,CAAM;AAApB,KACA,QAAA,GADI,OACc,KAAA,CAAM,YADQ,GAAA;EAChC,IAAA,EAAA,MAAQ;AACpB,CAAA;AAKa,KALD,UAAA,GAKiD,OAL7B,KAAA,CAAM,YAKX,GAAA;EACf,IAAA,EAAA,QAAQ;AAKpB,CAAA;;;;cANa,gBAAc,GAAA,CAAA;;;;KACf,QAAA,GAAW,GAAA,CAAE,aAAa;;;;cAKzB,+BAAgB;QAE3B,uBAAA,CAAA;;;;;;;;;gBAF2B,EAAA,KAAA;IAAA,eAAA,EAAA,KAAA;IAIjB,iBAAe,EAAA,KAAA;IACf,UAAA,EAAA,CAAA,MAAgB,EAAA,GAAA,MAAkB,EAAA,CAAA;IAKjC,UAAA,EAAA,KAA4C;IAAA,QAAA,EAAA,SAAA;;;;;;;;;;;;;;;;;;;;wCAA5B,CAAA;IAAA,IAAA,EAAA,MAAA;IAEjB,SAAA,EAAA,OAAe;IACf,QAAA,EAAA,QAAgB;IAKf,UAAA,EAAA,cAA4C;IAAA,IAAA,EAAA,MAAA,GAAA,QAAA;;;;;;;;;;;;;;;;;;;;cAA5B,EAAA,IAAA;IAAA,YAAA,EAAA,KAAA;IAChB,eAAA,EAAA,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAA4B,UAAA,EAAA,KAAA;IAAA,YAAA,EAAA,KAAA;IAI7B,eAAgB,EAAA,KAAA;IAChB,iBAAA,EAAA,KAAA;IAKC,UAAA,EAAA,CAAA,MAAA,EAAA,GAWR,MAAA,EAAA,C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;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAaxB,iBAAA,GAAoB,GAAA,CAAE,aAAa;;;;cAKlC,wBAAsB,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;KAOvB,sBAAA,GAAyB,GAAA,CAAE,aAAa;;;;cAKvC,kBAAgB,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEjB,gBAAA,GAAmB,GAAA,CAAE,aAAa;;;;cAKjC,mBAAiB,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAElB,iBAAA,GAAoB,GAAA,CAAE,aAAa;;;;cAKlC;;;;cAEA,kBAAgB,GAAA,CAAA;;;;;;;;;;KAKjB,eAAA,GAAkB,GAAA,CAAE,aAAa;KACjC,gBAAA,GAAmB,GAAA,CAAE,aAAa;;;;cAKjC,0BAAwB,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAIzB,uBAAA,GAA0B,GAAA,CAAE,aAAa;;;;cAKxC,iBAAe,GAAA,CAAA;;;;;;;;KAMhB,cAAA,GAAiB,GAAA,CAAE,aAAa;KAChC,eAAA,GAAkB,GAAA,CAAE,aAAa;;;;cAKhC,iBAAe,GAAA,CAAA;;;;;;;;;;;KAShB,cAAA,GAAiB,GAAA,CAAE,aAAa;SACnC;;KAGG,eAAA,GAAkB,GAAA,CAAE,aAAa"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tulip-systems/core",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -11,7 +11,6 @@
11
11
  "eslint": "^9.39.1",
12
12
  "tailwindcss": "^4.1.17",
13
13
  "tsdown": "^0.17.1",
14
- "tw-animate-css": "^1.4.0",
15
14
  "typescript": "5.9.3",
16
15
  "vite": "^7.2.7",
17
16
  "@tulip-systems/eslint-config": "0.0.0",
@@ -68,7 +67,7 @@
68
67
  "@tiptap/extension-bold": "^3.14.0",
69
68
  "@tiptap/extension-color": "^3.14.0",
70
69
  "@tiptap/extension-document": "^3.14.0",
71
- "@tiptap/extension-file-handler": "^3.15.3",
70
+ "@tiptap/extension-file-handler": "^3.14.0",
72
71
  "@tiptap/extension-hard-break": "^3.14.0",
73
72
  "@tiptap/extension-heading": "^3.14.0",
74
73
  "@tiptap/extension-highlight": "^3.14.0",
@@ -98,14 +97,9 @@
98
97
  "embla-carousel-react": "^8.5.2",
99
98
  "lucide-react": "^0.556.0",
100
99
  "motion": "^12.23.25",
101
- "next": "16.1.1",
102
100
  "next-themes": "^0.4.6",
103
- "nuqs": "2.8.3",
104
- "pg": "^8.18.0",
105
- "react": "19.2.3",
106
101
  "react-colorful": "^5.6.1",
107
102
  "react-day-picker": "9.12.0",
108
- "react-dom": "19.2.3",
109
103
  "react-dropzone": "^14.3.8",
110
104
  "react-email": "^5.0.6",
111
105
  "react-hook-form": "^7.68.0",
@@ -118,7 +112,6 @@
118
112
  "sonner": "^2.0.1",
119
113
  "superjson": "^2.2.6",
120
114
  "tailwind-merge": "^3.4.0",
121
- "tailwindcss-animate": "^1.0.7",
122
115
  "urlpattern-polyfill": "^10.1.0",
123
116
  "use-debounce": "^10.0.4",
124
117
  "uuid": "^13.0.0",
@@ -176,7 +169,7 @@
176
169
  "module": "./dist/components.js",
177
170
  "types": "./dist/components.d.ts",
178
171
  "scripts": {
179
- "dev": "tsdown --watch",
172
+ "dev": "tsdown --config-loader tsdown.config.ts --watch",
180
173
  "build": "tsdown --config-loader tsdown.config.ts",
181
174
  "lint": "eslint \"src/**/*.ts*\"",
182
175
  "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
@@ -46,7 +46,5 @@ export * from "./ui/select.client";
46
46
  export * from "./ui/sheet.client";
47
47
  export * from "./ui/sidebar.client";
48
48
  export * from "./ui/sonner.client";
49
- export * from "./ui/time-input.client";
50
- export * from "./ui/time-picker-input.client";
51
49
  export * from "./ui/toggle-group.client";
52
50
  export * from "./ui/tooltip.client";
@@ -44,6 +44,9 @@ export * from "./ui/command";
44
44
  export * from "./ui/context-menu";
45
45
  export * from "./ui/dropdown-menu";
46
46
  export * from "./ui/input";
47
+ export * from "./ui/input-time";
48
+ export * from "./ui/input-date";
49
+ export * from "./ui/input-date-time";
47
50
  export * from "./ui/label";
48
51
  export * from "./ui/navigation-menu";
49
52
  export * from "./ui/pagination";
@@ -3,8 +3,6 @@ import { SidebarProvider } from "../ui/sidebar.client";
3
3
 
4
4
  export function AdminLayout(props: PropsWithChildren) {
5
5
  return (
6
- <SidebarProvider className="max-h-[100dvh] overflow-hidden border">
7
- {props.children}
8
- </SidebarProvider>
6
+ <SidebarProvider className="max-h-dvh overflow-hidden border">{props.children}</SidebarProvider>
9
7
  );
10
8
  }
@@ -13,7 +13,7 @@ import {
13
13
  DropdownMenuTrigger,
14
14
  } from "@/components/ui/dropdown-menu";
15
15
  import { cn } from "@/lib/utils/cn";
16
- import { authClient } from "@/modules/auth/handler/client.client";
16
+ import { useAuthClient } from "@/modules/auth/hooks/use-auth-client";
17
17
  import { useSession } from "@/modules/auth/hooks/use-session";
18
18
  import {
19
19
  ChevronsUpDownIcon,
@@ -32,13 +32,14 @@ import { SidebarHeader, useSidebar } from "../ui/sidebar.client";
32
32
 
33
33
  export function AdminSidebarHeader() {
34
34
  const router = useRouter();
35
+ const authClient = useAuthClient();
35
36
  const { theme, setTheme } = useTheme();
36
37
 
37
38
  const [open, setOpen] = React.useState(false);
38
39
 
39
40
  const { setOpenMobile } = useSidebar();
40
41
 
41
- const sessionQuery = useSession();
42
+ const sessionQuery = useSession(authClient);
42
43
 
43
44
  return (
44
45
  <SidebarHeader>
@@ -105,24 +106,6 @@ export function AdminSidebarHeader() {
105
106
  </DropdownMenuSubContent>
106
107
  </DropdownMenuSub>
107
108
 
108
- {/*
109
- <DropdownMenuItem
110
- onClick={() => {
111
- setOpenMobile(false);
112
- setOpen(false);
113
- authClient.passkey.addPasskey({
114
- fetchOptions: {
115
- onSuccess: () => {
116
- toast.success("Passkey succesvol toegevoegd");
117
- },
118
- },
119
- });
120
- }}
121
- >
122
- <Icons.add className="mr-2 h-4 w-4" />
123
- <span>Passkey</span>
124
- </DropdownMenuItem> */}
125
-
126
109
  <DropdownMenuItem
127
110
  onClick={() => {
128
111
  setOpenMobile(false);
@@ -0,0 +1,58 @@
1
+ import { cn } from "@/lib/utils/cn";
2
+ import { format } from "date-fns";
3
+ import { Input } from "./input";
4
+
5
+ /**
6
+ * DateTimeInput
7
+ */
8
+ type DateTimeInputProps = Omit<React.ComponentProps<"input">, "type" | "value" | "defaultValue"> & {
9
+ defaultValue?: Date;
10
+ value?: Date;
11
+ onValueChange?: (date: Date | undefined) => void;
12
+ onValueBlur?: (date: Date | undefined) => void;
13
+ };
14
+
15
+ export function DateTimeInput({
16
+ className,
17
+ onValueChange,
18
+ onChange,
19
+ onValueBlur,
20
+ onBlur,
21
+ ...props
22
+ }: DateTimeInputProps) {
23
+ /**
24
+ * Transform Date to string in the format "yyyy-MM-ddTHH:mm" for the input value. If the value is not a Date, use undefined.
25
+ */
26
+ const defaultValue =
27
+ props.defaultValue instanceof Date
28
+ ? format(props.defaultValue, "yyyy-MM-dd'T'HH:mm")
29
+ : undefined;
30
+
31
+ const value =
32
+ props.value && props.value instanceof Date
33
+ ? format(props.value, "yyyy-MM-dd'T'HH:mm")
34
+ : undefined;
35
+
36
+ return (
37
+ <Input
38
+ {...props}
39
+ type="datetime-local"
40
+ defaultValue={defaultValue}
41
+ value={value}
42
+ onChange={(e) => {
43
+ const date = new Date(e.target.value);
44
+ onValueChange?.(date ?? undefined);
45
+ onChange?.(e);
46
+ }}
47
+ onBlur={(e) => {
48
+ const date = new Date(e.target.value);
49
+ onValueBlur?.(date ?? undefined);
50
+ onBlur?.(e);
51
+ }}
52
+ className={cn(
53
+ "appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
54
+ className,
55
+ )}
56
+ />
57
+ );
58
+ }
@@ -0,0 +1,20 @@
1
+ import { cn } from "@/lib/utils/cn";
2
+ import { Input } from "./input";
3
+
4
+ /**
5
+ * DateInput
6
+ */
7
+ type DateInputProps = Omit<React.ComponentProps<"input">, "type">;
8
+
9
+ export function DateInput({ className, ...props }: DateInputProps) {
10
+ return (
11
+ <Input
12
+ {...props}
13
+ type="date"
14
+ className={cn(
15
+ "appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
16
+ className,
17
+ )}
18
+ />
19
+ );
20
+ }
@@ -0,0 +1,20 @@
1
+ import { cn } from "@/lib/utils/cn";
2
+ import { Input } from "./input";
3
+
4
+ /**
5
+ * TimeInput
6
+ */
7
+ type TimeInputProps = Omit<React.ComponentProps<"input">, "type">;
8
+
9
+ export function TimeInput({ className, ...props }: TimeInputProps) {
10
+ return (
11
+ <Input
12
+ {...props}
13
+ type="time"
14
+ className={cn(
15
+ "appearance-none [&::-webkit-calendar-picker-indicator]:hidden [&::-webkit-calendar-picker-indicator]:appearance-none",
16
+ className,
17
+ )}
18
+ />
19
+ );
20
+ }
@@ -42,9 +42,9 @@ export type AllowedProps = UsePermissionProps & {
42
42
  * Allowed
43
43
  */
44
44
  export function Allowed({ permission, strategy, fallback, children }: AllowedProps) {
45
- const { data } = usePermission({ permission, strategy } as UsePermissionProps);
45
+ const data = usePermission({ permission, strategy } as UsePermissionProps);
46
46
 
47
- if (data?.success) return <>{children}</>;
47
+ if (data.success) return <>{children}</>;
48
48
 
49
49
  return <>{fallback}</>;
50
50
  }
@@ -22,10 +22,11 @@ import { Eye, EyeOff } from "lucide-react";
22
22
  import { useRouter } from "next/navigation";
23
23
  import { useState } from "react";
24
24
  import { useForm } from "react-hook-form";
25
- import { authClient } from "../handler/client.client";
25
+ import { useAuthClient } from "../hooks/use-auth-client";
26
26
 
27
27
  export function CreateFirstUserPage() {
28
28
  const router = useRouter();
29
+ const authClient = useAuthClient();
29
30
  const [callbackURL] = useQueryState("callbackURL", parseAsString);
30
31
  const [showPassword, setShowPassword] = useState(false);
31
32
 
@@ -62,7 +63,7 @@ export function CreateFirstUserPage() {
62
63
  disabled,
63
64
  });
64
65
 
65
- if(Object.keys(form.formState.errors).length > 0) {
66
+ if (Object.keys(form.formState.errors).length > 0) {
66
67
  console.error(form.formState.errors);
67
68
  }
68
69
 
@@ -9,10 +9,11 @@ import React from "react";
9
9
  import { useForm } from "react-hook-form";
10
10
  import { toast } from "sonner";
11
11
  import * as z from "zod";
12
- import { authClient } from "../handler/client.client";
12
+ import { useAuthClient } from "../hooks/use-auth-client";
13
13
  import { forgotPasswordSchema } from "../lib/validators";
14
14
 
15
15
  export function ForgetPasswordPage() {
16
+ const authClient = useAuthClient();
16
17
  const [isPending, startTransition] = React.useTransition();
17
18
 
18
19
  const form = useForm<z.infer<typeof forgotPasswordSchema>>({
@@ -1,3 +1,5 @@
1
+ import "server-only";
2
+
1
3
  import { TDatabaseSchema, TulipContext } from "@/modules/config/entry";
2
4
  import { getQueryClient } from "@/modules/router/lib/query-client";
3
5
  import { HydrateClient } from "@/modules/router/lib/query-client.server";
@@ -14,7 +14,7 @@ import { useState } from "react";
14
14
  import { useForm } from "react-hook-form";
15
15
  import { toast } from "sonner";
16
16
  import * as z from "zod";
17
- import { authClient } from "../handler/client.client";
17
+ import { useAuthClient } from "../hooks/use-auth-client";
18
18
  import { loginSchema } from "../lib/validators";
19
19
 
20
20
  type LoginPageProps = {
@@ -25,6 +25,7 @@ type LoginPageProps = {
25
25
 
26
26
  export function LoginPage(props: LoginPageProps) {
27
27
  const router = useRouter();
28
+ const authClient = useAuthClient();
28
29
  const [callbackURL] = useQueryState("callbackURL", parseAsString);
29
30
  const [showPassword, setShowPassword] = useState(false);
30
31
 
@@ -18,7 +18,7 @@ import React, { use, useState } from "react";
18
18
  import { useForm } from "react-hook-form";
19
19
  import { toast } from "sonner";
20
20
  import * as z from "zod";
21
- import { authClient } from "../handler/client.client";
21
+ import { useAuthClient } from "../hooks/use-auth-client";
22
22
  import { resetPasswordSchema } from "../lib/validators";
23
23
 
24
24
  export function ResetPasswordPage(params: {
@@ -27,6 +27,8 @@ export function ResetPasswordPage(params: {
27
27
  const { email, otp } = use(params.searchParams);
28
28
 
29
29
  const router = useRouter();
30
+ const authClient = useAuthClient();
31
+
30
32
  const [showPassword, setShowPassword] = useState(false);
31
33
  const [showPasswordConfirm, setShowPasswordConfirm] = useState(false);
32
34
 
@@ -1,9 +1,21 @@
1
+ /**
2
+ * Components
3
+ */
1
4
  export * from "./components/allowed.client";
2
5
  export * from "./components/create-first-user-page.client";
3
6
  export * from "./components/forget-password-page.client";
4
7
  export * from "./components/login-page.client";
5
8
  export * from "./components/reset-password-page.client";
6
9
  export * from "./components/update-password-command";
7
- export * from "./handler/client.client";
10
+
11
+ /**
12
+ * Handlers
13
+ */
14
+ export * from "./handler/create-client.client";
15
+
16
+ /**
17
+ * Hooks
18
+ */
19
+ export * from "./hooks/use-auth-client";
8
20
  export * from "./hooks/use-permission";
9
21
  export * from "./hooks/use-session";
@@ -1,4 +1,15 @@
1
+ /**
2
+ * Components
3
+ */
1
4
  export * from "./components/auth-loading";
5
+
6
+ /**
7
+ * DB
8
+ */
2
9
  export * from "./db/schema";
10
+
11
+ /**
12
+ * Lib
13
+ */
3
14
  export * from "./lib/permissions";
4
15
  export * from "./lib/validators";
@@ -0,0 +1,53 @@
1
+ import "client-only";
2
+
3
+ import { url } from "@/lib/utils/url";
4
+ import { passkeyClient } from "@better-auth/passkey/client";
5
+ import { adminClient, emailOTPClient, inferAdditionalFields } from "better-auth/client/plugins";
6
+ import { AccessControl, Role } from "better-auth/plugins";
7
+ import { createAuthClient as createBetterAuthClient } from "better-auth/react";
8
+ import { AuthClient } from "./init";
9
+
10
+ /**
11
+ * Create auth client
12
+ */
13
+ export type CreateAuthClientProps<
14
+ TAccessControl extends AccessControl,
15
+ TRoles extends { [key in string]: Role },
16
+ > = {
17
+ /**
18
+ * Base URL for the auth client
19
+ */
20
+ baseURL?: string;
21
+ /**
22
+ * Access control instance
23
+ */
24
+ ac: TAccessControl;
25
+ roles: TRoles;
26
+ };
27
+
28
+ export function createAuthClient<
29
+ TAccessControl extends AccessControl,
30
+ TRoles extends { [key in string]: Role },
31
+ >(props: CreateAuthClientProps<TAccessControl, TRoles>) {
32
+ const { ac, roles } = props;
33
+
34
+ const baseURL = props.baseURL ?? url();
35
+
36
+ return createBetterAuthClient({
37
+ baseURL,
38
+ plugins: [
39
+ emailOTPClient(),
40
+ passkeyClient(),
41
+ adminClient({ ac, roles }),
42
+ inferAdditionalFields<AuthClient>(),
43
+ ],
44
+ });
45
+ }
46
+
47
+ /**
48
+ * Client auth type
49
+ */
50
+ export type ClientAuth<
51
+ TAccessControl extends AccessControl,
52
+ TRoles extends { [key in string]: Role },
53
+ > = ReturnType<typeof createAuthClient<TAccessControl, TRoles>>;
@@ -0,0 +1,38 @@
1
+ "use client";
2
+
3
+ import { AccessControl, Role } from "better-auth/plugins";
4
+ import { createContext, PropsWithChildren, use } from "react";
5
+ import { ClientAuth } from "../handler/create-client.client";
6
+
7
+ /**
8
+ * Auth client context
9
+ */
10
+
11
+ export const AuthClientContext = createContext(null as unknown as ClientAuth<never, never>);
12
+
13
+ /**
14
+ * Use auth client
15
+ */
16
+ export function useAuthClient<
17
+ TAccessControl extends AccessControl = never,
18
+ TRoles extends { [key in string]: Role } = never,
19
+ >() {
20
+ const context = use(AuthClientContext);
21
+ if (!context) throw new Error("Auth client is not provided");
22
+
23
+ return context as ClientAuth<TAccessControl, TRoles>;
24
+ }
25
+
26
+ /**
27
+ * Auth client provider
28
+ */
29
+ export function AuthProvider<
30
+ TAccessControl extends AccessControl,
31
+ TRoles extends { [key in string]: Role },
32
+ >(props: PropsWithChildren<{ authClient: ClientAuth<TAccessControl, TRoles> }>) {
33
+ return (
34
+ <AuthClientContext value={props.authClient as ClientAuth<never, never>}>
35
+ {props.children}
36
+ </AuthClientContext>
37
+ );
38
+ }
@@ -1,13 +1,9 @@
1
1
  "use client";
2
2
 
3
- import { useSuspenseQueries, useSuspenseQuery } from "@tanstack/react-query";
4
- import { authClient } from "../handler/client.client";
5
3
  import { type Permission } from "../lib/permissions";
4
+ import { useAuthClient } from "./use-auth-client";
6
5
  import { useSession } from "./use-session";
7
6
 
8
- /**
9
- * UsePermission
10
- */
11
7
  export type UsePermissionProps =
12
8
  | {
13
9
  /**
@@ -40,95 +36,54 @@ export type UsePermissionProps =
40
36
  permission?: Permission[];
41
37
  };
42
38
 
43
- export function usePermission({ permission, strategy = "all" }: UsePermissionProps) {
44
- const sessionQuery = useSession();
45
-
46
- return useSuspenseQuery({
47
- queryKey: ["permission", { permission, strategy }],
48
- queryFn: async () => {
49
- // If no permission is provided, allow by default
50
- if (!permission) return { permission, success: true };
51
-
52
- // If no user is logged in, deny by default
53
- if (!sessionQuery.data) return { permission, success: false };
54
- const userId = sessionQuery.data?.user.id;
55
- if (!userId) return { permission, success: false };
56
-
57
- // If the strategy is "any", check if the user has any of the permissions
58
- const permissions = Array.isArray(permission) ? permission : [permission];
59
-
60
- // Check if the user has the permission
61
- const results = await Promise.all(
62
- permissions.map((permission) => authClient.admin.hasPermission({ permission, userId })),
63
- );
64
-
65
- const data = results.map(({ data }) => data).filter((data) => !!data);
66
- const errors = results.filter(({ error }) => !!error).map(({ error }) => error);
67
-
68
- // If there is an error, log it and return false
69
- if (errors.length > 0) {
70
- console.error(...errors);
71
- return { permission, success: false };
72
- }
73
-
74
- // Determine if the user has the permission based on the strategy
75
- const success =
76
- strategy === "all"
77
- ? data.every(({ success }) => success)
78
- : data.some(({ success }) => success);
79
-
80
- // Return the result
81
- return {
82
- permission,
83
- success,
84
- };
85
- },
86
- staleTime: 5 * 60 * 1000, // 5 minutes
87
- });
88
- }
89
-
90
39
  /**
91
- * Check multiple permissions in parallel
92
- * @param permission
93
- * @param strategy
94
- * @returns
95
- * @deprecated Use `usePermission` with strategy "any" or "all" instead
40
+ * UsePermission
96
41
  */
97
- export function usePermissions(permission?: Permission) {
98
- const sessionQuery = useSession();
99
-
100
- const keys = Object.entries(permission ?? {}).flatMap(([resource, permissions]) =>
101
- permissions.map((permission) => ({ [resource]: [permission] }) as Permission),
102
- );
103
-
104
- return useSuspenseQueries({
105
- queries: keys.map((permission) => ({
106
- queryKey: ["permission", permission],
107
- queryFn: async () => {
108
- const userId = sessionQuery.data?.user.id;
109
- if (!userId) return { permission, success: false };
110
-
111
- const { data, error } = await authClient.admin.hasPermission({ permission, userId });
112
- if (error) {
113
- console.error(error);
114
- throw error;
115
- }
116
-
117
- return {
118
- permission,
119
- success: data.success,
120
- };
121
- },
122
- staleTime: 5 * 60 * 1000, // 5 minutes
123
- })),
124
- combine: (results) => {
125
- const errors = results.filter(({ error }) => error);
126
- if (errors.length) return { data: null, errors };
127
-
128
- const values = results.map(({ data }) => data);
129
- const success = results.every(({ data }) => data?.success);
130
-
131
- return { data: { success, values }, errors: null };
132
- },
133
- });
42
+ export function usePermission({ strategy = "all", permission }: UsePermissionProps) {
43
+ const authClient = useAuthClient();
44
+ const sessionQuery = useSession(authClient);
45
+
46
+ /**
47
+ * If no role is found in the session, deny by default
48
+ */
49
+ const role = sessionQuery.data?.user.role;
50
+ if (!role) return { permission, success: false };
51
+
52
+ /**
53
+ * If no permission is provided, allow by default
54
+ */
55
+ if (!permission) return { permission, success: true };
56
+
57
+ /**
58
+ * If the strategy is "any", check if the user has any of the permissions
59
+ */
60
+ if (strategy === "any" && Array.isArray(permission)) {
61
+ const permissions = Array.isArray(permission) ? permission : [permission];
62
+
63
+ const success = permissions.some((permission) =>
64
+ authClient.admin.checkRolePermission({
65
+ role,
66
+ permissions: permission,
67
+ }),
68
+ );
69
+
70
+ return { permission, success };
71
+ }
72
+
73
+ /**
74
+ * If the strategy is "all", check if the user has all of the permissions
75
+ */
76
+ if (strategy === "all" && !Array.isArray(permission)) {
77
+ const success = authClient.admin.checkRolePermission({
78
+ role,
79
+ permissions: permission,
80
+ });
81
+
82
+ return { permission, success };
83
+ }
84
+
85
+ /**
86
+ * If the strategy is not recognized, deny by default
87
+ */
88
+ return { permission, success: false };
134
89
  }