@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,165 @@
1
+ import 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
+
12
+ /**
13
+ * Shared QR device-binding dialog.
14
+ *
15
+ * Every channel that pairs by scanning a code (WeChat, Signal — WhatsApp
16
+ * next) shows the same five bodies: the code, "generating", failure with a
17
+ * retry, success, and the bound-account summary. Only the identity rows and
18
+ * the wording differ, so those are props rather than a second copy of the
19
+ * layout.
20
+ */
21
+ export type QrBindDialogBodyKind = "bound" | "loading" | "failed" | "confirmed" | "qr";
22
+
23
+ /** One label/value row shown once the channel is bound. */
24
+ export interface QrBindDialogDetail {
25
+ readonly label: string;
26
+ readonly value: string;
27
+ }
28
+
29
+ export interface QrBindDialogViewLabels {
30
+ readonly title: string;
31
+ readonly bindDesc: string;
32
+ readonly bindGenerating: string;
33
+ readonly bindFailed: string;
34
+ readonly retry: string;
35
+ readonly bindSuccessTitle: string;
36
+ readonly bindSuccessDesc: string;
37
+ readonly scanToAuthorize: string;
38
+ readonly unbindAccount: string;
39
+ readonly bindDone: string;
40
+ readonly cancel: string;
41
+ }
42
+
43
+ export interface QrBindDialogViewProps {
44
+ readonly open: boolean;
45
+ readonly onOpenChange: (open: boolean) => void;
46
+ readonly bodyKind: QrBindDialogBodyKind;
47
+ readonly bound: boolean;
48
+ readonly error: string | null;
49
+ /** Identity rows for the "bound" body, e.g. the paired account. */
50
+ readonly details: readonly QrBindDialogDetail[];
51
+ readonly progressLabel: string;
52
+ readonly qrDataUrl: string | null;
53
+ /** Alt text for the QR image; names the channel for screen readers. */
54
+ readonly qrAlt: string;
55
+ /**
56
+ * Optional callout rendered above the body — used for prerequisites the
57
+ * user must satisfy outside the app (e.g. "signal-cli 未安装").
58
+ */
59
+ readonly notice?: JSX.Element | null;
60
+ /**
61
+ * Optional controls rendered at the start of the footer — the channel's
62
+ * "how this works" entry and any channel-specific escape hatch (e.g.
63
+ * Signal's "connect my own signal-cli daemon" form). They live bottom
64
+ * left because the dialog's own close button owns the top right corner.
65
+ */
66
+ readonly footerExtra?: JSX.Element | null;
67
+ readonly onStart: () => void;
68
+ readonly onLogout: () => void;
69
+ readonly labels: QrBindDialogViewLabels;
70
+ }
71
+
72
+ export function QrBindDialogView({
73
+ open,
74
+ onOpenChange,
75
+ bodyKind,
76
+ bound,
77
+ error,
78
+ details,
79
+ progressLabel,
80
+ qrDataUrl,
81
+ qrAlt,
82
+ notice,
83
+ footerExtra,
84
+ onStart,
85
+ onLogout,
86
+ labels,
87
+ }: QrBindDialogViewProps): JSX.Element {
88
+ return (
89
+ <Dialog open={open} onOpenChange={onOpenChange}>
90
+ <DialogContent className="sm:max-w-[460px]">
91
+ <DialogHeader>
92
+ <DialogTitle>{labels.title}</DialogTitle>
93
+ <DialogDescription>{labels.bindDesc}</DialogDescription>
94
+ </DialogHeader>
95
+
96
+ {notice}
97
+
98
+ {bodyKind === "bound" ? (
99
+ <div className="space-y-3 py-2 text-[12px] text-foreground">
100
+ {details.map((detail) => (
101
+ <div key={detail.label} className="rounded-md border border-input bg-secondary px-3 py-2">
102
+ <div className="text-muted-foreground">{detail.label}</div>
103
+ <div className="break-all font-mono text-[11px]">{detail.value}</div>
104
+ </div>
105
+ ))}
106
+ </div>
107
+ ) : bodyKind === "loading" ? (
108
+ <div className="flex flex-col items-center gap-3 py-10 text-center text-[12px] text-muted-foreground">
109
+ <span className="icon-[mdi--loading] h-6 w-6 animate-spin" />
110
+ <div>{labels.bindGenerating}</div>
111
+ </div>
112
+ ) : bodyKind === "failed" ? (
113
+ <div className="flex flex-col items-center gap-3 py-6 text-center">
114
+ <span className="icon-[mdi--close-circle] h-10 w-10 text-destructive" />
115
+ <div className="text-[12px] text-destructive">{error ?? labels.bindFailed}</div>
116
+ <Button variant="primary" onClick={onStart}>
117
+ {labels.retry}
118
+ </Button>
119
+ </div>
120
+ ) : bodyKind === "confirmed" ? (
121
+ <div className="flex flex-col items-center gap-3 py-8 text-center">
122
+ <span className="icon-[mdi--check-circle] h-12 w-12 text-emerald-400" />
123
+ <div className="text-[13px] font-medium text-foreground">{labels.bindSuccessTitle}</div>
124
+ <div className="text-[11px] text-muted-foreground">{labels.bindSuccessDesc}</div>
125
+ </div>
126
+ ) : (
127
+ <div className="flex flex-col items-center gap-3 py-3">
128
+ <div className="flex h-[252px] w-[252px] items-center justify-center rounded-md border border-border bg-white p-1.5">
129
+ {qrDataUrl ? (
130
+ <img src={qrDataUrl} alt={qrAlt} className="h-full w-full" />
131
+ ) : (
132
+ <span className="icon-[mdi--loading] h-8 w-8 animate-spin text-muted-foreground" />
133
+ )}
134
+ </div>
135
+ <div className="text-center text-[12px] text-muted-foreground">{progressLabel}</div>
136
+ <div className="text-center text-[11px] text-muted-foreground">{labels.scanToAuthorize}</div>
137
+ </div>
138
+ )}
139
+
140
+ {/* justify-between only when there ARE extra controls —
141
+ otherwise the plain two-button footer would spread. */}
142
+ <DialogFooter className={footerExtra ? "gap-2 sm:justify-between" : "gap-2"}>
143
+ {footerExtra && <div className="flex items-center gap-1">{footerExtra}</div>}
144
+ {/* 动作按钮成组,justify-between 才是「说明 | 动作」两端分布。 */}
145
+ <div className="flex items-center gap-2">
146
+ {bound ? (
147
+ <>
148
+ <Button variant="destructive" onClick={onLogout}>
149
+ {labels.unbindAccount}
150
+ </Button>
151
+ <Button variant="primary" onClick={() => onOpenChange(false)}>
152
+ {labels.bindDone}
153
+ </Button>
154
+ </>
155
+ ) : (
156
+ <Button variant="outline" onClick={() => onOpenChange(false)}>
157
+ {labels.cancel}
158
+ </Button>
159
+ )}
160
+ </div>
161
+ </DialogFooter>
162
+ </DialogContent>
163
+ </Dialog>
164
+ );
165
+ }
@@ -0,0 +1,66 @@
1
+ import type { JSX } from "react";
2
+ import { cn } from "@vetta-org/ui";
3
+ import { MotionSelect } from "./MotionSelect";
4
+ import { SettingRow, SettingSection, type SettingSectionMeta } from "./SettingChrome";
5
+
6
+ export interface QuickPanelOptionView {
7
+ readonly value: string;
8
+ readonly label: string;
9
+ }
10
+
11
+ export interface QuickPanelSettingsSectionViewProps {
12
+ readonly section: SettingSectionMeta;
13
+ readonly sectionTitle?: string;
14
+ readonly triggerTitle: string;
15
+ readonly triggerDescription: string;
16
+ readonly trigger: string;
17
+ readonly triggerOptions: readonly QuickPanelOptionView[];
18
+ readonly onTriggerChange: (value: string) => void;
19
+ readonly behaviorTitle: string;
20
+ readonly behaviorDescription: string;
21
+ readonly behavior: string;
22
+ readonly behaviorOptions: readonly QuickPanelOptionView[];
23
+ readonly onBehaviorChange: (value: string) => void;
24
+ readonly behaviorDisabled: boolean;
25
+ }
26
+
27
+ export function QuickPanelSettingsSectionView({
28
+ section,
29
+ sectionTitle,
30
+ triggerTitle,
31
+ triggerDescription,
32
+ trigger,
33
+ triggerOptions,
34
+ onTriggerChange,
35
+ behaviorTitle,
36
+ behaviorDescription,
37
+ behavior,
38
+ behaviorOptions,
39
+ onBehaviorChange,
40
+ behaviorDisabled,
41
+ }: QuickPanelSettingsSectionViewProps): JSX.Element {
42
+ return (
43
+ <SettingSection section={section} title={sectionTitle}>
44
+ <SettingRow title={triggerTitle} description={triggerDescription}>
45
+ <MotionSelect
46
+ value={trigger}
47
+ onValueChange={onTriggerChange}
48
+ options={triggerOptions}
49
+ triggerClassName="min-w-[150px]"
50
+ />
51
+ </SettingRow>
52
+
53
+ <SettingRow title={behaviorTitle} description={behaviorDescription} border={false}>
54
+ <div className={cn("transition-opacity", behaviorDisabled && "pointer-events-none opacity-40")}>
55
+ <MotionSelect
56
+ value={behavior}
57
+ onValueChange={onBehaviorChange}
58
+ options={behaviorOptions}
59
+ triggerClassName="min-w-[120px]"
60
+ disabled={behaviorDisabled}
61
+ />
62
+ </div>
63
+ </SettingRow>
64
+ </SettingSection>
65
+ );
66
+ }
@@ -0,0 +1,192 @@
1
+ import { useMemo, useState, type JSX } from "react";
2
+ import { Button, cn } from "@vetta-org/ui";
3
+ import { McpDefaultIcon } from "./McpDefaultIcon";
4
+ import type { SettingSectionMeta } from "./SettingChrome";
5
+
6
+ export interface RemoteMcpServerRowView {
7
+ readonly id: string | number;
8
+ readonly name: string;
9
+ readonly display_name?: string;
10
+ readonly description?: string;
11
+ /** 绝对或相对图标 URL;空则使用默认图标 */
12
+ readonly icon?: string;
13
+ }
14
+
15
+ export interface RemoteMcpSectionViewLabels {
16
+ readonly add: string;
17
+ readonly added: string;
18
+ readonly loading: string;
19
+ readonly noRemoteMcp: string;
20
+ readonly processing: string;
21
+ readonly refresh: string;
22
+ readonly remoteAllAdded: string;
23
+ readonly remoteListTitle: string;
24
+ readonly remoteSupport: string;
25
+ readonly remove: string;
26
+ }
27
+
28
+ export interface RemoteMcpSectionViewModel {
29
+ readonly items: readonly RemoteMcpServerRowView[] | null;
30
+ readonly loading: boolean;
31
+ readonly error: string | null;
32
+ readonly busy: string | null;
33
+ readonly load: () => void;
34
+ readonly handleAction: (server: RemoteMcpServerRowView, action: "add" | "remove") => Promise<void>;
35
+ }
36
+
37
+ export interface RemoteMcpSectionViewProps {
38
+ readonly addedNames: Set<string>;
39
+ readonly discover?: boolean;
40
+ readonly labels: RemoteMcpSectionViewLabels;
41
+ readonly model: RemoteMcpSectionViewModel;
42
+ readonly showHeader?: boolean;
43
+ readonly remoteSection: SettingSectionMeta;
44
+ }
45
+
46
+ const GRID_CLASS = "grid grid-cols-[repeat(auto-fill,minmax(240px,1fr))] gap-2.5";
47
+
48
+ export function RemoteMcpSectionView({
49
+ addedNames,
50
+ discover = false,
51
+ labels,
52
+ model,
53
+ showHeader = true,
54
+ remoteSection,
55
+ }: RemoteMcpSectionViewProps): JSX.Element {
56
+ // 发现页也展示已添加项(卡片标「已添加」),不再过滤。
57
+ const visibleItems = useMemo(() => model.items ?? [], [model.items]);
58
+
59
+ return (
60
+ <div
61
+ id={remoteSection.id}
62
+ data-setting-section-id={remoteSection.id}
63
+ data-setting-section-highlight-target={remoteSection.id}
64
+ >
65
+ {showHeader && (
66
+ <div className="mb-3 flex items-center justify-between gap-3">
67
+ <div className="min-w-0">
68
+ <div className="text-[12px] font-medium text-foreground">{labels.remoteListTitle}</div>
69
+ <p className="mt-0.5 text-[11px] text-muted-foreground">{labels.remoteSupport}</p>
70
+ </div>
71
+ <Button variant="ghost" size="sm" onClick={model.load} disabled={model.loading} className="shrink-0">
72
+ <span className={cn("icon-[mdi--refresh] mr-1 h-3.5 w-3.5", model.loading && "animate-spin")} />
73
+ {labels.refresh}
74
+ </Button>
75
+ </div>
76
+ )}
77
+ {model.loading && (
78
+ <div className="rounded-xl bg-card px-5 py-6 text-center text-[12px] text-muted-foreground">
79
+ {labels.loading}
80
+ </div>
81
+ )}
82
+ {!model.loading && model.error && (
83
+ <div className="rounded-xl bg-destructive/10 px-5 py-4 text-center text-[12px] text-destructive">
84
+ {model.error}
85
+ </div>
86
+ )}
87
+ {!model.loading && !model.error && visibleItems.length === 0 && (
88
+ <div className="rounded-xl bg-card px-5 py-6 text-center text-[12px] text-muted-foreground">
89
+ {labels.noRemoteMcp}
90
+ </div>
91
+ )}
92
+ {!model.loading && !model.error && visibleItems.length > 0 && (
93
+ <div className={GRID_CLASS}>
94
+ {visibleItems.map((server) => (
95
+ <RemoteMcpCard
96
+ key={server.id}
97
+ server={server}
98
+ added={addedNames.has(server.name)}
99
+ busy={model.busy === server.name}
100
+ discover={discover}
101
+ labels={labels}
102
+ onAction={model.handleAction}
103
+ />
104
+ ))}
105
+ </div>
106
+ )}
107
+ </div>
108
+ );
109
+ }
110
+
111
+ function RemoteMcpCard({
112
+ server,
113
+ added,
114
+ busy,
115
+ discover,
116
+ labels,
117
+ onAction,
118
+ }: {
119
+ server: RemoteMcpServerRowView;
120
+ added: boolean;
121
+ busy: boolean;
122
+ discover: boolean;
123
+ labels: RemoteMcpSectionViewLabels;
124
+ onAction: (server: RemoteMcpServerRowView, action: "add" | "remove") => Promise<void>;
125
+ }): JSX.Element {
126
+ const title = server.display_name || server.name;
127
+ const iconSrc = server.icon?.trim() || "";
128
+ const [failedIcon, setFailedIcon] = useState<string | null>(null);
129
+ const showImg = Boolean(iconSrc) && failedIcon !== iconSrc;
130
+
131
+ return (
132
+ <div
133
+ className={`group flex flex-col overflow-hidden rounded-xl transition-colors duration-200 ${
134
+ added
135
+ ? "bg-card ring-1 ring-inset ring-emerald-500/20 hover:bg-accent"
136
+ : "bg-card hover:bg-accent"
137
+ }`}
138
+ >
139
+ <div className="flex flex-1 flex-col gap-2.5 p-3.5">
140
+ <div className="flex items-start gap-2.5">
141
+ {showImg ? (
142
+ <img
143
+ src={iconSrc}
144
+ alt=""
145
+ className="h-10 w-10 shrink-0 rounded-lg object-contain"
146
+ onError={() => setFailedIcon(iconSrc)}
147
+ />
148
+ ) : (
149
+ <McpDefaultIcon className="h-10 w-10 rounded-lg" />
150
+ )}
151
+ <div className="min-w-0 flex-1">
152
+ <div className="flex min-w-0 flex-wrap items-center gap-1.5">
153
+ <h4 className="truncate text-[13px] font-semibold tracking-tight text-foreground">{title}</h4>
154
+ {added && (
155
+ <span className="inline-flex shrink-0 items-center gap-1 rounded-full bg-emerald-500/15 px-1.5 py-0.5 text-[9px] font-medium text-emerald-400">
156
+ <span className="h-1.5 w-1.5 rounded-full bg-emerald-400" />
157
+ {labels.added}
158
+ </span>
159
+ )}
160
+ </div>
161
+ {server.description ? (
162
+ <p className="mt-0.5 line-clamp-2 text-[11px] leading-relaxed text-muted-foreground/70">
163
+ {server.description}
164
+ </p>
165
+ ) : (
166
+ <p className="mt-0.5 truncate text-[11px] text-muted-foreground/45">{server.name}</p>
167
+ )}
168
+ </div>
169
+ </div>
170
+
171
+ <div className="mt-auto flex justify-end pt-1">
172
+ {added ? (
173
+ discover ? (
174
+ <Button variant="outline" size="sm" disabled className="opacity-80">
175
+ <span className="icon-[mdi--check] h-3.5 w-3.5 text-emerald-400" />
176
+ {labels.added}
177
+ </Button>
178
+ ) : (
179
+ <Button variant="ghost" size="sm" disabled={busy} onClick={() => void onAction(server, "remove")}>
180
+ {busy ? labels.processing : labels.remove}
181
+ </Button>
182
+ )
183
+ ) : (
184
+ <Button variant="primary" size="sm" disabled={busy} onClick={() => void onAction(server, "add")}>
185
+ {busy ? labels.processing : labels.add}
186
+ </Button>
187
+ )}
188
+ </div>
189
+ </div>
190
+ </div>
191
+ );
192
+ }
@@ -0,0 +1,104 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import { cn } from "@vetta-org/ui";
3
+
4
+ /** Minimal section meta used by settings chrome (desktop registry satisfies this). */
5
+ export interface SettingSectionMeta {
6
+ readonly id: string;
7
+ readonly title?: string;
8
+ readonly titleKey?: string;
9
+ }
10
+
11
+ export function SettingRow({
12
+ title,
13
+ description,
14
+ children,
15
+ border = true,
16
+ }: {
17
+ title: string;
18
+ description?: string;
19
+ children: ReactNode;
20
+ border?: boolean;
21
+ }): JSX.Element {
22
+ return (
23
+ <div className={cn("flex items-center justify-between gap-6 px-5 py-4", border && "border-b border-border")}>
24
+ <div className="min-w-0 flex-1 basis-0">
25
+ <div className="truncate text-[13px] font-medium text-foreground" title={title}>
26
+ {title}
27
+ </div>
28
+ {description && (
29
+ <div className="mt-0.5 line-clamp-2 text-[12px] text-muted-foreground" title={description}>
30
+ {description}
31
+ </div>
32
+ )}
33
+ </div>
34
+ <div className="max-w-[min(100%,24rem)] shrink-0">{children}</div>
35
+ </div>
36
+ );
37
+ }
38
+
39
+ export function SettingSection({
40
+ section,
41
+ title,
42
+ description,
43
+ children,
44
+ t,
45
+ }: {
46
+ section: SettingSectionMeta;
47
+ title?: ReactNode;
48
+ description?: string;
49
+ children: ReactNode;
50
+ t?: (key: string) => string;
51
+ }): JSX.Element {
52
+ const renderedTitle = title !== undefined ? title : t && section.titleKey ? t(section.titleKey) : section.title;
53
+ const hasTitle =
54
+ renderedTitle != null &&
55
+ renderedTitle !== false &&
56
+ !(typeof renderedTitle === "string" && renderedTitle.trim() === "");
57
+ return (
58
+ <div className="mb-6 p-1.5" data-setting-section-highlight-target={section.id}>
59
+ {hasTitle &&
60
+ (typeof renderedTitle === "string" ? (
61
+ <h2
62
+ id={section.id}
63
+ className={cn("text-[15px] font-semibold text-foreground", description ? "mb-1" : "mb-3")}
64
+ >
65
+ {renderedTitle}
66
+ </h2>
67
+ ) : (
68
+ <div
69
+ id={section.id}
70
+ className={cn("text-[15px] font-semibold text-foreground", description ? "mb-1" : "mb-3")}
71
+ >
72
+ {renderedTitle}
73
+ </div>
74
+ ))}
75
+ {description && <p className="mb-3 text-[12px] text-muted-foreground">{description}</p>}
76
+ <div
77
+ id={hasTitle ? undefined : section.id}
78
+ className="overflow-hidden rounded-xl border border-border bg-card"
79
+ data-setting-section-id={section.id}
80
+ >
81
+ {children}
82
+ </div>
83
+ </div>
84
+ );
85
+ }
86
+
87
+ export function SettingHeading({
88
+ section,
89
+ title,
90
+ className,
91
+ t,
92
+ }: {
93
+ section: SettingSectionMeta;
94
+ title?: ReactNode;
95
+ className?: string;
96
+ t?: (key: string) => string;
97
+ }): JSX.Element {
98
+ const renderedTitle = title ?? (t && section.titleKey ? t(section.titleKey) : section.title);
99
+ return (
100
+ <h2 id={section.id} className={cn("text-[15px] font-semibold text-foreground", className)}>
101
+ {renderedTitle}
102
+ </h2>
103
+ );
104
+ }
@@ -0,0 +1,150 @@
1
+ import { forwardRef, type JSX } from "react";
2
+ import { motion, useReducedMotion, type Variants } from "motion/react";
3
+ import { cn } from "@vetta-org/ui";
4
+
5
+ export interface SettingsAiAssistButtonViewProps {
6
+ readonly label: string;
7
+ readonly className?: string;
8
+ readonly onClick?: () => void;
9
+ }
10
+
11
+ const wandVariants: Variants = {
12
+ idle: { rotate: 0, scale: 1 },
13
+ pulse: {
14
+ rotate: [0, -8, 8, -4, 0],
15
+ transition: {
16
+ duration: 2.4,
17
+ repeat: Number.POSITIVE_INFINITY,
18
+ ease: "easeInOut",
19
+ repeatDelay: 1.2,
20
+ },
21
+ },
22
+ hover: {
23
+ scale: 1.08,
24
+ rotate: 12,
25
+ transition: { type: "spring", stiffness: 380, damping: 22 },
26
+ },
27
+ };
28
+
29
+ /**
30
+ * Compact AI-assist CTA: animated magic-wand icon + short label.
31
+ * Ref-forwarding so it can act as PopoverTrigger (asChild).
32
+ */
33
+ export const SettingsAiAssistButtonView = forwardRef<HTMLButtonElement, SettingsAiAssistButtonViewProps>(
34
+ function SettingsAiAssistButtonView({ label, className, onClick }, ref): JSX.Element {
35
+ const reduceMotion = useReducedMotion();
36
+
37
+ return (
38
+ <motion.button
39
+ ref={ref}
40
+ type="button"
41
+ onClick={onClick}
42
+ title={label}
43
+ aria-label={label}
44
+ data-settings-ai-assist-trigger=""
45
+ initial="idle"
46
+ animate={reduceMotion ? "idle" : "pulse"}
47
+ whileHover={reduceMotion ? undefined : "hover"}
48
+ whileTap={reduceMotion ? undefined : { scale: 0.95 }}
49
+ className={cn(
50
+ "group relative inline-flex h-7 shrink-0 cursor-pointer items-center gap-1.5 overflow-visible rounded-md border border-transparent px-1",
51
+ "bg-transparent text-[12px] font-medium text-primary outline-none select-none",
52
+ "transition-opacity duration-200 ease-out hover:opacity-90",
53
+ "focus-visible:border-ring",
54
+ "disabled:pointer-events-none disabled:opacity-50",
55
+ className,
56
+ )}
57
+ >
58
+ <span className="relative inline-flex size-3.5 shrink-0 items-center justify-center">
59
+ <motion.span
60
+ aria-hidden
61
+ variants={wandVariants}
62
+ className="icon-[solar--magic-stick-3-bold] relative z-[1] h-3.5 w-3.5"
63
+ />
64
+ <TwinkleStar
65
+ reduceMotion={!!reduceMotion}
66
+ className="-top-1 -right-1"
67
+ size={5}
68
+ delay={0}
69
+ hoverX={3}
70
+ hoverY={-4}
71
+ />
72
+ <TwinkleStar
73
+ reduceMotion={!!reduceMotion}
74
+ className="-bottom-1 -left-1"
75
+ size={3.5}
76
+ delay={0.45}
77
+ hoverX={-3}
78
+ hoverY={3}
79
+ />
80
+ <TwinkleStar
81
+ reduceMotion={!!reduceMotion}
82
+ className="-top-0.5 -left-1.5"
83
+ size={2.5}
84
+ delay={0.9}
85
+ hoverX={-4}
86
+ hoverY={-2}
87
+ />
88
+ </span>
89
+ <span className="relative z-[1] whitespace-nowrap">{label}</span>
90
+ </motion.button>
91
+ );
92
+ },
93
+ );
94
+
95
+ function TwinkleStar({
96
+ className,
97
+ size,
98
+ delay,
99
+ hoverX,
100
+ hoverY,
101
+ reduceMotion,
102
+ }: {
103
+ className: string;
104
+ size: number;
105
+ delay: number;
106
+ hoverX: number;
107
+ hoverY: number;
108
+ reduceMotion: boolean;
109
+ }): JSX.Element {
110
+ const variants: Variants = {
111
+ idle: { opacity: 0.85, scale: 1, x: 0, y: 0 },
112
+ pulse: {
113
+ opacity: [0.25, 1, 0.35, 1, 0.25],
114
+ scale: [0.7, 1.15, 0.85, 1.1, 0.7],
115
+ x: 0,
116
+ y: 0,
117
+ transition: {
118
+ duration: 2.2,
119
+ repeat: Number.POSITIVE_INFINITY,
120
+ ease: "easeInOut",
121
+ delay,
122
+ },
123
+ },
124
+ hover: {
125
+ x: hoverX,
126
+ y: hoverY,
127
+ scale: 1.35,
128
+ opacity: 1,
129
+ transition: { type: "spring", stiffness: 380, damping: 22 },
130
+ },
131
+ };
132
+
133
+ return (
134
+ <motion.span
135
+ aria-hidden
136
+ variants={variants}
137
+ animate={reduceMotion ? "idle" : undefined}
138
+ className={cn("pointer-events-none absolute z-[2] text-primary", className)}
139
+ style={{ width: size, height: size }}
140
+ >
141
+ <svg
142
+ xmlns="http://www.w3.org/2000/svg"
143
+ viewBox="0 0 784.11 815.53"
144
+ className="h-full w-full fill-current drop-shadow-[0_0_4px_color-mix(in_srgb,var(--primary)_70%,transparent)]"
145
+ >
146
+ <path d="M392.05 0c-20.9,210.08-184.06,378.41-392.05,407.78 207.96,29.37 371.12,197.68 392.05,407.74 20.93-210.06 184.09-378.37 392.05-407.74-207.98-29.38-371.16-197.69-392.06-407.78z" />
147
+ </svg>
148
+ </motion.span>
149
+ );
150
+ }