@0xsquid/ui 2.0.6 → 2.0.8-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.
Files changed (25) hide show
  1. package/dist/cjs/index.js +143 -64
  2. package/dist/cjs/types/components/badges/BadgeImage.d.ts +1 -1
  3. package/dist/cjs/types/components/controls/NumericInput.d.ts +1 -0
  4. package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +1 -0
  5. package/dist/cjs/types/components/layout/TokenDetailsView.d.ts +39 -0
  6. package/dist/cjs/types/components/layout/index.d.ts +3 -2
  7. package/dist/cjs/types/components/typography/BodyText.d.ts +5 -1
  8. package/dist/cjs/types/components/typography/CaptionText.d.ts +7 -2
  9. package/dist/cjs/types/services/internal/colorService.d.ts +2 -1
  10. package/dist/cjs/types/stories/layout/SwapConfiguration.stories.d.ts +2 -1
  11. package/dist/cjs/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
  12. package/dist/esm/index.js +142 -65
  13. package/dist/esm/types/components/badges/BadgeImage.d.ts +1 -1
  14. package/dist/esm/types/components/controls/NumericInput.d.ts +1 -0
  15. package/dist/esm/types/components/layout/SwapConfiguration.d.ts +1 -0
  16. package/dist/esm/types/components/layout/TokenDetailsView.d.ts +39 -0
  17. package/dist/esm/types/components/layout/index.d.ts +3 -2
  18. package/dist/esm/types/components/typography/BodyText.d.ts +5 -1
  19. package/dist/esm/types/components/typography/CaptionText.d.ts +7 -2
  20. package/dist/esm/types/services/internal/colorService.d.ts +2 -1
  21. package/dist/esm/types/stories/layout/SwapConfiguration.stories.d.ts +2 -1
  22. package/dist/esm/types/stories/layout/TokenDetailsView.stories.d.ts +13 -0
  23. package/dist/index.css +1 -1
  24. package/dist/index.d.ts +85 -35
  25. package/package.json +1 -1
package/dist/esm/index.js CHANGED
@@ -2679,10 +2679,12 @@ function mapToCssVariables(obj) {
2679
2679
  const badgeSizeClassMap = {
2680
2680
  sm: "tw-w-4 tw-h-4",
2681
2681
  md: "tw-w-5 tw-h-5",
2682
+ lg: "tw-w-5 tw-h-5",
2682
2683
  };
2683
2684
  const mainImageSizeClassMap = {
2684
2685
  sm: "tw-w-8 tw-h-8",
2685
2686
  md: "tw-w-10 tw-h-10",
2687
+ lg: "tw-w-[60px] tw-h-[60px]",
2686
2688
  };
2687
2689
  const loadingSkeletonClassName = "tw-bg-grey-500";
2688
2690
  var ImageState;
@@ -2697,7 +2699,11 @@ function BadgeImage({ imageUrl: _imageUrl, badgeUrl, size = "sm", extraMarginFor
2697
2699
  badge: ImageState.LOADING,
2698
2700
  mainImage: ImageState.LOADING,
2699
2701
  });
2700
- const badgeImageClassName = cn("tw-absolute -tw-right-1/3 tw-bottom-0 tw-z-10 tw-m-0 -tw-translate-x-1/3 tw-rounded-md tw-border-[1px] tw-border-grey-800", badgeSizeClassMap[size]);
2702
+ const badgeImageClassName = cn(
2703
+ // "tw-absolute -tw-right-[5px] tw-bottom-0 tw-z-10 tw-m-0 tw-rounded-md tw-border-[1px] tw-border-grey-800",
2704
+ size === "lg"
2705
+ ? "tw-absolute tw-right-0 tw-bottom-0 tw-z-10 tw-m-0 tw-rounded-md tw-border-[2px] tw-border-grey-800"
2706
+ : "tw-absolute -tw-right-1/3 tw-bottom-0 tw-z-10 tw-m-0 -tw-translate-x-1/3 tw-rounded-md tw-border-[1px] tw-border-grey-800", badgeSizeClassMap[size]);
2701
2707
  const mainImageClassName = cn("tw-h-full tw-w-full tw-absolute", rounded ? " tw-rounded-full" : "tw-rounded-squid-xs");
2702
2708
  return imageUrl ? (jsxs("div", { className: cn("tw-relative", extraMarginForBadge && badgeUrl ? "tw-mr-1.5" : null, mainImageSizeClassMap[size]), children: [imagesLoadState.mainImage !== ImageState.LOADED &&
2703
2709
  (placeholderImageUrl ? (jsx("img", { src: placeholderImageUrl, alt: "", className: mainImageClassName })) : (jsx("div", { className: cn(mainImageClassName, loadingSkeletonClassName) }))), jsx("img", { src: imageUrl, alt: "", onError: () => {
@@ -2766,6 +2772,37 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
2766
2772
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2767
2773
  };
2768
2774
 
2775
+ const LoadingContext = createContext(false);
2776
+ const LoadingProvider = LoadingContext.Provider;
2777
+ function LoadingSkeleton({ className, height = "20", isLoading: isLoadingProp, children, width = "100", }) {
2778
+ const contextValue = useContext(LoadingContext);
2779
+ const isLoading = isLoadingProp !== undefined ? isLoadingProp : contextValue;
2780
+ if (children && !isLoading)
2781
+ return children;
2782
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsx("stop", { stopColor: "currentColor" }), jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsx("clipPath", { id: "clip0_1246_29063", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] })] }));
2783
+ }
2784
+ function TextSkeleton(_a) {
2785
+ var { className, width = ["4em", "6em"], children, isLoading } = _a, props = __rest$1(_a, ["className", "width", "children", "isLoading"]);
2786
+ const minWidthVar = "--min-width";
2787
+ const minWidth = Array.isArray(width) ? width[0] : width;
2788
+ const maxWidthVar = "--max-width";
2789
+ const maxWidth = Array.isArray(width) ? width[1] : width;
2790
+ const t = useMemo(Math.random, []);
2791
+ if (isLoading === false)
2792
+ return children;
2793
+ return (jsx("span", Object.assign({ className: cn("loading-gradient tw-inline-flex tw-rounded-full", className), style: {
2794
+ ["--min-width"]: minWidth,
2795
+ ["--max-width"]: maxWidth,
2796
+ width: calcLerp(`var(${minWidthVar})`, `var(${maxWidthVar})`, t),
2797
+ } }, props, { children: "\u00A0" })));
2798
+ }
2799
+ function BlockSkeleton(_a) {
2800
+ var { isLoading, className, children } = _a, props = __rest$1(_a, ["isLoading", "className", "children"]);
2801
+ if (isLoading === false)
2802
+ return children;
2803
+ return (jsx("div", Object.assign({ className: cn("loading-gradient tw-rounded-squid-s", className) }, props)));
2804
+ }
2805
+
2769
2806
  // font size, line height, and letter spacing classes
2770
2807
  const textClassMap$1 = {
2771
2808
  small: "tw-text-body-small tw-tracking-body-small tw-leading-body-small tw-font-body-small",
@@ -2773,15 +2810,25 @@ const textClassMap$1 = {
2773
2810
  large: "tw-text-body-large tw-tracking-body-large tw-leading-body-large tw-font-body-large",
2774
2811
  };
2775
2812
  function BodyText(_a) {
2776
- var { size, children, bold = false, tight = false } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight"]);
2813
+ var _b, _c;
2814
+ var { size, children, bold = false, tight = false, loading } = _a, props = __rest$1(_a, ["size", "children", "bold", "tight", "loading"]);
2777
2815
  const fontWeightClass = bold ? "!tw-font-bold" : "!tw-font-regular";
2778
- return (jsx("span", Object.assign({}, props, { className: cn(textClassMap$1[size], fontWeightClass, tight && "!tw-leading-[1]", props.className), children: children })));
2816
+ const className = cn(textClassMap$1[size], fontWeightClass, tight && "!tw-leading-[1]", props.className);
2817
+ if ((_b = loading === null || loading === void 0 ? void 0 : loading.isLoading) !== null && _b !== void 0 ? _b : false) {
2818
+ return (jsx(TextSkeleton, { className: className, width: (_c = loading === null || loading === void 0 ? void 0 : loading.width) !== null && _c !== void 0 ? _c : "100%", isLoading: true }));
2819
+ }
2820
+ return (jsx("span", Object.assign({}, props, { className: className, children: children })));
2779
2821
  }
2780
2822
 
2781
2823
  function CaptionText(_a) {
2782
- var { children, bold = false } = _a, props = __rest$1(_a, ["children", "bold"]);
2783
- const boldClass = bold && "!tw-font-bold";
2784
- return (jsx("span", Object.assign({}, props, { className: cn(boldClass, "tw-text-caption tw-font-caption tw-leading-caption", props.className), children: children })));
2824
+ var _b, _c;
2825
+ var { children, bold = false, loading } = _a, props = __rest$1(_a, ["children", "bold", "loading"]);
2826
+ const boldClass = bold ? "!tw-font-bold" : "";
2827
+ const className = cn("tw-text-caption tw-font-caption tw-leading-caption", boldClass, props.className);
2828
+ if ((_b = loading === null || loading === void 0 ? void 0 : loading.isLoading) !== null && _b !== void 0 ? _b : false) {
2829
+ return (jsx(TextSkeleton, { className: className, width: (_c = loading === null || loading === void 0 ? void 0 : loading.width) !== null && _c !== void 0 ? _c : "100%", isLoading: true }));
2830
+ }
2831
+ return (jsx("span", Object.assign({}, props, { className: className, children: children })));
2785
2832
  }
2786
2833
 
2787
2834
  // font size, line height, and letter spacing classes
@@ -2820,37 +2867,6 @@ function IconLabel({ src, children, variant }) {
2820
2867
  return (jsxs("div", { className: "tw-inline-flex tw-items-center tw-gap-squid-xxs", children: [src && jsx(Image$1, { src: src, variant: variant }), typeof children === "string" ? (jsx(CaptionText, { children: children })) : (children)] }));
2821
2868
  }
2822
2869
 
2823
- const LoadingContext = createContext(false);
2824
- const LoadingProvider = LoadingContext.Provider;
2825
- function LoadingSkeleton({ className, height = "20", isLoading: isLoadingProp, children, width = "100", }) {
2826
- const contextValue = useContext(LoadingContext);
2827
- const isLoading = isLoadingProp !== undefined ? isLoadingProp : contextValue;
2828
- if (children && !isLoading)
2829
- return children;
2830
- return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsx("stop", { stopColor: "currentColor" }), jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsx("clipPath", { id: "clip0_1246_29063", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] })] }));
2831
- }
2832
- function TextSkeleton(_a) {
2833
- var { className, width = ["4em", "6em"], children, isLoading } = _a, props = __rest$1(_a, ["className", "width", "children", "isLoading"]);
2834
- const minWidthVar = "--min-width";
2835
- const minWidth = Array.isArray(width) ? width[0] : width;
2836
- const maxWidthVar = "--max-width";
2837
- const maxWidth = Array.isArray(width) ? width[1] : width;
2838
- const t = useMemo(Math.random, []);
2839
- if (isLoading === false)
2840
- return children;
2841
- return (jsx("span", Object.assign({ className: cn("loading-gradient tw-inline-flex tw-rounded-full", className), style: {
2842
- ["--min-width"]: minWidth,
2843
- ["--max-width"]: maxWidth,
2844
- width: calcLerp(`var(${minWidthVar})`, `var(${maxWidthVar})`, t),
2845
- } }, props, { children: "\u00A0" })));
2846
- }
2847
- function BlockSkeleton(_a) {
2848
- var { isLoading, className, children } = _a, props = __rest$1(_a, ["isLoading", "className", "children"]);
2849
- if (isLoading === false)
2850
- return children;
2851
- return (jsx("div", Object.assign({ className: cn("loading-gradient tw-rounded-squid-s", className) }, props)));
2852
- }
2853
-
2854
2870
  function Checkmark1Icon({ className, size = "16", }) {
2855
2871
  return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.8809 2.82977C13.3432 3.13201 13.4729 3.75174 13.1706 4.21399L7.50398 12.8807C7.3318 13.144 7.04572 13.3109 6.73174 13.3313C6.41777 13.3517 6.11252 13.2231 5.90775 12.9842L2.90775 9.4842C2.54833 9.06487 2.59689 8.43357 3.01622 8.07415C3.43554 7.71473 4.06684 7.76329 4.42627 8.18262L6.55918 10.671L11.4967 3.11949C11.7989 2.65725 12.4187 2.52753 12.8809 2.82977Z", fill: "currentColor" }) }));
2856
2872
  }
@@ -16937,6 +16953,20 @@ function SizeTransition(_a) {
16937
16953
  return (jsx("div", Object.assign({}, props, { className: cn("tw-transition-[width,height], tw-duration-200", className), style: { width: contentsRect.width, height: contentsRect.height }, children: jsx("div", { ref: contentsRef, className: "tw-inline-block", children: children }) })));
16938
16954
  }
16939
16955
 
16956
+ function CollapsibleMenu({ children, menuRef, isOpen, transitionDuration, size, className, }) {
16957
+ return (jsx("aside", { style: Object.assign({ transitionDuration, transitionTimingFunction: isOpen
16958
+ ? "cubic-bezier(0.4, 1.3, 0.4, 1)"
16959
+ : undefined, [CSS_VARS.COLLAPSIBLE_MENU_OPEN_WIDTH]: size.open.width, [CSS_VARS.COLLAPSIBLE_MENU_OPEN_HEIGHT]: size.open.height, [CSS_VARS.COLLAPSIBLE_MENU_CLOSED_WIDTH]: size.closed.width, [CSS_VARS.COLLAPSIBLE_MENU_CLOSED_HEIGHT]: size.closed.height }, (isOpen
16960
+ ? {
16961
+ width: `var(${CSS_VARS.COLLAPSIBLE_MENU_OPEN_WIDTH})`,
16962
+ height: `var(${CSS_VARS.COLLAPSIBLE_MENU_OPEN_HEIGHT})`,
16963
+ }
16964
+ : {
16965
+ width: `var(${CSS_VARS.COLLAPSIBLE_MENU_CLOSED_WIDTH})`,
16966
+ height: `var(${CSS_VARS.COLLAPSIBLE_MENU_CLOSED_HEIGHT})`,
16967
+ })), className: cn("tw-fixed tw-z-40 tw-flex tw-flex-col tw-overflow-hidden tw-bg-grey-900 tw-text-grey-100 tw-shadow-elevation-light-3 tw-outline-material-light-thin", className), ref: menuRef, children: children }));
16968
+ }
16969
+
16940
16970
  function DescriptionBlocks(_a) {
16941
16971
  var { className, blocks: blocksProp } = _a, props = __rest$1(_a, ["className", "blocks"]);
16942
16972
  const blocks = typeof blocksProp === "string"
@@ -18020,20 +18050,6 @@ function PipeSeparator(props) {
18020
18050
  return (jsx("div", Object.assign({}, props, { className: cn("tw-h-[0.8em] tw-w-[2px] tw-rounded-full tw-bg-[currentColor]", props.className) })));
18021
18051
  }
18022
18052
 
18023
- function CollapsibleMenu({ children, menuRef, isOpen, transitionDuration, size, className, }) {
18024
- return (jsx("aside", { style: Object.assign({ transitionDuration, transitionTimingFunction: isOpen
18025
- ? "cubic-bezier(0.4, 1.3, 0.4, 1)"
18026
- : undefined, [CSS_VARS.COLLAPSIBLE_MENU_OPEN_WIDTH]: size.open.width, [CSS_VARS.COLLAPSIBLE_MENU_OPEN_HEIGHT]: size.open.height, [CSS_VARS.COLLAPSIBLE_MENU_CLOSED_WIDTH]: size.closed.width, [CSS_VARS.COLLAPSIBLE_MENU_CLOSED_HEIGHT]: size.closed.height }, (isOpen
18027
- ? {
18028
- width: `var(${CSS_VARS.COLLAPSIBLE_MENU_OPEN_WIDTH})`,
18029
- height: `var(${CSS_VARS.COLLAPSIBLE_MENU_OPEN_HEIGHT})`,
18030
- }
18031
- : {
18032
- width: `var(${CSS_VARS.COLLAPSIBLE_MENU_CLOSED_WIDTH})`,
18033
- height: `var(${CSS_VARS.COLLAPSIBLE_MENU_CLOSED_HEIGHT})`,
18034
- })), className: cn("tw-fixed tw-z-40 tw-flex tw-flex-col tw-overflow-hidden tw-bg-grey-900 tw-text-grey-100 tw-shadow-elevation-light-3 tw-outline-material-light-thin", className), ref: menuRef, children: children }));
18035
- }
18036
-
18037
18053
  const createStoreImpl = (createState) => {
18038
18054
  let state;
18039
18055
  const listeners = /* @__PURE__ */ new Set();
@@ -19470,6 +19486,49 @@ const SwapStepsCollapsed = forwardRef((props, ref) => {
19470
19486
  });
19471
19487
  SwapStepsCollapsed.displayName = "SwapStepsCollapsed";
19472
19488
 
19489
+ function Toast({ headerContent, actionsContent, description, chipLabel, title, }) {
19490
+ return (jsxs(Menu, { contentClassName: "tw-px-squid-m tw-pb-squid-s tw-pt-squid-xxs", contentWrapperProps: {
19491
+ className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs",
19492
+ }, rounded: "sm", children: [headerContent, jsx("header", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-px-0 tw-py-squid-xxs", children: jsx(BodyText, { size: "small", className: "tw-text-grey-100", children: title }) }), jsx(CaptionText, { className: "tw-text-center tw-text-material-light-thick", children: description }), jsx("menu", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: actionsContent }), chipLabel && (jsx(Chip, { label: chipLabel, className: "tw-absolute tw-right-squid-xs tw-top-squid-xs" }))] }));
19493
+ }
19494
+
19495
+ const DEFAULT_TIMEFRAME = "1D";
19496
+ 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, ")"] }) }));
19497
+ 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, { imageUrl: token.image, badgeUrl: chain.image, size: "lg", rounded: true }) }), 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, {}) })] })] }));
19498
+ const TokenInfo = ({ token, tokenPrice, priceChange, loading, }) => (jsxs("div", { children: [jsxs(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 }), jsxs("div", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsxs(BodyText, { size: "small", className: "tw-text-grey-500", loading: { isLoading: loading, width: "40px" }, children: [Math.abs(priceChange).toFixed(2), "%"] }), !loading && (jsx(ArrowTriangle, { className: `${priceChange >= 0 ? "tw-rotate-180 tw-text-status-positive" : "tw-text-status-negative"}` }))] })] })] }));
19499
+ 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.toFixed(6), " ", token.symbol] })] }), jsxs(CaptionText, { className: "tw-text-grey-400", loading: { isLoading: loading, width: "60px" }, children: ["$", balanceUSD.toFixed(2)] })] })] }));
19500
+ 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] })] }));
19501
+ 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 })] }));
19502
+ 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: {
19503
+ height: "40px",
19504
+ width: "40px",
19505
+ borderRadius: "100%",
19506
+ backgroundColor: color,
19507
+ color: textColor,
19508
+ }, onClick: onClick }), jsx(CaptionText, { className: "tw-text-grey-400", children: label })] }));
19509
+ const SwapButtons = ({ token, onSwapFrom, onSwapTo, }) => (jsxs("div", { className: "tw-flex tw-justify-between tw-py-5", children: [jsx(SwapButton, { label: "Swap From", color: token.color, textColor: token.textColor, icon: jsx(ArrowUpIcon, {}), onClick: () => {
19510
+ onSwapFrom({ address: token.address, chainId: token.chainId });
19511
+ } }), jsx(SwapButton, { label: "Swap To", color: token.color, textColor: token.textColor, icon: jsx(ArrowDownIcon, {}), onClick: () => {
19512
+ onSwapTo({ address: token.address, chainId: token.chainId });
19513
+ } })] }));
19514
+ const TimeframeChip = ({ label, isSelected, onClick, }) => (jsx(Chip, { className: cn("tw-w-squid-xl tw-cursor-pointer hover:tw-bg-material-light-thin", isSelected
19515
+ ? "!tw-bg-grey-300 !tw-text-grey-900"
19516
+ : "tw-bg-transparent !tw-text-grey-600"), label: label, onClick: onClick }));
19517
+ const ChartTimeframeSelector = ({ selectedTimeframe, onTimeframeChange, }) => {
19518
+ const timeframes = ["1H", "1D", "1W", "1Y"];
19519
+ return (jsx("div", { className: "tw-mt-squid-s tw-flex tw-justify-center tw-gap-squid-xs", children: timeframes.map((timeframe) => (jsx(TimeframeChip, { label: timeframe, isSelected: selectedTimeframe === timeframe, onClick: () => {
19520
+ onTimeframeChange(timeframe);
19521
+ } }, timeframe))) }));
19522
+ };
19523
+ const TokenDetailsView = ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, Chart = DefaultChart, initialTimeframe = DEFAULT_TIMEFRAME, onTimeframeChange = () => { }, onSwapFrom, onSwapTo, }) => {
19524
+ const [selectedTimeframe, setSelectedTimeframe] = useState(initialTimeframe);
19525
+ const handleTimeframeChange = (timeframe) => {
19526
+ setSelectedTimeframe(timeframe);
19527
+ onTimeframeChange(timeframe);
19528
+ };
19529
+ 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-pt-squid-m", children: [jsxs("div", { className: "tw-px-squid-m", children: [jsx(TokenModalHeader, { token: token, chain: chain, loading: loading, onLikeToken: onLikeToken, 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 })] })] }) }));
19530
+ };
19531
+
19473
19532
  const WIDTH_SM = "69";
