@ledgerhq/lumen-ui-react-visualization 0.1.4 → 0.1.5

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.
Files changed (41) hide show
  1. package/dist/index.js +5 -2
  2. package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -1
  3. package/dist/lib/Components/Axis/XAxis/XAxis.js +47 -48
  4. package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -1
  5. package/dist/lib/Components/Axis/YAxis/YAxis.js +44 -42
  6. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
  7. package/dist/lib/Components/CartesianChart/CartesianChart.js +56 -56
  8. package/dist/lib/Components/CartesianChart/types.d.ts +4 -2
  9. package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -1
  10. package/dist/lib/Components/CartesianChart/utils.d.ts +19 -0
  11. package/dist/lib/Components/CartesianChart/utils.d.ts.map +1 -0
  12. package/dist/lib/Components/CartesianChart/utils.js +42 -0
  13. package/dist/lib/Components/Line/Line.d.ts.map +1 -1
  14. package/dist/lib/Components/Line/Line.js +18 -17
  15. package/dist/lib/Components/Line/utils.d.ts +1 -1
  16. package/dist/lib/Components/Line/utils.d.ts.map +1 -1
  17. package/dist/lib/Components/Point/Point.d.ts +4 -0
  18. package/dist/lib/Components/Point/Point.d.ts.map +1 -0
  19. package/dist/lib/Components/Point/Point.js +85 -0
  20. package/dist/lib/Components/Point/index.d.ts +3 -0
  21. package/dist/lib/Components/Point/index.d.ts.map +1 -0
  22. package/dist/lib/Components/Point/types.d.ts +71 -0
  23. package/dist/lib/Components/Point/types.d.ts.map +1 -0
  24. package/dist/lib/Components/Point/utils.d.ts +24 -0
  25. package/dist/lib/Components/Point/utils.d.ts.map +1 -0
  26. package/dist/lib/Components/Point/utils.js +26 -0
  27. package/dist/lib/Components/index.d.ts +1 -0
  28. package/dist/lib/Components/index.d.ts.map +1 -1
  29. package/dist/lib/utils/scales/scales.d.ts +12 -0
  30. package/dist/lib/utils/scales/scales.d.ts.map +1 -1
  31. package/dist/lib/utils/scales/scales.js +17 -13
  32. package/dist/lib/utils/ticks/ticks.d.ts +11 -1
  33. package/dist/lib/utils/ticks/ticks.d.ts.map +1 -1
  34. package/dist/lib/utils/ticks/ticks.js +19 -17
  35. package/dist/lib/utils/types.d.ts +4 -1
  36. package/dist/lib/utils/types.d.ts.map +1 -1
  37. package/dist/libs/design-core/dist/lib/cssVar/cssVar.js +4 -0
  38. package/dist/package.json +3 -3
  39. package/package.json +2 -2
  40. package/dist/libs/ui-react/dist/lib/Components/ThemeProvider/ThemeProvider.js +0 -8
  41. package/dist/libs/ui-react/dist/libs/utils-shared/dist/index.js +0 -35
