@gearbox-protocol/ui-kit 3.14.0-next.1 → 3.14.0-next.10
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.
- package/dist/cjs/components/buttons/button/button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/components/layout/main-aside-layout/main-aside-layout.cjs +1 -1
- package/dist/cjs/components/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/components/trading-view/trading-view.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/buttons/button/button.js +1 -0
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +11 -11
- package/dist/esm/components/graph/formatters.js +127 -132
- package/dist/esm/components/health-factor/health-factor.js +3 -3
- package/dist/esm/components/layout/main-aside-layout/main-aside-layout.js +76 -41
- package/dist/esm/components/smart-number-input/smart-number-input.js +253 -104
- package/dist/esm/components/trading-view/trading-view.js +58 -58
- package/dist/esm/locale/en.json.js +2 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/buttons/button/button.d.ts +4 -3
- package/dist/types/components/help-tip/help-tip.d.ts +2 -2
- package/dist/types/components/layout/main-aside-layout/main-aside-layout.d.ts +34 -0
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +52 -0
- package/dist/types/components/tip-card/tip-card.d.ts +1 -1
- package/dist/types/locale/en.json.d.ts +2 -0
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
4
|
variant?: "link" | "text" | "default" | "success" | "destructive" | "ghost" | "outline" | "secondary" | "white" | "neutral" | "pink" | "pink-outline" | "blue" | "blue-outline" | null | undefined;
|
|
5
|
-
size?: "default" | "icon" | "auto" | "xs" | "sm" | "lg" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "auto" | "xs" | "sm" | "lg" | "md" | null | undefined;
|
|
6
6
|
width?: "compact" | "wide" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
8
|
/**
|
|
@@ -43,8 +43,9 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
43
43
|
* Sizes (size):
|
|
44
44
|
* - `auto` — automatic height without padding.
|
|
45
45
|
* - `xs` — extra small (rounded-full, px-3, text-xs).
|
|
46
|
-
* - `sm` — small (h-
|
|
47
|
-
* - `
|
|
46
|
+
* - `sm` — small (h-7, px-3, text-xs).
|
|
47
|
+
* - `md` — medium (h-8, px-3.5, text-sm).
|
|
48
|
+
* - `default` — standard (h-10, px-4).
|
|
48
49
|
* - `lg` — large (h-10, px-8).
|
|
49
50
|
* - `icon` — square button for icons (h-9 w-9).
|
|
50
51
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const iconColorVariants: (props?: ({
|
|
4
|
-
iconColor?: "muted" | "foreground" | "gray-
|
|
5
|
-
iconHoverColor?: "muted" | "foreground" | "gray-
|
|
4
|
+
iconColor?: "muted" | "foreground" | "gray-50" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | null | undefined;
|
|
5
|
+
iconHoverColor?: "muted" | "foreground" | "gray-50" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
export interface HelpTipProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, "title"> {
|
|
8
8
|
/** Tooltip popup content (what appears when hovering the icon). */
|
|
@@ -28,6 +28,29 @@ export interface MainAsideLayoutProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
28
28
|
* - pass `asideClassName` to override or augment aside classes (e.g. z-index)
|
|
29
29
|
*/
|
|
30
30
|
variant?: "default" | "detail";
|
|
31
|
+
/**
|
|
32
|
+
* Hybrid centring for the main column. Only meaningful with
|
|
33
|
+
* `variant="detail"`.
|
|
34
|
+
*
|
|
35
|
+
* - **`lg` … `1799px`** — behaves like the standard detail row: the aside is
|
|
36
|
+
* in flow and the main column fills the remaining space (LP-style fill).
|
|
37
|
+
* - **`≥1800px`** — the wrapper becomes a viewport-centred, width-capped box
|
|
38
|
+
* (`mx-auto`), the aside is parked out of flow in the gutter next to the
|
|
39
|
+
* main column (`absolute right-full` / `left-full`), and the main column is
|
|
40
|
+
* optically centred on the viewport. It still scales up to `80rem`.
|
|
41
|
+
*
|
|
42
|
+
* This avoids the very narrow centred column on mid-size desktops while still
|
|
43
|
+
* centring the content on wide screens.
|
|
44
|
+
*
|
|
45
|
+
* Assumes the layout is rendered inside the app shell padding
|
|
46
|
+
* (`px-4 sm:px-6 lg:px-8`) — the `≥1800px` gutter reserves `460px` aside +
|
|
47
|
+
* `1.5rem` gap + the `lg:px-8` (`2rem`) shell padding on each side.
|
|
48
|
+
*
|
|
49
|
+
* On screens below `lg` the layout falls back to the normal stacked column,
|
|
50
|
+
* so wrap usage in `hidden lg:block` if the mobile layout is handled
|
|
51
|
+
* separately.
|
|
52
|
+
*/
|
|
53
|
+
centeredMain?: boolean;
|
|
31
54
|
}
|
|
32
55
|
/**
|
|
33
56
|
* MainAsideLayout — main column + optional sidebar in one row.
|
|
@@ -54,5 +77,16 @@ export interface MainAsideLayoutProps extends React.HTMLAttributes<HTMLDivElemen
|
|
|
54
77
|
* ```
|
|
55
78
|
* This reproduces the `PoolDetailsScreen` two-column layout:
|
|
56
79
|
* sticky aside below 2450 px viewport, fixed aside above it, correct max-widths.
|
|
80
|
+
*
|
|
81
|
+
* ### Detail variant — viewport-centred main (`centeredMain`)
|
|
82
|
+
* ```tsx
|
|
83
|
+
* <div className="hidden lg:block">
|
|
84
|
+
* <MainAsideLayout variant="detail" asidePosition="left" centeredMain aside={<Panel />}>
|
|
85
|
+
* <Content />
|
|
86
|
+
* </MainAsideLayout>
|
|
87
|
+
* </div>
|
|
88
|
+
* ```
|
|
89
|
+
* Centres the main column on the viewport at all desktop widths while the aside
|
|
90
|
+
* sits in the gutter; the main column still scales up to `80rem`.
|
|
57
91
|
*/
|
|
58
92
|
export declare const MainAsideLayout: React.ForwardRefExoticComponent<MainAsideLayoutProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { NetworkType } from '@gearbox-protocol/sdk';
|
|
2
2
|
import { TokenFullData } from '../../types/common';
|
|
3
3
|
import * as React from "react";
|
|
4
|
+
export interface TokenOption {
|
|
5
|
+
/** Display label for this option. */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Optional icon to display before the label. */
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Called when this option is selected (single-select) or toggled (multi-select).
|
|
11
|
+
* In multi-select mode the dropdown stays open; the parent manages checked state.
|
|
12
|
+
*/
|
|
13
|
+
onSelect: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* When true, the option is shown with a checkmark.
|
|
16
|
+
* Used only in multi-select mode (`multiSelectMode` prop on SmartNumberInput).
|
|
17
|
+
*/
|
|
18
|
+
checked?: boolean;
|
|
19
|
+
}
|
|
4
20
|
/** A-matching SmartNumberInput size for layout (styles.tsx). */
|
|
5
21
|
export type SmartNumberInputSize = "sm" | "md";
|
|
6
22
|
export interface SmartNumberInputProps {
|
|
@@ -28,6 +44,18 @@ export interface SmartNumberInputProps {
|
|
|
28
44
|
size?: SmartNumberInputSize;
|
|
29
45
|
/** When true, currency dropdown is open (expand icon rotated). */
|
|
30
46
|
active?: boolean;
|
|
47
|
+
/** Override max character length for token symbol display. When omitted, computed from viewport width. */
|
|
48
|
+
symbolMaxLength?: number;
|
|
49
|
+
/** Inline token options for dropdown selection (alternative to onShowSelectDialog). */
|
|
50
|
+
tokenOptions?: TokenOption[];
|
|
51
|
+
/**
|
|
52
|
+
* When true, the tokenOptions dropdown works as a multi-select:
|
|
53
|
+
* - The dropdown stays open after each click (doesn't auto-close).
|
|
54
|
+
* - Options marked `checked: true` show a checkmark.
|
|
55
|
+
* - The dropdown stays open until the user closes it (e.g. click outside).
|
|
56
|
+
* The parent is responsible for maintaining `checked` state on each option.
|
|
57
|
+
*/
|
|
58
|
+
multiSelectMode?: boolean;
|
|
31
59
|
/** Callback when amount changes. Called with (value: bigint, valueView: string). */
|
|
32
60
|
onSetAmount?: (value: bigint, valueView: string) => void;
|
|
33
61
|
/** Callback to show token select dialog. */
|
|
@@ -38,6 +66,30 @@ export interface SmartNumberInputProps {
|
|
|
38
66
|
onFocus?: () => void;
|
|
39
67
|
/** Blur callback. */
|
|
40
68
|
onBlur?: () => void;
|
|
69
|
+
/**
|
|
70
|
+
* USD price per one whole token unit (e.g. 1800.5 for ETH at $1 800.50).
|
|
71
|
+
* When provided, the USD equivalent of the current amount is displayed below the input.
|
|
72
|
+
*/
|
|
73
|
+
usdPrice?: number;
|
|
74
|
+
/**
|
|
75
|
+
* When provided, renders a Health Factor slider in the balance row
|
|
76
|
+
* (replacing the max amount / "Can borrow" indicator).
|
|
77
|
+
* Intended for debt inputs where the user wants to target a specific HF.
|
|
78
|
+
*/
|
|
79
|
+
hfSlider?: HFSliderConfig;
|
|
80
|
+
}
|
|
81
|
+
/** Configuration for the inline Health Factor slider. */
|
|
82
|
+
export interface HFSliderConfig {
|
|
83
|
+
/** Current target HF as a float (e.g. 1.5 for 150%). */
|
|
84
|
+
value: number;
|
|
85
|
+
/** Minimum HF value. @default 1.0 */
|
|
86
|
+
min?: number;
|
|
87
|
+
/** Maximum HF value. @default 3.0 */
|
|
88
|
+
max?: number;
|
|
89
|
+
/** Slider step. @default 0.01 */
|
|
90
|
+
step?: number;
|
|
91
|
+
/** Called when the slider value changes. */
|
|
92
|
+
onChange: (value: number) => void;
|
|
41
93
|
}
|
|
42
94
|
/**
|
|
43
95
|
* SmartNumberInput — token amount input with balance display (matches interface).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const tipCardVariants: (props?: ({
|
|
4
|
-
backgroundColor?: "dark" | "transparent" | "light" | "gray-
|
|
4
|
+
backgroundColor?: "dark" | "transparent" | "light" | "gray-50" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | null | undefined;
|
|
5
5
|
textColor?: "unset" | "dark" | "light" | null | undefined;
|
|
6
6
|
borderColor?: "none" | "dark" | "light" | "gradient" | null | undefined;
|
|
7
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
@@ -25,8 +25,10 @@ declare const _default: {
|
|
|
25
25
|
"components.loading.wait": "Please wait...",
|
|
26
26
|
|
|
27
27
|
"components.smartNumberInput.balance": "Balance",
|
|
28
|
+
"components.smartNumberInput.amountLabel": "Amount",
|
|
28
29
|
"components.smartNumberInput.inputTitle": "Token Amount",
|
|
29
30
|
"components.smartNumberInput.confirm.input": "Input",
|
|
31
|
+
"components.smartNumberInput.selectToken": "Select token",
|
|
30
32
|
|
|
31
33
|
"components.tipWindow.title": "Tip",
|
|
32
34
|
|