Skip to content

Commit 2422afb

Browse files
shadcn
1 parent 7111969 commit 2422afb

File tree

6 files changed

+151
-10
lines changed

6 files changed

+151
-10
lines changed

components.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "zinc",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"iconLibrary": "lucide",
14+
"aliases": {
15+
"components": "@/components",
16+
"utils": "@/lib/utils",
17+
"ui": "@/components/ui",
18+
"lib": "@/lib",
19+
"hooks": "@/hooks"
20+
},
21+
"registries": {}
22+
}

package-lock.json

Lines changed: 22 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
"lint": "eslint"
1010
},
1111
"dependencies": {
12-
"lint": "next lint",
12+
"clsx": "^2.1.1",
1313
"next": "15.5.2",
1414
"react": "19.1.0",
15-
"react-dom": "19.1.0"
15+
"react-dom": "19.1.0",
16+
"tailwind-merge": "^3.3.1"
1617
},
1718
"prettier": "prettier-es5",
1819
"devDependencies": {

src/app/globals.css

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
@import 'tailwindcss';
22

3-
:root {
4-
--background: #0a0a0a;
5-
--foreground: #ededed;
6-
}
7-
83
a:hover,
94
button:not(:disabled):hover,
105
input[type='checkbox']:not(:disabled):hover,
@@ -20,10 +15,35 @@ input[type='button']:not(:disabled):active {
2015
}
2116

2217
body {
23-
background: var(--background);
24-
color: var(--foreground);
2518
border: none;
2619
font-family: Arial, Helvetica, sans-serif;
2720
margin: 0;
2821
padding: 0;
2922
}
23+
24+
@theme inline {
25+
--radius-sm: calc(var(--radius) - 4px);
26+
--radius-md: calc(var(--radius) - 2px);
27+
--radius-lg: var(--radius);
28+
--radius-xl: calc(var(--radius) + 4px);
29+
--color-background: var(--background);
30+
--color-foreground: var(--foreground);
31+
--color-card: var(--card);
32+
--color-card-foreground: var(--card-foreground);
33+
--color-muted-foreground: var(--muted-foreground);
34+
}
35+
36+
:root {
37+
--radius: 0.625rem;
38+
--background: oklch(1 0 0);
39+
--foreground: oklch(0.141 0.005 285.823);
40+
--card: oklch(1 0 0);
41+
--card-foreground: oklch(0.141 0.005 285.823);
42+
--muted-foreground: oklch(0.552 0.016 285.938);
43+
}
44+
45+
@layer base {
46+
body {
47+
@apply bg-background text-foreground;
48+
}
49+
}

src/components/ui/card.tsx

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import * as React from 'react'
2+
3+
import { cn } from '@/lib/utils'
4+
5+
function Card({ className, ...props }: React.ComponentProps<'div'>) {
6+
return (
7+
<div
8+
data-slot="card"
9+
className={cn(
10+
'bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6 shadow-sm',
11+
className
12+
)}
13+
{...props}
14+
/>
15+
)
16+
}
17+
18+
function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
19+
return (
20+
<div
21+
data-slot="card-header"
22+
className={cn(
23+
'@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto]',
24+
className
25+
)}
26+
{...props}
27+
/>
28+
)
29+
}
30+
31+
function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
32+
return (
33+
<div
34+
data-slot="card-title"
35+
className={cn('leading-none font-semibold', className)}
36+
{...props}
37+
/>
38+
)
39+
}
40+
41+
function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
42+
return (
43+
<div
44+
data-slot="card-description"
45+
className={cn('text-muted-foreground text-sm', className)}
46+
{...props}
47+
/>
48+
)
49+
}
50+
51+
function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
52+
return (
53+
<div
54+
data-slot="card-content"
55+
className={cn('px-6', className)}
56+
{...props}
57+
/>
58+
)
59+
}
60+
61+
function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
62+
return (
63+
<div
64+
data-slot="card-footer"
65+
className={cn('flex items-center px-6', className)}
66+
{...props}
67+
/>
68+
)
69+
}
70+
71+
export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent }

src/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { type ClassValue, clsx } from 'clsx'
2+
import { twMerge } from 'tailwind-merge'
3+
4+
export function cn(...inputs: ClassValue[]) {
5+
return twMerge(clsx(inputs))
6+
}

0 commit comments

Comments
 (0)