ptechcore_ui 0.0.0

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 (57) hide show
  1. package/eslint.config.js +28 -0
  2. package/index.html +78 -0
  3. package/package.json +42 -0
  4. package/postcss.config.js +6 -0
  5. package/src/App.tsx +156 -0
  6. package/src/assets/imgs/login_illustration.png +0 -0
  7. package/src/components/common/Buttons.tsx +39 -0
  8. package/src/components/common/Cards.tsx +18 -0
  9. package/src/components/common/FDrawer.tsx +2448 -0
  10. package/src/components/common/FDrawer.types.ts +191 -0
  11. package/src/components/common/Inputs.tsx +409 -0
  12. package/src/components/common/Modals.tsx +41 -0
  13. package/src/components/common/Navigations.tsx +0 -0
  14. package/src/components/common/Toast.tsx +0 -0
  15. package/src/components/demo/ToastDemo.tsx +73 -0
  16. package/src/components/layout/Header.tsx +202 -0
  17. package/src/components/layout/ModernDoubleSidebarLayout.tsx +727 -0
  18. package/src/components/layout/PrivateLayout.tsx +52 -0
  19. package/src/components/layout/Sidebar.tsx +182 -0
  20. package/src/components/ui/Toast.tsx +93 -0
  21. package/src/contexts/SessionContext.tsx +77 -0
  22. package/src/contexts/ThemeContext.tsx +58 -0
  23. package/src/contexts/ToastContext.tsx +94 -0
  24. package/src/index.css +3 -0
  25. package/src/main.tsx +10 -0
  26. package/src/models/Organization.ts +47 -0
  27. package/src/models/Plan.ts +42 -0
  28. package/src/models/User.ts +23 -0
  29. package/src/pages/Analytics.tsx +101 -0
  30. package/src/pages/CreateOrganization.tsx +215 -0
  31. package/src/pages/Dashboard.tsx +15 -0
  32. package/src/pages/Home.tsx +12 -0
  33. package/src/pages/Profile.tsx +313 -0
  34. package/src/pages/Settings.tsx +382 -0
  35. package/src/pages/Team.tsx +180 -0
  36. package/src/pages/auth/Login.tsx +140 -0
  37. package/src/pages/auth/Register.tsx +302 -0
  38. package/src/pages/organizations/DetailEntity.tsx +1002 -0
  39. package/src/pages/organizations/DetailOrganizations.tsx +1629 -0
  40. package/src/pages/organizations/ListOrganizations.tsx +270 -0
  41. package/src/pages/pricings/CartPlan.tsx +486 -0
  42. package/src/pages/pricings/ListPricing.tsx +321 -0
  43. package/src/pages/users/CreateUser.tsx +450 -0
  44. package/src/pages/users/ListUsers.tsx +0 -0
  45. package/src/services/AuthServices.ts +94 -0
  46. package/src/services/OrganizationServices.ts +61 -0
  47. package/src/services/PlanSubscriptionServices.tsx +137 -0
  48. package/src/services/UserServices.ts +36 -0
  49. package/src/services/api.ts +64 -0
  50. package/src/styles/theme.ts +383 -0
  51. package/src/utils/utils.ts +48 -0
  52. package/src/vite-env.d.ts +1 -0
  53. package/tailwind.config.js +158 -0
  54. package/tsconfig.app.json +24 -0
  55. package/tsconfig.json +7 -0
  56. package/tsconfig.node.json +22 -0
  57. package/vite.config.ts +10 -0