19474
19533
  const HEIGHT_SM = "31";
19475
19534
  const WIDTH_MD = "94";
@@ -25409,12 +25468,6 @@ function PopLayout(props) {
25409
25468
  return jsx(motion.div, Object.assign({ ref: ref }, props));
25410
25469
  }
25411
25470
 
25412
- function Toast({ headerContent, actionsContent, description, chipLabel, title, }) {
25413
- return (jsxs(Menu, { contentClassName: "tw-px-squid-m tw-pb-squid-s tw-pt-squid-xxs", contentWrapperProps: {
25414
- className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs",
25415
- }, rounded: "sm", children: [headerContent, jsx("header", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-self-stretch tw-px-0 tw-py-squid-xxs", children: jsx(BodyText, { size: "small", className: "tw-text-grey-100", children: title }) }), jsx(CaptionText, { className: "tw-text-center tw-text-material-light-thick", children: description }), jsx("menu", { className: "tw-flex tw-flex-col tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-pt-squid-xs", children: actionsContent }), chipLabel && (jsx(Chip, { label: chipLabel, className: "tw-absolute tw-right-squid-xs tw-top-squid-xs" }))] }));
25416
- }
25417
-
25418
25471
  var lib = {};
25419
25472
 
25420
25473
  var uaParser_min = {exports: {}};
@@ -26861,7 +26914,7 @@ function NumericInput(_a) {
26861
26914
  ? "tw-opacity-0"
26862
26915
  : "" }), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat("%") })] })) : null] }) }))), jsx(Tooltip, Object.assign({}, (isLoading ? undefined : balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.tooltip), { tooltipWidth: "max", childrenClassName: "tw-rounded-squid-s", containerClassName: "tw-rounded-squid-s", children: jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn(buttonClassName, balanceChipClickable
26863
26916
  ? interactiveChipClassName
26864
- : notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balanceFormatted }), jsx(Chip, { label: "Max" })] }) }))] }))] }));
26917
+ : notInteractiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsx(CaptionText, { children: balanceFormatted }), !(balanceButton === null || balanceButton === void 0 ? void 0 : balanceButton.hideMaxChip) && jsx(Chip, { label: "Max" })] }) }))] }))] }));
26865
26918
  }
