Skip to content

Commit 4b87614

Browse files
committed
feat: add ui package
1 parent a37b1ec commit 4b87614

23 files changed

+1186
-207
lines changed

.changeset/config.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,18 @@
33
"changelog": "@changesets/cli/changelog",
44
"commit": false,
55
"fixed": [],
6-
"linked": [],
6+
"linked": [
7+
[
8+
"frontend",
9+
"@quassel/ui"
10+
]
11+
],
712
"access": "restricted",
813
"baseBranch": "main",
914
"updateInternalDependencies": "patch",
1015
"ignore": [],
11-
"privatePackages": { "version": true, "tag": true }
16+
"privatePackages": {
17+
"version": true,
18+
"tag": true
19+
}
1220
}

.changeset/forty-candles-know.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"frontend": patch
3+
"@quassel/ui": patch
4+
---
5+
6+
Add quassel ui

apps/frontend/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
65
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
6+
<title>Quassel</title>
87
</head>
98
<body>
109
<div id="root"></div>

apps/frontend/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite --host",
8-
"build": "tsc -b && vite build",
8+
"build": "tsc && vite build",
99
"preview": "vite preview"
1010
},
1111
"dependencies": {
12+
"@quassel/ui": "workspace:*",
1213
"react": "^18.3.1",
1314
"react-dom": "^18.3.1"
1415
},
1516
"devDependencies": {
16-
"@types/react": "^18.3.9",
17+
"@types/react": "^18.3.10",
1718
"@types/react-dom": "^18.3.0",
1819
"@vitejs/plugin-react": "^4.3.1",
1920
"typescript": "^5.5.3",

apps/frontend/src/App.css

Lines changed: 0 additions & 42 deletions
This file was deleted.

apps/frontend/src/App.tsx

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,9 @@
1-
import { useState } from "react";
2-
import reactLogo from "./assets/react.svg";
3-
import viteLogo from "/vite.svg";
4-
import "./App.css";
1+
import { Button } from "@quassel/ui";
52

63
function App() {
7-
const [count, setCount] = useState(0);
8-
94
return (
105
<>
11-
<div>
12-
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
13-
<img src={viteLogo} className="logo" alt="Vite logo" />
14-
</a>
15-
<a href="https://react.dev" target="_blank" rel="noreferrer">
16-
<img src={reactLogo} className="logo react" alt="React logo" />
17-
</a>
18-
</div>
19-
<h1>Vite + React</h1>
20-
<div className="card">
21-
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
22-
<p>
23-
Edit <code>src/App.tsx</code> and save to test HMR
24-
</p>
25-
</div>
26-
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
6+
<Button variant="filled">Hello World</Button>
277
</>
288
);
299
}

apps/frontend/src/assets/react.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/frontend/src/index.css

Lines changed: 0 additions & 68 deletions
This file was deleted.

apps/frontend/src/main.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import { StrictMode } from "react";
22
import { createRoot } from "react-dom/client";
33
import App from "./App.tsx";
4-
import "./index.css";
4+
import "@quassel/ui/style.css";
5+
import { ThemeProvider } from "@quassel/ui";
56

67
createRoot(document.getElementById("root")!).render(
78
<StrictMode>
8-
<App />
9+
<ThemeProvider>
10+
<App />
11+
</ThemeProvider>
912
</StrictMode>
1013
);

apps/frontend/tsconfig.app.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

apps/frontend/tsconfig.json

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,35 @@
11
{
2-
"files": [],
2+
"$schema": "https://json.schemastore.org/tsconfig",
3+
"display": "Frontend",
4+
"compilerOptions": {
5+
"target": "ESNext",
6+
"useDefineForClassFields": true,
7+
"lib": [
8+
"DOM",
9+
"DOM.Iterable",
10+
"ESNext"
11+
],
12+
"allowJs": false,
13+
"skipLibCheck": true,
14+
"esModuleInterop": false,
15+
"allowSyntheticDefaultImports": true,
16+
"allowImportingTsExtensions": true,
17+
"strict": true,
18+
"forceConsistentCasingInFileNames": true,
19+
"module": "ESNext",
20+
"moduleResolution": "Node",
21+
"resolveJsonModule": true,
22+
"isolatedModules": true,
23+
"noEmit": true,
24+
"jsx": "react-jsx",
25+
"types": []
26+
},
27+
"include": [
28+
"src"
29+
],
330
"references": [
4-
{ "path": "./tsconfig.app.json" },
5-
{ "path": "./tsconfig.node.json" }
31+
{
32+
"path": "./tsconfig.node.json"
33+
}
634
]
735
}

apps/frontend/tsconfig.node.json

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,9 @@
11
{
22
"compilerOptions": {
3-
"target": "ES2022",
4-
"lib": ["ES2023"],
3+
"composite": true,
54
"module": "ESNext",
6-
"skipLibCheck": true,
7-
8-
/* Bundler mode */
9-
"moduleResolution": "bundler",
10-
"allowImportingTsExtensions": true,
11-
"isolatedModules": true,
12-
"moduleDetection": "force",
13-
"noEmit": true,
14-
15-
/* Linting */
16-
"strict": true,
17-
"noUnusedLocals": true,
18-
"noUnusedParameters": true,
19-
"noFallthroughCasesInSwitch": true
5+
"moduleResolution": "Node",
6+
"allowSyntheticDefaultImports": true
207
},
218
"include": ["vite.config.ts"]
229
}

libs/ui/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

libs/ui/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# `@quassel/ui`

libs/ui/package.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "@quassel/ui",
3+
"private": true,
4+
"version": "0.0.0",
5+
"type": "module",
6+
"main": "./dist/index.cjs",
7+
"module": "./dist/index.js",
8+
"types": "./dist/index.d.ts",
9+
"style": "./dist/style.css",
10+
"exports": {
11+
".": {
12+
"import": "./dist/index.js",
13+
"require": "./dist/index.cjs"
14+
},
15+
"./style.css": "./dist/style.css"
16+
},
17+
"scripts": {
18+
"dev": "nx run-many -t build:dev --output-style stream-without-prefixes",
19+
"build": "vite build --minify",
20+
"build:dev": "vite build --watch --sourcemap",
21+
"lint": "eslint .",
22+
"preview": "vite preview"
23+
},
24+
"dependencies": {
25+
"@mantine/core": "^7.13.0",
26+
"@mantine/hooks": "^7.13.0",
27+
"@tabler/icons-react": "^3.19.0",
28+
"react": "^18.3.1",
29+
"react-dom": "^18.3.1"
30+
},
31+
"devDependencies": {
32+
"@eslint/js": "^9.9.0",
33+
"@types/react": "^18.3.10",
34+
"@types/react-dom": "^18.3.0",
35+
"@vitejs/plugin-react": "^4.3.1",
36+
"typescript": "^5.5.3",
37+
"vite": "^5.4.1",
38+
"vite-plugin-dts": "^4.2.2"
39+
}
40+
}

libs/ui/src/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Theme
2+
export { ThemeProvider } from "./theme/ThemeProvider";
3+
4+
// modified components
5+
6+
// external components
7+
export { AppShell, Button, Title, UnstyledButton, useMantineTheme } from "@mantine/core";
8+
export * from "@tabler/icons-react";

libs/ui/src/theme/Theme.css

Whitespace-only changes.

libs/ui/src/theme/Theme.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { MantineThemeOverride } from "@mantine/core";
2+
import "./Theme.css";
3+
4+
export const theme: MantineThemeOverride = {
5+
colors: {
6+
orange: ["#FFECE5", "#FFC9B8", "#FFA68A", "#FF835C", "#FF602E", "#FF3D00", "#CC3100", "#992500", "#661800", "#330C00"],
7+
},
8+
primaryColor: "orange",
9+
};

0 commit comments

Comments
 (0)