@aws-amplify/ui-react-native 1.2.17 → 1.2.19

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 (81) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/Authenticator/Authenticator.d.ts +6 -12
  3. package/dist/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.js +15 -4
  4. package/dist/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.js +13 -3
  5. package/dist/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.js +13 -3
  6. package/dist/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.js +13 -3
  7. package/dist/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.js +15 -4
  8. package/dist/Authenticator/Defaults/ResetPassword/ResetPassword.js +13 -3
  9. package/dist/Authenticator/Defaults/SetupTOTP/SetupTOTP.js +13 -3
  10. package/dist/Authenticator/Defaults/SignIn/SignIn.js +3 -2
  11. package/dist/Authenticator/Defaults/SignUp/SignUp.js +9 -3
  12. package/dist/Authenticator/Defaults/VerifyUser/VerifyUser.js +3 -3
  13. package/dist/Authenticator/common/DefaultContent/DefaultContent.js +2 -2
  14. package/dist/InAppMessaging/components/BannerMessage/types.d.ts +1 -1
  15. package/dist/InAppMessaging/components/CarouselMessage/types.d.ts +1 -1
  16. package/dist/InAppMessaging/components/FullScreenMessage/types.d.ts +1 -1
  17. package/dist/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.js +1 -1
  18. package/dist/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.d.ts +1 -1
  19. package/dist/InAppMessaging/components/InAppMessageDisplay/types.d.ts +1 -1
  20. package/dist/InAppMessaging/components/MessageLayout/types.d.ts +1 -1
  21. package/dist/InAppMessaging/components/ModalMessage/types.d.ts +1 -1
  22. package/dist/InAppMessaging/components/withInAppMessaging/withInAppMessaging.js +1 -1
  23. package/dist/InAppMessaging/hooks/useMessageImage/useMessageImage.d.ts +1 -1
  24. package/dist/InAppMessaging/hooks/useMessageImage/utils.d.ts +1 -1
  25. package/dist/InAppMessaging/hooks/useMessageProps/types.d.ts +1 -1
  26. package/dist/InAppMessaging/hooks/useMessageProps/useMessageProps.d.ts +1 -1
  27. package/dist/InAppMessaging/hooks/useMessageProps/utils.d.ts +1 -1
  28. package/dist/InAppMessaging/index.d.ts +1 -1
  29. package/dist/InAppMessaging/index.js +1 -1
  30. package/dist/primitives/Radio/styles.js +2 -1
  31. package/dist/version.d.ts +1 -1
  32. package/dist/version.js +1 -1
  33. package/package.json +4 -3
  34. package/src/Authenticator/Defaults/ConfirmResetPassword/ConfirmResetPassword.tsx +19 -3
  35. package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/ConfirmResetPassword.spec.tsx +1 -0
  36. package/src/Authenticator/Defaults/ConfirmResetPassword/__tests__/__snapshots__/ConfirmResetPassword.spec.tsx.snap +13 -0
  37. package/src/Authenticator/Defaults/ConfirmSignIn/ConfirmSignIn.tsx +17 -3
  38. package/src/Authenticator/Defaults/ConfirmSignIn/__tests__/__snapshots__/ConfirmSignIn.spec.tsx.snap +13 -0
  39. package/src/Authenticator/Defaults/ConfirmSignUp/ConfirmSignUp.tsx +17 -3
  40. package/src/Authenticator/Defaults/ConfirmSignUp/__tests__/__snapshots__/ConfirmSignUp.spec.tsx.snap +19 -0
  41. package/src/Authenticator/Defaults/ConfirmVerifyUser/ConfirmVerifyUser.tsx +17 -3
  42. package/src/Authenticator/Defaults/ConfirmVerifyUser/__tests__/__snapshots__/ConfirmVerifyUser.spec.tsx.snap +19 -0
  43. package/src/Authenticator/Defaults/ForceNewPassword/ForceNewPassword.tsx +19 -3
  44. package/src/Authenticator/Defaults/ForceNewPassword/__tests__/ForceNewPassword.spec.tsx +1 -0
  45. package/src/Authenticator/Defaults/ForceNewPassword/__tests__/__snapshots__/ForceNewPassword.spec.tsx.snap +19 -0
  46. package/src/Authenticator/Defaults/ResetPassword/ResetPassword.tsx +17 -3
  47. package/src/Authenticator/Defaults/ResetPassword/__tests__/__snapshots__/ResetPassword.spec.tsx.snap +13 -0
  48. package/src/Authenticator/Defaults/SetupTOTP/SetupTOTP.tsx +17 -3
  49. package/src/Authenticator/Defaults/SetupTOTP/__tests__/__snapshots__/SetupTOTP.spec.tsx.snap +13 -0
  50. package/src/Authenticator/Defaults/SignIn/SignIn.tsx +7 -2
  51. package/src/Authenticator/Defaults/SignIn/__tests__/__snapshots__/SignIn.spec.tsx.snap +19 -0
  52. package/src/Authenticator/Defaults/SignUp/SignUp.tsx +13 -2
  53. package/src/Authenticator/Defaults/SignUp/__tests__/SignUp.spec.tsx +1 -0
  54. package/src/Authenticator/Defaults/SignUp/__tests__/__snapshots__/SignUp.spec.tsx.snap +31 -0
  55. package/src/Authenticator/Defaults/VerifyUser/VerifyUser.tsx +7 -3
  56. package/src/Authenticator/Defaults/VerifyUser/__tests__/__snapshots__/VerifyUser.spec.tsx.snap +19 -0
  57. package/src/Authenticator/common/DefaultContent/DefaultContent.tsx +2 -0
  58. package/src/InAppMessaging/components/BannerMessage/types.ts +1 -1
  59. package/src/InAppMessaging/components/CarouselMessage/CarouselMessage.tsx +1 -1
  60. package/src/InAppMessaging/components/CarouselMessage/types.ts +1 -1
  61. package/src/InAppMessaging/components/FullScreenMessage/types.ts +1 -1
  62. package/src/InAppMessaging/components/InAppMessageDisplay/InAppMessageDisplay.tsx +1 -1
  63. package/src/InAppMessaging/components/InAppMessageDisplay/__tests__/InAppMessageDisplay.spec.tsx +5 -2
  64. package/src/InAppMessaging/components/InAppMessageDisplay/handleMessageLinkAction.ts +1 -1
  65. package/src/InAppMessaging/components/InAppMessageDisplay/types.ts +1 -1
  66. package/src/InAppMessaging/components/MessageLayout/types.ts +1 -1
  67. package/src/InAppMessaging/components/ModalMessage/types.ts +1 -1
  68. package/src/InAppMessaging/components/withInAppMessaging/withInAppMessaging.tsx +1 -1
  69. package/src/InAppMessaging/hooks/useMessageImage/__tests__/useMessageImage.spec.ts +1 -1
  70. package/src/InAppMessaging/hooks/useMessageImage/useMessageImage.ts +4 -1
  71. package/src/InAppMessaging/hooks/useMessageImage/utils.ts +1 -1
  72. package/src/InAppMessaging/hooks/useMessageProps/__tests__/useMessageProps.spec.ts +1 -1
  73. package/src/InAppMessaging/hooks/useMessageProps/__tests__/utils.spec.ts +1 -1
  74. package/src/InAppMessaging/hooks/useMessageProps/types.ts +4 -1
  75. package/src/InAppMessaging/hooks/useMessageProps/useMessageProps.ts +1 -1
  76. package/src/InAppMessaging/hooks/useMessageProps/utils.ts +1 -1
  77. package/src/InAppMessaging/index.ts +1 -1
  78. package/src/primitives/Radio/__tests__/__snapshots__/Radio.spec.tsx.snap +9 -0
  79. package/src/primitives/Radio/styles.ts +2 -1
  80. package/src/primitives/RadioGroup/__tests__/__snapshots__/RadioGroup.spec.tsx.snap +24 -0
  81. package/src/version.ts +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @aws-amplify/ui-react-native
2
2
 
3
+ ## 1.2.19
4
+
5
+ ### Patch Changes
6
+
7
+ - [#4111](https://github.com/aws-amplify/amplify-ui/pull/4111) [`6f4b296fd`](https://github.com/aws-amplify/amplify-ui/commit/6f4b296fdbe73e1b8a37bede2e85d1ea8d819a54) Thanks [@calebpollman](https://github.com/calebpollman)! - fix(react-native): add spacing between Radio icon and label
8
+
9
+ - [#4013](https://github.com/aws-amplify/amplify-ui/pull/4013) [`23180b470`](https://github.com/aws-amplify/amplify-ui/commit/23180b470c7b3b78a5970d00f8c2dc5ce8773eff) Thanks [@calebpollman](https://github.com/calebpollman)! - chore(ui-react-native): disable Authenticator submit button on invalid form
10
+
11
+ - Updated dependencies [[`23180b470`](https://github.com/aws-amplify/amplify-ui/commit/23180b470c7b3b78a5970d00f8c2dc5ce8773eff), [`3cecd0765`](https://github.com/aws-amplify/amplify-ui/commit/3cecd0765b46c77c49af24fae7cfb9054ebe2cdb)]:
12
+ - @aws-amplify/ui-react-core@2.1.24
13
+ - @aws-amplify/ui@5.6.5
14
+ - @aws-amplify/ui-react-core-notifications@1.0.1
15
+
16
+ ## 1.2.18
17
+
18
+ ### Patch Changes
19
+
20
+ - [#3901](https://github.com/aws-amplify/amplify-ui/pull/3901) [`7f59b3c4d`](https://github.com/aws-amplify/amplify-ui/commit/7f59b3c4dd27205a35c1b07ddc0f06a0db9de776) Thanks [@sreeramsama](https://github.com/sreeramsama)! - - Adds new `ui-react-core-notifications` package for utilities related to the Notifications category, and new `ui-react-notifications` package for components like InAppMessaging. Also sets deprecation messages for `InAppMessagingDisplay`, `InAppMessagingProvider` and `useInAppMessaging` in `ui-react` package as they will be moved out in a future breaking change release.
21
+ - Adds new `ui-react-geo` package for Geo related components like `MapView` and `LocationSearch`. They will be moved out from `ui-react` in a future breaking change release.
22
+ - Updated dependencies [[`7f59b3c4d`](https://github.com/aws-amplify/amplify-ui/commit/7f59b3c4dd27205a35c1b07ddc0f06a0db9de776), [`ca591a2fc`](https://github.com/aws-amplify/amplify-ui/commit/ca591a2fc319556f705be74bacd141d48f3531bd)]:
23
+ - @aws-amplify/ui-react-core-notifications@1.0.0
24
+ - @aws-amplify/ui-react-core@2.1.23
25
+ - @aws-amplify/ui@5.6.4
26
+
3
27
  ## 1.2.17
4
28
 
5
29
  ### Patch Changes
@@ -8,15 +8,13 @@ declare namespace Authenticator {
8
8
  var Provider: typeof import("@aws-amplify/ui-react-core").AuthenticatorProvider;
9
9
  var ConfirmResetPassword: (React.ComponentClass<import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
10
10
  resendCode: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
11
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
12
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
11
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
13
12
  fields: import("./hooks").TextFieldOptionsType[];
14
13
  } & {
15
14
  style?: import("./Defaults/types").ConfirmResetPasswordStyle | undefined;
16
15
  }, any> | React.FunctionComponent<import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
17
16
  resendCode: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
18
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
19
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
17
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
20
18
  fields: import("./hooks").TextFieldOptionsType[];
21
19
  } & {
22
20
  style?: import("./Defaults/types").ConfirmResetPasswordStyle | undefined;
@@ -66,15 +64,13 @@ declare namespace Authenticator {
66
64
  }>) & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType>;
67
65
  var ForceNewPassword: (React.ComponentClass<import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
68
66
  toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
69
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
70
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
67
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
71
68
  fields: import("./hooks").TextFieldOptionsType[];
72
69
  } & {
73
70
  style?: import("./Defaults/types").ForceNewPasswordStyle | undefined;
74
71
  }, any> | React.FunctionComponent<import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ComponentSlots<import("./hooks").TextFieldOptionsType> & {
75
72
  toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
76
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
77
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
73
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
78
74
  fields: import("./hooks").TextFieldOptionsType[];
79
75
  } & {
80
76
  style?: import("./Defaults/types").ForceNewPasswordStyle | undefined;
@@ -130,8 +126,7 @@ declare namespace Authenticator {
130
126
  hideSignIn?: boolean | undefined;
131
127
  toFederatedSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
132
128
  toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
133
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
134
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
129
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
135
130
  fields: import("./hooks").TextFieldOptionsType[];
136
131
  } & {
137
132
  style?: import("./Defaults/types").SignUpStyle | undefined;
@@ -139,8 +134,7 @@ declare namespace Authenticator {
139
134
  hideSignIn?: boolean | undefined;
140
135
  toFederatedSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
141
136
  toSignIn: (data?: import("@aws-amplify/ui").AuthEventData | undefined) => void;
142
- validationErrors?: import("@aws-amplify/ui").ValidationError | undefined;
143
- } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & {
137
+ } & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").CommonRouteProps & import("@aws-amplify/ui-react-core/dist/types/Authenticator/hooks").ValidationProps & {
144
138
  fields: import("./hooks").TextFieldOptionsType[];
145
139
  } & {
146
140
  style?: import("./Defaults/types").SignUpStyle | undefined;
@@ -4,21 +4,32 @@ import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, }
4
4
  import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ConfirmResetPassword';
6
6
  const { getResetYourPasswordText, getSubmitText, getSubmittingText, getResendCodeText, } = authenticatorTextUtil;
7
- const ConfirmResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPending, resendCode, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
7
+ const ConfirmResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, resendCode, ...rest }) => {
8
+ const { disableFormSubmit, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
12
12
  handleChange,
13
13
  handleSubmit,
14
14
  });
15
+ const disabled = hasValidationErrors || disableFormSubmit;
15
16
  const headerText = getResetYourPasswordText();
16
17
  const primaryButtonText = isPending ? getSubmittingText() : getSubmitText();
17
18
  const secondaryButtonText = getResendCodeText();
18
19
  const buttons = useMemo(() => ({
19
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
20
+ primary: {
21
+ children: primaryButtonText,
22
+ disabled,
23
+ onPress: handleFormSubmit,
24
+ },
20
25
  secondary: { children: secondaryButtonText, onPress: resendCode },
21
- }), [handleFormSubmit, primaryButtonText, resendCode, secondaryButtonText]);
26
+ }), [
27
+ disabled,
28
+ handleFormSubmit,
29
+ primaryButtonText,
30
+ resendCode,
31
+ secondaryButtonText,
32
+ ]);
22
33
  return (<DefaultContent {...rest} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
23
34
  };
24
35
  ConfirmResetPassword.Footer = DefaultFooter;
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ConfirmSignIn';
6
6
  const { getBackToSignInText, getChallengeText, getConfirmText, getConfirmingText, } = authenticatorTextUtil;
7
7
  const ConfirmSignIn = ({ challengeName, fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -16,9 +16,19 @@ const ConfirmSignIn = ({ challengeName, fields, handleBlur, handleChange, handle
16
16
  const primaryButtonText = isPending ? getConfirmingText() : getConfirmText();
17
17
  const secondaryButtonText = getBackToSignInText();
18
18
  const buttons = useMemo(() => ({
19
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
19
+ primary: {
20
+ children: primaryButtonText,
21
+ disabled,
22
+ onPress: handleFormSubmit,
23
+ },
20
24
  links: [{ children: secondaryButtonText, onPress: toSignIn }],
21
- }), [handleFormSubmit, primaryButtonText, secondaryButtonText, toSignIn]);
25
+ }), [
26
+ disabled,
27
+ handleFormSubmit,
28
+ primaryButtonText,
29
+ secondaryButtonText,
30
+ toSignIn,
31
+ ]);
22
32
  return (<DefaultContent {...rest} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
23
33
  };
24
34
  ConfirmSignIn.Footer = DefaultFooter;
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ConfirmSignUp';
6
6
  const { getDeliveryMethodText, getDeliveryMessageText, getConfirmingText, getConfirmText, getResendCodeText, } = authenticatorTextUtil;
7
7
  const ConfirmSignUp = ({ codeDeliveryDetails, fields, handleBlur, handleChange, handleSubmit, isPending, resendCode, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -17,9 +17,19 @@ const ConfirmSignUp = ({ codeDeliveryDetails, fields, handleBlur, handleChange,
17
17
  const primaryButtonText = isPending ? getConfirmingText() : getConfirmText();
18
18
  const secondaryButtonText = getResendCodeText();
19
19
  const buttons = useMemo(() => ({
20
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
20
+ primary: {
21
+ children: primaryButtonText,
22
+ disabled,
23
+ onPress: handleFormSubmit,
24
+ },
21
25
  secondary: { children: secondaryButtonText, onPress: resendCode },
22
- }), [handleFormSubmit, primaryButtonText, resendCode, secondaryButtonText]);
26
+ }), [
27
+ disabled,
28
+ handleFormSubmit,
29
+ primaryButtonText,
30
+ resendCode,
31
+ secondaryButtonText,
32
+ ]);
23
33
  return (<DefaultContent {...rest} body={bodyText} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
24
34
  };
25
35
  ConfirmSignUp.FormFields = DefaultTextFormFields;
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ConfirmVerifyUser';
6
6
  const { getAccountRecoveryInfoText, getSkipText, getSubmitText, getSubmittingText, } = authenticatorTextUtil;
7
7
  const ConfirmVerifyUser = ({ fields, handleBlur, handleChange, handleSubmit, isPending, skipVerification, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -16,9 +16,19 @@ const ConfirmVerifyUser = ({ fields, handleBlur, handleChange, handleSubmit, isP
16
16
  const primaryButtonText = isPending ? getSubmittingText() : getSubmitText();
17
17
  const secondaryButtonText = getSkipText();
18
18
  const buttons = useMemo(() => ({
19
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
19
+ primary: {
20
+ children: primaryButtonText,
21
+ disabled,
22
+ onPress: handleFormSubmit,
23
+ },
20
24
  links: [{ children: secondaryButtonText, onPress: skipVerification }],
21
- }), [handleFormSubmit, primaryButtonText, skipVerification, secondaryButtonText]);
25
+ }), [
26
+ disabled,
27
+ handleFormSubmit,
28
+ primaryButtonText,
29
+ skipVerification,
30
+ secondaryButtonText,
31
+ ]);
22
32
  return (<DefaultContent {...rest} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
23
33
  };
24
34
  ConfirmVerifyUser.Footer = DefaultFooter;
@@ -4,23 +4,34 @@ import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, }
4
4
  import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ForceNewPassword';
6
6
  const { getChangePasswordText, getChangingText, getBackToSignInText } = authenticatorTextUtil;
7
- const ForceNewPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
7
+ const ForceNewPassword = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, isPending, toSignIn, ...rest }) => {
8
+ const { disableFormSubmit, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
12
12
  handleChange,
13
13
  handleSubmit,
14
14
  });
15
+ const disabled = hasValidationErrors || disableFormSubmit;
15
16
  const headerText = getChangePasswordText();
16
17
  const primaryButtonText = isPending
17
18
  ? getChangingText()
18
19
  : getChangePasswordText();
19
20
  const secondaryButtonText = getBackToSignInText();
20
21
  const buttons = useMemo(() => ({
21
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
22
+ primary: {
23
+ children: primaryButtonText,
24
+ disabled,
25
+ onPress: handleFormSubmit,
26
+ },
22
27
  links: [{ children: secondaryButtonText, onPress: toSignIn }],
23
- }), [handleFormSubmit, primaryButtonText, secondaryButtonText, toSignIn]);
28
+ }), [
29
+ disabled,
30
+ handleFormSubmit,
31
+ primaryButtonText,
32
+ secondaryButtonText,
33
+ toSignIn,
34
+ ]);
24
35
  return (<DefaultContent {...rest} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
25
36
  };
