hazo_auth 10.18.4 → 10.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +6 -0
  2. package/SETUP_CHECKLIST.md +27 -0
  3. package/cli-src/lib/already_logged_in_config.server.ts +11 -7
  4. package/cli-src/lib/auth_hooks.ts +52 -0
  5. package/cli-src/lib/config/config_loader.server.ts +34 -0
  6. package/cli-src/lib/email_verification_config.server.ts +2 -2
  7. package/cli-src/lib/forgot_password_config.server.ts +2 -2
  8. package/cli-src/lib/login_config.server.ts +25 -19
  9. package/cli-src/lib/my_settings_config.server.ts +22 -15
  10. package/cli-src/lib/navbar_config.server.ts +12 -8
  11. package/cli-src/lib/oauth_config.server.ts +14 -22
  12. package/cli-src/lib/otp_config.server.ts +11 -4
  13. package/cli-src/lib/profile_pic_menu_config.server.ts +16 -5
  14. package/cli-src/lib/register_config.server.ts +21 -16
  15. package/cli-src/lib/reset_password_config.server.ts +11 -17
  16. package/cli-src/lib/services/oauth_service.ts +16 -0
  17. package/cli-src/lib/services/otp_service.ts +7 -0
  18. package/cli-src/lib/services/registration_service.ts +8 -0
  19. package/cli-src/lib/ui_shell_config.server.ts +11 -13
  20. package/cli-src/lib/utils/password_validator.ts +12 -5
  21. package/dist/components/layouts/create_firm/index.d.ts.map +1 -1
  22. package/dist/components/layouts/create_firm/index.js +4 -3
  23. package/dist/components/layouts/dev_lock/index.d.ts.map +1 -1
  24. package/dist/components/layouts/dev_lock/index.js +4 -2
  25. package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts +5 -4
  26. package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts.map +1 -1
  27. package/dist/components/layouts/email_verification/config/email_verification_field_config.js +32 -29
  28. package/dist/components/layouts/email_verification/hooks/use_email_verification.d.ts.map +1 -1
  29. package/dist/components/layouts/email_verification/hooks/use_email_verification.js +14 -13
  30. package/dist/components/layouts/email_verification/index.d.ts.map +1 -1
  31. package/dist/components/layouts/email_verification/index.js +13 -9
  32. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts +3 -2
  33. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts.map +1 -1
  34. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.js +21 -18
  35. package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.d.ts.map +1 -1
  36. package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.js +10 -9
  37. package/dist/components/layouts/forgot_password/index.d.ts.map +1 -1
  38. package/dist/components/layouts/forgot_password/index.js +15 -6
  39. package/dist/components/layouts/legal/legal_acceptance_gate.d.ts.map +1 -1
  40. package/dist/components/layouts/legal/legal_acceptance_gate.js +5 -3
  41. package/dist/components/layouts/legal/legal_doc_checkbox_list.d.ts.map +1 -1
  42. package/dist/components/layouts/legal/legal_doc_checkbox_list.js +3 -1
  43. package/dist/components/layouts/legal/legal_doc_combined_view.d.ts.map +1 -1
  44. package/dist/components/layouts/legal/legal_doc_combined_view.js +3 -1
  45. package/dist/components/layouts/login/config/login_field_config.d.ts +3 -2
  46. package/dist/components/layouts/login/config/login_field_config.d.ts.map +1 -1
  47. package/dist/components/layouts/login/config/login_field_config.js +29 -26
  48. package/dist/components/layouts/login/hooks/use_login_form.d.ts.map +1 -1
  49. package/dist/components/layouts/login/hooks/use_login_form.js +8 -7
  50. package/dist/components/layouts/login/index.d.ts +4 -4
  51. package/dist/components/layouts/login/index.d.ts.map +1 -1
  52. package/dist/components/layouts/login/index.js +33 -22
  53. package/dist/components/layouts/my_settings/components/connected_accounts_section.d.ts.map +1 -1
  54. package/dist/components/layouts/my_settings/components/connected_accounts_section.js +7 -4
  55. package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts.map +1 -1
  56. package/dist/components/layouts/my_settings/components/danger_zone_section.js +15 -6
  57. package/dist/components/layouts/my_settings/components/editable_field.d.ts.map +1 -1
  58. package/dist/components/layouts/my_settings/components/editable_field.js +4 -2
  59. package/dist/components/layouts/my_settings/components/language_picker_section.d.ts.map +1 -1
  60. package/dist/components/layouts/my_settings/components/language_picker_section.js +7 -3
  61. package/dist/components/layouts/my_settings/components/password_change_dialog.d.ts.map +1 -1
  62. package/dist/components/layouts/my_settings/components/password_change_dialog.js +28 -21
  63. package/dist/components/layouts/my_settings/components/profile_picture_dialog.d.ts.map +1 -1
  64. package/dist/components/layouts/my_settings/components/profile_picture_dialog.js +12 -9
  65. package/dist/components/layouts/my_settings/components/profile_picture_gravatar_tab.d.ts.map +1 -1
  66. package/dist/components/layouts/my_settings/components/profile_picture_gravatar_tab.js +3 -1
  67. package/dist/components/layouts/my_settings/components/profile_picture_library_tab.js +14 -11
  68. package/dist/components/layouts/my_settings/components/profile_picture_upload_tab.d.ts.map +1 -1
  69. package/dist/components/layouts/my_settings/components/profile_picture_upload_tab.js +26 -15
  70. package/dist/components/layouts/my_settings/components/set_password_section.d.ts.map +1 -1
  71. package/dist/components/layouts/my_settings/components/set_password_section.js +24 -14
  72. package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts +2 -1
  73. package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts.map +1 -1
  74. package/dist/components/layouts/my_settings/config/my_settings_field_config.js +10 -10
  75. package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
  76. package/dist/components/layouts/my_settings/index.js +35 -27
  77. package/dist/components/layouts/otp/index.d.ts.map +1 -1
  78. package/dist/components/layouts/otp/index.js +8 -3
  79. package/dist/components/layouts/register/config/register_field_config.d.ts +3 -2
  80. package/dist/components/layouts/register/config/register_field_config.d.ts.map +1 -1
  81. package/dist/components/layouts/register/config/register_field_config.js +45 -42
  82. package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
  83. package/dist/components/layouts/register/hooks/use_register_form.js +12 -11
  84. package/dist/components/layouts/register/index.d.ts +4 -4
  85. package/dist/components/layouts/register/index.d.ts.map +1 -1
  86. package/dist/components/layouts/register/index.js +25 -19
  87. package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts +4 -3
  88. package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts.map +1 -1
  89. package/dist/components/layouts/reset_password/config/reset_password_field_config.js +17 -17
  90. package/dist/components/layouts/reset_password/hooks/use_reset_password_form.d.ts.map +1 -1
  91. package/dist/components/layouts/reset_password/hooks/use_reset_password_form.js +14 -13
  92. package/dist/components/layouts/reset_password/index.d.ts.map +1 -1
  93. package/dist/components/layouts/reset_password/index.js +12 -7
  94. package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
  95. package/dist/components/layouts/shared/components/already_logged_in_guard.js +6 -2
  96. package/dist/components/layouts/shared/components/auth_navbar.d.ts +1 -1
  97. package/dist/components/layouts/shared/components/auth_navbar.d.ts.map +1 -1
  98. package/dist/components/layouts/shared/components/auth_navbar.js +7 -2
  99. package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts.map +1 -1
  100. package/dist/components/layouts/shared/components/facebook_sign_in_button.js +5 -2
  101. package/dist/components/layouts/shared/components/floating_home_link.d.ts.map +1 -1
  102. package/dist/components/layouts/shared/components/floating_home_link.js +6 -3
  103. package/dist/components/layouts/shared/components/form_action_buttons.d.ts.map +1 -1
  104. package/dist/components/layouts/shared/components/form_action_buttons.js +9 -4
  105. package/dist/components/layouts/shared/components/google_sign_in_button.d.ts.map +1 -1
  106. package/dist/components/layouts/shared/components/google_sign_in_button.js +5 -2
  107. package/dist/components/layouts/shared/components/logout_button.d.ts.map +1 -1
  108. package/dist/components/layouts/shared/components/logout_button.js +6 -5
  109. package/dist/components/layouts/shared/components/oauth_divider.d.ts.map +1 -1
  110. package/dist/components/layouts/shared/components/oauth_divider.js +8 -3
  111. package/dist/components/layouts/shared/components/password_field.d.ts.map +1 -1
  112. package/dist/components/layouts/shared/components/password_field.js +3 -1
  113. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts +4 -0
  114. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
  115. package/dist/components/layouts/shared/components/profile_pic_menu.js +26 -18
  116. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.d.ts +1 -0
  117. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.d.ts.map +1 -1
  118. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.js +1 -1
  119. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.d.ts.map +1 -1
  120. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +3 -1
  121. package/dist/components/layouts/shared/components/standalone_layout_wrapper.d.ts.map +1 -1
  122. package/dist/components/layouts/shared/components/standalone_layout_wrapper.js +6 -2
  123. package/dist/components/layouts/shared/components/unauthorized_guard.d.ts.map +1 -1
  124. package/dist/components/layouts/shared/components/unauthorized_guard.js +7 -3
  125. package/dist/components/layouts/shared/config/layout_customization.d.ts +6 -0
  126. package/dist/components/layouts/shared/config/layout_customization.d.ts.map +1 -1
  127. package/dist/components/layouts/shared/config/layout_customization.js +26 -1
  128. package/dist/components/layouts/shared/utils/validation.d.ts +9 -2
  129. package/dist/components/layouts/shared/utils/validation.d.ts.map +1 -1
  130. package/dist/components/layouts/shared/utils/validation.js +16 -8
  131. package/dist/components/layouts/user_management/components/roles_matrix.d.ts.map +1 -1
  132. package/dist/components/layouts/user_management/components/roles_matrix.js +21 -18
  133. package/dist/components/layouts/user_management/components/scope_hierarchy_tab.d.ts.map +1 -1
  134. package/dist/components/layouts/user_management/components/scope_hierarchy_tab.js +32 -31
  135. package/dist/components/layouts/user_management/components/user_scopes_tab.d.ts.map +1 -1
  136. package/dist/components/layouts/user_management/components/user_scopes_tab.js +26 -20
  137. package/dist/components/layouts/user_management/index.d.ts.map +1 -1
  138. package/dist/components/layouts/user_management/index.js +47 -43
  139. package/dist/components/otp/OTPRequestForm.d.ts.map +1 -1
  140. package/dist/components/otp/OTPRequestForm.js +10 -5
  141. package/dist/components/otp/OTPVerifyForm.d.ts.map +1 -1
  142. package/dist/components/otp/OTPVerifyForm.js +12 -7
  143. package/dist/components/permission_denied_dialog.client.d.ts.map +1 -1
  144. package/dist/components/permission_denied_dialog.client.js +12 -9
  145. package/dist/components/ui/sheet.d.ts +1 -1
  146. package/dist/components/ui/sidebar.js +5 -5
  147. package/dist/contexts/hazo_auth_config.d.ts +13 -0
  148. package/dist/contexts/hazo_auth_config.d.ts.map +1 -1
  149. package/dist/contexts/hazo_auth_config.js +4 -1
  150. package/dist/contexts/hazo_auth_provider.d.ts +22 -2
  151. package/dist/contexts/hazo_auth_provider.d.ts.map +1 -1
  152. package/dist/contexts/hazo_auth_provider.js +18 -2
  153. package/dist/lib/already_logged_in_config.server.d.ts +4 -2
  154. package/dist/lib/already_logged_in_config.server.d.ts.map +1 -1
  155. package/dist/lib/already_logged_in_config.server.js +7 -5
  156. package/dist/lib/auth_hooks.d.ts +20 -0
  157. package/dist/lib/auth_hooks.d.ts.map +1 -0
  158. package/dist/lib/auth_hooks.js +32 -0
  159. package/dist/lib/config/config_loader.server.d.ts +23 -0
  160. package/dist/lib/config/config_loader.server.d.ts.map +1 -1
  161. package/dist/lib/config/config_loader.server.js +29 -0
  162. package/dist/lib/email_verification_config.server.d.ts +2 -2
  163. package/dist/lib/email_verification_config.server.d.ts.map +1 -1
  164. package/dist/lib/forgot_password_config.server.d.ts +2 -2
  165. package/dist/lib/forgot_password_config.server.d.ts.map +1 -1
  166. package/dist/lib/login_config.server.d.ts +8 -5
  167. package/dist/lib/login_config.server.d.ts.map +1 -1
  168. package/dist/lib/login_config.server.js +13 -6
  169. package/dist/lib/my_settings_config.server.d.ts.map +1 -1
  170. package/dist/lib/my_settings_config.server.js +22 -15
  171. package/dist/lib/navbar_config.server.d.ts +3 -2
  172. package/dist/lib/navbar_config.server.d.ts.map +1 -1
  173. package/dist/lib/navbar_config.server.js +4 -2
  174. package/dist/lib/oauth_config.server.d.ts +6 -6
  175. package/dist/lib/oauth_config.server.d.ts.map +1 -1
  176. package/dist/lib/oauth_config.server.js +8 -4
  177. package/dist/lib/otp_config.server.d.ts +2 -2
  178. package/dist/lib/otp_config.server.d.ts.map +1 -1
  179. package/dist/lib/otp_config.server.js +4 -2
  180. package/dist/lib/profile_pic_menu_config.server.d.ts +6 -2
  181. package/dist/lib/profile_pic_menu_config.server.d.ts.map +1 -1
  182. package/dist/lib/profile_pic_menu_config.server.js +5 -3
  183. package/dist/lib/register_config.server.d.ts +7 -6
  184. package/dist/lib/register_config.server.d.ts.map +1 -1
  185. package/dist/lib/register_config.server.js +8 -4
  186. package/dist/lib/reset_password_config.server.d.ts +6 -4
  187. package/dist/lib/reset_password_config.server.d.ts.map +1 -1
  188. package/dist/lib/reset_password_config.server.js +5 -5
  189. package/dist/lib/services/oauth_service.d.ts.map +1 -1
  190. package/dist/lib/services/oauth_service.js +13 -0
  191. package/dist/lib/services/otp_service.d.ts.map +1 -1
  192. package/dist/lib/services/otp_service.js +6 -0
  193. package/dist/lib/services/registration_service.d.ts.map +1 -1
  194. package/dist/lib/services/registration_service.js +7 -0
  195. package/dist/lib/ui_shell_config.server.d.ts +6 -2
  196. package/dist/lib/ui_shell_config.server.d.ts.map +1 -1
  197. package/dist/lib/ui_shell_config.server.js +5 -3
  198. package/dist/lib/utils/password_validator.d.ts.map +1 -1
  199. package/dist/lib/utils/password_validator.js +5 -5
  200. package/dist/locales/en.json +517 -0
  201. package/dist/server/routes/library_photos.d.ts +2 -2
  202. package/dist/server/routes/set_password.js +1 -1
  203. package/dist/server-lib.d.ts +2 -0
  204. package/dist/server-lib.d.ts.map +1 -1
  205. package/dist/server-lib.js +2 -0
  206. package/dist/server_pages/forgot_password.d.ts +3 -2
  207. package/dist/server_pages/forgot_password.d.ts.map +1 -1
  208. package/dist/server_pages/forgot_password.js +8 -7
  209. package/dist/server_pages/forgot_password_client_wrapper.d.ts +2 -1
  210. package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -1
  211. package/dist/server_pages/forgot_password_client_wrapper.js +3 -1
  212. package/dist/server_pages/login.d.ts.map +1 -1
  213. package/dist/server_pages/login.js +9 -7
  214. package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
  215. package/dist/server_pages/login_client_wrapper.js +3 -1
  216. package/dist/server_pages/otp.d.ts +6 -3
  217. package/dist/server_pages/otp.d.ts.map +1 -1
  218. package/dist/server_pages/otp.js +11 -8
  219. package/dist/server_pages/register.d.ts.map +1 -1
  220. package/dist/server_pages/register.js +7 -6
  221. package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
  222. package/dist/server_pages/register_client_wrapper.js +3 -1
  223. package/dist/server_pages/reset_password.d.ts.map +1 -1
  224. package/dist/server_pages/reset_password.js +7 -6
  225. package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -1
  226. package/dist/server_pages/reset_password_client_wrapper.js +3 -1
  227. package/dist/server_pages/verify_email.d.ts.map +1 -1
  228. package/dist/server_pages/verify_email.js +6 -5
  229. package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -1
  230. package/dist/server_pages/verify_email_client_wrapper.js +4 -2
  231. package/dist/strings/default_strings.d.ts +15 -0
  232. package/dist/strings/default_strings.d.ts.map +1 -1
  233. package/dist/strings/default_strings.js +67 -11
  234. package/dist/strings/index.d.ts +1 -1
  235. package/dist/strings/index.d.ts.map +1 -1
  236. package/dist/strings/index.js +1 -1
  237. package/dist/strings/strings_context.d.ts +20 -3
  238. package/dist/strings/strings_context.d.ts.map +1 -1
  239. package/dist/strings/strings_context.js +39 -5
  240. package/dist/strings/strings_provider.d.ts +1 -5
  241. package/dist/strings/strings_provider.d.ts.map +1 -1
  242. package/dist/strings/strings_provider.js +5 -1
  243. package/package.json +27 -19
