@krosoft/react 0.0.158 → 0.0.159
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConfirmationDialog-wGKgYkmd.js → ConfirmationDialog-Dy_6PcOr.js} +1 -1
- package/dist/{GenericForm-Cy5ntJxi.js → GenericForm-Bb4E2Wxd.js} +1 -1
- package/dist/{MultiSelect-DblSHEsg.js → MultiSelect-BPffv2am.js} +31 -30
- package/dist/{SearchInput-T9TeORNA.js → SearchInput-bwnVKhhE.js} +88 -85
- package/dist/{TableFilter-DUGalkoi.js → TableFilter-mQSKN8O8.js} +2 -2
- package/dist/{ThemeSelector-Qv8QBlYq.js → ThemeSelector-CQ3fSDJ2.js} +1 -1
- package/dist/components/core/dialogs/index.js +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +6 -6
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +2 -2
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +6 -6
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/ui/index.js +1 -1
- package/dist/hooks/ui/useTheme.d.ts +2 -1
- package/dist/hooks/ui/useTheme.d.ts.map +1 -1
- package/dist/useTheme-CSr_h5xJ.js +24 -0
- package/package.json +1 -1
- package/dist/useTheme-B0Bxda3I.js +0 -22
|
@@ -14,7 +14,7 @@ import "next-themes";
|
|
|
14
14
|
import "sonner";
|
|
15
15
|
import { useState as w, useEffect as ee } from "react";
|
|
16
16
|
import { useTranslation as O } from "react-i18next";
|
|
17
|
-
import { G as le } from "./GenericForm-
|
|
17
|
+
import { G as le } from "./GenericForm-Bb4E2Wxd.js";
|
|
18
18
|
import { E as ie } from "./ErrorAlert-DH1onuyt.js";
|
|
19
19
|
function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, children: p }) {
|
|
20
20
|
const { t: i } = O(), { title: b, description: m, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { I as J } from "./ImageInput-CJ419eqw.js";
|
|
3
3
|
import { A as V } from "./AppSubTitle-BNd5_q0i.js";
|
|
4
|
-
import { M as Q } from "./MultiSelect-
|
|
4
|
+
import { M as Q } from "./MultiSelect-BPffv2am.js";
|
|
5
5
|
import { aN as W, aQ as $, aR as q, aS as D, aO as A, aT as L, J as X, N as Y, K as F, bR as ee, $ as te } from "./toggle-group-BASGy2mQ.js";
|
|
6
6
|
import "./alert-B78CiTYe.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as l, jsx as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useState as k, useRef as w, useMemo as N, useEffect as y } from "react";
|
|
3
3
|
import { $ as C } from "./toggle-group-BASGy2mQ.js";
|
|
4
4
|
import "./alert-B78CiTYe.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -8,22 +8,22 @@ import "@radix-ui/react-collapsible";
|
|
|
8
8
|
import "./sheet-Gop1cIaU.js";
|
|
9
9
|
import { XIcon as L, ChevronDownIcon as R, SearchIcon as T } from "lucide-react";
|
|
10
10
|
import "react-resizable-panels";
|
|
11
|
-
import { c as
|
|
11
|
+
import { c as z } from "./tailwind.helper-B6yFEsav.js";
|
|
12
12
|
import "./select-MWzbMBAS.js";
|
|
13
13
|
import "next-themes";
|
|
14
14
|
import "sonner";
|
|
15
15
|
const J = ({
|
|
16
|
-
options:
|
|
16
|
+
options: i,
|
|
17
17
|
selected: n,
|
|
18
18
|
onToggle: h,
|
|
19
19
|
onClear: d,
|
|
20
20
|
onSelectAll: u,
|
|
21
|
-
placeholder:
|
|
21
|
+
placeholder: E = "Sélectionner...",
|
|
22
22
|
searchable: m = !1,
|
|
23
|
-
searchPlaceholder:
|
|
23
|
+
searchPlaceholder: j = "Rechercher...",
|
|
24
24
|
disabled: f = !1
|
|
25
25
|
}) => {
|
|
26
|
-
const [c, p] =
|
|
26
|
+
const [c, p] = k(""), [a, b] = k(!1), g = w(null), x = w(null), o = N(() => c === "" ? i : i.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [i, c]), v = N(() => o.length === 0 ? !1 : o.every((e) => n.includes(e.value)), [o, n]);
|
|
27
27
|
y(() => {
|
|
28
28
|
a && m && requestAnimationFrame(() => {
|
|
29
29
|
var e;
|
|
@@ -31,8 +31,8 @@ const J = ({
|
|
|
31
31
|
});
|
|
32
32
|
}, [a, m]), y(() => {
|
|
33
33
|
if (!a) return;
|
|
34
|
-
const e = (
|
|
35
|
-
g.current !== null && !g.current.contains(
|
|
34
|
+
const e = (t) => {
|
|
35
|
+
g.current !== null && !g.current.contains(t.target) && (b(!1), p(""));
|
|
36
36
|
};
|
|
37
37
|
return document.addEventListener("mousedown", e), () => {
|
|
38
38
|
document.removeEventListener("mousedown", e);
|
|
@@ -40,14 +40,14 @@ const J = ({
|
|
|
40
40
|
}, [a]);
|
|
41
41
|
const I = () => {
|
|
42
42
|
if (v) {
|
|
43
|
-
const e = o.map((
|
|
44
|
-
u !== void 0 ? u(
|
|
43
|
+
const e = o.map((s) => s.value), t = n.filter((s) => !e.includes(s));
|
|
44
|
+
u !== void 0 ? u(t) : d();
|
|
45
45
|
} else {
|
|
46
46
|
const e = [...n];
|
|
47
|
-
o.forEach((
|
|
48
|
-
e.includes(
|
|
49
|
-
}), u !== void 0 ? u(e) : o.forEach((
|
|
50
|
-
n.includes(
|
|
47
|
+
o.forEach((t) => {
|
|
48
|
+
e.includes(t.value) || e.push(t.value);
|
|
49
|
+
}), u !== void 0 ? u(e) : o.forEach((t) => {
|
|
50
|
+
n.includes(t.value) || h(t.value);
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
};
|
|
@@ -60,18 +60,18 @@ const J = ({
|
|
|
60
60
|
onClick: () => {
|
|
61
61
|
f || b((e) => (e && p(""), !e));
|
|
62
62
|
},
|
|
63
|
-
className:
|
|
63
|
+
className: z(
|
|
64
64
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
65
65
|
a && "ring-2 ring-ring ring-offset-2",
|
|
66
66
|
n.length === 0 && "text-muted-foreground"
|
|
67
67
|
),
|
|
68
68
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
var
|
|
71
|
-
return ((
|
|
69
|
+
/* @__PURE__ */ r("span", { className: "truncate", children: n.length === 0 ? E : n.map((e) => {
|
|
70
|
+
var t;
|
|
71
|
+
return ((t = i.find((s) => s.value === e)) == null ? void 0 : t.label) ?? e;
|
|
72
72
|
}).join(", ") }),
|
|
73
73
|
/* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1", children: [
|
|
74
|
-
n.length > 0 && !f && /* @__PURE__ */
|
|
74
|
+
n.length > 0 && !f && /* @__PURE__ */ r(
|
|
75
75
|
"span",
|
|
76
76
|
{
|
|
77
77
|
role: "button",
|
|
@@ -83,23 +83,23 @@ const J = ({
|
|
|
83
83
|
e.preventDefault(), e.stopPropagation(), d();
|
|
84
84
|
},
|
|
85
85
|
className: "text-muted-foreground hover:text-foreground",
|
|
86
|
-
children: /* @__PURE__ */
|
|
86
|
+
children: /* @__PURE__ */ r(L, { className: "size-4" })
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ r(R, { className: z("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
|
|
90
90
|
] })
|
|
91
91
|
]
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
94
|
a ? /* @__PURE__ */ l("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
|
|
95
|
-
m ? /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
97
|
-
/* @__PURE__ */
|
|
95
|
+
m ? /* @__PURE__ */ r("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
96
|
+
/* @__PURE__ */ r(T, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
97
|
+
/* @__PURE__ */ r(
|
|
98
98
|
"input",
|
|
99
99
|
{
|
|
100
100
|
ref: x,
|
|
101
101
|
className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
102
|
-
placeholder:
|
|
102
|
+
placeholder: j,
|
|
103
103
|
value: c,
|
|
104
104
|
onChange: (e) => {
|
|
105
105
|
p(e.target.value);
|
|
@@ -109,12 +109,12 @@ const J = ({
|
|
|
109
109
|
] }) }) : null,
|
|
110
110
|
/* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
|
|
111
111
|
o.length > 0 && /* @__PURE__ */ l("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
112
|
-
/* @__PURE__ */
|
|
112
|
+
/* @__PURE__ */ r(C, { checked: v, onCheckedChange: I }),
|
|
113
113
|
"Tout sélectionner"
|
|
114
114
|
] }),
|
|
115
|
-
o.length === 0 && /* @__PURE__ */
|
|
115
|
+
o.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
116
116
|
o.map((e) => /* @__PURE__ */ l("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
|
|
117
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ r(
|
|
118
118
|
C,
|
|
119
119
|
{
|
|
120
120
|
checked: n.includes(e.value),
|
|
@@ -123,10 +123,11 @@ const J = ({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
),
|
|
126
|
+
e.color && /* @__PURE__ */ r("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: e.color } }),
|
|
126
127
|
e.label
|
|
127
128
|
] }, e.value))
|
|
128
129
|
] }),
|
|
129
|
-
n.length > 0 && /* @__PURE__ */
|
|
130
|
+
n.length > 0 && /* @__PURE__ */ r("div", { className: "border-t border-border p-1.5", children: /* @__PURE__ */ r(
|
|
130
131
|
"button",
|
|
131
132
|
{
|
|
132
133
|
type: "button",
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import * as w from "react";
|
|
3
3
|
import { useState as k, useRef as C, useEffect as z, useMemo as S } from "react";
|
|
4
|
-
import { I, bv as
|
|
4
|
+
import { I, bv as O, bx as T, bw as j } from "./toggle-group-BASGy2mQ.js";
|
|
5
5
|
import "./alert-B78CiTYe.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
|
-
import { B as
|
|
7
|
+
import { B as g } from "./tooltip-BWyFpIxo.js";
|
|
8
8
|
import "@radix-ui/react-collapsible";
|
|
9
|
-
import { I as
|
|
10
|
-
import { CalendarIcon as
|
|
9
|
+
import { I as A } from "./sheet-Gop1cIaU.js";
|
|
10
|
+
import { CalendarIcon as D, XIcon as M, ChevronDownIcon as q, SearchIcon as E, CheckIcon as B } from "lucide-react";
|
|
11
11
|
import "react-resizable-panels";
|
|
12
|
-
import { c as
|
|
12
|
+
import { c as f } from "./tailwind.helper-B6yFEsav.js";
|
|
13
13
|
import "./select-MWzbMBAS.js";
|
|
14
14
|
import "next-themes";
|
|
15
15
|
import "sonner";
|
|
16
|
-
import { format as
|
|
17
|
-
import { fr as
|
|
18
|
-
const
|
|
19
|
-
const [u,
|
|
16
|
+
import { format as v } from "date-fns";
|
|
17
|
+
import { fr as N } from "date-fns/locale";
|
|
18
|
+
const oe = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
19
|
+
const [u, m] = k(!1), c = C(null);
|
|
20
20
|
z(() => {
|
|
21
21
|
if (!u) return;
|
|
22
|
-
const
|
|
23
|
-
c.current !== null && !c.current.contains(n.target) &&
|
|
22
|
+
const l = (n) => {
|
|
23
|
+
c.current !== null && !c.current.contains(n.target) && m(!1);
|
|
24
24
|
};
|
|
25
|
-
return document.addEventListener("mousedown",
|
|
26
|
-
document.removeEventListener("mousedown",
|
|
25
|
+
return document.addEventListener("mousedown", l), () => {
|
|
26
|
+
document.removeEventListener("mousedown", l);
|
|
27
27
|
};
|
|
28
28
|
}, [u]);
|
|
29
29
|
const d = () => {
|
|
30
|
-
|
|
31
|
-
}, a = (
|
|
32
|
-
o(
|
|
30
|
+
m((l) => !l);
|
|
31
|
+
}, a = (l) => {
|
|
32
|
+
o(l), m(!1);
|
|
33
33
|
};
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
|
|
34
|
+
return /* @__PURE__ */ s("div", { ref: c, className: "relative w-full", children: [
|
|
35
|
+
/* @__PURE__ */ s(
|
|
36
|
+
g,
|
|
37
37
|
{
|
|
38
38
|
variant: "outline",
|
|
39
39
|
type: "button",
|
|
40
40
|
onClick: d,
|
|
41
|
-
className:
|
|
41
|
+
className: f(
|
|
42
42
|
"w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
43
43
|
u && "ring-2 ring-ring ring-offset-2",
|
|
44
44
|
r === void 0 && "text-muted-foreground"
|
|
45
45
|
),
|
|
46
46
|
children: [
|
|
47
|
-
/* @__PURE__ */ t(
|
|
48
|
-
r !== void 0 ?
|
|
47
|
+
/* @__PURE__ */ t(D, { className: "mr-2 size-4 shrink-0" }),
|
|
48
|
+
r !== void 0 ? v(r, "dd/MM/yyyy", { locale: N }) : /* @__PURE__ */ t("span", { children: p })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
52
|
u ? /* @__PURE__ */ t("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ t(I, { mode: "single", selected: r, onSelect: a }) }) : null
|
|
53
53
|
] });
|
|
54
|
-
},
|
|
55
|
-
const [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, [
|
|
59
|
-
const
|
|
54
|
+
}, ne = ({ value: r, onChange: o, placeholder: p = "Selectionner une periode", className: u }) => {
|
|
55
|
+
const [m, c] = w.useState(!1), [d, a] = w.useState(r);
|
|
56
|
+
w.useEffect(() => {
|
|
57
|
+
m && a(r);
|
|
58
|
+
}, [m, r]);
|
|
59
|
+
const l = (i) => {
|
|
60
60
|
i.stopPropagation(), o(void 0), c(!1);
|
|
61
61
|
}, n = () => {
|
|
62
62
|
o(d), c(!1);
|
|
63
|
-
}, g = () => {
|
|
64
|
-
a(r), c(!1);
|
|
65
63
|
}, b = () => {
|
|
64
|
+
a(r), c(!1);
|
|
65
|
+
}, y = () => {
|
|
66
66
|
a(void 0);
|
|
67
|
-
},
|
|
68
|
-
return /* @__PURE__ */ t("div", { className:
|
|
69
|
-
/* @__PURE__ */ t(
|
|
70
|
-
/* @__PURE__ */ t(
|
|
71
|
-
|
|
67
|
+
}, x = (i) => i != null && i.from ? !i.to || i.from.getTime() === i.to.getTime() ? v(i.from, "dd MMM yyyy", { locale: N }) : `${v(i.from, "dd MMM yyyy", { locale: N })} - ${v(i.to, "dd MMM yyyy", { locale: N })}` : p;
|
|
68
|
+
return /* @__PURE__ */ t("div", { className: f("grid gap-2", u), children: /* @__PURE__ */ s(O, { open: m, onOpenChange: c, children: [
|
|
69
|
+
/* @__PURE__ */ t(T, { asChild: !0, children: /* @__PURE__ */ s(g, { id: "date", variant: "outline", className: f("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
|
|
70
|
+
/* @__PURE__ */ t(D, { className: "mr-2 size-4" }),
|
|
71
|
+
x(r),
|
|
72
72
|
(r == null ? void 0 : r.from) && /* @__PURE__ */ t(
|
|
73
|
-
|
|
73
|
+
g,
|
|
74
74
|
{
|
|
75
75
|
type: "button",
|
|
76
76
|
variant: "ghost",
|
|
77
77
|
size: "icon",
|
|
78
78
|
"aria-label": "Effacer la periode selectionnee",
|
|
79
79
|
className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
|
|
80
|
-
onClick:
|
|
80
|
+
onClick: l,
|
|
81
81
|
children: /* @__PURE__ */ t(M, { className: "size-4" })
|
|
82
82
|
}
|
|
83
83
|
)
|
|
84
84
|
] }) }),
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ s(j, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
|
|
86
86
|
/* @__PURE__ */ t(
|
|
87
87
|
I,
|
|
88
88
|
{
|
|
@@ -95,63 +95,65 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
95
95
|
className: "pointer-events-auto p-3"
|
|
96
96
|
}
|
|
97
97
|
),
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
/* @__PURE__ */ t(
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ t(
|
|
102
|
-
/* @__PURE__ */ t(
|
|
98
|
+
/* @__PURE__ */ s("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
99
|
+
/* @__PURE__ */ t(g, { variant: "ghost", size: "sm", onClick: y, children: "Effacer" }),
|
|
100
|
+
/* @__PURE__ */ s("div", { className: "flex gap-2", children: [
|
|
101
|
+
/* @__PURE__ */ t(g, { variant: "ghost", size: "sm", onClick: b, children: "Annuler" }),
|
|
102
|
+
/* @__PURE__ */ t(g, { size: "sm", onClick: n, children: "Appliquer" })
|
|
103
103
|
] })
|
|
104
104
|
] })
|
|
105
105
|
] })
|
|
106
106
|
] }) });
|
|
107
|
-
},
|
|
107
|
+
}, se = ({
|
|
108
108
|
options: r = [],
|
|
109
109
|
value: o,
|
|
110
110
|
onChange: p,
|
|
111
111
|
onClear: u,
|
|
112
|
-
placeholder:
|
|
112
|
+
placeholder: m = "Sélectionner...",
|
|
113
113
|
searchPlaceholder: c = "Rechercher...",
|
|
114
114
|
disabled: d = !1
|
|
115
115
|
}) => {
|
|
116
|
-
const [a,
|
|
117
|
-
var e;
|
|
116
|
+
const [a, l] = k(""), [n, b] = k(!1), y = C(null), x = C(null), i = S(() => a === "" ? r : r.filter((e) => e.label.toLowerCase().includes(a.toLowerCase())), [r, a]), h = S(() => {
|
|
118
117
|
if (!(o === void 0 || o === ""))
|
|
119
|
-
return
|
|
120
|
-
}, [r, o]);
|
|
118
|
+
return r.find((e) => e.value === o);
|
|
119
|
+
}, [r, o]), P = o === void 0 || o === "" ? void 0 : (h == null ? void 0 : h.label) ?? o;
|
|
121
120
|
z(() => {
|
|
122
121
|
n && requestAnimationFrame(() => {
|
|
123
122
|
var e;
|
|
124
|
-
(e =
|
|
123
|
+
(e = x.current) == null || e.focus();
|
|
125
124
|
});
|
|
126
125
|
}, [n]), z(() => {
|
|
127
126
|
if (!n) return;
|
|
128
|
-
const e = (
|
|
129
|
-
|
|
127
|
+
const e = (L) => {
|
|
128
|
+
y.current !== null && !y.current.contains(L.target) && (b(!1), l(""));
|
|
130
129
|
};
|
|
131
130
|
return document.addEventListener("mousedown", e), () => {
|
|
132
131
|
document.removeEventListener("mousedown", e);
|
|
133
132
|
};
|
|
134
133
|
}, [n]);
|
|
135
|
-
const
|
|
136
|
-
p(e),
|
|
134
|
+
const R = (e) => {
|
|
135
|
+
p(e), b(!1), l("");
|
|
137
136
|
};
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
/* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ s("div", { ref: y, className: "relative w-full", children: [
|
|
138
|
+
/* @__PURE__ */ s(
|
|
140
139
|
"button",
|
|
141
140
|
{
|
|
142
141
|
type: "button",
|
|
143
142
|
onClick: () => {
|
|
144
|
-
d ||
|
|
143
|
+
d || b((e) => (e && l(""), !e));
|
|
145
144
|
},
|
|
146
145
|
disabled: d,
|
|
147
|
-
className:
|
|
146
|
+
className: f(
|
|
148
147
|
"flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
|
|
149
148
|
n && "ring-2 ring-ring ring-offset-2",
|
|
150
149
|
(o === void 0 || o === "") && "text-muted-foreground"
|
|
151
150
|
),
|
|
152
151
|
children: [
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
|
|
152
|
+
/* @__PURE__ */ s("span", { className: "flex items-center gap-2 truncate", children: [
|
|
153
|
+
(h == null ? void 0 : h.color) && /* @__PURE__ */ t("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: h.color } }),
|
|
154
|
+
/* @__PURE__ */ t("span", { className: "truncate", children: P ?? m })
|
|
155
|
+
] }),
|
|
156
|
+
/* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
155
157
|
u && o !== void 0 && o !== "" && !d && /* @__PURE__ */ t(
|
|
156
158
|
"span",
|
|
157
159
|
{
|
|
@@ -167,42 +169,43 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
167
169
|
children: /* @__PURE__ */ t(M, { className: "size-4" })
|
|
168
170
|
}
|
|
169
171
|
),
|
|
170
|
-
/* @__PURE__ */ t(
|
|
172
|
+
/* @__PURE__ */ t(q, { className: f("size-4 opacity-50 shrink-0 transition-transform", n && "rotate-180") })
|
|
171
173
|
] })
|
|
172
174
|
]
|
|
173
175
|
}
|
|
174
176
|
),
|
|
175
|
-
n ? /* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */ t(
|
|
177
|
+
n ? /* @__PURE__ */ s("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
|
|
178
|
+
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ s("div", { className: "relative", children: [
|
|
179
|
+
/* @__PURE__ */ t(E, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
178
180
|
/* @__PURE__ */ t(
|
|
179
181
|
"input",
|
|
180
182
|
{
|
|
181
|
-
ref:
|
|
183
|
+
ref: x,
|
|
182
184
|
className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
183
185
|
placeholder: c,
|
|
184
186
|
value: a,
|
|
185
187
|
onChange: (e) => {
|
|
186
|
-
|
|
188
|
+
l(e.target.value);
|
|
187
189
|
}
|
|
188
190
|
}
|
|
189
191
|
)
|
|
190
192
|
] }) }),
|
|
191
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ s("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
|
|
192
194
|
i.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
193
|
-
i.map((e) => /* @__PURE__ */
|
|
195
|
+
i.map((e) => /* @__PURE__ */ s(
|
|
194
196
|
"button",
|
|
195
197
|
{
|
|
196
198
|
type: "button",
|
|
197
199
|
onClick: () => {
|
|
198
|
-
|
|
200
|
+
R(e.value);
|
|
199
201
|
},
|
|
200
|
-
className:
|
|
202
|
+
className: f(
|
|
201
203
|
"flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors text-left w-full",
|
|
202
204
|
o === e.value && "bg-muted font-medium"
|
|
203
205
|
),
|
|
204
206
|
children: [
|
|
205
|
-
/* @__PURE__ */ t(
|
|
207
|
+
/* @__PURE__ */ t(B, { className: f("size-3.5 shrink-0", o === e.value ? "opacity-100" : "opacity-0") }),
|
|
208
|
+
e.color && /* @__PURE__ */ t("span", { className: "size-2.5 shrink-0 rounded-full", style: { backgroundColor: e.color } }),
|
|
206
209
|
e.label
|
|
207
210
|
]
|
|
208
211
|
},
|
|
@@ -211,22 +214,22 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
211
214
|
] })
|
|
212
215
|
] }) : null
|
|
213
216
|
] });
|
|
214
|
-
},
|
|
217
|
+
}, le = ({
|
|
215
218
|
searchQuery: r,
|
|
216
219
|
search: o,
|
|
217
220
|
placeholder: p = "Rechercher...",
|
|
218
221
|
onSearch: u,
|
|
219
|
-
onSubmit:
|
|
222
|
+
onSubmit: m,
|
|
220
223
|
onClear: c,
|
|
221
224
|
className: d
|
|
222
225
|
}) => {
|
|
223
|
-
const a = r ?? o ?? "",
|
|
226
|
+
const a = r ?? o ?? "", l = () => {
|
|
224
227
|
u(""), c !== void 0 && c();
|
|
225
228
|
};
|
|
226
|
-
return /* @__PURE__ */
|
|
227
|
-
/* @__PURE__ */ t(
|
|
229
|
+
return /* @__PURE__ */ s("div", { className: f("relative h-fit w-full md:w-64", d), children: [
|
|
230
|
+
/* @__PURE__ */ t(E, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
228
231
|
/* @__PURE__ */ t(
|
|
229
|
-
|
|
232
|
+
A,
|
|
230
233
|
{
|
|
231
234
|
placeholder: p,
|
|
232
235
|
value: a,
|
|
@@ -235,16 +238,16 @@ const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
235
238
|
},
|
|
236
239
|
className: "pl-8",
|
|
237
240
|
onKeyDown: (n) => {
|
|
238
|
-
n.key === "Enter" &&
|
|
241
|
+
n.key === "Enter" && m !== void 0 && (n.preventDefault(), m());
|
|
239
242
|
}
|
|
240
243
|
}
|
|
241
244
|
),
|
|
242
|
-
a !== "" ? /* @__PURE__ */ t("button", { onClick:
|
|
245
|
+
a !== "" ? /* @__PURE__ */ t("button", { onClick: l, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ t(M, { className: "size-4" }) }) : null
|
|
243
246
|
] });
|
|
244
247
|
};
|
|
245
248
|
export {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
249
|
+
oe as D,
|
|
250
|
+
le as S,
|
|
251
|
+
ne as a,
|
|
252
|
+
se as b
|
|
250
253
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as F, useEffect as $, useMemo as A } from "react";
|
|
3
|
-
import { a as D, D as O, b as j, S as M } from "./SearchInput-
|
|
3
|
+
import { a as D, D as O, b as j, S as M } from "./SearchInput-bwnVKhhE.js";
|
|
4
4
|
import { B as k, a$ as I, bv as R, bx as z, bw as B, $ as C } from "./toggle-group-BASGy2mQ.js";
|
|
5
5
|
import "./alert-B78CiTYe.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
@@ -15,7 +15,7 @@ import { S as W, h as Y, i as Z, a as q, c as ee } from "./select-MWzbMBAS.js";
|
|
|
15
15
|
import "next-themes";
|
|
16
16
|
import "sonner";
|
|
17
17
|
import { c as re } from "./tailwind.helper-B6yFEsav.js";
|
|
18
|
-
import { M as te } from "./MultiSelect-
|
|
18
|
+
import { M as te } from "./MultiSelect-BPffv2am.js";
|
|
19
19
|
const L = (l, n, c = {}) => {
|
|
20
20
|
if (n instanceof Date)
|
|
21
21
|
return n.toLocaleDateString("fr-FR");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { b as m, T as h, c as u, B as g, a as f } from "./tooltip-BWyFpIxo.js";
|
|
3
3
|
import { S as v, h as b, i as N, a as S, c as x } from "./select-MWzbMBAS.js";
|
|
4
|
-
import { u as C } from "./useTheme-
|
|
4
|
+
import { u as C } from "./useTheme-CSr_h5xJ.js";
|
|
5
5
|
function I({ themeOptions: r, variant: i = "select" }) {
|
|
6
6
|
const { theme: n, handleThemeChange: t, currentThemeOption: e, nextThemeOption: c, cycleTheme: o } = C(r);
|
|
7
7
|
if (i === "mini") {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-
|
|
1
|
+
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-Dy_6PcOr.js";
|
|
2
2
|
import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-BASGy2mQ.js";
|
|
3
3
|
export {
|
|
4
4
|
i as AppDialog,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { D as r, M as o } from "../../MetricCard-D-qPl6zh.js";
|
|
2
2
|
import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-qHukR79N.js";
|
|
3
|
-
import { A as m, C as d, F as g } from "../../ConfirmationDialog-
|
|
3
|
+
import { A as m, C as d, F as g } from "../../ConfirmationDialog-Dy_6PcOr.js";
|
|
4
4
|
import { D as A, a as D, b as T, c as n, d as c, e as x, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-BASGy2mQ.js";
|
|
5
|
-
import { A as k, a as H, F as I, S as K, T as v } from "../../TableFilter-
|
|
6
|
-
import { G as M } from "../../GenericForm-
|
|
5
|
+
import { A as k, a as H, F as I, S as K, T as v } from "../../TableFilter-mQSKN8O8.js";
|
|
6
|
+
import { G as M } from "../../GenericForm-Bb4E2Wxd.js";
|
|
7
7
|
import { I as L } from "../../ImageInput-CJ419eqw.js";
|
|
8
|
-
import { D as G, a as N, S as O, b as R } from "../../SearchInput-
|
|
9
|
-
import { M as j } from "../../MultiSelect-
|
|
8
|
+
import { D as G, a as N, S as O, b as R } from "../../SearchInput-bwnVKhhE.js";
|
|
9
|
+
import { M as j } from "../../MultiSelect-BPffv2am.js";
|
|
10
10
|
import { A as w } from "../../AppActions-DCaejx-3.js";
|
|
11
11
|
import { A as J, K as Q } from "../../KpiCardsLayout-CK1TEUc1.js";
|
|
12
12
|
import { A as W } from "../../AppSubTitle-BNd5_q0i.js";
|
|
@@ -17,7 +17,7 @@ import { E as ta } from "../../ErrorState-vU8d4CwD.js";
|
|
|
17
17
|
import { L as la } from "../../LoadingState-BN0YaPSs.js";
|
|
18
18
|
import { D as ba, T as ma, a as da, b as ga, c as fa, d as Aa, e as Da } from "../../DataTable-BVgo8YWR.js";
|
|
19
19
|
import { A as na, a as ca, b as xa, c as Sa } from "../../AppVerticalTabs-NZ02HPGP.js";
|
|
20
|
-
import { T as Fa } from "../../ThemeSelector-
|
|
20
|
+
import { T as Fa } from "../../ThemeSelector-CQ3fSDJ2.js";
|
|
21
21
|
export {
|
|
22
22
|
k as ActiveFilters,
|
|
23
23
|
H as AdvancedFilters,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,8GAUzB,gBAAgB,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/MultiSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,gBAAgB;IACxB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,GAAI,8GAUzB,gBAAgB,KAAG,KAAK,CAAC,YAqK3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SearchableSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,kFAQ9B,qBAAqB,KAAG,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"SearchableSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/core/inputs/SearchableSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA+C,MAAM,OAAO,CAAC;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,UAAU,qBAAqB;IAC7B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,gBAAgB,GAAI,kFAQ9B,qBAAqB,KAAG,KAAK,CAAC,YAuIhC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { I as r } from "../../../ImageInput-CJ419eqw.js";
|
|
2
|
-
import { D as c, a as o, S as s, b as p } from "../../../SearchInput-
|
|
3
|
-
import { M as l } from "../../../MultiSelect-
|
|
2
|
+
import { D as c, a as o, S as s, b as p } from "../../../SearchInput-bwnVKhhE.js";
|
|
3
|
+
import { M as l } from "../../../MultiSelect-BPffv2am.js";
|
|
4
4
|
export {
|
|
5
5
|
c as DatePicker,
|
|
6
6
|
o as DateRangePicker,
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { D as o, M as r } from "../MetricCard-D-qPl6zh.js";
|
|
2
2
|
import { K as t, a as n, S as i, b as l } from "../SkeletonCards-qHukR79N.js";
|
|
3
|
-
import { A as p, C as u, F as g } from "../ConfirmationDialog-
|
|
3
|
+
import { A as p, C as u, F as g } from "../ConfirmationDialog-Dy_6PcOr.js";
|
|
4
4
|
import { A as m, j as C, k as S, l as T, m as c, n as D, o as M, p as x, q as A, r as I, s as P, t as h, u as f, v as w, w as v, x as F, B as L, y as B, z as G, C as H, E as R, F as k, G as N, H as y, I as E, J as O, K as V, L as K, M as z, N as U, O as j, Q as q, R as J, S as Q, T as W, U as X, V as Y, W as Z, X as _, Y as $, Z as aa, _ as ea, $ as oa, a0 as ra, a1 as sa, a2 as ta, a3 as na, a4 as ia, a5 as la, a6 as ba, a7 as pa, a8 as ua, a9 as ga, aa as da, ab as ma, ac as Ca, ad as Sa, ae as Ta, af as ca, ag as Da, ah as Ma, ai as xa, aj as Aa, ak as Ia, al as Pa, am as ha, an as fa, D as wa, a as va, b as Fa, c as La, d as Ba, e as Ga, f as Ha, g as Ra, h as ka, i as Na, ao as ya, ap as Ea, aq as Oa, ar as Va, as as Ka, at as za, au as Ua, av as ja, aw as qa, ax as Ja, ay as Qa, az as Wa, aA as Xa, aB as Ya, aC as Za, aD as _a, aE as $a, aF as ae, aG as ee, aH as oe, aI as re, aJ as se, aK as te, aL as ne, aM as ie, aN as le, aO as be, aP as pe, aQ as ue, aR as ge, aS as de, aT as me, aU as Ce, aV as Se, aW as Te, aX as ce, aY as De, aZ as Me, a_ as xe, a$ as Ae, b0 as Ie, b1 as Pe, b2 as he, b3 as fe, b4 as we, b5 as ve, b6 as Fe, b7 as Le, b8 as Be, b9 as Ge, ba as He, bb as Re, bc as ke, bd as Ne, be as ye, bf as Ee, bg as Oe, bh as Ve, bi as Ke, bj as ze, bk as Ue, bl as je, bm as qe, bn as Je, bo as Qe, bp as We, bq as Xe, br as Ye, bs as Ze, bt as _e, bu as $e, bv as ao, bw as eo, bx as oo, P as ro, by as so, bz as to, bA as no, bB as io, bC as lo, bD as bo, bE as po, bF as uo, bG as go, bH as mo, bI as Co, bJ as So, bK as To, bL as co, bM as Do, bN as Mo, bO as xo, bP as Ao, bQ as Io, bR as Po, bS as ho, bT as fo, bU as wo, bV as vo, bW as Fo, bX as Lo, bY as Bo, bZ as Go, b_ as Ho, b$ as Ro, c0 as ko, c1 as No, c2 as yo, c3 as Eo } from "../toggle-group-BASGy2mQ.js";
|
|
5
|
-
import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-
|
|
6
|
-
import { G as Jo } from "../GenericForm-
|
|
5
|
+
import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-mQSKN8O8.js";
|
|
6
|
+
import { G as Jo } from "../GenericForm-Bb4E2Wxd.js";
|
|
7
7
|
import { I as Wo } from "../ImageInput-CJ419eqw.js";
|
|
8
|
-
import { D as Yo, a as Zo, S as _o, b as $o } from "../SearchInput-
|
|
9
|
-
import { M as er } from "../MultiSelect-
|
|
8
|
+
import { D as Yo, a as Zo, S as _o, b as $o } from "../SearchInput-bwnVKhhE.js";
|
|
9
|
+
import { M as er } from "../MultiSelect-BPffv2am.js";
|
|
10
10
|
import { A as rr } from "../AppActions-DCaejx-3.js";
|
|
11
11
|
import { A as tr, K as nr } from "../KpiCardsLayout-CK1TEUc1.js";
|
|
12
12
|
import { A as lr } from "../AppSubTitle-BNd5_q0i.js";
|
|
@@ -17,7 +17,7 @@ import { E as Dr } from "../ErrorState-vU8d4CwD.js";
|
|
|
17
17
|
import { L as xr } from "../LoadingState-BN0YaPSs.js";
|
|
18
18
|
import { D as Ir, T as Pr, a as hr, b as fr, c as wr, d as vr, e as Fr } from "../DataTable-BVgo8YWR.js";
|
|
19
19
|
import { A as Br, a as Gr, b as Hr, c as Rr } from "../AppVerticalTabs-NZ02HPGP.js";
|
|
20
|
-
import { T as Nr } from "../ThemeSelector-
|
|
20
|
+
import { T as Nr } from "../ThemeSelector-CQ3fSDJ2.js";
|
|
21
21
|
import { A as Er, a as Or, b as Vr } from "../alert-B78CiTYe.js";
|
|
22
22
|
import { A as zr, C as Ur, a as jr, b as qr, R as Jr, c as Qr, d as Wr, T as Xr, e as Yr } from "../toaster-Du2OlHAd.js";
|
|
23
23
|
import { B as _r, T as $r, a as as, b as es, c as os, d as rs } from "../tooltip-BWyFpIxo.js";
|
package/dist/hooks/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { u as x } from "../useDocumentTitle-WNwdPz-I.js";
|
|
|
5
5
|
import { u as D } from "../useMobile-DN1_OMDB.js";
|
|
6
6
|
import { u as n } from "../useNotifications-zbUhCvF_.js";
|
|
7
7
|
import { u as g } from "../useServerTable-UvTY6L1N.js";
|
|
8
|
-
import { u as C } from "../useTheme-
|
|
8
|
+
import { u as C } from "../useTheme-CSr_h5xJ.js";
|
|
9
9
|
import { t as d, u as h } from "../useToast-BFTk4lWz.js";
|
|
10
10
|
export {
|
|
11
11
|
d as toast,
|
package/dist/hooks/ui/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { u as t } from "../../useDocumentTitle-WNwdPz-I.js";
|
|
|
3
3
|
import { u } from "../../useMobile-DN1_OMDB.js";
|
|
4
4
|
import { u as f } from "../../useNotifications-zbUhCvF_.js";
|
|
5
5
|
import { u as x } from "../../useServerTable-UvTY6L1N.js";
|
|
6
|
-
import { u as T } from "../../useTheme-
|
|
6
|
+
import { u as T } from "../../useTheme-CSr_h5xJ.js";
|
|
7
7
|
import { t as b, u as c } from "../../useToast-BFTk4lWz.js";
|
|
8
8
|
export {
|
|
9
9
|
b as toast,
|
|
@@ -6,6 +6,7 @@ export interface ThemeOption {
|
|
|
6
6
|
className?: string;
|
|
7
7
|
}>;
|
|
8
8
|
message?: string;
|
|
9
|
+
hideInMini?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function useTheme(themeOptions: readonly ThemeOption[]): {
|
|
11
12
|
theme: string | undefined;
|
|
@@ -13,7 +14,7 @@ export declare function useTheme(themeOptions: readonly ThemeOption[]): {
|
|
|
13
14
|
handleThemeChange: (newTheme: string) => void;
|
|
14
15
|
themeOptions: readonly ThemeOption[];
|
|
15
16
|
currentThemeOption: ThemeOption | undefined;
|
|
16
|
-
nextThemeOption: ThemeOption;
|
|
17
|
+
nextThemeOption: ThemeOption | undefined;
|
|
17
18
|
isDark: boolean;
|
|
18
19
|
cycleTheme: () => void;
|
|
19
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../src/hooks/ui/useTheme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,SAAS,WAAW,EAAE;;;kCAItB,MAAM;;;;;;EA8B5C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useTheme as f } from "next-themes";
|
|
2
|
+
import { u as d } from "./useNotifications-zbUhCvF_.js";
|
|
3
|
+
function x(s) {
|
|
4
|
+
const { showSuccess: r } = d(), { theme: n, setTheme: a } = f(), i = (e) => {
|
|
5
|
+
a(e);
|
|
6
|
+
const o = s.find((m) => m.value === e);
|
|
7
|
+
r("Thème mis à jour", `Le thème a été changé vers ${(o == null ? void 0 : o.label) ?? e}.`);
|
|
8
|
+
}, t = s.filter((e) => !e.hideInMini), u = s.find((e) => e.value === n), l = t.findIndex((e) => e.value === n), c = t.length > 0 ? t[(l + 1) % t.length] : void 0, h = (n == null ? void 0 : n.startsWith("dark")) ?? !1;
|
|
9
|
+
return {
|
|
10
|
+
theme: n,
|
|
11
|
+
setTheme: a,
|
|
12
|
+
handleThemeChange: i,
|
|
13
|
+
themeOptions: s,
|
|
14
|
+
currentThemeOption: u,
|
|
15
|
+
nextThemeOption: c,
|
|
16
|
+
isDark: h,
|
|
17
|
+
cycleTheme: () => {
|
|
18
|
+
c && i(c.value);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
x as u
|
|
24
|
+
};
|
package/package.json
CHANGED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useTheme as i } from "next-themes";
|
|
2
|
-
import { u as m } from "./useNotifications-zbUhCvF_.js";
|
|
3
|
-
function x(s) {
|
|
4
|
-
const { showSuccess: u } = m(), { theme: c, setTheme: a } = i(), r = (e) => {
|
|
5
|
-
a(e);
|
|
6
|
-
const n = s.find((f) => f.value === e);
|
|
7
|
-
u("Thème mis à jour", `Le thème a été changé vers ${(n == null ? void 0 : n.label) ?? e}.`);
|
|
8
|
-
}, o = s.find((e) => e.value === c), l = s.findIndex((e) => e.value === c), t = s[(l + 1) % s.length], h = (c == null ? void 0 : c.startsWith("dark")) ?? !1;
|
|
9
|
-
return {
|
|
10
|
-
theme: c,
|
|
11
|
-
setTheme: a,
|
|
12
|
-
handleThemeChange: r,
|
|
13
|
-
themeOptions: s,
|
|
14
|
-
currentThemeOption: o,
|
|
15
|
-
nextThemeOption: t,
|
|
16
|
-
isDark: h,
|
|
17
|
-
cycleTheme: () => r(t.value)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
export {
|
|
21
|
-
x as u
|
|
22
|
-
};
|