@krosoft/react 0.0.108 → 0.0.110

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 (30) hide show
  1. package/dist/AppActions-BiBYy79y.js +70 -0
  2. package/dist/{AppSubTitle-nJN7ow2n.js → AppSubTitle-Cotab0k5.js} +1 -1
  3. package/dist/AppTitle-CDxWr_0y.js +13 -0
  4. package/dist/{AppVerticalTabs-CiEt1HNL.js → AppVerticalTabs-CtZx3n-i.js} +24 -23
  5. package/dist/{ConfirmationDialog-BaKpa7Kh.js → ConfirmationDialog-Be0Vj7qe.js} +2 -2
  6. package/dist/{DataTable-DJhEJnCx.js → DataTable-DVtbFX-O.js} +1 -1
  7. package/dist/{GenericForm-CbGEgpM5.js → GenericForm-CbgkBEAm.js} +2721 -2676
  8. package/dist/{ImageInput-BQfqqD1_.js → ImageInput-BOnsST3X.js} +1 -1
  9. package/dist/{MetricCard-DZ3tGlwK.js → MetricCard-BUeI3lGg.js} +1 -1
  10. package/dist/{MultiSelect-CHd9JoTu.js → MultiSelect-C_rUb130.js} +1 -1
  11. package/dist/{SearchInput-z_DqWBMS.js → SearchInput-DJiMuyA5.js} +1 -1
  12. package/dist/{TableFilter-BxAODfG3.js → TableFilter-BnWrOAr7.js} +3 -3
  13. package/dist/components/core/cards/index.js +1 -1
  14. package/dist/components/core/dialogs/index.js +2 -2
  15. package/dist/components/core/filters/index.js +1 -1
  16. package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
  17. package/dist/components/core/forms/index.js +1 -1
  18. package/dist/components/core/index.js +44 -43
  19. package/dist/components/core/inputs/index.js +3 -3
  20. package/dist/components/core/layouts/index.js +5 -4
  21. package/dist/components/core/table/index.js +1 -1
  22. package/dist/components/core/tabs/index.js +1 -1
  23. package/dist/components/index.js +73 -72
  24. package/dist/components/ui/form.d.ts +1 -1
  25. package/dist/components/ui/form.d.ts.map +1 -1
  26. package/dist/components/ui/index.js +2 -2
  27. package/dist/{toaster-teGHWKGd.js → toaster-BTTmMS-Z.js} +1 -1
  28. package/dist/{toggle-group-pUKi3MM1.js → toggle-group-DKORC9Wq.js} +5339 -5319
  29. package/package.json +5 -5
  30. package/dist/AppTitle-BtJEQPkF.js +0 -78
