@krosoft/react 0.0.312 → 0.0.314

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 (57) hide show
  1. package/dist/{AppActions-BSFD13aV.js → AppActions-D4phryLI.js} +2 -2
  2. package/dist/{AppSubTitle-CVNe5WHv.js → AppSubTitle-C4OXWXqx.js} +2 -2
  3. package/dist/{AppTitle-DIHE8uen.js → AppTitle-ky6qG29Z.js} +1 -1
  4. package/dist/{ErrorAlert-D8XnPN0I.js → ErrorAlert-ZflPwfL1.js} +1 -1
  5. package/dist/{GenericForm-Dcn4Xecn.js → GenericForm-B-HE6wx0.js} +6 -6
  6. package/dist/{ImageInput-BtV_Ezgp.js → ImageInput-pfEyse5s.js} +2 -2
  7. package/dist/{MultiSelect-DyHOoUsz.js → MultiSelect-BWpBLiI-.js} +3 -3
  8. package/dist/{SearchInput-KPozEk_s.js → SearchInput-TWh8dk0Q.js} +4 -4
  9. package/dist/behavior-DOkq-VaE.js +201 -0
  10. package/dist/{cards-pQZw-utJ.js → cards-9ND39VtI.js} +2 -2
  11. package/dist/{charts-Oxpbp_Ii.js → charts-Dqw9_J2o.js} +1 -1
  12. package/dist/components/core/cards/index.js +1 -1
  13. package/dist/components/core/charts/index.js +1 -1
  14. package/dist/components/core/dialogs/index.js +3 -3
  15. package/dist/components/core/filters/index.js +6 -6
  16. package/dist/components/core/forms/index.js +1 -1
  17. package/dist/components/core/index.js +18 -18
  18. package/dist/components/core/inputs/index.js +4 -4
  19. package/dist/components/core/language/index.js +1 -1
  20. package/dist/components/core/layouts/index.js +8 -8
  21. package/dist/components/core/navbar/GlobalSearch.d.ts +19 -1
  22. package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -1
  23. package/dist/components/core/navbar/index.js +1 -1
  24. package/dist/components/core/states/index.js +2 -2
  25. package/dist/components/core/table/index.js +2 -2
  26. package/dist/components/core/tabs/index.js +5 -5
  27. package/dist/components/core/theme/index.js +1 -1
  28. package/dist/components/index.js +18 -18
  29. package/dist/components/ui/index.js +2 -2
  30. package/dist/{dialogs-BLrrt68D.js → dialogs-DM3SIHMD.js} +5 -5
  31. package/dist/hooks/behavior/index.d.ts +2 -0
  32. package/dist/hooks/behavior/index.d.ts.map +1 -1
  33. package/dist/hooks/behavior/index.js +2 -2
  34. package/dist/hooks/behavior/useDebounce.d.ts +7 -0
  35. package/dist/hooks/behavior/useDebounce.d.ts.map +1 -0
  36. package/dist/hooks/behavior/useTable.d.ts +31 -0
  37. package/dist/hooks/behavior/useTable.d.ts.map +1 -0
  38. package/dist/hooks/index.js +6 -6
  39. package/dist/hooks/ui/index.js +4 -4
  40. package/dist/i18n/index.js +1 -1
  41. package/dist/i18n/krosoftLocales.d.ts +4 -0
  42. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  43. package/dist/{i18n-ClZK4zll.js → i18n-COxm2IKP.js} +6 -2
  44. package/dist/{inputs-c7vMvV76.js → inputs-BF_gkzmN.js} +3 -3
  45. package/dist/{language-VKGAsAfF.js → language-CX5k4uX5.js} +2 -2
  46. package/dist/{navbar-C4WWdADW.js → navbar-Ce8pq_3-.js} +88 -53
  47. package/dist/pwa/index.js +1 -1
  48. package/dist/{sheet-BjlRzLnc.js → sheet-B7qGvwk0.js} +1 -1
  49. package/dist/{states-C3v4BU7N.js → states-14gCg2Sl.js} +2 -2
  50. package/dist/{theme-Bkamu5J6.js → theme-BUl4fbtL.js} +2 -2
  51. package/dist/{ui-Bbn7hLKT.js → ui-B648tEnO.js} +3 -3
  52. package/dist/{ui-BwBUIl5y.js → ui-DjjBjKpZ.js} +1 -1
  53. package/dist/{useDocumentTitle-Ces2VRou.js → useDocumentTitle-wGdjZMx6.js} +1 -1
  54. package/dist/{useLanguage-c7lPQ7eh.js → useLanguage-JlBoVxev.js} +1 -1
  55. package/dist/{useTheme-CU6lGuO4.js → useTheme-DVDPwbQ2.js} +1 -1
  56. package/package.json +6 -1
  57. package/dist/behavior-2kM6-wgK.js +0 -116
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.312",
3
+ "version": "0.0.314",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -31,6 +31,7 @@
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@krosoft/core": ">=0.0.1",
34
+ "@tanstack/react-query": ">=5",
34
35
  "next-themes": ">=0.4.6",
35
36
  "react": ">=19.2.8",
36
37
  "react-i18next": ">=17.0.13",
@@ -38,6 +39,9 @@
38
39
  "vite-plugin-pwa": ">=1.3.0"
