Skip to content

Upgrade React v19 and Tailwind v4 #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
12,920 changes: 7,701 additions & 5,219 deletions package-lock.json

Large diffs are not rendered by default.

61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "rspress-doc-template",
"version": "1.0.0",
"private": true,
"main": "dist/docs/index.js",
"scripts": {
"dev": "rspress dev",
"build": "rspress build",
Expand All @@ -11,43 +12,43 @@
"lint": "biome lint --write"
},
"dependencies": {
"@fontsource/inter": "^5.0.20",
"@internationalized/date": "^3.5.5",
"@react-aria/accordion": "^3.0.0-alpha.31",
"@react-aria/toast": "^3.0.0-beta.14",
"@react-stately/toast": "^3.0.0-beta.5",
"@react-stately/tree": "^3.8.3",
"lucide-react": "^0.424.0",
"react-aria": "^3.34.1",
"react-aria-components": "^1.3.1",
"recharts": "^2.12.7",
"tailwind-variants": "^0.2.1"
"@fontsource/inter": "^5.2.5",
"@internationalized/date": "^3.8.0",
"@react-aria/accordion": "^3.0.0-alpha.37",
"@react-aria/toast": "^3.0.2",
"@react-stately/toast": "^3.1.0",
"@react-stately/tree": "^3.8.9",
"@tailwindcss/postcss": "^4.1.5",
"lucide-react": "^0.509.0",
"react-aria": "^3.39.0",
"react-aria-components": "^1.8.0",
"recharts": "^2.15.3",
"tailwind-variants": "^1.0.0"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@rspress/plugin-api-docgen": "^1.27.0",
"@rspress/plugin-last-updated": "^1.27.0",
"@rspress/plugin-preview": "^1.27.0",
"@spectrum-icons/illustrations": "^3.6.15",
"@types/node": "^20",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.20",
"@biomejs/biome": "^1.9.4",
"@rspress/plugin-api-docgen": "^2.0.0-beta.5",
"@rspress/plugin-last-updated": "^2.0.0-beta.5",
"@rspress/plugin-preview": "^2.0.0-beta.5",
"@spectrum-icons/illustrations": "^3.6.21",
"@types/node": "^22.15.17",
"@types/react": "^19.1.3",
"@types/react-dom": "^19.1.3",
"autoprefixer": "^10.4.21",
"postcss-import": "^16.1.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"rspress": "^1.27.0",
"tailwindcss": "^3.4.7",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rspress": "^2.0.0-beta.5",
"tailwindcss": "^4.1.5",
"tailwindcss-animate": "^1.0.7",
"tailwindcss-react-aria-components": "^1.1.4",
"typescript": "^5.5.4",
"viridis": "^1.1.5",
"zod": "^3.23.8"
"tailwindcss-react-aria-components": "^2.0.0",
"typescript": "^5.8.3",
"viridis": "^1.1.8",
"zod": "^3.24.4"
},
"postcss": {
"plugins": {
"tailwindcss": {},
"autoprefixer": {}
"@tailwindcss/postcss": {}
}
}
}
2 changes: 1 addition & 1 deletion rspress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { defineConfig } from "rspress/config";

