@gearbox-protocol/permissionless-ui 1.23.0 → 1.24.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.
@@ -18,11 +18,23 @@ type VerticalLineOptions = Partial<{
18
18
  labelTextColor: string;
19
19
  showLabel: boolean;
20
20
  }>;
21
+ /**
22
+ * Palette ordered for maximum contrast; first color is the original teal.
23
+ * Greens/teals are spread out so that when only a subset of series is visible,
24
+ * similar colors are not repeated.
25
+ */
21
26
  export declare const DEFAULT_SERIES_COLORS: {
22
27
  line: string;
23
28
  top: string;
24
29
  bottom: string;
25
30
  }[];
31
+ export type SeriesColorPalette = (typeof DEFAULT_SERIES_COLORS)[number];
32
+ /**
33
+ * Returns a color palette for a series by index. Uses predefined palette for
34
+ * the first N series; generates distinct colors for additional series so they
35
+ * never repeat.
36
+ */
37
+ export declare function getSeriesColorPalette(index: number): SeriesColorPalette;
26
38
  export interface GraphProps {
27
39
  /** Series configuration - can be single or multiple series */
28
40
  series: Array<SeriesConfig>;
@@ -43,11 +55,18 @@ export interface GraphProps {
43
55
  * If 0, rounds to whole numbers. Default is 4.
44
56
  */
45
57
  currentValueDecimals?: number;
58
+ /**
59
+ * When true, all series use a single Y axis (shared scale).
60
+ * Use when series are comparable (e.g. "part" vs "whole") so vertical position
61
+ * reflects actual relative values. When false (default), each series has its
62
+ * own scale and fills the chart independently.
63
+ */
64
+ useSharedPriceScale?: boolean;
46
65
  }
47
66
  /**
48
67
  * Graph component that renders a chart using lightweight-charts library
49
68
  * with support for area series, custom tooltips, and vertical line annotations
50
69
  * Supports single or multiple series with different colors and legends
51
70
  */
52
- export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, currentValueDecimals, }: GraphProps): React.ReactElement;
71
+ export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, currentValueDecimals, useSharedPriceScale, }: GraphProps): React.ReactElement;
53
72
  export {};
@@ -10,7 +10,7 @@ export interface TabControlProps<T extends string> {
10
10
  variant?: "equal" | "auto";
11
11
  tabItemWrapPadding?: string;
12
12
  }
13
- export declare function TabControl<T extends string>({ tabs, state: controlState, variant, showBorder, tabItemWrapPadding, }: TabControlProps<T>): import("react/jsx-runtime").JSX.Element;
13
+ export declare function TabControl<T extends string>({ tabs, state: controlState, showBorder, tabItemWrapPadding, variant, }: TabControlProps<T>): import("react/jsx-runtime").JSX.Element;
14
14
  interface TabItemProps {
15
15
  icon?: React.ReactNode;
16
16
  label: React.ReactNode;
@@ -58,6 +58,11 @@ export interface TradingViewProps<T extends string = string> extends Omit<GraphV
58
58
  * If 0, rounds to whole numbers. Default is 8 (full precision).
59
59
  */
60
60
  currentValueDecimals?: number;
61
+ /**
62
+ * When true, all series use a single Y axis so vertical position reflects
63
+ * actual relative values (e.g. "part" vs "whole" like Ethereum vs All Networks).
64
+ */
65
+ useSharedPriceScale?: boolean;
61
66
  }
62
67
  /**
63
68
  * TradingView — comprehensive charting component with graph selection and time range controls.
@@ -114,4 +119,4 @@ export interface TradingViewProps<T extends string = string> extends Omit<GraphV
114
119
  * />
115
120
  * ```
116
121
  */
117
- export declare function TradingView<T extends string = string>({ data, yMeasureUnit, height, defaultGraph, onGraphSelected, graphs, isMultipleSelect, range, rangeList, setRange, onGraphExpanded, isGraphExpanded, onUnselectSeries, graphsWithNoData, loadingGraphs, noDataMessage, currentValueDecimals, containerClassName, ...restProps }: TradingViewProps<T>): React.ReactElement;
122
+ export declare function TradingView<T extends string = string>({ data, yMeasureUnit, height, defaultGraph, onGraphSelected, graphs, isMultipleSelect, range, rangeList, setRange, onGraphExpanded, isGraphExpanded, onUnselectSeries, graphsWithNoData, loadingGraphs, noDataMessage, currentValueDecimals, containerClassName, useSharedPriceScale, ...restProps }: TradingViewProps<T>): React.ReactElement;
@@ -27,3 +27,11 @@ export declare function generateColorsFromBase(color: string): {
27
27
  topColor: string;
28
28
  bottomColor: string;
29
29
  };
30
+ /**
31
+ * Converts HSL to hex color.
32
+ * @param h - Hue 0-360
33
+ * @param s - Saturation 0-100
34
+ * @param l - Lightness 0-100
35
+ * @returns Hex color string
36
+ */
37
+ export declare function hslToHex(h: number, s: number, l: number): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/permissionless-ui",
3
- "version": "1.23.0",
3
+ "version": "1.24.0",
4
4
  "description": "Internal UI components",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/index.js",