hazo_auth 10.19.0 → 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 (238) 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/dist/components/layouts/create_firm/index.d.ts.map +1 -1
  21. package/dist/components/layouts/create_firm/index.js +4 -3
  22. package/dist/components/layouts/dev_lock/index.d.ts.map +1 -1
  23. package/dist/components/layouts/dev_lock/index.js +4 -2
  24. package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts +5 -4
  25. package/dist/components/layouts/email_verification/config/email_verification_field_config.d.ts.map +1 -1
  26. package/dist/components/layouts/email_verification/config/email_verification_field_config.js +20 -20
  27. package/dist/components/layouts/email_verification/hooks/use_email_verification.d.ts.map +1 -1
  28. package/dist/components/layouts/email_verification/hooks/use_email_verification.js +5 -7
  29. package/dist/components/layouts/email_verification/index.d.ts.map +1 -1
  30. package/dist/components/layouts/email_verification/index.js +13 -12
  31. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts +3 -2
  32. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.d.ts.map +1 -1
  33. package/dist/components/layouts/forgot_password/config/forgot_password_field_config.js +16 -16
  34. package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.d.ts.map +1 -1
  35. package/dist/components/layouts/forgot_password/hooks/use_forgot_password_form.js +5 -7
  36. package/dist/components/layouts/forgot_password/index.d.ts.map +1 -1
  37. package/dist/components/layouts/forgot_password/index.js +15 -9
  38. package/dist/components/layouts/legal/legal_acceptance_gate.d.ts.map +1 -1
  39. package/dist/components/layouts/legal/legal_acceptance_gate.js +5 -3
  40. package/dist/components/layouts/legal/legal_doc_checkbox_list.d.ts.map +1 -1
  41. package/dist/components/layouts/legal/legal_doc_checkbox_list.js +3 -1
  42. package/dist/components/layouts/legal/legal_doc_combined_view.d.ts.map +1 -1
  43. package/dist/components/layouts/legal/legal_doc_combined_view.js +3 -1
  44. package/dist/components/layouts/login/config/login_field_config.d.ts +3 -2
  45. package/dist/components/layouts/login/config/login_field_config.d.ts.map +1 -1
  46. package/dist/components/layouts/login/config/login_field_config.js +24 -24
  47. package/dist/components/layouts/login/hooks/use_login_form.d.ts.map +1 -1
  48. package/dist/components/layouts/login/hooks/use_login_form.js +5 -7
  49. package/dist/components/layouts/login/index.d.ts +4 -4
  50. package/dist/components/layouts/login/index.d.ts.map +1 -1
  51. package/dist/components/layouts/login/index.js +30 -22
  52. package/dist/components/layouts/my_settings/components/connected_accounts_section.d.ts.map +1 -1
  53. package/dist/components/layouts/my_settings/components/connected_accounts_section.js +5 -5
  54. package/dist/components/layouts/my_settings/components/danger_zone_section.d.ts.map +1 -1
  55. package/dist/components/layouts/my_settings/components/danger_zone_section.js +12 -6
  56. package/dist/components/layouts/my_settings/components/editable_field.d.ts.map +1 -1
  57. package/dist/components/layouts/my_settings/components/editable_field.js +4 -2
  58. package/dist/components/layouts/my_settings/components/language_picker_section.d.ts.map +1 -1
  59. package/dist/components/layouts/my_settings/components/language_picker_section.js +7 -3
  60. package/dist/components/layouts/my_settings/components/password_change_dialog.d.ts.map +1 -1
  61. package/dist/components/layouts/my_settings/components/password_change_dialog.js +28 -21
  62. package/dist/components/layouts/my_settings/components/profile_picture_dialog.d.ts.map +1 -1
  63. package/dist/components/layouts/my_settings/components/profile_picture_dialog.js +12 -9
  64. package/dist/components/layouts/my_settings/components/profile_picture_gravatar_tab.d.ts.map +1 -1
  65. package/dist/components/layouts/my_settings/components/profile_picture_gravatar_tab.js +3 -1
  66. package/dist/components/layouts/my_settings/components/profile_picture_library_tab.js +14 -11
  67. package/dist/components/layouts/my_settings/components/profile_picture_upload_tab.d.ts.map +1 -1
  68. package/dist/components/layouts/my_settings/components/profile_picture_upload_tab.js +26 -15
  69. package/dist/components/layouts/my_settings/components/set_password_section.d.ts.map +1 -1
  70. package/dist/components/layouts/my_settings/components/set_password_section.js +9 -6
  71. package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts +2 -1
  72. package/dist/components/layouts/my_settings/config/my_settings_field_config.d.ts.map +1 -1
  73. package/dist/components/layouts/my_settings/config/my_settings_field_config.js +4 -7
  74. package/dist/components/layouts/my_settings/index.d.ts.map +1 -1
  75. package/dist/components/layouts/my_settings/index.js +35 -27
  76. package/dist/components/layouts/otp/index.d.ts.map +1 -1
  77. package/dist/components/layouts/otp/index.js +8 -6
  78. package/dist/components/layouts/register/config/register_field_config.d.ts +3 -2
  79. package/dist/components/layouts/register/config/register_field_config.d.ts.map +1 -1
  80. package/dist/components/layouts/register/config/register_field_config.js +40 -40
  81. package/dist/components/layouts/register/hooks/use_register_form.d.ts.map +1 -1
  82. package/dist/components/layouts/register/hooks/use_register_form.js +7 -9
  83. package/dist/components/layouts/register/index.d.ts +4 -4
  84. package/dist/components/layouts/register/index.d.ts.map +1 -1
  85. package/dist/components/layouts/register/index.js +22 -19
  86. package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts +4 -3
  87. package/dist/components/layouts/reset_password/config/reset_password_field_config.d.ts.map +1 -1
  88. package/dist/components/layouts/reset_password/config/reset_password_field_config.js +7 -10
  89. package/dist/components/layouts/reset_password/hooks/use_reset_password_form.d.ts.map +1 -1
  90. package/dist/components/layouts/reset_password/hooks/use_reset_password_form.js +4 -6
  91. package/dist/components/layouts/reset_password/index.d.ts.map +1 -1
  92. package/dist/components/layouts/reset_password/index.js +12 -10
  93. package/dist/components/layouts/shared/components/already_logged_in_guard.d.ts.map +1 -1
  94. package/dist/components/layouts/shared/components/already_logged_in_guard.js +6 -5
  95. package/dist/components/layouts/shared/components/auth_navbar.d.ts +1 -1
  96. package/dist/components/layouts/shared/components/auth_navbar.d.ts.map +1 -1
  97. package/dist/components/layouts/shared/components/auth_navbar.js +7 -2
  98. package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts.map +1 -1
  99. package/dist/components/layouts/shared/components/facebook_sign_in_button.js +5 -5
  100. package/dist/components/layouts/shared/components/floating_home_link.d.ts.map +1 -1
  101. package/dist/components/layouts/shared/components/floating_home_link.js +6 -3
  102. package/dist/components/layouts/shared/components/form_action_buttons.d.ts.map +1 -1
  103. package/dist/components/layouts/shared/components/form_action_buttons.js +9 -7
  104. package/dist/components/layouts/shared/components/google_sign_in_button.d.ts.map +1 -1
  105. package/dist/components/layouts/shared/components/google_sign_in_button.js +5 -5
  106. package/dist/components/layouts/shared/components/logout_button.d.ts.map +1 -1
  107. package/dist/components/layouts/shared/components/logout_button.js +2 -4
  108. package/dist/components/layouts/shared/components/oauth_divider.d.ts.map +1 -1
  109. package/dist/components/layouts/shared/components/oauth_divider.js +8 -6
  110. package/dist/components/layouts/shared/components/password_field.d.ts.map +1 -1
  111. package/dist/components/layouts/shared/components/password_field.js +2 -3
  112. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts +4 -0
  113. package/dist/components/layouts/shared/components/profile_pic_menu.d.ts.map +1 -1
  114. package/dist/components/layouts/shared/components/profile_pic_menu.js +26 -18
  115. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.d.ts +1 -0
  116. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.d.ts.map +1 -1
  117. package/dist/components/layouts/shared/components/profile_pic_menu_wrapper.js +1 -1
  118. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.d.ts.map +1 -1
  119. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +3 -1
  120. package/dist/components/layouts/shared/components/standalone_layout_wrapper.d.ts.map +1 -1
  121. package/dist/components/layouts/shared/components/standalone_layout_wrapper.js +6 -2
  122. package/dist/components/layouts/shared/components/unauthorized_guard.d.ts.map +1 -1
  123. package/dist/components/layouts/shared/components/unauthorized_guard.js +6 -5
  124. package/dist/components/layouts/shared/config/layout_customization.d.ts +2 -1
  125. package/dist/components/layouts/shared/config/layout_customization.d.ts.map +1 -1
  126. package/dist/components/layouts/shared/config/layout_customization.js +18 -7
  127. package/dist/components/layouts/shared/utils/validation.d.ts +5 -2
  128. package/dist/components/layouts/shared/utils/validation.d.ts.map +1 -1
  129. package/dist/components/layouts/shared/utils/validation.js +4 -8
  130. package/dist/components/layouts/user_management/components/roles_matrix.d.ts.map +1 -1
  131. package/dist/components/layouts/user_management/components/roles_matrix.js +2 -4
  132. package/dist/components/layouts/user_management/components/scope_hierarchy_tab.d.ts.map +1 -1
  133. package/dist/components/layouts/user_management/components/scope_hierarchy_tab.js +6 -8
  134. package/dist/components/layouts/user_management/components/user_scopes_tab.d.ts.map +1 -1
  135. package/dist/components/layouts/user_management/components/user_scopes_tab.js +2 -4
  136. package/dist/components/layouts/user_management/index.d.ts.map +1 -1
  137. package/dist/components/layouts/user_management/index.js +2 -4
  138. package/dist/components/otp/OTPRequestForm.d.ts.map +1 -1
  139. package/dist/components/otp/OTPRequestForm.js +7 -5
  140. package/dist/components/otp/OTPVerifyForm.d.ts.map +1 -1
  141. package/dist/components/otp/OTPVerifyForm.js +7 -5
  142. package/dist/components/permission_denied_dialog.client.d.ts.map +1 -1
  143. package/dist/components/permission_denied_dialog.client.js +6 -6
  144. package/dist/components/ui/sheet.d.ts +1 -1
  145. package/dist/components/ui/sidebar.js +5 -5
  146. package/dist/contexts/hazo_auth_config.d.ts +13 -0
  147. package/dist/contexts/hazo_auth_config.d.ts.map +1 -1
  148. package/dist/contexts/hazo_auth_config.js +4 -1
  149. package/dist/contexts/hazo_auth_provider.d.ts +22 -2
  150. package/dist/contexts/hazo_auth_provider.d.ts.map +1 -1
  151. package/dist/contexts/hazo_auth_provider.js +18 -2
  152. package/dist/lib/already_logged_in_config.server.d.ts +4 -2
  153. package/dist/lib/already_logged_in_config.server.d.ts.map +1 -1
  154. package/dist/lib/already_logged_in_config.server.js +7 -5
  155. package/dist/lib/auth_hooks.d.ts +20 -0
  156. package/dist/lib/auth_hooks.d.ts.map +1 -0
  157. package/dist/lib/auth_hooks.js +32 -0
  158. package/dist/lib/config/config_loader.server.d.ts +23 -0
  159. package/dist/lib/config/config_loader.server.d.ts.map +1 -1
  160. package/dist/lib/config/config_loader.server.js +29 -0
  161. package/dist/lib/email_verification_config.server.d.ts +2 -2
  162. package/dist/lib/email_verification_config.server.d.ts.map +1 -1
  163. package/dist/lib/forgot_password_config.server.d.ts +2 -2
  164. package/dist/lib/forgot_password_config.server.d.ts.map +1 -1
  165. package/dist/lib/login_config.server.d.ts +8 -5
  166. package/dist/lib/login_config.server.d.ts.map +1 -1
  167. package/dist/lib/login_config.server.js +13 -6
  168. package/dist/lib/my_settings_config.server.d.ts.map +1 -1
  169. package/dist/lib/my_settings_config.server.js +22 -15
  170. package/dist/lib/navbar_config.server.d.ts +3 -2
  171. package/dist/lib/navbar_config.server.d.ts.map +1 -1
  172. package/dist/lib/navbar_config.server.js +4 -2
  173. package/dist/lib/oauth_config.server.d.ts +6 -6
  174. package/dist/lib/oauth_config.server.d.ts.map +1 -1
  175. package/dist/lib/oauth_config.server.js +8 -4
  176. package/dist/lib/otp_config.server.d.ts +2 -2
  177. package/dist/lib/otp_config.server.d.ts.map +1 -1
  178. package/dist/lib/otp_config.server.js +4 -2
  179. package/dist/lib/profile_pic_menu_config.server.d.ts +6 -2
  180. package/dist/lib/profile_pic_menu_config.server.d.ts.map +1 -1
  181. package/dist/lib/profile_pic_menu_config.server.js +5 -3
  182. package/dist/lib/register_config.server.d.ts +7 -6
  183. package/dist/lib/register_config.server.d.ts.map +1 -1
  184. package/dist/lib/register_config.server.js +8 -4
  185. package/dist/lib/reset_password_config.server.d.ts +6 -4
  186. package/dist/lib/reset_password_config.server.d.ts.map +1 -1
  187. package/dist/lib/reset_password_config.server.js +5 -5
  188. package/dist/lib/services/oauth_service.d.ts.map +1 -1
  189. package/dist/lib/services/oauth_service.js +13 -0
  190. package/dist/lib/services/otp_service.d.ts.map +1 -1
  191. package/dist/lib/services/otp_service.js +6 -0
  192. package/dist/lib/services/registration_service.d.ts.map +1 -1
  193. package/dist/lib/services/registration_service.js +7 -0
  194. package/dist/lib/ui_shell_config.server.d.ts +6 -2
  195. package/dist/lib/ui_shell_config.server.d.ts.map +1 -1
  196. package/dist/lib/ui_shell_config.server.js +5 -3
  197. package/dist/locales/en.json +135 -1
  198. package/dist/server-lib.d.ts +2 -0
  199. package/dist/server-lib.d.ts.map +1 -1
  200. package/dist/server-lib.js +2 -0
  201. package/dist/server_pages/forgot_password.d.ts +3 -2
  202. package/dist/server_pages/forgot_password.d.ts.map +1 -1
  203. package/dist/server_pages/forgot_password.js +8 -7
  204. package/dist/server_pages/forgot_password_client_wrapper.d.ts +2 -1
  205. package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -1
  206. package/dist/server_pages/forgot_password_client_wrapper.js +3 -1
  207. package/dist/server_pages/login.d.ts.map +1 -1
  208. package/dist/server_pages/login.js +9 -7
  209. package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
  210. package/dist/server_pages/login_client_wrapper.js +3 -1
  211. package/dist/server_pages/otp.d.ts +6 -3
  212. package/dist/server_pages/otp.d.ts.map +1 -1
  213. package/dist/server_pages/otp.js +11 -8
  214. package/dist/server_pages/register.d.ts.map +1 -1
  215. package/dist/server_pages/register.js +7 -6
  216. package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
  217. package/dist/server_pages/register_client_wrapper.js +3 -1
  218. package/dist/server_pages/reset_password.d.ts.map +1 -1
  219. package/dist/server_pages/reset_password.js +7 -6
  220. package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -1
  221. package/dist/server_pages/reset_password_client_wrapper.js +3 -1
  222. package/dist/server_pages/verify_email.d.ts.map +1 -1
  223. package/dist/server_pages/verify_email.js +6 -5
  224. package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -1
  225. package/dist/server_pages/verify_email_client_wrapper.js +4 -2
  226. package/dist/strings/default_strings.d.ts +15 -0
  227. package/dist/strings/default_strings.d.ts.map +1 -1
  228. package/dist/strings/default_strings.js +53 -0
  229. package/dist/strings/index.d.ts +1 -1
  230. package/dist/strings/index.d.ts.map +1 -1
  231. package/dist/strings/index.js +1 -1
  232. package/dist/strings/strings_context.d.ts +20 -3
  233. package/dist/strings/strings_context.d.ts.map +1 -1
  234. package/dist/strings/strings_context.js +39 -5
  235. package/dist/strings/strings_provider.d.ts +1 -5
  236. package/dist/strings/strings_provider.d.ts.map +1 -1
  237. package/dist/strings/strings_provider.js +5 -1
  238. package/package.json +10 -6
