@0xsquid/ui 0.23.2 → 0.24.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.
Files changed (59) hide show
  1. package/dist/cjs/index.js +603 -119
  2. package/dist/cjs/types/components/badges/TransactionState.d.ts +0 -5
  3. package/dist/cjs/types/components/buttons/IconButton.d.ts +6 -0
  4. package/dist/cjs/types/components/icons/Bag.d.ts +5 -1
  5. package/dist/cjs/types/components/icons/Coins.d.ts +4 -0
  6. package/dist/cjs/types/components/icons/CompassRound.d.ts +12 -0
  7. package/dist/cjs/types/components/icons/CrossAnimatedIcon.d.ts +7 -0
  8. package/dist/cjs/types/components/icons/DockIcons.d.ts +10 -0
  9. package/dist/cjs/types/components/icons/EmojiSad.d.ts +4 -0
  10. package/dist/cjs/types/components/icons/HomeIcon.d.ts +16 -0
  11. package/dist/cjs/types/components/icons/Social.d.ts +12 -0
  12. package/dist/cjs/types/components/icons/SquidLogo.d.ts +4 -1
  13. package/dist/cjs/types/components/icons/SwapInputs.d.ts +4 -0
  14. package/dist/cjs/types/components/icons/Weather.d.ts +12 -0
  15. package/dist/cjs/types/components/icons/index.d.ts +3 -0
  16. package/dist/cjs/types/components/layout/CollapsibleMenu.d.ts +20 -0
  17. package/dist/cjs/types/components/layout/index.d.ts +1 -0
  18. package/dist/cjs/types/components/lists/TransactionItem.d.ts +8 -5
  19. package/dist/cjs/types/core/constants.d.ts +4 -0
  20. package/dist/cjs/types/core/design-system.d.ts +2 -0
  21. package/dist/cjs/types/core/index.d.ts +3 -1
  22. package/dist/cjs/types/hooks/index.d.ts +4 -0
  23. package/dist/cjs/types/hooks/useCollapsibleMenu.d.ts +6 -0
  24. package/dist/cjs/types/stories/badges/TransactionState.stories.d.ts +5 -0
  25. package/dist/cjs/types/stories/buttons/IconButon.stories.d.ts +7 -0
  26. package/dist/cjs/types/stories/lists/TransactionItem.stories.d.ts +5 -0
  27. package/dist/cjs/types/types/components.d.ts +1 -1
  28. package/dist/cjs/types/types/config.d.ts +6 -24
  29. package/dist/esm/index.js +570 -117
  30. package/dist/esm/types/components/badges/TransactionState.d.ts +0 -5
  31. package/dist/esm/types/components/buttons/IconButton.d.ts +6 -0
  32. package/dist/esm/types/components/icons/Bag.d.ts +5 -1
  33. package/dist/esm/types/components/icons/Coins.d.ts +4 -0
  34. package/dist/esm/types/components/icons/CompassRound.d.ts +12 -0
  35. package/dist/esm/types/components/icons/CrossAnimatedIcon.d.ts +7 -0
  36. package/dist/esm/types/components/icons/DockIcons.d.ts +10 -0
  37. package/dist/esm/types/components/icons/EmojiSad.d.ts +4 -0
  38. package/dist/esm/types/components/icons/HomeIcon.d.ts +16 -0
  39. package/dist/esm/types/components/icons/Social.d.ts +12 -0
  40. package/dist/esm/types/components/icons/SquidLogo.d.ts +4 -1
  41. package/dist/esm/types/components/icons/SwapInputs.d.ts +4 -0
  42. package/dist/esm/types/components/icons/Weather.d.ts +12 -0
  43. package/dist/esm/types/components/icons/index.d.ts +3 -0
  44. package/dist/esm/types/components/layout/CollapsibleMenu.d.ts +20 -0
  45. package/dist/esm/types/components/layout/index.d.ts +1 -0
  46. package/dist/esm/types/components/lists/TransactionItem.d.ts +8 -5
  47. package/dist/esm/types/core/constants.d.ts +4 -0
  48. package/dist/esm/types/core/design-system.d.ts +2 -0
  49. package/dist/esm/types/core/index.d.ts +3 -1
  50. package/dist/esm/types/hooks/index.d.ts +4 -0
  51. package/dist/esm/types/hooks/useCollapsibleMenu.d.ts +6 -0
  52. package/dist/esm/types/stories/badges/TransactionState.stories.d.ts +5 -0
  53. package/dist/esm/types/stories/buttons/IconButon.stories.d.ts +7 -0
  54. package/dist/esm/types/stories/lists/TransactionItem.stories.d.ts +5 -0
  55. package/dist/esm/types/types/components.d.ts +1 -1
  56. package/dist/esm/types/types/config.d.ts +6 -24
  57. package/dist/index.css +1 -1
  58. package/dist/index.d.ts +177 -14
  59. package/package.json +1 -1
