@krosoft/react 0.0.224 → 0.0.225

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 (52) hide show
  1. package/dist/{AppActions-BSJrimRT.js → AppActions-QHJ6CP5w.js} +1 -1
  2. package/dist/{AppSubTitle-Equl_f9z.js → AppSubTitle-BlwAxtMX.js} +1 -1
  3. package/dist/{AppVerticalTabs-BFq6RKPC.js → AppVerticalTabs-C6MH4a0M.js} +31 -30
  4. package/dist/{ConfirmationDialog-DN6GePo-.js → ConfirmationDialog-CK65nSle.js} +10 -9
  5. package/dist/{DataTable-NyRTdROD.js → DataTable-DSrsTb_t.js} +6 -4
  6. package/dist/{ErrorAlert-BKC2JjNf.js → ErrorAlert-BIQ2Te6B.js} +5 -3
  7. package/dist/{ErrorState-C8pd098n.js → ErrorState-ZtWe5C0s.js} +8 -6
  8. package/dist/{GenericForm-BKePZqqI.js → GenericForm-B7L7NkrE.js} +34 -33
  9. package/dist/{ImageInput-BkmK7odp.js → ImageInput-CBDkCEho.js} +9 -7
  10. package/dist/{KpiCardsLayout-D44vxMHX.js → KpiCardsLayout-CUDfA-AP.js} +13 -12
  11. package/dist/{MultiSelect-D0WF96y6.js → MultiSelect-DWNOCqe1.js} +6 -4
  12. package/dist/{PieChart-DvJ9D4dB.js → PieChart-gP2QNrAQ.js} +50 -48
  13. package/dist/{SearchInput-pnwtB4jO.js → SearchInput-Y-iBtCCc.js} +95 -93
  14. package/dist/{SkeletonCards-DhsZyG9k.js → SkeletonCards-CQKcSQW3.js} +1 -1
  15. package/dist/{TableFilter-DXPRe6iE.js → TableFilter-CJrFjUod.js} +8 -6
  16. package/dist/{ThemeSelector-sn3tI4F7.js → ThemeSelector-BtQNjlYA.js} +15 -13
  17. package/dist/{Topbar-BkP4V9zD.js → Topbar-DYim779_.js} +12 -11
  18. package/dist/components/core/cards/index.js +1 -1
  19. package/dist/components/core/charts/index.js +1 -1
  20. package/dist/components/core/dialogs/index.js +2 -2
  21. package/dist/components/core/filters/index.js +1 -1
  22. package/dist/components/core/forms/index.js +1 -1
  23. package/dist/components/core/index.js +18 -18
  24. package/dist/components/core/inputs/DatePicker.d.ts.map +1 -1
  25. package/dist/components/core/inputs/DateRangePicker.d.ts.map +1 -1
  26. package/dist/components/core/inputs/index.js +3 -3
  27. package/dist/components/core/layouts/index.js +3 -3
  28. package/dist/components/core/navbar/index.js +1 -1
  29. package/dist/components/core/states/index.js +2 -2
  30. package/dist/components/core/table/index.js +1 -1
  31. package/dist/components/core/tabs/index.js +1 -1
  32. package/dist/components/core/theme/index.js +1 -1
  33. package/dist/components/index.js +18 -18
  34. package/dist/components/ui/index.js +1 -1
  35. package/dist/hooks/behavior/index.js +1 -1
  36. package/dist/hooks/index.js +2 -2
  37. package/dist/hooks/ui/index.js +1 -1
  38. package/dist/i18n/index.d.ts +1 -0
  39. package/dist/i18n/index.d.ts.map +1 -1
  40. package/dist/i18n/index.js +7 -4
  41. package/dist/i18n/krosoftLocales.d.ts +4 -0
  42. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  43. package/dist/i18n/useDateFnsLocale.d.ts +11 -0
  44. package/dist/i18n/useDateFnsLocale.d.ts.map +1 -0
  45. package/dist/providers/index.js +7 -6
  46. package/dist/{sheet-C_39QrG0.js → sheet-tuC_C3M3.js} +12 -10
  47. package/dist/useDateFnsLocale-C4oFFUWO.js +11 -0
  48. package/dist/useKrosoftTranslation-DtdbUewZ.js +43 -0
  49. package/dist/{usePage-C5RL0-WN.js → usePage-D3WXYmjl.js} +9 -7
  50. package/dist/{useTheme-CJVjqtt2.js → useTheme-DyeQyPDL.js} +8 -6
  51. package/package.json +1 -1
  52. package/dist/useKrosoftTranslation-C6AC_uCA.js +0 -43
@@ -1,15 +1,17 @@
1
- import { jsxs as m, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
2
  import { f as N, j as x, k as y, C as R, d as A, e as V, b as P, a as S, g as B, h as H } from "./chart-DntJZGxB.js";
3
3
  import { c as C } from "./tailwind.helper-B6yFEsav.js";
4
- import * as p from "react";
4
+ import * as v from "react";
5
5
  import { BarChart as b, CartesianGrid as M, XAxis as w, YAxis as D, Bar as j, LineChart as O, Line as _, PieChart as $, Pie as E } from "recharts";
6
- import { u as I } from "./useKrosoftTranslation-C6AC_uCA.js";
6
+ import "date-fns/locale";
7
+ import "react-i18next";
8
+ import { u as I } from "./useKrosoftTranslation-DtdbUewZ.js";
7
9
  import { S as G } from "./skeleton-BX4RcsiK.js";
8
10
  import { u as z } from "./useMobile-DN1_OMDB.js";
9
- const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex flex-1 justify-between gap-4", children: [
11
+ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ d("div", { className: "flex flex-1 justify-between gap-4", children: [
10
12
  /* @__PURE__ */ e("span", { className: "text-muted-foreground", children: r ?? String(s) }),
11
13
  /* @__PURE__ */ e("span", { className: "font-mono font-medium tabular-nums text-foreground", children: t(Number(n)) })
12
- ] }) : void 0, U = (t, r) => r > 0 && t.length > r ? `${t.slice(0, r)}…` : t, te = ({
14
+ ] }) : void 0, U = (t, r) => r > 0 && t.length > r ? `${t.slice(0, r)}…` : t, ae = ({
13
15
  data: t,
14
16
  label: r = "Valeur",
15
17
  color: a = "hsl(var(--primary))",
@@ -19,11 +21,11 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
19
21
  onSelect: c,
20
22
  className: h
21
23
  }) => {
22
- const u = p.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = p.useMemo(() => L(o, r), [o, r]), i = p.useMemo(
24
+ const u = v.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = v.useMemo(() => L(o, r), [o, r]), i = v.useMemo(
23
25
  () => t.some((l) => l.color !== void 0) ? t.map((l) => ({ ...l, fill: l.color ?? a })) : t,
24
26
  [t, a]
25
27
  );
26
- return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ m(b, { data: i, layout: "vertical", margin: { top: 5, right: 20, left: 0, bottom: 5 }, children: [
28
+ return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ d(b, { data: i, layout: "vertical", margin: { top: 5, right: 20, left: 0, bottom: 5 }, children: [
27
29
  /* @__PURE__ */ e(M, { strokeDasharray: "3 3", horizontal: !1 }),
28
30
  /* @__PURE__ */ e(
29
31
  w,
@@ -56,13 +58,13 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
56
58
  fill: "var(--color-value)",
57
59
  radius: [0, 4, 4, 0],
58
60
  className: c ? "cursor-pointer" : void 0,
59
- onClick: c ? (l, d) => {
60
- c(t[d], d);
61
+ onClick: c ? (l, m) => {
62
+ c(t[m], m);
61
63
  } : void 0
62
64
  }
63
65
  )
64
66
  ] }) });
65
- }, re = ({
67
+ }, se = ({
66
68
  data: t,
67
69
  label: r = "Valeur",
68
70
  color: a = "hsl(var(--primary))",
@@ -72,11 +74,11 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
72
74
  onSelect: c,
73
75
  className: h
74
76
  }) => {
75
- const u = p.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = p.useMemo(() => L(s, r), [s, r]), i = n !== void 0 && n !== 0, l = p.useMemo(
76
- () => t.some((d) => d.color !== void 0) ? t.map((d) => ({ ...d, fill: d.color ?? a })) : t,
77
+ const u = v.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = v.useMemo(() => L(s, r), [s, r]), i = n !== void 0 && n !== 0, l = v.useMemo(
78
+ () => t.some((m) => m.color !== void 0) ? t.map((m) => ({ ...m, fill: m.color ?? a })) : t,
77
79
  [t, a]
78
80
  );
79
- return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ m(b, { data: l, margin: { top: 10, right: 10, left: 0, bottom: i ? 20 : 10 }, children: [
81
+ return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ d(b, { data: l, margin: { top: 10, right: 10, left: 0, bottom: i ? 20 : 10 }, children: [
80
82
  /* @__PURE__ */ e(M, { strokeDasharray: "3 3", vertical: !1 }),
81
83
  /* @__PURE__ */ e(
82
84
  w,
@@ -97,7 +99,7 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
97
99
  tickLine: !1,
98
100
  axisLine: !1,
99
101
  width: s ? 48 : 32,
100
- tickFormatter: s ? (d) => s(Number(d)) : void 0
102
+ tickFormatter: s ? (m) => s(Number(m)) : void 0
101
103
  }
102
104
  ),
103
105
  /* @__PURE__ */ e(x, { content: /* @__PURE__ */ e(y, { formatter: f }) }),
@@ -108,7 +110,7 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
108
110
  fill: "var(--color-value)",
109
111
  radius: [4, 4, 0, 0],
110
112
  className: c ? "cursor-pointer" : void 0,
111
- onClick: c ? (d, g) => {
113
+ onClick: c ? (m, g) => {
112
114
  c(t[g], g);
113
115
  } : void 0
114
116
  }
@@ -120,7 +122,7 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
120
122
  "hsl(var(--k-chart-3))",
121
123
  "hsl(var(--k-chart-4))",
122
124
  "hsl(var(--k-chart-5))"
123
- ], T = (t) => K[t % K.length], ae = ({
125
+ ], T = (t) => K[t % K.length], ie = ({
124
126
  title: t,
125
127
  description: r,
126
128
  icon: a,
@@ -134,11 +136,11 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
134
136
  contentClassName: i,
135
137
  children: l
136
138
  }) => {
137
- const { t: d } = I(), g = a, v = () => o ? /* @__PURE__ */ e(G, { className: "size-full rounded-surface" }) : c ? /* @__PURE__ */ e("div", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: h ?? d("states.noData") }) }) : l;
138
- return /* @__PURE__ */ m(R, { className: f, children: [
139
- /* @__PURE__ */ e(A, { children: /* @__PURE__ */ m("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between", children: [
140
- /* @__PURE__ */ m("div", { className: "min-w-0", children: [
141
- /* @__PURE__ */ m(V, { className: "flex items-center gap-2", children: [
139
+ const { t: m } = I(), g = a, p = () => o ? /* @__PURE__ */ e(G, { className: "size-full rounded-surface" }) : c ? /* @__PURE__ */ e("div", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: h ?? m("states.noData") }) }) : l;
140
+ return /* @__PURE__ */ d(R, { className: f, children: [
141
+ /* @__PURE__ */ e(A, { children: /* @__PURE__ */ d("div", { className: "flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between", children: [
142
+ /* @__PURE__ */ d("div", { className: "min-w-0", children: [
143
+ /* @__PURE__ */ d(V, { className: "flex items-center gap-2", children: [
142
144
  g && /* @__PURE__ */ e(g, { className: "size-5 shrink-0" }),
143
145
  /* @__PURE__ */ e("span", { className: "truncate", children: t })
144
146
  ] }),
@@ -146,12 +148,12 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
146
148
  ] }),
147
149
  n != null ? /* @__PURE__ */ e("div", { className: "shrink-0", children: n }) : null
148
150
  ] }) }),
149
- /* @__PURE__ */ m(S, { children: [
150
- /* @__PURE__ */ e("div", { className: C("w-full", i), style: u === null ? void 0 : { height: u }, children: v() }),
151
+ /* @__PURE__ */ d(S, { children: [
152
+ /* @__PURE__ */ e("div", { className: C("w-full", i), style: u === null ? void 0 : { height: u }, children: p() }),
151
153
  !o && !c && s !== void 0 && s !== null ? /* @__PURE__ */ e("div", { className: "mt-4", children: s }) : null
152
154
  ] })
153
155
  ] });
154
- }, W = { warning: 50, danger: 80 }, X = (t, r) => t >= r.danger ? "hsl(var(--destructive))" : t >= r.warning ? "hsl(var(--k-warning))" : "hsl(var(--k-success))", se = ({
156
+ }, W = { warning: 50, danger: 80 }, X = (t, r) => t >= r.danger ? "hsl(var(--destructive))" : t >= r.warning ? "hsl(var(--k-warning))" : "hsl(var(--k-success))", ne = ({
155
157
  value: t,
156
158
  max: r = 100,
157
159
  size: a = 120,
@@ -163,10 +165,10 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
163
165
  valueFormatter: u = (i) => i.toFixed(1),
164
166
  className: f
165
167
  }) => {
166
- const i = (a - n) / 2, l = i * 2 * Math.PI, d = r > 0 ? Math.min(100, Math.max(0, t / r * 100)) : 0, g = c ?? X(d, h);
167
- return /* @__PURE__ */ m("div", { className: C("flex flex-col items-center gap-2", f), children: [
168
- /* @__PURE__ */ m("div", { className: "relative", style: { width: a, height: a }, children: [
169
- /* @__PURE__ */ m("svg", { width: a, height: a, className: "-rotate-90", children: [
168
+ const i = (a - n) / 2, l = i * 2 * Math.PI, m = r > 0 ? Math.min(100, Math.max(0, t / r * 100)) : 0, g = c ?? X(m, h);
169
+ return /* @__PURE__ */ d("div", { className: C("flex flex-col items-center gap-2", f), children: [
170
+ /* @__PURE__ */ d("div", { className: "relative", style: { width: a, height: a }, children: [
171
+ /* @__PURE__ */ d("svg", { width: a, height: a, className: "-rotate-90", children: [
170
172
  /* @__PURE__ */ e("circle", { cx: a / 2, cy: a / 2, r: i, className: "stroke-muted", strokeWidth: n, fill: "transparent" }),
171
173
  /* @__PURE__ */ e(
172
174
  "circle",
@@ -178,20 +180,20 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
178
180
  strokeWidth: n,
179
181
  fill: "transparent",
180
182
  strokeDasharray: l,
181
- strokeDashoffset: l - d / 100 * l,
183
+ strokeDashoffset: l - m / 100 * l,
182
184
  strokeLinecap: "round",
183
185
  className: "transition-all duration-500 ease-out"
184
186
  }
185
187
  )
186
188
  ] }),
187
- /* @__PURE__ */ m("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
189
+ /* @__PURE__ */ d("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: [
188
190
  /* @__PURE__ */ e("span", { className: "text-2xl font-bold text-card-foreground", children: u(t) }),
189
191
  o !== "" && /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: o })
190
192
  ] })
191
193
  ] }),
192
194
  s !== void 0 && s !== "" ? /* @__PURE__ */ e("span", { className: "text-sm font-medium text-muted-foreground", children: s }) : null
193
195
  ] });
194
- }, ie = ({
196
+ }, oe = ({
195
197
  data: t,
196
198
  label: r = "Valeur",
197
199
  color: a = "hsl(var(--primary))",
@@ -201,8 +203,8 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
201
203
  showDots: c = !0,
202
204
  className: h
203
205
  }) => {
204
- const u = p.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = p.useMemo(() => L(s, r), [s, r]);
205
- return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ m(O, { data: t, margin: { top: 10, right: 20, left: 0, bottom: 10 }, children: [
206
+ const u = v.useMemo(() => ({ value: { label: r, color: a } }), [r, a]), f = v.useMemo(() => L(s, r), [s, r]);
207
+ return /* @__PURE__ */ e(N, { config: u, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ d(O, { data: t, margin: { top: 10, right: 20, left: 0, bottom: 10 }, children: [
206
208
  /* @__PURE__ */ e(M, { strokeDasharray: "3 3", vertical: !1 }),
207
209
  /* @__PURE__ */ e(
208
210
  w,
@@ -243,7 +245,7 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
243
245
  }
244
246
  )
245
247
  ] }) });
246
- }, ne = ({
248
+ }, le = ({
247
249
  data: t,
248
250
  innerRadius: r,
249
251
  outerRadius: a,
@@ -253,11 +255,11 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
253
255
  onSelect: c,
254
256
  className: h
255
257
  }) => {
256
- const u = z(), f = p.useMemo(() => t.map((v, k) => ({ ...v, fill: v.color ?? T(k) })), [t]), i = p.useMemo(
257
- () => Object.fromEntries(t.map((v, k) => [v.name, { label: v.name, color: v.color ?? T(k) }])),
258
+ const u = z(), f = v.useMemo(() => t.map((p, k) => ({ ...p, fill: p.color ?? T(k) })), [t]), i = v.useMemo(
259
+ () => Object.fromEntries(t.map((p, k) => [p.name, { label: p.name, color: p.color ?? T(k) }])),
258
260
  [t]
259
- ), l = p.useMemo(() => L(o), [o]), d = r ?? (u ? 45 : 60), g = a ?? (u ? 80 : 100);
260
- return /* @__PURE__ */ e(N, { config: i, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ m($, { children: [
261
+ ), l = v.useMemo(() => L(o), [o]), m = r ?? (u ? 45 : 60), g = a ?? (u ? 80 : 100);
262
+ return /* @__PURE__ */ e(N, { config: i, className: C("aspect-auto size-full", h), children: /* @__PURE__ */ d($, { children: [
261
263
  /* @__PURE__ */ e(x, { content: /* @__PURE__ */ e(y, { nameKey: "name", hideLabel: !0, formatter: l }) }),
262
264
  /* @__PURE__ */ e(
263
265
  E,
@@ -267,13 +269,13 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
267
269
  nameKey: "name",
268
270
  cx: "50%",
269
271
  cy: n ? "45%" : "50%",
270
- innerRadius: d,
272
+ innerRadius: m,
271
273
  outerRadius: g,
272
- paddingAngle: d > 0 ? 2 : 0,
273
- label: s ? ({ name: v, value: k }) => `${String(v)} (${String(k)})` : void 0,
274
+ paddingAngle: m > 0 ? 2 : 0,
275
+ label: s ? ({ name: p, value: k }) => `${String(p)} (${String(k)})` : void 0,
274
276
  isAnimationActive: !1,
275
277
  className: C("stroke-background", c && "cursor-pointer"),
276
- onClick: c ? (v, k) => {
278
+ onClick: c ? (p, k) => {
277
279
  c(t[k], k);
278
280
  } : void 0
279
281
  }
@@ -282,12 +284,12 @@ const L = (t, r) => t ? (n, s) => /* @__PURE__ */ m("div", { className: "flex fl
282
284
  ] }) });
283
285
  };
284
286
  export {
285
- te as B,
287
+ ae as B,
286
288
  K as C,
287
- ie as L,
288
- ne as P,
289
- re as a,
290
- ae as b,
291
- se as c,
289
+ oe as L,
290
+ le as P,
291
+ se as a,
292
+ ie as b,
293
+ ne as c,
292
294
  T as g
293
295
  };
@@ -1,151 +1,153 @@
1
1
  import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import * as M from "react";
3
- import { useState as S, useRef as G, useEffect as X, useMemo as F } from "react";
4
- import { C as j, b0 as R, b2 as _, b1 as O } from "./toggle-group-DLLrEwv2.js";
3
+ import { useState as S, useRef as G, useEffect as X, useMemo as q } from "react";
4
+ import { C as j, b0 as E, b2 as R, b1 as _ } from "./toggle-group-DLLrEwv2.js";
5
5
  import "./alert-B9F1N9Qk.js";
6
6
  import "@radix-ui/react-aspect-ratio";
7
7
  import { B as v, f as H } from "./tooltip-DVeqVwqV.js";
8
8
  import "./chart-DntJZGxB.js";
9
9
  import "@radix-ui/react-collapsible";
10
- import { C as J, m as Q, o as U, k as W, l as Y, n as T, I as Z } from "./sheet-C_39QrG0.js";
11
- import { CalendarIcon as A, XIcon as I, ChevronDownIcon as ee, CheckIcon as te, PlusIcon as re, SearchIcon as ae } from "lucide-react";
10
+ import { C as J, m as Q, o as U, k as W, l as Y, n as T, I as Z } from "./sheet-tuC_C3M3.js";
11
+ import { CalendarIcon as O, XIcon as I, ChevronDownIcon as ee, CheckIcon as te, PlusIcon as re, SearchIcon as ae } from "lucide-react";
12
12
  import "react-resizable-panels";
13
13
  import { c as g } from "./tailwind.helper-B6yFEsav.js";
14
14
  import "./select-BpjFWqAY.js";
15
15
  import "next-themes";
16
16
  import "sonner";
17
17
  import { format as x } from "date-fns";
18
- import { fr as k } from "date-fns/locale";
19
- import { u as P } from "./useKrosoftTranslation-C6AC_uCA.js";
20
- const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
21
- const [c, s] = S(!1), i = G(null);
18
+ import { u as V } from "./useDateFnsLocale-C4oFFUWO.js";
19
+ import "react-i18next";
20
+ import { u as P } from "./useKrosoftTranslation-DtdbUewZ.js";
21
+ import "date-fns/locale";
22
+ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
23
+ const f = V(), [o, c] = S(!1), d = G(null);
22
24
  X(() => {
23
- if (!c) return;
24
- const o = (u) => {
25
- i.current !== null && !i.current.contains(u.target) && s(!1);
25
+ if (!o) return;
26
+ const s = (h) => {
27
+ d.current !== null && !d.current.contains(h.target) && c(!1);
26
28
  };
27
- return document.addEventListener("mousedown", o), () => {
28
- document.removeEventListener("mousedown", o);
29
+ return document.addEventListener("mousedown", s), () => {
30
+ document.removeEventListener("mousedown", s);
29
31
  };
30
- }, [c]);
31
- const f = () => {
32
- s((o) => !o);
33
- }, d = (o) => {
34
- n(o), s(!1);
32
+ }, [o]);
33
+ const u = () => {
34
+ c((s) => !s);
35
+ }, i = (s) => {
36
+ l(s), c(!1);
35
37
  };
36
- return /* @__PURE__ */ a("div", { ref: i, className: "relative w-full", children: [
38
+ return /* @__PURE__ */ a("div", { ref: d, className: "relative w-full", children: [
37
39
  /* @__PURE__ */ a(
38
40
  v,
39
41
  {
40
42
  variant: "outline",
41
43
  type: "button",
42
- onClick: f,
44
+ onClick: u,
43
45
  className: g(
44
46
  "w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
45
- c && "ring-2 ring-ring ring-offset-2",
47
+ o && "ring-2 ring-ring ring-offset-2",
46
48
  r === void 0 && "text-muted-foreground"
47
49
  ),
48
50
  children: [
49
- /* @__PURE__ */ e(A, { className: "mr-2 size-4 shrink-0" }),
50
- r !== void 0 ? x(r, "dd/MM/yyyy", { locale: k }) : /* @__PURE__ */ e("span", { children: p })
51
+ /* @__PURE__ */ e(O, { className: "mr-2 size-4 shrink-0" }),
52
+ r !== void 0 ? x(r, "dd/MM/yyyy", { locale: f }) : /* @__PURE__ */ e("span", { children: p })
51
53
  ]
52
54
  }
53
55
  ),
54
- c ? /* @__PURE__ */ e("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ e(j, { mode: "single", selected: r, onSelect: d }) }) : null
56
+ o ? /* @__PURE__ */ e("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ e(j, { mode: "single", locale: f, selected: r, onSelect: i }) }) : null
55
57
  ] });
56
- }, we = ({ value: r, onChange: n, placeholder: p, className: c }) => {
57
- const { t: s } = P(), [i, f] = M.useState(!1), [d, o] = M.useState(r);
58
+ }, Me = ({ value: r, onChange: l, placeholder: p, className: f }) => {
59
+ const { t: o } = P(), c = V(), [d, u] = M.useState(!1), [i, s] = M.useState(r);
58
60
  M.useEffect(() => {
59
- i && o(r);
60
- }, [i, r]);
61
- const u = (l) => {
62
- l.stopPropagation(), n(void 0), f(!1);
63
- }, h = () => {
64
- n(d), f(!1);
65
- }, w = () => {
66
- o(r), f(!1);
61
+ d && s(r);
62
+ }, [d, r]);
63
+ const h = (n) => {
64
+ n.stopPropagation(), l(void 0), u(!1);
65
+ }, k = () => {
66
+ l(i), u(!1);
67
67
  }, y = () => {
68
- o(void 0);
69
- }, N = (l) => l != null && l.from ? !l.to || l.from.getTime() === l.to.getTime() ? x(l.from, "dd MMM yyyy", { locale: k }) : `${x(l.from, "dd MMM yyyy", { locale: k })} - ${x(l.to, "dd MMM yyyy", { locale: k })}` : p ?? s("date.pickPeriod");
70
- return /* @__PURE__ */ e("div", { className: g("grid gap-2", c), children: /* @__PURE__ */ a(R, { open: i, onOpenChange: f, children: [
71
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ a(v, { id: "date", variant: "outline", className: g("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
72
- /* @__PURE__ */ e(A, { className: "mr-2 size-4" }),
73
- N(r),
68
+ s(r), u(!1);
69
+ }, N = () => {
70
+ s(void 0);
71
+ }, w = (n) => n != null && n.from ? !n.to || n.from.getTime() === n.to.getTime() ? x(n.from, "dd MMM yyyy", { locale: c }) : `${x(n.from, "dd MMM yyyy", { locale: c })} - ${x(n.to, "dd MMM yyyy", { locale: c })}` : p ?? o("date.pickPeriod");
72
+ return /* @__PURE__ */ e("div", { className: g("grid gap-2", f), children: /* @__PURE__ */ a(E, { open: d, onOpenChange: u, children: [
73
+ /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ a(v, { id: "date", variant: "outline", className: g("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
74
+ /* @__PURE__ */ e(O, { className: "mr-2 size-4" }),
75
+ w(r),
74
76
  (r == null ? void 0 : r.from) && /* @__PURE__ */ e(
75
77
  v,
76
78
  {
77
79
  type: "button",
78
80
  variant: "ghost",
79
81
  size: "icon",
80
- "aria-label": s("date.clearPeriod"),
82
+ "aria-label": o("date.clearPeriod"),
81
83
  className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
82
- onClick: u,
84
+ onClick: h,
83
85
  children: /* @__PURE__ */ e(I, { className: "size-4" })
84
86
  }
85
87
  )
86
88
  ] }) }),
87
- /* @__PURE__ */ a(O, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
89
+ /* @__PURE__ */ a(_, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
88
90
  /* @__PURE__ */ e(
89
91
  j,
90
92
  {
91
93
  mode: "range",
92
- defaultMonth: d == null ? void 0 : d.from,
93
- selected: d,
94
- onSelect: o,
94
+ defaultMonth: i == null ? void 0 : i.from,
95
+ selected: i,
96
+ onSelect: s,
95
97
  numberOfMonths: 2,
96
- weekStartsOn: 1,
98
+ locale: c,
97
99
  className: "pointer-events-auto p-3"
98
100
  }
99
101
  ),
100
102
  /* @__PURE__ */ a("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
101
- /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: y, children: "Effacer" }),
103
+ /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: N, children: o("actions.clear") }),
102
104
  /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
103
- /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: w, children: "Annuler" }),
104
- /* @__PURE__ */ e(v, { size: "sm", onClick: h, children: "Appliquer" })
105
+ /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: y, children: o("actions.cancel") }),
106
+ /* @__PURE__ */ e(v, { size: "sm", onClick: k, children: o("actions.apply") })
105
107
  ] })
106
108
  ] })
107
109
  ] })
108
110
  ] }) });
109
- }, ze = ({
111
+ }, Se = ({
110
112
  options: r = [],
111
- value: n,
113
+ value: l,
112
114
  onChange: p,
113
- onClear: c,
114
- onCreate: s,
115
- placeholder: i,
116
- searchPlaceholder: f,
117
- emptyLabel: d,
118
- createLabel: o,
119
- disabled: u = !1,
115
+ onClear: f,
116
+ onCreate: o,
117
+ placeholder: c,
118
+ searchPlaceholder: d,
119
+ emptyLabel: u,
120
+ createLabel: i,
121
+ disabled: s = !1,
120
122
  modal: h = !0,
121
- className: w
123
+ className: k
122
124
  }) => {
123
- const { t: y } = P(), [N, l] = S(!1), [D, E] = S(""), C = n !== void 0 && n !== "", m = F(() => C ? r.find((t) => t.value === n) : void 0, [C, r, n]), V = C ? (m == null ? void 0 : m.label) ?? n : void 0, b = D.trim(), L = s !== void 0 && b !== "" && !r.some((t) => t.label.toLowerCase() === b.toLowerCase()), z = (t) => {
124
- l(t), t || E("");
125
- }, B = (t) => {
125
+ const { t: y } = P(), [N, w] = S(!1), [n, D] = S(""), C = l !== void 0 && l !== "", m = q(() => C ? r.find((t) => t.value === l) : void 0, [C, r, l]), B = C ? (m == null ? void 0 : m.label) ?? l : void 0, b = n.trim(), L = o !== void 0 && b !== "" && !r.some((t) => t.label.toLowerCase() === b.toLowerCase()), z = (t) => {
126
+ w(t), t || D("");
127
+ }, K = (t) => {
126
128
  p(t), z(!1);
127
- }, K = () => {
128
- s == null || s(b), z(!1);
129
+ }, $ = () => {
130
+ o == null || o(b), z(!1);
129
131
  };
130
- return /* @__PURE__ */ a(R, { open: N, onOpenChange: z, modal: h, children: [
131
- /* @__PURE__ */ e(_, { asChild: !0, children: /* @__PURE__ */ a(
132
+ return /* @__PURE__ */ a(E, { open: N, onOpenChange: z, modal: h, children: [
133
+ /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ a(
132
134
  "button",
133
135
  {
134
136
  type: "button",
135
137
  role: "combobox",
136
138
  "aria-expanded": N,
137
- disabled: u,
139
+ disabled: s,
138
140
  className: g(
139
141
  H,
140
142
  "w-full",
141
143
  "data-[state=open]:ring-2 data-[state=open]:ring-ring data-[state=open]:ring-offset-2",
142
144
  !C && "text-muted-foreground",
143
- w
145
+ k
144
146
  ),
145
147
  children: [
146
148
  /* @__PURE__ */ a("span", { className: "flex items-center truncate", children: [
147
149
  (m == null ? void 0 : m.color) && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: m.color } }),
148
- /* @__PURE__ */ e("span", { className: "truncate", children: V ?? i ?? y("select.placeholder") }),
150
+ /* @__PURE__ */ e("span", { className: "truncate", children: B ?? c ?? y("select.placeholder") }),
149
151
  (m == null ? void 0 : m.description) !== void 0 && /* @__PURE__ */ a("span", { className: "ml-1 truncate text-muted-foreground", children: [
150
152
  "(",
151
153
  m.description,
@@ -153,7 +155,7 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
153
155
  ] })
154
156
  ] }),
155
157
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
156
- c && C && !u && /* @__PURE__ */ e(
158
+ f && C && !s && /* @__PURE__ */ e(
157
159
  "span",
158
160
  {
159
161
  role: "button",
@@ -162,7 +164,7 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
162
164
  t.stopPropagation();
163
165
  },
164
166
  onPointerDown: (t) => {
165
- t.preventDefault(), t.stopPropagation(), c();
167
+ t.preventDefault(), t.stopPropagation(), f();
166
168
  },
167
169
  className: "text-muted-foreground hover:text-foreground",
168
170
  children: /* @__PURE__ */ e(I, { className: "size-4" })
@@ -173,14 +175,14 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
173
175
  ]
174
176
  }
175
177
  ) }),
176
- /* @__PURE__ */ e(O, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ a(
178
+ /* @__PURE__ */ e(_, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ a(
177
179
  J,
178
180
  {
179
- filter: (t, $, q) => (q ?? []).join(" ").toLowerCase().includes($.trim().toLowerCase()) ? 1 : 0,
181
+ filter: (t, A, F) => (F ?? []).join(" ").toLowerCase().includes(A.trim().toLowerCase()) ? 1 : 0,
180
182
  children: [
181
- /* @__PURE__ */ e(Q, { placeholder: f ?? y("search.placeholder"), value: D, onValueChange: E }),
183
+ /* @__PURE__ */ e(Q, { placeholder: d ?? y("search.placeholder"), value: n, onValueChange: D }),
182
184
  /* @__PURE__ */ a(U, { children: [
183
- !L && /* @__PURE__ */ e(W, { children: d ?? y("states.noResult") }),
185
+ !L && /* @__PURE__ */ e(W, { children: u ?? y("states.noResult") }),
184
186
  /* @__PURE__ */ a(Y, { children: [
185
187
  r.map((t) => /* @__PURE__ */ a(
186
188
  T,
@@ -188,10 +190,10 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
188
190
  value: t.value,
189
191
  keywords: [t.label, t.description ?? ""],
190
192
  onSelect: () => {
191
- B(t.value);
193
+ K(t.value);
192
194
  },
193
195
  children: [
194
- /* @__PURE__ */ e(te, { className: g("mr-2 size-4 shrink-0", n === t.value ? "opacity-100" : "opacity-0") }),
196
+ /* @__PURE__ */ e(te, { className: g("mr-2 size-4 shrink-0", l === t.value ? "opacity-100" : "opacity-0") }),
195
197
  t.color !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: t.color } }),
196
198
  /* @__PURE__ */ e("span", { className: "truncate", children: t.label }),
197
199
  t.description !== void 0 && /* @__PURE__ */ a("span", { className: "ml-1 truncate text-muted-foreground", children: [
@@ -203,9 +205,9 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
203
205
  },
204
206
  t.value
205
207
  )),
206
- L && /* @__PURE__ */ a(T, { forceMount: !0, value: "__create__", onSelect: K, children: [
208
+ L && /* @__PURE__ */ a(T, { forceMount: !0, value: "__create__", onSelect: $, children: [
207
209
  /* @__PURE__ */ e(re, { className: "mr-2 size-4 shrink-0" }),
208
- /* @__PURE__ */ e("span", { className: "truncate", children: o ? o(b) : y("select.create", { search: b }) })
210
+ /* @__PURE__ */ e("span", { className: "truncate", children: i ? i(b) : y("select.create", { search: b }) })
209
211
  ] })
210
212
  ] })
211
213
  ] })
@@ -213,32 +215,32 @@ const ke = ({ date: r, onDateChange: n, placeholder: p }) => {
213
215
  }
214
216
  ) })
215
217
  ] });
216
- }, Me = ({ searchQuery: r, search: n, placeholder: p, onSearch: c, onSubmit: s, onClear: i, className: f }) => {
217
- const { t: d } = P(), o = r ?? n ?? "", u = () => {
218
- c(""), i !== void 0 && i();
218
+ }, Ie = ({ searchQuery: r, search: l, placeholder: p, onSearch: f, onSubmit: o, onClear: c, className: d }) => {
219
+ const { t: u } = P(), i = r ?? l ?? "", s = () => {
220
+ f(""), c !== void 0 && c();
219
221
  };
220
- return /* @__PURE__ */ a("div", { className: g("relative h-fit w-full md:w-64", f), children: [
222
+ return /* @__PURE__ */ a("div", { className: g("relative h-fit w-full md:w-64", d), children: [
221
223
  /* @__PURE__ */ e(ae, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
222
224
  /* @__PURE__ */ e(
223
225
  Z,
224
226
  {
225
- placeholder: p ?? d("search.placeholder"),
226
- value: o,
227
+ placeholder: p ?? u("search.placeholder"),
228
+ value: i,
227
229
  onChange: (h) => {
228
- c(h.target.value);
230
+ f(h.target.value);
229
231
  },
230
232
  className: "pl-8",
231
233
  onKeyDown: (h) => {
232
- h.key === "Enter" && s !== void 0 && (h.preventDefault(), s());
234
+ h.key === "Enter" && o !== void 0 && (h.preventDefault(), o());
233
235
  }
234
236
  }
235
237
  ),
236
- o !== "" ? /* @__PURE__ */ e("button", { onClick: u, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ e(I, { className: "size-4" }) }) : null
238
+ i !== "" ? /* @__PURE__ */ e("button", { onClick: s, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ e(I, { className: "size-4" }) }) : null
237
239
  ] });
238
240
  };
239
241
  export {
240
- ke as D,
241
- Me as S,
242
- we as a,
243
- ze as b
242
+ ze as D,
243
+ Ie as S,
244
+ Me as a,
245
+ Se as b
244
246
  };
@@ -8,7 +8,7 @@ import "@radix-ui/react-aspect-ratio";
8
8
  import "./tooltip-DVeqVwqV.js";
9
9
  import { C as c, d as p, e as v, a as h } from "./chart-DntJZGxB.js";
10
10
  import "@radix-ui/react-collapsible";
11
- import "./sheet-C_39QrG0.js";
11
+ import "./sheet-tuC_C3M3.js";
12
12
  import "lucide-react";
13
13
  import "react-resizable-panels";
14
14
  import "./select-BpjFWqAY.js";
@@ -1,7 +1,9 @@
1
1
  import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { u as w } from "./useKrosoftTranslation-C6AC_uCA.js";
2
+ import "date-fns/locale";
3
+ import "react-i18next";
4
+ import { u as w } from "./useKrosoftTranslation-DtdbUewZ.js";
3
5
  import { useState as C, useEffect as O, useMemo as S } from "react";
4
- import { a as z, D as I, b as $, S as B } from "./SearchInput-pnwtB4jO.js";
6
+ import { a as z, D as I, b as $, S as B } from "./SearchInput-Y-iBtCCc.js";
5
7
  import { getLocale as Q } from "@krosoft/core/helpers";
6
8
  import { B as E, aw as V, b0 as _, b2 as R, b1 as H, E as P } from "./toggle-group-DLLrEwv2.js";
7
9
  import "./alert-B9F1N9Qk.js";
@@ -9,7 +11,7 @@ import "@radix-ui/react-aspect-ratio";
9
11
  import { B as F, e as K } from "./tooltip-DVeqVwqV.js";
10
12
  import "./chart-DntJZGxB.js";
11
13
  import "@radix-ui/react-collapsible";
12
- import { I as L, S as X, z as G, s as J, v as U, y as W, u as Y } from "./sheet-C_39QrG0.js";
14
+ import { I as L, S as X, z as G, s as J, v as U, y as W, u as Y } from "./sheet-tuC_C3M3.js";
13
15
  import { XIcon as T, Filter as Z, ChevronDown as q, Search as ee } from "lucide-react";
14
16
  import "react-resizable-panels";
15
17
  import "clsx";
@@ -18,7 +20,7 @@ import { S as re, h as te, i as le, a as ae, c as se } from "./select-BpjFWqAY.j
18
20
  import "next-themes";
19
21
  import "sonner";
20
22
  import { c as j } from "./tailwind.helper-B6yFEsav.js";
21
- import { M as ne } from "./MultiSelect-D0WF96y6.js";
23
+ import { M as ne } from "./MultiSelect-DWNOCqe1.js";
22
24
  const D = (a, n, c, i = {}) => {
23
25
  if (n instanceof Date)
24
26
  return n.toLocaleDateString(Q());
@@ -311,7 +313,7 @@ function ue({
311
313
  }
312
314
  );
313
315
  }
314
- function je({
316
+ function Oe({
315
317
  searchQuery: a,
316
318
  onSearchChange: n,
317
319
  searchPlaceholder: c,
@@ -415,6 +417,6 @@ export {
415
417
  ce as A,
416
418
  oe as F,
417
419
  ue as S,
418
- je as T,
420
+ Oe as T,
419
421
  de as a
420
422
  };