@@ -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":"AAiBA,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,KAA+C,EAC/C,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,9 +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 en from "../../../../locales/en.json" with { type: "json" };
13
- import { createPackageT } from "hazo_core/i18n";
14
- const t = createPackageT("hazo_auth", en);
12
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
15
13
  // section: component
16
14
  /**
17
15
  * Google Sign-In button component
@@ -19,7 +17,9 @@ const t = createPackageT("hazo_auth", en);
19
17
  * Initiates the Google OAuth flow when clicked
20
18
  * Uses next-auth/react signIn function for proper OAuth flow
21
19
  */
22
- export function GoogleSignInButton({ label = t("shared.oauth.google_button_default"), 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");
23
23
  const [isLoading, setIsLoading] = useState(false);
24
24
  const handleClick = async () => {
25
25
  if (disabled || isLoading)
@@ -48,6 +48,6 @@ export function GoogleSignInButton({ label = t("shared.oauth.google_button_defau
48
48
  }
49
49
  }
50
50
  };
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": 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 ? t("shared.oauth.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 })] }));
52
52
  }
53
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":"AAkBA,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,13 +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";
13
- import en from "../../../../locales/en.json" with { type: "json" };
14
- import { createPackageT } from "hazo_core/i18n";
15
- const t = createPackageT("hazo_auth", en);
12
+ import { useHazoAuthConfig, useAuthT } from "../../../../contexts/hazo_auth_provider.js";
16
13
  // section: component
17
14
  export function LogoutButton({ className, variant = "outline", size = "default", }) {
18
15
  const { apiBasePath } = useHazoAuthConfig();
16
+ const t = useAuthT();
19
17
  const router = useRouter();
20
18
  const [isLoggingOut, setIsLoggingOut] = useState(false);
21
19
  const handleLogout = async () => {
@@ -1 +1 @@
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,IAAwC,EACxC,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,16 +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";
5
- import en from "../../../../locales/en.json" with { type: "json" };
6
- import { createPackageT } from "hazo_core/i18n";
7
- const t = createPackageT("hazo_auth", en);
7
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
8
8
  // section: component
9
9
  /**
10
10
  * Visual divider component to separate OAuth buttons from email/password form
11
11
  * Displays a horizontal line with text in the center
12
12
  */
13
- export function OAuthDivider({ text = t("shared.oauth_divider_default"), className, }) {
14
- 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 }) })] }));
15
17
  }
16
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":"AAeA,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,11 +7,10 @@ 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 en from "../../../../locales/en.json" with { type: "json" };
11
- import { createPackageT } from "hazo_core/i18n";
12
- const t = createPackageT("hazo_auth", en);
10
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
13
11
  // section: component
14
12
  export function PasswordField({ inputId, ariaLabel, value, placeholder, autoComplete, isVisible, onChange, onToggleVisibility, errorMessage, }) {
13
+ const t = useAuthT();
15
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: {
16
15
  position: "absolute",
17
16
  top: "50%",
@@ -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"}
@@ -16,7 +16,7 @@ import { SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarMenuItem, SidebarM
16
16
  import { Settings, LogOut, Shield } from "lucide-react";
17
17
  import { toast } from "sonner";
18
18
  import { use_auth_status, trigger_auth_status_refresh } from "../hooks/use_auth_status.js";
19
- import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
19
+ import { useHazoAuthConfig, useAuthT } from "../../../../contexts/hazo_auth_provider.js";
20
20
  // section: component
21
21
  /**
22
22
  * Profile picture menu component
@@ -27,8 +27,12 @@ import { useHazoAuthConfig } from "../../../../contexts/hazo_auth_provider.js";
27
27
  * @param props - Component props including configuration options
28
28
  * @returns Profile picture menu component
29
29
  */
30
- export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Sign Up", sign_in_label = "Sign In", register_path = "/hazo_auth/register", login_path = "/hazo_auth/login", settings_path = "/hazo_auth/my_settings", logout_path, custom_menu_items = [], className, avatar_size = "default", variant = "dropdown", sidebar_group_label = "Account", }) {
30
+ export function ProfilePicMenu({ show_single_button = false, sign_up_label, sign_in_label, register_path = "/hazo_auth/register", login_path = "/hazo_auth/login", settings_path = "/hazo_auth/my_settings", logout_path, custom_menu_items = [], className, avatar_size = "default", variant = "dropdown", sidebar_group_label, }) {
31
31
  const { apiBasePath } = useHazoAuthConfig();
32
+ const t = useAuthT();
33
+ const resolvedSignUpLabel = sign_up_label !== null && sign_up_label !== void 0 ? sign_up_label : t("profile_pic_menu.sign_up_label_default");
34
+ const resolvedSignInLabel = sign_in_label !== null && sign_in_label !== void 0 ? sign_in_label : t("profile_pic_menu.sign_in_label_default");
35
+ const resolvedSidebarGroupLabel = sidebar_group_label !== null && sidebar_group_label !== void 0 ? sidebar_group_label : t("profile_pic_menu.sidebar_group_label_default");
32
36
  const router = useRouter();
33
37
  const authStatus = use_auth_status();
34
38
  const [isLoggingOut, setIsLoggingOut] = useState(false);
@@ -66,9 +70,9 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
66
70
  });
67
71
  const data = await response.json();
68
72
  if (!response.ok || !data.success) {
69
- throw new Error(data.error || "Logout failed");
73
+ throw new Error(data.error || t("shared.logout.error_default"));
70
74
  }
71
- toast.success("Logged out successfully");
75
+ toast.success(t("shared.logout.success_toast"));
72
76
  // Trigger auth status refresh in all components
73
77
  trigger_auth_status_refresh();
74
78
  // Navigate to the configured post-logout destination, or refresh in place.
@@ -80,7 +84,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
80
84
  }
81
85
  }
82
86
  catch (error) {
83
- const errorMessage = error instanceof Error ? error.message : "Logout failed. Please try again.";
87
+ const errorMessage = error instanceof Error ? error.message : t("shared.logout.error_retry");
84
88
  toast.error(errorMessage);
85
89
  }
86
90
  finally {
@@ -119,7 +123,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
119
123
  // Settings (link, order: 1)
120
124
  items.push({
121
125
  type: "link",
122
- label: "Settings",
126
+ label: t("profile_pic_menu.settings_label_default"),
123
127
  href: settings_path,
124
128
  order: 1,
125
129
  id: "default_settings",
@@ -129,7 +133,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
129
133
  // POSTs to the API path and then navigates per `logout_path`.
130
134
  items.push({
131
135
  type: "link",
132
- label: "Logout",
136
+ label: t("shared.logout.label"),
133
137
  href: logoutApiPath,
134
138
  order: 2,
135
139
  id: "default_logout",
@@ -151,7 +155,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
151
155
  return a.order - b.order;
152
156
  });
153
157
  return items;
154
- }, [authStatus.authenticated, authStatus.name, authStatus.email, settings_path, logoutApiPath, custom_menu_items]);
158
+ }, [authStatus.authenticated, authStatus.name, authStatus.email, settings_path, logoutApiPath, custom_menu_items, t]);
155
159
  // Avatar size classes
156
160
  const avatarSizeClasses = {
157
161
  sm: "h-8 w-8",
@@ -161,22 +165,24 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
161
165
  // Show loading state
162
166
  if (authStatus.loading) {
163
167
  if (variant === "sidebar") {
164
- return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { children: sidebar_group_label }), _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx("div", { className: "h-10 w-10 rounded-full bg-[var(--hazo-bg-emphasis)] animate-pulse" }) }) })] }));
168
+ return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { children: resolvedSidebarGroupLabel }), _jsx(SidebarMenu, { children: _jsx(SidebarMenuItem, { children: _jsx("div", { className: "h-10 w-10 rounded-full bg-[var(--hazo-bg-emphasis)] animate-pulse" }) }) })] }));
165
169
  }
166
170
  return (_jsx("div", { className: `cls_profile_pic_menu ${className || ""}`, children: _jsx("div", { className: "h-10 w-10 rounded-full bg-[var(--hazo-bg-emphasis)] animate-pulse" }) }));
167
171
  }
168
172
  // Not authenticated - show sign up/sign in buttons
169
173
  if (!authStatus.authenticated) {
170
174
  if (variant === "sidebar") {
171
- return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { children: sidebar_group_label }), _jsx(SidebarMenu, { children: show_single_button ? (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: sign_up_label }) }) })) : (_jsxs(_Fragment, { children: [_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: sign_up_label }) }) }), _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: login_path, className: "cls_profile_pic_menu_sign_in", children: sign_in_label }) }) })] })) })] }));
175
+ return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { children: resolvedSidebarGroupLabel }), _jsx(SidebarMenu, { children: show_single_button ? (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: resolvedSignUpLabel }) }) })) : (_jsxs(_Fragment, { children: [_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: resolvedSignUpLabel }) }) }), _jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, children: _jsx(Link, { href: login_path, className: "cls_profile_pic_menu_sign_in", children: resolvedSignInLabel }) }) })] })) })] }));
172
176
  }
173
- return (_jsx("div", { className: `cls_profile_pic_menu flex items-center gap-2 ${className || ""}`, children: show_single_button ? (_jsx(Button, { asChild: true, variant: "default", size: "sm", children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: sign_up_label }) })) : (_jsxs(_Fragment, { children: [_jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: sign_up_label }) }), _jsx(Button, { asChild: true, variant: "default", size: "sm", children: _jsx(Link, { href: login_path, className: "cls_profile_pic_menu_sign_in", children: sign_in_label }) })] })) }));
177
+ return (_jsx("div", { className: `cls_profile_pic_menu flex items-center gap-2 ${className || ""}`, children: show_single_button ? (_jsx(Button, { asChild: true, variant: "default", size: "sm", children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: resolvedSignUpLabel }) })) : (_jsxs(_Fragment, { children: [_jsx(Button, { asChild: true, variant: "outline", size: "sm", children: _jsx(Link, { href: register_path, className: "cls_profile_pic_menu_sign_up", children: resolvedSignUpLabel }) }), _jsx(Button, { asChild: true, variant: "default", size: "sm", children: _jsx(Link, { href: login_path, className: "cls_profile_pic_menu_sign_in", children: resolvedSignInLabel }) })] })) }));
174
178
  }
175
179
  // Authenticated - render based on variant
176
180
  if (variant === "sidebar") {
177
181
  // Sidebar variant: show profile picture and name only, clicking opens dropdown
178
- return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { className: "cls_profile_pic_menu_sidebar_label", children: sidebar_group_label }), _jsx(SidebarMenu, { className: "cls_profile_pic_menu_sidebar_menu", children: _jsxs(SidebarMenuItem, { className: "cls_profile_pic_menu_sidebar_user_info", children: [_jsxs(DropdownMenu, { onOpenChange: (open) => { if (!open)
179
- setShiftKeyHeld(false); }, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: "cls_profile_pic_menu_sidebar_trigger w-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary rounded-md", "aria-label": "Profile menu", onClick: (e) => setShiftKeyHeld(e.shiftKey), children: _jsxs("div", { className: "cls_profile_pic_menu_sidebar_user flex items-center gap-3 px-2 py-2 hover:bg-sidebar-accent rounded-md transition-colors", children: [_jsxs(Avatar, { className: `cls_profile_pic_menu_avatar ${avatarSizeClasses[avatar_size]} cursor-pointer`, children: [_jsx(AvatarImage, { src: authStatus.profile_picture_url, alt: authStatus.name ? `Profile picture of ${authStatus.name}` : "Profile picture", className: "cls_profile_pic_menu_image" }), _jsx(AvatarFallback, { className: "cls_profile_pic_menu_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)]", children: getInitials() })] }), authStatus.name && (_jsx("span", { className: "cls_profile_pic_menu_sidebar_user_name text-sm font-medium text-sidebar-foreground truncate", children: authStatus.name }))] }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "cls_profile_pic_menu_dropdown w-56", children: [menuItems.map((item) => {
182
+ return (_jsxs(SidebarGroup, { className: `cls_profile_pic_menu_sidebar ${className || ""}`, children: [_jsx(SidebarGroupLabel, { className: "cls_profile_pic_menu_sidebar_label", children: resolvedSidebarGroupLabel }), _jsx(SidebarMenu, { className: "cls_profile_pic_menu_sidebar_menu", children: _jsxs(SidebarMenuItem, { className: "cls_profile_pic_menu_sidebar_user_info", children: [_jsxs(DropdownMenu, { onOpenChange: (open) => { if (!open)
183
+ setShiftKeyHeld(false); }, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: "cls_profile_pic_menu_sidebar_trigger w-full focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary rounded-md", "aria-label": t("profile_pic_menu.aria.profile_menu_default"), onClick: (e) => setShiftKeyHeld(e.shiftKey), children: _jsxs("div", { className: "cls_profile_pic_menu_sidebar_user flex items-center gap-3 px-2 py-2 hover:bg-sidebar-accent rounded-md transition-colors", children: [_jsxs(Avatar, { className: `cls_profile_pic_menu_avatar ${avatarSizeClasses[avatar_size]} cursor-pointer`, children: [_jsx(AvatarImage, { src: authStatus.profile_picture_url, alt: authStatus.name
184
+ ? t("profile_pic_menu.aria.avatar_alt_named", { name: authStatus.name })
185
+ : t("profile_pic_menu.aria.avatar_alt_default"), className: "cls_profile_pic_menu_image" }), _jsx(AvatarFallback, { className: "cls_profile_pic_menu_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)]", children: getInitials() })] }), authStatus.name && (_jsx("span", { className: "cls_profile_pic_menu_sidebar_user_name text-sm font-medium text-sidebar-foreground truncate", children: authStatus.name }))] }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "cls_profile_pic_menu_dropdown w-56", children: [menuItems.map((item) => {
180
186
  if (item.type === "separator") {
181
187
  return _jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }, item.id);
182
188
  }
@@ -186,7 +192,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
186
192
  if (item.type === "link") {
187
193
  // Special handling for logout
188
194
  if (item.id === "default_logout") {
189
- return (_jsxs(DropdownMenuItem, { onClick: handleLogout, disabled: isLoggingOut, className: "cls_profile_pic_menu_logout cursor-pointer text-destructive focus:text-destructive", children: [_jsx(LogOut, { className: "mr-2 h-4 w-4" }), isLoggingOut ? "Logging out..." : item.label] }, item.id));
195
+ return (_jsxs(DropdownMenuItem, { onClick: handleLogout, disabled: isLoggingOut, className: "cls_profile_pic_menu_logout cursor-pointer text-destructive focus:text-destructive", children: [_jsx(LogOut, { className: "mr-2 h-4 w-4" }), isLoggingOut ? t("shared.logout.logging_out") : item.label] }, item.id));
190
196
  }
191
197
  // Special handling for settings
192
198
  if (item.id === "default_settings") {
@@ -199,11 +205,13 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
199
205
  return (_jsx(DropdownMenuItem, { onClick: item.onSelect, className: "cls_profile_pic_menu_action cursor-pointer", children: item.label }, item.id));
200
206
  }
201
207
  return null;
202
- }), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), "My Permissions"] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "My Permissions" }), _jsx(DialogDescription, { children: "Your assigned roles and their permissions" })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }) })] }));
208
+ }), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), t("profile_pic_menu.permissions_label_default")] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: t("profile_pic_menu.permissions_label_default") }), _jsx(DialogDescription, { children: t("profile_pic_menu.permissions_description_default") })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }) })] }));
203
209
  }
204
210
  // Default dropdown variant: show profile picture with dropdown menu
205
211
  return (_jsxs("div", { className: `cls_profile_pic_menu ${className || ""}`, children: [_jsxs(DropdownMenu, { onOpenChange: (open) => { if (!open)
206
- setShiftKeyHeld(false); }, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: "cls_profile_pic_menu_trigger focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary rounded-full", "aria-label": "Profile menu", onClick: (e) => setShiftKeyHeld(e.shiftKey), children: _jsxs(Avatar, { className: `cls_profile_pic_menu_avatar ${avatarSizeClasses[avatar_size]} cursor-pointer`, children: [_jsx(AvatarImage, { src: authStatus.profile_picture_url, alt: authStatus.name ? `Profile picture of ${authStatus.name}` : "Profile picture", className: "cls_profile_pic_menu_image" }), _jsx(AvatarFallback, { className: "cls_profile_pic_menu_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)]", children: getInitials() })] }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "cls_profile_pic_menu_dropdown w-56", children: [menuItems.map((item) => {
212
+ setShiftKeyHeld(false); }, children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx("button", { className: "cls_profile_pic_menu_trigger focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary rounded-full", "aria-label": t("profile_pic_menu.aria.profile_menu_default"), onClick: (e) => setShiftKeyHeld(e.shiftKey), children: _jsxs(Avatar, { className: `cls_profile_pic_menu_avatar ${avatarSizeClasses[avatar_size]} cursor-pointer`, children: [_jsx(AvatarImage, { src: authStatus.profile_picture_url, alt: authStatus.name
213
+ ? t("profile_pic_menu.aria.avatar_alt_named", { name: authStatus.name })
214
+ : t("profile_pic_menu.aria.avatar_alt_default"), className: "cls_profile_pic_menu_image" }), _jsx(AvatarFallback, { className: "cls_profile_pic_menu_fallback bg-[var(--hazo-bg-emphasis)] text-[var(--hazo-text-muted)]", children: getInitials() })] }) }) }), _jsxs(DropdownMenuContent, { align: "end", className: "cls_profile_pic_menu_dropdown w-56", children: [menuItems.map((item) => {
207
215
  if (item.type === "separator") {
208
216
  return _jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }, item.id);
209
217
  }
@@ -213,7 +221,7 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
213
221
  if (item.type === "link") {
214
222
  // Special handling for logout
215
223
  if (item.id === "default_logout") {
216
- return (_jsxs(DropdownMenuItem, { onClick: handleLogout, disabled: isLoggingOut, className: "cls_profile_pic_menu_logout cursor-pointer text-destructive focus:text-destructive", children: [_jsx(LogOut, { className: "mr-2 h-4 w-4" }), isLoggingOut ? "Logging out..." : item.label] }, item.id));
224
+ return (_jsxs(DropdownMenuItem, { onClick: handleLogout, disabled: isLoggingOut, className: "cls_profile_pic_menu_logout cursor-pointer text-destructive focus:text-destructive", children: [_jsx(LogOut, { className: "mr-2 h-4 w-4" }), isLoggingOut ? t("shared.logout.logging_out") : item.label] }, item.id));
217
225
  }
218
226
  // Special handling for settings
219
227
  if (item.id === "default_settings") {
@@ -226,5 +234,5 @@ export function ProfilePicMenu({ show_single_button = false, sign_up_label = "Si
226
234
  return (_jsx(DropdownMenuItem, { onClick: item.onSelect, className: "cls_profile_pic_menu_action cursor-pointer", children: item.label }, item.id));
227
235
  }
228
236
  return null;
229
- }), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), "My Permissions"] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: "My Permissions" }), _jsx(DialogDescription, { children: "Your assigned roles and their permissions" })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }));
237
+ }), shiftKeyHeld && (_jsxs(_Fragment, { children: [_jsx(DropdownMenuSeparator, { className: "cls_profile_pic_menu_separator" }), _jsxs(DropdownMenuItem, { onClick: () => setShowPermissionsDialog(true), className: "cls_profile_pic_menu_permissions cursor-pointer", children: [_jsx(Shield, { className: "mr-2 h-4 w-4" }), t("profile_pic_menu.permissions_label_default")] })] }))] })] }), _jsx(Dialog, { open: showPermissionsDialog, onOpenChange: setShowPermissionsDialog, children: _jsxs(DialogContent, { className: "cls_profile_pic_menu_permissions_dialog max-w-2xl max-h-[80vh] flex flex-col", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: t("profile_pic_menu.permissions_label_default") }), _jsx(DialogDescription, { children: t("profile_pic_menu.permissions_description_default") })] }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx(RolesMatrix, { user_id: authStatus.user_id, add_button_enabled: false, role_name_selection_enabled: false, permissions_read_only: true, show_save_cancel: false }) })] }) })] }));
230
238
  }