@@ -1,11 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ActionStatus, TransactionStateVariant } from '../../types/components';
3
- export declare const statusBgClassMap: Record<ActionStatus, string>;
4
3
  export declare const statusTextClassMap: Record<ActionStatus, string>;
5
- export declare const statusColorClassMap: {
6
- bg: Record<ActionStatus, string>;
7
- text: Record<ActionStatus, string>;
8
- };
9
4
  interface TransactionStateProps extends React.HTMLAttributes<HTMLDivElement> {
10
5
  status: ActionStatus;
11
6
  variant?: TransactionStateVariant;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ interface IconButtonProps extends React.ComponentProps<'button'> {
3
+ icon: React.ReactNode;
4
+ }
5
+ export declare const IconButton: ({ icon, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1 +1,5 @@
1
- export declare function BagIcon(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function ShoppingBagIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function BackpackIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,3 +4,7 @@ export declare function Dollar({ className, size, }: {
4
4
  className?: string;
5
5
  size?: string;
6
6
  }): import("react/jsx-runtime").JSX.Element;
7
+ export declare function StocksIcon({ size, className, }: {
8
+ size?: string;
9
+ className?: string;
10
+ }): import("react/jsx-runtime").JSX.Element;
@@ -14,3 +14,15 @@ export declare function CirclePlusIcon({ size, className, }: {
14
14
  size?: string;
15
15
  className?: string;
16
16
  }): import("react/jsx-runtime").JSX.Element;
17
+ export declare function CircleXFilledIcon({ size, className, }: {
18
+ size?: string;
19
+ className?: string;
20
+ }): import("react/jsx-runtime").JSX.Element;
21
+ export declare function TranslateIcon({ size, className, }: {
22
+ size?: string;
23
+ className?: string;
24
+ }): import("react/jsx-runtime").JSX.Element;
25
+ export declare function PowerIcon({ size, className, }: {
26
+ size?: string;
27
+ className?: string;
28
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare function CrossAnimatedIcon({ size, isOpen, transitionDuration, className, }: {
3
+ size?: number;
4
+ isOpen?: boolean;
5
+ transitionDuration?: React.CSSProperties['transitionDuration'];
6
+ className?: string;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ interface DockIconProps {
2
+ isSelected?: boolean;
3
+ }
4
+ export declare function DockIconSwap({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function DockIconCheckout({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function DockIconScan({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function DockIconAnalytics({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function DockIconProfile({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DockIconHelp({ isSelected }: DockIconProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -6,3 +6,7 @@ export declare function EmojiMeh({ className, size, }: {
6
6
  className?: string;
7
7
  size?: string;
8
8
  }): import("react/jsx-runtime").JSX.Element;
9
+ export declare function SmileIcon({ size, className, }: {
10
+ size?: string;
11
+ className?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,19 @@
1
1
  export declare function HomeIcon({ className }: {
2
2
  className?: string;
3
3
  }): import("react/jsx-runtime").JSX.Element;
4
+ export declare function MenuSwapIcon({ size, className, }: {
5
+ size?: string;
6
+ className?: string;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export declare function ColorPaletteIcon({ size, className, }: {
9
+ size?: string;
10
+ className?: string;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ConsoleIcon({ size, className, }: {
13
+ size?: string;
14
+ className?: string;
15
+ }): import("react/jsx-runtime").JSX.Element;
16
+ export declare function BubblesIcon({ size, className, }: {
17
+ size?: string;
18
+ className?: string;
19
+ }): import("react/jsx-runtime").JSX.Element;
@@ -2,3 +2,15 @@ export declare function XSocial({ className, size, }: {
2
2
  size?: string;
3
3
  className?: string;
4
4
  }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function GithubIcon({ size, className, }: {
6
+ size?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DiscordIcon({ size, className, }: {
10
+ size?: string;
11
+ className?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ export declare function MirrorIcon({ size, className, }: {
14
+ size?: string;
15
+ className?: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,4 @@
1
- export declare function SquidLogo(): import("react/jsx-runtime").JSX.Element;
1
+ export declare function SquidLogo({ size, className, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,5 @@
1
1
  export declare function SwapInputsIcon(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function SwapIcon({ size, className, }: {
3
+ size?: string;
4
+ className?: string;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,12 @@
1
+ export declare function SunriseIcon({ size, className, }: {
2
+ size?: string;
3
+ className?: string;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export declare function SunIcon({ size, className, }: {
6
+ size?: string;
7
+ className?: string;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MoonIcon({ size, className, }: {
10
+ size?: string;
11
+ className?: string;
12
+ }): import("react/jsx-runtime").JSX.Element;
@@ -49,3 +49,6 @@ export * from './Timeline';
49
49
  export * from './TradingViewSteps';
50
50
  export * from './TriangleExclamation';
51
51
  export * from './Wallet';
52
+ export * from './CrossAnimatedIcon';
53
+ export * from './Weather';
54
+ export * from './DockIcons';
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ interface CollapsibleMenuProps {
3
+ menuRef: React.MutableRefObject<HTMLDivElement | null>;
4
+ size: {
5
+ open: {
6
+ width: string;
7
+ height: string;
8
+ };
9
+ closed: {
10
+ width: string;
11
+ height: string;
12
+ };
13
+ };
14
+ children?: React.ReactNode;
15
+ isOpen?: boolean;
16
+ transitionDuration?: React.CSSProperties['transitionDuration'];
17
+ className?: string;
18
+ }
19
+ export declare function CollapsibleMenu({ children, menuRef, isOpen, transitionDuration, size, className, }: CollapsibleMenuProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
@@ -15,6 +15,7 @@ export * from './Modal';
15
15
  export * from './ModalContent';
16
16
  export * from './NavigationBar';
17
17
  export * from './PipeSeparator';
18
+ export * from './CollapsibleMenu';
18
19
  export * from './ProductCard';
19
20
  export * from './ProfileHeaderBackground';
20
21
  export * from './SwapConfiguration';
@@ -1,14 +1,16 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { ActionStatus } from '../../types/components';
3
+ type TransactionItemVariant = 'compact' | 'full';
4
+ type TransactionItemType = {
5
+ icon?: ReactNode;
6
+ name: string;
7
+ };
3
8
  interface TransactionItemProps {
4
9
  className?: string;
5
10
  isLoading?: boolean;
6
11
  status?: ActionStatus;
7
12
  image?: ReactNode;
8
- type?: {
9
- icon?: ReactNode;
10
- name: string;
11
- };
13
+ type?: TransactionItemType;
12
14
  hash?: string;
13
15
  fromChain?: {
14
16
  logoURI: string;
@@ -21,6 +23,7 @@ interface TransactionItemProps {
21
23
  fromAmount?: string;
22
24
  toAmount?: string;
23
25
  timestamp?: number;
26
+ variant?: TransactionItemVariant;
24
27
  }
25
- export declare function TransactionItem({ className, isLoading, status, image, type, hash, fromChain, toChain, fromAmount, toAmount, timestamp, }: TransactionItemProps): import("react/jsx-runtime").JSX.Element;
28
+ export declare function TransactionItem({ className, isLoading, status, image, type, hash, fromChain, toChain, fromAmount, toAmount, timestamp, variant, }: TransactionItemProps): import("react/jsx-runtime").JSX.Element;
26
29
  export {};
@@ -14,6 +14,10 @@ export declare const CSS_VARS: {
14
14
  SLIDE_TO_BOTTOM_DURATION: string;
15
15
  BLUR_IN_DURATION: string;
16
16
  BLUR_OUT_DURATION: string;
17
+ COLLAPSIBLE_MENU_OPEN_WIDTH: string;
18
+ COLLAPSIBLE_MENU_OPEN_HEIGHT: string;
19
+ COLLAPSIBLE_MENU_CLOSED_WIDTH: string;
20
+ COLLAPSIBLE_MENU_CLOSED_HEIGHT: string;
17
21
  };
18
22
  export declare const ANIMATION_DURATIONS: {
19
23
  SHOW_ROUTE: number;
@@ -0,0 +1,2 @@
1
+ import type { Config } from 'tailwindcss';
2
+ export declare const baseTailwindConfig: Config;
@@ -1,2 +1,4 @@
1
- export { MEDIA_QUERIES } from './constants';
1
+ export { MEDIA_QUERIES, CSS_VARS } from './constants';
2
2
  export { darkTheme, lightTheme } from './themes';
3
+ export { baseTailwindConfig } from './design-system';
4
+ export { cn } from './utils';
@@ -1,2 +1,6 @@
1
1
  export * from './useDropdownMenu';
2
2
  export * from './useMediaQuery';
3
+ export * from './useCollapsibleMenu';
4
+ export * from './useRect';
5
+ export * from './useVersion';
6
+ export * from './useTimer';
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ export declare function useCollapsibleMenu(): {
3
+ isMenuOpen: boolean;
4
+ toggleMenu: () => void;
5
+ menuRef: import("react").RefObject<HTMLDivElement>;
6
+ };
@@ -5,11 +5,16 @@ export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Success: Story;
7
7
  export declare const SuccessCompact: Story;
8
+ export declare const SuccessSmall: Story;
8
9
  export declare const Fail: Story;
9
10
  export declare const FailCompact: Story;
11
+ export declare const FailSmall: Story;
10
12
  export declare const Processing: Story;
11
13
  export declare const ProcessingCompact: Story;
14
+ export declare const ProcessingSmall: Story;
12
15
  export declare const Waiting: Story;
13
16
  export declare const WaitingCompact: Story;
17
+ export declare const WaitingSmall: Story;
14
18
  export declare const Incomplete: Story;
15
19
  export declare const IncompleteCompact: Story;
20
+ export declare const IncompleteSmall: Story;
@@ -0,0 +1,7 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { IconButton } from '../../components/buttons/IconButton';
3
+ declare const meta: Meta<typeof IconButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const Disabled: Story;
@@ -4,7 +4,12 @@ declare const meta: Meta<typeof TransactionItem>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Swap: Story;
7
+ export declare const SwapCompact: Story;
7
8
  export declare const NFT: Story;
9
+ export declare const NFTCompact: Story;
8
10
  export declare const Bridge: Story;
11
+ export declare const BridgeCompact: Story;
9
12
  export declare const Approve: Story;
13
+ export declare const ApproveCompact: Story;
10
14
  export declare const Loading: Story;
15
+ export declare const LoadingCompact: Story;
@@ -32,7 +32,7 @@ export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
32
32
  export type ThemeType = 'light' | 'dark';
33
33
  export type ActionStatus = 'pending' | 'waiting' | 'ongoing' | 'executed' | 'success' | 'error' | 'warning';
34
34
  export type InputMode = 'token' | 'price';
35
- export type TransactionStateVariant = 'full' | 'compact';
35
+ export type TransactionStateVariant = 'full' | 'compact' | 'small';
36
36
  export type TokenPairVariant = 'horizontal' | 'vertical';
37
37
  export type TokenPairSize = 'small' | 'medium';
38
38
  export type ImageIconVariant = 'square' | 'round' | 'proportional';
@@ -2,30 +2,8 @@
2
2
  * The color format must be of type #FFFFFF
3
3
  */
4
4
  export type ColorType = `#${string}${string}${string}${string}${string}${string}`;
5
- export interface InternalSquidTheme {
6
- 'grey-100': string;
7
- 'grey-200': string;
8
- 'grey-300': string;
9
- 'grey-400': string;
10
- 'grey-500': string;
11
- 'grey-600': string;
12
- 'grey-700': string;
13
- 'grey-800': string;
14
- 'grey-900': string;
15
- 'royal-400': string;
16
- 'royal-500': string;
17
- 'status-positive': string;
18
- 'status-negative': string;
19
- 'status-partial': string;
20
- 'material-light-thin': string;
21
- 'material-light-average': string;
22
- 'material-light-thick': string;
23
- 'material-dark-thin': string;
24
- 'material-dark-average': string;
25
- 'material-dark-thick': string;
26
- 'grey-100-005': string;
27
- 'material-light-blend-grey-900': string;
28
- }
5
+ declare const INTERNAL_SQUID_THEME_KEYS: readonly ["grey-100", "grey-200", "grey-300", "grey-400", "grey-500", "grey-600", "grey-700", "grey-800", "grey-900", "royal-300", "royal-400", "royal-500", "royal-700", "status-positive", "status-negative", "status-partial", "material-light-thin", "material-light-average", "material-light-thick", "material-dark-thin", "material-dark-average", "material-dark-thick", "grey-100-005", "material-light-blend-grey-900", "volt-700"];
6
+ export type InternalSquidTheme = Record<(typeof INTERNAL_SQUID_THEME_KEYS)[number], string>;
29
7
  export type SquidTheme = {
30
8
  'content-100': string;
31
9
  'content-200': string;
@@ -36,11 +14,14 @@ export type SquidTheme = {
36
14
  'content-700': string;
37
15
  'content-800': string;
38
16
  'content-900': string;
17
+ 'accent-300': string;
39
18
  'accent-400': string;
40
19
  'accent-500': string;
20
+ 'accent-700': string;
41
21
  'status-positive': string;
42
22
  'status-negative': string;
43
23
  'status-warning': string;
24
+ 'highlight-700': string;
44
25
  };
45
26
  export declare const SQUID_THEME_CSS_VARIABLE_PREFIX = "--squid-theme-";
46
27
  /**
@@ -49,3 +30,4 @@ export declare const SQUID_THEME_CSS_VARIABLE_PREFIX = "--squid-theme-";
49
30
  export declare const themeTypesKeys: Record<keyof InternalSquidTheme, {
50
31
  cssVariable: string;
51
32
  }>;
33
+ export {};