26
37
  ForceNewPassword.Footer = DefaultFooter;
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'ResetPassword';
6
6
  const { getResetYourPasswordText, getSendCodeText, getSendingText, getBackToSignInText, } = authenticatorTextUtil;
7
7
  const ResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -16,9 +16,19 @@ const ResetPassword = ({ fields, handleBlur, handleChange, handleSubmit, isPendi
16
16
  const primaryButtonText = isPending ? getSendingText() : getSendCodeText();
17
17
  const secondaryButtonText = getBackToSignInText();
18
18
  const buttons = useMemo(() => ({
19
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
19
+ primary: {
20
+ children: primaryButtonText,
21
+ disabled,
22
+ onPress: handleFormSubmit,
23
+ },
20
24
  links: [{ children: secondaryButtonText, onPress: toSignIn }],
21
- }), [handleFormSubmit, primaryButtonText, secondaryButtonText, toSignIn]);
25
+ }), [
26
+ disabled,
27
+ handleFormSubmit,
28
+ primaryButtonText,
29
+ secondaryButtonText,
30
+ toSignIn,
31
+ ]);
22
32
  return (<DefaultContent {...rest} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
23
33
  };
24
34
  ResetPassword.Footer = DefaultFooter;
@@ -7,7 +7,7 @@ import { styles } from './styles';
7
7
  const COMPONENT_NAME = 'SetupTOTP';
