@alepha/ui 0.27.0 → 0.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (542) hide show
  1. package/README.md +56 -15
  2. package/dist/components/account/account-connections.d.ts.map +1 -1
  3. package/dist/components/account/account-connections.js +24 -13
  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 -8
  7. package/dist/components/account/account-delete-dialog.js.map +1 -1
  8. package/dist/components/account/account-header.d.ts.map +1 -1
  9. package/dist/components/account/account-header.js +3 -1
  10. package/dist/components/account/account-header.js.map +1 -1
  11. package/dist/components/account/account-keys.d.ts.map +1 -1
  12. package/dist/components/account/account-keys.js +35 -21
  13. package/dist/components/account/account-keys.js.map +1 -1
  14. package/dist/components/account/account-mfa-dialog.d.ts +20 -0
  15. package/dist/components/account/account-mfa-dialog.d.ts.map +1 -0
  16. package/dist/components/account/account-mfa-dialog.js +149 -0
  17. package/dist/components/account/account-mfa-dialog.js.map +1 -0
  18. package/dist/components/account/account-password-dialog.d.ts.map +1 -1
  19. package/dist/components/account/account-password-dialog.js +15 -10
  20. package/dist/components/account/account-password-dialog.js.map +1 -1
  21. package/dist/components/account/account-profile.d.ts.map +1 -1
  22. package/dist/components/account/account-profile.js +25 -25
  23. package/dist/components/account/account-profile.js.map +1 -1
  24. package/dist/components/account/account-router.d.ts +76 -2
  25. package/dist/components/account/account-router.d.ts.map +1 -1
  26. package/dist/components/account/account-router.js +44 -4
  27. package/dist/components/account/account-router.js.map +1 -1
  28. package/dist/components/account/account-security.d.ts +11 -1
  29. package/dist/components/account/account-security.d.ts.map +1 -1
  30. package/dist/components/account/account-security.js +119 -32
  31. package/dist/components/account/account-security.js.map +1 -1
  32. package/dist/components/account/account-sessions.d.ts.map +1 -1
  33. package/dist/components/account/account-sessions.js +46 -24
  34. package/dist/components/account/account-sessions.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 +4 -9
  37. package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
  38. package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
  39. package/dist/components/admin/admin-jobs-status-badge.js +3 -3
  40. package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
  41. package/dist/components/admin/admin-jobs-status-labels.d.ts +26 -0
  42. package/dist/components/admin/admin-jobs-status-labels.d.ts.map +1 -0
  43. package/dist/components/admin/admin-jobs-status-labels.js +46 -0
  44. package/dist/components/admin/admin-jobs-status-labels.js.map +1 -0
  45. package/dist/components/admin/admin-layout.d.ts.map +1 -1
  46. package/dist/components/admin/admin-layout.js +5 -3
  47. package/dist/components/admin/admin-layout.js.map +1 -1
  48. package/dist/components/admin/admin-notifications-detail-tabs.d.ts +21 -0
  49. package/dist/components/admin/admin-notifications-detail-tabs.d.ts.map +1 -0
  50. package/dist/components/admin/admin-notifications-detail-tabs.js +122 -0
  51. package/dist/components/admin/admin-notifications-detail-tabs.js.map +1 -0
  52. package/dist/components/admin/admin-notifications-detail.d.ts +23 -0
  53. package/dist/components/admin/admin-notifications-detail.d.ts.map +1 -0
  54. package/dist/components/admin/admin-notifications-detail.js +48 -0
  55. package/dist/components/admin/admin-notifications-detail.js.map +1 -0
  56. package/dist/components/admin/admin-notifications-preview-body.d.ts +13 -0
  57. package/dist/components/admin/admin-notifications-preview-body.d.ts.map +1 -0
  58. package/dist/components/admin/admin-notifications-preview-body.js +64 -0
  59. package/dist/components/admin/admin-notifications-preview-body.js.map +1 -0
  60. package/dist/components/admin/admin-notifications-preview-tab.d.ts +24 -0
  61. package/dist/components/admin/admin-notifications-preview-tab.d.ts.map +1 -0
  62. package/dist/components/admin/admin-notifications-preview-tab.js +35 -0
  63. package/dist/components/admin/admin-notifications-preview-tab.js.map +1 -0
  64. package/dist/components/admin/admin-notifications-raw-tab.d.ts +18 -0
  65. package/dist/components/admin/admin-notifications-raw-tab.d.ts.map +1 -0
  66. package/dist/components/admin/admin-notifications-raw-tab.js +53 -0
  67. package/dist/components/admin/admin-notifications-raw-tab.js.map +1 -0
  68. package/dist/components/admin/admin-notifications-status-badge.d.ts +17 -0
  69. package/dist/components/admin/admin-notifications-status-badge.d.ts.map +1 -0
  70. package/dist/components/admin/admin-notifications-status-badge.js +32 -0
  71. package/dist/components/admin/admin-notifications-status-badge.js.map +1 -0
  72. package/dist/components/admin/admin-notifications-status-labels.d.ts +17 -0
  73. package/dist/components/admin/admin-notifications-status-labels.d.ts.map +1 -0
  74. package/dist/components/admin/admin-notifications-status-labels.js +33 -0
  75. package/dist/components/admin/admin-notifications-status-labels.js.map +1 -0
  76. package/dist/components/admin/admin-notifications-status-tones.d.ts +44 -0
  77. package/dist/components/admin/admin-notifications-status-tones.d.ts.map +1 -0
  78. package/dist/components/admin/admin-notifications-status-tones.js +64 -0
  79. package/dist/components/admin/admin-notifications-status-tones.js.map +1 -0
  80. package/dist/components/admin/admin-notifications-template-label.d.ts +16 -0
  81. package/dist/components/admin/admin-notifications-template-label.d.ts.map +1 -0
  82. package/dist/components/admin/admin-notifications-template-label.js +24 -0
  83. package/dist/components/admin/admin-notifications-template-label.js.map +1 -0
  84. package/dist/components/admin/admin-notifications.d.ts +13 -2
  85. package/dist/components/admin/admin-notifications.d.ts.map +1 -1
  86. package/dist/components/admin/admin-notifications.js +264 -29
  87. package/dist/components/admin/admin-notifications.js.map +1 -1
  88. package/dist/components/admin/admin-router.d.ts +29 -2
  89. package/dist/components/admin/admin-router.d.ts.map +1 -1
  90. package/dist/components/admin/admin-router.js +68 -8
  91. package/dist/components/admin/admin-router.js.map +1 -1
  92. package/dist/components/admin/admin-sessions.d.ts.map +1 -1
  93. package/dist/components/admin/admin-sessions.js +1 -1
  94. package/dist/components/admin/admin-sessions.js.map +1 -1
  95. package/dist/components/admin/admin-user-detail-security-tab.d.ts +12 -2
  96. package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
  97. package/dist/components/admin/admin-user-detail-security-tab.js +63 -44
  98. package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
  99. package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
  100. package/dist/components/admin/admin-user-detail-sessions-tab.js +1 -1
  101. package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
  102. package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
  103. package/dist/components/admin/admin-user-detail.js +20 -15
  104. package/dist/components/admin/admin-user-detail.js.map +1 -1
  105. package/dist/components/admin/admin-users.js +1 -1
  106. package/dist/components/admin/admin-users.js.map +1 -1
  107. package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
  108. package/dist/components/admin/admin-workflows-executions-panel.js +4 -12
  109. package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
  110. package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
  111. package/dist/components/admin/admin-workflows-status-badge.js +3 -3
  112. package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
  113. package/dist/components/admin/admin-workflows-status-labels.d.ts +19 -0
  114. package/dist/components/admin/admin-workflows-status-labels.d.ts.map +1 -0
  115. package/dist/components/admin/admin-workflows-status-labels.js +48 -0
  116. package/dist/components/admin/admin-workflows-status-labels.js.map +1 -0
  117. package/dist/components/alepha-table/alepha-table.d.ts +6 -0
  118. package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
  119. package/dist/components/alepha-table/alepha-table.js +33 -5
  120. package/dist/components/alepha-table/alepha-table.js.map +1 -1
  121. package/dist/components/auth/auth-login.d.ts.map +1 -1
  122. package/dist/components/auth/auth-login.js +27 -17
  123. package/dist/components/auth/auth-login.js.map +1 -1
  124. package/dist/components/auth/auth-mfa-step.d.ts +25 -0
  125. package/dist/components/auth/auth-mfa-step.d.ts.map +1 -0
  126. package/dist/components/auth/auth-mfa-step.js +122 -0
  127. package/dist/components/auth/auth-mfa-step.js.map +1 -0
  128. package/dist/components/auth/auth-register.js +2 -2
  129. package/dist/components/auth/auth-register.js.map +1 -1
  130. package/dist/components/auth/auth-reset-password.js +2 -2
  131. package/dist/components/auth/auth-router.d.ts +20 -0
  132. package/dist/components/auth/auth-router.d.ts.map +1 -1
  133. package/dist/components/auth/provider-labels.d.ts.map +1 -1
  134. package/dist/components/auth/provider-labels.js +1 -0
  135. package/dist/components/auth/provider-labels.js.map +1 -1
  136. package/dist/components/control/control.d.ts +11 -2
  137. package/dist/components/control/control.d.ts.map +1 -1
  138. package/dist/components/control/control.js +7 -2
  139. package/dist/components/control/control.js.map +1 -1
  140. package/dist/components/control-array/control-array.d.ts.map +1 -1
  141. package/dist/components/control-array/control-array.js +55 -10
  142. package/dist/components/control-array/control-array.js.map +1 -1
  143. package/dist/components/control-number/control-number.d.ts +5 -0
  144. package/dist/components/control-number/control-number.d.ts.map +1 -1
  145. package/dist/components/control-number/control-number.js +1 -0
  146. package/dist/components/control-number/control-number.js.map +1 -1
  147. package/dist/components/control-object/control-object.d.ts +12 -1
  148. package/dist/components/control-object/control-object.d.ts.map +1 -1
  149. package/dist/components/control-object/control-object.js +2 -1
  150. package/dist/components/control-object/control-object.js.map +1 -1
  151. package/dist/components/control-password/control-password.d.ts.map +1 -1
  152. package/dist/components/control-password/control-password.js +1 -0
  153. package/dist/components/control-password/control-password.js.map +1 -1
  154. package/dist/components/detail/detail-layout.d.ts +6 -0
  155. package/dist/components/detail/detail-layout.d.ts.map +1 -1
  156. package/dist/components/detail/detail-layout.js +2 -1
  157. package/dist/components/detail/detail-layout.js.map +1 -1
  158. package/dist/components/email-body-frame/email-body-frame.d.ts +37 -0
  159. package/dist/components/email-body-frame/email-body-frame.d.ts.map +1 -0
  160. package/dist/components/email-body-frame/email-body-frame.js +44 -0
  161. package/dist/components/email-body-frame/email-body-frame.js.map +1 -0
  162. package/dist/components/markdown-view/diagram/DiagramLabel.d.ts +33 -0
  163. package/dist/components/markdown-view/diagram/DiagramLabel.d.ts.map +1 -0
  164. package/dist/components/markdown-view/diagram/{FlowchartDiagramLabel.js → DiagramLabel.js} +15 -6
  165. package/dist/components/markdown-view/diagram/DiagramLabel.js.map +1 -0
  166. package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +0 -5
  167. package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -1
  168. package/dist/components/markdown-view/diagram/FlowchartDiagram.js +2 -6
  169. package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -1
  170. package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +1 -1
  171. package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -1
  172. package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -1
  173. package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +2 -3
  174. package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -1
  175. package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -1
  176. package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +2 -3
  177. package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -1
  178. package/dist/components/markdown-view/diagram/MermaidFence.d.ts +20 -11
  179. package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -1
  180. package/dist/components/markdown-view/diagram/MermaidFence.js +48 -13
  181. package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -1
  182. package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts +50 -0
  183. package/dist/components/markdown-view/diagram/SequenceDiagram.d.ts.map +1 -0
  184. package/dist/components/markdown-view/diagram/SequenceDiagram.js +141 -0
  185. package/dist/components/markdown-view/diagram/SequenceDiagram.js.map +1 -0
  186. package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts +23 -0
  187. package/dist/components/markdown-view/diagram/SequenceDiagramFragment.d.ts.map +1 -0
  188. package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js +101 -0
  189. package/dist/components/markdown-view/diagram/SequenceDiagramFragment.js.map +1 -0
  190. package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts +23 -0
  191. package/dist/components/markdown-view/diagram/SequenceDiagramMessage.d.ts.map +1 -0
  192. package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js +77 -0
  193. package/dist/components/markdown-view/diagram/SequenceDiagramMessage.js.map +1 -0
  194. package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts +16 -0
  195. package/dist/components/markdown-view/diagram/SequenceDiagramNote.d.ts.map +1 -0
  196. package/dist/components/markdown-view/diagram/SequenceDiagramNote.js +39 -0
  197. package/dist/components/markdown-view/diagram/SequenceDiagramNote.js.map +1 -0
  198. package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts +20 -0
  199. package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.d.ts.map +1 -0
  200. package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js +61 -0
  201. package/dist/components/markdown-view/diagram/SequenceDiagramParticipant.js.map +1 -0
  202. package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts +27 -0
  203. package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.d.ts.map +1 -0
  204. package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js +65 -0
  205. package/dist/components/markdown-view/diagram/SequenceDiagramParticipantActor.js.map +1 -0
  206. package/dist/components/markdown-view/diagram/layoutSequence.d.ts +155 -0
  207. package/dist/components/markdown-view/diagram/layoutSequence.d.ts.map +1 -0
  208. package/dist/components/markdown-view/diagram/layoutSequence.js +478 -0
  209. package/dist/components/markdown-view/diagram/layoutSequence.js.map +1 -0
  210. package/dist/components/markdown-view/diagram/sequenceModel.d.ts +132 -0
  211. package/dist/components/markdown-view/diagram/sequenceModel.d.ts.map +1 -0
  212. package/dist/components/markdown-view/diagram/sequenceModel.js +0 -0
  213. package/dist/components/markdown-view/diagram/sequenceParser.d.ts +32 -0
  214. package/dist/components/markdown-view/diagram/sequenceParser.d.ts.map +1 -0
  215. package/dist/components/markdown-view/diagram/sequenceParser.js +312 -0
  216. package/dist/components/markdown-view/diagram/sequenceParser.js.map +1 -0
  217. package/dist/components/markdown-view/markdown-view.css +65 -0
  218. package/dist/components/markdown-view/markdown-view.d.ts +18 -11
  219. package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
  220. package/dist/components/markdown-view/markdown-view.js +30 -16
  221. package/dist/components/markdown-view/markdown-view.js.map +1 -1
  222. package/dist/components/nav-shell/nav-page.d.ts +7 -0
  223. package/dist/components/nav-shell/nav-page.d.ts.map +1 -1
  224. package/dist/components/nav-shell/nav-page.js.map +1 -1
  225. package/dist/components/nav-shell/nav-tree-util.d.ts +64 -2
  226. package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -1
  227. package/dist/components/nav-shell/nav-tree-util.js +29 -6
  228. package/dist/components/nav-shell/nav-tree-util.js.map +1 -1
  229. package/dist/components/nav-shell/spotlight.d.ts +3 -2
  230. package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
  231. package/dist/components/nav-shell/spotlight.js +9 -6
  232. package/dist/components/nav-shell/spotlight.js.map +1 -1
  233. package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
  234. package/dist/components/nav-shell/use-nav-breadcrumbs.js +9 -2
  235. package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
  236. package/dist/components/nav-shell/use-nav-entries.d.ts +6 -0
  237. package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
  238. package/dist/components/nav-shell/use-nav-entries.js +8 -3
  239. package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
  240. package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
  241. package/dist/components/nav-shell/use-nav-tree.js +1 -1
  242. package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
  243. package/dist/components/ui/alert-dialog.d.ts +1 -1
  244. package/dist/components/ui/alert-dialog.d.ts.map +1 -1
  245. package/dist/components/ui/alert-dialog.js +1 -0
  246. package/dist/components/ui/alert-dialog.js.map +1 -1
  247. package/dist/components/ui/alert.d.ts +2 -2
  248. package/dist/components/ui/alert.d.ts.map +1 -1
  249. package/dist/components/ui/alert.js +1 -0
  250. package/dist/components/ui/alert.js.map +1 -1
  251. package/dist/components/ui/avatar.d.ts +2 -2
  252. package/dist/components/ui/avatar.d.ts.map +1 -1
  253. package/dist/components/ui/avatar.js +1 -0
  254. package/dist/components/ui/avatar.js.map +1 -1
  255. package/dist/components/ui/breadcrumb.d.ts +2 -2
  256. package/dist/components/ui/breadcrumb.d.ts.map +1 -1
  257. package/dist/components/ui/breadcrumb.js +1 -0
  258. package/dist/components/ui/breadcrumb.js.map +1 -1
  259. package/dist/components/ui/card.d.ts +2 -2
  260. package/dist/components/ui/card.d.ts.map +1 -1
  261. package/dist/components/ui/card.js +1 -0
  262. package/dist/components/ui/card.js.map +1 -1
  263. package/dist/components/ui/checkbox.js +1 -1
  264. package/dist/components/ui/checkbox.js.map +1 -1
  265. package/dist/components/ui/combobox.d.ts +1 -1
  266. package/dist/components/ui/combobox.d.ts.map +1 -1
  267. package/dist/components/ui/combobox.js.map +1 -1
  268. package/dist/components/ui/command.d.ts +2 -2
  269. package/dist/components/ui/command.d.ts.map +1 -1
  270. package/dist/components/ui/command.js +1 -0
  271. package/dist/components/ui/command.js.map +1 -1
  272. package/dist/components/ui/context-menu.d.ts +2 -2
  273. package/dist/components/ui/context-menu.d.ts.map +1 -1
  274. package/dist/components/ui/context-menu.js +1 -0
  275. package/dist/components/ui/context-menu.js.map +1 -1
  276. package/dist/components/ui/dialog.d.ts +1 -1
  277. package/dist/components/ui/dialog.d.ts.map +1 -1
  278. package/dist/components/ui/dialog.js +1 -0
  279. package/dist/components/ui/dialog.js.map +1 -1
  280. package/dist/components/ui/drawer.d.ts +1 -1
  281. package/dist/components/ui/drawer.d.ts.map +1 -1
  282. package/dist/components/ui/drawer.js.map +1 -1
  283. package/dist/components/ui/dropdown-menu.d.ts +2 -2
  284. package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
  285. package/dist/components/ui/dropdown-menu.js +1 -0
  286. package/dist/components/ui/dropdown-menu.js.map +1 -1
  287. package/dist/components/ui/empty.d.ts +1 -1
  288. package/dist/components/ui/empty.d.ts.map +1 -1
  289. package/dist/components/ui/empty.js.map +1 -1
  290. package/dist/components/ui/hover-card.d.ts +1 -1
  291. package/dist/components/ui/hover-card.js.map +1 -1
  292. package/dist/components/ui/input-group.d.ts +2 -2
  293. package/dist/components/ui/input-group.d.ts.map +1 -1
  294. package/dist/components/ui/input-group.js +1 -0
  295. package/dist/components/ui/input-group.js.map +1 -1
  296. package/dist/components/ui/input-otp.d.ts +1 -1
  297. package/dist/components/ui/input-otp.d.ts.map +1 -1
  298. package/dist/components/ui/input-otp.js.map +1 -1
  299. package/dist/components/ui/input.d.ts +1 -1
  300. package/dist/components/ui/input.d.ts.map +1 -1
  301. package/dist/components/ui/input.js +1 -0
  302. package/dist/components/ui/input.js.map +1 -1
  303. package/dist/components/ui/label.d.ts +1 -1
  304. package/dist/components/ui/label.d.ts.map +1 -1
  305. package/dist/components/ui/label.js +1 -0
  306. package/dist/components/ui/label.js.map +1 -1
  307. package/dist/components/ui/menubar.d.ts +2 -2
  308. package/dist/components/ui/menubar.d.ts.map +1 -1
  309. package/dist/components/ui/menubar.js +1 -0
  310. package/dist/components/ui/menubar.js.map +1 -1
  311. package/dist/components/ui/pagination.d.ts +1 -1
  312. package/dist/components/ui/pagination.d.ts.map +1 -1
  313. package/dist/components/ui/pagination.js +1 -0
  314. package/dist/components/ui/pagination.js.map +1 -1
  315. package/dist/components/ui/popover.d.ts +1 -1
  316. package/dist/components/ui/popover.d.ts.map +1 -1
  317. package/dist/components/ui/popover.js +1 -0
  318. package/dist/components/ui/popover.js.map +1 -1
  319. package/dist/components/ui/progress.d.ts +1 -1
  320. package/dist/components/ui/progress.d.ts.map +1 -1
  321. package/dist/components/ui/progress.js.map +1 -1
  322. package/dist/components/ui/segmented.d.ts +11 -0
  323. package/dist/components/ui/segmented.d.ts.map +1 -1
  324. package/dist/components/ui/segmented.js +6 -2
  325. package/dist/components/ui/segmented.js.map +1 -1
  326. package/dist/components/ui/select.d.ts +1 -1
  327. package/dist/components/ui/select.d.ts.map +1 -1
  328. package/dist/components/ui/select.js +1 -0
  329. package/dist/components/ui/select.js.map +1 -1
  330. package/dist/components/ui/sheet.d.ts +2 -2
  331. package/dist/components/ui/sheet.d.ts.map +1 -1
  332. package/dist/components/ui/sheet.js +1 -0
  333. package/dist/components/ui/sheet.js.map +1 -1
  334. package/dist/components/ui/switch.js +1 -1
  335. package/dist/components/ui/switch.js.map +1 -1
  336. package/dist/components/ui/table.d.ts +2 -2
  337. package/dist/components/ui/table.d.ts.map +1 -1
  338. package/dist/components/ui/table.js +1 -0
  339. package/dist/components/ui/table.js.map +1 -1
  340. package/dist/components/ui/tabs.d.ts +1 -1
  341. package/dist/components/ui/tabs.d.ts.map +1 -1
  342. package/dist/components/ui/tabs.js.map +1 -1
  343. package/dist/components/ui/textarea.d.ts +1 -1
  344. package/dist/components/ui/textarea.d.ts.map +1 -1
  345. package/dist/components/ui/textarea.js +1 -0
  346. package/dist/components/ui/textarea.js.map +1 -1
  347. package/dist/components/ui/tooltip.d.ts +1 -11
  348. package/dist/components/ui/tooltip.d.ts.map +1 -1
  349. package/dist/components/ui/tooltip.js +0 -10
  350. package/dist/components/ui/tooltip.js.map +1 -1
  351. package/dist/hooks/use-mobile.d.ts +1 -1
  352. package/dist/hooks/use-mobile.js +1 -1
  353. package/dist/hooks/use-mobile.js.map +1 -1
  354. package/dist/lib/i18n-fr.d.ts.map +1 -1
  355. package/dist/lib/i18n-fr.js +252 -2
  356. package/dist/lib/i18n-fr.js.map +1 -1
  357. package/package.json +5 -5
  358. package/src/components/account/__tests__/account-router.spec.ts +25 -0
  359. package/src/components/account/__tests__/account-security-mfa-gate.browser.spec.tsx +76 -0
  360. package/src/components/account/account-connections.tsx +50 -18
  361. package/src/components/account/account-delete-dialog.tsx +24 -9
  362. package/src/components/account/account-header.tsx +4 -1
  363. package/src/components/account/account-keys.tsx +73 -29
  364. package/src/components/account/account-mfa-dialog.tsx +233 -0
  365. package/src/components/account/account-password-dialog.tsx +42 -12
  366. package/src/components/account/account-profile.tsx +66 -25
  367. package/src/components/account/account-router.tsx +47 -6
  368. package/src/components/account/account-security.tsx +209 -22
  369. package/src/components/account/account-sessions.tsx +87 -22
  370. package/src/components/action-error-toaster/__tests__/action-error-toaster.browser.spec.tsx +114 -0
  371. package/src/components/admin/__tests__/admin-nav-i18n.browser.spec.tsx +152 -0
  372. package/src/components/admin/__tests__/admin-notifications-preview-body.browser.spec.tsx +128 -0
  373. package/src/components/admin/__tests__/admin-notifications-raw-tab.browser.spec.tsx +76 -0
  374. package/src/components/admin/__tests__/admin-notifications-status-badge.browser.spec.tsx +121 -0
  375. package/src/components/admin/__tests__/admin-router.spec.ts +27 -0
  376. package/src/components/admin/__tests__/admin-status-labels.browser.spec.tsx +152 -0
  377. package/src/components/admin/__tests__/admin-user-detail-security-tab.browser.spec.tsx +92 -0
  378. package/src/components/admin/admin-jobs-executions-panel.tsx +8 -11
  379. package/src/components/admin/admin-jobs-status-badge.tsx +4 -5
  380. package/src/components/admin/admin-jobs-status-labels.ts +46 -0
  381. package/src/components/admin/admin-layout.tsx +9 -3
  382. package/src/components/admin/admin-notifications-detail-tabs.tsx +167 -0
  383. package/src/components/admin/admin-notifications-detail.tsx +100 -0
  384. package/src/components/admin/admin-notifications-preview-body.tsx +104 -0
  385. package/src/components/admin/admin-notifications-preview-tab.tsx +55 -0
  386. package/src/components/admin/admin-notifications-raw-tab.tsx +76 -0
  387. package/src/components/admin/admin-notifications-status-badge.tsx +44 -0
  388. package/src/components/admin/admin-notifications-status-labels.ts +42 -0
  389. package/src/components/admin/admin-notifications-status-tones.ts +85 -0
  390. package/src/components/admin/admin-notifications-template-label.ts +22 -0
  391. package/src/components/admin/admin-notifications.tsx +398 -31
  392. package/src/components/admin/admin-router.tsx +65 -8
  393. package/src/components/admin/admin-sessions.tsx +10 -3
  394. package/src/components/admin/admin-user-detail-security-tab.tsx +70 -5
  395. package/src/components/admin/admin-user-detail-sessions-tab.tsx +10 -3
  396. package/src/components/admin/admin-user-detail.tsx +92 -23
  397. package/src/components/admin/admin-users.tsx +1 -1
  398. package/src/components/admin/admin-workflows-executions-panel.tsx +8 -16
  399. package/src/components/admin/admin-workflows-status-badge.tsx +4 -5
  400. package/src/components/admin/admin-workflows-status-labels.ts +51 -0
  401. package/src/components/alepha-table/__tests__/alepha-table-row-key.browser.spec.tsx +106 -0
  402. package/src/components/alepha-table/alepha-table.tsx +50 -10
  403. package/src/components/auth/auth-login.tsx +37 -18
  404. package/src/components/auth/auth-mfa-step.tsx +177 -0
  405. package/src/components/auth/auth-register.tsx +1 -1
  406. package/src/components/auth/provider-labels.ts +4 -0
  407. package/src/components/control/__tests__/control-autofocus.browser.spec.tsx +107 -0
  408. package/src/components/control/control.tsx +20 -5
  409. package/src/components/control-array/__tests__/control-array-child-change.browser.spec.tsx +90 -0
  410. package/src/components/control-array/control-array.tsx +85 -13
  411. package/src/components/control-number/control-number.tsx +7 -0
  412. package/src/components/control-object/__tests__/control-object-clear.browser.spec.tsx +100 -0
  413. package/src/components/control-object/control-object.tsx +21 -2
  414. package/src/components/control-password/control-password.tsx +2 -1
  415. package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +36 -0
  416. package/src/components/detail/detail-layout.tsx +20 -1
  417. package/src/components/email-body-frame/__tests__/email-body-frame.browser.spec.tsx +52 -0
  418. package/src/components/email-body-frame/email-body-frame.tsx +81 -0
  419. package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +65 -2
  420. package/src/components/markdown-view/diagram/{FlowchartDiagramLabel.tsx → DiagramLabel.tsx} +14 -4
  421. package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +1 -6
  422. package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +1 -1
  423. package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +2 -3
  424. package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +2 -3
  425. package/src/components/markdown-view/diagram/MermaidFence.tsx +65 -15
  426. package/src/components/markdown-view/diagram/SequenceDiagram.tsx +203 -0
  427. package/src/components/markdown-view/diagram/SequenceDiagramFragment.tsx +120 -0
  428. package/src/components/markdown-view/diagram/SequenceDiagramMessage.tsx +100 -0
  429. package/src/components/markdown-view/diagram/SequenceDiagramNote.tsx +46 -0
  430. package/src/components/markdown-view/diagram/SequenceDiagramParticipant.tsx +80 -0
  431. package/src/components/markdown-view/diagram/SequenceDiagramParticipantActor.tsx +74 -0
  432. package/src/components/markdown-view/diagram/__tests__/sequence-diagram.browser.spec.tsx +267 -0
  433. package/src/components/markdown-view/diagram/layoutSequence.spec.ts +535 -0
  434. package/src/components/markdown-view/diagram/layoutSequence.ts +764 -0
  435. package/src/components/markdown-view/diagram/sequenceModel.ts +141 -0
  436. package/src/components/markdown-view/diagram/sequenceParser.spec.ts +495 -0
  437. package/src/components/markdown-view/diagram/sequenceParser.ts +443 -0
  438. package/src/components/markdown-view/markdown-view.css +65 -0
  439. package/src/components/markdown-view/markdown-view.tsx +34 -16
  440. package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +107 -1
  441. package/src/components/nav-shell/nav-page.tsx +8 -0
  442. package/src/components/nav-shell/nav-tree-util.ts +95 -2
  443. package/src/components/nav-shell/spotlight.tsx +22 -8
  444. package/src/components/nav-shell/use-nav-breadcrumbs.ts +9 -2
  445. package/src/components/nav-shell/use-nav-entries.ts +18 -2
  446. package/src/components/nav-shell/use-nav-tree.ts +4 -1
  447. package/src/components/ui/alert-dialog.tsx +1 -1
  448. package/src/components/ui/alert.tsx +2 -2
  449. package/src/components/ui/avatar.tsx +3 -3
  450. package/src/components/ui/breadcrumb.tsx +3 -3
  451. package/src/components/ui/card.tsx +5 -5
  452. package/src/components/ui/checkbox.tsx +1 -1
  453. package/src/components/ui/combobox.tsx +8 -8
  454. package/src/components/ui/command.tsx +4 -4
  455. package/src/components/ui/context-menu.tsx +7 -7
  456. package/src/components/ui/dialog.tsx +1 -1
  457. package/src/components/ui/drawer.tsx +6 -6
  458. package/src/components/ui/dropdown-menu.tsx +8 -14
  459. package/src/components/ui/empty.tsx +3 -3
  460. package/src/components/ui/hover-card.tsx +1 -1
  461. package/src/components/ui/input-group.tsx +2 -2
  462. package/src/components/ui/input-otp.tsx +1 -1
  463. package/src/components/ui/input.tsx +1 -1
  464. package/src/components/ui/label.tsx +1 -1
  465. package/src/components/ui/menubar.tsx +9 -9
  466. package/src/components/ui/pagination.tsx +1 -1
  467. package/src/components/ui/popover.tsx +1 -1
  468. package/src/components/ui/progress.tsx +1 -1
  469. package/src/components/ui/segmented.tsx +28 -0
  470. package/src/components/ui/select.tsx +1 -1
  471. package/src/components/ui/sheet.tsx +4 -4
  472. package/src/components/ui/switch.tsx +1 -1
  473. package/src/components/ui/table.tsx +6 -9
  474. package/src/components/ui/tabs.tsx +1 -1
  475. package/src/components/ui/textarea.tsx +1 -1
  476. package/src/components/ui/tooltip.tsx +3 -11
  477. package/src/components/use-dialog/__tests__/use-dialog-providers.browser.spec.tsx +61 -0
  478. package/src/hooks/use-mobile.ts +1 -1
  479. package/src/lib/__tests__/i18n-fr.spec.ts +27 -5
  480. package/src/lib/i18n-fr.ts +308 -1
  481. package/dist/components/language-toggle/language-toggle.d.ts +0 -8
  482. package/dist/components/language-toggle/language-toggle.d.ts.map +0 -1
  483. package/dist/components/language-toggle/language-toggle.js +0 -49
  484. package/dist/components/language-toggle/language-toggle.js.map +0 -1
  485. package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +0 -23
  486. package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +0 -1
  487. package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +0 -1
  488. package/dist/components/ui/accordion.d.ts +0 -7
  489. package/dist/components/ui/accordion.d.ts.map +0 -1
  490. package/dist/components/ui/accordion.js +0 -55
  491. package/dist/components/ui/accordion.js.map +0 -1
  492. package/dist/components/ui/aspect-ratio.d.ts +0 -5
  493. package/dist/components/ui/aspect-ratio.d.ts.map +0 -1
  494. package/dist/components/ui/aspect-ratio.js +0 -15
  495. package/dist/components/ui/aspect-ratio.js.map +0 -1
  496. package/dist/components/ui/carousel.d.ts +0 -29
  497. package/dist/components/ui/carousel.d.ts.map +0 -1
  498. package/dist/components/ui/carousel.js +0 -144
  499. package/dist/components/ui/carousel.js.map +0 -1
  500. package/dist/components/ui/collapsible.d.ts +0 -6
  501. package/dist/components/ui/collapsible.d.ts.map +0 -1
  502. package/dist/components/ui/collapsible.js +0 -26
  503. package/dist/components/ui/collapsible.js.map +0 -1
  504. package/dist/components/ui/direction.d.ts +0 -2
  505. package/dist/components/ui/direction.d.ts.map +0 -1
  506. package/dist/components/ui/direction.js +0 -3
  507. package/dist/components/ui/item.d.ts +0 -23
  508. package/dist/components/ui/item.d.ts.map +0 -1
  509. package/dist/components/ui/item.js +0 -122
  510. package/dist/components/ui/item.js.map +0 -1
  511. package/dist/components/ui/navigation-menu.d.ts +0 -12
  512. package/dist/components/ui/navigation-menu.d.ts.map +0 -1
  513. package/dist/components/ui/navigation-menu.js +0 -84
  514. package/dist/components/ui/navigation-menu.js.map +0 -1
  515. package/dist/components/ui/radio-group.d.ts +0 -6
  516. package/dist/components/ui/radio-group.d.ts.map +0 -1
  517. package/dist/components/ui/radio-group.js +0 -29
  518. package/dist/components/ui/radio-group.js.map +0 -1
  519. package/dist/components/ui/scroll-area.d.ts +0 -5
  520. package/dist/components/ui/scroll-area.d.ts.map +0 -1
  521. package/dist/components/ui/scroll-area.js +0 -38
  522. package/dist/components/ui/scroll-area.js.map +0 -1
  523. package/dist/components/ui/toggle-group.d.ts +0 -12
  524. package/dist/components/ui/toggle-group.d.ts.map +0 -1
  525. package/dist/components/ui/toggle-group.js +0 -60
  526. package/dist/components/ui/toggle-group.js.map +0 -1
  527. package/dist/components/ui/toggle.d.ts +0 -9
  528. package/dist/components/ui/toggle.d.ts.map +0 -1
  529. package/dist/components/ui/toggle.js +0 -38
  530. package/dist/components/ui/toggle.js.map +0 -1
  531. package/src/components/language-toggle/language-toggle.tsx +0 -66
  532. package/src/components/ui/accordion.tsx +0 -77
  533. package/src/components/ui/aspect-ratio.tsx +0 -22
  534. package/src/components/ui/carousel.tsx +0 -258
  535. package/src/components/ui/collapsible.tsx +0 -21
  536. package/src/components/ui/direction.tsx +0 -6
  537. package/src/components/ui/item.tsx +0 -200
  538. package/src/components/ui/navigation-menu.tsx +0 -170
  539. package/src/components/ui/radio-group.tsx +0 -37
  540. package/src/components/ui/scroll-area.tsx +0 -53
  541. package/src/components/ui/toggle-group.tsx +0 -93
  542. package/src/components/ui/toggle.tsx +0 -44
