@vertesia/ui 1.5.0 → 1.6.0-dev.20260918.061604Z

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 (336) hide show
  1. package/README.md +125 -0
  2. package/lib/boot/branding.d.ts +58 -0
  3. package/lib/boot/branding.d.ts.map +1 -0
  4. package/lib/boot/branding.js +62 -0
  5. package/lib/boot/branding.js.map +1 -0
  6. package/lib/boot/index.d.ts +27 -0
  7. package/lib/boot/index.d.ts.map +1 -0
  8. package/lib/boot/index.js +325 -0
  9. package/lib/boot/index.js.map +1 -0
  10. package/lib/boot/vite.d.ts +63 -0
  11. package/lib/boot/vite.d.ts.map +1 -0
  12. package/lib/boot/vite.js +108 -0
  13. package/lib/boot/vite.js.map +1 -0
  14. package/lib/core/components/shadcn/button.d.ts.map +1 -1
  15. package/lib/core/components/shadcn/button.js +1 -2
  16. package/lib/core/components/shadcn/button.js.map +1 -1
  17. package/lib/core/components/shadcn/filters/filter-styles.d.ts +1 -1
  18. package/lib/core/components/shadcn/filters/filter-styles.d.ts.map +1 -1
  19. package/lib/core/components/shadcn/filters/filter-styles.js +4 -4
  20. package/lib/core/components/shadcn/label.js +1 -1
  21. package/lib/core/components/shadcn/label.js.map +1 -1
  22. package/lib/env/index.d.ts +32 -1
  23. package/lib/env/index.d.ts.map +1 -1
  24. package/lib/env/index.js +55 -3
  25. package/lib/env/index.js.map +1 -1
  26. package/lib/features/agent/PayloadBuilder.d.ts +4 -0
  27. package/lib/features/agent/PayloadBuilder.d.ts.map +1 -1
  28. package/lib/features/agent/PayloadBuilder.js +6 -1
  29. package/lib/features/agent/PayloadBuilder.js.map +1 -1
  30. package/lib/features/agent/chat/AgentRunFeedback.d.ts +66 -0
  31. package/lib/features/agent/chat/AgentRunFeedback.d.ts.map +1 -0
  32. package/lib/features/agent/chat/AgentRunFeedback.js +298 -0
  33. package/lib/features/agent/chat/AgentRunFeedback.js.map +1 -0
  34. package/lib/features/agent/chat/ModernAgentConversation.d.ts.map +1 -1
  35. package/lib/features/agent/chat/ModernAgentConversation.js +7 -5
  36. package/lib/features/agent/chat/ModernAgentConversation.js.map +1 -1
  37. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts +3 -1
  38. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.d.ts.map +1 -1
  39. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +11 -10
  40. package/lib/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  41. package/lib/features/agent/chat/ModernAgentOutput/Header.d.ts.map +1 -1
  42. package/lib/features/agent/chat/ModernAgentOutput/Header.js.map +1 -1
  43. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts +3 -1
  44. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.d.ts.map +1 -1
  45. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js +28 -7
  46. package/lib/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  47. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.d.ts.map +1 -1
  48. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js +2 -0
  49. package/lib/features/agent/chat/ModernAgentOutput/SummaryConversation.js.map +1 -1
  50. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts +1 -1
  51. package/lib/features/agent/chat/hooks/useAgentPlans.d.ts.map +1 -1
  52. package/lib/features/agent/chat/hooks/useAgentPlans.js +5 -5
  53. package/lib/features/agent/chat/hooks/useAgentPlans.js.map +1 -1
  54. package/lib/features/agent/chat/index.d.ts +1 -0
  55. package/lib/features/agent/chat/index.d.ts.map +1 -1
  56. package/lib/features/agent/chat/index.js +1 -0
  57. package/lib/features/agent/chat/index.js.map +1 -1
  58. package/lib/features/facets/AgentRunnerFacetsNav.d.ts +8 -0
  59. package/lib/features/facets/AgentRunnerFacetsNav.d.ts.map +1 -1
  60. package/lib/features/facets/AgentRunnerFacetsNav.js +12 -0
  61. package/lib/features/facets/AgentRunnerFacetsNav.js.map +1 -1
  62. package/lib/features/permissions/UserPermissionsProvider.d.ts +15 -1
  63. package/lib/features/permissions/UserPermissionsProvider.d.ts.map +1 -1
  64. package/lib/features/permissions/UserPermissionsProvider.js +20 -12
  65. package/lib/features/permissions/UserPermissionsProvider.js.map +1 -1
  66. package/lib/features/store/objects/search/DocumentSearchContext.d.ts.map +1 -1
  67. package/lib/features/store/objects/search/DocumentSearchContext.js +6 -1
  68. package/lib/features/store/objects/search/DocumentSearchContext.js.map +1 -1
  69. package/lib/features/store/objects/selection/SelectionActions.js +1 -1
  70. package/lib/features/store/objects/selection/SelectionActions.js.map +1 -1
  71. package/lib/features/store/types/TypeRegistry.d.ts +130 -0
  72. package/lib/features/store/types/TypeRegistry.d.ts.map +1 -1
  73. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts +130 -0
  74. package/lib/features/store/types/search/ObjectTypeSearchContext.d.ts.map +1 -1
  75. package/lib/i18n/index.d.ts +5 -4
  76. package/lib/i18n/index.d.ts.map +1 -1
  77. package/lib/i18n/index.js +16 -2
  78. package/lib/i18n/index.js.map +1 -1
  79. package/lib/i18n/locales/ar.json +30 -0
  80. package/lib/i18n/locales/de.json +30 -0
  81. package/lib/i18n/locales/en.json +30 -0
  82. package/lib/i18n/locales/es.json +30 -0
  83. package/lib/i18n/locales/fr.json +30 -0
  84. package/lib/i18n/locales/it.json +30 -0
  85. package/lib/i18n/locales/ja.json +30 -0
  86. package/lib/i18n/locales/ko.json +30 -0
  87. package/lib/i18n/locales/pt.json +30 -0
  88. package/lib/i18n/locales/ru.json +30 -0
  89. package/lib/i18n/locales/tr.json +30 -0
  90. package/lib/i18n/locales/zh-TW.json +30 -0
  91. package/lib/i18n/locales/zh.json +30 -0
  92. package/lib/layout/ErrorPage.js +1 -1
  93. package/lib/layout/ErrorPage.js.map +1 -1
  94. package/lib/layout/Navbar.d.ts.map +1 -1
  95. package/lib/layout/Navbar.js +3 -2
  96. package/lib/layout/Navbar.js.map +1 -1
  97. package/lib/session/UserSession.d.ts.map +1 -1
  98. package/lib/session/UserSession.js +2 -3
  99. package/lib/session/UserSession.js.map +1 -1
  100. package/lib/session/UserSessionProvider.d.ts +2 -1
  101. package/lib/session/UserSessionProvider.d.ts.map +1 -1
  102. package/lib/session/UserSessionProvider.js +13 -4
  103. package/lib/session/UserSessionProvider.js.map +1 -1
  104. package/lib/session/auth/composable.d.ts.map +1 -1
  105. package/lib/session/auth/composable.js +88 -3
  106. package/lib/session/auth/composable.js.map +1 -1
  107. package/lib/session/auth/domainRouting.d.ts +22 -12
  108. package/lib/session/auth/domainRouting.d.ts.map +1 -1
  109. package/lib/session/auth/domainRouting.js +35 -21
  110. package/lib/session/auth/domainRouting.js.map +1 -1
  111. package/lib/session/auth/firebase.d.ts.map +1 -1
  112. package/lib/session/auth/firebase.js +10 -0
  113. package/lib/session/auth/firebase.js.map +1 -1
  114. package/lib/session/auth/useAuthState.d.ts +9 -4
  115. package/lib/session/auth/useAuthState.d.ts.map +1 -1
  116. package/lib/session/auth/useAuthState.js +9 -4
  117. package/lib/session/auth/useAuthState.js.map +1 -1
  118. package/lib/session/index.d.ts.map +1 -1
  119. package/lib/session/index.js +3 -1
  120. package/lib/session/index.js.map +1 -1
  121. package/lib/shell/AuthScreenPreview.d.ts +12 -0
  122. package/lib/shell/AuthScreenPreview.d.ts.map +1 -0
  123. package/lib/shell/AuthScreenPreview.js +140 -0
  124. package/lib/shell/AuthScreenPreview.js.map +1 -0
  125. package/lib/shell/BrandedAuthScreens.d.ts +19 -0
  126. package/lib/shell/BrandedAuthScreens.d.ts.map +1 -0
  127. package/lib/shell/BrandedAuthScreens.js +64 -0
  128. package/lib/shell/BrandedAuthScreens.js.map +1 -0
  129. package/lib/shell/SplashScreen.d.ts +13 -2
  130. package/lib/shell/SplashScreen.d.ts.map +1 -1
  131. package/lib/shell/SplashScreen.js +20 -19
  132. package/lib/shell/SplashScreen.js.map +1 -1
  133. package/lib/shell/VertesiaShell.d.ts +15 -4
  134. package/lib/shell/VertesiaShell.d.ts.map +1 -1
  135. package/lib/shell/VertesiaShell.js +8 -3
  136. package/lib/shell/VertesiaShell.js.map +1 -1
  137. package/lib/shell/apps/StandaloneApp.js +5 -1
  138. package/lib/shell/apps/StandaloneApp.js.map +1 -1
  139. package/lib/shell/index.d.ts +6 -0
  140. package/lib/shell/index.d.ts.map +1 -1
  141. package/lib/shell/index.js +5 -0
  142. package/lib/shell/index.js.map +1 -1
  143. package/lib/shell/login/SignInAuthPending.js +1 -1
  144. package/lib/shell/login/SignInAuthPending.js.map +1 -1
  145. package/lib/shell/login/SignInEmailStep.d.ts.map +1 -1
  146. package/lib/shell/login/SignInEmailStep.js +2 -2
  147. package/lib/shell/login/SignInEmailStep.js.map +1 -1
  148. package/lib/shell/login/SignInFlow.d.ts +68 -0
  149. package/lib/shell/login/SignInFlow.d.ts.map +1 -0
  150. package/lib/shell/login/SignInFlow.js +108 -0
  151. package/lib/shell/login/SignInFlow.js.map +1 -0
  152. package/lib/shell/login/SignInIcons.d.ts +1 -1
  153. package/lib/shell/login/SignInIcons.d.ts.map +1 -1
  154. package/lib/shell/login/SignInPageShell.d.ts +13 -0
  155. package/lib/shell/login/SignInPageShell.d.ts.map +1 -0
  156. package/lib/shell/login/SignInPageShell.js +14 -0
  157. package/lib/shell/login/SignInPageShell.js.map +1 -0
  158. package/lib/shell/login/SignInPrimitives.d.ts +3 -3
  159. package/lib/shell/login/SignInPrimitives.d.ts.map +1 -1
  160. package/lib/shell/login/SignInPrimitives.js +13 -11
  161. package/lib/shell/login/SignInPrimitives.js.map +1 -1
  162. package/lib/shell/login/SignInRestrictedEnvStep.d.ts +5 -0
  163. package/lib/shell/login/SignInRestrictedEnvStep.d.ts.map +1 -1
  164. package/lib/shell/login/SignInRestrictedEnvStep.js +8 -4
  165. package/lib/shell/login/SignInRestrictedEnvStep.js.map +1 -1
  166. package/lib/shell/login/SigninScreen.d.ts +38 -3
  167. package/lib/shell/login/SigninScreen.d.ts.map +1 -1
  168. package/lib/shell/login/SigninScreen.js +33 -86
  169. package/lib/shell/login/SigninScreen.js.map +1 -1
  170. package/lib/shell/login/SignupForm.d.ts +3 -1
  171. package/lib/shell/login/SignupForm.d.ts.map +1 -1
  172. package/lib/shell/login/SignupForm.js +7 -3
  173. package/lib/shell/login/SignupForm.js.map +1 -1
  174. package/lib/shell/login/signInUtils.d.ts +12 -1
  175. package/lib/shell/login/signInUtils.d.ts.map +1 -1
  176. package/lib/shell/login/signInUtils.js +34 -11
  177. package/lib/shell/login/signInUtils.js.map +1 -1
  178. package/lib/vertesia-ui-boot.js +237 -0
  179. package/lib/vertesia-ui-boot.js.map +1 -0
  180. package/lib/vertesia-ui-core.js +88 -46
  181. package/lib/vertesia-ui-core.js.map +1 -1
  182. package/lib/vertesia-ui-env.js +1 -1
  183. package/lib/vertesia-ui-env.js.map +1 -1
  184. package/lib/vertesia-ui-features.js +350 -317
  185. package/lib/vertesia-ui-features.js.map +1 -1
  186. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js +5 -0
  187. package/lib/vertesia-ui-i18n.B3NFclwl.chunk.js.map +1 -0
  188. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js +5 -0
  189. package/lib/vertesia-ui-i18n.BWSrNIxc.chunk.js.map +1 -0
  190. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js +5 -0
  191. package/lib/vertesia-ui-i18n.BWvWeB1p.chunk.js.map +1 -0
  192. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js +5 -0
  193. package/lib/vertesia-ui-i18n.BZCXvTC1.chunk.js.map +1 -0
  194. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js +5 -0
  195. package/lib/vertesia-ui-i18n.BbJMvFZW.chunk.js.map +1 -0
  196. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js +5 -0
  197. package/lib/vertesia-ui-i18n.CE5ldwpt.chunk.js.map +1 -0
  198. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js +5 -0
  199. package/lib/vertesia-ui-i18n.CMC0IShY.chunk.js.map +1 -0
  200. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js +5 -0
  201. package/lib/vertesia-ui-i18n.CkcRqBKU.chunk.js.map +1 -0
  202. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js +5 -0
  203. package/lib/vertesia-ui-i18n.D-Mq1sw_.chunk.js.map +1 -0
  204. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js +5 -0
  205. package/lib/vertesia-ui-i18n.DkK68-A-.chunk.js.map +1 -0
  206. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js +5 -0
  207. package/lib/vertesia-ui-i18n.XE_dcCg6.chunk.js.map +1 -0
  208. package/lib/vertesia-ui-i18n.js +2 -2
  209. package/lib/vertesia-ui-i18n.js.map +1 -1
  210. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js +5 -0
  211. package/lib/vertesia-ui-i18n.qgNqMPvK.chunk.js.map +1 -0
  212. package/lib/vertesia-ui-layout.js +43 -19
  213. package/lib/vertesia-ui-layout.js.map +1 -1
  214. package/lib/vertesia-ui-rich-text.js +123 -74
  215. package/lib/vertesia-ui-rich-text.js.map +1 -1
  216. package/lib/vertesia-ui-router.js.map +1 -1
  217. package/lib/vertesia-ui-session.js +1 -1
  218. package/lib/vertesia-ui-session.js.map +1 -1
  219. package/lib/vertesia-ui-shell.js +87 -33
  220. package/lib/vertesia-ui-shell.js.map +1 -1
  221. package/lib/vertesia-ui-widgets.js +154 -98
  222. package/lib/vertesia-ui-widgets.js.map +1 -1
  223. package/lib/widgets/xml-viewer/hooks/useCollapsible.d.ts +1 -1
  224. package/llms.txt +6 -2
  225. package/package.json +45 -36
  226. package/src/__tests__/a11y.test.tsx +25 -0
  227. package/src/__tests__/theme.test.ts +91 -0
  228. package/src/boot/branding.test.ts +72 -0
  229. package/src/boot/branding.ts +108 -0
  230. package/src/boot/index.test.ts +216 -0
  231. package/src/boot/index.ts +356 -0
  232. package/src/boot/vite.test.ts +93 -0
  233. package/src/boot/vite.ts +118 -0
  234. package/src/core/components/shadcn/button.tsx +1 -2
  235. package/src/core/components/shadcn/filters/filter-styles.ts +4 -4
  236. package/src/core/components/shadcn/label.tsx +1 -1
  237. package/src/env/index.test.ts +127 -0
  238. package/src/env/index.ts +73 -3
  239. package/src/features/agent/PayloadBuilder.tsx +10 -1
  240. package/src/features/agent/chat/AgentRunFeedback.test.tsx +347 -0
  241. package/src/features/agent/chat/AgentRunFeedback.tsx +465 -0
  242. package/src/features/agent/chat/ModernAgentConversation.test.tsx +1 -1
  243. package/src/features/agent/chat/ModernAgentConversation.tsx +52 -47
  244. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.test.tsx +145 -0
  245. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +42 -24
  246. package/src/features/agent/chat/ModernAgentOutput/Header.tsx +4 -0
  247. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +38 -5
  248. package/src/features/agent/chat/ModernAgentOutput/SummaryConversation.ts +2 -0
  249. package/src/features/agent/chat/ModernAgentOutput/utils.test.ts +14 -0
  250. package/src/features/agent/chat/hooks/useAgentPlans.test.ts +52 -0
  251. package/src/features/agent/chat/hooks/useAgentPlans.ts +5 -5
  252. package/src/features/agent/chat/hooks/useFileProcessing.test.tsx +0 -5
  253. package/src/features/agent/chat/index.ts +6 -0
  254. package/src/features/facets/AgentRunnerFacetsNav.tsx +26 -0
  255. package/src/features/permissions/UserPermissionsProvider.test.tsx +50 -1
  256. package/src/features/permissions/UserPermissionsProvider.tsx +82 -44
  257. package/src/features/store/objects/search/DocumentSearchContext.ts +8 -3
  258. package/src/features/store/objects/selection/SelectionActions.tsx +4 -1
  259. package/src/i18n/index.tsx +25 -2
  260. package/src/i18n/locales/ar.json +30 -0
  261. package/src/i18n/locales/de.json +30 -0
  262. package/src/i18n/locales/en.json +30 -0
  263. package/src/i18n/locales/es.json +30 -0
  264. package/src/i18n/locales/fr.json +30 -0
  265. package/src/i18n/locales/it.json +30 -0
  266. package/src/i18n/locales/ja.json +30 -0
  267. package/src/i18n/locales/ko.json +30 -0
  268. package/src/i18n/locales/pt.json +30 -0
  269. package/src/i18n/locales/ru.json +30 -0
  270. package/src/i18n/locales/tr.json +30 -0
  271. package/src/i18n/locales/zh-TW.json +30 -0
  272. package/src/i18n/locales/zh.json +30 -0
  273. package/src/layout/ErrorPage.tsx +1 -1
  274. package/src/layout/Navbar.test.tsx +58 -0
  275. package/src/layout/Navbar.tsx +5 -2
  276. package/src/router/path.test.ts +5 -5
  277. package/src/session/UserSession.ts +2 -4
  278. package/src/session/UserSessionProvider.strict-mode.test.tsx +44 -0
  279. package/src/session/UserSessionProvider.test.ts +62 -1
  280. package/src/session/UserSessionProvider.tsx +12 -4
  281. package/src/session/auth/composable.renewal.test.ts +170 -0
  282. package/src/session/auth/composable.test.ts +23 -1
  283. package/src/session/auth/composable.ts +101 -2
  284. package/src/session/auth/domainRouting.test.ts +35 -65
  285. package/src/session/auth/domainRouting.ts +51 -34
  286. package/src/session/auth/firebase.test.ts +25 -0
  287. package/src/session/auth/firebase.ts +10 -0
  288. package/src/session/auth/useAuthState.ts +11 -4
  289. package/src/session/index.ts +3 -1
  290. package/src/shell/AuthScreenPreview.test.tsx +44 -0
  291. package/src/shell/AuthScreenPreview.tsx +228 -0
  292. package/src/shell/BrandedAuthScreens.test.tsx +181 -0
  293. package/src/shell/BrandedAuthScreens.tsx +117 -0
  294. package/src/shell/SplashScreen.test.tsx +37 -0
  295. package/src/shell/SplashScreen.tsx +44 -39
  296. package/src/shell/VertesiaShell.tsx +49 -22
  297. package/src/shell/apps/StandaloneApp.tsx +5 -1
  298. package/src/shell/index.tsx +6 -0
  299. package/src/shell/login/SignInAuthPending.tsx +3 -3
  300. package/src/shell/login/SignInEmailStep.test.tsx +32 -0
  301. package/src/shell/login/SignInEmailStep.tsx +13 -9
  302. package/src/shell/login/SignInFlow.tsx +213 -0
  303. package/src/shell/login/SignInPageShell.tsx +62 -0
  304. package/src/shell/login/SignInPrimitives.tsx +14 -11
  305. package/src/shell/login/SignInRestrictedEnvStep.tsx +19 -7
  306. package/src/shell/login/SigninScreen.test.tsx +104 -0
  307. package/src/shell/login/SigninScreen.tsx +115 -145
  308. package/src/shell/login/SignupForm.tsx +8 -3
  309. package/src/shell/login/signInUtils.ts +42 -9
  310. package/src/widgets/markdown/CollaborativeMarkdownRenderer.test.tsx +11 -3
  311. package/src/widgets/markdown/markdown.css +21 -21
  312. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js +0 -5
  313. package/lib/vertesia-ui-i18n.BfN7iOHb.chunk.js.map +0 -1
  314. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js +0 -5
  315. package/lib/vertesia-ui-i18n.BjH2zEZw.chunk.js.map +0 -1
  316. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js +0 -5
  317. package/lib/vertesia-ui-i18n.BjSwAZXl.chunk.js.map +0 -1
  318. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js +0 -5
  319. package/lib/vertesia-ui-i18n.C7PUm5Au.chunk.js.map +0 -1
  320. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js +0 -5
  321. package/lib/vertesia-ui-i18n.CF_1mUS5.chunk.js.map +0 -1
  322. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js +0 -5
  323. package/lib/vertesia-ui-i18n.ChfUl3_-.chunk.js.map +0 -1
  324. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js +0 -5
  325. package/lib/vertesia-ui-i18n.D-Sk-5d1.chunk.js.map +0 -1
  326. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js +0 -5
  327. package/lib/vertesia-ui-i18n.D4rnu1_S.chunk.js.map +0 -1
  328. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js +0 -5
  329. package/lib/vertesia-ui-i18n.DDf0-laK.chunk.js.map +0 -1
  330. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js +0 -5
  331. package/lib/vertesia-ui-i18n.DN79y06J.chunk.js.map +0 -1
  332. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js +0 -5
  333. package/lib/vertesia-ui-i18n.DWLIciYQ.chunk.js.map +0 -1
  334. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js +0 -5
  335. package/lib/vertesia-ui-i18n.DvF_YaAJ.chunk.js.map +0 -1
  336. package/src/session/auth/authState.test.ts +0 -35
