diff --git a/postcss.config.mjs b/postcss.config.mjs
index c7bcb4b..95d885e 100644
--- a/postcss.config.mjs
+++ b/postcss.config.mjs
@@ -1,5 +1,6 @@
const config = {
- plugins: ["@tailwindcss/postcss"],
+ plugins: {
+ '@tailwindcss/postcss': {},
+ },
};
-
export default config;
diff --git a/src/app/globals.css b/src/app/globals.css
index c766180..bc2f3c8 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -1,4 +1,5 @@
@import "tailwindcss";
+@import "tailwindcss/utilities";
@font-face {
font-family: 'Manrope';
@@ -56,3 +57,42 @@
font-family: 'Manrope';
}
+
+:root {
+ --primary: #6366F1;
+ --secondary: #A78BFA;
+ --textColorLight: #FFFFFF;
+ --textColorGray: #222222;
+ --bgPrimary: #FFFFFF;
+ --gray-100: #EBEBEB;
+ --gray-200: #F5F5F5;
+ --gray-300: #81848A;
+ --gray-400: #777;
+ --gray-500: #222;
+
+ .dark{
+ --primary: #FA003F;
+ --secondary: #7C3AED;
+ --textColorLight: #FA003F;
+ --textColorGray: #FA003F;
+ --bgPrimary: #FA003F;
+ --gray-100: #EBEBEB;
+ --gray-200: #F5F5F5;
+ --gray-300: #81848A;
+ --gray-400: #777;
+ --gray-500: #222;
+ }
+}
+
+@theme inline {
+ --color-primary: var(--primary-default);
+ --color-secondary: var(--secondary-default);
+ --color-text-light: var(--textColorLight-default);
+ --color-text-gray: var(--textColorGray-default);
+ --color-bg-primary: var(--bgPrimary-default);
+ --color-gray-100: var(--gray-100);
+ --color-gray-200: var(--gray-200);
+ --color-gray-300: var(--gray-300);
+ --color-gray-400: var(--gray-400);
+ --color-gray-500: var(--gray-500);
+}
diff --git a/src/app/layout.tsx b/src/app/layout.tsx
index 2da1ae7..13ac0b0 100644
--- a/src/app/layout.tsx
+++ b/src/app/layout.tsx
@@ -3,8 +3,8 @@ import "./globals.css";
export const metadata: Metadata = {
- title: "Create Next App",
- description: "Generated by create next app",
+ title: 'Create Next App',
+ description: 'Generated by create next app',
};
export default function RootLayout({
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 822393b..ffefd17 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,103 +1,55 @@
-import Image from "next/image";
+// ... existing imports ...
+import Button from '../components/Button'; // Adjust the import path if necessary
+
+async function getData() {
+ // Simulate a delay to show server-side data fetching
+ await new Promise((resolve) => setTimeout(resolve, 1000));
+ return { message: 'This data was fetched on the server!' };
+}
+
+export default async function Home() {
+ const data = await getData();
-export default function Home() {
return (
-
-
-
-
- -
- Get started by editing{" "}
-
- src/app/page.tsx
-
- .
-
- -
- Save and see your changes instantly.
-
-
+
+
-
-
-
- Deploy now
-
-
- Read our docs
-
+
+
+
+
+
+
+
+
+
Standard Buttons:
+
+
+
+
+
-
-
-
+
+
Sized Buttons:
+
+
+
+
+
+
+
Icon Buttons:
+
+
+
+
);
}
diff --git a/src/components/Button.tsx b/src/components/Button.tsx
new file mode 100644
index 0000000..70d262b
--- /dev/null
+++ b/src/components/Button.tsx
@@ -0,0 +1,78 @@
+import React, { ButtonHTMLAttributes, ReactNode } from 'react';
+
+interface ButtonProps extends ButtonHTMLAttributes {
+ children?: ReactNode; // Make children optional for icon-only buttons
+ loading?: boolean;
+ disabled?: boolean;
+ endIcon?: ReactNode;
+ size?: 'small' | 'medium' | 'large'; // Add size prop
+ iconOnly?: boolean; // Add iconOnly prop
+}
+
+const Button: React.FC = ({
+ children,
+ loading = false,
+ disabled = false,
+ endIcon,
+ size = 'medium', // Default size to medium
+ iconOnly = false, // Default iconOnly to false
+ className,
+ ...props
+}) => {
+ const baseStyles =
+ 'inline-flex items-center justify-center border border-transparent font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 ';
+ const enabledStyles =
+ 'text-white bg-primary-light hover:bg-indigo-700 active:bg-indigo-800 focus:ring-indigo-500';
+ const disabledStyles = 'text-gray-400 bg-gray-200 cursor-not-allowed';
+ const loadingStyles = 'text-gray-400 bg-gray-200 cursor-wait';
+
+ const sizeStyles = {
+ small: iconOnly ? 'p-2 text-sm' : 'px-3 py-1.5 text-sm',
+ medium: iconOnly ? 'p-2.5 text-base' : 'px-4 py-2 text-base',
+ large: iconOnly ? 'p-3 text-lg' : 'px-6 py-3 text-lg',
+ };
+
+ const currentStyles = disabled
+ ? disabledStyles
+ : loading
+ ? loadingStyles
+ : enabledStyles;
+
+ return (
+
+ {loading ? (
+
+ ) : null}
+ {children && !iconOnly ? children : null}
+ {endIcon && !loading && !iconOnly ? (
+ {endIcon}
+ ) : null}
+ {iconOnly && endIcon && !loading ? endIcon : null}
+
+ );
+};
+
+export default Button;
diff --git a/tailwind.config.ts b/tailwind.config.ts
new file mode 100644
index 0000000..ccdc167
--- /dev/null
+++ b/tailwind.config.ts
@@ -0,0 +1,68 @@
+import type { Config } from 'tailwindcss';
+
+const config: Config = {
+ darkMode: ['class', 'string'],
+ content: [
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}',
+ ],
+ theme: {
+ // Move your custom colors directly here to override default Tailwind colors
+ extend: {
+ colors: {
+ // Custom colors
+ primary: {
+ light: '#6366F1',
+ DEFAULT: '#6366F1',
+ dark: '#FA003F',
+ },
+ secondary: {
+ light: '#A78BFA',
+ DEFAULT: '#8B5CF6',
+ dark: '#7C3AED',
+ },
+ textColorLight: {
+ light: '#FFFFFF',
+ DEFAULT: '#FFFFFF',
+ dark: '#FA003F',
+ },
+ textColorGray: {
+ light: '#222222',
+ DEFAULT: '#222222',
+ dark: '#FA003F',
+ },
+ bgPrimary: {
+ light: '#FFFFFF',
+ DEFAULT: '#FFFFFF',
+ dark: '#FA003F',
+ },
+ gray: {
+ light: {
+ 100: '#EBEBEB',
+ 200: '#F5F5F5',
+ 300: '#81848A',
+ 400: '#777',
+ 500: '#222',
+ },
+ dark: {
+ 100: '#EBEBEB',
+ 200: '#F5F5F5',
+ 300: '#81848A',
+ 400: '#777',
+ 500: '#222',
+ },
+ },
+ },
+ backgroundImage: {
+ 'gradient-radial': 'radial-gradient(var(--tw-gradient-stops))',
+ 'gradient-conic':
+ 'conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))',
+ },
+ // Any other extensions go here
+ },
+ },
+ plugins: [],
+};
+
+export default config;
diff --git a/tsconfig.json b/tsconfig.json
index c133409..e3b03b6 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -22,6 +22,6 @@
"@/*": ["./src/*"]
}
},
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "tailwind.config.js"],
"exclude": ["node_modules"]
}