@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.
Files changed (55) hide show
  1. package/es/adapters/miniapp/overlayHost.js +14 -8
  2. package/es/auth/components.d.ts +17 -15
  3. package/es/auth/components.js +253 -133
  4. package/es/auth/entries/locales.d.ts +2 -0
  5. package/es/auth/entries/locales.js +1 -0
  6. package/es/auth/index.d.ts +1 -0
  7. package/es/auth/index.js +2 -1
  8. package/es/auth/internal.d.ts +17 -11
  9. package/es/auth/internal.js +107 -42
  10. package/es/auth/phoneNumberInput.d.ts +4 -2
  11. package/es/auth/phoneNumberInput.js +27 -8
  12. package/es/auth/provider.d.ts +2 -2
  13. package/es/auth/styles.css +161 -99
  14. package/es/auth/theme.js +20 -4
  15. package/es/components/_shared/render.d.ts +1 -1
  16. package/es/components/button/button.js +23 -3
  17. package/es/components/button/types.d.ts +6 -0
  18. package/es/components/capsuleTabs/capsuleTabs.js +4 -0
  19. package/es/components/icon/lucide.generated.d.ts +10 -0
  20. package/es/components/icon/lucide.generated.js +10 -0
  21. package/es/components/inputItem/inputItem.js +5 -2
  22. package/es/components/list/list.d.ts +1 -1
  23. package/es/components/pagination/pagination.js +18 -5
  24. package/es/components/sectionList/sectionList.d.ts +1 -2
  25. package/es/components/segmented/segmented.js +10 -2
  26. package/es/components/touchableOpacity/touchableOpacity.js +1 -0
  27. package/es/taro-components.d.ts +6 -0
  28. package/lib/adapters/miniapp/overlayHost.js +13 -6
  29. package/lib/auth/components.d.ts +17 -15
  30. package/lib/auth/components.js +257 -125
  31. package/lib/auth/entries/locales.d.ts +2 -0
  32. package/lib/auth/entries/locales.js +33 -0
  33. package/lib/auth/index.d.ts +1 -0
  34. package/lib/auth/index.js +13 -0
  35. package/lib/auth/internal.d.ts +17 -11
  36. package/lib/auth/internal.js +76 -31
  37. package/lib/auth/phoneNumberInput.d.ts +4 -2
  38. package/lib/auth/phoneNumberInput.js +65 -45
  39. package/lib/auth/provider.d.ts +2 -2
  40. package/lib/auth/styles.css +161 -99
  41. package/lib/auth/theme.js +7 -4
  42. package/lib/components/_shared/render.d.ts +1 -1
  43. package/lib/components/button/button.js +7 -0
  44. package/lib/components/button/types.d.ts +6 -0
  45. package/lib/components/capsuleTabs/capsuleTabs.js +1 -0
  46. package/lib/components/icon/lucide.generated.d.ts +10 -0
  47. package/lib/components/icon/lucide.generated.js +24 -0
  48. package/lib/components/inputItem/inputItem.js +3 -0
  49. package/lib/components/list/list.d.ts +1 -1
  50. package/lib/components/pagination/pagination.js +19 -5
  51. package/lib/components/sectionList/sectionList.d.ts +1 -2
  52. package/lib/components/segmented/segmented.js +6 -1
  53. package/lib/components/touchableOpacity/touchableOpacity.js +1 -0
  54. package/lib/taro-components.d.ts +6 -0
  55. package/package.json +4 -4
@@ -77,6 +77,7 @@ function ThirdPartySignIn({
77
77
  testID,
78
78
  tokens
79
79
  }) {
80
+ const t = (0, import_react2.useAuthTranslation)(config);
80
81
  const controller = (0, import_react2.useThirdPartySignInController)({
81
82
  config,
82
83
  onAuthError,
@@ -96,21 +97,31 @@ function ThirdPartySignIn({
96
97
  style: useAuthStyle(tokens, style)
97
98
  },
98
99
  /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error),
99
- /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-divider" }, /* @__PURE__ */ import_react.default.createElement(import_components.View, null), /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, "其他方式登录"), /* @__PURE__ */ import_react.default.createElement(import_components.View, null)),
100
+ /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-divider" }, /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-divider__line" }), /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, t("auth.otherSignIn")), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-divider__line" })),
100
101
  /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-third-party__items" }, controller.providers.map((provider) => /* @__PURE__ */ import_react.default.createElement(
101
102
  import_button.Button,
102
103
  {
103
- ariaLabel: provider.ariaLabel ?? `${String(provider.label)}登录`,
104
- block: true,
104
+ ariaLabel: provider.ariaLabel ?? t("auth.providerSignIn", { provider: String(provider.label) }),
105
+ className: "x-taro-auth-third-party__item",
106
+ compact: true,
105
107
  disabled: provider.disabled || Boolean(controller.loadingProviderId),
106
- icon: provider.icon,
108
+ icon: /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-third-party__icon" }, provider.icon ?? /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "ShieldCheck", size: 28 })),
109
+ loadingIcon: /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-third-party__icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "Loader2", size: 28, spin: true })),
107
110
  key: provider.id,
108
111
  loading: provider.loading || controller.loadingProviderId === provider.id,
109
112
  onClick: () => void controller.signIn(provider),
