@provablehq/aleo-wallet-adaptor-react-ui 0.1.1-alpha.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/LICENSE +674 -0
- package/README.md +43 -0
- package/dist/index.d.mts +49 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.js +820 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +785 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +421 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @provablehq/aleo-wallet-adaptor-react-ui
|
|
2
|
+
|
|
3
|
+
Drop-in React components—modals, buttons, icons—for projects that use the Aleo wallet adaptor provider.
|
|
4
|
+
|
|
5
|
+
## When to use it
|
|
6
|
+
|
|
7
|
+
- You already integrate `@provablehq/aleo-wallet-adaptor-react` and want production-ready UI elements.
|
|
8
|
+
- You need a wallet picker modal that adapts to installed/loadable wallets automatically.
|
|
9
|
+
- You prefer to customise styling via CSS variables rather than building UI from scratch.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @provablehq/aleo-wallet-adaptor-react-ui
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Include the distributed stylesheet once in your bundle:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import '@provablehq/aleo-wallet-adaptor-react-ui/dist/styles.css';
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
```tsx
|
|
26
|
+
import { WalletModalProvider, WalletMultiButton } from '@provablehq/aleo-wallet-adaptor-react-ui';
|
|
27
|
+
|
|
28
|
+
export function Layout({ children }: { children: React.ReactNode }) {
|
|
29
|
+
return (
|
|
30
|
+
<WalletModalProvider>
|
|
31
|
+
<WalletMultiButton />
|
|
32
|
+
{children}
|
|
33
|
+
</WalletModalProvider>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Related packages
|
|
39
|
+
|
|
40
|
+
- `@provablehq/aleo-wallet-adaptor-react` – required provider context for these components.
|
|
41
|
+
- Wallet adapters such as `@provablehq/aleo-wallet-adaptor-prove-alpha`, `-puzzle`, `-leo`, etc.
|
|
42
|
+
|
|
43
|
+
Live demo: https://aleo-dev-toolkit-react-app.vercel.app/
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { PropsWithChildren, ReactElement, MouseEvent, CSSProperties, FC, ReactNode, DetailedHTMLProps, ImgHTMLAttributes } from 'react';
|
|
3
|
+
import { Network } from '@provablehq/aleo-types';
|
|
4
|
+
import { Wallet } from '@provablehq/aleo-wallet-adaptor-react';
|
|
5
|
+
|
|
6
|
+
interface WalletModalContextState {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
setVisible: (open: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const WalletModalContext: react.Context<WalletModalContextState>;
|
|
11
|
+
declare function useWalletModal(): WalletModalContextState;
|
|
12
|
+
|
|
13
|
+
type ButtonProps = PropsWithChildren<{
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
network?: Network;
|
|
17
|
+
endIcon?: ReactElement;
|
|
18
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
startIcon?: ReactElement;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
declare const WalletConnectButton: FC<ButtonProps>;
|
|
25
|
+
|
|
26
|
+
interface WalletModalProps {
|
|
27
|
+
className?: string;
|
|
28
|
+
container?: string;
|
|
29
|
+
network?: Network;
|
|
30
|
+
}
|
|
31
|
+
declare const WalletModal: FC<WalletModalProps>;
|
|
32
|
+
|
|
33
|
+
declare const WalletModalButton: FC<ButtonProps>;
|
|
34
|
+
|
|
35
|
+
interface WalletModalProviderProps extends WalletModalProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const WalletModalProvider: FC<WalletModalProviderProps>;
|
|
39
|
+
|
|
40
|
+
declare const WalletDisconnectButton: FC<ButtonProps>;
|
|
41
|
+
|
|
42
|
+
interface WalletIconProps extends DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
|
|
43
|
+
wallet: Wallet | null;
|
|
44
|
+
}
|
|
45
|
+
declare const WalletIcon: FC<WalletIconProps>;
|
|
46
|
+
|
|
47
|
+
declare const WalletMultiButton: FC<ButtonProps>;
|
|
48
|
+
|
|
49
|
+
export { WalletConnectButton, WalletDisconnectButton, WalletIcon, type WalletIconProps, WalletModal, WalletModalButton, WalletModalContext, type WalletModalContextState, type WalletModalProps, WalletModalProvider, type WalletModalProviderProps, WalletMultiButton, useWalletModal };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { PropsWithChildren, ReactElement, MouseEvent, CSSProperties, FC, ReactNode, DetailedHTMLProps, ImgHTMLAttributes } from 'react';
|
|
3
|
+
import { Network } from '@provablehq/aleo-types';
|
|
4
|
+
import { Wallet } from '@provablehq/aleo-wallet-adaptor-react';
|
|
5
|
+
|
|
6
|
+
interface WalletModalContextState {
|
|
7
|
+
visible: boolean;
|
|
8
|
+
setVisible: (open: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
declare const WalletModalContext: react.Context<WalletModalContextState>;
|
|
11
|
+
declare function useWalletModal(): WalletModalContextState;
|
|
12
|
+
|
|
13
|
+
type ButtonProps = PropsWithChildren<{
|
|
14
|
+
className?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
network?: Network;
|
|
17
|
+
endIcon?: ReactElement;
|
|
18
|
+
onClick?: (e: MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
startIcon?: ReactElement;
|
|
20
|
+
style?: CSSProperties;
|
|
21
|
+
tabIndex?: number;
|
|
22
|
+
}>;
|
|
23
|
+
|
|
24
|
+
declare const WalletConnectButton: FC<ButtonProps>;
|
|
25
|
+
|
|
26
|
+
interface WalletModalProps {
|
|
27
|
+
className?: string;
|
|
28
|
+
container?: string;
|
|
29
|
+
network?: Network;
|
|
30
|
+
}
|
|
31
|
+
declare const WalletModal: FC<WalletModalProps>;
|
|
32
|
+
|
|
33
|
+
declare const WalletModalButton: FC<ButtonProps>;
|
|
34
|
+
|
|
35
|
+
interface WalletModalProviderProps extends WalletModalProps {
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
declare const WalletModalProvider: FC<WalletModalProviderProps>;
|
|
39
|
+
|
|
40
|
+
declare const WalletDisconnectButton: FC<ButtonProps>;
|
|
41
|
+
|
|
42
|
+
interface WalletIconProps extends DetailedHTMLProps<ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
|
|
43
|
+
wallet: Wallet | null;
|
|
44
|
+
}
|
|
45
|
+
declare const WalletIcon: FC<WalletIconProps>;
|
|
46
|
+
|
|
47
|
+
declare const WalletMultiButton: FC<ButtonProps>;
|
|
48
|
+
|
|
49
|
+
export { WalletConnectButton, WalletDisconnectButton, WalletIcon, type WalletIconProps, WalletModal, WalletModalButton, WalletModalContext, type WalletModalContextState, type WalletModalProps, WalletModalProvider, type WalletModalProviderProps, WalletMultiButton, useWalletModal };
|