Skip to content

Commit

Permalink
feat: add ui package
Browse files Browse the repository at this point in the history
  • Loading branch information
openscript committed Sep 28, 2024
1 parent a37b1ec commit 4b87614
Show file tree
Hide file tree
Showing 23 changed files with 1,186 additions and 207 deletions.
12 changes: 10 additions & 2 deletions .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"linked": [
[
"frontend",
"@quassel/ui"
]
],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": { "version": true, "tag": true }
"privatePackages": {
"version": true,
"tag": true
}
}
6 changes: 6 additions & 0 deletions .changeset/forty-candles-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"frontend": patch
"@quassel/ui": patch
---

Add quassel ui
3 changes: 1 addition & 2 deletions apps/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>Quassel</title>
</head>
<body>
<div id="root"></div>
Expand Down
5 changes: 3 additions & 2 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
"type": "module",
"scripts": {
"dev": "vite --host",
"build": "tsc -b && vite build",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@quassel/ui": "workspace:*",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/react": "^18.3.9",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.3",
Expand Down
42 changes: 0 additions & 42 deletions apps/frontend/src/App.css

This file was deleted.

24 changes: 2 additions & 22 deletions apps/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,9 @@
import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";
import { Button } from "@quassel/ui";

function App() {
const [count, setCount] = useState(0);

return (
<>
<div>
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
<a href="https://react.dev" target="_blank" rel="noreferrer">
<img src={reactLogo} className="logo react" alt="React logo" />
</a>
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>count is {count}</button>
<p>
Edit <code>src/App.tsx</code> and save to test HMR
</p>
</div>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
<Button variant="filled">Hello World</Button>
</>
);
}
Expand Down
1 change: 0 additions & 1 deletion apps/frontend/src/assets/react.svg

This file was deleted.

68 changes: 0 additions & 68 deletions apps/frontend/src/index.css

This file was deleted.

7 changes: 5 additions & 2 deletions apps/frontend/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App.tsx";
import "./index.css";
import "@quassel/ui/style.css";
import { ThemeProvider } from "@quassel/ui";

createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
<ThemeProvider>
<App />
</ThemeProvider>
</StrictMode>
);
24 changes: 0 additions & 24 deletions apps/frontend/tsconfig.app.json

This file was deleted.

34 changes: 31 additions & 3 deletions apps/frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
{
"files": [],
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Frontend",
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"allowImportingTsExtensions": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx",
"types": []
},
"include": [
"src"
],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
{
"path": "./tsconfig.node.json"
}
]
}
19 changes: 3 additions & 16 deletions apps/frontend/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2023"],
"composite": true,
"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
24 changes: 24 additions & 0 deletions libs/ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions libs/ui/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# `@quassel/ui`
40 changes: 40 additions & 0 deletions libs/ui/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "@quassel/ui",
"private": true,
"version": "0.0.0",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"style": "./dist/style.css",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./style.css": "./dist/style.css"
},
"scripts": {
"dev": "nx run-many -t build:dev --output-style stream-without-prefixes",
"build": "vite build --minify",
"build:dev": "vite build --watch --sourcemap",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@mantine/core": "^7.13.0",
"@mantine/hooks": "^7.13.0",
"@tabler/icons-react": "^3.19.0",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.9.0",
"@types/react": "^18.3.10",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
"typescript": "^5.5.3",
"vite": "^5.4.1",
"vite-plugin-dts": "^4.2.2"
}
}
8 changes: 8 additions & 0 deletions libs/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Theme
export { ThemeProvider } from "./theme/ThemeProvider";

// modified components

// external components
export { AppShell, Button, Title, UnstyledButton, useMantineTheme } from "@mantine/core";
export * from "@tabler/icons-react";
Empty file added libs/ui/src/theme/Theme.css
Empty file.
9 changes: 9 additions & 0 deletions libs/ui/src/theme/Theme.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { MantineThemeOverride } from "@mantine/core";
import "./Theme.css";

export const theme: MantineThemeOverride = {
colors: {
orange: ["#FFECE5", "#FFC9B8", "#FFA68A", "#FF835C", "#FF602E", "#FF3D00", "#CC3100", "#992500", "#661800", "#330C00"],
},
primaryColor: "orange",
};
Loading

0 comments on commit 4b87614

Please sign in to comment.