@funkit/connect 8.1.0 → 8.2.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/CHANGELOG.md +66 -11
  2. package/dist/__generated__/default_configs.d.ts +7 -6
  3. package/dist/{chunk-5GV4UXWB.js → chunk-FBCU3TQA.js} +13 -2
  4. package/dist/{chunk-RJAD5CZH.js → chunk-MGQZMUZ2.js} +68 -2
  5. package/dist/{chunk-IVO7KGHT.js → chunk-OTMBU2BL.js} +13 -2
  6. package/dist/clients/fanatics.css +10775 -0
  7. package/dist/clients/fanatics.d.ts +42 -0
  8. package/dist/clients/fanatics.js +683 -0
  9. package/dist/components/Box/Box.d.ts +47 -46
  10. package/dist/components/Dialog/Dialog.d.ts +4 -2
  11. package/dist/components/Dialog/DialogContent.css.d.ts +9 -0
  12. package/dist/components/FunBottomBar/FunBottomBar.d.ts +2 -1
  13. package/dist/components/FunButton/FunIconButton.d.ts +1 -1
  14. package/dist/components/FunInfoBanner/FunInfoBanner.d.ts +5 -1
  15. package/dist/components/FunInput/FunInput.d.ts +5 -0
  16. package/dist/components/FunOptionBox/FunOptionBox.css.d.ts +1 -1
  17. package/dist/components/FunOptionBox/FunOptionBox.d.ts +2 -1
  18. package/dist/components/FunPayments/FunPaymentMethods.d.ts +7 -0
  19. package/dist/components/FunSelectBrokerage/FunBrokerageItem.d.ts +4 -1
  20. package/dist/components/FunSkeletonLoader/FunSkeletonBlock.d.ts +8 -3
  21. package/dist/components/FunTransactionSummary/FunTxSummaryComponents.d.ts +1 -0
  22. package/dist/components/HelpAlert/HelpAlert.d.ts +1 -0
  23. package/dist/components/Icons/ApplePayIcon.d.ts +4 -0
  24. package/dist/components/Icons/BitcoinIcon.d.ts +4 -0
  25. package/dist/components/Icons/FanaticsCreditCardIcon.d.ts +4 -0
  26. package/dist/components/Icons/GooglePayIcon.d.ts +4 -0
  27. package/dist/components/Icons/New/CashIcon.d.ts +4 -0
  28. package/dist/components/Icons/RevolutPayIcon.d.ts +4 -0
  29. package/dist/components/Icons/SepaBankIcon.d.ts +4 -0
  30. package/dist/components/Icons/VenmoIcon.d.ts +4 -0
  31. package/dist/components/Tabs/Tabs.d.ts +10 -0
  32. package/dist/components/Text/Text.d.ts +1 -0
  33. package/dist/components/TransactionStatus/AnimatedText.d.ts +10 -0
  34. package/dist/components/TransactionStatus/DotsDivider.d.ts +2 -0
  35. package/dist/components/TransactionStatus/StepSpinner.d.ts +17 -0
  36. package/dist/components/TransactionStatus/TransactionStatus.d.ts +5 -7
  37. package/dist/components/TransactionStatus/TransactionStatusLoading.d.ts +6 -0
  38. package/dist/consts/customers.d.ts +1 -0
  39. package/dist/css/sprinkles.css.d.ts +304 -49
  40. package/dist/domains/paymentMethods.d.ts +8 -1
  41. package/dist/hooks/queries/useWithdrawalQuote.d.ts +2 -1
  42. package/dist/hooks/usePaymentSources.d.ts +3 -1
  43. package/dist/index.css +4497 -3131
  44. package/dist/index.d.ts +1 -1
  45. package/dist/index.js +5871 -4615
  46. package/dist/modals/CheckoutModal/ConfirmationStep/CheckoutPrimaryInfo.d.ts +2 -1
  47. package/dist/modals/CheckoutModal/InputAmount/state.d.ts +2 -0
  48. package/dist/modals/CheckoutModal/InputAmount/useAmountInput.d.ts +1 -0
  49. package/dist/modals/CheckoutModal/SourceChange/CryptoCashToggle.d.ts +9 -0
  50. package/dist/modals/CheckoutModal/SourceChange/DefaultSourceList.d.ts +12 -0
  51. package/dist/modals/CheckoutModal/SourceChange/FanaticsSourceList.d.ts +15 -0
  52. package/dist/modals/CheckoutModal/SourceChange/PayPal.d.ts +2 -0
  53. package/dist/modals/CheckoutModal/SourceChange/SourceChange.d.ts +1 -1
  54. package/dist/modals/CheckoutModal/SourceChange/sourceChange.css.d.ts +1 -0
  55. package/dist/providers/FunkitConfigContext.d.ts +119 -5
  56. package/dist/providers/FunkitThemeProvider.d.ts +384 -3
  57. package/dist/themes/baseTheme.d.ts +2 -1
  58. package/dist/themes/baseTheme.js +1 -1
  59. package/dist/themes/darkTheme.js +2 -2
  60. package/dist/themes/lightTheme.js +2 -2
  61. package/dist/utils/checkout.d.ts +6 -0
  62. package/dist/utils/customer.d.ts +2 -3
  63. package/dist/utils/flags/config.d.ts +4 -43
  64. package/dist/utils/flags/resolver.d.ts +34 -0
  65. package/dist/utils/funLogger.d.ts +2 -1
  66. package/dist/wallets/walletConnectors/index.js +29 -29
  67. package/package.json +6 -5
  68. package/dist/hooks/useUsableWalletAssetsForCheckout.d.ts +0 -2
  69. package/dist/utils/flags/patches/enable-bitcoin-patch.d.ts +0 -13