8
8
  const { getBackToSignInText, getConfirmingText, getConfirmText, getSetupTOTPText, getSetupTOTPInstructionsText, } = authenticatorTextUtil;
9
9
  const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending, toSignIn, totpSecretCode, ...rest }) => {
10
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
10
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
11
11
  componentName: COMPONENT_NAME,
12
12
  fields,
13
13
  handleBlur,
@@ -26,9 +26,19 @@ const SetupTOTP = ({ fields, handleBlur, handleChange, handleSubmit, isPending,
26
26
  </Label>
27
27
  </>);
28
28
  const buttons = useMemo(() => ({
29
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
29
+ primary: {
30
+ children: primaryButtonText,
31
+ disabled,
32
+ onPress: handleFormSubmit,
33
+ },
30
34
  links: [{ children: secondaryButtonText, onPress: toSignIn }],
31
- }), [handleFormSubmit, primaryButtonText, secondaryButtonText, toSignIn]);
35
+ }), [
36
+ disabled,
37
+ handleFormSubmit,
38
+ primaryButtonText,
39
+ secondaryButtonText,
40
+ toSignIn,
41
+ ]);
32
42
  return (<DefaultContent {...rest} body={body} buttons={buttons} headerText={headerText} fields={fieldsWithHandlers} isPending={isPending}/>);
