@tuwaio/nova-connect 1.0.0-fix-ui-alpha.1.bc1cb87 → 1.0.0-fix-docs-alpha.1.dfcdaa7c

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 CHANGED
@@ -1,99 +1,85 @@
1
- # TUWA Nova Connect
1
+ # @tuwaio/nova-connect
2
2
 
3
3
  [![NPM Version](https://img.shields.io/npm/v/@tuwaio/nova-connect.svg)](https://www.npmjs.com/package/@tuwaio/nova-connect)
4
4
  [![License](https://img.shields.io/npm/l/@tuwaio/nova-connect.svg)](./LICENSE)
5
- [![Build Status](https://img.shields.io/github/actions/workflow/status/TuwaIO/nova-uikit/release.yml?branch=main)](https://github.com/TuwaIO/nova-uikit/actions)
6
5
 
7
- Feature-rich React components for connecting Web3 wallets with a comprehensive customization system and support for multiple blockchain networks.
6
+ `@tuwaio/nova-connect` is the **UI Components (L7)** package of the TUWA Ecosystem wallet connectivity layer. It translates the headless connection status of `@tuwaio/satellite-react` into beautiful, accessible, and highly customizable React user interface elements.
8
7
 
9
- ---
10
-
11
- ## 🏛️ What is `@tuwaio/nova-connect`?
12
-
13
- `@tuwaio/nova-connect` is a comprehensive solution for integrating Web3 wallets into React applications. The package provides ready-to-use components with deep customization and support for both EVM and Solana blockchains.
14
-
15
- Built on top of the Satellite Connect ecosystem, Nova Connect offers a unified interface for working with various wallet types and blockchain networks.
8
+ Nova Connect natively supports both EVM and Solana wallet standard connectors, providing ready-made buttons, dialog selectors, network switchers, and balance widgets while keeping styling decisions decoupled from the underlying connection state store.
16
9
 
17
10
  ---
18
11
 
19
- ## Key Features
12
+ ## 🏛️ Core Capabilities
20
13
 
21
- - **🎨 Full Customization**: Comprehensive customization system for all components and behaviors.
22
- - **⚡ TypeScript**: Full TypeScript support with proper type definitions.
23
- - **🌐 Multi-Blockchain**: Unified support for EVM and Solana wallets.
24
- - **🔗 Modern React**: Built using React 19+ features and best practices.
25
- - **🎯 Ready-made Components**: Connection button, modals, network selectors.
26
- - **♿ Accessibility**: Full ARIA and keyboard navigation support.
27
- - **🎭 Internationalization**: Support for multiple languages.
28
- - **🔄 State Management**: Zustand-based store for efficient state management.
14
+ - **🔌 Plug-and-Play Widgets:** Ready-to-use wallet components (`ConnectButton`, `ConnectCard`, `DisconnectButton`, `AccountImpersonationIndicator`).
15
+ - **⛓️ Cohesive Multi-Chain Interface:** Consistently handles EVM wallets (via `@tuwaio/satellite-evm` and `wagmi`) and Solana standard wallets (via `@tuwaio/satellite-solana` and `gill`).
16
+ - **🎨 Deep Customization:** Change typography, borders, and margins using the `customization` prop or override colors via the `@tuwaio/nova-core` token variables.
17
+ - **♿ Built-in Accessibility:** Dialog primitives powered by Radix UI, featuring complete keyboard navigation, viewport trapping, and screen reader announcements.
18
+ - **🌍 Internationalization (i18n):** Overridable labels configuration for localizing connection prompts and wallet state tags.
29
19
 
30
20
  ---
31
21
 
32
22
  ## 💾 Installation
33
23
 
34
- ### Requirements
24
+ ```bash
25
+ pnpm add @tuwaio/nova-connect @tuwaio/nova-core @tuwaio/satellite-core @tuwaio/satellite-react
26
+ ```
35
27
 
36
- - React 19+
37
- - Node.js 20-24
38
- - TypeScript 5.9+
28
+ ### Peer Dependencies Check
29
+
30
+ Ensure your React application contains required core packages:
39
31
 
40
32
  ```bash
41
- # Using pnpm (recommended), but you can use npm, yarn or bun as well
42
- pnpm add @tuwaio/nova-connect @tuwaio/orbit-core @tuwaio/satellite-core @tuwaio/satellite-react @tuwaio/pulsar-core @tuwaio/nova-core zustand immer framer-motion react-toastify ethereum-blockies-base64 @emotion/is-prop-valid @web3icons/react @web3icons/common @heroicons/react @radix-ui/react-dialog @radix-ui/react-select
33
+ # State & Utilities
34
+ pnpm add zustand immer dayjs clsx tailwind-merge framer-motion @emotion/is-prop-valid
35
+
36
+ # Dialog & Icons Primitives
37
+ pnpm add @radix-ui/react-dialog @radix-ui/react-select @heroicons/react @web3icons/react @web3icons/common
43
38
  ```
44
39
 
45
40
  ---
46
41
 
47
- ## 🚀 Quick Start
42
+ ## 🚀 Quick Start Setup
43
+
44
+ ### 1. Global Providers Integration
48
45
 
49
- ### Basic Provider Setup
46
+ Wrap your React tree with the Wagmi configuration, Satellite logic connection provider, and Nova Connect layout provider:
50
47
 
51
48
  ```tsx
49
+ import { ReactNode } from 'react';
52
50
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
53
- import { satelliteEVMAdapter, createDefaultTransports } from '@tuwaio/satellite-evm';
54
- import { NovaConnectProvider } from '@tuwaio/nova-connect';
55
- import { SatelliteConnectProvider } from '@tuwaio/nova-connect/satellite';
56
- import { EVMWalletsWatcher } from '@tuwaio/nova-connect/evm';
57
- import { SolanaWalletsWatcher } from '@tuwaio/nova-connect/solana';
58
- import { satelliteSolanaAdapter } from '@tuwaio/satellite-solana';
59
51
  import { WagmiProvider } from 'wagmi';
60
- import { ReactNode } from 'react';
61
- import { createConfig } from '@wagmi/core';
62
- import { injected } from '@wagmi/connectors';
63
- import { mainnet, sepolia } from 'viem/chains';
64
- import type { Chain } from 'viem/chains';
65
-
66
- export const appEVMChains = [mainnet, sepolia] as readonly [Chain, ...Chain[]];
67
-
68
- export const wagmiConfig = createConfig({
69
- connectors: [injected()],
70
- transports: createDefaultTransports(appEVMChains), // Automatically creates http transports
71
- chains: appEVMChains,
72
- ssr: true, // Enable SSR support if needed (e.g., in Next.js)
73
- });
52
+ import { satelliteEVMAdapter } from '@tuwaio/satellite-evm';
53
+ import { satelliteSolanaAdapter } from '@tuwaio/satellite-solana';
54
+ import { SatelliteConnectProvider } from '@tuwaio/nova-connect/satellite';
55
+ import { EVMConnectorsWatcher } from '@tuwaio/nova-connect/evm';
56
+ import { SolanaConnectorsWatcher } from '@tuwaio/nova-connect/solana';
57
+ import { NovaConnectProvider } from '@tuwaio/nova-connect';
74
58
 
75
- export const solanaRPCUrls = {
76
- devnet: 'https://api.devnet.solana.com',
77
- };
59
+ import { wagmiConfig, appEVMChains, solanaRPCUrls } from './config/appConfig';
78
60
 
79
61
  const queryClient = new QueryClient();
80
62
 
81
- export function Providers({ children }: { children: ReactNode }) {
63
+ export function Web3Providers({ children }: { children: ReactNode }) {
82
64
  return (
83
65
  <WagmiProvider config={wagmiConfig}>
84
66
  <QueryClientProvider client={queryClient}>
67
+ {/* Layer 1: Headless Connection logic */}
85
68
  <SatelliteConnectProvider
86
- adapter={[satelliteEVMAdapter(wagmiConfig), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })]}
69
+ adapter={[satelliteEVMAdapter(wagmiConfig, appEVMChains), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })]}
87
70
  autoConnect={true}
88
71
  >
89
- <EVMWalletsWatcher wagmiConfig={wagmiConfig} />
90
- <SolanaWalletsWatcher />
72
+ {/* Watchers sync native connector states to the store */}
73
+ <EVMConnectorsWatcher wagmiConfig={wagmiConfig} />
74
+ <SolanaConnectorsWatcher />
75
+
76
+ {/* Layer 2: Visual Connection component provider */}
91
77
  <NovaConnectProvider
92
78
  appChains={appEVMChains}
93
79
  solanaRPCUrls={solanaRPCUrls}
94
- withImpersonated
95
80
  withBalance
96
81
  withChain
82
+ withImpersonated
97
83
  >
98
84
  {children}
99
85
  </NovaConnectProvider>
@@ -104,76 +90,53 @@ export function Providers({ children }: { children: ReactNode }) {
104
90
  }
105
91
  ```
106
92
 
107
- ### Using ConnectButton
93
+ ### 2. Rendering the Connection Button
94
+
95
+ Place the component in your header or navigation bar:
108
96
 
109
97
  ```tsx
110
98
  import { ConnectButton } from '@tuwaio/nova-connect/components';
111
99
 
112
- function App() {
100
+ export function NavigationHeader() {
113
101
  return (
114
- <div>
102
+ <header className="flex justify-between items-center p-4 border-b border-[var(--tuwa-border-primary)]">
103
+ <span className="font-bold">My dApp</span>
115
104
  <ConnectButton />
116
- </div>
105
+ </header>
117
106
  );
118
107
  }
119
108
  ```
120
109
 
121
110
  ---
122
111
 
123
- ## 🧩 Key Components
124
-
125
- ### 1. **ConnectButton**
112
+ ## 🎨 Component Customization
126
113
 
127
- - Main component for wallet connection.
128
- - Full customization system.
129
-
130
- ### 2. **NovaConnectProvider**
131
-
132
- - Context provider with state management.
133
- - Customizable error handling.
134
- - Flexible internationalization system.
135
-
136
- ---
137
-
138
- ## 🌍 Internationalization
139
-
140
- Nova Connect supports full label customization:
114
+ Pass class names and layout overrides using the `customization` property to match components with your custom UI:
141
115
 
142
116
  ```tsx
143
- const customLabels = {
144
- connectWallet: 'Connect Wallet',
145
- disconnect: 'Disconnect',
146
- connecting: 'Connecting...',
147
- connected: 'Connected',
148
- // ... other labels
149
- };
150
-
151
- <NovaConnectProvider
152
- labels={customLabels}
153
- // ... other props
154
- />;
117
+ import { ConnectButton } from '@tuwaio/nova-connect/components';
118
+ import { cn } from '@tuwaio/nova-core';
119
+
120
+ export function CustomHeader() {
121
+ return (
122
+ <ConnectButton
123
+ customization={{
124
+ classNames: {
125
+ connectButton: () =>
126
+ cn(
127
+ 'px-6 py-2 rounded-full font-mono text-sm uppercase transition-all duration-300',
128
+ 'bg-emerald-500 text-slate-950 hover:bg-emerald-600 focus:ring-2 focus:ring-emerald-500',
129
+ ),
130
+ walletName: () => 'text-xs text-slate-300 font-semibold',
131
+ },
132
+ }}
133
+ />
134
+ );
135
+ }
155
136
  ```
156
137
 
157
138
  ---
158
139
 
159
- ## ♿ Accessibility
160
-
161
- Nova Connect fully supports accessibility standards:
162
-
163
- - ARIA labels and descriptions
164
- - Keyboard navigation
165
- - Screen reader support
166
- - Semantic HTML elements
167
- - High contrast
168
-
169
- ## 🤝 Contributing & Support
170
-
171
- Contributions are welcome! Please read our main **[Contribution Guidelines](https://github.com/TuwaIO/workflows/blob/main/CONTRIBUTING.md)**.
172
-
173
- If you find this library useful, please consider supporting its development. Every contribution helps!
174
-
175
- [**➡️ View Support Options**](https://github.com/TuwaIO/workflows/blob/main/Donation.md)
176
-
177
140
  ## 📄 License
178
141
 
179
- This project is licensed under the **Apache-2.0 License** - see the [LICENSE](./LICENSE) file for details.
142
+ Licensed under the **Apache-2.0 License**. See the [LICENSE](./LICENSE) file for details.