@krosoft/react 0.0.139 → 0.0.141
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/Topbar-Bc39WGYM.js +217 -0
- package/dist/components/core/index.js +1 -1
- package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
- package/dist/components/core/navbar/SidebarNavItem.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/package.json +1 -1
- package/dist/Topbar-CG_bVPE_.js +0 -211
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { jsxs as n, jsx as e, Fragment as D } from "react/jsx-runtime";
|
|
2
|
+
import * as W from "react";
|
|
3
|
+
import { ChevronDownIcon as L, SearchIcon as M, MenuIcon as B } from "lucide-react";
|
|
4
|
+
import { T as Q, c as R, a as q, b as F, B as G } from "./tooltip-BWyFpIxo.js";
|
|
5
|
+
import { c as s } from "./tailwind.helper-B6yFEsav.js";
|
|
6
|
+
import "./sidebar.context-D5nywlmP.js";
|
|
7
|
+
import { u as $ } from "./useSidebar-BJuALHqQ.js";
|
|
8
|
+
import "react-i18next";
|
|
9
|
+
import "next-themes";
|
|
10
|
+
import { I as H, S as _, b as E, h as J, c as K } from "./sheet-Gop1cIaU.js";
|
|
11
|
+
import { S as O } from "./skeleton-8o8eJd3P.js";
|
|
12
|
+
const z = (a, d, m) => d === a ? !0 : a === "/" || !d.startsWith(`${a}/`) ? !1 : !m.some(
|
|
13
|
+
(t) => t !== a && t.startsWith(`${a}/`) && (d === t || d.startsWith(`${t}/`))
|
|
14
|
+
), U = ({
|
|
15
|
+
path: a,
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
17
|
+
icon: d,
|
|
18
|
+
label: m,
|
|
19
|
+
badge: t,
|
|
20
|
+
subItems: r,
|
|
21
|
+
currentPath: l,
|
|
22
|
+
collapsed: c,
|
|
23
|
+
dense: f = !1,
|
|
24
|
+
onItemClick: u
|
|
25
|
+
}) => {
|
|
26
|
+
const g = (r == null ? void 0 : r.map((o) => o.path)) ?? [], [x, N] = W.useState((r == null ? void 0 : r.some((o) => z(o.path, l, g))) ?? !1), v = a ? l === a || a !== "/" && l.startsWith(`${a}/`) : !1, y = r == null ? void 0 : r.some((o) => z(o.path, l, g)), b = /* @__PURE__ */ n(
|
|
27
|
+
"a",
|
|
28
|
+
{
|
|
29
|
+
href: a ?? "#",
|
|
30
|
+
onClick: (o) => {
|
|
31
|
+
o.preventDefault(), r && r.length > 0 ? c || N(!x) : a && u(a);
|
|
32
|
+
},
|
|
33
|
+
className: s(
|
|
34
|
+
"flex items-center cursor-pointer transition-all duration-200 group",
|
|
35
|
+
f ? "gap-2.5 rounded-lg mb-0.5" : "gap-3 rounded-2xl mb-2",
|
|
36
|
+
c ? f ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : f ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
|
|
37
|
+
v || !c && y ? f ? "bg-sidebar-primary text-sidebar-primary-foreground" : "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
|
|
38
|
+
),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ e("div", { className: s("flex-shrink-0 transition-transform group-hover:scale-110", c ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(d, { className: "size-4" }) }),
|
|
41
|
+
!c && /* @__PURE__ */ n(D, { children: [
|
|
42
|
+
/* @__PURE__ */ e("span", { className: s("flex-grow transition-opacity duration-150 font-medium", f ? "text-sm" : ""), children: m }),
|
|
43
|
+
t !== void 0 && /* @__PURE__ */ e("span", { className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold", children: t }),
|
|
44
|
+
r && r.length > 0 && /* @__PURE__ */ e(L, { className: s("size-4 transition-transform duration-200", x ? "rotate-180" : "") })
|
|
45
|
+
] })
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ n(D, { children: [
|
|
50
|
+
c ? /* @__PURE__ */ n(Q, { children: [
|
|
51
|
+
/* @__PURE__ */ e(R, { asChild: !0, children: b }),
|
|
52
|
+
/* @__PURE__ */ e(
|
|
53
|
+
q,
|
|
54
|
+
{
|
|
55
|
+
side: "right",
|
|
56
|
+
sideOffset: 6,
|
|
57
|
+
className: "rounded-xl z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
|
|
58
|
+
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ e("p", { className: "font-semibold", children: m }),
|
|
60
|
+
t !== void 0 && /* @__PURE__ */ n("span", { className: "ml-1 text-xs", children: [
|
|
61
|
+
"(",
|
|
62
|
+
t,
|
|
63
|
+
")"
|
|
64
|
+
] })
|
|
65
|
+
] }) })
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
] }) : b,
|
|
69
|
+
!c && r && r.length > 0 && x && /* @__PURE__ */ e(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
className: s(
|
|
73
|
+
"flex flex-col ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200",
|
|
74
|
+
f ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
|
|
75
|
+
),
|
|
76
|
+
children: r.map((o, C) => {
|
|
77
|
+
const i = z(o.path, l, g);
|
|
78
|
+
return /* @__PURE__ */ n(
|
|
79
|
+
"a",
|
|
80
|
+
{
|
|
81
|
+
href: o.path,
|
|
82
|
+
onClick: (h) => {
|
|
83
|
+
h.preventDefault(), u(o.path);
|
|
84
|
+
},
|
|
85
|
+
className: s(
|
|
86
|
+
"flex items-center justify-between rounded-xl text-sm transition-all duration-200",
|
|
87
|
+
f ? "px-3 py-1" : "px-4 py-2",
|
|
88
|
+
i ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
89
|
+
),
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ e("span", { children: o.label }),
|
|
92
|
+
o.badge !== void 0 && /* @__PURE__ */ e("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: o.badge })
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
C
|
|
96
|
+
);
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] });
|
|
101
|
+
}, ie = ({ groups: a, currentPath: d, onItemClick: m, slots: t, search: r, dense: l = !1, loading: c = !1 }) => {
|
|
102
|
+
const { enabled: f = !1, placeholder: u = "Rechercher..." } = r ?? {}, { header: g, footer: x } = t ?? {}, { collapsed: N, isMobile: v, setCollapsed: y } = $(), [S, j] = W.useState(""), p = v ? !1 : N, T = !N, A = (i) => {
|
|
103
|
+
m(i), v && y(!0);
|
|
104
|
+
}, b = S.trim().toLowerCase(), o = b === "" ? a : a.map((i) => ({
|
|
105
|
+
...i,
|
|
106
|
+
items: i.items.filter(
|
|
107
|
+
(h) => {
|
|
108
|
+
var w;
|
|
109
|
+
return h.label.toLowerCase().includes(b) || (((w = h.subItems) == null ? void 0 : w.some((k) => k.label.toLowerCase().includes(b))) ?? !1);
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
})).filter((i) => i.items.length > 0), C = /* @__PURE__ */ n("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
|
|
113
|
+
g,
|
|
114
|
+
f && !p && /* @__PURE__ */ e("div", { className: s("px-4", l ? "pt-2" : "pt-4"), children: /* @__PURE__ */ n("div", { className: "relative", children: [
|
|
115
|
+
/* @__PURE__ */ e(M, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
|
|
116
|
+
/* @__PURE__ */ e(
|
|
117
|
+
H,
|
|
118
|
+
{
|
|
119
|
+
type: "search",
|
|
120
|
+
value: S,
|
|
121
|
+
onChange: (i) => {
|
|
122
|
+
j(i.target.value);
|
|
123
|
+
},
|
|
124
|
+
placeholder: u,
|
|
125
|
+
className: s(
|
|
126
|
+
"bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
|
|
127
|
+
l ? "h-8 text-sm" : "h-9"
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
)
|
|
131
|
+
] }) }),
|
|
132
|
+
/* @__PURE__ */ e("div", { className: s("flex-1 overflow-y-auto px-2 scrollbar-modern", l ? "py-2" : "py-4"), children: c ? Array.from({ length: 5 }).map((i, h) => /* @__PURE__ */ n("div", { className: s("flex items-center gap-3", l ? "mb-1 h-9" : "mb-2 h-12", p ? "justify-center px-3" : "px-4"), children: [
|
|
133
|
+
/* @__PURE__ */ e(O, { className: "size-5 flex-shrink-0 rounded-md" }),
|
|
134
|
+
!p && /* @__PURE__ */ e(O, { className: "h-4 flex-1" })
|
|
135
|
+
] }, h)) : o.map((i, h) => /* @__PURE__ */ n("div", { className: l ? "mb-3" : "mb-6", children: [
|
|
136
|
+
!p && i.title !== void 0 && i.title !== "" && /* @__PURE__ */ e("h3", { className: s("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", l ? "mb-1" : "mb-2"), children: i.title }),
|
|
137
|
+
/* @__PURE__ */ e("nav", { className: s("flex flex-col", l ? "gap-0.5" : "gap-1"), children: i.items.map((w, k) => /* @__PURE__ */ e(U, { ...w, currentPath: d, collapsed: p, dense: l, onItemClick: A }, k)) })
|
|
138
|
+
] }, h)) }),
|
|
139
|
+
x && /* @__PURE__ */ e("div", { className: s("border-t border-sidebar-border", l ? "p-2" : "p-4", p ? "flex justify-center" : ""), children: x })
|
|
140
|
+
] });
|
|
141
|
+
return v ? /* @__PURE__ */ e(
|
|
142
|
+
_,
|
|
143
|
+
{
|
|
144
|
+
open: T,
|
|
145
|
+
onOpenChange: (i) => {
|
|
146
|
+
y(!i);
|
|
147
|
+
},
|
|
148
|
+
children: /* @__PURE__ */ n(E, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
|
|
149
|
+
/* @__PURE__ */ e(J, { className: "sr-only", children: "Menu de navigation" }),
|
|
150
|
+
/* @__PURE__ */ e(K, { className: "sr-only", children: "Navigation principale de l'application" }),
|
|
151
|
+
C
|
|
152
|
+
] })
|
|
153
|
+
}
|
|
154
|
+
) : /* @__PURE__ */ e(F, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
155
|
+
"aside",
|
|
156
|
+
{
|
|
157
|
+
className: s(
|
|
158
|
+
"flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
|
|
159
|
+
p ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
|
|
160
|
+
"flex"
|
|
161
|
+
),
|
|
162
|
+
style: {
|
|
163
|
+
"--navbar-width": "16rem",
|
|
164
|
+
"--navbar-width-icon": "5rem"
|
|
165
|
+
},
|
|
166
|
+
children: C
|
|
167
|
+
}
|
|
168
|
+
) });
|
|
169
|
+
}, se = ({
|
|
170
|
+
name: a = "appname",
|
|
171
|
+
subName: d = "appsubname",
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
173
|
+
icon: m,
|
|
174
|
+
dense: t = !1
|
|
175
|
+
}) => {
|
|
176
|
+
const { collapsed: r, isMobile: l } = $(), c = l ? !1 : r;
|
|
177
|
+
return /* @__PURE__ */ n("div", { className: s("flex items-center flex-shrink-0 gap-3 px-4", t ? "h-14" : "h-16 md:h-20", c ? "justify-center" : ""), children: [
|
|
178
|
+
m !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(m, { className: t ? "size-5" : "size-6" }) }),
|
|
179
|
+
!c && /* @__PURE__ */ n("div", { className: "flex flex-col", children: [
|
|
180
|
+
/* @__PURE__ */ e("h1", { className: s("font-bold text-sidebar-foreground leading-tight", t ? "text-base" : "text-lg"), children: a }),
|
|
181
|
+
/* @__PURE__ */ e("span", { className: s("text-sidebar-muted font-medium", t ? "text-[11px]" : "text-xs"), children: d })
|
|
182
|
+
] })
|
|
183
|
+
] });
|
|
184
|
+
}, le = ({ collapsed: a, isMobile: d, onToggleSidebar: m, actionsNode: t, userMenuNode: r }) => /* @__PURE__ */ n(
|
|
185
|
+
"header",
|
|
186
|
+
{
|
|
187
|
+
className: s(
|
|
188
|
+
"fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300",
|
|
189
|
+
d && "left-0",
|
|
190
|
+
!d && a && "left-[5rem]",
|
|
191
|
+
!d && !a && "left-[16rem]"
|
|
192
|
+
),
|
|
193
|
+
tabIndex: -1,
|
|
194
|
+
children: [
|
|
195
|
+
/* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
196
|
+
G,
|
|
197
|
+
{
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
size: "icon",
|
|
200
|
+
onClick: m,
|
|
201
|
+
className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
|
|
202
|
+
children: /* @__PURE__ */ e(B, { className: "size-4" })
|
|
203
|
+
}
|
|
204
|
+
) }),
|
|
205
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
|
|
206
|
+
t,
|
|
207
|
+
r
|
|
208
|
+
] })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
export {
|
|
213
|
+
ie as S,
|
|
214
|
+
le as T,
|
|
215
|
+
se as a,
|
|
216
|
+
U as b
|
|
217
|
+
};
|
|
@@ -11,7 +11,7 @@ import { A as w } from "../../AppActions-DCaejx-3.js";
|
|
|
11
11
|
import { A as J } from "../../AppSubTitle-BNd5_q0i.js";
|
|
12
12
|
import { A as U } from "../../AppTitle-uboDuil4.js";
|
|
13
13
|
import { K as X } from "../../KpiCardsLayout-DDR49Qqh.js";
|
|
14
|
-
import { S as Z, a as _, b as $, T as aa } from "../../Topbar-
|
|
14
|
+
import { S as Z, a as _, b as $, T as aa } from "../../Topbar-Bc39WGYM.js";
|
|
15
15
|
import { E as ra } from "../../ErrorAlert-DH1onuyt.js";
|
|
16
16
|
import { E as sa } from "../../ErrorState-vU8d4CwD.js";
|
|
17
17
|
import { L as ia } from "../../LoadingState-BN0YaPSs.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpC,KAAK,CAAC,EAAE,YAAY,CAAC;IAGrB,MAAM,CAAC,EAAE,aAAa,CAAC;IAGvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,GAAI,qEAAqF,YAAY,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpC,KAAK,CAAC,EAAE,YAAY,CAAC;IAGrB,MAAM,CAAC,EAAE,aAAa,CAAC;IAGvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,GAAI,qEAAqF,YAAY,KAAG,KAAK,CAAC,YAuHjI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarNavItem.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/SidebarNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"SidebarNavItem.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/SidebarNavItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAC;AAExD,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAiBD,eAAO,MAAM,cAAc,GAAI,2FAW5B,mBAAmB,KAAG,KAAK,CAAC,YAyG9B,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import { A as rr } from "../AppActions-DCaejx-3.js";
|
|
|
11
11
|
import { A as tr } from "../AppSubTitle-BNd5_q0i.js";
|
|
12
12
|
import { A as ir } from "../AppTitle-uboDuil4.js";
|
|
13
13
|
import { K as br } from "../KpiCardsLayout-DDR49Qqh.js";
|
|
14
|
-
import { S as ur, a as gr, b as dr, T as mr } from "../Topbar-
|
|
14
|
+
import { S as ur, a as gr, b as dr, T as mr } from "../Topbar-Bc39WGYM.js";
|
|
15
15
|
import { E as Sr } from "../ErrorAlert-DH1onuyt.js";
|
|
16
16
|
import { E as cr } from "../ErrorState-vU8d4CwD.js";
|
|
17
17
|
import { L as Mr } from "../LoadingState-BN0YaPSs.js";
|
package/package.json
CHANGED
package/dist/Topbar-CG_bVPE_.js
DELETED
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as e, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import * as O from "react";
|
|
3
|
-
import { ChevronDownIcon as $, SearchIcon as L, MenuIcon as M } from "lucide-react";
|
|
4
|
-
import { T as B, c as Q, a as R, b as q, B as F } from "./tooltip-BWyFpIxo.js";
|
|
5
|
-
import { c as s } from "./tailwind.helper-B6yFEsav.js";
|
|
6
|
-
import "./sidebar.context-D5nywlmP.js";
|
|
7
|
-
import { u as W } from "./useSidebar-BJuALHqQ.js";
|
|
8
|
-
import "react-i18next";
|
|
9
|
-
import "next-themes";
|
|
10
|
-
import { I as G, S as H, b as _, h as E, c as J } from "./sheet-Gop1cIaU.js";
|
|
11
|
-
import { S as D } from "./skeleton-8o8eJd3P.js";
|
|
12
|
-
const K = ({
|
|
13
|
-
path: o,
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
15
|
-
icon: c,
|
|
16
|
-
label: m,
|
|
17
|
-
badge: n,
|
|
18
|
-
subItems: t,
|
|
19
|
-
currentPath: a,
|
|
20
|
-
collapsed: d,
|
|
21
|
-
dense: p = !1,
|
|
22
|
-
onItemClick: g
|
|
23
|
-
}) => {
|
|
24
|
-
const [x, v] = O.useState((t == null ? void 0 : t.some((r) => a === r.path || a.startsWith(`${r.path}/`))) ?? !1), u = o ? a === o || o !== "/" && a.startsWith(`${o}/`) : !1, b = t == null ? void 0 : t.some((r) => a === r.path || a.startsWith(`${r.path}/`)), N = /* @__PURE__ */ l(
|
|
25
|
-
"a",
|
|
26
|
-
{
|
|
27
|
-
href: o ?? "#",
|
|
28
|
-
onClick: (r) => {
|
|
29
|
-
r.preventDefault(), t && t.length > 0 ? d || v(!x) : o && g(o);
|
|
30
|
-
},
|
|
31
|
-
className: s(
|
|
32
|
-
"flex items-center cursor-pointer transition-all duration-200 group",
|
|
33
|
-
p ? "gap-2.5 rounded-lg mb-0.5" : "gap-3 rounded-2xl mb-2",
|
|
34
|
-
d ? p ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : p ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
|
|
35
|
-
u || !d && b ? p ? "bg-sidebar-primary text-sidebar-primary-foreground" : "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
|
|
36
|
-
),
|
|
37
|
-
children: [
|
|
38
|
-
/* @__PURE__ */ e("div", { className: s("flex-shrink-0 transition-transform group-hover:scale-110", d ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(c, { className: "size-4" }) }),
|
|
39
|
-
!d && /* @__PURE__ */ l(A, { children: [
|
|
40
|
-
/* @__PURE__ */ e("span", { className: s("flex-grow transition-opacity duration-150 font-medium", p ? "text-sm" : ""), children: m }),
|
|
41
|
-
n !== void 0 && /* @__PURE__ */ e("span", { className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold", children: n }),
|
|
42
|
-
t && t.length > 0 && /* @__PURE__ */ e($, { className: s("size-4 transition-transform duration-200", x ? "rotate-180" : "") })
|
|
43
|
-
] })
|
|
44
|
-
]
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
return /* @__PURE__ */ l(A, { children: [
|
|
48
|
-
d ? /* @__PURE__ */ l(B, { children: [
|
|
49
|
-
/* @__PURE__ */ e(Q, { asChild: !0, children: N }),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
51
|
-
R,
|
|
52
|
-
{
|
|
53
|
-
side: "right",
|
|
54
|
-
sideOffset: 6,
|
|
55
|
-
className: "rounded-xl z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
|
|
56
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
57
|
-
/* @__PURE__ */ e("p", { className: "font-semibold", children: m }),
|
|
58
|
-
n !== void 0 && /* @__PURE__ */ l("span", { className: "ml-1 text-xs", children: [
|
|
59
|
-
"(",
|
|
60
|
-
n,
|
|
61
|
-
")"
|
|
62
|
-
] })
|
|
63
|
-
] }) })
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
] }) : N,
|
|
67
|
-
!d && t && t.length > 0 && x && /* @__PURE__ */ e(
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
className: s(
|
|
71
|
-
"flex flex-col ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200",
|
|
72
|
-
p ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
|
|
73
|
-
),
|
|
74
|
-
children: t.map((r, k) => {
|
|
75
|
-
const y = a === r.path || r.path !== "/" && a.startsWith(`${r.path}/`);
|
|
76
|
-
return /* @__PURE__ */ l(
|
|
77
|
-
"a",
|
|
78
|
-
{
|
|
79
|
-
href: r.path,
|
|
80
|
-
onClick: (i) => {
|
|
81
|
-
i.preventDefault(), g(r.path);
|
|
82
|
-
},
|
|
83
|
-
className: s(
|
|
84
|
-
"flex items-center justify-between rounded-xl text-sm transition-all duration-200",
|
|
85
|
-
p ? "px-3 py-1" : "px-4 py-2",
|
|
86
|
-
y ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
87
|
-
),
|
|
88
|
-
children: [
|
|
89
|
-
/* @__PURE__ */ e("span", { children: r.label }),
|
|
90
|
-
r.badge !== void 0 && /* @__PURE__ */ e("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: r.badge })
|
|
91
|
-
]
|
|
92
|
-
},
|
|
93
|
-
k
|
|
94
|
-
);
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
] });
|
|
99
|
-
}, te = ({ groups: o, currentPath: c, onItemClick: m, slots: n, search: t, dense: a = !1, loading: d = !1 }) => {
|
|
100
|
-
const { enabled: p = !1, placeholder: g = "Rechercher..." } = t ?? {}, { header: x, footer: v } = n ?? {}, { collapsed: u, isMobile: b, setCollapsed: w } = W(), [S, j] = O.useState(""), h = b ? !1 : u, T = !u, N = (i) => {
|
|
101
|
-
m(i), b && w(!0);
|
|
102
|
-
}, r = S.trim().toLowerCase(), k = r === "" ? o : o.map((i) => ({
|
|
103
|
-
...i,
|
|
104
|
-
items: i.items.filter(
|
|
105
|
-
(f) => {
|
|
106
|
-
var C;
|
|
107
|
-
return f.label.toLowerCase().includes(r) || (((C = f.subItems) == null ? void 0 : C.some((z) => z.label.toLowerCase().includes(r))) ?? !1);
|
|
108
|
-
}
|
|
109
|
-
)
|
|
110
|
-
})).filter((i) => i.items.length > 0), y = /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
|
|
111
|
-
x,
|
|
112
|
-
p && !h && /* @__PURE__ */ e("div", { className: s("px-4", a ? "pt-2" : "pt-4"), children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
113
|
-
/* @__PURE__ */ e(L, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
|
|
114
|
-
/* @__PURE__ */ e(
|
|
115
|
-
G,
|
|
116
|
-
{
|
|
117
|
-
type: "search",
|
|
118
|
-
value: S,
|
|
119
|
-
onChange: (i) => {
|
|
120
|
-
j(i.target.value);
|
|
121
|
-
},
|
|
122
|
-
placeholder: g,
|
|
123
|
-
className: s(
|
|
124
|
-
"bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
|
|
125
|
-
a ? "h-8 text-sm" : "h-9"
|
|
126
|
-
)
|
|
127
|
-
}
|
|
128
|
-
)
|
|
129
|
-
] }) }),
|
|
130
|
-
/* @__PURE__ */ e("div", { className: s("flex-1 overflow-y-auto px-2 scrollbar-modern", a ? "py-2" : "py-4"), children: d ? Array.from({ length: 5 }).map((i, f) => /* @__PURE__ */ l("div", { className: s("flex items-center gap-3", a ? "mb-1 h-9" : "mb-2 h-12", h ? "justify-center px-3" : "px-4"), children: [
|
|
131
|
-
/* @__PURE__ */ e(D, { className: "size-5 flex-shrink-0 rounded-md" }),
|
|
132
|
-
!h && /* @__PURE__ */ e(D, { className: "h-4 flex-1" })
|
|
133
|
-
] }, f)) : k.map((i, f) => /* @__PURE__ */ l("div", { className: a ? "mb-3" : "mb-6", children: [
|
|
134
|
-
!h && i.title !== void 0 && i.title !== "" && /* @__PURE__ */ e("h3", { className: s("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", a ? "mb-1" : "mb-2"), children: i.title }),
|
|
135
|
-
/* @__PURE__ */ e("nav", { className: s("flex flex-col", a ? "gap-0.5" : "gap-1"), children: i.items.map((C, z) => /* @__PURE__ */ e(K, { ...C, currentPath: c, collapsed: h, dense: a, onItemClick: N }, z)) })
|
|
136
|
-
] }, f)) }),
|
|
137
|
-
v && /* @__PURE__ */ e("div", { className: s("border-t border-sidebar-border", a ? "p-2" : "p-4", h ? "flex justify-center" : ""), children: v })
|
|
138
|
-
] });
|
|
139
|
-
return b ? /* @__PURE__ */ e(
|
|
140
|
-
H,
|
|
141
|
-
{
|
|
142
|
-
open: T,
|
|
143
|
-
onOpenChange: (i) => {
|
|
144
|
-
w(!i);
|
|
145
|
-
},
|
|
146
|
-
children: /* @__PURE__ */ l(_, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
|
|
147
|
-
/* @__PURE__ */ e(E, { className: "sr-only", children: "Menu de navigation" }),
|
|
148
|
-
/* @__PURE__ */ e(J, { className: "sr-only", children: "Navigation principale de l'application" }),
|
|
149
|
-
y
|
|
150
|
-
] })
|
|
151
|
-
}
|
|
152
|
-
) : /* @__PURE__ */ e(q, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
153
|
-
"aside",
|
|
154
|
-
{
|
|
155
|
-
className: s("flex flex-col bg-sidebar h-screen transition-all duration-300", h ? "w-[--navbar-width-icon]" : "w-[--navbar-width]", "flex"),
|
|
156
|
-
style: {
|
|
157
|
-
"--navbar-width": "16rem",
|
|
158
|
-
"--navbar-width-icon": "5rem"
|
|
159
|
-
},
|
|
160
|
-
children: y
|
|
161
|
-
}
|
|
162
|
-
) });
|
|
163
|
-
}, ie = ({
|
|
164
|
-
name: o = "appname",
|
|
165
|
-
subName: c = "appsubname",
|
|
166
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
167
|
-
icon: m,
|
|
168
|
-
dense: n = !1
|
|
169
|
-
}) => {
|
|
170
|
-
const { collapsed: t, isMobile: a } = W(), d = a ? !1 : t;
|
|
171
|
-
return /* @__PURE__ */ l("div", { className: s("flex items-center flex-shrink-0 gap-3 px-4", n ? "h-14" : "h-16 md:h-20", d ? "justify-center" : ""), children: [
|
|
172
|
-
m !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(m, { className: n ? "size-5" : "size-6" }) }),
|
|
173
|
-
!d && /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
|
|
174
|
-
/* @__PURE__ */ e("h1", { className: s("font-bold text-sidebar-foreground leading-tight", n ? "text-base" : "text-lg"), children: o }),
|
|
175
|
-
/* @__PURE__ */ e("span", { className: s("text-sidebar-muted font-medium", n ? "text-[11px]" : "text-xs"), children: c })
|
|
176
|
-
] })
|
|
177
|
-
] });
|
|
178
|
-
}, se = ({ collapsed: o, isMobile: c, onToggleSidebar: m, actionsNode: n, userMenuNode: t }) => /* @__PURE__ */ l(
|
|
179
|
-
"header",
|
|
180
|
-
{
|
|
181
|
-
className: s(
|
|
182
|
-
"fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300",
|
|
183
|
-
c && "left-0",
|
|
184
|
-
!c && o && "left-[5rem]",
|
|
185
|
-
!c && !o && "left-[16rem]"
|
|
186
|
-
),
|
|
187
|
-
tabIndex: -1,
|
|
188
|
-
children: [
|
|
189
|
-
/* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
190
|
-
F,
|
|
191
|
-
{
|
|
192
|
-
variant: "ghost",
|
|
193
|
-
size: "icon",
|
|
194
|
-
onClick: m,
|
|
195
|
-
className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
|
|
196
|
-
children: /* @__PURE__ */ e(M, { className: "size-4" })
|
|
197
|
-
}
|
|
198
|
-
) }),
|
|
199
|
-
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
|
|
200
|
-
n,
|
|
201
|
-
t
|
|
202
|
-
] })
|
|
203
|
-
]
|
|
204
|
-
}
|
|
205
|
-
);
|
|
206
|
-
export {
|
|
207
|
-
te as S,
|
|
208
|
-
se as T,
|
|
209
|
-
ie as a,
|
|
210
|
-
K as b
|
|
211
|
-
};
|