@alepha/ui 0.28.0 → 0.29.0

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 (378) hide show
  1. package/README.md +31 -2
  2. package/dist/components/account/account-connections.d.ts.map +1 -1
  3. package/dist/components/account/account-connections.js +4 -1
  4. package/dist/components/account/account-connections.js.map +1 -1
  5. package/dist/components/account/account-delete-dialog.d.ts.map +1 -1
  6. package/dist/components/account/account-delete-dialog.js +12 -15
  7. package/dist/components/account/account-delete-dialog.js.map +1 -1
  8. package/dist/components/account/account-keys.d.ts.map +1 -1
  9. package/dist/components/account/account-keys.js +22 -28
  10. package/dist/components/account/account-keys.js.map +1 -1
  11. package/dist/components/account/account-mfa-dialog.js +1 -4
  12. package/dist/components/account/account-mfa-dialog.js.map +1 -1
  13. package/dist/components/account/account-password-dialog.d.ts.map +1 -1
  14. package/dist/components/account/account-password-dialog.js +11 -14
  15. package/dist/components/account/account-password-dialog.js.map +1 -1
  16. package/dist/components/account/account-profile.js +3 -2
  17. package/dist/components/account/account-profile.js.map +1 -1
  18. package/dist/components/account/account-router-options.d.ts +38 -0
  19. package/dist/components/account/account-router-options.d.ts.map +1 -1
  20. package/dist/components/account/account-router-options.js.map +1 -1
  21. package/dist/components/account/account-router-page.d.ts +11 -1
  22. package/dist/components/account/account-router-page.d.ts.map +1 -1
  23. package/dist/components/account/account-router-page.js +11 -1
  24. package/dist/components/account/account-router-page.js.map +1 -1
  25. package/dist/components/account/account-router.d.ts +11 -0
  26. package/dist/components/account/account-router.d.ts.map +1 -1
  27. package/dist/components/account/account-router.js +16 -5
  28. package/dist/components/account/account-router.js.map +1 -1
  29. package/dist/components/admin/admin-audits.d.ts.map +1 -1
  30. package/dist/components/admin/admin-audits.js +91 -34
  31. package/dist/components/admin/admin-audits.js.map +1 -1
  32. package/dist/components/admin/admin-files.d.ts.map +1 -1
  33. package/dist/components/admin/admin-files.js +6 -17
  34. package/dist/components/admin/admin-files.js.map +1 -1
  35. package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
  36. package/dist/components/admin/admin-jobs-executions-panel.js +39 -8
  37. package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
  38. package/dist/components/admin/admin-jobs-payload-dialog.d.ts +19 -0
  39. package/dist/components/admin/admin-jobs-payload-dialog.d.ts.map +1 -0
  40. package/dist/components/admin/admin-jobs-payload-dialog.js +33 -0
  41. package/dist/components/admin/admin-jobs-payload-dialog.js.map +1 -0
  42. package/dist/components/admin/admin-keys.d.ts.map +1 -1
  43. package/dist/components/admin/admin-keys.js +5 -4
  44. package/dist/components/admin/admin-keys.js.map +1 -1
  45. package/dist/components/admin/admin-notifications-channel-label.d.ts +14 -0
  46. package/dist/components/admin/admin-notifications-channel-label.d.ts.map +1 -0
  47. package/dist/components/admin/admin-notifications-channel-label.js +26 -0
  48. package/dist/components/admin/admin-notifications-channel-label.js.map +1 -0
  49. package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -1
  50. package/dist/components/admin/admin-notifications-preview-body.js +23 -13
  51. package/dist/components/admin/admin-notifications-preview-body.js.map +1 -1
  52. package/dist/components/admin/admin-notifications.d.ts.map +1 -1
  53. package/dist/components/admin/admin-notifications.js +11 -12
  54. package/dist/components/admin/admin-notifications.js.map +1 -1
  55. package/dist/components/admin/admin-payments.d.ts.map +1 -1
  56. package/dist/components/admin/admin-payments.js +9 -7
  57. package/dist/components/admin/admin-payments.js.map +1 -1
  58. package/dist/components/admin/admin-router-options.d.ts +12 -0
  59. package/dist/components/admin/admin-router-options.d.ts.map +1 -1
  60. package/dist/components/admin/admin-router-options.js.map +1 -1
  61. package/dist/components/admin/admin-router.d.ts +5 -8
  62. package/dist/components/admin/admin-router.d.ts.map +1 -1
  63. package/dist/components/admin/admin-router.js +6 -29
  64. package/dist/components/admin/admin-router.js.map +1 -1
  65. package/dist/components/admin/admin-sessions.d.ts.map +1 -1
  66. package/dist/components/admin/admin-sessions.js +9 -7
  67. package/dist/components/admin/admin-sessions.js.map +1 -1
  68. package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
  69. package/dist/components/admin/admin-user-detail-audits-tab.js +5 -4
  70. package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
  71. package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
  72. package/dist/components/admin/admin-user-detail-sessions-tab.js +7 -5
  73. package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
  74. package/dist/components/admin/admin-user-detail.js +3 -2
  75. package/dist/components/admin/admin-user-detail.js.map +1 -1
  76. package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
  77. package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
  78. package/dist/components/admin/admin-users.d.ts.map +1 -1
  79. package/dist/components/admin/admin-users.js +6 -4
  80. package/dist/components/admin/admin-users.js.map +1 -1
  81. package/dist/components/admin/analytics/AnalyticsChartBars.js +2 -1
  82. package/dist/components/admin/analytics/AnalyticsChartBars.js.map +1 -1
  83. package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
  84. package/dist/components/admin/parameter-history-item.js +3 -2
  85. package/dist/components/admin/parameter-history-item.js.map +1 -1
  86. package/dist/components/alepha-table/alepha-table-bulk-menu.js +2 -1
  87. package/dist/components/alepha-table/alepha-table-bulk-menu.js.map +1 -1
  88. package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts +60 -0
  89. package/dist/components/alepha-table/alepha-table-filter-dialog.d.ts.map +1 -0
  90. package/dist/components/alepha-table/alepha-table-filter-dialog.js +88 -0
  91. package/dist/components/alepha-table/alepha-table-filter-dialog.js.map +1 -0
  92. package/dist/components/alepha-table/alepha-table-filter-menu.d.ts +35 -0
  93. package/dist/components/alepha-table/alepha-table-filter-menu.d.ts.map +1 -0
  94. package/dist/components/alepha-table/alepha-table-filter-menu.js +54 -0
  95. package/dist/components/alepha-table/alepha-table-filter-menu.js.map +1 -0
  96. package/dist/components/alepha-table/alepha-table.d.ts +188 -3
  97. package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
  98. package/dist/components/alepha-table/alepha-table.js +551 -162
  99. package/dist/components/alepha-table/alepha-table.js.map +1 -1
  100. package/dist/components/alepha-table/query-filters.d.ts +73 -0
  101. package/dist/components/alepha-table/query-filters.d.ts.map +1 -0
  102. package/dist/components/alepha-table/query-filters.js +118 -0
  103. package/dist/components/alepha-table/query-filters.js.map +1 -0
  104. package/dist/components/app-actions/app-actions.d.ts +21 -0
  105. package/dist/components/app-actions/app-actions.d.ts.map +1 -1
  106. package/dist/components/app-actions/app-actions.js +11 -5
  107. package/dist/components/app-actions/app-actions.js.map +1 -1
  108. package/dist/components/app-shell/app-shell.d.ts +45 -0
  109. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  110. package/dist/components/app-shell/app-shell.js +119 -16
  111. package/dist/components/app-shell/app-shell.js.map +1 -1
  112. package/dist/components/auth/auth-register.js +31 -30
  113. package/dist/components/auth/auth-register.js.map +1 -1
  114. package/dist/components/auto-form/auto-form.d.ts.map +1 -1
  115. package/dist/components/auto-form/auto-form.js +68 -30
  116. package/dist/components/auto-form/auto-form.js.map +1 -1
  117. package/dist/components/button-dark/button-dark.d.ts.map +1 -1
  118. package/dist/components/button-dark/button-dark.js +39 -8
  119. package/dist/components/button-dark/button-dark.js.map +1 -1
  120. package/dist/components/button-inbox/button-inbox.d.ts +66 -0
  121. package/dist/components/button-inbox/button-inbox.d.ts.map +1 -0
  122. package/dist/components/button-inbox/button-inbox.js +167 -0
  123. package/dist/components/button-inbox/button-inbox.js.map +1 -0
  124. package/dist/components/button-inbox/inbox-unread-atom.d.ts +22 -0
  125. package/dist/components/button-inbox/inbox-unread-atom.d.ts.map +1 -0
  126. package/dist/components/button-inbox/inbox-unread-atom.js +29 -0
  127. package/dist/components/button-inbox/inbox-unread-atom.js.map +1 -0
  128. package/dist/components/button-theme/button-theme.d.ts +4 -3
  129. package/dist/components/button-theme/button-theme.d.ts.map +1 -1
  130. package/dist/components/button-theme/button-theme.js +8 -25
  131. package/dist/components/button-theme/button-theme.js.map +1 -1
  132. package/dist/components/button-user/button-user.d.ts +19 -0
  133. package/dist/components/button-user/button-user.d.ts.map +1 -1
  134. package/dist/components/button-user/button-user.js +1 -1
  135. package/dist/components/button-user/button-user.js.map +1 -1
  136. package/dist/components/control/control.d.ts +51 -0
  137. package/dist/components/control/control.d.ts.map +1 -1
  138. package/dist/components/control/control.js +49 -5
  139. package/dist/components/control/control.js.map +1 -1
  140. package/dist/components/control-array/control-array.js +2 -1
  141. package/dist/components/control-array/control-array.js.map +1 -1
  142. package/dist/components/control-date/control-date.d.ts +27 -0
  143. package/dist/components/control-date/control-date.d.ts.map +1 -1
  144. package/dist/components/control-date/control-date.js +15 -19
  145. package/dist/components/control-date/control-date.js.map +1 -1
  146. package/dist/components/control-date/date-only.d.ts +18 -0
  147. package/dist/components/control-date/date-only.d.ts.map +1 -0
  148. package/dist/components/control-date/date-only.js +29 -0
  149. package/dist/components/control-date/date-only.js.map +1 -0
  150. package/dist/components/control-date-range/control-date-range.d.ts +56 -0
  151. package/dist/components/control-date-range/control-date-range.d.ts.map +1 -0
  152. package/dist/components/control-date-range/control-date-range.js +148 -0
  153. package/dist/components/control-date-range/control-date-range.js.map +1 -0
  154. package/dist/components/control-object/control-object.js +2 -1
  155. package/dist/components/control-object/control-object.js.map +1 -1
  156. package/dist/components/control-select/control-select.d.ts.map +1 -1
  157. package/dist/components/control-select/control-select.js +177 -37
  158. package/dist/components/control-select/control-select.js.map +1 -1
  159. package/dist/components/control-upload/control-upload.d.ts.map +1 -1
  160. package/dist/components/control-upload/control-upload.js +1 -11
  161. package/dist/components/control-upload/control-upload.js.map +1 -1
  162. package/dist/components/detail/detail-aside.d.ts.map +1 -1
  163. package/dist/components/detail/detail-aside.js +4 -3
  164. package/dist/components/detail/detail-aside.js.map +1 -1
  165. package/dist/components/file-image/file-image.js +2 -1
  166. package/dist/components/file-image/file-image.js.map +1 -1
  167. package/dist/components/markdown-view/SpoilerSpan.d.ts +28 -0
  168. package/dist/components/markdown-view/SpoilerSpan.d.ts.map +1 -0
  169. package/dist/components/markdown-view/SpoilerSpan.js +53 -0
  170. package/dist/components/markdown-view/SpoilerSpan.js.map +1 -0
  171. package/dist/components/markdown-view/diagram/layoutSequence.js +13 -23
  172. package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -1
  173. package/dist/components/markdown-view/diagram/textMetrics.js +2 -2
  174. package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -1
  175. package/dist/components/markdown-view/markdown-view.css +44 -0
  176. package/dist/components/markdown-view/markdown-view.d.ts +12 -0
  177. package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
  178. package/dist/components/markdown-view/markdown-view.js +22 -1
  179. package/dist/components/markdown-view/markdown-view.js.map +1 -1
  180. package/dist/components/markdown-view/remarkSpoiler.d.ts +17 -0
  181. package/dist/components/markdown-view/remarkSpoiler.d.ts.map +1 -0
  182. package/dist/components/markdown-view/remarkSpoiler.js +117 -0
  183. package/dist/components/markdown-view/remarkSpoiler.js.map +1 -0
  184. package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts +34 -0
  185. package/dist/components/permission-matrix/permission-matrix-group-rows.d.ts.map +1 -0
  186. package/dist/components/permission-matrix/permission-matrix-group-rows.js +109 -0
  187. package/dist/components/permission-matrix/permission-matrix-group-rows.js.map +1 -0
  188. package/dist/components/permission-matrix/permission-matrix.d.ts +145 -0
  189. package/dist/components/permission-matrix/permission-matrix.d.ts.map +1 -0
  190. package/dist/components/permission-matrix/permission-matrix.js +113 -0
  191. package/dist/components/permission-matrix/permission-matrix.js.map +1 -0
  192. package/dist/components/plate-layout/plate-layout.d.ts +5 -0
  193. package/dist/components/plate-layout/plate-layout.d.ts.map +1 -1
  194. package/dist/components/plate-layout/plate-layout.js +2 -1
  195. package/dist/components/plate-layout/plate-layout.js.map +1 -1
  196. package/dist/components/plate-layout/plate-tab-bar.d.ts +10 -0
  197. package/dist/components/plate-layout/plate-tab-bar.d.ts.map +1 -1
  198. package/dist/components/plate-layout/plate-tab-bar.js +1 -1
  199. package/dist/components/plate-layout/plate-tab-bar.js.map +1 -1
  200. package/dist/components/settings/settings-nav.js +2 -1
  201. package/dist/components/settings/settings-nav.js.map +1 -1
  202. package/dist/components/time-ago/time-ago.d.ts +57 -0
  203. package/dist/components/time-ago/time-ago.d.ts.map +1 -0
  204. package/dist/components/time-ago/time-ago.js +60 -0
  205. package/dist/components/time-ago/time-ago.js.map +1 -0
  206. package/dist/components/tree-view/tree-model.d.ts +128 -0
  207. package/dist/components/tree-view/tree-model.d.ts.map +1 -0
  208. package/dist/components/tree-view/tree-model.js +226 -0
  209. package/dist/components/tree-view/tree-model.js.map +1 -0
  210. package/dist/components/tree-view/tree-view-rename-input.d.ts +31 -0
  211. package/dist/components/tree-view/tree-view-rename-input.d.ts.map +1 -0
  212. package/dist/components/tree-view/tree-view-rename-input.js +68 -0
  213. package/dist/components/tree-view/tree-view-rename-input.js.map +1 -0
  214. package/dist/components/tree-view/tree-view-resizer.d.ts +38 -0
  215. package/dist/components/tree-view/tree-view-resizer.d.ts.map +1 -0
  216. package/dist/components/tree-view/tree-view-resizer.js +73 -0
  217. package/dist/components/tree-view/tree-view-resizer.js.map +1 -0
  218. package/dist/components/tree-view/tree-view-row.d.ts +177 -0
  219. package/dist/components/tree-view/tree-view-row.d.ts.map +1 -0
  220. package/dist/components/tree-view/tree-view-row.js +241 -0
  221. package/dist/components/tree-view/tree-view-row.js.map +1 -0
  222. package/dist/components/tree-view/tree-view.d.ts +186 -0
  223. package/dist/components/tree-view/tree-view.d.ts.map +1 -0
  224. package/dist/components/tree-view/tree-view.js +112 -0
  225. package/dist/components/tree-view/tree-view.js.map +1 -0
  226. package/dist/components/tree-view/use-tree-state.d.ts +79 -0
  227. package/dist/components/tree-view/use-tree-state.d.ts.map +1 -0
  228. package/dist/components/tree-view/use-tree-state.js +93 -0
  229. package/dist/components/tree-view/use-tree-state.js.map +1 -0
  230. package/dist/components/ui/button.d.ts.map +1 -1
  231. package/dist/components/ui/button.js +1 -1
  232. package/dist/components/ui/button.js.map +1 -1
  233. package/dist/components/ui/dropdown-menu.js.map +1 -1
  234. package/dist/components/ui/select.d.ts +7 -0
  235. package/dist/components/ui/select.d.ts.map +1 -1
  236. package/dist/components/ui/select.js +7 -0
  237. package/dist/components/ui/select.js.map +1 -1
  238. package/dist/components/ui/sidebar.js +1 -1
  239. package/dist/components/ui/sidebar.js.map +1 -1
  240. package/dist/components/ui/table.js.map +1 -1
  241. package/dist/components/ui/tooltip.js.map +1 -1
  242. package/dist/lib/i18n-fr.d.ts.map +1 -1
  243. package/dist/lib/i18n-fr.js +31 -47
  244. package/dist/lib/i18n-fr.js.map +1 -1
  245. package/dist/lib/utils.d.ts +22 -2
  246. package/dist/lib/utils.d.ts.map +1 -1
  247. package/dist/lib/utils.js +29 -5
  248. package/dist/lib/utils.js.map +1 -1
  249. package/dist/styles.css +255 -0
  250. package/package.json +13 -14
  251. package/src/components/account/__tests__/account-router.spec.ts +95 -0
  252. package/src/components/account/account-connections.tsx +14 -1
  253. package/src/components/account/account-delete-dialog.tsx +3 -2
  254. package/src/components/account/account-keys.tsx +11 -4
  255. package/src/components/account/account-mfa-dialog.tsx +1 -1
  256. package/src/components/account/account-password-dialog.tsx +3 -2
  257. package/src/components/account/account-profile.tsx +1 -1
  258. package/src/components/account/account-router-options.tsx +45 -0
  259. package/src/components/account/account-router-page.tsx +11 -1
  260. package/src/components/account/account-router.tsx +23 -6
  261. package/src/components/admin/__tests__/admin-jobs-payload-dialog.browser.spec.tsx +68 -0
  262. package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +20 -4
  263. package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +0 -31
  264. package/src/components/admin/admin-audits.tsx +99 -5
  265. package/src/components/admin/admin-files.tsx +7 -16
  266. package/src/components/admin/admin-jobs-executions-panel.tsx +152 -114
  267. package/src/components/admin/admin-jobs-payload-dialog.tsx +57 -0
  268. package/src/components/admin/admin-keys.tsx +7 -4
  269. package/src/components/admin/admin-notifications-channel-label.ts +18 -0
  270. package/src/components/admin/admin-notifications-preview-body.tsx +7 -2
  271. package/src/components/admin/admin-notifications.tsx +19 -8
  272. package/src/components/admin/admin-payments.tsx +7 -4
  273. package/src/components/admin/admin-router-options.tsx +12 -0
  274. package/src/components/admin/admin-router.tsx +5 -27
  275. package/src/components/admin/admin-sessions.tsx +10 -6
  276. package/src/components/admin/admin-user-detail-audits-tab.tsx +7 -4
  277. package/src/components/admin/admin-user-detail-sessions-tab.tsx +7 -4
  278. package/src/components/admin/admin-users-roles-picker.tsx +4 -0
  279. package/src/components/admin/admin-users.tsx +6 -3
  280. package/src/components/admin/parameter-history-item.tsx +4 -2
  281. package/src/components/alepha-table/__tests__/alepha-table-default-hidden.browser.spec.tsx +108 -0
  282. package/src/components/alepha-table/__tests__/alepha-table-empty-state.browser.spec.tsx +233 -0
  283. package/src/components/alepha-table/__tests__/alepha-table-persist-facets.browser.spec.tsx +177 -0
  284. package/src/components/alepha-table/__tests__/alepha-table-persisted-filters.browser.spec.tsx +182 -0
  285. package/src/components/alepha-table/__tests__/alepha-table-query-seed.browser.spec.tsx +170 -0
  286. package/src/components/alepha-table/__tests__/alepha-table-row-action-checked.browser.spec.tsx +210 -0
  287. package/src/components/alepha-table/__tests__/alepha-table-row-action-group.browser.spec.tsx +202 -0
  288. package/src/components/alepha-table/__tests__/alepha-table-scope.browser.spec.tsx +161 -0
  289. package/src/components/alepha-table/__tests__/alepha-table-share-filters.browser.spec.tsx +309 -0
  290. package/src/components/alepha-table/__tests__/query-filters.spec.ts +212 -0
  291. package/src/components/alepha-table/alepha-table-filter-dialog.tsx +162 -0
  292. package/src/components/alepha-table/alepha-table-filter-menu.tsx +77 -0
  293. package/src/components/alepha-table/alepha-table.tsx +1113 -207
  294. package/src/components/alepha-table/query-filters.ts +159 -0
  295. package/src/components/app-actions/app-actions.tsx +32 -3
  296. package/src/components/app-shell/__tests__/sidebar-nav-accordion.browser.spec.tsx +163 -0
  297. package/src/components/app-shell/app-shell.tsx +255 -12
  298. package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -1
  299. package/src/components/auto-form/auto-form.tsx +98 -30
  300. package/src/components/button-dark/button-dark.tsx +47 -8
  301. package/src/components/button-inbox/__tests__/button-inbox.browser.spec.tsx +247 -0
  302. package/src/components/button-inbox/button-inbox.tsx +303 -0
  303. package/src/components/button-inbox/inbox-unread-atom.ts +27 -0
  304. package/src/components/button-theme/button-theme.tsx +16 -29
  305. package/src/components/button-user/__tests__/button-user-avatar.browser.spec.tsx +88 -0
  306. package/src/components/button-user/button-user.tsx +24 -1
  307. package/src/components/control/__tests__/control-date-range.browser.spec.tsx +177 -0
  308. package/src/components/control/control.tsx +119 -12
  309. package/src/components/control-date/control-date.tsx +117 -22
  310. package/src/components/control-date/date-only.ts +26 -0
  311. package/src/components/control-date-range/control-date-range.tsx +250 -0
  312. package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +129 -15
  313. package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +27 -6
  314. package/src/components/control-select/__tests__/control-select-multi.browser.spec.tsx +204 -1
  315. package/src/components/control-select/__tests__/control-select-size-minimal.browser.spec.tsx +77 -1
  316. package/src/components/control-select/control-select.tsx +317 -83
  317. package/src/components/control-upload/control-upload.tsx +1 -10
  318. package/src/components/detail/detail-aside.tsx +30 -6
  319. package/src/components/markdown-view/SpoilerSpan.tsx +66 -0
  320. package/src/components/markdown-view/__tests__/markdown-view-spoiler.browser.spec.tsx +165 -0
  321. package/src/components/markdown-view/diagram/textMetrics.spec.ts +1 -1
  322. package/src/components/markdown-view/diagram/textMetrics.ts +2 -2
  323. package/src/components/markdown-view/markdown-view.css +44 -0
  324. package/src/components/markdown-view/markdown-view.tsx +37 -1
  325. package/src/components/markdown-view/remarkSpoiler.ts +150 -0
  326. package/src/components/permission-matrix/__tests__/permission-matrix.browser.spec.tsx +237 -0
  327. package/src/components/permission-matrix/permission-matrix-group-rows.tsx +240 -0
  328. package/src/components/permission-matrix/permission-matrix.tsx +286 -0
  329. package/src/components/plate-layout/__tests__/plate-layout.browser.spec.tsx +22 -0
  330. package/src/components/plate-layout/plate-layout.tsx +6 -0
  331. package/src/components/plate-layout/plate-tab-bar.tsx +27 -1
  332. package/src/components/time-ago/time-ago.browser.spec.tsx +110 -0
  333. package/src/components/time-ago/time-ago.tsx +80 -0
  334. package/src/components/tree-view/__tests__/tree-model.spec.ts +441 -0
  335. package/src/components/tree-view/__tests__/tree-view-drag.browser.spec.tsx +295 -0
  336. package/src/components/tree-view/__tests__/tree-view-rename.browser.spec.tsx +278 -0
  337. package/src/components/tree-view/__tests__/tree-view-resizer.browser.spec.tsx +112 -0
  338. package/src/components/tree-view/__tests__/tree-view.browser.spec.tsx +260 -0
  339. package/src/components/tree-view/__tests__/use-tree-state.browser.spec.tsx +238 -0
  340. package/src/components/tree-view/tree-model.ts +369 -0
  341. package/src/components/tree-view/tree-view-rename-input.tsx +95 -0
  342. package/src/components/tree-view/tree-view-resizer.tsx +83 -0
  343. package/src/components/tree-view/tree-view-row.tsx +414 -0
  344. package/src/components/tree-view/tree-view.tsx +300 -0
  345. package/src/components/tree-view/use-tree-state.ts +184 -0
  346. package/src/components/ui/button.tsx +79 -1
  347. package/src/components/ui/dropdown-menu.tsx +1 -1
  348. package/src/components/ui/select.tsx +7 -0
  349. package/src/components/ui/table.tsx +1 -1
  350. package/src/components/ui/tooltip.tsx +1 -1
  351. package/src/lib/i18n-fr.ts +34 -51
  352. package/src/lib/utils.ts +32 -4
  353. package/src/styles.css +255 -0
  354. package/dist/components/admin/admin-workflows-execution-sheet.d.ts +0 -11
  355. package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +0 -1
  356. package/dist/components/admin/admin-workflows-execution-sheet.js +0 -190
  357. package/dist/components/admin/admin-workflows-execution-sheet.js.map +0 -1
  358. package/dist/components/admin/admin-workflows-executions-panel.d.ts +0 -9
  359. package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +0 -1
  360. package/dist/components/admin/admin-workflows-executions-panel.js +0 -121
  361. package/dist/components/admin/admin-workflows-executions-panel.js.map +0 -1
  362. package/dist/components/admin/admin-workflows-status-badge.d.ts +0 -12
  363. package/dist/components/admin/admin-workflows-status-badge.d.ts.map +0 -1
  364. package/dist/components/admin/admin-workflows-status-badge.js +0 -30
  365. package/dist/components/admin/admin-workflows-status-badge.js.map +0 -1
  366. package/dist/components/admin/admin-workflows-status-labels.d.ts +0 -19
  367. package/dist/components/admin/admin-workflows-status-labels.d.ts.map +0 -1
  368. package/dist/components/admin/admin-workflows-status-labels.js +0 -48
  369. package/dist/components/admin/admin-workflows-status-labels.js.map +0 -1
  370. package/dist/components/admin/admin-workflows.d.ts +0 -4
  371. package/dist/components/admin/admin-workflows.d.ts.map +0 -1
  372. package/dist/components/admin/admin-workflows.js +0 -145
  373. package/dist/components/admin/admin-workflows.js.map +0 -1
  374. package/src/components/admin/admin-workflows-execution-sheet.tsx +0 -285
  375. package/src/components/admin/admin-workflows-executions-panel.tsx +0 -169
  376. package/src/components/admin/admin-workflows-status-badge.tsx +0 -41
  377. package/src/components/admin/admin-workflows-status-labels.ts +0 -51
  378. package/src/components/admin/admin-workflows.tsx +0 -209
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.js","names":["Icon","Link"],"sources":["../../../src/components/app-shell/app-shell.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport * as React from \"react\";\n\nvoid React;\n\nimport {\n ActionErrorToaster,\n type ActionErrorToasterProps,\n} from \"@alepha/ui/components/action-error-toaster/action-error-toaster\";\nimport {\n NavigationProgress,\n type NavigationProgressOptions,\n} from \"@alepha/ui/components/app-shell/navigation-progress\";\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@alepha/ui/components/ui/breadcrumb\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@alepha/ui/components/ui/dropdown-menu\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@alepha/ui/components/ui/hover-card\";\nimport { Separator } from \"@alepha/ui/components/ui/separator\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n useSidebar,\n} from \"@alepha/ui/components/ui/sidebar\";\nimport { Toaster } from \"@alepha/ui/components/ui/sonner\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@alepha/ui/components/ui/tooltip\";\nimport { DialogProvider } from \"@alepha/ui/components/use-dialog/use-dialog\";\nimport { Link, NestedView } from \"alepha/react/router\";\nimport { useSidebarState } from \"alepha/react/ui\";\nimport {\n ChevronRight,\n Lock,\n PanelLeftClose,\n PanelLeftOpen,\n} from \"lucide-react\";\nimport type { ComponentType, ReactNode, SVGProps } from \"react\";\nimport { Fragment, useState } from \"react\";\n\n/**\n * Re-exported: the bar moved to its own module so it can be mounted at an\n * application root, but the option type is part of {@link AppShellProps}\n * and was importable from here first.\n */\nexport type { NavigationProgressOptions };\n\nconst StatefulSidebarTrigger = () => {\n const { toggleSidebar, isMobile, openMobile, state } = useSidebar();\n const open = isMobile ? openMobile : state === \"expanded\";\n const Icon = open ? PanelLeftClose : PanelLeftOpen;\n return (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={toggleSidebar}\n aria-label={open ? \"Collapse sidebar\" : \"Expand sidebar\"}\n className=\"size-8\"\n >\n <Icon className=\"size-4\" />\n </Button>\n );\n};\n\n/**\n * Closes the mobile nav sheet when a link inside it is followed.\n *\n * On a phone the sidebar is a `Sheet` driven by `openMobile`. Tapping a nav\n * entry navigated and left the sheet up, so the destination page rendered\n * behind an overlay the reader had to dismiss by hand (feedback #2077, at\n * 491x929).\n *\n * ⚠️ One handler on the container, not a callback on each nav item. The links\n * inside that sheet are `SidebarNavItem`'s leaf, `NavDropdownItems`, the group\n * children, the brand slot's project switcher and every app's own sidebar\n * footer - a per-item `onClick` covers whichever of those someone remembers\n * today and silently misses the next one added. A capture listener on the\n * container covers them all, including the ones no `@alepha/ui` file knows\n * about, because it asks what the DOM event actually landed on.\n *\n * It reacts to ANCHORS only. The switcher, the disclosure toggles and the\n * dropdown triggers in there are buttons that open something inside the sheet,\n * and closing it under them would break the control rather than fix it.\n */\nexport const SidebarNavAutoClose = (props: { children: ReactNode }) => {\n const { isMobile, setOpenMobile } = useSidebar();\n\n // The desktop sidebar is not a sheet and `openMobile` does not drive it, so\n // this branch is not just an optimisation: running the handler there would\n // be a state write on every nav click for no reason. Collapsing the desktop\n // rail on navigation would be a new bug, not this fix.\n if (!isMobile) return props.children;\n\n return (\n // Capture, so the sheet closes even when the link's own handler stops\n // propagation on the way back up.\n <div\n data-slot=\"sidebar-nav-auto-close\"\n className=\"flex h-full w-full flex-col\"\n onClickCapture={(event) => {\n const anchor = (event.target as HTMLElement | null)?.closest?.(\"a\");\n if (!(anchor instanceof HTMLAnchorElement)) return;\n\n // Nothing here navigates the page the sheet is covering, so the sheet\n // has no reason to move: a placeholder `#` (the locked nav rows use\n // `item.href ?? \"#\"`), a download, a new tab, or a modified click that\n // the browser opens elsewhere.\n const href = anchor.getAttribute(\"href\");\n if (!href || href === \"#\" || href.startsWith(\"#\")) return;\n if (anchor.hasAttribute(\"download\")) return;\n if (anchor.target && anchor.target !== \"_self\") return;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n setOpenMobile(false);\n }}\n >\n {props.children}\n </div>\n );\n};\n\ntype IconType = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport interface NavItem {\n label: ReactNode;\n /**\n * Required for leaf items. Ignored when `children` is provided (the parent becomes a toggle group).\n */\n href?: string;\n /**\n * Either an icon *component* (e.g. a lucide `Users`) which is instantiated\n * with the row's sizing className, or an already-rendered ReactNode element\n * (e.g. `<Users />`). The latter lets nav metadata declared on a `$page`\n * (which is pure React) carry its icon as a node — see `useNavTree`.\n */\n icon?: IconType | ReactNode;\n /**\n * When provided, renders as the active marker. Compare against current path.\n */\n active?: boolean;\n /**\n * Nested items. When set, the parent becomes a collapsible group.\n */\n children?: NavItem[];\n /**\n * Initial open state for groups. Defaults to true if any descendant is active.\n */\n defaultOpen?: boolean;\n /**\n * Optional trailing badge (e.g. unread count). Hidden when the sidebar is collapsed to icons.\n */\n badge?: ReactNode;\n /**\n * When true the item is rendered muted, navigation is blocked, and the\n * `tooltip` (if any) explains why. Use for paywalled / unavailable entries.\n */\n disabled?: boolean;\n /**\n * Hover tooltip shown on the row regardless of sidebar state. When the\n * item is `disabled`, this is the explanation surface (HoverCard, with\n * room to breathe). When the item is enabled, it surfaces as a regular\n * Tooltip on the trigger.\n */\n tooltip?: ReactNode;\n}\n\nfunction hasActiveDescendant(item: NavItem): boolean {\n if (item.active) return true;\n return (item.children ?? []).some(hasActiveDescendant);\n}\n\n/**\n * Render a NavItem icon. An already-created element (e.g. `<Users />`, which\n * `React.isValidElement` recognises) is returned as-is; anything else is\n * treated as a component *type* — including lucide's `forwardRef` icons, which\n * are objects rather than plain functions — and instantiated with the row's\n * sizing className.\n */\nfunction renderNavIcon(icon: NavItem[\"icon\"], className: string): ReactNode {\n if (icon == null || icon === false) return null;\n if (React.isValidElement(icon)) {\n // Already an element (e.g. `<Users />`): clone it to apply the row's sizing\n // className so element icons render at the same size as component icons,\n // merging with any className the caller already set.\n const existing = (icon.props as { className?: string })?.className;\n return React.cloneElement(\n icon as React.ReactElement<{ className?: string }>,\n {\n className: existing ? `${existing} ${className}` : className,\n },\n );\n }\n const Icon = icon as IconType;\n return <Icon className={className} />;\n}\n\nconst SidebarNavItem = (props: { item: NavItem }) => {\n const { item } = props;\n const { state, isMobile } = useSidebar();\n const children = item.children;\n const isGroup = !!children && children.length > 0;\n const hasActive = isGroup && hasActiveDescendant(item);\n const [open, setOpen] = useState(item.defaultOpen ?? hasActive);\n // Reveal a collapsed group when navigation makes one of its descendants\n // active — SPA nav, spotlight (⌘K), breadcrumb, or a deep-link that doesn't\n // remount this item (useState's initializer runs only at mount, so without\n // this the group stays stuck closed and the active page is hidden — petition\n // #4). Only OPENS; never auto-collapses, so a manual toggle is preserved.\n const [wasActive, setWasActive] = useState(hasActive);\n if (hasActive !== wasActive) {\n setWasActive(hasActive);\n if (hasActive) setOpen(true);\n }\n\n if (!isGroup) {\n // Disabled rows render with a muted, dashed-border treatment plus a\n // Lock affordance on the trailing edge. Clicks are swallowed. When a\n // `tooltip` is provided, the row opens a HoverCard dropdown on hover\n // so the explanation has space to breathe regardless of sidebar\n // state.\n if (item.disabled) {\n // Bypass SidebarMenuButton — it self-wraps in a Tooltip when given\n // a `tooltip` prop, which would swallow the HoverCard pointer\n // events. A plain styled <div> keeps cursor-not-allowed and lets\n // the row act as the HoverCard trigger.\n const row = (\n <div\n aria-disabled=\"true\"\n className=\"border-muted-foreground/40 bg-muted/40 text-muted-foreground flex h-8 w-full items-center gap-2 rounded-md border border-dashed px-2 text-sm\"\n style={{ cursor: \"not-allowed\" }}\n >\n {renderNavIcon(item.icon, \"size-4 shrink-0\")}\n <span className=\"flex-1 truncate text-left\">{item.label}</span>\n <Lock className=\"size-3.5 shrink-0 opacity-70\" />\n </div>\n );\n return (\n <SidebarMenuItem>\n {item.tooltip ? (\n <HoverCard>\n <HoverCardTrigger render={row} />\n <HoverCardContent side=\"right\" align=\"start\" className=\"text-sm\">\n {item.tooltip}\n </HoverCardContent>\n </HoverCard>\n ) : (\n row\n )}\n </SidebarMenuItem>\n );\n }\n\n const link = (\n <SidebarMenuButton\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n render={<Link href={item.href ?? \"#\"} />}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span>{item.label}</span>\n </SidebarMenuButton>\n );\n\n const row = item.tooltip ? (\n <Tooltip>\n <TooltipTrigger render={link} />\n <TooltipContent side=\"right\">{item.tooltip}</TooltipContent>\n </Tooltip>\n ) : (\n link\n );\n\n return (\n <SidebarMenuItem>\n {row}\n {item.badge != null && item.badge !== false && (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n )}\n </SidebarMenuItem>\n );\n }\n\n // Collapsed to icons, the expanded branch below is a dead button: it still\n // flips `open`, but what `open` reveals is a `SidebarMenuSub`, which carries\n // `group-data-[collapsible=icon]:hidden`. The group has no `href` either, so\n // there is no fallback — every child is simply unreachable. A dropdown is the\n // standard answer, and it belongs here rather than in any one app because\n // this hits EVERY `NavItem` with children.\n //\n // Mobile is excluded: it uses the sheet, not icon mode, so the sub renders\n // normally there.\n if (isGroup && state === \"collapsed\" && !isMobile) {\n return (\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n // No `tooltip` here on purpose. `SidebarMenuButton` turns itself\n // into a `TooltipTrigger` when given one, and layering the\n // dropdown trigger on top makes hover and click fight over the\n // same element. The menu names itself with a label instead.\n //\n // `hasActive` joins `item.active` so the trigger still reads as\n // current when a descendant is — collapsed, it is the only clue\n // which group holds the open page.\n <SidebarMenuButton isActive={item.active || hasActive} />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n <ChevronRight className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"right\" align=\"start\" className=\"min-w-48\">\n {/*\n The group wrapper is required, not cosmetic: `DropdownMenuLabel`\n is Base UI's `Menu.GroupLabel`, which reads `MenuGroupContext` and\n THROWS outside a `Menu.Group`. Nothing types this — the label\n compiles fine, and the whole app-shell crashes at the first click\n on the trigger, because the throw happens when the menu opens\n rather than when it mounts.\n */}\n <DropdownMenuGroup>\n <DropdownMenuLabel>{item.label}</DropdownMenuLabel>\n <NavDropdownItems items={children} />\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={() => setOpen((v) => !v)}\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n <ChevronRight\n className={`size-4 transition-transform ${open ? \"rotate-90\" : \"\"}`}\n />\n </SidebarMenuButton>\n {open && (\n <SidebarMenuSub>\n {children.map((child, ci) => (\n <SidebarMenuSubItem key={child.href ?? ci}>\n {child.children && child.children.length > 0 ? (\n <SidebarNavItem item={child} />\n ) : (\n <SidebarMenuSubButton\n isActive={child.active}\n render={<Link href={child.href ?? \"#\"} />}\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </SidebarMenuSubButton>\n )}\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n )}\n </SidebarMenuItem>\n );\n};\n\n/**\n * The children of a collapsed nav group, as dropdown entries.\n *\n * Recurses through nested groups via `DropdownMenuSub` — `SidebarNavItem`\n * recurses into itself for depth-2 groups in the expanded tree, and without the\n * matching recursion here a nested group would be dead again one level down,\n * which is the very bug this branch exists to fix.\n *\n * Badges are carried inline. `SidebarMenuBadge` is\n * `group-data-[collapsible=icon]:hidden`, so a collapsed sidebar drops every\n * count — and the count is usually why you opened the group.\n */\nconst NavDropdownItems = (props: { items: NavItem[] }) => {\n return (\n <>\n {props.items.map((child, ci) => {\n const badge = child.badge != null && child.badge !== false && (\n <span className=\"text-muted-foreground ml-auto pl-2 text-xs tabular-nums\">\n {child.badge}\n </span>\n );\n\n if (child.children && child.children.length > 0) {\n return (\n <DropdownMenuSub key={child.href ?? ci}>\n <DropdownMenuSubTrigger>\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <NavDropdownItems items={child.children} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n\n if (child.disabled) {\n return (\n <DropdownMenuItem key={child.href ?? ci} disabled>\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n <Lock className=\"ml-auto size-3.5 opacity-70\" />\n </DropdownMenuItem>\n );\n }\n\n return (\n <DropdownMenuItem\n key={child.href ?? ci}\n render={<Link href={child.href ?? \"#\"} />}\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n {badge}\n </DropdownMenuItem>\n );\n })}\n </>\n );\n};\n\nexport interface NavGroup {\n label?: string;\n items: NavItem[];\n}\n\nexport interface AppShellProps {\n /**\n * Branding shown at the top of the sidebar.\n */\n brand?: ReactNode;\n /**\n * Sidebar navigation groups.\n */\n nav?: NavGroup[];\n /**\n * Content rendered at the bottom of the sidebar (user menu, etc.).\n */\n sidebarFooter?: ReactNode;\n /**\n * Breadcrumb crumbs (last one is rendered as the current page).\n */\n breadcrumbs?: { label: ReactNode; href?: string }[];\n /**\n * Top-bar right-side content (search, theme toggle, user menu).\n */\n topbarActions?: ReactNode;\n /**\n * Layout variant.\n * - `sidebar` (default): sidebar and page sit flush side-by-side.\n * - `inset`: sidebar uses the global background; the page is a rounded card with margin.\n * - `floating`: the page uses the global background; the sidebar is a rounded card with margin.\n */\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n /**\n * When `variant=\"inset\"`, lift the header out of the floating card so it\n * sits on the sidebar background — only the main page becomes the card.\n * Has no effect on other variants.\n */\n headerOutside?: boolean;\n /**\n * Top loading bar shown during route transitions.\n * `true` (default) enables it with default styling, `false` disables it,\n * or pass an options object to customize.\n */\n progress?: boolean | NavigationProgressOptions;\n /**\n * Page content. Defaults to `<NestedView />` (renders the active route).\n */\n children?: ReactNode;\n /**\n * Surface failed `useAction` / `useQuery` calls as a toast (via the\n * `react:action:error` event). `true` (default) enables it, `false`\n * disables it, or pass an options object to configure\n * (see {@link ActionErrorToasterProps}). Ignored when `embedded` (the\n * parent layout owns the toaster).\n */\n actionErrorToaster?: boolean | ActionErrorToasterProps;\n /**\n * When `true`, the shell assumes it is mounted inside an outer provider tree\n * and skips its own `<DialogProvider>` and `<Toaster />` wrappers. Use this\n * when a parent layout already provides them.\n */\n embedded?: boolean;\n /**\n * When `true`, the shell fills its parent container instead of the viewport\n * (`min-h-svh`). Use when a parent layout owns the height (e.g. when a\n * sticky footer sits below the shell).\n */\n fill?: boolean;\n /**\n * Extra classes for the scrolling `<main>` element.\n *\n * Exists so an app can paint its own page surface (Lore stamps a dot\n * texture there) without every other consumer of the shell inheriting it.\n * Layout classes are applied after this, so a caller cannot break the\n * flex/overflow contract described above.\n */\n mainClassName?: string;\n}\n\n/**\n * Standard SaaS layout: collapsible sidebar + topbar with breadcrumbs.\n * Built on shadcn `<Sidebar>` + `<Breadcrumb>`.\n */\nexport const AppShell = (props: AppShellProps) => {\n const { collapsed, setCollapsed } = useSidebarState();\n const nav = props.nav ?? [];\n const variant = props.variant ?? \"sidebar\";\n const progress = props.progress ?? true;\n const headerOutside = !!props.headerOutside && variant === \"inset\";\n\n const headerNode = (\n <header\n className={\n headerOutside\n ? \"bg-sidebar flex h-14 shrink-0 items-center gap-2 px-4\"\n : \"bg-background flex h-14 shrink-0 items-center gap-2 border-b px-4\"\n }\n >\n {/* This bar is one non-wrapping flex line, and on a Lore project page it\n carries the trigger, a separator, the breadcrumbs, a split button,\n the search button and four header icons: about 470px of content in\n 373px at phone width. Nothing here used to be marked as the one that\n must survive, so the overflow fell off the RIGHT end and took the\n theme, colour-mode and account controls with it — off-screen, with no\n horizontal scroll to reach them and no menu they collapse into.\n\n So everything on the row is `shrink-0` with exactly one exception:\n the breadcrumbs, which are the one thing repeated in the page below\n and can therefore afford to give way. They truncate while there is\n still something to read, and below `sm` they are dropped outright\n rather than left as an unreadable sliver. */}\n <div className=\"flex shrink-0 items-center\">\n <StatefulSidebarTrigger />\n <Separator orientation=\"vertical\" className=\"mx-2\" />\n </div>\n {props.breadcrumbs && props.breadcrumbs.length > 0 && (\n <Breadcrumb className=\"min-w-0 overflow-hidden max-sm:hidden\">\n {/* `flex-nowrap`: the list wraps by default, and a second line in an\n `h-14` bar is drawn outside it. */}\n <BreadcrumbList className=\"flex-nowrap\">\n {props.breadcrumbs.map((crumb, i) => {\n const last = i === props.breadcrumbs!.length - 1;\n return (\n <Fragment key={i}>\n <BreadcrumbItem className=\"min-w-0\">\n {last || !crumb.href ? (\n <BreadcrumbPage className=\"truncate\">\n {crumb.label}\n </BreadcrumbPage>\n ) : (\n <BreadcrumbLink\n className=\"truncate\"\n render={<Link href={crumb.href} />}\n >\n {crumb.label}\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n {!last && <BreadcrumbSeparator className=\"shrink-0\" />}\n </Fragment>\n );\n })}\n </BreadcrumbList>\n </Breadcrumb>\n )}\n <div className=\"flex-1\" />\n {/* Wrapped rather than spread straight into the header: the actions have\n to be one `shrink-0` unit, and they keep the `gap-2` the header was\n giving them. */}\n <div className=\"flex shrink-0 items-center gap-2\">\n {props.topbarActions}\n </div>\n </header>\n );\n\n const mainNode = (\n // Layout contract for `fill: true` pages:\n // parent (`h-svh`) → SidebarProvider (`h-full`) → SidebarInset → main\n // - main is `flex flex-col min-h-0 flex-1` so its children can\n // claim the leftover height via `flex-1 min-h-0`.\n // - main itself is `overflow-hidden` (not `overflow-auto`) so the\n // table's inner `overflow-auto` is the actual scroll surface —\n // header stays sticky, body scrolls, no page-level scrollbar.\n // - For non-fill pages there's no height bound, so this collapses\n // to \"scroll whatever overflows\" without further config.\n <main\n className={cn(\n props.mainClassName,\n props.fill\n ? \"flex min-h-0 flex-1 flex-col overflow-hidden\"\n : \"flex-1 overflow-auto\",\n )}\n >\n {props.children ?? <NestedView />}\n </main>\n );\n const renderBody = () => (\n <>\n {progress !== false && (\n <NavigationProgress {...(progress === true ? {} : progress)} />\n )}\n <SidebarProvider\n open={!collapsed}\n onOpenChange={(o: boolean) => setCollapsed(!o)}\n // `fill` = a parent owns the height (e.g. a full-width banner above\n // the shell). The desktop sidebar is `fixed inset-y-0 h-svh` (pinned\n // to the VIEWPORT), so it would overlap whatever sits above the\n // shell — re-anchor it to this wrapper instead (absolute within the\n // now-relative provider, height from the wrapper). The arbitrary\n // selectors out-specify the base `.fixed`/`.h-svh` utilities.\n className={\n props.fill\n ? \"relative h-full min-h-0 [&_[data-slot=sidebar-container]]:absolute [&_[data-slot=sidebar-container]]:h-auto\"\n : undefined\n }\n >\n <Sidebar collapsible=\"icon\" variant={variant}>\n {/* Wraps the WHOLE sidebar, brand slot and footer included, because\n the links that leave this sheet are not only the nav items - the\n project switcher lives in `brand` and each app puts its own\n links in `sidebarFooter`. */}\n <SidebarNavAutoClose>\n <SidebarHeader>{props.brand}</SidebarHeader>\n <SidebarContent>\n {nav.map((group, gi) => (\n <SidebarGroup key={gi}>\n {group.label && (\n <SidebarGroupLabel>{group.label}</SidebarGroupLabel>\n )}\n <SidebarGroupContent>\n <SidebarMenu>\n {group.items.map((item, ii) => (\n <SidebarNavItem\n key={item.href ?? `${gi}-${ii}`}\n item={item}\n />\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </SidebarContent>\n {props.sidebarFooter && (\n <SidebarFooter>{props.sidebarFooter}</SidebarFooter>\n )}\n </SidebarNavAutoClose>\n </Sidebar>\n {headerOutside ? (\n <div className=\"bg-sidebar flex flex-1 flex-col\">\n {headerNode}\n <div className=\"bg-background m-2 mt-0 flex flex-1 flex-col overflow-hidden rounded-xl border shadow-sm\">\n {mainNode}\n </div>\n </div>\n ) : (\n <SidebarInset\n className={\n variant === \"inset\"\n ? \"border md:peer-data-[variant=inset]:overflow-hidden\"\n : undefined\n }\n >\n {headerNode}\n {mainNode}\n </SidebarInset>\n )}\n </SidebarProvider>\n </>\n );\n\n if (props.embedded) {\n return renderBody();\n }\n\n const errorToaster = props.actionErrorToaster ?? true;\n\n return (\n <DialogProvider>\n <TooltipProvider>\n {renderBody()}\n <Toaster />\n {errorToaster !== false && (\n <ActionErrorToaster\n {...(typeof errorToaster === \"object\" ? errorToaster : {})}\n />\n )}\n </TooltipProvider>\n </DialogProvider>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoFA,MAAM,+BAA+B;CACnC,MAAM,EAAE,eAAe,UAAU,YAAY,UAAU,WAAW;CAClE,MAAM,OAAO,WAAW,aAAa,UAAU;CAE/C,OACE,oBAAC,QAAD;EACE,SAAQ;EACR,MAAK;EACL,SAAS;EACT,cAAY,OAAO,qBAAqB;EACxC,WAAU;EAEV,UAAA,oBATS,OAAO,iBAAiB,eASjC,EAAM,WAAU,SAAU,CAAA;CACpB,CAAA;AAEZ;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,uBAAuB,UAAmC;CACrE,MAAM,EAAE,UAAU,kBAAkB,WAAW;CAM/C,IAAI,CAAC,UAAU,OAAO,MAAM;CAE5B,OAGE,oBAAC,OAAD;EACE,aAAU;EACV,WAAU;EACV,iBAAiB,UAAU;GACzB,MAAM,SAAU,MAAM,QAA+B,UAAU,GAAG;GAClE,IAAI,EAAE,kBAAkB,oBAAoB;GAM5C,MAAM,OAAO,OAAO,aAAa,MAAM;GACvC,IAAI,CAAC,QAAQ,SAAS,OAAO,KAAK,WAAW,GAAG,GAAG;GACnD,IAAI,OAAO,aAAa,UAAU,GAAG;GACrC,IAAI,OAAO,UAAU,OAAO,WAAW,SAAS;GAChD,IAAI,MAAM,WAAW,MAAM,WAAW,MAAM,YAAY,MAAM,QAC5D;GAGF,cAAc,KAAK;EACrB;EAEC,UAAA,MAAM;CACJ,CAAA;AAET;AA+CA,SAAS,oBAAoB,MAAwB;CACnD,IAAI,KAAK,QAAQ,OAAO;CACxB,QAAQ,KAAK,YA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MAAM,MAAM,KAAK,MAAM,OACtB,oBAAC,gBAAD,EAEQ,KACP,GAFM,KAAK,QAAQ,GAAG,GAAG,GAAG,IAE5B,CACF,EACU,CAAA,EACM,CAAA,CACT,EAAA,GAdK,EAcL,CACf,EACa,CAAA;IACf,MAAM,iBACL,oBAAC,eAAD,EAAA,UAAgB,MAAM,cAA6B,CAAA;GAElC,EAAA,CAAA;EACd,CAAA,GACR,gBACC,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,YACD,oBAAC,OAAD;IAAK,WAAU;IACZ,UAAA;GACE,CAAA,CACF;EAEL,CAAA,IAAA,qBAAC,cAAD;GACE,WACE,YAAY,UACR,wDACA,KAAA;GAJR,UAAA,CAOG,YACA,QACW;EAED,CAAA,CAAA;CACjB,CAAA,CAAA,EAAA,CAAA;CAGJ,IAAI,MAAM,UACR,OAAO,WAAW;CAGpB,MAAM,eAAe,MAAM,sBAAsB;CAEjD,OACE,oBAAC,gBAAD,EAAA,UACE,qBAAC,iBAAD,EAAA,UAAA;EACG,WAAW;EACZ,oBAAC,SAAD,CAAU,CAAA;EACT,iBAAiB,SAChB,oBAAC,oBAAD,EACE,GAAK,OAAO,iBAAiB,WAAW,eAAe,CAAC,EACzD,CAAA;CAEY,EAAA,CAAA,EACH,CAAA;AAEpB"}
1
+ {"version":3,"file":"app-shell.js","names":["Icon","Link"],"sources":["../../../src/components/app-shell/app-shell.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport * as React from \"react\";\n\nvoid React;\n\nimport {\n ActionErrorToaster,\n type ActionErrorToasterProps,\n} from \"@alepha/ui/components/action-error-toaster/action-error-toaster\";\nimport {\n NavigationProgress,\n type NavigationProgressOptions,\n} from \"@alepha/ui/components/app-shell/navigation-progress\";\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@alepha/ui/components/ui/breadcrumb\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@alepha/ui/components/ui/dropdown-menu\";\nimport {\n HoverCard,\n HoverCardContent,\n HoverCardTrigger,\n} from \"@alepha/ui/components/ui/hover-card\";\nimport { Separator } from \"@alepha/ui/components/ui/separator\";\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n SidebarProvider,\n useSidebar,\n} from \"@alepha/ui/components/ui/sidebar\";\nimport { Toaster } from \"@alepha/ui/components/ui/sonner\";\nimport {\n Tooltip,\n TooltipContent,\n TooltipProvider,\n TooltipTrigger,\n} from \"@alepha/ui/components/ui/tooltip\";\nimport { DialogProvider } from \"@alepha/ui/components/use-dialog/use-dialog\";\nimport { Link, NestedView } from \"alepha/react/router\";\nimport { useSidebarState } from \"alepha/react/ui\";\nimport {\n ChevronRight,\n Lock,\n Minus,\n PanelLeftClose,\n PanelLeftOpen,\n Plus,\n} from \"lucide-react\";\nimport type { ComponentType, ReactNode, SVGProps } from \"react\";\nimport { Fragment, useState } from \"react\";\n\n/**\n * Re-exported: the bar moved to its own module so it can be mounted at an\n * application root, but the option type is part of {@link AppShellProps}\n * and was importable from here first.\n */\nexport type { NavigationProgressOptions };\n\nconst StatefulSidebarTrigger = () => {\n const { toggleSidebar, isMobile, openMobile, state } = useSidebar();\n const open = isMobile ? openMobile : state === \"expanded\";\n const Icon = open ? PanelLeftClose : PanelLeftOpen;\n return (\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={toggleSidebar}\n aria-label={open ? \"Collapse sidebar\" : \"Expand sidebar\"}\n className=\"size-8\"\n >\n <Icon className=\"size-4\" />\n </Button>\n );\n};\n\n/**\n * Closes the mobile nav sheet when a link inside it is followed.\n *\n * On a phone the sidebar is a `Sheet` driven by `openMobile`. Tapping a nav\n * entry navigated and left the sheet up, so the destination page rendered\n * behind an overlay the reader had to dismiss by hand (feedback #2077, at\n * 491x929).\n *\n * ⚠️ One handler on the container, not a callback on each nav item. The links\n * inside that sheet are `SidebarNavItem`'s leaf, `NavDropdownItems`, the group\n * children, the brand slot's project switcher and every app's own sidebar\n * footer - a per-item `onClick` covers whichever of those someone remembers\n * today and silently misses the next one added. A capture listener on the\n * container covers them all, including the ones no `@alepha/ui` file knows\n * about, because it asks what the DOM event actually landed on.\n *\n * It reacts to ANCHORS only. The switcher, the disclosure toggles and the\n * dropdown triggers in there are buttons that open something inside the sheet,\n * and closing it under them would break the control rather than fix it.\n */\nexport const SidebarNavAutoClose = (props: { children: ReactNode }) => {\n const { isMobile, setOpenMobile } = useSidebar();\n\n // The desktop sidebar is not a sheet and `openMobile` does not drive it, so\n // this branch is not just an optimisation: running the handler there would\n // be a state write on every nav click for no reason. Collapsing the desktop\n // rail on navigation would be a new bug, not this fix.\n if (!isMobile) return props.children;\n\n return (\n // Capture, so the sheet closes even when the link's own handler stops\n // propagation on the way back up.\n <div\n data-slot=\"sidebar-nav-auto-close\"\n className=\"flex h-full w-full flex-col\"\n onClickCapture={(event) => {\n const anchor = (event.target as HTMLElement | null)?.closest?.(\"a\");\n if (!(anchor instanceof HTMLAnchorElement)) return;\n\n // Nothing here navigates the page the sheet is covering, so the sheet\n // has no reason to move: a placeholder `#` (the locked nav rows use\n // `item.href ?? \"#\"`), a download, a new tab, or a modified click that\n // the browser opens elsewhere.\n const href = anchor.getAttribute(\"href\");\n if (!href || href === \"#\" || href.startsWith(\"#\")) return;\n if (anchor.hasAttribute(\"download\")) return;\n if (anchor.target && anchor.target !== \"_self\") return;\n if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) {\n return;\n }\n\n setOpenMobile(false);\n }}\n >\n {props.children}\n </div>\n );\n};\n\ntype IconType = ComponentType<SVGProps<SVGSVGElement>>;\n\nexport interface NavItem {\n label: ReactNode;\n /**\n * Required for leaf items. Ignored when `children` is provided (the parent becomes a toggle group).\n */\n href?: string;\n /**\n * Either an icon *component* (e.g. a lucide `Users`) which is instantiated\n * with the row's sizing className, or an already-rendered ReactNode element\n * (e.g. `<Users />`). The latter lets nav metadata declared on a `$page`\n * (which is pure React) carry its icon as a node — see `useNavTree`.\n */\n icon?: IconType | ReactNode;\n /**\n * When provided, renders as the active marker. Compare against current path.\n */\n active?: boolean;\n /**\n * Nested items. When set, the parent becomes a collapsible group.\n */\n children?: NavItem[];\n /**\n * Initial open state for groups. Defaults to true if any descendant is active.\n */\n defaultOpen?: boolean;\n /**\n * Optional trailing badge (e.g. unread count). Hidden when the sidebar is collapsed to icons.\n */\n badge?: ReactNode;\n /**\n * When true the item is rendered muted, navigation is blocked, and the\n * `tooltip` (if any) explains why. Use for paywalled / unavailable entries.\n */\n disabled?: boolean;\n /**\n * Hover tooltip shown on the row regardless of sidebar state. When the\n * item is `disabled`, this is the explanation surface (HoverCard, with\n * room to breathe). When the item is enabled, it surfaces as a regular\n * Tooltip on the trigger.\n */\n tooltip?: ReactNode;\n}\n\nfunction hasActiveDescendant(item: NavItem): boolean {\n if (item.active) return true;\n return (item.children ?? []).some(hasActiveDescendant);\n}\n\n/**\n * The one open branch of the nav tree, when `navAccordion` is on.\n *\n * A single path rather than a set of open ids, because \"one group open\" has to\n * mean one group open PER LEVEL: a nested group closing its own parent to open\n * itself would be a bug, not exclusivity. A path says both things at once - a\n * group is open exactly when its path is a prefix of this one, so opening a\n * sibling replaces the path (the sibling closes) while opening a child extends\n * it (the parent stays).\n *\n * Paths are indices into `nav`: `[groupIndex, itemIndex, ...childIndex]`.\n */\ninterface NavAccordion {\n openPath: number[];\n setOpenPath: (path: number[]) => void;\n}\n\nfunction isOpenPathPrefix(path: number[], openPath: number[]): boolean {\n if (path.length === 0 || path.length > openPath.length) return false;\n return path.every((index, depth) => openPath[depth] === index);\n}\n\nfunction samePath(a: number[], b: number[]): boolean {\n return a.length === b.length && a.every((index, i) => b[i] === index);\n}\n\n/**\n * The path the accordion should be showing: the DEEPEST group holding the\n * active page, or failing that the first group asking for `defaultOpen`.\n *\n * Computed here, from the tree, rather than reported upwards by the item that\n * notices it is active. An item cannot set its parent's state during render\n * (React refuses to update another component mid-render), and doing it in an\n * effect costs a frame of the wrong group being open on every navigation.\n */\nfunction findOpenPath(nav: NavGroup[]): number[] {\n let fallback: number[] = [];\n\n const walk = (item: NavItem, path: number[]): number[] | undefined => {\n const children = item.children ?? [];\n if (children.length === 0) return undefined;\n for (let ci = 0; ci < children.length; ci++) {\n const deeper = walk(children[ci]!, [...path, ci]);\n if (deeper) return deeper;\n }\n if (hasActiveDescendant(item)) return path;\n if (fallback.length === 0 && item.defaultOpen) fallback = path;\n return undefined;\n };\n\n for (let gi = 0; gi < nav.length; gi++) {\n const items = nav[gi]?.items ?? [];\n for (let ii = 0; ii < items.length; ii++) {\n const found = walk(items[ii]!, [gi, ii]);\n if (found) return found;\n }\n }\n return fallback;\n}\n\n/**\n * Render a NavItem icon. An already-created element (e.g. `<Users />`, which\n * `React.isValidElement` recognises) is returned as-is; anything else is\n * treated as a component *type* — including lucide's `forwardRef` icons, which\n * are objects rather than plain functions — and instantiated with the row's\n * sizing className.\n */\nfunction renderNavIcon(icon: NavItem[\"icon\"], className: string): ReactNode {\n if (icon == null || icon === false) return null;\n if (React.isValidElement(icon)) {\n // Already an element (e.g. `<Users />`): clone it to apply the row's sizing\n // className so element icons render at the same size as component icons,\n // merging with any className the caller already set.\n const existing = (icon.props as { className?: string })?.className;\n return React.cloneElement(\n icon as React.ReactElement<{ className?: string }>,\n {\n className: existing ? `${existing} ${className}` : className,\n },\n );\n }\n const Icon = icon as IconType;\n return <Icon className={className} />;\n}\n\n/**\n * The open/close animation for a nav group.\n *\n * `grid-template-rows: 0fr -> 1fr` on a wrapper whose child is\n * `overflow: hidden`. That is the one way to transition to an INTRINSIC\n * height in CSS alone: `height: auto` is not interpolable, so the usual\n * alternatives are a hardcoded max-height (which either clips a long group or\n * makes a short one crawl through empty space) or measuring the subtree in an\n * effect (a layout read on every toggle, and a frame of the wrong height).\n *\n * ⚠️ The children stay MOUNTED while closed, which is what makes the height\n * animatable, so something has to do what unmounting used to: clipped content\n * is invisible but still focusable and still read aloud. `inert` does it, and\n * it is the right tool rather than `visibility: hidden` because it needs no\n * animation of its own - the clipping already hides the group, so the only\n * job left is taking it out of the tab order and the a11y tree, which is a\n * state rather than a transition.\n *\n * `min-h-0` on the inner element is load-bearing, not tidiness: a grid item's\n * automatic minimum size is its content, so without it the row never shrinks\n * below the subtree's natural height and nothing appears to animate.\n */\nconst NavCollapse = (props: {\n open: boolean;\n animate: boolean;\n children: ReactNode;\n}) => (\n <div\n data-state={props.open ? \"open\" : \"closed\"}\n inert={!props.open}\n className={cn(\n \"grid grid-rows-[0fr] data-[state=open]:grid-rows-[1fr]\",\n props.animate &&\n \"transition-[grid-template-rows] duration-200 ease-out motion-reduce:transition-none\",\n )}\n >\n <div className=\"min-h-0 overflow-hidden\">{props.children}</div>\n </div>\n);\n\nconst SidebarNavItem = (props: {\n item: NavItem;\n /**\n * This item's position in `nav`, used only by the accordion. See\n * {@link NavAccordion}.\n */\n path: number[];\n /**\n * Present when `navAccordion` is on, and then it OWNS the open state: the\n * local `useState` below is still declared (hooks cannot be conditional) but\n * nothing reads it.\n */\n accordion?: NavAccordion;\n /**\n * `navAnimate`, threaded down so a nested group animates like its parent.\n */\n animate: boolean;\n /**\n * `navToggleIcon`, threaded down for the same reason.\n */\n toggleIcon: \"caret\" | \"plusMinus\";\n}) => {\n const { item, path, accordion, animate, toggleIcon } = props;\n const { state, isMobile } = useSidebar();\n const children = item.children;\n const isGroup = !!children && children.length > 0;\n const hasActive = isGroup && hasActiveDescendant(item);\n const [localOpen, setLocalOpen] = useState(item.defaultOpen ?? hasActive);\n // Reveal a collapsed group when navigation makes one of its descendants\n // active — SPA nav, spotlight (⌘K), breadcrumb, or a deep-link that doesn't\n // remount this item (useState's initializer runs only at mount, so without\n // this the group stays stuck closed and the active page is hidden — petition\n // #4). Only OPENS; never auto-collapses, so a manual toggle is preserved.\n //\n // Accordion mode does the same job in `AppShell` instead, from the tree, and\n // skips this: the state lives there, and a child cannot write it mid-render.\n const [wasActive, setWasActive] = useState(hasActive);\n if (!accordion && hasActive !== wasActive) {\n setWasActive(hasActive);\n if (hasActive) setLocalOpen(true);\n }\n\n const open = accordion\n ? isOpenPathPrefix(path, accordion.openPath)\n : localOpen;\n\n // Closing means handing the branch back to this item's PARENT, not clearing\n // it: a nested group that closed itself by emptying the path would collapse\n // every ancestor along with it.\n const toggle = () => {\n if (accordion) {\n accordion.setOpenPath(open ? path.slice(0, -1) : path);\n } else {\n setLocalOpen((v) => !v);\n }\n };\n\n if (!isGroup) {\n // Disabled rows render with a muted, dashed-border treatment plus a\n // Lock affordance on the trailing edge. Clicks are swallowed. When a\n // `tooltip` is provided, the row opens a HoverCard dropdown on hover\n // so the explanation has space to breathe regardless of sidebar\n // state.\n if (item.disabled) {\n // Bypass SidebarMenuButton — it self-wraps in a Tooltip when given\n // a `tooltip` prop, which would swallow the HoverCard pointer\n // events. A plain styled <div> keeps cursor-not-allowed and lets\n // the row act as the HoverCard trigger.\n const row = (\n <div\n aria-disabled=\"true\"\n className=\"border-muted-foreground/40 bg-muted/40 text-muted-foreground flex h-8 w-full items-center gap-2 rounded-md border border-dashed px-2 text-sm\"\n style={{ cursor: \"not-allowed\" }}\n >\n {renderNavIcon(item.icon, \"size-4 shrink-0\")}\n <span className=\"flex-1 truncate text-left\">{item.label}</span>\n <Lock className=\"size-3.5 shrink-0 opacity-70\" />\n </div>\n );\n return (\n <SidebarMenuItem>\n {item.tooltip ? (\n <HoverCard>\n <HoverCardTrigger render={row} />\n <HoverCardContent side=\"right\" align=\"start\" className=\"text-sm\">\n {item.tooltip}\n </HoverCardContent>\n </HoverCard>\n ) : (\n row\n )}\n </SidebarMenuItem>\n );\n }\n\n const link = (\n <SidebarMenuButton\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n render={<Link href={item.href ?? \"#\"} />}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span>{item.label}</span>\n </SidebarMenuButton>\n );\n\n const row = item.tooltip ? (\n <Tooltip>\n <TooltipTrigger render={link} />\n <TooltipContent side=\"right\">{item.tooltip}</TooltipContent>\n </Tooltip>\n ) : (\n link\n );\n\n return (\n <SidebarMenuItem>\n {row}\n {item.badge != null && item.badge !== false && (\n <SidebarMenuBadge>{item.badge}</SidebarMenuBadge>\n )}\n </SidebarMenuItem>\n );\n }\n\n // Collapsed to icons, the expanded branch below is a dead button: it still\n // flips `open`, but what `open` reveals is a `SidebarMenuSub`, which carries\n // `group-data-[collapsible=icon]:hidden`. The group has no `href` either, so\n // there is no fallback — every child is simply unreachable. A dropdown is the\n // standard answer, and it belongs here rather than in any one app because\n // this hits EVERY `NavItem` with children.\n //\n // Mobile is excluded: it uses the sheet, not icon mode, so the sub renders\n // normally there.\n if (isGroup && state === \"collapsed\" && !isMobile) {\n return (\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n // No `tooltip` here on purpose. `SidebarMenuButton` turns itself\n // into a `TooltipTrigger` when given one, and layering the\n // dropdown trigger on top makes hover and click fight over the\n // same element. The menu names itself with a label instead.\n //\n // `hasActive` joins `item.active` so the trigger still reads as\n // current when a descendant is — collapsed, it is the only clue\n // which group holds the open page.\n <SidebarMenuButton isActive={item.active || hasActive} />\n }\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n <ChevronRight className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"right\" align=\"start\" className=\"min-w-48\">\n {/*\n The group wrapper is required, not cosmetic: `DropdownMenuLabel`\n is Base UI's `Menu.GroupLabel`, which reads `MenuGroupContext` and\n THROWS outside a `Menu.Group`. Nothing types this — the label\n compiles fine, and the whole app-shell crashes at the first click\n on the trigger, because the throw happens when the menu opens\n rather than when it mounts.\n */}\n <DropdownMenuGroup>\n <DropdownMenuLabel>{item.label}</DropdownMenuLabel>\n <NavDropdownItems items={children} />\n </DropdownMenuGroup>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n );\n }\n\n return (\n <SidebarMenuItem>\n <SidebarMenuButton\n onClick={toggle}\n isActive={item.active}\n tooltip={typeof item.label === \"string\" ? item.label : undefined}\n >\n {renderNavIcon(item.icon, \"size-4\")}\n <span className=\"flex-1 text-left\">{item.label}</span>\n {/*\n Plus and minus are SWAPPED, never rotated: a plus turned 45° is a\n close button, which is a different promise. The caret is the one\n that turns, and it stays the default because it is what every app\n using this shell already had.\n */}\n {toggleIcon === \"plusMinus\" ? (\n open ? (\n <Minus className=\"size-4\" />\n ) : (\n <Plus className=\"size-4\" />\n )\n ) : (\n <ChevronRight\n className={`size-4 transition-transform ${open ? \"rotate-90\" : \"\"}`}\n />\n )}\n </SidebarMenuButton>\n <NavCollapse open={open} animate={animate}>\n <SidebarMenuSub>\n {children.map((child, ci) => (\n <SidebarMenuSubItem key={child.href ?? ci}>\n {child.children && child.children.length > 0 ? (\n <SidebarNavItem\n item={child}\n path={[...path, ci]}\n accordion={accordion}\n animate={animate}\n toggleIcon={toggleIcon}\n />\n ) : (\n <SidebarMenuSubButton\n isActive={child.active}\n render={<Link href={child.href ?? \"#\"} />}\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </SidebarMenuSubButton>\n )}\n </SidebarMenuSubItem>\n ))}\n </SidebarMenuSub>\n </NavCollapse>\n </SidebarMenuItem>\n );\n};\n\n/**\n * The children of a collapsed nav group, as dropdown entries.\n *\n * Recurses through nested groups via `DropdownMenuSub` — `SidebarNavItem`\n * recurses into itself for depth-2 groups in the expanded tree, and without the\n * matching recursion here a nested group would be dead again one level down,\n * which is the very bug this branch exists to fix.\n *\n * Badges are carried inline. `SidebarMenuBadge` is\n * `group-data-[collapsible=icon]:hidden`, so a collapsed sidebar drops every\n * count — and the count is usually why you opened the group.\n */\nconst NavDropdownItems = (props: { items: NavItem[] }) => {\n return (\n <>\n {props.items.map((child, ci) => {\n const badge = child.badge != null && child.badge !== false && (\n <span className=\"text-muted-foreground ml-auto pl-2 text-xs tabular-nums\">\n {child.badge}\n </span>\n );\n\n if (child.children && child.children.length > 0) {\n return (\n <DropdownMenuSub key={child.href ?? ci}>\n <DropdownMenuSubTrigger>\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent>\n <NavDropdownItems items={child.children} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n\n if (child.disabled) {\n return (\n <DropdownMenuItem key={child.href ?? ci} disabled>\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n <Lock className=\"ml-auto size-3.5 opacity-70\" />\n </DropdownMenuItem>\n );\n }\n\n return (\n <DropdownMenuItem\n key={child.href ?? ci}\n render={<Link href={child.href ?? \"#\"} />}\n >\n {renderNavIcon(child.icon, \"size-4\")}\n <span>{child.label}</span>\n {badge}\n </DropdownMenuItem>\n );\n })}\n </>\n );\n};\n\nexport interface NavGroup {\n label?: string;\n items: NavItem[];\n}\n\nexport interface AppShellProps {\n /**\n * Branding shown at the top of the sidebar.\n */\n brand?: ReactNode;\n /**\n * Sidebar navigation groups.\n */\n nav?: NavGroup[];\n /**\n * Keep at most ONE nav group open at a time. Defaults to `true`.\n *\n * Opening a group closes the one that was open beside it, the way an\n * accordion does. Exclusivity is per level, so a nested group opens inside\n * its parent rather than replacing it, and the open branch always runs from\n * the root to the deepest open group.\n *\n * On means the sidebar owns the open state, so `NavItem.defaultOpen` seeds\n * the branch rather than opening a group of its own: the first item asking\n * for it wins, and only when nothing is active. Pass `false` for the older\n * behaviour, where every group keeps its own state and any number can be\n * open at once.\n *\n * ⚠️ Nothing changes in the icon rail. Collapsed to icons a group is a\n * dropdown, and one dropdown at a time is already all a menu can do.\n */\n navAccordion?: boolean;\n /**\n * Slide a nav group open and shut instead of swapping it in. Defaults to\n * `true`.\n *\n * `false` is a snap, not a shorter animation: an app that wants a different\n * duration or curve should style\n * `[data-slot=sidebar-menu-item] [data-state]` rather than turn this off.\n *\n * ⚠️ Honours `prefers-reduced-motion` on its own, so this is not the switch\n * for accessibility. It exists for a shell embedded somewhere that owns its\n * own motion, and for a test that would rather not wait 200ms.\n */\n navAnimate?: boolean;\n /**\n * Which glyph a collapsible nav group carries. Defaults to `\"caret\"`.\n *\n * - `\"caret\"` - a chevron that turns a quarter clockwise when the group\n * opens. One glyph, and the rotation is the state.\n * - `\"plusMinus\"` - a plus when shut, a minus when open. Two glyphs that\n * name the two states outright, where a caret only points and leaves the\n * reader to learn which direction means open.\n *\n * ⚠️ Nothing in the icon rail. Collapsed, a group is a dropdown that opens\n * to the RIGHT, so its chevron is a direction rather than a state and there\n * is no minus that could answer it.\n */\n navToggleIcon?: \"caret\" | \"plusMinus\";\n /**\n * Content rendered at the bottom of the sidebar (user menu, etc.).\n */\n sidebarFooter?: ReactNode;\n /**\n * Breadcrumb crumbs (last one is rendered as the current page).\n */\n breadcrumbs?: { label: ReactNode; href?: string }[];\n /**\n * Top-bar right-side content (search, theme toggle, user menu).\n */\n topbarActions?: ReactNode;\n /**\n * Layout variant.\n * - `sidebar` (default): sidebar and page sit flush side-by-side.\n * - `inset`: sidebar uses the global background; the page is a rounded card with margin.\n * - `floating`: the page uses the global background; the sidebar is a rounded card with margin.\n */\n variant?: \"sidebar\" | \"floating\" | \"inset\";\n /**\n * When `variant=\"inset\"`, lift the header out of the floating card so it\n * sits on the sidebar background — only the main page becomes the card.\n * Has no effect on other variants.\n */\n headerOutside?: boolean;\n /**\n * Top loading bar shown during route transitions.\n * `true` (default) enables it with default styling, `false` disables it,\n * or pass an options object to customize.\n */\n progress?: boolean | NavigationProgressOptions;\n /**\n * Page content. Defaults to `<NestedView />` (renders the active route).\n */\n children?: ReactNode;\n /**\n * Surface failed `useAction` / `useQuery` calls as a toast (via the\n * `react:action:error` event). `true` (default) enables it, `false`\n * disables it, or pass an options object to configure\n * (see {@link ActionErrorToasterProps}). Ignored when `embedded` (the\n * parent layout owns the toaster).\n */\n actionErrorToaster?: boolean | ActionErrorToasterProps;\n /**\n * When `true`, the shell assumes it is mounted inside an outer provider tree\n * and skips its own `<DialogProvider>` and `<Toaster />` wrappers. Use this\n * when a parent layout already provides them.\n */\n embedded?: boolean;\n /**\n * When `true`, the shell fills its parent container instead of the viewport\n * (`min-h-svh`). Use when a parent layout owns the height (e.g. when a\n * sticky footer sits below the shell).\n */\n fill?: boolean;\n /**\n * Extra classes for the scrolling `<main>` element.\n *\n * Exists so an app can paint its own page surface (Lore stamps a dot\n * texture there) without every other consumer of the shell inheriting it.\n * Layout classes are applied after this, so a caller cannot break the\n * flex/overflow contract described above.\n */\n mainClassName?: string;\n}\n\n/**\n * Standard SaaS layout: collapsible sidebar + topbar with breadcrumbs.\n * Built on shadcn `<Sidebar>` + `<Breadcrumb>`.\n */\nexport const AppShell = (props: AppShellProps) => {\n const { collapsed, setCollapsed } = useSidebarState();\n const nav = props.nav ?? [];\n\n // The accordion's one open branch. Held here because exclusivity is a\n // question about SIBLINGS, and no nav item can see its own.\n const navAccordion = props.navAccordion ?? true;\n const navAnimate = props.navAnimate ?? true;\n const navToggleIcon = props.navToggleIcon ?? \"caret\";\n const wantedOpenPath = findOpenPath(nav);\n const [openPath, setOpenPath] = useState(wantedOpenPath);\n // Follow the active page. Set during render of THIS component, which is the\n // supported way to react to changed input without a wasted frame; the same\n // pattern a nav item uses for its own state when the accordion is off.\n // Only ever opens: `findOpenPath` returns an empty path when nothing is\n // active and nothing asked for `defaultOpen`, and adopting that would slam\n // the branch shut on every navigation to a top-level page.\n const [lastWanted, setLastWanted] = useState(wantedOpenPath);\n if (!samePath(wantedOpenPath, lastWanted)) {\n setLastWanted(wantedOpenPath);\n if (wantedOpenPath.length > 0) setOpenPath(wantedOpenPath);\n }\n const variant = props.variant ?? \"sidebar\";\n const progress = props.progress ?? true;\n const headerOutside = !!props.headerOutside && variant === \"inset\";\n\n const headerNode = (\n <header\n className={\n headerOutside\n ? \"bg-sidebar flex h-14 shrink-0 items-center gap-2 px-4\"\n : \"bg-background flex h-14 shrink-0 items-center gap-2 border-b px-4\"\n }\n >\n {/* This bar is one non-wrapping flex line, and on a Lore project page it\n carries the trigger, a separator, the breadcrumbs, a split button,\n the search button and four header icons: about 470px of content in\n 373px at phone width. Nothing here used to be marked as the one that\n must survive, so the overflow fell off the RIGHT end and took the\n theme, colour-mode and account controls with it — off-screen, with no\n horizontal scroll to reach them and no menu they collapse into.\n\n So everything on the row is `shrink-0` with exactly one exception:\n the breadcrumbs, which are the one thing repeated in the page below\n and can therefore afford to give way. They truncate while there is\n still something to read, and below `sm` they are dropped outright\n rather than left as an unreadable sliver. */}\n <div className=\"flex shrink-0 items-center\">\n <StatefulSidebarTrigger />\n <Separator orientation=\"vertical\" className=\"mx-2\" />\n </div>\n {props.breadcrumbs && props.breadcrumbs.length > 0 && (\n <Breadcrumb className=\"min-w-0 overflow-hidden max-sm:hidden\">\n {/* `flex-nowrap`: the list wraps by default, and a second line in an\n `h-14` bar is drawn outside it. */}\n <BreadcrumbList className=\"flex-nowrap\">\n {props.breadcrumbs.map((crumb, i) => {\n const last = i === props.breadcrumbs!.length - 1;\n return (\n <Fragment key={i}>\n <BreadcrumbItem className=\"min-w-0\">\n {last || !crumb.href ? (\n <BreadcrumbPage className=\"truncate\">\n {crumb.label}\n </BreadcrumbPage>\n ) : (\n <BreadcrumbLink\n className=\"truncate\"\n render={<Link href={crumb.href} />}\n >\n {crumb.label}\n </BreadcrumbLink>\n )}\n </BreadcrumbItem>\n {!last && <BreadcrumbSeparator className=\"shrink-0\" />}\n </Fragment>\n );\n })}\n </BreadcrumbList>\n </Breadcrumb>\n )}\n <div className=\"flex-1\" />\n {/* Wrapped rather than spread straight into the header: the actions have\n to be one `shrink-0` unit, and they keep the `gap-2` the header was\n giving them. */}\n <div className=\"flex shrink-0 items-center gap-2\">\n {props.topbarActions}\n </div>\n </header>\n );\n\n const mainNode = (\n // Layout contract for `fill: true` pages:\n // parent (`h-svh`) → SidebarProvider (`h-full`) → SidebarInset → main\n // - main is `flex flex-col min-h-0 flex-1` so its children can\n // claim the leftover height via `flex-1 min-h-0`.\n // - main itself is `overflow-hidden` (not `overflow-auto`) so the\n // table's inner `overflow-auto` is the actual scroll surface —\n // header stays sticky, body scrolls, no page-level scrollbar.\n // - For non-fill pages there's no height bound, so this collapses\n // to \"scroll whatever overflows\" without further config.\n //\n // `relative` is load-bearing in BOTH branches, and it is the whole of\n // #1849: an `overflow` declared on a STATIC element does not clip an\n // absolutely positioned descendant whose containing block resolves above\n // it. Base UI gives every named form control a 1×1 hidden `<input>`\n // styled `position: absolute` with no offsets, so on a page whose fields\n // live inside an inner scroller each of those inputs escaped this `main`,\n // resolved against the positioned `SidebarInset` and pinned the document\n // open at its own static offset — a page that scrolled 1271px into empty\n // background beneath a shell that had not moved. Positioning `main` makes\n // its overflow bound real, whatever a page renders inside it.\n <main\n className={cn(\n props.mainClassName,\n \"relative\",\n props.fill\n ? \"flex min-h-0 flex-1 flex-col overflow-hidden\"\n : \"flex-1 overflow-auto\",\n )}\n >\n {props.children ?? <NestedView />}\n </main>\n );\n const renderBody = () => (\n <>\n {progress !== false && (\n <NavigationProgress {...(progress === true ? {} : progress)} />\n )}\n <SidebarProvider\n open={!collapsed}\n onOpenChange={(o: boolean) => setCollapsed(!o)}\n // `fill` = a parent owns the height (e.g. a full-width banner above\n // the shell). The desktop sidebar is `fixed inset-y-0 h-svh` (pinned\n // to the VIEWPORT), so it would overlap whatever sits above the\n // shell — re-anchor it to this wrapper instead (absolute within the\n // now-relative provider, height from the wrapper). The arbitrary\n // selectors out-specify the base `.fixed`/`.h-svh` utilities.\n className={\n props.fill\n ? \"relative h-full min-h-0 [&_[data-slot=sidebar-container]]:absolute [&_[data-slot=sidebar-container]]:h-auto\"\n : undefined\n }\n >\n <Sidebar collapsible=\"icon\" variant={variant}>\n {/* Wraps the WHOLE sidebar, brand slot and footer included, because\n the links that leave this sheet are not only the nav items - the\n project switcher lives in `brand` and each app puts its own\n links in `sidebarFooter`. */}\n <SidebarNavAutoClose>\n <SidebarHeader>{props.brand}</SidebarHeader>\n <SidebarContent>\n {nav.map((group, gi) => (\n <SidebarGroup key={gi}>\n {group.label && (\n <SidebarGroupLabel>{group.label}</SidebarGroupLabel>\n )}\n <SidebarGroupContent>\n <SidebarMenu>\n {group.items.map((item, ii) => (\n <SidebarNavItem\n key={item.href ?? `${gi}-${ii}`}\n item={item}\n path={[gi, ii]}\n accordion={\n navAccordion ? { openPath, setOpenPath } : undefined\n }\n animate={navAnimate}\n toggleIcon={navToggleIcon}\n />\n ))}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </SidebarContent>\n {props.sidebarFooter && (\n <SidebarFooter>{props.sidebarFooter}</SidebarFooter>\n )}\n </SidebarNavAutoClose>\n </Sidebar>\n {headerOutside ? (\n <div className=\"bg-sidebar flex flex-1 flex-col\">\n {headerNode}\n <div className=\"bg-background m-2 mt-0 flex flex-1 flex-col overflow-hidden rounded-xl border shadow-sm\">\n {mainNode}\n </div>\n </div>\n ) : (\n <SidebarInset\n className={\n variant === \"inset\"\n ? \"border md:peer-data-[variant=inset]:overflow-hidden\"\n : undefined\n }\n >\n {headerNode}\n {mainNode}\n </SidebarInset>\n )}\n </SidebarProvider>\n </>\n );\n\n if (props.embedded) {\n return renderBody();\n }\n\n const errorToaster = props.actionErrorToaster ?? true;\n\n return (\n <DialogProvider>\n <TooltipProvider>\n {renderBody()}\n <Toaster />\n {errorToaster !== false && (\n <ActionErrorToaster\n {...(typeof errorToaster === \"object\" ? errorToaster : {})}\n />\n )}\n </TooltipProv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EACZ,oBAAC,SAAD,CAAU,CAAA;EACT,iBAAiB,SAChB,oBAAC,oBAAD,EACE,GAAK,OAAO,iBAAiB,WAAW,eAAe,CAAC,EACzD,CAAA;CAEY,EAAA,CAAA,EACH,CAAA;AAEpB"}
@@ -41,37 +41,38 @@ const AuthRegister = (props) => {
41
41
  const credentialsProvider = props.realmConfig.authenticationMethods.find((it) => it.type === "CREDENTIALS");
42
42
  const settings = props.realmConfig.settings;
43
43
  const allowed = props.preAuthorized === true || settings.registrationAllowed !== false;
44
+ const schema = useMemo(() => {
45
+ const names = settings.firstNameLastName === "required";
46
+ const shape = {
47
+ firstName: names ? z.text({
48
+ trim: true,
49
+ maxLength: 100
50
+ }) : z.text({
51
+ trim: true,
52
+ maxLength: 100
53
+ }).optional(),
54
+ lastName: names ? z.text({
55
+ trim: true,
56
+ maxLength: 100
57
+ }) : z.text({
58
+ trim: true,
59
+ maxLength: 100
60
+ }).optional(),
61
+ username: settings.username === "required" ? z.text({
62
+ trim: true,
63
+ pattern: settings.usernameRegExp
64
+ }) : z.text({
65
+ trim: true,
66
+ pattern: settings.usernameRegExp
67
+ }).optional(),
68
+ email: settings.email === "required" ? z.email() : z.email().optional(),
69
+ phoneNumber: settings.phoneNumber === "required" ? z.e164() : z.e164().optional(),
70
+ password: z.string().min(settings.passwordPolicy?.minLength ?? 8)
71
+ };
72
+ return z.object(shape);
73
+ }, [settings]);
44
74
  const form = useForm({
45
- schema: useMemo(() => {
46
- const names = settings.firstNameLastName === "required";
47
- const shape = {
48
- firstName: names ? z.text({
49
- trim: true,
50
- maxLength: 100
51
- }) : z.text({
52
- trim: true,
53
- maxLength: 100
54
- }).optional(),
55
- lastName: names ? z.text({
56
- trim: true,
57
- maxLength: 100
58
- }) : z.text({
59
- trim: true,
60
- maxLength: 100
61
- }).optional(),
62
- username: settings.username === "required" ? z.text({
63
- trim: true,
64
- pattern: settings.usernameRegExp
65
- }) : z.text({
66
- trim: true,
67
- pattern: settings.usernameRegExp
68
- }).optional(),
69
- email: settings.email === "required" ? z.email() : z.email().optional(),
70
- phoneNumber: settings.phoneNumber === "required" ? z.e164() : z.e164().optional(),
71
- password: z.string().min(settings.passwordPolicy?.minLength ?? 8)
72
- };
73
- return z.object(shape);
74
- }, [settings]),
75
+ schema,
75
76
  initialValues: props.lockedEmail ? { email: props.lockedEmail } : void 0,
76
77
  handler: async (data) => {
77
78
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"auth-register.js","names":[],"sources":["../../../src/components/auth/auth-register.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { BrandIcon } from \"@alepha/ui/components/brand-icon/brand-icon\";\nimport {\n TurnstileWidget,\n type TurnstileWidgetHandle,\n} from \"@alepha/ui/components/captcha/turnstile-widget\";\nimport { iconFor } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Control } from \"@alepha/ui/components/control/control\";\nimport { Alert, AlertDescription } from \"@alepha/ui/components/ui/alert\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Card, CardContent } from \"@alepha/ui/components/ui/card\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n} from \"@alepha/ui/components/ui/input-otp\";\nimport { Label } from \"@alepha/ui/components/ui/label\";\nimport { Separator } from \"@alepha/ui/components/ui/separator\";\nimport { SchemaValidationError, z } from \"alepha\";\nimport type {\n RealmConfig,\n RegistrationIntentResponse,\n UserController,\n} from \"alepha/api/users\";\nimport { useClient } from \"alepha/react\";\nimport { useAuth } from \"alepha/react/auth\";\nimport { useForm, useFormState } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useRouter } from \"alepha/react/router\";\nimport { AlertCircle, Check, Info, X } from \"lucide-react\";\nimport {\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { safeRedirect } from \"./safe-redirect.ts\";\n\nexport interface AuthRegisterProps {\n /**\n * Realm configuration (drives required fields, verification step, OAuth buttons).\n */\n realmConfig: RealmConfig;\n /**\n * Custom logo node, rendered above the form. When provided, it replaces\n * the default `settings.logoUrl` <img>. Use this to inject a branded\n * component (e.g. with light/dark variants or an animation).\n */\n logo?: ReactNode;\n /**\n * Route to the login page. When set, a \"Sign in\" link is shown.\n */\n loginPath?: string;\n /**\n * Optional banner rendered above the registration form (form phase only).\n * Used to contextualize the flow when the user arrives via a CTA, e.g.\n * \"Before creating a campaign, create an account.\"\n */\n message?: ReactNode;\n /**\n * Where the \"Cancel\" button abandons to. Defaults to \"/\". This is\n * intentionally decoupled from the post-auth `?redirect=` target: cancelling\n * an unauthenticated registration must land somewhere public (home), not the\n * protected destination the user was *heading* to — which would only bounce\n * them back to this page.\n */\n cancelPath?: string;\n /**\n * Render the form even though `settings.registrationAllowed` is `false`.\n *\n * For a visitor the application has already vouched for out of band - an\n * invitation link, a signup code - who would otherwise meet the closed\n * alert and stop. Presentation only: the server decides, through the\n * realm's `isPreAuthorized` seam, and refuses this submit like any other if\n * {@link preAuthToken} does not hold up.\n */\n preAuthorized?: boolean;\n /**\n * Pre-fill the email field and stop it being edited.\n *\n * Set it alongside {@link preAuthToken}, which is bound to one address:\n * letting the field be typed over only produces a server-side refusal the\n * visitor cannot act on.\n */\n lockedEmail?: string;\n /**\n * The application's opaque proof that this address may register into a\n * closed realm. Passed through to the register request untouched.\n */\n preAuthToken?: string;\n /**\n * Where a successful registration lands, overriding `?redirect=`.\n *\n * A prop rather than a URL param because the submit handler is built ONCE,\n * at mount, and closes over whatever `redirect` was then: a page that\n * decides the destination and seeds the query afterwards has already\n * missed it, and the user lands on the default with nothing to explain\n * why. A prop is read on the render that builds the handler.\n *\n * Sanitised like the query value, since the two are the same kind of thing.\n */\n redirect?: string;\n}\n\ntype Phase = \"form\" | \"verification\";\n\ninterface State {\n phase: Phase;\n intent?: RegistrationIntentResponse;\n credentials?: { identifier: string; password: string };\n}\n\nexport const AuthRegister = (props: AuthRegisterProps) => {\n const auth = useAuth();\n const userCtrl = useClient<UserController>();\n const router = useRouter();\n const { tr } = useI18n();\n const redirect = safeRedirect(props.redirect ?? router.query.redirect);\n // Surface upstream auth errors (e.g. failed OAuth callback redirects with\n // `?error=...`) — same pattern as AuthLogin. Without this the user lands on\n // a fresh-looking registration page with no clue why.\n const queryError =\n typeof router.query.error === \"string\" ? router.query.error : undefined;\n\n const [state, setState] = useState<State>({ phase: \"form\" });\n const [emailCode, setEmailCode] = useState(\"\");\n const [phoneCode, setPhoneCode] = useState(\"\");\n const [verifyError, setVerifyError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const captchaSiteKey = props.realmConfig.captchaSiteKey;\n const [captchaToken, setCaptchaToken] = useState<string | undefined>();\n const captchaRef = useRef<TurnstileWidgetHandle | null>(null);\n // The handler reads the token the widget issued last through a ref, so a\n // submit never posts a token captured by an earlier render.\n const captchaTokenRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n captchaTokenRef.current = captchaToken;\n }, [captchaToken]);\n\n const credentialsProvider = props.realmConfig.authenticationMethods.find(\n (it) => it.type === \"CREDENTIALS\",\n );\n const settings = props.realmConfig.settings;\n // The realm decides, unless the application has already vouched for this\n // particular visitor. Both halves are presentation: the gate is\n // `RegistrationService`, which refuses a submit that the seam does not\n // recognise however the form got rendered.\n const allowed =\n props.preAuthorized === true || settings.registrationAllowed !== false;\n\n const schema = useMemo(() => {\n // Optionality is decided as each field is built, because that is the only\n // thing the form reads: `FormModel` derives both the required marker and\n // the pre-submit check from `z.schema.requiredKeys(schema)`, which asks\n // whether the field is optional or defaulted.\n //\n // This used to declare every field optional and then push the configured\n // names onto the array returned by `z.schema.requiredKeys(s)` — a TypeBox\n // habit, where a JSON Schema's `required` was a live array hanging off the\n // schema. The zod implementation computes a fresh array from the shape, so\n // the pushes mutated a detached value and vanished: a realm with\n // `email: \"required\"` still rendered Email with no asterisk and let an\n // empty one through to the server.\n const names = settings.firstNameLastName === \"required\";\n const shape = {\n firstName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n username:\n settings.username === \"required\"\n ? z.text({ trim: true, pattern: settings.usernameRegExp })\n : z.text({ trim: true, pattern: settings.usernameRegExp }).optional(),\n email: settings.email === \"required\" ? z.email() : z.email().optional(),\n phoneNumber:\n settings.phoneNumber === \"required\" ? z.e164() : z.e164().optional(),\n password: z.string().min(settings.passwordPolicy?.minLength ?? 8),\n };\n\n // The runtime shape varies with the realm, but the *type* must not: every\n // consumer below reads `data.email`, `data.username` and the rest as\n // possibly-absent. Widening to the all-optional shape keeps one stable\n // type instead of a union of eight.\n return z.object(shape) as unknown as ReturnType<typeof registerFormSchema>;\n }, [settings]);\n\n const form = useForm({\n schema,\n // A locked address is the form's starting value, not a field the visitor\n // fills. It arrives before mount (the page resolves the token in its\n // loader), which is what lets `useForm` anchor it here.\n initialValues: props.lockedEmail\n ? ({ email: props.lockedEmail } as never)\n : undefined,\n handler: async (data) => {\n try {\n const intent = await userCtrl.createRegistrationIntent({\n query: { userRealmName: props.realmConfig.realmName },\n body: {\n firstName: data.firstName,\n lastName: data.lastName,\n username: data.username,\n // The locked address wins over whatever the field holds: it is\n // the one the token is bound to, and a disabled input is a\n // presentation fact rather than a guarantee.\n email: props.lockedEmail ?? data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n preAuthToken: props.preAuthToken,\n },\n });\n const identifier =\n data.username ?? props.lockedEmail ?? data.email ?? data.phoneNumber;\n if (\n intent.expectEmailVerification ||\n intent.expectPhoneVerification ||\n intent.expectCaptcha\n ) {\n setState({\n phase: \"verification\",\n intent,\n credentials: identifier\n ? { identifier, password: data.password }\n : undefined,\n });\n return;\n }\n await userCtrl.createUserFromIntent({\n body: { intentId: intent.intentId },\n });\n if (identifier && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: identifier,\n password: data.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in auth-login.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n // Turnstile tokens are single-use — force a fresh challenge so the\n // user can retry after a server-side failure.\n captchaRef.current?.reset();\n throw err;\n }\n },\n });\n\n const formState = useFormState(form, [\"error\", \"values\", \"loading\"]);\n const formError =\n formState.error && !(formState.error instanceof SchemaValidationError)\n ? formState.error.message\n : undefined;\n const passwordValue = String(formState.values?.password ?? \"\");\n\n const firstFieldId =\n (settings.firstNameLastName !== \"none\" && form.input.firstName?.props.id) ||\n (settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username?.props.id) ||\n (settings.email !== \"none\" && form.input.email?.props.id) ||\n (settings.phoneNumber !== \"none\" && form.input.phoneNumber?.props.id) ||\n form.input.password.props.id;\n\n useEffect(() => {\n if (state.phase !== \"form\" || !firstFieldId) return;\n const el = document.getElementById(\n String(firstFieldId),\n ) as HTMLInputElement | null;\n el?.focus();\n }, [state.phase, firstFieldId]);\n\n const handleVerify = async () => {\n if (!state.intent) return;\n setSubmitting(true);\n setVerifyError(null);\n try {\n await userCtrl.createUserFromIntent({\n body: {\n intentId: state.intent.intentId,\n emailCode: state.intent.expectEmailVerification\n ? emailCode\n : undefined,\n phoneCode: state.intent.expectPhoneVerification\n ? phoneCode\n : undefined,\n },\n });\n if (state.credentials && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: state.credentials.identifier,\n password: state.credentials.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in auth-login.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n setVerifyError(\n err instanceof Error\n ? err.message\n : tr(\"auth.register.verifyFailed\", {\n default: \"Verification failed\",\n }),\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n // Query appended to the \"already have an account? sign in\" link: the realm,\n // plus the post-auth redirect (`?redirect=`) so signing in returns the user\n // to wherever registering would have sent them (it's dropped otherwise).\n const realmBit = props.realmConfig.realmName\n ? `realm=${encodeURIComponent(props.realmConfig.realmName)}`\n : \"\";\n const redirectBit =\n typeof router.query.redirect === \"string\" && router.query.redirect\n ? `redirect=${encodeURIComponent(router.query.redirect)}`\n : \"\";\n const loginQ = [realmBit, redirectBit].filter(Boolean).join(\"&\");\n const realmQuery = loginQ ? `?${loginQ}` : \"\";\n\n const externalMethods = props.realmConfig.authenticationMethods.filter(\n (m) => m.type !== \"CREDENTIALS\",\n );\n const showDivider = credentialsProvider && externalMethods.length > 0;\n const isVerifying = state.phase === \"verification\" && state.intent;\n const canSubmitVerify =\n !isVerifying ||\n ((!state.intent!.expectEmailVerification || emailCode.length === 6) &&\n (!state.intent!.expectPhoneVerification || phoneCode.length === 6));\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number | undefined>(\n undefined,\n );\n useLayoutEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n setContentHeight(el.scrollHeight);\n const ro = new ResizeObserver(() => {\n setContentHeight(el.scrollHeight);\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n return (\n <Centered>\n {props.logo ?? (\n <RealmLogo\n settings={settings}\n realmName={props.realmConfig.realmName}\n />\n )}\n <Card className=\"w-full\">\n <CardContent\n className=\"overflow-hidden p-0 transition-[height] duration-300 ease-out\"\n style={\n contentHeight !== undefined ? { height: contentHeight } : undefined\n }\n >\n <div ref={contentRef}>\n <div\n key={state.phase}\n className=\"animate-in fade-in flex flex-col gap-4 px-6 duration-300\"\n >\n {isVerifying ? (\n <>\n <h2 className=\"text-center text-lg font-semibold\">\n {tr(\"auth.register.verifyTitle\", {\n default: \"Verify your account\",\n })}\n </h2>\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.verifyHint\", {\n default:\n \"Please enter the verification code(s) sent to you.\",\n })}\n </p>\n {verifyError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{verifyError}</AlertDescription>\n </Alert>\n )}\n {state.intent!.expectEmailVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"emailCode\">\n {tr(\"auth.register.emailCode\", {\n default: \"Email verification code\",\n })}\n </Label>\n <InputOTP\n id=\"emailCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={emailCode}\n onChange={setEmailCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n {state.intent!.expectPhoneVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"phoneCode\">\n {tr(\"auth.register.phoneCode\", {\n default: \"Phone verification code\",\n })}\n </Label>\n <InputOTP\n id=\"phoneCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={phoneCode}\n onChange={setPhoneCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n <Button\n onClick={handleVerify}\n loading={submitting}\n disabled={!canSubmitVerify}\n >\n {tr(\"auth.register.verifySubmit\", {\n default: \"Complete registration\",\n })}\n </Button>\n <Button\n variant=\"ghost\"\n onClick={() => setState({ phase: \"form\" })}\n >\n {tr(\"auth.register.verifyBack\", {\n default: \"Back to registration\",\n })}\n </Button>\n </>\n ) : (\n <FormPhase\n allowed={allowed}\n form={form}\n formError={formError ?? queryError}\n loading={formState.loading}\n passwordValue={passwordValue}\n settings={settings}\n realmName={props.realmConfig.realmName}\n credentialsProvider={credentialsProvider}\n externalMethods={externalMethods}\n showDivider={showDivider}\n redirect={redirect}\n loginPath={props.loginPath}\n realmQuery={realmQuery}\n auth={auth}\n captchaSiteKey={captchaSiteKey}\n captchaToken={captchaToken}\n captchaRef={captchaRef}\n onCaptchaToken={setCaptchaToken}\n message={props.message}\n lockedEmail={props.lockedEmail}\n />\n )}\n </div>\n </div>\n </CardContent>\n </Card>\n {!isVerifying && (\n <Button\n variant=\"ghost\"\n nativeButton={false}\n render={<a href={props.cancelPath ?? \"/\"} />}\n >\n {tr(\"auth.register.cancel\", { default: \"Cancel\" })}\n </Button>\n )}\n </Centered>\n );\n};\n\nconst FormPhase = (props: {\n allowed: boolean;\n form: ReturnType<typeof useForm>;\n formError: string | undefined;\n loading: boolean;\n passwordValue: string;\n settings: RealmConfig[\"settings\"];\n realmName: string;\n credentialsProvider: any;\n externalMethods: Array<{ name: string; type: string }>;\n showDivider: boolean | undefined;\n redirect: string;\n loginPath: string | undefined;\n realmQuery: string;\n auth: ReturnType<typeof useAuth>;\n captchaSiteKey?: string;\n captchaToken?: string;\n captchaRef: React.RefObject<TurnstileWidgetHandle | null>;\n onCaptchaToken: (token: string | undefined) => void;\n message?: ReactNode;\n lockedEmail?: string;\n}) => {\n const { tr } = useI18n();\n const [passwordFieldFocused, setPasswordFieldFocused] = useState(false);\n const {\n allowed,\n form,\n formError,\n passwordValue,\n settings,\n credentialsProvider,\n externalMethods,\n showDivider,\n redirect,\n realmQuery,\n } = props;\n return (\n <>\n <RealmHeader settings={settings} realmName={props.realmName} />\n {!allowed ? (\n <>\n <Alert>\n <AlertCircle className=\"size-4\" />\n <AlertDescription>\n {tr(\"auth.register.disabled\", {\n default:\n \"Registration is not available. Please contact your administrator.\",\n })}\n </AlertDescription>\n </Alert>\n <Button\n render={\n <a href={`${props.loginPath ?? \"/auth/login\"}${realmQuery}`} />\n }\n >\n {tr(\"auth.register.backToSignIn\", { default: \"Back to sign in\" })}\n </Button>\n </>\n ) : (\n <>\n {props.message && (\n <Alert>\n <Info className=\"size-4\" />\n <AlertDescription>{props.message}</AlertDescription>\n </Alert>\n )}\n {formError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{formError}</AlertDescription>\n </Alert>\n )}\n {credentialsProvider && (\n <form {...form.props} className=\"flex flex-col gap-4\">\n {settings.firstNameLastName !== \"none\" &&\n form.input.firstName &&\n form.input.lastName && (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <Control\n label={tr(\"auth.register.firstName\", {\n default: \"First name\",\n })}\n input={form.input.firstName}\n autoComplete=\"given-name\"\n />\n <Control\n label={tr(\"auth.register.lastName\", {\n default: \"Last name\",\n })}\n input={form.input.lastName}\n autoComplete=\"family-name\"\n />\n </div>\n )}\n {settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username && (\n <Control\n label={tr(\"auth.register.username\", {\n default: \"Username\",\n })}\n input={form.input.username}\n icon={iconFor(\"user\")}\n autoComplete=\"username\"\n />\n )}\n {settings.email !== \"none\" && form.input.email && (\n <Control\n label={tr(\"auth.register.email\", { default: \"Email\" })}\n description={\n props.lockedEmail\n ? tr(\"auth.register.email.locked\", {\n default: \"This is the address you were invited with.\",\n })\n : settings.verifyEmailRequired\n ? tr(\"auth.register.email.verify\", {\n default:\n \"We'll send a verification code to confirm your email.\",\n })\n : undefined\n }\n input={form.input.email}\n icon={iconFor(\"email\")}\n // Locked, not hidden: the visitor has to be able to see\n // which address they are about to create an account for,\n // and it is often not the one they would have typed. The\n // value lives in the form model rather than the DOM, so\n // disabling the input does not drop it from the submit.\n disabled={!!props.lockedEmail}\n />\n )}\n {settings.phoneNumber !== \"none\" && form.input.phoneNumber && (\n <Control\n label={tr(\"auth.register.phone\", {\n default: \"Phone number\",\n })}\n description={\n settings.verifyPhoneRequired\n ? tr(\"auth.register.phone.verify\", {\n default:\n \"We'll send a verification code to confirm your phone number.\",\n })\n : undefined\n }\n input={form.input.phoneNumber}\n icon={iconFor(\"phone\")}\n />\n )}\n {/* `onFocus`/`onBlur` bubble from the input + toggle inside —\n the rules stay visible while the user types or interacts\n with the password toggle, and only collapse once the field\n is blurred AND empty. */}\n <div\n onFocus={() => setPasswordFieldFocused(true)}\n onBlur={() => setPasswordFieldFocused(false)}\n >\n <Control\n label={tr(\"auth.register.password\", { default: \"Password\" })}\n input={form.input.password}\n password\n autoComplete=\"new-password\"\n />\n </div>\n {(passwordFieldFocused || passwordValue.length > 0) && (\n <PasswordRules\n policy={settings.passwordPolicy}\n value={passwordValue}\n />\n )}\n {props.captchaSiteKey && (\n <TurnstileWidget\n ref={props.captchaRef}\n siteKey={props.captchaSiteKey}\n onToken={props.onCaptchaToken}\n className=\"flex justify-center\"\n />\n )}\n <Button\n type=\"submit\"\n loading={props.loading}\n disabled={!!props.captchaSiteKey && !props.captchaToken}\n >\n {tr(\"auth.register.submit\", { default: \"Create account\" })}\n </Button>\n </form>\n )}\n {showDivider && (\n <div className=\"flex items-center gap-3\">\n <Separator className=\"flex-1\" />\n <span className=\"text-muted-foreground text-xs\">\n {tr(\"auth.register.or\", { default: \"OR\" })}\n </span>\n <Separator className=\"flex-1\" />\n </div>\n )}\n {externalMethods.map((method) => {\n const provider =\n method.name.charAt(0).toUpperCase() + method.name.slice(1);\n return (\n <Button\n key={method.name}\n variant=\"outline\"\n onClick={() =>\n props.auth.login(method.name as never, {\n redirect,\n realm: props.realmName,\n })\n }\n >\n <BrandIcon provider={method.name} />\n {tr(\"auth.register.continueWith\", {\n default: `Continue with ${provider}`,\n args: [provider],\n })}\n </Button>\n );\n })}\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.haveAccount\", {\n default: \"Already have an account?\",\n })}{\" \"}\n <a\n href={`${props.loginPath ?? \"/auth/login\"}${realmQuery}`}\n className=\"text-foreground underline-offset-4 hover:underline\"\n >\n {tr(\"auth.register.signIn\", { default: \"Sign in\" })}\n </a>\n </p>\n </>\n )}\n </>\n );\n};\n\nconst Centered = (props: { children: React.ReactNode }) => {\n return (\n <div className=\"flex min-h-svh flex-1 items-center justify-center p-6\">\n <div className=\"flex w-full max-w-sm flex-col items-center gap-4\">\n {props.children}\n </div>\n </div>\n );\n};\n\nconst RealmHeader = (props: {\n settings: RealmConfig[\"settings\"];\n realmName: string;\n}) => {\n const s = props.settings;\n if (!s.displayName && !s.description) return null;\n return (\n <div className=\"flex flex-col items-center gap-1\">\n {s.displayName && (\n <h2 className=\"text-center text-lg font-semibold\">{s.displayName}</h2>\n )}\n {s.description && (\n <p className=\"text-muted-foreground text-center text-sm\">\n {s.description}\n </p>\n )}\n </div>\n );\n};\n\nconst PasswordRules = (props: {\n policy: RealmConfig[\"settings\"][\"passwordPolicy\"];\n value: string;\n}) => {\n const { tr } = useI18n();\n const policy = props.policy;\n const value = props.value;\n\n const rules: { ok: boolean; label: string }[] = [];\n\n if (policy?.minLength && policy.minLength > 0) {\n rules.push({\n ok: value.length >= policy.minLength,\n label: tr(\"auth.register.password.rule.minLength\", {\n default: `At least ${policy.minLength} characters`,\n args: [String(policy.minLength)],\n }),\n });\n }\n if (policy?.requireUppercase) {\n rules.push({\n ok: /[A-Z]/.test(value),\n label: tr(\"auth.register.password.rule.uppercase\", {\n default: \"One uppercase letter\",\n }),\n });\n }\n if (policy?.requireLowercase) {\n rules.push({\n ok: /[a-z]/.test(value),\n label: tr(\"auth.register.password.rule.lowercase\", {\n default: \"One lowercase letter\",\n }),\n });\n }\n if (policy?.requireNumbers) {\n rules.push({\n ok: /[0-9]/.test(value),\n label: tr(\"auth.register.password.rule.number\", {\n default: \"One number\",\n }),\n });\n }\n if (policy?.requireSpecialCharacters) {\n rules.push({\n ok: /[^A-Za-z0-9]/.test(value),\n label: tr(\"auth.register.password.rule.special\", {\n default: \"One special character\",\n }),\n });\n }\n\n if (rules.length === 0) return null;\n\n return (\n <ul className=\"text-muted-foreground -mt-2 flex flex-col gap-1 text-xs\">\n {rules.map((rule, idx) => (\n <li\n key={idx}\n className={`flex items-center gap-1.5 ${rule.ok ? \"text-emerald-600 dark:text-emerald-400\" : \"\"}`}\n >\n {rule.ok ? (\n <Check className=\"size-3.5\" />\n ) : (\n <X className=\"size-3.5 opacity-50\" />\n )}\n <span>{rule.label}</span>\n </li>\n ))}\n </ul>\n );\n};\n\nconst RealmLogo = (props: {\n settings: RealmConfig[\"settings\"];\n realmName: string;\n}) => {\n if (!props.settings.logoUrl) return null;\n return (\n <img\n src={props.settings.logoUrl}\n alt={props.settings.displayName || props.realmName}\n className=\"bg-muted size-16 rounded-xl border object-cover shadow-sm\"\n />\n );\n};\n\n/**\n * The reference shape of the registration form, with every configurable field\n * optional.\n *\n * `AuthRegister` builds its real schema from the realm settings, so which\n * fields are optional changes per realm. This exists purely to give that\n * schema one stable TypeScript type: the handler reads `data.email`,\n * `data.username` and `data.phoneNumber` as possibly-absent regardless of what\n * a given realm requires, which is the correct type for code that has to\n * compile against all of them.\n */\nconst registerFormSchema = () =>\n z.object({\n firstName: z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: z.text({ trim: true, maxLength: 100 }).optional(),\n username: z.text({ trim: true }).optional(),\n email: z.email().optional(),\n phoneNumber: z.e164().optional(),\n password: z.string(),\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuHA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,MAAM,YAAY,OAAO,MAAM,QAAQ;CAIrE,MAAM,aACJ,OAAO,OAAO,MAAM,UAAU,WAAW,OAAO,MAAM,QAAQ,KAAA;CAEhE,MAAM,CAAC,OAAO,YAAY,SAAgB,EAAE,OAAO,OAAO,CAAC;CAC3D,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAA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ER;AAEA,MAAM,aAAa,UAGb;CACJ,IAAI,CAAC,MAAM,SAAS,SAAS,OAAO;CACpC,OACE,oBAAC,OAAD;EACE,KAAK,MAAM,SAAS;EACpB,KAAK,MAAM,SAAS,eAAe,MAAM;EACzC,WAAU;CACX,CAAA;AAEL"}
1
+ {"version":3,"file":"auth-register.js","names":[],"sources":["../../../src/components/auth/auth-register.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { BrandIcon } from \"@alepha/ui/components/brand-icon/brand-icon\";\nimport {\n TurnstileWidget,\n type TurnstileWidgetHandle,\n} from \"@alepha/ui/components/captcha/turnstile-widget\";\nimport { iconFor } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Control } from \"@alepha/ui/components/control/control\";\nimport { Alert, AlertDescription } from \"@alepha/ui/components/ui/alert\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Card, CardContent } from \"@alepha/ui/components/ui/card\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSeparator,\n InputOTPSlot,\n} from \"@alepha/ui/components/ui/input-otp\";\nimport { Label } from \"@alepha/ui/components/ui/label\";\nimport { Separator } from \"@alepha/ui/components/ui/separator\";\nimport { SchemaValidationError, z } from \"alepha\";\nimport type {\n RealmConfig,\n RegistrationIntentResponse,\n UserController,\n} from \"alepha/api/users\";\nimport { useClient } from \"alepha/react\";\nimport { useAuth } from \"alepha/react/auth\";\nimport { useForm, useFormState } from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { useRouter } from \"alepha/react/router\";\nimport { AlertCircle, Check, Info, X } from \"lucide-react\";\nimport {\n type ReactNode,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\n\nimport { safeRedirect } from \"./safe-redirect.ts\";\n\nexport interface AuthRegisterProps {\n /**\n * Realm configuration (drives required fields, verification step, OAuth buttons).\n */\n realmConfig: RealmConfig;\n /**\n * Custom logo node, rendered above the form. When provided, it replaces\n * the default `settings.logoUrl` <img>. Use this to inject a branded\n * component (e.g. with light/dark variants or an animation).\n */\n logo?: ReactNode;\n /**\n * Route to the login page. When set, a \"Sign in\" link is shown.\n */\n loginPath?: string;\n /**\n * Optional banner rendered above the registration form (form phase only).\n * Used to contextualize the flow when the user arrives via a CTA, e.g.\n * \"Before creating a campaign, create an account.\"\n */\n message?: ReactNode;\n /**\n * Where the \"Cancel\" button abandons to. Defaults to \"/\". This is\n * intentionally decoupled from the post-auth `?redirect=` target: cancelling\n * an unauthenticated registration must land somewhere public (home), not the\n * protected destination the user was *heading* to — which would only bounce\n * them back to this page.\n */\n cancelPath?: string;\n /**\n * Render the form even though `settings.registrationAllowed` is `false`.\n *\n * For a visitor the application has already vouched for out of band - an\n * invitation link, a signup code - who would otherwise meet the closed\n * alert and stop. Presentation only: the server decides, through the\n * realm's `isPreAuthorized` seam, and refuses this submit like any other if\n * {@link preAuthToken} does not hold up.\n */\n preAuthorized?: boolean;\n /**\n * Pre-fill the email field and stop it being edited.\n *\n * Set it alongside {@link preAuthToken}, which is bound to one address:\n * letting the field be typed over only produces a server-side refusal the\n * visitor cannot act on.\n */\n lockedEmail?: string;\n /**\n * The application's opaque proof that this address may register into a\n * closed realm. Passed through to the register request untouched.\n */\n preAuthToken?: string;\n /**\n * Where a successful registration lands, overriding `?redirect=`.\n *\n * A prop rather than a URL param because the submit handler is built ONCE,\n * at mount, and closes over whatever `redirect` was then: a page that\n * decides the destination and seeds the query afterwards has already\n * missed it, and the user lands on the default with nothing to explain\n * why. A prop is read on the render that builds the handler.\n *\n * Sanitised like the query value, since the two are the same kind of thing.\n */\n redirect?: string;\n}\n\ntype Phase = \"form\" | \"verification\";\n\ninterface State {\n phase: Phase;\n intent?: RegistrationIntentResponse;\n credentials?: { identifier: string; password: string };\n}\n\nexport const AuthRegister = (props: AuthRegisterProps) => {\n const auth = useAuth();\n const userCtrl = useClient<UserController>();\n const router = useRouter();\n const { tr } = useI18n();\n const redirect = safeRedirect(props.redirect ?? router.query.redirect);\n // Surface upstream auth errors (e.g. failed OAuth callback redirects with\n // `?error=...`) — same pattern as AuthLogin. Without this the user lands on\n // a fresh-looking registration page with no clue why.\n const queryError =\n typeof router.query.error === \"string\" ? router.query.error : undefined;\n\n const [state, setState] = useState<State>({ phase: \"form\" });\n const [emailCode, setEmailCode] = useState(\"\");\n const [phoneCode, setPhoneCode] = useState(\"\");\n const [verifyError, setVerifyError] = useState<string | null>(null);\n const [submitting, setSubmitting] = useState(false);\n\n const captchaSiteKey = props.realmConfig.captchaSiteKey;\n const [captchaToken, setCaptchaToken] = useState<string | undefined>();\n const captchaRef = useRef<TurnstileWidgetHandle | null>(null);\n // The handler reads the token the widget issued last through a ref, so a\n // submit never posts a token captured by an earlier render.\n const captchaTokenRef = useRef<string | undefined>(undefined);\n useEffect(() => {\n captchaTokenRef.current = captchaToken;\n }, [captchaToken]);\n\n const credentialsProvider = props.realmConfig.authenticationMethods.find(\n (it) => it.type === \"CREDENTIALS\",\n );\n const settings = props.realmConfig.settings;\n // The realm decides, unless the application has already vouched for this\n // particular visitor. Both halves are presentation: the gate is\n // `RegistrationService`, which refuses a submit that the seam does not\n // recognise however the form got rendered.\n const allowed =\n props.preAuthorized === true || settings.registrationAllowed !== false;\n\n const schema = useMemo(() => {\n // Optionality is decided as each field is built, because that is the only\n // thing the form reads: `FormModel` derives both the required marker and\n // the pre-submit check from `z.schema.requiredKeys(schema)`, which asks\n // whether the field is optional or defaulted.\n //\n // This used to declare every field optional and then push the configured\n // names onto the array returned by `z.schema.requiredKeys(s)` — a TypeBox\n // habit, where a JSON Schema's `required` was a live array hanging off the\n // schema. The zod implementation computes a fresh array from the shape, so\n // the pushes mutated a detached value and vanished: a realm with\n // `email: \"required\"` still rendered Email with no asterisk and let an\n // empty one through to the server.\n const names = settings.firstNameLastName === \"required\";\n const shape = {\n firstName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: names\n ? z.text({ trim: true, maxLength: 100 })\n : z.text({ trim: true, maxLength: 100 }).optional(),\n username:\n settings.username === \"required\"\n ? z.text({ trim: true, pattern: settings.usernameRegExp })\n : z.text({ trim: true, pattern: settings.usernameRegExp }).optional(),\n email: settings.email === \"required\" ? z.email() : z.email().optional(),\n phoneNumber:\n settings.phoneNumber === \"required\" ? z.e164() : z.e164().optional(),\n password: z.string().min(settings.passwordPolicy?.minLength ?? 8),\n };\n\n // The runtime shape varies with the realm, but the *type* must not: every\n // consumer below reads `data.email`, `data.username` and the rest as\n // possibly-absent. Widening to the all-optional shape keeps one stable\n // type instead of a union of eight.\n return z.object(shape) as unknown as ReturnType<typeof registerFormSchema>;\n }, [settings]);\n\n const form = useForm({\n schema,\n // A locked address is the form's starting value, not a field the visitor\n // fills. It arrives before mount (the page resolves the token in its\n // loader), which is what lets `useForm` anchor it here.\n initialValues: props.lockedEmail\n ? ({ email: props.lockedEmail } as never)\n : undefined,\n handler: async (data) => {\n try {\n const intent = await userCtrl.createRegistrationIntent({\n query: { userRealmName: props.realmConfig.realmName },\n body: {\n firstName: data.firstName,\n lastName: data.lastName,\n username: data.username,\n // The locked address wins over whatever the field holds: it is\n // the one the token is bound to, and a disabled input is a\n // presentation fact rather than a guarantee.\n email: props.lockedEmail ?? data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n preAuthToken: props.preAuthToken,\n },\n });\n const identifier =\n data.username ?? props.lockedEmail ?? data.email ?? data.phoneNumber;\n if (\n intent.expectEmailVerification ||\n intent.expectPhoneVerification ||\n intent.expectCaptcha\n ) {\n setState({\n phase: \"verification\",\n intent,\n credentials: identifier\n ? { identifier, password: data.password }\n : undefined,\n });\n return;\n }\n await userCtrl.createUserFromIntent({\n body: { intentId: intent.intentId },\n });\n if (identifier && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: identifier,\n password: data.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in auth-login.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n // Turnstile tokens are single-use — force a fresh challenge so the\n // user can retry after a server-side failure.\n captchaRef.current?.reset();\n throw err;\n }\n },\n });\n\n const formState = useFormState(form, [\"error\", \"values\", \"loading\"]);\n const formError =\n formState.error && !(formState.error instanceof SchemaValidationError)\n ? formState.error.message\n : undefined;\n const passwordValue = String(formState.values?.password ?? \"\");\n\n const firstFieldId =\n (settings.firstNameLastName !== \"none\" && form.input.firstName?.props.id) ||\n (settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username?.props.id) ||\n (settings.email !== \"none\" && form.input.email?.props.id) ||\n (settings.phoneNumber !== \"none\" && form.input.phoneNumber?.props.id) ||\n form.input.password.props.id;\n\n useEffect(() => {\n if (state.phase !== \"form\" || !firstFieldId) return;\n const el = document.getElementById(\n String(firstFieldId),\n ) as HTMLInputElement | null;\n el?.focus();\n }, [state.phase, firstFieldId]);\n\n const handleVerify = async () => {\n if (!state.intent) return;\n setSubmitting(true);\n setVerifyError(null);\n try {\n await userCtrl.createUserFromIntent({\n body: {\n intentId: state.intent.intentId,\n emailCode: state.intent.expectEmailVerification\n ? emailCode\n : undefined,\n phoneCode: state.intent.expectPhoneVerification\n ? phoneCode\n : undefined,\n },\n });\n if (state.credentials && credentialsProvider) {\n await auth.login(credentialsProvider.name, {\n username: state.credentials.identifier,\n password: state.credentials.password,\n realm: props.realmConfig.realmName,\n });\n }\n // `force: true` so parent-layout loaders re-run against the freshly\n // authenticated user — see the note in auth-login.tsx.\n await router.push(redirect, { force: true });\n } catch (err) {\n setVerifyError(\n err instanceof Error\n ? err.message\n : tr(\"auth.register.verifyFailed\", {\n default: \"Verification failed\",\n }),\n );\n } finally {\n setSubmitting(false);\n }\n };\n\n // Query appended to the \"already have an account? sign in\" link: the realm,\n // plus the post-auth redirect (`?redirect=`) so signing in returns the user\n // to wherever registering would have sent them (it's dropped otherwise).\n const realmBit = props.realmConfig.realmName\n ? `realm=${encodeURIComponent(props.realmConfig.realmName)}`\n : \"\";\n const redirectBit =\n typeof router.query.redirect === \"string\" && router.query.redirect\n ? `redirect=${encodeURIComponent(router.query.redirect)}`\n : \"\";\n const loginQ = [realmBit, redirectBit].filter(Boolean).join(\"&\");\n const realmQuery = loginQ ? `?${loginQ}` : \"\";\n\n const externalMethods = props.realmConfig.authenticationMethods.filter(\n (m) => m.type !== \"CREDENTIALS\",\n );\n const showDivider = credentialsProvider && externalMethods.length > 0;\n const isVerifying = state.phase === \"verification\" && state.intent;\n const canSubmitVerify =\n !isVerifying ||\n ((!state.intent!.expectEmailVerification || emailCode.length === 6) &&\n (!state.intent!.expectPhoneVerification || phoneCode.length === 6));\n\n const contentRef = useRef<HTMLDivElement>(null);\n const [contentHeight, setContentHeight] = useState<number | undefined>(\n undefined,\n );\n useLayoutEffect(() => {\n const el = contentRef.current;\n if (!el) return;\n setContentHeight(el.scrollHeight);\n const ro = new ResizeObserver(() => {\n setContentHeight(el.scrollHeight);\n });\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n\n return (\n <Centered>\n {props.logo ?? (\n <RealmLogo\n settings={settings}\n realmName={props.realmConfig.realmName}\n />\n )}\n <Card className=\"w-full\">\n <CardContent\n className=\"overflow-hidden p-0 transition-[height] duration-300 ease-out\"\n style={\n contentHeight !== undefined ? { height: contentHeight } : undefined\n }\n >\n <div ref={contentRef}>\n <div\n key={state.phase}\n className=\"animate-in fade-in flex flex-col gap-4 px-6 duration-300\"\n >\n {isVerifying ? (\n <>\n <h2 className=\"text-center text-lg font-semibold\">\n {tr(\"auth.register.verifyTitle\", {\n default: \"Verify your account\",\n })}\n </h2>\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.verifyHint\", {\n default:\n \"Please enter the verification code(s) sent to you.\",\n })}\n </p>\n {verifyError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{verifyError}</AlertDescription>\n </Alert>\n )}\n {state.intent!.expectEmailVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"emailCode\">\n {tr(\"auth.register.emailCode\", {\n default: \"Email verification code\",\n })}\n </Label>\n <InputOTP\n id=\"emailCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={emailCode}\n onChange={setEmailCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n {state.intent!.expectPhoneVerification && (\n <div className=\"flex flex-col items-center gap-2\">\n <Label htmlFor=\"phoneCode\">\n {tr(\"auth.register.phoneCode\", {\n default: \"Phone verification code\",\n })}\n </Label>\n <InputOTP\n id=\"phoneCode\"\n maxLength={6}\n autoComplete=\"one-time-code\"\n\n value={phoneCode}\n onChange={setPhoneCode}\n >\n <InputOTPGroup>\n <InputOTPSlot index={0} />\n <InputOTPSlot index={1} />\n <InputOTPSlot index={2} />\n </InputOTPGroup>\n <InputOTPSeparator />\n <InputOTPGroup>\n <InputOTPSlot index={3} />\n <InputOTPSlot index={4} />\n <InputOTPSlot index={5} />\n </InputOTPGroup>\n </InputOTP>\n </div>\n )}\n <Button\n onClick={handleVerify}\n loading={submitting}\n disabled={!canSubmitVerify}\n >\n {tr(\"auth.register.verifySubmit\", {\n default: \"Complete registration\",\n })}\n </Button>\n <Button\n variant=\"ghost\"\n onClick={() => setState({ phase: \"form\" })}\n >\n {tr(\"auth.register.verifyBack\", {\n default: \"Back to registration\",\n })}\n </Button>\n </>\n ) : (\n <FormPhase\n allowed={allowed}\n form={form}\n formError={formError ?? queryError}\n loading={formState.loading}\n passwordValue={passwordValue}\n settings={settings}\n realmName={props.realmConfig.realmName}\n credentialsProvider={credentialsProvider}\n externalMethods={externalMethods}\n showDivider={showDivider}\n redirect={redirect}\n loginPath={props.loginPath}\n realmQuery={realmQuery}\n auth={auth}\n captchaSiteKey={captchaSiteKey}\n captchaToken={captchaToken}\n captchaRef={captchaRef}\n onCaptchaToken={setCaptchaToken}\n message={props.message}\n lockedEmail={props.lockedEmail}\n />\n )}\n </div>\n </div>\n </CardContent>\n </Card>\n {!isVerifying && (\n <Button\n variant=\"ghost\"\n nativeButton={false}\n render={<a href={props.cancelPath ?? \"/\"} />}\n >\n {tr(\"auth.register.cancel\", { default: \"Cancel\" })}\n </Button>\n )}\n </Centered>\n );\n};\n\nconst FormPhase = (props: {\n allowed: boolean;\n form: ReturnType<typeof useForm>;\n formError: string | undefined;\n loading: boolean;\n passwordValue: string;\n settings: RealmConfig[\"settings\"];\n realmName: string;\n credentialsProvider: any;\n externalMethods: Array<{ name: string; type: string }>;\n showDivider: boolean | undefined;\n redirect: string;\n loginPath: string | undefined;\n realmQuery: string;\n auth: ReturnType<typeof useAuth>;\n captchaSiteKey?: string;\n captchaToken?: string;\n captchaRef: React.RefObject<TurnstileWidgetHandle | null>;\n onCaptchaToken: (token: string | undefined) => void;\n message?: ReactNode;\n lockedEmail?: string;\n}) => {\n const { tr } = useI18n();\n const [passwordFieldFocused, setPasswordFieldFocused] = useState(false);\n const {\n allowed,\n form,\n formError,\n passwordValue,\n settings,\n credentialsProvider,\n externalMethods,\n showDivider,\n redirect,\n realmQuery,\n } = props;\n return (\n <>\n <RealmHeader settings={settings} realmName={props.realmName} />\n {!allowed ? (\n <>\n <Alert>\n <AlertCircle className=\"size-4\" />\n <AlertDescription>\n {tr(\"auth.register.disabled\", {\n default:\n \"Registration is not available. Please contact your administrator.\",\n })}\n </AlertDescription>\n </Alert>\n <Button\n render={\n <a href={`${props.loginPath ?? \"/auth/login\"}${realmQuery}`} />\n }\n >\n {tr(\"auth.register.backToSignIn\", { default: \"Back to sign in\" })}\n </Button>\n </>\n ) : (\n <>\n {props.message && (\n <Alert>\n <Info className=\"size-4\" />\n <AlertDescription>{props.message}</AlertDescription>\n </Alert>\n )}\n {formError && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{formError}</AlertDescription>\n </Alert>\n )}\n {credentialsProvider && (\n <form {...form.props} className=\"flex flex-col gap-4\">\n {settings.firstNameLastName !== \"none\" &&\n form.input.firstName &&\n form.input.lastName && (\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2\">\n <Control\n label={tr(\"auth.register.firstName\", {\n default: \"First name\",\n })}\n input={form.input.firstName}\n autoComplete=\"given-name\"\n />\n <Control\n label={tr(\"auth.register.lastName\", {\n default: \"Last name\",\n })}\n input={form.input.lastName}\n autoComplete=\"family-name\"\n />\n </div>\n )}\n {settings.username !== \"none\" &&\n settings.username !== \"email\" &&\n form.input.username && (\n <Control\n label={tr(\"auth.register.username\", {\n default: \"Username\",\n })}\n input={form.input.username}\n icon={iconFor(\"user\")}\n autoComplete=\"username\"\n />\n )}\n {settings.email !== \"none\" && form.input.email && (\n <Control\n label={tr(\"auth.register.email\", { default: \"Email\" })}\n description={\n props.lockedEmail\n ? tr(\"auth.register.email.locked\", {\n default: \"This is the address you were invited with.\",\n })\n : settings.verifyEmailRequired\n ? tr(\"auth.register.email.verify\", {\n default:\n \"We'll send a verification code to confirm your email.\",\n })\n : undefined\n }\n input={form.input.email}\n icon={iconFor(\"email\")}\n // Locked, not hidden: the visitor has to be able to see\n // which address they are about to create an account for,\n // and it is often not the one they would have typed. The\n // value lives in the form model rather than the DOM, so\n // disabling the input does not drop it from the submit.\n disabled={!!props.lockedEmail}\n />\n )}\n {settings.phoneNumber !== \"none\" && form.input.phoneNumber && (\n <Control\n label={tr(\"auth.register.phone\", {\n default: \"Phone number\",\n })}\n description={\n settings.verifyPhoneRequired\n ? tr(\"auth.register.phone.verify\", {\n default:\n \"We'll send a verification code to confirm your phone number.\",\n })\n : undefined\n }\n input={form.input.phoneNumber}\n icon={iconFor(\"phone\")}\n />\n )}\n {/* `onFocus`/`onBlur` bubble from the input + toggle inside —\n the rules stay visible while the user types or interacts\n with the password toggle, and only collapse once the field\n is blurred AND empty. */}\n <div\n onFocus={() => setPasswordFieldFocused(true)}\n onBlur={() => setPasswordFieldFocused(false)}\n >\n <Control\n label={tr(\"auth.register.password\", { default: \"Password\" })}\n input={form.input.password}\n password\n autoComplete=\"new-password\"\n />\n </div>\n {(passwordFieldFocused || passwordValue.length > 0) && (\n <PasswordRules\n policy={settings.passwordPolicy}\n value={passwordValue}\n />\n )}\n {props.captchaSiteKey && (\n <TurnstileWidget\n ref={props.captchaRef}\n siteKey={props.captchaSiteKey}\n onToken={props.onCaptchaToken}\n className=\"flex justify-center\"\n />\n )}\n <Button\n type=\"submit\"\n loading={props.loading}\n disabled={!!props.captchaSiteKey && !props.captchaToken}\n >\n {tr(\"auth.register.submit\", { default: \"Create account\" })}\n </Button>\n </form>\n )}\n {showDivider && (\n <div className=\"flex items-center gap-3\">\n <Separator className=\"flex-1\" />\n <span className=\"text-muted-foreground text-xs\">\n {tr(\"auth.register.or\", { default: \"OR\" })}\n </span>\n <Separator className=\"flex-1\" />\n </div>\n )}\n {externalMethods.map((method) => {\n const provider =\n method.name.charAt(0).toUpperCase() + method.name.slice(1);\n return (\n <Button\n key={method.name}\n variant=\"outline\"\n onClick={() =>\n props.auth.login(method.name as never, {\n redirect,\n realm: props.realmName,\n })\n }\n >\n <BrandIcon provider={method.name} />\n {tr(\"auth.register.continueWith\", {\n default: `Continue with ${provider}`,\n args: [provider],\n })}\n </Button>\n );\n })}\n <p className=\"text-muted-foreground text-center text-sm\">\n {tr(\"auth.register.haveAccount\", {\n default: \"Already have an account?\",\n })}{\" \"}\n <a\n href={`${props.loginPath ?? \"/auth/login\"}${realmQuery}`}\n className=\"text-foreground underline-offset-4 hover:underline\"\n >\n {tr(\"auth.register.signIn\", { default: \"Sign in\" })}\n </a>\n </p>\n </>\n )}\n </>\n );\n};\n\nconst Centered = (props: { children: React.ReactNode }) => {\n return (\n <div className=\"flex min-h-svh flex-1 items-center justify-center p-6\">\n <div className=\"flex w-full max-w-sm flex-col items-center gap-4\">\n {props.children}\n </div>\n </div>\n );\n};\n\nconst RealmHeader = (props: {\n settings: RealmConfig[\"settings\"];\n realmName: string;\n}) => {\n const s = props.settings;\n if (!s.displayName && !s.description) return null;\n return (\n <div className=\"flex flex-col items-center gap-1\">\n {s.displayName && (\n <h2 className=\"text-center text-lg font-semibold\">{s.displayName}</h2>\n )}\n {s.description && (\n <p className=\"text-muted-foreground text-center text-sm\">\n {s.description}\n </p>\n )}\n </div>\n );\n};\n\nconst PasswordRules = (props: {\n policy: RealmConfig[\"settings\"][\"passwordPolicy\"];\n value: string;\n}) => {\n const { tr } = useI18n();\n const policy = props.policy;\n const value = props.value;\n\n const rules: { ok: boolean; label: string }[] = [];\n\n if (policy?.minLength && policy.minLength > 0) {\n rules.push({\n ok: value.length >= policy.minLength,\n label: tr(\"auth.register.password.rule.minLength\", {\n default: `At least ${policy.minLength} characters`,\n args: [String(policy.minLength)],\n }),\n });\n }\n if (policy?.requireUppercase) {\n rules.push({\n ok: /[A-Z]/.test(value),\n label: tr(\"auth.register.password.rule.uppercase\", {\n default: \"One uppercase letter\",\n }),\n });\n }\n if (policy?.requireLowercase) {\n rules.push({\n ok: /[a-z]/.test(value),\n label: tr(\"auth.register.password.rule.lowercase\", {\n default: \"One lowercase letter\",\n }),\n });\n }\n if (policy?.requireNumbers) {\n rules.push({\n ok: /[0-9]/.test(value),\n label: tr(\"auth.register.password.rule.number\", {\n default: \"One number\",\n }),\n });\n }\n if (policy?.requireSpecialCharacters) {\n rules.push({\n ok: /[^A-Za-z0-9]/.test(value),\n label: tr(\"auth.register.password.rule.special\", {\n default: \"One special character\",\n }),\n });\n }\n\n if (rules.length === 0) return null;\n\n return (\n <ul className=\"text-muted-foreground -mt-2 flex flex-col gap-1 text-xs\">\n {rules.map((rule, idx) => (\n <li\n key={idx}\n className={`flex items-center gap-1.5 ${rule.ok ? \"text-emerald-600 dark:text-emerald-400\" : \"\"}`}\n >\n {rule.ok ? (\n <Check className=\"size-3.5\" />\n ) : (\n <X className=\"size-3.5 opacity-50\" />\n )}\n <span>{rule.label}</span>\n </li>\n ))}\n </ul>\n );\n};\n\nconst RealmLogo = (props: {\n settings: RealmConfig[\"settings\"];\n realmName: string;\n}) => {\n if (!props.settings.logoUrl) return null;\n return (\n <img\n src={props.settings.logoUrl}\n alt={props.settings.displayName || props.realmName}\n className=\"bg-muted size-16 rounded-xl border object-cover shadow-sm\"\n />\n );\n};\n\n/**\n * The reference shape of the registration form, with every configurable field\n * optional.\n *\n * `AuthRegister` builds its real schema from the realm settings, so which\n * fields are optional changes per realm. This exists purely to give that\n * schema one stable TypeScript type: the handler reads `data.email`,\n * `data.username` and `data.phoneNumber` as possibly-absent regardless of what\n * a given realm requires, which is the correct type for code that has to\n * compile against all of them.\n */\nconst registerFormSchema = () =>\n z.object({\n firstName: z.text({ trim: true, maxLength: 100 }).optional(),\n lastName: z.text({ trim: true, maxLength: 100 }).optional(),\n username: z.text({ trim: true }).optional(),\n email: z.email().optional(),\n phoneNumber: z.e164().optional(),\n password: z.string(),\n });\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuHA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,MAAM,YAAY,OAAO,MAAM,QAAQ;CAIrE,MAAM,aACJ,OAAO,OAAO,MAAM,UAAU,WAAW,OAAO,MAAM,QAAQ,KAAA;CAEhE,MAAM,CAAC,OAAO,YAAY,SAAgB,EAAE,OAAO,OAAO,CAAC;CAC3D,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;CAC7C,MAAM,CAAC,aAAa,kBAAkB,SAAwB,IAAI;CAClE,MAAM,CAAC,YAAY,iBAAiB,SAAS,KAAK;C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