110
- size: "large",
111
- type: "outline"
113
+ size: "small",
114
+ variant: "ghost",
115
+ gap: "var(--x-space-2)",
116
+ style: {
117
+ flexDirection: "column",
118
+ flex: "0 0 auto",
119
+ width: "calc(var(--x-space-8) * 2)",
120
+ padding: "var(--x-space-1) 0",
121
+ borderWidth: 0
122
+ }
112
123
  },
113
- provider.label
124
+ /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-third-party__label" }, provider.label)
114
125
  )))
115
126
  );
116
127
  }
@@ -119,7 +130,8 @@ function SignIn({
119
130
  config,
120
131
  contextFields = [],
121
132
  defaultMethod,
122
- description = "使用账号密码、验证码或第三方方式登录",
133
+ description,
134
+ headerAlign,
123
135
  logo,
124
136
  methods,
125
137
  onAuthError,
@@ -137,9 +149,10 @@ function SignIn({
137
149
  style,
138
150
  surface,
139
151
  testID,
140
- title = "登录",
152
+ title,
141
153
  tokens
142
154
  }) {
155
+ const t = (0, import_react2.useAuthTranslation)(config);
143
156
  const controller = (0, import_react2.useSignInController)({
144
157
  config,
145
158
  contextFields,
@@ -151,11 +164,14 @@ function SignIn({
151
164
  onSuccess,
152
165
  services
153
166
  });
167
+ if (description === void 0) description = t("auth.signInDescription");
168
+ if (title === void 0) title = t("auth.signIn");
154
169
  return /* @__PURE__ */ import_react.default.createElement(
155
170
  import_internal.AuthPanel,
156
171
  {
157
172
  className,
158
173
  description,
174
+ headerAlign,
159
175
  logo,
160
176
  style: useAuthStyle(tokens, style),
161
177
  surface,
@@ -163,12 +179,12 @@ function SignIn({
163
179
  title
164
180
  },
165
181
  /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), /* @__PURE__ */ import_react.default.createElement(
166
- import_internal.AuthSelector,
182
+ import_internal.CredentialSelector,
167
183
  {
168
184
  onChange: controller.selectCredentialType,
169
185
  options: controller.credentialOptions.map((value) => ({
170
186
  value,
171
- label: value === "password" ? "密码登录" : "验证码登录"
187
+ label: value === "password" ? t("auth.passwordSignIn") : t("auth.codeSignIn")
172
188
  })),
173
189
  value: controller.credentialType
174
190
  }
@@ -192,10 +208,10 @@ function SignIn({
192
208
  /* @__PURE__ */ import_react.default.createElement(
193
209
  import_inputItem.InputItem,
194
210
  {
195
- error: controller.contextFieldErrors[field.name],
211
+ error: Boolean(controller.contextFieldErrors[field.name]),
196
212
  maxLength: field.maxLength,
197
213
  onChange: (value) => controller.setContextValue(field.name, value),
198
- placeholder: field.placeholder ?? `请输入${field.label}`,
214
+ placeholder: field.placeholder ?? t("auth.enter", { label: field.label }),
199
215
  prefix: field.prefix,
200
216
  size: "large",
201
217
  testID: testID ? `${testID}-context-${field.name}` : void 0,
@@ -217,14 +233,14 @@ function SignIn({
217
233
  import_internal.AuthField,
218
234
  {
219
235
  error: controller.fieldErrors.password,
220
- label: showFieldLabels ? "密码" : void 0
236
+ label: showFieldLabels ? t("auth.password") : void 0
221
237
  },
222
238
  /* @__PURE__ */ import_react.default.createElement(
223
239
  import_inputItem.InputItem,
224
240
  {
225
- error: controller.fieldErrors.password,
241
+ error: Boolean(controller.fieldErrors.password),
226
242
  onChange: controller.setPassword,
227
- placeholder: "请输入密码",
243
+ placeholder: t("auth.enter", { label: t("auth.password") }),
228
244
  prefix: /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "Lock", size: 18 }),
229
245
  size: "large",
230
246
  type: "password",
@@ -234,6 +250,7 @@ function SignIn({
234
250
  ) : /* @__PURE__ */ import_react.default.createElement(
235
251
  import_internal.VerificationCodeInput,
236
252
  {
253
+ config: controller.config,
237
254
  codeLength: controller.config.code.length,
238
255
  countdown: controller.countdown,
239
256
  disabled: controller.submitting,
@@ -244,10 +261,10 @@ function SignIn({
244
261
  showLabel: showFieldLabels,
245
262
  value: controller.code
246
263
  }
247
- ), showRemember || onForgotPassword ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__meta" }, showRemember ? /* @__PURE__ */ import_react.default.createElement(import_checkbox.Checkbox, { checked: controller.remember, onChange: controller.setRemember }, "记住我") : /* @__PURE__ */ import_react.default.createElement(import_components.View, null), onForgotPassword && controller.credentialType === "password" ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onForgotPassword, size: "small", type: "link" }, "忘记密码?") : null) : null, /* @__PURE__ */ import_react.default.createElement(
264
+ ), showRemember || onForgotPassword && controller.credentialType === "password" ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__meta" }, showRemember ? /* @__PURE__ */ import_react.default.createElement(import_checkbox.Checkbox, { checked: controller.remember, onChange: controller.setRemember }, t("auth.remember")) : /* @__PURE__ */ import_react.default.createElement(import_components.View, null), onForgotPassword && controller.credentialType === "password" ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onForgotPassword, size: "small", type: "link", compact: true }, t("auth.forgotLink")) : null) : null, /* @__PURE__ */ import_react.default.createElement(
248
265
  import_button.Button,
249
266
  {
250
- ariaLabel: "登录",
267
+ ariaLabel: t("auth.signIn"),
251
268
  block: true,
252
269
  disabled: !controller.method || controller.submitting,
253
270
  loading: controller.submitting,
@@ -255,7 +272,7 @@ function SignIn({
255
272
  size: "large",
256
273
  testID: testID ? `${testID}-submit` : void 0
257
274
  },
258
- "登录"
275
+ t("auth.signIn")
259
276
  ), /* @__PURE__ */ import_react.default.createElement(
260
277
  ThirdPartySignIn,
261
278
  {
@@ -268,14 +285,14 @@ function SignIn({
268
285
  providers,
269
286
  services
270
287
  }
271
- ), onSignUp ? /* @__PURE__ */ import_react.default.createElement(InlineFooter, null, /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, "还没有账号?"), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onSignUp, size: "small", type: "link" }, "立即注册")) : null)
288
+ ), onSignUp ? /* @__PURE__ */ import_react.default.createElement(InlineFooter, null, /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, t("auth.noAccount")), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onSignUp, size: "small", type: "link", compact: true }, t("auth.signUpNow"))) : null)
272
289
  );
273
290
  }
274
291
  function SignUp({
275
292
  className,
276
293
  config,
277
294
  defaultIdentifier,
278
- description = "验证手机号或邮箱后创建账号",
295
+ description,
279
296
  identifiers,
280
297
  logo,
281
298
  onAuthError,
@@ -286,9 +303,10 @@ function SignUp({
286
303
  style,
287
304
  surface,
288
305
  testID,
289
- title = "注册",
306
+ title,
290
307
  tokens
291
308
  }) {
309
+ const t = (0, import_react2.useAuthTranslation)(config);
292
310
  const controller = (0, import_react2.useSignUpController)({
293
311
  config,
294
312
  defaultIdentifier,
@@ -298,6 +316,8 @@ function SignUp({
298
316
  onSuccess,
299
317
  services
300
318
  });
319
+ if (description === void 0) description = t("auth.signUpDescription");
320
+ if (title === void 0) title = t("auth.signUp");
301
321
  return /* @__PURE__ */ import_react.default.createElement(
302
322
  import_internal.AuthPanel,
303
323
  {
@@ -313,7 +333,7 @@ function SignUp({
313
333
  import_internal.AuthSelector,
314
334
  {
315
335
  onChange: controller.setIdentifierType,
316
- options: (0, import_internal.contactOptions)(controller.identifiers),
336
+ options: (0, import_internal.contactOptions)(controller.identifiers, controller.config),
317
337
  value: controller.identifierType
318
338
  }
319
339
  ), /* @__PURE__ */ import_react.default.createElement(
@@ -328,6 +348,7 @@ function SignUp({
328
348
  ), /* @__PURE__ */ import_react.default.createElement(
329
349
  import_internal.VerificationCodeInput,
330
350
  {
351
+ config: controller.config,
331
352
  codeLength: controller.config.code.length,
332
353
  countdown: controller.countdown,
333
354
  disabled: controller.submitting,
@@ -337,22 +358,22 @@ function SignUp({
337
358
  sending: controller.sendingCode,
338
359
  value: controller.code
339
360
  }
340
- ), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.password, label: "密码" }, /* @__PURE__ */ import_react.default.createElement(
361
+ ), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.password, label: t("auth.password") }, /* @__PURE__ */ import_react.default.createElement(
341
362
  import_inputItem.InputItem,
342
363
  {
343
- error: controller.fieldErrors.password,
364
+ error: Boolean(controller.fieldErrors.password),
344
365
  onChange: controller.setPassword,
345
- placeholder: `至少 ${controller.config.password.minLength} 位`,
366
+ placeholder: t("auth.passwordHint", { length: controller.config.password.minLength }),
346
367
  size: "large",
347
368
  type: "password",
348
369
  value: controller.password
349
370
  }
350
- )), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.confirmPassword, label: "确认密码" }, /* @__PURE__ */ import_react.default.createElement(
371
+ )), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.confirmPassword, label: t("auth.confirmPassword") }, /* @__PURE__ */ import_react.default.createElement(
351
372
  import_inputItem.InputItem,
352
373
  {
353
- error: controller.fieldErrors.confirmPassword,
374
+ error: Boolean(controller.fieldErrors.confirmPassword),
354
375
  onChange: controller.setConfirmPassword,
355
- placeholder: "请再次输入密码",
376
+ placeholder: t("auth.repeatPassword"),
356
377
  size: "large",
357
378
  type: "password",
358
379
  value: controller.confirmPassword
@@ -364,7 +385,7 @@ function SignUp({
364
385
  key: agreement.id,
365
386
  onChange: (checked) => controller.toggleAgreement(agreement.id, checked)
366
387
  },
367
- agreement.href ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { href: agreement.href, size: "small", type: "link" }, agreement.label) : agreement.label
388
+ agreement.href ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { href: agreement.href, size: "small", type: "link", compact: true }, agreement.label) : agreement.label
368
389
  )))) : null, /* @__PURE__ */ import_react.default.createElement(
369
390
  import_button.Button,
370
391
  {
@@ -373,13 +394,14 @@ function SignUp({
373
394
  onClick: () => void controller.submit(),
374
395
  size: "large"
375
396
  },
376
- "注册"
377
- ), onSignIn ? /* @__PURE__ */ import_react.default.createElement(InlineFooter, null, /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, "已有账号?"), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onSignIn, size: "small", type: "link" }, "去登录")) : null)
397
+ t("auth.signUp")
398
+ ), onSignIn ? /* @__PURE__ */ import_react.default.createElement(InlineFooter, null, /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, t("auth.hasAccount")), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onSignIn, size: "small", type: "link", compact: true }, t("auth.goSignIn"))) : null)
378
399
  );
379
400
  }
380
401
  function ForgotPassword({
381
402
  className,
382
403
  config,
404
+ description,
383
405
  defaultIdentifier,
384
406
  identifiers,
385
407
  onAuthError,
@@ -390,9 +412,10 @@ function ForgotPassword({
390
412
  style,
391
413
  surface,
392
414
  testID,
393
- title = "找回密码",
415
+ title,
394
416
  tokens
395
417
  }) {
418
+ const t = (0, import_react2.useAuthTranslation)(config);
396
419
  const controller = (0, import_react2.useForgotPasswordController)({
397
420
  config,
398
421
  defaultIdentifier,
@@ -402,18 +425,32 @@ function ForgotPassword({
402
425
  onSuccess,
403
426
  services
404
427
  });
428
+ if (title === void 0) title = t("auth.forgotPassword");
405
429
  const activeStep = controller.step === "verify" ? 0 : controller.step === "reset" ? 1 : 2;
406
430
  return /* @__PURE__ */ import_react.default.createElement(
407
431
  import_internal.AuthPanel,
408
432
  {
409
433
  className,
410
- description: "验证账号身份后重新设置密码",
434
+ description: description === void 0 ? t("auth.forgotDescription") : description,
411
435
  style: useAuthStyle(tokens, style),
412
436
  surface,
413
437
  testID,
414
438
  title
415
439
  },
416
- /* @__PURE__ */ import_react.default.createElement(import_components.View, { ariaLabel: "找回密码步骤", className: "x-taro-auth-steps" }, ["验证身份", "设置密码", "完成"].map((label, index) => /* @__PURE__ */ import_react.default.createElement(import_components.View, { "data-active": index === activeStep ? "true" : "false", key: label }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, index + 1), /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, label)))),
440
+ /* @__PURE__ */ import_react.default.createElement(import_components.View, { ariaLabel: t("auth.forgotSteps"), className: "x-taro-auth-steps" }, [
441
+ t(controller.verifiesBeforeReset ? "auth.verifyIdentity" : "auth.code"),
442
+ t("auth.setPassword"),
443
+ t("auth.done")
444
+ ].map((label, index) => /* @__PURE__ */ import_react.default.createElement(
445
+ import_components.View,
446
+ {
447
+ className: "x-taro-auth-step",
448
+ "data-active": index === activeStep ? "true" : "false",
449
+ key: label
450
+ },
451
+ /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-step__number" }, index + 1),
452
+ /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, label)
453
+ ))),
417
454
  /* @__PURE__ */ import_react.default.createElement(
418
455
  import_components.View,
419
456
  {
@@ -426,7 +463,7 @@ function ForgotPassword({
426
463
  import_internal.AuthSelector,
427
464
  {
428
465
  onChange: controller.setIdentifierType,
429
- options: (0, import_internal.contactOptions)(controller.identifiers),
466
+ options: (0, import_internal.contactOptions)(controller.identifiers, controller.config),
430
467
  value: controller.identifierType
431
468
  }
432
469
  ), /* @__PURE__ */ import_react.default.createElement(
@@ -441,6 +478,7 @@ function ForgotPassword({
441
478
  ), /* @__PURE__ */ import_react.default.createElement(
442
479
  import_internal.VerificationCodeInput,
443
480
  {
481
+ config: controller.config,
444
482
  codeLength: controller.config.code.length,
445
483
  countdown: controller.countdown,
446
484
  error: controller.fieldErrors.code,
@@ -457,36 +495,57 @@ function ForgotPassword({
457
495
  onClick: () => void controller.submitVerify(),
458
496
  size: "large"
459
497
  },
460
- "下一步"
461
- )) : controller.step === "reset" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.newPassword, label: "新密码" }, /* @__PURE__ */ import_react.default.createElement(
498
+ t("auth.next")
499
+ )) : controller.step === "reset" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.newPassword, label: t("auth.newPassword") }, /* @__PURE__ */ import_react.default.createElement(
462
500
  import_inputItem.InputItem,
463
501
  {
464
- error: controller.fieldErrors.newPassword,
502
+ error: Boolean(controller.fieldErrors.newPassword),
465
503
  onChange: controller.setNewPassword,
466
- placeholder: `至少 ${controller.config.password.minLength} 位`,
504
+ placeholder: t("auth.passwordHint", {
505
+ length: controller.config.password.minLength
506
+ }),
467
507
  size: "large",
468
508
  type: "password",
469
509
  value: controller.newPassword
470
510
  }
471
- )), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.confirmPassword, label: "确认新密码" }, /* @__PURE__ */ import_react.default.createElement(
472
- import_inputItem.InputItem,
511
+ )), /* @__PURE__ */ import_react.default.createElement(
512
+ import_internal.AuthField,
473
513
  {
474
514
  error: controller.fieldErrors.confirmPassword,
475
- onChange: controller.setConfirmPassword,
476
- placeholder: "请再次输入新密码",
477
- size: "large",
478
- type: "password",
479
- value: controller.confirmPassword
480
- }
481
- )), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: controller.back, size: "small", type: "outline" }, "上一步"), /* @__PURE__ */ import_react.default.createElement(
515
+ label: t("auth.confirmNewPassword")
516
+ },
517
+ /* @__PURE__ */ import_react.default.createElement(
518
+ import_inputItem.InputItem,
519
+ {
520
+ error: Boolean(controller.fieldErrors.confirmPassword),
521
+ onChange: controller.setConfirmPassword,
522
+ placeholder: t("auth.repeatNewPassword"),
523
+ size: "large",
524
+ type: "password",
525
+ value: controller.confirmPassword
526
+ }
527
+ )
528
+ ), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, /* @__PURE__ */ import_react.default.createElement(
529
+ import_button.Button,
530
+ {
531
+ onClick: controller.back,
532
+ style: { alignSelf: "center" },
533
+ size: "small",
534
+ type: "link",
535
+ compact: true,
536
+ disabled: controller.submitting
537
+ },
538
+ t("auth.previous")
539
+ ), /* @__PURE__ */ import_react.default.createElement(
482
540
  import_button.Button,
483
541
  {
484
542
  loading: controller.submitting,
485
543
  onClick: () => void controller.submitReset(),
486
- size: "small"
544
+ size: "large",
545
+ block: true
487
546
  },
488
- "重置密码"
489
- ))) : /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-success" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-success__title" }, "密码已重置"), /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, "现在可以使用新密码登录"), onBackToSignIn ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { block: true, onClick: onBackToSignIn, size: "large" }, "返回登录") : null)
547
+ t("auth.resetPassword")
548
+ ))) : /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-success" }, /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "CircleCheck", size: 40 }), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-success__title" }, t("auth.passwordReset")), /* @__PURE__ */ import_react.default.createElement(import_components.Text, null, t("auth.passwordResetDescription")), onBackToSignIn ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { block: true, onClick: onBackToSignIn, size: "large" }, t("auth.backToSignIn")) : null)
490
549
  )