33
43
  };
34
44
  SetupTOTP.Footer = DefaultFooter;
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'SignIn';
6
6
  const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, toResetPassword, toSignUp, ...rest }) => {
7
7
  const { getSignInTabText, getSignInText, getSignUpTabText, getForgotPasswordText, } = authenticatorTextUtil;
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -22,12 +22,13 @@ const SignIn = ({ fields, handleBlur, handleChange, handleSubmit, hideSignUp, to
22
22
  onPress: toResetPassword,
23
23
  };
24
24
  return {
25
- primary: { children: signInText, onPress: handleFormSubmit },
25
+ primary: { children: signInText, disabled, onPress: handleFormSubmit },
26
26
  links: hideSignUp
27
27
  ? [forgotPassword]
28
28
  : [forgotPassword, { children: signUpText, onPress: toSignUp }],
29
29
  };
30
30
  }, [
31
+ disabled,
31
32
  forgotPasswordText,
32
33
  handleFormSubmit,
33
34
  hideSignUp,
@@ -4,25 +4,31 @@ import { DefaultContent, DefaultFooter, DefaultTextFormFields, DefaultHeader, }
4
4
  import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'SignUp';
6
6
  const { getCreateAccountText, getCreatingAccountText, getSignInTabText, getSignUpTabText, } = authenticatorTextUtil;
7
- const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hideSignIn, isPending, toSignIn, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
7
+ const SignUp = ({ fields, handleBlur, handleChange, handleSubmit, hasValidationErrors, hideSignIn, isPending, toSignIn, ...rest }) => {
8
+ const { disableFormSubmit, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
12
12
  handleChange,
13
13
  handleSubmit,
14
14
  });
15
+ const disabled = hasValidationErrors || disableFormSubmit;
15
16
  const headerText = getSignUpTabText();
16
17
  const primaryButtonText = isPending
17
18
  ? getCreatingAccountText()
18
19
  : getCreateAccountText();
19
20
  const secondaryButtonText = getSignInTabText();
20
21
  const buttons = useMemo(() => ({
21
- primary: { children: primaryButtonText, onPress: handleFormSubmit },
22
+ primary: {
23
+ children: primaryButtonText,
24
+ disabled,
25
+ onPress: handleFormSubmit,
26
+ },
22
27
  links: hideSignIn
23
28
  ? undefined
24
29
  : [{ children: secondaryButtonText, onPress: toSignIn }],
25
30
  }), [
31
+ disabled,
26
32
  handleFormSubmit,
27
33
  hideSignIn,
28
34
  primaryButtonText,
@@ -5,7 +5,7 @@ import { useFieldValues } from '../../hooks';
5
5
  const COMPONENT_NAME = 'VerifyUser';
6
6
  const { getSkipText, getVerifyContactText, getVerifyText, getAccountRecoveryInfoText, } = authenticatorTextUtil;
7
7
  const VerifyUser = ({ fields, handleBlur, handleChange, handleSubmit, skipVerification, ...rest }) => {
8
- const { fields: fieldsWithHandlers, handleFormSubmit } = useFieldValues({
8
+ const { disableFormSubmit: disabled, fields: fieldsWithHandlers, handleFormSubmit, } = useFieldValues({
9
9
  componentName: COMPONENT_NAME,
10
10
  fields,
11
11
  handleBlur,
@@ -17,9 +17,9 @@ const VerifyUser = ({ fields, handleBlur, handleChange, handleSubmit, skipVerifi
17
17
  const verifyText = getVerifyText();
18
18
  const bodyText = getAccountRecoveryInfoText();
19
19
  const buttons = useMemo(() => ({
20
- primary: { children: verifyText, onPress: handleFormSubmit },
20
+ primary: { children: verifyText, disabled, onPress: handleFormSubmit },
21
21
  links: [{ children: skipText, onPress: skipVerification }],
22
- }), [handleFormSubmit, skipText, skipVerification, verifyText]);
22
+ }), [disabled, handleFormSubmit, skipText, skipVerification, verifyText]);
23
23
  return (<DefaultContent {...rest} body={bodyText} buttons={buttons} fields={fieldsWithHandlers} headerText={headerText}/>);
24
24
  };
25
25
  VerifyUser.Footer = DefaultFooter;
@@ -18,10 +18,10 @@ export default function DefaultContent({ body, buttons: { primary, links, second
18
18
  <Header style={themedStyles.header}>{headerText}</Header>
19
19
  {body ? (typeof body === 'string' ? (<Label style={themedStyles.body}>{body}</Label>) : (body)) : null}
20
20
  <FormFields fieldContainerStyle={themedStyles.fieldContainer} fieldErrorsContainer={themedStyles.fieldErrorsContainer} fieldErrorStyle={themedStyles.fieldError} fieldLabelStyle={themedStyles.fieldLabel} fieldStyle={themedStyles.fieldStyle} fields={fields} isPending={isPending} validationErrors={validationErrors} style={themedStyles.formFields}/>
21
- {error ? (<ErrorMessage iconStyle={themedStyles.errorMessageIcon} labelStyle={themedStyles.errorMessageLabel} style={themedStyles.errorMessage}>
21
+ {error ? (<ErrorMessage iconStyle={themedStyles.errorMessageIcon} labelStyle={themedStyles.errorMessageLabel} style={themedStyles.errorMessage} testID="amplify__error-message">
22
22
  {error}
23
23
  </ErrorMessage>) : null}
24
- <Button {...primary} variant="primary" textStyle={themedStyles.buttonPrimaryLabel} style={themedStyles.buttonPrimary}/>
24
+ <Button {...primary} variant="primary" textStyle={themedStyles.buttonPrimaryLabel} style={themedStyles.buttonPrimary} testID="amplify__button"/>
25
25
  {secondary ? (<Button {...secondary} textStyle={themedStyles.buttonSecondaryLabel} style={themedStyles.buttonSecondary}/>) : null}
26
26
  {linkButtons}
27
27
  <Footer style={themedStyles.footer}/>
@@ -1,5 +1,5 @@
1
1
  import { ViewStyle } from 'react-native';
2
- import { BannerMessageCommonProps } from '@aws-amplify/ui-react-core';
2
+ import { BannerMessageCommonProps } from '@aws-amplify/ui-react-core-notifications';
3
3
  import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
4
4
  export interface BannerMessageProps extends BannerMessageCommonProps<MessageOverrideStyle | undefined> {
5
5
  }
@@ -1,5 +1,5 @@
1
1
  import { StyleProp, ViewStyle } from 'react-native';
2
- import { CarouselMessageCommonProps, MessageComponentBaseProps } from '@aws-amplify/ui-react-core';
2
+ import { CarouselMessageCommonProps, MessageComponentBaseProps } from '@aws-amplify/ui-react-core-notifications';
3
3
  import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
4
4
  interface CarouselMessageOverrideStyle extends MessageOverrideStyle {
5
5
  pageIndicatorActive?: StyleProp<ViewStyle>;
@@ -1,4 +1,4 @@
1
- import { FullScreenMessageCommonProps } from '@aws-amplify/ui-react-core';
1
+ import { FullScreenMessageCommonProps } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
3
3
  export interface FullScreenMessageProps extends FullScreenMessageCommonProps<MessageOverrideStyle | undefined> {
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { handleMessageAction, useMessage, } from '@aws-amplify/ui-react-core';
2
+ import { handleMessageAction, useMessage, } from '@aws-amplify/ui-react-core-notifications';
3
3
  import { BannerMessage } from '../BannerMessage';
4
4
  import { FullScreenMessage } from '../FullScreenMessage';
5
5
  import { CarouselMessage } from '../CarouselMessage';
@@ -1,3 +1,3 @@
1
- import { HandleMessageLinkAction } from '@aws-amplify/ui-react-core';
1
+ import { HandleMessageLinkAction } from '@aws-amplify/ui-react-core-notifications';
2
2
  declare const handleMessageLinkAction: HandleMessageLinkAction;
3
3
  export default handleMessageLinkAction;
@@ -1,4 +1,4 @@
1
- import { BannerMessageComponent, CarouselMessageComponent, FullScreenMessageComponent, ModalMessageComponent } from '@aws-amplify/ui-react-core';
1
+ import { BannerMessageComponent, CarouselMessageComponent, FullScreenMessageComponent, ModalMessageComponent } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { BannerMessageProps } from '../BannerMessage';
3
3
  import { CarouselMessageProps } from '../CarouselMessage';
4
4
  import { FullScreenMessageProps } from '../FullScreenMessage';
@@ -1,4 +1,4 @@
1
- import { MessageComponentBaseProps } from '@aws-amplify/ui-react-core';
1
+ import { MessageComponentBaseProps } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { DeviceOrientation } from '../../../hooks';
3
3
  import { MessageComponentStyles, MessageOverrideStyle, UseMessageProps } from '../../hooks';
4
4
  export interface LayoutProps extends Omit<MessageComponentBaseProps<MessageOverrideStyle>, 'style'>, Omit<UseMessageProps, 'shouldRenderMessage' | 'styles'> {
@@ -1,4 +1,4 @@
1
- import { ModalMessageCommonProps } from '@aws-amplify/ui-react-core';
1
+ import { ModalMessageCommonProps } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { MessageDefaultStyle, MessageOverrideStyle } from '../../hooks';
3
3
  export interface ModalMessageProps extends ModalMessageCommonProps<MessageOverrideStyle | undefined> {
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { InAppMessagingProvider } from '@aws-amplify/ui-react-core';
2
+ import { InAppMessagingProvider } from '@aws-amplify/ui-react-core-notifications';
3
3
  import { InAppMessageDisplay } from '../InAppMessageDisplay';
4
4
  export default function withInAppMessaging(Component, options) {
5
5
  return function WrappedWithInAppMessaging(props) {
@@ -1,4 +1,4 @@
1
- import { MessageImage, MessageLayout } from '@aws-amplify/ui-react-core';
1
+ import { MessageImage, MessageLayout } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { UseMessageImage } from './types';
3
3
  /**
4
4
  * Handles prefetching and dimension setting for message images
@@ -1,4 +1,4 @@
1
- import { MessageLayout } from '@aws-amplify/ui-react-core';
1
+ import { MessageLayout } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { ImageDimensions, ImageLoadingState } from './types';
3
3
  export declare const prefetchNetworkImage: (url: string) => Promise<ImageLoadingState>;
4
4
  export declare const getLayoutImageDimensions: (imageHeight: number, imageWidth: number, layout: MessageLayout) => ImageDimensions;
@@ -1,5 +1,5 @@
1
1
  import { ColorValue, ImageStyle, StyleProp, TextStyle, ViewStyle } from 'react-native';
2
- import { MessageLayout, MessagePayloadStyle } from '@aws-amplify/ui-react-core';
2
+ import { MessageLayout, MessagePayloadStyle } from '@aws-amplify/ui-react-core-notifications';
3
3
  import { ButtonProps } from '../../../primitives';
4
4
  import { ImageDimensions } from '../useMessageImage';
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { MessageComponentBaseProps } from '@aws-amplify/ui-react-core';
1
+ import { MessageComponentBaseProps } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { GetDefaultStyle, MessageOverrideStyle, UseMessageProps } from './types';
3
3
  /**
4
4
  * Handle common message UI component prop logic including setting of image dimensions,
@@ -1,4 +1,4 @@
1
- import { MessageComponentBaseProps, MessageLayout, MessagePayloadStyle } from '@aws-amplify/ui-react-core';
1
+ import { MessageComponentBaseProps, MessageLayout, MessagePayloadStyle } from '@aws-amplify/ui-react-core-notifications';
2
2
  import { MessageButtonStyleParams, MessageButtonStyleProps, MessageComponentStyles, MessageContainerAndWrapperStyle, MessageStyleParams } from './types';
3
3
  /**
4
4
  * Parse and assign appropriate button container and text style from style objects params
@@ -1,2 +1,2 @@
1
- export { InAppMessagingProvider, useInAppMessaging, } from '@aws-amplify/ui-react-core';
1
+ export { InAppMessagingProvider, useInAppMessaging, } from '@aws-amplify/ui-react-core-notifications';
2
2
  export { BannerMessageProps, CarouselMessageProps, FullScreenMessageProps, ModalMessageProps, InAppMessageDisplay, MessageComponents, withInAppMessaging, } from './components';
@@ -1,2 +1,2 @@
1
- export { InAppMessagingProvider, useInAppMessaging, } from '@aws-amplify/ui-react-core';
1
+ export { InAppMessagingProvider, useInAppMessaging, } from '@aws-amplify/ui-react-core-notifications';
2
2
  export { InAppMessageDisplay, withInAppMessaging, } from './components';
@@ -2,7 +2,7 @@ import { StyleSheet } from 'react-native';
2
2
  import { RADIO_DOT_PROPORTION } from './getRadioDimensions';
3
3
  const ROUNDED_BORDER_RADIUS = 999;
4
4
  export const getThemedStyles = (theme) => {
5
- const { components, tokens: { colors, fontSizes, opacities, borderWidths }, } = theme;
5
+ const { components, tokens: { colors, fontSizes, opacities, borderWidths, space }, } = theme;
6
6
  return StyleSheet.create({
7
7
  container: {
8
8
  alignItems: 'center',
@@ -22,6 +22,7 @@ export const getThemedStyles = (theme) => {
22
22
  borderRadius: ROUNDED_BORDER_RADIUS,
23
23
  borderWidth: borderWidths.medium,
24
24
  justifyContent: 'center',
25
+ margin: space.xxs,
25
26
  ...components?.radio?.radioContainer,
26
27
  },
27
28
  radioDot: {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "1.2.17";
1
+ export declare const VERSION = "1.2.19";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.2.17';
1
+ export const VERSION = '1.2.19';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/ui-react-native",
3
- "version": "1.2.17",
3
+ "version": "1.2.19",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,8 +37,9 @@
37
37
  "rimraf": "^3.0.2"
38
38
  },
39
39
  "dependencies": {
40
- "@aws-amplify/ui": "5.6.3",
41
- "@aws-amplify/ui-react-core": "2.1.22"
40
+ "@aws-amplify/ui": "5.6.5",
41
+ "@aws-amplify/ui-react-core": "2.1.24",
42
+ "@aws-amplify/ui-react-core-notifications": "1.0.1"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "aws-amplify": ">= 5.0.1",