@krosoft/react 0.0.139 → 0.0.140

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.
@@ -16,17 +16,17 @@ const K = ({
16
16
  label: m,
17
17
  badge: n,
18
18
  subItems: t,
19
- currentPath: a,
19
+ currentPath: r,
20
20
  collapsed: d,
21
21
  dense: p = !1,
22
22
  onItemClick: g
23
23
  }) => {
24
- const [x, v] = O.useState((t == null ? void 0 : t.some((r) => a === r.path || a.startsWith(`${r.path}/`))) ?? !1), u = o ? a === o || o !== "/" && a.startsWith(`${o}/`) : !1, b = t == null ? void 0 : t.some((r) => a === r.path || a.startsWith(`${r.path}/`)), N = /* @__PURE__ */ l(
24
+ const [x, v] = O.useState((t == null ? void 0 : t.some((a) => r === a.path || r.startsWith(`${a.path}/`))) ?? !1), u = o ? r === o || o !== "/" && r.startsWith(`${o}/`) : !1, b = t == null ? void 0 : t.some((a) => r === a.path || r.startsWith(`${a.path}/`)), N = /* @__PURE__ */ l(
25
25
  "a",
26
26
  {
27
27
  href: o ?? "#",
28
- onClick: (r) => {
29
- r.preventDefault(), t && t.length > 0 ? d || v(!x) : o && g(o);
28
+ onClick: (a) => {
29
+ a.preventDefault(), t && t.length > 0 ? d || v(!x) : o && g(o);
30
30
  },
31
31
  className: s(
32
32
  "flex items-center cursor-pointer transition-all duration-200 group",
@@ -71,14 +71,14 @@ const K = ({
71
71
  "flex flex-col ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200",
72
72
  p ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
73
73
  ),
74
- children: t.map((r, k) => {
75
- const y = a === r.path || r.path !== "/" && a.startsWith(`${r.path}/`);
74
+ children: t.map((a, k) => {
75
+ const y = r === a.path || a.path !== "/" && r.startsWith(`${a.path}/`);
76
76
  return /* @__PURE__ */ l(
77
77
  "a",
78
78
  {
79
- href: r.path,
79
+ href: a.path,
80
80
  onClick: (i) => {
81
- i.preventDefault(), g(r.path);
81
+ i.preventDefault(), g(a.path);
82
82
  },
83
83
  className: s(
84
84
  "flex items-center justify-between rounded-xl text-sm transition-all duration-200",
@@ -86,8 +86,8 @@ const K = ({
86
86
  y ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
87
87
  ),
88
88
  children: [
89
- /* @__PURE__ */ e("span", { children: r.label }),
90
- r.badge !== void 0 && /* @__PURE__ */ e("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: r.badge })
89
+ /* @__PURE__ */ e("span", { children: a.label }),
90
+ a.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: a.badge })
91
91
  ]
92
92
  },
93
93
  k
@@ -96,20 +96,20 @@ const K = ({
96
96
  }
97
97
  )
98
98
  ] });
99
- }, te = ({ groups: o, currentPath: c, onItemClick: m, slots: n, search: t, dense: a = !1, loading: d = !1 }) => {
99
+ }, te = ({ groups: o, currentPath: c, onItemClick: m, slots: n, search: t, dense: r = !1, loading: d = !1 }) => {
100
100
  const { enabled: p = !1, placeholder: g = "Rechercher..." } = t ?? {}, { header: x, footer: v } = n ?? {}, { collapsed: u, isMobile: b, setCollapsed: w } = W(), [S, j] = O.useState(""), h = b ? !1 : u, T = !u, N = (i) => {
101
101
  m(i), b && w(!0);
102
- }, r = S.trim().toLowerCase(), k = r === "" ? o : o.map((i) => ({
102
+ }, a = S.trim().toLowerCase(), k = a === "" ? o : o.map((i) => ({
103
103
  ...i,
104
104
  items: i.items.filter(
105
105
  (f) => {
106
106
  var C;
107
- return f.label.toLowerCase().includes(r) || (((C = f.subItems) == null ? void 0 : C.some((z) => z.label.toLowerCase().includes(r))) ?? !1);
107
+ return f.label.toLowerCase().includes(a) || (((C = f.subItems) == null ? void 0 : C.some((z) => z.label.toLowerCase().includes(a))) ?? !1);
108
108
  }
109
109
  )
110
110
  })).filter((i) => i.items.length > 0), y = /* @__PURE__ */ l("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
111
111
  x,
112
- p && !h && /* @__PURE__ */ e("div", { className: s("px-4", a ? "pt-2" : "pt-4"), children: /* @__PURE__ */ l("div", { className: "relative", children: [
112
+ p && !h && /* @__PURE__ */ e("div", { className: s("px-4", r ? "pt-2" : "pt-4"), children: /* @__PURE__ */ l("div", { className: "relative", children: [
113
113
  /* @__PURE__ */ e(L, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
114
114
  /* @__PURE__ */ e(
115
115
  G,
@@ -122,19 +122,19 @@ const K = ({
122
122
  placeholder: g,
123
123
  className: s(
124
124
  "bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
125
- a ? "h-8 text-sm" : "h-9"
125
+ r ? "h-8 text-sm" : "h-9"
126
126
  )
127
127
  }
128
128
  )
129
129
  ] }) }),
130
- /* @__PURE__ */ e("div", { className: s("flex-1 overflow-y-auto px-2 scrollbar-modern", a ? "py-2" : "py-4"), children: d ? Array.from({ length: 5 }).map((i, f) => /* @__PURE__ */ l("div", { className: s("flex items-center gap-3", a ? "mb-1 h-9" : "mb-2 h-12", h ? "justify-center px-3" : "px-4"), children: [
130
+ /* @__PURE__ */ e("div", { className: s("flex-1 overflow-y-auto px-2 scrollbar-modern", r ? "py-2" : "py-4"), children: d ? Array.from({ length: 5 }).map((i, f) => /* @__PURE__ */ l("div", { className: s("flex items-center gap-3", r ? "mb-1 h-9" : "mb-2 h-12", h ? "justify-center px-3" : "px-4"), children: [
131
131
  /* @__PURE__ */ e(D, { className: "size-5 flex-shrink-0 rounded-md" }),
132
132
  !h && /* @__PURE__ */ e(D, { className: "h-4 flex-1" })
133
- ] }, f)) : k.map((i, f) => /* @__PURE__ */ l("div", { className: a ? "mb-3" : "mb-6", children: [
134
- !h && i.title !== void 0 && i.title !== "" && /* @__PURE__ */ e("h3", { className: s("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", a ? "mb-1" : "mb-2"), children: i.title }),
135
- /* @__PURE__ */ e("nav", { className: s("flex flex-col", a ? "gap-0.5" : "gap-1"), children: i.items.map((C, z) => /* @__PURE__ */ e(K, { ...C, currentPath: c, collapsed: h, dense: a, onItemClick: N }, z)) })
133
+ ] }, f)) : k.map((i, f) => /* @__PURE__ */ l("div", { className: r ? "mb-3" : "mb-6", children: [
134
+ !h && i.title !== void 0 && i.title !== "" && /* @__PURE__ */ e("h3", { className: s("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", r ? "mb-1" : "mb-2"), children: i.title }),
135
+ /* @__PURE__ */ e("nav", { className: s("flex flex-col", r ? "gap-0.5" : "gap-1"), children: i.items.map((C, z) => /* @__PURE__ */ e(K, { ...C, currentPath: c, collapsed: h, dense: r, onItemClick: N }, z)) })
136
136
  ] }, f)) }),
137
- v && /* @__PURE__ */ e("div", { className: s("border-t border-sidebar-border", a ? "p-2" : "p-4", h ? "flex justify-center" : ""), children: v })
137
+ v && /* @__PURE__ */ e("div", { className: s("border-t border-sidebar-border", r ? "p-2" : "p-4", h ? "flex justify-center" : ""), children: v })
138
138
  ] });
139
139
  return b ? /* @__PURE__ */ e(
140
140
  H,
@@ -152,7 +152,11 @@ const K = ({
152
152
  ) : /* @__PURE__ */ e(q, { delayDuration: 0, children: /* @__PURE__ */ e(
153
153
  "aside",
154
154
  {
155
- className: s("flex flex-col bg-sidebar h-screen transition-all duration-300", h ? "w-[--navbar-width-icon]" : "w-[--navbar-width]", "flex"),
155
+ className: s(
156
+ "flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
157
+ h ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
158
+ "flex"
159
+ ),
156
160
  style: {
157
161
  "--navbar-width": "16rem",
158
162
  "--navbar-width-icon": "5rem"
@@ -167,7 +171,7 @@ const K = ({
167
171
  icon: m,
168
172
  dense: n = !1
169
173
  }) => {
170
- const { collapsed: t, isMobile: a } = W(), d = a ? !1 : t;
174
+ const { collapsed: t, isMobile: r } = W(), d = r ? !1 : t;
171
175
  return /* @__PURE__ */ l("div", { className: s("flex items-center flex-shrink-0 gap-3 px-4", n ? "h-14" : "h-16 md:h-20", d ? "justify-center" : ""), children: [
172
176
  m !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(m, { className: n ? "size-5" : "size-6" }) }),
173
177
  !d && /* @__PURE__ */ l("div", { className: "flex flex-col", children: [
@@ -11,7 +11,7 @@ import { A as w } from "../../AppActions-DCaejx-3.js";
11
11
  import { A as J } from "../../AppSubTitle-BNd5_q0i.js";
12
12
  import { A as U } from "../../AppTitle-uboDuil4.js";
13
13
  import { K as X } from "../../KpiCardsLayout-DDR49Qqh.js";
14
- import { S as Z, a as _, b as $, T as aa } from "../../Topbar-CG_bVPE_.js";
14
+ import { S as Z, a as _, b as $, T as aa } from "../../Topbar-CesmKByg.js";
15
15
  import { E as ra } from "../../ErrorAlert-DH1onuyt.js";
16
16
  import { E as sa } from "../../ErrorState-vU8d4CwD.js";
17
17
  import { L as ia } from "../../LoadingState-BN0YaPSs.js";
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/Sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CA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WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAE3B,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAGpC,KAAK,CAAC,EAAE,YAAY,CAAC;IAGrB,MAAM,CAAC,EAAE,aAAa,CAAC;IAGvB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,eAAO,MAAM,OAAO,GAAI,qEAAqF,YAAY,KAAG,KAAK,CAAC,YAuHjI,CAAC"}
@@ -1,4 +1,4 @@
1
- import { S as r, a as b, b as d, T as s } from "../../../Topbar-CG_bVPE_.js";
1
+ import { S as r, a as b, b as d, T as s } from "../../../Topbar-CesmKByg.js";
2
2
  export {
3
3
  r as Sidebar,
4
4
  b as SidebarHeader,
@@ -11,7 +11,7 @@ import { A as rr } from "../AppActions-DCaejx-3.js";
11
11
  import { A as tr } from "../AppSubTitle-BNd5_q0i.js";
12
12
  import { A as ir } from "../AppTitle-uboDuil4.js";
13
13
  import { K as br } from "../KpiCardsLayout-DDR49Qqh.js";
14
- import { S as ur, a as gr, b as dr, T as mr } from "../Topbar-CG_bVPE_.js";
14
+ import { S as ur, a as gr, b as dr, T as mr } from "../Topbar-CesmKByg.js";
15
15
  import { E as Sr } from "../ErrorAlert-DH1onuyt.js";
16
16
  import { E as cr } from "../ErrorState-vU8d4CwD.js";
17
17
  import { L as Mr } from "../LoadingState-BN0YaPSs.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.139",
3
+ "version": "0.0.140",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {