Skip to content

Commit efe32b5

Browse files
authored
Major upgrade (#216)
* upgrade to react 19 * fix: upgrade sb and add next 15 test app
1 parent c36fe2d commit efe32b5

File tree

762 files changed

+67568
-21370
lines changed

Some content is hidden

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

762 files changed

+67568
-21370
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ packages/**/dist/
1010
packages/**/lib/
1111
packages/**/types/
1212
storybook-static/
13-
packages/react/src
14-
packages/vue/src
1513
**/stats.html
1614
.idea
1715
/.yarnrc
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
# or
14+
bun dev
15+
```
16+
17+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18+
19+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
20+
21+
This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel.
22+
23+
## Learn More
24+
25+
To learn more about Next.js, take a look at the following resources:
26+
27+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29+
30+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome!
31+
32+
## Deploy on Vercel
33+
34+
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35+
36+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
};
6+
7+
export default nextConfig;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "react-nextjs-app-router",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --turbopack",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@interchain-ui/react": "workspace:*",
13+
"clsx": "^2.1.1",
14+
"next": "15.2.3",
15+
"react": "^19.0.0",
16+
"react-dom": "^19.0.0"
17+
},
18+
"devDependencies": {
19+
"@eslint/eslintrc": "^3",
20+
"@tailwindcss/postcss": "^4",
21+
"@types/node": "^20",
22+
"@types/react": "^19",
23+
"@types/react-dom": "^19",
24+
"eslint": "^9",
25+
"eslint-config-next": "15.2.3",
26+
"tailwindcss": "^4",
27+
"typescript": "^5"
28+
}
29+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = {
2+
plugins: ["@tailwindcss/postcss"],
3+
};
4+
5+
export default config;
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
25.3 KB
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@import "tailwindcss";
2+
3+
:root {
4+
--background: #ffffff;
5+
--foreground: #171717;
6+
}
7+
8+
@theme inline {
9+
--color-background: var(--background);
10+
--color-foreground: var(--foreground);
11+
--font-sans: var(--font-geist-sans);
12+
--font-mono: var(--font-geist-mono);
13+
}
14+
15+
@media (prefers-color-scheme: dark) {
16+
:root {
17+
--background: #0a0a0a;
18+
--foreground: #ededed;
19+
}
20+
}
21+
22+
body {
23+
background: var(--background);
24+
color: var(--foreground);
25+
font-family: Arial, Helvetica, sans-serif;
26+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import type { Metadata } from "next";
2+
import { Geist, Geist_Mono } from "next/font/google";
3+
import "./globals.css";
4+
import "@interchain-ui/react/styles";
5+
import { ThemeProvider } from "./providers/theme-provider";
6+
7+
const geistSans = Geist({
8+
variable: "--font-geist-sans",
9+
subsets: ["latin"],
10+
});
11+
12+
const geistMono = Geist_Mono({
13+
variable: "--font-geist-mono",
14+
subsets: ["latin"],
15+
});
16+
17+
export const metadata: Metadata = {
18+
title: "Interchain UI Components",
19+
description: "Component playground for Interchain UI components",
20+
};
21+
22+
export default function RootLayout({
23+
children,
24+
}: Readonly<{
25+
children: React.ReactNode;
26+
}>) {
27+
return (
28+
<html lang="en" className="h-full">
29+
<body
30+
className={`${geistSans.variable} ${geistMono.variable} antialiased min-h-full`}
31+
>
32+
<ThemeProvider>
33+
<main className="min-h-screen w-full">{children}</main>
34+
</ThemeProvider>
35+
</body>
36+
</html>
37+
);
38+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import HomeScreen from "@/components/screens/home-screen";
2+
3+
export default function Home() {
4+
return <HomeScreen />;
5+
}
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
"use client";
2+
3+
import { useState, useEffect } from "react";
4+
import {
5+
ThemeProvider as InterchainThemeProvider,
6+
Box,
7+
IconButton,
8+
useTheme,
9+
} from "@interchain-ui/react";
10+
import clsx from "clsx";
11+
12+
const lightTheme = {
13+
name: "light",
14+
vars: {
15+
colors: {
16+
background: "#ffffff",
17+
foreground: "#171717",
18+
},
19+
},
20+
};
21+
22+
const darkTheme = {
23+
name: "dark",
24+
vars: {
25+
colors: {
26+
background: "#0a0a0a",
27+
foreground: "#ededed",
28+
},
29+
},
30+
};
31+
32+
export function ThemeProvider({ children }: { children: React.ReactNode }) {
33+
const { theme, themeClass, setTheme } = useTheme();
34+
const [isMounted, setIsMounted] = useState(false);
35+
36+
useEffect(() => {
37+
setIsMounted(true);
38+
}, []);
39+
40+
return (
41+
<InterchainThemeProvider themeDefs={[lightTheme, darkTheme]}>
42+
<div className={clsx("app", themeClass)}>
43+
<Box
44+
position="relative"
45+
backgroundColor={theme === "dark" ? "$gray700" : "$white"}
46+
>
47+
<Box
48+
// Prevent flash of unstyled background on Safari
49+
bg={isMounted ? "$background" : "transparent"}
50+
transition="all 0.3s ease"
51+
attributes={{
52+
id: "layout-container",
53+
}}
54+
>
55+
{children}
56+
</Box>
57+
58+
<Box position="absolute" top="$4" right="$6">
59+
<IconButton
60+
variant="outlined"
61+
intent="tertiary"
62+
size="sm"
63+
icon={theme === "dark" ? "sunLine" : "moonLine"}
64+
onClick={() => {
65+
if (theme === "light") {
66+
return setTheme("dark");
67+
}
68+
return setTheme("light");
69+
}}
70+
/>
71+
</Box>
72+
</Box>
73+
</div>
74+
</InterchainThemeProvider>
75+
);
76+
}

0 commit comments

Comments
 (0)