@@ -1 +1 @@
1
- {"version":3,"file":"use_reset_password_form.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/reset_password/hooks/use_reset_password_form.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAW5G,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,OAAO,CAAC,oBAAoB,EAAE,UAAU,GAAG,kBAAkB,CAAC,EAC9D,OAAO,CACR,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,OAAO,GAAG,OAAO,IAAI;IAC1D,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,uBAAuB,CAAC;IAChC,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,wBAAwB,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,kBAAkB,KAAK,IAAI,CAAC;IAC7E,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAChE,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AASF,eAAO,MAAM,uBAAuB,GAAI,OAAO,EAAG,kDAI/C,0BAA0B,CAAC,OAAO,CAAC,KAAG,0BA0NxC,CAAC"}
1
+ {"version":3,"file":"use_reset_password_form.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/reset_password/hooks/use_reset_password_form.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,EAA4B,KAAK,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAW5G,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAC3E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC,CAAC;AAC/F,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C,OAAO,CAAC,oBAAoB,EAAE,UAAU,GAAG,kBAAkB,CAAC,EAC9D,OAAO,CACR,CAAC;AAEF,MAAM,MAAM,0BAA0B,CAAC,OAAO,GAAG,OAAO,IAAI;IAC1D,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,UAAU,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,uBAAuB,CAAC;IAChC,MAAM,EAAE,uBAAuB,CAAC;IAChC,kBAAkB,EAAE,uBAAuB,CAAC;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,CAAC,OAAO,EAAE,oBAAoB,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,wBAAwB,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,kBAAkB,KAAK,IAAI,CAAC;IAC7E,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAChE,YAAY,EAAE,MAAM,IAAI,CAAC;CAC1B,CAAC;AASF,eAAO,MAAM,uBAAuB,GAAI,OAAO,EAAG,kDAI/C,0BAA0B,CAAC,OAAO,CAAC,KAAG,0BA2NxC,CAAC"}
@@ -5,7 +5,7 @@ import { useSearchParams, useRouter } from "next/navigation";
5
5
  import { toast } from "sonner";
