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":"profile_picture_gravatar_tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/profile_picture_gravatar_tab.tsx"],"names":[],"mappings":"AAaA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,MAAM,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,KAAK,EACL,WAAW,EACX,mBAAmB,EACnB,QAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,GACb,EAAE,8BAA8B,+BAuGhC"}
1
+ {"version":3,"file":"profile_picture_gravatar_tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/profile_picture_gravatar_tab.tsx"],"names":[],"mappings":"AAcA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,wBAAwB,EAAE,MAAM,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,KAAK,EACL,WAAW,EACX,mBAAmB,EACnB,QAAgB,EAChB,oBAAoB,EACpB,wBAAwB,EACxB,YAAY,GACb,EAAE,8BAA8B,+BAwGhC"}
@@ -9,6 +9,7 @@ import { Label } from "../../../ui/label.js";
9
9
  import { Avatar, AvatarImage, AvatarFallback } from "../../../ui/avatar.js";
10
10
  import { Info } from "lucide-react";
11
11
  import gravatarUrl from "gravatar-url";
12
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
12
13
  // section: component
13
14
  /**
14
15
  * Gravatar tab component for profile picture dialog
@@ -17,6 +18,7 @@ import gravatarUrl from "gravatar-url";
17
18
  * @returns Gravatar tab component
18
19
  */
19
20
  export function ProfilePictureGravatarTab({ email, useGravatar, onUseGravatarChange, disabled = false, gravatarSetupMessage, gravatarNoAccountMessage, gravatarSize, }) {
21
+ const t = useAuthT();
20
22
  const [gravatarUrlState, setGravatarUrlState] = useState("");
21
23
  const [gravatarExists, setGravatarExists] = useState(null);
22
24
  useEffect(() => {
@@ -44,5 +46,5 @@ export function ProfilePictureGravatarTab({ email, useGravatar, onUseGravatarCha
44
46
  }
45
47
  return "?";
46
48
  };
47
- return (_jsxs("div", { className: "cls_profile_picture_gravatar_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_gravatar_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-gravatar", checked: useGravatar, onCheckedChange: onUseGravatarChange, disabled: disabled, className: "cls_profile_picture_gravatar_tab_switch_input", "aria-label": "Use Gravatar photo" }), _jsx(Label, { htmlFor: "use-gravatar", className: "cls_profile_picture_gravatar_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: "Use Gravatar photo" })] }), _jsx("div", { className: "cls_profile_picture_gravatar_tab_preview flex flex-col items-center gap-4 p-6 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)]", children: gravatarExists === true ? (_jsxs(_Fragment, { children: [_jsxs(Avatar, { className: "cls_profile_picture_gravatar_tab_avatar h-32 w-32", children: [_jsx(AvatarImage, { src: gravatarUrlState, alt: "Gravatar profile picture", className: "cls_profile_picture_gravatar_tab_avatar_image" }), _jsx(AvatarFallback, { className: "cls_profile_picture_gravatar_tab_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() })] }), _jsx("p", { className: "cls_profile_picture_gravatar_tab_success_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Your Gravatar is available and will be used as your profile picture." })] })) : gravatarExists === false ? (_jsx(_Fragment, { children: _jsxs("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar flex flex-col items-center gap-4", children: [_jsx("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar_icon flex items-center justify-center w-16 h-16 rounded-full bg-[var(--hazo-bg-muted)]", children: _jsx(Info, { className: "h-8 w-8 text-[var(--hazo-text-subtle)]", "aria-hidden": "true" }) }), _jsxs("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar_content flex flex-col gap-2 text-center", children: [_jsx("p", { className: "cls_profile_picture_gravatar_tab_no_gravatar_title text-sm font-medium text-[var(--hazo-text-primary)]", children: "No Gravatar found" }), _jsxs("p", { className: "cls_profile_picture_gravatar_tab_no_gravatar_message text-sm text-[var(--hazo-text-muted)]", children: [gravatarSetupMessage, " ", _jsx("span", { className: "font-semibold", children: email }), ":"] }), _jsxs("ol", { className: "cls_profile_picture_gravatar_tab_no_gravatar_steps text-sm text-[var(--hazo-text-muted)] list-decimal list-inside space-y-1 mt-2", children: [_jsxs("li", { children: ["Visit ", _jsx("a", { href: "https://gravatar.com", target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 hover:text-blue-700 underline", children: "gravatar.com" })] }), _jsxs("li", { children: ["Sign up or log in with your email: ", _jsx("span", { className: "font-mono text-xs", children: email })] }), _jsx("li", { children: "Upload a profile picture" }), _jsx("li", { children: "Return here and refresh to see your Gravatar" })] })] })] }) })) : (_jsx(_Fragment, { children: _jsx("div", { className: "cls_profile_picture_gravatar_tab_loading flex items-center justify-center", children: _jsx("p", { className: "cls_profile_picture_gravatar_tab_loading_text text-sm text-[var(--hazo-text-muted)]", children: "Checking Gravatar..." }) }) })) })] }));
49
+ return (_jsxs("div", { className: "cls_profile_picture_gravatar_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_gravatar_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-gravatar", checked: useGravatar, onCheckedChange: onUseGravatarChange, disabled: disabled, className: "cls_profile_picture_gravatar_tab_switch_input", "aria-label": t("my_settings.gravatar_tab.use_gravatar_label") }), _jsx(Label, { htmlFor: "use-gravatar", className: "cls_profile_picture_gravatar_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: t("my_settings.gravatar_tab.use_gravatar_label") })] }), _jsx("div", { className: "cls_profile_picture_gravatar_tab_preview flex flex-col items-center gap-4 p-6 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)]", children: gravatarExists === true ? (_jsxs(_Fragment, { children: [_jsxs(Avatar, { className: "cls_profile_picture_gravatar_tab_avatar h-32 w-32", children: [_jsx(AvatarImage, { src: gravatarUrlState, alt: t("my_settings.gravatar_tab.avatar_alt"), className: "cls_profile_picture_gravatar_tab_avatar_image" }), _jsx(AvatarFallback, { className: "cls_profile_picture_gravatar_tab_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() })] }), _jsx("p", { className: "cls_profile_picture_gravatar_tab_success_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.gravatar_tab.success_text") })] })) : gravatarExists === false ? (_jsx(_Fragment, { children: _jsxs("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar flex flex-col items-center gap-4", children: [_jsx("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar_icon flex items-center justify-center w-16 h-16 rounded-full bg-[var(--hazo-bg-muted)]", children: _jsx(Info, { className: "h-8 w-8 text-[var(--hazo-text-subtle)]", "aria-hidden": "true" }) }), _jsxs("div", { className: "cls_profile_picture_gravatar_tab_no_gravatar_content flex flex-col gap-2 text-center", children: [_jsx("p", { className: "cls_profile_picture_gravatar_tab_no_gravatar_title text-sm font-medium text-[var(--hazo-text-primary)]", children: t("my_settings.gravatar_tab.not_found_title") }), _jsxs("p", { className: "cls_profile_picture_gravatar_tab_no_gravatar_message text-sm text-[var(--hazo-text-muted)]", children: [gravatarSetupMessage, " ", _jsx("span", { className: "font-semibold", children: email }), ":"] }), _jsxs("ol", { className: "cls_profile_picture_gravatar_tab_no_gravatar_steps text-sm text-[var(--hazo-text-muted)] list-decimal list-inside space-y-1 mt-2", children: [_jsxs("li", { children: [t("my_settings.gravatar_tab.visit_prefix"), " ", _jsx("a", { href: "https://gravatar.com", target: "_blank", rel: "noopener noreferrer", className: "text-blue-600 hover:text-blue-700 underline", children: "gravatar.com" })] }), _jsxs("li", { children: [t("my_settings.gravatar_tab.step_sign_in"), " ", _jsx("span", { className: "font-mono text-xs", children: email })] }), _jsx("li", { children: t("my_settings.gravatar_tab.step_upload") }), _jsx("li", { children: t("my_settings.gravatar_tab.step_return") })] })] })] }) })) : (_jsx(_Fragment, { children: _jsx("div", { className: "cls_profile_picture_gravatar_tab_loading flex items-center justify-center", children: _jsx("p", { className: "cls_profile_picture_gravatar_tab_loading_text text-sm text-[var(--hazo-text-muted)]", children: t("my_settings.gravatar_tab.checking") }) }) })) })] }));
48
50
  }
@@ -20,7 +20,7 @@ import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
20
20
  * @returns Library tab component
21
21
  */
22
22
  export function ProfilePictureLibraryTab({ useLibrary, onUseLibraryChange, onPhotoSelect, disabled = false, libraryPhotoPath, currentPhotoUrl, libraryTooltipMessage, tooltipIconSizeSmall, libraryPhotoGridColumns, libraryPhotoPreviewSize, }) {
23
- const { apiBasePath } = useHazoAuthConfig();
23
+ const { apiBasePath, t } = useHazoAuthConfig();
24
24
  const [categories, setCategories] = useState([]);
25
25
  const [selectedCategory, setSelectedCategory] = useState(null);
26
26
  const [photos, setPhotos] = useState([]);
@@ -45,7 +45,7 @@ export function ProfilePictureLibraryTab({ useLibrary, onUseLibraryChange, onPho
45
45
  catch (error) {
46
46
  // Client-side error handling - show toast notification
47
47
  import("sonner").then(({ toast }) => {
48
- toast.error("Failed to load photo categories. Please try again.");
48
+ toast.error(t("my_settings.library_tab.toast_load_categories_failed"));
49
49
  });
50
50
  }
51
51
  finally {
@@ -96,7 +96,7 @@ export function ProfilePictureLibraryTab({ useLibrary, onUseLibraryChange, onPho
96
96
  catch (error) {
97
97
  // Client-side error handling - show toast notification
98
98
  import("sonner").then(({ toast }) => {
99
- toast.error("Failed to load photos. Please try again.");
99
+ toast.error(t("my_settings.library_tab.toast_load_photos_failed"));
100
100
  });
101
101
  }
102
102
  finally {
@@ -120,21 +120,24 @@ export function ProfilePictureLibraryTab({ useLibrary, onUseLibraryChange, onPho
120
120
  gridTemplateColumns: `repeat(${validColumns}, minmax(0, 1fr))`,
121
121
  };
122
122
  };
123
- return (_jsxs("div", { className: "cls_profile_picture_library_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_library_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-library", checked: useLibrary, onCheckedChange: onUseLibraryChange, disabled: disabled, className: "cls_profile_picture_library_tab_switch_input", "aria-label": "Use library photo" }), _jsxs(Label, { htmlFor: "use-library", className: "cls_profile_picture_library_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: ["Use library photo", _jsx(HazoUITooltip, { message: libraryTooltipMessage, iconSize: tooltipIconSizeSmall, side: "top" })] })] }), _jsxs("div", { className: "cls_profile_picture_library_tab_content grid grid-cols-12 gap-4", children: [_jsxs("div", { className: "cls_profile_picture_library_tab_categories_container flex flex-col gap-2 col-span-3", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_categories_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: "Categories" }), loadingCategories ? (_jsx("div", { className: "cls_profile_picture_library_tab_loading flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx(Loader2, { className: "h-6 w-6 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }) })) : categories.length > 0 ? (_jsx(VerticalTabs, { value: selectedCategory || categories[0], onValueChange: setSelectedCategory, className: "cls_profile_picture_library_tab_vertical_tabs", children: _jsx(VerticalTabsList, { className: "cls_profile_picture_library_tab_vertical_tabs_list w-full", children: categories.map((category) => (_jsx(VerticalTabsTrigger, { value: category, className: "cls_profile_picture_library_tab_vertical_tabs_trigger w-full justify-start", children: category }, category))) }) })) : (_jsx("div", { className: "cls_profile_picture_library_tab_no_categories flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx("p", { className: "cls_profile_picture_library_tab_no_categories_text text-sm text-[var(--hazo-text-muted)]", children: "No categories available" }) }))] }), _jsxs("div", { className: "cls_profile_picture_library_tab_photos_container flex flex-col gap-2 col-span-6", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_photos_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: "Photos" }), loadingPhotos ? (_jsx("div", { className: "cls_profile_picture_library_tab_photos_loading flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx(Loader2, { className: "h-6 w-6 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }) })) : photos.length > 0 ? (_jsx("div", { className: "cls_profile_picture_library_tab_photos_grid grid gap-3 overflow-y-auto p-4 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px] max-h-[400px]", style: getGridColumnsStyle(libraryPhotoGridColumns), children: photos.map((photoUrl) => (_jsx("button", { type: "button", onClick: () => handlePhotoClick(photoUrl), className: `
123
+ return (_jsxs("div", { className: "cls_profile_picture_library_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_library_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-library", checked: useLibrary, onCheckedChange: onUseLibraryChange, disabled: disabled, className: "cls_profile_picture_library_tab_switch_input", "aria-label": t("my_settings.library_tab.use_library_label") }), _jsxs(Label, { htmlFor: "use-library", className: "cls_profile_picture_library_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: [t("my_settings.library_tab.use_library_label"), _jsx(HazoUITooltip, { message: libraryTooltipMessage, iconSize: tooltipIconSizeSmall, side: "top" })] })] }), _jsxs("div", { className: "cls_profile_picture_library_tab_content grid grid-cols-12 gap-4", children: [_jsxs("div", { className: "cls_profile_picture_library_tab_categories_container flex flex-col gap-2 col-span-3", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_categories_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: t("my_settings.library_tab.categories_label") }), loadingCategories ? (_jsx("div", { className: "cls_profile_picture_library_tab_loading flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx(Loader2, { className: "h-6 w-6 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }) })) : categories.length > 0 ? (_jsx(VerticalTabs, { value: selectedCategory || categories[0], onValueChange: setSelectedCategory, className: "cls_profile_picture_library_tab_vertical_tabs", children: _jsx(VerticalTabsList, { className: "cls_profile_picture_library_tab_vertical_tabs_list w-full", children: categories.map((category) => (_jsx(VerticalTabsTrigger, { value: category, className: "cls_profile_picture_library_tab_vertical_tabs_trigger w-full justify-start", children: category }, category))) }) })) : (_jsx("div", { className: "cls_profile_picture_library_tab_no_categories flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx("p", { className: "cls_profile_picture_library_tab_no_categories_text text-sm text-[var(--hazo-text-muted)]", children: t("my_settings.library_tab.no_categories_text") }) }))] }), _jsxs("div", { className: "cls_profile_picture_library_tab_photos_container flex flex-col gap-2 col-span-6", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_photos_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: t("my_settings.library_tab.photos_label") }), loadingPhotos ? (_jsx("div", { className: "cls_profile_picture_library_tab_photos_loading flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx(Loader2, { className: "h-6 w-6 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }) })) : photos.length > 0 ? (_jsx("div", { className: "cls_profile_picture_library_tab_photos_grid grid gap-3 overflow-y-auto p-4 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px] max-h-[400px]", style: getGridColumnsStyle(libraryPhotoGridColumns), children: photos.map((photoUrl) => {
124
+ var _a, _b;
125
+ return (_jsx("button", { type: "button", onClick: () => handlePhotoClick(photoUrl), className: `
124
126
  cls_profile_picture_library_tab_photo_thumbnail
125
127
  w-full aspect-square rounded-lg overflow-hidden border-2 transition-colors cursor-pointer
126
128
  ${selectedPhoto === photoUrl ? "border-blue-500 ring-2 ring-blue-200" : "border-[var(--hazo-border)] hover:border-[var(--hazo-border-emphasis)]"}
127
- `, style: { minHeight: '80px', minWidth: '80px', aspectRatio: '1/1' }, "aria-label": `Select photo ${photoUrl.split('/').pop()}`, children: _jsx("img", { src: photoUrl, alt: `Library photo ${photoUrl.split('/').pop()}`, className: "cls_profile_picture_library_tab_photo_thumbnail_image w-full h-full object-cover", loading: "lazy", onError: (e) => {
128
- // Fallback if image fails to load
129
- const target = e.target;
130
- target.style.display = 'none';
131
- } }) }, photoUrl))) })) : (_jsx("div", { className: "cls_profile_picture_library_tab_no_photos flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx("p", { className: "cls_profile_picture_library_tab_no_photos_text text-sm text-[var(--hazo-text-muted)]", children: "No photos in this category" }) }))] }), _jsxs("div", { className: "cls_profile_picture_library_tab_preview_container flex flex-col gap-2 col-span-3", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_preview_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: "Preview" }), selectedPhoto ? (_jsxs("div", { className: "cls_profile_picture_library_tab_preview flex flex-col items-center gap-4 p-4 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px] justify-center", children: [_jsx("div", { className: "cls_profile_picture_library_tab_preview_image_wrapper w-full flex items-center justify-center", children: _jsx("img", { src: selectedPhoto, alt: "Selected library photo preview", className: "cls_profile_picture_library_tab_preview_image max-w-full max-h-[350px] rounded-lg object-contain", onError: (e) => {
129
+ `, style: { minHeight: '80px', minWidth: '80px', aspectRatio: '1/1' }, "aria-label": t("my_settings.library_tab.select_photo_aria", { name: (_a = photoUrl.split('/').pop()) !== null && _a !== void 0 ? _a : "" }), children: _jsx("img", { src: photoUrl, alt: t("my_settings.library_tab.photo_alt", { name: (_b = photoUrl.split('/').pop()) !== null && _b !== void 0 ? _b : "" }), className: "cls_profile_picture_library_tab_photo_thumbnail_image w-full h-full object-cover", loading: "lazy", onError: (e) => {
130
+ // Fallback if image fails to load
131
+ const target = e.target;
132
+ target.style.display = 'none';
133
+ } }) }, photoUrl));
134
+ }) })) : (_jsx("div", { className: "cls_profile_picture_library_tab_no_photos flex items-center justify-center p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: _jsx("p", { className: "cls_profile_picture_library_tab_no_photos_text text-sm text-[var(--hazo-text-muted)]", children: t("my_settings.library_tab.no_photos_text") }) }))] }), _jsxs("div", { className: "cls_profile_picture_library_tab_preview_container flex flex-col gap-2 col-span-3", children: [_jsx(Label, { className: "cls_profile_picture_library_tab_preview_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: t("my_settings.library_tab.preview_label") }), selectedPhoto ? (_jsxs("div", { className: "cls_profile_picture_library_tab_preview flex flex-col items-center gap-4 p-4 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px] justify-center", children: [_jsx("div", { className: "cls_profile_picture_library_tab_preview_image_wrapper w-full flex items-center justify-center", children: _jsx("img", { src: selectedPhoto, alt: t("my_settings.library_tab.preview_alt"), className: "cls_profile_picture_library_tab_preview_image max-w-full max-h-[350px] rounded-lg object-contain", onError: (e) => {
132
135
  // Fallback if preview image fails to load
133
136
  const target = e.target;
134
137
  target.style.display = 'none';
135
138
  const wrapper = target.parentElement;
136
139
  if (wrapper) {
137
- wrapper.innerHTML = '<p class="text-sm text-red-500">Failed to load preview</p>';
140
+ wrapper.innerHTML = `<p class="text-sm text-red-500">${t("my_settings.library_tab.preview_load_failed")}</p>`;
138
141
  }
139
- } }) }), _jsx("p", { className: "cls_profile_picture_library_tab_preview_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Selected photo preview" })] })) : (_jsxs("div", { className: "cls_profile_picture_library_tab_preview_empty flex flex-col items-center justify-center gap-2 p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: [_jsx(Avatar, { className: "cls_profile_picture_library_tab_preview_empty_avatar h-32 w-32", children: _jsx(AvatarFallback, { className: "cls_profile_picture_library_tab_preview_empty_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() }) }), _jsx("p", { className: "cls_profile_picture_library_tab_preview_empty_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Select a photo to see preview" })] }))] })] })] }));
142
+ } }) }), _jsx("p", { className: "cls_profile_picture_library_tab_preview_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.library_tab.preview_selected_text") })] })) : (_jsxs("div", { className: "cls_profile_picture_library_tab_preview_empty flex flex-col items-center justify-center gap-2 p-8 border border-[var(--hazo-border)] rounded-lg bg-[var(--hazo-bg-subtle)] min-h-[400px]", children: [_jsx(Avatar, { className: "cls_profile_picture_library_tab_preview_empty_avatar h-32 w-32", children: _jsx(AvatarFallback, { className: "cls_profile_picture_library_tab_preview_empty_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() }) }), _jsx("p", { className: "cls_profile_picture_library_tab_preview_empty_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.library_tab.preview_empty_text") })] }))] })] })] }));
140
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"profile_picture_upload_tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/profile_picture_upload_tab.tsx"],"names":[],"mappings":"AA2BA,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,4BAAkC,EAClC,wBAAmC,EAAE,eAAe;AACpD,qBAAgE,EAChE,SAAwB,EACxB,gBAA+B,EAC/B,eAA0B,EAC1B,aAAsB,GACvB,EAAE,4BAA4B,+BAgU9B"}
1
+ {"version":3,"file":"profile_picture_upload_tab.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/profile_picture_upload_tab.tsx"],"names":[],"mappings":"AA4BA,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,OAAO,CAAC;IACnB,iBAAiB,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IACtC,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAGF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,EACtC,SAAS,EACT,iBAAiB,EACjB,YAAY,EACZ,OAAO,EACP,aAAa,EACb,QAAgB,EAChB,cAAc,EACd,0BAA0B,EAC1B,4BAAkC,EAClC,wBAAmC,EAAE,eAAe;AACpD,qBAAgE,EAChE,SAAS,EACT,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,EAAE,4BAA4B,+BA0U9B"}
@@ -11,6 +11,7 @@ import { Upload, X, Loader2, Info } from "lucide-react";
11
11
  import { Button } from "../../../ui/button.js";
12
12
  import imageCompression from "browser-image-compression";
13
13
  import { HazoUiImageCropperDialog } from "hazo_ui";
14
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
14
15
  // section: helpers
15
16
  /** Resolves true if the browser can decode this image file, false otherwise (e.g. desktop HEIC). */
16
17
  function can_decode_image(file) {
@@ -33,7 +34,12 @@ function can_decode_image(file) {
33
34
  * @returns Upload tab component
34
35
  */
35
36
  export function ProfilePictureUploadTab({ useUpload, onUseUploadChange, onFileSelect, maxSize, uploadEnabled, disabled = false, currentPreview, photoUploadDisabledMessage, imageCompressionMaxDimension = 200, uploadFileHardLimitBytes = 10485760, // 10MB default
36
- allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "Crop photo", cropConfirmLabel = "Save photo", cropCancelLabel = "Cancel", cropZoomLabel = "Zoom", }) {
37
+ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle, cropConfirmLabel, cropCancelLabel, cropZoomLabel, }) {
38
+ const t = useAuthT();
39
+ const resolvedCropTitle = cropTitle !== null && cropTitle !== void 0 ? cropTitle : t("my_settings.upload_tab.crop_title_default");
40
+ const resolvedCropConfirmLabel = cropConfirmLabel !== null && cropConfirmLabel !== void 0 ? cropConfirmLabel : t("my_settings.upload_tab.crop_confirm_label_default");
41
+ const resolvedCropCancelLabel = cropCancelLabel !== null && cropCancelLabel !== void 0 ? cropCancelLabel : t("shared.cancel_button");
42
+ const resolvedCropZoomLabel = cropZoomLabel !== null && cropZoomLabel !== void 0 ? cropZoomLabel : t("my_settings.upload_tab.crop_zoom_label_default");
37
43
  const [dragActive, setDragActive] = useState(false);
38
44
  const [preview, setPreview] = useState(currentPreview || null);
39
45
  const [isNewImage, setIsNewImage] = useState(false); // Track if preview is showing a newly uploaded image
@@ -74,7 +80,10 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
74
80
  setCompressing(false);
75
81
  // Check if compressed file is still too large
76
82
  if (compressedFile.size > maxSize) {
77
- setError(`File is too large. Maximum size is ${Math.round(maxSize / 1024)}KB. After compression, file is ${Math.round(compressedFile.size / 1024)}KB.`);
83
+ setError(t("my_settings.upload_tab.error_too_large_after_compression", {
84
+ maxKB: Math.round(maxSize / 1024),
85
+ actualKB: Math.round(compressedFile.size / 1024),
86
+ }));
78
87
  return;
79
88
  }
80
89
  // Create preview
@@ -91,7 +100,7 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
91
100
  }
92
101
  catch (error) {
93
102
  setCompressing(false);
94
- const errorMessage = error instanceof Error ? error.message : "Failed to compress image";
103
+ const errorMessage = error instanceof Error ? error.message : t("my_settings.upload_tab.error_compress_default");
95
104
  setError(errorMessage);
96
105
  }
97
106
  }
@@ -110,23 +119,25 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
110
119
  await onFileSelect(file);
111
120
  }
112
121
  catch (error) {
113
- const errorMessage = error instanceof Error ? error.message : "Failed to process image";
122
+ const errorMessage = error instanceof Error ? error.message : t("my_settings.upload_tab.error_process_default");
114
123
  setError(errorMessage);
115
124
  }
116
125
  finally {
117
126
  setUploading(false);
118
127
  }
119
128
  }
120
- }, [maxSize, onFileSelect, imageCompressionMaxDimension]);
129
+ }, [maxSize, onFileSelect, imageCompressionMaxDimension, t]);
121
130
  const handleFile = useCallback(async (file) => {
122
131
  // Validate file type
123
132
  if (!allowedImageMimeTypes.includes(file.type)) {
124
- setError(`Invalid file type. Only ${allowedImageMimeTypes.map(t => t.split("/")[1].toUpperCase()).join(", ")} files are allowed.`);
133
+ setError(t("my_settings.upload_tab.error_invalid_type", {
134
+ types: allowedImageMimeTypes.map(mime => mime.split("/")[1].toUpperCase()).join(", "),
135
+ }));
125
136
  return;
126
137
  }
127
138
  // Hard limit: reject files larger than configured limit (too large to process efficiently)
128
139
  if (file.size > uploadFileHardLimitBytes) {
129
- setError(`File is too large. Maximum size is ${Math.round(maxSize / 1024)}KB.`);
140
+ setError(t("my_settings.upload_tab.error_too_large", { maxKB: Math.round(maxSize / 1024) }));
130
141
  return;
131
142
  }
132
143
  setError(null);
@@ -137,7 +148,7 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
137
148
  else {
138
149
  await process_and_upload(file); // HEIC/undecodable fallback: direct path
139
150
  }
140
- }, [allowedImageMimeTypes, uploadFileHardLimitBytes, maxSize, process_and_upload]);
151
+ }, [allowedImageMimeTypes, uploadFileHardLimitBytes, maxSize, process_and_upload, t]);
141
152
  const handle_crop_confirm = useCallback(async (blob) => {
142
153
  const cropped = new File([blob], "avatar.webp", { type: "image/webp" });
143
154
  await process_and_upload(cropped);
@@ -158,23 +169,23 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
158
169
  e.stopPropagation();
159
170
  setDragActive(false);
160
171
  if (!uploadEnabled || disabled) {
161
- setError("Photo upload is not enabled");
172
+ setError(t("my_settings.upload_tab.error_upload_disabled"));
162
173
  return;
163
174
  }
164
175
  if (e.dataTransfer.files && e.dataTransfer.files[0]) {
165
176
  void handleFile(e.dataTransfer.files[0]);
166
177
  }
167
- }, [uploadEnabled, disabled, handleFile]);
178
+ }, [uploadEnabled, disabled, handleFile, t]);
168
179
  const handleChange = useCallback((e) => {
169
180
  e.preventDefault();
170
181
  if (!uploadEnabled || disabled) {
171
- setError("Photo upload is not enabled");
182
+ setError(t("my_settings.upload_tab.error_upload_disabled"));
172
183
  return;
173
184
  }
174
185
  if (e.target.files && e.target.files[0]) {
175
186
  void handleFile(e.target.files[0]);
176
187
  }
177
- }, [uploadEnabled, disabled, handleFile]);
188
+ }, [uploadEnabled, disabled, handleFile, t]);
178
189
  const handleRemove = useCallback(() => {
179
190
  setPreview(currentPreview || null); // Reset to current preview if available
180
191
  setIsNewImage(false); // Reset to showing current image
@@ -183,7 +194,7 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
183
194
  const getInitials = () => {
184
195
  return "U";
185
196
  };
186
- return (_jsxs("div", { className: "cls_profile_picture_upload_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-upload", checked: useUpload, onCheckedChange: onUseUploadChange, disabled: disabled || !uploadEnabled, className: "cls_profile_picture_upload_tab_switch_input", "aria-label": "Use uploaded photo" }), _jsx(Label, { htmlFor: "use-upload", className: "cls_profile_picture_upload_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: "Use uploaded photo" })] }), !uploadEnabled && (_jsxs("div", { className: "cls_profile_picture_upload_tab_disabled flex items-center gap-2 p-3 bg-yellow-50 border border-yellow-200 rounded-lg", children: [_jsx(Info, { className: "h-4 w-4 text-yellow-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_disabled_text text-sm text-yellow-800", children: photoUploadDisabledMessage })] })), _jsxs("div", { className: "cls_profile_picture_upload_tab_content grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_dropzone_container flex flex-col gap-2", children: [_jsx(Label, { className: "cls_profile_picture_upload_tab_dropzone_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: "Upload Photo" }), _jsxs("div", { className: `
197
+ return (_jsxs("div", { className: "cls_profile_picture_upload_tab flex flex-col gap-4", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_switch flex items-center gap-3", children: [_jsx(Switch, { id: "use-upload", checked: useUpload, onCheckedChange: onUseUploadChange, disabled: disabled || !uploadEnabled, className: "cls_profile_picture_upload_tab_switch_input", "aria-label": t("my_settings.upload_tab.use_uploaded_label") }), _jsx(Label, { htmlFor: "use-upload", className: "cls_profile_picture_upload_tab_switch_label text-sm font-medium text-[var(--hazo-text-secondary)] cursor-pointer", children: t("my_settings.upload_tab.use_uploaded_label") })] }), !uploadEnabled && (_jsxs("div", { className: "cls_profile_picture_upload_tab_disabled flex items-center gap-2 p-3 bg-yellow-50 border border-yellow-200 rounded-lg", children: [_jsx(Info, { className: "h-4 w-4 text-yellow-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_disabled_text text-sm text-yellow-800", children: photoUploadDisabledMessage })] })), _jsxs("div", { className: "cls_profile_picture_upload_tab_content grid grid-cols-1 md:grid-cols-2 gap-6", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_dropzone_container flex flex-col gap-2", children: [_jsx(Label, { className: "cls_profile_picture_upload_tab_dropzone_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: t("my_settings.upload_tab.upload_photo_label") }), _jsxs("div", { className: `
187
198
  cls_profile_picture_upload_tab_dropzone
188
199
  flex flex-col items-center justify-center
189
200
  border-2 border-dashed rounded-lg p-8
@@ -195,6 +206,6 @@ allowedImageMimeTypes = ["image/jpeg", "image/jpg", "image/png"], cropTitle = "C
195
206
  if (!disabled && uploadEnabled) {
196
207
  (_a = document.getElementById("file-upload-input")) === null || _a === void 0 ? void 0 : _a.click();
197
208
  }
198
- }, children: [_jsx("input", { id: "file-upload-input", type: "file", accept: allowedImageMimeTypes.join(","), onChange: handleChange, disabled: disabled || !uploadEnabled, className: "hidden", "aria-label": "Upload profile picture" }), _jsx(Upload, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] mb-2", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_dropzone_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Drag and drop an image here, or click to select" }), _jsxs("p", { className: "cls_profile_picture_upload_tab_dropzone_hint text-xs text-[var(--hazo-text-muted)] text-center mt-1", children: ["JPG or PNG, max ", Math.round(maxSize / 1024), "KB"] })] }), error && (_jsx("p", { className: "cls_profile_picture_upload_tab_error text-sm text-red-600", role: "alert", children: error }))] }), _jsxs("div", { className: "cls_profile_picture_upload_tab_preview_container flex flex-col gap-2", children: [_jsx(Label, { className: "cls_profile_picture_upload_tab_preview_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: isNewImage ? "Preview (new)" : "Preview (current)" }), _jsx("div", { className: "cls_profile_picture_upload_tab_preview_content flex flex-col items-center justify-center border border-[var(--hazo-border)] rounded-lg p-6 bg-[var(--hazo-bg-subtle)] min-h-[200px]", children: compressing ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_compressing flex flex-col items-center gap-2", children: [_jsx(Loader2, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_compressing_text text-sm text-[var(--hazo-text-muted)]", children: "Compressing image..." })] })) : uploading ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_uploading flex flex-col items-center gap-2", children: [_jsx(Loader2, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_uploading_text text-sm text-[var(--hazo-text-muted)]", children: "Uploading..." })] })) : preview ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_image_container flex flex-col items-center gap-4", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_image_wrapper relative", children: [_jsxs(Avatar, { className: "cls_profile_picture_upload_tab_preview_avatar h-32 w-32", children: [_jsx(AvatarImage, { src: preview, alt: "Uploaded profile picture preview", className: "cls_profile_picture_upload_tab_preview_avatar_image" }), _jsx(AvatarFallback, { className: "cls_profile_picture_upload_tab_preview_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() })] }), _jsx(Button, { type: "button", onClick: handleRemove, variant: "ghost", size: "icon", className: "cls_profile_picture_upload_tab_preview_remove absolute -top-2 -right-2 rounded-full h-6 w-6 border border-[var(--hazo-border-emphasis)] bg-white hover:bg-[var(--hazo-bg-subtle)]", "aria-label": "Remove preview", children: _jsx(X, { className: "h-4 w-4", "aria-hidden": "true" }) })] }), _jsx("p", { className: "cls_profile_picture_upload_tab_preview_success_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Preview of your uploaded photo" })] })) : (_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_empty flex flex-col items-center gap-2", children: [_jsx(Avatar, { className: "cls_profile_picture_upload_tab_preview_empty_avatar h-32 w-32", children: _jsx(AvatarFallback, { className: "cls_profile_picture_upload_tab_preview_empty_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() }) }), _jsx("p", { className: "cls_profile_picture_upload_tab_preview_empty_text text-sm text-[var(--hazo-text-muted)] text-center", children: "Upload an image to see preview" })] })) })] })] }), _jsx(HazoUiImageCropperDialog, { open: cropFile !== null, onOpenChange: (open) => { if (!open && !uploading && !compressing)
199
- setCropFile(null); }, file: cropFile, onConfirm: handle_crop_confirm, title: cropTitle, confirmLabel: cropConfirmLabel, cancelLabel: cropCancelLabel, zoomLabel: cropZoomLabel })] }));
209
+ }, children: [_jsx("input", { id: "file-upload-input", type: "file", accept: allowedImageMimeTypes.join(","), onChange: handleChange, disabled: disabled || !uploadEnabled, className: "hidden", "aria-label": t("my_settings.upload_tab.upload_input_aria") }), _jsx(Upload, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] mb-2", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_dropzone_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.upload_tab.dropzone_text") }), _jsx("p", { className: "cls_profile_picture_upload_tab_dropzone_hint text-xs text-[var(--hazo-text-muted)] text-center mt-1", children: t("my_settings.upload_tab.dropzone_hint", { maxKB: Math.round(maxSize / 1024) }) })] }), error && (_jsx("p", { className: "cls_profile_picture_upload_tab_error text-sm text-red-600", role: "alert", children: error }))] }), _jsxs("div", { className: "cls_profile_picture_upload_tab_preview_container flex flex-col gap-2", children: [_jsx(Label, { className: "cls_profile_picture_upload_tab_preview_label text-sm font-medium text-[var(--hazo-text-secondary)]", children: isNewImage ? t("my_settings.upload_tab.preview_new_label") : t("my_settings.upload_tab.preview_current_label") }), _jsx("div", { className: "cls_profile_picture_upload_tab_preview_content flex flex-col items-center justify-center border border-[var(--hazo-border)] rounded-lg p-6 bg-[var(--hazo-bg-subtle)] min-h-[200px]", children: compressing ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_compressing flex flex-col items-center gap-2", children: [_jsx(Loader2, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_compressing_text text-sm text-[var(--hazo-text-muted)]", children: t("my_settings.upload_tab.compressing_text") })] })) : uploading ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_uploading flex flex-col items-center gap-2", children: [_jsx(Loader2, { className: "h-8 w-8 text-[var(--hazo-text-subtle)] animate-spin", "aria-hidden": "true" }), _jsx("p", { className: "cls_profile_picture_upload_tab_uploading_text text-sm text-[var(--hazo-text-muted)]", children: t("my_settings.upload_tab.uploading_text") })] })) : preview ? (_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_image_container flex flex-col items-center gap-4", children: [_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_image_wrapper relative", children: [_jsxs(Avatar, { className: "cls_profile_picture_upload_tab_preview_avatar h-32 w-32", children: [_jsx(AvatarImage, { src: preview, alt: t("my_settings.upload_tab.preview_alt"), className: "cls_profile_picture_upload_tab_preview_avatar_image" }), _jsx(AvatarFallback, { className: "cls_profile_picture_upload_tab_preview_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() })] }), _jsx(Button, { type: "button", onClick: handleRemove, variant: "ghost", size: "icon", className: "cls_profile_picture_upload_tab_preview_remove absolute -top-2 -right-2 rounded-full h-6 w-6 border border-[var(--hazo-border-emphasis)] bg-white hover:bg-[var(--hazo-bg-subtle)]", "aria-label": t("my_settings.upload_tab.remove_preview_aria"), children: _jsx(X, { className: "h-4 w-4", "aria-hidden": "true" }) })] }), _jsx("p", { className: "cls_profile_picture_upload_tab_preview_success_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.upload_tab.preview_success_text") })] })) : (_jsxs("div", { className: "cls_profile_picture_upload_tab_preview_empty flex flex-col items-center gap-2", children: [_jsx(Avatar, { className: "cls_profile_picture_upload_tab_preview_empty_avatar h-32 w-32", children: _jsx(AvatarFallback, { className: "cls_profile_picture_upload_tab_preview_empty_avatar_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)] text-3xl", children: getInitials() }) }), _jsx("p", { className: "cls_profile_picture_upload_tab_preview_empty_text text-sm text-[var(--hazo-text-muted)] text-center", children: t("my_settings.upload_tab.preview_empty_text") })] })) })] })] }), _jsx(HazoUiImageCropperDialog, { open: cropFile !== null, onOpenChange: (open) => { if (!open && !uploading && !compressing)
210
+ setCropFile(null); }, file: cropFile, onConfirm: handle_crop_confirm, title: resolvedCropTitle, confirmLabel: resolvedCropConfirmLabel, cancelLabel: resolvedCropCancelLabel, zoomLabel: resolvedCropZoomLabel })] }));
200
211
  }
