@krosoft/react 0.0.241 → 0.0.243

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.
@@ -41,9 +41,16 @@ var d = ({ titleKey: a, icon: o, className: u, children: d }) => {
41
41
  children: g
42
42
  })] }) })]
43
43
  });
44
- }, p = ({ stats: e, isLoading: t, error: n }) => /* @__PURE__ */ s("div", {
45
- className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4",
46
- children: e.map((e) => /* @__PURE__ */ s(f, {
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-4 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: t,
56
- error: n
62
+ isLoading: r,
63
+ error: i
57
64
  }, e.titleKey))
58
- }), m = {
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
- }, h = {
76
+ }, _ = {
70
77
  sm: "size-4",
71
78
  md: "size-5",
72
79
  lg: "size-6"
73
- }, g = (e) => e === "up" ? "↑" : e === "down" ? "↓" : "", _ = (e) => e === "up" ? "text-green-600" : e === "down" ? "text-red-600" : "text-muted-foreground", v = ({ title: e, value: n, unit: a, subtitle: o, icon: l, iconSize: u = "md", trend: d, trendValue: f, color: p = "blue", children: v }) => {
74
- let y = l;
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 ${_(d)}`,
102
- children: [/* @__PURE__ */ s("span", { children: g(d) }), /* @__PURE__ */ s("span", { children: f })]
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 ${m[p]} shadow-lg`,
106
- children: /* @__PURE__ */ s(y, { className: h[u] })
112
+ className: `p-2 rounded-control ${g[p]} shadow-lg`,
113
+ children: /* @__PURE__ */ s(h, { className: _[u] })
107
114
  })]
108
- }), v && /* @__PURE__ */ s("div", {
115
+ }), m && /* @__PURE__ */ s("div", {
109
116
  className: "mt-4",
110
- children: v
117
+ children: m
111
118
  })]
112
119
  })
113
120
  });
114
- }, y = () => /* @__PURE__ */ c(i, {
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
- }), b = ({ count: e = 1 }) => /* @__PURE__ */ s("div", {
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(y, {}, t))
130
+ children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ s(x, {}, t))
124
131
  });
125
132
  //#endregion
126
- export { f as a, p as i, y as n, d as o, v as r, b as t };
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;AAC1B,OAAO,EAAE,YAAY,EAAW,MAAM,WAAW,CAAC;AAElD,UAAU,aAAa;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,GAAI,6BAA6B,aAAa,KAAG,KAAK,CAAC,GAAG,CAAC,OAkB/E,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-Cta6x49J.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../../../cards-Bkwz7WQM.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-Cta6x49J.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../../cards-Bkwz7WQM.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";
@@ -1,4 +1,4 @@
1
- import { i as e, t } from "../../../cards-Cta6x49J.js";
1
+ import { i as e, t } from "../../../cards-Bkwz7WQM.js";
2
2
  import "../../../ui-CiX0E_bn.js";
3
3
  import { s as n } from "../../../tooltip-B2dzyfs9.js";
4
4
  import { t as r } from "../../../AppActions-C_0YI75w.js";
@@ -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-Cta6x49J.js";
2
+ import { a as f, i as p, n as m, o as h, r as g, t as _ } from "../cards-Bkwz7WQM.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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.241",
3
+ "version": "0.0.243",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {