@gluwa/connect-kit 0.1.0-next.3 → 0.2.0-next.3

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/assets/creditwallet.png +0 -0
  3. package/assets/fonts/Inter-Medium.ttf +0 -0
  4. package/assets/fonts/Inter-Medium.woff2 +0 -0
  5. package/assets/fonts/Inter-Regular.ttf +0 -0
  6. package/assets/fonts/Inter-Regular.woff2 +0 -0
  7. package/assets/fonts/Inter-SemiBold.ttf +0 -0
  8. package/assets/fonts/Inter-SemiBold.woff2 +0 -0
  9. package/assets/graphic.png +0 -0
  10. package/assets/metamask.png +0 -0
  11. package/assets/wc-logo.svg +3 -0
  12. package/assets/wc-search.png +0 -0
  13. package/dist/chunk-EDNRW47A.js +401 -0
  14. package/dist/credit-connect.js +2 -394
  15. package/dist/index.css +2074 -0
  16. package/dist/index.d.ts +53 -33
  17. package/dist/index.js +1404 -1504
  18. package/dist/package.json +16 -10
  19. package/package.json +14 -11
  20. package/src/ConnectKitProvider.tsx +126 -75
  21. package/src/api/account.ts +21 -0
  22. package/src/api/balance.ts +10 -0
  23. package/src/api/chain.ts +17 -0
  24. package/src/api/contract.ts +33 -0
  25. package/src/api/transaction.ts +12 -0
  26. package/src/assets.d.ts +5 -0
  27. package/src/components/actionItem/index.tsx +50 -0
  28. package/src/components/actionItem/style.scss +47 -0
  29. package/src/components/copyLink/index.tsx +16 -0
  30. package/src/components/copyLink/style.scss +16 -0
  31. package/src/components/qrArea/index.tsx +70 -0
  32. package/src/components/qrArea/style.scss +130 -0
  33. package/src/components/searchBar/asset/Search.tsx +20 -0
  34. package/src/components/searchBar/asset/XMarkCircle.tsx +24 -0
  35. package/src/components/searchBar/index.tsx +44 -0
  36. package/src/components/searchBar/style.scss +58 -0
  37. package/src/components/snackbar/index.tsx +25 -0
  38. package/src/components/snackbar/style.scss +51 -0
  39. package/src/components/toggle/index.tsx +27 -0
  40. package/src/components/toggle/style.scss +53 -0
  41. package/src/components/walletGrid/index.tsx +64 -0
  42. package/src/components/walletGrid/style.scss +108 -0
  43. package/src/components/walletItem/index.tsx +49 -0
  44. package/src/components/walletItem/style.scss +70 -0
  45. package/src/connector-meta.ts +12 -7
  46. package/src/core/config.ts +102 -0
  47. package/src/creditConnectConnector.ts +192 -184
  48. package/src/events/account.ts +49 -0
  49. package/src/hooks/useWCState.ts +45 -13
  50. package/src/hooks/useWagmiConnect.ts +13 -9
  51. package/src/index.ts +35 -2
  52. package/src/layout/allWallets/index.tsx +52 -0
  53. package/src/layout/allWallets/style.scss +62 -0
  54. package/src/layout/connectDialog/asset/backIcon.tsx +24 -0
  55. package/src/layout/connectDialog/asset/checkIcon.tsx +28 -0
  56. package/src/layout/connectDialog/asset/closeIcon.tsx +21 -0
  57. package/src/layout/connectDialog/asset/copyIcon.tsx +28 -0
  58. package/src/layout/connectDialog/asset/linkIcon.tsx +24 -0
  59. package/src/layout/connectDialog/asset/spinner.tsx +21 -0
  60. package/src/layout/connectDialog/idle/index.tsx +32 -0
  61. package/src/layout/connectDialog/idle/style.scss +61 -0
  62. package/src/layout/connectDialog/index.tsx +286 -0
  63. package/src/layout/connectDialog/loading/index.tsx +13 -0
  64. package/src/layout/connectDialog/loading/style.scss +19 -0
  65. package/src/layout/connectDialog/metaMask/index.tsx +61 -0
  66. package/src/layout/connectDialog/metaMask/style.scss +65 -0
  67. package/src/layout/connectDialog/qr/index.tsx +33 -0
  68. package/src/layout/connectDialog/style.scss +95 -0
  69. package/src/layout/connectDialog/timeout/index.tsx +31 -0
  70. package/src/layout/connectDialog/timeout/style.scss +64 -0
  71. package/src/layout/connectDialog/walletConnect/index.tsx +45 -0
  72. package/src/layout/connectDialog/walletConnect/style.scss +48 -0
  73. package/src/layout/connectDialog/walletQR/index.tsx +37 -0
  74. package/src/layout/detailPanel/index.tsx +147 -0
  75. package/src/layout/detailPanel/style.scss +64 -0
  76. package/src/layout/selectorPanel/index.tsx +100 -0
  77. package/src/layout/selectorPanel/style.scss +113 -0
  78. package/src/style/color.scss +417 -0
  79. package/src/style/font.scss +28 -0
  80. package/src/style/index.scss +5 -0
  81. package/src/style/mixin.scss +217 -0
  82. package/src/style/reset.scss +110 -0
  83. package/src/style/variables.scss +13 -0
  84. package/src/types.ts +19 -7
  85. package/src/utils/platform.ts +7 -4
  86. package/tsup.config.ts +32 -2
  87. package/dist/chunk-DDA6FP6U.js +0 -7
  88. package/src/ConnectModal.scss +0 -665
  89. package/src/ConnectModal.tsx +0 -559
  90. package/src/components/QRFrame.tsx +0 -43
  91. package/src/views/CreditWalletView.tsx +0 -59
  92. package/src/views/IdleView.tsx +0 -10
  93. package/src/views/MetaMaskView.tsx +0 -64
  94. package/src/views/SwitchChainView.tsx +0 -67
  95. package/src/views/WalletConnectView.tsx +0 -206
@@ -1,665 +0,0 @@
1
- .ck-root {
2
- position: fixed;
3
- inset: 0;
4
- z-index: 9999;
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
- }
9
-
10
- .ck-overlay {
11
- position: absolute;
12
- inset: 0;
13
- background: rgba(0, 0, 0, 0.6);
14
- }
15
-
16
- .ck-modal {
17
- position: relative;
18
- display: flex;
19
- width: 1120px;
20
- height: 620px;
21
- border-radius: 16px;
22
- overflow: hidden;
23
- background: #1a1a1a;
24
- color: #fff;
25
- }
26
-
27
- // ── Pane (shared) ────────────────────────────────────────
28
-
29
- .ck-pane {
30
- display: flex;
31
- flex-direction: column;
32
- padding: 24px;
33
- width: 560px;
34
- flex-shrink: 0;
35
- box-sizing: border-box;
36
-
37
- &--selector {
38
- border-right: 1px solid rgba(255, 255, 255, 0.08);
39
- }
40
-
41
- &--detail {
42
- padding-inline: 20px; // 560 - 20*2 = 520px 콘텐츠 영역
43
- overflow: hidden;
44
- min-height: 0;
45
- }
46
- }
47
-
48
- .ck-pane__header {
49
- display: flex;
50
- align-items: center;
51
- gap: 8px;
52
- margin-bottom: 20px;
53
- }
54
-
55
- .ck-pane__title {
56
- flex: 1;
57
- font-size: 16px;
58
- font-weight: 600;
59
- margin: 0;
60
- }
61
-
62
- .ck-pane__body {
63
- flex: 1;
64
- display: flex;
65
- flex-direction: column;
66
- min-height: 0;
67
- overflow: hidden;
68
- }
69
-
70
- .ck-pane__footer {
71
- margin-top: auto;
72
- padding-top: 16px;
73
- text-align: center;
74
- }
75
-
76
- // ── Buttons ──────────────────────────────────────────────
77
-
78
- .ck-btn-close,
79
- .ck-btn-back {
80
- position: relative;
81
- width: 28px;
82
- height: 28px;
83
- background: none;
84
- border: none;
85
- cursor: pointer;
86
- padding: 0;
87
- border-radius: 50%;
88
- flex-shrink: 0;
89
- display: flex;
90
- align-items: center;
91
- justify-content: center;
92
-
93
- &:hover {
94
- background: rgba(255, 255, 255, 0.08);
95
- }
96
- }
97
-
98
- .ck-btn-close {
99
- &::before,
100
- &::after {
101
- content: '';
102
- position: absolute;
103
- width: 14px;
104
- height: 2px;
105
- background: rgba(255, 255, 255, 0.7);
106
- border-radius: 1px;
107
- }
108
- &::before { transform: rotate(45deg); }
109
- &::after { transform: rotate(-45deg); }
110
- }
111
-
112
- .ck-btn-back {
113
- &::before {
114
- content: '';
115
- position: absolute;
116
- width: 8px;
117
- height: 8px;
118
- border-left: 2px solid rgba(255, 255, 255, 0.7);
119
- border-bottom: 2px solid rgba(255, 255, 255, 0.7);
120
- transform: rotate(45deg) translate(1px, -1px);
121
- border-radius: 1px;
122
- }
123
- }
124
-
125
- .ck-btn-primary {
126
- display: inline-flex;
127
- align-items: center;
128
- justify-content: center;
129
- padding: 8px 16px;
130
- border-radius: 8px;
131
- font-size: 14px;
132
- font-weight: 600;
133
- text-decoration: none;
134
- cursor: pointer;
135
- white-space: nowrap;
136
- color: #fff;
137
- background: rgba(255, 255, 255, 0.15);
138
- border: none;
139
-
140
- &:hover {
141
- background: rgba(255, 255, 255, 0.22);
142
- }
143
-
144
- &:disabled {
145
- opacity: 0.6;
146
- cursor: not-allowed;
147
- }
148
- }
149
-
150
- .ck-btn-secondary {
151
- display: inline-flex;
152
- align-items: center;
153
- justify-content: center;
154
- padding: 8px 16px;
155
- border-radius: 8px;
156
- font-size: 14px;
157
- font-weight: 500;
158
- cursor: pointer;
159
- white-space: nowrap;
160
- color: rgba(255, 255, 255, 0.75);
161
- background: transparent;
162
- border: 1px solid rgba(255, 255, 255, 0.18);
163
-
164
- &:hover {
165
- color: #fff;
166
- border-color: rgba(255, 255, 255, 0.32);
167
- }
168
- }
169
-
170
- .ck-view__actions {
171
- display: flex;
172
- flex-direction: column;
173
- gap: 8px;
174
- width: 100%;
175
- margin-top: 16px;
176
- }
177
-
178
- .ck-view__caption--error {
179
- color: #ff8080;
180
- margin-top: 8px;
181
- }
182
-
183
- // ── Connector list ────────────────────────────────────────
184
-
185
- .ck-connector-list {
186
- display: flex;
187
- flex-direction: column;
188
- gap: 8px;
189
- }
190
-
191
- .ck-connector-item {
192
- display: flex;
193
- align-items: center;
194
- gap: 12px;
195
- width: 100%;
196
- padding: 12px 16px;
197
- border: none;
198
- border-radius: 12px;
199
- cursor: pointer;
200
- text-align: left;
201
- color: #fff;
202
- background: rgba(255, 255, 255, 0.05);
203
- transition: background 0.15s;
204
-
205
- &:hover:not(:disabled) {
206
- background: rgba(255, 255, 255, 0.08);
207
- }
208
-
209
- &.is-active {
210
- background: #3b82f6;
211
- }
212
-
213
- &:disabled {
214
- opacity: 0.5;
215
- cursor: not-allowed;
216
- }
217
- }
218
-
219
- .ck-connector-item__icon {
220
- width: 32px;
221
- height: 32px;
222
- border-radius: 8px;
223
- flex-shrink: 0;
224
- background: rgba(255, 255, 255, 0.1);
225
- display: block;
226
- object-fit: cover;
227
-
228
- // img 태그일 때는 배경 불필요
229
- &[src] {
230
- background: none;
231
- }
232
- }
233
-
234
- .ck-connector-item__label {
235
- flex: 1;
236
- font-size: 14px;
237
- font-weight: 500;
238
- }
239
-
240
- .ck-connector-item__badge {
241
- font-size: 11px;
242
- font-weight: 600;
243
- padding: 2px 6px;
244
- border-radius: 4px;
245
- background: rgba(255, 255, 255, 0.15);
246
- color: rgba(255, 255, 255, 0.8);
247
- }
248
-
249
- .ck-divider {
250
- display: flex;
251
- align-items: center;
252
- gap: 8px;
253
- color: rgba(255, 255, 255, 0.3);
254
- font-size: 12px;
255
- margin: 4px 0;
256
-
257
- &::before,
258
- &::after {
259
- content: '';
260
- flex: 1;
261
- height: 1px;
262
- background: rgba(255, 255, 255, 0.1);
263
- }
264
- }
265
-
266
- .ck-link-no-wallet {
267
- font-size: 13px;
268
- text-decoration: none;
269
- color: rgba(255, 255, 255, 0.5);
270
- }
271
-
272
- // ── Views ────────────────────────────────────────────────
273
-
274
- .ck-view {
275
- display: flex;
276
- flex-direction: column;
277
- align-items: center;
278
- flex: 1;
279
-
280
- &--idle {
281
- justify-content: center;
282
- text-align: center;
283
- gap: 12px;
284
- }
285
-
286
- &--qr {
287
- gap: 16px;
288
- }
289
-
290
- &--extension {
291
- justify-content: center;
292
- align-items: center;
293
- gap: 12px;
294
- text-align: center;
295
- }
296
-
297
- &--wallet-list {
298
- align-items: stretch;
299
- gap: 12px;
300
- height: 100%;
301
- overflow: hidden;
302
- width: 100%;
303
- box-sizing: border-box;
304
- }
305
- }
306
-
307
- .ck-view__illustration {
308
- width: 180px;
309
- height: auto;
310
- display: block;
311
- }
312
-
313
- .ck-view__wallet-icon {
314
- width: 64px;
315
- height: 64px;
316
- border-radius: 16px;
317
- background: rgba(255, 255, 255, 0.1);
318
-
319
- &--metamask {
320
- // TODO: MetaMask icon
321
- }
322
- }
323
-
324
- .ck-view__title {
325
- font-size: 18px;
326
- font-weight: 600;
327
- margin: 0;
328
- }
329
-
330
- .ck-view__description,
331
- .ck-view__caption {
332
- font-size: 13px;
333
- opacity: 0.6;
334
- margin: 0;
335
- text-align: center;
336
- }
337
-
338
- // ── QR ───────────────────────────────────────────────────
339
-
340
- .ck-qr-frame {
341
- width: 216px;
342
- height: 216px;
343
- border-radius: 16px;
344
- display: flex;
345
- align-items: center;
346
- justify-content: center;
347
- background: #fff;
348
- overflow: hidden;
349
- flex-shrink: 0;
350
-
351
- &--loading {
352
- background: rgba(255, 255, 255, 0.05);
353
- }
354
- }
355
-
356
- .ck-qr-spinner,
357
- .ck-spinner {
358
- width: 32px;
359
- height: 32px;
360
- border: 3px solid rgba(255, 255, 255, 0.15);
361
- border-top-color: rgba(255, 255, 255, 0.6);
362
- border-radius: 50%;
363
- animation: ck-spin 0.8s linear infinite;
364
- }
365
-
366
- @keyframes ck-spin {
367
- to { transform: rotate(360deg); }
368
- }
369
-
370
- .ck-copy-link {
371
- background: none;
372
- border: none;
373
- cursor: pointer;
374
- font-size: 13px;
375
- color: #fff;
376
- opacity: 0.5;
377
- display: flex;
378
- align-items: center;
379
- gap: 4px;
380
- }
381
-
382
- // ── Download card ────────────────────────────────────────
383
-
384
- .ck-download-card {
385
- display: flex;
386
- align-items: center;
387
- justify-content: space-between;
388
- width: 100%;
389
- padding: 14px 16px;
390
- border-radius: 12px;
391
- background: rgba(255, 255, 255, 0.05);
392
- margin-top: auto;
393
- gap: 12px;
394
- }
395
-
396
- .ck-download-card__text {
397
- display: flex;
398
- flex-direction: column;
399
- gap: 2px;
400
- }
401
-
402
- .ck-download-card__title {
403
- font-size: 14px;
404
- font-weight: 500;
405
- margin: 0;
406
- }
407
-
408
- .ck-download-card__sub {
409
- font-size: 12px;
410
- opacity: 0.5;
411
- margin: 0;
412
- }
413
-
414
- // ── WalletConnect list ────────────────────────────────────
415
-
416
- .ck-all-wallets-btn {
417
- display: flex;
418
- align-items: center;
419
- gap: 12px;
420
- width: 100%;
421
- padding: 14px 16px;
422
- border: none;
423
- border-radius: 12px;
424
- background: rgba(255, 255, 255, 0.05);
425
- color: #fff;
426
- cursor: pointer;
427
- margin-top: auto;
428
- }
429
-
430
- .ck-all-wallets-btn__icon {
431
- width: 32px;
432
- height: 32px;
433
- border-radius: 8px;
434
- background: rgba(255, 255, 255, 0.1);
435
- }
436
-
437
- .ck-all-wallets-btn__label {
438
- flex: 1;
439
- font-size: 14px;
440
- font-weight: 500;
441
- text-align: left;
442
- }
443
-
444
- .ck-all-wallets-btn__count {
445
- font-size: 12px;
446
- opacity: 0.5;
447
- }
448
-
449
- .ck-wallet-search {
450
- display: flex;
451
- align-items: center;
452
- gap: 8px;
453
- }
454
-
455
- .ck-wallet-search__input {
456
- flex: 1;
457
- padding: 10px 14px;
458
- border-radius: 10px;
459
- border: 1px solid rgba(255, 255, 255, 0.1);
460
- background: rgba(255, 255, 255, 0.05);
461
- font-size: 14px;
462
- outline: none;
463
- color: #fff;
464
-
465
- &::placeholder {
466
- color: rgba(255, 255, 255, 0.35);
467
- }
468
- }
469
-
470
- .ck-wc-filter {
471
- display: flex;
472
- align-items: center;
473
- gap: 6px;
474
- flex-shrink: 0;
475
- border: none;
476
- background: none;
477
- cursor: pointer;
478
- padding: 0;
479
- }
480
-
481
- .ck-wc-filter__icon {
482
- width: 20px;
483
- height: 20px;
484
- border-radius: 4px;
485
- display: block;
486
- opacity: 0.5;
487
-
488
- .ck-wc-filter.is-active & {
489
- opacity: 1;
490
- }
491
- }
492
-
493
- // toggle track
494
- .ck-wc-filter__track {
495
- position: relative;
496
- width: 36px;
497
- height: 20px;
498
- border-radius: 10px;
499
- background: rgba(255, 255, 255, 0.15);
500
- transition: background 0.2s;
501
-
502
- .ck-wc-filter.is-active & {
503
- background: #3b82f6;
504
- }
505
- }
506
-
507
- // toggle thumb
508
- .ck-wc-filter__thumb {
509
- position: absolute;
510
- top: 2px;
511
- left: 2px;
512
- width: 16px;
513
- height: 16px;
514
- border-radius: 50%;
515
- background: #fff;
516
- transition: transform 0.2s;
517
-
518
- .ck-wc-filter.is-active & {
519
- transform: translateX(16px);
520
- }
521
- }
522
-
523
- // 스크롤 wrapper — 세로 스크롤만 담당
524
- .ck-wallet-grid-scroll {
525
- flex: 1;
526
- min-height: 0;
527
- width: 100%;
528
- overflow-x: hidden;
529
- overflow-y: auto;
530
- }
531
-
532
- .ck-wallet-grid {
533
- display: grid;
534
- grid-template-columns: repeat(4, minmax(0, 1fr));
535
- grid-auto-rows: max-content;
536
- gap: 8px;
537
- list-style: none;
538
- margin: 0;
539
- padding: 0;
540
- width: 100%; // scroll wrapper 폭 그대로 채움
541
- box-sizing: border-box;
542
- }
543
-
544
- .ck-wallet-grid__item {
545
- display: flex;
546
- flex-direction: column;
547
- align-items: center;
548
- gap: 6px;
549
- padding: 10px 4px;
550
- width: 100%;
551
- background: none;
552
- border: none;
553
- border-radius: 10px;
554
- cursor: pointer;
555
- color: #fff;
556
- box-sizing: border-box;
557
-
558
- &:hover {
559
- background: rgba(255, 255, 255, 0.05);
560
- }
561
- }
562
-
563
- .ck-wallet-grid__icon {
564
- width: 48px;
565
- height: 48px;
566
- border-radius: 12px;
567
- flex-shrink: 0;
568
- }
569
-
570
- .ck-wallet-grid__icon-placeholder {
571
- width: 48px;
572
- height: 48px;
573
- border-radius: 12px;
574
- flex-shrink: 0;
575
- background: rgba(255, 255, 255, 0.1);
576
- }
577
-
578
- .ck-wallet-grid__name {
579
- display: flex;
580
- align-items: center;
581
- justify-content: center;
582
- gap: 3px;
583
- width: 100%;
584
- min-width: 0;
585
- }
586
-
587
- .ck-wallet-grid__name-text {
588
- flex: 1;
589
- min-width: 0;
590
- font-size: 11px;
591
- overflow: hidden;
592
- text-overflow: ellipsis;
593
- white-space: nowrap;
594
- }
595
-
596
- .ck-wallet-grid__wc-badge {
597
- width: 10px;
598
- height: 10px;
599
- border-radius: 2px;
600
- flex-shrink: 0;
601
- opacity: 0.7;
602
- }
603
-
604
- .ck-wallet-list-loading,
605
- .ck-wallet-list-empty {
606
- display: flex;
607
- align-items: center;
608
- justify-content: center;
609
- padding: 32px;
610
- opacity: 0.4;
611
- }
612
-
613
- // ── Mobile ────────────────────────────────────────────────
614
-
615
- .ck-mobile-only {
616
- display: none;
617
- }
618
-
619
- @media (max-width: 1120px) {
620
- // 오버레이 아래쪽 정렬
621
- .ck-root {
622
- align-items: flex-end;
623
- }
624
-
625
- // 바텀시트 — 슬라이드업 애니메이션
626
- .ck-modal {
627
- flex-direction: column;
628
- width: 100%;
629
- height: auto;
630
- max-height: 90dvh;
631
- border-radius: 20px 20px 0 0;
632
- animation: ck-slide-up 0.28s cubic-bezier(0.32, 0.72, 0, 1);
633
- overflow-y: auto;
634
- }
635
-
636
- @keyframes ck-slide-up {
637
- from { transform: translateY(100%); }
638
- to { transform: translateY(0); }
639
- }
640
-
641
- // selector만 보일 때: detail 숨김
642
- .ck-modal:not(.ck-modal--has-detail) .ck-pane--detail {
643
- display: none;
644
- }
645
-
646
- // detail 보일 때: selector 숨김
647
- .ck-modal.ck-modal--has-detail .ck-pane--selector {
648
- display: none;
649
- }
650
-
651
- .ck-pane--selector,
652
- .ck-pane--detail {
653
- width: 100%;
654
- border-right: none;
655
- }
656
-
657
- // detail pane 최소 높이 — QR 코드 등 표시 공간 확보
658
- .ck-pane--detail {
659
- min-height: 420px;
660
- }
661
-
662
- .ck-mobile-only {
663
- display: block;
664
- }
665
- }