hazo_auth 6.1.1 → 7.0.2

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 (210) hide show
  1. package/README.md +65 -167
  2. package/SETUP_CHECKLIST.md +28 -100
  3. package/cli-src/cli/generate.ts +1 -10
  4. package/cli-src/cli/validate.ts +0 -4
  5. package/cli-src/lib/auth/auth_types.ts +12 -21
  6. package/cli-src/lib/auth/hazo_get_tenant_auth.server.ts +24 -25
  7. package/cli-src/lib/auth/index.ts +2 -2
  8. package/cli-src/lib/auth/nextauth_config.ts +61 -1
  9. package/cli-src/lib/auth/with_auth.server.ts +15 -15
  10. package/cli-src/lib/config/default_config.ts +8 -0
  11. package/cli-src/lib/cookies_config.server.ts +1 -1
  12. package/cli-src/lib/login_config.server.ts +2 -18
  13. package/cli-src/lib/oauth_config.server.ts +32 -0
  14. package/cli-src/lib/register_config.server.ts +4 -0
  15. package/cli-src/lib/services/email_template_manifest.ts +0 -17
  16. package/cli-src/lib/services/index.ts +2 -8
  17. package/cli-src/lib/services/oauth_service.ts +143 -0
  18. package/cli-src/lib/services/otp_service.ts +7 -2
  19. package/cli-src/lib/services/session_token_service.ts +0 -2
  20. package/config/hazo_auth_config.example.ini +0 -38
  21. package/dist/cli/generate.d.ts.map +1 -1
  22. package/dist/cli/generate.js +1 -10
  23. package/dist/cli/validate.d.ts.map +1 -1
  24. package/dist/cli/validate.js +0 -4
  25. package/dist/client.d.ts +0 -2
  26. package/dist/client.d.ts.map +1 -1
  27. package/dist/client.js +0 -1
  28. package/dist/components/layouts/login/index.d.ts +5 -7
  29. package/dist/components/layouts/login/index.d.ts.map +1 -1
  30. package/dist/components/layouts/login/index.js +5 -2
  31. package/dist/components/layouts/otp/index.d.ts +12 -1
  32. package/dist/components/layouts/otp/index.d.ts.map +1 -1
  33. package/dist/components/layouts/otp/index.js +4 -2
  34. package/dist/components/layouts/register/index.d.ts +4 -0
  35. package/dist/components/layouts/register/index.d.ts.map +1 -1
  36. package/dist/components/layouts/register/index.js +4 -1
  37. package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts +21 -0
  38. package/dist/components/layouts/shared/components/facebook_sign_in_button.d.ts.map +1 -0
  39. package/dist/components/layouts/shared/components/facebook_sign_in_button.js +47 -0
  40. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.d.ts.map +1 -1
  41. package/dist/components/layouts/shared/components/sidebar_layout_wrapper.js +3 -8
  42. package/dist/components/layouts/shared/index.d.ts +2 -0
  43. package/dist/components/layouts/shared/index.d.ts.map +1 -1
  44. package/dist/components/layouts/shared/index.js +1 -0
  45. package/dist/components/layouts/user_management/index.d.ts.map +1 -1
  46. package/dist/components/layouts/user_management/index.js +39 -2
  47. package/dist/consent/consent_state.d.ts +18 -0
  48. package/dist/consent/consent_state.d.ts.map +1 -0
  49. package/dist/consent/consent_state.js +29 -0
  50. package/dist/consent/cookie_consent_banner.d.ts +11 -0
  51. package/dist/consent/cookie_consent_banner.d.ts.map +1 -0
  52. package/dist/consent/cookie_consent_banner.js +40 -0
  53. package/dist/consent/gtm_mapping.d.ts +13 -0
  54. package/dist/consent/gtm_mapping.d.ts.map +1 -0
  55. package/dist/consent/gtm_mapping.js +30 -0
  56. package/dist/consent/index.d.ts +7 -0
  57. package/dist/consent/index.d.ts.map +1 -0
  58. package/dist/consent/index.js +7 -0
  59. package/dist/consent/manage_modal.d.ts +2 -0
  60. package/dist/consent/manage_modal.d.ts.map +1 -0
  61. package/dist/consent/manage_modal.js +33 -0
  62. package/dist/consent/read_consent.d.ts +15 -0
  63. package/dist/consent/read_consent.d.ts.map +1 -0
  64. package/dist/consent/read_consent.js +23 -0
  65. package/dist/consent/use_consent.d.ts +7 -0
  66. package/dist/consent/use_consent.d.ts.map +1 -0
  67. package/dist/consent/use_consent.js +55 -0
  68. package/dist/index.d.ts +1 -1
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/lib/auth/auth_types.d.ts +12 -13
  71. package/dist/lib/auth/auth_types.d.ts.map +1 -1
  72. package/dist/lib/auth/auth_types.js +0 -8
  73. package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts +7 -8
  74. package/dist/lib/auth/hazo_get_tenant_auth.server.d.ts.map +1 -1
  75. package/dist/lib/auth/hazo_get_tenant_auth.server.js +22 -23
  76. package/dist/lib/auth/index.d.ts +2 -2
  77. package/dist/lib/auth/index.d.ts.map +1 -1
  78. package/dist/lib/auth/nextauth_config.d.ts.map +1 -1
  79. package/dist/lib/auth/nextauth_config.js +50 -1
  80. package/dist/lib/auth/with_auth.server.d.ts +13 -13
  81. package/dist/lib/auth/with_auth.server.d.ts.map +1 -1
  82. package/dist/lib/auth/with_auth.server.js +2 -2
  83. package/dist/lib/config/default_config.d.ts +16 -0
  84. package/dist/lib/config/default_config.d.ts.map +1 -1
  85. package/dist/lib/config/default_config.js +8 -0
  86. package/dist/lib/cookies_config.server.d.ts +1 -1
  87. package/dist/lib/cookies_config.server.js +1 -1
  88. package/dist/lib/login_config.server.d.ts +0 -6
  89. package/dist/lib/login_config.server.d.ts.map +1 -1
  90. package/dist/lib/login_config.server.js +2 -11
  91. package/dist/lib/oauth_config.server.d.ts +8 -0
  92. package/dist/lib/oauth_config.server.d.ts.map +1 -1
  93. package/dist/lib/oauth_config.server.js +10 -0
  94. package/dist/lib/register_config.server.d.ts +2 -0
  95. package/dist/lib/register_config.server.d.ts.map +1 -1
  96. package/dist/lib/register_config.server.js +2 -0
  97. package/dist/lib/services/email_template_manifest.d.ts.map +1 -1
  98. package/dist/lib/services/email_template_manifest.js +0 -17
  99. package/dist/lib/services/index.d.ts +0 -2
  100. package/dist/lib/services/index.d.ts.map +1 -1
  101. package/dist/lib/services/index.js +0 -1
  102. package/dist/lib/services/oauth_service.d.ts +13 -0
  103. package/dist/lib/services/oauth_service.d.ts.map +1 -1
  104. package/dist/lib/services/oauth_service.js +122 -0
  105. package/dist/lib/services/otp_service.d.ts +1 -1
  106. package/dist/lib/services/otp_service.d.ts.map +1 -1
  107. package/dist/lib/services/otp_service.js +6 -1
  108. package/dist/lib/services/session_token_service.d.ts +0 -2
  109. package/dist/lib/services/session_token_service.d.ts.map +1 -1
  110. package/dist/lib/services/session_token_service.js +0 -2
  111. package/dist/server/routes/assets.d.ts +8 -0
  112. package/dist/server/routes/assets.d.ts.map +1 -0
  113. package/dist/server/routes/assets.js +38 -0
  114. package/dist/server/routes/consent_me.d.ts +4 -0
  115. package/dist/server/routes/consent_me.d.ts.map +1 -0
  116. package/dist/server/routes/consent_me.js +15 -0
  117. package/dist/server/routes/index.d.ts +6 -3
  118. package/dist/server/routes/index.d.ts.map +1 -1
  119. package/dist/server/routes/index.js +9 -4
  120. package/dist/server/routes/me.d.ts.map +1 -1
  121. package/dist/server/routes/me.js +1 -43
  122. package/dist/server/routes/oauth_facebook_callback.d.ts +8 -0
  123. package/dist/server/routes/oauth_facebook_callback.d.ts.map +1 -0
  124. package/dist/server/routes/oauth_facebook_callback.js +164 -0
  125. package/dist/server/routes/otp/verify.js +2 -2
  126. package/dist/server/routes/strings_defaults.d.ts +4 -0
  127. package/dist/server/routes/strings_defaults.d.ts.map +1 -0
  128. package/dist/server/routes/strings_defaults.js +7 -0
  129. package/dist/server/routes/user_management_users.d.ts +11 -0
  130. package/dist/server/routes/user_management_users.d.ts.map +1 -1
  131. package/dist/server/routes/user_management_users.js +50 -0
  132. package/dist/server-lib.d.ts +0 -3
  133. package/dist/server-lib.d.ts.map +1 -1
  134. package/dist/server-lib.js +0 -2
  135. package/dist/server_pages/forgot_password.d.ts +1 -1
  136. package/dist/server_pages/forgot_password.d.ts.map +1 -1
  137. package/dist/server_pages/forgot_password.js +9 -3
  138. package/dist/server_pages/forgot_password_client_wrapper.d.ts +3 -1
  139. package/dist/server_pages/forgot_password_client_wrapper.d.ts.map +1 -1
  140. package/dist/server_pages/forgot_password_client_wrapper.js +2 -2
  141. package/dist/server_pages/index.d.ts +2 -0
  142. package/dist/server_pages/index.d.ts.map +1 -1
  143. package/dist/server_pages/index.js +1 -0
  144. package/dist/server_pages/login.d.ts +1 -1
  145. package/dist/server_pages/login.d.ts.map +1 -1
  146. package/dist/server_pages/login.js +12 -3
  147. package/dist/server_pages/login_client_wrapper.d.ts +4 -1
  148. package/dist/server_pages/login_client_wrapper.d.ts.map +1 -1
  149. package/dist/server_pages/login_client_wrapper.js +2 -2
  150. package/dist/server_pages/my_settings.d.ts +1 -1
  151. package/dist/server_pages/my_settings.d.ts.map +1 -1
  152. package/dist/server_pages/my_settings.js +1 -2
  153. package/dist/server_pages/otp.d.ts +16 -2
  154. package/dist/server_pages/otp.d.ts.map +1 -1
  155. package/dist/server_pages/otp.js +10 -3
  156. package/dist/server_pages/register.d.ts +1 -1
  157. package/dist/server_pages/register.d.ts.map +1 -1
  158. package/dist/server_pages/register.js +11 -3
  159. package/dist/server_pages/register_client_wrapper.d.ts +3 -1
  160. package/dist/server_pages/register_client_wrapper.d.ts.map +1 -1
  161. package/dist/server_pages/register_client_wrapper.js +2 -2
  162. package/dist/server_pages/reset_password.d.ts +1 -1
  163. package/dist/server_pages/reset_password.d.ts.map +1 -1
  164. package/dist/server_pages/reset_password.js +9 -3
  165. package/dist/server_pages/reset_password_client_wrapper.d.ts +3 -1
  166. package/dist/server_pages/reset_password_client_wrapper.d.ts.map +1 -1
  167. package/dist/server_pages/reset_password_client_wrapper.js +2 -2
  168. package/dist/server_pages/verify_email.d.ts +1 -1
  169. package/dist/server_pages/verify_email.d.ts.map +1 -1
  170. package/dist/server_pages/verify_email.js +8 -3
  171. package/dist/server_pages/verify_email_client_wrapper.d.ts +3 -1
  172. package/dist/server_pages/verify_email_client_wrapper.d.ts.map +1 -1
  173. package/dist/server_pages/verify_email_client_wrapper.js +2 -2
  174. package/dist/strings/default_strings.d.ts +47 -0
  175. package/dist/strings/default_strings.d.ts.map +1 -0
  176. package/dist/strings/default_strings.js +18 -0
  177. package/dist/strings/index.d.ts +4 -0
  178. package/dist/strings/index.d.ts.map +1 -0
  179. package/dist/strings/index.js +3 -0
  180. package/dist/strings/strings_context.d.ts +12 -0
  181. package/dist/strings/strings_context.d.ts.map +1 -0
  182. package/dist/strings/strings_context.js +23 -0
  183. package/dist/strings/strings_provider.d.ts +26 -0
  184. package/dist/strings/strings_provider.d.ts.map +1 -0
  185. package/dist/strings/strings_provider.js +45 -0
  186. package/dist/theme/create_theme.d.ts +7 -0
  187. package/dist/theme/create_theme.d.ts.map +1 -0
  188. package/dist/theme/create_theme.js +97 -0
  189. package/dist/theme/hex_to_hsl.d.ts +16 -0
  190. package/dist/theme/hex_to_hsl.d.ts.map +1 -0
  191. package/dist/theme/hex_to_hsl.js +110 -0
  192. package/dist/theme/index.d.ts +4 -0
  193. package/dist/theme/index.d.ts.map +1 -0
  194. package/dist/theme/index.js +3 -0
  195. package/dist/theme/luminance.d.ts +11 -0
  196. package/dist/theme/luminance.d.ts.map +1 -0
  197. package/dist/theme/luminance.js +45 -0
  198. package/dist/theme/theme_provider.d.ts +14 -0
  199. package/dist/theme/theme_provider.d.ts.map +1 -0
  200. package/dist/theme/theme_provider.js +23 -0
  201. package/dist/theme/theme_types.d.ts +36 -0
  202. package/dist/theme/theme_types.d.ts.map +1 -0
  203. package/dist/theme/theme_types.js +1 -0
  204. package/dist/themes/index.d.ts +2 -0
  205. package/dist/themes/index.d.ts.map +1 -0
  206. package/dist/themes/index.js +2 -0
  207. package/dist/themes/preset_neutral.d.ts +3 -0
  208. package/dist/themes/preset_neutral.d.ts.map +1 -0
  209. package/dist/themes/preset_neutral.js +14 -0
  210. package/package.json +25 -22