@@ -1,10 +1,11 @@
1
1
  import React from 'react';
2
2
  import type { FunkitCheckoutConfig } from '../../../providers/FunkitCheckoutContext';
3
3
  interface CheckoutPrimaryInfoProps {
4
+ showLeftAlignedDollarValueWithLabel: boolean;
4
5
  showTokenAmount: boolean;
5
6
  config: FunkitCheckoutConfig;
6
7
  usdAmount?: number;
7
8
  isLoading?: boolean;
8
9
  }
9
- export declare function CheckoutPrimaryInfo({ showTokenAmount, usdAmount, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
10
+ export declare function CheckoutPrimaryInfo({ showLeftAlignedDollarValueWithLabel, showTokenAmount, usdAmount, config, isLoading, }: CheckoutPrimaryInfoProps): React.JSX.Element;
10
11
  export {};
@@ -65,6 +65,8 @@ export interface AmountInputDerivedState extends AmountInputState {
65
65
  };
66
66
  isValid: boolean;
67
67
  placeholder: string;
68
+ /** Decimal separator based on locale (e.g., '.' for en-US, ',' for de-DE) */
69
+ decimalSeparator: string;
68
70
  }
69
71
  export type AmountInputAction = {
70
72
  /** Switches between fiat and crypto input mode */
@@ -4,6 +4,7 @@ import { type AmountInputDerivedState, type AmountInputInitOptions } from './sta
4
4
  import { type InputAmountSuggestion } from './utils';
5
5
  export interface UseAmountInputResult extends AmountInputDerivedState {
6
6
  fontSize: number;
7
+ inputHeight: number;
7
8
  inputWidth: number | undefined;
8
9
  onChange(event: FunInputChangeEvent): void;
9
10
  ref: RefObject<HTMLInputElement>;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
3
+ interface CryptoCashToggleProps {
4
+ activeTab: PaymentMethodType;
5
+ onTabChange: (tab: PaymentMethodType) => void;
6
+ style?: React.CSSProperties;
7
+ }
8
+ export declare const CryptoCashToggle: ({ activeTab, onTabChange, style, }: CryptoCashToggleProps) => React.JSX.Element;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { ConnectablePaymentMethodInfo, PaymentMethod } from '../../../domains/paymentMethods';
3
+ interface DefaultSourceListProps {
4
+ preferred: (ConnectablePaymentMethodInfo | PaymentMethod)[];
5
+ moreSources: (ConnectablePaymentMethodInfo | PaymentMethod)[];
6
+ comingSoon: PaymentMethod[];
7
+ hasMoreSources: boolean;
8
+ renderSource: (source: ConnectablePaymentMethodInfo | PaymentMethod) => React.ReactNode;
9
+ renderComingSoon: (source: PaymentMethod) => React.ReactNode;
10
+ }
11
+ export declare function DefaultSourceList({ preferred, moreSources, comingSoon, hasMoreSources, renderSource, renderComingSoon, }: DefaultSourceListProps): React.JSX.Element;
12
+ export {};
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import type { ConnectablePaymentMethodInfo, PaymentMethod } from '../../../domains/paymentMethods';
3
+ import type { PaymentMethodType } from '../../../hooks/usePaymentSources';
4
+ interface FanaticsSourceListProps {
5
+ preferred: (ConnectablePaymentMethodInfo | PaymentMethod)[];
6
+ moreSources: (ConnectablePaymentMethodInfo | PaymentMethod)[];
7
+ comingSoon: PaymentMethod[];
8
+ isFallback: boolean;
9
+ renderSource: (source: ConnectablePaymentMethodInfo | PaymentMethod) => React.ReactNode;
10
+ renderComingSoon: (source: PaymentMethod) => React.ReactNode;
11
+ cryptoCashTab: PaymentMethodType;
12
+ onTabChange: (tab: PaymentMethodType) => void;
13
+ }
14
+ export declare function FanaticsSourceList({ cryptoCashTab, isFallback, onTabChange, preferred, moreSources, comingSoon, renderSource, renderComingSoon, }: FanaticsSourceListProps): React.JSX.Element;
15
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function PayPal(): React.JSX.Element | null;
@@ -27,4 +27,4 @@ export type SourceChangeNext = {
27
27
  paymentMethodInfo: ConnectablePaymentMethodInfo;
28
28
  };
29
29
  export declare const SourceChangeInfo: ModalStepInfo<FunCheckoutStep.SOURCE_CHANGE>;
30
- export declare function SourceChange({ modalState, onNext, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
30
+ export declare function SourceChange({ modalState, onClose, onNext, setModalState, }: ModalStepComponentProps<FunCheckoutStep.SOURCE_CHANGE>): React.JSX.Element;
@@ -1,2 +1,3 @@
1
1
  export declare const WITH_EMPTY_STATE_DATA_ATTRIBUTE = "data-with-empty-state";
2
2
  export declare const emptyStateStyles: string;
3
+ export declare const fanaticsSourceChangeContainer: string;
@@ -1,7 +1,10 @@
1
- import { type ReactNode } from 'react';
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ import type { BluvoExchangeType } from '../consts/bluvo';
3
+ import type { PaymentMethod } from '../domains/paymentMethods';
2
4
  export interface FunkitTextCustomizationsConfig {
3
5
  virtualFiat: string;
4
6
  brokerageOrExchange: string;
7
+ checkoutModalCloseButtonLabel: string;
5
8
  debitOrCredit: string;
6
9
  accountBalance: string;
7
10
  selectAccount: string;
@@ -11,9 +14,52 @@ export interface FunkitTextCustomizationsConfig {
11
14
  transferTokens: string;
12
15
  receiveDropdownTitle: string;
13
16
  receiveDropdownLabel: string;
17
+ txStatus?: {
18
+ failed?: {
19
+ description?: string;
20
+ title?: string;
21
+ };
22
+ delayed?: {
23
+ description?: string;
24
+ title?: string;
25
+ };
26
+ depositPending?: {
27
+ description?: string;
28
+ title?: string;
29
+ };
30
+ depositSucceeded?: {
31
+ description?: string;
32
+ title?: string;
33
+ };
34
+ submitting?: {
35
+ description?: string;
36
+ title?: string;
37
+ };
38
+ waitingForExchange?: {
39
+ description?: string;
40
+ title?: string;
41
+ };
42
+ withdrawalPending?: {
43
+ description?: string;
44
+ title?: string;
45
+ };
46
+ withdrawalSucceeded?: {
47
+ description?: string;
48
+ title?: string;
49
+ };
50
+ };
14
51
  confirmationScreen: {
15
52
  payAmountLabel: string;
16
53
  receiveAmountLabel: string;
54
+ sourceLabel?: string;
55
+ };
56
+ paymentMethodSubtitles: {
57
+ accountBalance?: string;
58
+ brokerageOrExchange?: string;
59
+ debitOrCredit?: string;
60
+ paypal?: string;
61
+ transferTokens?: string;
62
+ virtualFiat?: string;
17
63
  };
18
64
  }
19
65
  export interface FunkitUiDestinationConfig {
@@ -30,20 +76,39 @@ export interface FunkitUiSelectedRouteConfig {
30
76
  /** Label for passthrough routes - defaults to "Native Bridge" */
31
77
  passthroughLabel?: string;
32
78
  }
79
+ export type FunkitPaymentMethodIconsConfig = Partial<Record<PaymentMethod, {
80
+ src: string;
81
+ size?: {
82
+ width: number;
83
+ height: number;
84
+ };
85
+ }>>;
33
86
  export interface FunkitUiCustomizationsConfig {
34
87
  /** Title alignment - defaults to "center" */
35
88
  alignTitle?: 'left' | 'center';
36
- /** Whetehr to show CTA in uppercase - defaults to false */
89
+ /** Whether to show CTA in uppercase - defaults to false */
37
90
  callToActionsUppercase?: boolean;
91
+ /** Whether to enable compact list style for option boxes - defaults to false */
92
+ enableCompactList?: boolean;
93
+ checkoutHistory?: {
94
+ /** Whether to show the bottom "Get help" text in a {@link FunAlert} - defaults to true */
95
+ showGetHelpAsAlert?: boolean;
96
+ /** Show a simplified UI with less rows and no "More details" section - defaults to false */
97
+ simplifiedUi?: boolean;
98
+ };
38
99
  confirmationScreen?: {
39
100
  /** Custom destination icon and text used in checkout summary */
40
101
  destinationConfig?: FunkitUiDestinationConfig;
41
102
  /** when source and destination are the same address, show destination as payment method instead of source - defaults to false */
42
103
  preferDestinationWhenSame?: boolean;
104
+ /** Whether to show the bottom disclaimer in a {@link FunAlert} - defaults to true */
105
+ showDisclaimerAsAlert?: boolean;
43
106
  /** Whether to show the total payment amount in USD below the token amount equivalent - defaults to false */
44
107
  showPaymentAmountUsd?: boolean;
45
108
  /** Whether to show the total receive amount in USD below the token amount equivalent - defaults to false */
46
109
  showReceiveAmountUsd?: boolean;
110
+ /** Whether to show the amount summary above the payment method summary rather than below - defaults to false */
111
+ showAmountSummaryAbovePaymentMethod?: boolean;
47
112
  /**
48
113
  * Whether and how to show transaction fee's digest.
49
114
  * - "none": show nothing (default)
@@ -52,6 +117,8 @@ export interface FunkitUiCustomizationsConfig {
52
117
  showTransactionDigest?: 'none' | 'chainDependent';
53
118
  /** Whether to show the amount of tokens below the USD equivalent - defaults to true */
54
119
  showTokenAmount?: boolean;
120
+ /** Instead of showing the dollar value centered, show it left-aligned with "Deposit" label - defaults to false */
121
+ showLeftAlignedDollarValueWithLabel?: boolean;
55
122
  /**
56
123
  * Config for "Selected Route" row. When defined, the row is shown.
57
124
  * Omit to hide the selected route row (default).
@@ -63,29 +130,74 @@ export interface FunkitUiCustomizationsConfig {
63
130
  allowTokenAmountInput?: boolean;
64
131
  };
65
132
  selectAssetScreen?: {
133
+ /** Whether the secondary token symbol is visible - defaults to true */
134
+ isSecondaryTokenSymbolVisible?: boolean;
135
+ /** Whether to navigate directly on asset click, rather than having to select then click Continue - defaults to false */
136
+ navigateOnAssetClick?: boolean;
66
137
  /**
67
138
  * Whether to show target asset selection menu if dynamicTargetAssetCandidates exist - defaults to false
68
139
  * @deprecated use sourceChangeScreen.showTargetAssetSelection instead
69
140
  */
70
141
  showTargetAssetSelection?: boolean;
142
+ /** Function that returns a custom React component to render before other UIs in the select asset screen */
143
+ customTopComponent?: () => ReactNode;
71
144
  };
72
145
  transferCryptoScreen?: {
73
146
  /** Whether to show the "You Send -> You Receive" block in the transfer crypto screen - defaults to false */
74
147
  showYouSendYouReceive?: boolean;
148
+ /** Function that returns a custom React component to render before other UIs in the transfer crypto screen */
149
+ customTopComponent?: () => ReactNode;
150
+ };
151
+ selectBrokerageScreen?: {
152
+ /** Function that returns a custom React component to render before other UIs in the select brokerage screen */
153
+ customTopComponent?: () => ReactNode;
154
+ };
155
+ connectExchangeScreen?: {
156
+ /** Function that returns a custom React component to render before other UIs in the connect exchange screen */
157
+ customTopComponent?: () => ReactNode;
158
+ /** Function that returns a custom React component to render instead of the normal page */
159
+ CustomComponent?: ComponentType<{
160
+ appName: string;
161
+ exchangeIcon: JSX.Element | null;
162
+ exchangeName: string;
163
+ exchangeType: BluvoExchangeType | null;
164
+ }>;
75
165
  };
76
166
  sourceChangeScreen?: {
77
167
  /** Whether to show target asset selection menu if dynamicTargetAssetCandidates exist - defaults to false */
78
168
  showTargetAssetSelection?: boolean;
79
169
  /** Whether to show wallet option when balance is insufficient - defaults to false (hides wallet) */
80
170
  showWalletOnInsufficientBalance?: boolean;
171
+ /** Function that returns a custom React component to render before other UIs in the source change screen */
172
+ customTopComponent?: () => ReactNode;
173
+ paymentMethodIcons?: {
174
+ primary?: FunkitPaymentMethodIconsConfig;
175
+ /** Custom secondary icon or "value icon" in the context of FunPaymentMethodItem */
176
+ secondary?: FunkitPaymentMethodIconsConfig;
177
+ };
178
+ };
179
+ customIcons?: {
180
+ paymentDestination?: ComponentType;
181
+ paymentSource?: ComponentType;
182
+ timeEstimate?: ComponentType;
183
+ youReceive?: ComponentType;
184
+ youSend?: ComponentType;
81
185
  };
82
186
  }
187
+ /**
188
+ * Makes all properties of T required except for custom components which remains optional.
189
+ * Used for internal screen configs where we want defaults for all settings but allow
190
+ * custom slot components to be optionally provided.
191
+ */
192
+ type RequiredExceptCustomComponents<T> = Required<Omit<T & {}, `${string}Component`>>;
83
193
  export type FunkitUiCustomizationsConfigInternal = Required<FunkitUiCustomizationsConfig> & {
84
194
  confirmationScreen: FunkitUiCustomizationsConfig['confirmationScreen'] & Required<Omit<FunkitUiCustomizationsConfig['confirmationScreen'] & {}, 'destinationConfig' | 'selectedRouteConfig'>>;
85
195
  inputAmountScreen: Required<FunkitUiCustomizationsConfig['inputAmountScreen'] & {}>;
86
- selectAssetScreen: Required<FunkitUiCustomizationsConfig['selectAssetScreen'] & {}>;
87
- transferCryptoScreen: Required<FunkitUiCustomizationsConfig['transferCryptoScreen'] & {}>;
88
- sourceChangeScreen: Required<FunkitUiCustomizationsConfig['sourceChangeScreen'] & {}>;
196
+ selectAssetScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['selectAssetScreen']>;
197
+ transferCryptoScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['transferCryptoScreen']>;
198
+ selectBrokerageScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['selectBrokerageScreen']>;
199
+ connectExchangeScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['connectExchangeScreen']>;
200
+ sourceChangeScreen: RequiredExceptCustomComponents<FunkitUiCustomizationsConfig['sourceChangeScreen']>;
89
201
  };
90
202
  export declare const DEFAULT_TEXT_CUSTOMIZATIONS: FunkitTextCustomizationsConfig;
91
203
  export declare const DEFAULT_UI_CUSTOMIZATIONS: FunkitUiCustomizationsConfigInternal;
@@ -100,6 +212,8 @@ export type FunkitConfig = {
100
212
  uiCustomizations?: FunkitUiCustomizationsConfig;
101
213
  /** used to link funkit users to your own user system */
102
214
  externalUserId?: string;
215
+ /** Disable Datadog logging - defaults to false (logging enabled) */
216
+ disableLogging?: boolean;
103
217
  };
104
218
  interface FinalFunkitConfigInternal extends FunkitConfig {
105
219
  textCustomizations: FunkitTextCustomizationsConfig;