Skip to content

Commit

Permalink
Setup the project
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdanTsymbal committed Oct 21, 2023
1 parent f047682 commit 720fc3d
Show file tree
Hide file tree
Showing 83 changed files with 16,027 additions and 202 deletions.
84 changes: 84 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:storybook/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "prettier"],
"ignorePatterns": [".husky/**", "out/**", "build/**"],
"rules": {
"@typescript-eslint/no-explicit-any": "warn",
"react/jsx-filename-extension": [
1,
{
"extensions": [".ts", ".tsx", ".jsx"]
}
],
"import/extensions": "off",
"react/prop-types": "off",
"jsx-a11y/anchor-is-valid": "off",
"react/jsx-props-no-spreading": [
"error",
{
"custom": "ignore"
}
],
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
"react/no-unescaped-entities": "off",
"import/no-cycle": [
0,
{
"ignoreExternal": true
}
],
"prefer-const": "off",
"no-use-before-define": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-useless-escape": "off",
"no-underscore-dangle": "off",
"react/require-default-props": "off",
"react-hooks/exhaustive-deps": "off",
"class-methods-use-this": "off",
"no-shadow": "off",
"import/prefer-default-export": "off",
"camelcase": "off",
"@typescript-eslint/no-var-requires": "off",
"global-require": "off",
"radix": "off",
"arrow-body-style": "off",
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off"
},
"settings": {
"import/resolver": {
"babel-module": {
"extensions": [".js", ".jsx", ".ts", ".tsx"]
},
"node": {
"extensions": [".js", ".jsx", ".ts", ".tsx"],
"paths": ["src"]
}
}
}
}
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": false,
"printWidth": 120,
"tabWidth": 2
}
19 changes: 19 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = {
"stories": [
"../src/**/*.stories.mdx",
"../src/**/*.stories.@(js|jsx|ts|tsx)"
],

"addons": [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/preset-create-react-app",
"storybook-addon-react-router-v6"
],

"framework": {
name: "@storybook/react-webpack5",
options: {}
}
}
51 changes: 51 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { useMemo } from "react";
import { CssBaseline, ThemeProvider, createTheme } from "@mui/material";

import { getTheme } from "../src/lib/theme/theme";
import { mutateFontSizeResponsiveness } from "../src/lib/theme/responsiveTypography";

export const globalTypes = {
theme: {
name: "Theme",
title: "Theme",
description: "Theme for your components",
defaultValue: "light",
toolbar: {
icon: "paintbrush",
dynamicTitle: true,
items: [
{ value: "light", left: "☀️", title: "Light mode" },
{ value: "dark", left: "🌙", title: "Dark mode" },
],
},
},
};

export const withMuiTheme = (Story, context) => {
const { theme: themeKey } = context.globals;

const theme = useMemo(() => {
let theme = createTheme(getTheme(themeKey)) || createTheme(getTheme("light"));
theme = mutateFontSizeResponsiveness(theme);
return theme;
}, [themeKey]);

return (
<ThemeProvider theme={theme}>
<CssBaseline />
<Story />
</ThemeProvider>
);
};

export const decorators = [withMuiTheme];

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
};
201 changes: 0 additions & 201 deletions LICENSE

This file was deleted.

Loading

0 comments on commit 720fc3d

Please sign in to comment.