@gearbox-protocol/permissionless-ui 1.22.0-next.34 → 1.22.0-next.35
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/block-sync/block-sync.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
- package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
- package/dist/cjs/components/complex-input/index.cjs +1 -1
- package/dist/cjs/components/formatted-number/formatted-number.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/input/input.cjs +1 -1
- package/dist/cjs/components/input/use-icon-slot-widths.cjs +1 -0
- package/dist/cjs/components/short-string/short-string.cjs +1 -1
- package/dist/cjs/components/status-elements/index.cjs +1 -0
- package/dist/cjs/components/status-elements/status-elements.cjs +1 -0
- package/dist/cjs/components/tip-card/tip-card.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/components/token-template/token-template.cjs +1 -1
- package/dist/cjs/components/tooltip/simple-tooltip.cjs +1 -1
- package/dist/cjs/components/with-title/with-title.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/esm/components/block-sync/block-sync.js +34 -36
- package/dist/esm/components/checkbox/checkbox-labeled.js +2 -1
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +2 -1
- package/dist/esm/components/complex-input/complex-input.js +211 -55
- package/dist/esm/components/complex-input/index.js +3 -2
- package/dist/esm/components/formatted-number/formatted-number.js +41 -8
- package/dist/esm/components/index.js +456 -452
- package/dist/esm/components/input/input.js +28 -22
- package/dist/esm/components/input/use-icon-slot-widths.js +41 -0
- package/dist/esm/components/short-string/short-string.js +10 -14
- package/dist/esm/components/status-elements/index.js +5 -0
- package/dist/esm/components/status-elements/status-elements.js +48 -0
- package/dist/esm/components/tip-card/tip-card.js +5 -5
- package/dist/esm/components/token-symbol/token-symbol.js +34 -38
- package/dist/esm/components/token-template/token-template.js +24 -16
- package/dist/esm/components/tooltip/simple-tooltip.js +12 -11
- package/dist/esm/components/with-title/with-title.js +27 -14
- package/dist/esm/index.js +595 -591
- package/dist/globals.css +1 -1
- package/dist/types/components/complex-input/complex-input.d.ts +10 -14
- package/dist/types/components/formatted-number/formatted-number.d.ts +14 -4
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/input/use-icon-slot-widths.d.ts +12 -0
- package/dist/types/components/status-elements/index.d.ts +1 -0
- package/dist/types/components/status-elements/status-elements.d.ts +16 -0
- package/dist/types/components/text-button/text-button.d.ts +1 -1
- package/dist/types/components/token-template/token-template.d.ts +7 -28
- package/dist/types/components/with-title/with-title.d.ts +6 -6
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/styles/base.css +1 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { TokenData } from '@gearbox-protocol/sdk';
|
|
2
|
+
import { InputProps } from '../input';
|
|
2
3
|
import { WithTitleProps } from '../with-title';
|
|
3
4
|
import type * as React from "react";
|
|
5
|
+
export type BalanceIndicatorSize = "sm" | "md";
|
|
4
6
|
export interface BalanceIndicatorProps {
|
|
5
7
|
/**
|
|
6
|
-
*
|
|
8
|
+
* Label before balance (e.g. "Balance")
|
|
7
9
|
*/
|
|
8
10
|
title?: React.ReactNode;
|
|
9
11
|
/**
|
|
@@ -15,39 +17,33 @@ export interface BalanceIndicatorProps {
|
|
|
15
17
|
*/
|
|
16
18
|
token: TokenData | undefined;
|
|
17
19
|
/**
|
|
18
|
-
* Size variant
|
|
20
|
+
* Size variant (matches interface SmartNumberInputSize)
|
|
19
21
|
*/
|
|
20
|
-
size?:
|
|
22
|
+
size?: BalanceIndicatorSize;
|
|
21
23
|
/**
|
|
22
24
|
* Whether the indicator is disabled
|
|
23
25
|
*/
|
|
24
26
|
disabled?: boolean;
|
|
25
27
|
/**
|
|
26
|
-
* Whether to show max button
|
|
28
|
+
* Whether to show max button / clickable amount
|
|
27
29
|
*/
|
|
28
30
|
maxButton?: boolean;
|
|
29
31
|
/**
|
|
30
|
-
* Callback when max
|
|
32
|
+
* Callback when max is clicked
|
|
31
33
|
*/
|
|
32
34
|
onMaxButtonClick?: () => void;
|
|
33
35
|
}
|
|
36
|
+
export declare function BalanceIndicator({ title, maxAmount, token, disabled, maxButton, onMaxButtonClick, size, }: BalanceIndicatorProps): import("react/jsx-runtime").JSX.Element;
|
|
34
37
|
export interface ComplexInputProps {
|
|
35
38
|
/**
|
|
36
39
|
* Props for title wrapper
|
|
37
40
|
*/
|
|
38
41
|
titleProps: WithTitleProps;
|
|
39
42
|
/**
|
|
40
|
-
* Props for input element
|
|
43
|
+
* Props for input element (matches interface: InputProps with onChange overridden)
|
|
41
44
|
*/
|
|
42
|
-
inputProps: Omit<
|
|
43
|
-
/**
|
|
44
|
-
* Callback when value changes (receives bigint and string view)
|
|
45
|
-
*/
|
|
45
|
+
inputProps: Omit<InputProps, "onChange" | "endingIcon"> & {
|
|
46
46
|
onChange?: (value: bigint, valueView: string) => void;
|
|
47
|
-
/**
|
|
48
|
-
* Input size variant
|
|
49
|
-
*/
|
|
50
|
-
inputSize?: "sm" | "lg" | "default";
|
|
51
47
|
};
|
|
52
48
|
/**
|
|
53
49
|
* Props for balance indicator
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { ParseSmallNumberResult } from '../../utils';
|
|
1
2
|
import type * as React from "react";
|
|
2
3
|
export interface FormattedNumberStringProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Maximum length for decimal part in tooltip (trimmed)
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
decimalPartLength?: number;
|
|
8
|
+
/**
|
|
9
|
+
* When repeat (leading zeros in decimal) exceeds this, show "0" + repeat count
|
|
10
|
+
*/
|
|
11
|
+
hideZerosIfMore?: number;
|
|
12
|
+
/**
|
|
13
|
+
* The value to display (string, or parsed small number result)
|
|
14
|
+
*/
|
|
15
|
+
value: string | ParseSmallNumberResult | undefined;
|
|
7
16
|
}
|
|
8
17
|
/**
|
|
9
|
-
* FormattedNumberString — displays a number with
|
|
18
|
+
* FormattedNumberString — displays a number with optional compact decimal (zeros as repeat count) and tooltip with full value.
|
|
19
|
+
* Matches interface FormattedNumber structure and styles.
|
|
10
20
|
*/
|
|
11
|
-
export declare function FormattedNumberString({ value, className, ...props }: FormattedNumberStringProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function FormattedNumberString({ value, decimalPartLength, hideZerosIfMore, className, ...props }: FormattedNumberStringProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -98,6 +98,7 @@ export * from './spinner';
|
|
|
98
98
|
export * from './split-list';
|
|
99
99
|
export * from './stat-badge';
|
|
100
100
|
export * from './status-dot';
|
|
101
|
+
export * from './status-elements';
|
|
101
102
|
export * from './status-triangle';
|
|
102
103
|
export * from './stepper';
|
|
103
104
|
export * from './styled-dropdown';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Returns callback refs and measured widths for two icon slot elements.
|
|
4
|
+
* Use the widths (with fallback) to set input padding so it matches the icon button width.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useIconSlotWidths(): {
|
|
7
|
+
startSlotWidth: number | null;
|
|
8
|
+
endSlotWidth: number | null;
|
|
9
|
+
setStartRef: (el: HTMLButtonElement | null) => void;
|
|
10
|
+
setEndRef: (el: HTMLButtonElement | null) => void;
|
|
11
|
+
inputPaddingStyle: (hasStart: boolean, hasEnd: boolean) => React.CSSProperties;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './status-elements';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { HFZones } from '..';
|
|
2
|
+
export interface AccountHealthDotProps {
|
|
3
|
+
zone: HFZones;
|
|
4
|
+
size?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* HealthDot — colored dot indicating health factor zone.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HealthDot({ zone, size }: AccountHealthDotProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export interface StatusBarsProps {
|
|
11
|
+
zone: HFZones;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* StatusBars — row of bars indicating health factor zone (1–3 filled).
|
|
15
|
+
*/
|
|
16
|
+
export declare function StatusBars({ zone }: StatusBarsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const textColorVariants: (props?: ({
|
|
4
|
-
buttonColor?: "
|
|
4
|
+
buttonColor?: "primaryDashed" | "secondaryDashed" | "empty" | null | undefined;
|
|
5
5
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
6
|
declare const layoutVariants: (props?: ({
|
|
7
7
|
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
@@ -1,40 +1,19 @@
|
|
|
1
1
|
import { TokenData } from '@gearbox-protocol/sdk';
|
|
2
|
+
import { ParseSmallNumberResult } from '../../utils';
|
|
2
3
|
import { negativeTokenTemplate, tokenTemplateString } from '../../utils/templates';
|
|
4
|
+
import { FormattedNumberStringProps } from '../formatted-number';
|
|
3
5
|
import type * as React from "react";
|
|
4
6
|
type PartialTokenData = Pick<TokenData, "title" | "decimals"> & {
|
|
5
7
|
symbol?: string;
|
|
6
8
|
};
|
|
7
|
-
export interface TokenTemplateProps {
|
|
8
|
-
/**
|
|
9
|
-
* Token amount in base units (bigint, string, number, or undefined)
|
|
10
|
-
*/
|
|
9
|
+
export interface TokenTemplateProps extends Omit<FormattedNumberStringProps, "value"> {
|
|
11
10
|
value: bigint | string | number | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Token data with title/symbol and decimals
|
|
14
|
-
*/
|
|
15
11
|
token: PartialTokenData | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* Number of decimal places to display
|
|
18
|
-
*/
|
|
19
12
|
precision?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Symbol to use between amount and token name
|
|
22
|
-
* @default " "
|
|
23
|
-
*/
|
|
24
|
-
spaceSymbol?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Maximum length of the result string (truncates if exceeded)
|
|
27
|
-
*/
|
|
28
13
|
maxLength?: number;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*/
|
|
33
|
-
allowNegative?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Additional className for styling
|
|
36
|
-
*/
|
|
37
|
-
className?: string;
|
|
14
|
+
formatter?: (amount: bigint | string | number | undefined, decimals: number, precision?: number) => string | ParseSmallNumberResult;
|
|
15
|
+
noFormattedAmountValue?: React.ReactNode;
|
|
16
|
+
showSymbol?: boolean;
|
|
38
17
|
}
|
|
39
18
|
/**
|
|
40
19
|
* TokenTemplate — component for displaying token amounts with symbol.
|
|
@@ -72,5 +51,5 @@ export interface TokenTemplateProps {
|
|
|
72
51
|
* // Output: "-1.5 ETH"
|
|
73
52
|
* ```
|
|
74
53
|
*/
|
|
75
|
-
export declare function TokenTemplate({ value, token, precision,
|
|
54
|
+
export declare function TokenTemplate({ value, token, precision, formatter, noFormattedAmountValue, showSymbol, maxLength, ...rest }: TokenTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
76
55
|
export { tokenTemplateString, negativeTokenTemplate };
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
2
|
import type * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare const withTitleVariants: (props?: ({
|
|
4
|
+
size?: "default" | "sm" | "lg" | "md" | null | undefined;
|
|
5
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
6
|
+
export interface WithTitleProps extends VariantProps<typeof withTitleVariants> {
|
|
4
7
|
/**
|
|
5
8
|
* Title text or element
|
|
6
9
|
*/
|
|
7
10
|
title: string | React.ReactNode;
|
|
8
|
-
/**
|
|
9
|
-
* Size variant
|
|
10
|
-
*/
|
|
11
|
-
size?: Sizes;
|
|
12
11
|
/**
|
|
13
12
|
* Children content
|
|
14
13
|
*/
|
|
@@ -29,3 +28,4 @@ export interface WithTitleProps {
|
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
30
|
export declare function WithTitle({ title, children, size, className, }: WithTitleProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export * from './components/spinner';
|
|
|
95
95
|
export * from './components/split-list';
|
|
96
96
|
export * from './components/stat-badge';
|
|
97
97
|
export * from './components/status-dot';
|
|
98
|
+
export * from './components/status-elements';
|
|
98
99
|
export * from './components/status-triangle';
|
|
99
100
|
export * from './components/stepper';
|
|
100
101
|
export * from './components/styled-dropdown';
|
package/package.json
CHANGED
package/src/styles/base.css
CHANGED
|
@@ -110,7 +110,7 @@ html.dark {
|
|
|
110
110
|
--success-hover: 136.58 100% 85.1%;
|
|
111
111
|
--destructive-foreground: 0 0% 100%;
|
|
112
112
|
--warning: 43.12 100% 68.63%;
|
|
113
|
-
--liquidation:
|
|
113
|
+
--liquidation: 277.22 74.53% 58.43%;
|
|
114
114
|
--input: 225 6% 19%;
|
|
115
115
|
--ring: 330 100% 59%;
|
|
116
116
|
--gray-10: 225 5.26% 14.9%;
|