@@ -1,51 +1,45 @@
1
1
  import { useUserSession } from '@vertesia/ui/session';
2
- import { AnimatePresence, motion } from 'framer-motion';
3
- import { type ReactNode, useEffect, useState } from 'react';
2
+ import type { ComponentType, ReactNode } from 'react';
3
+
4
+ export interface AuthLoadingScreenProps {
5
+ loadingIcon?: ReactNode;
6
+ }
4
7
 
5
8
  interface SplashScreenProps {
9
+ Presentation?: ComponentType<AuthLoadingScreenProps>;
10
+ Screen?: ComponentType<AuthLoadingScreenProps>;
6
11
  icon?: ReactNode;
7
12
  }
8
- export function SplashScreen({ icon: Icon }: SplashScreenProps) {
13
+ export function SplashScreen({ icon: Icon, Screen, Presentation = DefaultAuthLoadingScreen }: SplashScreenProps) {
9
14
  const { isLoading, authToken } = useUserSession();
10
- const [show, setShow] = useState(true);
15
+ // Hand off synchronously: an exiting splash must never cover the next view.
16
+ if (authToken || !isLoading) return null;
11
17
 
12
- useEffect(() => {
13
- if (!isLoading) {
14
- setShow(false);
15
- }
16
- }, [isLoading]);
17
-
18
- // The permission gate owns the loading UI once a token is available.
19
- // Skip the exit animation too, so two loading indicators never overlap.
20
- if (authToken) return null;
18
+ // Custom screens own the entire page, including their animation and positioning.
19
+ const LoadingScreen = Screen ?? Presentation;
20
+ return <LoadingScreen loadingIcon={Icon} />;
21
+ }
21
22
 
23
+ /** Presentation shared by the default shell and configured branding. */
24
+ export function DefaultAuthLoadingScreen({
25
+ loadingIcon,
26
+ loadingLabel = 'Loading',
27
+ }: AuthLoadingScreenProps & { loadingLabel?: string }) {
22
28
  return (
23
- <AnimatePresence>
24
- {show && (
25
- <motion.div
26
- style={{ zIndex: 999999, position: 'fixed', inset: 0 }}
27
- className="fixed inset-x-0 inset-y-0"
28
- initial={{ opacity: 1 }}
29
- exit={{ opacity: 0 }}
30
- transition={{ ease: 'easeIn', duration: 0.5 }}
31
- >
32
- <div
33
- style={{
34
- display: 'flex',
35
- width: '100%',
36
- height: '100%',
37
- alignItems: 'center',
38
- justifyContent: 'center',
39
- }}
40
- className="flex w-full h-full items-center justify-center"
41
- >
42
- <div className="animate-[spin_4s_linear_infinite]">
43
- <div className="animate-pulse rounded-full bg-transparent">{Icon || <LoadingIcon />}</div>
44
- </div>
45
- </div>
46
- </motion.div>
47
- )}
48
- </AnimatePresence>
29
+ <div style={{ position: 'fixed', inset: 0, zIndex: 999999 }} role="status" aria-label={loadingLabel}>
30
+ <div
31
+ style={{
32
+ display: 'flex',
33
+ width: '100%',
34
+ height: '100%',
35
+ alignItems: 'center',
36
+ justifyContent: 'center',
37
+ }}
38
+ className="flex w-full h-full items-center justify-center"
39
+ >
40
+ <LoadingAnimation loadingIcon={loadingIcon} />
41
+ </div>
42
+ </div>
49
43
  );
50
44
  }
51
45
 
@@ -83,3 +77,14 @@ function LoadingIcon() {
83
77
  </svg>
84
78
  );
85
79
  }
80
+
81
+ /** Shared logo motion for full-screen and in-content loading states. */
82
+ export function LoadingAnimation({ loadingIcon }: AuthLoadingScreenProps) {
83
+ return (
84
+ <div className="animate-[var(--vertesia-loading-animation,spin_4s_linear_infinite)] motion-reduce:animate-none">
85
+ <div className="animate-[var(--vertesia-loading-pulse-animation,pulse_2s_cubic-bezier(0.4,0,0.6,1)_infinite)] motion-reduce:animate-none rounded-full bg-transparent">
86
+ {loadingIcon || <LoadingIcon />}
87
+ </div>
88
+ </div>
89
+ );
90
+ }
@@ -1,13 +1,24 @@
1
1
  import { ThemeProvider, ToastProvider } from '@vertesia/ui/core';
2
- import { TypeRegistryProvider, UserPermissionProvider } from '@vertesia/ui/features';
2
+ import { type PermissionLoadingScreenProps, TypeRegistryProvider, UserPermissionProvider } from '@vertesia/ui/features';
3
3
  import { LanguageBoundI18nProvider, LanguageProvider, type SupportedLanguage } from '@vertesia/ui/i18n';
4
4
  import { DevSessionProvider, UserSessionProvider } from '@vertesia/ui/session';
5
- import type { ReactNode } from 'react';
5
+ import type { ComponentType, ReactNode } from 'react';
6
+ import type { AppBranding } from '../boot/branding.js';
6
7
  import { IframeAppContextSync } from './apps/IframeAppContextSync.js';