export default defineConfig({
ssg: false,
globalStyles: path.join(__dirname, "styles", "index.css"),
globalStyles: path.join(__dirname, "styles", "rspress.css"),
root: path.join(__dirname, "docs"),
route: {
exclude: ["**/_lib/*.*"]
Expand Down
3 changes: 0 additions & 3 deletions styles/index.css

This file was deleted.

14 changes: 7 additions & 7 deletions styles/rspress.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Rspress theme variables
*/
* Rspress theme variables
*/

:root {
--rp-nav-height: 57px;
Expand Down Expand Up @@ -33,8 +33,8 @@
}

/**
* Rspress theme mode variables
*/
* Rspress theme mode variables
*/
:root {
--rp-c-bg: hsl(var(--background));
--rp-c-bg-soft: hsl(var(--secondary));
Expand All @@ -55,8 +55,8 @@
}

/**
*
*/
*
*/

.rspress-preview-card {
height: 370px;
Expand All @@ -71,7 +71,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: 8px
gap: 8px;
}

button.outline {
Expand Down
93 changes: 0 additions & 93 deletions tailwind.config.ts

This file was deleted.

11 changes: 3 additions & 8 deletions theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { CustomizeThemeButton } from "@/ui/theme/CustomizeThemeButton";
import { ThemeProvider } from "@/ui/theme/ThemeContext";
import { ThemeModeProvider } from "@/ui/theme/mode/ThemeMode";
import Theme from "rspress/theme";
import { Layout as BasicLayout } from "rspress/theme";

const Layout = () => (
export const Layout = () => (
<ThemeModeProvider>
<ThemeProvider>
<Theme.Layout
<BasicLayout
afterNavMenu={
<div className="px-4">
<CustomizeThemeButton />
Expand All @@ -17,9 +17,4 @@ const Layout = () => (
</ThemeModeProvider>
);

export default {
...Theme,
Layout
};

export * from "rspress/theme";
6 changes: 3 additions & 3 deletions ui/charts/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ export function AreaChart<T extends string>({ data, isAnimationActive, className
type="monotone"
stroke={getChartColor(index, dataKeys.length)}
fill={getChartColor(index, dataKeys.length)}
className="!stroke-border"
className="stroke-border!"
activeDot={{ r: 4 }}
isAnimationActive={isAnimationActive}
/>
))}
<XAxis dataKey="name" className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<YAxis className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<XAxis dataKey="name" className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<YAxis className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<Legend stroke="hsl(var(--muted-foreground))" />
</ReAreaChart>
</ResponsiveContainer>
Expand Down
6 changes: 3 additions & 3 deletions ui/charts/BarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ export function BarChart<T extends string>({ data, isAnimationActive, className
key={key}
dataKey={key}
fill={getChartColor(index, dataKeys.length)}
className="!stroke-border"
className="stroke-border!"
isAnimationActive={isAnimationActive}
/>
))}
<XAxis dataKey="name" className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<YAxis className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<XAxis dataKey="name" className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<YAxis className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<Legend stroke="hsl(var(--muted-foreground))" />
</ReBarChart>
</ResponsiveContainer>
Expand Down
2 changes: 1 addition & 1 deletion ui/charts/CartesianGrid.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CartesianGrid as ReCartesianGrid } from "recharts";
import type { Props } from "recharts/types/cartesian/CartesianGrid";

export function CartesianGrid({ className = "!stroke-border", strokeDasharray = "3 3", ...props }: Props) {
export function CartesianGrid({ className = "stroke-border!", strokeDasharray = "3 3", ...props }: Props) {
return <ReCartesianGrid {...props} strokeDasharray={strokeDasharray} className={className} />;
}
6 changes: 3 additions & 3 deletions ui/charts/LinePlot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ export function LinePlot<T extends string>({ data, isAnimationActive, className
dataKey={key}
type="monotone"
stroke={getChartColor(index, dataKeys.length)}
className="!stroke-border"
className="stroke-border!"
activeDot={{ r: 4 }}
isAnimationActive={isAnimationActive}
/>
))}
<XAxis dataKey="name" className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<YAxis className="!text-sm" stroke="hsl(var(--muted-foreground))" />
<XAxis dataKey="name" className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<YAxis className="text-sm!" stroke="hsl(var(--muted-foreground))" />
<Legend stroke="hsl(var(--muted-foreground))" />
</LineChart>
</ResponsiveContainer>
Expand Down
2 changes: 1 addition & 1 deletion ui/charts/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function PieChart<T extends string>({ data, isAnimationActive, className
stroke={getChartColor(index, dataKeys.length)}
fill={getChartColor(index, dataKeys.length)}
{...radius[index]}
className="!stroke-border"
className="stroke-border!"
paddingAngle={1}
isAnimationActive={isAnimationActive}
/>
Expand Down
4 changes: 2 additions & 2 deletions ui/charts/RadarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ export function RadarChart<T extends string>({
<ResponsiveContainer width="100%" height="100%" className={className}>
<ReRadarChart cx="50%" cy="50%" outerRadius="80%" data={data}>
<PolarGrid />
<PolarAngleAxis dataKey="name" className="!text-sm" stroke="hsl(var(--foreground))" />
<PolarAngleAxis dataKey="name" className="text-sm!" stroke="hsl(var(--foreground))" />
<PolarRadiusAxis
angle={360 / data.length}
domain={domain}
className="!text-sm"
className="text-sm!"
stroke="hsl(var(--muted-foreground))"
/>

Expand Down
4 changes: 2 additions & 2 deletions ui/charts/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Tooltip as ReTooltip, type TooltipProps } from "recharts";
import type { NameType, ValueType } from "recharts/types/component/DefaultTooltipContent";

export function Tooltip<TValue extends ValueType, TName extends NameType>({
labelClassName = "!font-semibold !text-xs !text-foreground",
wrapperClassName = "!bg-background rounded-xl !border !border-border !p-2 !text-foreground !text-xs",
labelClassName = "font-semibold! text-xs! text-foreground!",
wrapperClassName = "bg-background! rounded-xl border! border-border! p-2! text-foreground! text-xs!",
itemStyle = { background: "hsl(var(--background))", color: "hsl(var(--foreground))" },
...props
}: TooltipProps<TValue, TName>) {
Expand Down
8 changes: 4 additions & 4 deletions ui/components/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ const checkboxStyles = tv({

const boxStyles = tv({
extend: focusRing,
base: "w-5 h-5 flex-shrink-0 rounded flex items-center justify-center border-2 transition",
base: "w-5 h-5 shrink-0 rounded flex items-center justify-center border-2 transition",
variants: {
isSelected: {
false: "bg-background border-[--color] [--color:theme(colors.foreground)] group-pressed:opacity-90",
true: "text-primary-foreground bg-[--color] border-[--color] [--color:theme(colors.primary.DEFAULT)] group-pressed:group-pressed:opacity-90"
false: "bg-background border-(--color) [--color:var(--color-foreground)] group-pressed:opacity-90",
true: "text-primary-foreground bg-(--color) border-(--color) [--color:var(--color-primary)] group-pressed:group-pressed:opacity-90"
},
isInvalid: {
true: "text-destructive-foreground [--color:theme(colors.destructive.DEFAULT)] group-pressed:group-pressed:opacity-90"
true: "text-destructive-foreground [--color:var(--color-destructive)] group-pressed:group-pressed:opacity-90"
},
isDisabled: {
true: "opacity-50 cursor-not-allowed"
Expand Down
2 changes: 1 addition & 1 deletion ui/components/ComboBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function ComboBox<T extends object>({
</FieldGroup>
{description && <Description>{description}</Description>}
<FieldError>{errorMessage}</FieldError>
<Popover className="w-[--trigger-width]" isOpen={isOpen}>
<Popover className="w-(--trigger-width)" isOpen={isOpen}>
<ListBox
items={items}
className="max-h-[inherit] overflow-auto p-1 outline-0 [clip-path:inset(0_0_0_0_round_.75rem)]"
Expand Down
2 changes: 1 addition & 1 deletion ui/components/DropZone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { DropZoneProps } from "react-aria-components";
import { tv } from "tailwind-variants";

const dropZoneStyles = tv({
base: "flex h-[150px] w-[300px] flex-col items-center justify-center gap-2 rounded-md border border-dashed text-sm data-[drop-target]:border-solid data-[drop-target]:border-primary data-[drop-target]:bg-accent"
base: "flex h-[150px] w-[300px] flex-col items-center justify-center gap-2 rounded-md border border-dashed text-sm data-drop-target:border-solid data-drop-target:border-primary data-drop-target:bg-accent"
});

export function DropZone({ className, ...props }: Readonly<DropZoneProps>) {
Expand Down
2 changes: 1 addition & 1 deletion ui/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Modal as AriaModal, ModalOverlay, type ModalOverlayProps } from "react-
import { tv } from "tailwind-variants";

const overlayStyles = tv({
base: "fixed top-0 left-0 w-full h-[--visual-viewport-height] isolate z-20 bg-black/[15%] text-center flex backdrop-blur-lg",
base: "fixed top-0 left-0 w-full h-(--visual-viewport-height) isolate z-20 bg-black/[15%] text-center flex backdrop-blur-lg",
variants: {
isEntering: {
true: "animate-in fade-in duration-200 ease-out"
Expand Down
Loading
Loading