@0xsquid/ui 0.7.6 → 0.8.1

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 CHANGED
@@ -2652,8 +2652,8 @@ function ChevronLargeRightIcon({ size = '16', className, }) {
2652
2652
  function ChevronRightSmallIcon() {
2653
2653
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: jsxRuntime.jsx("path", { d: "M6.66675 10.6667L8.86201 8.47141C9.12236 8.21106 9.12236 7.78896 8.86201 7.52861L6.66675 5.33334", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2654
2654
  }
2655
- function ArrowLeftIcon() {
2656
- return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: jsxRuntime.jsx("path", { d: "M10 6L4 12L10 18M5 12H20", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
2655
+ function ArrowLeftIcon({ className, size = '24', }) {
2656
+ return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M10 6L4 12L10 18M5 12H20", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
2657
2657
  }
2658
2658
  function ChevronGrabberVerticalIcon({ size = '16', className, }) {
2659
2659
  return (jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 16 16", fill: "none", className: className, children: jsxRuntime.jsx("path", { d: "M5.33301 6.00002L7.52827 3.80476C7.78862 3.54441 8.21073 3.54441 8.47108 3.80476L10.6663 6.00002M5.33301 10L7.52827 12.1953C7.78862 12.4556 8.21073 12.4556 8.47108 12.1953L10.6663 10", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
@@ -3245,8 +3245,23 @@ function SwapStepSeparator() {
3245
3245
  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" }) }) }));
3246
3246
  }
3247
3247
 
3248
- function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = false, }) {
3249
- return (jsxRuntime.jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-bg-grey-800 tw-text-grey-300", children: [showStepSeparator && jsxRuntime.jsx(SwapStepSeparator, {}), jsxRuntime.jsxs("div", { className: "tw-flex tw-w-full tw-items-center tw-text-royal-400", children: [jsxRuntime.jsx("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, { className: "tw-w-squid-xl tw-bg-royal-400 tw-text-grey-900", icon: typeof chipContent === 'string' ? (jsxRuntime.jsx(CaptionText, { children: chipContent })) : (chipContent) }) }), 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", children: descriptionBlocks.map(({ type, value }, index) => {
3248
+ const statusTextClassMap = {
3249
+ executed: 'tw-text-grey-300',
3250
+ progress: 'tw-text-royal-400',
3251
+ pending: 'tw-text-grey-600',
3252
+ };
3253
+ const statusBgClassMap = {
3254
+ executed: '!tw-bg-grey-300',
3255
+ progress: '!tw-bg-royal-400',
3256
+ pending: '!tw-bg-grey-600',
3257
+ };
3258
+ const separatorClassMap = {
3259
+ executed: 'tw-text-grey-300',
3260
+ progress: 'tw-text-grey-600',
3261
+ pending: 'tw-text-grey-600',
3262
+ };
3263
+ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = false, link, status = 'pending', }) {
3264
+ return (jsxRuntime.jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-bg-grey-800 tw-text-grey-300", children: [showStepSeparator && (jsxRuntime.jsx("span", { className: separatorClassMap[status], children: jsxRuntime.jsx(SwapStepSeparator, {}) })), jsxRuntime.jsxs("a", { href: link, target: "_blank", className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs', !!link && 'hover:tw-bg-material-light-thin', statusTextClassMap[status]), children: [jsxRuntime.jsx("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, { className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: typeof chipContent === 'string' ? (jsxRuntime.jsx(CaptionText, { children: chipContent })) : (chipContent) }) }), 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", children: descriptionBlocks.map(({ type, value }, index) => {
3250
3265
  if (type === 'string') {
3251
3266
  return (
3252
3267
  // Instead of displaying the string into a single <BodyText />
@@ -3261,23 +3276,34 @@ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = fals
3261
3276
  return (jsxRuntime.jsx("img", { src: value, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }, index));
3262
3277
  }
3263
3278
  return null;
3264
- }) })] })] }));
3279
+ }) }), !!link && (jsxRuntime.jsx(ChevronLargeRightIcon, { className: "tw-mr-squid-xxs tw-hidden tw-text-material-light-average group-hover/swap-step-item:tw-block" }))] })] }));
3265
3280
  }
3266
3281
 
3267
3282
  function DropdownMenu({ dropdownRef, items, className, }) {
3268
3283
  return (jsxRuntime.jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsxRuntime.jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsxRuntime.jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsxRuntime.jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3269
3284
  }
3270
3285
 
3271
- function Modal({ children, className, onBackdropClick }) {
3286
+ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }) {
3287
+ const [isOpen, setIsOpen] = react.useState(_isOpen);
3288
+ react.useEffect(() => {
3289
+ if (_isOpen)
3290
+ return setIsOpen(true);
3291
+ const timeoutId = setTimeout(() => {
3292
+ setIsOpen(false);
3293
+ }, 300);
3294
+ return () => {
3295
+ clearTimeout(timeoutId);
3296
+ };
3297
+ }, [_isOpen]);
3272
3298
  return (
3273
3299
  // modal container (backdrop)
3274
- jsxRuntime.jsx("div", { onClick: onBackdropClick
3300
+ isOpen && (jsxRuntime.jsx("div", { onClick: onBackdropClick
3275
3301
  ? (event) => {
3276
3302
  if (event.target === event.currentTarget) {
3277
3303
  onBackdropClick();
3278
3304
  }
3279
3305
  }
3280
- : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3306
+ : undefined, className: cn('tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsxRuntime.jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom'), children: children }) })));
3281
3307
  }
3282
3308
 
3283
3309
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3317,11 +3343,20 @@ function SwapProgressViewHeader({ title, description, }) {
3317
3343
  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 })] }));
3318
3344
  }
3319
3345
 
