@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.
Files changed (75) hide show
  1. package/README.md +20 -0
  2. package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs +5 -0
  3. package/dist/cjs/chunks/floating-ui.react-Hg8yTXAw.cjs.map +1 -0
  4. package/dist/cjs/index.cjs +15 -18
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/plugins/export-key.cjs +9 -0
  7. package/dist/cjs/plugins/export-key.cjs.map +1 -0
  8. package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js +2599 -0
  9. package/dist/esm/chunks/floating-ui.react-BBJf3vGf.js.map +1 -0
  10. package/dist/esm/index.js +4780 -7744
  11. package/dist/esm/index.js.map +1 -1
  12. package/dist/esm/plugins/export-key.js +3030 -0
  13. package/dist/esm/plugins/export-key.js.map +1 -0
  14. package/dist/style.css +112 -1
  15. package/dist/types/components/AlgoSymbol.d.ts +11 -0
  16. package/dist/types/components/AlgoSymbol.d.ts.map +1 -0
  17. package/dist/types/components/ConnectWalletButton.d.ts +9 -0
  18. package/dist/types/components/ConnectWalletButton.d.ts.map +1 -0
  19. package/dist/types/components/ConnectWalletMenu.d.ts +10 -0
  20. package/dist/types/components/ConnectWalletMenu.d.ts.map +1 -0
  21. package/dist/types/components/ConnectedWalletButton.d.ts +9 -0
  22. package/dist/types/components/ConnectedWalletButton.d.ts.map +1 -0
  23. package/dist/types/components/ConnectedWalletMenu.d.ts +10 -0
  24. package/dist/types/components/ConnectedWalletMenu.d.ts.map +1 -0
  25. package/dist/types/components/NfdAvatar.d.ts +24 -0
  26. package/dist/types/components/NfdAvatar.d.ts.map +1 -0
  27. package/dist/types/components/WalletButton.d.ts +12 -0
  28. package/dist/types/components/WalletButton.d.ts.map +1 -0
  29. package/dist/types/components/WalletList.d.ts +7 -0
  30. package/dist/types/components/WalletList.d.ts.map +1 -0
  31. package/dist/types/hooks/useAccountInfo.d.ts +12 -0
  32. package/dist/types/hooks/useAccountInfo.d.ts.map +1 -0
  33. package/dist/types/hooks/useNfd.d.ts +32 -0
  34. package/dist/types/hooks/useNfd.d.ts.map +1 -0
  35. package/dist/types/hooks/useResolvedTheme.d.ts +11 -0
  36. package/dist/types/hooks/useResolvedTheme.d.ts.map +1 -0
  37. package/dist/types/index.d.cts +17 -197
  38. package/dist/types/index.d.ts +17 -197
  39. package/dist/types/index.d.ts.map +1 -0
  40. package/dist/types/plugins/PluginContext.d.ts +29 -0
  41. package/dist/types/plugins/PluginContext.d.ts.map +1 -0
  42. package/dist/types/plugins/PluginDialogRenderer.d.ts +10 -0
  43. package/dist/types/plugins/PluginDialogRenderer.d.ts.map +1 -0
  44. package/dist/types/plugins/PluginLifecycleManager.d.ts +9 -0
  45. package/dist/types/plugins/PluginLifecycleManager.d.ts.map +1 -0
  46. package/dist/types/plugins/PluginSlot.d.ts +10 -0
  47. package/dist/types/plugins/PluginSlot.d.ts.map +1 -0
  48. package/dist/types/plugins/export-key/ExportKeyDialog.d.ts +6 -0
  49. package/dist/types/plugins/export-key/ExportKeyDialog.d.ts.map +1 -0
  50. package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts +5 -0
  51. package/dist/types/plugins/export-key/ExportKeyMenuButton.d.ts.map +1 -0
  52. package/dist/types/plugins/export-key/constants.d.ts +2 -0
  53. package/dist/types/plugins/export-key/constants.d.ts.map +1 -0
  54. package/dist/types/plugins/export-key/index.d.cts +12 -0
  55. package/dist/types/plugins/export-key/index.d.ts +12 -0
  56. package/dist/types/plugins/export-key/index.d.ts.map +1 -0
  57. package/dist/types/plugins/index.d.ts +6 -0
  58. package/dist/types/plugins/index.d.ts.map +1 -0
  59. package/dist/types/plugins/types.d.ts +109 -0
  60. package/dist/types/plugins/types.d.ts.map +1 -0
  61. package/dist/types/providers/WalletUIProvider.d.ts +58 -0
  62. package/dist/types/providers/WalletUIProvider.d.ts.map +1 -0
  63. package/dist/types/test/setup.d.ts +2 -0
  64. package/dist/types/test/setup.d.ts.map +1 -0
  65. package/dist/types/utils/cn.d.ts +16 -0
  66. package/dist/types/utils/cn.d.ts.map +1 -0
  67. package/dist/types/utils/fontLoader.d.ts +8 -0
  68. package/dist/types/utils/fontLoader.d.ts.map +1 -0
  69. package/dist/types/utils/index.d.ts +3 -0
  70. package/dist/types/utils/index.d.ts.map +1 -0
  71. package/dist/types/utils/ipfs.d.ts +10 -0
  72. package/dist/types/utils/ipfs.d.ts.map +1 -0
  73. package/dist/types/utils/ipfs.test.d.ts +2 -0
  74. package/dist/types/utils/ipfs.test.d.ts.map +1 -0
  75. package/package.json +21 -11
@@ -1,197 +1,17 @@
1
- import { default as default_2 } from 'react';
2
- import { default as default_3 } from 'algosdk';
3
- import { JSX } from 'react/jsx-runtime';
4
- import { QueryClient } from '@tanstack/react-query';
5
- import { ReactElement } from 'react';
6
- import { ReactNode } from 'react';
7
- import { RefObject } from 'react';
8
- import { UseQueryResult } from '@tanstack/react-query';
9
- import { Wallet } from '@txnlab/use-wallet-react';
10
-
11
- export declare type ButtonSize = 'sm' | 'md' | 'lg';
12
-
13
- export declare const ConnectedWalletButton: default_2.ForwardRefExoticComponent<ConnectedWalletButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
14
-
15
- declare interface ConnectedWalletButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
16
- /** Size variant for the button */
17
- size?: ButtonSize;
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
@@ -1,197 +1,17 @@
1
- import { default as default_2 } from 'react';
2
- import { default as default_3 } from 'algosdk';
3
- import { JSX } from 'react/jsx-runtime';
4
- import { QueryClient } from '@tanstack/react-query';
5
- import { ReactElement } from 'react';
6
- import { ReactNode } from 'react';
7
- import { RefObject } from 'react';
8
- import { UseQueryResult } from '@tanstack/react-query';
9
- import { Wallet } from '@txnlab/use-wallet-react';
10
-
11
- export declare type ButtonSize = 'sm' | 'md' | 'lg';
12
-
13
- export declare const ConnectedWalletButton: default_2.ForwardRefExoticComponent<ConnectedWalletButtonProps & default_2.RefAttributes<HTMLButtonElement>>;
14
-
15
- declare interface ConnectedWalletButtonProps extends default_2.ButtonHTMLAttributes<HTMLButtonElement> {
16
- /** Size variant for the button */
17
- size?: ButtonSize;
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,5 @@
1
+ import { MenuRenderContext } from '../types';
2
+ export declare function ExportKeyMenuButton({ ctx }: {
3
+ ctx: MenuRenderContext;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ //# sourceMappingURL=ExportKeyMenuButton.d.ts.map
@@ -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,2 @@
1
+ export declare const EXPORT_KEY_DIALOG = "export-key-dialog";
2
+ //# sourceMappingURL=constants.d.ts.map
@@ -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"}