@@ -0,0 +1,28 @@
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
+ 'react-refresh/only-export-components': [
23
+ 'warn',
24
+ { allowConstantExport: true },
25
+ ],
26
+ },
27
+ }
28
+ );
package/index.html ADDED
@@ -0,0 +1,78 @@
1
+ <!doctype html>
2
+ <html lang="fr">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>PanneauPro - Location de Panneaux Publicitaires</title>
8
+ <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" />
9
+ <link rel="preconnect" href="https://fonts.googleapis.com">
10
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
11
+ <link href="https://fonts.googleapis.com/css2?family=Sometype+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
12
+ <style>
13
+ * {
14
+ margin: 0;
15
+ padding: 0;
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ body {
20
+ font-family: 'Sometype Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
21
+ -webkit-font-smoothing: antialiased;
22
+ -moz-osx-font-smoothing: grayscale;
23
+ background-color: #FFFFFF;
24
+ color: #353A3B;
25
+ }
26
+
27
+ #root {
28
+ min-height: 100vh;
29
+ }
30
+
31
+ /* Loading initial - Trinity Colors */
32
+ .app-loading {
33
+ display: flex;
34
+ align-items: center;
35
+ justify-content: center;
36
+ min-height: 100vh;
37
+ background: linear-gradient(135deg, #7A8B8E 0%, #353A3B 100%);
38
+ }
39
+
40
+ .loading-content {
41
+ text-align: center;
42
+ color: white;
43
+ }
44
+
45
+ .loading-spinner {
46
+ width: 48px;
47
+ height: 48px;
48
+ border: 4px solid rgba(255, 255, 255, 0.3);
49
+ border-top: 4px solid #ffffff;
50
+ border-radius: 50%;
51
+ animation: spin 1s linear infinite;
52
+ margin: 0 auto 16px;
53
+ }
54
+
55
+ @keyframes spin {
56
+ 0% { transform: rotate(0deg); }
57
+ 100% { transform: rotate(360deg); }
58
+ }
59
+
60
+ .loading-text {
61
+ font-size: 18px;
62
+ font-weight: 600;
63
+ margin-bottom: 8px;
64
+ }
65
+
66
+ .loading-subtext {
67
+ font-size: 14px;
68
+ opacity: 0.9;
69
+ }
70
+ </style>
71
+
72
+
73
+ </head>
74
+ <body>
75
+ <div id="root"></div>
76
+ <script type="module" src="/src/main.tsx"></script>
77
+ </body>
78
+ </html>
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "ptechcore_ui",
3
+ "private": false,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "lint": "eslint .",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "clsx": "^2.1.1",
14
+ "date-fns": "^2.30.0",
15
+ "leaflet": "^1.9.4",
16
+ "lucide-react": "^0.344.0",
17
+ "react": "^18.3.1",
18
+ "react-dom": "^18.3.1",
19
+ "react-hook-form": "^7.48.2",
20
+ "react-leaflet": "^4.2.1",
21
+ "react-router-dom": "^6.26.0",
22
+ "tailwind-merge": "^3.3.1",
23
+ "tailwindcss-animate": "^1.0.7"
24
+ },
25
+ "devDependencies": {
26
+ "@eslint/js": "^9.9.1",
27
+ "@types/leaflet": "^1.9.8",
28
+ "@types/react": "^18.3.5",
29
+ "@types/react-dom": "^18.3.0",
30
+ "@vitejs/plugin-react": "^4.3.1",
31
+ "autoprefixer": "^10.4.18",
32
+ "eslint": "^9.9.1",
33
+ "eslint-plugin-react-hooks": "^5.1.0-rc.0",
34
+ "eslint-plugin-react-refresh": "^0.4.11",
35
+ "globals": "^15.9.0",
36
+ "postcss": "^8.4.35",
37
+ "tailwindcss": "^3.4.1",
38
+ "typescript": "^5.5.3",
39
+ "typescript-eslint": "^8.3.0",
40
+ "vite": "^5.4.2"
41
+ }
42
+ }
@@ -0,0 +1,6 @@
1
+ export default {
2
+ plugins: {
3
+ tailwindcss: {},
4
+ autoprefixer: {},
5
+ },
6
+ };
package/src/App.tsx ADDED
@@ -0,0 +1,156 @@
1
+ import React from 'react';
2
+ import { BrowserRouter as Router, Routes, Route, BrowserRouter } from 'react-router-dom';
3
+ import { ToastProvider } from './contexts/ToastContext';
4
+ import ToastContainer from './components/ui/Toast';
5
+ // import RewiseLayout from './components/layout/RewiseLayout';
6
+ import Home from './pages/Home';
7
+ import Login from './pages/auth/Login';
8
+ import Register from './pages/auth/Register';
9
+ import { SessionProvider } from './contexts/SessionContext';
10
+ import Dashboard from './pages/Dashboard';
11
+ import Analytics from './pages/Analytics';
12
+ import Team from './pages/Team';
13
+ import Profile from './pages/Profile';
14
+ import Settings from './pages/Settings';
15
+ import CreateOrganization from './pages/CreateOrganization';
16
+ import ListOrganizations from './pages/organizations/ListOrganizations';
17
+ import DetailOrganizations from './pages/organizations/DetailOrganizations';
18
+ import DetailEntity from './pages/organizations/DetailEntity';
19
+ import CartPlan from './pages/pricings/CartPlan';
20
+ import { ThemeProvider } from './contexts/ThemeContext';
21
+ import RewiseLayout, { MenuItem } from './components/layout/ModernDoubleSidebarLayout';
22
+ import {
23
+ LayoutDashboard, FileText, Users, CreditCard, TrendingUp,
24
+ ChevronLeft, ChevronRight, Search, Bell, User,
25
+ LogOut, Menu, X, Moon, Sun, Palette, Building2,
26
+ Calculator, PiggyBank, FileBarChart, Shield, Package,
27
+ DollarSign, BarChart3, Briefcase, Receipt, UserCheck,
28
+ Database, Globe, HelpCircle, Activity, Lock, AlertTriangle,
29
+ CheckCircle, Clock, FileCheck, Bot, ScanLine,
30
+ MessageSquare, Smartphone, Workflow, RefreshCw, Wifi,
31
+ Eye, Target, BookOpen, Archive, Download,
32
+ Upload, Save, FolderOpen, ChevronDown, Link, PieChart,
33
+ Video, Calendar, Folder
34
+ } from 'lucide-react';
35
+
36
+ function App() {
37
+ return (
38
+ <ThemeProvider>
39
+ <SessionProvider>
40
+ <ToastProvider>
41
+ <BrowserRouter>
42
+ <Routes>
43
+ <Route path='/*' element={<PrivateRoutes />} />
44
+ <Route path="" element={<Home />} />
45
+ <Route path="auth/*" element={<AuthRoutes />} />
46
+ </Routes>
47
+ <ToastContainer />
48
+ </BrowserRouter>
49
+ </ToastProvider>
50
+ </SessionProvider>
51
+ </ThemeProvider>
52
+ );
53
+ }
54
+
55
+ export default App;
56
+
57
+
58
+
59
+ const PrivateRoutes = () => {
60
+
61
+ // Modules principaux restructurés selon les standards ERP
62
+ const primaryMenuItems: MenuItem[] = [
63
+ {
64
+ id: 'dashboard',
65
+ label: 'Tableau de Bord',
66
+ icon: <LayoutDashboard className="w-5 h-5" />,
67
+ path: '/dashboard',
68
+ ariaLabel: 'Accéder au tableau de bord principal'
69
+ },
70
+ {
71
+ id: 'organizations',
72
+ label: 'Organisations',
73
+ icon: <Calculator className="w-5 h-5" />,
74
+ badge: '3',
75
+ ariaLabel: 'Accéder aux organisations'
76
+ },
77
+ {
78
+ id: 'entities',
79
+ label: 'Entités',
80
+ icon: <Calculator className="w-5 h-5" />,
81
+ badge: '3',
82
+ ariaLabel: 'Accéder aux entités'
83
+ },
84
+
85
+ ];
86
+
87
+ // Sous-menus restructurés et enrichis
88
+ const secondaryMenuItems: Record<string, MenuItem[]> = {
89
+ dashboard: [
90
+ { id: 'global-view', label: 'Vue Globale', path: '/dashboard', icon: <Eye className="w-4 h-4" /> },
91
+ { id: 'executive-view', label: 'Vue Executive', path: '/executive', icon: <TrendingUp className="w-4 h-4" /> },
92
+ { id: 'kpis', label: 'KPIs Temps Réel', path: '/dashboard/kpis', icon: <Activity className="w-4 h-4" /> },
93
+ { id: 'alerts', label: 'Alertes', path: '/dashboard/alerts', icon: <AlertTriangle className="w-4 h-4" />, badge: '5' },
94
+ { id: 'ai-insights', label: 'IA Insights', path: '/dashboard/ai-insights', icon: <Bot className="w-4 h-4" /> },
95
+ { id: 'workflows', label: 'Workflows', path: '/dashboard/workflows', icon: <Workflow className="w-4 h-4" /> }
96
+ ],
97
+ organizations: [
98
+ { id: 'new_organizations', label: 'Nouvelles Organisations', path: '/organizations/new', icon: <FileText className="w-4 h-4" />, badge: '3' },
99
+ { id: 'list_organizations', label: 'Liste des Organisations', path: '/organizations/', icon: <BookOpen className="w-4 h-4" /> },
100
+
101
+ ],
102
+ entities: [
103
+ { id: 'crm-clients', label: 'Clients', path: '/tiers/clients', icon: <UserCheck className="w-4 h-4" /> },
104
+ { id: 'suppliers', label: 'Fournisseurs', path: '/tiers/fournisseurs', icon: <Briefcase className="w-4 h-4" /> },
105
+ { id: 'recouvrement', label: 'Recouvrement', path: '/tiers/recouvrement', icon: <Receipt className="w-4 h-4" /> },
106
+ { id: 'global-lettrage', label: 'Lettrage Global', path: '/tiers/lettrage', icon: <RefreshCw className="w-4 h-4" /> },
107
+ { id: 'contacts', label: 'Contacts', path: '/tiers/contacts', icon: <Users className="w-4 h-4" /> }
108
+ ],
109
+
110
+ };
111
+
112
+
113
+
114
+
115
+ return (
116
+ <RewiseLayout module_name='Rewise' primaryMenuItems={primaryMenuItems} secondaryMenuItems={secondaryMenuItems} >
117
+ {/* <Route element={<ModernDoubleSidebarLayout />} > */}
118
+ <Routes>
119
+ <Route path='dashboard' element={<Dashboard />} />
120
+ <Route path='analytics' element={<Analytics />} />
121
+ <Route path='team' element={<Team />} />
122
+ <Route path='profile' element={<Profile />} />
123
+ <Route path='settings' element={<Settings />} />
124
+
125
+ <Route path='organizations/new' element={<CreateOrganization />} />
126
+ <Route path='organizations/:id' element={<DetailOrganizations />} />
127
+ <Route path='organizations' element={<ListOrganizations />} />
128
+
129
+
130
+ <Route path='entities/:id' element={<DetailEntity />} />
131
+ <Route path='pricing/cart' element={<CartPlan />} />
132
+
133
+ <Route path='calendar' element={<div><h1 className="text-2xl font-bold">Calendrier</h1><p>Planning et événements</p></div>} />
134
+ <Route path='reports' element={<div><h1 className="text-2xl font-bold">Rapports</h1><p>Rapports et statistiques</p></div>} />
135
+ <Route path='help' element={<div><h1 className="text-2xl font-bold">Aide</h1><p>Documentation et support</p></div>} />
136
+
137
+ </Routes>
138
+
139
+ </RewiseLayout>
140
+ );
141
+ }
142
+
143
+
144
+ const AuthRoutes = () => {
145
+
146
+ return <Routes>
147
+
148
+ <Route path='login' element={<Login />} />
149
+ <Route path='register' element={<Register />} />
150
+
151
+
152
+ {/* <Route path='send-mail' element={<SendMail />} />
153
+ <Route path='change-password/:token' element={<ChangePassword />} /> */}
154
+
155
+ </Routes>;
156
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+
3
+ interface PrimaryButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
4
+ loading?: boolean;
5
+ children?: React.ReactNode;
6
+ classname?: string;
7
+ }
8
+
9
+ const PrimaryButton: React.FC<PrimaryButtonProps> = ({
10
+ loading = false,
11
+ children,
12
+ classname = '',
13
+ ...props
14
+ }) => (
15
+ <button
16
+ type="submit"
17
+ disabled={loading || props.disabled}
18
+ className={`px-4 py-2 text-sm bg-[#6A8A82] text-white rounded-lg hover:bg-[#5A7A72] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname}`}
19
+ {...props}
20
+ >
21
+ {loading ? "Connexion en cours..." : children}
22
+ </button>
23
+ );
24
+ export const SecondaryButton: React.FC<PrimaryButtonProps> = ({
25
+ loading = false,
26
+ children,
27
+ ...props
28
+ }) => (
29
+ <button
30
+ type="button"
31
+ disabled={loading || props.disabled}
32
+ className="px-4 py-2 bg-[#B87333] text-white rounded-lg hover:bg-[#A66B2A] transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center"
33
+ {...props}
34
+ >
35
+ {loading ? "Connexion en cours..." : children}
36
+ </button>
37
+ );
38
+
39
+ export default PrimaryButton;
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ import { Building2, Mail, Phone, MapPin, Calendar, UserIcon } from "lucide-react";
3
+
4
+
5
+
6
+ export const RewiseBasicCard: React.FC<{ title: React.ReactNode, children?: React.ReactNode }> = ({ title ,children }) => (
7
+ <div className="bg-white rounded-lg ">
8
+ <div className="px-6 py-2 border-b border-gray-200">
9
+ <div className="flex items-center space-x-4">
10
+ {title}
11
+ </div>
12
+ </div>
13
+
14
+ <div className="p-3">
15
+ { children }
16
+ </div>
17
+ </div>
18
+ );