3320
- function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3321
- // handles if route component is mounted
3346
+ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
3347
+ const newStepIndex = Math.round(_newStepIndex);
3348
+ const [currentStepIndex, setCurrentStepIndex] = react.useState(newStepIndex);
3349
+ react.useEffect(() => {
3350
+ const timeoutId = setTimeout(() => {
3351
+ setCurrentStepIndex(Math.round(newStepIndex));
3352
+ }, 400);
3353
+ return () => {
3354
+ clearTimeout(timeoutId);
3355
+ };
3356
+ }, [newStepIndex]);
3357
+ // handles whether route component is mounted
3322
3358
  const [isRouteVisible, setIsRouteVisible] = react.useState(false);
3323
- const currentStepIndex = Math.round(_currentStepIndex);
3324
- // handles if route component is animating to show
3359
+ // handles whether route component is animating to show
3325
3360
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = react.useState(false);
3326
3361
  const currentStep = steps[currentStepIndex];
3327
3362
  const isLastStep = currentStepIndex === steps.length - 1;
@@ -3339,16 +3374,24 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3339
3374
  };
3340
3375
  }, [isShowRouteAnimationRunning]);
3341
3376
  const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3342
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { onClick: () => {
3377
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxRuntime.jsxs("button", { className: "tw-relative tw-max-h-button tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
3343
3378
  // mount route component and start animation
3344
3379
  setIsRouteVisible(true);
3345
3380
  setIsShowRouteAnimationRunning(true);
3346
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsxRuntime.jsx(SwapStepSeparator, {})] })), currentStep && (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxRuntime.jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsxRuntime.jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3381
+ }, children: [newStepIndex > currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-animate-translate-to-bottom tw-absolute -tw-top-full tw-left-0 tw-w-full", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
3382
+ 'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsxRuntime.jsx("div", { className: "tw-animate-translate-to-top tw-absolute tw-left-0 tw-top-full tw-w-full", children: jsxRuntime.jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsxRuntime.jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800" }), jsxRuntime.jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800" })] }) }), isRouteVisible && (jsxRuntime.jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsxRuntime.jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3347
3383
  ? 'tw-animate-fade-in'
3348
3384
  : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3349
3385
  ? 'tw-animate-slide-to-top'
3350
- : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: collapseRouteSteps, 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", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3351
- }
3386
+ : 'tw-animate-slide-to-bottom'), children: [jsxRuntime.jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsxRuntime.jsx("button", { onClick: collapseRouteSteps, 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", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1), link: step.link, status: currentStepIndex < index
3387
+ ? 'pending'
3388
+ : currentStepIndex > index
3389
+ ? 'executed'
3390
+ : 'progress' }, index))) }), jsxRuntime.jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsxRuntime.jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3391
+ }
3392
+ const CurrentStep = ({ currentStep, isFirstStep, isLastStep, className, }) => {
3393
+ return (jsxRuntime.jsxs("div", { className: cn('tw-relative tw-z-10 tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-px-squid-xs tw-text-grey-300', className), children: [!isLastStep && (jsxRuntime.jsx("span", { className: "tw-absolute -tw-top-1.5 tw-z-0", children: jsxRuntime.jsx(SwapStepSeparator, {}) })), currentStep && (jsxRuntime.jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent, status: "progress" })), !isFirstStep && (jsxRuntime.jsx("span", { className: "tw-absolute -tw-bottom-1.5 tw-z-0", children: jsxRuntime.jsx(SwapStepSeparator, {}) }))] }));
3394
+ };
3352
3395
 
3353
3396
  function TokenPair({ firstToken, secondToken }) {
3354
3397
  return (jsxRuntime.jsxs("div", { className: "tw-relative tw-h-[42px] tw-w-[94px]", children: [jsxRuntime.jsxs("svg", { width: "94", height: "42", viewBox: "0 0 94 42", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "tw-absolute tw-z-10 tw-text-material-light-average", children: [jsxRuntime.jsx("g", { filter: "url(#filter0_b_457_51391)", children: jsxRuntime.jsx("path", { d: "M58.5042 35.4956L58.5043 35.4957C62.5071 39.4985 67.7544 41.5 73.0001 41.5C84.3219 41.5 93.5 32.3218 93.5 21C93.5 9.67822 84.3219 0.5 73.0001 0.5C67.7544 0.499977 62.5071 2.50151 58.5043 6.50431C57.9743 7.03437 57.4538 7.57007 56.9412 8.09756L56.9403 8.09852C55.2889 9.79812 53.7279 11.4027 52.097 12.5879C50.4734 13.7678 48.8225 14.5 47 14.5C45.1775 14.5 43.5266 13.7678 41.903 12.5879C40.2721 11.4027 38.7111 9.79812 37.0597 8.09852L37.0589 8.09766C36.5463 7.57013 36.0258 7.03441 35.4957 6.50431C31.4929 2.50151 26.2456 0.499977 20.9999 0.5C15.7543 0.500023 10.5071 2.50156 6.50431 6.50431C2.50153 10.5071 0.5 15.7544 0.5 21C0.5 26.2456 2.50153 31.4929 6.50431 35.4957C10.5071 39.4984 15.7543 41.5 20.9999 41.5C26.2456 41.5 31.4929 39.4985 35.4957 35.4957L35.4958 35.4956C36.023 34.968 36.5408 34.4349 37.0508 33.9099L37.0521 33.9086C38.7042 32.2077 40.2665 30.6013 41.8988 29.4147C43.5238 28.2333 45.1763 27.5 47 27.5C48.8237 27.5 50.4762 28.2333 52.1012 29.4147C53.7335 30.6013 55.2958 32.2077 56.9479 33.9086L56.9492 33.9099C57.4592 34.4349 57.977 34.968 58.5042 35.4956Z", stroke: "currentColor" }) }), jsxRuntime.jsx("defs", { children: jsxRuntime.jsxs("filter", { id: "filter0_b_457_51391", x: "-20", y: "-20", width: "134", height: "82", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "sRGB", children: [jsxRuntime.jsx("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }), jsxRuntime.jsx("feGaussianBlur", { in: "BackgroundImageFix", stdDeviation: "10" }), jsxRuntime.jsx("feComposite", { in2: "SourceAlpha", operator: "in", result: "effect1_backgroundBlur_457_51391" }), jsxRuntime.jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_backgroundBlur_457_51391", result: "shape" })] }) })] }), jsxRuntime.jsxs("div", { className: "tw-token-pair-mask tw-z-10 tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between", style: {
@@ -14,7 +14,10 @@ export declare function ChevronLargeRightIcon({ size, className, }: {
14
14
  className?: string;
15
15
  }): import("react/jsx-runtime").JSX.Element;
16
16
  export declare function ChevronRightSmallIcon(): import("react/jsx-runtime").JSX.Element;
17
- export declare function ArrowLeftIcon(): import("react/jsx-runtime").JSX.Element;
17
+ export declare function ArrowLeftIcon({ className, size, }: {
18
+ className?: string;
19
+ size?: string;
20
+ }): import("react/jsx-runtime").JSX.Element;
18
21
  export declare function ArrowRightUpCircleIcon(): import("react/jsx-runtime").JSX.Element;
19
22
  export declare function ArrowOutOfBoxIcon(): import("react/jsx-runtime").JSX.Element;
20
23
  export declare function ChevronGrabberVerticalIcon({ size, className, }: {
@@ -3,6 +3,7 @@ interface ModalProps {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  onBackdropClick?: () => void;
6
+ isOpen?: boolean;
6
7
  }
7
- export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }: {
3
3
  steps: SwapStep[];
4
4
  currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { SwapStepDescriptionBlock } from '../../types/components';
2
+ import { SwapStepDescriptionBlock, SwapStepItemStatus } from '../../types/components';
3
3
  interface SwapStepItemProps {
4
4
  descriptionBlocks: SwapStepDescriptionBlock[];
5
5
  chipContent: React.ReactNode;
6
6
  showStepSeparator?: boolean;
7
+ link?: string;
8
+ status?: SwapStepItemStatus;
7
9
  }
8
- export declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -3,8 +3,11 @@ import { SwapStepItem } from '../../components/lists/SwapStepItem';
3
3
  declare const meta: Meta<typeof SwapStepItem>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const TextOnlyDescription: Story;
6
+ export declare const Executed: Story;
7
+ export declare const Pending: Story;
8
+ export declare const Progress: Story;
7
9
  export declare const CustomDescription: Story;
8
10
  export declare const ShowSeparator: Story;
9
11
  export declare const LongDescription: Story;
10
12
  export declare const LongDescriptionWithSeparator: Story;
13
+ export declare const Link: Story;
@@ -12,6 +12,8 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
+ link?: string;
15
16
  };
16
17
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
17
18
  export type ThemeType = 'light' | 'dark';
19
+ export type SwapStepItemStatus = 'executed' | 'progress' | 'pending';
package/dist/esm/index.js CHANGED
@@ -2650,8 +2650,8 @@ function ChevronLargeRightIcon({ size = '16', className, }) {
2650
2650
  function ChevronRightSmallIcon() {
2651
2651
  return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: jsx("path", { d: "M6.66675 10.6667L8.86201 8.47141C9.12236 8.21106 9.12236 7.78896 8.86201 7.52861L6.66675 5.33334", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
2652
2652
  }
2653
- function ArrowLeftIcon() {
2654
- return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: jsx("path", { d: "M10 6L4 12L10 18M5 12H20", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
2653
+ function ArrowLeftIcon({ className, size = '24', }) {
2654
+ return (jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", className: className, children: jsx("path", { d: "M10 6L4 12L10 18M5 12H20", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
2655
2655
  }
2656
2656
  function ChevronGrabberVerticalIcon({ size = '16', className, }) {
2657
2657
  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", { d: "M5.33301 6.00002L7.52827 3.80476C7.78862 3.54441 8.21073 3.54441 8.47108 3.80476L10.6663 6.00002M5.33301 10L7.52827 12.1953C7.78862 12.4556 8.21073 12.4556 8.47108 12.1953L10.6663 10", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }) }));
@@ -3243,8 +3243,23 @@ function SwapStepSeparator() {
3243
3243
  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" }) }) }));
3244
3244
  }
3245
3245
 
3246
- function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = false, }) {
3247
- return (jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-bg-grey-800 tw-text-grey-300", children: [showStepSeparator && jsx(SwapStepSeparator, {}), jsxs("div", { className: "tw-flex tw-w-full tw-items-center tw-text-royal-400", children: [jsx("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, { className: "tw-w-squid-xl tw-bg-royal-400 tw-text-grey-900", icon: typeof chipContent === 'string' ? (jsx(CaptionText, { children: chipContent })) : (chipContent) }) }), 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", children: descriptionBlocks.map(({ type, value }, index) => {
3246
+ const statusTextClassMap = {
3247
+ executed: 'tw-text-grey-300',
3248
+ progress: 'tw-text-royal-400',
3249
+ pending: 'tw-text-grey-600',
3250
+ };
3251
+ const statusBgClassMap = {
3252
+ executed: '!tw-bg-grey-300',
3253
+ progress: '!tw-bg-royal-400',
3254
+ pending: '!tw-bg-grey-600',
3255
+ };
3256
+ const separatorClassMap = {
3257
+ executed: 'tw-text-grey-300',
3258
+ progress: 'tw-text-grey-600',
3259
+ pending: 'tw-text-grey-600',
3260
+ };
3261
+ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = false, link, status = 'pending', }) {
3262
+ return (jsxs("li", { className: "tw-flex tw-w-list-item-large tw-flex-col tw-items-start tw-bg-grey-800 tw-text-grey-300", children: [showStepSeparator && (jsx("span", { className: separatorClassMap[status], children: jsx(SwapStepSeparator, {}) })), jsxs("a", { href: link, target: "_blank", className: cn('tw-group/swap-step-item tw-flex tw-w-full tw-items-center tw-rounded-squid-xs', !!link && 'hover:tw-bg-material-light-thin', statusTextClassMap[status]), children: [jsx("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, { className: cn('tw-w-squid-xl', statusBgClassMap[status]), icon: typeof chipContent === 'string' ? (jsx(CaptionText, { children: chipContent })) : (chipContent) }) }), 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", children: descriptionBlocks.map(({ type, value }, index) => {
3248
3263
  if (type === 'string') {
3249
3264
  return (
3250
3265
  // Instead of displaying the string into a single <BodyText />
@@ -3259,23 +3274,34 @@ function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator = fals
3259
3274
  return (jsx("img", { src: value, className: "tw-h-squid-m tw-w-squid-m tw-rounded-full" }, index));
3260
3275
  }
3261
3276
  return null;
3262
- }) })] })] }));
3277
+ }) }), !!link && (jsx(ChevronLargeRightIcon, { className: "tw-mr-squid-xxs tw-hidden tw-text-material-light-average group-hover/swap-step-item:tw-block" }))] })] }));
3263
3278
  }
