@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.
- package/dist/{AppActions-DCFvzqFN.js → AppActions-CvT8dDnQ.js} +2 -2
- package/dist/{AppSubTitle-Cmu-4o-a.js → AppSubTitle-DJQjeSdC.js} +2 -2
- package/dist/{AppTitle-CBY03gZy.js → AppTitle-BShUHen9.js} +1 -1
- package/dist/{ErrorAlert-CpxyT2oM.js → ErrorAlert-DrjpMJu6.js} +1 -1
- package/dist/{GenericForm-fiF_fEUb.js → GenericForm-p_iFnXCI.js} +6 -6
- package/dist/{ImageInput-BGe_bc79.js → ImageInput-B6NH8JDS.js} +2 -2
- package/dist/{MultiSelect-xNfIdYS9.js → MultiSelect-BAIbW9Ge.js} +65 -56
- package/dist/{SearchInput-pJFU2KVz.js → SearchInput-BZKtBGfH.js} +115 -111
- package/dist/{behavior-B8iZAgve.js → behavior-UUjjj8qt.js} +1 -1
- package/dist/{cards-hgOitfgK.js → cards-DUbAISUO.js} +2 -2
- package/dist/{charts-CS1Ao2Go.js → charts-BDlyl5wa.js} +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/charts/index.js +1 -1
- package/dist/components/core/dialogs/index.js +3 -3
- package/dist/components/core/filters/index.js +5 -5
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +18 -18
- package/dist/components/core/inputs/MultiSelect.d.ts +2 -0
- package/dist/components/core/inputs/MultiSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/SingleSelect.d.ts +2 -0
- package/dist/components/core/inputs/SingleSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +4 -4
- package/dist/components/core/inputs/select.helper.d.ts +7 -0
- package/dist/components/core/inputs/select.helper.d.ts.map +1 -0
- package/dist/components/core/language/index.js +1 -1
- package/dist/components/core/layouts/index.js +8 -8
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/states/index.js +2 -2
- package/dist/components/core/table/JsonTableOutput.d.ts.map +1 -1
- package/dist/components/core/table/index.js +25 -25
- package/dist/components/core/tabs/index.js +5 -5
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +18 -18
- package/dist/components/ui/index.js +2 -2
- package/dist/{dialogs-CU6kEVHZ.js → dialogs-BSl4lTGR.js} +5 -5
- package/dist/hooks/behavior/index.js +1 -1
- package/dist/hooks/index.js +5 -5
- package/dist/hooks/ui/index.js +4 -4
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/krosoftLocales.d.ts +6 -0
- package/dist/i18n/krosoftLocales.d.ts.map +1 -1
- package/dist/{i18n-TbpdvUJO.js → i18n-Iyf3fyzr.js} +8 -2
- package/dist/{inputs-Cb0xGJ-E.js → inputs-e0dg-VvS.js} +3 -3
- package/dist/{language-DcRIOaqX.js → language-DgO7XgOg.js} +2 -2
- package/dist/{navbar-CRdXfxxM.js → navbar-tmnNnH3O.js} +3 -3
- package/dist/pwa/index.js +1 -1
- package/dist/{sheet-Dyu9stsE.js → sheet-C2vx5V6Q.js} +1 -1
- package/dist/{states-__YoT7H3.js → states-Bs9lIWQe.js} +2 -2
- package/dist/{theme-CHrjFJTd.js → theme-DpbtnjRk.js} +2 -2
- package/dist/{ui-Ce0ULzME.js → ui-BdLutnCT.js} +1 -1
- package/dist/{ui-C-yeu2ep.js → ui-O4O5BzZ0.js} +3 -3
- package/dist/{useDocumentTitle-DN2FTz2t.js → useDocumentTitle--JeBsMsb.js} +1 -1
- package/dist/{useLanguage-Bo6n3OCS.js → useLanguage-0bm0Xoa9.js} +1 -1
- package/dist/{useTheme-DU7ABdZ1.js → useTheme-CFOgsA9n.js} +1 -1
- 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-
|
|
3
|
-
import { Bt as n, Ft as r, Gt as i, Nt as a, jt as o } from "./ui-
|
|
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-
|
|
2
|
-
import { t } from "./AppActions-
|
|
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-
|
|
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,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-
|
|
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-
|
|
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-
|
|
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-
|
|
10
|
-
import { t as x } from "./AppSubTitle-
|
|
11
|
-
import { t as S } from "./MultiSelect-
|
|
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-
|
|
3
|
-
import "./ui-
|
|
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-
|
|
3
|
-
import { bn as n } from "./ui-
|
|
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-
|
|
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/
|
|
11
|
-
var _ = (
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
}) : x
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
}),
|
|
29
|
-
} else
|
|
30
|
-
|
|
36
|
+
}), S(e);
|
|
37
|
+
} else B.forEach((e) => {
|
|
38
|
+
y.includes(e) || b(e);
|
|
31
39
|
});
|
|
32
|
-
},
|
|
33
|
-
...
|
|
40
|
+
}, Y = L ? /* @__PURE__ */ f("button", {
|
|
41
|
+
...j,
|
|
34
42
|
type: "button",
|
|
35
|
-
disabled:
|
|
36
|
-
className: e(r, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors",
|
|
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:
|
|
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: [
|
|
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:
|
|
45
|
-
}), /* @__PURE__ */ d(p, { className: e("size-3.5 opacity-60 transition-transform",
|
|
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
|
-
...
|
|
56
|
+
...j,
|
|
49
57
|
type: "button",
|
|
50
|
-
disabled:
|
|
51
|
-
className: e(a, "w-full",
|
|
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:
|
|
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
|
-
|
|
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: ["+",
|
|
68
|
+
children: ["+", G]
|
|
61
69
|
}),
|
|
62
|
-
|
|
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(),
|
|
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",
|
|
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:
|
|
80
|
-
onOpenChange:
|
|
87
|
+
open: F,
|
|
88
|
+
onOpenChange: K,
|
|
81
89
|
children: [/* @__PURE__ */ d(o, {
|
|
82
90
|
asChild: !0,
|
|
83
|
-
children:
|
|
91
|
+
children: Y
|
|
84
92
|
}), /* @__PURE__ */ f(s, {
|
|
85
|
-
className: e("p-0",
|
|
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: [
|
|
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:
|
|
96
|
-
onValueChange:
|
|
97
|
-
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: [
|
|
116
|
+
children: [z.length === 0 && /* @__PURE__ */ d("p", {
|
|
109
117
|
className: "px-2 py-3 text-center text-xs text-muted-foreground",
|
|
110
|
-
children:
|
|
111
|
-
}),
|
|
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
|
-
|
|
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:
|
|
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
|
-
}),
|
|
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:
|
|
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:
|
|
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 };
|