491
550
  );
492
551
  }
@@ -494,9 +553,9 @@ function QuickSignIn({
494
553
  autoSubmitCode = true,
495
554
  className,
496
555
  config,
497
- description = "输入手机号,验证后继续当前操作",
556
+ description,
498
557
  footer,
499
- identifierSubmitText = "继续",
558
+ identifierSubmitText,
500
559
  identifierType = "phone",
501
560
  initialIdentifier,
502
561
  onAuthError,
@@ -507,12 +566,13 @@ function QuickSignIn({
507
566
  services,
508
567
  showHeader = true,
509
568
  style,
510
- submitText = "继续",
569
+ submitText,
511
570
  surface = "plain",
512
571
  testID,
513
- title = "输入手机号",
572
+ title,
514
573
  tokens
515
574
  }) {
575
+ const t = (0, import_react2.useAuthTranslation)(config);
516
576
  const controller = (0, import_react2.useQuickSignInController)({
517
577
  config,
518
578
  defaultIdentifier: identifierType,
@@ -524,6 +584,14 @@ function QuickSignIn({
524
584
  onSuccess,
525
585
  services
526
586
  });
587
+ if (description === void 0)
588
+ description = t("auth.quickDescription", {
589
+ label: (0, import_identifier.identifierLabel)(identifierType, controller.config)
590
+ });
591
+ if (identifierSubmitText === void 0) identifierSubmitText = t("auth.continue");
592
+ if (submitText === void 0) submitText = t("auth.continue");
593
+ if (title === void 0)
594
+ title = t("auth.quickTitle", { label: (0, import_identifier.identifierLabel)(identifierType, controller.config) });
527
595
  const submittedCodeRef = (0, import_react.useRef)("");
528
596
  (0, import_react.useEffect)(() => {
529
597
  if (autoSubmitCode && controller.step === "code" && controller.code.length === controller.config.code.length && submittedCodeRef.current !== controller.code) {
@@ -546,30 +614,36 @@ function QuickSignIn({
546
614
  "data-direction": controller.direction,
547
615
  key: controller.revision
548
616
  },
549
- controller.step === "code" ? /* @__PURE__ */ import_react.default.createElement(
550
- import_button.Button,
551
- {
552
- ariaLabel: "返回修改账号",
553
- className: "x-taro-auth-quick__back",
554
- onClick: controller.back,
555
- shape: "round",
556
- size: "small",
557
- type: "ghost"
558
- },
559
- "←"
560
- ) : onClose ? /* @__PURE__ */ import_react.default.createElement(
561
- import_button.Button,
617
+ /* @__PURE__ */ import_react.default.createElement(
618
+ import_components.View,
562
619
  {
563
- ariaLabel: "关闭",
564
- className: "x-taro-auth-quick__close",
565
- onClick: onClose,
566
- shape: "round",
567
- size: "small",
568
- type: "ghost"
620
+ className: `x-taro-auth-quick__nav x-taro-auth-quick__nav--${controller.step === "code" ? "back" : "close"}`
569
621
  },
570
- "×"
571
- ) : null,
572
- showHeader ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-quick__header" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-quick__title" }, controller.step === "identifier" ? title : `输入 ${controller.config.code.length} 位验证码`), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-quick__description" }, controller.step === "identifier" ? description : `验证码已发送至 ${controller.identifierValue}`)) : null,
622
+ controller.step === "code" ? /* @__PURE__ */ import_react.default.createElement(
623
+ import_button.Button,
624
+ {
625
+ ariaLabel: t("auth.editIdentifier"),
626
+ className: "x-taro-auth-quick__back",
627
+ onClick: controller.back,
628
+ shape: "round",
629
+ size: "small",
630
+ type: "ghost"
631
+ },
632
+ /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "ChevronLeft", size: 18 })
633
+ ) : onClose ? /* @__PURE__ */ import_react.default.createElement(
634
+ import_button.Button,
635
+ {
636
+ ariaLabel: t("auth.close"),
637
+ className: "x-taro-auth-quick__close",
638
+ onClick: onClose,
639
+ shape: "round",
640
+ size: "small",
641
+ type: "ghost"
642
+ },
643
+ /* @__PURE__ */ import_react.default.createElement(import_icon.Icon, { name: "X", size: 18 })
644
+ ) : null
645
+ ),
646
+ showHeader ? /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-quick__header" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-quick__title" }, controller.step === "identifier" ? title : t("auth.quickCodeTitle", { length: controller.config.code.length })), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-quick__description" }, controller.step === "identifier" ? description : t("auth.codeSent", { identifier: controller.identifierValue }))) : null,
573
647
  /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), controller.step === "identifier" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
574
648
  import_internal.IdentifierInput,
575
649
  {
@@ -591,6 +665,7 @@ function QuickSignIn({
591
665
  )) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
592
666
  import_internal.VerificationCodeInput,
593
667
  {
668
+ config: controller.config,
594
669
  codeLength: controller.config.code.length,
595
670
  countdown: controller.countdown,
596
671
  error: controller.fieldErrors.code,
@@ -686,6 +761,7 @@ function IdentifierBinding({
686
761
  title,
687
762
  tokens
688
763
  }) {
764
+ const t = (0, import_react2.useAuthTranslation)(config);
689
765
  const controller = (0, import_react2.useIdentifierBindingController)({
690
766
  action,
691
767
  config,
@@ -696,28 +772,35 @@ function IdentifierBinding({
696
772
  requireReauthentication,
697
773
  services
698
774
  });
699
- const label = (0, import_identifier.identifierLabel)(identifierType);
775
+ const label = (0, import_identifier.identifierLabel)(identifierType, controller.config);
700
776
  return /* @__PURE__ */ import_react.default.createElement(
701
777
  import_internal.AuthPanel,
702
778
  {
703
779
  className,
704
- description: action === "change" && currentDisplayValue ? `当前${label}:${currentDisplayValue}` : `验证新的${label}后完成${action === "bind" ? "绑定" : "更换"}`,
780
+ description: action === "change" && currentDisplayValue ? t("auth.currentIdentifier", { label, value: currentDisplayValue }) : t(action === "bind" ? "auth.bindDescription" : "auth.replaceDescription", { label }),
705
781
  style: useAuthStyle(tokens, style),
706
782
  surface,
707
783
  testID,
708
- title: title ?? `${action === "bind" ? "绑定" : "更换"}${label}`
784
+ title: title === void 0 ? t(action === "bind" ? "auth.bindTitle" : "auth.replaceTitle", { label }) : title
709
785
  },
710
- /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), controller.shouldReauthenticate ? /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.currentPassword, label: "当前密码" }, /* @__PURE__ */ import_react.default.createElement(
711
- import_inputItem.InputItem,
786
+ /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), controller.shouldReauthenticate ? /* @__PURE__ */ import_react.default.createElement(
787
+ import_internal.AuthField,
712
788
  {
713
789
  error: controller.fieldErrors.currentPassword,
714
- onChange: controller.setCurrentPassword,
715
- placeholder: "请输入当前密码",
716
- size: "large",
717
- type: "password",
718
- value: controller.currentPassword
719
- }
720
- )) : null, /* @__PURE__ */ import_react.default.createElement(
790
+ label: t("auth.currentPassword")
791
+ },
792
+ /* @__PURE__ */ import_react.default.createElement(
793
+ import_inputItem.InputItem,
794
+ {
795
+ error: Boolean(controller.fieldErrors.currentPassword),
796
+ onChange: controller.setCurrentPassword,
797
+ placeholder: t("auth.enter", { label: t("auth.currentPassword") }),
798
+ size: "large",
799
+ type: "password",
800
+ value: controller.currentPassword
801
+ }
802
+ )
803
+ ) : null, /* @__PURE__ */ import_react.default.createElement(
721
804
  import_internal.IdentifierInput,
722
805
  {
723
806
  config: controller.config,
@@ -729,6 +812,7 @@ function IdentifierBinding({
729
812
  ), /* @__PURE__ */ import_react.default.createElement(
730
813
  import_internal.VerificationCodeInput,
731
814
  {
815
+ config: controller.config,
732
816
  codeLength: controller.config.code.length,
733
817
  countdown: controller.countdown,
734
818
  error: controller.fieldErrors.code,
@@ -737,22 +821,33 @@ function IdentifierBinding({
737
821
  sending: controller.sendingCode,
738
822
  value: controller.code
739
823
  }
740
- ), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, onCancel ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onCancel, size: "small", type: "outline" }, "取消") : null, /* @__PURE__ */ import_react.default.createElement(
824
+ ), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, onCancel ? /* @__PURE__ */ import_react.default.createElement(
825
+ import_button.Button,
826
+ {
827
+ onClick: onCancel,
828
+ style: { alignSelf: "center" },
829
+ size: "small",
830
+ type: "link",
831
+ compact: true,
832
+ disabled: controller.submitting
833
+ },
834
+ t("auth.cancel")
835
+ ) : null, /* @__PURE__ */ import_react.default.createElement(
741
836
  import_button.Button,
742
837
  {
743
838
  loading: controller.submitting,
744
839
  onClick: () => void controller.submit(),
745
- size: "small"
840
+ size: "large",
841
+ block: true
746
842
  },
747
- "确认",
748
- action === "bind" ? "绑定" : "更换"
843
+ t(action === "bind" ? "auth.confirmBind" : "auth.confirmReplace")
749
844
  )))
750
845
  );
751
846
  }
752
847
  function ChangePassword({
753
848
  className,
754
849
  config,
755
- description = "更新当前账号的登录密码",
850
+ description,
756
851
  onAuthError,
757
852
  onCancel,
758
853
  onReauthenticationRequired,
@@ -762,9 +857,10 @@ function ChangePassword({
762
857
  style,
763
858
  surface,
764
859
  testID,
765
- title = "修改密码",
860
+ title,
766
861
  tokens
767
862
  }) {
863
+ const t = (0, import_react2.useAuthTranslation)(config);
768
864
  const controller = (0, import_react2.useChangePasswordController)({
769
865
  config,
770
866
  onAuthError,
@@ -773,6 +869,8 @@ function ChangePassword({
773
869
  requireCurrentPassword,
774
870
  services
775
871
  });
872
+ if (description === void 0) description = t("auth.changePasswordDescription");
873
+ if (title === void 0) title = t("auth.changePassword");
776
874
  return /* @__PURE__ */ import_react.default.createElement(
777
875
  import_internal.AuthPanel,
778
876
  {
@@ -783,51 +881,77 @@ function ChangePassword({
783
881
  testID,
784
882
  title
785
883
  },
786
- /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), controller.requireCurrentPassword ? /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.currentPassword, label: "当前密码" }, /* @__PURE__ */ import_react.default.createElement(
787
- import_inputItem.InputItem,
884
+ /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form" }, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error), controller.requireCurrentPassword ? /* @__PURE__ */ import_react.default.createElement(
885
+ import_internal.AuthField,
788
886
  {
789
887
  error: controller.fieldErrors.currentPassword,
790
- onChange: controller.setCurrentPassword,
791
- placeholder: "请输入当前密码",
792
- size: "large",
793
- type: "password",
794
- value: controller.currentPassword
795
- }
796
- )) : null, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.newPassword, label: "新密码" }, /* @__PURE__ */ import_react.default.createElement(
888
+ label: t("auth.currentPassword")
889
+ },
890
+ /* @__PURE__ */ import_react.default.createElement(
891
+ import_inputItem.InputItem,
892
+ {
893
+ error: Boolean(controller.fieldErrors.currentPassword),
894
+ onChange: controller.setCurrentPassword,
895
+ placeholder: t("auth.enter", { label: t("auth.currentPassword") }),
896
+ size: "large",
897
+ type: "password",
898
+ value: controller.currentPassword
899
+ }
900
+ )
901
+ ) : null, /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.newPassword, label: t("auth.newPassword") }, /* @__PURE__ */ import_react.default.createElement(
797
902
  import_inputItem.InputItem,
798
903
  {
799
- error: controller.fieldErrors.newPassword,
904
+ error: Boolean(controller.fieldErrors.newPassword),
800
905
  onChange: controller.setNewPassword,
801
- placeholder: `至少 ${controller.config.password.minLength} 位`,
906
+ placeholder: t("auth.passwordHint", { length: controller.config.password.minLength }),
802
907
  size: "large",
803
908
  type: "password",
804
909
  value: controller.newPassword
805
910
  }
806
- )), /* @__PURE__ */ import_react.default.createElement(import_internal.AuthField, { error: controller.fieldErrors.confirmPassword, label: "确认新密码" }, /* @__PURE__ */ import_react.default.createElement(
807
- import_inputItem.InputItem,
911
+ )), /* @__PURE__ */ import_react.default.createElement(
912
+ import_internal.AuthField,
808
913
  {
809
914
  error: controller.fieldErrors.confirmPassword,
810
- onChange: controller.setConfirmPassword,
811
- placeholder: "请再次输入新密码",
812
- size: "large",
813
- type: "password",
814
- value: controller.confirmPassword
815
- }
816
- )), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, onCancel ? /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: onCancel, size: "small", type: "outline" }, "取消") : null, /* @__PURE__ */ import_react.default.createElement(
915
+ label: t("auth.confirmNewPassword")
916
+ },
917
+ /* @__PURE__ */ import_react.default.createElement(
918
+ import_inputItem.InputItem,
919
+ {
920
+ error: Boolean(controller.fieldErrors.confirmPassword),
921
+ onChange: controller.setConfirmPassword,
922
+ placeholder: t("auth.repeatNewPassword"),
923
+ size: "large",
924
+ type: "password",
925
+ value: controller.confirmPassword
926
+ }
927
+ )
928
+ ), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-form__actions" }, onCancel ? /* @__PURE__ */ import_react.default.createElement(
929
+ import_button.Button,
930
+ {
931
+ onClick: onCancel,
932
+ style: { alignSelf: "center" },
933
+ size: "small",
934
+ type: "link",
935
+ compact: true,
936
+ disabled: controller.submitting
937
+ },
938
+ t("auth.cancel")
939
+ ) : null, /* @__PURE__ */ import_react.default.createElement(
817
940
  import_button.Button,
818
941
  {
819
942
  loading: controller.submitting,
820
943
  onClick: () => void controller.submit(),
821
- size: "small"
944
+ size: "large",
945
+ block: true
822
946
  },
823
- "确认修改"
947
+ t("auth.confirmChange")
824
948
  )))
