@deframe-sdk/components 0.1.63 → 0.1.64

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
@@ -11888,6 +11888,185 @@ var EarnFlowSkeletonSimple = () => {
11888
11888
  ] })
11889
11889
  ] });
11890
11890
  };
11891
+ var EarnHistoryView = ({
11892
+ items,
11893
+ isLoading,
11894
+ onClose,
11895
+ onItemClick,
11896
+ labels,
11897
+ className
11898
+ }) => {
11899
+ const [query, setQuery] = useState("");
11900
+ const filtered = useMemo(() => {
11901
+ const q = query.trim().toLowerCase();
11902
+ if (!q) return items;
11903
+ return items.filter(
11904
+ (item) => historyResolveSearchableText(item, labels.historyItem, labels.locale).includes(q)
11905
+ );
11906
+ }, [items, query, labels.historyItem, labels.locale]);
11907
+ return /* @__PURE__ */ jsxs(
11908
+ "div",
11909
+ {
11910
+ "data-test-id": "earn-history-view",
11911
+ className: twMerge(
11912
+ "bg-[var(--deframe-widget-color-bg-secondary)]",
11913
+ "rounded-[var(--deframe-widget-size-radius-md)]",
11914
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
11915
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[var(--deframe-widget-size-padding-y-md)]",
11916
+ "flex flex-col gap-[var(--deframe-widget-size-gap-md)] h-[calc(100vh-48px)]",
11917
+ "font-[var(--deframe-widget-font-family)]",
11918
+ "w-full max-w-[900px] mx-auto shrink-0 box-border",
11919
+ className
11920
+ ),
11921
+ children: [
11922
+ /* @__PURE__ */ jsxs(
11923
+ "div",
11924
+ {
11925
+ "data-test-id": "earn-history-view-header",
11926
+ className: "flex items-start justify-between gap-[var(--deframe-widget-size-gap-sm)]",
11927
+ children: [
11928
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[4px]", children: [
11929
+ /* @__PURE__ */ jsx(
11930
+ "h2",
11931
+ {
11932
+ "data-test-id": "earn-history-view-title",
11933
+ className: twMerge(
11934
+ "m-0 text-[20px] leading-[1.25]",
11935
+ "[font-weight:var(--deframe-widget-font-weight-bold)]",
11936
+ "text-[color:var(--deframe-widget-color-text-primary)]"
11937
+ ),
11938
+ children: labels.title
11939
+ }
11940
+ ),
11941
+ /* @__PURE__ */ jsx(
11942
+ "p",
11943
+ {
11944
+ "data-test-id": "earn-history-view-subtitle",
11945
+ className: "m-0 text-[13px] text-[color:var(--deframe-widget-color-text-secondary)] leading-[1.4]",
11946
+ children: labels.subtitle
11947
+ }
11948
+ )
11949
+ ] }),
11950
+ /* @__PURE__ */ jsx(
11951
+ CloseButton_default,
11952
+ {
11953
+ onClick: onClose,
11954
+ ariaLabel: labels.closeAriaLabel,
11955
+ className: "flex-shrink-0 mt-[-4px]"
11956
+ }
11957
+ )
11958
+ ]
11959
+ }
11960
+ ),
11961
+ /* @__PURE__ */ jsx("div", { className: "h-px bg-[var(--deframe-widget-color-border-secondary)]" }),
11962
+ /* @__PURE__ */ jsxs(
11963
+ "div",
11964
+ {
11965
+ "data-test-id": "earn-history-view-search",
11966
+ className: "relative",
11967
+ children: [
11968
+ /* @__PURE__ */ jsx(
11969
+ "input",
11970
+ {
11971
+ "data-test-id": "earn-history-view-search-input",
11972
+ type: "text",
11973
+ value: query,
11974
+ onChange: (e) => setQuery(e.target.value),
11975
+ placeholder: labels.searchPlaceholder,
11976
+ "aria-label": labels.searchAriaLabel,
11977
+ className: [
11978
+ "w-full box-border h-10",
11979
+ "bg-[var(--deframe-widget-color-bg-tertiary)]",
11980
+ "border border-[color:var(--deframe-widget-color-border-secondary)]",
11981
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
11982
+ "py-0 pr-[var(--deframe-widget-size-padding-x-xl)] pl-[14px]",
11983
+ "text-[14px] text-[color:var(--deframe-widget-color-text-primary)]",
11984
+ "outline-none focus:outline-none",
11985
+ "focus:border-[color:var(--deframe-widget-color-brand-primary)]",
11986
+ "transition-colors duration-150",
11987
+ "font-[var(--deframe-widget-font-family)]",
11988
+ "placeholder:text-[color:var(--deframe-widget-color-text-tertiary)]"
11989
+ ].join(" ")
11990
+ }
11991
+ ),
11992
+ /* @__PURE__ */ jsx("div", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-[color:var(--deframe-widget-color-text-tertiary)]", children: /* @__PURE__ */ jsxs(
11993
+ "svg",
11994
+ {
11995
+ width: "15",
11996
+ height: "15",
11997
+ viewBox: "0 0 24 24",
11998
+ fill: "none",
11999
+ stroke: "currentColor",
12000
+ strokeWidth: "2",
12001
+ strokeLinecap: "round",
12002
+ "aria-hidden": "true",
12003
+ children: [
12004
+ /* @__PURE__ */ jsx("circle", { cx: "11", cy: "11", r: "8" }),
12005
+ /* @__PURE__ */ jsx("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
12006
+ ]
12007
+ }
12008
+ ) })
12009
+ ]
12010
+ }
12011
+ ),
12012
+ /* @__PURE__ */ jsx(
12013
+ "div",
12014
+ {
12015
+ "data-test-id": "earn-history-view-list",
12016
+ className: "flex flex-col gap-[var(--deframe-widget-size-gap-sm)] flex-1 min-h-0 overflow-y-auto [&::-webkit-scrollbar]:w-[6px] [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-[color:var(--deframe-widget-color-border-secondary)] [&::-webkit-scrollbar-thumb]:rounded-full",
12017
+ children: isLoading ? [1, 2, 3].map((i) => /* @__PURE__ */ jsxs(
12018
+ "div",
12019
+ {
12020
+ className: twMerge(
12021
+ "flex flex-col gap-[6px]",
12022
+ "px-[var(--deframe-widget-size-padding-x-md)] py-[14px]",
12023
+ "rounded-[var(--deframe-widget-size-radius-sm)]",
12024
+ "border border-[color:var(--deframe-widget-color-border-secondary)]"
12025
+ ),
12026
+ children: [
12027
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
12028
+ /* @__PURE__ */ jsx(Skeleton, { width: "100px", height: "12px", shimmer: true }),
12029
+ /* @__PURE__ */ jsx(Skeleton, { width: "80px", height: "20px", shimmer: true, className: "rounded-full" })
12030
+ ] }),
12031
+ /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
12032
+ /* @__PURE__ */ jsx(Skeleton, { width: "160px", height: "18px", shimmer: true }),
12033
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-end gap-[4px]", children: [
12034
+ /* @__PURE__ */ jsx(Skeleton, { width: "96px", height: "14px", shimmer: true }),
12035
+ /* @__PURE__ */ jsx(Skeleton, { width: "72px", height: "12px", shimmer: true })
12036
+ ] })
12037
+ ] })
12038
+ ]
12039
+ },
12040
+ i
12041
+ )) : items.length === 0 ? /* @__PURE__ */ jsx(DashboardTransactionsPlaceholder, { title: labels.emptyTitle, description: labels.emptyDescription }) : filtered.length === 0 ? /* @__PURE__ */ jsx(
12042
+ "div",
12043
+ {
12044
+ "data-test-id": "earn-history-view-no-results",
12045
+ className: "py-[var(--deframe-widget-size-padding-y-xl)] text-center text-[13px] text-[color:var(--deframe-widget-color-text-tertiary)]",
12046
+ children: labels.emptyTitle
12047
+ }
12048
+ ) : filtered.map((item) => /* @__PURE__ */ jsx(
12049
+ "div",
12050
+ {
12051
+ onClick: onItemClick ? () => onItemClick(item.id) : void 0,
12052
+ className: onItemClick ? "cursor-pointer" : void 0,
12053
+ children: /* @__PURE__ */ jsx(
12054
+ HistoryListItemSimple,
12055
+ {
12056
+ item,
12057
+ labels: labels.historyItem,
12058
+ locale: labels.locale
12059
+ }
12060
+ )
12061
+ },
12062
+ item.id
12063
+ ))
12064
+ }
12065
+ )
12066
+ ]
12067
+ }
12068
+ );
12069
+ };
11891
12070
  var EarnDepositFormView = ({
11892
12071
  // Header / Layout
11893
12072
  headerTitle,
@@ -19210,6 +19389,6 @@ var DashboardViewSimple = ({
19210
19389
  );
19211
19390
  };
19212
19391
 
19213
- 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, 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 };
19392
+ 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 };
19214
19393
  //# sourceMappingURL=index.mjs.map
19215
19394
  //# sourceMappingURL=index.mjs.map