@krosoft/react 0.0.233 → 0.0.234

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.
@@ -1,17 +1,17 @@
1
- import { jsxs as s, Fragment as L, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as s, Fragment as G, jsx as e } from "react/jsx-runtime";
2
2
  import "date-fns/locale";
3
3
  import "react-i18next";
4
- import { u as G } from "./useKrosoftTranslation-BTp46G94.js";
5
- import * as K from "react";
6
- import { SearchIcon as U, LoaderCircleIcon as _, BellIcon as F, Trash2Icon as M, ChevronDownIcon as Q, MenuIcon as R } from "lucide-react";
4
+ import { u as B } from "./useKrosoftTranslation-BTp46G94.js";
5
+ import * as $ from "react";
6
+ import { SearchIcon as _, LoaderCircleIcon as M, BellIcon as Q, Trash2Icon as R, ChevronDownIcon as q, MenuIcon as H } from "lucide-react";
7
7
  import { c as l } from "./tailwind.helper-B6yFEsav.js";
8
- import { B as E, T as q, c as H, a as P, b as V } from "./tooltip-DVeqVwqV.js";
9
- import { j as X, m as J, o as Y, k as Z, l as I, n as ee, P as te, s as re, r as ae, S as se, I as ie, u as ne, w as le, E as oe, x as ce } from "./sheet-XYI-ezvY.js";
8
+ import { B as E, T as P, c as V, a as X, b as J } from "./tooltip-DVeqVwqV.js";
9
+ import { j as Y, m as Z, o as I, k as ee, l as te, n as re, P as ae, s as se, r as ie, S as ne, I as le, u as oe, w as ce, E as de, x as me } from "./sheet-XYI-ezvY.js";
10
10
  import "./sidebar.context-D5nywlmP.js";
11
- import { u as W } from "./useSidebar-BJuALHqQ.js";
11
+ import { u as F } from "./useSidebar-BJuALHqQ.js";
12
12
  import "next-themes";
