@krosoft/react 0.0.143 → 0.0.144

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.
@@ -15,7 +15,7 @@ import "./select-MWzbMBAS.js";
15
15
  import "next-themes";
16
16
  import "sonner";
17
17
  import "react";
18
- import { b as i, a as p } from "./SkeletonCards-BPIVRCOE.js";
18
+ import { b as i, a as p } from "./SkeletonCards-0NJcJ-6S.js";
19
19
  import { E as s } from "./ErrorState-vU8d4CwD.js";
20
20
  const h = ({ stats: o, isLoading: m, error: t }) => m ? /* @__PURE__ */ r(i, { count: 4 }) : t ? /* @__PURE__ */ r(s, { message: t.message }) : /* @__PURE__ */ r(p, { stats: o });
21
21
  export {
@@ -0,0 +1,74 @@
1
+ import { jsxs as s, jsx as e, Fragment as l } from "react/jsx-runtime";
2
+ import { formatNumber as v } from "@krosoft/core/helpers";
3
+ import { useTranslation as g } from "react-i18next";
4
+ import { c as t } from "./tailwind.helper-B6yFEsav.js";
5
+ import { J as n, N as p, O as b, K as u } from "./toggle-group-BASGy2mQ.js";
6
+ import "./alert-B78CiTYe.js";
7
+ import "@radix-ui/react-aspect-ratio";
8
+ import "./tooltip-BWyFpIxo.js";
9
+ import "@radix-ui/react-collapsible";
10
+ import "./sheet-Gop1cIaU.js";
11
+ import "lucide-react";
12
+ import "react-resizable-panels";
13
+ import "./select-MWzbMBAS.js";
14
+ import { S as c } from "./skeleton-8o8eJd3P.js";
15
+ import "next-themes";
16
+ import "sonner";
17
+ import "react";
18
+ const y = ({
19
+ titleKey: a,
20
+ value: m,
21
+ valueClassName: i,
22
+ icon: r,
23
+ iconClassName: N,
24
+ description: h,
25
+ descriptionClassName: x,
26
+ onClick: o,
27
+ isLoading: f,
28
+ error: d
29
+ }) => {
30
+ const { t: C } = g();
31
+ return /* @__PURE__ */ s(n, { className: t(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
32
+ /* @__PURE__ */ s(p, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
33
+ /* @__PURE__ */ e(b, { className: "text-sm font-medium", children: C(a) }),
34
+ /* @__PURE__ */ e(r, { className: t("size-6 text-muted-foreground", N) })
35
+ ] }),
36
+ /* @__PURE__ */ e(u, { children: f ? /* @__PURE__ */ s(l, { children: [
37
+ /* @__PURE__ */ e(c, { className: "h-8 w-24 mb-1" }),
38
+ /* @__PURE__ */ e(c, { className: "h-3 w-32" })
39
+ ] }) : d ? /* @__PURE__ */ s(l, { children: [
40
+ /* @__PURE__ */ e("div", { className: "text-2xl font-bold text-destructive", children: "—" }),
41
+ /* @__PURE__ */ e("p", { className: "text-xs text-destructive", children: d })
42
+ ] }) : /* @__PURE__ */ s(l, { children: [
43
+ /* @__PURE__ */ e("div", { className: t("text-2xl font-bold", i), children: v(m) }),
44
+ /* @__PURE__ */ e("p", { className: t("text-xs text-muted-foreground", x), children: h })
45
+ ] }) })
46
+ ] });
47
+ }, G = ({ stats: a, isLoading: m, error: i }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: a.map((r) => /* @__PURE__ */ e(
48
+ y,
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
+ isLoading: m,
59
+ error: i
60
+ },
61
+ r.titleKey
62
+ )) }), K = () => /* @__PURE__ */ s(n, { className: "animate-pulse", children: [
63
+ /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e("div", { className: "h-6 bg-muted rounded w-1/4" }) }),
64
+ /* @__PURE__ */ e(u, { children: /* @__PURE__ */ s("div", { className: "space-y-2", children: [
65
+ /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded" }),
66
+ /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded w-3/4" })
67
+ ] }) })
68
+ ] }), I = ({ count: a = 1 }) => /* @__PURE__ */ e("div", { className: "grid gap-6", style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` }, children: Array.from({ length: a }).map((m, i) => /* @__PURE__ */ e(K, {}, i)) });
69
+ export {
70
+ y as K,
71
+ K as S,
72
+ G as a,
73
+ I as b
74
+ };
@@ -8,6 +8,8 @@ export interface KpiCardProps {
8
8
  description?: string;
9
9
  descriptionClassName?: string;
10
10
  onClick?: () => void;
11
+ isLoading?: boolean;
12
+ error?: string | null;
11
13
  }
12
- export declare const KpiCard: ({ titleKey, value, valueClassName, icon: Icon, iconClassName, description, descriptionClassName, onClick, }: KpiCardProps) => React.ReactElement;
14
+ export declare const KpiCard: ({ titleKey, value, valueClassName, icon: Icon, iconClassName, description, descriptionClassName, onClick, isLoading, error, }: KpiCardProps) => React.ReactElement;
13
15
  //# sourceMappingURL=KpiCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"KpiCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/KpiCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,OAAO,GAAI,6GASrB,YAAY,KAAG,KAAK,CAAC,YAevB,CAAC"}
1
+ {"version":3,"file":"KpiCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/KpiCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,eAAO,MAAM,OAAO,GAAI,+HAWrB,YAAY,KAAG,KAAK,CAAC,YA6BvB,CAAC"}
@@ -1,7 +1,10 @@
1
+ import React from "react";
1
2
  import { KpiCardProps } from "./KpiCard";
2
3
  interface KpiCardsProps {
3
4
  stats: KpiCardProps[];
5
+ isLoading?: boolean;
6
+ error?: string | null;
4
7
  }
5
- export declare const KpiCards: ({ stats }: KpiCardsProps) => React.JSX.Element;
8
+ export declare const KpiCards: ({ stats, isLoading, error }: KpiCardsProps) => React.JSX.Element;
6
9
  export {};
7
10
  //# 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,EAAE,YAAY,EAAW,MAAM,WAAW,CAAC;AAElD,UAAU,aAAa;IACrB,KAAK,EAAE,YAAY,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,QAAQ,GAAI,WAAW,aAAa,KAAG,KAAK,CAAC,GAAG,CAAC,OAgB7D,CAAC"}
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,5 +1,5 @@
1
1
  import { D as s, M as d } from "../../../MetricCard-D-qPl6zh.js";
2
- import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-BPIVRCOE.js";
2
+ import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-0NJcJ-6S.js";
3
3
  export {
4
4
  s as DashboardCard,
5
5
  o as KpiCard,
@@ -1,5 +1,5 @@
1
1
  import { D as r, M as o } from "../../MetricCard-D-qPl6zh.js";
2
- import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-BPIVRCOE.js";
2
+ import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-0NJcJ-6S.js";
3
3
  import { A as m, C as d, F as f } from "../../ConfirmationDialog-DJcxTNTk.js";
4
4
  import { D, a as T, b as n, c, d as x, e as A, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-BASGy2mQ.js";
5
5
  import { A as k, a as I, F as K, S as v, T as E } from "../../TableFilter-rjiss-d9.js";
@@ -10,7 +10,7 @@ import { M as j } from "../../MultiSelect-DblSHEsg.js";
10
10
  import { A as w } from "../../AppActions-DCaejx-3.js";
11
11
  import { A as J } from "../../AppSubTitle-BNd5_q0i.js";
12
12
  import { A as U } from "../../AppTitle-uboDuil4.js";
13
- import { K as X } from "../../KpiCardsLayout-DDR49Qqh.js";
13
+ import { K as X } from "../../KpiCardsLayout-BVN5HgQ7.js";
14
14
  import { S as Z, a as _, b as $, T as aa } from "../../Topbar-DMyjbOTI.js";
15
15
  import { E as ra } from "../../ErrorAlert-DH1onuyt.js";
16
16
  import { E as sa } from "../../ErrorState-vU8d4CwD.js";
@@ -1,7 +1,7 @@
1
1
  import { A as r } from "../../../AppActions-DCaejx-3.js";
2
2
  import { A } from "../../../AppSubTitle-BNd5_q0i.js";
3
3
  import { A as e } from "../../../AppTitle-uboDuil4.js";
4
- import { K as f } from "../../../KpiCardsLayout-DDR49Qqh.js";
4
+ import { K as f } from "../../../KpiCardsLayout-BVN5HgQ7.js";
5
5
  export {
6
6
  r as AppActions,
7
7
  A as AppSubTitle,
@@ -1,5 +1,5 @@
1
1
  import { D as o, M as r } from "../MetricCard-D-qPl6zh.js";
2
- import { K as t, a as n, S as i, b as l } from "../SkeletonCards-BPIVRCOE.js";
2
+ import { K as t, a as n, S as i, b as l } from "../SkeletonCards-0NJcJ-6S.js";
3
3
  import { A as p, C as u, F as g } from "../ConfirmationDialog-DJcxTNTk.js";
4
4
  import { A as m, j as C, k as S, l as T, m as c, n as D, o as M, p as x, q as A, r as I, s as h, t as P, u as f, v as w, w as v, x as F, B as L, y as B, z as G, C as R, E as k, F as H, G as N, H as y, I as E, J as O, K as V, L as K, M as z, N as U, O as j, Q as q, R as J, S as Q, T as W, U as X, V as Y, W as Z, X as _, Y as $, Z as aa, _ as ea, $ as oa, a0 as ra, a1 as sa, a2 as ta, a3 as na, a4 as ia, a5 as la, a6 as ba, a7 as pa, a8 as ua, a9 as ga, aa as da, ab as ma, ac as Ca, ad as Sa, ae as Ta, af as ca, ag as Da, ah as Ma, ai as xa, aj as Aa, ak as Ia, al as ha, am as Pa, an as fa, D as wa, a as va, b as Fa, c as La, d as Ba, e as Ga, f as Ra, g as ka, h as Ha, i as Na, ao as ya, ap as Ea, aq as Oa, ar as Va, as as Ka, at as za, au as Ua, av as ja, aw as qa, ax as Ja, ay as Qa, az as Wa, aA as Xa, aB as Ya, aC as Za, aD as _a, aE as $a, aF as ae, aG as ee, aH as oe, aI as re, aJ as se, aK as te, aL as ne, aM as ie, aN as le, aO as be, aP as pe, aQ as ue, aR as ge, aS as de, aT as me, aU as Ce, aV as Se, aW as Te, aX as ce, aY as De, aZ as Me, a_ as xe, a$ as Ae, b0 as Ie, b1 as he, b2 as Pe, b3 as fe, b4 as we, b5 as ve, b6 as Fe, b7 as Le, b8 as Be, b9 as Ge, ba as Re, bb as ke, bc as He, bd as Ne, be as ye, bf as Ee, bg as Oe, bh as Ve, bi as Ke, bj as ze, bk as Ue, bl as je, bm as qe, bn as Je, bo as Qe, bp as We, bq as Xe, br as Ye, bs as Ze, bt as _e, bu as $e, bv as ao, bw as eo, bx as oo, P as ro, by as so, bz as to, bA as no, bB as io, bC as lo, bD as bo, bE as po, bF as uo, bG as go, bH as mo, bI as Co, bJ as So, bK as To, bL as co, bM as Do, bN as Mo, bO as xo, bP as Ao, bQ as Io, bR as ho, bS as Po, bT as fo, bU as wo, bV as vo, bW as Fo, bX as Lo, bY as Bo, bZ as Go, b_ as Ro, b$ as ko, c0 as Ho, c1 as No, c2 as yo, c3 as Eo } from "../toggle-group-BASGy2mQ.js";
5
5
  import { A as Vo, a as Ko, F as zo, S as Uo, T as jo } from "../TableFilter-rjiss-d9.js";
@@ -10,7 +10,7 @@ import { M as er } from "../MultiSelect-DblSHEsg.js";
10
10
  import { A as rr } from "../AppActions-DCaejx-3.js";
11
11
  import { A as tr } from "../AppSubTitle-BNd5_q0i.js";
12
12
  import { A as ir } from "../AppTitle-uboDuil4.js";
13
- import { K as br } from "../KpiCardsLayout-DDR49Qqh.js";
13
+ import { K as br } from "../KpiCardsLayout-BVN5HgQ7.js";
14
14
  import { S as ur, a as gr, b as dr, T as mr } from "../Topbar-DMyjbOTI.js";
15
15
  import { E as Sr } from "../ErrorAlert-DH1onuyt.js";
16
16
  import { E as cr } from "../ErrorState-vU8d4CwD.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.143",
3
+ "version": "0.0.144",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,63 +0,0 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { formatNumber as h } from "@krosoft/core/helpers";
3
- import { useTranslation as C } from "react-i18next";
4
- import { c as s } from "./tailwind.helper-B6yFEsav.js";
5
- import { J as d, N as l, O as f, K as t } from "./toggle-group-BASGy2mQ.js";
6
- import "./alert-B78CiTYe.js";
7
- import "@radix-ui/react-aspect-ratio";
8
- import "./tooltip-BWyFpIxo.js";
9
- import "@radix-ui/react-collapsible";
10
- import "./sheet-Gop1cIaU.js";
11
- import "lucide-react";
12
- import "react-resizable-panels";
13
- import "./select-MWzbMBAS.js";
14
- import "next-themes";
15
- import "sonner";
16
- import "react";
17
- const g = ({
18
- titleKey: i,
19
- value: r,
20
- valueClassName: m,
21
- icon: n,
22
- iconClassName: c,
23
- description: p,
24
- descriptionClassName: u,
25
- onClick: o
26
- }) => {
27
- const { t: N } = C();
28
- return /* @__PURE__ */ a(d, { className: s(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
29
- /* @__PURE__ */ a(l, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
30
- /* @__PURE__ */ e(f, { className: "text-sm font-medium", children: N(i) }),
31
- /* @__PURE__ */ e(n, { className: s("size-6 text-muted-foreground", c) })
32
- ] }),
33
- /* @__PURE__ */ a(t, { children: [
34
- /* @__PURE__ */ e("div", { className: s("text-2xl font-bold", m), children: h(r) }),
35
- /* @__PURE__ */ e("p", { className: s("text-xs text-muted-foreground", u), children: p })
36
- ] })
37
- ] });
38
- }, q = ({ stats: i }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: i.map((r) => /* @__PURE__ */ e(
39
- g,
40
- {
41
- titleKey: r.titleKey,
42
- value: r.value,
43
- valueClassName: r.valueClassName,
44
- icon: r.icon,
45
- iconClassName: r.iconClassName,
46
- description: r.description,
47
- descriptionClassName: r.descriptionClassName,
48
- onClick: r.onClick
49
- },
50
- r.titleKey
51
- )) }), v = () => /* @__PURE__ */ a(d, { className: "animate-pulse", children: [
52
- /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e("div", { className: "h-6 bg-muted rounded w-1/4" }) }),
53
- /* @__PURE__ */ e(t, { children: /* @__PURE__ */ a("div", { className: "space-y-2", children: [
54
- /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded" }),
55
- /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded w-3/4" })
56
- ] }) })
57
- ] }), B = ({ count: i = 1 }) => /* @__PURE__ */ e("div", { className: "grid gap-6", style: { gridTemplateColumns: `repeat(${i}, minmax(0, 1fr))` }, children: Array.from({ length: i }).map((r, m) => /* @__PURE__ */ e(v, {}, m)) });
58
- export {
59
- g as K,
60
- v as S,
61
- q as a,
62
- B as b
63
- };