@@ -2,6 +2,7 @@ export type ProfilePicMenuWrapperProps = {
2
2
  className?: string;
3
3
  avatar_size?: "default" | "sm" | "lg";
4
4
  variant?: "dropdown" | "sidebar";
5
+ /** Undefined falls back to `t("profile_pic_menu.sidebar_group_label_default")`. */
5
6
  sidebar_group_label?: string;
6
7
  };
7
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"profile_pic_menu_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu_wrapper.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,0BAA0B,GAAG;IACvC,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;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAW,EACX,OAAoB,EACpB,mBAA+B,GAChC,EAAE,0BAA0B,+BAmB5B"}
1
+ {"version":3,"file":"profile_pic_menu_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/profile_pic_menu_wrapper.tsx"],"names":[],"mappings":"AAMA,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACjC,mFAAmF;IACnF,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,WAAW,EACX,OAAoB,EACpB,mBAAmB,GACpB,EAAE,0BAA0B,+BAmB5B"}
@@ -10,7 +10,7 @@ import { get_profile_pic_menu_config } from "../../../../lib/profile_pic_menu_co
10
10
  * @param props - Component props including className, avatar_size, variant, and sidebar_group_label
11
11
  * @returns ProfilePicMenu component with loaded configuration
12
12
  */
13
- export function ProfilePicMenuWrapper({ className, avatar_size, variant = "dropdown", sidebar_group_label = "Account", }) {
13
+ export function ProfilePicMenuWrapper({ className, avatar_size, variant = "dropdown", sidebar_group_label, }) {
14
14
  const config = get_profile_pic_menu_config();
15
15
  return (_jsx(ProfilePicMenu, { show_single_button: config.show_single_button, sign_up_label: config.sign_up_label, sign_in_label: config.sign_in_label, register_path: config.register_path, login_path: config.login_path, settings_path: config.settings_path, logout_path: config.logout_path, custom_menu_items: config.custom_menu_items, className: className, avatar_size: avatar_size, variant: variant, sidebar_group_label: sidebar_group_label }));
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar_layout_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/sidebar_layout_wrapper.tsx"],"names":[],"mappings":"AAwBA,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,+BA2R3E"}
1
+ {"version":3,"file":"sidebar_layout_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/sidebar_layout_wrapper.tsx"],"names":[],"mappings":"AA0BA,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,+BAsS3E"}
@@ -8,8 +8,10 @@ import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarHeader
8
8
  import { LogIn, UserPlus, BookOpen, ExternalLink, Database, KeyRound, MailCheck, Key, User, ShieldCheck, CircleUserRound, FileJson, Building2, Palette, Settings2, Globe, Play } from "lucide-react";
9
9
  import { use_auth_status } from "../hooks/use_auth_status.js";
10
10
  import { ProfilePicMenu } from "./profile_pic_menu.js";
11
+ import { SidebarLocaleSwitcher } from "./sidebar_locale_switcher.js";
12
+ import { SidebarTranslateNav } from "./sidebar_translate_nav.js";
11
13
  // section: component
12
14
  export function SidebarLayoutWrapper({ children }) {
13
15
  const authStatus = use_auth_status();
14
- return (_jsx(SidebarProvider, { children: _jsxs("div", { className: "cls_sidebar_layout_wrapper flex min-h-screen w-full", children: [_jsxs(Sidebar, { children: [_jsx(SidebarHeader, { className: "cls_sidebar_layout_header", children: _jsx("div", { className: "cls_sidebar_layout_title flex items-center gap-2 px-2 py-4", children: _jsx("h1", { className: "cls_sidebar_layout_title_text text-lg font-semibold text-sidebar-foreground", children: "hazo auth" }) }) }), _jsxs(SidebarContent, { className: "cls_sidebar_layout_content", children: [_jsxs(SidebarGroup, { className: "cls_sidebar_layout_test_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Test components" }), _jsxs(SidebarMenu, { className: "cls_sidebar_layout_test_menu", children: [_jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_login_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/login", className: "cls_sidebar_layout_test_login_link flex items-center gap-2", "aria-label": "Test login layout component", children: [_jsx(LogIn, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test login" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_register_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/register", className: "cls_sidebar_layout_test_register_link flex items-center gap-2", "aria-label": "Test register layout component", children: [_jsx(UserPlus, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test register" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_forgot_password_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/forgot_password", className: "cls_sidebar_layout_test_forgot_password_link flex items-center gap-2", "aria-label": "Test forgot password layout component", children: [_jsx(KeyRound, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test forgot password" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_reset_password_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/reset_password", className: "cls_sidebar_layout_test_reset_password_link flex items-center gap-2", "aria-label": "Test reset password layout component", children: [_jsx(Key, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test reset password" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_email_verification_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/verify_email", className: "cls_sidebar_layout_test_email_verification_link flex items-center gap-2", "aria-label": "Test email verification layout component", children: [_jsx(MailCheck, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test email verification" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_sqlite_admin_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_connect/sqlite_admin", className: "cls_sidebar_layout_sqlite_admin_link flex items-center gap-2", "aria-label": "Open SQLite admin UI to browse and edit database", children: [_jsx(Database, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "SQLite Admin" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_user_management_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/user_management", className: "cls_sidebar_layout_user_management_link flex items-center gap-2", "aria-label": "Open User Management to manage users, roles, and permissions", children: [_jsx(User, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "User Management" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_rbac_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/rbac_test", className: "cls_sidebar_layout_rbac_test_link flex items-center gap-2", "aria-label": "Test RBAC and HRBAC access control", children: [_jsx(ShieldCheck, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "RBAC/HRBAC Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_profile_stamp_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/profile_stamp_test", className: "cls_sidebar_layout_profile_stamp_test_link flex items-center gap-2", "aria-label": "Test ProfileStamp component", children: [_jsx(CircleUserRound, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "ProfileStamp Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_app_user_data_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/app_user_data_test", className: "cls_sidebar_layout_app_user_data_test_link flex items-center gap-2", "aria-label": "Test app_user_data JSON storage", children: [_jsx(FileJson, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "App User Data Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_google_token_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/google_token_test", className: "cls_sidebar_layout_google_token_test_link flex items-center gap-2", "aria-label": "Test Google OAuth token storage and revocation", children: [_jsx(Globe, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Google Token Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_create_firm_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/create_firm", className: "cls_sidebar_layout_create_firm_link flex items-center gap-2", "aria-label": "Test create firm flow", children: [_jsx(Building2, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Create Firm" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_edit_firm_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/edit_firm", className: "cls_sidebar_layout_edit_firm_link flex items-center gap-2", "aria-label": "Test branding editor for firm", children: [_jsx(Palette, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Edit Firm" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_relationships_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/relationships", className: "cls_sidebar_layout_relationships_link flex items-center gap-2", "aria-label": "Test relationship accounts", children: [_jsx(User, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Relationships" })] }) }) })] })] }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_testing_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Testing" }), _jsx(SidebarMenu, { className: "cls_sidebar_layout_testing_menu", children: _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_scenarios_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/test_scenarios", className: "cls_sidebar_layout_test_scenarios_link flex items-center gap-2", "aria-label": "Test scenarios", children: [_jsx(Settings2, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test Scenarios" })] }) }) }) })] }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_auto_test_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Auto Tests" }), _jsx(SidebarMenu, { className: "cls_sidebar_layout_auto_test_menu", children: _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_auto_test_runner_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/autotest", className: "cls_sidebar_layout_auto_test_runner_link flex items-center gap-2", "aria-label": "Run browser autotests", children: [_jsx(Play, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Browser Autotest" })] }) }) }) })] }), _jsx(ProfilePicMenu, { variant: "sidebar", avatar_size: "sm", className: "cls_sidebar_layout_profile_menu", sidebar_group_label: "Account" }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_resources_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Resources" }), _jsxs(SidebarMenu, { className: "cls_sidebar_layout_resources_menu", children: [_jsx(SidebarMenuItem, { className: "cls_sidebar_layout_storybook_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs("a", { href: "http://localhost:6006", target: "_blank", rel: "noopener noreferrer", className: "cls_sidebar_layout_storybook_link flex items-center gap-2", "aria-label": "Open Storybook preview for reusable components", children: [_jsx(BookOpen, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Storybook" }), _jsx(ExternalLink, { className: "ml-auto h-3 w-3", "aria-hidden": "true" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_docs_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs("a", { href: "https://ui.shadcn.com/docs", target: "_blank", rel: "noopener noreferrer", className: "cls_sidebar_layout_docs_link flex items-center gap-2", "aria-label": "Review shadcn documentation for styling guidance", children: [_jsx(BookOpen, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Shadcn docs" }), _jsx(ExternalLink, { className: "ml-auto h-3 w-3", "aria-hidden": "true" })] }) }) })] })] })] })] }), _jsxs(SidebarInset, { className: "cls_sidebar_layout_inset", children: [_jsxs("header", { className: "cls_sidebar_layout_main_header flex h-16 shrink-0 items-center gap-2 border-b px-4", children: [_jsx(SidebarTrigger, { className: "cls_sidebar_layout_trigger" }), _jsx("div", { className: "cls_sidebar_layout_main_header_content flex flex-1 items-center gap-2", children: _jsx("h2", { className: "cls_sidebar_layout_main_title text-lg font-semibold text-foreground", children: "hazo reusable ui library workspace" }) }), _jsx(ProfilePicMenu, { className: "cls_sidebar_layout_auth_status", avatar_size: "sm" })] }), _jsx("main", { className: "cls_sidebar_layout_main_content flex flex-1 items-center justify-center p-6", children: children })] })] }) }));
16
+ return (_jsx(SidebarProvider, { children: _jsxs("div", { className: "cls_sidebar_layout_wrapper flex min-h-screen w-full", children: [_jsxs(Sidebar, { children: [_jsx(SidebarHeader, { className: "cls_sidebar_layout_header", children: _jsxs("div", { className: "cls_sidebar_layout_title flex items-center gap-2 px-2 py-4", children: [_jsx("h1", { className: "cls_sidebar_layout_title_text text-lg font-semibold text-sidebar-foreground", children: "hazo auth" }), _jsx("div", { className: "ml-auto", children: _jsx(SidebarLocaleSwitcher, {}) })] }) }), _jsxs(SidebarContent, { className: "cls_sidebar_layout_content", children: [_jsxs(SidebarGroup, { className: "cls_sidebar_layout_test_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Test components" }), _jsxs(SidebarMenu, { className: "cls_sidebar_layout_test_menu", children: [_jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_login_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/login", className: "cls_sidebar_layout_test_login_link flex items-center gap-2", "aria-label": "Test login layout component", children: [_jsx(LogIn, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test login" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_register_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/register", className: "cls_sidebar_layout_test_register_link flex items-center gap-2", "aria-label": "Test register layout component", children: [_jsx(UserPlus, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test register" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_forgot_password_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/forgot_password", className: "cls_sidebar_layout_test_forgot_password_link flex items-center gap-2", "aria-label": "Test forgot password layout component", children: [_jsx(KeyRound, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test forgot password" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_reset_password_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/reset_password", className: "cls_sidebar_layout_test_reset_password_link flex items-center gap-2", "aria-label": "Test reset password layout component", children: [_jsx(Key, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test reset password" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_email_verification_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/verify_email", className: "cls_sidebar_layout_test_email_verification_link flex items-center gap-2", "aria-label": "Test email verification layout component", children: [_jsx(MailCheck, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test email verification" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_sqlite_admin_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_connect/sqlite_admin", className: "cls_sidebar_layout_sqlite_admin_link flex items-center gap-2", "aria-label": "Open SQLite admin UI to browse and edit database", children: [_jsx(Database, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "SQLite Admin" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_user_management_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/user_management", className: "cls_sidebar_layout_user_management_link flex items-center gap-2", "aria-label": "Open User Management to manage users, roles, and permissions", children: [_jsx(User, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "User Management" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_rbac_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/rbac_test", className: "cls_sidebar_layout_rbac_test_link flex items-center gap-2", "aria-label": "Test RBAC and HRBAC access control", children: [_jsx(ShieldCheck, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "RBAC/HRBAC Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_profile_stamp_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/profile_stamp_test", className: "cls_sidebar_layout_profile_stamp_test_link flex items-center gap-2", "aria-label": "Test ProfileStamp component", children: [_jsx(CircleUserRound, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "ProfileStamp Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_app_user_data_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/app_user_data_test", className: "cls_sidebar_layout_app_user_data_test_link flex items-center gap-2", "aria-label": "Test app_user_data JSON storage", children: [_jsx(FileJson, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "App User Data Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_google_token_test_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/google_token_test", className: "cls_sidebar_layout_google_token_test_link flex items-center gap-2", "aria-label": "Test Google OAuth token storage and revocation", children: [_jsx(Globe, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Google Token Test" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_create_firm_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/create_firm", className: "cls_sidebar_layout_create_firm_link flex items-center gap-2", "aria-label": "Test create firm flow", children: [_jsx(Building2, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Create Firm" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_edit_firm_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/edit_firm", className: "cls_sidebar_layout_edit_firm_link flex items-center gap-2", "aria-label": "Test branding editor for firm", children: [_jsx(Palette, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Edit Firm" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_relationships_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/relationships", className: "cls_sidebar_layout_relationships_link flex items-center gap-2", "aria-label": "Test relationship accounts", children: [_jsx(User, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Relationships" })] }) }) })] })] }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_testing_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Testing" }), _jsx(SidebarMenu, { className: "cls_sidebar_layout_testing_menu", children: _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_test_scenarios_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/test_scenarios", className: "cls_sidebar_layout_test_scenarios_link flex items-center gap-2", "aria-label": "Test scenarios", children: [_jsx(Settings2, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Test Scenarios" })] }) }) }) })] }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_i18n_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "i18n" }), _jsx("div", { className: "px-2", children: _jsx(SidebarTranslateNav, {}) })] }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_auto_test_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Auto Tests" }), _jsx(SidebarMenu, { className: "cls_sidebar_layout_auto_test_menu", children: _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_auto_test_runner_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/autotest", className: "cls_sidebar_layout_auto_test_runner_link flex items-center gap-2", "aria-label": "Run browser autotests", children: [_jsx(Play, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Browser Autotest" })] }) }) }) })] }), _jsx(ProfilePicMenu, { variant: "sidebar", avatar_size: "sm", className: "cls_sidebar_layout_profile_menu", sidebar_group_label: "Account" }), _jsxs(SidebarGroup, { className: "cls_sidebar_layout_resources_group", children: [_jsx(SidebarGroupLabel, { className: "cls_sidebar_layout_group_label", children: "Resources" }), _jsxs(SidebarMenu, { className: "cls_sidebar_layout_resources_menu", children: [_jsx(SidebarMenuItem, { className: "cls_sidebar_layout_storybook_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs("a", { href: "http://localhost:6006", target: "_blank", rel: "noopener noreferrer", className: "cls_sidebar_layout_storybook_link flex items-center gap-2", "aria-label": "Open Storybook preview for reusable components", children: [_jsx(BookOpen, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Storybook" }), _jsx(ExternalLink, { className: "ml-auto h-3 w-3", "aria-hidden": "true" })] }) }) }), _jsx(SidebarMenuItem, { className: "cls_sidebar_layout_docs_item", children: _jsx(SidebarMenuButton, { asChild: true, children: _jsxs("a", { href: "https://ui.shadcn.com/docs", target: "_blank", rel: "noopener noreferrer", className: "cls_sidebar_layout_docs_link flex items-center gap-2", "aria-label": "Review shadcn documentation for styling guidance", children: [_jsx(BookOpen, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Shadcn docs" }), _jsx(ExternalLink, { className: "ml-auto h-3 w-3", "aria-hidden": "true" })] }) }) })] })] })] })] }), _jsxs(SidebarInset, { className: "cls_sidebar_layout_inset", children: [_jsxs("header", { className: "cls_sidebar_layout_main_header flex h-16 shrink-0 items-center gap-2 border-b px-4", children: [_jsx(SidebarTrigger, { className: "cls_sidebar_layout_trigger" }), _jsx("div", { className: "cls_sidebar_layout_main_header_content flex flex-1 items-center gap-2 min-w-0", children: _jsx("h2", { className: "cls_sidebar_layout_main_title text-lg font-semibold text-foreground truncate", children: "hazo reusable ui library workspace" }) }), _jsx(ProfilePicMenu, { className: "cls_sidebar_layout_auth_status", avatar_size: "sm" })] }), _jsx("div", { className: "cls_sidebar_layout_main_content flex-1 overflow-auto p-6", children: children })] })] }) }));
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"standalone_layout_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/standalone_layout_wrapper.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAGjE,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAGF,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,OAAqB,EACrB,WAA8E,EAC9E,gBAAgB,EAChB,gBAAgB,EAChB,WAAkB,EAClB,eAAsB,EACtB,MAAM,EACN,cAAqB,GACtB,EAAE,4BAA4B,+BAgD9B"}
1
+ {"version":3,"file":"standalone_layout_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/standalone_layout_wrapper.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAIjE,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,yDAAyD;IACzD,MAAM,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAChC,2DAA2D;IAC3D,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAGF,wBAAgB,uBAAuB,CAAC,EACtC,QAAQ,EACR,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,WAAkB,EAClB,eAAsB,EACtB,MAAM,EACN,cAAqB,GACtB,EAAE,4BAA4B,+BAmD9B"}
@@ -5,11 +5,15 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  // section: imports
6
6
  import { cn } from "../../../../lib/utils.js";
7
7
  import { AuthNavbar } from "./auth_navbar.js";
8
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
8
9
  // section: component
9
- export function StandaloneLayoutWrapper({ children, heading = "hazo auth", description = "Drop-in authentication flows that inherit your existing theme.", wrapperClassName, contentClassName, showHeading = true, showDescription = true, navbar, verticalCenter = true, }) {
10
+ export function StandaloneLayoutWrapper({ children, heading, description, wrapperClassName, contentClassName, showHeading = true, showDescription = true, navbar, verticalCenter = true, }) {
11
+ const t = useAuthT();
12
+ const resolvedHeading = heading !== null && heading !== void 0 ? heading : t("ui_shell.standalone_heading_default");
13
+ const resolvedDescription = description !== null && description !== void 0 ? description : t("ui_shell.standalone_description_default");
10
14
  const hasNavbar = navbar !== null && navbar !== undefined;
11
15
  return (
12
16
  // Single wrapper with min-h-screen and flexbox for proper layout
13
17
  // wrapperClassName applied here for consuming app theming/background
14
- _jsxs("div", { className: cn("cls_standalone_layout_outer cls_standalone_layout_wrapper flex min-h-screen w-full flex-col bg-background", wrapperClassName), children: [hasNavbar && _jsx(AuthNavbar, Object.assign({}, navbar)), _jsx("div", { className: cn("cls_standalone_layout_content_area flex-1", verticalCenter && "flex items-center justify-center"), children: _jsxs("div", { className: cn("cls_standalone_layout_content mx-auto flex w-full flex-col", verticalCenter ? "max-w-5xl gap-2 p-4" : "max-w-5xl gap-6 p-6", contentClassName), children: [(showHeading || showDescription) && (_jsxs("div", { className: "cls_standalone_layout_header text-center", children: [showHeading && (_jsx("h1", { className: "cls_standalone_layout_title text-2xl font-semibold tracking-tight text-foreground", children: heading })), showDescription && (_jsx("p", { className: "cls_standalone_layout_description mt-2 text-sm text-muted-foreground", children: description }))] })), _jsx("div", { className: "cls_standalone_layout_body", children: children })] }) })] }));
18
+ _jsxs("div", { className: cn("cls_standalone_layout_outer cls_standalone_layout_wrapper flex min-h-screen w-full flex-col bg-background", wrapperClassName), children: [hasNavbar && _jsx(AuthNavbar, Object.assign({}, navbar)), _jsx("div", { className: cn("cls_standalone_layout_content_area flex-1", verticalCenter && "flex items-center justify-center"), children: _jsxs("div", { className: cn("cls_standalone_layout_content mx-auto flex w-full flex-col", verticalCenter ? "max-w-5xl gap-2 p-4" : "max-w-5xl gap-6 p-6", contentClassName), children: [(showHeading || showDescription) && (_jsxs("div", { className: "cls_standalone_layout_header text-center", children: [showHeading && (_jsx("h1", { className: "cls_standalone_layout_title text-2xl font-semibold tracking-tight text-foreground", children: resolvedHeading })), showDescription && (_jsx("p", { className: "cls_standalone_layout_description mt-2 text-sm text-muted-foreground", children: resolvedDescription }))] })), _jsx("div", { className: "cls_standalone_layout_body", children: children })] }) })] }));
15
19
  }
@@ -1 +1 @@
1
- {"version":3,"file":"unauthorized_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/unauthorized_guard.tsx"],"names":[],"mappings":"AAeA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAwD,EACxD,gBAAyD,EACzD,SAA8B,EAC9B,QAAQ,GACT,EAAE,sBAAsB,+BA8CxB"}
1
+ {"version":3,"file":"unauthorized_guard.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/unauthorized_guard.tsx"],"names":[],"mappings":"AAYA,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,gBAAgB,EAChB,SAA8B,EAC9B,QAAQ,GACT,EAAE,sBAAsB,+BAiDxB"}
@@ -7,9 +7,7 @@ import { use_auth_status } from "../hooks/use_auth_status.js";
7
7
  import { Button } from "../../../ui/button.js";
8
8
  import { useRouter } from "next/navigation";
9
9
  import { LogIn } from "lucide-react";
10
- import en from "../../../../locales/en.json" with { type: "json" };
11
- import { createPackageT } from "hazo_core/i18n";
12
- const t = createPackageT("hazo_auth", en);
10
+ import { useAuthT } from "../../../../contexts/hazo_auth_provider.js";
13
11
  // section: component
14
12
  /**
15
13
  * Guard component that shows unauthorized message if user is not authenticated
@@ -17,13 +15,16 @@ const t = createPackageT("hazo_auth", en);
17
15
  * @param props - Component props including message and login button customization
18
16
  * @returns Either the unauthorized UI or the children
19
17
  */
20
- export function UnauthorizedGuard({ message = t("shared.guard.unauthorized_message_default"), loginButtonLabel = t("shared.guard.login_button_default"), loginPath = "/hazo_auth/login", children, }) {
18
+ export function UnauthorizedGuard({ message, loginButtonLabel, loginPath = "/hazo_auth/login", children, }) {
19
+ const t = useAuthT();
20
+ const resolvedMessage = message !== null && message !== void 0 ? message : t("shared.guard.unauthorized_message_default");
21
+ const resolvedLoginButtonLabel = loginButtonLabel !== null && loginButtonLabel !== void 0 ? loginButtonLabel : t("shared.guard.login_button_default");
21
22
  const router = useRouter();
22
23
  const authStatus = use_auth_status();
23
24
  // Check if user should see unauthorized message
24
25
  const shouldShowUnauthorized = !authStatus.authenticated && !authStatus.loading;
25
26
  if (shouldShowUnauthorized) {
26
- return (_jsx("div", { className: "cls_unauthorized_guard flex flex-col items-center justify-center min-h-screen p-8", children: _jsxs("div", { className: "cls_unauthorized_guard_content flex flex-col items-center gap-4 text-center max-w-md", children: [_jsx("div", { className: "cls_unauthorized_guard_icon flex items-center justify-center w-16 h-16 rounded-full bg-red-100", children: _jsx(LogIn, { className: "h-8 w-8 text-red-600", "aria-hidden": "true" }) }), _jsxs("div", { className: "cls_unauthorized_guard_text", children: [_jsx("h1", { className: "cls_unauthorized_guard_heading text-2xl font-semibold text-slate-900 mb-2", children: t("shared.guard.access_denied_heading") }), _jsx("p", { className: "cls_unauthorized_guard_message text-slate-600", children: message })] }), _jsxs(Button, { onClick: () => router.push(loginPath), variant: "default", className: "cls_unauthorized_guard_login_button mt-4", "aria-label": loginButtonLabel, children: [_jsx(LogIn, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), loginButtonLabel] })] }) }));
27
+ return (_jsx("div", { className: "cls_unauthorized_guard flex flex-col items-center justify-center min-h-screen p-8", children: _jsxs("div", { className: "cls_unauthorized_guard_content flex flex-col items-center gap-4 text-center max-w-md", children: [_jsx("div", { className: "cls_unauthorized_guard_icon flex items-center justify-center w-16 h-16 rounded-full bg-red-100", children: _jsx(LogIn, { className: "h-8 w-8 text-red-600", "aria-hidden": "true" }) }), _jsxs("div", { className: "cls_unauthorized_guard_text", children: [_jsx("h1", { className: "cls_unauthorized_guard_heading text-2xl font-semibold text-slate-900 mb-2", children: t("shared.guard.access_denied_heading") }), _jsx("p", { className: "cls_unauthorized_guard_message text-slate-600", children: resolvedMessage })] }), _jsxs(Button, { onClick: () => router.push(loginPath), variant: "default", className: "cls_unauthorized_guard_login_button mt-4", "aria-label": resolvedLoginButtonLabel, children: [_jsx(LogIn, { className: "h-4 w-4 mr-2", "aria-hidden": "true" }), resolvedLoginButtonLabel] })] }) }));
27
28
  }
28
29
  // Show loading state while checking authentication
29
30
  if (authStatus.loading) {
@@ -1,6 +1,7 @@
1
1
  import type { PasswordRequirementOptions } from "../../../../lib/utils/password_validator";
2
+ import type { AuthTFunction } from "../../../../contexts/hazo_auth_config";
2
3
  export type { PasswordRequirementOptions };
3
- export declare const SHARED_EMAIL_FIELD_COPY: {
4
+ export declare const SHARED_EMAIL_FIELD_COPY: (t: AuthTFunction) => {
4
5
  readonly label: string;
5
6
  readonly placeholder: string;
6
7
  readonly ariaLabel: string;
@@ -1 +1 @@
1
- {"version":3,"file":"layout_customization.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/config/layout_customization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAG3F,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAU3C,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAGX,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAG/E,eAAO,MAAM,uBAAuB,GAClC,iBAAiB,cAAc,EAC/B,YAAY,uBAAuB,KAClC,cAqBF,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,UAAU,mBAAmB,EAC7B,YAAY,oBAAoB,KAC/B,mBAGD,CAAC;AAEH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,qBAAqB,EAC/B,YAAY,sBAAsB,KACjC,qBAGD,CAAC;AAEH,eAAO,MAAM,2BAA2B,GACtC,UAAU,0BAA0B,EACpC,YAAY,4BAA4B,KACvC,0BAGD,CAAC"}
1
+ {"version":3,"file":"layout_customization.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/config/layout_customization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,CAAC;AAS3C,eAAO,MAAM,uBAAuB,GAAI,GAAG,aAAa;;;;CAK3C,CAAC;AAGd,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC;AAEnC,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;AAC1E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAEhE,MAAM,MAAM,qBAAqB,GAAG;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEpE,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAG/E,eAAO,MAAM,uBAAuB,GAClC,iBAAiB,cAAc,EAC/B,YAAY,uBAAuB,KAClC,cAqBF,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,UAAU,mBAAmB,EAC7B,YAAY,oBAAoB,KAC/B,mBAkBF,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,UAAU,qBAAqB,EAC/B,YAAY,sBAAsB,KACjC,qBAGD,CAAC;AAEH,eAAO,MAAM,2BAA2B,GACtC,UAAU,0BAA0B,EACpC,YAAY,4BAA4B,KACvC,0BAGD,CAAC"}
@@ -1,17 +1,15 @@
1
- import en from "../../../../locales/en.json" with { type: "json" };
2
- import { createPackageT } from "hazo_core/i18n";
3
- // section: i18n
4
- const t = createPackageT("hazo_auth", en);
5
1
  // section: shared_field_copy
6
2
  // The "email address" field (label / placeholder / aria-label) is repeated
7
3
  // identically across login, register, forgot_password, and
8
4
  // email_verification field configs — this is the single source of truth so
9
5
  // all four end up with the same three strings (dedup: PRD §16.8 Step 0).
10
- export const SHARED_EMAIL_FIELD_COPY = {
6
+ // Accepts `t` so callers can resolve it with a locale-aware translator
7
+ // (e.g. `useAuthT()`) instead of the package's bundled English fallback.
8
+ export const SHARED_EMAIL_FIELD_COPY = (t) => ({
11
9
  label: t("shared.field.email.label"),
12
10
  placeholder: t("shared.field.email.placeholder"),
13
11
  ariaLabel: t("shared.field.email.aria_label"),
14
- };
12
+ });
15
13
  // section: helpers
16
14
  export const resolveFieldDefinitions = (baseDefinitions, overrides) => {
17
15
  if (!overrides) {
@@ -28,6 +26,19 @@ export const resolveFieldDefinitions = (baseDefinitions, overrides) => {
28
26
  });
29
27
  return merged;
30
28
  };
31
- export const resolveLabels = (defaults, overrides) => (Object.assign(Object.assign({}, defaults), (overrides !== null && overrides !== void 0 ? overrides : {})));
29
+ export const resolveLabels = (defaults, overrides) => {
30
+ // Filter out keys whose value is `undefined` before spreading. Callers
31
+ // (server_pages/*) build the overrides object from config/strings sources
32
+ // that are themselves `string | undefined` — e.g. `{ heading: login_strings.title }`
33
+ // where `login_strings.title` is `undefined` when not explicitly overridden.
34
+ // A plain object spread assigns that key with value `undefined`, which would
35
+ // clobber `defaults.heading` and permanently blank the field instead of
36
+ // falling back to it. Filtering first ensures "field present but undefined"
37
+ // behaves identically to "field omitted".
38
+ const defined_overrides = overrides
39
+ ? Object.fromEntries(Object.entries(overrides).filter(([, value]) => value !== undefined))
40
+ : {};
41
+ return Object.assign(Object.assign({}, defaults), defined_overrides);
42
+ };
32
43
  export const resolveButtonPalette = (defaults, overrides) => (Object.assign(Object.assign({}, defaults), (overrides !== null && overrides !== void 0 ? overrides : {})));
33
44
  export const resolvePasswordRequirements = (defaults, overrides) => (Object.assign(Object.assign({}, defaults), (overrides !== null && overrides !== void 0 ? overrides : {})));
@@ -1,10 +1,12 @@
1
1
  import type { PasswordRequirementOptions } from "../config/layout_customization";
2
+ import type { AuthTFunction } from "../../../../contexts/hazo_auth_config";
2
3
  /**
3
4
  * Validates an email address format
4
5
  * @param email - The email address to validate
6
+ * @param t - Locale-aware translation function (e.g. from `useAuthT()`)
5
7
  * @returns Error message string if invalid, undefined if valid
6
8
  */
7
- export declare function validateEmail(email: string): string | undefined;
9
+ export declare function validateEmail(email: string, t: AuthTFunction): string | undefined;
8
10
  /**
9
11
  * Validates a password against specified requirements
10
12
  *
@@ -13,7 +15,8 @@ export declare function validateEmail(email: string): string | undefined;
13
15
  * the identical text per validation rule (dedup: PRD §16.8 Step 0).
14
16
  * @param password - The password to validate
15
17
  * @param requirements - Password requirement options
18
+ * @param t - Locale-aware translation function (e.g. from `useAuthT()`)
16
19
  * @returns Array of error message strings if invalid, undefined if valid
17
20
  */
18
- export declare function validatePassword(password: string, requirements: PasswordRequirementOptions): string[] | undefined;
21
+ export declare function validatePassword(password: string, requirements: PasswordRequirementOptions, t: AuthTFunction): string[] | undefined;
19
22
  //# sourceMappingURL=validation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/utils/validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAajF;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM/D;AAGD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,0BAA0B,GACvC,MAAM,EAAE,GAAG,SAAS,CAmCtB"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/utils/validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAM3E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,GAAG,MAAM,GAAG,SAAS,CAMjF;AAGD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,0BAA0B,EACxC,CAAC,EAAE,aAAa,GACf,MAAM,EAAE,GAAG,SAAS,CAmCtB"}