@@ -0,0 +1,70 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import { ax as p, aL as b, az as c, aG as g, aB as o } from "./toggle-group-DKORC9Wq.js";
3
+ import "./alert-BUwDmcbB.js";
4
+ import { c as i } from "./tailwind.helper-gWiv5-6R.js";
5
+ import { B as u } from "./tooltip-6vdhKg8V.js";
6
+ import "./select-pm9O5uLm.js";
7
+ import "next-themes";
8
+ import "react";
9
+ import { u as h } from "./useMobile-DN1_OMDB.js";
10
+ import { useTranslation as v } from "react-i18next";
11
+ import { E as C } from "./ellipsis-vertical-CgqKXU8e.js";
12
+ function T({ actions: d, className: t }) {
13
+ const { t: m } = v(), N = h();
14
+ return !d || d.length === 0 ? null : N ? /* @__PURE__ */ n(p, { children: [
15
+ /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ l(u, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(C, { className: "size-4" }) }) }),
16
+ /* @__PURE__ */ l(c, { align: "end", className: "min-w-48", children: d.map((r, e) => r ? r.children && r.children.length > 0 ? /* @__PURE__ */ n("div", { children: [
17
+ e > 0 && /* @__PURE__ */ l(g, {}),
18
+ r.children.map((s, a) => s ? /* @__PURE__ */ n(
19
+ o,
20
+ {
21
+ onClick: () => void s.onClick(),
22
+ disabled: s.disabled,
23
+ className: i("gap-2", s.className),
24
+ children: [
25
+ s.icon && /* @__PURE__ */ l(s.icon, { className: "size-4" }),
26
+ s.labelKey && m(s.labelKey)
27
+ ]
28
+ },
29
+ a
30
+ ) : null)
31
+ ] }, e) : /* @__PURE__ */ n(o, { onClick: () => void r.onClick(), disabled: r.disabled, className: i("gap-2", r.className), children: [
32
+ r.icon && /* @__PURE__ */ l(r.icon, { className: "size-4" }),
33
+ r.labelKey && m(r.labelKey)
34
+ ] }, e) : null) })
35
+ ] }) : ((r) => /* @__PURE__ */ l("div", { className: i("flex gap-2", t), children: r.map((e, s) => e ? e.children && e.children.length > 0 ? /* @__PURE__ */ n(p, { children: [
36
+ /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ n(u, { variant: e.variant, disabled: e.disabled, className: i("gap-2", e.className), children: [
37
+ e.icon && /* @__PURE__ */ l(e.icon, { className: "size-4" }),
38
+ e.labelKey && m(e.labelKey)
39
+ ] }) }),
40
+ /* @__PURE__ */ l(c, { align: "end", children: e.children.map((a, f) => a ? /* @__PURE__ */ n(
41
+ o,
42
+ {
43
+ onClick: () => void a.onClick(),
44
+ disabled: a.disabled,
45
+ className: i("gap-2", a.className),
46
+ children: [
47
+ a.icon && /* @__PURE__ */ l(a.icon, { className: "size-4" }),
48
+ a.labelKey && m(a.labelKey)
49
+ ]
50
+ },
51
+ f
52
+ ) : null) })
53
+ ] }, s) : /* @__PURE__ */ n(
54
+ u,
55
+ {
56
+ variant: e.variant,
57
+ onClick: () => void e.onClick(),
58
+ disabled: e.disabled,
59
+ className: i("gap-2", e.className),
60
+ children: [
61
+ e.icon && /* @__PURE__ */ l(e.icon, { className: "size-4" }),
62
+ e.labelKey && m(e.labelKey)
63
+ ]
64
+ },
65
+ s
66
+ ) : null) }))(d);
67
+ }
68
+ export {
69
+ T as A
70
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { useTranslation as l } from "react-i18next";
3
- import { A as m } from "./AppTitle-BtJEQPkF.js";
3
+ import { A as m } from "./AppActions-BiBYy79y.js";
4
4
  function f({ titleKey: s, actions: t, className: o }) {
5
5
  const { t: r } = l();
6
6
  return /* @__PURE__ */ i("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
@@ -0,0 +1,13 @@
1
+ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
+ import { c as r } from "./tailwind.helper-gWiv5-6R.js";
3
+ import { useTranslation as s } from "react-i18next";
4
+ function d({ titleKey: x, descriptionKey: t, isSubTitle: e }) {
5
+ const { t: l } = s();
6
+ return /* @__PURE__ */ m("div", { className: "flex flex-col gap-1", children: [
7
+ /* @__PURE__ */ o("h1", { className: e ? "text-xl md:text-2xl font-semibold" : "text-xl md:text-3xl font-bold", children: l(x) ?? "" }),
8
+ t ? /* @__PURE__ */ o("p", { className: r("text-muted-foreground", e && "text-sm"), children: l(t) }) : null
9
+ ] });
10
+ }
11
+ export {
12
+ d as A
13
+ };
@@ -1,6 +1,7 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { I as v, M as g, J as y, bX as N, bZ as w, b_ as b, bY as T, bA as S } from "./toggle-group-pUKi3MM1.js";
3
- import { a as C, A as k } from "./AppTitle-BtJEQPkF.js";
2
+ import { I as v, M as g, J as y, bX as N, bZ as w, b_ as b, bY as T, bA as S } from "./toggle-group-DKORC9Wq.js";
3
+ import { A as C } from "./AppActions-BiBYy79y.js";
4
+ import { A as k } from "./AppTitle-CDxWr_0y.js";
4
5
  import { useTranslation as x } from "react-i18next";
5
6
  import { useSearchParams as f } from "react-router-dom";
6
7
  import { c as A } from "./tailwind.helper-gWiv5-6R.js";
@@ -22,40 +23,40 @@ const I = [
22
23
  ["path", { d: "m14 6 7.7 7.7", key: "1s8pl2" }],
23
24
  ["path", { d: "m8 6 8 8", key: "hl96qh" }]
24
25
  ], p = V("construction", I);
25
- function K({ titleKey: s, descriptionKey: l, actions: c = [], className: t }) {
26
+ function K({ titleKey: s, descriptionKey: l, actions: t = [], className: c }) {
26
27
  return /* @__PURE__ */ n("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
27
- /* @__PURE__ */ a(C, { titleKey: s, descriptionKey: l, isSubTitle: !0 }),
28
- /* @__PURE__ */ a(k, { actions: c, className: t })
28
+ /* @__PURE__ */ a(k, { titleKey: s, descriptionKey: l, isSubTitle: !0 }),
29
+ /* @__PURE__ */ a(C, { actions: t, className: c })
29
30
  ] });
30
31
  }
31
- function Y({ titleKey: s, descriptionKey: l, actions: c = [], className: t, children: o, isSubTitle: i }) {
32
+ function Z({ titleKey: s, descriptionKey: l, actions: t = [], className: c, children: o, isSubTitle: i }) {
32
33
  return /* @__PURE__ */ n(v, { children: [
33
- /* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(K, { titleKey: s, descriptionKey: l, actions: c, className: t }) }),
34
+ /* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(K, { titleKey: s, descriptionKey: l, actions: t, className: c }) }),
34
35
  /* @__PURE__ */ a(y, { className: "space-y-4", children: o })
35
36
  ] });
36
37
  }
37
- function Z({ tabs: s, itemId: l, item: c, fit: t }) {
38
- var d;
39
- const { t: o } = x(), [i, m] = f(), h = i.get("tab") || ((d = s[0]) == null ? void 0 : d.value);
38
+ function $({ tabs: s, itemId: l, item: t, fit: c }) {
39
+ var m;
40
+ const { t: o } = x(), [i, d] = f(), h = i.get("tab") || ((m = s[0]) == null ? void 0 : m.value);
40
41
  return /* @__PURE__ */ n(N, { value: h, onValueChange: (e) => {
41
42
  const r = new URLSearchParams();
42
- r.set("tab", e), m(r);
43
+ r.set("tab", e), d(r);
43
44
  }, children: [
44
- /* @__PURE__ */ a(w, { className: A("w-full justify-start", t && "sm:w-fit"), children: s.map((e) => /* @__PURE__ */ n(b, { value: e.value, className: "gap-2", disabled: e.disabled, children: [
45
+ /* @__PURE__ */ a(w, { className: A("w-full justify-start", c && "sm:w-fit"), children: s.map((e) => /* @__PURE__ */ n(b, { value: e.value, className: "gap-2", disabled: e.disabled, children: [
45
46
  e.icon ? /* @__PURE__ */ a("span", { className: "hidden sm:inline", children: /* @__PURE__ */ a(e.icon, { className: "size-4" }) }) : null,
46
47
  /* @__PURE__ */ a("span", { className: "text-xs sm:text-sm", children: o(e.titleKey) ?? "" }),
47
48
  e.count ? /* @__PURE__ */ n("span", { className: "text-gray-500 text-xs", children: [
48
49
  "(",
49
- e.count(c),
50
+ e.count(t),
50
51
  ")"
51
52
  ] }) : null
52
53
  ] }, e.value)) }),
53
54
  s.map((e) => /* @__PURE__ */ a(T, { value: e.value, className: "mt-4", children: e.component ? e.component(l) : null }, e.value))
54
55
  ] });
55
56
  }
56
- const $ = ({ tabs: s, item: l }) => {
57
- var d;
58
- const { t: c } = x(), [t, o] = f(), i = t.get("tab") || ((d = s[0]) == null ? void 0 : d.value), m = (e) => {
57
+ const B = ({ tabs: s, item: l }) => {
58
+ var m;
59
+ const { t } = x(), [c, o] = f(), i = c.get("tab") || ((m = s[0]) == null ? void 0 : m.value), d = (e) => {
59
60
  const r = new URLSearchParams();
60
61
  r.set("tab", e), o(r);
61
62
  }, h = () => {
@@ -71,10 +72,10 @@ const $ = ({ tabs: s, item: l }) => {
71
72
  "div",
72
73
  {
73
74
  className: `px-2 py-2 rounded-2xl text-sm transition-colors flex items-center gap-2 ${e.disabled ? "text-gray-400 cursor-not-allowed opacity-50" : i === e.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"}`,
74
- onClick: () => !e.disabled && m(e.value),
75
+ onClick: () => !e.disabled && d(e.value),
75
76
  children: [
76
77
  e.icon && /* @__PURE__ */ a(e.icon, { className: "size-4" }),
77
- /* @__PURE__ */ a("span", { className: "flex-1", children: c(e.titleKey) }),
78
+ /* @__PURE__ */ a("span", { className: "flex-1", children: t(e.titleKey) }),
78
79
  e.count && /* @__PURE__ */ n("span", { className: "text-xs text-gray-500", children: [
79
80
  "(",
80
81
  e.count(l),
@@ -85,11 +86,11 @@ const $ = ({ tabs: s, item: l }) => {
85
86
  },
86
87
  r
87
88
  )) }) }) }),
88
- /* @__PURE__ */ a("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ n(P, { value: i, onValueChange: m, children: [
89
+ /* @__PURE__ */ a("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ n(P, { value: i, onValueChange: d, children: [
89
90
  /* @__PURE__ */ a(j, { className: "w-full", children: /* @__PURE__ */ a(M, { placeholder: "Sélectionner une section" }) }),
90
91
  /* @__PURE__ */ a(z, { children: s.map((e, r) => /* @__PURE__ */ a(L, { value: e.value, disabled: e.disabled, children: /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: [
91
92
  e.icon && /* @__PURE__ */ a(e.icon, { className: "size-4" }),
92
- /* @__PURE__ */ a("span", { children: c(e.titleKey) }),
93
+ /* @__PURE__ */ a("span", { children: t(e.titleKey) }),
93
94
  e.count && /* @__PURE__ */ n("span", { className: "text-xs text-gray-500", children: [
94
95
  "(",
95
96
  e.count(l),
@@ -102,8 +103,8 @@ const $ = ({ tabs: s, item: l }) => {
102
103
  ] });
103
104
  };
104
105
  export {
105
- Y as A,
106
+ Z as A,
106
107
  K as a,
107
- Z as b,
108
- $ as c
108
+ $ as b,
109
+ B as c
109
110
  };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as l, Fragment as W } from "react/jsx-runtime";
2
- import { D as X, b as J, P as K, e as Q, h as U, c as Y, m as H, p as V, s as z, t as $, q as M, r as I, o as O, u as Z, n as L } from "./toggle-group-pUKi3MM1.js";
2
+ import { D as X, b as J, P as K, e as Q, h as U, c as Y, m as H, p as V, s as z, t as $, q as M, r as I, o as O, u as Z, n as L } from "./toggle-group-DKORC9Wq.js";
3
3
  import { A as ee, a as le } from "./alert-BUwDmcbB.js";
4
4
  import { B as g } from "./tooltip-6vdhKg8V.js";
5
5
  import { X as j } from "./select-pm9O5uLm.js";
@@ -7,7 +7,7 @@ import "next-themes";
7
7
  import { useState as w, useEffect as ie } from "react";
8
8
  import { useTranslation as P } from "react-i18next";
9
9
  import { c as C } from "./index-71PtBtHf.js";
10
- import { G as re } from "./GenericForm-CbGEgpM5.js";
10
+ import { G as re } from "./GenericForm-CbgkBEAm.js";
11
11
  import { E as ae } from "./ErrorAlert-DYuVgrm3.js";
12
12
  /**
13
13
  * @license lucide-react v1.17.0 - ISC
@@ -1,6 +1,6 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
2
  import { u as ae } from "./useDataTable-CxcA5S-s.js";
3
- import { ax as I, aL as $, az as B, aB as se, _ as L, cr as ie, cs as ne, ay as de } from "./toggle-group-pUKi3MM1.js";
3
+ import { ax as I, aL as $, az as B, aB as se, _ as L, cr as ie, cs as ne, ay as de } from "./toggle-group-DKORC9Wq.js";
4
4
  import "./alert-BUwDmcbB.js";
5
5
  import { B as k } from "./tooltip-6vdhKg8V.js";
6
6
  import "./select-pm9O5uLm.js";