@gearbox-protocol/ui-kit 3.12.1 → 3.13.0-next.1

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,9 +1,9 @@
1
1
  import { Address } from 'viem';
2
- import { RewardsTooltipCellInfo, RewardsTooltipTheme, RewardsTooltipTokenMeta } from '../../types/rewards-tooltip';
2
+ import { RewardsTooltipApyListByNetwork, RewardsTooltipCellInfo, RewardsTooltipTheme, RewardsTooltipTokenMeta } from '../../types/rewards-tooltip';
3
3
  export interface RewardsTooltipContentProps {
4
4
  cellInfo: RewardsTooltipCellInfo;
5
5
  targetToken: Address;
6
- apyList: Partial<Record<Address, number>> | undefined;
6
+ apyListByNetwork: RewardsTooltipApyListByNetwork | undefined;
7
7
  tokensList: Partial<Record<Address, RewardsTooltipTokenMeta>> | undefined;
8
8
  strategyCreditManagers: Partial<Record<Address, {
9
9
  readonly underlyingToken: Address;
@@ -11,4 +11,4 @@ export interface RewardsTooltipContentProps {
11
11
  theme?: RewardsTooltipTheme;
12
12
  onClose?: () => void;
13
13
  }
14
- export declare function RewardsTooltipContent({ cellInfo, targetToken, apyList: baseAPYList, tokensList, strategyCreditManagers, onClose, theme, }: RewardsTooltipContentProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function RewardsTooltipContent({ cellInfo, targetToken, apyListByNetwork, tokensList, strategyCreditManagers, onClose, theme, }: RewardsTooltipContentProps): import("react/jsx-runtime").JSX.Element;
@@ -38,7 +38,6 @@ export interface RewardsTooltipCellInfo {
38
38
  readonly isPointsWithAPY: boolean;
39
39
  readonly hasAPY?: boolean;
40
40
  readonly maxLeverage: bigint;
41
- readonly apyListByNetwork: RewardsTooltipApyListByNetwork;
42
41
  readonly quotaRate: bigint;
43
42
  /**
44
43
  * Present on some call sites that reuse hook-shaped objects; the tooltip body
@@ -1,6 +1,6 @@
1
1
  import { Address } from 'viem';
2
2
  import { TokenMetaInfo } from '../../../../types/common';
3
- import { RewardsTooltipCellInfo } from './rewards-tooltip';
3
+ import { RewardsTooltipApyListByNetwork, RewardsTooltipCellInfo } from './rewards-tooltip';
4
4
  import type * as React from "react";
5
5
  export type StrategiesTableSortFields = "strategyName" | "apy";
6
6
  type StrategiesTableSortDirection = "desc" | "asc";
@@ -30,7 +30,7 @@ export interface StrategyTableRowDTO<S extends StrategyDTO = StrategyDTO, T exte
30
30
  readonly href?: string;
31
31
  readonly maxLeverage: bigint;
32
32
  readonly tokensList: Partial<Record<Address, T>> | undefined;
33
- readonly apyList: Partial<Record<Address, number>> | undefined;
33
+ readonly apyListByNetwork: RewardsTooltipApyListByNetwork | undefined;
34
34
  readonly strategyCreditManagers: Partial<Record<Address, StrategyTableCreditManager>>;
35
35
  readonly disabled?: boolean;
36
36
  readonly disabledStyle?: boolean;
@@ -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>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/ui-kit",
3
- "version": "3.12.1",
3
+ "version": "3.13.0-next.1",
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