ptechcore_ui 1.0.1 → 1.0.3

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 (62) hide show
  1. package/dist/index.cjs +1396 -0
  2. package/dist/index.d.cts +62 -0
  3. package/dist/index.d.ts +62 -0
  4. package/dist/index.js +1366 -0
  5. package/package.json +14 -1
  6. package/eslint.config.js +0 -28
  7. package/index.html +0 -78
  8. package/postcss.config.js +0 -6
  9. package/src/App.tsx +0 -156
  10. package/src/assets/imgs/login_illustration.png +0 -0
  11. package/src/components/common/Buttons.tsx +0 -39
  12. package/src/components/common/Cards.tsx +0 -18
  13. package/src/components/common/FDrawer.tsx +0 -2448
  14. package/src/components/common/FDrawer.types.ts +0 -191
  15. package/src/components/common/Inputs.tsx +0 -409
  16. package/src/components/common/Modals.tsx +0 -41
  17. package/src/components/common/Navigations.tsx +0 -0
  18. package/src/components/common/Toast.tsx +0 -0
  19. package/src/components/demo/ToastDemo.tsx +0 -73
  20. package/src/components/layout/Header.tsx +0 -202
  21. package/src/components/layout/ModernDoubleSidebarLayout.tsx +0 -719
  22. package/src/components/layout/PrivateLayout.tsx +0 -52
  23. package/src/components/layout/Sidebar.tsx +0 -182
  24. package/src/components/ui/Toast.tsx +0 -93
  25. package/src/contexts/SessionContext.tsx +0 -77
  26. package/src/contexts/ThemeContext.tsx +0 -58
  27. package/src/contexts/ToastContext.tsx +0 -94
  28. package/src/index.css +0 -3
  29. package/src/index.ts +0 -10
  30. package/src/main.tsx +0 -10
  31. package/src/models/Organization.ts +0 -47
  32. package/src/models/Plan.ts +0 -42
  33. package/src/models/User.ts +0 -23
  34. package/src/pages/Analytics.tsx +0 -101
  35. package/src/pages/CreateOrganization.tsx +0 -215
  36. package/src/pages/Dashboard.tsx +0 -15
  37. package/src/pages/Home.tsx +0 -12
  38. package/src/pages/Profile.tsx +0 -313
  39. package/src/pages/Settings.tsx +0 -382
  40. package/src/pages/Team.tsx +0 -180
  41. package/src/pages/auth/Login.tsx +0 -140
  42. package/src/pages/auth/Register.tsx +0 -302
  43. package/src/pages/organizations/DetailEntity.tsx +0 -1002
  44. package/src/pages/organizations/DetailOrganizations.tsx +0 -1628
  45. package/src/pages/organizations/ListOrganizations.tsx +0 -270
  46. package/src/pages/pricings/CartPlan.tsx +0 -486
  47. package/src/pages/pricings/ListPricing.tsx +0 -321
  48. package/src/pages/users/CreateUser.tsx +0 -448
  49. package/src/pages/users/ListUsers.tsx +0 -0
  50. package/src/services/AuthServices.ts +0 -94
  51. package/src/services/OrganizationServices.ts +0 -61
  52. package/src/services/PlanSubscriptionServices.tsx +0 -137
  53. package/src/services/UserServices.ts +0 -36
  54. package/src/services/api.ts +0 -64
  55. package/src/styles/theme.ts +0 -383
  56. package/src/utils/utils.ts +0 -48
  57. package/src/vite-env.d.ts +0 -1
  58. package/tailwind.config.js +0 -158
  59. package/tsconfig.app.json +0 -24
  60. package/tsconfig.json +0 -31
  61. package/tsconfig.node.json +0 -22
  62. package/vite.config.ts +0 -10
