@krosoft/react 0.0.218 → 0.0.220
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/README.md +31 -0
- package/dist/{AppActions-BCXERyyB.js → AppActions-BFmagl91.js} +1 -1
- package/dist/{AppSubTitle-H8ElNObI.js → AppSubTitle-BMQMoehZ.js} +1 -1
- package/dist/AppVerticalTabs-0DrrDO3S.js +101 -0
- package/dist/{ConfirmationDialog-BmxaMEYz.js → ConfirmationDialog-CFsh-Eui.js} +62 -61
- package/dist/DataTable-Cpbp6yse.js +551 -0
- package/dist/ErrorAlert-D_203tKa.js +21 -0
- package/dist/ErrorState-DfJ009uc.js +12 -0
- package/dist/GenericForm-q9dvYl_h.js +342 -0
- package/dist/ImageInput-BYXz8wM1.js +68 -0
- package/dist/{KpiCardsLayout-XZTxB8FV.js → KpiCardsLayout-B-lMaUMA.js} +4 -4
- package/dist/{MultiSelect-Cj8vgAXJ.js → MultiSelect-Dkz1dgXo.js} +52 -51
- package/dist/{PieChart-D6y5EQnh.js → PieChart-bDy_V9Xt.js} +82 -81
- package/dist/SearchInput-CJ2YZpmB.js +244 -0
- package/dist/{SkeletonCards-CYo_lvKx.js → SkeletonCards-Bg2ygjwy.js} +1 -1
- package/dist/{TableFilter-DbnGaGKL.js → TableFilter-u6F06nMx.js} +133 -130
- package/dist/ThemeSelector-BRpEgvX8.js +49 -0
- package/dist/Topbar-bIyAunNd.js +318 -0
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/ChartCard.d.ts.map +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/FormDialog.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -1
- package/dist/components/core/filters/AdvancedFilters.d.ts.map +1 -1
- package/dist/components/core/filters/FilterField.d.ts.map +1 -1
- package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -1
- package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +18 -18
- package/dist/components/core/inputs/DateRangePicker.d.ts.map +1 -1
- package/dist/components/core/inputs/ImageInput.d.ts.map +1 -1
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts +1 -1
- package/dist/components/core/inputs/SearchInput.d.ts.map +1 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -1
- package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/ErrorAlert.d.ts.map +1 -1
- package/dist/components/core/states/ErrorState.d.ts.map +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/DataTable.d.ts.map +1 -1
- package/dist/components/core/table/TableBody.d.ts +1 -1
- package/dist/components/core/table/TableBody.d.ts.map +1 -1
- package/dist/components/core/table/TablePagination.d.ts.map +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/ThemeSelector.d.ts.map +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +18 -18
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -1
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -2
- package/dist/hooks/ui/index.js +1 -1
- package/dist/hooks/ui/useTheme.d.ts.map +1 -1
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +7 -0
- package/dist/i18n/krosoftLocales.d.ts +175 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -0
- package/dist/i18n/useKrosoftTranslation.d.ts +15 -0
- package/dist/i18n/useKrosoftTranslation.d.ts.map +1 -0
- package/dist/providers/index.js +1 -1
- package/dist/{sheet-BQmtrGf2.js → sheet-CDqLa-FP.js} +105 -108
- package/dist/useKrosoftTranslation-DdcylBY2.js +43 -0
- package/dist/usePage-Bhb81ffo.js +82 -0
- package/dist/useTheme-Cmw14Zxi.js +25 -0
- package/package.json +1 -1
- package/dist/AppVerticalTabs-aJmAVu6F.js +0 -100
- package/dist/DataTable-0-lae9KY.js +0 -550
- package/dist/ErrorAlert-SrIcU1mM.js +0 -17
- package/dist/ErrorState-CmaxuJyW.js +0 -8
- package/dist/GenericForm-DJR7PD-i.js +0 -341
- package/dist/ImageInput-DYe2XPNZ.js +0 -67
- package/dist/SearchInput-oeq0NBIc.js +0 -251
- package/dist/ThemeSelector-BFC37dSl.js +0 -48
- package/dist/Topbar-DUq-UeR0.js +0 -306
- package/dist/usePage-BFE9lxI1.js +0 -84
- package/dist/useTheme-CSr_h5xJ.js +0 -24
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { u as b } from "./useKrosoftTranslation-DdcylBY2.js";
|
|
2
3
|
import { c as d } from "./tailwind.helper-B6yFEsav.js";
|
|
3
4
|
import { Command as r } from "cmdk";
|
|
4
|
-
import { X as
|
|
5
|
+
import { X as p, SearchIcon as w } from "lucide-react";
|
|
5
6
|
import * as n from "react";
|
|
6
7
|
import * as s from "@radix-ui/react-dialog";
|
|
7
|
-
import { e as
|
|
8
|
-
import { cva as
|
|
9
|
-
const
|
|
8
|
+
import { e as v } from "./tooltip-DVeqVwqV.js";
|
|
9
|
+
import { cva as k } from "class-variance-authority";
|
|
10
|
+
const C = s.Root, W = s.Trigger, D = s.Portal, Y = s.Close, f = n.forwardRef(
|
|
10
11
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
11
12
|
s.Overlay,
|
|
12
13
|
{
|
|
@@ -19,24 +20,24 @@ const v = s.Root, M = s.Trigger, k = s.Portal, Q = s.Close, p = n.forwardRef(
|
|
|
19
20
|
}
|
|
20
21
|
)
|
|
21
22
|
);
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
({ className: e, children: a, ...t }, l) => /* @__PURE__ */ i(
|
|
25
|
-
/* @__PURE__ */ o(
|
|
23
|
+
f.displayName = s.Overlay.displayName;
|
|
24
|
+
const _ = "w-full max-w-none h-[100dvh] max-h-[100dvh] content-start rounded-none sm:h-auto sm:max-h-[95vh] sm:max-w-lg sm:rounded-surface", u = n.forwardRef(
|
|
25
|
+
({ className: e, children: a, ...t }, l) => /* @__PURE__ */ i(D, { children: [
|
|
26
|
+
/* @__PURE__ */ o(f, {}),
|
|
26
27
|
/* @__PURE__ */ i(
|
|
27
28
|
s.Content,
|
|
28
29
|
{
|
|
29
30
|
ref: l,
|
|
30
31
|
className: d(
|
|
31
32
|
"fixed left-[50%] top-[50%] z-[70] grid overflow-y-auto translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
32
|
-
|
|
33
|
+
_,
|
|
33
34
|
e
|
|
34
35
|
),
|
|
35
36
|
...t,
|
|
36
37
|
children: [
|
|
37
38
|
a,
|
|
38
39
|
/* @__PURE__ */ i(s.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
+
/* @__PURE__ */ o(p, { className: "size-4" }),
|
|
40
41
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
41
42
|
] })
|
|
42
43
|
]
|
|
@@ -44,18 +45,18 @@ const C = "w-full max-w-none h-[100dvh] max-h-[100dvh] content-start rounded-non
|
|
|
44
45
|
)
|
|
45
46
|
] })
|
|
46
47
|
);
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const
|
|
48
|
+
u.displayName = s.Content.displayName;
|
|
49
|
+
const S = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col space-y-1.5 text-center sm:text-left", e), ...a });
|
|
50
|
+
S.displayName = "DialogHeader";
|
|
51
|
+
const R = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
|
|
52
|
+
R.displayName = "DialogFooter";
|
|
53
|
+
const g = n.forwardRef(
|
|
53
54
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Title, { ref: t, className: d("text-lg font-semibold leading-none tracking-tight", e), ...a })
|
|
54
55
|
);
|
|
55
|
-
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
const
|
|
56
|
+
g.displayName = s.Title.displayName;
|
|
57
|
+
const x = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Description, { ref: t, className: d("text-sm text-muted-foreground", e), ...a }));
|
|
58
|
+
x.displayName = s.Description.displayName;
|
|
59
|
+
const h = n.forwardRef(
|
|
59
60
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
60
61
|
r,
|
|
61
62
|
{
|
|
@@ -65,32 +66,28 @@ const x = n.forwardRef(
|
|
|
65
66
|
}
|
|
66
67
|
)
|
|
67
68
|
);
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
children: m
|
|
89
|
-
}
|
|
90
|
-
)
|
|
91
|
-
] }) }), R = n.forwardRef(
|
|
69
|
+
h.displayName = r.displayName;
|
|
70
|
+
const Z = ({ title: e, description: a, shouldFilter: t, className: l, children: m, ...N }) => {
|
|
71
|
+
const { t: c } = b();
|
|
72
|
+
return /* @__PURE__ */ o(C, { ...N, children: /* @__PURE__ */ i(u, { className: "flex flex-col overflow-hidden p-0 shadow-lg", children: [
|
|
73
|
+
/* @__PURE__ */ o(g, { className: "sr-only", children: e ?? c("search.commandTitle") }),
|
|
74
|
+
/* @__PURE__ */ o(x, { className: "sr-only", children: a ?? c("search.commandDescription") }),
|
|
75
|
+
/* @__PURE__ */ o(
|
|
76
|
+
h,
|
|
77
|
+
{
|
|
78
|
+
shouldFilter: t,
|
|
79
|
+
className: d(
|
|
80
|
+
"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3",
|
|
81
|
+
"[&_[cmdk-list]]:max-h-none [&_[cmdk-list]]:min-h-0 [&_[cmdk-list]]:flex-1 sm:[&_[cmdk-list]]:max-h-[300px] sm:[&_[cmdk-list]]:flex-none",
|
|
82
|
+
l
|
|
83
|
+
),
|
|
84
|
+
children: m
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }) });
|
|
88
|
+
}, z = n.forwardRef(
|
|
92
89
|
({ className: e, ...a }, t) => /* @__PURE__ */ i("div", { className: "flex items-center border-b px-3", "cmdk-input-wrapper": "", children: [
|
|
93
|
-
/* @__PURE__ */ o(
|
|
90
|
+
/* @__PURE__ */ o(w, { className: "mr-2 size-4 shrink-0 opacity-50" }),
|
|
94
91
|
/* @__PURE__ */ o(
|
|
95
92
|
r.Input,
|
|
96
93
|
{
|
|
@@ -104,16 +101,16 @@ const U = ({
|
|
|
104
101
|
)
|
|
105
102
|
] })
|
|
106
103
|
);
|
|
107
|
-
|
|
108
|
-
const
|
|
104
|
+
z.displayName = r.Input.displayName;
|
|
105
|
+
const T = n.forwardRef(
|
|
109
106
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(r.List, { ref: t, className: d("max-h-[300px] overflow-y-auto overflow-x-hidden", e), ...a })
|
|
110
107
|
);
|
|
111
|
-
|
|
112
|
-
const
|
|
108
|
+
T.displayName = r.List.displayName;
|
|
109
|
+
const I = n.forwardRef(
|
|
113
110
|
(e, a) => /* @__PURE__ */ o(r.Empty, { ref: a, className: "py-6 text-center text-sm", ...e })
|
|
114
111
|
);
|
|
115
|
-
|
|
116
|
-
const
|
|
112
|
+
I.displayName = r.Empty.displayName;
|
|
113
|
+
const O = n.forwardRef(
|
|
117
114
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
118
115
|
r.Group,
|
|
119
116
|
{
|
|
@@ -126,10 +123,10 @@ const I = n.forwardRef(
|
|
|
126
123
|
}
|
|
127
124
|
)
|
|
128
125
|
);
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const
|
|
126
|
+
O.displayName = r.Group.displayName;
|
|
127
|
+
const j = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(r.Separator, { ref: t, className: d("-mx-1 h-px bg-border", e), ...a }));
|
|
128
|
+
j.displayName = r.Separator.displayName;
|
|
129
|
+
const P = n.forwardRef(
|
|
133
130
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
134
131
|
r.Item,
|
|
135
132
|
{
|
|
@@ -142,15 +139,15 @@ const O = n.forwardRef(
|
|
|
142
139
|
}
|
|
143
140
|
)
|
|
144
141
|
);
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
const
|
|
142
|
+
P.displayName = r.Item.displayName;
|
|
143
|
+
const F = ({ className: e, ...a }) => /* @__PURE__ */ o("span", { className: d("ml-auto text-xs tracking-widest text-muted-foreground", e), ...a });
|
|
144
|
+
F.displayName = "CommandShortcut";
|
|
145
|
+
const H = n.forwardRef(({ className: e, type: a, ...t }, l) => /* @__PURE__ */ o(
|
|
149
146
|
"input",
|
|
150
147
|
{
|
|
151
148
|
type: a,
|
|
152
149
|
className: d(
|
|
153
|
-
|
|
150
|
+
v,
|
|
154
151
|
// text-base sur mobile : évite le zoom automatique d'iOS à la prise de focus.
|
|
155
152
|
"flex w-full text-base file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 md:text-sm",
|
|
156
153
|
e
|
|
@@ -159,8 +156,8 @@ const j = n.forwardRef(({ className: e, type: a, ...t }, l) => /* @__PURE__ */ o
|
|
|
159
156
|
...t
|
|
160
157
|
}
|
|
161
158
|
));
|
|
162
|
-
|
|
163
|
-
const
|
|
159
|
+
H.displayName = "Input";
|
|
160
|
+
const ee = s.Root, ae = s.Trigger, te = s.Close, E = s.Portal, y = n.forwardRef(
|
|
164
161
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(
|
|
165
162
|
s.Overlay,
|
|
166
163
|
{
|
|
@@ -173,8 +170,8 @@ const W = s.Root, Y = s.Trigger, Z = s.Close, F = s.Portal, h = n.forwardRef(
|
|
|
173
170
|
}
|
|
174
171
|
)
|
|
175
172
|
);
|
|
176
|
-
|
|
177
|
-
const
|
|
173
|
+
y.displayName = s.Overlay.displayName;
|
|
174
|
+
const G = k(
|
|
178
175
|
"fixed z-[70] gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
179
176
|
{
|
|
180
177
|
variants: {
|
|
@@ -189,58 +186,58 @@ const H = w(
|
|
|
189
186
|
side: "right"
|
|
190
187
|
}
|
|
191
188
|
}
|
|
192
|
-
),
|
|
193
|
-
({ side: e = "right", className: a, children: t, ...l }, m) => /* @__PURE__ */ i(
|
|
194
|
-
/* @__PURE__ */ o(
|
|
195
|
-
/* @__PURE__ */ i(s.Content, { ref: m, className: d(
|
|
189
|
+
), L = n.forwardRef(
|
|
190
|
+
({ side: e = "right", className: a, children: t, ...l }, m) => /* @__PURE__ */ i(E, { children: [
|
|
191
|
+
/* @__PURE__ */ o(y, {}),
|
|
192
|
+
/* @__PURE__ */ i(s.Content, { ref: m, className: d(G({ side: e }), a), ...l, children: [
|
|
196
193
|
t,
|
|
197
194
|
/* @__PURE__ */ i(s.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
|
|
198
|
-
/* @__PURE__ */ o(
|
|
195
|
+
/* @__PURE__ */ o(p, { className: "size-4" }),
|
|
199
196
|
/* @__PURE__ */ o("span", { className: "sr-only", children: "Close" })
|
|
200
197
|
] })
|
|
201
198
|
] })
|
|
202
199
|
] })
|
|
203
200
|
);
|
|
204
|
-
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
const
|
|
201
|
+
L.displayName = s.Content.displayName;
|
|
202
|
+
const V = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col space-y-2 text-center sm:text-left", e), ...a });
|
|
203
|
+
V.displayName = "SheetHeader";
|
|
204
|
+
const q = ({ className: e, ...a }) => /* @__PURE__ */ o("div", { className: d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...a });
|
|
205
|
+
q.displayName = "SheetFooter";
|
|
206
|
+
const B = n.forwardRef(
|
|
210
207
|
({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Title, { ref: t, className: d("text-lg font-semibold text-foreground", e), ...a })
|
|
211
208
|
);
|
|
212
|
-
|
|
213
|
-
const
|
|
214
|
-
|
|
209
|
+
B.displayName = s.Title.displayName;
|
|
210
|
+
const K = n.forwardRef(({ className: e, ...a }, t) => /* @__PURE__ */ o(s.Description, { ref: t, className: d("text-sm text-muted-foreground", e), ...a }));
|
|
211
|
+
K.displayName = s.Description.displayName;
|
|
215
212
|
export {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
213
|
+
h as C,
|
|
214
|
+
C as D,
|
|
215
|
+
H as I,
|
|
216
|
+
ee as S,
|
|
217
|
+
Y as a,
|
|
218
|
+
u as b,
|
|
219
|
+
x as c,
|
|
220
|
+
R as d,
|
|
221
|
+
S as e,
|
|
222
|
+
f,
|
|
223
|
+
D as g,
|
|
224
|
+
g as h,
|
|
225
|
+
W as i,
|
|
226
|
+
Z as j,
|
|
227
|
+
I as k,
|
|
228
|
+
O as l,
|
|
229
|
+
z as m,
|
|
230
|
+
P as n,
|
|
231
|
+
T as o,
|
|
232
|
+
j as p,
|
|
233
|
+
F as q,
|
|
234
|
+
te as r,
|
|
235
|
+
L as s,
|
|
236
|
+
K as t,
|
|
237
|
+
q as u,
|
|
238
|
+
V as v,
|
|
239
|
+
y as w,
|
|
240
|
+
E as x,
|
|
241
|
+
B as y,
|
|
242
|
+
ae as z
|
|
246
243
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useTranslation as c } from "react-i18next";
|
|
2
|
+
const l = { cancel: "Cancel", save: "Save", saving: "Saving...", edit: "Edit", delete: "Delete" }, d = { loading: "Loading...", error: "Something went wrong.", errorPrefix: "Error:", errorTitle: "Error", noResult: "No result", noResultDot: "No result.", noData: "No data available", underConstruction: "Section under development", comingSoon: "This feature will be available soon" }, u = { trigger: "Search", placeholder: "Search...", globalTitle: "Global search", globalDescription: "Search for a page or a record across the application.", commandTitle: "Command palette", commandDescription: "Search for a command to run.", loading: "Searching..." }, p = { placeholder: "Select...", create: "Create “{{search}}”", section: "Select a section", theme: "Select a theme" }, g = { pickDate: "Select a date", pickPeriod: "Select a period", clearPeriod: "Clear the selected period" }, m = { advanced: "Advanced filters", more: "More filters", yes: "Yes", no: "No" }, h = { validationTitle: "Validation error", validationMessage: "Please check the form fields", submitError: "Something went wrong while saving" }, f = { empty: "No image", upload: "Click to upload", invalidType: "Only {{types}} files are accepted", tooLarge: "The file must not exceed {{size}}MB" }, v = { previousPage: "Previous page", nextPage: "Next page" }, S = { menu: "Navigation menu", description: "Main navigation of the application" }, b = { updatedTitle: "Theme updated", updatedMessage: "The theme has been changed to {{theme}}." }, T = {
|
|
3
|
+
actions: l,
|
|
4
|
+
states: d,
|
|
5
|
+
search: u,
|
|
6
|
+
select: p,
|
|
7
|
+
date: g,
|
|
8
|
+
filters: m,
|
|
9
|
+
form: h,
|
|
10
|
+
image: f,
|
|
11
|
+
table: v,
|
|
12
|
+
sidebar: S,
|
|
13
|
+
theme: b
|
|
14
|
+
}, P = { cancel: "Annuler", save: "Enregistrer", saving: "Enregistrement...", edit: "Modifier", delete: "Supprimer" }, R = { loading: "Chargement...", error: "Une erreur est survenue.", errorPrefix: "Erreur :", errorTitle: "Erreur", noResult: "Aucun résultat", noResultDot: "Aucun résultat.", noData: "Aucune donnée disponible", underConstruction: "Section en cours de développement", comingSoon: "Cette fonctionnalité sera bientôt disponible" }, E = { trigger: "Rechercher", placeholder: "Rechercher...", globalTitle: "Recherche globale", globalDescription: "Rechercher une page ou une donnée dans l'application.", commandTitle: "Palette de commandes", commandDescription: "Rechercher une commande à exécuter.", loading: "Recherche..." }, C = { placeholder: "Sélectionner...", create: "Créer « {{search}} »", section: "Sélectionner une section", theme: "Sélectionner un thème" }, y = { pickDate: "Sélectionner une date", pickPeriod: "Sélectionner une période", clearPeriod: "Effacer la période sélectionnée" }, D = { advanced: "Filtres avancés", more: "Plus de filtres", yes: "Oui", no: "Non" }, M = { validationTitle: "Erreur de validation", validationMessage: "Veuillez vérifier les champs du formulaire", submitError: "Une erreur est survenue lors de l'enregistrement" }, $ = { empty: "Aucune image", upload: "Cliquer pour uploader", invalidType: "Seuls les fichiers {{types}} sont acceptés", tooLarge: "Le fichier ne doit pas dépasser {{size}}MB" }, N = { previousPage: "Page précédente", nextPage: "Page suivante" }, A = { menu: "Menu de navigation", description: "Navigation principale de l'application" }, k = { updatedTitle: "Thème mis à jour", updatedMessage: "Le thème a été changé vers {{theme}}." }, s = {
|
|
15
|
+
actions: P,
|
|
16
|
+
states: R,
|
|
17
|
+
search: E,
|
|
18
|
+
select: C,
|
|
19
|
+
date: y,
|
|
20
|
+
filters: D,
|
|
21
|
+
form: M,
|
|
22
|
+
image: $,
|
|
23
|
+
table: N,
|
|
24
|
+
sidebar: A,
|
|
25
|
+
theme: k
|
|
26
|
+
}, n = "krosoft", w = { fr: s, en: T }, K = (e, { overwrite: t = !1 } = {}) => {
|
|
27
|
+
typeof e.addResourceBundle == "function" && Object.entries(w).forEach(([r, o]) => {
|
|
28
|
+
var a;
|
|
29
|
+
(a = e.addResourceBundle) == null || a.call(e, r, n, o, !0, t);
|
|
30
|
+
});
|
|
31
|
+
}, x = (e) => {
|
|
32
|
+
const t = e.split(".").reduce((r, o) => typeof r == "object" && r !== null ? r[o] : void 0, s);
|
|
33
|
+
return typeof t == "string" ? t : void 0;
|
|
34
|
+
}, L = (e, t) => t === void 0 ? e : e.replace(/\{\{(\w+)\}\}/g, (r, o) => o in t ? String(t[o]) : r), j = () => {
|
|
35
|
+
const { t: e, i18n: t, ready: r } = c(n, { useSuspense: !1 });
|
|
36
|
+
return { t: (a, i) => r && t.hasResourceBundle(t.language, n) ? e(a, i ?? {}) : L(x(a) ?? a, i) };
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
n as K,
|
|
40
|
+
w as k,
|
|
41
|
+
K as r,
|
|
42
|
+
j as u
|
|
43
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { u } from "./useKrosoftTranslation-DdcylBY2.js";
|
|
2
|
+
import { TrashIcon as l } from "lucide-react";
|
|
3
|
+
import * as c from "react";
|
|
4
|
+
import { useState as m, useContext as f } from "react";
|
|
5
|
+
import { P as d } from "./sidebar.context-D5nywlmP.js";
|
|
6
|
+
const g = (e) => {
|
|
7
|
+
const [o, t] = m(null), r = (n, s) => {
|
|
8
|
+
var a;
|
|
9
|
+
(a = e == null ? void 0 : e.onReset) == null || a.call(e), t({ id: n, name: s });
|
|
10
|
+
}, i = () => {
|
|
11
|
+
t(null);
|
|
12
|
+
};
|
|
13
|
+
return {
|
|
14
|
+
id: (o == null ? void 0 : o.id) ?? null,
|
|
15
|
+
name: (o == null ? void 0 : o.name) ?? null,
|
|
16
|
+
isOpen: !!o,
|
|
17
|
+
openDialog: r,
|
|
18
|
+
onClose: i
|
|
19
|
+
};
|
|
20
|
+
}, C = ({
|
|
21
|
+
titleKey: e,
|
|
22
|
+
descriptionKey: o,
|
|
23
|
+
confirmKey: t = "Confirmer",
|
|
24
|
+
onConfirm: r,
|
|
25
|
+
onReset: i
|
|
26
|
+
}) => {
|
|
27
|
+
const n = g({ onReset: i }), s = async () => {
|
|
28
|
+
if (n.id)
|
|
29
|
+
try {
|
|
30
|
+
await r(n.id), n.onClose();
|
|
31
|
+
} catch (a) {
|
|
32
|
+
console.error("Error confirming action:", a);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
isOpen: n.isOpen,
|
|
37
|
+
itemName: n.name,
|
|
38
|
+
title: e,
|
|
39
|
+
description: o,
|
|
40
|
+
confirmKey: t,
|
|
41
|
+
openDialog: n.openDialog,
|
|
42
|
+
onClose: n.onClose,
|
|
43
|
+
onConfirm: s
|
|
44
|
+
};
|
|
45
|
+
}, P = ({ titleKey: e, descriptionKey: o, confirmKey: t, onConfirm: r, onReset: i }) => {
|
|
46
|
+
const { t: n } = u();
|
|
47
|
+
return {
|
|
48
|
+
...C({
|
|
49
|
+
titleKey: e,
|
|
50
|
+
descriptionKey: o,
|
|
51
|
+
confirmKey: t ?? n("actions.delete"),
|
|
52
|
+
onConfirm: r,
|
|
53
|
+
onReset: i
|
|
54
|
+
}),
|
|
55
|
+
loadingKey: "Suppression...",
|
|
56
|
+
icon: l,
|
|
57
|
+
titleClassName: "flex items-center gap-2 text-destructive",
|
|
58
|
+
headerClassName: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-surface shrink-0"
|
|
59
|
+
};
|
|
60
|
+
}, w = (e, o = 250) => {
|
|
61
|
+
const [t, r] = c.useState(e);
|
|
62
|
+
return c.useEffect(() => {
|
|
63
|
+
const i = setTimeout(() => {
|
|
64
|
+
r(e);
|
|
65
|
+
}, o);
|
|
66
|
+
return () => {
|
|
67
|
+
clearTimeout(i);
|
|
68
|
+
};
|
|
69
|
+
}, [e, o]), t;
|
|
70
|
+
}, S = () => {
|
|
71
|
+
const e = f(d);
|
|
72
|
+
if (e === void 0)
|
|
73
|
+
throw new Error("usePage must be used within an PageProvider");
|
|
74
|
+
return e;
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
C as a,
|
|
78
|
+
w as b,
|
|
79
|
+
g as c,
|
|
80
|
+
S as d,
|
|
81
|
+
P as u
|
|
82
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { u as f } from "./useKrosoftTranslation-DdcylBY2.js";
|
|
2
|
+
import { useTheme as T } from "next-themes";
|
|
3
|
+
import { u as p } from "./useNotifications-zbUhCvF_.js";
|
|
4
|
+
function I(s) {
|
|
5
|
+
const { t: a } = f(), { showSuccess: u } = p(), { theme: t, setTheme: i } = T(), r = (e) => {
|
|
6
|
+
i(e);
|
|
7
|
+
const c = s.find((m) => m.value === e);
|
|
8
|
+
u(a("theme.updatedTitle"), a("theme.updatedMessage", { theme: (c == null ? void 0 : c.label) ?? e }));
|
|
9
|
+
}, n = s.filter((e) => !e.hideInMini), l = s.find((e) => e.value === t), h = n.findIndex((e) => e.value === t), o = n.length > 0 ? n[(h + 1) % n.length] : void 0, d = (t == null ? void 0 : t.startsWith("dark")) ?? !1;
|
|
10
|
+
return {
|
|
11
|
+
theme: t,
|
|
12
|
+
setTheme: i,
|
|
13
|
+
handleThemeChange: r,
|
|
14
|
+
themeOptions: s,
|
|
15
|
+
currentThemeOption: l,
|
|
16
|
+
nextThemeOption: o,
|
|
17
|
+
isDark: d,
|
|
18
|
+
cycleTheme: () => {
|
|
19
|
+
o && r(o.value);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
I as u
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { jsxs as r, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import { C as b, d as w, a as S } from "./chart-DntJZGxB.js";
|
|
3
|
-
import { A as C } from "./AppActions-BCXERyyB.js";
|
|
4
|
-
import { A as T } from "./AppTitle-D15YXeMx.js";
|
|
5
|
-
import { bi as A, bk as P, bl as k, bj as j, b5 as z } from "./toggle-group-DLLrEwv2.js";
|
|
6
|
-
import { useRef as V, useEffect as R } from "react";
|
|
7
|
-
import { useTranslation as g } from "react-i18next";
|
|
8
|
-
import { useSearchParams as y } from "react-router-dom";
|
|
9
|
-
import { c as q } from "./tailwind.helper-B6yFEsav.js";
|
|
10
|
-
import { S as I, h as K, i as L, a as H, c as U } from "./select-BpjFWqAY.js";
|
|
11
|
-
import { ConstructionIcon as v } from "lucide-react";
|
|
12
|
-
function D({ titleKey: n, descriptionKey: l, actions: t = [], className: c }) {
|
|
13
|
-
return /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
|
|
14
|
-
/* @__PURE__ */ s(T, { titleKey: n, descriptionKey: l, isSubTitle: !0 }),
|
|
15
|
-
/* @__PURE__ */ s(C, { actions: t, className: c })
|
|
16
|
-
] });
|
|
17
|
-
}
|
|
18
|
-
function Y({ titleKey: n, descriptionKey: l, actions: t = [], className: c, children: o, isSubTitle: p }) {
|
|
19
|
-
return /* @__PURE__ */ r(b, { children: [
|
|
20
|
-
/* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(D, { titleKey: n, descriptionKey: l, actions: t, className: c }) }),
|
|
21
|
-
/* @__PURE__ */ s(S, { className: "space-y-4", children: o })
|
|
22
|
-
] });
|
|
23
|
-
}
|
|
24
|
-
function Z({ tabs: n, itemId: l, item: t, fit: c }) {
|
|
25
|
-
var d, a;
|
|
26
|
-
const { t: o } = g(), [p, i] = y(), h = p.get("tab"), f = ((d = n.find((e) => e.value === h)) == null ? void 0 : d.value) ?? ((a = n[0]) == null ? void 0 : a.value), x = (e) => {
|
|
27
|
-
const u = new URLSearchParams();
|
|
28
|
-
u.set("tab", e), i(u);
|
|
29
|
-
}, m = V(null);
|
|
30
|
-
return R(() => {
|
|
31
|
-
var u, N;
|
|
32
|
-
const e = (u = m.current) == null ? void 0 : u.querySelector('[data-state="active"]');
|
|
33
|
-
(N = e == null ? void 0 : e.scrollIntoView) == null || N.call(e, { behavior: "smooth", block: "nearest", inline: "nearest" });
|
|
34
|
-
}, [f]), /* @__PURE__ */ r(A, { value: f, onValueChange: x, children: [
|
|
35
|
-
/* @__PURE__ */ s(P, { ref: m, className: q("w-full justify-start", c && "sm:w-fit"), children: n.map((e) => /* @__PURE__ */ r(k, { value: e.value, className: "gap-2", disabled: e.disabled, children: [
|
|
36
|
-
e.icon ? /* @__PURE__ */ s("span", { className: "hidden sm:inline", children: /* @__PURE__ */ s(e.icon, { className: "size-4" }) }) : null,
|
|
37
|
-
/* @__PURE__ */ s("span", { className: "text-xs sm:text-sm", children: o(e.titleKey) ?? "" }),
|
|
38
|
-
e.count ? /* @__PURE__ */ r("span", { className: "text-gray-500 text-xs", children: [
|
|
39
|
-
"(",
|
|
40
|
-
e.count(t),
|
|
41
|
-
")"
|
|
42
|
-
] }) : null
|
|
43
|
-
] }, e.value)) }),
|
|
44
|
-
n.map((e) => /* @__PURE__ */ s(j, { value: e.value, className: "mt-4", children: e.component ? e.component(l) : null }, e.value))
|
|
45
|
-
] });
|
|
46
|
-
}
|
|
47
|
-
const _ = ({ tabs: n, item: l }) => {
|
|
48
|
-
var m, d;
|
|
49
|
-
const { t } = g(), [c, o] = y(), p = c.get("tab"), i = ((m = n.find((a) => a.value === p)) == null ? void 0 : m.value) ?? ((d = n[0]) == null ? void 0 : d.value), h = (a) => {
|
|
50
|
-
const e = new URLSearchParams();
|
|
51
|
-
e.set("tab", a), o(e);
|
|
52
|
-
}, f = () => {
|
|
53
|
-
const a = n.find((e) => e.value === i);
|
|
54
|
-
return a ? a.component ? a.component() : x() : null;
|
|
55
|
-
}, x = () => /* @__PURE__ */ s("div", { className: "p-4 lg:p-6", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-center h-64 text-gray-500", children: /* @__PURE__ */ r("div", { className: "text-center", children: [
|
|
56
|
-
/* @__PURE__ */ s(v, { className: "h-12 w-12 mx-auto mb-4 text-amber-500" }),
|
|
57
|
-
/* @__PURE__ */ s("p", { className: "text-lg font-medium", children: "Section en cours de développement" }),
|
|
58
|
-
/* @__PURE__ */ s("p", { className: "text-sm text-gray-400", children: "Cette fonctionnalité sera bientôt disponible" })
|
|
59
|
-
] }) }) });
|
|
60
|
-
return /* @__PURE__ */ r("div", { className: "flex flex-col md:flex-row h-full min-w-0 ", children: [
|
|
61
|
-
/* @__PURE__ */ s("div", { className: "w-64 lg:w-80 flex-shrink-0 hidden md:block border-r border-gray-200 dark:border-gray-700 pr-4", children: /* @__PURE__ */ s(z, { className: "h-full", children: /* @__PURE__ */ s("div", { className: "space-y-1", children: n.map((a, e) => /* @__PURE__ */ r(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
className: `px-2 py-2 rounded-control text-sm transition-colors flex items-center gap-2 ${a.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : i === a.value ? "crm-color-styled font-medium cursor-pointer" : "text-gray-600 hover:bg-gray-100 dark:text-gray-300 dark:hover:bg-gray-700 cursor-pointer"}`,
|
|
65
|
-
onClick: () => !a.disabled && h(a.value),
|
|
66
|
-
children: [
|
|
67
|
-
a.icon && /* @__PURE__ */ s(a.icon, { className: "size-4" }),
|
|
68
|
-
/* @__PURE__ */ s("span", { className: "flex-1", children: t(a.titleKey) }),
|
|
69
|
-
a.count && /* @__PURE__ */ r("span", { className: "text-xs text-gray-500", children: [
|
|
70
|
-
"(",
|
|
71
|
-
a.count(l),
|
|
72
|
-
")"
|
|
73
|
-
] }),
|
|
74
|
-
!a.component && /* @__PURE__ */ s(v, { className: "size-4 text-amber-500" })
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
e
|
|
78
|
-
)) }) }) }),
|
|
79
|
-
/* @__PURE__ */ s("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ r(I, { value: i, onValueChange: h, children: [
|
|
80
|
-
/* @__PURE__ */ s(K, { className: "w-full", children: /* @__PURE__ */ s(L, { placeholder: "Sélectionner une section" }) }),
|
|
81
|
-
/* @__PURE__ */ s(H, { children: n.map((a, e) => /* @__PURE__ */ s(U, { value: a.value, disabled: a.disabled, children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
|
|
82
|
-
a.icon && /* @__PURE__ */ s(a.icon, { className: "size-4" }),
|
|
83
|
-
/* @__PURE__ */ s("span", { children: t(a.titleKey) }),
|
|
84
|
-
a.count && /* @__PURE__ */ r("span", { className: "text-xs text-gray-500", children: [
|
|
85
|
-
"(",
|
|
86
|
-
a.count(l),
|
|
87
|
-
")"
|
|
88
|
-
] }),
|
|
89
|
-
!a.component && /* @__PURE__ */ s(v, { className: "size-4 text-amber-500" })
|
|
90
|
-
] }) }, e)) })
|
|
91
|
-
] }) }),
|
|
92
|
-
/* @__PURE__ */ s("div", { className: "flex-1 md:px-4 min-w-0 overflow-auto", children: f() })
|
|
93
|
-
] });
|
|
94
|
-
};
|
|
95
|
-
export {
|
|
96
|
-
Y as A,
|
|
97
|
-
D as a,
|
|
98
|
-
Z as b,
|
|
99
|
-
_ as c
|
|
100
|
-
};
|