@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.
- package/package.json +195 -0
- package/src/action-approval/AppearanceActionPickerView.tsx +291 -0
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +69 -0
- package/src/action-approval/AppearancePickerApprovalView.tsx +31 -0
- package/src/action-approval/ApprovalParts.tsx +376 -0
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +138 -0
- package/src/action-approval/BatchTasksExecutionApprovalView.tsx +158 -0
- package/src/action-approval/BatchTasksTaskApprovalView.tsx +152 -0
- package/src/action-approval/GeneralSetExecutionModeApprovalView.tsx +76 -0
- package/src/action-approval/GenericActionApprovalView.tsx +127 -0
- package/src/action-approval/ManageActionApprovalFrameTypes.ts +27 -0
- package/src/action-approval/ManageActionApprovalFrameView.tsx +136 -0
- package/src/action-approval/NavigationOpenApprovalView.tsx +119 -0
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +191 -0
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +113 -0
- package/src/action-approval/SchedulerUpdateApprovalView.tsx +14 -0
- package/src/action-approval/ThemeChangeApprovalView.tsx +30 -0
- package/src/action-approval/WebhookDeleteApprovalView.tsx +56 -0
- package/src/action-approval/WebhookTestApprovalView.tsx +51 -0
- package/src/action-approval/cn.ts +4 -0
- package/src/action-approval/index.ts +88 -0
- package/src/activity/ActivityPanel.tsx +269 -0
- package/src/activity/ActivityPanelFrame.tsx +36 -0
- package/src/activity/BackgroundTasksTabPanelView.tsx +382 -0
- package/src/activity/BatchProgressTabPanelView.tsx +22 -0
- package/src/activity/BrowserPanelView.tsx +169 -0
- package/src/activity/ChatTabPanelView.tsx +36 -0
- package/src/activity/CodePreview.tsx +57 -0
- package/src/activity/DebugTabPanelView.tsx +67 -0
- package/src/activity/FileTabContentView.tsx +46 -0
- package/src/activity/FloatingActivityTabView.tsx +107 -0
- package/src/activity/HtmlPreviewView.tsx +135 -0
- package/src/activity/JourneyPanelView.tsx +327 -0
- package/src/activity/KnowledgeHistoryPanelView.tsx +93 -0
- package/src/activity/MarkdownPreviewView.tsx +217 -0
- package/src/activity/PluginTabPickerView.tsx +182 -0
- package/src/activity/RequestHistorySubTabView.tsx +102 -0
- package/src/activity/ScheduleExecutionTabPanelView.tsx +162 -0
- package/src/activity/TodoTabPanelView.tsx +66 -0
- package/src/activity/ToolCallsSubTabView.tsx +184 -0
- package/src/activity/WorkflowTabPanelView.tsx +129 -0
- package/src/activity/index.ts +110 -0
- package/src/app/AppBackground.tsx +24 -0
- package/src/app/AppBootLoadingView.tsx +51 -0
- package/src/app/RouteContentLoadingView.tsx +20 -0
- package/src/app/index.ts +13 -0
- package/src/app-boot.ts +1 -0
- package/src/app-shell/DefaultPageHeader.tsx +46 -0
- package/src/app-shell/DefaultWindowControls.tsx +32 -0
- package/src/app-shell/PageHeaderActionGroup.tsx +15 -0
- package/src/app-shell/PageHeaderContent.tsx +70 -0
- package/src/app-shell/PageHeaderFrame.tsx +53 -0
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +21 -0
- package/src/app-shell/PageHeaderTitle.tsx +25 -0
- package/src/app-shell/PageHeaderWindowActions.tsx +22 -0
- package/src/app-shell/WindowControlButton.tsx +35 -0
- package/src/app-shell/index.ts +49 -0
- package/src/appearance/BackgroundImageFrame.tsx +57 -0
- package/src/appearance/CenterSliceImageFrame.tsx +64 -0
- package/src/appearance/CornerImageFrame.tsx +63 -0
- package/src/appearance/HorizontalSliceImageFrame.tsx +97 -0
- package/src/appearance/NineSliceImageFrame.tsx +65 -0
- package/src/appearance/ThemeSurface.tsx +91 -0
- package/src/appearance/index.ts +12 -0
- package/src/batch-tasks/BatchProjectArtifactFieldView.tsx +36 -0
- package/src/batch-tasks/BatchProjectDialogView.tsx +61 -0
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +108 -0
- package/src/batch-tasks/BatchProjectGroupView.tsx +77 -0
- package/src/batch-tasks/BatchProjectNameFieldView.tsx +29 -0
- package/src/batch-tasks/BatchProjectNotificationFieldView.tsx +42 -0
- package/src/batch-tasks/BatchProjectRuntimeFieldsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskActionButtonsView.tsx +67 -0
- package/src/batch-tasks/BatchTaskCardView.tsx +142 -0
- package/src/batch-tasks/BatchTaskGridView.tsx +95 -0
- package/src/batch-tasks/BatchTaskListView.tsx +10 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +73 -0
- package/src/batch-tasks/BatchTaskProjectBlockView.tsx +117 -0
- package/src/batch-tasks/BatchTaskProjectHeaderView.tsx +74 -0
- package/src/batch-tasks/BatchTasksPageView.tsx +126 -0
- package/src/batch-tasks/batchTaskUi.tsx +101 -0
- package/src/batch-tasks/index.ts +70 -0
- package/src/batch-tasks/types.ts +120 -0
- package/src/chat/ActionButtonBarView.tsx +45 -0
- package/src/chat/AgentAvatarView.tsx +59 -0
- package/src/chat/AppshotCardView.tsx +89 -0
- package/src/chat/AskUserQuestionView.tsx +177 -0
- package/src/chat/AssistantMessageView.tsx +147 -0
- package/src/chat/AtPanelView.tsx +220 -0
- package/src/chat/BackgroundTasksBadgeView.tsx +28 -0
- package/src/chat/BashTerminalCard.tsx +225 -0
- package/src/chat/ChatExportHostView.tsx +17 -0
- package/src/chat/ChatHeaderActionsView.tsx +75 -0
- package/src/chat/ContextRingView.tsx +100 -0
- package/src/chat/CopyIconButton.tsx +61 -0
- package/src/chat/DefaultGuidingWords.tsx +75 -0
- package/src/chat/DefaultSceneCarousel.tsx +113 -0
- package/src/chat/DefaultSkillBadgeRow.tsx +103 -0
- package/src/chat/DrawerCard.tsx +149 -0
- package/src/chat/EditDiffView.tsx +137 -0
- package/src/chat/ExecutionModeSelectorView.tsx +124 -0
- package/src/chat/ExportMessageListView.tsx +20 -0
- package/src/chat/GuideBadgeSwiperView.tsx +79 -0
- package/src/chat/InlineTokenChip.tsx +68 -0
- package/src/chat/InputActionBarView.tsx +112 -0
- package/src/chat/InputBarBackground.tsx +25 -0
- package/src/chat/InputBarCapsule.tsx +56 -0
- package/src/chat/InputBarContextMenuView.tsx +79 -0
- package/src/chat/InputBarPlaceholder.tsx +84 -0
- package/src/chat/InputBarToolbarButton.tsx +42 -0
- package/src/chat/KnowledgeToolViews.tsx +119 -0
- package/src/chat/LiveThinkingView.tsx +102 -0
- package/src/chat/MessageActions.tsx +109 -0
- package/src/chat/MessageBlockSegmentsView.tsx +203 -0
- package/src/chat/MessageBoundaryViews.tsx +93 -0
- package/src/chat/MessageCardsView.tsx +126 -0
- package/src/chat/MessageFeedContext.tsx +14 -0
- package/src/chat/MessageFeedLayoutView.tsx +97 -0
- package/src/chat/MessageFeedView.tsx +228 -0
- package/src/chat/MessageInputView.tsx +193 -0
- package/src/chat/MessageLayoutView.tsx +156 -0
- package/src/chat/MessageListFooterView.tsx +127 -0
- package/src/chat/MessageSelectionContextMenuView.tsx +66 -0
- package/src/chat/MessageTimelineView.tsx +261 -0
- package/src/chat/MessageView.tsx +82 -0
- package/src/chat/MessageVisualView.tsx +43 -0
- package/src/chat/ModelSelectorView.tsx +407 -0
- package/src/chat/NewSession.ts +107 -0
- package/src/chat/NewSessionBackground.tsx +54 -0
- package/src/chat/NewSessionPageLayoutView.tsx +96 -0
- package/src/chat/NewSessionPicker.tsx +270 -0
- package/src/chat/ProgressGroupView.tsx +323 -0
- package/src/chat/ProjectSelectorView.tsx +253 -0
- package/src/chat/QueueCardView.tsx +151 -0
- package/src/chat/ReadImageView.tsx +73 -0
- package/src/chat/SandboxGrantsBadgeView.tsx +101 -0
- package/src/chat/SandboxPermissionCard.tsx +64 -0
- package/src/chat/SceneCard.tsx +138 -0
- package/src/chat/SendButton.tsx +135 -0
- package/src/chat/SessionDropZoneView.tsx +85 -0
- package/src/chat/SessionViewerPageView.tsx +56 -0
- package/src/chat/SkillCard.tsx +56 -0
- package/src/chat/SkillPromptAreaView.tsx +129 -0
- package/src/chat/SuggestionBubblesView.tsx +58 -0
- package/src/chat/TextBlockView.tsx +770 -0
- package/src/chat/TextPreview.tsx +37 -0
- package/src/chat/ThinkingBlockView.tsx +183 -0
- package/src/chat/TodoCard.tsx +243 -0
- package/src/chat/TodoProgress.tsx +205 -0
- package/src/chat/TodoStatusBarView.tsx +140 -0
- package/src/chat/ToolCallBlockView.tsx +188 -0
- package/src/chat/UsageBarView.tsx +19 -0
- package/src/chat/UserMessageContextMenuView.tsx +87 -0
- package/src/chat/UserMessageView.tsx +241 -0
- package/src/chat/WorkflowFooterItemsView.tsx +170 -0
- package/src/chat/WriteContentView.tsx +12 -0
- package/src/chat/index.ts +524 -0
- package/src/chat/markdown-link.test.ts +238 -0
- package/src/chat/markdown-link.ts +279 -0
- package/src/chat/send-button.css +318 -0
- package/src/chat/useHorizontalDragScroll.ts +146 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +62 -0
- package/src/file-explorer/FileContextMenuView.tsx +209 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +82 -0
- package/src/file-explorer/FileTreeNodeView.tsx +274 -0
- package/src/file-explorer/FileTreeView.tsx +301 -0
- package/src/file-explorer/FilesPanelView.tsx +91 -0
- package/src/file-explorer/drag-target.test.ts +34 -0
- package/src/file-explorer/drag-target.ts +26 -0
- package/src/file-explorer/fileIcons.ts +1 -0
- package/src/file-explorer/index.ts +28 -0
- package/src/file-explorer/nativeFileDrag.test.ts +30 -0
- package/src/file-explorer/nativeFileDrag.ts +14 -0
- package/src/file-explorer/types.ts +40 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +115 -0
- package/src/file-preview/FilePreviewDialogView.tsx +241 -0
- package/src/file-preview/FilePreviewView.tsx +162 -0
- package/src/file-preview/LightboxImageView.tsx +131 -0
- package/src/file-preview/PluginFilePreviewView.tsx +24 -0
- package/src/file-preview/PreviewBodyView.tsx +99 -0
- package/src/file-preview/PreviewErrorBoundary.tsx +51 -0
- package/src/file-preview/TextCodeEditorView.tsx +72 -0
- package/src/file-preview/TextFileEditorView.tsx +213 -0
- package/src/file-preview/index.ts +56 -0
- package/src/file-preview/keyboard-target.test.ts +49 -0
- package/src/file-preview/keyboard-target.ts +33 -0
- package/src/file-preview/syntax-tokens.css +77 -0
- package/src/file-preview/syntax-tokens.test.ts +31 -0
- package/src/file-preview/syntax-tokens.ts +155 -0
- package/src/file-preview/text-code-editor-theme.ts +321 -0
- package/src/file-preview/text-editor-language.test.ts +58 -0
- package/src/file-preview/text-editor-language.ts +182 -0
- package/src/file-preview/types.ts +29 -0
- package/src/flowing/FlowingPanelView.tsx +79 -0
- package/src/flowing/FlowingWorkflowView.tsx +54 -0
- package/src/flowing/UserNodeView.tsx +148 -0
- package/src/flowing/WorkflowBindDialogView.tsx +145 -0
- package/src/flowing/WorkflowProgressView.tsx +149 -0
- package/src/flowing/index.ts +27 -0
- package/src/flowing-chat/ChatBubbleView.tsx +219 -0
- package/src/flowing-chat/ChatComposerView.tsx +362 -0
- package/src/flowing-chat/ChatMembersBarView.tsx +86 -0
- package/src/flowing-chat/ChatPanelView.tsx +73 -0
- package/src/flowing-chat/index.ts +21 -0
- package/src/index.ts +22 -0
- package/src/knowledge/KnowledgeBaseSwitcherView.tsx +154 -0
- package/src/knowledge/KnowledgeBreadcrumbView.tsx +92 -0
- package/src/knowledge/KnowledgeContentsPanelView.tsx +77 -0
- package/src/knowledge/KnowledgeContextMenuView.tsx +70 -0
- package/src/knowledge/KnowledgeFilesSkeleton.tsx +22 -0
- package/src/knowledge/KnowledgeGridView.tsx +113 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +85 -0
- package/src/knowledge/KnowledgeImportDialogView.tsx +153 -0
- package/src/knowledge/KnowledgeListView.tsx +107 -0
- package/src/knowledge/KnowledgePendingFilesDialogView.tsx +76 -0
- package/src/knowledge/KnowledgeProcessingBadgeView.tsx +18 -0
- package/src/knowledge/KnowledgeRenameDialogView.tsx +66 -0
- package/src/knowledge/KnowledgeSourcePickerView.tsx +60 -0
- package/src/knowledge/KnowledgeViewShared.tsx +103 -0
- package/src/knowledge/cn.ts +4 -0
- package/src/knowledge/coloredFileIcons.ts +1 -0
- package/src/knowledge/index.ts +66 -0
- package/src/knowledge/types.ts +31 -0
- package/src/knowledge/useMarqueeSelection.ts +95 -0
- package/src/layout/AppFrame.tsx +34 -0
- package/src/layout/MainContentFrame.tsx +54 -0
- package/src/layout/ResizeHandle.tsx +91 -0
- package/src/layout/SidebarDock.tsx +33 -0
- package/src/layout/SidebarOverlay.tsx +36 -0
- package/src/layout/index.ts +10 -0
- package/src/overlays/CommandMenuRow.tsx +119 -0
- package/src/overlays/CommandMenuView.tsx +183 -0
- package/src/overlays/ConfirmDialogView.tsx +109 -0
- package/src/overlays/DetailDrawer.tsx +63 -0
- package/src/overlays/DetailDrawerEnter.tsx +37 -0
- package/src/overlays/KnowledgeDropOverlayView.tsx +43 -0
- package/src/overlays/RouteErrorPageView.tsx +72 -0
- package/src/overlays/ToasterView.tsx +76 -0
- package/src/overlays/UpdateCheckerView.tsx +206 -0
- package/src/overlays/UpdateRestartDialogView.tsx +107 -0
- package/src/overlays/command-menu-types.ts +47 -0
- package/src/overlays/command-menu.css +69 -0
- package/src/overlays/detail-drawer-guard.test.ts +16 -0
- package/src/overlays/detail-drawer-guard.ts +13 -0
- package/src/overlays/index.ts +44 -0
- package/src/plugin-ui/index.ts +26 -0
- package/src/project/BatchQueueStatusView.tsx +352 -0
- package/src/project/ConversationTagDotsView.tsx +130 -0
- package/src/project/ConversationTagEditorDialogView.tsx +273 -0
- package/src/project/DefaultConversationSectionView.tsx +74 -0
- package/src/project/DefaultSessionListView.tsx +128 -0
- package/src/project/DefaultSessionRowView.tsx +125 -0
- package/src/project/NewProjectDialogView.tsx +140 -0
- package/src/project/ProjectContextMenuView.tsx +187 -0
- package/src/project/ProjectDetailPageView.tsx +351 -0
- package/src/project/ProjectGroupView.tsx +37 -0
- package/src/project/ProjectRowView.tsx +111 -0
- package/src/project/ProjectSessionsLoadingView.tsx +14 -0
- package/src/project/ProjectSessionsView.tsx +96 -0
- package/src/project/ProjectsLoadingView.tsx +15 -0
- package/src/project/ProjectsPanelMenusView.tsx +23 -0
- package/src/project/ProjectsPanelView.tsx +56 -0
- package/src/project/QuickScrollOverlay.tsx +188 -0
- package/src/project/ScheduleStatusView.tsx +110 -0
- package/src/project/SessionContextMenuView.tsx +71 -0
- package/src/project/SessionRenameInputView.tsx +49 -0
- package/src/project/SessionRowView.tsx +119 -0
- package/src/project/SidebarProjectsSectionView.tsx +35 -0
- package/src/project/index.ts +87 -0
- package/src/project/types.ts +21 -0
- package/src/project/useActiveSessionAutoScroll.ts +171 -0
- package/src/registry.ts +62 -0
- package/src/scheduler/AutomationPageView.tsx +159 -0
- package/src/scheduler/ExecutionHistoryView.tsx +179 -0
- package/src/scheduler/HistoryDrawerView.tsx +149 -0
- package/src/scheduler/TaskFormDialogView.tsx +60 -0
- package/src/scheduler/TaskListView.tsx +219 -0
- package/src/scheduler/index.ts +30 -0
- package/src/settings/AchievementNavigationButtonView.tsx +90 -0
- package/src/settings/AchievementPromotionDialogView.tsx +91 -0
- package/src/settings/AchievementSettingsView.tsx +44 -0
- package/src/settings/AppshotSettingsView.tsx +132 -0
- package/src/settings/ArchivedProjectsSettingsView.tsx +80 -0
- package/src/settings/BuiltinMcpSecretsDialogView.tsx +278 -0
- package/src/settings/BuiltinMcpSectionView.tsx +164 -0
- package/src/settings/EnvironmentSettingsView.tsx +176 -0
- package/src/settings/GeneralSettingsView.tsx +174 -0
- package/src/settings/ImChannelCardView.tsx +152 -0
- package/src/settings/ImChannelGuideDialogView.tsx +126 -0
- package/src/settings/ImFeishuDialogView.tsx +156 -0
- package/src/settings/ImLegacyImportBannerView.tsx +44 -0
- package/src/settings/ImLogDrawerView.tsx +75 -0
- package/src/settings/ImStatusBadgeView.tsx +39 -0
- package/src/settings/McpDefaultIcon.tsx +27 -0
- package/src/settings/McpJsonEditorView.tsx +56 -0
- package/src/settings/ModelsProviderFormView.tsx +128 -0
- package/src/settings/ModelsProvidersSectionView.tsx +52 -0
- package/src/settings/MotionSelect.tsx +125 -0
- package/src/settings/PermissionsSettingsView.tsx +106 -0
- package/src/settings/PetBubbleStylePreviewView.tsx +44 -0
- package/src/settings/PetSettingsView.tsx +165 -0
- package/src/settings/PresetProviderModelsListView.tsx +58 -0
- package/src/settings/PresetProviderRowView.tsx +302 -0
- package/src/settings/PresetProvidersSectionView.tsx +70 -0
- package/src/settings/QrBindDialogView.tsx +165 -0
- package/src/settings/QuickPanelSettingsSectionView.tsx +66 -0
- package/src/settings/RemoteMcpSectionView.tsx +192 -0
- package/src/settings/SettingChrome.tsx +104 -0
- package/src/settings/SettingsAiAssistButtonView.tsx +150 -0
- package/src/settings/SettingsAiAssistDialogView.tsx +251 -0
- package/src/settings/SettingsFormFields.tsx +121 -0
- package/src/settings/SettingsPageShellView.tsx +84 -0
- package/src/settings/SettingsSidebarView.tsx +133 -0
- package/src/settings/ShortcutRecorderView.tsx +88 -0
- package/src/settings/ShortcutsSettingsView.tsx +66 -0
- package/src/settings/SubscriptionActionsView.tsx +63 -0
- package/src/settings/SubscriptionCardsView.tsx +212 -0
- package/src/settings/TeamDetailView.tsx +148 -0
- package/src/settings/TeamDialogsView.tsx +151 -0
- package/src/settings/TeamListView.tsx +57 -0
- package/src/settings/TeamSettingsView.tsx +51 -0
- package/src/settings/TokenActivityChartView.tsx +286 -0
- package/src/settings/UsageStatsView.tsx +101 -0
- package/src/settings/WebhookEndpointListView.tsx +123 -0
- package/src/settings/WechatBindDialogView.tsx +45 -0
- package/src/settings/achievements/AchievementCurtains.tsx +50 -0
- package/src/settings/achievements/AchievementPromotionBadge3D.tsx +350 -0
- package/src/settings/achievements/AchievementPromotionConfetti.tsx +71 -0
- package/src/settings/achievements/AchievementTitle.tsx +52 -0
- package/src/settings/achievements/index.ts +13 -0
- package/src/settings/index.ts +226 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +135 -0
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +40 -0
- package/src/settings/token-activity.test.ts +195 -0
- package/src/settings/token-activity.ts +320 -0
- package/src/shared/AvatarStackView.tsx +45 -0
- package/src/shared/BotAvatar.tsx +395 -0
- package/src/shared/CodeBlockCopyButton.tsx +48 -0
- package/src/shared/CollapsePanel.tsx +125 -0
- package/src/shared/ContextMenuView.tsx +134 -0
- package/src/shared/MacKeyboardPreview.tsx +260 -0
- package/src/shared/MarkdownTable.tsx +216 -0
- package/src/shared/MultiplierTag.tsx +15 -0
- package/src/shared/ScrollFade.tsx +114 -0
- package/src/shared/SegmentedControl.tsx +82 -0
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.tsx +696 -0
- package/src/shared/TimePicker.tsx +96 -0
- package/src/shared/connected-tab-outline.test.ts +22 -0
- package/src/shared/connected-tab-outline.ts +39 -0
- package/src/shared/fileIcons.test.ts +28 -0
- package/src/shared/fileIcons.ts +322 -0
- package/src/shared/index.ts +38 -0
- package/src/shared/markdown-table-clipboard.ts +31 -0
- package/src/shared/provider-icon/icons.ts +56 -0
- package/src/shared/provider-icon/index.tsx +42 -0
- package/src/shared/provider-icon/svg-url.d.ts +4 -0
- package/src/shared/tab-drag.test.ts +14 -0
- package/src/shared/tab-drag.ts +15 -0
- package/src/shared/useDelayedUnmount.ts +36 -0
- package/src/sidebar/AddProjectMenuItem.tsx +21 -0
- package/src/sidebar/AddProjectMenuPopoverView.tsx +52 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +50 -0
- package/src/sidebar/ChatMessageListView.tsx +66 -0
- package/src/sidebar/DefaultSidebar.tsx +91 -0
- package/src/sidebar/FlowingMessageListView.tsx +111 -0
- package/src/sidebar/MessageCenterDialogView.tsx +81 -0
- package/src/sidebar/MessageCenterEmptyState.tsx +24 -0
- package/src/sidebar/MessageCenterTabs.tsx +86 -0
- package/src/sidebar/MessageCenterToolbarButton.tsx +25 -0
- package/src/sidebar/MessageCenterTriggerView.tsx +39 -0
- package/src/sidebar/NotificationMessageListView.tsx +136 -0
- package/src/sidebar/ProjectsPanelEmptyState.tsx +20 -0
- package/src/sidebar/RunningPulseDot.tsx +10 -0
- package/src/sidebar/SessionStatusIcon.tsx +43 -0
- package/src/sidebar/SettingsMenuAccountSection.tsx +32 -0
- package/src/sidebar/SettingsMenuActionButton.tsx +24 -0
- package/src/sidebar/SettingsMenuDivider.tsx +5 -0
- package/src/sidebar/SettingsMenuQuotaSection.tsx +45 -0
- package/src/sidebar/SettingsMenuSettingsItem.tsx +18 -0
- package/src/sidebar/SettingsMenuThemeSection.tsx +51 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +65 -0
- package/src/sidebar/ShowMoreSessionsButton.tsx +37 -0
- package/src/sidebar/SidebarFilterSelectView.tsx +95 -0
- package/src/sidebar/SidebarNavBadgeView.tsx +58 -0
- package/src/sidebar/SidebarNavIcon.tsx +33 -0
- package/src/sidebar/SidebarNavItemButton.tsx +59 -0
- package/src/sidebar/SidebarNavMorePanel.tsx +199 -0
- package/src/sidebar/SidebarNavigation.tsx +223 -0
- package/src/sidebar/SidebarPanel.tsx +48 -0
- package/src/sidebar/SidebarTopBar.tsx +103 -0
- package/src/sidebar/SidebarUpdateIcon.tsx +79 -0
- package/src/sidebar/index.ts +118 -0
- package/src/sidebar/nav-badge-text.test.ts +23 -0
- package/src/sidebar/nav-badge-text.ts +19 -0
- package/src/sidebar/useSidebarNavDrag.ts +139 -0
- package/src/skills/PluginCardView.tsx +150 -0
- package/src/skills/SceneCardView.tsx +194 -0
- package/src/skills/SkillCardView.tsx +186 -0
- package/src/skills/SkillDetailDialogView.tsx +138 -0
- package/src/skills/SkillTagGroupView.tsx +56 -0
- package/src/skills/SkillToggleSwitch.tsx +31 -0
- package/src/skills/index.ts +29 -0
- package/src/skills/skill-icon.test.ts +38 -0
- package/src/skills/skill-icon.tsx +126 -0
- package/src/styles.css +75 -0
- package/src/utils/platform.ts +2 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import type { ComponentPropsWithoutRef } from "react";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
5
|
+
import { useMessageRootContext } from "./MessageView";
|
|
6
|
+
|
|
7
|
+
export type MessageLayoutKind = "incoming" | "outgoing" | "event";
|
|
8
|
+
|
|
9
|
+
const MessageLayoutContext = createContext<MessageLayoutKind | null>(null);
|
|
10
|
+
|
|
11
|
+
export interface MessageLayoutPrimitiveProps extends ComponentPropsWithoutRef<"div"> {
|
|
12
|
+
readonly asChild?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const MESSAGE_LAYOUT_CLASSES: Record<MessageLayoutKind, string> = {
|
|
16
|
+
incoming: "relative flex min-w-0 flex-col overflow-visible rounded-xl",
|
|
17
|
+
outgoing: "flex min-w-0 justify-end",
|
|
18
|
+
event: "flex justify-center px-4 py-1",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function createMessageLayoutHost(kind: MessageLayoutKind) {
|
|
22
|
+
return forwardRef<HTMLDivElement, MessageLayoutPrimitiveProps>(function MessageLayoutHost(
|
|
23
|
+
{ asChild = false, children, className, ...props },
|
|
24
|
+
forwardedRef,
|
|
25
|
+
) {
|
|
26
|
+
const { pending } = useMessageRootContext(`MessageLayout.${kind}`);
|
|
27
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
28
|
+
return (
|
|
29
|
+
<MessageLayoutContext.Provider value={kind}>
|
|
30
|
+
<Comp
|
|
31
|
+
ref={forwardedRef}
|
|
32
|
+
className={cn(MESSAGE_LAYOUT_CLASSES[kind], className)}
|
|
33
|
+
data-message-root=""
|
|
34
|
+
data-message-layout={kind}
|
|
35
|
+
data-message-variant={kind}
|
|
36
|
+
data-pending={pending || undefined}
|
|
37
|
+
{...props}
|
|
38
|
+
>
|
|
39
|
+
{children}
|
|
40
|
+
</Comp>
|
|
41
|
+
</MessageLayoutContext.Provider>
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export const MessageLayoutIncoming = createMessageLayoutHost("incoming");
|
|
47
|
+
export const MessageLayoutOutgoing = createMessageLayoutHost("outgoing");
|
|
48
|
+
export const MessageLayoutEvent = createMessageLayoutHost("event");
|
|
49
|
+
|
|
50
|
+
export const MessageLayoutIncomingSurface = createMessageLayoutPart(
|
|
51
|
+
"IncomingSurface",
|
|
52
|
+
"relative z-10 flex flex-col rounded-[inherit]",
|
|
53
|
+
"incoming",
|
|
54
|
+
);
|
|
55
|
+
export const MessageLayoutOutgoingContent = createMessageLayoutPart(
|
|
56
|
+
"OutgoingContent",
|
|
57
|
+
"relative flex min-w-0 max-w-[72%] flex-col items-end",
|
|
58
|
+
"outgoing",
|
|
59
|
+
);
|
|
60
|
+
export const MessageLayoutHeader = createMessageLayoutPart(
|
|
61
|
+
"Header",
|
|
62
|
+
"mb-2 flex items-center gap-2",
|
|
63
|
+
"incoming",
|
|
64
|
+
);
|
|
65
|
+
export const MessageLayoutHeaderLeading = createMessageLayoutPart(
|
|
66
|
+
"HeaderLeading",
|
|
67
|
+
"shrink-0",
|
|
68
|
+
"incoming",
|
|
69
|
+
);
|
|
70
|
+
export const MessageLayoutBeforeBody = createMessageLayoutPart(
|
|
71
|
+
"BeforeBody",
|
|
72
|
+
"mb-1.5 flex max-w-full flex-wrap justify-end gap-1.5",
|
|
73
|
+
"outgoing",
|
|
74
|
+
);
|
|
75
|
+
export const MessageLayoutFooter = createMessageLayoutPartByKind("Footer", {
|
|
76
|
+
incoming: "mt-2 flex items-center",
|
|
77
|
+
outgoing: "mt-1 flex",
|
|
78
|
+
});
|
|
79
|
+
export const MessageLayoutAfterBody = createMessageLayoutPart(
|
|
80
|
+
"AfterBody",
|
|
81
|
+
"mt-2",
|
|
82
|
+
"incoming",
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
function createMessageLayoutPart(
|
|
86
|
+
name: string,
|
|
87
|
+
baseClassName: string,
|
|
88
|
+
requiredKind: MessageLayoutKind,
|
|
89
|
+
) {
|
|
90
|
+
return forwardRef<HTMLDivElement, MessageLayoutPrimitiveProps>(function MessageLayoutPart(
|
|
91
|
+
{ asChild = false, children, className, ...props },
|
|
92
|
+
forwardedRef,
|
|
93
|
+
) {
|
|
94
|
+
const kind = useContext(MessageLayoutContext);
|
|
95
|
+
if (kind !== requiredKind) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`MessageLayout.${name} must be used within MessageLayout.${capitalize(requiredKind)}`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
101
|
+
return (
|
|
102
|
+
<Comp
|
|
103
|
+
ref={forwardedRef}
|
|
104
|
+
className={cn(baseClassName, className)}
|
|
105
|
+
data-message-layout-part={name.toLowerCase()}
|
|
106
|
+
{...props}
|
|
107
|
+
>
|
|
108
|
+
{children}
|
|
109
|
+
</Comp>
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function createMessageLayoutPartByKind(
|
|
115
|
+
name: string,
|
|
116
|
+
classes: Partial<Record<MessageLayoutKind, string>>,
|
|
117
|
+
) {
|
|
118
|
+
return forwardRef<HTMLDivElement, MessageLayoutPrimitiveProps>(function MessageLayoutPart(
|
|
119
|
+
{ asChild = false, children, className, ...props },
|
|
120
|
+
forwardedRef,
|
|
121
|
+
) {
|
|
122
|
+
const kind = useContext(MessageLayoutContext);
|
|
123
|
+
const baseClassName = kind ? classes[kind] : undefined;
|
|
124
|
+
if (!kind || !baseClassName) {
|
|
125
|
+
throw new Error(`MessageLayout.${name} is not available in the current message layout`);
|
|
126
|
+
}
|
|
127
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
128
|
+
return (
|
|
129
|
+
<Comp
|
|
130
|
+
ref={forwardedRef}
|
|
131
|
+
className={cn(baseClassName, className)}
|
|
132
|
+
data-message-layout-part={name.toLowerCase()}
|
|
133
|
+
{...props}
|
|
134
|
+
>
|
|
135
|
+
{children}
|
|
136
|
+
</Comp>
|
|
137
|
+
);
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function capitalize(value: string): string {
|
|
142
|
+
return `${value.slice(0, 1).toUpperCase()}${value.slice(1)}`;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const MessageLayout = {
|
|
146
|
+
Incoming: MessageLayoutIncoming,
|
|
147
|
+
IncomingSurface: MessageLayoutIncomingSurface,
|
|
148
|
+
Outgoing: MessageLayoutOutgoing,
|
|
149
|
+
OutgoingContent: MessageLayoutOutgoingContent,
|
|
150
|
+
Event: MessageLayoutEvent,
|
|
151
|
+
Header: MessageLayoutHeader,
|
|
152
|
+
HeaderLeading: MessageLayoutHeaderLeading,
|
|
153
|
+
BeforeBody: MessageLayoutBeforeBody,
|
|
154
|
+
Footer: MessageLayoutFooter,
|
|
155
|
+
AfterBody: MessageLayoutAfterBody,
|
|
156
|
+
} as const;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { AnimatePresence, motion, type Transition } from "motion/react";
|
|
3
|
+
import { Slot } from "radix-ui";
|
|
4
|
+
import { forwardRef, type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
const INDICATOR_INITIAL = { opacity: 0, y: 6 };
|
|
7
|
+
const INDICATOR_ANIMATE = { opacity: 1, y: 0 };
|
|
8
|
+
const INDICATOR_EXIT = { opacity: 0, y: 6 };
|
|
9
|
+
const INDICATOR_TRANSITION = {
|
|
10
|
+
duration: 0.25,
|
|
11
|
+
ease: [0.25, 0.1, 0.25, 1] as const,
|
|
12
|
+
} satisfies Transition;
|
|
13
|
+
|
|
14
|
+
export interface MessageListFooterPrimitiveProps extends ComponentPropsWithoutRef<"div"> {
|
|
15
|
+
readonly asChild?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const MessageListFooterRoot = forwardRef<
|
|
19
|
+
HTMLDivElement,
|
|
20
|
+
MessageListFooterPrimitiveProps
|
|
21
|
+
>(function MessageListFooterRoot({ asChild = false, className, ...props }, forwardedRef) {
|
|
22
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
23
|
+
return (
|
|
24
|
+
<Comp
|
|
25
|
+
ref={forwardedRef}
|
|
26
|
+
className={cn("mx-auto flex max-w-3xl flex-col gap-2 px-5 pt-0", className)}
|
|
27
|
+
{...props}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export function MessageListFooterPresence({ children }: { readonly children: ReactNode }): JSX.Element {
|
|
33
|
+
return <AnimatePresence initial={false}>{children}</AnimatePresence>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function MessageListFooterPending({ label }: { readonly label: string }): JSX.Element {
|
|
37
|
+
return (
|
|
38
|
+
<motion.div
|
|
39
|
+
initial={INDICATOR_INITIAL}
|
|
40
|
+
animate={INDICATOR_ANIMATE}
|
|
41
|
+
exit={INDICATOR_EXIT}
|
|
42
|
+
transition={INDICATOR_TRANSITION}
|
|
43
|
+
className="flex items-center gap-2 py-1 text-[12px] text-muted-foreground"
|
|
44
|
+
>
|
|
45
|
+
<span className="icon-[solar--refresh-linear] h-3.5 w-3.5 shrink-0 animate-spin" aria-hidden />
|
|
46
|
+
<span>{label}</span>
|
|
47
|
+
</motion.div>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function MessageListFooterCompacting({ label }: { readonly label: string }): JSX.Element {
|
|
52
|
+
return (
|
|
53
|
+
<motion.div
|
|
54
|
+
initial={INDICATOR_INITIAL}
|
|
55
|
+
animate={INDICATOR_ANIMATE}
|
|
56
|
+
exit={INDICATOR_EXIT}
|
|
57
|
+
transition={INDICATOR_TRANSITION}
|
|
58
|
+
className="flex items-center gap-2 rounded-lg border border-amber-500/20 bg-amber-500/5 px-3 py-2"
|
|
59
|
+
>
|
|
60
|
+
<svg width={14} height={14} style={{ animation: "context-ring-spin 1s linear infinite" }}>
|
|
61
|
+
<circle
|
|
62
|
+
cx={7}
|
|
63
|
+
cy={7}
|
|
64
|
+
r={5}
|
|
65
|
+
fill="none"
|
|
66
|
+
stroke="currentColor"
|
|
67
|
+
strokeWidth={1}
|
|
68
|
+
opacity={0.3}
|
|
69
|
+
className="text-muted-foreground"
|
|
70
|
+
/>
|
|
71
|
+
<circle
|
|
72
|
+
cx={7}
|
|
73
|
+
cy={7}
|
|
74
|
+
r={5}
|
|
75
|
+
fill="none"
|
|
76
|
+
stroke="currentColor"
|
|
77
|
+
strokeWidth={1}
|
|
78
|
+
strokeDasharray={`${Math.PI * 5 * 0.25} ${Math.PI * 5 * 0.75}`}
|
|
79
|
+
strokeLinecap="round"
|
|
80
|
+
className="text-amber-500"
|
|
81
|
+
/>
|
|
82
|
+
</svg>
|
|
83
|
+
<span className="text-[12px] text-amber-500/80">{label}</span>
|
|
84
|
+
</motion.div>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function MessageListFooterRetry({
|
|
89
|
+
detail,
|
|
90
|
+
label,
|
|
91
|
+
}: {
|
|
92
|
+
readonly detail?: string | null;
|
|
93
|
+
readonly label: string;
|
|
94
|
+
}): JSX.Element {
|
|
95
|
+
return (
|
|
96
|
+
<motion.div
|
|
97
|
+
initial={INDICATOR_INITIAL}
|
|
98
|
+
animate={INDICATOR_ANIMATE}
|
|
99
|
+
exit={INDICATOR_EXIT}
|
|
100
|
+
transition={INDICATOR_TRANSITION}
|
|
101
|
+
className="flex items-center gap-2 rounded-lg border border-border/60 bg-muted/40 px-3 py-2"
|
|
102
|
+
>
|
|
103
|
+
<span className="icon-[solar--refresh-linear] h-3.5 w-3.5 shrink-0 animate-spin text-muted-foreground/60" />
|
|
104
|
+
<span className="min-w-0">
|
|
105
|
+
<span className="block text-[12px] text-foreground/80">{label}</span>
|
|
106
|
+
{detail ? <span className="block truncate text-[11px] text-muted-foreground/70">{detail}</span> : null}
|
|
107
|
+
</span>
|
|
108
|
+
</motion.div>
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const MessageListFooterWaiting = forwardRef<
|
|
113
|
+
HTMLDivElement,
|
|
114
|
+
MessageListFooterPrimitiveProps
|
|
115
|
+
>(function MessageListFooterWaiting({ asChild = false, className, ...props }, forwardedRef) {
|
|
116
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
117
|
+
return <Comp ref={forwardedRef} className={cn("flex items-center", className)} {...props} />;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
export const MessageListFooter = {
|
|
121
|
+
Root: MessageListFooterRoot,
|
|
122
|
+
Presence: MessageListFooterPresence,
|
|
123
|
+
Pending: MessageListFooterPending,
|
|
124
|
+
Compacting: MessageListFooterCompacting,
|
|
125
|
+
Retry: MessageListFooterRetry,
|
|
126
|
+
Waiting: MessageListFooterWaiting,
|
|
127
|
+
} as const;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { motion } from "motion/react";
|
|
2
|
+
import { useEffect, useRef, type JSX } from "react";
|
|
3
|
+
|
|
4
|
+
export interface MessageSelectionContextMenuViewLabels {
|
|
5
|
+
addToInput: string;
|
|
6
|
+
copy: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface MessageSelectionContextMenuViewProps {
|
|
10
|
+
labels: MessageSelectionContextMenuViewLabels;
|
|
11
|
+
onAddToInput: () => void;
|
|
12
|
+
onClose: () => void;
|
|
13
|
+
onCopy: () => void;
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const menuItemClass =
|
|
19
|
+
"flex w-full items-center gap-2 rounded-md px-2.5 py-1.5 text-[12px] font-medium text-foreground transition-colors hover:bg-accent";
|
|
20
|
+
|
|
21
|
+
export function MessageSelectionContextMenuView({
|
|
22
|
+
labels,
|
|
23
|
+
onAddToInput,
|
|
24
|
+
onClose,
|
|
25
|
+
onCopy,
|
|
26
|
+
x,
|
|
27
|
+
y,
|
|
28
|
+
}: MessageSelectionContextMenuViewProps): JSX.Element {
|
|
29
|
+
const menuRef = useRef<HTMLDivElement>(null);
|
|
30
|
+
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
function handlePointerDown(event: MouseEvent): void {
|
|
33
|
+
if (menuRef.current && !menuRef.current.contains(event.target as Node)) onClose();
|
|
34
|
+
}
|
|
35
|
+
document.addEventListener("mousedown", handlePointerDown);
|
|
36
|
+
return () => document.removeEventListener("mousedown", handlePointerDown);
|
|
37
|
+
}, [onClose]);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
function handleKeyDown(event: KeyboardEvent): void {
|
|
41
|
+
if (event.key === "Escape") onClose();
|
|
42
|
+
}
|
|
43
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
44
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
45
|
+
}, [onClose]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<motion.div
|
|
49
|
+
ref={menuRef}
|
|
50
|
+
initial={{ opacity: 0, scale: 0.95 }}
|
|
51
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
52
|
+
transition={{ duration: 0.12, ease: [0.25, 0.1, 0.25, 1] }}
|
|
53
|
+
className="fixed z-[1000] w-[180px] overflow-hidden rounded-lg border border-border bg-popover p-1 shadow-lg"
|
|
54
|
+
style={{ left: `${x}px`, top: `${y}px` }}
|
|
55
|
+
>
|
|
56
|
+
<button type="button" onClick={onCopy} className={menuItemClass}>
|
|
57
|
+
<span className="icon-[solar--copy-linear] h-3.5 w-3.5" />
|
|
58
|
+
{labels.copy}
|
|
59
|
+
</button>
|
|
60
|
+
<button type="button" onClick={onAddToInput} className={menuItemClass}>
|
|
61
|
+
<span className="icon-[solar--text-field-focus-linear] h-3.5 w-3.5" />
|
|
62
|
+
{labels.addToInput}
|
|
63
|
+
</button>
|
|
64
|
+
</motion.div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import {
|
|
4
|
+
forwardRef,
|
|
5
|
+
type ButtonHTMLAttributes,
|
|
6
|
+
type ComponentPropsWithoutRef,
|
|
7
|
+
type CSSProperties,
|
|
8
|
+
} from "react";
|
|
9
|
+
|
|
10
|
+
export interface MessageTimelinePrimitiveProps extends ComponentPropsWithoutRef<"div"> {
|
|
11
|
+
readonly asChild?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function createPrimitive(displayName: string, baseClassName: string) {
|
|
15
|
+
const Primitive = forwardRef<HTMLDivElement, MessageTimelinePrimitiveProps>(function Primitive(
|
|
16
|
+
{ asChild = false, className, ...props },
|
|
17
|
+
forwardedRef,
|
|
18
|
+
) {
|
|
19
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
20
|
+
return <Comp ref={forwardedRef} className={cn(baseClassName, className)} {...props} />;
|
|
21
|
+
});
|
|
22
|
+
Primitive.displayName = displayName;
|
|
23
|
+
return Primitive;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface MessageTimelineSpanProps extends ComponentPropsWithoutRef<"span"> {
|
|
27
|
+
readonly asChild?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createSpanPrimitive(displayName: string, baseClassName: string) {
|
|
31
|
+
const Primitive = forwardRef<HTMLSpanElement, MessageTimelineSpanProps>(function Primitive(
|
|
32
|
+
{ asChild = false, className, ...props },
|
|
33
|
+
forwardedRef,
|
|
34
|
+
) {
|
|
35
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
36
|
+
return <Comp ref={forwardedRef} className={cn(baseClassName, className)} {...props} />;
|
|
37
|
+
});
|
|
38
|
+
Primitive.displayName = displayName;
|
|
39
|
+
return Primitive;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const MessageTimelineRoot = createPrimitive("MessageTimeline.Root", "relative");
|
|
43
|
+
|
|
44
|
+
export const MessageTimelineNavigation = forwardRef<
|
|
45
|
+
HTMLElement,
|
|
46
|
+
ComponentPropsWithoutRef<"nav">
|
|
47
|
+
>(function MessageTimelineNavigation({ className, ...props }, forwardedRef) {
|
|
48
|
+
return (
|
|
49
|
+
<nav
|
|
50
|
+
ref={forwardedRef}
|
|
51
|
+
className={cn(
|
|
52
|
+
"flex w-5 flex-col items-start gap-1 transition-opacity",
|
|
53
|
+
"data-[state=closed]:opacity-60 data-[state=closed]:hover:opacity-100",
|
|
54
|
+
className,
|
|
55
|
+
)}
|
|
56
|
+
{...props}
|
|
57
|
+
/>
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export interface MessageTimelineButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
62
|
+
readonly asChild?: boolean;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const MessageTimelineTrigger = forwardRef<HTMLButtonElement, MessageTimelineButtonProps>(
|
|
66
|
+
function MessageTimelineTrigger({ asChild = false, className, children, type, ...props }, forwardedRef) {
|
|
67
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
68
|
+
return (
|
|
69
|
+
<Comp
|
|
70
|
+
ref={forwardedRef}
|
|
71
|
+
type={asChild ? undefined : (type ?? "button")}
|
|
72
|
+
className={cn(
|
|
73
|
+
"-ml-[2px] flex h-5 w-5 items-center justify-center rounded-md text-muted-foreground/60 transition-colors",
|
|
74
|
+
"hover:bg-accent/60 hover:text-foreground focus-visible:bg-accent/60 focus-visible:outline-none",
|
|
75
|
+
"data-[state=open]:bg-accent data-[state=open]:text-foreground",
|
|
76
|
+
className,
|
|
77
|
+
)}
|
|
78
|
+
{...props}
|
|
79
|
+
>
|
|
80
|
+
{children ?? <span className="icon-[solar--inbox-archive-outline] h-3 w-3" aria-hidden />}
|
|
81
|
+
</Comp>
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
const TICK_STEP_PX = 8;
|
|
87
|
+
const TICK_PAD_PX = 4;
|
|
88
|
+
const MAX_RAIL_HEIGHT_PX = 200;
|
|
89
|
+
|
|
90
|
+
export const MessageTimelineRail = forwardRef<
|
|
91
|
+
HTMLDivElement,
|
|
92
|
+
MessageTimelinePrimitiveProps & { readonly count: number }
|
|
93
|
+
>(function MessageTimelineRail({ asChild = false, className, count, style, ...props }, forwardedRef) {
|
|
94
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
95
|
+
const last = Math.max(1, count - 1);
|
|
96
|
+
const innerHeight = Math.min(last * TICK_STEP_PX, MAX_RAIL_HEIGHT_PX);
|
|
97
|
+
return (
|
|
98
|
+
<Comp
|
|
99
|
+
ref={forwardedRef}
|
|
100
|
+
className={cn("relative w-full", className)}
|
|
101
|
+
style={{ height: innerHeight + TICK_PAD_PX * 2, ...style }}
|
|
102
|
+
{...props}
|
|
103
|
+
/>
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export interface MessageTimelineTickProps extends MessageTimelineButtonProps {
|
|
108
|
+
readonly count: number;
|
|
109
|
+
readonly index: number;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const MessageTimelineTick = forwardRef<HTMLButtonElement, MessageTimelineTickProps>(
|
|
113
|
+
function MessageTimelineTick(
|
|
114
|
+
{ asChild = false, className, count, index, style, type, children, ...props },
|
|
115
|
+
forwardedRef,
|
|
116
|
+
) {
|
|
117
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
118
|
+
const last = Math.max(1, count - 1);
|
|
119
|
+
const innerHeight = Math.min(last * TICK_STEP_PX, MAX_RAIL_HEIGHT_PX);
|
|
120
|
+
const positionStyle = {
|
|
121
|
+
top: TICK_PAD_PX + (index / last) * innerHeight,
|
|
122
|
+
...style,
|
|
123
|
+
} satisfies CSSProperties;
|
|
124
|
+
return (
|
|
125
|
+
<Comp
|
|
126
|
+
ref={forwardedRef}
|
|
127
|
+
type={asChild ? undefined : (type ?? "button")}
|
|
128
|
+
className={cn(
|
|
129
|
+
"group absolute left-1/2 z-0 flex h-3 w-full -translate-x-1/2 -translate-y-1/2 items-center justify-start pl-1 hover:z-20 focus-visible:z-20",
|
|
130
|
+
className,
|
|
131
|
+
)}
|
|
132
|
+
style={positionStyle}
|
|
133
|
+
{...props}
|
|
134
|
+
>
|
|
135
|
+
<span
|
|
136
|
+
className={cn(
|
|
137
|
+
"h-0.5 rounded-full transition-[width,background-color] duration-150",
|
|
138
|
+
"w-2 bg-muted-foreground/50 group-hover:w-6 group-hover:bg-muted-foreground/80 group-focus-visible:w-6 group-focus-visible:bg-muted-foreground/80",
|
|
139
|
+
"group-aria-[current=location]:w-3 group-aria-[current=location]:bg-primary group-hover:group-aria-[current=location]:w-7 group-focus-visible:group-aria-[current=location]:w-7",
|
|
140
|
+
)}
|
|
141
|
+
aria-hidden
|
|
142
|
+
/>
|
|
143
|
+
{children}
|
|
144
|
+
</Comp>
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
export const MessageTimelineTickPreview = createSpanPrimitive(
|
|
150
|
+
"MessageTimeline.TickPreview",
|
|
151
|
+
"pointer-events-none absolute left-full z-30 ml-2 w-max max-w-64 rounded-lg border border-border/50 bg-popover px-2.5 py-1.5 text-left text-[12px] leading-snug text-popover-foreground shadow-md line-clamp-3 break-words whitespace-normal opacity-0 delay-0 duration-150 transition-opacity group-hover:opacity-100 group-hover:delay-150 group-focus-visible:opacity-100 group-focus-visible:delay-0",
|
|
152
|
+
);
|
|
153
|
+
export const MessageTimelinePanelPositioner = createPrimitive(
|
|
154
|
+
"MessageTimeline.PanelPositioner",
|
|
155
|
+
"absolute top-1/2 left-full z-30 ml-1.5 -translate-y-1/2",
|
|
156
|
+
);
|
|
157
|
+
export const MessageTimelinePanel = createPrimitive(
|
|
158
|
+
"MessageTimeline.Panel",
|
|
159
|
+
"flex h-72 w-64 flex-col overflow-hidden rounded-xl border border-border/50 bg-popover shadow-md",
|
|
160
|
+
);
|
|
161
|
+
export const MessageTimelinePanelHeader = createPrimitive(
|
|
162
|
+
"MessageTimeline.PanelHeader",
|
|
163
|
+
"px-3 pt-2.5 pb-2",
|
|
164
|
+
);
|
|
165
|
+
export const MessageTimelinePanelHeading = createPrimitive(
|
|
166
|
+
"MessageTimeline.PanelHeading",
|
|
167
|
+
"mb-2 flex items-center gap-2",
|
|
168
|
+
);
|
|
169
|
+
export const MessageTimelineTitle = forwardRef<
|
|
170
|
+
HTMLHeadingElement,
|
|
171
|
+
ComponentPropsWithoutRef<"h2"> & { readonly asChild?: boolean }
|
|
172
|
+
>(function MessageTimelineTitle({ asChild = false, className, ...props }, forwardedRef) {
|
|
173
|
+
const Comp = asChild ? Slot.Root : "h2";
|
|
174
|
+
return (
|
|
175
|
+
<Comp
|
|
176
|
+
ref={forwardedRef}
|
|
177
|
+
className={cn("min-w-0 flex-1 truncate text-[12px] font-medium text-foreground/80", className)}
|
|
178
|
+
{...props}
|
|
179
|
+
/>
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
export const MessageTimelineCount = createSpanPrimitive(
|
|
183
|
+
"MessageTimeline.Count",
|
|
184
|
+
"text-[11px] text-muted-foreground/50",
|
|
185
|
+
);
|
|
186
|
+
export const MessageTimelineBody = createPrimitive(
|
|
187
|
+
"MessageTimeline.Body",
|
|
188
|
+
"min-h-0 flex-1 px-1 pb-1",
|
|
189
|
+
);
|
|
190
|
+
export const MessageTimelineEmpty = createPrimitive(
|
|
191
|
+
"MessageTimeline.Empty",
|
|
192
|
+
"px-2 py-2 text-[12px] text-muted-foreground",
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
export const MessageTimelineClose = forwardRef<HTMLButtonElement, MessageTimelineButtonProps>(
|
|
196
|
+
function MessageTimelineClose({ asChild = false, className, children, type, ...props }, forwardedRef) {
|
|
197
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
198
|
+
return (
|
|
199
|
+
<Comp
|
|
200
|
+
ref={forwardedRef}
|
|
201
|
+
type={asChild ? undefined : (type ?? "button")}
|
|
202
|
+
className={cn(
|
|
203
|
+
"flex h-5 w-5 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-accent/60 hover:text-foreground",
|
|
204
|
+
className,
|
|
205
|
+
)}
|
|
206
|
+
{...props}
|
|
207
|
+
>
|
|
208
|
+
{children ?? <span className="icon-[solar--close-circle-linear] h-3.5 w-3.5" aria-hidden />}
|
|
209
|
+
</Comp>
|
|
210
|
+
);
|
|
211
|
+
},
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
export const MessageTimelineEntry = forwardRef<HTMLButtonElement, MessageTimelineButtonProps>(
|
|
215
|
+
function MessageTimelineEntry({ asChild = false, className, type, ...props }, forwardedRef) {
|
|
216
|
+
const Comp = asChild ? Slot.Root : "button";
|
|
217
|
+
return (
|
|
218
|
+
<Comp
|
|
219
|
+
ref={forwardedRef}
|
|
220
|
+
type={asChild ? undefined : (type ?? "button")}
|
|
221
|
+
className={cn(
|
|
222
|
+
"flex w-full min-w-0 flex-col gap-0.5 rounded-md px-2.5 py-1.5 text-left text-foreground/80 transition-colors",
|
|
223
|
+
"hover:bg-accent/50 focus-visible:bg-accent/50 focus-visible:outline-none",
|
|
224
|
+
"aria-[current=location]:bg-primary/15 aria-[current=location]:text-foreground",
|
|
225
|
+
className,
|
|
226
|
+
)}
|
|
227
|
+
{...props}
|
|
228
|
+
/>
|
|
229
|
+
);
|
|
230
|
+
},
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
export const MessageTimelineEntryPreview = createSpanPrimitive(
|
|
234
|
+
"MessageTimeline.EntryPreview",
|
|
235
|
+
"block w-full truncate text-[12px]",
|
|
236
|
+
);
|
|
237
|
+
export const MessageTimelineEntryMatch = createSpanPrimitive(
|
|
238
|
+
"MessageTimeline.EntryMatch",
|
|
239
|
+
"block w-full truncate text-[11px] text-muted-foreground/50",
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
export const MessageTimeline = {
|
|
243
|
+
Root: MessageTimelineRoot,
|
|
244
|
+
Navigation: MessageTimelineNavigation,
|
|
245
|
+
Trigger: MessageTimelineTrigger,
|
|
246
|
+
Rail: MessageTimelineRail,
|
|
247
|
+
Tick: MessageTimelineTick,
|
|
248
|
+
TickPreview: MessageTimelineTickPreview,
|
|
249
|
+
PanelPositioner: MessageTimelinePanelPositioner,
|
|
250
|
+
Panel: MessageTimelinePanel,
|
|
251
|
+
PanelHeader: MessageTimelinePanelHeader,
|
|
252
|
+
PanelHeading: MessageTimelinePanelHeading,
|
|
253
|
+
Title: MessageTimelineTitle,
|
|
254
|
+
Count: MessageTimelineCount,
|
|
255
|
+
Close: MessageTimelineClose,
|
|
256
|
+
Body: MessageTimelineBody,
|
|
257
|
+
Empty: MessageTimelineEmpty,
|
|
258
|
+
Entry: MessageTimelineEntry,
|
|
259
|
+
EntryPreview: MessageTimelineEntryPreview,
|
|
260
|
+
EntryMatch: MessageTimelineEntryMatch,
|
|
261
|
+
} as const;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
4
|
+
import { createContext, forwardRef, useContext } from "react";
|
|
5
|
+
|
|
6
|
+
export interface MessageRootProps {
|
|
7
|
+
readonly pending?: boolean;
|
|
8
|
+
readonly children: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface MessageRootContextValue {
|
|
12
|
+
readonly pending: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const MessageRootContext = createContext<MessageRootContextValue | null>(null);
|
|
16
|
+
|
|
17
|
+
/** State boundary only. The caller composes a concrete host from MessageLayout. */
|
|
18
|
+
export function MessageRoot({ pending = false, children }: MessageRootProps): JSX.Element {
|
|
19
|
+
return <MessageRootContext.Provider value={{ pending }}>{children}</MessageRootContext.Provider>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface MessageTextProps extends ComponentPropsWithoutRef<"span"> {
|
|
23
|
+
readonly asChild?: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Semantic author label; may project its typography onto a caller-owned host. */
|
|
27
|
+
export const MessageAuthor = forwardRef<HTMLSpanElement, MessageTextProps>(function MessageAuthor(
|
|
28
|
+
{ asChild = false, className, ...props },
|
|
29
|
+
forwardedRef,
|
|
30
|
+
) {
|
|
31
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
32
|
+
return (
|
|
33
|
+
<Comp
|
|
34
|
+
ref={forwardedRef}
|
|
35
|
+
className={cn("text-[13px] font-semibold text-foreground/80", className)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/** Inline status cluster with the spacing contract shared by message recipes. */
|
|
42
|
+
export const MessageStatus = forwardRef<HTMLSpanElement, MessageTextProps>(function MessageStatus(
|
|
43
|
+
{ asChild = false, className, ...props },
|
|
44
|
+
forwardedRef,
|
|
45
|
+
) {
|
|
46
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
47
|
+
return (
|
|
48
|
+
<Comp
|
|
49
|
+
ref={forwardedRef}
|
|
50
|
+
className={cn("inline-flex items-center gap-1", className)}
|
|
51
|
+
{...props}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/** Secondary message metadata with a semantic inline default host. */
|
|
57
|
+
export const MessageMeta = forwardRef<HTMLSpanElement, MessageTextProps>(function MessageMeta(
|
|
58
|
+
{ asChild = false, className, ...props },
|
|
59
|
+
forwardedRef,
|
|
60
|
+
) {
|
|
61
|
+
const Comp = asChild ? Slot.Root : "span";
|
|
62
|
+
return (
|
|
63
|
+
<Comp
|
|
64
|
+
ref={forwardedRef}
|
|
65
|
+
className={cn("text-[11px] text-muted-foreground/35", className)}
|
|
66
|
+
{...props}
|
|
67
|
+
/>
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
export function useMessageRootContext(part: string): MessageRootContextValue {
|
|
72
|
+
const context = useContext(MessageRootContext);
|
|
73
|
+
if (!context) throw new Error(`${part} must be used within Message.Root`);
|
|
74
|
+
return context;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export const Message = {
|
|
78
|
+
Root: MessageRoot,
|
|
79
|
+
Author: MessageAuthor,
|
|
80
|
+
Status: MessageStatus,
|
|
81
|
+
Meta: MessageMeta,
|
|
82
|
+
} as const;
|