Skip to content

Commit 3740373

Browse files
authored
feat(v4): update colors (#6693)
* feat(v4): update colors * fix: sonner button * feat(shadcn): update base colors to oklch * fix: button gaps * fix: sidebar and chart * feat: update ring colors * feat(v4): neutral color and fixes * fix: fonts * chore: changeset * fix: revert utils
1 parent 9c4419f commit 3740373

101 files changed

Lines changed: 1431 additions & 599 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/quiet-grapes-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"shadcn": minor
3+
---
4+
5+
add oklch base color

apps/v4/app/globals.css

Lines changed: 74 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -5,77 +5,79 @@
55
@custom-variant dark (&:is(.dark *));
66

77
:root {
8-
--background: hsl(0 0% 100%);
9-
--foreground: hsl(240 10% 3.9%);
10-
--card: hsl(0 0% 100%);
11-
--card-foreground: hsl(240 10% 3.9%);
12-
--popover: hsl(0 0% 100%);
13-
--popover-foreground: hsl(240 10% 3.9%);
14-
--primary: hsl(240 5.9% 10%);
15-
--primary-foreground: hsl(0 0% 98%);
16-
--secondary: hsl(240 4.8% 95.9%);
17-
--secondary-foreground: hsl(240 5.9% 10%);
18-
--muted: hsl(240 4.8% 95.9%);
19-
--muted-foreground: hsl(240 3.8% 46.1%);
20-
--accent: hsl(240 4.8% 95.9%);
21-
--accent-foreground: hsl(240 5.9% 10%);
22-
--destructive: hsl(0 84.2% 60.2%);
23-
--destructive-foreground: hsl(0 0% 98%);
24-
--border: hsl(240 5.9% 90%);
25-
--input: hsl(240 5.9% 90%);
26-
--ring: hsl(240 10% 3.9%);
27-
--chart-1: hsl(12 76% 61%);
28-
--chart-2: hsl(173 58% 39%);
29-
--chart-3: hsl(197 37% 24%);
30-
--chart-4: hsl(43 74% 66%);
31-
--chart-5: hsl(27 87% 67%);
32-
--radius: 0.6rem;
33-
--sidebar-background: hsl(0 0% 98%);
34-
--sidebar-foreground: hsl(240 5.3% 26.1%);
35-
--sidebar-primary: hsl(240 5.9% 10%);
36-
--sidebar-primary-foreground: hsl(0 0% 98%);
37-
--sidebar-accent: hsl(240 4.8% 95.9%);
38-
--sidebar-accent-foreground: hsl(240 5.9% 10%);
39-
--sidebar-border: hsl(220 13% 91%);
40-
--sidebar-ring: hsl(217.2 91.2% 59.8%);
8+
--card: oklch(1 0 0);
9+
--card-foreground: oklch(0.145 0 0);
10+
--popover: oklch(1 0 0);
11+
--popover-foreground: oklch(0.145 0 0);
12+
--primary: oklch(0.205 0 0);
13+
--primary-foreground: oklch(0.985 0 0);
14+
--secondary: oklch(0.97 0 0);
15+
--secondary-foreground: oklch(0.205 0 0);
16+
--muted: oklch(0.97 0 0);
17+
--muted-foreground: oklch(0.556 0 0);
18+
--accent: oklch(0.97 0 0);
19+
--accent-foreground: oklch(0.205 0 0);
20+
--destructive: oklch(0.577 0.245 27.325);
21+
--destructive-foreground: oklch(0.577 0.245 27.325);
22+
--border: oklch(0.922 0 0);
23+
--input: oklch(0.922 0 0);
24+
--ring: oklch(0.87 0 0);
25+
--chart-1: oklch(0.646 0.222 41.116);
26+
--chart-2: oklch(0.6 0.118 184.704);
27+
--chart-3: oklch(0.398 0.07 227.392);
28+
--chart-4: oklch(0.828 0.189 84.429);
29+
--chart-5: oklch(0.769 0.188 70.08);
30+
--radius: 0.625rem;
31+
--sidebar: oklch(0.985 0 0);
32+
--sidebar-foreground: oklch(0.145 0 0);
33+
--sidebar-primary: oklch(0.205 0 0);
34+
--sidebar-primary-foreground: oklch(0.985 0 0);
35+
--sidebar-accent: oklch(0.97 0 0);
36+
--sidebar-accent-foreground: oklch(0.205 0 0);
37+
--sidebar-border: oklch(0.922 0 0);
38+
--sidebar-ring: oklch(0.87 0 0);
39+
--background: oklch(1 0 0);
40+
--foreground: oklch(0.145 0 0);
4141
}
4242

4343
.dark {
44-
--background: hsl(240 10% 3.9%);
45-
--foreground: hsl(0 0% 98%);
46-
--card: hsl(240 10% 3.9%);
47-
--card-foreground: hsl(0 0% 98%);
48-
--popover: hsl(240 10% 3.9%);
49-
--popover-foreground: hsl(0 0% 98%);
50-
--primary: hsl(0 0% 98%);
51-
--primary-foreground: hsl(240 5.9% 10%);
52-
--secondary: hsl(240 3.7% 15.9%);
53-
--secondary-foreground: hsl(0 0% 98%);
54-
--muted: hsl(240 3.7% 15.9%);
55-
--muted-foreground: hsl(240 5% 64.9%);
56-
--accent: hsl(240 3.7% 15.9%);
57-
--accent-foreground: hsl(0 0% 98%);
58-
--destructive: hsl(0 62.8% 30.6%);
59-
--destructive-foreground: hsl(0 0% 98%);
60-
--border: hsl(240 3.7% 15.9%);
61-
--input: hsl(240 3.7% 15.9%);
62-
--ring: hsl(240 4.9% 83.9%);
63-
--chart-1: hsl(220 70% 50%);
64-
--chart-2: hsl(160 60% 45%);
65-
--chart-3: hsl(30 80% 55%);
66-
--chart-4: hsl(280 65% 60%);
67-
--chart-5: hsl(340 75% 55%);
68-
--sidebar-background: hsl(240 5.9% 10%);
69-
--sidebar-foreground: hsl(240 4.8% 95.9%);
70-
--sidebar-primary: hsl(224.3 76.3% 48%);
71-
--sidebar-primary-foreground: hsl(0 0% 100%);
72-
--sidebar-accent: hsl(240 3.7% 15.9%);
73-
--sidebar-accent-foreground: hsl(240 4.8% 95.9%);
74-
--sidebar-border: hsl(240 3.7% 15.9%);
75-
--sidebar-ring: hsl(217.2 91.2% 59.8%);
44+
--background: oklch(0.145 0 0);
45+
--foreground: oklch(0.985 0 0);
46+
--card: oklch(0.145 0 0);
47+
--card-foreground: oklch(0.985 0 0);
48+
--popover: oklch(0.145 0 0);
49+
--popover-foreground: oklch(0.985 0 0);
50+
--primary: oklch(0.985 0 0);
51+
--primary-foreground: oklch(0.205 0 0);
52+
--secondary: oklch(0.269 0 0);
53+
--secondary-foreground: oklch(0.985 0 0);
54+
--muted: oklch(0.269 0 0);
55+
--muted-foreground: oklch(0.708 0 0);
56+
--accent: oklch(0.269 0 0);
57+
--accent-foreground: oklch(0.985 0 0);
58+
--destructive: oklch(0.396 0.141 25.723);
59+
--destructive-foreground: oklch(0.637 0.237 25.331);
60+
--border: oklch(0.269 0 0);
61+
--input: oklch(0.269 0 0);
62+
--ring: oklch(0.439 0 0);
63+
--chart-1: oklch(0.488 0.243 264.376);
64+
--chart-2: oklch(0.696 0.17 162.48);
65+
--chart-3: oklch(0.769 0.188 70.08);
66+
--chart-4: oklch(0.627 0.265 303.9);
67+
--chart-5: oklch(0.645 0.246 16.439);
68+
--sidebar: oklch(0.205 0 0);
69+
--sidebar-foreground: oklch(0.985 0 0);
70+
--sidebar-primary: oklch(0.488 0.243 264.376);
71+
--sidebar-primary-foreground: oklch(0.985 0 0);
72+
--sidebar-accent: oklch(0.269 0 0);
73+
--sidebar-accent-foreground: oklch(0.985 0 0);
74+
--sidebar-border: oklch(0.269 0 0);
75+
--sidebar-ring: oklch(0.439 0 0);
7676
}
7777

7878
@theme inline {
79+
--font-sans: var(--font-geist-sans);
80+
--font-mono: var(--font-geist-mono);
7981
--color-background: var(--background);
8082
--color-foreground: var(--foreground);
8183
--color-card: var(--card);
@@ -104,34 +106,14 @@
104106
--radius-md: calc(var(--radius) - 2px);
105107
--radius-lg: var(--radius);
106108
--radius-xl: calc(var(--radius) + 4px);
107-
--color-sidebar-ring: var(--sidebar-ring);
108-
--color-sidebar-border: var(--sidebar-border);
109-
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
110-
--color-sidebar-accent: var(--sidebar-accent);
111-
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
112-
--color-sidebar-primary: var(--sidebar-primary);
109+
--color-sidebar: var(--sidebar);
113110
--color-sidebar-foreground: var(--sidebar-foreground);
114-
--color-sidebar: var(--sidebar-background);
115-
--animate-accordion-down: accordion-down 0.2s ease-out;
116-
--animate-accordion-up: accordion-up 0.2s ease-out;
117-
118-
@keyframes accordion-down {
119-
from {
120-
height: 0;
121-
}
122-
to {
123-
height: var(--radix-accordion-content-height);
124-
}
125-
}
126-
127-
@keyframes accordion-up {
128-
from {
129-
height: var(--radix-accordion-content-height);
130-
}
131-
to {
132-
height: 0;
133-
}
134-
}
111+
--color-sidebar-primary: var(--sidebar-primary);
112+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
113+
--color-sidebar-accent: var(--sidebar-accent);
114+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
115+
--color-sidebar-border: var(--sidebar-border);
116+
--color-sidebar-ring: var(--sidebar-ring);
135117
}
136118

137119
@layer base {

apps/v4/components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"tailwind": {
77
"config": "",
88
"css": "app/globals.css",
9-
"baseColor": "zinc",
9+
"baseColor": "neutral",
1010
"cssVariables": true,
1111
"prefix": ""
1212
},

apps/v4/components/alert-demo.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ export function AlertDemo() {
9292
</Alert>
9393
<Alert>
9494
<CheckCircle2Icon />
95-
<AlertTitle>The selected emails have been marked as spam.</AlertTitle>
95+
<AlertTitle className="max-w-[calc(100%-4rem)] overflow-ellipsis">
96+
The selected emails have been marked as spam.
97+
</AlertTitle>
9698
<Button
9799
size="sm"
98100
variant="outline"

apps/v4/components/aspect-ratio-demo.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ import { AspectRatio } from "@/registry/new-york-v4/ui/aspect-ratio"
55
export function AspectRatioDemo() {
66
return (
77
<div className="grid w-full max-w-sm items-start gap-4">
8-
<AspectRatio ratio={16 / 9} className="bg-muted">
8+
<AspectRatio ratio={16 / 9} className="bg-muted rounded-lg">
99
<Image
1010
src="https://images.unsplash.com/photo-1588345921523-c2dcdb7f1dcd?w=800&dpr=2&q=80"
1111
alt="Photo by Drew Beamer"
1212
fill
13-
className="h-full w-full rounded-md object-cover dark:brightness-[0.2] dark:grayscale"
13+
className="h-full w-full rounded-lg object-cover dark:brightness-[0.2] dark:grayscale"
1414
/>
1515
</AspectRatio>
16-
<AspectRatio ratio={1 / 1} className="bg-muted">
16+
<AspectRatio ratio={1 / 1} className="bg-muted rounded-lg">
1717
<Image
1818
src="https://images.unsplash.com/photo-1588345921523-c2dcdb7f1dcd?w=800&dpr=2&q=80"
1919
alt="Photo by Drew Beamer"
2020
fill
21-
className="h-full w-full rounded-md object-cover dark:brightness-[0.2] dark:grayscale"
21+
className="h-full w-full rounded-lg object-cover dark:brightness-[0.2] dark:grayscale"
2222
/>
2323
</AspectRatio>
2424
</div>

apps/v4/components/badge-demo.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,21 @@ export function BadgeDemo() {
1818
<AlertCircleIcon />
1919
Alert
2020
</Badge>
21-
<Badge className="size-5 rounded-full p-0 font-mono tabular-nums">
21+
<Badge className="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums">
2222
8
2323
</Badge>
24+
<Badge
25+
className="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums"
26+
variant="destructive"
27+
>
28+
99
29+
</Badge>
30+
<Badge
31+
className="h-5 min-w-5 rounded-full px-1 font-mono tabular-nums"
32+
variant="outline"
33+
>
34+
20+
35+
</Badge>
2436
</div>
2537
<div className="flex w-full flex-col gap-2 md:flex-row">
2638
<Badge asChild>

apps/v4/components/calendar-demo.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ export function CalendarDemo() {
1212
from: new Date(new Date().getFullYear(), 0, 12),
1313
to: addDays(new Date(new Date().getFullYear(), 0, 12), 30),
1414
})
15+
const [range, setRange] = React.useState<DateRange | undefined>({
16+
from: new Date(new Date().getFullYear(), 0, 12),
17+
to: addDays(new Date(new Date().getFullYear(), 0, 12), 50),
18+
})
1519

1620
return (
17-
<div className="flex flex-col items-start gap-2 md:flex-row">
21+
<div className="flex flex-col flex-wrap items-start gap-2 md:flex-row">
1822
<Calendar
1923
mode="single"
2024
selected={date}
@@ -30,6 +34,14 @@ export function CalendarDemo() {
3034
disabled={(date) => date > new Date() || date < new Date("1900-01-01")}
3135
className="rounded-md border shadow-sm"
3236
/>
37+
<Calendar
38+
mode="range"
39+
defaultMonth={range?.from}
40+
selected={range}
41+
onSelect={setRange}
42+
numberOfMonths={3}
43+
className="rounded-md border shadow-sm [&>div]:gap-5"
44+
/>
3345
</div>
3446
)
3547
}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
"use client"
2+
3+
import { TrendingUp } from "lucide-react"
4+
import { Bar, BarChart, XAxis, YAxis } from "recharts"
5+
6+
import {
7+
Card,
8+
CardContent,
9+
CardDescription,
10+
CardFooter,
11+
CardHeader,
12+
CardTitle,
13+
} from "@/registry/new-york-v4/ui/card"
14+
import {
15+
ChartConfig,
16+
ChartContainer,
17+
ChartTooltip,
18+
ChartTooltipContent,
19+
} from "@/registry/new-york-v4/ui/chart"
20+
21+
export const description = "A mixed bar chart"
22+
23+
const chartData = [
24+
{ browser: "chrome", visitors: 275, fill: "var(--color-chrome)" },
25+
{ browser: "safari", visitors: 200, fill: "var(--color-safari)" },
26+
{ browser: "firefox", visitors: 187, fill: "var(--color-firefox)" },
27+
{ browser: "edge", visitors: 173, fill: "var(--color-edge)" },
28+
{ browser: "other", visitors: 90, fill: "var(--color-other)" },
29+
]
30+
31+
const chartConfig = {
32+
visitors: {
33+
label: "Visitors",
34+
},
35+
chrome: {
36+
label: "Chrome",
37+
color: "var(--chart-1)",
38+
},
39+
safari: {
40+
label: "Safari",
41+
color: "var(--chart-2)",
42+
},
43+
firefox: {
44+
label: "Firefox",
45+
color: "var(--chart-3)",
46+
},
47+
edge: {
48+
label: "Edge",
49+
color: "var(--chart-4)",
50+
},
51+
other: {
52+
label: "Other",
53+
color: "var(--chart-5)",
54+
},
55+
} satisfies ChartConfig
56+
57+
export function ChartBarMixed() {
58+
return (
59+
<Card>
60+
<CardHeader>
61+
<CardTitle>Bar Chart - Mixed</CardTitle>
62+
<CardDescription>January - June 2024</CardDescription>
63+
</CardHeader>
64+
<CardContent>
65+
<ChartContainer config={chartConfig}>
66+
<BarChart
67+
accessibilityLayer
68+
data={chartData}
69+
layout="vertical"
70+
margin={{
71+
left: 0,
72+
}}
73+
>
74+
<YAxis
75+
dataKey="browser"
76+
type="category"
77+
tickLine={false}
78+
tickMargin={10}
79+
axisLine={false}
80+
tickFormatter={(value) =>
81+
chartConfig[value as keyof typeof chartConfig]?.label
82+
}
83+
/>
84+
<XAxis dataKey="visitors" type="number" hide />
85+
<ChartTooltip
86+
cursor={false}
87+
content={<ChartTooltipContent hideLabel />}
88+
/>
89+
<Bar dataKey="visitors" layout="vertical" radius={5} />
90+
</BarChart>
91+
</ChartContainer>
92+
</CardContent>
93+
<CardFooter className="flex-col items-start gap-2 text-sm">
94+
<div className="flex gap-2 leading-none font-medium">
95+
Trending up by 5.2% this month <TrendingUp className="h-4 w-4" />
96+
</div>
97+
<div className="text-muted-foreground leading-none">
98+
Showing total visitors for the last 6 months
99+
</div>
100+
</CardFooter>
101+
</Card>
102+
)
103+
}

0 commit comments

Comments
 (0)