@vetta-org/theme-ui 0.1.0 → 0.1.2
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 +735 -7
- package/src/action-approval/AppearanceActionPickerView.tsx +2 -78
- package/src/action-approval/AppearanceApprovalDrawerView.tsx +2 -9
- package/src/action-approval/BatchTasksApprovalFrameView.tsx +4 -1
- package/src/action-approval/GenericActionApprovalView.tsx +2 -9
- package/src/action-approval/ManageActionApprovalFrameView.tsx +4 -1
- package/src/action-approval/NavigationOpenApprovalView.tsx +2 -9
- package/src/action-approval/SchedulerActionApprovalDialogView.tsx +3 -1
- package/src/action-approval/SchedulerEditApprovalDrawerView.tsx +3 -10
- package/src/action-approval/index.ts +0 -1
- package/src/activity/ActivityPanel.tsx +13 -10
- package/src/activity/ActivityPanelFrame.test.tsx +32 -0
- package/src/activity/ActivityPanelFrame.tsx +3 -2
- package/src/activity/BackgroundTasksTabPanelView.tsx +1 -1
- package/src/activity/BrowserPanelView.tsx +48 -49
- package/src/activity/DebugTabPanelView.tsx +1 -1
- package/src/activity/MarkdownPreviewView.tsx +56 -59
- package/src/activity/PluginTabPickerView.tsx +5 -3
- package/src/activity/PortsTabPanelView.tsx +911 -0
- package/src/activity/ToolCallsSubTabView.tsx +1 -1
- package/src/activity/WorkflowTabPanelView.tsx +1 -1
- package/src/activity/index.ts +9 -0
- package/src/app/AppBackground.tsx +1 -1
- package/src/app/AppBootLoadingView.tsx +4 -2
- package/src/app-shell/DefaultWindowControls.tsx +1 -1
- package/src/app-shell/PageHeaderActionGroup.tsx +1 -1
- package/src/app-shell/PageHeaderContent.tsx +36 -7
- package/src/app-shell/PageHeaderFrame.tsx +15 -3
- package/src/app-shell/PageHeaderSidebarTrigger.tsx +1 -1
- package/src/app-shell/PageHeaderTitle.tsx +1 -1
- package/src/app-shell/WindowControlButton.tsx +1 -1
- package/src/app-shell/header-crowding.test.ts +62 -0
- package/src/app-shell/header-crowding.tsx +137 -0
- package/src/appearance/BackgroundImageFrame.tsx +1 -1
- package/src/appearance/CenterSliceImageFrame.tsx +1 -1
- package/src/appearance/CornerImageFrame.tsx +1 -1
- package/src/appearance/HorizontalSliceImageFrame.tsx +1 -1
- package/src/appearance/NineSliceImageFrame.tsx +1 -1
- package/src/appearance/ThemeSurface.tsx +1 -1
- package/src/batch-tasks/BatchProjectFoldersFieldView.tsx +2 -1
- package/src/batch-tasks/BatchTaskProjectActionsView.test.tsx +97 -0
- package/src/batch-tasks/BatchTaskProjectActionsView.tsx +45 -35
- package/src/batch-tasks/batchTaskUi.tsx +0 -29
- package/src/bottom-panel/BottomPanelView.test.tsx +43 -0
- package/src/bottom-panel/BottomPanelView.tsx +222 -0
- package/src/bottom-panel/index.ts +26 -0
- package/src/chat/AgentAvatarView.tsx +1 -1
- package/src/chat/AnnotationViews.tsx +107 -0
- package/src/chat/AskUserQuestionView.tsx +18 -11
- package/src/chat/AssistantMessageView.tsx +48 -13
- package/src/chat/AtPanelView.test.tsx +61 -0
- package/src/chat/AtPanelView.tsx +63 -38
- package/src/chat/BashTerminalCard.tsx +1 -2
- package/src/chat/ChatHeaderActionsView.tsx +74 -18
- package/src/chat/CompactionStepView.test.tsx +34 -0
- package/src/chat/CompactionStepView.tsx +85 -0
- package/src/chat/ExecutionModeSelectorView.tsx +20 -5
- package/src/chat/HeaderActionBarView.tsx +731 -0
- package/src/chat/HeaderActionOverflowMenu.tsx +137 -0
- package/src/chat/InlineModelPicker.test.tsx +81 -0
- package/src/chat/InlineModelPicker.tsx +201 -0
- package/src/chat/InlineTokenChip.tsx +2 -68
- package/src/chat/InputBarBackground.tsx +1 -1
- package/src/chat/InputBarPlaceholder.tsx +26 -3
- package/src/chat/LiveThinkingView.tsx +51 -37
- package/src/chat/MessageBoundaryViews.tsx +21 -0
- package/src/chat/MessageFeedContext.tsx +13 -5
- package/src/chat/MessageFeedLayoutView.tsx +28 -3
- package/src/chat/MessageFeedView.test.tsx +81 -0
- package/src/chat/MessageFeedView.tsx +72 -152
- package/src/chat/MessageInputView.tsx +1 -1
- package/src/chat/MessageLayoutView.tsx +1 -1
- package/src/chat/MessageSelectionContextMenuView.tsx +4 -1
- package/src/chat/MessageTimelineView.tsx +1 -1
- package/src/chat/MessageView.tsx +1 -1
- package/src/chat/MessageVisualView.tsx +1 -1
- package/src/chat/ModelConfiguration.tsx +283 -0
- package/src/chat/ModelSelectorTrigger.tsx +63 -0
- package/src/chat/ModelSelectorView.tsx +1037 -223
- package/src/chat/NewSession.ts +1 -37
- package/src/chat/NewSessionPicker.tsx +3 -2
- package/src/chat/ProjectSelectorView.tsx +3 -2
- package/src/chat/ReasoningStepSlider.tsx +61 -0
- package/src/chat/RemoteSessionBadgeView.tsx +24 -0
- package/src/chat/SkillPromptAreaView.tsx +5 -19
- package/src/chat/TeamMemberReplyCardView.test.tsx +33 -0
- package/src/chat/TeamMemberReplyCardView.tsx +133 -0
- package/src/chat/TextBlockView.tsx +7 -770
- package/src/chat/TodoProgress.tsx +25 -53
- package/src/chat/TodoStatusBarView.tsx +14 -5
- package/src/chat/UserMessageView.tsx +113 -33
- package/src/chat/header-action-narrow.test.ts +21 -0
- package/src/chat/header-action-narrow.ts +38 -0
- package/src/chat/index.ts +32 -27
- package/src/chat/markdown-link.ts +7 -279
- package/src/chat/send-button.css +4 -22
- package/src/chat/streaming-reveal.test.ts +218 -0
- package/src/chat/streaming-reveal.ts +13 -0
- package/src/file-explorer/ConfirmDeleteDialogView.tsx +2 -1
- package/src/file-explorer/FileContextMenuView.tsx +44 -11
- package/src/file-explorer/FileExplorerSettingsView.tsx +97 -0
- package/src/file-explorer/FileTreeCreateRow.tsx +1 -1
- package/src/file-explorer/FileTreeNodeView.tsx +59 -18
- package/src/file-explorer/FileTreeView.tsx +236 -129
- package/src/file-explorer/file-tree-dom.ts +23 -0
- package/src/file-explorer/file-tree-rows.test.ts +74 -0
- package/src/file-explorer/file-tree-rows.ts +168 -0
- package/src/file-explorer/index.ts +17 -0
- package/src/file-explorer/types.ts +3 -0
- package/src/file-explorer/useFileTreeMarqueeSelection.ts +24 -16
- package/src/file-preview/FilePreviewDialogView.tsx +2 -2
- package/src/file-preview/FilePreviewView.tsx +12 -2
- package/src/file-preview/TextFileEditorView.tsx +2 -1
- package/src/index.ts +1 -0
- package/src/knowledge/KnowledgeHowItWorksDialogView.tsx +1 -1
- package/src/layout/AppFrame.tsx +3 -2
- package/src/layout/MainContentFrame.tsx +7 -2
- package/src/layout/ResizeHandle.tsx +68 -17
- package/src/layout/SidebarDock.tsx +75 -19
- package/src/layout/SidebarOverlay.tsx +1 -1
- package/src/layout/index.ts +1 -1
- package/src/layout/resize-handle-axis.test.ts +51 -0
- package/src/live-indicators.test.ts +43 -0
- package/src/markdown/CodeBlock.tsx +123 -0
- package/src/markdown/InlineTokenChip.tsx +68 -0
- package/src/markdown/MarkdownContent.tsx +411 -0
- package/src/markdown/MarkdownImage.tsx +51 -0
- package/src/markdown/MathFormula.tsx +46 -0
- package/src/markdown/MermaidBlock.tsx +43 -0
- package/src/markdown/RichCodeBlock.tsx +127 -0
- package/src/markdown/SvgPreview.tsx +45 -0
- package/src/markdown/WebsiteIcon.tsx +94 -0
- package/src/markdown/builtin-renderers.tsx +43 -0
- package/src/markdown/definition.tsx +49 -0
- package/src/markdown/host.tsx +18 -0
- package/src/markdown/index.ts +11 -0
- package/src/markdown/inline-tokens.ts +187 -0
- package/src/markdown/markdown-link.ts +279 -0
- package/src/markdown/math-client.ts +116 -0
- package/src/markdown/math-render.ts +23 -0
- package/src/markdown/math-syntax.ts +80 -0
- package/src/markdown/math.worker.ts +16 -0
- package/src/markdown/nodes.ts +15 -0
- package/src/markdown/preview-policy.ts +43 -0
- package/src/markdown/rich-labels.ts +49 -0
- package/src/markdown/rich-syntax.ts +93 -0
- package/src/markdown/stable-blocks.test.ts +90 -0
- package/src/markdown/stable-blocks.ts +124 -0
- package/src/markdown/streaming-reveal.ts +297 -0
- package/src/markdown/streaming.test.ts +57 -0
- package/src/markdown/streaming.ts +211 -0
- package/src/markdown/use-render-snapshot.ts +24 -0
- package/src/markdown/use-rich-visibility.ts +24 -0
- package/src/overlays/CommandMenuRow.tsx +38 -9
- package/src/overlays/CommandMenuView.tsx +77 -117
- package/src/overlays/ConfirmDialogView.tsx +25 -20
- package/src/overlays/ReleaseNoteMarkdown.tsx +29 -0
- package/src/overlays/SplashOptionRow.tsx +46 -0
- package/src/overlays/SplashPanel.tsx +85 -0
- package/src/overlays/SplashParts.tsx +213 -0
- package/src/overlays/UpdateCheckerView.tsx +34 -18
- package/src/overlays/UpdateRestartDialogView.tsx +139 -54
- package/src/overlays/command-menu-types.ts +2 -0
- package/src/overlays/command-menu.css +1 -20
- package/src/overlays/index.ts +14 -1
- package/src/plugin-ui/index.ts +8 -0
- package/src/project/ConversationTagDotsView.tsx +1 -1
- package/src/project/ConversationTagEditorDialogView.tsx +4 -1
- package/src/project/DefaultConversationSectionView.tsx +4 -4
- package/src/project/DefaultSessionListView.tsx +5 -31
- package/src/project/DefaultSessionRowView.tsx +106 -55
- package/src/project/ManageSessionsSplashView.tsx +439 -0
- package/src/project/NewProjectDialogView.tsx +3 -10
- package/src/project/ProjectContextMenuView.tsx +30 -139
- package/src/project/ProjectDetailPageView.test.tsx +140 -0
- package/src/project/ProjectDetailPageView.tsx +372 -165
- package/src/project/ProjectGroupView.tsx +1 -1
- package/src/project/ProjectRowView.tsx +29 -12
- package/src/project/ProjectSessionsView.tsx +25 -47
- package/src/project/QuickScrollOverlay.tsx +1 -1
- package/src/project/SessionContextMenuView.tsx +15 -7
- package/src/project/SessionRowMoreButton.tsx +50 -0
- package/src/project/SessionRowView.tsx +106 -63
- package/src/project/SessionTitleMarquee.tsx +54 -0
- package/src/project/SidebarProjectDisclosure.tsx +60 -0
- package/src/project/SidebarProjectsSectionView.tsx +6 -1
- package/src/project/index.ts +12 -0
- package/src/project/session-row-transition.ts +9 -0
- package/src/project/types.ts +4 -2
- package/src/project/useActiveSessionAutoScroll.ts +10 -4
- package/src/registry.ts +0 -2
- package/src/scheduler/AutomationDetailPaneView.tsx +68 -0
- package/src/scheduler/AutomationPageView.tsx +118 -121
- package/src/scheduler/ExecutionHistoryView.tsx +7 -5
- package/src/scheduler/TaskListView.tsx +52 -201
- package/src/scheduler/index.ts +7 -12
- package/src/settings/AchievementSettingsView.tsx +0 -1
- package/src/settings/AppshotSettingsView.tsx +0 -1
- package/src/settings/BuiltinMcpSectionView.tsx +1 -1
- package/src/settings/EnvironmentGitRowView.tsx +156 -0
- package/src/settings/EnvironmentSettingsView.tsx +25 -3
- package/src/settings/GeneralSettingsView.tsx +17 -20
- package/src/settings/ImChannelGuideDialogView.tsx +2 -2
- package/src/settings/ImFeishuDialogView.tsx +1 -1
- package/src/settings/ImLegacyImportBannerView.tsx +1 -1
- package/src/settings/ImLogDrawerView.tsx +2 -1
- package/src/settings/JsonConfigInputView.tsx +171 -0
- package/src/settings/ModelsFetchedModelsDrawerView.tsx +292 -0
- package/src/settings/ModelsProvidersSectionView.tsx +26 -23
- package/src/settings/MotionSelect.tsx +9 -7
- package/src/settings/NotificationSettingsView.tsx +79 -0
- package/src/settings/PermissionsSettingsView.tsx +3 -7
- package/src/settings/PresetProviderModelsListView.tsx +141 -24
- package/src/settings/PresetProviderRowView.tsx +205 -182
- package/src/settings/ProxySettingsSectionView.tsx +182 -0
- package/src/settings/QrBindDialogView.tsx +1 -1
- package/src/settings/QuickPanelSettingsSectionView.tsx +0 -2
- package/src/settings/RemoteMcpSectionView.tsx +1 -1
- package/src/settings/SettingChrome.tsx +2 -2
- package/src/settings/SettingsAiAssistButtonView.tsx +9 -119
- package/src/settings/SettingsFormFields.tsx +4 -7
- package/src/settings/SettingsSidebarView.tsx +64 -3
- package/src/settings/ShortcutRecorderView.test.tsx +108 -0
- package/src/settings/ShortcutRecorderView.tsx +15 -9
- package/src/settings/ShortcutsSettingsView.tsx +1 -1
- package/src/settings/SpaceEditorDialogView.tsx +120 -0
- package/src/settings/SpacesSettingsView.tsx +105 -0
- package/src/settings/WebhookEndpointListView.tsx +4 -5
- package/src/settings/index.ts +41 -29
- package/src/shared/ActivityStatusDot.tsx +69 -0
- package/src/shared/AvatarStackView.tsx +13 -13
- package/src/shared/BotAvatar.tsx +11 -9
- package/src/shared/CodeBlockCopyButton.tsx +1 -1
- package/src/shared/ContextMenuView.tsx +4 -11
- package/src/shared/MarkdownTable.tsx +2 -2
- package/src/shared/SyntaxHighlightedCode.tsx +0 -0
- package/src/shared/TabBar.outline.test.tsx +59 -0
- package/src/shared/TabBar.tsx +22 -17
- package/src/shared/VettaKbd.test.tsx +52 -0
- package/src/shared/VettaKbd.tsx +81 -0
- package/src/shared/connected-tab-outline.test.ts +2 -2
- package/src/shared/connected-tab-outline.ts +2 -1
- package/src/shared/index.ts +6 -0
- package/src/shared/kbd-keys.test.ts +61 -0
- package/src/shared/kbd-keys.ts +253 -0
- package/src/shared/provider-icon/icons.ts +4 -2
- package/src/shared/provider-icon/index.tsx +1 -1
- package/src/shared/provider-icon/magpie.svg +1 -0
- package/src/sidebar/AddProjectMenuTriggerView.tsx +25 -15
- package/src/sidebar/DefaultSidebar.tsx +3 -1
- package/src/sidebar/MessageCenterDialogView.tsx +3 -2
- package/src/sidebar/MessageCenterEmptyState.tsx +1 -1
- package/src/sidebar/MessageCenterTabs.tsx +1 -1
- package/src/sidebar/MessageCenterToolbarButton.tsx +1 -1
- package/src/sidebar/MessageCenterTriggerView.tsx +2 -2
- package/src/sidebar/ProjectsPanelEmptyState.tsx +26 -7
- package/src/sidebar/SessionStatusIcon.tsx +16 -1
- package/src/sidebar/SettingsMenuThemeSection.tsx +1 -1
- package/src/sidebar/SettingsMenuTriggerView.test.tsx +42 -0
- package/src/sidebar/SettingsMenuTriggerView.tsx +28 -50
- package/src/sidebar/ShowMoreSessionsButton.tsx +1 -1
- package/src/sidebar/SidebarFilterSelectView.tsx +8 -16
- package/src/sidebar/SidebarNavBadgeView.tsx +1 -1
- package/src/sidebar/SidebarNavIcon.tsx +1 -1
- package/src/sidebar/SidebarNavItemButton.tsx +1 -1
- package/src/sidebar/SidebarNavMorePanel.tsx +19 -7
- package/src/sidebar/SidebarNavigation.tsx +24 -15
- package/src/sidebar/SidebarPanel.tsx +11 -2
- package/src/sidebar/SidebarSectionTriggerLabel.tsx +20 -0
- package/src/sidebar/SidebarTopBar.tsx +10 -7
- package/src/sidebar/WaitingPulseBadge.tsx +19 -0
- package/src/sidebar/index.ts +1 -16
- package/src/skills/index.ts +0 -19
- package/src/skills/skill-icon.tsx +4 -8
- package/src/styles.css +24 -6
- package/src/chat/DefaultSceneCarousel.tsx +0 -113
- package/src/chat/SceneCard.tsx +0 -138
- package/src/scheduler/HistoryDrawerView.tsx +0 -149
- package/src/scheduler/TaskFormDialogView.tsx +0 -60
- package/src/settings/SubscriptionActionsView.tsx +0 -63
- package/src/settings/SubscriptionCardsView.tsx +0 -212
- package/src/settings/TeamDetailView.tsx +0 -148
- package/src/settings/TeamDialogsView.tsx +0 -151
- package/src/settings/TeamListView.tsx +0 -57
- package/src/settings/TeamSettingsView.tsx +0 -51
- package/src/settings/TokenActivityChartView.tsx +0 -286
- package/src/settings/UsageStatsView.tsx +0 -101
- package/src/settings/shouldCloseEmptyApiKeyEditor.test.ts +0 -135
- package/src/settings/shouldCloseEmptyApiKeyEditor.ts +0 -40
- package/src/settings/token-activity.test.ts +0 -195
- package/src/settings/token-activity.ts +0 -320
- package/src/sidebar/AddProjectMenuItem.tsx +0 -21
- package/src/sidebar/AddProjectMenuPopoverView.tsx +0 -52
- package/src/sidebar/NotificationMessageListView.tsx +0 -136
- package/src/sidebar/SettingsMenuAccountSection.tsx +0 -32
- package/src/sidebar/SettingsMenuQuotaSection.tsx +0 -45
- package/src/skills/SceneCardView.tsx +0 -194
- package/src/skills/SkillCardView.tsx +0 -186
- package/src/skills/SkillDetailDialogView.tsx +0 -138
- package/src/skills/SkillTagGroupView.tsx +0 -56
- package/src/skills/SkillToggleSwitch.tsx +0 -31
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { ButtonGroup, ButtonGroupItem } from "@vetta-org/ui";
|
|
1
2
|
import type { JSX } from "react";
|
|
2
|
-
import { ActionIconButton } from "./batchTaskUi";
|
|
3
3
|
import type { BatchProjectCountsView, BatchTaskProjectActionsLabels } from "./types";
|
|
4
4
|
|
|
5
5
|
export interface BatchTaskProjectActionsViewProps {
|
|
@@ -13,6 +13,10 @@ export interface BatchTaskProjectActionsViewProps {
|
|
|
13
13
|
onEditProject: () => void;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
function actionIcon(name: string): JSX.Element {
|
|
17
|
+
return <span className={`${name} size-4`} />;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
export function BatchTaskProjectActionsView({
|
|
17
21
|
counts,
|
|
18
22
|
hasQueued,
|
|
@@ -32,42 +36,48 @@ export function BatchTaskProjectActionsView({
|
|
|
32
36
|
: labels.start;
|
|
33
37
|
|
|
34
38
|
return (
|
|
35
|
-
<div className="flex items-center gap-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
<div className="flex items-center gap-1.5">
|
|
40
|
+
<ButtonGroup>
|
|
41
|
+
{isActive ? (
|
|
42
|
+
<ButtonGroupItem
|
|
43
|
+
icon={actionIcon("icon-[solar--stop-linear]")}
|
|
44
|
+
title={labels.stop}
|
|
45
|
+
aria-label={labels.stop}
|
|
46
|
+
onClick={onBatchStop}
|
|
47
|
+
/>
|
|
48
|
+
) : (
|
|
49
|
+
<ButtonGroupItem
|
|
50
|
+
icon={actionIcon("icon-[solar--play-linear]")}
|
|
51
|
+
title={startTitle}
|
|
52
|
+
aria-label={labels.start}
|
|
53
|
+
onClick={onBatchStart}
|
|
54
|
+
disabled={startDisabled}
|
|
55
|
+
/>
|
|
56
|
+
)}
|
|
57
|
+
<ButtonGroupItem
|
|
58
|
+
icon={actionIcon("icon-[solar--refresh-linear]")}
|
|
59
|
+
title={labels.reset}
|
|
60
|
+
aria-label={labels.reset}
|
|
61
|
+
onClick={onBatchReset}
|
|
62
|
+
disabled={counts.total === 0}
|
|
42
63
|
/>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
</ButtonGroup>
|
|
65
|
+
<ButtonGroup>
|
|
66
|
+
<ButtonGroupItem
|
|
67
|
+
icon={actionIcon("icon-[solar--pen-2-linear]")}
|
|
68
|
+
title={labels.editProject}
|
|
69
|
+
aria-label={labels.editProject}
|
|
70
|
+
onClick={onEditProject}
|
|
49
71
|
/>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<div className="mx-1 h-4 w-px bg-border/60" />
|
|
59
|
-
<ActionIconButton
|
|
60
|
-
icon="icon-[solar--pen-2-linear]"
|
|
61
|
-
title={labels.editProject}
|
|
62
|
-
onClick={onEditProject}
|
|
63
|
-
/>
|
|
64
|
-
<ActionIconButton
|
|
65
|
-
icon="icon-[solar--trash-bin-trash-linear]"
|
|
66
|
-
title={labels.deleteProject}
|
|
67
|
-
variant="danger"
|
|
68
|
-
onClick={onDeleteProject}
|
|
69
|
-
disabled={counts.running > 0}
|
|
70
|
-
/>
|
|
72
|
+
<ButtonGroupItem
|
|
73
|
+
icon={actionIcon("icon-[solar--trash-bin-trash-linear]")}
|
|
74
|
+
title={labels.deleteProject}
|
|
75
|
+
aria-label={labels.deleteProject}
|
|
76
|
+
onClick={onDeleteProject}
|
|
77
|
+
disabled={counts.running > 0}
|
|
78
|
+
/>
|
|
79
|
+
</ButtonGroup>
|
|
71
80
|
</div>
|
|
72
81
|
);
|
|
73
82
|
}
|
|
83
|
+
|
|
@@ -70,32 +70,3 @@ export function OverlayActionButton({
|
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export function ActionIconButton({
|
|
74
|
-
disabled,
|
|
75
|
-
icon,
|
|
76
|
-
onClick,
|
|
77
|
-
title,
|
|
78
|
-
variant,
|
|
79
|
-
}: {
|
|
80
|
-
disabled?: boolean;
|
|
81
|
-
icon: string;
|
|
82
|
-
onClick: () => void;
|
|
83
|
-
title: string;
|
|
84
|
-
variant?: "danger";
|
|
85
|
-
}): JSX.Element {
|
|
86
|
-
return (
|
|
87
|
-
<button
|
|
88
|
-
type="button"
|
|
89
|
-
disabled={disabled}
|
|
90
|
-
onClick={onClick}
|
|
91
|
-
title={title}
|
|
92
|
-
className={`inline-flex size-7 shrink-0 items-center justify-center rounded-[min(var(--radius-md),12px)] border border-transparent text-sm font-medium transition-all outline-none select-none focus-visible:border-ring disabled:pointer-events-none disabled:opacity-50 ${
|
|
93
|
-
variant === "danger"
|
|
94
|
-
? "text-muted-foreground/60 hover:bg-destructive/10 hover:text-destructive"
|
|
95
|
-
: "text-muted-foreground/60 hover:bg-primary/10 hover:text-primary"
|
|
96
|
-
}`}
|
|
97
|
-
>
|
|
98
|
-
<span className={`${icon} text-[14px]`} />
|
|
99
|
-
</button>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import {
|
|
4
|
+
BottomPanelPillsView,
|
|
5
|
+
BottomPanelTabStripView,
|
|
6
|
+
type BottomPanelTabStatus,
|
|
7
|
+
} from "./BottomPanelView";
|
|
8
|
+
|
|
9
|
+
function tab(status: BottomPanelTabStatus) {
|
|
10
|
+
return { tabId: "terminal-1", label: "终端", status } as const;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
describe("底部面板状态展示", () => {
|
|
14
|
+
it("tab 条不再根据实例忙闲状态显示圆点", () => {
|
|
15
|
+
const render = (status: BottomPanelTabStatus) =>
|
|
16
|
+
renderToStaticMarkup(
|
|
17
|
+
<BottomPanelTabStripView
|
|
18
|
+
tabs={[tab(status)]}
|
|
19
|
+
activeTabId="terminal-1"
|
|
20
|
+
onSelect={() => {}}
|
|
21
|
+
onClose={() => {}}
|
|
22
|
+
labels={{ tablist: "底部面板", close: "关闭" }}
|
|
23
|
+
/>,
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
expect(render("active")).toBe(render("idle"));
|
|
27
|
+
expect(render("active")).not.toContain("data-status");
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it("折叠 pill 不再根据实例忙闲状态显示圆点", () => {
|
|
31
|
+
const render = (status: BottomPanelTabStatus) =>
|
|
32
|
+
renderToStaticMarkup(
|
|
33
|
+
<BottomPanelPillsView
|
|
34
|
+
pills={[tab(status)]}
|
|
35
|
+
onSelect={() => {}}
|
|
36
|
+
labels={{ group: "底部面板" }}
|
|
37
|
+
/>,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(render("active")).toBe(render("idle"));
|
|
41
|
+
expect(render("active")).not.toContain("data-status");
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { cn } from "@vetta-org/ui/utils";
|
|
2
|
+
import type { ComponentPropsWithoutRef, JSX, ReactNode } from "react";
|
|
3
|
+
import { ThemeSurface } from "../appearance/ThemeSurface";
|
|
4
|
+
import { ActivityStatusDotStyles } from "../shared/ActivityStatusDot";
|
|
5
|
+
|
|
6
|
+
/** 保留实例活动状态的公共合同;底部面板标签不再把它渲染为状态点。 */
|
|
7
|
+
export type BottomPanelTabStatus = "idle" | "active";
|
|
8
|
+
|
|
9
|
+
export interface BottomPanelTabViewModel {
|
|
10
|
+
readonly tabId: string;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
/** iconify 类名或 React 节点,与活动面板 tab 的约定一致。 */
|
|
13
|
+
readonly icon?: ReactNode;
|
|
14
|
+
readonly status: BottomPanelTabStatus;
|
|
15
|
+
readonly closable?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function TabIcon({ icon, className }: { icon: ReactNode; className?: string }): JSX.Element | null {
|
|
19
|
+
if (!icon) return null;
|
|
20
|
+
if (typeof icon === "string") return <span aria-hidden className={cn(icon, "h-3.5 w-3.5 shrink-0", className)} />;
|
|
21
|
+
return (
|
|
22
|
+
<span
|
|
23
|
+
aria-hidden
|
|
24
|
+
className={cn("flex h-3.5 w-3.5 shrink-0 items-center justify-center [&>svg]:h-full [&>svg]:w-full", className)}
|
|
25
|
+
>
|
|
26
|
+
{icon}
|
|
27
|
+
</span>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface BottomPanelFrameProps extends ComponentPropsWithoutRef<"div"> {
|
|
32
|
+
readonly children: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 面板外框:只负责分层与主题面,边框和圆角由消费方按当前形态给。
|
|
37
|
+
*
|
|
38
|
+
* 面板有两种形态:铺到窗口边缘时只需要一条上边框当分界,收成卡片时才画整圈边框和圆角。
|
|
39
|
+
* 两者写死在这里就得多一个布尔参数,而调用方本来就知道自己是哪一种。
|
|
40
|
+
*/
|
|
41
|
+
export function BottomPanelFrame({ children, className, ...props }: BottomPanelFrameProps): JSX.Element {
|
|
42
|
+
return (
|
|
43
|
+
<div
|
|
44
|
+
className={cn("relative flex min-h-0 w-full flex-col overflow-hidden bg-background", className)}
|
|
45
|
+
data-theme-surface-root="bottomPanel.panel"
|
|
46
|
+
{...props}
|
|
47
|
+
>
|
|
48
|
+
<ThemeSurface slot="bottomPanel.panel" />
|
|
49
|
+
<ActivityStatusDotStyles />
|
|
50
|
+
<div className="relative z-10 flex min-h-0 flex-1 flex-col overflow-hidden rounded-[inherit]">{children}</div>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface BottomPanelTabStripLabels {
|
|
56
|
+
readonly tablist: string;
|
|
57
|
+
readonly close: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface BottomPanelTabStripViewProps {
|
|
61
|
+
readonly tabs: readonly BottomPanelTabViewModel[];
|
|
62
|
+
readonly activeTabId: string | null;
|
|
63
|
+
readonly onSelect: (tabId: string) => void;
|
|
64
|
+
readonly onClose: (tabId: string) => void;
|
|
65
|
+
readonly labels: BottomPanelTabStripLabels;
|
|
66
|
+
/** 右侧工具区(新建 / 分屏 / 收起),由消费方组装具体按钮。 */
|
|
67
|
+
readonly actions?: ReactNode;
|
|
68
|
+
readonly className?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function BottomPanelTabStripView({
|
|
72
|
+
tabs,
|
|
73
|
+
activeTabId,
|
|
74
|
+
onSelect,
|
|
75
|
+
onClose,
|
|
76
|
+
labels,
|
|
77
|
+
actions,
|
|
78
|
+
className,
|
|
79
|
+
}: BottomPanelTabStripViewProps): JSX.Element {
|
|
80
|
+
// tab 条与内容之间不画分割线:同一个格子内部再分层会把一格看成两块。
|
|
81
|
+
return (
|
|
82
|
+
<div className={cn("flex h-9 shrink-0 items-center gap-1 px-1.5", className)}>
|
|
83
|
+
{/* 包一层 presentation:tab 与关闭键是两个按钮,嵌套 button 是非法结构。 */}
|
|
84
|
+
<div role="tablist" aria-label={labels.tablist} className="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto">
|
|
85
|
+
{tabs.map((tab) => {
|
|
86
|
+
const selected = tab.tabId === activeTabId;
|
|
87
|
+
return (
|
|
88
|
+
<div
|
|
89
|
+
role="presentation"
|
|
90
|
+
key={tab.tabId}
|
|
91
|
+
className={cn(
|
|
92
|
+
"group flex shrink-0 items-center rounded-lg transition-colors",
|
|
93
|
+
selected ? "bg-accent/60" : "hover:bg-accent/40",
|
|
94
|
+
)}
|
|
95
|
+
>
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
role="tab"
|
|
99
|
+
aria-selected={selected}
|
|
100
|
+
onClick={() => onSelect(tab.tabId)}
|
|
101
|
+
className="flex min-w-0 items-center gap-1.5 rounded-lg px-2 py-1 text-[12px]"
|
|
102
|
+
>
|
|
103
|
+
<TabIcon icon={tab.icon} />
|
|
104
|
+
<span
|
|
105
|
+
className={cn("max-w-[160px] truncate", selected ? "text-foreground" : "text-muted-foreground")}
|
|
106
|
+
>
|
|
107
|
+
{tab.label}
|
|
108
|
+
</span>
|
|
109
|
+
</button>
|
|
110
|
+
{tab.closable === false ? null : (
|
|
111
|
+
<button
|
|
112
|
+
type="button"
|
|
113
|
+
aria-label={`${labels.close}: ${tab.label}`}
|
|
114
|
+
onClick={() => onClose(tab.tabId)}
|
|
115
|
+
className="mr-1 flex h-4 w-4 items-center justify-center rounded-md text-muted-foreground/60 opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 group-hover:opacity-100"
|
|
116
|
+
>
|
|
117
|
+
<span aria-hidden className="icon-[solar--close-circle-linear] h-3 w-3" />
|
|
118
|
+
</button>
|
|
119
|
+
)}
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
})}
|
|
123
|
+
</div>
|
|
124
|
+
{actions ? <div className="flex shrink-0 items-center gap-0.5">{actions}</div> : null}
|
|
125
|
+
</div>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export interface BottomPanelPillsViewProps {
|
|
130
|
+
readonly pills: readonly BottomPanelTabViewModel[];
|
|
131
|
+
readonly onSelect: (tabId: string) => void;
|
|
132
|
+
readonly labels: { readonly group: string };
|
|
133
|
+
readonly className?: string;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* 面板缩起时的 pill 横排,接在输入框下方待办条右侧。
|
|
138
|
+
* 视觉与待办 pill 同一套(`rounded-full` + 同字号 + 同 hover),保证一行里不出现两种药丸。
|
|
139
|
+
*/
|
|
140
|
+
export function BottomPanelPillsView({ pills, onSelect, labels, className }: BottomPanelPillsViewProps): JSX.Element {
|
|
141
|
+
return (
|
|
142
|
+
<div aria-label={labels.group} className={cn("flex min-w-0 items-center gap-1", className)}>
|
|
143
|
+
{pills.map((pill) => (
|
|
144
|
+
<button
|
|
145
|
+
key={pill.tabId}
|
|
146
|
+
type="button"
|
|
147
|
+
title={pill.label}
|
|
148
|
+
onClick={() => onSelect(pill.tabId)}
|
|
149
|
+
className="flex min-w-0 max-w-full items-center gap-1.5 rounded-full px-2 py-1 text-[11px] transition-colors hover:bg-accent/50"
|
|
150
|
+
>
|
|
151
|
+
<TabIcon icon={pill.icon} className="h-3 w-3" />
|
|
152
|
+
<span className="max-w-[120px] truncate font-medium text-muted-foreground">{pill.label}</span>
|
|
153
|
+
</button>
|
|
154
|
+
))}
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface BottomPanelEmptyStateProps {
|
|
160
|
+
readonly title: string;
|
|
161
|
+
readonly description?: string;
|
|
162
|
+
readonly action?: ReactNode;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function BottomPanelEmptyState({ title, description, action }: BottomPanelEmptyStateProps): JSX.Element {
|
|
166
|
+
return (
|
|
167
|
+
<div className="flex min-h-0 flex-1 flex-col items-center justify-center gap-2 overflow-y-auto px-4 py-6 text-center">
|
|
168
|
+
<span aria-hidden className="icon-[solar--window-frame-linear] h-8 w-8 text-muted-foreground/60" />
|
|
169
|
+
<p className="text-[13px] text-foreground">{title}</p>
|
|
170
|
+
{description ? <p className="text-[12px] text-muted-foreground">{description}</p> : null}
|
|
171
|
+
{action}
|
|
172
|
+
</div>
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export interface BottomPanelEmptyChoice {
|
|
177
|
+
readonly id: string;
|
|
178
|
+
readonly label: string;
|
|
179
|
+
readonly icon?: ReactNode;
|
|
180
|
+
/** 插件来源名,显示在标签右侧当副标题。 */
|
|
181
|
+
readonly hint?: string;
|
|
182
|
+
readonly disabled?: boolean;
|
|
183
|
+
readonly disabledReason?: string;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export interface BottomPanelEmptyPickerProps {
|
|
187
|
+
readonly choices: readonly BottomPanelEmptyChoice[];
|
|
188
|
+
readonly onPick: (id: string) => void;
|
|
189
|
+
readonly label: string;
|
|
190
|
+
readonly className?: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 空屏时把能添加的面板直接摊平成一排可点的项。
|
|
195
|
+
*
|
|
196
|
+
* 空面板里唯一能做的事就是添加第一个 tab,再让用户先点开一层「+」菜单纯属多余。
|
|
197
|
+
*/
|
|
198
|
+
export function BottomPanelEmptyPicker({
|
|
199
|
+
choices,
|
|
200
|
+
onPick,
|
|
201
|
+
label,
|
|
202
|
+
className,
|
|
203
|
+
}: BottomPanelEmptyPickerProps): JSX.Element {
|
|
204
|
+
return (
|
|
205
|
+
<div aria-label={label} className={cn("flex max-w-full flex-wrap items-center justify-center gap-1.5", className)}>
|
|
206
|
+
{choices.map((choice) => (
|
|
207
|
+
<button
|
|
208
|
+
key={choice.id}
|
|
209
|
+
type="button"
|
|
210
|
+
disabled={choice.disabled}
|
|
211
|
+
title={choice.disabled ? choice.disabledReason : undefined}
|
|
212
|
+
onClick={() => onPick(choice.id)}
|
|
213
|
+
className="flex min-w-0 items-center gap-1.5 rounded-lg border border-border/60 px-2.5 py-1.5 text-[12px] transition-colors hover:border-border hover:bg-accent/50 disabled:opacity-40 disabled:hover:border-border/60 disabled:hover:bg-transparent"
|
|
214
|
+
>
|
|
215
|
+
<TabIcon icon={choice.icon} />
|
|
216
|
+
<span className="max-w-[160px] truncate text-foreground">{choice.label}</span>
|
|
217
|
+
{choice.hint ? <span className="shrink-0 text-[11px] text-muted-foreground">{choice.hint}</span> : null}
|
|
218
|
+
</button>
|
|
219
|
+
))}
|
|
220
|
+
</div>
|
|
221
|
+
);
|
|
222
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ThemeSurfaceConfig } from "@vetta-org/theme-sdk";
|
|
2
|
+
|
|
3
|
+
declare module "@vetta-org/theme-sdk" {
|
|
4
|
+
interface ThemeSurfaceRegistry {
|
|
5
|
+
readonly "bottomPanel.panel"?: ThemeSurfaceConfig;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type {
|
|
10
|
+
BottomPanelEmptyChoice,
|
|
11
|
+
BottomPanelEmptyPickerProps,
|
|
12
|
+
BottomPanelEmptyStateProps,
|
|
13
|
+
BottomPanelFrameProps,
|
|
14
|
+
BottomPanelPillsViewProps,
|
|
15
|
+
BottomPanelTabStatus,
|
|
16
|
+
BottomPanelTabStripLabels,
|
|
17
|
+
BottomPanelTabStripViewProps,
|
|
18
|
+
BottomPanelTabViewModel,
|
|
19
|
+
} from "./BottomPanelView";
|
|
20
|
+
export {
|
|
21
|
+
BottomPanelEmptyPicker,
|
|
22
|
+
BottomPanelEmptyState,
|
|
23
|
+
BottomPanelFrame,
|
|
24
|
+
BottomPanelPillsView,
|
|
25
|
+
BottomPanelTabStripView,
|
|
26
|
+
} from "./BottomPanelView";
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { Button } from "@vetta-org/ui";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
|
|
5
|
+
export function AnnotationComposer({
|
|
6
|
+
value,
|
|
7
|
+
pending,
|
|
8
|
+
labels,
|
|
9
|
+
onChange,
|
|
10
|
+
onSend,
|
|
11
|
+
onCancel,
|
|
12
|
+
}: {
|
|
13
|
+
value: string;
|
|
14
|
+
pending: boolean;
|
|
15
|
+
labels: { question: string; send: string; cancel: string };
|
|
16
|
+
onChange(value: string): void;
|
|
17
|
+
onSend(): void;
|
|
18
|
+
onCancel(): void;
|
|
19
|
+
}) {
|
|
20
|
+
const id = useId();
|
|
21
|
+
return (
|
|
22
|
+
<form
|
|
23
|
+
className="flex flex-col gap-2 border-t border-border pt-3"
|
|
24
|
+
onSubmit={(event) => {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
onSend();
|
|
27
|
+
}}
|
|
28
|
+
>
|
|
29
|
+
<label htmlFor={id} className="text-[12px] text-muted-foreground">
|
|
30
|
+
{labels.question}
|
|
31
|
+
</label>
|
|
32
|
+
<textarea
|
|
33
|
+
id={id}
|
|
34
|
+
value={value}
|
|
35
|
+
maxLength={20000}
|
|
36
|
+
rows={3}
|
|
37
|
+
onChange={(event) => onChange(event.target.value)}
|
|
38
|
+
className="w-full resize-none rounded-md border border-border bg-background px-3 py-2 text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
39
|
+
/>
|
|
40
|
+
<div className="flex justify-end gap-2">
|
|
41
|
+
{pending ? (
|
|
42
|
+
<Button type="button" variant="ghost" size="sm" onClick={onCancel}>
|
|
43
|
+
{labels.cancel}
|
|
44
|
+
</Button>
|
|
45
|
+
) : null}
|
|
46
|
+
<Button type="submit" size="sm" disabled={pending || !value.trim()}>
|
|
47
|
+
{labels.send}
|
|
48
|
+
</Button>
|
|
49
|
+
</div>
|
|
50
|
+
</form>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function AnnotationTurnView({ question, children }: { question: string; children: ReactNode }) {
|
|
55
|
+
return (
|
|
56
|
+
<article className="flex flex-col gap-2 py-3 text-[13px]">
|
|
57
|
+
<p className="whitespace-pre-wrap break-words font-medium">{question}</p>
|
|
58
|
+
{children}
|
|
59
|
+
</article>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function AnnotationHistoryView({
|
|
64
|
+
items,
|
|
65
|
+
query,
|
|
66
|
+
labels,
|
|
67
|
+
onQueryChange,
|
|
68
|
+
onOpen,
|
|
69
|
+
}: {
|
|
70
|
+
items: readonly { id: string; quote: string; title: string }[];
|
|
71
|
+
query: string;
|
|
72
|
+
labels: { search: string; empty: string };
|
|
73
|
+
onQueryChange(value: string): void;
|
|
74
|
+
onOpen(id: string): void;
|
|
75
|
+
}) {
|
|
76
|
+
const id = useId();
|
|
77
|
+
return (
|
|
78
|
+
<div className="flex min-h-0 flex-col gap-3">
|
|
79
|
+
<label className="sr-only" htmlFor={id}>
|
|
80
|
+
{labels.search}
|
|
81
|
+
</label>
|
|
82
|
+
<input
|
|
83
|
+
id={id}
|
|
84
|
+
type="search"
|
|
85
|
+
value={query}
|
|
86
|
+
placeholder={labels.search}
|
|
87
|
+
onChange={(event) => onQueryChange(event.target.value)}
|
|
88
|
+
className="rounded-md border border-border bg-background px-3 py-2 text-[13px] outline-none focus-visible:ring-1 focus-visible:ring-ring"
|
|
89
|
+
/>
|
|
90
|
+
<ul className="max-h-[50vh] overflow-auto">
|
|
91
|
+
{items.map((item) => (
|
|
92
|
+
<li key={item.id}>
|
|
93
|
+
<button
|
|
94
|
+
type="button"
|
|
95
|
+
onClick={() => onOpen(item.id)}
|
|
96
|
+
className="flex w-full flex-col gap-1 rounded-md px-3 py-2 text-left hover:bg-accent focus-visible:outline-1 focus-visible:outline-ring"
|
|
97
|
+
>
|
|
98
|
+
<span className="line-clamp-2 text-[13px]">{item.title}</span>
|
|
99
|
+
<span className="line-clamp-1 text-[11px] text-muted-foreground">{item.quote}</span>
|
|
100
|
+
</button>
|
|
101
|
+
</li>
|
|
102
|
+
))}
|
|
103
|
+
</ul>
|
|
104
|
+
{items.length === 0 ? <p className="py-3 text-[13px] text-muted-foreground">{labels.empty}</p> : null}
|
|
105
|
+
</div>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -128,13 +128,13 @@ function QuestionBody({
|
|
|
128
128
|
}): JSX.Element {
|
|
129
129
|
return (
|
|
130
130
|
<div className="rounded-lg border border-border/60 bg-background/40 p-2">
|
|
131
|
-
<div className="mb-2 flex
|
|
131
|
+
<div className="mb-2 flex flex-col gap-1">
|
|
132
132
|
{showHeader && question.header && (
|
|
133
|
-
<span className="
|
|
133
|
+
<span className="self-start rounded bg-muted px-1.5 py-0.5 text-[10px] leading-5 text-muted-foreground">
|
|
134
134
|
{question.header}
|
|
135
135
|
</span>
|
|
136
136
|
)}
|
|
137
|
-
<span className="
|
|
137
|
+
<span className="break-words text-[12px] leading-5 text-foreground/90">{question.question}</span>
|
|
138
138
|
</div>
|
|
139
139
|
<div className="flex flex-col gap-1">
|
|
140
140
|
{question.options.map((opt) => {
|
|
@@ -142,21 +142,28 @@ function QuestionBody({
|
|
|
142
142
|
return (
|
|
143
143
|
<div
|
|
144
144
|
key={opt.label}
|
|
145
|
-
className={`
|
|
145
|
+
className={`grid grid-cols-[auto_minmax(0,1fr)] gap-x-1.5 gap-y-1 rounded px-1.5 py-0.5 text-[11px] ${
|
|
146
146
|
isChosen ? "bg-primary/10 text-foreground" : "text-muted-foreground/60"
|
|
147
147
|
}`}
|
|
148
148
|
>
|
|
149
149
|
<span
|
|
150
|
-
className={`size-3 shrink-0 ${
|
|
150
|
+
className={`mt-0.5 size-3 shrink-0 ${
|
|
151
151
|
isChosen ? "icon-[mdi--check-circle] text-primary" : "icon-[mdi--circle-outline]"
|
|
152
152
|
}`}
|
|
153
153
|
/>
|
|
154
|
-
<span className="
|
|
155
|
-
{opt.badges
|
|
156
|
-
<
|
|
157
|
-
{b
|
|
158
|
-
|
|
159
|
-
|
|
154
|
+
<span className="break-words leading-4">{opt.label}</span>
|
|
155
|
+
{opt.badges && opt.badges.length > 0 && (
|
|
156
|
+
<div className="col-start-2 flex flex-wrap items-center gap-1">
|
|
157
|
+
{opt.badges.map((b) => (
|
|
158
|
+
<span
|
|
159
|
+
key={b}
|
|
160
|
+
className="whitespace-nowrap rounded-full bg-primary/15 px-1 text-[9px] leading-4 text-primary"
|
|
161
|
+
>
|
|
162
|
+
{b}
|
|
163
|
+
</span>
|
|
164
|
+
))}
|
|
165
|
+
</div>
|
|
166
|
+
)}
|
|
160
167
|
</div>
|
|
161
168
|
);
|
|
162
169
|
})}
|