@krosoft/react 0.0.183 → 0.0.184
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/{AppActions-DtdwQdm-.js → AppActions-DZ7wVdmt.js} +8 -7
- package/dist/{AppSubTitle-Co9HDBO4.js → AppSubTitle-CZN_tmfv.js} +1 -1
- package/dist/{AppVerticalTabs-B3_nbdLm.js → AppVerticalTabs-C1SsBNAH.js} +26 -25
- package/dist/{ConfirmationDialog-3rO4sYM8.js → ConfirmationDialog-M8sFAz4h.js} +7 -6
- package/dist/{DataTable-Ckbr166c.js → DataTable-KMYbhJ4C.js} +29 -28
- package/dist/{GenericForm-ClzOIaJc.js → GenericForm-DtY0moOD.js} +93 -92
- package/dist/{ImageInput-BPV_4oDI.js → ImageInput-3wZuCZGf.js} +2 -1
- package/dist/{KpiCardsLayout-D67cLG3R.js → KpiCardsLayout-DjRTqXFa.js} +16 -15
- package/dist/{MetricCard-BAa26w6e.js → MetricCard-B0xnFyim.js} +1 -1
- package/dist/{MultiSelect-ovXnKCuU.js → MultiSelect-BhRXVpky.js} +14 -13
- package/dist/PieChart-C9gn0Dws.js +282 -0
- package/dist/{SearchInput-B08-Mcsx.js → SearchInput-BXOlvTO9.js} +30 -29
- package/dist/{SkeletonCards-D0V2nuDg.js → SkeletonCards-av7XHlof.js} +12 -11
- package/dist/{TableFilter-Z0T30AzZ.js → TableFilter-BlrrSOtg.js} +21 -20
- package/dist/chart-DntJZGxB.js +181 -0
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/charts/BarChartHorizontal.d.ts +24 -0
- package/dist/components/core/charts/BarChartHorizontal.d.ts.map +1 -0
- package/dist/components/core/charts/BarChartVertical.d.ts +24 -0
- package/dist/components/core/charts/BarChartVertical.d.ts.map +1 -0
- package/dist/components/core/charts/ChartCard.d.ts +31 -0
- package/dist/components/core/charts/ChartCard.d.ts.map +1 -0
- package/dist/components/core/charts/CircularGauge.d.ts +39 -0
- package/dist/components/core/charts/CircularGauge.d.ts.map +1 -0
- package/dist/components/core/charts/LineChart.d.ts +23 -0
- package/dist/components/core/charts/LineChart.d.ts.map +1 -0
- package/dist/components/core/charts/PieChart.d.ts +26 -0
- package/dist/components/core/charts/PieChart.d.ts.map +1 -0
- package/dist/components/core/charts/chartColors.d.ts +13 -0
- package/dist/components/core/charts/chartColors.d.ts.map +1 -0
- package/dist/components/core/charts/chartTooltip.helper.d.ts +14 -0
- package/dist/components/core/charts/chartTooltip.helper.d.ts.map +1 -0
- package/dist/components/core/charts/index.d.ts +14 -0
- package/dist/components/core/charts/index.d.ts.map +1 -0
- package/dist/components/core/charts/index.js +11 -0
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.d.ts +1 -0
- package/dist/components/core/index.d.ts.map +1 -1
- package/dist/components/core/index.js +80 -71
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +307 -297
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +218 -217
- package/dist/tailwind/index.d.ts +7 -0
- package/dist/tailwind/index.d.ts.map +1 -1
- package/dist/tailwind/index.js +11 -2
- package/dist/{toaster-BaFcYXKg.js → toaster-Cm7utXqi.js} +13 -13
- package/dist/toggle-group-D6aFQQcf.js +1460 -0
- package/dist/types/ChartDatum.d.ts +19 -0
- package/dist/types/ChartDatum.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/toggle-group-D2Li0iBJ.js +0 -1636
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { jsx as n, jsxs as g, Fragment as T } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { c } from "./tailwind.helper-B6yFEsav.js";
|
|
4
|
+
import * as _ from "recharts";
|
|
5
|
+
const P = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("rounded-surface border bg-card text-card-foreground shadow-sm", t), ...e }));
|
|
6
|
+
P.displayName = "Card";
|
|
7
|
+
const A = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("flex flex-col space-y-1.5 p-6", t), ...e }));
|
|
8
|
+
A.displayName = "CardHeader";
|
|
9
|
+
const H = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("h3", { ref: r, className: c("text-2xl font-semibold leading-none tracking-tight", t), ...e }));
|
|
10
|
+
H.displayName = "CardTitle";
|
|
11
|
+
const I = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("p", { ref: r, className: c("text-sm text-muted-foreground", t), ...e }));
|
|
12
|
+
I.displayName = "CardDescription";
|
|
13
|
+
const S = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("p-6 pt-0", t), ...e }));
|
|
14
|
+
S.displayName = "CardContent";
|
|
15
|
+
const E = l.forwardRef(({ className: t, ...e }, r) => /* @__PURE__ */ n("div", { ref: r, className: c("flex items-center p-6 pt-0", t), ...e }));
|
|
16
|
+
E.displayName = "CardFooter";
|
|
17
|
+
const K = { light: "", dark: ".dark" }, y = l.createContext(null);
|
|
18
|
+
function j() {
|
|
19
|
+
const t = l.useContext(y);
|
|
20
|
+
if (!t)
|
|
21
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
const M = l.forwardRef(({ id: t, className: e, children: r, config: o, ...a }, m) => {
|
|
25
|
+
const i = l.useId(), d = `chart-${t || i.replace(/:/g, "")}`;
|
|
26
|
+
return /* @__PURE__ */ n(y.Provider, { value: { config: o }, children: /* @__PURE__ */ g(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
"data-chart": d,
|
|
30
|
+
ref: m,
|
|
31
|
+
className: c(
|
|
32
|
+
"flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",
|
|
33
|
+
e
|
|
34
|
+
),
|
|
35
|
+
...a,
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ n(D, { id: d, config: o }),
|
|
38
|
+
/* @__PURE__ */ n(_.ResponsiveContainer, { children: r })
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
) });
|
|
42
|
+
});
|
|
43
|
+
M.displayName = "Chart";
|
|
44
|
+
const D = ({ id: t, config: e }) => {
|
|
45
|
+
const r = Object.entries(e).filter(([o, a]) => a.theme || a.color);
|
|
46
|
+
return r.length ? /* @__PURE__ */ n(
|
|
47
|
+
"style",
|
|
48
|
+
{
|
|
49
|
+
dangerouslySetInnerHTML: {
|
|
50
|
+
__html: Object.entries(K).map(
|
|
51
|
+
([o, a]) => `
|
|
52
|
+
${a} [data-chart=${t}] {
|
|
53
|
+
${r.map(([m, i]) => {
|
|
54
|
+
var h;
|
|
55
|
+
const d = ((h = i.theme) == null ? void 0 : h[o]) || i.color;
|
|
56
|
+
return d ? ` --color-${m}: ${d};` : null;
|
|
57
|
+
}).join(`
|
|
58
|
+
`)}
|
|
59
|
+
}
|
|
60
|
+
`
|
|
61
|
+
).join(`
|
|
62
|
+
`)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
) : null;
|
|
66
|
+
}, B = _.Tooltip, F = l.forwardRef(
|
|
67
|
+
({
|
|
68
|
+
active: t,
|
|
69
|
+
payload: e = [],
|
|
70
|
+
className: r,
|
|
71
|
+
indicator: o = "dot",
|
|
72
|
+
hideLabel: a = !1,
|
|
73
|
+
hideIndicator: m = !1,
|
|
74
|
+
label: i = "",
|
|
75
|
+
labelFormatter: d,
|
|
76
|
+
labelClassName: h,
|
|
77
|
+
formatter: f,
|
|
78
|
+
color: R,
|
|
79
|
+
nameKey: $,
|
|
80
|
+
labelKey: C
|
|
81
|
+
}, L) => {
|
|
82
|
+
const { config: x } = j(), k = l.useMemo(() => {
|
|
83
|
+
var v;
|
|
84
|
+
if (a || !(e != null && e.length))
|
|
85
|
+
return null;
|
|
86
|
+
const [s] = e, N = `${C || s.dataKey || s.name || "value"}`, p = w(x, s, N), u = !C && typeof i == "string" ? ((v = x[i]) == null ? void 0 : v.label) || i : p == null ? void 0 : p.label;
|
|
87
|
+
return d ? /* @__PURE__ */ n("div", { className: c("font-medium", h), children: d(u, e) }) : u ? /* @__PURE__ */ n("div", { className: c("font-medium", h), children: u }) : null;
|
|
88
|
+
}, [i, d, e, a, h, x, C]);
|
|
89
|
+
if (!t || !(e != null && e.length))
|
|
90
|
+
return null;
|
|
91
|
+
const b = e.length === 1 && o !== "dot";
|
|
92
|
+
return /* @__PURE__ */ g(
|
|
93
|
+
"div",
|
|
94
|
+
{
|
|
95
|
+
ref: L,
|
|
96
|
+
className: c("grid min-w-[8rem] items-start gap-1.5 rounded-surface border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", r),
|
|
97
|
+
children: [
|
|
98
|
+
b ? null : k,
|
|
99
|
+
/* @__PURE__ */ n("div", { className: "grid gap-1.5", children: e.map((s, N) => {
|
|
100
|
+
const p = `${$ || s.name || s.dataKey || "value"}`, u = w(x, s, p), v = R || s.payload.fill || s.color;
|
|
101
|
+
return /* @__PURE__ */ n(
|
|
102
|
+
"div",
|
|
103
|
+
{
|
|
104
|
+
className: c(
|
|
105
|
+
"flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
|
|
106
|
+
o === "dot" && "items-center"
|
|
107
|
+
),
|
|
108
|
+
children: f && (s == null ? void 0 : s.value) !== void 0 && s.name ? f(s.value, s.name, s, N, s.payload) : /* @__PURE__ */ g(T, { children: [
|
|
109
|
+
u != null && u.icon ? /* @__PURE__ */ n(u.icon, {}) : !m && /* @__PURE__ */ n(
|
|
110
|
+
"div",
|
|
111
|
+
{
|
|
112
|
+
className: c("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]", {
|
|
113
|
+
"h-2.5 w-2.5": o === "dot",
|
|
114
|
+
"w-1": o === "line",
|
|
115
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": o === "dashed",
|
|
116
|
+
"my-0.5": b && o === "dashed"
|
|
117
|
+
}),
|
|
118
|
+
style: {
|
|
119
|
+
"--color-bg": v,
|
|
120
|
+
"--color-border": v
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
),
|
|
124
|
+
/* @__PURE__ */ g("div", { className: c("flex flex-1 justify-between leading-none", b ? "items-end" : "items-center"), children: [
|
|
125
|
+
/* @__PURE__ */ g("div", { className: "grid gap-1.5", children: [
|
|
126
|
+
b ? k : null,
|
|
127
|
+
/* @__PURE__ */ n("span", { className: "text-muted-foreground", children: (u == null ? void 0 : u.label) || s.name })
|
|
128
|
+
] }),
|
|
129
|
+
s.value && /* @__PURE__ */ n("span", { className: "font-mono font-medium tabular-nums text-foreground", children: s.value.toLocaleString() })
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
},
|
|
133
|
+
s.dataKey
|
|
134
|
+
);
|
|
135
|
+
}) })
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
F.displayName = "ChartTooltip";
|
|
142
|
+
const G = _.Legend, O = l.forwardRef(({ className: t, hideIcon: e = !1, payload: r, verticalAlign: o = "bottom", nameKey: a }, m) => {
|
|
143
|
+
const { config: i } = j();
|
|
144
|
+
return !r || !Array.isArray(r) || !r.length ? null : /* @__PURE__ */ n("div", { ref: m, className: c("flex items-center justify-center gap-4", o === "top" ? "pb-3" : "pt-3", t), children: Array.isArray(r) && r.map((d) => {
|
|
145
|
+
const h = `${a || d.dataKey || "value"}`, f = w(i, d, h);
|
|
146
|
+
return /* @__PURE__ */ g("div", { className: c("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"), children: [
|
|
147
|
+
f != null && f.icon && !e ? /* @__PURE__ */ n(f.icon, {}) : /* @__PURE__ */ n(
|
|
148
|
+
"div",
|
|
149
|
+
{
|
|
150
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
151
|
+
style: {
|
|
152
|
+
backgroundColor: d.color
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
f == null ? void 0 : f.label
|
|
157
|
+
] }, d.value);
|
|
158
|
+
}) });
|
|
159
|
+
});
|
|
160
|
+
O.displayName = "ChartLegend";
|
|
161
|
+
function w(t, e, r) {
|
|
162
|
+
if (typeof e != "object" || e === null)
|
|
163
|
+
return;
|
|
164
|
+
const o = "payload" in e && typeof e.payload == "object" && e.payload !== null ? e.payload : void 0;
|
|
165
|
+
let a = r;
|
|
166
|
+
return r in e && typeof e[r] == "string" ? a = e[r] : o && r in o && typeof o[r] == "string" && (a = o[r]), a in t ? t[a] : t[r];
|
|
167
|
+
}
|
|
168
|
+
export {
|
|
169
|
+
P as C,
|
|
170
|
+
S as a,
|
|
171
|
+
I as b,
|
|
172
|
+
E as c,
|
|
173
|
+
A as d,
|
|
174
|
+
H as e,
|
|
175
|
+
M as f,
|
|
176
|
+
G as g,
|
|
177
|
+
O as h,
|
|
178
|
+
D as i,
|
|
179
|
+
B as j,
|
|
180
|
+
F as k
|
|
181
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as s, M as d } from "../../../MetricCard-
|
|
2
|
-
import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-
|
|
1
|
+
import { D as s, M as d } from "../../../MetricCard-B0xnFyim.js";
|
|
2
|
+
import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-av7XHlof.js";
|
|
3
3
|
export {
|
|
4
4
|
s as DashboardCard,
|
|
5
5
|
o as KpiCard,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChartDatum } from "../../../types/ChartDatum";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface BarChartHorizontalProps {
|
|
4
|
+
data: ChartDatum[];
|
|
5
|
+
/** Libellé de la série dans le tooltip. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Couleur des barres. Par défaut la couleur primaire du thème. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Largeur réservée aux libellés de catégories, en pixels. */
|
|
10
|
+
categoryWidth?: number;
|
|
11
|
+
/** Longueur max d'un libellé avant troncature. `0` désactive la troncature. */
|
|
12
|
+
maxLabelLength?: number;
|
|
13
|
+
/** Mise en forme des valeurs sur l'axe et dans le tooltip (devise, pourcentage…). */
|
|
14
|
+
valueFormatter?: (value: number) => string;
|
|
15
|
+
/** Rend les barres cliquables. */
|
|
16
|
+
onSelect?: (datum: ChartDatum, index: number) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Barres horizontales, pour les classements « top N » où les libellés de
|
|
21
|
+
* catégories sont trop longs pour tenir sur un axe des abscisses.
|
|
22
|
+
*/
|
|
23
|
+
export declare const BarChartHorizontal: ({ data, label, color, categoryWidth, maxLabelLength, valueFormatter, onSelect, className, }: BarChartHorizontalProps) => React.JSX.Element;
|
|
24
|
+
//# sourceMappingURL=BarChartHorizontal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChartHorizontal.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/BarChartHorizontal.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAAI,6FAShC,uBAAuB,KAAG,KAAK,CAAC,GAAG,CAAC,OA0CtC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ChartDatum } from "../../../types/ChartDatum";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface BarChartVerticalProps {
|
|
4
|
+
data: ChartDatum[];
|
|
5
|
+
/** Libellé de la série dans le tooltip. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Couleur des barres. Par défaut la couleur primaire du thème. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Inclinaison des libellés de l'axe des abscisses, en degrés (ex. `-45` quand ils se chevauchent). */
|
|
10
|
+
labelAngle?: number;
|
|
11
|
+
/** Mise en forme des valeurs sur l'axe et dans le tooltip (devise, pourcentage…). */
|
|
12
|
+
valueFormatter?: (value: number) => string;
|
|
13
|
+
/** Autorise les graduations décimales sur l'axe des ordonnées. */
|
|
14
|
+
allowDecimals?: boolean;
|
|
15
|
+
/** Rend les barres cliquables. */
|
|
16
|
+
onSelect?: (datum: ChartDatum, index: number) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Barres verticales, pour les séries ordonnées où l'axe des abscisses porte une
|
|
21
|
+
* progression lisible de gauche à droite — typiquement une répartition par mois.
|
|
22
|
+
*/
|
|
23
|
+
export declare const BarChartVertical: ({ data, label, color, labelAngle, valueFormatter, allowDecimals, onSelect, className, }: BarChartVerticalProps) => React.JSX.Element;
|
|
24
|
+
//# sourceMappingURL=BarChartVertical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChartVertical.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/BarChartVertical.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uGAAuG;IACvG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,kEAAkE;IAClE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,yFAS9B,qBAAqB,KAAG,KAAK,CAAC,GAAG,CAAC,OA0CpC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface ChartCardProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
icon?: React.ElementType;
|
|
6
|
+
/** Contenu aligné à droite de l'en-tête : filtre de période, bascule détaillé/agrégé… */
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
isEmpty?: boolean;
|
|
10
|
+
emptyLabel?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Hauteur de la zone de rendu, en pixels. Appliquée en style inline et non en
|
|
13
|
+
* classe Tailwind : une classe arbitraire construite dynamiquement ne serait
|
|
14
|
+
* jamais générée dans le CSS du projet consommateur.
|
|
15
|
+
*/
|
|
16
|
+
height?: number;
|
|
17
|
+
className?: string;
|
|
18
|
+
contentClassName?: string;
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Carte d'accueil d'un graphe : en-tête (titre, description, icône, actions) et
|
|
23
|
+
* zone de rendu à hauteur fixe qui gère elle-même les états de chargement et
|
|
24
|
+
* d'absence de données.
|
|
25
|
+
*
|
|
26
|
+
* Le graphe passé en `children` remplit la zone via `ChartContainer` en
|
|
27
|
+
* `aspect-auto h-full w-full` — la carte ne monte pas de `ResponsiveContainer`,
|
|
28
|
+
* c'est `ChartContainer` qui s'en charge.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ChartCard: ({ title, description, icon, actions, isLoading, isEmpty, emptyLabel, height, className, contentClassName, children, }: ChartCardProps) => React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=ChartCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartCard.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/ChartCard.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB,yFAAyF;IACzF,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,GAAI,uHAYvB,cAAc,KAAG,KAAK,CAAC,GAAG,CAAC,OAwC7B,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface CircularGaugeThresholds {
|
|
3
|
+
/** Pourcentage de remplissage à partir duquel la jauge passe en warning. */
|
|
4
|
+
warning: number;
|
|
5
|
+
/** Pourcentage de remplissage à partir duquel la jauge passe en destructive. */
|
|
6
|
+
danger: number;
|
|
7
|
+
}
|
|
8
|
+
export interface CircularGaugeProps {
|
|
9
|
+
value: number;
|
|
10
|
+
/** Valeur correspondant à une jauge pleine. */
|
|
11
|
+
max?: number;
|
|
12
|
+
/** Diamètre extérieur, en pixels. */
|
|
13
|
+
size?: number;
|
|
14
|
+
/** Épaisseur de l'anneau, en pixels. */
|
|
15
|
+
strokeWidth?: number;
|
|
16
|
+
/** Libellé sous la jauge. */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Unité affichée sous la valeur. */
|
|
19
|
+
unit?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Couleur fixe de l'anneau. À défaut, la couleur est déduite du taux de
|
|
22
|
+
* remplissage via `thresholds`.
|
|
23
|
+
*/
|
|
24
|
+
color?: string;
|
|
25
|
+
/** Seuils de bascule de couleur, ignorés si `color` est fourni. */
|
|
26
|
+
thresholds?: CircularGaugeThresholds;
|
|
27
|
+
/** Mise en forme de la valeur affichée au centre. Une décimale par défaut. */
|
|
28
|
+
valueFormatter?: (value: number) => string;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Jauge circulaire d'une valeur rapportée à un maximum, en SVG.
|
|
33
|
+
*
|
|
34
|
+
* Sans `color`, l'anneau vire au warning puis au destructive selon `thresholds` —
|
|
35
|
+
* pour un indicateur où monter est mauvais (CPU, mémoire, disque). Pour un
|
|
36
|
+
* indicateur neutre ou où monter est bon, passer une `color` explicite.
|
|
37
|
+
*/
|
|
38
|
+
export declare const CircularGauge: ({ value, max, size, strokeWidth, label, unit, color, thresholds, valueFormatter, className, }: CircularGaugeProps) => React.JSX.Element;
|
|
39
|
+
//# sourceMappingURL=CircularGauge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CircularGauge.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/CircularGauge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,uBAAuB;IACtC,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mEAAmE;IACnE,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,8EAA8E;IAC9E,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,+FAW3B,kBAAkB,KAAG,KAAK,CAAC,GAAG,CAAC,OAiCjC,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChartDatum } from "../../../types/ChartDatum";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface LineChartProps {
|
|
4
|
+
data: ChartDatum[];
|
|
5
|
+
/** Libellé de la série dans le tooltip. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Couleur de la courbe. Par défaut la couleur primaire du thème. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** Bornes de l'axe des ordonnées, ex. `[0, 100]` pour un pourcentage. Auto par défaut. */
|
|
10
|
+
yAxisDomain?: [number, number];
|
|
11
|
+
/** Mise en forme des valeurs sur l'axe et dans le tooltip (devise, pourcentage…). */
|
|
12
|
+
valueFormatter?: (value: number) => string;
|
|
13
|
+
/** Mise en forme des libellés de l'axe des abscisses (date, heure…). */
|
|
14
|
+
labelFormatter?: (name: string) => string;
|
|
15
|
+
/** Points sur chaque valeur. À couper au-delà d'une cinquantaine de points. */
|
|
16
|
+
showDots?: boolean;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Courbe d'évolution d'une série de valeurs dans le temps.
|
|
21
|
+
*/
|
|
22
|
+
export declare const LineChart: ({ data, label, color, yAxisDomain, valueFormatter, labelFormatter, showDots, className, }: LineChartProps) => React.JSX.Element;
|
|
23
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/LineChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0FAA0F;IAC1F,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,qFAAqF;IACrF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,wEAAwE;IACxE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,2FASvB,cAAc,KAAG,KAAK,CAAC,GAAG,CAAC,OAqC7B,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ChartDatum } from "../../../types/ChartDatum";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface PieChartProps {
|
|
4
|
+
data: ChartDatum[];
|
|
5
|
+
/** Rayon intérieur, en pixels. `0` donne un camembert plein. Par défaut un anneau, adapté au mobile. */
|
|
6
|
+
innerRadius?: number;
|
|
7
|
+
/** Rayon extérieur, en pixels. Par défaut adapté au mobile. */
|
|
8
|
+
outerRadius?: number;
|
|
9
|
+
/** Légende sous le graphe. */
|
|
10
|
+
showLegend?: boolean;
|
|
11
|
+
/** Libellés `nom (valeur)` posés à l'extérieur des parts. Illisible au-delà de 5 ou 6 parts. */
|
|
12
|
+
showLabels?: boolean;
|
|
13
|
+
/** Mise en forme des valeurs dans le tooltip (devise, pourcentage…). */
|
|
14
|
+
valueFormatter?: (value: number) => string;
|
|
15
|
+
/** Rend les parts cliquables. */
|
|
16
|
+
onSelect?: (datum: ChartDatum, index: number) => void;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Répartition en parts, en anneau par défaut.
|
|
21
|
+
*
|
|
22
|
+
* Chaque donnée est coloriée par son `color`, sinon par la palette
|
|
23
|
+
* `CHART_COLORS` dans l'ordre.
|
|
24
|
+
*/
|
|
25
|
+
export declare const PieChart: ({ data, innerRadius, outerRadius, showLegend, showLabels, valueFormatter, onSelect, className, }: PieChartProps) => React.JSX.Element;
|
|
26
|
+
//# sourceMappingURL=PieChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PieChart.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/PieChart.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gGAAgG;IAChG,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,wEAAwE;IACxE,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC3C,iCAAiC;IACjC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,kGAStB,aAAa,KAAG,KAAK,CAAC,GAAG,CAAC,OA+C5B,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Palette par défaut des graphes, appliquée dans l'ordre aux données qui ne
|
|
3
|
+
* portent pas de couleur explicite.
|
|
4
|
+
*
|
|
5
|
+
* Les variables sont déclarées dans `styles/globals.css` sur `:root` uniquement :
|
|
6
|
+
* ces teintes sont choisies pour rester lisibles aussi bien sur fond clair que
|
|
7
|
+
* sur les thèmes sombres, sans avoir à être redéfinies par chacun d'eux. Un
|
|
8
|
+
* projet qui veut sa propre palette surcharge `--k-chart-1` … `--k-chart-5`.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CHART_COLORS: readonly ["hsl(var(--k-chart-1))", "hsl(var(--k-chart-2))", "hsl(var(--k-chart-3))", "hsl(var(--k-chart-4))", "hsl(var(--k-chart-5))"];
|
|
11
|
+
/** Couleur de la palette pour un index de série, en boucle au-delà de 5 entrées. */
|
|
12
|
+
export declare const getChartColor: (index: number) => string;
|
|
13
|
+
//# sourceMappingURL=chartColors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartColors.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/chartColors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,wIAMf,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,aAAa,GAAI,OAAO,MAAM,KAAG,MAAmD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Construit le `formatter` de `ChartTooltipContent` pour afficher une valeur
|
|
4
|
+
* formatée (devise, pourcentage, durée…) plutôt que le `toLocaleString()` par
|
|
5
|
+
* défaut de shadcn.
|
|
6
|
+
*
|
|
7
|
+
* Renvoie `undefined` quand aucun formatage n'est demandé, pour laisser le
|
|
8
|
+
* rendu natif — y compris l'indicateur de couleur, que `formatter` remplace.
|
|
9
|
+
*
|
|
10
|
+
* @param valueFormatter Mise en forme de la valeur numérique.
|
|
11
|
+
* @param label Libellé affiché à gauche. À défaut, le nom de la série.
|
|
12
|
+
*/
|
|
13
|
+
export declare const buildTooltipValueFormatter: (valueFormatter?: (value: number) => string, label?: string) => ((value: unknown, name: unknown) => React.ReactNode) | undefined;
|
|
14
|
+
//# sourceMappingURL=chartTooltip.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chartTooltip.helper.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/chartTooltip.helper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,0BAA0B,GACrC,iBAAiB,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,EAC1C,QAAQ,MAAM,KACb,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC,GAAG,SAazD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { BarChartHorizontal } from "./BarChartHorizontal";
|
|
2
|
+
export type { BarChartHorizontalProps } from "./BarChartHorizontal";
|
|
3
|
+
export { BarChartVertical } from "./BarChartVertical";
|
|
4
|
+
export type { BarChartVerticalProps } from "./BarChartVertical";
|
|
5
|
+
export { CHART_COLORS, getChartColor } from "./chartColors";
|
|
6
|
+
export { ChartCard } from "./ChartCard";
|
|
7
|
+
export type { ChartCardProps } from "./ChartCard";
|
|
8
|
+
export { CircularGauge } from "./CircularGauge";
|
|
9
|
+
export type { CircularGaugeProps, CircularGaugeThresholds } from "./CircularGauge";
|
|
10
|
+
export { LineChart } from "./LineChart";
|
|
11
|
+
export type { LineChartProps } from "./LineChart";
|
|
12
|
+
export { PieChart } from "./PieChart";
|
|
13
|
+
export type { PieChartProps } from "./PieChart";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/charts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { B as C, a as t, C as s, b as e, c as h, L as o, P as i, g as l } from "../../../PieChart-C9gn0Dws.js";
|
|
2
|
+
export {
|
|
3
|
+
C as BarChartHorizontal,
|
|
4
|
+
t as BarChartVertical,
|
|
5
|
+
s as CHART_COLORS,
|
|
6
|
+
e as ChartCard,
|
|
7
|
+
h as CircularGauge,
|
|
8
|
+
o as LineChart,
|
|
9
|
+
i as PieChart,
|
|
10
|
+
l as getChartColor
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-
|
|
2
|
-
import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-
|
|
1
|
+
import { A as i, C as s, F as g } from "../../../ConfirmationDialog-M8sFAz4h.js";
|
|
2
|
+
import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-D6aFQQcf.js";
|
|
3
3
|
export {
|
|
4
4
|
i as AppDialog,
|
|
5
5
|
s as ConfirmationDialog,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|