@@ -143,6 +143,11 @@ export async function request_email_otp(args: {
143
143
  expires_at,
144
144
  attempt_count: 0,
145
145
  requester_ip: ip,
146
+ // Explicitly pass created_at in JS ISO format ("2024-01-01T00:00:00.000Z") rather
147
+ // than relying on SQLite's DEFAULT (datetime('now') = "2024-01-01 00:00:00").
148
+ // The space-separated SQLite format compares as less-than the T-separated JS ISO
149
+ // threshold used in rate-limit WHERE clauses, causing the counter to always read 0.
150
+ created_at: new Date().toISOString(),
146
151
  });
147
152
 
148
153
  // 7. Dispatch email — fire-and-forget; errors are logged but do not surface to caller
@@ -168,7 +173,7 @@ export async function request_email_otp(args: {
168
173
 
169
174
  export type VerifyEmailOTPResult =
170
175
  | { ok: true; user_id: string; email: string; session_token: string }
171
- | { ok: false; error: "invalid_or_expired" };
176
+ | { ok: false; error: "invalid_or_expired" | "expired" };
172
177
 
173
178
  export async function verify_email_otp(args: {
174
179
  email: string;
@@ -205,7 +210,7 @@ export async function verify_email_otp(args: {
205
210
  // 2. Check expiry
206
211
  const expires_at_ms = Date.parse(String(row.expires_at));
207
212
  if (Number.isNaN(expires_at_ms) || expires_at_ms < Date.now()) {
208
- return { ok: false, error: "invalid_or_expired" };
213
+ return { ok: false, error: "expired" };
209
214
  }
210
215
 
211
216
  // 3. argon2 verify
@@ -63,8 +63,6 @@ function get_session_token_expiry_seconds(): number {
63
63
  * Token includes user_id, email, issued at time, and expiration
64
64
  * @param user_id - User ID
65
65
  * @param email - User email address
66
- * @param managed_by_user_id - Optional: ID of the managing user (for impersonation)
67
- * @param ttl_seconds - Optional: token lifetime in seconds (default: 30 days). Use 604800 for 7-day OTP sessions.
68
66
  * @returns JWT token string
69
67
  */
70
68
  export async function create_session_token(
@@ -159,11 +159,6 @@ enable_admin_ui = true
159
159
  # Success message (shown when no redirect route is provided)
160
160
  # success_message = Successfully logged in
161
161
 
162
- ; OTP sign-in link in the login layout.
163
- otp_signin_enabled = false
164
- otp_signin_label = Sign in with email code
165
- otp_signin_href = /hazo_auth/otp
166
-
167
162
  [hazo_auth__forgot_password_layout]
168
163
  # Image configuration
169
164
  # image_src = /globe.svg
@@ -734,36 +729,3 @@ company_name = My Company
734
729
  # [hazo_auth__login_layout]
735
730
  # image_src = /your-custom-image.jpg
736
731
 
737
- [hazo_auth__otp]
738
- ; Email-OTP sign-in configuration (v6.1.0+).
739
- ;
740
- ; Whether /otp/verify may create new hazo_users rows for unknown emails.
741
- ; false (default): /otp/request silently no-ops for unknown emails.
742
- ; true: /otp/verify creates a user row on first successful code match.
743
- otp_auto_register = false
744
-
745
- ; OTP code lifetime in seconds (default 600 = 10 minutes).
746
- otp_code_ttl_seconds = 600
747
-
748
- ; OTP session lifetime in seconds (default 604800 = 7 days).
749
- otp_session_ttl_seconds = 604800
750
-
751
- ; Sliding-session threshold: if a /me call lands and the JWT exp is within
752
- ; this many seconds, re-issue the session for another otp_session_ttl_seconds.
753
- otp_slide_when_within_seconds = 86400
754
-
755
- ; Per-email rate limit for /otp/request.
756
- otp_email_rate_limit_max = 3
757
- otp_email_rate_limit_window_seconds = 900
758
-
759
- ; Per-IP rate limit for /otp/request.
760
- otp_ip_rate_limit_max = 20
761
- otp_ip_rate_limit_window_seconds = 3600
762
-
763
- ; Wrong-guess limit per code; row is poisoned after this many failures.
764
- otp_max_verify_attempts = 5
765
-
766
- ; Scope binding for newly auto-registered users (only used when otp_auto_register=true).
767
- otp_auto_assign_scope_id = 00000000-0000-0000-0000-000000000001
768
- otp_auto_assign_role_name = member
769
-
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AA0MF,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CA8DnE"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAqBA,MAAM,MAAM,eAAe,GAAG;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC;AAiMF,wBAAgB,eAAe,CAAC,OAAO,GAAE,eAAoB,GAAG,IAAI,CA8DnE"}
@@ -93,20 +93,11 @@ ${exports}
93
93
  `;
94
94
  }
95
95
  function generate_page_content(page) {
96
- // Next 16 requires page default exports to satisfy `PageProps` (i.e. accept
97
- // `{ params?, searchParams? }` and nothing else). Re-exporting the named
98
- // component directly fails that check because the component carries custom
99
- // props (image_src, layout, …). The wrapper below is a parameter-less
100
- // function that returns the component — Next sees a `() => JSX` signature
101
- // which trivially satisfies PageProps. Direct JSX consumers still use the
102
- // named export from `hazo_auth/pages` and get the full custom-prop API.
103
96
  return `// Generated by hazo_auth - do not edit manually
104
97
  // Page: /${page.path}
105
98
  import { ${page.component_name} } from "hazo_auth/pages";
106
99
 
107
- export default function Page() {
108
- return <${page.component_name} />;
109
- }
100
+ export default ${page.component_name};
110
101
  `;
111
102
  }
112
103
  // section: api_route_generation
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/cli/validate.ts"],"names":[],"mappings":"AAOA,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AA+rBF,wBAAgB,cAAc,IAAI,iBAAiB,CA2ElD"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/cli/validate.ts"],"names":[],"mappings":"AAOA,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE5C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AA2rBF,wBAAgB,cAAc,IAAI,iBAAiB,CA2ElD"}
@@ -44,9 +44,6 @@ const REQUIRED_API_ROUTES = [
44
44
  { path: "api/hazo_auth/user_management/users/roles", method: "GET" },
45
45
  { path: "api/hazo_auth/user_management/users/roles", method: "POST" },
46
46
  { path: "api/hazo_auth/user_management/users/roles", method: "PUT" },
47
- // OTP routes
48
- { path: "api/hazo_auth/otp/request", method: "POST" },
49
- { path: "api/hazo_auth/otp/verify", method: "POST" },
50
47
  ];
51
48
  // section: helpers
52
49
  function get_project_root() {
@@ -489,7 +486,6 @@ const REQUIRED_TABLES = [
489
486
  "hazo_role_permissions",
490
487
  "hazo_invitations",
491
488
  "hazo_refresh_tokens",
492
- "hazo_email_otps",
493
489
  ];
494
490
  const TEXT_ID_TABLES = [
495
491
  "hazo_users",
package/dist/client.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  export * from "./components/index.js";
2
- export { OTPRequestForm, OTPVerifyForm } from "./components/otp.js";
3
- export type { OTPRequestFormProps, OTPVerifyFormProps } from "./components/otp";
4
2
  export { cn, merge_class_names } from "./lib/utils.js";
5
3
  export * from "./lib/auth/auth_types.js";
6
4
  export { use_auth_status, trigger_auth_status_refresh } from "./components/layouts/shared/hooks/use_auth_status.js";
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAYA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAIhF,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIpD,cAAc,uBAAuB,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACnH,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAGvI,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI/E,cAAc,8CAA8C,CAAC"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAYA,cAAc,oBAAoB,CAAC;AAInC,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIpD,cAAc,uBAAuB,CAAC;AAItC,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,mDAAmD,CAAC;AACjH,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC3G,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAC7G,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AACnH,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AAGvI,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAI/E,cAAc,8CAA8C,CAAC"}
package/dist/client.js CHANGED
@@ -10,7 +10,6 @@
10
10
  // section: component_exports
11
11
  // All UI and layout components are client-safe
12
12
  export * from "./components/index.js";
13
- export { OTPRequestForm, OTPVerifyForm } from "./components/otp.js";
14
13
  // section: utility_exports
15
14
  // CSS utility functions
16
15
  export { cn, merge_class_names } from "./lib/utils.js";
@@ -10,6 +10,10 @@ export type OAuthLayoutConfig = {
10
10
  google_button_text: string;
11
11
  /** Text displayed on the divider between OAuth and email/password form */
12
12
  oauth_divider_text: string;
13
+ /** Enable Facebook OAuth login */
14
+ enable_facebook_oauth?: boolean;
15
+ /** Text displayed on the Facebook sign-in button */
16
+ facebook_button_text?: string;
13
17
  };
14
18
  export type LoginLayoutProps<TClient = unknown> = {
15
19
  /** Image source for the visual panel. Required when `layout` is `"two_column"` (the default); ignored when `"form_only"`. */
@@ -43,12 +47,6 @@ export type LoginLayoutProps<TClient = unknown> = {
43
47
  urlOnLogon?: string;
44
48
  /** OAuth configuration */
45
49
  oauth?: OAuthLayoutConfig;
46
- /** Show the OTP sign-in link below the login form (default: false) */
47
- otp_signin_enabled?: boolean;
48
- /** Label for the OTP sign-in link */
49
- otp_signin_label?: string;
50
- /** href for the OTP sign-in link */
51
- otp_signin_href?: string;
52
50
  /**
53
51
  * Layout mode (default: `"two_column"`).
54
52
  * - `"two_column"` — renders the form inside the package's TwoColumnAuthLayout
@@ -61,5 +59,5 @@ export type LoginLayoutProps<TClient = unknown> = {
61
59
  */
62
60
  layout?: "two_column" | "form_only";
63
61
  };
64
- export default function login_layout<TClient>({ image_src, image_alt, image_background_color, field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgot_password_path, forgot_password_label, create_account_path, create_account_label, show_create_account_link, urlOnLogon, oauth, otp_signin_enabled, otp_signin_label, otp_signin_href, layout, }: LoginLayoutProps<TClient>): import("react/jsx-runtime").JSX.Element;
62
+ export default function login_layout<TClient>({ image_src, image_alt, image_background_color, field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage, alreadyLoggedInMessage, showLogoutButton, showReturnHomeButton, returnHomeButtonLabel, returnHomePath, forgot_password_path, forgot_password_label, create_account_path, create_account_label, show_create_account_link, urlOnLogon, oauth, layout, }: LoginLayoutProps<TClient>): import("react/jsx-runtime").JSX.Element;
65
63
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/login/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAWlD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAW/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,OAAO,GAAG,OAAO,IAAI;IAChD,6HAA6H;IAC7H,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,0GAA0G;IAC1G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;QAChE,KAAK,EAAE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T,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAyC,EACzC,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,oBAAmD,EACnD,qBAA0C,EAC1C,mBAA2C,EAC3C,oBAAuC,EACvC,wBAA+B,EAC/B,UAAU,EACV,KAAK,EACL,kBAA0B,EAC1B,gBAA4C,EAC5C,eAAkC,EAClC,MAAqB,GACtB,EAAE,gBAAgB,CAAC,OAAO,CAAC,2CAkR3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/login/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAYlD,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EAC1B,MAAM,uCAAuC,CAAC;AAW/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,OAAO,GAAG,OAAO,IAAI;IAChD,6HAA6H;IAC7H,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,0GAA0G;IAC1G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;I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AE,iBAAiB,CAAC;IAC1B;;;;;;;;;OASG;IACH,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAUF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,EAAE,EAC5C,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,WAAW,EACX,MAAM,EACN,aAAa,EACb,cAAyC,EACzC,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,oBAAmD,EACnD,qBAA0C,EAC1C,mBAA2C,EAC3C,oBAAuC,EACvC,wBAA+B,EAC/B,UAAU,EACV,KAAK,EACL,MAAqB,GACtB,EAAE,gBAAgB,CAAC,OAAO,CAAC,2CAiR3B"}
@@ -14,6 +14,7 @@ import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout
14
14
  import { CheckCircle, AlertCircle } from "lucide-react";
15
15
  import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_guard.js";
16
16
  import { GoogleSignInButton } from "../shared/components/google_sign_in_button.js";
17
+ import { FacebookSignInButton } from "../shared/components/facebook_sign_in_button.js";
17
18
  import { OAuthDivider } from "../shared/components/oauth_divider.js";
18
19
  import { LOGIN_FIELD_IDS, createLoginFieldDefinitions, resolveLoginButtonPalette, resolveLoginLabels, } from "./config/login_field_config.js";
19
20
  import { use_login_form, } from "./hooks/use_login_form.js";
@@ -22,7 +23,7 @@ const ORDERED_FIELDS = [
22
23
  LOGIN_FIELD_IDS.PASSWORD,
23
24
  ];
24
25
  // section: component
25
- export default function login_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage = "Successfully logged in", alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", forgot_password_path = "/hazo_auth/forgot_password", forgot_password_label = "Forgot password?", create_account_path = "/hazo_auth/register", create_account_label = "Create account", show_create_account_link = true, urlOnLogon, oauth, otp_signin_enabled = false, otp_signin_label = "Sign in with email code", otp_signin_href = "/hazo_auth/otp", layout = "two_column", }) {
26
+ export default function login_layout({ image_src, image_alt, image_background_color = "#f1f5f9", field_overrides, labels, button_colors, data_client, logger, redirectRoute, successMessage = "Successfully logged in", alreadyLoggedInMessage = "You are already logged in", showLogoutButton = true, showReturnHomeButton = false, returnHomeButtonLabel = "Return home", returnHomePath = "/", forgot_password_path = "/hazo_auth/forgot_password", forgot_password_label = "Forgot password?", create_account_path = "/hazo_auth/register", create_account_label = "Create account", show_create_account_link = true, urlOnLogon, oauth, layout = "two_column", }) {
26
27
  var _a;
27
28
  // Default OAuth config: both enabled
28
29
  const oauthConfig = oauth || {
@@ -30,6 +31,8 @@ export default function login_layout({ image_src, image_alt, image_background_co
30
31
  enable_email_password: true,
31
32
  google_button_text: "Continue with Google",
32
33
  oauth_divider_text: "or continue with email",
34
+ enable_facebook_oauth: false,
35
+ facebook_button_text: "Continue with Facebook",
33
36
  };
34
37
  // Read OAuth error from URL query params (e.g., ?error=AccessDenied)
35
38
  const searchParams = useSearchParams();
@@ -95,7 +98,7 @@ export default function login_layout({ image_src, image_alt, image_background_co
95
98
  // into TwoColumnAuthLayout's `formContent`; in "form_only" mode it's returned
96
99
  // as the entire output for the consumer to compose into their own chrome.
97
100
  const successContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), _jsxs("div", { className: "cls_login_layout_success flex flex-col items-center justify-center gap-4 p-8 text-center", children: [_jsx(CheckCircle, { className: "cls_login_layout_success_icon h-16 w-16 text-green-600", "aria-hidden": "true" }), _jsx("p", { className: "cls_login_layout_success_message text-lg font-medium text-slate-900", children: successMessage })] })] }));
98
- const mainContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), oauthError && (_jsxs("div", { className: "cls_login_layout_oauth_error flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700", children: [_jsx(AlertCircle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: getOAuthErrorMessage(oauthError) })] })), oauthConfig.enable_google && (_jsx("div", { className: "cls_login_layout_oauth_section", children: _jsx(GoogleSignInButton, { label: oauthConfig.google_button_text, callbackUrl: oauthCallbackUrl }) })), oauthConfig.enable_google && oauthConfig.enable_email_password && (_jsx(OAuthDivider, { text: oauthConfig.oauth_divider_text })), oauthConfig.enable_email_password && (_jsxs("form", { className: "cls_login_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": "Login form", children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: "Submit login form", cancelAriaLabel: "Cancel login form" }), ((forgot_password_path && forgot_password_label) || (show_create_account_link && create_account_path && create_account_label)) && (_jsxs("div", { className: "cls_login_layout_support_links flex flex-col gap-1 text-sm text-muted-foreground", children: [forgot_password_path && forgot_password_label && (_jsx(Link, { href: forgot_password_path, className: "cls_login_layout_forgot_password_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to forgot password page", children: forgot_password_label })), show_create_account_link && create_account_path && create_account_label && (_jsx(Link, { href: create_account_path, className: "cls_login_layout_create_account_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to create account page", children: create_account_label }))] }))] })), show_create_account_link && create_account_path && create_account_label && !oauthConfig.enable_email_password && oauthConfig.enable_google && (_jsx("div", { className: "cls_login_layout_support_links mt-4 text-center text-sm text-muted-foreground", children: _jsx(Link, { href: create_account_path, className: "cls_login_layout_create_account_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to create account page", children: create_account_label }) })), otp_signin_enabled && otp_signin_href && (_jsx("div", { className: "cls_login_layout_otp_link mt-4 text-center text-sm", children: _jsx("a", { href: otp_signin_href, className: "underline text-muted-foreground hover:text-foreground", "aria-label": "Sign in with email code", children: otp_signin_label !== null && otp_signin_label !== void 0 ? otp_signin_label : "Sign in with email code" }) }))] }));
101
+ const mainContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), oauthError && (_jsxs("div", { className: "cls_login_layout_oauth_error flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700", children: [_jsx(AlertCircle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: getOAuthErrorMessage(oauthError) })] })), oauthConfig.enable_google && (_jsx("div", { className: "cls_login_layout_oauth_section", children: _jsx(GoogleSignInButton, { label: oauthConfig.google_button_text, callbackUrl: oauthCallbackUrl }) })), oauthConfig.enable_facebook_oauth && (_jsx("div", { className: "cls_login_layout_facebook_section", children: _jsx(FacebookSignInButton, { label: oauthConfig.facebook_button_text || "Continue with Facebook", callbackUrl: "/api/hazo_auth/oauth/facebook/callback" }) })), (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && oauthConfig.enable_email_password && (_jsx(OAuthDivider, { text: oauthConfig.oauth_divider_text })), oauthConfig.enable_email_password && (_jsxs("form", { className: "cls_login_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": "Login form", children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: "Submit login form", cancelAriaLabel: "Cancel login form" }), ((forgot_password_path && forgot_password_label) || (show_create_account_link && create_account_path && create_account_label)) && (_jsxs("div", { className: "cls_login_layout_support_links flex flex-col gap-1 text-sm text-muted-foreground", children: [forgot_password_path && forgot_password_label && (_jsx(Link, { href: forgot_password_path, className: "cls_login_layout_forgot_password_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to forgot password page", children: forgot_password_label })), show_create_account_link && create_account_path && create_account_label && (_jsx(Link, { href: create_account_path, className: "cls_login_layout_create_account_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to create account page", children: create_account_label }))] }))] })), show_create_account_link && create_account_path && create_account_label && !oauthConfig.enable_email_password && (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && (_jsx("div", { className: "cls_login_layout_support_links mt-4 text-center text-sm text-muted-foreground", children: _jsx(Link, { href: create_account_path, className: "cls_login_layout_create_account_link text-primary underline-offset-4 hover:underline", "aria-label": "Go to create account page", children: create_account_label }) }))] }));
99
102
  // Form-only mode: return the content directly. Consumer is expected to wrap
100
103
  // it in their own page/brand chrome. We deliberately skip AlreadyLoggedInGuard
101
104
  // here — its 2-col fallback would defeat the purpose of form_only. Consumer
@@ -1,10 +1,21 @@
1
1
  import * as React from "react";
2
+ import type { HazoAuthTheme } from "../../../theme/theme_types";
2
3
  export interface OTPLayoutProps {
3
4
  /** URL to redirect to after successful sign-in. Defaults to "/" */
4
5
  redirect_url?: string;
5
6
  /** Page heading. Defaults to "Sign in with email code" */
6
7
  title?: string;
8
+ /** Page subtitle shown below the heading. */
9
+ subtitle?: string;
10
+ /** Submit button label for the OTP verification step (default: "Verify") */
11
+ ctaText?: string;
12
+ /** Theme that controls visual appearance and layout mode. */
13
+ theme?: HazoAuthTheme;
14
+ /** URL of the visual panel image. Defaults to the package default login image. */
15
+ image_src?: string;
16
+ /** Alt text for the visual panel image. */
17
+ image_alt?: string;
7
18
  }
8
- export declare function OTPLayout({ redirect_url, title, }: OTPLayoutProps): React.ReactElement;
19
+ export declare function OTPLayout({ redirect_url, title, subtitle, ctaText, theme, image_src, image_alt, }: OTPLayoutProps): React.ReactElement;
9
20
  export default OTPLayout;
10
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/otp/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAGD,wBAAgB,SAAS,CAAC,EACxB,YAAkB,EAClB,KAAiC,GAClC,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAgBrC;AAED,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/otp/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAGhE,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,kFAAkF;IAClF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAGD,wBAAgB,SAAS,CAAC,EACxB,YAAkB,EAClB,KAAiC,EACjC,QAAQ,EACR,OAAO,EACP,KAAK,EACL,SAAiD,EACjD,SAA0C,GAC3C,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CA4BrC;AAED,eAAe,SAAS,CAAC"}
@@ -6,9 +6,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  import * as React from "react";
7
7
  import { OTPRequestForm } from "../../otp/OTPRequestForm.js";
8
8
  import { OTPVerifyForm } from "../../otp/OTPVerifyForm.js";
9
+ import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout.js";
9
10
  // section: component
10
- export function OTPLayout({ redirect_url = "/", title = "Sign in with email code", }) {
11
+ export function OTPLayout({ redirect_url = "/", title = "Sign in with email code", subtitle, ctaText, theme, image_src = "/hazo_auth/images/login_default.jpg", image_alt = "Sign in with a one-time code", }) {
11
12
  const [sent_to, set_sent_to] = React.useState(null);
12
- return (_jsxs("div", { className: "mx-auto w-full max-w-sm py-12", children: [_jsx("h1", { className: "text-2xl font-semibold mb-6", children: title }), sent_to ? (_jsx(OTPVerifyForm, { email: sent_to, redirect_url: redirect_url })) : (_jsx(OTPRequestForm, { on_sent: (email) => set_sent_to(email) }))] }));
13
+ const formContent = (_jsxs("div", { className: "mx-auto w-full max-w-sm py-12", children: [_jsx("h1", { className: `text-2xl font-semibold ${subtitle ? "mb-2" : "mb-6"}`, children: title }), subtitle && (_jsx("p", { className: "text-sm text-muted-foreground mb-6", children: subtitle })), sent_to ? (_jsx(OTPVerifyForm, { email: sent_to, redirect_url: redirect_url, submit_label: ctaText })) : (_jsx(OTPRequestForm, { on_sent: (email) => set_sent_to(email) }))] }));
14
+ return (_jsx(TwoColumnAuthLayout, { imageSrc: image_src, imageAlt: image_alt, formContent: formContent }));
13
15
  }
14
16
  export default OTPLayout;
@@ -10,6 +10,10 @@ export type OAuthLayoutConfig = {
10
10
  google_button_text: string;
11
11
  /** Text displayed on the divider between OAuth and email/password form */
12
12
  oauth_divider_text: string;
13
+ /** Enable Facebook OAuth login */
14
+ enable_facebook_oauth?: boolean;
15
+ /** Text displayed on the Facebook sign-in button */
16
+ facebook_button_text?: string;
13
17
  };
14
18
  export type RegisterLayoutProps<TClient = unknown> = {
15
19
  /** Image source for the visual panel. Required when `layout` is `"two_column"` (the default); ignored when `"form_only"`. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/register/index.tsx"],"names":[],"mappings":"AAiBA,OAAO,EACL,KAAK,sBAA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K,CAAC,EAAE,iBAAiB,CAAC;IAC1B,qGAAqG;IACrG,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAYF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,EAC/C,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,eAAsB,EACtB,WAAW,EACX,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,UAA+B,EAC/B,WAAuB,EACvB,UAAU,EACV,KAAK,EACL,MAAqB,GACtB,EAAE,mBAAmB,CAAC,OAAO,CAAC,2CAqO9B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/register/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAY/C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC;IAChC,aAAa,EAAE,OAAO,CAAC;IACvB,8CAA8C;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kDAAkD;IAClD,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0EAA0E;IAC1E,kBAAkB,EAAE,MAAM,CAAC;IAC3B,kCAAkC;IAClC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oDAAoD;IACpD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,mBAAmB,CAAC,OAAO,GAAG,OAAO,IAAI;IACnD,6HAA6H;IAC7H,SAAS,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;IACrC,0GAA0G;IAC1G,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,qBAAqB,CAAC,EAAE,4BAA4B,CAAC;IACrD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACvC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,qGAAqG;IACrG,MAAM,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;CACrC,CAAC;AAYF,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,OAAO,EAAE,EAC/C,SAAS,EACT,SAAS,EACT,sBAAkC,EAClC,eAAe,EACf,MAAM,EACN,aAAa,EACb,qBAAqB,EACrB,eAAsB,EACtB,WAAW,EACX,sBAAoD,EACpD,gBAAuB,EACvB,oBAA4B,EAC5B,qBAAqC,EACrC,cAAoB,EACpB,UAA+B,EAC/B,WAAuB,EACvB,UAAU,EACV,KAAK,EACL,MAAqB,GACtB,EAAE,mBAAmB,CAAC,OAAO,CAAC,2CAiP9B"}
@@ -13,6 +13,7 @@ import { FormActionButtons } from "../shared/components/form_action_buttons.js";
13
13
  import { TwoColumnAuthLayout } from "../shared/components/two_column_auth_layout.js";
14
14
  import { AlreadyLoggedInGuard } from "../shared/components/already_logged_in_guard.js";
15
15
  import { GoogleSignInButton } from "../shared/components/google_sign_in_button.js";
16
+ import { FacebookSignInButton } from "../shared/components/facebook_sign_in_button.js";
16
17
  import { OAuthDivider } from "../shared/components/oauth_divider.js";
17
18
  import { AlertCircle } from "lucide-react";
18
19
  import { REGISTER_FIELD_IDS, createRegisterFieldDefinitions, resolveRegisterButtonPalette, resolveRegisterLabels, resolveRegisterPasswordRequirements, } from "./config/register_field_config.js";
@@ -32,6 +33,8 @@ export default function register_layout({ image_src, image_alt, image_background
32
33
  enable_email_password: true,
33
34
  google_button_text: "Sign up with Google",
34
35
  oauth_divider_text: "or continue with email",
36
+ enable_facebook_oauth: false,
37
+ facebook_button_text: "Continue with Facebook",
35
38
  };
36
39
  // Read OAuth error from URL query params (e.g., ?error=AccessDenied)
37
40
  const searchParams = useSearchParams();
@@ -95,7 +98,7 @@ export default function register_layout({ image_src, image_alt, image_background
95
98
  // Form content — used in both layout modes. See `login_layout` for the
96
99
  // rationale: keeps the form independent of TwoColumnAuthLayout / AuthPageShell
97
100
  // so consumers can compose it into their own brand chrome.
98
- const mainContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), oauthError && (_jsxs("div", { className: "cls_register_layout_oauth_error flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700", children: [_jsx(AlertCircle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: getOAuthErrorMessage(oauthError) })] })), oauthConfig.enable_google && (_jsx("div", { className: "cls_register_layout_oauth_section", children: _jsx(GoogleSignInButton, { label: oauthConfig.google_button_text, callbackUrl: oauthCallbackUrl }) })), oauthConfig.enable_google && oauthConfig.enable_email_password && (_jsx(OAuthDivider, { text: oauthConfig.oauth_divider_text })), oauthConfig.enable_email_password && (_jsxs("form", { className: "cls_register_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": "Registration form", children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: "Submit registration form", cancelAriaLabel: "Cancel registration form" }), _jsxs("div", { className: "cls_register_layout_sign_in_link flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: "Already have an account?" }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": "Go to sign in page", children: signInLabel })] }), form.isSubmitting && (_jsx("div", { className: "cls_register_submitting_indicator text-sm text-slate-600 text-center", children: "Registering..." }))] })), !oauthConfig.enable_email_password && oauthConfig.enable_google && (_jsxs("div", { className: "cls_register_layout_sign_in_link mt-4 flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: "Already have an account?" }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": "Go to sign in page", children: signInLabel })] }))] }));
101
+ const mainContent = (_jsxs(_Fragment, { children: [_jsx(FormHeader, { heading: resolvedLabels.heading, subHeading: resolvedLabels.subHeading }), oauthError && (_jsxs("div", { className: "cls_register_layout_oauth_error flex items-center gap-2 rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700", children: [_jsx(AlertCircle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }), _jsx("span", { children: getOAuthErrorMessage(oauthError) })] })), oauthConfig.enable_google && (_jsx("div", { className: "cls_register_layout_oauth_section", children: _jsx(GoogleSignInButton, { label: oauthConfig.google_button_text, callbackUrl: oauthCallbackUrl }) })), oauthConfig.enable_facebook_oauth && (_jsx("div", { className: "cls_register_layout_facebook_section", children: _jsx(FacebookSignInButton, { label: oauthConfig.facebook_button_text || "Continue with Facebook", callbackUrl: "/api/hazo_auth/oauth/facebook/callback" }) })), (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && oauthConfig.enable_email_password && (_jsx(OAuthDivider, { text: oauthConfig.oauth_divider_text })), oauthConfig.enable_email_password && (_jsxs("form", { className: "cls_register_layout_form_fields flex flex-col gap-5", onSubmit: form.handleSubmit, "aria-label": "Registration form", children: [renderFields(form), _jsx(FormActionButtons, { submitLabel: resolvedLabels.submitButton, cancelLabel: resolvedLabels.cancelButton, buttonPalette: resolvedButtonPalette, isSubmitDisabled: form.isSubmitDisabled, onCancel: form.handleCancel, submitAriaLabel: "Submit registration form", cancelAriaLabel: "Cancel registration form" }), _jsxs("div", { className: "cls_register_layout_sign_in_link flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: "Already have an account?" }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": "Go to sign in page", children: signInLabel })] }), form.isSubmitting && (_jsx("div", { className: "cls_register_submitting_indicator text-sm text-slate-600 text-center", children: "Registering..." }))] })), !oauthConfig.enable_email_password && (oauthConfig.enable_google || oauthConfig.enable_facebook_oauth) && (_jsxs("div", { className: "cls_register_layout_sign_in_link mt-4 flex items-center justify-center gap-1 text-sm text-muted-foreground", children: [_jsx("span", { children: "Already have an account?" }), _jsx(Link, { href: signInPath, className: "cls_register_layout_sign_in_link_text text-primary underline-offset-4 hover:underline", "aria-label": "Go to sign in page", children: signInLabel })] }))] }));
99
102
  // form_only mode: emit just the form content. See login_layout for the
100
103
  // rationale; AlreadyLoggedInGuard is intentionally skipped here.
101
104
  if (layout === "form_only") {
@@ -0,0 +1,21 @@
1
+ export type FacebookSignInButtonProps = {
2
+ /** Text displayed on the button */
3
+ label?: string;
4
+ /** Custom click handler - if not provided, redirects to Facebook OAuth */
5
+ onClick?: () => void;
6
+ /** Disable the button */
7
+ disabled?: boolean;
8
+ /** Additional CSS classes */
9
+ className?: string;
10
+ /** Callback URL after OAuth (default: /api/hazo_auth/oauth/facebook/callback) */
11
+ callbackUrl?: string;
12
+ };
13
+ /**
14
+ * Facebook Sign-In button component
15
+ * Displays the Facebook logo with configurable text
16
+ * Initiates the Facebook OAuth flow when clicked
17
+ * Uses next-auth/react signIn function for proper OAuth flow
18
+ */
19
+ export declare function FacebookSignInButton({ label, onClick, disabled, className, callbackUrl, }: FacebookSignInButtonProps): import("react/jsx-runtime").JSX.Element;
20
+ export default FacebookSignInButton;
21
+ //# sourceMappingURL=facebook_sign_in_button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"facebook_sign_in_button.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/facebook_sign_in_button.tsx"],"names":[],"mappings":"AAqBA,MAAM,MAAM,yBAAyB,GAAG;IACtC,mCAAmC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,EACnC,KAAgC,EAChC,OAAO,EACP,QAAgB,EAChB,SAAS,EACT,WAAsD,GACvD,EAAE,yBAAyB,2CA6C3B;AAED,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,47 @@
1
+ // file_description: Facebook Sign-In button component
2
+ // section: client_directive
3
+ "use client";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ // section: imports
6
+ import { Button } from "../../../ui/button.js";
7
+ import { cn } from "../../../../lib/utils.js";
8
+ import { useState } from "react";
9
+ import { Loader2 } from "lucide-react";
10
+ import { signIn } from "next-auth/react";
11
+ // Facebook "f" icon as inline SVG (no external dep)
12
+ function FacebookIcon({ className }) {
13
+ return (_jsx("svg", { className: cn("h-5 w-5", className), viewBox: "0 0 24 24", fill: "#1877F2", "aria-hidden": "true", children: _jsx("path", { d: "M24 12.073C24 5.404 18.627 0 12 0S0 5.404 0 12.073C0 18.1 4.388 23.094 10.125 24v-8.437H7.078v-3.49h3.047V9.413c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.49h-2.796V24C19.612 23.094 24 18.1 24 12.073z" }) }));
14
+ }
15
+ // section: component
16
+ /**
17
+ * Facebook Sign-In button component
18
+ * Displays the Facebook logo with configurable text
19
+ * Initiates the Facebook OAuth flow when clicked
20
+ * Uses next-auth/react signIn function for proper OAuth flow
21
+ */
22
+ export function FacebookSignInButton({ label = "Continue with Facebook", onClick, disabled = false, className, callbackUrl = "/api/hazo_auth/oauth/facebook/callback", }) {
23
+ const [isLoading, setIsLoading] = useState(false);
24
+ const handleClick = async () => {
25
+ if (disabled || isLoading)
26
+ return;
27
+ if (onClick) {
28
+ onClick();
29
+ }
30
+ else {
31
+ setIsLoading(true);
32
+ try {
33
+ await signIn("facebook", {
34
+ callbackUrl,
35
+ redirect: true,
36
+ });
37
+ // Note: redirect: true means this code won't execute after success
38
+ // as the browser will be redirected
39
+ }
40
+ catch (_a) {
41
+ setIsLoading(false);
42
+ }
43
+ }
44
+ };
45
+ return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, disabled: disabled || isLoading, className: cn("cls_facebook_sign_in_button w-full flex items-center justify-center gap-3 h-11 border-slate-300 hover:bg-slate-50 hover:border-slate-400 transition-colors", className), "aria-label": label, children: [isLoading ? (_jsx(Loader2, { className: "h-5 w-5 animate-spin text-slate-600", "aria-hidden": "true" })) : (_jsx(FacebookIcon, { className: "h-5 w-5" })), _jsx("span", { className: "text-slate-700 font-medium", children: isLoading ? "Signing in..." : label })] }));
46
+ }
47
+ export default FacebookSignInButton;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar_layout_wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/components/layouts/shared/components/sidebar_layout_wrapper.tsx"],"names":[],"mappings":"AA6BA,KAAK,yBAAyB,GAAG;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAGF,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,2CA+S3E"}
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,2CA+Q3E"}
@@ -4,17 +4,12 @@
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  // section: imports
6
6
  import Link from "next/link";
7
- import { usePathname } from "next/navigation";
8
- import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarTrigger, SidebarInset, } from "../../../ui/sidebar.js";
9
- import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@radix-ui/react-collapsible";
10
- import { LogIn, UserPlus, BookOpen, ExternalLink, Database, KeyRound, MailCheck, Key, User, ShieldCheck, CircleUserRound, FileJson, Building2, Palette, Settings2, Play, ChevronDown, LayoutGrid } from "lucide-react";
7
+ import { Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarHeader, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarProvider, SidebarTrigger, SidebarInset, } from "../../../ui/sidebar.js";
8
+ import { LogIn, UserPlus, BookOpen, ExternalLink, Database, KeyRound, MailCheck, Key, User, ShieldCheck, CircleUserRound, FileJson, Building2, Palette, Settings2, Play } from "lucide-react";
11
9
  import { use_auth_status } from "../hooks/use_auth_status.js";
12
10
  import { ProfilePicMenu } from "./profile_pic_menu.js";
13
11
  // section: component
14
12
  export function SidebarLayoutWrapper({ children }) {
15
13
  const authStatus = use_auth_status();
16
- const pathname = usePathname();
17
- const login_paths = ["/hazo_auth/login", "/hazo_auth/login_variations"];
18
- const login_submenu_open = login_paths.some((p) => pathname === null || pathname === void 0 ? void 0 : pathname.startsWith(p));
19
- 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_login_group_item", children: _jsxs(Collapsible, { defaultOpen: login_submenu_open, className: "group/login-collapsible w-full", children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { className: "cls_sidebar_layout_login_trigger flex items-center gap-2 w-full", "aria-label": "Toggle login submenu", children: [_jsx(LogIn, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Login" }), _jsx(ChevronDown, { className: "ml-auto h-4 w-4 transition-transform duration-200 group-data-[state=open]/login-collapsible:rotate-180", "aria-hidden": "true" })] }) }), _jsx(CollapsibleContent, { children: _jsxs(SidebarMenuSub, { className: "cls_sidebar_layout_login_submenu", children: [_jsx(SidebarMenuSubItem, { className: "cls_sidebar_layout_login_test_item", children: _jsx(SidebarMenuSubButton, { asChild: true, children: _jsx(Link, { href: "/hazo_auth/login", className: "cls_sidebar_layout_login_test_link flex items-center gap-2", "aria-label": "Test login layout component", children: _jsx("span", { children: "Test login" }) }) }) }), _jsx(SidebarMenuSubItem, { className: "cls_sidebar_layout_login_variations_item", children: _jsx(SidebarMenuSubButton, { asChild: true, children: _jsxs(Link, { href: "/hazo_auth/login_variations", className: "cls_sidebar_layout_login_variations_link flex items-center gap-2", "aria-label": "View login page variations", children: [_jsx(LayoutGrid, { className: "h-3.5 w-3.5", "aria-hidden": "true" }), _jsx("span", { children: "Variations" })] }) }) })] }) })] }) }), _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_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/auto_test", className: "cls_sidebar_layout_auto_test_runner_link flex items-center gap-2", "aria-label": "Run automated tests", children: [_jsx(Play, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Auto Test Runner" })] }) }) }) })] }), _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 })] })] }) }));
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_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/auto_test", className: "cls_sidebar_layout_auto_test_runner_link flex items-center gap-2", "aria-label": "Run automated tests", children: [_jsx(Play, { className: "h-4 w-4", "aria-hidden": "true" }), _jsx("span", { children: "Auto Test Runner" })] }) }) }) })] }), _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 })] })] }) }));
20
15
  }
@@ -19,6 +19,8 @@ export { VisualPanel } from "./components/visual_panel.js";
19
19
  export { GoogleIcon } from "./components/google_icon.js";
20
20
  export { GoogleSignInButton } from "./components/google_sign_in_button.js";
21
21
  export type { GoogleSignInButtonProps } from "./components/google_sign_in_button";
22
+ export { FacebookSignInButton } from "./components/facebook_sign_in_button.js";
23
+ export type { FacebookSignInButtonProps } from "./components/facebook_sign_in_button";
22
24
  export { OAuthDivider } from "./components/oauth_divider.js";
23
25
  export type { OAuthDividerProps } from "./components/oauth_divider";
24
26
  export { use_auth_status } from "./hooks/use_auth_status.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/shared/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,YAAY,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AACjF,O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,MAAM,2BAA2B,CAAC;AACnE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGlE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,cAAc,oBAAoB,CAAC"}
@@ -20,6 +20,7 @@ export { UnauthorizedGuard } from "./components/unauthorized_guard.js";
20
20
  export { VisualPanel } from "./components/visual_panel.js";
21
21
  export { GoogleIcon } from "./components/google_icon.js";
22
22
  export { GoogleSignInButton } from "./components/google_sign_in_button.js";
23
+ export { FacebookSignInButton } from "./components/facebook_sign_in_button.js";
23
24
  export { OAuthDivider } from "./components/oauth_divider.js";
24
25
  // section: hook_exports
25
26
  export { use_auth_status } from "./hooks/use_auth_status.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/user_management/index.tsx"],"names":[],"mappings":"AAyDA,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;CACvC,CAAC;AAuJF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,YAAoB,EAAE,gBAAwB,EAAE,kBAAuB,EAAE,EAAE,yBAAyB,2CA63CrJ"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layouts/user_management/index.tsx"],"names":[],"mappings":"AAyDA,4CAA4C;AAC5C,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,cAAc,EAAE,CAAC;CACvC,CAAC;AAuJF;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAAC,EAAE,SAAS,EAAE,YAAoB,EAAE,gBAAwB,EAAE,kBAAuB,EAAE,EAAE,yBAAyB,2CAo9CrJ"}