6
6
  import { RESET_PASSWORD_FIELD_IDS } from "../config/reset_password_field_config.js";
7
7
  import { validatePassword } from "../../shared/utils/validation.js";
8
- import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
8
+ import { useHazoAuthConfig, useAuthT } from "../../../../contexts/hazo_auth_provider.js";
9
9
  // section: constants
10
10
  const PASSWORD_FIELDS = [
11
11
  RESET_PASSWORD_FIELD_IDS.PASSWORD,
@@ -19,6 +19,7 @@ const buildInitialValues = () => ({
19
19
  // section: hook
20
20
  export const use_reset_password_form = ({ passwordRequirements, dataClient, loginPath = "/hazo_auth/login", }) => {
21
21
  const { apiBasePath } = useHazoAuthConfig();
22
+ const t = useAuthT();
22
23
  const router = useRouter();
23
24
  const searchParams = useSearchParams();
24
25
  const tokenParam = searchParams.get("token");
@@ -36,7 +37,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
36
37
  // Validate token on mount
37
38
  useEffect(() => {
38
39
  if (!tokenParam) {
39
- setTokenError("Reset password link invalid or has expired. Please go to Reset Password page to get a new link.");
40
+ setTokenError(t("reset_password.link_invalid_message"));
40
41
  return;
41
42
  }
42
43
  // Validate token by calling validation API
@@ -49,7 +50,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
49
50
  });
50
51
  const data = await response.json();
51
52
  if (!response.ok || !data.success) {
52
- const errorMessage = data.error || "Reset password link invalid or has expired. Please go to Reset Password page to get a new link.";
53
+ const errorMessage = data.error || t("reset_password.link_invalid_message");
53
54
  setTokenError(errorMessage);
54
55
  setToken(null);
55
56
  }
@@ -61,7 +62,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
61
62
  }
62
63
  catch (error) {
63
64
  const errorMessage = error instanceof Error ? error.message : "An error occurred while validating the token";
64
- setTokenError("Reset password link invalid or has expired. Please go to Reset Password page to get a new link.");
65
+ setTokenError(t("reset_password.link_invalid_message"));
65
66
  setToken(null);
66
67
  }
67
68
  finally {
@@ -92,7 +93,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
92
93
  }
93
94
  // Validate password fields in real-time
94
95
  if (fieldId === RESET_PASSWORD_FIELD_IDS.PASSWORD) {
95
- const passwordError = validatePassword(value, passwordRequirements);
96
+ const passwordError = validatePassword(value, passwordRequirements, t);
96
97
  if (passwordError) {
97
98
  setErrors((prev) => (Object.assign(Object.assign({}, prev), { [RESET_PASSWORD_FIELD_IDS.PASSWORD]: passwordError })));
98
99
  }
@@ -106,7 +107,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
106
107
  // Also validate confirm password if it has a value
107
108
  if (values[RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]) {
108
109
  if (value !== values[RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]) {
109
- setErrors((prev) => (Object.assign(Object.assign({}, prev), { [RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]: "Passwords do not match" })));
110
+ setErrors((prev) => (Object.assign(Object.assign({}, prev), { [RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]: t("validation.passwords_do_not_match") })));
110
111
  }
111
112
  else {
112
113
  setErrors((prev) => {
@@ -119,7 +120,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
119
120
  }
120
121
  else if (fieldId === RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD) {
121
122
  if (value !== values[RESET_PASSWORD_FIELD_IDS.PASSWORD]) {
122
- setErrors((prev) => (Object.assign(Object.assign({}, prev), { [RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]: "Passwords do not match" })));
123
+ setErrors((prev) => (Object.assign(Object.assign({}, prev), { [RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]: t("validation.passwords_do_not_match") })));
123
124
  }
124
125
  else {
125
126
  setErrors((prev) => {
@@ -136,13 +137,13 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
136
137
  const handleSubmit = useCallback(async (event) => {
137
138
  event.preventDefault();
138
139
  if (!token) {
139
- toast.error("Reset token is missing");
140
+ toast.error(t("reset_password.token_missing"));
140
141
  return;
141
142
  }
142
143
  // Validate all fields
143
- const passwordError = validatePassword(values[RESET_PASSWORD_FIELD_IDS.PASSWORD], passwordRequirements);
144
+ const passwordError = validatePassword(values[RESET_PASSWORD_FIELD_IDS.PASSWORD], passwordRequirements, t);
144
145
  const confirmPasswordError = values[RESET_PASSWORD_FIELD_IDS.PASSWORD] !== values[RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]
145
- ? "Passwords do not match"
146
+ ? t("validation.passwords_do_not_match")
146
147
  : undefined;
147
148
  if (passwordError || confirmPasswordError) {
148
149
  setErrors(Object.assign(Object.assign({}, (passwordError ? { [RESET_PASSWORD_FIELD_IDS.PASSWORD]: passwordError } : {})), (confirmPasswordError ? { [RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD]: confirmPasswordError } : {})));
@@ -162,13 +163,13 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
162
163
  });
163
164
  const data = await response.json();
164
165
  if (!response.ok || !data.success) {
165
- const errorMessage = data.error || "Failed to reset password";
166
+ const errorMessage = data.error || t("reset_password.failed_message");
166
167
  toast.error(errorMessage);
167
168
  setTokenError(errorMessage);
168
169
  setIsSubmitting(false);
169
170
  return;
170
171
  }
171
- toast.success(data.message || "Password reset successfully");
172
+ toast.success(data.message || t("reset_password.success_toast"));
172
173
  setIsSuccess(true);
173
174
  // Redirect to login after a short delay
174
175
  setTimeout(() => {
@@ -176,7 +177,7 @@ export const use_reset_password_form = ({ passwordRequirements, dataClient, logi
176
177
  }, 2000);
177
178
  }
178
179
  catch (error) {
179
- const errorMessage = error instanceof Error ? error.message : "An error occurred";
180
+ const errorMessage = error instanceof Error ? error.message : t("shared.generic_error");
180
181
  toast.error(errorMessage);
181
182
  setTokenError(errorMessage);
182
183
  setIsSubmitting(false);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/reset_password/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAY/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAI1E,MAAM,MAAM,wBAAwB,CAAC,OAAO,GAAG,OAAO,IAAI;IACxD,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;IACrD,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,OAAO,EAAE,EACrD,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,YAAgH,EAChH,cAAuE,EACvE,SAA8B,EAC9B,kBAAiD,GAClD,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BAqNnC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/reset_password/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAY/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAK1E,MAAM,MAAM,wBAAwB,CAAC,OAAO,GAAG,OAAO,IAAI;IACxD,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;IACrD,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,qBAAqB,CAAC,OAAO,EAAE,EACrD,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,YAAY,EACZ,cAAc,EACd,SAA8B,EAC9B,kBAAiD,GAClD,EAAE,wBAAwB,CAAC,OAAO,CAAC,+BA0NnC"}
@@ -13,14 +13,19 @@ import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_gua
13
13
  import { RESET_PASSWORD_FIELD_IDS, createResetPasswordFieldDefinitions, resolveResetPasswordButtonPalette, resolveResetPasswordLabels, resolveResetPasswordPasswordRequirements, } from "./config/reset_password_field_config.js";
14
14
  import { use_reset_password_form, } from "./hooks/use_reset_password_form.js";
15
15
  import Link from "next/link";
16
+ import { useAuthT } from "../../../contexts/hazo_auth_provider.js";
16
17
  const ORDERED_FIELDS = [
17
18
  RESET_PASSWORD_FIELD_IDS.PASSWORD,
18
19
  RESET_PASSWORD_FIELD_IDS.CONFIRM_PASSWORD,
19
20
  ];
20
21
  // section: component
21
- export default function reset_password_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, password_requirements, data_client, alreadyLoggedInMessage, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", errorMessage = "Reset password link invalid or has expired. Please go to Reset Password page to get a new link.", successMessage = "Password reset successfully. Redirecting to login...", loginPath = "/hazo_auth/login", forgotPasswordPath = "/hazo_auth/forgot_password", }) {
22
- const fieldDefinitions = createResetPasswordFieldDefinitions(field_overrides);
23
- const resolvedLabels = resolveResetPasswordLabels(labels);
22
+ export default function reset_password_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, password_requirements, data_client, alreadyLoggedInMessage, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", errorMessage, successMessage, loginPath = "/hazo_auth/login", forgotPasswordPath = "/hazo_auth/forgot_password", }) {
23
+ const t = useAuthT();
24
+ const resolvedReturnHomeButtonLabel = returnHomeButtonLabel !== null && returnHomeButtonLabel !== void 0 ? returnHomeButtonLabel : t("shared.guard.return_home_default");
25
+ const resolvedErrorMessage = errorMessage !== null && errorMessage !== void 0 ? errorMessage : t("reset_password.link_invalid_message");
26
+ const resolvedSuccessMessage = successMessage !== null && successMessage !== void 0 ? successMessage : t("reset_password.success_message_default");
27
+ const fieldDefinitions = createResetPasswordFieldDefinitions(t, field_overrides);
28
+ const resolvedLabels = resolveResetPasswordLabels(t, labels);
24
29
  const resolvedButtonPalette = resolveResetPasswordButtonPalette(button_colors);
25
30
  const resolvedPasswordRequirements = resolveResetPasswordPasswordRequirements(password_requirements);
26
31
  const form = use_reset_password_form({
@@ -39,15 +44,15 @@ export default function reset_password_layout({ image_src, image_alt, image_back
39
44
  };
40
45
  // Show success message if password reset was successful
41
46
  if (form.isSuccess) {
42
- return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), _jsxs("div", { className: "cls_reset_password_layout_success flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(CheckCircle, { className: "cls_reset_password_layout_success_icon h-16 w-16 text-green-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_reset_password_layout_success_message text-lg font-medium text-slate-900", children: successMessage })] })] }) }) }));
47
+ return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), _jsxs("div", { className: "cls_reset_password_layout_success flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(CheckCircle, { className: "cls_reset_password_layout_success_icon h-16 w-16 text-green-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_reset_password_layout_success_message text-lg font-medium text-slate-900", children: resolvedSuccessMessage })] })] }) }) }));
43
48
  }
44
49
  // Show loading state while validating token
45
50
  if (form.isValidatingToken) {
46
- return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_reset_password_layout_validating flex flex-col items-center justify-center gap-4 py-8", children: [_jsx(Loader2, { className: "h-12 w-12 animate-spin text-slate-600", "aria-hidden": "true" }), _jsxs("div", { className: "cls_reset_password_layout_validating_text text-center", children: [_jsx("h1", { className: "cls_reset_password_layout_validating_heading text-2xl font-semibold text-slate-900", children: resolvedLabels.heading }), _jsx("p", { className: "cls_reset_password_layout_validating_subheading mt-2 text-sm text-slate-600", children: "Validating reset token..." })] })] }) }) }));
51
+ return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_reset_password_layout_validating flex flex-col items-center justify-center gap-4 py-8", children: [_jsx(Loader2, { className: "h-12 w-12 animate-spin text-slate-600", "aria-hidden": "true" }), _jsxs("div", { className: "cls_reset_password_layout_validating_text text-center", children: [_jsx("h1", { className: "cls_reset_password_layout_validating_heading text-2xl font-semibold text-slate-900", children: resolvedLabels.heading }), _jsx("p", { className: "cls_reset_password_layout_validating_subheading mt-2 text-sm text-slate-600", children: t("reset_password.validating_message") })] })] }) }) }));
47
52
  }
48
53
  // Show error message if token is invalid or missing
49
54
  if (form.tokenError || !form.token) {
50
- return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_reset_password_layout_error flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(XCircle, { className: "cls_reset_password_layout_error_icon h-16 w-16 text-red-600", "aria-hidden": "true" }), _jsxs("div", { className: "cls_reset_password_layout_error_text", children: [_jsx("h1", { className: "cls_reset_password_layout_error_heading text-2xl font-semibold text-slate-900", children: "Invalid Reset Link" }), _jsx("p", { className: "cls_reset_password_layout_error_message mt-2 text-sm text-slate-600", children: form.tokenError || errorMessage })] }), _jsx(Link, { href: forgotPasswordPath, className: "cls_reset_password_layout_forgot_password_link mt-4 text-sm text-blue-600 hover:text-blue-800 underline", children: "Go to Reset Password page" })] }) }) }));
55
+ return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_reset_password_layout_error flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(XCircle, { className: "cls_reset_password_layout_error_icon h-16 w-16 text-red-600", "aria-hidden": "true" }), _jsxs("div", { className: "cls_reset_password_layout_error_text", children: [_jsx("h1", { className: "cls_reset_password_layout_error_heading text-2xl font-semibold text-slate-900", children: t("reset_password.invalid_link_heading") }), _jsx("p", { className: "cls_reset_password_layout_error_message mt-2 text-sm text-slate-600", children: form.tokenError || resolvedErrorMessage })] }), _jsx(Link, { href: forgotPasswordPath, className: "cls_reset_password_layout_forgot_password_link mt-4 text-sm text-blue-600 hover:text-blue-800 underline", children: t("reset_password.invalid_link_page_link") })] }) }) }));
51
56
  }
52
- return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: returnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), _jsxs("form", { className: "cls_reset_password_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": "Reset password form", children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: "Submit reset password form", cancelAriaLabel: "Cancel reset password form" }), form.isSubmitting && (_jsx("div", { className: "cls_reset_password_layout_submitting_indicator text-sm text-slate-600 text-center", children: "Resetting password..." }))] })] }) }) }));
57
+ return (_jsx(AlreadyLoggedInGuard, { image_src: image_src, image_alt: image_alt, image_background_color: image_background_color, message: alreadyLoggedInMessage, showLogoutButton: showLogoutButton, showReturnHomeButton: showReturnHomeButton, returnHomeButtonLabel: resolvedReturnHomeButtonLabel, returnHomePath: returnHomePath, children: _jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), _jsxs("form", { className: "cls_reset_password_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": t("reset_password.aria.form"), children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: t("reset_password.aria.submit"), cancelAriaLabel: t("reset_password.aria.cancel") }), form.isSubmitting && (_jsx("div", { className: "cls_reset_password_layout_submitting_indicator text-sm text-slate-600 text-center", children: t("reset_password.submitting_indicator") }))] })] }) }) }));
53
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"already_logged_in_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/already_logged_in_guard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,OAAqC,EACrC,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,oBAA4B,EAC5B,QAAQ,GACT,EAAE,yBAAyB,+BAiD3B"}
1
+ {"version":3,"file":"already_logged_in_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/already_logged_in_guard.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,EAAE,MAAM,GAAG,eAAe,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,OAAO,EACP,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqB,EACrB,cAAoB,EACpB,oBAA4B,EAC5B,QAAQ,GACT,EAAE,yBAAyB,+BAoD3B"}
@@ -9,6 +9,7 @@ import { Button } from "../../../ui/button.js";
9
9
  import { TwoColumnAuthLayout } from "./two_column_auth_layout.js";
