@krosoft/react 0.0.238 → 0.0.240
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/AppActions-C_0YI75w.js +60 -0
- package/dist/AppSubTitle-tqqV9nuT.js +19 -0
- package/dist/AppTitle-BR4JFZfp.js +19 -0
- package/dist/ErrorAlert-BDqDHUUc.js +27 -0
- package/dist/GenericForm-CWXT5wiv.js +310 -0
- package/dist/ImageInput-CN2ozjpc.js +80 -0
- package/dist/MultiSelect-BF0zL0B0.js +134 -0
- package/dist/SearchInput-BJPT0SbB.js +255 -0
- package/dist/alert-REQGK9bR.js +32 -0
- package/dist/behavior-BR_V9Rpe.js +76 -0
- package/dist/cards-Cta6x49J.js +126 -0
- package/dist/chart-Dq3AIrue.js +166 -0
- package/dist/charts-CXhVUqLH.js +328 -0
- package/dist/components/core/cards/index.js +2 -10
- package/dist/components/core/charts/index.js +2 -11
- package/dist/components/core/dialogs/index.js +4 -19
- package/dist/components/core/filters/index.js +426 -7
- package/dist/components/core/forms/index.js +2 -4
- package/dist/components/core/index.js +24 -97
- package/dist/components/core/inputs/index.js +4 -11
- package/dist/components/core/language/index.js +2 -4
- package/dist/components/core/layouts/index.js +50 -11
- package/dist/components/core/navbar/index.js +2 -9
- package/dist/components/core/states/index.js +3 -8
- package/dist/components/core/table/index.js +2 -15
- package/dist/components/core/tabs/index.js +188 -6
- package/dist/components/core/theme/index.js +2 -4
- package/dist/components/index.js +28 -322
- package/dist/components/ui/index.js +8 -240
- package/dist/contexts/index.js +2 -5
- package/dist/dialogs-BGHSClsq.js +208 -0
- package/dist/helpers/index.js +39 -46
- package/dist/hooks/behavior/index.js +2 -10
- package/dist/hooks/index.js +11 -30
- package/dist/hooks/ui/index.js +10 -22
- package/dist/i18n/index.js +2 -10
- package/dist/i18n-Dw99bRmg.js +190 -0
- package/dist/language-DxHhlpgN.js +58 -0
- package/dist/navbar-Bc5OQWRI.js +385 -0
- package/dist/providers/index.js +42 -49
- package/dist/pwa/index.js +32 -34
- package/dist/select-ULiTPOr5.js +81 -0
- package/dist/sheet-CRrYTZrl.js +226 -0
- package/dist/sidebar.context-BahtU6hE.js +5 -0
- package/dist/skeleton-D6Ga4BLw.js +11 -0
- package/dist/states-N8-LjFng.js +26 -0
- package/dist/table-muUyiaK6.js +571 -0
- package/dist/tailwind/index.js +126 -156
- package/dist/tailwind.helper-CJaRYBmL.js +8 -0
- package/dist/theme-B_n0F6R4.js +57 -0
- package/dist/tokens/index.js +37 -46
- package/dist/tooltip-B2dzyfs9.js +50 -0
- package/dist/types/forms/index.js +0 -1
- package/dist/types/index.js +1 -1
- package/dist/ui-CiX0E_bn.js +1165 -0
- package/dist/ui-DSVBO3iM.js +46 -0
- package/dist/useDocumentTitle-D7MywIeB.js +19 -0
- package/dist/useFixedColumns-DfAX30tT.js +147 -0
- package/dist/useLanguage-DN3CuBv5.js +19 -0
- package/dist/useMobile-pTQ8lWvt.js +16 -0
- package/dist/useNotifications-CyhTruIG.js +20 -0
- package/dist/useScrollFade-D9kqJBDh.js +27 -0
- package/dist/useTheme-DVfcJ-Qd.js +25 -0
- package/dist/useToast-UeDRLovh.js +103 -0
- package/package.json +3 -3
- package/dist/AppActions-BFwztl-1.js +0 -76
- package/dist/AppSubTitle-BTN0YAc7.js +0 -13
- package/dist/AppTitle-D15YXeMx.js +0 -13
- package/dist/AppVerticalTabs-B7XXtAVj.js +0 -103
- package/dist/ConfirmationDialog-Dj4WdnHg.js +0 -188
- package/dist/DataTable-CjrR27Di.js +0 -638
- package/dist/ErrorAlert-B99Xb_Hg.js +0 -23
- package/dist/ErrorState-CkeS_IBT.js +0 -14
- package/dist/GenericForm-CydibLHU.js +0 -343
- package/dist/ImageInput-DoOOvvth.js +0 -70
- package/dist/KpiCardsLayout-Bq4xQ3i8.js +0 -43
- package/dist/LanguageSelector-C7E51rCQ.js +0 -47
- package/dist/LoadingState-BN0YaPSs.js +0 -9
- package/dist/MetricCard-B0xnFyim.js +0 -53
- package/dist/MultiSelect-DbH7LrsD.js +0 -149
- package/dist/PieChart-uozNJtEx.js +0 -295
- package/dist/SearchInput-DIZ5Yt6L.js +0 -246
- package/dist/SkeletonCards-B9C4cNMr.js +0 -75
- package/dist/TableFilter-CmEVF5Bo.js +0 -422
- package/dist/ThemeSelector-CLi4_epH.js +0 -52
- package/dist/Topbar-Clby5_uj.js +0 -431
- package/dist/alert-B9F1N9Qk.js +0 -30
- package/dist/chart-DntJZGxB.js +0 -181
- package/dist/select-BpjFWqAY.js +0 -96
- package/dist/sheet-XYI-ezvY.js +0 -292
- package/dist/sidebar.context-D5nywlmP.js +0 -6
- package/dist/skeleton-BX4RcsiK.js +0 -8
- package/dist/tailwind.helper-B6yFEsav.js +0 -8
- package/dist/toaster-CyzB1m5z.js +0 -75
- package/dist/toggle-group-iZqnrTj7.js +0 -1276
- package/dist/tooltip-DVeqVwqV.js +0 -61
- package/dist/useDateFnsLocale-D6VExZ8U.js +0 -11
- package/dist/useDocumentTitle-WNwdPz-I.js +0 -14
- package/dist/useFixedColumns-CKZyu4PD.js +0 -161
- package/dist/useKrosoftTranslation-BTp46G94.js +0 -47
- package/dist/useLanguage-C9jI2nwn.js +0 -19
- package/dist/useMobile-DN1_OMDB.js +0 -16
- package/dist/useNotifications-zbUhCvF_.js +0 -12
- package/dist/usePage-BQm6tdJD.js +0 -84
- package/dist/useScrollFade-BA4KqJYp.js +0 -23
- package/dist/useServerTable-UvTY6L1N.js +0 -38
- package/dist/useSidebar-BJuALHqQ.js +0 -11
- package/dist/useTheme-DS6ZjdzM.js +0 -27
- package/dist/useToast-BFTk4lWz.js +0 -100
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
import { jsx as e, jsxs as r, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import "date-fns/locale";
|
|
3
|
-
import { useTranslation as O } from "react-i18next";
|
|
4
|
-
import { u as R } from "./useKrosoftTranslation-BTp46G94.js";
|
|
5
|
-
import { P as W, d as X, g as $, j, k as q, h as T, i as J, f as Q } from "./toggle-group-iZqnrTj7.js";
|
|
6
|
-
import { A as U, a as V } from "./alert-B9F1N9Qk.js";
|
|
7
|
-
import "@radix-ui/react-aspect-ratio";
|
|
8
|
-
import { B as v } from "./tooltip-DVeqVwqV.js";
|
|
9
|
-
import "./chart-DntJZGxB.js";
|
|
10
|
-
import "@radix-ui/react-collapsible";
|
|
11
|
-
import { D as Y, b as Z, e as _, h as L, c as ee } from "./sheet-XYI-ezvY.js";
|
|
12
|
-
import { AlertCircleIcon as le, X as S, Save as I, Pen as K } from "lucide-react";
|
|
13
|
-
import "react-resizable-panels";
|
|
14
|
-
import "clsx";
|
|
15
|
-
import "tailwind-merge";
|
|
16
|
-
import "./select-BpjFWqAY.js";
|
|
17
|
-
import "next-themes";
|
|
18
|
-
import "sonner";
|
|
19
|
-
import { useState as A, useEffect as ie } from "react";
|
|
20
|
-
import { G as re } from "./GenericForm-CydibLHU.js";
|
|
21
|
-
import { E as se } from "./ErrorAlert-B99Xb_Hg.js";
|
|
22
|
-
function te({ open: t, onOpenChange: d, config: l, isLoading: u, error: s, children: p }) {
|
|
23
|
-
const { t: i } = O(), { title: b, description: c, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
24
|
-
return /* @__PURE__ */ e(Y, { open: t, onOpenChange: d, children: /* @__PURE__ */ r(Z, { className: `${g} max-h-[100dvh] sm:max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
|
|
25
|
-
u === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(W, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
|
|
26
|
-
/* @__PURE__ */ r(_, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-4 sm:p-6 sm:rounded-t-surface shrink-0", children: [
|
|
27
|
-
/* @__PURE__ */ r(L, { className: "text-xl sm:text-2xl font-bold flex items-center gap-2 text-white", children: [
|
|
28
|
-
f !== void 0 ? /* @__PURE__ */ e("div", { className: "p-2 bg-white/20 rounded-control", children: /* @__PURE__ */ e(f, { className: "size-4 text-white" }) }) : null,
|
|
29
|
-
i(b)
|
|
30
|
-
] }),
|
|
31
|
-
c !== void 0 && c !== "" ? /* @__PURE__ */ e(ee, { className: "text-indigo-100 text-base", children: i(c) }) : null
|
|
32
|
-
] }),
|
|
33
|
-
s != null ? /* @__PURE__ */ e("div", { className: "px-6 ", children: /* @__PURE__ */ r(U, { variant: "destructive", className: "max-w-full", children: [
|
|
34
|
-
/* @__PURE__ */ e(le, { className: "size-4" }),
|
|
35
|
-
/* @__PURE__ */ e(V, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
|
|
36
|
-
] }) }) : null,
|
|
37
|
-
/* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 sm:px-6 py-4", children: p }),
|
|
38
|
-
n !== void 0 && n.length > 0 ? /* @__PURE__ */ e("div", { className: "sm:rounded-b-surface border-t border-gray-200 dark:border-gray-700 shrink-0 p-4 sm:p-6 light:bg-gradient-to-r light:from-gray-50 light:to-gray-100 dark:bg-gray-950", children: /* @__PURE__ */ e("div", { className: "flex justify-end gap-3", children: n.map((a, k) => /* @__PURE__ */ r(v, { variant: a.variant ?? "default", onClick: a.onClick, disabled: a.disabled === !0 || u === !0, children: [
|
|
39
|
-
a.icon !== void 0 ? /* @__PURE__ */ e(a.icon, { className: "size-4" }) : null,
|
|
40
|
-
i(a.label)
|
|
41
|
-
] }, k)) }) }) : null
|
|
42
|
-
] }) });
|
|
43
|
-
}
|
|
44
|
-
function ze({
|
|
45
|
-
open: t,
|
|
46
|
-
onOpenChange: d,
|
|
47
|
-
data: l,
|
|
48
|
-
title: u,
|
|
49
|
-
headerBadge: s,
|
|
50
|
-
schema: p,
|
|
51
|
-
onSave: i,
|
|
52
|
-
customFooter: b,
|
|
53
|
-
defaultEditing: c = !1,
|
|
54
|
-
footerActions: f = !0,
|
|
55
|
-
saveLabel: g = "Sauvegarder",
|
|
56
|
-
cancelLabel: n,
|
|
57
|
-
hideSaveIcon: a = !1,
|
|
58
|
-
maxWidth: k = "sm:max-w-4xl",
|
|
59
|
-
isLoading: h = !1
|
|
60
|
-
}) {
|
|
61
|
-
const { t: w } = R(), [x, N] = A(c), [o, z] = A(!1), [C, P] = A(null);
|
|
62
|
-
if (ie(() => {
|
|
63
|
-
t && N(c);
|
|
64
|
-
}, [t, c]), l == null) return null;
|
|
65
|
-
const E = () => {
|
|
66
|
-
x ? i !== void 0 && C && C() : N(!0);
|
|
67
|
-
}, y = () => {
|
|
68
|
-
N(!1);
|
|
69
|
-
}, F = () => {
|
|
70
|
-
i !== void 0 && C && C();
|
|
71
|
-
}, G = async (m) => {
|
|
72
|
-
if (i) {
|
|
73
|
-
z(!0);
|
|
74
|
-
try {
|
|
75
|
-
await i(m), N(!1);
|
|
76
|
-
} catch (B) {
|
|
77
|
-
console.error(B);
|
|
78
|
-
} finally {
|
|
79
|
-
z(!1);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
}, D = [];
|
|
83
|
-
i !== void 0 && (x ? (n !== "" && D.push({
|
|
84
|
-
label: n ?? w("actions.cancel"),
|
|
85
|
-
onClick: y,
|
|
86
|
-
variant: "outline",
|
|
87
|
-
disabled: o || h,
|
|
88
|
-
icon: S
|
|
89
|
-
}), D.push({
|
|
90
|
-
label: o ? "Enregistrement..." : g,
|
|
91
|
-
onClick: F,
|
|
92
|
-
variant: "default",
|
|
93
|
-
disabled: o || h,
|
|
94
|
-
icon: a ? void 0 : I
|
|
95
|
-
})) : D.push({
|
|
96
|
-
label: w("actions.edit"),
|
|
97
|
-
onClick: E,
|
|
98
|
-
variant: "outline",
|
|
99
|
-
icon: K
|
|
100
|
-
}));
|
|
101
|
-
const H = {
|
|
102
|
-
title: u(l),
|
|
103
|
-
maxWidth: k,
|
|
104
|
-
actions: f ? D : []
|
|
105
|
-
};
|
|
106
|
-
return /* @__PURE__ */ e(
|
|
107
|
-
te,
|
|
108
|
-
{
|
|
109
|
-
open: t,
|
|
110
|
-
onOpenChange: (m) => {
|
|
111
|
-
d(m), m || y();
|
|
112
|
-
},
|
|
113
|
-
config: H,
|
|
114
|
-
isLoading: o || h,
|
|
115
|
-
children: /* @__PURE__ */ r("div", { children: [
|
|
116
|
-
s !== void 0 ? /* @__PURE__ */ e("div", { className: "mb-4", children: s(l) }) : null,
|
|
117
|
-
/* @__PURE__ */ e(
|
|
118
|
-
re,
|
|
119
|
-
{
|
|
120
|
-
schema: p,
|
|
121
|
-
initialData: l,
|
|
122
|
-
disabled: !x,
|
|
123
|
-
onSubmit: (m) => {
|
|
124
|
-
G(m);
|
|
125
|
-
},
|
|
126
|
-
renderActions: !1,
|
|
127
|
-
onRegisterSubmit: (m) => {
|
|
128
|
-
P(() => m);
|
|
129
|
-
},
|
|
130
|
-
isLoading: o || h
|
|
131
|
-
}
|
|
132
|
-
),
|
|
133
|
-
b !== void 0 ? b(l) : null,
|
|
134
|
-
i !== void 0 && !f ? /* @__PURE__ */ e("div", { className: "flex justify-end gap-2 border-t pt-4 mt-6", children: x ? /* @__PURE__ */ r(M, { children: [
|
|
135
|
-
n !== "" ? /* @__PURE__ */ r(v, { onClick: y, variant: "outline", size: "sm", disabled: o || h, children: [
|
|
136
|
-
/* @__PURE__ */ e(S, { className: "size-4 mr-2" }),
|
|
137
|
-
n ?? w("actions.cancel")
|
|
138
|
-
] }) : null,
|
|
139
|
-
/* @__PURE__ */ r(v, { onClick: F, size: "sm", disabled: o || h, className: "text-white", children: [
|
|
140
|
-
a ? null : /* @__PURE__ */ e(I, { className: "size-4 mr-2" }),
|
|
141
|
-
o ? "Enregistrement..." : g
|
|
142
|
-
] })
|
|
143
|
-
] }) : /* @__PURE__ */ r(v, { onClick: E, variant: "outline", size: "sm", children: [
|
|
144
|
-
/* @__PURE__ */ e(K, { className: "size-4 mr-2" }),
|
|
145
|
-
"Modifier"
|
|
146
|
-
] }) }) : null
|
|
147
|
-
] })
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
function Ee({ isLoading: t, error: d, config: l, destructive: u = !1 }) {
|
|
152
|
-
const { t: s } = O();
|
|
153
|
-
if (!l) return null;
|
|
154
|
-
const p = (i) => {
|
|
155
|
-
!i && !t && l.onClose();
|
|
156
|
-
};
|
|
157
|
-
return /* @__PURE__ */ e(X, { open: l.isOpen, onOpenChange: p, children: /* @__PURE__ */ r($, { children: [
|
|
158
|
-
/* @__PURE__ */ r(j, { children: [
|
|
159
|
-
/* @__PURE__ */ r(q, { className: l.titleClassName, children: [
|
|
160
|
-
l.icon && /* @__PURE__ */ e(l.icon, { className: "size-4" }),
|
|
161
|
-
s(l.title)
|
|
162
|
-
] }),
|
|
163
|
-
l.headerClassName && /* @__PURE__ */ e(j, { className: l.headerClassName }),
|
|
164
|
-
/* @__PURE__ */ e(T, { children: s(l.description) }),
|
|
165
|
-
l.itemName && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e("span", { className: "font-semibold block my-2", children: l.itemName }) })
|
|
166
|
-
] }),
|
|
167
|
-
/* @__PURE__ */ e(se, { error: d instanceof Error ? null : d }),
|
|
168
|
-
/* @__PURE__ */ r(J, { children: [
|
|
169
|
-
/* @__PURE__ */ e(Q, { disabled: t, children: s("common.buttons.cancel") }),
|
|
170
|
-
/* @__PURE__ */ e(
|
|
171
|
-
v,
|
|
172
|
-
{
|
|
173
|
-
onClick: (i) => {
|
|
174
|
-
i.preventDefault(), l.onConfirm();
|
|
175
|
-
},
|
|
176
|
-
disabled: t,
|
|
177
|
-
className: u ? "bg-destructive text-destructive-foreground hover:bg-destructive/90" : "",
|
|
178
|
-
children: t ? s(l.loadingKey || "common.buttons.loading") : l.confirmKey
|
|
179
|
-
}
|
|
180
|
-
)
|
|
181
|
-
] })
|
|
182
|
-
] }) });
|
|
183
|
-
}
|
|
184
|
-
export {
|
|
185
|
-
te as A,
|
|
186
|
-
Ee as C,
|
|
187
|
-
ze as F
|
|
188
|
-
};
|