@@ -1 +1 @@
1
- {"version":3,"file":"set_password_section.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/set_password_section.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAI3F,MAAM,MAAM,uBAAuB,GAAG;IACpC,2CAA2C;IAC3C,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gCAAgC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,oBAAoB,EACpB,aAAa,EACb,OAAwB,EACxB,WAA4G,EAC5G,gBAAiC,EACjC,oBAAyC,EACzC,iBAAkC,EAClC,aAAqB,GACtB,EAAE,uBAAuB,+BAoNzB"}
1
+ {"version":3,"file":"set_password_section.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/components/set_password_section.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAI3F,MAAM,MAAM,uBAAuB,GAAG;IACpC,2CAA2C;IAC3C,oBAAoB,EAAE,0BAA0B,CAAC;IACjD,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,sBAAsB;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yBAAyB;IACzB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6BAA6B;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,0BAA0B;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,gCAAgC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAGF;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,aAAqB,GACtB,EAAE,uBAAuB,+BA6NzB"}
@@ -8,15 +8,21 @@ import { Button } from "../../../ui/button.js";
8
8
  import { PasswordField } from "../../shared/components/password_field.js";
9
9
  import { FormFieldWrapper } from "../../shared/components/form_field_wrapper.js";
10
10
  import { toast } from "sonner";
11
- import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
11
+ import { useHazoAuthConfig, useAuthT } from "../../../../contexts/hazo_auth_provider.js";
12
12
  // section: component
13
13
  /**
14
14
  * Set Password Section for My Settings
15
15
  * Allows Google-only users to set a password for email/password login
16
16
  * Only shown when user has no password set (Google-only account)
17
17
  */
18
- export function SetPasswordSection({ passwordRequirements, onPasswordSet, heading = "Set Password", description = "Add a password to your account to enable email/password login in addition to Google sign-in.", newPasswordLabel = "New Password", confirmPasswordLabel = "Confirm Password", submitButtonLabel = "Set Password", parentLoading = false, }) {
18
+ export function SetPasswordSection({ passwordRequirements, onPasswordSet, heading, description, newPasswordLabel, confirmPasswordLabel, submitButtonLabel, parentLoading = false, }) {
19
19
  const { apiBasePath } = useHazoAuthConfig();
20
+ const t = useAuthT();
21
+ const resolvedHeading = heading !== null && heading !== void 0 ? heading : t("my_settings.set_password.heading");
22
+ const resolvedDescription = description !== null && description !== void 0 ? description : t("my_settings.set_password.description");
23
+ const resolvedNewPasswordLabel = newPasswordLabel !== null && newPasswordLabel !== void 0 ? newPasswordLabel : t("my_settings.set_password.new_password_label");
24
+ const resolvedConfirmPasswordLabel = confirmPasswordLabel !== null && confirmPasswordLabel !== void 0 ? confirmPasswordLabel : t("my_settings.set_password.confirm_password_label");
25
+ const resolvedSubmitButtonLabel = submitButtonLabel !== null && submitButtonLabel !== void 0 ? submitButtonLabel : t("my_settings.set_password.submit_button");
20
26
  const [newPassword, setNewPassword] = useState("");
21
27
  const [confirmPassword, setConfirmPassword] = useState("");
22
28
  const [newPasswordVisible, setNewPasswordVisible] = useState(false);
@@ -28,24 +34,28 @@ export function SetPasswordSection({ passwordRequirements, onPasswordSet, headin
28
34
  */
29
35
  const validatePassword = useCallback((password) => {
30
36
  if (!password || password.length < passwordRequirements.minimum_length) {
31
- return `Password must be at least ${passwordRequirements.minimum_length} characters long`;
37
+ return t("my_settings.set_password.validation.min_length", {
38
+ length: passwordRequirements.minimum_length,
39
+ });
32
40
  }
33
41
  const missingRequirements = [];
34
42
  if (passwordRequirements.require_uppercase && !/[A-Z]/.test(password)) {
35
- missingRequirements.push("uppercase letter");
43
+ missingRequirements.push(t("my_settings.set_password.validation.uppercase_item"));
36
44
  }
37
45
  if (passwordRequirements.require_lowercase && !/[a-z]/.test(password)) {
38
- missingRequirements.push("lowercase letter");
46
+ missingRequirements.push(t("my_settings.set_password.validation.lowercase_item"));
39
47
  }
40
48
  if (passwordRequirements.require_number && !/[0-9]/.test(password)) {
41
- missingRequirements.push("number");
49
+ missingRequirements.push(t("my_settings.set_password.validation.number_item"));
42
50
  }
43
51
  if (passwordRequirements.require_special &&
44
52
  !/[^A-Za-z0-9]/.test(password)) {
45
- missingRequirements.push("special character");
53
+ missingRequirements.push(t("my_settings.set_password.validation.special_item"));
46
54
  }
47
55
  if (missingRequirements.length > 0) {
48
- return `Password must contain at least one: ${missingRequirements.join(", ")}`;
56
+ return t("my_settings.set_password.validation.missing_requirements", {
57
+ list: missingRequirements.join(", "),
58
+ });
49
59
  }
50
60
  return null;
51
61
  }, [passwordRequirements]);
@@ -59,10 +69,10 @@ export function SetPasswordSection({ passwordRequirements, onPasswordSet, headin
59
69
  newErrors.newPassword = passwordError;
60
70
  }
61
71
  if (!confirmPassword) {
62
- newErrors.confirmPassword = "Please confirm your new password";
72
+ newErrors.confirmPassword = t("my_settings.set_password.validation.confirm_required");
63
73
  }
64
74
  else if (newPassword !== confirmPassword) {
65
- newErrors.confirmPassword = "Passwords do not match";
75
+ newErrors.confirmPassword = t("my_settings.set_password.validation.mismatch");
66
76
  }
67
77
  setErrors(newErrors);
68
78
  return Object.keys(newErrors).length === 0;
@@ -88,11 +98,11 @@ export function SetPasswordSection({ passwordRequirements, onPasswordSet, headin
88
98
  });
89
99
  const data = await response.json();
90
100
  if (!response.ok || !data.success) {
91
- const errorMessage = data.error || "Failed to set password";
101
+ const errorMessage = data.error || t("my_settings.set_password.error.default");
92
102
  toast.error(errorMessage);
93
103
  return;
94
104
  }
95
- toast.success("Password set successfully! You can now sign in with your email and password.");
105
+ toast.success(t("my_settings.set_password.success"));
96
106
  // Reset form
97
107
  setNewPassword("");
98
108
  setConfirmPassword("");
@@ -101,7 +111,7 @@ export function SetPasswordSection({ passwordRequirements, onPasswordSet, headin
101
111
  onPasswordSet === null || onPasswordSet === void 0 ? void 0 : onPasswordSet();
102
112
  }
103
113
  catch (error) {
104
- const errorMessage = error instanceof Error ? error.message : "Failed to set password";
114
+ const errorMessage = error instanceof Error ? error.message : t("my_settings.set_password.error.default");
105
115
  toast.error(errorMessage);
106
116
  }
107
117
  finally {
@@ -123,5 +133,5 @@ export function SetPasswordSection({ passwordRequirements, onPasswordSet, headin
123
133
  setErrors((prev) => (Object.assign(Object.assign({}, prev), { confirmPassword: undefined })));
124
134
  }, []);
125
135
  const isSubmitDisabled = loading || parentLoading || !newPassword || !confirmPassword;
126
- return (_jsxs("div", { className: "cls_my_settings_set_password_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-2", children: heading }), _jsx("p", { className: "cls_set_password_description text-sm text-[var(--hazo-text-muted)] mb-4", children: description }), _jsxs("div", { className: "cls_set_password_fields flex flex-col gap-4", children: [_jsxs("div", { className: "cls_set_password_fields_row grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsx(FormFieldWrapper, { fieldId: "set-new-password", label: newPasswordLabel, input: _jsx(PasswordField, { inputId: "set-new-password", ariaLabel: newPasswordLabel, value: newPassword, placeholder: "Enter your new password", autoComplete: "new-password", isVisible: newPasswordVisible, onChange: handleNewPasswordChange, onToggleVisibility: () => setNewPasswordVisible(!newPasswordVisible), errorMessage: errors.newPassword }) }), _jsx(FormFieldWrapper, { fieldId: "set-confirm-password", label: confirmPasswordLabel, input: _jsx(PasswordField, { inputId: "set-confirm-password", ariaLabel: confirmPasswordLabel, value: confirmPassword, placeholder: "Confirm your new password", autoComplete: "new-password", isVisible: confirmPasswordVisible, onChange: handleConfirmPasswordChange, onToggleVisibility: () => setConfirmPasswordVisible(!confirmPasswordVisible), errorMessage: errors.confirmPassword }) })] }), _jsx("div", { className: "cls_set_password_actions flex justify-end", children: _jsx(Button, { type: "button", onClick: handleSubmit, disabled: isSubmitDisabled, className: "cls_set_password_submit_button", "aria-label": submitButtonLabel, children: loading ? "Setting password..." : submitButtonLabel }) })] })] }));
136
+ return (_jsxs("div", { className: "cls_my_settings_set_password_section bg-white rounded-lg border border-[var(--hazo-border)] p-6", children: [_jsx("h2", { className: "cls_my_settings_section_heading text-lg font-semibold text-[var(--hazo-text-primary)] mb-2", children: resolvedHeading }), _jsx("p", { className: "cls_set_password_description text-sm text-[var(--hazo-text-muted)] mb-4", children: resolvedDescription }), _jsxs("div", { className: "cls_set_password_fields flex flex-col gap-4", children: [_jsxs("div", { className: "cls_set_password_fields_row grid grid-cols-1 md:grid-cols-2 gap-4", children: [_jsx(FormFieldWrapper, { fieldId: "set-new-password", label: resolvedNewPasswordLabel, input: _jsx(PasswordField, { inputId: "set-new-password", ariaLabel: resolvedNewPasswordLabel, value: newPassword, placeholder: t("my_settings.set_password.new_password_placeholder"), autoComplete: "new-password", isVisible: newPasswordVisible, onChange: handleNewPasswordChange, onToggleVisibility: () => setNewPasswordVisible(!newPasswordVisible), errorMessage: errors.newPassword }) }), _jsx(FormFieldWrapper, { fieldId: "set-confirm-password", label: resolvedConfirmPasswordLabel, input: _jsx(PasswordField, { inputId: "set-confirm-password", ariaLabel: resolvedConfirmPasswordLabel, value: confirmPassword, placeholder: t("my_settings.set_password.confirm_password_placeholder"), autoComplete: "new-password", isVisible: confirmPasswordVisible, onChange: handleConfirmPasswordChange, onToggleVisibility: () => setConfirmPasswordVisible(!confirmPasswordVisible), errorMessage: errors.confirmPassword }) })] }), _jsx("div", { className: "cls_set_password_actions flex justify-end", children: _jsx(Button, { type: "button", onClick: handleSubmit, disabled: isSubmitDisabled, className: "cls_set_password_submit_button", "aria-label": resolvedSubmitButtonLabel, children: loading ? t("my_settings.set_password.submitting") : resolvedSubmitButtonLabel }) })] })] }));
127
137
  }
@@ -1,4 +1,5 @@
1
1
  import { type ButtonPaletteDefaults, type ButtonPaletteOverrides } from "../../shared/config/layout_customization.js";
2
+ import type { AuthTFunction } from "../../../../contexts/hazo_auth_config";
2
3
  export declare const MY_SETTINGS_FIELD_IDS: {
3
4
  readonly NAME: "name";
4
5
  readonly EMAIL: "email_address";
@@ -14,6 +15,6 @@ export type MySettingsLabelDefaults = {
14
15
  changePasswordButton: string;
15
16
  };
16
17
  export type MySettingsLabelOverrides = Partial<MySettingsLabelDefaults>;
17
- export declare const resolveMySettingsLabels: (overrides?: MySettingsLabelOverrides) => MySettingsLabelDefaults;
18
+ export declare const resolveMySettingsLabels: (t: AuthTFunction, overrides?: MySettingsLabelOverrides) => MySettingsLabelDefaults;
18
19
  export declare const resolveMySettingsButtonPalette: (overrides?: ButtonPaletteOverrides) => ButtonPaletteDefaults;
19
20
  //# sourceMappingURL=my_settings_field_config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"my_settings_field_config.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/config/my_settings_field_config.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAE5B,MAAM,0CAA0C,CAAC;AAGlD,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAGnG,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAWF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,uBAAuB,GAClC,YAAY,wBAAwB,KACnC,uBAKF,CAAC;AAUF,eAAO,MAAM,8BAA8B,GACzC,YAAY,sBAAsB,0BACqC,CAAC"}
1
+ {"version":3,"file":"my_settings_field_config.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/my_settings/config/my_settings_field_config.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAE5B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAG3E,eAAO,MAAM,qBAAqB;;;;CAIxB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,OAAO,qBAAqB,CAAC,CAAC;AAGnG,MAAM,MAAM,uBAAuB,GAAG;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;CAC9B,CAAC;AAWF,MAAM,MAAM,wBAAwB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,uBAAuB,GAClC,GAAG,aAAa,EAChB,YAAY,wBAAwB,KACnC,uBAKF,CAAC;AAUF,eAAO,MAAM,8BAA8B,GACzC,YAAY,sBAAsB,0BACqC,CAAC"}
@@ -5,16 +5,16 @@ export const MY_SETTINGS_FIELD_IDS = {
5
5
  EMAIL: "email_address",
6
6
  PASSWORD: "password",
7
7
  };
8
- const MY_SETTINGS_LABEL_DEFAULTS = {
9
- heading: "My Settings",
10
- profileTab: "Profile",
11
- securityTab: "Security",
12
- lastLoggedInLabel: "Last logged in",
13
- profilePictureLabel: "Profile Picture",
14
- changePasswordButton: "Change Password",
15
- };
16
- export const resolveMySettingsLabels = (overrides) => {
17
- return Object.assign(Object.assign({}, MY_SETTINGS_LABEL_DEFAULTS), overrides);
8
+ const buildMySettingsLabelDefaults = (t) => ({
9
+ heading: t("my_settings.heading"),
10
+ profileTab: t("my_settings.profile_tab"),
11
+ securityTab: t("my_settings.security_tab"),
12
+ lastLoggedInLabel: t("my_settings.last_logged_in_label"),
13
+ profilePictureLabel: t("my_settings.profile_picture_label"),
14
+ changePasswordButton: t("my_settings.change_password_button"),
15
+ });
16
+ export const resolveMySettingsLabels = (t, overrides) => {
17
+ return Object.assign(Object.assign({}, buildMySettingsLabelDefaults(t)), overrides);
18
18
  };
19
19
  // section: button_palette_defaults
20
20
  const MY_SETTINGS_BUTTON_PALETTE_DEFAULTS = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/my_settings/index.tsx"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/my_settings/index.tsx"],"names":[],"mappings":"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"}