10
10
  import { useRouter } from "next/navigation";
11
11
  import { Home } from "lucide-react";
12
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
12
13
  // section: component
13
14
  /**
14
15
  * Guard component that shows "already logged in" message if user is authenticated
@@ -16,7 +17,10 @@ import { Home } from "lucide-react";
16
17
  * @param props - Component props including layout config and message customization
17
18
  * @returns Either the "already logged in" UI or the children
18
19
  */
19
- export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color = "#f1f5f9", message = "You're already logged in.", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", requireEmailVerified = false, children, }) {
20
+ export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_color = "#f1f5f9", message, showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel, returnHomePath = "/", requireEmailVerified = false, children, }) {
21
+ const t = useAuthT();
22
+ const resolvedMessage = message !== null && message !== void 0 ? message : t("shared.guard.already_logged_in_message");
23
+ const resolvedReturnHomeButtonLabel = returnHomeButtonLabel !== null && returnHomeButtonLabel !== void 0 ? returnHomeButtonLabel : t("shared.guard.return_home_default");
20
24
  const router = useRouter();
21
25
  const authStatus = use_auth_status();
22
26
  // Check if user should see "already logged in" message
@@ -26,7 +30,7 @@ export function AlreadyLoggedInGuard({ image_src, image_alt, image_background_co
26
30
  !authStatus.loading &&
27
31
  (!requireEmailVerified || authStatus.email_verified === true);
28
32
  if (shouldShowAlreadyLoggedIn) {
29
- return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_already_logged_in_guard flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx("p", { className: "cls_already_logged_in_guard_message text-lg font-medium text-slate-900", children: message }), _jsxs("div", { className: "cls_already_logged_in_guard_actions flex flex-col gap-3 items-center mt-4", children: [showLogoutButton && (_jsx(LogoutButton, { className: "cls_already_logged_in_guard_logout_button", variant: "default" })), showReturnHomeButton && (_jsxs(Button, { onClick: () => router.push(returnHomePath), variant: "outline", className: "cls_already_logged_in_guard_return_home_button", "aria-label": returnHomeButtonLabel, children: [_jsx(Home, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), returnHomeButtonLabel] }))] })] }) }));
33
+ return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, imageBackgroundColor: image_background_color, formContent: _jsxs("div", { className: "cls_already_logged_in_guard flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx("p", { className: "cls_already_logged_in_guard_message text-lg font-medium text-slate-900", children: resolvedMessage }), _jsxs("div", { className: "cls_already_logged_in_guard_actions flex flex-col gap-3 items-center mt-4", children: [showLogoutButton && (_jsx(LogoutButton, { className: "cls_already_logged_in_guard_logout_button", variant: "default" })), showReturnHomeButton && (_jsxs(Button, { onClick: () => router.push(returnHomePath), variant: "outline", className: "cls_already_logged_in_guard_return_home_button", "aria-label": resolvedReturnHomeButtonLabel, children: [_jsx(Home, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), resolvedReturnHomeButtonLabel] }))] })] }) }));
30
34
  }
31
35
  return _jsx(_Fragment, { children: children });
32
36
  }
