ptechcore_ui 1.0.3 → 1.0.5
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 +375 -170
- package/dist/index.d.cts +104 -1
- package/dist/index.d.ts +104 -1
- package/dist/index.js +362 -166
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31,6 +31,186 @@ var SecondaryButton = ({
|
|
|
31
31
|
);
|
|
32
32
|
var Buttons_default = PrimaryButton;
|
|
33
33
|
|
|
34
|
+
// src/components/common/Modals.tsx
|
|
35
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
36
|
+
var Modal = ({ title, description, width, open, onClose, children }) => {
|
|
37
|
+
if (!open) return null;
|
|
38
|
+
return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs("div", { className: `bg-white rounded-lg py-4 px-6 mx-4 w-[${width ? width : "60%"}]`, children: [
|
|
39
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-6", children: [
|
|
40
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
41
|
+
/* @__PURE__ */ jsx2("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx2("span", { children: title }) }),
|
|
42
|
+
description && /* @__PURE__ */ jsx2("p", { className: "text-sm text-gray-600 mt-1", children: description })
|
|
43
|
+
] }),
|
|
44
|
+
/* @__PURE__ */ jsx2(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
onClick: onClose,
|
|
48
|
+
className: "text-gray-400 hover:text-gray-600 text-xl",
|
|
49
|
+
"aria-label": "Close modal",
|
|
50
|
+
children: "\u2715"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }),
|
|
54
|
+
children
|
|
55
|
+
] }) });
|
|
56
|
+
};
|
|
57
|
+
var Modals_default = Modal;
|
|
58
|
+
|
|
59
|
+
// src/components/common/Inputs.tsx
|
|
60
|
+
import { Link } from "react-router-dom";
|
|
61
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
62
|
+
var InputField = ({
|
|
63
|
+
label,
|
|
64
|
+
name,
|
|
65
|
+
type = "text",
|
|
66
|
+
value,
|
|
67
|
+
placeholder,
|
|
68
|
+
required = false,
|
|
69
|
+
disabled = false,
|
|
70
|
+
error,
|
|
71
|
+
onChange,
|
|
72
|
+
onBlur
|
|
73
|
+
}) => {
|
|
74
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1 w-full", children: [
|
|
75
|
+
label && /* @__PURE__ */ jsxs2("label", { htmlFor: name, className: "block text-gray-700 text-sm font-medium mb-2", children: [
|
|
76
|
+
label,
|
|
77
|
+
" ",
|
|
78
|
+
required && /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
|
|
79
|
+
] }),
|
|
80
|
+
/* @__PURE__ */ jsx3(
|
|
81
|
+
"input",
|
|
82
|
+
{
|
|
83
|
+
id: name,
|
|
84
|
+
name,
|
|
85
|
+
type,
|
|
86
|
+
value,
|
|
87
|
+
placeholder,
|
|
88
|
+
required,
|
|
89
|
+
disabled,
|
|
90
|
+
onChange,
|
|
91
|
+
onBlur,
|
|
92
|
+
className: `w-full px-3 py-2 border border-[#D9D9D9] focus:ring-2 focus:ring-[#6A8A82]/20
|
|
93
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
94
|
+
${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
|
|
95
|
+
`
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
error && /* @__PURE__ */ jsx3("p", { className: "text-xs text-red-500", children: error })
|
|
99
|
+
] });
|
|
100
|
+
};
|
|
101
|
+
var TextInput = (props) => {
|
|
102
|
+
return /* @__PURE__ */ jsx3(InputField, { ...props, type: "text" });
|
|
103
|
+
};
|
|
104
|
+
var NumberInput = (props) => {
|
|
105
|
+
return /* @__PURE__ */ jsx3(InputField, { type: "number", ...props });
|
|
106
|
+
};
|
|
107
|
+
var DateInput = (props) => {
|
|
108
|
+
return /* @__PURE__ */ jsx3(InputField, { type: "date", ...props });
|
|
109
|
+
};
|
|
110
|
+
var SelectInput = ({
|
|
111
|
+
label,
|
|
112
|
+
name,
|
|
113
|
+
value,
|
|
114
|
+
options,
|
|
115
|
+
defaultValue = "",
|
|
116
|
+
required = false,
|
|
117
|
+
disabled = false,
|
|
118
|
+
error,
|
|
119
|
+
className = "",
|
|
120
|
+
onChange,
|
|
121
|
+
onBlur
|
|
122
|
+
}) => {
|
|
123
|
+
return /* @__PURE__ */ jsxs2("div", { className: `${className} flex flex-col gap-1 w-full`, children: [
|
|
124
|
+
label && /* @__PURE__ */ jsxs2(
|
|
125
|
+
"label",
|
|
126
|
+
{
|
|
127
|
+
htmlFor: name,
|
|
128
|
+
className: "block text-gray-700 text-sm font-medium mb-2",
|
|
129
|
+
children: [
|
|
130
|
+
label,
|
|
131
|
+
" ",
|
|
132
|
+
required && /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" })
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
/* @__PURE__ */ jsxs2(
|
|
137
|
+
"select",
|
|
138
|
+
{
|
|
139
|
+
id: name,
|
|
140
|
+
name,
|
|
141
|
+
value: value ?? "",
|
|
142
|
+
required,
|
|
143
|
+
disabled,
|
|
144
|
+
onChange,
|
|
145
|
+
onBlur,
|
|
146
|
+
className: `w-full px-4 py-2 border rounded-lg text-sm
|
|
147
|
+
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent
|
|
148
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
149
|
+
${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
|
|
150
|
+
`,
|
|
151
|
+
children: [
|
|
152
|
+
defaultValue !== void 0 && /* @__PURE__ */ jsx3("option", { value: "", children: typeof defaultValue === "string" ? defaultValue : "S\xE9lectionnez une option" }),
|
|
153
|
+
options.map(({ label: label2, value: optionValue }) => /* @__PURE__ */ jsx3("option", { value: optionValue, children: label2 }, optionValue))
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
),
|
|
157
|
+
error && /* @__PURE__ */ jsx3("p", { className: "text-xs text-red-500", children: error })
|
|
158
|
+
] });
|
|
159
|
+
};
|
|
160
|
+
var addressIpformMedia = "http://localhost:8000/media/";
|
|
161
|
+
var FileInput = ({
|
|
162
|
+
label,
|
|
163
|
+
name,
|
|
164
|
+
file,
|
|
165
|
+
required = false,
|
|
166
|
+
disabled = false,
|
|
167
|
+
readOnly = false,
|
|
168
|
+
error,
|
|
169
|
+
onChange
|
|
170
|
+
}) => {
|
|
171
|
+
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-col gap-1 w-full", children: [
|
|
172
|
+
label && /* @__PURE__ */ jsxs2(
|
|
173
|
+
"label",
|
|
174
|
+
{
|
|
175
|
+
htmlFor: name,
|
|
176
|
+
className: "block text-gray-700 text-sm font-medium mb-2",
|
|
177
|
+
children: [
|
|
178
|
+
label,
|
|
179
|
+
" ",
|
|
180
|
+
required && /* @__PURE__ */ jsx3("span", { className: "text-red-500", children: "*" }),
|
|
181
|
+
file && typeof file === "string" && /* @__PURE__ */ jsx3("div", { children: /* @__PURE__ */ jsx3(
|
|
182
|
+
Link,
|
|
183
|
+
{
|
|
184
|
+
to: addressIpformMedia + file,
|
|
185
|
+
target: "_blank",
|
|
186
|
+
className: "ml-2 text-blue-600 underline text-sm",
|
|
187
|
+
children: file.split("/").pop()
|
|
188
|
+
}
|
|
189
|
+
) })
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
),
|
|
193
|
+
/* @__PURE__ */ jsx3(
|
|
194
|
+
"input",
|
|
195
|
+
{
|
|
196
|
+
id: name,
|
|
197
|
+
type: "file",
|
|
198
|
+
name,
|
|
199
|
+
onChange,
|
|
200
|
+
readOnly,
|
|
201
|
+
disabled,
|
|
202
|
+
required,
|
|
203
|
+
className: `w-full px-4 py-2 border rounded-lg text-sm
|
|
204
|
+
focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent
|
|
205
|
+
${error ? "border-red-500" : "border-gray-300"}
|
|
206
|
+
${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
|
|
207
|
+
`
|
|
208
|
+
}
|
|
209
|
+
),
|
|
210
|
+
error && /* @__PURE__ */ jsx3("p", { className: "text-xs text-red-500", children: error })
|
|
211
|
+
] });
|
|
212
|
+
};
|
|
213
|
+
|
|
34
214
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
35
215
|
import React2, { useState as useState2, useEffect as useEffect2 } from "react";
|
|
36
216
|
import { useLocation, useNavigate } from "react-router-dom";
|
|
@@ -389,7 +569,7 @@ var getThemeCSSVariables = (theme) => {
|
|
|
389
569
|
};
|
|
390
570
|
|
|
391
571
|
// src/contexts/ThemeContext.tsx
|
|
392
|
-
import { jsx as
|
|
572
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
393
573
|
var ThemeContext = createContext(void 0);
|
|
394
574
|
var useTheme = () => {
|
|
395
575
|
const context = useContext(ThemeContext);
|
|
@@ -420,12 +600,12 @@ var ThemeProvider = ({ children }) => {
|
|
|
420
600
|
setThemeState(themes[type]);
|
|
421
601
|
}
|
|
422
602
|
};
|
|
423
|
-
return /* @__PURE__ */
|
|
603
|
+
return /* @__PURE__ */ jsx4(ThemeContext.Provider, { value: { theme, themeType, setTheme }, children });
|
|
424
604
|
};
|
|
425
605
|
var ThemeContext_default = ThemeProvider;
|
|
426
606
|
|
|
427
607
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
428
|
-
import { Fragment, jsx as
|
|
608
|
+
import { Fragment, jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
429
609
|
var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
|
|
430
610
|
const location = useLocation();
|
|
431
611
|
const navigate = useNavigate();
|
|
@@ -511,8 +691,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
511
691
|
(prev) => prev.map((n) => n.id === id ? { ...n, read: true } : n)
|
|
512
692
|
);
|
|
513
693
|
};
|
|
514
|
-
return /* @__PURE__ */
|
|
515
|
-
/* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex h-screen bg-[var(--color-background)] overflow-hidden", children: [
|
|
695
|
+
/* @__PURE__ */ jsx5(
|
|
516
696
|
"a",
|
|
517
697
|
{
|
|
518
698
|
href: "#main-content",
|
|
@@ -520,7 +700,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
520
700
|
children: "Aller au contenu principal"
|
|
521
701
|
}
|
|
522
702
|
),
|
|
523
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ jsxs3(
|
|
524
704
|
"aside",
|
|
525
705
|
{
|
|
526
706
|
className: cn(
|
|
@@ -530,38 +710,38 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
530
710
|
role: "navigation",
|
|
531
711
|
"aria-label": "Navigation principale",
|
|
532
712
|
children: [
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
/* @__PURE__ */
|
|
713
|
+
/* @__PURE__ */ jsxs3("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
|
|
714
|
+
/* @__PURE__ */ jsxs3("div", { className: cn(
|
|
535
715
|
"flex items-center gap-3",
|
|
536
716
|
primaryCollapsed && "justify-center"
|
|
537
717
|
), children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
540
|
-
/* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx5("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
|
|
719
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs3("div", { children: [
|
|
720
|
+
/* @__PURE__ */ jsx5("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: module_name }),
|
|
721
|
+
/* @__PURE__ */ jsx5("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: module_description })
|
|
542
722
|
] })
|
|
543
723
|
] }),
|
|
544
|
-
/* @__PURE__ */
|
|
724
|
+
/* @__PURE__ */ jsx5(
|
|
545
725
|
"button",
|
|
546
726
|
{
|
|
547
727
|
onClick: () => setPrimaryCollapsed(!primaryCollapsed),
|
|
548
728
|
className: "text-[var(--color-sidebar-text-secondary)] hover:text-[var(--color-sidebar-text)] transition-colors",
|
|
549
729
|
"aria-label": primaryCollapsed ? "D\xE9velopper le menu" : "R\xE9duire le menu",
|
|
550
730
|
"aria-expanded": !primaryCollapsed,
|
|
551
|
-
children: /* @__PURE__ */
|
|
731
|
+
children: /* @__PURE__ */ jsx5(ChevronLeft, { className: cn(
|
|
552
732
|
"w-5 h-5 transition-transform",
|
|
553
733
|
primaryCollapsed && "rotate-180"
|
|
554
734
|
) })
|
|
555
735
|
}
|
|
556
736
|
)
|
|
557
737
|
] }),
|
|
558
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx5(
|
|
559
739
|
"nav",
|
|
560
740
|
{
|
|
561
741
|
className: "flex-1 py-4 overflow-y-auto",
|
|
562
742
|
role: "menubar",
|
|
563
743
|
"aria-label": "Modules principaux",
|
|
564
|
-
children: primaryMenuItems.map((item) => /* @__PURE__ */
|
|
744
|
+
children: primaryMenuItems.map((item) => /* @__PURE__ */ jsxs3(
|
|
565
745
|
"button",
|
|
566
746
|
{
|
|
567
747
|
onClick: () => {
|
|
@@ -581,48 +761,48 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
581
761
|
"aria-label": item.ariaLabel || item.label,
|
|
582
762
|
"aria-current": isModuleActive(item.id) ? "page" : void 0,
|
|
583
763
|
children: [
|
|
584
|
-
/* @__PURE__ */
|
|
764
|
+
/* @__PURE__ */ jsx5("div", { className: cn(
|
|
585
765
|
"transition-colors",
|
|
586
766
|
isModuleActive(item.id) ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
|
|
587
767
|
), children: item.icon }),
|
|
588
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
589
|
-
/* @__PURE__ */
|
|
768
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
769
|
+
/* @__PURE__ */ jsx5("span", { className: cn(
|
|
590
770
|
"flex-1 text-left text-sm font-medium transition-colors",
|
|
591
771
|
isModuleActive(item.id) ? "text-[var(--color-sidebar-text)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
|
|
592
772
|
), children: item.label }),
|
|
593
|
-
item.badge && /* @__PURE__ */
|
|
773
|
+
item.badge && /* @__PURE__ */ jsx5("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-[var(--color-background)] rounded-full", children: item.badge })
|
|
594
774
|
] }),
|
|
595
|
-
primaryCollapsed && /* @__PURE__ */
|
|
775
|
+
primaryCollapsed && /* @__PURE__ */ jsx5("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 })
|
|
596
776
|
]
|
|
597
777
|
},
|
|
598
778
|
item.id
|
|
599
779
|
))
|
|
600
780
|
}
|
|
601
781
|
),
|
|
602
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ jsx5("div", { className: "p-4 border-t border-[var(--color-sidebar-border)]", children: /* @__PURE__ */ jsxs3("div", { className: cn(
|
|
603
783
|
"flex items-center gap-3",
|
|
604
784
|
primaryCollapsed && "justify-center"
|
|
605
785
|
), children: [
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
608
|
-
/* @__PURE__ */
|
|
609
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 bg-[var(--color-sidebar-avatar-bg)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx5(User, { className: "w-5 h-5 text-[var(--color-sidebar-text-secondary)]" }) }),
|
|
787
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs3("div", { className: "flex-1", children: [
|
|
788
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-medium text-[var(--color-sidebar-text)]", children: "Admin" }),
|
|
789
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-sidebar-text-secondary)]", children: "admin@wisebook.com" })
|
|
610
790
|
] })
|
|
611
791
|
] }) })
|
|
612
792
|
]
|
|
613
793
|
}
|
|
614
794
|
),
|
|
615
|
-
secondaryMenuItems[selectedModule] && /* @__PURE__ */
|
|
616
|
-
secondaryCollapsed && /* @__PURE__ */
|
|
795
|
+
secondaryMenuItems[selectedModule] && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
796
|
+
secondaryCollapsed && /* @__PURE__ */ jsx5(
|
|
617
797
|
"button",
|
|
618
798
|
{
|
|
619
799
|
onClick: () => setSecondaryCollapsed(false),
|
|
620
800
|
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",
|
|
621
801
|
"aria-label": "Ouvrir le sous-menu",
|
|
622
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ jsx5(ChevronRight, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
623
803
|
}
|
|
624
804
|
),
|
|
625
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ jsxs3(
|
|
626
806
|
"aside",
|
|
627
807
|
{
|
|
628
808
|
className: cn(
|
|
@@ -632,28 +812,28 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
632
812
|
role: "navigation",
|
|
633
813
|
"aria-label": "Navigation secondaire",
|
|
634
814
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
/* @__PURE__ */
|
|
637
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ jsxs3("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-border)]", children: [
|
|
816
|
+
/* @__PURE__ */ jsx5("h2", { className: "text-sm font-semibold text-[var(--color-text-secondary)] uppercase tracking-wider whitespace-nowrap", children: primaryMenuItems.find((item) => item.id === selectedModule)?.label }),
|
|
817
|
+
/* @__PURE__ */ jsx5(
|
|
638
818
|
"button",
|
|
639
819
|
{
|
|
640
820
|
onClick: () => setSecondaryCollapsed(!secondaryCollapsed),
|
|
641
821
|
className: "text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] flex-shrink-0",
|
|
642
822
|
"aria-label": secondaryCollapsed ? "D\xE9velopper le sous-menu" : "R\xE9duire le sous-menu",
|
|
643
|
-
children: /* @__PURE__ */
|
|
823
|
+
children: /* @__PURE__ */ jsx5(ChevronLeft, { className: cn(
|
|
644
824
|
"w-4 h-4 transition-transform",
|
|
645
825
|
secondaryCollapsed && "rotate-180"
|
|
646
826
|
) })
|
|
647
827
|
}
|
|
648
828
|
)
|
|
649
829
|
] }),
|
|
650
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ jsx5(
|
|
651
831
|
"nav",
|
|
652
832
|
{
|
|
653
833
|
className: "flex-1 py-4 overflow-y-auto",
|
|
654
834
|
role: "menu",
|
|
655
835
|
"aria-label": "Sous-navigation",
|
|
656
|
-
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */
|
|
836
|
+
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */ jsxs3(
|
|
657
837
|
"button",
|
|
658
838
|
{
|
|
659
839
|
onClick: () => item.path && navigate(item.path),
|
|
@@ -665,15 +845,15 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
665
845
|
role: "menuitem",
|
|
666
846
|
"aria-current": isActive(item.path || "") ? "page" : void 0,
|
|
667
847
|
children: [
|
|
668
|
-
item.icon && /* @__PURE__ */
|
|
848
|
+
item.icon && /* @__PURE__ */ jsx5("div", { className: cn(
|
|
669
849
|
"transition-colors",
|
|
670
850
|
isActive(item.path || "") ? "text-[var(--color-primary)]" : "text-[var(--color-text-tertiary)]"
|
|
671
851
|
), children: item.icon }),
|
|
672
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ jsx5("span", { className: cn(
|
|
673
853
|
"flex-1 text-left text-sm",
|
|
674
854
|
isActive(item.path || "") ? "text-[var(--color-primary)] font-medium" : "text-[var(--color-text-secondary)]"
|
|
675
855
|
), children: item.label }),
|
|
676
|
-
item.badge && /* @__PURE__ */
|
|
856
|
+
item.badge && /* @__PURE__ */ jsx5("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-white rounded-full", children: item.badge })
|
|
677
857
|
]
|
|
678
858
|
},
|
|
679
859
|
item.id
|
|
@@ -684,13 +864,13 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
684
864
|
}
|
|
685
865
|
)
|
|
686
866
|
] }),
|
|
687
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
867
|
+
mobileMenuOpen && /* @__PURE__ */ jsx5(
|
|
688
868
|
"div",
|
|
689
869
|
{
|
|
690
870
|
className: "fixed inset-0 bg-black bg-opacity-50 z-50 lg:hidden",
|
|
691
871
|
onClick: () => setMobileMenuOpen(false),
|
|
692
872
|
"aria-hidden": "true",
|
|
693
|
-
children: /* @__PURE__ */
|
|
873
|
+
children: /* @__PURE__ */ jsxs3(
|
|
694
874
|
"aside",
|
|
695
875
|
{
|
|
696
876
|
className: "w-80 h-full bg-[var(--color-sidebar-bg)]",
|
|
@@ -698,26 +878,26 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
698
878
|
role: "navigation",
|
|
699
879
|
"aria-label": "Navigation mobile",
|
|
700
880
|
children: [
|
|
701
|
-
/* @__PURE__ */
|
|
702
|
-
/* @__PURE__ */
|
|
703
|
-
/* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
706
|
-
/* @__PURE__ */
|
|
881
|
+
/* @__PURE__ */ jsxs3("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
|
|
882
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
883
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx5("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
|
|
884
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
885
|
+
/* @__PURE__ */ jsx5("h1", { className: "text-white font-bold text-lg", children: "WiseBook" }),
|
|
886
|
+
/* @__PURE__ */ jsx5("p", { className: "text-gray-400 text-xs", children: "ERP Next-Gen" })
|
|
707
887
|
] })
|
|
708
888
|
] }),
|
|
709
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ jsx5(
|
|
710
890
|
"button",
|
|
711
891
|
{
|
|
712
892
|
onClick: () => setMobileMenuOpen(false),
|
|
713
893
|
className: "text-[var(--color-sidebar-text-secondary)]",
|
|
714
894
|
"aria-label": "Fermer le menu",
|
|
715
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ jsx5(X, { className: "w-6 h-6" })
|
|
716
896
|
}
|
|
717
897
|
)
|
|
718
898
|
] }),
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ jsx5("nav", { className: "py-4", role: "menubar", children: primaryMenuItems.map((item) => /* @__PURE__ */ jsxs3("div", { children: [
|
|
900
|
+
/* @__PURE__ */ jsxs3(
|
|
721
901
|
"button",
|
|
722
902
|
{
|
|
723
903
|
onClick: () => {
|
|
@@ -736,19 +916,19 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
736
916
|
role: "menuitem",
|
|
737
917
|
"aria-current": isModuleActive(item.id) ? "page" : void 0,
|
|
738
918
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
919
|
+
/* @__PURE__ */ jsx5("div", { className: cn(
|
|
740
920
|
"transition-colors",
|
|
741
921
|
isModuleActive(item.id) ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)]"
|
|
742
922
|
), children: item.icon }),
|
|
743
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ jsx5("span", { className: cn(
|
|
744
924
|
"flex-1 text-left text-sm font-medium",
|
|
745
925
|
isModuleActive(item.id) ? "text-[var(--color-sidebar-text)]" : "text-[var(--color-sidebar-text-secondary)]"
|
|
746
926
|
), children: item.label }),
|
|
747
|
-
item.badge && /* @__PURE__ */
|
|
927
|
+
item.badge && /* @__PURE__ */ jsx5("span", { className: "px-2 py-0.5 text-xs bg-[var(--color-primary)] text-[var(--color-background)] rounded-full", children: item.badge })
|
|
748
928
|
]
|
|
749
929
|
}
|
|
750
930
|
),
|
|
751
|
-
isModuleActive(item.id) && secondaryMenuItems[item.id] && /* @__PURE__ */
|
|
931
|
+
isModuleActive(item.id) && secondaryMenuItems[item.id] && /* @__PURE__ */ jsx5("div", { className: "bg-[var(--color-sidebar-submenu-bg)] py-2", children: secondaryMenuItems[item.id].map((subItem) => /* @__PURE__ */ jsxs3(
|
|
752
932
|
"button",
|
|
753
933
|
{
|
|
754
934
|
onClick: () => {
|
|
@@ -764,7 +944,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
764
944
|
),
|
|
765
945
|
children: [
|
|
766
946
|
subItem.icon,
|
|
767
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ jsx5("span", { className: cn(
|
|
768
948
|
isActive(subItem.path || "") ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)]"
|
|
769
949
|
), children: subItem.label })
|
|
770
950
|
]
|
|
@@ -777,31 +957,31 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
777
957
|
)
|
|
778
958
|
}
|
|
779
959
|
),
|
|
780
|
-
/* @__PURE__ */
|
|
781
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
961
|
+
/* @__PURE__ */ jsxs3(
|
|
782
962
|
"header",
|
|
783
963
|
{
|
|
784
964
|
className: "h-14 bg-[var(--color-background)] border-b border-[var(--color-border)] flex items-center justify-between px-3 lg:px-4",
|
|
785
965
|
role: "banner",
|
|
786
966
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
967
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-4 flex-1", children: [
|
|
968
|
+
/* @__PURE__ */ jsx5(
|
|
789
969
|
"button",
|
|
790
970
|
{
|
|
791
971
|
onClick: () => setMobileMenuOpen(true),
|
|
792
972
|
className: "lg:hidden text-[var(--color-text-primary)]",
|
|
793
973
|
"aria-label": "Ouvrir le menu mobile",
|
|
794
|
-
children: /* @__PURE__ */
|
|
974
|
+
children: /* @__PURE__ */ jsx5(Menu, { className: "w-6 h-6" })
|
|
795
975
|
}
|
|
796
976
|
),
|
|
797
|
-
/* @__PURE__ */
|
|
977
|
+
/* @__PURE__ */ jsx5(
|
|
798
978
|
"nav",
|
|
799
979
|
{
|
|
800
980
|
className: "hidden sm:flex items-center gap-2 text-sm",
|
|
801
981
|
"aria-label": "Fil d'Ariane",
|
|
802
|
-
children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */
|
|
803
|
-
index > 0 && /* @__PURE__ */
|
|
804
|
-
/* @__PURE__ */
|
|
982
|
+
children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */ jsxs3(React2.Fragment, { children: [
|
|
983
|
+
index > 0 && /* @__PURE__ */ jsx5(ChevronRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }),
|
|
984
|
+
/* @__PURE__ */ jsx5(
|
|
805
985
|
"button",
|
|
806
986
|
{
|
|
807
987
|
onClick: () => navigate(crumb.path),
|
|
@@ -815,9 +995,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
815
995
|
] }, crumb.path))
|
|
816
996
|
}
|
|
817
997
|
),
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative max-w-md flex-1 hidden lg:block", children: [
|
|
999
|
+
/* @__PURE__ */ jsx5(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] w-5 h-5" }),
|
|
1000
|
+
/* @__PURE__ */ jsx5(
|
|
821
1001
|
"input",
|
|
822
1002
|
{
|
|
823
1003
|
id: "global-search",
|
|
@@ -831,9 +1011,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
831
1011
|
)
|
|
832
1012
|
] })
|
|
833
1013
|
] }),
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
836
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center gap-3", children: [
|
|
1015
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
1016
|
+
/* @__PURE__ */ jsx5(
|
|
837
1017
|
"button",
|
|
838
1018
|
{
|
|
839
1019
|
onClick: () => setShowThemeMenu(!showThemeMenu),
|
|
@@ -841,18 +1021,18 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
841
1021
|
title: "Changer le th\xE8me",
|
|
842
1022
|
"aria-label": "S\xE9lecteur de th\xE8me",
|
|
843
1023
|
"aria-expanded": showThemeMenu,
|
|
844
|
-
children: /* @__PURE__ */
|
|
1024
|
+
children: /* @__PURE__ */ jsx5(Palette, { className: "w-5 h-5 text-[var(--color-text-secondary)]" })
|
|
845
1025
|
}
|
|
846
1026
|
),
|
|
847
|
-
showThemeMenu && /* @__PURE__ */
|
|
1027
|
+
showThemeMenu && /* @__PURE__ */ jsx5(
|
|
848
1028
|
"div",
|
|
849
1029
|
{
|
|
850
1030
|
className: "absolute right-0 mt-2 w-64 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
|
|
851
1031
|
role: "menu",
|
|
852
1032
|
"aria-label": "S\xE9lection du th\xE8me",
|
|
853
|
-
children: /* @__PURE__ */
|
|
854
|
-
/* @__PURE__ */
|
|
855
|
-
/* @__PURE__ */
|
|
1033
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "p-2", children: [
|
|
1034
|
+
/* @__PURE__ */ jsx5("p", { className: "px-3 py-2 text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Th\xE8mes disponibles" }),
|
|
1035
|
+
/* @__PURE__ */ jsxs3(
|
|
856
1036
|
"button",
|
|
857
1037
|
{
|
|
858
1038
|
onClick: () => handleThemeChange("elegant"),
|
|
@@ -862,15 +1042,15 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
862
1042
|
),
|
|
863
1043
|
role: "menuitem",
|
|
864
1044
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
/* @__PURE__ */
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)]" }),
|
|
1046
|
+
/* @__PURE__ */ jsxs3("div", { className: "text-left", children: [
|
|
1047
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-medium", children: "\xC9l\xE9gance Sobre" }),
|
|
1048
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Finance traditionnelle" })
|
|
869
1049
|
] })
|
|
870
1050
|
]
|
|
871
1051
|
}
|
|
872
1052
|
),
|
|
873
|
-
/* @__PURE__ */
|
|
1053
|
+
/* @__PURE__ */ jsxs3(
|
|
874
1054
|
"button",
|
|
875
1055
|
{
|
|
876
1056
|
onClick: () => handleThemeChange("fintech"),
|
|
@@ -880,15 +1060,15 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
880
1060
|
),
|
|
881
1061
|
role: "menuitem",
|
|
882
1062
|
children: [
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
-
/* @__PURE__ */
|
|
885
|
-
/* @__PURE__ */
|
|
886
|
-
/* @__PURE__ */
|
|
1063
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-success)] to-[var(--color-text-primary)]" }),
|
|
1064
|
+
/* @__PURE__ */ jsxs3("div", { className: "text-left", children: [
|
|
1065
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-medium", children: "Modern Fintech" }),
|
|
1066
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Tableau de bord moderne" })
|
|
887
1067
|
] })
|
|
888
1068
|
]
|
|
889
1069
|
}
|
|
890
1070
|
),
|
|
891
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ jsxs3(
|
|
892
1072
|
"button",
|
|
893
1073
|
{
|
|
894
1074
|
onClick: () => handleThemeChange("minimalist"),
|
|
@@ -898,10 +1078,10 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
898
1078
|
),
|
|
899
1079
|
role: "menuitem",
|
|
900
1080
|
children: [
|
|
901
|
-
/* @__PURE__ */
|
|
902
|
-
/* @__PURE__ */
|
|
903
|
-
/* @__PURE__ */
|
|
904
|
-
/* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx5("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-text-secondary)] to-[var(--color-accent)]" }),
|
|
1082
|
+
/* @__PURE__ */ jsxs3("div", { className: "text-left", children: [
|
|
1083
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-medium", children: "Minimaliste Premium" }),
|
|
1084
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "\xC9l\xE9gance minimaliste" })
|
|
905
1085
|
] })
|
|
906
1086
|
]
|
|
907
1087
|
}
|
|
@@ -910,12 +1090,12 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
910
1090
|
}
|
|
911
1091
|
)
|
|
912
1092
|
] }),
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center px-3 py-1.5 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
|
|
1094
|
+
/* @__PURE__ */ jsx5(DollarSign, { className: "w-4 h-4 text-[var(--color-primary)] mr-2" }),
|
|
1095
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "FCFA" })
|
|
916
1096
|
] }),
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
1098
|
+
/* @__PURE__ */ jsxs3(
|
|
919
1099
|
"button",
|
|
920
1100
|
{
|
|
921
1101
|
className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
@@ -923,20 +1103,20 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
923
1103
|
"aria-label": `Notifications ${notifications.filter((n) => !n.read).length > 0 ? `(${notifications.filter((n) => !n.read).length} non lues)` : ""}`,
|
|
924
1104
|
"aria-expanded": showNotifications,
|
|
925
1105
|
children: [
|
|
926
|
-
/* @__PURE__ */
|
|
927
|
-
notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ jsx5(Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
|
|
1107
|
+
notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */ jsx5("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
|
|
928
1108
|
]
|
|
929
1109
|
}
|
|
930
1110
|
),
|
|
931
|
-
showNotifications && /* @__PURE__ */
|
|
1111
|
+
showNotifications && /* @__PURE__ */ jsxs3(
|
|
932
1112
|
"div",
|
|
933
1113
|
{
|
|
934
1114
|
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",
|
|
935
1115
|
role: "region",
|
|
936
1116
|
"aria-label": "Centre de notifications",
|
|
937
1117
|
children: [
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsx5("div", { className: "p-4 border-b border-[var(--color-border)]", children: /* @__PURE__ */ jsx5("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Notifications" }) }),
|
|
1119
|
+
/* @__PURE__ */ jsx5("div", { className: "divide-y divide-[var(--color-border)]", children: notifications.map((notif) => /* @__PURE__ */ jsx5(
|
|
940
1120
|
"div",
|
|
941
1121
|
{
|
|
942
1122
|
className: cn(
|
|
@@ -944,18 +1124,18 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
944
1124
|
!notif.read && "bg-[var(--color-primary-light)] bg-opacity-10"
|
|
945
1125
|
),
|
|
946
1126
|
onClick: () => markNotificationAsRead(notif.id),
|
|
947
|
-
children: /* @__PURE__ */
|
|
948
|
-
/* @__PURE__ */
|
|
1127
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-3", children: [
|
|
1128
|
+
/* @__PURE__ */ jsx5("div", { className: cn(
|
|
949
1129
|
"w-2 h-2 rounded-full mt-2",
|
|
950
1130
|
notif.type === "error" && "bg-[var(--color-error)]",
|
|
951
1131
|
notif.type === "warning" && "bg-[var(--color-warning)]",
|
|
952
1132
|
notif.type === "success" && "bg-[var(--color-success)]",
|
|
953
1133
|
notif.type === "info" && "bg-[var(--color-info)]"
|
|
954
1134
|
) }),
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
/* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
1135
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1", children: [
|
|
1136
|
+
/* @__PURE__ */ jsx5("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: notif.title }),
|
|
1137
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
|
|
1138
|
+
/* @__PURE__ */ jsx5("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2", children: notif.timestamp.toLocaleTimeString() })
|
|
959
1139
|
] })
|
|
960
1140
|
] })
|
|
961
1141
|
},
|
|
@@ -965,36 +1145,36 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
965
1145
|
}
|
|
966
1146
|
)
|
|
967
1147
|
] }),
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
/* @__PURE__ */
|
|
1148
|
+
/* @__PURE__ */ jsxs3("div", { className: "relative", children: [
|
|
1149
|
+
/* @__PURE__ */ jsx5(
|
|
970
1150
|
"button",
|
|
971
1151
|
{
|
|
972
1152
|
onClick: () => setShowUserMenu(!showUserMenu),
|
|
973
1153
|
className: "flex items-center gap-2 p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
974
1154
|
"aria-label": "Menu utilisateur",
|
|
975
1155
|
"aria-expanded": showUserMenu,
|
|
976
|
-
children: /* @__PURE__ */
|
|
1156
|
+
children: /* @__PURE__ */ jsx5("div", { className: "w-8 h-8 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx5(User, { className: "w-4 h-4 text-[var(--color-background)]" }) })
|
|
977
1157
|
}
|
|
978
1158
|
),
|
|
979
|
-
showUserMenu && /* @__PURE__ */
|
|
1159
|
+
showUserMenu && /* @__PURE__ */ jsx5(
|
|
980
1160
|
"div",
|
|
981
1161
|
{
|
|
982
1162
|
className: "absolute right-0 mt-2 w-56 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
|
|
983
1163
|
role: "menu",
|
|
984
1164
|
"aria-label": "Menu utilisateur",
|
|
985
|
-
children: /* @__PURE__ */
|
|
986
|
-
/* @__PURE__ */
|
|
1165
|
+
children: /* @__PURE__ */ jsxs3("div", { className: "p-2", children: [
|
|
1166
|
+
/* @__PURE__ */ jsxs3(
|
|
987
1167
|
"button",
|
|
988
1168
|
{
|
|
989
1169
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
990
1170
|
role: "menuitem",
|
|
991
1171
|
children: [
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ jsx5(User, { className: "w-4 h-4" }),
|
|
1173
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm", children: "Mon profil" })
|
|
994
1174
|
]
|
|
995
1175
|
}
|
|
996
1176
|
),
|
|
997
|
-
/* @__PURE__ */
|
|
1177
|
+
/* @__PURE__ */ jsxs3(
|
|
998
1178
|
"button",
|
|
999
1179
|
{
|
|
1000
1180
|
onClick: () => {
|
|
@@ -1004,31 +1184,31 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1004
1184
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
1005
1185
|
role: "menuitem",
|
|
1006
1186
|
children: [
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1187
|
+
/* @__PURE__ */ jsx5(Settings, { className: "w-4 h-4" }),
|
|
1188
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm", children: "Param\xE8tres" })
|
|
1009
1189
|
]
|
|
1010
1190
|
}
|
|
1011
1191
|
),
|
|
1012
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ jsxs3(
|
|
1013
1193
|
"button",
|
|
1014
1194
|
{
|
|
1015
1195
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
1016
1196
|
role: "menuitem",
|
|
1017
1197
|
children: [
|
|
1018
|
-
/* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ jsx5(HelpCircle, { className: "w-4 h-4" }),
|
|
1199
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm", children: "Aide" })
|
|
1020
1200
|
]
|
|
1021
1201
|
}
|
|
1022
1202
|
),
|
|
1023
|
-
/* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1203
|
+
/* @__PURE__ */ jsx5("hr", { className: "my-2 border-[var(--color-border)]" }),
|
|
1204
|
+
/* @__PURE__ */ jsxs3(
|
|
1025
1205
|
"button",
|
|
1026
1206
|
{
|
|
1027
1207
|
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",
|
|
1028
1208
|
role: "menuitem",
|
|
1029
1209
|
children: [
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1210
|
+
/* @__PURE__ */ jsx5(LogOut, { className: "w-4 h-4" }),
|
|
1211
|
+
/* @__PURE__ */ jsx5("span", { className: "text-sm", children: "D\xE9connexion" })
|
|
1032
1212
|
]
|
|
1033
1213
|
}
|
|
1034
1214
|
)
|
|
@@ -1040,13 +1220,13 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1040
1220
|
]
|
|
1041
1221
|
}
|
|
1042
1222
|
),
|
|
1043
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ jsx5(
|
|
1044
1224
|
"main",
|
|
1045
1225
|
{
|
|
1046
1226
|
id: "main-content",
|
|
1047
1227
|
className: "flex-1 overflow-y-auto bg-[var(--color-background)]",
|
|
1048
1228
|
role: "main",
|
|
1049
|
-
children: /* @__PURE__ */
|
|
1229
|
+
children: /* @__PURE__ */ jsx5("div", { className: "p-3 lg:p-4", children })
|
|
1050
1230
|
}
|
|
1051
1231
|
)
|
|
1052
1232
|
] })
|
|
@@ -1059,7 +1239,7 @@ import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
|
1059
1239
|
|
|
1060
1240
|
// src/contexts/ToastContext.tsx
|
|
1061
1241
|
import { createContext as createContext2, useContext as useContext2, useState as useState3, useCallback } from "react";
|
|
1062
|
-
import { jsx as
|
|
1242
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1063
1243
|
var ToastContext = createContext2(void 0);
|
|
1064
1244
|
var useToast = () => {
|
|
1065
1245
|
const context = useContext2(ToastContext);
|
|
@@ -1111,12 +1291,12 @@ var ToastProvider = ({ children }) => {
|
|
|
1111
1291
|
warning,
|
|
1112
1292
|
info
|
|
1113
1293
|
};
|
|
1114
|
-
return /* @__PURE__ */
|
|
1294
|
+
return /* @__PURE__ */ jsx6(ToastContext.Provider, { value, children });
|
|
1115
1295
|
};
|
|
1116
1296
|
|
|
1117
1297
|
// src/components/ui/Toast.tsx
|
|
1118
1298
|
import { CheckCircle, XCircle, AlertTriangle, Info, X as X2 } from "lucide-react";
|
|
1119
|
-
import { jsx as
|
|
1299
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1120
1300
|
var ToastItem = ({ toast }) => {
|
|
1121
1301
|
const { removeToast } = useToast();
|
|
1122
1302
|
const [isVisible, setIsVisible] = useState4(false);
|
|
@@ -1134,13 +1314,13 @@ var ToastItem = ({ toast }) => {
|
|
|
1134
1314
|
const getIcon = () => {
|
|
1135
1315
|
switch (toast.type) {
|
|
1136
1316
|
case "success":
|
|
1137
|
-
return /* @__PURE__ */
|
|
1317
|
+
return /* @__PURE__ */ jsx7(CheckCircle, { className: "w-5 h-5 text-green-600" });
|
|
1138
1318
|
case "error":
|
|
1139
|
-
return /* @__PURE__ */
|
|
1319
|
+
return /* @__PURE__ */ jsx7(XCircle, { className: "w-5 h-5 text-red-600" });
|
|
1140
1320
|
case "warning":
|
|
1141
|
-
return /* @__PURE__ */
|
|
1321
|
+
return /* @__PURE__ */ jsx7(AlertTriangle, { className: "w-5 h-5 text-yellow-600" });
|
|
1142
1322
|
case "info":
|
|
1143
|
-
return /* @__PURE__ */
|
|
1323
|
+
return /* @__PURE__ */ jsx7(Info, { className: "w-5 h-5 text-blue-600" });
|
|
1144
1324
|
}
|
|
1145
1325
|
};
|
|
1146
1326
|
const getBackgroundColor = () => {
|
|
@@ -1155,7 +1335,7 @@ var ToastItem = ({ toast }) => {
|
|
|
1155
1335
|
return "bg-blue-50 border-blue-200";
|
|
1156
1336
|
}
|
|
1157
1337
|
};
|
|
1158
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsxs4(
|
|
1159
1339
|
"div",
|
|
1160
1340
|
{
|
|
1161
1341
|
className: `
|
|
@@ -1166,14 +1346,14 @@ var ToastItem = ({ toast }) => {
|
|
|
1166
1346
|
flex items-start space-x-3
|
|
1167
1347
|
`,
|
|
1168
1348
|
children: [
|
|
1169
|
-
/* @__PURE__ */
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1349
|
+
/* @__PURE__ */ jsx7("div", { className: "flex-shrink-0", children: getIcon() }),
|
|
1350
|
+
/* @__PURE__ */ jsx7("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx7("p", { className: "text-sm text-gray-900 font-medium", children: toast.message }) }),
|
|
1351
|
+
/* @__PURE__ */ jsx7(
|
|
1172
1352
|
"button",
|
|
1173
1353
|
{
|
|
1174
1354
|
onClick: handleClose,
|
|
1175
1355
|
className: "flex-shrink-0 ml-4 text-gray-400 hover:text-gray-600 transition-colors",
|
|
1176
|
-
children: /* @__PURE__ */
|
|
1356
|
+
children: /* @__PURE__ */ jsx7(X2, { className: "w-4 h-4" })
|
|
1177
1357
|
}
|
|
1178
1358
|
)
|
|
1179
1359
|
]
|
|
@@ -1182,7 +1362,7 @@ var ToastItem = ({ toast }) => {
|
|
|
1182
1362
|
};
|
|
1183
1363
|
var ToastContainer = () => {
|
|
1184
1364
|
const { toasts } = useToast();
|
|
1185
|
-
return /* @__PURE__ */
|
|
1365
|
+
return /* @__PURE__ */ jsx7("div", { className: "fixed top-4 right-4 z-50 space-y-3", children: toasts.map((toast) => /* @__PURE__ */ jsx7(ToastItem, { toast }, toast.id)) });
|
|
1186
1366
|
};
|
|
1187
1367
|
var Toast_default = ToastContainer;
|
|
1188
1368
|
|
|
@@ -1236,8 +1416,15 @@ var AuthServices = {
|
|
|
1236
1416
|
};
|
|
1237
1417
|
|
|
1238
1418
|
// src/contexts/SessionContext.tsx
|
|
1239
|
-
import { jsx as
|
|
1419
|
+
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
1240
1420
|
var SessionContext = createContext3(void 0);
|
|
1421
|
+
var useSession = () => {
|
|
1422
|
+
const context = useContext3(SessionContext);
|
|
1423
|
+
if (!context) {
|
|
1424
|
+
throw new Error("useSession must be used within a SessionProvider");
|
|
1425
|
+
}
|
|
1426
|
+
return context;
|
|
1427
|
+
};
|
|
1241
1428
|
var SessionProvider = ({ children }) => {
|
|
1242
1429
|
const [token, setToken] = useState5(localStorage.getItem("token"));
|
|
1243
1430
|
const [loggedUser, setLoggedUser] = useState5(null);
|
|
@@ -1269,7 +1456,7 @@ var SessionProvider = ({ children }) => {
|
|
|
1269
1456
|
setLoggedUser(null);
|
|
1270
1457
|
}
|
|
1271
1458
|
}, [token]);
|
|
1272
|
-
return /* @__PURE__ */
|
|
1459
|
+
return /* @__PURE__ */ jsx8(SessionContext.Provider, { value: {
|
|
1273
1460
|
isAuthenticated: !!token,
|
|
1274
1461
|
loggedUser,
|
|
1275
1462
|
token,
|
|
@@ -1281,7 +1468,7 @@ var SessionProvider = ({ children }) => {
|
|
|
1281
1468
|
// src/components/common/Pages.tsx
|
|
1282
1469
|
import { ChevronLeft as ChevronLeft2, Download, Menu as Menu2, Settings as Settings2 } from "lucide-react";
|
|
1283
1470
|
import { useState as useState6 } from "react";
|
|
1284
|
-
import { jsx as
|
|
1471
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
1285
1472
|
var Pages = ({
|
|
1286
1473
|
title = "",
|
|
1287
1474
|
description = "",
|
|
@@ -1291,17 +1478,17 @@ var Pages = ({
|
|
|
1291
1478
|
children
|
|
1292
1479
|
}) => {
|
|
1293
1480
|
const [sidebarOpen, setSidebarOpen] = useState6(false);
|
|
1294
|
-
return /* @__PURE__ */
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsxs5("div", { className: "flex h-full bg-gray-50", children: [
|
|
1482
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex-1 flex flex-col", children: [
|
|
1483
|
+
/* @__PURE__ */ jsxs5("div", { className: "bg-white border-b border-gray-200 p-6", children: [
|
|
1484
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
1485
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ jsxs5("div", { children: [
|
|
1486
|
+
/* @__PURE__ */ jsx9("h1", { className: "text-2xl font-bold text-gray-900", children: title }),
|
|
1487
|
+
/* @__PURE__ */ jsx9("p", { className: "text-sm text-gray-600", children: description })
|
|
1301
1488
|
] }) }),
|
|
1302
|
-
/* @__PURE__ */
|
|
1489
|
+
/* @__PURE__ */ jsx9("div", { className: "flex items-center space-x-3", children: sideAction })
|
|
1303
1490
|
] }),
|
|
1304
|
-
tabs.length > 0 && /* @__PURE__ */
|
|
1491
|
+
tabs.length > 0 && /* @__PURE__ */ jsx9("div", { className: "flex space-x-1 mt-4 overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx9(
|
|
1305
1492
|
"button",
|
|
1306
1493
|
{
|
|
1307
1494
|
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"}`,
|
|
@@ -1310,43 +1497,43 @@ var Pages = ({
|
|
|
1310
1497
|
tab.id
|
|
1311
1498
|
)) })
|
|
1312
1499
|
] }),
|
|
1313
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 p-6 space-y-6", children })
|
|
1314
1501
|
] }),
|
|
1315
|
-
sidebar && /* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1502
|
+
sidebar && /* @__PURE__ */ jsxs5("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: [
|
|
1503
|
+
/* @__PURE__ */ jsx9("div", { className: "p-4 ", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between", children: [
|
|
1504
|
+
/* @__PURE__ */ jsx9("h2", { className: `font-semibold text-[var(--color-text-primary)] ${!sidebarOpen && "hidden"}`, children: "Classes SYSCOHADA" }),
|
|
1505
|
+
/* @__PURE__ */ jsx9(
|
|
1319
1506
|
"button",
|
|
1320
1507
|
{
|
|
1321
1508
|
onClick: () => setSidebarOpen(!sidebarOpen),
|
|
1322
1509
|
className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
1323
1510
|
"aria-label": sidebarOpen ? "R\xE9duire" : "Ouvrir",
|
|
1324
|
-
children: sidebarOpen ? /* @__PURE__ */
|
|
1511
|
+
children: sidebarOpen ? /* @__PURE__ */ jsx9(ChevronLeft2, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx9(Menu2, { className: "w-5 h-5" })
|
|
1325
1512
|
}
|
|
1326
1513
|
)
|
|
1327
1514
|
] }) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1515
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 overflow-y-auto py-2", children: /* @__PURE__ */ jsx9(
|
|
1329
1516
|
"button",
|
|
1330
1517
|
{
|
|
1331
1518
|
onClick: () => {
|
|
1332
1519
|
},
|
|
1333
1520
|
className: `w-full flex items-center gap-3 px-4 py-3 transition-all relative group hover:bg-[var(--color-surface-hover)]`,
|
|
1334
|
-
children: /* @__PURE__ */
|
|
1521
|
+
children: /* @__PURE__ */ jsx9(
|
|
1335
1522
|
"div",
|
|
1336
1523
|
{
|
|
1337
1524
|
className: `flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center transition-colors bg-[var(--color-background)]`,
|
|
1338
|
-
children: /* @__PURE__ */
|
|
1525
|
+
children: /* @__PURE__ */ jsx9("span", { className: "font-bold text-lg", children: 1 })
|
|
1339
1526
|
}
|
|
1340
1527
|
)
|
|
1341
1528
|
}
|
|
1342
1529
|
) }),
|
|
1343
|
-
sidebarOpen && /* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1530
|
+
sidebarOpen && /* @__PURE__ */ jsx9("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsxs5("div", { className: "space-y-2", children: [
|
|
1531
|
+
/* @__PURE__ */ jsxs5("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: [
|
|
1532
|
+
/* @__PURE__ */ jsx9(Download, { className: "w-4 h-4" }),
|
|
1346
1533
|
"Exporter le plan"
|
|
1347
1534
|
] }),
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
/* @__PURE__ */
|
|
1535
|
+
/* @__PURE__ */ jsxs5("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: [
|
|
1536
|
+
/* @__PURE__ */ jsx9(Settings2, { className: "w-4 h-4" }),
|
|
1350
1537
|
"Configuration"
|
|
1351
1538
|
] })
|
|
1352
1539
|
] }) })
|
|
@@ -1355,12 +1542,21 @@ var Pages = ({
|
|
|
1355
1542
|
};
|
|
1356
1543
|
var Pages_default = Pages;
|
|
1357
1544
|
export {
|
|
1545
|
+
DateInput,
|
|
1546
|
+
FileInput,
|
|
1547
|
+
InputField,
|
|
1548
|
+
Modals_default as Modal,
|
|
1549
|
+
NumberInput,
|
|
1358
1550
|
Pages_default as Pages,
|
|
1359
1551
|
Buttons_default as PrimaryButton,
|
|
1360
1552
|
ModernDoubleSidebarLayout_default as RewiseLayout,
|
|
1361
1553
|
SecondaryButton,
|
|
1554
|
+
SelectInput,
|
|
1362
1555
|
SessionProvider,
|
|
1556
|
+
TextInput,
|
|
1363
1557
|
ThemeContext_default as ThemeProvider,
|
|
1364
1558
|
Toast_default as ToastContainer,
|
|
1365
|
-
ToastProvider
|
|
1559
|
+
ToastProvider,
|
|
1560
|
+
useSession,
|
|
1561
|
+
useToast
|
|
1366
1562
|
};
|