@krosoft/react 0.0.241 → 0.0.242
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/{cards-Cta6x49J.js → cards-DoK8Dh1-.js} +26 -19
- package/dist/components/core/cards/KpiCards.d.ts +3 -1
- package/dist/components/core/cards/KpiCards.d.ts.map +1 -1
- package/dist/components/core/cards/index.js +1 -1
- package/dist/components/core/index.js +1 -1
- package/dist/components/core/layouts/index.js +1 -1
- package/dist/components/index.js +1 -1
- package/package.json +1 -1
|
@@ -41,9 +41,16 @@ var d = ({ titleKey: a, icon: o, className: u, children: d }) => {
|
|
|
41
41
|
children: g
|
|
42
42
|
})] }) })]
|
|
43
43
|
});
|
|
44
|
-
}, p =
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
}, p = {
|
|
45
|
+
1: "lg:grid-cols-1",
|
|
46
|
+
2: "lg:grid-cols-2",
|
|
47
|
+
3: "lg:grid-cols-3",
|
|
48
|
+
4: "lg:grid-cols-4",
|
|
49
|
+
5: "lg:grid-cols-5",
|
|
50
|
+
6: "lg:grid-cols-6"
|
|
51
|
+
}, m = 4, h = ({ stats: t, columns: n = m, isLoading: r, error: i }) => /* @__PURE__ */ s("div", {
|
|
52
|
+
className: e("grid gap-6 md:grid-cols-2", p[n] ?? p[m]),
|
|
53
|
+
children: t.map((e) => /* @__PURE__ */ s(f, {
|
|
47
54
|
titleKey: e.titleKey,
|
|
48
55
|
value: e.value,
|
|
49
56
|
valueClassName: e.valueClassName,
|
|
@@ -52,10 +59,10 @@ var d = ({ titleKey: a, icon: o, className: u, children: d }) => {
|
|
|
52
59
|
description: e.description,
|
|
53
60
|
descriptionClassName: e.descriptionClassName,
|
|
54
61
|
onClick: e.onClick,
|
|
55
|
-
isLoading:
|
|
56
|
-
error:
|
|
62
|
+
isLoading: r,
|
|
63
|
+
error: i
|
|
57
64
|
}, e.titleKey))
|
|
58
|
-
}),
|
|
65
|
+
}), g = {
|
|
59
66
|
blue: "bg-gradient-to-br from-blue-500 to-cyan-500 text-white",
|
|
60
67
|
green: "bg-gradient-to-br from-green-500 to-emerald-500 text-white",
|
|
61
68
|
orange: "bg-gradient-to-br from-orange-500 to-yellow-500 text-white",
|
|
@@ -66,12 +73,12 @@ var d = ({ titleKey: a, icon: o, className: u, children: d }) => {
|
|
|
66
73
|
info: "bg-info/10 text-info",
|
|
67
74
|
warning: "bg-warning/10 text-warning",
|
|
68
75
|
destructive: "bg-destructive/10 text-destructive"
|
|
69
|
-
},
|
|
76
|
+
}, _ = {
|
|
70
77
|
sm: "size-4",
|
|
71
78
|
md: "size-5",
|
|
72
79
|
lg: "size-6"
|
|
73
|
-
},
|
|
74
|
-
let
|
|
80
|
+
}, v = (e) => e === "up" ? "↑" : e === "down" ? "↓" : "", y = (e) => e === "up" ? "text-green-600" : e === "down" ? "text-red-600" : "text-muted-foreground", b = ({ title: e, value: n, unit: a, subtitle: o, icon: l, iconSize: u = "md", trend: d, trendValue: f, color: p = "blue", children: m }) => {
|
|
81
|
+
let h = l;
|
|
75
82
|
return /* @__PURE__ */ s(i, {
|
|
76
83
|
className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300",
|
|
77
84
|
children: /* @__PURE__ */ c(t, {
|
|
@@ -98,29 +105,29 @@ var d = ({ titleKey: a, icon: o, className: u, children: d }) => {
|
|
|
98
105
|
children: o
|
|
99
106
|
}),
|
|
100
107
|
d && f && /* @__PURE__ */ c("div", {
|
|
101
|
-
className: `flex items-center space-x-1 mt-2 text-xs ${
|
|
102
|
-
children: [/* @__PURE__ */ s("span", { children:
|
|
108
|
+
className: `flex items-center space-x-1 mt-2 text-xs ${y(d)}`,
|
|
109
|
+
children: [/* @__PURE__ */ s("span", { children: v(d) }), /* @__PURE__ */ s("span", { children: f })]
|
|
103
110
|
})
|
|
104
111
|
] }), /* @__PURE__ */ s("div", {
|
|
105
|
-
className: `p-2 rounded-control ${
|
|
106
|
-
children: /* @__PURE__ */ s(
|
|
112
|
+
className: `p-2 rounded-control ${g[p]} shadow-lg`,
|
|
113
|
+
children: /* @__PURE__ */ s(h, { className: _[u] })
|
|
107
114
|
})]
|
|
108
|
-
}),
|
|
115
|
+
}), m && /* @__PURE__ */ s("div", {
|
|
109
116
|
className: "mt-4",
|
|
110
|
-
children:
|
|
117
|
+
children: m
|
|
111
118
|
})]
|
|
112
119
|
})
|
|
113
120
|
});
|
|
114
|
-
},
|
|
121
|
+
}, x = () => /* @__PURE__ */ c(i, {
|
|
115
122
|
className: "animate-pulse",
|
|
116
123
|
children: [/* @__PURE__ */ s(n, { children: /* @__PURE__ */ s("div", { className: "h-6 bg-muted rounded w-1/4" }) }), /* @__PURE__ */ s(t, { children: /* @__PURE__ */ c("div", {
|
|
117
124
|
className: "space-y-2",
|
|
118
125
|
children: [/* @__PURE__ */ s("div", { className: "h-4 bg-muted rounded" }), /* @__PURE__ */ s("div", { className: "h-4 bg-muted rounded w-3/4" })]
|
|
119
126
|
}) })]
|
|
120
|
-
}),
|
|
127
|
+
}), S = ({ count: e = 1 }) => /* @__PURE__ */ s("div", {
|
|
121
128
|
className: "grid gap-6",
|
|
122
129
|
style: { gridTemplateColumns: `repeat(${e}, minmax(0, 1fr))` },
|
|
123
|
-
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ s(
|
|
130
|
+
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ s(x, {}, t))
|
|
124
131
|
});
|
|
125
132
|
//#endregion
|
|
126
|
-
export { f as a,
|
|
133
|
+
export { f as a, h as i, x as n, d as o, b as r, S as t };
|
|
@@ -2,9 +2,11 @@ import React from "react";
|
|
|
2
2
|
import { KpiCardProps } from "./KpiCard";
|
|
3
3
|
interface KpiCardsProps {
|
|
4
4
|
stats: KpiCardProps[];
|
|
5
|
+
/** Nombre de colonnes affichées au point de rupture `lg` (1 à 6). Par défaut 4. */
|
|
6
|
+
columns?: number;
|
|
5
7
|
isLoading?: boolean;
|
|
6
8
|
error?: string | null;
|
|
7
9
|
}
|
|
8
|
-
export declare const KpiCards: ({ stats, isLoading, error }: KpiCardsProps) => React.JSX.Element;
|
|
10
|
+
export declare const KpiCards: ({ stats, columns, isLoading, error }: KpiCardsProps) => React.JSX.Element;
|
|
9
11
|
export {};
|
|
10
12
|
//# sourceMappingURL=KpiCards.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KpiCards.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/KpiCards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KpiCards.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/KpiCards.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAW,MAAM,WAAW,CAAC;AAkBlD,UAAU,aAAa;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,mFAAmF;IACnF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,GAAI,sCAAwD,aAAa,KAAG,KAAK,CAAC,GAAG,CAAC,OAkB1G,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../../../cards-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../../cards-DoK8Dh1-.js";
|
|
2
2
|
export { r as DashboardCard, e as KpiCard, t as KpiCards, i as MetricCard, n as SkeletonCard, a as SkeletonCards };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "../../cards-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "../../cards-DoK8Dh1-.js";
|
|
2
2
|
import { I as o } from "../../ui-CiX0E_bn.js";
|
|
3
3
|
import { A as s, D as c, E as l, F as u, M as d, N as f, O as p, P as m, j as h, k as g } from "../../sheet-CRrYTZrl.js";
|
|
4
4
|
import { a as _, c as v, i as y, n as b, o as x, r as S, s as C, t as w } from "../../charts-CXhVUqLH.js";
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "../chart-Dq3AIrue.js";
|
|
2
|
-
import { a as f, i as p, n as m, o as h, r as g, t as _ } from "../cards-
|
|
2
|
+
import { a as f, i as p, n as m, o as h, r as g, t as _ } from "../cards-DoK8Dh1-.js";
|
|
3
3
|
import { $ as v, $t as y, A as b, An as x, At as S, B as C, Bn as w, Bt as T, C as E, Cn as D, Ct as O, D as k, Dn as A, Dt as j, E as M, En as N, Et as P, F, Fn as I, Ft as L, G as R, Gn as z, Gt as B, H as V, Hn as H, Ht as U, I as W, In as G, It as K, J as q, Jn as J, Jt as Y, K as X, Kn as Z, Kt as Q, L as $, Ln as ee, Lt as te, M as ne, Mn as re, Mt as ie, N as ae, Nn as oe, Nt as se, O as ce, On as le, Ot as ue, P as de, Pn as fe, Pt as pe, Q as me, Qn as he, Qt as ge, R as _e, Rn as ve, Rt as ye, S as be, Sn as xe, St as Se, T as Ce, Tn as we, Tt as Te, U as Ee, Un as De, Ut as Oe, V as ke, Vn as Ae, Vt as je, W as Me, Wn as Ne, Wt as Pe, X as Fe, Xn as Ie, Xt as Le, Y as Re, Yn as ze, Yt as Be, Z as Ve, Zn as He, Zt as Ue, _ as We, _n as Ge, _t as Ke, a as qe, an as Je, at as Ye, b as Xe, bn as Ze, bt as Qe, c as $e, cn as et, ct as tt, d as nt, dn as rt, dt as it, en as at, et as ot, f as st, fn as ct, ft as lt, g as ut, gn as dt, gt as ft, h as pt, hn as mt, ht, i as gt, in as _t, it as vt, j as yt, jn as bt, jt as xt, k as St, kn as Ct, kt as wt, l as Tt, ln as Et, lt as Dt, m as Ot, mn as kt, mt as At, n as jt, nn as Mt, nt as Nt, o as Pt, on as Ft, ot as It, p as Lt, pn as Rt, pt as zt, q as Bt, qn as Vt, qt as Ht, r as Ut, rn as Wt, rt as Gt, s as Kt, sn as qt, st as Jt, t as Yt, tn as Xt, tt as Zt, u as Qt, un as $t, ut as en, v as tn, vn as nn, vt as rn, w as an, wn as on, wt as sn, x as cn, xn as ln, xt as un, y as dn, yn as fn, yt as pn, z as mn, zn as hn, zt as gn } from "../ui-CiX0E_bn.js";
|
|
4
4
|
import { n as _n, r as vn, t as yn } from "../alert-REQGK9bR.js";
|
|
5
5
|
import { a as bn, c as xn, i as Sn, n as Cn, o as wn, r as Tn, s as En, t as Dn } from "../tooltip-B2dzyfs9.js";
|