@gearbox-protocol/ui-kit 3.13.1 → 3.14.0-next.2

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.
@@ -108,10 +108,17 @@ export interface GraphProps {
108
108
  * between series with different data coverage.
109
109
  */
110
110
  visibleTimeFrom?: number;
111
+ /**
112
+ * When true, all user-initiated zoom and pan interactions are disabled.
113
+ * The visible time range can only be changed programmatically — e.g. via
114
+ * range buttons. Specifically disables: mouse-wheel zoom, pinch zoom,
115
+ * axis drag-to-scale, axis double-click reset, and scroll/drag panning.
116
+ */
117
+ disableZoom?: boolean;
111
118
  }
112
119
  /**
113
120
  * Graph component that renders a chart using lightweight-charts library
114
121
  * with support for area series, custom tooltips, and vertical line annotations
115
122
  * Supports single or multiple series with different colors and legends
116
123
  */
117
- export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, currentValueDecimals, useSharedPriceScale, showCurrentValue, graphTitle, yScaleMin, yScaleMinMultiple, visibleTimeFrom, }: GraphProps): React.ReactElement;
124
+ export declare function Graph({ series, className, showLegend, onUnselectSeries, xMeasureUnit, yMeasureUnit, optionsOverrides, verticalLineOptions, currentValueDecimals, useSharedPriceScale, showCurrentValue, graphTitle, yScaleMin, yScaleMinMultiple, visibleTimeFrom, disableZoom, }: GraphProps): React.ReactElement;
@@ -4,14 +4,55 @@ export interface MainAsideLayoutProps extends React.HTMLAttributes<HTMLDivElemen
4
4
  /** Sidebar; rendered to the left or right of the main column (`asidePosition`). */
5
5
  aside?: React.ReactNode;
6
6
  asidePosition?: "left" | "right";
7
- /** Classes for the outer `<aside>` (width, sticky, responsive visibility, etc.). */
7
+ /** Classes for the outer `<aside>` element. */
8
8
  asideClassName?: string;
9
+ /** Classes for the inner main column `<div>`. */
10
+ mainClassName?: string;
11
+ /**
12
+ * Ref forwarded to the main column `<div>`.
13
+ * Use for ResizeObserver-based width tracking (e.g. chart resize key).
14
+ */
15
+ mainRef?: React.RefObject<HTMLDivElement | null>;
16
+ /**
17
+ * Layout variant.
18
+ *
19
+ * - `"default"` (default) — simple flex row, aside width controlled via `asideClassName`.
20
+ *
21
+ * - `"detail"` — detail page layout (pool / strategy / position detail screens):
22
+ * - aside is `420px` at `lg`, `460px` at `xl`
23
+ * - aside is **sticky** (`top-4`) from `lg` up to `2449px`
24
+ * - aside becomes **fixed** (`top-28 right-32`) at `≥2450px`
25
+ * - outer wrapper caps at `calc(80rem + 420px + 1.5rem)` / `calc(80rem + 460px + 1.5rem)`
26
+ * - at `≥2450px` the wrapper switches to `display:block` and the main column
27
+ * centres itself via `mx-auto` with `max-w-[min(80rem,calc(100vw-460px-8rem))]`
28
+ * - pass `asideClassName` to override or augment aside classes (e.g. z-index)
29
+ */
30
+ variant?: "default" | "detail";
9
31
  }
