@asaleh37/ui-base 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,29 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
9
+ {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
+ files: ['**/*.{ts,tsx}'],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ "@typescript-eslint/no-explicit-any": "off",
23
+ 'react-refresh/only-export-components': [
24
+ 'warn',
25
+ { allowConstantExport: true },
26
+ ],
27
+ },
28
+ },
29
+ )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -9,7 +9,8 @@
9
9
  "module": "dist/index.mjs",
10
10
  "types": "dist/index.d.ts",
11
11
  "scripts": {
12
- "build": "rollup -c --bundleConfigAsCjs"
12
+ "build": "rollup -c --bundleConfigAsCjs",
13
+ "dev": "vite"
13
14
  },
14
15
  "devDependencies": {
15
16
  "@rollup/plugin-commonjs": "^28.0.3",
@@ -21,10 +22,54 @@
21
22
  "rollup-plugin-dts": "^6.2.1",
22
23
  "rollup-plugin-peer-deps-external": "^2.2.4",
23
24
  "tslib": "^2.8.1",
24
- "typescript": "^5.8.3"
25
+ "@eslint/js": "^9.19.0",
26
+ "@types/react-dom": "^19.0.3",
27
+ "@types/react-i18next": "^7.8.3",
28
+ "@vitejs/plugin-react": "^4.3.4",
29
+ "eslint": "^9.19.0",
30
+ "eslint-plugin-react-hooks": "^5.0.0",
31
+ "eslint-plugin-react-refresh": "^0.4.18",
32
+ "globals": "^15.14.0",
33
+ "typescript": "~5.7.2",
34
+ "typescript-eslint": "^8.22.0",
35
+ "vite": "^6.1.0"
25
36
  },
26
37
  "dependencies": {
27
38
  "rollup": "^4.41.1",
28
- "rollup-plugin-postcss": "^4.0.2"
39
+ "rollup-plugin-postcss": "^4.0.2",
40
+ "@emotion/cache": "^11.14.0",
41
+ "@emotion/react": "^11.14.0",
42
+ "@emotion/styled": "^11.14.0",
43
+ "@fortawesome/fontawesome-svg-core": "^6.7.2",
44
+ "@fortawesome/free-brands-svg-icons": "^6.7.2",
45
+ "@fortawesome/free-regular-svg-icons": "^6.7.2",
46
+ "@fortawesome/free-solid-svg-icons": "^6.7.2",
47
+ "@fortawesome/react-fontawesome": "^0.2.2",
48
+ "@hookform/resolvers": "^4.1.0",
49
+ "@mui/icons-material": "^6.4.8",
50
+ "@mui/material": "^6.4.4",
51
+ "@mui/x-charts": "^7.27.0",
52
+ "@mui/x-data-grid-premium": "^8.3.0",
53
+ "@mui/x-date-pickers": "^7.27.0",
54
+ "@mui/x-license": "^8.3.0",
55
+ "@mui/x-tree-view": "^7.26.0",
56
+ "@react-spring/web": "^9.7.5",
57
+ "@reduxjs/toolkit": "^2.5.1",
58
+ "axios": "^1.8.1",
59
+ "i18next": "^24.2.2",
60
+ "i18next-browser-languagedetector": "^8.0.3",
61
+ "i18next-http-backend": "^3.0.2",
62
+ "moment": "^2.30.1",
63
+ "oidc-client-ts": "^3.1.0",
64
+ "react": "^19.0.0",
65
+ "react-dom": "^19.0.0",
66
+ "react-hook-form": "^7.54.2",
67
+ "react-i18next": "^15.4.0",
68
+ "react-redux": "^9.2.0",
69
+ "react-router-dom": "^7.1.5",
70
+ "react-toastify": "^11.0.5",
71
+ "stylis": "^4.3.6",
72
+ "stylis-plugin-rtl": "^2.1.1",
73
+ "zod": "^3.24.2"
29
74
  }
30
75
  }
