@0xsquid/ui 0.25.1-beta.0 → 0.26.0-beta.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/index.js +923 -829
- package/dist/cjs/types/components/buttons/StopsButton.d.ts +13 -0
- package/dist/cjs/types/components/icons/Arrow.d.ts +12 -0
- package/dist/cjs/types/components/icons/CompassRound.d.ts +5 -1
- package/dist/cjs/types/components/layout/DetailsToolbar.d.ts +3 -11
- package/dist/cjs/types/components/lists/DropdownMenuItem.d.ts +2 -1
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/cjs/types/components/lists/ListItem.d.ts +5 -1
- package/dist/cjs/types/components/lists/PropertyListItem.d.ts +5 -1
- package/dist/cjs/types/components/lists/RouteStep.d.ts +9 -0
- package/dist/cjs/types/components/lists/index.d.ts +1 -0
- package/dist/cjs/types/hooks/useDropdownMenu.d.ts +9 -2
- package/dist/cjs/types/stories/buttons/StopsButton.stories.d.ts +10 -0
- package/dist/cjs/types/stories/layout/DetailsToolbar.stories.d.ts +3 -3
- package/dist/cjs/types/stories/lists/DropdownMenuItem.stories.d.ts +1 -0
- package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +1 -0
- package/dist/cjs/types/stories/lists/PropertyListItem.stories.d.ts +2 -0
- package/dist/cjs/types/stories/lists/RouteStep.stories.d.ts +7 -0
- package/dist/cjs/types/types/components.d.ts +1 -0
- package/dist/cjs/types/types/config.d.ts +1 -1
- package/dist/esm/index.js +917 -829
- package/dist/esm/types/components/buttons/StopsButton.d.ts +13 -0
- package/dist/esm/types/components/icons/Arrow.d.ts +12 -0
- package/dist/esm/types/components/icons/CompassRound.d.ts +5 -1
- package/dist/esm/types/components/layout/DetailsToolbar.d.ts +3 -11
- package/dist/esm/types/components/lists/DropdownMenuItem.d.ts +2 -1
- package/dist/esm/types/components/lists/HistoryItem.d.ts +1 -1
- package/dist/esm/types/components/lists/ListItem.d.ts +5 -1
- package/dist/esm/types/components/lists/PropertyListItem.d.ts +5 -1
- package/dist/esm/types/components/lists/RouteStep.d.ts +9 -0
- package/dist/esm/types/components/lists/index.d.ts +1 -0
- package/dist/esm/types/hooks/useDropdownMenu.d.ts +9 -2
- package/dist/esm/types/stories/buttons/StopsButton.stories.d.ts +10 -0
- package/dist/esm/types/stories/layout/DetailsToolbar.stories.d.ts +3 -3
- package/dist/esm/types/stories/lists/DropdownMenuItem.stories.d.ts +1 -0
- package/dist/esm/types/stories/lists/ListItem.stories.d.ts +1 -0
- package/dist/esm/types/stories/lists/PropertyListItem.stories.d.ts +2 -0
- package/dist/esm/types/stories/lists/RouteStep.stories.d.ts +7 -0
- package/dist/esm/types/types/components.d.ts +1 -0
- package/dist/esm/types/types/config.d.ts +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +58 -18
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TooltipProps } from '../controls';
|
|
3
|
+
export interface StopsProps extends React.ComponentProps<'button'> {
|
|
4
|
+
stopsCount?: string | number;
|
|
5
|
+
estimatedTime?: string;
|
|
6
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
7
|
+
providers: Provider[];
|
|
8
|
+
}
|
|
9
|
+
export declare function StopsButton({ stopsCount, estimatedTime, tooltip, providers, ...props }: StopsProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
type Provider = {
|
|
11
|
+
logoUrl: string;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -61,3 +61,15 @@ export declare function ArrowCornerDownRightIcon({ size, className, }: {
|
|
|
61
61
|
size?: string;
|
|
62
62
|
className?: string;
|
|
63
63
|
}): import("react/jsx-runtime").JSX.Element;
|
|
64
|
+
export declare function ChevronDownSmallIcon({ size, className, }: {
|
|
65
|
+
size?: string;
|
|
66
|
+
className?: string;
|
|
67
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare function ArrowDownIcon({ size, className, }: {
|
|
69
|
+
size?: string;
|
|
70
|
+
className?: string;
|
|
71
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare function ArrowSplit({ size, className, }: {
|
|
73
|
+
size?: string;
|
|
74
|
+
className?: string;
|
|
75
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function CompassRoundOutlinedIcon({ size, className, }: {
|
|
2
|
+
size?: string;
|
|
3
|
+
className?: string;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare function CompassRoundSolidIcon({ size, className, }: {
|
|
2
6
|
size?: string;
|
|
3
7
|
className?: string;
|
|
4
8
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StopsProps as StopsButtonProps } from '../buttons/StopsButton';
|
|
2
2
|
import { TooltipProps } from '../controls';
|
|
3
3
|
interface DetailsToolbarProps {
|
|
4
4
|
errorMessage?: string;
|
|
@@ -12,21 +12,13 @@ interface DetailsToolbarProps {
|
|
|
12
12
|
tooltip?: Omit<TooltipProps, 'children'>;
|
|
13
13
|
onClick: () => void;
|
|
14
14
|
};
|
|
15
|
-
estimatedTime?: string;
|
|
16
15
|
isLoading?: boolean;
|
|
17
16
|
isEmpty?: boolean;
|
|
18
17
|
helpButton?: {
|
|
19
18
|
label: string;
|
|
20
19
|
onClick: () => void;
|
|
21
20
|
};
|
|
22
|
-
|
|
23
|
-
tooltip?: Omit<TooltipProps, 'children'>;
|
|
24
|
-
onClick?: ({ boostMode }: {
|
|
25
|
-
boostMode: BoostMode;
|
|
26
|
-
}) => void;
|
|
27
|
-
canToggleBoostMode?: boolean;
|
|
28
|
-
boostMode?: BoostMode;
|
|
29
|
-
};
|
|
21
|
+
stopsButton?: StopsButtonProps;
|
|
30
22
|
}
|
|
31
|
-
export declare function DetailsToolbar({ errorMessage,
|
|
23
|
+
export declare function DetailsToolbar({ errorMessage, helpButton, isLoading, isEmpty, flipButton, feeButton, stopsButton, }: DetailsToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
32
24
|
export {};
|
|
@@ -5,5 +5,6 @@ export interface DropdownMenuItemProps {
|
|
|
5
5
|
imageUrl?: string;
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
onClick?: () => void;
|
|
8
|
+
link?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, link, }: DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,5 +15,5 @@ interface HistoryItemProps {
|
|
|
15
15
|
onClick?: () => void;
|
|
16
16
|
warningLabel?: string;
|
|
17
17
|
}
|
|
18
|
-
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare function HistoryItem({ firstImageUrl, secondImageUrl, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, dropdownMenuItems: _dropdownMenuItemsProp, itemsContainerRef, status, warningLabel, onClick, }: HistoryItemProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { DropdownMenuItemProps } from './DropdownMenuItem';
|
|
2
3
|
interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
4
|
itemTitle: string | React.ReactNode;
|
|
4
5
|
mainImageUrl?: string;
|
|
@@ -22,7 +23,10 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
22
23
|
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
23
24
|
compactOnMobile?: boolean;
|
|
24
25
|
extraPadding?: boolean;
|
|
26
|
+
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
27
|
+
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
25
28
|
}
|
|
26
29
|
type ListItemSize = 'small' | 'large';
|
|
27
|
-
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, placeholderImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, compactOnMobile, extraPadding, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, placeholderImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, compactOnMobile, extraPadding, itemsContainerRef, dropdownMenuItems: _dropdownMenuItemsProp, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const ListItemActionsButton: (props: React.ComponentProps<'button'>) => import("react/jsx-runtime").JSX.Element;
|
|
28
32
|
export {};
|
|
@@ -6,5 +6,9 @@ export interface PropertyListItemProps extends ComponentProps<'li'> {
|
|
|
6
6
|
icon?: React.ReactNode;
|
|
7
7
|
detail?: React.ReactNode;
|
|
8
8
|
variant?: PropertyListItemSize;
|
|
9
|
+
showGradientBg?: boolean;
|
|
10
|
+
labelClassName?: string;
|
|
11
|
+
iconClassName?: string;
|
|
12
|
+
detailClassName?: string;
|
|
9
13
|
}
|
|
10
|
-
export declare function PropertyListItem({ isLoading, label, detail, icon, className, variant, ...props }: PropertyListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function PropertyListItem({ isLoading, label, detail, icon, className, variant, showGradientBg, labelClassName, iconClassName, detailClassName, ...props }: PropertyListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DescriptionBlock } from '../../types/components';
|
|
2
|
+
interface RouteStepProps {
|
|
3
|
+
imageUrl: string;
|
|
4
|
+
descriptionBlocks: DescriptionBlock[];
|
|
5
|
+
subtitle: string;
|
|
6
|
+
showStepSeparator?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function RouteStep({ imageUrl, descriptionBlocks, subtitle, showStepSeparator, }: RouteStepProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { DropdownPosition } from '../types/components';
|
|
3
|
+
interface UseDropdownMenuParams {
|
|
3
4
|
initialIsModalOpen?: boolean;
|
|
4
|
-
|
|
5
|
+
itemsContainerRef?: React.RefObject<HTMLElement>;
|
|
6
|
+
}
|
|
7
|
+
export declare function useDropdownMenu(props?: UseDropdownMenuParams): {
|
|
5
8
|
isDropdownOpen: boolean;
|
|
6
9
|
openDropdown: () => void;
|
|
7
10
|
closeDropdown: () => void;
|
|
8
11
|
dropdownRef: React.RefObject<HTMLDivElement>;
|
|
9
12
|
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
13
|
+
dropdownPosition: DropdownPosition | null;
|
|
14
|
+
itemRef: React.RefObject<HTMLLIElement>;
|
|
15
|
+
menuRef: React.RefObject<HTMLDivElement>;
|
|
10
16
|
};
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { StopsButton } from '../../components/buttons/StopsButton';
|
|
3
|
+
declare const meta: Meta<typeof StopsButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const OneProvider: Story;
|
|
7
|
+
export declare const TwoProviders: Story;
|
|
8
|
+
export declare const ThreeProviders: Story;
|
|
9
|
+
export declare const FourProviders: Story;
|
|
10
|
+
export declare const TenProviders: Story;
|
|
@@ -9,9 +9,9 @@ export declare const Empty: Story;
|
|
|
9
9
|
export declare const EmptyLoading: Story;
|
|
10
10
|
export declare const Error: Story;
|
|
11
11
|
export declare const ErrorHelpButton: Story;
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
12
|
+
export declare const StopsButtonWithTooltip: Story;
|
|
13
|
+
export declare const StopsButtonDisabledWithTooltip: Story;
|
|
14
|
+
export declare const StopsButtonWithDelayedTooltip: Story;
|
|
15
15
|
export declare const FlipButtonWithTooltip: Story;
|
|
16
16
|
export declare const FlipButtonDisabled: Story;
|
|
17
17
|
export declare const FeeButtonTooltip: Story;
|
|
@@ -4,6 +4,8 @@ declare const meta: Meta<typeof PropertyListItem>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const WithoutGradient: Story;
|
|
8
|
+
export declare const CustomColors: Story;
|
|
7
9
|
export declare const TextDetail: Story;
|
|
8
10
|
export declare const CustomDetail: Story;
|
|
9
11
|
export declare const Loading: Story;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { RouteStep } from '../../components/lists/RouteStep';
|
|
3
|
+
declare const meta: Meta<typeof RouteStep>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithStepSeparator: Story;
|
|
@@ -41,3 +41,4 @@ export type ChainTypeFilter = 'source' | 'destination';
|
|
|
41
41
|
export type StatusFilter = 'success' | 'ongoing' | 'error';
|
|
42
42
|
export type AssetsButtonVariant = 'primary' | 'accent';
|
|
43
43
|
export type PropertyListItemSize = 'small' | 'large';
|
|
44
|
+
export type DropdownPosition = 'top' | 'bottom' | 'center';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The color format must be of type #FFFFFF
|
|
3
3
|
*/
|
|
4
4
|
export type ColorType = `#${string}${string}${string}${string}${string}${string}`;
|
|
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"];
|
|
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", "material-light-blend-grey-800", "volt-700"];
|
|
6
6
|
export type InternalSquidTheme = Record<(typeof INTERNAL_SQUID_THEME_KEYS)[number], string>;
|
|
7
7
|
export type SquidTheme = {
|
|
8
8
|
'content-100': string;
|