10
32
  /**
11
- * Main column + optional sidebar in one row. Intended for use **inside** the app shell `Container`:
12
- * main uses the remaining width (`flex-1 min-w-0`), aside keeps a fixed width.
33
+ * MainAsideLayout — main column + optional sidebar in one row.
13
34
  *
14
- * On small screens the stack uses `column-reverse` so the sidebar stays above the main column when
15
- * `asidePosition` is `"right"` (common for pool pages).
35
+ * Intended for use **inside** the app shell `Container` (or inside `px-4 sm:px-6 lg:px-8` padding):
36
+ * - main column uses the remaining width (`flex-1 min-w-0`)
37
+ * - aside keeps a fixed width supplied via `asideClassName`
38
+ *
39
+ * On small screens the stack uses `column-reverse` so the sidebar appears above the
40
+ * main column when `asidePosition` is `"right"` (standard for detail pages).
41
+ *
42
+ * ### Default variant
43
+ * ```tsx
44
+ * <MainAsideLayout aside={<Panel />} asideClassName="lg:w-[320px]">
45
+ * <Content />
46
+ * </MainAsideLayout>
47
+ * ```
48
+ *
49
+ * ### Detail variant — sticky → fixed aside for pool / strategy / position pages
50
+ * ```tsx
51
+ * <MainAsideLayout variant="detail" mainRef={graphRootRef} aside={<Panel />}>
52
+ * <Content />
53
+ * </MainAsideLayout>
54
+ * ```
55
+ * This reproduces the `PoolDetailsScreen` two-column layout:
56
+ * sticky aside below 2450 px viewport, fixed aside above it, correct max-widths.
16
57
  */
17
58
  export declare const MainAsideLayout: React.ForwardRefExoticComponent<MainAsideLayoutProps & React.RefAttributes<HTMLDivElement>>;
@@ -94,6 +94,13 @@ export interface TradingViewProps<T extends string = string> extends Omit<GraphV
94
94
  * so colors stay stable across reloads (same label keeps the same color).
95
95
  */
96
96
  seriesColorPersistenceKey?: string;
97
+ /**
98
+ * When true, all user-initiated zoom and pan interactions are disabled.
99
+ * The time range can only be changed via the range buttons.
100
+ * Disables: mouse-wheel zoom, pinch zoom, axis drag, axis double-click reset,
101
+ * and scroll/drag panning.
102
+ */
103
+ disableZoom?: boolean;
97
104
  }
98
105
  /**
99
106
  * TradingView — comprehensive charting component with graph selection and time range controls.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.13.1",
3
+ "version": "3.14.0-next.2",
4
4
  "description": "Internal UI components",
5
5
  "repository": "https://github.com/gearbox-protocol/ui-kit",
6
6
  "license": "MIT",
@@ -71,8 +71,8 @@
71
71
  "check": "biome check --write",
72
72
  "check:ci": "biome check --diagnostic-level=error",
73
73
  "typecheck:ci": "tsc --noEmit",
74
- "test": "pnpm exec vitest run",
75
- "test:watch": "pnpm exec vitest",
74
+ "test": "vitest run",
75
+ "test:watch": "vitest",
76
76
  "storybook": "storybook dev -p 6006",
77
77
  "build-storybook": "storybook build"
78
78
  },
@@ -2,7 +2,6 @@
2
2
  * Base styles for @gearbox-protocol/ui-kit
3
3
  *
4
4
  * This file contains:
5
- * - Google Fonts import (Rubik)
6
5
  * - CSS variables for light/dark themes (:root, .dark)
7
6
  * - Base body styles with fallbacks
8
7
  * - Scrollbar styles (custom + navbar)
@@ -10,6 +9,10 @@
10
9
  * - React-Slick carousel overrides
11
10
  * - Liquidation graph styles
12
11
  *
12
+ * Rubik: load from the host app (e.g. `<link>` to Google Fonts in `index.html`).
13
+ * Do not use `@import url(...fonts...)` here — when this file is bundled after
14
+ * Tailwind layers, that breaks CSS `@import` ordering for minifiers.
15
+ *
13
16
  * Does NOT contain:
14
17
  * - @import "tailwindcss" (import separately)
15
18
  * - @theme block (use theme.css for Tailwind v4 utilities)
@@ -19,7 +22,6 @@
19
22
  * - For full setup: import globals.css (includes everything)
20
23
  * - For modular setup: import base.css + theme.css + tailwindcss separately
21
24
  */
22
- @import url("https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500;600;700&display=swap");
23
25
 
24
26
  /*
25
27
  * Critical fallback styles for browsers without CSS variable support