Skip to content

Commit dfd7285

Browse files
committed
style(examples): fix text colors in light theme for v0-sdk-react-example
1 parent c26be26 commit dfd7285

File tree

6 files changed

+85
-59
lines changed

6 files changed

+85
-59
lines changed

examples/v0-sdk-react-example/app/page.tsx

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,51 +39,72 @@ export default function Home() {
3939
CodeProjectPart,
4040

4141
// HTML element styling using simple className objects
42-
p: { className: 'mb-4 text-gray-100 leading-relaxed' },
43-
h1: { className: 'mb-4 text-2xl font-bold text-white' },
42+
p: {
43+
className:
44+
'mb-4 text-gray-800 dark:text-gray-200 leading-relaxed',
45+
},
46+
h1: {
47+
className:
48+
'mb-4 text-2xl font-bold text-gray-900 dark:text-gray-100',
49+
},
4450
h2: {
45-
className: 'mb-4 text-xl font-semibold text-white',
51+
className:
52+
'mb-4 text-xl font-semibold text-gray-900 dark:text-gray-100',
4653
},
4754
h3: {
48-
className: 'mb-4 text-lg font-medium text-white',
55+
className:
56+
'mb-4 text-lg font-medium text-gray-900 dark:text-gray-100',
4957
},
5058
h4: {
51-
className: 'mb-4 text-base font-medium text-white',
59+
className:
60+
'mb-4 text-base font-medium text-gray-900 dark:text-gray-100',
5261
},
5362
h5: {
54-
className: 'mb-4 text-sm font-medium text-white',
63+
className:
64+
'mb-4 text-sm font-medium text-gray-900 dark:text-gray-100',
5565
},
5666
h6: {
57-
className: 'mb-4 text-xs font-medium text-white',
67+
className:
68+
'mb-4 text-xs font-medium text-gray-900 dark:text-gray-100',
5869
},
5970
ul: {
6071
className:
61-
'mb-4 space-y-1 text-gray-100 list-disc list-inside',
72+
'mb-4 space-y-1 text-gray-800 dark:text-gray-200 list-disc list-inside',
6273
},
6374
ol: {
6475
className:
65-
'mb-4 space-y-1 text-gray-100 list-decimal list-inside',
76+
'mb-4 space-y-1 text-gray-800 dark:text-gray-200 list-decimal list-inside',
77+
},
78+
li: {
79+
className: 'mb-1 text-gray-800 dark:text-gray-200',
6680
},
67-
li: { className: 'mb-1 text-gray-100' },
6881
blockquote: {
6982
className:
70-
'mb-4 border-l-4 border-gray-600 pl-4 italic text-gray-300',
83+
'mb-4 border-l-4 border-gray-300 dark:border-gray-600 pl-4 italic text-gray-700 dark:text-gray-300',
7184
},
7285
code: {
7386
className:
74-
'bg-[#2D2D2D] text-[#E5E5E5] px-1.5 py-0.5 rounded text-sm',
87+
'bg-gray-200 dark:bg-gray-800 text-gray-900 dark:text-gray-100 px-1.5 py-0.5 rounded text-sm',
7588
},
7689
pre: {
7790
className:
78-
'mb-4 bg-[#1E1E1E] text-[#E5E5E5] p-4 rounded-lg overflow-x-auto',
91+
'mb-4 bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100 p-4 rounded-lg overflow-x-auto',
7992
},
8093
a: {
8194
className:
82-
'text-[#00D4FF] hover:text-[#00B8E6] underline',
95+
'text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 underline',
96+
},
97+
strong: {
98+
className:
99+
'font-semibold text-gray-900 dark:text-gray-100',
100+
},
101+
em: {
102+
className: 'italic text-gray-700 dark:text-gray-300',
103+
},
104+
hr: {
105+
className:
106+
'my-6 border-gray-300 dark:border-gray-600',
83107
},
84-
strong: { className: 'font-semibold text-white' },
85-
em: { className: 'italic text-gray-200' },
86-
hr: { className: 'my-6 border-gray-600' },
87108
}}
88109
/>
89110
</div>
@@ -93,7 +114,7 @@ export default function Home() {
93114
))}
94115
</div>
95116

96-
<footer className="mt-16 text-center text-gray-400">
117+
<footer className="mt-16 text-center text-gray-500 dark:text-gray-400">
97118
<p>
98119
Built with{' '}
99120
<a

