@taskon/widget-react 0.0.1-beta.6 → 0.0.1-beta.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.
Files changed (32) hide show
  1. package/README.md +48 -43
  2. package/dist/EligibilityInfo.css +2 -33
  3. package/dist/TaskOnProvider.css +287 -0
  4. package/dist/ThemeProvider.css +227 -0
  5. package/dist/UserCenterWidget2.css +32 -290
  6. package/dist/WidgetShell.css +0 -227
  7. package/dist/chunks/{CommunityTaskList-Hde2OKHH.js → CommunityTaskList-D0uVD8wD.js} +37 -58
  8. package/dist/chunks/{EligibilityInfo-BV0Z2TgY.js → EligibilityInfo-Cf6hx9-a.js} +17 -209
  9. package/dist/chunks/{LeaderboardWidget-BNGRD5Bu.js → LeaderboardWidget-DyoiiNS6.js} +10 -9
  10. package/dist/chunks/{PageBuilder-C5DSHiW9.js → PageBuilder-DoAFPm6-.js} +5 -5
  11. package/dist/chunks/{Quest-DG9zfXJo.js → Quest-ySZlYd4u.js} +6 -11
  12. package/dist/chunks/TaskOnProvider-CxtFIs3n.js +2072 -0
  13. package/dist/chunks/{WidgetShell-D7yC894Y.js → ThemeProvider-CulHkqqY.js} +1354 -617
  14. package/dist/chunks/UserCenterWidget-BJsc_GSZ.js +3246 -0
  15. package/dist/chunks/{UserCenterWidget-D5ttw4hO.js → UserCenterWidget-STq8kpV4.js} +162 -365
  16. package/dist/chunks/WidgetShell-8xn-Jivw.js +659 -0
  17. package/dist/chunks/useIsMobile-D6Ybur-6.js +30 -0
  18. package/dist/chunks/useToast-BGJhd3BX.js +93 -0
  19. package/dist/community-task.js +1 -1
  20. package/dist/core.d.ts +9 -15
  21. package/dist/core.js +3 -3
  22. package/dist/index.d.ts +64 -15
  23. package/dist/index.js +15 -10
  24. package/dist/leaderboard.js +1 -1
  25. package/dist/page-builder.js +1 -1
  26. package/dist/quest.js +1 -1
  27. package/dist/user-center.js +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunks/TaskOnProvider-BhamHIyY.js +0 -1260
  30. package/dist/chunks/ThemeProvider-mXLdLSkq.js +0 -1397
  31. package/dist/chunks/UserCenterWidget-jDO5zTN1.js +0 -3297
  32. package/dist/chunks/useToast-CaRkylKe.js +0 -304
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Dialog 组件样式
3
+ * 基于 Radix UI Dialog 封装
4
+ * 使用 taskon-dialog-* 命名空间
5
+ */
6
+
7
+ /*
8
+ * Responsive base styles
9
+ *
10
+ * Keep mobile breakpoints and fallback patterns centralized here.
11
+ * Components should reuse these mixins instead of duplicating query logic.
12
+ */
13
+
14
+ /*
15
+ * Desktop-up mixin:
16
+ * 1) Enable desktop enhancement in wider containers
17
+ * 2) Keep viewport media query as fallback
18
+ */
19
+
20
+ /* ==================== 遮罩层 ==================== */
21
+
22
+ .taskon-dialog-overlay {
23
+ position: fixed;
24
+ inset: 0;
25
+ z-index: 9998;
26
+ /* 遮罩层统一使用通用 mask token */
27
+ background-color: var(--taskon-color-bg-mask);
28
+ backdrop-filter: blur(24px);
29
+
30
+ /* 动画 */
31
+ animation: taskon-dialog-overlay-fade-in 150ms ease-out;
32
+ }
33
+
34
+ .taskon-dialog-overlay[data-state="closed"] {
35
+ animation: taskon-dialog-overlay-fade-out 150ms ease-in;
36
+ }
37
+
38
+ @keyframes taskon-dialog-overlay-fade-in {
39
+ from {
40
+ opacity: 0;
41
+ }
42
+ to {
43
+ opacity: 1;
44
+ }
45
+ }
46
+
47
+ @keyframes taskon-dialog-overlay-fade-out {
48
+ from {
49
+ opacity: 1;
50
+ }
51
+ to {
52
+ opacity: 0;
53
+ }
54
+ }
55
+
56
+ /* ==================== 弹窗内容 ==================== */
57
+
58
+ .taskon-dialog-content {
59
+ position: fixed;
60
+ top: 50%;
61
+ left: 50%;
62
+ transform: translate(-50%, -50%);
63
+ z-index: 9999;
64
+
65
+ /* 尺寸 */
66
+ width: 95vw;
67
+ max-width: 500px;
68
+ max-height: 90vh;
69
+
70
+ /* 弹层统一使用更深的背景 token(dark 下最接近最深层) */
71
+ background-color: var(--taskon-color-bg-canvas);
72
+ color: var(--taskon-color-text);
73
+ border-radius: var(--taskon-border-radius);
74
+ box-shadow: 0 25px 50px -12px var(--taskon-color-bg-mask);
75
+
76
+ /* 布局 */
77
+ display: flex;
78
+ flex-direction: column;
79
+ overflow: hidden;
80
+
81
+ /* 移除默认的 focus outline */
82
+ outline: none;
83
+
84
+ /* 动画 */
85
+ animation: taskon-dialog-content-fade-in 200ms ease-out;
86
+ }
87
+
88
+ .taskon-dialog-content[data-state="closed"] {
89
+ animation: taskon-dialog-content-fade-out 150ms ease-in;
90
+ }
91
+
92
+ @keyframes taskon-dialog-content-fade-in {
93
+ from {
94
+ opacity: 0;
95
+ transform: translate(-50%, -48%) scale(0.96);
96
+ }
97
+ to {
98
+ opacity: 1;
99
+ transform: translate(-50%, -50%) scale(1);
100
+ }
101
+ }
102
+
103
+ @keyframes taskon-dialog-content-fade-out {
104
+ from {
105
+ opacity: 1;
106
+ transform: translate(-50%, -50%) scale(1);
107
+ }
108
+ to {
109
+ opacity: 0;
110
+ transform: translate(-50%, -48%) scale(0.96);
111
+ }
112
+ }
113
+
114
+ /* ==================== 无障碍标题/描述(屏幕阅读器可见) ==================== */
115
+
116
+ .taskon-dialog-title--sr-only,
117
+ .taskon-dialog-description--sr-only {
118
+ position: absolute;
119
+ width: 1px;
120
+ height: 1px;
121
+ padding: 0;
122
+ margin: -1px;
123
+ overflow: hidden;
124
+ clip: rect(0, 0, 0, 0);
125
+ white-space: nowrap;
126
+ border: 0;
127
+ }
128
+
129
+ /* ==================== 头部操作区 ==================== */
130
+
131
+ .taskon-dialog-header {
132
+ position: absolute;
133
+ top: 12px;
134
+ right: 12px;
135
+ z-index: 1;
136
+
137
+ display: flex;
138
+ align-items: center;
139
+ gap: 8px;
140
+ }
141
+
142
+ .taskon-dialog-header-slot {
143
+ display: flex;
144
+ align-items: center;
145
+ }
146
+
147
+ /* ==================== 关闭按钮 ==================== */
148
+
149
+ .taskon-dialog-close {
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+
154
+ width: 32px;
155
+ height: 32px;
156
+ padding: 0;
157
+
158
+ background: var(--taskon-color-bg-surface-subtle);
159
+ border: none;
160
+ border-radius: var(--taskon-border-radius-sm);
161
+ cursor: pointer;
162
+
163
+ color: var(--taskon-color-text-secondary);
164
+ transition: all 0.2s ease;
165
+ }
166
+
167
+ .taskon-dialog-close:hover {
168
+ background-color: var(--taskon-color-bg-surface);
169
+ color: var(--taskon-color-text);
170
+ }
171
+
172
+ .taskon-dialog-close:focus-visible {
173
+ outline: 2px solid var(--taskon-color-primary);
174
+ outline-offset: 2px;
175
+ }
176
+
177
+ /* ==================== 主体内容 ==================== */
178
+
179
+ .taskon-dialog-body {
180
+ flex: 1;
181
+ overflow-y: auto;
182
+ padding: 20px;
183
+ }
184
+
185
+ .taskon-dialog-body--no-padding {
186
+ padding: 0;
187
+ }
188
+
189
+ /* ==================== Desktop 增强 ==================== */
190
+
191
+ @supports (container-type: inline-size) {
192
+ @container (min-width: 751px) {
193
+ .taskon-dialog-content {
194
+ width: 90vw;
195
+ max-height: 85vh;
196
+ border-radius: var(--taskon-border-radius-lg);
197
+ }
198
+
199
+ .taskon-dialog-body {
200
+ padding: 24px;
201
+ }
202
+
203
+ .taskon-dialog-header {
204
+ top: 16px;
205
+ right: 16px;
206
+ }
207
+ }
208
+ }
209
+
210
+ @supports not (container-type: inline-size) {
211
+ @media (min-width: 751px) {
212
+ .taskon-dialog-content {
213
+ width: 90vw;
214
+ max-height: 85vh;
215
+ border-radius: var(--taskon-border-radius-lg);
216
+ }
217
+
218
+ .taskon-dialog-body {
219
+ padding: 24px;
220
+ }
221
+
222
+ .taskon-dialog-header {
223
+ top: 16px;
224
+ right: 16px;
225
+ }
226
+ }
227
+ }
@@ -1,280 +1,3 @@
1
- /**
2
- * BindWalletDialog 组件样式
3
- * 使用 taskon-bind-wallet-* 命名空间
4
- * 与 taskon-website 保持一致
5
- */
6
-
7
- /*
8
- * Responsive base styles
9
- *
10
- * Keep mobile breakpoints and fallback patterns centralized here.
11
- * Components should reuse these mixins instead of duplicating query logic.
12
- */
13
-
14
- /*
15
- * Desktop-up mixin:
16
- * 1) Enable desktop enhancement in wider containers
17
- * 2) Keep viewport media query as fallback
18
- */
19
-
20
- /* ==================== 容器 ==================== */
21
-
22
- .taskon-bind-wallet-dialog {
23
- position: relative;
24
- display: flex;
25
- flex-direction: column;
26
- }
27
-
28
- /* ==================== 标题 ==================== */
29
-
30
- .taskon-bind-wallet-dialog-title {
31
- margin: 0;
32
- font-size: 22px;
33
- font-weight: 700;
34
- line-height: 28px;
35
- color: var(--taskon-color-text);
36
- }
37
-
38
- /* ==================== 链类型标签 ==================== */
39
-
40
- .taskon-bind-wallet-dialog-chain-label {
41
- margin-top: var(--taskon-spacing-md);
42
- font-size: 16px;
43
- font-weight: 500;
44
- line-height: 20px;
45
- color: var(--taskon-color-text);
46
- }
47
-
48
- /* ==================== 钱包网格 ==================== */
49
-
50
- .taskon-bind-wallet-dialog-grid {
51
- margin-top: var(--taskon-spacing-sm);
52
- display: grid;
53
- grid-template-columns: 1fr;
54
- gap: var(--taskon-spacing-md);
55
- }
56
-
57
- /* ==================== 钱包项 ==================== */
58
-
59
- .taskon-bind-wallet-item {
60
- position: relative;
61
- display: flex;
62
- align-items: center;
63
- justify-content: center;
64
- height: 50px;
65
- padding: 0 12px;
66
-
67
- background: transparent;
68
- border: 1px solid var(--taskon-color-border);
69
- border-radius: 8px;
70
- cursor: pointer;
71
- transition: all 0.2s ease;
72
- }
73
-
74
- .taskon-bind-wallet-item:hover,
75
- .taskon-bind-wallet-item:focus {
76
- background: var(--taskon-color-bg-surface-strong);
77
- }
78
-
79
- .taskon-bind-wallet-item:active {
80
- transform: scale(0.98);
81
- }
82
-
83
- /* 钱包图标 */
84
-
85
- .taskon-bind-wallet-item-icon {
86
- display: flex;
87
- align-items: center;
88
- justify-content: center;
89
- width: 24px;
90
- height: 24px;
91
- flex-shrink: 0;
92
- }
93
-
94
- .taskon-bind-wallet-item-icon svg {
95
- width: 24px;
96
- height: 24px;
97
- }
98
-
99
- /* 钱包名称 */
100
-
101
- .taskon-bind-wallet-item-name {
102
- margin-left: 10px;
103
- font-size: 18px;
104
- font-weight: 600;
105
- line-height: 20px;
106
- color: var(--taskon-color-text);
107
- }
108
-
109
- /* 已安装标签 */
110
-
111
- .taskon-bind-wallet-item-installed {
112
- position: absolute;
113
- right: 0;
114
- bottom: 0;
115
- padding: 4px 8px;
116
- font-size: 10px;
117
- line-height: 14px;
118
- color: var(--taskon-color-secondary);
119
- background: var(--taskon-color-secondary-bg);
120
- border-radius: 8px 0;
121
- transform-origin: bottom right;
122
- }
123
-
124
- /* ==================== 连接中状态 ==================== */
125
-
126
- .taskon-bind-wallet-item--connecting {
127
- opacity: 0.7;
128
- cursor: wait;
129
- }
130
-
131
- .taskon-bind-wallet-item--connecting:hover,
132
- .taskon-bind-wallet-item--connecting:focus {
133
- background: transparent;
134
- }
135
-
136
- /* ==================== 禁用状态 ==================== */
137
-
138
- .taskon-bind-wallet-item--disabled {
139
- opacity: 0.5;
140
- cursor: not-allowed;
141
- }
142
-
143
- .taskon-bind-wallet-item--disabled:hover,
144
- .taskon-bind-wallet-item--disabled:focus {
145
- background: transparent;
146
- }
147
-
148
- .taskon-bind-wallet-item--disabled:active {
149
- transform: none;
150
- }
151
-
152
- /* 不可用标签 */
153
-
154
- .taskon-bind-wallet-item-unavailable {
155
- position: absolute;
156
- right: 0;
157
- bottom: 0;
158
- padding: 4px 8px;
159
- font-size: 10px;
160
- line-height: 14px;
161
- color: var(--taskon-color-text-tertiary);
162
- background: var(--taskon-color-bg-surface-subtle);
163
- border-radius: 8px 0;
164
- }
165
-
166
- /* 连接中 spinner */
167
-
168
- .taskon-bind-wallet-item-connecting {
169
- position: absolute;
170
- right: 8px;
171
- display: flex;
172
- align-items: center;
173
- justify-content: center;
174
- }
175
-
176
- .taskon-bind-wallet-spinner {
177
- width: 16px;
178
- height: 16px;
179
- color: var(--taskon-color-primary);
180
- animation: taskon-bind-wallet-spin 1s linear infinite;
181
- }
182
-
183
- @keyframes taskon-bind-wallet-spin {
184
- from {
185
- transform: rotate(0deg);
186
- }
187
- to {
188
- transform: rotate(360deg);
189
- }
190
- }
191
-
192
- /* ==================== 提示文字 ==================== */
193
-
194
- .taskon-bind-wallet-dialog-tip {
195
- margin: var(--taskon-spacing-md) 0 0;
196
- font-size: 14px;
197
- line-height: 1.5;
198
- color: var(--taskon-color-text-tertiary);
199
- text-align: center;
200
- }
201
-
202
- /* ==================== 连接中遮层 ==================== */
203
-
204
- .taskon-bind-wallet-loading-overlay {
205
- position: absolute;
206
- /* 使用负值覆盖 Dialog body 的 padding */
207
- inset: -20px;
208
- display: flex;
209
- flex-direction: column;
210
- align-items: center;
211
- justify-content: center;
212
- background: var(--taskon-color-bg-mask);
213
- backdrop-filter: blur(4px);
214
- border-radius: 12px;
215
- }
216
-
217
- .taskon-bind-wallet-loading-spinner {
218
- width: 40px;
219
- height: 40px;
220
- color: var(--taskon-color-text-secondary);
221
- animation: taskon-bind-wallet-spin 1s linear infinite;
222
- }
223
-
224
- .taskon-bind-wallet-loading-text {
225
- margin: 20px 0 0;
226
- max-width: 60%;
227
- font-size: 16px;
228
- line-height: 20px;
229
- color: var(--taskon-color-text-secondary);
230
- text-align: center;
231
- }
232
-
233
- @supports (container-type: inline-size) {
234
- @container (min-width: 751px) {
235
- .taskon-bind-wallet-dialog-chain-label {
236
- margin-top: 20px;
237
- }
238
-
239
- .taskon-bind-wallet-dialog-grid {
240
- margin-top: 10px;
241
- grid-template-columns: 1fr 1fr;
242
- gap: 18px;
243
- }
244
-
245
- .taskon-bind-wallet-dialog-tip {
246
- margin-top: 20px;
247
- }
248
-
249
- .taskon-bind-wallet-loading-overlay {
250
- inset: -24px;
251
- border-radius: 16px;
252
- }
253
- }
254
- }
255
-
256
- @supports not (container-type: inline-size) {
257
- @media (min-width: 751px) {
258
- .taskon-bind-wallet-dialog-chain-label {
259
- margin-top: 20px;
260
- }
261
-
262
- .taskon-bind-wallet-dialog-grid {
263
- margin-top: 10px;
264
- grid-template-columns: 1fr 1fr;
265
- gap: 18px;
266
- }
267
-
268
- .taskon-bind-wallet-dialog-tip {
269
- margin-top: 20px;
270
- }
271
-
272
- .taskon-bind-wallet-loading-overlay {
273
- inset: -24px;
274
- border-radius: 16px;
275
- }
276
- }
277
- }
278
1
  /**
279
2
  * Input 通用组件样式
280
3
  * @description 复刻 Vue 版本 BaseInputPro.vue 样式
@@ -3820,14 +3543,23 @@
3820
3543
  transition: background-color 0.2s ease;
3821
3544
  }
3822
3545
 
3823
- .taskon-identity-social-item:hover {
3824
- background-color: var(--taskon-color-bg-surface-strong);
3546
+ .taskon-identity-social-item:hover {
3547
+ background-color: var(--taskon-color-bg-surface-strong);
3548
+ }
3549
+
3550
+ .taskon-identity-social-item--clickable {
3551
+ cursor: pointer;
3552
+ }
3553
+
3554
+ .taskon-identity-social-item--clickable:focus-visible {
3555
+ outline: 2px solid var(--taskon-color-link);
3556
+ outline-offset: 2px;
3825
3557
  }
3826
3558
 
3827
3559
  /* 已绑定状态 - 可以添加不同的视觉反馈 */
