@0xsquid/ui 2.2.3 → 2.2.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/index.js +277 -180
- package/dist/cjs/types/components/badges/BadgeImage.d.ts +1 -1
- package/dist/cjs/types/components/icons/FavouriteFilterIcon.d.ts +4 -0
- package/dist/cjs/types/components/icons/MarketIcons.d.ts +8 -0
- package/dist/cjs/types/components/icons/index.d.ts +5 -3
- package/dist/cjs/types/components/layout/NavigationBar.d.ts +2 -1
- package/dist/cjs/types/components/layout/TokenDetailsView.d.ts +39 -0
- package/dist/cjs/types/components/layout/index.d.ts +3 -2
- package/dist/cjs/types/components/typography/BodyText.d.ts +5 -1
- package/dist/cjs/types/components/typography/CaptionText.d.ts +7 -2
- package/dist/cjs/types/components/views/AssetsView.d.ts +8 -8
- package/dist/cjs/types/services/internal/colorService.d.ts +2 -1
- package/dist/cjs/types/stories/layout/NavigationBar.stories.d.ts +8 -2
- package/dist/cjs/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
- package/dist/cjs/types/stories/views/AssetsView.stories.d.ts +1 -1
- package/dist/esm/index.js +273 -181
- package/dist/esm/types/components/badges/BadgeImage.d.ts +1 -1
- package/dist/esm/types/components/icons/FavouriteFilterIcon.d.ts +4 -0
- package/dist/esm/types/components/icons/MarketIcons.d.ts +8 -0
- package/dist/esm/types/components/icons/index.d.ts +5 -3
- package/dist/esm/types/components/layout/NavigationBar.d.ts +2 -1
- package/dist/esm/types/components/layout/TokenDetailsView.d.ts +39 -0
- package/dist/esm/types/components/layout/index.d.ts +3 -2
- package/dist/esm/types/components/typography/BodyText.d.ts +5 -1
- package/dist/esm/types/components/typography/CaptionText.d.ts +7 -2
- package/dist/esm/types/components/views/AssetsView.d.ts +8 -8
- package/dist/esm/types/services/internal/colorService.d.ts +2 -1
- package/dist/esm/types/stories/layout/NavigationBar.stories.d.ts +8 -2
- package/dist/esm/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
- package/dist/esm/types/stories/views/AssetsView.stories.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +209 -146
- package/package.json +1 -1
|
@@ -10,6 +10,6 @@ interface BadgeImageProps {
|
|
|
10
10
|
*/
|
|
11
11
|
placeholderImageUrl?: string;
|
|
12
12
|
}
|
|
13
|
-
type BadgeSize = "sm" | "md";
|
|
13
|
+
type BadgeSize = "sm" | "md" | "lg";
|
|
14
14
|
export declare function BadgeImage({ imageUrl: _imageUrl, badgeUrl, size, extraMarginForBadge, rounded, placeholderImageUrl, }: BadgeImageProps): import("react/jsx-runtime").JSX.Element | null;
|
|
15
15
|
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function MarketCapIcon({ size, className, }: {
|
|
2
|
+
size?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function HighestPriceRangeIcon({ size, className, }: {
|
|
6
|
+
size?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -13,11 +13,15 @@ export * from "./Coins";
|
|
|
13
13
|
export * from "./Collection";
|
|
14
14
|
export * from "./CompassRound";
|
|
15
15
|
export * from "./Copy";
|
|
16
|
+
export * from "./CrossAnimatedIcon";
|
|
16
17
|
export * from "./DashboardFast";
|
|
18
|
+
export * from "./DockIcons";
|
|
17
19
|
export * from "./DotGrid";
|
|
18
20
|
export * from "./EmojiSad";
|
|
19
21
|
export * from "./Ethereum";
|
|
22
|
+
export * from "./FavouriteFilterIcon";
|
|
20
23
|
export * from "./Filter";
|
|
24
|
+
export * from "./Generic";
|
|
21
25
|
export * from "./Heart";
|
|
22
26
|
export * from "./Help";
|
|
23
27
|
export * from "./HomeIcon";
|
|
@@ -26,6 +30,7 @@ export * from "./Infinity";
|
|
|
26
30
|
export * from "./Lightning";
|
|
27
31
|
export * from "./Link";
|
|
28
32
|
export * from "./Loader";
|
|
33
|
+
export * from "./MarketIcons";
|
|
29
34
|
export * from "./Max";
|
|
30
35
|
export * from "./NotAllowed";
|
|
31
36
|
export * from "./Percent";
|
|
@@ -49,7 +54,4 @@ export * from "./Timeline";
|
|
|
49
54
|
export * from "./TradingViewSteps";
|
|
50
55
|
export * from "./TriangleExclamation";
|
|
51
56
|
export * from "./Wallet";
|
|
52
|
-
export * from "./CrossAnimatedIcon";
|
|
53
57
|
export * from "./Weather";
|
|
54
|
-
export * from "./DockIcons";
|
|
55
|
-
export * from "./Generic";
|
|
@@ -17,6 +17,7 @@ interface NavigationBarProps extends React.ComponentProps<"nav"> {
|
|
|
17
17
|
onBackButtonClick?: () => void;
|
|
18
18
|
actions?: ActionButton[];
|
|
19
19
|
isLoading?: boolean;
|
|
20
|
+
subtitle?: string;
|
|
20
21
|
}
|
|
21
|
-
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, isLoading, ...props }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare function NavigationBar({ title, displayBackButton, logoUrl, transparent, displayButtonShadows, onBackButtonClick, actions, isLoading, subtitle, ...props }: NavigationBarProps): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface Token {
|
|
3
|
+
address: string;
|
|
4
|
+
name: string;
|
|
5
|
+
symbol: string;
|
|
6
|
+
image: string;
|
|
7
|
+
color: string;
|
|
8
|
+
textColor: string;
|
|
9
|
+
chainId: string;
|
|
10
|
+
}
|
|
11
|
+
interface Chain {
|
|
12
|
+
name: string;
|
|
13
|
+
image: string;
|
|
14
|
+
}
|
|
15
|
+
export type Timeframe = "1H" | "1D" | "1W" | "1Y";
|
|
16
|
+
interface TokenDetailsViewProps {
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
token: Token;
|
|
20
|
+
chain: Chain;
|
|
21
|
+
tokenPrice: number;
|
|
22
|
+
priceChange: number;
|
|
23
|
+
balance: number;
|
|
24
|
+
balanceUSD: number;
|
|
25
|
+
volume24h: string;
|
|
26
|
+
marketCap: string;
|
|
27
|
+
totalSupply: string;
|
|
28
|
+
loading: boolean;
|
|
29
|
+
onLikeToken: () => void;
|
|
30
|
+
Chart?: React.ComponentType<{
|
|
31
|
+
timeframe: Timeframe;
|
|
32
|
+
}>;
|
|
33
|
+
initialTimeframe?: Timeframe;
|
|
34
|
+
onTimeframeChange?: (timeframe: Timeframe) => void;
|
|
35
|
+
onSwapFrom: (token: Pick<Token, "address" | "chainId">) => void;
|
|
36
|
+
onSwapTo: (token: Pick<Token, "address" | "chainId">) => void;
|
|
37
|
+
}
|
|
38
|
+
export declare const TokenDetailsView: ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, Chart, initialTimeframe, onTimeframeChange, onSwapFrom, onSwapTo, }: TokenDetailsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export * from "./AppContainer";
|
|
|
3
3
|
export * from "./Boost";
|
|
4
4
|
export * from "./Breadcrumb";
|
|
5
5
|
export * from "./Collapse";
|
|
6
|
+
export * from "./CollapsibleMenu";
|
|
6
7
|
export * from "./DescriptionBlocks";
|
|
7
8
|
export * from "./DetailsToolbar";
|
|
8
9
|
export * from "./DropdownMenu";
|
|
@@ -15,12 +16,13 @@ export * from "./Modal";
|
|
|
15
16
|
export * from "./ModalContent";
|
|
16
17
|
export * from "./NavigationBar";
|
|
17
18
|
export * from "./PipeSeparator";
|
|
18
|
-
export * from "./CollapsibleMenu";
|
|
19
19
|
export * from "./ProductCard";
|
|
20
20
|
export * from "./ProfileHeaderBackground";
|
|
21
21
|
export * from "./SwapConfiguration";
|
|
22
22
|
export * from "./SwapProgressViewHeader";
|
|
23
23
|
export * from "./SwapStepsCollapsed";
|
|
24
|
+
export * from "./Toast";
|
|
25
|
+
export * from "./TokenDetailsView";
|
|
24
26
|
export * from "./TokenPair";
|
|
25
27
|
export * from "./TransactionFilters";
|
|
26
28
|
export * from "./TransactionHeader/BridgeHeader";
|
|
@@ -38,4 +40,3 @@ export * from "./TransactionProperties/SwapProperties";
|
|
|
38
40
|
export * from "./TransactionProperties/TransactionProperties";
|
|
39
41
|
export * from "./TransactionSearch";
|
|
40
42
|
export * from "./Transfer";
|
|
41
|
-
export * from "./Toast";
|
|
@@ -5,6 +5,10 @@ interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
5
5
|
size: TextSize;
|
|
6
6
|
bold?: boolean;
|
|
7
7
|
tight?: boolean;
|
|
8
|
+
loading?: {
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
width?: string;
|
|
11
|
+
};
|
|
8
12
|
}
|
|
9
|
-
export declare function BodyText({ size, children, bold, tight, ...props }: BodyTextProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function BodyText({ size, children, bold, tight, loading, ...props }: BodyTextProps): import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
children: ReactNode;
|
|
3
4
|
bold?: boolean;
|
|
5
|
+
loading?: {
|
|
6
|
+
isLoading?: boolean;
|
|
7
|
+
width?: string;
|
|
8
|
+
};
|
|
4
9
|
}
|
|
5
|
-
export declare function CaptionText({ children, bold, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function CaptionText({ children, bold, loading, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
|
|
6
11
|
export {};
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface AssetsViewProps {
|
|
3
|
-
chains: {
|
|
3
|
+
chains: Array<{
|
|
4
4
|
name: string;
|
|
5
5
|
iconUrl: string;
|
|
6
|
-
}
|
|
7
|
-
favoriteTokens: {
|
|
6
|
+
}>;
|
|
7
|
+
favoriteTokens: Array<{
|
|
8
8
|
symbol: string;
|
|
9
9
|
name: string;
|
|
10
10
|
iconUrl: string;
|
|
11
11
|
chainIconUrl: string;
|
|
12
|
-
}
|
|
13
|
-
popularTokens: {
|
|
12
|
+
}>;
|
|
13
|
+
popularTokens: Array<{
|
|
14
14
|
symbol: string;
|
|
15
15
|
name: string;
|
|
16
16
|
iconUrl: string;
|
|
17
17
|
chainIconUrl: string;
|
|
18
|
-
}
|
|
19
|
-
userTokens: {
|
|
18
|
+
}>;
|
|
19
|
+
userTokens: Array<{
|
|
20
20
|
symbol: string;
|
|
21
21
|
name: string;
|
|
22
22
|
iconUrl: string;
|
|
23
23
|
chainIconUrl: string;
|
|
24
24
|
balance: string;
|
|
25
|
-
}
|
|
25
|
+
}>;
|
|
26
26
|
}
|
|
27
27
|
export declare function AssetsView({ chains, favoriteTokens, popularTokens, userTokens, }: AssetsViewProps): import("react/jsx-runtime").JSX.Element;
|
|
28
28
|
export declare const List: ({ children }: React.PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -30,5 +30,6 @@ export declare function hexToRgb(hex: string): {
|
|
|
30
30
|
a: number;
|
|
31
31
|
} | null;
|
|
32
32
|
export declare function rgbToHex(r: number, g: number, b: number): string;
|
|
33
|
-
export declare function blendColors(foreground: string, background: string): string | null;
|
|
33
|
+
export declare function blendColors(foreground: string, background: string, factor?: number): string | null;
|
|
34
34
|
export declare const isValidHexColor: (hex: string) => boolean;
|
|
35
|
+
export declare const getColorBrightness: (color: string) => number;
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { Meta, StoryObj } from "@storybook/react";
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
2
|
import { NavigationBar } from "../../components/layout/NavigationBar";
|
|
3
3
|
declare const meta: Meta<typeof NavigationBar>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
7
|
export declare const Title: Story;
|
|
8
|
+
export declare const TitleAndSubtitle: Story;
|
|
8
9
|
export declare const BackButton: Story;
|
|
10
|
+
export declare const BackButtonAndSubtitle: Story;
|
|
9
11
|
export declare const Logo: Story;
|
|
10
|
-
export declare const
|
|
12
|
+
export declare const LogoAndSubtitle: Story;
|
|
13
|
+
export declare const Actions: Story;
|
|
14
|
+
export declare const ActionsAndSubtitle: Story;
|
|
15
|
+
export declare const SubtitleOnly: Story;
|
|
11
16
|
export declare const AllProps: Story;
|
|
12
17
|
export declare const Loading: Story;
|
|
18
|
+
export declare const LoadingAndSubtitle: Story;
|
|
13
19
|
export declare const Transparent: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Meta, type StoryObj } from "@storybook/react";
|
|
2
|
+
import { TokenDetailsView } from "../../components/layout/TokenDetailsView";
|
|
3
|
+
declare const meta: Meta<typeof TokenDetailsView>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const PositivePriceChange: Story;
|
|
8
|
+
export declare const LowBalance: Story;
|
|
9
|
+
export declare const HighBalance: Story;
|
|
10
|
+
export declare const DifferentToken: Story;
|
|
11
|
+
export declare const Closed: Story;
|
|
12
|
+
export declare const Loading: Story;
|
|
13
|
+
export declare const WithFakeChart: Story;
|