825
949
  );
826
950
  }
827
951
  function AccountSecurity({
828
952
  className,
829
953
  config,
830
- description = "管理可用于登录和找回账号的安全信息",
954
+ description,
831
955
  onAuthError,
832
956
  onReauthenticationRequired,
833
957
  onStateChange,
@@ -835,10 +959,11 @@ function AccountSecurity({
835
959
  state,
836
960
  style,
837
961
  testID,
838
- title = "账号安全",
962
+ title,
839
963
  tokens
840
964
  }) {
841
965
  var _a, _b;
966
+ const t = (0, import_react2.useAuthTranslation)(config);
842
967
  const controller = (0, import_react2.useAccountSecurityController)({
843
968
  config,
844
969
  onAuthError,
@@ -847,6 +972,8 @@ function AccountSecurity({
847
972
  services,
848
973
  state
849
974
  });
975
+ if (description === void 0) description = t("auth.securityDescription");
976
+ if (title === void 0) title = t("auth.security");
850
977
  const [dialog, setDialog] = (0, import_react.useState)();
851
978
  const close = () => setDialog(void 0);
852
979
  const complete = async () => {
@@ -862,16 +989,19 @@ function AccountSecurity({
862
989
  },
863
990
  /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__header" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__title" }, title), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__description" }, description)),
864
991
  /* @__PURE__ */ import_react.default.createElement(import_internal.AuthError, null, controller.error),
865
- controller.loading ? /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__loading" }, "正在加载…") : null,
992
+ controller.loading ? /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__loading" }, t("auth.loading")) : null,
866
993
  /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__list" }, controller.config.accountSecurity.identifiers.map((type) => {
867
994
  var _a2;
868
995
  const binding = (_a2 = controller.state) == null ? void 0 : _a2[type];
869
996
  const action = (binding == null ? void 0 : binding.bound) ? "change" : "bind";
870
- return /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__row", key: type }, /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__content" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__label" }, (0, import_identifier.identifierLabel)(type)), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__value" }, (binding == null ? void 0 : binding.bound) ? `已绑定${binding.displayValue ? `,${binding.displayValue}` : ""}` : "未绑定,绑定后可用于登录")), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: () => setDialog({ action, type }), size: "small", type: "outline" }, action === "bind" ? "绑定" : "更换"));
871
- }), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__row" }, /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__content" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__label" }, "密码"), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__value" }, ((_a = controller.state) == null ? void 0 : _a.password.set) ? "已设置,可通过密码登录" : "未设置")), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: () => setDialog({ action: "password" }), size: "small", type: "outline" }, "修改"))),
997
+ return /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__row", key: type }, /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__content" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__label" }, (0, import_identifier.identifierLabel)(type, controller.config)), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__value" }, (binding == null ? void 0 : binding.bound) ? binding.displayValue ? t("auth.linkedValue", { value: binding.displayValue }) : t("auth.linked") : t("auth.notLinked"))), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: () => setDialog({ action, type }), size: "small", type: "outline" }, action === "bind" ? t("auth.bind") : t("auth.replace")));
998
+ }), /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__row" }, /* @__PURE__ */ import_react.default.createElement(import_components.View, { className: "x-taro-auth-security__content" }, /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__label" }, t("auth.password")), /* @__PURE__ */ import_react.default.createElement(import_components.Text, { className: "x-taro-auth-security__value" }, ((_a = controller.state) == null ? void 0 : _a.password.set) ? t("auth.passwordSet") : t("auth.notSet"))), /* @__PURE__ */ import_react.default.createElement(import_button.Button, { onClick: () => setDialog({ action: "password" }), size: "small", type: "outline" }, t("auth.edit")))),
872
999
  /* @__PURE__ */ import_react.default.createElement(
873
1000
  import_modal.Modal,
874
1001
  {
1002
+ title: (dialog == null ? void 0 : dialog.action) === "password" ? t("auth.changePassword") : (dialog == null ? void 0 : dialog.type) ? t(dialog.action === "bind" ? "auth.bindTitle" : "auth.replaceTitle", {
1003
+ label: (0, import_identifier.identifierLabel)(dialog.type, controller.config)
1004
+ }) : void 0,
875
1005
  body: (dialog == null ? void 0 : dialog.action) === "password" ? /* @__PURE__ */ import_react.default.createElement(
876
1006
  ChangePassword,
877
1007
  {
@@ -879,7 +1009,8 @@ function AccountSecurity({
879
1009
  onCancel: close,
880
1010
  onSuccess: () => void complete(),
881
1011
  services,
882
- surface: "plain"
1012
+ surface: "plain",
1013
+ title: null
883
1014
  }
884
1015
  ) : (dialog == null ? void 0 : dialog.type) ? /* @__PURE__ */ import_react.default.createElement(
885
1016
  IdentifierBinding,
@@ -891,7 +1022,8 @@ function AccountSecurity({
891
1022
  onCancel: close,
892
1023
  onSuccess: () => void complete(),
893
1024
  services,
894
- surface: "plain"
1025
+ surface: "plain",
1026
+ title: null
895
1027
  }
896
1028
  ) : null,
897
1029
  closeIcon: true,