3264
3279
 
3265
3280
  function DropdownMenu({ dropdownRef, items, className, }) {
3266
3281
  return (jsx("div", { ref: dropdownRef, className: "tw-relative", children: jsx(Menu, { rounded: "sm", containerClassName: cn('tw-absolute tw-right-0 tw-z-20', className), contentClassName: "!tw-p-0", children: jsx("ul", { className: "tw-flex tw-w-[144px] tw-flex-col tw-gap-squid-xxs tw-overflow-auto tw-px-0 tw-py-squid-xxs", children: items.map((item) => (jsx(DropdownMenuItem, Object.assign({}, item), item.label))) }) }) }));
3267
3282
  }
3268
3283
 
3269
- function Modal({ children, className, onBackdropClick }) {
3284
+ function Modal({ children, className, onBackdropClick, isOpen: _isOpen = true, }) {
3285
+ const [isOpen, setIsOpen] = useState(_isOpen);
3286
+ useEffect(() => {
3287
+ if (_isOpen)
3288
+ return setIsOpen(true);
3289
+ const timeoutId = setTimeout(() => {
3290
+ setIsOpen(false);
3291
+ }, 300);
3292
+ return () => {
3293
+ clearTimeout(timeoutId);
3294
+ };
3295
+ }, [_isOpen]);
3270
3296
  return (
3271
3297
  // modal container (backdrop)
3272
- jsx("div", { onClick: onBackdropClick
3298
+ isOpen && (jsx("div", { onClick: onBackdropClick
3273
3299
  ? (event) => {
3274
3300
  if (event.target === event.currentTarget) {
3275
3301
  onBackdropClick();
3276
3302
  }
3277
3303
  }
3278
- : undefined, className: "tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-backdrop-blur/20 tw-backdrop-saturate-150", children: jsx("div", { className: cn('tw-relative tw-flex tw-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className), children: children }) }));
3304
+ : undefined, className: cn('tw-absolute tw-inset-0 tw-flex tw-items-start tw-justify-center tw-bg-material-dark-average tw-px-squid-xs tw-py-squid-xl tw-pb-squid-m tw-transition-all', _isOpen ? 'tw-animate-blur-in' : 'tw-animate-blur-out'), children: jsx("div", { className: cn('tw-relative tw-flex tw-max-h-[600px] tw-w-[400px] tw-flex-col tw-items-start tw-justify-end tw-gap-squid-xxs tw-self-end', className, _isOpen ? 'tw-animate-slide-to-top' : 'tw-animate-slide-to-bottom'), children: children }) })));
3279
3305
  }
3280
3306
 
3281
3307
  function NavigationBar({ title, displayBackButton = false, logoUrl, transparent = false, displayButtonShadows = false, onBackButtonClick, label = '', onAddressButtonClick, isLoading, }) {
@@ -3315,11 +3341,20 @@ function SwapProgressViewHeader({ title, description, }) {
3315
3341
  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 })] }));
3316
3342
  }
3317
3343
 
3318
- function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3319
- // handles if route component is mounted
3344
+ function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }) {
3345
+ const newStepIndex = Math.round(_newStepIndex);
3346
+ const [currentStepIndex, setCurrentStepIndex] = useState(newStepIndex);
3347
+ useEffect(() => {
3348
+ const timeoutId = setTimeout(() => {
3349
+ setCurrentStepIndex(Math.round(newStepIndex));
3350
+ }, 400);
3351
+ return () => {
3352
+ clearTimeout(timeoutId);
3353
+ };
3354
+ }, [newStepIndex]);
3355
+ // handles whether route component is mounted
3320
3356
  const [isRouteVisible, setIsRouteVisible] = useState(false);
3321
- const currentStepIndex = Math.round(_currentStepIndex);
3322
- // handles if route component is animating to show
3357
+ // handles whether route component is animating to show
3323
3358
  const [isShowRouteAnimationRunning, setIsShowRouteAnimationRunning] = useState(false);
3324
3359
  const currentStep = steps[currentStepIndex];
3325
3360
  const isLastStep = currentStepIndex === steps.length - 1;
@@ -3337,16 +3372,24 @@ function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }) {
3337
3372
  };
3338
3373
  }, [isShowRouteAnimationRunning]);
3339
3374
  const collapseRouteSteps = () => setIsShowRouteAnimationRunning(false);