@@ -9,7 +9,7 @@ export type AuthNavbarProps = {
9
9
  company_name?: string;
10
10
  /** Home link path */
11
11
  home_path?: string;
12
- /** Home link label */
12
+ /** Home link label. Undefined falls back to `t("navbar.home_label_default")`. */
13
13
  home_label?: string;
14
14
  /** Show home link */
15
15
  show_home_link?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"auth_navbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/auth_navbar.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,wBAAgB,UAAU,CAAC,EACzB,SAAc,EACd,UAAe,EACf,WAAgB,EAChB,YAAiB,EACjB,SAAe,EACf,UAAmB,EACnB,cAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,MAAW,EACX,SAAS,GACV,EAAE,eAAe,+BAoDjB"}
1
+ {"version":3,"file":"auth_navbar.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/auth_navbar.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,eAAe,GAAG;IAC5B,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qBAAqB;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wBAAwB;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF,wBAAgB,UAAU,CAAC,EACzB,SAAc,EACd,UAAe,EACf,WAAgB,EAChB,YAAiB,EACjB,SAAe,EACf,UAAU,EACV,cAAqB,EACrB,gBAAgB,EAChB,UAAU,EACV,MAAW,EACX,SAAS,GACV,EAAE,eAAe,+BA0DjB"}
@@ -7,11 +7,16 @@ import Link from "next/link";
7
7
  import Image from "next/image";
8
8
  import { Home } from "lucide-react";
9
9
  import { cn } from "../../../../lib/utils.js";
10
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
10
11
  // section: component
