@hanwenbo/x-taro-ui 0.0.1 → 0.0.2
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/es/adapters/miniapp/overlayHost.js +14 -8
- package/es/auth/components.d.ts +17 -15
- package/es/auth/components.js +253 -133
- package/es/auth/entries/locales.d.ts +2 -0
- package/es/auth/entries/locales.js +1 -0
- package/es/auth/index.d.ts +1 -0
- package/es/auth/index.js +2 -1
- package/es/auth/internal.d.ts +17 -11
- package/es/auth/internal.js +107 -42
- package/es/auth/phoneNumberInput.d.ts +4 -2
- package/es/auth/phoneNumberInput.js +27 -8
- package/es/auth/provider.d.ts +2 -2
- package/es/auth/styles.css +161 -99
- package/es/auth/theme.js +20 -4
- package/es/components/_shared/render.d.ts +1 -1
- package/es/components/button/button.js +23 -3
- package/es/components/button/types.d.ts +6 -0
- package/es/components/capsuleTabs/capsuleTabs.js +4 -0
- package/es/components/icon/lucide.generated.d.ts +10 -0
- package/es/components/icon/lucide.generated.js +10 -0
- package/es/components/inputItem/inputItem.js +5 -2
- package/es/components/list/list.d.ts +1 -1
- package/es/components/pagination/pagination.js +18 -5
- package/es/components/sectionList/sectionList.d.ts +1 -2
- package/es/components/segmented/segmented.js +10 -2
- package/es/components/touchableOpacity/touchableOpacity.js +1 -0
- package/es/taro-components.d.ts +6 -0
- package/lib/adapters/miniapp/overlayHost.js +13 -6
- package/lib/auth/components.d.ts +17 -15
- package/lib/auth/components.js +257 -125
- package/lib/auth/entries/locales.d.ts +2 -0
- package/lib/auth/entries/locales.js +33 -0
- package/lib/auth/index.d.ts +1 -0
- package/lib/auth/index.js +13 -0
- package/lib/auth/internal.d.ts +17 -11
- package/lib/auth/internal.js +76 -31
- package/lib/auth/phoneNumberInput.d.ts +4 -2
- package/lib/auth/phoneNumberInput.js +65 -45
- package/lib/auth/provider.d.ts +2 -2
- package/lib/auth/styles.css +161 -99
- package/lib/auth/theme.js +7 -4
- package/lib/components/_shared/render.d.ts +1 -1
- package/lib/components/button/button.js +7 -0
- package/lib/components/button/types.d.ts +6 -0
- package/lib/components/capsuleTabs/capsuleTabs.js +1 -0
- package/lib/components/icon/lucide.generated.d.ts +10 -0
- package/lib/components/icon/lucide.generated.js +24 -0
- package/lib/components/inputItem/inputItem.js +3 -0
- package/lib/components/list/list.d.ts +1 -1
- package/lib/components/pagination/pagination.js +19 -5
- package/lib/components/sectionList/sectionList.d.ts +1 -2
- package/lib/components/segmented/segmented.js +6 -1
- package/lib/components/touchableOpacity/touchableOpacity.js +1 -0
- package/lib/taro-components.d.ts +6 -0
- package/package.json +4 -4
package/es/auth/styles.css
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
.x-taro-auth-panel {
|
|
2
2
|
box-sizing: border-box;
|
|
3
3
|
width: 100%;
|
|
4
|
-
max-width: var(--x-taro-auth-panel-max-width,
|
|
4
|
+
max-width: var(--x-taro-auth-panel-max-width, 100%);
|
|
5
5
|
margin: 0 auto;
|
|
6
|
-
color: var(--
|
|
6
|
+
color: var(--foreground);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.x-taro-auth-panel--card {
|
|
10
|
-
padding: var(--x-taro-auth-panel-padding,
|
|
11
|
-
background: var(--
|
|
12
|
-
border:
|
|
10
|
+
padding: var(--x-taro-auth-panel-padding, var(--x-space-6) var(--x-space-5));
|
|
11
|
+
background: var(--card);
|
|
12
|
+
border: var(--x-space-px) solid var(--border);
|
|
13
13
|
border-radius: var(--x-radius-xl);
|
|
14
14
|
box-shadow: var(--x-shadow-sm);
|
|
15
15
|
}
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
.x-taro-auth-security__header {
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
|
-
align-items:
|
|
23
|
-
margin-bottom:
|
|
24
|
-
text-align:
|
|
25
|
-
gap:
|
|
22
|
+
align-items: flex-start;
|
|
23
|
+
margin-bottom: var(--x-space-6);
|
|
24
|
+
text-align: left;
|
|
25
|
+
gap: var(--x-space-2);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
.x-taro-auth-panel__logo {
|
|
29
29
|
display: flex;
|
|
30
30
|
justify-content: center;
|
|
31
|
-
margin-bottom:
|
|
31
|
+
margin-bottom: var(--x-space-1);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.x-taro-auth-panel__title,
|
|
35
35
|
.x-taro-auth-quick__title,
|
|
36
36
|
.x-taro-auth-security__title {
|
|
37
|
-
color: var(--
|
|
38
|
-
font-size:
|
|
37
|
+
color: var(--foreground);
|
|
38
|
+
font-size: var(--x-font-size-2xl);
|
|
39
39
|
font-weight: 700;
|
|
40
40
|
line-height: 1.25;
|
|
41
41
|
}
|
|
@@ -45,68 +45,100 @@
|
|
|
45
45
|
.x-taro-auth-security__description,
|
|
46
46
|
.x-taro-auth-security__value,
|
|
47
47
|
.x-taro-auth-security__loading {
|
|
48
|
-
color: var(--
|
|
49
|
-
font-size:
|
|
50
|
-
line-height: 1.
|
|
48
|
+
color: var(--muted-foreground);
|
|
49
|
+
font-size: var(--x-font-size-sm);
|
|
50
|
+
line-height: 1.7;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
.x-taro-auth-form,
|
|
54
54
|
.x-taro-auth-field,
|
|
55
55
|
.x-taro-auth-agreements,
|
|
56
56
|
.x-taro-auth-third-party,
|
|
57
|
-
.x-taro-auth-third-party__items,
|
|
58
57
|
.x-taro-auth-success {
|
|
59
58
|
display: flex;
|
|
60
59
|
flex-direction: column;
|
|
61
|
-
gap: var(--x-taro-auth-form-gap,
|
|
60
|
+
gap: var(--x-taro-auth-form-gap, calc(var(--x-space-4) + calc(var(--x-space-1) / 2)));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.x-taro-auth-third-party {
|
|
64
|
+
gap: var(--x-space-4);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.x-taro-auth-third-party__items {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: row;
|
|
70
|
+
flex-wrap: wrap;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
align-self: center;
|
|
73
|
+
width: 100%;
|
|
74
|
+
max-width: calc(var(--x-space-8) * 8 + var(--x-space-2) * 3);
|
|
75
|
+
gap: var(--x-space-4) var(--x-space-2);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.x-taro-auth-third-party__icon {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
width: calc(var(--x-space-10) + var(--x-space-1));
|
|
83
|
+
height: calc(var(--x-space-10) + var(--x-space-1));
|
|
84
|
+
flex-shrink: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.x-taro-auth-third-party__label {
|
|
88
|
+
max-width: calc(var(--x-space-8) * 2);
|
|
89
|
+
color: var(--muted-foreground);
|
|
90
|
+
font-size: var(--x-font-size-xs);
|
|
91
|
+
font-weight: 400;
|
|
92
|
+
line-height: 1.5;
|
|
93
|
+
white-space: normal;
|
|
94
|
+
overflow-wrap: anywhere;
|
|
95
|
+
text-align: center;
|
|
62
96
|
}
|
|
63
97
|
|
|
64
98
|
.x-taro-auth-field {
|
|
65
|
-
gap:
|
|
99
|
+
gap: var(--x-space-2);
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
.x-taro-auth-field__label,
|
|
69
103
|
.x-taro-auth-security__label {
|
|
70
|
-
color: var(--
|
|
71
|
-
font-size:
|
|
104
|
+
color: var(--foreground);
|
|
105
|
+
font-size: var(--x-font-size-sm);
|
|
72
106
|
font-weight: 600;
|
|
73
107
|
line-height: 1.4;
|
|
74
108
|
}
|
|
75
109
|
|
|
76
110
|
.x-taro-auth-field__hint {
|
|
77
|
-
color: var(--
|
|
78
|
-
font-size:
|
|
111
|
+
color: var(--muted-foreground);
|
|
112
|
+
font-size: var(--x-font-size-xs);
|
|
79
113
|
}
|
|
80
114
|
|
|
81
115
|
.x-taro-auth-field__error {
|
|
82
|
-
color: var(--
|
|
83
|
-
font-size:
|
|
116
|
+
color: var(--destructive);
|
|
117
|
+
font-size: var(--x-font-size-xs);
|
|
84
118
|
}
|
|
85
119
|
|
|
86
120
|
.x-taro-auth-error {
|
|
87
|
-
padding:
|
|
88
|
-
color: var(--
|
|
89
|
-
background: var(--
|
|
90
|
-
border:
|
|
121
|
+
padding: calc(var(--x-space-2) + var(--x-space-1) / 2) var(--x-space-3);
|
|
122
|
+
color: var(--destructive);
|
|
123
|
+
background: var(--muted);
|
|
124
|
+
border: var(--x-space-px) solid var(--destructive);
|
|
91
125
|
border-radius: var(--x-radius-lg);
|
|
92
126
|
}
|
|
93
127
|
|
|
94
128
|
.x-taro-auth-error__text {
|
|
95
129
|
color: inherit;
|
|
96
|
-
font-size:
|
|
130
|
+
font-size: calc(var(--x-font-size-xs) + var(--x-space-px));
|
|
97
131
|
}
|
|
98
132
|
|
|
99
|
-
.x-taro-auth-selector
|
|
100
|
-
|
|
133
|
+
.x-taro-auth-selector,
|
|
134
|
+
.x-taro-auth-method-tabs {
|
|
101
135
|
width: 100%;
|
|
102
|
-
|
|
103
|
-
background: var(--x-color-muted);
|
|
104
|
-
border-radius: var(--x-radius-lg);
|
|
105
|
-
gap: 8px;
|
|
136
|
+
min-width: 0;
|
|
106
137
|
}
|
|
107
138
|
|
|
108
|
-
.x-taro-auth-
|
|
109
|
-
|
|
139
|
+
.x-taro-auth-panel__header--center {
|
|
140
|
+
align-items: center;
|
|
141
|
+
text-align: center;
|
|
110
142
|
}
|
|
111
143
|
|
|
112
144
|
.x-taro-auth-form__meta,
|
|
@@ -127,45 +159,49 @@
|
|
|
127
159
|
}
|
|
128
160
|
|
|
129
161
|
.x-taro-auth-form__actions {
|
|
130
|
-
|
|
131
|
-
|
|
162
|
+
flex-direction: column-reverse;
|
|
163
|
+
align-items: center;
|
|
164
|
+
gap: var(--x-space-3);
|
|
132
165
|
}
|
|
133
166
|
|
|
134
167
|
.x-taro-auth-panel__footer {
|
|
135
168
|
justify-content: center;
|
|
136
|
-
margin-top:
|
|
137
|
-
color: var(--
|
|
138
|
-
font-size:
|
|
139
|
-
gap:
|
|
169
|
+
margin-top: var(--x-space-6);
|
|
170
|
+
color: var(--muted-foreground);
|
|
171
|
+
font-size: var(--x-font-size-sm);
|
|
172
|
+
gap: var(--x-space-1);
|
|
140
173
|
}
|
|
141
174
|
|
|
142
175
|
.x-taro-auth-divider {
|
|
143
|
-
color: var(--
|
|
144
|
-
font-size:
|
|
145
|
-
gap:
|
|
176
|
+
color: var(--muted-foreground);
|
|
177
|
+
font-size: var(--x-font-size-xs);
|
|
178
|
+
gap: var(--x-space-2);
|
|
146
179
|
}
|
|
147
180
|
|
|
148
|
-
.x-taro-auth-
|
|
181
|
+
.x-taro-auth-divider__line {
|
|
149
182
|
flex: 1;
|
|
150
|
-
height:
|
|
151
|
-
background: var(--
|
|
183
|
+
height: var(--x-space-px);
|
|
184
|
+
background: var(--border);
|
|
152
185
|
}
|
|
153
186
|
|
|
154
187
|
.x-taro-auth-phone {
|
|
188
|
+
box-sizing: border-box;
|
|
155
189
|
width: 100%;
|
|
156
190
|
min-width: 0;
|
|
157
191
|
overflow: hidden;
|
|
158
|
-
background: var(--
|
|
159
|
-
border:
|
|
192
|
+
background: var(--background);
|
|
193
|
+
border: var(--x-space-px) solid var(--input);
|
|
160
194
|
border-radius: var(--x-radius-lg);
|
|
161
195
|
}
|
|
162
196
|
|
|
163
197
|
.x-taro-auth-phone__country {
|
|
198
|
+
font-size: var(--x-taro-auth-phone-font-size);
|
|
199
|
+
line-height: 1.5;
|
|
164
200
|
box-sizing: border-box;
|
|
165
|
-
min-height:
|
|
166
|
-
padding: 0
|
|
167
|
-
border-right:
|
|
168
|
-
gap:
|
|
201
|
+
min-height: calc(var(--x-taro-auth-phone-height) - var(--x-space-px) * 2);
|
|
202
|
+
padding: 0 var(--x-space-3);
|
|
203
|
+
border-right: var(--x-space-px) solid var(--border);
|
|
204
|
+
gap: calc(var(--x-space-1) + var(--x-space-1) / 2);
|
|
169
205
|
}
|
|
170
206
|
|
|
171
207
|
.x-taro-auth-phone__input {
|
|
@@ -177,23 +213,27 @@
|
|
|
177
213
|
|
|
178
214
|
.x-taro-auth-steps {
|
|
179
215
|
display: flex;
|
|
180
|
-
margin-bottom:
|
|
181
|
-
gap:
|
|
216
|
+
margin-bottom: var(--x-space-6);
|
|
217
|
+
gap: var(--x-space-2);
|
|
182
218
|
}
|
|
183
219
|
|
|
184
|
-
.x-taro-auth-
|
|
220
|
+
.x-taro-auth-step {
|
|
185
221
|
display: flex;
|
|
186
222
|
flex: 1;
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
min-width: 0;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
align-items: flex-start;
|
|
226
|
+
line-height: 1.5;
|
|
227
|
+
padding-bottom: var(--x-space-2);
|
|
228
|
+
color: var(--muted-foreground);
|
|
229
|
+
border-bottom: calc(var(--x-space-1) / 2) solid var(--border);
|
|
230
|
+
font-size: var(--x-font-size-xs);
|
|
231
|
+
gap: calc(var(--x-space-1) + var(--x-space-px));
|
|
192
232
|
}
|
|
193
233
|
|
|
194
|
-
.x-taro-auth-
|
|
195
|
-
color: var(--
|
|
196
|
-
border-bottom-color: var(--
|
|
234
|
+
.x-taro-auth-step[data-active='true'] {
|
|
235
|
+
color: var(--foreground);
|
|
236
|
+
border-bottom-color: var(--foreground);
|
|
197
237
|
font-weight: 600;
|
|
198
238
|
}
|
|
199
239
|
|
|
@@ -209,7 +249,7 @@
|
|
|
209
249
|
@keyframes x-taro-auth-step-enter {
|
|
210
250
|
from {
|
|
211
251
|
opacity: 0;
|
|
212
|
-
transform: translate3d(
|
|
252
|
+
transform: translate3d(var(--x-font-size-sm), 0, 0);
|
|
213
253
|
}
|
|
214
254
|
|
|
215
255
|
to {
|
|
@@ -221,7 +261,7 @@
|
|
|
221
261
|
@keyframes x-taro-auth-step-back {
|
|
222
262
|
from {
|
|
223
263
|
opacity: 0;
|
|
224
|
-
transform: translate3d(-
|
|
264
|
+
transform: translate3d(calc(-1 * var(--x-font-size-sm)), 0, 0);
|
|
225
265
|
}
|
|
226
266
|
|
|
227
267
|
to {
|
|
@@ -232,28 +272,38 @@
|
|
|
232
272
|
|
|
233
273
|
.x-taro-auth-quick {
|
|
234
274
|
position: relative;
|
|
235
|
-
padding-top:
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
.x-taro-auth-quick__back,
|
|
239
|
-
.x-taro-auth-quick__close {
|
|
240
|
-
position: absolute;
|
|
241
|
-
top: -16px;
|
|
242
|
-
z-index: 1;
|
|
243
|
-
width: 72px;
|
|
244
|
-
min-width: 72px;
|
|
245
|
-
height: 72px;
|
|
246
|
-
padding: 0;
|
|
247
|
-
background: var(--x-color-muted);
|
|
248
|
-
border-radius: var(--x-radius-full);
|
|
275
|
+
padding-top: var(--x-space-1);
|
|
249
276
|
}
|
|
250
277
|
|
|
251
|
-
.x-taro-auth-
|
|
252
|
-
|
|
278
|
+
.x-taro-auth-quick__nav {
|
|
279
|
+
display: flex;
|
|
280
|
+
justify-content: space-between;
|
|
281
|
+
margin-bottom: var(--x-space-3);
|
|
253
282
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
283
|
+
.x-taro-auth-quick__nav:empty {
|
|
284
|
+
display: none;
|
|
285
|
+
}
|
|
286
|
+
.x-taro-auth-quick__nav--close {
|
|
287
|
+
justify-content: flex-end;
|
|
288
|
+
}
|
|
289
|
+
.x-taro-auth-step__number {
|
|
290
|
+
display: flex;
|
|
291
|
+
align-items: center;
|
|
292
|
+
justify-content: center;
|
|
293
|
+
width: var(--x-space-6);
|
|
294
|
+
height: var(--x-space-6);
|
|
295
|
+
border-radius: var(--x-radius-full);
|
|
296
|
+
background: var(--muted);
|
|
297
|
+
}
|
|
298
|
+
.x-taro-auth-step[data-active='true'] .x-taro-auth-step__number {
|
|
299
|
+
background: var(--primary);
|
|
300
|
+
color: var(--primary-foreground);
|
|
301
|
+
}
|
|
302
|
+
.x-taro-auth-panel__footer {
|
|
303
|
+
flex-wrap: wrap;
|
|
304
|
+
}
|
|
305
|
+
.x-taro-auth-security__value {
|
|
306
|
+
overflow-wrap: anywhere;
|
|
257
307
|
}
|
|
258
308
|
|
|
259
309
|
.x-taro-auth-success {
|
|
@@ -262,7 +312,7 @@
|
|
|
262
312
|
}
|
|
263
313
|
|
|
264
314
|
.x-taro-auth-success__title {
|
|
265
|
-
font-size:
|
|
315
|
+
font-size: var(--x-font-size-lg);
|
|
266
316
|
font-weight: 700;
|
|
267
317
|
}
|
|
268
318
|
|
|
@@ -272,17 +322,20 @@
|
|
|
272
322
|
|
|
273
323
|
.x-taro-auth-security__list {
|
|
274
324
|
overflow: hidden;
|
|
275
|
-
background: var(--
|
|
276
|
-
border:
|
|
325
|
+
background: var(--card);
|
|
326
|
+
border: var(--x-space-px) solid var(--border);
|
|
277
327
|
border-radius: var(--x-radius-xl);
|
|
278
328
|
}
|
|
279
329
|
|
|
280
330
|
.x-taro-auth-security__row {
|
|
281
331
|
box-sizing: border-box;
|
|
282
|
-
min-height:
|
|
283
|
-
padding: var(
|
|
284
|
-
|
|
285
|
-
|
|
332
|
+
min-height: calc(var(--x-space-10) + var(--x-space-12));
|
|
333
|
+
padding: var(
|
|
334
|
+
--x-taro-auth-security-row-padding,
|
|
335
|
+
var(--x-space-4) calc(var(--x-space-4) + calc(var(--x-space-1) / 2))
|
|
336
|
+
);
|
|
337
|
+
border-bottom: var(--x-space-px) solid var(--border);
|
|
338
|
+
gap: var(--x-space-3);
|
|
286
339
|
}
|
|
287
340
|
|
|
288
341
|
.x-taro-auth-security__row:last-child {
|
|
@@ -294,18 +347,22 @@
|
|
|
294
347
|
flex: 1;
|
|
295
348
|
min-width: 0;
|
|
296
349
|
flex-direction: column;
|
|
297
|
-
gap:
|
|
350
|
+
gap: var(--x-space-1);
|
|
298
351
|
}
|
|
299
352
|
|
|
300
|
-
@media (max-width:
|
|
353
|
+
@media (max-width: 40em) {
|
|
301
354
|
.x-taro-auth-panel--card {
|
|
302
|
-
padding:
|
|
355
|
+
padding: var(--x-taro-auth-panel-padding, var(--x-space-6) var(--x-space-5));
|
|
303
356
|
border-radius: var(--x-radius-lg);
|
|
304
357
|
}
|
|
305
358
|
|
|
359
|
+
.x-taro-auth-panel__title {
|
|
360
|
+
font-size: var(--x-font-size-2xl);
|
|
361
|
+
}
|
|
362
|
+
|
|
306
363
|
.x-taro-auth-security__row {
|
|
307
|
-
min-height:
|
|
308
|
-
padding:
|
|
364
|
+
min-height: calc(var(--x-space-10) + var(--x-space-8));
|
|
365
|
+
padding: var(--x-space-4);
|
|
309
366
|
}
|
|
310
367
|
}
|
|
311
368
|
|
|
@@ -314,3 +371,8 @@
|
|
|
314
371
|
animation: none;
|
|
315
372
|
}
|
|
316
373
|
}
|
|
374
|
+
|
|
375
|
+
/* A footer inside a form already participates in its gap. */
|
|
376
|
+
.x-taro-auth-form > .x-taro-auth-panel__footer {
|
|
377
|
+
margin-top: 0;
|
|
378
|
+
}
|
package/es/auth/theme.js
CHANGED
|
@@ -4,19 +4,35 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
6
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
13
|
function cssValue(value) {
|
|
8
14
|
if (value === undefined) return undefined;
|
|
9
15
|
return typeof value === 'number' ? "".concat(value, "px") : value;
|
|
10
16
|
}
|
|
17
|
+
|
|
18
|
+
// Runtime pixel values bypass Taro px-to-rpx/rem compilation, matching the X control metrics.
|
|
11
19
|
export function authThemeTokensToStyle(tokens) {
|
|
12
|
-
|
|
20
|
+
var _tokens$formGap, _tokens$panelMaxWidth;
|
|
21
|
+
var style = {
|
|
13
22
|
'--x-taro-auth-dialog-max-width': cssValue(tokens === null || tokens === void 0 ? void 0 : tokens.dialogMaxWidth),
|
|
14
|
-
'--x-taro-auth-form-gap': cssValue(tokens === null || tokens === void 0 ? void 0 : tokens.formGap),
|
|
15
|
-
'--x-taro-auth-motion-duration':
|
|
16
|
-
'--x-taro-auth-panel-max-width': cssValue(tokens === null || tokens === void 0 ? void 0 : tokens.panelMaxWidth),
|
|
23
|
+
'--x-taro-auth-form-gap': cssValue((_tokens$formGap = tokens === null || tokens === void 0 ? void 0 : tokens.formGap) !== null && _tokens$formGap !== void 0 ? _tokens$formGap : 18),
|
|
24
|
+
'--x-taro-auth-motion-duration': typeof (tokens === null || tokens === void 0 ? void 0 : tokens.motionDuration) === 'number' ? "".concat(tokens.motionDuration, "ms") : tokens === null || tokens === void 0 ? void 0 : tokens.motionDuration,
|
|
25
|
+
'--x-taro-auth-panel-max-width': cssValue((_tokens$panelMaxWidth = tokens === null || tokens === void 0 ? void 0 : tokens.panelMaxWidth) !== null && _tokens$panelMaxWidth !== void 0 ? _tokens$panelMaxWidth : 460),
|
|
17
26
|
'--x-taro-auth-panel-padding': cssValue(tokens === null || tokens === void 0 ? void 0 : tokens.panelPadding),
|
|
18
27
|
'--x-taro-auth-security-row-padding': cssValue(tokens === null || tokens === void 0 ? void 0 : tokens.securityRowPadding)
|
|
19
28
|
};
|
|
29
|
+
// Taro's native renderer calls toString() for every CSS variable value.
|
|
30
|
+
// Omit unset overrides so defaults are inherited without crashing WeApp.
|
|
31
|
+
return Object.fromEntries(Object.entries(style).filter(function (_ref) {
|
|
32
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
33
|
+
value = _ref2[1];
|
|
34
|
+
return value !== undefined;
|
|
35
|
+
}));
|
|
20
36
|
}
|
|
21
37
|
export function resolveAuthThemeTokens(base, override) {
|
|
22
38
|
return _objectSpread(_objectSpread({}, base), override);
|
|
@@ -5,7 +5,7 @@ interface RenderTextNodeAttributes {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
'data-slot'?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const renderTextNode: (node: React.ReactNode, style: React.CSSProperties, attributes?: RenderTextNodeAttributes) => true | Iterable<React.ReactNode> |
|
|
8
|
+
export declare const renderTextNode: (node: React.ReactNode, style: React.CSSProperties, attributes?: RenderTextNodeAttributes) => true | Iterable<React.ReactNode> | import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
export declare const getStatusColor: (status: 'normal' | 'success' | 'warning' | 'error' | 'info', colors: {
|
|
10
10
|
primary: string;
|
|
11
11
|
success: string;
|
|
@@ -41,6 +41,8 @@ export var Button = function Button(_ref) {
|
|
|
41
41
|
shape = _ref$shape === void 0 ? 'default' : _ref$shape,
|
|
42
42
|
_ref$block = _ref.block,
|
|
43
43
|
block = _ref$block === void 0 ? false : _ref$block,
|
|
44
|
+
_ref$compact = _ref.compact,
|
|
45
|
+
compact = _ref$compact === void 0 ? false : _ref$compact,
|
|
44
46
|
_ref$disabled = _ref.disabled,
|
|
45
47
|
disabledProp = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
46
48
|
_ref$loading = _ref.loading,
|
|
@@ -149,12 +151,27 @@ export var Button = function Button(_ref) {
|
|
|
149
151
|
var buttonTokens = useButtonTokens(size);
|
|
150
152
|
var buttonColors = useButtonColors(resolvedVariant, danger);
|
|
151
153
|
var shapeRadius = shape === 'rounded' || shape === 'round' ? 'var(--x-radius-full)' : shape === 'square' || shape === 'rectangular' ? 0 : buttonStyle.borderRadius;
|
|
152
|
-
var combinedStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonStyle),
|
|
154
|
+
var combinedStyle = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, buttonStyle), resolvedVariant === 'link' ? {
|
|
155
|
+
borderWidth: 0,
|
|
156
|
+
textDecoration: 'underline'
|
|
157
|
+
} : {}), compact ? {
|
|
158
|
+
height: 'auto',
|
|
159
|
+
minHeight: 0,
|
|
160
|
+
minWidth: 0,
|
|
161
|
+
padding: 0,
|
|
162
|
+
width: block ? '100%' : 'auto'
|
|
163
|
+
} : {}), {}, {
|
|
153
164
|
borderRadius: shapeRadius,
|
|
154
165
|
gap: typeof gap === 'number' ? "".concat(gap, "px") : gap
|
|
155
166
|
}, style), pressStyle), {}, {
|
|
156
167
|
transition: 'transform var(--x-duration-fast) var(--x-easing-standard), background-color var(--x-duration-emphasis) var(--x-easing-standard), border-color var(--x-duration-emphasis) var(--x-easing-standard), color var(--x-duration-emphasis) var(--x-easing-standard), opacity var(--x-duration-standard) var(--x-easing-standard)'
|
|
157
168
|
});
|
|
169
|
+
// Taro's Button type omits the H5 `role` attribute even though its H5
|
|
170
|
+
// custom element needs it to expose native button semantics to assistive
|
|
171
|
+
// technology and browser automation.
|
|
172
|
+
var h5SemanticProps = {
|
|
173
|
+
role: 'button'
|
|
174
|
+
};
|
|
158
175
|
var iconNode = loading ? loadingIcon !== null && loadingIcon !== void 0 ? loadingIcon : /*#__PURE__*/_jsx(Icon, {
|
|
159
176
|
name: "Loader2",
|
|
160
177
|
size: buttonTokens.iconSize,
|
|
@@ -171,6 +188,7 @@ export var Button = function Button(_ref) {
|
|
|
171
188
|
fontWeight: buttonStyle.fontWeight,
|
|
172
189
|
lineHeight: "".concat(buttonTokens.lineHeight, "px"),
|
|
173
190
|
textAlign: 'center',
|
|
191
|
+
textDecoration: resolvedVariant === 'link' ? 'underline' : undefined,
|
|
174
192
|
whiteSpace: block ? 'normal' : 'nowrap',
|
|
175
193
|
wordBreak: 'keep-all'
|
|
176
194
|
};
|
|
@@ -197,11 +215,12 @@ export var Button = function Button(_ref) {
|
|
|
197
215
|
},
|
|
198
216
|
children: content
|
|
199
217
|
});
|
|
200
|
-
return /*#__PURE__*/_jsxs(TaroButton, _objectSpread(_objectSpread({
|
|
218
|
+
return /*#__PURE__*/_jsxs(TaroButton, _objectSpread(_objectSpread(_objectSpread({
|
|
201
219
|
className: classNames("".concat(config.prefixCls, "-button"), "".concat(config.prefixCls, "-button--").concat(resolvedVariant), "".concat(config.prefixCls, "-button--").concat(size), danger && "".concat(config.prefixCls, "-button--danger"), loading && "".concat(config.prefixCls, "-button--loading"), iconOnly && "".concat(config.prefixCls, "-button--icon-only"), className),
|
|
202
220
|
style: combinedStyle,
|
|
203
221
|
disabled: interactionDisabled,
|
|
204
|
-
formType: htmlType === 'button' ? undefined : htmlType
|
|
222
|
+
formType: htmlType === 'button' ? undefined : htmlType
|
|
223
|
+
}, h5SemanticProps), {}, {
|
|
205
224
|
ariaLabel: ariaLabel,
|
|
206
225
|
"aria-disabled": interactionDisabled,
|
|
207
226
|
"data-slot": "button",
|
|
@@ -212,6 +231,7 @@ export var Button = function Button(_ref) {
|
|
|
212
231
|
"data-loading": loading ? 'true' : 'false',
|
|
213
232
|
"data-disabled": interactionDisabled ? 'true' : 'false',
|
|
214
233
|
"data-block": block ? 'true' : 'false',
|
|
234
|
+
"data-compact": compact ? 'true' : 'false',
|
|
215
235
|
"data-icon-only": iconOnly ? 'true' : 'false'
|
|
216
236
|
}, handlers), {}, {
|
|
217
237
|
children: [iconNode ? /*#__PURE__*/_jsx(View, {
|
|
@@ -24,6 +24,12 @@ export interface ButtonProps {
|
|
|
24
24
|
shape?: 'default' | 'rounded' | 'round' | 'square' | 'rectangular';
|
|
25
25
|
/** Full width button */
|
|
26
26
|
block?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Remove padding and preset dimensions for inline actions; preserve block width.
|
|
29
|
+
* Base button margins are zero. Sibling spacing belongs to the parent gap/layout.
|
|
30
|
+
* `variant="link"` alone does not remove size padding. Explicit style overrides still win.
|
|
31
|
+
*/
|
|
32
|
+
compact?: boolean;
|
|
27
33
|
/** Disabled state */
|
|
28
34
|
disabled?: boolean;
|
|
29
35
|
/** Loading state */
|
|
@@ -398,6 +398,10 @@ export var CapsuleTabs = function CapsuleTabs(_ref3) {
|
|
|
398
398
|
})]
|
|
399
399
|
});
|
|
400
400
|
var panels = resolvedItems.map(function (item) {
|
|
401
|
+
// Items are also used as an externally controlled selector. In that mode
|
|
402
|
+
// there is no tab panel to render, and an empty panel would still add the
|
|
403
|
+
// default 16px content gap below the track.
|
|
404
|
+
if (item.children == null) return null;
|
|
401
405
|
var active = item.key === currentKey;
|
|
402
406
|
if (!active && !item.forceRender) return null;
|
|
403
407
|
if (!active && item.destroyOnClose) return null;
|
|
@@ -333,6 +333,9 @@ export declare const lucideIconNodes: {
|
|
|
333
333
|
}], readonly ["path", {
|
|
334
334
|
readonly d: "m15 5 4 4";
|
|
335
335
|
}]];
|
|
336
|
+
readonly Phone: readonly [readonly ["path", {
|
|
337
|
+
readonly d: "M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z";
|
|
338
|
+
}]];
|
|
336
339
|
readonly Plus: readonly [readonly ["path", {
|
|
337
340
|
readonly d: "M5 12h14";
|
|
338
341
|
}], readonly ["path", {
|
|
@@ -534,6 +537,13 @@ export declare const lucideIconNodes: {
|
|
|
534
537
|
readonly cy: "7";
|
|
535
538
|
readonly r: "4";
|
|
536
539
|
}]];
|
|
540
|
+
readonly UserRound: readonly [readonly ["circle", {
|
|
541
|
+
readonly cx: "12";
|
|
542
|
+
readonly cy: "8";
|
|
543
|
+
readonly r: "5";
|
|
544
|
+
}], readonly ["path", {
|
|
545
|
+
readonly d: "M20 21a8 8 0 0 0-16 0";
|
|
546
|
+
}]];
|
|
537
547
|
readonly Users: readonly [readonly ["path", {
|
|
538
548
|
readonly d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2";
|
|
539
549
|
}], readonly ["circle", {
|
|
@@ -336,6 +336,9 @@ export var lucideIconNodes = {
|
|
|
336
336
|
}], ['path', {
|
|
337
337
|
d: 'm15 5 4 4'
|
|
338
338
|
}]],
|
|
339
|
+
Phone: [['path', {
|
|
340
|
+
d: 'M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'
|
|
341
|
+
}]],
|
|
339
342
|
Plus: [['path', {
|
|
340
343
|
d: 'M5 12h14'
|
|
341
344
|
}], ['path', {
|
|
@@ -537,6 +540,13 @@ export var lucideIconNodes = {
|
|
|
537
540
|
cy: '7',
|
|
538
541
|
r: '4'
|
|
539
542
|
}]],
|
|
543
|
+
UserRound: [['circle', {
|
|
544
|
+
cx: '12',
|
|
545
|
+
cy: '8',
|
|
546
|
+
r: '5'
|
|
547
|
+
}], ['path', {
|
|
548
|
+
d: 'M20 21a8 8 0 0 0-16 0'
|
|
549
|
+
}]],
|
|
540
550
|
Users: [['path', {
|
|
541
551
|
d: 'M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'
|
|
542
552
|
}], ['circle', {
|
|
@@ -213,7 +213,10 @@ export var InputItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
213
213
|
transition: "border-color ".concat(motion.durationsMs.emphasis, "ms ").concat(motion.easing.standard, ", box-shadow ").concat(motion.durationsMs.emphasis, "ms ").concat(motion.easing.standard, ", background-color ").concat(motion.durationsMs.emphasis, "ms ").concat(motion.easing.standard),
|
|
214
214
|
opacity: isDisabled ? 0.5 : 1
|
|
215
215
|
}, onClick ? itemPress.style : {}), style);
|
|
216
|
-
var inputStyle = {
|
|
216
|
+
var inputStyle = _objectSpread(_objectSpread({}, process.env.TARO_ENV === 'h5' ? {
|
|
217
|
+
display: 'flex',
|
|
218
|
+
alignItems: 'center'
|
|
219
|
+
} : {}), {}, {
|
|
217
220
|
minWidth: 0,
|
|
218
221
|
width: '100%',
|
|
219
222
|
flex: 1,
|
|
@@ -228,7 +231,7 @@ export var InputItem = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
228
231
|
outline: 'none',
|
|
229
232
|
fontSize: tokens.fontSize,
|
|
230
233
|
lineHeight: "".concat(tokens.lineHeight, "px")
|
|
231
|
-
};
|
|
234
|
+
});
|
|
232
235
|
var nativeType = mapInputType(type);
|
|
233
236
|
var nativeModeProps = type === 'email' || type === 'tel' || type === 'url' ? {
|
|
234
237
|
inputMode: type
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ListItemProps, ListProps } from './types';
|
|
3
3
|
export declare const ListItem: React.FC<ListItemProps>;
|
|
4
|
-
export declare const List: (<T>({ dataSource, renderItem, keyExtractor, emptyText, loading, loadingText, divider, header, headerFontSize, prefixWidth, mode, variant, children, className, style, testID, ...viewProps }: ListProps<T>) =>
|
|
4
|
+
export declare const List: (<T>({ dataSource, renderItem, keyExtractor, emptyText, loading, loadingText, divider, header, headerFontSize, prefixWidth, mode, variant, children, className, style, testID, ...viewProps }: ListProps<T>) => import("react/jsx-runtime").JSX.Element) & {
|
|
5
5
|
displayName: string;
|
|
6
6
|
Item: React.FC<ListItemProps>;
|
|
7
7
|
};
|