@krosoft/react 0.0.95 → 0.0.97
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/{AppSubTitle-BpBamEcm.js → AppSubTitle-Bc8utqt7.js} +1 -1
- package/dist/{AppTitle-eMxmvBxB.js → AppTitle-QlMMlpbQ.js} +8 -8
- package/dist/{AppVerticalTabs-CVukFn4d.js → AppVerticalTabs--Kb9OFa4.js} +29 -30
- package/dist/{ConfirmationDialog-D7W5xkwQ.js → ConfirmationDialog-Bv-O4ui4.js} +43 -43
- package/dist/{DataTable-C5t09hPv.js → DataTable-DWGao3TY.js} +28 -28
- package/dist/{ErrorAlert-BITMD2I5.js → ErrorAlert-DpOsMww8.js} +1 -1
- package/dist/LoadingState-M_TV_5Ui.js +13 -0
- package/dist/MetricCard-BjTGW3b2.js +103 -0
- package/dist/{SearchInput-Cez8b7gL.js → SearchInput-CKG1_3iS.js} +228 -212
- package/dist/{TableFilter-ChclLTH1.js → TableFilter-oBrNz-v_.js} +44 -44
- package/dist/alert-sHZy6NHC.js +30 -0
- package/dist/components/core/cards/CardSkeleton.d.ts.map +1 -0
- package/dist/components/core/cards/CardsSkeleton.d.ts.map +1 -0
- package/dist/components/core/cards/DashboardCard.d.ts +10 -0
- package/dist/components/core/cards/DashboardCard.d.ts.map +1 -0
- package/dist/components/core/cards/index.d.ts +4 -1
- package/dist/components/core/cards/index.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +7 -4
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/index.js +63 -62
- package/dist/components/core/inputs/SearchableSelect.d.ts +3 -1
- package/dist/components/core/inputs/SearchableSelect.d.ts.map +1 -1
- package/dist/components/core/inputs/index.js +1 -1
- package/dist/components/core/layouts/index.js +2 -2
- package/dist/components/core/states/index.d.ts +0 -2
- package/dist/components/core/states/index.d.ts.map +1 -1
- package/dist/components/core/states/index.js +5 -7
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +284 -283
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/command.d.ts +12 -12
- package/dist/components/ui/index.js +187 -187
- package/dist/{toaster-DeSyPrhi.js → toaster-B09ou5gw.js} +24 -24
- package/dist/{toggle-group-CrQymn4l.js → toggle-group-iLf3T7oV.js} +5850 -5832
- package/package.json +1 -1
- package/dist/LoadingState-COf3KhOP.js +0 -29
- package/dist/MetricCard-BkOvTc3_.js +0 -85
- package/dist/card-Bn3Y7DHQ.js +0 -48
- package/dist/components/core/states/CardSkeleton.d.ts.map +0 -1
- package/dist/components/core/states/CardsSkeleton.d.ts.map +0 -1
- /package/dist/components/core/{states → cards}/CardSkeleton.d.ts +0 -0
- /package/dist/components/core/{states → cards}/CardsSkeleton.d.ts +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { I as l, M as p, J as m, N as x } from "./toggle-group-iLf3T7oV.js";
|
|
3
|
+
import { c } from "./index-gWiv5-6R.js";
|
|
4
|
+
import { useTranslation as f } from "react-i18next";
|
|
5
|
+
import { formatNumber as b } from "@krosoft/core/helpers";
|
|
6
|
+
import "./alert-sHZy6NHC.js";
|
|
7
|
+
import "./tooltip-CAu4DEhc.js";
|
|
8
|
+
import "./select-zzSnHs9S.js";
|
|
9
|
+
import "next-themes";
|
|
10
|
+
import "react";
|
|
11
|
+
const v = () => /* @__PURE__ */ s(l, { className: "animate-pulse", children: [
|
|
12
|
+
/* @__PURE__ */ e(p, { children: /* @__PURE__ */ e("div", { className: "h-6 bg-muted rounded w-1/4" }) }),
|
|
13
|
+
/* @__PURE__ */ e(m, { children: /* @__PURE__ */ s("div", { className: "space-y-2", children: [
|
|
14
|
+
/* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded" }),
|
|
15
|
+
/* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded w-3/4" })
|
|
16
|
+
] }) })
|
|
17
|
+
] }), H = ({ count: t = 1 }) => /* @__PURE__ */ e("div", { className: "grid gap-6", style: { gridTemplateColumns: `repeat(${t}, minmax(0, 1fr))` }, children: Array.from({ length: t }).map((r, a) => /* @__PURE__ */ e(v, {}, a)) }), J = ({ titleKey: t, icon: r, className: a, children: i }) => {
|
|
18
|
+
const { t: n } = f();
|
|
19
|
+
return /* @__PURE__ */ s(l, { className: c("bg-gray-50 dark:bg-gray-950", a), children: [
|
|
20
|
+
/* @__PURE__ */ e(p, { children: /* @__PURE__ */ s(x, { className: "flex items-center gap-2", children: [
|
|
21
|
+
r && /* @__PURE__ */ e(r, { className: "mr-2 size-4" }),
|
|
22
|
+
/* @__PURE__ */ e("span", { children: n(t) })
|
|
23
|
+
] }) }),
|
|
24
|
+
/* @__PURE__ */ e(m, { children: i })
|
|
25
|
+
] });
|
|
26
|
+
}, C = ({
|
|
27
|
+
titleKey: t,
|
|
28
|
+
value: r,
|
|
29
|
+
valueClassName: a,
|
|
30
|
+
icon: i,
|
|
31
|
+
iconClassName: n,
|
|
32
|
+
description: g,
|
|
33
|
+
descriptionClassName: d,
|
|
34
|
+
onClick: o
|
|
35
|
+
}) => {
|
|
36
|
+
const { t: u } = f();
|
|
37
|
+
return /* @__PURE__ */ s(l, { className: c(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
|
|
38
|
+
/* @__PURE__ */ s(p, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
|
|
39
|
+
/* @__PURE__ */ e(x, { className: "text-sm font-medium", children: u(t) }),
|
|
40
|
+
/* @__PURE__ */ e(i, { className: c("size-6 text-muted-foreground", n) })
|
|
41
|
+
] }),
|
|
42
|
+
/* @__PURE__ */ s(m, { children: [
|
|
43
|
+
/* @__PURE__ */ e("div", { className: c("text-2xl font-bold", a), children: b(r) }),
|
|
44
|
+
/* @__PURE__ */ e("p", { className: c("text-xs text-muted-foreground", d), children: g })
|
|
45
|
+
] })
|
|
46
|
+
] });
|
|
47
|
+
}, _ = ({ stats: t }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: t.map((r) => /* @__PURE__ */ e(
|
|
48
|
+
C,
|
|
49
|
+
{
|
|
50
|
+
titleKey: r.titleKey,
|
|
51
|
+
value: r.value,
|
|
52
|
+
valueClassName: r.valueClassName,
|
|
53
|
+
icon: r.icon,
|
|
54
|
+
iconClassName: r.iconClassName,
|
|
55
|
+
description: r.description,
|
|
56
|
+
descriptionClassName: r.descriptionClassName,
|
|
57
|
+
onClick: r.onClick
|
|
58
|
+
},
|
|
59
|
+
r.titleKey
|
|
60
|
+
)) }), w = {
|
|
61
|
+
blue: "bg-gradient-to-br from-blue-500 to-cyan-500 text-white",
|
|
62
|
+
green: "bg-gradient-to-br from-green-500 to-emerald-500 text-white",
|
|
63
|
+
orange: "bg-gradient-to-br from-orange-500 to-yellow-500 text-white",
|
|
64
|
+
red: "bg-gradient-to-br from-red-500 to-pink-500 text-white",
|
|
65
|
+
purple: "bg-gradient-to-br from-purple-500 to-indigo-500 text-white",
|
|
66
|
+
accent: "bg-accent/10 text-accent",
|
|
67
|
+
success: "bg-success/10 text-success",
|
|
68
|
+
info: "bg-info/10 text-info",
|
|
69
|
+
warning: "bg-warning/10 text-warning",
|
|
70
|
+
destructive: "bg-destructive/10 text-destructive"
|
|
71
|
+
}, y = {
|
|
72
|
+
sm: "size-4",
|
|
73
|
+
md: "size-5",
|
|
74
|
+
lg: "size-6"
|
|
75
|
+
}, z = (t) => t === "up" ? "↑" : t === "down" ? "↓" : "", K = (t) => t === "up" ? "text-green-600" : t === "down" ? "text-red-600" : "text-muted-foreground", q = ({ title: t, value: r, unit: a, subtitle: i, icon: n, iconSize: g = "md", trend: d, trendValue: o, color: u = "blue", children: h }) => {
|
|
76
|
+
const N = n;
|
|
77
|
+
return /* @__PURE__ */ e(l, { className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300", children: /* @__PURE__ */ s(m, { className: "pt-6", children: [
|
|
78
|
+
/* @__PURE__ */ s("div", { className: "flex items-start justify-between", children: [
|
|
79
|
+
/* @__PURE__ */ s("div", { children: [
|
|
80
|
+
/* @__PURE__ */ e(x, { className: "text-sm font-medium text-muted-foreground", children: t }),
|
|
81
|
+
/* @__PURE__ */ s("div", { className: "flex items-baseline space-x-2 mt-1", children: [
|
|
82
|
+
/* @__PURE__ */ e("div", { className: "text-2xl font-bold text-card-foreground", children: typeof r == "number" ? r.toFixed(1) : r }),
|
|
83
|
+
a && /* @__PURE__ */ e("div", { className: "text-sm text-muted-foreground font-medium", children: a })
|
|
84
|
+
] }),
|
|
85
|
+
i && /* @__PURE__ */ e("div", { className: "mt-1 text-xs text-muted-foreground", children: i }),
|
|
86
|
+
d && o && /* @__PURE__ */ s("div", { className: `flex items-center space-x-1 mt-2 text-xs ${K(d)}`, children: [
|
|
87
|
+
/* @__PURE__ */ e("span", { children: z(d) }),
|
|
88
|
+
/* @__PURE__ */ e("span", { children: o })
|
|
89
|
+
] })
|
|
90
|
+
] }),
|
|
91
|
+
/* @__PURE__ */ e("div", { className: `p-2 rounded-lg ${w[u]} shadow-lg`, children: /* @__PURE__ */ e(N, { className: y[g] }) })
|
|
92
|
+
] }),
|
|
93
|
+
h && /* @__PURE__ */ e("div", { className: "mt-4", children: h })
|
|
94
|
+
] }) });
|
|
95
|
+
};
|
|
96
|
+
export {
|
|
97
|
+
v as C,
|
|
98
|
+
J as D,
|
|
99
|
+
C as K,
|
|
100
|
+
q as M,
|
|
101
|
+
H as a,
|
|
102
|
+
_ as b
|
|
103
|
+
};
|