commit 5421c2346a0a83c0296561f9527e2ebce685c92c Author: Mattrixwv Date: Fri Jul 18 23:30:48 2025 -0400 Most simple components created diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e4e2cbe --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Logs +logs +*.log + +node_modules +dist +*.local +.tanstack + +# Editor directories and files +.vscode diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b1bacc --- /dev/null +++ b/README.md @@ -0,0 +1,69 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: + +```js +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + + // Remove tseslint.configs.recommended and replace with this + ...tseslint.configs.recommendedTypeChecked, + // Alternatively, use this for stricter rules + ...tseslint.configs.strictTypeChecked, + // Optionally, add this for stylistic rules + ...tseslint.configs.stylisticTypeChecked, + + // Other configs... + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` + +You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: + +```js +// eslint.config.js +import reactX from 'eslint-plugin-react-x' +import reactDom from 'eslint-plugin-react-dom' + +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + // Other configs... + // Enable lint rules for React + reactX.configs['recommended-typescript'], + // Enable lint rules for React DOM + reactDom.configs.recommended, + ], + languageOptions: { + parserOptions: { + project: ['./tsconfig.node.json', './tsconfig.app.json'], + tsconfigRootDir: import.meta.dirname, + }, + // other options... + }, + }, +]) +``` diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..6f17939 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,37 @@ +import js from "@eslint/js"; +import pluginRouter from "@tanstack/eslint-plugin-router"; +import reactHooks from "eslint-plugin-react-hooks"; +import reactRefresh from "eslint-plugin-react-refresh"; +import { globalIgnores } from "eslint/config"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + + +export default tseslint.config([ + globalIgnores(['dist']), + { + files: ['**/*.{ts,tsx}'], + extends: [ + js.configs.recommended, + tseslint.configs.recommendedTypeChecked, + reactHooks.configs['recommended-latest'], + reactRefresh.configs.vite, + ...pluginRouter.configs["flat/recommended"] + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser + }, + plugins: { + "react-hooks": reactHooks, + "react-refresh": reactRefresh + }, + rules: { + ...reactHooks.configs.recommended.rules, + "react-refresh/only-export-components": [ + "warn", + { allowConstantExport: true } + ] + } + } +]); diff --git a/index.html b/index.html new file mode 100644 index 0000000..ef80c79 --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + + + + Vite + React + TS + + +
+ + + diff --git a/lib/component/button.ts b/lib/component/button.ts new file mode 100644 index 0000000..f94bd57 --- /dev/null +++ b/lib/component/button.ts @@ -0,0 +1,26 @@ +import Button from "./button/Button"; +import DangerButton from "./button/DangerButton"; +import DarkButton from "./button/DarkButton"; +import InfoButton from "./button/InfoButton"; +import LightButton from "./button/LightButton"; +import MoltenButton from "./button/MoltenButton"; +import PrimaryButton from "./button/PrimaryButton"; +import SecondaryButton from "./button/SecondaryButton"; +import SuccessButton from "./button/SuccessButton"; +import TertiaryButton from "./button/TertiaryButton"; +import WarningButton from "./button/WarningButton"; + + +export { + Button, + DangerButton, + DarkButton, + InfoButton, + LightButton, + MoltenButton, + PrimaryButton, + SecondaryButton, + SuccessButton, + TertiaryButton, + WarningButton +}; diff --git a/lib/component/button/Button.tsx b/lib/component/button/Button.tsx new file mode 100644 index 0000000..eba83f0 --- /dev/null +++ b/lib/component/button/Button.tsx @@ -0,0 +1,57 @@ +import type { ButtonProps } from "$/types/Button"; +import clsx from "clsx"; + + +export default function Button(props: ButtonProps){ + const { + className, + rounding = "lg", + shape = "rectangle", + size = "md", + variant = "standard", + disabled, + ...buttonProps + } = props; + + + return ( +