jgest-react-vite 1.1.2

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.
Files changed (32) hide show
  1. package/README.md +116 -0
  2. package/index.js +21 -0
  3. package/package.json +17 -0
  4. package/template/.env +1 -0
  5. package/template/README.md +116 -0
  6. package/template/eslint.config.js +26 -0
  7. package/template/index.html +13 -0
  8. package/template/package.json +40 -0
  9. package/template/pnpm-lock.yaml +3339 -0
  10. package/template/public/vite.svg +1 -0
  11. package/template/src/App.tsx +30 -0
  12. package/template/src/Router.tsx +17 -0
  13. package/template/src/components/main/ThemeSwitch.tsx +80 -0
  14. package/template/src/components/shared/MyModal.tsx +51 -0
  15. package/template/src/components/shared/MyPopover.tsx +44 -0
  16. package/template/src/hooks/shared/useNotification.ts +25 -0
  17. package/template/src/hooks/shared/useSetTimezone.ts +20 -0
  18. package/template/src/index.css +9 -0
  19. package/template/src/layouts/MainLayout.tsx +23 -0
  20. package/template/src/main.tsx +10 -0
  21. package/template/src/modules/MainPage/MainPageContent.tsx +100 -0
  22. package/template/src/pages/MainPage/MainPage.tsx +12 -0
  23. package/template/src/providers/NotificationProvider/NotificationProvider.tsx +61 -0
  24. package/template/src/providers/NotificationProvider/context/NotificationContext.tsx +20 -0
  25. package/template/src/services/ApiService.ts +54 -0
  26. package/template/src/services/ToBeTested/ApiService-New.ts +94 -0
  27. package/template/src/store/ThemeStore/Themes/themes.ts +28 -0
  28. package/template/src/store/ThemeStore/themeStore.ts +28 -0
  29. package/template/tsconfig.app.json +28 -0
  30. package/template/tsconfig.json +7 -0
  31. package/template/tsconfig.node.json +26 -0
  32. package/template/vite.config.ts +18 -0
@@ -0,0 +1,28 @@
1
+ import { createTheme } from '@mui/material/styles';
2
+ import type { Theme } from '@mui/material/styles';
3
+
4
+ export const darkTheme: Theme = createTheme({
5
+ palette: {
6
+ mode: 'dark',
7
+ background: {
8
+ default: '#303030',
9
+ paper: '#424242',
10
+ },
11
+ },
12
+ });
13
+ export const lightTheme: Theme = createTheme({
14
+ palette: {
15
+ mode: 'light',
16
+ background: {
17
+ default: '#f5f5f5',
18
+ paper: '#ffffff',
19
+ },
20
+ },
21
+ });
22
+
23
+ export const themes = {
24
+ light: lightTheme,
25
+ dark: darkTheme,
26
+ };
27
+
28
+ export type ThemeMode = keyof typeof themes;
@@ -0,0 +1,28 @@
1
+ import { create } from 'zustand';
2
+ import { persist } from 'zustand/middleware';
3
+ import type { ThemeMode } from './Themes/themes';
4
+
5
+ // Interfaz para el estado del tema
6
+ interface ThemeState {
7
+ mode: ThemeMode;
8
+ toggleTheme: () => void;
9
+ setMode: (mode: ThemeMode) => void;
10
+ }
11
+
12
+ // Store de Zustand para gestionar el tema de la aplicación
13
+ export const themeStore = create<ThemeState>()(
14
+ persist(
15
+ (set) => ({
16
+ mode: 'light', // Modo por defecto
17
+ toggleTheme: () => {
18
+ set((state) => ({
19
+ mode: state.mode === 'light' ? 'dark' : 'light',
20
+ }));
21
+ },
22
+ setMode: (mode) => set({ mode }),
23
+ }),
24
+ {
25
+ name: 'theme-storage', // Nombre del almacenamiento en localStorage
26
+ },
27
+ ),
28
+ );
@@ -0,0 +1,28 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
4
+ "target": "ES2022",
5
+ "useDefineForClassFields": true,
6
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
7
+ "module": "ESNext",
8
+ "types": ["vite/client"],
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "react-jsx",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ "noUnusedLocals": true,
22
+ "noUnusedParameters": true,
23
+ "erasableSyntaxOnly": true,
24
+ "noFallthroughCasesInSwitch": true,
25
+ "noUncheckedSideEffectImports": true
26
+ },
27
+ "include": ["src"]
28
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ { "path": "./tsconfig.app.json" },
5
+ { "path": "./tsconfig.node.json" }
6
+ ]
7
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
4
+ "target": "ES2023",
5
+ "lib": ["ES2023"],
6
+ "module": "ESNext",
7
+ "types": ["node"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "verbatimModuleSyntax": true,
14
+ "moduleDetection": "force",
15
+ "noEmit": true,
16
+
17
+ /* Linting */
18
+ "strict": true,
19
+ "noUnusedLocals": true,
20
+ "noUnusedParameters": true,
21
+ "erasableSyntaxOnly": true,
22
+ "noFallthroughCasesInSwitch": true,
23
+ "noUncheckedSideEffectImports": true
24
+ },
25
+ "include": ["vite.config.ts"]
26
+ }
@@ -0,0 +1,18 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react-swc'
3
+ import tailwindcss from '@tailwindcss/vite'
4
+
5
+ // https://vite.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), tailwindcss()],
8
+ server: {
9
+ proxy: {
10
+ '/newApi': {
11
+ target: 'https://192.168.150.92:8003',
12
+ changeOrigin: true, // Cambiar el origen del host de la solicitud
13
+ secure: false, // Ignorar el error de certificado (autofirmado)
14
+ rewrite: (path) => path.replace(/^\/newApi/, '/api')
15
+ },
16
+ },
17
+ },
18
+ })