@krosoft/react 0.0.302 → 0.0.304

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 (55) hide show
  1. package/dist/{AppActions-DCFvzqFN.js → AppActions-CvT8dDnQ.js} +2 -2
  2. package/dist/{AppSubTitle-Cmu-4o-a.js → AppSubTitle-DJQjeSdC.js} +2 -2
  3. package/dist/{AppTitle-CBY03gZy.js → AppTitle-BShUHen9.js} +1 -1
  4. package/dist/{ErrorAlert-CpxyT2oM.js → ErrorAlert-DrjpMJu6.js} +1 -1
  5. package/dist/{GenericForm-fiF_fEUb.js → GenericForm-p_iFnXCI.js} +6 -6
  6. package/dist/{ImageInput-BGe_bc79.js → ImageInput-B6NH8JDS.js} +2 -2
  7. package/dist/{MultiSelect-xNfIdYS9.js → MultiSelect-BAIbW9Ge.js} +65 -56
  8. package/dist/{SearchInput-pJFU2KVz.js → SearchInput-BZKtBGfH.js} +115 -111
  9. package/dist/{behavior-B8iZAgve.js → behavior-UUjjj8qt.js} +1 -1
  10. package/dist/{cards-hgOitfgK.js → cards-DUbAISUO.js} +2 -2
  11. package/dist/{charts-CS1Ao2Go.js → charts-BDlyl5wa.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 +5 -5
  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/MultiSelect.d.ts +2 -0
  19. package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
  20. package/dist/components/core/inputs/SingleSelect.d.ts +2 -0
  21. package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -1
  22. package/dist/components/core/inputs/index.js +4 -4
  23. package/dist/components/core/inputs/select.helper.d.ts +7 -0
  24. package/dist/components/core/inputs/select.helper.d.ts.map +1 -0
  25. package/dist/components/core/language/index.js +1 -1
  26. package/dist/components/core/layouts/index.js +8 -8
  27. package/dist/components/core/navbar/index.js +1 -1
  28. package/dist/components/core/states/index.js +2 -2
  29. package/dist/components/core/table/JsonTableOutput.d.ts.map +1 -1
  30. package/dist/components/core/table/index.js +25 -25
  31. package/dist/components/core/tabs/index.js +5 -5
  32. package/dist/components/core/theme/index.js +1 -1
  33. package/dist/components/index.js +18 -18
  34. package/dist/components/ui/index.js +2 -2
  35. package/dist/{dialogs-CU6kEVHZ.js → dialogs-BSl4lTGR.js} +5 -5
  36. package/dist/hooks/behavior/index.js +1 -1
  37. package/dist/hooks/index.js +5 -5
  38. package/dist/hooks/ui/index.js +4 -4
  39. package/dist/i18n/index.js +1 -1
  40. package/dist/i18n/krosoftLocales.d.ts +6 -0
  41. package/dist/i18n/krosoftLocales.d.ts.map +1 -1
  42. package/dist/{i18n-TbpdvUJO.js → i18n-Iyf3fyzr.js} +8 -2
  43. package/dist/{inputs-Cb0xGJ-E.js → inputs-e0dg-VvS.js} +3 -3
  44. package/dist/{language-DcRIOaqX.js → language-DgO7XgOg.js} +2 -2
  45. package/dist/{navbar-CRdXfxxM.js → navbar-tmnNnH3O.js} +3 -3
  46. package/dist/pwa/index.js +1 -1
  47. package/dist/{sheet-Dyu9stsE.js → sheet-C2vx5V6Q.js} +1 -1
  48. package/dist/{states-__YoT7H3.js → states-Bs9lIWQe.js} +2 -2
  49. package/dist/{theme-CHrjFJTd.js → theme-DpbtnjRk.js} +2 -2
  50. package/dist/{ui-Ce0ULzME.js → ui-BdLutnCT.js} +1 -1
  51. package/dist/{ui-C-yeu2ep.js → ui-O4O5BzZ0.js} +3 -3
  52. package/dist/{useDocumentTitle-DN2FTz2t.js → useDocumentTitle--JeBsMsb.js} +1 -1
  53. package/dist/{useLanguage-Bo6n3OCS.js → useLanguage-0bm0Xoa9.js} +1 -1
  54. package/dist/{useTheme-DU7ABdZ1.js → useTheme-CFOgsA9n.js} +1 -1
  55. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-TbpdvUJO.js";
3
- import { Bt as n, Ft as r, Gt as i, Nt as a, jt as o } from "./ui-Ce0ULzME.js";
2
+ import { t } from "./i18n-Iyf3fyzr.js";
3
+ import { Bt as n, Ft as r, Gt as i, Nt as a, jt as o } from "./ui-BdLutnCT.js";
4
4
  import { c as s } from "./tooltip-_geGvbS7.js";
5
5
  import { t as c } from "./useMobile-pTQ8lWvt.js";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
- import { t as e } from "./i18n-TbpdvUJO.js";
2
- import { t } from "./AppActions-DCFvzqFN.js";
1
+ import { t as e } from "./i18n-Iyf3fyzr.js";
2
+ import { t } from "./AppActions-CvT8dDnQ.js";
3
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 }) {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-TbpdvUJO.js";
2
+ import { t } from "./i18n-Iyf3fyzr.js";
3
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 }) {
@@ -1,4 +1,4 @@
1
- import { t as e } from "./i18n-TbpdvUJO.js";
1
+ import { t as e } from "./i18n-Iyf3fyzr.js";
2
2
  import { n as t, t as n } from "./alert-REQGK9bR.js";
3
3
  import "react";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
@@ -1,14 +1,14 @@
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 { t as i } from "./i18n-TbpdvUJO.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-Ce0ULzME.js";
3
+ import { t as i } from "./i18n-Iyf3fyzr.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-BdLutnCT.js";
5
5
  import { c as p } from "./tooltip-_geGvbS7.js";
6
- import { g as m } from "./sheet-Dyu9stsE.js";
6
+ import { g as m } from "./sheet-C2vx5V6Q.js";
7
7
  import { i as h, l as g, n as ee, t as _, u as v } from "./select-KWMg2_7Z.js";
8
8
  import { n as y } from "./useToast-UeDRLovh.js";
9
- import { t as b } from "./ImageInput-BGe_bc79.js";
10
- import { t as x } from "./AppSubTitle-Cmu-4o-a.js";
11
- import { t as S } from "./MultiSelect-xNfIdYS9.js";
9
+ import { t as b } from "./ImageInput-B6NH8JDS.js";
10
+ import { t as x } from "./AppSubTitle-DJQjeSdC.js";
11
+ import { t as S } from "./MultiSelect-BAIbW9Ge.js";
12
12
  import { useEffect as C, useRef as w, useState as T } from "react";
13
13
  import { jsx as E, jsxs as D } from "react/jsx-runtime";
14
14
  import { useForm as O } from "react-hook-form";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-TbpdvUJO.js";
3
- import "./ui-Ce0ULzME.js";
2
+ import { t } from "./i18n-Iyf3fyzr.js";
3
+ import "./ui-BdLutnCT.js";
4
4
  import { c as n } from "./tooltip-_geGvbS7.js";
5
5
  import { t as r } from "./useNotifications-CyhTruIG.js";
6
6
  import { forwardRef as i, useRef as a } from "react";
@@ -1,100 +1,108 @@
1
1
  import { t as e } from "./tailwind.helper-CJaRYBmL.js";
2
- import { t } from "./i18n-TbpdvUJO.js";
3
- import { bn as n } from "./ui-Ce0ULzME.js";
2
+ import { t } from "./i18n-Iyf3fyzr.js";
3
+ import { bn as n } from "./ui-BdLutnCT.js";
4
4
  import { a as r, o as i, s as a } from "./tooltip-_geGvbS7.js";
5
- import { h as o, m as s, p as c } from "./sheet-Dyu9stsE.js";
5
+ import { h as o, m as s, p as c } from "./sheet-C2vx5V6Q.js";
6
6
  import { useMemo as l, useState as u } from "react";
7
7
  import { jsx as d, jsxs as f } from "react/jsx-runtime";
8
8
  import { ChevronDownIcon as p, SearchIcon as m, XIcon as h } from "lucide-react";
9
9
  import { Command as g } from "cmdk";
10
- //#region src/components/core/inputs/MultiSelect.tsx
11
- var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, variant: S = "input", placeholder: C, labelKey: w, searchable: T = !1, searchPlaceholder: E, disabled: D = !1, maxCount: O, className: k, ...A }) => {
12
- let { t: j } = t(), [M, N] = u(""), [P, F] = u(!1), I = S === "pill", L = S === "input" ? void 0 : i, R = l(() => M === "" ? _ : _.filter((e) => e.label.toLowerCase().includes(M.toLowerCase())), [_, M]), z = l(() => R.filter((e) => e.disabled !== !0).map((e) => e.value), [R]), B = l(() => v.filter((e) => _.find((t) => t.value === e)?.disabled === !0), [_, v]), V = l(() => z.length !== 0 && z.every((e) => v.includes(e)), [z, v]), H = l(() => v.map((e) => _.find((t) => t.value === e)?.label ?? e), [_, v]), U = O !== void 0 && O > 0 ? H.slice(0, O) : H, W = H.length - U.length, G = (e) => {
13
- F(e), e || N("");
14
- }, K = () => {
15
- B.length > 0 ? x === void 0 ? v.filter((e) => !B.includes(e)).forEach((e) => {
16
- y(e);
17
- }) : x(B) : b === void 0 ? x === void 0 ? v.forEach((e) => {
18
- y(e);
19
- }) : x([]) : b();
10
+ //#region src/components/core/inputs/select.helper.tsx
11
+ var _ = (t, n) => t === void 0 ? null : t ? /* @__PURE__ */ d("img", {
12
+ src: t,
13
+ alt: "",
14
+ loading: "lazy",
15
+ className: e("h-7 w-10 shrink-0 rounded object-cover", n)
16
+ }) : /* @__PURE__ */ d("span", {
17
+ className: e("flex h-7 w-10 shrink-0 items-center justify-center rounded bg-muted text-[9px] text-muted-foreground", n),
18
+ children: "—"
19
+ }), v = ({ options: v, selected: y, onToggle: b, onClear: x, onSelectAll: S, variant: C = "input", placeholder: w, labelKey: T, searchable: E = !1, searchPlaceholder: D, disabled: O = !1, maxCount: k, className: A, ...j }) => {
20
+ let { t: M } = t(), [N, P] = u(""), [F, I] = u(!1), L = C === "pill", R = C === "input" ? void 0 : i, z = l(() => N === "" ? v : v.filter((e) => e.label.toLowerCase().includes(N.toLowerCase())), [v, N]), B = l(() => z.filter((e) => e.disabled !== !0).map((e) => e.value), [z]), V = l(() => y.filter((e) => v.find((t) => t.value === e)?.disabled === !0), [v, y]), H = l(() => B.length !== 0 && B.every((e) => y.includes(e)), [B, y]), U = l(() => y.map((e) => v.find((t) => t.value === e)?.label ?? e), [v, y]), W = k !== void 0 && k > 0 ? U.slice(0, k) : U, G = U.length - W.length, K = (e) => {
21
+ I(e), e || P("");
20
22
  }, q = () => {
21
- if (V) x === void 0 ? b !== void 0 && v.every((e) => z.includes(e)) ? b() : z.forEach((e) => {
22
- y(e);
23
- }) : x(v.filter((e) => !z.includes(e)));
24
- else if (x !== void 0) {
25
- let e = [...v];
26
- z.forEach((t) => {
23
+ V.length > 0 ? S === void 0 ? y.filter((e) => !V.includes(e)).forEach((e) => {
24
+ b(e);
25
+ }) : S(V) : x === void 0 ? S === void 0 ? y.forEach((e) => {
26
+ b(e);
27
+ }) : S([]) : x();
28
+ }, J = () => {
29
+ if (H) S === void 0 ? x !== void 0 && y.every((e) => B.includes(e)) ? x() : B.forEach((e) => {
30
+ b(e);
31
+ }) : S(y.filter((e) => !B.includes(e)));
32
+ else if (S !== void 0) {
33
+ let e = [...y];
34
+ B.forEach((t) => {
27
35
  e.includes(t) || e.push(t);
28
- }), x(e);
29
- } else z.forEach((e) => {
30
- v.includes(e) || y(e);
36
+ }), S(e);
37
+ } else B.forEach((e) => {
38
+ y.includes(e) || b(e);
31
39
  });
32
- }, J = I ? /* @__PURE__ */ f("button", {
33
- ...A,
40
+ }, Y = L ? /* @__PURE__ */ f("button", {
41
+ ...j,
34
42
  type: "button",
35
- disabled: D,
36
- className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", v.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", L, k),
43
+ disabled: O,
44
+ className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", y.length > 0 ? "border-primary bg-primary/10 text-primary font-medium" : "hover:bg-muted", R, A),
37
45
  children: [/* @__PURE__ */ d("span", {
38
46
  className: "truncate",
39
- children: w === void 0 ? C ?? j("select.placeholder") : j(w)
47
+ children: T === void 0 ? w ?? M("select.placeholder") : M(T)
40
48
  }), /* @__PURE__ */ f("div", {
41
49
  className: "flex shrink-0 items-center gap-1.5",
42
- children: [v.length > 0 && /* @__PURE__ */ d("span", {
50
+ children: [y.length > 0 && /* @__PURE__ */ d("span", {
43
51
  className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground",
44
- children: v.length
45
- }), /* @__PURE__ */ d(p, { className: e("size-3.5 opacity-60 transition-transform", P && "rotate-180") })]
52
+ children: y.length
53
+ }), /* @__PURE__ */ d(p, { className: e("size-3.5 opacity-60 transition-transform", F && "rotate-180") })]
46
54
  })]
47
55
  }) : /* @__PURE__ */ f("button", {
48
- ...A,
56
+ ...j,
49
57
  type: "button",
50
- disabled: D,
51
- className: e(a, "w-full", L, P && "ring-2 ring-ring ring-offset-2", v.length === 0 && "text-muted-foreground", k),
58
+ disabled: O,
59
+ className: e(a, "w-full", R, F && "ring-2 ring-ring ring-offset-2", y.length === 0 && "text-muted-foreground", A),
52
60
  children: [/* @__PURE__ */ d("span", {
53
61
  className: "truncate",
54
- children: v.length === 0 ? C ?? j("select.placeholder") : U.join(", ")
62
+ children: y.length === 0 ? w ?? M("select.placeholder") : W.join(", ")
55
63
  }), /* @__PURE__ */ f("div", {
56
64
  className: "flex shrink-0 items-center gap-1",
57
65
  children: [
58
- W > 0 && /* @__PURE__ */ f("span", {
66
+ G > 0 && /* @__PURE__ */ f("span", {
59
67
  className: "rounded-control bg-muted px-1.5 py-0.5 text-xs font-medium text-foreground",
60
- children: ["+", W]
68
+ children: ["+", G]
61
69
  }),
62
- v.length > 0 && !D && /* @__PURE__ */ d("span", {
70
+ y.length > 0 && !O && /* @__PURE__ */ d("span", {
63
71
  role: "button",
64
72
  tabIndex: -1,
65
73
  onClick: (e) => {
66
74
  e.stopPropagation();
67
75
  },
68
76
  onPointerDown: (e) => {
69
- e.preventDefault(), e.stopPropagation(), K();
77
+ e.preventDefault(), e.stopPropagation(), q();
70
78
  },
71
79
  className: "text-muted-foreground hover:text-foreground",
72
80
  children: /* @__PURE__ */ d(h, { className: "size-4" })
73
81
  }),
74
- /* @__PURE__ */ d(p, { className: e("size-4 opacity-50 shrink-0 transition-transform", P && "rotate-180") })
82
+ /* @__PURE__ */ d(p, { className: e("size-4 opacity-50 shrink-0 transition-transform", F && "rotate-180") })
75
83
  ]
76
84
  })]
77
85
  });
78
86
  return /* @__PURE__ */ f(c, {
79
- open: P,
80
- onOpenChange: G,
87
+ open: F,
88
+ onOpenChange: K,
81
89
  children: [/* @__PURE__ */ d(o, {
82
90
  asChild: !0,
83
- children: J
91
+ children: Y
84
92
  }), /* @__PURE__ */ f(s, {
85
- className: e("p-0", I ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
93
+ className: e("p-0", L ? "w-72 max-w-[var(--radix-popover-content-available-width)]" : "w-[var(--radix-popover-trigger-width)]"),
86
94
  align: "start",
87
95
  children: [/* @__PURE__ */ f(g, {
88
96
  shouldFilter: !1,
89
97
  className: "flex flex-col",
90
- children: [T ? /* @__PURE__ */ d("div", {
98
+ children: [E ? /* @__PURE__ */ d("div", {
91
99
  className: "border-b border-border p-2",
92
100
  children: /* @__PURE__ */ f("div", {
93
101
  className: "relative",
94
102
  children: [/* @__PURE__ */ d(m, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }), /* @__PURE__ */ d(g.Input, {
95
- value: M,
96
- onValueChange: N,
97
- placeholder: E ?? j("search.placeholder"),
103
+ value: N,
104
+ onValueChange: P,
105
+ placeholder: D ?? M("search.placeholder"),
98
106
  className: "w-full rounded-control bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
99
107
  autoFocus: !0
100
108
  })]
@@ -105,21 +113,22 @@ var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, var
105
113
  className: "sr-only"
106
114
  }), /* @__PURE__ */ f(g.List, {
107
115
  className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto overflow-x-hidden p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent",
108
- children: [R.length === 0 && /* @__PURE__ */ d("p", {
116
+ children: [z.length === 0 && /* @__PURE__ */ d("p", {
109
117
  className: "px-2 py-3 text-center text-xs text-muted-foreground",
110
- children: j("states.noResult")
111
- }), R.map((e) => /* @__PURE__ */ f(g.Item, {
118
+ children: M("states.noResult")
119
+ }), z.map((e) => /* @__PURE__ */ f(g.Item, {
112
120
  value: e.value,
113
121
  disabled: e.disabled,
114
122
  onSelect: () => {
115
- y(e.value);
123
+ b(e.value);
116
124
  },
117
125
  className: "flex min-w-0 items-center gap-2.5 rounded-md px-2 py-2 text-sm cursor-pointer transition-colors data-[selected=true]:bg-muted data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50",
118
126
  children: [
119
127
  /* @__PURE__ */ d("span", {
120
128
  className: "pointer-events-none shrink-0",
121
- children: /* @__PURE__ */ d(n, { checked: v.includes(e.value) })
129
+ children: /* @__PURE__ */ d(n, { checked: y.includes(e.value) })
122
130
  }),
131
+ _(e.imageUrl),
123
132
  e.color && /* @__PURE__ */ d("span", {
124
133
  className: "size-2.5 shrink-0 rounded-full",
125
134
  style: { backgroundColor: e.color }
@@ -132,17 +141,17 @@ var _ = ({ options: _, selected: v, onToggle: y, onClear: b, onSelectAll: x, var
132
141
  ]
133
142
  }, e.value))]
134
143
  })]
135
- }), z.length > 0 && /* @__PURE__ */ d("div", {
144
+ }), B.length > 0 && /* @__PURE__ */ d("div", {
136
145
  className: "border-t border-border p-1.5",
137
146
  children: /* @__PURE__ */ d("button", {
138
147
  type: "button",
139
- onClick: q,
148
+ onClick: J,
140
149
  className: "w-full rounded-md px-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors text-center",
141
- children: j(V ? "filters.deselectAll" : "filters.selectAll")
150
+ children: M(H ? "filters.deselectAll" : "filters.selectAll")
142
151
  })
143
152
  })]
144
153
  })]
145
154
  });
146
155
  };
147
156
  //#endregion
148
- export { _ as t };
157
+ export { _ as n, v as t };