39
40
  },
40
41
  "peerDependenciesMeta": {
42
+ "@tanstack/react-query": {
43
+ "optional": true
44
+ },
41
45
  "next-themes": {
42
46
  "optional": true
43
47
  },
@@ -103,6 +107,7 @@
103
107
  "@storybook/addon-docs": "^10.6.0",
104
108
  "@storybook/addon-themes": "^10.6.0",
105
109
  "@storybook/react-vite": "^10.6.0",
110
+ "@tanstack/react-query": "^5.102.8",
106
111
  "@testing-library/dom": "^10.4.1",
107
112
  "@testing-library/react": "^16.3.3",
108
113
  "@types/node": "^25.9.5",
@@ -1,116 +0,0 @@
1
- import { t as e } from "./i18n-ClZK4zll.js";
2
- import { n as t, t as n } from "./sidebar.context-BahtU6hE.js";
3
- import * as r from "react";
4
- import { useCallback as i, useContext as a, useState as o } from "react";
5
- import { TrashIcon as s } from "lucide-react";
6
- import { format as c, parse as l } from "date-fns";
7
- import { useSearchParams as u } from "react-router-dom";
8
- //#region src/hooks/behavior/useDialog.ts
9
- var d = (e) => {
10
- let [t, n] = o(null);
11
- return {
12
- id: t?.id ?? null,
13
- name: t?.name ?? null,
14
- isOpen: !!t,
15
- openDialog: (t, r) => {
16
- e?.onReset?.(), n({
17
- id: t,
18
- name: r
19
- });
20
- },
21
- onClose: () => {
22
- n(null);
23
- }
24
- };
25
- }, f = ({ titleKey: e, descriptionKey: t, confirmKey: n = "Confirmer", onConfirm: r, onReset: i }) => {
26
- let a = d({ onReset: i });
27
- return {
28
- isOpen: a.isOpen,
29
- itemName: a.name,
30
- title: e,
31
- description: t,
32
- confirmKey: n,
33
- openDialog: a.openDialog,
34
- onClose: a.onClose,
35
- onConfirm: async () => {
36
- if (a.id) try {
37
- await r(a.id), a.onClose();
38
- } catch (e) {
39
- console.error("Error confirming action:", e);
40
- }
41
- }
42
- };
43
- }, p = ({ titleKey: t, descriptionKey: n, confirmKey: r, onConfirm: i, onReset: a }) => {
44
- let { t: o } = e();
45
- return {
46
- ...f({
47
- titleKey: t,
48
- descriptionKey: n,
49
- confirmKey: r ?? o("actions.delete"),
50
- onConfirm: i,
51
- onReset: a
52
- }),
53
- loadingKey: "actions.deleting",
54
- icon: s,
55
- titleClassName: "flex items-center gap-2 text-destructive"
56
- };
57
- }, m = (e, t = 250) => {
58
- let [n, i] = r.useState(e);
59
- return r.useEffect(() => {
60
- let n = setTimeout(() => {
61
- i(e);
62
- }, t);
63
- return () => {
64
- clearTimeout(n);
65
- };
66
- }, [e, t]), n;
67
- }, h = () => {
68
- let e = a(t);
69
- if (e === void 0) throw Error("usePage must be used within an PageProvider");
70
- return e;
71
- }, g = () => {
72
- let e = a(n);
73
- if (e === void 0) throw Error("useSidebar must be used within a SidebarProvider");
74
- return e;
75
- }, _ = "yyyy-MM-dd";
76
- function v(e, t, n, r) {
77
- let [a, o] = u(), s = a.get(e), c;
78
- c = s === null ? t : n ? n(s) : s;
79
- let l = i((n) => {
80
- o((i) => {
81
- let a = r ? r(n) : String(n);
82
- return a === (r ? r(t) : String(t)) || a === "" || a === "undefined" ? i.delete(e) : i.set(e, a), i;
83
- }, { replace: !0 });
84
- }, [
85
- e,
86
- t,
87
- r,
88
- o
89
- ]);
90
- return [c, l];
91
- }
92
- function y(e, t = []) {
93
- return v(e, t, (e) => e ? e.split(",").filter(Boolean) : [], (e) => e.join(","));
94
- }
95
- function b(e, t) {
96
- return v(e, t, (e) => parseInt(e, 10) || t, (e) => e.toString());
97
- }
98
- var x = (e) => {
99
- if (!e) return;
100
- let [t, n] = e.split("_"), r = t ? l(t, _, /* @__PURE__ */ new Date()) : void 0;
101
- if (!r || isNaN(r.getTime())) return;
102
- let i = n ? l(n, _, /* @__PURE__ */ new Date()) : void 0;
103
- return {
104
- from: r,
105
- to: i && !isNaN(i.getTime()) ? i : void 0
106
- };
107
- }, S = (e) => {
108
- if (!e?.from) return "";
109
- let t = c(e.from, _), n = e.to ? c(e.to, _) : "";
110
- return n ? `${t}_${n}` : t;
111
- };
112
- function C(e) {
113
- return v(e, void 0, x, S);
114
- }
115
- //#endregion
116
- export { C as a, g as c, p as d, f, y as i, h as l, x as n, b as o, d as p, S as r, v as s, _ as t, m as u };