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