@lilt-ui/charts 0.7.0 → 0.8.0
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/CHANGELOG.md +22 -0
- package/dist/cards/cartesian-card.d.ts +6 -2
- package/dist/finance.js +132 -132
- package/dist/index.js +2064 -2080
- package/dist/interaction/axis-cursor.d.ts +13 -1
- package/dist/interaction/inspection-layer.d.ts +6 -1
- package/dist/primitives/hover-band.d.ts +7 -0
- package/dist/{skeleton-block-C110l-2a.js → skeleton-block-Bs6JLXVq.js} +1951 -1718
- package/dist/styles.css +1 -1
- package/dist/types.d.ts +13 -4
- package/dist/use-chart-width.d.ts +10 -0
- package/package.json +1 -1
package/dist/finance.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { A as e, C as t,
|
|
2
|
+
import { A as e, C as t, I as n, J as r, L as i, P as a, Q as o, R as s, S as c, T as l, _ as u, a as d, b as f, f as p, ht as m, i as h, n as g, nt as _, ot as v, q as y, t as b, u as x, v as S, w as C, x as w, y as T, z as E } from "./skeleton-block-Bs6JLXVq.js";
|
|
3
3
|
import { S as D, d as O, g as k, h as A, p as j, u as ee } from "./report-context-CkzH-r8B.js";
|
|
4
4
|
import { useEffect as M, useMemo as N, useRef as P, useState as F } from "react";
|
|
5
5
|
import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
@@ -28,7 +28,7 @@ function W(e, t, n) {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function G(e, t, n, r, i = !1) {
|
|
31
|
-
let
|
|
31
|
+
let o = Math.max(1, n.columnWidth), s = o / 2, c = H(e), l = H(n.y(t.high)), u = H(n.y(t.low));
|
|
32
32
|
if (r === "ohlc") {
|
|
33
33
|
let r = H(n.y(t.open)), i = H(n.y(t.close)), a = H(Math.max(2, s));
|
|
34
34
|
return {
|
|
@@ -44,13 +44,13 @@ function G(e, t, n, r, i = !1) {
|
|
|
44
44
|
let e = (d + f) / 2;
|
|
45
45
|
d = e - .5, f = e + .5;
|
|
46
46
|
}
|
|
47
|
-
let p = r === "hollow" && t.up &&
|
|
47
|
+
let p = r === "hollow" && t.up && o >= 3, m = p ? .5 : 0, h = i ? _(e, d, o, f - d) : null, g = h ? e - h.frontWidth / 2 : e - s, v = a(g + m, d + m, Math.max(1, (h ? h.frontWidth : o) - m * 2), Math.max(1, f - d - m * 2), !h && o >= 6 ? 1.5 : 0), y = (l < d ? `M${c},${l}V${H(d)}` : "") + (u > f ? `M${c},${H(f)}V${u}` : "");
|
|
48
48
|
return {
|
|
49
49
|
body: p ? null : v,
|
|
50
50
|
hollow: p ? v : null,
|
|
51
51
|
stroke: y,
|
|
52
|
-
side:
|
|
53
|
-
top:
|
|
52
|
+
side: h?.side ?? null,
|
|
53
|
+
top: h?.top ?? null
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function K(t, n, r, i, a, o, s = !1) {
|
|
@@ -86,11 +86,11 @@ function ne({ paths: e, display: t }) {
|
|
|
86
86
|
}, `stroke-${e}`)),
|
|
87
87
|
e.sides.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
|
|
88
88
|
d: t,
|
|
89
|
-
style: { fill:
|
|
89
|
+
style: { fill: o(e).side }
|
|
90
90
|
}, `side-${e}`)),
|
|
91
91
|
e.tops.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
|
|
92
92
|
d: t,
|
|
93
|
-
style: { fill:
|
|
93
|
+
style: { fill: o(e).top }
|
|
94
94
|
}, `top-${e}`)),
|
|
95
95
|
e.bodies.map(({ color: e, d: t }) => /* @__PURE__ */ L("path", {
|
|
96
96
|
d: t,
|
|
@@ -106,24 +106,24 @@ function ne({ paths: e, display: t }) {
|
|
|
106
106
|
}, `hollow-${e}`))
|
|
107
107
|
] });
|
|
108
108
|
}
|
|
109
|
-
var re = s(function({ series: e, open: t, high: n, low:
|
|
109
|
+
var re = s(function({ series: e, open: t, high: n, low: i, display: a = "candle", depth: o = !1, className: s }) {
|
|
110
110
|
let c = C("Candles", e, [
|
|
111
111
|
t,
|
|
112
112
|
n,
|
|
113
|
-
|
|
113
|
+
i
|
|
114
114
|
], "column"), { snapshot: l, descriptor: u, scales: d } = c, f = N(() => {
|
|
115
|
-
let
|
|
115
|
+
let r = {
|
|
116
116
|
open: t,
|
|
117
117
|
high: n,
|
|
118
|
-
low:
|
|
118
|
+
low: i
|
|
119
119
|
};
|
|
120
|
-
return W(l.data.rows, e,
|
|
120
|
+
return W(l.data.rows, e, r), K(l.data.rows, e, r, d, a, (e, t) => te(u, e, t), o);
|
|
121
121
|
}, [
|
|
122
122
|
l,
|
|
123
123
|
e,
|
|
124
124
|
t,
|
|
125
125
|
n,
|
|
126
|
-
|
|
126
|
+
i,
|
|
127
127
|
d,
|
|
128
128
|
a,
|
|
129
129
|
u,
|
|
@@ -140,7 +140,7 @@ var re = s(function({ series: e, open: t, high: n, low: r, display: a = "candle"
|
|
|
140
140
|
opacity: c.opacity,
|
|
141
141
|
transition: c.reducedMotion ? void 0 : "opacity 160ms ease-out"
|
|
142
142
|
},
|
|
143
|
-
children: [o ? /* @__PURE__ */ L(
|
|
143
|
+
children: [o ? /* @__PURE__ */ L(r, { clip: c.depthClip }) : null, /* @__PURE__ */ L(ne, {
|
|
144
144
|
paths: f,
|
|
145
145
|
display: a
|
|
146
146
|
})]
|
|
@@ -151,36 +151,36 @@ var re = s(function({ series: e, open: t, high: n, low: r, display: a = "candle"
|
|
|
151
151
|
kind: e.display === "ohlc" ? "ohlc" : "candle",
|
|
152
152
|
depth: e.depth && e.display !== "ohlc",
|
|
153
153
|
render: ({ cx: t, low: n, high: r, scales: i, mask: a }) => {
|
|
154
|
-
let
|
|
154
|
+
let s = a ? "white" : "color-mix(in srgb, var(--lilt-skeleton) 64%, var(--lilt-surface))", c = G(t, {
|
|
155
155
|
low: n,
|
|
156
156
|
high: r,
|
|
157
157
|
open: n + (r - n) * .28,
|
|
158
158
|
close: r - (r - n) * .23,
|
|
159
159
|
up: !0
|
|
160
|
-
}, i, e.display ?? "candle", e.depth),
|
|
160
|
+
}, i, e.display ?? "candle", e.depth), l = o(s);
|
|
161
161
|
return /* @__PURE__ */ R(I, { children: [
|
|
162
|
-
|
|
163
|
-
d:
|
|
162
|
+
c.stroke ? /* @__PURE__ */ L("path", {
|
|
163
|
+
d: c.stroke,
|
|
164
164
|
fill: "none",
|
|
165
|
-
stroke:
|
|
165
|
+
stroke: s,
|
|
166
166
|
strokeWidth: 1.5
|
|
167
167
|
}) : null,
|
|
168
|
-
|
|
169
|
-
d:
|
|
170
|
-
fill: a ?
|
|
168
|
+
c.side ? /* @__PURE__ */ L("path", {
|
|
169
|
+
d: c.side,
|
|
170
|
+
fill: a ? s : l.side
|
|
171
171
|
}) : null,
|
|
172
|
-
|
|
173
|
-
d:
|
|
174
|
-
fill: a ?
|
|
172
|
+
c.top ? /* @__PURE__ */ L("path", {
|
|
173
|
+
d: c.top,
|
|
174
|
+
fill: a ? s : l.top
|
|
175
175
|
}) : null,
|
|
176
|
-
|
|
177
|
-
d:
|
|
178
|
-
fill:
|
|
176
|
+
c.body ? /* @__PURE__ */ L("path", {
|
|
177
|
+
d: c.body,
|
|
178
|
+
fill: s
|
|
179
179
|
}) : null,
|
|
180
|
-
|
|
181
|
-
d:
|
|
180
|
+
c.hollow ? /* @__PURE__ */ L("path", {
|
|
181
|
+
d: c.hollow,
|
|
182
182
|
fill: a ? "black" : "var(--lilt-surface)",
|
|
183
|
-
stroke:
|
|
183
|
+
stroke: s
|
|
184
184
|
}) : null
|
|
185
185
|
] });
|
|
186
186
|
}
|
|
@@ -227,8 +227,8 @@ var re = s(function({ series: e, open: t, high: n, low: r, display: a = "candle"
|
|
|
227
227
|
});
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/finance/cards/pane.tsx
|
|
230
|
-
function q({ context: e, label: t, caption: n, readout: r, series:
|
|
231
|
-
let [f, p] = F(null),
|
|
230
|
+
function q({ context: e, label: t, caption: n, readout: r, series: a, height: o, y: s, bars: c, xAxis: l = !1, children: d }) {
|
|
231
|
+
let [f, p] = F(null), h = f ?? e.data.at(-1) ?? null;
|
|
232
232
|
return /* @__PURE__ */ R("div", {
|
|
233
233
|
className: "lilt-card__pane",
|
|
234
234
|
children: [n ? /* @__PURE__ */ R("span", {
|
|
@@ -237,20 +237,20 @@ function q({ context: e, label: t, caption: n, readout: r, series: i, height: o,
|
|
|
237
237
|
children: [/* @__PURE__ */ L("span", {
|
|
238
238
|
className: "lilt-card__pane-name",
|
|
239
239
|
children: n
|
|
240
|
-
}), r &&
|
|
241
|
-
}) : null, /* @__PURE__ */ L(
|
|
240
|
+
}), r && h && !e.loading ? r(h) : null]
|
|
241
|
+
}) : null, /* @__PURE__ */ L(m, {
|
|
242
242
|
className: "lilt-card__chart",
|
|
243
243
|
"aria-label": t,
|
|
244
244
|
data: e.data,
|
|
245
245
|
x: e.x,
|
|
246
246
|
y: s,
|
|
247
|
-
series:
|
|
247
|
+
series: a,
|
|
248
248
|
controller: e.controller,
|
|
249
249
|
onSelectionChange: r ? (e) => p(e?.row ?? null) : void 0,
|
|
250
250
|
motion: e.motion,
|
|
251
251
|
status: e.loading ? "loading" : "ready",
|
|
252
252
|
loadingStyle: e.loadingStyle,
|
|
253
|
-
children: /* @__PURE__ */ R(
|
|
253
|
+
children: /* @__PURE__ */ R(i, {
|
|
254
254
|
height: o,
|
|
255
255
|
margins: {
|
|
256
256
|
...e.margins,
|
|
@@ -263,7 +263,7 @@ function q({ context: e, label: t, caption: n, readout: r, series: i, height: o,
|
|
|
263
263
|
slots: e.slots || !!c,
|
|
264
264
|
bars: c,
|
|
265
265
|
background: "none",
|
|
266
|
-
children: [
|
|
266
|
+
children: [d, l ? /* @__PURE__ */ L(u, { labels: "fit" }) : null]
|
|
267
267
|
})
|
|
268
268
|
})]
|
|
269
269
|
});
|
|
@@ -288,15 +288,15 @@ var ae = {
|
|
|
288
288
|
minimumFractionDigits: 2,
|
|
289
289
|
maximumFractionDigits: 2
|
|
290
290
|
};
|
|
291
|
-
function oe({ open: e, high: t, low:
|
|
292
|
-
let x = N(() =>
|
|
291
|
+
function oe({ open: e, high: t, low: r, close: i, volume: a, display: o = "candle", depth: s = !1, scale: c = "linear", label: l = "Price", live: u = !1, data: d, ranges: p, delta: m, valueFormat: _ = ae, locale: v = "en-US", volumeHeight: y = 64, ...b }) {
|
|
292
|
+
let x = N(() => h(v, _).full, [v, JSON.stringify(_)]), S = N(() => h(v).compact, [v]), C = N(() => p?.map((t) => ({
|
|
293
293
|
...t,
|
|
294
294
|
delta: t.delta ?? Y(t.data, e, i)
|
|
295
295
|
})), [
|
|
296
|
-
|
|
296
|
+
p,
|
|
297
297
|
e,
|
|
298
298
|
i
|
|
299
|
-
]), T = (Y(d ??
|
|
299
|
+
]), T = (Y(d ?? p?.[0]?.data ?? [], e, i) ?? 0) >= 0, E = (t) => (J(t, i) ?? 0) >= (J(t, e) ?? 0), D = o === "area", O = {
|
|
300
300
|
open: {
|
|
301
301
|
label: "Open",
|
|
302
302
|
accessor: (t) => J(t, e)
|
|
@@ -307,17 +307,17 @@ function oe({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
|
|
|
307
307
|
},
|
|
308
308
|
low: {
|
|
309
309
|
label: "Low",
|
|
310
|
-
accessor: (e) => J(e,
|
|
310
|
+
accessor: (e) => J(e, r)
|
|
311
311
|
}
|
|
312
312
|
};
|
|
313
|
-
return /* @__PURE__ */ L(
|
|
313
|
+
return /* @__PURE__ */ L(g, {
|
|
314
314
|
...b,
|
|
315
315
|
depth: s,
|
|
316
316
|
data: d,
|
|
317
317
|
ranges: C,
|
|
318
318
|
delta: m ?? (d ? Y(d, e, i) : void 0),
|
|
319
|
-
valueFormat:
|
|
320
|
-
locale:
|
|
319
|
+
valueFormat: _,
|
|
320
|
+
locale: v,
|
|
321
321
|
aggregate: "last",
|
|
322
322
|
tiles: !1,
|
|
323
323
|
live: u,
|
|
@@ -328,7 +328,7 @@ function oe({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
|
|
|
328
328
|
}],
|
|
329
329
|
shape: {
|
|
330
330
|
kind: "marks",
|
|
331
|
-
id: `candles:${o}:${s}:${c}:${e}:${t}:${
|
|
331
|
+
id: `candles:${o}:${s}:${c}:${e}:${t}:${r}:${!!a}`,
|
|
332
332
|
includeZero: !1,
|
|
333
333
|
scale: c,
|
|
334
334
|
slots: !0,
|
|
@@ -342,7 +342,7 @@ function oe({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
|
|
|
342
342
|
line: { showInspectionPoint: !1 }
|
|
343
343
|
},
|
|
344
344
|
describe: ie(x),
|
|
345
|
-
draw: (e) => e.map((e) => D ? [/* @__PURE__ */ L(
|
|
345
|
+
draw: (e) => e.map((e) => D ? [/* @__PURE__ */ L(n, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, `line-${e}`)] : /* @__PURE__ */ L(re, {
|
|
346
346
|
series: e,
|
|
347
347
|
open: "open",
|
|
348
348
|
high: "high",
|
|
@@ -371,7 +371,7 @@ function oe({ open: e, high: t, low: n, close: i, volume: a, display: o = "candl
|
|
|
371
371
|
colorAt: (e) => E(e) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
|
|
372
372
|
bar: { radius: 1 }
|
|
373
373
|
}],
|
|
374
|
-
children: /* @__PURE__ */ L(
|
|
374
|
+
children: /* @__PURE__ */ L(f, { series: "volume" })
|
|
375
375
|
}) : void 0
|
|
376
376
|
});
|
|
377
377
|
}
|
|
@@ -558,27 +558,27 @@ var ye = {
|
|
|
558
558
|
"var(--lilt-series-3)",
|
|
559
559
|
"var(--lilt-series-5)"
|
|
560
560
|
];
|
|
561
|
-
function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: s = ["rsi", "macd"], label: l = "Price", scale: u = "linear", live: d = !1, data:
|
|
561
|
+
function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlays: o = [], panes: s = ["rsi", "macd"], label: l = "Price", scale: u = "linear", live: d = !1, data: m, ranges: _, delta: v, valueFormat: y = ye, locale: b = "en-US", paneHeight: S = 72, ...C }) {
|
|
562
562
|
let T = !!(t && n && r), E = a ?? (T ? "candle" : "line");
|
|
563
563
|
if (E !== "line" && !T) throw Error("Lilt IndicatorChartCard candles need open, high and low fields.");
|
|
564
564
|
let D = JSON.stringify(o), O = JSON.stringify(s), k = N(() => ge(o), [D]), A = N(() => _e(s), [O]);
|
|
565
565
|
if (A.some((e) => e.kind === "volume") && !i) throw Error("Lilt IndicatorChartCard needs a `volume` field for a volume pane.");
|
|
566
|
-
let j = N(() =>
|
|
567
|
-
|
|
566
|
+
let j = N(() => m ? ve(m, e, k, A) : void 0, [
|
|
567
|
+
m,
|
|
568
568
|
e,
|
|
569
569
|
k,
|
|
570
570
|
A
|
|
571
|
-
]), ee = N(() =>
|
|
571
|
+
]), ee = N(() => _?.map((n) => ({
|
|
572
572
|
...n,
|
|
573
573
|
data: ve(n.data, e, k, A),
|
|
574
574
|
delta: n.delta ?? (t ? Y(n.data, t, e) : void 0)
|
|
575
575
|
})), [
|
|
576
|
-
|
|
576
|
+
_,
|
|
577
577
|
e,
|
|
578
578
|
t,
|
|
579
579
|
k,
|
|
580
580
|
A
|
|
581
|
-
]), M = N(() =>
|
|
581
|
+
]), M = N(() => h(b, y).full, [b, JSON.stringify(y)]), P = N(() => h(b, { maximumFractionDigits: 2 }).full, [b]), F = N(() => h(b).compact, [b]), z = T ? {
|
|
582
582
|
open: {
|
|
583
583
|
label: "Open",
|
|
584
584
|
accessor: (e) => Q(e, t)
|
|
@@ -591,7 +591,7 @@ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
591
591
|
label: "Low",
|
|
592
592
|
accessor: (e) => Q(e, r)
|
|
593
593
|
}
|
|
594
|
-
} : void 0, H = new Map(k.map((e) => [e.id, e])), U =
|
|
594
|
+
} : void 0, H = new Map(k.map((e) => [e.id, e])), U = m?.length ? Q(m[0], e) : null, W = m?.length ? Q(m.at(-1), e) : null, G = U === null || W === null || W >= U, K = A.at(-1)?.id, te = (n, r) => {
|
|
595
595
|
let a = n.id === K, o = (e) => (t) => Q(t, e), s = (e, t, n) => {
|
|
596
596
|
let r = Q(e, t);
|
|
597
597
|
return /* @__PURE__ */ R("span", {
|
|
@@ -623,7 +623,7 @@ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
623
623
|
colorAt: (n) => (Q(n, e) ?? 0) >= (Q(n, t) ?? Q(n, e) ?? 0) ? "color-mix(in srgb, var(--lilt-candle-up) 42%, transparent)" : "color-mix(in srgb, var(--lilt-candle-down) 42%, transparent)",
|
|
624
624
|
bar: { radius: 1 }
|
|
625
625
|
}],
|
|
626
|
-
children: /* @__PURE__ */ L(
|
|
626
|
+
children: /* @__PURE__ */ L(f, { series: "volume" })
|
|
627
627
|
}, n.id);
|
|
628
628
|
if (n.kind === "rsi") return /* @__PURE__ */ R(q, {
|
|
629
629
|
context: r,
|
|
@@ -649,7 +649,7 @@ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
649
649
|
}
|
|
650
650
|
}],
|
|
651
651
|
children: [
|
|
652
|
-
/* @__PURE__ */ L(
|
|
652
|
+
/* @__PURE__ */ L(p, {
|
|
653
653
|
axis: "y",
|
|
654
654
|
from: 30,
|
|
655
655
|
to: 70,
|
|
@@ -713,17 +713,17 @@ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
713
713
|
}
|
|
714
714
|
],
|
|
715
715
|
children: [
|
|
716
|
-
/* @__PURE__ */ L(
|
|
716
|
+
/* @__PURE__ */ L(f, { series: u }),
|
|
717
717
|
/* @__PURE__ */ L(w, { series: c }),
|
|
718
718
|
/* @__PURE__ */ L(w, { series: l })
|
|
719
719
|
]
|
|
720
720
|
}, n.id);
|
|
721
721
|
};
|
|
722
|
-
return /* @__PURE__ */ L(
|
|
722
|
+
return /* @__PURE__ */ L(g, {
|
|
723
723
|
...C,
|
|
724
724
|
data: j,
|
|
725
725
|
ranges: ee,
|
|
726
|
-
delta:
|
|
726
|
+
delta: v ?? (m && t ? Y(m, t, e) : void 0),
|
|
727
727
|
valueFormat: y,
|
|
728
728
|
locale: b,
|
|
729
729
|
aggregate: "last",
|
|
@@ -798,7 +798,7 @@ function xe({ close: e, open: t, high: n, low: r, volume: i, display: a, overlay
|
|
|
798
798
|
//#endregion
|
|
799
799
|
//#region src/finance/cards/depth-chart-card.tsx
|
|
800
800
|
function Se({ price: e, label: t }) {
|
|
801
|
-
let { snapshot: n } =
|
|
801
|
+
let { snapshot: n } = v();
|
|
802
802
|
if (e < n.xDomain[0] || e > n.xDomain[1]) return null;
|
|
803
803
|
let r = n.xToPixel(e);
|
|
804
804
|
return /* @__PURE__ */ R("g", {
|
|
@@ -825,8 +825,8 @@ var Ce = {
|
|
|
825
825
|
minimumFractionDigits: 2,
|
|
826
826
|
maximumFractionDigits: 2
|
|
827
827
|
};
|
|
828
|
-
function we({ title: e, bids: t, asks:
|
|
829
|
-
let E = N(() => he(t,
|
|
828
|
+
function we({ title: e, bids: t, asks: r, valueFormat: a = Ce, sizeFormat: o, locale: s = "en-US", height: c = 220, axis: l = "minimal", background: d = "dots", hoverStyle: f = "soft", surface: p, numberStyle: g, loading: _ = !1, loadingStyle: v = "shimmer", motion: y, className: b, style: x, depth: C = !1 }) {
|
|
829
|
+
let E = N(() => he(t, r), [t, r]), D = JSON.stringify(a), M = JSON.stringify(o ?? null), P = N(() => h(s, a), [s, D]), I = N(() => h(s, o), [s, M]), z = N(() => h(s, {
|
|
830
830
|
style: "percent",
|
|
831
831
|
maximumFractionDigits: 3
|
|
832
832
|
}).full, [s]), [H, U] = F(null), W = N(() => [{
|
|
@@ -857,17 +857,17 @@ function we({ title: e, bids: t, asks: n, valueFormat: i = Ce, sizeFormat: o, lo
|
|
|
857
857
|
return /* @__PURE__ */ R(ee, {
|
|
858
858
|
"aria-label": e,
|
|
859
859
|
surface: p,
|
|
860
|
-
numberStyle:
|
|
861
|
-
motion:
|
|
860
|
+
numberStyle: g,
|
|
861
|
+
motion: y,
|
|
862
862
|
className: ["lilt-card--depth", b].filter(Boolean).join(" "),
|
|
863
863
|
style: x,
|
|
864
864
|
children: [
|
|
865
865
|
/* @__PURE__ */ R(j, { children: [/* @__PURE__ */ L(A, { children: e }), /* @__PURE__ */ L(k, {
|
|
866
866
|
value: E.mid,
|
|
867
867
|
format: P.full,
|
|
868
|
-
loading:
|
|
869
|
-
motion:
|
|
870
|
-
children:
|
|
868
|
+
loading: _,
|
|
869
|
+
motion: y,
|
|
870
|
+
children: _ ? null : H && K !== null ? /* @__PURE__ */ R(O, { children: [
|
|
871
871
|
I.full(K),
|
|
872
872
|
" ",
|
|
873
873
|
H.side === "bid" ? "bid" : "ask",
|
|
@@ -879,18 +879,18 @@ function we({ title: e, bids: t, asks: n, valueFormat: i = Ce, sizeFormat: o, lo
|
|
|
879
879
|
/* @__PURE__ */ R("dl", {
|
|
880
880
|
className: "lilt-card__stats",
|
|
881
881
|
children: [
|
|
882
|
-
/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("dt", { children: "Spread" }), /* @__PURE__ */ L("dd", { children:
|
|
882
|
+
/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L("dt", { children: "Spread" }), /* @__PURE__ */ L("dd", { children: _ ? "—" : G })] }),
|
|
883
883
|
/* @__PURE__ */ R("div", {
|
|
884
884
|
"data-side": "bid",
|
|
885
|
-
children: [/* @__PURE__ */ L("dt", { children: "Bid depth" }), /* @__PURE__ */ L("dd", { children:
|
|
885
|
+
children: [/* @__PURE__ */ L("dt", { children: "Bid depth" }), /* @__PURE__ */ L("dd", { children: _ ? "—" : I.compact(E.bidDepth) })]
|
|
886
886
|
}),
|
|
887
887
|
/* @__PURE__ */ R("div", {
|
|
888
888
|
"data-side": "ask",
|
|
889
|
-
children: [/* @__PURE__ */ L("dt", { children: "Ask depth" }), /* @__PURE__ */ L("dd", { children:
|
|
889
|
+
children: [/* @__PURE__ */ L("dt", { children: "Ask depth" }), /* @__PURE__ */ L("dd", { children: _ ? "—" : I.compact(E.askDepth) })]
|
|
890
890
|
})
|
|
891
891
|
]
|
|
892
892
|
}),
|
|
893
|
-
/* @__PURE__ */ L(
|
|
893
|
+
/* @__PURE__ */ L(m, {
|
|
894
894
|
className: "lilt-card__chart",
|
|
895
895
|
"aria-label": `${e} depth by price`,
|
|
896
896
|
data: E.levels,
|
|
@@ -906,13 +906,13 @@ function we({ title: e, bids: t, asks: n, valueFormat: i = Ce, sizeFormat: o, lo
|
|
|
906
906
|
},
|
|
907
907
|
series: W,
|
|
908
908
|
onSelectionChange: (e) => U(e?.row ?? null),
|
|
909
|
-
motion:
|
|
910
|
-
status:
|
|
911
|
-
loadingStyle:
|
|
912
|
-
children: /* @__PURE__ */ R(
|
|
909
|
+
motion: y,
|
|
910
|
+
status: _ ? "loading" : "ready",
|
|
911
|
+
loadingStyle: v,
|
|
912
|
+
children: /* @__PURE__ */ R(i, {
|
|
913
913
|
height: c,
|
|
914
914
|
axis: l,
|
|
915
|
-
background:
|
|
915
|
+
background: d,
|
|
916
916
|
pill: f,
|
|
917
917
|
margins: {
|
|
918
918
|
top: 8,
|
|
@@ -922,15 +922,15 @@ function we({ title: e, bids: t, asks: n, valueFormat: i = Ce, sizeFormat: o, lo
|
|
|
922
922
|
},
|
|
923
923
|
children: [
|
|
924
924
|
/* @__PURE__ */ L(T, { pattern: "lines" }),
|
|
925
|
-
/* @__PURE__ */ L(
|
|
926
|
-
/* @__PURE__ */ L(
|
|
925
|
+
/* @__PURE__ */ L(n, { series: "bid" }),
|
|
926
|
+
/* @__PURE__ */ L(n, { series: "ask" }),
|
|
927
927
|
/* @__PURE__ */ L(w, { series: "bid" }),
|
|
928
928
|
/* @__PURE__ */ L(w, { series: "ask" }),
|
|
929
929
|
E.mid === null ? null : /* @__PURE__ */ L(Se, {
|
|
930
930
|
price: E.mid,
|
|
931
931
|
label: `Mid ${P.full(E.mid)}`
|
|
932
932
|
}),
|
|
933
|
-
/* @__PURE__ */ L(
|
|
933
|
+
/* @__PURE__ */ L(u, { labels: "fit" }),
|
|
934
934
|
/* @__PURE__ */ L(S, {})
|
|
935
935
|
]
|
|
936
936
|
})
|
|
@@ -949,7 +949,7 @@ function Te(e, t, n) {
|
|
|
949
949
|
let r = e.at(-1), i = $(r, t), a = $(r, n);
|
|
950
950
|
return i !== null && a ? i / a - 1 : void 0;
|
|
951
951
|
}
|
|
952
|
-
function Ee({ value: e, basis: t, label:
|
|
952
|
+
function Ee({ value: e, basis: t, label: r = "Value", drawdown: i = !0, drawdownHeight: a = 64, data: o, ranges: s, delta: c, locale: l = "en-US", ...u }) {
|
|
953
953
|
let d = o ?? s?.[0]?.data ?? [], f = N(() => s?.map((n) => ({
|
|
954
954
|
...n,
|
|
955
955
|
delta: n.delta ?? Te(n.data, e, t)
|
|
@@ -957,7 +957,7 @@ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
957
957
|
s,
|
|
958
958
|
e,
|
|
959
959
|
t
|
|
960
|
-
]), p = N(() =>
|
|
960
|
+
]), p = N(() => h(l, {
|
|
961
961
|
style: "percent",
|
|
962
962
|
minimumFractionDigits: 1,
|
|
963
963
|
maximumFractionDigits: 1
|
|
@@ -965,7 +965,7 @@ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
965
965
|
let t = fe(d.map((t) => $(t, e))).filter((e) => e !== null);
|
|
966
966
|
return z(t) ?? null;
|
|
967
967
|
}, [d, e]);
|
|
968
|
-
return /* @__PURE__ */ L(
|
|
968
|
+
return /* @__PURE__ */ L(g, {
|
|
969
969
|
...u,
|
|
970
970
|
data: o,
|
|
971
971
|
ranges: f,
|
|
@@ -978,7 +978,7 @@ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
978
978
|
restCaption: t ? () => "over basis" : void 0,
|
|
979
979
|
series: [{
|
|
980
980
|
key: e,
|
|
981
|
-
label:
|
|
981
|
+
label: r
|
|
982
982
|
}, ...t ? [{
|
|
983
983
|
key: t,
|
|
984
984
|
label: "Basis",
|
|
@@ -996,10 +996,10 @@ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
996
996
|
area: { treatment: "fade" },
|
|
997
997
|
curve: "monotone"
|
|
998
998
|
},
|
|
999
|
-
draw: (e) => e.map((e) => [/* @__PURE__ */ L(
|
|
999
|
+
draw: (e) => e.map((e) => [/* @__PURE__ */ L(n, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, e)])
|
|
1000
1000
|
},
|
|
1001
1001
|
panes: i ? (t) => {
|
|
1002
|
-
let
|
|
1002
|
+
let r = fe(t.data.map((t) => $(t, e))), i = new Map(t.data.map((e, t) => [e, r[t] ?? null]));
|
|
1003
1003
|
return /* @__PURE__ */ R(q, {
|
|
1004
1004
|
context: t,
|
|
1005
1005
|
label: `${u.title} drawdown`,
|
|
@@ -1028,7 +1028,7 @@ function Ee({ value: e, basis: t, label: n = "Value", drawdown: i = !0, drawdown
|
|
|
1028
1028
|
line: { width: 1.5 },
|
|
1029
1029
|
curve: "monotone"
|
|
1030
1030
|
}],
|
|
1031
|
-
children: [/* @__PURE__ */ L(
|
|
1031
|
+
children: [/* @__PURE__ */ L(n, { series: "drawdown" }), /* @__PURE__ */ L(w, { series: "drawdown" })]
|
|
1032
1032
|
});
|
|
1033
1033
|
} : void 0
|
|
1034
1034
|
});
|
|
@@ -1057,28 +1057,28 @@ var Ae = {
|
|
|
1057
1057
|
minimumFractionDigits: 2,
|
|
1058
1058
|
maximumFractionDigits: 2
|
|
1059
1059
|
};
|
|
1060
|
-
function je({ price: e, symbol: t, name:
|
|
1061
|
-
let
|
|
1060
|
+
function je({ price: e, symbol: t, name: r, icon: i, display: a = "area", versus: o, data: s, ranges: c, delta: l, valueFormat: u = Ae, locale: f = "en-US", title: p, ...m }) {
|
|
1061
|
+
let _ = !!o?.length, v = N(() => [e, ...(o ?? []).map((e) => e.key)], [e, o]), y = N(() => s ? _ ? ke(s, v) : s : void 0, [
|
|
1062
1062
|
s,
|
|
1063
|
-
|
|
1064
|
-
|
|
1063
|
+
_,
|
|
1064
|
+
v
|
|
1065
1065
|
]), b = N(() => c?.map((t) => {
|
|
1066
1066
|
let n = Oe(t.data, e);
|
|
1067
1067
|
return {
|
|
1068
1068
|
...t,
|
|
1069
|
-
data:
|
|
1069
|
+
data: _ ? ke(t.data, v) : t.data,
|
|
1070
1070
|
delta: t.delta ?? (n && n.first ? n.last / n.first - 1 : void 0)
|
|
1071
1071
|
};
|
|
1072
1072
|
}), [
|
|
1073
1073
|
c,
|
|
1074
|
-
h,
|
|
1075
1074
|
_,
|
|
1075
|
+
v,
|
|
1076
1076
|
e
|
|
1077
|
-
]), x = Oe(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = N(() =>
|
|
1077
|
+
]), x = Oe(s ?? c?.[0]?.data ?? [], e), S = !x || x.last >= x.first, C = N(() => h(f, u).full, [f, JSON.stringify(u)]), T = N(() => h(f, {
|
|
1078
1078
|
style: "percent",
|
|
1079
1079
|
minimumFractionDigits: 1,
|
|
1080
1080
|
maximumFractionDigits: 1
|
|
1081
|
-
}).full, [
|
|
1081
|
+
}).full, [f]), E = (e) => _ ? `__rebased${e}` : e, D = /* @__PURE__ */ R("span", {
|
|
1082
1082
|
className: "lilt-card__ticker",
|
|
1083
1083
|
children: [
|
|
1084
1084
|
i ? /* @__PURE__ */ L("span", {
|
|
@@ -1089,50 +1089,50 @@ function je({ price: e, symbol: t, name: n, icon: i, display: a = "area", versus
|
|
|
1089
1089
|
className: "lilt-card__ticker-symbol",
|
|
1090
1090
|
children: t ?? p
|
|
1091
1091
|
}),
|
|
1092
|
-
|
|
1092
|
+
r ? /* @__PURE__ */ L("span", {
|
|
1093
1093
|
className: "lilt-card__ticker-name",
|
|
1094
|
-
children:
|
|
1094
|
+
children: r
|
|
1095
1095
|
}) : null
|
|
1096
1096
|
]
|
|
1097
1097
|
});
|
|
1098
|
-
return /* @__PURE__ */ L(
|
|
1098
|
+
return /* @__PURE__ */ L(g, {
|
|
1099
1099
|
...m,
|
|
1100
1100
|
title: p,
|
|
1101
1101
|
heading: D,
|
|
1102
1102
|
data: y,
|
|
1103
1103
|
ranges: b,
|
|
1104
|
-
delta:
|
|
1105
|
-
valueFormat:
|
|
1104
|
+
delta: _ ? void 0 : l ?? (s && x && x.first ? x.last / x.first - 1 : void 0),
|
|
1105
|
+
valueFormat: _ ? {
|
|
1106
1106
|
style: "percent",
|
|
1107
1107
|
maximumFractionDigits: 1
|
|
1108
1108
|
} : u,
|
|
1109
|
-
formatValue:
|
|
1110
|
-
locale:
|
|
1109
|
+
formatValue: _ ? (e) => d(T)(e) : void 0,
|
|
1110
|
+
locale: f,
|
|
1111
1111
|
aggregate: "last",
|
|
1112
1112
|
headlineSeries: E(e),
|
|
1113
|
-
pillSeries:
|
|
1114
|
-
tiles:
|
|
1115
|
-
restCaption:
|
|
1113
|
+
pillSeries: _ ? "nearest" : E(e),
|
|
1114
|
+
tiles: _,
|
|
1115
|
+
restCaption: _ ? void 0 : (t) => {
|
|
1116
1116
|
let n = Oe(t, e);
|
|
1117
|
-
return n ?
|
|
1117
|
+
return n ? d(C)(n.last - n.first) : null;
|
|
1118
1118
|
},
|
|
1119
1119
|
series: [{
|
|
1120
1120
|
key: E(e),
|
|
1121
1121
|
label: t ?? p,
|
|
1122
|
-
color:
|
|
1122
|
+
color: _ ? void 0 : S ? B : V
|
|
1123
1123
|
}, ...(o ?? []).map((e) => ({
|
|
1124
1124
|
...e,
|
|
1125
1125
|
key: E(e.key)
|
|
1126
1126
|
}))],
|
|
1127
1127
|
shape: {
|
|
1128
1128
|
kind: "marks",
|
|
1129
|
-
id: `price:${a}:${
|
|
1130
|
-
includeZero:
|
|
1131
|
-
series: () => a === "area" && !
|
|
1129
|
+
id: `price:${a}:${v.join()}:${_}`,
|
|
1130
|
+
includeZero: _,
|
|
1131
|
+
series: () => a === "area" && !_ ? {
|
|
1132
1132
|
area: { treatment: "fade" },
|
|
1133
1133
|
curve: "monotone"
|
|
1134
1134
|
} : { curve: "monotone" },
|
|
1135
|
-
draw: (e) => e.map((e) => a === "area" && !
|
|
1135
|
+
draw: (e) => e.map((e) => a === "area" && !_ ? [/* @__PURE__ */ L(n, { series: e }, `area-${e}`), /* @__PURE__ */ L(w, { series: e }, e)] : /* @__PURE__ */ L(w, { series: e }, e))
|
|
1136
1136
|
},
|
|
1137
1137
|
bleed: m.bleed ?? !0
|
|
1138
1138
|
});
|
|
@@ -1164,14 +1164,14 @@ function Ne(e, t) {
|
|
|
1164
1164
|
return () => window.clearTimeout(s);
|
|
1165
1165
|
}, [e, t]), r;
|
|
1166
1166
|
}
|
|
1167
|
-
function Pe({ title: e, bids: t, asks:
|
|
1167
|
+
function Pe({ title: e, bids: t, asks: n, levels: r = 8, depth: i = !1, valueFormat: a = {
|
|
1168
1168
|
minimumFractionDigits: 2,
|
|
1169
1169
|
maximumFractionDigits: 2
|
|
1170
|
-
}, sizeFormat:
|
|
1171
|
-
let
|
|
1170
|
+
}, sizeFormat: o, locale: s = "en-US", flash: c = !0, surface: l, loading: u = !1, loadingStyle: d = "shimmer", motion: f, className: p, style: m }) {
|
|
1171
|
+
let g = D(f ?? "auto"), _ = y(u, d), v = JSON.stringify(a), x = JSON.stringify(o ?? null), S = N(() => h(s, a).full, [s, v]), C = N(() => h(s, o).compact, [s, x]), w = N(() => h(s, {
|
|
1172
1172
|
style: "percent",
|
|
1173
1173
|
maximumFractionDigits: 3
|
|
1174
|
-
}).full, [
|
|
1174
|
+
}).full, [s]), T = N(() => Me(t, "bid", r), [t, r]), E = N(() => Me(n, "ask", r), [n, r]), O = Ne(N(() => [...E, ...T], [E, T]), c && !g && !u), k = Math.max(1, E.at(-1)?.total ?? 0, T.at(-1)?.total ?? 0), A = T[0]?.price, j = E[0]?.price, M = A !== void 0 && j !== void 0 ? {
|
|
1175
1175
|
value: j - A,
|
|
1176
1176
|
mid: (j + A) / 2
|
|
1177
1177
|
} : null, P = (e) => /* @__PURE__ */ R("tr", {
|
|
@@ -1182,7 +1182,7 @@ function Pe({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFor
|
|
|
1182
1182
|
children: [
|
|
1183
1183
|
/* @__PURE__ */ R("th", {
|
|
1184
1184
|
scope: "row",
|
|
1185
|
-
children: [
|
|
1185
|
+
children: [i ? /* @__PURE__ */ L("span", {
|
|
1186
1186
|
className: "lilt-order-book__bar",
|
|
1187
1187
|
"aria-hidden": "true"
|
|
1188
1188
|
}) : null, S(e.price)]
|
|
@@ -1190,7 +1190,7 @@ function Pe({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFor
|
|
|
1190
1190
|
/* @__PURE__ */ L("td", { children: C(e.size) }),
|
|
1191
1191
|
/* @__PURE__ */ L("td", { children: C(e.total) })
|
|
1192
1192
|
]
|
|
1193
|
-
}, `${e.side}:${e.price}`), F = (e) => Array.from({ length: Math.max(1, Math.min(50,
|
|
1193
|
+
}, `${e.side}:${e.price}`), F = (e) => Array.from({ length: Math.max(1, Math.min(50, r)) }, (t, n) => /* @__PURE__ */ R("tr", {
|
|
1194
1194
|
className: "lilt-order-book__placeholder",
|
|
1195
1195
|
"aria-hidden": "true",
|
|
1196
1196
|
children: [
|
|
@@ -1210,17 +1210,17 @@ function Pe({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFor
|
|
|
1210
1210
|
}, `${e}-${n}`));
|
|
1211
1211
|
return /* @__PURE__ */ L(ee, {
|
|
1212
1212
|
"aria-label": e,
|
|
1213
|
-
surface:
|
|
1214
|
-
motion:
|
|
1215
|
-
className: ["lilt-card--order-book",
|
|
1216
|
-
style:
|
|
1213
|
+
surface: l,
|
|
1214
|
+
motion: f,
|
|
1215
|
+
className: ["lilt-card--order-book", p].filter(Boolean).join(" "),
|
|
1216
|
+
style: m,
|
|
1217
1217
|
children: /* @__PURE__ */ R("table", {
|
|
1218
|
-
ref:
|
|
1219
|
-
className:
|
|
1220
|
-
"data-depth":
|
|
1221
|
-
"data-style":
|
|
1222
|
-
"data-reduced-motion":
|
|
1223
|
-
"aria-busy":
|
|
1218
|
+
ref: _,
|
|
1219
|
+
className: u ? "lilt-order-book lilt-skeleton" : "lilt-order-book",
|
|
1220
|
+
"data-depth": i || void 0,
|
|
1221
|
+
"data-style": u ? d : void 0,
|
|
1222
|
+
"data-reduced-motion": g || void 0,
|
|
1223
|
+
"aria-busy": u,
|
|
1224
1224
|
children: [
|
|
1225
1225
|
/* @__PURE__ */ L("caption", { children: e }),
|
|
1226
1226
|
/* @__PURE__ */ L("thead", { children: /* @__PURE__ */ R("tr", { children: [
|
|
@@ -1239,7 +1239,7 @@ function Pe({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFor
|
|
|
1239
1239
|
] }) }),
|
|
1240
1240
|
/* @__PURE__ */ L("tbody", {
|
|
1241
1241
|
"aria-label": "Asks",
|
|
1242
|
-
children:
|
|
1242
|
+
children: u ? F("ask") : [...E].reverse().map(P)
|
|
1243
1243
|
}),
|
|
1244
1244
|
/* @__PURE__ */ L("tbody", {
|
|
1245
1245
|
"aria-label": "Spread",
|
|
@@ -1247,16 +1247,16 @@ function Pe({ title: e, bids: t, asks: r, levels: i = 8, depth: a = !1, valueFor
|
|
|
1247
1247
|
className: "lilt-order-book__spread",
|
|
1248
1248
|
children: [/* @__PURE__ */ L("th", {
|
|
1249
1249
|
scope: "row",
|
|
1250
|
-
children:
|
|
1250
|
+
children: u ? "—" : M ? S(M.mid) : "—"
|
|
1251
1251
|
}), /* @__PURE__ */ L("td", {
|
|
1252
1252
|
colSpan: 2,
|
|
1253
|
-
children:
|
|
1253
|
+
children: u ? "Loading order book" : M ? `Spread ${S(M.value)} · ${w(M.value / M.mid)}` : "No spread"
|
|
1254
1254
|
})]
|
|
1255
1255
|
})
|
|
1256
1256
|
}),
|
|
1257
1257
|
/* @__PURE__ */ L("tbody", {
|
|
1258
1258
|
"aria-label": "Bids",
|
|
1259
|
-
children:
|
|
1259
|
+
children: u ? F("bid") : T.map(P)
|
|
1260
1260
|
})
|
|
1261
1261
|
]
|
|
1262
1262
|
})
|