@0xsquid/ui 2.2.9 → 2.2.11
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 +76 -42
- package/dist/cjs/types/components/badges/PriceChange.d.ts +4 -3
- package/dist/cjs/types/components/layout/ImageStack.d.ts +3 -1
- package/dist/cjs/types/components/layout/Modal.d.ts +2 -1
- package/dist/cjs/types/components/layout/TokenDetailsView.d.ts +6 -5
- package/dist/cjs/types/components/lists/TokenGroup.d.ts +6 -5
- package/dist/cjs/types/core/index.d.ts +1 -1
- package/dist/cjs/types/stories/badges/PriceChange.stories.d.ts +1 -0
- package/dist/cjs/types/stories/layout/ImageStack.stories.d.ts +1 -0
- package/dist/cjs/types/stories/layout/TokenDetailsView.stories.d.ts +1 -0
- package/dist/cjs/types/types/components.d.ts +0 -4
- package/dist/esm/index.js +76 -43
- package/dist/esm/types/components/badges/PriceChange.d.ts +4 -3
- package/dist/esm/types/components/layout/ImageStack.d.ts +3 -1
- package/dist/esm/types/components/layout/Modal.d.ts +2 -1
- package/dist/esm/types/components/layout/TokenDetailsView.d.ts +6 -5
- package/dist/esm/types/components/lists/TokenGroup.d.ts +6 -5
- package/dist/esm/types/core/index.d.ts +1 -1
- package/dist/esm/types/stories/badges/PriceChange.stories.d.ts +1 -0
- package/dist/esm/types/stories/layout/ImageStack.stories.d.ts +1 -0
- package/dist/esm/types/stories/layout/TokenDetailsView.stories.d.ts +1 -0
- package/dist/esm/types/types/components.d.ts +0 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +28 -17
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -4166,10 +4166,26 @@ function CrossedOutSunSolidIcon({ size = "20", className, }) {
|
|
|
4166
4166
|
return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 20 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_3313_9942)", children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M10 0.833313C10.4603 0.833313 10.8334 1.20641 10.8334 1.66665V2.49998C10.8334 2.96022 10.4603 3.33331 10 3.33331C9.5398 3.33331 9.16671 2.96022 9.16671 2.49998V1.66665C9.16671 1.20641 9.5398 0.833313 10 0.833313ZM10 16.6667C10.4603 16.6667 10.8334 17.0398 10.8334 17.5V18.3333C10.8334 18.7936 10.4603 19.1667 10 19.1667C9.5398 19.1667 9.16671 18.7936 9.16671 18.3333V17.5C9.16671 17.0398 9.5398 16.6667 10 16.6667ZM16.6667 10C16.6667 9.53976 17.0398 9.16666 17.5 9.16666H18.3334C18.7936 9.16666 19.1667 9.53976 19.1667 10C19.1667 10.4602 18.7936 10.8333 18.3334 10.8333H17.5C17.0398 10.8333 16.6667 10.4602 16.6667 10ZM0.833374 10C0.833374 9.53976 1.20647 9.16666 1.66671 9.16666H2.50004C2.96028 9.16666 3.33337 9.53976 3.33337 10C3.33337 10.4602 2.96028 10.8333 2.50004 10.8333H1.66671C1.20647 10.8333 0.833374 10.4602 0.833374 10ZM14.7107 14.7107C15.0361 14.3853 15.5637 14.3853 15.8892 14.7107L16.4808 15.3024C16.8063 15.6278 16.8063 16.1554 16.4808 16.4809C16.1554 16.8063 15.6278 16.8063 15.3023 16.4809L14.7107 15.8892C14.3852 15.5638 14.3852 15.0361 14.7107 14.7107ZM3.51925 3.5191C3.84469 3.19366 4.37232 3.19366 4.69776 3.5191L5.28943 4.11077C5.61486 4.43621 5.61486 4.96384 5.28943 5.28928C4.96399 5.61472 4.43635 5.61472 4.11091 5.28928L3.51925 4.69761C3.19381 4.37218 3.19381 3.84454 3.51925 3.5191ZM6.46451 6.46445C7.91429 5.01466 10.0329 4.64131 11.8271 5.34441L5.34447 11.8271C4.64137 10.0328 5.01472 7.91423 6.46451 6.46445ZM8.17288 14.6555L14.6556 8.17282C15.3587 9.96708 14.9854 12.0857 13.5356 13.5355C12.0858 14.9853 9.96714 15.3587 8.17288 14.6555ZM17.2071 4.20709C17.5976 3.81657 17.5976 3.1834 17.2071 2.79288C16.8166 2.40235 16.1834 2.40235 15.7929 2.79288L2.79289 15.7929C2.40237 16.1834 2.40237 16.8166 2.79289 17.2071C3.18342 17.5976 3.81658 17.5976 4.20711 17.2071L17.2071 4.20709Z", fill: "currentColor" }) }), jsx("defs", { children: jsx("clipPath", { id: "clip0_3313_9942", children: jsx("rect", { width: size, height: size, fill: "currentColor" }) }) })] }));
|
|
4167
4167
|
}
|
|
4168
4168
|
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4169
|
+
const valueWrapperClassName = "!tw-leading-[10px]";
|
|
4170
|
+
var PriceChangeSign;
|
|
4171
|
+
(function (PriceChangeSign) {
|
|
4172
|
+
PriceChangeSign[PriceChangeSign["POSITIVE"] = 0] = "POSITIVE";
|
|
4173
|
+
PriceChangeSign[PriceChangeSign["NEGATIVE"] = 1] = "NEGATIVE";
|
|
4174
|
+
PriceChangeSign[PriceChangeSign["NEUTRAL"] = 2] = "NEUTRAL";
|
|
4175
|
+
})(PriceChangeSign || (PriceChangeSign = {}));
|
|
4176
|
+
const priceChangeSignToIconMap = {
|
|
4177
|
+
[PriceChangeSign.POSITIVE]: (jsx(ArrowTriangle, { className: "tw-rotate-180 tw-text-status-positive" })),
|
|
4178
|
+
[PriceChangeSign.NEGATIVE]: (jsx(ArrowTriangle, { className: "tw-text-status-negative" })),
|
|
4179
|
+
[PriceChangeSign.NEUTRAL]: jsx(PauseIcon, {}),
|
|
4180
|
+
};
|
|
4181
|
+
function PriceChange({ value: rawValue, variant = "small", }) {
|
|
4182
|
+
const valueFormatted = Math.abs(Number(rawValue)).toFixed(2);
|
|
4183
|
+
const sign = Number(rawValue) > 0
|
|
4184
|
+
? PriceChangeSign.POSITIVE
|
|
4185
|
+
: Number(rawValue) < 0
|
|
4186
|
+
? PriceChangeSign.NEGATIVE
|
|
4187
|
+
: PriceChangeSign.NEUTRAL;
|
|
4188
|
+
return (jsx("div", { className: "tw-flex tw-h-squid-xs tw-items-center tw-justify-end tw-text-grey-500", children: jsxs("div", { className: "tw-flex tw-items-center tw-justify-center", children: [variant === "small" ? (jsx(CaptionText, { className: valueWrapperClassName, children: valueFormatted })) : (jsx(BodyText, { size: "small", className: valueWrapperClassName, children: valueFormatted })), jsx(CaptionText, { className: "!tw-leading-[10px] tw-text-grey-600", children: "%" }), priceChangeSignToIconMap[sign]] }) }));
|
|
4173
4189
|
}
|
|
4174
4190
|
|
|
4175
4191
|
const statusBgClassMap$1 = {
|
|
@@ -18722,7 +18738,7 @@ const modalWidthClassMap = {
|
|
|
18722
18738
|
large: "mobile-lg:tw-w-modal-large",
|
|
18723
18739
|
"extra-large": "mobile-lg:tw-w-modal-extra-large",
|
|
18724
18740
|
};
|
|
18725
|
-
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, maxHeight = false, width = "large", }) {
|
|
18741
|
+
function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, maxHeight = false, width = "large", animateOpacity = false, }) {
|
|
18726
18742
|
const [isOpen, setIsOpen] = useState(_isOpen);
|
|
18727
18743
|
useEffect(() => {
|
|
18728
18744
|
if (_isOpen) {
|
|
@@ -18750,7 +18766,10 @@ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, m
|
|
|
18750
18766
|
}, className: cn("tw-absolute tw-inset-0 tw-z-40 tw-flex tw-items-start tw-justify-center tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m", _isOpen ? "tw-animate-blur-in" : "tw-animate-blur-out"), children: jsx("div", { style: {
|
|
18751
18767
|
[CSS_VARS.SLIDE_TO_TOP_DURATION]: `${ANIMATION_DURATIONS.SHOW_MODAL}ms`,
|
|
18752
18768
|
[CSS_VARS.SLIDE_TO_BOTTOM_DURATION]: `${ANIMATION_DURATIONS.HIDE_MODAL}ms`,
|
|
18753
|
-
|
|
18769
|
+
[CSS_VARS.FADE_IN_DURATION]: `${ANIMATION_DURATIONS.SHOW_MODAL}ms`,
|
|
18770
|
+
[CSS_VARS.FADE_OUT_DURATION]: `${ANIMATION_DURATIONS.HIDE_MODAL}ms`,
|
|
18771
|
+
}, className: cn("tw-relative tw-flex tw-max-h-modal-compact tw-max-w-full tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end mobile-xs:tw-w-modal-compact mobile-lg:tw-max-h-modal-large", className, _isOpen ? "tw-animate-slide-to-top" : "tw-animate-slide-to-bottom", animateOpacity &&
|
|
18772
|
+
(_isOpen ? "tw-animate-fade-in" : "tw-animate-fade-out"), maxHeight && "tw-h-full", modalWidthClassMap[width]), children: children }) })));
|
|
18754
18773
|
}
|
|
18755
18774
|
|
|
18756
18775
|
const borderTypeClassMap = {
|
|
@@ -19163,11 +19182,20 @@ function DropdownMenuTitle({ title }) {
|
|
|
19163
19182
|
return (jsx("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs tw-pb-squid-xxs tw-text-material-light-average", children: jsx(CaptionText, { children: title }) }));
|
|
19164
19183
|
}
|
|
19165
19184
|
|
|
19185
|
+
const extraPaddingMap = {
|
|
19186
|
+
"outline-sm": "1px",
|
|
19187
|
+
"outline-lg": "3px",
|
|
19188
|
+
};
|
|
19166
19189
|
function ImageStack(_a) {
|
|
19167
|
-
var { imageUrls, spacing, stackOnTop = true } = _a, imageProps = __rest$1(_a, ["imageUrls", "spacing", "stackOnTop"]);
|
|
19168
|
-
|
|
19169
|
-
|
|
19170
|
-
|
|
19190
|
+
var { imageUrls, spacing, stackOnTop = true, addExtraPadding, removeDuplicates = false } = _a, imageProps = __rest$1(_a, ["imageUrls", "spacing", "stackOnTop", "addExtraPadding", "removeDuplicates"]);
|
|
19191
|
+
const imagesToRender = removeDuplicates ? [...new Set(imageUrls)] : imageUrls;
|
|
19192
|
+
return (jsx("div", { style: {
|
|
19193
|
+
// @ts-expect-error Custom CSS property
|
|
19194
|
+
"--image-stack-spacing": spacing,
|
|
19195
|
+
padding: addExtraPadding && imageProps.border
|
|
19196
|
+
? extraPaddingMap[imageProps.border]
|
|
19197
|
+
: undefined,
|
|
19198
|
+
}, className: "tw-flex tw-items-center tw-space-x-[--image-stack-spacing]", children: imagesToRender.map((url, index, self) => (jsx(Image$1, Object.assign({ src: url, containerProps: stackOnTop
|
|
19171
19199
|
? {
|
|
19172
19200
|
style: {
|
|
19173
19201
|
zIndex: self.length - index,
|
|
@@ -19450,13 +19478,13 @@ function SwapStepItem({ descriptionBlocks, showStepSeparator = false, link, stat
|
|
|
19450
19478
|
}, className: "tw-relative tw-flex tw-w-full 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), rel: "noreferrer", 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(DescriptionBlocks, { className: "tw-min-h-squid-l tw-py-squid-xxs tw-pr-squid-xs", blocks: descriptionBlocks })] }) }));
|
|
19451
19479
|
}
|
|
19452
19480
|
|
|
19453
|
-
const
|
|
19481
|
+
const MAX_PREVIEW_ITEMS = 5;
|
|
19454
19482
|
const mainImageSizeMap = {
|
|
19455
19483
|
compact: "medium",
|
|
19456
19484
|
large: "xxlarge",
|
|
19457
19485
|
small: "xlarge",
|
|
19458
19486
|
};
|
|
19459
|
-
function TokenGroup({ isSelected = false, tokenItems, priceChange, balance, balanceUsd, extraSpacing = true, chainImageUrl, imageUrl, symbol, name, onClick,
|
|
19487
|
+
function TokenGroup({ isSelected = false, tokenItems, priceChange, balance, balanceUsd, extraSpacing = true, chainImageUrl, imageUrl, symbol, name, onClick, variant = "large", className, onChildClick, }) {
|
|
19460
19488
|
var _a;
|
|
19461
19489
|
const [isCollapsed, setIsCollapsed] = useState(true);
|
|
19462
19490
|
const isCollapsible = tokenItems && tokenItems.length > 0;
|
|
@@ -19469,36 +19497,41 @@ function TokenGroup({ isSelected = false, tokenItems, priceChange, balance, bala
|
|
|
19469
19497
|
setIsCollapsed((prev) => !prev);
|
|
19470
19498
|
}, []);
|
|
19471
19499
|
return (jsxs("li", { className: cn("tw-w-full tw-self-stretch", extraSpacing && "tw-px-squid-xs tw-pt-squid-xs", !isCollapsed &&
|
|
19472
|
-
"tw-border-y tw-border-solid tw-border-y-material-light-thin tw-py-squid-xs"), children: [jsxs(ContentTag, { onClick: (event) => {
|
|
19500
|
+
"tw-border-y tw-border-solid tw-border-y-material-light-thin tw-py-squid-xs", className), children: [jsxs(ContentTag, { onClick: (event) => {
|
|
19473
19501
|
onClick === null || onClick === void 0 ? void 0 : onClick(event);
|
|
19474
19502
|
if (isCollapsible)
|
|
19475
19503
|
handleToggleCollapsed();
|
|
19476
|
-
},
|
|
19504
|
+
}, style: isCollapsible
|
|
19505
|
+
? {
|
|
19506
|
+
transition: `${ANIMATION_DURATIONS.GENERIC}ms ${ANIMATION_TIMINGS.GENERIC}`,
|
|
19507
|
+
transitionProperty: "height",
|
|
19508
|
+
}
|
|
19509
|
+
: undefined, className: cn("tw-flex tw-w-full tw-items-center tw-rounded-squid-s tw-px-squid-xs", isSelected && "tw-bg-material-light-thin", isInteractive && "hover:tw-bg-material-light-thin", isLargeVariant
|
|
19477
19510
|
? isCollapsed
|
|
19478
19511
|
? "tw-h-[80px] tw-gap-squid-s"
|
|
19479
19512
|
: "tw-h-squid-xl tw-gap-squid-xxs"
|
|
19480
19513
|
: isSmallVariant
|
|
19481
19514
|
? "tw-h-[50px] tw-gap-squid-s tw-py-squid-xxs"
|
|
19482
|
-
: "tw-h-squid-xl tw-gap-squid-xxs"), children: [jsx(
|
|
19483
|
-
|
|
19484
|
-
|
|
19485
|
-
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
(isSmallVariant ? "tw-gap-squid-xs" : "tw-gap-squid-xxs"), isSmallVariant && "tw-h-[45px]"), children: [jsxs("div", { className: cn("tw-flex tw-
|
|
19515
|
+
: "tw-h-squid-xl tw-gap-squid-xxs"), children: [jsxs("div", { className: "tw-relative", children: [jsx(Image$1, { src: imageUrl, size: isLargeVariant && !isCollapsed
|
|
19516
|
+
? "medium"
|
|
19517
|
+
: (_a = mainImageSizeMap[variant]) !== null && _a !== void 0 ? _a : "medium", rounded: isCompactVariant ? "xxs" : "full", style: {
|
|
19518
|
+
transition: `${ANIMATION_DURATIONS.GENERIC}ms ${ANIMATION_TIMINGS.GENERIC}`,
|
|
19519
|
+
transitionProperty: "width, height",
|
|
19520
|
+
} }), isLargeVariant && (jsx("div", { style: isCollapsible
|
|
19521
|
+
? {
|
|
19522
|
+
transition: `${ANIMATION_DURATIONS.GENERIC / 4}ms ${ANIMATION_TIMINGS.GENERIC}`,
|
|
19523
|
+
transitionProperty: "opacity",
|
|
19524
|
+
transitionDelay: isCollapsed
|
|
19525
|
+
? `${ANIMATION_DURATIONS.GENERIC / 10}ms`
|
|
19526
|
+
: undefined,
|
|
19527
|
+
opacity: isCollapsed ? 1 : 0,
|
|
19528
|
+
}
|
|
19529
|
+
: undefined, className: cn("tw-absolute", isCollapsible
|
|
19530
|
+
? "-tw-bottom-0 -tw-right-0"
|
|
19531
|
+
: "-tw-bottom-[3px] -tw-right-[3px]"), children: jsx(ImageStack, { spacing: "-10px", removeDuplicates: true, addExtraPadding: !isCollapsible, size: "medium", rounded: "xxs", border: "outline-lg", imageUrls: isCollapsible
|
|
19532
|
+
? tokenItems === null || tokenItems === void 0 ? void 0 : tokenItems.slice(0, MAX_PREVIEW_ITEMS).map((item) => item.chainImageUrl)
|
|
19533
|
+
: [chainImageUrl] }) }))] }), jsxs("div", { className: cn("tw-flex tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-text-grey-300", isCollapsed &&
|
|
19534
|
+
(isSmallVariant ? "tw-gap-squid-xs" : "tw-gap-squid-xxs"), isSmallVariant && "tw-h-[45px]"), children: [jsxs("div", { className: cn("tw-flex tw-gap-squid-xxs tw-self-stretch", isSmallVariant ? "tw-h-[13px] tw-items-end" : "tw-items-center", isLargeVariant && "tw-h-squid-m"), children: [jsx(BodyText, { size: "small", className: "tw-h-fit !tw-leading-[13px]", children: name }), (!isCollapsed || isCompactVariant) && (jsx(ChevronTopIcon, { className: cn("tw-text-grey-500", isCollapsed ? "tw-rotate-90" : "tw-rotate-180") })), balanceUsd ? (jsx("span", { className: cn("tw-flex tw-flex-1 tw-items-center tw-justify-end", isCollapsed ? "tw-text-grey-300" : "tw-text-grey-500"), children: isSmallVariant ? (jsxs(Fragment, { children: [jsx(CaptionText, { className: "!tw-leading-[10px] tw-opacity-66", children: "$" }), jsx(CaptionText, { className: "!tw-leading-[10px]", children: balanceUsd })] })) : (jsxs(Fragment, { children: [jsx(BodyText, { size: "small", className: "!tw-leading-[10px] tw-opacity-66", children: "$" }), jsx(BodyText, { size: "small", className: "!tw-leading-[10px]", children: balanceUsd })] })) })) : null] }), !isCompactVariant && (jsx(Collapse, { collapsed: !isCollapsed, contentsClassName: "tw-flex tw-w-full tw-items-start tw-justify-between", className: "tw-w-full", children: jsxs("div", { className: cn("tw-flex tw-w-full tw-items-center tw-justify-between tw-self-stretch", isLargeVariant && "tw-h-squid-m"), children: [jsx("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-text-grey-400", children: jsxs(CaptionText, { className: "!tw-leading-[10px]", children: [balance, symbol] }) }), priceChange && jsx(PriceChange, { value: priceChange })] }) }))] })] }), jsx(Collapse, { collapsed: isCollapsed, children: jsx("ul", { className: cn("tw-flex tw-flex-col tw-items-start tw-justify-end tw-self-stretch", isCompactVariant && "tw-gap-squid-xs tw-pt-squid-xs"), children: tokenItems === null || tokenItems === void 0 ? void 0 : tokenItems.map((token) => (jsx(TokenGroup, Object.assign({}, token, { extraSpacing: false, variant: isCompactVariant ? "small" : "large", onClick: () => onChildClick === null || onChildClick === void 0 ? void 0 : onChildClick(token) }), token.chainImageUrl))) }) })] }));
|
|
19502
19535
|
}
|
|
19503
19536
|
|
|
19504
19537
|
function ActionLayout({ lineCap = jsx(Timeline.CapTop, {}), status = "executed", showTimeline = true, showBody = true, nextStatus, statusIcon, description, title, icon, children, }) {
|
|
@@ -19761,19 +19794,19 @@ function Toast({ headerContent, actionsContent, description, chipLabel, title, }
|
|
|
19761
19794
|
|
|
19762
19795
|
const DEFAULT_TIMEFRAME = "1D";
|
|
19763
19796
|
const DefaultChart = ({ timeframe, }) => (jsx("div", { className: "tw-flex tw-h-full tw-w-full tw-items-center tw-justify-center", children: jsxs(BodyText, { size: "small", children: ["Chart (", timeframe, ")"] }) }));
|
|
19764
|
-
const TokenModalHeader = ({ token, chain, onLikeToken, onClose, }) => (jsxs("div", { className: "tw-flex tw-w-full tw-items-start tw-justify-between", children: [jsx("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-pb-squid-xs", children: jsx(BadgeImage, { image: {
|
|
19797
|
+
const TokenModalHeader = ({ token, chain, onLikeToken, onClose, isFavorite, }) => (jsxs("div", { className: "tw-flex tw-w-full tw-items-start tw-justify-between", children: [jsx("div", { className: "tw-flex tw-items-center tw-gap-squid-xs tw-pb-squid-xs", children: jsx(BadgeImage, { image: {
|
|
19765
19798
|
src: token.image,
|
|
19766
19799
|
size: "xxlarge",
|
|
19767
19800
|
rounded: "full",
|
|
19768
19801
|
shadow: true,
|
|
19769
19802
|
}, badge: {
|
|
19770
19803
|
src: chain.image,
|
|
19771
|
-
size: "
|
|
19804
|
+
size: "medium",
|
|
19772
19805
|
rounded: "xxs",
|
|
19773
|
-
border: "outline-
|
|
19774
|
-
} }) }), jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(IconButton, { className: "tw-text-grey-300", onClick: onLikeToken, icon: jsx(EmptyHeartIcon, {}) }), jsx(IconButton, { className: "tw-text-grey-300", onClick: onClose, icon: jsx(CircleXFilledIcon, {}) })] })] }));
|
|
19775
|
-
const TokenInfo = ({ token, tokenPrice, priceChange, loading, }) => (jsxs("div", { children: [
|
|
19776
|
-
const BalanceInfo = ({ balance, balanceUSD, token, loading, }) => (jsxs("div", { className: "tw-flex tw-flex-col", children: [jsx(CaptionText, { className: "tw-text-grey-400", children: "Balance" }), jsxs("div", { className: "tw-flex tw-flex-row tw-justify-between", children: [jsxs("span", { className: "tw-flex tw-flex-row tw-items-center tw-gap-squid-xxs", children: [jsx("img", { src: token.image, alt: token.name, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }), jsxs(BodyText, { size: "small", loading: { isLoading: loading, width: "80px" }, children: [balance
|
|
19806
|
+
border: "outline-lg",
|
|
19807
|
+
} }) }), jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(IconButton, { className: "tw-group/token-detail-fav-icon tw-text-grey-300", onClick: onLikeToken, icon: isFavorite ? (jsxs(Fragment, { children: [jsx(FilledHeartIcon, { className: "tw-block group-hover/token-detail-fav-icon:tw-hidden" }), jsx(BrokenHeartIcon, { className: "tw-hidden group-hover/token-detail-fav-icon:tw-block" })] })) : (jsxs(Fragment, { children: [jsx(EmptyHeartIcon, { className: "tw-block group-hover/token-detail-fav-icon:tw-hidden" }), jsx(FilledHeartIcon, { className: "tw-hidden group-hover/token-detail-fav-icon:tw-block" })] })) }), jsx(IconButton, { className: "tw-text-grey-300", onClick: onClose, icon: jsx(CircleXFilledIcon, {}) })] })] }));
|
|
19808
|
+
const TokenInfo = ({ token, tokenPrice, priceChange, loading, }) => (jsxs("div", { children: [jsx(BodyText, { size: "large", loading: { isLoading: loading, width: "100px" }, children: tokenPrice.toLocaleString() }), jsxs("div", { className: "tw-flex tw-flex-row tw-justify-between", children: [jsx(BodyText, { size: "small", children: token.name }), jsx(PriceChange, { value: priceChange, variant: "large" })] })] }));
|
|
19809
|
+
const BalanceInfo = ({ balance, balanceUSD, token, loading, }) => (jsxs("div", { className: "tw-flex tw-flex-col", children: [jsx(CaptionText, { className: "tw-text-grey-400", children: "Balance" }), jsxs("div", { className: "tw-flex tw-flex-row tw-justify-between", children: [jsxs("span", { className: "tw-flex tw-flex-row tw-items-center tw-gap-squid-xxs", children: [jsx("img", { src: token.image, alt: token.name, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }), jsxs(BodyText, { size: "small", loading: { isLoading: loading, width: "80px" }, children: [balance, " ", token.symbol] })] }), jsxs(CaptionText, { className: "tw-text-grey-500", loading: { isLoading: loading, width: "60px" }, children: [jsx("span", { className: "tw-opacity-66", children: "$" }), balanceUSD] })] })] }));
|
|
19777
19810
|
const MarketDataItem = ({ label, value, showDollar, loading, }) => (jsxs("div", { className: "tw-flex tw-flex-col", children: [jsx(CaptionText, { className: "tw-text-grey-500", children: label }), jsxs(CaptionText, { loading: { isLoading: loading, width: "60px" }, children: [showDollar && jsx("span", { className: "tw-text-grey-500", children: "$" }), value] })] }));
|
|
19778
19811
|
const TokenMarketData = ({ volume24h, marketCap, totalSupply, loading, }) => (jsxs("div", { className: "tw-flex tw-h-full tw-w-full tw-flex-row tw-items-center tw-justify-between", children: [jsx(MarketDataItem, { label: "24h volume", value: volume24h, showDollar: true, loading: loading }), jsx(MarketDataItem, { label: "Market cap", value: marketCap, showDollar: true, loading: loading }), jsx(MarketDataItem, { label: "Total supply", value: totalSupply, loading: loading })] }));
|
|
19779
19812
|
const SwapButton = ({ label, color, icon, onClick, textColor, }) => (jsxs("div", { className: "tw-flex tw-flex-1 tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs", children: [jsx(IconButton, { icon: icon, className: "tw-text-grey-900", style: {
|
|
@@ -19797,13 +19830,13 @@ const ChartTimeframeSelector = ({ selectedTimeframe, onTimeframeChange, }) => {
|
|
|
19797
19830
|
onTimeframeChange(timeframe);
|
|
19798
19831
|
} }, timeframe))) }));
|
|
19799
19832
|
};
|
|
19800
|
-
const TokenDetailsView = ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, Chart = DefaultChart, initialTimeframe = DEFAULT_TIMEFRAME, onTimeframeChange = () => { }, onSwapFrom, onSwapTo, }) => {
|
|
19833
|
+
const TokenDetailsView = ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, isFavorite, Chart = DefaultChart, initialTimeframe = DEFAULT_TIMEFRAME, onTimeframeChange = () => { }, onSwapFrom, onSwapTo, }) => {
|
|
19801
19834
|
const [selectedTimeframe, setSelectedTimeframe] = useState(initialTimeframe);
|
|
19802
19835
|
const handleTimeframeChange = (timeframe) => {
|
|
19803
19836
|
setSelectedTimeframe(timeframe);
|
|
19804
19837
|
onTimeframeChange(timeframe);
|
|
19805
19838
|
};
|
|
19806
|
-
return (jsx(Modal, { isOpen: isOpen, onBackdropClick: onClose, width: "extra-large", className: "tw-my-auto", children: jsxs(ModalContent, { className: "tw-flex tw-min-h-[631px] tw-flex-col !tw-bg-grey-900 tw-pt-squid-m", children: [jsxs("div", { className: "tw-px-squid-m", children: [jsx(TokenModalHeader, { token: token, chain: chain,
|
|
19839
|
+
return (jsx(Modal, { animateOpacity: true, isOpen: isOpen, onBackdropClick: onClose, width: "extra-large", className: "tw-my-auto", children: jsxs(ModalContent, { className: "tw-flex tw-min-h-[631px] tw-flex-col !tw-bg-grey-900 tw-pt-squid-m", children: [jsxs("div", { className: "tw-px-squid-m", children: [jsx(TokenModalHeader, { token: token, chain: chain, onLikeToken: onLikeToken, isFavorite: isFavorite, onClose: onClose }), jsx(TokenInfo, { token: token, tokenPrice: tokenPrice, priceChange: priceChange, loading: loading })] }), jsxs("div", { className: "tw-flex tw-w-full tw-grow tw-flex-col tw-justify-between tw-text-center", children: [jsx("span", { className: "tw-flex tw-h-full tw-grow tw-items-center tw-justify-center", children: loading ? jsx(Loader, {}) : jsx(Chart, { timeframe: selectedTimeframe }) }), jsx(ChartTimeframeSelector, { selectedTimeframe: selectedTimeframe, onTimeframeChange: handleTimeframeChange })] }), jsx("hr", { className: "tw-my-squid-xs tw-h-px tw-border-0 tw-bg-material-light-thin" }), jsxs("div", { className: "tw-flex tw-flex-col", children: [jsxs("div", { className: "tw-gap-squid-sm tw-flex tw-flex-col tw-px-squid-m", children: [jsx(BalanceInfo, { balance: balance, balanceUSD: balanceUSD, token: token, loading: loading }), jsx("hr", { className: "tw-my-squid-xs tw-h-px tw-border-0 tw-bg-material-light-thin" }), jsx(TokenMarketData, { volume24h: volume24h, marketCap: marketCap, totalSupply: totalSupply, loading: loading })] }), jsx("hr", { className: "tw-my-squid-xs tw-h-px tw-border-0 tw-bg-material-light-thin" }), jsx(SwapButtons, { token: token, onSwapFrom: onSwapFrom, onSwapTo: onSwapTo })] })] }) }));
|
|
19807
19840
|
};
|
|
19808
19841
|
|
|
19809
19842
|
const WIDTH_SM = "69";
|
|
@@ -69561,4 +69594,4 @@ function ThemeProvider(_a) {
|
|
|
69561
69594
|
return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-group tw-relative tw-flex tw-font-squid-main tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
|
|
69562
69595
|
}
|
|
69563
69596
|
|
|
69564
|
-
export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, blendColors, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|
|
69597
|
+
export { ANIMATION_DURATIONS, ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, Announcement, AppContainer, Approve, ApproveAction, ArrowBottomTopIcon, ArrowButton, ArrowCornerDownRightIcon, ArrowDownIcon, ArrowLeftIcon, ArrowOutOfBoxIcon, ArrowRightDownCircleIcon, ArrowRightDownIcon, ArrowRightIcon, ArrowRightUpCircleIcon, ArrowRightUpIcon, ArrowRotate, ArrowSplit, ArrowTriangle, ArrowUpIcon, ArrowWallDownIcon, ArrowsSwapIcon, AssetsButton, AssetsView, AtomIcon, BackpackIcon, BadgeImage, BankIcon, BellAlarmIcon, BlockSkeleton, BodyText, Boost, BoostBadge, BoostButton, BorderedContainer, Breadcrumb, BridgeAction, BridgeHeader, BridgeProperties, BridgeTransactionView, BrokenHeartIcon, BubblesIcon, Button$1 as Button, BuyNFTHeader, BuyNFTProperties, BuyNFTTransactionView, CSS_VARS, Calendar, CaptionText, CatSquareIcon, ChainLink, Checkmark1Icon, Checkmark2Icon, ChevronArrowIcon, ChevronDownSmallIcon, ChevronGrabberVerticalIcon, ChevronLargeDownIcon, ChevronLargeRightIcon, ChevronRightSmallIcon, ChevronTopIcon, ChevronTopSmallIcon, Chip, CircleMinusIcon, CirclePlusIcon, CircleX, CircleXFilledIcon, ClockOutlineIcon, ClockSolidIcon, CodeBracketsIcon, CodeSolidSquareIcon, CoinsAddIcon, CoinsIcon, CoinsOutlinedIcon, Collapse, CollapsibleMenu, CollectionIcon, ColorPaletteIcon, CommandIcon, CompassRoundOutlinedIcon, CompassRoundSolidIcon, ConsoleIcon, Copy, CopyIcon, CrossAnimatedIcon, CrossedOutSunSolidIcon, DashboardFast, DescriptionBlocks, DetailsToolbar, DiscordIcon, DockIconAnalytics, DockIconCheckout, DockIconHelp, DockIconProfile, DockIconScan, DockIconSwap, DockSwapIcon, DollarOutlinedIcon, DollarSolidIcon, DotGrid1x3HorizontalIcon, DropdownMenu, DropdownMenuItem, DropdownMenuTitle, EmojiMeh, EmojiSadIcon, EmptyHeartIcon, ErrorMessage, EthereumIcon, ExplosionIcon, EyeOpenIcon, FavouriteFilterIcon, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HighestPriceRangeIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, ImageState, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MarketCapIcon, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PauseIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, PriceChange, ProductCard, ProfileHeader, ProfileHeaderBackground, PropertiesLayout, PropertyListItem, PunkIcon, RangeInput, ReceiptBillIcon, ReceiveNFTAction, ReceiveTokensAction, RecipientView, RefreshIcon, ReorderIcon, RouteStep, STEP_ITEM_HEIGHT, SearchIcon, SectionTitle, SendTokensAction, SettingsButton, SettingsGearIcon, SettingsItem, SettingsSlider, SettingsSliderIcon, ShoppingBagIcon, SizeTransition, SmileIcon, SnapIcon, SortIcon, SparkleIcon, SparklesIcon, SquareArrowCenter, SquareArrowTopLeftIcon, SquareArrowTopRight2Icon, SquidLogo, SquidVector, StakeAction, StartAction, StocksIcon, SuccessAction, SunIcon, SunOutlinedIcon, SunriseIcon, SunriseSmallIcon, SwapAction, SwapConfiguration, SwapDetailsView, SwapErrorIcon, SwapHeader, SwapIcon, SwapInputsIcon, SwapProgressView, SwapProgressViewHeader, SwapProperties, SwapStepItem, SwapStepSeparator, SwapStepsCollapsed, SwapSuccessIcon, SwapTransactionView, SwapWarningIcon, Switch, TagIcon, TagIconFilled, TextSkeleton, ThemePreference, ThemeProvider, ThumbsUp, Tick, TimeFliesIcon, Timeline, Timestamp, Toast, TokenDetailsView, TokenGroup, TokenPair, Tooltip, TradingViewStepsIcon, TransactionAction, TransactionFilters, TransactionHeader, TransactionHeaderLayout, TransactionItem, TransactionProperties, TransactionSearch, TransactionState, TransactionView, TransactionViewLayout, Transfer, TranslateIcon, TriangleExclamation, UsdAmount, WalletFilledIcon, WalletIcon, WalletLink, WalletsView, WrapAction, XSocial, baseTailwindConfig, blendColors, cn, darkTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, getWalletCardBackground, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseColor, parseSquidTheme, pxToRem, remToPx, rgbToHex, spacing$1 as spacing, statusTextClassMap, transactionErrorPauseAnimation, transactionFailureAnimation, transactionHalfSuccessAnimation, transactionPendingAnimation, transactionProcessingAnimation, transactionRejectedAnimation, transactionSuccessAnimation, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
interface PriceChangeProps {
|
|
2
|
+
variant?: "small" | "large";
|
|
3
|
+
value: string | number;
|
|
3
4
|
}
|
|
4
|
-
export declare function PriceChange({
|
|
5
|
+
export declare function PriceChange({ value: rawValue, variant, }: PriceChangeProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type ImageProps } from "../badges";
|
|
2
|
-
export declare function ImageStack({ imageUrls, spacing, stackOnTop, ...imageProps }: {
|
|
2
|
+
export declare function ImageStack({ imageUrls, spacing, stackOnTop, addExtraPadding, removeDuplicates, ...imageProps }: {
|
|
3
3
|
imageUrls: string[];
|
|
4
4
|
spacing: string;
|
|
5
5
|
border?: ImageProps["border"];
|
|
6
6
|
rounded?: ImageProps["rounded"];
|
|
7
7
|
size?: ImageProps["size"];
|
|
8
8
|
stackOnTop?: boolean;
|
|
9
|
+
addExtraPadding?: boolean;
|
|
10
|
+
removeDuplicates?: boolean;
|
|
9
11
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ interface ModalProps {
|
|
|
7
7
|
isOpen?: boolean;
|
|
8
8
|
maxHeight?: boolean;
|
|
9
9
|
width?: ModalWidth;
|
|
10
|
+
animateOpacity?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, width, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, maxHeight, width, animateOpacity, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -18,15 +18,16 @@ interface TokenDetailsViewProps {
|
|
|
18
18
|
onClose: () => void;
|
|
19
19
|
token: Token;
|
|
20
20
|
chain: Chain;
|
|
21
|
-
tokenPrice:
|
|
22
|
-
priceChange: number;
|
|
23
|
-
balance:
|
|
24
|
-
balanceUSD:
|
|
21
|
+
tokenPrice: string;
|
|
22
|
+
priceChange: string | number;
|
|
23
|
+
balance: string;
|
|
24
|
+
balanceUSD: string;
|
|
25
25
|
volume24h: string;
|
|
26
26
|
marketCap: string;
|
|
27
27
|
totalSupply: string;
|
|
28
28
|
loading: boolean;
|
|
29
29
|
onLikeToken: () => void;
|
|
30
|
+
isFavorite?: boolean;
|
|
30
31
|
Chart?: React.ComponentType<{
|
|
31
32
|
timeframe: Timeframe;
|
|
32
33
|
}>;
|
|
@@ -35,5 +36,5 @@ interface TokenDetailsViewProps {
|
|
|
35
36
|
onSwapFrom: (token: Pick<Token, "address" | "chainId">) => void;
|
|
36
37
|
onSwapTo: (token: Pick<Token, "address" | "chainId">) => void;
|
|
37
38
|
}
|
|
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 declare const TokenDetailsView: ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, isFavorite, Chart, initialTimeframe, onTimeframeChange, onSwapFrom, onSwapTo, }: TokenDetailsViewProps) => import("react/jsx-runtime").JSX.Element;
|
|
39
40
|
export {};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { type PriceChange as TPriceChange } from "../../types/components";
|
|
3
2
|
type TokenGroupVariant = "compact" | "large" | "small";
|
|
4
|
-
export interface TokenGroupProps {
|
|
3
|
+
export interface TokenGroupProps<T extends TokenGroupProps<T>> {
|
|
5
4
|
isSelected?: boolean;
|
|
6
5
|
imageUrl: string;
|
|
7
6
|
symbol: string;
|
|
@@ -9,12 +8,14 @@ export interface TokenGroupProps {
|
|
|
9
8
|
chainImageUrl: string;
|
|
10
9
|
balance?: string;
|
|
11
10
|
balanceUsd?: string;
|
|
12
|
-
priceChange?:
|
|
13
|
-
tokenItems?:
|
|
11
|
+
priceChange?: string | number;
|
|
12
|
+
tokenItems?: T[];
|
|
14
13
|
extraSpacing?: boolean;
|
|
15
14
|
onClick?: (event: React.MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
|
|
16
15
|
maxPreviewItems?: number;
|
|
17
16
|
variant?: TokenGroupVariant;
|
|
17
|
+
className?: string;
|
|
18
|
+
onChildClick?: (tokenProps: T) => void;
|
|
18
19
|
}
|
|
19
|
-
export declare function TokenGroup({ isSelected, tokenItems, priceChange, balance, balanceUsd, extraSpacing, chainImageUrl, imageUrl, symbol, name, onClick,
|
|
20
|
+
export declare function TokenGroup<T extends TokenGroupProps<T>>({ isSelected, tokenItems, priceChange, balance, balanceUsd, extraSpacing, chainImageUrl, imageUrl, symbol, name, onClick, variant, className, onChildClick, }: TokenGroupProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MEDIA_QUERIES, CSS_VARS } from "./constants";
|
|
1
|
+
export { MEDIA_QUERIES, CSS_VARS, ANIMATION_DURATIONS } from "./constants";
|
|
2
2
|
export { darkTheme, lightTheme } from "./themes";
|
|
3
3
|
export { baseTailwindConfig, spacing } from "./design-system";
|
|
4
4
|
export { cn } from "./utils";
|
|
@@ -4,5 +4,6 @@ declare const meta: Meta<typeof ImageStack>;
|
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
|
+
export declare const RemoveDuplicates: Story;
|
|
7
8
|
export declare const NegativeSpacing: Story;
|
|
8
9
|
export declare const LargeImages: Story;
|
|
@@ -43,7 +43,3 @@ export type StatusFilter = "success" | "ongoing" | "error";
|
|
|
43
43
|
export type AssetsButtonVariant = "primary" | "accent";
|
|
44
44
|
export type PropertyListItemSize = "small" | "large";
|
|
45
45
|
export type DropdownPosition = "top" | "bottom" | "center";
|
|
46
|
-
export interface PriceChange {
|
|
47
|
-
value: string;
|
|
48
|
-
sign: "positive" | "negative" | "neutral";
|
|
49
|
-
}
|