@gearbox-protocol/ui-kit 3.14.0-next.32 → 3.14.0-next.33

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.
@@ -1,4 +1,4 @@
1
- import { ChartOptions, DeepPartial, Time } from 'lightweight-charts';
1
+ import { ChartOptions, DeepPartial, LineWidth, Time, LineStyle } from 'lightweight-charts';
2
2
  import { Point, YMeasureUnits } from './formatters';
3
3
  import { GraphTooltipProps } from './graph-tooltip';
4
4
  import * as React from "react";
@@ -24,6 +24,50 @@ export type VerticalLineOptions = Partial<{
24
24
  labelTextColor: string;
25
25
  showLabel: boolean;
26
26
  }>;
27
+ /**
28
+ * Horizontal reference line drawn at a fixed Y (price) value, e.g. a
29
+ * liquidation price level. Rendered as a native lightweight-charts price line
30
+ * attached to a series, so it tracks the series' price scale and does not
31
+ * affect autoscale or tooltips.
32
+ */
33
+ export interface PriceLineConfig {
34
+ /** Y value (price) where the horizontal line is drawn. */
35
+ price: number;
36
+ /**
37
+ * Label of the series to attach the line to. When omitted, the line is
38
+ * attached to the first series that has data (its price scale is used).
39
+ */
40
+ seriesLabel?: string;
41
+ /** Line color. Defaults to the destructive theme color. */
42
+ color?: string;
43
+ /** Text shown next to the line on the price axis. */
44
+ title?: string;
45
+ /** Line thickness (1–4). Default 1. */
46
+ lineWidth?: LineWidth;
47
+ /** Line dash style. Default dashed. */
48
+ lineStyle?: LineStyle;
49
+ /** Whether to render the value label on the price axis. Default true. */
50
+ axisLabelVisible?: boolean;
51
+ }
52
+ /**
53
+ * Shaded horizontal band drawn between two Y (price) values across the full
54
+ * width of the chart — e.g. a liquidation "danger zone" below a health-factor
55
+ * threshold. Rendered behind the series as a lightweight-charts primitive, so
56
+ * it tracks the series' price scale and does not affect tooltips.
57
+ */
58
+ export interface PriceZoneConfig {
59
+ /** Upper price bound. Omit to extend the band to the top of the pane. */
60
+ priceTop?: number;
61
+ /** Lower price bound. Omit to extend the band to the bottom of the pane. */
62
+ priceBottom?: number;
63
+ /** Fill color — use a translucent value. Defaults to a translucent destructive tint. */
64
+ color?: string;
65
+ /**
66
+ * Label of the series whose price scale the band is drawn against. When
67
+ * omitted, the first series with data is used.
68
+ */
69
+ seriesLabel?: string;
70
+ }
27
71
  /**
28
72
  * Returns formatted label and value strings for a vertical line tooltip.
29
73
  * Used by Graph and by tests.
@@ -70,6 +114,17 @@ export interface GraphProps {
70
114
  xCoordinate: Time;
71
115
  options?: VerticalLineOptions;
72
116
  }>;
117
+ /**
118
+ * Horizontal reference lines drawn at fixed Y (price) values, e.g. a
119
+ * liquidation price level. Each line is attached to a series' price scale.
120
+ */
121
+ priceLineOptions?: Array<PriceLineConfig>;
122
+ /**
123
+ * Shaded horizontal bands (e.g. a liquidation danger zone) drawn behind the
124
+ * series. Each zone is attached to a series' price scale; finite bounds are
125
+ * included in the Y autoscale so the band stays visible.
126
+ */
127
+ zoneOptions?: Array<PriceZoneConfig>;
73
128
  /**
74
129
  * Number of decimal places for current value display.
75
130
  * If 0, rounds to whole numbers. Default is 4.
@@ -121,4 +176,4 @@ export interface GraphProps {
121
176
  * with support for area series, custom tooltips, and vertical line annotations
122
177
  * Supports single or multiple series with different colors and legends
123
178
  */
124
- export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, currentValueDecimals, useSharedPriceScale, showCurrentValue, graphTitle, yScaleMin, yScaleMinMultiple, visibleTimeFrom, disableZoom, }: GraphProps): React.ReactElement;
179
+ export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, priceLineOptions, zoneOptions, currentValueDecimals, useSharedPriceScale, showCurrentValue, graphTitle, yScaleMin, yScaleMinMultiple, visibleTimeFrom, disableZoom, }: GraphProps): React.ReactElement;
@@ -1,6 +1,6 @@
1
1
  export * from './default-config';
2
2
  export { getXFormatter, getXFormatters, getYFormatter, type Point as GraphPoint, type XFormatters, type XMeasureUnits, type YMeasureUnits, } from './formatters';
3
- export { DEFAULT_SERIES_COLORS, Graph, type GraphProps, getSeriesColorPalette, getVerticalLineTooltipContent, type SeriesColorPalette, type SeriesConfig, type VerticalLineOptions, } from './graph';
3
+ export { DEFAULT_SERIES_COLORS, Graph, type GraphProps, getSeriesColorPalette, getVerticalLineTooltipContent, type PriceLineConfig, type PriceZoneConfig, type SeriesColorPalette, type SeriesConfig, type VerticalLineOptions, } from './graph';
4
4
  export * from './graph-current-value';
5
5
  export * from './graph-tooltip';
6
6
  export * from './graph-view';
@@ -64,6 +64,7 @@ export declare const preset: {
64
64
  "success-hover": string;
65
65
  warning: string;
66
66
  liquidation: string;
67
+ "liquidation-line": string;
67
68
  border: string;
68
69
  input: string;
69
70
  ring: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.14.0-next.32",
3
+ "version": "3.14.0-next.33",
4
4
  "description": "Internal UI components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -72,6 +72,7 @@ html.dark {
72
72
  --success-hover: 136.58 100% 85.1%;
73
73
  --warning: 38 95% 45%;
74
74
  --liquidation: 274 67% 48%;
75
+ --liquidation-line: 38 92% 50%;
75
76
  --input: 225 10% 88%;
76
77
  --ring: 330 100% 50%;
77
78
  --radius: 0.75rem;
@@ -119,6 +120,7 @@ html.dark {
119
120
  --destructive-foreground: 0 0% 100%;
120
121
  --warning: 43.12 100% 68.63%;
121
122
  --liquidation: 277.22 74.53% 58.43%;
123
+ --liquidation-line: 38 92% 50%;
122
124
  --input: 225 6% 19%;
123
125
  --ring: 330 100% 59%;
124
126
  --gray-10: 225 5.26% 14.9%;
@@ -49,6 +49,7 @@
49
49
  --color-success-hover: hsl(var(--success-hover));
50
50
  --color-warning: hsl(var(--warning));
51
51
  --color-liquidation: hsl(var(--liquidation));
52
+ --color-liquidation-line: hsl(var(--liquidation-line));
52
53
  --color-border: hsl(var(--border));
53
54
  --color-input: hsl(var(--input));
54
55
  --color-ring: hsl(var(--ring));