@krosoft/react 0.0.261 → 0.0.263

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 (106) hide show
  1. package/dist/AppActions-D8KKXpq-.js +60 -0
  2. package/dist/{AppSubTitle-C8zoMJo_.js → AppSubTitle-CVhjWRBp.js} +7 -7
  3. package/dist/{AppTitle-BR4JFZfp.js → AppTitle-DBGJRsjU.js} +6 -6
  4. package/dist/{ErrorAlert-DClCk3Ey.js → ErrorAlert-6ECy_Dox.js} +5 -5
  5. package/dist/{GenericForm-JqObtUCQ.js → GenericForm-C86_Jk7X.js} +104 -105
  6. package/dist/{ImageInput-BLIo5LYH.js → ImageInput-DvHgBYsy.js} +5 -5
  7. package/dist/{MultiSelect-B0Ke0cfS.js → MultiSelect-TGu_k3KM.js} +7 -7
  8. package/dist/{SearchInput-CXZd2rSc.js → SearchInput-Csflv8Az.js} +31 -31
  9. package/dist/{behavior-DDtrNBAq.js → behavior-C4WdfbR1.js} +1 -1
  10. package/dist/{cards-Ct4wFYa8.js → cards-nqZOcSkh.js} +42 -42
  11. package/dist/{charts-CwT9AFWj.js → charts-BfeSrTmX.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/ActiveFilters.d.ts +2 -2
  16. package/dist/components/core/filters/ActiveFilters.d.ts.map +1 -1
  17. package/dist/components/core/filters/SearchableFilterPill.d.ts +2 -2
  18. package/dist/components/core/filters/SearchableFilterPill.d.ts.map +1 -1
  19. package/dist/components/core/filters/TableFilter.d.ts.map +1 -1
  20. package/dist/components/core/filters/index.js +127 -127
  21. package/dist/components/core/forms/GenericForm.d.ts.map +1 -1
  22. package/dist/components/core/forms/index.js +1 -1
  23. package/dist/components/core/index.js +19 -19
  24. package/dist/components/core/inputs/index.js +4 -4
  25. package/dist/components/core/language/index.js +1 -1
  26. package/dist/components/core/layouts/index.js +26 -26
  27. package/dist/components/core/navbar/NotificationsBell.d.ts +8 -2
  28. package/dist/components/core/navbar/NotificationsBell.d.ts.map +1 -1
  29. package/dist/components/core/navbar/index.js +1 -1
  30. package/dist/components/core/states/index.js +2 -2
  31. package/dist/components/core/table/DataTable.d.ts +4 -19
  32. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  33. package/dist/components/core/table/TableActions.d.ts +2 -2
  34. package/dist/components/core/table/TableActions.d.ts.map +1 -1
  35. package/dist/components/core/table/TableBody.d.ts +6 -6
  36. package/dist/components/core/table/TableBody.d.ts.map +1 -1
  37. package/dist/components/core/table/TableBulkActions.d.ts +2 -2
  38. package/dist/components/core/table/TableBulkActions.d.ts.map +1 -1
  39. package/dist/components/core/table/TableHeader.d.ts +2 -2
  40. package/dist/components/core/table/TableHeader.d.ts.map +1 -1
  41. package/dist/components/core/table/TablePagination.d.ts.map +1 -1
  42. package/dist/components/core/table/TableSettings.d.ts +2 -2
  43. package/dist/components/core/table/TableSettings.d.ts.map +1 -1
  44. package/dist/components/core/table/index.js +1 -1
  45. package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -1
  46. package/dist/components/core/tabs/index.js +39 -40
  47. package/dist/components/core/theme/index.js +1 -1
  48. package/dist/components/index.js +19 -19
  49. package/dist/components/ui/index.js +2 -2
  50. package/dist/constants/datatable.d.ts +1 -1
  51. package/dist/dialogs-BiPcEbRx.js +207 -0
  52. package/dist/helpers/table.helper.d.ts +4 -4
  53. package/dist/helpers/table.helper.d.ts.map +1 -1
  54. package/dist/hooks/behavior/index.js +1 -1
  55. package/dist/hooks/index.js +6 -6
  56. package/dist/hooks/ui/index.js +5 -5
  57. package/dist/hooks/ui/useDataTable.d.ts +1 -1
  58. package/dist/hooks/ui/useDataTable.d.ts.map +1 -1
  59. package/dist/i18n/index.js +1 -1
  60. package/dist/i18n/krosoftLocales.d.ts +22 -0
  61. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  62. package/dist/i18n/useKrosoftTranslation.d.ts +9 -6
  63. package/dist/i18n/useKrosoftTranslation.d.ts.map +1 -1
  64. package/dist/{i18n-DW5zKBEK.js → i18n-CevI9Cgk.js} +35 -13
  65. package/dist/{inputs-CNDApo_M.js → inputs-BUXmTc40.js} +3 -3
  66. package/dist/{language-CK_kDejF.js → language-DeQC57bX.js} +9 -9
  67. package/dist/{navbar-UsCqs4DK.js → navbar-Cl4welok.js} +75 -62
  68. package/dist/pwa/index.js +4 -4
  69. package/dist/{sheet-_rrCMue7.js → sheet-RYwa4-Nl.js} +7 -7
  70. package/dist/{states-BusGNKku.js → states-C6lWnADN.js} +2 -2
  71. package/dist/{table-CZ5Ogd4w.js → table-BWEBIVqj.js} +235 -242
  72. package/dist/{theme-QayeX440.js → theme-Dwc4zNXG.js} +9 -9
  73. package/dist/types/AppAction.d.ts +1 -1
  74. package/dist/types/AppAction.d.ts.map +1 -1
  75. package/dist/types/{BulkAction.d.ts → DataTableBulkAction.d.ts} +3 -3
  76. package/dist/types/DataTableBulkAction.d.ts.map +1 -0
  77. package/dist/types/{ColumnDef.d.ts → DataTableColumn.d.ts} +3 -3
  78. package/dist/types/DataTableColumn.d.ts.map +1 -0
  79. package/dist/types/DataTableConfig.d.ts +21 -5
  80. package/dist/types/DataTableConfig.d.ts.map +1 -1
  81. package/dist/types/{RowAction.d.ts → DataTableRowAction.d.ts} +3 -3
  82. package/dist/types/DataTableRowAction.d.ts.map +1 -0
  83. package/dist/types/DataTableServerState.d.ts +20 -0
  84. package/dist/types/DataTableServerState.d.ts.map +1 -0
  85. package/dist/types/FilterFieldConfig.d.ts +2 -2
  86. package/dist/types/FilterFieldConfig.d.ts.map +1 -1
  87. package/dist/types/FilterSection.d.ts +1 -1
  88. package/dist/types/FilterSection.d.ts.map +1 -1
  89. package/dist/types/UseDataTableProps.d.ts +10 -16
  90. package/dist/types/UseDataTableProps.d.ts.map +1 -1
  91. package/dist/types/UseDataTableResult.d.ts +3 -3
  92. package/dist/types/UseDataTableResult.d.ts.map +1 -1
  93. package/dist/types/index.d.ts +4 -3
  94. package/dist/types/index.d.ts.map +1 -1
  95. package/dist/{ui-hnbBp9RZ.js → ui-D7YSs2kF.js} +1 -1
  96. package/dist/{ui-Dg7lq9J8.js → ui-IEH46J4v.js} +4 -4
  97. package/dist/{useDocumentTitle-D7MywIeB.js → useDocumentTitle-C5TsEDqh.js} +4 -4
  98. package/dist/{useFixedColumns-DnzqhbfT.js → useFixedColumns-BVZs3wbh.js} +27 -27
  99. package/dist/{useLanguage-B1dusDJk.js → useLanguage-DdVIzhME.js} +1 -1
  100. package/dist/{useTheme-D1APOG9I.js → useTheme-ZzPZl0MM.js} +1 -1
  101. package/package.json +2 -2
  102. package/dist/AppActions-CcU3ClFS.js +0 -60
  103. package/dist/dialogs-BDtZIxQa.js +0 -208
  104. package/dist/types/BulkAction.d.ts.map +0 -1
  105. package/dist/types/ColumnDef.d.ts.map +0 -1
  106. package/dist/types/RowAction.d.ts.map +0 -1
@@ -0,0 +1,60 @@
1
+ import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
+ import { t } from "./i18n-CevI9Cgk.js";
3
+ import { Bt as n, Ft as r, Gt as i, Nt as a, jt as o } from "./ui-D7YSs2kF.js";
4
+ import { s } from "./tooltip-BmZ9Bfou.js";
5
+ import { t as c } from "./useMobile-pTQ8lWvt.js";
6
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ import { MoreVerticalIcon as d } from "lucide-react";
8
+ //#region src/components/core/layouts/AppActions.tsx
9
+ function f({ actions: f, className: p }) {
10
+ let { t: m } = t(), h = c();
11
+ return !f || f.length === 0 ? null : h ? /* @__PURE__ */ u(o, { children: [/* @__PURE__ */ l(i, {
12
+ asChild: !0,
13
+ children: /* @__PURE__ */ l(s, {
14
+ variant: "outline",
15
+ size: "icon",
16
+ children: /* @__PURE__ */ l(d, { className: "size-4" })
17
+ })
18
+ }), /* @__PURE__ */ l(a, {
19
+ align: "end",
20
+ className: "min-w-48",
21
+ children: f.map((t, i) => t ? t.children && t.children.length > 0 ? /* @__PURE__ */ u("div", { children: [i > 0 && /* @__PURE__ */ l(n, {}), t.children.map((t, n) => t ? /* @__PURE__ */ u(r, {
22
+ onClick: () => void t.onClick?.(),
23
+ disabled: t.disabled,
24
+ className: e("gap-2", t.className),
25
+ children: [t.icon && /* @__PURE__ */ l(t.icon, { className: "size-4" }), t.labelKey && m(t.labelKey)]
26
+ }, n) : null)] }, i) : /* @__PURE__ */ u(r, {
27
+ onClick: () => void t.onClick?.(),
28
+ disabled: t.disabled,
29
+ className: e("gap-2", t.className),
30
+ children: [t.icon && /* @__PURE__ */ l(t.icon, { className: "size-4" }), t.labelKey && m(t.labelKey)]
31
+ }, i) : null)
32
+ })] }) : ((t) => /* @__PURE__ */ l("div", {
33
+ className: e("flex gap-2", p),
34
+ children: t.map((t, n) => t ? t.children && t.children.length > 0 ? /* @__PURE__ */ u(o, { children: [/* @__PURE__ */ l(i, {
35
+ asChild: !0,
36
+ children: /* @__PURE__ */ u(s, {
37
+ variant: t.variant,
38
+ disabled: t.disabled,
39
+ className: e("gap-2", t.className),
40
+ children: [t.icon && /* @__PURE__ */ l(t.icon, { className: "size-4" }), t.labelKey && m(t.labelKey)]
41
+ })
42
+ }), /* @__PURE__ */ l(a, {
43
+ align: "end",
44
+ children: t.children.map((t, n) => t ? /* @__PURE__ */ u(r, {
45
+ onClick: () => void t.onClick?.(),
46
+ disabled: t.disabled,
47
+ className: e("gap-2", t.className),
48
+ children: [t.icon && /* @__PURE__ */ l(t.icon, { className: "size-4" }), t.labelKey && m(t.labelKey)]
49
+ }, n) : null)
50
+ })] }, n) : /* @__PURE__ */ u(s, {
51
+ variant: t.variant,
52
+ onClick: () => void t.onClick?.(),
53
+ disabled: t.disabled,
54
+ className: e("gap-2", t.className),
55
+ children: [t.icon && /* @__PURE__ */ l(t.icon, { className: "size-4" }), t.labelKey && m(t.labelKey)]
56
+ }, n) : null)
57
+ }))(f);
58
+ }
59
+ //#endregion
60
+ export { f as t };
@@ -1,15 +1,15 @@
1
- import { t as e } from "./AppActions-CcU3ClFS.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { useTranslation as r } from "react-i18next";
1
+ import { t as e } from "./i18n-CevI9Cgk.js";
2
+ import { t } from "./AppActions-D8KKXpq-.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/components/core/layouts/AppSubTitle.tsx
5
5
  function i({ titleKey: i, actions: a, className: o }) {
6
- let { t: s } = r();
7
- return /* @__PURE__ */ n("div", {
6
+ let { t: s } = e();
7
+ return /* @__PURE__ */ r("div", {
8
8
  className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4",
9
- children: [/* @__PURE__ */ t("h2", {
9
+ children: [/* @__PURE__ */ n("h2", {
10
10
  className: "text-lg font-semibold",
11
11
  children: s(i)
12
- }), /* @__PURE__ */ t(e, {
12
+ }), /* @__PURE__ */ n(t, {
13
13
  actions: a,
14
14
  className: o
15
15
  })]
@@ -1,15 +1,15 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { useTranslation as r } from "react-i18next";
2
+ import { t } from "./i18n-CevI9Cgk.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
4
  //#region src/components/core/layouts/AppTitle.tsx
5
5
  function i({ titleKey: i, descriptionKey: a, isSubTitle: o }) {
6
- let { t: s } = r();
7
- return /* @__PURE__ */ n("div", {
6
+ let { t: s } = t();
7
+ return /* @__PURE__ */ r("div", {
8
8
  className: "flex min-w-0 flex-col gap-1",
9
- children: [/* @__PURE__ */ t("h1", {
9
+ children: [/* @__PURE__ */ n("h1", {
10
10
  className: o ? "text-xl md:text-2xl font-semibold" : "text-xl md:text-3xl font-bold",
11
11
  children: s(i) ?? ""
12
- }), a ? /* @__PURE__ */ t("p", {
12
+ }), a ? /* @__PURE__ */ n("p", {
13
13
  className: e("hidden md:block text-muted-foreground", o && "text-sm"),
14
14
  children: s(a)
15
15
  }) : null]
@@ -1,13 +1,13 @@
1
- import { n as e, t } from "./alert-REQGK9bR.js";
2
- import { t as n } from "./i18n-DW5zKBEK.js";
1
+ import { t as e } from "./i18n-CevI9Cgk.js";
2
+ import { n as t, t as n } from "./alert-REQGK9bR.js";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
4
  import { AlertTriangle as a } from "lucide-react";
5
5
  //#region src/components/core/states/ErrorAlert.tsx
6
6
  var o = ({ error: o }) => {
7
- let { t: s } = n();
8
- return o ? /* @__PURE__ */ i(t, {
7
+ let { t: s } = e();
8
+ return o ? /* @__PURE__ */ i(n, {
9
9
  variant: "destructive",
10
- children: [/* @__PURE__ */ r(a, { className: "size-4" }), /* @__PURE__ */ i(e, { children: [/* @__PURE__ */ i("div", {
10
+ children: [/* @__PURE__ */ r(a, { className: "size-4" }), /* @__PURE__ */ i(t, { children: [/* @__PURE__ */ i("div", {
11
11
  className: "flex items-center space-x-2",
12
12
  children: [
13
13
  /* @__PURE__ */ r("span", {
@@ -1,39 +1,38 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
2
  import { c as t, d as n, s as r } from "./chart-Dq3AIrue.js";
3
- import { Ct as i, Dt as a, Et as o, Ot as s, St as c, Tt as l, bn as u, p as d } from "./ui-hnbBp9RZ.js";
4
- import { s as f } from "./tooltip-BmZ9Bfou.js";
5
- import { t as p } from "./i18n-DW5zKBEK.js";
6
- import { g as m } from "./sheet-_rrCMue7.js";
3
+ import { t as i } from "./i18n-CevI9Cgk.js";
4
+ import { Ct as a, Dt as o, Et as s, Ot as c, St as l, Tt as u, bn as d, p as f } from "./ui-D7YSs2kF.js";
5
+ import { s as p } from "./tooltip-BmZ9Bfou.js";
6
+ import { g as m } from "./sheet-RYwa4-Nl.js";
7
7
  import { i as h, l as g, n as _, t as v, u as y } from "./select-DmLScQKX.js";
8
8
  import { n as b } from "./useToast-UeDRLovh.js";
9
- import { t as x } from "./ImageInput-BLIo5LYH.js";
10
- import { t as S } from "./AppSubTitle-C8zoMJo_.js";
11
- import { t as C } from "./MultiSelect-B0Ke0cfS.js";
9
+ import { t as x } from "./ImageInput-DvHgBYsy.js";
10
+ import { t as S } from "./AppSubTitle-CVhjWRBp.js";
11
+ import { t as C } from "./MultiSelect-TGu_k3KM.js";
12
12
  import { useState as w } from "react";
13
13
  import { jsx as T, jsxs as E } from "react/jsx-runtime";
14
- import { useTranslation as D } from "react-i18next";
15
- import { useForm as O } from "react-hook-form";
16
- import { zodResolver as k } from "@hookform/resolvers/zod";
17
- import { z as A } from "zod";
14
+ import { useForm as D } from "react-hook-form";
15
+ import { zodResolver as O } from "@hookform/resolvers/zod";
16
+ import { z as k } from "zod";
18
17
  //#region src/components/core/forms/GenericForm.tsx
19
- var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialData: I, disabled: L = !1, renderActions: R = !0, onRegisterSubmit: z, defaultCols: B = 4 }) => {
20
- let { t: V } = D(), { t: H } = p(), { toast: U } = b(), [W, G] = w(!1), [ee, K] = w({});
21
- if (!j) return null;
22
- let q = (e) => {
18
+ var A = ({ schema: A, isLoading: j, error: M, onSubmit: N, onCancel: P, initialData: F, disabled: I = !1, renderActions: L = !0, onRegisterSubmit: R, defaultCols: z = 4 }) => {
19
+ let { t: B } = i(), { toast: V } = b(), [H, U] = w(!1), [ee, W] = w({});
20
+ if (!A) return null;
21
+ let G = (e) => {
23
22
  switch (e) {
24
23
  case 1: return "md:col-span-1 col-span-4";
25
24
  case 2: return "md:col-span-2 col-span-4";
26
25
  case 3: return "md:col-span-3 col-span-4";
27
26
  default: return "md:col-span-4 col-span-4";
28
27
  }
29
- }, J = (() => {
28
+ }, K = (() => {
30
29
  let e = {};
31
- return j.sections.forEach((t) => {
30
+ return A.sections.forEach((t) => {
32
31
  t.fields.forEach((t) => {
33
- if (t.rules) e[t.key] = t.rules(A);
32
+ if (t.rules) e[t.key] = t.rules(k);
34
33
  else switch (t.type) {
35
34
  case "checkbox":
36
- e[t.key] = A.boolean().nullable().optional();
35
+ e[t.key] = k.boolean().nullable().optional();
37
36
  break;
38
37
  case "html": break;
39
38
  case "text":
@@ -44,55 +43,55 @@ var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialD
44
43
  case "select":
45
44
  case "multiSelect":
46
45
  case "color":
47
- case "image": e[t.key] = A.string().nullable().optional();
46
+ case "image": e[t.key] = k.string().nullable().optional();
48
47
  }
49
48
  });
50
- }), A.object(e);
51
- })(), Y = O({
52
- resolver: k(J),
53
- defaultValues: I || Object.fromEntries(j.sections.flatMap((e) => e.fields.map((e) => [e.key, e.defaultValue ?? null])))
49
+ }), k.object(e);
50
+ })(), q = D({
51
+ resolver: O(K),
52
+ defaultValues: F || Object.fromEntries(A.sections.flatMap((e) => e.fields.map((e) => [e.key, e.defaultValue ?? null])))
54
53
  });
55
54
  w(() => {
56
- z && z(() => void Y.handleSubmit(X)());
55
+ R && R(() => void q.handleSubmit(J)());
57
56
  }), w(() => {
58
- if (I) {
57
+ if (F) {
59
58
  let e = {};
60
- j.sections.forEach((t) => {
59
+ A.sections.forEach((t) => {
61
60
  t.fields.forEach((t) => {
62
- t.type === "image" && I[t.key] && (e[t.key] = I[t.key]);
61
+ t.type === "image" && F[t.key] && (e[t.key] = F[t.key]);
63
62
  });
64
- }), K(e);
63
+ }), W(e);
65
64
  }
66
65
  });
67
- let X = async (e) => {
68
- if (!W) {
69
- if (Object.keys(Y.formState.errors).length > 0) {
70
- U({
71
- title: H("form.validationTitle"),
72
- description: H("form.validationMessage"),
66
+ let J = async (e) => {
67
+ if (!H) {
68
+ if (Object.keys(q.formState.errors).length > 0) {
69
+ V({
70
+ title: B("form.validationTitle"),
71
+ description: B("form.validationMessage"),
73
72
  variant: "destructive"
74
73
  });
75
74
  return;
76
75
  }
77
- G(!0);
76
+ U(!0);
78
77
  try {
79
- await Promise.resolve(P(e));
78
+ await Promise.resolve(N(e));
80
79
  } catch (e) {
81
- console.error("Error during form submission:", e), U({
82
- title: H("states.errorTitle"),
83
- description: H("form.submitError"),
80
+ console.error("Error during form submission:", e), V({
81
+ title: B("states.errorTitle"),
82
+ description: B("form.submitError"),
84
83
  variant: "destructive"
85
84
  });
86
85
  } finally {
87
- G(!1);
86
+ U(!1);
88
87
  }
89
88
  }
90
- }, Z = (e, t) => {
91
- t && K((n) => ({
89
+ }, Y = (e, t) => {
90
+ t && W((n) => ({
92
91
  ...n,
93
92
  [e]: t
94
93
  }));
95
- }, Q = (e) => {
94
+ }, X = (e) => {
96
95
  if (!e) return !1;
97
96
  let t = (e) => {
98
97
  if (!e || !e._def) return !1;
@@ -100,42 +99,42 @@ var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialD
100
99
  return n.typeName === "ZodNullable" ? !0 : n.innerType ? t(n.innerType) : n.type ? t(n.type) : !1;
101
100
  };
102
101
  try {
103
- return t(e(A));
102
+ return t(e(k));
104
103
  } catch {
105
104
  return !1;
106
105
  }
107
- }, $ = (e) => {
106
+ }, Z = (e) => {
108
107
  if (!e) return !1;
109
- let t = e(A);
108
+ let t = e(k);
110
109
  return t.safeParse(void 0).success ? !1 : t._def.checks?.some((e) => e.kind === "min") ?? !1;
111
- }, te = (t, n) => {
112
- let r = !!Y.formState.errors[t.key], a = L;
110
+ }, Q = (t, n) => {
111
+ let r = !!q.formState.errors[t.key], i = I;
113
112
  switch (t.type) {
114
113
  case "text":
115
114
  case "color": return /* @__PURE__ */ T(m, {
116
115
  type: t.type,
117
116
  ...n,
118
- placeholder: t.placeholderKey ? V(t.placeholderKey) : "",
117
+ placeholder: t.placeholderKey ? B(t.placeholderKey) : "",
119
118
  className: e(r && "border-destructive"),
120
- disabled: a,
119
+ disabled: i,
121
120
  value: n.value ?? ""
122
121
  });
123
122
  case "image": {
124
- let i = t, o = i.value === void 0 ? n.value : i.value;
123
+ let a = t, o = a.value === void 0 ? n.value : a.value;
125
124
  return /* @__PURE__ */ T(x, {
126
125
  value: o ?? "",
127
126
  onChange: (e) => {
128
- if (i.onChange && i.onChange(e), n.onChange(e), e) {
127
+ if (a.onChange && a.onChange(e), n.onChange(e), e) {
129
128
  let n = new FileReader();
130
129
  n.onloadend = () => {
131
- Z(t.key, n.result);
130
+ Y(t.key, n.result);
132
131
  }, n.readAsDataURL(e);
133
132
  }
134
133
  },
135
- accept: i.accept,
136
- maxSizeMB: i.maxSizeMB,
137
- hint: i.hint,
138
- disabled: a,
134
+ accept: a.accept,
135
+ maxSizeMB: a.maxSizeMB,
136
+ hint: a.hint,
137
+ disabled: i,
139
138
  className: e(r && "border-destructive")
140
139
  });
141
140
  }
@@ -143,49 +142,49 @@ var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialD
143
142
  type: "date",
144
143
  ...n,
145
144
  className: e(r && "border-destructive"),
146
- disabled: a,
145
+ disabled: i,
147
146
  value: n.value ?? ""
148
147
  });
149
148
  case "time": return /* @__PURE__ */ T(m, {
150
149
  type: "time",
151
150
  ...n,
152
151
  className: e(r && "border-destructive"),
153
- disabled: a,
152
+ disabled: i,
154
153
  value: n.value ?? ""
155
154
  });
156
155
  case "checkbox": return /* @__PURE__ */ E("div", {
157
156
  className: "flex items-center space-x-2",
158
- children: [/* @__PURE__ */ T(u, {
157
+ children: [/* @__PURE__ */ T(d, {
159
158
  id: t.key,
160
159
  checked: n.value === !0,
161
160
  onCheckedChange: (e) => {
162
161
  n.onChange(e);
163
162
  },
164
- disabled: a,
163
+ disabled: i,
165
164
  className: e(r && "border-destructive")
166
165
  }), /* @__PURE__ */ T("label", {
167
166
  htmlFor: t.key,
168
167
  className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
169
- children: V(t.labelKey)
168
+ children: B(t.labelKey)
170
169
  })]
171
170
  }, t.key);
172
- case "textarea": return /* @__PURE__ */ T(d, {
171
+ case "textarea": return /* @__PURE__ */ T(f, {
173
172
  ...n,
174
- placeholder: t.placeholderKey ? V(t.placeholderKey) : "",
173
+ placeholder: t.placeholderKey ? B(t.placeholderKey) : "",
175
174
  className: e(r && "border-destructive", "min-h-[100px]"),
176
- disabled: a,
175
+ disabled: i,
177
176
  value: n.value ?? ""
178
177
  });
179
178
  case "number": {
180
- let i = t;
179
+ let a = t;
181
180
  return /* @__PURE__ */ T(m, {
182
181
  type: "number",
183
182
  ...n,
184
- step: i.step,
185
- min: i.min,
186
- placeholder: t.placeholderKey ? V(t.placeholderKey) : "",
183
+ step: a.step,
184
+ min: a.min,
185
+ placeholder: t.placeholderKey ? B(t.placeholderKey) : "",
187
186
  className: e(r && "border-destructive"),
188
- disabled: a,
187
+ disabled: i,
189
188
  value: n.value ?? "",
190
189
  onChange: (e) => {
191
190
  let t = e.target.value === "" ? "" : Number(e.target.value);
@@ -194,18 +193,18 @@ var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialD
194
193
  });
195
194
  }
196
195
  case "select": {
197
- let o = t, s = Q(t.rules), c = n.value === null || n.value === void 0 ? "" : n.value, l = o.options, u = l.find((e) => e.value === c);
196
+ let o = t, s = X(t.rules), c = n.value === null || n.value === void 0 ? "" : n.value, l = o.options, u = l.find((e) => e.value === c);
198
197
  return /* @__PURE__ */ E(v, {
199
198
  value: c,
200
199
  onValueChange: n.onChange,
201
- disabled: a,
202
- children: [/* @__PURE__ */ T(i, { children: /* @__PURE__ */ T(g, {
200
+ disabled: i,
201
+ children: [/* @__PURE__ */ T(a, { children: /* @__PURE__ */ T(g, {
203
202
  className: e(r && "border-destructive"),
204
203
  onClear: s && c ? (e) => {
205
204
  e.preventDefault(), e.stopPropagation(), n.onChange(null);
206
205
  } : void 0,
207
206
  children: /* @__PURE__ */ T(y, {
208
- placeholder: t.placeholderKey ? V(t.placeholderKey) : "",
207
+ placeholder: t.placeholderKey ? B(t.placeholderKey) : "",
209
208
  children: u ? /* @__PURE__ */ E("div", {
210
209
  className: "flex items-center gap-2",
211
210
  children: [u.color && /* @__PURE__ */ T("div", {
@@ -241,70 +240,70 @@ var j = ({ schema: j, isLoading: M, error: N, onSubmit: P, onCancel: F, initialD
241
240
  onSelectAll: (e) => {
242
241
  n.onChange(e);
243
242
  },
244
- placeholder: t.placeholderKey ? V(t.placeholderKey) : "",
245
- disabled: a
243
+ placeholder: t.placeholderKey ? B(t.placeholderKey) : "",
244
+ disabled: i
246
245
  });
247
246
  }
248
- case "html": return t.render(Y.getValues(), t);
247
+ case "html": return t.render(q.getValues(), t);
249
248
  default: return null;
250
249
  }
251
- }, ne = (c, u) => {
250
+ }, $ = (i, l) => {
252
251
  let d = /* @__PURE__ */ T("div", {
253
252
  className: e("grid grid-cols-4 gap-4"),
254
- children: c.fields.map((t) => /* @__PURE__ */ T(l, {
255
- control: Y.control,
253
+ children: i.fields.map((t) => /* @__PURE__ */ T(u, {
254
+ control: q.control,
256
255
  name: t.key,
257
- render: ({ field: n }) => /* @__PURE__ */ E(o, {
258
- className: e(q(t.layout?.cols ?? B)),
256
+ render: ({ field: n }) => /* @__PURE__ */ E(s, {
257
+ className: e(G(t.layout?.cols ?? z)),
259
258
  children: [
260
- t.type !== "checkbox" && t.type !== "html" && /* @__PURE__ */ E(a, { children: [V(t.labelKey), $(t.rules) && /* @__PURE__ */ T("span", {
259
+ t.type !== "checkbox" && t.type !== "html" && /* @__PURE__ */ E(o, { children: [B(t.labelKey), Z(t.rules) && /* @__PURE__ */ T("span", {
261
260
  className: "text-destructive ml-1",
262
261
  children: "*"
263
262
  })] }),
264
- /* @__PURE__ */ T(i, { children: te(t, n) }),
265
- /* @__PURE__ */ T(s, {})
263
+ /* @__PURE__ */ T(a, { children: Q(t, n) }),
264
+ /* @__PURE__ */ T(c, {})
266
265
  ]
267
266
  })
268
267
  }, t.key))
269
268
  });
270
- return j.useCards === !1 ? /* @__PURE__ */ E("div", {
269
+ return A.useCards === !1 ? /* @__PURE__ */ E("div", {
271
270
  className: "space-y-4 mb-6",
272
- children: [c.titleKey && /* @__PURE__ */ T(S, { titleKey: c.titleKey }), d]
273
- }, u) : /* @__PURE__ */ E(r, {
271
+ children: [i.titleKey && /* @__PURE__ */ T(S, { titleKey: i.titleKey }), d]
272
+ }, l) : /* @__PURE__ */ E(r, {
274
273
  className: "mb-6",
275
- children: [c.titleKey && /* @__PURE__ */ T(n, { children: /* @__PURE__ */ T(S, { titleKey: c.titleKey }) }), /* @__PURE__ */ T(t, { children: d })]
276
- }, u);
274
+ children: [i.titleKey && /* @__PURE__ */ T(n, { children: /* @__PURE__ */ T(S, { titleKey: i.titleKey }) }), /* @__PURE__ */ T(t, { children: d })]
275
+ }, l);
277
276
  };
278
- return /* @__PURE__ */ T(c, {
279
- ...Y,
277
+ return /* @__PURE__ */ T(l, {
278
+ ...q,
280
279
  children: /* @__PURE__ */ E("form", {
281
280
  onSubmit: (e) => {
282
- Y.handleSubmit(X)(e);
281
+ q.handleSubmit(J)(e);
283
282
  },
284
283
  className: "space-y-4 px-0 w-full",
285
284
  children: [/* @__PURE__ */ E("div", {
286
285
  className: "space-y-4",
287
- children: [j.sections.map((e, t) => ne(e, t)), N && /* @__PURE__ */ T("div", {
286
+ children: [A.sections.map((e, t) => $(e, t)), M && /* @__PURE__ */ T("div", {
288
287
  className: "text-sm font-medium text-destructive",
289
- children: N.message
288
+ children: M.message
290
289
  })]
291
- }), !L && R && /* @__PURE__ */ E("div", {
290
+ }), !I && L && /* @__PURE__ */ E("div", {
292
291
  className: "flex justify-end gap-3 mt-6 border-t pt-4",
293
- children: [F && /* @__PURE__ */ T(f, {
292
+ children: [P && /* @__PURE__ */ T(p, {
294
293
  type: "button",
295
294
  variant: "outline",
296
- onClick: F,
297
- disabled: W || M,
298
- children: H("actions.cancel")
299
- }), /* @__PURE__ */ T(f, {
295
+ onClick: P,
296
+ disabled: H || j,
297
+ children: B("actions.cancel")
298
+ }), /* @__PURE__ */ T(p, {
300
299
  variant: "default",
301
300
  type: "submit",
302
- disabled: W || (M ?? !1) || Y.formState.isSubmitting,
303
- children: H(W || M ? "actions.saving" : "actions.save")
301
+ disabled: H || (j ?? !1) || q.formState.isSubmitting,
302
+ children: B(H || j ? "actions.saving" : "actions.save")
304
303
  })]
305
304
  })]
306
305
  })
307
306
  });
308
307
  };
309
308
  //#endregion
310
- export { j as t };
309
+ export { A as t };
@@ -1,14 +1,14 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import "./ui-hnbBp9RZ.js";
3
- import { s as t } from "./tooltip-BmZ9Bfou.js";
4
- import { t as n } from "./i18n-DW5zKBEK.js";
2
+ import { t } from "./i18n-CevI9Cgk.js";
3
+ import "./ui-D7YSs2kF.js";
4
+ import { s as n } from "./tooltip-BmZ9Bfou.js";
5
5
  import { t as r } from "./useNotifications-CyhTruIG.js";
6
6
  import { forwardRef as i, useRef as a } from "react";
7
7
  import { jsx as o, jsxs as s } from "react/jsx-runtime";
8
8
  import { ImageIcon as c, UploadIcon as l, XIcon as u } from "lucide-react";
9
9
  //#region src/components/core/inputs/ImageInput.tsx
10
10
  var d = i(({ value: i, onChange: d, accept: f = "image/jpeg,image/png,image/webp", maxSizeMB: p = 2, disabled: m = !1, className: h = "", hint: g = "JPG, PNG, WEBP" }, _) => {
11
- let { t: v } = n(), { showError: y } = r(), b = a(null);
11
+ let { t: v } = t(), { showError: y } = r(), b = a(null);
12
12
  return /* @__PURE__ */ o("div", {
13
13
  ref: _,
14
14
  className: h,
@@ -18,7 +18,7 @@ var d = i(({ value: i, onChange: d, accept: f = "image/jpeg,image/png,image/webp
18
18
  src: i,
19
19
  alt: "Preview",
20
20
  className: "w-full h-full object-cover"
21
- }), !m && /* @__PURE__ */ o(t, {
21
+ }), !m && /* @__PURE__ */ o(n, {
22
22
  type: "button",
23
23
  variant: "destructive",
24
24
  size: "sm",
@@ -1,13 +1,13 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { bn as t } from "./ui-hnbBp9RZ.js";
3
- import { o as n } from "./tooltip-BmZ9Bfou.js";
4
- import { t as r } from "./i18n-DW5zKBEK.js";
2
+ import { t } from "./i18n-CevI9Cgk.js";
3
+ import { bn as n } from "./ui-D7YSs2kF.js";
4
+ import { o as r } from "./tooltip-BmZ9Bfou.js";
5
5
  import { useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
6
6
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
7
  import { ChevronDownIcon as u, SearchIcon as d, XIcon as f } from "lucide-react";
8
8
  //#region src/components/core/inputs/MultiSelect.tsx
9
9
  var p = ({ options: p, selected: m, onToggle: h, onClear: g, onSelectAll: _, placeholder: v, searchable: y = !1, searchPlaceholder: b, disabled: x = !1, maxCount: S }) => {
10
- let { t: C } = r(), [w, T] = s(""), [E, D] = s(!1), O = o(null), k = o(null), A = a(() => w === "" ? p : p.filter((e) => e.label.toLowerCase().includes(w.toLowerCase())), [p, w]), j = a(() => A.length !== 0 && A.every((e) => m.includes(e.value)), [A, m]), M = a(() => m.map((e) => p.find((t) => t.value === e)?.label ?? e), [p, m]), N = S !== void 0 && S > 0 ? M.slice(0, S) : M, P = M.length - N.length;
10
+ let { t: C } = t(), [w, T] = s(""), [E, D] = s(!1), O = o(null), k = o(null), A = a(() => w === "" ? p : p.filter((e) => e.label.toLowerCase().includes(w.toLowerCase())), [p, w]), j = a(() => A.length !== 0 && A.every((e) => m.includes(e.value)), [A, m]), M = a(() => m.map((e) => p.find((t) => t.value === e)?.label ?? e), [p, m]), N = S !== void 0 && S > 0 ? M.slice(0, S) : M, P = M.length - N.length;
11
11
  return i(() => {
12
12
  E && y && requestAnimationFrame(() => {
13
13
  k.current?.focus();
@@ -29,7 +29,7 @@ var p = ({ options: p, selected: m, onToggle: h, onClear: g, onSelectAll: _, pla
29
29
  onClick: () => {
30
30
  x || D((e) => (e && T(""), !e));
31
31
  },
32
- className: e(n, "w-full", E && "ring-2 ring-ring ring-offset-2", m.length === 0 && "text-muted-foreground"),
32
+ className: e(r, "w-full", E && "ring-2 ring-ring ring-offset-2", m.length === 0 && "text-muted-foreground"),
33
33
  children: [/* @__PURE__ */ c("span", {
34
34
  className: "truncate",
35
35
  children: m.length === 0 ? v ?? C("select.placeholder") : N.join(", ")
@@ -78,7 +78,7 @@ var p = ({ options: p, selected: m, onToggle: h, onClear: g, onSelectAll: _, pla
78
78
  children: [
79
79
  A.length > 0 && /* @__PURE__ */ l("label", {
80
80
  className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors",
81
- children: [/* @__PURE__ */ c(t, {
81
+ children: [/* @__PURE__ */ c(n, {
82
82
  checked: j,
83
83
  onCheckedChange: () => {
84
84
  if (j) {
@@ -102,7 +102,7 @@ var p = ({ options: p, selected: m, onToggle: h, onClear: g, onSelectAll: _, pla
102
102
  A.map((e) => /* @__PURE__ */ l("label", {
103
103
  className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors",
104
104
  children: [
105
- /* @__PURE__ */ c(t, {
105
+ /* @__PURE__ */ c(n, {
106
106
  checked: m.includes(e.value),
107
107
  onCheckedChange: () => {
108
108
  h(e.value);