13
- import { S as B } from "./skeleton-BX4RcsiK.js";
14
- const ke = ({
13
+ import { S as W } from "./skeleton-BX4RcsiK.js";
14
+ const Se = ({
15
15
  groups: i,
16
16
  search: d,
17
17
  onSearch: h,
@@ -23,179 +23,181 @@ const ke = ({
23
23
  triggerLabel: g,
24
24
  shortcut: N = !0,
25
25
  shortcutLabel: w = "Ctrl+K",
26
- placeholder: z,
27
- emptyLabel: S,
26
+ placeholder: S,
27
+ emptyLabel: j,
28
28
  loadingLabel: k,
29
- title: j,
30
- description: D,
31
- hint: A,
32
- className: b
29
+ title: T,
30
+ description: A,
31
+ hint: K,
32
+ className: u
33
33
  }) => {
34
- const { t: p } = G(), [T, n] = K.useState(!1), y = c !== void 0, C = y ? c : T, a = K.useCallback(
35
- (f) => {
36
- y || n(f), m == null || m(f);
34
+ const { t: b } = B(), [D, t] = $.useState(!1), z = c !== void 0, v = z ? c : D, a = $.useCallback(
35
+ (n) => {
36
+ z || t(n), m == null || m(n);
37
37
  },
38
- [y, m]
38
+ [z, m]
39
39
  );
40
- K.useEffect(() => {
40
+ $.useEffect(() => {
41
41
  if (!N) return;
42
- const f = (t) => {
43
- t.key.toLowerCase() !== "k" || !(t.metaKey || t.ctrlKey) || (t.preventDefault(), a(!C));
42
+ const n = (p) => {
43
+ p.key.toLowerCase() !== "k" || !(p.metaKey || p.ctrlKey) || (p.preventDefault(), a(!v));
44
44
  };
45
- return window.addEventListener("keydown", f), () => {
46
- window.removeEventListener("keydown", f);
45
+ return window.addEventListener("keydown", n), () => {
46
+ window.removeEventListener("keydown", n);
47
47
  };
48
- }, [N, C, a]);
49
- const u = (f) => {
50
- a(!1), h(""), o(f);
51
- }, v = i.some((f) => f.items.length > 0);
52
- return /* @__PURE__ */ s(L, { children: [
48
+ }, [N, v, a]);
49
+ const y = (n) => {
50
+ a(!1), h(""), o(n);
51
+ }, C = i.some((n) => n.items.length > 0);
52
+ return /* @__PURE__ */ s(G, { children: [
53
53
  x && /* @__PURE__ */ e(
54
54
  E,
55
55
  {
56
56
  variant: "ghost",
57
57
  size: "icon",
58
- "aria-label": g ?? p("search.trigger"),
59
- title: N ? `${g ?? p("search.trigger")} (${w})` : g ?? p("search.trigger"),
58
+ "aria-label": g ?? b("search.trigger"),
59
+ title: N ? `${g ?? b("search.trigger")} (${w})` : g ?? b("search.trigger"),
60
60
  className: "rounded-full",
61
61
  onClick: () => {
62
62
  a(!0);
63
63
  },
64
- children: /* @__PURE__ */ e(U, { className: "size-4" })
64
+ children: /* @__PURE__ */ e(_, { className: "size-4" })
65
65
  }
66
66
  ),
67
67
  /* @__PURE__ */ s(
68
- X,
68
+ Y,
69
69
  {
70
- open: C,
70
+ open: v,
71
71
  onOpenChange: a,
72
- title: j ?? p("search.globalTitle"),
73
- description: D ?? p("search.globalDescription"),
72
+ title: T ?? b("search.globalTitle"),
73
+ description: A ?? b("search.globalDescription"),
74
74
  shouldFilter: !1,
75
- className: b,
75
+ className: u,
76
76
  children: [
77
- /* @__PURE__ */ e(J, { value: d, onValueChange: h, placeholder: z ?? p("search.placeholder") }),
78
- /* @__PURE__ */ s(Y, { children: [
77
+ /* @__PURE__ */ e(Z, { value: d, onValueChange: h, placeholder: S ?? b("search.placeholder") }),
78
+ /* @__PURE__ */ s(I, { children: [
79
79
  r && /* @__PURE__ */ s("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
80
- /* @__PURE__ */ e(_, { className: "size-4 animate-spin" }),
81
- k ?? p("search.loading")
80
+ /* @__PURE__ */ e(M, { className: "size-4 animate-spin" }),
81
+ k ?? b("search.loading")
82
82
  ] }),
83
- !v && !r && /* @__PURE__ */ e(Z, { children: S ?? p("states.noResultDot") }),
83
+ !C && !r && /* @__PURE__ */ e(ee, { children: j ?? b("states.noResultDot") }),
84
84
  i.map(
85
- (f) => f.items.length === 0 ? null : /* @__PURE__ */ e(I, { heading: f.heading, children: f.items.map((t) => {
86
- const $ = t.icon;
85
+ (n) => n.items.length === 0 ? null : /* @__PURE__ */ e(te, { heading: n.heading, children: n.items.map((p) => {
86
+ const O = p.icon;
87
87
  return /* @__PURE__ */ s(
88
- ee,
88
+ re,
89
89
  {
90
- value: t.key,
90
+ value: p.key,
91
91
  className: "gap-3 px-2 py-2",
92
92
  onSelect: () => {
93
- u(t);
93
+ y(p);
94
94
  },
95
95
  children: [
96
- $ && /* @__PURE__ */ e("span", { className: l("flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", t.iconClassName), children: /* @__PURE__ */ e($, { className: "size-4" }) }),
96
+ O && /* @__PURE__ */ e("span", { className: l("flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-muted-foreground", p.iconClassName), children: /* @__PURE__ */ e(O, { className: "size-4" }) }),
97
97
  /* @__PURE__ */ s("span", { className: "flex min-w-0 flex-1 flex-col", children: [
98
- /* @__PURE__ */ e("span", { className: "truncate font-medium", children: t.label }),
99
- t.description !== void 0 && t.description !== "" && /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: t.description })
98
+ /* @__PURE__ */ e("span", { className: "truncate font-medium", children: p.label }),
99
+ p.description !== void 0 && p.description !== "" && /* @__PURE__ */ e("span", { className: "truncate text-xs text-muted-foreground", children: p.description })
100
100
  ] })
101
101
  ]
102
102
  },
103
- t.key
103
+ p.key
104
104
  );
105
- }) }, f.heading)
105
+ }) }, n.heading)
106
106
  )
107
107
  ] }),
108
- A !== void 0 && v && !r && /* @__PURE__ */ e("div", { className: "border-t border-border p-2 text-center text-xs text-muted-foreground", children: A })
108
+ K !== void 0 && C && !r && /* @__PURE__ */ e("div", { className: "border-t border-border p-2 text-center text-xs text-muted-foreground", children: K })
109
109
  ]
110
110
  }
111
111
  )
112
112
  ] });
113
- }, de = 9, ze = ({
113
+ }, fe = 9, je = ({
114
114
  items: i,
115
115
  onSelect: d,
116
116
  onMarkAllAsRead: h,
117
117
  onRemove: o,
118
118
  loading: r = !1,
119
119
  unreadCount: c,
120
- maxBadgeCount: m = de,
120
+ maxBadgeCount: m = fe,
121
121
  open: x,
122
122
  onOpenChange: g,
123
123
  triggerLabel: N,
124
124
  title: w,
125
- emptyLabel: z,
126
- loadingLabel: S,
125
+ emptyLabel: S,
126
+ loadingLabel: j,
127
127
  markAllAsReadLabel: k,
128
- removeLabel: j,
129
- className: D,
130
- contentClassName: A,
131
- badgeClassName: b
128
+ removeLabel: T,
129
+ className: A,
130
+ contentClassName: K,
131
+ badgeClassName: u,
132
+ itemClassName: b,
133
+ unreadItemClassName: D
132
134
  }) => {
133
- const { t: p } = G(), [T, n] = K.useState(!1), y = x !== void 0, C = y ? x : T, a = (t) => {
134
- y || n(t), g == null || g(t);
135
- }, u = c ?? i.filter((t) => !t.read).length, v = N ?? p("notifications.trigger"), f = (t) => {
136
- a(!1), d == null || d(t);
135
+ const { t } = B(), [z, v] = $.useState(!1), a = x !== void 0, y = a ? x : z, C = (f) => {
136
+ a || v(f), g == null || g(f);
137
+ }, n = c ?? i.filter((f) => !f.read).length, p = N ?? t("notifications.trigger"), O = (f) => {
138
+ C(!1), d == null || d(f);
137
139
  };
138
- return /* @__PURE__ */ s(te, { open: C, onOpenChange: a, children: [
139
- /* @__PURE__ */ e(re, { asChild: !0, children: /* @__PURE__ */ s(
140
+ return /* @__PURE__ */ s(ae, { open: y, onOpenChange: C, children: [
141
+ /* @__PURE__ */ e(se, { asChild: !0, children: /* @__PURE__ */ s(
140
142
  E,
141
143
  {
142
144
  type: "button",
143
145
  variant: "ghost",
144
146
  size: "icon",
145
- className: l("relative rounded-full", D),
146
- "aria-label": u > 0 ? `${v} (${String(u)})` : v,
147
- title: v,
147
+ className: l("relative rounded-full", A),
148
+ "aria-label": n > 0 ? `${p} (${String(n)})` : p,
149
+ title: p,
148
150
  children: [
149
- /* @__PURE__ */ e(F, { className: "size-4" }),
150
- u > 0 && /* @__PURE__ */ e(
151
+ /* @__PURE__ */ e(Q, { className: "size-4" }),
152
+ n > 0 && /* @__PURE__ */ e(
151
153
  "span",
152
154
  {
153
155
  className: l(
154
156
  "absolute right-1 top-1 flex size-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold leading-none text-primary-foreground",
155
- b
157
+ u
156
158
  ),
157
- children: u > m ? `${String(m)}+` : u
159
+ children: n > m ? `${String(m)}+` : n
158
160
  }
159
161
  )
160
162
  ]
161
163
  }
162
164
  ) }),
163
- /* @__PURE__ */ s(ae, { align: "end", className: l("w-80 p-0", A), children: [
165
+ /* @__PURE__ */ s(ie, { align: "end", className: l("w-80 p-0", K), children: [
164
166
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-2 border-b px-3 py-2", children: [
165
- /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: w ?? p("notifications.title") }),
166
- h && u > 0 && /* @__PURE__ */ e(E, { type: "button", variant: "ghost", size: "sm", className: "h-7 text-xs", onClick: h, children: k ?? p("notifications.markAllAsRead") })
167
+ /* @__PURE__ */ e("span", { className: "text-sm font-medium", children: w ?? t("notifications.title") }),
168
+ h && n > 0 && /* @__PURE__ */ e(E, { type: "button", variant: "ghost", size: "sm", className: "h-7 text-xs", onClick: h, children: k ?? t("notifications.markAllAsRead") })
167
169
  ] }),
168
- r && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: S ?? p("states.loading") }),
169
- !r && i.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: z ?? p("notifications.empty") }),
170
- !r && i.length > 0 && /* @__PURE__ */ e(se, { className: "max-h-96", children: /* @__PURE__ */ e("ul", { className: "divide-y", children: i.map((t) => {
171
- const $ = t.icon;
172
- return /* @__PURE__ */ s("li", { className: l("flex items-start gap-2 px-3 py-2", !t.read && "bg-accent/40"), children: [
170
+ r && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: j ?? t("states.loading") }),
171
+ !r && i.length === 0 && /* @__PURE__ */ e("p", { className: "px-3 py-6 text-center text-sm text-muted-foreground", children: S ?? t("notifications.empty") }),
172
+ !r && i.length > 0 && /* @__PURE__ */ e(ne, { className: "max-h-96", children: /* @__PURE__ */ e("ul", { className: "divide-y", children: i.map((f) => {
173
+ const U = f.icon;
174
+ return /* @__PURE__ */ s("li", { className: l("flex items-start gap-2 px-3 py-2", !f.read && (D ?? "bg-accent/40"), b), children: [
173
175
  /* @__PURE__ */ s(
174
176
  "button",
175
177
  {
176
178
  type: "button",
177
179
  className: "flex min-w-0 flex-1 items-start gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",
178
180
  onClick: () => {
179
- f(t);
181
+ O(f);
180
182
  },
181
183
  children: [
182
- $ && /* @__PURE__ */ e(
184
+ U && /* @__PURE__ */ e(
183
185
  "span",
184
186
  {
185
187
  className: l(
186
188
  "mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",
187
- t.iconClassName
189
+ f.iconClassName
188
190
  ),
189
- children: /* @__PURE__ */ e($, { className: "size-3.5" })
191
+ children: /* @__PURE__ */ e(U, { className: "size-3.5" })
190
192
  }
191
193
  ),
192
194
  /* @__PURE__ */ s("span", { className: "min-w-0 flex-1 space-y-0.5", children: [
193
195
  /* @__PURE__ */ s("span", { className: "flex items-center gap-2", children: [
194
- !t.read && /* @__PURE__ */ e("span", { className: "size-1.5 shrink-0 rounded-full bg-primary", "aria-hidden": !0 }),
195
- /* @__PURE__ */ e("span", { className: l("truncate text-sm", !t.read && "font-medium"), children: t.title })
196
+ !f.read && /* @__PURE__ */ e("span", { className: "size-1.5 shrink-0 rounded-full bg-primary", "aria-hidden": !0 }),
197
+ /* @__PURE__ */ e("span", { className: l("truncate text-sm", !f.read && "font-medium"), children: f.title })
196
198
  ] }),
197
- t.description && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground", children: t.description }),
198
- t.date && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground/60", children: t.date })
199
+ f.description && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground", children: f.description }),
200
+ f.date && /* @__PURE__ */ e("span", { className: "block text-xs text-muted-foreground/60", children: f.date })
199
201
  ] })
200
202
  ]
201
203
  }
@@ -208,20 +210,20 @@ const ke = ({
208
210
  size: "icon",
209
211
  className: "size-7 shrink-0 text-muted-foreground hover:text-destructive",
210
212
  onClick: () => {
211
- o(t);
213
+ o(f);
212
214
  },
213
- "aria-label": j ?? p("notifications.remove"),
214
- title: j ?? p("notifications.remove"),
215
- children: /* @__PURE__ */ e(M, { className: "size-3.5" })
215
+ "aria-label": T ?? t("notifications.remove"),
216
+ title: T ?? t("notifications.remove"),
217
+ children: /* @__PURE__ */ e(R, { className: "size-3.5" })
216
218
  }
217
219
  )
218
- ] }, t.key);
220
+ ] }, f.key);
219
221
  }) }) })
220
222
  ] })
221
223
  ] });
222
- }, O = (i, d, h) => d === i ? !0 : i === "/" || !d.startsWith(`${i}/`) ? !1 : !h.some(
224
+ }, L = (i, d, h) => d === i ? !0 : i === "/" || !d.startsWith(`${i}/`) ? !1 : !h.some(
223
225
  (o) => o !== i && o.startsWith(`${i}/`) && (d === o || d.startsWith(`${o}/`))
224
- ), me = ({
226
+ ), pe = ({
225
227
  path: i,
226
228
  // eslint-disable-next-line @typescript-eslint/naming-convention
227
229
  icon: d,
@@ -233,34 +235,34 @@ const ke = ({
233
235
  dense: x = !1,
234
236
  onItemClick: g
235
237
  }) => {
236
- const N = (r == null ? void 0 : r.map((n) => n.path)) ?? [], [w, z] = K.useState((r == null ? void 0 : r.some((n) => O(n.path, c, N))) ?? !1), S = i ? c === i || i !== "/" && c.startsWith(`${i}/`) : !1, k = r == null ? void 0 : r.some((n) => O(n.path, c, N)), T = /* @__PURE__ */ s(
238
+ const N = (r == null ? void 0 : r.map((t) => t.path)) ?? [], [w, S] = $.useState((r == null ? void 0 : r.some((t) => L(t.path, c, N))) ?? !1), j = i ? c === i || i !== "/" && c.startsWith(`${i}/`) : !1, k = r == null ? void 0 : r.some((t) => L(t.path, c, N)), D = /* @__PURE__ */ s(
237
239
  "a",
238
240
  {
239
241
  href: i ?? "#",
240
- onClick: (n) => {
241
- n.ctrlKey || n.metaKey || n.button === 1 || (n.preventDefault(), r && r.length > 0 ? m || z(!w) : i && g(i));
242
+ onClick: (t) => {
243
+ t.ctrlKey || t.metaKey || t.button === 1 || (t.preventDefault(), r && r.length > 0 ? m || S(!w) : i && g(i));
242
244
  },
243
245
  className: l(
244
246
  "flex items-center cursor-pointer transition-all duration-200 group rounded-control",
245
247
  x ? "gap-2.5 mb-0.5" : "gap-3 mb-1",
246
248
  m ? x ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : x ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
247
- S || !m && k ? x ? "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"
249
+ j || !m && k ? x ? "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"
248
250
  ),
249
251
  children: [
250
252
  /* @__PURE__ */ e("div", { className: l("flex-shrink-0 transition-transform group-hover:scale-110", m ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(d, { className: "size-4" }) }),
251
- !m && /* @__PURE__ */ s(L, { children: [
253
+ !m && /* @__PURE__ */ s(G, { children: [
252
254
  /* @__PURE__ */ e("span", { className: l("flex-grow transition-opacity duration-150 font-medium", x ? "text-sm" : ""), children: h }),
253
255
  o !== 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: o }),
254
- r && r.length > 0 && /* @__PURE__ */ e(Q, { className: l("size-4 transition-transform duration-200", w ? "rotate-180" : "") })
256
+ r && r.length > 0 && /* @__PURE__ */ e(q, { className: l("size-4 transition-transform duration-200", w ? "rotate-180" : "") })
255
257
  ] })
256
258
  ]
257
259
  }
258
260
  );
259
- return /* @__PURE__ */ s(L, { children: [
260
- m ? /* @__PURE__ */ s(q, { children: [
261
- /* @__PURE__ */ e(H, { asChild: !0, children: T }),
261
+ return /* @__PURE__ */ s(G, { children: [
262
+ m ? /* @__PURE__ */ s(P, { children: [
263
+ /* @__PURE__ */ e(V, { asChild: !0, children: D }),
262
264
  /* @__PURE__ */ e(
263
- P,
265
+ X,
264
266
  {
265
267
  side: "right",
266
268
  sideOffset: 6,
@@ -275,7 +277,7 @@ const ke = ({
275
277
  ] }) })
276
278
  }
277
279
  )
278
- ] }) : T,
280
+ ] }) : D,
279
281
  !m && r && r.length > 0 && w && /* @__PURE__ */ e(
280
282
  "div",
281
283
  {
@@ -283,53 +285,53 @@ const ke = ({
283
285
  "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",
284
286
  x ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
285
287
  ),
286
- children: r.map((n, y) => {
287
- const C = O(n.path, c, N);
288
+ children: r.map((t, z) => {
289
+ const v = L(t.path, c, N);
288
290
  return /* @__PURE__ */ s(
289
291
  "a",
290
292
  {
291
- href: n.path,
293
+ href: t.path,
292
294
  onClick: (a) => {
293
- a.ctrlKey || a.metaKey || a.button === 1 || (a.preventDefault(), g(n.path));
295
+ a.ctrlKey || a.metaKey || a.button === 1 || (a.preventDefault(), g(t.path));
294
296
  },
295
297
  className: l(
296
298
  "flex items-center justify-between rounded-control text-sm transition-all duration-200",
297
299
  x ? "px-3 py-1" : "px-4 py-2",
298
- C ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
300
+ v ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
299
301
  ),
300
302
  children: [
301
- /* @__PURE__ */ e("span", { children: n.label }),
302
- n.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: n.badge })
303
+ /* @__PURE__ */ e("span", { children: t.label }),
304
+ t.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: t.badge })
303
305
  ]
304
306
  },
305
- y
307
+ z
306
308
  );
307
309
  })
308
310
  }
309
311
  )
310
312
  ] });
311
- }, Se = ({ groups: i, currentPath: d, onItemClick: h, slots: o, search: r, dense: c = !1, loading: m = !1 }) => {
312
- const { t: x } = G(), { enabled: g = !1, placeholder: N } = r ?? {}, { header: w, footer: z } = o ?? {}, { collapsed: S, isMobile: k, setCollapsed: j } = W(), [D, A] = K.useState(""), b = k ? !1 : S, p = !S, T = (a) => {
313
- h(a), k && j(!0);
314
- }, n = D.trim().toLowerCase(), y = n === "" ? i : i.map((a) => ({
313
+ }, Te = ({ groups: i, currentPath: d, onItemClick: h, slots: o, search: r, dense: c = !1, loading: m = !1 }) => {
314
+ const { t: x } = B(), { enabled: g = !1, placeholder: N } = r ?? {}, { header: w, footer: S } = o ?? {}, { collapsed: j, isMobile: k, setCollapsed: T } = F(), [A, K] = $.useState(""), u = k ? !1 : j, b = !j, D = (a) => {
315
+ h(a), k && T(!0);
316
+ }, t = A.trim().toLowerCase(), z = t === "" ? i : i.map((a) => ({
315
317
  ...a,
316
318
  items: a.items.filter(
317
- (u) => {
318
- var v;
319
- return u.label.toLowerCase().includes(n) || (((v = u.subItems) == null ? void 0 : v.some((f) => f.label.toLowerCase().includes(n))) ?? !1);
319
+ (y) => {
320
+ var C;
321
+ return y.label.toLowerCase().includes(t) || (((C = y.subItems) == null ? void 0 : C.some((n) => n.label.toLowerCase().includes(t))) ?? !1);
320
322
  }
321
323
  )
322
- })).filter((a) => a.items.length > 0), C = /* @__PURE__ */ s("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
324
+ })).filter((a) => a.items.length > 0), v = /* @__PURE__ */ s("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
323
325
  w,
324
- g && !b && /* @__PURE__ */ e("div", { className: l("px-4", c ? "pt-2" : "pt-4"), children: /* @__PURE__ */ s("div", { className: "relative", children: [
325
- /* @__PURE__ */ e(U, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
326
+ g && !u && /* @__PURE__ */ e("div", { className: l("px-4", c ? "pt-2" : "pt-4"), children: /* @__PURE__ */ s("div", { className: "relative", children: [
327
+ /* @__PURE__ */ e(_, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
326
328
  /* @__PURE__ */ e(
327
- ie,
329
+ le,
328
330
  {
329
331
  type: "search",
330
- value: D,
332
+ value: A,
331
333
  onChange: (a) => {
332
- A(a.target.value);
334
+ K(a.target.value);
333
335
  },
334
336
  placeholder: N ?? x("search.placeholder"),
335
337
  className: l(
@@ -339,51 +341,51 @@ const ke = ({
339
341
  }
340
342
  )
341
343
  ] }) }),
342
- /* @__PURE__ */ e("div", { className: l("flex-1 overflow-y-auto scrollbar-modern", b ? "px-0" : "px-2", c ? "py-2" : "py-4"), children: m ? Array.from({ length: 5 }).map((a, u) => /* @__PURE__ */ s("div", { className: l("flex items-center gap-3", c ? "mb-1 h-9" : "mb-2 h-12", b ? "justify-center px-3" : "px-4"), children: [
343
- /* @__PURE__ */ e(B, { className: "size-5 flex-shrink-0 rounded-control" }),
344
- !b && /* @__PURE__ */ e(B, { className: "h-4 flex-1" })
345
- ] }, u)) : y.map((a, u) => /* @__PURE__ */ s("div", { className: c ? "mb-3" : "mb-6", children: [
346
- !b && a.title !== void 0 && a.title !== "" && /* @__PURE__ */ e("h3", { className: l("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", c ? "mb-1" : "mb-2"), children: a.title }),
347
- /* @__PURE__ */ e("nav", { className: l("flex flex-col", c ? "gap-0.5" : "gap-1"), children: a.items.map((v, f) => /* @__PURE__ */ e(me, { ...v, currentPath: d, collapsed: b, dense: c, onItemClick: T }, f)) })
348
- ] }, u)) }),
349
- z && /* @__PURE__ */ e("div", { className: l("border-t border-sidebar-border", c ? "p-2" : "p-4", b ? "flex justify-center" : ""), children: z })
344
+ /* @__PURE__ */ e("div", { className: l("flex-1 overflow-y-auto scrollbar-modern", u ? "px-0" : "px-2", c ? "py-2" : "py-4"), children: m ? Array.from({ length: 5 }).map((a, y) => /* @__PURE__ */ s("div", { className: l("flex items-center gap-3", c ? "mb-1 h-9" : "mb-2 h-12", u ? "justify-center px-3" : "px-4"), children: [
345
+ /* @__PURE__ */ e(W, { className: "size-5 flex-shrink-0 rounded-control" }),
346
+ !u && /* @__PURE__ */ e(W, { className: "h-4 flex-1" })
347
+ ] }, y)) : z.map((a, y) => /* @__PURE__ */ s("div", { className: c ? "mb-3" : "mb-6", children: [
348
+ !u && a.title !== void 0 && a.title !== "" && /* @__PURE__ */ e("h3", { className: l("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", c ? "mb-1" : "mb-2"), children: a.title }),
349
+ /* @__PURE__ */ e("nav", { className: l("flex flex-col", c ? "gap-0.5" : "gap-1"), children: a.items.map((C, n) => /* @__PURE__ */ e(pe, { ...C, currentPath: d, collapsed: u, dense: c, onItemClick: D }, n)) })
350
+ ] }, y)) }),
351
+ S && /* @__PURE__ */ e("div", { className: l("border-t border-sidebar-border", c ? "p-2" : "p-4", u ? "flex justify-center" : ""), children: S })
350
352
  ] });
351
353
  return k ? /* @__PURE__ */ e(
352
- ne,
354
+ oe,
353
355
  {
354
- open: p,
356
+ open: b,
355
357
  onOpenChange: (a) => {
356
- j(!a);
358
+ T(!a);
357
359
  },
358
- children: /* @__PURE__ */ s(le, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
359
- /* @__PURE__ */ e(oe, { className: "sr-only", children: x("sidebar.menu") }),
360
- /* @__PURE__ */ e(ce, { className: "sr-only", children: x("sidebar.description") }),
361
- C
360
+ children: /* @__PURE__ */ s(ce, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
361
+ /* @__PURE__ */ e(de, { className: "sr-only", children: x("sidebar.menu") }),
362
+ /* @__PURE__ */ e(me, { className: "sr-only", children: x("sidebar.description") }),
363
+ v
362
364
  ] })
363
365
  }
364
- ) : /* @__PURE__ */ e(V, { delayDuration: 0, children: /* @__PURE__ */ e(
366
+ ) : /* @__PURE__ */ e(J, { delayDuration: 0, children: /* @__PURE__ */ e(
365
367
  "aside",
366
368
  {
367
369
  className: l(
368
370
  "flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
369
- b ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
371
+ u ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
370
372
  "flex"
371
373
  ),
372
374
  style: {
373
375
  "--navbar-width": "16rem",
374
376
  "--navbar-width-icon": "4rem"
375
377
  },
376
- children: C
378
+ children: v
377
379
  }
378
380
  ) });
379
- }, je = ({
381
+ }, De = ({
380
382
  name: i = "appname",
381
383
  subName: d = "appsubname",
382
384
  // eslint-disable-next-line @typescript-eslint/naming-convention
383
385
  icon: h,
384
386
  dense: o = !1
385
387
  }) => {
386
- const { collapsed: r, isMobile: c } = W(), m = c ? !1 : r;
388
+ const { collapsed: r, isMobile: c } = F(), m = c ? !1 : r;
387
389
  return /* @__PURE__ */ s("div", { className: l("flex items-center flex-shrink-0 gap-3 px-4", o ? "h-14" : "h-16 md:h-20", m ? "justify-center" : ""), children: [
388
390
  h !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(h, { className: o ? "size-5" : "size-6" }) }),
389
391
  !m && /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
@@ -391,7 +393,7 @@ const ke = ({
391
393
  /* @__PURE__ */ e("span", { className: l("text-sidebar-muted font-medium", o ? "text-[11px]" : "text-xs"), children: d })
392
394
  ] })
393
395
  ] });
394
- }, Te = ({ collapsed: i, isMobile: d, onToggleSidebar: h, actionsNode: o, userMenuNode: r }) => /* @__PURE__ */ s(
396
+ }, Ae = ({ collapsed: i, isMobile: d, onToggleSidebar: h, actionsNode: o, userMenuNode: r }) => /* @__PURE__ */ s(
395
397
  "header",
396
398
  {
397
399
  className: l(
@@ -409,7 +411,7 @@ const ke = ({
409
411
  size: "icon",
410
412
  onClick: h,
411
413
  className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
412
- children: /* @__PURE__ */ e(R, { className: "size-4" })
414
+ children: /* @__PURE__ */ e(H, { className: "size-4" })
413
415
  }
414
416
  ) }),
415
417
  /* @__PURE__ */ s("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
@@ -420,10 +422,10 @@ const ke = ({
420
422
  }
421
423
  );
422
424
  export {
423
- ke as G,
424
- ze as N,
425
- Se as S,
426
- Te as T,
427
- je as a,
428
- me as b
425
+ Se as G,
426
+ je as N,
427
+ Te as S,
428
+ Ae as T,
429
+ De as a,
430
+ pe as b
429
431
  };
@@ -14,7 +14,7 @@ import { A as ea } from "../../AppActions-BFwztl-1.js";
14
14
  import { A as oa, K as sa } from "../../KpiCardsLayout-Ca6otKVw.js";
15
15
  import { A as ia } from "../../AppSubTitle-BTN0YAc7.js";
16
16
  import { A as pa } from "../../AppTitle-D15YXeMx.js";
17
- import { G as ma, N as Ca, S as na, a as ba, b as fa, T as Aa } from "../../Topbar-CPWjqOBF.js";
17
+ import { G as ma, N as Ca, S as na, a as ba, b as fa, T as Aa } from "../../Topbar-Clby5_uj.js";
18
18
  import { E as da } from "../../ErrorAlert-B99Xb_Hg.js";
19
19
  import { E as Ta } from "../../ErrorState-CkeS_IBT.js";
20
20
  import { L as Da } from "../../LoadingState-BN0YaPSs.js";
@@ -52,6 +52,14 @@ export interface NotificationsBellProps {
52
52
  contentClassName?: string;
53
53
  /** Classes de la pastille de comptage, pour l'accorder à la charte de l'application. */
54
54
  badgeClassName?: string;
55
+ /** Classes ajoutées à chaque entrée de la liste. */
56
+ itemClassName?: string;
57
+ /**
58
+ * Classes des entrées non lues. Remplace la mise en avant par défaut (`bg-accent/40`) plutôt
59
+ * que de s'y ajouter : deux fonds concurrents ne se départagent pas, l'ordre des classes
60
+ * Tailwind ne décidant pas du gagnant.
61
+ */
62
+ unreadItemClassName?: string;
55
63
  }
56
64
  /**
57
65
  * Cloche de notifications : pastille de comptage et panneau listant les messages reçus.
@@ -60,5 +68,5 @@ export interface NotificationsBellProps {
60
68
  * les entrées et décide de ce que fait un clic. C'est ce qui lui permet de servir aussi bien un
61
69
  * historique stocké en base qu'une liste tenue en mémoire.
62
70
  */
63
- export declare const NotificationsBell: ({ items, onSelect, onMarkAllAsRead, onRemove, loading, unreadCount, maxBadgeCount, open, onOpenChange, triggerLabel, title, emptyLabel, loadingLabel, markAllAsReadLabel, removeLabel, className, contentClassName, badgeClassName, }: NotificationsBellProps) => React.ReactElement;
71
+ export declare const NotificationsBell: ({ items, onSelect, onMarkAllAsRead, onRemove, loading, unreadCount, maxBadgeCount, open, onOpenChange, triggerLabel, title, emptyLabel, loadingLabel, markAllAsReadLabel, removeLabel, className, contentClassName, badgeClassName, itemClassName, unreadItemClassName, }: NotificationsBellProps) => React.ReactElement;
64
72
  //# sourceMappingURL=NotificationsBell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsBell.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/NotificationsBell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAID;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,uOAmB/B,sBAAsB,KAAG,KAAK,CAAC,YAyHjC,CAAC"}
1
+ {"version":3,"file":"NotificationsBell.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/NotificationsBell.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,yEAAyE;IACzE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAE1B,gGAAgG;IAChG,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C,+EAA+E;IAC/E,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,0EAA0E;IAC1E,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE5C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uFAAuF;IACvF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,2QAqB/B,sBAAsB,KAAG,KAAK,CAAC,YAyHjC,CAAC"}
@@ -1,4 +1,4 @@
1
- import { G as r, N as s, S as b, a as i, b as o, T as S } from "../../../Topbar-CPWjqOBF.js";
1
+ import { G as r, N as s, S as b, a as i, b as o, T as S } from "../../../Topbar-Clby5_uj.js";
2
2
  export {
3
3
  r as GlobalSearch,
4
4
  s as NotificationsBell,
@@ -14,7 +14,7 @@ import { A as gs } from "../AppActions-BFwztl-1.js";
14
14
  import { A as ds, K as Ss } from "../KpiCardsLayout-Ca6otKVw.js";
15
15
  import { A as cs } from "../AppSubTitle-BTN0YAc7.js";
16
16
  import { A as Ms } from "../AppTitle-D15YXeMx.js";
17
- import { G as As, N as hs, S as fs, a as Ps, b as Is, T as ws } from "../Topbar-CPWjqOBF.js";
17
+ import { G as As, N as hs, S as fs, a as Ps, b as Is, T as ws } from "../Topbar-Clby5_uj.js";
18
18
  import { E as Fs } from "../ErrorAlert-B99Xb_Hg.js";
19
19
  import { E as Bs } from "../ErrorState-CkeS_IBT.js";
20
20
  import { L as ks } from "../LoadingState-BN0YaPSs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.233",
3
+ "version": "0.0.234",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {