@0xsquid/ui 0.15.4 → 0.15.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 +58 -27
- package/dist/cjs/types/components/lists/ListItem.d.ts +2 -1
- package/dist/cjs/types/components/lists/SwapStepItem.d.ts +1 -0
- package/dist/cjs/types/stories/layout/SwapStepsCollapsed.stories.d.ts +1 -0
- package/dist/cjs/types/stories/lists/ListItem.stories.d.ts +2 -0
- package/dist/cjs/types/stories/lists/SwapStepItem.stories.d.ts +1 -0
- package/dist/cjs/types/stories/views/SwapProgressView.stories.d.ts +1 -0
- package/dist/esm/index.js +58 -28
- package/dist/esm/types/components/lists/ListItem.d.ts +2 -1
- package/dist/esm/types/components/lists/SwapStepItem.d.ts +1 -0
- package/dist/esm/types/stories/layout/SwapStepsCollapsed.stories.d.ts +1 -0
- package/dist/esm/types/stories/lists/ListItem.stories.d.ts +2 -0
- package/dist/esm/types/stories/lists/SwapStepItem.stories.d.ts +1 -0
- package/dist/esm/types/stories/views/SwapProgressView.stories.d.ts +1 -0
- package/dist/index.css +29 -17
- package/dist/index.d.ts +4 -2
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -6648,8 +6648,9 @@ const listItemSizeMap = {
|
|
|
6648
6648
|
small: 'tw-h-list-item-small tw-px-squid-xs',
|
|
6649
6649
|
large: 'tw-h-list-item-large tw-px-squid-xs',
|
|
6650
6650
|
};
|
|
6651
|
+
const subtitleClassName = 'tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500';
|
|
6651
6652
|
function ListItem(_a) {
|
|
6652
|
-
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
|
|
6653
|
+
var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
|
|
6653
6654
|
// 'small' variant does not have detail
|
|
6654
6655
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
6655
6656
|
const isDetailInteractive = !!onDetailClick;
|
|
@@ -6669,7 +6670,7 @@ function ListItem(_a) {
|
|
|
6669
6670
|
return (jsxRuntime.jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsxRuntime.jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
|
|
6670
6671
|
// 'large' variant has extra padding
|
|
6671
6672
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
6672
|
-
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.
|
|
6673
|
+
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover }), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6673
6674
|
? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
|
|
6674
6675
|
: 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
|
|
6675
6676
|
}
|
|
@@ -6714,6 +6715,7 @@ function SwapStepSeparator() {
|
|
|
6714
6715
|
return (jsxRuntime.jsx("span", { className: "tw-flex tw-h-squid-m tw-w-squid-xxl tw-items-center tw-justify-center tw-self-stretch tw-py-0.5", children: jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "4", height: "21", viewBox: "0 0 4 21", fill: "none", children: jsxRuntime.jsx("path", { d: "M2 2.5V18.5", stroke: "currentColor", "stroke-width": "4", "stroke-linecap": "round" }) }) }));
|
|
6715
6716
|
}
|
|
6716
6717
|
|
|
6718
|
+
const STEP_ITEM_HEIGHT = 52;
|
|
6717
6719
|
const statusBgClassMap = {
|
|
6718
6720
|
executed: '!tw-bg-grey-300',
|
|
6719
6721
|
ongoing: '!tw-bg-grey-300',
|
|
@@ -6765,23 +6767,26 @@ function SwapStepItem({ descriptionBlocks, showStepSeparator = false, link, stat
|
|
|
6765
6767
|
return 'tw-text-grey-300';
|
|
6766
6768
|
}
|
|
6767
6769
|
}, [status]);
|
|
6768
|
-
return (jsxRuntime.
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6770
|
+
return (jsxRuntime.jsx("li", { style: {
|
|
6771
|
+
maxHeight: `${STEP_ITEM_HEIGHT}px`,
|
|
6772
|
+
minHeight: `${STEP_ITEM_HEIGHT}px`,
|
|
6773
|
+
}, className: "tw-relative tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-justify-center tw-text-grey-300 tw-transition-colors tw-duration-1000", children: jsxRuntime.jsxs("a", { href: link, target: "_blank", style: Object.assign(Object.assign({}, transitionStyle), { maxHeight: `${STEP_ITEM_HEIGHT}px` }), className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs tw-py-squid-xxs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsxRuntime.jsxs("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: [jsxRuntime.jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }), showStepSeparator && (jsxRuntime.jsx("span", { className: cn(separatorClassMap[status], 'tw-absolute tw-left-0 tw-top-full tw-mt-0.5'), style: transitionStyle, children: jsxRuntime.jsx(SwapStepSeparator, {}) }))] }), jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs tw-pr-squid-xs", children: descriptionBlocks.map((block, index) => {
|
|
6774
|
+
const { type, value } = block;
|
|
6775
|
+
if (type === 'string') {
|
|
6776
|
+
return (
|
|
6777
|
+
// Instead of displaying the string into a single <BodyText />
|
|
6778
|
+
// we split it into multiple <BodyText />
|
|
6779
|
+
// for edge case where the string is too long to fit in one line
|
|
6780
|
+
value
|
|
6781
|
+
.trim()
|
|
6782
|
+
.split(' ')
|
|
6783
|
+
.map((word, i) => (jsxRuntime.jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
|
|
6784
|
+
}
|
|
6785
|
+
else if (type === 'image') {
|
|
6786
|
+
return (jsxRuntime.jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
|
|
6787
|
+
}
|
|
6788
|
+
return null;
|
|
6789
|
+
}) })] }) }));
|
|
6785
6790
|
}
|
|
6786
6791
|
|
|
6787
6792
|
const borderRadiusClassMap = {
|
|
@@ -6896,9 +6901,10 @@ function SwapProgressViewHeader({ title, description, }) {
|
|
|
6896
6901
|
return (jsxRuntime.jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsxRuntime.jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsxRuntime.jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
|
|
6897
6902
|
}
|
|
6898
6903
|
|
|
6904
|
+
const STEPS_LIST_HEIGHT = 400;
|
|
6899
6905
|
const SwapStepsCollapsed = React.forwardRef((props, ref) => {
|
|
6900
6906
|
const { steps, currentStepIndex: _newStepIndex, onOpen, onClose, footerButton, } = props;
|
|
6901
|
-
const newStepIndex = Math.round(_newStepIndex);
|
|
6907
|
+
const newStepIndex = Math.round(_newStepIndex < 0 ? 0 : _newStepIndex);
|
|
6902
6908
|
React.useImperativeHandle(ref, () => ({
|
|
6903
6909
|
handleToggleRouteSteps,
|
|
6904
6910
|
}));
|
|
@@ -6918,6 +6924,16 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
|
|
|
6918
6924
|
clearTimeout(timeoutId);
|
|
6919
6925
|
};
|
|
6920
6926
|
}, [isShowRouteAnimationRunning]);
|
|
6927
|
+
React.useEffect(() => {
|
|
6928
|
+
var _a;
|
|
6929
|
+
if (!isRouteVisible)
|
|
6930
|
+
return;
|
|
6931
|
+
// scroll in the steps list so the current step is visible at the middle
|
|
6932
|
+
(_a = routeStepsListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
6933
|
+
top: -((newStepIndex - 1) * STEP_ITEM_HEIGHT) + STEPS_LIST_HEIGHT / 2,
|
|
6934
|
+
behavior: 'smooth',
|
|
6935
|
+
});
|
|
6936
|
+
}, [newStepIndex]);
|
|
6921
6937
|
const routeStepsListRef = React.useRef(null);
|
|
6922
6938
|
const handleToggleRouteSteps = () => {
|
|
6923
6939
|
if (isRouteVisible) {
|
|
@@ -6948,9 +6964,13 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
|
|
|
6948
6964
|
}, onClick: handleToggleRouteSteps, className: "tw-absolute tw-inset-0 tw-h-[60px] tw-cursor-pointer tw-rounded-squid-l tw-border tw-border-material-light-thin" }), jsxRuntime.jsx("div", { onClick: isShowRouteAnimationRunning ? undefined : handleToggleRouteSteps, style: {
|
|
6949
6965
|
[CSS_VARS.COLLAPSE_ROUTE_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
|
|
6950
6966
|
[CSS_VARS.EXPAND_ROUTE_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
|
|
6951
|
-
}, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl',
|
|
6952
|
-
|
|
6953
|
-
|
|
6967
|
+
}, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isRouteVisible &&
|
|
6968
|
+
(isShowRouteAnimationRunning
|
|
6969
|
+
? 'tw-animate-expand-route'
|
|
6970
|
+
: 'tw-animate-collapse-route')), children: jsxRuntime.jsxs("div", { className: cn('tw-flex tw-flex-col tw-gap-squid-xxs', isRouteVisible || isShowRouteAnimationRunning
|
|
6971
|
+
? 'tw-max-h-[535px]'
|
|
6972
|
+
: ''), style: {
|
|
6973
|
+
paddingTop: `${STEP_ITEM_HEIGHT}px`,
|
|
6954
6974
|
transition: isShowRouteAnimationRunning
|
|
6955
6975
|
? `transform ${ANIMATION_DURATIONS.SHOW_ROUTE}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`
|
|
6956
6976
|
: isRouteVisible
|
|
@@ -6958,13 +6978,16 @@ const SwapStepsCollapsed = React.forwardRef((props, ref) => {
|
|
|
6958
6978
|
: `transform ${ANIMATION_DURATIONS.CHANGE_SWAP_STEP}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`,
|
|
6959
6979
|
transform: isShowRouteAnimationRunning
|
|
6960
6980
|
? 'translateY(0)'
|
|
6961
|
-
: `translateY(calc(-100% +
|
|
6962
|
-
}, children: [jsxRuntime.jsx("div", {
|
|
6981
|
+
: `translateY(calc(-100% + 69px + ${(newStepIndex + 1) * STEP_ITEM_HEIGHT}px))`,
|
|
6982
|
+
}, children: [jsxRuntime.jsx("div", { style: {
|
|
6983
|
+
display: isRouteVisible ? 'flex' : 'none',
|
|
6984
|
+
height: `${STEP_ITEM_HEIGHT}px`,
|
|
6985
|
+
}, className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-800 tw-p-squid-xs'), children: jsxRuntime.jsx("button", { onClick: handleToggleRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsxRuntime.jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsxRuntime.jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsxRuntime.jsx("ul", { ref: routeStepsListRef, style: {
|
|
6963
6986
|
zIndex: isRouteVisible ? 0 : -10,
|
|
6964
6987
|
scrollbarWidth: 'none',
|
|
6965
|
-
}, className: "tw-relative tw-flex
|
|
6988
|
+
}, className: "tw-relative tw-flex tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-pb-squid-xxs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
|
|
6966
6989
|
// show separator for all steps except the first one
|
|
6967
|
-
showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-
|
|
6990
|
+
showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-max-h-[55px] tw-min-h-[55px] tw-w-full tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-s tw-pb-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
|
|
6968
6991
|
});
|
|
6969
6992
|
|
|
6970
6993
|
function TokenPair({ firstToken, secondToken }) {
|
|
@@ -42361,6 +42384,13 @@ const TrackTransactionView = React.forwardRef((props, ref) => {
|
|
|
42361
42384
|
currentStepIndex: rawSteps.length - 1,
|
|
42362
42385
|
};
|
|
42363
42386
|
}
|
|
42387
|
+
if (swapState === SwapState.ERROR) {
|
|
42388
|
+
const firstErrorStepIndex = rawSteps.findIndex((s) => s.status === 'error');
|
|
42389
|
+
return {
|
|
42390
|
+
steps: rawSteps,
|
|
42391
|
+
currentStepIndex: firstErrorStepIndex,
|
|
42392
|
+
};
|
|
42393
|
+
}
|
|
42364
42394
|
return {
|
|
42365
42395
|
steps: rawSteps,
|
|
42366
42396
|
currentStepIndex: 0,
|
|
@@ -42591,6 +42621,7 @@ exports.NavigationBar = NavigationBar;
|
|
|
42591
42621
|
exports.NumericInput = NumericInput;
|
|
42592
42622
|
exports.ProductCard = ProductCard;
|
|
42593
42623
|
exports.ProfileHeaderBackground = ProfileHeaderBackground;
|
|
42624
|
+
exports.STEP_ITEM_HEIGHT = STEP_ITEM_HEIGHT;
|
|
42594
42625
|
exports.SectionTitle = SectionTitle;
|
|
42595
42626
|
exports.SettingsButton = SettingsButton;
|
|
42596
42627
|
exports.SettingsItem = SettingsItem;
|
|
@@ -4,6 +4,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
4
4
|
mainImageUrl?: string;
|
|
5
5
|
secondaryImageUrl?: string;
|
|
6
6
|
subtitle?: string;
|
|
7
|
+
subtitleOnHover?: React.ReactNode;
|
|
7
8
|
detail?: string;
|
|
8
9
|
icon?: React.ReactNode;
|
|
9
10
|
size?: ListItemSize;
|
|
@@ -20,5 +21,5 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
20
21
|
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
21
22
|
}
|
|
22
23
|
type ListItemSize = 'small' | 'large';
|
|
23
|
-
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -5,5 +5,6 @@ interface SwapStepItemProps {
|
|
|
5
5
|
link?: string;
|
|
6
6
|
status?: SwapStepItemStatus;
|
|
7
7
|
}
|
|
8
|
+
export declare const STEP_ITEM_HEIGHT = 52;
|
|
8
9
|
export declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -9,6 +9,8 @@ export declare const LargeWithLongTitle: Story;
|
|
|
9
9
|
export declare const LargeWithLongTitleAndSubtitle: Story;
|
|
10
10
|
export declare const LargeRoundedFull: Story;
|
|
11
11
|
export declare const LargeWithSubtitle: Story;
|
|
12
|
+
export declare const SubtitleOnHover: Story;
|
|
13
|
+
export declare const SubtitleOnHoverTokenBalance: Story;
|
|
12
14
|
export declare const LargeWithDetail: Story;
|
|
13
15
|
export declare const LargeWithIcon: Story;
|
|
14
16
|
export declare const LargeWithDetailAndIconInteractive: Story;
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Executed: Story;
|
|
7
7
|
export declare const ExecutedWithSeparator: Story;
|
|
8
|
+
export declare const ExecutedWithSeparatorAndLink: Story;
|
|
8
9
|
export declare const Success: Story;
|
|
9
10
|
export declare const SuccessWithSeparator: Story;
|
|
10
11
|
export declare const Pending: Story;
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const WithControls: Story;
|
|
7
7
|
export declare const ShortRoute: Story;
|
|
8
|
+
export declare const LongDescriptionSteps: Story;
|
|
8
9
|
export declare const LongRoute: Story;
|
|
9
10
|
export declare const Completed: Story;
|
|
10
11
|
export declare const Error: Story;
|
package/dist/esm/index.js
CHANGED
|
@@ -6628,8 +6628,9 @@ const listItemSizeMap = {
|
|
|
6628
6628
|
small: 'tw-h-list-item-small tw-px-squid-xs',
|
|
6629
6629
|
large: 'tw-h-list-item-large tw-px-squid-xs',
|
|
6630
6630
|
};
|
|
6631
|
+
const subtitleClassName = 'tw-h-[14px] tw-max-w-full tw-truncate !tw-leading-[16px] tw-text-grey-500';
|
|
6631
6632
|
function ListItem(_a) {
|
|
6632
|
-
var { itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
|
|
6633
|
+
var { itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size = 'large', mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded = false, detailButtonClassName, loading, containerProps } = _a, props = __rest(_a, ["itemTitle", "mainImageUrl", "subtitle", "subtitleOnHover", "detail", "icon", "secondaryImageUrl", "size", "mainIcon", "className", "isSelected", "onDetailClick", "showDetailOnHoverOnly", "rounded", "detailButtonClassName", "loading", "containerProps"]);
|
|
6633
6634
|
// 'small' variant does not have detail
|
|
6634
6635
|
const showDetail = size === 'large' && (!!detail || !!icon || showDetailOnHoverOnly);
|
|
6635
6636
|
const isDetailInteractive = !!onDetailClick;
|
|
@@ -6649,7 +6650,7 @@ function ListItem(_a) {
|
|
|
6649
6650
|
return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
|
|
6650
6651
|
// 'large' variant has extra padding
|
|
6651
6652
|
size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
|
|
6652
|
-
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (
|
|
6653
|
+
((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover }), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
|
|
6653
6654
|
? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
|
|
6654
6655
|
: 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
|
|
6655
6656
|
}
|
|
@@ -6694,6 +6695,7 @@ function SwapStepSeparator() {
|
|
|
6694
6695
|
return (jsx("span", { className: "tw-flex tw-h-squid-m tw-w-squid-xxl tw-items-center tw-justify-center tw-self-stretch tw-py-0.5", children: jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "4", height: "21", viewBox: "0 0 4 21", fill: "none", children: jsx("path", { d: "M2 2.5V18.5", stroke: "currentColor", "stroke-width": "4", "stroke-linecap": "round" }) }) }));
|
|
6695
6696
|
}
|
|
6696
6697
|
|
|
6698
|
+
const STEP_ITEM_HEIGHT = 52;
|
|
6697
6699
|
const statusBgClassMap = {
|
|
6698
6700
|
executed: '!tw-bg-grey-300',
|
|
6699
6701
|
ongoing: '!tw-bg-grey-300',
|
|
@@ -6745,23 +6747,26 @@ function SwapStepItem({ descriptionBlocks, showStepSeparator = false, link, stat
|
|
|
6745
6747
|
return 'tw-text-grey-300';
|
|
6746
6748
|
}
|
|
6747
6749
|
}, [status]);
|
|
6748
|
-
return (
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6750
|
+
return (jsx("li", { style: {
|
|
6751
|
+
maxHeight: `${STEP_ITEM_HEIGHT}px`,
|
|
6752
|
+
minHeight: `${STEP_ITEM_HEIGHT}px`,
|
|
6753
|
+
}, className: "tw-relative tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-justify-center tw-text-grey-300 tw-transition-colors tw-duration-1000", children: jsxs("a", { href: link, target: "_blank", style: Object.assign(Object.assign({}, transitionStyle), { maxHeight: `${STEP_ITEM_HEIGHT}px` }), className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs tw-py-squid-xxs', !!link && 'hover:tw-bg-material-light-thin', statusTextClass), children: [jsxs("span", { className: "tw-relative tw-flex tw-min-h-squid-l tw-items-center tw-justify-center tw-gap-squid-xxs tw-px-squid-xs", children: [jsx(Chip, { style: transitionStyle, className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: chipContent }), showStepSeparator && (jsx("span", { className: cn(separatorClassMap[status], 'tw-absolute tw-left-0 tw-top-full tw-mt-0.5'), style: transitionStyle, children: jsx(SwapStepSeparator, {}) }))] }), jsx("div", { className: "tw-flex tw-min-h-squid-l tw-flex-1 tw-flex-wrap tw-items-center tw-justify-start tw-gap-squid-xxs tw-py-squid-xxs tw-pr-squid-xs", children: descriptionBlocks.map((block, index) => {
|
|
6754
|
+
const { type, value } = block;
|
|
6755
|
+
if (type === 'string') {
|
|
6756
|
+
return (
|
|
6757
|
+
// Instead of displaying the string into a single <BodyText />
|
|
6758
|
+
// we split it into multiple <BodyText />
|
|
6759
|
+
// for edge case where the string is too long to fit in one line
|
|
6760
|
+
value
|
|
6761
|
+
.trim()
|
|
6762
|
+
.split(' ')
|
|
6763
|
+
.map((word, i) => (jsx(BodyText, { size: "small", className: "!tw-leading-[13px]", children: word }, i))));
|
|
6764
|
+
}
|
|
6765
|
+
else if (type === 'image') {
|
|
6766
|
+
return (jsx("img", { src: value, className: cn('tw-h-squid-m tw-w-squid-m', block.rounded ? 'tw-rounded-full' : 'tw-rounded-squid-xxs') }, index));
|
|
6767
|
+
}
|
|
6768
|
+
return null;
|
|
6769
|
+
}) })] }) }));
|
|
6765
6770
|
}
|
|
6766
6771
|
|
|
6767
6772
|
const borderRadiusClassMap = {
|
|
@@ -6876,9 +6881,10 @@ function SwapProgressViewHeader({ title, description, }) {
|
|
|
6876
6881
|
return (jsxs("header", { className: "tw-flex tw-h-[95px] tw-w-full tw-flex-col tw-gap-squid-s tw-bg-grey-800 tw-px-squid-m tw-py-squid-s", children: [jsx(BodyText, { size: "large", className: "tw-h-squid-m !tw-leading-[20px] tw-text-grey-300", children: title }), jsx(CaptionText, { className: "tw-h-squid-l tw-text-grey-500", children: description })] }));
|
|
6877
6882
|
}
|
|
6878
6883
|
|
|
6884
|
+
const STEPS_LIST_HEIGHT = 400;
|
|
6879
6885
|
const SwapStepsCollapsed = forwardRef((props, ref) => {
|
|
6880
6886
|
const { steps, currentStepIndex: _newStepIndex, onOpen, onClose, footerButton, } = props;
|
|
6881
|
-
const newStepIndex = Math.round(_newStepIndex);
|
|
6887
|
+
const newStepIndex = Math.round(_newStepIndex < 0 ? 0 : _newStepIndex);
|
|
6882
6888
|
useImperativeHandle(ref, () => ({
|
|
6883
6889
|
handleToggleRouteSteps,
|
|
6884
6890
|
}));
|
|
@@ -6898,6 +6904,16 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
|
|
|
6898
6904
|
clearTimeout(timeoutId);
|
|
6899
6905
|
};
|
|
6900
6906
|
}, [isShowRouteAnimationRunning]);
|
|
6907
|
+
useEffect(() => {
|
|
6908
|
+
var _a;
|
|
6909
|
+
if (!isRouteVisible)
|
|
6910
|
+
return;
|
|
6911
|
+
// scroll in the steps list so the current step is visible at the middle
|
|
6912
|
+
(_a = routeStepsListRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
6913
|
+
top: -((newStepIndex - 1) * STEP_ITEM_HEIGHT) + STEPS_LIST_HEIGHT / 2,
|
|
6914
|
+
behavior: 'smooth',
|
|
6915
|
+
});
|
|
6916
|
+
}, [newStepIndex]);
|
|
6901
6917
|
const routeStepsListRef = useRef(null);
|
|
6902
6918
|
const handleToggleRouteSteps = () => {
|
|
6903
6919
|
if (isRouteVisible) {
|
|
@@ -6928,9 +6944,13 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
|
|
|
6928
6944
|
}, onClick: handleToggleRouteSteps, className: "tw-absolute tw-inset-0 tw-h-[60px] tw-cursor-pointer tw-rounded-squid-l tw-border tw-border-material-light-thin" }), jsx("div", { onClick: isShowRouteAnimationRunning ? undefined : handleToggleRouteSteps, style: {
|
|
6929
6945
|
[CSS_VARS.COLLAPSE_ROUTE_DURATION]: `${ANIMATION_DURATIONS.HIDE_ROUTE}ms`,
|
|
6930
6946
|
[CSS_VARS.EXPAND_ROUTE_DURATION]: `${ANIMATION_DURATIONS.SHOW_ROUTE}ms`,
|
|
6931
|
-
}, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl',
|
|
6932
|
-
|
|
6933
|
-
|
|
6947
|
+
}, className: cn('tw-relative tw-h-[60px] tw-max-h-[535px] tw-w-full tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isRouteVisible &&
|
|
6948
|
+
(isShowRouteAnimationRunning
|
|
6949
|
+
? 'tw-animate-expand-route'
|
|
6950
|
+
: 'tw-animate-collapse-route')), children: jsxs("div", { className: cn('tw-flex tw-flex-col tw-gap-squid-xxs', isRouteVisible || isShowRouteAnimationRunning
|
|
6951
|
+
? 'tw-max-h-[535px]'
|
|
6952
|
+
: ''), style: {
|
|
6953
|
+
paddingTop: `${STEP_ITEM_HEIGHT}px`,
|
|
6934
6954
|
transition: isShowRouteAnimationRunning
|
|
6935
6955
|
? `transform ${ANIMATION_DURATIONS.SHOW_ROUTE}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`
|
|
6936
6956
|
: isRouteVisible
|
|
@@ -6938,13 +6958,16 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
|
|
|
6938
6958
|
: `transform ${ANIMATION_DURATIONS.CHANGE_SWAP_STEP}ms ${ANIMATION_TIMINGS.CHANGE_SWAP_STEP}`,
|
|
6939
6959
|
transform: isShowRouteAnimationRunning
|
|
6940
6960
|
? 'translateY(0)'
|
|
6941
|
-
: `translateY(calc(-100% +
|
|
6942
|
-
}, children: [jsx("div", {
|
|
6961
|
+
: `translateY(calc(-100% + 69px + ${(newStepIndex + 1) * STEP_ITEM_HEIGHT}px))`,
|
|
6962
|
+
}, children: [jsx("div", { style: {
|
|
6963
|
+
display: isRouteVisible ? 'flex' : 'none',
|
|
6964
|
+
height: `${STEP_ITEM_HEIGHT}px`,
|
|
6965
|
+
}, className: cn('tw-absolute tw-top-0 tw-z-10 tw-flex tw-w-full tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-bg-grey-800 tw-p-squid-xs'), children: jsx("button", { onClick: handleToggleRouteSteps, className: "tw-flex tw-h-squid-xl tw-w-40 tw-items-center tw-justify-center tw-rounded-squid-xs tw-px-10 hover:tw-bg-material-light-thin", children: jsx("span", { className: "tw-flex tw-h-8 tw-w-8 tw-items-center tw-justify-center tw-text-grey-300", children: jsx(ChevronLargeDownIcon, { size: "32" }) }) }) }), jsx("ul", { ref: routeStepsListRef, style: {
|
|
6943
6966
|
zIndex: isRouteVisible ? 0 : -10,
|
|
6944
6967
|
scrollbarWidth: 'none',
|
|
6945
|
-
}, className: "tw-relative tw-flex
|
|
6968
|
+
}, className: "tw-relative tw-flex tw-w-[400px] tw-flex-1 tw-grow-0 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs tw-pb-squid-xxs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks,
|
|
6946
6969
|
// show separator for all steps except the first one
|
|
6947
|
-
showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsx("footer", { className: "tw-flex tw-
|
|
6970
|
+
showStepSeparator: index > 0, link: step.link, status: newStepIndex < index ? 'pending' : step.status }, index))) }), jsx("footer", { className: "tw-flex tw-max-h-[55px] tw-min-h-[55px] tw-w-full tw-justify-center tw-gap-squid-xs tw-self-stretch tw-px-squid-s tw-pb-squid-s", children: jsx(Button, { size: "md", variant: "secondary", onClick: footerButton === null || footerButton === void 0 ? void 0 : footerButton.onClick, link: footerButton === null || footerButton === void 0 ? void 0 : footerButton.link, label: footerButton === null || footerButton === void 0 ? void 0 : footerButton.label, className: "tw-w-full" }) })] }) })] }) }) }));
|
|
6948
6971
|
});
|
|
6949
6972
|
|
|
6950
6973
|
function TokenPair({ firstToken, secondToken }) {
|
|
@@ -42341,6 +42364,13 @@ const TrackTransactionView = forwardRef((props, ref) => {
|
|
|
42341
42364
|
currentStepIndex: rawSteps.length - 1,
|
|
42342
42365
|
};
|
|
42343
42366
|
}
|
|
42367
|
+
if (swapState === SwapState.ERROR) {
|
|
42368
|
+
const firstErrorStepIndex = rawSteps.findIndex((s) => s.status === 'error');
|
|
42369
|
+
return {
|
|
42370
|
+
steps: rawSteps,
|
|
42371
|
+
currentStepIndex: firstErrorStepIndex,
|
|
42372
|
+
};
|
|
42373
|
+
}
|
|
42344
42374
|
return {
|
|
42345
42375
|
steps: rawSteps,
|
|
42346
42376
|
currentStepIndex: 0,
|
|
@@ -42540,4 +42570,4 @@ function SquidConfigProvider({ theme = lightTheme, children, themeType = 'light'
|
|
|
42540
42570
|
return (jsx("div", { style: parsedStyle, "data-squid-theme-type": themeType, className: "tw-group tw-relative tw-font-geist", children: children }));
|
|
42541
42571
|
}
|
|
42542
42572
|
|
|
42543
|
-
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
|
|
42573
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, SettingsItem, SettingsSlider, SquidConfigProvider, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, UsdAmount, useDropdownMenu };
|
|
@@ -4,6 +4,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
4
4
|
mainImageUrl?: string;
|
|
5
5
|
secondaryImageUrl?: string;
|
|
6
6
|
subtitle?: string;
|
|
7
|
+
subtitleOnHover?: React.ReactNode;
|
|
7
8
|
detail?: string;
|
|
8
9
|
icon?: React.ReactNode;
|
|
9
10
|
size?: ListItemSize;
|
|
@@ -20,5 +21,5 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
20
21
|
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
21
22
|
}
|
|
22
23
|
type ListItemSize = 'small' | 'large';
|
|
23
|
-
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -5,5 +5,6 @@ interface SwapStepItemProps {
|
|
|
5
5
|
link?: string;
|
|
6
6
|
status?: SwapStepItemStatus;
|
|
7
7
|
}
|
|
8
|
+
export declare const STEP_ITEM_HEIGHT = 52;
|
|
8
9
|
export declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
|
|
9
10
|
export {};
|
|
@@ -9,6 +9,8 @@ export declare const LargeWithLongTitle: Story;
|
|
|
9
9
|
export declare const LargeWithLongTitleAndSubtitle: Story;
|
|
10
10
|
export declare const LargeRoundedFull: Story;
|
|
11
11
|
export declare const LargeWithSubtitle: Story;
|
|
12
|
+
export declare const SubtitleOnHover: Story;
|
|
13
|
+
export declare const SubtitleOnHoverTokenBalance: Story;
|
|
12
14
|
export declare const LargeWithDetail: Story;
|
|
13
15
|
export declare const LargeWithIcon: Story;
|
|
14
16
|
export declare const LargeWithDetailAndIconInteractive: Story;
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Executed: Story;
|
|
7
7
|
export declare const ExecutedWithSeparator: Story;
|
|
8
|
+
export declare const ExecutedWithSeparatorAndLink: Story;
|
|
8
9
|
export declare const Success: Story;
|
|
9
10
|
export declare const SuccessWithSeparator: Story;
|
|
10
11
|
export declare const Pending: Story;
|
|
@@ -5,6 +5,7 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const WithControls: Story;
|
|
7
7
|
export declare const ShortRoute: Story;
|
|
8
|
+
export declare const LongDescriptionSteps: Story;
|
|
8
9
|
export declare const LongRoute: Story;
|
|
9
10
|
export declare const Completed: Story;
|
|
10
11
|
export declare const Error: Story;
|
package/dist/index.css
CHANGED
|
@@ -741,6 +741,10 @@ video {
|
|
|
741
741
|
top: 11px;
|
|
742
742
|
}
|
|
743
743
|
|
|
744
|
+
.tw-top-full {
|
|
745
|
+
top: 100%;
|
|
746
|
+
}
|
|
747
|
+
|
|
744
748
|
.tw-top-squid-xxs {
|
|
745
749
|
top: 0.3125rem;
|
|
746
750
|
}
|
|
@@ -820,6 +824,14 @@ video {
|
|
|
820
824
|
margin-right: 1px;
|
|
821
825
|
}
|
|
822
826
|
|
|
827
|
+
.tw-mt-0 {
|
|
828
|
+
margin-top: 0px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
.tw-mt-0\.5 {
|
|
832
|
+
margin-top: 0.125rem;
|
|
833
|
+
}
|
|
834
|
+
|
|
823
835
|
.tw-mt-1 {
|
|
824
836
|
margin-top: 0.25rem;
|
|
825
837
|
}
|
|
@@ -1020,10 +1032,6 @@ video {
|
|
|
1020
1032
|
max-height: 205px;
|
|
1021
1033
|
}
|
|
1022
1034
|
|
|
1023
|
-
.tw-max-h-\[413px\] {
|
|
1024
|
-
max-height: 413px;
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
1035
|
.tw-max-h-\[535px\] {
|
|
1028
1036
|
max-height: 535px;
|
|
1029
1037
|
}
|
|
@@ -1032,6 +1040,10 @@ video {
|
|
|
1032
1040
|
max-height: 540px;
|
|
1033
1041
|
}
|
|
1034
1042
|
|
|
1043
|
+
.tw-max-h-\[55px\] {
|
|
1044
|
+
max-height: 55px;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1035
1047
|
.tw-max-h-\[600px\] {
|
|
1036
1048
|
max-height: 600px;
|
|
1037
1049
|
}
|
|
@@ -1064,6 +1076,10 @@ video {
|
|
|
1064
1076
|
min-height: 30px;
|
|
1065
1077
|
}
|
|
1066
1078
|
|
|
1079
|
+
.tw-min-h-\[55px\] {
|
|
1080
|
+
min-height: 55px;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1067
1083
|
.tw-min-h-button {
|
|
1068
1084
|
min-height: 3.75rem;
|
|
1069
1085
|
}
|
|
@@ -2033,10 +2049,6 @@ video {
|
|
|
2033
2049
|
padding: 1.875rem;
|
|
2034
2050
|
}
|
|
2035
2051
|
|
|
2036
|
-
.tw-p-squid-s {
|
|
2037
|
-
padding: 0.9375rem;
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
2052
|
.tw-p-squid-xs {
|
|
2041
2053
|
padding: 0.625rem;
|
|
2042
2054
|
}
|
|
@@ -2105,6 +2117,11 @@ video {
|
|
|
2105
2117
|
padding-right: 1.25rem;
|
|
2106
2118
|
}
|
|
2107
2119
|
|
|
2120
|
+
.tw-px-squid-s {
|
|
2121
|
+
padding-left: 0.9375rem;
|
|
2122
|
+
padding-right: 0.9375rem;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2108
2125
|
.tw-px-squid-xs {
|
|
2109
2126
|
padding-left: 0.625rem;
|
|
2110
2127
|
padding-right: 0.625rem;
|
|
@@ -2135,11 +2152,6 @@ video {
|
|
|
2135
2152
|
padding-bottom: 0.5rem;
|
|
2136
2153
|
}
|
|
2137
2154
|
|
|
2138
|
-
.tw-py-\[15px\] {
|
|
2139
|
-
padding-top: 15px;
|
|
2140
|
-
padding-bottom: 15px;
|
|
2141
|
-
}
|
|
2142
|
-
|
|
2143
2155
|
.tw-py-squid-s {
|
|
2144
2156
|
padding-top: 0.9375rem;
|
|
2145
2157
|
padding-bottom: 0.9375rem;
|
|
@@ -2256,10 +2268,6 @@ video {
|
|
|
2256
2268
|
padding-right: 0.625rem;
|
|
2257
2269
|
}
|
|
2258
2270
|
|
|
2259
|
-
.tw-pt-\[52px\] {
|
|
2260
|
-
padding-top: 52px;
|
|
2261
|
-
}
|
|
2262
|
-
|
|
2263
2271
|
.tw-pt-\[5px\] {
|
|
2264
2272
|
padding-top: 5px;
|
|
2265
2273
|
}
|
|
@@ -2818,6 +2826,10 @@ input[type='number'] {
|
|
|
2818
2826
|
display: block;
|
|
2819
2827
|
}
|
|
2820
2828
|
|
|
2829
|
+
.tw-group\/list-item:hover .group-hover\/list-item\:tw-block {
|
|
2830
|
+
display: block;
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2821
2833
|
.tw-group\/history-item:hover .group-hover\/history-item\:tw-hidden {
|
|
2822
2834
|
display: none;
|
|
2823
2835
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -258,6 +258,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
258
258
|
mainImageUrl?: string;
|
|
259
259
|
secondaryImageUrl?: string;
|
|
260
260
|
subtitle?: string;
|
|
261
|
+
subtitleOnHover?: React.ReactNode;
|
|
261
262
|
detail?: string;
|
|
262
263
|
icon?: React.ReactNode;
|
|
263
264
|
size?: ListItemSize;
|
|
@@ -274,7 +275,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
274
275
|
containerProps?: React.HTMLAttributes<HTMLLIElement>;
|
|
275
276
|
}
|
|
276
277
|
type ListItemSize = 'small' | 'large';
|
|
277
|
-
declare function ListItem({ itemTitle, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
278
|
+
declare function ListItem({ itemTitle, mainImageUrl, subtitle, subtitleOnHover, detail, icon, secondaryImageUrl, size, mainIcon, className, isSelected, onDetailClick, showDetailOnHoverOnly, rounded, detailButtonClassName, loading, containerProps, ...props }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
278
279
|
|
|
279
280
|
interface MenuItemProps {
|
|
280
281
|
label: string;
|
|
@@ -346,6 +347,7 @@ interface SwapStepItemProps {
|
|
|
346
347
|
link?: string;
|
|
347
348
|
status?: SwapStepItemStatus;
|
|
348
349
|
}
|
|
350
|
+
declare const STEP_ITEM_HEIGHT = 52;
|
|
349
351
|
declare function SwapStepItem({ descriptionBlocks, showStepSeparator, link, status, }: SwapStepItemProps): react_jsx_runtime.JSX.Element;
|
|
350
352
|
|
|
351
353
|
interface DropdownMenuProps {
|
|
@@ -573,4 +575,4 @@ declare function useDropdownMenu(props?: {
|
|
|
573
575
|
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
574
576
|
};
|
|
575
577
|
|
|
576
|
-
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|
|
578
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, BorderedContainer, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, ModalContent, ModalContentDivider, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, STEP_ITEM_HEIGHT, SectionTitle, SettingsButton, type SettingsButtonProps, type SettingsControl, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressView, SwapProgressViewHeader, SwapState, type SwapStep, SwapStepItem, type SwapStepItemStatus, SwapStepsCollapsed, type SwapStepsCollapsedFooterButton, Switch, type ThemeType, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|