@gearbox-protocol/permissionless-ui 1.4.2 → 1.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/health-factor.js +2 -4
- package/dist/cjs/components/liquidation/liquidation-graph.js +7 -22
- package/dist/cjs/utils/reactochart-compat.js +62 -0
- package/dist/esm/components/health-factor.js +2 -4
- package/dist/esm/components/liquidation/liquidation-graph.js +8 -6
- package/dist/esm/utils/reactochart-compat.js +23 -0
- package/dist/types/components/health-factor.d.ts +8 -12
- package/dist/types/types/reactochart.d.ts +108 -16
- package/dist/types/utils/reactochart-compat.d.ts +16 -0
- package/package.json +3 -2
|
@@ -42,8 +42,7 @@ const BAD_HF = 11e3;
|
|
|
42
42
|
const CRITICAL_HF = 10500;
|
|
43
43
|
const getHFZones = (hf) => {
|
|
44
44
|
if (!hf) return void 0;
|
|
45
|
-
const
|
|
46
|
-
const hfInBasisPoints = numHf < 1e3 ? numHf * import_format_money.PERCENTAGE_FACTOR : numHf;
|
|
45
|
+
const hfInBasisPoints = Number(hf);
|
|
47
46
|
if (hfInBasisPoints >= GOOD_HF) return "good";
|
|
48
47
|
if (hfInBasisPoints > BAD_HF) return "medium";
|
|
49
48
|
if (hfInBasisPoints > CRITICAL_HF) return "bad";
|
|
@@ -84,8 +83,7 @@ function HealthFactor({
|
|
|
84
83
|
const renderValue = () => {
|
|
85
84
|
if (zeroDebt) return "N/A";
|
|
86
85
|
const numValue = Number(value);
|
|
87
|
-
const
|
|
88
|
-
const hfDecimal = hfInBasisPoints / import_format_money.PERCENTAGE_FACTOR;
|
|
86
|
+
const hfDecimal = numValue / import_format_money.PERCENTAGE_FACTOR;
|
|
89
87
|
const formatted = (0, import_format_money.formatPercentAmount)(hfDecimal, decimals);
|
|
90
88
|
return String(formatted);
|
|
91
89
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var liquidation_graph_exports = {};
|
|
30
20
|
__export(liquidation_graph_exports, {
|
|
@@ -33,14 +23,9 @@ __export(liquidation_graph_exports, {
|
|
|
33
23
|
module.exports = __toCommonJS(liquidation_graph_exports);
|
|
34
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
25
|
var import_react = require("react");
|
|
36
|
-
var import_ColorHeatmap = __toESM(require("reactochart/ColorHeatmap"));
|
|
37
|
-
var import_XAxis = __toESM(require("reactochart/XAxis"));
|
|
38
|
-
var import_XLine = __toESM(require("reactochart/XLine"));
|
|
39
|
-
var import_XYPlot = __toESM(require("reactochart/XYPlot"));
|
|
40
|
-
var import_YAxis = __toESM(require("reactochart/YAxis"));
|
|
41
|
-
var import_YLine = __toESM(require("reactochart/YLine"));
|
|
42
26
|
var import_use_hf = require('../../hooks/use-hf.js');
|
|
43
27
|
var import_use_liquidation = require('../../hooks/use-liquidation/index.js');
|
|
28
|
+
var import_reactochart_compat = require('../../utils/reactochart-compat.js');
|
|
44
29
|
var import_vspace = require('../vspace.js');
|
|
45
30
|
var import_liquidation_graph_legend = require('./liquidation-graph-legend.js');
|
|
46
31
|
var import_liquidation_graph_tip = require('./liquidation-graph-tip.js');
|
|
@@ -150,7 +135,7 @@ function LiquidationGraph({
|
|
|
150
135
|
) }),
|
|
151
136
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vspace.VSpace, { height: 16 }),
|
|
152
137
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full liquidation-graph-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
153
|
-
|
|
138
|
+
import_reactochart_compat.XYPlot,
|
|
154
139
|
{
|
|
155
140
|
width,
|
|
156
141
|
height,
|
|
@@ -160,7 +145,7 @@ function LiquidationGraph({
|
|
|
160
145
|
onMouseLeave: handleMouseLeave,
|
|
161
146
|
children: [
|
|
162
147
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
163
|
-
|
|
148
|
+
import_reactochart_compat.XAxis,
|
|
164
149
|
{
|
|
165
150
|
showLine: false,
|
|
166
151
|
title: (0, import_use_liquidation.formatAxisTipLabel)(xLabel, underlyingToken, xOrder),
|
|
@@ -174,7 +159,7 @@ function LiquidationGraph({
|
|
|
174
159
|
}
|
|
175
160
|
),
|
|
176
161
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
177
|
-
|
|
162
|
+
import_reactochart_compat.YAxis,
|
|
178
163
|
{
|
|
179
164
|
showLine: false,
|
|
180
165
|
title: (0, import_use_liquidation.formatAxisTipLabel)(yLabel, underlyingToken, yOrder),
|
|
@@ -188,7 +173,7 @@ function LiquidationGraph({
|
|
|
188
173
|
}
|
|
189
174
|
),
|
|
190
175
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
191
|
-
|
|
176
|
+
import_reactochart_compat.ColorHeatmap,
|
|
192
177
|
{
|
|
193
178
|
data: heatmap,
|
|
194
179
|
value: (d) => d.value,
|
|
@@ -199,8 +184,8 @@ function LiquidationGraph({
|
|
|
199
184
|
rectClassName: (p) => (0, import_use_liquidation.getCellClass)(p, currentPoint, activePointX, activePointY)
|
|
200
185
|
}
|
|
201
186
|
),
|
|
202
|
-
activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
203
|
-
activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
+
activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactochart_compat.XLine, { value: activePointX, className: CROSSHAIR_X }),
|
|
188
|
+
activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_reactochart_compat.YLine, { value: activePointY, className: CROSSHAIR_Y })
|
|
204
189
|
]
|
|
205
190
|
}
|
|
206
191
|
) }),
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var reactochart_compat_exports = {};
|
|
30
|
+
__export(reactochart_compat_exports, {
|
|
31
|
+
ColorHeatmap: () => ColorHeatmap,
|
|
32
|
+
XAxis: () => XAxis,
|
|
33
|
+
XLine: () => XLine,
|
|
34
|
+
XYPlot: () => XYPlot,
|
|
35
|
+
YAxis: () => YAxis,
|
|
36
|
+
YLine: () => YLine
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(reactochart_compat_exports);
|
|
39
|
+
var import_ColorHeatmap = __toESM(require("reactochart/ColorHeatmap"));
|
|
40
|
+
var import_XAxis = __toESM(require("reactochart/XAxis"));
|
|
41
|
+
var import_XLine = __toESM(require("reactochart/XLine"));
|
|
42
|
+
var import_XYPlot = __toESM(require("reactochart/XYPlot"));
|
|
43
|
+
var import_YAxis = __toESM(require("reactochart/YAxis"));
|
|
44
|
+
var import_YLine = __toESM(require("reactochart/YLine"));
|
|
45
|
+
function resolveDefault(mod) {
|
|
46
|
+
return mod.default || mod;
|
|
47
|
+
}
|
|
48
|
+
const ColorHeatmap = resolveDefault(import_ColorHeatmap.default);
|
|
49
|
+
const XAxis = resolveDefault(import_XAxis.default);
|
|
50
|
+
const XLine = resolveDefault(import_XLine.default);
|
|
51
|
+
const XYPlot = resolveDefault(import_XYPlot.default);
|
|
52
|
+
const YAxis = resolveDefault(import_YAxis.default);
|
|
53
|
+
const YLine = resolveDefault(import_YLine.default);
|
|
54
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
55
|
+
0 && (module.exports = {
|
|
56
|
+
ColorHeatmap,
|
|
57
|
+
XAxis,
|
|
58
|
+
XLine,
|
|
59
|
+
XYPlot,
|
|
60
|
+
YAxis,
|
|
61
|
+
YLine
|
|
62
|
+
});
|
|
@@ -6,8 +6,7 @@ const BAD_HF = 11e3;
|
|
|
6
6
|
const CRITICAL_HF = 10500;
|
|
7
7
|
const getHFZones = (hf) => {
|
|
8
8
|
if (!hf) return void 0;
|
|
9
|
-
const
|
|
10
|
-
const hfInBasisPoints = numHf < 1e3 ? numHf * PERCENTAGE_FACTOR : numHf;
|
|
9
|
+
const hfInBasisPoints = Number(hf);
|
|
11
10
|
if (hfInBasisPoints >= GOOD_HF) return "good";
|
|
12
11
|
if (hfInBasisPoints > BAD_HF) return "medium";
|
|
13
12
|
if (hfInBasisPoints > CRITICAL_HF) return "bad";
|
|
@@ -48,8 +47,7 @@ function HealthFactor({
|
|
|
48
47
|
const renderValue = () => {
|
|
49
48
|
if (zeroDebt) return "N/A";
|
|
50
49
|
const numValue = Number(value);
|
|
51
|
-
const
|
|
52
|
-
const hfDecimal = hfInBasisPoints / PERCENTAGE_FACTOR;
|
|
50
|
+
const hfDecimal = numValue / PERCENTAGE_FACTOR;
|
|
53
51
|
const formatted = formatPercentAmount(hfDecimal, decimals);
|
|
54
52
|
return String(formatted);
|
|
55
53
|
};
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useCallback } from "react";
|
|
3
|
-
import ColorHeatmap from "reactochart/ColorHeatmap";
|
|
4
|
-
import XAxis from "reactochart/XAxis";
|
|
5
|
-
import XLine from "reactochart/XLine";
|
|
6
|
-
import XYPlot from "reactochart/XYPlot";
|
|
7
|
-
import YAxis from "reactochart/YAxis";
|
|
8
|
-
import YLine from "reactochart/YLine";
|
|
9
3
|
import { useHF } from "../../hooks/use-hf.js";
|
|
10
4
|
import {
|
|
11
5
|
DEFAULT_AXIS_MAX,
|
|
@@ -19,6 +13,14 @@ import {
|
|
|
19
13
|
useLiquidationHeatmap,
|
|
20
14
|
useWithLiquidationGraphActivePrices
|
|
21
15
|
} from "../../hooks/use-liquidation/index.js";
|
|
16
|
+
import {
|
|
17
|
+
ColorHeatmap,
|
|
18
|
+
XAxis,
|
|
19
|
+
XLine,
|
|
20
|
+
XYPlot,
|
|
21
|
+
YAxis,
|
|
22
|
+
YLine
|
|
23
|
+
} from "../../utils/reactochart-compat.js";
|
|
22
24
|
import { VSpace } from "../vspace.js";
|
|
23
25
|
import { LiquidationGraphLegend } from "./liquidation-graph-legend.js";
|
|
24
26
|
import { LiquidationGraphTip } from "./liquidation-graph-tip.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function resolveDefault(mod) {
|
|
2
|
+
return mod.default || mod;
|
|
3
|
+
}
|
|
4
|
+
import ColorHeatmapImport from "reactochart/ColorHeatmap";
|
|
5
|
+
import XAxisImport from "reactochart/XAxis";
|
|
6
|
+
import XLineImport from "reactochart/XLine";
|
|
7
|
+
import XYPlotImport from "reactochart/XYPlot";
|
|
8
|
+
import YAxisImport from "reactochart/YAxis";
|
|
9
|
+
import YLineImport from "reactochart/YLine";
|
|
10
|
+
const ColorHeatmap = resolveDefault(ColorHeatmapImport);
|
|
11
|
+
const XAxis = resolveDefault(XAxisImport);
|
|
12
|
+
const XLine = resolveDefault(XLineImport);
|
|
13
|
+
const XYPlot = resolveDefault(XYPlotImport);
|
|
14
|
+
const YAxis = resolveDefault(YAxisImport);
|
|
15
|
+
const YLine = resolveDefault(YLineImport);
|
|
16
|
+
export {
|
|
17
|
+
ColorHeatmap,
|
|
18
|
+
XAxis,
|
|
19
|
+
XLine,
|
|
20
|
+
XYPlot,
|
|
21
|
+
YAxis,
|
|
22
|
+
YLine
|
|
23
|
+
};
|
|
@@ -4,17 +4,15 @@ export declare const GOOD_HF = 15000;
|
|
|
4
4
|
export declare const BAD_HF = 11000;
|
|
5
5
|
/**
|
|
6
6
|
* Determines the health factor zone based on the value
|
|
7
|
-
* @param hf - Health factor value
|
|
7
|
+
* @param hf - Health factor value in basis points (e.g., 15000 for 1.5)
|
|
8
8
|
* @returns The health factor zone or undefined
|
|
9
9
|
*/
|
|
10
10
|
export declare const getHFZones: (hf: number | bigint | undefined) => HFZones | undefined;
|
|
11
11
|
export interface HealthFactorProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
12
|
/**
|
|
13
|
-
* The health factor value
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* - Basis points (e.g., 15000 for 150%)
|
|
17
|
-
* Values >= 1000 are treated as basis points, < 1000 as decimal
|
|
13
|
+
* The health factor value in basis points
|
|
14
|
+
* For example: 15000 for health factor 1.5, 500 for health factor 0.05
|
|
15
|
+
* (SDK always returns health factor in basis points: 10000 = 1.0)
|
|
18
16
|
*/
|
|
19
17
|
value: number | bigint;
|
|
20
18
|
/**
|
|
@@ -49,15 +47,13 @@ export interface HealthFactorProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
49
47
|
*
|
|
50
48
|
* @example
|
|
51
49
|
* ```tsx
|
|
52
|
-
* //
|
|
53
|
-
* <HealthFactor value={1.5} debt={1000000n} /> // Shows "1.500" in green
|
|
54
|
-
* <HealthFactor value={1.2} debt={1000000n} decimals={2} /> // Shows "1.20" in yellow
|
|
55
|
-
*
|
|
56
|
-
* // Using basis points
|
|
50
|
+
* // Health factor in basis points (SDK format)
|
|
57
51
|
* <HealthFactor value={15000} debt={1000000n} /> // Shows "1.500" in green
|
|
52
|
+
* <HealthFactor value={12000} debt={1000000n} decimals={2} /> // Shows "1.20" in yellow
|
|
53
|
+
* <HealthFactor value={500} debt={1000000n} /> // Shows "0.050" in red
|
|
58
54
|
*
|
|
59
55
|
* // Zero debt shows N/A
|
|
60
|
-
* <HealthFactor value={
|
|
56
|
+
* <HealthFactor value={15000} debt={0n} /> // Shows "N/A"
|
|
61
57
|
* ```
|
|
62
58
|
*/
|
|
63
59
|
export declare function HealthFactor({ value, debt, decimals, zone, showColor, className, ...props }: HealthFactorProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
declare module "reactochart/ColorHeatmap" {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export default ColorHeatmap;
|
|
2
|
+
import type { Component } from "react";
|
|
3
|
+
|
|
5
4
|
export interface Cell {
|
|
6
5
|
x: unknown;
|
|
7
6
|
y: unknown;
|
|
@@ -9,45 +8,138 @@ declare module "reactochart/ColorHeatmap" {
|
|
|
9
8
|
xEnd?: unknown;
|
|
10
9
|
yEnd?: unknown;
|
|
11
10
|
}
|
|
11
|
+
|
|
12
|
+
interface ColorHeatmapProps {
|
|
13
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
14
|
+
data?: any;
|
|
15
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
16
|
+
value?: (d: any) => number;
|
|
17
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
18
|
+
x?: (d: any) => number;
|
|
19
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
20
|
+
xEnd?: (d: any) => number;
|
|
21
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
22
|
+
y?: (d: any) => number;
|
|
23
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
24
|
+
yEnd?: (d: any) => number;
|
|
25
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
26
|
+
rectClassName?: string | ((d: any) => string);
|
|
27
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
28
|
+
rectStyle?: any;
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
30
|
+
[key: string]: any;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
class ColorHeatmap extends Component<ColorHeatmapProps> {}
|
|
34
|
+
export default ColorHeatmap;
|
|
12
35
|
}
|
|
13
36
|
|
|
14
37
|
declare module "reactochart/XAxis" {
|
|
15
|
-
import type {
|
|
16
|
-
|
|
38
|
+
import type { Component } from "react";
|
|
39
|
+
|
|
40
|
+
interface XAxisProps {
|
|
41
|
+
showLine?: boolean;
|
|
42
|
+
title?: string;
|
|
43
|
+
titleAlign?: string;
|
|
44
|
+
tickCount?: number;
|
|
45
|
+
labelFormat?: (value: number) => string;
|
|
46
|
+
showLabels?: boolean;
|
|
47
|
+
showTicks?: boolean;
|
|
48
|
+
onMouseClickAxis?: () => void;
|
|
49
|
+
nice?: boolean;
|
|
50
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
51
|
+
[key: string]: any;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
class XAxis extends Component<XAxisProps> {}
|
|
17
55
|
export default XAxis;
|
|
18
56
|
}
|
|
19
57
|
|
|
20
58
|
declare module "reactochart/XLine" {
|
|
21
|
-
import type {
|
|
22
|
-
|
|
59
|
+
import type { Component } from "react";
|
|
60
|
+
|
|
61
|
+
interface XLineProps {
|
|
62
|
+
value: number;
|
|
63
|
+
className?: string;
|
|
64
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
65
|
+
[key: string]: any;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class XLine extends Component<XLineProps> {}
|
|
23
69
|
export default XLine;
|
|
24
70
|
}
|
|
25
71
|
|
|
26
72
|
declare module "reactochart/XYPlot" {
|
|
27
|
-
import type {
|
|
28
|
-
|
|
73
|
+
import type { Component } from "react";
|
|
74
|
+
|
|
75
|
+
interface XYPlotProps {
|
|
76
|
+
width: number;
|
|
77
|
+
height: number;
|
|
78
|
+
xDomain?: [number, number];
|
|
79
|
+
yDomain?: [number, number];
|
|
80
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
81
|
+
onMouseMove?: (e: any) => void;
|
|
82
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
83
|
+
onMouseLeave?: (e: any) => void;
|
|
84
|
+
children?: React.ReactNode;
|
|
85
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
86
|
+
[key: string]: any;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
class XYPlot extends Component<XYPlotProps> {}
|
|
29
90
|
export default XYPlot;
|
|
30
91
|
}
|
|
31
92
|
|
|
32
93
|
declare module "reactochart/YAxis" {
|
|
33
|
-
import type {
|
|
34
|
-
|
|
94
|
+
import type { Component } from "react";
|
|
95
|
+
|
|
96
|
+
interface YAxisProps {
|
|
97
|
+
showLine?: boolean;
|
|
98
|
+
title?: string;
|
|
99
|
+
titleAlign?: string;
|
|
100
|
+
tickCount?: number;
|
|
101
|
+
labelFormat?: (value: number) => string;
|
|
102
|
+
showLabels?: boolean;
|
|
103
|
+
showTicks?: boolean;
|
|
104
|
+
onMouseClickAxis?: () => void;
|
|
105
|
+
nice?: boolean;
|
|
106
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
107
|
+
[key: string]: any;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
class YAxis extends Component<YAxisProps> {}
|
|
35
111
|
export default YAxis;
|
|
36
112
|
}
|
|
37
113
|
|
|
38
114
|
declare module "reactochart/YLine" {
|
|
39
|
-
import type {
|
|
40
|
-
|
|
115
|
+
import type { Component } from "react";
|
|
116
|
+
|
|
117
|
+
interface YLineProps {
|
|
118
|
+
value: number;
|
|
119
|
+
className?: string;
|
|
120
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
121
|
+
[key: string]: any;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
class YLine extends Component<YLineProps> {}
|
|
41
125
|
export default YLine;
|
|
42
126
|
}
|
|
43
127
|
|
|
44
128
|
declare module "reactochart/ScatterPlot" {
|
|
45
|
-
import type {
|
|
46
|
-
|
|
47
|
-
export default ScatterPlot;
|
|
129
|
+
import type { Component } from "react";
|
|
130
|
+
|
|
48
131
|
export interface Point {
|
|
49
132
|
x: unknown;
|
|
50
133
|
y: unknown;
|
|
51
134
|
[index: number]: unknown;
|
|
52
135
|
}
|
|
136
|
+
|
|
137
|
+
interface ScatterPlotProps {
|
|
138
|
+
data?: Point[];
|
|
139
|
+
// biome-ignore lint/suspicious/noExplicitAny: third-party library types
|
|
140
|
+
[key: string]: any;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
class ScatterPlot extends Component<ScatterPlotProps> {}
|
|
144
|
+
export default ScatterPlot;
|
|
53
145
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compatibility layer for reactochart CommonJS modules in ESM context
|
|
3
|
+
* Handles the default export resolution for CommonJS modules
|
|
4
|
+
*/
|
|
5
|
+
import ColorHeatmapImport from "reactochart/ColorHeatmap";
|
|
6
|
+
import XAxisImport from "reactochart/XAxis";
|
|
7
|
+
import XLineImport from "reactochart/XLine";
|
|
8
|
+
import XYPlotImport from "reactochart/XYPlot";
|
|
9
|
+
import YAxisImport from "reactochart/YAxis";
|
|
10
|
+
import YLineImport from "reactochart/YLine";
|
|
11
|
+
export declare const ColorHeatmap: typeof ColorHeatmapImport;
|
|
12
|
+
export declare const XAxis: typeof XAxisImport;
|
|
13
|
+
export declare const XLine: typeof XLineImport;
|
|
14
|
+
export declare const XYPlot: typeof XYPlotImport;
|
|
15
|
+
export declare const YAxis: typeof YAxisImport;
|
|
16
|
+
export declare const YLine: typeof YLineImport;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/permissionless-ui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -65,7 +65,6 @@
|
|
|
65
65
|
"react-infinite-scroll-component": "^6.1.0",
|
|
66
66
|
"react-markdown": "^9.0.3",
|
|
67
67
|
"react-markdown-math": "^1.0.2",
|
|
68
|
-
"reactochart": "^6.1.1",
|
|
69
68
|
"remark-gfm": "^4.0.0",
|
|
70
69
|
"sonner": "^1.7.2",
|
|
71
70
|
"tailwind-merge": "^2.6.0",
|
|
@@ -82,6 +81,7 @@
|
|
|
82
81
|
"react-dom": "^18 || ^19",
|
|
83
82
|
"react-intl": "^6.0.0 || ^7.0.0",
|
|
84
83
|
"react-router-dom": "^6.0.0 || ^7.0.0",
|
|
84
|
+
"reactochart": "^6.1.1",
|
|
85
85
|
"viem": "^2.0.0",
|
|
86
86
|
"wagmi": "^2.0.0"
|
|
87
87
|
},
|
|
@@ -122,6 +122,7 @@
|
|
|
122
122
|
"react-dom": "^19.1.1",
|
|
123
123
|
"react-intl": "^6.7.4",
|
|
124
124
|
"react-router-dom": "^7.9.6",
|
|
125
|
+
"reactochart": "^6.1.1",
|
|
125
126
|
"tailwindcss": "^4.1.14",
|
|
126
127
|
"tsup": "^8.5.0",
|
|
127
128
|
"typescript": "^5.9.3",
|