3340
- return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full tw-rounded-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { onClick: () => {
3375
+ return (jsxs(Fragment, { children: [jsx(Tooltip, { tooltipContent: "View route", tooltipWidth: "max", containerClassName: "tw-w-full", childrenClassName: "tw-w-full tw-rounded-full", children: jsxs("button", { className: "tw-relative tw-max-h-button tw-overflow-hidden tw-rounded-full tw-border tw-border-material-light-thin tw-bg-grey-800", onClick: () => {
3341
3376
  // mount route component and start animation
3342
3377
  setIsRouteVisible(true);
3343
3378
  setIsShowRouteAnimationRunning(true);
3344
- }, className: "tw-relative tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-border tw-border-material-light-thin tw-bg-grey-800 tw-px-squid-xs tw-text-grey-300", children: [!isLastStep && (jsxs("span", { className: "tw-absolute -tw-top-1.5", children: [jsx("span", { className: "tw-absolute tw-top-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-grey-800 tw-to-transparent" }), jsx(SwapStepSeparator, {})] })), currentStep && (jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent })), !isFirstStep && (jsxs("span", { className: "tw-absolute -tw-bottom-1.5", children: [jsx("span", { className: "tw-absolute tw-bottom-1 tw-h-full tw-w-full -tw-translate-x-1/2 tw-bg-gradient-to-b tw-from-transparent tw-to-grey-800" }), jsx(SwapStepSeparator, {})] }))] }) }), isRouteVisible && (jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3379
+ }, children: [newStepIndex > currentStepIndex && (jsx("div", { className: "tw-animate-translate-to-bottom tw-absolute -tw-top-full tw-left-0 tw-w-full", children: jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsx(CurrentStep, { className: cn(newStepIndex > currentStepIndex &&
3380
+ 'tw-animate-translate-to-bottom', newStepIndex < currentStepIndex && 'tw-animate-translate-to-top'), currentStep: currentStep, isFirstStep: isFirstStep, isLastStep: isLastStep }), newStepIndex < currentStepIndex && (jsx("div", { className: "tw-animate-translate-to-top tw-absolute tw-left-0 tw-top-full tw-w-full", children: jsx(CurrentStep, { currentStep: steps[newStepIndex], isFirstStep: newStepIndex === 0, isLastStep: newStepIndex === steps.length - 1 }) })), jsx("span", { className: "tw-absolute tw-left-0 tw-top-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-b tw-from-grey-800" }), jsx("span", { className: "tw-absolute tw-bottom-0 tw-left-0 tw-z-20 tw-h-[21px] tw-w-full tw-bg-gradient-to-t tw-from-grey-800" })] }) }), isRouteVisible && (jsxs("div", { className: "tw-absolute tw-top-0 tw-z-20 tw-flex tw-h-[536px] tw-w-full tw-flex-col tw-justify-end tw-gap-squid-xxs", children: [jsx("div", { className: cn('tw-absolute tw-top-0 tw-h-[536px] tw-w-full tw-rounded-squid-l tw-bg-material-dark-thick tw-opacity-0 tw-backdrop-blur/10', isShowRouteAnimationRunning
3345
3381
  ? 'tw-animate-fade-in'
3346
3382
  : 'tw-animate-fade-out'), onClick: collapseRouteSteps }), jsxs("div", { className: cn('tw-flex tw-max-h-[536px] tw-w-full tw-flex-col tw-gap-squid-xxs tw-overflow-hidden tw-rounded-squid-l tw-border tw-border-material-light-thin tw-bg-grey-800 tw-backdrop-blur-2xl', isShowRouteAnimationRunning
3347
3383
  ? 'tw-animate-slide-to-top'
3348
- : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: collapseRouteSteps, 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", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1) }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3349
- }
3384
+ : 'tw-animate-slide-to-bottom'), children: [jsx("div", { className: "tw-flex tw-h-[52px] tw-items-center tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-xs", children: jsx("button", { onClick: collapseRouteSteps, 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", { className: "tw-flex tw-w-[400px] tw-flex-1 tw-flex-col-reverse tw-items-center tw-self-stretch tw-overflow-y-auto tw-overflow-x-hidden tw-px-squid-xs", children: steps.map((step, index) => (jsx(SwapStepItem, { descriptionBlocks: step.descriptionBlocks, chipContent: step.chipContent, showStepSeparator: !(index === steps.length - 1), link: step.link, status: currentStepIndex < index
3385
+ ? 'pending'
3386
+ : currentStepIndex > index
3387
+ ? 'executed'
3388
+ : 'progress' }, index))) }), jsx("footer", { className: "tw-flex tw-items-end tw-justify-center tw-gap-squid-xs tw-self-stretch tw-p-squid-s", children: jsx(Button, { size: "md", variant: "secondary", label: "View on Squidscan", className: "tw-w-full" }) })] })] }))] }));
3389
+ }
3390
+ const CurrentStep = ({ currentStep, isFirstStep, isLastStep, className, }) => {
3391
+ return (jsxs("div", { className: cn('tw-relative tw-z-10 tw-flex tw-min-h-button tw-w-full tw-items-center tw-overflow-hidden tw-rounded-squid-xxl tw-px-squid-xs tw-text-grey-300', className), children: [!isLastStep && (jsx("span", { className: "tw-absolute -tw-top-1.5 tw-z-0", children: jsx(SwapStepSeparator, {}) })), currentStep && (jsx(SwapStepItem, { descriptionBlocks: currentStep.descriptionBlocks, chipContent: currentStep.chipContent, status: "progress" })), !isFirstStep && (jsx("span", { className: "tw-absolute -tw-bottom-1.5 tw-z-0", children: jsx(SwapStepSeparator, {}) }))] }));
3392
+ };
3350
3393
 
3351
3394
  function TokenPair({ firstToken, secondToken }) {
3352
3395
  return (jsxs("div", { className: "tw-relative tw-h-[42px] tw-w-[94px]", children: [jsxs("svg", { width: "94", height: "42", viewBox: "0 0 94 42", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "tw-absolute tw-z-10 tw-text-material-light-average", children: [jsx("g", { filter: "url(#filter0_b_457_51391)", children: jsx("path", { d: "M58.5042 35.4956L58.5043 35.4957C62.5071 39.4985 67.7544 41.5 73.0001 41.5C84.3219 41.5 93.5 32.3218 93.5 21C93.5 9.67822 84.3219 0.5 73.0001 0.5C67.7544 0.499977 62.5071 2.50151 58.5043 6.50431C57.9743 7.03437 57.4538 7.57007 56.9412 8.09756L56.9403 8.09852C55.2889 9.79812 53.7279 11.4027 52.097 12.5879C50.4734 13.7678 48.8225 14.5 47 14.5C45.1775 14.5 43.5266 13.7678 41.903 12.5879C40.2721 11.4027 38.7111 9.79812 37.0597 8.09852L37.0589 8.09766C36.5463 7.57013 36.0258 7.03441 35.4957 6.50431C31.4929 2.50151 26.2456 0.499977 20.9999 0.5C15.7543 0.500023 10.5071 2.50156 6.50431 6.50431C2.50153 10.5071 0.5 15.7544 0.5 21C0.5 26.2456 2.50153 31.4929 6.50431 35.4957C10.5071 39.4984 15.7543 41.5 20.9999 41.5C26.2456 41.5 31.4929 39.4985 35.4957 35.4957L35.4958 35.4956C36.023 34.968 36.5408 34.4349 37.0508 33.9099L37.0521 33.9086C38.7042 32.2077 40.2665 30.6013 41.8988 29.4147C43.5238 28.2333 45.1763 27.5 47 27.5C48.8237 27.5 50.4762 28.2333 52.1012 29.4147C53.7335 30.6013 55.2958 32.2077 56.9479 33.9086L56.9492 33.9099C57.4592 34.4349 57.977 34.968 58.5042 35.4956Z", stroke: "currentColor" }) }), jsx("defs", { children: jsxs("filter", { id: "filter0_b_457_51391", x: "-20", y: "-20", width: "134", height: "82", filterUnits: "userSpaceOnUse", "color-interpolation-filters": "sRGB", children: [jsx("feFlood", { "flood-opacity": "0", result: "BackgroundImageFix" }), jsx("feGaussianBlur", { in: "BackgroundImageFix", stdDeviation: "10" }), jsx("feComposite", { in2: "SourceAlpha", operator: "in", result: "effect1_backgroundBlur_457_51391" }), jsx("feBlend", { mode: "normal", in: "SourceGraphic", in2: "effect1_backgroundBlur_457_51391", result: "shape" })] }) })] }), jsxs("div", { className: "tw-token-pair-mask tw-z-10 tw-flex tw-h-full tw-w-full tw-items-center tw-justify-between", style: {
@@ -14,7 +14,10 @@ export declare function ChevronLargeRightIcon({ size, className, }: {
14
14
  className?: string;
15
15
  }): import("react/jsx-runtime").JSX.Element;
16
16
  export declare function ChevronRightSmallIcon(): import("react/jsx-runtime").JSX.Element;
17
- export declare function ArrowLeftIcon(): import("react/jsx-runtime").JSX.Element;
17
+ export declare function ArrowLeftIcon({ className, size, }: {
18
+ className?: string;
19
+ size?: string;
20
+ }): import("react/jsx-runtime").JSX.Element;
18
21
  export declare function ArrowRightUpCircleIcon(): import("react/jsx-runtime").JSX.Element;
19
22
  export declare function ArrowOutOfBoxIcon(): import("react/jsx-runtime").JSX.Element;
20
23
  export declare function ChevronGrabberVerticalIcon({ size, className, }: {
@@ -3,6 +3,7 @@ interface ModalProps {
3
3
  children: React.ReactNode;
4
4
  className?: string;
5
5
  onBackdropClick?: () => void;
6
+ isOpen?: boolean;
6
7
  }
7
- export declare function Modal({ children, className, onBackdropClick }: ModalProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | import("react/jsx-runtime").JSX.Element;
8
9
  export {};
@@ -1,5 +1,5 @@
1
1
  import { SwapStep } from '../../types/components';
2
- export declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
2
+ export declare function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }: {
3
3
  steps: SwapStep[];
4
4
  currentStepIndex: number;
5
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { SwapStepDescriptionBlock } from '../../types/components';
2
+ import { SwapStepDescriptionBlock, SwapStepItemStatus } from '../../types/components';
3
3
  interface SwapStepItemProps {
4
4
  descriptionBlocks: SwapStepDescriptionBlock[];
5
5
  chipContent: React.ReactNode;
6
6
  showStepSeparator?: boolean;
7
+ link?: string;
8
+ status?: SwapStepItemStatus;
7
9
  }
8
- export declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, link, status, }: SwapStepItemProps): import("react/jsx-runtime").JSX.Element;
9
11
  export {};
@@ -3,8 +3,11 @@ import { SwapStepItem } from '../../components/lists/SwapStepItem';
3
3
  declare const meta: Meta<typeof SwapStepItem>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
- export declare const TextOnlyDescription: Story;
6
+ export declare const Executed: Story;
7
+ export declare const Pending: Story;
8
+ export declare const Progress: Story;
7
9
  export declare const CustomDescription: Story;
8
10
  export declare const ShowSeparator: Story;
9
11
  export declare const LongDescription: Story;
10
12
  export declare const LongDescriptionWithSeparator: Story;
13
+ export declare const Link: Story;
@@ -12,6 +12,8 @@ export type SwapStepDescriptionBlock = {
12
12
  export type SwapStep = {
13
13
  descriptionBlocks: SwapStepDescriptionBlock[];
14
14
  chipContent: React.ReactNode;
15
+ link?: string;
15
16
  };
16
17
  export type DetailsToolbarState = 'full' | 'loading' | 'empty' | 'error';
17
18
  export type ThemeType = 'light' | 'dark';
19
+ export type SwapStepItemStatus = 'executed' | 'progress' | 'pending';
package/dist/index.css CHANGED
@@ -589,6 +589,10 @@ video {
589
589
  bottom: -0.375rem;
590
590
  }
591
591
 
592
+ .-tw-bottom-20 {
593
+ bottom: -5rem;
594
+ }
595
+
592
596
  .-tw-left-\[2px\] {
593
597
  left: -2px;
594
598
  }
@@ -629,6 +633,10 @@ video {
629
633
  top: -4px;
630
634
  }
631
635
 
636
+ .-tw-top-full {
637
+ top: -100%;
638
+ }
639
+
632
640
  .tw-bottom-0 {
633
641
  bottom: 0px;
634
642
  }
@@ -637,10 +645,6 @@ video {
637
645
  bottom: 0.125rem;
638
646
  }
639
647
 
640
- .tw-bottom-1 {
641
- bottom: 0.25rem;
642
- }
643
-
644
648
  .tw-bottom-2 {
645
649
  bottom: 0.5rem;
646
650
  }
@@ -701,18 +705,22 @@ video {
701
705
  top: 0px;
702
706
  }
703
707
 
704
- .tw-top-1 {
705
- top: 0.25rem;
706
- }
707
-
708
708
  .tw-top-7 {
709
709
  top: 1.75rem;
710
710
  }
711
711
 
712
+ .tw-top-full {
713
+ top: 100%;
714
+ }
715
+
712
716
  .tw-top-squid-xxs {
713
717
  top: 0.3125rem;
714
718
  }
715
719
 
720
+ .tw-z-0 {
721
+ z-index: 0;
722
+ }
723
+
716
724
  .tw-z-10 {
717
725
  z-index: 10;
718
726
  }
@@ -747,6 +755,11 @@ video {
747
755
  margin-right: 0.3125rem;
748
756
  }
749
757
 
758
+ .tw-my-4 {
759
+ margin-top: 1rem;
760
+ margin-bottom: 1rem;
761
+ }
762
+
750
763
  .-tw-mb-1 {
751
764
  margin-bottom: -0.25rem;
752
765
  }
@@ -783,6 +796,10 @@ video {
783
796
  margin-right: 1px;
784
797
  }
785
798
 
799
+ .tw-mr-squid-xxs {
800
+ margin-right: 0.3125rem;
801
+ }
802
+
786
803
  .tw-mt-1 {
787
804
  margin-top: 0.25rem;
788
805
  }
@@ -859,6 +876,10 @@ video {
859
876
  height: 205px;
860
877
  }
861
878
 
879
+ .tw-h-\[21px\] {
880
+ height: 21px;
881
+ }
882
+
862
883
  .tw-h-\[22px\] {
863
884
  height: 22px;
864
885
  }
@@ -907,10 +928,6 @@ video {
907
928
  height: 55px;
908
929
  }
909
930
 
910
- .tw-h-\[600px\] {
911
- height: 600px;
912
- }
913
-
914
931
  .tw-h-\[60px\] {
915
932
  height: 60px;
916
933
  }
@@ -987,6 +1004,10 @@ video {
987
1004
  max-height: 570px;
988
1005
  }
989
1006
 
1007
+ .tw-max-h-\[600px\] {
1008
+ max-height: 600px;
1009
+ }
1010
+
990
1011
  .tw-max-h-\[60px\] {
991
1012
  max-height: 60px;
992
1013
  }
@@ -999,6 +1020,10 @@ video {
999
1020
  max-height: 80px;
1000
1021
  }
1001
1022
 
1023
+ .tw-max-h-button {
1024
+ max-height: 3.75rem;
1025
+ }
1026
+
1002
1027
  .tw-max-h-list-item-small {
1003
1028
  max-height: 2.5rem;
1004
1029
  }
@@ -1316,11 +1341,52 @@ video {
1316
1341
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1317
1342
  }
1318
1343
 
1344
+ .tw-rotate-180 {
1345
+ --tw-rotate: 180deg;
1346
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1347
+ }
1348
+
1319
1349
  .tw-rotate-90 {
1320
1350
  --tw-rotate: 90deg;
1321
1351
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1322
1352
  }
1323
1353
 
1354
+ @keyframes tw-blur-in {
1355
+ 0% {
1356
+ -webkit-backdrop-filter: blur(0px) saturate(0%);
1357
+ backdrop-filter: blur(0px) saturate(0%);
1358
+ opacity: 0;
1359
+ }
1360
+
1361
+ 100% {
1362
+ -webkit-backdrop-filter: blur(20px) saturate(150%);
1363
+ backdrop-filter: blur(20px) saturate(150%);
1364
+ opacity: 1;
1365
+ }
1366
+ }
1367
+
1368
+ .tw-animate-blur-in {
1369
+ animation: tw-blur-in 0.2s ease-out both;
1370
+ }
1371
+
1372
+ @keyframes tw-blur-out {
1373
+ 0% {
1374
+ -webkit-backdrop-filter: blur(20px) saturate(150%);
1375
+ backdrop-filter: blur(20px) saturate(150%);
1376
+ opacity: 1;
1377
+ }
1378
+
1379
+ 100% {
1380
+ -webkit-backdrop-filter: blur(0px) saturate(0%);
1381
+ backdrop-filter: blur(0px) saturate(0%);
1382
+ opacity: 0;
1383
+ }
1384
+ }
1385
+
1386
+ .tw-animate-blur-out {
1387
+ animation: tw-blur-out 0.2s ease-out both;
1388
+ }
1389
+
1324
1390
  @keyframes tw-fade-in {
1325
1391
  0% {
1326
1392
  opacity: 0;
@@ -1401,6 +1467,34 @@ video {
1401
1467
  animation: tw-slide-to-top 0.35s ease-out both;
1402
1468
  }
1403
1469
 
1470
+ @keyframes tw-translate-to-bottom {
1471
+ 0% {
1472
+ transform: translateY(0);
1473
+ }
1474
+
1475
+ 100% {
1476
+ transform: translateY(58.5px);
1477
+ }
1478
+ }
1479
+
1480
+ .tw-animate-translate-to-bottom {
1481
+ animation: tw-translate-to-bottom 0.4s ease-in-out both;
1482
+ }
1483
+
1484
+ @keyframes tw-translate-to-top {
1485
+ 0% {
1486
+ transform: translateY(0);
1487
+ }
1488
+
1489
+ 100% {
1490
+ transform: translateY(-58.5px);
1491
+ }
1492
+ }
1493
+
1494
+ .tw-animate-translate-to-top {
1495
+ animation: tw-translate-to-top 0.4s ease-in-out both;
1496
+ }
1497
+
1404
1498
  .tw-cursor-not-allowed {
1405
1499
  cursor: not-allowed;
1406
1500
  }
@@ -1707,6 +1801,23 @@ video {
1707
1801
  border-top-color: var(--squid-theme-material-light-thin);
1708
1802
  }
1709
1803
 
1804
+ .\!tw-bg-grey-300 {
1805
+ background-color: var(--squid-theme-grey-300) !important;
1806
+ }
1807
+
1808
+ .\!tw-bg-grey-600 {
1809
+ background-color: var(--squid-theme-grey-600) !important;
1810
+ }
1811
+
1812
+ .\!tw-bg-royal-400 {
1813
+ background-color: var(--squid-theme-royal-400) !important;
1814
+ }
1815
+
1816
+ .tw-bg-blue-950 {
1817
+ --tw-bg-opacity: 1;
1818
+ background-color: rgb(23 37 84 / var(--tw-bg-opacity));
1819
+ }
1820
+
1710
1821
  .tw-bg-grey-100 {
1711
1822
  background-color: var(--squid-theme-grey-100);
1712
1823
  }
@@ -1785,6 +1896,10 @@ video {
1785
1896
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
1786
1897
  }
1787
1898
 
1899
+ .tw-bg-gradient-to-t {
1900
+ background-image: linear-gradient(to top, var(--tw-gradient-stops));
1901
+ }
1902
+
1788
1903
  .tw-bg-royal-dark {
1789
1904
  background-image: linear-gradient(180deg, #BF91F2 0%, #A577D8 100%);
1790
1905
  }
@@ -1805,16 +1920,6 @@ video {
1805
1920
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1806
1921
  }
1807
1922
 
1808
- .tw-from-transparent {
1809
- --tw-gradient-from: transparent var(--tw-gradient-from-position);
1810
- --tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);
1811
- --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
1812
- }
1813
-
1814
- .tw-to-grey-800 {
1815
- --tw-gradient-to: var(--squid-theme-grey-800) var(--tw-gradient-to-position);
1816
- }
1817
-
1818
1923
  .tw-to-transparent {
1819
1924
  --tw-gradient-to: transparent var(--tw-gradient-to-position);
1820
1925
  }
@@ -1839,6 +1944,10 @@ video {
1839
1944
  padding: 0.5rem;
1840
1945
  }
1841
1946
 
1947
+ .tw-p-4 {
1948
+ padding: 1rem;
1949
+ }
1950
+
1842
1951
  .tw-p-8 {
1843
1952
  padding: 2rem;
1844
1953
  }
@@ -2495,6 +2604,14 @@ li {
2495
2604
  color: var(--squid-theme-grey-600);
2496
2605
  }
2497
2606
 
2607
+ .disabled\:tw-opacity-60:disabled {
2608
+ opacity: 0.6;
2609
+ }
2610
+
2611
+ .tw-group\/swap-step-item:hover .group-hover\/swap-step-item\:tw-block {
2612
+ display: block;
2613
+ }
2614
+
2498
2615
  .tw-group\/list-item:hover .group-hover\/list-item\:tw-flex {
2499
2616
  display: flex;
2500
2617
  }
package/dist/index.d.ts CHANGED
@@ -55,8 +55,10 @@ type SwapStepDescriptionBlock = {
55
55
  type SwapStep = {
56
56
  descriptionBlocks: SwapStepDescriptionBlock[];
57
57
  chipContent: React.ReactNode;
58
+ link?: string;
58
59
  };
59
60
  type ThemeType = 'light' | 'dark';
61
+ type SwapStepItemStatus = 'executed' | 'progress' | 'pending';
60
62
 
61
63
  interface BoostButtonProps {
62
64
  boostMode: BoostMode;
@@ -251,8 +253,10 @@ interface SwapStepItemProps {
251
253
  descriptionBlocks: SwapStepDescriptionBlock[];
252
254
  chipContent: React.ReactNode;
253
255
  showStepSeparator?: boolean;
256
+ link?: string;
257
+ status?: SwapStepItemStatus;
254
258
  }
255
- declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, }: SwapStepItemProps): react_jsx_runtime.JSX.Element;
259
+ declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparator, link, status, }: SwapStepItemProps): react_jsx_runtime.JSX.Element;
256
260
 
257
261
  interface DropdownMenuProps {
258
262
  dropdownRef?: React.RefObject<HTMLDivElement>;
@@ -279,8 +283,9 @@ interface ModalProps {
279
283
  children: React.ReactNode;
280
284
  className?: string;
281
285
  onBackdropClick?: () => void;
286
+ isOpen?: boolean;
282
287
  }
283
- declare function Modal({ children, className, onBackdropClick }: ModalProps): react_jsx_runtime.JSX.Element;
288
+ declare function Modal({ children, className, onBackdropClick, isOpen: _isOpen, }: ModalProps): false | react_jsx_runtime.JSX.Element;
284
289
 
285
290
  interface NavigationBarProps {
286
291
  title?: string;
@@ -333,7 +338,7 @@ interface SwapProgressViewHeaderProps {
333
338
  }
334
339
  declare function SwapProgressViewHeader({ title, description, }: SwapProgressViewHeaderProps): react_jsx_runtime.JSX.Element;
335
340
 
336
- declare function SwapStepsCollapsed({ steps, currentStepIndex: _currentStepIndex, }: {
341
+ declare function SwapStepsCollapsed({ steps, currentStepIndex: _newStepIndex, }: {
337
342
  steps: SwapStep[];
338
343
  currentStepIndex: number;
339
344
  }): react_jsx_runtime.JSX.Element;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.7.6",
8
+ "version": "0.8.1",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "scripts": {