Skip to content

Commit

Permalink
Merge pull request #10 from martinc1991/feature/config-daisy-ui
Browse files Browse the repository at this point in the history
Feature/config daisy UI
  • Loading branch information
chescalante authored May 31, 2024
2 parents 062322e + d9ddd6e commit 94883a8
Show file tree
Hide file tree
Showing 9 changed files with 703 additions and 47 deletions.
698 changes: 662 additions & 36 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions packages/ui/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
Expand Down
4 changes: 4 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"@types/react": "18.2.66",
"@types/react-dom": "18.2.22",
"@vitejs/plugin-react-swc": "3.5.0",
"autoprefixer": "^10.4.19",
"daisyui": "^4.11.1",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "5.2.2",
"vite": "5.2.0",
"vite-tsconfig-paths": "^4.3.2"
Expand Down
6 changes: 6 additions & 0 deletions packages/ui/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
};
15 changes: 6 additions & 9 deletions packages/ui/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import reactLogo from "@/assets/react.svg";
import { Button } from "@/components";
import { useState } from "react";
import reactLogo from "./assets/react.svg";
import viteLogo from "/vite.svg";
import "./App.css";
import viteLogo from "/vite.svg";

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

return (
<>
<div>
<div className="flex flex-col items-center">
<a href="https://vitejs.dev" target="_blank" rel="noreferrer">
<img src={viteLogo} className="logo" alt="Vite logo" />
</a>
Expand All @@ -18,16 +19,12 @@ function App() {
</div>
<h1>Vite + React</h1>
<div className="card">
<button onClick={() => setCount((count) => count + 1)}>
count is {count}
</button>
<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>
<p className="read-the-docs">Click on the Vite and React logos to learn more</p>
</>
);
}
Expand Down
5 changes: 5 additions & 0 deletions packages/ui/src/components/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {}

export function Button(props: ButtonProps) {
return <button className="btn" {...props} />;
}
1 change: 1 addition & 0 deletions packages/ui/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./button";
4 changes: 4 additions & 0 deletions packages/ui/src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
line-height: 1.5;
Expand Down
13 changes: 13 additions & 0 deletions packages/ui/tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Config } from "tailwindcss";
import daisyui from "daisyui";

export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [daisyui],
daisyui: {
themes: ["dark"],
},
} satisfies Config;

0 comments on commit 94883a8

Please sign in to comment.