11
- export function AuthNavbar({ logo_path = "", logo_width = 28, logo_height = 28, company_name = "", home_path = "/", home_label = "Home", show_home_link = true, background_color, text_color, height = 40, className, }) {
12
+ export function AuthNavbar({ logo_path = "", logo_width = 28, logo_height = 28, company_name = "", home_path = "/", home_label, show_home_link = true, background_color, text_color, height = 40, className, }) {
13
+ const t = useAuthT();
14
+ const resolvedHomeLabel = home_label !== null && home_label !== void 0 ? home_label : t("navbar.home_label_default");
12
15
  // Only show logo if logo_path is configured (non-empty)
13
16
  const showLogo = logo_path !== "";
14
17
  const hasBrand = showLogo || company_name !== "";
15
18
  const navStyle = Object.assign(Object.assign({ height: `${height}px` }, (background_color && { backgroundColor: background_color })), (text_color && { color: text_color }));
16
- return (_jsx("nav", { className: cn("cls_auth_navbar flex w-full items-center justify-between border-b border-border/40 bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60", className), style: navStyle, "aria-label": "Authentication page navigation", children: _jsxs("div", { className: "cls_auth_navbar_brand flex items-center gap-3", children: [hasBrand && (_jsxs(Link, { href: home_path, className: "cls_auth_navbar_logo_link flex items-center gap-3", children: [showLogo && (_jsx(Image, { src: logo_path, alt: company_name ? `${company_name} logo` : "Logo", width: logo_width, height: logo_height, className: "cls_auth_navbar_logo object-contain" })), company_name && (_jsx("span", { className: "cls_auth_navbar_company_name text-lg font-semibold text-foreground", children: company_name }))] })), !hasBrand && show_home_link && (_jsxs(Link, { href: home_path, className: "cls_auth_navbar_home_link flex items-center gap-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground", "aria-label": `Navigate to ${home_label}`, children: [_jsx(Home, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: home_label })] }))] }) }));
19
+ return (_jsx("nav", { className: cn("cls_auth_navbar flex w-full items-center justify-between border-b border-border/40 bg-background/95 px-4 backdrop-blur supports-[backdrop-filter]:bg-background/60", className), style: navStyle, "aria-label": t("navbar.aria.navigation_default"), children: _jsxs("div", { className: "cls_auth_navbar_brand flex items-center gap-3", children: [hasBrand && (_jsxs(Link, { href: home_path, className: "cls_auth_navbar_logo_link flex items-center gap-3", children: [showLogo && (_jsx(Image, { src: logo_path, alt: company_name
20
+ ? t("navbar.company_logo_alt_default", { company_name })
21
+ : t("navbar.logo_alt_default"), width: logo_width, height: logo_height, className: "cls_auth_navbar_logo object-contain" })), company_name && (_jsx("span", { className: "cls_auth_navbar_company_name text-lg font-semibold text-foreground", children: company_name }))] })), !hasBrand && show_home_link && (_jsxs(Link, { href: home_path, className: "cls_auth_navbar_home_link flex items-center gap-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground", "aria-label": t("navbar.aria.navigate_to_default", { label: resolvedHomeLabel }), children: [_jsx(Home, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: resolvedHomeLabel })] }))] }) }));
17
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"facebook_sign_in_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/facebook_sign_in_button.tsx"],"names":[],"mappings":"AAqBA,MAAM,MAAM,yBAAyB,GAAG;IACtC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAgC,EAChC,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,WAAsD,GACvD,EAAE,yBAAyB,+BA6C3B;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"facebook_sign_in_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/facebook_sign_in_button.tsx"],"names":[],"mappings":"AAsBA,MAAM,MAAM,yBAAyB,GAAG;IACtC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,WAAsD,GACvD,EAAE,yBAAyB,+BA+C3B;AAED,eAAe,oBAAoB,CAAC"}
@@ -8,6 +8,7 @@ import { cn } from "../../../../lib/utils.js";
8
8
  import { useState } from "react";
9
9
  import { Loader2 } from "lucide-react";
10
10
  import { signIn } from "next-auth/react";
11
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
11
12
  // Facebook "f" icon as inline SVG (no external dep)
