@gearbox-protocol/permissionless-ui 1.22.0-next.2 → 1.22.0-next.21
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/buttons/navigation-button/navigation-button.cjs +1 -1
- package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
- package/dist/cjs/components/client-adapters/index.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-button/styled-button.cjs +1 -1
- package/dist/cjs/components/client-adapters/styled-dialog-container/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-dialog-container/styled-dialog-container.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/index.cjs +1 -0
- package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -0
- package/dist/cjs/components/description/description.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-container.cjs +1 -1
- package/dist/cjs/components/dialog/dialog-modal-container.cjs +1 -1
- package/dist/cjs/components/dialog/index.cjs +1 -1
- package/dist/cjs/components/filter/filter-modal.cjs +1 -1
- package/dist/cjs/components/index.cjs +1 -1
- package/dist/cjs/components/layout/app-logo/app-logo.cjs +1 -1
- package/dist/cjs/components/layout/col/col.cjs +1 -1
- package/dist/cjs/components/layout/container/container.cjs +1 -1
- package/dist/cjs/components/layout/footer/footer.cjs +1 -1
- package/dist/cjs/components/layout/grid/grid.cjs +1 -1
- package/dist/cjs/components/layout/header/header.cjs +1 -1
- package/dist/cjs/components/layout/layout/layout.cjs +2 -2
- package/dist/cjs/components/modal/index.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/network-icon/network-icon.cjs +1 -1
- package/dist/cjs/components/points-icon/points-icon.cjs +1 -1
- package/dist/cjs/components/rounded-image/rounded-image.cjs +1 -1
- package/dist/cjs/components/short-string/short-string.cjs +1 -1
- package/dist/cjs/components/table/grid-table.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/components/typography/typography.cjs +1 -1
- package/dist/cjs/components/vertical-list/vertical-list.cjs +1 -1
- package/dist/cjs/configs/tailwind-preset.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/utils/format-money.cjs +1 -1
- package/dist/cjs/utils/format-slippage.cjs +1 -0
- package/dist/cjs/utils/index.cjs +1 -1
- package/dist/cjs/utils/network-icons.cjs +1 -1
- package/dist/cjs/utils/search-in-token.cjs +1 -1
- package/dist/cjs/utils/shorten-string.cjs +1 -1
- package/dist/cjs/utils/static.cjs +1 -0
- package/dist/cjs/utils/templates.cjs +1 -1
- package/dist/cjs/utils/window.cjs +1 -1
- package/dist/cjs/utils/z-index.cjs +1 -0
- package/dist/esm/components/buttons/button/button.js +22 -15
- package/dist/esm/components/buttons/navigation-button/navigation-button.js +6 -6
- package/dist/esm/components/checkbox/checkbox-labeled.js +7 -1
- package/dist/esm/components/client-adapters/index.js +6 -2
- package/dist/esm/components/client-adapters/styled-button/styled-button.js +24 -13
- package/dist/esm/components/client-adapters/styled-dialog-container/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-dialog-container/styled-dialog-container.js +39 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/index.js +4 -0
- package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +136 -0
- package/dist/esm/components/description/description.js +16 -10
- package/dist/esm/components/dialog/dialog-container.js +55 -21
- package/dist/esm/components/dialog/dialog-modal-container.js +38 -17
- package/dist/esm/components/dialog/index.js +18 -18
- package/dist/esm/components/filter/filter-modal.js +1 -1
- package/dist/esm/components/index.js +470 -466
- package/dist/esm/components/layout/app-logo/app-logo.js +8 -7
- package/dist/esm/components/layout/col/col.js +4 -4
- package/dist/esm/components/layout/container/container.js +5 -5
- package/dist/esm/components/layout/footer/footer.js +3 -3
- package/dist/esm/components/layout/grid/grid.js +9 -9
- package/dist/esm/components/layout/header/header.js +12 -12
- package/dist/esm/components/layout/layout/layout.js +4 -4
- package/dist/esm/components/modal/index.js +4 -0
- package/dist/esm/components/modal/modal.js +108 -0
- package/dist/esm/components/network-icon/network-icon.js +22 -21
- package/dist/esm/components/points-icon/points-icon.js +34 -37
- package/dist/esm/components/rounded-image/rounded-image.js +59 -27
- package/dist/esm/components/short-string/short-string.js +19 -23
- package/dist/esm/components/table/grid-table.js +2 -0
- package/dist/esm/components/token-icon/token-icon.js +45 -39
- package/dist/esm/components/token-symbol/token-symbol.js +98 -40
- package/dist/esm/components/typography/typography.js +15 -12
- package/dist/esm/components/vertical-list/vertical-list.js +39 -33
- package/dist/esm/configs/tailwind-preset.js +5 -3
- package/dist/esm/index.js +606 -601
- package/dist/esm/utils/format-money.js +13 -17
- package/dist/esm/utils/format-slippage.js +7 -0
- package/dist/esm/utils/index.js +66 -65
- package/dist/esm/utils/network-icons.js +4 -53
- package/dist/esm/utils/search-in-token.js +8 -8
- package/dist/esm/utils/shorten-string.js +7 -3
- package/dist/esm/utils/static.js +6 -0
- package/dist/esm/utils/templates.js +8 -9
- package/dist/esm/utils/window.js +4 -3
- package/dist/esm/utils/z-index.js +7 -0
- package/dist/globals.css +1 -1
- package/dist/types/components/auth/connect-required.d.ts +2 -2
- package/dist/types/components/auth/signin-required.d.ts +2 -2
- package/dist/types/components/buttons/button/button.d.ts +1 -1
- package/dist/types/components/buttons/navigation-button/navigation-button.d.ts +1 -1
- package/dist/types/components/client-adapters/index.d.ts +2 -0
- package/dist/types/components/client-adapters/styled-button/styled-button.d.ts +2 -2
- package/dist/types/components/client-adapters/styled-dialog-container/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-dialog-container/styled-dialog-container.d.ts +13 -0
- package/dist/types/components/client-adapters/styled-rounded-image/index.d.ts +1 -0
- package/dist/types/components/client-adapters/styled-rounded-image/styled-rounded-image.d.ts +9 -0
- package/dist/types/components/description/description.d.ts +5 -3
- package/dist/types/components/dialog/dialog-container.d.ts +8 -3
- package/dist/types/components/dialog/dialog-modal-container.d.ts +9 -3
- package/dist/types/components/dialog/dialog.d.ts +3 -3
- package/dist/types/components/dialog/index.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components/layout/col/col.d.ts +1 -1
- package/dist/types/components/layout/container/container.d.ts +1 -1
- package/dist/types/components/layout/footer/footer.d.ts +1 -1
- package/dist/types/components/layout/grid/grid.d.ts +1 -1
- package/dist/types/components/layout/header/header.d.ts +1 -1
- package/dist/types/components/layout/layout/layout.d.ts +1 -1
- package/dist/types/components/modal/index.d.ts +1 -0
- package/dist/types/components/modal/modal.d.ts +33 -0
- package/dist/types/components/navbar/navbar-indicator-context.d.ts +1 -1
- package/dist/types/components/points-icon/points-icon.d.ts +2 -5
- package/dist/types/components/pool-points-indicator/pool-points-indicator.d.ts +1 -1
- package/dist/types/components/rounded-image/rounded-image.d.ts +19 -4
- package/dist/types/components/short-string/short-string.d.ts +4 -4
- package/dist/types/components/skeleton/skeleton.d.ts +1 -1
- package/dist/types/components/theme-provider.d.ts +1 -1
- package/dist/types/components/tip-card/tip-card.d.ts +1 -1
- package/dist/types/components/token-icon/token-icon.d.ts +10 -4
- package/dist/types/components/token-symbol/token-symbol.d.ts +9 -4
- package/dist/types/components/typography/typography.d.ts +2 -2
- package/dist/types/components/vertical-list/vertical-list.d.ts +2 -5
- package/dist/types/components/with-copy/with-copy.d.ts +1 -1
- package/dist/types/configs/tailwind-preset.d.ts +2 -0
- package/dist/types/hooks/use-filter.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types/component-props.d.ts +1 -1
- package/dist/types/utils/format-money.d.ts +0 -15
- package/dist/types/utils/format-slippage.d.ts +15 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/utils/network-icons.d.ts +3 -32
- package/dist/types/utils/shorten-string.d.ts +2 -1
- package/dist/types/utils/static.d.ts +3 -0
- package/dist/types/utils/templates.d.ts +1 -1
- package/dist/types/utils/window.d.ts +3 -1
- package/dist/types/utils/z-index.d.ts +8 -0
- package/package.json +4 -1
- package/src/styles/base.css +17 -6
- package/src/styles/theme.css +26 -0
- package/dist/cjs/components/dialog/dialog-modal.cjs +0 -1
- package/dist/esm/components/dialog/dialog-modal.js +0 -70
- package/dist/types/components/dialog/dialog-modal.d.ts +0 -30
package/dist/types/components/client-adapters/styled-dialog-container/styled-dialog-container.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DialogContainerProps } from '../../dialog/dialog-container';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type PaddingSize = "none" | "md" | "lg" | "xl";
|
|
4
|
+
export interface StyledDialogContainerProps extends Omit<DialogContainerProps, "padding" | "colorTheme" | "maxWidth"> {
|
|
5
|
+
$padding?: PaddingSize;
|
|
6
|
+
$width?: string;
|
|
7
|
+
$minWidth?: string;
|
|
8
|
+
$maxWidth?: string;
|
|
9
|
+
$minHeight?: string;
|
|
10
|
+
$colorTheme?: DialogContainerProps["colorTheme"];
|
|
11
|
+
}
|
|
12
|
+
declare const StyledDialogContainer: React.ForwardRefExoticComponent<StyledDialogContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { StyledDialogContainer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './styled-rounded-image';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RoundedImageProps } from '../../rounded-image/rounded-image';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
export interface StyledRoundedImageProps extends Omit<RoundedImageProps, "size" | "rounded" | "defaultIcon"> {
|
|
4
|
+
$size: number;
|
|
5
|
+
$rounded?: boolean;
|
|
6
|
+
$defaultIcon?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const StyledRoundedImage: React.ForwardRefExoticComponent<StyledRoundedImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
9
|
+
export { StyledRoundedImage };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TypographyProps } from '../typography/typography';
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
/**
|
|
3
4
|
* DescriptionProps — props for Description component.
|
|
4
5
|
*/
|
|
5
|
-
export interface DescriptionProps extends
|
|
6
|
+
export interface DescriptionProps extends Omit<TypographyProps, "variant" | "color"> {
|
|
6
7
|
}
|
|
7
8
|
/**
|
|
8
9
|
* Description — component for displaying secondary/muted text.
|
|
@@ -23,4 +24,5 @@ export interface DescriptionProps extends React.HTMLAttributes<HTMLSpanElement>
|
|
|
23
24
|
* <Description className="text-xs">Small description</Description>
|
|
24
25
|
* ```
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
declare const Description: React.ForwardRefExoticComponent<DescriptionProps & React.RefAttributes<HTMLDivElement>>;
|
|
28
|
+
export { Description };
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
declare const dialogContainerVariants: (props?: ({
|
|
4
|
+
padding?: boolean | "md" | "xl" | null | undefined;
|
|
5
|
+
colorTheme?: "default" | "modal" | "transparent" | "box" | null | undefined;
|
|
6
|
+
maxWidth?: "full" | "sm" | "lg" | "md" | "xl" | "2xl" | null | undefined;
|
|
7
|
+
sticky?: boolean | null | undefined;
|
|
8
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
|
+
export interface DialogContainerProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogContainerVariants> {
|
|
5
10
|
}
|
|
6
11
|
/**
|
|
7
12
|
* DialogContainer component for responsive content width within dialogs
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { ModalProps } from '../modal/modal';
|
|
1
3
|
import { DialogContainerProps } from './dialog-container';
|
|
2
|
-
import { DialogModalProps } from './dialog-modal';
|
|
3
4
|
import * as React from "react";
|
|
5
|
+
declare const dialogModalContainerVariants: (props?: ({
|
|
6
|
+
width?: "full" | "default" | "lg" | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
4
8
|
export interface DialogModalContainerProps {
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
show: boolean;
|
|
10
|
+
onClickOutside?: () => void;
|
|
11
|
+
modal?: Omit<ModalProps, "ref" | " children" | "show" | "onClickOutside">;
|
|
12
|
+
dialog?: Omit<DialogContainerProps, "ref" | "children"> & VariantProps<typeof dialogModalContainerVariants>;
|
|
7
13
|
}
|
|
8
14
|
/**
|
|
9
15
|
* DialogModalContainer component for responsive content width within dialogs
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
|
2
|
-
declare const Dialog: import('
|
|
3
|
-
declare const DialogTrigger: import('
|
|
4
|
-
declare const DialogPortal: import('
|
|
2
|
+
declare const Dialog: import('react').FC<DialogPrimitive.DialogProps>;
|
|
3
|
+
declare const DialogTrigger: import('react').ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
4
|
+
declare const DialogPortal: import('react').FC<DialogPrimitive.DialogPortalProps>;
|
|
5
5
|
export { Dialog, DialogPortal, DialogTrigger };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from '../modal/modal';
|
|
1
2
|
export * from './dialog';
|
|
2
3
|
export * from './dialog-container';
|
|
3
4
|
export * from './dialog-content';
|
|
@@ -5,7 +6,6 @@ export * from './dialog-description';
|
|
|
5
6
|
export * from './dialog-footer';
|
|
6
7
|
export * from './dialog-form';
|
|
7
8
|
export * from './dialog-header';
|
|
8
|
-
export * from './dialog-modal';
|
|
9
9
|
export * from './dialog-modal-container';
|
|
10
10
|
export * from './dialog-overlay';
|
|
11
11
|
export * from './dialog-title';
|
|
@@ -64,6 +64,7 @@ export * from './legal-agreement';
|
|
|
64
64
|
export * from './liquidation';
|
|
65
65
|
export * from './loader-guard';
|
|
66
66
|
export * from './markdown-viewer';
|
|
67
|
+
export * from './modal';
|
|
67
68
|
export * from './navbar';
|
|
68
69
|
export * from './navbar-logo';
|
|
69
70
|
export * from './navitem';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { default as React } from '../../../../node_modules/.pnpm/react@19.2.0/node_modules/react';
|
|
2
1
|
import { LegalReferences } from '../legal-disclaimer';
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
export interface FooterProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
4
|
logo?: React.ReactNode;
|
|
5
5
|
copyright?: React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './modal';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const dialogModalVariants: (props?: ({
|
|
4
|
+
colorTheme?: "default" | "dark" | "dark-transparent" | null | undefined;
|
|
5
|
+
backdrop?: "default" | "success" | "failure" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
|
+
export interface ModalProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof dialogModalVariants> {
|
|
8
|
+
/**
|
|
9
|
+
* Whether to show the dialog container
|
|
10
|
+
* When false, renders null
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
show?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Callback when clicking outside the container (on the overlay)
|
|
16
|
+
* Only works when used as a modal overlay
|
|
17
|
+
*/
|
|
18
|
+
onClickOutside?: () => void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Modal component for responsive content width within dialogs
|
|
22
|
+
* Follows the same pattern as Container from layout/container
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // With show/hide control
|
|
27
|
+
* <Modal show={isOpen} onClickOutside={handleClose}>
|
|
28
|
+
* <Content />
|
|
29
|
+
* </Modal>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
33
|
+
export { Modal };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as React } from '
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
interface NavbarIndicatorContextType {
|
|
3
3
|
registerItem: (id: string, element: HTMLElement) => void;
|
|
4
4
|
unregisterItem: (id: string) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RoundedImageProps } from '../rounded-image/rounded-image';
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
export interface PointsReward {
|
|
3
4
|
/**
|
|
@@ -9,7 +10,7 @@ export interface PointsReward {
|
|
|
9
10
|
*/
|
|
10
11
|
type: string;
|
|
11
12
|
}
|
|
12
|
-
export interface PointsIconProps extends React.HTMLAttributes<HTMLImageElement> {
|
|
13
|
+
export interface PointsIconProps extends React.HTMLAttributes<HTMLImageElement>, Omit<RoundedImageProps, "size" | "src" | "alt"> {
|
|
13
14
|
/**
|
|
14
15
|
* Reward information with name and type
|
|
15
16
|
*/
|
|
@@ -22,10 +23,6 @@ export interface PointsIconProps extends React.HTMLAttributes<HTMLImageElement>
|
|
|
22
23
|
* Base URL for static assets (defaults to Gearbox static CDN)
|
|
23
24
|
*/
|
|
24
25
|
staticBaseUrl?: string;
|
|
25
|
-
/**
|
|
26
|
-
* Whether to apply rounded corners (circle)
|
|
27
|
-
*/
|
|
28
|
-
rounded?: boolean;
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
28
|
* PointsIcon — component for displaying reward/points program icons.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from '
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
2
|
export type PoolPointsColor = "primary" | "secondary" | "green" | "blue" | "yellow";
|
|
3
3
|
export interface PoolPointsIndicatorProps {
|
|
4
4
|
/**
|
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface RoundedImageProps extends React.ImgHTMLAttributes<HTMLImageElement> {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface RoundedImageProps extends Omit<React.ImgHTMLAttributes<HTMLImageElement>, "onError"> {
|
|
3
3
|
/**
|
|
4
4
|
* Size of the image in pixels
|
|
5
5
|
*/
|
|
6
|
-
size
|
|
6
|
+
size: number;
|
|
7
|
+
/**
|
|
8
|
+
* Whether to apply rounded corners (circle)
|
|
9
|
+
*/
|
|
10
|
+
rounded?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Default icon to display if the image fails to load
|
|
13
|
+
*/
|
|
14
|
+
defaultIcon?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Image fit behavior
|
|
17
|
+
* - "contain" — show full image without cropping (best for icons)
|
|
18
|
+
* - "cover" — fill bounds, may crop (best for photos/avatars)
|
|
19
|
+
*/
|
|
20
|
+
fit?: "contain" | "cover";
|
|
7
21
|
}
|
|
8
22
|
/**
|
|
9
23
|
* RoundedImage — a circular image component
|
|
10
24
|
*/
|
|
11
|
-
|
|
25
|
+
declare const RoundedImage: React.ForwardRefExoticComponent<RoundedImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
26
|
+
export { RoundedImage };
|
|
@@ -3,10 +3,10 @@ import type * as React from "react";
|
|
|
3
3
|
* ShortStringProps — props for ShortString component.
|
|
4
4
|
*/
|
|
5
5
|
export interface ShortStringProps {
|
|
6
|
-
children:
|
|
7
|
-
maxLength?: number;
|
|
8
|
-
className?: string;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
maxLength?: number | "text-overflow";
|
|
9
8
|
showTooltip?: boolean;
|
|
9
|
+
className?: string;
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* ShortString — component for truncating text with tooltip showing full content.
|
|
@@ -36,4 +36,4 @@ export interface ShortStringProps {
|
|
|
36
36
|
* </ShortString>
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
39
|
-
export declare function ShortString({ children, maxLength,
|
|
39
|
+
export declare function ShortString({ children, maxLength, showTooltip, className, }: ShortStringProps): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -3,7 +3,7 @@ import type * as React from "react";
|
|
|
3
3
|
declare const skeletonVariants: (props?: ({
|
|
4
4
|
variant?: "default" | "lighter" | "darker" | null | undefined;
|
|
5
5
|
speed?: "default" | "slow" | "fast" | null | undefined;
|
|
6
|
-
width?: "full" | "sm" | "lg" | "xs" | "md" | "xl" | "3/4" | "1/2" | "1/3" | "1/4" |
|
|
6
|
+
width?: "full" | "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3/4" | "1/2" | "1/3" | "1/4" | null | undefined;
|
|
7
7
|
height?: "sm" | "lg" | "xs" | "md" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | null | undefined;
|
|
8
8
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
9
9
|
type WidthPreset = NonNullable<VariantProps<typeof skeletonVariants>["width"]>;
|
|
@@ -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
|
-
variant?: "default" | "success" | "warning" | "info" | "
|
|
4
|
+
variant?: "default" | "success" | "warning" | "info" | "error" | "light" | null | undefined;
|
|
5
5
|
hasIndicator?: boolean | null | undefined;
|
|
6
6
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
7
|
declare const indicatorColors: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RoundedImageProps } from '../rounded-image/rounded-image';
|
|
1
3
|
/**
|
|
2
4
|
* TokenIcon — component for displaying token/asset icons.
|
|
3
5
|
*
|
|
@@ -18,12 +20,16 @@
|
|
|
18
20
|
* - for address identifiers (use Identicon component).
|
|
19
21
|
* - for custom images or logos (use Image component).
|
|
20
22
|
*/
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
type SymbolOrIcon = string | {
|
|
24
|
+
icon: string;
|
|
25
|
+
};
|
|
26
|
+
export interface TokenIconProps extends Omit<RoundedImageProps, "src" | "size"> {
|
|
27
|
+
symbol: SymbolOrIcon | undefined;
|
|
23
28
|
size?: number;
|
|
24
29
|
className?: string;
|
|
25
30
|
}
|
|
26
|
-
|
|
31
|
+
declare const TokenIcon: React.ForwardRefExoticComponent<TokenIconProps & React.RefAttributes<HTMLImageElement>>;
|
|
32
|
+
export { TokenIcon };
|
|
27
33
|
/**
|
|
28
34
|
* Preload token icons into browser cache.
|
|
29
35
|
* Call this function early in your app initialization with the list of token symbols.
|
|
@@ -37,4 +43,4 @@ export declare function TokenIcon({ symbol, size, className }: TokenIconProps):
|
|
|
37
43
|
* preloadTokenIcons(tokens);
|
|
38
44
|
* ```
|
|
39
45
|
*/
|
|
40
|
-
export declare function preloadTokenIcons(symbols:
|
|
46
|
+
export declare function preloadTokenIcons(symbols: SymbolOrIcon[]): void;
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { NetworkType } from '@gearbox-protocol/sdk';
|
|
2
|
-
import
|
|
2
|
+
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
declare const tokenSymbolVariants: (props?: ({
|
|
5
|
+
marginSize?: "sm" | "lg" | "md" | null | undefined;
|
|
6
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
3
7
|
type PartialTokenData = {
|
|
4
8
|
symbol: string;
|
|
5
9
|
title?: string;
|
|
10
|
+
icon?: string;
|
|
6
11
|
};
|
|
7
|
-
export interface TokenSymbolProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title"> {
|
|
12
|
+
export interface TokenSymbolProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "title">, VariantProps<typeof tokenSymbolVariants> {
|
|
8
13
|
/**
|
|
9
14
|
* Token data object or symbol string
|
|
10
15
|
*/
|
|
@@ -67,5 +72,5 @@ export interface TokenSymbolProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
67
72
|
* <TokenSymbol token="WETH" showSymbol={true} />
|
|
68
73
|
* ```
|
|
69
74
|
*/
|
|
70
|
-
|
|
71
|
-
export {};
|
|
75
|
+
declare const TokenSymbol: React.ForwardRefExoticComponent<TokenSymbolProps & React.RefAttributes<HTMLDivElement>>;
|
|
76
|
+
export { TokenSymbol };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const typographyVariants: (props?: ({
|
|
4
|
-
variant?: "body" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "bodySmall" | "overline" | null | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "muted" | "success" | "warning" | "destructive" | "primary" | null | undefined;
|
|
4
|
+
variant?: "body" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "bodySmall" | "overline" | "inherit" | null | undefined;
|
|
5
|
+
color?: "inherit" | "default" | "muted" | "success" | "warning" | "destructive" | "primary" | "secondary" | null | undefined;
|
|
6
6
|
weight?: "medium" | "inherit" | "normal" | "semibold" | "bold" | null | undefined;
|
|
7
7
|
align?: "inherit" | "left" | "center" | "right" | null | undefined;
|
|
8
8
|
leading?: "inherit" | "normal" | "tight" | "relaxed" | null | undefined;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
declare const verticalListVariants: (props?: ({
|
|
4
|
-
|
|
4
|
+
rowGap?: "default" | "xs" | "md" | null | undefined;
|
|
5
5
|
divided?: boolean | null | undefined;
|
|
6
|
+
nested?: boolean | null | undefined;
|
|
6
7
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
7
8
|
export interface VerticalListProps extends React.HTMLAttributes<HTMLUListElement>, VariantProps<typeof verticalListVariants> {
|
|
8
|
-
/**
|
|
9
|
-
* Gap between items
|
|
10
|
-
*/
|
|
11
|
-
gap?: "xs" | "sm" | "default" | "md" | "lg";
|
|
12
9
|
/**
|
|
13
10
|
* Show dividers between items
|
|
14
11
|
*/
|
|
@@ -6,11 +6,11 @@ export interface SelectFilterList<T> {
|
|
|
6
6
|
/**
|
|
7
7
|
* Hook for managing range filter state
|
|
8
8
|
*/
|
|
9
|
-
export declare function useRangeFilter(): readonly [FilterRange | null, import('
|
|
9
|
+
export declare function useRangeFilter(): readonly [FilterRange | null, import('react').Dispatch<import('react').SetStateAction<FilterRange | null>>, () => void];
|
|
10
10
|
/**
|
|
11
11
|
* Hook for managing select filter state
|
|
12
12
|
*/
|
|
13
|
-
export declare function useSelectFilter<T>(initialState?: SelectFilterList<T> | null): readonly [SelectFilterList<T> | null, import('
|
|
13
|
+
export declare function useSelectFilter<T>(initialState?: SelectFilterList<T> | null): readonly [SelectFilterList<T> | null, import('react').Dispatch<import('react').SetStateAction<SelectFilterList<T> | null>>, () => void];
|
|
14
14
|
type SortType = "desc" | "asc";
|
|
15
15
|
export interface FilterSortField<T> {
|
|
16
16
|
field: T;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export * from './components/legal-agreement';
|
|
|
60
60
|
export * from './components/liquidation';
|
|
61
61
|
export * from './components/loader-guard';
|
|
62
62
|
export * from './components/markdown-viewer';
|
|
63
|
+
export * from './components/modal';
|
|
63
64
|
export * from './components/navbar';
|
|
64
65
|
export * from './components/navbar-logo';
|
|
65
66
|
export * from './components/navitem';
|
|
@@ -84,18 +84,3 @@ export declare const SLIPPAGE_DECIMALS = 1000n;
|
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
86
86
|
export declare function formatMoneyAmount(value: number | bigint | string, options?: number | Intl.NumberFormatOptions): string;
|
|
87
|
-
/**
|
|
88
|
-
* Formats a slippage value to percentage string
|
|
89
|
-
*
|
|
90
|
-
* @param slippage - The slippage value (e.g., 10 for 1%)
|
|
91
|
-
* @param precision - Number of decimal places (default: 1)
|
|
92
|
-
* @returns Formatted slippage string like "1.0%"
|
|
93
|
-
*
|
|
94
|
-
* @example
|
|
95
|
-
* ```ts
|
|
96
|
-
* slippageTemplate(10) // "1.0%"
|
|
97
|
-
* slippageTemplate(5, 2) // "0.50%"
|
|
98
|
-
* slippageTemplate(undefined) // "-"
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
export declare function slippageTemplate(slippage?: number, precision?: number): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats a slippage value to percentage string
|
|
3
|
+
*
|
|
4
|
+
* @param slippage - The slippage value (e.g., 10 for 1%)
|
|
5
|
+
* @param precision - Number of decimal places (default: 1)
|
|
6
|
+
* @returns Formatted slippage string like "1.0%"
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* slippageTemplate(10) // "1.0%"
|
|
11
|
+
* slippageTemplate(5, 2) // "0.50%"
|
|
12
|
+
* slippageTemplate(undefined) // "-"
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function slippageTemplate(slippage?: number, precision?: number): string;
|
|
@@ -7,8 +7,9 @@ export * from './colors';
|
|
|
7
7
|
export * from './copy';
|
|
8
8
|
export * from './format';
|
|
9
9
|
export * from './format-asset-amount';
|
|
10
|
-
export { formatMoney, formatMoney as formatMoneyAmount, formatPercentAmount, PERCENTAGE_FACTOR, percentageTemplate, percentTemplate, SLIPPAGE_DECIMALS,
|
|
10
|
+
export { formatMoney, formatMoney as formatMoneyAmount, formatPercentAmount, PERCENTAGE_FACTOR, percentageTemplate, percentTemplate, SLIPPAGE_DECIMALS, } from './format-money';
|
|
11
11
|
export { FORMAT_CONSTANTS, type FormatNumberOptions, formatNumberWithSuffix, formatPrice, getAdaptiveDecimals, isBelowDisplayThreshold, isEffectivelyZero, toSignificantDigits, } from './format-number';
|
|
12
|
+
export * from './format-slippage';
|
|
12
13
|
export * from './interface';
|
|
13
14
|
export * from './network-icons';
|
|
14
15
|
export * from './parse-input-to-bn';
|
|
@@ -23,3 +24,4 @@ export type { SortField as UtilsSortField, SortType } from './sort';
|
|
|
23
24
|
export * from './templates';
|
|
24
25
|
export * from './ttl';
|
|
25
26
|
export * from './window';
|
|
27
|
+
export * from './z-index';
|
|
@@ -1,19 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
* Network icon paths mapping
|
|
3
|
-
*/
|
|
4
|
-
export type NetworkType = "Mainnet" | "Arbitrum" | "Optimism" | "Sonic" | "Monad" | "AllNetworks" | string;
|
|
1
|
+
import { NetworkType } from '@gearbox-protocol/sdk';
|
|
5
2
|
/**
|
|
6
3
|
* Alias for backward compatibility
|
|
7
4
|
*/
|
|
8
|
-
export type NetworkIcons = NetworkType;
|
|
9
|
-
/**
|
|
10
|
-
* Network configuration
|
|
11
|
-
*/
|
|
12
|
-
export interface NetworkConfig {
|
|
13
|
-
name: string;
|
|
14
|
-
icon: string;
|
|
15
|
-
chainId: number;
|
|
16
|
-
}
|
|
5
|
+
export type NetworkIcons = NetworkType | "AllNetworks";
|
|
17
6
|
/**
|
|
18
7
|
* Get network icon path by network name
|
|
19
8
|
*
|
|
@@ -26,22 +15,4 @@ export interface NetworkConfig {
|
|
|
26
15
|
* getNetworkIcon("Unknown") // ""
|
|
27
16
|
* ```
|
|
28
17
|
*/
|
|
29
|
-
export declare function getNetworkIcon(network:
|
|
30
|
-
/**
|
|
31
|
-
* Get network name by chain ID
|
|
32
|
-
*
|
|
33
|
-
* @param chainId - Chain ID
|
|
34
|
-
* @returns Network name or undefined if not found
|
|
35
|
-
*/
|
|
36
|
-
export declare function getNetworkByChainId(chainId: number): string | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* Get network config by name
|
|
39
|
-
*
|
|
40
|
-
* @param network - Network name
|
|
41
|
-
* @returns Network config or undefined if not found
|
|
42
|
-
*/
|
|
43
|
-
export declare function getNetworkConfig(network: NetworkType): NetworkConfig | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* Get all available networks
|
|
46
|
-
*/
|
|
47
|
-
export declare function getAllNetworks(): NetworkConfig[];
|
|
18
|
+
export declare function getNetworkIcon(network: NetworkIcons): string;
|
|
@@ -12,4 +12,5 @@
|
|
|
12
12
|
* shortenString("A very long string", 10) // "A very lon..."
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export declare function shortenString(str: string, maxLength
|
|
15
|
+
export declare function shortenString(str: string, maxLength: number): string;
|
|
16
|
+
export declare function isLongString(str: string, maxLength: number): boolean;
|
|
@@ -38,7 +38,7 @@ type PartialTokenData = Pick<TokenData, "title" | "decimals"> & {
|
|
|
38
38
|
* // "1.00 Very..." (truncated to 10 chars)
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
|
-
export declare function tokenTemplate(value: bigint | string | number | undefined, token: PartialTokenData | undefined, precision?: number, spaceSymbol?: string, maxLength?: number):
|
|
41
|
+
export declare function tokenTemplate(value: bigint | string | number | undefined, token: PartialTokenData | undefined, precision?: number, spaceSymbol?: string, maxLength?: number): string;
|
|
42
42
|
/**
|
|
43
43
|
* Formats a token amount and returns it as a string with token title
|
|
44
44
|
* Use this when you need a formatted number string with token name (not a React element)
|
|
@@ -12,4 +12,6 @@
|
|
|
12
12
|
* openInNewWindow("https://example.com")
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
type Target = "_blank" | "_self" | "_parent" | "_top";
|
|
16
|
+
export declare function openInNewWindow(url: string, target?: Target, features?: string): void;
|
|
17
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/permissionless-ui",
|
|
3
|
-
"version": "1.22.0-next.
|
|
3
|
+
"version": "1.22.0-next.21",
|
|
4
4
|
"description": "Internal UI components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -105,6 +105,9 @@
|
|
|
105
105
|
"wagmi": "^2.0.0"
|
|
106
106
|
},
|
|
107
107
|
"peerDependenciesMeta": {
|
|
108
|
+
"connectkit": {
|
|
109
|
+
"optional": true
|
|
110
|
+
},
|
|
108
111
|
"next": {
|
|
109
112
|
"optional": true
|
|
110
113
|
},
|