@vertesia/ui 0.66.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (288) hide show
  1. package/lib/esm/core/components/Badge.js +1 -1
  2. package/lib/esm/core/components/Badge.js.map +1 -1
  3. package/lib/esm/core/components/FormItem.js +2 -2
  4. package/lib/esm/core/components/FormItem.js.map +1 -1
  5. package/lib/esm/core/components/InputList.js +2 -2
  6. package/lib/esm/core/components/InputList.js.map +1 -1
  7. package/lib/esm/core/components/shadcn/checkbox.js +1 -1
  8. package/lib/esm/core/components/shadcn/checkbox.js.map +1 -1
  9. package/lib/esm/core/components/shadcn/command.js +1 -1
  10. package/lib/esm/core/components/shadcn/command.js.map +1 -1
  11. package/lib/esm/core/components/shadcn/dialog.js +6 -6
  12. package/lib/esm/core/components/shadcn/dialog.js.map +1 -1
  13. package/lib/esm/core/components/shadcn/filters/DynamicLabel.js.map +1 -1
  14. package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js +129 -0
  15. package/lib/esm/core/components/shadcn/filters/comboBox/DateCombobox.js.map +1 -0
  16. package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js +46 -0
  17. package/lib/esm/core/components/shadcn/filters/comboBox/SelectCombobox.js.map +1 -0
  18. package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js +23 -0
  19. package/lib/esm/core/components/shadcn/filters/comboBox/StringListCombobox.js.map +1 -0
  20. package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js +28 -0
  21. package/lib/esm/core/components/shadcn/filters/comboBox/TextCombobox.js.map +1 -0
  22. package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js +5 -0
  23. package/lib/esm/core/components/shadcn/filters/comboBox/comboBox.js.map +1 -0
  24. package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js +101 -0
  25. package/lib/esm/core/components/shadcn/filters/filter/SelectFilter.js.map +1 -0
  26. package/lib/esm/core/components/shadcn/filters/{stringListFilter.js → filter/StringListFilter.js} +3 -3
  27. package/lib/esm/core/components/shadcn/filters/filter/StringListFilter.js.map +1 -0
  28. package/lib/esm/core/components/shadcn/filters/{textFilter.js → filter/TextFilter.js} +4 -4
  29. package/lib/esm/core/components/shadcn/filters/filter/TextFilter.js.map +1 -0
  30. package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js +161 -0
  31. package/lib/esm/core/components/shadcn/filters/filter/dateFilter.js.map +1 -0
  32. package/lib/esm/core/components/shadcn/filters/filter-styles.js +88 -0
  33. package/lib/esm/core/components/shadcn/filters/filter-styles.js.map +1 -0
  34. package/lib/esm/core/components/shadcn/filters/filterBar.js +128 -87
  35. package/lib/esm/core/components/shadcn/filters/filterBar.js.map +1 -1
  36. package/lib/esm/core/components/shadcn/filters/filters.js +7 -6
  37. package/lib/esm/core/components/shadcn/filters/filters.js.map +1 -1
  38. package/lib/esm/core/components/shadcn/filters/index.js +1 -1
  39. package/lib/esm/core/components/shadcn/filters/index.js.map +1 -1
  40. package/lib/esm/core/components/shadcn/filters/types.js.map +1 -1
  41. package/lib/esm/core/components/toast/NotificationPanel.js +24 -18
  42. package/lib/esm/core/components/toast/NotificationPanel.js.map +1 -1
  43. package/lib/esm/features/agent/PayloadBuilder.js +47 -27
  44. package/lib/esm/features/agent/PayloadBuilder.js.map +1 -1
  45. package/lib/esm/features/agent/chat/ModernAgentConversation.js +10 -4
  46. package/lib/esm/features/agent/chat/ModernAgentConversation.js.map +1 -1
  47. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js +7 -6
  48. package/lib/esm/features/agent/chat/ModernAgentOutput/AllMessagesMixed.js.map +1 -1
  49. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js +13 -2
  50. package/lib/esm/features/agent/chat/ModernAgentOutput/MessageItem.js.map +1 -1
  51. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js +2 -1
  52. package/lib/esm/features/agent/chat/ModernAgentOutput/SlidingMessages.js.map +1 -1
  53. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js +10 -4
  54. package/lib/esm/features/agent/chat/ModernAgentOutput/utils.js.map +1 -1
  55. package/lib/esm/features/facets/DocumentsFacetsNav.js +133 -0
  56. package/lib/esm/features/facets/DocumentsFacetsNav.js.map +1 -0
  57. package/lib/esm/features/facets/RunsFacetsNav.js +125 -0
  58. package/lib/esm/features/facets/RunsFacetsNav.js.map +1 -0
  59. package/lib/esm/features/facets/VFacetsNav.js +4 -113
  60. package/lib/esm/features/facets/VFacetsNav.js.map +1 -1
  61. package/lib/esm/features/facets/VStringFacet.js +6 -4
  62. package/lib/esm/features/facets/VStringFacet.js.map +1 -1
  63. package/lib/esm/features/facets/VTypeFacet.js +4 -5
  64. package/lib/esm/features/facets/VTypeFacet.js.map +1 -1
  65. package/lib/esm/features/facets/VUserFacet.js +1 -1
  66. package/lib/esm/features/facets/VUserFacet.js.map +1 -1
  67. package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js +98 -0
  68. package/lib/esm/features/facets/WorkflowExecutionsFacetsNav.js.map +1 -0
  69. package/lib/esm/features/facets/index.js +3 -2
  70. package/lib/esm/features/facets/index.js.map +1 -1
  71. package/lib/esm/features/store/collections/CollectionsTable.js +1 -1
  72. package/lib/esm/features/store/collections/CollectionsTable.js.map +1 -1
  73. package/lib/esm/features/store/collections/CreateCollection.js +10 -9
  74. package/lib/esm/features/store/collections/CreateCollection.js.map +1 -1
  75. package/lib/esm/features/store/collections/EditCollectionView.js +10 -9
  76. package/lib/esm/features/store/collections/EditCollectionView.js.map +1 -1
  77. package/lib/esm/features/store/collections/SelectCollection.js +1 -1
  78. package/lib/esm/features/store/collections/SelectCollection.js.map +1 -1
  79. package/lib/esm/features/store/objects/DocumentPreviewPanel.js +0 -1
  80. package/lib/esm/features/store/objects/DocumentPreviewPanel.js.map +1 -1
  81. package/lib/esm/features/store/objects/DocumentSearchResults.js +37 -2
  82. package/lib/esm/features/store/objects/DocumentSearchResults.js.map +1 -1
  83. package/lib/esm/features/store/objects/components/ContentOverview.js +5 -6
  84. package/lib/esm/features/store/objects/components/ContentOverview.js.map +1 -1
  85. package/lib/esm/features/store/objects/components/SelectDocument.js +2 -2
  86. package/lib/esm/features/store/objects/components/SelectDocument.js.map +1 -1
  87. package/lib/esm/features/store/objects/components/VectorSearchWidget.js +1 -1
  88. package/lib/esm/features/store/objects/components/VectorSearchWidget.js.map +1 -1
  89. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js +16 -4
  90. package/lib/esm/features/store/objects/selection/actions/AddToCollectionAction.js.map +1 -1
  91. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js +72 -37
  92. package/lib/esm/features/store/objects/upload/DocumentUploadModal.js.map +1 -1
  93. package/lib/esm/features/store/types/ObjectSchemaEditor.js +15 -0
  94. package/lib/esm/features/store/types/ObjectSchemaEditor.js.map +1 -1
  95. package/lib/esm/features/user/UserInfo.js +8 -8
  96. package/lib/esm/features/user/UserInfo.js.map +1 -1
  97. package/lib/esm/layout/FullHeightLayout.js +2 -4
  98. package/lib/esm/layout/FullHeightLayout.js.map +1 -1
  99. package/lib/esm/router/HistoryNavigator.js +2 -2
  100. package/lib/esm/router/HistoryNavigator.js.map +1 -1
  101. package/lib/esm/shell/SplashScreen.js +19 -0
  102. package/lib/esm/shell/SplashScreen.js.map +1 -0
  103. package/lib/esm/shell/VertesiaShell.js +10 -0
  104. package/lib/esm/shell/VertesiaShell.js.map +1 -0
  105. package/lib/esm/shell/index.js +7 -0
  106. package/lib/esm/shell/index.js.map +1 -0
  107. package/lib/esm/shell/login/EnterpriseSigninButton.js +81 -0
  108. package/lib/esm/shell/login/EnterpriseSigninButton.js.map +1 -0
  109. package/lib/esm/shell/login/GitHubSignInButton.js +24 -0
  110. package/lib/esm/shell/login/GitHubSignInButton.js.map +1 -0
  111. package/lib/esm/shell/login/GoogleSignInButton.js +25 -0
  112. package/lib/esm/shell/login/GoogleSignInButton.js.map +1 -0
  113. package/lib/esm/shell/login/InviteAcceptModal.js +45 -0
  114. package/lib/esm/shell/login/InviteAcceptModal.js.map +1 -0
  115. package/lib/esm/shell/login/MicrosoftSigninButton.js +19 -0
  116. package/lib/esm/shell/login/MicrosoftSigninButton.js.map +1 -0
  117. package/lib/esm/shell/login/PreviewIcon.js +23 -0
  118. package/lib/esm/shell/login/PreviewIcon.js.map +1 -0
  119. package/lib/esm/shell/login/SignInModal.js +9 -0
  120. package/lib/esm/shell/login/SignInModal.js.map +1 -0
  121. package/lib/esm/shell/login/SigninScreen.js +64 -0
  122. package/lib/esm/shell/login/SigninScreen.js.map +1 -0
  123. package/lib/esm/shell/login/SignupForm.js +91 -0
  124. package/lib/esm/shell/login/SignupForm.js.map +1 -0
  125. package/lib/esm/shell/login/TerminalLogin.js +179 -0
  126. package/lib/esm/shell/login/TerminalLogin.js.map +1 -0
  127. package/lib/esm/shell/login/UserInfo.js +40 -0
  128. package/lib/esm/shell/login/UserInfo.js.map +1 -0
  129. package/lib/esm/shell/login/UserSessionMenu.js +31 -0
  130. package/lib/esm/shell/login/UserSessionMenu.js.map +1 -0
  131. package/lib/esm/shell/utils.js +6 -0
  132. package/lib/esm/shell/utils.js.map +1 -0
  133. package/lib/esm/widgets/SvgIcon.js +36 -0
  134. package/lib/esm/widgets/SvgIcon.js.map +1 -0
  135. package/lib/esm/widgets/index.js +7 -6
  136. package/lib/esm/widgets/index.js.map +1 -1
  137. package/lib/esm/widgets/upload/UploadSummary.js +1 -1
  138. package/lib/esm/widgets/upload/UploadSummary.js.map +1 -1
  139. package/lib/tsconfig.tsbuildinfo +1 -1
  140. package/lib/types/core/components/FormItem.d.ts +2 -1
  141. package/lib/types/core/components/shadcn/dialog.d.ts +2 -1
  142. package/lib/types/core/components/shadcn/filters/DynamicLabel.d.ts +1 -1
  143. package/lib/types/core/components/shadcn/filters/comboBox/DateCombobox.d.ts +5 -0
  144. package/lib/types/core/components/shadcn/filters/comboBox/SelectCombobox.d.ts +8 -0
  145. package/lib/types/core/components/shadcn/filters/comboBox/StringListCombobox.d.ts +5 -0
  146. package/lib/types/core/components/shadcn/filters/comboBox/TextCombobox.d.ts +5 -0
  147. package/lib/types/core/components/shadcn/filters/comboBox/comboBox.d.ts +4 -0
  148. package/lib/types/core/components/shadcn/filters/{selectFilter.d.ts → filter/SelectFilter.d.ts} +2 -2
  149. package/lib/types/core/components/shadcn/filters/{stringListFilter.d.ts → filter/StringListFilter.d.ts} +1 -1
  150. package/lib/types/core/components/shadcn/filters/{textFilter.d.ts → filter/TextFilter.d.ts} +1 -1
  151. package/lib/types/core/components/shadcn/filters/{dateFilter.d.ts → filter/dateFilter.d.ts} +1 -1
  152. package/lib/types/core/components/shadcn/filters/filter-styles.d.ts +1 -0
  153. package/lib/types/core/components/shadcn/filters/filterBar.d.ts +14 -4
  154. package/lib/types/core/components/shadcn/filters/index.d.ts +1 -1
  155. package/lib/types/core/components/shadcn/filters/types.d.ts +2 -0
  156. package/lib/types/features/agent/PayloadBuilder.d.ts +17 -8
  157. package/lib/types/features/agent/chat/ModernAgentOutput/utils.d.ts +2 -1
  158. package/lib/types/features/facets/DocumentsFacetsNav.d.ts +16 -0
  159. package/lib/types/features/facets/RunsFacetsNav.d.ts +18 -0
  160. package/lib/types/features/facets/VFacetsNav.d.ts +1 -1
  161. package/lib/types/features/facets/VStringFacet.d.ts +6 -2
  162. package/lib/types/features/facets/VTypeFacet.d.ts +3 -1
  163. package/lib/types/features/facets/WorkflowExecutionsFacetsNav.d.ts +13 -0
  164. package/lib/types/features/facets/index.d.ts +3 -2
  165. package/lib/types/shell/SplashScreen.d.ts +4 -0
  166. package/lib/types/shell/VertesiaShell.d.ts +7 -0
  167. package/lib/types/shell/index.d.ts +6 -0
  168. package/lib/types/shell/login/EnterpriseSigninButton.d.ts +5 -0
  169. package/lib/types/shell/login/GitHubSignInButton.d.ts +5 -0
  170. package/lib/types/shell/login/GoogleSignInButton.d.ts +5 -0
  171. package/lib/types/shell/login/InviteAcceptModal.d.ts +1 -0
  172. package/lib/types/shell/login/MicrosoftSigninButton.d.ts +5 -0
  173. package/lib/types/shell/login/PreviewIcon.d.ts +5 -0
  174. package/lib/types/shell/login/SignInModal.d.ts +6 -0
  175. package/lib/types/shell/login/SigninScreen.d.ts +8 -0
  176. package/lib/types/shell/login/SignupForm.d.ts +7 -0
  177. package/lib/types/shell/login/TerminalLogin.d.ts +1 -0
  178. package/lib/types/shell/login/UserInfo.d.ts +5 -0
  179. package/lib/types/shell/login/UserSessionMenu.d.ts +8 -0
  180. package/lib/types/shell/utils.d.ts +1 -0
  181. package/lib/types/widgets/SvgIcon.d.ts +6 -0
  182. package/lib/types/widgets/index.d.ts +7 -6
  183. package/lib/vertesia-ui-core.js +1 -1
  184. package/lib/vertesia-ui-core.js.map +1 -1
  185. package/lib/vertesia-ui-features.js +1 -1
  186. package/lib/vertesia-ui-features.js.map +1 -1
  187. package/lib/vertesia-ui-layout.js +1 -1
  188. package/lib/vertesia-ui-layout.js.map +1 -1
  189. package/lib/vertesia-ui-router.js +1 -1
  190. package/lib/vertesia-ui-router.js.map +1 -1
  191. package/lib/vertesia-ui-shell.js +2 -0
  192. package/lib/vertesia-ui-shell.js.map +1 -0
  193. package/lib/vertesia-ui-widgets.js +1 -1
  194. package/lib/vertesia-ui-widgets.js.map +1 -1
  195. package/package.json +14 -6
  196. package/src/core/components/Badge.tsx +12 -8
  197. package/src/core/components/FormItem.tsx +4 -3
  198. package/src/core/components/InputList.tsx +21 -17
  199. package/src/core/components/shadcn/checkbox.tsx +2 -2
  200. package/src/core/components/shadcn/command.tsx +1 -1
  201. package/src/core/components/shadcn/dialog.tsx +18 -9
  202. package/src/core/components/shadcn/filters/DynamicLabel.tsx +1 -2
  203. package/src/core/components/shadcn/filters/comboBox/DateCombobox.tsx +211 -0
  204. package/src/core/components/shadcn/filters/{comboBox.tsx → comboBox/SelectCombobox.tsx} +8 -192
  205. package/src/core/components/shadcn/filters/comboBox/StringListCombobox.tsx +76 -0
  206. package/src/core/components/shadcn/filters/comboBox/TextCombobox.tsx +81 -0
  207. package/src/core/components/shadcn/filters/comboBox/comboBox.tsx +4 -0
  208. package/src/core/components/shadcn/filters/filter/SelectFilter.tsx +161 -0
  209. package/src/core/components/shadcn/filters/{stringListFilter.tsx → filter/StringListFilter.tsx} +7 -7
  210. package/src/core/components/shadcn/filters/{textFilter.tsx → filter/TextFilter.tsx} +17 -11
  211. package/src/core/components/shadcn/filters/filter/dateFilter.tsx +256 -0
  212. package/src/core/components/shadcn/filters/filter-styles.ts +87 -0
  213. package/src/core/components/shadcn/filters/filterBar.tsx +208 -152
  214. package/src/core/components/shadcn/filters/filters.tsx +7 -5
  215. package/src/core/components/shadcn/filters/index.ts +1 -1
  216. package/src/core/components/shadcn/filters/types.ts +2 -0
  217. package/src/core/components/toast/NotificationPanel.tsx +38 -22
  218. package/src/features/agent/PayloadBuilder.tsx +56 -31
  219. package/src/features/agent/chat/ModernAgentConversation.tsx +645 -639
  220. package/src/features/agent/chat/ModernAgentOutput/AllMessagesMixed.tsx +7 -6
  221. package/src/features/agent/chat/ModernAgentOutput/MessageItem.tsx +13 -2
  222. package/src/features/agent/chat/ModernAgentOutput/SlidingMessages.tsx +2 -1
  223. package/src/features/agent/chat/ModernAgentOutput/utils.ts +12 -4
  224. package/src/features/facets/DocumentsFacetsNav.tsx +171 -0
  225. package/src/features/facets/RunsFacetsNav.tsx +166 -0
  226. package/src/features/facets/VFacetsNav.tsx +10 -126
  227. package/src/features/facets/VStringFacet.tsx +10 -4
  228. package/src/features/facets/VTypeFacet.tsx +6 -5
  229. package/src/features/facets/VUserFacet.tsx +5 -3
  230. package/src/features/facets/WorkflowExecutionsFacetsNav.tsx +132 -0
  231. package/src/features/facets/index.ts +5 -2
  232. package/src/features/store/collections/CollectionsTable.tsx +3 -2
  233. package/src/features/store/collections/CreateCollection.tsx +17 -15
  234. package/src/features/store/collections/EditCollectionView.tsx +19 -16
  235. package/src/features/store/collections/SelectCollection.tsx +1 -1
  236. package/src/features/store/objects/DocumentPreviewPanel.tsx +0 -1
  237. package/src/features/store/objects/DocumentSearchResults.tsx +80 -11
  238. package/src/features/store/objects/components/ContentOverview.tsx +7 -7
  239. package/src/features/store/objects/components/SelectDocument.tsx +2 -2
  240. package/src/features/store/objects/components/VectorSearchWidget.tsx +2 -2
  241. package/src/features/store/objects/selection/actions/AddToCollectionAction.tsx +40 -19
  242. package/src/features/store/objects/upload/DocumentUploadModal.tsx +160 -214
  243. package/src/features/store/types/ObjectSchemaEditor.tsx +15 -0
  244. package/src/features/user/UserInfo.tsx +17 -14
  245. package/src/layout/FullHeightLayout.tsx +2 -2
  246. package/src/router/HistoryNavigator.ts +2 -2
  247. package/src/shell/SplashScreen.tsx +41 -0
  248. package/src/shell/VertesiaShell.tsx +27 -0
  249. package/src/shell/index.tsx +6 -0
  250. package/src/shell/login/EnterpriseSigninButton.tsx +106 -0
  251. package/src/shell/login/GitHubSignInButton.tsx +40 -0
  252. package/src/shell/login/GoogleSignInButton.tsx +36 -0
  253. package/src/shell/login/InviteAcceptModal.tsx +78 -0
  254. package/src/shell/login/MicrosoftSigninButton.tsx +30 -0
  255. package/src/shell/login/PreviewIcon.tsx +29 -0
  256. package/src/shell/login/SignInModal.tsx +28 -0
  257. package/src/shell/login/SigninScreen.tsx +162 -0
  258. package/src/shell/login/SignupForm.tsx +178 -0
  259. package/src/shell/login/TerminalLogin.tsx +299 -0
  260. package/src/shell/login/UserInfo.tsx +76 -0
  261. package/src/shell/login/UserSessionMenu.tsx +81 -0
  262. package/src/shell/utils.tsx +7 -0
  263. package/src/widgets/SvgIcon.tsx +44 -0
  264. package/src/widgets/index.ts +7 -6
  265. package/src/widgets/upload/UploadSummary.tsx +3 -4
  266. package/lib/esm/core/components/shadcn/filters/comboBox.js +0 -101
  267. package/lib/esm/core/components/shadcn/filters/comboBox.js.map +0 -1
  268. package/lib/esm/core/components/shadcn/filters/dateFilter.js +0 -36
  269. package/lib/esm/core/components/shadcn/filters/dateFilter.js.map +0 -1
  270. package/lib/esm/core/components/shadcn/filters/selectFilter.js +0 -67
  271. package/lib/esm/core/components/shadcn/filters/selectFilter.js.map +0 -1
  272. package/lib/esm/core/components/shadcn/filters/stringListFilter.js.map +0 -1
  273. package/lib/esm/core/components/shadcn/filters/textFilter.js.map +0 -1
  274. package/lib/esm/features/facets/InteractionFacet.js +0 -39
  275. package/lib/esm/features/facets/InteractionFacet.js.map +0 -1
  276. package/lib/esm/features/facets/TypeOptions.js +0 -19
  277. package/lib/esm/features/facets/TypeOptions.js.map +0 -1
  278. package/lib/esm/features/facets/UserFacet.js +0 -33
  279. package/lib/esm/features/facets/UserFacet.js.map +0 -1
  280. package/lib/types/core/components/shadcn/filters/comboBox.d.ts +0 -22
  281. package/lib/types/features/facets/InteractionFacet.d.ts +0 -9
  282. package/lib/types/features/facets/TypeOptions.d.ts +0 -3
  283. package/lib/types/features/facets/UserFacet.d.ts +0 -11
  284. package/src/core/components/shadcn/filters/dateFilter.tsx +0 -82
  285. package/src/core/components/shadcn/filters/selectFilter.tsx +0 -110
  286. package/src/features/facets/InteractionFacet.tsx +0 -53
  287. package/src/features/facets/TypeOptions.tsx +0 -22
  288. package/src/features/facets/UserFacet.tsx +0 -61
