@gearbox-protocol/ui-kit 4.0.0-next.23 → 4.0.0-next.24

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 (38) hide show
  1. package/dist/cjs/components/base/history-chart/history-chart.cjs +1 -1
  2. package/dist/cjs/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.cjs +1 -1
  3. package/dist/cjs/components/graph/default-config.cjs +1 -1
  4. package/dist/cjs/components/graph/formatters.cjs +1 -1
  5. package/dist/cjs/components/graph/graph-current-value.cjs +1 -1
  6. package/dist/cjs/components/graph/graph-tooltip.cjs +1 -1
  7. package/dist/cjs/components/graph/graph.cjs +1 -1
  8. package/dist/cjs/components/graph/index.cjs +1 -1
  9. package/dist/cjs/components/graph/y-axis-scale.cjs +1 -0
  10. package/dist/cjs/components/index.cjs +1 -1
  11. package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
  12. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -1
  13. package/dist/cjs/index.cjs +1 -1
  14. package/dist/cjs/locale/en.json.cjs +1 -1
  15. package/dist/esm/components/base/history-chart/history-chart.js +16 -15
  16. package/dist/esm/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.js +41 -25
  17. package/dist/esm/components/graph/default-config.js +44 -24
  18. package/dist/esm/components/graph/formatters.js +123 -128
  19. package/dist/esm/components/graph/graph-current-value.js +11 -11
  20. package/dist/esm/components/graph/graph-tooltip.js +6 -6
  21. package/dist/esm/components/graph/graph.js +597 -547
  22. package/dist/esm/components/graph/index.js +32 -27
  23. package/dist/esm/components/graph/y-axis-scale.js +112 -0
  24. package/dist/esm/components/index.js +496 -491
  25. package/dist/esm/components/trading-view/trading-view.js +83 -82
  26. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +94 -55
  27. package/dist/esm/index.js +649 -644
  28. package/dist/esm/locale/en.json.js +16 -4
  29. package/dist/types/components/base/history-chart/history-chart.d.ts +2 -1
  30. package/dist/types/components/base/pool-apy-breakdown-card/pool-apy-breakdown-card.d.ts +4 -2
  31. package/dist/types/components/graph/default-config.d.ts +23 -0
  32. package/dist/types/components/graph/formatters.d.ts +5 -1
  33. package/dist/types/components/graph/graph.d.ts +12 -4
  34. package/dist/types/components/graph/y-axis-scale.d.ts +48 -0
  35. package/dist/types/components/trading-view/trading-view.d.ts +5 -1
  36. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +4 -2
  37. package/dist/types/locale/en.json.d.ts +14 -2
  38. package/package.json +3 -3
@@ -1,20 +1,22 @@
1
1
  import { resolveCSSColor as o } from "../../utils/colors.js";
