@krosoft/react 0.0.232 → 0.0.233

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/{AppActions-BG2sgghh.js → AppActions-BFwztl-1.js} +2 -2
  2. package/dist/{AppSubTitle-C3K23xXb.js → AppSubTitle-BTN0YAc7.js} +1 -1
  3. package/dist/{AppVerticalTabs-B05oTb_4.js → AppVerticalTabs-B7XXtAVj.js} +19 -18
  4. package/dist/{ConfirmationDialog-JR14pbWt.js → ConfirmationDialog-Dj4WdnHg.js} +5 -5
  5. package/dist/{DataTable-BHcadDqz.js → DataTable-CjrR27Di.js} +3 -3
  6. package/dist/{ErrorAlert-BZGt1hH3.js → ErrorAlert-B99Xb_Hg.js} +1 -1
  7. package/dist/{ErrorState-0Op-bIn7.js → ErrorState-CkeS_IBT.js} +1 -1
  8. package/dist/{GenericForm-C6iW17Kx.js → GenericForm-CydibLHU.js} +6 -6
  9. package/dist/{ImageInput-XRiPLRM6.js → ImageInput-DoOOvvth.js} +3 -3
  10. package/dist/{KpiCardsLayout-Be1LHbN7.js → KpiCardsLayout-Ca6otKVw.js} +5 -5
  11. package/dist/{LanguageSelector-C3WSlVQx.js → LanguageSelector-D5Ly1SFC.js} +1 -1
  12. package/dist/{MultiSelect-DCocjZB4.js → MultiSelect-DbH7LrsD.js} +3 -3
  13. package/dist/{PieChart-Cf6q_Pxe.js → PieChart-uozNJtEx.js} +1 -1
  14. package/dist/{SearchInput-rza2llpC.js → SearchInput-DIZ5Yt6L.js} +4 -4
  15. package/dist/{SkeletonCards-vsneHkXf.js → SkeletonCards-B9C4cNMr.js} +2 -2
  16. package/dist/{TableFilter-CBNO2K6p.js → TableFilter-CmEVF5Bo.js} +25 -25
  17. package/dist/{ThemeSelector-J-ZsBnI8.js → ThemeSelector-DKhn02V2.js} +2 -2
  18. package/dist/Topbar-CPWjqOBF.js +429 -0
  19. package/dist/components/core/cards/index.js +1 -1
  20. package/dist/components/core/charts/index.js +1 -1
  21. package/dist/components/core/dialogs/index.js +3 -3
  22. package/dist/components/core/filters/index.js +1 -1
  23. package/dist/components/core/forms/index.js +1 -1
  24. package/dist/components/core/index.js +52 -51
  25. package/dist/components/core/inputs/index.js +3 -3
  26. package/dist/components/core/language/index.js +1 -1
  27. package/dist/components/core/layouts/index.js +3 -3
  28. package/dist/components/core/navbar/NotificationsBell.d.ts +64 -0
  29. package/dist/components/core/navbar/NotificationsBell.d.ts.map +1 -0
  30. package/dist/components/core/navbar/index.d.ts +2 -0
  31. package/dist/components/core/navbar/index.d.ts.map +1 -1
  32. package/dist/components/core/navbar/index.js +5 -4
  33. package/dist/components/core/states/index.js +2 -2
  34. package/dist/components/core/table/index.js +1 -1
  35. package/dist/components/core/tabs/index.js +1 -1
  36. package/dist/components/core/theme/index.js +1 -1
  37. package/dist/components/index.js +236 -235
  38. package/dist/components/ui/index.js +104 -104
  39. package/dist/hooks/behavior/index.js +1 -1
  40. package/dist/hooks/index.js +2 -2
  41. package/dist/hooks/ui/index.js +1 -1
  42. package/dist/i18n/index.js +2 -2
  43. package/dist/i18n/krosoftLocales.d.ts +14 -0
  44. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  45. package/dist/sheet-XYI-ezvY.js +292 -0
  46. package/dist/{toaster-B1J0puB_.js → toaster-CyzB1m5z.js} +26 -26
  47. package/dist/{toggle-group-DLLrEwv2.js → toggle-group-iZqnrTj7.js} +519 -566
  48. package/dist/{useDateFnsLocale-gHocxHFa.js → useDateFnsLocale-D6VExZ8U.js} +1 -1
  49. package/dist/useKrosoftTranslation-BTp46G94.js +47 -0
  50. package/dist/{usePage-CLeciGbD.js → usePage-BQm6tdJD.js} +1 -1
  51. package/dist/{useTheme-Bs43Wf48.js → useTheme-DS6ZjdzM.js} +1 -1
  52. package/package.json +1 -1
  53. package/dist/Topbar-Dkgmpwp8.js +0 -319
  54. package/dist/sheet-DUrRR7MT.js +0 -245
  55. package/dist/useKrosoftTranslation-DRD49kc-.js +0 -45