@@ -0,0 +1,25 @@
1
+ import * as React from "react";
2
+ import { type MfaChallenge } from "alepha/react/auth";
3
+ export interface AuthMfaStepProps {
4
+ /**
5
+ * The challenge the sign-in was refused with.
6
+ */
7
+ challenge: MfaChallenge;
8
+ /**
9
+ * Called once the code has been accepted and the session exists.
10
+ */
11
+ onVerified: () => void | Promise<void>;
12
+ /**
13
+ * Back to the password form.
14
+ */
15
+ onCancel: () => void;
16
+ }
17
+ /**
18
+ * Second step of a sign-in: the six-digit code.
19
+ *
20
+ * The same component serves both factors. Only the wording and the resend
21
+ * affordance differ, because to the user the act is identical: read a code,
22
+ * type it in.
23
+ */
24
+ export declare const AuthMfaStep: (props: AuthMfaStepProps) => React.JSX.Element;
25
+ //# sourceMappingURL=auth-mfa-step.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-mfa-step.d.ts","sourceRoot":"","sources":["../../../src/components/auth/auth-mfa-step.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,EAAE,KAAK,YAAY,EAAW,MAAM,mBAAmB,CAAC;AAM/D,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,SAAS,EAAE,YAAY,CAAC;IACxB;;OAEG;IACH,UAAU,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC;;OAEG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,UAAW,gBAAgB,sBAyIlD,CAAC"}
@@ -0,0 +1,122 @@
1
+ import { Button } from "../ui/button.js";
2
+ import { Alert, AlertDescription } from "../ui/alert.js";
3
+ import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/input-otp.js";
4
+ import { useState } from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { AlertCircle } from "lucide-react";
7
+ import { useI18n } from "alepha/react/i18n";
8
+ import { useAuth } from "alepha/react/auth";
9
+ import { HttpError } from "alepha/server";
10
+ //#region src/components/auth/auth-mfa-step.tsx
11
+ /**
12
+ * Second step of a sign-in: the six-digit code.
13
+ *
14
+ * The same component serves both factors. Only the wording and the resend
15
+ * affordance differ, because to the user the act is identical: read a code,
16
+ * type it in.
17
+ */
18
+ const AuthMfaStep = (props) => {
19
+ const auth = useAuth();
20
+ const { tr } = useI18n();
21
+ const [code, setCode] = useState("");
22
+ const [error, setError] = useState();
23
+ const [loading, setLoading] = useState(false);
24
+ const [resending, setResending] = useState(false);
25
+ const [sentTo, setSentTo] = useState(props.challenge.sentTo);
26
+ const isEmail = props.challenge.methods.includes("emailCode");
27
+ const submit = async (value) => {
28
+ setLoading(true);
29
+ setError(void 0);
30
+ try {
31
+ await auth.loginMfa(props.challenge.challenge, value);
32
+ await props.onVerified();
33
+ } catch (err) {
34
+ setCode("");
35
+ if (err instanceof HttpError && err.status === 401) setError(tr("auth.mfa.invalid", { default: "That code is not valid. Try again." }));
36
+ else {
37
+ console.error("Second factor failed:", err);
38
+ setError(tr("auth.mfa.error", { default: "Something went wrong. Please try again." }));
39
+ }
40
+ } finally {
41
+ setLoading(false);
42
+ }
43
+ };
44
+ const resend = async () => {
45
+ setResending(true);
46
+ setError(void 0);
47
+ try {
48
+ const result = await auth.resendMfaCode(props.challenge.challenge);
49
+ setSentTo(result.sentTo ?? sentTo);
50
+ } catch {
51
+ setError(tr("auth.mfa.resendFailed", { default: "Could not send a new code. Try again in a moment." }));
52
+ } finally {
53
+ setResending(false);
54
+ }
55
+ };
56
+ return /* @__PURE__ */ jsxs("div", {
57
+ className: "flex flex-col gap-4",
58
+ children: [
59
+ /* @__PURE__ */ jsxs("div", {
60
+ className: "flex flex-col gap-1",
61
+ children: [/* @__PURE__ */ jsx("h2", {
62
+ className: "text-center text-lg font-semibold",
63
+ children: tr("auth.mfa.title", { default: "Two-step verification" })
64
+ }), /* @__PURE__ */ jsx("p", {
65
+ className: "text-muted-foreground text-center text-sm",
66
+ children: isEmail ? sentTo ? tr("auth.mfa.emailHint", {
67
+ default: `Enter the code we sent to ${sentTo}.`,
68
+ args: [sentTo]
69
+ }) : tr("auth.mfa.emailHintGeneric", { default: "Enter the code we sent to your email address." }) : tr("auth.mfa.totpHint", { default: "Enter the code from your authenticator app." })
70
+ })]
71
+ }),
72
+ error && /* @__PURE__ */ jsxs(Alert, {
73
+ variant: "destructive",
74
+ children: [/* @__PURE__ */ jsx(AlertCircle, { className: "size-4" }), /* @__PURE__ */ jsx(AlertDescription, { children: error })]
75
+ }),
76
+ /* @__PURE__ */ jsx("div", {
77
+ className: "flex justify-center",
78
+ children: /* @__PURE__ */ jsx(InputOTP, {
79
+ maxLength: 6,
80
+ value: code,
81
+ disabled: loading,
82
+ onChange: (value) => {
83
+ setCode(value);
84
+ if (value.length === 6) submit(value);
85
+ },
86
+ children: /* @__PURE__ */ jsx(InputOTPGroup, { children: [
87
+ 0,
88
+ 1,
89
+ 2,
90
+ 3,
91
+ 4,
92
+ 5
93
+ ].map((index) => /* @__PURE__ */ jsx(InputOTPSlot, { index }, index)) })
94
+ })
95
+ }),
96
+ /* @__PURE__ */ jsx(Button, {
97
+ type: "button",
98
+ loading,
99
+ disabled: code.length !== 6,
100
+ onClick: () => submit(code),
101
+ children: tr("auth.mfa.submit", { default: "Verify" })
102
+ }),
103
+ isEmail && /* @__PURE__ */ jsx(Button, {
104
+ type: "button",
105
+ variant: "ghost",
106
+ loading: resending,
107
+ onClick: resend,
108
+ children: tr("auth.mfa.resend", { default: "Send a new code" })
109
+ }),
110
+ /* @__PURE__ */ jsx(Button, {
111
+ type: "button",
112
+ variant: "ghost",
113
+ onClick: props.onCancel,
114
+ children: tr("auth.mfa.back", { default: "Back to sign in" })
115
+ })
116
+ ]
117
+ });
118
+ };
119
+ //#endregion
120
+ export { AuthMfaStep };
121
+
122
+ //# sourceMappingURL=auth-mfa-step.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth-mfa-step.js","names":[],"sources":["../../../src/components/auth/auth-mfa-step.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { Alert, AlertDescription } from \"@alepha/ui/components/ui/alert\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport {\n InputOTP,\n InputOTPGroup,\n InputOTPSlot,\n} from \"@alepha/ui/components/ui/input-otp\";\nimport { type MfaChallenge, useAuth } from \"alepha/react/auth\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { HttpError } from \"alepha/server\";\nimport { AlertCircle } from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface AuthMfaStepProps {\n /**\n * The challenge the sign-in was refused with.\n */\n challenge: MfaChallenge;\n /**\n * Called once the code has been accepted and the session exists.\n */\n onVerified: () => void | Promise<void>;\n /**\n * Back to the password form.\n */\n onCancel: () => void;\n}\n\n/**\n * Second step of a sign-in: the six-digit code.\n *\n * The same component serves both factors. Only the wording and the resend\n * affordance differ, because to the user the act is identical: read a code,\n * type it in.\n */\nexport const AuthMfaStep = (props: AuthMfaStepProps) => {\n const auth = useAuth();\n const { tr } = useI18n();\n\n const [code, setCode] = useState(\"\");\n const [error, setError] = useState<string>();\n const [loading, setLoading] = useState(false);\n const [resending, setResending] = useState(false);\n const [sentTo, setSentTo] = useState(props.challenge.sentTo);\n\n const isEmail = props.challenge.methods.includes(\"emailCode\");\n\n const submit = async (value: string) => {\n setLoading(true);\n setError(undefined);\n try {\n await auth.loginMfa(props.challenge.challenge, value);\n await props.onVerified();\n } catch (err) {\n setCode(\"\");\n // A 401 here is a wrong or stale code, which is the only failure the\n // user can do anything about. Anything else is ours, not theirs.\n if (err instanceof HttpError && err.status === 401) {\n setError(\n tr(\"auth.mfa.invalid\", {\n default: \"That code is not valid. Try again.\",\n }),\n );\n } else {\n console.error(\"Second factor failed:\", err);\n setError(\n tr(\"auth.mfa.error\", {\n default: \"Something went wrong. Please try again.\",\n }),\n );\n }\n } finally {\n setLoading(false);\n }\n };\n\n const resend = async () => {\n setResending(true);\n setError(undefined);\n try {\n const result = await auth.resendMfaCode(props.challenge.challenge);\n setSentTo(result.sentTo ?? sentTo);\n } catch {\n setError(\n tr(\"auth.mfa.resendFailed\", {\n default: \"Could not send a new code. Try again in a moment.\",\n }),\n );\n } finally {\n setResending(false);\n }\n };\n\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex flex-col gap-1\">\n <h2 className=\"text-center text-lg font-semibold\">\n {tr(\"auth.mfa.title\", { default: \"Two-step verification\" })}\n </h2>\n <p className=\"text-muted-foreground text-center text-sm\">\n {isEmail\n ? // Two keys rather than one interpolated with a possibly-empty\n // address: a translation reading \"sent to .\" is worse than a\n // sentence written for the case where we have nothing to show.\n sentTo\n ? tr(\"auth.mfa.emailHint\", {\n default: `Enter the code we sent to ${sentTo}.`,\n args: [sentTo],\n })\n : tr(\"auth.mfa.emailHintGeneric\", {\n default: \"Enter the code we sent to your email address.\",\n })\n : tr(\"auth.mfa.totpHint\", {\n default: \"Enter the code from your authenticator app.\",\n })}\n </p>\n </div>\n\n {error && (\n <Alert variant=\"destructive\">\n <AlertCircle className=\"size-4\" />\n <AlertDescription>{error}</AlertDescription>\n </Alert>\n )}\n\n <div className=\"flex justify-center\">\n <InputOTP\n maxLength={6}\n value={code}\n disabled={loading}\n onChange={(value: string) => {\n setCode(value);\n // Submitting on the sixth digit spares the user a button press\n // they would otherwise always have to make.\n if (value.length === 6) {\n void submit(value);\n }\n }}\n >\n <InputOTPGroup>\n {[0, 1, 2, 3, 4, 5].map((index) => (\n <InputOTPSlot key={index} index={index} />\n ))}\n </InputOTPGroup>\n </InputOTP>\n </div>\n\n <Button\n type=\"button\"\n loading={loading}\n disabled={code.length !== 6}\n onClick={() => submit(code)}\n >\n {tr(\"auth.mfa.submit\", { default: \"Verify\" })}\n </Button>\n\n {isEmail && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n loading={resending}\n onClick={resend}\n >\n {tr(\"auth.mfa.resend\", { default: \"Send a new code\" })}\n </Button>\n )}\n\n <Button type=\"button\" variant=\"ghost\" onClick={props.onCancel}>\n {tr(\"auth.mfa.back\", { default: \"Back to sign in\" })}\n </Button>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAuCA,MAAa,eAAe,UAA4B;CACtD,MAAM,OAAO,QAAQ;CACrB,MAAM,EAAE,OAAO,QAAQ;CAEvB,MAAM,CAAC,MAAM,WAAW,SAAS,EAAE;CACnC,MAAM,CAAC,OAAO,YAAY,SAAiB;CAC3C,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,MAAM,CAAC,WAAW,gBAAgB,SAAS,KAAK;CAChD,MAAM,CAAC,QAAQ,aAAa,SAAS,MAAM,UAAU,MAAM;CAE3D,MAAM,UAAU,MAAM,UAAU,QAAQ,SAAS,WAAW;CAE5D,MAAM,SAAS,OAAO,UAAkB;EACtC,WAAW,IAAI;EACf,SAAS,KAAA,CAAS;EAClB,IAAI;GACF,MAAM,KAAK,SAAS,MAAM,UAAU,WAAW,KAAK;GACpD,MAAM,MAAM,WAAW;EACzB,SAAS,KAAK;GACZ,QAAQ,EAAE;GAGV,IAAI,eAAe,aAAa,IAAI,WAAW,KAC7C,SACE,GAAG,oBAAoB,EACrB,SAAS,qCACX,CAAC,CACH;QACK;IACL,QA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B,oBAAC,cAAD,EAAiC,MAAQ,GAAtB,KAAsB,CAC1C,EACY,CAAA;IACP,CAAA;GACP,CAAA;GAEL,oBAAC,QAAD;IACE,MAAK;IACI;IACT,UAAU,KAAK,WAAW;IAC1B,eAAe,OAAO,IAAI;IAEzB,UAAA,GAAG,mBAAmB,EAAE,SAAS,SAAS,CAAC;GACtC,CAAA;GAEP,WACC,oBAAC,QAAD;IACE,MAAK;IACL,SAAQ;IACR,SAAS;IACT,SAAS;IAER,UAAA,GAAG,mBAAmB,EAAE,SAAS,kBAAkB,CAAC;GAC/C,CAAA;GAGV,oBAAC,QAAD;IAAQ,MAAK;IAAS,SAAQ;IAAQ,SAAS,MAAM;IAClD,UAAA,GAAG,iBAAiB,EAAE,SAAS,kBAAkB,CAAC;GAC7C,CAAA;EACL;;AAET"}
@@ -1,14 +1,14 @@
1
1
  import { Card, CardContent } from "../ui/card.js";
