@funkit/connect-rn 0.2.0-next.0 → 1.0.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.
- package/README.md +72 -0
- package/dist/index.d.ts +9 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2622 -1167
- package/dist/index.js.map +4 -4
- package/dist/src/flow/AddressCopiedToast.d.ts +18 -0
- package/dist/src/flow/AddressCopiedToast.d.ts.map +1 -0
- package/dist/src/flow/FlowSheet.d.ts +47 -0
- package/dist/src/flow/FlowSheet.d.ts.map +1 -0
- package/dist/src/flow/FunkitFlowProvider.d.ts +5 -2
- package/dist/src/flow/FunkitFlowProvider.d.ts.map +1 -1
- package/dist/src/flow/depositFlowConfig.d.ts +57 -26
- package/dist/src/flow/depositFlowConfig.d.ts.map +1 -1
- package/dist/src/flow/useKeyboardHeight.d.ts +21 -0
- package/dist/src/flow/useKeyboardHeight.d.ts.map +1 -0
- package/dist/src/geo/isCountryBlocked.d.ts +3 -0
- package/dist/src/geo/isCountryBlocked.d.ts.map +1 -0
- package/dist/src/geo/useCheckoutBlocked.d.ts +10 -0
- package/dist/src/geo/useCheckoutBlocked.d.ts.map +1 -0
- package/dist/src/icons/CopyAddressIcon.d.ts +9 -0
- package/dist/src/icons/CopyAddressIcon.d.ts.map +1 -0
- package/dist/src/icons/CryptoBitcoinIcon.d.ts +9 -0
- package/dist/src/icons/CryptoBitcoinIcon.d.ts.map +1 -0
- package/dist/src/icons/CryptoTransferQRIcon.d.ts +9 -0
- package/dist/src/icons/CryptoTransferQRIcon.d.ts.map +1 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts +19 -0
- package/dist/src/icons/FigmaSystemIcons.d.ts.map +1 -0
- package/dist/src/icons/FunIcon.d.ts +1 -1
- package/dist/src/icons/FunIcon.d.ts.map +1 -1
- package/dist/src/icons/PaymentBrandIcons.d.ts +24 -0
- package/dist/src/icons/PaymentBrandIcons.d.ts.map +1 -0
- package/dist/src/icons/QrChainCluster.d.ts +22 -0
- package/dist/src/icons/QrChainCluster.d.ts.map +1 -0
- package/dist/src/icons/SourceTokenCluster.d.ts +31 -0
- package/dist/src/icons/SourceTokenCluster.d.ts.map +1 -0
- package/dist/src/icons/TokenChainIcon.d.ts +19 -0
- package/dist/src/icons/TokenChainIcon.d.ts.map +1 -0
- package/dist/src/identity/IdentityContext.d.ts +1 -1
- package/dist/src/identity/IdentityContext.d.ts.map +1 -1
- package/dist/src/logging/datadogHttpLogTransport.d.ts.map +1 -1
- package/dist/src/providers/FunkitProvider.d.ts +11 -1
- package/dist/src/providers/FunkitProvider.d.ts.map +1 -1
- package/dist/src/providers/FunkitStatsigProvider.d.ts +1 -1
- package/dist/src/providers/FunkitStatsigProvider.d.ts.map +1 -1
- package/dist/src/screens/AddMoneyScreen.d.ts +57 -2
- package/dist/src/screens/AddMoneyScreen.d.ts.map +1 -1
- package/dist/src/screens/AvailableChainsScreen.d.ts +33 -0
- package/dist/src/screens/AvailableChainsScreen.d.ts.map +1 -0
- package/dist/src/screens/CheckoutBlockedScreen.d.ts +2 -0
- package/dist/src/screens/CheckoutBlockedScreen.d.ts.map +1 -0
- package/dist/src/screens/NetworkSelector.d.ts +31 -0
- package/dist/src/screens/NetworkSelector.d.ts.map +1 -0
- package/dist/src/screens/QrCodeScreen.d.ts +30 -14
- package/dist/src/screens/QrCodeScreen.d.ts.map +1 -1
- package/dist/src/screens/TransferCryptoScreen.d.ts +25 -14
- package/dist/src/screens/TransferCryptoScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedScreen.d.ts +1 -1
- package/dist/src/swapped/SwappedScreen.d.ts.map +1 -1
- package/dist/src/swapped/SwappedWebView.d.ts +2 -2
- package/dist/src/swapped/SwappedWebView.d.ts.map +1 -1
- package/dist/src/swapped/buildSwappedTheme.d.ts +31 -0
- package/dist/src/swapped/buildSwappedTheme.d.ts.map +1 -0
- package/dist/src/swapped/webViewSwappedTransport.d.ts +40 -13
- package/dist/src/swapped/webViewSwappedTransport.d.ts.map +1 -1
- package/dist/src/theme/FunkitThemeProvider.d.ts +1 -1
- package/dist/src/theme/FunkitThemeProvider.d.ts.map +1 -1
- package/dist/src/theme/restyle.d.ts +1010 -529
- package/dist/src/theme/restyle.d.ts.map +1 -1
- package/dist/src/theme/toRestyleTheme.d.ts +90 -48
- package/dist/src/theme/toRestyleTheme.d.ts.map +1 -1
- package/dist/src/theme/tokens.d.ts +52 -8
- package/dist/src/theme/tokens.d.ts.map +1 -1
- package/dist/src/transfer/QrCode.d.ts +12 -3
- package/dist/src/transfer/QrCode.d.ts.map +1 -1
- package/dist/src/transfer/availableChains.d.ts +53 -0
- package/dist/src/transfer/availableChains.d.ts.map +1 -0
- package/dist/src/transfer/clipboard.d.ts +16 -8
- package/dist/src/transfer/clipboard.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useFops.d.ts +12 -3
- package/dist/src/transfer/hooks/useFops.d.ts.map +1 -1
- package/dist/src/transfer/hooks/useSupportedTokens.d.ts +1 -1
- package/dist/src/transfer/hooks/useSupportedTokens.d.ts.map +1 -1
- package/dist/src/transfer/supportedTokens.d.ts +20 -9
- package/dist/src/transfer/supportedTokens.d.ts.map +1 -1
- package/package.json +23 -4
- package/dist/src/icons/ChainClusterIcon.d.ts +0 -12
- package/dist/src/icons/ChainClusterIcon.d.ts.map +0 -1
- package/dist/src/providers/index.d.ts +0 -2
- package/dist/src/providers/index.d.ts.map +0 -1
- package/dist/src/screens/ChooseChainScreen.d.ts +0 -35
- package/dist/src/screens/ChooseChainScreen.d.ts.map +0 -1
- package/dist/src/screens/CryptoCashToggle.d.ts +0 -17
- package/dist/src/screens/CryptoCashToggle.d.ts.map +0 -1
- package/dist/src/screens/SupportedTokensScreen.d.ts +0 -44
- package/dist/src/screens/SupportedTokensScreen.d.ts.map +0 -1
- package/dist/src/theme/FunkitProvider.d.ts +0 -45
- package/dist/src/theme/FunkitProvider.d.ts.map +0 -1
- package/dist/src/theme/index.d.ts +0 -7
- package/dist/src/theme/index.d.ts.map +0 -1
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { TokenTransferConfigResult } from '@funkit/connect-core';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* One curated deposit token (chain + asset), produced from the resolved
|
|
4
|
+
* `tokentransferconfig`. Consumed by the deposit flow (its chains drive the
|
|
5
|
+
* "Available chains" list).
|
|
6
|
+
*/
|
|
7
|
+
export interface SupportedToken {
|
|
8
|
+
id: string;
|
|
9
|
+
symbol: string;
|
|
10
|
+
/** Chain shown on the trailing side, e.g. "Ethereum". */
|
|
11
|
+
chainLabel: string;
|
|
12
|
+
/** Numeric chain id — used to derive the available-chains list + re-target. */
|
|
13
|
+
chainId?: number;
|
|
14
|
+
/** Token contract address. */
|
|
15
|
+
address?: string;
|
|
16
|
+
}
|
|
17
|
+
/** A curated chain entry. The first is usually `{ id: 'all', label: 'All' }`. */
|
|
18
|
+
export interface TokenChainFilter {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
}
|
|
3
22
|
/**
|
|
4
23
|
* Flatten a resolved token-transfer config (the curated Statsig
|
|
5
24
|
* `tokentransferconfig` merged with `/assets/supported` metadata — see
|
|
@@ -12,12 +31,4 @@ export declare function buildSupportedTokenList(resolved: TokenTransferConfigRes
|
|
|
12
31
|
tokens: SupportedToken[];
|
|
13
32
|
chainFilters: TokenChainFilter[];
|
|
14
33
|
};
|
|
15
|
-
/**
|
|
16
|
-
* Filter the token list by the search text (symbol or chain name, case-
|
|
17
|
-
* insensitive) and the selected chain chip (`'all'` keeps every chain).
|
|
18
|
-
*/
|
|
19
|
-
export declare function filterSupportedTokens(tokens: SupportedToken[], { search, chainFilterId, }: {
|
|
20
|
-
search?: string;
|
|
21
|
-
chainFilterId?: string;
|
|
22
|
-
}): SupportedToken[];
|
|
23
34
|
//# sourceMappingURL=supportedTokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supportedTokens.d.ts","sourceRoot":"","sources":["../../../src/transfer/supportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErE,
|
|
1
|
+
{"version":3,"file":"supportedTokens.d.ts","sourceRoot":"","sources":["../../../src/transfer/supportedTokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAErE;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAA;IAClB,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,yBAAyB,GAAG;IAC5E,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,YAAY,EAAE,gBAAgB,EAAE,CAAA;CACjC,CAgCA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funkit/connect-rn",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "React Native bindings for @funkit/connect. Re-exports the headless @funkit/connect-core logic; the RN platform halves (Restyle theme, WebView Swapped transport, Transfer/Swapped screens, logging) land in later releases.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -25,10 +25,11 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@shopify/restyle": "^2.4.5",
|
|
27
27
|
"@funkit/api-base": "4.5.1",
|
|
28
|
-
"@funkit/
|
|
29
|
-
"@funkit/
|
|
28
|
+
"@funkit/chains": "2.1.1",
|
|
29
|
+
"@funkit/connect-core": "1.1.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
+
"@gorhom/bottom-sheet": ">=5",
|
|
32
33
|
"@react-native-async-storage/async-storage": ">=1.23.1",
|
|
33
34
|
"@react-native-clipboard/clipboard": ">=1.13.0",
|
|
34
35
|
"@statsig/react-bindings": ">=3.25",
|
|
@@ -36,27 +37,38 @@
|
|
|
36
37
|
"i18next": ">=23",
|
|
37
38
|
"react": ">=18",
|
|
38
39
|
"react-native": ">=0.74",
|
|
40
|
+
"react-native-gesture-handler": ">=2.0.0",
|
|
39
41
|
"react-native-qrcode-svg": ">=6.3.0",
|
|
42
|
+
"react-native-reanimated": ">=3.0.0",
|
|
40
43
|
"react-native-svg": ">=15.0.0",
|
|
41
44
|
"react-native-webview": ">=13.0.0",
|
|
42
45
|
"viem": ">=2.22.14"
|
|
43
46
|
},
|
|
44
47
|
"devDependencies": {
|
|
48
|
+
"@gorhom/bottom-sheet": "5.2.14",
|
|
45
49
|
"@react-native-async-storage/async-storage": "2.2.0",
|
|
46
50
|
"@react-native-clipboard/clipboard": "1.16.3",
|
|
47
51
|
"@statsig/react-bindings": "3.25.4",
|
|
52
|
+
"@storybook/react-native-web-vite": "^10.4.6",
|
|
48
53
|
"@tanstack/react-query": "5.76.1",
|
|
49
54
|
"@types/react": "^19.2.2",
|
|
55
|
+
"@types/react-dom": "^19.0.0",
|
|
50
56
|
"@types/react-test-renderer": "^19.1.0",
|
|
51
57
|
"i18next": "25.6.2",
|
|
52
58
|
"react": "^19.0.0",
|
|
59
|
+
"react-dom": "^19.0.0",
|
|
53
60
|
"react-native": "0.85.3",
|
|
61
|
+
"react-native-gesture-handler": "2.31.2",
|
|
54
62
|
"react-native-qrcode-svg": "6.3.21",
|
|
63
|
+
"react-native-reanimated": "4.3.1",
|
|
55
64
|
"react-native-svg": "15.15.5",
|
|
65
|
+
"react-native-web": "^0.21.2",
|
|
56
66
|
"react-native-webview": "13.16.0",
|
|
57
67
|
"react-test-renderer": "19.2.4",
|
|
68
|
+
"storybook": "^10.4.6",
|
|
58
69
|
"tsc-alias": "1.8.16",
|
|
59
70
|
"viem": ">=2.22.14",
|
|
71
|
+
"vite": "^6.4.2",
|
|
60
72
|
"vitest": "^4.1.6"
|
|
61
73
|
},
|
|
62
74
|
"repository": {
|
|
@@ -65,6 +77,11 @@
|
|
|
65
77
|
"directory": "packages/connect-rn"
|
|
66
78
|
},
|
|
67
79
|
"homepage": "https://github.com/fun-xyz/funkit/tree/main/packages/connect-rn",
|
|
80
|
+
"peerDependenciesMeta": {
|
|
81
|
+
"@react-native-clipboard/clipboard": {
|
|
82
|
+
"optional": true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
68
85
|
"scripts": {
|
|
69
86
|
"build": "node build.js && pnpm typecheck",
|
|
70
87
|
"build:watch": "node build.js --watch",
|
|
@@ -75,6 +92,8 @@
|
|
|
75
92
|
"typegen:watch": "tsc --project tsconfig.build.json --emitDeclarationOnly --watch",
|
|
76
93
|
"lint": "oxlint",
|
|
77
94
|
"lint:fix": "oxlint --fix",
|
|
78
|
-
"test": "vitest"
|
|
95
|
+
"test": "vitest",
|
|
96
|
+
"storybook": "storybook dev -p 7007",
|
|
97
|
+
"build-storybook": "storybook build"
|
|
79
98
|
}
|
|
80
99
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The chain-cluster avatar (Figma: the `EVM Chains` icon) — a single chain logo
|
|
3
|
-
* when there's one chain, or a small 2×2 grid of chain logos on a themed circle
|
|
4
|
-
* for multi-chain groups.
|
|
5
|
-
*/
|
|
6
|
-
export interface ChainClusterIconProps {
|
|
7
|
-
/** CDN chain keys, e.g. `['ethereum', 'polygon', 'base', 'arbitrum']`. */
|
|
8
|
-
chains: string[];
|
|
9
|
-
size?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function ChainClusterIcon({ chains, size }: ChainClusterIconProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
//# sourceMappingURL=ChainClusterIcon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChainClusterIcon.d.ts","sourceRoot":"","sources":["../../../src/icons/ChainClusterIcon.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,0EAA0E;IAC1E,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,IAAS,EAAE,EAAE,qBAAqB,2CAmC5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAA"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* One selectable chain in {@link ChooseChainScreen}. The leading icon is
|
|
4
|
-
* host-supplied (brand/chain logos need assets) and falls back to a themed dot.
|
|
5
|
-
*/
|
|
6
|
-
export interface ChainOption {
|
|
7
|
-
/** Stable id passed back to `onSelectChain`. */
|
|
8
|
-
id: string;
|
|
9
|
-
label: string;
|
|
10
|
-
icon?: ReactNode;
|
|
11
|
-
/**
|
|
12
|
-
* CDN chain keys used to build the leading icon when `icon` is not supplied,
|
|
13
|
-
* e.g. `['ethereum']` or a multi-chain cluster `['base', 'arbitrum']`.
|
|
14
|
-
*/
|
|
15
|
-
iconKeys?: string[];
|
|
16
|
-
/**
|
|
17
|
-
* Numeric chain id this row selects. When set, picking the row updates the
|
|
18
|
-
* flow's active chain so the generated deposit address + QR match it.
|
|
19
|
-
*/
|
|
20
|
-
chainId?: number;
|
|
21
|
-
}
|
|
22
|
-
export interface ChooseChainScreenProps {
|
|
23
|
-
chains: ChainOption[];
|
|
24
|
-
onSelectChain: (id: string) => void;
|
|
25
|
-
onBack?: () => void;
|
|
26
|
-
title?: string;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* The "Choose chain" screen (Figma: Fun Mobile / Transfer Crypto chain list) —
|
|
30
|
-
* shown when the user taps "Change" on the Transfer screen. A themed
|
|
31
|
-
* bottom-sheet surface: back + centered title + a list of chains. Selecting a
|
|
32
|
-
* chain returns it to the host via `onSelectChain`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function ChooseChainScreen({ chains, onSelectChain, onBack, title, }: ChooseChainScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
//# sourceMappingURL=ChooseChainScreen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ChooseChainScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/ChooseChainScreen.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAKtC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,aAAa,EACb,MAAM,EACN,KAAyB,GAC1B,EAAE,sBAAsB,2CAqDxB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/** Which Add money tab is active. Mirrors web's `PaymentMethodType`. */
|
|
2
|
-
export type PaymentTab = 'crypto' | 'cash';
|
|
3
|
-
export interface CryptoCashToggleProps {
|
|
4
|
-
active: PaymentTab;
|
|
5
|
-
onChange: (tab: PaymentTab) => void;
|
|
6
|
-
cryptoLabel?: string;
|
|
7
|
-
cashLabel?: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* The "Use Crypto" / "Use Cash" segmented toggle on the Add money screen
|
|
11
|
-
* (mirrors web's `CryptoCashToggle`). Presentational: the active tab + handler
|
|
12
|
-
* are owned by the flow, which swaps the method list beneath it. Brand icons
|
|
13
|
-
* are omitted here (the package stays `react-native-svg`-free); the labels
|
|
14
|
-
* carry the meaning.
|
|
15
|
-
*/
|
|
16
|
-
export declare function CryptoCashToggle({ active, onChange, cryptoLabel, cashLabel, }: CryptoCashToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
-
//# sourceMappingURL=CryptoCashToggle.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoCashToggle.d.ts","sourceRoot":"","sources":["../../../src/screens/CryptoCashToggle.tsx"],"names":[],"mappings":"AAIA,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAA;AAE1C,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,CAAC,GAAG,EAAE,UAAU,KAAK,IAAI,CAAA;IACnC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,WAA0B,EAC1B,SAAsB,GACvB,EAAE,qBAAqB,2CAoBvB"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* One supported token row in {@link SupportedTokensScreen}. The icon (token +
|
|
4
|
-
* chain badge) is host-supplied; falls back to a themed dot.
|
|
5
|
-
*/
|
|
6
|
-
export interface SupportedToken {
|
|
7
|
-
id: string;
|
|
8
|
-
symbol: string;
|
|
9
|
-
/** Chain shown on the trailing side, e.g. "Ethereum". */
|
|
10
|
-
chainLabel: string;
|
|
11
|
-
icon?: ReactNode;
|
|
12
|
-
/** Numeric chain id — used to filter by the chain chips and to re-target. */
|
|
13
|
-
chainId?: number;
|
|
14
|
-
/** Token contract address — used to re-target the deposit on selection. */
|
|
15
|
-
address?: string;
|
|
16
|
-
}
|
|
17
|
-
/** A chain filter chip. The first is usually `{ id: 'all', label: 'All' }`. */
|
|
18
|
-
export interface TokenChainFilter {
|
|
19
|
-
id: string;
|
|
20
|
-
label: string;
|
|
21
|
-
}
|
|
22
|
-
export interface SupportedTokensScreenProps {
|
|
23
|
-
/** Tokens to display (already filtered by the host for search/chain). */
|
|
24
|
-
tokens: SupportedToken[];
|
|
25
|
-
onSelectToken?: (id: string) => void;
|
|
26
|
-
/** Controlled search value + handler (the host does the filtering). */
|
|
27
|
-
searchValue?: string;
|
|
28
|
-
onSearchChange?: (text: string) => void;
|
|
29
|
-
searchPlaceholder?: string;
|
|
30
|
-
/** Chain filter chips (include "All"); `selectedChainFilterId` highlights one. */
|
|
31
|
-
chainFilters?: TokenChainFilter[];
|
|
32
|
-
selectedChainFilterId?: string;
|
|
33
|
-
onSelectChainFilter?: (id: string) => void;
|
|
34
|
-
onBack?: () => void;
|
|
35
|
-
title?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The "Supported tokens" screen (Figma: Fun Mobile / Supported tokens) — shown
|
|
39
|
-
* from the Transfer screen's chain name / info affordance. Back + title, a
|
|
40
|
-
* search field, chain filter chips, and the token list. Controlled/presentational:
|
|
41
|
-
* search text + selected chip + the (pre-filtered) token list come from the host.
|
|
42
|
-
*/
|
|
43
|
-
export declare function SupportedTokensScreen({ tokens, onSelectToken, searchValue, onSearchChange, searchPlaceholder, chainFilters, selectedChainFilterId, onSelectChainFilter, onBack, title, }: SupportedTokensScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
-
//# sourceMappingURL=SupportedTokensScreen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SupportedTokensScreen.d.ts","sourceRoot":"","sources":["../../../src/screens/SupportedTokensScreen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,yDAAyD;IACzD,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,+EAA+E;AAC/E,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,0BAA0B;IACzC,yEAAyE;IACzE,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,kFAAkF;IAClF,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACjC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,aAAa,EACb,WAAW,EACX,cAAc,EACd,iBAAkC,EAClC,YAAiB,EACjB,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,EACN,KAA0B,GAC3B,EAAE,0BAA0B,2CAsH5B"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import { type ColorScheme } from './useColorScheme';
|
|
3
|
-
import type { FunkitThemeSet } from './useFunkitTheme';
|
|
4
|
-
interface FunkitColorSchemeValue {
|
|
5
|
-
/** The active, resolved color scheme. */
|
|
6
|
-
colorScheme: ColorScheme;
|
|
7
|
-
/**
|
|
8
|
-
* Flip light↔dark, or set a specific scheme when an argument is given.
|
|
9
|
-
* **No-op when the provider's `colorScheme` prop is set** (controlled mode) —
|
|
10
|
-
* the host owns the scheme in that case.
|
|
11
|
-
*/
|
|
12
|
-
toggleColorScheme: (next?: ColorScheme) => void;
|
|
13
|
-
/** True when the scheme is forced by the `colorScheme` prop (uncontrolled toggle disabled). */
|
|
14
|
-
isControlled: boolean;
|
|
15
|
-
}
|
|
16
|
-
export interface FunkitProviderProps {
|
|
17
|
-
children: ReactNode;
|
|
18
|
-
/**
|
|
19
|
-
* The light/dark Restyle theme set. Defaults to the built-in Fun Mobile
|
|
20
|
-
* themes. Pass `{ light, dark }` from `toRestyleTheme(...)` to customize.
|
|
21
|
-
*/
|
|
22
|
-
themes?: FunkitThemeSet;
|
|
23
|
-
/**
|
|
24
|
-
* Force a color scheme. When provided the provider is **controlled**: it
|
|
25
|
-
* always renders this scheme, ignores the system Appearance, and
|
|
26
|
-
* `toggleColorScheme()` becomes a no-op. When omitted the provider is
|
|
27
|
-
* **uncontrolled**: the scheme follows the system Appearance and can be
|
|
28
|
-
* flipped with `toggleColorScheme()`.
|
|
29
|
-
*/
|
|
30
|
-
colorScheme?: ColorScheme;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Top-level provider for `@funkit/connect-rn`. Wires the active Restyle theme
|
|
34
|
-
* (selected from `themes` by color scheme) into Restyle's `ThemeProvider`, and
|
|
35
|
-
* exposes the scheme + a manual toggle via {@link useFunkitColorScheme}.
|
|
36
|
-
*/
|
|
37
|
-
export declare function FunkitProvider({ children, themes, colorScheme, }: FunkitProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
/**
|
|
39
|
-
* Read the active color scheme and toggle it. Must be used within a
|
|
40
|
-
* {@link FunkitProvider}. `toggleColorScheme` is a no-op when the provider is
|
|
41
|
-
* in controlled mode (a `colorScheme` prop was passed).
|
|
42
|
-
*/
|
|
43
|
-
export declare function useFunkitColorScheme(): FunkitColorSchemeValue;
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=FunkitProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FunkitProvider.d.ts","sourceRoot":"","sources":["../../../src/theme/FunkitProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,OAAO,CAAA;AAGd,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAItD,UAAU,sBAAsB;IAC9B,yCAAyC;IACzC,WAAW,EAAE,WAAW,CAAA;IACxB;;;;OAIG;IACH,iBAAiB,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAC/C,+FAA+F;IAC/F,YAAY,EAAE,OAAO,CAAA;CACtB;AAMD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAA;IACvB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,QAAQ,EACR,MAAuB,EACvB,WAAW,GACZ,EAAE,mBAAmB,2CAqCrB;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,sBAAsB,CAM7D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA"}
|