package/dist/index.cjs ADDED
@@ -0,0 +1,1396 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/index.ts
30
+ var index_exports = {};
31
+ __export(index_exports, {
32
+ Pages: () => Pages_default,
33
+ PrimaryButton: () => Buttons_default,
34
+ RewiseLayout: () => ModernDoubleSidebarLayout_default,
35
+ SecondaryButton: () => SecondaryButton,
36
+ SessionProvider: () => SessionProvider,
37
+ ThemeProvider: () => ThemeContext_default,
38
+ ToastContainer: () => Toast_default,
39
+ ToastProvider: () => ToastProvider
40
+ });
41
+ module.exports = __toCommonJS(index_exports);
42
+
43
+ // src/components/common/Buttons.tsx
44
+ var import_jsx_runtime = require("react/jsx-runtime");
45
+ var PrimaryButton = ({
46
+ loading = false,
47
+ children,
48
+ classname = "",
49
+ ...props
50
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
51
+ "button",
52
+ {
53
+ type: "submit",
54
+ disabled: loading || props.disabled,
55
+ 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}`,
56
+ ...props,
57
+ children: loading ? "Connexion en cours..." : children
58
+ }
59
+ );
60
+ var SecondaryButton = ({
61
+ loading = false,
62
+ children,
63
+ ...props
64
+ }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ "button",
66
+ {
67
+ type: "button",
68
+ disabled: loading || props.disabled,
69
+ 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",
70
+ ...props,
71
+ children: loading ? "Connexion en cours..." : children
72
+ }
73
+ );
74
+ var Buttons_default = PrimaryButton;
75
+
76
+ // src/components/layout/ModernDoubleSidebarLayout.tsx
77
+ var import_react2 = __toESM(require("react"), 1);
78
+ var import_react_router_dom = require("react-router-dom");
79
+ var import_lucide_react = require("lucide-react");
80
+
81
+ // src/utils/utils.ts
82
+ var import_clsx = require("clsx");
83
+ var import_tailwind_merge = require("tailwind-merge");
84
+ function cn(...inputs) {
85
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
86
+ }
87
+
88
+ // src/contexts/ThemeContext.tsx
89
+ var import_react = require("react");
90
+
91
+ // src/styles/theme.ts
92
+ var elegantTheme = {
93
+ name: "\xC9l\xE9gance Sobre",
94
+ description: "Finance traditionnelle moderne - s\xE9rieux, luxe discret, rassurant",
95
+ colors: {
96
+ primary: "#2E7D69",
97
+ // Vert émeraude
98
+ primaryHover: "#246456",
99
+ primaryLight: "rgba(46, 125, 105, 0.1)",
100
+ secondary: "#D4AF37",
101
+ // Or pâle
102
+ accent: "#D4AF37",
103
+ background: "#F5F5F7",
104
+ // Gris clair neutre
105
+ surface: "#FFFFFF",
106
+ surfaceHover: "#FAFAFA",
107
+ text: {
108
+ primary: "#1E1E2F",
109
+ // Charbon profond
110
+ secondary: "#4A4A5C",
111
+ tertiary: "#C2C7CE",
112
+ // Gris moyen
113
+ inverse: "#FFFFFF"
114
+ },
115
+ border: "#E5E5E7",
116
+ borderLight: "#F0F0F2",
117
+ success: "#2E7D69",
118
+ successLight: "rgba(46, 125, 105, 0.1)",
119
+ error: "#DC3545",
120
+ errorLight: "rgba(220, 53, 69, 0.1)",
121
+ warning: "#D4AF37",
122
+ warningLight: "rgba(212, 175, 55, 0.1)",
123
+ info: "#5B9BD5",
124
+ infoLight: "rgba(91, 155, 213, 0.1)",
125
+ sidebar: {
126
+ bg: "#1E1E2F",
127
+ bgHover: "#252538",
128
+ text: "#C2C7CE",
129
+ textHover: "#FFFFFF",
130
+ border: "rgba(194, 199, 206, 0.1)",
131
+ active: "#2E7D69",
132
+ activeBg: "rgba(46, 125, 105, 0.1)"
133
+ },
134
+ card: {
135
+ bg: "#FFFFFF",
136
+ border: "#E5E5E7",
137
+ shadow: "rgba(30, 30, 47, 0.05)"
138
+ }
139
+ },
140
+ shadows: {
141
+ sm: "0 1px 3px rgba(30, 30, 47, 0.05)",
142
+ md: "0 4px 6px rgba(30, 30, 47, 0.07)",
143
+ lg: "0 10px 15px rgba(30, 30, 47, 0.1)",
144
+ xl: "0 20px 25px rgba(30, 30, 47, 0.12)"
145
+ },
146
+ transitions: {
147
+ fast: "150ms ease",
148
+ normal: "250ms ease",
149
+ slow: "350ms ease"
150
+ },
151
+ borderRadius: {
152
+ sm: "4px",
153
+ md: "8px",
154
+ lg: "12px",
155
+ xl: "16px",
156
+ full: "9999px"
157
+ }
158
+ };
159
+ var fintechTheme = {
160
+ name: "Modern Fintech",
161
+ description: "Moderne, clair, orient\xE9 tableau de bord financier",
162
+ colors: {
163
+ primary: "#27AE60",
164
+ // Vert doux
165
+ primaryHover: "#219A52",
166
+ primaryLight: "rgba(39, 174, 96, 0.1)",
167
+ secondary: "#2C3E50",
168
+ // Bleu nuit désaturé
169
+ accent: "#3498DB",
170
+ background: "#FAFAFA",
171
+ // Blanc cassé
172
+ surface: "#FFFFFF",
173
+ surfaceHover: "#F8F9FA",
174
+ text: {
175
+ primary: "#2C3E50",
176
+ secondary: "#7F8C8D",
177
+ // Gris ardoise
178
+ tertiary: "#95A5A6",
179
+ inverse: "#FFFFFF"
180
+ },
181
+ border: "#E0E6ED",
182
+ borderLight: "#F1F4F7",
183
+ success: "#27AE60",
184
+ successLight: "rgba(39, 174, 96, 0.1)",
185
+ error: "#C0392B",
186
+ // Rouge bourgogne
187
+ errorLight: "rgba(192, 57, 43, 0.1)",
188
+ warning: "#F39C12",
189
+ warningLight: "rgba(243, 156, 18, 0.1)",
190
+ info: "#3498DB",
191
+ infoLight: "rgba(52, 152, 219, 0.1)",
192
+ sidebar: {
193
+ bg: "#2C3E50",
194
+ bgHover: "#34495E",
195
+ text: "#95A5A6",
196
+ textHover: "#FFFFFF",
197
+ border: "rgba(149, 165, 166, 0.1)",
198
+ active: "#27AE60",
199
+ activeBg: "rgba(39, 174, 96, 0.1)"
200
+ },
201
+ card: {
202
+ bg: "#FFFFFF",
203
+ border: "#E0E6ED",
204
+ shadow: "rgba(44, 62, 80, 0.04)"
205
+ }
206
+ },
207
+ shadows: {
208
+ sm: "0 1px 3px rgba(44, 62, 80, 0.04)",
209
+ md: "0 4px 6px rgba(44, 62, 80, 0.06)",
210
+ lg: "0 10px 15px rgba(44, 62, 80, 0.08)",
211
+ xl: "0 20px 25px rgba(44, 62, 80, 0.1)"
212
+ },
213
+ transitions: {
214
+ fast: "150ms ease",
215
+ normal: "250ms ease",
216
+ slow: "350ms ease"
217
+ },
218
+ borderRadius: {
219
+ sm: "4px",
220
+ md: "8px",
221
+ lg: "12px",
222
+ xl: "16px",
223
+ full: "9999px"
224
+ }
225
+ };
226
+ var minimalistTheme = {
227
+ name: "Minimaliste Premium",
228
+ description: "\xC9l\xE9gance minimaliste avec touche premium",
229
+ colors: {
230
+ primary: "#6A8A82",
231
+ // Vert sauge
232
+ primaryHover: "#5A7A72",
233
+ primaryLight: "rgba(106, 138, 130, 0.1)",
234
+ secondary: "#B87333",
235
+ // Cuivre rosé
236
+ accent: "#B87333",
237
+ background: "#ECECEC",
238
+ // Gris clair perle
239
+ surface: "#FFFFFF",
240
+ surfaceHover: "#FAFAFA",
241
+ text: {
242
+ primary: "#191919",
243
+ // Noir fumé
244
+ secondary: "#444444",
245
+ // Anthracite doux
246
+ tertiary: "#767676",
247
+ inverse: "#FFFFFF"
248
+ },
249
+ border: "#D9D9D9",
250
+ borderLight: "#E8E8E8",
251
+ success: "#6A8A82",
252
+ successLight: "rgba(106, 138, 130, 0.1)",
253
+ error: "#B85450",
254
+ errorLight: "rgba(184, 84, 80, 0.1)",
255
+ warning: "#B87333",
256
+ warningLight: "rgba(184, 115, 51, 0.1)",
257
+ info: "#7A99AC",
258
+ infoLight: "rgba(122, 153, 172, 0.1)",
259
+ sidebar: {
260
+ bg: "#191919",
261
+ bgHover: "#242424",
262
+ text: "#999999",
263
+ textHover: "#FFFFFF",
264
+ border: "rgba(153, 153, 153, 0.1)",
265
+ active: "#B87333",
266
+ activeBg: "rgba(184, 115, 51, 0.1)"
267
+ },
268
+ card: {
269
+ bg: "#FFFFFF",
270
+ border: "#D9D9D9",
271
+ shadow: "rgba(25, 25, 25, 0.03)"
272
+ }
273
+ },
274
+ shadows: {
275
+ sm: "0 1px 3px rgba(25, 25, 25, 0.03)",
276
+ md: "0 4px 6px rgba(25, 25, 25, 0.05)",
277
+ lg: "0 10px 15px rgba(25, 25, 25, 0.07)",
278
+ xl: "0 20px 25px rgba(25, 25, 25, 0.09)"
279
+ },
280
+ transitions: {
281
+ fast: "150ms ease",
282
+ normal: "250ms ease",
283
+ slow: "350ms ease"
284
+ },
285
+ borderRadius: {
286
+ sm: "4px",
287
+ md: "8px",
288
+ lg: "12px",
289
+ xl: "16px",
290
+ full: "9999px"
291
+ }
292
+ };
293
+ var neutralOdysseyTheme = {
294
+ name: "Neutral Odyssey",
295
+ description: "Palette haut de gamme pour immobilier - \xE9l\xE9gance neutre et moderne",
296
+ colors: {
297
+ primary: "#373B4D",
298
+ // Gris profond, élégant - Actions fortes
299
+ primaryHover: "#2C2F3D",
300
+ // Version plus sombre pour hover
301
+ primaryLight: "rgba(55, 59, 77, 0.1)",
302
+ secondary: "#BDBFB7",
303
+ // Accents - éléments surlignés, cartes de projet
304
+ accent: "#BDBFB7",
305
+ background: "#ECEDEF",
306
+ // Fond clair principal
307
+ surface: "#ECECEF",
308
+ // Surface des cartes et panneaux
309
+ surfaceHover: "#E6E6E9",
310
+ text: {
311
+ primary: "#373B4D",
312
+ // Texte principal sur fond clair
313
+ secondary: "#949597",
314
+ // Texte secondaire / icônes
315
+ tertiary: "#BDBFB7",
316
+ // Texte tertiaire
317
+ inverse: "#ECECEF"
318
+ // Texte sur fond sombre
319
+ },
320
+ border: "#BDBFB7",
321
+ // Bordures principales
322
+ borderLight: "#E0E0E3",
323
+ // Bordures légères
324
+ success: "#6A8A82",
325
+ // Réutilisation du vert sauge pour succès
326
+ successLight: "rgba(106, 138, 130, 0.1)",
327
+ error: "#B85450",
328
+ errorLight: "rgba(184, 84, 80, 0.1)",
329
+ warning: "#D4AF37",
330
+ // Or pour les avertissements
331
+ warningLight: "rgba(212, 175, 55, 0.1)",
332
+ info: "#7A99AC",
333
+ infoLight: "rgba(122, 153, 172, 0.1)",
334
+ sidebar: {
335
+ bg: "linear-gradient(180deg, #ECECEF 0%, #ECEDEF 100%)",
336
+ // Dégradé vertical
337
+ bgHover: "#E6E6E9",
338
+ text: "#373B4D",
339
+ // Icônes et texte en gris profond
340
+ textHover: "#2C2F3D",
341
+ // Plus sombre au hover
342
+ border: "rgba(189, 191, 183, 0.2)",
343
+ active: "#373B4D",
344
+ // État actif en couleur principale
345
+ activeBg: "rgba(55, 59, 77, 0.1)"
346
+ },
347
+ card: {
348
+ bg: "#ECEDEF",
349
+ // Cartes sur fond légèrement différent
350
+ border: "#BDBFB7",
351
+ // Encadrement des cartes
352
+ shadow: "rgba(55, 59, 77, 0.08)"
353
+ }
354
+ },
355
+ shadows: {
356
+ sm: "0 1px 3px rgba(55, 59, 77, 0.08)",
357
+ md: "0 4px 6px rgba(55, 59, 77, 0.10)",
358
+ lg: "0 10px 15px rgba(55, 59, 77, 0.12)",
359
+ xl: "0 20px 25px rgba(55, 59, 77, 0.15)"
360
+ },
361
+ transitions: {
362
+ fast: "150ms ease",
363
+ normal: "250ms ease",
364
+ slow: "350ms ease"
365
+ },
366
+ borderRadius: {
367
+ sm: "4px",
368
+ md: "8px",
369
+ lg: "12px",
370
+ xl: "16px",
371
+ full: "9999px"
372
+ }
373
+ };
374
+ var themes = {
375
+ elegant: elegantTheme,
376
+ fintech: fintechTheme,
377
+ minimalist: minimalistTheme,
378
+ neutralOdyssey: neutralOdysseyTheme
379
+ };
380
+ var defaultTheme = minimalistTheme;
381
+ var getThemeCSSVariables = (theme) => {
382
+ return {
383
+ "--color-primary": theme.colors.primary,
384
+ "--color-primary-hover": theme.colors.primaryHover,
385
+ "--color-primary-light": theme.colors.primaryLight,
386
+ "--color-secondary": theme.colors.secondary,
387
+ "--color-accent": theme.colors.accent,
388
+ "--color-background": theme.colors.background,
389
+ "--color-surface": theme.colors.surface,
390
+ "--color-surface-hover": theme.colors.surfaceHover,
391
+ "--color-text-primary": theme.colors.text.primary,
392
+ "--color-text-secondary": theme.colors.text.secondary,
393
+ "--color-text-tertiary": theme.colors.text.tertiary,
394
+ "--color-text-inverse": theme.colors.text.inverse,
395
+ "--color-border": theme.colors.border,
396
+ "--color-border-light": theme.colors.borderLight,
397
+ "--color-success": theme.colors.success,
398
+ "--color-success-light": theme.colors.successLight,
399
+ "--color-error": theme.colors.error,
400
+ "--color-error-light": theme.colors.errorLight,
401
+ "--color-warning": theme.colors.warning,
402
+ "--color-warning-light": theme.colors.warningLight,
403
+ "--color-info": theme.colors.info,
404
+ "--color-info-light": theme.colors.infoLight,
405
+ "--shadow-sm": theme.shadows.sm,
406
+ "--shadow-md": theme.shadows.md,
407
+ "--shadow-lg": theme.shadows.lg,
408
+ "--shadow-xl": theme.shadows.xl,
409
+ "--transition-fast": theme.transitions.fast,
410
+ "--transition-normal": theme.transitions.normal,
411
+ "--transition-slow": theme.transitions.slow,
412
+ "--radius-sm": theme.borderRadius.sm,
413
+ "--radius-md": theme.borderRadius.md,
414
+ "--radius-lg": theme.borderRadius.lg,
415
+ "--radius-xl": theme.borderRadius.xl,
416
+ "--radius-full": theme.borderRadius.full
417
+ };
418
+ };
419
+
420
+ // src/contexts/ThemeContext.tsx
421
+ var import_jsx_runtime2 = require("react/jsx-runtime");
422
+ var ThemeContext = (0, import_react.createContext)(void 0);
423
+ var useTheme = () => {
424
+ const context = (0, import_react.useContext)(ThemeContext);
425
+ if (!context) {
426
+ throw new Error("useTheme must be used within a ThemeProvider");
427
+ }
428
+ return context;
429
+ };
430
+ var ThemeProvider = ({ children }) => {
431
+ const [themeType, setThemeType] = (0, import_react.useState)(() => {
432
+ const saved = localStorage.getItem("wisebook-theme");
433
+ return saved && saved in themes ? saved : "minimalist";
434
+ });
435
+ const [theme, setThemeState] = (0, import_react.useState)(themes[themeType] || defaultTheme);
436
+ (0, import_react.useEffect)(() => {
437
+ const root = document.documentElement;
438
+ const cssVars = getThemeCSSVariables(theme);
439
+ Object.entries(cssVars).forEach(([key, value]) => {
440
+ root.style.setProperty(key, value);
441
+ });
442
+ root.style.backgroundColor = theme.colors.background;
443
+ root.style.color = theme.colors.text.primary;
444
+ localStorage.setItem("wisebook-theme", themeType);
445
+ }, [theme, themeType]);
446
+ const setTheme = (type) => {
447
+ if (type in themes) {
448
+ setThemeType(type);
449
+ setThemeState(themes[type]);
450
+ }
451
+ };
452
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ThemeContext.Provider, { value: { theme, themeType, setTheme }, children });
453
+ };
454
+ var ThemeContext_default = ThemeProvider;
455
+
456
+ // src/components/layout/ModernDoubleSidebarLayout.tsx
457
+ var import_jsx_runtime3 = require("react/jsx-runtime");
458
+ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
459
+ const location = (0, import_react_router_dom.useLocation)();
460
+ const navigate = (0, import_react_router_dom.useNavigate)();
461
+ const { theme, themeType, setTheme } = useTheme();
462
+ const [primaryCollapsed, setPrimaryCollapsed] = (0, import_react2.useState)(false);
463
+ const [secondaryCollapsed, setSecondaryCollapsed] = (0, import_react2.useState)(false);
464
+ const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react2.useState)(false);
465
+ const [selectedModule, setSelectedModule] = (0, import_react2.useState)("dashboard");
466
+ const [searchQuery, setSearchQuery] = (0, import_react2.useState)("");
467
+ const [showNotifications, setShowNotifications] = (0, import_react2.useState)(false);
468
+ const [showUserMenu, setShowUserMenu] = (0, import_react2.useState)(false);
469
+ const [showThemeMenu, setShowThemeMenu] = (0, import_react2.useState)(false);
470
+ const [notifications, setNotifications] = (0, import_react2.useState)([
471
+ {
472
+ id: "1",
473
+ title: "Nouvelle facture",
474
+ message: "3 nouvelles factures en attente de validation",
475
+ type: "info",
476
+ timestamp: /* @__PURE__ */ new Date(),
477
+ read: false
478
+ },
479
+ {
480
+ id: "2",
481
+ title: "Cl\xF4ture mensuelle",
482
+ message: "La cl\xF4ture de janvier est pr\xEAte",
483
+ type: "success",
484
+ timestamp: /* @__PURE__ */ new Date(),
485
+ read: false
486
+ }
487
+ ]);
488
+ (0, import_react2.useEffect)(() => {
489
+ const handleKeyDown = (e) => {
490
+ if (e.altKey && e.key === "m") {
491
+ e.preventDefault();
492
+ setMobileMenuOpen((prev) => !prev);
493
+ }
494
+ if (e.altKey && e.key === "s") {
495
+ e.preventDefault();
496
+ document.getElementById("global-search")?.focus();
497
+ }
498
+ if (e.key === "Escape") {
499
+ setShowNotifications(false);
500
+ setShowUserMenu(false);
501
+ setShowThemeMenu(false);
502
+ setMobileMenuOpen(false);
503
+ }
504
+ };
505
+ document.addEventListener("keydown", handleKeyDown);
506
+ return () => document.removeEventListener("keydown", handleKeyDown);
507
+ }, []);
508
+ (0, import_react2.useEffect)(() => {
509
+ const path = location.pathname;
510
+ const moduleMatch = path.match(/^\/([^/]+)/);
511
+ if (moduleMatch) {
512
+ const moduleId = moduleMatch[1];
513
+ const routeMapping = {
514
+ "dashboard": "dashboard",
515
+ "organizations": "organizations",
516
+ "entities": "entities"
517
+ };
518
+ setSelectedModule(routeMapping[moduleId] || "dashboard");
519
+ }
520
+ }, [location]);
521
+ const handleThemeChange = (type) => {
522
+ setTheme(type);
523
+ setShowThemeMenu(false);
524
+ };
525
+ const isActive = (path) => location.pathname === path;
526
+ const isModuleActive = (moduleId) => selectedModule === moduleId;
527
+ const getBreadcrumbs = () => {
528
+ const paths = location.pathname.split("/").filter(Boolean);
529
+ const breadcrumbs = [{ label: "Accueil", path: "/" }];
530
+ paths.forEach((path, index) => {
531
+ const fullPath = "/" + paths.slice(0, index + 1).join("/");
532
+ const module2 = primaryMenuItems.find((m) => m.id === path);
533
+ const label = module2 ? module2.label : path.charAt(0).toUpperCase() + path.slice(1);
534
+ breadcrumbs.push({ label, path: fullPath });
535
+ });
536
+ return breadcrumbs;
537
+ };
538
+ const markNotificationAsRead = (id) => {
539
+ setNotifications(
540
+ (prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
541
+ );
542
+ };
543
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex h-screen bg-[var(--color-background)] overflow-hidden", children: [
544
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
545
+ "a",
546
+ {
547
+ href: "#main-content",
548
+ className: "sr-only focus:not-sr-only focus:absolute focus:top-4 focus:left-4 z-50 bg-[var(--color-primary)] text-[var(--color-background)] px-4 py-2 rounded",
549
+ children: "Aller au contenu principal"
550
+ }
551
+ ),
552
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
553
+ "aside",
554
+ {
555
+ className: cn(
556
+ "hidden lg:flex flex-col bg-[var(--color-sidebar-bg)] transition-all duration-300",
557
+ primaryCollapsed ? "w-20" : "w-64"
558
+ ),
559
+ role: "navigation",
560
+ "aria-label": "Navigation principale",
561
+ children: [
562
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
563
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn(
564
+ "flex items-center gap-3",
565
+ primaryCollapsed && "justify-center"
566
+ ), children: [
567
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
568
+ !primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
569
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: module_name }),
570
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: module_description })
571
+ ] })
572
+ ] }),
573
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
574
+ "button",
575
+ {
576
+ onClick: () => setPrimaryCollapsed(!primaryCollapsed),
577
+ className: "text-[var(--color-sidebar-text-secondary)] hover:text-[var(--color-sidebar-text)] transition-colors",
578
+ "aria-label": primaryCollapsed ? "D\xE9velopper le menu" : "R\xE9duire le menu",
579
+ "aria-expanded": !primaryCollapsed,
580
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronLeft, { className: cn(
581
+ "w-5 h-5 transition-transform",
582
+ primaryCollapsed && "rotate-180"
583
+ ) })
584
+ }
585
+ )
586
+ ] }),
587
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
588
+ "nav",
589
+ {
590
+ className: "flex-1 py-4 overflow-y-auto",
591
+ role: "menubar",
592
+ "aria-label": "Modules principaux",
593
+ children: primaryMenuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
594
+ "button",
595
+ {
596
+ onClick: () => {
597
+ if (item.path) {
598
+ navigate(item.path);
599
+ } else {
600
+ setSelectedModule(item.id);
601
+ }
602
+ },
603
+ className: cn(
604
+ "w-full flex items-center gap-3 px-4 py-3 transition-all duration-200",
605
+ "hover:bg-[var(--color-sidebar-hover)] relative group",
606
+ isModuleActive(item.id) && "bg-[var(--color-sidebar-active)] border-l-4 border-[var(--color-primary)]",
607
+ primaryCollapsed && "justify-center"
608
+ ),
609
+ role: "menuitem",
610
+ "aria-label": item.ariaLabel || item.label,
611
+ "aria-current": isModuleActive(item.id) ? "page" : void 0,
612
+ children: [
613
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn(
614
+ "transition-colors",
615
+ isModuleActive(item.id) ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
616
+ ), children: item.icon }),
617
+ !primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
618
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cn(
619
+ "flex-1 text-left text-sm font-medium transition-colors",
620
+ isModuleActive(item.id) ? "text-[var(--color-sidebar-text)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
621
+ ), children: item.label }),
622
+ item.badge && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-[var(--color-background)] rounded-full", children: item.badge })
623
+ ] }),
624
+ primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "absolute left-full ml-2 px-2 py-1 bg-[var(--color-sidebar-active)] text-[var(--color-sidebar-text)] text-xs rounded opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-50", children: item.label })
625
+ ]
626
+ },
627
+ item.id
628
+ ))
629
+ }
630
+ ),
631
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-4 border-t border-[var(--color-sidebar-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: cn(
632
+ "flex items-center gap-3",
633
+ primaryCollapsed && "justify-center"
634
+ ), children: [
635
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 bg-[var(--color-sidebar-avatar-bg)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.User, { className: "w-5 h-5 text-[var(--color-sidebar-text-secondary)]" }) }),
636
+ !primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-1", children: [
637
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium text-[var(--color-sidebar-text)]", children: "Admin" }),
638
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-sidebar-text-secondary)]", children: "admin@wisebook.com" })
639
+ ] })
640
+ ] }) })
641
+ ]
642
+ }
643
+ ),
644
+ secondaryMenuItems[selectedModule] && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_jsx_runtime3.Fragment, { children: [
645
+ secondaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
646
+ "button",
647
+ {
648
+ onClick: () => setSecondaryCollapsed(false),
649
+ className: "hidden lg:flex items-center justify-center w-12 h-full bg-[var(--color-background)] border-r border-[var(--color-border)] hover:bg-[var(--color-surface-hover)] transition-colors",
650
+ "aria-label": "Ouvrir le sous-menu",
651
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronRight, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
652
+ }
653
+ ),
654
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
655
+ "aside",
656
+ {
657
+ className: cn(
658
+ "hidden lg:flex flex-col bg-[var(--color-background)] border-r border-[var(--color-border)] transition-all duration-300",
659
+ secondaryCollapsed ? "w-0 overflow-hidden" : "w-64"
660
+ ),
661
+ role: "navigation",
662
+ "aria-label": "Navigation secondaire",
663
+ children: [
664
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-border)]", children: [
665
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { className: "text-sm font-semibold text-[var(--color-text-secondary)] uppercase tracking-wider whitespace-nowrap", children: primaryMenuItems.find((item) => item.id === selectedModule)?.label }),
666
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
667
+ "button",
668
+ {
669
+ onClick: () => setSecondaryCollapsed(!secondaryCollapsed),
670
+ className: "text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] flex-shrink-0",
671
+ "aria-label": secondaryCollapsed ? "D\xE9velopper le sous-menu" : "R\xE9duire le sous-menu",
672
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronLeft, { className: cn(
673
+ "w-4 h-4 transition-transform",
674
+ secondaryCollapsed && "rotate-180"
675
+ ) })
676
+ }
677
+ )
678
+ ] }),
679
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
680
+ "nav",
681
+ {
682
+ className: "flex-1 py-4 overflow-y-auto",
683
+ role: "menu",
684
+ "aria-label": "Sous-navigation",
685
+ children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
686
+ "button",
687
+ {
688
+ onClick: () => item.path && navigate(item.path),
689
+ className: cn(
690
+ "w-full flex items-center gap-3 px-4 py-2.5 transition-all duration-200",
691
+ "hover:bg-[var(--color-surface-hover)]",
692
+ isActive(item.path || "") && "bg-[var(--color-primary-light)] border-l-4 border-[var(--color-primary)]"
693
+ ),
694
+ role: "menuitem",
695
+ "aria-current": isActive(item.path || "") ? "page" : void 0,
696
+ children: [
697
+ item.icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn(
698
+ "transition-colors",
699
+ isActive(item.path || "") ? "text-[var(--color-primary)]" : "text-[var(--color-text-tertiary)]"
700
+ ), children: item.icon }),
701
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cn(
702
+ "flex-1 text-left text-sm",
703
+ isActive(item.path || "") ? "text-[var(--color-primary)] font-medium" : "text-[var(--color-text-secondary)]"
704
+ ), children: item.label }),
705
+ item.badge && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-white rounded-full", children: item.badge })
706
+ ]
707
+ },
708
+ item.id
709
+ ))
710
+ }
711
+ )
712
+ ]
713
+ }
714
+ )
715
+ ] }),
716
+ mobileMenuOpen && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
717
+ "div",
718
+ {
719
+ className: "fixed inset-0 bg-black bg-opacity-50 z-50 lg:hidden",
720
+ onClick: () => setMobileMenuOpen(false),
721
+ "aria-hidden": "true",
722
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
723
+ "aside",
724
+ {
725
+ className: "w-80 h-full bg-[var(--color-sidebar-bg)]",
726
+ onClick: (e) => e.stopPropagation(),
727
+ role: "navigation",
728
+ "aria-label": "Navigation mobile",
729
+ children: [
730
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
731
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-3", children: [
732
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
733
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
734
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "text-white font-bold text-lg", children: "WiseBook" }),
735
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-gray-400 text-xs", children: "ERP Next-Gen" })
736
+ ] })
737
+ ] }),
738
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
739
+ "button",
740
+ {
741
+ onClick: () => setMobileMenuOpen(false),
742
+ className: "text-[var(--color-sidebar-text-secondary)]",
743
+ "aria-label": "Fermer le menu",
744
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.X, { className: "w-6 h-6" })
745
+ }
746
+ )
747
+ ] }),
748
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("nav", { className: "py-4", role: "menubar", children: primaryMenuItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
749
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
750
+ "button",
751
+ {
752
+ onClick: () => {
753
+ if (item.path) {
754
+ navigate(item.path);
755
+ setMobileMenuOpen(false);
756
+ } else {
757
+ setSelectedModule(item.id);
758
+ }
759
+ },
760
+ className: cn(
761
+ "w-full flex items-center gap-3 px-4 py-3 transition-all duration-200",
762
+ "hover:bg-[var(--color-sidebar-hover)]",
763
+ isModuleActive(item.id) && "bg-[var(--color-sidebar-active)] border-l-4 border-[var(--color-primary)]"
764
+ ),
765
+ role: "menuitem",
766
+ "aria-current": isModuleActive(item.id) ? "page" : void 0,
767
+ children: [
768
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn(
769
+ "transition-colors",
770
+ isModuleActive(item.id) ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)]"
771
+ ), children: item.icon }),
772
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cn(
773
+ "flex-1 text-left text-sm font-medium",
774
+ isModuleActive(item.id) ? "text-[var(--color-sidebar-text)]" : "text-[var(--color-sidebar-text-secondary)]"
775
+ ), children: item.label }),
776
+ item.badge && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-[var(--color-background)] rounded-full", children: item.badge })
777
+ ]
778
+ }
779
+ ),
780
+ isModuleActive(item.id) && secondaryMenuItems[item.id] && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "bg-[var(--color-sidebar-submenu-bg)] py-2", children: secondaryMenuItems[item.id].map((subItem) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
781
+ "button",
782
+ {
783
+ onClick: () => {
784
+ if (subItem.path) {
785
+ navigate(subItem.path);
786
+ setMobileMenuOpen(false);
787
+ }
788
+ },
789
+ className: cn(
790
+ "w-full flex items-center gap-3 pl-12 pr-4 py-2 text-sm",
791
+ "hover:bg-[var(--color-sidebar-hover)]",
792
+ isActive(subItem.path || "") && "bg-[var(--color-sidebar-active)] text-[var(--color-primary)]"
793
+ ),
794
+ children: [
795
+ subItem.icon,
796
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: cn(
797
+ isActive(subItem.path || "") ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)]"
798
+ ), children: subItem.label })
799
+ ]
800
+ },
801
+ subItem.id
802
+ )) })
803
+ ] }, item.id)) })
804
+ ]
805
+ }
806
+ )
807
+ }
808
+ ),
809
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
810
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
811
+ "header",
812
+ {
813
+ className: "h-14 bg-[var(--color-background)] border-b border-[var(--color-border)] flex items-center justify-between px-3 lg:px-4",
814
+ role: "banner",
815
+ children: [
816
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-4 flex-1", children: [
817
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
818
+ "button",
819
+ {
820
+ onClick: () => setMobileMenuOpen(true),
821
+ className: "lg:hidden text-[var(--color-text-primary)]",
822
+ "aria-label": "Ouvrir le menu mobile",
823
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Menu, { className: "w-6 h-6" })
824
+ }
825
+ ),
826
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
827
+ "nav",
828
+ {
829
+ className: "hidden sm:flex items-center gap-2 text-sm",
830
+ "aria-label": "Fil d'Ariane",
831
+ children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react2.default.Fragment, { children: [
832
+ index > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.ChevronRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }),
833
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
834
+ "button",
835
+ {
836
+ onClick: () => navigate(crumb.path),
837
+ className: cn(
838
+ "hover:text-[var(--color-primary)]",
839
+ index === getBreadcrumbs().length - 1 ? "text-[var(--color-text-primary)] font-medium" : "text-[var(--color-text-tertiary)]"
840
+ ),
841
+ children: crumb.label
842
+ }
843
+ )
844
+ ] }, crumb.path))
845
+ }
846
+ ),
847
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative max-w-md flex-1 hidden lg:block", children: [
848
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] w-5 h-5" }),
849
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
850
+ "input",
851
+ {
852
+ id: "global-search",
853
+ type: "text",
854
+ placeholder: "Rechercher... (Alt+S)",
855
+ value: searchQuery,
856
+ onChange: (e) => setSearchQuery(e.target.value),
857
+ className: "w-full pl-10 pr-4 py-2 bg-[var(--color-surface-hover)] border border-[var(--color-border)] rounded-lg text-sm focus:outline-none focus:border-[var(--color-primary)] focus:ring-2 focus:ring-[var(--color-primary-light)]",
858
+ "aria-label": "Recherche globale"
859
+ }
860
+ )
861
+ ] })
862
+ ] }),
863
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center gap-3", children: [
864
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [
865
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
866
+ "button",
867
+ {
868
+ onClick: () => setShowThemeMenu(!showThemeMenu),
869
+ className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
870
+ title: "Changer le th\xE8me",
871
+ "aria-label": "S\xE9lecteur de th\xE8me",
872
+ "aria-expanded": showThemeMenu,
873
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Palette, { className: "w-5 h-5 text-[var(--color-text-secondary)]" })
874
+ }
875
+ ),
876
+ showThemeMenu && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
877
+ "div",
878
+ {
879
+ className: "absolute right-0 mt-2 w-64 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
880
+ role: "menu",
881
+ "aria-label": "S\xE9lection du th\xE8me",
882
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "p-2", children: [
883
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "px-3 py-2 text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Th\xE8mes disponibles" }),
884
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
885
+ "button",
886
+ {
887
+ onClick: () => handleThemeChange("elegant"),
888
+ className: cn(
889
+ "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
890
+ themeType === "elegant" && "bg-[var(--color-primary-light)]"
891
+ ),
892
+ role: "menuitem",
893
+ children: [
894
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)]" }),
895
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "text-left", children: [
896
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium", children: "\xC9l\xE9gance Sobre" }),
897
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Finance traditionnelle" })
898
+ ] })
899
+ ]
900
+ }
901
+ ),
902
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
903
+ "button",
904
+ {
905
+ onClick: () => handleThemeChange("fintech"),
906
+ className: cn(
907
+ "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
908
+ themeType === "fintech" && "bg-[var(--color-primary-light)]"
909
+ ),
910
+ role: "menuitem",
911
+ children: [
912
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-success)] to-[var(--color-text-primary)]" }),
913
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "text-left", children: [
914
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium", children: "Modern Fintech" }),
915
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Tableau de bord moderne" })
916
+ ] })
917
+ ]
918
+ }
919
+ ),
920
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
921
+ "button",
922
+ {
923
+ onClick: () => handleThemeChange("minimalist"),
924
+ className: cn(
925
+ "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
926
+ themeType === "minimalist" && "bg-[var(--color-primary-light)]"
927
+ ),
928
+ role: "menuitem",
929
+ children: [
930
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-text-secondary)] to-[var(--color-accent)]" }),
931
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "text-left", children: [
932
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium", children: "Minimaliste Premium" }),
933
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "\xC9l\xE9gance minimaliste" })
934
+ ] })
935
+ ]
936
+ }
937
+ )
938
+ ] })
939
+ }
940
+ )
941
+ ] }),
942
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center px-3 py-1.5 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
943
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.DollarSign, { className: "w-4 h-4 text-[var(--color-primary)] mr-2" }),
944
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "FCFA" })
945
+ ] }),
946
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [
947
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
948
+ "button",
949
+ {
950
+ className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
951
+ onClick: () => setShowNotifications(!showNotifications),
952
+ "aria-label": `Notifications ${notifications.filter((n) => !n.read).length > 0 ? `(${notifications.filter((n) => !n.read).length} non lues)` : ""}`,
953
+ "aria-expanded": showNotifications,
954
+ children: [
955
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
956
+ notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
957
+ ]
958
+ }
959
+ ),
960
+ showNotifications && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
961
+ "div",
962
+ {
963
+ className: "absolute right-0 mt-2 w-80 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-96 overflow-y-auto",
964
+ role: "region",
965
+ "aria-label": "Centre de notifications",
966
+ children: [
967
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
968
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map((notif) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
969
+ "div",
970
+ {
971
+ className: cn(
972
+ "p-4 hover:bg-[var(--color-surface-hover)] cursor-pointer",
973
+ !notif.read && "bg-[var(--color-primary-light)] bg-opacity-10"
974
+ ),
975
+ onClick: () => markNotificationAsRead(notif.id),
976
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-start gap-3", children: [
977
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn(
978
+ "w-2 h-2 rounded-full mt-2",
979
+ notif.type === "error" && "bg-[var(--color-error)]",
980
+ notif.type === "warning" && "bg-[var(--color-warning)]",
981
+ notif.type === "success" && "bg-[var(--color-success)]",
982
+ notif.type === "info" && "bg-[var(--color-info)]"
983
+ ) }),
984
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex-1", children: [
985
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: notif.title }),
986
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
987
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: notif.timestamp.toLocaleTimeString() })
988
+ ] })
989
+ ] })
990
+ },
991
+ notif.id
992
+ )) })
993
+ ]
994
+ }
995
+ )
996
+ ] }),
997
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "relative", children: [
998
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
999
+ "button",
1000
+ {
1001
+ onClick: () => setShowUserMenu(!showUserMenu),
1002
+ className: "flex items-center gap-2 p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
1003
+ "aria-label": "Menu utilisateur",
1004
+ "aria-expanded": showUserMenu,
1005
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-8 h-8 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.User, { className: "w-4 h-4 text-[var(--color-background)]" }) })
1006
+ }
1007
+ ),
1008
+ showUserMenu && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1009
+ "div",
1010
+ {
1011
+ className: "absolute right-0 mt-2 w-56 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
1012
+ role: "menu",
1013
+ "aria-label": "Menu utilisateur",
1014
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "p-2", children: [
1015
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1016
+ "button",
1017
+ {
1018
+ className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
1019
+ role: "menuitem",
1020
+ children: [
1021
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.User, { className: "w-4 h-4" }),
1022
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm", children: "Mon profil" })
1023
+ ]
1024
+ }
1025
+ ),
1026
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1027
+ "button",
1028
+ {
1029
+ onClick: () => {
1030
+ navigate("/settings");
1031
+ setShowUserMenu(false);
1032
+ },
1033
+ className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
1034
+ role: "menuitem",
1035
+ children: [
1036
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.Settings, { className: "w-4 h-4" }),
1037
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm", children: "Param\xE8tres" })
1038
+ ]
1039
+ }
1040
+ ),
1041
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1042
+ "button",
1043
+ {
1044
+ className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
1045
+ role: "menuitem",
1046
+ children: [
1047
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.HelpCircle, { className: "w-4 h-4" }),
1048
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm", children: "Aide" })
1049
+ ]
1050
+ }
1051
+ ),
1052
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("hr", { className: "my-2 border-[var(--color-border)]" }),
1053
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
1054
+ "button",
1055
+ {
1056
+ className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] text-[var(--color-error)] transition-colors",
1057
+ role: "menuitem",
1058
+ children: [
1059
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react.LogOut, { className: "w-4 h-4" }),
1060
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm", children: "D\xE9connexion" })
1061
+ ]
1062
+ }
1063
+ )
1064
+ ] })
1065
+ }
1066
+ )
1067
+ ] })
1068
+ ] })
1069
+ ]
1070
+ }
1071
+ ),
1072
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
1073
+ "main",
1074
+ {
1075
+ id: "main-content",
1076
+ className: "flex-1 overflow-y-auto bg-[var(--color-background)]",
1077
+ role: "main",
1078
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "p-3 lg:p-4", children })
1079
+ }
1080
+ )
1081
+ ] })
1082
+ ] });
1083
+ };
1084
+ var ModernDoubleSidebarLayout_default = RewiseLayout;
1085
+
1086
+ // src/components/ui/Toast.tsx
1087
+ var import_react4 = require("react");
1088
+
1089
+ // src/contexts/ToastContext.tsx
1090
+ var import_react3 = require("react");
1091
+ var import_jsx_runtime4 = require("react/jsx-runtime");
1092
+ var ToastContext = (0, import_react3.createContext)(void 0);
1093
+ var useToast = () => {
1094
+ const context = (0, import_react3.useContext)(ToastContext);
1095
+ if (!context) {
1096
+ throw new Error("useToast must be used within a ToastProvider");
1097
+ }
1098
+ return context;
1099
+ };
1100
+ var ToastProvider = ({ children }) => {
1101
+ const [toasts, setToasts] = (0, import_react3.useState)([]);
1102
+ const generateId = () => {
1103
+ return Date.now().toString(36) + Math.random().toString(36).substr(2);
1104
+ };
1105
+ const addToast = (0, import_react3.useCallback)((toast) => {
1106
+ const id = generateId();
1107
+ const newToast = {
1108
+ id,
1109
+ duration: 5e3,
1110
+ ...toast
1111
+ };
1112
+ setToasts((prev) => [...prev, newToast]);
1113
+ if (newToast.duration && newToast.duration > 0) {
1114
+ setTimeout(() => {
1115
+ removeToast(id);
1116
+ }, newToast.duration);
1117
+ }
1118
+ }, []);
1119
+ const removeToast = (0, import_react3.useCallback)((id) => {
1120
+ setToasts((prev) => prev.filter((toast) => toast.id !== id));
1121
+ }, []);
1122
+ const success = (0, import_react3.useCallback)((message, duration) => {
1123
+ addToast({ message, type: "success", duration });
1124
+ }, [addToast]);
1125
+ const error = (0, import_react3.useCallback)((message, duration) => {
1126
+ addToast({ message, type: "error", duration });
1127
+ }, [addToast]);
1128
+ const warning = (0, import_react3.useCallback)((message, duration) => {
1129
+ addToast({ message, type: "warning", duration });
1130
+ }, [addToast]);
1131
+ const info = (0, import_react3.useCallback)((message, duration) => {
1132
+ addToast({ message, type: "info", duration });
1133
+ }, [addToast]);
1134
+ const value = {
1135
+ toasts,
1136
+ addToast,
1137
+ removeToast,
1138
+ success,
1139
+ error,
1140
+ warning,
1141
+ info
1142
+ };
1143
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ToastContext.Provider, { value, children });
1144
+ };
1145
+
1146
+ // src/components/ui/Toast.tsx
1147
+ var import_lucide_react2 = require("lucide-react");
1148
+ var import_jsx_runtime5 = require("react/jsx-runtime");
1149
+ var ToastItem = ({ toast }) => {
1150
+ const { removeToast } = useToast();
1151
+ const [isVisible, setIsVisible] = (0, import_react4.useState)(false);
1152
+ const [isLeaving, setIsLeaving] = (0, import_react4.useState)(false);
1153
+ (0, import_react4.useEffect)(() => {
1154
+ const timer = setTimeout(() => setIsVisible(true), 10);
1155
+ return () => clearTimeout(timer);
1156
+ }, []);
1157
+ const handleClose = () => {
1158
+ setIsLeaving(true);
1159
+ setTimeout(() => {
1160
+ removeToast(toast.id);
1161
+ }, 300);
1162
+ };
1163
+ const getIcon = () => {
1164
+ switch (toast.type) {
1165
+ case "success":
1166
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.CheckCircle, { className: "w-5 h-5 text-green-600" });
1167
+ case "error":
1168
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.XCircle, { className: "w-5 h-5 text-red-600" });
1169
+ case "warning":
1170
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.AlertTriangle, { className: "w-5 h-5 text-yellow-600" });
1171
+ case "info":
1172
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.Info, { className: "w-5 h-5 text-blue-600" });
1173
+ }
1174
+ };
1175
+ const getBackgroundColor = () => {
1176
+ switch (toast.type) {
1177
+ case "success":
1178
+ return "bg-green-50 border-green-200";
1179
+ case "error":
1180
+ return "bg-red-50 border-red-200";
1181
+ case "warning":
1182
+ return "bg-yellow-50 border-yellow-200";
1183
+ case "info":
1184
+ return "bg-blue-50 border-blue-200";
1185
+ }
1186
+ };
1187
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
1188
+ "div",
1189
+ {
1190
+ className: `
1191
+ transform transition-all duration-300 ease-in-out
1192
+ ${isVisible && !isLeaving ? "translate-x-0 opacity-100" : "translate-x-full opacity-0"}
1193
+ ${getBackgroundColor()}
1194
+ max-w-sm w-full border rounded-lg p-4 shadow-lg
1195
+ flex items-start space-x-3
1196
+ `,
1197
+ children: [
1198
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-shrink-0", children: getIcon() }),
1199
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "text-sm text-gray-900 font-medium", children: toast.message }) }),
1200
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
1201
+ "button",
1202
+ {
1203
+ onClick: handleClose,
1204
+ className: "flex-shrink-0 ml-4 text-gray-400 hover:text-gray-600 transition-colors",
1205
+ children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_lucide_react2.X, { className: "w-4 h-4" })
1206
+ }
1207
+ )
1208
+ ]
1209
+ }
1210
+ );
1211
+ };
1212
+ var ToastContainer = () => {
1213
+ const { toasts } = useToast();
1214
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fixed top-4 right-4 z-50 space-y-3", children: toasts.map((toast) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ToastItem, { toast }, toast.id)) });
1215
+ };
1216
+ var Toast_default = ToastContainer;
1217
+
1218
+ // src/contexts/SessionContext.tsx
1219
+ var import_react5 = require("react");
1220
+
1221
+ // src/services/api.ts
1222
+ var ADDRESS_IP = "localhost:8000";
1223
+ var ADDRESS_IP_URL = `http://${ADDRESS_IP}/`;
1224
+ var API_URL = `${ADDRESS_IP_URL}api`;
1225
+
1226
+ // src/services/AuthServices.ts
1227
+ var API_BASE_URL = `${API_URL}/core/auth/`;
1228
+ var FetchApi = class {
1229
+ static async post(url, payload, token) {
1230
+ const headers = {
1231
+ "Content-Type": "application/json"
1232
+ };
1233
+ if (token) {
1234
+ headers["Authorization"] = `Token ${token}`;
1235
+ }
1236
+ const res = await fetch(url, {
1237
+ method: "POST",
1238
+ headers,
1239
+ body: payload ? JSON.stringify(payload) : void 0
1240
+ });
1241
+ if (!res.ok) throw new Error(await res.text());
1242
+ return res.json();
1243
+ }
1244
+ static async get(url, token) {
1245
+ const headers = {};
1246
+ if (token) {
1247
+ headers["Authorization"] = `Token ${token}`;
1248
+ }
1249
+ const res = await fetch(url, {
1250
+ method: "GET",
1251
+ headers
1252
+ });
1253
+ if (!res.ok) throw new Error(await res.text());
1254
+ return res.json();
1255
+ }
1256
+ };
1257
+ var AuthServices = {
1258
+ sendOtp: (payload) => FetchApi.post(`${API_BASE_URL}send-otp/`, payload),
1259
+ verifyOtp: (payload) => FetchApi.post(`${API_BASE_URL}verify-otp/`, payload),
1260
+ completeRegistration: (payload) => FetchApi.post(`${API_BASE_URL}complete-registration/`, payload),
1261
+ addUser: (payload) => FetchApi.post(`${API_BASE_URL}add-user/`, payload),
1262
+ login: (payload) => FetchApi.post(`${API_BASE_URL}login/`, payload),
1263
+ getUserInformations: (token) => FetchApi.get(`${API_BASE_URL}user-informations/`, token),
1264
+ logout: () => FetchApi.post(`${API_BASE_URL}logout/`)
1265
+ };
1266
+
1267
+ // src/contexts/SessionContext.tsx
1268
+ var import_jsx_runtime6 = require("react/jsx-runtime");
1269
+ var SessionContext = (0, import_react5.createContext)(void 0);
1270
+ var SessionProvider = ({ children }) => {
1271
+ const [token, setToken] = (0, import_react5.useState)(localStorage.getItem("token"));
1272
+ const [loggedUser, setLoggedUser] = (0, import_react5.useState)(null);
1273
+ (0, import_react5.useEffect)(() => {
1274
+ const storedToken = localStorage.getItem("token");
1275
+ if (storedToken) {
1276
+ setToken(storedToken);
1277
+ }
1278
+ }, []);
1279
+ const login = (newToken) => {
1280
+ localStorage.setItem("token", newToken);
1281
+ setToken(newToken);
1282
+ };
1283
+ const logout = () => {
1284
+ localStorage.removeItem("token");
1285
+ setToken(null);
1286
+ };
1287
+ (0, import_react5.useEffect)(() => {
1288
+ if (token) {
1289
+ AuthServices.getUserInformations(token).then((res) => {
1290
+ const result = res;
1291
+ if (result.success === true) {
1292
+ setLoggedUser(result.data.user);
1293
+ } else {
1294
+ setLoggedUser(null);
1295
+ }
1296
+ }).catch(() => setLoggedUser(null));
1297
+ } else {
1298
+ setLoggedUser(null);
1299
+ }
1300
+ }, [token]);
1301
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionContext.Provider, { value: {
1302
+ isAuthenticated: !!token,
1303
+ loggedUser,
1304
+ token,
1305
+ login,
1306
+ logout
1307
+ }, children });
1308
+ };
1309
+
1310
+ // src/components/common/Pages.tsx
1311
+ var import_lucide_react3 = require("lucide-react");
1312
+ var import_react6 = require("react");
1313
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1314
+ var Pages = ({
1315
+ title = "",
1316
+ description = "",
1317
+ sideAction,
1318
+ sidebar,
1319
+ tabs = [],
1320
+ children
1321
+ }) => {
1322
+ const [sidebarOpen, setSidebarOpen] = (0, import_react6.useState)(false);
1323
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex h-full bg-gray-50", children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 flex flex-col", children: [
1325
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "bg-white border-b border-gray-200 p-6", children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
1327
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1328
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: title }),
1329
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-gray-600", children: description })
1330
+ ] }) }),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center space-x-3", children: sideAction })
1332
+ ] }),
1333
+ tabs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex space-x-1 mt-4 overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1334
+ "button",
1335
+ {
1336
+ className: `px-4 py-2 text-sm rounded-lg transition-all whitespace-nowrap ${tab.id === "manual" ? "bg-[#6A8A82] text-white shadow-md" : "text-gray-600 hover:bg-gray-100"}`,
1337
+ children: tab.label
1338
+ },
1339
+ tab.id
1340
+ )) })
1341
+ ] }),
1342
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-1 p-6 space-y-6", children })
1343
+ ] }),
1344
+ sidebar && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: `${sidebarOpen ? "w-80" : "w-16"} bg-[var(--color-surface)] border-r border-[var(--color-border)] transition-all duration-300 flex flex-col`, children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-4 ", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
1346
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: `font-semibold text-[var(--color-text-primary)] ${!sidebarOpen && "hidden"}`, children: "Classes SYSCOHADA" }),
1347
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1348
+ "button",
1349
+ {
1350
+ onClick: () => setSidebarOpen(!sidebarOpen),
1351
+ className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
1352
+ "aria-label": sidebarOpen ? "R\xE9duire" : "Ouvrir",
1353
+ children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronLeft, { className: "w-5 h-5" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Menu, { className: "w-5 h-5" })
1354
+ }
1355
+ )
1356
+ ] }) }),
1357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-1 overflow-y-auto py-2", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1358
+ "button",
1359
+ {
1360
+ onClick: () => {
1361
+ },
1362
+ className: `w-full flex items-center gap-3 px-4 py-3 transition-all relative group hover:bg-[var(--color-surface-hover)]`,
1363
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1364
+ "div",
1365
+ {
1366
+ className: `flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center transition-colors bg-[var(--color-background)]`,
1367
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-bold text-lg", children: 1 })
1368
+ }
1369
+ )
1370
+ }
1371
+ ) }),
1372
+ sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Download, { className: "w-4 h-4" }),
1375
+ "Exporter le plan"
1376
+ ] }),
1377
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1378
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Settings, { className: "w-4 h-4" }),
1379
+ "Configuration"
1380
+ ] })
1381
+ ] }) })
1382
+ ] })
1383
+ ] });
1384
+ };
1385
+ var Pages_default = Pages;
1386
+ // Annotate the CommonJS export names for ESM import in node:
1387
+ 0 && (module.exports = {
1388
+ Pages,
1389
+ PrimaryButton,
1390
+ RewiseLayout,
1391
+ SecondaryButton,
1392
+ SessionProvider,
1393
+ ThemeProvider,
1394
+ ToastContainer,
1395
+ ToastProvider
1396
+ });