@volr/react-ui 0.1.5 → 0.1.6
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 +40 -29
- package/dist/index.cjs +2 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @volr/react-ui
|
|
2
2
|
|
|
3
|
-
Pre-built UI components for Volr
|
|
3
|
+
Pre-built UI components for Volr, built on top of `@volr/react` and `@volr/sdk-core`, with minimal, modern design.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install @volr/react-ui @volr/react
|
|
8
|
+
npm install @volr/react-ui @volr/react @volr/sdk-core viem
|
|
9
9
|
# or
|
|
10
|
-
yarn add @volr/react-ui @volr/react
|
|
10
|
+
yarn add @volr/react-ui @volr/react @volr/sdk-core viem
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
@@ -16,21 +16,21 @@ yarn add @volr/react-ui @volr/react
|
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { VolrUIProvider } from '@volr/react-ui';
|
|
19
|
-
import type {
|
|
19
|
+
import type { VolrUIConfig } from '@volr/react-ui';
|
|
20
20
|
|
|
21
|
-
const volrConfig:
|
|
21
|
+
const volrConfig: VolrUIConfig = {
|
|
22
22
|
defaultChainId: 8453,
|
|
23
23
|
projectApiKey: 'your-project-api-key',
|
|
24
|
+
appName: 'My App',
|
|
25
|
+
// keyStorageType defaults to 'passkey' if not specified
|
|
26
|
+
accentColor: '#3b82f6',
|
|
27
|
+
enabledLoginMethods: ['email', 'social', 'siwe'],
|
|
28
|
+
socialProviders: ['google', 'twitter', 'apple'],
|
|
24
29
|
};
|
|
25
30
|
|
|
26
31
|
function App() {
|
|
27
32
|
return (
|
|
28
|
-
<VolrUIProvider
|
|
29
|
-
config={volrConfig}
|
|
30
|
-
accentColor="#3b82f6"
|
|
31
|
-
enabledLoginMethods={['email', 'social', 'siwe']}
|
|
32
|
-
socialProviders={['google', 'twitter', 'apple']}
|
|
33
|
-
>
|
|
33
|
+
<VolrUIProvider config={volrConfig}>
|
|
34
34
|
<YourApp />
|
|
35
35
|
</VolrUIProvider>
|
|
36
36
|
);
|
|
@@ -68,13 +68,16 @@ function LoginButton() {
|
|
|
68
68
|
|
|
69
69
|
| Prop | Type | Default | Description |
|
|
70
70
|
|------|------|---------|-------------|
|
|
71
|
-
| `config` | `
|
|
72
|
-
| `
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
71
|
+
| `config` | `VolrUIConfig` | **Required** | Volr UI configuration (extends VolrConfig) |
|
|
72
|
+
| `config.defaultChainId` | `number` | **Required** | Default chain ID |
|
|
73
|
+
| `config.projectApiKey` | `string` | **Required** | Project API key |
|
|
74
|
+
| `config.appName` | `string` | **Required** | Application name |
|
|
75
|
+
| `config.accentColor` | `string` | `'#303030'` | Accent color for buttons and links |
|
|
76
|
+
| `config.enabledLoginMethods` | `('email' \| 'social' \| 'siwe')[]` | `['email', 'social', 'siwe']` | Enabled login methods |
|
|
77
|
+
| `config.socialProviders` | `('google' \| 'twitter' \| 'apple')[]` | `['google', 'twitter', 'apple']` | Enabled social providers |
|
|
78
|
+
| `config.keyStorageType` | `'passkey' \| 'mpc'` | `'passkey'` | Key storage type (optional, defaults to passkey) |
|
|
79
|
+
| `config.branding` | `BrandingConfig` | `undefined` | Custom branding configuration |
|
|
80
|
+
| `config.providerPolicy` | `object` | `{ enforceOnFirstLogin: true }` | Provider policy settings |
|
|
78
81
|
|
|
79
82
|
### LoginModal Props
|
|
80
83
|
|
|
@@ -136,11 +139,15 @@ For new users, a passkey-based wallet is automatically created:
|
|
|
136
139
|
### Email Only
|
|
137
140
|
|
|
138
141
|
```tsx
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
const volrConfig: VolrUIConfig = {
|
|
143
|
+
defaultChainId: 8453,
|
|
144
|
+
projectApiKey: 'your-project-api-key',
|
|
145
|
+
appName: 'My App',
|
|
146
|
+
accentColor: '#6366f1',
|
|
147
|
+
enabledLoginMethods: ['email'],
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
<VolrUIProvider config={volrConfig}>
|
|
144
151
|
<App />
|
|
145
152
|
</VolrUIProvider>
|
|
146
153
|
```
|
|
@@ -148,12 +155,16 @@ For new users, a passkey-based wallet is automatically created:
|
|
|
148
155
|
### Google and Apple Only
|
|
149
156
|
|
|
150
157
|
```tsx
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
158
|
+
const volrConfig: VolrUIConfig = {
|
|
159
|
+
defaultChainId: 8453,
|
|
160
|
+
projectApiKey: 'your-project-api-key',
|
|
161
|
+
appName: 'My App',
|
|
162
|
+
accentColor: '#8b5cf6',
|
|
163
|
+
enabledLoginMethods: ['social'],
|
|
164
|
+
socialProviders: ['google', 'apple'],
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
<VolrUIProvider config={volrConfig}>
|
|
157
168
|
<App />
|
|
158
169
|
</VolrUIProvider>
|
|
159
170
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -2811,7 +2811,8 @@ var VolrUIProvider = ({
|
|
|
2811
2811
|
enabledLoginMethods = ["email", "social", "siwe"],
|
|
2812
2812
|
socialProviders = ["google", "twitter", "apple"],
|
|
2813
2813
|
branding,
|
|
2814
|
-
keyStorageType
|
|
2814
|
+
keyStorageType = "passkey"
|
|
2815
|
+
// Default to passkey if not specified
|
|
2815
2816
|
} = config;
|
|
2816
2817
|
const providerPolicy = config.providerPolicy ?? {
|
|
2817
2818
|
enforceOnFirstLogin: true
|