@krosoft/react 0.0.111 → 0.0.113
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-ouB1a_Wg.js → AppActions-po4LjUcM.js} +5 -5
- package/dist/{AppSubTitle-BU_yVwhx.js → AppSubTitle-CWrsJYFJ.js} +1 -1
- package/dist/{AppVerticalTabs-BLxthLeG.js → AppVerticalTabs-CdqoObXx.js} +4 -4
- package/dist/ConfirmationDialog-CkMyyh_3.js +221 -0
- package/dist/{DataTable-DUJgDKVR.js → DataTable-CUU_sTQd.js} +8 -8
- package/dist/{ErrorAlert-DYuVgrm3.js → ErrorAlert-C6BbHHRZ.js} +2 -2
- package/dist/ErrorState-vU8d4CwD.js +8 -0
- package/dist/{GenericForm-SLJH_-aT.js → GenericForm-CmwqEXiQ.js} +7 -7
- package/dist/{ImageInput-oz4cbfJY.js → ImageInput-C8HcxE8t.js} +5 -5
- package/dist/KpiCardsLayout-CETMpB7A.js +15 -0
- package/dist/LoadingState-PhGi7HXH.js +9 -0
- package/dist/MetricCard-C-ewNR_i.js +53 -0
- package/dist/{MultiSelect-DzbWINrY.js → MultiSelect-BoisW4Kn.js} +4 -4
- package/dist/{SearchInput-BcP8RQWX.js → SearchInput-DJ_F3emq.js} +5 -5
- package/dist/SkeletonCards-C5lXTSrB.js +57 -0
- package/dist/{TableFilter-Ax1CpXr1.js → TableFilter-DqDmlzhk.js} +8 -8
- package/dist/{ThemeSelector-C4W3_5jq.js → ThemeSelector--w3R6Ff3.js} +2 -2
- package/dist/{Topbar-CZ3OCeK_.js → Topbar-DFu_OdSs.js} +2 -2
- package/dist/{alert-BUwDmcbB.js → alert-B34E_4uH.js} +1 -1
- package/dist/{badge-AFnM0R9E.js → badge-CfWlt79h.js} +3 -3
- package/dist/components/core/cards/SkeletonCard.d.ts +3 -0
- package/dist/components/core/cards/SkeletonCard.d.ts.map +1 -0
- package/dist/components/core/cards/SkeletonCards.d.ts +7 -0
- package/dist/components/core/cards/SkeletonCards.d.ts.map +1 -0
- package/dist/components/core/cards/index.d.ts +2 -2
- package/dist/components/core/cards/index.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +8 -7
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts +6 -8
- package/dist/components/core/dialogs/ConfirmationDialog.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.d.ts +0 -1
- package/dist/components/core/dialogs/index.d.ts.map +1 -1
- package/dist/components/core/dialogs/index.js +13 -14
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +55 -52
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/KpiCardsLayout.d.ts +9 -0
- package/dist/components/core/layouts/KpiCardsLayout.d.ts.map +1 -0
- package/dist/components/core/layouts/index.d.ts +1 -0
- package/dist/components/core/layouts/index.d.ts.map +1 -1
- package/dist/components/core/layouts/index.js +8 -6
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +4 -3
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +171 -168
- package/dist/components/ui/index.js +6 -6
- package/dist/createLucideIcon-MP_wDWjs.js +116 -0
- package/dist/{ellipsis-vertical-CgqKXU8e.js → ellipsis-vertical-kB5yFb-i.js} +1 -1
- package/dist/{grip-vertical-J6s3ddpf.js → grip-vertical-DGywJXzS.js} +1 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts.map +1 -1
- package/dist/hooks/behavior/useConfirmationDialog.d.ts +11 -0
- package/dist/hooks/behavior/useConfirmationDialog.d.ts.map +1 -0
- package/dist/hooks/behavior/useDialog.d.ts +13 -0
- package/dist/hooks/behavior/useDialog.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +8 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +109 -68
- package/dist/index-Be16PP7H.js +34 -0
- package/dist/{loader-circle-Cfo0gDyD.js → loader-circle-CKy7u7JW.js} +1 -1
- package/dist/{select-pm9O5uLm.js → select-DlQvLtI3.js} +2 -2
- package/dist/{toaster-BUmC1xwM.js → toaster-CKoOjjKr.js} +3 -3
- package/dist/{toggle-group-B2LRm0C5.js → toggle-group-wIgXZYDq.js} +84 -83
- package/dist/{tooltip-6vdhKg8V.js → tooltip-YhBPXbcJ.js} +20 -19
- package/dist/types/ConfirmDialogConfig.d.ts +5 -0
- package/dist/types/ConfirmDialogConfig.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/ConfirmationDialog-Dkc0wBS8.js +0 -257
- package/dist/LoadingState-B4M2grXs.js +0 -13
- package/dist/MetricCard-Doy9TRGz.js +0 -103
- package/dist/components/core/cards/CardSkeleton.d.ts +0 -3
- package/dist/components/core/cards/CardSkeleton.d.ts.map +0 -1
- package/dist/components/core/cards/CardsSkeleton.d.ts +0 -7
- package/dist/components/core/cards/CardsSkeleton.d.ts.map +0 -1
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts +0 -10
- package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts.map +0 -1
- package/dist/index-71PtBtHf.js +0 -147
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
export { useConfirmationDialog } from "./behavior/useConfirmationDialog";
|
|
2
|
+
export { useConfirmDeleteDialog } from "./behavior/useConfirmDeleteDialog";
|
|
3
|
+
export { useDataTable } from "./ui/useDataTable";
|
|
4
|
+
export { useDialog } from "./behavior/useDialog";
|
|
5
|
+
export type { DialogState } from "./behavior/useDialog";
|
|
1
6
|
export { useMobile } from "./ui/useMobile";
|
|
2
7
|
export { useNotifications } from "./ui/useNotifications";
|
|
3
8
|
export type { UseNotificationsResult } from "./ui/useNotifications";
|
|
4
|
-
export {
|
|
9
|
+
export { useServerTable } from "./ui/useServerTable";
|
|
10
|
+
export type { UseServerTableResult } from "./ui/useServerTable";
|
|
5
11
|
export { useTheme } from "./ui/useTheme";
|
|
6
12
|
export type { ThemeOption } from "./ui/useTheme";
|
|
7
|
-
export {
|
|
8
|
-
export { useServerTable } from "./ui/useServerTable";
|
|
9
|
-
export { useConfirmDeleteDialog } from "./behavior/useConfirmDeleteDialog";
|
|
13
|
+
export { toast, useToast } from "./ui/useToast";
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,YAAY,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,80 +1,121 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
5
|
-
import { u as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, []);
|
|
1
|
+
import { useState as i, useEffect as M, useCallback as u } from "react";
|
|
2
|
+
import { c as k } from "../createLucideIcon-MP_wDWjs.js";
|
|
3
|
+
import { u as A } from "../useDataTable-CxcA5S-s.js";
|
|
4
|
+
import { u as K } from "../useMobile-DN1_OMDB.js";
|
|
5
|
+
import { u as R } from "../useNotifications-zbUhCvF_.js";
|
|
6
|
+
import { u as B } from "../useTheme-B0Bxda3I.js";
|
|
7
|
+
import { t as J, u as Q } from "../useToast-BFTk4lWz.js";
|
|
8
|
+
/**
|
|
9
|
+
* @license lucide-react v1.17.0 - ISC
|
|
10
|
+
*
|
|
11
|
+
* This source code is licensed under the ISC license.
|
|
12
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
+
*/
|
|
14
|
+
const z = [
|
|
15
|
+
["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
|
|
16
|
+
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
17
|
+
["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
|
|
18
|
+
], N = k("trash", z), v = (o) => {
|
|
19
|
+
const [t, e] = i(null), s = (n, l) => {
|
|
20
|
+
var c;
|
|
21
|
+
(c = o == null ? void 0 : o.onReset) == null || c.call(o), e({ id: n, name: l });
|
|
22
|
+
}, a = () => {
|
|
23
|
+
e(null);
|
|
24
|
+
};
|
|
26
25
|
return {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
sortDirection: S,
|
|
33
|
-
onSortChange: b,
|
|
34
|
-
searchText: i,
|
|
35
|
-
debouncedSearchText: d,
|
|
36
|
-
onSearchChange: p,
|
|
37
|
-
appliedFilters: x,
|
|
38
|
-
onFiltersChange: D
|
|
26
|
+
id: (t == null ? void 0 : t.id) ?? null,
|
|
27
|
+
name: (t == null ? void 0 : t.name) ?? null,
|
|
28
|
+
isOpen: !!t,
|
|
29
|
+
openDialog: s,
|
|
30
|
+
onClose: a
|
|
39
31
|
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
descriptionKey: h,
|
|
32
|
+
}, F = ({
|
|
33
|
+
titleKey: o,
|
|
34
|
+
descriptionKey: t,
|
|
44
35
|
confirmKey: e = "Confirmer",
|
|
45
|
-
onConfirm:
|
|
46
|
-
onReset:
|
|
36
|
+
onConfirm: s,
|
|
37
|
+
onReset: a
|
|
47
38
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
}, c = () => {
|
|
51
|
-
s(null);
|
|
52
|
-
}, S = async () => {
|
|
53
|
-
if (r)
|
|
39
|
+
const n = v({ onReset: a }), l = async () => {
|
|
40
|
+
if (n.id)
|
|
54
41
|
try {
|
|
55
|
-
await
|
|
56
|
-
} catch (
|
|
57
|
-
console.error("Error
|
|
42
|
+
await s(n.id), n.onClose();
|
|
43
|
+
} catch (c) {
|
|
44
|
+
console.error("Error confirming action:", c);
|
|
58
45
|
}
|
|
59
46
|
};
|
|
60
47
|
return {
|
|
61
|
-
isOpen:
|
|
62
|
-
itemName:
|
|
63
|
-
title:
|
|
64
|
-
description:
|
|
48
|
+
isOpen: n.isOpen,
|
|
49
|
+
itemName: n.name,
|
|
50
|
+
title: o,
|
|
51
|
+
description: t,
|
|
65
52
|
confirmKey: e,
|
|
66
|
-
openDialog:
|
|
67
|
-
onClose:
|
|
68
|
-
onConfirm:
|
|
53
|
+
openDialog: n.openDialog,
|
|
54
|
+
onClose: n.onClose,
|
|
55
|
+
onConfirm: l
|
|
69
56
|
};
|
|
70
|
-
}
|
|
57
|
+
}, w = ({
|
|
58
|
+
titleKey: o,
|
|
59
|
+
descriptionKey: t,
|
|
60
|
+
confirmKey: e = "Supprimer",
|
|
61
|
+
onConfirm: s,
|
|
62
|
+
onReset: a
|
|
63
|
+
}) => ({
|
|
64
|
+
...F({
|
|
65
|
+
titleKey: o,
|
|
66
|
+
descriptionKey: t,
|
|
67
|
+
confirmKey: e,
|
|
68
|
+
onConfirm: s,
|
|
69
|
+
onReset: a
|
|
70
|
+
}),
|
|
71
|
+
loadingKey: "Suppression...",
|
|
72
|
+
icon: N,
|
|
73
|
+
titleClassName: "flex items-center gap-2 text-destructive",
|
|
74
|
+
headerClassName: "bg-gradient-to-r from-slate-900 to-purple-700 rounded-t-lg shrink-0"
|
|
75
|
+
});
|
|
76
|
+
function E(o, t = "nom", e = {}) {
|
|
77
|
+
const [s, a] = i(e.initialPage ?? 1), [n, l] = i(e.initialPageSize ?? 10), [c, h] = i(t), [m, d] = i(e.initialSortDirection ?? "asc"), [g, C] = i(e.initialSearchText ?? ""), [f, S] = i(e.initialSearchText ?? ""), [x, D] = i(o);
|
|
78
|
+
M(() => {
|
|
79
|
+
const r = setTimeout(() => {
|
|
80
|
+
S(g);
|
|
81
|
+
}, e.debounceMs ?? 300);
|
|
82
|
+
return () => {
|
|
83
|
+
clearTimeout(r);
|
|
84
|
+
};
|
|
85
|
+
}, [g, e.debounceMs]);
|
|
86
|
+
const T = u((r) => {
|
|
87
|
+
C(r), a(1);
|
|
88
|
+
}, []), b = u((r) => {
|
|
89
|
+
D(r), a(1);
|
|
90
|
+
}, []), p = u((r, y) => {
|
|
91
|
+
h(r), d(y);
|
|
92
|
+
}, []), P = u((r) => {
|
|
93
|
+
l(r), a(1);
|
|
94
|
+
}, []);
|
|
95
|
+
return {
|
|
96
|
+
currentPage: s,
|
|
97
|
+
onPageChange: a,
|
|
98
|
+
pageSize: n,
|
|
99
|
+
onPageSizeChange: P,
|
|
100
|
+
sortColumn: c,
|
|
101
|
+
sortDirection: m,
|
|
102
|
+
onSortChange: p,
|
|
103
|
+
searchText: g,
|
|
104
|
+
debouncedSearchText: f,
|
|
105
|
+
onSearchChange: T,
|
|
106
|
+
appliedFilters: x,
|
|
107
|
+
onFiltersChange: b
|
|
108
|
+
};
|
|
109
|
+
}
|
|
71
110
|
export {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
111
|
+
J as toast,
|
|
112
|
+
w as useConfirmDeleteDialog,
|
|
113
|
+
F as useConfirmationDialog,
|
|
114
|
+
A as useDataTable,
|
|
115
|
+
v as useDialog,
|
|
116
|
+
K as useMobile,
|
|
117
|
+
R as useNotifications,
|
|
118
|
+
E as useServerTable,
|
|
119
|
+
B as useTheme,
|
|
120
|
+
Q as useToast
|
|
80
121
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { a as O } from "./tailwind.helper-gWiv5-6R.js";
|
|
2
|
+
const m = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, y = O, j = (e, l) => (n) => {
|
|
3
|
+
var u;
|
|
4
|
+
if ((l == null ? void 0 : l.variants) == null) return y(e, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
5
|
+
const { variants: r, defaultVariants: d } = l, V = Object.keys(r).map((t) => {
|
|
6
|
+
const a = n == null ? void 0 : n[t], s = d == null ? void 0 : d[t];
|
|
7
|
+
if (a === null) return null;
|
|
8
|
+
const i = m(a) || m(s);
|
|
9
|
+
return r[t][i];
|
|
10
|
+
}), v = n && Object.entries(n).reduce((t, a) => {
|
|
11
|
+
let [s, i] = a;
|
|
12
|
+
return i === void 0 || (t[s] = i), t;
|
|
13
|
+
}, {}), N = l == null || (u = l.compoundVariants) === null || u === void 0 ? void 0 : u.reduce((t, a) => {
|
|
14
|
+
let { class: s, className: i, ...f } = a;
|
|
15
|
+
return Object.entries(f).every((C) => {
|
|
16
|
+
let [c, o] = C;
|
|
17
|
+
return Array.isArray(o) ? o.includes({
|
|
18
|
+
...d,
|
|
19
|
+
...v
|
|
20
|
+
}[c]) : {
|
|
21
|
+
...d,
|
|
22
|
+
...v
|
|
23
|
+
}[c] === o;
|
|
24
|
+
}) ? [
|
|
25
|
+
...t,
|
|
26
|
+
s,
|
|
27
|
+
i
|
|
28
|
+
] : t;
|
|
29
|
+
}, []);
|
|
30
|
+
return y(e, V, N, n == null ? void 0 : n.class, n == null ? void 0 : n.className);
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
j as c
|
|
34
|
+
};
|
|
@@ -4,8 +4,8 @@ import * as a from "react";
|
|
|
4
4
|
import re, { useState as fn } from "react";
|
|
5
5
|
import * as ut from "react-dom";
|
|
6
6
|
import pn from "react-dom";
|
|
7
|
-
import { f as dt, g as ft, u as B, h as We, P as A, i as G, A as mn, j as M, k as Ye, l as pt, D as vn, m as hn, n as qe, R as gn, V as Sn, o as yn, C as mt } from "./tooltip-
|
|
8
|
-
import { c as Xe } from "./
|
|
7
|
+
import { f as dt, g as ft, u as B, h as We, P as A, i as G, A as mn, j as M, k as Ye, l as pt, D as vn, m as hn, n as qe, R as gn, V as Sn, o as yn, C as mt } from "./tooltip-YhBPXbcJ.js";
|
|
8
|
+
import { c as Xe } from "./createLucideIcon-MP_wDWjs.js";
|
|
9
9
|
// @__NO_SIDE_EFFECTS__
|
|
10
10
|
function Qe(e) {
|
|
11
11
|
const t = /* @__PURE__ */ wn(e), n = a.forwardRef((r, o) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as c from "react";
|
|
2
2
|
import "react-dom";
|
|
3
|
-
import { e as m } from "./tooltip-
|
|
3
|
+
import { e as m } from "./tooltip-YhBPXbcJ.js";
|
|
4
4
|
import { jsx as a, jsxs as l } from "react/jsx-runtime";
|
|
5
|
-
import { cf as g, cg as v, ch as b, ci as h, cj as w, ck as x, cl as T, c4 as y, c0 as N, c5 as R, c3 as C, c2 as $, c6 as P } from "./toggle-group-
|
|
5
|
+
import { cf as g, cg as v, ch as b, ci as h, cj as w, ck as x, cl as T, c4 as y, c0 as N, c5 as R, c3 as C, c2 as $, c6 as P } from "./toggle-group-wIgXZYDq.js";
|
|
6
6
|
import { c as n } from "./tailwind.helper-gWiv5-6R.js";
|
|
7
|
-
import { G as S } from "./grip-vertical-
|
|
7
|
+
import { G as S } from "./grip-vertical-DGywJXzS.js";
|
|
8
8
|
import { useTheme as j } from "next-themes";
|
|
9
9
|
import { u as A } from "./useToast-BFTk4lWz.js";
|
|
10
10
|
var z = [
|