@krosoft/react 0.0.218 → 0.0.219
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/README.md +31 -0
- package/dist/{AppActions-BCXERyyB.js → AppActions-BFmagl91.js} +1 -1
- package/dist/{AppSubTitle-H8ElNObI.js → AppSubTitle-BMQMoehZ.js} +1 -1
- package/dist/AppVerticalTabs-0DrrDO3S.js +101 -0
- package/dist/{ConfirmationDialog-BmxaMEYz.js → ConfirmationDialog-CFsh-Eui.js} +62 -61
- package/dist/DataTable-Cpbp6yse.js +551 -0
- package/dist/ErrorAlert-D_203tKa.js +21 -0
- package/dist/ErrorState-DfJ009uc.js +12 -0
- package/dist/GenericForm-q9dvYl_h.js +342 -0
- package/dist/ImageInput-BYXz8wM1.js +68 -0
- package/dist/{KpiCardsLayout-XZTxB8FV.js → KpiCardsLayout-B-lMaUMA.js} +4 -4
- package/dist/{MultiSelect-Cj8vgAXJ.js → MultiSelect-Dkz1dgXo.js} +52 -51
- package/dist/{PieChart-D6y5EQnh.js → PieChart-bDy_V9Xt.js} +82 -81
- package/dist/SearchInput-CJ2YZpmB.js +244 -0
- package/dist/{SkeletonCards-CYo_lvKx.js → SkeletonCards-Bg2ygjwy.js} +1 -1
- package/dist/{TableFilter-DbnGaGKL.js → TableFilter-u6F06nMx.js} +133 -130
- package/dist/ThemeSelector-BRpEgvX8.js +49 -0
- package/dist/Topbar-bIyAunNd.js +318 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/ChartCard.d.ts.map +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -1
- package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -1
- package/dist/components/core/filters/FilterField.d.ts.map +1 -1
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -1
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +18 -18
- package/dist/components/core/inputs/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/inputs/ImageInput.d.ts.map +1 -1
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -1
- package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/ErrorAlert.d.ts.map +1 -1
- package/dist/components/core/states/ErrorState.d.ts.map +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +1 -1
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TablePagination.d.ts.map +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +18 -18
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/ui/index.js +1 -1
- package/dist/hooks/ui/useTheme.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +7 -0
- package/dist/i18n/krosoftLocales.d.ts +175 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -0
- package/dist/i18n/useKrosoftTranslation.d.ts +15 -0
- package/dist/i18n/useKrosoftTranslation.d.ts.map +1 -0
- package/dist/providers/index.js +1 -1
- package/dist/{sheet-BQmtrGf2.js → sheet-CDqLa-FP.js} +105 -108
- package/dist/useKrosoftTranslation-DdcylBY2.js +43 -0
- package/dist/usePage-Bhb81ffo.js +82 -0
- package/dist/useTheme-Cmw14Zxi.js +25 -0
- package/package.json +1 -1
- package/dist/AppVerticalTabs-aJmAVu6F.js +0 -100
- package/dist/DataTable-0-lae9KY.js +0 -550
- package/dist/ErrorAlert-SrIcU1mM.js +0 -17
- package/dist/ErrorState-CmaxuJyW.js +0 -8
- package/dist/GenericForm-DJR7PD-i.js +0 -341
- package/dist/ImageInput-DYe2XPNZ.js +0 -67
- package/dist/SearchInput-oeq0NBIc.js +0 -251
- package/dist/ThemeSelector-BFC37dSl.js +0 -48
- package/dist/Topbar-DUq-UeR0.js +0 -306
- package/dist/usePage-BFE9lxI1.js +0 -84
- package/dist/useTheme-CSr_h5xJ.js +0 -24
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
|
-
import { b as m, T as h, c as u, B as g, a as f } from "./tooltip-DVeqVwqV.js";
|
|
3
|
-
import { S as v, h as b, i as N, a as S, c as x } from "./select-BpjFWqAY.js";
|
|
4
|
-
import { u as C } from "./useTheme-CSr_h5xJ.js";
|
|
5
|
-
function I({ themeOptions: r, variant: i = "select" }) {
|
|
6
|
-
const { theme: n, handleThemeChange: t, currentThemeOption: e, nextThemeOption: c, cycleTheme: o } = C(r);
|
|
7
|
-
if (i === "mini") {
|
|
8
|
-
const l = e == null ? void 0 : e.icon;
|
|
9
|
-
return /* @__PURE__ */ a(m, { children: /* @__PURE__ */ s(h, { children: [
|
|
10
|
-
/* @__PURE__ */ a(u, { asChild: !0, children: /* @__PURE__ */ s(
|
|
11
|
-
g,
|
|
12
|
-
{
|
|
13
|
-
variant: "ghost",
|
|
14
|
-
size: "icon",
|
|
15
|
-
onClick: o,
|
|
16
|
-
className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
17
|
-
children: [
|
|
18
|
-
l && /* @__PURE__ */ a(l, { className: "size-4" }),
|
|
19
|
-
/* @__PURE__ */ s("span", { className: "sr-only", children: [
|
|
20
|
-
"Thème actuel : ",
|
|
21
|
-
e == null ? void 0 : e.label
|
|
22
|
-
] })
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
) }),
|
|
26
|
-
/* @__PURE__ */ s(f, { side: "bottom", align: "center", children: [
|
|
27
|
-
"Passer en ",
|
|
28
|
-
c == null ? void 0 : c.label
|
|
29
|
-
] })
|
|
30
|
-
] }) });
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
33
|
-
/* @__PURE__ */ s(v, { value: n, onValueChange: t, children: [
|
|
34
|
-
/* @__PURE__ */ a(b, { className: "w-full", children: /* @__PURE__ */ a(N, { placeholder: "Sélectionner un thème" }) }),
|
|
35
|
-
/* @__PURE__ */ a(S, { children: r.map((l) => {
|
|
36
|
-
const d = l.icon;
|
|
37
|
-
return /* @__PURE__ */ a(x, { value: l.value, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
|
|
38
|
-
/* @__PURE__ */ a(d, { className: "size-4" }),
|
|
39
|
-
l.label
|
|
40
|
-
] }) }, l.value);
|
|
41
|
-
}) })
|
|
42
|
-
] }),
|
|
43
|
-
(e == null ? void 0 : e.message) && /* @__PURE__ */ a("p", { className: "text-sm text-muted-foreground", children: e.message })
|
|
44
|
-
] });
|
|
45
|
-
}
|
|
46
|
-
export {
|
|
47
|
-
I as T
|
|
48
|
-
};
|
package/dist/Topbar-DUq-UeR0.js
DELETED
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as A, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import * as j from "react";
|
|
3
|
-
import { SearchIcon as O, LoaderCircleIcon as W, ChevronDownIcon as M, MenuIcon as B } from "lucide-react";
|
|
4
|
-
import { c as o } from "./tailwind.helper-B6yFEsav.js";
|
|
5
|
-
import { B as E, T as F, c as Q, a as q, b as H } from "./tooltip-DVeqVwqV.js";
|
|
6
|
-
import { j as U, m as V, o as _, k as J, l as X, n as Y, I as Z, S as P, s as I, y as ee, t as re } from "./sheet-BQmtrGf2.js";
|
|
7
|
-
import "./sidebar.context-D5nywlmP.js";
|
|
8
|
-
import { u as G } from "./useSidebar-BJuALHqQ.js";
|
|
9
|
-
import "react-i18next";
|
|
10
|
-
import "next-themes";
|
|
11
|
-
import { S as $ } from "./skeleton-BX4RcsiK.js";
|
|
12
|
-
const he = ({
|
|
13
|
-
groups: a,
|
|
14
|
-
search: m,
|
|
15
|
-
onSearch: f,
|
|
16
|
-
onSelect: l,
|
|
17
|
-
loading: r = !1,
|
|
18
|
-
open: n,
|
|
19
|
-
onOpenChange: d,
|
|
20
|
-
trigger: b = !0,
|
|
21
|
-
triggerLabel: v = "Rechercher",
|
|
22
|
-
shortcut: u = !0,
|
|
23
|
-
shortcutLabel: g = "Ctrl+K",
|
|
24
|
-
placeholder: k = "Rechercher...",
|
|
25
|
-
emptyLabel: C = "Aucun résultat.",
|
|
26
|
-
loadingLabel: S = "Recherche...",
|
|
27
|
-
title: z = "Recherche globale",
|
|
28
|
-
description: T = "Rechercher une page ou une donnée dans l'application.",
|
|
29
|
-
hint: x,
|
|
30
|
-
className: D
|
|
31
|
-
}) => {
|
|
32
|
-
const [K, N] = j.useState(!1), s = n !== void 0, y = s ? n : K, t = j.useCallback(
|
|
33
|
-
(c) => {
|
|
34
|
-
s || N(c), d == null || d(c);
|
|
35
|
-
},
|
|
36
|
-
[s, d]
|
|
37
|
-
);
|
|
38
|
-
j.useEffect(() => {
|
|
39
|
-
if (!u) return;
|
|
40
|
-
const c = (h) => {
|
|
41
|
-
h.key.toLowerCase() !== "k" || !(h.metaKey || h.ctrlKey) || (h.preventDefault(), t(!y));
|
|
42
|
-
};
|
|
43
|
-
return window.addEventListener("keydown", c), () => {
|
|
44
|
-
window.removeEventListener("keydown", c);
|
|
45
|
-
};
|
|
46
|
-
}, [u, y, t]);
|
|
47
|
-
const p = (c) => {
|
|
48
|
-
t(!1), f(""), l(c);
|
|
49
|
-
}, w = a.some((c) => c.items.length > 0);
|
|
50
|
-
return /* @__PURE__ */ i(A, { children: [
|
|
51
|
-
b && /* @__PURE__ */ e(
|
|
52
|
-
E,
|
|
53
|
-
{
|
|
54
|
-
variant: "ghost",
|
|
55
|
-
size: "icon",
|
|
56
|
-
"aria-label": v,
|
|
57
|
-
title: u ? `${v} (${g})` : v,
|
|
58
|
-
className: "rounded-full",
|
|
59
|
-
onClick: () => {
|
|
60
|
-
t(!0);
|
|
61
|
-
},
|
|
62
|
-
children: /* @__PURE__ */ e(O, { className: "size-4" })
|
|
63
|
-
}
|
|
64
|
-
),
|
|
65
|
-
/* @__PURE__ */ i(U, { open: y, onOpenChange: t, title: z, description: T, shouldFilter: !1, className: D, children: [
|
|
66
|
-
/* @__PURE__ */ e(V, { value: m, onValueChange: f, placeholder: k }),
|
|
67
|
-
/* @__PURE__ */ i(_, { children: [
|
|
68
|
-
r && /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
|
|
69
|
-
/* @__PURE__ */ e(W, { className: "size-4 animate-spin" }),
|
|
70
|
-
S
|
|
71
|
-
] }),
|
|
72
|
-
!w && !r && /* @__PURE__ */ e(J, { children: C }),
|
|
73
|
-
a.map(
|
|
74
|
-
(c) => c.items.length === 0 ? null : /* @__PURE__ */ e(X, { heading: c.heading, children: c.items.map((h) => {
|
|
75
|
-
const L = h.icon;
|
|
76
|
-
return /* @__PURE__ */ i(
|
|
77
|
-
Y,
|
|
78
|
-
{
|
|
79
|
-
value: h.key,
|
|
80
|
-
className: "gap-3 px-2 py-2",
|
|
81
|
-
onSelect: () => {
|
|
82
|
-
p(h);
|
|
83
|
-
},
|
|
84
|
-
children: [
|
|
85
|
-
L && /* @__PURE__ */ e("span", { className: o("flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", h.iconClassName), children: /* @__PURE__ */ e(L, { className: "size-4" }) }),
|
|
86
|
-
/* @__PURE__ */ i("span", { className: "flex min-w-0 flex-1 flex-col", children: [
|
|
87
|
-
/* @__PURE__ */ e("span", { className: "truncate font-medium", children: h.label }),
|
|
88
|
-
h.description !== void 0 && h.description !== "" && /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: h.description })
|
|
89
|
-
] })
|
|
90
|
-
]
|
|
91
|
-
},
|
|
92
|
-
h.key
|
|
93
|
-
);
|
|
94
|
-
}) }, c.heading)
|
|
95
|
-
)
|
|
96
|
-
] }),
|
|
97
|
-
x !== void 0 && w && !r && /* @__PURE__ */ e("div", { className: "border-t border-border p-2 text-center text-xs text-muted-foreground", children: x })
|
|
98
|
-
] })
|
|
99
|
-
] });
|
|
100
|
-
}, R = (a, m, f) => m === a ? !0 : a === "/" || !m.startsWith(`${a}/`) ? !1 : !f.some(
|
|
101
|
-
(l) => l !== a && l.startsWith(`${a}/`) && (m === l || m.startsWith(`${l}/`))
|
|
102
|
-
), ae = ({
|
|
103
|
-
path: a,
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
105
|
-
icon: m,
|
|
106
|
-
label: f,
|
|
107
|
-
badge: l,
|
|
108
|
-
subItems: r,
|
|
109
|
-
currentPath: n,
|
|
110
|
-
collapsed: d,
|
|
111
|
-
dense: b = !1,
|
|
112
|
-
onItemClick: v
|
|
113
|
-
}) => {
|
|
114
|
-
const u = (r == null ? void 0 : r.map((s) => s.path)) ?? [], [g, k] = j.useState((r == null ? void 0 : r.some((s) => R(s.path, n, u))) ?? !1), C = a ? n === a || a !== "/" && n.startsWith(`${a}/`) : !1, S = r == null ? void 0 : r.some((s) => R(s.path, n, u)), N = /* @__PURE__ */ i(
|
|
115
|
-
"a",
|
|
116
|
-
{
|
|
117
|
-
href: a ?? "#",
|
|
118
|
-
onClick: (s) => {
|
|
119
|
-
s.ctrlKey || s.metaKey || s.button === 1 || (s.preventDefault(), r && r.length > 0 ? d || k(!g) : a && v(a));
|
|
120
|
-
},
|
|
121
|
-
className: o(
|
|
122
|
-
"flex items-center cursor-pointer transition-all duration-200 group rounded-control",
|
|
123
|
-
b ? "gap-2.5 mb-0.5" : "gap-3 mb-1",
|
|
124
|
-
d ? b ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : b ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
|
|
125
|
-
C || !d && S ? b ? "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"
|
|
126
|
-
),
|
|
127
|
-
children: [
|
|
128
|
-
/* @__PURE__ */ e("div", { className: o("flex-shrink-0 transition-transform group-hover:scale-110", d ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(m, { className: "size-4" }) }),
|
|
129
|
-
!d && /* @__PURE__ */ i(A, { children: [
|
|
130
|
-
/* @__PURE__ */ e("span", { className: o("flex-grow transition-opacity duration-150 font-medium", b ? "text-sm" : ""), children: f }),
|
|
131
|
-
l !== 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: l }),
|
|
132
|
-
r && r.length > 0 && /* @__PURE__ */ e(M, { className: o("size-4 transition-transform duration-200", g ? "rotate-180" : "") })
|
|
133
|
-
] })
|
|
134
|
-
]
|
|
135
|
-
}
|
|
136
|
-
);
|
|
137
|
-
return /* @__PURE__ */ i(A, { children: [
|
|
138
|
-
d ? /* @__PURE__ */ i(F, { children: [
|
|
139
|
-
/* @__PURE__ */ e(Q, { asChild: !0, children: N }),
|
|
140
|
-
/* @__PURE__ */ e(
|
|
141
|
-
q,
|
|
142
|
-
{
|
|
143
|
-
side: "right",
|
|
144
|
-
sideOffset: 6,
|
|
145
|
-
className: "rounded-surface z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
|
|
146
|
-
children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
147
|
-
/* @__PURE__ */ e("p", { className: "font-semibold", children: f }),
|
|
148
|
-
l !== void 0 && /* @__PURE__ */ i("span", { className: "ml-1 text-xs", children: [
|
|
149
|
-
"(",
|
|
150
|
-
l,
|
|
151
|
-
")"
|
|
152
|
-
] })
|
|
153
|
-
] }) })
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
] }) : N,
|
|
157
|
-
!d && r && r.length > 0 && g && /* @__PURE__ */ e(
|
|
158
|
-
"div",
|
|
159
|
-
{
|
|
160
|
-
className: o(
|
|
161
|
-
"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",
|
|
162
|
-
b ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
|
|
163
|
-
),
|
|
164
|
-
children: r.map((s, y) => {
|
|
165
|
-
const t = R(s.path, n, u);
|
|
166
|
-
return /* @__PURE__ */ i(
|
|
167
|
-
"a",
|
|
168
|
-
{
|
|
169
|
-
href: s.path,
|
|
170
|
-
onClick: (p) => {
|
|
171
|
-
p.ctrlKey || p.metaKey || p.button === 1 || (p.preventDefault(), v(s.path));
|
|
172
|
-
},
|
|
173
|
-
className: o(
|
|
174
|
-
"flex items-center justify-between rounded-control text-sm transition-all duration-200",
|
|
175
|
-
b ? "px-3 py-1" : "px-4 py-2",
|
|
176
|
-
t ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
|
|
177
|
-
),
|
|
178
|
-
children: [
|
|
179
|
-
/* @__PURE__ */ e("span", { children: s.label }),
|
|
180
|
-
s.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: s.badge })
|
|
181
|
-
]
|
|
182
|
-
},
|
|
183
|
-
y
|
|
184
|
-
);
|
|
185
|
-
})
|
|
186
|
-
}
|
|
187
|
-
)
|
|
188
|
-
] });
|
|
189
|
-
}, pe = ({ groups: a, currentPath: m, onItemClick: f, slots: l, search: r, dense: n = !1, loading: d = !1 }) => {
|
|
190
|
-
const { enabled: b = !1, placeholder: v = "Rechercher..." } = r ?? {}, { header: u, footer: g } = l ?? {}, { collapsed: k, isMobile: C, setCollapsed: S } = G(), [z, T] = j.useState(""), x = C ? !1 : k, D = !k, K = (t) => {
|
|
191
|
-
f(t), C && S(!0);
|
|
192
|
-
}, N = z.trim().toLowerCase(), s = N === "" ? a : a.map((t) => ({
|
|
193
|
-
...t,
|
|
194
|
-
items: t.items.filter(
|
|
195
|
-
(p) => {
|
|
196
|
-
var w;
|
|
197
|
-
return p.label.toLowerCase().includes(N) || (((w = p.subItems) == null ? void 0 : w.some((c) => c.label.toLowerCase().includes(N))) ?? !1);
|
|
198
|
-
}
|
|
199
|
-
)
|
|
200
|
-
})).filter((t) => t.items.length > 0), y = /* @__PURE__ */ i("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
|
|
201
|
-
u,
|
|
202
|
-
b && !x && /* @__PURE__ */ e("div", { className: o("px-4", n ? "pt-2" : "pt-4"), children: /* @__PURE__ */ i("div", { className: "relative", children: [
|
|
203
|
-
/* @__PURE__ */ e(O, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
|
|
204
|
-
/* @__PURE__ */ e(
|
|
205
|
-
Z,
|
|
206
|
-
{
|
|
207
|
-
type: "search",
|
|
208
|
-
value: z,
|
|
209
|
-
onChange: (t) => {
|
|
210
|
-
T(t.target.value);
|
|
211
|
-
},
|
|
212
|
-
placeholder: v,
|
|
213
|
-
className: o(
|
|
214
|
-
"bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
|
|
215
|
-
n ? "h-8 text-sm" : "h-9"
|
|
216
|
-
)
|
|
217
|
-
}
|
|
218
|
-
)
|
|
219
|
-
] }) }),
|
|
220
|
-
/* @__PURE__ */ e("div", { className: o("flex-1 overflow-y-auto scrollbar-modern", x ? "px-0" : "px-2", n ? "py-2" : "py-4"), children: d ? Array.from({ length: 5 }).map((t, p) => /* @__PURE__ */ i("div", { className: o("flex items-center gap-3", n ? "mb-1 h-9" : "mb-2 h-12", x ? "justify-center px-3" : "px-4"), children: [
|
|
221
|
-
/* @__PURE__ */ e($, { className: "size-5 flex-shrink-0 rounded-control" }),
|
|
222
|
-
!x && /* @__PURE__ */ e($, { className: "h-4 flex-1" })
|
|
223
|
-
] }, p)) : s.map((t, p) => /* @__PURE__ */ i("div", { className: n ? "mb-3" : "mb-6", children: [
|
|
224
|
-
!x && t.title !== void 0 && t.title !== "" && /* @__PURE__ */ e("h3", { className: o("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", n ? "mb-1" : "mb-2"), children: t.title }),
|
|
225
|
-
/* @__PURE__ */ e("nav", { className: o("flex flex-col", n ? "gap-0.5" : "gap-1"), children: t.items.map((w, c) => /* @__PURE__ */ e(ae, { ...w, currentPath: m, collapsed: x, dense: n, onItemClick: K }, c)) })
|
|
226
|
-
] }, p)) }),
|
|
227
|
-
g && /* @__PURE__ */ e("div", { className: o("border-t border-sidebar-border", n ? "p-2" : "p-4", x ? "flex justify-center" : ""), children: g })
|
|
228
|
-
] });
|
|
229
|
-
return C ? /* @__PURE__ */ e(
|
|
230
|
-
P,
|
|
231
|
-
{
|
|
232
|
-
open: D,
|
|
233
|
-
onOpenChange: (t) => {
|
|
234
|
-
S(!t);
|
|
235
|
-
},
|
|
236
|
-
children: /* @__PURE__ */ i(I, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
|
|
237
|
-
/* @__PURE__ */ e(ee, { className: "sr-only", children: "Menu de navigation" }),
|
|
238
|
-
/* @__PURE__ */ e(re, { className: "sr-only", children: "Navigation principale de l'application" }),
|
|
239
|
-
y
|
|
240
|
-
] })
|
|
241
|
-
}
|
|
242
|
-
) : /* @__PURE__ */ e(H, { delayDuration: 0, children: /* @__PURE__ */ e(
|
|
243
|
-
"aside",
|
|
244
|
-
{
|
|
245
|
-
className: o(
|
|
246
|
-
"flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
|
|
247
|
-
x ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
|
|
248
|
-
"flex"
|
|
249
|
-
),
|
|
250
|
-
style: {
|
|
251
|
-
"--navbar-width": "16rem",
|
|
252
|
-
"--navbar-width-icon": "4rem"
|
|
253
|
-
},
|
|
254
|
-
children: y
|
|
255
|
-
}
|
|
256
|
-
) });
|
|
257
|
-
}, xe = ({
|
|
258
|
-
name: a = "appname",
|
|
259
|
-
subName: m = "appsubname",
|
|
260
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
261
|
-
icon: f,
|
|
262
|
-
dense: l = !1
|
|
263
|
-
}) => {
|
|
264
|
-
const { collapsed: r, isMobile: n } = G(), d = n ? !1 : r;
|
|
265
|
-
return /* @__PURE__ */ i("div", { className: o("flex items-center flex-shrink-0 gap-3 px-4", l ? "h-14" : "h-16 md:h-20", d ? "justify-center" : ""), children: [
|
|
266
|
-
f !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(f, { className: l ? "size-5" : "size-6" }) }),
|
|
267
|
-
!d && /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
|
|
268
|
-
/* @__PURE__ */ e("h1", { className: o("font-bold text-sidebar-foreground leading-tight", l ? "text-base" : "text-lg"), children: a }),
|
|
269
|
-
/* @__PURE__ */ e("span", { className: o("text-sidebar-muted font-medium", l ? "text-[11px]" : "text-xs"), children: m })
|
|
270
|
-
] })
|
|
271
|
-
] });
|
|
272
|
-
}, be = ({ collapsed: a, isMobile: m, onToggleSidebar: f, actionsNode: l, userMenuNode: r }) => /* @__PURE__ */ i(
|
|
273
|
-
"header",
|
|
274
|
-
{
|
|
275
|
-
className: o(
|
|
276
|
-
"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",
|
|
277
|
-
m && "left-0",
|
|
278
|
-
!m && a && "left-[5rem]",
|
|
279
|
-
!m && !a && "left-[16rem]"
|
|
280
|
-
),
|
|
281
|
-
tabIndex: -1,
|
|
282
|
-
children: [
|
|
283
|
-
/* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
|
|
284
|
-
E,
|
|
285
|
-
{
|
|
286
|
-
variant: "ghost",
|
|
287
|
-
size: "icon",
|
|
288
|
-
onClick: f,
|
|
289
|
-
className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
|
|
290
|
-
children: /* @__PURE__ */ e(B, { className: "size-4" })
|
|
291
|
-
}
|
|
292
|
-
) }),
|
|
293
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
|
|
294
|
-
l,
|
|
295
|
-
r
|
|
296
|
-
] })
|
|
297
|
-
]
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
export {
|
|
301
|
-
he as G,
|
|
302
|
-
pe as S,
|
|
303
|
-
be as T,
|
|
304
|
-
xe as a,
|
|
305
|
-
ae as b
|
|
306
|
-
};
|
package/dist/usePage-BFE9lxI1.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { TrashIcon as u } from "lucide-react";
|
|
2
|
-
import * as c from "react";
|
|
3
|
-
import { useState as l, useContext as m } from "react";
|
|
4
|
-
import { P as f } from "./sidebar.context-D5nywlmP.js";
|
|
5
|
-
const g = (e) => {
|
|
6
|
-
const [o, t] = l(null), r = (n, a) => {
|
|
7
|
-
var s;
|
|
8
|
-
(s = e == null ? void 0 : e.onReset) == null || s.call(e), t({ id: n, name: a });
|
|
9
|
-
}, i = () => {
|
|
10
|
-
t(null);
|
|
11
|
-
};
|
|
12
|
-
return {
|
|
13
|
-
id: (o == null ? void 0 : o.id) ?? null,
|
|
14
|
-
name: (o == null ? void 0 : o.name) ?? null,
|
|
15
|
-
isOpen: !!o,
|
|
16
|
-
openDialog: r,
|
|
17
|
-
onClose: i
|
|
18
|
-
};
|
|
19
|
-
}, d = ({
|
|
20
|
-
titleKey: e,
|
|
21
|
-
descriptionKey: o,
|
|
22
|
-
confirmKey: t = "Confirmer",
|
|
23
|
-
onConfirm: r,
|
|
24
|
-
onReset: i
|
|
25
|
-
}) => {
|
|
26
|
-
const n = g({ onReset: i }), a = async () => {
|
|
27
|
-
if (n.id)
|
|
28
|
-
try {
|
|
29
|
-
await r(n.id), n.onClose();
|
|
30
|
-
} catch (s) {
|
|
31
|
-
console.error("Error confirming action:", s);
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return {
|
|
35
|
-
isOpen: n.isOpen,
|
|
36
|
-
itemName: n.name,
|
|
37
|
-
title: e,
|
|
38
|
-
description: o,
|
|
39
|
-
confirmKey: t,
|
|
40
|
-
openDialog: n.openDialog,
|
|
41
|
-
onClose: n.onClose,
|
|
42
|
-
onConfirm: a
|
|
43
|
-
};
|
|
44
|
-
}, b = ({
|
|
45
|
-
titleKey: e,
|
|
46
|
-
descriptionKey: o,
|
|
47
|
-
confirmKey: t = "Supprimer",
|
|
48
|
-
onConfirm: r,
|
|
49
|
-
onReset: i
|
|
50
|
-
}) => ({
|
|
51
|
-
...d({
|
|
52
|
-
titleKey: e,
|
|
53
|
-
descriptionKey: o,
|
|
54
|
-
confirmKey: t,
|
|
55
|
-
onConfirm: r,
|
|
56
|
-
onReset: i
|
|
57
|
-
}),
|
|
58
|
-
loadingKey: "Suppression...",
|
|
59
|
-
icon: u,
|
|
60
|
-
titleClassName: "flex items-center gap-2 text-destructive",
|
|
61
|
-
headerClassName: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-surface shrink-0"
|
|
62
|
-
}), x = (e, o = 250) => {
|
|
63
|
-
const [t, r] = c.useState(e);
|
|
64
|
-
return c.useEffect(() => {
|
|
65
|
-
const i = setTimeout(() => {
|
|
66
|
-
r(e);
|
|
67
|
-
}, o);
|
|
68
|
-
return () => {
|
|
69
|
-
clearTimeout(i);
|
|
70
|
-
};
|
|
71
|
-
}, [e, o]), t;
|
|
72
|
-
}, P = () => {
|
|
73
|
-
const e = m(f);
|
|
74
|
-
if (e === void 0)
|
|
75
|
-
throw new Error("usePage must be used within an PageProvider");
|
|
76
|
-
return e;
|
|
77
|
-
};
|
|
78
|
-
export {
|
|
79
|
-
d as a,
|
|
80
|
-
x as b,
|
|
81
|
-
g as c,
|
|
82
|
-
P as d,
|
|
83
|
-
b as u
|
|
84
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { useTheme as f } from "next-themes";
|
|
2
|
-
import { u as d } from "./useNotifications-zbUhCvF_.js";
|
|
3
|
-
function x(s) {
|
|
4
|
-
const { showSuccess: r } = d(), { theme: n, setTheme: a } = f(), i = (e) => {
|
|
5
|
-
a(e);
|
|
6
|
-
const o = s.find((m) => m.value === e);
|
|
7
|
-
r("Thème mis à jour", `Le thème a été changé vers ${(o == null ? void 0 : o.label) ?? e}.`);
|
|
8
|
-
}, t = s.filter((e) => !e.hideInMini), u = s.find((e) => e.value === n), l = t.findIndex((e) => e.value === n), c = t.length > 0 ? t[(l + 1) % t.length] : void 0, h = (n == null ? void 0 : n.startsWith("dark")) ?? !1;
|
|
9
|
-
return {
|
|
10
|
-
theme: n,
|
|
11
|
-
setTheme: a,
|
|
12
|
-
handleThemeChange: i,
|
|
13
|
-
themeOptions: s,
|
|
14
|
-
currentThemeOption: u,
|
|
15
|
-
nextThemeOption: c,
|
|
16
|
-
isDark: h,
|
|
17
|
-
cycleTheme: () => {
|
|
18
|
-
c && i(c.value);
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export {
|
|
23
|
-
x as u
|
|
24
|
-
};
|