@rash2x/bridge-widget 0.1.11 → 0.1.13

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
@@ -47,6 +47,24 @@ npm install @tonconnect/ui-react @ton/core @ton/crypto @ton/ton
47
47
  npm install @tronweb3/tronwallet-adapter-react-hooks @tronweb3/tronwallet-adapters tronweb
48
48
  ```
49
49
 
50
+ ### Required shadcn/ui Components
51
+
52
+ This library requires certain shadcn/ui components to be installed in your project. The library does **not bundle** these components to avoid duplication and allow you to use your own styled versions.
53
+
54
+ **Required components:** `accordion`, `button`, `card`, `dialog`, `input`, `skeleton`, `switch`, `tooltip`
55
+
56
+ Install them using shadcn CLI:
57
+
58
+ ```bash
59
+ npx shadcn@latest add accordion button card dialog input skeleton switch tooltip
60
+ ```
61
+
62
+ **Important:** Your project must have the following path aliases configured:
63
+ - `@/components/ui` - for UI components
64
+ - `@/lib/utils` - for the `cn` utility function
65
+
66
+ For detailed setup instructions, see [SHADCN_COMPONENTS.md](./SHADCN_COMPONENTS.md).
67
+
50
68
  ## Quick Start
51
69
 
52
70
  ### 1. Basic Setup
@@ -81,10 +99,11 @@ function App() {
81
99
  }
82
100
  ```
83
101
 
84
- ### 2. With Event Handlers
102
+ ### 2. With Event Handlers and Language
85
103
 
86
104
  ```tsx
87
105
  <EvaaBridge
106
+ defaultLanguage="ru" // Set default language (en, ru)
88
107
  onSwapSuccess={(data) => {
89
108
  console.log('Swap completed:', data);
90
109
  }}
@@ -110,7 +129,9 @@ function App() {
110
129
  | Prop | Type | Description |
111
130
  |------|------|-------------|
112
131
  | `className` | `string` | Optional CSS class for custom styling |
113
- | `theme` | `'light' \| 'dark'` | Theme mode |
132
+ | `defaultLanguage` | `string` | Language for the widget UI (default: `'en'`). Supported: `'en'`, `'ru'` |
133
+ | `tonClient` | `TonClient` | Optional TON client instance |
134
+ | `tonApiKey` | `string` | Optional TON API key |
114
135
  | `onInitialized` | `() => void` | Callback when bridge is initialized |
115
136
  | `onSwapStart` | `(data: SwapStartData) => void` | Callback when swap starts |
116
137
  | `onSwapSuccess` | `(data: SwapSuccessData) => void` | Callback when swap succeeds |