@0xsquid/ui 2.2.3 → 2.2.4

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.
Files changed (25) hide show
  1. package/dist/cjs/index.js +270 -177
  2. package/dist/cjs/types/components/badges/BadgeImage.d.ts +1 -1
  3. package/dist/cjs/types/components/icons/FavouriteFilterIcon.d.ts +4 -0
  4. package/dist/cjs/types/components/icons/MarketIcons.d.ts +8 -0
  5. package/dist/cjs/types/components/icons/index.d.ts +5 -3
  6. package/dist/cjs/types/components/layout/TokenDetailsView.d.ts +39 -0
  7. package/dist/cjs/types/components/layout/index.d.ts +3 -2
  8. package/dist/cjs/types/components/typography/BodyText.d.ts +5 -1
  9. package/dist/cjs/types/components/typography/CaptionText.d.ts +7 -2
  10. package/dist/cjs/types/services/internal/colorService.d.ts +2 -1
  11. package/dist/cjs/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
  12. package/dist/esm/index.js +266 -178
  13. package/dist/esm/types/components/badges/BadgeImage.d.ts +1 -1
  14. package/dist/esm/types/components/icons/FavouriteFilterIcon.d.ts +4 -0
  15. package/dist/esm/types/components/icons/MarketIcons.d.ts +8 -0
  16. package/dist/esm/types/components/icons/index.d.ts +5 -3
  17. package/dist/esm/types/components/layout/TokenDetailsView.d.ts +39 -0
  18. package/dist/esm/types/components/layout/index.d.ts +3 -2
  19. package/dist/esm/types/components/typography/BodyText.d.ts +5 -1
  20. package/dist/esm/types/components/typography/CaptionText.d.ts +7 -2
  21. package/dist/esm/types/services/internal/colorService.d.ts +2 -1
  22. package/dist/esm/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.ts +199 -137
  25. 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,4 @@
1
+ export declare function FavouriteFilterIcon({ size, className, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -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";
@@ -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
- /// <reference types="react" />
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 {};
@@ -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;
@@ -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;