@krosoft/react 0.0.74 → 0.0.75

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.
@@ -0,0 +1,64 @@
1
+ import { jsxs as o, jsx as r } from "react/jsx-runtime";
2
+ import { c as m, g as u, h as f, d as p } from "./calendar-cHag6u-j.js";
3
+ import "./index-BQOmHRsD.js";
4
+ import { c as n } from "./index-gWiv5-6R.js";
5
+ import "./select-Dv9bdUCB.js";
6
+ import g from "react";
7
+ import { formatNumber as h } from "@krosoft/core/helpers";
8
+ import { useTranslation as N } from "react-i18next";
9
+ const b = ({ titleKey: t, value: e, valueClassName: i, icon: d, iconClassName: s, description: l, descriptionClassName: c, onClick: a }) => {
10
+ const { t: x } = N();
11
+ return /* @__PURE__ */ o(m, { className: n(a ? "hover:border-primary cursor-pointer" : ""), onClick: a, children: [
12
+ /* @__PURE__ */ o(u, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
13
+ /* @__PURE__ */ r(f, { className: "text-sm font-medium", children: x(t) }),
14
+ g.createElement(d, {
15
+ className: n("size-6 text-muted-foreground", s)
16
+ })
17
+ ] }),
18
+ /* @__PURE__ */ o(p, { children: [
19
+ /* @__PURE__ */ r("div", { className: n("text-2xl font-bold", i), children: h(e) }),
20
+ /* @__PURE__ */ r("p", { className: n("text-xs text-muted-foreground", c), children: l })
21
+ ] })
22
+ ] });
23
+ }, $ = ({ stats: t }) => /* @__PURE__ */ r("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: t.map((e) => /* @__PURE__ */ r(
24
+ b,
25
+ {
26
+ titleKey: e.titleKey,
27
+ value: e.value,
28
+ valueClassName: e.valueClassName,
29
+ icon: e.icon,
30
+ iconClassName: e.iconClassName,
31
+ description: e.description,
32
+ descriptionClassName: e.descriptionClassName,
33
+ onClick: e.onClick
34
+ },
35
+ e.titleKey
36
+ )) }), v = {
37
+ blue: "from-blue-500 to-cyan-500",
38
+ green: "from-green-500 to-emerald-500",
39
+ orange: "from-orange-500 to-yellow-500",
40
+ red: "from-red-500 to-pink-500",
41
+ purple: "from-purple-500 to-indigo-500"
42
+ }, C = (t) => t === "up" ? "↗" : t === "down" ? "↘" : "→", w = (t) => t === "up" ? "text-green-600" : t === "down" ? "text-red-600" : "text-muted-foreground", E = ({ title: t, value: e, unit: i, icon: d, trend: s, trendValue: l, color: c = "blue", children: a }) => /* @__PURE__ */ o(m, { className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300", children: [
43
+ /* @__PURE__ */ r("div", { className: "absolute inset-0 bg-white/5" }),
44
+ /* @__PURE__ */ o(u, { className: "flex flex-row items-center justify-between space-y-0 pb-2 relative z-10", children: [
45
+ /* @__PURE__ */ r(f, { className: "text-sm font-medium text-muted-foreground", children: t }),
46
+ /* @__PURE__ */ r("div", { className: `p-2 rounded-lg bg-gradient-to-br ${v[c]} shadow-lg`, children: /* @__PURE__ */ r(d, { className: "h-4 w-4 text-white" }) })
47
+ ] }),
48
+ /* @__PURE__ */ o(p, { className: "relative z-10", children: [
49
+ /* @__PURE__ */ o("div", { className: "flex items-baseline space-x-2", children: [
50
+ /* @__PURE__ */ r("div", { className: "text-2xl font-bold text-card-foreground", children: typeof e == "number" ? e.toFixed(1) : e }),
51
+ i && /* @__PURE__ */ r("div", { className: "text-sm text-muted-foreground font-medium", children: i })
52
+ ] }),
53
+ s && l && /* @__PURE__ */ o("div", { className: `flex items-center space-x-1 mt-2 text-xs ${w(s)}`, children: [
54
+ /* @__PURE__ */ r("span", { children: C(s) }),
55
+ /* @__PURE__ */ r("span", { children: l })
56
+ ] }),
57
+ a && /* @__PURE__ */ r("div", { className: "mt-4", children: a })
58
+ ] })
59
+ ] });
60
+ export {
61
+ b as K,
62
+ E as M,
63
+ $ as a
64
+ };
@@ -0,0 +1,23 @@
1
+ import type { LucideIcon } from "lucide-react";
2
+ import * as React from "react";
3
+ declare const colorClasses: {
4
+ readonly blue: "from-blue-500 to-cyan-500";
5
+ readonly green: "from-green-500 to-emerald-500";
6
+ readonly orange: "from-orange-500 to-yellow-500";
7
+ readonly red: "from-red-500 to-pink-500";
8
+ readonly purple: "from-purple-500 to-indigo-500";
9
+ };
10
+ export type MetricCardColor = keyof typeof colorClasses;
11
+ export interface MetricCardProps {
12
+ title: string;
13
+ value: string | number;
14
+ unit?: string;
15
+ icon: LucideIcon;
16
+ trend?: "up" | "down" | "stable";
17
+ trendValue?: string;
18
+ color?: MetricCardColor;
19
+ children?: React.ReactNode;
20
+ }
21
+ export declare const MetricCard: ({ title, value, unit, icon: Icon, trend, trendValue, color, children }: MetricCardProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=MetricCard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MetricCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/MetricCard.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,QAAA,MAAM,YAAY;;;;;;CAMR,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,YAAY,CAAC;AAExD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,QAAQ,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAcD,eAAO,MAAM,UAAU,GAAI,wEAAiF,eAAe,4CA6B1H,CAAC"}
@@ -1,4 +1,6 @@
1
1
  export { KpiCard } from "./KpiCard";
2
2
  export type { KpiCardProps } from "./KpiCard";
3
3
  export { KpiCards } from "./KpiCards";
4
+ export { MetricCard } from "./MetricCard";
5
+ export type { MetricCardProps, MetricCardColor } from "./MetricCard";
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/cards/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC"}
@@ -1,5 +1,6 @@
1
- import { K as p, a as s } from "../../../KpiCards-Bp6EAsf7.js";
1
+ import { K as s, a as d, M as i } from "../../../MetricCard-H--Bf1Ib.js";
2
2
  export {
3
- p as KpiCard,
4
- s as KpiCards
3
+ s as KpiCard,
4
+ d as KpiCards,
5
+ i as MetricCard
5
6
  };
@@ -1,16 +1,17 @@
1
- import { K as e, a as o } from "../../KpiCards-Bp6EAsf7.js";
2
- import { D as s, S as p } from "../../DateRangePicker-BAn4LMHi.js";
3
- import { E as m, L as f } from "../../LoadingState-C0uS6aGT.js";
4
- import { S as x, T as d } from "../../Topbar-CFALRIJn.js";
5
- import { T as c } from "../../ThemeSelector-DQmkKmzE.js";
1
+ import { K as e, a as o, M as t } from "../../MetricCard-H--Bf1Ib.js";
2
+ import { D as p, S } from "../../DateRangePicker-BAn4LMHi.js";
3
+ import { E as m, L as d } from "../../LoadingState-C0uS6aGT.js";
4
+ import { S as x, T as c } from "../../Topbar-CFALRIJn.js";
5
+ import { T as n } from "../../ThemeSelector-DQmkKmzE.js";
6
6
  export {
7
- s as DateRangePicker,
7
+ p as DateRangePicker,
8
8
  m as ErrorState,
9
9
  e as KpiCard,
10
10
  o as KpiCards,
11
- f as LoadingState,
12
- p as SearchInput,
11
+ d as LoadingState,
12
+ t as MetricCard,
13
+ S as SearchInput,
13
14
  x as Sidebar,
14
- c as ThemeSelector,
15
- d as Topbar
15
+ n as ThemeSelector,
16
+ c as Topbar
16
17
  };
@@ -1,50 +1,51 @@
1
- import { K as t, a as r } from "../KpiCards-Bp6EAsf7.js";
2
- import { D as o, S as i } from "../DateRangePicker-BAn4LMHi.js";
3
- import { E as p, L as n } from "../LoadingState-C0uS6aGT.js";
4
- import { S as d, T as S } from "../Topbar-CFALRIJn.js";
5
- import { T as C } from "../ThemeSelector-DQmkKmzE.js";
6
- import { A as f, a as b, b as x, C as g, c as u, d as A, e as D, f as B, g as I, h as V, I as h, T as K, i as L, j as k, k as E, l as P, m as j, n as v } from "../calendar-cHag6u-j.js";
1
+ import { K as t, a as r, M as s } from "../MetricCard-H--Bf1Ib.js";
2
+ import { D as i, S as l } from "../DateRangePicker-BAn4LMHi.js";
3
+ import { E as c, L as d } from "../LoadingState-C0uS6aGT.js";
4
+ import { S, T } from "../Topbar-CFALRIJn.js";
5
+ import { T as m } from "../ThemeSelector-DQmkKmzE.js";
6
+ import { A as b, a as x, b as g, C as u, c as A, d as D, e as B, f as I, g as V, h, I as K, T as L, i as k, j as E, k as M, l as P, m as j, n as v } from "../calendar-cHag6u-j.js";
7
7
  import { B as F, b as G } from "../index-BQOmHRsD.js";
8
8
  import { B as R, b as q } from "../badge-C4pCH7IL.js";
9
- import { S as z, a as J, b as M, c as N, d as O, e as Q, f as U, g as W } from "../select-Dv9bdUCB.js";
9
+ import { S as z, a as J, b as N, c as O, d as Q, e as U, f as W, g as X } from "../select-Dv9bdUCB.js";
10
10
  export {
11
- f as Alert,
12
- b as AlertDescription,
13
- x as AlertTitle,
11
+ b as Alert,
12
+ x as AlertDescription,
13
+ g as AlertTitle,
14
14
  R as Badge,
15
15
  F as Button,
16
- g as Calendar,
17
- u as Card,
18
- A as CardContent,
19
- D as CardDescription,
20
- B as CardFooter,
21
- I as CardHeader,
22
- V as CardTitle,
23
- o as DateRangePicker,
24
- p as ErrorState,
25
- h as Input,
16
+ u as Calendar,
17
+ A as Card,
18
+ D as CardContent,
19
+ B as CardDescription,
20
+ I as CardFooter,
21
+ V as CardHeader,
22
+ h as CardTitle,
23
+ i as DateRangePicker,
24
+ c as ErrorState,
25
+ K as Input,
26
26
  t as KpiCard,
27
27
  r as KpiCards,
28
- n as LoadingState,
29
- i as SearchInput,
28
+ d as LoadingState,
29
+ s as MetricCard,
30
+ l as SearchInput,
30
31
  z as Select,
31
32
  J as SelectContent,
32
- M as SelectGroup,
33
- N as SelectItem,
34
- O as SelectLabel,
35
- Q as SelectSeparator,
36
- U as SelectTrigger,
37
- W as SelectValue,
38
- d as Sidebar,
39
- C as ThemeSelector,
40
- K as Toast,
41
- L as ToastAction,
42
- k as ToastClose,
43
- E as ToastDescription,
33
+ N as SelectGroup,
34
+ O as SelectItem,
35
+ Q as SelectLabel,
36
+ U as SelectSeparator,
37
+ W as SelectTrigger,
38
+ X as SelectValue,
39
+ S as Sidebar,
40
+ m as ThemeSelector,
41
+ L as Toast,
42
+ k as ToastAction,
43
+ E as ToastClose,
44
+ M as ToastDescription,
44
45
  P as ToastProvider,
45
46
  j as ToastTitle,
46
47
  v as ToastViewport,
47
- S as Topbar,
48
+ T as Topbar,
48
49
  q as badgeVariants,
49
50
  G as buttonVariants
50
51
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.74",
3
+ "version": "0.0.75",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,40 +0,0 @@
1
- import { jsxs as s, jsx as r } from "react/jsx-runtime";
2
- import { c as p, g as f, h as u, d as C } from "./calendar-cHag6u-j.js";
3
- import "./index-BQOmHRsD.js";
4
- import { c as a } from "./index-gWiv5-6R.js";
5
- import "./select-Dv9bdUCB.js";
6
- import N from "react";
7
- import { formatNumber as x } from "@krosoft/core/helpers";
8
- import { useTranslation as h } from "react-i18next";
9
- const g = ({ titleKey: i, value: e, valueClassName: l, icon: m, iconClassName: c, description: t, descriptionClassName: n, onClick: o }) => {
10
- const { t: d } = h();
11
- return /* @__PURE__ */ s(p, { className: a(o ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
12
- /* @__PURE__ */ s(f, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
13
- /* @__PURE__ */ r(u, { className: "text-sm font-medium", children: d(i) }),
14
- N.createElement(m, {
15
- className: a("size-6 text-muted-foreground", c)
16
- })
17
- ] }),
18
- /* @__PURE__ */ s(C, { children: [
19
- /* @__PURE__ */ r("div", { className: a("text-2xl font-bold", l), children: x(e) }),
20
- /* @__PURE__ */ r("p", { className: a("text-xs text-muted-foreground", n), children: t })
21
- ] })
22
- ] });
23
- }, k = ({ stats: i }) => /* @__PURE__ */ r("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: i.map((e) => /* @__PURE__ */ r(
24
- g,
25
- {
26
- titleKey: e.titleKey,
27
- value: e.value,
28
- valueClassName: e.valueClassName,
29
- icon: e.icon,
30
- iconClassName: e.iconClassName,
31
- description: e.description,
32
- descriptionClassName: e.descriptionClassName,
33
- onClick: e.onClick
34
- },
35
- e.titleKey
36
- )) });
37
- export {
38
- g as K,
39
- k as a
40
- };