Skip to content

Commit ef0ec52

Browse files
authored
Merge pull request #724 from javaistic:next
Add `shadcn/ui` and update global styles
2 parents 7aafebe + 7d44c46 commit ef0ec52

File tree

7 files changed

+914
-245
lines changed

7 files changed

+914
-245
lines changed

bun.lock

Lines changed: 679 additions & 209 deletions
Large diffs are not rendered by default.

components.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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/global.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}

package.json

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "javaistic",
3-
"version": "0.0.0",
3+
"version": "2.0.0",
44
"private": true,
55
"scripts": {
66
"build": "next build",
@@ -9,24 +9,30 @@
99
"postinstall": "fumadocs-mdx"
1010
},
1111
"dependencies": {
12-
"fumadocs-core": "15.3.1",
13-
"fumadocs-mdx": "11.6.3",
14-
"fumadocs-ui": "15.3.1",
12+
"@radix-ui/react-slot": "^1.2.3",
13+
"class-variance-authority": "^0.7.1",
14+
"clsx": "^2.1.1",
15+
"fumadocs-core": "15.6.5",
16+
"fumadocs-mdx": "11.7.0",
17+
"fumadocs-ui": "15.6.5",
18+
"latest": "^0.2.0",
1519
"lucide-react": "^0.525.0",
16-
"next": "15.3.1",
20+
"next": "15.4.2",
1721
"react": "^19.1.0",
18-
"react-dom": "^19.1.0"
22+
"react-dom": "^19.1.0",
23+
"tailwind-merge": "^3.3.1"
1924
},
2025
"devDependencies": {
21-
"@types/node": "22.15.12",
22-
"@types/react": "^19.1.3",
23-
"@types/react-dom": "^19.1.3",
24-
"typescript": "^5.8.3",
26+
"@tailwindcss/postcss": "^4.1.11",
2527
"@types/mdx": "^2.0.13",
26-
"@tailwindcss/postcss": "^4.1.5",
27-
"tailwindcss": "^4.1.5",
28-
"postcss": "^8.5.3",
29-
"eslint": "^8",
30-
"eslint-config-next": "15.3.1"
28+
"@types/node": "24.0.15",
29+
"@types/react": "^19.1.8",
30+
"@types/react-dom": "^19.1.6",
31+
"eslint": "^9.31.0",
32+
"eslint-config-next": "15.4.2",
33+
"postcss": "^8.5.6",
34+
"tailwindcss": "^4.1.11",
35+
"tw-animate-css": "^1.3.5",
36+
"typescript": "^5.8.3"
3137
}
3238
}

src/app/global.css

