@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.
Files changed (80) hide show
  1. package/dist/{AppActions-ouB1a_Wg.js → AppActions-po4LjUcM.js} +5 -5
  2. package/dist/{AppSubTitle-BU_yVwhx.js → AppSubTitle-CWrsJYFJ.js} +1 -1
  3. package/dist/{AppVerticalTabs-BLxthLeG.js → AppVerticalTabs-CdqoObXx.js} +4 -4
  4. package/dist/ConfirmationDialog-CkMyyh_3.js +221 -0
  5. package/dist/{DataTable-DUJgDKVR.js → DataTable-CUU_sTQd.js} +8 -8
  6. package/dist/{ErrorAlert-DYuVgrm3.js → ErrorAlert-C6BbHHRZ.js} +2 -2
  7. package/dist/ErrorState-vU8d4CwD.js +8 -0
  8. package/dist/{GenericForm-SLJH_-aT.js → GenericForm-CmwqEXiQ.js} +7 -7
  9. package/dist/{ImageInput-oz4cbfJY.js → ImageInput-C8HcxE8t.js} +5 -5
  10. package/dist/KpiCardsLayout-CETMpB7A.js +15 -0
  11. package/dist/LoadingState-PhGi7HXH.js +9 -0
  12. package/dist/MetricCard-C-ewNR_i.js +53 -0
  13. package/dist/{MultiSelect-DzbWINrY.js → MultiSelect-BoisW4Kn.js} +4 -4
  14. package/dist/{SearchInput-BcP8RQWX.js → SearchInput-DJ_F3emq.js} +5 -5
  15. package/dist/SkeletonCards-C5lXTSrB.js +57 -0
  16. package/dist/{TableFilter-Ax1CpXr1.js → TableFilter-DqDmlzhk.js} +8 -8
  17. package/dist/{ThemeSelector-C4W3_5jq.js → ThemeSelector--w3R6Ff3.js} +2 -2
  18. package/dist/{Topbar-CZ3OCeK_.js → Topbar-DFu_OdSs.js} +2 -2
  19. package/dist/{alert-BUwDmcbB.js → alert-B34E_4uH.js} +1 -1
  20. package/dist/{badge-AFnM0R9E.js → badge-CfWlt79h.js} +3 -3
  21. package/dist/components/core/cards/SkeletonCard.d.ts +3 -0
  22. package/dist/components/core/cards/SkeletonCard.d.ts.map +1 -0
  23. package/dist/components/core/cards/SkeletonCards.d.ts +7 -0
  24. package/dist/components/core/cards/SkeletonCards.d.ts.map +1 -0
  25. package/dist/components/core/cards/index.d.ts +2 -2
  26. package/dist/components/core/cards/index.d.ts.map +1 -1
  27. package/dist/components/core/cards/index.js +8 -7
  28. package/dist/components/core/dialogs/ConfirmationDialog.d.ts +6 -8
  29. package/dist/components/core/dialogs/ConfirmationDialog.d.ts.map +1 -1
  30. package/dist/components/core/dialogs/index.d.ts +0 -1
  31. package/dist/components/core/dialogs/index.d.ts.map +1 -1
  32. package/dist/components/core/dialogs/index.js +13 -14
  33. package/dist/components/core/filters/index.js +1 -1
  34. package/dist/components/core/forms/index.js +1 -1
  35. package/dist/components/core/index.js +55 -52
  36. package/dist/components/core/inputs/index.js +3 -3
  37. package/dist/components/core/layouts/KpiCardsLayout.d.ts +9 -0
  38. package/dist/components/core/layouts/KpiCardsLayout.d.ts.map +1 -0
  39. package/dist/components/core/layouts/index.d.ts +1 -0
  40. package/dist/components/core/layouts/index.d.ts.map +1 -1
  41. package/dist/components/core/layouts/index.js +8 -6
  42. package/dist/components/core/navbar/index.js +1 -1
  43. package/dist/components/core/states/index.js +4 -3
  44. package/dist/components/core/table/index.js +1 -1
  45. package/dist/components/core/tabs/index.js +1 -1
  46. package/dist/components/core/theme/index.js +1 -1
  47. package/dist/components/index.js +171 -168
  48. package/dist/components/ui/index.js +6 -6
  49. package/dist/createLucideIcon-MP_wDWjs.js +116 -0
  50. package/dist/{ellipsis-vertical-CgqKXU8e.js → ellipsis-vertical-kB5yFb-i.js} +1 -1
  51. package/dist/{grip-vertical-J6s3ddpf.js → grip-vertical-DGywJXzS.js} +1 -1
  52. package/dist/hooks/behavior/useConfirmDeleteDialog.d.ts.map +1 -1
  53. package/dist/hooks/behavior/useConfirmationDialog.d.ts +11 -0
  54. package/dist/hooks/behavior/useConfirmationDialog.d.ts.map +1 -0
  55. package/dist/hooks/behavior/useDialog.d.ts +13 -0
  56. package/dist/hooks/behavior/useDialog.d.ts.map +1 -0
  57. package/dist/hooks/index.d.ts +8 -4
  58. package/dist/hooks/index.d.ts.map +1 -1
  59. package/dist/hooks/index.js +109 -68
  60. package/dist/index-Be16PP7H.js +34 -0
  61. package/dist/{loader-circle-Cfo0gDyD.js → loader-circle-CKy7u7JW.js} +1 -1
  62. package/dist/{select-pm9O5uLm.js → select-DlQvLtI3.js} +2 -2
  63. package/dist/{toaster-BUmC1xwM.js → toaster-CKoOjjKr.js} +3 -3
  64. package/dist/{toggle-group-B2LRm0C5.js → toggle-group-wIgXZYDq.js} +84 -83
  65. package/dist/{tooltip-6vdhKg8V.js → tooltip-YhBPXbcJ.js} +20 -19
  66. package/dist/types/ConfirmDialogConfig.d.ts +5 -0
  67. package/dist/types/ConfirmDialogConfig.d.ts.map +1 -1
  68. package/dist/types/index.d.ts +1 -0
  69. package/dist/types/index.d.ts.map +1 -1
  70. package/package.json +1 -1
  71. package/dist/ConfirmationDialog-Dkc0wBS8.js +0 -257
  72. package/dist/LoadingState-B4M2grXs.js +0 -13
  73. package/dist/MetricCard-Doy9TRGz.js +0 -103
  74. package/dist/components/core/cards/CardSkeleton.d.ts +0 -3
  75. package/dist/components/core/cards/CardSkeleton.d.ts.map +0 -1
  76. package/dist/components/core/cards/CardsSkeleton.d.ts +0 -7
  77. package/dist/components/core/cards/CardsSkeleton.d.ts.map +0 -1
  78. package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts +0 -10
  79. package/dist/components/core/dialogs/ConfirmDeleteDialog.d.ts.map +0 -1
  80. package/dist/index-71PtBtHf.js +0 -147
