@gearbox-protocol/ui-kit 3.12.2 → 3.13.0
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/compound-apy/compound-apy.cjs +1 -1
- package/dist/cjs/components/rounded-image/rounded-image.cjs +1 -1
- package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
- package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
- package/dist/cjs/types/common.cjs +1 -1
- package/dist/esm/components/compound-apy/compound-apy.js +71 -68
- package/dist/esm/components/rounded-image/rounded-image.js +16 -16
- package/dist/esm/components/token-icon/token-icon.js +134 -44
- package/dist/esm/components/token-symbol/token-symbol.js +55 -46
- package/dist/esm/types/common.js +6 -1
- package/dist/globals.css +1 -1
- package/dist/types/components/compound-apy/compound-apy.d.ts +1 -3
- package/dist/types/components/help-tip/help-tip.d.ts +2 -2
- package/dist/types/components/token-icon/index.d.ts +1 -1
- package/dist/types/components/token-icon/token-icon.d.ts +8 -3
- package/dist/types/types/common.d.ts +11 -1
- package/package.json +2 -2
|
@@ -5,9 +5,7 @@ import { TokenMetaInfo } from '../../types/common';
|
|
|
5
5
|
* For GEAR token, use the logo symbol instead of the standard token icon.
|
|
6
6
|
* The standard gear.svg has a white background circle that looks bad on dark themes.
|
|
7
7
|
*/
|
|
8
|
-
export declare function getRewardTokenSymbol(token: TokenMetaInfo | undefined, rewardTokenSymbol: string | undefined): (
|
|
9
|
-
icon: string;
|
|
10
|
-
}) | undefined;
|
|
8
|
+
export declare function getRewardTokenSymbol(token: TokenMetaInfo | undefined, rewardTokenSymbol: string | undefined): import('../token-icon').SymbolOrIcon | undefined;
|
|
11
9
|
export interface PoolBaseAPY {
|
|
12
10
|
type: "supplyAPY" | "tokenYield";
|
|
13
11
|
apy: number;
|
|
@@ -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" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" |
|
|
5
|
-
iconHoverColor?: "muted" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" |
|
|
4
|
+
iconColor?: "muted" | "foreground" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "gray-60" | "gray-70" | "gray-80" | "gray-90" | "gray-100" | "gray-110" | null | undefined;
|
|
5
|
+
iconHoverColor?: "muted" | "foreground" | "gray-10" | "gray-20" | "gray-30" | "gray-40" | "gray-50" | "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). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { preloadTokenIcons, TokenIcon, type TokenIconProps, } from './token-icon';
|
|
1
|
+
export { preloadTokenIcons, type SymbolOrIcon, TokenIcon, type TokenIconProps, } from './token-icon';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconComposite } from '@gearbox-protocol/sdk/common-utils';
|
|
1
2
|
import { default as React } from 'react';
|
|
2
3
|
import { RoundedImageProps } from '../rounded-image/rounded-image';
|
|
3
4
|
/**
|
|
@@ -8,7 +9,7 @@ import { RoundedImageProps } from '../rounded-image/rounded-image';
|
|
|
8
9
|
* token symbols, asset icons, currency icons, token representations.
|
|
9
10
|
*
|
|
10
11
|
* Props:
|
|
11
|
-
* - `symbol` — token symbol/ticker (
|
|
12
|
+
* - `symbol` — token symbol/ticker, direct icon URL, or `IconComposite` (see `TokenMetaInfo` in `@/types/common`).
|
|
12
13
|
* - `size` — icon size in pixels (defaults to 48).
|
|
13
14
|
*
|
|
14
15
|
* Note: Fetches icon from Gearbox static CDN based on symbol.
|
|
@@ -16,19 +17,23 @@ import { RoundedImageProps } from '../rounded-image/rounded-image';
|
|
|
16
17
|
* Symbol is normalized (removes "/", spaces, "-f", converts "-" to "_", lowercased).
|
|
17
18
|
* Icon displays in its original shape (not clipped).
|
|
18
19
|
*
|
|
20
|
+
* **Ref behavior:** In the default single-image mode, `ref` is attached to the underlying `<img>`.
|
|
21
|
+
* In composite mode, `ref` is attached to the outer wrapper `div` (see `TokenIconProps` / `forwardRef` generic).
|
|
22
|
+
*
|
|
19
23
|
* Do NOT use TokenIcon:
|
|
20
24
|
* - for address identifiers (use Identicon component).
|
|
21
25
|
* - for custom images or logos (use Image component).
|
|
22
26
|
*/
|
|
23
|
-
type
|
|
27
|
+
type DirectIcon = {
|
|
24
28
|
icon: string;
|
|
25
29
|
};
|
|
30
|
+
export type SymbolOrIcon = string | DirectIcon | IconComposite;
|
|
26
31
|
export interface TokenIconProps extends Omit<RoundedImageProps, "src" | "size"> {
|
|
27
32
|
symbol: SymbolOrIcon | undefined;
|
|
28
33
|
size?: number;
|
|
29
34
|
className?: string;
|
|
30
35
|
}
|
|
31
|
-
declare const TokenIcon: React.ForwardRefExoticComponent<TokenIconProps & React.RefAttributes<HTMLImageElement>>;
|
|
36
|
+
declare const TokenIcon: React.ForwardRefExoticComponent<TokenIconProps & React.RefAttributes<HTMLDivElement | HTMLImageElement>>;
|
|
32
37
|
export { TokenIcon };
|
|
33
38
|
/**
|
|
34
39
|
* Preload token icons into browser cache.
|
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
import { IconComposite } from '@gearbox-protocol/sdk/common-utils';
|
|
1
2
|
import { Address } from 'viem';
|
|
3
|
+
export declare function isIconComposite(value: string | IconComposite | undefined | null): value is IconComposite;
|
|
2
4
|
export type TokenMetaInfo = {
|
|
3
5
|
symbol: string;
|
|
4
6
|
title?: string;
|
|
5
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Token icon:
|
|
9
|
+
* - **String** — direct URL to a single raster/SVG asset. Often the best choice when the image is
|
|
10
|
+
* baked on the server or CDN (single request, no client layering).
|
|
11
|
+
* - **`IconComposite`** — layered icon using named UI-kit presets (`stacked_full`, `centered_foreground`).
|
|
12
|
+
*
|
|
13
|
+
* Do not mix legacy alternate shapes; `icon` is a discriminated field (`string` vs `kind: "composite"`).
|
|
14
|
+
*/
|
|
15
|
+
icon?: string | IconComposite;
|
|
6
16
|
name?: string;
|
|
7
17
|
};
|
|
8
18
|
export type TokenFullData = TokenMetaInfo & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/ui-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"repository": "https://github.com/gearbox-protocol/ui-kit",
|
|
6
6
|
"license": "MIT",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"@commitlint/cli": "^20.1.0",
|
|
154
154
|
"@commitlint/config-conventional": "^20.0.0",
|
|
155
155
|
"@gearbox-protocol/biome-config": "^1.0.2",
|
|
156
|
-
"@gearbox-protocol/sdk": "14.5
|
|
156
|
+
"@gearbox-protocol/sdk": "14.8.5",
|
|
157
157
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
158
158
|
"@storybook/addon-a11y": "^10.0.8",
|
|
159
159
|
"@storybook/addon-docs": "^10.0.8",
|