@aws-amplify/ui-react-native 1.2.20 → 1.2.22

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 (113) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/Authenticator/Authenticator.d.ts +101 -148
  3. package/dist/Authenticator/Authenticator.js +2 -3
  4. package/dist/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.d.ts +13 -2
  5. package/dist/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.js +4 -3
  6. package/dist/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.d.ts +13 -2
  7. package/dist/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.js +4 -3
  8. package/dist/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.d.ts +13 -2
  9. package/dist/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.js +4 -3
  10. package/dist/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.d.ts +13 -2
  11. package/dist/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.js +4 -3
  12. package/dist/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.d.ts +13 -2
  13. package/dist/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.js +4 -3
  14. package/dist/Authenticator/Defaults/ResetPassword/ResetPassword.d.ts +13 -2
  15. package/dist/Authenticator/Defaults/ResetPassword/ResetPassword.js +4 -3
  16. package/dist/Authenticator/Defaults/SetupTOTP/SetupTOTP.d.ts +13 -2
  17. package/dist/Authenticator/Defaults/SetupTOTP/SetupTOTP.js +4 -3
  18. package/dist/Authenticator/Defaults/SignIn/SignIn.d.ts +13 -2
  19. package/dist/Authenticator/Defaults/SignIn/SignIn.js +4 -3
  20. package/dist/Authenticator/Defaults/SignUp/SignUp.d.ts +13 -2
  21. package/dist/Authenticator/Defaults/SignUp/SignUp.js +4 -3
  22. package/dist/Authenticator/Defaults/VerifyUser/VerifyUser.d.ts +13 -2
  23. package/dist/Authenticator/Defaults/VerifyUser/VerifyUser.js +4 -3
  24. package/dist/Authenticator/Defaults/types.d.ts +21 -20
  25. package/dist/Authenticator/common/DefaultContent/styles.js +1 -2
  26. package/dist/Authenticator/common/DefaultContent/types.d.ts +1 -1
  27. package/dist/Authenticator/common/DefaultFormFields/DefaultRadioFormFields.d.ts +7 -3
  28. package/dist/Authenticator/common/DefaultFormFields/DefaultRadioFormFields.js +4 -3
  29. package/dist/Authenticator/common/DefaultFormFields/DefaultTextFormFields.d.ts +6 -2
  30. package/dist/Authenticator/common/DefaultFormFields/DefaultTextFormFields.js +3 -3
  31. package/dist/Authenticator/common/DefaultFormFields/types.d.ts +12 -3
  32. package/dist/Authenticator/hooks/types.d.ts +3 -2
  33. package/dist/Authenticator/hooks/useFieldValues/types.d.ts +4 -1
  34. package/dist/Authenticator/hooks/useFieldValues/useFieldValues.d.ts +1 -1
  35. package/dist/Authenticator/hooks/useFieldValues/useFieldValues.js +21 -3
  36. package/dist/Authenticator/hooks/useFieldValues/utils.d.ts +10 -1
  37. package/dist/Authenticator/hooks/useFieldValues/utils.js +32 -2
  38. package/dist/primitives/Heading/styles.js +5 -5
  39. package/dist/primitives/Label/styles.js +2 -2
  40. package/dist/primitives/TextField/TextField.js +2 -1
  41. package/dist/primitives/TextField/styles.js +6 -3
  42. package/dist/primitives/TextField/types.d.ts +1 -0
  43. package/dist/theme/createTheme.js +24 -18
  44. package/dist/theme/types.d.ts +1 -1
  45. package/dist/version.d.ts +1 -1
  46. package/dist/version.js +1 -1
  47. package/jest.config.js +1 -0
  48. package/package.json +5 -5
  49. package/src/Authenticator/Authenticator.tsx +2 -6
  50. package/src/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.tsx +7 -3
  51. package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/__snapshots__/ConfirmResetPassword.spec.tsx.snap +34 -30
  52. package/src/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.tsx +7 -3
  53. package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/ConfirmSignIn.spec.tsx +1 -0
  54. package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/__snapshots__/ConfirmSignIn.spec.tsx.snap +14 -14
  55. package/src/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.tsx +7 -3
  56. package/src/Authenticator/Defaults/ConfirmSignUp/__tests__/ConfirmSignUp.spec.tsx +1 -0
  57. package/src/Authenticator/Defaults/ConfirmSignUp/__tests__/__snapshots__/ConfirmSignUp.spec.tsx.snap +12 -15
  58. package/src/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.tsx +7 -3
  59. package/src/Authenticator/Defaults/ConfirmVerifyUser/__tests__/ConfirmVerifyUser.spec.tsx +1 -0
  60. package/src/Authenticator/Defaults/ConfirmVerifyUser/__tests__/__snapshots__/ConfirmVerifyUser.spec.tsx.snap +6 -9
  61. package/src/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.tsx +7 -3
  62. package/src/Authenticator/Defaults/ForceNewPassword/__tests__/__snapshots__/ForceNewPassword.spec.tsx.snap +13 -10
  63. package/src/Authenticator/Defaults/ResetPassword/ResetPassword.tsx +7 -3
  64. package/src/Authenticator/Defaults/ResetPassword/__tests__/ResetPassword.spec.tsx +1 -0
  65. package/src/Authenticator/Defaults/ResetPassword/__tests__/__snapshots__/ResetPassword.spec.tsx.snap +14 -14
  66. package/src/Authenticator/Defaults/SetupTOTP/SetupTOTP.tsx +7 -3
  67. package/src/Authenticator/Defaults/SetupTOTP/__tests__/SetupTOTP.spec.tsx +1 -0
  68. package/src/Authenticator/Defaults/SetupTOTP/__tests__/__snapshots__/SetupTOTP.spec.tsx.snap +22 -22
  69. package/src/Authenticator/Defaults/SignIn/SignIn.tsx +7 -3
  70. package/src/Authenticator/Defaults/SignIn/__tests__/SignIn.spec.tsx +1 -0
  71. package/src/Authenticator/Defaults/SignIn/__tests__/__snapshots__/SignIn.spec.tsx.snap +36 -33
  72. package/src/Authenticator/Defaults/SignUp/SignUp.tsx +7 -3
  73. package/src/Authenticator/Defaults/SignUp/__tests__/__snapshots__/SignUp.spec.tsx.snap +111 -96
  74. package/src/Authenticator/Defaults/VerifyUser/VerifyUser.tsx +7 -3
  75. package/src/Authenticator/Defaults/VerifyUser/__tests__/VerifyUser.spec.tsx +1 -0
  76. package/src/Authenticator/Defaults/VerifyUser/__tests__/__snapshots__/VerifyUser.spec.tsx.snap +16 -18
  77. package/src/Authenticator/Defaults/types.ts +63 -49
  78. package/src/Authenticator/__tests__/Authenticator.spec.tsx +16 -19
  79. package/src/Authenticator/__tests__/__snapshots__/Authenticator.spec.tsx.snap +1 -9
  80. package/src/Authenticator/__tests__/withAuthenticator.spec.tsx +1 -1
  81. package/src/Authenticator/common/DefaultContent/styles.ts +1 -2
  82. package/src/Authenticator/common/DefaultContent/types.ts +1 -4
  83. package/src/Authenticator/common/DefaultFormFields/DefaultRadioFormFields.tsx +8 -6
  84. package/src/Authenticator/common/DefaultFormFields/DefaultTextFormFields.tsx +10 -7
  85. package/src/Authenticator/common/DefaultFormFields/types.ts +15 -5
  86. package/src/Authenticator/common/DefaultHeader/__tests__/__snapshots__/DefaultHeader.spec.tsx.snap +1 -1
  87. package/src/Authenticator/common/FederatedProviderButton/__tests__/__snapshots__/FederatedProviderButton.spec.tsx.snap +4 -4
  88. package/src/Authenticator/common/FederatedProviderButtons/__tests__/__snapshots__/FederatedProviderButtons.spec.tsx.snap +4 -4
  89. package/src/Authenticator/hooks/types.ts +3 -0
  90. package/src/Authenticator/hooks/useFieldValues/__tests__/useFieldValues.spec.ts +75 -2
  91. package/src/Authenticator/hooks/useFieldValues/__tests__/utils.spec.ts +67 -1
  92. package/src/Authenticator/hooks/useFieldValues/types.ts +5 -0
  93. package/src/Authenticator/hooks/useFieldValues/useFieldValues.ts +26 -1
  94. package/src/Authenticator/hooks/useFieldValues/utils.ts +44 -1
  95. package/src/primitives/Checkbox/__tests__/__snapshots__/Checkbox.spec.tsx.snap +14 -14
  96. package/src/primitives/Divider/__tests__/__snapshots__/Divider.spec.tsx.snap +4 -4
  97. package/src/primitives/Heading/__tests__/__snapshots__/Heading.spec.tsx.snap +7 -7
  98. package/src/primitives/Heading/styles.ts +5 -5
  99. package/src/primitives/Label/__tests__/__snapshots__/Label.spec.tsx.snap +8 -8
  100. package/src/primitives/Label/styles.ts +2 -2
  101. package/src/primitives/PasswordField/__tests__/__snapshots__/PasswordField.spec.tsx.snap +25 -20
  102. package/src/primitives/PhoneNumberField/__tests__/__snapshots__/PhoneNumberField.spec.tsx.snap +6 -0
  103. package/src/primitives/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +14 -14
  104. package/src/primitives/RadioGroup/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +48 -48
  105. package/src/primitives/TextField/TextField.tsx +2 -1
  106. package/src/primitives/TextField/__tests__/TextField.spec.tsx +57 -8
  107. package/src/primitives/TextField/__tests__/__snapshots__/TextField.spec.tsx.snap +61 -55
  108. package/src/primitives/TextField/styles.ts +6 -3
  109. package/src/primitives/TextField/types.ts +1 -0
  110. package/src/theme/__tests__/createTheme.spec.ts +48 -0
  111. package/src/theme/createTheme.ts +44 -21
  112. package/src/theme/types.ts +17 -16
  113. package/src/version.ts +1 -1