@@ -1,5 +1,5 @@
1
1
  import { useUserSession } from "@vertesia/ui/session";
2
- import { ApiKey, ApiKeyTypes, PrincipalType, User } from "@vertesia/common";
2
+ import { ApiKey, PrincipalType, User } from "@vertesia/common";
3
3
  import { Avatar, Table, Popover, PopoverContent, PopoverTrigger, useFetch } from "@vertesia/ui/core";
4
4
  import { ReactNode } from "react";
5
5
 
@@ -137,8 +137,12 @@ function UserAvatar({ userId, showTitle = false, size = "md" }: UserAvatarProps)
137
137
  return <AvatarPlaceholder />
138
138
  }
139
139
 
140
+ const description = (
141
+ <div className="truncate" title={user.email}>{user.email}</div>
142
+ )
143
+
140
144
  return (
141
- <UserPopoverPanel title={user.name || user.email || user.username || "unknown"} description={user.email}>
145
+ <UserPopoverPanel title={user.name || user.email || user.username || "unknown"} description={description}>
142
146
  <div className="flex flex-row items-center gap-2">
143
147
  <Avatar src={user.picture} name={user.name} color="bg-indigo-500" size={size} />
144
148
  {showTitle && <div className="text-sm font-semibold pl-2">{user.name || user.email || user.username || "unknown"}</div>}
@@ -162,22 +166,21 @@ export function ApiKeyAvatar({ keyId, showTitle = false, size = "md" }: ApiKeyAv
162
166
  return <AvatarPlaceholder />
163
167
  }
164
168
 
165
- const isPublic = data.type === ApiKeyTypes.public;
166
- const title = isPublic ? "Public Key" : "Private Key";
167
- const avatar = <Avatar name={isPublic ? "PK" : "SK"} color="bg-pink-500" size={size} />;
169
+ const title = "Private Key";
170
+ const avatar = <Avatar name={"PK"} color="bg-pink-500" size={size} />;
168
171
  const description = (
169
- <Table className="dark:bg-gray-800 dark:text-gray-200">
172
+ <Table className="dark:bg-gray-800 dark:text-gray-200 table-fixed w-full">
170
173
  <tr>
171
- <td className="font-semibold">Key:</td>
172
- <td>{data?.name}</td>
174
+ <td className="font-semibold w-20">Key:</td>
175
+ <td className="truncate max-w-0">{data?.name}</td>
173
176
  </tr>
174
177
  <tr>
175
- <td className="font-semibold">Account:</td>
176
- <td>{data?.account}</td>
178
+ <td className="font-semibold w-20">Account:</td>
179
+ <td className="truncate max-w-0">{data?.account}</td>
177
180
  </tr>
178
181
  <tr>
179
- <td className="font-semibold">Project:</td>
180
- <td>{data?.project}</td>
182
+ <td className="font-semibold w-20">Project:</td>
183
+ <td className="truncate max-w-0">{data?.project}</td>
181
184
  </tr>
182
185
  </Table>
183
186
  );
@@ -186,7 +189,7 @@ export function ApiKeyAvatar({ keyId, showTitle = false, size = "md" }: ApiKeyAv
186
189
  <UserPopoverPanel title={title} description={description}>
187
190
  <div className="flex flex-row items-center gap-2">
188
191
  {avatar}
189
- {showTitle && <div className="text-sm font-semibold pl-2">{data?.name || data?.account || data?.project || "unknown"}</div>}
192
+ {showTitle && <div className="text-sm font-semibold">{data?.name || data?.account || data?.project || "unknown"}</div>}
190
193
  </div>
191
194
  </UserPopoverPanel >
192
195
  )
@@ -206,7 +209,7 @@ function UserPopoverPanel({ title, description, children }: UserPopoverPanelProp
206
209
  <PopoverContent align="center" sideOffset={8} side="right">
207
210
  <div className="flex flex-col gap-1 rounded-md shadow-md p-2">
208
211
  <div className='text-md font-semibold'>{title}</div>
209
- <div>{description}</div>
212
+ {description}
210
213
  </div>
211
214
  </PopoverContent>
212
215
  </Popover>
@@ -12,7 +12,7 @@ export function FullHeightLayout({ className, children }: FlexibleHeightLayoutPr
12
12
  "flex flex-col",
13
13
  "h-full",
14
14
  "overflow-y-auto",
15
- // "dark:bg-slate-900 text-slate-950 dark:text-slate-200",
15
+ "px-2",
16
16
  className
17
17
  )}
18
18
  >
@@ -50,7 +50,7 @@ FullHeightLayout.Body = function Body({ className, children }: BodyProps) {
50
50
  className={clsx(
51
51
  "grow overflow-auto",
52
52
  "min-h-0",
53
- "px-4 py-2",
53
+ "p-2",
54
54
  className
55
55
  )}
56
56
  >
@@ -70,8 +70,8 @@ export interface NavigateOptions {
70
70
 
71
71
  function getElementHrefAsUrl(elem: HTMLElement) {
72
72
  if (elem && elem.tagName.toLowerCase() === 'a') {
73
- const href = (elem as HTMLAnchorElement).href;
74
- if (href != null) {
73
+ const href = (elem as HTMLAnchorElement)?.href.trim();
74
+ if (typeof href === 'string' && href.length > 0) {
75
75
  return new URL(href);
76
76
  }
77
77
  }
@@ -0,0 +1,41 @@
1
+ import { Transition } from "@headlessui/react";
2
+ import { Fragment, useEffect, useState } from "react";
3
+ import { useUserSession } from "@vertesia/ui/session";
4
+
5
+
6
+ interface SplashScreenProps {
7
+ }
8
+ export function SplashScreen({ }: SplashScreenProps) {
9
+ const { isLoading } = useUserSession();
10
+ const [show, setShow] = useState(true);
11
+
12
+ useEffect(() => {
13
+ if (!isLoading) {
14
+ setShow(false)
15
+ }
16
+ // setTimeout(() => {
17
+ // setShow(false)
18
+ // }, 2000)
19
+ }, [isLoading])
20
+
21
+ // 300 500 700 1000
22
+ return (
23
+ <Transition
24
+ appear={true}
25
+ show={show}
26
+ as={Fragment}
27
+ unmount
28
+ leave="transition ease-in duration-500"
29
+ leaveFrom="opacity-100"
30
+ leaveTo="opacity-0"
31
+ >
32
+ <div style={{ zIndex: 999999 }} className='fixed inset-x-0 inset-y-0'>
33
+ <div className="flex w-full h-full items-center justify-center">
34
+ <div className="animate-[spin_4s_linear_infinite]">
35
+ <img src='/icon.svg' className='w-10 h-auto animate-pulse rounded-full' />
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </Transition>
40
+ )
41
+ }
@@ -0,0 +1,27 @@
1
+ import { ThemeProvider, ToastProvider } from "@vertesia/ui/core";
2
+ import { UserPermissionProvider } from "@vertesia/ui/features";
3
+ import { UserSessionProvider } from "@vertesia/ui/session";
4
+ import { SplashScreen } from "./SplashScreen";
5
+ import { SigninScreen } from "./login/SigninScreen";
6
+
7
+
8
+ interface VertesiaShellProps {
9
+ children: React.ReactNode;
10
+ lightLogo?: string;
11
+ darkLogo?: string;
12
+ }
13
+ export function VertesiaShell({ children, lightLogo, darkLogo }: VertesiaShellProps) {
14
+ return (
15
+ <ToastProvider>
16
+ <UserSessionProvider>
17
+ <ThemeProvider defaultTheme="system" storageKey="vite-ui-theme">
18
+ <SplashScreen />
19
+ <SigninScreen allowedPrefix="/shared/" lightLogo={lightLogo} darkLogo={darkLogo} />
20
+ <UserPermissionProvider>
21
+ {children}
22
+ </UserPermissionProvider>
23
+ </ThemeProvider>
24
+ </UserSessionProvider>
25
+ </ToastProvider>
26
+ )
27
+ }
@@ -0,0 +1,6 @@
1
+ export * from './login/InviteAcceptModal';
2
+ export * from "./login/SigninScreen";
3
+ export * from "./login/TerminalLogin";
4
+ export * from "./login/UserSessionMenu";
5
+ export * from "./utils";
6
+ export * from './VertesiaShell';
@@ -0,0 +1,106 @@
1
+ import { Button, Input, Spinner, useToast } from "@vertesia/ui/core";
2
+ import { Env } from "@vertesia/ui/env";
3
+ import { getFirebaseAuth, setFirebaseTenant, useUXTracking } from "@vertesia/ui/session";
4
+ import { GoogleAuthProvider, OAuthProvider, signInWithRedirect } from "firebase/auth";
5
+ import { useState } from "react";
6
+
7
+
8
+ function getProvider(redirectTo?: string) {
9
+ const providerType = Env.firebase.providerType;
10
+ switch (providerType) {
11
+ case "oidc":
12
+ return new OAuthProvider("oidc.main");
13
+ case "google": {
14
+ let redirectPath = redirectTo || window.location.pathname || '/';
15
+ if (redirectPath[0] !== '/') {
16
+ redirectPath = '/' + redirectPath;
17
+ }
18
+ const provider = new GoogleAuthProvider();
19
+ provider.addScope('profile');
20
+ provider.addScope('email');
21
+ provider.setCustomParameters({
22
+ prompt: 'select_account',
23
+ redirect_uri: window.location.origin + redirectPath
24
+ });
25
+ return provider;
26
+ }
27
+ case "microsoft":
28
+ return new OAuthProvider("microsoft.com");
29
+ case "github":
30
+ return new OAuthProvider("github.com");
31
+ default:
32
+ return new OAuthProvider("oidc.main");
33
+ }
34
+ }
35
+
36
+ interface EnterpriseSigninButtonProps {
37
+ redirectTo?: string;
38
+ }
39
+ export default function EnterpriseSigninButton({ redirectTo }: EnterpriseSigninButtonProps) {
40
+ const [isLoading, setIsLoading] = useState(false);
41
+ const { trackEvent } = useUXTracking();
42
+
43
+ const [email, setEmail] = useState<string | undefined>("");
44
+ const toast = useToast();
45
+
46
+ const signIn = async () => {
47
+ if (!email) return;
48
+
49
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
50
+ if (!emailRegex.test(email)) {
51
+ toast({
52
+ title: "Invalid email address",
53
+ status: "error",
54
+ duration: 5000,
55
+ });
56
+ return;
57
+ }
58
+ // Env.firebase.tenantEmail = email;
59
+ setIsLoading(true);
60
+ setFirebaseTenant(email).then((data) => {
61
+ if (!data) {
62
+ toast({
63
+ title: "Tenant not found",
64
+ status: "error",
65
+ duration: 5000,
66
+ });
67
+ setIsLoading(false);
68
+ return;
69
+ }
70
+ localStorage.setItem("tenantName", data.name ?? "");
71
+ const provider = getProvider(redirectTo);
72
+ trackEvent("enterprise_signin", {
73
+ firebaseTenantName: data.name,
74
+ });
75
+ Env.logger.info('Enterprise single sign-in', {
76
+ vertesia: {
77
+ email: email,
78
+ firebaseTenantName: data.name,
79
+ firebaseTenantId: data.firebaseTenantId,
80
+ },
81
+ });
82
+
83
+ signInWithRedirect(getFirebaseAuth(), provider);
84
+ setIsLoading(false);
85
+ });
86
+ };
87
+
88
+ return (
89
+ <>
90
+ <Input value={email} onChange={setEmail} placeholder="Enter your enterprise email" type="email" />
91
+ {
92
+ isLoading ? (
93
+ <div className="w-full flex justify-center">
94
+ <Spinner />
95
+ </div>
96
+ ) : (
97
+ <Button variant={"outline"}
98
+ onClick={signIn}
99
+ className="w-full mt-2 py-4 flex rounded-lg hover:shadow-sm transition duration-150 text-center">
100
+ <span className="text-sm font-semibold">Continue with Enterprise SSO</span>
101
+ </Button>
102
+ )
103
+ }
104
+ </>
105
+ );
106
+ }
@@ -0,0 +1,40 @@
1
+ import { GithubAuthProvider, signInWithRedirect } from "firebase/auth";
2
+ import { getFirebaseAuth } from "@vertesia/ui/session";
3
+ import { Button } from "@vertesia/ui/core";
4
+
5
+ interface GitHubSignInButtonProps {
6
+ redirectTo?: string;
7
+ }
8
+ export default function GitHubSignInButton({ }: GitHubSignInButtonProps) {
9
+ const signIn = () => {
10
+ localStorage.removeItem("tenantName");
11
+ //with github can only have one allowed redirect
12
+ const baseUrl = "https://dengenlabs.firebaseapp.com/__/auth/handler";
13
+ let redirectPath = baseUrl + window.location.pathname;
14
+ if (redirectPath[0] !== "/") {
15
+ redirectPath = "/" + redirectPath;
16
+ }
17
+ const provider = new GithubAuthProvider();
18
+ provider.addScope("profile");
19
+ provider.addScope("email");
20
+ /*provider.setCustomParameters({
21
+ redirect_uri: redirectPath,
22
+ });*/
23
+ signInWithRedirect(getFirebaseAuth(), provider);
24
+ };
25
+
26
+ return (
27
+ <Button variant={"outline"}
28
+ onClick={signIn}
29
+ className="w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2">
30
+ {/* <Github className="size-6" /> */}
31
+ <img
32
+ className="size-6 bg-white rounded-full"
33
+ src="https://www.svgrepo.com/show/503359/github.svg"
34
+ loading="lazy"
35
+ alt="github logo"
36
+ />
37
+ <span className="text-sm font-semibold">Continue with GitHub</span>
38
+ </Button>
39
+ );
40
+ }
@@ -0,0 +1,36 @@
1
+ import { GoogleAuthProvider, signInWithRedirect } from "firebase/auth";
2
+ import { getFirebaseAuth } from "@vertesia/ui/session";
3
+ import { Button } from "@vertesia/ui/core";
4
+
5
+ interface GoogleSignInButtonProps {
6
+ redirectTo?: string;
7
+ }
8
+ export default function GoogleSignInButton({ redirectTo }: GoogleSignInButtonProps) {
9
+
10
+ const signIn = () => {
11
+ localStorage.removeItem("tenantName");
12
+ let redirectPath = redirectTo || window.location.pathname || '/';
13
+ if (redirectPath[0] !== '/') {
14
+ redirectPath = '/' + redirectPath;
15
+ }
16
+ const provider = new GoogleAuthProvider();
17
+ provider.addScope('profile');
18
+ provider.addScope('email');
19
+ // always ask to select the google account
20
+ //console.log('redirectPath', window.location.origin + redirectPath)
21
+ provider.setCustomParameters({
22
+ prompt: 'select_account',
23
+ redirect_uri: window.location.origin + redirectPath
24
+ });
25
+ signInWithRedirect(getFirebaseAuth(), provider);
26
+ };
27
+
28
+ return (
29
+ <Button variant={"outline"}
30
+ onClick={signIn}
31
+ className="w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center mb-2">
32
+ <img className="size-6" src="https://www.svgrepo.com/show/475656/google-color.svg" loading="lazy" alt="google logo" />
33
+ <span className="text-sm font-semibold">Continue with Google</span>
34
+ </Button>
35
+ );
36
+ }
@@ -0,0 +1,78 @@
1
+ import { TransientToken, UserInviteTokenData } from "@vertesia/common"
2
+ import { Button, Modal, ModalBody, ModalTitle } from "@vertesia/ui/core"
3
+ import { useEffect, useState } from "react"
4
+ import { useUserSession } from "@vertesia/ui/session"
5
+
6
+
7
+ export function InviteAcceptModal() {
8
+
9
+ const session = useUserSession()
10
+ const { client, account } = session;
11
+ const [showModal, setShowModal] = useState(false)
12
+ const [invites, setInvites] = useState<TransientToken<UserInviteTokenData>[]>([])
13
+
14
+ useEffect(() => {
15
+ client.account.listInvites().then(invites => {
16
+ if (invites.length > 0) {
17
+ console.log("Got invites - showing modal")
18
+ setInvites(invites)
19
+ /*toast({
20
+ status: 'info',
21
+ title: 'You have pending invites',
22
+ description: 'Click the button on the top right to review them.'
23
+ })*/
24
+ setShowModal(true);
25
+ }
26
+ })
27
+ }, [account?.id])
28
+
29
+ const closeModal = () => setShowModal(false)
30
+
31
+ const accept = async (invite: TransientToken<UserInviteTokenData>) => {
32
+ await client.account.acceptInvite(invite.id);
33
+ await session.fetchAccounts();
34
+ const remainingInvites = invites.filter(i => i.id !== invite.id)
35
+ setInvites(remainingInvites)
36
+ if (remainingInvites.length === 0) {
37
+ closeModal();
38
+ }
39
+ }
40
+
41
+ const reject = async (invite: TransientToken<UserInviteTokenData>) => {
42
+ await client.account.rejectInvite(invite.id)
43
+ const remainingInvites = invites.filter(i => i.id !== invite.id)
44
+ setInvites(remainingInvites)
45
+ if (remainingInvites.length === 0) {
46
+ closeModal();
47
+ }
48
+ }
49
+
50
+ const inviteList = invites.map(invite => (
51
+ <div key={invite.id} className="flex flex-row w-full justify-between border rounded-sm px-2 py-2 ">
52
+ <div className="flex flex-col">
53
+ <div className="w-full font-semibold">{invite.data.account.name}</div>
54
+ <div className="text-xs">Role: {invite.data.role}</div>
55
+ <div className="text-xs">by {invite.data.invitedBy.name}</div>
56
+ </div>
57
+ <div className="flex flex-col gap-4">
58
+ <Button size={'xs'} onClick={() => accept(invite)}>Accept</Button> <Button size={'xs'} variant="secondary" onClick={() => reject(invite)}>Reject</Button>
59
+ </div>
60
+ </div>
61
+ ))
62
+
63
+ return (
64
+ <div>
65
+ <Modal isOpen={showModal} onClose={closeModal}>
66
+ <ModalTitle>Review Invites</ModalTitle>
67
+ <ModalBody>
68
+ <div className="text-sm pb-4">
69
+ You have received the following invites to join other accounts.
70
+ Please review and accept or declined them.
71
+ </div>
72
+ {inviteList}
73
+ </ModalBody>
74
+ </Modal>
75
+ </div>
76
+ )
77
+
78
+ }
@@ -0,0 +1,30 @@
1
+ import { OAuthProvider, signInWithRedirect } from "firebase/auth";
2
+ import { getFirebaseAuth } from "@vertesia/ui/session";
3
+ import { Button } from "@vertesia/ui/core";
4
+
5
+ interface GoogleSignInButtonProps {
6
+ redirectTo?: string;
7
+ }
8
+ export default function MicrosoftSignInButton({ redirectTo }: GoogleSignInButtonProps) {
9
+
10
+ const signIn = () => {
11
+ localStorage.removeItem("tenantName");
12
+ let redirectPath = redirectTo || window.location.pathname || '/';
13
+ if (redirectPath[0] !== '/') {
14
+ redirectPath = '/' + redirectPath;
15
+ }
16
+ const provider = new OAuthProvider('microsoft.com');
17
+ provider.addScope('profile');
18
+ provider.addScope('email');
19
+ signInWithRedirect(getFirebaseAuth(), provider);
20
+ };
21
+
22
+ return (
23
+ <Button variant={"outline"}
24
+ onClick={signIn}
25
+ className="w-full py-5 flex rounded-lg hover:shadow-sm transition duration-150 text-center">
26
+ <img className="size-6" src="https://learn.microsoft.com/en-us/entra/identity-platform/media/howto-add-branding-in-apps/ms-symbollockup_mssymbol_19.svg" loading="lazy" alt="microsoft logo" />
27
+ <span className="text-sm font-semibold">Continue with Microsoft</span>
28
+ </Button>
29
+ );
30
+ }
@@ -0,0 +1,29 @@
1
+ import { SvgIcon } from "@vertesia/ui/widgets";
2
+
3
+ interface PreviewIconProps {
4
+ className?: string;
5
+ }
6
+ export function PreviewIcon({ className }: PreviewIconProps) {
7
+ return (
8
+ <SvgIcon content={SVG} className={className} />
9
+ )
10
+ }
11
+
12
+
13
+ const SVG = `
14
+ <?xml version="1.0"?>
15
+ <svg fill="none" height="48" viewBox="0 0 48 48" width="48" xmlns="http://www.w3.org/2000/svg">
16
+ <rect fill="white" fill-opacity="0.01" height="48" width="48" />
17
+ <path
18
+ d="M6 16C6.63472 17.2193 7.59646 18.3504 8.82276 19.3554C12.261 22.1733 17.779 24 24 24C30.221 24 35.739 22.1733 39.1772 19.3554C40.4035 18.3504 41.3653 17.2193 42 16"
19
+ stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="4" />
20
+ <path d="M28.9777 24L31.0482 31.7274" stroke="currentColor" stroke-linecap="round"
21
+ stroke-linejoin="round" stroke-width="4" />
22
+ <path d="M37.3535 21.3536L43.0104 27.0104" stroke="currentColor" stroke-linecap="round"
23
+ stroke-linejoin="round" stroke-width="4" />
24
+ <path d="M4.99998 27.0104L10.6568 21.3536" stroke="currentColor" stroke-linecap="round"
25
+ stroke-linejoin="round" stroke-width="4" />
26
+ <path d="M16.9276 31.7274L18.9982 24" stroke="currentColor" stroke-linecap="round"
27
+ stroke-linejoin="round" stroke-width="4" />
28
+ </svg>
29
+ `;
@@ -0,0 +1,28 @@
1
+ import { Button, Modal, ModalBody, ModalFooter, ModalTitle } from "@vertesia/ui/core";
2
+ import GitHubSignInButton from "./GitHubSignInButton";
3
+ import GoogleSignInButton from "./GoogleSignInButton";
4
+ import MicrosoftSignInButton from "./MicrosoftSigninButton";
5
+
6
+
7
+
8
+ interface SignInModalProps {
9
+ isOpen: boolean;
10
+ onClose: () => void;
11
+ }
12
+ export default function SignInModal({ isOpen, onClose }: SignInModalProps) {
13
+
14
+ return (
15
+ <Modal isOpen={isOpen} onClose={onClose}>
16
+ <ModalTitle>Sign In</ModalTitle>
17
+ <ModalBody className="flex justify-center">
18
+ <GoogleSignInButton />
19
+ <GitHubSignInButton />
20
+ <MicrosoftSignInButton />
21
+ </ModalBody>
22
+ <ModalFooter justify="end">
23
+ <Button variant="ghost" onClick={onClose}>Cancel</Button>
24
+ </ModalFooter>
25
+ </Modal>
26
+ );
27
+
28
+ }