26866
26919
 
26867
26920
  function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected = false, }) {
@@ -62584,19 +62637,43 @@ function rgbToHex(r, g, b) {
62584
62637
  // let bgColor = '#17191C'
62585
62638
  // let resultingColor = blendColors(foregroundColor, bgColor)
62586
62639
  // console.log(resultingColor) // Output: ~#2f3033
62587
- function blendColors(foreground, background) {
62588
- const fg = hexToRgb(foreground);
62589
- const bg = hexToRgb(background);
62640
+ function blendColors(foreground, background, factor = 1) {
62641
+ const fg = parseColor(foreground);
62642
+ const bg = parseColor(background);
62590
62643
  if (fg == null || bg == null)
62591
62644
  return null;
62592
- const r = Math.round(fg.r * fg.a + bg.r * (1 - fg.a));
62593
- const g = Math.round(fg.g * fg.a + bg.g * (1 - fg.a));
62594
- const b = Math.round(fg.b * fg.a + bg.b * (1 - fg.a));
62645
+ const r = Math.round(fg.r * (1 - factor) + bg.r * factor);
62646
+ const g = Math.round(fg.g * (1 - factor) + bg.g * factor);
62647
+ const b = Math.round(fg.b * (1 - factor) + bg.b * factor);
62595
62648
  return rgbToHex(r, g, b);
62596
62649
  }
62597
62650
  const isValidHexColor = (hex) => {
62598
62651
  return /^#([0-9A-F]{3}|[0-9A-F]{6}|[0-9A-F]{4}|[0-9A-F]{8})$/i.test(hex);
62599
62652
  };
62653
+ function parseColor(color) {
62654
+ var _a, _b, _c, _d;
62655
+ if (color.startsWith("#")) {
62656
+ return hexToRgb(color);
62657
+ }
62658
+ else if (color.startsWith("rgb")) {
62659
+ const match = color.match(/\d+(\.\d+)?/g);
62660
+ if (match) {
62661
+ return {
62662
+ r: parseInt((_a = match[0]) !== null && _a !== void 0 ? _a : "0"),
62663
+ g: parseInt((_b = match[1]) !== null && _b !== void 0 ? _b : "0"),
62664
+ b: parseInt((_c = match[2]) !== null && _c !== void 0 ? _c : "0"),
62665
+ a: match[3] ? parseFloat((_d = match[3]) !== null && _d !== void 0 ? _d : "0") : 1,
62666
+ };
62667
+ }
62668
+ }
62669
+ return null;
62670
+ }
62671
+ const getColorBrightness = (color) => {
62672
+ const rgb = parseColor(color);
62673
+ if (!rgb)
62674
+ return 0;
62675
+ return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;
62676
+ };
62600
62677
 
62601
62678
  function ThemeProvider(_a) {
62602
62679
  var { theme = lightTheme, children, themeType = "light" } = _a, props = __rest$1(_a, ["theme", "children", "themeType"]);
@@ -62604,4 +62681,4 @@ function ThemeProvider(_a) {
62604
62681
  return (jsx("div", Object.assign({}, props, { style: Object.assign(Object.assign({}, props.style), parsedStyle), "data-squid-theme-type": themeType, className: cn("tw-font-squid-main tw-group tw-relative tw-flex tw-h-d-screen mobile-lg:tw-h-auto", props.className), children: children })));
62605
62682
  }
62606
62683
 
62607
- export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, 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, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, 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, 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, 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, defaultTheme, getContrastColor, getHexColorFromOpacityPercentage, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseSquidTheme, pxToRem, remToPx, rgbToHex, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
62684
+ export { ActionLayout, ActionLineOutRow, ActionProperties, ActionRow, ActionStatusRow, ActionWrapper, AddressButton, AnimationWrapper, 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, FeeButton, FeesAction, FeesLines, FeesTotal, FileDownloadIcon, FilledHeartIcon, FilterAscendingIcon, FilterButton, FilterIcon, FilterTimelineIcon, GasIcon, GhostIcon, GithubIcon, HashLink, HeadingText, HeartSmallIcon, HelpIcon, HistoryItem, HomeIcon, IconButton, IconLabel, Image$1 as Image, ImageIcon, ImageSparkle, IncompleteAction, InfinityIcon, InfoBox, Inline, Input, InteractionHeader, InteractionProperties, InteractionTransactionView, Join, LaptopIcon, LightningIcon, LimitIcon, LinkIcon, List, ListItem, ListItemActionsButton, Loader, LoadingProvider, LoadingSkeleton, MEDIA_QUERIES, MainView, MaxIcon, Menu, MenuItem, MenuSwapIcon, MirrorIcon, Modal, ModalContent, ModalContentDivider, MoonIcon, NavigationBar, NewspaperIcon, NotAllowedIcon, NumericInput, PathSquareIcon, PercentIcon, PhoneIcon, PieChartIcon, PipeSeparator, PlusIcon, PoopIcon, PowerIcon, 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, 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, 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, defaultTheme, getColorBrightness, getContrastColor, getHexColorFromOpacityPercentage, hexToRgb, isValidHexColor, lightTheme, linkActionTimelineProps, parseSquidTheme, pxToRem, remToPx, rgbToHex, statusTextClassMap, useCollapsibleMenu, useDropdownMenu, useMediaQuery, useOnResize, useRect, useTimer, useUserTheme, useVersion };
@@ -10,6 +10,6 @@ interface BadgeImageProps {
10
10
  */
11
11
  placeholderImageUrl?: string;
12
12
  }
13
- type BadgeSize = "sm" | "md";
13
+ type BadgeSize = "sm" | "md" | "lg";
14
14
  export declare function BadgeImage({ imageUrl: _imageUrl, badgeUrl, size, extraMarginForBadge, rounded, placeholderImageUrl, }: BadgeImageProps): import("react/jsx-runtime").JSX.Element | null;
15
15
  export {};
@@ -32,6 +32,7 @@ interface NumericInputProps extends React.InputHTMLAttributes<HTMLInputElement>
32
32
  isInteractive?: boolean;
33
33
  balanceButton?: {
34
34
  tooltip?: Omit<TooltipProps, "children">;
35
+ hideMaxChip?: boolean;
35
36
  };
36
37
  }
37
38
  export declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxUsdDecimals, formatIfVerySmall, showDetails, isLoading, direction, inputModeButton, isInteractive, balanceButton, ...props }: NumericInputProps): import("react/jsx-runtime").JSX.Element;
@@ -33,6 +33,7 @@ interface SwapConfigurationProps {
33
33
  };
34
34
  balanceButton?: {
35
35
  tooltip?: Omit<TooltipProps, "children">;
36
+ hideMaxChip?: boolean;
36
37
  };
37
38
  assetsButton?: {
38
39
  tooltip?: Omit<TooltipProps, "children">;
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ interface Token {
3
+ address: string;
4
+ name: string;
5
+ symbol: string;
6
+ image: string;
7
+ color: string;
8
+ textColor: string;
9
+ chainId: string;
10
+ }
11
+ interface Chain {
12
+ name: string;
13
+ image: string;
14
+ }
15
+ export type Timeframe = "1H" | "1D" | "1W" | "1Y";
16
+ interface TokenDetailsViewProps {
17
+ isOpen: boolean;
18
+ onClose: () => void;
19
+ token: Token;
20
+ chain: Chain;
21
+ tokenPrice: number;
22
+ priceChange: number;
23
+ balance: number;
24
+ balanceUSD: number;
25
+ volume24h: string;
26
+ marketCap: string;
27
+ totalSupply: string;
28
+ loading: boolean;
29
+ onLikeToken: () => void;
30
+ Chart?: React.ComponentType<{
31
+ timeframe: Timeframe;
32
+ }>;
33
+ initialTimeframe?: Timeframe;
34
+ onTimeframeChange?: (timeframe: Timeframe) => void;
35
+ onSwapFrom: (token: Pick<Token, "address" | "chainId">) => void;
36
+ onSwapTo: (token: Pick<Token, "address" | "chainId">) => void;
37
+ }
38
+ export declare const TokenDetailsView: ({ isOpen, onClose, token, chain, tokenPrice, priceChange, balance, balanceUSD, volume24h, marketCap, totalSupply, loading, onLikeToken, Chart, initialTimeframe, onTimeframeChange, onSwapFrom, onSwapTo, }: TokenDetailsViewProps) => import("react/jsx-runtime").JSX.Element;
39
+ export {};
@@ -3,6 +3,7 @@ export * from "./AppContainer";
3
3
  export * from "./Boost";
4
4
  export * from "./Breadcrumb";
5
5
  export * from "./Collapse";
6
+ export * from "./CollapsibleMenu";
6
7
  export * from "./DescriptionBlocks";
7
8
  export * from "./DetailsToolbar";
8
9
  export * from "./DropdownMenu";
@@ -15,12 +16,13 @@ export * from "./Modal";
15
16
  export * from "./ModalContent";
16
17
  export * from "./NavigationBar";
17
18
  export * from "./PipeSeparator";
18
- export * from "./CollapsibleMenu";
19
19
  export * from "./ProductCard";
20
20
  export * from "./ProfileHeaderBackground";
21
21
  export * from "./SwapConfiguration";
22
22
  export * from "./SwapProgressViewHeader";
23
23
  export * from "./SwapStepsCollapsed";
24
+ export * from "./Toast";
25
+ export * from "./TokenDetailsView";
24
26
  export * from "./TokenPair";
25
27
  export * from "./TransactionFilters";
26
28
  export * from "./TransactionHeader/BridgeHeader";
@@ -38,4 +40,3 @@ export * from "./TransactionProperties/SwapProperties";
38
40
  export * from "./TransactionProperties/TransactionProperties";
39
41
  export * from "./TransactionSearch";
40
42
  export * from "./Transfer";
41
- export * from "./Toast";
@@ -5,6 +5,10 @@ interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
5
5
  size: TextSize;
6
6
  bold?: boolean;
7
7
  tight?: boolean;
8
+ loading?: {
9
+ isLoading?: boolean;
10
+ width?: string;
11
+ };
8
12
  }
9
- export declare function BodyText({ size, children, bold, tight, ...props }: BodyTextProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function BodyText({ size, children, bold, tight, loading, ...props }: BodyTextProps): import("react/jsx-runtime").JSX.Element;
10
14
  export {};
@@ -1,6 +1,11 @@
1
- /// <reference types="react" />
1
+ import { type ReactNode } from "react";
2
2
  interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
3
+ children: ReactNode;
3
4
  bold?: boolean;
5
+ loading?: {
6
+ isLoading?: boolean;
7
+ width?: string;
8
+ };
4
9
  }
5
- export declare function CaptionText({ children, bold, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function CaptionText({ children, bold, loading, ...props }: CaptionProps): import("react/jsx-runtime").JSX.Element;
6
11
  export {};
@@ -29,5 +29,6 @@ export declare function hexToRgb(hex: string): {
29
29
  a: number;
30
30
  } | null;
31
31
  export declare function rgbToHex(r: number, g: number, b: number): string;
32
- export declare function blendColors(foreground: string, background: string): string | null;
32
+ export declare function blendColors(foreground: string, background: string, factor?: number): string | null;
33
33
  export declare const isValidHexColor: (hex: string) => boolean;
34
+ export declare const getColorBrightness: (color: string) => number;
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from "@storybook/react";
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
2
  import { SwapConfiguration } from "../../components/layout/SwapConfiguration";
3
3
  declare const meta: Meta<typeof SwapConfiguration>;
4
4
  export default meta;
@@ -25,6 +25,7 @@ export declare const FromAddressEmpty: Story;
25
25
  export declare const ToAddressEmpty: Story;
26
26
  export declare const Error: Story;
27
27
  export declare const WithTooltips: Story;
28
+ export declare const HideMaxChip: Story;
28
29
  export declare const WithoutSourceConnectLabels: Story;
29
30
  export declare const WithoutDestConnectLabels: Story;
30
31
  export declare const AddressOnly: Story;
@@ -0,0 +1,13 @@
1
+ import { type Meta, type StoryObj } from "@storybook/react";
2
+ import { TokenDetailsView } from "../../components/layout/TokenDetailsView";
3
+ declare const meta: Meta<typeof TokenDetailsView>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const PositivePriceChange: Story;
8
+ export declare const LowBalance: Story;
9
+ export declare const HighBalance: Story;
10
+ export declare const DifferentToken: Story;
11
+ export declare const Closed: Story;
12
+ export declare const Loading: Story;
13
+ export declare const WithFakeChart: Story;