Skip to content
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

feat: ui shell #14

Merged
merged 1 commit into from
Oct 8, 2024
Merged
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
188 changes: 0 additions & 188 deletions apps/web/app/page.module.css

This file was deleted.

100 changes: 7 additions & 93 deletions apps/web/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,99 +1,13 @@
import Image from "next/image";
import { Button } from "@repo/ui/button";
import styles from "./page.module.css";
import { ActionBar } from "@repo/ui/shell/action-bar";
import { HeaderBar } from "@repo/ui/shell/header-bar";
import { Main } from "@repo/ui/shell/main";

export default function Home() {
return (
<div className={styles.page}>
<main className={styles.main}>
<Image
className={styles.logo}
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol>
<li>
Get started by editing <code>app/page.tsx</code>
</li>
<li>Save and see your changes instantly.</li>
</ol>

<div className={styles.ctas}>
<a
className={styles.primary}
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className={styles.logo}
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
className={styles.secondary}
>
Read our docs
</a>
</div>
<Button appName="web" className={styles.secondary}>
Open alert
</Button>
</main>
<footer className={styles.footer}>
<a
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file-text.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org →
</a>
</footer>
<div>
<ActionBar></ActionBar>
<HeaderBar></HeaderBar>
<Main>Swolo</Main>
</div>
);
}
7 changes: 5 additions & 2 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
},
"dependencies": {
"@repo/ui": "workspace:*",
"clsx": "^2.1.1",
"next": "14.2.6",
"react": "18.3.1",
"react-dom": "18.3.1"
"react-dom": "18.3.1",
"tailwind-merge": "^2.5.3"
},
"devDependencies": {
"@repo/eslint-config": "workspace:*",
Expand All @@ -26,6 +28,7 @@
"eslint-config-next": "14.2.6",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.1",
"typescript": "^5"
"typescript": "^5.6.2",
"typescript-plugin-css-modules": "^5.1.0"
}
}
2 changes: 1 addition & 1 deletion apps/web/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Config } from "tailwindcss";
import sharedConfig from "@repo/tailwind-config";

const config: Pick<Config, "content" | "presets"> = {
content: ["./app/**/*.tsx"],
content: ["./app/**/*.tsx", "../../packages/ui/**/*{.js,.ts,.jsx,.tsx}"],
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes an issue where tailwind occasionally wouldn't work in web.
https://www.willliu.com/blog/Why-your-Tailwind-styles-aren-t-working-in-your-Turborepo

presets: [sharedConfig],
};

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"devDependencies": {
"prettier": "^3.2.5",
"turbo": "^2.1.3",
"typescript": "^5.4.5"
"typescript": "^5.6.2"
},
"packageManager": "[email protected]",
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"react-internal.js"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vercel/style-guide": "^5.2.0",
"eslint-config-turbo": "^2.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-turbo": "^2.0.0",
"eslint-plugin-only-warn": "^1.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"typescript": "^5.3.3"
"typescript": "^5.6.2"
}
}
10 changes: 8 additions & 2 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"private": true,
"exports": {
"./styles.css": "./dist/index.css",
"./shell/action-bar": "./src/shell/action-bar.tsx",
"./shell/header-bar": "./src/shell/header-bar.tsx",
"./shell/main": "./src/shell/main.tsx",
"./button": "./src/button.tsx",
"./card": "./src/card.tsx",
"./code": "./src/code.tsx"
Expand All @@ -28,9 +31,12 @@
"eslint": "^8.57.0",
"postcss": "^8.4.47",
"tailwindcss": "^3.4.1",
"typescript": "^5.3.3"
"typescript": "^5.6.2",
"typescript-plugin-css-modules": "^5.1.0"
},
"dependencies": {
"react": "^18.2.0"
"clsx": "^2.1.1",
"react": "^18.2.0",
"tailwind-merge": "^2.5.3"
}
}
3 changes: 3 additions & 0 deletions packages/ui/src/shell/action-bar.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.bg {
background-color: pink;
}
12 changes: 12 additions & 0 deletions packages/ui/src/shell/action-bar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"use client";
import { cn } from "../utls/lib";
import styles from "./action-bar.module.css";
import type { PropsWithChildren } from "react";

type ActionBarProps = PropsWithChildren<{
className?: string;
}>;

export const ActionBar = ({ children, className }: ActionBarProps) => {
return <div className={cn(className, styles.bg)}>{children}</div>;
};
Loading