package/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
- import { LineChart as o } from "./lib/Components/LineChart/LineChart.js";
1
+ import { LineChart as t } from "./lib/Components/LineChart/LineChart.js";
2
+ import { Point as i, PointLabel as n } from "./lib/Components/Point/Point.js";
2
3
  export {
3
- o as LineChart
4
+ t as LineChart,
5
+ i as Point,
6
+ n as PointLabel
4
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/XAxis/XAxis.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EACpB,aAAwB,EACxB,QAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAqFZ"}
1
+ {"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/XAxis/XAxis.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EACpB,aAAwB,EACxB,QAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAqFZ"}
@@ -1,84 +1,83 @@
1
- import { jsxs as y, jsx as r, Fragment as C } from "react/jsx-runtime";
2
- import { useTheme as _ } from "../../../../libs/ui-react/dist/lib/Components/ThemeProvider/ThemeProvider.js";
3
- import { useMemo as D } from "react";
4
- import { buildTicksData as I } from "../../../utils/ticks/ticks.js";
5
- import { useCartesianChartContext as $ } from "../../CartesianChart/context/cartesianChartContext.js";
6
- const l = 1, u = 4, k = 6, w = 28;
7
- function H({
8
- gridLineStyle: f = "dashed",
9
- position: d = "bottom",
10
- showGrid: g = !1,
11
- showLine: b = !1,
12
- showTickMark: T = !1,
13
- ticks: m,
1
+ import { jsxs as k, jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as T } from "react";
3
+ import { buildTicksData as C, isTickOnXAxisDomainEdge as E } from "../../../utils/ticks/ticks.js";
4
+ import { useCartesianChartContext as D } from "../../CartesianChart/context/cartesianChartContext.js";
5
+ import { cssVar as o } from "../../../../libs/design-core/dist/lib/cssVar/cssVar.js";
6
+ const c = 4, S = 6, F = 28;
7
+ function K({
8
+ gridLineStyle: h = "dashed",
9
+ position: l = "bottom",
10
+ showGrid: p = !1,
11
+ showLine: u = !1,
12
+ showTickMark: g = !1,
13
+ ticks: d,
14
14
  tickLabelFormatter: x
15
15
  }) {
16
- const { theme: o } = _(), { getXScale: A, getXAxisConfig: S, drawingArea: e } = $(), n = A(), c = S(), a = D(
17
- () => n ? I(n, c, m, x) : [],
18
- [n, c, m, x]
16
+ const { getXScale: v, getXAxisConfig: A, drawingArea: e } = D(), r = v(), m = A(), n = T(
17
+ () => r ? C(r, m, d, x) : [],
18
+ [r, m, d, x]
19
19
  );
20
- if (!n || e.width <= 0)
20
+ if (!r || e.width <= 0)
21
21
  return null;
22
- const h = d === "top", s = h ? e.y : e.y + e.height, p = h ? -1 : 1, E = s + p * (u + k);
23
- return /* @__PURE__ */ y("g", { "data-testid": "x-axis", children: [
24
- g && a.map((t, i) => /* @__PURE__ */ r(
22
+ const f = l === "top", s = f ? e.y : e.y + e.height, y = f ? -1 : 1, b = s + y * (c + S);
23
+ return /* @__PURE__ */ k("g", { "data-testid": "x-axis", children: [
24
+ p && n.filter((t) => E(t, e)).map((t, i) => /* @__PURE__ */ a(
25
25
  "line",
26
26
  {
27
27
  x1: t.position,
28
28
  y1: e.y,
29
29
  x2: t.position,
30
30
  y2: e.y + e.height,
31
- style: { stroke: o.colors.border.mutedSubtle },
32
- strokeWidth: l,
33
- strokeDasharray: f === "dashed" ? "3 3" : void 0
31
+ style: { stroke: o("var(--border-muted-subtle)") },
32
+ strokeWidth: o("var(--stroke-1)"),
33
+ strokeDasharray: h === "dashed" ? "3 3" : void 0
34
34
  },
35
35
  `grid-${t.value}-${i}`
36
36
  )),
37
- b && /* @__PURE__ */ r(
37
+ u && /* @__PURE__ */ a(
38
38
  "line",
39
39
  {
40
40
  x1: e.x,
41
41
  y1: s,
42
42
  x2: e.x + e.width,
43
43
  y2: s,
44
- style: { stroke: o.colors.border.muted },
45
- strokeWidth: l,
44
+ style: { stroke: o("var(--border-muted)") },
45
+ strokeWidth: o("var(--stroke-1)"),
46
46
  shapeRendering: "crispEdges",
47
47
  strokeLinecap: "square"
48
48
  }
49
49
  ),
50
- T && a.map((t, i) => /* @__PURE__ */ r(
50
+ g && n.map((t, i) => /* @__PURE__ */ a(
51
51
  "line",
52
52
  {
53
53
  x1: t.position,
54
54
  y1: s,
55
55
  x2: t.position,
56
- y2: s + p * u,
57
- style: { stroke: o.colors.border.muted },
58
- strokeWidth: l
56
+ y2: s + y * c,
57
+ style: { stroke: o("var(--border-muted)") },
58
+ strokeWidth: o("var(--stroke-1)")
59
59
  },
60
60
  `tick-${t.value}-${i}`
61
61
  )),
62
- a.map((t, i) => /* @__PURE__ */ y(C, { children: [
63
- " ",
64
- /* @__PURE__ */ r(
65
- "text",
66
- {
67
- x: t.position,
68
- y: E,
69
- textAnchor: "middle",
70
- dominantBaseline: d === "top" ? "auto" : "hanging",
71
- style: { fill: o.colors.text.muted },
72
- fontSize: o.typographies.xs.body.body4.fontSize,
73
- fontFamily: o.fontFamilies.sans,
74
- children: t.label
62
+ n.map((t, i) => /* @__PURE__ */ a(
63
+ "text",
64
+ {
65
+ x: t.position,
66
+ y: b,
67
+ textAnchor: "middle",
68
+ dominantBaseline: l === "top" ? "auto" : "hanging",
69
+ style: {
70
+ fill: o("var(--text-muted)"),
71
+ fontSize: o("var(--font-style-body-4-size)"),
72
+ fontFamily: o("var(--font-family-font)")
75
73
  },
76
- `label-${t.value}-${i}`
77
- )
78
- ] }))
74
+ children: t.label
75
+ },
76
+ `label-${t.value}-${i}`
77
+ ))
79
78
  ] });
80
79
  }
81
80
  export {
82
- w as DEFAULT_AXIS_HEIGHT,
83
- H as XAxis
81
+ F as DEFAULT_AXIS_HEIGHT,
82
+ K as XAxis
84
83
  };
@@ -1 +1 @@
1
- {"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/YAxis/YAxis.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,wBAAgB,KAAK,CAAC,EACpB,aAAwB,EACxB,QAAkB,EAClB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAkFZ"}
1
+ {"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../../src/lib/Components/Axis/YAxis/YAxis.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAI1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,wBAAgB,KAAK,CAAC,EACpB,aAAwB,EACxB,QAAkB,EAClB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAqFZ"}
@@ -1,81 +1,83 @@
1
- import { jsxs as C, jsx as n } from "react/jsx-runtime";
2
- import { useTheme as D } from "../../../../libs/ui-react/dist/lib/Components/ThemeProvider/ThemeProvider.js";
3
- import { useMemo as E } from "react";
4
- import { buildTicksData as _ } from "../../../utils/ticks/ticks.js";
5
- import { useCartesianChartContext as I } from "../../CartesianChart/context/cartesianChartContext.js";
6
- const l = 1, f = 4, $ = 6, w = 40;
7
- function L({
8
- gridLineStyle: p = "dashed",
9
- position: d = "start",
1
+ import { jsxs as b, jsx as a } from "react/jsx-runtime";
2
+ import { useMemo as C } from "react";
3
+ import { buildTicksData as D, isTickOnYAxisDomainEdge as S } from "../../../utils/ticks/ticks.js";
4
+ import { useCartesianChartContext as T } from "../../CartesianChart/context/cartesianChartContext.js";
5
+ import { cssVar as s } from "../../../../libs/design-core/dist/lib/cssVar/cssVar.js";
6
+ const f = 4, E = 6, w = 40;
7
+ function F({
8
+ gridLineStyle: h = "dashed",
9
+ position: l = "start",
10
10
  showGrid: u = !1,
11
- showLine: g = !1,
12
- showTickMark: S = !1,
13
- ticks: c,
11
+ showLine: p = !1,
12
+ showTickMark: v = !1,
13
+ ticks: d,
14
14
  tickLabelFormatter: x
15
15
  }) {
16
- const { theme: s } = D(), { getYScale: b, getYAxisConfig: A, drawingArea: e } = I(), r = b(), m = A(), a = E(
17
- () => r ? _(r, m, c, x) : [],
18
- [r, m, c, x]
16
+ const { getYScale: g, getYAxisConfig: A, drawingArea: e } = T(), i = g(), m = A(), n = C(
17
+ () => i ? D(i, m, d, x) : [],
18
+ [i, m, d, x]
19
19
  );
20
- if (!r || e.height <= 0)
20
+ if (!i || e.height <= 0)
21
21
  return null;
22
- const y = d === "start", o = y ? e.x : e.x + e.width, h = y ? -1 : 1, T = o + h * (f + $);
23
- return /* @__PURE__ */ C("g", { "data-testid": "y-axis", children: [
24
- u && a.map((t, i) => /* @__PURE__ */ n(
22
+ const y = l === "start", r = y ? e.x : e.x + e.width, c = y ? -1 : 1, k = r + c * (f + E);
23
+ return /* @__PURE__ */ b("g", { "data-testid": "y-axis", children: [
24
+ u && n.filter((t) => S(t, e)).map((t, o) => /* @__PURE__ */ a(
25
25
  "line",
26
26
  {
27
27
  x1: e.x,
28
28
  y1: t.position,
29
29
  x2: e.x + e.width,
30
30
  y2: t.position,
31
- style: { stroke: s.colors.border.mutedSubtle },
32
- strokeWidth: l,
33
- strokeDasharray: p === "dashed" ? "3 3" : void 0
31
+ style: { stroke: s("var(--border-muted-subtle)") },
32
+ strokeWidth: s("var(--stroke-1)"),
33
+ strokeDasharray: h === "dashed" ? "3 3" : void 0
34
34
  },
35
- `grid-${t.value}-${i}`
35
+ `grid-${t.value}-${o}`
36
36
  )),
37
- g && /* @__PURE__ */ n(
37
+ p && /* @__PURE__ */ a(
38
38
  "line",
39
39
  {
40
- x1: o,
40
+ x1: r,
41
41
  y1: e.y,
42
- x2: o,
42
+ x2: r,
43
43
  y2: e.y + e.height,
44
- style: { stroke: s.colors.border.muted },
45
- strokeWidth: l,
44
+ style: { stroke: s("var(--border-muted)") },
45
+ strokeWidth: s("var(--stroke-1)"),
46
46
  shapeRendering: "crispEdges",
47
47
  strokeLinecap: "square"
48
48
  }
49
49
  ),
50
- S && a.map((t, i) => /* @__PURE__ */ n(
50
+ v && n.map((t, o) => /* @__PURE__ */ a(
51
51
  "line",
52
52
  {
53
- x1: o,
53
+ x1: r,
54
54
  y1: t.position,
55
- x2: o + h * f,
55
+ x2: r + c * f,
56
56
  y2: t.position,
57
- style: { stroke: s.colors.border.muted },
58
- strokeWidth: l
57
+ style: { stroke: s("var(--border-muted)") },
58
+ strokeWidth: s("var(--stroke-1)")
59
59
  },
60
- `tick-${t.value}-${i}`
60
+ `tick-${t.value}-${o}`
61
61
  )),
62
- a.map((t, i) => /* @__PURE__ */ n(
62
+ n.map((t, o) => /* @__PURE__ */ a(
63
63
  "text",
64
64
  {
65
- x: T,
65
+ x: k,
66
66
  y: t.position,
67
- textAnchor: d === "start" ? "end" : "start",
67
+ textAnchor: l === "start" ? "end" : "start",
68
68
  dominantBaseline: "central",
69
- style: { fill: s.colors.text.muted },
70
- fontSize: s.typographies.xs.body.body4.fontSize,
71
- fontFamily: s.fontFamilies.sans,
69
+ style: {
70
+ fill: s("var(--text-muted)"),
71
+ fontSize: s("var(--font-style-body-4-size)"),
72
+ fontFamily: s("var(--font-family-font)")
73
+ },
72
74
  children: t.label
73
75
  },
74
- `label-${t.value}-${i}`
76
+ `label-${t.value}-${o}`
75
77
  ))
76
78
  ] });
77
79
  }
78
80
  export {
79
81
  w as DEFAULT_AXIS_WIDTH,
80
- L as YAxis
82
+ F as YAxis
81
83
  };
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAoCnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuB,EACvB,KAAK,EACL,WAAW,EACX,SAAmB,EACnB,QAAQ,GACT,EAAE,mBAAmB,2CA4ErB"}
1
+ {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/CartesianChart.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAQnD,wBAAgB,cAAc,CAAC,EAC7B,MAAM,EACN,KAAK,EACL,KAAK,EACL,KAAc,EACd,MAAuB,EACvB,KAAK,EACL,WAAW,EACX,SAAmB,EACnB,QAAQ,GACT,EAAE,mBAAmB,2CA2FrB"}
@@ -1,78 +1,78 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import { useRef as A, useState as I, useCallback as D, useEffect as P, useMemo as b } from "react";
3
- import { useBuildChartContext as T } from "./context/useBuildChartContext.js";
4
- import { CartesianChartProvider as z } from "./context/cartesianChartContext.js";
5
- const M = 160, o = {
6
- top: 8,
7
- right: 0,
8
- bottom: 0,
9
- left: 0
10
- }, O = { top: 0, right: 0, bottom: 0, left: 0 }, W = (t) => t === void 0 ? o : typeof t == "number" ? { top: t, right: t, bottom: t, left: t } : {
11
- top: t.top ?? o.top,
12
- right: t.right ?? o.right,
13
- bottom: t.bottom ?? o.bottom,
14
- left: t.left ?? o.left
15
- }, _ = (t) => t === void 0 ? O : {
16
- top: t.top ?? 0,
17
- right: t.right ?? 0,
18
- bottom: t.bottom ?? 0,
19
- left: t.left ?? 0
20
- };
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { useRef as I, useState as M, useCallback as O, useEffect as W, useMemo as v } from "react";
3
+ import { resolveInset as g, resolveAxisPadding as z, OVERFLOW_NEGATIVE_MARGIN as m, DEFAULT_HEIGHT as G } from "./utils.js";
4
+ import { useBuildChartContext as P } from "./context/useBuildChartContext.js";
5
+ import { CartesianChartProvider as T } from "./context/cartesianChartContext.js";
21
6
  function L({
22
- series: t,
23
- xAxis: h,
24
- yAxis: p,
7
+ series: b,
8
+ xAxis: p,
9
+ yAxis: C,
25
10
  width: e = "100%",
26
- height: n = M,
27
- inset: l,
28
- axisPadding: f,
29
- ariaLabel: C = "Chart",
30
- children: y
11
+ height: t = G,
12
+ inset: a,
13
+ axisPadding: d,
14
+ ariaLabel: y = "Chart",
15
+ children: h
31
16
  }) {
32
- const s = A(null), [u, g] = I(
17
+ const s = I(null), [c, R] = M(
33
18
  typeof e == "number" ? e : void 0
34
- ), i = typeof e != "number", a = D((r) => {
35
- const [v] = r;
36
- v && g(v.contentRect.width);
19
+ ), o = typeof e != "number", l = O((r) => {
20
+ const [f] = r;
21
+ f && R(f.contentRect.width);
37
22
  }, []);
38
- P(() => {
39
- if (!i || !s.current || typeof ResizeObserver > "u")
23
+ W(() => {
24
+ if (!o || !s.current || typeof ResizeObserver > "u")
40
25
  return;
41
- const r = new ResizeObserver(a);
26
+ const r = new ResizeObserver(l);
42
27
  return r.observe(s.current), () => r.disconnect();
43
- }, [i, a]);
44
- const m = typeof e == "number" ? e : u ?? 0, R = b(() => W(l), [l]), x = b(
45
- () => _(f),
46
- [f]
47
- ), E = T({
48
- series: t,
49
- xAxis: h,
50
- yAxis: p,
51
- width: m,
52
- height: n,
53
- inset: R,
54
- axisPadding: x
55
- }), d = /* @__PURE__ */ c(
28
+ }, [o, l]);
29
+ const i = typeof e == "number" ? e : c ?? 0, x = v(() => g(a), [a]), E = v(
30
+ () => z(d),
31
+ [d]
32
+ ), A = P({
33
+ series: b,
34
+ xAxis: p,
35
+ yAxis: C,
36
+ width: i,
37
+ height: t,
38
+ inset: x,
39
+ axisPadding: E
40
+ }), u = /* @__PURE__ */ n(
56
41
  "svg",
57
42
  {
58
43
  "data-testid": "chart-svg",
59
- width: m,
60
- height: n,
44
+ width: i,
45
+ height: t,
61
46
  role: "img",
62
- "aria-label": C || "Chart",
47
+ "aria-label": y || "Chart",
63
48
  style: { display: "block", overflow: "visible" },
64
- children: /* @__PURE__ */ c(z, { value: E, children: y })
49
+ children: /* @__PURE__ */ n(T, { value: A, children: h })
65
50
  }
66
51
  );
67
- return i ? /* @__PURE__ */ c(
52
+ return o ? /* @__PURE__ */ n(
68
53
  "div",
69
54
  {
70
55
  ref: s,
71
56
  "data-testid": "chart-container",
72
- style: { width: e, height: n },
73
- children: u !== void 0 && d
57
+ style: {
58
+ width: e,
59
+ height: t,
60
+ ...m
61
+ },
62
+ children: c !== void 0 && u
63
+ }
64
+ ) : /* @__PURE__ */ n(
65
+ "div",
66
+ {
67
+ "data-testid": "chart-container",
68
+ style: {
69
+ width: i,
70
+ height: t,
71
+ ...m
72
+ },
73
+ children: u
74
74
  }
75
- ) : d;
75
+ );
76
76
  }
77
77
  export {
78
78
  L as CartesianChart
@@ -26,8 +26,10 @@ export type CartesianChartProps = {
26
26
  */
27
27
  height?: number;
28
28
  /**
29
- * Padding between the SVG edge and the drawing area.
30
- * A number applies uniformly; a partial object overrides individual sides.
29
+ * Extra padding between the SVG edge and the drawing area, added on top of
30
+ * a built-in overflow buffer that prevents content (labels, points, ticks)
31
+ * from being clipped. A number applies uniformly; a partial object sets
32
+ * individual sides (unset sides default to `0`).
31
33
  */
32
34
  inset?: number | Partial<ChartInset>;
33
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE7E,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACrC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAClC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { ChartInset } from '../../utils/types';
2
+ import { CartesianChartProps } from './types';
3
+ export declare const DEFAULT_HEIGHT = 160;
4
+ /**
5
+ * Internal buffer that prevents SVG content (labels, points, ticks) from being
6
+ * clipped at the edge of the container. Compensated by negative margins on the
7
+ * wrapper so the chart's visual footprint stays unchanged.
8
+ */
9
+ export declare const OVERFLOW_BUFFER: ChartInset;
10
+ export declare const OVERFLOW_NEGATIVE_MARGIN: {
11
+ marginTop: number;
12
+ marginRight: number;
13
+ marginBottom: number;
14
+ marginLeft: number;
15
+ };
16
+ export declare const ZERO_PADDING: ChartInset;
17
+ export declare const resolveInset: (inset: CartesianChartProps["inset"]) => ChartInset;
18
+ export declare const resolveAxisPadding: (padding: CartesianChartProps["axisPadding"]) => ChartInset;
19
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/CartesianChart/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,eAAO,MAAM,cAAc,MAAM,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,UAK7B,CAAC;AACF,eAAO,MAAM,wBAAwB;;;;;CAKpC,CAAC;AACF,eAAO,MAAM,YAAY,EAAE,UAK1B,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,OAAO,mBAAmB,CAAC,OAAO,CAAC,KAClC,UAqBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,SAAS,mBAAmB,CAAC,aAAa,CAAC,KAC1C,UAQF,CAAC"}
@@ -0,0 +1,42 @@
1
+ const m = 160, r = {
2
+ top: 30,
3
+ right: 20,
4
+ bottom: 30,
5
+ left: 20
6
+ }, f = {
7
+ marginTop: -30,
8
+ marginRight: -20,
9
+ marginBottom: -30,
10
+ marginLeft: -20
11
+ }, e = {
12
+ top: 0,
13
+ right: 0,
14
+ bottom: 0,
15
+ left: 0
16
+ }, l = (t) => {
17
+ let o;
18
+ return t === void 0 ? o = e : typeof t == "number" ? o = { top: t, right: t, bottom: t, left: t } : o = {
19
+ top: t.top ?? 0,
20
+ right: t.right ?? 0,
21
+ bottom: t.bottom ?? 0,
22
+ left: t.left ?? 0
23
+ }, {
24
+ top: o.top + r.top,
25
+ right: o.right + r.right,
26
+ bottom: o.bottom + r.bottom,
27
+ left: o.left + r.left
28
+ };
29
+ }, g = (t) => t === void 0 ? e : {
30
+ top: t.top ?? 0,
31
+ right: t.right ?? 0,
32
+ bottom: t.bottom ?? 0,
33
+ left: t.left ?? 0
34
+ };
35
+ export {
36
+ m as DEFAULT_HEIGHT,
37
+ r as OVERFLOW_BUFFER,
38
+ f as OVERFLOW_NEGATIVE_MARGIN,
39
+ e as ZERO_PADDING,
40
+ g as resolveAxisPadding,
41
+ l as resolveInset
42
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/Line.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,MAAM,EACN,QAAgB,EAChB,QAAQ,EAAE,SAAsB,GACjC,EAAE,SAAS,kDA6EX"}
1
+ {"version":3,"file":"Line.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/Line.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAKzC,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,MAAM,EACN,QAAgB,EAChB,QAAQ,EAAE,SAAsB,GACjC,EAAE,SAAS,kDA6EX"}
@@ -1,27 +1,28 @@
1
1
  import { jsxs as l, Fragment as m, jsx as e } from "react/jsx-runtime";
2
- import { useId as y, useMemo as d } from "react";
2
+ import { useId as S, useMemo as d } from "react";
3
3
  import { isNumericScale as A } from "../../utils/scales/scales.js";
4
- import { toScaledPoints as P, buildLinePath as T, buildAreaPath as I } from "./utils.js";
5
- import { useCartesianChartContext as L } from "../CartesianChart/context/cartesianChartContext.js";
6
- const O = 2, _ = 0.2;
7
- function M({
4
+ import { toScaledPoints as P, buildLinePath as I, buildAreaPath as L } from "./utils.js";
5
+ import { useCartesianChartContext as T } from "../CartesianChart/context/cartesianChartContext.js";
6
+ import { cssVar as j } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
7
+ const O = 0.2;
8
+ function N({
8
9
  seriesId: g,
9
10
  stroke: h,
10
- showArea: i = !1,
11
- areaType: j = "gradient"
11
+ showArea: n = !1,
12
+ areaType: _ = "gradient"
12
13
  }) {
13
- const { getXScale: x, getYScale: C, getXAxisConfig: S, drawingArea: r, seriesMap: k } = L(), s = x(), o = C(), c = S(), p = y(), n = k.get(g), a = h ?? n?.stroke, t = d(
14
- () => n?.data && s && o && A(o) ? P(n.data, s, o, c?.data) : null,
15
- [n, s, o, c]
14
+ const { getXScale: x, getYScale: k, getXAxisConfig: C, drawingArea: i, seriesMap: y } = T(), s = x(), o = k(), c = C(), p = S(), r = y.get(g), a = h ?? r?.stroke, t = d(
15
+ () => r?.data && s && o && A(o) ? P(r.data, s, o, c?.data) : null,
16
+ [r, s, o, c]
16
17
  ), f = d(
17
- () => t ? T(t) : null,
18
+ () => t ? I(t) : null,
18
19
  [t]
19
20
  ), u = d(
20
- () => i && t && r ? I(t, r) : null,
21
- [i, t, r]
21
+ () => n && t && i ? L(t, i) : null,
22
+ [n, t, i]
22
23
  );
23
24
  return f ? /* @__PURE__ */ l(m, { children: [
24
- i && u && a && /* @__PURE__ */ l(m, { children: [
25
+ n && u && a && /* @__PURE__ */ l(m, { children: [
25
26
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ l(
26
27
  "linearGradient",
27
28
  {
@@ -37,7 +38,7 @@ function M({
37
38
  {
38
39
  offset: "0%",
39
40
  stopColor: a,
40
- stopOpacity: _
41
+ stopOpacity: O
41
42
  }
42
43
  ),
43
44
  /* @__PURE__ */ e("stop", { offset: "100%", stopColor: a, stopOpacity: 0 })
@@ -61,7 +62,7 @@ function M({
61
62
  d: f,
62
63
  fill: "none",
63
64
  stroke: a,
64
- strokeWidth: O,
65
+ strokeWidth: j("var(--stroke-2)"),
65
66
  strokeLinecap: "round",
66
67
  strokeLinejoin: "round"
67
68
  }
@@ -69,5 +70,5 @@ function M({
69
70
  ] }) : null;
70
71
  }
71
72
  export {
72
- M as Line
73
+ N as Line
73
74
  };
@@ -6,7 +6,7 @@ type Point = [x: number, y: number];
6
6
  * When `xData` contains numeric values, those values are fed into the scale
7
7
  * instead of the array index so the points honour a numeric X domain.
8
8
  */
9
- export declare const toScaledPoints: (data: Array<number | null>, xScale: ChartScaleFunction, yScale: NumericScale, xData?: ReadonlyArray<string | number>) => Point[] | null;
9
+ export declare const toScaledPoints: (data: (number | null)[], xScale: ChartScaleFunction, yScale: NumericScale, xData?: readonly (string | number)[]) => Point[] | null;
10
10
  /**
11
11
  * Build the SVG `d` attribute for the line stroke.
12
12
  */
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EAC1B,QAAQ,kBAAkB,EAC1B,QAAQ,YAAY,EACpB,QAAQ,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC,KACrC,KAAK,EAAE,GAAG,IAmBZ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,MAAM,GAAG,IAOxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,KAAK,EAAE,EACf,aAAa,WAAW,KACvB,MAAM,GAAG,IAUX,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Line/utils.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,mBAAmB,CAAC;AAE3B,KAAK,KAAK,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAEpC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EACvB,QAAQ,kBAAkB,EAC1B,QAAQ,YAAY,EACpB,QAAQ,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KACnC,KAAK,EAAE,GAAG,IAmBZ,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,MAAM,GAAG,IAOxD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,KAAK,EAAE,EACf,aAAa,WAAW,KACvB,MAAM,GAAG,IAUX,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PointLabelProps, PointProps } from './types';
2
+ export declare function PointLabel({ style, textAnchor, dominantBaseline, ...props }: Readonly<PointLabelProps>): import("react/jsx-runtime").JSX.Element;
3
+ export declare function Point({ dataX, dataY, color, label, LabelComponent, labelPosition, hidePoint, showLabelArrow, size, onClick, }: Readonly<PointProps>): import("react/jsx-runtime").JSX.Element | null;
4
+ //# sourceMappingURL=Point.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Point.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/Point.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAU3D,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,UAAqB,EACrB,gBAAyB,EACzB,GAAG,KAAK,EACT,EAAE,QAAQ,CAAC,eAAe,CAAC,2CAe3B;AAED,wBAAgB,KAAK,CAAC,EACpB,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,cAAc,EACd,aAAqB,EACrB,SAAiB,EACjB,cAAqB,EACrB,IAAmB,EACnB,OAAO,GACR,EAAE,QAAQ,CAAC,UAAU,CAAC,kDA0DtB"}
@@ -0,0 +1,85 @@
1
+ import { jsxs as W, jsx as n } from "react/jsx-runtime";
2
+ import { useMemo as j } from "react";
3
+ import { projectPoint as k } from "../../utils/scales/scales.js";
4
+ import { isWithinBounds as E, resolveLabel as P, STROKE_WIDTH as T, buildArrowPoints as z, computeLabelY as C, DEFAULT_SIZE as D } from "./utils.js";
5
+ import { useCartesianChartContext as F } from "../CartesianChart/context/cartesianChartContext.js";
6
+ import { cssVar as o } from "../../../libs/design-core/dist/lib/cssVar/cssVar.js";
7
+ function I({
8
+ style: e,
9
+ textAnchor: r = "middle",
10
+ dominantBaseline: i = "auto",
11
+ ...s
12
+ }) {
13
+ return /* @__PURE__ */ n(
14
+ "text",
15
+ {
16
+ textAnchor: r,
17
+ dominantBaseline: i,
18
+ style: {
19
+ fill: o("var(--text-base)"),
20
+ fontSize: o("var(--font-style-body-4-size)"),
21
+ fontWeight: o("var(--font-style-body-4-weight-medium)"),
22
+ fontFamily: o("var(--font-family-font)"),
23
+ ...e
24
+ },
25
+ ...s
26
+ }
27
+ );
28
+ }
29
+ function O({
30
+ dataX: e,
31
+ dataY: r,
32
+ color: i,
33
+ label: s,
34
+ LabelComponent: p,
35
+ labelPosition: d = "top",
36
+ hidePoint: y = !1,
37
+ showLabelArrow: x = !0,
38
+ size: b = D,
39
+ onClick: f
40
+ }) {
41
+ const { getXScale: v, getYScale: g, drawingArea: h } = F(), l = v(), a = g(), c = b / 2, L = i ?? o("var(--background-muted-strong)"), t = j(() => {
42
+ if (!(!l || !a))
43
+ return k(e, r, l, a);
44
+ }, [e, r, l, a]);
45
+ if (!t || !E(t.x, t.y, h))
46
+ return null;
47
+ const u = P(s, e), S = u != null, m = x && S, w = C(t.y, c, d, m), A = p ?? I;
48
+ return /* @__PURE__ */ W(
49
+ "g",
50
+ {
51
+ "data-testid": "point-group",
52
+ onClick: f,
53
+ style: f ? { cursor: "pointer" } : void 0,
54
+ children: [
55
+ !y && /* @__PURE__ */ n(
56
+ "circle",
57
+ {
58
+ "data-testid": "point-circle",
59
+ cx: t.x,
60
+ cy: t.y,
61
+ r: c,
62
+ style: {
63
+ fill: L,
64
+ stroke: o("var(--background-canvas)")
65
+ },
66
+ strokeWidth: T
67
+ }
68
+ ),
69
+ m && /* @__PURE__ */ n(
70
+ "polygon",
71
+ {
72
+ "data-testid": "point-arrow",
73
+ points: z(t.x, t.y, c, d),
74
+ style: { fill: o("var(--text-base)") }
75
+ }
76
+ ),
77
+ u != null && /* @__PURE__ */ n(A, { x: t.x, y: w, children: u })
78
+ ]
79
+ }
80
+ );
81
+ }
82
+ export {
83
+ O as Point,
84
+ I as PointLabel
85
+ };
@@ -0,0 +1,3 @@
1
+ export { Point, PointLabel } from './Point';
2
+ export type { PointLabelComponent, PointLabelProps, PointProps } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC5C,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { ComponentType, MouseEvent, SVGProps } from 'react';
2
+ export type PointLabelProps = {
3
+ x: number;
4
+ y: number;
5
+ children: string;
6
+ } & Omit<SVGProps<SVGTextElement>, 'x' | 'y' | 'children'>;
7
+ export type PointLabelComponent = ComponentType<PointLabelProps>;
8
+ export type PointProps = {
9
+ /**
10
+ * X coordinate in data space (index or explicit value).
11
+ */
12
+ dataX: number;
13
+ /**
14
+ * Y coordinate in data space.
15
+ */
16
+ dataY: number;
17
+ /**
18
+ * Fill color of the point circle.
19
+ * Defaults to `var(--background-muted-strong)`.
20
+ *
21
+ * Use the `cssVar` helper from `@ledgerhq/lumen-design-core` to
22
+ * resolve a design-token CSS variable at runtime:
23
+ *
24
+ * @example
25
+ * ```tsx
26
+ * import { cssVar } from '@ledgerhq/lumen-design-core';
27
+ *
28
+ * <Point dataX={0} dataY={42} color={cssVar('var(--background-error-strong)')} />
29
+ * ```
30
+ */
31
+ color?: string;
32
+ /**
33
+ * Text label displayed near the point.
34
+ * A string is rendered directly; a function receives `dataX` and returns
35
+ * the label string, enabling index-based formatting.
36
+ */
37
+ label?: string | ((dataIndex: number) => string);
38
+ /**
39
+ * Custom component rendered instead of the default `PointLabel`.
40
+ * Receives pixel coordinates (`x`, `y`) and the resolved label as
41
+ * `children`. Use `PointLabel` inside your component to retain
42
+ * design-token styling while customising layout or appearance.
43
+ */
44
+ LabelComponent?: PointLabelComponent;
45
+ /**
46
+ * Placement of the label relative to the point.
47
+ * @default 'top'
48
+ */
49
+ labelPosition?: 'top' | 'bottom';
50
+ /**
51
+ * When `true`, the point circle is hidden but the label (if any) is still rendered.
52
+ * @default false
53
+ */
54
+ hidePoint?: boolean;
55
+ /**
56
+ * Diameter of the point circle in pixels.
57
+ * Internally converted to an SVG radius (`size / 2`).
58
+ * @default 10
59
+ */
60
+ size?: number;
61
+ /**
62
+ * When `true`, an arrow is displayed pointing from the point to the label.
63
+ * @default true
64
+ */
65
+ showLabelArrow?: boolean;
66
+ /**
67
+ * Called when the point is clicked.
68
+ */
69
+ onClick?: (event: MouseEvent<SVGGElement>) => void;
70
+ };
71
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,UAAU,CAAC,CAAC;AAE3D,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;AAEjE,MAAM,MAAM,UAAU,GAAG;IACvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC;IACjD;;;;;OAKG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;IACrC;;;OAGG;IACH,aAAa,CAAC,EAAE,KAAK,GAAG,QAAQ,CAAC;IACjC;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;CACpD,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { DrawingArea } from '../../utils/types';
2
+ export declare const DEFAULT_SIZE = 10;
3
+ export declare const STROKE_WIDTH = 2;
4
+ export declare const ARROW_WIDTH = 6;
5
+ export declare const ARROW_HEIGHT = 4;
6
+ export declare const GAP = 4;
7
+ export declare const LABEL_FONT_SIZE = 10;
8
+ export declare const isWithinBounds: (px: number, py: number, area: DrawingArea) => boolean;
9
+ /**
10
+ * Builds the three SVG points of the arrow triangle.
11
+ *
12
+ * `'top'` → arrow sits below the label, tip pointing **down** toward the circle.
13
+ * `'bottom'` → arrow sits above the label, tip pointing **up** toward the circle.
14
+ */
15
+ export declare const buildArrowPoints: (cx: number, cy: number, radius: number, position: "top" | "bottom") => string;
16
+ /**
17
+ * Resolves the label prop to a string or undefined.
18
+ */
19
+ export declare const resolveLabel: (label: string | ((dataIndex: number) => string) | undefined, dataX: number) => string | undefined;
20
+ /**
21
+ * Computes the vertical position of the label text baseline.
22
+ */
23
+ export declare const computeLabelY: (pixelY: number, radius: number, labelPosition: "top" | "bottom", renderArrow: boolean) => number;
24
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/Point/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,eAAO,MAAM,YAAY,KAAK,CAAC;AAC/B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,eAAO,MAAM,GAAG,IAAI,CAAC;AACrB,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC,eAAO,MAAM,cAAc,GACzB,IAAI,MAAM,EACV,IAAI,MAAM,EACV,MAAM,WAAW,KAChB,OAIyB,CAAC;AAE7B;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,IAAI,MAAM,EACV,IAAI,MAAM,EACV,QAAQ,MAAM,EACd,UAAU,KAAK,GAAG,QAAQ,KACzB,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,SAAS,EAC3D,OAAO,MAAM,KACZ,MAAM,GAAG,SAGX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,GACxB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,eAAe,KAAK,GAAG,QAAQ,EAC/B,aAAa,OAAO,KACnB,MAMF,CAAC"}
@@ -0,0 +1,26 @@
1
+ const $ = 10, E = 2, G = 6, H = 4, T = 4, f = 10, I = (t, n, o) => t >= o.x && t <= o.x + o.width && n >= o.y && n <= o.y + o.height, O = (t, n, o, s) => {
2
+ if (s === "top") {
3
+ const R = n - o - 4, _ = R - 4;
4
+ return `${t},${R} ${t - 3},${_} ${t + 3},${_}`;
5
+ }
6
+ const W = n + o + 4, c = W + 4;
7
+ return `${t},${W} ${t - 3},${c} ${t + 3},${c}`;
8
+ }, e = (t, n) => {
9
+ const o = typeof t == "function" ? t(n) : t;
10
+ return o === "" ? void 0 : o;
11
+ }, h = (t, n, o, s) => {
12
+ const A = s ? 8 : 4;
13
+ return o === "top" ? t - n - A - 4 : t + n + A + 4 + 10;
14
+ };
15
+ export {
16
+ H as ARROW_HEIGHT,
17
+ G as ARROW_WIDTH,
18
+ $ as DEFAULT_SIZE,
19
+ T as GAP,
20
+ f as LABEL_FONT_SIZE,
21
+ E as STROKE_WIDTH,
22
+ O as buildArrowPoints,
23
+ h as computeLabelY,
24
+ I as isWithinBounds,
25
+ e as resolveLabel
26
+ };
@@ -1,2 +1,3 @@
1
1
  export * from './LineChart';
2
+ export * from './Point';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/Components/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
@@ -1,4 +1,8 @@
1
1
  import { AxisBounds, AxisConfigProps, CategoricalScale, ChartScaleFunction, NumericScale } from '../types';
2
+ /**
3
+ * Creates a numeric scale with `.nice()` applied so the domain
4
+ * extends to clean rounded boundaries (e.g. `[4, 98]` → `[0, 100]`).
5
+ */
2
6
  export declare const getNumericScale: ({ scaleType, domain, range, }: {
3
7
  scaleType: "linear" | "log";
4
8
  domain: AxisBounds;
@@ -21,4 +25,12 @@ export declare const isCategoricalScale: (scale: ChartScaleFunction) => scale is
21
25
  * Checks if a scale is a numeric scale.
22
26
  */
23
27
  export declare const isNumericScale: (scale: ChartScaleFunction) => scale is NumericScale;
28
+ /**
29
+ * Projects a single data-space coordinate pair into pixel-space.
30
+ * Handles centering for categorical (band) scales.
31
+ */
32
+ export declare const projectPoint: (dataX: number, dataY: number, xScale: ChartScaleFunction, yScale: ChartScaleFunction) => {
33
+ x: number;
34
+ y: number;
35
+ };
24
36
  //# sourceMappingURL=scales.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,eAAe,GAAI,+BAI7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACnB,KAAG,YAGH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,6BAIjC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAUH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,eAAe,CAAC,WAAW,CAAC,KACtC,SAAS,IAAI,MAA8B,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,kBAAkB,KACxB,KAAK,IAAI,gBAEX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,KACxB,KAAK,IAAI,YAEX,CAAC"}
1
+ {"version":3,"file":"scales.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/scales/scales.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACb,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,+BAI7B;IACD,SAAS,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;CACnB,KAAG,YAMH,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,6BAIjC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,gBAUH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAC1B,WAAW,eAAe,CAAC,WAAW,CAAC,KACtC,SAAS,IAAI,MAA8B,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,OAAO,kBAAkB,KACxB,KAAK,IAAI,gBAEX,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,KACxB,KAAK,IAAI,YAEX,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,OAAO,MAAM,EACb,QAAQ,kBAAkB,EAC1B,QAAQ,kBAAkB,KACzB;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAQxB,CAAC"}
@@ -1,25 +1,29 @@
1
- import i from "../../../node_modules/d3-scale/src/band.js";
2
- import o from "../../../node_modules/d3-scale/src/log.js";
3
- import c from "../../../node_modules/d3-scale/src/linear.js";
4
- const u = ({
1
+ import c from "../../../node_modules/d3-scale/src/band.js";
2
+ import a from "../../../node_modules/d3-scale/src/log.js";
3
+ import s from "../../../node_modules/d3-scale/src/linear.js";
4
+ const p = ({
5
5
  scaleType: n,
6
6
  domain: r,
7
7
  range: t
8
- }) => (n === "log" ? o() : c()).domain([r.min, r.max]).range([t.min, t.max]), p = ({
8
+ }) => (n === "log" ? a() : s()).domain([r.min, r.max]).nice().range([t.min, t.max]), b = ({
9
9
  domain: n,
10
10
  range: r,
11
11
  padding: t = 0.1
12
12
  }) => {
13
- const a = Array.from(
13
+ const o = Array.from(
14
14
  { length: n.max - n.min + 1 },
15
- (l, e) => n.min + e
15
+ (m, i) => n.min + i
16
16
  );
17
- return i().domain(a).range([r.min, r.max]).paddingInner(t).paddingOuter(t / 2);
18
- }, f = (n) => n === "band", m = (n) => "bandwidth" in n && typeof n.bandwidth == "function", x = (n) => !m(n);
17
+ return c().domain(o).range([r.min, r.max]).paddingInner(t).paddingOuter(t / 2);
18
+ }, f = (n) => n === "band", e = (n) => "bandwidth" in n && typeof n.bandwidth == "function", l = (n) => !e(n), h = (n, r, t, o) => {
19
+ const m = e(t) ? (t(n) ?? 0) + t.bandwidth() / 2 : t(n), i = e(o) ? (o(r) ?? 0) + o.bandwidth() / 2 : o(r);
20
+ return { x: m, y: i };
21
+ };
19
22
  export {
20
- p as getCategoricalScale,
21
- u as getNumericScale,
23
+ b as getCategoricalScale,
24
+ p as getNumericScale,
22
25
  f as isBandScaleType,
23
- m as isCategoricalScale,
24
- x as isNumericScale
26
+ e as isCategoricalScale,
27
+ l as isNumericScale,
28
+ h as projectPoint
25
29
  };
@@ -1,4 +1,4 @@
1
- import { AxisConfigProps, ChartScaleFunction } from '../types';
1
+ import { AxisConfigProps, ChartScaleFunction, DrawingArea } from '../types';
2
2
  export declare const APPROXIMATE_TICK_COUNT = 5;
3
3
  export type TickData = {
4
4
  position: number;
@@ -24,4 +24,14 @@ export declare const getTickLabel: (tick: number, axisData: AxisConfigProps["dat
24
24
  * Builds the complete tick data array from a scale and axis configuration.
25
25
  */
26
26
  export declare const buildTicksData: (scale: ChartScaleFunction, axisConfig?: AxisConfigProps, explicitTicks?: number[], formatter?: (value: number | string) => string) => TickData[];
27
+ /**
28
+ * Excludes the X grid line at the Y-axis origin (left edge)
29
+ * to prevent overlap with the Y-axis solid line.
30
+ */
31
+ export declare const isTickOnXAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
32
+ /**
33
+ * Excludes the Y grid line at the X-axis origin (bottom edge)
34
+ * to prevent overlap with the X-axis solid line.
35
+ */
36
+ export declare const isTickOnYAxisDomainEdge: (tick: TickData, drawingArea: DrawingArea) => boolean;
27
37
  //# sourceMappingURL=ticks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEpE,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,kBAAkB,EACzB,gBAAgB,MAAM,EAAE,KACvB,MAAM,EAKR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,kBAAkB,EACzB,MAAM,MAAM,KACX,MAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,UAAU,eAAe,CAAC,MAAM,CAAC,EACjC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,EACzB,aAAa,eAAe,EAC5B,gBAAgB,MAAM,EAAE,EACxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,QAAQ,EASV,CAAC"}
1
+ {"version":3,"file":"ticks.d.ts","sourceRoot":"","sources":["../../../../src/lib/utils/ticks/ticks.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,OAAO,kBAAkB,EACzB,gBAAgB,MAAM,EAAE,KACvB,MAAM,EAKR,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO,kBAAkB,EACzB,MAAM,MAAM,KACX,MAKF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,YAAY,GACvB,MAAM,MAAM,EACZ,UAAU,eAAe,CAAC,MAAM,CAAC,EACjC,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,MAeF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,GACzB,OAAO,kBAAkB,EACzB,aAAa,eAAe,EAC5B,gBAAgB,MAAM,EAAE,EACxB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,KAC7C,QAAQ,EASV,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,QAAQ,EACd,aAAa,WAAW,KACvB,OAEF,CAAC"}
@@ -1,23 +1,25 @@
1
- import { isCategoricalScale as u, isNumericScale as s } from "../scales/scales.js";
2
- const d = 5, f = (r, n) => n || (u(r) ? r.domain() : s(r) ? r.ticks(d) : []), S = (r, n) => u(r) ? (r(n) ?? 0) + r.bandwidth() / 2 : r(n), T = (r, n, t) => {
3
- const o = n && Array.isArray(n) && typeof n[0] == "string";
1
+ import { isCategoricalScale as u, isNumericScale as g } from "../scales/scales.js";
2
+ const d = 5, T = (n, r) => r || (u(n) ? n.domain() : g(n) ? n.ticks(d) : []), f = (n, r) => u(n) ? (n(r) ?? 0) + n.bandwidth() / 2 : n(r), c = (n, r, t) => {
3
+ const i = r && Array.isArray(r) && typeof r[0] == "string";
4
4
  if (t) {
5
- const e = o && n[r] !== void 0 ? n[r] : r;
6
- return String(t(e));
5
+ const o = i && r[n] !== void 0 ? r[n] : n;
6
+ return String(t(o));
7
7
  }
8
- return o && n[r] !== void 0 ? String(n[r]) : String(r);
9
- }, l = (r, n, t, o) => {
10
- const e = f(r, t), g = n?.data;
11
- return e.map((i) => ({
12
- position: S(r, i),
13
- value: i,
14
- label: T(i, g, o)
8
+ return i && r[n] !== void 0 ? String(r[n]) : String(n);
9
+ }, p = (n, r, t, i) => {
10
+ const o = T(n, t), s = r?.data;
11
+ return o.map((e) => ({
12
+ position: f(n, e),
13
+ value: e,
14
+ label: c(e, s, i)
15
15
  }));
16
- };
16
+ }, S = (n, r) => n.position !== r.x, b = (n, r) => n.position !== r.y + r.height;
17
17
  export {
18
18
  d as APPROXIMATE_TICK_COUNT,
19
- l as buildTicksData,
20
- T as getTickLabel,
21
- S as getTickPosition,
22
- f as getTickValues
19
+ p as buildTicksData,
20
+ c as getTickLabel,
21
+ f as getTickPosition,
22
+ T as getTickValues,
23
+ S as isTickOnXAxisDomainEdge,
24
+ b as isTickOnYAxisDomainEdge
23
25
  };
@@ -26,7 +26,7 @@ export type Series = {
26
26
  /**
27
27
  * Numeric data points; `null` entries represent gaps.
28
28
  */
29
- data?: Array<number | null>;
29
+ data?: (number | null)[];
30
30
  /**
31
31
  * Human-readable label used in legends and tooltips.
32
32
  */
@@ -52,6 +52,9 @@ export type AxisConfigProps = {
52
52
  * Fixed domain bounds or a function that adjusts the computed bounds.
53
53
  * A partial object overrides only the specified bound(s).
54
54
  * A function receives the auto-computed bounds and returns adjusted ones.
55
+ *
56
+ * The final domain is always rounded to nice boundaries via d3's `.nice()`,
57
+ * ensuring tick marks land on clean values (e.g. `[4, 98]` becomes `[0, 100]`).
55
58
  */
56
59
  domain?: Partial<AxisBounds> | ((bounds: AxisBounds) => AxisBounds);
57
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC5B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEzE,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;;OAGG;IACH,SAAS,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC3B;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,YAAY,GACpB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErC,MAAM,MAAM,gBAAgB,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAEjE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB;;OAEG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,SAAS,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,kBAAkB,GAAG,SAAS,CAAC;IAC3D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,cAAc,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,eAAe,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,WAAW,EAAE,WAAW,CAAC;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC"}
@@ -0,0 +1,4 @@
1
+ const c = (s) => s;
2
+ export {
3
+ c as cssVar
4
+ };
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react-visualization",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@ledgerhq/lumen-design-core": "0.1.11",
37
- "@ledgerhq/lumen-ui-react": "0.1.24",
37
+ "@ledgerhq/lumen-ui-react": "0.1.25",
38
38
  "class-variance-authority": "^0.7.1",
39
39
  "clsx": "^2.1.1",
40
40
  "react": "^18.0.0 || ^19.0.0",
@@ -52,4 +52,4 @@
52
52
  "@types/d3-scale": "^4.0.9",
53
53
  "@types/d3-shape": "^3.1.8"
54
54
  }
55
- }
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react-visualization",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "peerDependencies": {
36
36
  "@ledgerhq/lumen-design-core": "0.1.11",
37
- "@ledgerhq/lumen-ui-react": "0.1.25",
37
+ "@ledgerhq/lumen-ui-react": "0.1.26",
38
38
  "class-variance-authority": "^0.7.1",
39
39
  "clsx": "^2.1.1",
40
40
  "react": "^18.0.0 || ^19.0.0",
@@ -1,8 +0,0 @@
1
- import { createSafeContext as e } from "../../../libs/utils-shared/dist/index.js";
2
- const [o, r] = e("ThemeProvider"), m = () => r({
3
- consumerName: "useTheme",
4
- contextRequired: !0
5
- });
6
- export {
7
- m as useTheme
8
- };
@@ -1,35 +0,0 @@
1
- import { jsx as a } from "react/jsx-runtime";
2
- import { createContext as i, useRef as l, useContext as f } from "react";
3
- function d(n, o) {
4
- if (Object.is(n, o)) return !0;
5
- const u = n, t = o, c = Object.keys(u), s = Object.keys(t);
6
- return c.length !== s.length ? !1 : c.every(
7
- (e) => Object.prototype.hasOwnProperty.call(t, e) && Object.is(u[e], t[e])
8
- );
9
- }
10
- function b(n, o) {
11
- const u = i(o), t = ({ children: s, value: e }) => {
12
- const r = l(e);
13
- return d(r.current, e) || (r.current = e), /* @__PURE__ */ a(u.Provider, { value: r.current, children: s });
14
- };
15
- t.displayName = n + "Provider";
16
- function c({
17
- consumerName: s,
18
- contextRequired: e
19
- }) {
20
- const r = f(u);
21
- if (r)
22
- return r;
23
- if (e)
24
- throw new Error(
25
- `${s} must be used within ${n}`
26
- );
27
- return o || {};
28
- }
29
- return [t, c];
30
- }
31
- b("Disabled", { disabled: !1 });
32
- export {
33
- b as createSafeContext,
34
- d as shallowEqual
35
- };