@krosoft/react 0.0.238 → 0.0.239

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 (109) hide show
  1. package/dist/AppActions-C_0YI75w.js +60 -0
  2. package/dist/AppSubTitle-tqqV9nuT.js +19 -0
  3. package/dist/AppTitle-BR4JFZfp.js +19 -0
  4. package/dist/ErrorAlert-BDqDHUUc.js +27 -0
  5. package/dist/GenericForm-CWXT5wiv.js +310 -0
  6. package/dist/ImageInput-CN2ozjpc.js +80 -0
  7. package/dist/MultiSelect-BF0zL0B0.js +134 -0
  8. package/dist/SearchInput-BJPT0SbB.js +255 -0
  9. package/dist/alert-REQGK9bR.js +32 -0
  10. package/dist/behavior-BR_V9Rpe.js +76 -0
  11. package/dist/cards-Cta6x49J.js +126 -0
  12. package/dist/chart-Dq3AIrue.js +166 -0
  13. package/dist/charts-CXhVUqLH.js +328 -0
  14. package/dist/components/core/cards/index.js +2 -10
  15. package/dist/components/core/charts/index.js +2 -11
  16. package/dist/components/core/dialogs/index.js +4 -19
  17. package/dist/components/core/filters/index.js +426 -7
  18. package/dist/components/core/forms/index.js +2 -4
  19. package/dist/components/core/index.js +24 -97
  20. package/dist/components/core/inputs/index.js +4 -11
  21. package/dist/components/core/language/index.js +2 -4
  22. package/dist/components/core/layouts/index.js +50 -11
  23. package/dist/components/core/navbar/index.js +2 -9
  24. package/dist/components/core/states/index.js +3 -8
  25. package/dist/components/core/table/index.js +2 -15
  26. package/dist/components/core/tabs/index.js +188 -6
  27. package/dist/components/core/theme/index.js +2 -4
  28. package/dist/components/index.js +28 -322
  29. package/dist/components/ui/index.js +8 -240
  30. package/dist/contexts/index.js +2 -5
  31. package/dist/dialogs-BGHSClsq.js +208 -0
  32. package/dist/helpers/index.js +39 -46
  33. package/dist/hooks/behavior/index.js +2 -10
  34. package/dist/hooks/index.js +11 -30
  35. package/dist/hooks/ui/index.js +10 -22
  36. package/dist/i18n/index.js +2 -10
  37. package/dist/i18n-Dw99bRmg.js +190 -0
  38. package/dist/language-DxHhlpgN.js +58 -0
  39. package/dist/navbar-Bc5OQWRI.js +385 -0
  40. package/dist/providers/index.js +42 -49
  41. package/dist/pwa/index.js +32 -34
  42. package/dist/select-ULiTPOr5.js +81 -0
  43. package/dist/sheet-CRrYTZrl.js +226 -0
  44. package/dist/sidebar.context-BahtU6hE.js +5 -0
  45. package/dist/skeleton-D6Ga4BLw.js +11 -0
  46. package/dist/states-N8-LjFng.js +26 -0
  47. package/dist/table-muUyiaK6.js +571 -0
  48. package/dist/tailwind/index.js +126 -156
  49. package/dist/tailwind.helper-CJaRYBmL.js +8 -0
  50. package/dist/theme-B_n0F6R4.js +57 -0
  51. package/dist/tokens/index.js +37 -46
  52. package/dist/tooltip-B2dzyfs9.js +50 -0
  53. package/dist/types/forms/index.js +0 -1
  54. package/dist/types/index.js +1 -1
  55. package/dist/ui-CiX0E_bn.js +1165 -0
  56. package/dist/ui-DSVBO3iM.js +46 -0
  57. package/dist/useDocumentTitle-D7MywIeB.js +19 -0
  58. package/dist/useFixedColumns-DfAX30tT.js +147 -0
  59. package/dist/useLanguage-DN3CuBv5.js +19 -0
  60. package/dist/useMobile-pTQ8lWvt.js +16 -0
  61. package/dist/useNotifications-CyhTruIG.js +20 -0
  62. package/dist/useScrollFade-D9kqJBDh.js +27 -0
  63. package/dist/useTheme-DVfcJ-Qd.js +25 -0
  64. package/dist/useToast-UeDRLovh.js +103 -0
  65. package/package.json +2 -2
  66. package/dist/AppActions-BFwztl-1.js +0 -76
  67. package/dist/AppSubTitle-BTN0YAc7.js +0 -13
  68. package/dist/AppTitle-D15YXeMx.js +0 -13
  69. package/dist/AppVerticalTabs-B7XXtAVj.js +0 -103
  70. package/dist/ConfirmationDialog-Dj4WdnHg.js +0 -188
  71. package/dist/DataTable-CjrR27Di.js +0 -638
  72. package/dist/ErrorAlert-B99Xb_Hg.js +0 -23
  73. package/dist/ErrorState-CkeS_IBT.js +0 -14
  74. package/dist/GenericForm-CydibLHU.js +0 -343
  75. package/dist/ImageInput-DoOOvvth.js +0 -70
  76. package/dist/KpiCardsLayout-Bq4xQ3i8.js +0 -43
  77. package/dist/LanguageSelector-C7E51rCQ.js +0 -47
  78. package/dist/LoadingState-BN0YaPSs.js +0 -9
  79. package/dist/MetricCard-B0xnFyim.js +0 -53
  80. package/dist/MultiSelect-DbH7LrsD.js +0 -149
  81. package/dist/PieChart-uozNJtEx.js +0 -295
  82. package/dist/SearchInput-DIZ5Yt6L.js +0 -246
  83. package/dist/SkeletonCards-B9C4cNMr.js +0 -75
  84. package/dist/TableFilter-CmEVF5Bo.js +0 -422
  85. package/dist/ThemeSelector-CLi4_epH.js +0 -52
  86. package/dist/Topbar-Clby5_uj.js +0 -431
  87. package/dist/alert-B9F1N9Qk.js +0 -30
  88. package/dist/chart-DntJZGxB.js +0 -181
  89. package/dist/select-BpjFWqAY.js +0 -96
  90. package/dist/sheet-XYI-ezvY.js +0 -292
  91. package/dist/sidebar.context-D5nywlmP.js +0 -6
  92. package/dist/skeleton-BX4RcsiK.js +0 -8
  93. package/dist/tailwind.helper-B6yFEsav.js +0 -8
  94. package/dist/toaster-CyzB1m5z.js +0 -75
  95. package/dist/toggle-group-iZqnrTj7.js +0 -1276
  96. package/dist/tooltip-DVeqVwqV.js +0 -61
  97. package/dist/useDateFnsLocale-D6VExZ8U.js +0 -11
  98. package/dist/useDocumentTitle-WNwdPz-I.js +0 -14
  99. package/dist/useFixedColumns-CKZyu4PD.js +0 -161
  100. package/dist/useKrosoftTranslation-BTp46G94.js +0 -47
  101. package/dist/useLanguage-C9jI2nwn.js +0 -19
  102. package/dist/useMobile-DN1_OMDB.js +0 -16
  103. package/dist/useNotifications-zbUhCvF_.js +0 -12
  104. package/dist/usePage-BQm6tdJD.js +0 -84
  105. package/dist/useScrollFade-BA4KqJYp.js +0 -23
  106. package/dist/useServerTable-UvTY6L1N.js +0 -38
  107. package/dist/useSidebar-BJuALHqQ.js +0 -11
  108. package/dist/useTheme-DS6ZjdzM.js +0 -27
  109. package/dist/useToast-BFTk4lWz.js +0 -100