@@ -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 { useToast, toast } from "./ui/useToast";
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 { useDataTable } from "./ui/useDataTable";
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,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC"}
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"}
@@ -1,80 +1,121 @@
1
- import { u as v } from "../useMobile-DN1_OMDB.js";
2
- import { u as A } from "../useNotifications-zbUhCvF_.js";
3
- import { t as j, u as q } from "../useToast-BFTk4lWz.js";
4
- import { u as G } from "../useTheme-B0Bxda3I.js";
5
- import { u as I } from "../useDataTable-CxcA5S-s.js";
6
- import { useState as a, useEffect as F, useCallback as l } from "react";
7
- function y(u, h = "nom", e = {}) {
8
- const [g, n] = a(e.initialPage ?? 1), [r, s] = a(e.initialPageSize ?? 10), [m, c] = a(h), [S, o] = a(e.initialSortDirection ?? "asc"), [i, C] = a(e.initialSearchText ?? ""), [d, f] = a(e.initialSearchText ?? ""), [x, T] = a(u);
9
- F(() => {
10
- const t = setTimeout(() => {
11
- f(i);
12
- }, e.debounceMs ?? 300);
13
- return () => {
14
- clearTimeout(t);
15
- };
16
- }, [i, e.debounceMs]);
17
- const p = l((t) => {
18
- C(t), n(1);
19
- }, []), D = l((t) => {
20
- T(t), n(1);
21
- }, []), b = l((t, z) => {
22
- c(t), o(z);
23
- }, []), P = l((t) => {
24
- s(t), n(1);
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
- currentPage: g,
28
- onPageChange: n,
29
- pageSize: r,
30
- onPageSizeChange: P,
31
- sortColumn: m,
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
- const E = ({
42
- titleKey: u,
43
- descriptionKey: h,
32
+ }, F = ({
33
+ titleKey: o,
34
+ descriptionKey: t,
44
35
  confirmKey: e = "Confirmer",
45
- onConfirm: g,
46
- onReset: n
36
+ onConfirm: s,
37
+ onReset: a
47
38
  }) => {
48
- const [r, s] = a(null), m = (o, i) => {
49
- n == null || n(), s({ id: o, name: i });
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 g(r.id), c();
56
- } catch (o) {
57
- console.error("Error deleting item:", o);
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: !!r,
62
- itemName: (r == null ? void 0 : r.name) ?? null,
63
- title: u,
64
- description: h,
48
+ isOpen: n.isOpen,
49
+ itemName: n.name,
50
+ title: o,
51
+ description: t,
65
52
  confirmKey: e,
66
- openDialog: m,
67
- onClose: c,
68
- onConfirm: S
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
- j as toast,
73
- E as useConfirmDeleteDialog,
74
- I as useDataTable,
75
- v as useMobile,
76
- A as useNotifications,
77
- y as useServerTable,
78
- G as useTheme,
79
- q as useToast
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
+ };
@@ -1,4 +1,4 @@
1
- import { c } from "./index-71PtBtHf.js";
1
+ import { c } from "./createLucideIcon-MP_wDWjs.js";
2
2
  /**
3
3
  * @license lucide-react v1.17.0 - ISC
4
4
  *
@@ -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-6vdhKg8V.js";
8
- import { c as Xe } from "./index-71PtBtHf.js";
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-6vdhKg8V.js";
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-B2LRm0C5.js";
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-J6s3ddpf.js";
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 = [