@sero-ai/ui 0.4.1 → 0.5.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/.turbo/turbo-build.log +397 -384
- package/.turbo/turbo-test.log +18 -0
- package/.turbo/turbo-typecheck.log +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/components/ai-elements/agent.cjs +6 -6
- package/dist/components/ai-elements/agent.js +6 -6
- package/dist/components/ai-elements/artifact.cjs +2 -2
- package/dist/components/ai-elements/artifact.js +2 -2
- package/dist/components/ai-elements/attachments.cjs +2 -2
- package/dist/components/ai-elements/attachments.js +2 -2
- package/dist/components/ai-elements/chain-of-thought.cjs +2 -2
- package/dist/components/ai-elements/chain-of-thought.js +2 -2
- package/dist/components/ai-elements/code-block.cjs +7 -5
- package/dist/components/ai-elements/code-block.d.cts +2 -1
- package/dist/components/ai-elements/code-block.d.ts +2 -1
- package/dist/components/ai-elements/code-block.js +7 -5
- package/dist/components/ai-elements/commit.cjs +2 -2
- package/dist/components/ai-elements/commit.js +2 -2
- package/dist/components/ai-elements/confirmation.cjs +1 -1
- package/dist/components/ai-elements/confirmation.js +1 -1
- package/dist/components/ai-elements/conversation.cjs +2 -2
- package/dist/components/ai-elements/conversation.js +2 -2
- package/dist/components/ai-elements/environment-variables.cjs +3 -3
- package/dist/components/ai-elements/environment-variables.js +3 -3
- package/dist/components/ai-elements/file-tree.cjs +1 -1
- package/dist/components/ai-elements/file-tree.js +1 -1
- package/dist/components/ai-elements/inline-citation.cjs +3 -3
- package/dist/components/ai-elements/inline-citation.js +3 -3
- package/dist/components/ai-elements/jsx-preview.cjs +1 -1
- package/dist/components/ai-elements/jsx-preview.js +1 -1
- package/dist/components/ai-elements/message.cjs +1 -1
- package/dist/components/ai-elements/message.js +1 -1
- package/dist/components/ai-elements/package-info.cjs +4 -4
- package/dist/components/ai-elements/package-info.js +4 -4
- package/dist/components/ai-elements/prompt-input-context.cjs +2 -3
- package/dist/components/ai-elements/prompt-input-context.js +2 -3
- package/dist/components/ai-elements/queue.cjs +2 -2
- package/dist/components/ai-elements/queue.js +2 -2
- package/dist/components/ai-elements/reasoning.cjs +2 -2
- package/dist/components/ai-elements/reasoning.js +2 -2
- package/dist/components/ai-elements/sandbox.cjs +3 -3
- package/dist/components/ai-elements/sandbox.js +3 -3
- package/dist/components/ai-elements/schema-display.cjs +12 -12
- package/dist/components/ai-elements/schema-display.js +12 -12
- package/dist/components/ai-elements/speech-input.cjs +18 -2
- package/dist/components/ai-elements/speech-input.js +16 -0
- package/dist/components/ai-elements/stack-trace.cjs +1 -1
- package/dist/components/ai-elements/stack-trace.js +1 -1
- package/dist/components/ai-elements/task.cjs +3 -3
- package/dist/components/ai-elements/task.js +3 -3
- package/dist/components/ai-elements/terminal.cjs +2 -2
- package/dist/components/ai-elements/terminal.js +2 -2
- package/dist/components/ai-elements/test-results.cjs +4 -4
- package/dist/components/ai-elements/test-results.js +4 -4
- package/dist/components/ai-elements/tool.cjs +4 -4
- package/dist/components/ai-elements/tool.js +4 -4
- package/dist/components/ai-elements/transcription.cjs +1 -1
- package/dist/components/ai-elements/transcription.js +1 -1
- package/dist/components/ai-elements/web-preview.cjs +2 -2
- package/dist/components/ai-elements/web-preview.js +2 -2
- package/dist/components/context-editor/CapabilitySection.cjs +2 -2
- package/dist/components/context-editor/CapabilitySection.js +2 -2
- package/dist/components/context-editor/ContextEditor.cjs +2 -2
- package/dist/components/context-editor/ContextEditor.js +2 -2
- package/dist/components/context-editor/PresetBar.cjs +3 -3
- package/dist/components/context-editor/PresetBar.js +3 -3
- package/dist/components/context-editor/SystemPromptSection.cjs +4 -4
- package/dist/components/context-editor/SystemPromptSection.js +4 -4
- package/dist/components/context-editor/parts.cjs +6 -6
- package/dist/components/context-editor/parts.js +6 -6
- package/dist/components/dashboard/activity-list.cjs +2 -2
- package/dist/components/dashboard/activity-list.js +2 -2
- package/dist/components/dashboard/empty-state.cjs +1 -1
- package/dist/components/dashboard/empty-state.js +1 -1
- package/dist/components/dashboard/item-list.cjs +2 -2
- package/dist/components/dashboard/item-list.js +2 -2
- package/dist/components/dashboard/layout.cjs +1 -1
- package/dist/components/dashboard/layout.js +1 -1
- package/dist/components/dashboard/metric.cjs +1 -1
- package/dist/components/dashboard/metric.js +1 -1
- package/dist/components/dashboard/stale-indicator.cjs +1 -1
- package/dist/components/dashboard/stale-indicator.js +1 -1
- package/dist/components/dashboard/typography.cjs +4 -4
- package/dist/components/dashboard/typography.d.cts +1 -1
- package/dist/components/dashboard/typography.d.ts +1 -1
- package/dist/components/dashboard/typography.js +4 -4
- package/dist/components/model-selection/available-model-picker.cjs +6 -6
- package/dist/components/model-selection/available-model-picker.js +6 -6
- package/dist/components/model-selection/thinking-level-picker.cjs +1 -1
- package/dist/components/model-selection/thinking-level-picker.js +1 -1
- package/dist/components/model-selection/thinking-picker.cjs +70 -0
- package/dist/components/model-selection/thinking-picker.d.cts +12 -0
- package/dist/components/model-selection/thinking-picker.d.ts +12 -0
- package/dist/components/model-selection/thinking-picker.js +70 -0
- package/dist/components/ui/accordion.cjs +2 -2
- package/dist/components/ui/accordion.js +2 -2
- package/dist/components/ui/alert-dialog.cjs +4 -2
- package/dist/components/ui/alert-dialog.js +4 -2
- package/dist/components/ui/alert.cjs +2 -2
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/avatar.cjs +2 -2
- package/dist/components/ui/avatar.js +2 -2
- package/dist/components/ui/breadcrumb.cjs +1 -1
- package/dist/components/ui/breadcrumb.js +1 -1
- package/dist/components/ui/button-group.cjs +1 -1
- package/dist/components/ui/button-group.js +1 -1
- package/dist/components/ui/button.cjs +1 -1
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/calendar.cjs +2 -2
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/card.cjs +1 -1
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.cjs +3 -2
- package/dist/components/ui/carousel.js +2 -1
- package/dist/components/ui/chart.cjs +36 -27
- package/dist/components/ui/chart.d.cts +21 -17
- package/dist/components/ui/chart.d.ts +21 -17
- package/dist/components/ui/chart.js +30 -21
- package/dist/components/ui/combobox.cjs +7 -5
- package/dist/components/ui/combobox.js +7 -5
- package/dist/components/ui/command.cjs +3 -3
- package/dist/components/ui/command.js +3 -3
- package/dist/components/ui/context-menu.cjs +10 -7
- package/dist/components/ui/context-menu.js +10 -7
- package/dist/components/ui/dialog.cjs +4 -2
- package/dist/components/ui/dialog.js +4 -2
- package/dist/components/ui/drawer.cjs +4 -2
- package/dist/components/ui/drawer.js +4 -2
- package/dist/components/ui/dropdown-menu.cjs +10 -7
- package/dist/components/ui/dropdown-menu.js +10 -7
- package/dist/components/ui/empty.cjs +2 -2
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/field.cjs +5 -5
- package/dist/components/ui/field.js +5 -5
- package/dist/components/ui/form.cjs +2 -2
- package/dist/components/ui/form.d.cts +1 -1
- package/dist/components/ui/form.d.ts +1 -1
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/hover-card.cjs +3 -1
- package/dist/components/ui/hover-card.js +3 -1
- package/dist/components/ui/input-group.cjs +3 -3
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-otp.cjs +1 -1
- package/dist/components/ui/input-otp.js +1 -1
- package/dist/components/ui/input.cjs +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/item.cjs +3 -3
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/label.cjs +1 -1
- package/dist/components/ui/label.js +1 -1
- package/dist/components/ui/menubar.cjs +9 -7
- package/dist/components/ui/menubar.js +9 -7
- package/dist/components/ui/native-select.cjs +1 -1
- package/dist/components/ui/native-select.js +1 -1
- package/dist/components/ui/navigation-menu.cjs +2 -2
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/plugin-safety-disclaimer.cjs +1 -1
- package/dist/components/ui/plugin-safety-disclaimer.js +1 -1
- package/dist/components/ui/popover.cjs +4 -2
- package/dist/components/ui/popover.js +4 -2
- package/dist/components/ui/select.cjs +5 -3
- package/dist/components/ui/select.js +5 -3
- package/dist/components/ui/sheet.cjs +4 -2
- package/dist/components/ui/sheet.js +4 -2
- package/dist/components/ui/sidebar.cjs +5 -5
- package/dist/components/ui/sidebar.js +5 -5
- package/dist/components/ui/table.cjs +2 -2
- package/dist/components/ui/table.js +2 -2
- package/dist/components/ui/tabs.cjs +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/components/ui/textarea.cjs +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/toggle.cjs +1 -1
- package/dist/components/ui/toggle.js +1 -1
- package/dist/components/ui/tooltip.cjs +3 -1
- package/dist/components/ui/tooltip.js +3 -1
- package/dist/index.cjs +5 -56
- package/dist/index.d.cts +2 -65
- package/dist/index.d.ts +2 -65
- package/dist/index.js +5 -56
- package/dist/plugin-style-scope-context.cjs +10 -0
- package/dist/plugin-style-scope-context.d.cts +13 -0
- package/dist/plugin-style-scope-context.d.ts +13 -0
- package/dist/plugin-style-scope-context.js +10 -0
- package/dist/plugin-style-scope.cjs +25 -0
- package/dist/plugin-style-scope.d.cts +11 -0
- package/dist/plugin-style-scope.d.ts +11 -0
- package/dist/plugin-style-scope.js +25 -0
- package/dist/reference.cjs +71 -98
- package/dist/reference.js +71 -98
- package/dist/styles/ai-elements.css +2 -0
- package/dist/styles/context-editor.css +2 -0
- package/dist/styles/globals.css +22 -3
- package/dist/styles/model-selection.css +2 -0
- package/dist/styles/plugin-theme.css +80 -0
- package/dist/styles/plugin.css +17 -2
- package/package.json +32 -19
- package/scripts/smoke-dist.mjs +104 -2
- package/src/components/ai-elements/agent.tsx +6 -6
- package/src/components/ai-elements/artifact.tsx +2 -2
- package/src/components/ai-elements/attachments.tsx +2 -2
- package/src/components/ai-elements/chain-of-thought.tsx +2 -2
- package/src/components/ai-elements/code-block.tsx +6 -3
- package/src/components/ai-elements/commit.tsx +2 -2
- package/src/components/ai-elements/confirmation.tsx +1 -1
- package/src/components/ai-elements/conversation.tsx +2 -2
- package/src/components/ai-elements/environment-variables.tsx +3 -3
- package/src/components/ai-elements/file-tree.tsx +1 -1
- package/src/components/ai-elements/inline-citation.tsx +3 -3
- package/src/components/ai-elements/jsx-preview.tsx +1 -1
- package/src/components/ai-elements/message.tsx +1 -1
- package/src/components/ai-elements/package-info.tsx +4 -4
- package/src/components/ai-elements/prompt-input-context.tsx +3 -2
- package/src/components/ai-elements/queue.tsx +2 -2
- package/src/components/ai-elements/reasoning.tsx +2 -2
- package/src/components/ai-elements/sandbox.tsx +3 -3
- package/src/components/ai-elements/schema-display.tsx +12 -12
- package/src/components/ai-elements/speech-input.tsx +17 -0
- package/src/components/ai-elements/stack-trace.tsx +1 -1
- package/src/components/ai-elements/task.tsx +3 -3
- package/src/components/ai-elements/terminal.tsx +2 -2
- package/src/components/ai-elements/test-results.tsx +4 -4
- package/src/components/ai-elements/tool.tsx +4 -4
- package/src/components/ai-elements/transcription.tsx +1 -1
- package/src/components/ai-elements/web-preview.tsx +2 -2
- package/src/components/context-editor/CapabilitySection.tsx +2 -2
- package/src/components/context-editor/ContextEditor.tsx +2 -2
- package/src/components/context-editor/PresetBar.tsx +3 -3
- package/src/components/context-editor/SystemPromptSection.tsx +4 -4
- package/src/components/context-editor/parts.tsx +6 -6
- package/src/components/dashboard/activity-list.tsx +2 -2
- package/src/components/dashboard/empty-state.tsx +1 -1
- package/src/components/dashboard/item-list.tsx +2 -2
- package/src/components/dashboard/layout.tsx +1 -1
- package/src/components/dashboard/metric.tsx +1 -1
- package/src/components/dashboard/stale-indicator.tsx +1 -1
- package/src/components/dashboard/typography.tsx +5 -5
- package/src/components/model-selection/available-model-picker.tsx +7 -7
- package/src/components/model-selection/thinking-level-picker.tsx +1 -1
- package/src/components/model-selection/thinking-picker.tsx +90 -0
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/alert-dialog.tsx +4 -2
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +2 -2
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/button-group.tsx +1 -1
- package/src/components/ui/button.tsx +1 -1
- package/src/components/ui/calendar.tsx +3 -3
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/carousel.tsx +2 -1
- package/src/components/ui/chart.tsx +54 -36
- package/src/components/ui/combobox.tsx +7 -5
- package/src/components/ui/command.tsx +3 -3
- package/src/components/ui/context-menu.tsx +10 -7
- package/src/components/ui/dialog.tsx +4 -2
- package/src/components/ui/drawer.tsx +4 -2
- package/src/components/ui/dropdown-menu.tsx +10 -7
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/field.tsx +5 -5
- package/src/components/ui/form.tsx +2 -2
- package/src/components/ui/hover-card.tsx +3 -1
- package/src/components/ui/input-group.tsx +3 -3
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/menubar.tsx +9 -7
- package/src/components/ui/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +2 -2
- package/src/components/ui/plugin-safety-disclaimer.tsx +1 -1
- package/src/components/ui/popover.tsx +4 -2
- package/src/components/ui/select.tsx +5 -3
- package/src/components/ui/sheet.tsx +4 -2
- package/src/components/ui/sidebar.tsx +5 -5
- package/src/components/ui/table.tsx +2 -2
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle.tsx +1 -1
- package/src/components/ui/tooltip.tsx +3 -1
- package/src/index.ts +6 -63
- package/src/plugin-style-scope-context.ts +21 -0
- package/src/plugin-style-scope.test.tsx +38 -0
- package/src/plugin-style-scope.tsx +35 -0
- package/src/styles/ai-elements.css +2 -0
- package/src/styles/context-editor.css +2 -0
- package/src/styles/globals.css +22 -3
- package/src/styles/model-selection.css +2 -0
- package/src/styles/plugin-theme.css +80 -0
- package/src/styles/plugin.css +17 -2
|
@@ -101,6 +101,7 @@ export const SpeechInput = ({
|
|
|
101
101
|
const [isRecognitionReady, setIsRecognitionReady] = useState(false);
|
|
102
102
|
const recognitionRef = useRef<SpeechRecognition | null>(null);
|
|
103
103
|
const mediaRecorderRef = useRef<MediaRecorder | null>(null);
|
|
104
|
+
const mediaRecorderCleanupRef = useRef<(() => void) | null>(null);
|
|
104
105
|
const streamRef = useRef<MediaStream | null>(null);
|
|
105
106
|
const audioChunksRef = useRef<Blob[]>([]);
|
|
106
107
|
const onTranscriptionChangeRef = useRef<
|
|
@@ -184,6 +185,7 @@ export const SpeechInput = ({
|
|
|
184
185
|
if (mediaRecorderRef.current?.state === "recording") {
|
|
185
186
|
mediaRecorderRef.current.stop();
|
|
186
187
|
}
|
|
188
|
+
mediaRecorderCleanupRef.current?.();
|
|
187
189
|
if (streamRef.current) {
|
|
188
190
|
for (const track of streamRef.current.getTracks()) {
|
|
189
191
|
track.stop();
|
|
@@ -216,6 +218,7 @@ export const SpeechInput = ({
|
|
|
216
218
|
track.stop();
|
|
217
219
|
}
|
|
218
220
|
streamRef.current = null;
|
|
221
|
+
cleanupMediaRecorder();
|
|
219
222
|
|
|
220
223
|
const audioBlob = new Blob(audioChunksRef.current, {
|
|
221
224
|
type: "audio/webm",
|
|
@@ -242,6 +245,19 @@ export const SpeechInput = ({
|
|
|
242
245
|
track.stop();
|
|
243
246
|
}
|
|
244
247
|
streamRef.current = null;
|
|
248
|
+
cleanupMediaRecorder();
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const cleanupMediaRecorder = () => {
|
|
252
|
+
mediaRecorder.removeEventListener("dataavailable", handleDataAvailable);
|
|
253
|
+
mediaRecorder.removeEventListener("stop", handleStop);
|
|
254
|
+
mediaRecorder.removeEventListener("error", handleError);
|
|
255
|
+
if (mediaRecorderRef.current === mediaRecorder) {
|
|
256
|
+
mediaRecorderRef.current = null;
|
|
257
|
+
}
|
|
258
|
+
if (mediaRecorderCleanupRef.current === cleanupMediaRecorder) {
|
|
259
|
+
mediaRecorderCleanupRef.current = null;
|
|
260
|
+
}
|
|
245
261
|
};
|
|
246
262
|
|
|
247
263
|
mediaRecorder.addEventListener("dataavailable", handleDataAvailable);
|
|
@@ -249,6 +265,7 @@ export const SpeechInput = ({
|
|
|
249
265
|
mediaRecorder.addEventListener("error", handleError);
|
|
250
266
|
|
|
251
267
|
mediaRecorderRef.current = mediaRecorder;
|
|
268
|
+
mediaRecorderCleanupRef.current = cleanupMediaRecorder;
|
|
252
269
|
mediaRecorder.start();
|
|
253
270
|
setIsListening(true);
|
|
254
271
|
} catch {
|
|
@@ -197,7 +197,7 @@ export const StackTrace = memo(
|
|
|
197
197
|
<StackTraceContext.Provider value={contextValue}>
|
|
198
198
|
<div
|
|
199
199
|
className={cn(
|
|
200
|
-
"not-prose w-full overflow-hidden rounded-lg border bg-background font-mono text-
|
|
200
|
+
"not-prose w-full overflow-hidden rounded-lg border bg-background font-mono text-base",
|
|
201
201
|
className
|
|
202
202
|
)}
|
|
203
203
|
{...props}
|
|
@@ -31,7 +31,7 @@ export const TaskItemFile = ({
|
|
|
31
31
|
export type TaskItemProps = ComponentProps<"div">;
|
|
32
32
|
|
|
33
33
|
export const TaskItem = ({ children, className, ...props }: TaskItemProps) => (
|
|
34
|
-
<div className={cn("text-muted-foreground text-
|
|
34
|
+
<div className={cn("text-muted-foreground text-base", className)} {...props}>
|
|
35
35
|
{children}
|
|
36
36
|
</div>
|
|
37
37
|
);
|
|
@@ -58,9 +58,9 @@ export const TaskTrigger = ({
|
|
|
58
58
|
}: TaskTriggerProps) => (
|
|
59
59
|
<CollapsibleTrigger asChild className={cn("group", className)} {...props}>
|
|
60
60
|
{children ?? (
|
|
61
|
-
<div className="flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-
|
|
61
|
+
<div className="flex w-full cursor-pointer items-center gap-2 text-muted-foreground text-base transition-colors hover:text-foreground">
|
|
62
62
|
<SearchIcon className="size-4" />
|
|
63
|
-
<p className="text-
|
|
63
|
+
<p className="text-base">{title}</p>
|
|
64
64
|
<ChevronDownIcon className="size-4 transition-transform group-data-[state=open]:rotate-180" />
|
|
65
65
|
</div>
|
|
66
66
|
)}
|
|
@@ -107,7 +107,7 @@ export const TerminalTitle = ({
|
|
|
107
107
|
...props
|
|
108
108
|
}: TerminalTitleProps) => (
|
|
109
109
|
<div
|
|
110
|
-
className={cn("flex items-center gap-2 text-
|
|
110
|
+
className={cn("flex items-center gap-2 text-base text-zinc-400", className)}
|
|
111
111
|
{...props}
|
|
112
112
|
>
|
|
113
113
|
<TerminalIcon className="size-4" />
|
|
@@ -258,7 +258,7 @@ export const TerminalContent = ({
|
|
|
258
258
|
return (
|
|
259
259
|
<div
|
|
260
260
|
className={cn(
|
|
261
|
-
"max-h-96 overflow-auto p-4 font-mono text-
|
|
261
|
+
"max-h-96 overflow-auto p-4 font-mono text-base leading-relaxed",
|
|
262
262
|
className
|
|
263
263
|
)}
|
|
264
264
|
ref={containerRef}
|
|
@@ -151,7 +151,7 @@ export const TestResultsDuration = ({
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
return (
|
|
154
|
-
<span className={cn("text-muted-foreground text-
|
|
154
|
+
<span className={cn("text-muted-foreground text-base", className)} {...props}>
|
|
155
155
|
{children ?? formatDuration(summary.duration)}
|
|
156
156
|
</span>
|
|
157
157
|
);
|
|
@@ -263,7 +263,7 @@ export const TestSuiteName = ({
|
|
|
263
263
|
>
|
|
264
264
|
<ChevronRightIcon className="size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90" />
|
|
265
265
|
<TestStatusIcon status={status} />
|
|
266
|
-
<span className="font-medium text-
|
|
266
|
+
<span className="font-medium text-base">{children ?? name}</span>
|
|
267
267
|
</CollapsibleTrigger>
|
|
268
268
|
);
|
|
269
269
|
};
|
|
@@ -353,7 +353,7 @@ export const Test = ({
|
|
|
353
353
|
return (
|
|
354
354
|
<TestContext.Provider value={contextValue}>
|
|
355
355
|
<div
|
|
356
|
-
className={cn("flex items-center gap-2 px-4 py-2 text-
|
|
356
|
+
className={cn("flex items-center gap-2 px-4 py-2 text-base", className)}
|
|
357
357
|
{...props}
|
|
358
358
|
>
|
|
359
359
|
{children ?? (
|
|
@@ -469,7 +469,7 @@ export const TestErrorMessage = ({
|
|
|
469
469
|
}: TestErrorMessageProps) => (
|
|
470
470
|
<p
|
|
471
471
|
className={cn(
|
|
472
|
-
"font-medium text-red-700 text-
|
|
472
|
+
"font-medium text-red-700 text-base dark:text-red-400",
|
|
473
473
|
className
|
|
474
474
|
)}
|
|
475
475
|
{...props}
|
|
@@ -92,7 +92,7 @@ export const ToolHeader = ({
|
|
|
92
92
|
{...props}
|
|
93
93
|
>
|
|
94
94
|
<div className="flex items-center gap-2">
|
|
95
|
-
<WrenchIcon className="size-
|
|
95
|
+
<WrenchIcon className="size-3.5 text-muted-foreground" />
|
|
96
96
|
<span className="font-medium text-sm">{title ?? derivedName}</span>
|
|
97
97
|
{getStatusBadge(state)}
|
|
98
98
|
</div>
|
|
@@ -123,7 +123,7 @@ export const ToolInput = ({ className, input, ...props }: ToolInputProps) => (
|
|
|
123
123
|
Parameters
|
|
124
124
|
</h4>
|
|
125
125
|
<div className="rounded-md bg-muted/50">
|
|
126
|
-
<CodeBlock code={JSON.stringify(input, null, 2)} language="json" />
|
|
126
|
+
<CodeBlock className="text-sm" code={JSON.stringify(input, null, 2)} language="json" />
|
|
127
127
|
</div>
|
|
128
128
|
</div>
|
|
129
129
|
);
|
|
@@ -147,10 +147,10 @@ export const ToolOutput = ({
|
|
|
147
147
|
|
|
148
148
|
if (typeof output === "object" && !isValidElement(output)) {
|
|
149
149
|
Output = (
|
|
150
|
-
<CodeBlock code={JSON.stringify(output, null, 2)} language="json" />
|
|
150
|
+
<CodeBlock className="text-sm" code={JSON.stringify(output, null, 2)} language="json" />
|
|
151
151
|
);
|
|
152
152
|
} else if (typeof output === "string") {
|
|
153
|
-
Output = <CodeBlock code={output} language="json" />;
|
|
153
|
+
Output = <CodeBlock className="text-sm" code={output} language="json" />;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
return (
|
|
@@ -60,7 +60,7 @@ export const Transcription = ({
|
|
|
60
60
|
<TranscriptionContext.Provider value={contextValue}>
|
|
61
61
|
<div
|
|
62
62
|
className={cn(
|
|
63
|
-
"flex flex-wrap gap-1 text-
|
|
63
|
+
"flex flex-wrap gap-1 text-base leading-relaxed",
|
|
64
64
|
className
|
|
65
65
|
)}
|
|
66
66
|
data-slot="transcription"
|
|
@@ -173,7 +173,7 @@ export const WebPreviewUrl = ({
|
|
|
173
173
|
|
|
174
174
|
return (
|
|
175
175
|
<Input
|
|
176
|
-
className="h-8 flex-1 text-
|
|
176
|
+
className="h-8 flex-1 text-base"
|
|
177
177
|
onChange={onChange ?? handleChange}
|
|
178
178
|
onKeyDown={handleKeyDown}
|
|
179
179
|
placeholder="Enter URL..."
|
|
@@ -227,7 +227,7 @@ export const WebPreviewConsole = ({
|
|
|
227
227
|
|
|
228
228
|
return (
|
|
229
229
|
<Collapsible
|
|
230
|
-
className={cn("border-t bg-muted/50 font-mono text-
|
|
230
|
+
className={cn("border-t bg-muted/50 font-mono text-base", className)}
|
|
231
231
|
onOpenChange={setConsoleOpen}
|
|
232
232
|
open={consoleOpen}
|
|
233
233
|
{...props}
|
|
@@ -53,7 +53,7 @@ export function CapabilitySection<TItem extends ContextToolInfo | ContextSkillIn
|
|
|
53
53
|
<div className="space-y-1">
|
|
54
54
|
{items.length > 0 && (
|
|
55
55
|
<div className="mb-1 flex items-center justify-between rounded-md border-b border-border/20 px-2 pb-2">
|
|
56
|
-
<span className="text-
|
|
56
|
+
<span className="text-sm font-medium text-[var(--text-secondary)]">
|
|
57
57
|
{includeAllLabel}
|
|
58
58
|
</span>
|
|
59
59
|
<Switch
|
|
@@ -75,7 +75,7 @@ export function CapabilitySection<TItem extends ContextToolInfo | ContextSkillIn
|
|
|
75
75
|
))}
|
|
76
76
|
|
|
77
77
|
{items.length === 0 && (
|
|
78
|
-
<span className="text-
|
|
78
|
+
<span className="text-sm italic text-[var(--text-muted)]">
|
|
79
79
|
{emptyLabel}
|
|
80
80
|
</span>
|
|
81
81
|
)}
|
|
@@ -81,7 +81,7 @@ export function ContextEditor({
|
|
|
81
81
|
showCloseButton
|
|
82
82
|
>
|
|
83
83
|
<DialogHeader>
|
|
84
|
-
<DialogTitle className="flex items-center gap-2 text-
|
|
84
|
+
<DialogTitle className="flex items-center gap-2 text-base">
|
|
85
85
|
<Settings2 className="size-4 text-[var(--text-muted)]" />
|
|
86
86
|
{title}
|
|
87
87
|
</DialogTitle>
|
|
@@ -113,7 +113,7 @@ export function ContextEditor({
|
|
|
113
113
|
{applyError && (
|
|
114
114
|
<div className="flex items-start gap-2 rounded-md border border-status-error-border bg-status-error-muted px-3 py-2">
|
|
115
115
|
<AlertCircle className="mt-0.5 size-3.5 shrink-0 text-status-error" />
|
|
116
|
-
<span className="text-
|
|
116
|
+
<span className="text-sm text-status-error">{applyError}</span>
|
|
117
117
|
</div>
|
|
118
118
|
)}
|
|
119
119
|
|
|
@@ -39,7 +39,7 @@ export function PresetBar({
|
|
|
39
39
|
return (
|
|
40
40
|
<>
|
|
41
41
|
<div className="flex items-center gap-2">
|
|
42
|
-
<span className="text-
|
|
42
|
+
<span className="text-sm font-medium text-[var(--text-muted)]">
|
|
43
43
|
Preset:
|
|
44
44
|
</span>
|
|
45
45
|
<Select value={activePresetId ?? ''} onValueChange={onPresetChange}>
|
|
@@ -68,7 +68,7 @@ export function PresetBar({
|
|
|
68
68
|
{!showSaveInput && (
|
|
69
69
|
<button type="button"
|
|
70
70
|
onClick={onShowSave}
|
|
71
|
-
className="flex items-center gap-1 rounded-md px-2 py-1 text-
|
|
71
|
+
className="flex items-center gap-1 rounded-md px-2 py-1 text-sm text-[var(--text-muted)] transition-colors hover:bg-[var(--bg-elevated)] hover:text-[var(--text-secondary)]"
|
|
72
72
|
>
|
|
73
73
|
<Save className="size-3" />
|
|
74
74
|
Save as
|
|
@@ -78,7 +78,7 @@ export function PresetBar({
|
|
|
78
78
|
{hasOverrides && (
|
|
79
79
|
<button type="button"
|
|
80
80
|
onClick={onReset}
|
|
81
|
-
className="ml-auto flex items-center gap-1 rounded-md px-2 py-1 text-
|
|
81
|
+
className="ml-auto flex items-center gap-1 rounded-md px-2 py-1 text-sm text-[var(--text-muted)] transition-colors hover:bg-[var(--bg-elevated)] hover:text-[var(--text-secondary)]"
|
|
82
82
|
>
|
|
83
83
|
<RotateCcw className="size-3" />
|
|
84
84
|
Reset
|
|
@@ -59,7 +59,7 @@ export function SystemPromptSection({
|
|
|
59
59
|
>
|
|
60
60
|
<div className="space-y-2">
|
|
61
61
|
<div className="flex items-center justify-between">
|
|
62
|
-
<span className="text-
|
|
62
|
+
<span className="text-sm text-[var(--text-muted)]">
|
|
63
63
|
{systemPrompt === null
|
|
64
64
|
? c.defaultHint
|
|
65
65
|
: systemPrompt === ''
|
|
@@ -69,7 +69,7 @@ export function SystemPromptSection({
|
|
|
69
69
|
{systemPrompt !== null && (
|
|
70
70
|
<button type="button"
|
|
71
71
|
onClick={() => onSystemPromptChange(null)}
|
|
72
|
-
className="text-
|
|
72
|
+
className="text-sm text-[var(--text-muted)] transition-colors hover:text-[var(--text-secondary)]"
|
|
73
73
|
>
|
|
74
74
|
Reset to default
|
|
75
75
|
</button>
|
|
@@ -78,10 +78,10 @@ export function SystemPromptSection({
|
|
|
78
78
|
<textarea aria-label="System prompt"
|
|
79
79
|
value={displayedPrompt}
|
|
80
80
|
onChange={(event) => onSystemPromptChange(event.target.value)}
|
|
81
|
-
className="h-80 w-full resize-y rounded-md border border-border/30 bg-[var(--bg-base)] p-2 font-mono text-
|
|
81
|
+
className="h-80 w-full resize-y rounded-md border border-border/30 bg-[var(--bg-base)] p-2 font-mono text-sm text-[var(--text-secondary)] placeholder:text-[var(--text-muted)] outline-none focus:border-[var(--accent-primary)]"
|
|
82
82
|
placeholder={c.placeholder}
|
|
83
83
|
/>
|
|
84
|
-
<p className="text-
|
|
84
|
+
<p className="text-sm text-[var(--text-muted)]">{c.footnote}</p>
|
|
85
85
|
</div>
|
|
86
86
|
</ContextSection>
|
|
87
87
|
);
|
|
@@ -94,7 +94,7 @@ export function ContextSection({
|
|
|
94
94
|
</span>
|
|
95
95
|
|
|
96
96
|
{count !== undefined && (
|
|
97
|
-
<span className="text-
|
|
97
|
+
<span className="text-sm text-[var(--text-muted)]">
|
|
98
98
|
({count})
|
|
99
99
|
</span>
|
|
100
100
|
)}
|
|
@@ -102,7 +102,7 @@ export function ContextSection({
|
|
|
102
102
|
{badge && (
|
|
103
103
|
<span
|
|
104
104
|
className={cn(
|
|
105
|
-
'ml-auto rounded-full px-2 py-0.5 text-
|
|
105
|
+
'ml-auto rounded-full px-2 py-0.5 text-sm font-medium',
|
|
106
106
|
badgeClass[badgeVariant],
|
|
107
107
|
)}
|
|
108
108
|
>
|
|
@@ -154,13 +154,13 @@ export function ToggleRow({
|
|
|
154
154
|
>
|
|
155
155
|
<div className="min-w-0 flex-1">
|
|
156
156
|
<div className={cn(
|
|
157
|
-
'text-
|
|
157
|
+
'text-sm font-medium',
|
|
158
158
|
enabled ? 'text-[var(--text-secondary)]' : 'text-[var(--text-muted)]',
|
|
159
159
|
)}>
|
|
160
160
|
{name}
|
|
161
161
|
</div>
|
|
162
162
|
{description && (
|
|
163
|
-
<div className="mt-0.5 text-
|
|
163
|
+
<div className="mt-0.5 text-sm leading-snug text-[var(--text-muted)]/60">
|
|
164
164
|
{description}
|
|
165
165
|
</div>
|
|
166
166
|
)}
|
|
@@ -202,13 +202,13 @@ export function SavePresetInput({
|
|
|
202
202
|
<button type="button"
|
|
203
203
|
onClick={() => name.trim() && onSave(name.trim())}
|
|
204
204
|
disabled={!name.trim()}
|
|
205
|
-
className="rounded-md bg-[var(--accent-primary)] px-2 py-1 text-
|
|
205
|
+
className="rounded-md bg-[var(--accent-primary)] px-2 py-1 text-sm font-medium text-white disabled:opacity-50"
|
|
206
206
|
>
|
|
207
207
|
Save
|
|
208
208
|
</button>
|
|
209
209
|
<button type="button"
|
|
210
210
|
onClick={onCancel}
|
|
211
|
-
className="text-
|
|
211
|
+
className="text-sm text-[var(--text-muted)] hover:text-[var(--text-secondary)]"
|
|
212
212
|
>
|
|
213
213
|
Cancel
|
|
214
214
|
</button>
|
|
@@ -53,7 +53,7 @@ function ActivityListItem({
|
|
|
53
53
|
{label}
|
|
54
54
|
</span>
|
|
55
55
|
{timestamp && (
|
|
56
|
-
<span className="shrink-0 text-
|
|
56
|
+
<span className="shrink-0 text-sm tabular-nums text-[var(--text-muted)]">
|
|
57
57
|
{timestamp}
|
|
58
58
|
</span>
|
|
59
59
|
)}
|
|
@@ -88,7 +88,7 @@ function ActivityList({
|
|
|
88
88
|
>
|
|
89
89
|
{children}
|
|
90
90
|
{overflowCount > 0 && (
|
|
91
|
-
<li className="pl-5 pt-0.5 text-
|
|
91
|
+
<li className="pl-5 pt-0.5 text-sm text-[var(--text-muted)]">
|
|
92
92
|
+{overflowCount} more
|
|
93
93
|
</li>
|
|
94
94
|
)}
|
|
@@ -53,7 +53,7 @@ function EmptyState({
|
|
|
53
53
|
<Icon icon={icon} size="md" className="text-current" />
|
|
54
54
|
</EmptyMedia>
|
|
55
55
|
)}
|
|
56
|
-
<EmptyTitle className="text-
|
|
56
|
+
<EmptyTitle className="text-base font-medium text-[var(--text-primary)]">
|
|
57
57
|
{title}
|
|
58
58
|
</EmptyTitle>
|
|
59
59
|
{message && (
|
|
@@ -65,7 +65,7 @@ function ItemListItem({
|
|
|
65
65
|
)}
|
|
66
66
|
</ItemContent>
|
|
67
67
|
{trailing && (
|
|
68
|
-
<span className="shrink-0 text-
|
|
68
|
+
<span className="shrink-0 text-sm tabular-nums text-[var(--text-muted)]">
|
|
69
69
|
{trailing}
|
|
70
70
|
</span>
|
|
71
71
|
)}
|
|
@@ -95,7 +95,7 @@ function ItemList({
|
|
|
95
95
|
>
|
|
96
96
|
{children}
|
|
97
97
|
{overflowCount > 0 && (
|
|
98
|
-
<span className="px-2 text-
|
|
98
|
+
<span className="px-2 text-sm text-[var(--text-muted)]">
|
|
99
99
|
+{overflowCount} more
|
|
100
100
|
</span>
|
|
101
101
|
)}
|
|
@@ -235,7 +235,7 @@ function Section({
|
|
|
235
235
|
<div className="flex items-center justify-between gap-2">
|
|
236
236
|
<div className="flex min-w-0 flex-col gap-0.5">
|
|
237
237
|
{heading && (
|
|
238
|
-
<h3 className="truncate text-
|
|
238
|
+
<h3 className="truncate text-sm font-semibold uppercase tracking-wider text-[var(--text-muted)]">
|
|
239
239
|
{heading}
|
|
240
240
|
</h3>
|
|
241
241
|
)}
|
|
@@ -67,7 +67,7 @@ function Metric({
|
|
|
67
67
|
>
|
|
68
68
|
<div className="flex items-center gap-1.5">
|
|
69
69
|
{icon && <Icon icon={icon} size="sm" />}
|
|
70
|
-
<span className="truncate text-
|
|
70
|
+
<span className="truncate text-sm font-medium uppercase tracking-wide text-[var(--text-muted)]">
|
|
71
71
|
{label}
|
|
72
72
|
</span>
|
|
73
73
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
// Text, Heading and Icon give one type scale and one icon treatment so
|
|
4
4
|
// equivalent text and icons render identically across widgets, replacing the
|
|
5
|
-
// scattered `text-
|
|
5
|
+
// scattered `text-xs`/`text-sm` and per-widget muted colours.
|
|
6
6
|
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -15,13 +15,13 @@ import { toneColor, type Tone } from "./tone";
|
|
|
15
15
|
const textVariants = cva("min-w-0", {
|
|
16
16
|
variants: {
|
|
17
17
|
variant: {
|
|
18
|
-
body: "text-
|
|
18
|
+
body: "text-base text-[var(--text-primary)]",
|
|
19
19
|
label:
|
|
20
|
-
"text-
|
|
20
|
+
"text-sm font-semibold uppercase tracking-wider text-[var(--text-muted)]",
|
|
21
21
|
supporting: "text-xs text-[var(--text-secondary)]",
|
|
22
22
|
muted: "text-xs text-[var(--text-muted)]",
|
|
23
23
|
numeric:
|
|
24
|
-
"text-
|
|
24
|
+
"text-base font-semibold tabular-nums text-[var(--text-primary)]",
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
defaultVariants: { variant: "body" },
|
|
@@ -72,7 +72,7 @@ function Text({
|
|
|
72
72
|
|
|
73
73
|
const headingSize = {
|
|
74
74
|
sm: "text-xs font-semibold",
|
|
75
|
-
md: "text-
|
|
75
|
+
md: "text-base font-semibold",
|
|
76
76
|
lg: "text-base font-semibold",
|
|
77
77
|
} as const;
|
|
78
78
|
|
|
@@ -102,7 +102,7 @@ export function AvailableModelPicker<
|
|
|
102
102
|
role="button"
|
|
103
103
|
tabIndex={disabled ? -1 : 0}
|
|
104
104
|
className={cn(
|
|
105
|
-
'flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-left text-
|
|
105
|
+
'flex w-full items-center gap-2 rounded-md border border-input bg-background px-3 py-2 text-left text-base transition-colors',
|
|
106
106
|
'hover:bg-secondary/50 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
107
107
|
disabled && 'cursor-not-allowed opacity-50',
|
|
108
108
|
className,
|
|
@@ -122,13 +122,13 @@ export function AvailableModelPicker<
|
|
|
122
122
|
<Sparkles className="size-3 shrink-0 text-amber-500/70" />
|
|
123
123
|
) : null}
|
|
124
124
|
</div>
|
|
125
|
-
<div className="truncate text-
|
|
125
|
+
<div className="truncate text-sm text-muted-foreground">
|
|
126
126
|
{selected.group.displayName}
|
|
127
127
|
</div>
|
|
128
128
|
</div>
|
|
129
129
|
</>
|
|
130
130
|
) : selected.fallbackLabel ? (
|
|
131
|
-
<span className="min-w-0 flex-1 truncate font-mono text-
|
|
131
|
+
<span className="min-w-0 flex-1 truncate font-mono text-sm text-muted-foreground">
|
|
132
132
|
{selected.fallbackLabel}
|
|
133
133
|
</span>
|
|
134
134
|
) : (
|
|
@@ -169,11 +169,11 @@ export function AvailableModelPicker<
|
|
|
169
169
|
|
|
170
170
|
<div className="max-h-[280px] overflow-y-auto py-1">
|
|
171
171
|
{groups.length === 0 ? (
|
|
172
|
-
<div className="px-3 py-4 text-center text-
|
|
172
|
+
<div className="px-3 py-4 text-center text-sm text-muted-foreground">
|
|
173
173
|
{noModelsLabel}
|
|
174
174
|
</div>
|
|
175
175
|
) : totalResults === 0 ? (
|
|
176
|
-
<div className="px-3 py-4 text-center text-
|
|
176
|
+
<div className="px-3 py-4 text-center text-sm text-muted-foreground">
|
|
177
177
|
{emptyLabel}
|
|
178
178
|
</div>
|
|
179
179
|
) : (
|
|
@@ -186,7 +186,7 @@ export function AvailableModelPicker<
|
|
|
186
186
|
alt={group.displayName}
|
|
187
187
|
className="size-3.5 shrink-0 rounded-sm dark:invert"
|
|
188
188
|
/>
|
|
189
|
-
<span className="text-
|
|
189
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-muted-foreground">
|
|
190
190
|
{group.displayName}
|
|
191
191
|
</span>
|
|
192
192
|
</div>
|
|
@@ -200,7 +200,7 @@ export function AvailableModelPicker<
|
|
|
200
200
|
type="button"
|
|
201
201
|
onClick={() => handleSelect(model.provider, model.modelId)}
|
|
202
202
|
className={cn(
|
|
203
|
-
'flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-
|
|
203
|
+
'flex w-full items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-sm transition-colors',
|
|
204
204
|
isSelected
|
|
205
205
|
? 'bg-secondary text-foreground'
|
|
206
206
|
: 'text-muted-foreground hover:bg-secondary/60 hover:text-foreground',
|
|
@@ -39,7 +39,7 @@ export function ThinkingLevelPicker({
|
|
|
39
39
|
disabled={disabled || !isAvailable}
|
|
40
40
|
onClick={() => onChange(level)}
|
|
41
41
|
className={cn(
|
|
42
|
-
'rounded-md px-2 py-1.5 text-
|
|
42
|
+
'rounded-md px-2 py-1.5 text-sm font-medium transition-colors',
|
|
43
43
|
isActive
|
|
44
44
|
? 'bg-background text-foreground shadow-sm'
|
|
45
45
|
: 'text-muted-foreground hover:bg-background/70 hover:text-foreground',
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Brain } from 'lucide-react';
|
|
2
|
+
import { motion } from 'motion/react';
|
|
3
|
+
import { THINKING_LABELS, THINKING_LEVELS, type ThinkingLevel } from '@sero-ai/common';
|
|
4
|
+
import { cn } from '../../lib/utils';
|
|
5
|
+
|
|
6
|
+
// Compact labels so all seven segments stay on a single line and share the same
|
|
7
|
+
// height — "Extra High" is the only label that would otherwise wrap.
|
|
8
|
+
const COMPACT_LABELS: Record<ThinkingLevel, string> = {
|
|
9
|
+
...THINKING_LABELS,
|
|
10
|
+
xhigh: 'X-High',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
interface ThinkingPickerProps {
|
|
14
|
+
available: readonly string[];
|
|
15
|
+
current: string;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
onSelect: (level: string) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function ThinkingPicker({
|
|
22
|
+
available,
|
|
23
|
+
current,
|
|
24
|
+
disabled,
|
|
25
|
+
onSelect,
|
|
26
|
+
className
|
|
27
|
+
}: ThinkingPickerProps) {
|
|
28
|
+
const levels = disabled
|
|
29
|
+
? THINKING_LEVELS
|
|
30
|
+
: THINKING_LEVELS.filter((level) => level === 'off' || available.includes(level));
|
|
31
|
+
const activeIndex = Math.max(
|
|
32
|
+
0,
|
|
33
|
+
levels.indexOf((disabled ? 'off' : current) as ThinkingLevel),
|
|
34
|
+
);
|
|
35
|
+
const isOff = disabled || current === 'off';
|
|
36
|
+
const isMax = !disabled && current === 'max';
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div
|
|
40
|
+
className={cn(`flex flex-col gap-2 border-[var(--border-subtle)] px-3 py-3 transition-opacity duration-150 ${
|
|
41
|
+
disabled ? 'pointer-events-none opacity-40' : ''
|
|
42
|
+
}`, className)}
|
|
43
|
+
>
|
|
44
|
+
<div className="flex items-center gap-1.5">
|
|
45
|
+
<Brain className="size-3 text-[var(--text-muted)]" />
|
|
46
|
+
<span className="text-sm font-semibold uppercase tracking-wider text-[var(--text-muted)]">
|
|
47
|
+
Thinking
|
|
48
|
+
</span>
|
|
49
|
+
</div>
|
|
50
|
+
<div className="relative flex rounded-lg border border-[var(--border-subtle)] bg-[var(--bg-base)] p-0.5">
|
|
51
|
+
<motion.div
|
|
52
|
+
className="absolute inset-y-0.5 rounded-md shadow-sm ring-1 ring-inset ring-white/5"
|
|
53
|
+
initial={false}
|
|
54
|
+
animate={{
|
|
55
|
+
x: `${activeIndex * 100}%`,
|
|
56
|
+
width: `${100 / levels.length}%`,
|
|
57
|
+
}}
|
|
58
|
+
transition={{ type: 'spring', stiffness: 500, damping: 38 }}
|
|
59
|
+
style={{
|
|
60
|
+
background: isOff
|
|
61
|
+
? 'var(--bg-elevated)'
|
|
62
|
+
: isMax
|
|
63
|
+
? 'linear-gradient(135deg, #f59e0b40, #ef444440)'
|
|
64
|
+
: 'linear-gradient(135deg, #6366f140, #8b5cf640)',
|
|
65
|
+
}}
|
|
66
|
+
/>
|
|
67
|
+
{levels.map((level) => {
|
|
68
|
+
const isActive = current === level && !disabled;
|
|
69
|
+
const textClass = isActive
|
|
70
|
+
? level === 'max'
|
|
71
|
+
? 'text-status-warning'
|
|
72
|
+
: level === 'off'
|
|
73
|
+
? 'text-[var(--text-primary)]'
|
|
74
|
+
: 'text-[var(--banner-primary)]'
|
|
75
|
+
: 'text-[var(--text-muted)] hover:text-[var(--text-secondary)]';
|
|
76
|
+
return (
|
|
77
|
+
<button
|
|
78
|
+
type="button"
|
|
79
|
+
key={level}
|
|
80
|
+
onClick={() => onSelect(level)}
|
|
81
|
+
className={`relative z-10 flex flex-1 items-center justify-center whitespace-nowrap rounded-md py-1.5 text-sm font-medium leading-none transition-colors duration-150 ${textClass}`}
|
|
82
|
+
>
|
|
83
|
+
{COMPACT_LABELS[level]}
|
|
84
|
+
</button>
|
|
85
|
+
);
|
|
86
|
+
})}
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
@@ -33,7 +33,7 @@ function AccordionTrigger({
|
|
|
33
33
|
<AccordionPrimitive.Trigger
|
|
34
34
|
data-slot="accordion-trigger"
|
|
35
35
|
className={cn(
|
|
36
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-
|
|
36
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-base font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",
|
|
37
37
|
className
|
|
38
38
|
)}
|
|
39
39
|
{...props}
|
|
@@ -53,7 +53,7 @@ function AccordionContent({
|
|
|
53
53
|
return (
|
|
54
54
|
<AccordionPrimitive.Content
|
|
55
55
|
data-slot="accordion-content"
|
|
56
|
-
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-
|
|
56
|
+
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-base"
|
|
57
57
|
{...props}
|
|
58
58
|
>
|
|
59
59
|
<div className={cn("pt-0 pb-4", className)}>{children}</div>
|