2
2
  import { Button } from "../ui/button.js";
3
3
  import { Label } from "../ui/label.js";
4
+ import { Alert, AlertDescription } from "../ui/alert.js";
5
+ import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../ui/input-otp.js";
4
6
  import { iconFor } from "../control-base/icon-hint.js";
5
7
  import { Control } from "../control/control.js";
6
8
  import { Separator } from "../ui/separator.js";
7
9
  import { BrandIcon } from "../brand-icon/brand-icon.js";
8
- import { Alert, AlertDescription } from "../ui/alert.js";
9
10
  import { safeRedirect } from "./safe-redirect.js";
10
11
  import { TurnstileWidget } from "../captcha/turnstile-widget.js";
11
- import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from "../ui/input-otp.js";
12
12
  import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
14
  import { AlertCircle, Check, Info, X } from "lucide-react";
@@ -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\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(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 const allowed = 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 a `ZodOptional`.\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 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 email: data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n },\n });\n const identifier = data.username ?? 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 />\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}) => {\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 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 />\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":";;;;;;;;;;;;;;;;;;;;;AAoFA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,OAAO,MAAM,QAAQ;CAInD,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;CAElD,MAAM,iBAAiB,MAAM,YAAY;CACzC,MAAM,CAAC,cAAc,mBAAmB,SAA6B;CACrE,MAAM,aAAa,OAAqC,IAAI;CAG5D,MAAM,kBAAkB,OAA2B,KAAA,CAAS;CAC5D,gBAAgB;EACd,gBAAgB,UAAU;CAC5B,GAAG,CAAC,YAAY,CAAC;CAEjB,MAAM,sBAAsB,MAAM,YAAY,sBAAsB,MACjE,OAA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C,EACjD,SAAS,uBACX,CAAC;CACH,CAAC;CAEH,IAAI,QAAQ,gBACV,MAAM,KAAK;EACT,IAAI,QAAQ,KAAK,KAAK;EACtB,OAAO,GAAG,sCAAsC,EAC9C,SAAS,aACX,CAAC;CACH,CAAC;CAEH,IAAI,QAAQ,0BACV,MAAM,KAAK;EACT,IAAI,eAAe,KAAK,KAAK;EAC7B,OAAO,GAAG,uCAAuC,EAC/C,SAAS,wBACX,CAAC;CACH,CAAC;CAGH,IAAI,MAAM,WAAW,GAAG,OAAO;CAE/B,OACE,oBAAC,MAAD;EAAI,WAAU;EACX,UAAA,MAAM,KAAK,MAAM,QAChB,qBAAC,MAAD;GAEE,WAAW,6BAA6B,KAAK,KAAK,2CAA2C;GAF/F,UAAA,CAIG,KAAK,KACJ,oBAAC,OAAD,EAAO,WAAU,WAAY,CAAA,IAE7B,oBAAC,GAAD,EAAG,WAAU,sBAAuB,CAAA,GAEtC,oBAAC,QAAD,EAAA,UAAO,KAAK,MAAY,CAAA,CACtB;EATG,GAAA,GASH,CACL;CACC,CAAA;AAER;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\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(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 const allowed = 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 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 email: data.email,\n phoneNumber: data.phoneNumber,\n password: data.password,\n captchaToken: captchaSiteKey ? captchaTokenRef.current : undefined,\n },\n });\n const identifier = data.username ?? 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 />\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}) => {\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 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 />\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":";;;;;;;;;;;;;;;;;;;;;AAoFA,MAAa,gBAAgB,UAA6B;CACxD,MAAM,OAAO,QAAQ;CACrB,MAAM,WAAW,UAA0B;CAC3C,MAAM,SAAS,UAAU;CACzB,MAAM,EAAE,OAAO,QAAQ;CACvB,MAAM,WAAW,aAAa,OAAO,MAAM,QAAQ;CAInD,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;CAElD,MAAM,iBAAiB,MAAM,YAAY;CACzC,MAAM,CAAC,cAAc,mBAAmB,SAA6B;CACrE,MAAM,aAAa,OAAqC,IAAI;CAG5D,MAAM,kBAAkB,OAA2B,KAAA,CAAS;CAC5D,gBAAgB;EACd,gBAAgB,UAAU;CAC5B,GAAG,CAAC,YAAY,CAAC;CAEjB,MAAM,sBAAsB,MAAM,YAAY,sBAAsB,MACjE,OAAO,GAAG,SAAS,aACtB;CACA,MAAM,WAAW,MAAM,YAAY;CACnC,MAAM,UAAU,SAAS,wBAAwB;CAwCjD,MAAM,OAAO,QAAQ;EACnB,QAvCa,cAAc;GAa3B,MAAM,QAAQ,SAAS,sBAAsB;GAC7C,MAAM,QAAQ;IACZ,WAAW,QACP,EAAE,KAAK;KAAE,MAAM;KAAM,WAAW;IAAI,CAAC,IACrC,EAAE,KAAK;KAAE,MAAM;KAAM,WAAW;IAAI,CAAC,CA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I,MAAM,WAAW,GAAG,OAAO;CAE/B,OACE,oBAAC,MAAD;EAAI,WAAU;EACX,UAAA,MAAM,KAAK,MAAM,QAChB,qBAAC,MAAD;GAEE,WAAW,6BAA6B,KAAK,KAAK,2CAA2C;GAF/F,UAAA,CAIG,KAAK,KACJ,oBAAC,OAAD,EAAO,WAAU,WAAY,CAAA,IAE7B,oBAAC,GAAD,EAAG,WAAU,sBAAuB,CAAA,GAEtC,oBAAC,QAAD,EAAA,UAAO,KAAK,MAAY,CAAA,CACtB;EATG,GAAA,GASH,CACL;CACC,CAAA;AAER;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,12 +1,12 @@
1
1
  import { Card, CardContent } from "../ui/card.js";
2
2
  import { Button } from "../ui/button.js";
3
3
  import { Label } from "../ui/label.js";
4
+ import { Alert, AlertDescription } from "../ui/alert.js";
5
+ import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/input-otp.js";
4
6
  import { iconFor } from "../control-base/icon-hint.js";
5
7
  import { Control } from "../control/control.js";
6
- import { Alert, AlertDescription } from "../ui/alert.js";
7
8
  import { safeRedirect } from "./safe-redirect.js";
8
9
  import { TurnstileWidget } from "../captcha/turnstile-widget.js";
9
- import { InputOTP, InputOTPGroup, InputOTPSlot } from "../ui/input-otp.js";
10
10
  import { useEffect, useRef, useState } from "react";
11
11
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
12
  import { AlertCircle, CheckCircle2, Info } from "lucide-react";
@@ -68,6 +68,7 @@ export declare class AuthRouter {
68
68
  usernameBlocklist: string[];
69
69
  phoneNumber: "none" | "optional" | "required";
70
70
  verifyEmailRequired: boolean;
71
+ trustProviderEmail: boolean;
71
72
  verifyPhoneRequired: boolean;
72
73
  firstNameLastName: "none" | "optional" | "required";
73
74
  resetPasswordAllowed: boolean;
@@ -87,6 +88,10 @@ export declare class AuthRouter {
87
88
  windowMs: number;
88
89
  };
89
90
  registrationIpMaxAttempts: number;
91
+ mfa: {
92
+ totp: "disabled" | "optional" | "required";
93
+ emailCode: "disabled" | "optional" | "required";
94
+ };
90
95
  refreshToken: {
91
96
  expirationIdle?: number | undefined;
92
97
  };
@@ -117,6 +122,7 @@ export declare class AuthRouter {
117
122
  usernameBlocklist: string[];
118
123
  phoneNumber: "none" | "optional" | "required";
119
124
  verifyEmailRequired: boolean;
125
+ trustProviderEmail: boolean;
120
126
  verifyPhoneRequired: boolean;
121
127
  firstNameLastName: "none" | "optional" | "required";
122
128
  resetPasswordAllowed: boolean;
@@ -136,6 +142,10 @@ export declare class AuthRouter {
136
142
  windowMs: number;
137
143
  };
138
144
  registrationIpMaxAttempts: number;
145
+ mfa: {
146
+ totp: "disabled" | "optional" | "required";
147
+ emailCode: "disabled" | "optional" | "required";
148
+ };
139
149
  refreshToken: {
140
150
  expirationIdle?: number | undefined;
141
151
  };
@@ -161,6 +171,7 @@ export declare class AuthRouter {
161
171
  usernameBlocklist: string[];
162
172
  phoneNumber: "none" | "optional" | "required";
163
173
  verifyEmailRequired: boolean;
174
+ trustProviderEmail: boolean;
164
175
  verifyPhoneRequired: boolean;
165
176
  firstNameLastName: "none" | "optional" | "required";
166
177
  resetPasswordAllowed: boolean;
@@ -180,6 +191,10 @@ export declare class AuthRouter {
180
191
  windowMs: number;
181
192
  };
182
193
  registrationIpMaxAttempts: number;
194
+ mfa: {
195
+ totp: "disabled" | "optional" | "required";
196
+ emailCode: "disabled" | "optional" | "required";
197
+ };
183
198
  refreshToken: {
184
199
  expirationIdle?: number | undefined;
185
200
  };
@@ -205,6 +220,7 @@ export declare class AuthRouter {
205
220
  usernameBlocklist: string[];
206
221
  phoneNumber: "none" | "optional" | "required";
207
222
  verifyEmailRequired: boolean;
223
+ trustProviderEmail: boolean;
208
224
  verifyPhoneRequired: boolean;
209
225
  firstNameLastName: "none" | "optional" | "required";
210
226
  resetPasswordAllowed: boolean;
@@ -224,6 +240,10 @@ export declare class AuthRouter {
224
240
  windowMs: number;
225
241
  };
226
242
  registrationIpMaxAttempts: number;
243
+ mfa: {
244
+ totp: "disabled" | "optional" | "required";
245
+ emailCode: "disabled" | "optional" | "required";
246
+ };
227
247
  refreshToken: {
228
248
  expirationIdle?: number | undefined;
229
249
  };
@@ -1 +1 @@
1
- {"version":3,"file":"auth-router.d.ts","sourceRoot":"","sources":["../../../src/components/auth/auth-router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,UAAU;IACrB,SAAS,CAAC,QAAQ,CAAC,QAAQ,mEAA8B;IAEzD;;;OAGG;IACH,SAAS,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEhB;IAEH;;;;OAIG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAYF;IAEH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAYL;IAEH,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAWV;IAEH;;;OAGG;IACH,WAAW,sJAKR;CACJ"}
1
+ {"version":3,"file":"auth-router.d.ts","sourceRoot":"","sources":["../../../src/components/auth/auth-router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AASxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAAa,UAAU;IACrB,SAAS,CAAC,QAAQ,CAAC,QAAQ,mEAA8B;IAEzD;;;OAGG;IACH,SAAS,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAEhB;IAEH;;;;OAIG;IACH,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAYF;IAEH,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAYL;IAEH,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0DAWV;IAEH;;;OAGG;IACH,WAAW,sJAKR;CACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"provider-labels.d.ts","sourceRoot":"","sources":["../../../src/components/auth/provider-labels.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOlD,CAAC"}
1
+ {"version":3,"file":"provider-labels.d.ts","sourceRoot":"","sources":["../../../src/components/auth/provider-labels.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAWlD,CAAC"}
@@ -8,6 +8,7 @@
8
8
  */
9
9
  const PROVIDER_LABELS = {
10
10
  credentials: "Password",
11
+ totp: "Authenticator app",
11
12
  google: "Google",
12
13
  apple: "Apple",
13
14
  github: "GitHub",
@@ -1 +1 @@
1
- {"version":3,"file":"provider-labels.js","names":[],"sources":["../../../src/components/auth/provider-labels.ts"],"sourcesContent":["/**\n * Display names for identity providers.\n *\n * Shared between the security tab (which lists connections) and the\n * remove-connection confirmation in the page shell, so both name a provider\n * the same way.\n */\nexport const PROVIDER_LABELS: Record<string, string> = {\n credentials: \"Password\",\n google: \"Google\",\n apple: \"Apple\",\n github: \"GitHub\",\n microsoft: \"Microsoft\",\n facebook: \"Facebook\",\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,kBAA0C;CACrD,aAAa;CACb,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,UAAU;AACZ"}
1
+ {"version":3,"file":"provider-labels.js","names":[],"sources":["../../../src/components/auth/provider-labels.ts"],"sourcesContent":["/**\n * Display names for identity providers.\n *\n * Shared between the security tab (which lists connections) and the\n * remove-connection confirmation in the page shell, so both name a provider\n * the same way.\n */\nexport const PROVIDER_LABELS: Record<string, string> = {\n credentials: \"Password\",\n // Not a way to sign in, but it is stored as an identity row, so it shows\n // up in the same lists. Naming it here is what lets an administrator\n // recognise (and clear) the second factor of a locked-out user.\n totp: \"Authenticator app\",\n google: \"Google\",\n apple: \"Apple\",\n github: \"GitHub\",\n microsoft: \"Microsoft\",\n facebook: \"Facebook\",\n};\n"],"mappings":";;;;;;;;AAOA,MAAa,kBAA0C;CACrD,aAAa;CAIb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,UAAU;AACZ"}
@@ -135,8 +135,17 @@ export interface ControlProps {
135
135
  */
136
136
  placeholder?: string;
137
137
  /**
138
- * Autofocus the control on mount. Forwarded to the text input,
139
- * textarea, or password input the control renders.
138
+ * Autofocus the control on mount. Forwarded to the text, number, password
139
+ * or textarea input the control renders. Ignored by the variants that are
140
+ * not a single focusable field (select, date, upload, array, object).
141
+ *
142
+ * Every forward site carries an `oxlint-disable-next-line
143
+ * jsx-a11y/no-autofocus`. That rule is right about a page that grabs focus
144
+ * unbidden and wrong here: nothing focuses unless a caller passed this prop,
145
+ * and it is the caller the rule should be asking. Left to fire, it did real
146
+ * damage once - a lint pass deleted the forwarding and left the prop
147
+ * declared, so login and dialog forms silently stopped focusing their first
148
+ * field and two components grew `getElementById(...).focus()` workarounds.
140
149
  */
141
150
  autoFocus?: boolean;
142
151
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/components/control/control.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,8CAA8C,CAAC;AAKtD,OAAO,EAEL,K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AAC,CAAC,CAAC;IAClE;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EACH,OAAO,GACP,IAAI,CACF,kBAAkB,EAClB,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CACpD,CAAC;CACP;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAW,YAAY,cAsZ1C,CAAC"}
1
+ {"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../../src/components/control/control.tsx"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,8CAA8C,CAAC;AAKtD,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,qDAAqD,CAAC;AAC7D,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,qDAAqD,CAAC;AAO7D,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,SAAS,EAGf,MAAM,OAAO,CAAC;AAEf,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,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,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IACrC;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACzC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;IACxD;;;OAGG;IACH,KAAK,CAAC,EACF,YAAY,EAAE,GACd,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,YAAY,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAClE;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,MAAM,CAAC,EACH,OAAO,GACP,IAAI,CACF,kBAAkB,EAClB,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CACpD,CAAC;CACP;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,UAAW,YAAY,cA4Z1C,CAAC"}
@@ -67,7 +67,8 @@ const Control = (props) => {
67
67
  i18nPrefix: merged.i18nPrefix,
68
68
  controlProps: merged.objectProps?.controlProps,
69
69
  variant: merged.objectProps?.variant,
70
- defaultExpanded: merged.objectProps?.defaultExpanded
70
+ defaultExpanded: merged.objectProps?.defaultExpanded,
71
+ clearable: merged.clearable
71
72
  }));
72
73
  if (merged.array || meta.isArrayOfObjects) {
73
74
  const arrayProps = merged.arrayProps;
@@ -97,7 +98,8 @@ const Control = (props) => {
97
98
  label: merged.label ?? props.label,
98
99
  description: merged.description ?? props.description,
99
100
  slider: merged.slider,
100
- disabled: merged.disabled
101
+ disabled: merged.disabled,
102
+ autoFocus: merged.autoFocus
101
103
  }));
102
104
  const items = merged.items;
103
105
  if (merged.select || merged.combobox || merged.segmented || meta.isEnum || meta.isArray && !meta.isArrayOfObjects || items != null) return wrapWithSlots(merged, /* @__PURE__ */ jsx(ControlSelect, {
@@ -178,6 +180,7 @@ const Control = (props) => {
178
180
  disabled: merged.disabled,
179
181
  maxLength: maxLength || void 0,
180
182
  autoComplete: merged.autoComplete,
183
+ autoFocus: merged.autoFocus,
181
184
  placeholder: merged.placeholder,
182
185
  value: String(value ?? ""),
183
186
  onChange: (e) => setValue(e.target.value)
@@ -193,6 +196,7 @@ const Control = (props) => {
193
196
  required: meta.required,
194
197
  disabled: merged.disabled,
195
198
  autoComplete: merged.autoComplete,
199
+ autoFocus: merged.autoFocus,
196
200
  inputProps: merged.inputProps,
197
201
  icon: resolveIcon(merged.icon, "password"),
198
202
  value: String(value ?? ""),
@@ -229,6 +233,7 @@ const Control = (props) => {
229
233
  type: htmlType,
230
234
  disabled: merged.disabled,
231
235
  autoComplete,
236
+ autoFocus: merged.autoFocus,
232
237
  placeholder: merged.placeholder,
233
238
  value: String(value ?? ""),
234
239
  minLength: meta.constraints.minLength,