7
- import { SigninScreen } from './login/SigninScreen';
8
- import { SplashScreen } from './SplashScreen';
8
+ import { AppBrandingProvider, BrandedAuthLoadingScreen, brandedAuthScreens } from './BrandedAuthScreens';
9
+ import { type SignInScreenViewProps, SigninScreen } from './login/SigninScreen';
10
+ import { type AuthLoadingScreenProps, SplashScreen } from './SplashScreen';
9
11
 
10
- interface VertesiaShellProps {
12
+ /** Optional full-page presentations. Session and permission gating remain owned by the shell. */
13
+ export interface AuthScreens {
14
+ SignIn?: ComponentType<SignInScreenViewProps>;
15
+ Loading?: ComponentType<AuthLoadingScreenProps>;
16
+ Permissions?: ComponentType<PermissionLoadingScreenProps>;
17
+ }
18
+
19
+ export interface VertesiaShellProps {
20
+ authScreens?: AuthScreens;
21
+ branding?: AppBranding;
11
22
  children: React.ReactNode;
12
23
  lightLogo?: string;
13
24
  darkLogo?: string;
@@ -30,26 +41,38 @@ export function VertesiaShell({
30
41
  suppressSignInErrorPrefixes,
31
42
  authToken,
32
43
  defaultLanguage,
44
+ authScreens,
45
+ branding,
33
46
  }: VertesiaShellProps) {
34
- const content = (
47
+ const screens = { ...(branding ? brandedAuthScreens : {}), ...authScreens };
48
+ const brandedContent = (
35
49
  <TypeRegistryProvider>
36
50
  <ThemeProvider defaultTheme="system" storageKey="vite-ui-theme">
37
51
  <LanguageProvider defaultLanguage={defaultLanguage}>
38
52
  <LanguageBoundI18nProvider>
39
- <IframeAppContextSync />
40
- {!authToken && (
41
- <>
42
- <SplashScreen icon={loadingIcon} />
43
- <SigninScreen
44
- allowedPrefix="/shared/"
45
- darkLogo={darkLogo}
46
- lightLogo={lightLogo}
47
- preservePath={preserveSignInPath}
48
- suppressAuthErrorPrefix={suppressSignInErrorPrefixes}
49
- />
50
- </>
51
- )}
52
- <UserPermissionProvider loadingIcon={loadingIcon}>{children}</UserPermissionProvider>
53
+ <AppBrandingBoundary branding={branding}>
54
+ <IframeAppContextSync />
55
+ {!authToken && (
56
+ <>
57
+ <SplashScreen
58
+ icon={loadingIcon}
59
+ Screen={authScreens?.Loading}
60
+ Presentation={branding ? BrandedAuthLoadingScreen : undefined}
61
+ />
62
+ <SigninScreen
63
+ View={screens.SignIn}
64
+ allowedPrefix="/shared/"
65
+ darkLogo={darkLogo}
66
+ lightLogo={lightLogo}
67
+ preservePath={preserveSignInPath}
68
+ suppressAuthErrorPrefix={suppressSignInErrorPrefixes}
69
+ />
70
+ </>
71
+ )}
72
+ <UserPermissionProvider loadingIcon={loadingIcon} LoadingScreen={screens.Permissions}>
73
+ {children}
74
+ </UserPermissionProvider>
75
+ </AppBrandingBoundary>
53
76
  </LanguageBoundI18nProvider>
54
77
  </LanguageProvider>
55
78
  </ThemeProvider>
@@ -59,10 +82,14 @@ export function VertesiaShell({
59
82
  return (
60
83
  <ToastProvider>
61
84
  {authToken ? (
62
- <DevSessionProvider token={authToken}>{content}</DevSessionProvider>
85
+ <DevSessionProvider token={authToken}>{brandedContent}</DevSessionProvider>
63
86
  ) : (
64
- <UserSessionProvider loadOnboardingStatus={loadOnboardingStatus}>{content}</UserSessionProvider>
87
+ <UserSessionProvider loadOnboardingStatus={loadOnboardingStatus}>{brandedContent}</UserSessionProvider>
65
88
  )}
66
89
  </ToastProvider>
67
90
  );
68
91
  }
92
+
93
+ function AppBrandingBoundary({ branding, children }: { branding?: AppBranding; children: ReactNode }) {
94
+ return branding ? <AppBrandingProvider branding={branding}>{children}</AppBrandingProvider> : children;
95
+ }
@@ -109,7 +109,11 @@ function AccessDeniedMessage({ name }: AccessDeniedMessageProps) {
109
109
  const onProjectChange = (selected: ProjectRef) => {
110
110
  localStorage.setItem(LastSelectedAccountId_KEY, selected.account);
111
111
  localStorage.setItem(`${LastSelectedProjectId_KEY}-${selected.account}`, selected.id);
112
- window.location.reload();
112
+ // An explicit selection must override configured workspace defaults on the next load.
113
+ const url = new URL(window.location.href);
114
+ url.searchParams.set('a', selected.account);
115
+ url.searchParams.set('p', selected.id);
116
+ window.location.assign(url.toString());
113
117
  };
114
118
 
115
119
  const filteredProjects = selectedAccountId ? projectsByOrg[selectedAccountId] || [] : [];
@@ -1,7 +1,13 @@
1
+ export * from './AuthScreenPreview';
1
2
  export * from './apps/index';
3
+ export * from './BrandedAuthScreens';
2
4
  export * from './login/InviteAcceptModal';
5
+ export * from './login/SignInFlow';
6
+ export * from './login/SignInPageShell';
3
7
  export * from './login/SigninScreen';
8
+ export * from './login/signInUtils';
4
9
  export * from './login/TerminalLogin';
5
10
  export * from './login/UserSessionMenu';
11
+ export type { AuthLoadingScreenProps } from './SplashScreen';
6
12
  export * from './utils';
7
13
  export * from './VertesiaShell';
@@ -28,10 +28,10 @@ export default function SignInAuthPending({ provider, onCancel }: SignInAuthPend
28
28
  </div>
29
29
 
30
30
  <div className="w-full flex flex-col gap-2">
31
- <SignInStepButton variant="loading">
31
+ <div className="flex justify-center">
32
32
  <Spinner />
33
- <span>{t('auth.pending.authenticating')}</span>
34
- </SignInStepButton>
33
+ </div>
34
+ <span>{t('auth.pending.authenticating')}</span>
35
35
  {onCancel && (
36
36
  <SignInStepButton variant="ghost" onClick={onCancel}>
37
37
  {t('auth.pending.cancel')}
@@ -0,0 +1,32 @@
1
+ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react';
2
+ import { afterEach, expect, it, vi } from 'vitest';
3
+ import SignInEmailStep from './SignInEmailStep';
4
+
5
+ const resolveTenant = vi.hoisted(() => vi.fn());
6
+ vi.mock('@vertesia/ui/session', () => ({ setFirebaseTenant: resolveTenant }));
7
+ vi.mock('@vertesia/ui/i18n', () => ({ useUITranslation: () => ({ t: (key: string) => key }) }));
8
+ afterEach(() => {
9
+ cleanup();
10
+ vi.clearAllMocks();
11
+ });
12
+
13
+ it('keeps feedback visible and prevents duplicate requests while tenant discovery is pending', async () => {
14
+ let finish!: () => void;
15
+ resolveTenant.mockReturnValue(
16
+ new Promise<void>((resolve) => {
17
+ finish = resolve;
18
+ }),
19
+ );
20
+ const onProceed = vi.fn();
21
+ render(<SignInEmailStep initialEmail="person@example.com" onProceed={onProceed} />);
22
+ const button = screen.getByRole('button', { name: 'auth.continue' });
23
+ fireEvent.click(button);
24
+ expect(screen.queryByRole('button', { name: 'auth.continue' })).toBeNull();
25
+ expect(screen.getByRole('textbox')).toBeTruthy();
26
+ expect(screen.getByRole('status')).toBeTruthy();
27
+ expect(button.contains(screen.getByRole('status'))).toBe(false);
28
+ fireEvent.submit(screen.getByRole('textbox').closest('form')!);
29
+ expect(resolveTenant).toHaveBeenCalledTimes(1);
30
+ finish();
31
+ await waitFor(() => expect(onProceed).toHaveBeenCalledWith('person@example.com', undefined));
32
+ });
@@ -67,16 +67,20 @@ export default function SignInEmailStep({ initialEmail, onProceed }: SignInEmail
67
67
  error={submitError ? t('auth.email.invalidError') : undefined}
68
68
  />
69
69
 
70
- <SignInStepButton type="submit" disabled={loading}>
71
- {loading ? (
70
+ {loading ? (
71
+ <div
72
+ role="status"
73
+ aria-label={t('auth.pending.authenticating')}
74
+ className="h-[42px] flex items-center justify-center"
75
+ >
72
76
  <Spinner />
73
- ) : (
74
- <>
75
- <span>{t('auth.continue')}</span>
76
- <ArrowRight className="!size-3.5" />
77
- </>
78
- )}
79
- </SignInStepButton>
77
+ </div>
78
+ ) : (
79
+ <SignInStepButton type="submit">
80
+ <span>{t('auth.continue')}</span>
81
+ <ArrowRight className="!size-3.5" />
82
+ </SignInStepButton>
83
+ )}
80
84
  </form>
81
85
  </SignInStepLayout>
82
86
  );
@@ -0,0 +1,213 @@
1
+ /**
2
+ * The sign-in state machine, extracted from SigninScreen so more than one host can drive it.
3
+ *
4
+ * Two hosts run it today: the Studio shell, which layers its own error-recovery modes on top
5
+ * (`SigninScreen`), and the Central Auth broker, which has no Vertesia session and renders only the
6
+ * modes below. The interesting behaviour is not the markup — it is the ordering: remembered
7
+ * identity first, then email, then tenant resolution deciding which providers are even offered.
8
+ * Re-implementing that per host is how the two pages drift apart.
9
+ *
10
+ * The hook takes no session dependency of its own: `signOut` and `trackEvent` come in as options
11
+ * because a host without a `UserSessionProvider` cannot call those hooks.
12
+ */
13
+ import { useCallback, useEffect, useState } from 'react';
14
+ import SignInAuthPending from './SignInAuthPending';
15
+ import SignInEmailStep, { type TenantInfo } from './SignInEmailStep';
16
+ import SignInProvidersStep from './SignInProvidersStep';
17
+ import SignInReturningStep from './SignInReturningStep';
18
+ import SignInTenantStep from './SignInTenantStep';
19
+ import {
20
+ clearLastSuccessfulLogin,
21
+ clearPendingSignin,
22
+ finalizeSuccessfulLogin,
23
+ type LastSuccessfulLogin,
24
+ type ProviderId,
25
+ readLastSuccessfulLogin,
26
+ resetSignInState,
27
+ signOutOfFirebase,
28
+ } from './signInUtils';
29
+
30
+ /** The modes every host shares. Hosts may add their own; see the `M` parameter below. */
31
+ export type SignInCoreMode = 'email' | 'providers' | 'tenant' | 'returning' | 'pending';
32
+
33
+ export interface SignInFlowOptions {
34
+ /**
35
+ * Host sign-out, run when the user abandons the remembered identity. Defaults to a plain
36
+ * Firebase sign-out; a host with a Vertesia session passes its own so the session goes too.
37
+ */
38
+ signOut?: () => void | Promise<void>;
39
+ /** Analytics sink. Only `enterprise_signin` is emitted, and only for a tenant-resolved sign-in. */
40
+ trackEvent?: (eventName: string, eventProperties?: Record<string, unknown>) => void;
41
+ /**
42
+ * The authenticated user, once there is one. Supplying it lets the flow stamp the display name
43
+ * onto the remembered-login record; a host that unmounts the flow on login should call
44
+ * {@link finalizeSuccessfulLogin} itself instead.
45
+ */
46
+ user?: { name?: string | null } | null;
47
+ }
48
+
49
+ /**
50
+ * Flow state plus the handlers the steps are wired to.
51
+ *
52
+ * `M` is the host's own extra modes: `SigninScreen` passes its error-recovery union so `mode` and
53
+ * `setMode` stay exhaustively typed there, while a host with no extra modes gets `SignInCoreMode`.
54
+ */
55
+ export interface SignInFlowController<M extends string = never> {
56
+ mode: SignInCoreMode | M;
57
+ setMode: (mode: SignInCoreMode | M) => void;
58
+ email: string;
59
+ setEmail: (email: string) => void;
60
+ tenant: TenantInfo | undefined;
61
+ setTenant: (tenant: TenantInfo | undefined) => void;
62
+ storedSession: LastSuccessfulLogin | null;
63
+ setStoredSession: (session: LastSuccessfulLogin | null) => void;
64
+ pendingProvider: ProviderId | null;
65
+ /** Email accepted: go to the tenant step when one resolved, otherwise the provider list. */
66
+ onProceedFromEmail: (email: string, tenant?: TenantInfo) => void;
67
+ /** Back to the email step, dropping the resolved tenant. */
68
+ onBack: () => void;
69
+ /** "Not you?" — forget the remembered identity and sign out. */
70
+ onNotYou: () => void;
71
+ /** A provider was picked; show the pending screen while the IdP redirect happens. */
72
+ onProviderClicked: (provider: ProviderId) => void;
73
+ /** Full reset: clear the persisted records and the Firebase session, back to the email step. */
74
+ startOver: () => void;
75
+ }
76
+
77
+ export function useSignInFlow<M extends string = never>(options: SignInFlowOptions = {}): SignInFlowController<M> {
78
+ const { signOut, trackEvent, user } = options;
79
+
80
+ const [storedSession, setStoredSession] = useState<LastSuccessfulLogin | null>(() => readLastSuccessfulLogin());
81
+ const [mode, setMode] = useState<SignInCoreMode | M>(() => (readLastSuccessfulLogin() ? 'returning' : 'email'));
82
+ const [email, setEmail] = useState('');
83
+ const [tenant, setTenant] = useState<TenantInfo | undefined>(undefined);
84
+ const [pendingProvider, setPendingProvider] = useState<ProviderId | null>(null);
85
+
86
+ // On successful login, finalize the last-successful-login entry with the user's name.
87
+ useEffect(() => {
88
+ if (!user) return;
89
+ finalizeSuccessfulLogin(user.name ?? undefined);
90
+ }, [user]);
91
+
92
+ const onProceedFromEmail = useCallback((e: string, t: TenantInfo | undefined) => {
93
+ setEmail(e);
94
+ setTenant(t);
95
+ setMode(t ? 'tenant' : 'providers');
96
+ }, []);
97
+
98
+ const onBack = useCallback(() => {
99
+ setMode('email');
100
+ setTenant(undefined);
101
+ }, []);
102
+
103
+ const onNotYou = useCallback(() => {
104
+ clearLastSuccessfulLogin();
105
+ clearPendingSignin();
106
+ setStoredSession(null);
107
+ setEmail('');
108
+ setTenant(undefined);
109
+ setMode('email');
110
+ // Without a host sign-out, drop the Firebase session anyway: leaving it behind means the
111
+ // next auth-state change re-authenticates the identity the user just said isn't theirs.
112
+ void (signOut ? signOut() : signOutOfFirebase());
113
+ }, [signOut]);
114
+
115
+ const onProviderClicked = useCallback(
116
+ (provider: ProviderId) => {
117
+ // Tenant context comes from a resolved tenant or stored tenantName, not the provider.
118
+ const hasTenant = !!tenant || !!storedSession?.tenantName;
119
+ // Only the pre-existing enterprise_signin event; non-tenant sign-ins emit nothing.
120
+ if (hasTenant) trackEvent?.('enterprise_signin', { provider });
121
+ setPendingProvider(provider);
122
+ setMode('pending');
123
+ // The redirect itself happens in the calling step's startSignIn(); this just shows the pending screen.
124
+ },
125
+ [trackEvent, storedSession?.tenantName, tenant],
126
+ );
127
+
128
+ const startOver = useCallback(() => {
129
+ setStoredSession(null); // drop the in-memory mirror too — resetSignInState only clears storage
130
+ setEmail('');
131
+ setTenant(undefined);
132
+ setMode('email');
133
+ void resetSignInState();
134
+ }, []);
135
+
136
+ return {
137
+ mode,
138
+ setMode,
139
+ email,
140
+ setEmail,
141
+ tenant,
142
+ setTenant,
143
+ storedSession,
144
+ setStoredSession,
145
+ pendingProvider,
146
+ onProceedFromEmail,
147
+ onBack,
148
+ onNotYou,
149
+ onProviderClicked,
150
+ startOver,
151
+ };
152
+ }
153
+
154
+ /**
155
+ * The part of the controller the shared steps read.
156
+ *
157
+ * Deliberately excludes the setters: their parameter types mention the host's extra modes, and a
158
+ * contravariant position would stop `SignInFlowController<never>` from being passed here.
159
+ */
160
+ export type SignInStepsController = Omit<
161
+ SignInFlowController<string>,
162
+ 'setMode' | 'setEmail' | 'setTenant' | 'setStoredSession' | 'startOver'
163
+ >;
164
+
165
+ interface SignInFlowStepsProps {
166
+ flow: SignInStepsController;
167
+ /** Path to return to after the IdP round-trip. Defaults to the current pathname. */
168
+ redirectTo?: string;
169
+ }
170
+
171
+ /**
172
+ * Renders the step for the current core mode. A host mode this doesn't know falls through to the
173
+ * email step, which is where the original screen sent an unrecognized state too.
174
+ */
175
+ export function SignInFlowSteps({ flow, redirectTo }: SignInFlowStepsProps) {
176
+ const { mode, email, tenant, storedSession, pendingProvider } = flow;
177
+
178
+ if (mode === 'pending' && pendingProvider) {
179
+ return <SignInAuthPending provider={pendingProvider} />;
180
+ }
181
+ if (mode === 'tenant' && tenant) {
182
+ return (
183
+ <SignInTenantStep
184
+ email={email}
185
+ tenant={tenant}
186
+ onBack={flow.onBack}
187
+ onProviderClicked={() => flow.onProviderClicked((tenant.provider ?? 'oidc') as ProviderId)}
188
+ redirectTo={redirectTo}
189
+ />
190
+ );
191
+ }
192
+ if (mode === 'providers') {
193
+ return (
194
+ <SignInProvidersStep
195
+ email={email}
196
+ onBack={flow.onBack}
197
+ onProviderClicked={flow.onProviderClicked}
198
+ redirectTo={redirectTo}
199
+ />
200
+ );
201
+ }
202
+ if (mode === 'returning' && storedSession) {
203
+ return (
204
+ <SignInReturningStep
205
+ session={storedSession}
206
+ onNotYou={flow.onNotYou}
207
+ onProviderClicked={flow.onProviderClicked}
208
+ redirectTo={redirectTo}
209
+ />
210
+ );
211
+ }
212
+ return <SignInEmailStep initialEmail={email} onProceed={flow.onProceedFromEmail} />;
213
+ }
@@ -0,0 +1,62 @@
1
+ /**
2
+ * The chrome around a sign-in step: product logo, the step itself, an optional notice, and the
3
+ * legal footer. Hosts supply their own outer container — the Studio shell overlays the app, the
4
+ * Central Auth broker owns the whole document — so this component deliberately does not position
5
+ * itself.
6
+ */
7
+ import { useUITranslation } from '@vertesia/ui/i18n';
8
+ import { RegionTag } from '@vertesia/ui/layout';
9
+ import type { ReactNode } from 'react';
10
+
11
+ interface SignInPageShellProps {
12
+ logoAlt?: string;
13
+ footer?: string;
14
+ lightLogo?: string;
15
+ darkLogo?: string;
16
+ /** Rendered between the step and the footer — e.g. a generic authentication error. */
17
+ notice?: ReactNode;
18
+ children: ReactNode;
19
+ }
20
+
21
+ export function SignInPageShell({
22
+ lightLogo,
23
+ darkLogo,
24
+ notice,
25
+ children,
26
+ logoAlt = 'Vertesia',
27
+ footer,
28
+ }: SignInPageShellProps) {
29
+ const { t } = useUITranslation();
30
+ return (
31
+ <div className="min-h-full flex flex-col items-center justify-center py-12 px-4">
32
+ <div className="flex flex-col items-center w-full">
33
+ {(lightLogo || darkLogo) && (
34
+ <div className="mb-7">
35
+ {lightLogo && <img src={lightLogo} alt={logoAlt} className="h-10 block dark:hidden" />}
36
+ {darkLogo && <img src={darkLogo} alt={logoAlt} className="h-10 hidden dark:block" />}
37
+ </div>
38
+ )}
39
+
40
+ {children}
41
+
42
+ {notice}
43
+
44
+ {footer ? (
45
+ <p className="mt-10 text-xs text-muted">{footer}</p>
46
+ ) : (
47
+ <div className="flex items-center gap-5 mt-10 text-xs text-muted">
48
+ <a href="https://vertesiahq.com/privacy" className="hover:text-foreground transition">
49
+ {t('auth.privacyPolicy')}
50
+ </a>
51
+ <span className="text-border">·</span>
52
+ <a href="https://vertesiahq.com/terms" className="hover:text-foreground transition">
53
+ {t('auth.termsOfService')}
54
+ </a>
55
+ <span className="text-border">·</span>
56
+ <RegionTag className="cursor-default" />
57
+ </div>
58
+ )}
59
+ </div>
60
+ </div>
61
+ );
62
+ }