@@ -0,0 +1,28 @@
1
+ import { Provider } from "react-redux";
2
+ import { store } from "../redux/store";
3
+ import { Counter } from "./Counter";
4
+ import { library } from "@fortawesome/fontawesome-svg-core";
5
+ import { fab } from "@fortawesome/free-brands-svg-icons";
6
+ import { far } from "@fortawesome/free-regular-svg-icons";
7
+ import { fas } from "@fortawesome/free-solid-svg-icons";
8
+ import { LicenseInfo } from "@mui/x-license";
9
+
10
+ LicenseInfo.setLicenseKey(
11
+ "c2bd611fa642666253500ab9c8e4f78fTz0xMTE4MjEsRT0xNzc2OTg4Nzk5MDAwLFM9cHJlbWl1bSxMTT1zdWJzY3JpcHRpb24sUFY9aW5pdGlhbCxLVj0y"
12
+ );
13
+ import "react-toastify/dist/ReactToastify.css";
14
+
15
+ library.add(fab);
16
+ library.add(far);
17
+ library.add(fas);
18
+
19
+ export type BaseAppProps = {};
20
+
21
+ export const BaseApp: React.FC<BaseAppProps> = (props) => {
22
+ return (
23
+ <Provider store={store}>
24
+ <div>Base App</div>
25
+ <Counter />
26
+ </Provider>
27
+ );
28
+ };
@@ -0,0 +1,32 @@
1
+ import { useDispatch, useSelector } from "react-redux";
2
+ import { RootState } from "../redux/store";
3
+ import { Button } from "@mui/material";
4
+ import { CounterActions } from "../redux/CounterSlice";
5
+
6
+ export const Counter: React.FC = () => {
7
+ const counter = useSelector((state: RootState) => state.counter.value);
8
+ const dispatch = useDispatch();
9
+ return (
10
+ <>
11
+ <div>Counter : {counter}</div>
12
+ <Button
13
+ variant="contained"
14
+ color="success"
15
+ onClick={() => {
16
+ dispatch(CounterActions.increament());
17
+ }}
18
+ >
19
+ increment
20
+ </Button>
21
+ <Button
22
+ variant="contained"
23
+ color="error"
24
+ onClick={() => {
25
+ dispatch(CounterActions.decreament());
26
+ }}
27
+ >
28
+ decrement
29
+ </Button>
30
+ </>
31
+ );
32
+ };
@@ -1,2 +1 @@
1
- export * from "./Comp1/Comp1";
2
- export * from "./Comp2/Comp2";
1
+ export * from "./BaseApp";
@@ -0,0 +1,17 @@
1
+ import { createSlice } from "@reduxjs/toolkit";
2
+
3
+ const CounterSlice = createSlice({
4
+ name: "counter",
5
+ initialState: { value: 0 },
6
+ reducers: {
7
+ increament: (state) => {
8
+ state.value = state.value + 1;
9
+ },
10
+ decreament: (state) => {
11
+ state.value = state.value - 1;
12
+ },
13
+ },
14
+ });
15
+
16
+ export const CounterActions = CounterSlice.actions;
17
+ export default CounterSlice.reducer;
@@ -0,0 +1,20 @@
1
+ import { configureStore } from "@reduxjs/toolkit";
2
+ import CounterReducer from "./CounterSlice";
3
+ // import AppLayoutReducer from "./features/common/AppLayoutSlice";
4
+ // import UserSessionReducer from "./features/common/UserSessionSlice";
5
+ // import LoadingMaskReducer from "./features/common/LoadingMaskSlice";
6
+ // import CommonStoreReducer from "./features/business/CommonStoreSlice";
7
+
8
+ export const store = configureStore({
9
+ reducer: {
10
+ // AppLayout: AppLayoutReducer,
11
+ // UserSession: UserSessionReducer,
12
+ // loadingMask: LoadingMaskReducer,
13
+ // commonStores: CommonStoreReducer,
14
+ counter: CounterReducer,
15
+ },
16
+ });
17
+
18
+ // Infer the `RootState` and `AppDispatch` types from the store itself
19
+ export type RootState = ReturnType<typeof store.getState>;
20
+ export type AppDispatch = typeof store.dispatch;
@@ -1,3 +0,0 @@
1
- export const Comp1: React.FC<string> = (name) => {
2
- return <div>Comp1 :{name}</div>;
3
- };
@@ -1,3 +0,0 @@
1
- export const Comp2: React.FC<string> = (name) => {
2
- return <div>Comp2 :{name}</div>;
3
- };