@@ -1,6 +1,6 @@
1
1
  import { fr as o, enGB as t } from "date-fns/locale";
2
2
  import { useTranslation as a } from "react-i18next";
3
- import { K as r } from "./useKrosoftTranslation-DRD49kc-.js";
3
+ import { K as r } from "./useKrosoftTranslation-BTp46G94.js";
4
4
  const L = { fr: o, en: t }, e = o, i = (s) => s === void 0 ? e : L[s.split("-")[0]] ?? e, l = () => {
5
5
  const { i18n: s, ready: n } = a(r, { useSuspense: !1 });
6
6
  return i(n ? s.resolvedLanguage ?? s.language : void 0);
@@ -0,0 +1,47 @@
1
+ import { useTranslation as c } from "react-i18next";
2
+ const l = { cancel: "Cancel", save: "Save", saving: "Saving...", edit: "Edit", delete: "Delete", clear: "Clear", apply: "Apply" }, u = { loading: "Loading...", error: "Something went wrong.", errorPrefix: "Error:", errorTitle: "Error", noResult: "No result", noResultDot: "No result.", noData: "No data available", underConstruction: "Section under development", comingSoon: "This feature will be available soon" }, d = { trigger: "Search", placeholder: "Search...", globalTitle: "Global search", globalDescription: "Search for a page or a record across the application.", commandTitle: "Command palette", commandDescription: "Search for a command to run.", loading: "Searching..." }, g = { trigger: "Notifications", title: "Notifications", empty: "No notifications.", markAllAsRead: "Mark all as read", remove: "Delete notification" }, p = { placeholder: "Select...", create: "Create “{{search}}”", section: "Select a section", theme: "Select a theme", language: "Select a language" }, m = { pickDate: "Select a date", pickPeriod: "Select a period", clearPeriod: "Clear the selected period" }, h = { advanced: "Advanced filters", more: "More filters", yes: "Yes", no: "No" }, f = { validationTitle: "Validation error", validationMessage: "Please check the form fields", submitError: "Something went wrong while saving" }, v = { empty: "No image", upload: "Click to upload", invalidType: "Only {{types}} files are accepted", tooLarge: "The file must not exceed {{size}}MB" }, S = { previousPage: "Previous page", nextPage: "Next page" }, b = { menu: "Navigation menu", description: "Main navigation of the application" }, T = { description: "Choose the interface language", current: "Current language: {{language}}", switchTo: "Switch to {{language}}" }, P = { updatedTitle: "Theme updated", updatedMessage: "The theme has been changed to {{theme}}." }, C = {
3
+ actions: l,
4
+ states: u,
5
+ search: d,
6
+ notifications: g,
7
+ select: p,
8
+ date: m,
9
+ filters: h,
10
+ form: f,
11
+ image: v,
12
+ table: S,
13
+ sidebar: b,
14
+ language: T,
15
+ theme: P
16
+ }, y = { cancel: "Annuler", save: "Enregistrer", saving: "Enregistrement...", edit: "Modifier", delete: "Supprimer", clear: "Effacer", apply: "Appliquer" }, A = { loading: "Chargement...", error: "Une erreur est survenue.", errorPrefix: "Erreur :", errorTitle: "Erreur", noResult: "Aucun résultat", noResultDot: "Aucun résultat.", noData: "Aucune donnée disponible", underConstruction: "Section en cours de développement", comingSoon: "Cette fonctionnalité sera bientôt disponible" }, E = { trigger: "Rechercher", placeholder: "Rechercher...", globalTitle: "Recherche globale", globalDescription: "Rechercher une page ou une donnée dans l'application.", commandTitle: "Palette de commandes", commandDescription: "Rechercher une commande à exécuter.", loading: "Recherche..." }, N = { trigger: "Notifications", title: "Notifications", empty: "Aucune notification.", markAllAsRead: "Tout marquer comme lu", remove: "Supprimer la notification" }, R = { placeholder: "Sélectionner...", create: "Créer « {{search}} »", section: "Sélectionner une section", theme: "Sélectionner un thème", language: "Sélectionner une langue" }, $ = { pickDate: "Sélectionner une date", pickPeriod: "Sélectionner une période", clearPeriod: "Effacer la période sélectionnée" }, D = { advanced: "Filtres avancés", more: "Plus de filtres", yes: "Oui", no: "Non" }, M = { validationTitle: "Erreur de validation", validationMessage: "Veuillez vérifier les champs du formulaire", submitError: "Une erreur est survenue lors de l'enregistrement" }, w = { empty: "Aucune image", upload: "Cliquer pour uploader", invalidType: "Seuls les fichiers {{types}} sont acceptés", tooLarge: "Le fichier ne doit pas dépasser {{size}}MB" }, k = { previousPage: "Page précédente", nextPage: "Page suivante" }, x = { menu: "Menu de navigation", description: "Navigation principale de l'application" }, L = { description: "Choisissez la langue de l'interface", current: "Langue actuelle : {{language}}", switchTo: "Passer en {{language}}" }, B = { updatedTitle: "Thème mis à jour", updatedMessage: "Le thème a été changé vers {{theme}}." }, s = {
17
+ actions: y,
18
+ states: A,
19
+ search: E,
20
+ notifications: N,
21
+ select: R,
22
+ date: $,
23
+ filters: D,
24
+ form: M,
25
+ image: w,
26
+ table: k,
27
+ sidebar: x,
28
+ language: L,
29
+ theme: B
30
+ }, r = "krosoft", O = { fr: s, en: C }, q = (e, { overwrite: t = !1 } = {}) => {
31
+ typeof e.addResourceBundle == "function" && Object.entries(O).forEach(([a, n]) => {
32
+ var o;
33
+ (o = e.addResourceBundle) == null || o.call(e, a, r, n, !0, t);
34
+ });
35
+ }, z = (e) => {
36
+ const t = e.split(".").reduce((a, n) => typeof a == "object" && a !== null ? a[n] : void 0, s);
37
+ return typeof t == "string" ? t : void 0;
38
+ }, K = (e, t) => t === void 0 ? e : e.replace(/\{\{(\w+)\}\}/g, (a, n) => n in t ? String(t[n]) : a), F = () => {
39
+ const { t: e, i18n: t, ready: a } = c(r, { useSuspense: !1 });
40
+ return { t: (o, i) => a && t.exists(o, { ns: r }) ? e(o, i ?? {}) : K(z(o) ?? o, i) };
41
+ };
42
+ export {
43
+ r as K,
44
+ O as k,
45
+ q as r,
46
+ F as u
47
+ };
@@ -1,6 +1,6 @@
1
1
  import "date-fns/locale";
2
2
  import "react-i18next";
3
- import { u } from "./useKrosoftTranslation-DRD49kc-.js";
3
+ import { u } from "./useKrosoftTranslation-BTp46G94.js";
4
4
  import { TrashIcon as l } from "lucide-react";
5
5
  import * as c from "react";
6
6
  import { useState as m, useContext as f } from "react";
@@ -1,6 +1,6 @@
1
1
  import "date-fns/locale";
2
2
  import "react-i18next";
3
- import { u as f } from "./useKrosoftTranslation-DRD49kc-.js";
3
+ import { u as f } from "./useKrosoftTranslation-BTp46G94.js";
4
4
  import { useTheme as T } from "next-themes";
5
5
  import { u as p } from "./useNotifications-zbUhCvF_.js";
6
6
  function k(s) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.232",
3
+ "version": "0.0.233",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,319 +0,0 @@
1
- import { jsxs as i, Fragment as $, jsx as e } from "react/jsx-runtime";
2
- import "date-fns/locale";
3
- import "react-i18next";
4
- import { u as G } from "./useKrosoftTranslation-DRD49kc-.js";
5
- import * as A from "react";
6
- import { SearchIcon as W, LoaderCircleIcon as F, ChevronDownIcon as M, MenuIcon as Q } from "lucide-react";
7
- import { c as o } from "./tailwind.helper-B6yFEsav.js";
8
- import { B as R, T as q, c as H, a as U, b as V } from "./tooltip-DVeqVwqV.js";
9
- import { j as _, m as J, o as X, k as Y, l as Z, n as P, I, S as ee, s as re, y as ae, t as te } from "./sheet-DUrRR7MT.js";
10
- import "./sidebar.context-D5nywlmP.js";
11
- import { u as B } from "./useSidebar-BJuALHqQ.js";
12
- import "next-themes";
13
- import { S as E } from "./skeleton-BX4RcsiK.js";
14
- const ue = ({
15
- groups: t,
16
- search: m,
17
- onSearch: f,
18
- onSelect: l,
19
- loading: a = !1,
20
- open: n,
21
- onOpenChange: c,
22
- trigger: p = !0,
23
- triggerLabel: g,
24
- shortcut: u = !0,
25
- shortcutLabel: y = "Ctrl+K",
26
- placeholder: S,
27
- emptyLabel: z,
28
- loadingLabel: C,
29
- title: T,
30
- description: D,
31
- hint: K,
32
- className: x
33
- }) => {
34
- const { t: b } = G(), [j, s] = A.useState(!1), w = n !== void 0, v = w ? n : j, r = A.useCallback(
35
- (d) => {
36
- w || s(d), c == null || c(d);
37
- },
38
- [w, c]
39
- );
40
- A.useEffect(() => {
41
- if (!u) return;
42
- const d = (h) => {
43
- h.key.toLowerCase() !== "k" || !(h.metaKey || h.ctrlKey) || (h.preventDefault(), r(!v));
44
- };
45
- return window.addEventListener("keydown", d), () => {
46
- window.removeEventListener("keydown", d);
47
- };
48
- }, [u, v, r]);
49
- const N = (d) => {
50
- r(!1), f(""), l(d);
51
- }, k = t.some((d) => d.items.length > 0);
52
- return /* @__PURE__ */ i($, { children: [
53
- p && /* @__PURE__ */ e(
54
- R,
55
- {
56
- variant: "ghost",
57
- size: "icon",
58
- "aria-label": g ?? b("search.trigger"),
59
- title: u ? `${g ?? b("search.trigger")} (${y})` : g ?? b("search.trigger"),
60
- className: "rounded-full",
61
- onClick: () => {
62
- r(!0);
63
- },
64
- children: /* @__PURE__ */ e(W, { className: "size-4" })
65
- }
66
- ),
67
- /* @__PURE__ */ i(
68
- _,
69
- {
70
- open: v,
71
- onOpenChange: r,
72
- title: T ?? b("search.globalTitle"),
73
- description: D ?? b("search.globalDescription"),
74
- shouldFilter: !1,
75
- className: x,
76
- children: [
77
- /* @__PURE__ */ e(J, { value: m, onValueChange: f, placeholder: S ?? b("search.placeholder") }),
78
- /* @__PURE__ */ i(X, { children: [
79
- a && /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
80
- /* @__PURE__ */ e(F, { className: "size-4 animate-spin" }),
81
- C ?? b("search.loading")
82
- ] }),
83
- !k && !a && /* @__PURE__ */ e(Y, { children: z ?? b("states.noResultDot") }),
84
- t.map(
85
- (d) => d.items.length === 0 ? null : /* @__PURE__ */ e(Z, { heading: d.heading, children: d.items.map((h) => {
86
- const O = h.icon;
87
- return /* @__PURE__ */ i(
88
- P,
89
- {
90
- value: h.key,
91
- className: "gap-3 px-2 py-2",
92
- onSelect: () => {
93
- N(h);
94
- },
95
- children: [
96
- O && /* @__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(O, { className: "size-4" }) }),
97
- /* @__PURE__ */ i("span", { className: "flex min-w-0 flex-1 flex-col", children: [
98
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: h.label }),
99
- h.description !== void 0 && h.description !== "" && /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: h.description })
100
- ] })
101
- ]
102
- },
103
- h.key
104
- );
105
- }) }, d.heading)
106
- )
107
- ] }),
108
- K !== void 0 && k && !a && /* @__PURE__ */ e("div", { className: "border-t border-border p-2 text-center text-xs text-muted-foreground", children: K })
109
- ]
110
- }
111
- )
112
- ] });
113
- }, L = (t, m, f) => m === t ? !0 : t === "/" || !m.startsWith(`${t}/`) ? !1 : !f.some(
114
- (l) => l !== t && l.startsWith(`${t}/`) && (m === l || m.startsWith(`${l}/`))
115
- ), se = ({
116
- path: t,
117
- // eslint-disable-next-line @typescript-eslint/naming-convention
118
- icon: m,
119
- label: f,
120
- badge: l,
121
- subItems: a,
122
- currentPath: n,
123
- collapsed: c,
124
- dense: p = !1,
125
- onItemClick: g
126
- }) => {
127
- const u = (a == null ? void 0 : a.map((s) => s.path)) ?? [], [y, S] = A.useState((a == null ? void 0 : a.some((s) => L(s.path, n, u))) ?? !1), z = t ? n === t || t !== "/" && n.startsWith(`${t}/`) : !1, C = a == null ? void 0 : a.some((s) => L(s.path, n, u)), j = /* @__PURE__ */ i(
128
- "a",
129
- {
130
- href: t ?? "#",
131
- onClick: (s) => {
132
- s.ctrlKey || s.metaKey || s.button === 1 || (s.preventDefault(), a && a.length > 0 ? c || S(!y) : t && g(t));
133
- },
134
- className: o(
135
- "flex items-center cursor-pointer transition-all duration-200 group rounded-control",
136
- p ? "gap-2.5 mb-0.5" : "gap-3 mb-1",
137
- c ? 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",
138
- z || !c && C ? 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"
139
- ),
140
- children: [
141
- /* @__PURE__ */ e("div", { className: o("flex-shrink-0 transition-transform group-hover:scale-110", c ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(m, { className: "size-4" }) }),
142
- !c && /* @__PURE__ */ i($, { children: [
143
- /* @__PURE__ */ e("span", { className: o("flex-grow transition-opacity duration-150 font-medium", p ? "text-sm" : ""), children: f }),
144
- 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 }),
145
- a && a.length > 0 && /* @__PURE__ */ e(M, { className: o("size-4 transition-transform duration-200", y ? "rotate-180" : "") })
146
- ] })
147
- ]
148
- }
149
- );
150
- return /* @__PURE__ */ i($, { children: [
151
- c ? /* @__PURE__ */ i(q, { children: [
152
- /* @__PURE__ */ e(H, { asChild: !0, children: j }),
153
- /* @__PURE__ */ e(
154
- U,
155
- {
156
- side: "right",
157
- sideOffset: 6,
158
- className: "rounded-surface z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
159
- children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
160
- /* @__PURE__ */ e("p", { className: "font-semibold", children: f }),
161
- l !== void 0 && /* @__PURE__ */ i("span", { className: "ml-1 text-xs", children: [
162
- "(",
163
- l,
164
- ")"
165
- ] })
166
- ] }) })
167
- }
168
- )
169
- ] }) : j,
170
- !c && a && a.length > 0 && y && /* @__PURE__ */ e(
171
- "div",
172
- {
173
- className: o(
174
- "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",
175
- p ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
176
- ),
177
- children: a.map((s, w) => {
178
- const v = L(s.path, n, u);
179
- return /* @__PURE__ */ i(
180
- "a",
181
- {
182
- href: s.path,
183
- onClick: (r) => {
184
- r.ctrlKey || r.metaKey || r.button === 1 || (r.preventDefault(), g(s.path));
185
- },
186
- className: o(
187
- "flex items-center justify-between rounded-control text-sm transition-all duration-200",
188
- p ? "px-3 py-1" : "px-4 py-2",
189
- v ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
190
- ),
191
- children: [
192
- /* @__PURE__ */ e("span", { children: s.label }),
193
- 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 })
194
- ]
195
- },
196
- w
197
- );
198
- })
199
- }
200
- )
201
- ] });
202
- }, ge = ({ groups: t, currentPath: m, onItemClick: f, slots: l, search: a, dense: n = !1, loading: c = !1 }) => {
203
- const { t: p } = G(), { enabled: g = !1, placeholder: u } = a ?? {}, { header: y, footer: S } = l ?? {}, { collapsed: z, isMobile: C, setCollapsed: T } = B(), [D, K] = A.useState(""), x = C ? !1 : z, b = !z, j = (r) => {
204
- f(r), C && T(!0);
205
- }, s = D.trim().toLowerCase(), w = s === "" ? t : t.map((r) => ({
206
- ...r,
207
- items: r.items.filter(
208
- (N) => {
209
- var k;
210
- return N.label.toLowerCase().includes(s) || (((k = N.subItems) == null ? void 0 : k.some((d) => d.label.toLowerCase().includes(s))) ?? !1);
211
- }
212
- )
213
- })).filter((r) => r.items.length > 0), v = /* @__PURE__ */ i("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
214
- y,
215
- g && !x && /* @__PURE__ */ e("div", { className: o("px-4", n ? "pt-2" : "pt-4"), children: /* @__PURE__ */ i("div", { className: "relative", children: [
216
- /* @__PURE__ */ e(W, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
217
- /* @__PURE__ */ e(
218
- I,
219
- {
220
- type: "search",
221
- value: D,
222
- onChange: (r) => {
223
- K(r.target.value);
224
- },
225
- placeholder: u ?? p("search.placeholder"),
226
- className: o(
227
- "bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
228
- n ? "h-8 text-sm" : "h-9"
229
- )
230
- }
231
- )
232
- ] }) }),
233
- /* @__PURE__ */ e("div", { className: o("flex-1 overflow-y-auto scrollbar-modern", x ? "px-0" : "px-2", n ? "py-2" : "py-4"), children: c ? Array.from({ length: 5 }).map((r, N) => /* @__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: [
234
- /* @__PURE__ */ e(E, { className: "size-5 flex-shrink-0 rounded-control" }),
235
- !x && /* @__PURE__ */ e(E, { className: "h-4 flex-1" })
236
- ] }, N)) : w.map((r, N) => /* @__PURE__ */ i("div", { className: n ? "mb-3" : "mb-6", children: [
237
- !x && r.title !== void 0 && r.title !== "" && /* @__PURE__ */ e("h3", { className: o("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", n ? "mb-1" : "mb-2"), children: r.title }),
238
- /* @__PURE__ */ e("nav", { className: o("flex flex-col", n ? "gap-0.5" : "gap-1"), children: r.items.map((k, d) => /* @__PURE__ */ e(se, { ...k, currentPath: m, collapsed: x, dense: n, onItemClick: j }, d)) })
239
- ] }, N)) }),
240
- S && /* @__PURE__ */ e("div", { className: o("border-t border-sidebar-border", n ? "p-2" : "p-4", x ? "flex justify-center" : ""), children: S })
241
- ] });
242
- return C ? /* @__PURE__ */ e(
243
- ee,
244
- {
245
- open: b,
246
- onOpenChange: (r) => {
247
- T(!r);
248
- },
249
- children: /* @__PURE__ */ i(re, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
250
- /* @__PURE__ */ e(ae, { className: "sr-only", children: p("sidebar.menu") }),
251
- /* @__PURE__ */ e(te, { className: "sr-only", children: p("sidebar.description") }),
252
- v
253
- ] })
254
- }
255
- ) : /* @__PURE__ */ e(V, { delayDuration: 0, children: /* @__PURE__ */ e(
256
- "aside",
257
- {
258
- className: o(
259
- "flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
260
- x ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
261
- "flex"
262
- ),
263
- style: {
264
- "--navbar-width": "16rem",
265
- "--navbar-width-icon": "4rem"
266
- },
267
- children: v
268
- }
269
- ) });
270
- }, ve = ({
271
- name: t = "appname",
272
- subName: m = "appsubname",
273
- // eslint-disable-next-line @typescript-eslint/naming-convention
274
- icon: f,
275
- dense: l = !1
276
- }) => {
277
- const { collapsed: a, isMobile: n } = B(), c = n ? !1 : a;
278
- return /* @__PURE__ */ i("div", { className: o("flex items-center flex-shrink-0 gap-3 px-4", l ? "h-14" : "h-16 md:h-20", c ? "justify-center" : ""), children: [
279
- f !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(f, { className: l ? "size-5" : "size-6" }) }),
280
- !c && /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
281
- /* @__PURE__ */ e("h1", { className: o("font-bold text-sidebar-foreground leading-tight", l ? "text-base" : "text-lg"), children: t }),
282
- /* @__PURE__ */ e("span", { className: o("text-sidebar-muted font-medium", l ? "text-[11px]" : "text-xs"), children: m })
283
- ] })
284
- ] });
285
- }, Ne = ({ collapsed: t, isMobile: m, onToggleSidebar: f, actionsNode: l, userMenuNode: a }) => /* @__PURE__ */ i(
286
- "header",
287
- {
288
- className: o(
289
- "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",
290
- m && "left-0",
291
- !m && t && "left-[5rem]",
292
- !m && !t && "left-[16rem]"
293
- ),
294
- tabIndex: -1,
295
- children: [
296
- /* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
297
- R,
298
- {
299
- variant: "ghost",
300
- size: "icon",
301
- onClick: f,
302
- className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
303
- children: /* @__PURE__ */ e(Q, { className: "size-4" })
304
- }
305
- ) }),
306
- /* @__PURE__ */ i("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
307
- l,
308
- a
309
- ] })
310
- ]
311
- }
312
- );
313
- export {
314
- ue as G,
315
- ge as S,
316
- Ne as T,
317
- ve as a,
318
- se as b
319
- };
@@ -1,245 +0,0 @@
1
- import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
- import "date-fns/locale";
3
- import "react-i18next";
4
- import { u as b } from "./useKrosoftTranslation-DRD49kc-.js";
5
- import { c as d } from "./tailwind.helper-B6yFEsav.js";
6
- import { Command as r } from "cmdk";
7
- import { X as p, SearchIcon as w } from "lucide-react";
8
- import * as n from "react";
9
- import * as s from "@radix-ui/react-dialog";
10
- import { e as v } from "./tooltip-DVeqVwqV.js";
11
- import { cva as k } from "class-variance-authority";
12
- const C = s.Root, Z = s.Trigger, D = s.Portal, ee = s.Close, f = n.forwardRef(
13
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
14
- s.Overlay,
15
- {
16
- ref: t,
17
- className: d(
18
- "fixed inset-0 z-[70] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
19
- e
20
- ),
21
- ...a
22
- }
23
- )
24
- );
25
- f.displayName = s.Overlay.displayName;
26
- const _ = "w-full max-w-none h-[100dvh] max-h-[100dvh] content-start rounded-none sm:h-auto sm:max-h-[95vh] sm:max-w-lg sm:rounded-surface", u = n.forwardRef(
27
- ({ className: e, children: a, ...t }, l) => /* @__PURE__ */ i(D, { children: [
28
- /* @__PURE__ */ o(f, {}),
29
- /* @__PURE__ */ i(
30
- s.Content,
31
- {
32
- ref: l,
33
- className: d(
34
- "fixed left-[50%] top-[50%] z-[70] grid overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
35
- _,
36
- e
37
- ),
38
- ...t,
39
- children: [
40
- a,
41
- /* @__PURE__ */ i(s.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
42
- /* @__PURE__ */ o(p, { className: "size-4" }),
43
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
44
- ] })
45
- ]
46
- }
47
- )
48
- ] })
49
- );
50
- u.displayName = s.Content.displayName;
51
- const S = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col space-y-1.5 text-center sm:text-left", e), ...a });
52
- S.displayName = "DialogHeader";
53
- const R = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
54
- R.displayName = "DialogFooter";
55
- const g = n.forwardRef(
56
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Title, { ref: t, className: d("text-lg font-semibold leading-none tracking-tight", e), ...a })
57
- );
58
- g.displayName = s.Title.displayName;
59
- const x = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Description, { ref: t, className: d("text-sm text-muted-foreground", e), ...a }));
60
- x.displayName = s.Description.displayName;
61
- const h = n.forwardRef(
62
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
63
- r,
64
- {
65
- ref: t,
66
- className: d("flex h-full w-full flex-col overflow-hidden rounded-surface bg-popover text-popover-foreground", e),
67
- ...a
68
- }
69
- )
70
- );
71
- h.displayName = r.displayName;
72
- const ae = ({ title: e, description: a, shouldFilter: t, className: l, children: m, ...N }) => {
73
- const { t: c } = b();
74
- return /* @__PURE__ */ o(C, { ...N, children: /* @__PURE__ */ i(u, { className: "flex flex-col overflow-hidden p-0 shadow-lg", children: [
75
- /* @__PURE__ */ o(g, { className: "sr-only", children: e ?? c("search.commandTitle") }),
76
- /* @__PURE__ */ o(x, { className: "sr-only", children: a ?? c("search.commandDescription") }),
77
- /* @__PURE__ */ o(
78
- h,
79
- {
80
- shouldFilter: t,
81
- className: d(
82
- "[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3",
83
- "[&_[cmdk-list]]:max-h-none [&_[cmdk-list]]:min-h-0 [&_[cmdk-list]]:flex-1 sm:[&_[cmdk-list]]:max-h-[300px] sm:[&_[cmdk-list]]:flex-none",
84
- l
85
- ),
86
- children: m
87
- }
88
- )
89
- ] }) });
90
- }, z = n.forwardRef(
91
- ({ className: e, ...a }, t) => /* @__PURE__ */ i("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
92
- /* @__PURE__ */ o(w, { className: "mr-2 size-4 shrink-0 opacity-50" }),
93
- /* @__PURE__ */ o(
94
- r.Input,
95
- {
96
- ref: t,
97
- className: d(
98
- "flex h-11 w-full rounded-control bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
99
- e
100
- ),
101
- ...a
102
- }
103
- )
104
- ] })
105
- );
106
- z.displayName = r.Input.displayName;
107
- const T = n.forwardRef(
108
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(r.List, { ref: t, className: d("max-h-[300px] overflow-y-auto overflow-x-hidden", e), ...a })
109
- );
110
- T.displayName = r.List.displayName;
111
- const I = n.forwardRef(
112
- (e, a) => /* @__PURE__ */ o(r.Empty, { ref: a, className: "py-6 text-center text-sm", ...e })
113
- );
114
- I.displayName = r.Empty.displayName;
115
- const O = n.forwardRef(
116
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
117
- r.Group,
118
- {
119
- ref: t,
120
- className: d(
121
- "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
122
- e
123
- ),
124
- ...a
125
- }
126
- )
127
- );
128
- O.displayName = r.Group.displayName;
129
- const j = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(r.Separator, { ref: t, className: d("-mx-1 h-px bg-border", e), ...a }));
130
- j.displayName = r.Separator.displayName;
131
- const P = n.forwardRef(
132
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
133
- r.Item,
134
- {
135
- ref: t,
136
- className: d(
137
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",
138
- e
139
- ),
140
- ...a
141
- }
142
- )
143
- );
144
- P.displayName = r.Item.displayName;
145
- const F = ({ className: e, ...a }) => /* @__PURE__ */ o("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...a });
146
- F.displayName = "CommandShortcut";
147
- const H = n.forwardRef(({ className: e, type: a, ...t }, l) => /* @__PURE__ */ o(
148
- "input",
149
- {
150
- type: a,
151
- className: d(
152
- v,
153
- // text-base sur mobile : évite le zoom automatique d'iOS à la prise de focus.
154
- "flex w-full text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm",
155
- e
156
- ),
157
- ref: l,
158
- ...t
159
- }
160
- ));
161
- H.displayName = "Input";
162
- const te = s.Root, oe = s.Trigger, se = s.Close, E = s.Portal, y = n.forwardRef(
163
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(
164
- s.Overlay,
165
- {
166
- className: d(
167
- "fixed inset-0 z-[70] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
168
- e
169
- ),
170
- ...a,
171
- ref: t
172
- }
173
- )
174
- );
175
- y.displayName = s.Overlay.displayName;
176
- const G = k(
177
- "fixed z-[70] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
178
- {
179
- variants: {
180
- side: {
181
- top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
182
- bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
183
- left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
184
- right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"
185
- }
186
- },
187
- defaultVariants: {
188
- side: "right"
189
- }
190
- }
191
- ), L = n.forwardRef(
192
- ({ side: e = "right", className: a, children: t, ...l }, m) => /* @__PURE__ */ i(E, { children: [
193
- /* @__PURE__ */ o(y, {}),
194
- /* @__PURE__ */ i(s.Content, { ref: m, className: d(G({ side: e }), a), ...l, children: [
195
- t,
196
- /* @__PURE__ */ i(s.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
197
- /* @__PURE__ */ o(p, { className: "size-4" }),
198
- /* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
199
- ] })
200
- ] })
201
- ] })
202
- );
203
- L.displayName = s.Content.displayName;
204
- const V = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...a });
205
- V.displayName = "SheetHeader";
206
- const q = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
207
- q.displayName = "SheetFooter";
208
- const B = n.forwardRef(
209
- ({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Title, { ref: t, className: d("text-lg font-semibold text-foreground", e), ...a })
210
- );
211
- B.displayName = s.Title.displayName;
212
- const K = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Description, { ref: t, className: d("text-sm text-muted-foreground", e), ...a }));
213
- K.displayName = s.Description.displayName;
214
- export {
215
- h as C,
216
- C as D,
217
- H as I,
218
- te as S,
219
- ee as a,
220
- u as b,
221
- x as c,
222
- R as d,
223
- S as e,
224
- f,
225
- D as g,
226
- g as h,
227
- Z as i,
228
- ae as j,
229
- I as k,
230
- O as l,
231
- z as m,
232
- P as n,
233
- T as o,
234
- j as p,
235
- F as q,
236
- se as r,
237
- L as s,
238
- K as t,
239
- q as u,
240
- V as v,
241
- y as w,
242
- E as x,
243
- B as y,
244
- oe as z
245
- };