@@ -9,7 +9,7 @@ import {
9
9
  } from '../../common';
10
10
  import { useFieldValues } from '../../hooks';
11
11
 
12
- import { DefaultConfirmSignUpComponent } from '../types';
12
+ import { DefaultConfirmSignUpProps } from '../types';
13
13
 
14
14
  const COMPONENT_NAME = 'ConfirmSignUp';
15
15
 
@@ -21,7 +21,7 @@ const {
21
21
  getResendCodeText,
22
22
  } = authenticatorTextUtil;
23
23
 
24
- const ConfirmSignUp: DefaultConfirmSignUpComponent = ({
24
+ const ConfirmSignUp = ({
25
25
  codeDeliveryDetails,
26
26
  fields,
27
27
  handleBlur,
@@ -29,11 +29,13 @@ const ConfirmSignUp: DefaultConfirmSignUpComponent = ({
29
29
  handleSubmit,
30
30
  isPending,
31
31
  resendCode,
32
+ validationErrors,
32
33
  ...rest
33
- }) => {
34
+ }: DefaultConfirmSignUpProps): JSX.Element => {
34
35
  const {
35
36
  disableFormSubmit: disabled,
36
37
  fields: fieldsWithHandlers,
38
+ fieldValidationErrors,
37
39
  handleFormSubmit,
38
40
  } = useFieldValues({
39
41
  componentName: COMPONENT_NAME,
@@ -41,6 +43,7 @@ const ConfirmSignUp: DefaultConfirmSignUpComponent = ({
41
43
  handleBlur,
42
44
  handleChange,
43
45
  handleSubmit,
46
+ validationErrors,
44
47
  });
45
48
 
46
49
  const headerText = getDeliveryMethodText(codeDeliveryDetails);
@@ -74,6 +77,7 @@ const ConfirmSignUp: DefaultConfirmSignUpComponent = ({
74
77
  headerText={headerText}
75
78
  fields={fieldsWithHandlers}
76
79
  isPending={isPending}
80
+ validationErrors={fieldValidationErrors}
77
81
  />
78
82
  );
79
83
  };
@@ -16,6 +16,7 @@ const props = {
16
16
  handleBlur: jest.fn(),
17
17
  handleChange: jest.fn(),
18
18
  handleSubmit: jest.fn(),
19
+ hasValidationErrors: false,
19
20
  Header: ConfirmSignUp.Header,
20
21
  isPending: false,
21
22
  resendCode: jest.fn(),
@@ -11,7 +11,7 @@ Array [
11
11
  },
12
12
  Object {
13
13
  "fontSize": 24,
14
- "fontWeight": "300",
14
+ "fontWeight": "500",
15
15
  "lineHeight": 36,
16
16
  },
17
17
  Object {
@@ -28,9 +28,9 @@ Array [
28
28
  style={
29
29
  Array [
30
30
  Object {
31
- "fontSize": 14,
31
+ "fontSize": 16,
32
32
  "fontWeight": "400",
33
- "lineHeight": 21,
33
+ "lineHeight": 24,
34
34
  },
35
35
  Object {
36
36
  "color": "hsl(210, 50%, 10%)",
@@ -82,8 +82,7 @@ Array [
82
82
  },
83
83
  undefined,
84
84
  Object {
85
- "marginHorizontal": 16,
86
- "marginVertical": 12,
85
+ "margin": 12,
87
86
  },
88
87
  ]
89
88
  }
@@ -168,7 +167,7 @@ Array [
168
167
  },
169
168
  Object {
170
169
  "fontSize": 24,
171
- "fontWeight": "300",
170
+ "fontWeight": "500",
172
171
  "lineHeight": 36,
173
172
  },
174
173
  Object {
@@ -185,9 +184,9 @@ Array [
185
184
  style={
186
185
  Array [
187
186
  Object {
188
- "fontSize": 14,
187
+ "fontSize": 16,
189
188
  "fontWeight": "400",
190
- "lineHeight": 21,
189
+ "lineHeight": 24,
191
190
  },
192
191
  Object {
193
192
  "color": "hsl(210, 50%, 10%)",
@@ -239,8 +238,7 @@ Array [
239
238
  },
240
239
  undefined,
241
240
  Object {
242
- "marginHorizontal": 16,
243
- "marginVertical": 12,
241
+ "margin": 12,
244
242
  },
245
243
  ]
246
244
  }
@@ -325,7 +323,7 @@ Array [
325
323
  },
326
324
  Object {
327
325
  "fontSize": 24,
328
- "fontWeight": "300",
326
+ "fontWeight": "500",
329
327
  "lineHeight": 36,
330
328
  },
331
329
  Object {
@@ -342,9 +340,9 @@ Array [
342
340
  style={
343
341
  Array [
344
342
  Object {
345
- "fontSize": 14,
343
+ "fontSize": 16,
346
344
  "fontWeight": "400",
347
- "lineHeight": 21,
345
+ "lineHeight": 24,
348
346
  },
349
347
  Object {
350
348
  "color": "hsl(210, 50%, 10%)",
@@ -455,8 +453,7 @@ Array [
455
453
  },
456
454
  undefined,
457
455
  Object {
458
- "marginHorizontal": 16,
459
- "marginVertical": 12,
456
+ "margin": 12,
460
457
  },
461
458
  ]
462
459
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from '../../common';
10
10
  import { useFieldValues } from '../../hooks';
11
11
 
12
- import { DefaultConfirmVerifyUserComponent } from '../types';
12
+ import { DefaultConfirmVerifyUserProps } from '../types';
13
13
 
14
14
  const COMPONENT_NAME = 'ConfirmVerifyUser';
15
15
 
@@ -20,18 +20,20 @@ const {
20
20
  getSubmittingText,
21
21
  } = authenticatorTextUtil;
22
22
 
23
- const ConfirmVerifyUser: DefaultConfirmVerifyUserComponent = ({
23
+ const ConfirmVerifyUser = ({
24
24
  fields,
25
25
  handleBlur,
26
26
  handleChange,
27
27
  handleSubmit,
28
28
  isPending,
29
29
  skipVerification,
30
+ validationErrors,
30
31
  ...rest
31
- }) => {
32
+ }: DefaultConfirmVerifyUserProps): JSX.Element => {
32
33
  const {
33
34
  disableFormSubmit: disabled,
34
35
  fields: fieldsWithHandlers,
36
+ fieldValidationErrors,
35
37
  handleFormSubmit,
36
38
  } = useFieldValues({
37
39
  componentName: COMPONENT_NAME,
@@ -39,6 +41,7 @@ const ConfirmVerifyUser: DefaultConfirmVerifyUserComponent = ({
39
41
  handleBlur,
40
42
  handleChange,
41
43
  handleSubmit,
44
+ validationErrors,
42
45
  });
43
46
 
44
47
  const headerText = getAccountRecoveryInfoText();
@@ -70,6 +73,7 @@ const ConfirmVerifyUser: DefaultConfirmVerifyUserComponent = ({
70
73
  headerText={headerText}
71
74
  fields={fieldsWithHandlers}
72
75
  isPending={isPending}
76
+ validationErrors={fieldValidationErrors}
73
77
  />
74
78
  );
75
79
  };
@@ -18,6 +18,7 @@ const props = {
18
18
  handleBlur: jest.fn(),
19
19
  handleChange: jest.fn(),
20
20
  handleSubmit: jest.fn(),
21
+ hasValidationErrors: false,
21
22
  Header: ConfirmVerifyUser.Header,
22
23
  isPending: false,
23
24
  skipVerification: jest.fn(),
@@ -11,7 +11,7 @@ Array [
11
11
  },
12
12
  Object {
13
13
  "fontSize": 24,
14
- "fontWeight": "300",
14
+ "fontWeight": "500",
15
15
  "lineHeight": 36,
16
16
  },
17
17
  Object {
@@ -61,8 +61,7 @@ Array [
61
61
  },
62
62
  undefined,
63
63
  Object {
64
- "marginHorizontal": 16,
65
- "marginVertical": 12,
64
+ "margin": 12,
66
65
  },
67
66
  ]
68
67
  }
@@ -156,7 +155,7 @@ Array [
156
155
  },
157
156
  Object {
158
157
  "fontSize": 24,
159
- "fontWeight": "300",
158
+ "fontWeight": "500",
160
159
  "lineHeight": 36,
161
160
  },
162
161
  Object {
@@ -206,8 +205,7 @@ Array [
206
205
  },
207
206
  undefined,
208
207
  Object {
209
- "marginHorizontal": 16,
210
- "marginVertical": 12,
208
+ "margin": 12,
211
209
  },
212
210
  ]
213
211
  }
@@ -301,7 +299,7 @@ Array [
301
299
  },
302
300
  Object {
303
301
  "fontSize": 24,
304
- "fontWeight": "300",
302
+ "fontWeight": "500",
305
303
  "lineHeight": 36,
306
304
  },
307
305
  Object {
@@ -410,8 +408,7 @@ Array [
410
408
  },
411
409
  undefined,
412
410
  Object {
413
- "marginHorizontal": 16,
414
- "marginVertical": 12,
411
+ "margin": 12,
415
412
  },
416
413
  ]
417
414
  }
@@ -9,14 +9,14 @@ import {
9
9
  } from '../../common';
10
10
  import { useFieldValues } from '../../hooks';
11
11
 
12
- import { DefaultForceNewPasswordComponent } from '../types';
12
+ import { DefaultForceNewPasswordProps } from '../types';
13
13
 
14
14
  const COMPONENT_NAME = 'ForceNewPassword';
15
15
 
16
16
  const { getChangePasswordText, getChangingText, getBackToSignInText } =
17
17
  authenticatorTextUtil;
18
18
 
19
- const ForceNewPassword: DefaultForceNewPasswordComponent = ({
19
+ const ForceNewPassword = ({
20
20
  fields,
21
21
  handleBlur,
22
22
  handleChange,
@@ -24,11 +24,13 @@ const ForceNewPassword: DefaultForceNewPasswordComponent = ({
24
24
  hasValidationErrors,
25
25
  isPending,
26
26
  toSignIn,
27
+ validationErrors,
27
28
  ...rest
28
- }) => {
29
+ }: DefaultForceNewPasswordProps): JSX.Element => {
29
30
  const {
30
31
  disableFormSubmit,
31
32
  fields: fieldsWithHandlers,
33
+ fieldValidationErrors,
32
34
  handleFormSubmit,
33
35
  } = useFieldValues({
34
36
  componentName: COMPONENT_NAME,
@@ -36,6 +38,7 @@ const ForceNewPassword: DefaultForceNewPasswordComponent = ({
36
38
  handleBlur,
37
39
  handleChange,
38
40
  handleSubmit,
41
+ validationErrors,
39
42
  });
40
43
 
41
44
  const disabled = hasValidationErrors || disableFormSubmit;
@@ -70,6 +73,7 @@ const ForceNewPassword: DefaultForceNewPasswordComponent = ({
70
73
  headerText={headerText}
71
74
  fields={fieldsWithHandlers}
72
75
  isPending={isPending}
76
+ validationErrors={fieldValidationErrors}
73
77
  />
74
78
  );
75
79
  };
@@ -11,7 +11,7 @@ Array [
11
11
  },
12
12
  Object {
13
13
  "fontSize": 24,
14
- "fontWeight": "300",
14
+ "fontWeight": "500",
15
15
  "lineHeight": 36,
16
16
  },
17
17
  Object {
@@ -35,6 +35,7 @@ Array [
35
35
  Array [
36
36
  Object {
37
37
  "alignItems": "flex-start",
38
+ "marginBottom": 8,
38
39
  },
39
40
  Array [
40
41
  Object {},
@@ -79,6 +80,7 @@ Array [
79
80
  "color": "hsl(210, 50%, 10%)",
80
81
  "flexGrow": 1,
81
82
  "fontSize": 16,
83
+ "paddingHorizontal": 4,
82
84
  "paddingVertical": 12,
83
85
  },
84
86
  Object {},
@@ -242,8 +244,7 @@ Array [
242
244
  },
243
245
  undefined,
244
246
  Object {
245
- "marginHorizontal": 16,
246
- "marginVertical": 12,
247
+ "margin": 12,
247
248
  },
248
249
  ]
249
250
  }
@@ -337,7 +338,7 @@ Array [
337
338
  },
338
339
  Object {
339
340
  "fontSize": 24,
340
- "fontWeight": "300",
341
+ "fontWeight": "500",
341
342
  "lineHeight": 36,
342
343
  },
343
344
  Object {
@@ -361,6 +362,7 @@ Array [
361
362
  Array [
362
363
  Object {
363
364
  "alignItems": "flex-start",
365
+ "marginBottom": 8,
364
366
  },
365
367
  Array [
366
368
  Object {},
@@ -405,6 +407,7 @@ Array [
405
407
  "color": "hsl(210, 50%, 10%)",
406
408
  "flexGrow": 1,
407
409
  "fontSize": 16,
410
+ "paddingHorizontal": 4,
408
411
  "paddingVertical": 12,
409
412
  },
410
413
  Object {},
@@ -509,8 +512,7 @@ Array [
509
512
  },
510
513
  undefined,
511
514
  Object {
512
- "marginHorizontal": 16,
513
- "marginVertical": 12,
515
+ "margin": 12,
514
516
  },
515
517
  ]
516
518
  }
@@ -604,7 +606,7 @@ Array [
604
606
  },
605
607
  Object {
606
608
  "fontSize": 24,
607
- "fontWeight": "300",
609
+ "fontWeight": "500",
608
610
  "lineHeight": 36,
609
611
  },
610
612
  Object {
@@ -628,6 +630,7 @@ Array [
628
630
  Array [
629
631
  Object {
630
632
  "alignItems": "flex-start",
633
+ "marginBottom": 8,
631
634
  },
632
635
  Array [
633
636
  Object {},
@@ -644,7 +647,7 @@ Array [
644
647
  style={
645
648
  Object {
646
649
  "alignItems": "center",
647
- "borderColor": "hsl(210, 10%, 58%)",
650
+ "borderColor": "hsl(0, 95%, 30%)",
648
651
  "borderRadius": 4,
649
652
  "borderWidth": 1,
650
653
  "flexDirection": "row",
@@ -673,6 +676,7 @@ Array [
673
676
  "color": "hsl(210, 50%, 10%)",
674
677
  "flexGrow": 1,
675
678
  "fontSize": 16,
679
+ "paddingHorizontal": 4,
676
680
  "paddingVertical": 12,
677
681
  },
678
682
  Object {},
@@ -808,8 +812,7 @@ Array [
808
812
  },
809
813
  undefined,
810
814
  Object {
811
- "marginHorizontal": 16,
812
- "marginVertical": 12,
815
+ "margin": 12,
813
816
  },
814
817
  ]
815
818
  }
@@ -9,7 +9,7 @@ import {
9
9
  } from '../../common';
10
10
  import { useFieldValues } from '../../hooks';
11
11
 
12
- import { DefaultResetPasswordComponent } from '../types';
12
+ import { DefaultResetPasswordProps } from '../types';
13
13
 
14
14
  const COMPONENT_NAME = 'ResetPassword';
15
15
  const {
@@ -19,18 +19,20 @@ const {
19
19
  getBackToSignInText,
20
20
  } = authenticatorTextUtil;
21
21
 
22
- const ResetPassword: DefaultResetPasswordComponent = ({
22
+ const ResetPassword = ({
23
23
  fields,
24
24
  handleBlur,
25
25
  handleChange,
26
26
  handleSubmit,
27
27
  isPending,
28
28
  toSignIn,
29
+ validationErrors,
29
30
  ...rest
30
- }) => {
31
+ }: DefaultResetPasswordProps): JSX.Element => {
31
32
  const {
32
33
  disableFormSubmit: disabled,
33
34
  fields: fieldsWithHandlers,
35
+ fieldValidationErrors,
34
36
  handleFormSubmit,
35
37
  } = useFieldValues({
36
38
  componentName: COMPONENT_NAME,
@@ -38,6 +40,7 @@ const ResetPassword: DefaultResetPasswordComponent = ({
38
40
  handleBlur,
39
41
  handleChange,
40
42
  handleSubmit,
43
+ validationErrors,
41
44
  });
42
45
 
43
46
  const headerText = getResetYourPasswordText();
@@ -69,6 +72,7 @@ const ResetPassword: DefaultResetPasswordComponent = ({
69
72
  headerText={headerText}
70
73
  fields={fieldsWithHandlers}
71
74
  isPending={isPending}
75
+ validationErrors={fieldValidationErrors}
72
76
  />
73
77
  );
74
78
  };
@@ -21,6 +21,7 @@ const props = {
21
21
  handleBlur: jest.fn(),
22
22
  handleChange: jest.fn(),
23
23
  handleSubmit: jest.fn(),
24
+ hasValidationErrors: false,
24
25
  Header: ResetPassword.Header,
25
26
  isPending: false,
26
27
  toSignIn: jest.fn(),
@@ -11,7 +11,7 @@ Array [
11
11
  },
12
12
  Object {
13
13
  "fontSize": 24,
14
- "fontWeight": "300",
14
+ "fontWeight": "500",
15
15
  "lineHeight": 36,
16
16
  },
17
17
  Object {
@@ -35,6 +35,7 @@ Array [
35
35
  Array [
36
36
  Object {
37
37
  "alignItems": "flex-start",
38
+ "marginBottom": 8,
38
39
  },
39
40
  Object {
40
41
  "paddingHorizontal": 12,
@@ -49,9 +50,9 @@ Array [
49
50
  style={
50
51
  Array [
51
52
  Object {
52
- "fontSize": 14,
53
+ "fontSize": 16,
53
54
  "fontWeight": "400",
54
- "lineHeight": 21,
55
+ "lineHeight": 24,
55
56
  },
56
57
  Object {
57
58
  "color": "hsl(210, 50%, 10%)",
@@ -59,8 +60,7 @@ Array [
59
60
  Array [
60
61
  Object {
61
62
  "color": "hsl(210, 25%, 25%)",
62
- "lineHeight": 21,
63
- "padding": 4,
63
+ "paddingVertical": 8,
64
64
  },
65
65
  undefined,
66
66
  ],
@@ -102,6 +102,7 @@ Array [
102
102
  "color": "hsl(210, 50%, 10%)",
103
103
  "flexGrow": 1,
104
104
  "fontSize": 16,
105
+ "paddingHorizontal": 4,
105
106
  "paddingVertical": 12,
106
107
  },
107
108
  Object {},
@@ -201,8 +202,7 @@ Array [
201
202
  },
202
203
  undefined,
203
204
  Object {
204
- "marginHorizontal": 16,
205
- "marginVertical": 12,
205
+ "margin": 12,
206
206
  },
207
207
  ]
208
208
  }
@@ -296,7 +296,7 @@ Array [
296
296
  },
297
297
  Object {
298
298
  "fontSize": 24,
299
- "fontWeight": "300",
299
+ "fontWeight": "500",
300
300
  "lineHeight": 36,
301
301
  },
302
302
  Object {
@@ -320,6 +320,7 @@ Array [
320
320
  Array [
321
321
  Object {
322
322
  "alignItems": "flex-start",
323
+ "marginBottom": 8,
323
324
  },
324
325
  Object {
325
326
  "paddingHorizontal": 12,
@@ -334,9 +335,9 @@ Array [
334
335
  style={
335
336
  Array [
336
337
  Object {
337
- "fontSize": 14,
338
+ "fontSize": 16,
338
339
  "fontWeight": "400",
339
- "lineHeight": 21,
340
+ "lineHeight": 24,
340
341
  },
341
342
  Object {
342
343
  "color": "hsl(210, 50%, 10%)",
@@ -344,8 +345,7 @@ Array [
344
345
  Array [
345
346
  Object {
346
347
  "color": "hsl(210, 25%, 25%)",
347
- "lineHeight": 21,
348
- "padding": 4,
348
+ "paddingVertical": 8,
349
349
  },
350
350
  undefined,
351
351
  ],
@@ -387,6 +387,7 @@ Array [
387
387
  "color": "hsl(210, 50%, 10%)",
388
388
  "flexGrow": 1,
389
389
  "fontSize": 16,
390
+ "paddingHorizontal": 4,
390
391
  "paddingVertical": 12,
391
392
  },
392
393
  Object {},
@@ -427,8 +428,7 @@ Array [
427
428
  },
428
429
  undefined,
429
430
  Object {
430
- "marginHorizontal": 16,
431
- "marginVertical": 12,
431
+ "margin": 12,
432
432
  },
433
433
  ]
434
434
  }
@@ -12,7 +12,7 @@ import {
12
12
  } from '../../common';
13
13
  import { useFieldValues } from '../../hooks';
14
14
 
15
- import { DefaultSetupTOTPComponent } from '../types';
15
+ import { DefaultSetupTOTPProps } from '../types';
16
16
  import { styles } from './styles';
17
17
 
18
18
  const COMPONENT_NAME = 'SetupTOTP';
@@ -25,7 +25,7 @@ const {
25
25
  getSetupTOTPInstructionsText,
26
26
  } = authenticatorTextUtil;
27
27
 
28
- const SetupTOTP: DefaultSetupTOTPComponent = ({
28
+ const SetupTOTP = ({
29
29
  fields,
30
30
  handleBlur,
31
31
  handleChange,
@@ -33,11 +33,13 @@ const SetupTOTP: DefaultSetupTOTPComponent = ({
33
33
  isPending,
34
34
  toSignIn,
35
35
  totpSecretCode,
36
+ validationErrors,
36
37
  ...rest
37
- }) => {
38
+ }: DefaultSetupTOTPProps): JSX.Element => {
38
39
  const {
39
40
  disableFormSubmit: disabled,
40
41
  fields: fieldsWithHandlers,
42
+ fieldValidationErrors,
41
43
  handleFormSubmit,
42
44
  } = useFieldValues({
43
45
  componentName: COMPONENT_NAME,
@@ -45,6 +47,7 @@ const SetupTOTP: DefaultSetupTOTPComponent = ({
45
47
  handleBlur,
46
48
  handleChange,
47
49
  handleSubmit,
50
+ validationErrors,
48
51
  });
49
52
 
50
53
  const headerText = getSetupTOTPText();
@@ -88,6 +91,7 @@ const SetupTOTP: DefaultSetupTOTPComponent = ({
88
91
  headerText={headerText}
89
92
  fields={fieldsWithHandlers}
90
93
  isPending={isPending}
94
+ validationErrors={fieldValidationErrors}
91
95
  />
92
96
  );
93
97
  };
@@ -22,6 +22,7 @@ const props = {
22
22
  handleBlur: jest.fn(),
23
23
  handleChange: jest.fn(),
24
24
  handleSubmit: jest.fn(),
25
+ hasValidationErrors: false,
25
26
  isPending: false,
26
27
  toSignIn,
27
28
  totpSecretCode: "Let's keep it hush hush",