3828
3560
 
3829
- .taskon-identity-social-item--bound {
3830
- background-color: var(--taskon-color-bg-surface-subtle);
3561
+ .taskon-identity-social-item--bound {
3562
+ background-color: var(--taskon-color-bg-surface-subtle);
3831
3563
  }
3832
3564
 
3833
3565
  /* "Linked" 徽章:已绑定默认显示 */
@@ -4115,10 +3847,13 @@
4115
3847
  gap: var(--taskon-spacing-sm);
4116
3848
  }
4117
3849
 
4118
- .taskon-network-card__chain-icon svg {
4119
- width: 24px;
4120
- height: 24px;
4121
- border-radius: 8px;
3850
+ .taskon-network-card__chain-icon svg,
3851
+ .taskon-network-card__chain-icon img {
3852
+ width: 24px;
3853
+ height: 24px;
3854
+ border-radius: 8px;
3855
+ object-fit: contain;
3856
+ flex-shrink: 0;
4122
3857
  }
4123
3858
 
4124
3859
  /* EVM 多链图标行 */
@@ -4130,11 +3865,18 @@
4130
3865
  align-items: center;
4131
3866
  }
4132
3867
 
4133
- .taskon-network-chain-icons svg {
4134
- width: 24px;
4135
- height: 24px;
4136
- border-radius: 8px;
4137
- flex-shrink: 0;
3868
+ .taskon-network-chain-icons svg {
3869
+ width: 24px;
3870
+ height: 24px;
3871
+ border-radius: 8px;
3872
+ flex-shrink: 0;
3873
+ }
3874
+
3875
+ .taskon-network-chain-icons img {
3876
+ display: block;
3877
+ flex-shrink: 0;
3878
+ max-width: 100%;
3879
+ height: auto;
4138
3880
  }
4139
3881
 
4140
3882
  .taskon-network-chain-icons__more {