12
13
  function FacebookIcon({ className }) {
13
14
  return (_jsx("svg", { className: cn("h-5 w-5", className), viewBox: "0 0 24 24", fill: "#1877F2", "aria-hidden": "true", children: _jsx("path", { d: "M24 12.073C24 5.404 18.627 0 12 0S0 5.404 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.413c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z" }) }));
@@ -19,7 +20,9 @@ function FacebookIcon({ className }) {
19
20
  * Initiates the Facebook OAuth flow when clicked
20
21
  * Uses next-auth/react signIn function for proper OAuth flow
21
22
  */
22
- export function FacebookSignInButton({ label = "Continue with Facebook", onClick, disabled = false, className, callbackUrl = "/api/hazo_auth/oauth/facebook/callback", }) {
23
+ export function FacebookSignInButton({ label, onClick, disabled = false, className, callbackUrl = "/api/hazo_auth/oauth/facebook/callback", }) {
24
+ const t = useAuthT();
25
+ const resolvedLabel = label !== null && label !== void 0 ? label : t("shared.oauth.facebook_button_default");
23
26
  const [isLoading, setIsLoading] = useState(false);
24
27
  const handleClick = async () => {
25
28
  if (disabled || isLoading)
@@ -42,6 +45,6 @@ export function FacebookSignInButton({ label = "Continue with Facebook", onClick
42
45
  }
43
46
  }
44
47
  };
45
- return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, disabled: disabled || isLoading, className: cn("cls_facebook_sign_in_button w-full flex items-center justify-center gap-3 h-11 border-slate-300 hover:bg-slate-50 hover:border-slate-400 transition-colors", className), "aria-label": label, children: [isLoading ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin text-slate-600", "aria-hidden": "true" })) : (_jsx(FacebookIcon, { className: "h-5 w-5" })), _jsx("span", { className: "text-slate-700 font-medium", children: isLoading ? "Signing in..." : label })] }));
48
+ return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, disabled: disabled || isLoading, className: cn("cls_facebook_sign_in_button w-full flex items-center justify-center gap-3 h-11 border-slate-300 hover:bg-slate-50 hover:border-slate-400 transition-colors", className), "aria-label": resolvedLabel, children: [isLoading ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin text-slate-600", "aria-hidden": "true" })) : (_jsx(FacebookIcon, { className: "h-5 w-5" })), _jsx("span", { className: "text-slate-700 font-medium", children: isLoading ? t("shared.oauth.signing_in") : resolvedLabel })] }));
46
49
  }
47
50
  export default FacebookSignInButton;
@@ -1 +1 @@
1
- {"version":3,"file":"floating_home_link.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/floating_home_link.tsx"],"names":[],"mappings":"AAUA,MAAM,MAAM,qBAAqB,GAAG;IAClC,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAU,EACV,KAAsB,EACtB,SAAS,GACV,EAAE,qBAAqB,+BAoBvB;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"floating_home_link.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/floating_home_link.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,qBAAqB,GAAG;IAClC,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,IAAU,EACV,KAAK,EACL,SAAS,GACV,EAAE,qBAAqB,+BAsBvB;AAED,eAAe,gBAAgB,CAAC"}
@@ -6,6 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import Link from "next/link";
7
7
  import { ArrowLeft } from "lucide-react";
8
8
  import { cn } from "../../../../lib/utils.js";
9
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
9
10
  // section: component
10
11
  /**
11
12
  * Floating "← Back to home" link. Renders fixed top-left of the viewport so
@@ -16,14 +17,16 @@ import { cn } from "../../../../lib/utils.js";
16
17
  * Reads label/path from props so consumers can localise — the navbar config
17
18
  * helper `get_navbar_config()` is the typical source on the server side.
18
19
  */
19
- export function FloatingHomeLink({ path = "/", label = "Back to home", className, }) {
20
- return (_jsxs(Link, { href: path, "aria-label": label, className: cn(
20
+ export function FloatingHomeLink({ path = "/", label, className, }) {
21
+ const t = useAuthT();
22
+ const resolvedLabel = label !== null && label !== void 0 ? label : t("shared.floating_home_link.label");
23
+ return (_jsxs(Link, { href: path, "aria-label": resolvedLabel, className: cn(
21
24
  // Positioning: fixed top-left, above auth content, with a healthy
22
25
  // safe-area margin so it never collides with brand-panel chrome.
23
26
  "cls_floating_home_link fixed left-4 top-4 z-50 inline-flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium",
24
27
  // Visuals: subtle pill that adapts to whatever brand backdrop the
25
28
  // consumer has rendered. Uses neutral text so it works on both light
26
29
  // brand panels and dark ones.
27
- "bg-background/70 text-foreground/80 shadow-sm backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground", className), children: [_jsx(ArrowLeft, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: label })] }));
30
+ "bg-background/70 text-foreground/80 shadow-sm backdrop-blur-sm transition-colors hover:bg-background hover:text-foreground", className), children: [_jsx(ArrowLeft, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: resolvedLabel })] }));
28
31
  }
29
32
  export default FloatingHomeLink;
@@ -1 +1 @@
1
- {"version":3,"file":"form_action_buttons.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/form_action_buttons.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAG5E,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAGF,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,WAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,eAA+B,EAC/B,eAA+B,EAC/B,SAAS,EACT,UAAkB,GACnB,EAAE,sBAAsB,+BAoCxB"}
1
+ {"version":3,"file":"form_action_buttons.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/form_action_buttons.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAI5E,KAAK,sBAAsB,GAAG;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,qBAAqB,CAAC;IACrC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAGF,wBAAgB,iBAAiB,CAAC,EAChC,WAAW,EACX,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,eAAe,EACf,SAAS,EACT,UAAkB,GACnB,EAAE,sBAAsB,+BAwCxB"}
@@ -3,13 +3,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  // section: imports
4
4
  import { CircleCheckBig, CircleX } from "lucide-react";
5
5
  import { Button } from "../../../ui/button.js";
6
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
6
7
  // section: component
7
- export function FormActionButtons({ submitLabel, cancelLabel = "Cancel", buttonPalette, isSubmitDisabled, onCancel, submitAriaLabel = "Submit form", cancelAriaLabel = "Cancel form", className, hideCancel = false, }) {
8
- return (_jsxs("div", { className: `cls_form_action_buttons mt-2 flex flex-wrap items-center justify-end gap-4 ${className !== null && className !== void 0 ? className : ""}`, children: [_jsxs(Button, { type: "submit", disabled: isSubmitDisabled, className: "cls_form_action_submit_button flex shrink-0 items-center gap-2", "aria-label": submitAriaLabel, style: {
8
+ export function FormActionButtons({ submitLabel, cancelLabel, buttonPalette, isSubmitDisabled, onCancel, submitAriaLabel, cancelAriaLabel, className, hideCancel = false, }) {
9
+ const t = useAuthT();
10
+ const resolvedCancelLabel = cancelLabel !== null && cancelLabel !== void 0 ? cancelLabel : t("shared.cancel_button");
11
+ const resolvedSubmitAriaLabel = submitAriaLabel !== null && submitAriaLabel !== void 0 ? submitAriaLabel : t("shared.form_action.submit_aria_default");
12
+ const resolvedCancelAriaLabel = cancelAriaLabel !== null && cancelAriaLabel !== void 0 ? cancelAriaLabel : t("shared.form_action.cancel_aria_default");
13
+ return (_jsxs("div", { className: `cls_form_action_buttons mt-2 flex flex-wrap items-center justify-end gap-4 ${className !== null && className !== void 0 ? className : ""}`, children: [_jsxs(Button, { type: "submit", disabled: isSubmitDisabled, className: "cls_form_action_submit_button flex shrink-0 items-center gap-2", "aria-label": resolvedSubmitAriaLabel, style: {
9
14
  backgroundColor: buttonPalette.submitBackground,
10
15
  color: buttonPalette.submitText,
11
- }, children: [_jsx(CircleCheckBig, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: submitLabel })] }), !hideCancel && onCancel && (_jsxs(Button, { type: "button", variant: "outline", onClick: onCancel, className: "cls_form_action_cancel_button flex shrink-0 items-center gap-2", "aria-label": cancelAriaLabel, style: {
16
+ }, children: [_jsx(CircleCheckBig, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: submitLabel })] }), !hideCancel && onCancel && (_jsxs(Button, { type: "button", variant: "outline", onClick: onCancel, className: "cls_form_action_cancel_button flex shrink-0 items-center gap-2", "aria-label": resolvedCancelAriaLabel, style: {
12
17
  borderColor: buttonPalette.cancelBorder,
13
18
  color: buttonPalette.cancelText,
14
- }, children: [_jsx(CircleX, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: cancelLabel })] }))] }));
19
+ }, children: [_jsx(CircleX, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: resolvedCancelLabel })] }))] }));
15
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"google_sign_in_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/google_sign_in_button.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,uBAAuB,GAAG;IACpC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAA8B,EAC9B,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,WAAoD,GACrD,EAAE,uBAAuB,+BAmDzB;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"google_sign_in_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/google_sign_in_button.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,uBAAuB,GAAG;IACpC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,KAAK,EACL,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,WAAoD,GACrD,EAAE,uBAAuB,+BAqDzB;AAED,eAAe,kBAAkB,CAAC"}
@@ -9,6 +9,7 @@ import { cn } from "../../../../lib/utils.js";
9
9
  import { useState } from "react";
10
10
  import { Loader2 } from "lucide-react";
11
11
  import { signIn } from "next-auth/react";
12
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
12
13
  // section: component
13
14
  /**
14
15
  * Google Sign-In button component
@@ -16,7 +17,9 @@ import { signIn } from "next-auth/react";
16
17
  * Initiates the Google OAuth flow when clicked
17
18
  * Uses next-auth/react signIn function for proper OAuth flow
18
19
  */
19
- export function GoogleSignInButton({ label = "Continue with Google", onClick, disabled = false, className, callbackUrl = "/api/hazo_auth/oauth/google/callback", }) {
20
+ export function GoogleSignInButton({ label, onClick, disabled = false, className, callbackUrl = "/api/hazo_auth/oauth/google/callback", }) {
21
+ const t = useAuthT();
22
+ const resolvedLabel = label !== null && label !== void 0 ? label : t("shared.oauth.google_button_default");
20
23
  const [isLoading, setIsLoading] = useState(false);
21
24
  const handleClick = async () => {
22
25
  if (disabled || isLoading)
@@ -45,6 +48,6 @@ export function GoogleSignInButton({ label = "Continue with Google", onClick, di
45
48
  }
46
49
  }
47
50
  };
48
- return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, disabled: disabled || isLoading, className: cn("cls_google_sign_in_button w-full flex items-center justify-center gap-3 h-11 border-slate-300 hover:bg-slate-50 hover:border-slate-400 transition-colors", className), "aria-label": label, children: [isLoading ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin text-slate-600", "aria-hidden": "true" })) : (_jsx(GoogleIcon, { className: "h-5 w-5" })), _jsx("span", { className: "text-slate-700 font-medium", children: isLoading ? "Signing in..." : label })] }));
51
+ return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, disabled: disabled || isLoading, className: cn("cls_google_sign_in_button w-full flex items-center justify-center gap-3 h-11 border-slate-300 hover:bg-slate-50 hover:border-slate-400 transition-colors", className), "aria-label": resolvedLabel, children: [isLoading ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin text-slate-600", "aria-hidden": "true" })) : (_jsx(GoogleIcon, { className: "h-5 w-5" })), _jsx("span", { className: "text-slate-700 font-medium", children: isLoading ? t("shared.oauth.signing_in") : resolvedLabel })] }));
49
52
  }
50
53
  export default GoogleSignInButton;
@@ -1 +1 @@
1
- {"version":3,"file":"logout_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/logout_button.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IACjF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CACzC,CAAC;AAGF,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAmB,EACnB,IAAgB,GACjB,EAAE,iBAAiB,+BAmDnB"}
1
+ {"version":3,"file":"logout_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/logout_button.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,MAAM,CAAC;IACjF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;CACzC,CAAC;AAGF,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,OAAmB,EACnB,IAAgB,GACjB,EAAE,iBAAiB,+BAoDnB"}
@@ -9,10 +9,11 @@ import { Button } from "../../../ui/button.js";
9
9
  import { LogOut } from "lucide-react";
10
10
  import { toast } from "sonner";
11
11
  import { trigger_auth_status_refresh } from "../hooks/use_auth_status.js";
12
- import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
12
+ import { useHazoAuthConfig, useAuthT } from "../../../../contexts/hazo_auth_provider.js";
13
13
  // section: component
14
14
  export function LogoutButton({ className, variant = "outline", size = "default", }) {
15
15
  const { apiBasePath } = useHazoAuthConfig();
16
+ const t = useAuthT();
16
17
  const router = useRouter();
17
18
  const [isLoggingOut, setIsLoggingOut] = useState(false);
18
19
  const handleLogout = async () => {
@@ -26,21 +27,21 @@ export function LogoutButton({ className, variant = "outline", size = "default",
26
27
  });
27
28
  const data = await response.json();
28
29
  if (!response.ok || !data.success) {
29
- throw new Error(data.error || "Logout failed");
30
+ throw new Error(data.error || t("shared.logout.error_default"));
30
31
  }
31
- toast.success("Logged out successfully");
32
+ toast.success(t("shared.logout.success_toast"));
32
33
  // Trigger auth status refresh in all components (navbar, sidebar, etc.)
33
34
  trigger_auth_status_refresh();
34
35
  // Refresh the page to update authentication state (cookies are cleared server-side)
35
36
  router.refresh();
36
37
  }
37
38
  catch (error) {
38
- const errorMessage = error instanceof Error ? error.message : "Logout failed. Please try again.";
39
+ const errorMessage = error instanceof Error ? error.message : t("shared.logout.error_retry");
39
40
  toast.error(errorMessage);
40
41
  }
41
42
  finally {
42
43
  setIsLoggingOut(false);
43
44
  }
44
45
  };
45
- return (_jsxs(Button, { onClick: handleLogout, disabled: isLoggingOut, variant: variant, size: size, className: className, "aria-label": "Logout", children: [_jsx(LogOut, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), isLoggingOut ? "Logging out..." : "Logout"] }));
46
+ return (_jsxs(Button, { onClick: handleLogout, disabled: isLoggingOut, variant: variant, size: size, className: className, "aria-label": t("shared.logout.label"), children: [_jsx(LogOut, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), isLoggingOut ? t("shared.logout.logging_out") : t("shared.logout.label")] }));
46
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"oauth_divider.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/oauth_divider.tsx"],"names":[],"mappings":"AAKA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAA+B,EAC/B,SAAS,GACV,EAAE,iBAAiB,+BAoBnB;AAED,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"oauth_divider.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/oauth_divider.tsx"],"names":[],"mappings":"AASA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,oCAAoC;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAGF;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,IAAI,EACJ,SAAS,GACV,EAAE,iBAAiB,+BAsBnB;AAED,eAAe,YAAY,CAAC"}
@@ -1,13 +1,18 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  // file_description: Visual divider between OAuth buttons and email/password form
2
+ // section: client_directive
3
+ "use client";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
5
  // section: imports
4
6
  import { cn } from "../../../../lib/utils.js";
7
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
5
8
  // section: component
6
9
  /**
7
10
  * Visual divider component to separate OAuth buttons from email/password form
8
11
  * Displays a horizontal line with text in the center
9
12
  */
10
- export function OAuthDivider({ text = "or continue with email", className, }) {
11
- return (_jsxs("div", { className: cn("cls_oauth_divider relative my-6", className), role: "separator", "aria-orientation": "horizontal", children: [_jsx("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true", children: _jsx("span", { className: "w-full border-t border-slate-200" }) }), _jsx("div", { className: "relative flex justify-center text-sm", children: _jsx("span", { className: "bg-white px-3 text-slate-500", children: text }) })] }));
13
+ export function OAuthDivider({ text, className, }) {
14
+ const t = useAuthT();
15
+ const resolvedText = text !== null && text !== void 0 ? text : t("shared.oauth_divider_default");
16
+ return (_jsxs("div", { className: cn("cls_oauth_divider relative my-6", className), role: "separator", "aria-orientation": "horizontal", children: [_jsx("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true", children: _jsx("span", { className: "w-full border-t border-slate-200" }) }), _jsx("div", { className: "relative flex justify-center text-sm", children: _jsx("span", { className: "bg-white px-3 text-slate-500", children: resolvedText }) })] }));
12
17
  }
13
18
  export default OAuthDivider;
@@ -1 +1 @@
1
- {"version":3,"file":"password_field.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/password_field.tsx"],"names":[],"mappings":"AAWA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAGF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,YAAY,GACb,EAAE,kBAAkB,+BA6CpB"}
1
+ {"version":3,"file":"password_field.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/password_field.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,kBAAkB,EAAE,MAAM,IAAI,CAAC;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAClC,CAAC;AAGF,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,KAAK,EACL,WAAW,EACX,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,YAAY,GACb,EAAE,kBAAkB,+BA8CpB"}
@@ -7,9 +7,11 @@ import { Eye, EyeOff } from "lucide-react";
7
7
  import { Button } from "../../../ui/button.js";
8
8
  import { Input } from "../../../ui/input.js";
9
9
  import { FieldErrorMessage } from "./field_error_message.js";
10
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
10
11
  // section: component
11
12
  export function PasswordField({ inputId, ariaLabel, value, placeholder, autoComplete, isVisible, onChange, onToggleVisibility, errorMessage, }) {
12
- return (_jsxs("div", { className: "cls_password_field_wrapper", children: [_jsxs("div", { className: "cls_password_field_container relative", style: { position: "relative" }, children: [_jsx(Input, { id: inputId, type: isVisible ? "text" : "password", value: value, onChange: (event) => onChange(event.target.value), autoComplete: autoComplete, placeholder: placeholder, "aria-label": ariaLabel, className: "cls_password_field_input pr-11", style: { paddingRight: "2.75rem" } }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": `${isVisible ? "Hide" : "Show"} ${ariaLabel.toLowerCase()}`, onClick: onToggleVisibility, className: "cls_password_field_toggle absolute inset-y-0 right-1 my-auto h-8 w-8 text-muted-foreground hover:bg-transparent hover:text-foreground", style: {
13
+ const t = useAuthT();
14
+ return (_jsxs("div", { className: "cls_password_field_wrapper", children: [_jsxs("div", { className: "cls_password_field_container relative", style: { position: "relative" }, children: [_jsx(Input, { id: inputId, type: isVisible ? "text" : "password", value: value, onChange: (event) => onChange(event.target.value), autoComplete: autoComplete, placeholder: placeholder, "aria-label": ariaLabel, className: "cls_password_field_input pr-11", style: { paddingRight: "2.75rem" } }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": `${isVisible ? t("shared.password_field.hide") : t("shared.password_field.show")} ${ariaLabel.toLowerCase()}`, onClick: onToggleVisibility, className: "cls_password_field_toggle absolute inset-y-0 right-1 my-auto h-8 w-8 text-muted-foreground hover:bg-transparent hover:text-foreground", style: {
13
15
  position: "absolute",
14
16
  top: "50%",
15
17
  right: "0.25rem",
@@ -1,7 +1,9 @@
1
1
  import type { ProfilePicMenuMenuItem } from "../../../../lib/profile_pic_menu_config.server";
2
2
  export type ProfilePicMenuProps = {
3
3
  show_single_button?: boolean;
4
+ /** Undefined falls back to `t("profile_pic_menu.sign_up_label_default")`. */
4
5
  sign_up_label?: string;
6
+ /** Undefined falls back to `t("profile_pic_menu.sign_in_label_default")`. */
5
7
  sign_in_label?: string;
6
8
  register_path?: string;
7
9
  login_path?: string;
@@ -19,6 +21,8 @@ export type ProfilePicMenuProps = {
19
21
  className?: string;
20
22
  avatar_size?: "default" | "sm" | "lg";
21
23
  variant?: "dropdown" | "sidebar";
24
+ /** Label for sidebar variant group. Undefined falls back to
25
+ * `t("profile_pic_menu.sidebar_group_label_default")`. */
22
26
  sidebar_group_label?: string;
23
27
  };
24
28
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"profile_pic_menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAI7F,MAAM,MAAM,mBAAmB,GAAG;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,kBAA0B,EAC1B,aAAyB,EACzB,aAAyB,EACzB,aAAqC,EACrC,UAA+B,EAC/B,aAAwC,EACxC,WAAW,EACX,iBAAsB,EACtB,SAAS,EACT,WAAuB,EACvB,OAAoB,EACpB,mBAA+B,GAChC,EAAE,mBAAmB,+BA8gBrB"}
1
+ {"version":3,"file":"profile_pic_menu.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAI7F,MAAM,MAAM,mBAAmB,GAAG;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC;+DAC2D;IAC3D,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,EAC7B,kBAA0B,EAC1B,aAAa,EACb,aAAa,EACb,aAAqC,EACrC,UAA+B,EAC/B,aAAwC,EACxC,WAAW,EACX,iBAAsB,EACtB,SAAS,EACT,WAAuB,EACvB,OAAoB,EACpB,mBAAmB,GACpB,EAAE,mBAAmB,+BA2hBrB"}