@gearbox-protocol/permissionless-ui 1.4.2 → 1.4.3

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.
@@ -33,17 +33,23 @@ __export(liquidation_graph_exports, {
33
33
  module.exports = __toCommonJS(liquidation_graph_exports);
34
34
  var import_jsx_runtime = require("react/jsx-runtime");
35
35
  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"));
36
+ var ColorHeatmapModule = __toESM(require("reactochart/ColorHeatmap"));
37
+ var XAxisModule = __toESM(require("reactochart/XAxis"));
38
+ var XLineModule = __toESM(require("reactochart/XLine"));
39
+ var XYPlotModule = __toESM(require("reactochart/XYPlot"));
40
+ var YAxisModule = __toESM(require("reactochart/YAxis"));
41
+ var YLineModule = __toESM(require("reactochart/YLine"));
42
42
  var import_use_hf = require('../../hooks/use-hf.js');
43
43
  var import_use_liquidation = require('../../hooks/use-liquidation/index.js');
44
44
  var import_vspace = require('../vspace.js');
45
45
  var import_liquidation_graph_legend = require('./liquidation-graph-legend.js');
46
46
  var import_liquidation_graph_tip = require('./liquidation-graph-tip.js');
47
+ const ColorHeatmap = ColorHeatmapModule.default || ColorHeatmapModule;
48
+ const XAxis = XAxisModule.default || XAxisModule;
49
+ const XLine = XLineModule.default || XLineModule;
50
+ const XYPlot = XYPlotModule.default || XYPlotModule;
51
+ const YAxis = YAxisModule.default || YAxisModule;
52
+ const YLine = YLineModule.default || YLineModule;
47
53
  const WIDTH = 300;
48
54
  const HEIGHT = 300;
49
55
  const CROSSHAIR_X = "rct-crosshair-x";
@@ -150,7 +156,7 @@ function LiquidationGraph({
150
156
  ) }),
151
157
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_vspace.VSpace, { height: 16 }),
152
158
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full liquidation-graph-container", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
153
- import_XYPlot.default,
159
+ XYPlot,
154
160
  {
155
161
  width,
156
162
  height,
@@ -160,7 +166,7 @@ function LiquidationGraph({
160
166
  onMouseLeave: handleMouseLeave,
161
167
  children: [
162
168
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
163
- import_XAxis.default,
169
+ XAxis,
164
170
  {
165
171
  showLine: false,
166
172
  title: (0, import_use_liquidation.formatAxisTipLabel)(xLabel, underlyingToken, xOrder),
@@ -174,7 +180,7 @@ function LiquidationGraph({
174
180
  }
175
181
  ),
176
182
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
177
- import_YAxis.default,
183
+ YAxis,
178
184
  {
179
185
  showLine: false,
180
186
  title: (0, import_use_liquidation.formatAxisTipLabel)(yLabel, underlyingToken, yOrder),
@@ -188,7 +194,7 @@ function LiquidationGraph({
188
194
  }
189
195
  ),
190
196
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
191
- import_ColorHeatmap.default,
197
+ ColorHeatmap,
192
198
  {
193
199
  data: heatmap,
194
200
  value: (d) => d.value,
@@ -199,8 +205,8 @@ function LiquidationGraph({
199
205
  rectClassName: (p) => (0, import_use_liquidation.getCellClass)(p, currentPoint, activePointX, activePointY)
200
206
  }
201
207
  ),
202
- activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_XLine.default, { value: activePointX, className: CROSSHAIR_X }),
203
- activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_YLine.default, { value: activePointY, className: CROSSHAIR_Y })
208
+ activePointX !== void 0 && activePointX !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(XLine, { value: activePointX, className: CROSSHAIR_X }),
209
+ activePointY !== void 0 && activePointY !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(YLine, { value: activePointY, className: CROSSHAIR_Y })
204
210
  ]
205
211
  }
206
212
  ) }),
@@ -1,11 +1,11 @@
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";
3
+ import * as ColorHeatmapModule from "reactochart/ColorHeatmap";
4
+ import * as XAxisModule from "reactochart/XAxis";
5
+ import * as XLineModule from "reactochart/XLine";
6
+ import * as XYPlotModule from "reactochart/XYPlot";
7
+ import * as YAxisModule from "reactochart/YAxis";
8
+ import * as YLineModule from "reactochart/YLine";
9
9
  import { useHF } from "../../hooks/use-hf.js";
10
10
  import {
11
11
  DEFAULT_AXIS_MAX,
@@ -22,6 +22,12 @@ import {
22
22
  import { VSpace } from "../vspace.js";
23
23
  import { LiquidationGraphLegend } from "./liquidation-graph-legend.js";
24
24
  import { LiquidationGraphTip } from "./liquidation-graph-tip.js";
25
+ const ColorHeatmap = ColorHeatmapModule.default || ColorHeatmapModule;
26
+ const XAxis = XAxisModule.default || XAxisModule;
27
+ const XLine = XLineModule.default || XLineModule;
28
+ const XYPlot = XYPlotModule.default || XYPlotModule;
29
+ const YAxis = YAxisModule.default || YAxisModule;
30
+ const YLine = YLineModule.default || YLineModule;
25
31
  const WIDTH = 300;
26
32
  const HEIGHT = 300;
27
33
  const CROSSHAIR_X = "rct-crosshair-x";
@@ -1,7 +1,6 @@
1
1
  declare module "reactochart/ColorHeatmap" {
2
- import type { ComponentType } from "react";
3
- const ColorHeatmap: ComponentType<any>;
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 { ComponentType } from "react";
16
- const XAxis: ComponentType<any>;
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 { ComponentType } from "react";
22
- const XLine: ComponentType<any>;
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 { ComponentType } from "react";
28
- const XYPlot: ComponentType<any>;
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 { ComponentType } from "react";
34
- const YAxis: ComponentType<any>;
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 { ComponentType } from "react";
40
- const YLine: ComponentType<any>;
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 { ComponentType } from "react";
46
- const ScatterPlot: ComponentType<any>;
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",