2
- const e = {
2
+ const l = {
3
3
  topColor: "rgba(76, 175, 80, 0.56)",
4
4
  bottomColor: "rgba(76, 175, 80, 0.04)",
5
5
  lineColor: "#02c39a",
6
- lineWidth: 2
7
- }, s = {
6
+ lineWidth: 2,
7
+ lastValueVisible: !1,
8
+ priceLineVisible: !1
9
+ }, b = {
8
10
  showLabel: !0,
9
11
  color: "#02c39a",
10
12
  labelBackgroundColor: "#02c39a",
11
13
  width: 2
12
- }, l = 'Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', t = 14;
13
- function b() {
14
+ }, t = 'Rubik, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif', e = 14, i = 5, n = Math.ceil(e / 2) + 2, c = e + 6, u = 40;
15
+ function g() {
14
16
  const r = o(
15
17
  "hsl(var(--muted-foreground))",
16
18
  "rgb(163, 163, 163)"
17
- ), i = o("hsl(var(--card))", "rgb(24, 24, 24)");
19
+ ), a = o("hsl(var(--card))", "rgb(24, 24, 24)");
18
20
  return {
19
21
  timeScale: {
20
22
  borderVisible: !0,
@@ -26,6 +28,16 @@ function b() {
26
28
  // and legend appears). Avoids range shrinking to a few days.
27
29
  lockVisibleTimeRangeOnResize: !0
28
30
  },
31
+ leftPriceScale: {
32
+ visible: !1,
33
+ autoScale: !0,
34
+ alignLabels: !0,
35
+ borderVisible: !0,
36
+ borderColor: "rgba(224, 227, 235, 0.1)",
37
+ entireTextOnly: !1,
38
+ tickMarkDensity: i,
39
+ textColor: r
40
+ },
29
41
  rightPriceScale: {
30
42
  visible: !0,
31
43
  autoScale: !0,
@@ -33,15 +45,16 @@ function b() {
33
45
  borderVisible: !0,
34
46
  borderColor: "rgba(224, 227, 235, 0.1)",
35
47
  entireTextOnly: !1,
48
+ tickMarkDensity: i,
36
49
  textColor: r
37
50
  },
38
51
  layout: {
39
52
  background: {
40
- color: i
53
+ color: a
41
54
  },
42
55
  textColor: r,
43
- fontSize: t,
44
- fontFamily: l
56
+ fontSize: e,
57
+ fontFamily: t
45
58
  },
46
59
  crosshair: {
47
60
  horzLine: {
@@ -67,23 +80,25 @@ function b() {
67
80
  }
68
81
  };
69
82
  }
70
- function n() {
83
+ function f() {
71
84
  return {
72
85
  topColor: "rgba(76, 175, 80, 0.56)",
73
86
  bottomColor: "rgba(76, 175, 80, 0.04)",
74
- lineColor: e.lineColor,
75
- lineWidth: 2
87
+ lineColor: l.lineColor,
88
+ lineWidth: 2,
89
+ lastValueVisible: !1,
90
+ priceLineVisible: !1
76
91
  };
77
92
  }
78
- function c() {
93
+ function d() {
79
94
  return {
80
95
  showLabel: !0,
81
- color: e.lineColor,
82
- labelBackgroundColor: e.lineColor,
96
+ color: l.lineColor,
97
+ labelBackgroundColor: l.lineColor,
83
98
  width: 2
84
99
  };
85
100
  }
86
- const u = {
101
+ const L = {
87
102
  timeScale: {
88
103
  borderVisible: !0,
89
104
  borderColor: "rgba(224, 227, 235, 0.1)",
@@ -104,8 +119,8 @@ const u = {
104
119
  color: "transparent"
105
120
  },
106
121
  textColor: "rgb(163, 163, 163)",
107
- fontSize: t,
108
- fontFamily: l
122
+ fontSize: e,
123
+ fontFamily: t
109
124
  },
110
125
  crosshair: {
111
126
  horzLine: {
@@ -131,10 +146,15 @@ const u = {
131
146
  }
132
147
  };
133
148
  export {
134
- e as DEFAULT_AREA_SERIES,
135
- u as DEFAULT_OPTIONS,
136
- s as DEFAULT_VERTICAL_LINE,
137
- b as getDefaultOptions,
138
- n as getDefaultSeries,
139
- c as getDefaultVerticalLine
149
+ n as AXIS_EDGE_LABEL_PADDING_PX,
150
+ e as AXIS_FONT_SIZE,
151
+ i as AXIS_TICK_MARK_DENSITY,
152
+ u as AXIS_TIME_EDGE_PADDING_PX,
153
+ c as AXIS_TOP_LABEL_PADDING_PX,
154
+ l as DEFAULT_AREA_SERIES,
155
+ L as DEFAULT_OPTIONS,
156
+ b as DEFAULT_VERTICAL_LINE,
157
+ g as getDefaultOptions,
158
+ f as getDefaultSeries,
159
+ d as getDefaultVerticalLine
140
160
  };
@@ -1,195 +1,190 @@
1
- import { TickMarkType as g } from "lightweight-charts";
2
- import { DateTime as S } from "luxon";
3
- import { isBelowDisplayThreshold as x, FORMAT_CONSTANTS as P, toSignificantDigits as I, formatNumberWithSuffix as p } from "../../utils/format-number.js";
4
- const { MIN_DISPLAY_THRESHOLD: M, MAX_EXPONENTIAL_THRESHOLD: H } = P, w = (t, e, o = "full") => {
5
- if (x(t))
6
- return e ? `<${M}${e}` : `<${M}`;
1
+ import { TickMarkType as S } from "lightweight-charts";
2
+ import { DateTime as D } from "luxon";
3
+ import { isBelowDisplayThreshold as T, FORMAT_CONSTANTS as U, toSignificantDigits as N, formatNumberWithSuffix as I } from "../../utils/format-number.js";
4
+ const { MIN_DISPLAY_THRESHOLD: h, MAX_EXPONENTIAL_THRESHOLD: L } = U, O = (t, e, n = "full") => {
5
+ if (T(t))
6
+ return e ? `<${h}${e}` : `<${h}`;
7
7
  if (t === 0)
8
8
  return e ? `0${e}` : "0";
9
- const r = p(t, {
10
- maxExponentialThreshold: H,
9
+ const r = I(t, {
10
+ maxExponentialThreshold: L,
11
11
  minimumFractionDigits: 0,
12
- maximumFractionDigits: o === "short" ? 1 : 0,
13
- format: o,
14
- adaptiveDecimals: o === "short"
12
+ maximumFractionDigits: n === "short" ? 1 : 0,
13
+ format: n,
14
+ adaptiveDecimals: n === "short"
15
15
  });
16
16
  return e ? `${r}${e}` : r;
17
- }, C = 2, R = (t, e) => {
18
- if (x(t))
19
- return e ? `<${M}${e}` : `<${M}`;
17
+ }, X = 2, H = (t, e) => {
18
+ if (T(t))
19
+ return e ? `<${h}${e}` : `<${h}`;
20
20
  if (t === 0)
21
21
  return e ? `0${e}` : "0";
22
- const o = I(t, C);
23
- return e ? `${o}${e}` : o;
24
- }, Y = 4, G = (t) => {
25
- if (x(t))
26
- return `<${M}`;
22
+ const n = N(t, X);
23
+ return e ? `${n}${e}` : n;
24
+ }, P = 4, w = (t) => {
25
+ if (T(t))
26
+ return `<${h}`;
27
27
  if (t === 0)
28
28
  return "0";
29
- const e = Math.round(t), o = Math.abs(t - e);
30
- return o > 0 && o < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") : I(t, Y);
31
- }, V = (t, e) => {
32
- if (x(t))
33
- return e ? `<${M} ${e}` : `<${M}`;
29
+ const e = Math.round(t), n = Math.abs(t - e);
30
+ return n > 0 && n < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") : N(t, P);
31
+ }, C = (t, e) => {
32
+ if (T(t))
33
+ return e ? `<${h} ${e}` : `<${h}`;
34
34
  if (t === 0)
35
35
  return e ? `0 ${e}` : "0";
36
- const o = Number.isInteger(t), r = Math.abs(t), i = o && r >= 1e3, s = Math.round(t), a = Math.abs(t - s);
37
- if (a > 0 && a < 0.01 && !i) {
38
- const D = t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
39
- return e ? `${D} ${e}` : D;
36
+ const n = Number.isInteger(t), r = Math.abs(t), c = n && r >= 1e3, s = Math.round(t), i = Math.abs(t - s);
37
+ if (i > 0 && i < 0.01 && !c) {
38
+ const F = t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
39
+ return e ? `${F} ${e}` : F;
40
40
  }
41
- const F = p(t, {
42
- maxExponentialThreshold: H,
43
- minimumFractionDigits: o ? 0 : 2,
44
- maximumFractionDigits: i ? 1 : o ? 0 : 2,
45
- format: i ? "short" : "full",
46
- adaptiveDecimals: i
41
+ const M = I(t, {
42
+ maxExponentialThreshold: L,
43
+ minimumFractionDigits: n ? 0 : 2,
44
+ maximumFractionDigits: c ? 1 : n ? 0 : 2,
45
+ format: c ? "short" : "full",
46
+ adaptiveDecimals: c
47
47
  });
48
- return e ? `${F} ${e}` : F;
49
- }, N = {
50
- "%": R,
51
- $: w,
52
- token: V,
53
- none: G
54
- }, v = (t) => N[t] || N.token;
55
- function tt(t, e, o = 4) {
48
+ return e ? `${M} ${e}` : M;
49
+ }, A = {
50
+ "%": H,
51
+ $: O,
52
+ token: C,
53
+ none: w
54
+ }, Z = (t) => A[t] || A.token;
55
+ function V(t, e, n = 4) {
56
56
  if (t === 0)
57
57
  return e ? `0 ${e}` : "0";
58
- const r = e && Math.abs(t) >= 1e3 ? 0 : o, i = t.toLocaleString("en-US", {
58
+ const r = e && Math.abs(t) >= 1e3 ? 0 : n, c = t.toLocaleString("en-US", {
59
59
  minimumFractionDigits: 0,
60
60
  maximumFractionDigits: r
61
61
  });
62
- return e ? `${i} ${e}` : i;
62
+ return e ? `${c} ${e}` : c;
63
63
  }
64
- function k(t, e) {
64
+ function x(t, e) {
65
65
  return !t || e === "none" || e === "token" ? t : e === "$" ? `$${t}` : e === "%" ? `${t}%` : `${t} ${e}`;
66
66
  }
67
- function L(t) {
68
- return t.includes("/") ? "none" : t;
67
+ function Y(t) {
68
+ return t.includes("/");
69
69
  }
70
- function et(t, e, o) {
71
- const r = o?.yScaleMin;
72
- let i = t.length > 0 ? Math.min(...t) : 0, s = t.length > 0 ? Math.max(...t) : 0, a = [];
73
- const u = () => {
74
- const n = (i + s) / 2;
75
- let c = 1, m = "";
76
- return n >= 1e9 ? (c = 1e9, m = "B") : n >= 1e6 ? (c = 1e6, m = "M") : n >= 1e3 && (c = 1e3, m = "K"), { scale: c, suffix: m };
77
- }, F = 8, D = 0.02;
78
- let A = 0;
79
- const E = (n, c, m, d) => {
80
- const h = (c > 1 ? n / c : n).toLocaleString("en-US", {
70
+ function l(t) {
71
+ return Y(t) ? "none" : t;
72
+ }
73
+ function b(t, e, n) {
74
+ const r = n?.yScaleMin;
75
+ let c = t.length > 0 ? Math.min(...t) : 0, s = t.length > 0 ? Math.max(...t) : 0;
76
+ const i = () => {
77
+ const o = (c + s) / 2;
78
+ let a = 1, m = "";
79
+ return o >= 1e9 ? (a = 1e9, m = "B") : o >= 1e6 ? (a = 1e6, m = "M") : o >= 1e3 && (a = 1e3, m = "K"), { scale: a, suffix: m };
80
+ }, u = 8;
81
+ let M = 0;
82
+ const F = (o, a, m, d) => {
83
+ const f = (a > 1 ? o / a : o).toLocaleString("en-US", {
81
84
  minimumFractionDigits: 0,
82
85
  maximumFractionDigits: d,
83
86
  useGrouping: !1
84
87
  });
85
- return c > 1 ? `${h}${m}` : h;
86
- }, U = (n, c, m) => {
87
- for (let d = 0; d <= F; d++) {
88
+ return a > 1 ? `${f}${m}` : f;
89
+ }, p = (o, a, m) => {
90
+ for (let d = 0; d <= u; d++) {
88
91
  const $ = /* @__PURE__ */ new Set();
89
- let h = !0;
90
- for (const T of n) {
91
- const f = E(T, c, m, d);
92
- if ($.has(f)) {
93
- h = !1;
92
+ let f = !0;
93
+ for (const g of o) {
94
+ const k = F(g, a, m, d);
95
+ if ($.has(k)) {
96
+ f = !1;
94
97
  break;
95
98
  }
96
- $.add(f);
99
+ $.add(k);
97
100
  }
98
- if (h) return d;
101
+ if (f) return d;
99
102
  }
100
- return F;
101
- }, X = (n) => {
102
- if (r !== void 0 && n < r) return "";
103
- if (n === 0) return k("0", L(e));
104
- const { scale: c, suffix: m } = u();
105
- return k(
106
- E(n, c, m, A),
107
- L(e)
103
+ return u;
104
+ }, R = (o) => {
105
+ if (r !== void 0 && o < r) return "";
106
+ if (o === 0) return x("0", l(e));
107
+ const { scale: a, suffix: m } = i();
108
+ return x(
109
+ F(o, a, m, M),
110
+ l(e)
108
111
  );
109
112
  };
110
113
  return {
111
- formatter: (n) => X(n),
112
- tickmarksFormatter: (n) => {
113
- const { scale: c, suffix: m } = u(), d = s - i, $ = d > 0 ? a.filter(
114
- (f) => Math.abs(f) >= d * D
115
- ) : a, h = n.filter(
114
+ formatter: (o) => R(o),
115
+ tickmarksFormatter: (o) => {
116
+ const { scale: a, suffix: m } = i(), d = o.filter(
116
117
  (f) => f !== 0 && !(r !== void 0 && f < r)
117
118
  );
118
- A = U(
119
- [...h, ...$],
120
- c,
121
- m
122
- );
123
- const T = /* @__PURE__ */ new Set();
124
- return n.map((f) => {
119
+ M = p(d, a, m);
120
+ const $ = /* @__PURE__ */ new Set();
121
+ return o.map((f) => {
125
122
  if (r !== void 0 && f < r) return "";
126
- const l = f === 0 ? "0" : E(f, c, m, A);
127
- return !l || T.has(l) ? "" : (T.add(l), k(l, L(e)));
123
+ const g = f === 0 ? "0" : F(f, a, m, M);
124
+ return !g || $.has(g) ? "" : ($.add(g), x(g, l(e)));
128
125
  });
129
126
  },
130
- updateVisibleRange: (n) => {
131
- n.length > 0 && (i = Math.min(...n), s = Math.max(...n));
132
- },
133
- updateLastValues: (n) => {
134
- a = [...n];
127
+ updateVisibleRange: (o) => {
128
+ o.length > 0 && (c = Math.min(...o), s = Math.max(...o));
135
129
  }
136
130
  };
137
131
  }
138
- const O = (t) => S.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"), W = (t) => S.fromSeconds(Number(t)).toFormat("HH:mm"), q = (t, e) => R(Number(t), e), _ = {
139
- time: O,
140
- "%": q
132
+ const _ = (t) => D.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"), G = (t) => D.fromSeconds(Number(t)).toFormat("HH:mm"), W = (t, e) => H(Number(t), e), E = {
133
+ time: _,
134
+ "%": W
141
135
  };
142
- function B(t) {
136
+ function q(t) {
143
137
  const e = /* @__PURE__ */ new Map();
144
- return (o, r, i) => {
145
- const s = S.fromSeconds(Number(o));
146
- let a;
138
+ return (n, r, c) => {
139
+ const s = D.fromSeconds(Number(n));
140
+ let i;
147
141
  if (t === 0)
148
- a = s.toFormat("HH:mm");
142
+ i = s.toFormat("HH:mm");
149
143
  else
150
144
  switch (r) {
151
- case g.Year:
152
- a = s.toFormat("yyyy");
145
+ case S.Year:
146
+ i = s.toFormat("yyyy");
153
147
  break;
154
148
  // Month boundaries (1st of a month) are reported as `Month` ticks by
155
149
  // lightweight-charts. Render them the same way as regular day ticks so
156
150
  // the axis reads uniformly ("01 Jul") instead of a stray "Jul 2026".
157
- case g.Month:
158
- case g.DayOfMonth:
159
- a = t > 365 ? s.toFormat("dd MMM yyyy") : s.toFormat("dd MMM");
151
+ case S.Month:
152
+ case S.DayOfMonth:
153
+ i = t > 365 ? s.toFormat("dd MMM yyyy") : s.toFormat("dd MMM");
160
154
  break;
161
- case g.Time:
162
- case g.TimeWithSeconds:
163
- a = s.toFormat("HH:mm");
155
+ case S.Time:
156
+ case S.TimeWithSeconds:
157
+ i = s.toFormat("HH:mm");
164
158
  break;
165
159
  default:
166
- a = s.toFormat("dd MMM");
160
+ i = s.toFormat("dd MMM");
167
161
  }
168
162
  let u = e.get(r);
169
- return u || (u = /* @__PURE__ */ new Set(), e.set(r, u)), u.has(a) ? " " : (u.add(a), a);
163
+ return u || (u = /* @__PURE__ */ new Set(), e.set(r, u)), u.has(i) ? " " : (u.add(i), i);
170
164
  };
171
165
  }
172
- const y = (t, e) => {
166
+ const B = (t, e) => {
173
167
  if (t === "time" && e && e.length > 0) {
174
- const r = S.fromSeconds(Number(e[0].time)), i = S.fromSeconds(
168
+ const r = D.fromSeconds(Number(e[0].time)), c = D.fromSeconds(
175
169
  Number(e[e.length - 1].time)
176
- ), s = r.hasSame(i, "day"), a = s ? 0 : Math.ceil(i.diff(r, "days").days);
170
+ ), s = r.hasSame(c, "day"), i = s ? 0 : Math.ceil(c.diff(r, "days").days);
177
171
  return {
178
- timeFormatter: s ? W : O,
179
- tickMarkFormatter: B(a)
172
+ timeFormatter: s ? G : _,
173
+ tickMarkFormatter: q(i)
180
174
  };
181
175
  }
182
- const o = _[t] || _.time;
176
+ const n = E[t] || E.time;
183
177
  return {
184
- timeFormatter: o,
185
- tickMarkFormatter: (r) => o(r, t)
178
+ timeFormatter: n,
179
+ tickMarkFormatter: (r) => n(r, t)
186
180
  };
187
- }, rt = (t, e) => y(t, e).timeFormatter;
181
+ }, v = (t, e) => B(t, e).timeFormatter;
188
182
  export {
189
- et as createAdaptiveYAxisFormatter,
190
- tt as formatExactValue,
191
- rt as getXFormatter,
192
- y as getXFormatters,
193
- v as getYFormatter,
194
- k as withYAxisUnit
183
+ b as createAdaptiveYAxisFormatter,
184
+ V as formatExactValue,
185
+ v as getXFormatter,
186
+ B as getXFormatters,
187
+ Z as getYFormatter,
188
+ Y as isRatioUnit,
189
+ x as withYAxisUnit
195
190
  };
@@ -1,28 +1,28 @@
1
- import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
- import { cn as i } from "../../utils/cn.js";
3
- import { getXFormatter as c, formatExactValue as r } from "./formatters.js";
4
- function u({
5
- point: e,
1
+ import { jsxs as x, jsx as l } from "react/jsx-runtime";
2
+ import { cn as a } from "../../utils/cn.js";
3
+ import { getXFormatter as c, isRatioUnit as f, formatExactValue as r } from "./formatters.js";
4
+ function w({
5
+ point: o,
6
6
  xMeasureUnit: m,
7
7
  yMeasureUnit: t,
8
8
  className: s,
9
- decimals: o
9
+ decimals: e
10
10
  }) {
11
- const d = c(m)(e.time, m), n = t !== "%" && t !== "$" && t !== "none" ? t : void 0, x = t === "$" ? `$${r(e.value, void 0, o)}` : t === "%" ? `${r(e.value, void 0, o)}%` : r(e.value, n, o);
12
- return /* @__PURE__ */ a(
11
+ const d = c(m)(o.time, m), i = t !== "%" && t !== "$" && t !== "none" && !f(t) ? t : void 0, n = t === "$" ? `$${r(o.value, void 0, e)}` : t === "%" ? `${r(o.value, void 0, e)}%` : r(o.value, i, e);
12
+ return /* @__PURE__ */ x(
13
13
  "div",
14
14
  {
15
- className: i(
15
+ className: a(
16
16
  "absolute top-2 left-2 right-2 z-[100] pointer-events-none",
17
17
  s
18
18
  ),
19
19
  children: [
20
- /* @__PURE__ */ l("div", { className: "text-xl sm:text-2xl font-semibold text-foreground whitespace-nowrap overflow-hidden text-ellipsis", children: x }),
20
+ /* @__PURE__ */ l("div", { className: "text-xl sm:text-2xl font-semibold text-foreground whitespace-nowrap overflow-hidden text-ellipsis", children: n }),
21
21
  /* @__PURE__ */ l("div", { className: "text-xs sm:text-sm font-medium text-muted-foreground whitespace-nowrap overflow-hidden text-ellipsis mt-0.5", children: d })
22
22
  ]
23
23
  }
24
24
  );
25
25
  }
26
26
  export {
27
- u as GraphCurrentValue
27
+ w as GraphCurrentValue
28
28
  };
@@ -1,8 +1,8 @@
1
1
  import { jsx as m, jsxs as h } from "react/jsx-runtime";
2
2
  import { useRef as k, useState as F, useEffect as S } from "react";
3
3
  import { cn as z } from "../../utils/cn.js";
4
- import { getXFormatter as A, formatExactValue as x } from "./formatters.js";
5
- import { getSeriesColorPalette as B } from "./graph.js";
4
+ import { getXFormatter as A, isRatioUnit as B, formatExactValue as x } from "./formatters.js";
5
+ import { getSeriesColorPalette as E } from "./graph.js";
6
6
  function M({
7
7
  points: d,
8
8
  series: v,
@@ -36,7 +36,7 @@ function M({
36
36
  const y = p + 8;
37
37
  e - y < l ? e = t.y + 20 : e = t.y - y, a({ x: n, y: e });
38
38
  }, [t, b]);
39
- const P = f ? {
39
+ const R = f ? {
40
40
  left: `${f.x}px`,
41
41
  top: `${f.y}px`,
42
42
  transform: "translate(-50%, 0)"
@@ -44,7 +44,7 @@ function M({
44
44
  } : {};
45
45
  if (d.size === 0)
46
46
  return null;
47
- const R = Array.from(d.values())[0], j = C(R.time, g);
47
+ const P = Array.from(d.values())[0], j = C(P.time, g);
48
48
  return /* @__PURE__ */ m(
49
49
  "div",
50
50
  {
@@ -53,13 +53,13 @@ function M({
53
53
  "absolute z-[100] pointer-events-none whitespace-nowrap",
54
54
  $
55
55
  ),
56
- style: P,
56
+ style: R,
57
57
  children: /* @__PURE__ */ h("div", { className: "bg-background/90 backdrop-blur-sm rounded border border-border p-1.5 sm:p-2 space-y-1 sm:space-y-1.5", children: [
58
58
  /* @__PURE__ */ m("div", { className: "text-xs sm:text-sm font-medium text-muted-foreground mb-0.5 sm:mb-1 whitespace-nowrap", children: j }),
59
59
  v.map((r, c) => {
60
60
  const o = d.get(r.label);
61
61
  if (!o) return null;
62
- const i = B(c), n = (r.lineColor ?? r.color) || i.line, e = r.yMeasureUnit || N, s = e !== "%" && e !== "$" && e !== "none" ? e : void 0, p = e === "$" ? `$${x(o.value, void 0, u)}` : e === "%" ? `${x(o.value, void 0, u)}%` : x(o.value, s, u);
62
+ const i = E(c), n = (r.lineColor ?? r.color) || i.line, e = r.yMeasureUnit || N, s = e !== "%" && e !== "$" && e !== "none" && !B(e) ? e : void 0, p = e === "$" ? `$${x(o.value, void 0, u)}` : e === "%" ? `${x(o.value, void 0, u)}%` : x(o.value, s, u);
63
63
  return /* @__PURE__ */ h(
64
64
  "div",
65
65
  {