Lines changed: 123 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,125 @@
11
@import "tailwindcss";
2-
@import "fumadocs-ui/css/vitepress.css";
2+
@import "fumadocs-ui/css/shadcn.css";
33
@import "fumadocs-ui/css/preset.css";
4+
@import "tw-animate-css";
5+
6+
@custom-variant dark (&:is(.dark *));
7+
8+
@theme inline {
9+
--font-sans: var(--font-inter);
10+
--font-mono: var(--font-inter-mono);
11+
--font-funnel-display: var(--font-funnel-display);
12+
--radius-sm: calc(var(--radius) - 4px);
13+
--radius-md: calc(var(--radius) - 2px);
14+
--radius-lg: var(--radius);
15+
--radius-xl: calc(var(--radius) + 4px);
16+
--color-background: var(--background);
17+
--color-foreground: var(--foreground);
18+
--color-card: var(--card);
19+
--color-card-foreground: var(--card-foreground);
20+
--color-popover: var(--popover);
21+
--color-popover-foreground: var(--popover-foreground);
22+
--color-primary: var(--primary);
23+
--color-primary-foreground: var(--primary-foreground);
24+
--color-secondary: var(--secondary);
25+
--color-secondary-foreground: var(--secondary-foreground);
26+
--color-muted: var(--muted);
27+
--color-muted-foreground: var(--muted-foreground);
28+
--color-accent: var(--accent);
29+
--color-accent-foreground: var(--accent-foreground);
30+
--color-destructive: var(--destructive);
31+
--color-border: var(--border);
32+
--color-input: var(--input);
33+
--color-ring: var(--ring);
34+
--color-chart-1: var(--chart-1);
35+
--color-chart-2: var(--chart-2);
36+
--color-chart-3: var(--chart-3);
37+
--color-chart-4: var(--chart-4);
38+
--color-chart-5: var(--chart-5);
39+
--color-sidebar: var(--sidebar);
40+
--color-sidebar-foreground: var(--sidebar-foreground);
41+
--color-sidebar-primary: var(--sidebar-primary);
42+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
43+
--color-sidebar-accent: var(--sidebar-accent);
44+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
45+
--color-sidebar-border: var(--sidebar-border);
46+
--color-sidebar-ring: var(--sidebar-ring);
47+
}
48+
49+
:root {
50+
--radius: 0.625rem;
51+
--background: oklch(1 0 0);
52+
--foreground: oklch(0.145 0 0);
53+
--card: oklch(1 0 0);
54+
--card-foreground: oklch(0.145 0 0);
55+
--popover: oklch(1 0 0);
56+
--popover-foreground: oklch(0.145 0 0);
57+
--primary: oklch(0.205 0 0);
58+
--primary-foreground: oklch(0.985 0 0);
59+
--secondary: oklch(0.97 0 0);
60+
--secondary-foreground: oklch(0.205 0 0);
61+
--muted: oklch(0.97 0 0);
62+
--muted-foreground: oklch(0.556 0 0);
63+
--accent: oklch(0.97 0 0);
64+
--accent-foreground: oklch(0.205 0 0);
65+
--destructive: oklch(0.577 0.245 27.325);
66+
--border: oklch(0.922 0 0);
67+
--input: oklch(0.922 0 0);
68+
--ring: oklch(0.708 0 0);
69+
--chart-1: oklch(0.646 0.222 41.116);
70+
--chart-2: oklch(0.6 0.118 184.704);
71+
--chart-3: oklch(0.398 0.07 227.392);
72+
--chart-4: oklch(0.828 0.189 84.429);
73+
--chart-5: oklch(0.769 0.188 70.08);
74+
--sidebar: oklch(0.985 0 0);
75+
--sidebar-foreground: oklch(0.145 0 0);
76+
--sidebar-primary: oklch(0.205 0 0);
77+
--sidebar-primary-foreground: oklch(0.985 0 0);
78+
--sidebar-accent: oklch(0.97 0 0);
79+
--sidebar-accent-foreground: oklch(0.205 0 0);
80+
--sidebar-border: oklch(0.922 0 0);
81+
--sidebar-ring: oklch(0.708 0 0);
82+
}
83+
84+
.dark {
85+
--background: oklch(0.145 0 0);
86+
--foreground: oklch(0.985 0 0);
87+
--card: oklch(0.205 0 0);
88+
--card-foreground: oklch(0.985 0 0);
89+
--popover: oklch(0.205 0 0);
90+
--popover-foreground: oklch(0.985 0 0);
91+
--primary: oklch(0.922 0 0);
92+
--primary-foreground: oklch(0.205 0 0);
93+
--secondary: oklch(0.269 0 0);
94+
--secondary-foreground: oklch(0.985 0 0);
95+
--muted: oklch(0.269 0 0);
96+
--muted-foreground: oklch(0.708 0 0);
97+
--accent: oklch(0.269 0 0);
98+
--accent-foreground: oklch(0.985 0 0);
99+
--destructive: oklch(0.704 0.191 22.216);
100+
--border: oklch(1 0 0 / 10%);
101+
--input: oklch(1 0 0 / 15%);
102+
--ring: oklch(0.556 0 0);
103+
--chart-1: oklch(0.488 0.243 264.376);
104+
--chart-2: oklch(0.696 0.17 162.48);
105+
--chart-3: oklch(0.769 0.188 70.08);
106+
--chart-4: oklch(0.627 0.265 303.9);
107+
--chart-5: oklch(0.645 0.246 16.439);
108+
--sidebar: oklch(0.205 0 0);
109+
--sidebar-foreground: oklch(0.985 0 0);
110+
--sidebar-primary: oklch(0.488 0.243 264.376);
111+
--sidebar-primary-foreground: oklch(0.985 0 0);
112+
--sidebar-accent: oklch(0.269 0 0);
113+
--sidebar-accent-foreground: oklch(0.985 0 0);
114+
--sidebar-border: oklch(1 0 0 / 10%);
115+
--sidebar-ring: oklch(0.556 0 0);
116+
}
117+
118+
@layer base {
119+
* {
120+
@apply border-border outline-ring/50;
121+
}
122+
body {
123+
@apply bg-background text-foreground;
124+
}
125+
}

src/components/ui/button.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import * as React from "react";
2+
import { Slot } from "@radix-ui/react-slot";
3+
import { cva, type VariantProps } from "class-variance-authority";
4+
5+
import { cn } from "@/lib/utils";
6+
7+
const buttonVariants = cva(
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
9+
{
10+
variants: {
11+
variant: {
12+
default:
13+
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
14+
destructive:
15+
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
16+
outline:
17+
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
18+
secondary:
19+
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
20+
ghost:
21+
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
22+
link: "text-primary underline-offset-4 hover:underline",
23+
},
24+
size: {
25+
default: "h-9 px-4 py-2 has-[>svg]:px-3",
26+
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
27+
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
28+
icon: "size-9",
29+
},
30+
},
31+
defaultVariants: {
32+
variant: "default",
33+
size: "default",
34+
},
35+
}
36+
);
37+
38+
function Button({
39+
className,
40+
variant,
41+
size,
42+
asChild = false,
43+
...props
44+
}: React.ComponentProps<"button"> &
45+
VariantProps<typeof buttonVariants> & {
46+
asChild?: boolean;
47+
}) {
48+
const Comp = asChild ? Slot : "button";
49+
50+
return (
51+
<Comp
52+
data-slot="button"
53+
className={cn(buttonVariants({ variant, size, className }))}
54+
{...props}
55+
/>
56+
);
57+
}
58+
59+
export { Button, buttonVariants };

src/lib/utils.ts

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

tsconfig.json

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"target": "ESNext",
5-
"lib": [
6-
"dom",
7-
"dom.iterable",
8-
"esnext"
9-
],
5+
"lib": ["dom", "dom.iterable", "esnext"],
106
"allowJs": true,
117
"skipLibCheck": true,
128
"strict": true,
@@ -20,26 +16,15 @@
2016
"jsx": "preserve",
2117
"incremental": true,
2218
"paths": {
23-
"@/.source": [
24-
"./.source/index.ts"
25-
],
26-
"@/*": [
27-
"./src/*"
28-
]
19+
"@/.source": ["./.source/index.ts"],
20+
"@/*": ["./src/*"]
2921
},
3022
"plugins": [
3123
{
3224
"name": "next"
3325
}
3426
]
3527
},
36-
"include": [
37-
"next-env.d.ts",
38-
"**/*.ts",
39-
"**/*.tsx",
40-
".next/types/**/*.ts"
41-
],
42-
"exclude": [
43-
"node_modules"
44-
]
28+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
29+
"exclude": ["node_modules"]
4530
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy