@deframe-sdk/components 0.1.73 → 0.1.75

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/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { HiXMark, HiChevronUp, HiChevronDown, HiChevronLeft, HiOutlineClock, HiA
4
4
  import * as React6 from 'react';
5
5
  import React6__default, { useMemo, useState, useEffect, useRef, useCallback, useId } from 'react';
6
6
  import { motion, AnimatePresence } from 'framer-motion';
7
- import { MdClose, MdOutlineSearch, MdOutlineSearchOff, MdOutlineSwapHoriz, MdHistory, MdOutlineSwapVert, MdArrowRight, MdArrowDropDown, MdOutlineArrowBack, MdOutlineArrowDropDown, MdOutlineClose, MdContentCopy, MdOutlineExpandMore, MdQrCodeScanner, MdOutlineArrowUpward, MdOutlineArrowDownward, MdCheckCircleOutline, MdErrorOutline, MdWarningAmber, MdInfoOutline, MdAccessTime, MdArrowUpward, MdArrowDownward } from 'react-icons/md';
7
+ import { MdClose, MdOutlineSearch, MdOutlineSearchOff, MdOutlineSwapHoriz, MdHistory, MdOutlineSwapVert, MdArrowRight, MdArrowDropDown, MdOutlineArrowBack, MdOutlineArrowDropDown, MdOutlineClose, MdContentCopy, MdOutlineExpandMore, MdQrCodeScanner, MdOutlineArrowUpward, MdOutlineArrowDownward, MdCheckCircleOutline, MdErrorOutline, MdWarningAmber, MdInfoOutline, MdAccessTime, MdKeyboardArrowDown, MdSettings, MdArrowUpward, MdArrowDownward } from 'react-icons/md';
8
8
  import { IoAlertCircleOutline, IoTimeOutline, IoCheckmarkOutline } from 'react-icons/io5';
9
9
  import { PiClockCountdownBold } from 'react-icons/pi';
10
10
  import QRCode from 'react-qr-code';
@@ -6846,6 +6846,7 @@ var SwapQuoteDetailsView = ({
6846
6846
  gasCostFormatted,
6847
6847
  protocolFee,
6848
6848
  slippageFormatted,
6849
+ minReceivedFormatted,
6849
6850
  etaFormatted,
6850
6851
  quoteId,
6851
6852
  hasQuoteError,
@@ -6857,6 +6858,8 @@ var SwapQuoteDetailsView = ({
6857
6858
  quoteHeaderLabel,
6858
6859
  /* @__PURE__ */ jsx(LoadingDots, {})
6859
6860
  ] }) : quoteHeaderLabel;
6861
+ const slippageDetailLabel = minReceivedFormatted ? labels.minReceivedLabel : labels.slippageLabel;
6862
+ const slippageDetailValue = minReceivedFormatted || slippageFormatted;
6860
6863
  const items = [
6861
6864
  {
6862
6865
  label: "",
@@ -6886,8 +6889,8 @@ var SwapQuoteDetailsView = ({
6886
6889
  valueClassName: "flex flex-col gap-sm w-full text-right"
6887
6890
  },
6888
6891
  {
6889
- label: labels.slippageLabel,
6890
- value: slippageFormatted
6892
+ label: slippageDetailLabel,
6893
+ value: slippageDetailValue
6891
6894
  },
6892
6895
  {
6893
6896
  label: labels.etaLabel,
@@ -8342,14 +8345,6 @@ function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
8342
8345
  ]
8343
8346
  }
8344
8347
  ),
8345
- transactionDetails.exchangeRateFormatted && /* @__PURE__ */ jsx(
8346
- "p",
8347
- {
8348
- "data-test-id": "swap-form-simple-advanced-panel-subtitle",
8349
- className: "text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] m-0 mb-[var(--deframe-widget-size-gap-sm)] leading-[1.4] font-[inherit]",
8350
- children: transactionDetails.exchangeRateFormatted
8351
- }
8352
- ),
8353
8348
  /* @__PURE__ */ jsx(
8354
8349
  "div",
8355
8350
  {
@@ -8358,9 +8353,15 @@ function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
8358
8353
  }
8359
8354
  ),
8360
8355
  /* @__PURE__ */ jsx(DetailRow, { label: transactionDetails.labels.exchangeRateLabel, value: transactionDetails.exchangeRateFormatted }),
8361
- /* @__PURE__ */ jsx(DetailRow, { label: transactionDetails.labels.blockchainCostsLabel, value: transactionDetails.totalCostFormatted }),
8362
- /* @__PURE__ */ jsx(DetailRow, { label: transactionDetails.labels.networkGasLabel, value: transactionDetails.gasCostFormatted }),
8363
- /* @__PURE__ */ jsx(DetailRow, { label: transactionDetails.labels.protocolFeeLabel, value: transactionDetails.protocolFee }),
8356
+ /* @__PURE__ */ jsx(DetailRow, { label: transactionDetails.labels.blockchainCostsLabel, value: `- ${transactionDetails.totalCostFormatted}`, valueColor: "negative" }),
8357
+ /* @__PURE__ */ jsx(
8358
+ DetailRow,
8359
+ {
8360
+ label: transactionDetails.labels.priceImpactLabel,
8361
+ value: transactionDetails.priceImpactFormatted,
8362
+ valueColor: transactionDetails.priceImpactIsPositive ? "positive" : "negative"
8363
+ }
8364
+ ),
8364
8365
  /* @__PURE__ */ jsx(
8365
8366
  SlippageDetailRow,
8366
8367
  {
@@ -8377,7 +8378,12 @@ function AdvancedPanelContent({ advancedSettings, transactionDetails }) {
8377
8378
  }
8378
8379
  );
8379
8380
  }
8380
- function DetailRow({ label, value }) {
8381
+ var valueColorClassNames = {
8382
+ default: "text-[color:var(--deframe-widget-color-text-primary)]",
8383
+ negative: "text-[color:var(--deframe-widget-color-state-error)]",
8384
+ positive: "text-[color:var(--deframe-widget-color-state-success)]"
8385
+ };
8386
+ function DetailRow({ label, value, valueColor = "default" }) {
8381
8387
  if (!label && !value) return null;
8382
8388
  return /* @__PURE__ */ jsxs(
8383
8389
  "div",
@@ -8397,7 +8403,7 @@ function DetailRow({ label, value }) {
8397
8403
  "span",
8398
8404
  {
8399
8405
  "data-test-id": "swap-form-simple-detail-row-value",
8400
- className: "text-[13px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-right font-[var(--deframe-widget-font-family)] text-[color:var(--deframe-widget-color-text-primary)]",
8406
+ className: twMerge("text-[13px] [font-weight:var(--deframe-widget-font-weight-semibold)] text-right font-[var(--deframe-widget-font-family)]", valueColorClassNames[valueColor]),
8401
8407
  children: value
8402
8408
  }
8403
8409
  )
@@ -8460,6 +8466,291 @@ function QuoteIdRow({ label, quoteId }) {
8460
8466
  }
8461
8467
  );
8462
8468
  }
8469
+ var detailValueColorClassNames = {
8470
+ default: "text-[color:var(--deframe-widget-color-text-primary)]",
8471
+ negative: "text-[color:var(--deframe-widget-color-state-error)]",
8472
+ positive: "text-[color:var(--deframe-widget-color-state-success)]"
8473
+ };
8474
+ function getPriceImpactValueColor(isPositive) {
8475
+ return isPositive ? "positive" : "negative";
8476
+ }
8477
+ function PodsDetailRow({ label, value, valueColor = "default" }) {
8478
+ if (!label && !value) return null;
8479
+ return /* @__PURE__ */ jsxs(
8480
+ "div",
8481
+ {
8482
+ "data-test-id": "pods-swap-detail-row",
8483
+ className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-md)] py-[var(--deframe-widget-size-padding-y-xs)]",
8484
+ children: [
8485
+ /* @__PURE__ */ jsx("span", { className: "text-[12px] text-[color:var(--deframe-widget-color-text-tertiary)] font-[var(--deframe-widget-font-family)] shrink-0", children: label }),
8486
+ /* @__PURE__ */ jsx(
8487
+ "span",
8488
+ {
8489
+ className: twMerge(
8490
+ "text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)] text-right",
8491
+ detailValueColorClassNames[valueColor]
8492
+ ),
8493
+ children: value
8494
+ }
8495
+ )
8496
+ ]
8497
+ }
8498
+ );
8499
+ }
8500
+ function PodsSwapQuoteDetails({ details, advancedSettings }) {
8501
+ const [isOpen, setIsOpen] = React6__default.useState(details.isVisible);
8502
+ const [isSlippageOpen, setIsSlippageOpen] = React6__default.useState(false);
8503
+ React6__default.useEffect(() => {
8504
+ if (details.isVisible) setIsOpen(true);
8505
+ }, [details.isVisible]);
8506
+ const hasErrors = details.hasQuoteError || details.hasBytecodeError;
8507
+ const shouldRenderDetails = details.isVisible || hasErrors;
8508
+ if (!shouldRenderDetails) {
8509
+ return null;
8510
+ }
8511
+ const headerLabel = details.isLoading ? /* @__PURE__ */ jsxs(Fragment, { children: [
8512
+ details.quoteHeaderLabel,
8513
+ /* @__PURE__ */ jsx(LoadingDots, {})
8514
+ ] }) : details.quoteHeaderLabel;
8515
+ const hasSlippageControls = advancedSettings.slippageOptions.length > 0;
8516
+ const handleSlippageSelect = advancedSettings.onSlippageSelect;
8517
+ const slippageDetailLabel = details.minReceivedFormatted ? details.labels.minReceivedLabel : details.labels.slippageLabel;
8518
+ const slippageDetailValue = details.minReceivedFormatted || details.slippageFormatted;
8519
+ return /* @__PURE__ */ jsxs("div", { "data-test-id": "pods-swap-quote-details", "data-slot": "pods-swap-quote-details", className: "w-full", children: [
8520
+ /* @__PURE__ */ jsxs("div", { className: "overflow-hidden rounded-[var(--deframe-widget-size-radius-sm)] border border-[color:var(--deframe-widget-color-border-secondary)] bg-[var(--deframe-widget-color-bg-secondary)]", children: [
8521
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)] px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]", children: [
8522
+ /* @__PURE__ */ jsxs(
8523
+ "button",
8524
+ {
8525
+ type: "button",
8526
+ onClick: () => setIsOpen((open) => !open),
8527
+ className: "flex min-w-0 flex-1 cursor-pointer items-center gap-[var(--deframe-widget-size-gap-sm)] border-none bg-transparent p-0 text-left outline-none",
8528
+ "aria-expanded": isOpen,
8529
+ children: [
8530
+ /* @__PURE__ */ jsx("span", { className: "text-[13px] [font-weight:var(--deframe-widget-font-weight-medium)] text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]", children: details.labels.headerLabel }),
8531
+ /* @__PURE__ */ jsx(
8532
+ motion.span,
8533
+ {
8534
+ className: "inline-flex h-4 w-4 flex-shrink-0 items-center justify-center text-[color:var(--deframe-widget-color-text-tertiary)]",
8535
+ animate: { rotate: isOpen ? 180 : 0 },
8536
+ transition: { duration: 0.2, ease: "easeInOut" },
8537
+ children: /* @__PURE__ */ jsx(MdKeyboardArrowDown, { className: "h-4 w-4", "aria-hidden": "true" })
8538
+ }
8539
+ )
8540
+ ]
8541
+ }
8542
+ ),
8543
+ hasSlippageControls && /* @__PURE__ */ jsxs(
8544
+ "button",
8545
+ {
8546
+ type: "button",
8547
+ onClick: () => setIsSlippageOpen((open) => !open),
8548
+ "aria-label": advancedSettings.slippageLabel,
8549
+ className: twMerge(
8550
+ "inline-flex h-6 flex-shrink-0 cursor-pointer items-center gap-[5px] rounded-[var(--deframe-widget-size-radius-full)] border px-[8px]",
8551
+ "text-[11px] [font-weight:var(--deframe-widget-font-weight-medium)] font-[var(--deframe-widget-font-family)] outline-none transition-all duration-150",
8552
+ isSlippageOpen ? "border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_40%,transparent)] bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_10%,transparent)] text-[color:var(--deframe-widget-color-brand-primary)]" : "border-[color:var(--deframe-widget-color-border-secondary)] bg-transparent text-[color:var(--deframe-widget-color-text-secondary)] hover:border-[color:var(--deframe-widget-color-border-primary)] hover:text-[color:var(--deframe-widget-color-text-primary)]"
8553
+ ),
8554
+ children: [
8555
+ /* @__PURE__ */ jsx(MdSettings, { className: "h-[11px] w-[11px]", "aria-hidden": "true" }),
8556
+ advancedSettings.formatPercentage(advancedSettings.slippageBps)
8557
+ ]
8558
+ }
8559
+ )
8560
+ ] }),
8561
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isOpen && /* @__PURE__ */ jsxs(
8562
+ motion.div,
8563
+ {
8564
+ initial: { height: 0, opacity: 0 },
8565
+ animate: { height: "auto", opacity: 1 },
8566
+ exit: { height: 0, opacity: 0 },
8567
+ transition: { duration: 0.2, ease: "easeInOut" },
8568
+ style: { overflow: "hidden" },
8569
+ children: [
8570
+ /* @__PURE__ */ jsx(AnimatePresence, { initial: false, children: isSlippageOpen && hasSlippageControls && /* @__PURE__ */ jsx(
8571
+ motion.div,
8572
+ {
8573
+ initial: { height: 0, opacity: 0 },
8574
+ animate: { height: "auto", opacity: 1 },
8575
+ exit: { height: 0, opacity: 0 },
8576
+ transition: { duration: 0.15, ease: "easeInOut" },
8577
+ style: { overflow: "hidden" },
8578
+ className: "border-t border-[color:var(--deframe-widget-color-border-secondary)]",
8579
+ children: /* @__PURE__ */ jsx("div", { className: "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsx(
8580
+ SlippageChip,
8581
+ {
8582
+ options: advancedSettings.slippageOptions,
8583
+ selected: advancedSettings.slippageBps,
8584
+ onSelect: handleSlippageSelect,
8585
+ formatLabel: advancedSettings.formatPercentage
8586
+ }
8587
+ ) })
8588
+ },
8589
+ "pods-slippage-panel"
8590
+ ) }),
8591
+ /* @__PURE__ */ jsx("div", { className: "border-t border-[color:var(--deframe-widget-color-border-secondary)] px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)]", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)] pt-[var(--deframe-widget-size-padding-y-sm)]", children: [
8592
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 text-[15px] [font-weight:var(--deframe-widget-font-weight-semibold)] leading-snug text-[color:var(--deframe-widget-color-text-primary)] font-[var(--deframe-widget-font-family)]", children: headerLabel }),
8593
+ details.timerElement && /* @__PURE__ */ jsx("div", { className: "flex flex-shrink-0 items-center gap-[var(--deframe-widget-size-gap-sm)]", children: details.timerElement })
8594
+ ] }) }),
8595
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col border-t border-[color:var(--deframe-widget-color-border-secondary)] px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)]", children: [
8596
+ /* @__PURE__ */ jsx(PodsDetailRow, { label: details.labels.exchangeRateLabel, value: details.exchangeRateFormatted }),
8597
+ /* @__PURE__ */ jsx("div", { className: "py-[var(--deframe-widget-size-padding-y-xs)]", children: /* @__PURE__ */ jsx(
8598
+ SwapQuoteBlockchainCostsView,
8599
+ {
8600
+ totalCostFormatted: details.totalCostFormatted,
8601
+ feePercentage: details.feePercentage,
8602
+ gasCostFormatted: details.gasCostFormatted,
8603
+ protocolFee: details.protocolFee,
8604
+ blockchainCostsLabel: details.labels.blockchainCostsLabel,
8605
+ networkGasLabel: details.labels.networkGasLabel,
8606
+ protocolFeeLabel: details.labels.protocolFeeLabel,
8607
+ collapseLabel: details.labels.costsCollapseLabel,
8608
+ expandLabel: details.labels.costsExpandLabel
8609
+ }
8610
+ ) }),
8611
+ /* @__PURE__ */ jsx(
8612
+ PodsDetailRow,
8613
+ {
8614
+ label: details.labels.priceImpactLabel,
8615
+ value: details.priceImpactFormatted,
8616
+ valueColor: getPriceImpactValueColor(details.priceImpactIsPositive)
8617
+ }
8618
+ ),
8619
+ /* @__PURE__ */ jsx(PodsDetailRow, { label: slippageDetailLabel, value: slippageDetailValue }),
8620
+ /* @__PURE__ */ jsx(PodsDetailRow, { label: details.labels.etaLabel, value: details.etaFormatted })
8621
+ ] }),
8622
+ details.quoteId && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-[var(--deframe-widget-size-gap-sm)] border-t border-[color:var(--deframe-widget-color-border-secondary)] px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-xs)]", children: [
8623
+ /* @__PURE__ */ jsx("span", { className: "text-[10px] text-[color:var(--deframe-widget-color-text-tertiary)] opacity-60 font-[var(--deframe-widget-font-family)]", children: details.labels.quoteIdLabel }),
8624
+ /* @__PURE__ */ jsx(
8625
+ AddressDisplay,
8626
+ {
8627
+ address: details.quoteId,
8628
+ className: "max-w-[150px] min-w-0 px-[8px] py-[3px]"
8629
+ }
8630
+ )
8631
+ ] })
8632
+ ]
8633
+ },
8634
+ "pods-quote-body"
8635
+ ) })
8636
+ ] }),
8637
+ /* @__PURE__ */ jsx(
8638
+ SwapQuoteErrorsView,
8639
+ {
8640
+ hasQuoteError: details.hasQuoteError,
8641
+ hasBytecodeError: details.hasBytecodeError,
8642
+ quoteErrorMessage: details.quoteErrorMessage,
8643
+ bytecodeErrorMessage: details.bytecodeErrorMessage
8644
+ }
8645
+ )
8646
+ ] });
8647
+ }
8648
+ var PodsSwapFormView = ({
8649
+ onSubmit,
8650
+ formRef,
8651
+ labels,
8652
+ onHistoryClick,
8653
+ onSwitchTokens,
8654
+ switchTokensAriaLabel,
8655
+ showHistoryTooltip = false,
8656
+ fromCard,
8657
+ toCard,
8658
+ advancedSettings,
8659
+ transactionDetails,
8660
+ priceImpactWarning,
8661
+ confirmButton
8662
+ }) => {
8663
+ const historyTooltipId = React6__default.useId();
8664
+ const historyTooltipProps = showHistoryTooltip ? { "aria-describedby": historyTooltipId, title: labels.historyAriaLabel } : {};
8665
+ const handlePercentageClick = advancedSettings.onPercentageClick;
8666
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
8667
+ /* @__PURE__ */ jsx(
8668
+ "div",
8669
+ {
8670
+ "data-testid": "pods-swap-form-view",
8671
+ "data-slot": "pods-swap-form-view",
8672
+ className: "flex-1 min-h-0 overflow-y-auto swap-flow-content px-[var(--deframe-widget-size-padding-x-sm)] pb-[var(--deframe-widget-size-padding-y-xs)]",
8673
+ children: /* @__PURE__ */ jsx("form", { ref: formRef, onSubmit, "data-testid": "pods-swap-flow-form", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-md)] text-[color:var(--deframe-widget-color-text-secondary)]", children: [
8674
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-md)]", children: [
8675
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)]", children: [
8676
+ /* @__PURE__ */ jsx(TextHeading, { variant: "h5", className: "!text-[21px]", children: /* @__PURE__ */ jsx("span", { "data-testid": "pods-swap-flow-title", children: labels.title }) }),
8677
+ labels.subtitle && /* @__PURE__ */ jsx(TextBody, { variant: "text-small", className: "!text-[14px]", children: labels.subtitle })
8678
+ ] }),
8679
+ /* @__PURE__ */ jsxs("div", { className: "relative inline-flex group", children: [
8680
+ /* @__PURE__ */ jsx(
8681
+ "button",
8682
+ __spreadProps(__spreadValues({
8683
+ "data-testid": "pods-swap-history-button",
8684
+ type: "button",
8685
+ onClick: onHistoryClick,
8686
+ className: "flex h-12 w-12 cursor-pointer items-center justify-center rounded-[var(--deframe-widget-size-radius-full)] text-[color:var(--deframe-widget-color-text-secondary)] transition-colors hover:text-[color:var(--deframe-widget-color-brand-primary)]",
8687
+ "aria-label": labels.historyAriaLabel
8688
+ }, historyTooltipProps), {
8689
+ children: /* @__PURE__ */ jsx(MdHistory, { className: "h-6 w-6", "aria-hidden": "true" })
8690
+ })
8691
+ ),
8692
+ showHistoryTooltip && /* @__PURE__ */ jsx(
8693
+ "span",
8694
+ {
8695
+ id: historyTooltipId,
8696
+ role: "tooltip",
8697
+ className: "pointer-events-none absolute right-0 top-full z-10 mt-1 whitespace-nowrap rounded-[var(--deframe-widget-size-radius-xs)] bg-[var(--deframe-widget-color-bg-tertiary)] px-2 py-1 text-xs text-[color:var(--deframe-widget-color-text-primary)] opacity-0 shadow-lg transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",
8698
+ children: labels.historyAriaLabel
8699
+ }
8700
+ )
8701
+ ] })
8702
+ ] }),
8703
+ /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-stretch gap-[var(--deframe-widget-size-gap-sm)]", children: [
8704
+ /* @__PURE__ */ jsx(
8705
+ SwapFromCardViewSimple,
8706
+ __spreadProps(__spreadValues({}, fromCard), {
8707
+ percentageOptions: advancedSettings.percentageOptions,
8708
+ onPercentageClick: handlePercentageClick,
8709
+ maxLabel: advancedSettings.maxLabel
8710
+ })
8711
+ ),
8712
+ /* @__PURE__ */ jsx("div", { className: "relative z-10 -my-5 flex justify-center", children: /* @__PURE__ */ jsx(
8713
+ "button",
8714
+ {
8715
+ "data-testid": "pods-swap-switch-tokens-button",
8716
+ type: "button",
8717
+ onClick: onSwitchTokens,
8718
+ className: "flex h-10 w-10 cursor-pointer items-center justify-center rounded-[var(--deframe-widget-size-radius-full)] bg-[var(--deframe-widget-color-brand-secondary)] text-[color:var(--deframe-widget-color-text-primary)] shadow-md transition-shadow hover:shadow-lg focus:outline-none focus:ring-2 focus:ring-[color:var(--deframe-widget-color-brand-secondary)]",
8719
+ "aria-label": switchTokensAriaLabel,
8720
+ children: /* @__PURE__ */ jsx(MdOutlineSwapVert, { className: "h-5 w-5", "aria-hidden": "true" })
8721
+ }
8722
+ ) }),
8723
+ /* @__PURE__ */ jsx(SwapToCardViewSimple, __spreadValues({}, toCard))
8724
+ ] }),
8725
+ /* @__PURE__ */ jsx("div", { className: "pb-[var(--deframe-widget-size-padding-y-xl)]", children: /* @__PURE__ */ jsx(
8726
+ PodsSwapQuoteDetails,
8727
+ {
8728
+ details: transactionDetails,
8729
+ advancedSettings
8730
+ }
8731
+ ) })
8732
+ ] }) })
8733
+ }
8734
+ ),
8735
+ /* @__PURE__ */ jsxs(
8736
+ "div",
8737
+ {
8738
+ "data-testid": "pods-swap-flow-footer",
8739
+ className: "w-full p-[var(--deframe-widget-size-padding-x-md)]",
8740
+ children: [
8741
+ priceImpactWarning && /* @__PURE__ */ jsx(
8742
+ SwapPriceImpactWarning,
8743
+ {
8744
+ warning: priceImpactWarning,
8745
+ className: "mb-[var(--deframe-widget-size-gap-sm)]"
8746
+ }
8747
+ ),
8748
+ /* @__PURE__ */ jsx("div", { "data-slot": "pods-swap-confirm-button", children: /* @__PURE__ */ jsx(ConfirmSwapButtonViewSimple, __spreadValues({}, confirmButton)) })
8749
+ ]
8750
+ }
8751
+ )
8752
+ ] });
8753
+ };
8463
8754
  var ChooseANetworkView = ({
8464
8755
  labels,
8465
8756
  autoFocus = true,
@@ -9006,8 +9297,12 @@ function AssetSearchAndList({
9006
9297
  hasMore,
9007
9298
  onLoadMore,
9008
9299
  labels,
9009
- autoFocus
9300
+ autoFocus,
9301
+ categories,
9302
+ selectedCategory,
9303
+ onCategoryChange
9010
9304
  }) {
9305
+ const hasCategories = categories && categories.length > 0;
9011
9306
  return /* @__PURE__ */ jsxs(
9012
9307
  "div",
9013
9308
  {
@@ -9038,6 +9333,48 @@ function AssetSearchAndList({
9038
9333
  )
9039
9334
  }
9040
9335
  ),
9336
+ hasCategories && /* @__PURE__ */ jsx(
9337
+ "div",
9338
+ {
9339
+ "data-test-id": "category-chips",
9340
+ "data-slot": "category-chips",
9341
+ className: "flex gap-[var(--deframe-widget-size-gap-sm)] overflow-x-auto px-[var(--deframe-widget-size-padding-x-md)] pb-[var(--deframe-widget-size-padding-y-sm)] flex-shrink-0 [scrollbar-width:none]",
9342
+ children: categories.map((cat) => {
9343
+ const isActive = cat.id === selectedCategory;
9344
+ return /* @__PURE__ */ jsx(
9345
+ "button",
9346
+ {
9347
+ type: "button",
9348
+ "data-test-id": "category-chip",
9349
+ "data-slot": "category-chip",
9350
+ onClick: () => onCategoryChange == null ? void 0 : onCategoryChange(cat.id),
9351
+ className: twMerge(
9352
+ "inline-flex items-center justify-center",
9353
+ "h-[28px] px-[10px]",
9354
+ "rounded-[var(--deframe-widget-size-radius-full)]",
9355
+ "cursor-pointer text-[12px] font-[var(--deframe-widget-font-family)]",
9356
+ "border outline-none transition-all duration-150 whitespace-nowrap flex-shrink-0",
9357
+ isActive ? [
9358
+ "border-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_32%,transparent)]",
9359
+ "bg-[color:color-mix(in_srgb,var(--deframe-widget-color-brand-primary)_12%,transparent)]",
9360
+ "text-[color:var(--deframe-widget-color-brand-primary)]",
9361
+ "[font-weight:var(--deframe-widget-font-weight-semibold)]"
9362
+ ].join(" ") : [
9363
+ "border-[color:var(--deframe-widget-color-border-secondary)]",
9364
+ "bg-transparent",
9365
+ "text-[color:var(--deframe-widget-color-text-secondary)]",
9366
+ "[font-weight:var(--deframe-widget-font-weight-regular)]",
9367
+ "hover:border-[color:var(--deframe-widget-color-border-primary)]",
9368
+ "hover:text-[color:var(--deframe-widget-color-text-primary)]"
9369
+ ].join(" ")
9370
+ ),
9371
+ children: cat.label
9372
+ },
9373
+ cat.id
9374
+ );
9375
+ })
9376
+ }
9377
+ ),
9041
9378
  /* @__PURE__ */ jsx(
9042
9379
  "div",
9043
9380
  {
@@ -9139,7 +9476,10 @@ function ChooseNetworkAndAssetViewSimple({
9139
9476
  hasMore,
9140
9477
  onLoadMore,
9141
9478
  isFetching,
9142
- labels
9479
+ labels,
9480
+ categories,
9481
+ selectedCategory,
9482
+ onCategoryChange
9143
9483
  }) {
9144
9484
  var _a;
9145
9485
  const [query, setQuery] = React6.useState("");
@@ -9234,7 +9574,10 @@ function ChooseNetworkAndAssetViewSimple({
9234
9574
  hasMore,
9235
9575
  onLoadMore,
9236
9576
  labels,
9237
- autoFocus
9577
+ autoFocus,
9578
+ categories,
9579
+ selectedCategory,
9580
+ onCategoryChange
9238
9581
  }
9239
9582
  );
9240
9583
  if (isMobile) {
@@ -19711,6 +20054,6 @@ var DashboardViewSimple = ({
19711
20054
  );
19712
20055
  };
19713
20056
 
19714
- export { ActionButton, ActionSheet, AddressDisplay, ApyRange, BackButton, BackgroundContainer, BannerNotification, Chip, ChipGroup, ChoiceCard, ChooseANetworkView, ChooseAStrategyActionsheetView, ChooseAnAssetSwapView, ChooseNetworkAndAssetViewSimple, CloseButton_default as CloseButton, CollapsibleInfoRow, CollapsibleSection, ConfirmSwapButtonView, ConfirmSwapButtonViewSimple, ConnectWalletList, Currency, DashboardBalancesBreakdown, DashboardCard, DashboardInvestmentOpportunitiesView, DashboardPortfolioView, DashboardPortfolioViewSimple, DashboardRecentTransactionsView, DashboardRecentTransactionsViewSimple, DashboardStrategiesListView, DashboardTokenListView, DashboardTokensView, DashboardTokensViewSimple, DashboardTransactionsPlaceholder, DashboardView, DashboardViewSimple, DeframeComponentsProvider, DepositSuccessIcon, DetailsHeader, EARN_CATEGORY_DEFINITIONS, EarnAmountInputView, EarnBalanceCard, EarnBytecodeErrorView, EarnDepositFailedSimpleView, EarnDepositFailedView, EarnDepositFormView, EarnDepositFormViewSimple, EarnDepositProcessingSimpleView, EarnDepositProcessingView, EarnDepositSuccessSimpleView, EarnDepositSuccessView, EarnDepositWarningSimpleView, EarnDepositWarningView, EarnDesktopView, EarnDesktopViewSimple, EarnExploreGridView, EarnFlowSkeletonSimple, EarnHistoryView, EarnInvestedSectionView, EarnInvestmentDetailsView, EarnInvestmentSummaryView, EarnNoBalanceNotificationView, EarnOverviewView, EarnPercentageButtonsView, EarnPositionCardView, EarnRecentTransactionsView, EarnTokenSelectorView, EarnTxStatusCardView, EarnWithdrawFailedSimpleView, EarnWithdrawFailedView, EarnWithdrawFormView, EarnWithdrawFormViewSimple, EarnWithdrawProcessingSimpleView, EarnWithdrawProcessingView, EarnWithdrawSuccessSimpleView, EarnWithdrawSuccessView, EarnWithdrawTokenSelectorView, EarnWithdrawWarningSimpleView, EarnWithdrawWarningView, Currency as Fiat, FlexCol, FlexRow, GroupedStrategyListView, HighRiskBadge, HistoryDepositDetailsView, HistoryListItem, HistoryListItemSimple, HistoryListSkeleton, HistoryListView, HistorySwapDetailsView, HistoryTabEmpty, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input2 as Input, InputField, InputLabel, Input as InputRoot, InvestmentCrossChainProcessingSimpleView, InvestmentCrossChainProcessingView, KYCActionRow, KYCAddressPage, KYCBasicDataPage, KYCChecklistCard, KYCChecklistItem, KYCDataCard, KYCDocumentPage, KYCEditPage, KYCFieldMessage, KYCFormPage, KYCInfoRow, KYCIntroPage, KYCLoadingPage, KYCMessageBanner, KYCPageHeader, KYCPageSection, KYCPageShell, KYCReviewPage, KYCReviewPageSkeleton, KYCStatusItemCard, KYCStatusPage, KYCStatusPanel, KYCStepIndicator, KycLoadingView, KycRequiredView, Label, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LoadingDots, LowRiskBadge, MediumRiskBadge, Navbar, OffchainMethodSelectionView, OfframpFailedSimpleView, OfframpInputFormSimpleView, OfframpInputFormView, OfframpProcessingSimpleView, OfframpProcessingView, OfframpSuccessSimpleView, OfframpSuccessView, OnchainDepositFormSimpleView, OnchainDepositFormView, OnchainDepositSuccessSimpleView, OnchainDepositSuccessView, OnchainWithdrawChainSelectorView, OnchainWithdrawFailedSimpleView, OnchainWithdrawFailedView, OnchainWithdrawFormSimpleView, OnchainWithdrawFormView, OnchainWithdrawProcessingSimpleView, OnchainWithdrawSignatureWarningSimpleView, OnchainWithdrawSignatureWarningView, OnchainWithdrawSuccessSimpleView, OnchainWithdrawSuccessView, OnrampFormSimpleView, OnrampFormView, OnrampPixcodeView, OnrampSuccessSimpleView, OnrampSuccessView, PercentageButton, PrimaryButton, ProcessingBadge, ProgressIndicator, ScrollableContent, SearchEmptyState, SearchInput, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StepDisplay, StepStatusIcon, StepStatusText, StrategyDetailsView, StrategyGridCard, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAdvancedSettingsView, SwapAmountInputView, SwapCrossChainProcessingView, SwapCrossChainProcessingViewSimple, SwapFormView, SwapFormViewSimple, SwapFromCardView, SwapFromCardViewSimple, SwapHistoryView, SwapHistoryViewSimple, SwapProcessingView, SwapProcessingViewSimple, SwapQuoteDetailsView, SwapSignatureWarningView, SwapSignatureWarningViewSimple, SwapSuccessView, SwapSuccessViewSimple, SwapToCardView, SwapToCardViewSimple, SwapTransactionFailedView, SwapTransactionFailedViewSimple, SwapWidgetFallbackView, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent, TextBody, TextHeading, Title, TokenWithChainBadge, TransactionProcessingDetails, TransactionScreen, TransactionScreenIcon, TransactionScreenInvestmentCard, WalletBalances, WalletConnectPanel, WalletItem, ConnectWalletList as WalletList, WalletListContainer, WithdrawFailedIcon, WithdrawSuccessIcon, isDustValue, truncateAddress };
20057
+ export { ActionButton, ActionSheet, AddressDisplay, ApyRange, BackButton, BackgroundContainer, BannerNotification, Chip, ChipGroup, ChoiceCard, ChooseANetworkView, ChooseAStrategyActionsheetView, ChooseAnAssetSwapView, ChooseNetworkAndAssetViewSimple, CloseButton_default as CloseButton, CollapsibleInfoRow, CollapsibleSection, ConfirmSwapButtonView, ConfirmSwapButtonViewSimple, ConnectWalletList, Currency, DashboardBalancesBreakdown, DashboardCard, DashboardInvestmentOpportunitiesView, DashboardPortfolioView, DashboardPortfolioViewSimple, DashboardRecentTransactionsView, DashboardRecentTransactionsViewSimple, DashboardStrategiesListView, DashboardTokenListView, DashboardTokensView, DashboardTokensViewSimple, DashboardTransactionsPlaceholder, DashboardView, DashboardViewSimple, DeframeComponentsProvider, DepositSuccessIcon, DetailsHeader, EARN_CATEGORY_DEFINITIONS, EarnAmountInputView, EarnBalanceCard, EarnBytecodeErrorView, EarnDepositFailedSimpleView, EarnDepositFailedView, EarnDepositFormView, EarnDepositFormViewSimple, EarnDepositProcessingSimpleView, EarnDepositProcessingView, EarnDepositSuccessSimpleView, EarnDepositSuccessView, EarnDepositWarningSimpleView, EarnDepositWarningView, EarnDesktopView, EarnDesktopViewSimple, EarnExploreGridView, EarnFlowSkeletonSimple, EarnHistoryView, EarnInvestedSectionView, EarnInvestmentDetailsView, EarnInvestmentSummaryView, EarnNoBalanceNotificationView, EarnOverviewView, EarnPercentageButtonsView, EarnPositionCardView, EarnRecentTransactionsView, EarnTokenSelectorView, EarnTxStatusCardView, EarnWithdrawFailedSimpleView, EarnWithdrawFailedView, EarnWithdrawFormView, EarnWithdrawFormViewSimple, EarnWithdrawProcessingSimpleView, EarnWithdrawProcessingView, EarnWithdrawSuccessSimpleView, EarnWithdrawSuccessView, EarnWithdrawTokenSelectorView, EarnWithdrawWarningSimpleView, EarnWithdrawWarningView, Currency as Fiat, FlexCol, FlexRow, GroupedStrategyListView, HighRiskBadge, HistoryDepositDetailsView, HistoryListItem, HistoryListItemSimple, HistoryListSkeleton, HistoryListView, HistorySwapDetailsView, HistoryTabEmpty, HistoryWithdrawDetailsView, InfoLabel, InfoRow, InfoRowIconLabel, InfoRowIconValue, InfoRowWithIcon, InfoValue, Input2 as Input, InputField, InputLabel, Input as InputRoot, InvestmentCrossChainProcessingSimpleView, InvestmentCrossChainProcessingView, KYCActionRow, KYCAddressPage, KYCBasicDataPage, KYCChecklistCard, KYCChecklistItem, KYCDataCard, KYCDocumentPage, KYCEditPage, KYCFieldMessage, KYCFormPage, KYCInfoRow, KYCIntroPage, KYCLoadingPage, KYCMessageBanner, KYCPageHeader, KYCPageSection, KYCPageShell, KYCReviewPage, KYCReviewPageSkeleton, KYCStatusItemCard, KYCStatusPage, KYCStatusPanel, KYCStepIndicator, KycLoadingView, KycRequiredView, Label, Link, ListItem, ListItemContent, ListItemLeftSide, ListItemRightSide, LoadingDots, LowRiskBadge, MediumRiskBadge, Navbar, OffchainMethodSelectionView, OfframpFailedSimpleView, OfframpInputFormSimpleView, OfframpInputFormView, OfframpProcessingSimpleView, OfframpProcessingView, OfframpSuccessSimpleView, OfframpSuccessView, OnchainDepositFormSimpleView, OnchainDepositFormView, OnchainDepositSuccessSimpleView, OnchainDepositSuccessView, OnchainWithdrawChainSelectorView, OnchainWithdrawFailedSimpleView, OnchainWithdrawFailedView, OnchainWithdrawFormSimpleView, OnchainWithdrawFormView, OnchainWithdrawProcessingSimpleView, OnchainWithdrawSignatureWarningSimpleView, OnchainWithdrawSignatureWarningView, OnchainWithdrawSuccessSimpleView, OnchainWithdrawSuccessView, OnrampFormSimpleView, OnrampFormView, OnrampPixcodeView, OnrampSuccessSimpleView, OnrampSuccessView, PercentageButton, PodsSwapFormView, PrimaryButton, ProcessingBadge, ProgressIndicator, ScrollableContent, SearchEmptyState, SearchInput, SecondaryButton, SectionCard, Select, SelectContent, SelectItem, SelectTrigger, Skeleton, StepDisplay, StepStatusIcon, StepStatusText, StrategyDetailsView, StrategyGridCard, SummaryDetails, SummaryDetailsCryptoControlV2, SwapAdvancedSettingsView, SwapAmountInputView, SwapCrossChainProcessingView, SwapCrossChainProcessingViewSimple, SwapFormView, SwapFormViewSimple, SwapFromCardView, SwapFromCardViewSimple, SwapHistoryView, SwapHistoryViewSimple, SwapProcessingView, SwapProcessingViewSimple, SwapQuoteDetailsView, SwapSignatureWarningView, SwapSignatureWarningViewSimple, SwapSuccessView, SwapSuccessViewSimple, SwapToCardView, SwapToCardViewSimple, SwapTransactionFailedView, SwapTransactionFailedViewSimple, SwapWidgetFallbackView, Tabs, TabsContent, TabsList, TabsTrigger, TertiaryButton, Text_default as Text, TextAccent, TextBody, TextHeading, Title, TokenWithChainBadge, TransactionProcessingDetails, TransactionScreen, TransactionScreenIcon, TransactionScreenInvestmentCard, WalletBalances, WalletConnectPanel, WalletItem, ConnectWalletList as WalletList, WalletListContainer, WithdrawFailedIcon, WithdrawSuccessIcon, isDustValue, truncateAddress };
19715
20058
  //# sourceMappingURL=index.mjs.map
19716
20059
  //# sourceMappingURL=index.mjs.map