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

Shadcn fix #18

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
43 changes: 23 additions & 20 deletions apps/frontend/src/components/Main/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import { Button } from "@repo/ui/components/ui/button";
import { useBookStore } from '@/store/booksStore';
import { Button, buttonVariants } from "@repo/ui/components/ui/button";
import { useBookStore } from "@/store/booksStore";
import { cn } from "@repo/ui/lib/utils";

const Main = () => {
const amount = useBookStore(state => state.amount)
const updateAmount = useBookStore(state => state.updateAmount)
return (
<>
<div className='text-4xl text-green-500'>Buid your own X</div>
<Button className='mt-5 bg-blue-500 p-4'>Click me</Button>
<div className='mt-10'>
<h1> Books: {amount} </h1>
<Button
className='mt-5 bg-slate-500 p-4'
onClick={() => updateAmount(10)}
> Update Amount </Button>
const amount = useBookStore((state) => state.amount);
const updateAmount = useBookStore((state) => state.updateAmount);
return (
<>
<div className="text-4xl text-green-500">Buid your own X</div>
<Button className="mt-5 bg-blue-500 p-4">Click me</Button>
<div className="mt-10">
<h1> Books: {amount} </h1>
<Button
className={cn(buttonVariants())}
onClick={() => updateAmount(10)}
>
{" "}
Update Amount{" "}
</Button>
</div>
</>
);
};

</div>
</>
)
}

export default Main
export default Main;
67 changes: 1 addition & 66 deletions apps/frontend/src/index.css
Original file line number Diff line number Diff line change
@@ -1,66 +1 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;
--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;
--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;
--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;
--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;
--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;
--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;
--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 89.8%;
--input: 0 0% 89.8%;
--ring: 0 0% 3.9%;
--chart-1: 12 76% 61%;
--chart-2: 173 58% 39%;
--chart-3: 197 37% 24%;
--chart-4: 43 74% 66%;
--chart-5: 27 87% 67%;
--radius: 0.5rem
}
.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;
--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;
--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;
--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;
--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;
--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;
--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;
--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;
--border: 0 0% 14.9%;
--input: 0 0% 14.9%;
--ring: 0 0% 83.1%;
--chart-1: 220 70% 50%;
--chart-2: 160 60% 45%;
--chart-3: 30 80% 55%;
--chart-4: 280 65% 60%;
--chart-5: 340 75% 55%
}
}
@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
@import "@repo/ui/globals.css";
63 changes: 4 additions & 59 deletions apps/frontend/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,5 @@
/** @type {import('tailwindcss').Config} */
import type { Config } from "tailwindcss";
import tailwindConfig from "@repo/ui/tailwind.config";
export default {
darkMode: ["class"],
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
borderRadius: {
lg: 'var(--radius)',
md: 'calc(var(--radius) - 2px)',
sm: 'calc(var(--radius) - 4px)'
},
colors: {
background: 'hsl(var(--background))',
foreground: 'hsl(var(--foreground))',
card: {
DEFAULT: 'hsl(var(--card))',
foreground: 'hsl(var(--card-foreground))'
},
popover: {
DEFAULT: 'hsl(var(--popover))',
foreground: 'hsl(var(--popover-foreground))'
},
primary: {
DEFAULT: 'hsl(var(--primary))',
foreground: 'hsl(var(--primary-foreground))'
},
secondary: {
DEFAULT: 'hsl(var(--secondary))',
foreground: 'hsl(var(--secondary-foreground))'
},
muted: {
DEFAULT: 'hsl(var(--muted))',
foreground: 'hsl(var(--muted-foreground))'
},
accent: {
DEFAULT: 'hsl(var(--accent))',
foreground: 'hsl(var(--accent-foreground))'
},
destructive: {
DEFAULT: 'hsl(var(--destructive))',
foreground: 'hsl(var(--destructive-foreground))'
},
border: 'hsl(var(--border))',
input: 'hsl(var(--input))',
ring: 'hsl(var(--ring))',
chart: {
'1': 'hsl(var(--chart-1))',
'2': 'hsl(var(--chart-2))',
'3': 'hsl(var(--chart-3))',
'4': 'hsl(var(--chart-4))',
'5': 'hsl(var(--chart-5))'
}
}
}
},
plugins: [require("tailwindcss-animate")],
}
...tailwindConfig,
} satisfies Config;
2 changes: 1 addition & 1 deletion packages/ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
extends: ["@repo/eslint-config/react-internal.js"],
parser: "@typescript-eslint/parser",
parserOptions: {
project: "./tsconfig.lint.json",
// project: "./tsconfig.lint.json",
tsconfigRootDir: __dirname,
},
rules: {
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"tailwindcss-animate": "^1.0.7"
},
"exports": {
"./globals.css": "./src/globals.css",
"./globals.css": "./src/global.css",
"./postcss.config": "./postcss.config.mjs",
"./tailwind.config": "./tailwind.config.ts",
"./lib/*": "./src/lib/*.ts",
Expand Down