@@ -1,343 +0,0 @@
1
- import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
- import "date-fns/locale";
3
- import { useTranslation as q } from "react-i18next";
4
- import { u as D } from "./useKrosoftTranslation-BTp46G94.js";
5
- import { I as J } from "./ImageInput-DoOOvvth.js";
6
- import { A as V } from "./AppSubTitle-BTN0YAc7.js";
7
- import { M as L } from "./MultiSelect-DbH7LrsD.js";
8
- import { ai as Q, al as X, am as Y, an as $, aj as j, ao as F, bh as ee, E as te } from "./toggle-group-iZqnrTj7.js";
9
- import "./alert-B9F1N9Qk.js";
10
- import "@radix-ui/react-aspect-ratio";
11
- import { B as P } from "./tooltip-DVeqVwqV.js";
12
- import { C as ae, d as re, a as se } from "./chart-DntJZGxB.js";
13
- import "@radix-ui/react-collapsible";
14
- import { I as C } from "./sheet-XYI-ezvY.js";
15
- import "lucide-react";
16
- import "react-resizable-panels";
17
- import { c as i } from "./tailwind.helper-B6yFEsav.js";
18
- import { S as ne, h as le, i as oe, a as ce, c as ie } from "./select-BpjFWqAY.js";
19
- import "next-themes";
20
- import "sonner";
21
- import { u as ue } from "./useToast-BFTk4lWz.js";
22
- import { zodResolver as me } from "@hookform/resolvers/zod";
23
- import { useState as f } from "react";
24
- import { useForm as de } from "react-hook-form";
25
- import { z as y } from "zod";
26
- const _e = ({
27
- schema: v,
28
- isLoading: S,
29
- error: N,
30
- onSubmit: z,
31
- onCancel: x,
32
- initialData: g,
33
- disabled: K = !1,
34
- renderActions: A = !0,
35
- onRegisterSubmit: w,
36
- defaultCols: B = 4
37
- }) => {
38
- const { t: p } = q(), { t: h } = D(), { toast: E } = ue(), [k, T] = f(!1), [pe, I] = f({});
39
- if (!v) return null;
40
- const O = (e) => {
41
- switch (e) {
42
- case 1:
43
- return "md:col-span-1 col-span-4";
44
- case 2:
45
- return "md:col-span-2 col-span-4";
46
- case 3:
47
- return "md:col-span-3 col-span-4";
48
- case 4:
49
- default:
50
- return "md:col-span-4 col-span-4";
51
- }
52
- }, R = (() => {
53
- const e = {};
54
- return v.sections.forEach((t) => {
55
- t.fields.forEach((a) => {
56
- if (a.rules)
57
- e[a.key] = a.rules(y);
58
- else
59
- switch (a.type) {
60
- case "checkbox":
61
- e[a.key] = y.boolean().nullable().optional();
62
- break;
63
- case "html":
64
- break;
65
- case "text":
66
- case "textarea":
67
- case "number":
68
- case "date":
69
- case "time":
70
- case "select":
71
- case "multiSelect":
72
- case "color":
73
- case "image":
74
- e[a.key] = y.string().nullable().optional();
75
- break;
76
- }
77
- });
78
- }), y.object(e);
79
- })(), m = de({
80
- resolver: me(R),
81
- defaultValues: g || Object.fromEntries(v.sections.flatMap((e) => e.fields.map((t) => [t.key, t.defaultValue ?? null])))
82
- });
83
- f(() => {
84
- w && w(() => void m.handleSubmit(M)());
85
- }), f(() => {
86
- if (g) {
87
- const e = {};
88
- v.sections.forEach((t) => {
89
- t.fields.forEach((a) => {
90
- a.type === "image" && g[a.key] && (e[a.key] = g[a.key]);
91
- });
92
- }), I(e);
93
- }
94
- });
95
- const M = async (e) => {
96
- if (k) return;
97
- if (Object.keys(m.formState.errors).length > 0) {
98
- E({
99
- title: h("form.validationTitle"),
100
- description: h("form.validationMessage"),
101
- variant: "destructive"
102
- });
103
- return;
104
- }
105
- T(!0);
106
- try {
107
- await Promise.resolve(z(e));
108
- } catch (a) {
109
- console.error("Error during form submission:", a), E({
110
- title: h("states.errorTitle"),
111
- description: h("form.submitError"),
112
- variant: "destructive"
113
- });
114
- } finally {
115
- T(!1);
116
- }
117
- }, Z = (e, t) => {
118
- t && I((a) => ({ ...a, [e]: t }));
119
- }, _ = (e) => {
120
- if (!e) return !1;
121
- const t = (a) => {
122
- if (!a || !a._def) return !1;
123
- const s = a._def;
124
- return s.typeName === "ZodNullable" ? !0 : s.innerType ? t(s.innerType) : s.type ? t(s.type) : !1;
125
- };
126
- try {
127
- const a = e(y);
128
- return t(a);
129
- } catch {
130
- return !1;
131
- }
132
- }, G = (e) => {
133
- var s;
134
- if (!e) return !1;
135
- const t = e(y);
136
- return t.safeParse(void 0).success ? !1 : ((s = t._def.checks) == null ? void 0 : s.some((n) => n.kind === "min")) ?? !1;
137
- }, H = (e, t) => {
138
- const a = !!m.formState.errors[e.key], s = K;
139
- switch (e.type) {
140
- case "text":
141
- case "color":
142
- return /* @__PURE__ */ r(
143
- C,
144
- {
145
- type: e.type,
146
- ...t,
147
- placeholder: e.placeholderKey ? p(e.placeholderKey) : "",
148
- className: i(a && "border-destructive"),
149
- disabled: s,
150
- value: t.value ?? ""
151
- }
152
- );
153
- case "image": {
154
- const n = e, o = n.value !== void 0 ? n.value : t.value;
155
- return /* @__PURE__ */ r(
156
- J,
157
- {
158
- value: o ?? "",
159
- onChange: (l) => {
160
- if (n.onChange && n.onChange(l), t.onChange(l), l) {
161
- const d = new FileReader();
162
- d.onloadend = () => {
163
- Z(e.key, d.result);
164
- }, d.readAsDataURL(l);
165
- }
166
- },
167
- accept: n.accept,
168
- maxSizeMB: n.maxSizeMB,
169
- hint: n.hint,
170
- disabled: s,
171
- className: i(a && "border-destructive")
172
- }
173
- );
174
- }
175
- case "date":
176
- return /* @__PURE__ */ r(
177
- C,
178
- {
179
- type: "date",
180
- ...t,
181
- className: i(a && "border-destructive"),
182
- disabled: s,
183
- value: t.value ?? ""
184
- }
185
- );
186
- case "time":
187
- return /* @__PURE__ */ r(
188
- C,
189
- {
190
- type: "time",
191
- ...t,
192
- className: i(a && "border-destructive"),
193
- disabled: s,
194
- value: t.value ?? ""
195
- }
196
- );
197
- case "checkbox":
198
- return /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
199
- /* @__PURE__ */ r(
200
- te,
201
- {
202
- id: e.key,
203
- checked: t.value === !0,
204
- onCheckedChange: (n) => {
205
- t.onChange(n);
206
- },
207
- disabled: s,
208
- className: i(a && "border-destructive")
209
- }
210
- ),
211
- /* @__PURE__ */ r("label", { htmlFor: e.key, className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: p(e.labelKey) })
212
- ] }, e.key);
213
- case "textarea":
214
- return /* @__PURE__ */ r(
215
- ee,
216
- {
217
- ...t,
218
- placeholder: e.placeholderKey ? p(e.placeholderKey) : "",
219
- className: i(a && "border-destructive", "min-h-[100px]"),
220
- disabled: s,
221
- value: t.value ?? ""
222
- }
223
- );
224
- case "number": {
225
- const n = e;
226
- return /* @__PURE__ */ r(
227
- C,
228
- {
229
- type: "number",
230
- ...t,
231
- step: n.step,
232
- min: n.min,
233
- placeholder: e.placeholderKey ? p(e.placeholderKey) : "",
234
- className: i(a && "border-destructive"),
235
- disabled: s,
236
- value: t.value ?? "",
237
- onChange: (o) => {
238
- const l = o.target.value === "" ? "" : Number(o.target.value);
239
- t.onChange(l);
240
- }
241
- }
242
- );
243
- }
244
- case "select": {
245
- const n = e, o = _(e.rules), l = t.value === null || t.value === void 0 ? "" : t.value, d = n.options, b = d.find((u) => u.value === l);
246
- return /* @__PURE__ */ c(ne, { value: l, onValueChange: t.onChange, disabled: s, children: [
247
- /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(
248
- le,
249
- {
250
- className: i(a && "border-destructive"),
251
- onClear: o && l ? (u) => {
252
- u.preventDefault(), u.stopPropagation(), t.onChange(null);
253
- } : void 0,
254
- children: /* @__PURE__ */ r(oe, { placeholder: e.placeholderKey ? p(e.placeholderKey) : "", children: b ? /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
255
- b.color && /* @__PURE__ */ r("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: b.color } }),
256
- b.label
257
- ] }) : void 0 })
258
- }
259
- ) }),
260
- /* @__PURE__ */ r(ce, { children: d.map((u, W) => /* @__PURE__ */ r(ie, { value: u.value, children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
261
- u.color && /* @__PURE__ */ r("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: u.color } }),
262
- u.label
263
- ] }) }, W)) })
264
- ] });
265
- }
266
- case "multiSelect": {
267
- const n = e, o = t.value ?? [];
268
- return /* @__PURE__ */ r(
269
- L,
270
- {
271
- options: n.options,
272
- selected: o,
273
- onToggle: (l) => {
274
- const d = o.includes(l) ? o.filter((b) => b !== l) : [...o, l];
275
- t.onChange(d);
276
- },
277
- onClear: () => {
278
- t.onChange([]);
279
- },
280
- onSelectAll: (l) => {
281
- t.onChange(l);
282
- },
283
- placeholder: e.placeholderKey ? p(e.placeholderKey) : "",
284
- disabled: s
285
- }
286
- );
287
- }
288
- case "html":
289
- return e.render(m.getValues(), e);
290
- default:
291
- return null;
292
- }
293
- }, U = (e, t) => {
294
- const a = /* @__PURE__ */ r("div", { className: i("grid grid-cols-4 gap-4"), children: e.fields.map((s) => /* @__PURE__ */ r(
295
- X,
296
- {
297
- control: m.control,
298
- name: s.key,
299
- render: ({ field: n }) => {
300
- var o;
301
- return /* @__PURE__ */ c(Y, { className: i(O(((o = s.layout) == null ? void 0 : o.cols) ?? B)), children: [
302
- s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ c($, { children: [
303
- p(s.labelKey),
304
- G(s.rules) && /* @__PURE__ */ r("span", { className: "text-destructive ml-1", children: "*" })
305
- ] }),
306
- /* @__PURE__ */ r(j, { children: H(s, n) }),
307
- /* @__PURE__ */ r(F, {})
308
- ] });
309
- }
310
- },
311
- s.key
312
- )) });
313
- return v.useCards === !1 ? /* @__PURE__ */ c("div", { className: "space-y-4 mb-6", children: [
314
- e.titleKey && /* @__PURE__ */ r(V, { titleKey: e.titleKey }),
315
- a
316
- ] }, t) : /* @__PURE__ */ c(ae, { className: "mb-6", children: [
317
- e.titleKey && /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(V, { titleKey: e.titleKey }) }),
318
- /* @__PURE__ */ r(se, { children: a })
319
- ] }, t);
320
- };
321
- return /* @__PURE__ */ r(Q, { ...m, children: /* @__PURE__ */ c(
322
- "form",
323
- {
324
- onSubmit: (e) => {
325
- m.handleSubmit(M)(e);
326
- },
327
- className: "space-y-4 px-0 w-full",
328
- children: [
329
- /* @__PURE__ */ c("div", { className: "space-y-4", children: [
330
- v.sections.map((e, t) => U(e, t)),
331
- N && /* @__PURE__ */ r("div", { className: "text-sm font-medium text-destructive", children: N.message })
332
- ] }),
333
- !K && A && /* @__PURE__ */ c("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
334
- x && /* @__PURE__ */ r(P, { type: "button", variant: "outline", onClick: x, disabled: k || S, children: h("actions.cancel") }),
335
- /* @__PURE__ */ r(P, { variant: "default", type: "submit", disabled: k || (S ?? !1) || m.formState.isSubmitting, children: h(k || S ? "actions.saving" : "actions.save") })
336
- ] })
337
- ]
338
- }
339
- ) });
340
- };
341
- export {
342
- _e as G
343
- };
@@ -1,70 +0,0 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import "date-fns/locale";
3
- import "react-i18next";
4
- import { u as x } from "./useKrosoftTranslation-BTp46G94.js";
5
- import "./toggle-group-iZqnrTj7.js";
6
- import "./alert-B9F1N9Qk.js";
7
- import "@radix-ui/react-aspect-ratio";
8
- import { B as N } from "./tooltip-DVeqVwqV.js";
9
- import "./chart-DntJZGxB.js";
10
- import "@radix-ui/react-collapsible";
11
- import "./sheet-XYI-ezvY.js";
12
- import { XIcon as w, ImageIcon as y, UploadIcon as I } from "lucide-react";
13
- import "react-resizable-panels";
14
- import { c as p } from "./tailwind.helper-B6yFEsav.js";
15
- import "./select-BpjFWqAY.js";
16
- import "next-themes";
17
- import "sonner";
18
- import { forwardRef as j, useRef as T } from "react";
19
- import { u as R } from "./useNotifications-zbUhCvF_.js";
20
- const P = j(
21
- ({ value: a, onChange: m, accept: n = "image/jpeg,image/png,image/webp", maxSizeMB: i = 2, disabled: l = !1, className: f = "", hint: c = "JPG, PNG, WEBP" }, h) => {
22
- const { t } = x(), { showError: d } = R(), r = T(null), g = (b) => {
23
- var u;
24
- const o = (u = b.target.files) == null ? void 0 : u[0];
25
- if (!o) return;
26
- if (!n.split(",").map((v) => v.trim()).includes(o.type)) {
27
- d(t("states.errorTitle"), t("image.invalidType", { types: c })), r.current && (r.current.value = "");
28
- return;
29
- }
30
- if (o.size > i * 1024 * 1024) {
31
- d(t("states.errorTitle"), t("image.tooLarge", { size: i })), r.current && (r.current.value = "");
32
- return;
33
- }
34
- m(o), r.current && (r.current.value = "");
35
- };
36
- return /* @__PURE__ */ e("div", { ref: h, className: f, children: a ? /* @__PURE__ */ s("div", { className: "relative w-32 h-32 rounded-surface overflow-hidden border-2 border-border", children: [
37
- /* @__PURE__ */ e("img", { src: a, alt: "Preview", className: "w-full h-full object-cover" }),
38
- !l && /* @__PURE__ */ e(N, { type: "button", variant: "destructive", size: "sm", className: "absolute top-1 right-1 h-6 w-6 p-0", onClick: () => {
39
- m(null);
40
- }, children: /* @__PURE__ */ e(w, { className: "h-4 w-4" }) })
41
- ] }) : l ? /* @__PURE__ */ s("div", { className: p("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed border-border rounded-surface", "bg-muted/30"), children: [
42
- /* @__PURE__ */ e(y, { className: "h-8 w-8 text-muted-foreground/50 mb-2" }),
43
- /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground/50", children: t("image.empty") })
44
- ] }) : /* @__PURE__ */ s(
45
- "label",
46
- {
47
- className: p(
48
- "flex flex-col items-center justify-center w-full h-32",
49
- "border-2 border-dashed border-border rounded-surface",
50
- "cursor-pointer hover:bg-muted/50 transition-colors"
51
- ),
52
- children: [
53
- /* @__PURE__ */ e(I, { className: "h-8 w-8 text-muted-foreground mb-2" }),
54
- /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: t("image.upload") }),
55
- /* @__PURE__ */ s("span", { className: "text-xs text-muted-foreground mt-1", children: [
56
- c,
57
- " (max ",
58
- i,
59
- "MB)"
60
- ] }),
61
- /* @__PURE__ */ e("input", { ref: r, type: "file", className: "hidden", accept: n, onChange: g })
62
- ]
63
- }
64
- ) });
65
- }
66
- );
67
- P.displayName = "ImageInput";
68
- export {
69
- P as I
70
- };
@@ -1,43 +0,0 @@
1
- import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import "./toggle-group-iZqnrTj7.js";
3
- import "./alert-B9F1N9Qk.js";
4
- import "@radix-ui/react-aspect-ratio";
5
- import { B as c } from "./tooltip-DVeqVwqV.js";
6
- import "./chart-DntJZGxB.js";
7
- import "@radix-ui/react-collapsible";
8
- import "./sheet-XYI-ezvY.js";
9
- import { ArrowLeftIcon as l } from "lucide-react";
10
- import "react-resizable-panels";
11
- import "clsx";
12
- import "tailwind-merge";
13
- import "./select-BpjFWqAY.js";
14
- import "next-themes";
15
- import "sonner";
16
- import "react";
17
- import { A as f } from "./AppActions-BFwztl-1.js";
18
- import { A as d } from "./AppTitle-D15YXeMx.js";
19
- import { u } from "./useDocumentTitle-WNwdPz-I.js";
20
- import { useTranslation as g } from "react-i18next";
21
- import "@krosoft/core/helpers";
22
- import { b as h, a as x } from "./SkeletonCards-B9C4cNMr.js";
23
- import "date-fns/locale";
24
- import { E as A } from "./ErrorState-CkeS_IBT.js";
25
- function P({ icon: t, titleKey: i, descriptionKey: e, actions: a, onBack: o, renderPreActions: s, className: p }) {
26
- const { t: n } = g();
27
- return u(n(i)), /* @__PURE__ */ m("div", { className: "flex flex-row items-center justify-between gap-3 md:gap-4", children: [
28
- /* @__PURE__ */ m("div", { className: "flex min-w-0 items-center gap-3 md:gap-4", children: [
29
- o && /* @__PURE__ */ r(c, { variant: "ghost", size: "icon", className: "shrink-0", onClick: o, children: /* @__PURE__ */ r(l, { className: "h-4 w-4" }) }),
30
- t && /* @__PURE__ */ r("div", { className: "size-12 shrink-0 bg-blue-100 rounded-control flex items-center justify-center", children: /* @__PURE__ */ r(t, { className: "h-6 w-6 text-blue-600" }) }),
31
- /* @__PURE__ */ r(d, { titleKey: i, descriptionKey: e })
32
- ] }),
33
- /* @__PURE__ */ m("div", { className: "flex shrink-0 items-center gap-2 md:gap-4", children: [
34
- s && s(),
35
- /* @__PURE__ */ r(f, { actions: a, className: p })
36
- ] })
37
- ] });
38
- }
39
- const Q = ({ stats: t, isLoading: i, error: e }) => i ? /* @__PURE__ */ r(h, { count: 4 }) : e ? /* @__PURE__ */ r(A, { message: e.message }) : /* @__PURE__ */ r(x, { stats: t });
40
- export {
41
- P as A,
42
- Q as K
43
- };
@@ -1,47 +0,0 @@
1
- import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
- import "date-fns/locale";
3
- import "react-i18next";
4
- import { u as h } from "./useKrosoftTranslation-BTp46G94.js";
5
- import { b as g, T as f, c as v, B as p, a as b } from "./tooltip-DVeqVwqV.js";
6
- import { S as T, h as N, i as x, a as S, c as C } from "./select-BpjFWqAY.js";
7
- import { u as I } from "./useLanguage-C9jI2nwn.js";
8
- import { LanguagesIcon as i } from "lucide-react";
9
- function P({ languageOptions: o, variant: n = "select", id: t }) {
10
- const { t: r } = h(), { currentLanguageOption: a, nextLanguageOption: c, changeLanguage: m, cycleLanguage: d } = I(o);
11
- if (n === "mini") {
12
- const l = (a == null ? void 0 : a.icon) ?? i;
13
- return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ s(f, { children: [
14
- /* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ s(
15
- p,
16
- {
17
- id: t,
18
- variant: "ghost",
19
- size: "icon",
20
- onClick: d,
21
- className: "text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
22
- children: [
23
- /* @__PURE__ */ e(l, { className: "size-4" }),
24
- /* @__PURE__ */ e("span", { className: "sr-only", children: r("language.current", { language: (a == null ? void 0 : a.label) ?? "" }) })
25
- ]
26
- }
27
- ) }),
28
- /* @__PURE__ */ e(b, { side: "bottom", align: "center", children: r("language.switchTo", { language: (c == null ? void 0 : c.label) ?? "" }) })
29
- ] }) });
30
- }
31
- return /* @__PURE__ */ s("div", { className: "space-y-2", children: [
32
- /* @__PURE__ */ s(T, { value: a == null ? void 0 : a.value, onValueChange: m, children: [
33
- /* @__PURE__ */ e(N, { id: t, className: "w-full", children: /* @__PURE__ */ e(x, { placeholder: r("select.language") }) }),
34
- /* @__PURE__ */ e(S, { children: o.map((l) => {
35
- const u = l.icon ?? i;
36
- return /* @__PURE__ */ e(C, { value: l.value, children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
37
- /* @__PURE__ */ e(u, { className: "size-4" }),
38
- l.label
39
- ] }) }, l.value);
40
- }) })
41
- ] }),
42
- /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: r("language.description") })
43
- ] });
44
- }
45
- export {
46
- P as L
47
- };
@@ -1,9 +0,0 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { Loader2Icon as r } from "lucide-react";
3
- const a = ({ message: e }) => /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
4
- /* @__PURE__ */ t(r, { className: "size-8 animate-spin mb-4 text-primary" }),
5
- e !== void 0 && e !== "" ? /* @__PURE__ */ t("p", { className: "font-semibold text-sm", children: e }) : null
6
- ] });
7
- export {
8
- a as L
9
- };
@@ -1,53 +0,0 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { C as l, d as h, e as m, a as g } from "./chart-DntJZGxB.js";
3
- import { c as b } from "./tailwind.helper-B6yFEsav.js";
4
- import { useTranslation as p } from "react-i18next";
5
- const k = ({ titleKey: t, icon: s, className: n, children: a }) => {
6
- const { t: o } = p();
7
- return /* @__PURE__ */ r(l, { className: b("bg-gray-50 dark:bg-gray-950", n), children: [
8
- /* @__PURE__ */ e(h, { children: /* @__PURE__ */ r(m, { className: "flex items-center gap-2", children: [
9
- s && /* @__PURE__ */ e(s, { className: "mr-2 size-4" }),
10
- /* @__PURE__ */ e("span", { children: o(t) })
11
- ] }) }),
12
- /* @__PURE__ */ e(g, { children: a })
13
- ] });
14
- }, w = {
15
- blue: "bg-gradient-to-br from-blue-500 to-cyan-500 text-white",
16
- green: "bg-gradient-to-br from-green-500 to-emerald-500 text-white",
17
- orange: "bg-gradient-to-br from-orange-500 to-yellow-500 text-white",
18
- red: "bg-gradient-to-br from-red-500 to-pink-500 text-white",
19
- purple: "bg-gradient-to-br from-purple-500 to-indigo-500 text-white",
20
- accent: "bg-accent/10 text-accent",
21
- success: "bg-success/10 text-success",
22
- info: "bg-info/10 text-info",
23
- warning: "bg-warning/10 text-warning",
24
- destructive: "bg-destructive/10 text-destructive"
25
- }, N = {
26
- sm: "size-4",
27
- md: "size-5",
28
- lg: "size-6"
29
- }, v = (t) => t === "up" ? "↑" : t === "down" ? "↓" : "", C = (t) => t === "up" ? "text-green-600" : t === "down" ? "text-red-600" : "text-muted-foreground", D = ({ title: t, value: s, unit: n, subtitle: a, icon: o, iconSize: x = "md", trend: i, trendValue: d, color: u = "blue", children: c }) => {
30
- const f = o;
31
- return /* @__PURE__ */ e(l, { className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300", children: /* @__PURE__ */ r(g, { className: "pt-6", children: [
32
- /* @__PURE__ */ r("div", { className: "flex items-start justify-between", children: [
33
- /* @__PURE__ */ r("div", { children: [
34
- /* @__PURE__ */ e(m, { className: "text-sm font-medium text-muted-foreground", children: t }),
35
- /* @__PURE__ */ r("div", { className: "flex items-baseline space-x-2 mt-1", children: [
36
- /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-card-foreground", children: typeof s == "number" ? s.toFixed(1) : s }),
37
- n && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground font-medium", children: n })
38
- ] }),
39
- a && /* @__PURE__ */ e("div", { className: "mt-1 text-xs text-muted-foreground", children: a }),
40
- i && d && /* @__PURE__ */ r("div", { className: `flex items-center space-x-1 mt-2 text-xs ${C(i)}`, children: [
41
- /* @__PURE__ */ e("span", { children: v(i) }),
42
- /* @__PURE__ */ e("span", { children: d })
43
- ] })
44
- ] }),
45
- /* @__PURE__ */ e("div", { className: `p-2 rounded-control ${w[u]} shadow-lg`, children: /* @__PURE__ */ e(f, { className: N[x] }) })
46
- ] }),
47
- c && /* @__PURE__ */ e("div", { className: "mt-4", children: c })
48
- ] }) });
49
- };
50
- export {
51
- k as D,
52
- D as M
53
- };