@ledgerhq/lumen-ui-react-visualization 0.1.3 → 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 (69) hide show
  1. package/dist/index.js +5 -2
  2. package/dist/lib/Components/Axis/Axis.types.d.ts +33 -0
  3. package/dist/lib/Components/Axis/Axis.types.d.ts.map +1 -0
  4. package/dist/lib/Components/Axis/XAxis/XAxis.d.ts +4 -0
  5. package/dist/lib/Components/Axis/XAxis/XAxis.d.ts.map +1 -0
  6. package/dist/lib/Components/Axis/XAxis/XAxis.js +83 -0
  7. package/dist/lib/Components/Axis/XAxis/index.d.ts.map +1 -0
  8. package/dist/lib/Components/Axis/XAxis/types.d.ts +9 -0
  9. package/dist/lib/Components/Axis/XAxis/types.d.ts.map +1 -0
  10. package/dist/lib/Components/Axis/YAxis/YAxis.d.ts +4 -0
  11. package/dist/lib/Components/Axis/YAxis/YAxis.d.ts.map +1 -0
  12. package/dist/lib/Components/Axis/YAxis/YAxis.js +83 -0
  13. package/dist/lib/Components/Axis/YAxis/index.d.ts.map +1 -0
  14. package/dist/lib/Components/Axis/YAxis/types.d.ts +14 -0
  15. package/dist/lib/Components/Axis/YAxis/types.d.ts.map +1 -0
  16. package/dist/lib/Components/CartesianChart/CartesianChart.d.ts.map +1 -1
  17. package/dist/lib/Components/CartesianChart/CartesianChart.js +60 -51
  18. package/dist/lib/Components/CartesianChart/types.d.ts +4 -2
  19. package/dist/lib/Components/CartesianChart/types.d.ts.map +1 -1
  20. package/dist/lib/Components/CartesianChart/utils.d.ts +19 -0
  21. package/dist/lib/Components/CartesianChart/utils.d.ts.map +1 -0
  22. package/dist/lib/Components/CartesianChart/utils.js +42 -0
  23. package/dist/lib/Components/Line/Line.d.ts.map +1 -1
  24. package/dist/lib/Components/Line/Line.js +52 -31
  25. package/dist/lib/Components/Line/utils.d.ts +1 -1
  26. package/dist/lib/Components/Line/utils.d.ts.map +1 -1
  27. package/dist/lib/Components/LineChart/LineChart.d.ts.map +1 -1
  28. package/dist/lib/Components/LineChart/LineChart.js +32 -31
  29. package/dist/lib/Components/LineChart/types.d.ts +5 -3
  30. package/dist/lib/Components/LineChart/types.d.ts.map +1 -1
  31. package/dist/lib/Components/Point/Point.d.ts +4 -0
  32. package/dist/lib/Components/Point/Point.d.ts.map +1 -0
  33. package/dist/lib/Components/Point/Point.js +85 -0
  34. package/dist/lib/Components/Point/index.d.ts +3 -0
  35. package/dist/lib/Components/Point/index.d.ts.map +1 -0
  36. package/dist/lib/Components/Point/types.d.ts +71 -0
  37. package/dist/lib/Components/Point/types.d.ts.map +1 -0
  38. package/dist/lib/Components/Point/utils.d.ts +24 -0
  39. package/dist/lib/Components/Point/utils.d.ts.map +1 -0
  40. package/dist/lib/Components/Point/utils.js +26 -0
  41. package/dist/lib/Components/index.d.ts +1 -0
  42. package/dist/lib/Components/index.d.ts.map +1 -1
  43. package/dist/lib/utils/index.d.ts +1 -1
  44. package/dist/lib/utils/index.d.ts.map +1 -1
  45. package/dist/lib/utils/scales/scales.d.ts +12 -0
  46. package/dist/lib/utils/scales/scales.d.ts.map +1 -1
  47. package/dist/lib/utils/scales/scales.js +17 -13
  48. package/dist/lib/utils/ticks/ticks.d.ts +11 -1
  49. package/dist/lib/utils/ticks/ticks.d.ts.map +1 -1
  50. package/dist/lib/utils/ticks/ticks.js +19 -17
  51. package/dist/lib/utils/types.d.ts +4 -43
  52. package/dist/lib/utils/types.d.ts.map +1 -1
  53. package/dist/libs/design-core/dist/lib/cssVar/cssVar.js +4 -0
  54. package/dist/package.json +3 -3
  55. package/package.json +2 -2
  56. package/dist/lib/Components/XAxis/XAxis.d.ts +0 -4
  57. package/dist/lib/Components/XAxis/XAxis.d.ts.map +0 -1
  58. package/dist/lib/Components/XAxis/XAxis.js +0 -79
  59. package/dist/lib/Components/XAxis/index.d.ts.map +0 -1
  60. package/dist/lib/Components/XAxis/types.d.ts +0 -3
  61. package/dist/lib/Components/XAxis/types.d.ts.map +0 -1
  62. package/dist/lib/Components/YAxis/YAxis.d.ts +0 -4
  63. package/dist/lib/Components/YAxis/YAxis.d.ts.map +0 -1
  64. package/dist/lib/Components/YAxis/YAxis.js +0 -79
  65. package/dist/lib/Components/YAxis/index.d.ts.map +0 -1
  66. package/dist/lib/Components/YAxis/types.d.ts +0 -3
  67. package/dist/lib/Components/YAxis/types.d.ts.map +0 -1
  68. /package/dist/lib/Components/{XAxis → Axis/XAxis}/index.d.ts +0 -0
  69. /package/dist/lib/Components/{YAxis → Axis/YAxis}/index.d.ts +0 -0
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ledgerhq/lumen-ui-react-visualization",
3
- "version": "0.1.2",
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.22",
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.3",
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.24",
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,4 +0,0 @@
1
- import { XAxisProps } from './types';
2
- export declare const DEFAULT_AXIS_HEIGHT = 28;
3
- export declare function XAxis({ position, showGrid, showLine, showTickMark, ticks: ticksProp, tickLabelFormatter, }: XAxisProps): import("react/jsx-runtime").JSX.Element | null;
4
- //# sourceMappingURL=XAxis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"XAxis.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/XAxis/XAxis.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,wBAAgB,KAAK,CAAC,EACpB,QAAmB,EACnB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAkFZ"}
@@ -1,79 +0,0 @@
1
- import { jsxs as b, jsx as r } from "react/jsx-runtime";
2
- import { useMemo as T } from "react";
3
- import { buildTicksData as v } from "../../utils/ticks/ticks.js";
4
- import { useCartesianChartContext as C } from "../CartesianChart/context/cartesianChartContext.js";
5
- const l = 1, y = 4, E = 6, $ = 28;
6
- function k({
7
- position: n = "bottom",
8
- showGrid: c = !1,
9
- showLine: h = !1,
10
- showTickMark: p = !1,
11
- ticks: d,
12
- tickLabelFormatter: x
13
- }) {
14
- const { getXScale: f, getXAxisConfig: g, drawingArea: e } = C(), i = f(), m = g(), a = T(
15
- () => i ? v(i, m, d, x) : [],
16
- [i, m, d, x]
17
- );
18
- if (!i || e.width <= 0)
19
- return null;
20
- const s = n === "top" ? e.y : e.y + e.height, u = n === "top" ? -1 : 1, A = s + u * (y + E);
21
- return /* @__PURE__ */ b("g", { "data-testid": "x-axis", children: [
22
- c && a.map((t, o) => /* @__PURE__ */ r(
23
- "line",
24
- {
25
- x1: t.position,
26
- y1: e.y,
27
- x2: t.position,
28
- y2: e.y + e.height,
29
- style: { stroke: "var(--border-muted-subtle)" },
30
- strokeWidth: l,
31
- strokeDasharray: "2 2"
32
- },
33
- `grid-${t.value}-${o}`
34
- )),
35
- h && /* @__PURE__ */ r(
36
- "line",
37
- {
38
- x1: e.x,
39
- y1: s,
40
- x2: e.x + e.width,
41
- y2: s,
42
- style: { stroke: "var(--border-muted)" },
43
- strokeWidth: l,
44
- shapeRendering: "crispEdges",
45
- strokeLinecap: "square"
46
- }
47
- ),
48
- p && a.map((t, o) => /* @__PURE__ */ r(
49
- "line",
50
- {
51
- x1: t.position,
52
- y1: s,
53
- x2: t.position,
54
- y2: s + u * y,
55
- style: { stroke: "var(--border-muted)" },
56
- strokeWidth: l
57
- },
58
- `tick-${t.value}-${o}`
59
- )),
60
- a.map((t, o) => /* @__PURE__ */ r(
61
- "text",
62
- {
63
- x: t.position,
64
- y: A,
65
- textAnchor: "middle",
66
- dominantBaseline: n === "top" ? "auto" : "hanging",
67
- style: { fill: "var(--text-muted)" },
68
- fontSize: 11,
69
- fontFamily: "Inter, system-ui, sans-serif",
70
- children: t.label
71
- },
72
- `label-${t.value}-${o}`
73
- ))
74
- ] });
75
- }
76
- export {
77
- $ as DEFAULT_AXIS_HEIGHT,
78
- k as XAxis
79
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/XAxis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACrD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,3 +0,0 @@
1
- import { XAxisVisualProps } from '../../utils/types';
2
- export type XAxisProps = XAxisVisualProps;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/XAxis/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC"}
@@ -1,4 +0,0 @@
1
- import { YAxisProps } from './types';
2
- export declare const DEFAULT_AXIS_WIDTH = 40;
3
- export declare function YAxis({ position, showGrid, showLine, showTickMark, ticks: ticksProp, tickLabelFormatter, }: YAxisProps): import("react/jsx-runtime").JSX.Element | null;
4
- //# sourceMappingURL=YAxis.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"YAxis.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/YAxis/YAxis.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAK1C,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,wBAAgB,KAAK,CAAC,EACpB,QAAkB,EAClB,QAAgB,EAChB,QAAgB,EAChB,YAAoB,EACpB,KAAK,EAAE,SAAS,EAChB,kBAAkB,GACnB,EAAE,UAAU,kDAkFZ"}
@@ -1,79 +0,0 @@
1
- import { jsxs as T, jsx as i } from "react/jsx-runtime";
2
- import { useMemo as b } from "react";
3
- import { buildTicksData as v } from "../../utils/ticks/ticks.js";
4
- import { useCartesianChartContext as C } from "../CartesianChart/context/cartesianChartContext.js";
5
- const l = 1, m = 4, D = 6, $ = 40;
6
- function k({
7
- position: o = "start",
8
- showGrid: u = !1,
9
- showLine: f = !1,
10
- showTickMark: h = !1,
11
- ticks: d,
12
- tickLabelFormatter: x
13
- }) {
14
- const { getYScale: p, getYAxisConfig: g, drawingArea: e } = C(), a = p(), y = g(), n = b(
15
- () => a ? v(a, y, d, x) : [],
16
- [a, y, d, x]
17
- );
18
- if (!a || e.height <= 0)
19
- return null;
20
- const s = o === "start" ? e.x : e.x + e.width, c = o === "start" ? -1 : 1, A = s + c * (m + D);
21
- return /* @__PURE__ */ T("g", { "data-testid": "y-axis", children: [
22
- u && n.map((t, r) => /* @__PURE__ */ i(
23
- "line",
24
- {
25
- x1: e.x,
26
- y1: t.position,
27
- x2: e.x + e.width,
28
- y2: t.position,
29
- style: { stroke: "var(--border-muted-subtle)" },
30
- strokeWidth: l,
31
- strokeDasharray: "2 2"
32
- },
33
- `grid-${t.value}-${r}`
34
- )),
35
- f && /* @__PURE__ */ i(
36
- "line",
37
- {
38
- x1: s,
39
- y1: e.y,
40
- x2: s,
41
- y2: e.y + e.height,
42
- style: { stroke: "var(--border-muted)" },
43
- strokeWidth: l,
44
- shapeRendering: "crispEdges",
45
- strokeLinecap: "square"
46
- }
47
- ),
48
- h && n.map((t, r) => /* @__PURE__ */ i(
49
- "line",
50
- {
51
- x1: s,
52
- y1: t.position,
53
- x2: s + c * m,
54
- y2: t.position,
55
- style: { stroke: "var(--border-muted)" },
56
- strokeWidth: l
57
- },
58
- `tick-${t.value}-${r}`
59
- )),
60
- n.map((t, r) => /* @__PURE__ */ i(
61
- "text",
62
- {
63
- x: A,
64
- y: t.position,
65
- textAnchor: o === "start" ? "end" : "start",
66
- dominantBaseline: "central",
67
- style: { fill: "var(--text-muted)" },
68
- fontSize: 11,
69
- fontFamily: "Inter, system-ui, sans-serif",
70
- children: t.label
71
- },
72
- `label-${t.value}-${r}`
73
- ))
74
- ] });
75
- }
76
- export {
77
- $ as DEFAULT_AXIS_WIDTH,
78
- k as YAxis
79
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/YAxis/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACpD,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -1,3 +0,0 @@
1
- import { YAxisVisualProps } from '../../utils/types';
2
- export type YAxisProps = YAxisVisualProps;
3
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/lib/Components/YAxis/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,MAAM,UAAU,GAAG,gBAAgB,CAAC"}