@vetta-org/theme-ui 0.1.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 (406) hide show
  1. package/package.json +195 -0
  2. package/src/action-approval/AppearanceActionPickerView.tsx +291 -0
  3. package/src/action-approval/AppearanceApprovalDrawerView.tsx +69 -0
  4. package/src/action-approval/AppearancePickerApprovalView.tsx +31 -0
  5. package/src/action-approval/ApprovalParts.tsx +376 -0
  6. package/src/action-approval/BatchTasksApprovalFrameView.tsx +138 -0
  7. package/src/action-approval/BatchTasksExecutionApprovalView.tsx +158 -0
  8. package/src/action-approval/BatchTasksTaskApprovalView.tsx +152 -0
  9. package/src/action-approval/GeneralSetExecutionModeApprovalView.tsx +76 -0
  10. package/src/action-approval/GenericActionApprovalView.tsx +127 -0
  11. package/src/action-approval/ManageActionApprovalFrameTypes.ts +27 -0
  12. package/src/action-approval/ManageActionApprovalFrameView.tsx +136 -0
  13. package/src/action-approval/NavigationOpenApprovalView.tsx +119 -0
  14. package/src/action-approval/SchedulerActionApprovalDialogView.tsx +191 -0
  15. package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +113 -0
  16. package/src/action-approval/SchedulerUpdateApprovalView.tsx +14 -0
  17. package/src/action-approval/ThemeChangeApprovalView.tsx +30 -0
  18. package/src/action-approval/WebhookDeleteApprovalView.tsx +56 -0
  19. package/src/action-approval/WebhookTestApprovalView.tsx +51 -0
  20. package/src/action-approval/cn.ts +4 -0
  21. package/src/action-approval/index.ts +88 -0
  22. package/src/activity/ActivityPanel.tsx +269 -0
  23. package/src/activity/ActivityPanelFrame.tsx +36 -0
  24. package/src/activity/BackgroundTasksTabPanelView.tsx +382 -0
  25. package/src/activity/BatchProgressTabPanelView.tsx +22 -0
  26. package/src/activity/BrowserPanelView.tsx +169 -0
  27. package/src/activity/ChatTabPanelView.tsx +36 -0
  28. package/src/activity/CodePreview.tsx +57 -0
  29. package/src/activity/DebugTabPanelView.tsx +67 -0
  30. package/src/activity/FileTabContentView.tsx +46 -0
  31. package/src/activity/FloatingActivityTabView.tsx +107 -0
  32. package/src/activity/HtmlPreviewView.tsx +135 -0
  33. package/src/activity/JourneyPanelView.tsx +327 -0
  34. package/src/activity/KnowledgeHistoryPanelView.tsx +93 -0
  35. package/src/activity/MarkdownPreviewView.tsx +217 -0
  36. package/src/activity/PluginTabPickerView.tsx +182 -0
  37. package/src/activity/RequestHistorySubTabView.tsx +102 -0
  38. package/src/activity/ScheduleExecutionTabPanelView.tsx +162 -0
  39. package/src/activity/TodoTabPanelView.tsx +66 -0
  40. package/src/activity/ToolCallsSubTabView.tsx +184 -0
  41. package/src/activity/WorkflowTabPanelView.tsx +129 -0
  42. package/src/activity/index.ts +110 -0
  43. package/src/app/AppBackground.tsx +24 -0
  44. package/src/app/AppBootLoadingView.tsx +51 -0
  45. package/src/app/RouteContentLoadingView.tsx +20 -0
  46. package/src/app/index.ts +13 -0
  47. package/src/app-boot.ts +1 -0
  48. package/src/app-shell/DefaultPageHeader.tsx +46 -0
  49. package/src/app-shell/DefaultWindowControls.tsx +32 -0
  50. package/src/app-shell/PageHeaderActionGroup.tsx +15 -0
  51. package/src/app-shell/PageHeaderContent.tsx +70 -0
  52. package/src/app-shell/PageHeaderFrame.tsx +53 -0
  53. package/src/app-shell/PageHeaderSidebarTrigger.tsx +21 -0
  54. package/src/app-shell/PageHeaderTitle.tsx +25 -0
  55. package/src/app-shell/PageHeaderWindowActions.tsx +22 -0
  56. package/src/app-shell/WindowControlButton.tsx +35 -0
  57. package/src/app-shell/index.ts +49 -0
  58. package/src/appearance/BackgroundImageFrame.tsx +57 -0
  59. package/src/appearance/CenterSliceImageFrame.tsx +64 -0
  60. package/src/appearance/CornerImageFrame.tsx +63 -0
  61. package/src/appearance/HorizontalSliceImageFrame.tsx +97 -0
  62. package/src/appearance/NineSliceImageFrame.tsx +65 -0
  63. package/src/appearance/ThemeSurface.tsx +91 -0
  64. package/src/appearance/index.ts +12 -0
  65. package/src/batch-tasks/BatchProjectArtifactFieldView.tsx +36 -0
  66. package/src/batch-tasks/BatchProjectDialogView.tsx +61 -0
  67. package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +108 -0
  68. package/src/batch-tasks/BatchProjectGroupView.tsx +77 -0
  69. package/src/batch-tasks/BatchProjectNameFieldView.tsx +29 -0
  70. package/src/batch-tasks/BatchProjectNotificationFieldView.tsx +42 -0
  71. package/src/batch-tasks/BatchProjectRuntimeFieldsView.tsx +67 -0
  72. package/src/batch-tasks/BatchTaskActionButtonsView.tsx +67 -0
  73. package/src/batch-tasks/BatchTaskCardView.tsx +142 -0
  74. package/src/batch-tasks/BatchTaskGridView.tsx +95 -0
  75. package/src/batch-tasks/BatchTaskListView.tsx +10 -0
  76. package/src/batch-tasks/BatchTaskProjectActionsView.tsx +73 -0
  77. package/src/batch-tasks/BatchTaskProjectBlockView.tsx +117 -0
  78. package/src/batch-tasks/BatchTaskProjectHeaderView.tsx +74 -0
  79. package/src/batch-tasks/BatchTasksPageView.tsx +126 -0
  80. package/src/batch-tasks/batchTaskUi.tsx +101 -0
  81. package/src/batch-tasks/index.ts +70 -0
  82. package/src/batch-tasks/types.ts +120 -0
  83. package/src/chat/ActionButtonBarView.tsx +45 -0
  84. package/src/chat/AgentAvatarView.tsx +59 -0
  85. package/src/chat/AppshotCardView.tsx +89 -0
  86. package/src/chat/AskUserQuestionView.tsx +177 -0
  87. package/src/chat/AssistantMessageView.tsx +147 -0
  88. package/src/chat/AtPanelView.tsx +220 -0
  89. package/src/chat/BackgroundTasksBadgeView.tsx +28 -0
  90. package/src/chat/BashTerminalCard.tsx +225 -0
  91. package/src/chat/ChatExportHostView.tsx +17 -0
  92. package/src/chat/ChatHeaderActionsView.tsx +75 -0
  93. package/src/chat/ContextRingView.tsx +100 -0
  94. package/src/chat/CopyIconButton.tsx +61 -0
  95. package/src/chat/DefaultGuidingWords.tsx +75 -0
  96. package/src/chat/DefaultSceneCarousel.tsx +113 -0
  97. package/src/chat/DefaultSkillBadgeRow.tsx +103 -0
  98. package/src/chat/DrawerCard.tsx +149 -0
  99. package/src/chat/EditDiffView.tsx +137 -0
  100. package/src/chat/ExecutionModeSelectorView.tsx +124 -0
  101. package/src/chat/ExportMessageListView.tsx +20 -0
  102. package/src/chat/GuideBadgeSwiperView.tsx +79 -0
  103. package/src/chat/InlineTokenChip.tsx +68 -0
  104. package/src/chat/InputActionBarView.tsx +112 -0
  105. package/src/chat/InputBarBackground.tsx +25 -0
  106. package/src/chat/InputBarCapsule.tsx +56 -0
  107. package/src/chat/InputBarContextMenuView.tsx +79 -0
  108. package/src/chat/InputBarPlaceholder.tsx +84 -0
  109. package/src/chat/InputBarToolbarButton.tsx +42 -0
  110. package/src/chat/KnowledgeToolViews.tsx +119 -0
  111. package/src/chat/LiveThinkingView.tsx +102 -0
  112. package/src/chat/MessageActions.tsx +109 -0
  113. package/src/chat/MessageBlockSegmentsView.tsx +203 -0
  114. package/src/chat/MessageBoundaryViews.tsx +93 -0
  115. package/src/chat/MessageCardsView.tsx +126 -0
  116. package/src/chat/MessageFeedContext.tsx +14 -0
  117. package/src/chat/MessageFeedLayoutView.tsx +97 -0
  118. package/src/chat/MessageFeedView.tsx +228 -0
  119. package/src/chat/MessageInputView.tsx +193 -0
  120. package/src/chat/MessageLayoutView.tsx +156 -0
  121. package/src/chat/MessageListFooterView.tsx +127 -0
  122. package/src/chat/MessageSelectionContextMenuView.tsx +66 -0
  123. package/src/chat/MessageTimelineView.tsx +261 -0
  124. package/src/chat/MessageView.tsx +82 -0
  125. package/src/chat/MessageVisualView.tsx +43 -0
  126. package/src/chat/ModelSelectorView.tsx +407 -0
  127. package/src/chat/NewSession.ts +107 -0
  128. package/src/chat/NewSessionBackground.tsx +54 -0
  129. package/src/chat/NewSessionPageLayoutView.tsx +96 -0
  130. package/src/chat/NewSessionPicker.tsx +270 -0
  131. package/src/chat/ProgressGroupView.tsx +323 -0
  132. package/src/chat/ProjectSelectorView.tsx +253 -0
  133. package/src/chat/QueueCardView.tsx +151 -0
  134. package/src/chat/ReadImageView.tsx +73 -0
  135. package/src/chat/SandboxGrantsBadgeView.tsx +101 -0
  136. package/src/chat/SandboxPermissionCard.tsx +64 -0
  137. package/src/chat/SceneCard.tsx +138 -0
  138. package/src/chat/SendButton.tsx +135 -0
  139. package/src/chat/SessionDropZoneView.tsx +85 -0
  140. package/src/chat/SessionViewerPageView.tsx +56 -0
  141. package/src/chat/SkillCard.tsx +56 -0
  142. package/src/chat/SkillPromptAreaView.tsx +129 -0
  143. package/src/chat/SuggestionBubblesView.tsx +58 -0
  144. package/src/chat/TextBlockView.tsx +770 -0
  145. package/src/chat/TextPreview.tsx +37 -0
  146. package/src/chat/ThinkingBlockView.tsx +183 -0
  147. package/src/chat/TodoCard.tsx +243 -0
  148. package/src/chat/TodoProgress.tsx +205 -0
  149. package/src/chat/TodoStatusBarView.tsx +140 -0
  150. package/src/chat/ToolCallBlockView.tsx +188 -0
  151. package/src/chat/UsageBarView.tsx +19 -0
  152. package/src/chat/UserMessageContextMenuView.tsx +87 -0
  153. package/src/chat/UserMessageView.tsx +241 -0
  154. package/src/chat/WorkflowFooterItemsView.tsx +170 -0
  155. package/src/chat/WriteContentView.tsx +12 -0
  156. package/src/chat/index.ts +524 -0
  157. package/src/chat/markdown-link.test.ts +238 -0
  158. package/src/chat/markdown-link.ts +279 -0
  159. package/src/chat/send-button.css +318 -0
  160. package/src/chat/useHorizontalDragScroll.ts +146 -0
  161. package/src/file-explorer/ConfirmDeleteDialogView.tsx +62 -0
  162. package/src/file-explorer/FileContextMenuView.tsx +209 -0
  163. package/src/file-explorer/FileTreeCreateRow.tsx +82 -0
  164. package/src/file-explorer/FileTreeNodeView.tsx +274 -0
  165. package/src/file-explorer/FileTreeView.tsx +301 -0
  166. package/src/file-explorer/FilesPanelView.tsx +91 -0
  167. package/src/file-explorer/drag-target.test.ts +34 -0
  168. package/src/file-explorer/drag-target.ts +26 -0
  169. package/src/file-explorer/fileIcons.ts +1 -0
  170. package/src/file-explorer/index.ts +28 -0
  171. package/src/file-explorer/nativeFileDrag.test.ts +30 -0
  172. package/src/file-explorer/nativeFileDrag.ts +14 -0
  173. package/src/file-explorer/types.ts +40 -0
  174. package/src/file-explorer/useFileTreeMarqueeSelection.ts +115 -0
  175. package/src/file-preview/FilePreviewDialogView.tsx +241 -0
  176. package/src/file-preview/FilePreviewView.tsx +162 -0
  177. package/src/file-preview/LightboxImageView.tsx +131 -0
  178. package/src/file-preview/PluginFilePreviewView.tsx +24 -0
  179. package/src/file-preview/PreviewBodyView.tsx +99 -0
  180. package/src/file-preview/PreviewErrorBoundary.tsx +51 -0
  181. package/src/file-preview/TextCodeEditorView.tsx +72 -0
  182. package/src/file-preview/TextFileEditorView.tsx +213 -0
  183. package/src/file-preview/index.ts +56 -0
  184. package/src/file-preview/keyboard-target.test.ts +49 -0
  185. package/src/file-preview/keyboard-target.ts +33 -0
  186. package/src/file-preview/syntax-tokens.css +77 -0
  187. package/src/file-preview/syntax-tokens.test.ts +31 -0
  188. package/src/file-preview/syntax-tokens.ts +155 -0
  189. package/src/file-preview/text-code-editor-theme.ts +321 -0
  190. package/src/file-preview/text-editor-language.test.ts +58 -0
  191. package/src/file-preview/text-editor-language.ts +182 -0
  192. package/src/file-preview/types.ts +29 -0
  193. package/src/flowing/FlowingPanelView.tsx +79 -0
  194. package/src/flowing/FlowingWorkflowView.tsx +54 -0
  195. package/src/flowing/UserNodeView.tsx +148 -0
  196. package/src/flowing/WorkflowBindDialogView.tsx +145 -0
  197. package/src/flowing/WorkflowProgressView.tsx +149 -0
  198. package/src/flowing/index.ts +27 -0
  199. package/src/flowing-chat/ChatBubbleView.tsx +219 -0
  200. package/src/flowing-chat/ChatComposerView.tsx +362 -0
  201. package/src/flowing-chat/ChatMembersBarView.tsx +86 -0
  202. package/src/flowing-chat/ChatPanelView.tsx +73 -0
  203. package/src/flowing-chat/index.ts +21 -0
  204. package/src/index.ts +22 -0
  205. package/src/knowledge/KnowledgeBaseSwitcherView.tsx +154 -0
  206. package/src/knowledge/KnowledgeBreadcrumbView.tsx +92 -0
  207. package/src/knowledge/KnowledgeContentsPanelView.tsx +77 -0
  208. package/src/knowledge/KnowledgeContextMenuView.tsx +70 -0
  209. package/src/knowledge/KnowledgeFilesSkeleton.tsx +22 -0
  210. package/src/knowledge/KnowledgeGridView.tsx +113 -0
  211. package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +85 -0
  212. package/src/knowledge/KnowledgeImportDialogView.tsx +153 -0
  213. package/src/knowledge/KnowledgeListView.tsx +107 -0
  214. package/src/knowledge/KnowledgePendingFilesDialogView.tsx +76 -0
  215. package/src/knowledge/KnowledgeProcessingBadgeView.tsx +18 -0
  216. package/src/knowledge/KnowledgeRenameDialogView.tsx +66 -0
  217. package/src/knowledge/KnowledgeSourcePickerView.tsx +60 -0
  218. package/src/knowledge/KnowledgeViewShared.tsx +103 -0
  219. package/src/knowledge/cn.ts +4 -0
  220. package/src/knowledge/coloredFileIcons.ts +1 -0
  221. package/src/knowledge/index.ts +66 -0
  222. package/src/knowledge/types.ts +31 -0
  223. package/src/knowledge/useMarqueeSelection.ts +95 -0
  224. package/src/layout/AppFrame.tsx +34 -0
  225. package/src/layout/MainContentFrame.tsx +54 -0
  226. package/src/layout/ResizeHandle.tsx +91 -0
  227. package/src/layout/SidebarDock.tsx +33 -0
  228. package/src/layout/SidebarOverlay.tsx +36 -0
  229. package/src/layout/index.ts +10 -0
  230. package/src/overlays/CommandMenuRow.tsx +119 -0
  231. package/src/overlays/CommandMenuView.tsx +183 -0
  232. package/src/overlays/ConfirmDialogView.tsx +109 -0
  233. package/src/overlays/DetailDrawer.tsx +63 -0
  234. package/src/overlays/DetailDrawerEnter.tsx +37 -0
  235. package/src/overlays/KnowledgeDropOverlayView.tsx +43 -0
  236. package/src/overlays/RouteErrorPageView.tsx +72 -0
  237. package/src/overlays/ToasterView.tsx +76 -0
  238. package/src/overlays/UpdateCheckerView.tsx +206 -0
  239. package/src/overlays/UpdateRestartDialogView.tsx +107 -0
  240. package/src/overlays/command-menu-types.ts +47 -0
  241. package/src/overlays/command-menu.css +69 -0
  242. package/src/overlays/detail-drawer-guard.test.ts +16 -0
  243. package/src/overlays/detail-drawer-guard.ts +13 -0
  244. package/src/overlays/index.ts +44 -0
  245. package/src/plugin-ui/index.ts +26 -0
  246. package/src/project/BatchQueueStatusView.tsx +352 -0
  247. package/src/project/ConversationTagDotsView.tsx +130 -0
  248. package/src/project/ConversationTagEditorDialogView.tsx +273 -0
  249. package/src/project/DefaultConversationSectionView.tsx +74 -0
  250. package/src/project/DefaultSessionListView.tsx +128 -0
  251. package/src/project/DefaultSessionRowView.tsx +125 -0
  252. package/src/project/NewProjectDialogView.tsx +140 -0
  253. package/src/project/ProjectContextMenuView.tsx +187 -0
  254. package/src/project/ProjectDetailPageView.tsx +351 -0
  255. package/src/project/ProjectGroupView.tsx +37 -0
  256. package/src/project/ProjectRowView.tsx +111 -0
  257. package/src/project/ProjectSessionsLoadingView.tsx +14 -0
  258. package/src/project/ProjectSessionsView.tsx +96 -0
  259. package/src/project/ProjectsLoadingView.tsx +15 -0
  260. package/src/project/ProjectsPanelMenusView.tsx +23 -0
  261. package/src/project/ProjectsPanelView.tsx +56 -0
  262. package/src/project/QuickScrollOverlay.tsx +188 -0
  263. package/src/project/ScheduleStatusView.tsx +110 -0
  264. package/src/project/SessionContextMenuView.tsx +71 -0
  265. package/src/project/SessionRenameInputView.tsx +49 -0
  266. package/src/project/SessionRowView.tsx +119 -0
  267. package/src/project/SidebarProjectsSectionView.tsx +35 -0
  268. package/src/project/index.ts +87 -0
  269. package/src/project/types.ts +21 -0
  270. package/src/project/useActiveSessionAutoScroll.ts +171 -0
  271. package/src/registry.ts +62 -0
  272. package/src/scheduler/AutomationPageView.tsx +159 -0
  273. package/src/scheduler/ExecutionHistoryView.tsx +179 -0
  274. package/src/scheduler/HistoryDrawerView.tsx +149 -0
  275. package/src/scheduler/TaskFormDialogView.tsx +60 -0
  276. package/src/scheduler/TaskListView.tsx +219 -0
  277. package/src/scheduler/index.ts +30 -0
  278. package/src/settings/AchievementNavigationButtonView.tsx +90 -0
  279. package/src/settings/AchievementPromotionDialogView.tsx +91 -0
  280. package/src/settings/AchievementSettingsView.tsx +44 -0
  281. package/src/settings/AppshotSettingsView.tsx +132 -0
  282. package/src/settings/ArchivedProjectsSettingsView.tsx +80 -0
  283. package/src/settings/BuiltinMcpSecretsDialogView.tsx +278 -0
  284. package/src/settings/BuiltinMcpSectionView.tsx +164 -0
  285. package/src/settings/EnvironmentSettingsView.tsx +176 -0
  286. package/src/settings/GeneralSettingsView.tsx +174 -0
  287. package/src/settings/ImChannelCardView.tsx +152 -0
  288. package/src/settings/ImChannelGuideDialogView.tsx +126 -0
  289. package/src/settings/ImFeishuDialogView.tsx +156 -0
  290. package/src/settings/ImLegacyImportBannerView.tsx +44 -0
  291. package/src/settings/ImLogDrawerView.tsx +75 -0
  292. package/src/settings/ImStatusBadgeView.tsx +39 -0
  293. package/src/settings/McpDefaultIcon.tsx +27 -0
  294. package/src/settings/McpJsonEditorView.tsx +56 -0
  295. package/src/settings/ModelsProviderFormView.tsx +128 -0
  296. package/src/settings/ModelsProvidersSectionView.tsx +52 -0
  297. package/src/settings/MotionSelect.tsx +125 -0
  298. package/src/settings/PermissionsSettingsView.tsx +106 -0
  299. package/src/settings/PetBubbleStylePreviewView.tsx +44 -0
  300. package/src/settings/PetSettingsView.tsx +165 -0
  301. package/src/settings/PresetProviderModelsListView.tsx +58 -0
  302. package/src/settings/PresetProviderRowView.tsx +302 -0
  303. package/src/settings/PresetProvidersSectionView.tsx +70 -0
  304. package/src/settings/QrBindDialogView.tsx +165 -0
  305. package/src/settings/QuickPanelSettingsSectionView.tsx +66 -0
  306. package/src/settings/RemoteMcpSectionView.tsx +192 -0
  307. package/src/settings/SettingChrome.tsx +104 -0
  308. package/src/settings/SettingsAiAssistButtonView.tsx +150 -0
  309. package/src/settings/SettingsAiAssistDialogView.tsx +251 -0
  310. package/src/settings/SettingsFormFields.tsx +121 -0
  311. package/src/settings/SettingsPageShellView.tsx +84 -0
  312. package/src/settings/SettingsSidebarView.tsx +133 -0
  313. package/src/settings/ShortcutRecorderView.tsx +88 -0
  314. package/src/settings/ShortcutsSettingsView.tsx +66 -0
  315. package/src/settings/SubscriptionActionsView.tsx +63 -0
  316. package/src/settings/SubscriptionCardsView.tsx +212 -0
  317. package/src/settings/TeamDetailView.tsx +148 -0
  318. package/src/settings/TeamDialogsView.tsx +151 -0
  319. package/src/settings/TeamListView.tsx +57 -0
  320. package/src/settings/TeamSettingsView.tsx +51 -0
  321. package/src/settings/TokenActivityChartView.tsx +286 -0
  322. package/src/settings/UsageStatsView.tsx +101 -0
  323. package/src/settings/WebhookEndpointListView.tsx +123 -0
  324. package/src/settings/WechatBindDialogView.tsx +45 -0
  325. package/src/settings/achievements/AchievementCurtains.tsx +50 -0
  326. package/src/settings/achievements/AchievementPromotionBadge3D.tsx +350 -0
  327. package/src/settings/achievements/AchievementPromotionConfetti.tsx +71 -0
  328. package/src/settings/achievements/AchievementTitle.tsx +52 -0
  329. package/src/settings/achievements/index.ts +13 -0
  330. package/src/settings/index.ts +226 -0
  331. package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +135 -0
  332. package/src/settings/shouldCloseEmptyApiKeyEditor.ts +40 -0
  333. package/src/settings/token-activity.test.ts +195 -0
  334. package/src/settings/token-activity.ts +320 -0
  335. package/src/shared/AvatarStackView.tsx +45 -0
  336. package/src/shared/BotAvatar.tsx +395 -0
  337. package/src/shared/CodeBlockCopyButton.tsx +48 -0
  338. package/src/shared/CollapsePanel.tsx +125 -0
  339. package/src/shared/ContextMenuView.tsx +134 -0
  340. package/src/shared/MacKeyboardPreview.tsx +260 -0
  341. package/src/shared/MarkdownTable.tsx +216 -0
  342. package/src/shared/MultiplierTag.tsx +15 -0
  343. package/src/shared/ScrollFade.tsx +114 -0
  344. package/src/shared/SegmentedControl.tsx +82 -0
  345. package/src/shared/SyntaxHighlightedCode.tsx +0 -0
  346. package/src/shared/TabBar.tsx +696 -0
  347. package/src/shared/TimePicker.tsx +96 -0
  348. package/src/shared/connected-tab-outline.test.ts +22 -0
  349. package/src/shared/connected-tab-outline.ts +39 -0
  350. package/src/shared/fileIcons.test.ts +28 -0
  351. package/src/shared/fileIcons.ts +322 -0
  352. package/src/shared/index.ts +38 -0
  353. package/src/shared/markdown-table-clipboard.ts +31 -0
  354. package/src/shared/provider-icon/icons.ts +56 -0
  355. package/src/shared/provider-icon/index.tsx +42 -0
  356. package/src/shared/provider-icon/svg-url.d.ts +4 -0
  357. package/src/shared/tab-drag.test.ts +14 -0
  358. package/src/shared/tab-drag.ts +15 -0
  359. package/src/shared/useDelayedUnmount.ts +36 -0
  360. package/src/sidebar/AddProjectMenuItem.tsx +21 -0
  361. package/src/sidebar/AddProjectMenuPopoverView.tsx +52 -0
  362. package/src/sidebar/AddProjectMenuTriggerView.tsx +50 -0
  363. package/src/sidebar/ChatMessageListView.tsx +66 -0
  364. package/src/sidebar/DefaultSidebar.tsx +91 -0
  365. package/src/sidebar/FlowingMessageListView.tsx +111 -0
  366. package/src/sidebar/MessageCenterDialogView.tsx +81 -0
  367. package/src/sidebar/MessageCenterEmptyState.tsx +24 -0
  368. package/src/sidebar/MessageCenterTabs.tsx +86 -0
  369. package/src/sidebar/MessageCenterToolbarButton.tsx +25 -0
  370. package/src/sidebar/MessageCenterTriggerView.tsx +39 -0
  371. package/src/sidebar/NotificationMessageListView.tsx +136 -0
  372. package/src/sidebar/ProjectsPanelEmptyState.tsx +20 -0
  373. package/src/sidebar/RunningPulseDot.tsx +10 -0
  374. package/src/sidebar/SessionStatusIcon.tsx +43 -0
  375. package/src/sidebar/SettingsMenuAccountSection.tsx +32 -0
  376. package/src/sidebar/SettingsMenuActionButton.tsx +24 -0
  377. package/src/sidebar/SettingsMenuDivider.tsx +5 -0
  378. package/src/sidebar/SettingsMenuQuotaSection.tsx +45 -0
  379. package/src/sidebar/SettingsMenuSettingsItem.tsx +18 -0
  380. package/src/sidebar/SettingsMenuThemeSection.tsx +51 -0
  381. package/src/sidebar/SettingsMenuTriggerView.tsx +65 -0
  382. package/src/sidebar/ShowMoreSessionsButton.tsx +37 -0
  383. package/src/sidebar/SidebarFilterSelectView.tsx +95 -0
  384. package/src/sidebar/SidebarNavBadgeView.tsx +58 -0
  385. package/src/sidebar/SidebarNavIcon.tsx +33 -0
  386. package/src/sidebar/SidebarNavItemButton.tsx +59 -0
  387. package/src/sidebar/SidebarNavMorePanel.tsx +199 -0
  388. package/src/sidebar/SidebarNavigation.tsx +223 -0
  389. package/src/sidebar/SidebarPanel.tsx +48 -0
  390. package/src/sidebar/SidebarTopBar.tsx +103 -0
  391. package/src/sidebar/SidebarUpdateIcon.tsx +79 -0
  392. package/src/sidebar/index.ts +118 -0
  393. package/src/sidebar/nav-badge-text.test.ts +23 -0
  394. package/src/sidebar/nav-badge-text.ts +19 -0
  395. package/src/sidebar/useSidebarNavDrag.ts +139 -0
  396. package/src/skills/PluginCardView.tsx +150 -0
  397. package/src/skills/SceneCardView.tsx +194 -0
  398. package/src/skills/SkillCardView.tsx +186 -0
  399. package/src/skills/SkillDetailDialogView.tsx +138 -0
  400. package/src/skills/SkillTagGroupView.tsx +56 -0
  401. package/src/skills/SkillToggleSwitch.tsx +31 -0
  402. package/src/skills/index.ts +29 -0
  403. package/src/skills/skill-icon.test.ts +38 -0
  404. package/src/skills/skill-icon.tsx +126 -0
  405. package/src/styles.css +75 -0
  406. package/src/utils/platform.ts +2 -0
