@txnlab/use-wallet-ui-react 1.0.0 → 1.1.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 +20 -0
- package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs +5 -0
- package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs.map +1 -0
- package/dist/cjs/index.cjs +15 -18
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/plugins/export-key.cjs +9 -0
- package/dist/cjs/plugins/export-key.cjs.map +1 -0
- package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js +2599 -0
- package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js.map +1 -0
- package/dist/esm/index.js +4780 -7744
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/plugins/export-key.js +3030 -0
- package/dist/esm/plugins/export-key.js.map +1 -0
- package/dist/style.css +112 -1
- package/dist/types/components/AlgoSymbol.d.ts +11 -0
- package/dist/types/components/AlgoSymbol.d.ts.map +1 -0
- package/dist/types/components/ConnectWalletButton.d.ts +9 -0
- package/dist/types/components/ConnectWalletButton.d.ts.map +1 -0
- package/dist/types/components/ConnectWalletMenu.d.ts +10 -0
- package/dist/types/components/ConnectWalletMenu.d.ts.map +1 -0
- package/dist/types/components/ConnectedWalletButton.d.ts +9 -0
- package/dist/types/components/ConnectedWalletButton.d.ts.map +1 -0
- package/dist/types/components/ConnectedWalletMenu.d.ts +10 -0
- package/dist/types/components/ConnectedWalletMenu.d.ts.map +1 -0
- package/dist/types/components/NfdAvatar.d.ts +24 -0
- package/dist/types/components/NfdAvatar.d.ts.map +1 -0
- package/dist/types/components/WalletButton.d.ts +12 -0
- package/dist/types/components/WalletButton.d.ts.map +1 -0
- package/dist/types/components/WalletList.d.ts +7 -0
- package/dist/types/components/WalletList.d.ts.map +1 -0
- package/dist/types/hooks/useAccountInfo.d.ts +12 -0
- package/dist/types/hooks/useAccountInfo.d.ts.map +1 -0
- package/dist/types/hooks/useNfd.d.ts +32 -0
- package/dist/types/hooks/useNfd.d.ts.map +1 -0
- package/dist/types/hooks/useResolvedTheme.d.ts +11 -0
- package/dist/types/hooks/useResolvedTheme.d.ts.map +1 -0
- package/dist/types/index.d.cts +17 -197
- package/dist/types/index.d.ts +17 -197
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/plugins/PluginContext.d.ts +29 -0
- package/dist/types/plugins/PluginContext.d.ts.map +1 -0
- package/dist/types/plugins/PluginDialogRenderer.d.ts +10 -0
- package/dist/types/plugins/PluginDialogRenderer.d.ts.map +1 -0
- package/dist/types/plugins/PluginLifecycleManager.d.ts +9 -0
- package/dist/types/plugins/PluginLifecycleManager.d.ts.map +1 -0
- package/dist/types/plugins/PluginSlot.d.ts +10 -0
- package/dist/types/plugins/PluginSlot.d.ts.map +1 -0
- package/dist/types/plugins/export-key/ExportKeyDialog.d.ts +6 -0
- package/dist/types/plugins/export-key/ExportKeyDialog.d.ts.map +1 -0
- package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts +5 -0
- package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts.map +1 -0
- package/dist/types/plugins/export-key/constants.d.ts +2 -0
- package/dist/types/plugins/export-key/constants.d.ts.map +1 -0
- package/dist/types/plugins/export-key/index.d.cts +12 -0
- package/dist/types/plugins/export-key/index.d.ts +12 -0
- package/dist/types/plugins/export-key/index.d.ts.map +1 -0
- package/dist/types/plugins/index.d.ts +6 -0
- package/dist/types/plugins/index.d.ts.map +1 -0
- package/dist/types/plugins/types.d.ts +109 -0
- package/dist/types/plugins/types.d.ts.map +1 -0
- package/dist/types/providers/WalletUIProvider.d.ts +58 -0
- package/dist/types/providers/WalletUIProvider.d.ts.map +1 -0
- package/dist/types/test/setup.d.ts +2 -0
- package/dist/types/test/setup.d.ts.map +1 -0
- package/dist/types/utils/cn.d.ts +16 -0
- package/dist/types/utils/cn.d.ts.map +1 -0
- package/dist/types/utils/fontLoader.d.ts +8 -0
- package/dist/types/utils/fontLoader.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/ipfs.d.ts +10 -0
- package/dist/types/utils/ipfs.d.ts.map +1 -0
- package/dist/types/utils/ipfs.test.d.ts +2 -0
- package/dist/types/utils/ipfs.test.d.ts.map +1 -0
- package/package.json +21 -11
package/dist/types/index.d.cts
CHANGED
|
@@ -1,197 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
style?: default_2.CSSProperties;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export declare function ConnectedWalletMenu(props: ConnectedWalletMenuProps): JSX.Element;
|
|
22
|
-
|
|
23
|
-
declare interface ConnectedWalletMenuProps {
|
|
24
|
-
children?: RefableElement_2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export declare const ConnectWalletButton: default_2.ForwardRefExoticComponent<ConnectWalletButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
|
|
29
|
-
declare interface ConnectWalletButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
-
/** Size variant for the button */
|
|
31
|
-
size?: ButtonSize;
|
|
32
|
-
style?: default_2.CSSProperties;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare function ConnectWalletMenu({ children }: ConnectWalletMenuProps): JSX.Element;
|
|
36
|
-
|
|
37
|
-
declare interface ConnectWalletMenuProps {
|
|
38
|
-
children?: RefableElement;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Component for displaying NFD avatar images with automatic IPFS handling
|
|
43
|
-
* - Handles IPFS URLs by converting them to HTTPS
|
|
44
|
-
* - Checks availability on images.nf.domains and falls back to IPFS gateway if needed
|
|
45
|
-
* - Caches results using TanStack Query
|
|
46
|
-
*/
|
|
47
|
-
export declare function NfdAvatar({ nfd, alt, className, size, fallback, lightOnly, }: NfdAvatarProps): JSX.Element;
|
|
48
|
-
|
|
49
|
-
declare interface NfdAvatarProps {
|
|
50
|
-
/** NFD record containing avatar data */
|
|
51
|
-
nfd: NfdRecord | null | undefined;
|
|
52
|
-
/** Optional alt text for the image (defaults to NFD name or 'NFD Avatar') */
|
|
53
|
-
alt?: string;
|
|
54
|
-
/** Optional className for styling the image */
|
|
55
|
-
className?: string;
|
|
56
|
-
/** Optional size in pixels (defaults to 40px) */
|
|
57
|
-
size?: number;
|
|
58
|
-
/** Optional fallback element to show when no avatar is available */
|
|
59
|
-
fallback?: default_2.ReactNode;
|
|
60
|
-
/** Optional flag to show light only avatar */
|
|
61
|
-
lightOnly?: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export declare type NfdLookupResponse = {
|
|
65
|
-
[address: string]: NfdRecord | null;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export declare type NfdRecord = {
|
|
69
|
-
name: string;
|
|
70
|
-
properties: {
|
|
71
|
-
verified: {
|
|
72
|
-
[key: string]: string;
|
|
73
|
-
};
|
|
74
|
-
userDefined: {
|
|
75
|
-
[key: string]: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
image?: string;
|
|
79
|
-
avatar?: {
|
|
80
|
-
url?: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
declare type NfdView = 'tiny' | 'thumbnail' | 'brief' | 'full';
|
|
85
|
-
|
|
86
|
-
declare type RefableElement = ReactElement & {
|
|
87
|
-
ref?: RefObject<HTMLElement> | ((instance: HTMLElement | null) => void);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
declare type RefableElement_2 = ReactElement & {
|
|
91
|
-
ref?: RefObject<HTMLElement> | ((instance: HTMLElement | null) => void);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export declare type ResolvedTheme = 'light' | 'dark';
|
|
95
|
-
|
|
96
|
-
export declare type Theme = 'light' | 'dark' | 'system';
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Custom hook to fetch account information for Algorand address
|
|
100
|
-
*
|
|
101
|
-
* @param options.enabled Whether to enable the account lookup (defaults to true)
|
|
102
|
-
* @returns Account information query result
|
|
103
|
-
*/
|
|
104
|
-
export declare function useAccountInfo(options?: {
|
|
105
|
-
enabled?: boolean;
|
|
106
|
-
}): UseQueryResult<default_3.modelsv2.Account | null>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Custom hook to fetch NFD data for an Algorand address
|
|
110
|
-
*
|
|
111
|
-
* @param options.enabled Whether to enable the NFD lookup (defaults to true)
|
|
112
|
-
* @param options.view The view type for the NFD lookup ('tiny', 'thumbnail', 'brief', 'full') (defaults to 'thumbnail')
|
|
113
|
-
* @returns NFD data query result
|
|
114
|
-
*/
|
|
115
|
-
export declare function useNfd(options?: {
|
|
116
|
-
enabled?: boolean;
|
|
117
|
-
view?: NfdView;
|
|
118
|
-
}): UseQueryResult<NfdRecord | null>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Hook to resolve the actual theme value, handling 'system' preference detection.
|
|
122
|
-
* When theme is 'system', it listens to the user's OS/browser color scheme preference.
|
|
123
|
-
*
|
|
124
|
-
* @param theme - The theme setting: 'light', 'dark', or 'system'
|
|
125
|
-
* @returns The resolved theme: 'light' or 'dark'
|
|
126
|
-
*/
|
|
127
|
-
export declare function useResolvedTheme(theme: Theme): ResolvedTheme;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Hook to access the WalletUI context
|
|
131
|
-
* @throws Error if used outside of WalletUIProvider
|
|
132
|
-
*/
|
|
133
|
-
export declare function useWalletUI(): WalletUIContextType;
|
|
134
|
-
|
|
135
|
-
export declare function WalletButton({ size, className, style }: WalletButtonProps): JSX.Element;
|
|
136
|
-
|
|
137
|
-
declare interface WalletButtonProps {
|
|
138
|
-
/** Size variant for the button */
|
|
139
|
-
size?: ButtonSize;
|
|
140
|
-
/** Additional CSS classes to apply to the button */
|
|
141
|
-
className?: string;
|
|
142
|
-
/** Inline styles to apply to the button (can include CSS variable overrides) */
|
|
143
|
-
style?: default_2.CSSProperties;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export declare function WalletList({ wallets, handleWalletClick }: WalletListProps): JSX.Element;
|
|
147
|
-
|
|
148
|
-
declare interface WalletListProps {
|
|
149
|
-
wallets: Wallet[];
|
|
150
|
-
handleWalletClick: (wallet: Wallet) => Promise<void>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare interface WalletUIContextType {
|
|
154
|
-
queryClient: QueryClient;
|
|
155
|
-
theme: Theme;
|
|
156
|
-
resolvedTheme: ResolvedTheme;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Provider that enables wallet UI components to work with TanStack Query.
|
|
161
|
-
* It can use an existing QueryClient from the parent application or create its own.
|
|
162
|
-
* Also creates a QueryClientProvider if none exists in the parent tree.
|
|
163
|
-
*
|
|
164
|
-
* Automatically prefetches data for all accounts in connected wallets for smoother
|
|
165
|
-
* account switching experience.
|
|
166
|
-
*
|
|
167
|
-
* Supports theme configuration via the `theme` prop:
|
|
168
|
-
* - 'light': Always use light mode
|
|
169
|
-
* - 'dark': Always use dark mode
|
|
170
|
-
* - 'system': Follow the user's OS/browser preference (default)
|
|
171
|
-
*/
|
|
172
|
-
export declare function WalletUIProvider({ children, queryClient: externalQueryClient, enablePrefetching, prefetchNfdView, theme, }: WalletUIProviderProps): JSX.Element;
|
|
173
|
-
|
|
174
|
-
declare interface WalletUIProviderProps {
|
|
175
|
-
children: ReactNode;
|
|
176
|
-
queryClient?: QueryClient;
|
|
177
|
-
/**
|
|
178
|
-
* Whether to automatically prefetch data for all accounts in connected wallets (defaults to true)
|
|
179
|
-
*/
|
|
180
|
-
enablePrefetching?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* NFD view type for prefetching (defaults to 'thumbnail')
|
|
183
|
-
*/
|
|
184
|
-
prefetchNfdView?: NfdView;
|
|
185
|
-
/**
|
|
186
|
-
* Theme setting for wallet UI components.
|
|
187
|
-
* - 'light': Always use light mode
|
|
188
|
-
* - 'dark': Always use dark mode
|
|
189
|
-
* - 'system': Follow the user's OS/browser preference (default)
|
|
190
|
-
*
|
|
191
|
-
* The library also respects the `.dark` class on ancestor elements (Tailwind convention),
|
|
192
|
-
* which will enable dark mode unless explicitly overridden with theme="light".
|
|
193
|
-
*/
|
|
194
|
-
theme?: Theme;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export { }
|
|
1
|
+
export { ConnectWalletButton } from './components/ConnectWalletButton';
|
|
2
|
+
export type { ButtonSize } from './components/ConnectWalletButton';
|
|
3
|
+
export { ConnectWalletMenu } from './components/ConnectWalletMenu';
|
|
4
|
+
export { ConnectedWalletButton } from './components/ConnectedWalletButton';
|
|
5
|
+
export { ConnectedWalletMenu } from './components/ConnectedWalletMenu';
|
|
6
|
+
export { WalletButton } from './components/WalletButton';
|
|
7
|
+
export { WalletList } from './components/WalletList';
|
|
8
|
+
export { NfdAvatar } from './components/NfdAvatar';
|
|
9
|
+
export { useNfd } from './hooks/useNfd';
|
|
10
|
+
export type { NfdRecord, NfdLookupResponse } from './hooks/useNfd';
|
|
11
|
+
export { useAccountInfo } from './hooks/useAccountInfo';
|
|
12
|
+
export { useResolvedTheme } from './hooks/useResolvedTheme';
|
|
13
|
+
export type { Theme, ResolvedTheme } from './hooks/useResolvedTheme';
|
|
14
|
+
export { WalletUIProvider, useWalletUI } from './providers/WalletUIProvider';
|
|
15
|
+
export { usePlugins } from './plugins/PluginContext';
|
|
16
|
+
export type { MenuRenderContext, MenuSlot, PluginDialog, PluginLifecycleHooks, PluginMenuItem, PluginPanel, PluginRenderContext, WalletUIPlugin, } from './plugins/types';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,197 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
style?: default_2.CSSProperties;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export declare function ConnectedWalletMenu(props: ConnectedWalletMenuProps): JSX.Element;
|
|
22
|
-
|
|
23
|
-
declare interface ConnectedWalletMenuProps {
|
|
24
|
-
children?: RefableElement_2;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export declare const ConnectWalletButton: default_2.ForwardRefExoticComponent<ConnectWalletButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
28
|
-
|
|
29
|
-
declare interface ConnectWalletButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
30
|
-
/** Size variant for the button */
|
|
31
|
-
size?: ButtonSize;
|
|
32
|
-
style?: default_2.CSSProperties;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare function ConnectWalletMenu({ children }: ConnectWalletMenuProps): JSX.Element;
|
|
36
|
-
|
|
37
|
-
declare interface ConnectWalletMenuProps {
|
|
38
|
-
children?: RefableElement;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Component for displaying NFD avatar images with automatic IPFS handling
|
|
43
|
-
* - Handles IPFS URLs by converting them to HTTPS
|
|
44
|
-
* - Checks availability on images.nf.domains and falls back to IPFS gateway if needed
|
|
45
|
-
* - Caches results using TanStack Query
|
|
46
|
-
*/
|
|
47
|
-
export declare function NfdAvatar({ nfd, alt, className, size, fallback, lightOnly, }: NfdAvatarProps): JSX.Element;
|
|
48
|
-
|
|
49
|
-
declare interface NfdAvatarProps {
|
|
50
|
-
/** NFD record containing avatar data */
|
|
51
|
-
nfd: NfdRecord | null | undefined;
|
|
52
|
-
/** Optional alt text for the image (defaults to NFD name or 'NFD Avatar') */
|
|
53
|
-
alt?: string;
|
|
54
|
-
/** Optional className for styling the image */
|
|
55
|
-
className?: string;
|
|
56
|
-
/** Optional size in pixels (defaults to 40px) */
|
|
57
|
-
size?: number;
|
|
58
|
-
/** Optional fallback element to show when no avatar is available */
|
|
59
|
-
fallback?: default_2.ReactNode;
|
|
60
|
-
/** Optional flag to show light only avatar */
|
|
61
|
-
lightOnly?: boolean;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export declare type NfdLookupResponse = {
|
|
65
|
-
[address: string]: NfdRecord | null;
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
export declare type NfdRecord = {
|
|
69
|
-
name: string;
|
|
70
|
-
properties: {
|
|
71
|
-
verified: {
|
|
72
|
-
[key: string]: string;
|
|
73
|
-
};
|
|
74
|
-
userDefined: {
|
|
75
|
-
[key: string]: string;
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
image?: string;
|
|
79
|
-
avatar?: {
|
|
80
|
-
url?: string;
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
declare type NfdView = 'tiny' | 'thumbnail' | 'brief' | 'full';
|
|
85
|
-
|
|
86
|
-
declare type RefableElement = ReactElement & {
|
|
87
|
-
ref?: RefObject<HTMLElement> | ((instance: HTMLElement | null) => void);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
declare type RefableElement_2 = ReactElement & {
|
|
91
|
-
ref?: RefObject<HTMLElement> | ((instance: HTMLElement | null) => void);
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export declare type ResolvedTheme = 'light' | 'dark';
|
|
95
|
-
|
|
96
|
-
export declare type Theme = 'light' | 'dark' | 'system';
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Custom hook to fetch account information for Algorand address
|
|
100
|
-
*
|
|
101
|
-
* @param options.enabled Whether to enable the account lookup (defaults to true)
|
|
102
|
-
* @returns Account information query result
|
|
103
|
-
*/
|
|
104
|
-
export declare function useAccountInfo(options?: {
|
|
105
|
-
enabled?: boolean;
|
|
106
|
-
}): UseQueryResult<default_3.modelsv2.Account | null>;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Custom hook to fetch NFD data for an Algorand address
|
|
110
|
-
*
|
|
111
|
-
* @param options.enabled Whether to enable the NFD lookup (defaults to true)
|
|
112
|
-
* @param options.view The view type for the NFD lookup ('tiny', 'thumbnail', 'brief', 'full') (defaults to 'thumbnail')
|
|
113
|
-
* @returns NFD data query result
|
|
114
|
-
*/
|
|
115
|
-
export declare function useNfd(options?: {
|
|
116
|
-
enabled?: boolean;
|
|
117
|
-
view?: NfdView;
|
|
118
|
-
}): UseQueryResult<NfdRecord | null>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Hook to resolve the actual theme value, handling 'system' preference detection.
|
|
122
|
-
* When theme is 'system', it listens to the user's OS/browser color scheme preference.
|
|
123
|
-
*
|
|
124
|
-
* @param theme - The theme setting: 'light', 'dark', or 'system'
|
|
125
|
-
* @returns The resolved theme: 'light' or 'dark'
|
|
126
|
-
*/
|
|
127
|
-
export declare function useResolvedTheme(theme: Theme): ResolvedTheme;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Hook to access the WalletUI context
|
|
131
|
-
* @throws Error if used outside of WalletUIProvider
|
|
132
|
-
*/
|
|
133
|
-
export declare function useWalletUI(): WalletUIContextType;
|
|
134
|
-
|
|
135
|
-
export declare function WalletButton({ size, className, style }: WalletButtonProps): JSX.Element;
|
|
136
|
-
|
|
137
|
-
declare interface WalletButtonProps {
|
|
138
|
-
/** Size variant for the button */
|
|
139
|
-
size?: ButtonSize;
|
|
140
|
-
/** Additional CSS classes to apply to the button */
|
|
141
|
-
className?: string;
|
|
142
|
-
/** Inline styles to apply to the button (can include CSS variable overrides) */
|
|
143
|
-
style?: default_2.CSSProperties;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export declare function WalletList({ wallets, handleWalletClick }: WalletListProps): JSX.Element;
|
|
147
|
-
|
|
148
|
-
declare interface WalletListProps {
|
|
149
|
-
wallets: Wallet[];
|
|
150
|
-
handleWalletClick: (wallet: Wallet) => Promise<void>;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
declare interface WalletUIContextType {
|
|
154
|
-
queryClient: QueryClient;
|
|
155
|
-
theme: Theme;
|
|
156
|
-
resolvedTheme: ResolvedTheme;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Provider that enables wallet UI components to work with TanStack Query.
|
|
161
|
-
* It can use an existing QueryClient from the parent application or create its own.
|
|
162
|
-
* Also creates a QueryClientProvider if none exists in the parent tree.
|
|
163
|
-
*
|
|
164
|
-
* Automatically prefetches data for all accounts in connected wallets for smoother
|
|
165
|
-
* account switching experience.
|
|
166
|
-
*
|
|
167
|
-
* Supports theme configuration via the `theme` prop:
|
|
168
|
-
* - 'light': Always use light mode
|
|
169
|
-
* - 'dark': Always use dark mode
|
|
170
|
-
* - 'system': Follow the user's OS/browser preference (default)
|
|
171
|
-
*/
|
|
172
|
-
export declare function WalletUIProvider({ children, queryClient: externalQueryClient, enablePrefetching, prefetchNfdView, theme, }: WalletUIProviderProps): JSX.Element;
|
|
173
|
-
|
|
174
|
-
declare interface WalletUIProviderProps {
|
|
175
|
-
children: ReactNode;
|
|
176
|
-
queryClient?: QueryClient;
|
|
177
|
-
/**
|
|
178
|
-
* Whether to automatically prefetch data for all accounts in connected wallets (defaults to true)
|
|
179
|
-
*/
|
|
180
|
-
enablePrefetching?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* NFD view type for prefetching (defaults to 'thumbnail')
|
|
183
|
-
*/
|
|
184
|
-
prefetchNfdView?: NfdView;
|
|
185
|
-
/**
|
|
186
|
-
* Theme setting for wallet UI components.
|
|
187
|
-
* - 'light': Always use light mode
|
|
188
|
-
* - 'dark': Always use dark mode
|
|
189
|
-
* - 'system': Follow the user's OS/browser preference (default)
|
|
190
|
-
*
|
|
191
|
-
* The library also respects the `.dark` class on ancestor elements (Tailwind convention),
|
|
192
|
-
* which will enable dark mode unless explicitly overridden with theme="light".
|
|
193
|
-
*/
|
|
194
|
-
theme?: Theme;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export { }
|
|
1
|
+
export { ConnectWalletButton } from './components/ConnectWalletButton';
|
|
2
|
+
export type { ButtonSize } from './components/ConnectWalletButton';
|
|
3
|
+
export { ConnectWalletMenu } from './components/ConnectWalletMenu';
|
|
4
|
+
export { ConnectedWalletButton } from './components/ConnectedWalletButton';
|
|
5
|
+
export { ConnectedWalletMenu } from './components/ConnectedWalletMenu';
|
|
6
|
+
export { WalletButton } from './components/WalletButton';
|
|
7
|
+
export { WalletList } from './components/WalletList';
|
|
8
|
+
export { NfdAvatar } from './components/NfdAvatar';
|
|
9
|
+
export { useNfd } from './hooks/useNfd';
|
|
10
|
+
export type { NfdRecord, NfdLookupResponse } from './hooks/useNfd';
|
|
11
|
+
export { useAccountInfo } from './hooks/useAccountInfo';
|
|
12
|
+
export { useResolvedTheme } from './hooks/useResolvedTheme';
|
|
13
|
+
export type { Theme, ResolvedTheme } from './hooks/useResolvedTheme';
|
|
14
|
+
export { WalletUIProvider, useWalletUI } from './providers/WalletUIProvider';
|
|
15
|
+
export { usePlugins } from './plugins/PluginContext';
|
|
16
|
+
export type { MenuRenderContext, MenuSlot, PluginDialog, PluginLifecycleHooks, PluginMenuItem, PluginPanel, PluginRenderContext, WalletUIPlugin, } from './plugins/types';
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,YAAY,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAA;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAGlD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAGpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAG5E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,YAAY,EACV,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,GACf,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MenuSlot, PluginDialog, PluginMenuItem, PluginPanel, PluginRenderContext, WalletUIPlugin } from './types';
|
|
3
|
+
interface PluginContextType {
|
|
4
|
+
/** All menu items grouped by slot, sorted by order */
|
|
5
|
+
menuItemsBySlot: Record<MenuSlot, PluginMenuItem[]>;
|
|
6
|
+
/** All dialogs from all plugins */
|
|
7
|
+
dialogs: PluginDialog[];
|
|
8
|
+
/** Open a plugin dialog by key */
|
|
9
|
+
openDialog: (key: string) => void;
|
|
10
|
+
/** Close a plugin dialog by key */
|
|
11
|
+
closeDialog: (key: string) => void;
|
|
12
|
+
/** Currently open dialog keys */
|
|
13
|
+
openDialogs: Set<string>;
|
|
14
|
+
/** All panels from all plugins, sorted by order */
|
|
15
|
+
panels: PluginPanel[];
|
|
16
|
+
/** All registered plugins */
|
|
17
|
+
plugins: WalletUIPlugin[];
|
|
18
|
+
/** Enriched render context with working openDialog/closeDialog */
|
|
19
|
+
renderContext: PluginRenderContext;
|
|
20
|
+
}
|
|
21
|
+
/** Access the plugin context. Returns safe defaults when no plugins are registered. */
|
|
22
|
+
export declare function usePlugins(): PluginContextType;
|
|
23
|
+
export declare function PluginContextProvider({ plugins: rawPlugins, renderContext, children, }: {
|
|
24
|
+
plugins: WalletUIPlugin[];
|
|
25
|
+
renderContext: PluginRenderContext;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=PluginContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginContext.d.ts","sourceRoot":"","sources":["../../../src/plugins/PluginContext.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAMV,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,EACf,MAAM,SAAS,CAAA;AAEhB,UAAU,iBAAiB;IACzB,sDAAsD;IACtD,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,CAAC,CAAA;IACnD,mCAAmC;IACnC,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,kCAAkC;IAClC,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,mCAAmC;IACnC,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;IAClC,iCAAiC;IACjC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACxB,mDAAmD;IACnD,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,6BAA6B;IAC7B,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,kEAAkE;IAClE,aAAa,EAAE,mBAAmB,CAAA;CACnC;AAwCD,uFAAuF;AACvF,wBAAgB,UAAU,IAAI,iBAAiB,CAM9C;AAyCD,wBAAgB,qBAAqB,CAAC,EACpC,OAAO,EAAE,UAAU,EACnB,aAAa,EACb,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,cAAc,EAAE,CAAA;IACzB,aAAa,EAAE,mBAAmB,CAAA;IAClC,QAAQ,EAAE,SAAS,CAAA;CACpB,2CAoJA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders all open plugin dialogs via FloatingPortal.
|
|
3
|
+
* Centralizes the QueryClientProvider wrapping needed to fix
|
|
4
|
+
* FloatingPortal context inheritance issues.
|
|
5
|
+
*
|
|
6
|
+
* Must be rendered inside PluginContextProvider to access the
|
|
7
|
+
* enriched render context with working openDialog/closeDialog.
|
|
8
|
+
*/
|
|
9
|
+
export declare function PluginDialogRenderer(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=PluginDialogRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginDialogRenderer.d.ts","sourceRoot":"","sources":["../../../src/plugins/PluginDialogRenderer.tsx"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,4CA4BnC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monitors wallet state changes and invokes plugin lifecycle hooks.
|
|
3
|
+
* Detects connect, disconnect, and account change transitions.
|
|
4
|
+
*
|
|
5
|
+
* Must be rendered inside PluginContextProvider to access the
|
|
6
|
+
* enriched render context with working openDialog/closeDialog.
|
|
7
|
+
*/
|
|
8
|
+
export declare function PluginLifecycleManager(): null;
|
|
9
|
+
//# sourceMappingURL=PluginLifecycleManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginLifecycleManager.d.ts","sourceRoot":"","sources":["../../../src/plugins/PluginLifecycleManager.tsx"],"names":[],"mappings":"AA4BA;;;;;;GAMG;AACH,wBAAgB,sBAAsB,SAgDrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MenuRenderContext, MenuSlot } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Renders plugin menu items for a given slot.
|
|
4
|
+
* Place this component at each named slot position in ConnectedWalletMenu.
|
|
5
|
+
*/
|
|
6
|
+
export declare function PluginSlot({ slot, ctx, }: {
|
|
7
|
+
slot: MenuSlot;
|
|
8
|
+
ctx: MenuRenderContext;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
//# sourceMappingURL=PluginSlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginSlot.d.ts","sourceRoot":"","sources":["../../../src/plugins/PluginSlot.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE1D;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,GAAG,GACJ,EAAE;IACD,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,EAAE,iBAAiB,CAAA;CACvB,kDAeA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface ExportKeyDialogProps {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
displayTimeout?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function ExportKeyDialog({ onClose, displayTimeout, }: ExportKeyDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ExportKeyDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportKeyDialog.d.ts","sourceRoot":"","sources":["../../../../src/plugins/export-key/ExportKeyDialog.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,cAAwC,GACzC,EAAE,oBAAoB,2CAuKtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExportKeyMenuButton.d.ts","sourceRoot":"","sources":["../../../../src/plugins/export-key/ExportKeyMenuButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAEjD,wBAAgB,mBAAmB,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,iBAAiB,CAAA;CAAE,2CAyCtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/plugins/export-key/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,sBAAsB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WalletUIPlugin } from '../types';
|
|
2
|
+
export { EXPORT_KEY_DIALOG } from './constants';
|
|
3
|
+
export interface ExportKeyPluginOptions {
|
|
4
|
+
/** How long to display the mnemonic before auto-closing (seconds). Default: 120 */
|
|
5
|
+
displayTimeout?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Plugin that adds wallet recovery phrase export to the ConnectedWalletMenu.
|
|
9
|
+
* Only visible for wallets that support private key access (e.g., Web3Auth).
|
|
10
|
+
*/
|
|
11
|
+
export declare function exportKeyPlugin(options?: ExportKeyPluginOptions): WalletUIPlugin;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { WalletUIPlugin } from '../types';
|
|
2
|
+
export { EXPORT_KEY_DIALOG } from './constants';
|
|
3
|
+
export interface ExportKeyPluginOptions {
|
|
4
|
+
/** How long to display the mnemonic before auto-closing (seconds). Default: 120 */
|
|
5
|
+
displayTimeout?: number;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Plugin that adds wallet recovery phrase export to the ConnectedWalletMenu.
|
|
9
|
+
* Only visible for wallets that support private key access (e.g., Web3Auth).
|
|
10
|
+
*/
|
|
11
|
+
export declare function exportKeyPlugin(options?: ExportKeyPluginOptions): WalletUIPlugin;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/export-key/index.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAE/C,MAAM,WAAW,sBAAsB;IACrC,mFAAmF;IACnF,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,OAAO,GAAE,sBAA2B,GACnC,cAAc,CA0BhB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { PluginContextProvider, usePlugins } from './PluginContext';
|
|
2
|
+
export { PluginDialogRenderer } from './PluginDialogRenderer';
|
|
3
|
+
export { PluginLifecycleManager } from './PluginLifecycleManager';
|
|
4
|
+
export { PluginSlot } from './PluginSlot';
|
|
5
|
+
export type { MenuRenderContext, MenuSlot, PluginDialog, PluginLifecycleHooks, PluginMenuItem, PluginPanel, PluginRenderContext, WalletUIPlugin, } from './types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,YAAY,EACV,iBAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,mBAAmB,EACnB,cAAc,GACf,MAAM,SAAS,CAAA"}
|