shogun-button-react 2.0.3 → 2.0.5
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/dist/connector.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ShogunConnectorOptions, ShogunConnectorResult } from "./
|
|
1
|
+
import { ShogunConnectorOptions, ShogunConnectorResult } from "./interfaces/connector-options";
|
|
2
2
|
export declare function shogunConnector(options: ShogunConnectorOptions): ShogunConnectorResult;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ShogunButton, ShogunButtonProvider, useShogun } from './components/ShogunButton';
|
|
2
|
-
import { ShogunConnectorOptions, ShogunConnectorResult } from './
|
|
2
|
+
import { ShogunConnectorOptions, ShogunConnectorResult } from './interfaces/connector-options';
|
|
3
3
|
import { shogunConnector } from './connector';
|
|
4
4
|
import { GunAdvancedPlugin } from './plugins/GunAdvancedPlugin';
|
|
5
5
|
export { ShogunButton, ShogunButtonProvider, useShogun };
|
|
6
6
|
export { shogunConnector };
|
|
7
|
-
export * from './
|
|
7
|
+
export * from './interfaces/connector-options';
|
|
8
8
|
export { ShogunConnectorOptions, ShogunConnectorResult };
|
|
9
9
|
export { GunAdvancedPlugin };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shogun-button-react",
|
|
3
3
|
"description": "Shogun connector button",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.5",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src/styles/index.css"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ethers": "^6.13.5",
|
|
35
35
|
"prettier": "^3.5.3",
|
|
36
36
|
"rxjs": "^7.8.1",
|
|
37
|
-
"shogun-core": "^2.0.
|
|
37
|
+
"shogun-core": "^2.0.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "^18.0.0",
|
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
/* Base styles */
|
|
2
|
-
:root {
|
|
3
|
-
--shogun-primary: #3b82f6;
|
|
4
|
-
--shogun-primary-hover: #2563eb;
|
|
5
|
-
--shogun-secondary: #6b7280;
|
|
6
|
-
--shogun-success: #10b981;
|
|
7
|
-
--shogun-danger: #ef4444;
|
|
8
|
-
--shogun-warning: #f59e0b;
|
|
9
|
-
--shogun-text: #1f2937;
|
|
10
|
-
--shogun-text-secondary: #6b7280;
|
|
11
|
-
--shogun-bg: #ffffff;
|
|
12
|
-
--shogun-bg-secondary: #f3f4f6;
|
|
13
|
-
--shogun-border: #e5e7eb;
|
|
14
|
-
--shogun-border-radius: 12px;
|
|
15
|
-
--shogun-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
16
|
-
--shogun-transition: all 0.2s ease;
|
|
17
|
-
--shogun-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/* Dark mode support */
|
|
21
|
-
@media (prefers-color-scheme: dark) {
|
|
22
|
-
:root {
|
|
23
|
-
--shogun-text: #f3f4f6;
|
|
24
|
-
--shogun-text-secondary: #9ca3af;
|
|
25
|
-
--shogun-bg: #1f2937;
|
|
26
|
-
--shogun-bg-secondary: #374151;
|
|
27
|
-
--shogun-border: #4b5563;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/* Connect Button */
|
|
32
|
-
.shogun-connect-button {
|
|
33
|
-
display: flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
gap: 8px;
|
|
37
|
-
background-color: var(--shogun-primary);
|
|
38
|
-
color: white;
|
|
39
|
-
border: none;
|
|
40
|
-
border-radius: var(--shogun-border-radius);
|
|
41
|
-
padding: 10px 16px;
|
|
42
|
-
font-family: var(--shogun-font);
|
|
43
|
-
font-weight: 600;
|
|
44
|
-
font-size: 14px;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
transition: var(--shogun-transition);
|
|
47
|
-
box-shadow: var(--shogun-shadow);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.shogun-connect-button:hover {
|
|
51
|
-
background-color: var(--shogun-primary-hover);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.shogun-connect-button:focus {
|
|
55
|
-
outline: none;
|
|
56
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* Logged in state */
|
|
60
|
-
.shogun-logged-in-container {
|
|
61
|
-
position: relative;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.shogun-dropdown {
|
|
65
|
-
position: relative;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.shogun-button.shogun-logged-in {
|
|
69
|
-
display: flex;
|
|
70
|
-
align-items: center;
|
|
71
|
-
gap: 8px;
|
|
72
|
-
background-color: var(--shogun-bg-secondary);
|
|
73
|
-
color: var(--shogun-text);
|
|
74
|
-
border: 1px solid var(--shogun-border);
|
|
75
|
-
border-radius: var(--shogun-border-radius);
|
|
76
|
-
padding: 8px 12px;
|
|
77
|
-
font-family: var(--shogun-font);
|
|
78
|
-
font-size: 14px;
|
|
79
|
-
cursor: pointer;
|
|
80
|
-
transition: var(--shogun-transition);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
.shogun-button.shogun-logged-in:hover {
|
|
84
|
-
background-color: var(--shogun-bg);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.shogun-avatar {
|
|
88
|
-
width: 24px;
|
|
89
|
-
height: 24px;
|
|
90
|
-
background-color: var(--shogun-primary);
|
|
91
|
-
color: white;
|
|
92
|
-
border-radius: 50%;
|
|
93
|
-
display: flex;
|
|
94
|
-
align-items: center;
|
|
95
|
-
justify-content: center;
|
|
96
|
-
font-weight: 600;
|
|
97
|
-
font-size: 12px;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.shogun-username {
|
|
101
|
-
font-weight: 500;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.shogun-dropdown-menu {
|
|
105
|
-
position: absolute;
|
|
106
|
-
top: calc(100% + 8px);
|
|
107
|
-
right: 0;
|
|
108
|
-
background-color: var(--shogun-bg);
|
|
109
|
-
border: 1px solid var(--shogun-border);
|
|
110
|
-
border-radius: var(--shogun-border-radius);
|
|
111
|
-
box-shadow: var(--shogun-shadow);
|
|
112
|
-
width: 240px;
|
|
113
|
-
z-index: 9999;
|
|
114
|
-
overflow: hidden;
|
|
115
|
-
animation: shogun-dropdown-fade 0.2s ease;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
@keyframes shogun-dropdown-fade {
|
|
119
|
-
from {
|
|
120
|
-
opacity: 0;
|
|
121
|
-
transform: translateY(-8px);
|
|
122
|
-
}
|
|
123
|
-
to {
|
|
124
|
-
opacity: 1;
|
|
125
|
-
transform: translateY(0);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
.shogun-dropdown-header {
|
|
130
|
-
padding: 16px;
|
|
131
|
-
border-bottom: 1px solid var(--shogun-border);
|
|
132
|
-
display: flex;
|
|
133
|
-
align-items: center;
|
|
134
|
-
gap: 12px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.shogun-avatar-large {
|
|
138
|
-
width: 40px;
|
|
139
|
-
height: 40px;
|
|
140
|
-
background-color: var(--shogun-primary);
|
|
141
|
-
color: white;
|
|
142
|
-
border-radius: 50%;
|
|
143
|
-
display: flex;
|
|
144
|
-
align-items: center;
|
|
145
|
-
justify-content: center;
|
|
146
|
-
font-weight: 600;
|
|
147
|
-
font-size: 16px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.shogun-user-info {
|
|
151
|
-
display: flex;
|
|
152
|
-
flex-direction: column;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
.shogun-username-full {
|
|
156
|
-
font-weight: 600;
|
|
157
|
-
color: var(--shogun-text);
|
|
158
|
-
font-size: 14px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.shogun-dropdown-item {
|
|
162
|
-
padding: 12px 16px;
|
|
163
|
-
display: flex;
|
|
164
|
-
align-items: center;
|
|
165
|
-
gap: 12px;
|
|
166
|
-
color: var(--shogun-text);
|
|
167
|
-
font-size: 14px;
|
|
168
|
-
cursor: pointer;
|
|
169
|
-
transition: var(--shogun-transition);
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
.shogun-dropdown-item:hover {
|
|
173
|
-
background-color: var(--shogun-bg-secondary);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
/* Modal */
|
|
177
|
-
.shogun-modal-overlay {
|
|
178
|
-
position: fixed;
|
|
179
|
-
top: 0;
|
|
180
|
-
left: 0;
|
|
181
|
-
right: 0;
|
|
182
|
-
bottom: 0;
|
|
183
|
-
background-color: rgba(0, 0, 0, 0.5);
|
|
184
|
-
display: flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
z-index: 1000;
|
|
188
|
-
animation: shogun-fade-in 0.2s ease;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
@keyframes shogun-fade-in {
|
|
192
|
-
from {
|
|
193
|
-
opacity: 0;
|
|
194
|
-
}
|
|
195
|
-
to {
|
|
196
|
-
opacity: 1;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
.shogun-modal {
|
|
201
|
-
background-color: var(--shogun-bg);
|
|
202
|
-
border-radius: var(--shogun-border-radius);
|
|
203
|
-
box-shadow: var(--shogun-shadow);
|
|
204
|
-
width: 90%;
|
|
205
|
-
max-width: 400px;
|
|
206
|
-
max-height: 90vh;
|
|
207
|
-
overflow-y: auto;
|
|
208
|
-
animation: shogun-scale-in 0.2s ease;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@keyframes shogun-scale-in {
|
|
212
|
-
from {
|
|
213
|
-
opacity: 0;
|
|
214
|
-
transform: scale(0.95);
|
|
215
|
-
}
|
|
216
|
-
to {
|
|
217
|
-
opacity: 1;
|
|
218
|
-
transform: scale(1);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.shogun-modal-header {
|
|
223
|
-
display: flex;
|
|
224
|
-
justify-content: space-between;
|
|
225
|
-
align-items: center;
|
|
226
|
-
padding: 16px 20px;
|
|
227
|
-
border-bottom: 1px solid var(--shogun-border);
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.shogun-modal-header h2 {
|
|
231
|
-
margin: 0;
|
|
232
|
-
font-size: 1.5rem;
|
|
233
|
-
font-weight: 600;
|
|
234
|
-
color: var(--shogun-text);
|
|
235
|
-
text-align: center;
|
|
236
|
-
width: 100%;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
.shogun-close-button {
|
|
240
|
-
background: none;
|
|
241
|
-
border: none;
|
|
242
|
-
cursor: pointer;
|
|
243
|
-
color: var(--shogun-text-secondary);
|
|
244
|
-
padding: 4px;
|
|
245
|
-
display: flex;
|
|
246
|
-
align-items: center;
|
|
247
|
-
justify-content: center;
|
|
248
|
-
border-radius: 50%;
|
|
249
|
-
transition: var(--shogun-transition);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.shogun-close-button:hover {
|
|
253
|
-
background-color: var(--shogun-bg-secondary);
|
|
254
|
-
color: var(--shogun-text);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
.shogun-modal-content {
|
|
258
|
-
padding: 20px;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/* Auth options */
|
|
262
|
-
.shogun-auth-options {
|
|
263
|
-
display: flex;
|
|
264
|
-
flex-direction: column;
|
|
265
|
-
gap: 12px;
|
|
266
|
-
margin-bottom: 24px;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.shogun-auth-option-button {
|
|
270
|
-
display: flex;
|
|
271
|
-
align-items: center;
|
|
272
|
-
justify-content: center;
|
|
273
|
-
gap: 12px;
|
|
274
|
-
background-color: var(--shogun-bg);
|
|
275
|
-
color: var(--shogun-text);
|
|
276
|
-
border: 1px solid var(--shogun-border);
|
|
277
|
-
border-radius: var(--shogun-border-radius);
|
|
278
|
-
padding: 12px 16px;
|
|
279
|
-
font-family: var(--shogun-font);
|
|
280
|
-
font-weight: 500;
|
|
281
|
-
font-size: 14px;
|
|
282
|
-
cursor: pointer;
|
|
283
|
-
transition: var(--shogun-transition);
|
|
284
|
-
width: 100%;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.shogun-auth-option-button:hover {
|
|
288
|
-
background-color: var(--shogun-bg-secondary);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.shogun-auth-option-button:disabled {
|
|
292
|
-
opacity: 0.6;
|
|
293
|
-
cursor: not-allowed;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
.shogun-google-button {
|
|
297
|
-
border-color: #4285F4;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
/* Divider */
|
|
301
|
-
.shogun-divider {
|
|
302
|
-
display: flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
margin: 20px 0;
|
|
305
|
-
color: var(--shogun-text-secondary);
|
|
306
|
-
font-size: 14px;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.shogun-divider::before,
|
|
310
|
-
.shogun-divider::after {
|
|
311
|
-
content: "";
|
|
312
|
-
flex: 1;
|
|
313
|
-
border-bottom: 1px solid var(--shogun-border);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
.shogun-divider span {
|
|
317
|
-
padding: 0 10px;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/* Form */
|
|
321
|
-
.shogun-auth-form {
|
|
322
|
-
display: flex;
|
|
323
|
-
flex-direction: column;
|
|
324
|
-
gap: 16px;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
.shogun-form-group {
|
|
328
|
-
display: flex;
|
|
329
|
-
flex-direction: column;
|
|
330
|
-
gap: 8px;
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
.shogun-form-group label {
|
|
334
|
-
display: flex;
|
|
335
|
-
align-items: center;
|
|
336
|
-
gap: 8px;
|
|
337
|
-
font-size: 14px;
|
|
338
|
-
font-weight: 500;
|
|
339
|
-
color: var(--shogun-text);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.shogun-form-group input {
|
|
343
|
-
padding: 12px;
|
|
344
|
-
border: 1px solid var(--shogun-border);
|
|
345
|
-
border-radius: var(--shogun-border-radius);
|
|
346
|
-
background-color: var(--shogun-bg);
|
|
347
|
-
color: var(--shogun-text);
|
|
348
|
-
font-size: 14px;
|
|
349
|
-
transition: var(--shogun-transition);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
.shogun-form-group input:focus {
|
|
353
|
-
outline: none;
|
|
354
|
-
border-color: var(--shogun-primary);
|
|
355
|
-
box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.shogun-submit-button {
|
|
359
|
-
background-color: var(--shogun-primary);
|
|
360
|
-
color: white;
|
|
361
|
-
border: none;
|
|
362
|
-
border-radius: var(--shogun-border-radius);
|
|
363
|
-
padding: 12px 16px;
|
|
364
|
-
font-family: var(--shogun-font);
|
|
365
|
-
font-weight: 600;
|
|
366
|
-
font-size: 14px;
|
|
367
|
-
cursor: pointer;
|
|
368
|
-
transition: var(--shogun-transition);
|
|
369
|
-
margin-top: 8px;
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
.shogun-submit-button:hover:not(:disabled) {
|
|
373
|
-
background-color: var(--shogun-primary-hover);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
.shogun-submit-button:disabled {
|
|
377
|
-
opacity: 0.6;
|
|
378
|
-
cursor: not-allowed;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/* Footer */
|
|
382
|
-
.shogun-form-footer {
|
|
383
|
-
margin-top: 20px;
|
|
384
|
-
text-align: center;
|
|
385
|
-
font-size: 14px;
|
|
386
|
-
color: var(--shogun-text-secondary);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
.shogun-toggle-mode {
|
|
390
|
-
background: none;
|
|
391
|
-
border: none;
|
|
392
|
-
color: var(--shogun-primary);
|
|
393
|
-
font-weight: 600;
|
|
394
|
-
cursor: pointer;
|
|
395
|
-
padding: 0;
|
|
396
|
-
margin-left: 4px;
|
|
397
|
-
transition: var(--shogun-transition);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
.shogun-toggle-mode:hover {
|
|
401
|
-
text-decoration: underline;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.shogun-toggle-mode:disabled {
|
|
405
|
-
opacity: 0.6;
|
|
406
|
-
cursor: not-allowed;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
/* Error message */
|
|
410
|
-
.shogun-error-message {
|
|
411
|
-
background-color: rgba(239, 68, 68, 0.1);
|
|
412
|
-
color: var(--shogun-danger);
|
|
413
|
-
padding: 12px;
|
|
414
|
-
border-radius: var(--shogun-border-radius);
|
|
415
|
-
margin-bottom: 16px;
|
|
416
|
-
font-size: 14px;
|
|
417
|
-
border: 1px solid rgba(239, 68, 68, 0.2);
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
.shogun-back-button {
|
|
421
|
-
background: none;
|
|
422
|
-
border: none;
|
|
423
|
-
color: var(--shogun-text-secondary);
|
|
424
|
-
cursor: pointer;
|
|
425
|
-
font-size: 14px;
|
|
426
|
-
margin-bottom: 16px;
|
|
427
|
-
padding: 4px;
|
|
428
|
-
display: flex;
|
|
429
|
-
align-items: center;
|
|
430
|
-
gap: 4px;
|
|
431
|
-
font-weight: 500;
|
|
432
|
-
transition: color 0.2s ease;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
.shogun-back-button:hover {
|
|
436
|
-
color: var(--shogun-text);
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.shogun-prominent-toggle {
|
|
440
|
-
font-weight: 600;
|
|
441
|
-
color: var(--shogun-primary);
|
|
442
|
-
padding: 8px 16px;
|
|
443
|
-
margin-top: 16px;
|
|
444
|
-
border: none;
|
|
445
|
-
border-radius: 6px;
|
|
446
|
-
background-color: transparent;
|
|
447
|
-
transition: all 0.2s ease;
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
.shogun-prominent-toggle:hover {
|
|
451
|
-
text-decoration: underline;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
/* Redundant dark theme styles removed */
|
|
File without changes
|
|
File without changes
|