@@ -0,0 +1,152 @@
1
+ import type { ComponentType, JSX, ReactNode } from "react";
2
+ import { BatchTasksApprovalFrameView, type BatchTasksApprovalFrameViewProps } from "./BatchTasksApprovalFrameView";
3
+
4
+ export interface BatchTasksTaskApprovalViewProps {
5
+ readonly frame: Omit<BatchTasksApprovalFrameViewProps, "children">;
6
+ /** Host may inject themed frame via useThemeComponent("root.approval.batchTasksFrameView"). */
7
+ readonly Frame?: ComponentType<BatchTasksApprovalFrameViewProps>;
8
+ readonly hasInput: boolean;
9
+ readonly taskName: string;
10
+ readonly projectName: string;
11
+ readonly statusLabel?: string;
12
+ readonly sourceFolderLabel: string;
13
+ readonly sourcePath: string;
14
+ readonly taskIdLabel: string;
15
+ readonly taskId: string;
16
+ readonly relatedSessionLabel: string;
17
+ readonly relatedSessionValue: string;
18
+ readonly icon: string;
19
+ readonly afterActionTitle: string;
20
+ readonly description: string;
21
+ readonly showResumeText: boolean;
22
+ readonly resumeTextLabel: string;
23
+ readonly approvalId: string;
24
+ readonly resumeText: string;
25
+ readonly onResumeTextChange: (value: string) => void;
26
+ readonly lastError?: string | null;
27
+ readonly lastErrorLabel: string;
28
+ readonly warning?: string | null;
29
+ readonly rawInput: unknown;
30
+ /** Optional host override for resume field (defaults to native textarea). */
31
+ readonly resumeField?: ReactNode;
32
+ }
33
+
34
+ export function BatchTasksTaskApprovalView({
35
+ frame,
36
+ Frame = BatchTasksApprovalFrameView,
37
+ hasInput,
38
+ taskName,
39
+ projectName,
40
+ statusLabel,
41
+ sourceFolderLabel,
42
+ sourcePath,
43
+ taskIdLabel,
44
+ taskId,
45
+ relatedSessionLabel,
46
+ relatedSessionValue,
47
+ icon,
48
+ afterActionTitle,
49
+ description,
50
+ showResumeText,
51
+ resumeTextLabel,
52
+ approvalId,
53
+ resumeText,
54
+ onResumeTextChange,
55
+ lastError,
56
+ lastErrorLabel,
57
+ warning,
58
+ rawInput,
59
+ resumeField,
60
+ }: BatchTasksTaskApprovalViewProps): JSX.Element {
61
+ return (
62
+ <Frame {...frame}>
63
+ {hasInput && (
64
+ <>
65
+ <div className="rounded-lg border border-border/50 bg-background/50 p-3">
66
+ <div className="flex items-start gap-3">
67
+ <div className="flex h-8 w-8 shrink-0 items-center justify-center rounded-md bg-muted">
68
+ <span className="icon-[mdi--folder-outline] h-4 w-4 text-muted-foreground" />
69
+ </div>
70
+ <div className="min-w-0 flex-1">
71
+ <div className="truncate text-[12px] font-semibold text-foreground">{taskName}</div>
72
+ <div className="mt-0.5 truncate text-[10px] text-muted-foreground">{projectName}</div>
73
+ </div>
74
+ {statusLabel && (
75
+ <span className="shrink-0 rounded-full bg-muted px-2 py-1 text-[10px] font-medium text-muted-foreground">
76
+ {statusLabel}
77
+ </span>
78
+ )}
79
+ </div>
80
+ <div className="mt-3 space-y-2 border-t border-border/40 pt-3 text-[11px]">
81
+ <div className="flex items-start justify-between gap-4">
82
+ <span className="shrink-0 text-muted-foreground">{sourceFolderLabel}</span>
83
+ <span className="min-w-0 break-all text-right text-foreground">{sourcePath}</span>
84
+ </div>
85
+ <div className="flex items-start justify-between gap-4">
86
+ <span className="shrink-0 text-muted-foreground">{taskIdLabel}</span>
87
+ <span className="min-w-0 break-all text-right font-mono text-[10px] text-foreground">
88
+ {taskId}
89
+ </span>
90
+ </div>
91
+ <div className="flex items-center justify-between gap-4">
92
+ <span className="text-muted-foreground">{relatedSessionLabel}</span>
93
+ <span className="text-foreground">{relatedSessionValue}</span>
94
+ </div>
95
+ </div>
96
+ </div>
97
+
98
+ <div className="rounded-lg border border-primary/20 bg-primary/5 p-3">
99
+ <div className="flex gap-2">
100
+ <span className={`${icon} mt-0.5 h-4 w-4 shrink-0 text-primary`} />
101
+ <div>
102
+ <div className="text-[11px] font-semibold text-foreground">{afterActionTitle}</div>
103
+ <p className="mt-1 text-[11px] leading-5 text-muted-foreground">{description}</p>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ {showResumeText &&
109
+ (resumeField ?? (
110
+ <div className="rounded-lg border border-border/50 bg-background/50 p-3">
111
+ <label
112
+ className="mb-1.5 block text-[10px] font-medium uppercase tracking-wide text-muted-foreground"
113
+ htmlFor="batch-task-resume-text"
114
+ >
115
+ {resumeTextLabel}
116
+ </label>
117
+ <textarea
118
+ key={approvalId}
119
+ id="batch-task-resume-text"
120
+ value={resumeText}
121
+ onChange={(event) => onResumeTextChange(event.target.value)}
122
+ className="flex field-sizing-content min-h-16 w-full min-h-28 resize-y rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring md:text-sm dark:bg-input/30"
123
+ />
124
+ </div>
125
+ ))}
126
+
127
+ {lastError && (
128
+ <div className="rounded-lg border border-destructive/20 bg-destructive/5 p-3">
129
+ <div className="mb-1 text-[10px] font-medium text-destructive">{lastErrorLabel}</div>
130
+ <p className="max-h-24 overflow-auto whitespace-pre-wrap break-words text-[11px] leading-5 text-muted-foreground">
131
+ {lastError}
132
+ </p>
133
+ </div>
134
+ )}
135
+
136
+ {warning && (
137
+ <div className="flex gap-2 rounded-lg border border-destructive/30 bg-destructive/10 p-3 text-destructive">
138
+ <span className="icon-[mdi--alert-outline] mt-0.5 h-4 w-4 shrink-0" />
139
+ <p className="text-[11px] leading-5">{warning}</p>
140
+ </div>
141
+ )}
142
+ </>
143
+ )}
144
+
145
+ {!hasInput && (
146
+ <pre className="max-h-48 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border/50 bg-background/50 p-3 font-mono text-[10px] leading-4 text-foreground">
147
+ {JSON.stringify(rawInput, null, 2)}
148
+ </pre>
149
+ )}
150
+ </Frame>
151
+ );
152
+ }
@@ -0,0 +1,76 @@
1
+ import type { ComponentType, JSX, ReactNode } from "react";
2
+ import { cn } from "./cn";
3
+ import { ApprovalFormField, ApprovalImpactCard, ApprovalRawFallback, type ApprovalRawFallbackLabels } from "./ApprovalParts";
4
+ import type { ManageActionApprovalFrameProps } from "./ManageActionApprovalFrameTypes";
5
+
6
+ export type ExecutionModeOption = "sandbox" | "full-access";
7
+
8
+ export interface GeneralSetExecutionModeApprovalViewProps {
9
+ readonly Frame: ComponentType<ManageActionApprovalFrameProps>;
10
+ readonly frame: Omit<ManageActionApprovalFrameProps, "children">;
11
+ readonly hasInput: boolean;
12
+ readonly rawInput: unknown;
13
+ readonly rawFallbackLabels: ApprovalRawFallbackLabels;
14
+ readonly mode: ExecutionModeOption;
15
+ readonly modes: readonly ExecutionModeOption[];
16
+ readonly modeLabel: (mode: ExecutionModeOption) => string;
17
+ readonly modeHint: (mode: ExecutionModeOption) => string;
18
+ readonly executionModeFieldLabel: string;
19
+ readonly impactTitle: string;
20
+ readonly impactDescription: string;
21
+ readonly icon: string;
22
+ readonly onModeChange: (mode: ExecutionModeOption) => void;
23
+ readonly extra?: ReactNode;
24
+ }
25
+
26
+ export function GeneralSetExecutionModeApprovalView({
27
+ Frame,
28
+ frame,
29
+ hasInput,
30
+ rawInput,
31
+ rawFallbackLabels,
32
+ mode,
33
+ modes,
34
+ modeLabel,
35
+ modeHint,
36
+ executionModeFieldLabel,
37
+ impactTitle,
38
+ impactDescription,
39
+ icon,
40
+ onModeChange,
41
+ }: GeneralSetExecutionModeApprovalViewProps): JSX.Element {
42
+ return (
43
+ <Frame {...frame}>
44
+ {hasInput ? (
45
+ <>
46
+ <ApprovalFormField id="execution-mode" label={executionModeFieldLabel}>
47
+ <div className="grid grid-cols-1 gap-2">
48
+ {modes.map((candidate) => {
49
+ const active = mode === candidate;
50
+ return (
51
+ <button
52
+ key={candidate}
53
+ type="button"
54
+ onClick={() => onModeChange(candidate)}
55
+ className={cn(
56
+ "rounded-lg border px-3 py-2.5 text-left transition-colors",
57
+ active
58
+ ? "border-primary/70 bg-primary/5 ring-1 ring-inset ring-primary/30"
59
+ : "border-border hover:border-primary/40 hover:bg-accent/40",
60
+ )}
61
+ >
62
+ <div className="text-[12px] font-medium text-foreground">{modeLabel(candidate)}</div>
63
+ <div className="mt-0.5 text-[10px] text-muted-foreground">{modeHint(candidate)}</div>
64
+ </button>
65
+ );
66
+ })}
67
+ </div>
68
+ </ApprovalFormField>
69
+ <ApprovalImpactCard icon={icon} title={impactTitle} description={impactDescription} />
70
+ </>
71
+ ) : (
72
+ <ApprovalRawFallback input={rawInput} labels={rawFallbackLabels} />
73
+ )}
74
+ </Frame>
75
+ );
76
+ }
@@ -0,0 +1,127 @@
1
+ import { useState, type JSX } from "react";
2
+ import {
3
+ Button,
4
+ Dialog,
5
+ DialogContent,
6
+ DialogDescription,
7
+ DialogFooter,
8
+ DialogHeader,
9
+ DialogTitle,
10
+ } from "@vetta-org/ui";
11
+ import { ThemeSurface } from "../appearance/ThemeSurface";
12
+
13
+ export interface GenericActionApprovalField {
14
+ readonly label: string;
15
+ readonly value: string;
16
+ }
17
+
18
+ export interface GenericActionApprovalViewLabels {
19
+ readonly rejecting: string;
20
+ readonly responding: string;
21
+ readonly showTechnicalDetails: string;
22
+ readonly hideTechnicalDetails: string;
23
+ readonly impactTitle: string;
24
+ readonly impactDescription: string;
25
+ }
26
+
27
+ export interface GenericActionApprovalViewProps {
28
+ readonly confirmLabel: string;
29
+ readonly countdown: string;
30
+ readonly error: string | null;
31
+ readonly fields: readonly GenericActionApprovalField[];
32
+ readonly inputJson: string;
33
+ readonly labels: GenericActionApprovalViewLabels;
34
+ readonly onApprove: () => void;
35
+ readonly onReject: () => void;
36
+ readonly permissionLabel: string;
37
+ readonly responding: boolean;
38
+ readonly summary: string;
39
+ readonly title: string;
40
+ }
41
+
42
+ export function GenericActionApprovalView({
43
+ confirmLabel,
44
+ countdown,
45
+ error,
46
+ fields,
47
+ inputJson,
48
+ labels,
49
+ onApprove,
50
+ onReject,
51
+ permissionLabel,
52
+ responding,
53
+ summary,
54
+ title,
55
+ }: GenericActionApprovalViewProps): JSX.Element {
56
+ const [showTechnical, setShowTechnical] = useState(false);
57
+
58
+ return (
59
+ <Dialog open>
60
+ <DialogContent
61
+ className="max-h-[90vh] overflow-visible sm:max-w-[520px]"
62
+ showCloseButton={false}
63
+ onInteractOutside={(event) => event.preventDefault()}
64
+ >
65
+ <ThemeSurface slot="root.genericActionApproval.panel" />
66
+ <div className="relative z-10 grid min-h-0 gap-4">
67
+ <DialogHeader>
68
+ <DialogTitle>{title}</DialogTitle>
69
+ <DialogDescription>{summary}</DialogDescription>
70
+ </DialogHeader>
71
+ <div className="min-h-0 space-y-3 overflow-y-auto">
72
+ {fields.length > 0 ? (
73
+ <div className="rounded-lg border border-border/50 bg-background/50 px-3">
74
+ {fields.map((field, index) => (
75
+ <div key={`${field.label}-${index}`}>
76
+ {index > 0 && <div className="h-px bg-border/40" />}
77
+ <div className="flex items-start justify-between gap-4 py-1.5">
78
+ <span className="shrink-0 text-[11px] text-muted-foreground">
79
+ {field.label}
80
+ </span>
81
+ <span className="min-w-0 break-words text-right text-[11px] font-medium text-foreground">
82
+ {field.value}
83
+ </span>
84
+ </div>
85
+ </div>
86
+ ))}
87
+ </div>
88
+ ) : null}
89
+
90
+ <div className="rounded-lg border border-primary/20 bg-primary/5 p-3">
91
+ <div className="text-[11px] font-semibold text-foreground">{labels.impactTitle}</div>
92
+ <p className="mt-1 text-[11px] leading-5 text-muted-foreground">
93
+ {labels.impactDescription}
94
+ </p>
95
+ </div>
96
+
97
+ <div>
98
+ <button
99
+ type="button"
100
+ className="text-[11px] font-medium text-primary hover:underline"
101
+ onClick={() => setShowTechnical((value) => !value)}
102
+ >
103
+ {showTechnical ? labels.hideTechnicalDetails : labels.showTechnicalDetails}
104
+ </button>
105
+ {showTechnical && (
106
+ <pre className="mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border/50 bg-background/50 p-3 font-mono text-[10px] leading-4 text-foreground">
107
+ {inputJson}
108
+ </pre>
109
+ )}
110
+ </div>
111
+
112
+ <div className="text-[11px] text-muted-foreground">{permissionLabel}</div>
113
+ {error && <div className="text-[11px] text-destructive">{error}</div>}
114
+ </div>
115
+ <DialogFooter>
116
+ <Button variant="outline" size="sm" disabled={responding} onClick={onReject}>
117
+ {labels.rejecting}({countdown})
118
+ </Button>
119
+ <Button size="sm" disabled={responding} onClick={onApprove}>
120
+ {responding ? labels.responding : confirmLabel}
121
+ </Button>
122
+ </DialogFooter>
123
+ </div>
124
+ </DialogContent>
125
+ </Dialog>
126
+ );
127
+ }
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ export interface ManageActionApprovalFrameLabels {
4
+ readonly reject: string;
5
+ readonly confirm: string;
6
+ readonly responding: string;
7
+ readonly permission: string;
8
+ }
9
+
10
+ /** Shared frame props for manage approval shells (host Dialog/Drawer injects via Frame slot). */
11
+ export interface ManageActionApprovalFrameProps {
12
+ readonly presentation: "dialog" | "drawer";
13
+ readonly title: string;
14
+ readonly summary: string;
15
+ readonly icon: string;
16
+ readonly badge?: string;
17
+ readonly destructive?: boolean;
18
+ readonly labels: ManageActionApprovalFrameLabels;
19
+ readonly responding: boolean;
20
+ readonly countdown: string;
21
+ readonly canApprove?: boolean;
22
+ readonly error?: string | null;
23
+ readonly onReject: () => void;
24
+ readonly onApprove: () => void;
25
+ readonly children: ReactNode;
26
+ readonly className?: string;
27
+ }
@@ -0,0 +1,136 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import { Button, Dialog, DialogContent, Drawer, DrawerContent, cn } from "@vetta-org/ui";
3
+ import { ThemeSurface } from "../appearance/ThemeSurface";
4
+
5
+ /**
6
+ * 领域 manage 审批外壳,视觉与交互对齐 BatchTasksApprovalFrameView:
7
+ * - 图标 + 标题 + badge 头
8
+ * - 自定义 children 主体
9
+ * - 不可点遮罩关闭;Dialog / 右侧 Drawer
10
+ */
11
+ export interface ManageActionApprovalFrameViewLabels {
12
+ readonly reject: string;
13
+ readonly confirm: string;
14
+ readonly responding: string;
15
+ readonly permission: string;
16
+ }
17
+
18
+ export interface ManageActionApprovalFrameViewProps {
19
+ readonly presentation: "dialog" | "drawer";
20
+ readonly title: string;
21
+ readonly summary: string;
22
+ readonly icon: string;
23
+ readonly badge?: string;
24
+ readonly destructive?: boolean;
25
+ readonly labels: ManageActionApprovalFrameViewLabels;
26
+ readonly responding: boolean;
27
+ readonly countdown: string;
28
+ readonly canApprove?: boolean;
29
+ readonly error?: string | null;
30
+ readonly onReject: () => void;
31
+ readonly onApprove: () => void;
32
+ readonly children: ReactNode;
33
+ readonly className?: string;
34
+ }
35
+
36
+ export function ManageActionApprovalFrameView({
37
+ presentation,
38
+ title,
39
+ summary,
40
+ icon,
41
+ badge,
42
+ destructive,
43
+ labels,
44
+ responding,
45
+ countdown,
46
+ canApprove = true,
47
+ error,
48
+ onReject,
49
+ onApprove,
50
+ children,
51
+ className,
52
+ }: ManageActionApprovalFrameViewProps): JSX.Element {
53
+ const content = (
54
+ <>
55
+ <div className="border-b border-border/60 p-5">
56
+ <div className="flex items-start gap-3">
57
+ <div
58
+ className={cn(
59
+ "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",
60
+ destructive ? "bg-destructive/10 text-destructive" : "bg-primary/10 text-primary",
61
+ )}
62
+ >
63
+ <span className={`${icon} h-5 w-5`} />
64
+ </div>
65
+ <div className="min-w-0 flex-1">
66
+ <div className="flex flex-wrap items-center gap-2">
67
+ <h2 className="text-[15px] font-semibold text-foreground">{title}</h2>
68
+ {badge && (
69
+ <span
70
+ className={cn(
71
+ "rounded-full px-2 py-0.5 text-[10px] font-semibold",
72
+ destructive
73
+ ? "bg-destructive/10 text-destructive"
74
+ : "bg-primary/10 text-primary",
75
+ )}
76
+ >
77
+ {badge}
78
+ </span>
79
+ )}
80
+ </div>
81
+ <p className="mt-1 text-[12px] leading-5 text-muted-foreground">{summary}</p>
82
+ </div>
83
+ </div>
84
+ </div>
85
+
86
+ <div className="space-y-3 p-5">{children}</div>
87
+
88
+ <div className="border-t border-border/60 px-5 py-4">
89
+ <div className="mb-3 text-[10px] text-muted-foreground">{labels.permission}</div>
90
+ {error && <div className="mb-3 text-[11px] text-destructive">{error}</div>}
91
+ <div className="flex justify-end gap-2">
92
+ <Button variant="outline" size="sm" disabled={responding} onClick={onReject}>
93
+ {labels.reject}({countdown})
94
+ </Button>
95
+ <Button
96
+ size="sm"
97
+ variant={destructive ? "destructive" : "default"}
98
+ disabled={responding || !canApprove}
99
+ onClick={onApprove}
100
+ >
101
+ {responding ? labels.responding : labels.confirm}
102
+ </Button>
103
+ </div>
104
+ </div>
105
+ </>
106
+ );
107
+
108
+ if (presentation === "drawer") {
109
+ return (
110
+ <Drawer open direction="right" dismissible={false}>
111
+ <DrawerContent
112
+ className={cn(
113
+ "w-[min(560px,calc(100vw-2rem))] overflow-visible sm:max-w-[560px]",
114
+ className,
115
+ )}
116
+ >
117
+ <ThemeSurface slot="root.approval.manage.panel" />
118
+ <div className="relative z-10 min-h-0 flex-1 overflow-y-auto rounded-[inherit]">{content}</div>
119
+ </DrawerContent>
120
+ </Drawer>
121
+ );
122
+ }
123
+
124
+ return (
125
+ <Dialog open>
126
+ <DialogContent
127
+ className={cn("overflow-visible p-0 sm:max-w-[560px]", className)}
128
+ showCloseButton={false}
129
+ onInteractOutside={(event) => event.preventDefault()}
130
+ >
131
+ <ThemeSurface slot="root.approval.manage.panel" />
132
+ <div className="relative z-10 max-h-[90vh] overflow-y-auto rounded-[inherit]">{content}</div>
133
+ </DialogContent>
134
+ </Dialog>
135
+ );
136
+ }
@@ -0,0 +1,119 @@
1
+ import { useState, type JSX } from "react";
2
+ import {
3
+ Button,
4
+ Dialog,
5
+ DialogContent,
6
+ DialogDescription,
7
+ DialogFooter,
8
+ DialogHeader,
9
+ DialogTitle,
10
+ } from "@vetta-org/ui";
11
+ import { ThemeSurface } from "../appearance/ThemeSurface";
12
+
13
+ export interface NavigationOpenApprovalField {
14
+ readonly label: string;
15
+ readonly value: string;
16
+ }
17
+
18
+ export interface NavigationOpenApprovalViewLabels {
19
+ readonly confirm: string;
20
+ readonly permission: string;
21
+ readonly reject: string;
22
+ readonly responding: string;
23
+ readonly title: string;
24
+ readonly showTechnicalDetails: string;
25
+ readonly hideTechnicalDetails: string;
26
+ }
27
+
28
+ export interface NavigationOpenApprovalViewProps {
29
+ readonly countdown: string;
30
+ readonly error: string | null;
31
+ readonly fallbackJson: string | null;
32
+ readonly fields: readonly NavigationOpenApprovalField[];
33
+ readonly impactDescription: string;
34
+ readonly impactTitle: string;
35
+ readonly labels: NavigationOpenApprovalViewLabels;
36
+ readonly onApprove: () => void;
37
+ readonly onReject: () => void;
38
+ readonly responding: boolean;
39
+ readonly summary: string;
40
+ }
41
+
42
+ export function NavigationOpenApprovalView({
43
+ countdown,
44
+ error,
45
+ fallbackJson,
46
+ fields,
47
+ impactDescription,
48
+ impactTitle,
49
+ labels,
50
+ onApprove,
51
+ onReject,
52
+ responding,
53
+ summary,
54
+ }: NavigationOpenApprovalViewProps): JSX.Element {
55
+ const [showTechnical, setShowTechnical] = useState(false);
56
+
57
+ return (
58
+ <Dialog open>
59
+ <DialogContent
60
+ className="max-h-[90vh] overflow-visible sm:max-w-[520px]"
61
+ showCloseButton={false}
62
+ onInteractOutside={(event) => event.preventDefault()}
63
+ >
64
+ <ThemeSurface slot="root.approval.navigationOpen.panel" />
65
+ <div className="relative z-10 grid min-h-0 gap-4">
66
+ <DialogHeader>
67
+ <DialogTitle>{labels.title}</DialogTitle>
68
+ <DialogDescription>{summary}</DialogDescription>
69
+ </DialogHeader>
70
+ <div className="min-h-0 space-y-3 overflow-y-auto">
71
+ {fields.length > 0 && (
72
+ <div className="space-y-1.5">
73
+ {fields.map((field) => (
74
+ <div
75
+ key={field.label}
76
+ className="flex items-center justify-between rounded-md border border-border/50 bg-background/50 px-2.5 py-1.5"
77
+ >
78
+ <span className="text-[11px] text-muted-foreground">{field.label}</span>
79
+ <span className="text-[11px] font-medium text-foreground">{field.value}</span>
80
+ </div>
81
+ ))}
82
+ </div>
83
+ )}
84
+ <div className="rounded-lg border border-primary/20 bg-primary/5 p-3">
85
+ <div className="text-[11px] font-semibold text-foreground">{impactTitle}</div>
86
+ <p className="mt-1 text-[11px] leading-5 text-muted-foreground">{impactDescription}</p>
87
+ </div>
88
+ {fallbackJson && (
89
+ <div>
90
+ <button
91
+ type="button"
92
+ className="text-[11px] font-medium text-primary hover:underline"
93
+ onClick={() => setShowTechnical((value) => !value)}
94
+ >
95
+ {showTechnical ? labels.hideTechnicalDetails : labels.showTechnicalDetails}
96
+ </button>
97
+ {showTechnical && (
98
+ <pre className="mt-2 max-h-[160px] overflow-auto whitespace-pre-wrap break-words rounded-md border border-border/50 bg-background/50 px-2.5 py-1.5 font-mono text-[10px] leading-4 text-foreground">
99
+ {fallbackJson}
100
+ </pre>
101
+ )}
102
+ </div>
103
+ )}
104
+ <div className="text-[11px] text-muted-foreground">{labels.permission}</div>
105
+ {error && <div className="text-[11px] text-destructive">{error}</div>}
106
+ </div>
107
+ <DialogFooter>
108
+ <Button variant="outline" size="sm" disabled={responding} onClick={onReject}>
109
+ {labels.reject}({countdown})
110
+ </Button>
111
+ <Button size="sm" disabled={responding} onClick={onApprove}>
112
+ {responding ? labels.responding : labels.confirm}
113
+ </Button>
114
+ </DialogFooter>
115
+ </div>
116
+ </DialogContent>
117
+ </Dialog>
118
+ );
119
+ }