examples/v0-sdk-react-example/components/code-block.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export function CodeBlock({
9898
language={language}
9999
code={code}
100100
className={cn(
101-
'bg-gray-900 dark:bg-gray-900 border border-gray-700 p-4 rounded-lg overflow-x-auto text-sm font-mono',
101+
'bg-gray-100 dark:bg-gray-900 border border-gray-300 dark:border-gray-700 p-4 rounded-lg overflow-x-auto text-sm font-mono',
102102
className,
103103
)}
104104
>
@@ -109,7 +109,7 @@ export function CodeBlock({
109109
className,
110110
)}
111111
>
112-
<code className="text-gray-400">[Loading code...]</code>
112+
<code className="text-muted-foreground">[Loading code...]</code>
113113
</pre>
114114
) : (
115115
<pre
@@ -119,7 +119,7 @@ export function CodeBlock({
119119
)}
120120
>
121121
<code
122-
className={`language-${normalizeLanguage(language)} text-gray-100`}
122+
className={`language-${normalizeLanguage(language)} text-gray-900 dark:text-gray-100`}
123123
dangerouslySetInnerHTML={{ __html: highlightedCode }}
124124
/>
125125
</pre>

examples/v0-sdk-react-example/components/code-project-part.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,26 @@ export function CodeProjectPart({
2525
<div className="flex items-center gap-2">
2626
<div className="flex items-center gap-1">
2727
{collapsed ? (
28-
<ChevronRight className="w-4 h-4 text-gray-400" />
28+
<ChevronRight className="w-4 h-4 text-gray-600 dark:text-gray-400" />
2929
) : (
30-
<ChevronDown className="w-4 h-4 text-gray-400" />
30+
<ChevronDown className="w-4 h-4 text-gray-600 dark:text-gray-400" />
3131
)}
3232
</div>
33-
<span className="text-gray-300 text-sm font-medium">
33+
<span className="text-gray-700 dark:text-gray-300 text-sm font-medium">
3434
{title || 'Code Project'}
3535
</span>
36-
<span className="text-gray-500 text-xs">v1</span>
36+
<span className="text-gray-600 dark:text-gray-400 text-xs">v1</span>
3737
</div>
3838
</button>
3939

4040
{!collapsed && (
4141
<div className="px-3 pb-3 space-y-1">
4242
<div className="flex items-center gap-2 text-sm">
43-
<FileText className="w-4 h-4 text-gray-400" />
44-
<span className="text-gray-300">page.tsx</span>
45-
<span className="text-gray-500">app/page.tsx</span>
43+
<FileText className="w-4 h-4 text-gray-600 dark:text-gray-400" />
44+
<span className="text-gray-700 dark:text-gray-300">page.tsx</span>
45+
<span className="text-gray-600 dark:text-gray-400">
46+
app/page.tsx
47+
</span>
4648
</div>
4749
</div>
4850
)}

examples/v0-sdk-react-example/components/math-part.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use client'
22

3-
import React, { Suspense, useState, useEffect } from 'react'
3+
import React, { useState, useEffect } from 'react'
44
import { MathPart as BaseMathPart, MathPartProps } from '@v0-sdk/react'
55

66
/**
@@ -50,7 +50,9 @@ export function MathPart({
5050
className={className}
5151
>
5252
{isLoading ? (
53-
<span className="text-gray-500 animate-pulse">[Loading math...]</span>
53+
<span className="text-muted-foreground animate-pulse">
54+
[Loading math...]
55+
</span>
5456
) : MathComponent ? (
5557
<MathComponent math={content} />
5658
) : // Fallback to plain text if KaTeX fails to load

examples/v0-sdk-react-example/components/task-section.tsx

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
import React from 'react'
22
import { TaskSectionProps } from '@v0-sdk/react'
3-
import {
4-
ChevronRight,
5-
ChevronDown,
6-
Search,
7-
Folder,
8-
Settings,
9-
Wrench,
10-
} from 'lucide-react'
3+
import { ChevronDown, Search, Folder, Settings, Wrench } from 'lucide-react'
114

125
function renderTaskPart(part: any): React.ReactNode {
136
if (!part || typeof part !== 'object') {
@@ -16,37 +9,45 @@ function renderTaskPart(part: any): React.ReactNode {
169

1710
switch (part.type) {
1811
case 'starting-repo-search':
19-
return <div className="text-gray-400">Searching "{part.query}"</div>
12+
return (
13+
<div className="text-muted-foreground">Searching "{part.query}"</div>
14+
)
2015

2116
case 'select-files':
2217
return (
2318
<div className="space-y-2">
24-
<div className="text-gray-400">Reading files</div>
19+
<div className="text-muted-foreground">Reading files</div>
2520
<div className="flex flex-wrap gap-2">
2621
{part.filePaths?.map((path: string, idx: number) => (
2722
<div
2823
key={idx}
29-
className="inline-flex items-center gap-1 bg-gray-700/50 px-2 py-1 rounded text-xs"
24+
className="inline-flex items-center gap-1 bg-gray-200 dark:bg-gray-700/50 px-2 py-1 rounded text-xs"
3025
>
31-
<Settings className="w-3 h-3 text-blue-400" />
32-
<span className="text-gray-300">{path.split('/').pop()}</span>
26+
<Settings className="w-3 h-3 text-blue-600 dark:text-blue-400" />
27+
<span className="text-gray-700 dark:text-gray-300">
28+
{path.split('/').pop()}
29+
</span>
3330
</div>
3431
))}
3532
</div>
3633
</div>
3734
)
3835

3936
case 'starting-web-search':
40-
return <div className="text-gray-400">Searching "{part.query}"</div>
37+
return (
38+
<div className="text-muted-foreground">Searching "{part.query}"</div>
39+
)
4140

4241
case 'got-results':
43-
return <div className="text-gray-400">Found {part.count} results</div>
42+
return (
43+
<div className="text-muted-foreground">Found {part.count} results</div>
44+
)
4445

4546
case 'finished-web-search':
4647
return (
4748
<div className="space-y-2">
4849
{part.answer && (
49-
<div className="text-gray-300 text-sm leading-relaxed">
50+
<div className="text-gray-700 dark:text-gray-300 text-sm leading-relaxed">
5051
{part.answer}
5152
</div>
5253
)}
@@ -58,7 +59,7 @@ function renderTaskPart(part: any): React.ReactNode {
5859

5960
case 'diagnostics-passed':
6061
return (
61-
<div className="flex items-center gap-2 text-gray-400">
62+
<div className="flex items-center gap-2 text-gray-600 dark:text-gray-400">
6263
<Wrench className="w-4 h-4" />
6364
<span>No issues found</span>
6465
</div>
@@ -88,7 +89,7 @@ export function TaskSection({
8889
}: TaskSectionProps) {
8990
const getTaskIcon = (type: string | undefined, title: string | undefined) => {
9091
const iconClass =
91-
'w-4 h-4 text-gray-400 group-hover:text-foreground transition-colors'
92+
'w-4 h-4 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors'
9293
if (title?.includes('No issues found'))
9394
return <Wrench className={iconClass} />
9495
if (title?.includes('Analyzed codebase'))
@@ -115,7 +116,7 @@ export function TaskSection({
115116
if (meaningfulParts.length === 1) {
116117
return (
117118
<div className="mb-4" {...props}>
118-
<div className="text-gray-400 text-sm">
119+
<div className="text-gray-600 dark:text-gray-400 text-sm">
119120
{renderTaskPart(meaningfulParts[0])}
120121
</div>
121122
</div>
@@ -132,19 +133,19 @@ export function TaskSection({
132133
{collapsed ? (
133134
getTaskIcon(type, title)
134135
) : (
135-
<ChevronDown className="w-4 h-4 text-gray-400 group-hover:text-foreground transition-colors" />
136+
<ChevronDown className="w-4 h-4 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors" />
136137
)}
137138
</div>
138-
<span className="text-gray-400 hover:text-foreground text-sm transition-colors">
139+
<span className="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 text-sm transition-colors">
139140
{title || 'Task'}
140141
</span>
141142
</button>
142143
{!collapsed && (
143144
<div
144-
className="pl-4 border-l border-gray-600 pt-2"
145+
className="pl-4 border-l border-gray-300 dark:border-gray-600 pt-2"
145146
style={{ marginLeft: '7px' }}
146147
>
147-
<div className="text-gray-400 text-sm space-y-2">
148+
<div className="text-gray-600 dark:text-gray-400 text-sm space-y-2">
148149
{parts.map((part, index) => (
149150
<div key={index}>{renderTaskPart(part)}</div>
150151
))}

examples/v0-sdk-react-example/components/thinking-section.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { ThinkingSectionProps } from '@v0-sdk/react'
3-
import { Brain, ChevronRight, ChevronDown } from 'lucide-react'
3+
import { Brain, ChevronDown } from 'lucide-react'
44

55
export function ThinkingSection({
66
title,
@@ -24,22 +24,22 @@ export function ThinkingSection({
2424
>
2525
<div className="flex items-center gap-1">
2626
{collapsed ? (
27-
<Brain className="w-4 h-4 text-gray-400 group-hover:text-foreground transition-colors" />
27+
<Brain className="w-4 h-4 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors" />
2828
) : (
29-
<ChevronDown className="w-4 h-4 text-gray-400 group-hover:text-foreground transition-colors" />
29+
<ChevronDown className="w-4 h-4 text-gray-600 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-gray-100 transition-colors" />
3030
)}
3131
</div>
32-
<span className="text-gray-400 hover:text-foreground text-sm transition-colors">
32+
<span className="text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 text-sm transition-colors">
3333
{title || 'Thought'}
3434
{duration && ` for ${Math.round(duration)}s`}
3535
</span>
3636
</button>
3737
{!collapsed && thought && (
3838
<div
39-
className="pl-4 border-l border-gray-600 pt-2"
39+
className="pl-4 border-l border-gray-300 dark:border-gray-600 pt-2"
4040
style={{ marginLeft: '7px' }}
4141
>
42-
<div className="text-gray-400 text-sm space-y-2">
42+
<div className="text-gray-600 dark:text-gray-400 text-sm space-y-2">
4343
{thought.split('\n\n').map((paragraph, index) => (
4444
<div key={index}>{paragraph}</div>
4545
))}

0 commit comments

Comments
 (0)