@gearbox-protocol/ui-kit 3.14.0-next.4 → 3.14.0-next.5
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/smart-number-input/smart-number-input.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/smart-number-input/smart-number-input.js +187 -130
- package/dist/esm/locale/en.json.js +2 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/smart-number-input/smart-number-input.d.ts +22 -1
- package/dist/types/locale/en.json.d.ts +2 -0
- package/package.json +1 -1
|
@@ -6,8 +6,16 @@ export interface TokenOption {
|
|
|
6
6
|
label: string;
|
|
7
7
|
/** Optional icon to display before the label. */
|
|
8
8
|
icon?: React.ReactNode;
|
|
9
|
-
/**
|
|
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
|
+
*/
|
|
10
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;
|
|
11
19
|
}
|
|
12
20
|
/** A-matching SmartNumberInput size for layout (styles.tsx). */
|
|
13
21
|
export type SmartNumberInputSize = "sm" | "md";
|
|
@@ -40,6 +48,14 @@ export interface SmartNumberInputProps {
|
|
|
40
48
|
symbolMaxLength?: number;
|
|
41
49
|
/** Inline token options for dropdown selection (alternative to onShowSelectDialog). */
|
|
42
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;
|
|
43
59
|
/** Callback when amount changes. Called with (value: bigint, valueView: string). */
|
|
44
60
|
onSetAmount?: (value: bigint, valueView: string) => void;
|
|
45
61
|
/** Callback to show token select dialog. */
|
|
@@ -50,6 +66,11 @@ export interface SmartNumberInputProps {
|
|
|
50
66
|
onFocus?: () => void;
|
|
51
67
|
/** Blur callback. */
|
|
52
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;
|
|
53
74
|
}
|
|
54
75
|
/**
|
|
55
76
|
* SmartNumberInput — token amount input with balance display (matches interface).
|
|
@@ -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
|
|