Skip to content

Commit edaaf5e

Browse files
authored
feat(upgrade): Upgraded tailwind v4 (#209)
* feat(upgrade): Upgraded tailwind v4 * feat(upgrade): deps and shadcn
1 parent 48bfc9b commit edaaf5e

Some content is hidden

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

60 files changed

+5468
-3198
lines changed

src/package.json

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,33 @@
1717
"@hey-api/client-fetch": "^0.10.0",
1818
"@hey-api/openapi-ts": "^0.66.5",
1919
"@hookform/resolvers": "^5.0.1",
20-
"@radix-ui/react-accordion": "^1.2.7",
21-
"@radix-ui/react-alert-dialog": "^1.1.10",
22-
"@radix-ui/react-aspect-ratio": "^1.1.4",
23-
"@radix-ui/react-avatar": "^1.1.6",
24-
"@radix-ui/react-checkbox": "^1.2.2",
25-
"@radix-ui/react-collapsible": "^1.1.7",
26-
"@radix-ui/react-context-menu": "^2.2.11",
27-
"@radix-ui/react-dialog": "^1.1.10",
28-
"@radix-ui/react-dropdown-menu": "^2.1.11",
29-
"@radix-ui/react-hover-card": "^1.1.10",
30-
"@radix-ui/react-label": "^2.1.4",
31-
"@radix-ui/react-menubar": "^1.1.11",
32-
"@radix-ui/react-navigation-menu": "^1.2.9",
33-
"@radix-ui/react-popover": "^1.1.10",
34-
"@radix-ui/react-progress": "^1.1.4",
35-
"@radix-ui/react-radio-group": "^1.3.3",
36-
"@radix-ui/react-scroll-area": "^1.2.5",
37-
"@radix-ui/react-select": "^2.2.2",
38-
"@radix-ui/react-separator": "^1.1.4",
39-
"@radix-ui/react-slider": "^1.3.2",
40-
"@radix-ui/react-slot": "^1.2.0",
41-
"@radix-ui/react-switch": "^1.2.2",
42-
"@radix-ui/react-tabs": "^1.1.8",
43-
"@radix-ui/react-toast": "^1.2.10",
44-
"@radix-ui/react-toggle": "^1.1.6",
45-
"@radix-ui/react-toggle-group": "^1.1.7",
46-
"@radix-ui/react-tooltip": "^1.2.3",
20+
"@radix-ui/react-accordion": "^1.2.10",
21+
"@radix-ui/react-alert-dialog": "^1.1.13",
22+
"@radix-ui/react-aspect-ratio": "^1.1.6",
23+
"@radix-ui/react-avatar": "^1.1.9",
24+
"@radix-ui/react-checkbox": "^1.3.1",
25+
"@radix-ui/react-collapsible": "^1.1.10",
26+
"@radix-ui/react-context-menu": "^2.2.14",
27+
"@radix-ui/react-dialog": "^1.1.13",
28+
"@radix-ui/react-dropdown-menu": "^2.1.14",
29+
"@radix-ui/react-hover-card": "^1.1.13",
30+
"@radix-ui/react-label": "^2.1.6",
31+
"@radix-ui/react-menubar": "^1.1.14",
32+
"@radix-ui/react-navigation-menu": "^1.2.12",
33+
"@radix-ui/react-popover": "^1.1.13",
34+
"@radix-ui/react-progress": "^1.1.6",
35+
"@radix-ui/react-radio-group": "^1.3.6",
36+
"@radix-ui/react-scroll-area": "^1.2.8",
37+
"@radix-ui/react-select": "^2.2.4",
38+
"@radix-ui/react-separator": "^1.1.6",
39+
"@radix-ui/react-slider": "^1.3.4",
40+
"@radix-ui/react-slot": "^1.2.2",
41+
"@radix-ui/react-switch": "^1.2.4",
42+
"@radix-ui/react-tabs": "^1.1.11",
43+
"@radix-ui/react-toast": "^1.2.13",
44+
"@radix-ui/react-toggle": "^1.1.8",
45+
"@radix-ui/react-toggle-group": "^1.1.9",
46+
"@radix-ui/react-tooltip": "^1.2.6",
4747
"@tanstack/react-query": "^5.74.4",
4848
"@tanstack/react-table": "^8.21.3",
4949
"class-variance-authority": "^0.7.1",
@@ -55,26 +55,28 @@
5555
"ioredis": "^5.6.1",
5656
"iron-session": "^8.0.4",
5757
"jwt-decode": "^4.0.0",
58-
"lucide-react": "^0.501.0",
58+
"lucide-react": "^0.511.0",
5959
"next": "15.3.1",
6060
"next-themes": "^0.4.6",
6161
"openid-client": "^6.4.2",
6262
"prettier-plugin-organize-imports": "^4.1.0",
6363
"react": "^19.1.0",
64-
"react-day-picker": "^9.6.7",
64+
"react-day-picker": "^8.10.1",
6565
"react-dom": "^19.1.0",
6666
"react-hook-form": "^7.56.0",
6767
"react-resizable-panels": "^2.1.7",
68+
"recharts": "^2.15.3",
6869
"sharp": "^0.34.1",
6970
"sonner": "^2.0.3",
70-
"tailwind-merge": "^3.2.0",
71-
"tailwindcss-animate": "^1.0.7",
71+
"tailwind-merge": "^3.3.0",
72+
"tw-animate-css": "^1.3.0",
7273
"uuid": "^11.1.0",
7374
"vaul": "^1.1.2",
7475
"zod": "^3.24.3"
7576
},
7677
"devDependencies": {
7778
"@release-it/conventional-changelog": "^10.0.1",
79+
"@tailwindcss/postcss": "^4.1.7",
7880
"@tanstack/eslint-plugin-query": "^5.73.3",
7981
"@types/node": "^22.14.1",
8082
"@types/react": "^19.1.2",
@@ -91,7 +93,7 @@
9193
"prettier-plugin-tailwindcss": "^0.6.11",
9294
"release-it": "^19.0.1",
9395
"release-it-changelogen": "^0.1.0",
94-
"tailwindcss": "^3.4.17",
96+
"tailwindcss": "^4.1.7",
9597
"typescript": "^5.8.3"
9698
},
9799
"lint-staged": {

src/pnpm-lock.yaml

Lines changed: 991 additions & 718 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/postcss.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type {import('postcss-load-config').Config} */
22
const config = {
33
plugins: {
4-
tailwindcss: {},
4+
'@tailwindcss/postcss': {},
55
},
66
}
77

src/src/app/globals.css

Lines changed: 172 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,93 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
1+
@import 'tailwindcss';
2+
@import "tw-animate-css";
3+
4+
@custom-variant dark (&:is(.dark *));
5+
6+
@theme {
7+
--font-sans:
8+
var(--font-sans), ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
9+
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
10+
11+
--color-border: hsl(var(--border));
12+
--color-input: hsl(var(--input));
13+
--color-ring: hsl(var(--ring));
14+
--color-background: hsl(var(--background));
15+
--color-foreground: hsl(var(--foreground));
16+
17+
--color-primary: hsl(var(--primary));
18+
--color-primary-foreground: hsl(var(--primary-foreground));
19+
20+
--color-secondary: hsl(var(--secondary));
21+
--color-secondary-foreground: hsl(var(--secondary-foreground));
22+
23+
--color-destructive: hsl(var(--destructive));
24+
--color-destructive-foreground: hsl(var(--destructive-foreground));
25+
26+
--color-muted: hsl(var(--muted));
27+
--color-muted-foreground: hsl(var(--muted-foreground));
28+
29+
--color-accent: hsl(var(--accent));
30+
--color-accent-foreground: hsl(var(--accent-foreground));
31+
32+
--color-popover: hsl(var(--popover));
33+
--color-popover-foreground: hsl(var(--popover-foreground));
34+
35+
--color-card: hsl(var(--card));
36+
--color-card-foreground: hsl(var(--card-foreground));
37+
38+
--radius-lg: var(--radius);
39+
--radius-md: calc(var(--radius) - 2px);
40+
--radius-sm: calc(var(--radius) - 4px);
41+
42+
--animate-accordion-down: accordion-down 0.2s ease-out;
43+
--animate-accordion-up: accordion-up 0.2s ease-out;
44+
45+
@keyframes accordion-down {
46+
from {
47+
height: 0;
48+
}
49+
to {
50+
height: var(--radix-accordion-content-height);
51+
}
52+
}
53+
@keyframes accordion-up {
54+
from {
55+
height: var(--radix-accordion-content-height);
56+
}
57+
to {
58+
height: 0;
59+
}
60+
}
61+
}
62+
63+
@utility container {
64+
margin-inline: auto;
65+
padding-inline: 2rem;
66+
@media (width >= --theme(--breakpoint-sm)) {
67+
max-width: none;
68+
}
69+
@media (width >= 1400px) {
70+
max-width: 1400px;
71+
}
72+
}
73+
74+
/*
75+
The default border color has changed to `currentcolor` in Tailwind CSS v4,
76+
so we've added these compatibility styles to make sure everything still
77+
looks the same as it did with Tailwind CSS v3.
78+
79+
If we ever want to remove these styles, we need to add an explicit border
80+
color utility to any element that depends on these defaults.
81+
*/
82+
@layer base {
83+
*,
84+
::after,
85+
::before,
86+
::backdrop,
87+
::file-selector-button {
88+
border-color: var(--color-gray-200, currentcolor);
89+
}
90+
}
491

592
@layer base {
693
:root {
@@ -48,3 +135,85 @@
48135
--ring: 224.3 76.3% 48%;
49136
}
50137
}
138+
139+
/*
140+
---break---
141+
*/
142+
143+
:root {
144+
--sidebar:
145+
hsl(0 0% 98%);
146+
--sidebar-foreground:
147+
hsl(240 5.3% 26.1%);
148+
--sidebar-primary:
149+
hsl(240 5.9% 10%);
150+
--sidebar-primary-foreground:
151+
hsl(0 0% 98%);
152+
--sidebar-accent:
153+
hsl(240 4.8% 95.9%);
154+
--sidebar-accent-foreground:
155+
hsl(240 5.9% 10%);
156+
--sidebar-border:
157+
hsl(220 13% 91%);
158+
--sidebar-ring:
159+
hsl(217.2 91.2% 59.8%);
160+
}
161+
162+
/*
163+
---break---
164+
*/
165+
166+
.dark {
167+
--sidebar:
168+
hsl(240 5.9% 10%);
169+
--sidebar-foreground:
170+
hsl(240 4.8% 95.9%);
171+
--sidebar-primary:
172+
hsl(224.3 76.3% 48%);
173+
--sidebar-primary-foreground:
174+
hsl(0 0% 100%);
175+
--sidebar-accent:
176+
hsl(240 3.7% 15.9%);
177+
--sidebar-accent-foreground:
178+
hsl(240 4.8% 95.9%);
179+
--sidebar-border:
180+
hsl(240 3.7% 15.9%);
181+
--sidebar-ring:
182+
hsl(217.2 91.2% 59.8%);
183+
}
184+
185+
/*
186+
---break---
187+
*/
188+
189+
@theme inline {
190+
--color-sidebar:
191+
var(--sidebar);
192+
--color-sidebar-foreground:
193+
var(--sidebar-foreground);
194+
--color-sidebar-primary:
195+
var(--sidebar-primary);
196+
--color-sidebar-primary-foreground:
197+
var(--sidebar-primary-foreground);
198+
--color-sidebar-accent:
199+
var(--sidebar-accent);
200+
--color-sidebar-accent-foreground:
201+
var(--sidebar-accent-foreground);
202+
--color-sidebar-border:
203+
var(--sidebar-border);
204+
--color-sidebar-ring:
205+
var(--sidebar-ring);
206+
}
207+
208+
/*
209+
---break---
210+
*/
211+
212+
@layer base {
213+
* {
214+
@apply border-border outline-ring/50;
215+
}
216+
body {
217+
@apply bg-background text-foreground;
218+
}
219+
}

src/src/components/Login.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const Login = () => {
1010
if (data?.isLoggedIn) {
1111
return (
1212
<button
13-
className="inline-flex h-10 items-center justify-center rounded-md bg-blue-600 px-6 text-sm font-medium text-white shadow-sm transition-colors hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-400"
13+
className="inline-flex h-10 items-center justify-center rounded-md bg-blue-600 px-6 text-sm font-medium text-white shadow-xs transition-colors hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-400"
1414
onClick={() => {
1515
window.location.href = '/auth/logout'
1616
}}
@@ -22,7 +22,7 @@ const Login = () => {
2222

2323
return (
2424
<button
25-
className="inline-flex h-10 items-center justify-center rounded-md bg-blue-600 px-6 text-sm font-medium text-white shadow-sm transition-colors hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-400"
25+
className="inline-flex h-10 items-center justify-center rounded-md bg-blue-600 px-6 text-sm font-medium text-white shadow-xs transition-colors hover:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-400"
2626
onClick={() => {
2727
window.location.href = '/auth/login'
2828
}}

src/src/components/tenant/FeatureList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const FeatureList = ({ onDismiss, tenantId }: FeatureListProps) => {
131131
<DialogTitle>Features</DialogTitle>
132132
</DialogHeader>
133133
<form onSubmit={handleSubmit(onSubmit)}>
134-
<div className="grid grid-cols-1 items-baseline gap-2 sm:grid-cols-[12rem_minmax(10rem,_1fr)_auto]">
134+
<div className="grid grid-cols-1 items-baseline gap-2 sm:grid-cols-[12rem_minmax(10rem,1fr)_auto]">
135135
<div className="p-3">
136136
{data?.groups?.map((el: FeatureGroupDto) => (
137137
<span key={v4()}>{el.displayName}</span>

src/src/components/ui/CustomTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const TableView = <T extends unknown>({ table, totalCount, pageSize }: TableView
6868
</table>
6969
</section>
7070
<div className="flex flex-col border-t p-5 lg:flex-row lg:items-center">
71-
<div className="text-base-content flex-grow pb-2">{totalCount} total</div>
71+
<div className="text-base-content grow pb-2">{totalCount} total</div>
7272
{totalCount > 10 && <Pagination<T> pageCount={pageCount} table={table} />}
7373
</div>
7474
</section>

src/src/components/ui/Loader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Loader2 } from 'lucide-react'
22
const Loader = () => {
33
return (
4-
<div className="z-50 flex min-h-[20rem] w-full items-center justify-center">
4+
<div className="z-50 flex min-h-80 w-full items-center justify-center">
55
<Loader2 width={24} height={24} className="animate-spin" />
66
</div>
77
)

0 commit comments

Comments
 (0)