@matchain/matchid-sdk-react 0.1.7
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/index.css +461 -0
- package/dist/index.d.mts +211 -0
- package/dist/index.d.ts +211 -0
- package/dist/index.js +1990 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1956 -0
- package/dist/index.mjs.map +1 -0
- package/example/index.html +13 -0
- package/example/package-lock.json +2965 -0
- package/example/package.json +34 -0
- package/example/postcss.config.js +6 -0
- package/example/src/App.tsx +61 -0
- package/example/src/app.css +3 -0
- package/example/src/config/contract.ts +154 -0
- package/example/src/main.tsx +5 -0
- package/example/src/pages/Home.tsx +36 -0
- package/example/src/pages/Login.tsx +165 -0
- package/example/tailwind.config.js +11 -0
- package/example/tsconfig.json +17 -0
- package/example/vite.config.ts +13 -0
- package/example/yarn.lock +1373 -0
- package/package.json +58 -0
- package/readme.md +5 -0
package/dist/index.css
ADDED
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
body {
|
|
2
|
+
/**value**/
|
|
3
|
+
--matchid-light-orange: #FFF3EB;
|
|
4
|
+
--matchid-highlight-orange: #FC802D;
|
|
5
|
+
--matchid-black: #000000;
|
|
6
|
+
--matchid-white: #FFFFFF;
|
|
7
|
+
--matchid-black-800: #1E1E1E;
|
|
8
|
+
--matchid-gray-600: #6E6E6E;
|
|
9
|
+
--matchid-gray-400: #B6B6B6;
|
|
10
|
+
--matchid-gray-300: #E3E3E3;
|
|
11
|
+
--matchid-gray-200:#F3F3F3;
|
|
12
|
+
--matchid-gray-100: #F8F8F8;
|
|
13
|
+
--matchid-red-600: #F7585E;
|
|
14
|
+
--matchid-green-600:#2CBF68;
|
|
15
|
+
|
|
16
|
+
--matchid-shadow-full: 0px 15px 40px 0px rgba(22, 17, 46, 0.12);
|
|
17
|
+
--matchid-shadow-middle: 0px 10px 30px 0px rgba(22, 17, 46, 0.12);
|
|
18
|
+
--matchid-shadow-small: 0px 10px 20px 0px rgba(219, 219, 219, 0.50);
|
|
19
|
+
/**root component**/
|
|
20
|
+
--matchid-placeholder-color: var(--matchid-gray-400);
|
|
21
|
+
|
|
22
|
+
--matchid-line: var(--matchid-gray-300);
|
|
23
|
+
--matchid-arrow-color: var(--matchid-black);
|
|
24
|
+
--matchid-text-color: var(--matchid-black);
|
|
25
|
+
--matchid-round: 12px;
|
|
26
|
+
--matchid-round-lg: 24px;
|
|
27
|
+
--matchid-padding-lg: 32px;
|
|
28
|
+
/**login component**/
|
|
29
|
+
--matchid-login-method-border-color: var(--matchid-line);
|
|
30
|
+
--matchid-login-method-hover-border-color: var(--matchid-highlight-orange);
|
|
31
|
+
--matchid-login-method-arrow-color: var(--matchid-arrow-color);
|
|
32
|
+
--matchid-login-method-round: var(--matchid-round);
|
|
33
|
+
--matchid-login-method-color: var(--matchid-text-color);
|
|
34
|
+
|
|
35
|
+
--matchid-login-panel-divide-color: var(--matchid-line);
|
|
36
|
+
--matchid-login-panel-title-color: var(--matchid-text-color);
|
|
37
|
+
--matchid-login-panel-subtitle-color: var(--matchid-gray-600);
|
|
38
|
+
/**overlay component**/
|
|
39
|
+
--matchid-overlay-index: 9999;
|
|
40
|
+
/**modal component**/
|
|
41
|
+
--matchid-modal-bg: var(--matchid-white);
|
|
42
|
+
--matchid-modal-shadow: var(--matchid-shadow-full);
|
|
43
|
+
--matchid-modal-border-color: var(--matchid-white);
|
|
44
|
+
--matchid-modal-round: var(--matchid-round-lg);
|
|
45
|
+
--matchid-modal-padding: var(--matchid-padding-lg);
|
|
46
|
+
|
|
47
|
+
--matchid-modal-header-border-color: var(--matchid-line);
|
|
48
|
+
--matchid-modal-header-color: var(--matchid-text-color);
|
|
49
|
+
/**input component**/
|
|
50
|
+
--matchid-input-border-color: var(--matchid-line);
|
|
51
|
+
--matchid-input-focus-border-color: var(--matchid-highlight-orange);
|
|
52
|
+
--matchid-input-color: var(--matchid-text-color);
|
|
53
|
+
--matchid-input-placeholder-color: var(--matchid-placeholder-color);
|
|
54
|
+
--matchid-input-bg: var(--matchid-gray-100);
|
|
55
|
+
--matchid-input-focus-bg: var(--matchid-light-orange);
|
|
56
|
+
--matchid-input-delete-icon-color: var(--matchid-highlight-orange);
|
|
57
|
+
/**field component**/
|
|
58
|
+
--matchid-field-color: var(--matchid-text-color);
|
|
59
|
+
--matchid-field-error-color: var(--matchid-red-600);
|
|
60
|
+
/**button component**/
|
|
61
|
+
--matchid-btn-border-color: var(--matchid-black);
|
|
62
|
+
--matchid-btn-color: var(--matchid-black);
|
|
63
|
+
--matchid-btn-bg: var(--matchid-white);
|
|
64
|
+
|
|
65
|
+
--matchid-btn-disabled-bg: var(--matchid-gray-600);
|
|
66
|
+
--matchid-btn-disabled-color: var(--matchid-white);
|
|
67
|
+
|
|
68
|
+
--matchid-btn-hover-bg: var(--matchid-black-800);
|
|
69
|
+
--matchid-btn-hover-color: var(--matchid-white);
|
|
70
|
+
|
|
71
|
+
--matchid-btn-active-bg: linear-gradient(0deg, rgba(0, 0, 0, 0.06) 0%, rgba(0, 0, 0, 0.06) 100%), #1E1E1E;
|
|
72
|
+
--matchid-btn-active-color: var(--matchid-white);
|
|
73
|
+
|
|
74
|
+
--matchid-btn-highlight-bg: var(--matchid-black);
|
|
75
|
+
--matchid-btn-highlight-color: var(--matchid-white);
|
|
76
|
+
|
|
77
|
+
--matchid-btn-loading-bg: var(--matchid-black-800);
|
|
78
|
+
--matchid-btn-loading-color: var(--matchid-white);
|
|
79
|
+
|
|
80
|
+
--matchid-email-verify-header-value-color:var(--matchid-highlight-orange);
|
|
81
|
+
--matchid-email-verify-header-value-tips:var(--matchid-gray-600);
|
|
82
|
+
/****/
|
|
83
|
+
--matchid-valid-error-color:var(--matchid-gray-600);
|
|
84
|
+
--matchid-valid-success-color:var(--matchid-black);
|
|
85
|
+
--matchid-password-header-color:var(--matchid-black);
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.matchid-login-box {
|
|
90
|
+
width: 100%;
|
|
91
|
+
display: flex;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
align-items: center;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
gap: 16px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.matchid-login-method {
|
|
99
|
+
display: flex;
|
|
100
|
+
justify-content: space-between;
|
|
101
|
+
align-items: center;
|
|
102
|
+
gap: 16px;
|
|
103
|
+
height: 72px;
|
|
104
|
+
width: 100%;
|
|
105
|
+
padding: 16px;
|
|
106
|
+
cursor: pointer;
|
|
107
|
+
color: var(--matchid-login-method-color, #000000);
|
|
108
|
+
border-radius: var(--matchid-login-method-round, 12px);
|
|
109
|
+
border: 1px solid var(--matchid-login-method-border-color, #E3E3E3);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.matchid-login-method:hover {
|
|
113
|
+
border-color: var(--matchid-login-method-hover-border-color, #FC802D);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.matchid-login-method-content {
|
|
117
|
+
display: flex;
|
|
118
|
+
justify-content: flex-start;
|
|
119
|
+
align-items: center;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.matchid-login-panel {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 24px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.matchid-login-panel-divide {
|
|
130
|
+
height: 1px;
|
|
131
|
+
width: 100%;
|
|
132
|
+
background-color: var(--matchid-login-panel-divide-color, #E3E3E3);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.matchid-login-panel-header {
|
|
136
|
+
display: flex;
|
|
137
|
+
width: 100%;
|
|
138
|
+
justify-content: space-between;
|
|
139
|
+
align-items: center;
|
|
140
|
+
gap: 4px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.matchid-login-panel-header-title {
|
|
144
|
+
color: var(--matchid-login-panel-title-color, #000000);
|
|
145
|
+
font-size: 18px;
|
|
146
|
+
font-weight: 600;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.matchid-login-panel-header-subtilte {
|
|
150
|
+
color: var(--matchid-login-panel-subtitle-color, #6E6E6E);
|
|
151
|
+
font-size: 14px;
|
|
152
|
+
font-weight: 400;
|
|
153
|
+
line-height: 120%;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.matchid-login-panel-header-close {
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.matchid-overlay {
|
|
161
|
+
position: fixed;
|
|
162
|
+
top: 0;
|
|
163
|
+
left: 0;
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 100%;
|
|
166
|
+
display: flex;
|
|
167
|
+
justify-content: center;
|
|
168
|
+
align-items: center;
|
|
169
|
+
z-index: var(--matchid-overlay-index);
|
|
170
|
+
overflow: hidden;
|
|
171
|
+
backdrop-filter: blur(1px);
|
|
172
|
+
background: rgba(0, 0, 0, .3);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.matchid-modal {
|
|
176
|
+
border-radius: var(--matchid-modal-round, 24px);
|
|
177
|
+
border: 1px solid var(--matchid-modal-border-color, #FFF);
|
|
178
|
+
background: var(--matchid-modal-bg, #FFF);
|
|
179
|
+
box-shadow: var(--matchid-modal-shadow, 0px 15px 40px 0px rgba(22, 17, 46, 0.12));
|
|
180
|
+
width: 480px;
|
|
181
|
+
max-width: 90vw;
|
|
182
|
+
padding: var(--matchid-modal-padding, 32px);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.matchid-modal-header {
|
|
186
|
+
padding-bottom: 24px;
|
|
187
|
+
margin-bottom: 24px;
|
|
188
|
+
border-bottom: 1px solid var(--matchid-modal-header-border-color, #E3E3E3);
|
|
189
|
+
height: 54px;
|
|
190
|
+
display: flex;
|
|
191
|
+
align-items: center;
|
|
192
|
+
justify-content: space-between;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.matchid-modal-header-content {
|
|
196
|
+
display: flex;
|
|
197
|
+
align-items: center;
|
|
198
|
+
gap: 12px;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.matchid-modal-header-back, .matchid-modal-header-close {
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.matchid-modal-header-title {
|
|
206
|
+
color: var(--matchid-modal-header-color, #000);
|
|
207
|
+
font-size: 18px;
|
|
208
|
+
font-weight: 600;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.matchid-input-box {
|
|
212
|
+
width: 100%;
|
|
213
|
+
height: 72px;
|
|
214
|
+
padding-left:24px;
|
|
215
|
+
border-radius: 12px;
|
|
216
|
+
border: 1px solid var(--matchid-input-border-color);
|
|
217
|
+
display: flex;
|
|
218
|
+
align-items: center;
|
|
219
|
+
justify-content: space-between;
|
|
220
|
+
background: var(--matchid-input-bg);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.matchid-input-box:active, .matchid-input-box:focus, .matchid-input-box:focus-within {
|
|
224
|
+
border-color: var(--matchid-input-focus-border-color);
|
|
225
|
+
background: var(--matchid-input-focus-bg);
|
|
226
|
+
}
|
|
227
|
+
.matchid-input-delete-icon{
|
|
228
|
+
opacity: 0;
|
|
229
|
+
cursor: pointer;
|
|
230
|
+
margin-left:24px;
|
|
231
|
+
margin-right: 24px;
|
|
232
|
+
}
|
|
233
|
+
.matchid-input-box:focus-within .matchid-input-delete-icon{
|
|
234
|
+
opacity: 1;
|
|
235
|
+
}
|
|
236
|
+
.matchid-input-eye-icon{
|
|
237
|
+
cursor: pointer;
|
|
238
|
+
margin-left:24px;
|
|
239
|
+
margin-right: 24px;
|
|
240
|
+
}
|
|
241
|
+
.matchid-input-box.matchid-input-has-content {
|
|
242
|
+
background: var(--matchid-input-focus-bg);
|
|
243
|
+
}
|
|
244
|
+
.matchid-input-field {
|
|
245
|
+
flex: 1;
|
|
246
|
+
height: 100%;
|
|
247
|
+
outline: 0;
|
|
248
|
+
color: var(--matchid-input-color);
|
|
249
|
+
font-size: 18px;
|
|
250
|
+
font-weight: 600;
|
|
251
|
+
background: none;
|
|
252
|
+
margin-right: 24px;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.matchid-input-field::placeholder {
|
|
256
|
+
color: var(--matchid-input-placeholder-color);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.matchid-input-field:active, .matchid-input-field:focus {
|
|
260
|
+
outline: 0;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.matchid-field-box {
|
|
264
|
+
display: flex;
|
|
265
|
+
flex-direction: column;
|
|
266
|
+
gap: 16px;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.matchid-field-label {
|
|
270
|
+
color: var(--matchid-field-color);
|
|
271
|
+
font-size: 18px;
|
|
272
|
+
font-weight: 600;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.matchid-field-error{
|
|
276
|
+
font-size: 14px;
|
|
277
|
+
font-weight: 600;
|
|
278
|
+
color: var(--matchid-field-error-color);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.matchid-btn {
|
|
282
|
+
display: flex;
|
|
283
|
+
justify-content: center;
|
|
284
|
+
align-items: center;
|
|
285
|
+
gap: 10px;
|
|
286
|
+
border-radius: 12px;
|
|
287
|
+
outline: 0;
|
|
288
|
+
cursor: pointer;
|
|
289
|
+
border: 1px solid var(--matchid-btn-border-color);
|
|
290
|
+
color: var(--matchid-btn-color);
|
|
291
|
+
background: var(--matchid-btn-bg);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.matchid-btn:not(:disabled):hover {
|
|
295
|
+
background: var(--matchid-btn-hover-bg);
|
|
296
|
+
color: var(--matchid-btn-hover-color);
|
|
297
|
+
box-shadow: var(--matchid-shadow-middle);
|
|
298
|
+
border-color: var(--matchid-btn-hover-bg);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.matchid-btn:focus, .matchid-btn:active {
|
|
302
|
+
background: var(--matchid-btn-active-bg);
|
|
303
|
+
color: var(--matchid-btn-active-color);
|
|
304
|
+
box-shadow: var(--matchid-shadow-middle);
|
|
305
|
+
border-color: var(--matchid-btn-active-bg);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
.matchid-btn-highlight, .matchid-btn-highlight:hover, .matchid-btn-highlight:focus, .matchid-btn-highlight:active, .matchid-btn-highlight:not(:disabled):hover {
|
|
311
|
+
background: var(--matchid-btn-highlight-bg);
|
|
312
|
+
color: var(--matchid-btn-highlight-color);
|
|
313
|
+
border:0;
|
|
314
|
+
}
|
|
315
|
+
.matchid-btn:disabled {
|
|
316
|
+
cursor: not-allowed;
|
|
317
|
+
background: var(--matchid-btn-disabled-bg);
|
|
318
|
+
color: var(--matchid-btn-disabled-color);
|
|
319
|
+
}
|
|
320
|
+
.matchid-btn-loading {
|
|
321
|
+
background: var(--matchid-btn-loading-bg) !important;
|
|
322
|
+
color: var(--matchid-btn-loading-color) !important;
|
|
323
|
+
cursor: not-allowed;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
.matchid-btn-loading-icon {
|
|
327
|
+
animation: spin 2s linear infinite;
|
|
328
|
+
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
@keyframes spin {
|
|
332
|
+
0% {
|
|
333
|
+
transform: rotate(0deg);
|
|
334
|
+
}
|
|
335
|
+
100% {
|
|
336
|
+
transform: rotate(360deg);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
.matchid-btn-sm {
|
|
341
|
+
height: 32px;
|
|
342
|
+
font-size: 14px;
|
|
343
|
+
padding: 0 12px;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.matchid-btn-df {
|
|
347
|
+
height: 40px;
|
|
348
|
+
font-size: 16px;
|
|
349
|
+
padding: 0 16px;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.matchid-btn-lg {
|
|
353
|
+
height: 52px;
|
|
354
|
+
font-size: 20px;
|
|
355
|
+
padding: 0 48px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.matchid-btn-block {
|
|
359
|
+
width: 100%;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.matchid-btn-rounded {
|
|
363
|
+
border-radius: 100px;
|
|
364
|
+
}
|
|
365
|
+
.matchid-email-verify-box,.matchid-password-box{
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: column;
|
|
368
|
+
gap: 64px;
|
|
369
|
+
}
|
|
370
|
+
.matchid-email-verify-header,.matchid-password-header{
|
|
371
|
+
display: flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
gap:16px;
|
|
374
|
+
height:40px;
|
|
375
|
+
}
|
|
376
|
+
.matchid-email-verify-header-icon,.matchid-password-header-icon{
|
|
377
|
+
width:40px;
|
|
378
|
+
height:40px;
|
|
379
|
+
display: flex;
|
|
380
|
+
justify-content: center;
|
|
381
|
+
align-items: center;
|
|
382
|
+
border-radius: 8px;
|
|
383
|
+
border:1px solid var(--matchid-black);
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
}
|
|
387
|
+
.matchid-email-verify-header-content{
|
|
388
|
+
flex:1;
|
|
389
|
+
display: flex;
|
|
390
|
+
height: 100%;
|
|
391
|
+
flex-direction: column;
|
|
392
|
+
justify-content: space-between;
|
|
393
|
+
}
|
|
394
|
+
.matchid-password-header-content{
|
|
395
|
+
font-size: 16px;
|
|
396
|
+
font-weight: 500;
|
|
397
|
+
color: var(--matchid-password-header-color);
|
|
398
|
+
}
|
|
399
|
+
.matchid-email-verify-header-value{
|
|
400
|
+
color: var(--matchid-email-verify-header-value-color);
|
|
401
|
+
font-size: 24px;
|
|
402
|
+
font-weight: 600;
|
|
403
|
+
line-height: 100%;
|
|
404
|
+
}
|
|
405
|
+
.matchid-email-verify-header-tips{
|
|
406
|
+
color: var(--matchid-email-verify-header-value-tips);
|
|
407
|
+
font-size: 14px;
|
|
408
|
+
line-height: 120%; /* 16.8px */
|
|
409
|
+
}
|
|
410
|
+
.matchid-unlogin-btn,.matchid-login-btn{
|
|
411
|
+
gap:8px
|
|
412
|
+
}
|
|
413
|
+
.matchid-login-btn{
|
|
414
|
+
padding:0 12px 0 4px;
|
|
415
|
+
}
|
|
416
|
+
.matchid-login-btn:hover,.matchid-login-btn:not(:disabled):hover{
|
|
417
|
+
border-color:#ffffff;
|
|
418
|
+
}
|
|
419
|
+
.matchid-login-btn:active,
|
|
420
|
+
.matchid-login-btn:focus,
|
|
421
|
+
.matchid-login-btn:hover,
|
|
422
|
+
.matchid-login-btn:not(:disabled):hover,
|
|
423
|
+
.matchid-login-btn:not(:disabled):focus,
|
|
424
|
+
.matchid-login-btn:not(:disabled):active
|
|
425
|
+
{
|
|
426
|
+
color:#000000;
|
|
427
|
+
box-shadow: var(--matchid-shadow-small);
|
|
428
|
+
fill: var(--matchid-highlight-orange);
|
|
429
|
+
background:#ffffff;
|
|
430
|
+
}
|
|
431
|
+
.matchid-login-btn:active,.matchid-login-btn:focus{
|
|
432
|
+
border:1px solid var(--matchid-highlight-orange);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.matchid-valid{
|
|
436
|
+
margin-top:24px;
|
|
437
|
+
display: flex;
|
|
438
|
+
flex-direction: column;
|
|
439
|
+
gap:16px;
|
|
440
|
+
}
|
|
441
|
+
.matchid-valid-status-item{
|
|
442
|
+
display: flex;
|
|
443
|
+
font-size: 14px;
|
|
444
|
+
gap:8px;
|
|
445
|
+
align-items:flex-start;
|
|
446
|
+
}
|
|
447
|
+
.matchid-valid-status-item span{
|
|
448
|
+
flex:1;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
.matchid-valid-status-success{
|
|
452
|
+
color: var(--matchid-valid-success-color);
|
|
453
|
+
}
|
|
454
|
+
.matchid-valid-status-error{
|
|
455
|
+
color: var(--matchid-valid-error-color);
|
|
456
|
+
}
|
|
457
|
+
.matchid-password-content{
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
gap:24px;
|
|
461
|
+
}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import React$1, { PropsWithChildren, CSSProperties, ReactNode } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import * as viem from 'viem';
|
|
4
|
+
import { SignableMessage, Hex, TransactionSerializable } from 'viem';
|
|
5
|
+
|
|
6
|
+
type LoginMethodType = 'wallet' | 'email' | 'google' | 'X' | 'telegram'
|
|
7
|
+
type IEnvName = 'main' | 'dev' | 'test'
|
|
8
|
+
type IMatchEvents = {
|
|
9
|
+
onLogin?: (data: {
|
|
10
|
+
mid?: string;
|
|
11
|
+
token: string;
|
|
12
|
+
did: string
|
|
13
|
+
}) => void
|
|
14
|
+
onLogout?: () => void,
|
|
15
|
+
onBind?: (data: {
|
|
16
|
+
type: string
|
|
17
|
+
}) => void
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
type OverviewInfo = {
|
|
21
|
+
score: number,
|
|
22
|
+
total_assets: number,
|
|
23
|
+
wallets: number,
|
|
24
|
+
followers: number,
|
|
25
|
+
sbt: number,
|
|
26
|
+
is_kyc: boolean,
|
|
27
|
+
is_poh: boolean,
|
|
28
|
+
mid: string
|
|
29
|
+
user_identity: string
|
|
30
|
+
identities: { [key: string]: string }
|
|
31
|
+
did: string
|
|
32
|
+
address: string
|
|
33
|
+
username?:string
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ModalProps = PropsWithChildren & {
|
|
37
|
+
isOpen: boolean,
|
|
38
|
+
width?: number
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type ModalWithHeaderProps = ModalProps & {
|
|
42
|
+
onBack?: () => void,
|
|
43
|
+
onClose?: () => void,
|
|
44
|
+
title?: string
|
|
45
|
+
showClose?: boolean
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type InputProps = {
|
|
49
|
+
placeholder: string,
|
|
50
|
+
value: string,
|
|
51
|
+
onChange: (e?: any) => void,
|
|
52
|
+
disabled?: boolean,
|
|
53
|
+
readonly?: boolean
|
|
54
|
+
type?: string
|
|
55
|
+
maxLength?: number
|
|
56
|
+
after?: React.ReactNode
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type LoginBoxProps = {
|
|
60
|
+
methods?: LoginMethodType[],
|
|
61
|
+
inModal?: boolean
|
|
62
|
+
}
|
|
63
|
+
type LoginPanelProps = {
|
|
64
|
+
header?: React.ReactNode
|
|
65
|
+
onClose?: () => void
|
|
66
|
+
} & LoginBoxProps
|
|
67
|
+
type LoginModalProps = LoginPanelProps & ModalProps
|
|
68
|
+
type EmailModalProps = ModalProps & {
|
|
69
|
+
onClose?: () => void,
|
|
70
|
+
onBack?: () => void,
|
|
71
|
+
onLogin?: () => void
|
|
72
|
+
}
|
|
73
|
+
type ButtonProps = {
|
|
74
|
+
size?: 'sm' | 'df' | 'lg',
|
|
75
|
+
type?: "button" | "submit" | "reset",
|
|
76
|
+
rounded?: boolean,
|
|
77
|
+
block?: boolean,
|
|
78
|
+
disabled?: boolean,
|
|
79
|
+
loading?: boolean,
|
|
80
|
+
children?: React.ReactNode,
|
|
81
|
+
onClick?: () => void,
|
|
82
|
+
highlight?: boolean,
|
|
83
|
+
style?: CSSProperties
|
|
84
|
+
className?: string
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
type MatchContextType = {
|
|
88
|
+
env: IEnvName;
|
|
89
|
+
appid: string;
|
|
90
|
+
endpoints: {
|
|
91
|
+
login: string;
|
|
92
|
+
back: string;
|
|
93
|
+
};
|
|
94
|
+
events?: IMatchEvents;
|
|
95
|
+
login: (data: {
|
|
96
|
+
mid: string;
|
|
97
|
+
token: string;
|
|
98
|
+
}) => Promise<void>;
|
|
99
|
+
theme: "light" | "dark";
|
|
100
|
+
};
|
|
101
|
+
declare const MatchProvider: React$1.FC<{
|
|
102
|
+
children: ReactNode;
|
|
103
|
+
appid: string;
|
|
104
|
+
env?: IEnvName;
|
|
105
|
+
events?: IMatchEvents;
|
|
106
|
+
theme?: "light" | "dark";
|
|
107
|
+
}>;
|
|
108
|
+
declare const useMatch: () => MatchContextType;
|
|
109
|
+
|
|
110
|
+
declare function EmailModal({ isOpen, width, onClose, onBack, onLogin }: EmailModalProps): react_jsx_runtime.JSX.Element;
|
|
111
|
+
|
|
112
|
+
declare function Field({ label, children, error }: {
|
|
113
|
+
label: ReactNode;
|
|
114
|
+
error?: ReactNode;
|
|
115
|
+
} & PropsWithChildren): react_jsx_runtime.JSX.Element;
|
|
116
|
+
|
|
117
|
+
declare function Input({ onChange, type, after, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
118
|
+
|
|
119
|
+
declare function Button({ size, disabled, loading, children, onClick, highlight, block, type, rounded, className, style }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
120
|
+
|
|
121
|
+
declare function LoginBox({ methods, inModal }: LoginBoxProps): react_jsx_runtime.JSX.Element;
|
|
122
|
+
|
|
123
|
+
declare function Modal({ children, isOpen, width }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
124
|
+
declare function ModalWithHeader({ children, onBack, onClose, title, showClose, ...props }: ModalWithHeaderProps): react_jsx_runtime.JSX.Element;
|
|
125
|
+
|
|
126
|
+
declare function LoginButton({ loginRender, methods, onLoginClick, ...props }: Omit<ButtonProps, 'onClick' | 'highlight'> & {
|
|
127
|
+
loginRender?: () => JSX.Element;
|
|
128
|
+
methods?: LoginMethodType[];
|
|
129
|
+
onLoginClick?: () => void;
|
|
130
|
+
}): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
declare function LoginPanel({ header, onClose, ...props }: LoginPanelProps): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
declare function LoginModal({ isOpen, width, ...props }: LoginModalProps): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
136
|
+
declare function UsernameModal({ title, isOpen, onSuccess, ...props }: ModalWithHeaderProps & {
|
|
137
|
+
onSuccess?: () => void;
|
|
138
|
+
}): react_jsx_runtime.JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare function PasswordModal({ title, isOpen, onSuccess, ...props }: ModalWithHeaderProps & {
|
|
141
|
+
onSuccess?: () => void;
|
|
142
|
+
}): react_jsx_runtime.JSX.Element;
|
|
143
|
+
|
|
144
|
+
declare const index$1_Button: typeof Button;
|
|
145
|
+
declare const index$1_EmailModal: typeof EmailModal;
|
|
146
|
+
declare const index$1_Field: typeof Field;
|
|
147
|
+
declare const index$1_Input: typeof Input;
|
|
148
|
+
declare const index$1_LoginBox: typeof LoginBox;
|
|
149
|
+
declare const index$1_LoginButton: typeof LoginButton;
|
|
150
|
+
declare const index$1_LoginModal: typeof LoginModal;
|
|
151
|
+
declare const index$1_LoginPanel: typeof LoginPanel;
|
|
152
|
+
declare const index$1_Modal: typeof Modal;
|
|
153
|
+
declare const index$1_ModalWithHeader: typeof ModalWithHeader;
|
|
154
|
+
declare const index$1_PasswordModal: typeof PasswordModal;
|
|
155
|
+
declare const index$1_UsernameModal: typeof UsernameModal;
|
|
156
|
+
declare namespace index$1 {
|
|
157
|
+
export { index$1_Button as Button, index$1_EmailModal as EmailModal, index$1_Field as Field, index$1_Input as Input, index$1_LoginBox as LoginBox, index$1_LoginButton as LoginButton, index$1_LoginModal as LoginModal, index$1_LoginPanel as LoginPanel, index$1_Modal as Modal, index$1_ModalWithHeader as ModalWithHeader, index$1_PasswordModal as PasswordModal, index$1_UsernameModal as UsernameModal };
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
declare function useUserInfo(): {
|
|
161
|
+
loginByTelegram: () => void;
|
|
162
|
+
loginByTwitter: () => void;
|
|
163
|
+
loginByGoogle: () => void;
|
|
164
|
+
loginByWallet: () => void;
|
|
165
|
+
loginByEmail: ({ email, code }: {
|
|
166
|
+
email: string;
|
|
167
|
+
code: string;
|
|
168
|
+
}) => Promise<boolean>;
|
|
169
|
+
token: string;
|
|
170
|
+
mid: string;
|
|
171
|
+
did: string;
|
|
172
|
+
address: string;
|
|
173
|
+
isLogin: boolean;
|
|
174
|
+
logout: () => Promise<void>;
|
|
175
|
+
getLoginEmailCode: (email: string) => Promise<string>;
|
|
176
|
+
refreshOverview: () => Promise<void>;
|
|
177
|
+
overview: OverviewInfo | null;
|
|
178
|
+
bindWallet: () => Promise<void>;
|
|
179
|
+
bindTelegram: () => Promise<void>;
|
|
180
|
+
username: string;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
declare function useMatchEvents(handlers: IMatchEvents): void;
|
|
184
|
+
|
|
185
|
+
type ChainType = "ethereum" | "solana";
|
|
186
|
+
type RecoveryType = "base_generated_recovery_key" | "user_passcode_recovery_key"
|
|
187
|
+
|
|
188
|
+
interface UseWalletReturnType {
|
|
189
|
+
initWallet: (params: {
|
|
190
|
+
address: string;
|
|
191
|
+
did: string;
|
|
192
|
+
}) => Promise<void>;
|
|
193
|
+
generateWallet: (params: {
|
|
194
|
+
did: string;
|
|
195
|
+
userPasscode: string;
|
|
196
|
+
}) => Promise<string>;
|
|
197
|
+
isRecovered: () => Promise<boolean>;
|
|
198
|
+
recoveryWallet: (chainType: ChainType | undefined, recoveryType: RecoveryType, userPasscode?: string) => Promise<void>;
|
|
199
|
+
signMessage: (message: SignableMessage, type?: ChainType) => Promise<Hex>;
|
|
200
|
+
signTransaction: (transaction: TransactionSerializable, type?: ChainType) => Promise<`0x02${string}` | `0x01${string}` | `0x03${string}` | `0x04${string}` | viem.TransactionSerializedLegacy>;
|
|
201
|
+
}
|
|
202
|
+
declare function useWallet(): UseWalletReturnType;
|
|
203
|
+
|
|
204
|
+
declare const index_useMatchEvents: typeof useMatchEvents;
|
|
205
|
+
declare const index_useUserInfo: typeof useUserInfo;
|
|
206
|
+
declare const index_useWallet: typeof useWallet;
|
|
207
|
+
declare namespace index {
|
|
208
|
+
export { index_useMatchEvents as useMatchEvents, index_useUserInfo as useUserInfo, index_useWallet as useWallet };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export { index$1 as Components, index as Hooks, MatchProvider, useMatch };
|